From: Andrea Bianco Date: Thu, 7 Oct 2021 14:28:45 +0000 (+0200) Subject: Built motion from commit f3da74b7.|2.5.36 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com/%22my-avatar.png//%22%7B%7Blicense.fax?a=commitdiff_plain;h=d646eae03bd21ebf3a78622e636bb975d53a92c3;p=motion2.git Built motion from commit f3da74b7.|2.5.36 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index bacf515..18a886c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-07T14:09:33.697Z", + "time": "2021-10-07T14:21:48.070Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 50b1857..e2dadaf 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-07T14:09:33.697Z", + "time": "2021-10-07T14:21:48.070Z", "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 9a8b957..357a5ee 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 _0x86d2=['STRING','integration','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue'];(function(_0x37d79b,_0x189596){var _0x387f50=function(_0x3eba8d){while(--_0x3eba8d){_0x37d79b['push'](_0x37d79b['shift']());}};_0x387f50(++_0x189596);}(_0x86d2,0x15d));var _0x286d=function(_0x4c18c9,_0x27a9f0){_0x4c18c9=_0x4c18c9-0x0;var _0x9bdb1c=_0x86d2[_0x4c18c9];return _0x9bdb1c;};'use strict';var Sequelize=require('sequelize');module[_0x286d('0x0')]={'name':{'type':Sequelize[_0x286d('0x1')],'get':function(_0x49f3cf){return this[_0x286d('0x2')]('action');}},'action':{'type':Sequelize[_0x286d('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x286d('0x4'),'motionbar',_0x286d('0x5'),'urlForward','browser',_0x286d('0x6'),_0x286d('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x286d('0x8')},'data1':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0x9')},'data2':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x286d('0xb')},'data4':{'type':Sequelize[_0x286d('0x3')](0x1000),'comments':_0x286d('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x286d('0x3')],'comments':_0x286d('0xd')},'data7':{'type':Sequelize[_0x286d('0xe')],'comments':_0x286d('0xf')}}; \ No newline at end of file +var _0xb190=['VIRTUAL','action','contactManager','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports'];(function(_0x292bf8,_0x544454){var _0x1f0f3c=function(_0x1f93c8){while(--_0x1f93c8){_0x292bf8['push'](_0x292bf8['shift']());}};_0x1f0f3c(++_0x544454);}(_0xb190,0xce));var _0x0b19=function(_0x312d77,_0x9c0671){_0x312d77=_0x312d77-0x0;var _0x348c10=_0xb190[_0x312d77];return _0x348c10;};'use strict';var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'name':{'type':Sequelize[_0x0b19('0x2')],'get':function(_0x2ba555){return this['getDataValue'](_0x0b19('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0b19('0x4'),'integration','motionbar','jscripty',_0x0b19('0x5'),_0x0b19('0x6'),_0x0b19('0x7'),'script']],'msg':_0x0b19('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comment':_0x0b19('0xa')},'data3':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comment':_0x0b19('0xb')},'data4':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comments':_0x0b19('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0b19('0xd')},'data6':{'type':Sequelize[_0x0b19('0x9')],'comments':_0x0b19('0xe')},'data7':{'type':Sequelize[_0x0b19('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 72cf740..5b86db4 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 _0x81d4=['util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','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','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x32bdea,_0x5d16ae){var _0x41843a=function(_0x51334c){while(--_0x51334c){_0x32bdea['push'](_0x32bdea['shift']());}};_0x41843a(++_0x5d16ae);}(_0x81d4,0xba));var _0x481d=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x81d4[_0x371b64];return _0x3cf3b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x481d('0x0'));var zipdir=require(_0x481d('0x1'));var jsonpatch=require(_0x481d('0x2'));var rp=require(_0x481d('0x3'));var moment=require('moment');var BPromise=require(_0x481d('0x4'));var Mustache=require(_0x481d('0x5'));var util=require(_0x481d('0x6'));var path=require(_0x481d('0x7'));var sox=require(_0x481d('0x8'));var csv=require('to-csv');var ejs=require(_0x481d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x481d('0xa'));var squel=require(_0x481d('0xb'));var crypto=require(_0x481d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x481d('0xd'));var toCsv=require(_0x481d('0xe'));var querystring=require('querystring');var Papa=require(_0x481d('0xf'));var Redis=require('ioredis');var authService=require(_0x481d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x481d('0x11'));var hardwareService=require(_0x481d('0x12'));var logger=require(_0x481d('0x13'))(_0x481d('0x14'));var utils=require(_0x481d('0x15'));var config=require(_0x481d('0x16'));var licenseUtil=require(_0x481d('0x17'));var db=require(_0x481d('0x18'))['db'];function respondWithStatusCode(_0x543d5b,_0x291b91){_0x291b91=_0x291b91||0xcc;return function(_0x47f060){if(_0x47f060){return _0x543d5b[_0x481d('0x19')](_0x291b91);}return _0x543d5b[_0x481d('0x1a')](_0x291b91)[_0x481d('0x1b')]();};}function respondWithResult(_0x4c3eb1,_0x17f9e7){_0x17f9e7=_0x17f9e7||0xc8;return function(_0x54acb9){if(_0x54acb9){return _0x4c3eb1[_0x481d('0x1a')](_0x17f9e7)[_0x481d('0x1c')](_0x54acb9);}};}function respondWithFilteredResult(_0x3dd471,_0x1d879a){return function(_0x102446){if(_0x102446){var _0x59236f=typeof _0x1d879a[_0x481d('0x1d')]===_0x481d('0x1e')&&typeof _0x1d879a[_0x481d('0x1f')]===_0x481d('0x1e');var _0x5de9ed=_0x102446[_0x481d('0x20')];var _0x355518=_0x59236f?0x0:_0x1d879a['offset'];var _0x5f2739=_0x59236f?_0x102446['count']:_0x1d879a[_0x481d('0x1d')]+_0x1d879a[_0x481d('0x1f')];var _0x3b2540;if(_0x5f2739>=_0x5de9ed){_0x5f2739=_0x5de9ed;_0x3b2540=0xc8;}else{_0x3b2540=0xce;}_0x3dd471[_0x481d('0x1a')](_0x3b2540);return _0x3dd471['set'](_0x481d('0x21'),_0x355518+'-'+_0x5f2739+'/'+_0x5de9ed)[_0x481d('0x1c')](_0x102446);}return null;};}function patchUpdates(_0x421b2a){return function(_0x291d1e){try{jsonpatch[_0x481d('0x22')](_0x291d1e,_0x421b2a,!![]);}catch(_0x54abb8){return BPromise[_0x481d('0x23')](_0x54abb8);}return _0x291d1e[_0x481d('0x24')]();};}function saveUpdates(_0x11fb9b,_0x192329){return function(_0x11a52e){if(_0x11a52e){return _0x11a52e[_0x481d('0x25')](_0x11fb9b)['then'](function(_0x1e346a){return _0x1e346a;});}return null;};}function removeEntity(_0x23583f,_0x5ddcc8){return function(_0x2d77ba){if(_0x2d77ba){return _0x2d77ba['destroy']()[_0x481d('0x26')](function(){_0x23583f[_0x481d('0x1a')](0xcc)[_0x481d('0x1b')]();});}};}function handleEntityNotFound(_0x359bfb,_0x2b3056){return function(_0x5c9dbf){if(!_0x5c9dbf){_0x359bfb[_0x481d('0x19')](0x194);}return _0x5c9dbf;};}function handleError(_0x1825b8,_0x5b856b){_0x5b856b=_0x5b856b||0x1f4;return function(_0x360849){logger[_0x481d('0x27')](_0x360849[_0x481d('0x28')]);if(_0x360849[_0x481d('0x29')]){delete _0x360849['name'];}_0x1825b8['status'](_0x5b856b)[_0x481d('0x2a')](_0x360849);};}exports[_0x481d('0x25')]=function(_0x5efa3c,_0x1bdab8){if(_0x5efa3c[_0x481d('0x2b')]['id']){delete _0x5efa3c['body']['id'];}return db[_0x481d('0x2c')][_0x481d('0x2d')]({'where':{'id':_0x5efa3c[_0x481d('0x2e')]['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1bdab8,null))[_0x481d('0x26')](saveUpdates(_0x5efa3c[_0x481d('0x2b')],null))[_0x481d('0x26')](respondWithResult(_0x1bdab8,null))[_0x481d('0x2f')](handleError(_0x1bdab8,null));};exports['destroy']=function(_0x4fc4e0,_0x1b5d42){return db['Action']['find']({'where':{'id':_0x4fc4e0['params']['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1b5d42,null))[_0x481d('0x26')](removeEntity(_0x1b5d42,null))[_0x481d('0x2f')](handleError(_0x1b5d42,null));}; \ No newline at end of file +var _0xd9e1=['eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','limit','undefined','offset','set','json','apply','update','then','error','stack','name','send','body','Action','find','catch','destroy','params'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd9e1,0x150));var _0x1d9e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd9e1[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x1d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d9e('0x2'));var moment=require(_0x1d9e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d9e('0x4'));var path=require(_0x1d9e('0x5'));var sox=require(_0x1d9e('0x6'));var csv=require(_0x1d9e('0x7'));var ejs=require(_0x1d9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1d9e('0x9'));var _=require(_0x1d9e('0xa'));var squel=require(_0x1d9e('0xb'));var crypto=require(_0x1d9e('0xc'));var jsforce=require(_0x1d9e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1d9e('0x7'));var querystring=require(_0x1d9e('0xe'));var Papa=require(_0x1d9e('0xf'));var Redis=require(_0x1d9e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d9e('0x11'));var as=require(_0x1d9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d9e('0x13'))('api');var utils=require(_0x1d9e('0x14'));var config=require(_0x1d9e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716c57,_0xe1b783){_0xe1b783=_0xe1b783||0xcc;return function(_0x28fc4f){if(_0x28fc4f){return _0x716c57['sendStatus'](_0xe1b783);}return _0x716c57[_0x1d9e('0x16')](_0xe1b783)[_0x1d9e('0x17')]();};}function respondWithResult(_0x583347,_0x60b17b){_0x60b17b=_0x60b17b||0xc8;return function(_0x2150cd){if(_0x2150cd){return _0x583347[_0x1d9e('0x16')](_0x60b17b)['json'](_0x2150cd);}};}function respondWithFilteredResult(_0x58ec3a,_0x3d4e25){return function(_0x1f05a0){if(_0x1f05a0){var _0x46cb3c=typeof _0x3d4e25['offset']==='undefined'&&typeof _0x3d4e25[_0x1d9e('0x18')]===_0x1d9e('0x19');var _0x4177f2=_0x1f05a0['count'];var _0xd6de89=_0x46cb3c?0x0:_0x3d4e25[_0x1d9e('0x1a')];var _0x10b5ab=_0x46cb3c?_0x1f05a0['count']:_0x3d4e25[_0x1d9e('0x1a')]+_0x3d4e25[_0x1d9e('0x18')];var _0x4b6563;if(_0x10b5ab>=_0x4177f2){_0x10b5ab=_0x4177f2;_0x4b6563=0xc8;}else{_0x4b6563=0xce;}_0x58ec3a[_0x1d9e('0x16')](_0x4b6563);return _0x58ec3a[_0x1d9e('0x1b')]('Content-Range',_0xd6de89+'-'+_0x10b5ab+'/'+_0x4177f2)[_0x1d9e('0x1c')](_0x1f05a0);}return null;};}function patchUpdates(_0x150a32){return function(_0x240ba7){try{jsonpatch[_0x1d9e('0x1d')](_0x240ba7,_0x150a32,!![]);}catch(_0x2410ce){return BPromise['reject'](_0x2410ce);}return _0x240ba7['save']();};}function saveUpdates(_0x29f6f3,_0x4c8b38){return function(_0x249692){if(_0x249692){return _0x249692[_0x1d9e('0x1e')](_0x29f6f3)[_0x1d9e('0x1f')](function(_0x27fc9d){return _0x27fc9d;});}return null;};}function removeEntity(_0x334d59,_0x243744){return function(_0x12e638){if(_0x12e638){return _0x12e638['destroy']()[_0x1d9e('0x1f')](function(){_0x334d59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca37c,_0x403efe){return function(_0x17f7c7){if(!_0x17f7c7){_0x3ca37c['sendStatus'](0x194);}return _0x17f7c7;};}function handleError(_0x39cbdb,_0xe748f){_0xe748f=_0xe748f||0x1f4;return function(_0xdae501){logger[_0x1d9e('0x20')](_0xdae501[_0x1d9e('0x21')]);if(_0xdae501[_0x1d9e('0x22')]){delete _0xdae501[_0x1d9e('0x22')];}_0x39cbdb[_0x1d9e('0x16')](_0xe748f)[_0x1d9e('0x23')](_0xdae501);};}exports['update']=function(_0x1ca3eb,_0xd2f161){if(_0x1ca3eb[_0x1d9e('0x24')]['id']){delete _0x1ca3eb[_0x1d9e('0x24')]['id'];}return db[_0x1d9e('0x25')][_0x1d9e('0x26')]({'where':{'id':_0x1ca3eb['params']['id']}})[_0x1d9e('0x1f')](handleEntityNotFound(_0xd2f161,null))[_0x1d9e('0x1f')](saveUpdates(_0x1ca3eb[_0x1d9e('0x24')],null))[_0x1d9e('0x1f')](respondWithResult(_0xd2f161,null))[_0x1d9e('0x27')](handleError(_0xd2f161,null));};exports[_0x1d9e('0x28')]=function(_0x2cd981,_0xf60509){return db[_0x1d9e('0x25')][_0x1d9e('0x26')]({'where':{'id':_0x2cd981[_0x1d9e('0x29')]['id']}})[_0x1d9e('0x1f')](handleEntityNotFound(_0xf60509,null))[_0x1d9e('0x1f')](removeEntity(_0xf60509,null))['catch'](handleError(_0xf60509,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 49d91f0..f5ea4e3 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 _0x2eab=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define'];(function(_0x1213bd,_0x71a10f){var _0x3471d1=function(_0x381d8a){while(--_0x381d8a){_0x1213bd['push'](_0x1213bd['shift']());}};_0x3471d1(++_0x71a10f);}(_0x2eab,0x8d));var _0xb2ea=function(_0x574007,_0x58a36d){_0x574007=_0x574007-0x0;var _0x22be55=_0x2eab[_0x574007];return _0x22be55;};'use strict';var _=require(_0xb2ea('0x0'));var util=require(_0xb2ea('0x1'));var logger=require(_0xb2ea('0x2'))(_0xb2ea('0x3'));var moment=require(_0xb2ea('0x4'));var BPromise=require(_0xb2ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ea('0x6'));var rimraf=require('rimraf');var config=require(_0xb2ea('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x117496,_0x3a6c1e){return _0x117496[_0xb2ea('0x8')]('Action',attributes,{'tableName':_0xb2ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6181=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash'];(function(_0x11045d,_0x14910b){var _0x38a685=function(_0x286452){while(--_0x286452){_0x11045d['push'](_0x11045d['shift']());}};_0x38a685(++_0x14910b);}(_0x6181,0xbf));var _0x1618=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x6181[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0x1618('0x0'));var util=require(_0x1618('0x1'));var logger=require(_0x1618('0x2'))(_0x1618('0x3'));var moment=require(_0x1618('0x4'));var BPromise=require(_0x1618('0x5'));var rp=require(_0x1618('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1618('0x7'));var config=require(_0x1618('0x8'));var attributes=require(_0x1618('0x9'));module['exports']=function(_0x4ee3f3,_0xc0cbdc){return _0x4ee3f3[_0x1618('0xa')]('Action',attributes,{'tableName':_0x1618('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 3b8e7b4..1ce5fee 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4975,0x86));var _0x5497=function(_0xd47394,_0x42c0d2){_0xd47394=_0xd47394-0x0;var _0x198ac5=_0x4975[_0xd47394];return _0x198ac5;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x853a0,_0xe5643f){var _0x1d988d=function(_0x3377de){while(--_0x3377de){_0x853a0['push'](_0x853a0['shift']());}};_0x1d988d(++_0xe5643f);}(_0xe14b,0x93));var _0xbe14=function(_0xf8fd31,_0x16dcdb){_0xf8fd31=_0xf8fd31-0x0;var _0xe20055=_0xe14b[_0xf8fd31];return _0xe20055;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 22268f9..bbd1f55 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 _0xd6c5=['put','/:id','delete','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xe13c51,_0x1d5358){var _0x23c04d=function(_0xfc418a){while(--_0xfc418a){_0xe13c51['push'](_0xe13c51['shift']());}};_0x23c04d(++_0x1d5358);}(_0xd6c5,0x9f));var _0x5d6c=function(_0x21a09f,_0x3fce61){_0x21a09f=_0x21a09f-0x0;var _0x3fef3f=_0xd6c5[_0x21a09f];return _0x3fef3f;};'use strict';var multer=require(_0x5d6c('0x0'));var util=require(_0x5d6c('0x1'));var path=require('path');var timeout=require(_0x5d6c('0x2'));var express=require('express');var router=express[_0x5d6c('0x3')]();var fs_extra=require(_0x5d6c('0x4'));var auth=require(_0x5d6c('0x5'));var interaction=require(_0x5d6c('0x6'));var config=require(_0x5d6c('0x7'));var controller=require(_0x5d6c('0x8'));router[_0x5d6c('0x9')](_0x5d6c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5d6c('0xb')](_0x5d6c('0xa'),auth[_0x5d6c('0xc')](),controller['destroy']);module[_0x5d6c('0xd')]=router; \ No newline at end of file +var _0x9fcf=['Router','fs-extra','../../components/interaction/service','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x9fcf,0x140));var _0xf9fc=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x9fcf[_0xac151d];return _0x111dba;};'use strict';var multer=require(_0xf9fc('0x0'));var util=require(_0xf9fc('0x1'));var path=require(_0xf9fc('0x2'));var timeout=require(_0xf9fc('0x3'));var express=require('express');var router=express[_0xf9fc('0x4')]();var fs_extra=require(_0xf9fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf9fc('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xf9fc('0x7')](_0xf9fc('0x8'),auth['isAuthenticated'](),controller[_0xf9fc('0x9')]);router['delete'](_0xf9fc('0x8'),auth[_0xf9fc('0xa')](),controller[_0xf9fc('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d6e5a02..a078c73 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 _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x30861a,_0x337deb){var _0xa37ad6=function(_0x4dad90){while(--_0x4dad90){_0x30861a['push'](_0x30861a['shift']());}};_0xa37ad6(++_0x337deb);}(_0xf494,0x1c6));var _0x4f49=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0xf494[_0x1aec02];return _0x10a837;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file +var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x187559,_0x4ea33f){var _0x5e5794=function(_0x326261){while(--_0x326261){_0x187559['push'](_0x187559['shift']());}};_0x5e5794(++_0x4ea33f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x23711e,_0x5739a9){_0x23711e=_0x23711e-0x0;var _0x4ab582=_0x9c5a[_0x23711e];return _0x4ab582;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 5fe14eb..7a34127 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 _0xf2d9=['joins','parentKey','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NOT\x20NULL','value','AnalyticMetric','DESC','foreignTable','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','reject','then','destroy','get','CustomReports','error','stack','send','index','AnalyticCustomReport','fieldName','key','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','include','findAll','rows','show','params','rawAttributes','filters','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','alias'];(function(_0x39b7b6,_0x14bcf4){var _0x5e4e75=function(_0x4daadb){while(--_0x4daadb){_0x39b7b6['push'](_0x39b7b6['shift']());}};_0x5e4e75(++_0x14bcf4);}(_0xf2d9,0xd2));var _0x9f2d=function(_0x4da2a6,_0x261779){_0x4da2a6=_0x4da2a6-0x0;var _0x2a9788=_0xf2d9[_0x4da2a6];return _0x2a9788;};'use strict';var emlformat=require(_0x9f2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f2d('0x1'));var jsonpatch=require(_0x9f2d('0x2'));var rp=require(_0x9f2d('0x3'));var moment=require(_0x9f2d('0x4'));var BPromise=require(_0x9f2d('0x5'));var Mustache=require(_0x9f2d('0x6'));var util=require(_0x9f2d('0x7'));var path=require(_0x9f2d('0x8'));var sox=require(_0x9f2d('0x9'));var csv=require(_0x9f2d('0xa'));var ejs=require(_0x9f2d('0xb'));var fs=require('fs');var fs_extra=require(_0x9f2d('0xc'));var _=require('lodash');var squel=require(_0x9f2d('0xd'));var crypto=require(_0x9f2d('0xe'));var jsforce=require(_0x9f2d('0xf'));var deskjs=require(_0x9f2d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f2d('0x12'));var as=require(_0x9f2d('0x13'));var hardwareService=require(_0x9f2d('0x14'));var logger=require(_0x9f2d('0x15'))(_0x9f2d('0x16'));var utils=require(_0x9f2d('0x17'));var config=require(_0x9f2d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f2d('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x14f6ae,_0x184ce6){_0x184ce6=_0x184ce6||0xcc;return function(_0x13fc99){if(_0x13fc99){return _0x14f6ae[_0x9f2d('0x1a')](_0x184ce6);}return _0x14f6ae['status'](_0x184ce6)[_0x9f2d('0x1b')]();};}function respondWithResult(_0x1e6b4f,_0xbded3d){_0xbded3d=_0xbded3d||0xc8;return function(_0x486293){if(_0x486293){return _0x1e6b4f[_0x9f2d('0x1c')](_0xbded3d)[_0x9f2d('0x1d')](_0x486293);}};}function respondWithFilteredResult(_0x4a4a5d,_0x591878){return function(_0x22f7f4){if(_0x22f7f4){var _0x50f762=typeof _0x591878[_0x9f2d('0x1e')]==='undefined'&&typeof _0x591878['limit']==='undefined';var _0xa249bd=_0x22f7f4[_0x9f2d('0x1f')];var _0x100ef5=_0x50f762?0x0:_0x591878['offset'];var _0x45cd72=_0x50f762?_0x22f7f4['count']:_0x591878[_0x9f2d('0x1e')]+_0x591878[_0x9f2d('0x20')];var _0x124145;if(_0x45cd72>=_0xa249bd){_0x45cd72=_0xa249bd;_0x124145=0xc8;}else{_0x124145=0xce;}_0x4a4a5d[_0x9f2d('0x1c')](_0x124145);return _0x4a4a5d[_0x9f2d('0x21')]('Content-Range',_0x100ef5+'-'+_0x45cd72+'/'+_0xa249bd)[_0x9f2d('0x1d')](_0x22f7f4);}return null;};}function patchUpdates(_0x40e6a5){return function(_0x930309){try{jsonpatch['apply'](_0x930309,_0x40e6a5,!![]);}catch(_0x7dda0f){return BPromise[_0x9f2d('0x22')](_0x7dda0f);}return _0x930309['save']();};}function saveUpdates(_0x26ea93,_0x2c6dc5){return function(_0x520cdf){if(_0x520cdf){return _0x520cdf['update'](_0x26ea93)[_0x9f2d('0x23')](function(_0x175465){return _0x175465;});}return null;};}function removeEntity(_0x1026d2,_0x3a7d4e){return function(_0x3444f0){if(_0x3444f0){return _0x3444f0[_0x9f2d('0x24')]()[_0x9f2d('0x23')](function(){var _0x39f84b=_0x3444f0[_0x9f2d('0x25')]({'plain':!![]});var _0x2ae19d=_0x9f2d('0x26');return db['UserProfileResource'][_0x9f2d('0x24')]({'where':{'type':_0x2ae19d,'resourceId':_0x39f84b['id']}})['then'](function(){return _0x3444f0;});})[_0x9f2d('0x23')](function(){_0x1026d2[_0x9f2d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37190a,_0x1c18c1){return function(_0x106ed8){if(!_0x106ed8){_0x37190a[_0x9f2d('0x1a')](0x194);}return _0x106ed8;};}function handleError(_0x1b3c02,_0xa4219e){_0xa4219e=_0xa4219e||0x1f4;return function(_0x1f8270){logger[_0x9f2d('0x27')](_0x1f8270[_0x9f2d('0x28')]);if(_0x1f8270['name']){delete _0x1f8270['name'];}_0x1b3c02[_0x9f2d('0x1c')](_0xa4219e)[_0x9f2d('0x29')](_0x1f8270);};}exports[_0x9f2d('0x2a')]=function(_0x205d96,_0x29006b){var _0x27f6e3={},_0x20a827={},_0x36ad06={'count':0x0,'rows':[]};var _0x5a3ac6=_['map'](db[_0x9f2d('0x2b')]['rawAttributes'],function(_0xd7190f){return{'name':_0xd7190f[_0x9f2d('0x2c')],'type':_0xd7190f['type'][_0x9f2d('0x2d')]};});_0x20a827['model']=_['map'](_0x5a3ac6,'name');_0x20a827['query']=_[_0x9f2d('0x2e')](_0x205d96['query']);_0x20a827['filters']=_['intersection'](_0x20a827[_0x9f2d('0x2f')],_0x20a827[_0x9f2d('0x30')]);_0x27f6e3[_0x9f2d('0x31')]=_[_0x9f2d('0x32')](_0x20a827[_0x9f2d('0x2f')],qs[_0x9f2d('0x33')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x27f6e3[_0x9f2d('0x31')]=_0x27f6e3[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x27f6e3[_0x9f2d('0x31')]:_0x20a827['model'];if(!_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x35')](_0x9f2d('0x36'))){_0x27f6e3['limit']=qs[_0x9f2d('0x20')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x20')]);_0x27f6e3[_0x9f2d('0x1e')]=qs[_0x9f2d('0x1e')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x1e')]);}_0x27f6e3['order']=qs[_0x9f2d('0x37')](_0x205d96['query'][_0x9f2d('0x37')]);_0x27f6e3[_0x9f2d('0x38')]=qs['filters'](_[_0x9f2d('0x39')](_0x205d96['query'],_0x20a827['filters']),_0x5a3ac6);if(_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x3a')]){_0x27f6e3[_0x9f2d('0x38')]=_[_0x9f2d('0x3b')](_0x27f6e3[_0x9f2d('0x38')],{'$or':_['map'](_0x5a3ac6,function(_0x51921e){if(_0x51921e[_0x9f2d('0x3c')]!==_0x9f2d('0x3d')){var _0x2b08e8={};_0x2b08e8[_0x51921e[_0x9f2d('0x3e')]]={'$like':'%'+_0x205d96['query']['filter']+'%'};return _0x2b08e8;}})});}_0x27f6e3=_['merge']({},_0x27f6e3,_0x205d96['options']);var _0x204628={'where':_0x27f6e3[_0x9f2d('0x38')]};return db[_0x9f2d('0x2b')]['count'](_0x204628)[_0x9f2d('0x23')](function(_0x17e5e3){_0x36ad06[_0x9f2d('0x1f')]=_0x17e5e3;if(_0x205d96[_0x9f2d('0x30')]['includeAll']){_0x27f6e3[_0x9f2d('0x3f')]=[{'all':!![]}];}return db[_0x9f2d('0x2b')][_0x9f2d('0x40')](_0x27f6e3);})[_0x9f2d('0x23')](function(_0x529b3b){_0x36ad06[_0x9f2d('0x41')]=_0x529b3b;return _0x36ad06;})[_0x9f2d('0x23')](respondWithFilteredResult(_0x29006b,_0x27f6e3))['catch'](handleError(_0x29006b,null));};exports[_0x9f2d('0x42')]=function(_0x2668b3,_0x439a6b){var _0x5c261e={'raw':![],'where':{'id':_0x2668b3[_0x9f2d('0x43')]['id']}},_0x6b82d5={};_0x6b82d5[_0x9f2d('0x2f')]=_['keys'](db[_0x9f2d('0x2b')][_0x9f2d('0x44')]);_0x6b82d5[_0x9f2d('0x30')]=_[_0x9f2d('0x2e')](_0x2668b3[_0x9f2d('0x30')]);_0x6b82d5[_0x9f2d('0x45')]=_[_0x9f2d('0x32')](_0x6b82d5['model'],_0x6b82d5[_0x9f2d('0x30')]);_0x5c261e['attributes']=_[_0x9f2d('0x32')](_0x6b82d5['model'],qs[_0x9f2d('0x33')](_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x5c261e['attributes']=_0x5c261e[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x5c261e[_0x9f2d('0x31')]:_0x6b82d5[_0x9f2d('0x2f')];if(_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x46')]){_0x5c261e[_0x9f2d('0x3f')]=[{'all':!![]}];}_0x5c261e=_[_0x9f2d('0x3b')]({},_0x5c261e,_0x2668b3[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x5c261e)[_0x9f2d('0x23')](handleEntityNotFound(_0x439a6b,null))[_0x9f2d('0x23')](respondWithResult(_0x439a6b,null))[_0x9f2d('0x49')](handleError(_0x439a6b,null));};exports[_0x9f2d('0x4a')]=function(_0x3eddd5,_0x3e7996){return db[_0x9f2d('0x2b')]['create'](_0x3eddd5[_0x9f2d('0x4b')],{})[_0x9f2d('0x23')](function(_0x5ec9e5){var _0x5065d1=_0x3eddd5[_0x9f2d('0x4c')]['get']({'plain':!![]});if(!_0x5065d1)throw new Error(_0x9f2d('0x4d'));if(_0x5065d1['role']===_0x9f2d('0x4c')){var _0x3ff324=_0x5ec9e5[_0x9f2d('0x25')]({'plain':!![]});var _0x976b61='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x976b61,'userProfileId':_0x5065d1[_0x9f2d('0x4e')]},'raw':!![]})[_0x9f2d('0x23')](function(_0x25662a){if(_0x25662a&&_0x25662a['autoAssociation']===0x0){return db['UserProfileResource'][_0x9f2d('0x4a')]({'name':_0x3ff324[_0x9f2d('0x3e')],'resourceId':_0x3ff324['id'],'type':_0x9f2d('0x26'),'sectionId':_0x25662a['id']},{})['then'](function(){return _0x5ec9e5;});}else{return _0x5ec9e5;}})[_0x9f2d('0x49')](function(_0x5c0bdb){logger[_0x9f2d('0x27')](_0x9f2d('0x4f'),_0x5c0bdb);throw _0x5c0bdb;});}return _0x5ec9e5;})[_0x9f2d('0x23')](respondWithResult(_0x3e7996,0xc9))[_0x9f2d('0x49')](handleError(_0x3e7996,null));};exports['update']=function(_0x77452e,_0x2bc443){if(_0x77452e['body']['id']){delete _0x77452e['body']['id'];}return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x77452e[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x2bc443,null))['then'](saveUpdates(_0x77452e[_0x9f2d('0x4b')],null))[_0x9f2d('0x23')](respondWithResult(_0x2bc443,null))[_0x9f2d('0x49')](handleError(_0x2bc443,null));};exports[_0x9f2d('0x24')]=function(_0x39c32f,_0x10b4d){return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x39c32f[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x10b4d,null))[_0x9f2d('0x23')](removeEntity(_0x10b4d,null))['catch'](handleError(_0x10b4d,null));};exports[_0x9f2d('0x50')]=function(_0xbd2d57,_0xd6c755){var _0x55cd0c=0xa;var _0x6578bd=['join','left_join',_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x40b4e0={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x165763={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x20e730=function(_0x5cfa69){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),'IS\x20NOT\x20NULL',_0x9f2d('0x61'),_0x9f2d('0x62')],_0x5cfa69);};var _0x2fd373=function(_0x50397d){if(!_0x50397d||!_0x50397d['rules'][_0x9f2d('0x34')]){return'';}for(var _0x270e5e='(',_0x9fd238=0x0;_0x9fd238<_0x50397d['rules'][_0x9f2d('0x34')];_0x9fd238+=0x1){_0x9fd238>0x0&&(_0x270e5e+='\x20'+_0x50397d[_0x9f2d('0x63')]+'\x20');_0x270e5e+=_0x50397d['rules'][_0x9fd238]['group']?_0x2fd373(_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x65')]):_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x66')]+'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x67')]+(_0x20e730(_0x50397d['rules'][_0x9fd238][_0x9f2d('0x67')])?'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238]['value']:'');}return _0x270e5e+')';};var _0x45788b={'where':{'id':_0xbd2d57[_0x9f2d('0x43')]['id']}},_0x2ba2cc,_0x446d8b,_0x48529b,_0x233724,_0x445063;_0x45788b=_[_0x9f2d('0x3b')]({},_0x45788b,_0xbd2d57[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')]['find'](_0x45788b)[_0x9f2d('0x23')](function(_0x970a06){if(_0x970a06){_0x2ba2cc=_0x970a06;return _0x970a06[_0x9f2d('0x68')]();}return null;})[_0x9f2d('0x23')](function(_0x3f0c1f){if(_0x3f0c1f){if(!_0x3f0c1f[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x446d8b=_0x3f0c1f;return db['AnalyticMetric'][_0x9f2d('0x40')]({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x3b2841){if(_0x3b2841){_0x48529b=_[_0x9f2d('0x6b')](_0x3b2841,'id');var _0x5e7e6d;var _0x4c9954=squel[_0x9f2d('0x6c')]();_0x4c9954[_0x9f2d('0x6d')](_0x2ba2cc[_0x9f2d('0x6e')]);for(var _0x47b830=0x0;_0x47b830<_0x446d8b[_0x9f2d('0x34')];_0x47b830+=0x1){_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x6f')]?_0x48529b[_0x446d8b[_0x47b830][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x446d8b[_0x47b830][_0x9f2d('0x66')];_0x5e7e6d=_0x446d8b[_0x47b830]['function']?_[_0x9f2d('0x71')](_0x40b4e0[_0x446d8b[_0x47b830][_0x9f2d('0x72')]],'%s',_0x5e7e6d):_0x5e7e6d;_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x73')]?_['replace'](_0x165763[_0x446d8b[_0x47b830][_0x9f2d('0x73')]],'%s',_0x5e7e6d):_0x5e7e6d;if(_0x446d8b[_0x47b830][_0x9f2d('0x74')]){_0x4c9954[_0x9f2d('0x65')](_0x5e7e6d);}_0x446d8b[_0x47b830][_0x9f2d('0x75')]&&_0x4c9954[_0x9f2d('0x76')](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x75')]==='DESC'?![]:!![]);_0x4c9954['field'](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x77')]||_0x5e7e6d);}if(_0x2ba2cc[_0x9f2d('0x78')]){_0x2ba2cc[_0x9f2d('0x78')]=JSON['parse'](_0x2ba2cc[_0x9f2d('0x78')]);for(var _0x5c4e1=0x0;_0x5c4e1<_0x2ba2cc[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x5c4e1+=0x1){if(_0x2ba2cc['joins'][_0x5c4e1][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x6578bd,_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')])&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')]&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1]['foreignTable']&&_0x2ba2cc['joins'][_0x5c4e1]['foreignKey']){_0x4c9954[_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')]](_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],null,util['format'](_0x9f2d('0x7a'),_0x2ba2cc[_0x9f2d('0x6e')],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')],_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x7b')]));}}}if(_0x2ba2cc['conditions']){_0x2ba2cc[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x2ba2cc['conditions']);_0x4c9954[_0x9f2d('0x38')](_0x2fd373(_0x2ba2cc[_0x9f2d('0x7c')]['group']));}_0x445063=_0x4c9954['clone']();_0x4c9954['limit'](_0x55cd0c);_0x4c9954[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')](_0x9f2d('0x7f'),_0x4c9954['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x4c9954[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](respondWithResult(_0xd6c755,null))[_0x9f2d('0x49')](handleError(_0xd6c755,null));};function runReport(_0x4b3571,_0x20bd66,_0x37bae9){var _0x11c822=_0x20bd66[_0x9f2d('0x3e')];var _0x2c6181=0xa;var _0x3d2c89=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x5b9084={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':_0x9f2d('0x86')};var _0x14cfc1={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48b5f0=function(_0x595989){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x595989);};var _0x12b67f=function(_0x5acac6){if(!_0x5acac6||!_0x5acac6[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x2af1d9='(',_0x1ea74d=0x0;_0x1ea74d<_0x5acac6[_0x9f2d('0x64')]['length'];_0x1ea74d+=0x1){_0x1ea74d>0x0&&(_0x2af1d9+='\x20'+_0x5acac6[_0x9f2d('0x63')]+'\x20');_0x2af1d9+=_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x65')]?_0x12b67f(_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x65')]):_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x66')]+'\x20'+_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x67')]+(_0x48b5f0(_0x5acac6[_0x9f2d('0x64')][_0x1ea74d]['condition'])?'\x20'+_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x89')]:'');}return _0x2af1d9+')';};var _0x588606={'where':{'id':_0x4b3571['id']}},_0x4f0974,_0x12ab9b,_0x134efa,_0x11a144,_0x35f20a;_0x588606=_['merge']({},_0x588606,_0x37bae9);return db[_0x9f2d('0x2b')]['find'](_0x588606)[_0x9f2d('0x23')](function(_0x289fa0){if(_0x289fa0){_0x4f0974=_0x289fa0;return _0x289fa0[_0x9f2d('0x68')]();}return null;})['then'](function(_0x292aba){if(_0x292aba){if(!_0x292aba[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12ab9b=_0x292aba;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x697931){if(_0x697931){_0x134efa=_[_0x9f2d('0x6b')](_0x697931,'id');var _0x1be640;var _0x59e586=squel[_0x9f2d('0x6c')]();_0x59e586[_0x9f2d('0x6d')](_0x4f0974[_0x9f2d('0x6e')]);for(var _0x5f4046=0x0;_0x5f4046<_0x12ab9b[_0x9f2d('0x34')];_0x5f4046+=0x1){_0x1be640=_0x12ab9b[_0x5f4046]['MetricId']?_0x134efa[_0x12ab9b[_0x5f4046][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x12ab9b[_0x5f4046][_0x9f2d('0x66')];_0x1be640=_0x12ab9b[_0x5f4046]['function']?_[_0x9f2d('0x71')](_0x5b9084[_0x12ab9b[_0x5f4046][_0x9f2d('0x72')]],'%s',_0x1be640):_0x1be640;_0x1be640=_0x12ab9b[_0x5f4046]['format']?_[_0x9f2d('0x71')](_0x14cfc1[_0x12ab9b[_0x5f4046][_0x9f2d('0x73')]],'%s',_0x1be640):_0x1be640;if(_0x12ab9b[_0x5f4046]['groupBy']){_0x59e586[_0x9f2d('0x65')](_0x1be640);}_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]&&_0x59e586[_0x9f2d('0x76')](_0x1be640,_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]===_0x9f2d('0x8b')?![]:!![]);_0x59e586['field'](_0x1be640,_0x12ab9b[_0x5f4046]['alias']||_0x1be640);}if(_0x4f0974[_0x9f2d('0x78')]){_0x4f0974[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x78')]);for(var _0x439b15=0x0;_0x439b15<_0x4f0974['joins'][_0x9f2d('0x34')];_0x439b15+=0x1){if(_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x3d2c89,_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')])&&_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x79')]&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignTable']&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignKey']){_0x59e586[_0x4f0974['joins'][_0x439b15][_0x9f2d('0x3c')]](_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')]('%s.%s\x20=\x20%s.%s',_0x4f0974[_0x9f2d('0x6e')],_0x4f0974['joins'][_0x439b15][_0x9f2d('0x79')],_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],_0x4f0974['joins'][_0x439b15]['foreignKey']));}}}if(_0x4f0974[_0x9f2d('0x7c')]){_0x4f0974[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x7c')]);_0x59e586[_0x9f2d('0x38')](_0x12b67f(_0x4f0974[_0x9f2d('0x7c')][_0x9f2d('0x65')]));}_0x35f20a=_0x59e586[_0x9f2d('0x8d')]();_0x59e586['limit'](_0x2c6181);_0x59e586[_0x9f2d('0x1e')](0x0);return;}})[_0x9f2d('0x23')](function(){if(_0x20bd66[_0x9f2d('0x8e')]===_0x9f2d('0x8f')){return null;}var _0x3d0265=_['merge'](_0x20bd66,{'name':_0x20bd66[_0x9f2d('0x90')]||_0x20bd66[_0x9f2d('0x3e')]||_0x4f0974[_0x9f2d('0x3e')],'basename':_0x11c822,'savename':util['format'](_0x9f2d('0x91'),_0x20bd66['name']||_0x4f0974[_0x9f2d('0x3e')],require(_0x9f2d('0x92'))[_0x9f2d('0x93')](0x4),_0x20bd66[_0x9f2d('0x8e')]||_0x9f2d('0x94')),'reportId':_0x4f0974['id'],'reportType':_0x9f2d('0x95')});return db[_0x9f2d('0x96')][_0x9f2d('0x4a')](_0x3d0265,{'raw':!![]});})['then'](function(_0x58190e){if(_0x4f0974[_0x9f2d('0x6e')]===_0x9f2d('0x97')){_0x35f20a[_0x9f2d('0x38')](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x98'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66['endDate']);}else{_0x35f20a['where'](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x9a'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66[_0x9f2d('0x9b')]);}if(_0x58190e){logger[_0x9f2d('0x9c')](_0x9f2d('0x9d'),_0x35f20a[_0x9f2d('0x81')]());require(_0x9f2d('0x9e'))[_0x9f2d('0x9f')](path[_0x9f2d('0x84')](__dirname,_0x9f2d('0xa0'),_0x58190e[_0x9f2d('0x8e')]),[_0x58190e['id'],_0x35f20a[_0x9f2d('0x81')](),path[_0x9f2d('0x84')](__dirname,'../../files/reports',_0x58190e[_0x9f2d('0xa1')]),_0x11c822]);return _0x58190e;}else{var _0x1855e9=squel[_0x9f2d('0x6c')]();_0x1855e9['from']('('+_0x35f20a['toString']()+')',_0x9f2d('0xa2'));_0x1855e9[_0x9f2d('0x66')]('COUNT(*)','count');_0x35f20a[_0x9f2d('0x20')](_0x20bd66[_0x9f2d('0x20')]||_0x2c6181);_0x35f20a[_0x9f2d('0x1e')](_0x20bd66[_0x9f2d('0x1e')]||0x0);return dbH[_0x9f2d('0x80')]['query'](_0x1855e9[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')]['QueryTypes'][_0x9f2d('0x83')]})['then'](function(_0x2f66db){if(!_0x2f66db[_0x9f2d('0x34')]){_0x11a144=0x0;}else{_0x11a144=_0x2f66db[0x0]['count']||0x0;}return dbH[_0x9f2d('0x80')]['query'](_0x35f20a[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});})[_0x9f2d('0x23')](function(_0x2d5414){return{'rows':_0x2d5414||[],'count':_0x11a144};});}});}exports[_0x9f2d('0xa3')]=function(_0x3d7c40,_0xadd74a){return runReport(_0x3d7c40[_0x9f2d('0x43')],_0x3d7c40[_0x9f2d('0x30')],_0x3d7c40['options'])[_0x9f2d('0x23')](respondWithResult(_0xadd74a,null))[_0x9f2d('0x49')](handleError(_0xadd74a,null));};exports['runReport']=runReport;exports['query']=function(_0x58609a,_0x21bbe3){var _0x54cffe=0xa;var _0x343b3c=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),'cross_join'];var _0x406630={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':'MIN(%s)','AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48fa92={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x2f832d=function(_0x159446){return!_[_0x9f2d('0x5f')](['IS\x20NULL',_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x159446);};var _0x4fcc8c=function(_0x568a0e){if(!_0x568a0e||!_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x40ccfd='(',_0x335a1d=0x0;_0x335a1d<_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')];_0x335a1d+=0x1){_0x335a1d>0x0&&(_0x40ccfd+='\x20'+_0x568a0e[_0x9f2d('0x63')]+'\x20');_0x40ccfd+=_0x568a0e[_0x9f2d('0x64')][_0x335a1d]['group']?_0x4fcc8c(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x65')]):_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x66')]+'\x20'+_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')]+(_0x2f832d(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')])?'\x20'+_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x89')]:'');}return _0x40ccfd+')';};var _0x3657c7={'where':{'id':_0x58609a[_0x9f2d('0x43')]['id']}},_0x284827,_0x474294,_0x4b902b,_0x19aa80,_0x194a37;_0x3657c7=_[_0x9f2d('0x3b')]({},_0x3657c7,_0x58609a[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x3657c7)[_0x9f2d('0x23')](function(_0x22e4e7){if(_0x22e4e7){_0x284827=_0x22e4e7;return _0x22e4e7['getFields']();}return null;})['then'](function(_0x33bc7e){if(_0x33bc7e){if(!_0x33bc7e[_0x9f2d('0x34')]){throw new db['Sequelize'][(_0x9f2d('0x6a'))](_0x9f2d('0xa4'),0x193);}_0x474294=_0x33bc7e;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x27376b){if(_0x27376b){_0x4b902b=_[_0x9f2d('0x6b')](_0x27376b,'id');var _0x525bfe;var _0x153496=squel[_0x9f2d('0x6c')]();_0x153496[_0x9f2d('0x6d')](_0x284827[_0x9f2d('0x6e')]);for(var _0x32f8ef=0x0;_0x32f8ef<_0x474294[_0x9f2d('0x34')];_0x32f8ef+=0x1){_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x6f')]?_0x4b902b[_0x474294[_0x32f8ef][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x474294[_0x32f8ef]['field'];_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x72')]?_[_0x9f2d('0x71')](_0x406630[_0x474294[_0x32f8ef][_0x9f2d('0x72')]],'%s',_0x525bfe):_0x525bfe;_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x73')]?_[_0x9f2d('0x71')](_0x48fa92[_0x474294[_0x32f8ef][_0x9f2d('0x73')]],'%s',_0x525bfe):_0x525bfe;if(_0x474294[_0x32f8ef][_0x9f2d('0x74')]){_0x153496[_0x9f2d('0x65')](_0x525bfe);}_0x474294[_0x32f8ef][_0x9f2d('0x75')]&&_0x153496[_0x9f2d('0x76')](_0x525bfe,_0x474294[_0x32f8ef]['orderBy']===_0x9f2d('0x8b')?![]:!![]);_0x153496['field'](_0x525bfe,_0x474294[_0x32f8ef][_0x9f2d('0x77')]||_0x525bfe);}if(_0x284827[_0x9f2d('0x78')]){_0x284827[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x78')]);for(var _0x3abeb4=0x0;_0x3abeb4<_0x284827[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x3abeb4+=0x1){if(_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x343b3c,_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')])&&_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x79')]&&_0x284827[_0x9f2d('0x78')][_0x3abeb4]['foreignTable']&&_0x284827['joins'][_0x3abeb4]['foreignKey']){_0x153496[_0x284827[_0x9f2d('0x78')][_0x3abeb4]['type']](_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')](_0x9f2d('0x7a'),_0x284827['table'],_0x284827[_0x9f2d('0x78')][_0x3abeb4]['parentKey'],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x7b')]));}}}if(_0x284827[_0x9f2d('0x7c')]){_0x284827[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x7c')]);_0x153496[_0x9f2d('0x38')](_0x4fcc8c(_0x284827[_0x9f2d('0x7c')]['group']));}_0x194a37=_0x153496[_0x9f2d('0x8d')]();_0x153496[_0x9f2d('0x20')](_0x54cffe);_0x153496[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')]('Limited\x20Query:',_0x153496['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x153496['toString'](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](function(){return{'sql':_0x194a37[_0x9f2d('0x81')]()};})[_0x9f2d('0x23')](respondWithResult(_0x21bbe3,null))[_0x9f2d('0x49')](handleError(_0x21bbe3,null));}; \ No newline at end of file +var _0x6262=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','merge','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','HOUR(%s)','value','getFields','groupBy','output','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','rimraf','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','dbH','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','model'];(function(_0x2ceb31,_0x40ecf1){var _0x168859=function(_0x3de469){while(--_0x3de469){_0x2ceb31['push'](_0x2ceb31['shift']());}};_0x168859(++_0x40ecf1);}(_0x6262,0x72));var _0x2626=function(_0x337570,_0xdd86bc){_0x337570=_0x337570-0x0;var _0x27b1fb=_0x6262[_0x337570];return _0x27b1fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2626('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2626('0x1'));var rp=require(_0x2626('0x2'));var moment=require(_0x2626('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2626('0x4'));var sox=require('sox');var csv=require(_0x2626('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2626('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2626('0x7'));var jsforce=require(_0x2626('0x8'));var deskjs=require(_0x2626('0x9'));var toCsv=require(_0x2626('0x5'));var querystring=require(_0x2626('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2626('0xb'));var qs=require(_0x2626('0xc'));var as=require(_0x2626('0xd'));var hardwareService=require(_0x2626('0xe'));var logger=require(_0x2626('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2626('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x2626('0x11')];function respondWithStatusCode(_0x5955f0,_0x7f4e3f){_0x7f4e3f=_0x7f4e3f||0xcc;return function(_0x344db2){if(_0x344db2){return _0x5955f0['sendStatus'](_0x7f4e3f);}return _0x5955f0[_0x2626('0x12')](_0x7f4e3f)[_0x2626('0x13')]();};}function respondWithResult(_0x5043f7,_0x15ea5e){_0x15ea5e=_0x15ea5e||0xc8;return function(_0x4bf50b){if(_0x4bf50b){return _0x5043f7[_0x2626('0x12')](_0x15ea5e)[_0x2626('0x14')](_0x4bf50b);}};}function respondWithFilteredResult(_0x2eb9cd,_0x374257){return function(_0x221d6f){if(_0x221d6f){var _0x4d667d=typeof _0x374257[_0x2626('0x15')]==='undefined'&&typeof _0x374257[_0x2626('0x16')]===_0x2626('0x17');var _0x50c940=_0x221d6f[_0x2626('0x18')];var _0x4c917e=_0x4d667d?0x0:_0x374257['offset'];var _0x2e84f3=_0x4d667d?_0x221d6f['count']:_0x374257[_0x2626('0x15')]+_0x374257[_0x2626('0x16')];var _0xb6493f;if(_0x2e84f3>=_0x50c940){_0x2e84f3=_0x50c940;_0xb6493f=0xc8;}else{_0xb6493f=0xce;}_0x2eb9cd[_0x2626('0x12')](_0xb6493f);return _0x2eb9cd[_0x2626('0x19')](_0x2626('0x1a'),_0x4c917e+'-'+_0x2e84f3+'/'+_0x50c940)[_0x2626('0x14')](_0x221d6f);}return null;};}function patchUpdates(_0x3501ee){return function(_0x13debd){try{jsonpatch[_0x2626('0x1b')](_0x13debd,_0x3501ee,!![]);}catch(_0x4a281b){return BPromise[_0x2626('0x1c')](_0x4a281b);}return _0x13debd[_0x2626('0x1d')]();};}function saveUpdates(_0x1ecfb5,_0x4325db){return function(_0x271b49){if(_0x271b49){return _0x271b49[_0x2626('0x1e')](_0x1ecfb5)[_0x2626('0x1f')](function(_0x4735d3){return _0x4735d3;});}return null;};}function removeEntity(_0x21c3eb,_0x4ce27e){return function(_0x3302f1){if(_0x3302f1){return _0x3302f1[_0x2626('0x20')]()[_0x2626('0x1f')](function(){var _0x496cba=_0x3302f1[_0x2626('0x21')]({'plain':!![]});var _0x2428ca='CustomReports';return db[_0x2626('0x22')][_0x2626('0x20')]({'where':{'type':_0x2428ca,'resourceId':_0x496cba['id']}})[_0x2626('0x1f')](function(){return _0x3302f1;});})[_0x2626('0x1f')](function(){_0x21c3eb[_0x2626('0x12')](0xcc)[_0x2626('0x13')]();});}};}function handleEntityNotFound(_0x5bbebf,_0x516588){return function(_0x57529c){if(!_0x57529c){_0x5bbebf[_0x2626('0x23')](0x194);}return _0x57529c;};}function handleError(_0x8c4f3e,_0x1d64d9){_0x1d64d9=_0x1d64d9||0x1f4;return function(_0xfb7a91){logger[_0x2626('0x24')](_0xfb7a91[_0x2626('0x25')]);if(_0xfb7a91[_0x2626('0x26')]){delete _0xfb7a91[_0x2626('0x26')];}_0x8c4f3e[_0x2626('0x12')](_0x1d64d9)[_0x2626('0x27')](_0xfb7a91);};}exports[_0x2626('0x28')]=function(_0x5f1811,_0x53f75c){var _0x288a83={},_0x3d0b3e={},_0x16523e={'count':0x0,'rows':[]};var _0x5b1231=_[_0x2626('0x29')](db[_0x2626('0x2a')]['rawAttributes'],function(_0x1013dc){return{'name':_0x1013dc[_0x2626('0x2b')],'type':_0x1013dc[_0x2626('0x2c')]['key']};});_0x3d0b3e[_0x2626('0x2d')]=_[_0x2626('0x29')](_0x5b1231,_0x2626('0x26'));_0x3d0b3e[_0x2626('0x2e')]=_[_0x2626('0x2f')](_0x5f1811[_0x2626('0x2e')]);_0x3d0b3e[_0x2626('0x30')]=_[_0x2626('0x31')](_0x3d0b3e[_0x2626('0x2d')],_0x3d0b3e['query']);_0x288a83[_0x2626('0x32')]=_[_0x2626('0x31')](_0x3d0b3e[_0x2626('0x2d')],qs[_0x2626('0x33')](_0x5f1811[_0x2626('0x2e')]['fields']));_0x288a83[_0x2626('0x32')]=_0x288a83[_0x2626('0x32')][_0x2626('0x34')]?_0x288a83[_0x2626('0x32')]:_0x3d0b3e[_0x2626('0x2d')];if(!_0x5f1811['query']['hasOwnProperty'](_0x2626('0x35'))){_0x288a83[_0x2626('0x16')]=qs['limit'](_0x5f1811['query'][_0x2626('0x16')]);_0x288a83[_0x2626('0x15')]=qs[_0x2626('0x15')](_0x5f1811[_0x2626('0x2e')][_0x2626('0x15')]);}_0x288a83[_0x2626('0x36')]=qs[_0x2626('0x37')](_0x5f1811['query'][_0x2626('0x37')]);_0x288a83[_0x2626('0x38')]=qs[_0x2626('0x30')](_[_0x2626('0x39')](_0x5f1811[_0x2626('0x2e')],_0x3d0b3e[_0x2626('0x30')]),_0x5b1231);if(_0x5f1811[_0x2626('0x2e')]['filter']){_0x288a83[_0x2626('0x38')]=_['merge'](_0x288a83[_0x2626('0x38')],{'$or':_[_0x2626('0x29')](_0x5b1231,function(_0x111852){if(_0x111852['type']!==_0x2626('0x3a')){var _0x50b596={};_0x50b596[_0x111852[_0x2626('0x26')]]={'$like':'%'+_0x5f1811[_0x2626('0x2e')][_0x2626('0x3b')]+'%'};return _0x50b596;}})});}_0x288a83=_['merge']({},_0x288a83,_0x5f1811[_0x2626('0x3c')]);var _0x2a77a2={'where':_0x288a83[_0x2626('0x38')]};return db['AnalyticCustomReport']['count'](_0x2a77a2)[_0x2626('0x1f')](function(_0x1e9c1d){_0x16523e['count']=_0x1e9c1d;if(_0x5f1811[_0x2626('0x2e')][_0x2626('0x3d')]){_0x288a83[_0x2626('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x2626('0x3f')](_0x288a83);})[_0x2626('0x1f')](function(_0x2cc62a){_0x16523e[_0x2626('0x40')]=_0x2cc62a;return _0x16523e;})[_0x2626('0x1f')](respondWithFilteredResult(_0x53f75c,_0x288a83))[_0x2626('0x41')](handleError(_0x53f75c,null));};exports[_0x2626('0x42')]=function(_0xcd6464,_0xb27663){var _0x50306a={'raw':![],'where':{'id':_0xcd6464['params']['id']}},_0x45b819={};_0x45b819[_0x2626('0x2d')]=_[_0x2626('0x2f')](db['AnalyticCustomReport']['rawAttributes']);_0x45b819['query']=_[_0x2626('0x2f')](_0xcd6464['query']);_0x45b819[_0x2626('0x30')]=_[_0x2626('0x31')](_0x45b819[_0x2626('0x2d')],_0x45b819[_0x2626('0x2e')]);_0x50306a[_0x2626('0x32')]=_[_0x2626('0x31')](_0x45b819[_0x2626('0x2d')],qs[_0x2626('0x33')](_0xcd6464[_0x2626('0x2e')]['fields']));_0x50306a[_0x2626('0x32')]=_0x50306a[_0x2626('0x32')][_0x2626('0x34')]?_0x50306a[_0x2626('0x32')]:_0x45b819['model'];if(_0xcd6464[_0x2626('0x2e')]['includeAll']){_0x50306a[_0x2626('0x3e')]=[{'all':!![]}];}_0x50306a=_['merge']({},_0x50306a,_0xcd6464[_0x2626('0x3c')]);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x50306a)[_0x2626('0x1f')](handleEntityNotFound(_0xb27663,null))['then'](respondWithResult(_0xb27663,null))[_0x2626('0x41')](handleError(_0xb27663,null));};exports[_0x2626('0x44')]=function(_0x2ff7b2,_0x9b0cfc){return db[_0x2626('0x2a')][_0x2626('0x44')](_0x2ff7b2['body'],{})['then'](function(_0x439fbb){var _0x51bf9f=_0x2ff7b2[_0x2626('0x45')]['get']({'plain':!![]});if(!_0x51bf9f)throw new Error(_0x2626('0x46'));if(_0x51bf9f['role']===_0x2626('0x45')){var _0x139f88=_0x439fbb['get']({'plain':!![]});var _0xb1fbd9=_0x2626('0x47');return db[_0x2626('0x48')]['find']({'where':{'name':_0xb1fbd9,'userProfileId':_0x51bf9f['userProfileId']},'raw':!![]})[_0x2626('0x1f')](function(_0x28168f){if(_0x28168f&&_0x28168f[_0x2626('0x49')]===0x0){return db[_0x2626('0x22')]['create']({'name':_0x139f88[_0x2626('0x26')],'resourceId':_0x139f88['id'],'type':_0x2626('0x4a'),'sectionId':_0x28168f['id']},{})[_0x2626('0x1f')](function(){return _0x439fbb;});}else{return _0x439fbb;}})[_0x2626('0x41')](function(_0x3a4200){logger[_0x2626('0x24')](_0x2626('0x4b'),_0x3a4200);throw _0x3a4200;});}return _0x439fbb;})[_0x2626('0x1f')](respondWithResult(_0x9b0cfc,0xc9))[_0x2626('0x41')](handleError(_0x9b0cfc,null));};exports[_0x2626('0x1e')]=function(_0x1e4b0b,_0x28a94b){if(_0x1e4b0b[_0x2626('0x4c')]['id']){delete _0x1e4b0b[_0x2626('0x4c')]['id'];}return db[_0x2626('0x2a')][_0x2626('0x43')]({'where':{'id':_0x1e4b0b[_0x2626('0x4d')]['id']}})['then'](handleEntityNotFound(_0x28a94b,null))[_0x2626('0x1f')](saveUpdates(_0x1e4b0b[_0x2626('0x4c')],null))[_0x2626('0x1f')](respondWithResult(_0x28a94b,null))[_0x2626('0x41')](handleError(_0x28a94b,null));};exports[_0x2626('0x20')]=function(_0x1083cd,_0x3fe841){return db[_0x2626('0x2a')][_0x2626('0x43')]({'where':{'id':_0x1083cd[_0x2626('0x4d')]['id']}})[_0x2626('0x1f')](handleEntityNotFound(_0x3fe841,null))[_0x2626('0x1f')](removeEntity(_0x3fe841,null))[_0x2626('0x41')](handleError(_0x3fe841,null));};exports[_0x2626('0x4e')]=function(_0x5980ef,_0x3fcd24){var _0x469631=0xa;var _0xd28c93=[_0x2626('0x4f'),_0x2626('0x50'),_0x2626('0x51'),_0x2626('0x52')];var _0x26447d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2626('0x53'),'MAX':_0x2626('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':_0x2626('0x56'),'GROUP_CONCAT DESC':_0x2626('0x57')};var _0xf18de7={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0x43d027=function(_0x770789){return!_['includes']([_0x2626('0x5c'),_0x2626('0x5d'),_0x2626('0x5e'),_0x2626('0x5f')],_0x770789);};var _0x5afe0d=function(_0x31944f){if(!_0x31944f||!_0x31944f[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x1466a3='(',_0x44023e=0x0;_0x44023e<_0x31944f[_0x2626('0x60')][_0x2626('0x34')];_0x44023e+=0x1){_0x44023e>0x0&&(_0x1466a3+='\x20'+_0x31944f[_0x2626('0x61')]+'\x20');_0x1466a3+=_0x31944f[_0x2626('0x60')][_0x44023e]['group']?_0x5afe0d(_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x62')]):_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x63')]+'\x20'+_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x64')]+(_0x43d027(_0x31944f['rules'][_0x44023e][_0x2626('0x64')])?'\x20'+_0x31944f[_0x2626('0x60')][_0x44023e]['value']:'');}return _0x1466a3+')';};var _0x5ce8e2={'where':{'id':_0x5980ef[_0x2626('0x4d')]['id']}},_0x546a68,_0xb759df,_0x24f1b5,_0x1faa54,_0x27ad57;_0x5ce8e2=_[_0x2626('0x65')]({},_0x5ce8e2,_0x5980ef['options']);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x5ce8e2)[_0x2626('0x1f')](function(_0x43a8fb){if(_0x43a8fb){_0x546a68=_0x43a8fb;return _0x43a8fb['getFields']();}return null;})[_0x2626('0x1f')](function(_0x2a9fc7){if(_0x2a9fc7){if(!_0x2a9fc7[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xb759df=_0x2a9fc7;return db[_0x2626('0x68')]['findAll']({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x34bf80){if(_0x34bf80){_0x24f1b5=_[_0x2626('0x69')](_0x34bf80,'id');var _0x35b790;var _0x4510ed=squel[_0x2626('0x6a')]();_0x4510ed[_0x2626('0x6b')](_0x546a68['table']);for(var _0x1d0266=0x0;_0x1d0266<_0xb759df[_0x2626('0x34')];_0x1d0266+=0x1){_0x35b790=_0xb759df[_0x1d0266]['MetricId']?_0x24f1b5[_0xb759df[_0x1d0266][_0x2626('0x6c')]][_0x2626('0x6d')]:_0xb759df[_0x1d0266][_0x2626('0x63')];_0x35b790=_0xb759df[_0x1d0266][_0x2626('0x6e')]?_[_0x2626('0x6f')](_0x26447d[_0xb759df[_0x1d0266]['function']],'%s',_0x35b790):_0x35b790;_0x35b790=_0xb759df[_0x1d0266][_0x2626('0x70')]?_[_0x2626('0x6f')](_0xf18de7[_0xb759df[_0x1d0266]['format']],'%s',_0x35b790):_0x35b790;if(_0xb759df[_0x1d0266]['groupBy']){_0x4510ed[_0x2626('0x62')](_0x35b790);}_0xb759df[_0x1d0266][_0x2626('0x71')]&&_0x4510ed[_0x2626('0x36')](_0x35b790,_0xb759df[_0x1d0266][_0x2626('0x71')]===_0x2626('0x72')?![]:!![]);_0x4510ed[_0x2626('0x63')](_0x35b790,_0xb759df[_0x1d0266][_0x2626('0x73')]||_0x35b790);}if(_0x546a68['joins']){_0x546a68['joins']=JSON[_0x2626('0x74')](_0x546a68[_0x2626('0x75')]);for(var _0x29584d=0x0;_0x29584d<_0x546a68['joins']['length'];_0x29584d+=0x1){if(_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0xd28c93,_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')])&&_0x546a68['joins'][_0x29584d][_0x2626('0x77')]&&_0x546a68['joins'][_0x29584d][_0x2626('0x78')]&&_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x79')]){_0x4510ed[_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')]](_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x78')],null,util[_0x2626('0x70')](_0x2626('0x7a'),_0x546a68[_0x2626('0x7b')],_0x546a68['joins'][_0x29584d][_0x2626('0x77')],_0x546a68[_0x2626('0x75')][_0x29584d]['foreignTable'],_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x79')]));}}}if(_0x546a68[_0x2626('0x7c')]){_0x546a68['conditions']=JSON['parse'](_0x546a68[_0x2626('0x7c')]);_0x4510ed['where'](_0x5afe0d(_0x546a68[_0x2626('0x7c')]['group']));}_0x27ad57=_0x4510ed[_0x2626('0x7d')]();_0x4510ed[_0x2626('0x16')](_0x469631);_0x4510ed[_0x2626('0x15')](0x0);logger[_0x2626('0x7e')]('Limited\x20Query:',_0x4510ed['toString']());return dbH[_0x2626('0x7f')]['query'](_0x4510ed[_0x2626('0x80')](),{'type':dbH[_0x2626('0x7f')][_0x2626('0x81')][_0x2626('0x82')]});}})[_0x2626('0x1f')](respondWithResult(_0x3fcd24,null))[_0x2626('0x41')](handleError(_0x3fcd24,null));};function runReport(_0x121bd3,_0x3bf673,_0x1fa4a3){var _0x55228c=_0x3bf673[_0x2626('0x26')];var _0x452c35=0xa;var _0x42e45f=[_0x2626('0x4f'),_0x2626('0x50'),'right_join',_0x2626('0x52')];var _0x2c4ffe={'SUM':_0x2626('0x83'),'COUNT':_0x2626('0x84'),'COUNT DISTINCT':_0x2626('0x53'),'MAX':_0x2626('0x54'),'MIN':_0x2626('0x85'),'AVG':_0x2626('0x86'),'GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':_0x2626('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b262b={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':_0x2626('0x87'),'ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0x18a9ea=function(_0x7ac956){return!_[_0x2626('0x76')]([_0x2626('0x5c'),'IS\x20NOT\x20NULL',_0x2626('0x5e'),_0x2626('0x5f')],_0x7ac956);};var _0x4754e4=function(_0x3d0207){if(!_0x3d0207||!_0x3d0207[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x35662e='(',_0x1d0c52=0x0;_0x1d0c52<_0x3d0207['rules'][_0x2626('0x34')];_0x1d0c52+=0x1){_0x1d0c52>0x0&&(_0x35662e+='\x20'+_0x3d0207[_0x2626('0x61')]+'\x20');_0x35662e+=_0x3d0207['rules'][_0x1d0c52][_0x2626('0x62')]?_0x4754e4(_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x62')]):_0x3d0207['rules'][_0x1d0c52][_0x2626('0x63')]+'\x20'+_0x3d0207[_0x2626('0x60')][_0x1d0c52]['condition']+(_0x18a9ea(_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x64')])?'\x20'+_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x88')]:'');}return _0x35662e+')';};var _0x447591={'where':{'id':_0x121bd3['id']}},_0x53a76c,_0x1d5d69,_0x17ffad,_0xf5b056,_0x4cd3d5;_0x447591=_[_0x2626('0x65')]({},_0x447591,_0x1fa4a3);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x447591)[_0x2626('0x1f')](function(_0x4e1e11){if(_0x4e1e11){_0x53a76c=_0x4e1e11;return _0x4e1e11[_0x2626('0x89')]();}return null;})[_0x2626('0x1f')](function(_0x4d09b2){if(_0x4d09b2){if(!_0x4d09b2[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1d5d69=_0x4d09b2;return db[_0x2626('0x68')]['findAll']({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x6937a6){if(_0x6937a6){_0x17ffad=_[_0x2626('0x69')](_0x6937a6,'id');var _0x4d2cf7;var _0x355340=squel[_0x2626('0x6a')]();_0x355340[_0x2626('0x6b')](_0x53a76c[_0x2626('0x7b')]);for(var _0x433bba=0x0;_0x433bba<_0x1d5d69[_0x2626('0x34')];_0x433bba+=0x1){_0x4d2cf7=_0x1d5d69[_0x433bba][_0x2626('0x6c')]?_0x17ffad[_0x1d5d69[_0x433bba]['MetricId']]['metric']:_0x1d5d69[_0x433bba][_0x2626('0x63')];_0x4d2cf7=_0x1d5d69[_0x433bba]['function']?_[_0x2626('0x6f')](_0x2c4ffe[_0x1d5d69[_0x433bba]['function']],'%s',_0x4d2cf7):_0x4d2cf7;_0x4d2cf7=_0x1d5d69[_0x433bba]['format']?_[_0x2626('0x6f')](_0x5b262b[_0x1d5d69[_0x433bba][_0x2626('0x70')]],'%s',_0x4d2cf7):_0x4d2cf7;if(_0x1d5d69[_0x433bba][_0x2626('0x8a')]){_0x355340[_0x2626('0x62')](_0x4d2cf7);}_0x1d5d69[_0x433bba][_0x2626('0x71')]&&_0x355340[_0x2626('0x36')](_0x4d2cf7,_0x1d5d69[_0x433bba][_0x2626('0x71')]===_0x2626('0x72')?![]:!![]);_0x355340[_0x2626('0x63')](_0x4d2cf7,_0x1d5d69[_0x433bba][_0x2626('0x73')]||_0x4d2cf7);}if(_0x53a76c[_0x2626('0x75')]){_0x53a76c['joins']=JSON[_0x2626('0x74')](_0x53a76c['joins']);for(var _0x2c479c=0x0;_0x2c479c<_0x53a76c[_0x2626('0x75')][_0x2626('0x34')];_0x2c479c+=0x1){if(_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0x42e45f,_0x53a76c[_0x2626('0x75')][_0x2c479c]['type'])&&_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x77')]&&_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x78')]&&_0x53a76c['joins'][_0x2c479c]['foreignKey']){_0x355340[_0x53a76c['joins'][_0x2c479c][_0x2626('0x2c')]](_0x53a76c[_0x2626('0x75')][_0x2c479c]['foreignTable'],null,util['format'](_0x2626('0x7a'),_0x53a76c[_0x2626('0x7b')],_0x53a76c[_0x2626('0x75')][_0x2c479c]['parentKey'],_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x78')],_0x53a76c['joins'][_0x2c479c][_0x2626('0x79')]));}}}if(_0x53a76c['conditions']){_0x53a76c[_0x2626('0x7c')]=JSON[_0x2626('0x74')](_0x53a76c[_0x2626('0x7c')]);_0x355340[_0x2626('0x38')](_0x4754e4(_0x53a76c['conditions'][_0x2626('0x62')]));}_0x4cd3d5=_0x355340[_0x2626('0x7d')]();_0x355340[_0x2626('0x16')](_0x452c35);_0x355340[_0x2626('0x15')](0x0);return;}})['then'](function(){if(_0x3bf673[_0x2626('0x8b')]==='web'){return null;}var _0x1478dd=_[_0x2626('0x65')](_0x3bf673,{'name':_0x3bf673['fullPath']||_0x3bf673[_0x2626('0x26')]||_0x53a76c[_0x2626('0x26')],'basename':_0x55228c,'savename':util[_0x2626('0x70')]('%s-%s.%s',_0x3bf673[_0x2626('0x26')]||_0x53a76c[_0x2626('0x26')],require('randomstring')[_0x2626('0x8c')](0x4),_0x3bf673[_0x2626('0x8b')]||_0x2626('0x8d')),'reportId':_0x53a76c['id'],'reportType':_0x2626('0x8e')});return db[_0x2626('0x8f')]['create'](_0x1478dd,{'raw':!![]});})['then'](function(_0x5f58af){if(_0x53a76c[_0x2626('0x7b')]==='cdr'){_0x4cd3d5['where'](_0x53a76c[_0x2626('0x7b')]+_0x2626('0x90'),_0x3bf673[_0x2626('0x91')],_0x3bf673[_0x2626('0x92')]);}else{_0x4cd3d5[_0x2626('0x38')](_0x53a76c[_0x2626('0x7b')]+_0x2626('0x93'),_0x3bf673[_0x2626('0x91')],_0x3bf673[_0x2626('0x92')]);}if(_0x5f58af){logger[_0x2626('0x94')](_0x2626('0x95'),_0x4cd3d5['toString']());require(_0x2626('0x96'))[_0x2626('0x97')](path[_0x2626('0x4f')](__dirname,_0x2626('0x98'),_0x5f58af[_0x2626('0x8b')]),[_0x5f58af['id'],_0x4cd3d5['toString'](),path['join'](__dirname,_0x2626('0x99'),_0x5f58af[_0x2626('0x9a')]),_0x55228c]);return _0x5f58af;}else{var _0x471005=squel[_0x2626('0x6a')]();_0x471005[_0x2626('0x6b')]('('+_0x4cd3d5['toString']()+')',_0x2626('0x9b'));_0x471005[_0x2626('0x63')](_0x2626('0x9c'),'count');_0x4cd3d5[_0x2626('0x16')](_0x3bf673[_0x2626('0x16')]||_0x452c35);_0x4cd3d5[_0x2626('0x15')](_0x3bf673[_0x2626('0x15')]||0x0);return dbH['sequelize'][_0x2626('0x2e')](_0x471005[_0x2626('0x80')](),{'type':dbH['sequelize'][_0x2626('0x81')][_0x2626('0x82')]})[_0x2626('0x1f')](function(_0x4a8761){if(!_0x4a8761['length']){_0xf5b056=0x0;}else{_0xf5b056=_0x4a8761[0x0][_0x2626('0x18')]||0x0;}return dbH['sequelize'][_0x2626('0x2e')](_0x4cd3d5[_0x2626('0x80')](),{'type':dbH[_0x2626('0x7f')]['QueryTypes']['SELECT']});})[_0x2626('0x1f')](function(_0x5c5813){return{'rows':_0x5c5813||[],'count':_0xf5b056};});}});}exports[_0x2626('0x9d')]=function(_0x32d983,_0x529ce2){return runReport(_0x32d983[_0x2626('0x4d')],_0x32d983[_0x2626('0x2e')],_0x32d983[_0x2626('0x3c')])['then'](respondWithResult(_0x529ce2,null))[_0x2626('0x41')](handleError(_0x529ce2,null));};exports['runReport']=runReport;exports[_0x2626('0x2e')]=function(_0x42f985,_0x9c837e){var _0xf90360=0xa;var _0xd6b20c=[_0x2626('0x4f'),'left_join',_0x2626('0x51'),_0x2626('0x52')];var _0x17c7ae={'SUM':_0x2626('0x83'),'COUNT':_0x2626('0x84'),'COUNT DISTINCT':_0x2626('0x53'),'MAX':'MAX(%s)','MIN':_0x2626('0x85'),'AVG':_0x2626('0x86'),'GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2626('0x57')};var _0x504b52={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0xa5d20d=function(_0x1c5198){return!_[_0x2626('0x76')]([_0x2626('0x5c'),_0x2626('0x5d'),_0x2626('0x5e'),_0x2626('0x5f')],_0x1c5198);};var _0x115015=function(_0x5217f1){if(!_0x5217f1||!_0x5217f1[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x9341f1='(',_0x36473b=0x0;_0x36473b<_0x5217f1[_0x2626('0x60')][_0x2626('0x34')];_0x36473b+=0x1){_0x36473b>0x0&&(_0x9341f1+='\x20'+_0x5217f1[_0x2626('0x61')]+'\x20');_0x9341f1+=_0x5217f1[_0x2626('0x60')][_0x36473b]['group']?_0x115015(_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x62')]):_0x5217f1['rules'][_0x36473b][_0x2626('0x63')]+'\x20'+_0x5217f1[_0x2626('0x60')][_0x36473b]['condition']+(_0xa5d20d(_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x64')])?'\x20'+_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x88')]:'');}return _0x9341f1+')';};var _0x50062e={'where':{'id':_0x42f985[_0x2626('0x4d')]['id']}},_0x4c8142,_0x540430,_0x468884,_0x5aaa9e,_0x3c4c13;_0x50062e=_[_0x2626('0x65')]({},_0x50062e,_0x42f985[_0x2626('0x3c')]);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x50062e)['then'](function(_0x3a49e4){if(_0x3a49e4){_0x4c8142=_0x3a49e4;return _0x3a49e4[_0x2626('0x89')]();}return null;})[_0x2626('0x1f')](function(_0x4346ab){if(_0x4346ab){if(!_0x4346ab[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))](_0x2626('0x9e'),0x193);}_0x540430=_0x4346ab;return db[_0x2626('0x68')][_0x2626('0x3f')]({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x5a7b20){if(_0x5a7b20){_0x468884=_[_0x2626('0x69')](_0x5a7b20,'id');var _0x1cbcf8;var _0x4730b7=squel[_0x2626('0x6a')]();_0x4730b7['from'](_0x4c8142[_0x2626('0x7b')]);for(var _0x467f25=0x0;_0x467f25<_0x540430[_0x2626('0x34')];_0x467f25+=0x1){_0x1cbcf8=_0x540430[_0x467f25][_0x2626('0x6c')]?_0x468884[_0x540430[_0x467f25][_0x2626('0x6c')]][_0x2626('0x6d')]:_0x540430[_0x467f25][_0x2626('0x63')];_0x1cbcf8=_0x540430[_0x467f25][_0x2626('0x6e')]?_['replace'](_0x17c7ae[_0x540430[_0x467f25]['function']],'%s',_0x1cbcf8):_0x1cbcf8;_0x1cbcf8=_0x540430[_0x467f25]['format']?_[_0x2626('0x6f')](_0x504b52[_0x540430[_0x467f25][_0x2626('0x70')]],'%s',_0x1cbcf8):_0x1cbcf8;if(_0x540430[_0x467f25]['groupBy']){_0x4730b7['group'](_0x1cbcf8);}_0x540430[_0x467f25][_0x2626('0x71')]&&_0x4730b7[_0x2626('0x36')](_0x1cbcf8,_0x540430[_0x467f25][_0x2626('0x71')]==='DESC'?![]:!![]);_0x4730b7[_0x2626('0x63')](_0x1cbcf8,_0x540430[_0x467f25][_0x2626('0x73')]||_0x1cbcf8);}if(_0x4c8142[_0x2626('0x75')]){_0x4c8142[_0x2626('0x75')]=JSON[_0x2626('0x74')](_0x4c8142['joins']);for(var _0x4161c5=0x0;_0x4161c5<_0x4c8142[_0x2626('0x75')]['length'];_0x4161c5+=0x1){if(_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0xd6b20c,_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x2c')])&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x77')]&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x78')]&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x79')]){_0x4730b7[_0x4c8142[_0x2626('0x75')][_0x4161c5]['type']](_0x4c8142[_0x2626('0x75')][_0x4161c5]['foreignTable'],null,util[_0x2626('0x70')](_0x2626('0x7a'),_0x4c8142[_0x2626('0x7b')],_0x4c8142['joins'][_0x4161c5][_0x2626('0x77')],_0x4c8142[_0x2626('0x75')][_0x4161c5]['foreignTable'],_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x79')]));}}}if(_0x4c8142[_0x2626('0x7c')]){_0x4c8142[_0x2626('0x7c')]=JSON['parse'](_0x4c8142[_0x2626('0x7c')]);_0x4730b7[_0x2626('0x38')](_0x115015(_0x4c8142[_0x2626('0x7c')][_0x2626('0x62')]));}_0x3c4c13=_0x4730b7[_0x2626('0x7d')]();_0x4730b7[_0x2626('0x16')](_0xf90360);_0x4730b7[_0x2626('0x15')](0x0);logger['debug'](_0x2626('0x9f'),_0x4730b7[_0x2626('0x80')]());return dbH['sequelize']['query'](_0x4730b7[_0x2626('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0x2626('0x82')]});}})[_0x2626('0x1f')](function(){return{'sql':_0x3c4c13[_0x2626('0x80')]()};})['then'](respondWithResult(_0x9c837e,null))[_0x2626('0x41')](handleError(_0x9c837e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 42e7dff..50e89fc 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 _0x1027=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x1027,0xc1));var _0x7102=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x1027[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x7102('0x0'));var util=require(_0x7102('0x1'));var logger=require(_0x7102('0x2'))(_0x7102('0x3'));var moment=require(_0x7102('0x4'));var BPromise=require(_0x7102('0x5'));var rp=require(_0x7102('0x6'));var fs=require('fs');var path=require(_0x7102('0x7'));var rimraf=require(_0x7102('0x8'));var config=require(_0x7102('0x9'));var attributes=require(_0x7102('0xa'));module[_0x7102('0xb')]=function(_0x373853,_0x35cdd7){return _0x373853[_0x7102('0xc')](_0x7102('0xd'),attributes,{'tableName':_0x7102('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedf9=['util','../../config/logger','api','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x41f72f,_0x1e4e5b){var _0x3150aa=function(_0x2e7903){while(--_0x2e7903){_0x41f72f['push'](_0x41f72f['shift']());}};_0x3150aa(++_0x1e4e5b);}(_0xedf9,0x99));var _0x9edf=function(_0x24fd75,_0x937198){_0x24fd75=_0x24fd75-0x0;var _0x591a95=_0xedf9[_0x24fd75];return _0x591a95;};'use strict';var _=require(_0x9edf('0x0'));var util=require(_0x9edf('0x1'));var logger=require(_0x9edf('0x2'))(_0x9edf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9edf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9edf('0x5'));var config=require('../../config/environment');var attributes=require(_0x9edf('0x6'));module[_0x9edf('0x7')]=function(_0x587317,_0x2e877d){return _0x587317[_0x9edf('0x8')](_0x9edf('0x9'),attributes,{'tableName':_0x9edf('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 dea292e..de5e32b 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 _0x0ff9=['client','request','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0x0ff9,0x11a));var _0x90ff=function(_0x16ba7f,_0x2928f8){_0x16ba7f=_0x16ba7f-0x0;var _0x3ca577=_0x0ff9[_0x16ba7f];return _0x3ca577;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var moment=require(_0x90ff('0x2'));var BPromise=require(_0x90ff('0x3'));var rs=require(_0x90ff('0x4'));var fs=require('fs');var Redis=require(_0x90ff('0x5'));var db=require(_0x90ff('0x6'))['db'];var utils=require(_0x90ff('0x7'));var logger=require(_0x90ff('0x8'))(_0x90ff('0x9'));var config=require(_0x90ff('0xa'));var jayson=require(_0x90ff('0xb'));var client=jayson[_0x90ff('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23109b,_0x2add9c,_0x320ca1){return new BPromise(function(_0x2b58a7,_0x1747b9){return client[_0x90ff('0xd')](_0x23109b,_0x320ca1)['then'](function(_0xeaab26){logger[_0x90ff('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x90ff('0xf'));logger['debug'](_0x90ff('0x10'),_0x2add9c,_0x90ff('0xf'),JSON['stringify'](_0xeaab26));if(_0xeaab26[_0x90ff('0x11')]){if(_0xeaab26['error'][_0x90ff('0x12')]===0x1f4){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26[_0x90ff('0x11')]['message']);return _0x1747b9(_0xeaab26['error']['message']);}logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26['error'][_0x90ff('0x13')]);return _0x2b58a7(_0xeaab26[_0x90ff('0x11')]['message']);}else{logger[_0x90ff('0xe')](_0x90ff('0x14'),_0x2add9c,_0x90ff('0xf'));_0x2b58a7(_0xeaab26['result']['message']);}})['catch'](function(_0x3d179d){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x3d179d);_0x1747b9(_0x3d179d);});});} \ No newline at end of file +var _0xb728=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x5160da,_0x3aa93d){var _0x4647ec=function(_0x3354c3){while(--_0x3354c3){_0x5160da['push'](_0x5160da['shift']());}};_0x4647ec(++_0x3aa93d);}(_0xb728,0x64));var _0x8b72=function(_0x2bf8cd,_0x59f8c3){_0x2bf8cd=_0x2bf8cd-0x0;var _0x3d48ea=_0xb728[_0x2bf8cd];return _0x3d48ea;};'use strict';var _=require(_0x8b72('0x0'));var util=require(_0x8b72('0x1'));var moment=require(_0x8b72('0x2'));var BPromise=require(_0x8b72('0x3'));var rs=require(_0x8b72('0x4'));var fs=require('fs');var Redis=require(_0x8b72('0x5'));var db=require(_0x8b72('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b72('0x7'))(_0x8b72('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b72('0x9')][_0x8b72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a98f,_0x53dc02,_0x29173b){return new BPromise(function(_0x27f994,_0x168f16){return client[_0x8b72('0xb')](_0x28a98f,_0x29173b)[_0x8b72('0xc')](function(_0x745506){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53dc02,_0x8b72('0xd'));logger[_0x8b72('0xe')](_0x8b72('0xf'),_0x53dc02,_0x8b72('0xd'),JSON[_0x8b72('0x10')](_0x745506));if(_0x745506[_0x8b72('0x11')]){if(_0x745506[_0x8b72('0x11')][_0x8b72('0x12')]===0x1f4){logger[_0x8b72('0x11')](_0x8b72('0x13'),_0x53dc02,_0x745506[_0x8b72('0x11')]['message']);return _0x168f16(_0x745506['error'][_0x8b72('0x14')]);}logger[_0x8b72('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53dc02,_0x745506[_0x8b72('0x11')][_0x8b72('0x14')]);return _0x27f994(_0x745506[_0x8b72('0x11')][_0x8b72('0x14')]);}else{logger[_0x8b72('0x15')](_0x8b72('0x13'),_0x53dc02,_0x8b72('0xd'));_0x27f994(_0x745506[_0x8b72('0x16')][_0x8b72('0x14')]);}})[_0x8b72('0x17')](function(_0x45e02b){logger[_0x8b72('0x11')](_0x8b72('0x13'),_0x53dc02,_0x45e02b);_0x168f16(_0x45e02b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 9adc441..d5993d7 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 _0x6c4f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports','util','path','express','Router','fs-extra'];(function(_0x51ce23,_0x205248){var _0x211944=function(_0x92eae3){while(--_0x92eae3){_0x51ce23['push'](_0x51ce23['shift']());}};_0x211944(++_0x205248);}(_0x6c4f,0x1a4));var _0xf6c4=function(_0x1d8653,_0x5b05e3){_0x1d8653=_0x1d8653-0x0;var _0x59dbc0=_0x6c4f[_0x1d8653];return _0x59dbc0;};'use strict';var multer=require('multer');var util=require(_0xf6c4('0x0'));var path=require(_0xf6c4('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6c4('0x2'));var router=express[_0xf6c4('0x3')]();var fs_extra=require(_0xf6c4('0x4'));var auth=require(_0xf6c4('0x5'));var interaction=require(_0xf6c4('0x6'));var config=require(_0xf6c4('0x7'));var controller=require(_0xf6c4('0x8'));router[_0xf6c4('0x9')]('/',auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xb')]);router[_0xf6c4('0x9')](_0xf6c4('0xc'),auth['isAuthenticated'](),controller[_0xf6c4('0xd')]);router['get'](_0xf6c4('0xe'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xf')]);router[_0xf6c4('0x9')](_0xf6c4('0x10'),auth['isAuthenticated'](),controller[_0xf6c4('0x11')]);router[_0xf6c4('0x9')](_0xf6c4('0x12'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x13')]);router[_0xf6c4('0x14')]('/',auth[_0xf6c4('0xa')](),controller['create']);router[_0xf6c4('0x15')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x16')]);router[_0xf6c4('0x17')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller['destroy']);module[_0xf6c4('0x18')]=router; \ No newline at end of file +var _0x6f6a=['show','/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x6f6a,0x165));var _0xa6f6=function(_0x2e30c6,_0x101c8e){_0x2e30c6=_0x2e30c6-0x0;var _0x5d5f99=_0x6f6a[_0x2e30c6];return _0x5d5f99;};'use strict';var multer=require('multer');var util=require(_0xa6f6('0x0'));var path=require(_0xa6f6('0x1'));var timeout=require(_0xa6f6('0x2'));var express=require(_0xa6f6('0x3'));var router=express[_0xa6f6('0x4')]();var fs_extra=require(_0xa6f6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6f6('0x6'));var config=require(_0xa6f6('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xa6f6('0x8')]('/',auth[_0xa6f6('0x9')](),controller[_0xa6f6('0xa')]);router[_0xa6f6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa6f6('0xb')]);router['get'](_0xa6f6('0xc'),auth[_0xa6f6('0x9')](),controller['preview']);router[_0xa6f6('0x8')](_0xa6f6('0xd'),auth[_0xa6f6('0x9')](),controller[_0xa6f6('0xe')]);router[_0xa6f6('0x8')](_0xa6f6('0xf'),auth['isAuthenticated'](),controller[_0xa6f6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa6f6('0x11')]);router[_0xa6f6('0x12')](_0xa6f6('0x13'),auth[_0xa6f6('0x9')](),controller[_0xa6f6('0x14')]);router[_0xa6f6('0x15')](_0xa6f6('0x13'),auth[_0xa6f6('0x9')](),controller['destroy']);module[_0xa6f6('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5ae1c00..ca1abb9 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 _0xda19=['exports','STRING','TEXT'];(function(_0x474a40,_0x3377aa){var _0x21f947=function(_0xfe8aba){while(--_0xfe8aba){_0x474a40['push'](_0x474a40['shift']());}};_0x21f947(++_0x3377aa);}(_0xda19,0xd5));var _0x9da1=function(_0x4ba81e,_0x406c22){_0x4ba81e=_0x4ba81e-0x0;var _0x1d2886=_0xda19[_0x4ba81e];return _0x1d2886;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x1f3fb6,_0x53c142){var _0x450da7=function(_0x49dbb0){while(--_0x49dbb0){_0x1f3fb6['push'](_0x1f3fb6['shift']());}};_0x450da7(++_0x53c142);}(_0x98a8,0x12c));var _0x898a=function(_0x18cbde,_0x18afcb){_0x18cbde=_0x18cbde-0x0;var _0x1fb43a=_0x98a8[_0x18cbde];return _0x1fb43a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('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 1fb3bb5..963cea0 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x59b677,_0xf359aa){var _0x5bb449=function(_0x21cd87){while(--_0x21cd87){_0x59b677['push'](_0x59b677['shift']());}};_0x5bb449(++_0xf359aa);}(_0x814b,0x1a2));var _0xb814=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x814b[_0x1558ab];return _0x53b64a;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x97db75,_0x3abdb8){var _0x259a53=function(_0x4af802){while(--_0x4af802){_0x97db75['push'](_0x97db75['shift']());}};_0x259a53(++_0x3abdb8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a178562..fd7bffb 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 _0xa12f=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','util','api','moment','bluebird','path'];(function(_0xd0b141,_0x5fa4dc){var _0x3c06b5=function(_0x4b6a3c){while(--_0x4b6a3c){_0xd0b141['push'](_0xd0b141['shift']());}};_0x3c06b5(++_0x5fa4dc);}(_0xa12f,0xaf));var _0xfa12=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa12f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xfa12('0x0'));var logger=require('../../config/logger')(_0xfa12('0x1'));var moment=require(_0xfa12('0x2'));var BPromise=require(_0xfa12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa12('0x4'));var rimraf=require(_0xfa12('0x5'));var config=require(_0xfa12('0x6'));var attributes=require(_0xfa12('0x7'));module[_0xfa12('0x8')]=function(_0x39cd5d,_0x532950){return _0x39cd5d['define']('AnalyticDefaultReport',attributes,{'tableName':_0xfa12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe588=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x20d9f0,_0x453415){var _0x195dda=function(_0x58d8e8){while(--_0x58d8e8){_0x20d9f0['push'](_0x20d9f0['shift']());}};_0x195dda(++_0x453415);}(_0xe588,0x18a));var _0x8e58=function(_0x535517,_0x1095be){_0x535517=_0x535517-0x0;var _0xc1f779=_0xe588[_0x535517];return _0xc1f779;};'use strict';var _=require(_0x8e58('0x0'));var util=require(_0x8e58('0x1'));var logger=require(_0x8e58('0x2'))('api');var moment=require(_0x8e58('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e58('0x4'));var fs=require('fs');var path=require(_0x8e58('0x5'));var rimraf=require(_0x8e58('0x6'));var config=require(_0x8e58('0x7'));var attributes=require(_0x8e58('0x8'));module[_0x8e58('0x9')]=function(_0x5644ff,_0x2fb72c){return _0x5644ff[_0x8e58('0xa')](_0x8e58('0xb'),attributes,{'tableName':_0x8e58('0xc'),'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 b28fe58..5744dbe 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 _0x2525=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','ioredis'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2525,0xed));var _0x5252=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2525[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x5252('0x0'));var moment=require('moment');var BPromise=require(_0x5252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5252('0x2'));var db=require(_0x5252('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5252('0x4'))('rpc');var config=require(_0x5252('0x5'));var jayson=require(_0x5252('0x6'));var client=jayson[_0x5252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299174,_0x53c4e6,_0x2de5f4){return new BPromise(function(_0x313201,_0x422f55){return client[_0x5252('0x8')](_0x299174,_0x2de5f4)[_0x5252('0x9')](function(_0x5c0469){logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));logger[_0x5252('0xd')](_0x5252('0xe'),_0x53c4e6,_0x5252('0xc'),JSON[_0x5252('0xf')](_0x5c0469));if(_0x5c0469['error']){if(_0x5c0469[_0x5252('0x10')][_0x5252('0x11')]===0x1f4){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x5c0469['error'][_0x5252('0x12')]);return _0x422f55(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}logger[_0x5252('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53c4e6,_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);return _0x313201(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}else{logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));_0x313201(_0x5c0469[_0x5252('0x13')][_0x5252('0x12')]);}})['catch'](function(_0x24db6f){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x24db6f);_0x422f55(_0x24db6f);});});} \ No newline at end of file +var _0x672c=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird'];(function(_0x2318e6,_0x555547){var _0x123900=function(_0x5a9f05){while(--_0x5a9f05){_0x2318e6['push'](_0x2318e6['shift']());}};_0x123900(++_0x555547);}(_0x672c,0x1b5));var _0xc672=function(_0x5aee2e,_0x3d2704){_0x5aee2e=_0x5aee2e-0x0;var _0x3f043f=_0x672c[_0x5aee2e];return _0x3f043f;};'use strict';var _=require('lodash');var util=require(_0xc672('0x0'));var moment=require(_0xc672('0x1'));var BPromise=require(_0xc672('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc672('0x3'));var db=require(_0xc672('0x4'))['db'];var utils=require(_0xc672('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc672('0x6'));var client=jayson[_0xc672('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27fb8b,_0xe65ef2,_0x518edb){return new BPromise(function(_0x353805,_0xc7b68f){return client[_0xc672('0x8')](_0x27fb8b,_0x518edb)[_0xc672('0x9')](function(_0x261908){logger['info'](_0xc672('0xa'),_0xe65ef2,_0xc672('0xb'));logger[_0xc672('0xc')](_0xc672('0xd'),_0xe65ef2,'request\x20sent',JSON[_0xc672('0xe')](_0x261908));if(_0x261908[_0xc672('0xf')]){if(_0x261908[_0xc672('0xf')][_0xc672('0x10')]===0x1f4){logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x261908['error'][_0xc672('0x11')]);return _0xc7b68f(_0x261908[_0xc672('0xf')][_0xc672('0x11')]);}logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x261908[_0xc672('0xf')][_0xc672('0x11')]);return _0x353805(_0x261908[_0xc672('0xf')][_0xc672('0x11')]);}else{logger[_0xc672('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe65ef2,_0xc672('0xb'));_0x353805(_0x261908['result'][_0xc672('0x11')]);}})[_0xc672('0x13')](function(_0x900ce4){logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x900ce4);_0xc7b68f(_0x900ce4);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7e906ce..239d185 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 _0x563f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x18141b,_0x45c769){var _0x474c30=function(_0x7de6d1){while(--_0x7de6d1){_0x18141b['push'](_0x18141b['shift']());}};_0x474c30(++_0x45c769);}(_0x563f,0x158));var _0xf563=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x563f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var path=require(_0xf563('0x2'));var timeout=require('connect-timeout');var express=require(_0xf563('0x3'));var router=express[_0xf563('0x4')]();var fs_extra=require(_0xf563('0x5'));var auth=require(_0xf563('0x6'));var interaction=require(_0xf563('0x7'));var config=require(_0xf563('0x8'));var controller=require(_0xf563('0x9'));router[_0xf563('0xa')]('/',auth[_0xf563('0xb')](),controller[_0xf563('0xc')]);router[_0xf563('0xa')](_0xf563('0xd'),auth[_0xf563('0xb')](),controller['show']);router[_0xf563('0xa')]('/:id/preview',auth[_0xf563('0xb')](),controller[_0xf563('0xe')]);router['get'](_0xf563('0xf'),auth[_0xf563('0xb')](),controller[_0xf563('0x10')]);router[_0xf563('0xa')](_0xf563('0x11'),auth['isAuthenticated'](),controller[_0xf563('0x12')]);router[_0xf563('0x13')]('/',auth['isAuthenticated'](),controller[_0xf563('0x14')]);router[_0xf563('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf563('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf563('0x17')]);module[_0xf563('0x18')]=router; \ No newline at end of file +var _0x5696=['./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','/:id/preview','preview','get','run','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f7502,_0x56f298){var _0x332db4=function(_0x2d90c6){while(--_0x2d90c6){_0x2f7502['push'](_0x2f7502['shift']());}};_0x332db4(++_0x56f298);}(_0x5696,0xbe));var _0x6569=function(_0x562fc8,_0x2ff988){_0x562fc8=_0x562fc8-0x0;var _0x4b42d8=_0x5696[_0x562fc8];return _0x4b42d8;};'use strict';var multer=require(_0x6569('0x0'));var util=require(_0x6569('0x1'));var path=require(_0x6569('0x2'));var timeout=require(_0x6569('0x3'));var express=require(_0x6569('0x4'));var router=express[_0x6569('0x5')]();var fs_extra=require(_0x6569('0x6'));var auth=require(_0x6569('0x7'));var interaction=require(_0x6569('0x8'));var config=require(_0x6569('0x9'));var controller=require(_0x6569('0xa'));router['get']('/',auth[_0x6569('0xb')](),controller[_0x6569('0xc')]);router['get'](_0x6569('0xd'),auth['isAuthenticated'](),controller[_0x6569('0xe')]);router['get'](_0x6569('0xf'),auth[_0x6569('0xb')](),controller[_0x6569('0x10')]);router[_0x6569('0x11')]('/:id/run',auth[_0x6569('0xb')](),controller[_0x6569('0x12')]);router['get']('/:id/query',auth[_0x6569('0xb')](),controller['query']);router[_0x6569('0x13')]('/',auth[_0x6569('0xb')](),controller[_0x6569('0x14')]);router[_0x6569('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6569('0x16')]);router[_0x6569('0x17')]('/:id',auth[_0x6569('0xb')](),controller['destroy']);module[_0x6569('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index efb28f3..4af9225 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 _0x42d0=['UNSIGNED','moment','exports','STRING','ENUM','csv','xlsx','DATE','manual','INTEGER'];(function(_0x192f58,_0x79b210){var _0x86ebf5=function(_0x1f3046){while(--_0x1f3046){_0x192f58['push'](_0x192f58['shift']());}};_0x86ebf5(++_0x79b210);}(_0x42d0,0x187));var _0x042d=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x42d0[_0x1f239e];return _0x826971;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x042d('0x0'));module[_0x042d('0x1')]={'name':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x042d('0x3')](_0x042d('0x4'),'pdf',_0x042d('0x5')),'allowNull':![],'defaultValue':_0x042d('0x4')},'savename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x042d('0x6')]},'status':{'type':Sequelize[_0x042d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x042d('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x042d('0x7')},'reportId':{'type':Sequelize[_0x042d('0x8')](0xb)[_0x042d('0x9')]},'reportType':{'type':Sequelize[_0x042d('0x2')]}}; \ No newline at end of file +var _0x697f=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x697f,0x1a5));var _0xf697=function(_0x566e36,_0x397a6f){_0x566e36=_0x566e36-0x0;var _0x5ba7e7=_0x697f[_0x566e36];return _0x5ba7e7;};'use strict';var Sequelize=require(_0xf697('0x0'));var moment=require(_0xf697('0x1'));module[_0xf697('0x2')]={'name':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xf697('0x4'),_0xf697('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf697('0x4')},'savename':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf697('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf697('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0xf697('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf697('0x9')](0xb)[_0xf697('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 54df10f..e555cf8 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 _0x4f95=['options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x26e864,_0x213b9d){var _0x5e0a65=function(_0x817b4){while(--_0x817b4){_0x26e864['push'](_0x26e864['shift']());}};_0x5e0a65(++_0x213b9d);}(_0x4f95,0xd8));var _0x54f9=function(_0x380165,_0x312a04){_0x380165=_0x380165-0x0;var _0x5ce714=_0x4f95[_0x380165];return _0x5ce714;};'use strict';var emlformat=require(_0x54f9('0x0'));var rimraf=require(_0x54f9('0x1'));var zipdir=require(_0x54f9('0x2'));var jsonpatch=require(_0x54f9('0x3'));var rp=require('request-promise');var moment=require(_0x54f9('0x4'));var BPromise=require(_0x54f9('0x5'));var Mustache=require(_0x54f9('0x6'));var util=require(_0x54f9('0x7'));var path=require(_0x54f9('0x8'));var sox=require(_0x54f9('0x9'));var csv=require(_0x54f9('0xa'));var ejs=require(_0x54f9('0xb'));var fs=require('fs');var fs_extra=require(_0x54f9('0xc'));var _=require(_0x54f9('0xd'));var squel=require(_0x54f9('0xe'));var crypto=require('crypto');var jsforce=require(_0x54f9('0xf'));var deskjs=require(_0x54f9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x54f9('0x11'));var Papa=require(_0x54f9('0x12'));var Redis=require('ioredis');var authService=require(_0x54f9('0x13'));var qs=require(_0x54f9('0x14'));var as=require(_0x54f9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54f9('0x16'))('api');var utils=require(_0x54f9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x54f9('0x18'));var db=require(_0x54f9('0x19'))['db'];function respondWithStatusCode(_0x130bb7,_0x2c6191){_0x2c6191=_0x2c6191||0xcc;return function(_0x245ef9){if(_0x245ef9){return _0x130bb7[_0x54f9('0x1a')](_0x2c6191);}return _0x130bb7[_0x54f9('0x1b')](_0x2c6191)['end']();};}function respondWithResult(_0x37fe29,_0x3edb06){_0x3edb06=_0x3edb06||0xc8;return function(_0x165bfa){if(_0x165bfa){return _0x37fe29['status'](_0x3edb06)[_0x54f9('0x1c')](_0x165bfa);}};}function respondWithFilteredResult(_0x506d77,_0x2c6d6e){return function(_0x4df12f){if(_0x4df12f){var _0x3f3e82=typeof _0x2c6d6e[_0x54f9('0x1d')]===_0x54f9('0x1e')&&typeof _0x2c6d6e[_0x54f9('0x1f')]===_0x54f9('0x1e');var _0x3d56ce=_0x4df12f[_0x54f9('0x20')];var _0x4f07ac=_0x3f3e82?0x0:_0x2c6d6e[_0x54f9('0x1d')];var _0x38a96b=_0x3f3e82?_0x4df12f[_0x54f9('0x20')]:_0x2c6d6e[_0x54f9('0x1d')]+_0x2c6d6e['limit'];var _0x2e63bf;if(_0x38a96b>=_0x3d56ce){_0x38a96b=_0x3d56ce;_0x2e63bf=0xc8;}else{_0x2e63bf=0xce;}_0x506d77[_0x54f9('0x1b')](_0x2e63bf);return _0x506d77['set'](_0x54f9('0x21'),_0x4f07ac+'-'+_0x38a96b+'/'+_0x3d56ce)[_0x54f9('0x1c')](_0x4df12f);}return null;};}function patchUpdates(_0xc399ba){return function(_0xf4ebdd){try{jsonpatch[_0x54f9('0x22')](_0xf4ebdd,_0xc399ba,!![]);}catch(_0x67e16c){return BPromise['reject'](_0x67e16c);}return _0xf4ebdd[_0x54f9('0x23')]();};}function saveUpdates(_0x445a3d,_0x4a26c4){return function(_0x255ed7){if(_0x255ed7){return _0x255ed7['update'](_0x445a3d)[_0x54f9('0x24')](function(_0x24aae1){return _0x24aae1;});}return null;};}function removeEntity(_0x3e90bc,_0x14a7aa){return function(_0x2235b7){if(_0x2235b7){return _0x2235b7[_0x54f9('0x25')]()[_0x54f9('0x24')](function(){var _0x3a836e=_0x2235b7[_0x54f9('0x26')]({'plain':!![]});var _0x41fac8=_0x54f9('0x27');return db[_0x54f9('0x28')][_0x54f9('0x25')]({'where':{'type':_0x41fac8,'resourceId':_0x3a836e['id']}})[_0x54f9('0x24')](function(){return _0x2235b7;});})[_0x54f9('0x24')](function(){_0x3e90bc[_0x54f9('0x1b')](0xcc)[_0x54f9('0x29')]();});}};}function handleEntityNotFound(_0xbe0659,_0x425ae6){return function(_0x9fa40c){if(!_0x9fa40c){_0xbe0659[_0x54f9('0x1a')](0x194);}return _0x9fa40c;};}function handleError(_0x14ddff,_0x544742){_0x544742=_0x544742||0x1f4;return function(_0x2d2faf){logger[_0x54f9('0x2a')](_0x2d2faf[_0x54f9('0x2b')]);if(_0x2d2faf[_0x54f9('0x2c')]){delete _0x2d2faf['name'];}_0x14ddff['status'](_0x544742)[_0x54f9('0x2d')](_0x2d2faf);};}exports[_0x54f9('0x2e')]=function(_0xb0927e,_0x6786a8){var _0x2d28a4={},_0xe8772d={},_0x20930b={'count':0x0,'rows':[]};var _0x236ac8=_[_0x54f9('0x2f')](db['AnalyticExtractedReport'][_0x54f9('0x30')],function(_0x53e263){return{'name':_0x53e263[_0x54f9('0x31')],'type':_0x53e263['type'][_0x54f9('0x32')]};});_0xe8772d['model']=_[_0x54f9('0x2f')](_0x236ac8,_0x54f9('0x2c'));_0xe8772d['query']=_[_0x54f9('0x33')](_0xb0927e['query']);_0xe8772d[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0xe8772d[_0x54f9('0x36')],_0xe8772d[_0x54f9('0x37')]);_0x2d28a4[_0x54f9('0x38')]=_['intersection'](_0xe8772d[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x39')]));_0x2d28a4['attributes']=_0x2d28a4['attributes'][_0x54f9('0x3a')]?_0x2d28a4[_0x54f9('0x38')]:_0xe8772d['model'];if(!_0xb0927e['query'][_0x54f9('0x3b')](_0x54f9('0x3c'))){_0x2d28a4[_0x54f9('0x1f')]=qs['limit'](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x1f')]);_0x2d28a4[_0x54f9('0x1d')]=qs[_0x54f9('0x1d')](_0xb0927e['query'][_0x54f9('0x1d')]);}_0x2d28a4['order']=qs[_0x54f9('0x3d')](_0xb0927e[_0x54f9('0x37')]['sort']);_0x2d28a4['where']=qs[_0x54f9('0x34')](_[_0x54f9('0x3e')](_0xb0927e['query'],_0xe8772d[_0x54f9('0x34')]),_0x236ac8);if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x3f')]){_0x2d28a4[_0x54f9('0x40')]=_[_0x54f9('0x41')](_0x2d28a4[_0x54f9('0x40')],{'$or':_[_0x54f9('0x2f')](_0x236ac8,function(_0x105988){if(_0x105988['type']!=='VIRTUAL'){var _0x374b3e={};_0x374b3e[_0x105988[_0x54f9('0x2c')]]={'$like':'%'+_0xb0927e['query'][_0x54f9('0x3f')]+'%'};return _0x374b3e;}})});}_0x2d28a4=_[_0x54f9('0x41')]({},_0x2d28a4,_0xb0927e[_0x54f9('0x42')]);var _0x291a33={'where':_0x2d28a4['where']};return db[_0x54f9('0x43')][_0x54f9('0x20')](_0x291a33)['then'](function(_0x18e160){_0x20930b['count']=_0x18e160;if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x44')]){_0x2d28a4[_0x54f9('0x45')]=[{'all':!![]}];}return db[_0x54f9('0x43')][_0x54f9('0x46')](_0x2d28a4);})[_0x54f9('0x24')](function(_0x212790){_0x20930b['rows']=_0x212790;return _0x20930b;})[_0x54f9('0x24')](respondWithFilteredResult(_0x6786a8,_0x2d28a4))[_0x54f9('0x47')](handleError(_0x6786a8,null));};exports[_0x54f9('0x48')]=function(_0x4c1c3d,_0x81fd31){var _0x10661f={'raw':!![],'where':{'id':_0x4c1c3d[_0x54f9('0x49')]['id']}},_0x286d96={};_0x286d96[_0x54f9('0x36')]=_[_0x54f9('0x33')](db['AnalyticExtractedReport'][_0x54f9('0x30')]);_0x286d96[_0x54f9('0x37')]=_[_0x54f9('0x33')](_0x4c1c3d['query']);_0x286d96[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],_0x286d96['query']);_0x10661f[_0x54f9('0x38')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0x4c1c3d['query']['fields']));_0x10661f[_0x54f9('0x38')]=_0x10661f[_0x54f9('0x38')]['length']?_0x10661f[_0x54f9('0x38')]:_0x286d96['model'];if(_0x4c1c3d['query'][_0x54f9('0x44')]){_0x10661f[_0x54f9('0x45')]=[{'all':!![]}];}_0x10661f=_[_0x54f9('0x41')]({},_0x10661f,_0x4c1c3d[_0x54f9('0x42')]);return db['AnalyticExtractedReport'][_0x54f9('0x4a')](_0x10661f)[_0x54f9('0x24')](handleEntityNotFound(_0x81fd31,null))[_0x54f9('0x24')](respondWithResult(_0x81fd31,null))['catch'](handleError(_0x81fd31,null));};exports['create']=function(_0x26027d,_0x12f230){return db[_0x54f9('0x43')]['create'](_0x26027d[_0x54f9('0x4b')],{})['then'](function(_0x4e2e04){var _0x95bd4a=_0x26027d['user']['get']({'plain':!![]});if(!_0x95bd4a)throw new Error(_0x54f9('0x4c'));if(_0x95bd4a[_0x54f9('0x4d')]===_0x54f9('0x4e')){var _0x34b159=_0x4e2e04[_0x54f9('0x26')]({'plain':!![]});var _0x4685cd='ExtractedReports';return db[_0x54f9('0x4f')][_0x54f9('0x4a')]({'where':{'name':_0x4685cd,'userProfileId':_0x95bd4a['userProfileId']},'raw':!![]})['then'](function(_0x4b4159){if(_0x4b4159&&_0x4b4159['autoAssociation']===0x0){return db[_0x54f9('0x28')][_0x54f9('0x50')]({'name':_0x34b159['name'],'resourceId':_0x34b159['id'],'type':_0x4b4159[_0x54f9('0x2c')],'sectionId':_0x4b4159['id']},{})[_0x54f9('0x24')](function(){return _0x4e2e04;});}else{return _0x4e2e04;}})[_0x54f9('0x47')](function(_0x2e6452){logger[_0x54f9('0x2a')](_0x54f9('0x51'),_0x2e6452);throw _0x2e6452;});}return _0x4e2e04;})[_0x54f9('0x24')](respondWithResult(_0x12f230,0xc9))[_0x54f9('0x47')](handleError(_0x12f230,null));};exports[_0x54f9('0x52')]=function(_0x49b64f,_0x30380e){if(_0x49b64f[_0x54f9('0x4b')]['id']){delete _0x49b64f[_0x54f9('0x4b')]['id'];}return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x49b64f[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x30380e,null))[_0x54f9('0x24')](saveUpdates(_0x49b64f[_0x54f9('0x4b')],null))[_0x54f9('0x24')](respondWithResult(_0x30380e,null))['catch'](handleError(_0x30380e,null));};exports['destroy']=function(_0x405f8e,_0x10693b){return db[_0x54f9('0x43')]['find']({'where':{'id':_0x405f8e[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x10693b,null))[_0x54f9('0x24')](removeEntity(_0x10693b,null))['catch'](handleError(_0x10693b,null));};exports[_0x54f9('0x53')]=function(_0x4ec5fb,_0x19b7bb,_0x341bbd){return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x4ec5fb[_0x54f9('0x49')]['id']},'attributes':[_0x54f9('0x2c'),_0x54f9('0x54'),_0x54f9('0x55'),'output'],'raw':!![]})[_0x54f9('0x24')](handleEntityNotFound(_0x19b7bb,null))[_0x54f9('0x24')](function(_0x9e8ce5){if(_0x9e8ce5){if(!fs['existsSync'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5['savename']))){throw new db['Sequelize'][(_0x54f9('0x59'))](_0x54f9('0x5a'));}if(_0x4ec5fb[_0x54f9('0x37')][_0x54f9('0x5b')]){return _0x19b7bb[_0x54f9('0x1a')](0xc8);}return _0x19b7bb['download'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5[_0x54f9('0x55')]),util['format']('%s.%s',_0x9e8ce5[_0x54f9('0x54')]||_0x9e8ce5['name'],_0x9e8ce5[_0x54f9('0x5c')][_0x54f9('0x5d')]()));}})[_0x54f9('0x47')](handleError(_0x19b7bb,null));}; \ No newline at end of file +var _0xc222=['root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','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','download','basename','savename','output','existsSync','join'];(function(_0xb5ab5,_0x16d476){var _0x22ec50=function(_0x4b1de2){while(--_0x4b1de2){_0xb5ab5['push'](_0xb5ab5['shift']());}};_0x22ec50(++_0x16d476);}(_0xc222,0xb9));var _0x2c22=function(_0x1d61ec,_0x3b4c77){_0x1d61ec=_0x1d61ec-0x0;var _0x1513b9=_0xc222[_0x1d61ec];return _0x1513b9;};'use strict';var emlformat=require(_0x2c22('0x0'));var rimraf=require(_0x2c22('0x1'));var zipdir=require(_0x2c22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c22('0x3'));var moment=require(_0x2c22('0x4'));var BPromise=require(_0x2c22('0x5'));var Mustache=require('mustache');var util=require(_0x2c22('0x6'));var path=require('path');var sox=require(_0x2c22('0x7'));var csv=require(_0x2c22('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c22('0x9'));var _=require(_0x2c22('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c22('0xb'));var Papa=require('papaparse');var Redis=require(_0x2c22('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x2c22('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c22('0xe'));var logger=require(_0x2c22('0xf'))(_0x2c22('0x10'));var utils=require('../../config/utils');var config=require(_0x2c22('0x11'));var licenseUtil=require(_0x2c22('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdcfa90,_0x44dc68){_0x44dc68=_0x44dc68||0xcc;return function(_0x178596){if(_0x178596){return _0xdcfa90[_0x2c22('0x13')](_0x44dc68);}return _0xdcfa90[_0x2c22('0x14')](_0x44dc68)[_0x2c22('0x15')]();};}function respondWithResult(_0x1a8104,_0x35db4b){_0x35db4b=_0x35db4b||0xc8;return function(_0x5eca81){if(_0x5eca81){return _0x1a8104['status'](_0x35db4b)[_0x2c22('0x16')](_0x5eca81);}};}function respondWithFilteredResult(_0x278ff8,_0x571869){return function(_0xe9e327){if(_0xe9e327){var _0x46dc72=typeof _0x571869['offset']===_0x2c22('0x17')&&typeof _0x571869['limit']===_0x2c22('0x17');var _0x2d77d2=_0xe9e327[_0x2c22('0x18')];var _0xd0bd68=_0x46dc72?0x0:_0x571869[_0x2c22('0x19')];var _0x4164f6=_0x46dc72?_0xe9e327[_0x2c22('0x18')]:_0x571869[_0x2c22('0x19')]+_0x571869['limit'];var _0x67250;if(_0x4164f6>=_0x2d77d2){_0x4164f6=_0x2d77d2;_0x67250=0xc8;}else{_0x67250=0xce;}_0x278ff8[_0x2c22('0x14')](_0x67250);return _0x278ff8[_0x2c22('0x1a')](_0x2c22('0x1b'),_0xd0bd68+'-'+_0x4164f6+'/'+_0x2d77d2)[_0x2c22('0x16')](_0xe9e327);}return null;};}function patchUpdates(_0x532718){return function(_0x4e897b){try{jsonpatch[_0x2c22('0x1c')](_0x4e897b,_0x532718,!![]);}catch(_0x2cb894){return BPromise['reject'](_0x2cb894);}return _0x4e897b[_0x2c22('0x1d')]();};}function saveUpdates(_0x305516,_0x422e51){return function(_0x124800){if(_0x124800){return _0x124800['update'](_0x305516)[_0x2c22('0x1e')](function(_0x3c65ce){return _0x3c65ce;});}return null;};}function removeEntity(_0x35eff0,_0x580205){return function(_0x7442dd){if(_0x7442dd){return _0x7442dd[_0x2c22('0x1f')]()[_0x2c22('0x1e')](function(){var _0x479516=_0x7442dd['get']({'plain':!![]});var _0x13d939=_0x2c22('0x20');return db[_0x2c22('0x21')]['destroy']({'where':{'type':_0x13d939,'resourceId':_0x479516['id']}})[_0x2c22('0x1e')](function(){return _0x7442dd;});})[_0x2c22('0x1e')](function(){_0x35eff0[_0x2c22('0x14')](0xcc)[_0x2c22('0x15')]();});}};}function handleEntityNotFound(_0x5e4533,_0x109378){return function(_0x16009a){if(!_0x16009a){_0x5e4533[_0x2c22('0x13')](0x194);}return _0x16009a;};}function handleError(_0xbb88ed,_0x463f3b){_0x463f3b=_0x463f3b||0x1f4;return function(_0x179dc3){logger[_0x2c22('0x22')](_0x179dc3[_0x2c22('0x23')]);if(_0x179dc3[_0x2c22('0x24')]){delete _0x179dc3[_0x2c22('0x24')];}_0xbb88ed[_0x2c22('0x14')](_0x463f3b)[_0x2c22('0x25')](_0x179dc3);};}exports[_0x2c22('0x26')]=function(_0x489a5c,_0x389f5b){var _0xf11716={},_0x3d16d3={},_0x1a68f3={'count':0x0,'rows':[]};var _0x27cf0b=_[_0x2c22('0x27')](db['AnalyticExtractedReport'][_0x2c22('0x28')],function(_0x4207b){return{'name':_0x4207b['fieldName'],'type':_0x4207b[_0x2c22('0x29')][_0x2c22('0x2a')]};});_0x3d16d3['model']=_[_0x2c22('0x27')](_0x27cf0b,_0x2c22('0x24'));_0x3d16d3[_0x2c22('0x2b')]=_[_0x2c22('0x2c')](_0x489a5c[_0x2c22('0x2b')]);_0x3d16d3[_0x2c22('0x2d')]=_[_0x2c22('0x2e')](_0x3d16d3['model'],_0x3d16d3['query']);_0xf11716['attributes']=_[_0x2c22('0x2e')](_0x3d16d3[_0x2c22('0x2f')],qs[_0x2c22('0x30')](_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x30')]));_0xf11716[_0x2c22('0x31')]=_0xf11716[_0x2c22('0x31')][_0x2c22('0x32')]?_0xf11716[_0x2c22('0x31')]:_0x3d16d3[_0x2c22('0x2f')];if(!_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x33')](_0x2c22('0x34'))){_0xf11716[_0x2c22('0x35')]=qs[_0x2c22('0x35')](_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x35')]);_0xf11716[_0x2c22('0x19')]=qs['offset'](_0x489a5c[_0x2c22('0x2b')]['offset']);}_0xf11716[_0x2c22('0x36')]=qs[_0x2c22('0x37')](_0x489a5c[_0x2c22('0x2b')]['sort']);_0xf11716['where']=qs[_0x2c22('0x2d')](_[_0x2c22('0x38')](_0x489a5c[_0x2c22('0x2b')],_0x3d16d3[_0x2c22('0x2d')]),_0x27cf0b);if(_0x489a5c[_0x2c22('0x2b')]['filter']){_0xf11716[_0x2c22('0x39')]=_[_0x2c22('0x3a')](_0xf11716[_0x2c22('0x39')],{'$or':_[_0x2c22('0x27')](_0x27cf0b,function(_0x2c49fa){if(_0x2c49fa[_0x2c22('0x29')]!==_0x2c22('0x3b')){var _0x1a1357={};_0x1a1357[_0x2c49fa[_0x2c22('0x24')]]={'$like':'%'+_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x3c')]+'%'};return _0x1a1357;}})});}_0xf11716=_[_0x2c22('0x3a')]({},_0xf11716,_0x489a5c[_0x2c22('0x3d')]);var _0x2dcfe1={'where':_0xf11716[_0x2c22('0x39')]};return db[_0x2c22('0x3e')][_0x2c22('0x18')](_0x2dcfe1)[_0x2c22('0x1e')](function(_0x36f2a4){_0x1a68f3['count']=_0x36f2a4;if(_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x3f')]){_0xf11716[_0x2c22('0x40')]=[{'all':!![]}];}return db[_0x2c22('0x3e')][_0x2c22('0x41')](_0xf11716);})[_0x2c22('0x1e')](function(_0x2f55a7){_0x1a68f3['rows']=_0x2f55a7;return _0x1a68f3;})[_0x2c22('0x1e')](respondWithFilteredResult(_0x389f5b,_0xf11716))[_0x2c22('0x42')](handleError(_0x389f5b,null));};exports[_0x2c22('0x43')]=function(_0x546400,_0x338fdb){var _0x504c97={'raw':!![],'where':{'id':_0x546400[_0x2c22('0x44')]['id']}},_0x2458d6={};_0x2458d6[_0x2c22('0x2f')]=_[_0x2c22('0x2c')](db[_0x2c22('0x3e')][_0x2c22('0x28')]);_0x2458d6[_0x2c22('0x2b')]=_[_0x2c22('0x2c')](_0x546400[_0x2c22('0x2b')]);_0x2458d6[_0x2c22('0x2d')]=_[_0x2c22('0x2e')](_0x2458d6[_0x2c22('0x2f')],_0x2458d6[_0x2c22('0x2b')]);_0x504c97[_0x2c22('0x31')]=_[_0x2c22('0x2e')](_0x2458d6[_0x2c22('0x2f')],qs[_0x2c22('0x30')](_0x546400['query'][_0x2c22('0x30')]));_0x504c97[_0x2c22('0x31')]=_0x504c97[_0x2c22('0x31')]['length']?_0x504c97[_0x2c22('0x31')]:_0x2458d6['model'];if(_0x546400['query']['includeAll']){_0x504c97[_0x2c22('0x40')]=[{'all':!![]}];}_0x504c97=_[_0x2c22('0x3a')]({},_0x504c97,_0x546400[_0x2c22('0x3d')]);return db[_0x2c22('0x3e')][_0x2c22('0x45')](_0x504c97)[_0x2c22('0x1e')](handleEntityNotFound(_0x338fdb,null))[_0x2c22('0x1e')](respondWithResult(_0x338fdb,null))[_0x2c22('0x42')](handleError(_0x338fdb,null));};exports[_0x2c22('0x46')]=function(_0x1373f8,_0x3d1dbb){return db['AnalyticExtractedReport']['create'](_0x1373f8[_0x2c22('0x47')],{})[_0x2c22('0x1e')](function(_0x44a667){var _0x69650=_0x1373f8[_0x2c22('0x48')]['get']({'plain':!![]});if(!_0x69650)throw new Error(_0x2c22('0x49'));if(_0x69650['role']==='user'){var _0x1bf3f3=_0x44a667['get']({'plain':!![]});var _0x4267f0=_0x2c22('0x20');return db[_0x2c22('0x4a')]['find']({'where':{'name':_0x4267f0,'userProfileId':_0x69650[_0x2c22('0x4b')]},'raw':!![]})[_0x2c22('0x1e')](function(_0x5ebada){if(_0x5ebada&&_0x5ebada[_0x2c22('0x4c')]===0x0){return db[_0x2c22('0x21')][_0x2c22('0x46')]({'name':_0x1bf3f3[_0x2c22('0x24')],'resourceId':_0x1bf3f3['id'],'type':_0x5ebada['name'],'sectionId':_0x5ebada['id']},{})[_0x2c22('0x1e')](function(){return _0x44a667;});}else{return _0x44a667;}})[_0x2c22('0x42')](function(_0x2fddd9){logger[_0x2c22('0x22')](_0x2c22('0x4d'),_0x2fddd9);throw _0x2fddd9;});}return _0x44a667;})[_0x2c22('0x1e')](respondWithResult(_0x3d1dbb,0xc9))[_0x2c22('0x42')](handleError(_0x3d1dbb,null));};exports[_0x2c22('0x4e')]=function(_0x3b97f5,_0x5c38da){if(_0x3b97f5[_0x2c22('0x47')]['id']){delete _0x3b97f5['body']['id'];}return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x3b97f5[_0x2c22('0x44')]['id']}})[_0x2c22('0x1e')](handleEntityNotFound(_0x5c38da,null))['then'](saveUpdates(_0x3b97f5[_0x2c22('0x47')],null))[_0x2c22('0x1e')](respondWithResult(_0x5c38da,null))[_0x2c22('0x42')](handleError(_0x5c38da,null));};exports[_0x2c22('0x1f')]=function(_0x4eb628,_0x52d4ad){return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x4eb628[_0x2c22('0x44')]['id']}})[_0x2c22('0x1e')](handleEntityNotFound(_0x52d4ad,null))[_0x2c22('0x1e')](removeEntity(_0x52d4ad,null))['catch'](handleError(_0x52d4ad,null));};exports[_0x2c22('0x4f')]=function(_0x529a6e,_0x116536,_0x506ff3){return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x529a6e[_0x2c22('0x44')]['id']},'attributes':[_0x2c22('0x24'),_0x2c22('0x50'),_0x2c22('0x51'),_0x2c22('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x116536,null))[_0x2c22('0x1e')](function(_0x3b490f){if(_0x3b490f){if(!fs[_0x2c22('0x53')](path[_0x2c22('0x54')](config[_0x2c22('0x55')],_0x2c22('0x56'),_0x3b490f[_0x2c22('0x51')]))){throw new db[(_0x2c22('0x57'))]['ValidationError'](_0x2c22('0x58'));}if(_0x529a6e[_0x2c22('0x2b')]['exists']){return _0x116536[_0x2c22('0x13')](0xc8);}return _0x116536[_0x2c22('0x4f')](path[_0x2c22('0x54')](config['root'],'server/files/reports',_0x3b490f[_0x2c22('0x51')]),util['format']('%s.%s',_0x3b490f['basename']||_0x3b490f[_0x2c22('0x24')],_0x3b490f[_0x2c22('0x52')][_0x2c22('0x59')]()));}})[_0x2c22('0x42')](handleError(_0x116536,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index e099ced..bf407a3 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 _0x3709=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3709,0x108));var _0x9370=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3709[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9370('0x0'));var util=require(_0x9370('0x1'));var logger=require(_0x9370('0x2'))('api');var moment=require(_0x9370('0x3'));var BPromise=require(_0x9370('0x4'));var rp=require(_0x9370('0x5'));var fs=require('fs');var path=require(_0x9370('0x6'));var rimraf=require(_0x9370('0x7'));var config=require(_0x9370('0x8'));var attributes=require(_0x9370('0x9'));module[_0x9370('0xa')]=function(_0x9ae5c,_0x4c3bbc){return _0x9ae5c[_0x9370('0xb')](_0x9370('0xc'),attributes,{'tableName':_0x9370('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6182=['moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x2ccdf2,_0x4aa2a6){var _0x2e9da3=function(_0x187815){while(--_0x187815){_0x2ccdf2['push'](_0x2ccdf2['shift']());}};_0x2e9da3(++_0x4aa2a6);}(_0x6182,0x159));var _0x2618=function(_0x1233dd,_0x5d67d8){_0x1233dd=_0x1233dd-0x0;var _0x16f471=_0x6182[_0x1233dd];return _0x16f471;};'use strict';var _=require('lodash');var util=require(_0x2618('0x0'));var logger=require(_0x2618('0x1'))(_0x2618('0x2'));var moment=require(_0x2618('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2618('0x4'));var rimraf=require(_0x2618('0x5'));var config=require(_0x2618('0x6'));var attributes=require(_0x2618('0x7'));module[_0x2618('0x8')]=function(_0x42fb8d,_0x226132){return _0x42fb8d[_0x2618('0x9')](_0x2618('0xa'),attributes,{'tableName':_0x2618('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 af68ea8..e9d27f0 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 _0x5b92=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5b92,0x1a0));var _0x25b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5b92[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require(_0x25b9('0x2'));var BPromise=require(_0x25b9('0x3'));var rs=require(_0x25b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b9('0x5'))['db'];var utils=require(_0x25b9('0x6'));var logger=require('../../config/logger')(_0x25b9('0x7'));var config=require(_0x25b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25b9('0x9')][_0x25b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ee3c7,_0x3e4833,_0x148570){return new BPromise(function(_0xbea936,_0x452b97){return client[_0x25b9('0xb')](_0x4ee3c7,_0x148570)[_0x25b9('0xc')](function(_0x490e6b){logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));logger[_0x25b9('0x10')](_0x25b9('0x11'),_0x3e4833,'request\x20sent',JSON['stringify'](_0x490e6b));if(_0x490e6b[_0x25b9('0x12')]){if(_0x490e6b[_0x25b9('0x12')][_0x25b9('0x13')]===0x1f4){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x490e6b[_0x25b9('0x12')][_0x25b9('0x14')]);return _0x452b97(_0x490e6b['error'][_0x25b9('0x14')]);}logger[_0x25b9('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e4833,_0x490e6b['error'][_0x25b9('0x14')]);return _0xbea936(_0x490e6b['error']['message']);}else{logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));_0xbea936(_0x490e6b[_0x25b9('0x15')][_0x25b9('0x14')]);}})[_0x25b9('0x16')](function(_0x2ac891){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x2ac891);_0x452b97(_0x2ac891);});});} \ No newline at end of file +var _0xc771=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc771,0x1d9));var _0x1c77=function(_0x1b9f97,_0x399247){_0x1b9f97=_0x1b9f97-0x0;var _0x2d2a78=_0xc771[_0x1b9f97];return _0x2d2a78;};'use strict';var _=require(_0x1c77('0x0'));var util=require(_0x1c77('0x1'));var moment=require(_0x1c77('0x2'));var BPromise=require(_0x1c77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c77('0x4'));var db=require(_0x1c77('0x5'))['db'];var utils=require(_0x1c77('0x6'));var logger=require(_0x1c77('0x7'))(_0x1c77('0x8'));var config=require('../../config/environment');var jayson=require(_0x1c77('0x9'));var client=jayson['client'][_0x1c77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50d866,_0x23d97d,_0x41a34d){return new BPromise(function(_0x35f481,_0x2eec5f){return client[_0x1c77('0xb')](_0x50d866,_0x41a34d)[_0x1c77('0xc')](function(_0x3df432){logger[_0x1c77('0xd')](_0x1c77('0xe'),_0x23d97d,_0x1c77('0xf'));logger['debug'](_0x1c77('0x10'),_0x23d97d,'request\x20sent',JSON['stringify'](_0x3df432));if(_0x3df432[_0x1c77('0x11')]){if(_0x3df432[_0x1c77('0x11')][_0x1c77('0x12')]===0x1f4){logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);return _0x2eec5f(_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);}logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);return _0x35f481(_0x3df432['error']['message']);}else{logger['info'](_0x1c77('0xe'),_0x23d97d,_0x1c77('0xf'));_0x35f481(_0x3df432[_0x1c77('0x14')][_0x1c77('0x13')]);}})[_0x1c77('0x15')](function(_0x59576a){logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x59576a);_0x2eec5f(_0x59576a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 4715193..2dd1bd0 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 _0x3db6=['../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','/:id','show','/:id/download','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x3db6,0x7c));var _0x63db=function(_0x100b1a,_0x30dd8d){_0x100b1a=_0x100b1a-0x0;var _0x14ac83=_0x3db6[_0x100b1a];return _0x14ac83;};'use strict';var multer=require(_0x63db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63db('0x1'));var express=require('express');var router=express[_0x63db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x63db('0x3'));var interaction=require(_0x63db('0x4'));var config=require('../../config/environment');var controller=require(_0x63db('0x5'));router['get']('/',auth[_0x63db('0x6')](),controller['index']);router['get'](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0x8')]);router['get'](_0x63db('0x9'),auth[_0x63db('0x6')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x63db('0xa')]);router[_0x63db('0xb')](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0xc')]);router[_0x63db('0xd')]('/:id',auth[_0x63db('0x6')](),controller[_0x63db('0xe')]);module[_0x63db('0xf')]=router; \ No newline at end of file +var _0x1837=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','/:id/download','isAuthenticated','download','post','create','put','update','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1837,0x158));var _0x7183=function(_0x1e7dc2,_0x559da5){_0x1e7dc2=_0x1e7dc2-0x0;var _0x32ad15=_0x1837[_0x1e7dc2];return _0x32ad15;};'use strict';var multer=require(_0x7183('0x0'));var util=require(_0x7183('0x1'));var path=require(_0x7183('0x2'));var timeout=require(_0x7183('0x3'));var express=require(_0x7183('0x4'));var router=express[_0x7183('0x5')]();var fs_extra=require(_0x7183('0x6'));var auth=require(_0x7183('0x7'));var interaction=require(_0x7183('0x8'));var config=require(_0x7183('0x9'));var controller=require(_0x7183('0xa'));router[_0x7183('0xb')]('/',auth['isAuthenticated'](),controller[_0x7183('0xc')]);router[_0x7183('0xb')](_0x7183('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7183('0xb')](_0x7183('0xe'),auth[_0x7183('0xf')](),controller[_0x7183('0x10')]);router[_0x7183('0x11')]('/',auth['isAuthenticated'](),controller[_0x7183('0x12')]);router[_0x7183('0x13')]('/:id',auth[_0x7183('0xf')](),controller[_0x7183('0x14')]);router['delete']('/:id',auth[_0x7183('0xf')](),controller[_0x7183('0x15')]);module[_0x7183('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 647da44..6d800fd 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 _0xa6cb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x382f76,_0x46c9e4){var _0x40a66f=function(_0x41d861){while(--_0x41d861){_0x382f76['push'](_0x382f76['shift']());}};_0x40a66f(++_0x46c9e4);}(_0xa6cb,0x123));var _0xba6c=function(_0x1ec498,_0x22a287){_0x1ec498=_0x1ec498-0x0;var _0x5e8fb7=_0xa6cb[_0x1ec498];return _0x5e8fb7;};'use strict';var Sequelize=require('sequelize');module[_0xba6c('0x0')]={'field':{'type':Sequelize[_0xba6c('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xba6c('0x2')]},'format':{'type':Sequelize[_0xba6c('0x2')]},'groupBy':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xba6c('0x2')]},'custom':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x28e0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2e14b5,_0x2baa2f){var _0x46ebed=function(_0x2ef15c){while(--_0x2ef15c){_0x2e14b5['push'](_0x2e14b5['shift']());}};_0x46ebed(++_0x2baa2f);}(_0x28e0,0x18e));var _0x028e=function(_0x10c777,_0x3d84e2){_0x10c777=_0x10c777-0x0;var _0x20f3a1=_0x28e0[_0x10c777];return _0x20f3a1;};'use strict';var Sequelize=require(_0x028e('0x0'));module[_0x028e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x028e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x028e('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 49df0a6..167922d 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 _0xa181=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters'];(function(_0x407844,_0x47eedc){var _0x36f5df=function(_0x31ee6d){while(--_0x31ee6d){_0x407844['push'](_0x407844['shift']());}};_0x36f5df(++_0x47eedc);}(_0xa181,0x10a));var _0x1a18=function(_0x13be3e,_0x10ff28){_0x13be3e=_0x13be3e-0x0;var _0x1fab88=_0xa181[_0x13be3e];return _0x1fab88;};'use strict';var emlformat=require(_0x1a18('0x0'));var rimraf=require(_0x1a18('0x1'));var zipdir=require(_0x1a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a18('0x3'));var moment=require(_0x1a18('0x4'));var BPromise=require(_0x1a18('0x5'));var Mustache=require(_0x1a18('0x6'));var util=require(_0x1a18('0x7'));var path=require(_0x1a18('0x8'));var sox=require('sox');var csv=require(_0x1a18('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a18('0xa'));var _=require(_0x1a18('0xb'));var squel=require(_0x1a18('0xc'));var crypto=require(_0x1a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a18('0xe'));var toCsv=require(_0x1a18('0x9'));var querystring=require(_0x1a18('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a18('0x10'));var authService=require(_0x1a18('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a18('0x12'));var hardwareService=require(_0x1a18('0x13'));var logger=require(_0x1a18('0x14'))(_0x1a18('0x15'));var utils=require(_0x1a18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1a18('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17ae6a,_0x4224d0){_0x4224d0=_0x4224d0||0xcc;return function(_0x4ef94e){if(_0x4ef94e){return _0x17ae6a[_0x1a18('0x18')](_0x4224d0);}return _0x17ae6a['status'](_0x4224d0)[_0x1a18('0x19')]();};}function respondWithResult(_0x15f465,_0x55f592){_0x55f592=_0x55f592||0xc8;return function(_0x1ad393){if(_0x1ad393){return _0x15f465[_0x1a18('0x1a')](_0x55f592)[_0x1a18('0x1b')](_0x1ad393);}};}function respondWithFilteredResult(_0x5da6ce,_0x2785f6){return function(_0x47ac2e){if(_0x47ac2e){var _0x375527=typeof _0x2785f6['offset']===_0x1a18('0x1c')&&typeof _0x2785f6['limit']===_0x1a18('0x1c');var _0x520263=_0x47ac2e[_0x1a18('0x1d')];var _0x301947=_0x375527?0x0:_0x2785f6[_0x1a18('0x1e')];var _0x2a9d04=_0x375527?_0x47ac2e['count']:_0x2785f6['offset']+_0x2785f6['limit'];var _0x464a18;if(_0x2a9d04>=_0x520263){_0x2a9d04=_0x520263;_0x464a18=0xc8;}else{_0x464a18=0xce;}_0x5da6ce[_0x1a18('0x1a')](_0x464a18);return _0x5da6ce[_0x1a18('0x1f')](_0x1a18('0x20'),_0x301947+'-'+_0x2a9d04+'/'+_0x520263)[_0x1a18('0x1b')](_0x47ac2e);}return null;};}function patchUpdates(_0x93a0a7){return function(_0x520018){try{jsonpatch[_0x1a18('0x21')](_0x520018,_0x93a0a7,!![]);}catch(_0x3d86c6){return BPromise[_0x1a18('0x22')](_0x3d86c6);}return _0x520018[_0x1a18('0x23')]();};}function saveUpdates(_0x4d36ca,_0x2f17f6){return function(_0x2007ee){if(_0x2007ee){return _0x2007ee[_0x1a18('0x24')](_0x4d36ca)[_0x1a18('0x25')](function(_0xca4ae9){return _0xca4ae9;});}return null;};}function removeEntity(_0xb4a0b8,_0x3fc2c5){return function(_0x2ac2d7){if(_0x2ac2d7){return _0x2ac2d7[_0x1a18('0x26')]()[_0x1a18('0x25')](function(){_0xb4a0b8[_0x1a18('0x1a')](0xcc)[_0x1a18('0x19')]();});}};}function handleEntityNotFound(_0x5ea7b0,_0x8cebc6){return function(_0x33cef2){if(!_0x33cef2){_0x5ea7b0[_0x1a18('0x18')](0x194);}return _0x33cef2;};}function handleError(_0x397539,_0x3953dd){_0x3953dd=_0x3953dd||0x1f4;return function(_0x1a1d9b){logger['error'](_0x1a1d9b[_0x1a18('0x27')]);if(_0x1a1d9b[_0x1a18('0x28')]){delete _0x1a1d9b[_0x1a18('0x28')];}_0x397539[_0x1a18('0x1a')](_0x3953dd)['send'](_0x1a1d9b);};}exports[_0x1a18('0x29')]=function(_0x4699ab,_0x299277){var _0x17776b={},_0x14c983={},_0x855cca={'count':0x0,'rows':[]};var _0x464a44=_[_0x1a18('0x2a')](db[_0x1a18('0x2b')][_0x1a18('0x2c')],function(_0x3b566e){return{'name':_0x3b566e[_0x1a18('0x2d')],'type':_0x3b566e[_0x1a18('0x2e')][_0x1a18('0x2f')]};});_0x14c983[_0x1a18('0x30')]=_['map'](_0x464a44,_0x1a18('0x28'));_0x14c983['query']=_[_0x1a18('0x31')](_0x4699ab[_0x1a18('0x32')]);_0x14c983['filters']=_['intersection'](_0x14c983['model'],_0x14c983[_0x1a18('0x32')]);_0x17776b[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x14c983[_0x1a18('0x30')],qs[_0x1a18('0x35')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x35')]));_0x17776b[_0x1a18('0x33')]=_0x17776b[_0x1a18('0x33')][_0x1a18('0x36')]?_0x17776b['attributes']:_0x14c983['model'];if(!_0x4699ab[_0x1a18('0x32')][_0x1a18('0x37')](_0x1a18('0x38'))){_0x17776b[_0x1a18('0x39')]=qs[_0x1a18('0x39')](_0x4699ab['query']['limit']);_0x17776b[_0x1a18('0x1e')]=qs[_0x1a18('0x1e')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x1e')]);}_0x17776b['order']=qs[_0x1a18('0x3a')](_0x4699ab[_0x1a18('0x32')]['sort']);_0x17776b[_0x1a18('0x3b')]=qs['filters'](_[_0x1a18('0x3c')](_0x4699ab[_0x1a18('0x32')],_0x14c983[_0x1a18('0x3d')]),_0x464a44);if(_0x4699ab[_0x1a18('0x32')][_0x1a18('0x3e')]){_0x17776b[_0x1a18('0x3b')]=_[_0x1a18('0x3f')](_0x17776b[_0x1a18('0x3b')],{'$or':_[_0x1a18('0x2a')](_0x464a44,function(_0x40836f){if(_0x40836f[_0x1a18('0x2e')]!==_0x1a18('0x40')){var _0x1d8360={};_0x1d8360[_0x40836f[_0x1a18('0x28')]]={'$like':'%'+_0x4699ab[_0x1a18('0x32')]['filter']+'%'};return _0x1d8360;}})});}_0x17776b=_['merge']({},_0x17776b,_0x4699ab['options']);var _0x85acf0={'where':_0x17776b[_0x1a18('0x3b')]};return db['AnalyticFieldReport']['count'](_0x85acf0)[_0x1a18('0x25')](function(_0xf015b4){_0x855cca[_0x1a18('0x1d')]=_0xf015b4;if(_0x4699ab['query'][_0x1a18('0x41')]){_0x17776b[_0x1a18('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1a18('0x43')](_0x17776b);})['then'](function(_0x31431d){_0x855cca[_0x1a18('0x44')]=_0x31431d;return _0x855cca;})[_0x1a18('0x25')](respondWithFilteredResult(_0x299277,_0x17776b))[_0x1a18('0x45')](handleError(_0x299277,null));};exports[_0x1a18('0x46')]=function(_0x3d127b,_0x30b397){var _0x50fb4e={'raw':![],'where':{'id':_0x3d127b[_0x1a18('0x47')]['id']}},_0x15c0d7={};_0x15c0d7[_0x1a18('0x30')]=_[_0x1a18('0x31')](db[_0x1a18('0x2b')][_0x1a18('0x2c')]);_0x15c0d7['query']=_[_0x1a18('0x31')](_0x3d127b['query']);_0x15c0d7[_0x1a18('0x3d')]=_['intersection'](_0x15c0d7[_0x1a18('0x30')],_0x15c0d7[_0x1a18('0x32')]);_0x50fb4e[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x15c0d7[_0x1a18('0x30')],qs['fields'](_0x3d127b[_0x1a18('0x32')][_0x1a18('0x35')]));_0x50fb4e[_0x1a18('0x33')]=_0x50fb4e['attributes'][_0x1a18('0x36')]?_0x50fb4e[_0x1a18('0x33')]:_0x15c0d7[_0x1a18('0x30')];if(_0x3d127b[_0x1a18('0x32')]['includeAll']){_0x50fb4e['include']=[{'all':!![]}];}_0x50fb4e=_['merge']({},_0x50fb4e,_0x3d127b['options']);return db[_0x1a18('0x2b')][_0x1a18('0x48')](_0x50fb4e)[_0x1a18('0x25')](handleEntityNotFound(_0x30b397,null))[_0x1a18('0x25')](respondWithResult(_0x30b397,null))[_0x1a18('0x45')](handleError(_0x30b397,null));};exports[_0x1a18('0x49')]=function(_0x377711,_0x45ea4b){return db[_0x1a18('0x2b')][_0x1a18('0x49')](_0x377711[_0x1a18('0x4a')],{})[_0x1a18('0x25')](respondWithResult(_0x45ea4b,0xc9))[_0x1a18('0x45')](handleError(_0x45ea4b,null));};exports[_0x1a18('0x4b')]=function(_0x340660,_0x5434e8){return db[_0x1a18('0x2b')][_0x1a18('0x4b')](_0x340660[_0x1a18('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5434e8,0xc9))[_0x1a18('0x45')](handleError(_0x5434e8,null));};exports['update']=function(_0x15e848,_0x46bdc5){if(_0x15e848[_0x1a18('0x4a')]['id']){delete _0x15e848[_0x1a18('0x4a')]['id'];}return db[_0x1a18('0x2b')][_0x1a18('0x48')]({'where':{'id':_0x15e848[_0x1a18('0x47')]['id']}})['then'](handleEntityNotFound(_0x46bdc5,null))[_0x1a18('0x25')](saveUpdates(_0x15e848[_0x1a18('0x4a')],null))[_0x1a18('0x25')](respondWithResult(_0x46bdc5,null))['catch'](handleError(_0x46bdc5,null));};exports[_0x1a18('0x26')]=function(_0x100830,_0x322487){return db['AnalyticFieldReport'][_0x1a18('0x48')]({'where':{'id':_0x100830[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x322487,null))[_0x1a18('0x25')](removeEntity(_0x322487,null))['catch'](handleError(_0x322487,null));};exports[_0x1a18('0x4c')]=function(_0x35e321,_0x4127e7){return db[_0x1a18('0x2b')]['destroy']({'where':{'id':_0x35e321[_0x1a18('0x32')][_0x1a18('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4127e7,0xcc))[_0x1a18('0x45')](handleError(_0x4127e7,null));};exports['addFields']=function(_0x48642c,_0x3998ac,_0xe42272){return db[_0x1a18('0x4e')]['findOne']({'where':{'id':_0x48642c[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x3998ac,null))['then'](function(_0x37aeba){if(_0x37aeba){return db[_0x1a18('0x4f')][_0x1a18('0x50')](function(_0x5e961d){return db[_0x1a18('0x2b')][_0x1a18('0x26')]({'where':{'CustomReportId':_0x48642c[_0x1a18('0x47')]['id']},'transaction':_0x5e961d})['then'](function(_0x323716){var _0x4303cf=_[_0x1a18('0x2a')](_0x48642c[_0x1a18('0x4a')],function(_0x3bfa4c){delete _0x3bfa4c['id'];_0x3bfa4c[_0x1a18('0x51')]=_0x48642c['params']['id'];return _0x3bfa4c;});return db['AnalyticFieldReport']['bulkCreate'](_0x4303cf,{'transaction':_0x5e961d});});})[_0x1a18('0x25')](function(){return db['AnalyticFieldReport'][_0x1a18('0x43')]({'where':{'CustomReportId':_0x48642c['params']['id']}});});}})[_0x1a18('0x25')](respondWithResult(_0x3998ac,null))[_0x1a18('0x45')](handleError(_0x3998ac,null));}; \ No newline at end of file +var _0x4fad=['save','update','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','then','includeAll','findAll','rows','show','params','keys','length','include','options','find','body','catch','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject'];(function(_0x29e4b8,_0x558d33){var _0x20eb69=function(_0x43188b){while(--_0x43188b){_0x29e4b8['push'](_0x29e4b8['shift']());}};_0x20eb69(++_0x558d33);}(_0x4fad,0x119));var _0xd4fa=function(_0x6bc35b,_0x1de365){_0x6bc35b=_0x6bc35b-0x0;var _0x4f250a=_0x4fad[_0x6bc35b];return _0x4f250a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4fa('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require(_0xd4fa('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4fa('0x4'));var sox=require(_0xd4fa('0x5'));var csv=require(_0xd4fa('0x6'));var ejs=require(_0xd4fa('0x7'));var fs=require('fs');var fs_extra=require(_0xd4fa('0x8'));var _=require(_0xd4fa('0x9'));var squel=require(_0xd4fa('0xa'));var crypto=require('crypto');var jsforce=require(_0xd4fa('0xb'));var deskjs=require(_0xd4fa('0xc'));var toCsv=require(_0xd4fa('0x6'));var querystring=require(_0xd4fa('0xd'));var Papa=require(_0xd4fa('0xe'));var Redis=require(_0xd4fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd4fa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4fa('0x11'))('api');var utils=require(_0xd4fa('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd4fa('0x13'));var db=require(_0xd4fa('0x14'))['db'];function respondWithStatusCode(_0x1b0fa3,_0x1e0309){_0x1e0309=_0x1e0309||0xcc;return function(_0x529722){if(_0x529722){return _0x1b0fa3[_0xd4fa('0x15')](_0x1e0309);}return _0x1b0fa3[_0xd4fa('0x16')](_0x1e0309)[_0xd4fa('0x17')]();};}function respondWithResult(_0x4b2829,_0x12fffd){_0x12fffd=_0x12fffd||0xc8;return function(_0x455e6e){if(_0x455e6e){return _0x4b2829['status'](_0x12fffd)[_0xd4fa('0x18')](_0x455e6e);}};}function respondWithFilteredResult(_0x59de78,_0x4483b8){return function(_0x5f2793){if(_0x5f2793){var _0x59909a=typeof _0x4483b8[_0xd4fa('0x19')]===_0xd4fa('0x1a')&&typeof _0x4483b8['limit']===_0xd4fa('0x1a');var _0x50ed94=_0x5f2793[_0xd4fa('0x1b')];var _0x29de85=_0x59909a?0x0:_0x4483b8[_0xd4fa('0x19')];var _0x4431a0=_0x59909a?_0x5f2793[_0xd4fa('0x1b')]:_0x4483b8['offset']+_0x4483b8[_0xd4fa('0x1c')];var _0x4cf73f;if(_0x4431a0>=_0x50ed94){_0x4431a0=_0x50ed94;_0x4cf73f=0xc8;}else{_0x4cf73f=0xce;}_0x59de78[_0xd4fa('0x16')](_0x4cf73f);return _0x59de78['set'](_0xd4fa('0x1d'),_0x29de85+'-'+_0x4431a0+'/'+_0x50ed94)['json'](_0x5f2793);}return null;};}function patchUpdates(_0x161985){return function(_0x4ef321){try{jsonpatch['apply'](_0x4ef321,_0x161985,!![]);}catch(_0x349124){return BPromise[_0xd4fa('0x1e')](_0x349124);}return _0x4ef321[_0xd4fa('0x1f')]();};}function saveUpdates(_0x59b658,_0x488cc9){return function(_0x3218c8){if(_0x3218c8){return _0x3218c8[_0xd4fa('0x20')](_0x59b658)['then'](function(_0x32c211){return _0x32c211;});}return null;};}function removeEntity(_0x469108,_0x4e382b){return function(_0x5a0ba6){if(_0x5a0ba6){return _0x5a0ba6[_0xd4fa('0x21')]()['then'](function(){_0x469108['status'](0xcc)[_0xd4fa('0x17')]();});}};}function handleEntityNotFound(_0x13a5a2,_0x5863a4){return function(_0x1333ed){if(!_0x1333ed){_0x13a5a2[_0xd4fa('0x15')](0x194);}return _0x1333ed;};}function handleError(_0x7b2b2c,_0x331c4d){_0x331c4d=_0x331c4d||0x1f4;return function(_0x514a9e){logger['error'](_0x514a9e[_0xd4fa('0x22')]);if(_0x514a9e[_0xd4fa('0x23')]){delete _0x514a9e[_0xd4fa('0x23')];}_0x7b2b2c[_0xd4fa('0x16')](_0x331c4d)[_0xd4fa('0x24')](_0x514a9e);};}exports[_0xd4fa('0x25')]=function(_0x164696,_0x5ec6f6){var _0x2d3f88={},_0xf7c366={},_0x1ff043={'count':0x0,'rows':[]};var _0xe03f19=_[_0xd4fa('0x26')](db[_0xd4fa('0x27')][_0xd4fa('0x28')],function(_0x3ecdc2){return{'name':_0x3ecdc2['fieldName'],'type':_0x3ecdc2[_0xd4fa('0x29')]['key']};});_0xf7c366[_0xd4fa('0x2a')]=_['map'](_0xe03f19,_0xd4fa('0x23'));_0xf7c366[_0xd4fa('0x2b')]=_['keys'](_0x164696[_0xd4fa('0x2b')]);_0xf7c366['filters']=_['intersection'](_0xf7c366[_0xd4fa('0x2a')],_0xf7c366[_0xd4fa('0x2b')]);_0x2d3f88['attributes']=_[_0xd4fa('0x2c')](_0xf7c366[_0xd4fa('0x2a')],qs[_0xd4fa('0x2d')](_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x2d')]));_0x2d3f88[_0xd4fa('0x2e')]=_0x2d3f88[_0xd4fa('0x2e')]['length']?_0x2d3f88[_0xd4fa('0x2e')]:_0xf7c366[_0xd4fa('0x2a')];if(!_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x2f')](_0xd4fa('0x30'))){_0x2d3f88['limit']=qs['limit'](_0x164696[_0xd4fa('0x2b')]['limit']);_0x2d3f88['offset']=qs['offset'](_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x19')]);}_0x2d3f88[_0xd4fa('0x31')]=qs[_0xd4fa('0x32')](_0x164696['query'][_0xd4fa('0x32')]);_0x2d3f88[_0xd4fa('0x33')]=qs[_0xd4fa('0x34')](_[_0xd4fa('0x35')](_0x164696[_0xd4fa('0x2b')],_0xf7c366[_0xd4fa('0x34')]),_0xe03f19);if(_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x36')]){_0x2d3f88[_0xd4fa('0x33')]=_['merge'](_0x2d3f88['where'],{'$or':_[_0xd4fa('0x26')](_0xe03f19,function(_0x31fd8d){if(_0x31fd8d[_0xd4fa('0x29')]!==_0xd4fa('0x37')){var _0x3ebab1={};_0x3ebab1[_0x31fd8d[_0xd4fa('0x23')]]={'$like':'%'+_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x36')]+'%'};return _0x3ebab1;}})});}_0x2d3f88=_[_0xd4fa('0x38')]({},_0x2d3f88,_0x164696['options']);var _0x496555={'where':_0x2d3f88['where']};return db[_0xd4fa('0x27')]['count'](_0x496555)[_0xd4fa('0x39')](function(_0x5cc981){_0x1ff043['count']=_0x5cc981;if(_0x164696['query'][_0xd4fa('0x3a')]){_0x2d3f88['include']=[{'all':!![]}];}return db[_0xd4fa('0x27')][_0xd4fa('0x3b')](_0x2d3f88);})[_0xd4fa('0x39')](function(_0x19bcb3){_0x1ff043[_0xd4fa('0x3c')]=_0x19bcb3;return _0x1ff043;})[_0xd4fa('0x39')](respondWithFilteredResult(_0x5ec6f6,_0x2d3f88))['catch'](handleError(_0x5ec6f6,null));};exports[_0xd4fa('0x3d')]=function(_0x15a9ac,_0x14f961){var _0x7f922b={'raw':![],'where':{'id':_0x15a9ac[_0xd4fa('0x3e')]['id']}},_0x4fbbcd={};_0x4fbbcd[_0xd4fa('0x2a')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x4fbbcd['query']=_[_0xd4fa('0x3f')](_0x15a9ac[_0xd4fa('0x2b')]);_0x4fbbcd['filters']=_['intersection'](_0x4fbbcd[_0xd4fa('0x2a')],_0x4fbbcd[_0xd4fa('0x2b')]);_0x7f922b[_0xd4fa('0x2e')]=_[_0xd4fa('0x2c')](_0x4fbbcd['model'],qs[_0xd4fa('0x2d')](_0x15a9ac[_0xd4fa('0x2b')]['fields']));_0x7f922b[_0xd4fa('0x2e')]=_0x7f922b[_0xd4fa('0x2e')][_0xd4fa('0x40')]?_0x7f922b[_0xd4fa('0x2e')]:_0x4fbbcd[_0xd4fa('0x2a')];if(_0x15a9ac[_0xd4fa('0x2b')]['includeAll']){_0x7f922b[_0xd4fa('0x41')]=[{'all':!![]}];}_0x7f922b=_[_0xd4fa('0x38')]({},_0x7f922b,_0x15a9ac[_0xd4fa('0x42')]);return db['AnalyticFieldReport'][_0xd4fa('0x43')](_0x7f922b)[_0xd4fa('0x39')](handleEntityNotFound(_0x14f961,null))[_0xd4fa('0x39')](respondWithResult(_0x14f961,null))['catch'](handleError(_0x14f961,null));};exports['create']=function(_0x59987b,_0x58aa22){return db[_0xd4fa('0x27')]['create'](_0x59987b[_0xd4fa('0x44')],{})[_0xd4fa('0x39')](respondWithResult(_0x58aa22,0xc9))[_0xd4fa('0x45')](handleError(_0x58aa22,null));};exports[_0xd4fa('0x46')]=function(_0x544a0d,_0x34d147){return db[_0xd4fa('0x27')][_0xd4fa('0x46')](_0x544a0d['body'],{'raw':![],'individualHooks':!![]})[_0xd4fa('0x39')](respondWithResult(_0x34d147,0xc9))[_0xd4fa('0x45')](handleError(_0x34d147,null));};exports[_0xd4fa('0x20')]=function(_0x4f1c2c,_0x423677){if(_0x4f1c2c[_0xd4fa('0x44')]['id']){delete _0x4f1c2c[_0xd4fa('0x44')]['id'];}return db[_0xd4fa('0x27')]['find']({'where':{'id':_0x4f1c2c['params']['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x423677,null))['then'](saveUpdates(_0x4f1c2c[_0xd4fa('0x44')],null))[_0xd4fa('0x39')](respondWithResult(_0x423677,null))['catch'](handleError(_0x423677,null));};exports['destroy']=function(_0x947e9c,_0x56fb1b){return db[_0xd4fa('0x27')][_0xd4fa('0x43')]({'where':{'id':_0x947e9c[_0xd4fa('0x3e')]['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x56fb1b,null))[_0xd4fa('0x39')](removeEntity(_0x56fb1b,null))[_0xd4fa('0x45')](handleError(_0x56fb1b,null));};exports[_0xd4fa('0x47')]=function(_0x3d6219,_0x21d066){return db['AnalyticFieldReport'][_0xd4fa('0x21')]({'where':{'id':_0x3d6219['query'][_0xd4fa('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xd4fa('0x39')](respondWithResult(_0x21d066,0xcc))[_0xd4fa('0x45')](handleError(_0x21d066,null));};exports[_0xd4fa('0x49')]=function(_0x4e5004,_0x48d82a,_0xf3e396){return db[_0xd4fa('0x4a')][_0xd4fa('0x4b')]({'where':{'id':_0x4e5004['params']['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x48d82a,null))[_0xd4fa('0x39')](function(_0x39a936){if(_0x39a936){return db[_0xd4fa('0x4c')][_0xd4fa('0x4d')](function(_0x56bb51){return db[_0xd4fa('0x27')]['destroy']({'where':{'CustomReportId':_0x4e5004[_0xd4fa('0x3e')]['id']},'transaction':_0x56bb51})['then'](function(_0x19b1ae){var _0x4569f8=_[_0xd4fa('0x26')](_0x4e5004[_0xd4fa('0x44')],function(_0x491f34){delete _0x491f34['id'];_0x491f34['CustomReportId']=_0x4e5004[_0xd4fa('0x3e')]['id'];return _0x491f34;});return db['AnalyticFieldReport'][_0xd4fa('0x46')](_0x4569f8,{'transaction':_0x56bb51});});})['then'](function(){return db[_0xd4fa('0x27')][_0xd4fa('0x3b')]({'where':{'CustomReportId':_0x4e5004[_0xd4fa('0x3e')]['id']}});});}})[_0xd4fa('0x39')](respondWithResult(_0x48d82a,null))['catch'](handleError(_0x48d82a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fee67f7..54343d6 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 _0xd472=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd472,0x77));var _0x2d47=function(_0x32b591,_0x83d4fe){_0x32b591=_0x32b591-0x0;var _0x1603f1=_0xd472[_0x32b591];return _0x1603f1;};'use strict';var _=require(_0x2d47('0x0'));var util=require('util');var logger=require(_0x2d47('0x1'))(_0x2d47('0x2'));var moment=require(_0x2d47('0x3'));var BPromise=require(_0x2d47('0x4'));var rp=require(_0x2d47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d47('0x6'));var config=require(_0x2d47('0x7'));var attributes=require(_0x2d47('0x8'));module[_0x2d47('0x9')]=function(_0x4c1c85,_0x5c08a8){return _0x4c1c85[_0x2d47('0xa')](_0x2d47('0xb'),attributes,{'tableName':_0x2d47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x544a=['AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x1197da,_0x54cf3a){var _0x3b3a75=function(_0x18dd0f){while(--_0x18dd0f){_0x1197da['push'](_0x1197da['shift']());}};_0x3b3a75(++_0x54cf3a);}(_0x544a,0x146));var _0xa544=function(_0x49beab,_0xe4c823){_0x49beab=_0x49beab-0x0;var _0x5b98e0=_0x544a[_0x49beab];return _0x5b98e0;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require('../../config/logger')(_0xa544('0x2'));var moment=require(_0xa544('0x3'));var BPromise=require(_0xa544('0x4'));var rp=require(_0xa544('0x5'));var fs=require('fs');var path=require(_0xa544('0x6'));var rimraf=require('rimraf');var config=require(_0xa544('0x7'));var attributes=require(_0xa544('0x8'));module['exports']=function(_0xbfe31c,_0x46d61a){return _0xbfe31c[_0xa544('0x9')](_0xa544('0xa'),attributes,{'tableName':_0xa544('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index bcc8798..7fe4eed 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 _0x11d2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e78f4,_0x39412d){var _0x41ae6f=function(_0x32ad74){while(--_0x32ad74){_0x3e78f4['push'](_0x3e78f4['shift']());}};_0x41ae6f(++_0x39412d);}(_0x11d2,0x13d));var _0x211d=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x11d2[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var moment=require(_0x211d('0x2'));var BPromise=require(_0x211d('0x3'));var rs=require(_0x211d('0x4'));var fs=require('fs');var Redis=require(_0x211d('0x5'));var db=require(_0x211d('0x6'))['db'];var utils=require(_0x211d('0x7'));var logger=require(_0x211d('0x8'))(_0x211d('0x9'));var config=require(_0x211d('0xa'));var jayson=require(_0x211d('0xb'));var client=jayson[_0x211d('0xc')][_0x211d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51fdbd,_0x56ce0b,_0x23eb9f){return new BPromise(function(_0x46e85f,_0x144bfd){return client[_0x211d('0xe')](_0x51fdbd,_0x23eb9f)['then'](function(_0x4ae9d8){logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,'request\x20sent');logger[_0x211d('0x11')](_0x211d('0x12'),_0x56ce0b,_0x211d('0x13'),JSON[_0x211d('0x14')](_0x4ae9d8));if(_0x4ae9d8['error']){if(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x16')]===0x1f4){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')]['message']);return _0x144bfd(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);return _0x46e85f(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}else{logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,_0x211d('0x13'));_0x46e85f(_0x4ae9d8[_0x211d('0x18')]['message']);}})['catch'](function(_0x5baa24){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x5baa24);_0x144bfd(_0x5baa24);});});} \ No newline at end of file +var _0x5411=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x4f8244,_0x26f94e){var _0x41f619=function(_0x2741de){while(--_0x2741de){_0x4f8244['push'](_0x4f8244['shift']());}};_0x41f619(++_0x26f94e);}(_0x5411,0x12e));var _0x1541=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5411[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1541('0x0'));var util=require(_0x1541('0x1'));var moment=require(_0x1541('0x2'));var BPromise=require(_0x1541('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1541('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1541('0x5'))(_0x1541('0x6'));var config=require('../../config/environment');var jayson=require(_0x1541('0x7'));var client=jayson[_0x1541('0x8')][_0x1541('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ed291,_0x2ac567,_0x3279e5){return new BPromise(function(_0xb8e24d,_0x33f1c1){return client[_0x1541('0xa')](_0x4ed291,_0x3279e5)[_0x1541('0xb')](function(_0x2a5425){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2ac567,_0x1541('0xc'));logger['debug'](_0x1541('0xd'),_0x2ac567,_0x1541('0xc'),JSON[_0x1541('0xe')](_0x2a5425));if(_0x2a5425[_0x1541('0xf')]){if(_0x2a5425['error']['code']===0x1f4){logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x2a5425['error'][_0x1541('0x11')]);return _0x33f1c1(_0x2a5425[_0x1541('0xf')][_0x1541('0x11')]);}logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x2a5425[_0x1541('0xf')][_0x1541('0x11')]);return _0xb8e24d(_0x2a5425['error'][_0x1541('0x11')]);}else{logger[_0x1541('0x12')](_0x1541('0x10'),_0x2ac567,'request\x20sent');_0xb8e24d(_0x2a5425[_0x1541('0x13')]['message']);}})[_0x1541('0x14')](function(_0x29f6f6){logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x29f6f6);_0x33f1c1(_0x29f6f6);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 77cdd32..21b311a 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(_0x22005d,_0x579a64){var _0x175b8e=function(_0x318fc4){while(--_0x318fc4){_0x22005d['push'](_0x22005d['shift']());}};_0x175b8e(++_0x579a64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x3c41c8,_0xd46b3c){var _0x965ce=function(_0x401618){while(--_0x401618){_0x3c41c8['push'](_0x3c41c8['shift']());}};_0x965ce(++_0xd46b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 d8252e9..02ee238 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 _0x9a86=['name','STRING','TEXT','sequelize','exports'];(function(_0x356758,_0x28d328){var _0x44610b=function(_0x105469){while(--_0x105469){_0x356758['push'](_0x356758['shift']());}};_0x44610b(++_0x28d328);}(_0x9a86,0x1ed));var _0x69a8=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x9a86[_0x3932eb];return _0x5316e5;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x69a8('0x2')},'table':{'type':Sequelize[_0x69a8('0x3')]},'metric':{'type':Sequelize[_0x69a8('0x4')]},'description':{'type':Sequelize[_0x69a8('0x3')]}}; \ No newline at end of file +var _0x7382=['exports','STRING'];(function(_0x9ba57c,_0x5ecc0d){var _0x627a6e=function(_0x3c702d){while(--_0x3c702d){_0x9ba57c['push'](_0x9ba57c['shift']());}};_0x627a6e(++_0x5ecc0d);}(_0x7382,0x1f2));var _0x2738=function(_0x18ad25,_0x2b94fb){_0x18ad25=_0x18ad25-0x0;var _0x1efbab=_0x7382[_0x18ad25];return _0x1efbab;};'use strict';var Sequelize=require('sequelize');module[_0x2738('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2738('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x2738('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4bc7c66..debd27e 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7da7,0x10d));var _0x77da=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x7da7[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4fba6f,_0x777932){var _0x44f4cb=function(_0x5b304d){while(--_0x5b304d){_0x4fba6f['push'](_0x4fba6f['shift']());}};_0x44f4cb(++_0x777932);}(_0x98a8,0x12c));var _0x898a=function(_0x5bcab8,_0x2c5b58){_0x5bcab8=_0x5bcab8-0x0;var _0xdc33a3=_0x98a8[_0x5bcab8];return _0xdc33a3;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index db7d346..6dfb02f 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 _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_metrics','lodash'];(function(_0x53e3fa,_0xbcabb5){var _0xcb3861=function(_0x1d1196){while(--_0x1d1196){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xcb3861(++_0xbcabb5);}(_0x7da7,0x10d));var _0x77da=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7da7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('AnalyticMetric',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b20=['../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b8c7f,_0xabadc4){var _0x3f1cbe=function(_0x183226){while(--_0x183226){_0x4b8c7f['push'](_0x4b8c7f['shift']());}};_0x3f1cbe(++_0xabadc4);}(_0x5b20,0x86));var _0x05b2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5b20[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'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 f2b6a20..8d34370 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 _0x3c91=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x3c91,0xcc));var _0x13c9=function(_0x473c42,_0x286677){_0x473c42=_0x473c42-0x0;var _0x252886=_0x3c91[_0x473c42];return _0x252886;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require(_0x13c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x4'));var db=require(_0x13c9('0x5'))['db'];var utils=require(_0x13c9('0x6'));var logger=require(_0x13c9('0x7'))(_0x13c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x13c9('0x9'));var client=jayson[_0x13c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25b9fd,_0x1d2715,_0x2613b3){return new BPromise(function(_0x1f5c57,_0x2b5c25){return client[_0x13c9('0xb')](_0x25b9fd,_0x2613b3)[_0x13c9('0xc')](function(_0x4d0c97){logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');logger[_0x13c9('0xe')](_0x13c9('0xf'),_0x1d2715,_0x13c9('0x10'),JSON['stringify'](_0x4d0c97));if(_0x4d0c97[_0x13c9('0x11')]){if(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x12')]===0x1f4){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')]['message']);return _0x2b5c25(_0x4d0c97['error']['message']);}logger['error'](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);return _0x1f5c57(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);}else{logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');_0x1f5c57(_0x4d0c97[_0x13c9('0x14')][_0x13c9('0x13')]);}})[_0x13c9('0x15')](function(_0x5e7d46){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x5e7d46);_0x2b5c25(_0x5e7d46);});});} \ No newline at end of file +var _0xed2c=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1ffbe0,_0x33e573){var _0x496ca2=function(_0x1af8aa){while(--_0x1af8aa){_0x1ffbe0['push'](_0x1ffbe0['shift']());}};_0x496ca2(++_0x33e573);}(_0xed2c,0xc4));var _0xced2=function(_0x2bc4df,_0x397a6f){_0x2bc4df=_0x2bc4df-0x0;var _0x4bcc54=_0xed2c[_0x2bc4df];return _0x4bcc54;};'use strict';var _=require(_0xced2('0x0'));var util=require(_0xced2('0x1'));var moment=require(_0xced2('0x2'));var BPromise=require('bluebird');var rs=require(_0xced2('0x3'));var fs=require('fs');var Redis=require(_0xced2('0x4'));var db=require(_0xced2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xced2('0x6'))(_0xced2('0x7'));var config=require(_0xced2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xced2('0x9')][_0xced2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208fda,_0x7b4091,_0x17c12e){return new BPromise(function(_0x70fae6,_0x38303d){return client[_0xced2('0xb')](_0x208fda,_0x17c12e)[_0xced2('0xc')](function(_0x4c6eb1){logger[_0xced2('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x7b4091,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x7b4091,_0xced2('0xe'),JSON[_0xced2('0xf')](_0x4c6eb1));if(_0x4c6eb1[_0xced2('0x10')]){if(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x11')]===0x1f4){logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);return _0x38303d(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);}logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x4c6eb1['error'][_0xced2('0x13')]);return _0x70fae6(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);}else{logger['info'](_0xced2('0x12'),_0x7b4091,_0xced2('0xe'));_0x70fae6(_0x4c6eb1[_0xced2('0x14')][_0xced2('0x13')]);}})[_0xced2('0x15')](function(_0x2a98be){logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x2a98be);_0x38303d(_0x2a98be);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6feccc8..6b17745 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 _0xb1a3=['get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x597e39,_0x26f975){var _0x2cfc99=function(_0x5b40a2){while(--_0x5b40a2){_0x597e39['push'](_0x597e39['shift']());}};_0x2cfc99(++_0x26f975);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xb1a3[_0x1034ca];return _0x1a023a;};'use strict';var multer=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var path=require(_0x3b1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b1a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b1a('0x4'));var interaction=require(_0x3b1a('0x5'));var config=require(_0x3b1a('0x6'));var controller=require(_0x3b1a('0x7'));router[_0x3b1a('0x8')]('/',auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xa')]);router['get'](_0x3b1a('0xb'),auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xc')]);router[_0x3b1a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b1a('0xe')](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0xf')]);router['delete'](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0x10')]);module[_0x3b1a('0x11')]=router; \ No newline at end of file +var _0x0eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x3a04d4,_0x46b803){var _0x1557e5=function(_0x4b90ad){while(--_0x4b90ad){_0x3a04d4['push'](_0x3a04d4['shift']());}};_0x1557e5(++_0x46b803);}(_0x0eb2,0x11c));var _0x20eb=function(_0x5958a6,_0x34a283){_0x5958a6=_0x5958a6-0x0;var _0x33513f=_0x0eb2[_0x5958a6];return _0x33513f;};'use strict';var multer=require(_0x20eb('0x0'));var util=require('util');var path=require(_0x20eb('0x1'));var timeout=require(_0x20eb('0x2'));var express=require(_0x20eb('0x3'));var router=express[_0x20eb('0x4')]();var fs_extra=require(_0x20eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20eb('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0x8')]);router[_0x20eb('0x9')]('/:id',auth[_0x20eb('0x7')](),controller[_0x20eb('0xa')]);router[_0x20eb('0xb')]('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0xc')]);router[_0x20eb('0xd')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0xf')]);router[_0x20eb('0x10')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0x11')]);module[_0x20eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f105c81..cb18049 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 _0x8e45=['TEXT'];(function(_0x31fcb1,_0x45f216){var _0x2ea7e6=function(_0x3977e0){while(--_0x3977e0){_0x31fcb1['push'](_0x31fcb1['shift']());}};_0x2ea7e6(++_0x45f216);}(_0x8e45,0x1f2));var _0x58e4=function(_0x45218a,_0xbd1113){_0x45218a=_0x45218a-0x0;var _0x14027a=_0x8e45[_0x45218a];return _0x14027a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x58e4('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x92e1=['exports','TEXT','sequelize'];(function(_0x46815d,_0x9c59b0){var _0x2d27b4=function(_0x30e294){while(--_0x30e294){_0x46815d['push'](_0x46815d['shift']());}};_0x2d27b4(++_0x9c59b0);}(_0x92e1,0x10d));var _0x192e=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x92e1[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x192e('0x0'));module[_0x192e('0x1')]={'tree':{'type':Sequelize[_0x192e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index cb709d3..069b866 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 _0x39a8=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','AnalyticTreeReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x35a76f,_0x158af7){var _0x184f62=function(_0xedbd82){while(--_0xedbd82){_0x35a76f['push'](_0x35a76f['shift']());}};_0x184f62(++_0x158af7);}(_0x39a8,0xdc));var _0x839a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39a8[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x839a('0x0'));var zipdir=require(_0x839a('0x1'));var jsonpatch=require(_0x839a('0x2'));var rp=require(_0x839a('0x3'));var moment=require(_0x839a('0x4'));var BPromise=require(_0x839a('0x5'));var Mustache=require(_0x839a('0x6'));var util=require(_0x839a('0x7'));var path=require(_0x839a('0x8'));var sox=require(_0x839a('0x9'));var csv=require(_0x839a('0xa'));var ejs=require(_0x839a('0xb'));var fs=require('fs');var fs_extra=require(_0x839a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x839a('0xd'));var jsforce=require(_0x839a('0xe'));var deskjs=require(_0x839a('0xf'));var toCsv=require(_0x839a('0xa'));var querystring=require(_0x839a('0x10'));var Papa=require(_0x839a('0x11'));var Redis=require(_0x839a('0x12'));var authService=require(_0x839a('0x13'));var qs=require(_0x839a('0x14'));var as=require(_0x839a('0x15'));var hardwareService=require(_0x839a('0x16'));var logger=require(_0x839a('0x17'))(_0x839a('0x18'));var utils=require(_0x839a('0x19'));var config=require(_0x839a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x839a('0x1b'))['db'];function respondWithStatusCode(_0x140f0f,_0x392698){_0x392698=_0x392698||0xcc;return function(_0x138c35){if(_0x138c35){return _0x140f0f[_0x839a('0x1c')](_0x392698);}return _0x140f0f[_0x839a('0x1d')](_0x392698)[_0x839a('0x1e')]();};}function respondWithResult(_0x162209,_0x400aaf){_0x400aaf=_0x400aaf||0xc8;return function(_0x39cef6){if(_0x39cef6){return _0x162209[_0x839a('0x1d')](_0x400aaf)['json'](_0x39cef6);}};}function respondWithFilteredResult(_0x19e7ce,_0x59ba5e){return function(_0xb27002){if(_0xb27002){var _0x17b08b=typeof _0x59ba5e[_0x839a('0x1f')]==='undefined'&&typeof _0x59ba5e[_0x839a('0x20')]===_0x839a('0x21');var _0x14d6aa=_0xb27002['count'];var _0x4e663c=_0x17b08b?0x0:_0x59ba5e[_0x839a('0x1f')];var _0x26ed42=_0x17b08b?_0xb27002[_0x839a('0x22')]:_0x59ba5e[_0x839a('0x1f')]+_0x59ba5e[_0x839a('0x20')];var _0x569966;if(_0x26ed42>=_0x14d6aa){_0x26ed42=_0x14d6aa;_0x569966=0xc8;}else{_0x569966=0xce;}_0x19e7ce[_0x839a('0x1d')](_0x569966);return _0x19e7ce[_0x839a('0x23')](_0x839a('0x24'),_0x4e663c+'-'+_0x26ed42+'/'+_0x14d6aa)[_0x839a('0x25')](_0xb27002);}return null;};}function patchUpdates(_0x4b8ba9){return function(_0xe0e950){try{jsonpatch['apply'](_0xe0e950,_0x4b8ba9,!![]);}catch(_0x3a2839){return BPromise[_0x839a('0x26')](_0x3a2839);}return _0xe0e950['save']();};}function saveUpdates(_0x530a53,_0x579d27){return function(_0x57333b){if(_0x57333b){return _0x57333b[_0x839a('0x27')](_0x530a53)[_0x839a('0x28')](function(_0x2e272e){return _0x2e272e;});}return null;};}function removeEntity(_0x95b44b,_0x369f72){return function(_0x5a819f){if(_0x5a819f){return _0x5a819f[_0x839a('0x29')]()[_0x839a('0x28')](function(){_0x95b44b[_0x839a('0x1d')](0xcc)[_0x839a('0x1e')]();});}};}function handleEntityNotFound(_0x3b2e9e,_0x9fc3af){return function(_0x3d5cd8){if(!_0x3d5cd8){_0x3b2e9e[_0x839a('0x1c')](0x194);}return _0x3d5cd8;};}function handleError(_0x3feec1,_0x1d99eb){_0x1d99eb=_0x1d99eb||0x1f4;return function(_0x2d4207){logger[_0x839a('0x2a')](_0x2d4207['stack']);if(_0x2d4207[_0x839a('0x2b')]){delete _0x2d4207[_0x839a('0x2b')];}_0x3feec1[_0x839a('0x1d')](_0x1d99eb)[_0x839a('0x2c')](_0x2d4207);};}exports[_0x839a('0x2d')]=function(_0x275d20,_0x55846d){var _0x16df8c={},_0x5f3928={},_0x2bc7f0={'count':0x0,'rows':[]};var _0x12a68e=_['map'](db[_0x839a('0x2e')]['rawAttributes'],function(_0x43320f){return{'name':_0x43320f[_0x839a('0x2f')],'type':_0x43320f['type'][_0x839a('0x30')]};});_0x5f3928[_0x839a('0x31')]=_['map'](_0x12a68e,_0x839a('0x2b'));_0x5f3928[_0x839a('0x32')]=_[_0x839a('0x33')](_0x275d20[_0x839a('0x32')]);_0x5f3928[_0x839a('0x34')]=_['intersection'](_0x5f3928['model'],_0x5f3928['query']);_0x16df8c[_0x839a('0x35')]=_[_0x839a('0x36')](_0x5f3928['model'],qs[_0x839a('0x37')](_0x275d20[_0x839a('0x32')][_0x839a('0x37')]));_0x16df8c[_0x839a('0x35')]=_0x16df8c[_0x839a('0x35')][_0x839a('0x38')]?_0x16df8c[_0x839a('0x35')]:_0x5f3928[_0x839a('0x31')];if(!_0x275d20[_0x839a('0x32')][_0x839a('0x39')](_0x839a('0x3a'))){_0x16df8c['limit']=qs[_0x839a('0x20')](_0x275d20['query'][_0x839a('0x20')]);_0x16df8c['offset']=qs['offset'](_0x275d20[_0x839a('0x32')]['offset']);}_0x16df8c[_0x839a('0x3b')]=qs[_0x839a('0x3c')](_0x275d20[_0x839a('0x32')]['sort']);_0x16df8c[_0x839a('0x3d')]=qs['filters'](_['pick'](_0x275d20[_0x839a('0x32')],_0x5f3928[_0x839a('0x34')]),_0x12a68e);if(_0x275d20[_0x839a('0x32')][_0x839a('0x3e')]){_0x16df8c[_0x839a('0x3d')]=_[_0x839a('0x3f')](_0x16df8c[_0x839a('0x3d')],{'$or':_[_0x839a('0x40')](_0x12a68e,function(_0x583681){if(_0x583681[_0x839a('0x41')]!=='VIRTUAL'){var _0x4fbc63={};_0x4fbc63[_0x583681[_0x839a('0x2b')]]={'$like':'%'+_0x275d20['query']['filter']+'%'};return _0x4fbc63;}})});}_0x16df8c=_[_0x839a('0x3f')]({},_0x16df8c,_0x275d20['options']);var _0x4b14d5={'where':_0x16df8c['where']};return db['AnalyticTreeReport'][_0x839a('0x22')](_0x4b14d5)['then'](function(_0x2a15d0){_0x2bc7f0[_0x839a('0x22')]=_0x2a15d0;if(_0x275d20[_0x839a('0x32')][_0x839a('0x42')]){_0x16df8c[_0x839a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x839a('0x44')](_0x16df8c);})[_0x839a('0x28')](function(_0x1b5735){_0x2bc7f0[_0x839a('0x45')]=_0x1b5735;return _0x2bc7f0;})[_0x839a('0x28')](respondWithFilteredResult(_0x55846d,_0x16df8c))[_0x839a('0x46')](handleError(_0x55846d,null));};exports[_0x839a('0x47')]=function(_0x35d98d,_0x26f539){var _0x2aca05={'raw':!![],'where':{'id':_0x35d98d['params']['id']}},_0x5949f8={};_0x5949f8[_0x839a('0x31')]=_['keys'](db[_0x839a('0x2e')][_0x839a('0x48')]);_0x5949f8[_0x839a('0x32')]=_[_0x839a('0x33')](_0x35d98d['query']);_0x5949f8[_0x839a('0x34')]=_['intersection'](_0x5949f8[_0x839a('0x31')],_0x5949f8[_0x839a('0x32')]);_0x2aca05['attributes']=_[_0x839a('0x36')](_0x5949f8[_0x839a('0x31')],qs[_0x839a('0x37')](_0x35d98d[_0x839a('0x32')][_0x839a('0x37')]));_0x2aca05['attributes']=_0x2aca05[_0x839a('0x35')][_0x839a('0x38')]?_0x2aca05[_0x839a('0x35')]:_0x5949f8[_0x839a('0x31')];if(_0x35d98d[_0x839a('0x32')][_0x839a('0x42')]){_0x2aca05[_0x839a('0x43')]=[{'all':!![]}];}_0x2aca05=_[_0x839a('0x3f')]({},_0x2aca05,_0x35d98d['options']);return db[_0x839a('0x2e')][_0x839a('0x49')](_0x2aca05)['then'](handleEntityNotFound(_0x26f539,null))[_0x839a('0x28')](respondWithResult(_0x26f539,null))[_0x839a('0x46')](handleError(_0x26f539,null));};exports[_0x839a('0x4a')]=function(_0x3d6602,_0xa9a62){return db[_0x839a('0x2e')]['create'](_0x3d6602[_0x839a('0x4b')],{})[_0x839a('0x28')](respondWithResult(_0xa9a62,0xc9))[_0x839a('0x46')](handleError(_0xa9a62,null));};exports[_0x839a('0x27')]=function(_0x178b45,_0x1f54dc){if(_0x178b45['body']['id']){delete _0x178b45[_0x839a('0x4b')]['id'];}return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x178b45[_0x839a('0x4c')]['id']}})[_0x839a('0x28')](handleEntityNotFound(_0x1f54dc,null))[_0x839a('0x28')](saveUpdates(_0x178b45['body'],null))[_0x839a('0x28')](respondWithResult(_0x1f54dc,null))[_0x839a('0x46')](handleError(_0x1f54dc,null));};exports['destroy']=function(_0x34c7ae,_0x307c38){return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x34c7ae[_0x839a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x307c38,null))[_0x839a('0x28')](removeEntity(_0x307c38,null))[_0x839a('0x46')](handleError(_0x307c38,null));}; \ No newline at end of file +var _0x05a1=['options','find','create','body','eml-format','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x05a1,0xd0));var _0x105a=function(_0x359ff2,_0x1fe389){_0x359ff2=_0x359ff2-0x0;var _0x347af3=_0x05a1[_0x359ff2];return _0x347af3;};'use strict';var emlformat=require(_0x105a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x105a('0x1'));var moment=require(_0x105a('0x2'));var BPromise=require(_0x105a('0x3'));var Mustache=require('mustache');var util=require(_0x105a('0x4'));var path=require('path');var sox=require(_0x105a('0x5'));var csv=require('to-csv');var ejs=require(_0x105a('0x6'));var fs=require('fs');var fs_extra=require(_0x105a('0x7'));var _=require(_0x105a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x105a('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x105a('0xa'));var querystring=require(_0x105a('0xb'));var Papa=require('papaparse');var Redis=require(_0x105a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x105a('0xd'));var as=require(_0x105a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x105a('0xf'))('api');var utils=require(_0x105a('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x105a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x488d47,_0x180ac8){_0x180ac8=_0x180ac8||0xcc;return function(_0x911842){if(_0x911842){return _0x488d47[_0x105a('0x12')](_0x180ac8);}return _0x488d47[_0x105a('0x13')](_0x180ac8)[_0x105a('0x14')]();};}function respondWithResult(_0x2b992e,_0x343781){_0x343781=_0x343781||0xc8;return function(_0x1ed252){if(_0x1ed252){return _0x2b992e[_0x105a('0x13')](_0x343781)['json'](_0x1ed252);}};}function respondWithFilteredResult(_0x11b8d1,_0x3216e9){return function(_0x5a46cf){if(_0x5a46cf){var _0x3240c1=typeof _0x3216e9[_0x105a('0x15')]===_0x105a('0x16')&&typeof _0x3216e9[_0x105a('0x17')]===_0x105a('0x16');var _0x2db578=_0x5a46cf[_0x105a('0x18')];var _0x633176=_0x3240c1?0x0:_0x3216e9[_0x105a('0x15')];var _0x5a3f40=_0x3240c1?_0x5a46cf[_0x105a('0x18')]:_0x3216e9[_0x105a('0x15')]+_0x3216e9[_0x105a('0x17')];var _0x4e0d7d;if(_0x5a3f40>=_0x2db578){_0x5a3f40=_0x2db578;_0x4e0d7d=0xc8;}else{_0x4e0d7d=0xce;}_0x11b8d1[_0x105a('0x13')](_0x4e0d7d);return _0x11b8d1[_0x105a('0x19')]('Content-Range',_0x633176+'-'+_0x5a3f40+'/'+_0x2db578)[_0x105a('0x1a')](_0x5a46cf);}return null;};}function patchUpdates(_0x3befca){return function(_0x45f2ad){try{jsonpatch[_0x105a('0x1b')](_0x45f2ad,_0x3befca,!![]);}catch(_0x2b7420){return BPromise[_0x105a('0x1c')](_0x2b7420);}return _0x45f2ad[_0x105a('0x1d')]();};}function saveUpdates(_0x293130,_0x4eb6a0){return function(_0x4a25b5){if(_0x4a25b5){return _0x4a25b5[_0x105a('0x1e')](_0x293130)[_0x105a('0x1f')](function(_0x33b99e){return _0x33b99e;});}return null;};}function removeEntity(_0x11f2a8,_0x51382f){return function(_0x49d303){if(_0x49d303){return _0x49d303[_0x105a('0x20')]()[_0x105a('0x1f')](function(){_0x11f2a8[_0x105a('0x13')](0xcc)[_0x105a('0x14')]();});}};}function handleEntityNotFound(_0x25cb3b,_0x3a6c61){return function(_0x3ae6ad){if(!_0x3ae6ad){_0x25cb3b[_0x105a('0x12')](0x194);}return _0x3ae6ad;};}function handleError(_0x330045,_0x4858cd){_0x4858cd=_0x4858cd||0x1f4;return function(_0x56724e){logger[_0x105a('0x21')](_0x56724e['stack']);if(_0x56724e[_0x105a('0x22')]){delete _0x56724e[_0x105a('0x22')];}_0x330045[_0x105a('0x13')](_0x4858cd)[_0x105a('0x23')](_0x56724e);};}exports[_0x105a('0x24')]=function(_0x147db3,_0x53efa4){var _0x3fa5dd={},_0x395a04={},_0x24a7b0={'count':0x0,'rows':[]};var _0x332360=_['map'](db['AnalyticTreeReport'][_0x105a('0x25')],function(_0x123b37){return{'name':_0x123b37[_0x105a('0x26')],'type':_0x123b37[_0x105a('0x27')][_0x105a('0x28')]};});_0x395a04['model']=_[_0x105a('0x29')](_0x332360,_0x105a('0x22'));_0x395a04[_0x105a('0x2a')]=_[_0x105a('0x2b')](_0x147db3[_0x105a('0x2a')]);_0x395a04[_0x105a('0x2c')]=_[_0x105a('0x2d')](_0x395a04[_0x105a('0x2e')],_0x395a04[_0x105a('0x2a')]);_0x3fa5dd['attributes']=_[_0x105a('0x2d')](_0x395a04['model'],qs[_0x105a('0x2f')](_0x147db3['query'][_0x105a('0x2f')]));_0x3fa5dd[_0x105a('0x30')]=_0x3fa5dd[_0x105a('0x30')][_0x105a('0x31')]?_0x3fa5dd[_0x105a('0x30')]:_0x395a04[_0x105a('0x2e')];if(!_0x147db3[_0x105a('0x2a')]['hasOwnProperty'](_0x105a('0x32'))){_0x3fa5dd[_0x105a('0x17')]=qs[_0x105a('0x17')](_0x147db3['query'][_0x105a('0x17')]);_0x3fa5dd[_0x105a('0x15')]=qs[_0x105a('0x15')](_0x147db3['query'][_0x105a('0x15')]);}_0x3fa5dd['order']=qs[_0x105a('0x33')](_0x147db3[_0x105a('0x2a')][_0x105a('0x33')]);_0x3fa5dd[_0x105a('0x34')]=qs[_0x105a('0x2c')](_['pick'](_0x147db3[_0x105a('0x2a')],_0x395a04[_0x105a('0x2c')]),_0x332360);if(_0x147db3[_0x105a('0x2a')][_0x105a('0x35')]){_0x3fa5dd[_0x105a('0x34')]=_[_0x105a('0x36')](_0x3fa5dd[_0x105a('0x34')],{'$or':_['map'](_0x332360,function(_0x4f882d){if(_0x4f882d[_0x105a('0x27')]!==_0x105a('0x37')){var _0x2e0da9={};_0x2e0da9[_0x4f882d[_0x105a('0x22')]]={'$like':'%'+_0x147db3[_0x105a('0x2a')][_0x105a('0x35')]+'%'};return _0x2e0da9;}})});}_0x3fa5dd=_['merge']({},_0x3fa5dd,_0x147db3['options']);var _0x5ce164={'where':_0x3fa5dd['where']};return db[_0x105a('0x38')]['count'](_0x5ce164)[_0x105a('0x1f')](function(_0x75003e){_0x24a7b0[_0x105a('0x18')]=_0x75003e;if(_0x147db3[_0x105a('0x2a')][_0x105a('0x39')]){_0x3fa5dd['include']=[{'all':!![]}];}return db[_0x105a('0x38')][_0x105a('0x3a')](_0x3fa5dd);})[_0x105a('0x1f')](function(_0xf10bda){_0x24a7b0[_0x105a('0x3b')]=_0xf10bda;return _0x24a7b0;})['then'](respondWithFilteredResult(_0x53efa4,_0x3fa5dd))[_0x105a('0x3c')](handleError(_0x53efa4,null));};exports[_0x105a('0x3d')]=function(_0x4b3393,_0x6db1d8){var _0xfd0f55={'raw':!![],'where':{'id':_0x4b3393[_0x105a('0x3e')]['id']}},_0x47a077={};_0x47a077['model']=_[_0x105a('0x2b')](db[_0x105a('0x38')][_0x105a('0x25')]);_0x47a077[_0x105a('0x2a')]=_[_0x105a('0x2b')](_0x4b3393[_0x105a('0x2a')]);_0x47a077[_0x105a('0x2c')]=_[_0x105a('0x2d')](_0x47a077['model'],_0x47a077[_0x105a('0x2a')]);_0xfd0f55[_0x105a('0x30')]=_['intersection'](_0x47a077[_0x105a('0x2e')],qs[_0x105a('0x2f')](_0x4b3393[_0x105a('0x2a')][_0x105a('0x2f')]));_0xfd0f55['attributes']=_0xfd0f55['attributes']['length']?_0xfd0f55['attributes']:_0x47a077[_0x105a('0x2e')];if(_0x4b3393[_0x105a('0x2a')][_0x105a('0x39')]){_0xfd0f55[_0x105a('0x3f')]=[{'all':!![]}];}_0xfd0f55=_[_0x105a('0x36')]({},_0xfd0f55,_0x4b3393[_0x105a('0x40')]);return db[_0x105a('0x38')][_0x105a('0x41')](_0xfd0f55)[_0x105a('0x1f')](handleEntityNotFound(_0x6db1d8,null))[_0x105a('0x1f')](respondWithResult(_0x6db1d8,null))['catch'](handleError(_0x6db1d8,null));};exports[_0x105a('0x42')]=function(_0xaa6a27,_0x494862){return db[_0x105a('0x38')]['create'](_0xaa6a27[_0x105a('0x43')],{})[_0x105a('0x1f')](respondWithResult(_0x494862,0xc9))[_0x105a('0x3c')](handleError(_0x494862,null));};exports[_0x105a('0x1e')]=function(_0x217b0e,_0x1223df){if(_0x217b0e[_0x105a('0x43')]['id']){delete _0x217b0e[_0x105a('0x43')]['id'];}return db[_0x105a('0x38')][_0x105a('0x41')]({'where':{'id':_0x217b0e[_0x105a('0x3e')]['id']}})[_0x105a('0x1f')](handleEntityNotFound(_0x1223df,null))[_0x105a('0x1f')](saveUpdates(_0x217b0e['body'],null))[_0x105a('0x1f')](respondWithResult(_0x1223df,null))['catch'](handleError(_0x1223df,null));};exports['destroy']=function(_0x48dd29,_0x4817c4){return db[_0x105a('0x38')]['find']({'where':{'id':_0x48dd29['params']['id']}})[_0x105a('0x1f')](handleEntityNotFound(_0x4817c4,null))['then'](removeEntity(_0x4817c4,null))[_0x105a('0x3c')](handleError(_0x4817c4,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 79f799b..132259e 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 _0xe78f=['moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','analytics_report_trees','../../config/logger','api'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe78f,0x1d2));var _0xfe78=function(_0xf1955f,_0x4b4cdc){_0xf1955f=_0xf1955f-0x0;var _0x185220=_0xe78f[_0xf1955f];return _0x185220;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe78('0x0'))(_0xfe78('0x1'));var moment=require(_0xfe78('0x2'));var BPromise=require('bluebird');var rp=require(_0xfe78('0x3'));var fs=require('fs');var path=require(_0xfe78('0x4'));var rimraf=require(_0xfe78('0x5'));var config=require(_0xfe78('0x6'));var attributes=require(_0xfe78('0x7'));module['exports']=function(_0x24294d,_0x5714ea){return _0x24294d['define']('AnalyticTreeReport',attributes,{'tableName':_0xfe78('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabf5=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util','../../config/logger','moment'];(function(_0x475fad,_0xad7d4f){var _0x599ac6=function(_0x1fd0c0){while(--_0x1fd0c0){_0x475fad['push'](_0x475fad['shift']());}};_0x599ac6(++_0xad7d4f);}(_0xabf5,0xe0));var _0x5abf=function(_0x4b833d,_0x224c12){_0x4b833d=_0x4b833d-0x0;var _0x553bf6=_0xabf5[_0x4b833d];return _0x553bf6;};'use strict';var _=require(_0x5abf('0x0'));var util=require(_0x5abf('0x1'));var logger=require(_0x5abf('0x2'))('api');var moment=require(_0x5abf('0x3'));var BPromise=require(_0x5abf('0x4'));var rp=require(_0x5abf('0x5'));var fs=require('fs');var path=require(_0x5abf('0x6'));var rimraf=require(_0x5abf('0x7'));var config=require(_0x5abf('0x8'));var attributes=require(_0x5abf('0x9'));module[_0x5abf('0xa')]=function(_0x31eb4b,_0x4cd408){return _0x31eb4b['define'](_0x5abf('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d7da79e..c3fc6c5 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 _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(_0x52bd88,_0x52def0){var _0x40c088=function(_0x38036f){while(--_0x38036f){_0x52bd88['push'](_0x52bd88['shift']());}};_0x40c088(++_0x52def0);}(_0xdb28,0x106));var _0x8db2=function(_0x4b7ea5,_0x5b1ffe){_0x4b7ea5=_0x4b7ea5-0x0;var _0x5c744a=_0xdb28[_0x4b7ea5];return _0x5c744a;};'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 +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(_0x3f8ee1,_0x58c438){var _0xf7a5f9=function(_0x5b43d4){while(--_0x5b43d4){_0x3f8ee1['push'](_0x3f8ee1['shift']());}};_0xf7a5f9(++_0x58c438);}(_0xdb28,0x106));var _0x8db2=function(_0x30d6cf,_0x242443){_0x30d6cf=_0x30d6cf-0x0;var _0x13acb0=_0xdb28[_0x30d6cf];return _0x13acb0;};'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 385428b..bbf1264 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 _0xaf49=['../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','path','Router','fs-extra','../../components/auth/service'];(function(_0x1b886e,_0x320e47){var _0x5280ea=function(_0x3cccce){while(--_0x3cccce){_0x1b886e['push'](_0x1b886e['shift']());}};_0x5280ea(++_0x320e47);}(_0xaf49,0xfb));var _0x9af4=function(_0x162d05,_0x22cc23){_0x162d05=_0x162d05-0x0;var _0x45c72d=_0xaf49[_0x162d05];return _0x45c72d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9af4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9af4('0x1')]();var fs_extra=require(_0x9af4('0x2'));var auth=require(_0x9af4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9af4('0x4'));var controller=require('./analyticTreeReport.controller');router[_0x9af4('0x5')]('/',auth[_0x9af4('0x6')](),controller[_0x9af4('0x7')]);router[_0x9af4('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x9af4('0x8')]);router[_0x9af4('0x9')]('/',auth['isAuthenticated'](),controller[_0x9af4('0xa')]);router[_0x9af4('0xb')]('/:id',auth[_0x9af4('0x6')](),controller[_0x9af4('0xc')]);router[_0x9af4('0xd')](_0x9af4('0xe'),auth['isAuthenticated'](),controller[_0x9af4('0xf')]);module[_0x9af4('0x10')]=router; \ No newline at end of file +var _0xd9a0=['show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0xd9a0,0x199));var _0x0d9a=function(_0xf383e3,_0x3f825e){_0xf383e3=_0xf383e3-0x0;var _0x3335f4=_0xd9a0[_0xf383e3];return _0x3335f4;};'use strict';var multer=require(_0x0d9a('0x0'));var util=require(_0x0d9a('0x1'));var path=require(_0x0d9a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d9a('0x3')]();var fs_extra=require(_0x0d9a('0x4'));var auth=require(_0x0d9a('0x5'));var interaction=require(_0x0d9a('0x6'));var config=require(_0x0d9a('0x7'));var controller=require(_0x0d9a('0x8'));router[_0x0d9a('0x9')]('/',auth[_0x0d9a('0xa')](),controller['index']);router[_0x0d9a('0x9')]('/:id',auth[_0x0d9a('0xa')](),controller[_0x0d9a('0xb')]);router[_0x0d9a('0xc')]('/',auth['isAuthenticated'](),controller[_0x0d9a('0xd')]);router[_0x0d9a('0xe')]('/:id',auth[_0x0d9a('0xa')](),controller[_0x0d9a('0xf')]);router[_0x0d9a('0x10')](_0x0d9a('0x11'),auth[_0x0d9a('0xa')](),controller[_0x0d9a('0x12')]);module[_0x0d9a('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 97349d6..40e96b3 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 _0x67a2=['STRING','sequelize','exports'];(function(_0xa74d82,_0x545983){var _0xc5d5ec=function(_0x10aed8){while(--_0x10aed8){_0xa74d82['push'](_0xa74d82['shift']());}};_0xc5d5ec(++_0x545983);}(_0x67a2,0xd3));var _0x267a=function(_0x1d1e50,_0x4ceaad){_0x1d1e50=_0x1d1e50-0x0;var _0xc4f0d0=_0x67a2[_0x1d1e50];return _0xc4f0d0;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x267a('0x2')]},'type':{'type':Sequelize[_0x267a('0x2')]}}; \ No newline at end of file +var _0x61a1=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61a1,0x127));var _0x161a=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x61a1[_0x43776a];return _0x18eb8f;};'use strict';var Sequelize=require(_0x161a('0x0'));module[_0x161a('0x1')]={'name':{'type':Sequelize[_0x161a('0x2')]},'basename':{'type':Sequelize[_0x161a('0x2')]},'type':{'type':Sequelize[_0x161a('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d700c48..111b823 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 _0x07c4=['count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Attachment','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit'];(function(_0x55f6d7,_0x5bd984){var _0x2153cc=function(_0x11ff8b){while(--_0x11ff8b){_0x55f6d7['push'](_0x55f6d7['shift']());}};_0x2153cc(++_0x5bd984);}(_0x07c4,0xee));var _0x407c=function(_0x3ebc22,_0x23c72c){_0x3ebc22=_0x3ebc22-0x0;var _0xb676b7=_0x07c4[_0x3ebc22];return _0xb676b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x407c('0x0'));var rp=require(_0x407c('0x1'));var moment=require(_0x407c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x407c('0x3'));var util=require(_0x407c('0x4'));var path=require(_0x407c('0x5'));var sox=require(_0x407c('0x6'));var csv=require('to-csv');var ejs=require(_0x407c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x407c('0x8'));var squel=require(_0x407c('0x9'));var crypto=require(_0x407c('0xa'));var jsforce=require(_0x407c('0xb'));var deskjs=require(_0x407c('0xc'));var toCsv=require(_0x407c('0xd'));var querystring=require(_0x407c('0xe'));var Papa=require(_0x407c('0xf'));var Redis=require(_0x407c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x407c('0x11'));var hardwareService=require(_0x407c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x407c('0x13'));var config=require(_0x407c('0x14'));var licenseUtil=require(_0x407c('0x15'));var db=require(_0x407c('0x16'))['db'];function respondWithStatusCode(_0x107c9f,_0x3c5dcf){_0x3c5dcf=_0x3c5dcf||0xcc;return function(_0x5248e6){if(_0x5248e6){return _0x107c9f['sendStatus'](_0x3c5dcf);}return _0x107c9f[_0x407c('0x17')](_0x3c5dcf)['end']();};}function respondWithResult(_0x27c194,_0x480244){_0x480244=_0x480244||0xc8;return function(_0x488b47){if(_0x488b47){return _0x27c194[_0x407c('0x17')](_0x480244)['json'](_0x488b47);}};}function respondWithFilteredResult(_0x3e2db7,_0x298f9e){return function(_0x4988a7){if(_0x4988a7){var _0x5f2924=typeof _0x298f9e[_0x407c('0x18')]==='undefined'&&typeof _0x298f9e[_0x407c('0x19')]==='undefined';var _0xa74f67=_0x4988a7[_0x407c('0x1a')];var _0x308275=_0x5f2924?0x0:_0x298f9e[_0x407c('0x18')];var _0x166bc5=_0x5f2924?_0x4988a7[_0x407c('0x1a')]:_0x298f9e[_0x407c('0x18')]+_0x298f9e['limit'];var _0x3beafe;if(_0x166bc5>=_0xa74f67){_0x166bc5=_0xa74f67;_0x3beafe=0xc8;}else{_0x3beafe=0xce;}_0x3e2db7[_0x407c('0x17')](_0x3beafe);return _0x3e2db7[_0x407c('0x1b')](_0x407c('0x1c'),_0x308275+'-'+_0x166bc5+'/'+_0xa74f67)['json'](_0x4988a7);}return null;};}function patchUpdates(_0x4c0427){return function(_0x422208){try{jsonpatch[_0x407c('0x1d')](_0x422208,_0x4c0427,!![]);}catch(_0x415242){return BPromise[_0x407c('0x1e')](_0x415242);}return _0x422208[_0x407c('0x1f')]();};}function saveUpdates(_0x108580,_0x31fb2c){return function(_0x4e28e8){if(_0x4e28e8){return _0x4e28e8[_0x407c('0x20')](_0x108580)[_0x407c('0x21')](function(_0x270af4){return _0x270af4;});}return null;};}function removeEntity(_0x212afa,_0x21a3da){return function(_0xd2fcc0){if(_0xd2fcc0){return _0xd2fcc0[_0x407c('0x22')]()[_0x407c('0x21')](function(){_0x212afa['status'](0xcc)[_0x407c('0x23')]();});}};}function handleEntityNotFound(_0x1d4f13,_0x47ca0e){return function(_0x32f515){if(!_0x32f515){_0x1d4f13[_0x407c('0x24')](0x194);}return _0x32f515;};}function handleError(_0x3fecbd,_0x33c6cf){_0x33c6cf=_0x33c6cf||0x1f4;return function(_0x20c734){logger[_0x407c('0x25')](_0x20c734[_0x407c('0x26')]);if(_0x20c734[_0x407c('0x27')]){delete _0x20c734['name'];}_0x3fecbd[_0x407c('0x17')](_0x33c6cf)[_0x407c('0x28')](_0x20c734);};}exports[_0x407c('0x29')]=function(_0x59ef01,_0x6636e4){var _0x11ad5a={},_0x1ac680={},_0x3cba0e={'count':0x0,'rows':[]};var _0x3adacf=_[_0x407c('0x2a')](db[_0x407c('0x2b')]['rawAttributes'],function(_0x33f2d2){return{'name':_0x33f2d2['fieldName'],'type':_0x33f2d2[_0x407c('0x2c')][_0x407c('0x2d')]};});_0x1ac680[_0x407c('0x2e')]=_[_0x407c('0x2a')](_0x3adacf,'name');_0x1ac680['query']=_[_0x407c('0x2f')](_0x59ef01['query']);_0x1ac680[_0x407c('0x30')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],_0x1ac680[_0x407c('0x32')]);_0x11ad5a[_0x407c('0x33')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x59ef01[_0x407c('0x32')][_0x407c('0x34')]));_0x11ad5a['attributes']=_0x11ad5a[_0x407c('0x33')]['length']?_0x11ad5a[_0x407c('0x33')]:_0x1ac680[_0x407c('0x2e')];if(!_0x59ef01[_0x407c('0x32')][_0x407c('0x35')]('nolimit')){_0x11ad5a['limit']=qs['limit'](_0x59ef01[_0x407c('0x32')]['limit']);_0x11ad5a[_0x407c('0x18')]=qs['offset'](_0x59ef01['query'][_0x407c('0x18')]);}_0x11ad5a[_0x407c('0x36')]=qs[_0x407c('0x37')](_0x59ef01[_0x407c('0x32')][_0x407c('0x37')]);_0x11ad5a[_0x407c('0x38')]=qs[_0x407c('0x30')](_[_0x407c('0x39')](_0x59ef01[_0x407c('0x32')],_0x1ac680['filters']),_0x3adacf);if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3a')]){_0x11ad5a[_0x407c('0x38')]=_['merge'](_0x11ad5a[_0x407c('0x38')],{'$or':_['map'](_0x3adacf,function(_0x13f8d7){if(_0x13f8d7[_0x407c('0x2c')]!=='VIRTUAL'){var _0x1bcfaf={};_0x1bcfaf[_0x13f8d7['name']]={'$like':'%'+_0x59ef01[_0x407c('0x32')]['filter']+'%'};return _0x1bcfaf;}})});}_0x11ad5a=_[_0x407c('0x3b')]({},_0x11ad5a,_0x59ef01[_0x407c('0x3c')]);var _0x4e9188={'where':_0x11ad5a[_0x407c('0x38')]};return db[_0x407c('0x2b')][_0x407c('0x1a')](_0x4e9188)[_0x407c('0x21')](function(_0x1060a3){_0x3cba0e[_0x407c('0x1a')]=_0x1060a3;if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3d')]){_0x11ad5a[_0x407c('0x3e')]=[{'all':!![]}];}return db[_0x407c('0x2b')]['findAll'](_0x11ad5a);})[_0x407c('0x21')](function(_0x546475){_0x3cba0e['rows']=_0x546475;return _0x3cba0e;})[_0x407c('0x21')](respondWithFilteredResult(_0x6636e4,_0x11ad5a))[_0x407c('0x3f')](handleError(_0x6636e4,null));};exports[_0x407c('0x40')]=function(_0x155426,_0x34bf99){var _0x1ba512={'raw':!![],'where':{'id':_0x155426[_0x407c('0x41')]['id']}},_0x160501={};_0x160501['model']=_[_0x407c('0x2f')](db[_0x407c('0x2b')][_0x407c('0x42')]);_0x160501[_0x407c('0x32')]=_[_0x407c('0x2f')](_0x155426[_0x407c('0x32')]);_0x160501[_0x407c('0x30')]=_['intersection'](_0x160501[_0x407c('0x2e')],_0x160501[_0x407c('0x32')]);_0x1ba512['attributes']=_['intersection'](_0x160501[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x155426[_0x407c('0x32')][_0x407c('0x34')]));_0x1ba512[_0x407c('0x33')]=_0x1ba512[_0x407c('0x33')]['length']?_0x1ba512[_0x407c('0x33')]:_0x160501[_0x407c('0x2e')];if(_0x155426[_0x407c('0x32')][_0x407c('0x3d')]){_0x1ba512[_0x407c('0x3e')]=[{'all':!![]}];}_0x1ba512=_[_0x407c('0x3b')]({},_0x1ba512,_0x155426['options']);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x1ba512)[_0x407c('0x21')](handleEntityNotFound(_0x34bf99,null))[_0x407c('0x21')](respondWithResult(_0x34bf99,null))[_0x407c('0x3f')](handleError(_0x34bf99,null));};exports[_0x407c('0x44')]=function(_0x2f1666,_0x1c38e9){var _0x2a9fd0={'where':{'id':_0x2f1666['params']['id']}},_0x3d9b15={};_0x3d9b15[_0x407c('0x2e')]=_[_0x407c('0x2f')](db['Attachment'][_0x407c('0x42')]);_0x2a9fd0[_0x407c('0x33')]=_[_0x407c('0x31')](_0x3d9b15[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x2f1666['query'][_0x407c('0x34')]));_0x2a9fd0[_0x407c('0x33')]=_0x2a9fd0[_0x407c('0x33')][_0x407c('0x45')]?_0x2a9fd0['attributes']:_0x3d9b15[_0x407c('0x2e')];if(_0x2f1666[_0x407c('0x32')][_0x407c('0x3d')]){_0x2a9fd0[_0x407c('0x3e')]=[{'all':!![]}];}_0x2a9fd0=_['merge']({},_0x2a9fd0,_0x2f1666[_0x407c('0x3c')]);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x2a9fd0)[_0x407c('0x21')](handleEntityNotFound(_0x1c38e9,null))['then'](function(_0x4b44c8){if(_0x4b44c8){var _0x1bd66a=_0x4b44c8[_0x407c('0x46')]({'plain':!![]});_0x1bd66a=qs[_0x407c('0x47')](_0x1bd66a,['id',_0x407c('0x48'),_0x407c('0x49')]);_0x2f1666[_0x407c('0x4a')]=_['omit'](_0x2f1666[_0x407c('0x4a')],['id',_0x407c('0x48'),'updatedAt']);return db[_0x407c('0x2b')][_0x407c('0x4b')](_[_0x407c('0x3b')](_0x1bd66a,_0x2f1666[_0x407c('0x4a')]),{'include':_0x2f1666[_0x407c('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x407c('0x21')](respondWithResult(_0x1c38e9,0xc9))[_0x407c('0x3f')](handleError(_0x1c38e9,null));};exports[_0x407c('0x20')]=function(_0x474d01,_0x52f050){if(_0x474d01[_0x407c('0x4a')]['id']){delete _0x474d01['body']['id'];}return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x474d01['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x52f050,null))[_0x407c('0x21')](saveUpdates(_0x474d01['body'],null))[_0x407c('0x21')](respondWithResult(_0x52f050,null))['catch'](handleError(_0x52f050,null));};exports[_0x407c('0x22')]=function(_0x368dc6,_0x13c72){return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x368dc6['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x13c72,null))['then'](removeEntity(_0x13c72,null))[_0x407c('0x3f')](handleError(_0x13c72,null));};exports['create']=function(_0x188bf5,_0x556260,_0x4dc048){_0x188bf5[_0x407c('0x4a')][_0x407c('0x27')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4d')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x4e')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4f')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x2c')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x50')];return db[_0x407c('0x2b')][_0x407c('0x4b')](_0x188bf5[_0x407c('0x4a')])[_0x407c('0x21')](respondWithResult(_0x556260,0xc9))['catch'](handleError(_0x556260,null));};exports[_0x407c('0x51')]=function(_0x26f05e,_0x109b19,_0x4a6608){return db[_0x407c('0x2b')][_0x407c('0x52')]({'where':{'id':_0x26f05e['params']['id']},'raw':!![]})[_0x407c('0x21')](handleEntityNotFound(_0x109b19,null))[_0x407c('0x21')](function(_0x450416){if(_0x450416){var _0x339260=_0x450416[_0x407c('0x53')]!==null;var _0x5ed0b9=path[_0x407c('0x54')](config[_0x407c('0x55')],_0x407c('0x56'));if(_0x339260){_0x5ed0b9=path[_0x407c('0x54')](_0x5ed0b9,_0x407c('0x57'));}var _0x503de8=path[_0x407c('0x54')](_0x5ed0b9,_0x450416[_0x407c('0x4e')]);return _0x109b19[_0x407c('0x51')](_0x503de8);}})[_0x407c('0x3f')](handleError(_0x109b19,null));}; \ No newline at end of file +var _0x6292=['where','filter','merge','VIRTUAL','options','includeAll','include','Attachment','show','rawAttributes','keys','find','catch','clone','get','omit','createdAt','body','updatedAt','create','update','params','destroy','file','basename','filename','mimetype','download','findOne','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','then','end','error','stack','name','send','index','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x6292,0x12e));var _0x2629=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x6292[_0x51fe5f];return _0x4abce9;};'use strict';var emlformat=require(_0x2629('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2629('0x1'));var jsonpatch=require(_0x2629('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2629('0x3'));var Mustache=require(_0x2629('0x4'));var util=require(_0x2629('0x5'));var path=require(_0x2629('0x6'));var sox=require(_0x2629('0x7'));var csv=require(_0x2629('0x8'));var ejs=require(_0x2629('0x9'));var fs=require('fs');var fs_extra=require(_0x2629('0xa'));var _=require(_0x2629('0xb'));var squel=require(_0x2629('0xc'));var crypto=require(_0x2629('0xd'));var jsforce=require(_0x2629('0xe'));var deskjs=require(_0x2629('0xf'));var toCsv=require(_0x2629('0x8'));var querystring=require(_0x2629('0x10'));var Papa=require('papaparse');var Redis=require(_0x2629('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2629('0x12'));var as=require(_0x2629('0x13'));var hardwareService=require(_0x2629('0x14'));var logger=require(_0x2629('0x15'))(_0x2629('0x16'));var utils=require(_0x2629('0x17'));var config=require(_0x2629('0x18'));var licenseUtil=require(_0x2629('0x19'));var db=require(_0x2629('0x1a'))['db'];function respondWithStatusCode(_0x25ae88,_0x57f7fb){_0x57f7fb=_0x57f7fb||0xcc;return function(_0x166de3){if(_0x166de3){return _0x25ae88[_0x2629('0x1b')](_0x57f7fb);}return _0x25ae88[_0x2629('0x1c')](_0x57f7fb)['end']();};}function respondWithResult(_0x83fa06,_0x3b41a5){_0x3b41a5=_0x3b41a5||0xc8;return function(_0x1deeef){if(_0x1deeef){return _0x83fa06[_0x2629('0x1c')](_0x3b41a5)[_0x2629('0x1d')](_0x1deeef);}};}function respondWithFilteredResult(_0x5be465,_0x5d5121){return function(_0x5d6b43){if(_0x5d6b43){var _0x3643e3=typeof _0x5d5121['offset']===_0x2629('0x1e')&&typeof _0x5d5121[_0x2629('0x1f')]===_0x2629('0x1e');var _0x45e4c8=_0x5d6b43[_0x2629('0x20')];var _0x43514c=_0x3643e3?0x0:_0x5d5121[_0x2629('0x21')];var _0x59cf13=_0x3643e3?_0x5d6b43[_0x2629('0x20')]:_0x5d5121[_0x2629('0x21')]+_0x5d5121['limit'];var _0x389193;if(_0x59cf13>=_0x45e4c8){_0x59cf13=_0x45e4c8;_0x389193=0xc8;}else{_0x389193=0xce;}_0x5be465['status'](_0x389193);return _0x5be465['set']('Content-Range',_0x43514c+'-'+_0x59cf13+'/'+_0x45e4c8)[_0x2629('0x1d')](_0x5d6b43);}return null;};}function patchUpdates(_0x1adbcb){return function(_0x87e9d2){try{jsonpatch[_0x2629('0x22')](_0x87e9d2,_0x1adbcb,!![]);}catch(_0x4b5569){return BPromise[_0x2629('0x23')](_0x4b5569);}return _0x87e9d2['save']();};}function saveUpdates(_0x54dcea,_0x48ca45){return function(_0x536245){if(_0x536245){return _0x536245['update'](_0x54dcea)['then'](function(_0x1dd810){return _0x1dd810;});}return null;};}function removeEntity(_0x118fb1,_0x54065c){return function(_0x156b67){if(_0x156b67){return _0x156b67['destroy']()[_0x2629('0x24')](function(){_0x118fb1[_0x2629('0x1c')](0xcc)[_0x2629('0x25')]();});}};}function handleEntityNotFound(_0x5d82ed,_0xf555be){return function(_0x38fb7b){if(!_0x38fb7b){_0x5d82ed[_0x2629('0x1b')](0x194);}return _0x38fb7b;};}function handleError(_0x1b9651,_0x368767){_0x368767=_0x368767||0x1f4;return function(_0x55d298){logger[_0x2629('0x26')](_0x55d298[_0x2629('0x27')]);if(_0x55d298['name']){delete _0x55d298[_0x2629('0x28')];}_0x1b9651[_0x2629('0x1c')](_0x368767)[_0x2629('0x29')](_0x55d298);};}exports[_0x2629('0x2a')]=function(_0x39bce9,_0xeed075){var _0xd1b549={},_0x5ac4f1={},_0x334e1e={'count':0x0,'rows':[]};var _0x4582df=_[_0x2629('0x2b')](db['Attachment']['rawAttributes'],function(_0x4d88e6){return{'name':_0x4d88e6[_0x2629('0x2c')],'type':_0x4d88e6[_0x2629('0x2d')][_0x2629('0x2e')]};});_0x5ac4f1['model']=_['map'](_0x4582df,_0x2629('0x28'));_0x5ac4f1[_0x2629('0x2f')]=_['keys'](_0x39bce9[_0x2629('0x2f')]);_0x5ac4f1[_0x2629('0x30')]=_['intersection'](_0x5ac4f1[_0x2629('0x31')],_0x5ac4f1[_0x2629('0x2f')]);_0xd1b549[_0x2629('0x32')]=_[_0x2629('0x33')](_0x5ac4f1['model'],qs[_0x2629('0x34')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x34')]));_0xd1b549[_0x2629('0x32')]=_0xd1b549['attributes'][_0x2629('0x35')]?_0xd1b549[_0x2629('0x32')]:_0x5ac4f1[_0x2629('0x31')];if(!_0x39bce9[_0x2629('0x2f')][_0x2629('0x36')](_0x2629('0x37'))){_0xd1b549[_0x2629('0x1f')]=qs[_0x2629('0x1f')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x1f')]);_0xd1b549['offset']=qs[_0x2629('0x21')](_0x39bce9[_0x2629('0x2f')]['offset']);}_0xd1b549[_0x2629('0x38')]=qs[_0x2629('0x39')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x39')]);_0xd1b549[_0x2629('0x3a')]=qs[_0x2629('0x30')](_['pick'](_0x39bce9['query'],_0x5ac4f1[_0x2629('0x30')]),_0x4582df);if(_0x39bce9[_0x2629('0x2f')][_0x2629('0x3b')]){_0xd1b549[_0x2629('0x3a')]=_[_0x2629('0x3c')](_0xd1b549['where'],{'$or':_['map'](_0x4582df,function(_0x2bc7a8){if(_0x2bc7a8[_0x2629('0x2d')]!==_0x2629('0x3d')){var _0x114b1b={};_0x114b1b[_0x2bc7a8[_0x2629('0x28')]]={'$like':'%'+_0x39bce9[_0x2629('0x2f')]['filter']+'%'};return _0x114b1b;}})});}_0xd1b549=_[_0x2629('0x3c')]({},_0xd1b549,_0x39bce9[_0x2629('0x3e')]);var _0x47379c={'where':_0xd1b549[_0x2629('0x3a')]};return db['Attachment'][_0x2629('0x20')](_0x47379c)['then'](function(_0x151b82){_0x334e1e[_0x2629('0x20')]=_0x151b82;if(_0x39bce9['query'][_0x2629('0x3f')]){_0xd1b549[_0x2629('0x40')]=[{'all':!![]}];}return db[_0x2629('0x41')]['findAll'](_0xd1b549);})[_0x2629('0x24')](function(_0x2daf8b){_0x334e1e['rows']=_0x2daf8b;return _0x334e1e;})[_0x2629('0x24')](respondWithFilteredResult(_0xeed075,_0xd1b549))['catch'](handleError(_0xeed075,null));};exports[_0x2629('0x42')]=function(_0x1d922e,_0x5126b2){var _0x2576fb={'raw':!![],'where':{'id':_0x1d922e['params']['id']}},_0x486094={};_0x486094[_0x2629('0x31')]=_['keys'](db[_0x2629('0x41')][_0x2629('0x43')]);_0x486094[_0x2629('0x2f')]=_[_0x2629('0x44')](_0x1d922e['query']);_0x486094[_0x2629('0x30')]=_[_0x2629('0x33')](_0x486094[_0x2629('0x31')],_0x486094['query']);_0x2576fb[_0x2629('0x32')]=_[_0x2629('0x33')](_0x486094[_0x2629('0x31')],qs[_0x2629('0x34')](_0x1d922e['query'][_0x2629('0x34')]));_0x2576fb[_0x2629('0x32')]=_0x2576fb[_0x2629('0x32')][_0x2629('0x35')]?_0x2576fb['attributes']:_0x486094[_0x2629('0x31')];if(_0x1d922e[_0x2629('0x2f')][_0x2629('0x3f')]){_0x2576fb[_0x2629('0x40')]=[{'all':!![]}];}_0x2576fb=_[_0x2629('0x3c')]({},_0x2576fb,_0x1d922e[_0x2629('0x3e')]);return db[_0x2629('0x41')][_0x2629('0x45')](_0x2576fb)[_0x2629('0x24')](handleEntityNotFound(_0x5126b2,null))[_0x2629('0x24')](respondWithResult(_0x5126b2,null))[_0x2629('0x46')](handleError(_0x5126b2,null));};exports[_0x2629('0x47')]=function(_0x3736a2,_0x151f4d){var _0x42a5e0={'where':{'id':_0x3736a2['params']['id']}},_0x7222b1={};_0x7222b1[_0x2629('0x31')]=_[_0x2629('0x44')](db['Attachment'][_0x2629('0x43')]);_0x42a5e0[_0x2629('0x32')]=_[_0x2629('0x33')](_0x7222b1[_0x2629('0x31')],qs[_0x2629('0x34')](_0x3736a2[_0x2629('0x2f')]['fields']));_0x42a5e0[_0x2629('0x32')]=_0x42a5e0[_0x2629('0x32')]['length']?_0x42a5e0['attributes']:_0x7222b1[_0x2629('0x31')];if(_0x3736a2[_0x2629('0x2f')]['includeAll']){_0x42a5e0['include']=[{'all':!![]}];}_0x42a5e0=_[_0x2629('0x3c')]({},_0x42a5e0,_0x3736a2[_0x2629('0x3e')]);return db[_0x2629('0x41')][_0x2629('0x45')](_0x42a5e0)['then'](handleEntityNotFound(_0x151f4d,null))['then'](function(_0x345564){if(_0x345564){var _0x4d453b=_0x345564[_0x2629('0x48')]({'plain':!![]});_0x4d453b=qs[_0x2629('0x49')](_0x4d453b,['id',_0x2629('0x4a'),'updatedAt']);_0x3736a2[_0x2629('0x4b')]=_[_0x2629('0x49')](_0x3736a2[_0x2629('0x4b')],['id','createdAt',_0x2629('0x4c')]);return db['Attachment'][_0x2629('0x4d')](_[_0x2629('0x3c')](_0x4d453b,_0x3736a2[_0x2629('0x4b')]),{'include':_0x3736a2[_0x2629('0x2f')][_0x2629('0x3f')]?[{'all':!![]}]:undefined});}})[_0x2629('0x24')](respondWithResult(_0x151f4d,0xc9))[_0x2629('0x46')](handleError(_0x151f4d,null));};exports[_0x2629('0x4e')]=function(_0x205500,_0x4e6a80){if(_0x205500[_0x2629('0x4b')]['id']){delete _0x205500['body']['id'];}return db[_0x2629('0x41')][_0x2629('0x45')]({'where':{'id':_0x205500[_0x2629('0x4f')]['id']}})[_0x2629('0x24')](handleEntityNotFound(_0x4e6a80,null))[_0x2629('0x24')](saveUpdates(_0x205500['body'],null))[_0x2629('0x24')](respondWithResult(_0x4e6a80,null))[_0x2629('0x46')](handleError(_0x4e6a80,null));};exports[_0x2629('0x50')]=function(_0x1de43e,_0x185e97){return db[_0x2629('0x41')][_0x2629('0x45')]({'where':{'id':_0x1de43e[_0x2629('0x4f')]['id']}})[_0x2629('0x24')](handleEntityNotFound(_0x185e97,null))['then'](removeEntity(_0x185e97,null))[_0x2629('0x46')](handleError(_0x185e97,null));};exports['create']=function(_0x461124,_0x4f78c7,_0x1df2d7){_0x461124[_0x2629('0x4b')][_0x2629('0x28')]=_0x461124[_0x2629('0x51')]['originalname'];_0x461124['body'][_0x2629('0x52')]=_0x461124['file'][_0x2629('0x53')];_0x461124['body'][_0x2629('0x2d')]=_0x461124[_0x2629('0x51')][_0x2629('0x54')];return db[_0x2629('0x41')][_0x2629('0x4d')](_0x461124[_0x2629('0x4b')])[_0x2629('0x24')](respondWithResult(_0x4f78c7,0xc9))[_0x2629('0x46')](handleError(_0x4f78c7,null));};exports[_0x2629('0x55')]=function(_0x1fc12a,_0x1cf544,_0xf010f1){return db['Attachment'][_0x2629('0x56')]({'where':{'id':_0x1fc12a[_0x2629('0x4f')]['id']},'raw':!![]})[_0x2629('0x24')](handleEntityNotFound(_0x1cf544,null))[_0x2629('0x24')](function(_0x3e5bcc){if(_0x3e5bcc){var _0x364955=_0x3e5bcc['ChatOfflineMessageId']!==null;var _0x1adb52=path[_0x2629('0x57')](config[_0x2629('0x58')],'server/files/attachments/');if(_0x364955){_0x1adb52=path[_0x2629('0x57')](_0x1adb52,_0x2629('0x59'));}var _0x316fe9=path[_0x2629('0x57')](_0x1adb52,_0x3e5bcc[_0x2629('0x52')]);return _0x1cf544[_0x2629('0x55')](_0x316fe9);}})[_0x2629('0x46')](handleError(_0x1cf544,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e496daa..f72e3fb 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 _0x1189=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x257fd4,_0x446a74){var _0x3bbcba=function(_0x53549c){while(--_0x53549c){_0x257fd4['push'](_0x257fd4['shift']());}};_0x3bbcba(++_0x446a74);}(_0x1189,0x157));var _0x9118=function(_0x5dacd7,_0x4a0c65){_0x5dacd7=_0x5dacd7-0x0;var _0x566b81=_0x1189[_0x5dacd7];return _0x566b81;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require(_0x9118('0x4'));var BPromise=require(_0x9118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require(_0x9118('0x7'));var config=require(_0x9118('0x8'));var attributes=require('./attachment.attributes');module[_0x9118('0x9')]=function(_0x57e0c1,_0x59546a){return _0x57e0c1[_0x9118('0xa')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f23=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment'];(function(_0x19a2a5,_0x58cc71){var _0x44bc75=function(_0x103e76){while(--_0x103e76){_0x19a2a5['push'](_0x19a2a5['shift']());}};_0x44bc75(++_0x58cc71);}(_0x7f23,0x1d6));var _0x37f2=function(_0x528570,_0x329514){_0x528570=_0x528570-0x0;var _0x1cb4f7=_0x7f23[_0x528570];return _0x1cb4f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x37f2('0x0'))(_0x37f2('0x1'));var moment=require(_0x37f2('0x2'));var BPromise=require('bluebird');var rp=require(_0x37f2('0x3'));var fs=require('fs');var path=require(_0x37f2('0x4'));var rimraf=require(_0x37f2('0x5'));var config=require(_0x37f2('0x6'));var attributes=require(_0x37f2('0x7'));module['exports']=function(_0x2d5e75,_0x419fdd){return _0x2d5e75[_0x37f2('0x8')](_0x37f2('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index c95246a..42e260f 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 _0x3299=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateAttachment','create','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd48545,_0x856e08){var _0x18094f=function(_0x528b05){while(--_0x528b05){_0xd48545['push'](_0xd48545['shift']());}};_0x18094f(++_0x856e08);}(_0x3299,0x1bc));var _0x9329=function(_0x3f906b,_0x42a1b5){_0x3f906b=_0x3f906b-0x0;var _0x5ce241=_0x3299[_0x3f906b];return _0x5ce241;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Attachment'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});}; \ No newline at end of file +var _0xd691=['Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw','info','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5bceff,_0x2d91cd){var _0xa1cd10=function(_0x40eba7){while(--_0x40eba7){_0x5bceff['push'](_0x5bceff['shift']());}};_0xa1cd10(++_0x2d91cd);}(_0xd691,0xe6));var _0x1d69=function(_0x1e028c,_0x2bd5b0){_0x1e028c=_0x1e028c-0x0;var _0x336831=_0xd691[_0x1e028c];return _0x336831;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var moment=require(_0x1d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d69('0x3'));var fs=require('fs');var Redis=require(_0x1d69('0x4'));var db=require(_0x1d69('0x5'))['db'];var utils=require(_0x1d69('0x6'));var logger=require(_0x1d69('0x7'))(_0x1d69('0x8'));var config=require(_0x1d69('0x9'));var jayson=require(_0x1d69('0xa'));var client=jayson[_0x1d69('0xb')][_0x1d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b0c,_0x520acb,_0x267da3){return new BPromise(function(_0x49f008,_0x369d44){return client[_0x1d69('0xd')](_0x5a5b0c,_0x267da3)[_0x1d69('0xe')](function(_0x364061){logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));logger[_0x1d69('0x11')](_0x1d69('0x12'),_0x520acb,_0x1d69('0x10'),JSON['stringify'](_0x364061));if(_0x364061['error']){if(_0x364061[_0x1d69('0x13')][_0x1d69('0x14')]===0x1f4){logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x369d44(_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);}logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x49f008(_0x364061[_0x1d69('0x13')]['message']);}else{logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));_0x49f008(_0x364061[_0x1d69('0x16')][_0x1d69('0x15')]);}})[_0x1d69('0x17')](function(_0x383771){logger['error'](_0x1d69('0xf'),_0x520acb,_0x383771);_0x369d44(_0x383771);});});}exports[_0x1d69('0x18')]=function(_0x34f6d4){var _0x53915f=this;return new Promise(function(_0x4cebea,_0x258249){return db[_0x1d69('0x19')][_0x1d69('0x1a')](_0x34f6d4['body'],{'raw':_0x34f6d4[_0x1d69('0x1b')]?_0x34f6d4[_0x1d69('0x1b')][_0x1d69('0x1c')]===undefined?!![]:![]:!![]})[_0x1d69('0xe')](function(_0x3ef4dc){logger[_0x1d69('0x1d')](_0x1d69('0x18'),_0x34f6d4);logger[_0x1d69('0x11')]('CreateAttachment',_0x34f6d4,JSON[_0x1d69('0x1e')](_0x3ef4dc));_0x4cebea(_0x3ef4dc);})[_0x1d69('0x17')](function(_0x1786e1){logger[_0x1d69('0x13')]('CreateAttachment',_0x1786e1[_0x1d69('0x15')],_0x34f6d4);_0x258249(_0x53915f[_0x1d69('0x13')](0x1f4,_0x1786e1[_0x1d69('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6172c4b..0dfbddd 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3c89bc,_0x210d5a){var _0x3dba77=function(_0x214dff){while(--_0x214dff){_0x3c89bc['push'](_0x3c89bc['shift']());}};_0x3dba77(++_0x210d5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d8884,_0x2b6633){_0x4d8884=_0x4d8884-0x0;var _0x49300c=_0x5f2f[_0x4d8884];return _0x49300c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _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(_0x5ea230,_0x20d0ba){var _0x224f7d=function(_0x577f61){while(--_0x577f61){_0x5ea230['push'](_0x5ea230['shift']());}};_0x224f7d(++_0x20d0ba);}(_0xadb5,0xad));var _0x5adb=function(_0x11c32d,_0x3e50f5){_0x11c32d=_0x11c32d-0x0;var _0x184a00=_0xadb5[_0x11c32d];return _0x184a00;};'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 diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 037826b..356b277 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 _0x233c=['lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','/login','profile','email','callback','google','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','disabled','blocked','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x233c,0x130));var _0xc233=function(_0x4348cf,_0x3c5e31){_0x4348cf=_0x4348cf-0x0;var _0xa33ff3=_0x233c[_0x4348cf];return _0xa33ff3;};'use strict';var _=require(_0xc233('0x0'));var passport=require(_0xc233('0x1'));var GoogleStrategy=require(_0xc233('0x2'))[_0xc233('0x3')];var moment=require('moment');var db=require(_0xc233('0x4'))['db'];var config=require(_0xc233('0x5'));var signToken=require(_0xc233('0x6'))[_0xc233('0x7')];var utils=require('../../config/utils');exports[_0xc233('0x8')]=passport[_0xc233('0x9')]('google',{'failureRedirect':_0xc233('0xa'),'scope':[_0xc233('0xb'),_0xc233('0xc')],'session':![]});exports[_0xc233('0xd')]=passport[_0xc233('0x9')](_0xc233('0xe'),{'failureRedirect':'/login','session':![]});passport[_0xc233('0xf')](new GoogleStrategy({'clientID':config[_0xc233('0xe')]?config['google']['clientID']:'id','clientSecret':config[_0xc233('0xe')]?config['google'][_0xc233('0x10')]:_0xc233('0x11'),'callbackURL':config[_0xc233('0xe')]?config[_0xc233('0xe')][_0xc233('0x12')]:''},function(_0x505ed3,_0x1bf040,_0x3a6592,_0xf83721){var _0x1c1a97,_0x4da362;return db[_0xc233('0x13')][_0xc233('0x14')]({'where':{'id':0x1},'attributes':[_0xc233('0x15'),_0xc233('0x16')],'raw':!![]})[_0xc233('0x17')](function(_0x574695){_0x1c1a97=_0x574695;return db[_0xc233('0x18')][_0xc233('0x19')]({'where':{'email':_[_0xc233('0x1a')](_0x3a6592['emails'],_0xc233('0x1b')),'role':{'$or':[_0xc233('0x1c'),_0xc233('0x1d'),_0xc233('0x1e')]}}});})[_0xc233('0x17')](function(_0x1b22d2){_0x4da362=_0x1b22d2;if(_0x4da362){if(_0x4da362[_0xc233('0x1f')]){return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1c1a97['blockDuration']>0x0){if(_0x4da362[_0xc233('0x20')]){if(moment(_0x4da362['blockedAt'])[_0xc233('0x21')](_0x1c1a97[_0xc233('0x16')],'minutes')>moment()){return _0xf83721(_0xc233('0x22'));}else{return utils[_0xc233('0x23')](_0x4da362,0x0,![],null)[_0xc233('0x17')](function(){return utils[_0xc233('0x24')](_0x4da362);})['then'](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc233('0x25')](function(_0x3455bc){_0xf83721(_0x3455bc);});})); \ No newline at end of file +var _0xc01b=['signToken','../../config/utils','profile','callback','authenticate','google','/login','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','value','user','agent','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb','../../config/environment'];(function(_0x1c259b,_0x241bf0){var _0x5196b3=function(_0x380b31){while(--_0x380b31){_0x1c259b['push'](_0x1c259b['shift']());}};_0x5196b3(++_0x241bf0);}(_0xc01b,0x1b5));var _0xbc01=function(_0x24a91e,_0x49f4c3){_0x24a91e=_0x24a91e-0x0;var _0x441c9e=_0xc01b[_0x24a91e];return _0x441c9e;};'use strict';var _=require('lodash');var passport=require(_0xbc01('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0xbc01('0x1')];var moment=require(_0xbc01('0x2'));var db=require(_0xbc01('0x3'))['db'];var config=require(_0xbc01('0x4'));var signToken=require('../../components/auth/service')[_0xbc01('0x5')];var utils=require(_0xbc01('0x6'));exports['login']=passport['authenticate']('google',{'failureRedirect':'/login','scope':[_0xbc01('0x7'),'email'],'session':![]});exports[_0xbc01('0x8')]=passport[_0xbc01('0x9')](_0xbc01('0xa'),{'failureRedirect':_0xbc01('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xbc01('0xa')]?config['google']['clientID']:'id','clientSecret':config[_0xbc01('0xa')]?config[_0xbc01('0xa')][_0xbc01('0xc')]:'secret','callbackURL':config[_0xbc01('0xa')]?config[_0xbc01('0xa')][_0xbc01('0xd')]:''},function(_0x2700d9,_0x33a28a,_0x4e816a,_0x50ae35){var _0x459810,_0x2d066d;return db[_0xbc01('0xe')][_0xbc01('0xf')]({'where':{'id':0x1},'attributes':[_0xbc01('0x10'),_0xbc01('0x11')],'raw':!![]})[_0xbc01('0x12')](function(_0x15f660){_0x459810=_0x15f660;return db['User'][_0xbc01('0x13')]({'where':{'email':_[_0xbc01('0x14')](_0x4e816a[_0xbc01('0x15')],_0xbc01('0x16')),'role':{'$or':['admin',_0xbc01('0x17'),_0xbc01('0x18')]}}});})[_0xbc01('0x12')](function(_0x400fdb){_0x2d066d=_0x400fdb;if(_0x2d066d){if(_0x2d066d[_0xbc01('0x19')]){return _0x50ae35('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x459810[_0xbc01('0x11')]>0x0){if(_0x2d066d[_0xbc01('0x1a')]){if(moment(_0x2d066d[_0xbc01('0x1b')])[_0xbc01('0x1c')](_0x459810[_0xbc01('0x11')],_0xbc01('0x1d'))>moment()){return _0x50ae35(_0xbc01('0x1e'));}else{return utils[_0xbc01('0x1f')](_0x2d066d,0x0,![],null)['then'](function(){return utils[_0xbc01('0x20')](_0x2d066d);})['then'](function(){return _0x50ae35(null,_0x2d066d);});}}else{return utils[_0xbc01('0x20')](_0x2d066d)[_0xbc01('0x12')](function(){return _0x50ae35(null,_0x2d066d);});}}else{return utils[_0xbc01('0x20')](_0x2d066d)[_0xbc01('0x12')](function(){return _0x50ae35(null,_0x2d066d);});}}return _0x50ae35(_0xbc01('0x1e'));})[_0xbc01('0x21')](function(_0x113d52){_0x50ae35(_0x113d52);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index fe98fee..0969121 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 _0x1666=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x4f9e17,_0x58a581){var _0x514a97=function(_0x1c48e1){while(--_0x1c48e1){_0x4f9e17['push'](_0x4f9e17['shift']());}};_0x514a97(++_0x58a581);}(_0x1666,0x75));var _0x6166=function(_0x3c73f3,_0x231858){_0x3c73f3=_0x3c73f3-0x0;var _0x435c58=_0x1666[_0x3c73f3];return _0x435c58;};'use strict';var express=require(_0x6166('0x0'));var passport=require(_0x6166('0x1'));var router=express['Router']();var controller=require(_0x6166('0x2'));var userController=require(_0x6166('0x3'));var authService=require(_0x6166('0x4'));router[_0x6166('0x5')]('/',controller[_0x6166('0x6')]);router[_0x6166('0x5')](_0x6166('0x7'),controller[_0x6166('0x8')],authService['isMiddleware'],userController[_0x6166('0x6')],authService[_0x6166('0x9')]);module[_0x6166('0xa')]=router; \ No newline at end of file +var _0xd7dc=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','callback','isMiddleware','setTokenCookie'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xd7dc,0x18d));var _0xcd7d=function(_0x4d554d,_0x4e7503){_0x4d554d=_0x4d554d-0x0;var _0x3cf518=_0xd7dc[_0x4d554d];return _0x3cf518;};'use strict';var express=require(_0xcd7d('0x0'));var passport=require('passport');var router=express[_0xcd7d('0x1')]();var controller=require(_0xcd7d('0x2'));var userController=require(_0xcd7d('0x3'));var authService=require(_0xcd7d('0x4'));router['get']('/',controller['login']);router['get']('/callback',controller[_0xcd7d('0x5')],authService[_0xcd7d('0x6')],userController['login'],authService[_0xcd7d('0x7')]);module[_0xcd7d('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ab51c6f..5c405a9 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 _0x24cf=['body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','email','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot'];(function(_0x1c31f4,_0x8e8aeb){var _0x5a3f66=function(_0x3ff723){while(--_0x3ff723){_0x1c31f4['push'](_0x1c31f4['shift']());}};_0x5a3f66(++_0x8e8aeb);}(_0x24cf,0x1d5));var _0xf24c=function(_0x3a497b,_0x4c5cb7){_0x3a497b=_0x3a497b-0x0;var _0x2cfdb3=_0x24cf[_0x3a497b];return _0x2cfdb3;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xf24c('0x0'))[_0xf24c('0x1')];var jayson=require(_0xf24c('0x2'));var _=require(_0xf24c('0x3'));var rs=require(_0xf24c('0x4'));var moment=require('moment');var db=require(_0xf24c('0x5'))['db'];var authService=require(_0xf24c('0x6'));var utils=require(_0xf24c('0x7'));var client=jayson[_0xf24c('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4983e2,_0x5104bd,_0x272d25,_0x596e81){var _0x3b7cf1,_0x13163e;return db[_0xf24c('0x9')][_0xf24c('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x260dfd){_0x3b7cf1=_0x260dfd;return _0x4983e2[_0xf24c('0xa')]({'attributes':['id',_0xf24c('0xd'),_0xf24c('0xe'),'salt',_0xf24c('0xf'),_0xf24c('0x10'),_0xf24c('0x11'),'blockedAt',_0xf24c('0x12')],'where':{'name':_0x5104bd,'role':{'$or':[_0xf24c('0x13'),'user','agent']}}});})[_0xf24c('0xc')](function(_0x479b01){if(!_0x479b01||_0x479b01&&_0x479b01[_0xf24c('0xd')]!==_0x5104bd){throw new Error(_0xf24c('0x14'));}else{_0x13163e=_0x479b01;return _0x13163e;}})['then'](function(){_0x13163e[_0xf24c('0x15')](_0x272d25,function(_0x302daf,_0x1efef1){var _0x263c49=_0x13163e[_0xf24c('0x12')]+0x1;if(_0x302daf){return _0x596e81(_0x302daf);}else if(!_0x1efef1){if(_0x13163e['disabled']){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b7cf1[_0xf24c('0x16')]>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1[_0xf24c('0xb')],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':_0xf24c('0x14')});});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x263c49>=_0x3b7cf1[_0xf24c('0x16')]){return utils[_0xf24c('0x1a')](_0x13163e,0x0,!![],moment())[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x13163e[_0xf24c('0x10')]){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else if(_0x3b7cf1['allowedLoginAttempts']>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1['blockDuration'],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);})['catch'](function(_0x4b21f5){return _0x596e81(null,![],_0x4b21f5);});}}else{if(_0x13163e[_0xf24c('0x11')]){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x13163e)[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}}});})['catch'](function(_0x191c46){return _0x596e81(null,![],_0x191c46);});}function sendServiceMail(_0x379f9a){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0xf24c('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0xf24c('0x1d')}]})[_0xf24c('0xc')](function(_0x2ee712){if(!_0x2ee712){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2033a8={'tls':{'rejectUnauthorized':![]}};if(_0x2ee712['Smtp']['service']){_0x2033a8[_0xf24c('0x1e')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x1e')];}else{_0x2033a8[_0xf24c('0x1f')]=_0x2ee712['Smtp'][_0xf24c('0x1f')];_0x2033a8[_0xf24c('0x20')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x20')];_0x2033a8[_0xf24c('0x21')]=_0x2ee712[_0xf24c('0x1d')]['secure'];}if(_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x22')]){_0x2033a8[_0xf24c('0x23')]={'user':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x24')],'pass':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x25')]};}var _0x5c8f4a={'account':_0x2033a8,'message':_[_0xf24c('0x26')]({'from':util['format'](_0xf24c('0x27'),_0x2ee712[_0xf24c('0xd')],_0x2ee712['email']||_0x2ee712[_0xf24c('0x1d')]['user'])},_0x379f9a)};return client[_0xf24c('0x28')](_0xf24c('0x29'),_0x5c8f4a);})[_0xf24c('0xc')](function(_0x47f733){if(_0x47f733[_0xf24c('0x2a')]){throw new Error(util['format'](_0xf24c('0x2b'),_0x47f733['error']['message']||JSON['stringify'](_0x47f733[_0xf24c('0x2a')])));}return!![];});}function handleError(_0x2bd44c,_0x447761,_0x3334b3){return _0x2bd44c[_0xf24c('0x2c')](_0x447761||0x1f4)[_0xf24c('0x2d')]({'message':_0x3334b3?_0x3334b3[_0xf24c('0x2e')]||_0x3334b3:''});}exports['login']=function(_0x19b372,_0x39b928,_0x2332e6){passport[_0xf24c('0x15')](_0xf24c('0x2f'),function(_0x484b7f,_0x177c02,_0x571075){var _0x3e027f=_0x484b7f||_0x571075;if(_0x3e027f){return handleError(_0x39b928,0x191,_0x3e027f);}if(!_0x177c02){return handleError(_0x39b928,0x194,{'message':_0xf24c('0x30')});}else{var _0x303ad4={'payload':{'id':_0x177c02['id'],'role':_0x177c02[_0xf24c('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf24c('0x31')](_0x303ad4)[_0xf24c('0xc')](function(_0x3e5d78){_0x39b928[_0xf24c('0x32')]({'id':_0x177c02['id'],'token':_0x3e5d78,'statusCall':'','isAlreadyLogged':_0x177c02[_0xf24c('0x33')]});});}})(_0x19b372,_0x39b928,_0x2332e6);};exports[_0xf24c('0x34')]=function(_0x232688,_0x5d5ac1,_0x5d55f0){if(!_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]){return handleError(_0x5d5ac1,0x1f4,{'message':_0xf24c('0x36')});}var _0x11a9ca=rs[_0xf24c('0x37')]();_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]=_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')][_0xf24c('0x38')]()[_0xf24c('0x39')]();var _0x5002a1;return db[_0xf24c('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xf24c('0x16'),_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x2bd052){_0x5002a1=_0x2bd052;return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'email':_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]}});})[_0xf24c('0xc')](function(_0x2638f6){if(!_0x2638f6){throw new Error(_0xf24c('0x3c'));}if(_0x2638f6[_0xf24c('0x10')]){throw new Error(_0xf24c('0x3d'));}if(_0x2638f6[_0xf24c('0x11')]){if(moment(_0x2638f6[_0xf24c('0x17')])['add'](_0x5002a1['blockDuration'],_0xf24c('0x19'))>moment()){throw new Error(_0xf24c('0x3e'));}else{_0x2638f6[_0xf24c('0x11')]=![];_0x2638f6[_0xf24c('0x17')]=null;}}_0x2638f6[_0xf24c('0x3f')]=_0x11a9ca;_0x2638f6['resetPasswordExpires']=Date[_0xf24c('0x40')]()+0x36ee80;return _0x2638f6[_0xf24c('0x41')]();})[_0xf24c('0xc')](function(){return sendServiceMail({'to':_0x232688[_0xf24c('0x35')]['email'],'subject':_0xf24c('0x42'),'text':_0xf24c('0x43')+_0xf24c('0x44')+_0xf24c('0x45')+_0x232688[_0xf24c('0x46')][_0xf24c('0x1f')]+_0xf24c('0x47')+_0x11a9ca+'\x0a\x0a'+_0xf24c('0x48')});})[_0xf24c('0xc')](function(){_0x5d5ac1[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x49')});})[_0xf24c('0x4a')](function(_0x2b99f1){return handleError(_0x5d5ac1,0x1f4,_0x2b99f1);});};exports[_0xf24c('0x4b')]=function(_0x340552,_0x296252,_0x4ab953){return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'resetPasswordToken':_0x340552[_0xf24c('0x4c')][_0xf24c('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xf24c('0x40')]()}}})[_0xf24c('0xc')](function(_0x86dc69){if(!_0x86dc69){throw new Error(_0xf24c('0x4e'));}return db[_0xf24c('0x9')][_0xf24c('0xa')]({'attributes':['id','securePassword',_0xf24c('0x4f'),_0xf24c('0x50')]})['then'](function(_0x517dbf){if(_0x517dbf[_0xf24c('0x51')])authService[_0xf24c('0x52')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')]);if(!_0x517dbf[_0xf24c('0x4f')]||!_0x86dc69[_0xf24c('0x53')])return _0x86dc69;authService[_0xf24c('0x54')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')],_0x86dc69['previousPasswords'],_0x517dbf[_0xf24c('0x50')]);return _0x86dc69;})['then'](function(){_0x86dc69['password']=_0x340552[_0xf24c('0x35')][_0xf24c('0xe')];_0x86dc69[_0xf24c('0x3f')]=null;_0x86dc69[_0xf24c('0x55')]=null;return _0x86dc69[_0xf24c('0x41')]();});})[_0xf24c('0xc')](function(){_0x296252[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x56')});})[_0xf24c('0x4a')](function(_0x5793f2){return handleError(_0x296252,0x1f4,_0x5793f2);});};passport['use'](new LocalStrategy({'usernameField':_0xf24c('0xd'),'passwordField':'password'},function(_0x2b9b2d,_0x35a63a,_0x18012b){return localAuthenticate(db[_0xf24c('0x3a')],_0x2b9b2d,_0x35a63a,_0x18012b);})); \ No newline at end of file +var _0x2b2a=['findOne','allowedLoginAttempts','then','name','salt','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','blocked','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','save','Password\x20reset!','use','passport','passport-local','jayson/promise','moment','../../mysqldb','client','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2b2a,0x149));var _0xa2b2=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x2b2a[_0x490be3];return _0x3f5140;};'use strict';var util=require('util');var passport=require(_0xa2b2('0x0'));var LocalStrategy=require(_0xa2b2('0x1'))['Strategy'];var jayson=require(_0xa2b2('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xa2b2('0x3'));var db=require(_0xa2b2('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xa2b2('0x5')][_0xa2b2('0x6')]({'port':0x232b});function localAuthenticate(_0x29690f,_0x655546,_0x53282c,_0x5e066d){var _0x47bc23,_0x50bd5c;return db['Setting'][_0xa2b2('0x7')]({'where':{'id':0x1},'attributes':[_0xa2b2('0x8'),'blockDuration'],'raw':!![]})[_0xa2b2('0x9')](function(_0x34444a){_0x47bc23=_0x34444a;return _0x29690f['findOne']({'attributes':['id',_0xa2b2('0xa'),'password',_0xa2b2('0xb'),'role','disabled','blocked',_0xa2b2('0xc'),_0xa2b2('0xd')],'where':{'name':_0x655546,'role':{'$or':[_0xa2b2('0xe'),_0xa2b2('0xf'),'agent']}}});})[_0xa2b2('0x9')](function(_0x3411b5){if(!_0x3411b5||_0x3411b5&&_0x3411b5['name']!==_0x655546){throw new Error(_0xa2b2('0x10'));}else{_0x50bd5c=_0x3411b5;return _0x50bd5c;}})['then'](function(){_0x50bd5c['authenticate'](_0x53282c,function(_0xddcea8,_0x398be9){var _0x1b262d=_0x50bd5c[_0xa2b2('0xd')]+0x1;if(_0xddcea8){return _0x5e066d(_0xddcea8);}else if(!_0x398be9){if(_0x50bd5c[_0xa2b2('0x11')]){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x47bc23[_0xa2b2('0x8')]>0x0){if(_0x50bd5c[_0xa2b2('0x12')]){if(_0x47bc23[_0xa2b2('0x13')]>0x0){if(moment(_0x50bd5c[_0xa2b2('0xc')])[_0xa2b2('0x14')](_0x47bc23[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else{return utils[_0xa2b2('0x16')](_0x50bd5c,_0x1b262d,![],null)[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{if(_0x1b262d>=_0x47bc23['allowedLoginAttempts']){return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,!![],moment())[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});});}else{return utils['clearBlockUser'](_0x50bd5c,_0x1b262d,![],null)[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});});}}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{if(_0x50bd5c['disabled']){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else if(_0x47bc23[_0xa2b2('0x8')]>0x0){if(_0x50bd5c[_0xa2b2('0x12')]){if(_0x47bc23[_0xa2b2('0x13')]>0x0){if(moment(_0x50bd5c[_0xa2b2('0xc')])['add'](_0x47bc23[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else{return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,![],null)['then'](function(){return utils[_0xa2b2('0x17')](_0x50bd5c);})[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);});}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,![],null)[_0xa2b2('0x9')](function(){return utils[_0xa2b2('0x17')](_0x50bd5c);})[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);})[_0xa2b2('0x18')](function(_0x4d8295){return _0x5e066d(null,![],_0x4d8295);});}}else{if(_0x50bd5c[_0xa2b2('0x12')]){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x50bd5c)[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);});}}}});})[_0xa2b2('0x18')](function(_0x59dcdb){return _0x5e066d(null,![],_0x59dcdb);});}function sendServiceMail(_0x1c31d7){return db[_0xa2b2('0x19')][_0xa2b2('0x1a')]({'where':{'service':!![]},'attributes':['id','name',_0xa2b2('0x1b')],'include':[{'model':db[_0xa2b2('0x1c')],'as':_0xa2b2('0x1d')}]})[_0xa2b2('0x9')](function(_0x59dc22){if(!_0x59dc22){throw new Error(_0xa2b2('0x1e'));}var _0x21b379={'tls':{'rejectUnauthorized':![]}};if(_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0x1f')]){_0x21b379['service']=_0x59dc22[_0xa2b2('0x1d')]['service'];}else{_0x21b379['host']=_0x59dc22['Smtp'][_0xa2b2('0x20')];_0x21b379[_0xa2b2('0x21')]=_0x59dc22[_0xa2b2('0x1d')]['port'];_0x21b379[_0xa2b2('0x22')]=_0x59dc22['Smtp'][_0xa2b2('0x22')];}if(_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0x23')]){_0x21b379[_0xa2b2('0x24')]={'user':_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0xf')],'pass':_0x59dc22['Smtp']['pass']};}var _0x2adf6a={'account':_0x21b379,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x59dc22['name'],_0x59dc22[_0xa2b2('0x1b')]||_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0xf')])},_0x1c31d7)};return client[_0xa2b2('0x25')](_0xa2b2('0x26'),_0x2adf6a);})[_0xa2b2('0x9')](function(_0x55b8ac){if(_0x55b8ac[_0xa2b2('0x27')]){throw new Error(util[_0xa2b2('0x28')](_0xa2b2('0x29'),_0x55b8ac[_0xa2b2('0x27')]['message']||JSON[_0xa2b2('0x2a')](_0x55b8ac[_0xa2b2('0x27')])));}return!![];});}function handleError(_0x5bdbe5,_0x20404d,_0x25fc87){return _0x5bdbe5[_0xa2b2('0x2b')](_0x20404d||0x1f4)[_0xa2b2('0x2c')]({'message':_0x25fc87?_0x25fc87['message']||_0x25fc87:''});}exports[_0xa2b2('0x2d')]=function(_0x3a5113,_0x8a38e4,_0x586991){passport[_0xa2b2('0x2e')]('local',function(_0x287e9d,_0x412e8e,_0x478257){var _0x30fc2d=_0x287e9d||_0x478257;if(_0x30fc2d){return handleError(_0x8a38e4,0x191,_0x30fc2d);}if(!_0x412e8e){return handleError(_0x8a38e4,0x194,{'message':_0xa2b2('0x2f')});}else{var _0x56e842={'payload':{'id':_0x412e8e['id'],'role':_0x412e8e[_0xa2b2('0x30')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x56e842)['then'](function(_0x4748a2){_0x8a38e4[_0xa2b2('0x31')]({'id':_0x412e8e['id'],'token':_0x4748a2,'statusCall':'','isAlreadyLogged':_0x412e8e[_0xa2b2('0x32')]});});}})(_0x3a5113,_0x8a38e4,_0x586991);};exports['forgot']=function(_0x2d3b83,_0x5454b1,_0x35670e){if(!_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')]){return handleError(_0x5454b1,0x1f4,{'message':_0xa2b2('0x34')});}var _0x1f03fb=rs[_0xa2b2('0x35')]();_0x2d3b83[_0xa2b2('0x33')]['email']=_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')][_0xa2b2('0x36')]()[_0xa2b2('0x37')]();var _0x48eb7f;return db[_0xa2b2('0x38')][_0xa2b2('0x7')]({'where':{'id':0x1},'attributes':[_0xa2b2('0x8'),_0xa2b2('0x13')],'raw':!![]})[_0xa2b2('0x9')](function(_0x293c89){_0x48eb7f=_0x293c89;return db[_0xa2b2('0x39')][_0xa2b2('0x1a')]({'where':{'email':_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')]}});})[_0xa2b2('0x9')](function(_0x4de923){if(!_0x4de923){throw new Error(_0xa2b2('0x3a'));}if(_0x4de923[_0xa2b2('0x11')]){throw new Error(_0xa2b2('0x3b'));}if(_0x4de923[_0xa2b2('0x12')]){if(moment(_0x4de923['blockedAt'])[_0xa2b2('0x14')](_0x48eb7f[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){throw new Error(_0xa2b2('0x3c'));}else{_0x4de923['blocked']=![];_0x4de923[_0xa2b2('0xc')]=null;}}_0x4de923[_0xa2b2('0x3d')]=_0x1f03fb;_0x4de923[_0xa2b2('0x3e')]=Date[_0xa2b2('0x3f')]()+0x36ee80;return _0x4de923['save']();})[_0xa2b2('0x9')](function(){return sendServiceMail({'to':_0x2d3b83['body'][_0xa2b2('0x1b')],'subject':_0xa2b2('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xa2b2('0x41')+_0xa2b2('0x42')+_0x2d3b83['headers']['host']+_0xa2b2('0x43')+_0x1f03fb+'\x0a\x0a'+_0xa2b2('0x44')});})['then'](function(){_0x5454b1[_0xa2b2('0x2b')](0xc8)[_0xa2b2('0x2c')]({'message':_0xa2b2('0x45')});})[_0xa2b2('0x18')](function(_0x13bc7e){return handleError(_0x5454b1,0x1f4,_0x13bc7e);});};exports[_0xa2b2('0x46')]=function(_0x3f1623,_0x45dd0f,_0x339846){return db['User'][_0xa2b2('0x1a')]({'where':{'resetPasswordToken':_0x3f1623[_0xa2b2('0x47')][_0xa2b2('0x48')],'resetPasswordExpires':{'$gt':Date[_0xa2b2('0x3f')]()}}})[_0xa2b2('0x9')](function(_0x32d633){if(!_0x32d633){throw new Error(_0xa2b2('0x49'));}return db[_0xa2b2('0x38')][_0xa2b2('0x7')]({'attributes':['id',_0xa2b2('0x4a'),_0xa2b2('0x4b'),_0xa2b2('0x4c')]})[_0xa2b2('0x9')](function(_0x7c27bb){if(_0x7c27bb['securePassword'])authService[_0xa2b2('0x4d')](_0x3f1623[_0xa2b2('0x33')]['password']);if(!_0x7c27bb[_0xa2b2('0x4b')]||!_0x32d633[_0xa2b2('0x4e')])return _0x32d633;authService[_0xa2b2('0x4f')](_0x3f1623[_0xa2b2('0x33')][_0xa2b2('0x50')],_0x32d633[_0xa2b2('0x4e')],_0x7c27bb[_0xa2b2('0x4c')]);return _0x32d633;})[_0xa2b2('0x9')](function(){_0x32d633['password']=_0x3f1623[_0xa2b2('0x33')][_0xa2b2('0x50')];_0x32d633[_0xa2b2('0x3d')]=null;_0x32d633['resetPasswordExpires']=null;return _0x32d633[_0xa2b2('0x51')]();});})[_0xa2b2('0x9')](function(){_0x45dd0f[_0xa2b2('0x2b')](0xc8)[_0xa2b2('0x2c')]({'message':_0xa2b2('0x52')});})[_0xa2b2('0x18')](function(_0x15d785){return handleError(_0x45dd0f,0x1f4,_0x15d785);});};passport[_0xa2b2('0x53')](new LocalStrategy({'usernameField':_0xa2b2('0xa'),'passwordField':_0xa2b2('0x50')},function(_0x1c1431,_0xa971c0,_0x1746f5){return localAuthenticate(db[_0xa2b2('0x39')],_0x1c1431,_0xa971c0,_0x1746f5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e7bcaba..a93968a 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 _0x00e1=['forgot','Router','./authLocal.controller','post','login','/forgot'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00e1,0xeb));var _0x100e=function(_0x1618b8,_0x50b4c1){_0x1618b8=_0x1618b8-0x0;var _0x5b0cfc=_0x00e1[_0x1618b8];return _0x5b0cfc;};'use strict';var express=require('express');var router=express[_0x100e('0x0')]();var controller=require(_0x100e('0x1'));router[_0x100e('0x2')]('/',controller[_0x100e('0x3')]);router['post'](_0x100e('0x4'),controller[_0x100e('0x5')]);router[_0x100e('0x2')]('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file +var _0x8df7=['login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x8df7,0x1ac));var _0x78df=function(_0x3eb470,_0x59b847){_0x3eb470=_0x3eb470-0x0;var _0x419806=_0x8df7[_0x3eb470];return _0x419806;};'use strict';var express=require(_0x78df('0x0'));var router=express[_0x78df('0x1')]();var controller=require(_0x78df('0x2'));router[_0x78df('0x3')]('/',controller[_0x78df('0x4')]);router[_0x78df('0x3')]('/forgot',controller[_0x78df('0x5')]);router[_0x78df('0x3')](_0x78df('0x6'),controller[_0x78df('0x7')]);module[_0x78df('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 6194764..73dc88e 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 _0xcc54=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x5a418a,_0x21bb20){var _0x41a70e=function(_0x39eb2c){while(--_0x39eb2c){_0x5a418a['push'](_0x5a418a['shift']());}};_0x41a70e(++_0x21bb20);}(_0xcc54,0xe1));var _0x4cc5=function(_0x24b170,_0x35ef06){_0x24b170=_0x24b170-0x0;var _0x2bdf9f=_0xcc54[_0x24b170];return _0x2bdf9f;};'use strict';var Sequelize=require(_0x4cc5('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cc5('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4cc5('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4cc5('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4cc5('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xee6f=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4fcbbe,_0x55a068){var _0x2ac729=function(_0x44aa09){while(--_0x44aa09){_0x4fcbbe['push'](_0x4fcbbe['shift']());}};_0x2ac729(++_0x55a068);}(_0xee6f,0x7d));var _0xfee6=function(_0x1d6b91,_0x570374){_0x1d6b91=_0x1d6b91-0x0;var _0x225e92=_0xee6f[_0x1d6b91];return _0x225e92;};'use strict';var Sequelize=require(_0xfee6('0x0'));module[_0xfee6('0x1')]={'name':{'type':Sequelize[_0xfee6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfee6('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xfee6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 056ed16..eccea55 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 _0x9656=['name','send','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','Automation','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','addConditions','Condition','ids','getConditions','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','update','then','destroy','error'];(function(_0x3bf789,_0x52c120){var _0x880b25=function(_0x19844e){while(--_0x19844e){_0x3bf789['push'](_0x3bf789['shift']());}};_0x880b25(++_0x52c120);}(_0x9656,0x1d0));var _0x6965=function(_0xf61041,_0x40f594){_0xf61041=_0xf61041-0x0;var _0x5ece16=_0x9656[_0xf61041];return _0x5ece16;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require(_0x6965('0x1'));var zipdir=require(_0x6965('0x2'));var jsonpatch=require(_0x6965('0x3'));var rp=require(_0x6965('0x4'));var moment=require(_0x6965('0x5'));var BPromise=require(_0x6965('0x6'));var Mustache=require('mustache');var util=require(_0x6965('0x7'));var path=require('path');var sox=require(_0x6965('0x8'));var csv=require('to-csv');var ejs=require(_0x6965('0x9'));var fs=require('fs');var fs_extra=require(_0x6965('0xa'));var _=require(_0x6965('0xb'));var squel=require('squel');var crypto=require(_0x6965('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6965('0xd'));var toCsv=require(_0x6965('0xe'));var querystring=require(_0x6965('0xf'));var Papa=require(_0x6965('0x10'));var Redis=require(_0x6965('0x11'));var authService=require(_0x6965('0x12'));var qs=require(_0x6965('0x13'));var as=require(_0x6965('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6965('0x15'))(_0x6965('0x16'));var utils=require(_0x6965('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6965('0x18'));var db=require(_0x6965('0x19'))['db'];function respondWithStatusCode(_0x2e0109,_0x15169e){_0x15169e=_0x15169e||0xcc;return function(_0x4f8f48){if(_0x4f8f48){return _0x2e0109[_0x6965('0x1a')](_0x15169e);}return _0x2e0109[_0x6965('0x1b')](_0x15169e)['end']();};}function respondWithResult(_0x223318,_0x52f385){_0x52f385=_0x52f385||0xc8;return function(_0x534fee){if(_0x534fee){return _0x223318['status'](_0x52f385)[_0x6965('0x1c')](_0x534fee);}};}function respondWithFilteredResult(_0x2bfd97,_0x2ec07d){return function(_0x4b0342){if(_0x4b0342){var _0x3a14cf=typeof _0x2ec07d['offset']==='undefined'&&typeof _0x2ec07d[_0x6965('0x1d')]===_0x6965('0x1e');var _0x58aab6=_0x4b0342['count'];var _0x2c3ceb=_0x3a14cf?0x0:_0x2ec07d[_0x6965('0x1f')];var _0x2157a9=_0x3a14cf?_0x4b0342['count']:_0x2ec07d[_0x6965('0x1f')]+_0x2ec07d[_0x6965('0x1d')];var _0x1c4f77;if(_0x2157a9>=_0x58aab6){_0x2157a9=_0x58aab6;_0x1c4f77=0xc8;}else{_0x1c4f77=0xce;}_0x2bfd97[_0x6965('0x1b')](_0x1c4f77);return _0x2bfd97[_0x6965('0x20')](_0x6965('0x21'),_0x2c3ceb+'-'+_0x2157a9+'/'+_0x58aab6)[_0x6965('0x1c')](_0x4b0342);}return null;};}function patchUpdates(_0x2d9b10){return function(_0xdd7083){try{jsonpatch['apply'](_0xdd7083,_0x2d9b10,!![]);}catch(_0x10d7a1){return BPromise[_0x6965('0x22')](_0x10d7a1);}return _0xdd7083[_0x6965('0x23')]();};}function saveUpdates(_0x338c37,_0x569710){return function(_0x419c0e){if(_0x419c0e){return _0x419c0e[_0x6965('0x24')](_0x338c37)[_0x6965('0x25')](function(_0x356f1b){return _0x356f1b;});}return null;};}function removeEntity(_0x31a726,_0x3b9555){return function(_0x1d1afd){if(_0x1d1afd){return _0x1d1afd[_0x6965('0x26')]()[_0x6965('0x25')](function(){_0x31a726[_0x6965('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c253b,_0x21a8f2){return function(_0x298346){if(!_0x298346){_0x4c253b[_0x6965('0x1a')](0x194);}return _0x298346;};}function handleError(_0x1c46a4,_0x402c5e){_0x402c5e=_0x402c5e||0x1f4;return function(_0x19ea80){logger[_0x6965('0x27')](_0x19ea80['stack']);if(_0x19ea80['name']){delete _0x19ea80[_0x6965('0x28')];}_0x1c46a4[_0x6965('0x1b')](_0x402c5e)[_0x6965('0x29')](_0x19ea80);};}exports['index']=function(_0x3e4378,_0x267d60){var _0x57c4ce={},_0x4882cb={},_0x2620e1={'count':0x0,'rows':[]};var _0x2d5bcb=_[_0x6965('0x2a')](db['Automation']['rawAttributes'],function(_0x59b7f7){return{'name':_0x59b7f7[_0x6965('0x2b')],'type':_0x59b7f7[_0x6965('0x2c')][_0x6965('0x2d')]};});_0x4882cb['model']=_[_0x6965('0x2a')](_0x2d5bcb,_0x6965('0x28'));_0x4882cb[_0x6965('0x2e')]=_['keys'](_0x3e4378[_0x6965('0x2e')]);_0x4882cb[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],_0x4882cb[_0x6965('0x2e')]);_0x57c4ce[_0x6965('0x32')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],qs[_0x6965('0x33')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x33')]));_0x57c4ce['attributes']=_0x57c4ce[_0x6965('0x32')][_0x6965('0x34')]?_0x57c4ce[_0x6965('0x32')]:_0x4882cb['model'];if(!_0x3e4378['query'][_0x6965('0x35')](_0x6965('0x36'))){_0x57c4ce[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x1d')]);_0x57c4ce[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x3e4378[_0x6965('0x2e')]['offset']);}_0x57c4ce[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x38')]);_0x57c4ce[_0x6965('0x39')]=qs['filters'](_[_0x6965('0x3a')](_0x3e4378[_0x6965('0x2e')],_0x4882cb[_0x6965('0x2f')]),_0x2d5bcb);if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]){_0x57c4ce[_0x6965('0x39')]=_['merge'](_0x57c4ce['where'],{'$or':_['map'](_0x2d5bcb,function(_0x10abbc){if(_0x10abbc[_0x6965('0x2c')]!=='VIRTUAL'){var _0x4f4bab={};_0x4f4bab[_0x10abbc['name']]={'$like':'%'+_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x4f4bab;}})});}_0x57c4ce=_[_0x6965('0x3c')]({},_0x57c4ce,_0x3e4378[_0x6965('0x3d')]);var _0x235e94={'where':_0x57c4ce['where']};return db['Automation'][_0x6965('0x3e')](_0x235e94)['then'](function(_0x6ff23f){_0x2620e1[_0x6965('0x3e')]=_0x6ff23f;if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3f')]){_0x57c4ce[_0x6965('0x40')]=[{'all':!![]}];}return db[_0x6965('0x41')][_0x6965('0x42')](_0x57c4ce);})['then'](function(_0x448751){_0x2620e1[_0x6965('0x43')]=_0x448751;return _0x2620e1;})[_0x6965('0x25')](respondWithFilteredResult(_0x267d60,_0x57c4ce))[_0x6965('0x44')](handleError(_0x267d60,null));};exports[_0x6965('0x45')]=function(_0x9810f4,_0x24e8d2){var _0x279934={'raw':![],'where':{'id':_0x9810f4[_0x6965('0x46')]['id']}},_0x250353={};_0x250353['model']=_[_0x6965('0x47')](db[_0x6965('0x41')][_0x6965('0x48')]);_0x250353[_0x6965('0x2e')]=_[_0x6965('0x47')](_0x9810f4[_0x6965('0x2e')]);_0x250353[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],_0x250353[_0x6965('0x2e')]);_0x279934['attributes']=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],qs['fields'](_0x9810f4['query'][_0x6965('0x33')]));_0x279934[_0x6965('0x32')]=_0x279934[_0x6965('0x32')][_0x6965('0x34')]?_0x279934['attributes']:_0x250353[_0x6965('0x31')];if(_0x9810f4[_0x6965('0x2e')]['includeAll']){_0x279934[_0x6965('0x40')]=[{'all':!![]}];}_0x279934=_[_0x6965('0x3c')]({},_0x279934,_0x9810f4[_0x6965('0x3d')]);return db[_0x6965('0x41')][_0x6965('0x49')](_0x279934)[_0x6965('0x25')](handleEntityNotFound(_0x24e8d2,null))[_0x6965('0x25')](respondWithResult(_0x24e8d2,null))[_0x6965('0x44')](handleError(_0x24e8d2,null));};exports['create']=function(_0x26fc68,_0x3fd941){return db['Automation'][_0x6965('0x4a')](_0x26fc68[_0x6965('0x4b')],{})[_0x6965('0x25')](respondWithResult(_0x3fd941,0xc9))['catch'](handleError(_0x3fd941,null));};exports[_0x6965('0x24')]=function(_0x6935d1,_0x57b382){if(_0x6935d1[_0x6965('0x4b')]['id']){delete _0x6935d1[_0x6965('0x4b')]['id'];}return db['Automation']['find']({'where':{'id':_0x6935d1[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x57b382,null))['then'](saveUpdates(_0x6935d1[_0x6965('0x4b')],null))[_0x6965('0x25')](respondWithResult(_0x57b382,null))[_0x6965('0x44')](handleError(_0x57b382,null));};exports[_0x6965('0x26')]=function(_0x5032d7,_0x13a433){return db[_0x6965('0x41')][_0x6965('0x49')]({'where':{'id':_0x5032d7[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x13a433,null))[_0x6965('0x25')](removeEntity(_0x13a433,null))['catch'](handleError(_0x13a433,null));};exports[_0x6965('0x4c')]=function(_0x166602,_0x22fc11,_0x37a265){return db[_0x6965('0x4d')]['find']({'where':{'id':_0x166602[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x22fc11,null))['then'](function(_0x419072){if(_0x419072){return _0x419072['addConditions'](_0x166602[_0x6965('0x4b')]['ids'],_['omit'](_0x166602[_0x6965('0x4b')],[_0x6965('0x4e'),'id'])||{});}})[_0x6965('0x25')](respondWithResult(_0x22fc11,null))[_0x6965('0x44')](handleError(_0x22fc11,null));};exports['getConditions']=function(_0x14e4a6,_0x99c157,_0x1bafa0){var _0x293b0b={};var _0x55d865={};var _0x472a92;var _0x905251;return db[_0x6965('0x41')]['findOne']({'where':{'id':_0x14e4a6[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x99c157,null))[_0x6965('0x25')](function(_0x19e797){if(_0x19e797){_0x472a92=_0x19e797;_0x55d865[_0x6965('0x31')]=_[_0x6965('0x47')](db[_0x6965('0x4d')][_0x6965('0x48')]);_0x55d865['query']=_['keys'](_0x14e4a6[_0x6965('0x2e')]);_0x55d865[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x55d865[_0x6965('0x31')],_0x55d865[_0x6965('0x2e')]);_0x293b0b['attributes']=_['intersection'](_0x55d865['model'],qs[_0x6965('0x33')](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x33')]));_0x293b0b[_0x6965('0x32')]=_0x293b0b['attributes']['length']?_0x293b0b[_0x6965('0x32')]:_0x55d865[_0x6965('0x31')];_0x293b0b['order']=qs[_0x6965('0x38')](_0x14e4a6['query'][_0x6965('0x38')]);_0x293b0b['where']=qs[_0x6965('0x2f')](_['pick'](_0x14e4a6[_0x6965('0x2e')],_0x55d865[_0x6965('0x2f')]));if(_0x14e4a6[_0x6965('0x2e')][_0x6965('0x3b')]){_0x293b0b['where']=_[_0x6965('0x3c')](_0x293b0b[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x293b0b[_0x6965('0x32')],function(_0x127bae){var _0x6ecab8={};_0x6ecab8[_0x127bae]={'$like':'%'+_0x14e4a6[_0x6965('0x2e')]['filter']+'%'};return _0x6ecab8;})});}_0x293b0b=_[_0x6965('0x3c')]({},_0x293b0b,_0x14e4a6['options']);return _0x472a92['getConditions'](_0x293b0b);}})[_0x6965('0x25')](function(_0xe63f63){if(_0xe63f63){_0x905251=_0xe63f63[_0x6965('0x34')];if(!_0x14e4a6[_0x6965('0x2e')]['hasOwnProperty']('nolimit')){_0x293b0b[_0x6965('0x1d')]=qs['limit'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1d')]);_0x293b0b[_0x6965('0x1f')]=qs['offset'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1f')]);}return _0x472a92[_0x6965('0x4f')](_0x293b0b);}})[_0x6965('0x25')](function(_0x2198e2){if(_0x2198e2){return _0x2198e2?{'count':_0x905251,'rows':_0x2198e2}:null;}})['then'](respondWithResult(_0x99c157,null))[_0x6965('0x44')](handleError(_0x99c157,null));};exports['addActions']=function(_0x2ab3be,_0x28de18,_0x4f03be){return db[_0x6965('0x50')]['find']({'where':{'id':_0x2ab3be['params']['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x28de18,null))[_0x6965('0x25')](function(_0x167733){if(_0x167733){return _0x167733[_0x6965('0x51')](_0x2ab3be[_0x6965('0x4b')][_0x6965('0x4e')],_['omit'](_0x2ab3be[_0x6965('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x28de18,null))[_0x6965('0x44')](handleError(_0x28de18,null));};exports[_0x6965('0x52')]=function(_0x2100c9,_0x536fe8,_0x3dd64c){var _0x422f91={};var _0x27722c={};var _0x4f720e;var _0x10075a;return db['Automation'][_0x6965('0x53')]({'where':{'id':_0x2100c9[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x536fe8,null))['then'](function(_0x5a88ff){if(_0x5a88ff){_0x4f720e=_0x5a88ff;_0x27722c[_0x6965('0x31')]=_[_0x6965('0x47')](db['Action']['rawAttributes']);_0x27722c['query']=_[_0x6965('0x47')](_0x2100c9['query']);_0x27722c[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],_0x27722c['query']);_0x422f91[_0x6965('0x32')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],qs[_0x6965('0x33')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x33')]));_0x422f91[_0x6965('0x32')]=_0x422f91[_0x6965('0x32')][_0x6965('0x34')]?_0x422f91[_0x6965('0x32')]:_0x27722c[_0x6965('0x31')];_0x422f91[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x38')]);_0x422f91[_0x6965('0x39')]=qs[_0x6965('0x2f')](_[_0x6965('0x3a')](_0x2100c9[_0x6965('0x2e')],_0x27722c['filters']));if(_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]){_0x422f91['where']=_[_0x6965('0x3c')](_0x422f91[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x422f91[_0x6965('0x32')],function(_0x49b8db){var _0x43bd8f={};_0x43bd8f[_0x49b8db]={'$like':'%'+_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x43bd8f;})});}_0x422f91=_['merge']({},_0x422f91,_0x2100c9[_0x6965('0x3d')]);return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x5a2de7){if(_0x5a2de7){_0x10075a=_0x5a2de7['length'];if(!_0x2100c9[_0x6965('0x2e')][_0x6965('0x35')](_0x6965('0x36'))){_0x422f91[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x2100c9[_0x6965('0x2e')]['limit']);_0x422f91[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x2100c9['query'][_0x6965('0x1f')]);}return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x30246f){if(_0x30246f){return _0x30246f?{'count':_0x10075a,'rows':_0x30246f}:null;}})[_0x6965('0x25')](respondWithResult(_0x536fe8,null))['catch'](handleError(_0x536fe8,null));}; \ No newline at end of file +var _0x9919=['attributes','fields','model','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','filter','hasOwnProperty','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Automation','rawAttributes','type','key','query','keys','filters','intersection'];(function(_0xfdfedb,_0x488984){var _0x4c8bf5=function(_0x4b68f4){while(--_0x4b68f4){_0xfdfedb['push'](_0xfdfedb['shift']());}};_0x4c8bf5(++_0x488984);}(_0x9919,0xc3));var _0x9991=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x9919[_0x47adb8];return _0x4689a8;};'use strict';var emlformat=require(_0x9991('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9991('0x1'));var jsonpatch=require(_0x9991('0x2'));var rp=require(_0x9991('0x3'));var moment=require('moment');var BPromise=require(_0x9991('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9991('0x5'));var sox=require(_0x9991('0x6'));var csv=require(_0x9991('0x7'));var ejs=require(_0x9991('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9991('0x9'));var squel=require(_0x9991('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9991('0xb'));var toCsv=require(_0x9991('0x7'));var querystring=require(_0x9991('0xc'));var Papa=require('papaparse');var Redis=require(_0x9991('0xd'));var authService=require(_0x9991('0xe'));var qs=require(_0x9991('0xf'));var as=require(_0x9991('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9991('0x11'));var utils=require(_0x9991('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9991('0x13'));var db=require(_0x9991('0x14'))['db'];function respondWithStatusCode(_0x579baa,_0x17338f){_0x17338f=_0x17338f||0xcc;return function(_0x2ede08){if(_0x2ede08){return _0x579baa['sendStatus'](_0x17338f);}return _0x579baa[_0x9991('0x15')](_0x17338f)[_0x9991('0x16')]();};}function respondWithResult(_0x1ef294,_0x2a4009){_0x2a4009=_0x2a4009||0xc8;return function(_0x2bef6c){if(_0x2bef6c){return _0x1ef294['status'](_0x2a4009)[_0x9991('0x17')](_0x2bef6c);}};}function respondWithFilteredResult(_0x4cae1a,_0x32eec7){return function(_0x253b3a){if(_0x253b3a){var _0x57a8e8=typeof _0x32eec7[_0x9991('0x18')]===_0x9991('0x19')&&typeof _0x32eec7[_0x9991('0x1a')]==='undefined';var _0x41e79e=_0x253b3a[_0x9991('0x1b')];var _0x403c89=_0x57a8e8?0x0:_0x32eec7[_0x9991('0x18')];var _0x2e84d9=_0x57a8e8?_0x253b3a[_0x9991('0x1b')]:_0x32eec7[_0x9991('0x18')]+_0x32eec7[_0x9991('0x1a')];var _0x46ff66;if(_0x2e84d9>=_0x41e79e){_0x2e84d9=_0x41e79e;_0x46ff66=0xc8;}else{_0x46ff66=0xce;}_0x4cae1a[_0x9991('0x15')](_0x46ff66);return _0x4cae1a[_0x9991('0x1c')]('Content-Range',_0x403c89+'-'+_0x2e84d9+'/'+_0x41e79e)[_0x9991('0x17')](_0x253b3a);}return null;};}function patchUpdates(_0x3f069d){return function(_0x14b742){try{jsonpatch['apply'](_0x14b742,_0x3f069d,!![]);}catch(_0x5e0939){return BPromise[_0x9991('0x1d')](_0x5e0939);}return _0x14b742[_0x9991('0x1e')]();};}function saveUpdates(_0x45b816,_0x2040e0){return function(_0x5aad31){if(_0x5aad31){return _0x5aad31[_0x9991('0x1f')](_0x45b816)[_0x9991('0x20')](function(_0x4b9d92){return _0x4b9d92;});}return null;};}function removeEntity(_0x2fb6a0,_0x2c813d){return function(_0xe8d5df){if(_0xe8d5df){return _0xe8d5df[_0x9991('0x21')]()['then'](function(){_0x2fb6a0[_0x9991('0x15')](0xcc)[_0x9991('0x16')]();});}};}function handleEntityNotFound(_0x4d5532,_0x235b1d){return function(_0x2626eb){if(!_0x2626eb){_0x4d5532[_0x9991('0x22')](0x194);}return _0x2626eb;};}function handleError(_0x350cbf,_0x18bd83){_0x18bd83=_0x18bd83||0x1f4;return function(_0x17afd3){logger['error'](_0x17afd3[_0x9991('0x23')]);if(_0x17afd3[_0x9991('0x24')]){delete _0x17afd3[_0x9991('0x24')];}_0x350cbf[_0x9991('0x15')](_0x18bd83)[_0x9991('0x25')](_0x17afd3);};}exports[_0x9991('0x26')]=function(_0x15f6c3,_0xdd8043){var _0x49acc0={},_0x136509={},_0x58680d={'count':0x0,'rows':[]};var _0x15d74b=_[_0x9991('0x27')](db[_0x9991('0x28')][_0x9991('0x29')],function(_0x1a20e5){return{'name':_0x1a20e5['fieldName'],'type':_0x1a20e5[_0x9991('0x2a')][_0x9991('0x2b')]};});_0x136509['model']=_[_0x9991('0x27')](_0x15d74b,_0x9991('0x24'));_0x136509[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x15f6c3[_0x9991('0x2c')]);_0x136509[_0x9991('0x2e')]=_[_0x9991('0x2f')](_0x136509['model'],_0x136509[_0x9991('0x2c')]);_0x49acc0[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x136509['model'],qs[_0x9991('0x31')](_0x15f6c3[_0x9991('0x2c')]['fields']));_0x49acc0[_0x9991('0x30')]=_0x49acc0['attributes']['length']?_0x49acc0[_0x9991('0x30')]:_0x136509[_0x9991('0x32')];if(!_0x15f6c3[_0x9991('0x2c')]['hasOwnProperty'](_0x9991('0x33'))){_0x49acc0[_0x9991('0x1a')]=qs['limit'](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x1a')]);_0x49acc0[_0x9991('0x18')]=qs[_0x9991('0x18')](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x18')]);}_0x49acc0[_0x9991('0x34')]=qs['sort'](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x35')]);_0x49acc0[_0x9991('0x36')]=qs['filters'](_[_0x9991('0x37')](_0x15f6c3[_0x9991('0x2c')],_0x136509['filters']),_0x15d74b);if(_0x15f6c3[_0x9991('0x2c')]['filter']){_0x49acc0[_0x9991('0x36')]=_[_0x9991('0x38')](_0x49acc0[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x15d74b,function(_0x456024){if(_0x456024[_0x9991('0x2a')]!==_0x9991('0x39')){var _0x4d4bd6={};_0x4d4bd6[_0x456024[_0x9991('0x24')]]={'$like':'%'+_0x15f6c3[_0x9991('0x2c')]['filter']+'%'};return _0x4d4bd6;}})});}_0x49acc0=_[_0x9991('0x38')]({},_0x49acc0,_0x15f6c3[_0x9991('0x3a')]);var _0x1f89c1={'where':_0x49acc0[_0x9991('0x36')]};return db['Automation'][_0x9991('0x1b')](_0x1f89c1)['then'](function(_0x5c6e12){_0x58680d[_0x9991('0x1b')]=_0x5c6e12;if(_0x15f6c3[_0x9991('0x2c')]['includeAll']){_0x49acc0[_0x9991('0x3b')]=[{'all':!![]}];}return db[_0x9991('0x28')][_0x9991('0x3c')](_0x49acc0);})[_0x9991('0x20')](function(_0x5bb308){_0x58680d[_0x9991('0x3d')]=_0x5bb308;return _0x58680d;})[_0x9991('0x20')](respondWithFilteredResult(_0xdd8043,_0x49acc0))[_0x9991('0x3e')](handleError(_0xdd8043,null));};exports[_0x9991('0x3f')]=function(_0x241e5e,_0x4f7fae){var _0x4e42a3={'raw':![],'where':{'id':_0x241e5e[_0x9991('0x40')]['id']}},_0x4fe87c={};_0x4fe87c[_0x9991('0x32')]=_[_0x9991('0x2d')](db[_0x9991('0x28')][_0x9991('0x29')]);_0x4fe87c['query']=_['keys'](_0x241e5e[_0x9991('0x2c')]);_0x4fe87c[_0x9991('0x2e')]=_['intersection'](_0x4fe87c[_0x9991('0x32')],_0x4fe87c[_0x9991('0x2c')]);_0x4e42a3[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x4fe87c['model'],qs[_0x9991('0x31')](_0x241e5e[_0x9991('0x2c')][_0x9991('0x31')]));_0x4e42a3[_0x9991('0x30')]=_0x4e42a3['attributes'][_0x9991('0x41')]?_0x4e42a3['attributes']:_0x4fe87c[_0x9991('0x32')];if(_0x241e5e[_0x9991('0x2c')][_0x9991('0x42')]){_0x4e42a3[_0x9991('0x3b')]=[{'all':!![]}];}_0x4e42a3=_[_0x9991('0x38')]({},_0x4e42a3,_0x241e5e[_0x9991('0x3a')]);return db['Automation'][_0x9991('0x43')](_0x4e42a3)['then'](handleEntityNotFound(_0x4f7fae,null))[_0x9991('0x20')](respondWithResult(_0x4f7fae,null))[_0x9991('0x3e')](handleError(_0x4f7fae,null));};exports['create']=function(_0x2da284,_0x27e66c){return db[_0x9991('0x28')][_0x9991('0x44')](_0x2da284[_0x9991('0x45')],{})[_0x9991('0x20')](respondWithResult(_0x27e66c,0xc9))['catch'](handleError(_0x27e66c,null));};exports[_0x9991('0x1f')]=function(_0x128740,_0x4d6a57){if(_0x128740['body']['id']){delete _0x128740[_0x9991('0x45')]['id'];}return db[_0x9991('0x28')][_0x9991('0x43')]({'where':{'id':_0x128740['params']['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x4d6a57,null))[_0x9991('0x20')](saveUpdates(_0x128740[_0x9991('0x45')],null))[_0x9991('0x20')](respondWithResult(_0x4d6a57,null))[_0x9991('0x3e')](handleError(_0x4d6a57,null));};exports[_0x9991('0x21')]=function(_0x33a11b,_0x390640){return db['Automation']['find']({'where':{'id':_0x33a11b[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x390640,null))[_0x9991('0x20')](removeEntity(_0x390640,null))['catch'](handleError(_0x390640,null));};exports[_0x9991('0x46')]=function(_0x1e9a48,_0x373b42,_0x1f79f3){return db['Condition'][_0x9991('0x43')]({'where':{'id':_0x1e9a48['params']['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x373b42,null))[_0x9991('0x20')](function(_0x5d47b1){if(_0x5d47b1){return _0x5d47b1[_0x9991('0x46')](_0x1e9a48[_0x9991('0x45')][_0x9991('0x47')],_[_0x9991('0x48')](_0x1e9a48[_0x9991('0x45')],['ids','id'])||{});}})[_0x9991('0x20')](respondWithResult(_0x373b42,null))[_0x9991('0x3e')](handleError(_0x373b42,null));};exports[_0x9991('0x49')]=function(_0x5a7aa6,_0x1e1b7a,_0xbe997){var _0x14b35a={};var _0x5e1680={};var _0x5375a8;var _0x42e19f;return db[_0x9991('0x28')][_0x9991('0x4a')]({'where':{'id':_0x5a7aa6[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x1e1b7a,null))[_0x9991('0x20')](function(_0x43ec64){if(_0x43ec64){_0x5375a8=_0x43ec64;_0x5e1680[_0x9991('0x32')]=_['keys'](db[_0x9991('0x4b')][_0x9991('0x29')]);_0x5e1680[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x5a7aa6[_0x9991('0x2c')]);_0x5e1680['filters']=_[_0x9991('0x2f')](_0x5e1680[_0x9991('0x32')],_0x5e1680[_0x9991('0x2c')]);_0x14b35a[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x5e1680[_0x9991('0x32')],qs[_0x9991('0x31')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x31')]));_0x14b35a['attributes']=_0x14b35a['attributes'][_0x9991('0x41')]?_0x14b35a[_0x9991('0x30')]:_0x5e1680['model'];_0x14b35a[_0x9991('0x34')]=qs[_0x9991('0x35')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x35')]);_0x14b35a[_0x9991('0x36')]=qs[_0x9991('0x2e')](_[_0x9991('0x37')](_0x5a7aa6['query'],_0x5e1680[_0x9991('0x2e')]));if(_0x5a7aa6[_0x9991('0x2c')]['filter']){_0x14b35a[_0x9991('0x36')]=_['merge'](_0x14b35a[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x14b35a[_0x9991('0x30')],function(_0x566748){var _0x537aef={};_0x537aef[_0x566748]={'$like':'%'+_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x4c')]+'%'};return _0x537aef;})});}_0x14b35a=_['merge']({},_0x14b35a,_0x5a7aa6['options']);return _0x5375a8[_0x9991('0x49')](_0x14b35a);}})[_0x9991('0x20')](function(_0x13e73c){if(_0x13e73c){_0x42e19f=_0x13e73c[_0x9991('0x41')];if(!_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x4d')]('nolimit')){_0x14b35a[_0x9991('0x1a')]=qs[_0x9991('0x1a')](_0x5a7aa6[_0x9991('0x2c')]['limit']);_0x14b35a[_0x9991('0x18')]=qs[_0x9991('0x18')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x18')]);}return _0x5375a8[_0x9991('0x49')](_0x14b35a);}})[_0x9991('0x20')](function(_0x415734){if(_0x415734){return _0x415734?{'count':_0x42e19f,'rows':_0x415734}:null;}})[_0x9991('0x20')](respondWithResult(_0x1e1b7a,null))[_0x9991('0x3e')](handleError(_0x1e1b7a,null));};exports[_0x9991('0x4e')]=function(_0x2d4b38,_0x1fd691,_0x1092ce){return db[_0x9991('0x4f')][_0x9991('0x43')]({'where':{'id':_0x2d4b38[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x1fd691,null))[_0x9991('0x20')](function(_0x30c75e){if(_0x30c75e){return _0x30c75e[_0x9991('0x4e')](_0x2d4b38[_0x9991('0x45')][_0x9991('0x47')],_[_0x9991('0x48')](_0x2d4b38[_0x9991('0x45')],[_0x9991('0x47'),'id'])||{});}})[_0x9991('0x20')](respondWithResult(_0x1fd691,null))[_0x9991('0x3e')](handleError(_0x1fd691,null));};exports[_0x9991('0x50')]=function(_0x474fe8,_0x13a01d,_0x2c586a){var _0x541eae={};var _0x1ae2ca={};var _0x1ebaa7;var _0x1b9f65;return db[_0x9991('0x28')][_0x9991('0x4a')]({'where':{'id':_0x474fe8[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x13a01d,null))[_0x9991('0x20')](function(_0x3972e6){if(_0x3972e6){_0x1ebaa7=_0x3972e6;_0x1ae2ca['model']=_[_0x9991('0x2d')](db['Action']['rawAttributes']);_0x1ae2ca[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x474fe8['query']);_0x1ae2ca[_0x9991('0x2e')]=_[_0x9991('0x2f')](_0x1ae2ca[_0x9991('0x32')],_0x1ae2ca[_0x9991('0x2c')]);_0x541eae[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x1ae2ca[_0x9991('0x32')],qs[_0x9991('0x31')](_0x474fe8[_0x9991('0x2c')][_0x9991('0x31')]));_0x541eae[_0x9991('0x30')]=_0x541eae[_0x9991('0x30')]['length']?_0x541eae[_0x9991('0x30')]:_0x1ae2ca[_0x9991('0x32')];_0x541eae[_0x9991('0x34')]=qs[_0x9991('0x35')](_0x474fe8[_0x9991('0x2c')][_0x9991('0x35')]);_0x541eae[_0x9991('0x36')]=qs[_0x9991('0x2e')](_['pick'](_0x474fe8[_0x9991('0x2c')],_0x1ae2ca[_0x9991('0x2e')]));if(_0x474fe8[_0x9991('0x2c')][_0x9991('0x4c')]){_0x541eae[_0x9991('0x36')]=_[_0x9991('0x38')](_0x541eae[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x541eae[_0x9991('0x30')],function(_0x51f4e1){var _0x14957e={};_0x14957e[_0x51f4e1]={'$like':'%'+_0x474fe8[_0x9991('0x2c')][_0x9991('0x4c')]+'%'};return _0x14957e;})});}_0x541eae=_[_0x9991('0x38')]({},_0x541eae,_0x474fe8[_0x9991('0x3a')]);return _0x1ebaa7['getActions'](_0x541eae);}})['then'](function(_0x212858){if(_0x212858){_0x1b9f65=_0x212858[_0x9991('0x41')];if(!_0x474fe8['query'][_0x9991('0x4d')](_0x9991('0x33'))){_0x541eae[_0x9991('0x1a')]=qs[_0x9991('0x1a')](_0x474fe8['query'][_0x9991('0x1a')]);_0x541eae[_0x9991('0x18')]=qs['offset'](_0x474fe8[_0x9991('0x2c')]['offset']);}return _0x1ebaa7[_0x9991('0x50')](_0x541eae);}})[_0x9991('0x20')](function(_0x22b5d2){if(_0x22b5d2){return _0x22b5d2?{'count':_0x1b9f65,'rows':_0x22b5d2}:null;}})[_0x9991('0x20')](respondWithResult(_0x13a01d,null))[_0x9991('0x3e')](handleError(_0x13a01d,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 12968a7..ff6aaf7 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 _0xb2b1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb2b1,0xcf));var _0x1b2b=function(_0x24ee4d,_0x346b64){_0x24ee4d=_0x24ee4d-0x0;var _0x305b6d=_0xb2b1[_0x24ee4d];return _0x305b6d;};'use strict';var _=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var logger=require(_0x1b2b('0x2'))(_0x1b2b('0x3'));var moment=require(_0x1b2b('0x4'));var BPromise=require(_0x1b2b('0x5'));var rp=require(_0x1b2b('0x6'));var fs=require('fs');var path=require(_0x1b2b('0x7'));var rimraf=require(_0x1b2b('0x8'));var config=require(_0x1b2b('0x9'));var attributes=require(_0x1b2b('0xa'));module[_0x1b2b('0xb')]=function(_0x4d3467,_0x18e7b4){return _0x4d3467[_0x1b2b('0xc')](_0x1b2b('0xd'),attributes,{'tableName':_0x1b2b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc84=['tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc84,0x1c8));var _0x4dc8=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xdc84[_0x31c19c];return _0x1a87f7;};'use strict';var _=require(_0x4dc8('0x0'));var util=require(_0x4dc8('0x1'));var logger=require('../../config/logger')(_0x4dc8('0x2'));var moment=require(_0x4dc8('0x3'));var BPromise=require(_0x4dc8('0x4'));var rp=require(_0x4dc8('0x5'));var fs=require('fs');var path=require(_0x4dc8('0x6'));var rimraf=require(_0x4dc8('0x7'));var config=require(_0x4dc8('0x8'));var attributes=require(_0x4dc8('0x9'));module['exports']=function(_0x3fe0d1,_0x1277b3){return _0x3fe0d1[_0x4dc8('0xa')](_0x4dc8('0xb'),attributes,{'tableName':_0x4dc8('0xc'),'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 92b2776..8c039da 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 _0x5236=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b9d76,_0x1051ec){var _0x404112=function(_0xe695cd){while(--_0xe695cd){_0x2b9d76['push'](_0x2b9d76['shift']());}};_0x404112(++_0x1051ec);}(_0x5236,0x109));var _0x6523=function(_0x2e177f,_0x277cd4){_0x2e177f=_0x2e177f-0x0;var _0x148734=_0x5236[_0x2e177f];return _0x148734;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});} \ No newline at end of file +var _0xd26f=['request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a9350,_0x47d4ba){var _0x4a2f4b=function(_0x31c883){while(--_0x31c883){_0x2a9350['push'](_0x2a9350['shift']());}};_0x4a2f4b(++_0x47d4ba);}(_0xd26f,0x113));var _0xfd26=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xd26f[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6711d7b..fa28eba 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 _0x524a=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','/:id','update'];(function(_0x365309,_0x31275a){var _0x197b05=function(_0x1666fc){while(--_0x1666fc){_0x365309['push'](_0x365309['shift']());}};_0x197b05(++_0x31275a);}(_0x524a,0xf5));var _0xa524=function(_0x267ea4,_0x4e191e){_0x267ea4=_0x267ea4-0x0;var _0x113e83=_0x524a[_0x267ea4];return _0x113e83;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['get'](_0xa524('0xb'),auth[_0xa524('0x9')](),controller[_0xa524('0xc')]);router[_0xa524('0x8')](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0xe')]);router[_0xa524('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa524('0xf')](_0xa524('0xb'),auth[_0xa524('0x9')](),controller['addConditions']);router['post'](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0x10')]);router['put'](_0xa524('0x11'),auth['isAuthenticated'](),controller[_0xa524('0x12')]);router[_0xa524('0x13')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x14')]);module[_0xa524('0x15')]=router; \ No newline at end of file +var _0xe638=['post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions'];(function(_0x19c5f2,_0x44ed13){var _0xb94caf=function(_0x1b3522){while(--_0x1b3522){_0x19c5f2['push'](_0x19c5f2['shift']());}};_0xb94caf(++_0x44ed13);}(_0xe638,0x92));var _0x8e63=function(_0x363104,_0x3c060d){_0x363104=_0x363104-0x0;var _0x316c35=_0xe638[_0x363104];return _0x316c35;};'use strict';var multer=require(_0x8e63('0x0'));var util=require(_0x8e63('0x1'));var path=require(_0x8e63('0x2'));var timeout=require(_0x8e63('0x3'));var express=require('express');var router=express[_0x8e63('0x4')]();var fs_extra=require(_0x8e63('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e63('0x6'));var controller=require('./automation.controller');router[_0x8e63('0x7')]('/',auth[_0x8e63('0x8')](),controller[_0x8e63('0x9')]);router['get'](_0x8e63('0xa'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xb')]);router[_0x8e63('0x7')]('/:id/conditions',auth[_0x8e63('0x8')](),controller[_0x8e63('0xc')]);router[_0x8e63('0x7')](_0x8e63('0xd'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xe')]);router[_0x8e63('0xf')]('/',auth[_0x8e63('0x8')](),controller['create']);router[_0x8e63('0xf')](_0x8e63('0x10'),auth[_0x8e63('0x8')](),controller[_0x8e63('0x11')]);router[_0x8e63('0xf')](_0x8e63('0xd'),auth['isAuthenticated'](),controller[_0x8e63('0x12')]);router[_0x8e63('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8e63('0x14')]);router[_0x8e63('0x15')](_0x8e63('0xa'),auth['isAuthenticated'](),controller[_0x8e63('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index a5316ea..828b70d 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 _0x071f=['Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','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\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\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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)','STRING','ENUM','ivr','BOOLEAN'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0x071f,0xab));var _0xf071=function(_0x98432f,_0x277eee){_0x98432f=_0x98432f-0x0;var _0x2f1051=_0x071f[_0x98432f];return _0x2f1051;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf071('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf071('0x0')]},'active':{'type':Sequelize[_0xf071('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf071('0x4')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf071('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf071('0xc')},'dialTimezone':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf071('0x0')],'defaultValue':_0xf071('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xf071('0x1')](_0xf071('0xe'),_0xf071('0xf'),_0xf071('0x10')),'defaultValue':_0xf071('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf071('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf071('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf071('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf071('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf071('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf071('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x18'),_0xf071('0x19')),'defaultValue':_0xf071('0x18')},'dialPrefix':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1e')},'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['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x22')}}; \ No newline at end of file +var _0x778e=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x47152a,_0x5862c6){var _0x3d5cce=function(_0x391e57){while(--_0x391e57){_0x47152a['push'](_0x47152a['shift']());}};_0x3d5cce(++_0x5862c6);}(_0x778e,0xf4));var _0xe778=function(_0xcb6455,_0x139842){_0xcb6455=_0xcb6455-0x0;var _0x435cb2=_0x778e[_0xcb6455];return _0x435cb2;};'use strict';var Sequelize=require(_0xe778('0x0'));module['exports']={'name':{'type':Sequelize[_0xe778('0x1')],'unique':_0xe778('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe778('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe778('0x5')},'limitCalls':{'type':Sequelize[_0xe778('0x6')](0x4)[_0xe778('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe778('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe778('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe778('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'comment':_0xe778('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe778('0x10')},'dialTimezone':{'type':Sequelize[_0xe778('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe778('0x1')],'defaultValue':_0xe778('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x12'),_0xe778('0x13'),'onlyIfOpen'),'defaultValue':_0xe778('0x12')},'dialAMDActive':{'type':Sequelize[_0xe778('0x14')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe778('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe778('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe778('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe778('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe778('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe778('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe778('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe778('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe778('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x1c'),_0xe778('0x1d')),'defaultValue':_0xe778('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe778('0x1e')},'dialCutDigit':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 220a306..c175f5c 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 _0xe8ea=['cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','cm_hopper','onlyIfOpen','fromQuery','phone\x20NOT\x20IN\x20(?)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','findOne','pick','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','field','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)'];(function(_0x14fac6,_0x5d0726){var _0x137203=function(_0x389ccd){while(--_0x389ccd){_0x14fac6['push'](_0x14fac6['shift']());}};_0x137203(++_0x5d0726);}(_0xe8ea,0x1aa));var _0xae8e=function(_0x127b5e,_0x4ee9d2){_0x127b5e=_0x127b5e-0x0;var _0x22a0be=_0xe8ea[_0x127b5e];return _0x22a0be;};'use strict';var emlformat=require(_0xae8e('0x0'));var rimraf=require(_0xae8e('0x1'));var zipdir=require(_0xae8e('0x2'));var jsonpatch=require(_0xae8e('0x3'));var rp=require('request-promise');var moment=require(_0xae8e('0x4'));var BPromise=require(_0xae8e('0x5'));var Mustache=require(_0xae8e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xae8e('0x7'));var csv=require(_0xae8e('0x8'));var ejs=require(_0xae8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae8e('0xa'));var squel=require('squel');var crypto=require(_0xae8e('0xb'));var jsforce=require(_0xae8e('0xc'));var deskjs=require(_0xae8e('0xd'));var toCsv=require(_0xae8e('0x8'));var querystring=require(_0xae8e('0xe'));var Papa=require(_0xae8e('0xf'));var Redis=require(_0xae8e('0x10'));var authService=require(_0xae8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae8e('0x12'));var hardwareService=require(_0xae8e('0x13'));var logger=require('../../config/logger')(_0xae8e('0x14'));var utils=require('../../config/utils');var config=require(_0xae8e('0x15'));var licenseUtil=require(_0xae8e('0x16'));var db=require(_0xae8e('0x17'))['db'];function respondWithStatusCode(_0x49ed2a,_0x4796a4){_0x4796a4=_0x4796a4||0xcc;return function(_0x245e6d){if(_0x245e6d){return _0x49ed2a['sendStatus'](_0x4796a4);}return _0x49ed2a[_0xae8e('0x18')](_0x4796a4)['end']();};}function respondWithResult(_0x99047d,_0x42f058){_0x42f058=_0x42f058||0xc8;return function(_0x3c2d06){if(_0x3c2d06){return _0x99047d['status'](_0x42f058)[_0xae8e('0x19')](_0x3c2d06);}};}function respondWithFilteredResult(_0x4f813b,_0x3528a7){return function(_0x13e490){if(_0x13e490){var _0x56ef6a=typeof _0x3528a7[_0xae8e('0x1a')]===_0xae8e('0x1b')&&typeof _0x3528a7[_0xae8e('0x1c')]===_0xae8e('0x1b');var _0x3f585c=_0x13e490[_0xae8e('0x1d')];var _0x58b6d6=_0x56ef6a?0x0:_0x3528a7[_0xae8e('0x1a')];var _0xa6d414=_0x56ef6a?_0x13e490[_0xae8e('0x1d')]:_0x3528a7[_0xae8e('0x1a')]+_0x3528a7[_0xae8e('0x1c')];var _0x155758;if(_0xa6d414>=_0x3f585c){_0xa6d414=_0x3f585c;_0x155758=0xc8;}else{_0x155758=0xce;}_0x4f813b[_0xae8e('0x18')](_0x155758);return _0x4f813b[_0xae8e('0x1e')](_0xae8e('0x1f'),_0x58b6d6+'-'+_0xa6d414+'/'+_0x3f585c)[_0xae8e('0x19')](_0x13e490);}return null;};}function patchUpdates(_0x515a3b){return function(_0x30eb6e){try{jsonpatch[_0xae8e('0x20')](_0x30eb6e,_0x515a3b,!![]);}catch(_0xa3f7b0){return BPromise[_0xae8e('0x21')](_0xa3f7b0);}return _0x30eb6e[_0xae8e('0x22')]();};}function saveUpdates(_0x4e6e14,_0x385e70){return function(_0x113044){if(_0x113044){return _0x113044['update'](_0x4e6e14)[_0xae8e('0x23')](function(_0x33d8a1){return _0x33d8a1;});}return null;};}function removeEntity(_0x260942,_0x3416d8){return function(_0x540b61){if(_0x540b61){return _0x540b61[_0xae8e('0x24')]()[_0xae8e('0x23')](function(){var _0x2bacdc=_0x540b61[_0xae8e('0x25')]({'plain':!![]});var _0x55c4b0='IvrCampaigns';return db[_0xae8e('0x26')][_0xae8e('0x24')]({'where':{'type':_0x55c4b0,'resourceId':_0x2bacdc['id']}})['then'](function(){return _0x540b61;});})[_0xae8e('0x23')](function(){_0x260942[_0xae8e('0x18')](0xcc)[_0xae8e('0x27')]();});}};}function handleEntityNotFound(_0x301f78,_0x5c1204){return function(_0x4db29a){if(!_0x4db29a){_0x301f78[_0xae8e('0x28')](0x194);}return _0x4db29a;};}function handleError(_0x22e563,_0x232501){_0x232501=_0x232501||0x1f4;return function(_0x3a6568){logger[_0xae8e('0x29')](_0x3a6568[_0xae8e('0x2a')]);if(_0x3a6568[_0xae8e('0x2b')]){delete _0x3a6568[_0xae8e('0x2b')];}_0x22e563[_0xae8e('0x18')](_0x232501)[_0xae8e('0x2c')](_0x3a6568);};}exports[_0xae8e('0x2d')]=function(_0x3d0c1f,_0x2f4db7){var _0x416e76={},_0x13c140={},_0x8e5f35={'count':0x0,'rows':[]};var _0x589f8a=_[_0xae8e('0x2e')](db[_0xae8e('0x2f')][_0xae8e('0x30')],function(_0x13a592){return{'name':_0x13a592[_0xae8e('0x31')],'type':_0x13a592['type'][_0xae8e('0x32')]};});_0x13c140[_0xae8e('0x33')]=_[_0xae8e('0x2e')](_0x589f8a,_0xae8e('0x2b'));_0x13c140[_0xae8e('0x34')]=_['keys'](_0x3d0c1f[_0xae8e('0x34')]);_0x13c140['filters']=_[_0xae8e('0x35')](_0x13c140[_0xae8e('0x33')],_0x13c140[_0xae8e('0x34')]);_0x416e76[_0xae8e('0x36')]=_['intersection'](_0x13c140['model'],qs[_0xae8e('0x37')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x37')]));_0x416e76[_0xae8e('0x36')]=_0x416e76[_0xae8e('0x36')][_0xae8e('0x38')]?_0x416e76[_0xae8e('0x36')]:_0x13c140[_0xae8e('0x33')];if(!_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x416e76['limit']=qs[_0xae8e('0x1c')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x416e76[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x416e76[_0xae8e('0x3b')]=qs['sort'](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x416e76[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x3d0c1f[_0xae8e('0x34')],_0x13c140[_0xae8e('0x3e')]),_0x589f8a);if(_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x416e76[_0xae8e('0x3d')]=_['merge'](_0x416e76[_0xae8e('0x3d')],{'$or':_['map'](_0x589f8a,function(_0x222463){if(_0x222463[_0xae8e('0x40')]!==_0xae8e('0x41')){var _0x558075={};_0x558075[_0x222463[_0xae8e('0x2b')]]={'$like':'%'+_0x3d0c1f['query'][_0xae8e('0x3f')]+'%'};return _0x558075;}})});}_0x416e76=_[_0xae8e('0x42')]({},_0x416e76,_0x3d0c1f[_0xae8e('0x43')]);var _0x32453e={'where':_0x416e76['where']};return db['Campaign'][_0xae8e('0x1d')](_0x32453e)[_0xae8e('0x23')](function(_0x270ef4){_0x8e5f35[_0xae8e('0x1d')]=_0x270ef4;if(_0x3d0c1f[_0xae8e('0x34')]['includeAll']){_0x416e76[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x2f')][_0xae8e('0x45')](_0x416e76);})['then'](function(_0x5300d3){_0x8e5f35[_0xae8e('0x46')]=_0x5300d3;return _0x8e5f35;})[_0xae8e('0x23')](respondWithFilteredResult(_0x2f4db7,_0x416e76))[_0xae8e('0x47')](handleError(_0x2f4db7,null));};exports[_0xae8e('0x48')]=function(_0x288bdd,_0x7a5d7a){var _0x1f8aef={'raw':![],'where':{'id':_0x288bdd['params']['id']}},_0xc6759={};_0xc6759[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0xc6759[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x288bdd[_0xae8e('0x34')]);_0xc6759[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0xc6759[_0xae8e('0x33')],_0xc6759[_0xae8e('0x34')]);_0x1f8aef[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0xc6759['model'],qs[_0xae8e('0x37')](_0x288bdd[_0xae8e('0x34')]['fields']));_0x1f8aef[_0xae8e('0x36')]=_0x1f8aef[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1f8aef[_0xae8e('0x36')]:_0xc6759[_0xae8e('0x33')];if(_0x288bdd[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1f8aef[_0xae8e('0x44')]=[{'all':!![]}];}_0x1f8aef=_[_0xae8e('0x42')]({},_0x1f8aef,_0x288bdd[_0xae8e('0x43')]);return db['Campaign'][_0xae8e('0x4b')](_0x1f8aef)['then'](handleEntityNotFound(_0x7a5d7a,null))[_0xae8e('0x23')](respondWithResult(_0x7a5d7a,null))[_0xae8e('0x47')](handleError(_0x7a5d7a,null));};exports[_0xae8e('0x4c')]=function(_0x269e5b,_0x50a565){return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_0x269e5b['body'],{})[_0xae8e('0x23')](function(_0x32044d){var _0x2c067e=_0x269e5b[_0xae8e('0x4d')]['get']({'plain':!![]});if(!_0x2c067e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c067e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x1bfe59=_0x32044d[_0xae8e('0x25')]({'plain':!![]});var _0x3c4190=_0xae8e('0x4f');return db[_0xae8e('0x50')]['find']({'where':{'name':_0x3c4190,'userProfileId':_0x2c067e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x5505d5){if(_0x5505d5&&_0x5505d5[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x1bfe59[_0xae8e('0x2b')],'resourceId':_0x1bfe59['id'],'type':_0x5505d5[_0xae8e('0x2b')],'sectionId':_0x5505d5['id']},{})['then'](function(){return _0x32044d;});}else{return _0x32044d;}})[_0xae8e('0x47')](function(_0x27207a){logger[_0xae8e('0x29')](_0xae8e('0x53'),_0x27207a);throw _0x27207a;});}return _0x32044d;})[_0xae8e('0x23')](respondWithResult(_0x50a565,0xc9))[_0xae8e('0x47')](handleError(_0x50a565,null));};exports['clone']=function(_0x15c483,_0x4e0e04){var _0x1b48a4={'where':{'id':_0x15c483['params']['id']}},_0x45bdb7={};_0x45bdb7['model']=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0x1b48a4[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x45bdb7['model'],qs[_0xae8e('0x37')](_0x15c483[_0xae8e('0x34')][_0xae8e('0x37')]));_0x1b48a4[_0xae8e('0x36')]=_0x1b48a4[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1b48a4[_0xae8e('0x36')]:_0x45bdb7[_0xae8e('0x33')];if(_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1b48a4[_0xae8e('0x44')]=[{'all':!![]}];}_0x1b48a4=_[_0xae8e('0x42')]({},_0x1b48a4,_0x15c483['options']);return db['Campaign'][_0xae8e('0x4b')](_0x1b48a4)['then'](handleEntityNotFound(_0x4e0e04,null))['then'](function(_0x1883c0){if(_0x1883c0){var _0x30b4b0=_0x1883c0[_0xae8e('0x25')]({'plain':!![]});_0x30b4b0=qs['omit'](_0x30b4b0,['id',_0xae8e('0x54'),_0xae8e('0x55')]);_0x15c483[_0xae8e('0x56')]=_[_0xae8e('0x57')](_0x15c483[_0xae8e('0x56')],['id',_0xae8e('0x54'),_0xae8e('0x55')]);return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_[_0xae8e('0x42')](_0x30b4b0,_0x15c483[_0xae8e('0x56')]),{'include':_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b3615){var _0x54521e=_0x15c483['user'][_0xae8e('0x25')]({'plain':!![]});if(!_0x54521e)throw new Error(_0xae8e('0x58'));if(_0x54521e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x4857d2=_0x2b3615['get']({'plain':!![]});var _0x3ee9fb='IvrCampaigns';return db[_0xae8e('0x50')][_0xae8e('0x4b')]({'where':{'name':_0x3ee9fb,'userProfileId':_0x54521e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x3ffc18){if(_0x3ffc18&&_0x3ffc18[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x4857d2[_0xae8e('0x2b')],'resourceId':_0x4857d2['id'],'type':_0x3ffc18['name'],'sectionId':_0x3ffc18['id']},{})['then'](function(){return _0x2b3615;});}else{return _0x2b3615;}})['catch'](function(_0x2a23ae){logger['error'](_0xae8e('0x53'),_0x2a23ae);throw _0x2a23ae;});}return _0x2b3615;});}})['then'](respondWithResult(_0x4e0e04,0xc9))['catch'](handleError(_0x4e0e04,null));};exports['update']=function(_0x109e5a,_0x325af2){if(_0x109e5a['body']['id']){delete _0x109e5a['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x109e5a[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x325af2,null))[_0xae8e('0x23')](saveUpdates(_0x109e5a['body'],null))['then'](respondWithResult(_0x325af2,null))[_0xae8e('0x47')](handleError(_0x325af2,null));};exports[_0xae8e('0x24')]=function(_0x3cf5d8,_0x401da1){return db['Campaign'][_0xae8e('0x4b')]({'where':{'id':_0x3cf5d8[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x401da1,null))[_0xae8e('0x23')](removeEntity(_0x401da1,null))[_0xae8e('0x47')](handleError(_0x401da1,null));};exports['getHoppers']=function(_0x1a2067,_0x323db3,_0x1dfb5f){var _0x8de537={'raw':!![],'where':{}};var _0x1eca13={};var _0x3adbe4={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x1a2067[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x323db3,null))[_0xae8e('0x23')](function(_0x321204){if(_0x321204){_0x1eca13[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmHopper'][_0xae8e('0x30')]);_0x1eca13['query']=_[_0xae8e('0x49')](_0x1a2067[_0xae8e('0x34')]);_0x1eca13['filters']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],_0x1eca13[_0xae8e('0x34')]);_0x8de537['attributes']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x37')]));_0x8de537['attributes']=_0x8de537[_0xae8e('0x36')][_0xae8e('0x38')]?_0x8de537[_0xae8e('0x36')]:_0x1eca13['model'];if(!_0x1a2067[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x8de537[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x8de537[_0xae8e('0x1a')]=qs['offset'](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x8de537[_0xae8e('0x3b')]=qs['sort'](_0x1a2067['query'][_0xae8e('0x3c')]);_0x8de537['where']=qs['filters'](_[_0xae8e('0x5b')](_0x1a2067[_0xae8e('0x34')],_0x1eca13[_0xae8e('0x3e')]));_0x8de537[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x321204['id'];if(_0x1a2067[_0xae8e('0x34')]['filter']){_0x8de537[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x8de537[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x8de537[_0xae8e('0x36')],function(_0x3176c0){var _0x31008b={};_0x31008b[_0x3176c0]={'$like':'%'+_0x1a2067['query'][_0xae8e('0x3f')]+'%'};return _0x31008b;})});}_0x8de537=_[_0xae8e('0x42')]({},_0x8de537,_0x1a2067['options']);return db[_0xae8e('0x5d')][_0xae8e('0x1d')]({'where':_0x8de537['where']})['then'](function(_0x1adf27){_0x3adbe4[_0xae8e('0x1d')]=_0x1adf27;if(_0x1a2067['query'][_0xae8e('0x4a')]){_0x8de537[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5d')][_0xae8e('0x45')](_0x8de537);})[_0xae8e('0x23')](function(_0x317cb8){_0x3adbe4[_0xae8e('0x46')]=_0x317cb8;return _0x3adbe4;});}})['then'](respondWithFilteredResult(_0x323db3,_0x8de537))['catch'](handleError(_0x323db3,null));};exports['getHopperHistories']=function(_0xa89c13,_0x40b6ce,_0x551bf9){var _0x38cae9={'raw':!![],'where':{}};var _0x51f2cc={};var _0x39a4ac={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0xa89c13[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x40b6ce,null))['then'](function(_0x541786){if(_0x541786){_0x51f2cc['model']=_[_0xae8e('0x49')](db['CmHopperHistory'][_0xae8e('0x30')]);_0x51f2cc['query']=_[_0xae8e('0x49')](_0xa89c13['query']);_0x51f2cc['filters']=_[_0xae8e('0x35')](_0x51f2cc['model'],_0x51f2cc[_0xae8e('0x34')]);_0x38cae9[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x51f2cc[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x37')]));_0x38cae9[_0xae8e('0x36')]=_0x38cae9[_0xae8e('0x36')]['length']?_0x38cae9[_0xae8e('0x36')]:_0x51f2cc[_0xae8e('0x33')];if(!_0xa89c13[_0xae8e('0x34')][_0xae8e('0x39')]('nolimit')){_0x38cae9[_0xae8e('0x1c')]=qs['limit'](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x38cae9[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0xa89c13['query'][_0xae8e('0x1a')]);}_0x38cae9['order']=qs[_0xae8e('0x3c')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x38cae9[_0xae8e('0x3d')]=qs['filters'](_[_0xae8e('0x5b')](_0xa89c13[_0xae8e('0x34')],_0x51f2cc[_0xae8e('0x3e')]));_0x38cae9[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x541786['id'];if(_0xa89c13[_0xae8e('0x34')]['filter']){_0x38cae9[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x38cae9[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x38cae9[_0xae8e('0x36')],function(_0x33877f){var _0x598298={};_0x598298[_0x33877f]={'$like':'%'+_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x598298;})});}_0x38cae9=_[_0xae8e('0x42')]({},_0x38cae9,_0xa89c13[_0xae8e('0x43')]);return db[_0xae8e('0x5e')][_0xae8e('0x1d')]({'where':_0x38cae9[_0xae8e('0x3d')]})['then'](function(_0x2131ba){_0x39a4ac[_0xae8e('0x1d')]=_0x2131ba;if(_0xa89c13[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x38cae9[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5e')][_0xae8e('0x45')](_0x38cae9);})[_0xae8e('0x23')](function(_0x1541a5){_0x39a4ac['rows']=_0x1541a5;return _0x39a4ac;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x40b6ce,_0x38cae9))[_0xae8e('0x47')](handleError(_0x40b6ce,null));};exports[_0xae8e('0x5f')]=function(_0x42fa56,_0x46fb40,_0x225e7e){var _0x59845f={'raw':!![],'where':{}};var _0x41b4a4={};var _0x180774={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x42fa56[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x46fb40,null))['then'](function(_0x44169b){if(_0x44169b){_0x41b4a4[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x60')]['rawAttributes']);_0x41b4a4[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x42fa56[_0xae8e('0x34')]);_0x41b4a4[_0xae8e('0x3e')]=_['intersection'](_0x41b4a4[_0xae8e('0x33')],_0x41b4a4[_0xae8e('0x34')]);_0x59845f['attributes']=_[_0xae8e('0x35')](_0x41b4a4[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x37')]));_0x59845f[_0xae8e('0x36')]=_0x59845f[_0xae8e('0x36')][_0xae8e('0x38')]?_0x59845f[_0xae8e('0x36')]:_0x41b4a4[_0xae8e('0x33')];if(!_0x42fa56[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x59845f['limit']=qs[_0xae8e('0x1c')](_0x42fa56[_0xae8e('0x34')]['limit']);_0x59845f[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x59845f['order']=qs[_0xae8e('0x3c')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x59845f['where']=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x42fa56[_0xae8e('0x34')],_0x41b4a4[_0xae8e('0x3e')]));_0x59845f[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x44169b['id'];if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x59845f[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x59845f[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x59845f[_0xae8e('0x36')],function(_0x495c35){var _0x367e44={};_0x367e44[_0x495c35]={'$like':'%'+_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x367e44;})});}_0x59845f=_['merge']({},_0x59845f,_0x42fa56['options']);return db[_0xae8e('0x60')]['count']({'where':_0x59845f[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x542a18){_0x180774['count']=_0x542a18;if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x59845f[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x60')][_0xae8e('0x45')](_0x59845f);})['then'](function(_0x1b00bb){_0x180774[_0xae8e('0x46')]=_0x1b00bb;return _0x180774;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x46fb40,_0x59845f))[_0xae8e('0x47')](handleError(_0x46fb40,null));};exports[_0xae8e('0x61')]=function(_0x34090b,_0x292655,_0x256b12){var _0x5606fb={'raw':!![],'where':{}};var _0x31f01e={};var _0x52ae1a={'count':0x0,'rows':[]};return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x34090b[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x292655,null))[_0xae8e('0x23')](function(_0x5547de){if(_0x5547de){_0x31f01e['model']=_[_0xae8e('0x49')](db[_0xae8e('0x62')]['rawAttributes']);_0x31f01e[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x34090b[_0xae8e('0x34')]);_0x31f01e[_0xae8e('0x3e')]=_['intersection'](_0x31f01e[_0xae8e('0x33')],_0x31f01e['query']);_0x5606fb['attributes']=_['intersection'](_0x31f01e['model'],qs[_0xae8e('0x37')](_0x34090b[_0xae8e('0x34')]['fields']));_0x5606fb['attributes']=_0x5606fb[_0xae8e('0x36')][_0xae8e('0x38')]?_0x5606fb[_0xae8e('0x36')]:_0x31f01e[_0xae8e('0x33')];if(!_0x34090b[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x5606fb[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x34090b['query'][_0xae8e('0x1c')]);_0x5606fb['offset']=qs[_0xae8e('0x1a')](_0x34090b[_0xae8e('0x34')]['offset']);}_0x5606fb[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x34090b[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x5606fb[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x34090b[_0xae8e('0x34')],_0x31f01e[_0xae8e('0x3e')]));_0x5606fb[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x5547de['id'];if(_0x34090b[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x5606fb[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x5606fb[_0xae8e('0x3d')],{'$or':_['map'](_0x5606fb[_0xae8e('0x36')],function(_0x56bee8){var _0x12c9f0={};_0x12c9f0[_0x56bee8]={'$like':'%'+_0x34090b['query'][_0xae8e('0x3f')]+'%'};return _0x12c9f0;})});}_0x5606fb=_[_0xae8e('0x42')]({},_0x5606fb,_0x34090b[_0xae8e('0x43')]);return db['CmHopperBlack'][_0xae8e('0x1d')]({'where':_0x5606fb[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x18d824){_0x52ae1a[_0xae8e('0x1d')]=_0x18d824;if(_0x34090b['query'][_0xae8e('0x4a')]){_0x5606fb['include']=[{'all':!![]}];}return db[_0xae8e('0x62')]['findAll'](_0x5606fb);})[_0xae8e('0x23')](function(_0x2ccca1){_0x52ae1a[_0xae8e('0x46')]=_0x2ccca1;return _0x52ae1a;});}})['then'](respondWithFilteredResult(_0x292655,_0x5606fb))[_0xae8e('0x47')](handleError(_0x292655,null));};exports[_0xae8e('0x63')]=function(_0x59f20d,_0x10e255,_0x5eafed){var _0x15c92a={};var _0x300ca6={};var _0xaa399a;var _0x95cc;return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x59f20d[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x10e255,null))[_0xae8e('0x23')](function(_0x561732){if(_0x561732){_0xaa399a=_0x561732;_0x300ca6[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x64')][_0xae8e('0x30')]);_0x300ca6[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x59f20d[_0xae8e('0x34')]);_0x300ca6[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],_0x300ca6[_0xae8e('0x34')]);_0x15c92a[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x37')]));_0x15c92a[_0xae8e('0x36')]=_0x15c92a[_0xae8e('0x36')][_0xae8e('0x38')]?_0x15c92a[_0xae8e('0x36')]:_0x300ca6[_0xae8e('0x33')];_0x15c92a[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x15c92a[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x59f20d[_0xae8e('0x34')],_0x300ca6[_0xae8e('0x3e')]));if(_0x59f20d['query'][_0xae8e('0x3f')]){_0x15c92a['where']=_[_0xae8e('0x42')](_0x15c92a['where'],{'$or':_['map'](_0x15c92a['attributes'],function(_0x3e96c6){var _0x45b015={};_0x45b015[_0x3e96c6]={'$like':'%'+_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x45b015;})});}_0x15c92a=_[_0xae8e('0x42')]({},_0x15c92a,_0x59f20d[_0xae8e('0x43')]);return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})['then'](function(_0x371b39){if(_0x371b39){_0x95cc=_0x371b39['length'];if(!_0x59f20d[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x15c92a[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x15c92a[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1a')]);}return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})[_0xae8e('0x23')](function(_0x5df525){if(_0x5df525){return _0x5df525?{'count':_0x95cc,'rows':_0x5df525}:null;}})['then'](respondWithResult(_0x10e255,null))['catch'](handleError(_0x10e255,null));};exports[_0xae8e('0x65')]=function(_0x358751,_0x6f7758,_0x39dd4f){var _0xef5e7c,_0x159f79;return db[_0xae8e('0x2f')]['find']({'where':{'id':_0x358751[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x6f7758,null))[_0xae8e('0x23')](function(_0x4dc241){if(_0x4dc241){_0x159f79=_0x4dc241;return _0x4dc241[_0xae8e('0x65')](_0x358751[_0xae8e('0x56')][_0xae8e('0x66')],_['omit'](_0x358751[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})[_0xae8e('0x67')](function(_0x31c7e9){var _0x1fce13;_0xef5e7c=_0x31c7e9||[];var _0x2bc120=[];if(_0x31c7e9){for(var _0x4a8a07=0x0;_0x4a8a07<_0x31c7e9[_0xae8e('0x38')];_0x4a8a07+=0x1){var _0x45b6b4=_0x31c7e9[_0x4a8a07][_0xae8e('0x25')]({'plain':!![]});_0x159f79[_0xae8e('0x68')]=_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]?_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]:_0x159f79['dialCheckDuplicateType'];switch(_0x159f79[_0xae8e('0x68')]){case _0xae8e('0x69'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper')['fromQuery']([_0xae8e('0x6c'),_0xae8e('0x6d'),_0xae8e('0x6e'),_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),'updatedAt'],squel['select']()['field'](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x45b6b4['CmListId'][_0xae8e('0x71')](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),'updatedAt')['from'](_0xae8e('0x73'))[_0xae8e('0x3d')](_0xae8e('0x74'))[_0xae8e('0x3d')](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xae8e('0x78')]()['field'](_0xae8e('0x79'))['from'](_0xae8e('0x7a'))['where'](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]()))[_0xae8e('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))[_0xae8e('0x3d')](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;case _0xae8e('0x7f'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')](_0xae8e('0x7e'))[_0xae8e('0x80')](['phone',_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),'scheduledAt')[_0xae8e('0x70')]('id','ContactId')[_0xae8e('0x70')](_0x45b6b4[_0xae8e('0x76')]['toString'](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),'createdAt')['field'](_0xae8e('0x72'),_0xae8e('0x55'))[_0xae8e('0x7d')]('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())['where'](_0xae8e('0x77'))[_0xae8e('0x3d')](_0xae8e('0x81'),squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))['where'](_0xae8e('0x7b'),_0x358751['params']['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;default:_0x1fce13=squel[_0xae8e('0x6a')]()['into'](_0xae8e('0x7e'))[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))['field'](_0x45b6b4['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),_0xae8e('0x55'))['from']('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))[_0xae8e('0x71')]();}_0x2bc120[_0xae8e('0x82')](db[_0xae8e('0x83')][_0xae8e('0x34')](_0x1fce13));}return BPromise[_0xae8e('0x84')](_0x2bc120);}})[_0xae8e('0x23')](function(){return _0xef5e7c;})[_0xae8e('0x23')](respondWithResult(_0x6f7758,null))[_0xae8e('0x47')](handleError(_0x6f7758,null));};exports[_0xae8e('0x85')]=function(_0xb15d60,_0x2c9502,_0x39fd52){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x2c9502,null))[_0xae8e('0x23')](function(_0x3a41c3){if(_0x3a41c3){return _0x3a41c3[_0xae8e('0x85')](_0xb15d60[_0xae8e('0x34')][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x35f8fa){if(_0x35f8fa){return db[_0xae8e('0x5d')][_0xae8e('0x24')]({'where':{'ListId':_0xb15d60[_0xae8e('0x34')]['ids'],'CampaignId':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](function(){return _0x35f8fa;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x2c9502,null))[_0xae8e('0x47')](handleError(_0x2c9502,null));};exports['getBlackLists']=function(_0x289a5d,_0x386aa0,_0x36ab20){var _0x4bfab6={};var _0x10c4f0={};var _0x4f32cd;var _0x2583e3;return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x289a5d['params']['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x386aa0,null))[_0xae8e('0x23')](function(_0x1a194e){if(_0x1a194e){_0x4f32cd=_0x1a194e;_0x10c4f0[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmList'][_0xae8e('0x30')]);_0x10c4f0['query']=_['keys'](_0x289a5d['query']);_0x10c4f0[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],_0x10c4f0[_0xae8e('0x34')]);_0x4bfab6[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x289a5d['query'][_0xae8e('0x37')]));_0x4bfab6[_0xae8e('0x36')]=_0x4bfab6[_0xae8e('0x36')]['length']?_0x4bfab6[_0xae8e('0x36')]:_0x10c4f0[_0xae8e('0x33')];_0x4bfab6[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x289a5d['query'][_0xae8e('0x3c')]);_0x4bfab6[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x289a5d[_0xae8e('0x34')],_0x10c4f0[_0xae8e('0x3e')]));if(_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x4bfab6['where']=_[_0xae8e('0x42')](_0x4bfab6[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x4bfab6[_0xae8e('0x36')],function(_0x1746be){var _0x58f440={};_0x58f440[_0x1746be]={'$like':'%'+_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x58f440;})});}_0x4bfab6=_[_0xae8e('0x42')]({},_0x4bfab6,_0x289a5d['options']);return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x485cc7){if(_0x485cc7){_0x2583e3=_0x485cc7[_0xae8e('0x38')];if(!_0x289a5d[_0xae8e('0x34')]['hasOwnProperty'](_0xae8e('0x3a'))){_0x4bfab6[_0xae8e('0x1c')]=qs['limit'](_0x289a5d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x4bfab6[_0xae8e('0x1a')]=qs['offset'](_0x289a5d['query'][_0xae8e('0x1a')]);}return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x2ed6ac){if(_0x2ed6ac){return _0x2ed6ac?{'count':_0x2583e3,'rows':_0x2ed6ac}:null;}})['then'](respondWithResult(_0x386aa0,null))['catch'](handleError(_0x386aa0,null));};exports['addBlackLists']=function(_0xfc6ea4,_0x35add2,_0x15e1b3){var _0x4737db,_0x2f210e;return db[_0xae8e('0x2f')][_0xae8e('0x4b')]({'where':{'id':_0xfc6ea4[_0xae8e('0x59')]['id']}})['then'](handleEntityNotFound(_0x35add2,null))[_0xae8e('0x23')](function(_0x4096c9){if(_0x4096c9){_0x2f210e=_0x4096c9;return _0x4096c9[_0xae8e('0x87')](_0xfc6ea4[_0xae8e('0x56')][_0xae8e('0x66')],_[_0xae8e('0x57')](_0xfc6ea4[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})['spread'](function(_0x586f74){var _0xcb9b97;_0x4737db=_0x586f74||[];var _0x566d56=[];if(_0x586f74){for(var _0x1220b8=0x0;_0x1220b8<_0x586f74[_0xae8e('0x38')];_0x1220b8+=0x1){var _0x15eea7=_0x586f74[_0x1220b8][_0xae8e('0x25')]({'plain':!![]});_0xcb9b97=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper_black')[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6e'),'ListId',_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x15eea7['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))['field'](_0xfc6ea4[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),'CampaignId')['field']('NOW()',_0xae8e('0x54'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x55'))[_0xae8e('0x7d')](_0xae8e('0x73'))[_0xae8e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xae8e('0x3d')]('ListId\x20=\x20?',_0x15eea7[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))['toString']();_0x566d56['push'](db['sequelize'][_0xae8e('0x34')](_0xcb9b97));}return BPromise[_0xae8e('0x84')](_0x566d56);}})[_0xae8e('0x23')](function(){return _0x4737db;})[_0xae8e('0x23')](respondWithResult(_0x35add2,null))[_0xae8e('0x47')](handleError(_0x35add2,null));};exports[_0xae8e('0x88')]=function(_0xc7dfe3,_0x5599b2,_0x1489a4){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xc7dfe3[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x5599b2,null))[_0xae8e('0x23')](function(_0x3f5a5f){if(_0x3f5a5f){return _0x3f5a5f[_0xae8e('0x88')](_0xc7dfe3['query'][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x9f7f66){if(_0x9f7f66){return db[_0xae8e('0x62')][_0xae8e('0x24')]({'where':{'ListId':_0xc7dfe3[_0xae8e('0x34')][_0xae8e('0x66')],'CampaignId':_0xc7dfe3['params']['id']}})[_0xae8e('0x23')](function(){return _0x9f7f66;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x5599b2,null))[_0xae8e('0x47')](handleError(_0x5599b2,null));}; \ No newline at end of file +var _0xca8c=['set','Content-Range','reject','save','then','get','UserProfileResource','destroy','end','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','error','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','ContactId','ListId','CmListId','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca8c,0x179));var _0xcca8=function(_0x9fb089,_0x53acde){_0x9fb089=_0x9fb089-0x0;var _0x223d4b=_0xca8c[_0x9fb089];return _0x223d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcca8('0x0'));var zipdir=require(_0xcca8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcca8('0x2'));var moment=require(_0xcca8('0x3'));var BPromise=require(_0xcca8('0x4'));var Mustache=require('mustache');var util=require(_0xcca8('0x5'));var path=require(_0xcca8('0x6'));var sox=require(_0xcca8('0x7'));var csv=require(_0xcca8('0x8'));var ejs=require(_0xcca8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcca8('0xa'));var squel=require(_0xcca8('0xb'));var crypto=require(_0xcca8('0xc'));var jsforce=require(_0xcca8('0xd'));var deskjs=require(_0xcca8('0xe'));var toCsv=require(_0xcca8('0x8'));var querystring=require(_0xcca8('0xf'));var Papa=require(_0xcca8('0x10'));var Redis=require(_0xcca8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcca8('0x12'));var as=require(_0xcca8('0x13'));var hardwareService=require(_0xcca8('0x14'));var logger=require(_0xcca8('0x15'))(_0xcca8('0x16'));var utils=require(_0xcca8('0x17'));var config=require(_0xcca8('0x18'));var licenseUtil=require(_0xcca8('0x19'));var db=require(_0xcca8('0x1a'))['db'];function respondWithStatusCode(_0x50c84f,_0x596a5e){_0x596a5e=_0x596a5e||0xcc;return function(_0xd0e692){if(_0xd0e692){return _0x50c84f[_0xcca8('0x1b')](_0x596a5e);}return _0x50c84f[_0xcca8('0x1c')](_0x596a5e)['end']();};}function respondWithResult(_0x4295e0,_0x4641c6){_0x4641c6=_0x4641c6||0xc8;return function(_0x127354){if(_0x127354){return _0x4295e0['status'](_0x4641c6)[_0xcca8('0x1d')](_0x127354);}};}function respondWithFilteredResult(_0x538697,_0x416fd4){return function(_0x20b084){if(_0x20b084){var _0x2b5244=typeof _0x416fd4[_0xcca8('0x1e')]===_0xcca8('0x1f')&&typeof _0x416fd4[_0xcca8('0x20')]===_0xcca8('0x1f');var _0x327809=_0x20b084[_0xcca8('0x21')];var _0x2bfe0d=_0x2b5244?0x0:_0x416fd4['offset'];var _0xa6fe04=_0x2b5244?_0x20b084[_0xcca8('0x21')]:_0x416fd4[_0xcca8('0x1e')]+_0x416fd4[_0xcca8('0x20')];var _0x8b5d88;if(_0xa6fe04>=_0x327809){_0xa6fe04=_0x327809;_0x8b5d88=0xc8;}else{_0x8b5d88=0xce;}_0x538697[_0xcca8('0x1c')](_0x8b5d88);return _0x538697[_0xcca8('0x22')](_0xcca8('0x23'),_0x2bfe0d+'-'+_0xa6fe04+'/'+_0x327809)[_0xcca8('0x1d')](_0x20b084);}return null;};}function patchUpdates(_0x5e008e){return function(_0x1f4710){try{jsonpatch['apply'](_0x1f4710,_0x5e008e,!![]);}catch(_0xf3f46f){return BPromise[_0xcca8('0x24')](_0xf3f46f);}return _0x1f4710[_0xcca8('0x25')]();};}function saveUpdates(_0x38e491,_0x429b15){return function(_0x282b97){if(_0x282b97){return _0x282b97['update'](_0x38e491)[_0xcca8('0x26')](function(_0x5f4cc0){return _0x5f4cc0;});}return null;};}function removeEntity(_0x1de727,_0xf154ae){return function(_0x397061){if(_0x397061){return _0x397061['destroy']()[_0xcca8('0x26')](function(){var _0x1ed91d=_0x397061[_0xcca8('0x27')]({'plain':!![]});var _0x324beb='IvrCampaigns';return db[_0xcca8('0x28')][_0xcca8('0x29')]({'where':{'type':_0x324beb,'resourceId':_0x1ed91d['id']}})[_0xcca8('0x26')](function(){return _0x397061;});})['then'](function(){_0x1de727[_0xcca8('0x1c')](0xcc)[_0xcca8('0x2a')]();});}};}function handleEntityNotFound(_0x59eee1,_0x3c35c5){return function(_0x3ecb6c){if(!_0x3ecb6c){_0x59eee1['sendStatus'](0x194);}return _0x3ecb6c;};}function handleError(_0x464f6a,_0x3df6d1){_0x3df6d1=_0x3df6d1||0x1f4;return function(_0x46e52c){logger['error'](_0x46e52c[_0xcca8('0x2b')]);if(_0x46e52c['name']){delete _0x46e52c[_0xcca8('0x2c')];}_0x464f6a['status'](_0x3df6d1)[_0xcca8('0x2d')](_0x46e52c);};}exports[_0xcca8('0x2e')]=function(_0x5548ec,_0x102d3f){var _0x1c57a0={},_0x2fd9f9={},_0x56ef45={'count':0x0,'rows':[]};var _0xfccf31=_[_0xcca8('0x2f')](db[_0xcca8('0x30')][_0xcca8('0x31')],function(_0x4f8510){return{'name':_0x4f8510['fieldName'],'type':_0x4f8510[_0xcca8('0x32')][_0xcca8('0x33')]};});_0x2fd9f9[_0xcca8('0x34')]=_[_0xcca8('0x2f')](_0xfccf31,'name');_0x2fd9f9[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x5548ec[_0xcca8('0x35')]);_0x2fd9f9[_0xcca8('0x37')]=_['intersection'](_0x2fd9f9[_0xcca8('0x34')],_0x2fd9f9[_0xcca8('0x35')]);_0x1c57a0[_0xcca8('0x38')]=_[_0xcca8('0x39')](_0x2fd9f9[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x5548ec['query'][_0xcca8('0x3a')]));_0x1c57a0[_0xcca8('0x38')]=_0x1c57a0[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x1c57a0[_0xcca8('0x38')]:_0x2fd9f9[_0xcca8('0x34')];if(!_0x5548ec[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x1c57a0['limit']=qs[_0xcca8('0x20')](_0x5548ec[_0xcca8('0x35')]['limit']);_0x1c57a0[_0xcca8('0x1e')]=qs['offset'](_0x5548ec[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x1c57a0['order']=qs[_0xcca8('0x3e')](_0x5548ec['query'][_0xcca8('0x3e')]);_0x1c57a0[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_['pick'](_0x5548ec['query'],_0x2fd9f9[_0xcca8('0x37')]),_0xfccf31);if(_0x5548ec[_0xcca8('0x35')][_0xcca8('0x40')]){_0x1c57a0[_0xcca8('0x3f')]=_['merge'](_0x1c57a0['where'],{'$or':_['map'](_0xfccf31,function(_0x27f928){if(_0x27f928[_0xcca8('0x32')]!==_0xcca8('0x41')){var _0x362cf2={};_0x362cf2[_0x27f928[_0xcca8('0x2c')]]={'$like':'%'+_0x5548ec['query'][_0xcca8('0x40')]+'%'};return _0x362cf2;}})});}_0x1c57a0=_['merge']({},_0x1c57a0,_0x5548ec[_0xcca8('0x42')]);var _0x3e47c0={'where':_0x1c57a0[_0xcca8('0x3f')]};return db['Campaign'][_0xcca8('0x21')](_0x3e47c0)[_0xcca8('0x26')](function(_0x54fa20){_0x56ef45[_0xcca8('0x21')]=_0x54fa20;if(_0x5548ec['query'][_0xcca8('0x43')]){_0x1c57a0[_0xcca8('0x44')]=[{'all':!![]}];}return db['Campaign'][_0xcca8('0x45')](_0x1c57a0);})[_0xcca8('0x26')](function(_0x1b0663){_0x56ef45[_0xcca8('0x46')]=_0x1b0663;return _0x56ef45;})[_0xcca8('0x26')](respondWithFilteredResult(_0x102d3f,_0x1c57a0))[_0xcca8('0x47')](handleError(_0x102d3f,null));};exports[_0xcca8('0x48')]=function(_0x522c77,_0x2db649){var _0x285eb4={'raw':![],'where':{'id':_0x522c77[_0xcca8('0x49')]['id']}},_0x125df3={};_0x125df3[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x30')]['rawAttributes']);_0x125df3['query']=_[_0xcca8('0x36')](_0x522c77[_0xcca8('0x35')]);_0x125df3[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x125df3[_0xcca8('0x34')],_0x125df3['query']);_0x285eb4['attributes']=_[_0xcca8('0x39')](_0x125df3[_0xcca8('0x34')],qs['fields'](_0x522c77['query'][_0xcca8('0x3a')]));_0x285eb4['attributes']=_0x285eb4[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x285eb4[_0xcca8('0x38')]:_0x125df3[_0xcca8('0x34')];if(_0x522c77[_0xcca8('0x35')]['includeAll']){_0x285eb4[_0xcca8('0x44')]=[{'all':!![]}];}_0x285eb4=_[_0xcca8('0x4a')]({},_0x285eb4,_0x522c77[_0xcca8('0x42')]);return db[_0xcca8('0x30')]['find'](_0x285eb4)[_0xcca8('0x26')](handleEntityNotFound(_0x2db649,null))[_0xcca8('0x26')](respondWithResult(_0x2db649,null))['catch'](handleError(_0x2db649,null));};exports[_0xcca8('0x4b')]=function(_0x365041,_0x2c7107){return db[_0xcca8('0x30')][_0xcca8('0x4b')](_0x365041[_0xcca8('0x4c')],{})[_0xcca8('0x26')](function(_0x215644){var _0x294499=_0x365041[_0xcca8('0x4d')]['get']({'plain':!![]});if(!_0x294499)throw new Error(_0xcca8('0x4e'));if(_0x294499[_0xcca8('0x4f')]==='user'){var _0x2ea86b=_0x215644[_0xcca8('0x27')]({'plain':!![]});var _0x363a19=_0xcca8('0x50');return db[_0xcca8('0x51')][_0xcca8('0x52')]({'where':{'name':_0x363a19,'userProfileId':_0x294499['userProfileId']},'raw':!![]})[_0xcca8('0x26')](function(_0x51cc48){if(_0x51cc48&&_0x51cc48[_0xcca8('0x53')]===0x0){return db[_0xcca8('0x28')]['create']({'name':_0x2ea86b[_0xcca8('0x2c')],'resourceId':_0x2ea86b['id'],'type':_0x51cc48[_0xcca8('0x2c')],'sectionId':_0x51cc48['id']},{})[_0xcca8('0x26')](function(){return _0x215644;});}else{return _0x215644;}})['catch'](function(_0x9a51c4){logger['error'](_0xcca8('0x54'),_0x9a51c4);throw _0x9a51c4;});}return _0x215644;})['then'](respondWithResult(_0x2c7107,0xc9))['catch'](handleError(_0x2c7107,null));};exports[_0xcca8('0x55')]=function(_0x2e678b,_0xa21eba){var _0x5881b7={'where':{'id':_0x2e678b[_0xcca8('0x49')]['id']}},_0x2f165e={};_0x2f165e[_0xcca8('0x34')]=_[_0xcca8('0x36')](db['Campaign'][_0xcca8('0x31')]);_0x5881b7[_0xcca8('0x38')]=_['intersection'](_0x2f165e[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x2e678b[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x5881b7[_0xcca8('0x38')]=_0x5881b7[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x5881b7[_0xcca8('0x38')]:_0x2f165e[_0xcca8('0x34')];if(_0x2e678b[_0xcca8('0x35')][_0xcca8('0x43')]){_0x5881b7['include']=[{'all':!![]}];}_0x5881b7=_[_0xcca8('0x4a')]({},_0x5881b7,_0x2e678b[_0xcca8('0x42')]);return db[_0xcca8('0x30')][_0xcca8('0x52')](_0x5881b7)[_0xcca8('0x26')](handleEntityNotFound(_0xa21eba,null))['then'](function(_0x43a134){if(_0x43a134){var _0x41f609=_0x43a134[_0xcca8('0x27')]({'plain':!![]});_0x41f609=qs[_0xcca8('0x56')](_0x41f609,['id',_0xcca8('0x57'),'updatedAt']);_0x2e678b[_0xcca8('0x4c')]=_[_0xcca8('0x56')](_0x2e678b[_0xcca8('0x4c')],['id','createdAt',_0xcca8('0x58')]);return db[_0xcca8('0x30')][_0xcca8('0x4b')](_[_0xcca8('0x4a')](_0x41f609,_0x2e678b['body']),{'include':_0x2e678b[_0xcca8('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xcca8('0x26')](function(_0x4d8c2c){var _0x136f36=_0x2e678b[_0xcca8('0x4d')]['get']({'plain':!![]});if(!_0x136f36)throw new Error(_0xcca8('0x4e'));if(_0x136f36['role']===_0xcca8('0x4d')){var _0x5ba79d=_0x4d8c2c[_0xcca8('0x27')]({'plain':!![]});var _0x223f55=_0xcca8('0x50');return db[_0xcca8('0x51')]['find']({'where':{'name':_0x223f55,'userProfileId':_0x136f36['userProfileId']},'raw':!![]})['then'](function(_0x436ffc){if(_0x436ffc&&_0x436ffc[_0xcca8('0x53')]===0x0){return db[_0xcca8('0x28')][_0xcca8('0x4b')]({'name':_0x5ba79d[_0xcca8('0x2c')],'resourceId':_0x5ba79d['id'],'type':_0x436ffc[_0xcca8('0x2c')],'sectionId':_0x436ffc['id']},{})[_0xcca8('0x26')](function(){return _0x4d8c2c;});}else{return _0x4d8c2c;}})[_0xcca8('0x47')](function(_0x3601a7){logger[_0xcca8('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3601a7);throw _0x3601a7;});}return _0x4d8c2c;});}})[_0xcca8('0x26')](respondWithResult(_0xa21eba,0xc9))[_0xcca8('0x47')](handleError(_0xa21eba,null));};exports['update']=function(_0x16da29,_0x53a4ad){if(_0x16da29['body']['id']){delete _0x16da29[_0xcca8('0x4c')]['id'];}return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x16da29[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x53a4ad,null))[_0xcca8('0x26')](saveUpdates(_0x16da29[_0xcca8('0x4c')],null))[_0xcca8('0x26')](respondWithResult(_0x53a4ad,null))[_0xcca8('0x47')](handleError(_0x53a4ad,null));};exports[_0xcca8('0x29')]=function(_0x30d9e6,_0x18b66f){return db['Campaign']['find']({'where':{'id':_0x30d9e6[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x18b66f,null))['then'](removeEntity(_0x18b66f,null))[_0xcca8('0x47')](handleError(_0x18b66f,null));};exports[_0xcca8('0x5a')]=function(_0x47b4c8,_0x20886c,_0x36daca){var _0x5c3207={'raw':!![],'where':{}};var _0x2c53c3={};var _0x1c62a3={'count':0x0,'rows':[]};return db['Campaign'][_0xcca8('0x5b')]({'where':{'id':_0x47b4c8['params']['id']}})['then'](handleEntityNotFound(_0x20886c,null))['then'](function(_0x1f6e38){if(_0x1f6e38){_0x2c53c3[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x5c')][_0xcca8('0x31')]);_0x2c53c3[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x47b4c8[_0xcca8('0x35')]);_0x2c53c3['filters']=_['intersection'](_0x2c53c3['model'],_0x2c53c3['query']);_0x5c3207[_0xcca8('0x38')]=_['intersection'](_0x2c53c3[_0xcca8('0x34')],qs['fields'](_0x47b4c8['query']['fields']));_0x5c3207[_0xcca8('0x38')]=_0x5c3207[_0xcca8('0x38')]['length']?_0x5c3207[_0xcca8('0x38')]:_0x2c53c3[_0xcca8('0x34')];if(!_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x3c')]('nolimit')){_0x5c3207[_0xcca8('0x20')]=qs['limit'](_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x20')]);_0x5c3207[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x5c3207['order']=qs[_0xcca8('0x3e')](_0x47b4c8['query'][_0xcca8('0x3e')]);_0x5c3207[_0xcca8('0x3f')]=qs['filters'](_['pick'](_0x47b4c8[_0xcca8('0x35')],_0x2c53c3['filters']));_0x5c3207['where'][_0xcca8('0x5d')]=_0x1f6e38['id'];if(_0x47b4c8['query'][_0xcca8('0x40')]){_0x5c3207[_0xcca8('0x3f')]=_['merge'](_0x5c3207[_0xcca8('0x3f')],{'$or':_[_0xcca8('0x2f')](_0x5c3207[_0xcca8('0x38')],function(_0xab41ea){var _0x556722={};_0x556722[_0xab41ea]={'$like':'%'+_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x556722;})});}_0x5c3207=_['merge']({},_0x5c3207,_0x47b4c8[_0xcca8('0x42')]);return db['CmHopper'][_0xcca8('0x21')]({'where':_0x5c3207['where']})['then'](function(_0x6d7f89){_0x1c62a3[_0xcca8('0x21')]=_0x6d7f89;if(_0x47b4c8['query'][_0xcca8('0x43')]){_0x5c3207['include']=[{'all':!![]}];}return db[_0xcca8('0x5c')][_0xcca8('0x45')](_0x5c3207);})[_0xcca8('0x26')](function(_0x45048a){_0x1c62a3['rows']=_0x45048a;return _0x1c62a3;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x20886c,_0x5c3207))[_0xcca8('0x47')](handleError(_0x20886c,null));};exports[_0xcca8('0x5e')]=function(_0x20226f,_0x13c0b4,_0x5cb94a){var _0x34b712={'raw':!![],'where':{}};var _0x427ff9={};var _0x50c21c={'count':0x0,'rows':[]};return db[_0xcca8('0x30')]['findOne']({'where':{'id':_0x20226f['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x13c0b4,null))[_0xcca8('0x26')](function(_0x5f1a9a){if(_0x5f1a9a){_0x427ff9[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x5f')][_0xcca8('0x31')]);_0x427ff9['query']=_[_0xcca8('0x36')](_0x20226f[_0xcca8('0x35')]);_0x427ff9['filters']=_['intersection'](_0x427ff9[_0xcca8('0x34')],_0x427ff9['query']);_0x34b712[_0xcca8('0x38')]=_[_0xcca8('0x39')](_0x427ff9[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x20226f[_0xcca8('0x35')]['fields']));_0x34b712[_0xcca8('0x38')]=_0x34b712[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x34b712[_0xcca8('0x38')]:_0x427ff9[_0xcca8('0x34')];if(!_0x20226f[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x34b712[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x20226f[_0xcca8('0x35')][_0xcca8('0x20')]);_0x34b712[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x20226f[_0xcca8('0x35')]['offset']);}_0x34b712[_0xcca8('0x60')]=qs['sort'](_0x20226f[_0xcca8('0x35')]['sort']);_0x34b712[_0xcca8('0x3f')]=qs['filters'](_[_0xcca8('0x61')](_0x20226f[_0xcca8('0x35')],_0x427ff9['filters']));_0x34b712['where'][_0xcca8('0x5d')]=_0x5f1a9a['id'];if(_0x20226f['query'][_0xcca8('0x40')]){_0x34b712[_0xcca8('0x3f')]=_['merge'](_0x34b712[_0xcca8('0x3f')],{'$or':_[_0xcca8('0x2f')](_0x34b712[_0xcca8('0x38')],function(_0x454ff1){var _0x2297a2={};_0x2297a2[_0x454ff1]={'$like':'%'+_0x20226f[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x2297a2;})});}_0x34b712=_[_0xcca8('0x4a')]({},_0x34b712,_0x20226f[_0xcca8('0x42')]);return db[_0xcca8('0x5f')][_0xcca8('0x21')]({'where':_0x34b712[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x1bd2c1){_0x50c21c[_0xcca8('0x21')]=_0x1bd2c1;if(_0x20226f[_0xcca8('0x35')]['includeAll']){_0x34b712[_0xcca8('0x44')]=[{'all':!![]}];}return db[_0xcca8('0x5f')][_0xcca8('0x45')](_0x34b712);})[_0xcca8('0x26')](function(_0x21838b){_0x50c21c['rows']=_0x21838b;return _0x50c21c;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x13c0b4,_0x34b712))[_0xcca8('0x47')](handleError(_0x13c0b4,null));};exports[_0xcca8('0x62')]=function(_0x21b47f,_0x213e40,_0x26147e){var _0x34726b={'raw':!![],'where':{}};var _0x59526e={};var _0x5c633d={'count':0x0,'rows':[]};return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0x21b47f['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x213e40,null))[_0xcca8('0x26')](function(_0x4f9bde){if(_0x4f9bde){_0x59526e[_0xcca8('0x34')]=_[_0xcca8('0x36')](db['CmHopperFinal'][_0xcca8('0x31')]);_0x59526e[_0xcca8('0x35')]=_['keys'](_0x21b47f['query']);_0x59526e[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x59526e[_0xcca8('0x34')],_0x59526e[_0xcca8('0x35')]);_0x34726b['attributes']=_[_0xcca8('0x39')](_0x59526e[_0xcca8('0x34')],qs['fields'](_0x21b47f[_0xcca8('0x35')]['fields']));_0x34726b[_0xcca8('0x38')]=_0x34726b[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x34726b[_0xcca8('0x38')]:_0x59526e['model'];if(!_0x21b47f[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x34726b[_0xcca8('0x20')]=qs['limit'](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x20')]);_0x34726b['offset']=qs['offset'](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x34726b[_0xcca8('0x60')]=qs[_0xcca8('0x3e')](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x3e')]);_0x34726b[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x21b47f[_0xcca8('0x35')],_0x59526e[_0xcca8('0x37')]));_0x34726b[_0xcca8('0x3f')][_0xcca8('0x5d')]=_0x4f9bde['id'];if(_0x21b47f[_0xcca8('0x35')][_0xcca8('0x40')]){_0x34726b['where']=_['merge'](_0x34726b[_0xcca8('0x3f')],{'$or':_['map'](_0x34726b['attributes'],function(_0x473176){var _0x22e68a={};_0x22e68a[_0x473176]={'$like':'%'+_0x21b47f['query'][_0xcca8('0x40')]+'%'};return _0x22e68a;})});}_0x34726b=_[_0xcca8('0x4a')]({},_0x34726b,_0x21b47f[_0xcca8('0x42')]);return db[_0xcca8('0x63')][_0xcca8('0x21')]({'where':_0x34726b[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x1be7c8){_0x5c633d[_0xcca8('0x21')]=_0x1be7c8;if(_0x21b47f['query']['includeAll']){_0x34726b[_0xcca8('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x34726b);})[_0xcca8('0x26')](function(_0x556cfa){_0x5c633d['rows']=_0x556cfa;return _0x5c633d;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x213e40,_0x34726b))[_0xcca8('0x47')](handleError(_0x213e40,null));};exports[_0xcca8('0x64')]=function(_0x3001a2,_0x56e105,_0x65d312){var _0xf150ab={'raw':!![],'where':{}};var _0x549d09={};var _0x35caff={'count':0x0,'rows':[]};return db[_0xcca8('0x30')]['findOne']({'where':{'id':_0x3001a2['params']['id']}})['then'](handleEntityNotFound(_0x56e105,null))[_0xcca8('0x26')](function(_0x9eabea){if(_0x9eabea){_0x549d09[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x65')][_0xcca8('0x31')]);_0x549d09[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x3001a2['query']);_0x549d09['filters']=_['intersection'](_0x549d09[_0xcca8('0x34')],_0x549d09[_0xcca8('0x35')]);_0xf150ab['attributes']=_[_0xcca8('0x39')](_0x549d09[_0xcca8('0x34')],qs['fields'](_0x3001a2[_0xcca8('0x35')]['fields']));_0xf150ab[_0xcca8('0x38')]=_0xf150ab['attributes']['length']?_0xf150ab[_0xcca8('0x38')]:_0x549d09[_0xcca8('0x34')];if(!_0x3001a2[_0xcca8('0x35')]['hasOwnProperty'](_0xcca8('0x3d'))){_0xf150ab[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x20')]);_0xf150ab[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0xf150ab['order']=qs[_0xcca8('0x3e')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x3e')]);_0xf150ab[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x3001a2['query'],_0x549d09[_0xcca8('0x37')]));_0xf150ab[_0xcca8('0x3f')]['CampaignId']=_0x9eabea['id'];if(_0x3001a2['query'][_0xcca8('0x40')]){_0xf150ab[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0xf150ab['where'],{'$or':_[_0xcca8('0x2f')](_0xf150ab[_0xcca8('0x38')],function(_0x5f22d7){var _0x170b0e={};_0x170b0e[_0x5f22d7]={'$like':'%'+_0x3001a2[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x170b0e;})});}_0xf150ab=_[_0xcca8('0x4a')]({},_0xf150ab,_0x3001a2[_0xcca8('0x42')]);return db[_0xcca8('0x65')][_0xcca8('0x21')]({'where':_0xf150ab[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x165536){_0x35caff[_0xcca8('0x21')]=_0x165536;if(_0x3001a2[_0xcca8('0x35')][_0xcca8('0x43')]){_0xf150ab[_0xcca8('0x44')]=[{'all':!![]}];}return db[_0xcca8('0x65')][_0xcca8('0x45')](_0xf150ab);})[_0xcca8('0x26')](function(_0x43d504){_0x35caff[_0xcca8('0x46')]=_0x43d504;return _0x35caff;});}})['then'](respondWithFilteredResult(_0x56e105,_0xf150ab))[_0xcca8('0x47')](handleError(_0x56e105,null));};exports[_0xcca8('0x66')]=function(_0xdb0c10,_0x3348d1,_0x1d017a){var _0x5bbcd7={};var _0x101e8e={};var _0xe597fc;var _0x41d29c;return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0xdb0c10[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x3348d1,null))[_0xcca8('0x26')](function(_0x368dc5){if(_0x368dc5){_0xe597fc=_0x368dc5;_0x101e8e['model']=_[_0xcca8('0x36')](db['CmList']['rawAttributes']);_0x101e8e[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0xdb0c10[_0xcca8('0x35')]);_0x101e8e[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x101e8e[_0xcca8('0x34')],_0x101e8e['query']);_0x5bbcd7[_0xcca8('0x38')]=_['intersection'](_0x101e8e[_0xcca8('0x34')],qs['fields'](_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x5bbcd7['attributes']=_0x5bbcd7['attributes']['length']?_0x5bbcd7[_0xcca8('0x38')]:_0x101e8e[_0xcca8('0x34')];_0x5bbcd7['order']=qs[_0xcca8('0x3e')](_0xdb0c10['query'][_0xcca8('0x3e')]);_0x5bbcd7['where']=qs[_0xcca8('0x37')](_['pick'](_0xdb0c10[_0xcca8('0x35')],_0x101e8e[_0xcca8('0x37')]));if(_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x40')]){_0x5bbcd7[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0x5bbcd7[_0xcca8('0x3f')],{'$or':_['map'](_0x5bbcd7[_0xcca8('0x38')],function(_0x5c6d9d){var _0x1dfd3e={};_0x1dfd3e[_0x5c6d9d]={'$like':'%'+_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x1dfd3e;})});}_0x5bbcd7=_[_0xcca8('0x4a')]({},_0x5bbcd7,_0xdb0c10[_0xcca8('0x42')]);return _0xe597fc['getLists'](_0x5bbcd7);}})[_0xcca8('0x26')](function(_0x4863be){if(_0x4863be){_0x41d29c=_0x4863be['length'];if(!_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x5bbcd7['limit']=qs[_0xcca8('0x20')](_0xdb0c10['query']['limit']);_0x5bbcd7[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x1e')]);}return _0xe597fc['getLists'](_0x5bbcd7);}})[_0xcca8('0x26')](function(_0x5ebbba){if(_0x5ebbba){return _0x5ebbba?{'count':_0x41d29c,'rows':_0x5ebbba}:null;}})[_0xcca8('0x26')](respondWithResult(_0x3348d1,null))[_0xcca8('0x47')](handleError(_0x3348d1,null));};exports[_0xcca8('0x67')]=function(_0x20adef,_0x1ce7cc,_0x4aff04){var _0x39bf94,_0x48b73e;return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x20adef['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x1ce7cc,null))[_0xcca8('0x26')](function(_0x1d1aa0){if(_0x1d1aa0){_0x48b73e=_0x1d1aa0;return _0x1d1aa0[_0xcca8('0x67')](_0x20adef[_0xcca8('0x4c')][_0xcca8('0x68')],_['omit'](_0x20adef['body'],[_0xcca8('0x68'),'id'])||{});}return null;})[_0xcca8('0x69')](function(_0x31fe88){var _0xeda7b1;_0x39bf94=_0x31fe88||[];var _0x3f2144=[];if(_0x31fe88){for(var _0x5e25ec=0x0;_0x5e25ec<_0x31fe88[_0xcca8('0x3b')];_0x5e25ec+=0x1){var _0x3eec02=_0x31fe88[_0x5e25ec]['get']({'plain':!![]});_0x48b73e[_0xcca8('0x6a')]=_0x20adef[_0xcca8('0x4c')][_0xcca8('0x6a')]?_0x20adef['body']['dialCheckDuplicateType']:_0x48b73e['dialCheckDuplicateType'];switch(_0x48b73e['dialCheckDuplicateType']){case'always':_0xeda7b1=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x6d'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),_0xcca8('0x70'),'ContactId','ListId',_0xcca8('0x5d'),_0xcca8('0x57'),_0xcca8('0x58')],squel[_0xcca8('0x71')]()[_0xcca8('0x72')]('phone',_0xcca8('0x6f'))['field'](_0xcca8('0x73'),_0xcca8('0x70'))[_0xcca8('0x72')]('id','ContactId')[_0xcca8('0x72')](_0x3eec02['CmListId'][_0xcca8('0x74')](),'ListId')['field'](_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),_0xcca8('0x5d'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x57'))['field'](_0xcca8('0x73'),'updatedAt')[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')](_0xcca8('0x77'))[_0xcca8('0x3f')](_0xcca8('0x78'),_0x3eec02['CmListId'][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79'))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel['select']()[_0xcca8('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xcca8('0x75')](_0xcca8('0x7b'))['where']('CampaignId\x20=\x20?',_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')]()))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel[_0xcca8('0x71')]()[_0xcca8('0x72')]('COALESCE(phone,\x27\x27)')[_0xcca8('0x75')](_0xcca8('0x6d'))[_0xcca8('0x3f')](_0xcca8('0x7c'),_0x20adef[_0xcca8('0x49')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0xeda7b1=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x6d'))[_0xcca8('0x6e')](['phone','scheduledAt',_0xcca8('0x7d'),_0xcca8('0x7e'),_0xcca8('0x5d'),_0xcca8('0x57'),'updatedAt'],squel[_0xcca8('0x71')]()[_0xcca8('0x72')](_0xcca8('0x6f'),_0xcca8('0x6f'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x70'))[_0xcca8('0x72')]('id',_0xcca8('0x7d'))[_0xcca8('0x72')](_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')](),_0xcca8('0x7e'))['field'](_0x20adef[_0xcca8('0x49')]['id']['toString'](),_0xcca8('0x5d'))[_0xcca8('0x72')](_0xcca8('0x73'),'createdAt')[_0xcca8('0x72')](_0xcca8('0x73'),'updatedAt')[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')]('deletedAt\x20IS\x20NULL')[_0xcca8('0x3f')](_0xcca8('0x78'),_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79'))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel[_0xcca8('0x71')]()['field'](_0xcca8('0x80'))[_0xcca8('0x75')](_0xcca8('0x6d'))[_0xcca8('0x3f')](_0xcca8('0x7c'),_0x20adef[_0xcca8('0x49')]['id']['toString']())))[_0xcca8('0x74')]();break;default:_0xeda7b1=squel[_0xcca8('0x6b')]()['into'](_0xcca8('0x6d'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),'scheduledAt',_0xcca8('0x7d'),'ListId',_0xcca8('0x5d'),_0xcca8('0x57'),_0xcca8('0x58')],squel[_0xcca8('0x71')]()['field'](_0xcca8('0x6f'),_0xcca8('0x6f'))['field'](_0xcca8('0x73'),'scheduledAt')['field']('id',_0xcca8('0x7d'))['field'](_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')](),'ListId')[_0xcca8('0x72')](_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),'CampaignId')[_0xcca8('0x72')]('NOW()',_0xcca8('0x57'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x58'))[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xcca8('0x78'),_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')]())['where'](_0xcca8('0x79')))['toString']();}_0x3f2144['push'](db[_0xcca8('0x81')]['query'](_0xeda7b1));}return BPromise[_0xcca8('0x82')](_0x3f2144);}})[_0xcca8('0x26')](function(){return _0x39bf94;})[_0xcca8('0x26')](respondWithResult(_0x1ce7cc,null))['catch'](handleError(_0x1ce7cc,null));};exports['removeLists']=function(_0x34a9fa,_0x452110,_0x6d91a8){return db['Campaign']['find']({'where':{'id':_0x34a9fa[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x452110,null))[_0xcca8('0x26')](function(_0x50aab5){if(_0x50aab5){return _0x50aab5[_0xcca8('0x83')](_0x34a9fa['query']['ids']);}})[_0xcca8('0x26')](function(_0x410152){if(_0x410152){return db[_0xcca8('0x5c')][_0xcca8('0x29')]({'where':{'ListId':_0x34a9fa[_0xcca8('0x35')][_0xcca8('0x68')],'CampaignId':_0x34a9fa[_0xcca8('0x49')]['id']}})['then'](function(){return _0x410152;});}})[_0xcca8('0x26')](respondWithStatusCode(_0x452110,null))[_0xcca8('0x47')](handleError(_0x452110,null));};exports[_0xcca8('0x84')]=function(_0x4f9382,_0x40695d,_0x365fe0){var _0x333294={};var _0x4de829={};var _0x36c46c;var _0x5d67f5;return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0x4f9382[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x40695d,null))[_0xcca8('0x26')](function(_0x2ab656){if(_0x2ab656){_0x36c46c=_0x2ab656;_0x4de829[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x85')][_0xcca8('0x31')]);_0x4de829[_0xcca8('0x35')]=_['keys'](_0x4f9382[_0xcca8('0x35')]);_0x4de829['filters']=_['intersection'](_0x4de829['model'],_0x4de829[_0xcca8('0x35')]);_0x333294['attributes']=_['intersection'](_0x4de829[_0xcca8('0x34')],qs['fields'](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x333294[_0xcca8('0x38')]=_0x333294['attributes'][_0xcca8('0x3b')]?_0x333294[_0xcca8('0x38')]:_0x4de829[_0xcca8('0x34')];_0x333294[_0xcca8('0x60')]=qs[_0xcca8('0x3e')](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3e')]);_0x333294[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x4f9382[_0xcca8('0x35')],_0x4de829[_0xcca8('0x37')]));if(_0x4f9382[_0xcca8('0x35')][_0xcca8('0x40')]){_0x333294[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0x333294['where'],{'$or':_[_0xcca8('0x2f')](_0x333294[_0xcca8('0x38')],function(_0x3b3c9b){var _0x1d262c={};_0x1d262c[_0x3b3c9b]={'$like':'%'+_0x4f9382['query'][_0xcca8('0x40')]+'%'};return _0x1d262c;})});}_0x333294=_[_0xcca8('0x4a')]({},_0x333294,_0x4f9382[_0xcca8('0x42')]);return _0x36c46c['getBlackLists'](_0x333294);}})[_0xcca8('0x26')](function(_0x56060b){if(_0x56060b){_0x5d67f5=_0x56060b[_0xcca8('0x3b')];if(!_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x333294[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x20')]);_0x333294[_0xcca8('0x1e')]=qs['offset'](_0x4f9382['query'][_0xcca8('0x1e')]);}return _0x36c46c[_0xcca8('0x84')](_0x333294);}})[_0xcca8('0x26')](function(_0x53e9b3){if(_0x53e9b3){return _0x53e9b3?{'count':_0x5d67f5,'rows':_0x53e9b3}:null;}})[_0xcca8('0x26')](respondWithResult(_0x40695d,null))[_0xcca8('0x47')](handleError(_0x40695d,null));};exports[_0xcca8('0x86')]=function(_0x2b234a,_0x4b4a37,_0x3f95e3){var _0x38925d,_0x418a7b;return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x2b234a[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x4b4a37,null))['then'](function(_0x1d532){if(_0x1d532){_0x418a7b=_0x1d532;return _0x1d532['addBlackLists'](_0x2b234a[_0xcca8('0x4c')][_0xcca8('0x68')],_[_0xcca8('0x56')](_0x2b234a[_0xcca8('0x4c')],['ids','id'])||{});}return null;})[_0xcca8('0x69')](function(_0x20a23c){var _0x504589;_0x38925d=_0x20a23c||[];var _0x4346bc=[];if(_0x20a23c){for(var _0x97e39e=0x0;_0x97e39e<_0x20a23c['length'];_0x97e39e+=0x1){var _0x50005e=_0x20a23c[_0x97e39e][_0xcca8('0x27')]({'plain':!![]});_0x504589=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x87'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),'ContactId',_0xcca8('0x7e'),_0xcca8('0x5d'),'createdAt',_0xcca8('0x58')],squel['select']()[_0xcca8('0x72')]('phone',_0xcca8('0x6f'))['field']('id',_0xcca8('0x7d'))[_0xcca8('0x72')](_0x50005e[_0xcca8('0x7f')]['toString'](),_0xcca8('0x7e'))[_0xcca8('0x72')](_0x2b234a[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),'CampaignId')[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x57'))[_0xcca8('0x72')]('NOW()','updatedAt')['from'](_0xcca8('0x76'))['where'](_0xcca8('0x77'))[_0xcca8('0x3f')](_0xcca8('0x78'),_0x50005e[_0xcca8('0x7f')][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79')))[_0xcca8('0x74')]();_0x4346bc['push'](db[_0xcca8('0x81')][_0xcca8('0x35')](_0x504589));}return BPromise[_0xcca8('0x82')](_0x4346bc);}})['then'](function(){return _0x38925d;})[_0xcca8('0x26')](respondWithResult(_0x4b4a37,null))[_0xcca8('0x47')](handleError(_0x4b4a37,null));};exports[_0xcca8('0x88')]=function(_0x3fcb31,_0x36c21f,_0x3ff943){return db['Campaign'][_0xcca8('0x52')]({'where':{'id':_0x3fcb31['params']['id']}})['then'](handleEntityNotFound(_0x36c21f,null))[_0xcca8('0x26')](function(_0x1904e3){if(_0x1904e3){return _0x1904e3[_0xcca8('0x88')](_0x3fcb31[_0xcca8('0x35')][_0xcca8('0x68')]);}})['then'](function(_0x128453){if(_0x128453){return db[_0xcca8('0x65')][_0xcca8('0x29')]({'where':{'ListId':_0x3fcb31['query'][_0xcca8('0x68')],'CampaignId':_0x3fcb31['params']['id']}})[_0xcca8('0x26')](function(){return _0x128453;});}})['then'](respondWithStatusCode(_0x36c21f,null))[_0xcca8('0x47')](handleError(_0x36c21f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3fc802b..0fbbb45 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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 3491506..2c1a674 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 _0xf257=['map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x1dc29a,_0x10db83){var _0x547b4f=function(_0x2cd12d){while(--_0x2cd12d){_0x1dc29a['push'](_0x1dc29a['shift']());}};_0x547b4f(++_0x10db83);}(_0xf257,0x82));var _0x7f25=function(_0x378fcb,_0x32e78c){_0x378fcb=_0x378fcb-0x0;var _0x5dfe9b=_0xf257[_0x378fcb];return _0x5dfe9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f25('0x0'));var BPromise=require(_0x7f25('0x1'));var rs=require(_0x7f25('0x2'));var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f25('0x4'));var logger=require(_0x7f25('0x5'))(_0x7f25('0x6'));var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson[_0x7f25('0x9')][_0x7f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x242a3e,_0x369a09,_0x16e278){return new BPromise(function(_0x31a5d8,_0x1ae607){return client[_0x7f25('0xb')](_0x242a3e,_0x16e278)[_0x7f25('0xc')](function(_0x57ba17){logger[_0x7f25('0xd')](_0x7f25('0xe'),_0x369a09,'request\x20sent');logger['debug'](_0x7f25('0xf'),_0x369a09,'request\x20sent',JSON[_0x7f25('0x10')](_0x57ba17));if(_0x57ba17[_0x7f25('0x11')]){if(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x12')]===0x1f4){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')]['message']);return _0x1ae607(_0x57ba17['error'][_0x7f25('0x13')]);}logger['error'](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);return _0x31a5d8(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x369a09,'request\x20sent');_0x31a5d8(_0x57ba17[_0x7f25('0x14')][_0x7f25('0x13')]);}})[_0x7f25('0x15')](function(_0x167363){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x167363);_0x1ae607(_0x167363);});});}exports[_0x7f25('0x16')]=function(_0x26d4aa){var _0x5e0067=this;return new Promise(function(_0x23f30c,_0x1cd6c1){return db[_0x7f25('0x17')][_0x7f25('0x18')]({'raw':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26d4aa['options']?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1a')]||null:null,'attributes':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1b')]||null:null,'limit':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1c')]||null:null,'include':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa['options'][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1d')],function(_0x29039a){return{'model':db[_0x29039a['model']],'as':_0x29039a['as'],'attributes':_0x29039a[_0x7f25('0x1b')],'include':_0x29039a[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x29039a['include'],function(_0x17b38c){return{'model':db[_0x17b38c['model']],'as':_0x17b38c['as'],'attributes':_0x17b38c[_0x7f25('0x1b')],'include':_0x17b38c[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x17b38c[_0x7f25('0x1d')],function(_0x382fd4){return{'model':db[_0x382fd4[_0x7f25('0x1f')]],'as':_0x382fd4['as'],'attributes':_0x382fd4[_0x7f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xc')](function(_0x44116d){logger[_0x7f25('0xd')]('GetCampaign',_0x26d4aa);logger['debug'](_0x7f25('0x16'),_0x26d4aa,JSON[_0x7f25('0x10')](_0x44116d));_0x23f30c(_0x44116d);})['catch'](function(_0xa373ee){logger[_0x7f25('0x11')](_0x7f25('0x16'),_0xa373ee[_0x7f25('0x13')],_0x26d4aa);_0x1cd6c1(_0x5e0067[_0x7f25('0x11')](0x1f4,_0xa373ee[_0x7f25('0x13')]));});});}; \ No newline at end of file +var _0xd3b4=['catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4c7c91,_0x48278c){var _0x325c70=function(_0x4f357a){while(--_0x4f357a){_0x4c7c91['push'](_0x4c7c91['shift']());}};_0x325c70(++_0x48278c);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0xd90be7,_0x5cc718){_0xd90be7=_0xd90be7-0x0;var _0x5dc59f=_0xd3b4[_0xd90be7];return _0x5dc59f;};'use strict';var _=require(_0x4d3b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d3b('0x1'));var rs=require(_0x4d3b('0x2'));var fs=require('fs');var Redis=require(_0x4d3b('0x3'));var db=require(_0x4d3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d3b('0x5'))('rpc');var config=require(_0x4d3b('0x6'));var jayson=require(_0x4d3b('0x7'));var client=jayson[_0x4d3b('0x8')][_0x4d3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe4511c,_0x64ad89,_0x331043){return new BPromise(function(_0x7b17b9,_0x207a6e){return client[_0x4d3b('0xa')](_0xe4511c,_0x331043)['then'](function(_0x30e71a){logger['info'](_0x4d3b('0xb'),_0x64ad89,'request\x20sent');logger[_0x4d3b('0xc')](_0x4d3b('0xd'),_0x64ad89,_0x4d3b('0xe'),JSON[_0x4d3b('0xf')](_0x30e71a));if(_0x30e71a[_0x4d3b('0x10')]){if(_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x11')]===0x1f4){logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);return _0x207a6e(_0x30e71a[_0x4d3b('0x10')]['message']);}logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);return _0x7b17b9(_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);}else{logger[_0x4d3b('0x13')](_0x4d3b('0xb'),_0x64ad89,_0x4d3b('0xe'));_0x7b17b9(_0x30e71a[_0x4d3b('0x14')]['message']);}})[_0x4d3b('0x15')](function(_0x53c21a){logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x53c21a);_0x207a6e(_0x53c21a);});});}exports[_0x4d3b('0x16')]=function(_0x408b9b){var _0x4f5ac6=this;return new Promise(function(_0x2f8a24,_0x393b68){return db[_0x4d3b('0x17')][_0x4d3b('0x18')]({'raw':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')][_0x4d3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b['options'][_0x4d3b('0x1b')]||null:null,'attributes':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')][_0x4d3b('0x1c')]||null:null,'limit':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b['options'][_0x4d3b('0x1d')]||null:null,'include':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')]['include']?_[_0x4d3b('0x1e')](_0x408b9b['options'][_0x4d3b('0x1f')],function(_0x293388){return{'model':db[_0x293388[_0x4d3b('0x20')]],'as':_0x293388['as'],'attributes':_0x293388['attributes'],'include':_0x293388[_0x4d3b('0x1f')]?_[_0x4d3b('0x1e')](_0x293388[_0x4d3b('0x1f')],function(_0x24ada0){return{'model':db[_0x24ada0['model']],'as':_0x24ada0['as'],'attributes':_0x24ada0[_0x4d3b('0x1c')],'include':_0x24ada0[_0x4d3b('0x1f')]?_[_0x4d3b('0x1e')](_0x24ada0[_0x4d3b('0x1f')],function(_0x2486ef){return{'model':db[_0x2486ef[_0x4d3b('0x20')]],'as':_0x2486ef['as'],'attributes':_0x2486ef[_0x4d3b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4d3b('0x21')](function(_0x1b7c1b){logger['info'](_0x4d3b('0x16'),_0x408b9b);logger['debug'](_0x4d3b('0x16'),_0x408b9b,JSON[_0x4d3b('0xf')](_0x1b7c1b));_0x2f8a24(_0x1b7c1b);})[_0x4d3b('0x15')](function(_0x3239bf){logger[_0x4d3b('0x10')](_0x4d3b('0x16'),_0x3239bf['message'],_0x408b9b);_0x393b68(_0x4f5ac6['error'](0x1f4,_0x3239bf[_0x4d3b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 62eaf17..7ec9ee2 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 _0x2b44=['destroy','removeLists','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','/:id'];(function(_0x3075a6,_0x1c0d29){var _0x19e413=function(_0x5a9deb){while(--_0x5a9deb){_0x3075a6['push'](_0x3075a6['shift']());}};_0x19e413(++_0x1c0d29);}(_0x2b44,0x122));var _0x42b4=function(_0x22244c,_0x16e0be){_0x22244c=_0x22244c-0x0;var _0x16e2d5=_0x2b44[_0x22244c];return _0x16e2d5;};'use strict';var multer=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var path=require(_0x42b4('0x2'));var timeout=require(_0x42b4('0x3'));var express=require(_0x42b4('0x4'));var router=express[_0x42b4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var controller=require(_0x42b4('0x8'));router[_0x42b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x42b4('0xa')]);router[_0x42b4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0xb')]);router[_0x42b4('0x9')](_0x42b4('0xc'),auth[_0x42b4('0xd')](),controller[_0x42b4('0xe')]);router[_0x42b4('0x9')](_0x42b4('0xf'),auth['isAuthenticated'](),controller[_0x42b4('0x10')]);router[_0x42b4('0x9')](_0x42b4('0x11'),auth['isAuthenticated'](),controller[_0x42b4('0x12')]);router[_0x42b4('0x9')](_0x42b4('0x13'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x14')]);router[_0x42b4('0x9')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x42b4('0xd')](),controller[_0x42b4('0x16')]);router[_0x42b4('0x17')]('/',auth[_0x42b4('0xd')](),controller[_0x42b4('0x18')]);router['post'](_0x42b4('0x19'),auth['isAuthenticated'](),controller[_0x42b4('0x1a')]);router[_0x42b4('0x17')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1b')]);router['post'](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1d')]);router[_0x42b4('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0x1f')]);router[_0x42b4('0x20')](_0x42b4('0x21'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x22')]);router[_0x42b4('0x20')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x23')]);router[_0x42b4('0x20')](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x5b56=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','get','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','addLists','put','delete','removeLists','removeBlackLists','exports','multer'];(function(_0x460c3e,_0x2e210f){var _0x4517df=function(_0x2c6e21){while(--_0x2c6e21){_0x460c3e['push'](_0x460c3e['shift']());}};_0x4517df(++_0x2e210f);}(_0x5b56,0x9a));var _0x65b5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5b56[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x65b5('0x0'));var util=require(_0x65b5('0x1'));var path=require(_0x65b5('0x2'));var timeout=require(_0x65b5('0x3'));var express=require('express');var router=express[_0x65b5('0x4')]();var fs_extra=require(_0x65b5('0x5'));var auth=require(_0x65b5('0x6'));var interaction=require(_0x65b5('0x7'));var config=require('../../config/environment');var controller=require(_0x65b5('0x8'));router['get']('/',auth[_0x65b5('0x9')](),controller[_0x65b5('0xa')]);router['get']('/:id',auth[_0x65b5('0x9')](),controller[_0x65b5('0xb')]);router['get']('/:id/hoppers',auth[_0x65b5('0x9')](),controller[_0x65b5('0xc')]);router['get'](_0x65b5('0xd'),auth[_0x65b5('0x9')](),controller[_0x65b5('0xe')]);router[_0x65b5('0xf')](_0x65b5('0x10'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x11')]);router['get'](_0x65b5('0x12'),auth['isAuthenticated'](),controller[_0x65b5('0x13')]);router[_0x65b5('0xf')](_0x65b5('0x14'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x15')]);router[_0x65b5('0xf')](_0x65b5('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x65b5('0x17')]('/',auth[_0x65b5('0x9')](),controller['create']);router[_0x65b5('0x17')](_0x65b5('0x18'),auth[_0x65b5('0x9')](),controller['clone']);router['post'](_0x65b5('0x14'),auth['isAuthenticated'](),controller[_0x65b5('0x19')]);router[_0x65b5('0x17')](_0x65b5('0x16'),auth[_0x65b5('0x9')](),controller['addBlackLists']);router[_0x65b5('0x1a')]('/:id',auth[_0x65b5('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x65b5('0x1b')](_0x65b5('0x14'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x1c')]);router['delete'](_0x65b5('0x16'),auth['isAuthenticated'](),controller[_0x65b5('0x1d')]);module[_0x65b5('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 60aacad..5aac073 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 _0xff67=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xff67,0x86));var _0x7ff6=function(_0x2b9638,_0x37e81f){_0x2b9638=_0x2b9638-0x0;var _0x58b5d2=_0xff67[_0x2b9638];return _0x58b5d2;};'use strict';var Sequelize=require('sequelize');module[_0x7ff6('0x0')]={'key':{'type':Sequelize[_0x7ff6('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7ff6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7ff6('0x1')]},'name':{'type':Sequelize[_0x7ff6('0x3')],'get':function(){return this[_0x7ff6('0x4')](_0x7ff6('0x5'));}}}; \ No newline at end of file +var _0x4861=['sequelize','STRING','TEXT','VIRTUAL','key'];(function(_0xc940bf,_0x4a378f){var _0x36e7f2=function(_0x2533c5){while(--_0x2533c5){_0xc940bf['push'](_0xc940bf['shift']());}};_0x36e7f2(++_0x4a378f);}(_0x4861,0x181));var _0x1486=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4861[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x1486('0x0'));module['exports']={'key':{'type':Sequelize[_0x1486('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1486('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1486('0x1')]},'name':{'type':Sequelize[_0x1486('0x3')],'get':function(){return this['getDataValue'](_0x1486('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7d6f4ef..43f8358 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 _0xa0b1=['filters','pick','filter','where','options','CannedAnswer','findAll','rows','catch','params','keys','includeAll','include','merge','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa0b1,0x128));var _0x1a0b=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0xa0b1[_0x3394a6];return _0x4a7909;};'use strict';var emlformat=require(_0x1a0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0b('0x2'));var moment=require(_0x1a0b('0x3'));var BPromise=require(_0x1a0b('0x4'));var Mustache=require(_0x1a0b('0x5'));var util=require(_0x1a0b('0x6'));var path=require(_0x1a0b('0x7'));var sox=require('sox');var csv=require(_0x1a0b('0x8'));var ejs=require(_0x1a0b('0x9'));var fs=require('fs');var fs_extra=require(_0x1a0b('0xa'));var _=require(_0x1a0b('0xb'));var squel=require(_0x1a0b('0xc'));var crypto=require(_0x1a0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a0b('0xe'));var toCsv=require(_0x1a0b('0x8'));var querystring=require(_0x1a0b('0xf'));var Papa=require(_0x1a0b('0x10'));var Redis=require(_0x1a0b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1a0b('0x12'));var as=require(_0x1a0b('0x13'));var hardwareService=require(_0x1a0b('0x14'));var logger=require(_0x1a0b('0x15'))(_0x1a0b('0x16'));var utils=require(_0x1a0b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1a0b('0x18'));var db=require(_0x1a0b('0x19'))['db'];function respondWithStatusCode(_0x2b1647,_0x3dc34f){_0x3dc34f=_0x3dc34f||0xcc;return function(_0x524fd1){if(_0x524fd1){return _0x2b1647[_0x1a0b('0x1a')](_0x3dc34f);}return _0x2b1647[_0x1a0b('0x1b')](_0x3dc34f)[_0x1a0b('0x1c')]();};}function respondWithResult(_0x2331be,_0x395202){_0x395202=_0x395202||0xc8;return function(_0x58eaa7){if(_0x58eaa7){return _0x2331be[_0x1a0b('0x1b')](_0x395202)[_0x1a0b('0x1d')](_0x58eaa7);}};}function respondWithFilteredResult(_0x144f49,_0x3bffde){return function(_0x5ad3bd){if(_0x5ad3bd){var _0x15c20e=typeof _0x3bffde[_0x1a0b('0x1e')]===_0x1a0b('0x1f')&&typeof _0x3bffde[_0x1a0b('0x20')]==='undefined';var _0x141858=_0x5ad3bd[_0x1a0b('0x21')];var _0x21f019=_0x15c20e?0x0:_0x3bffde[_0x1a0b('0x1e')];var _0x1447e2=_0x15c20e?_0x5ad3bd[_0x1a0b('0x21')]:_0x3bffde['offset']+_0x3bffde[_0x1a0b('0x20')];var _0x31b8a1;if(_0x1447e2>=_0x141858){_0x1447e2=_0x141858;_0x31b8a1=0xc8;}else{_0x31b8a1=0xce;}_0x144f49[_0x1a0b('0x1b')](_0x31b8a1);return _0x144f49['set'](_0x1a0b('0x22'),_0x21f019+'-'+_0x1447e2+'/'+_0x141858)[_0x1a0b('0x1d')](_0x5ad3bd);}return null;};}function patchUpdates(_0x36623b){return function(_0x22c64b){try{jsonpatch[_0x1a0b('0x23')](_0x22c64b,_0x36623b,!![]);}catch(_0x9c0631){return BPromise[_0x1a0b('0x24')](_0x9c0631);}return _0x22c64b['save']();};}function saveUpdates(_0x2ffd8d,_0x1f0e62){return function(_0x2ea48e){if(_0x2ea48e){return _0x2ea48e[_0x1a0b('0x25')](_0x2ffd8d)['then'](function(_0x39ccdb){return _0x39ccdb;});}return null;};}function removeEntity(_0x2d10ce,_0xc53c5c){return function(_0xb1bc82){if(_0xb1bc82){return _0xb1bc82[_0x1a0b('0x26')]()[_0x1a0b('0x27')](function(){var _0x1d535e=_0xb1bc82[_0x1a0b('0x28')]({'plain':!![]});var _0x5cdd89=_0x1a0b('0x29');return db[_0x1a0b('0x2a')][_0x1a0b('0x26')]({'where':{'type':_0x5cdd89,'resourceId':_0x1d535e['id']}})['then'](function(){return _0xb1bc82;});})[_0x1a0b('0x27')](function(){_0x2d10ce['status'](0xcc)[_0x1a0b('0x1c')]();});}};}function handleEntityNotFound(_0x5572f5,_0x18a68d){return function(_0x309b51){if(!_0x309b51){_0x5572f5[_0x1a0b('0x1a')](0x194);}return _0x309b51;};}function handleError(_0x51e90a,_0x12518e){_0x12518e=_0x12518e||0x1f4;return function(_0x5d7d56){logger[_0x1a0b('0x2b')](_0x5d7d56[_0x1a0b('0x2c')]);if(_0x5d7d56[_0x1a0b('0x2d')]){delete _0x5d7d56[_0x1a0b('0x2d')];}_0x51e90a[_0x1a0b('0x1b')](_0x12518e)['send'](_0x5d7d56);};}exports['index']=function(_0x529013,_0x2df315){var _0x3538d0={},_0x4b9644={},_0x22b8db={'count':0x0,'rows':[]};var _0x2e0e91=_[_0x1a0b('0x2e')](db['CannedAnswer'][_0x1a0b('0x2f')],function(_0x62451d){return{'name':_0x62451d[_0x1a0b('0x30')],'type':_0x62451d['type'][_0x1a0b('0x31')]};});_0x4b9644[_0x1a0b('0x32')]=_[_0x1a0b('0x2e')](_0x2e0e91,_0x1a0b('0x2d'));_0x4b9644['query']=_['keys'](_0x529013[_0x1a0b('0x33')]);_0x4b9644['filters']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],_0x4b9644[_0x1a0b('0x33')]);_0x3538d0['attributes']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],qs[_0x1a0b('0x35')](_0x529013[_0x1a0b('0x33')]['fields']));_0x3538d0[_0x1a0b('0x36')]=_0x3538d0['attributes'][_0x1a0b('0x37')]?_0x3538d0[_0x1a0b('0x36')]:_0x4b9644['model'];if(!_0x529013['query'][_0x1a0b('0x38')](_0x1a0b('0x39'))){_0x3538d0[_0x1a0b('0x20')]=qs['limit'](_0x529013[_0x1a0b('0x33')]['limit']);_0x3538d0[_0x1a0b('0x1e')]=qs[_0x1a0b('0x1e')](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x1e')]);}_0x3538d0[_0x1a0b('0x3a')]=qs['sort'](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3b')]);_0x3538d0['where']=qs[_0x1a0b('0x3c')](_[_0x1a0b('0x3d')](_0x529013[_0x1a0b('0x33')],_0x4b9644[_0x1a0b('0x3c')]),_0x2e0e91);if(_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]){_0x3538d0['where']=_['merge'](_0x3538d0[_0x1a0b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]+'%'}},{'value':{'$like':'%'+_0x529013[_0x1a0b('0x33')]['filter']+'%'}}]});}_0x3538d0=_['merge']({},_0x3538d0,_0x529013[_0x1a0b('0x40')]);var _0x268c51={'where':_0x3538d0[_0x1a0b('0x3f')]};return db[_0x1a0b('0x41')][_0x1a0b('0x21')](_0x268c51)[_0x1a0b('0x27')](function(_0x4a17b0){_0x22b8db[_0x1a0b('0x21')]=_0x4a17b0;if(_0x529013[_0x1a0b('0x33')]['includeAll']){_0x3538d0['include']=[{'all':!![]}];}return db[_0x1a0b('0x41')][_0x1a0b('0x42')](_0x3538d0);})[_0x1a0b('0x27')](function(_0x163e6b){_0x22b8db[_0x1a0b('0x43')]=_0x163e6b;return _0x22b8db;})[_0x1a0b('0x27')](respondWithFilteredResult(_0x2df315,_0x3538d0))[_0x1a0b('0x44')](handleError(_0x2df315,null));};exports['show']=function(_0x44860a,_0x288174){var _0x1e54dc={'raw':!![],'where':{'id':_0x44860a[_0x1a0b('0x45')]['id']}},_0x23ee18={};_0x23ee18[_0x1a0b('0x32')]=_[_0x1a0b('0x46')](db[_0x1a0b('0x41')]['rawAttributes']);_0x23ee18[_0x1a0b('0x33')]=_['keys'](_0x44860a[_0x1a0b('0x33')]);_0x23ee18['filters']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],_0x23ee18[_0x1a0b('0x33')]);_0x1e54dc['attributes']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],qs['fields'](_0x44860a[_0x1a0b('0x33')][_0x1a0b('0x35')]));_0x1e54dc[_0x1a0b('0x36')]=_0x1e54dc[_0x1a0b('0x36')][_0x1a0b('0x37')]?_0x1e54dc[_0x1a0b('0x36')]:_0x23ee18[_0x1a0b('0x32')];if(_0x44860a['query'][_0x1a0b('0x47')]){_0x1e54dc[_0x1a0b('0x48')]=[{'all':!![]}];}_0x1e54dc=_[_0x1a0b('0x49')]({},_0x1e54dc,_0x44860a[_0x1a0b('0x40')]);return db['CannedAnswer'][_0x1a0b('0x4a')](_0x1e54dc)[_0x1a0b('0x27')](handleEntityNotFound(_0x288174,null))['then'](respondWithResult(_0x288174,null))[_0x1a0b('0x44')](handleError(_0x288174,null));};exports['update']=function(_0x3a5ff2,_0x5959f5){if(_0x3a5ff2[_0x1a0b('0x4b')]['id']){delete _0x3a5ff2[_0x1a0b('0x4b')]['id'];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x3a5ff2[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x5959f5,null))[_0x1a0b('0x27')](saveUpdates(_0x3a5ff2[_0x1a0b('0x4b')],null))[_0x1a0b('0x27')](respondWithResult(_0x5959f5,null))['catch'](handleError(_0x5959f5,null));};exports[_0x1a0b('0x26')]=function(_0x26d3bb,_0x35c92e){return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x26d3bb[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x35c92e,null))[_0x1a0b('0x27')](removeEntity(_0x35c92e,null))[_0x1a0b('0x44')](handleError(_0x35c92e,null));};exports['create']=function(_0x41f977,_0x12f002){var _0x5ad145={'key':_0x41f977['body'][_0x1a0b('0x31')]};if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4c')]){_0x5ad145[_0x1a0b('0x4c')]=_0x41f977[_0x1a0b('0x4b')]['MailAccountId'];}else if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')]){_0x5ad145[_0x1a0b('0x4d')]=_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')];}else if(_0x41f977['body'][_0x1a0b('0x4e')]){_0x5ad145['OpenchannelAccountId']=_0x41f977[_0x1a0b('0x4b')]['OpenchannelAccountId'];}else if(_0x41f977['body'][_0x1a0b('0x4f')]){_0x5ad145[_0x1a0b('0x4f')]=_0x41f977['body'][_0x1a0b('0x4f')];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':_0x5ad145})[_0x1a0b('0x27')](function(_0x40ac6c){if(_0x40ac6c){throw new db['Sequelize'][(_0x1a0b('0x50'))](_0x1a0b('0x51'));}return db['CannedAnswer'][_0x1a0b('0x52')](_0x41f977['body']);})[_0x1a0b('0x27')](function(_0x33b2bd){var _0x2e7b88=_0x41f977[_0x1a0b('0x53')]['get']({'plain':!![]});if(!_0x2e7b88)throw new Error(_0x1a0b('0x54'));if(_0x2e7b88[_0x1a0b('0x55')]===_0x1a0b('0x53')){var _0x3ff29e=_0x33b2bd[_0x1a0b('0x28')]({'plain':!![]});return db[_0x1a0b('0x56')][_0x1a0b('0x4a')]({'where':{'name':_0x1a0b('0x29'),'userProfileId':_0x2e7b88[_0x1a0b('0x57')]},'raw':!![]})['then'](function(_0x3fee5a){if(_0x3fee5a&&_0x3fee5a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a0b('0x52')]({'name':_0x3ff29e['name'],'resourceId':_0x3ff29e['id'],'type':_0x3fee5a[_0x1a0b('0x2d')],'sectionId':_0x3fee5a['id']},{})[_0x1a0b('0x27')](function(){return _0x33b2bd;});}else{return _0x33b2bd;}})['catch'](function(_0x56e434){logger[_0x1a0b('0x2b')](_0x1a0b('0x58'),_0x56e434);throw _0x56e434;});}return _0x33b2bd;})[_0x1a0b('0x27')](respondWithResult(_0x12f002,0xc9))[_0x1a0b('0x44')](handleError(_0x12f002,null));}; \ No newline at end of file +var _0xccb0=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','options','include','findAll','rows','catch','show','params','includeAll','merge','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','role'];(function(_0x238703,_0xaeb1ce){var _0x2748ab=function(_0x213933){while(--_0x213933){_0x238703['push'](_0x238703['shift']());}};_0x2748ab(++_0xaeb1ce);}(_0xccb0,0x105));var _0x0ccb=function(_0x591ac2,_0x37a6de){_0x591ac2=_0x591ac2-0x0;var _0xb2d743=_0xccb0[_0x591ac2];return _0xb2d743;};'use strict';var emlformat=require(_0x0ccb('0x0'));var rimraf=require(_0x0ccb('0x1'));var zipdir=require(_0x0ccb('0x2'));var jsonpatch=require(_0x0ccb('0x3'));var rp=require(_0x0ccb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0ccb('0x5'));var util=require(_0x0ccb('0x6'));var path=require(_0x0ccb('0x7'));var sox=require(_0x0ccb('0x8'));var csv=require(_0x0ccb('0x9'));var ejs=require(_0x0ccb('0xa'));var fs=require('fs');var fs_extra=require(_0x0ccb('0xb'));var _=require('lodash');var squel=require(_0x0ccb('0xc'));var crypto=require(_0x0ccb('0xd'));var jsforce=require(_0x0ccb('0xe'));var deskjs=require(_0x0ccb('0xf'));var toCsv=require(_0x0ccb('0x9'));var querystring=require(_0x0ccb('0x10'));var Papa=require('papaparse');var Redis=require(_0x0ccb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ccb('0x12'));var hardwareService=require(_0x0ccb('0x13'));var logger=require(_0x0ccb('0x14'))(_0x0ccb('0x15'));var utils=require('../../config/utils');var config=require(_0x0ccb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ccb('0x17'))['db'];function respondWithStatusCode(_0x28c984,_0x3417bd){_0x3417bd=_0x3417bd||0xcc;return function(_0x453e1c){if(_0x453e1c){return _0x28c984['sendStatus'](_0x3417bd);}return _0x28c984[_0x0ccb('0x18')](_0x3417bd)[_0x0ccb('0x19')]();};}function respondWithResult(_0x447198,_0x3ef2b6){_0x3ef2b6=_0x3ef2b6||0xc8;return function(_0x50507d){if(_0x50507d){return _0x447198['status'](_0x3ef2b6)['json'](_0x50507d);}};}function respondWithFilteredResult(_0x3fb15b,_0x470db7){return function(_0x121369){if(_0x121369){var _0x3e47a3=typeof _0x470db7['offset']===_0x0ccb('0x1a')&&typeof _0x470db7[_0x0ccb('0x1b')]===_0x0ccb('0x1a');var _0x2757cb=_0x121369[_0x0ccb('0x1c')];var _0x568a1e=_0x3e47a3?0x0:_0x470db7[_0x0ccb('0x1d')];var _0x571f0d=_0x3e47a3?_0x121369['count']:_0x470db7[_0x0ccb('0x1d')]+_0x470db7['limit'];var _0x103ae2;if(_0x571f0d>=_0x2757cb){_0x571f0d=_0x2757cb;_0x103ae2=0xc8;}else{_0x103ae2=0xce;}_0x3fb15b[_0x0ccb('0x18')](_0x103ae2);return _0x3fb15b[_0x0ccb('0x1e')](_0x0ccb('0x1f'),_0x568a1e+'-'+_0x571f0d+'/'+_0x2757cb)[_0x0ccb('0x20')](_0x121369);}return null;};}function patchUpdates(_0x483a27){return function(_0x2102d8){try{jsonpatch[_0x0ccb('0x21')](_0x2102d8,_0x483a27,!![]);}catch(_0x1bce8b){return BPromise[_0x0ccb('0x22')](_0x1bce8b);}return _0x2102d8[_0x0ccb('0x23')]();};}function saveUpdates(_0x1baee2,_0x57a191){return function(_0x2c6762){if(_0x2c6762){return _0x2c6762[_0x0ccb('0x24')](_0x1baee2)[_0x0ccb('0x25')](function(_0x261cdf){return _0x261cdf;});}return null;};}function removeEntity(_0x48a6fa,_0x258439){return function(_0x3f68e5){if(_0x3f68e5){return _0x3f68e5['destroy']()['then'](function(){var _0x54ace8=_0x3f68e5[_0x0ccb('0x26')]({'plain':!![]});var _0x585171=_0x0ccb('0x27');return db[_0x0ccb('0x28')][_0x0ccb('0x29')]({'where':{'type':_0x585171,'resourceId':_0x54ace8['id']}})['then'](function(){return _0x3f68e5;});})[_0x0ccb('0x25')](function(){_0x48a6fa['status'](0xcc)[_0x0ccb('0x19')]();});}};}function handleEntityNotFound(_0x1e73be,_0x3c116c){return function(_0x10c8f8){if(!_0x10c8f8){_0x1e73be[_0x0ccb('0x2a')](0x194);}return _0x10c8f8;};}function handleError(_0x513a2e,_0x154da6){_0x154da6=_0x154da6||0x1f4;return function(_0x3bcade){logger[_0x0ccb('0x2b')](_0x3bcade['stack']);if(_0x3bcade[_0x0ccb('0x2c')]){delete _0x3bcade[_0x0ccb('0x2c')];}_0x513a2e[_0x0ccb('0x18')](_0x154da6)[_0x0ccb('0x2d')](_0x3bcade);};}exports[_0x0ccb('0x2e')]=function(_0x4bbd4e,_0x1f46f3){var _0x3314bb={},_0x525dd1={},_0xb792d5={'count':0x0,'rows':[]};var _0x1c1147=_[_0x0ccb('0x2f')](db[_0x0ccb('0x30')][_0x0ccb('0x31')],function(_0x2352ef){return{'name':_0x2352ef[_0x0ccb('0x32')],'type':_0x2352ef[_0x0ccb('0x33')]['key']};});_0x525dd1['model']=_[_0x0ccb('0x2f')](_0x1c1147,_0x0ccb('0x2c'));_0x525dd1[_0x0ccb('0x34')]=_[_0x0ccb('0x35')](_0x4bbd4e['query']);_0x525dd1[_0x0ccb('0x36')]=_[_0x0ccb('0x37')](_0x525dd1[_0x0ccb('0x38')],_0x525dd1[_0x0ccb('0x34')]);_0x3314bb[_0x0ccb('0x39')]=_[_0x0ccb('0x37')](_0x525dd1[_0x0ccb('0x38')],qs[_0x0ccb('0x3a')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3a')]));_0x3314bb[_0x0ccb('0x39')]=_0x3314bb['attributes']['length']?_0x3314bb['attributes']:_0x525dd1[_0x0ccb('0x38')];if(!_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3b')]('nolimit')){_0x3314bb['limit']=qs['limit'](_0x4bbd4e['query'][_0x0ccb('0x1b')]);_0x3314bb['offset']=qs[_0x0ccb('0x1d')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x1d')]);}_0x3314bb['order']=qs[_0x0ccb('0x3c')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3c')]);_0x3314bb[_0x0ccb('0x3d')]=qs[_0x0ccb('0x36')](_[_0x0ccb('0x3e')](_0x4bbd4e[_0x0ccb('0x34')],_0x525dd1[_0x0ccb('0x36')]),_0x1c1147);if(_0x4bbd4e['query'][_0x0ccb('0x3f')]){_0x3314bb[_0x0ccb('0x3d')]=_['merge'](_0x3314bb[_0x0ccb('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4bbd4e['query'][_0x0ccb('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3f')]+'%'}}]});}_0x3314bb=_['merge']({},_0x3314bb,_0x4bbd4e[_0x0ccb('0x40')]);var _0x1cb730={'where':_0x3314bb[_0x0ccb('0x3d')]};return db[_0x0ccb('0x30')]['count'](_0x1cb730)[_0x0ccb('0x25')](function(_0x408d3e){_0xb792d5[_0x0ccb('0x1c')]=_0x408d3e;if(_0x4bbd4e[_0x0ccb('0x34')]['includeAll']){_0x3314bb[_0x0ccb('0x41')]=[{'all':!![]}];}return db[_0x0ccb('0x30')][_0x0ccb('0x42')](_0x3314bb);})[_0x0ccb('0x25')](function(_0x5095c7){_0xb792d5[_0x0ccb('0x43')]=_0x5095c7;return _0xb792d5;})[_0x0ccb('0x25')](respondWithFilteredResult(_0x1f46f3,_0x3314bb))[_0x0ccb('0x44')](handleError(_0x1f46f3,null));};exports[_0x0ccb('0x45')]=function(_0x5e1a70,_0x1d783f){var _0xb793b2={'raw':!![],'where':{'id':_0x5e1a70[_0x0ccb('0x46')]['id']}},_0x3fb85c={};_0x3fb85c[_0x0ccb('0x38')]=_[_0x0ccb('0x35')](db['CannedAnswer']['rawAttributes']);_0x3fb85c[_0x0ccb('0x34')]=_[_0x0ccb('0x35')](_0x5e1a70[_0x0ccb('0x34')]);_0x3fb85c[_0x0ccb('0x36')]=_[_0x0ccb('0x37')](_0x3fb85c[_0x0ccb('0x38')],_0x3fb85c['query']);_0xb793b2[_0x0ccb('0x39')]=_[_0x0ccb('0x37')](_0x3fb85c[_0x0ccb('0x38')],qs[_0x0ccb('0x3a')](_0x5e1a70[_0x0ccb('0x34')][_0x0ccb('0x3a')]));_0xb793b2[_0x0ccb('0x39')]=_0xb793b2['attributes']['length']?_0xb793b2['attributes']:_0x3fb85c['model'];if(_0x5e1a70['query'][_0x0ccb('0x47')]){_0xb793b2[_0x0ccb('0x41')]=[{'all':!![]}];}_0xb793b2=_[_0x0ccb('0x48')]({},_0xb793b2,_0x5e1a70['options']);return db[_0x0ccb('0x30')][_0x0ccb('0x49')](_0xb793b2)['then'](handleEntityNotFound(_0x1d783f,null))[_0x0ccb('0x25')](respondWithResult(_0x1d783f,null))[_0x0ccb('0x44')](handleError(_0x1d783f,null));};exports['update']=function(_0x4b8943,_0xd596d7){if(_0x4b8943[_0x0ccb('0x4a')]['id']){delete _0x4b8943[_0x0ccb('0x4a')]['id'];}return db[_0x0ccb('0x30')][_0x0ccb('0x49')]({'where':{'id':_0x4b8943[_0x0ccb('0x46')]['id']}})['then'](handleEntityNotFound(_0xd596d7,null))[_0x0ccb('0x25')](saveUpdates(_0x4b8943[_0x0ccb('0x4a')],null))['then'](respondWithResult(_0xd596d7,null))[_0x0ccb('0x44')](handleError(_0xd596d7,null));};exports[_0x0ccb('0x29')]=function(_0x2fe5ce,_0x460a57){return db[_0x0ccb('0x30')][_0x0ccb('0x49')]({'where':{'id':_0x2fe5ce[_0x0ccb('0x46')]['id']}})[_0x0ccb('0x25')](handleEntityNotFound(_0x460a57,null))['then'](removeEntity(_0x460a57,null))[_0x0ccb('0x44')](handleError(_0x460a57,null));};exports[_0x0ccb('0x4b')]=function(_0x470006,_0x86b34b){var _0x5338cd={'key':_0x470006[_0x0ccb('0x4a')]['key']};if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4c')]){_0x5338cd['MailAccountId']=_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4c')];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4d')]){_0x5338cd[_0x0ccb('0x4d')]=_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4d')];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4e')]){_0x5338cd[_0x0ccb('0x4e')]=_0x470006['body']['OpenchannelAccountId'];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4f')]){_0x5338cd['ChatWebsiteId']=_0x470006[_0x0ccb('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x0ccb('0x49')]({'where':_0x5338cd})[_0x0ccb('0x25')](function(_0x5c13bd){if(_0x5c13bd){throw new db[(_0x0ccb('0x50'))]['ValidationError'](_0x0ccb('0x51'));}return db[_0x0ccb('0x30')]['create'](_0x470006['body']);})['then'](function(_0x34653c){var _0x4662af=_0x470006['user'][_0x0ccb('0x26')]({'plain':!![]});if(!_0x4662af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4662af[_0x0ccb('0x52')]==='user'){var _0x171afe=_0x34653c['get']({'plain':!![]});return db['UserProfileSection'][_0x0ccb('0x49')]({'where':{'name':_0x0ccb('0x27'),'userProfileId':_0x4662af[_0x0ccb('0x53')]},'raw':!![]})[_0x0ccb('0x25')](function(_0x388188){if(_0x388188&&_0x388188[_0x0ccb('0x54')]===0x0){return db[_0x0ccb('0x28')][_0x0ccb('0x4b')]({'name':_0x171afe['name'],'resourceId':_0x171afe['id'],'type':_0x388188[_0x0ccb('0x2c')],'sectionId':_0x388188['id']},{})[_0x0ccb('0x25')](function(){return _0x34653c;});}else{return _0x34653c;}})[_0x0ccb('0x44')](function(_0xb69888){logger[_0x0ccb('0x2b')](_0x0ccb('0x55'),_0xb69888);throw _0xb69888;});}return _0x34653c;})[_0x0ccb('0x25')](respondWithResult(_0x86b34b,0xc9))[_0x0ccb('0x44')](handleError(_0x86b34b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 5045c27..beee185 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 _0x8d84=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x8d84,0xfe));var _0x48d8=function(_0x35ff48,_0x50592f){_0x35ff48=_0x35ff48-0x0;var _0x2ab29f=_0x8d84[_0x35ff48];return _0x2ab29f;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x48d8('0x3'));var rp=require(_0x48d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d8('0x5'));var config=require(_0x48d8('0x6'));var attributes=require(_0x48d8('0x7'));module[_0x48d8('0x8')]=function(_0x3f1843,_0x8c1e97){return _0x3f1843[_0x48d8('0x9')](_0x48d8('0xa'),attributes,{'tableName':_0x48d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48d8('0xc'),'collate':_0x48d8('0xd')});}; \ No newline at end of file +var _0x7dcc=['util','api','moment','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7dcc,0xfc));var _0xc7dc=function(_0x1780ec,_0x3af2fa){_0x1780ec=_0x1780ec-0x0;var _0x5c5663=_0x7dcc[_0x1780ec];return _0x5c5663;};'use strict';var _=require('lodash');var util=require(_0xc7dc('0x0'));var logger=require('../../config/logger')(_0xc7dc('0x1'));var moment=require(_0xc7dc('0x2'));var BPromise=require('bluebird');var rp=require(_0xc7dc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7dc('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7dc('0x5'));module[_0xc7dc('0x6')]=function(_0x145872,_0x407e3d){return _0x145872[_0xc7dc('0x7')](_0xc7dc('0x8'),attributes,{'tableName':_0xc7dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7dc('0xa'),'collate':_0xc7dc('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index aab88ca..607be17 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(_0x37350a,_0x400d32){var _0x43312a=function(_0x5173ab){while(--_0x5173ab){_0x37350a['push'](_0x37350a['shift']());}};_0x43312a(++_0x400d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x538643,_0x19cc4d){var _0x3cf145=function(_0x176966){while(--_0x176966){_0x538643['push'](_0x538643['shift']());}};_0x3cf145(++_0x19cc4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 eab4542..c944a64 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 _0x0c56=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x25cb0a,_0x549fda){var _0x5483ac=function(_0x32eaa6){while(--_0x32eaa6){_0x25cb0a['push'](_0x25cb0a['shift']());}};_0x5483ac(++_0x549fda);}(_0x0c56,0x12b));var _0x60c5=function(_0x4fa8f2,_0x56d32d){_0x4fa8f2=_0x4fa8f2-0x0;var _0xbf88da=_0x0c56[_0x4fa8f2];return _0xbf88da;};'use strict';var multer=require(_0x60c5('0x0'));var util=require(_0x60c5('0x1'));var path=require('path');var timeout=require(_0x60c5('0x2'));var express=require(_0x60c5('0x3'));var router=express[_0x60c5('0x4')]();var fs_extra=require(_0x60c5('0x5'));var auth=require(_0x60c5('0x6'));var interaction=require(_0x60c5('0x7'));var config=require('../../config/environment');var controller=require(_0x60c5('0x8'));router[_0x60c5('0x9')]('/',auth[_0x60c5('0xa')](),controller[_0x60c5('0xb')]);router['get'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60c5('0xe')]);router[_0x60c5('0xf')](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x10')]);router['delete'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x11')]);module[_0x60c5('0x12')]=router; \ No newline at end of file +var _0x292a=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','exports','path','connect-timeout','../../components/auth/service'];(function(_0x51921f,_0x42bde0){var _0x41743a=function(_0x27105d){while(--_0x27105d){_0x51921f['push'](_0x51921f['shift']());}};_0x41743a(++_0x42bde0);}(_0x292a,0x8d));var _0xa292=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x292a[_0x1be3b3];return _0x4f8b2d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa292('0x0'));var timeout=require(_0xa292('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa292('0x2'));var interaction=require(_0xa292('0x3'));var config=require(_0xa292('0x4'));var controller=require(_0xa292('0x5'));router[_0xa292('0x6')]('/',auth['isAuthenticated'](),controller[_0xa292('0x7')]);router['get']('/:id',auth[_0xa292('0x8')](),controller[_0xa292('0x9')]);router[_0xa292('0xa')]('/',auth['isAuthenticated'](),controller[_0xa292('0xb')]);router['put'](_0xa292('0xc'),auth['isAuthenticated'](),controller[_0xa292('0xd')]);router[_0xa292('0xe')](_0xa292('0xc'),auth[_0xa292('0x8')](),controller['destroy']);module[_0xa292('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ce9d00e..7537311 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 _0xffaa=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x1e3c58,_0x4baead){var _0x2cd780=function(_0x2e4fe1){while(--_0x2e4fe1){_0x1e3c58['push'](_0x1e3c58['shift']());}};_0x2cd780(++_0x4baead);}(_0xffaa,0x130));var _0xaffa=function(_0x36510e,_0x148437){_0x36510e=_0x36510e-0x0;var _0xe732fd=_0xffaa[_0x36510e];return _0xe732fd;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'calldate':{'type':Sequelize[_0xaffa('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xaffa('0x3')]},'dst':{'type':Sequelize[_0xaffa('0x3')]},'dcontext':{'type':Sequelize[_0xaffa('0x3')]},'channel':{'type':Sequelize[_0xaffa('0x3')]},'dstchannel':{'type':Sequelize[_0xaffa('0x3')]},'lastapp':{'type':Sequelize[_0xaffa('0x3')]},'lastdata':{'type':Sequelize[_0xaffa('0x3')]},'duration':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaffa('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaffa('0x3')]},'userfield':{'type':Sequelize[_0xaffa('0x3')]},'uniqueid':{'type':Sequelize[_0xaffa('0x3')]},'linkedid':{'type':Sequelize[_0xaffa('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xaffa('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xaffa('0x3')]}}; \ No newline at end of file +var _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0xa4cc47,_0x4b2cb9){var _0x280d8f=function(_0x5d5895){while(--_0x5d5895){_0xa4cc47['push'](_0xa4cc47['shift']());}};_0x280d8f(++_0x4b2cb9);}(_0x53a6,0x18f));var _0x653a=function(_0x21138e,_0x3f8f75){_0x21138e=_0x21138e-0x0;var _0x43116a=_0x53a6[_0x21138e];return _0x43116a;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 11e9f66..37cf694 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 _0x5fd1=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Cdr','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x13ee86,_0x501a7f){var _0x377722=function(_0x20ae4b){while(--_0x20ae4b){_0x13ee86['push'](_0x13ee86['shift']());}};_0x377722(++_0x501a7f);}(_0x5fd1,0x155));var _0x15fd=function(_0x2eff2d,_0x54ad03){_0x2eff2d=_0x2eff2d-0x0;var _0x48e190=_0x5fd1[_0x2eff2d];return _0x48e190;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['map'](_0x4590a1,_0x15fd('0x23'));_0x218034[_0x15fd('0x2b')]=_['keys'](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x218034[_0x15fd('0x2a')],_0x218034[_0x15fd('0x2b')]);_0x6c213b[_0x15fd('0x2e')]=_['intersection'](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x2f')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x2f')]));_0x6c213b['attributes']=_0x6c213b[_0x15fd('0x2e')][_0x15fd('0x30')]?_0x6c213b[_0x15fd('0x2e')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x31')]('nolimit')){_0x6c213b[_0x15fd('0x19')]=qs[_0x15fd('0x19')](_0x27d2c4['query'][_0x15fd('0x19')]);_0x6c213b[_0x15fd('0x1a')]=qs[_0x15fd('0x1a')](_0x27d2c4['query'][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x33')]);_0x6c213b[_0x15fd('0x34')]=qs['filters'](_['pick'](_0x27d2c4['query'],_0x218034[_0x15fd('0x2c')]),_0x4590a1);if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x35')]){_0x6c213b['where']=_['merge'](_0x6c213b[_0x15fd('0x34')],{'$or':_['map'](_0x4590a1,function(_0x4f1c84){if(_0x4f1c84['type']!==_0x15fd('0x36')){var _0x10702c={};_0x10702c[_0x4f1c84[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4['query'][_0x15fd('0x35')]+'%'};return _0x10702c;}})});}_0x6c213b=_[_0x15fd('0x37')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x38')]);var _0x5beb6e={'where':_0x6c213b[_0x15fd('0x34')]};return db[_0x15fd('0x27')][_0x15fd('0x39')](_0x5beb6e)[_0x15fd('0x1f')](function(_0x2e8b0a){_0xe650a3[_0x15fd('0x39')]=_0x2e8b0a;if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x6c213b[_0x15fd('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x15fd('0x3c')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x180433){_0xe650a3[_0x15fd('0x3d')]=_0x180433;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x3e')](handleError(_0x233ed3,null));};exports[_0x15fd('0x3f')]=function(_0xda4ca2,_0x343ce6){var _0x104eef={'raw':!![],'where':{'id':_0xda4ca2[_0x15fd('0x40')]['id']}},_0x2eb6b6={};_0x2eb6b6[_0x15fd('0x2a')]=_[_0x15fd('0x41')](db[_0x15fd('0x27')]['rawAttributes']);_0x2eb6b6[_0x15fd('0x2b')]=_[_0x15fd('0x41')](_0xda4ca2[_0x15fd('0x2b')]);_0x2eb6b6[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x2eb6b6[_0x15fd('0x2a')],_0x2eb6b6[_0x15fd('0x2b')]);_0x104eef[_0x15fd('0x2e')]=_['intersection'](_0x2eb6b6['model'],qs[_0x15fd('0x2f')](_0xda4ca2['query'][_0x15fd('0x2f')]));_0x104eef[_0x15fd('0x2e')]=_0x104eef['attributes'][_0x15fd('0x30')]?_0x104eef[_0x15fd('0x2e')]:_0x2eb6b6[_0x15fd('0x2a')];if(_0xda4ca2[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x104eef[_0x15fd('0x3b')]=[{'all':!![]}];}_0x104eef=_['merge']({},_0x104eef,_0xda4ca2[_0x15fd('0x38')]);return db[_0x15fd('0x27')][_0x15fd('0x42')](_0x104eef)[_0x15fd('0x1f')](handleEntityNotFound(_0x343ce6,null))[_0x15fd('0x1f')](respondWithResult(_0x343ce6,null))[_0x15fd('0x3e')](handleError(_0x343ce6,null));};exports[_0x15fd('0x43')]=function(_0xffc5dc,_0x24cb44){return db[_0x15fd('0x27')][_0x15fd('0x43')](_0xffc5dc[_0x15fd('0x44')],{})['then'](respondWithResult(_0x24cb44,0xc9))[_0x15fd('0x3e')](handleError(_0x24cb44,null));};exports['update']=function(_0x284f51,_0x34c250){if(_0x284f51[_0x15fd('0x44')]['id']){delete _0x284f51['body']['id'];}return db[_0x15fd('0x27')][_0x15fd('0x42')]({'where':{'id':_0x284f51[_0x15fd('0x40')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x34c250,null))['then'](saveUpdates(_0x284f51[_0x15fd('0x44')],null))[_0x15fd('0x1f')](respondWithResult(_0x34c250,null))[_0x15fd('0x3e')](handleError(_0x34c250,null));};exports[_0x15fd('0x20')]=function(_0x4b6827,_0x56c6be){return db[_0x15fd('0x27')]['find']({'where':{'id':_0x4b6827['params']['id']}})['then'](handleEntityNotFound(_0x56c6be,null))[_0x15fd('0x1f')](removeEntity(_0x56c6be,null))[_0x15fd('0x3e')](handleError(_0x56c6be,null));};exports[_0x15fd('0x45')]=function(_0x10cf04,_0x292174){return db[_0x15fd('0x27')]['describe']()[_0x15fd('0x1f')](respondWithResult(_0x292174,null))[_0x15fd('0x3e')](handleError(_0x292174,null));}; \ No newline at end of file +var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf767,0x76));var _0x7f76=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xf767[_0x46361e];return _0x14e302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 3743ec4..5eefa3c 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x7e27c6,_0x16811a){var _0x4efe01=function(_0x466a72){while(--_0x466a72){_0x7e27c6['push'](_0x7e27c6['shift']());}};_0x4efe01(++_0x16811a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x21c23e,_0x1d33e3){var _0xa7b7e2=function(_0x6ac2a8){while(--_0x6ac2a8){_0x21c23e['push'](_0x21c23e['shift']());}};_0xa7b7e2(++_0x1d33e3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f452038..e7e2f57 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 _0x9df4=['jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9df4,0x174));var _0x49df=function(_0x60369b,_0x525315){_0x60369b=_0x60369b-0x0;var _0x3c9e8e=_0x9df4[_0x60369b];return _0x3c9e8e;};'use strict';var _=require(_0x49df('0x0'));var util=require(_0x49df('0x1'));var moment=require(_0x49df('0x2'));var BPromise=require(_0x49df('0x3'));var rs=require(_0x49df('0x4'));var fs=require('fs');var Redis=require(_0x49df('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49df('0x6'))('rpc');var config=require(_0x49df('0x7'));var jayson=require(_0x49df('0x8'));var client=jayson['client'][_0x49df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f54fc,_0x5b9cba,_0x371b9a){return new BPromise(function(_0x183488,_0x2d6324){return client[_0x49df('0xa')](_0x5f54fc,_0x371b9a)[_0x49df('0xb')](function(_0x1a28d7){logger[_0x49df('0xc')]('Cdr,\x20%s,\x20%s',_0x5b9cba,'request\x20sent');logger[_0x49df('0xd')](_0x49df('0xe'),_0x5b9cba,'request\x20sent',JSON['stringify'](_0x1a28d7));if(_0x1a28d7['error']){if(_0x1a28d7[_0x49df('0xf')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7['error'][_0x49df('0x10')]);return _0x2d6324(_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);}logger[_0x49df('0xf')]('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);return _0x183488(_0x1a28d7[_0x49df('0xf')]['message']);}else{logger[_0x49df('0xc')](_0x49df('0x11'),_0x5b9cba,'request\x20sent');_0x183488(_0x1a28d7[_0x49df('0x12')][_0x49df('0x10')]);}})[_0x49df('0x13')](function(_0x33abd3){logger[_0x49df('0xf')](_0x49df('0x11'),_0x5b9cba,_0x33abd3);_0x2d6324(_0x33abd3);});});} \ No newline at end of file +var _0x9f5c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9f5c,0xd0));var _0xc9f5=function(_0x55cc32,_0x4eecea){_0x55cc32=_0x55cc32-0x0;var _0x5eceef=_0x9f5c[_0x55cc32];return _0x5eceef;};'use strict';var _=require('lodash');var util=require(_0xc9f5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc9f5('0x1'));var fs=require('fs');var Redis=require(_0xc9f5('0x2'));var db=require(_0xc9f5('0x3'))['db'];var utils=require(_0xc9f5('0x4'));var logger=require(_0xc9f5('0x5'))('rpc');var config=require(_0xc9f5('0x6'));var jayson=require(_0xc9f5('0x7'));var client=jayson['client'][_0xc9f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c169a,_0x4e2412,_0x428b1b){return new BPromise(function(_0x164071,_0xe815cd){return client[_0xc9f5('0x9')](_0x5c169a,_0x428b1b)[_0xc9f5('0xa')](function(_0x5b4735){logger[_0xc9f5('0xb')](_0xc9f5('0xc'),_0x4e2412,_0xc9f5('0xd'));logger[_0xc9f5('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4e2412,_0xc9f5('0xd'),JSON[_0xc9f5('0xf')](_0x5b4735));if(_0x5b4735[_0xc9f5('0x10')]){if(_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x11')]===0x1f4){logger[_0xc9f5('0x10')]('Cdr,\x20%s,\x20%s',_0x4e2412,_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x12')]);return _0xe815cd(_0x5b4735[_0xc9f5('0x10')]['message']);}logger[_0xc9f5('0x10')](_0xc9f5('0xc'),_0x4e2412,_0x5b4735['error'][_0xc9f5('0x12')]);return _0x164071(_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x12')]);}else{logger['info'](_0xc9f5('0xc'),_0x4e2412,_0xc9f5('0xd'));_0x164071(_0x5b4735[_0xc9f5('0x13')]['message']);}})[_0xc9f5('0x14')](function(_0x4c7243){logger[_0xc9f5('0x10')](_0xc9f5('0xc'),_0x4e2412,_0x4c7243);_0xe815cd(_0x4c7243);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 30697e4..1411c58 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(_0x530ddb,_0x3008f8){var _0x4fa295=function(_0x552364){while(--_0x552364){_0x530ddb['push'](_0x530ddb['shift']());}};_0x4fa295(++_0x3008f8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2cdd4d,_0x394c2f){var _0x55cbc8=function(_0x3b92cb){while(--_0x3b92cb){_0x2cdd4d['push'](_0x2cdd4d['shift']());}};_0x55cbc8(++_0x394c2f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e30946c..91f331f 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 _0x9c3f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x9c3f,0xbb));var _0xf9c3=function(_0x1b3e4a,_0x4f5a24){_0x1b3e4a=_0x1b3e4a-0x0;var _0x1d0eed=_0x9c3f[_0x1b3e4a];return _0x1d0eed;};'use strict';var Sequelize=require(_0xf9c3('0x0'));module[_0xf9c3('0x1')]={'priority':{'type':Sequelize[_0xf9c3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf9c3('0x3')],'allowNull':![],'defaultValue':_0xf9c3('0x4')},'appdata':{'type':Sequelize[_0xf9c3('0x5')]()},'description':{'type':Sequelize[_0xf9c3('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3ba9=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x15e45d,_0x5b6683){var _0x22fc0e=function(_0x58da9e){while(--_0x58da9e){_0x15e45d['push'](_0x15e45d['shift']());}};_0x22fc0e(++_0x5b6683);}(_0x3ba9,0xf8));var _0x93ba=function(_0x283f13,_0x37160e){_0x283f13=_0x283f13-0x0;var _0x3d469f=_0x3ba9[_0x283f13];return _0x3d469f;};'use strict';var Sequelize=require(_0x93ba('0x0'));module['exports']={'priority':{'type':Sequelize[_0x93ba('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x93ba('0x2')],'allowNull':![],'defaultValue':_0x93ba('0x3')},'appdata':{'type':Sequelize[_0x93ba('0x4')]()},'description':{'type':Sequelize[_0x93ba('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 492e388..2006ecd 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 _0x9649=['show','params','model','keys','query','attributes','fields','include','merge','options','find','catch','update','body','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','error','stack','send'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9649,0x118));var _0x9964=function(_0x4adbbc,_0x2b98ce){_0x4adbbc=_0x4adbbc-0x0;var _0x3b9187=_0x9649[_0x4adbbc];return _0x3b9187;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6ff,_0x4ef5c5){_0x4ef5c5=_0x4ef5c5||0xcc;return function(_0x1b8afa){if(_0x1b8afa){return _0x2bd6ff[_0x9964('0x16')](_0x4ef5c5);}return _0x2bd6ff[_0x9964('0x17')](_0x4ef5c5)[_0x9964('0x18')]();};}function respondWithResult(_0x22f5ce,_0x360a02){_0x360a02=_0x360a02||0xc8;return function(_0x44ce20){if(_0x44ce20){return _0x22f5ce['status'](_0x360a02)['json'](_0x44ce20);}};}function respondWithFilteredResult(_0x37f137,_0x2be683){return function(_0x561571){if(_0x561571){var _0x416340=typeof _0x2be683[_0x9964('0x19')]===_0x9964('0x1a')&&typeof _0x2be683[_0x9964('0x1b')]===_0x9964('0x1a');var _0x2c12f8=_0x561571['count'];var _0x2a7a61=_0x416340?0x0:_0x2be683[_0x9964('0x19')];var _0x58f157=_0x416340?_0x561571['count']:_0x2be683['offset']+_0x2be683[_0x9964('0x1b')];var _0xc4c0fe;if(_0x58f157>=_0x2c12f8){_0x58f157=_0x2c12f8;_0xc4c0fe=0xc8;}else{_0xc4c0fe=0xce;}_0x37f137[_0x9964('0x17')](_0xc4c0fe);return _0x37f137[_0x9964('0x1c')]('Content-Range',_0x2a7a61+'-'+_0x58f157+'/'+_0x2c12f8)[_0x9964('0x1d')](_0x561571);}return null;};}function patchUpdates(_0x5f2bbd){return function(_0x470a8d){try{jsonpatch[_0x9964('0x1e')](_0x470a8d,_0x5f2bbd,!![]);}catch(_0x209929){return BPromise[_0x9964('0x1f')](_0x209929);}return _0x470a8d[_0x9964('0x20')]();};}function saveUpdates(_0xea9fc2,_0x4053ad){return function(_0x341c56){if(_0x341c56){return _0x341c56['update'](_0xea9fc2)[_0x9964('0x21')](function(_0x3069d7){return _0x3069d7;});}return null;};}function removeEntity(_0x1629f9,_0x30ccf7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x9964('0x22')]()[_0x9964('0x21')](function(){_0x1629f9[_0x9964('0x17')](0xcc)[_0x9964('0x18')]();});}};}function handleEntityNotFound(_0x4be822,_0x5d4a5e){return function(_0x3911e0){if(!_0x3911e0){_0x4be822[_0x9964('0x16')](0x194);}return _0x3911e0;};}function handleError(_0x2dafcc,_0x96bee0){_0x96bee0=_0x96bee0||0x1f4;return function(_0xd48c01){logger[_0x9964('0x23')](_0xd48c01[_0x9964('0x24')]);if(_0xd48c01['name']){delete _0xd48c01['name'];}_0x2dafcc[_0x9964('0x17')](_0x96bee0)[_0x9964('0x25')](_0xd48c01);};}exports[_0x9964('0x26')]=function(_0x16ec83,_0x47d0d4){var _0x201656={'raw':!![],'where':{'id':_0x16ec83[_0x9964('0x27')]['id']}},_0x3a59df={};_0x3a59df[_0x9964('0x28')]=_[_0x9964('0x29')](db['ChatApplication']['rawAttributes']);_0x3a59df[_0x9964('0x2a')]=_[_0x9964('0x29')](_0x16ec83['query']);_0x3a59df['filters']=_['intersection'](_0x3a59df[_0x9964('0x28')],_0x3a59df[_0x9964('0x2a')]);_0x201656[_0x9964('0x2b')]=_['intersection'](_0x3a59df[_0x9964('0x28')],qs[_0x9964('0x2c')](_0x16ec83[_0x9964('0x2a')][_0x9964('0x2c')]));_0x201656[_0x9964('0x2b')]=_0x201656[_0x9964('0x2b')]['length']?_0x201656[_0x9964('0x2b')]:_0x3a59df[_0x9964('0x28')];if(_0x16ec83[_0x9964('0x2a')]['includeAll']){_0x201656[_0x9964('0x2d')]=[{'all':!![]}];}_0x201656=_[_0x9964('0x2e')]({},_0x201656,_0x16ec83[_0x9964('0x2f')]);return db['ChatApplication'][_0x9964('0x30')](_0x201656)[_0x9964('0x21')](handleEntityNotFound(_0x47d0d4,null))[_0x9964('0x21')](respondWithResult(_0x47d0d4,null))[_0x9964('0x31')](handleError(_0x47d0d4,null));};exports[_0x9964('0x32')]=function(_0xa1cf0b,_0x113c6b){if(_0xa1cf0b[_0x9964('0x33')]['id']){delete _0xa1cf0b[_0x9964('0x33')]['id'];}return db[_0x9964('0x34')][_0x9964('0x30')]({'where':{'id':_0xa1cf0b[_0x9964('0x27')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x113c6b,null))[_0x9964('0x21')](saveUpdates(_0xa1cf0b[_0x9964('0x33')],null))[_0x9964('0x21')](respondWithResult(_0x113c6b,null))[_0x9964('0x31')](handleError(_0x113c6b,null));};exports[_0x9964('0x22')]=function(_0x539d3d,_0xfe79a3){return db['ChatApplication'][_0x9964('0x30')]({'where':{'id':_0x539d3d[_0x9964('0x27')]['id']}})['then'](handleEntityNotFound(_0xfe79a3,null))[_0x9964('0x21')](removeEntity(_0xfe79a3,null))['catch'](handleError(_0xfe79a3,null));}; \ No newline at end of file +var _0x0fec=['../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','end','sendStatus','error','name','send','keys','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','ChatApplication','find','then','catch','body','params','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x1f0cf3,_0x5d520d){_0x1f0cf3=_0x1f0cf3-0x0;var _0x11effe=_0x0fec[_0x1f0cf3];return _0x11effe;};'use strict';var emlformat=require(_0xc0fe('0x0'));var rimraf=require(_0xc0fe('0x1'));var zipdir=require(_0xc0fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0fe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc0fe('0x4'));var util=require(_0xc0fe('0x5'));var path=require('path');var sox=require(_0xc0fe('0x6'));var csv=require('to-csv');var ejs=require(_0xc0fe('0x7'));var fs=require('fs');var fs_extra=require(_0xc0fe('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc0fe('0x9'));var deskjs=require(_0xc0fe('0xa'));var toCsv=require(_0xc0fe('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc0fe('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xc0fe('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0fe('0xe'))(_0xc0fe('0xf'));var utils=require(_0xc0fe('0x10'));var config=require(_0xc0fe('0x11'));var licenseUtil=require(_0xc0fe('0x12'));var db=require(_0xc0fe('0x13'))['db'];function respondWithStatusCode(_0x559ad2,_0x350a6d){_0x350a6d=_0x350a6d||0xcc;return function(_0x2cd4bb){if(_0x2cd4bb){return _0x559ad2['sendStatus'](_0x350a6d);}return _0x559ad2['status'](_0x350a6d)['end']();};}function respondWithResult(_0x35ff2c,_0x2a4dad){_0x2a4dad=_0x2a4dad||0xc8;return function(_0x40cccf){if(_0x40cccf){return _0x35ff2c['status'](_0x2a4dad)[_0xc0fe('0x14')](_0x40cccf);}};}function respondWithFilteredResult(_0x46f20f,_0x5ae053){return function(_0x4afe19){if(_0x4afe19){var _0x1c7b1c=typeof _0x5ae053[_0xc0fe('0x15')]===_0xc0fe('0x16')&&typeof _0x5ae053[_0xc0fe('0x17')]===_0xc0fe('0x16');var _0xedc330=_0x4afe19[_0xc0fe('0x18')];var _0x15fe4b=_0x1c7b1c?0x0:_0x5ae053['offset'];var _0x42b841=_0x1c7b1c?_0x4afe19[_0xc0fe('0x18')]:_0x5ae053[_0xc0fe('0x15')]+_0x5ae053[_0xc0fe('0x17')];var _0x17504f;if(_0x42b841>=_0xedc330){_0x42b841=_0xedc330;_0x17504f=0xc8;}else{_0x17504f=0xce;}_0x46f20f[_0xc0fe('0x19')](_0x17504f);return _0x46f20f[_0xc0fe('0x1a')](_0xc0fe('0x1b'),_0x15fe4b+'-'+_0x42b841+'/'+_0xedc330)['json'](_0x4afe19);}return null;};}function patchUpdates(_0x3cdd16){return function(_0x36bfe2){try{jsonpatch[_0xc0fe('0x1c')](_0x36bfe2,_0x3cdd16,!![]);}catch(_0x329a4c){return BPromise[_0xc0fe('0x1d')](_0x329a4c);}return _0x36bfe2[_0xc0fe('0x1e')]();};}function saveUpdates(_0x44fb50,_0x13a20f){return function(_0x20236a){if(_0x20236a){return _0x20236a['update'](_0x44fb50)['then'](function(_0xc3d74){return _0xc3d74;});}return null;};}function removeEntity(_0x280ba5,_0x9c477){return function(_0x525f91){if(_0x525f91){return _0x525f91[_0xc0fe('0x1f')]()['then'](function(){_0x280ba5[_0xc0fe('0x19')](0xcc)[_0xc0fe('0x20')]();});}};}function handleEntityNotFound(_0x5e7890,_0x27a154){return function(_0x4fb617){if(!_0x4fb617){_0x5e7890[_0xc0fe('0x21')](0x194);}return _0x4fb617;};}function handleError(_0x5f884d,_0x250ad8){_0x250ad8=_0x250ad8||0x1f4;return function(_0x550167){logger[_0xc0fe('0x22')](_0x550167['stack']);if(_0x550167[_0xc0fe('0x23')]){delete _0x550167[_0xc0fe('0x23')];}_0x5f884d[_0xc0fe('0x19')](_0x250ad8)[_0xc0fe('0x24')](_0x550167);};}exports['show']=function(_0x2d17cd,_0x406f25){var _0x413dbf={'raw':!![],'where':{'id':_0x2d17cd['params']['id']}},_0x48a7a6={};_0x48a7a6['model']=_[_0xc0fe('0x25')](db['ChatApplication'][_0xc0fe('0x26')]);_0x48a7a6[_0xc0fe('0x27')]=_['keys'](_0x2d17cd[_0xc0fe('0x27')]);_0x48a7a6['filters']=_[_0xc0fe('0x28')](_0x48a7a6[_0xc0fe('0x29')],_0x48a7a6['query']);_0x413dbf[_0xc0fe('0x2a')]=_[_0xc0fe('0x28')](_0x48a7a6[_0xc0fe('0x29')],qs[_0xc0fe('0x2b')](_0x2d17cd[_0xc0fe('0x27')][_0xc0fe('0x2b')]));_0x413dbf['attributes']=_0x413dbf['attributes'][_0xc0fe('0x2c')]?_0x413dbf[_0xc0fe('0x2a')]:_0x48a7a6[_0xc0fe('0x29')];if(_0x2d17cd[_0xc0fe('0x27')][_0xc0fe('0x2d')]){_0x413dbf[_0xc0fe('0x2e')]=[{'all':!![]}];}_0x413dbf=_['merge']({},_0x413dbf,_0x2d17cd['options']);return db[_0xc0fe('0x2f')][_0xc0fe('0x30')](_0x413dbf)['then'](handleEntityNotFound(_0x406f25,null))[_0xc0fe('0x31')](respondWithResult(_0x406f25,null))[_0xc0fe('0x32')](handleError(_0x406f25,null));};exports['update']=function(_0x27e1c0,_0x2d92d8){if(_0x27e1c0[_0xc0fe('0x33')]['id']){delete _0x27e1c0[_0xc0fe('0x33')]['id'];}return db[_0xc0fe('0x2f')][_0xc0fe('0x30')]({'where':{'id':_0x27e1c0[_0xc0fe('0x34')]['id']}})[_0xc0fe('0x31')](handleEntityNotFound(_0x2d92d8,null))[_0xc0fe('0x31')](saveUpdates(_0x27e1c0[_0xc0fe('0x33')],null))[_0xc0fe('0x31')](respondWithResult(_0x2d92d8,null))[_0xc0fe('0x32')](handleError(_0x2d92d8,null));};exports[_0xc0fe('0x1f')]=function(_0x4f2c45,_0x2d71b7){return db[_0xc0fe('0x2f')][_0xc0fe('0x30')]({'where':{'id':_0x4f2c45['params']['id']}})[_0xc0fe('0x31')](handleEntityNotFound(_0x2d71b7,null))[_0xc0fe('0x31')](removeEntity(_0x2d71b7,null))[_0xc0fe('0x32')](handleError(_0x2d71b7,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index cd9298b..160d827 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 _0x241d=['chat_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x241d,0x64));var _0xd241=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x241d[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xd241('0x0'));var util=require('util');var logger=require(_0xd241('0x1'))(_0xd241('0x2'));var moment=require(_0xd241('0x3'));var BPromise=require(_0xd241('0x4'));var rp=require(_0xd241('0x5'));var fs=require('fs');var path=require(_0xd241('0x6'));var rimraf=require(_0xd241('0x7'));var config=require(_0xd241('0x8'));var attributes=require(_0xd241('0x9'));module[_0xd241('0xa')]=function(_0x2eb97f,_0x4e6ad3){return _0x2eb97f[_0xd241('0xb')]('ChatApplication',attributes,{'tableName':_0xd241('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd241('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb786=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58422d,_0x36551c){var _0x438a0c=function(_0x53cdde){while(--_0x53cdde){_0x58422d['push'](_0x58422d['shift']());}};_0x438a0c(++_0x36551c);}(_0xb786,0x1d8));var _0x6b78=function(_0x58a058,_0x5965eb){_0x58a058=_0x58a058-0x0;var _0x347664=_0xb786[_0x58a058];return _0x347664;};'use strict';var _=require(_0x6b78('0x0'));var util=require(_0x6b78('0x1'));var logger=require(_0x6b78('0x2'))('api');var moment=require(_0x6b78('0x3'));var BPromise=require(_0x6b78('0x4'));var rp=require(_0x6b78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b78('0x6'));var config=require(_0x6b78('0x7'));var attributes=require(_0x6b78('0x8'));module[_0x6b78('0x9')]=function(_0x43f3ac,_0x5e69f2){return _0x43f3ac[_0x6b78('0xa')](_0x6b78('0xb'),attributes,{'tableName':_0x6b78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b78('0xd'),'collate':_0x6b78('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d370556..9062935 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 _0x7be5=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x284d28,_0x327da6){var _0x440af8=function(_0x4550fe){while(--_0x4550fe){_0x284d28['push'](_0x284d28['shift']());}};_0x440af8(++_0x327da6);}(_0x7be5,0x166));var _0x57be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7be5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57be('0x0'));var util=require(_0x57be('0x1'));var moment=require(_0x57be('0x2'));var BPromise=require(_0x57be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57be('0x4'));var db=require(_0x57be('0x5'))['db'];var utils=require(_0x57be('0x6'));var logger=require(_0x57be('0x7'))(_0x57be('0x8'));var config=require(_0x57be('0x9'));var jayson=require(_0x57be('0xa'));var client=jayson[_0x57be('0xb')][_0x57be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45d877,_0x1a798f,_0x2cf4e2){return new BPromise(function(_0x2ba136,_0x255cf3){return client[_0x57be('0xd')](_0x45d877,_0x2cf4e2)[_0x57be('0xe')](function(_0x50d68f){logger[_0x57be('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'));logger[_0x57be('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'),JSON[_0x57be('0x12')](_0x50d68f));if(_0x50d68f['error']){if(_0x50d68f[_0x57be('0x13')][_0x57be('0x14')]===0x1f4){logger['error'](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x255cf3(_0x50d68f['error'][_0x57be('0x16')]);}logger[_0x57be('0x13')](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x2ba136(_0x50d68f[_0x57be('0x13')]['message']);}else{logger[_0x57be('0xf')](_0x57be('0x15'),_0x1a798f,_0x57be('0x10'));_0x2ba136(_0x50d68f['result'][_0x57be('0x16')]);}})[_0x57be('0x17')](function(_0x23614a){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x23614a);_0x255cf3(_0x23614a);});});} \ No newline at end of file +var _0x5ec3=['info','debug','request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x536b5e,_0x44c3c0){var _0x2b2721=function(_0x2ecd47){while(--_0x2ecd47){_0x536b5e['push'](_0x536b5e['shift']());}};_0x2b2721(++_0x44c3c0);}(_0x5ec3,0x17a));var _0x35ec=function(_0x112cd0,_0xd6430e){_0x112cd0=_0x112cd0-0x0;var _0x8ad0e7=_0x5ec3[_0x112cd0];return _0x8ad0e7;};'use strict';var _=require(_0x35ec('0x0'));var util=require(_0x35ec('0x1'));var moment=require(_0x35ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x35ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ec('0x5'))(_0x35ec('0x6'));var config=require(_0x35ec('0x7'));var jayson=require(_0x35ec('0x8'));var client=jayson[_0x35ec('0x9')][_0x35ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28003d,_0x2d8742,_0x2ae615){return new BPromise(function(_0x3ae8a3,_0x1660c0){return client[_0x35ec('0xb')](_0x28003d,_0x2ae615)[_0x35ec('0xc')](function(_0x59dba0){logger[_0x35ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,'request\x20sent');logger[_0x35ec('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2d8742,_0x35ec('0xf'),JSON[_0x35ec('0x10')](_0x59dba0));if(_0x59dba0[_0x35ec('0x11')]){if(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x12')]===0x1f4){logger['error'](_0x35ec('0x13'),_0x2d8742,_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);return _0x1660c0(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);}logger[_0x35ec('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);return _0x3ae8a3(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);}else{logger[_0x35ec('0xd')](_0x35ec('0x13'),_0x2d8742,_0x35ec('0xf'));_0x3ae8a3(_0x59dba0[_0x35ec('0x15')][_0x35ec('0x14')]);}})[_0x35ec('0x16')](function(_0x4389d2){logger[_0x35ec('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,_0x4389d2);_0x1660c0(_0x4389d2);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c492f81..3e561c9 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 _0x8985=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update','exports','multer','util','connect-timeout'];(function(_0x13107e,_0x35c767){var _0xad7d95=function(_0x330ca8){while(--_0x330ca8){_0x13107e['push'](_0x13107e['shift']());}};_0xad7d95(++_0x35c767);}(_0x8985,0x6d));var _0x5898=function(_0x460133,_0x4cda19){_0x460133=_0x460133-0x0;var _0x523f40=_0x8985[_0x460133];return _0x523f40;};'use strict';var multer=require(_0x5898('0x0'));var util=require(_0x5898('0x1'));var path=require('path');var timeout=require(_0x5898('0x2'));var express=require(_0x5898('0x3'));var router=express[_0x5898('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5898('0x5'));var interaction=require(_0x5898('0x6'));var config=require(_0x5898('0x7'));var controller=require(_0x5898('0x8'));router['get'](_0x5898('0x9'),auth[_0x5898('0xa')](),controller['show']);router[_0x5898('0xb')]('/:id',auth[_0x5898('0xa')](),controller[_0x5898('0xc')]);router['delete'](_0x5898('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5898('0xd')]=router; \ No newline at end of file +var _0xbaf6=['../../components/interaction/service','get','/:id','isAuthenticated','show','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3b0ec7,_0x5413be){var _0x4ec6da=function(_0x12e4dd){while(--_0x12e4dd){_0x3b0ec7['push'](_0x3b0ec7['shift']());}};_0x4ec6da(++_0x5413be);}(_0xbaf6,0xe9));var _0x6baf=function(_0x52bcbd,_0x8dcc55){_0x52bcbd=_0x52bcbd-0x0;var _0x2c4072=_0xbaf6[_0x52bcbd];return _0x2c4072;};'use strict';var multer=require(_0x6baf('0x0'));var util=require(_0x6baf('0x1'));var path=require(_0x6baf('0x2'));var timeout=require(_0x6baf('0x3'));var express=require(_0x6baf('0x4'));var router=express['Router']();var fs_extra=require(_0x6baf('0x5'));var auth=require(_0x6baf('0x6'));var interaction=require(_0x6baf('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x6baf('0x8')](_0x6baf('0x9'),auth[_0x6baf('0xa')](),controller[_0x6baf('0xb')]);router['put']('/:id',auth[_0x6baf('0xa')](),controller[_0x6baf('0xc')]);router[_0x6baf('0xd')](_0x6baf('0x9'),auth[_0x6baf('0xa')](),controller['destroy']);module[_0x6baf('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 800a574..556b6eb 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 _0x489e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x489e,0x184));var _0xe489=function(_0x255493,_0x212e2b){_0x255493=_0x255493-0x0;var _0x564f94=_0x489e[_0x255493];return _0x564f94;};'use strict';var Sequelize=require(_0xe489('0x0'));module[_0xe489('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe489('0x2')]},'write':{'type':Sequelize[_0xe489('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1e97=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e97,0x90));var _0x71e9=function(_0x4b0ca0,_0x3e70a1){_0x4b0ca0=_0x4b0ca0-0x0;var _0x4d1ba9=_0x1e97[_0x4b0ca0];return _0x4d1ba9;};'use strict';var Sequelize=require(_0x71e9('0x0'));module[_0x71e9('0x1')]={'name':{'type':Sequelize[_0x71e9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x71e9('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 023aa2d..0c6b6de 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 _0x8edf=['defaults','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','map','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0x8edf,0xaa));var _0xf8ed=function(_0x30d249,_0xe500b9){_0x30d249=_0x30d249-0x0;var _0xa668f7=_0x8edf[_0x30d249];return _0xa668f7;};'use strict';var emlformat=require(_0xf8ed('0x0'));var rimraf=require(_0xf8ed('0x1'));var zipdir=require(_0xf8ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8ed('0x3'));var moment=require(_0xf8ed('0x4'));var BPromise=require(_0xf8ed('0x5'));var Mustache=require(_0xf8ed('0x6'));var util=require(_0xf8ed('0x7'));var path=require(_0xf8ed('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(_0xf8ed('0x9'));var squel=require(_0xf8ed('0xa'));var crypto=require(_0xf8ed('0xb'));var jsforce=require(_0xf8ed('0xc'));var deskjs=require(_0xf8ed('0xd'));var toCsv=require(_0xf8ed('0xe'));var querystring=require('querystring');var Papa=require(_0xf8ed('0xf'));var Redis=require(_0xf8ed('0x10'));var authService=require(_0xf8ed('0x11'));var qs=require(_0xf8ed('0x12'));var as=require(_0xf8ed('0x13'));var hardwareService=require(_0xf8ed('0x14'));var logger=require(_0xf8ed('0x15'))(_0xf8ed('0x16'));var utils=require(_0xf8ed('0x17'));var config=require(_0xf8ed('0x18'));var licenseUtil=require(_0xf8ed('0x19'));var db=require(_0xf8ed('0x1a'))['db'];config[_0xf8ed('0x1b')]=_[_0xf8ed('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8ed('0x1b')]));require(_0xf8ed('0x1d'))[_0xf8ed('0x1e')](socket);function respondWithStatusCode(_0x2f53e2,_0x4465f7){_0x4465f7=_0x4465f7||0xcc;return function(_0x9fdf6b){if(_0x9fdf6b){return _0x2f53e2[_0xf8ed('0x1f')](_0x4465f7);}return _0x2f53e2['status'](_0x4465f7)[_0xf8ed('0x20')]();};}function respondWithResult(_0x4695a3,_0x54e6c0){_0x54e6c0=_0x54e6c0||0xc8;return function(_0x5cd100){if(_0x5cd100){return _0x4695a3[_0xf8ed('0x21')](_0x54e6c0)['json'](_0x5cd100);}};}function respondWithFilteredResult(_0x16fa5a,_0x1750cb){return function(_0x369698){if(_0x369698){var _0x1eb458=typeof _0x1750cb[_0xf8ed('0x22')]===_0xf8ed('0x23')&&typeof _0x1750cb[_0xf8ed('0x24')]===_0xf8ed('0x23');var _0x3a0b4c=_0x369698['count'];var _0x2cffa3=_0x1eb458?0x0:_0x1750cb[_0xf8ed('0x22')];var _0x52d2f7=_0x1eb458?_0x369698[_0xf8ed('0x25')]:_0x1750cb[_0xf8ed('0x22')]+_0x1750cb[_0xf8ed('0x24')];var _0x263af2;if(_0x52d2f7>=_0x3a0b4c){_0x52d2f7=_0x3a0b4c;_0x263af2=0xc8;}else{_0x263af2=0xce;}_0x16fa5a[_0xf8ed('0x21')](_0x263af2);return _0x16fa5a[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x2cffa3+'-'+_0x52d2f7+'/'+_0x3a0b4c)['json'](_0x369698);}return null;};}function patchUpdates(_0x3b8c44){return function(_0x17554b){try{jsonpatch['apply'](_0x17554b,_0x3b8c44,!![]);}catch(_0x2a3e78){return BPromise['reject'](_0x2a3e78);}return _0x17554b[_0xf8ed('0x28')]();};}function saveUpdates(_0x2db572,_0x451508){return function(_0x56dd52){if(_0x56dd52){return _0x56dd52[_0xf8ed('0x29')](_0x2db572)['then'](function(_0x36bf02){return _0x36bf02;});}return null;};}function removeEntity(_0xaf22ea,_0x28f9a8){return function(_0x5764f6){if(_0x5764f6){return _0x5764f6['destroy']()[_0xf8ed('0x2a')](function(){_0xaf22ea[_0xf8ed('0x21')](0xcc)[_0xf8ed('0x20')]();});}};}function handleEntityNotFound(_0xa00f80,_0x3d1b29){return function(_0x251818){if(!_0x251818){_0xa00f80[_0xf8ed('0x1f')](0x194);}return _0x251818;};}function handleError(_0x53e13b,_0x4a5f48){_0x4a5f48=_0x4a5f48||0x1f4;return function(_0x310f53){logger['error'](_0x310f53[_0xf8ed('0x2b')]);if(_0x310f53[_0xf8ed('0x2c')]){delete _0x310f53['name'];}_0x53e13b[_0xf8ed('0x21')](_0x4a5f48)[_0xf8ed('0x2d')](_0x310f53);};}exports[_0xf8ed('0x2e')]=function(_0x2dddcb,_0x4ba844){var _0x1948ba={},_0x49b00d={},_0x2494da={'count':0x0,'rows':[]};var _0x321789=_[_0xf8ed('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x1619bf){return{'name':_0x1619bf['fieldName'],'type':_0x1619bf['type'][_0xf8ed('0x30')]};});_0x49b00d[_0xf8ed('0x31')]=_[_0xf8ed('0x2f')](_0x321789,_0xf8ed('0x2c'));_0x49b00d[_0xf8ed('0x32')]=_['keys'](_0x2dddcb[_0xf8ed('0x32')]);_0x49b00d[_0xf8ed('0x33')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],_0x49b00d[_0xf8ed('0x32')]);_0x1948ba[_0xf8ed('0x34')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x1948ba[_0xf8ed('0x34')]=_0x1948ba[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x1948ba[_0xf8ed('0x34')]:_0x49b00d[_0xf8ed('0x31')];if(!_0x2dddcb['query'][_0xf8ed('0x37')]('nolimit')){_0x1948ba[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x1948ba[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x22')]);}_0x1948ba[_0xf8ed('0x38')]=qs[_0xf8ed('0x39')](_0x2dddcb[_0xf8ed('0x32')]['sort']);_0x1948ba[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2dddcb[_0xf8ed('0x32')],_0x49b00d[_0xf8ed('0x33')]),_0x321789);if(_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x1948ba[_0xf8ed('0x3a')]=_[_0xf8ed('0x3d')](_0x1948ba[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x321789,function(_0xb6b855){if(_0xb6b855[_0xf8ed('0x3e')]!==_0xf8ed('0x3f')){var _0x58ba00={};_0x58ba00[_0xb6b855[_0xf8ed('0x2c')]]={'$like':'%'+_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x58ba00;}})});}_0x1948ba=_['merge']({},_0x1948ba,_0x2dddcb[_0xf8ed('0x40')]);var _0x3e518d={'where':_0x1948ba[_0xf8ed('0x3a')]};return db[_0xf8ed('0x41')][_0xf8ed('0x25')](_0x3e518d)[_0xf8ed('0x2a')](function(_0x50cdc9){_0x2494da[_0xf8ed('0x25')]=_0x50cdc9;if(_0x2dddcb['query']['includeAll']){_0x1948ba[_0xf8ed('0x42')]=[{'all':!![]}];}return db[_0xf8ed('0x41')][_0xf8ed('0x43')](_0x1948ba);})[_0xf8ed('0x2a')](function(_0x6bff45){_0x2494da[_0xf8ed('0x44')]=_0x6bff45;return _0x2494da;})[_0xf8ed('0x2a')](respondWithFilteredResult(_0x4ba844,_0x1948ba))[_0xf8ed('0x45')](handleError(_0x4ba844,null));};exports[_0xf8ed('0x46')]=function(_0x3dd71d,_0xc97a6){var _0x2a71c3={'raw':!![],'where':{'id':_0x3dd71d[_0xf8ed('0x47')]['id']}},_0x5e0efe={};_0x5e0efe[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db['ChatGroup'][_0xf8ed('0x49')]);_0x5e0efe[_0xf8ed('0x32')]=_['keys'](_0x3dd71d[_0xf8ed('0x32')]);_0x5e0efe[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],_0x5e0efe['query']);_0x2a71c3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],qs['fields'](_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x2a71c3[_0xf8ed('0x34')]=_0x2a71c3[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x2a71c3[_0xf8ed('0x34')]:_0x5e0efe[_0xf8ed('0x31')];if(_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x4b')]){_0x2a71c3[_0xf8ed('0x42')]=[{'all':!![]}];}_0x2a71c3=_[_0xf8ed('0x3d')]({},_0x2a71c3,_0x3dd71d[_0xf8ed('0x40')]);return db[_0xf8ed('0x41')][_0xf8ed('0x4c')](_0x2a71c3)[_0xf8ed('0x2a')](handleEntityNotFound(_0xc97a6,null))[_0xf8ed('0x2a')](respondWithResult(_0xc97a6,null))[_0xf8ed('0x45')](handleError(_0xc97a6,null));};exports[_0xf8ed('0x4d')]=function(_0x119041,_0x9d59b2){return db[_0xf8ed('0x41')][_0xf8ed('0x4d')](_0x119041[_0xf8ed('0x4e')],{})[_0xf8ed('0x2a')](respondWithResult(_0x9d59b2,0xc9))['catch'](handleError(_0x9d59b2,null));};exports['update']=function(_0x4ab044,_0x1616c6){if(_0x4ab044[_0xf8ed('0x4e')]['id']){delete _0x4ab044['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x4ab044[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1616c6,null))['then'](saveUpdates(_0x4ab044[_0xf8ed('0x4e')],null))[_0xf8ed('0x2a')](respondWithResult(_0x1616c6,null))[_0xf8ed('0x45')](handleError(_0x1616c6,null));};exports[_0xf8ed('0x4f')]=function(_0x3f662f,_0x352cb2){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x3f662f[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x352cb2,null))['then'](removeEntity(_0x352cb2,null))[_0xf8ed('0x45')](handleError(_0x352cb2,null));};exports[_0xf8ed('0x50')]=function(_0x204af2,_0x4ae532){return db[_0xf8ed('0x41')][_0xf8ed('0x50')]()[_0xf8ed('0x2a')](respondWithResult(_0x4ae532,null))['catch'](handleError(_0x4ae532,null));};exports['getUnread']=function(_0x5eef11,_0x258f6f,_0xe68cae){return db[_0xf8ed('0x51')][_0xf8ed('0x25')]({'where':{'ChatGroupId':_0x5eef11[_0xf8ed('0x47')]['id'],'ToId':_0x5eef11[_0xf8ed('0x52')]['id'],'read':![]}})[_0xf8ed('0x2a')](function(_0x5e874c){return{'id':_[_0xf8ed('0x53')](_0x5eef11[_0xf8ed('0x47')]['id']),'count':_0x5e874c};})[_0xf8ed('0x2a')](respondWithResult(_0x258f6f,null))['catch'](handleError(_0x258f6f,null));};exports[_0xf8ed('0x54')]=function(_0x1cb857,_0x1c378d,_0x175b4f){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1cb857['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1c378d,null))['then'](function(_0x5bf9ad){if(_0x5bf9ad){return _0x5bf9ad[_0xf8ed('0x54')](_0x1cb857[_0xf8ed('0x4e')][_0xf8ed('0x55')],_[_0xf8ed('0x56')](_0x1cb857[_0xf8ed('0x4e')],[_0xf8ed('0x55'),'id'])||{});}})[_0xf8ed('0x2a')](respondWithResult(_0x1c378d,null))[_0xf8ed('0x45')](handleError(_0x1c378d,null));};exports[_0xf8ed('0x57')]=function(_0x3a2226,_0x5acf0c,_0x4a4bde){var _0x57c2d3={};var _0x1f1fec={};var _0x3e5712;var _0x2edb90;return db['ChatGroup'][_0xf8ed('0x58')]({'where':{'id':_0x3a2226[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x5acf0c,null))[_0xf8ed('0x2a')](function(_0x3b7a14){if(_0x3b7a14){_0x3e5712=_0x3b7a14;_0x1f1fec[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db[_0xf8ed('0x59')][_0xf8ed('0x49')]);_0x1f1fec[_0xf8ed('0x32')]=_[_0xf8ed('0x48')](_0x3a2226[_0xf8ed('0x32')]);_0x1f1fec[_0xf8ed('0x33')]=_['intersection'](_0x1f1fec[_0xf8ed('0x31')],_0x1f1fec['query']);_0x57c2d3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x1f1fec[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x57c2d3['attributes']=_0x57c2d3['attributes'][_0xf8ed('0x36')]?_0x57c2d3[_0xf8ed('0x34')]:_0x1f1fec[_0xf8ed('0x31')];_0x57c2d3[_0xf8ed('0x38')]=qs['sort'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x57c2d3[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x3a2226[_0xf8ed('0x32')],_0x1f1fec[_0xf8ed('0x33')]));if(_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x57c2d3['where']=_[_0xf8ed('0x3d')](_0x57c2d3[_0xf8ed('0x3a')],{'$or':_['map'](_0x57c2d3[_0xf8ed('0x34')],function(_0x4ce8f7){var _0x3862b7={};_0x3862b7[_0x4ce8f7]={'$like':'%'+_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x3862b7;})});}_0x57c2d3=_[_0xf8ed('0x3d')]({},_0x57c2d3,_0x3a2226[_0xf8ed('0x40')]);return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x33acd2){if(_0x33acd2){_0x2edb90=_0x33acd2['length'];if(!_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x57c2d3[_0xf8ed('0x24')]=qs['limit'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x57c2d3[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x5b7c1b){if(_0x5b7c1b){return _0x5b7c1b?{'count':_0x2edb90,'rows':_0x5b7c1b}:null;}})[_0xf8ed('0x2a')](respondWithResult(_0x5acf0c,null))[_0xf8ed('0x45')](handleError(_0x5acf0c,null));};exports[_0xf8ed('0x5b')]=function(_0x283aef,_0x361f5e,_0x2acd95){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x283aef[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x361f5e,null))['then'](function(_0x4f9bf5){if(_0x4f9bf5){return _0x4f9bf5[_0xf8ed('0x5b')](_0x283aef['query'][_0xf8ed('0x55')]);}})['then'](respondWithStatusCode(_0x361f5e,null))[_0xf8ed('0x45')](handleError(_0x361f5e,null));};exports[_0xf8ed('0x5c')]=function(_0x1223c7,_0x3f4d0b,_0x3635c1){if(_0x1223c7['body']['id']){delete _0x1223c7['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1223c7['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x3f4d0b,null))[_0xf8ed('0x2a')](function(_0x3b46b2){if(_0x3b46b2){_0x1223c7[_0xf8ed('0x4e')][_0xf8ed('0x5d')]=_0x3b46b2['id'];return db['ChatInternalMessage'][_0xf8ed('0x4d')](_0x1223c7[_0xf8ed('0x4e')]);}})[_0xf8ed('0x2a')](respondWithResult(_0x3f4d0b,null))['catch'](handleError(_0x3f4d0b,null));};exports[_0xf8ed('0x5e')]=function(_0x2bf8a4,_0x5b745b,_0x1a21ae){var _0x2263d2={};var _0x3d5f05={};var _0x4e95fe;var _0x52c32b;return db[_0xf8ed('0x41')][_0xf8ed('0x58')]({'where':{'id':_0x2bf8a4[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x5b745b,null))[_0xf8ed('0x2a')](function(_0x1aa304){if(_0x1aa304){_0x4e95fe=_0x1aa304;_0x3d5f05['model']=_['keys'](db[_0xf8ed('0x51')]['rawAttributes']);_0x3d5f05['query']=_[_0xf8ed('0x48')](_0x2bf8a4[_0xf8ed('0x32')]);_0x3d5f05[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x3d5f05['model'],_0x3d5f05[_0xf8ed('0x32')]);_0x2263d2[_0xf8ed('0x34')]=_['intersection'](_0x3d5f05['model'],qs['fields'](_0x2bf8a4['query'][_0xf8ed('0x35')]));_0x2263d2['attributes']=_0x2263d2[_0xf8ed('0x34')]['length']?_0x2263d2[_0xf8ed('0x34')]:_0x3d5f05[_0xf8ed('0x31')];_0x2263d2[_0xf8ed('0x38')]=qs['sort'](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x2263d2[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2bf8a4[_0xf8ed('0x32')],_0x3d5f05[_0xf8ed('0x33')]));if(_0x2bf8a4['query'][_0xf8ed('0x3c')]){_0x2263d2['where']=_[_0xf8ed('0x3d')](_0x2263d2[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x2263d2[_0xf8ed('0x34')],function(_0x2d67d0){var _0x4034d6={};_0x4034d6[_0x2d67d0]={'$like':'%'+_0x2bf8a4['query']['filter']+'%'};return _0x4034d6;})});}if(_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x5f')]){var _0x41be3a=_0x2bf8a4[_0xf8ed('0x32')]['$gte'][_0xf8ed('0x60')](',');var _0x447397={};_0x447397[_0x41be3a[0x0]]={'$gte':moment(_0x41be3a[0x1])[_0xf8ed('0x61')](_0xf8ed('0x62'))};_0x2263d2[_0xf8ed('0x3a')]=_['merge'](_0x2263d2[_0xf8ed('0x3a')],_0x447397);}_0x2263d2=_[_0xf8ed('0x3d')]({},_0x2263d2,_0x2bf8a4[_0xf8ed('0x40')]);return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x43a796){if(_0x43a796){_0x52c32b=_0x43a796[_0xf8ed('0x36')];if(!_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x2263d2[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2bf8a4['query'][_0xf8ed('0x24')]);_0x2263d2[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x12a9ec){if(_0x12a9ec){return _0x12a9ec?{'count':_0x52c32b,'rows':_0x12a9ec}:null;}})['then'](respondWithResult(_0x5b745b,null))['catch'](handleError(_0x5b745b,null));}; \ No newline at end of file +var _0x757b=['keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','find','create','update','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatInternalMessage','$gte','split','format','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','count','limit','status','set','reject','save','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','key','model','query'];(function(_0x441215,_0x2eb514){var _0x27b31c=function(_0x1550e9){while(--_0x1550e9){_0x441215['push'](_0x441215['shift']());}};_0x27b31c(++_0x2eb514);}(_0x757b,0x1b7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb757('0x0'));var rimraf=require(_0xb757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb757('0x2'));var rp=require(_0xb757('0x3'));var moment=require(_0xb757('0x4'));var BPromise=require(_0xb757('0x5'));var Mustache=require(_0xb757('0x6'));var util=require(_0xb757('0x7'));var path=require(_0xb757('0x8'));var sox=require(_0xb757('0x9'));var csv=require(_0xb757('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb757('0xb'));var _=require(_0xb757('0xc'));var squel=require(_0xb757('0xd'));var crypto=require(_0xb757('0xe'));var jsforce=require(_0xb757('0xf'));var deskjs=require(_0xb757('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb757('0x11'));var Papa=require(_0xb757('0x12'));var Redis=require('ioredis');var authService=require(_0xb757('0x13'));var qs=require(_0xb757('0x14'));var as=require(_0xb757('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb757('0x16'))(_0xb757('0x17'));var utils=require(_0xb757('0x18'));var config=require(_0xb757('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb757('0x1a'))['db'];config['redis']=_['defaults'](config[_0xb757('0x1b')],{'host':_0xb757('0x1c'),'port':0x18eb});var socket=require(_0xb757('0x1d'))(new Redis(config[_0xb757('0x1b')]));require(_0xb757('0x1e'))[_0xb757('0x1f')](socket);function respondWithStatusCode(_0x5f4481,_0x5b539a){_0x5b539a=_0x5b539a||0xcc;return function(_0x2a0f9d){if(_0x2a0f9d){return _0x5f4481[_0xb757('0x20')](_0x5b539a);}return _0x5f4481['status'](_0x5b539a)[_0xb757('0x21')]();};}function respondWithResult(_0x29c604,_0x2d4955){_0x2d4955=_0x2d4955||0xc8;return function(_0x2c4932){if(_0x2c4932){return _0x29c604['status'](_0x2d4955)[_0xb757('0x22')](_0x2c4932);}};}function respondWithFilteredResult(_0xfbfe1e,_0x2c1725){return function(_0x5d1916){if(_0x5d1916){var _0x333c46=typeof _0x2c1725[_0xb757('0x23')]==='undefined'&&typeof _0x2c1725['limit']===_0xb757('0x24');var _0x467684=_0x5d1916[_0xb757('0x25')];var _0x564612=_0x333c46?0x0:_0x2c1725[_0xb757('0x23')];var _0x86fc3=_0x333c46?_0x5d1916[_0xb757('0x25')]:_0x2c1725[_0xb757('0x23')]+_0x2c1725[_0xb757('0x26')];var _0x448212;if(_0x86fc3>=_0x467684){_0x86fc3=_0x467684;_0x448212=0xc8;}else{_0x448212=0xce;}_0xfbfe1e[_0xb757('0x27')](_0x448212);return _0xfbfe1e[_0xb757('0x28')]('Content-Range',_0x564612+'-'+_0x86fc3+'/'+_0x467684)[_0xb757('0x22')](_0x5d1916);}return null;};}function patchUpdates(_0x332a45){return function(_0x55d62a){try{jsonpatch['apply'](_0x55d62a,_0x332a45,!![]);}catch(_0x258ce9){return BPromise[_0xb757('0x29')](_0x258ce9);}return _0x55d62a[_0xb757('0x2a')]();};}function saveUpdates(_0xf18c0b,_0x471c00){return function(_0x271fe0){if(_0x271fe0){return _0x271fe0['update'](_0xf18c0b)[_0xb757('0x2b')](function(_0x30ef3b){return _0x30ef3b;});}return null;};}function removeEntity(_0x204ce7,_0x1c4f9b){return function(_0x538292){if(_0x538292){return _0x538292[_0xb757('0x2c')]()[_0xb757('0x2b')](function(){_0x204ce7[_0xb757('0x27')](0xcc)[_0xb757('0x21')]();});}};}function handleEntityNotFound(_0x33d579,_0x90a22b){return function(_0x2e195d){if(!_0x2e195d){_0x33d579[_0xb757('0x20')](0x194);}return _0x2e195d;};}function handleError(_0x50f19c,_0xa70703){_0xa70703=_0xa70703||0x1f4;return function(_0x28cb48){logger[_0xb757('0x2d')](_0x28cb48[_0xb757('0x2e')]);if(_0x28cb48[_0xb757('0x2f')]){delete _0x28cb48[_0xb757('0x2f')];}_0x50f19c[_0xb757('0x27')](_0xa70703)[_0xb757('0x30')](_0x28cb48);};}exports[_0xb757('0x31')]=function(_0x2f6701,_0x2bbc2a){var _0x2dc596={},_0xc3b206={},_0x150fdb={'count':0x0,'rows':[]};var _0x3f3096=_[_0xb757('0x32')](db[_0xb757('0x33')]['rawAttributes'],function(_0x2042c6){return{'name':_0x2042c6[_0xb757('0x34')],'type':_0x2042c6['type'][_0xb757('0x35')]};});_0xc3b206[_0xb757('0x36')]=_[_0xb757('0x32')](_0x3f3096,'name');_0xc3b206[_0xb757('0x37')]=_[_0xb757('0x38')](_0x2f6701[_0xb757('0x37')]);_0xc3b206[_0xb757('0x39')]=_['intersection'](_0xc3b206[_0xb757('0x36')],_0xc3b206[_0xb757('0x37')]);_0x2dc596[_0xb757('0x3a')]=_[_0xb757('0x3b')](_0xc3b206[_0xb757('0x36')],qs[_0xb757('0x3c')](_0x2f6701['query'][_0xb757('0x3c')]));_0x2dc596[_0xb757('0x3a')]=_0x2dc596[_0xb757('0x3a')][_0xb757('0x3d')]?_0x2dc596[_0xb757('0x3a')]:_0xc3b206[_0xb757('0x36')];if(!_0x2f6701[_0xb757('0x37')]['hasOwnProperty'](_0xb757('0x3e'))){_0x2dc596[_0xb757('0x26')]=qs[_0xb757('0x26')](_0x2f6701[_0xb757('0x37')][_0xb757('0x26')]);_0x2dc596['offset']=qs[_0xb757('0x23')](_0x2f6701[_0xb757('0x37')][_0xb757('0x23')]);}_0x2dc596[_0xb757('0x3f')]=qs[_0xb757('0x40')](_0x2f6701['query'][_0xb757('0x40')]);_0x2dc596[_0xb757('0x41')]=qs[_0xb757('0x39')](_[_0xb757('0x42')](_0x2f6701[_0xb757('0x37')],_0xc3b206[_0xb757('0x39')]),_0x3f3096);if(_0x2f6701['query'][_0xb757('0x43')]){_0x2dc596['where']=_[_0xb757('0x44')](_0x2dc596[_0xb757('0x41')],{'$or':_[_0xb757('0x32')](_0x3f3096,function(_0x1fb049){if(_0x1fb049['type']!==_0xb757('0x45')){var _0x106f2d={};_0x106f2d[_0x1fb049['name']]={'$like':'%'+_0x2f6701['query']['filter']+'%'};return _0x106f2d;}})});}_0x2dc596=_[_0xb757('0x44')]({},_0x2dc596,_0x2f6701[_0xb757('0x46')]);var _0x2e4b9d={'where':_0x2dc596[_0xb757('0x41')]};return db[_0xb757('0x33')][_0xb757('0x25')](_0x2e4b9d)[_0xb757('0x2b')](function(_0x431347){_0x150fdb['count']=_0x431347;if(_0x2f6701['query'][_0xb757('0x47')]){_0x2dc596[_0xb757('0x48')]=[{'all':!![]}];}return db[_0xb757('0x33')]['findAll'](_0x2dc596);})[_0xb757('0x2b')](function(_0x592003){_0x150fdb[_0xb757('0x49')]=_0x592003;return _0x150fdb;})[_0xb757('0x2b')](respondWithFilteredResult(_0x2bbc2a,_0x2dc596))[_0xb757('0x4a')](handleError(_0x2bbc2a,null));};exports['show']=function(_0x55057a,_0x2d1574){var _0x576862={'raw':!![],'where':{'id':_0x55057a['params']['id']}},_0xb0c26a={};_0xb0c26a[_0xb757('0x36')]=_['keys'](db['ChatGroup'][_0xb757('0x4b')]);_0xb0c26a[_0xb757('0x37')]=_[_0xb757('0x38')](_0x55057a[_0xb757('0x37')]);_0xb0c26a['filters']=_[_0xb757('0x3b')](_0xb0c26a[_0xb757('0x36')],_0xb0c26a['query']);_0x576862['attributes']=_[_0xb757('0x3b')](_0xb0c26a['model'],qs[_0xb757('0x3c')](_0x55057a[_0xb757('0x37')][_0xb757('0x3c')]));_0x576862[_0xb757('0x3a')]=_0x576862[_0xb757('0x3a')][_0xb757('0x3d')]?_0x576862[_0xb757('0x3a')]:_0xb0c26a[_0xb757('0x36')];if(_0x55057a['query'][_0xb757('0x47')]){_0x576862[_0xb757('0x48')]=[{'all':!![]}];}_0x576862=_[_0xb757('0x44')]({},_0x576862,_0x55057a[_0xb757('0x46')]);return db['ChatGroup'][_0xb757('0x4c')](_0x576862)[_0xb757('0x2b')](handleEntityNotFound(_0x2d1574,null))[_0xb757('0x2b')](respondWithResult(_0x2d1574,null))[_0xb757('0x4a')](handleError(_0x2d1574,null));};exports['create']=function(_0x3126ce,_0x5a1c39){return db[_0xb757('0x33')][_0xb757('0x4d')](_0x3126ce['body'],{})[_0xb757('0x2b')](respondWithResult(_0x5a1c39,0xc9))[_0xb757('0x4a')](handleError(_0x5a1c39,null));};exports[_0xb757('0x4e')]=function(_0x16f4db,_0x2756f1){if(_0x16f4db[_0xb757('0x4f')]['id']){delete _0x16f4db[_0xb757('0x4f')]['id'];}return db[_0xb757('0x33')][_0xb757('0x4c')]({'where':{'id':_0x16f4db[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x2756f1,null))[_0xb757('0x2b')](saveUpdates(_0x16f4db[_0xb757('0x4f')],null))[_0xb757('0x2b')](respondWithResult(_0x2756f1,null))['catch'](handleError(_0x2756f1,null));};exports['destroy']=function(_0x218629,_0x46d9e6){return db['ChatGroup'][_0xb757('0x4c')]({'where':{'id':_0x218629[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x46d9e6,null))['then'](removeEntity(_0x46d9e6,null))[_0xb757('0x4a')](handleError(_0x46d9e6,null));};exports[_0xb757('0x51')]=function(_0x131e4c,_0x35f4ab){return db['ChatGroup']['describe']()[_0xb757('0x2b')](respondWithResult(_0x35f4ab,null))['catch'](handleError(_0x35f4ab,null));};exports[_0xb757('0x52')]=function(_0x347313,_0xe56550,_0x1e4a04){return db['ChatInternalMessage'][_0xb757('0x25')]({'where':{'ChatGroupId':_0x347313[_0xb757('0x50')]['id'],'ToId':_0x347313[_0xb757('0x53')]['id'],'read':![]}})[_0xb757('0x2b')](function(_0x489dd1){return{'id':_[_0xb757('0x54')](_0x347313[_0xb757('0x50')]['id']),'count':_0x489dd1};})[_0xb757('0x2b')](respondWithResult(_0xe56550,null))['catch'](handleError(_0xe56550,null));};exports[_0xb757('0x55')]=function(_0x24349d,_0x5af0f0,_0x14c028){return db[_0xb757('0x33')]['find']({'where':{'id':_0x24349d[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x5af0f0,null))[_0xb757('0x2b')](function(_0x2017a9){if(_0x2017a9){return _0x2017a9[_0xb757('0x55')](_0x24349d[_0xb757('0x4f')][_0xb757('0x56')],_[_0xb757('0x57')](_0x24349d[_0xb757('0x4f')],[_0xb757('0x56'),'id'])||{});}})['then'](respondWithResult(_0x5af0f0,null))[_0xb757('0x4a')](handleError(_0x5af0f0,null));};exports['getMembers']=function(_0x5ceb2c,_0x30c882,_0x45663c){var _0x75a470={};var _0x11a12a={};var _0x1f6d09;var _0x3200b3;return db[_0xb757('0x33')][_0xb757('0x58')]({'where':{'id':_0x5ceb2c[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x30c882,null))['then'](function(_0x2089d9){if(_0x2089d9){_0x1f6d09=_0x2089d9;_0x11a12a[_0xb757('0x36')]=_['keys'](db[_0xb757('0x59')][_0xb757('0x4b')]);_0x11a12a['query']=_['keys'](_0x5ceb2c[_0xb757('0x37')]);_0x11a12a[_0xb757('0x39')]=_[_0xb757('0x3b')](_0x11a12a[_0xb757('0x36')],_0x11a12a[_0xb757('0x37')]);_0x75a470['attributes']=_['intersection'](_0x11a12a[_0xb757('0x36')],qs[_0xb757('0x3c')](_0x5ceb2c['query'][_0xb757('0x3c')]));_0x75a470[_0xb757('0x3a')]=_0x75a470[_0xb757('0x3a')][_0xb757('0x3d')]?_0x75a470[_0xb757('0x3a')]:_0x11a12a[_0xb757('0x36')];_0x75a470['order']=qs[_0xb757('0x40')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x40')]);_0x75a470[_0xb757('0x41')]=qs[_0xb757('0x39')](_[_0xb757('0x42')](_0x5ceb2c[_0xb757('0x37')],_0x11a12a['filters']));if(_0x5ceb2c['query'][_0xb757('0x43')]){_0x75a470[_0xb757('0x41')]=_[_0xb757('0x44')](_0x75a470[_0xb757('0x41')],{'$or':_['map'](_0x75a470[_0xb757('0x3a')],function(_0x116265){var _0x4ac1fc={};_0x4ac1fc[_0x116265]={'$like':'%'+_0x5ceb2c[_0xb757('0x37')][_0xb757('0x43')]+'%'};return _0x4ac1fc;})});}_0x75a470=_[_0xb757('0x44')]({},_0x75a470,_0x5ceb2c[_0xb757('0x46')]);return _0x1f6d09[_0xb757('0x5a')](_0x75a470);}})[_0xb757('0x2b')](function(_0x1de741){if(_0x1de741){_0x3200b3=_0x1de741['length'];if(!_0x5ceb2c[_0xb757('0x37')][_0xb757('0x5b')](_0xb757('0x3e'))){_0x75a470[_0xb757('0x26')]=qs[_0xb757('0x26')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x26')]);_0x75a470[_0xb757('0x23')]=qs[_0xb757('0x23')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x23')]);}return _0x1f6d09['getMembers'](_0x75a470);}})['then'](function(_0x49bf5f){if(_0x49bf5f){return _0x49bf5f?{'count':_0x3200b3,'rows':_0x49bf5f}:null;}})['then'](respondWithResult(_0x30c882,null))['catch'](handleError(_0x30c882,null));};exports[_0xb757('0x5c')]=function(_0x2ed642,_0x13a799,_0x2fe4d6){return db['ChatGroup'][_0xb757('0x4c')]({'where':{'id':_0x2ed642['params']['id']}})['then'](handleEntityNotFound(_0x13a799,null))[_0xb757('0x2b')](function(_0x4a55d0){if(_0x4a55d0){return _0x4a55d0[_0xb757('0x5c')](_0x2ed642[_0xb757('0x37')][_0xb757('0x56')]);}})[_0xb757('0x2b')](respondWithStatusCode(_0x13a799,null))[_0xb757('0x4a')](handleError(_0x13a799,null));};exports[_0xb757('0x5d')]=function(_0x1a36cf,_0x1f33fc,_0x5789dd){if(_0x1a36cf['body']['id']){delete _0x1a36cf[_0xb757('0x4f')]['id'];}return db[_0xb757('0x33')][_0xb757('0x4c')]({'where':{'id':_0x1a36cf['params']['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x1f33fc,null))['then'](function(_0x3289a4){if(_0x3289a4){_0x1a36cf['body']['ChatGroupId']=_0x3289a4['id'];return db[_0xb757('0x5e')][_0xb757('0x4d')](_0x1a36cf[_0xb757('0x4f')]);}})[_0xb757('0x2b')](respondWithResult(_0x1f33fc,null))[_0xb757('0x4a')](handleError(_0x1f33fc,null));};exports['getMessages']=function(_0x2f38bd,_0x2724dd,_0x40b338){var _0x3fdb38={};var _0x190fb6={};var _0x5d4b3e;var _0x20f1a3;return db[_0xb757('0x33')]['findOne']({'where':{'id':_0x2f38bd[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x2724dd,null))['then'](function(_0x5f1f2b){if(_0x5f1f2b){_0x5d4b3e=_0x5f1f2b;_0x190fb6[_0xb757('0x36')]=_['keys'](db[_0xb757('0x5e')][_0xb757('0x4b')]);_0x190fb6[_0xb757('0x37')]=_[_0xb757('0x38')](_0x2f38bd[_0xb757('0x37')]);_0x190fb6[_0xb757('0x39')]=_[_0xb757('0x3b')](_0x190fb6[_0xb757('0x36')],_0x190fb6[_0xb757('0x37')]);_0x3fdb38[_0xb757('0x3a')]=_[_0xb757('0x3b')](_0x190fb6['model'],qs[_0xb757('0x3c')](_0x2f38bd['query'][_0xb757('0x3c')]));_0x3fdb38[_0xb757('0x3a')]=_0x3fdb38[_0xb757('0x3a')]['length']?_0x3fdb38[_0xb757('0x3a')]:_0x190fb6[_0xb757('0x36')];_0x3fdb38[_0xb757('0x3f')]=qs['sort'](_0x2f38bd[_0xb757('0x37')]['sort']);_0x3fdb38[_0xb757('0x41')]=qs['filters'](_[_0xb757('0x42')](_0x2f38bd[_0xb757('0x37')],_0x190fb6[_0xb757('0x39')]));if(_0x2f38bd[_0xb757('0x37')]['filter']){_0x3fdb38[_0xb757('0x41')]=_['merge'](_0x3fdb38[_0xb757('0x41')],{'$or':_[_0xb757('0x32')](_0x3fdb38['attributes'],function(_0x3c5c2f){var _0x25e475={};_0x25e475[_0x3c5c2f]={'$like':'%'+_0x2f38bd['query'][_0xb757('0x43')]+'%'};return _0x25e475;})});}if(_0x2f38bd[_0xb757('0x37')]['$gte']){var _0x27a9bb=_0x2f38bd[_0xb757('0x37')][_0xb757('0x5f')][_0xb757('0x60')](',');var _0x246273={};_0x246273[_0x27a9bb[0x0]]={'$gte':moment(_0x27a9bb[0x1])[_0xb757('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3fdb38[_0xb757('0x41')]=_[_0xb757('0x44')](_0x3fdb38[_0xb757('0x41')],_0x246273);}_0x3fdb38=_[_0xb757('0x44')]({},_0x3fdb38,_0x2f38bd[_0xb757('0x46')]);return _0x5d4b3e['getMessages'](_0x3fdb38);}})['then'](function(_0x4f1383){if(_0x4f1383){_0x20f1a3=_0x4f1383[_0xb757('0x3d')];if(!_0x2f38bd[_0xb757('0x37')]['hasOwnProperty']('nolimit')){_0x3fdb38['limit']=qs[_0xb757('0x26')](_0x2f38bd['query']['limit']);_0x3fdb38['offset']=qs[_0xb757('0x23')](_0x2f38bd[_0xb757('0x37')][_0xb757('0x23')]);}return _0x5d4b3e[_0xb757('0x62')](_0x3fdb38);}})[_0xb757('0x2b')](function(_0x304187){if(_0x304187){return _0x304187?{'count':_0x20f1a3,'rows':_0x304187}:null;}})['then'](respondWithResult(_0x2724dd,null))['catch'](handleError(_0x2724dd,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ab207bd..936f527 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 _0x8185=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8185,0x127));var _0x5818=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8185[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x5818('0x0'));var ChatGroup=require(_0x5818('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5818('0x2')](0x0);var events={'afterCreate':_0x5818('0x3'),'afterUpdate':_0x5818('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59270a){return function(_0x2def2f,_0x45fa9d,_0x3b34d7){ChatGroupEvents[_0x5818('0x5')](_0x59270a+':'+_0x2def2f['id'],_0x2def2f);ChatGroupEvents[_0x5818('0x5')](_0x59270a,_0x2def2f);_0x3b34d7(null);};}for(var e in events){if(events[_0x5818('0x6')](e)){var event=events[e];ChatGroup[_0x5818('0x7')](e,emitEvent(event));}}module[_0x5818('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x4ab6=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x4ab6,0x1a6));var _0x64ab=function(_0xe47217,_0x3a35db){_0xe47217=_0xe47217-0x0;var _0x3dc84c=_0x4ab6[_0xe47217];return _0x3dc84c;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x64ab('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x64ab('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64ab('0x2'),'afterDestroy':_0x64ab('0x3')};function emitEvent(_0x442a85){return function(_0x12c651,_0x3336dc,_0x36ea2e){ChatGroupEvents[_0x64ab('0x4')](_0x442a85+':'+_0x12c651['id'],_0x12c651);ChatGroupEvents[_0x64ab('0x4')](_0x442a85,_0x12c651);_0x36ea2e(null);};}for(var e in events){if(events[_0x64ab('0x5')](e)){var event=events[e];ChatGroup[_0x64ab('0x6')](e,emitEvent(event));}}module[_0x64ab('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ced4a1e..ae4038f 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 _0x2ebd=['moment','path','rimraf','exports','define','chat_groups','lodash','util','api'];(function(_0x1978cf,_0x106e44){var _0x7ec3f5=function(_0x5dbc39){while(--_0x5dbc39){_0x1978cf['push'](_0x1978cf['shift']());}};_0x7ec3f5(++_0x106e44);}(_0x2ebd,0xde));var _0xd2eb=function(_0x5ce528,_0x43f173){_0x5ce528=_0x5ce528-0x0;var _0x138c3b=_0x2ebd[_0x5ce528];return _0x138c3b;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var logger=require('../../config/logger')(_0xd2eb('0x2'));var moment=require(_0xd2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2eb('0x4'));var rimraf=require(_0xd2eb('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xd2eb('0x6')]=function(_0x1d8e1b,_0x1c6857){return _0x1d8e1b[_0xd2eb('0x7')]('ChatGroup',attributes,{'tableName':_0xd2eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a3f=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','ChatGroup','chat_groups'];(function(_0x18c59c,_0x5006cc){var _0x525e64=function(_0x2deacc){while(--_0x2deacc){_0x18c59c['push'](_0x18c59c['shift']());}};_0x525e64(++_0x5006cc);}(_0x4a3f,0xea));var _0xf4a3=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x4a3f[_0x36f243];return _0x426436;};'use strict';var _=require('lodash');var util=require(_0xf4a3('0x0'));var logger=require(_0xf4a3('0x1'))(_0xf4a3('0x2'));var moment=require('moment');var BPromise=require(_0xf4a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4a3('0x4'));var rimraf=require(_0xf4a3('0x5'));var config=require(_0xf4a3('0x6'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2f2042,_0x2584c7){return _0x2f2042['define'](_0xf4a3('0x7'),attributes,{'tableName':_0xf4a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index f7ae34f..299f95a 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 _0x3c7e=['result','catch','util','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','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x3c7e,0xdb));var _0xe3c7=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x3c7e[_0xa2049b];return _0x2fd615;};'use strict';var _=require('lodash');var util=require(_0xe3c7('0x0'));var moment=require('moment');var BPromise=require(_0xe3c7('0x1'));var rs=require(_0xe3c7('0x2'));var fs=require('fs');var Redis=require(_0xe3c7('0x3'));var db=require(_0xe3c7('0x4'))['db'];var utils=require(_0xe3c7('0x5'));var logger=require(_0xe3c7('0x6'))(_0xe3c7('0x7'));var config=require(_0xe3c7('0x8'));var jayson=require(_0xe3c7('0x9'));var client=jayson[_0xe3c7('0xa')][_0xe3c7('0xb')]({'port':0x232a});config[_0xe3c7('0xc')]=_[_0xe3c7('0xd')](config[_0xe3c7('0xc')],{'host':_0xe3c7('0xe'),'port':0x18eb});var socket=require(_0xe3c7('0xf'))(new Redis(config[_0xe3c7('0xc')]));require(_0xe3c7('0x10'))[_0xe3c7('0x11')](socket);function respondWithRpcPromise(_0x358556,_0x596de9,_0x54a3fb){return new BPromise(function(_0x4fcf72,_0x59becd){return client[_0xe3c7('0x12')](_0x358556,_0x54a3fb)[_0xe3c7('0x13')](function(_0x52cf90){logger['info'](_0xe3c7('0x14'),_0x596de9,_0xe3c7('0x15'));logger[_0xe3c7('0x16')](_0xe3c7('0x17'),_0x596de9,_0xe3c7('0x15'),JSON[_0xe3c7('0x18')](_0x52cf90));if(_0x52cf90[_0xe3c7('0x19')]){if(_0x52cf90['error'][_0xe3c7('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x59becd(_0x52cf90[_0xe3c7('0x19')]['message']);}logger[_0xe3c7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x4fcf72(_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);}else{logger[_0xe3c7('0x1c')](_0xe3c7('0x14'),_0x596de9,'request\x20sent');_0x4fcf72(_0x52cf90[_0xe3c7('0x1d')]['message']);}})[_0xe3c7('0x1e')](function(_0x13f5bc){logger[_0xe3c7('0x19')](_0xe3c7('0x14'),_0x596de9,_0x13f5bc);_0x59becd(_0x13f5bc);});});} \ No newline at end of file +var _0x6fad=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x441f33,_0x4e41e0){var _0x13816e=function(_0x240b59){while(--_0x240b59){_0x441f33['push'](_0x441f33['shift']());}};_0x13816e(++_0x4e41e0);}(_0x6fad,0x174));var _0xd6fa=function(_0x34b245,_0xfe65b4){_0x34b245=_0x34b245-0x0;var _0x3a8984=_0x6fad[_0x34b245];return _0x3a8984;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6fa('0x5'));var logger=require(_0xd6fa('0x6'))(_0xd6fa('0x7'));var config=require(_0xd6fa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x9')][_0xd6fa('0xa')]({'port':0x232a});config[_0xd6fa('0xb')]=_[_0xd6fa('0xc')](config['redis'],{'host':_0xd6fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6fa('0xb')]));require(_0xd6fa('0xe'))[_0xd6fa('0xf')](socket);function respondWithRpcPromise(_0x18b286,_0x331241,_0x491b11){return new BPromise(function(_0x4ff747,_0xbd7cee){return client[_0xd6fa('0x10')](_0x18b286,_0x491b11)[_0xd6fa('0x11')](function(_0x410494){logger[_0xd6fa('0x12')]('ChatGroup,\x20%s,\x20%s',_0x331241,'request\x20sent');logger[_0xd6fa('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x331241,'request\x20sent',JSON[_0xd6fa('0x14')](_0x410494));if(_0x410494[_0xd6fa('0x15')]){if(_0x410494[_0xd6fa('0x15')][_0xd6fa('0x16')]===0x1f4){logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x410494[_0xd6fa('0x15')][_0xd6fa('0x18')]);return _0xbd7cee(_0x410494[_0xd6fa('0x15')]['message']);}logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x410494[_0xd6fa('0x15')][_0xd6fa('0x18')]);return _0x4ff747(_0x410494['error']['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x331241,'request\x20sent');_0x4ff747(_0x410494[_0xd6fa('0x19')]['message']);}})[_0xd6fa('0x1a')](function(_0x4bf723){logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x4bf723);_0xbd7cee(_0x4bf723);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9817b7a..6c3906f 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 _0x244e=['emit','register','length','chatGroup:','./chatGroup.events','remove','update'];(function(_0x16c2e0,_0x3dc335){var _0x49b690=function(_0x5bb015){while(--_0x5bb015){_0x16c2e0['push'](_0x16c2e0['shift']());}};_0x49b690(++_0x3dc335);}(_0x244e,0x19a));var _0xe244=function(_0x5e3c95,_0x380914){_0x5e3c95=_0x5e3c95-0x0;var _0x1692d8=_0x244e[_0x5e3c95];return _0x1692d8;};'use strict';var ChatGroupEvents=require(_0xe244('0x0'));var events=['save',_0xe244('0x1'),_0xe244('0x2')];function createListener(_0x15452d,_0x3ebe61){return function(_0x181f1d){_0x3ebe61[_0xe244('0x3')](_0x15452d,_0x181f1d);};}function removeListener(_0x4968d4,_0x355301){return function(){ChatGroupEvents['removeListener'](_0x4968d4,_0x355301);};}exports[_0xe244('0x4')]=function(_0x19dc91){for(var _0x4c519f=0x0,_0x2a7d57=events[_0xe244('0x5')];_0x4c519f<_0x2a7d57;_0x4c519f++){var _0x46bbf5=events[_0x4c519f];var _0x4ed2c9=createListener(_0xe244('0x6')+_0x46bbf5,_0x19dc91);ChatGroupEvents['on'](_0x46bbf5,_0x4ed2c9);}}; \ No newline at end of file +var _0xdd02=['update','emit','removeListener','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2c12d6,_0x3fc532){var _0x5db894=function(_0x2d71ca){while(--_0x2d71ca){_0x2c12d6['push'](_0x2c12d6['shift']());}};_0x5db894(++_0x3fc532);}(_0xdd02,0x1e5));var _0x2dd0=function(_0x26d5c0,_0x118e5b){_0x26d5c0=_0x26d5c0-0x0;var _0x5d4475=_0xdd02[_0x26d5c0];return _0x5d4475;};'use strict';var ChatGroupEvents=require(_0x2dd0('0x0'));var events=[_0x2dd0('0x1'),_0x2dd0('0x2'),_0x2dd0('0x3')];function createListener(_0x3e22ef,_0x38b5fb){return function(_0x408f7e){_0x38b5fb[_0x2dd0('0x4')](_0x3e22ef,_0x408f7e);};}function removeListener(_0x497113,_0x58188e){return function(){ChatGroupEvents[_0x2dd0('0x5')](_0x497113,_0x58188e);};}exports[_0x2dd0('0x6')]=function(_0x2d89f1){for(var _0x107433=0x0,_0x583b87=events['length'];_0x107433<_0x583b87;_0x107433++){var _0x3f6f78=events[_0x107433];var _0x4816dc=createListener(_0x2dd0('0x7')+_0x3f6f78,_0x2d89f1);ChatGroupEvents['on'](_0x3f6f78,_0x4816dc);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index caa4cda..6c5a92b 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 _0xb59e=['getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages'];(function(_0x1bbbbb,_0x26bf4b){var _0x2b089d=function(_0x12e092){while(--_0x12e092){_0x1bbbbb['push'](_0x1bbbbb['shift']());}};_0x2b089d(++_0x26bf4b);}(_0xb59e,0x76));var _0xeb59=function(_0x16268a,_0x3cc445){_0x16268a=_0x16268a-0x0;var _0x5b4384=_0xb59e[_0x16268a];return _0x5b4384;};'use strict';var multer=require('multer');var util=require(_0xeb59('0x0'));var path=require(_0xeb59('0x1'));var timeout=require('connect-timeout');var express=require(_0xeb59('0x2'));var router=express[_0xeb59('0x3')]();var fs_extra=require(_0xeb59('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb59('0x5'));router[_0xeb59('0x6')]('/',auth['isAuthenticated'](),controller[_0xeb59('0x7')]);router['get'](_0xeb59('0x8'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xa')]);router[_0xeb59('0x6')](_0xeb59('0xb'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xc')]);router[_0xeb59('0x6')](_0xeb59('0xd'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xe')]);router[_0xeb59('0x6')](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['getMembers']);router['get'](_0xeb59('0x10'),auth[_0xeb59('0x9')](),controller[_0xeb59('0x11')]);router[_0xeb59('0x12')]('/',auth[_0xeb59('0x9')](),controller[_0xeb59('0x13')]);router[_0xeb59('0x12')](_0xeb59('0xf'),auth['isAuthenticated'](),controller[_0xeb59('0x14')]);router[_0xeb59('0x12')](_0xeb59('0x10'),auth['isAuthenticated'](),controller[_0xeb59('0x15')]);router[_0xeb59('0x16')]('/:id',auth[_0xeb59('0x9')](),controller[_0xeb59('0x17')]);router[_0xeb59('0x18')](_0xeb59('0xb'),auth['isAuthenticated'](),controller[_0xeb59('0x19')]);router['delete'](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['removeMembers']);module[_0xeb59('0x1a')]=router; \ No newline at end of file +var _0x4cb7=['getUnread','getMessages','post','create','addMembers','/:id/messages','addMessage','/:id','delete','/:id/members','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','isAuthenticated','show','/:id/unread'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x4cb7,0x15b));var _0x74cb=function(_0xfa1bf5,_0x3b153d){_0xfa1bf5=_0xfa1bf5-0x0;var _0x2c4951=_0x4cb7[_0xfa1bf5];return _0x2c4951;};'use strict';var multer=require(_0x74cb('0x0'));var util=require(_0x74cb('0x1'));var path=require(_0x74cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x74cb('0x3'));var router=express[_0x74cb('0x4')]();var fs_extra=require(_0x74cb('0x5'));var auth=require(_0x74cb('0x6'));var interaction=require(_0x74cb('0x7'));var config=require(_0x74cb('0x8'));var controller=require(_0x74cb('0x9'));router[_0x74cb('0xa')]('/',auth['isAuthenticated'](),controller[_0x74cb('0xb')]);router[_0x74cb('0xa')](_0x74cb('0xc'),auth['isAuthenticated'](),controller[_0x74cb('0xd')]);router[_0x74cb('0xa')]('/:id',auth[_0x74cb('0xe')](),controller[_0x74cb('0xf')]);router['get'](_0x74cb('0x10'),auth[_0x74cb('0xe')](),controller[_0x74cb('0x11')]);router['get']('/:id/members',auth[_0x74cb('0xe')](),controller['getMembers']);router[_0x74cb('0xa')]('/:id/messages',auth[_0x74cb('0xe')](),controller[_0x74cb('0x12')]);router[_0x74cb('0x13')]('/',auth[_0x74cb('0xe')](),controller[_0x74cb('0x14')]);router['post']('/:id/members',auth[_0x74cb('0xe')](),controller[_0x74cb('0x15')]);router[_0x74cb('0x13')](_0x74cb('0x16'),auth['isAuthenticated'](),controller[_0x74cb('0x17')]);router['put'](_0x74cb('0x18'),auth[_0x74cb('0xe')](),controller['update']);router[_0x74cb('0x19')](_0x74cb('0x18'),auth[_0x74cb('0xe')](),controller['destroy']);router[_0x74cb('0x19')](_0x74cb('0x1a'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x74cb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 0c89641..4cd715d 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 _0x8b29=['sequelize','BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x2e6bc2,_0x550f2a){var _0x1f3356=function(_0x4953c6){while(--_0x4953c6){_0x2e6bc2['push'](_0x2e6bc2['shift']());}};_0x1f3356(++_0x550f2a);}(_0x8b29,0xbe));var _0x98b2=function(_0x1f9e49,_0x359b05){_0x1f9e49=_0x1f9e49-0x0;var _0x54e24f=_0x8b29[_0x1f9e49];return _0x54e24f;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'closed':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x98b2('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x98b2('0x3')),'defaultValue':_0x98b2('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x98b2('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x98b2('0x6')]},'disposition':{'type':Sequelize[_0x98b2('0x7')]},'secondDisposition':{'type':Sequelize[_0x98b2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x98b2('0x7')]},'note':{'type':Sequelize[_0x98b2('0x7')]},'browserName':{'type':Sequelize[_0x98b2('0x7')]},'browserVersion':{'type':Sequelize[_0x98b2('0x7')]},'osName':{'type':Sequelize[_0x98b2('0x7')]},'osVersion':{'type':Sequelize[_0x98b2('0x7')]},'deviceModel':{'type':Sequelize[_0x98b2('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x98b2('0x5')]},'customerIp':{'type':Sequelize[_0x98b2('0x7')]},'formData':{'type':Sequelize[_0x98b2('0x5')](_0x98b2('0x8'))},'read1stAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x98b2('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x98b2('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x98b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xfe9d=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x408f00,_0x2f6546){var _0x4ff564=function(_0x38cd0b){while(--_0x38cd0b){_0x408f00['push'](_0x408f00['shift']());}};_0x4ff564(++_0x2f6546);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x43c031,_0x83fec1){_0x43c031=_0x43c031-0x0;var _0x13b6f3=_0xfe9d[_0x43c031];return _0x13b6f3;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'closed':{'type':Sequelize[_0xdfe9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdfe9('0x3')]},'ratingType':{'type':Sequelize[_0xdfe9('0x4')]('star',_0xdfe9('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xdfe9('0x6')]},'pathTranscript':{'type':Sequelize[_0xdfe9('0x6')]},'mailTranscript':{'type':Sequelize[_0xdfe9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdfe9('0x8')]},'disposition':{'type':Sequelize[_0xdfe9('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdfe9('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xdfe9('0x7')]},'osName':{'type':Sequelize[_0xdfe9('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdfe9('0x7')]},'deviceVendor':{'type':Sequelize[_0xdfe9('0x7')]},'deviceType':{'type':Sequelize[_0xdfe9('0x7')]},'referer':{'type':Sequelize[_0xdfe9('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xdfe9('0x6')](_0xdfe9('0x9'))},'read1stAt':{'type':Sequelize[_0xdfe9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xdfe9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xdfe9('0x4')]('in',_0xdfe9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdfe9('0x7')]},'customerPort':{'type':Sequelize[_0xdfe9('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xdfe9('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xdfe9('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1ae157d..e678b1d 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 _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x59b058,_0x5f4c38){var _0x5cb986=function(_0x54ee4c){while(--_0x54ee4c){_0x59b058['push'](_0x59b058['shift']());}};_0x5cb986(++_0x5f4c38);}(_0xd943,0x15d));var _0x3d94=function(_0x2c98ed,_0x42db72){_0x2c98ed=_0x2c98ed-0x0;var _0x4b5cf7=_0xd943[_0x2c98ed];return _0x4b5cf7;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));}; \ No newline at end of file +var _0x1a85=['System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','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','YYYY-MM-DD\x20HH:mm:ss','findAll','nolimit','includeAgent','rows','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','body','contact','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','params','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','isNull','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','CmContact','%s%d','agentAlias'];(function(_0xa8ec17,_0x350c66){var _0x2760bf=function(_0x5a4c25){while(--_0x5a4c25){_0xa8ec17['push'](_0xa8ec17['shift']());}};_0x2760bf(++_0x350c66);}(_0x1a85,0x178));var _0x51a8=function(_0x16360c,_0x37c098){_0x16360c=_0x16360c-0x0;var _0x17dd2d=_0x1a85[_0x16360c];return _0x17dd2d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var pdf=require(_0x51a8('0x10'));var hardwareService=require(_0x51a8('0x11'));var logger=require(_0x51a8('0x12'))(_0x51a8('0x13'));var utils=require(_0x51a8('0x14'));var config=require(_0x51a8('0x15'));var licenseUtil=require(_0x51a8('0x16'));var db=require(_0x51a8('0x17'))['db'];config[_0x51a8('0x18')]=_[_0x51a8('0x19')](config[_0x51a8('0x18')],{'host':_0x51a8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51a8('0x18')]));require(_0x51a8('0x1b'))[_0x51a8('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0x51a8('0x1d')][_0x51a8('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x39cd45,_0x2b0521,_0x3fbd02,_0x3e0603){return new BPromise(function(_0x1f49ee,_0x516abc){var _0x1c2f25=_0x3e0603||client;return _0x1c2f25[_0x51a8('0x1f')](_0x39cd45,_0x3fbd02)[_0x51a8('0x20')](function(_0x23539e){logger[_0x51a8('0x21')](_0x51a8('0x22'),_0x2b0521,'request\x20sent');logger[_0x51a8('0x23')](_0x51a8('0x24'),_0x2b0521,_0x51a8('0x25'),JSON[_0x51a8('0x26')](_0x23539e));if(_0x23539e[_0x51a8('0x27')]){if(_0x23539e[_0x51a8('0x27')][_0x51a8('0x28')]===0x1f4){logger[_0x51a8('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x23539e[_0x51a8('0x27')]['message']);return _0x516abc(_0x23539e[_0x51a8('0x27')][_0x51a8('0x29')]);}logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x23539e['error'][_0x51a8('0x29')]);return _0x1f49ee(_0x23539e['error']['message']);}else{logger[_0x51a8('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x51a8('0x25'));_0x1f49ee(_0x23539e[_0x51a8('0x2a')][_0x51a8('0x29')]);}})[_0x51a8('0x2b')](function(_0x157554){logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x157554);_0x516abc(_0x157554);});});}function respondWithStatusCode(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0xcc;return function(_0x273ce2){if(_0x273ce2){return _0x1326a2[_0x51a8('0x2c')](_0x5b3f49);}return _0x1326a2[_0x51a8('0x2d')](_0x5b3f49)[_0x51a8('0x2e')]();};}function respondWithResult(_0x1c150d,_0x11aefc){_0x11aefc=_0x11aefc||0xc8;return function(_0x1a886f){if(_0x1a886f){return _0x1c150d[_0x51a8('0x2d')](_0x11aefc)[_0x51a8('0x2f')](_0x1a886f);}};}function respondWithFilteredResult(_0x4b5cda,_0x20c6b5){return function(_0x347a02){if(_0x347a02){var _0x4a1548=typeof _0x20c6b5[_0x51a8('0x30')]==='undefined'&&typeof _0x20c6b5[_0x51a8('0x31')]===_0x51a8('0x32');var _0x143f46=_0x347a02[_0x51a8('0x33')];var _0x2136b4=_0x4a1548?0x0:_0x20c6b5['offset'];var _0x10c19b=_0x4a1548?_0x347a02['count']:_0x20c6b5[_0x51a8('0x30')]+_0x20c6b5[_0x51a8('0x31')];var _0x253a59;if(_0x10c19b>=_0x143f46){_0x10c19b=_0x143f46;_0x253a59=0xc8;}else{_0x253a59=0xce;}_0x4b5cda['status'](_0x253a59);return _0x4b5cda[_0x51a8('0x34')]('Content-Range',_0x2136b4+'-'+_0x10c19b+'/'+_0x143f46)[_0x51a8('0x2f')](_0x347a02);}return null;};}function patchUpdates(_0x192ac4){return function(_0x1ba6a7){try{jsonpatch[_0x51a8('0x35')](_0x1ba6a7,_0x192ac4,!![]);}catch(_0x193e0f){return BPromise['reject'](_0x193e0f);}return _0x1ba6a7[_0x51a8('0x36')]();};}function saveUpdates(_0x53b3b6,_0x9f0e6){return function(_0x2d977b){if(_0x2d977b){return _0x2d977b[_0x51a8('0x37')](_0x53b3b6)['then'](function(_0x1f9cfc){return _0x1f9cfc;});}return null;};}function removeEntity(_0xdc6cc7,_0x2b7833){return function(_0x2429f8){if(_0x2429f8){return _0x2429f8[_0x51a8('0x38')]()['then'](function(){_0xdc6cc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b871,_0x299001){return function(_0x4ec1db){if(!_0x4ec1db){_0x21b871[_0x51a8('0x2c')](0x194);}return _0x4ec1db;};}function handleError(_0x4ec0ac,_0x13723b){_0x13723b=_0x13723b||0x1f4;return function(_0x38aa25){logger[_0x51a8('0x27')](_0x38aa25[_0x51a8('0x39')]);if(_0x38aa25[_0x51a8('0x3a')]){delete _0x38aa25[_0x51a8('0x3a')];}_0x4ec0ac['status'](_0x13723b)['send'](_0x38aa25);};}function getMustacheRender(_0x377b4c,_0x5f524e){return Mustache['render'](_0x377b4c,_['merge'](_0x5f524e[_0x51a8('0x3b')],{'contact':_0x5f524e[_0x51a8('0x3c')],'message':_0x5f524e[_0x51a8('0x29')],'agent':_0x5f524e['agent'],'interaction':_0x5f524e[_0x51a8('0x3d')],'account':_0x5f524e[_0x51a8('0x3e')]}))||'';}function getInteractionUsers(_0x2e6432,_0x310ad2){return new BPromise(function(_0x5d3983,_0x19fa98){try{if(_0x310ad2[_0x2e6432['id']]){_0x2e6432[_0x51a8('0x3f')]=_[_0x51a8('0x40')](_0x310ad2[_0x2e6432['id']],function(_0x4dcbfb){return{'id':_0x4dcbfb['id'],'fullname':_0x4dcbfb[_0x51a8('0x41')]};});}}catch(_0x51d7bd){_0x19fa98(_0x51d7bd);}_0x5d3983(_0x2e6432);});}function getInteractionTags(_0x2032c0,_0x1e637a){return new BPromise(function(_0x2a98bd,_0x37d50b){try{if(_0x2032c0['TagIds']){_0x2032c0[_0x51a8('0x42')]=[];_0x2032c0[_0x51a8('0x43')][_0x51a8('0x44')](',')[_0x51a8('0x45')](function(_0xa33fc){_0x2032c0[_0x51a8('0x42')][_0x51a8('0x46')](_0x1e637a[_0xa33fc]);});}delete _0x2032c0[_0x51a8('0x43')];}catch(_0x3b15c7){_0x37d50b(_0x3b15c7);}_0x2a98bd(_0x2032c0);});}function updateChatInteraction(_0x4b8467,_0x22e6e6,_0x2afb74){return new BPromise(function(_0x4c7c67,_0x53409d){return getInteractionUsers(_0x4b8467,_0x2afb74)[_0x51a8('0x20')](function(_0x19a57c){return getInteractionTags(_0x19a57c,_0x22e6e6);})[_0x51a8('0x20')](function(_0x27b8e5){_0x4c7c67(_0x27b8e5);})[_0x51a8('0x2b')](function(_0x157a51){_0x53409d(_0x157a51);});});}exports[_0x51a8('0x47')]=function(_0x18c697,_0x26ad89){var _0x2e80ed={},_0x4bdee0={},_0x416988={'count':0x0,'rows':[]};var _0x218ae0=_[_0x51a8('0x40')](db[_0x51a8('0x48')][_0x51a8('0x49')],function(_0x22ff0e){return{'name':_0x22ff0e['fieldName'],'type':_0x22ff0e[_0x51a8('0x4a')]['key']};});_0x4bdee0[_0x51a8('0x4b')]=_[_0x51a8('0x40')](_0x218ae0,_0x51a8('0x3a'));_0x4bdee0[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x18c697['query']);_0x4bdee0['filters']=_[_0x51a8('0x4e')](_0x4bdee0[_0x51a8('0x4b')],_0x4bdee0[_0x51a8('0x4c')]);_0x2e80ed[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4bdee0['model'],qs['fields'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2e80ed[_0x51a8('0x4f')]=_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x51')]?_0x2e80ed[_0x51a8('0x4f')]:_0x4bdee0[_0x51a8('0x4b')];if(!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x52')]('nolimit')){_0x2e80ed['limit']=qs['limit'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x31')]);_0x2e80ed[_0x51a8('0x30')]=qs['offset'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2e80ed['order']=qs[_0x51a8('0x53')](_0x18c697['query']['sort']);_0x2e80ed[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x18c697['query'],_0x4bdee0['filters']),_0x218ae0);var _0x3a8f1e=[];var _0x5b0398=squel[_0x51a8('0x57')]()[_0x51a8('0x58')]('id')[_0x51a8('0x58')](_0x51a8('0x3a'))[_0x51a8('0x58')](_0x51a8('0x59'))[_0x51a8('0x5a')](_0x51a8('0x5b'));var _0x29d31e=squel['select']()[_0x51a8('0x58')](_0x51a8('0x5c'))[_0x51a8('0x58')](_0x51a8('0x5d'))['field'](_0x51a8('0x5e'))['from'](_0x51a8('0x5f'),'ui')[_0x51a8('0x60')]('users','u','u.id\x20=\x20ui.UserId');var _0x2628d4=squel[_0x51a8('0x57')]()[_0x51a8('0x5a')](_0x51a8('0x61'),'i')[_0x51a8('0x60')]('cm_contacts','c',_0x51a8('0x62'))[_0x51a8('0x60')](_0x51a8('0x63'),'o',_0x51a8('0x64'))[_0x51a8('0x60')]('chat_websites','a',_0x51a8('0x65'))[_0x51a8('0x60')](_0x51a8('0x66'),'me',_0x51a8('0x67'))[_0x51a8('0x60')](_0x51a8('0x68'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2048c6=squel[_0x51a8('0x69')]();var _0x51f9f7=[];var _0x7ac0ae=squel['expr']();var _0x41cc00;if(_0x18c697['query'][_0x51a8('0x6a')]){_0x41cc00=as[_0x51a8('0x6b')](_0x18c697['query']['search']);var _0x5eb540=_0x41cc00[_0x51a8('0x6c')];for(var _0x1ead77=0x0;_0x1ead77<_0x41cc00[_0x51a8('0x6d')][_0x51a8('0x51')];_0x1ead77++){var _0x149047=_0x41cc00[_0x51a8('0x6d')][_0x1ead77];var _0x3fd347='i';var _0x259153=_['find'](_0x218ae0,[_0x51a8('0x3a'),_0x149047[_0x51a8('0x58')]]);if(!_0x259153){switch(_0x149047['field']){case _0x51a8('0x6e'):if(_0x149047[_0x51a8('0x6f')]==0x1){_0x2628d4[_0x51a8('0x70')]('`'+_0x149047[_0x51a8('0x58')]+_0x51a8('0x71'));}else{_0x2628d4[_0x51a8('0x70')]('`'+_0x149047['field']+'`\x20>\x200');}break;case _0x51a8('0x72'):if(_0x149047['operator']==='$substring'){if(_0x149047['value']['split']('\x20')['length']>0x1){_0x2048c6[_0x5eb540](_0x51a8('0x73'),qs['getFullTextValue'](_0x149047[_0x51a8('0x6f')]),null);}else{var _0x4772cd='%'+_0x149047[_0x51a8('0x6f')]+'%';_0x2048c6[_0x5eb540](_0x51a8('0x74'),_0x4772cd,_0x4772cd,_0x4772cd);}}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),_0x51a8('0x76')]);_0x149047[_0x51a8('0x58')]=_0x51a8('0x76');_0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074['value']['end']);}break;case'Tag':var _0x10c22e=_0x149047[_0x51a8('0x6f')][_0x51a8('0x44')](',')[_0x51a8('0x40')](function(_0x2efb36){return Number(_0x2efb36);});_0x10c22e[_0x51a8('0x45')](function(_0x351c22){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x351c22+',%');});_0x51f9f7=_[_0x51a8('0x7b')](_0x51f9f7,_0x10c22e);break;case _0x51a8('0x7c'):if(_0x149047[_0x51a8('0x7d')]===_0x51a8('0x7e')){_0x2048c6[_0x5eb540](_0x51a8('0x7f'),'%'+_0x149047['value']+'%',null);}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),'UserId']);_0x149047[_0x51a8('0x58')]='UserId';_0x238074=as['buildExpression'](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);}break;case _0x51a8('0x3b'):_0x238074=as[_0x51a8('0x77')]('me',null,_0x149047);_0x2048c6[_0x5eb540](_0x238074['text'],_0x238074['value']['start'],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);break;}}else{var _0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153[_0x51a8('0x4a')],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074['value'][_0x51a8('0x79')],_0x238074['value'][_0x51a8('0x2e')]);}}}else{var _0x1be70f=_(_0x18c697[_0x51a8('0x4c')])[_0x51a8('0x4d')]()[_0x51a8('0x40')](function(_0x3aca4a){return _[_0x51a8('0x80')](_0x218ae0,[_0x51a8('0x3a'),_0x3aca4a])?_0x3aca4a:undefined;})[_0x51a8('0x81')]()[_0x51a8('0x6f')]();if(!_[_0x51a8('0x82')](_0x1be70f)){_0x1be70f['forEach'](function(_0x4b99cb){if(_0x4b99cb===_0x51a8('0x83')){_0x2628d4[_0x51a8('0x54')](_0x51a8('0x84'),[][_0x51a8('0x85')](_0x18c697['query'][_0x4b99cb]));}else if(_0x4b99cb===_0x51a8('0x86')){var _0x4d418a=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x88')];var _0x24fcc3=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x89')];_0x2628d4[_0x51a8('0x54')](_0x51a8('0x8a'),_0x4d418a,_0x24fcc3);}else{if(_0x18c697['query'][_0x4b99cb]===_0x51a8('0x8b')){_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+_0x51a8('0x8c'));}else{_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+'\x20=\x20?',_0x18c697['query'][_0x4b99cb]);}}});}if(_0x18c697[_0x51a8('0x4c')]['read']){if(_0x18c697['query']['read']==0x1){_0x2628d4[_0x51a8('0x70')]('`unreadMessages`\x20=\x200');}else{_0x2628d4['having'](_0x51a8('0x8d'));}}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]){_0x51f9f7=_['isArray'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')])?_0x18c697[_0x51a8('0x4c')]['tag']:new Array(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]);_0x51f9f7[_0x51a8('0x45')](function(_0x16e90a){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x16e90a+',%');});}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8f')]){var _0x245f5b=_0x18c697[_0x51a8('0x4c')]['filter'][_0x51a8('0x90')]('\x5c','\x5c\x5c')[_0x51a8('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x245f5b)){_0x2048c6['or'](_0x51a8('0x91'),_0x245f5b+'%');}else{_0x2048c6['or'](_0x51a8('0x92'),qs['getFullTextValue'](_0x245f5b))['or'](_0x51a8('0x93'),_0x245f5b+'%');}}}_0x2628d4[_0x51a8('0x54')](_0x2048c6);_0x2628d4[_0x51a8('0x94')](_0x51a8('0x95'));var _0x398fb2={'type':db['Sequelize'][_0x51a8('0x96')][_0x51a8('0x97')],'raw':!![]};var _0x12d018=_0x2628d4[_0x51a8('0x98')]();_0x12d018['field'](_0x51a8('0x95'));_0x12d018[_0x51a8('0x58')](_0x51a8('0x99'),_0x51a8('0x6e'));if(_0x2e80ed[_0x51a8('0x9a')]){_0x2e80ed[_0x51a8('0x9a')][_0x51a8('0x45')](function(_0xd22e7b){var _0x540c86=_0xd22e7b[0x0]===_0x51a8('0x9b')?_0xd22e7b[0x0]:'i.'+_0xd22e7b[0x0];_0x2628d4[_0x51a8('0x9a')](_0x540c86,_0xd22e7b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x51a8('0x82')](_0x51f9f7)){_0x2628d4[_0x51a8('0x70')](_0x7ac0ae);_0x12d018['where'](_0x51a8('0x9c'),_0x51f9f7);}BPromise['resolve']()['then'](function(){if(!_0x41cc00){if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return;_0x12d018[_0x51a8('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2628d4['where'](_0x51a8('0x9d'));return;}if(_0x18c697['user'][_0x51a8('0x9e')]!==_0x51a8('0x9f'))return;return _0x18c697[_0x51a8('0xa0')][_0x51a8('0xa1')]({'attributes':['id'],'raw':!![]})[_0x51a8('0x20')](function(_0x28acb8){if(_[_0x51a8('0x82')](_0x28acb8)){_0x12d018[_0x51a8('0x54')](_0x51a8('0xa2'));_0x2628d4[_0x51a8('0x54')](_0x51a8('0xa2'));}else{_0x12d018[_0x51a8('0x54')](_0x51a8('0x84'),_[_0x51a8('0x40')](_0x28acb8,'id'));_0x2628d4[_0x51a8('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x28acb8,'id'));}});})[_0x51a8('0x20')](function(){if(_0x18c697['user']['role']==='agent'&&!_0x41cc00&&!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return[];return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x12d018['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x343fec){_0x416988['count']=_0x343fec[_0x51a8('0x51')];if(_0x416988[_0x51a8('0x33')]===0x0)return[];return db['sequelize']['query'](_0x5b0398[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x8587b9){_0x3a8f1e=_[_0x51a8('0xa5')](_0x8587b9,'id');_0x398fb2=_[_0x51a8('0xa6')](_0x398fb2,{'model':db[_0x51a8('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18c697['query'][_0x51a8('0x50')]){_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x45')](function(_0x566d62){_0x2628d4[_0x51a8('0x58')]('i.'+_0x566d62);});}else{_0x2628d4[_0x51a8('0x58')](_0x51a8('0x99'),'unreadMessages');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa7'),'Account.key');_0x2628d4[_0x51a8('0x58')]('a.mandatoryDisposition',_0x51a8('0xa8'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa9'),_0x51a8('0x9b'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xaa'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xab'),'Contact.firstName');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xac'),_0x51a8('0xad'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xae'),'Contact.email');_0x2628d4['field'](_0x51a8('0xaf'),_0x51a8('0xb0'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb1'),_0x51a8('0xb2'));_0x2628d4['field'](_0x51a8('0xb3'),'Contact.fax');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb4'),'Owner.fullname');_0x2628d4[_0x51a8('0x58')]('o.internal',_0x51a8('0xb5'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb6'),_0x51a8('0x43'));}if(_0x2e80ed[_0x51a8('0x31')])_0x2628d4['limit'](_0x2e80ed[_0x51a8('0x31')]);if(_0x2e80ed[_0x51a8('0x30')])_0x2628d4['offset'](_0x2e80ed[_0x51a8('0x30')]);return db[_0x51a8('0xa3')]['query'](_0x2628d4['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x158c45){if(_0x158c45[_0x51a8('0x51')]>0x0)_0x29d31e['where'](_0x51a8('0xb7'),_[_0x51a8('0x40')](_0x158c45,'id'));return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x29d31e[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x30bf44){var _0x5a32ce=_[_0x51a8('0xb8')](_0x30bf44,_0x51a8('0xb9'));var _0xa29735=[];_0x158c45[_0x51a8('0x45')](function(_0x4ef066){_0xa29735['push'](updateChatInteraction(_0x4ef066,_0x3a8f1e,_0x5a32ce));});return BPromise[_0x51a8('0xba')](_0xa29735);});});})[_0x51a8('0x20')](function(_0x58b25d){_0x416988['rows']=_0x58b25d;return _0x416988;})['then'](respondWithFilteredResult(_0x26ad89,_0x2e80ed))[_0x51a8('0x2b')](handleError(_0x26ad89,null));};exports['show']=function(_0x47c025,_0x517de1){var _0x2164d7={'raw':![],'where':{'id':_0x47c025[_0x51a8('0xbb')]['id']}},_0x4b03f7={};_0x4b03f7[_0x51a8('0x4b')]=_['keys'](db['ChatInteraction'][_0x51a8('0x49')]);_0x4b03f7['query']=_[_0x51a8('0x4d')](_0x47c025[_0x51a8('0x4c')]);_0x4b03f7['filters']=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],_0x4b03f7['query']);_0x2164d7[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],qs['fields'](_0x47c025[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2164d7[_0x51a8('0x4f')]=_0x2164d7['attributes']['length']?_0x2164d7[_0x51a8('0x4f')]:_0x4b03f7[_0x51a8('0x4b')];if(_0x47c025[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2164d7[_0x51a8('0xbd')]=[{'all':!![]}];}_0x2164d7=_[_0x51a8('0xa6')]({},_0x2164d7,_0x47c025[_0x51a8('0xbe')]);return db[_0x51a8('0x48')][_0x51a8('0x75')](_0x2164d7)[_0x51a8('0x20')](handleEntityNotFound(_0x517de1,null))[_0x51a8('0x20')](respondWithResult(_0x517de1,null))[_0x51a8('0x2b')](handleError(_0x517de1,null));};exports[_0x51a8('0xbf')]=function(_0x575c51,_0x4fdc39){return db[_0x51a8('0x48')][_0x51a8('0xbf')](_0x575c51[_0x51a8('0x3b')],{})[_0x51a8('0x20')](respondWithResult(_0x4fdc39,0xc9))[_0x51a8('0x2b')](handleError(_0x4fdc39,null));};exports['update']=function(_0x59a17d,_0x39e8e6){if(_0x59a17d[_0x51a8('0x3b')]['id']){delete _0x59a17d['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x59a17d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x39e8e6,null))[_0x51a8('0x20')](saveUpdates(_0x59a17d['body'],null))['then'](respondWithResult(_0x39e8e6,null))[_0x51a8('0x2b')](handleError(_0x39e8e6,null));};exports['destroy']=function(_0x96219,_0x5bd9a6){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x96219['params']['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x5bd9a6,null))[_0x51a8('0x20')](removeEntity(_0x5bd9a6,null))[_0x51a8('0x2b')](handleError(_0x5bd9a6,null));};exports[_0x51a8('0xc0')]=function(_0x5cacc1,_0x57b718){return db[_0x51a8('0x48')][_0x51a8('0xc0')]()[_0x51a8('0x20')](respondWithResult(_0x57b718,null))[_0x51a8('0x2b')](handleError(_0x57b718,null));};exports['createVidaooSession']=function(_0xaaa86f,_0x5ebf39){var _0x40a229=_0xaaa86f['params']['id'];var _0x1d03c1;var _0x1667b7;var _0x1ae73c;return db[_0x51a8('0x48')]['findOne']({'where':{'id':_0x40a229}})[_0x51a8('0x20')](function(_0x50ced7){_0x1d03c1=_0x50ced7;return db[_0x51a8('0xc1')][_0x51a8('0xc2')]({'where':{'id':_0x50ced7[_0x51a8('0x83')]},'attributes':['id','vidaooApiKey',_0x51a8('0xc3'),_0x51a8('0xc4'),_0x51a8('0xc5'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x14792a){if(_0x14792a&&_0x14792a[_0x51a8('0xc6')]&&_0x14792a[_0x51a8('0xc3')]){_0x1667b7=_0x14792a;var _0x706653={'interaction':{'id':_0x40a229},'agent':{'id':_0xaaa86f['user']['id'],'name':_0xaaa86f['user'][_0x51a8('0x3a')],'fullname':_0xaaa86f['user'][_0x51a8('0x41')],'email':_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]},'contact':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3c')],'account':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3e')]};var _0x5ec5f2={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x14792a[_0x51a8('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]],'buttons':null,'topic':_0x1667b7[_0x51a8('0xc4')],'note':_[_0x51a8('0xc8')](_0x1667b7['vidaooNote'])?null:getMustacheRender(_0x1667b7[_0x51a8('0xc5')],_0x706653),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x51a8('0xc8')](_0x1667b7[_0x51a8('0xc9')])){var _0x1dcdd9=getMustacheRender(_0x1667b7[_0x51a8('0xc9')],_0x706653);var _0x55d905=JSON['parse'](_0x1dcdd9);_0x5ec5f2[_0x51a8('0x3b')]['metadata']=_0x55d905;}}catch(_0x289366){throw new db[(_0x51a8('0xca'))][(_0x51a8('0xcb'))](_0x51a8('0xcc'));}return rp(_0x5ec5f2);}else{throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xcd'));}})[_0x51a8('0x20')](function(_0x26e672){_0x1ae73c=_0x26e672;if(_0x1ae73c['id']){var _0x3dbfd7={'body':_0x1ae73c[_0x51a8('0xce')],'ChatWebsiteId':_0x1667b7['id'],'ChatInteractionId':_0x1d03c1['id'],'direction':_0x51a8('0xcf'),'UserId':_0xaaa86f[_0x51a8('0xa0')]['id']};return db[_0x51a8('0xd0')][_0x51a8('0xbf')](_0x3dbfd7,{});}else{throw new db[(_0x51a8('0xca'))]['ValidationError'](_0x51a8('0xd1'));}})[_0x51a8('0x20')](function(){return _0x1d03c1[_0x51a8('0xd2')]({'vidaooSessionId':_0x1ae73c['id']});})[_0x51a8('0x20')](respondWithResult(_0x5ebf39,null))[_0x51a8('0x2b')](handleError(_0x5ebf39,null));};exports['customUpdate']=function(_0x3ed105,_0x4a48b4){if(_0x3ed105[_0x51a8('0x3b')]['id']){delete _0x3ed105['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x3ed105[_0x51a8('0xbb')]['id']},'include':[{'model':db['CmContact'],'as':_0x51a8('0x72')}]})[_0x51a8('0x20')](handleEntityNotFound(_0x4a48b4,null))[_0x51a8('0x20')](saveUpdates(_0x3ed105[_0x51a8('0x3b')],null))['then'](respondWithResult(_0x4a48b4,null))['catch'](handleError(_0x4a48b4,null));};exports['abandon']=function(_0x1e957d,_0x5ed8f1,_0x5ee996){if(_0x1e957d[_0x51a8('0x3b')]['id']){delete _0x1e957d[_0x51a8('0x3b')]['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x1e957d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](function(_0x5b316b){if(!_0x5b316b){logger[_0x51a8('0x27')](_0x51a8('0xd3'),'abandon',0x194,'entity\x20not\x20found');_0x5ed8f1[_0x51a8('0x2c')](0x194);}else{if(_0x5b316b[_0x51a8('0xd4')]){throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xd5'));}}return _0x5b316b;})[_0x51a8('0x20')](function(_0x3dbaa0){if(_0x3dbaa0){return _0x3dbaa0[_0x51a8('0x37')]({'closed':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd6')],'disposition':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd7')]})[_0x51a8('0x20')](function(_0xc7c551){return _0xc7c551;});}})[_0x51a8('0x20')](function(_0x441b16){return respondWithRpcPromise(_0x51a8('0xd8'),_0x51a8('0xd9'),_0x1e957d['body'],client9004);})[_0x51a8('0x20')](respondWithResult(_0x5ed8f1,null))[_0x51a8('0x2b')](handleError(_0x5ed8f1,null));};exports['attachmentUpload']=function(_0xbc8168,_0x1d9439,_0x4b137c){_0xbc8168[_0x51a8('0x3b')]['name']=_0xbc8168['file'][_0x51a8('0xda')];_0xbc8168['body'][_0x51a8('0xdb')]=_0xbc8168[_0x51a8('0xdc')][_0x51a8('0xdd')];_0xbc8168[_0x51a8('0x3b')]['type']=_0xbc8168['file']['mimetype'];return db['Attachment'][_0x51a8('0xbf')](_0xbc8168[_0x51a8('0x3b')])[_0x51a8('0x20')](respondWithResult(_0x1d9439,0xc9))[_0x51a8('0x2b')](handleError(_0x1d9439,null));};exports[_0x51a8('0xde')]=function(_0x953f85,_0x2d5307,_0x4d7035){return db['ChatInteraction'][_0x51a8('0xc2')]({'where':{'id':_0x953f85['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null))[_0x51a8('0x20')](function(_0x33bea4){if(_0x33bea4){if(_0x33bea4[_0x51a8('0xd6')]){return _0x2d5307[_0x51a8('0x2d')](0x193)[_0x51a8('0x2f')]({'status':0x193,'message':_0x51a8('0xdf')});}return db[_0x51a8('0xe0')][_0x51a8('0xc2')]({'where':{'id':_0x953f85[_0x51a8('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null));}})[_0x51a8('0x20')](function(_0x2d95eb){if(_0x2d95eb){var _0x2559e0=_0x2d95eb[_0x51a8('0xe1')]!==null;var _0x441034=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0xe4'));if(_0x2559e0){_0x441034=path[_0x51a8('0xe2')](_0x441034,_0x51a8('0xe5'));}var _0x4a55c0=path['join'](_0x441034,_0x2d95eb['basename']);return _0x2d5307[_0x51a8('0xe6')](_0x4a55c0);}})[_0x51a8('0x2b')](handleError(_0x2d5307,null));};exports[_0x51a8('0xe7')]=function(_0x58c6df,_0x44fa71){var _0x18179c=null;var _0x17cb9f=null;var _0x43b1d2=null;var _0x4f8535=null;if(_0x58c6df[_0x51a8('0x3b')]['id']){delete _0x58c6df[_0x51a8('0x3b')]['id'];}if(_0x58c6df['body'][_0x51a8('0xe8')]){_0x4f8535=path['join'](config[_0x51a8('0xe3')],_0x51a8('0xe9'),util[_0x51a8('0xea')](_0x51a8('0xeb'),Date['now']()));_0x58c6df[_0x51a8('0x3b')]['pathTranscript']=_0x4f8535;}return db['ChatInteraction'][_0x51a8('0x75')]({'where':{'id':_0x58c6df[_0x51a8('0xbb')]['id']},'include':[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'include':[{'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c')}]}]})[_0x51a8('0x20')](handleEntityNotFound(_0x44fa71,null))['then'](saveUpdates(_0x58c6df[_0x51a8('0x3b')],null))[_0x51a8('0x20')](function(_0x7aa19f){if(_0x7aa19f){_0x18179c=_0x7aa19f;return db[_0x51a8('0xc1')]['find']({'where':{'id':_0x18179c[_0x51a8('0x83')]}});}})[_0x51a8('0x20')](function(_0x350385){if(_0x350385){_0x43b1d2=_0x350385;return db[_0x51a8('0xed')]['find']({'where':{'id':_0x18179c[_0x51a8('0x76')]}});}})[_0x51a8('0x20')](function(_0x584235){if(_0x584235){_0x17cb9f=_0x584235;if(_0x4f8535){var _0x206c27=null;for(var _0x500112=0x1;_0x500112<_0x18179c[_0x51a8('0xec')][_0x51a8('0x51')];++_0x500112){_0x206c27=_0x18179c[_0x51a8('0xec')][_0x500112];var _0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');var _0x5c78b9=_0x58c6df['body'][_0x51a8('0xf1')]||util['format'](_0x51a8('0xee'),_0x51a8('0xf2'),_0x206c27[_0x51a8('0x76')]);switch(_0x43b1d2[_0x51a8('0xf3')]){case _0x51a8('0xf4'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')]('%s%d',_0x43b1d2['agentAlias'],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');break;case _0x51a8('0xf5'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27[_0x51a8('0x7c')][_0x51a8('0xf6')]||_0x206c27[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0');break;case _0x51a8('0xf7'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27['User']['fullname']:_0x51a8('0xf0');break;default:_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):'System';}var _0x13fb74=util[_0x51a8('0xea')]('[%s]\x20%s:\x20%s\x0a',moment(_0x206c27[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0xf8')),_0x206c27[_0x51a8('0xf9')]==='in'?_0x5c78b9:_0x24a6a8,_0x206c27['body']);if(!_0x206c27[_0x51a8('0xfa')]){fs[_0x51a8('0xfb')](_0x4f8535,_0x13fb74);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x51a8('0xfc')],'as':_0x51a8('0xfd'),'raw':!![]}]});}}})[_0x51a8('0x20')](function(_0x359e42){if(_0x359e42&&_0x359e42[_0x51a8('0xfd')]&&_0x58c6df[_0x51a8('0x3b')]){var _0x4eeff2={'tls':{'rejectUnauthorized':![]}};if(_0x359e42[_0x51a8('0xfd')]['service']){_0x4eeff2[_0x51a8('0xfe')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xfe')];}else{_0x4eeff2['host']=_0x359e42[_0x51a8('0xfd')]['host'];_0x4eeff2[_0x51a8('0xff')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xff')];_0x4eeff2['secure']=_0x359e42[_0x51a8('0xfd')][_0x51a8('0x100')];}if(_0x359e42[_0x51a8('0xfd')][_0x51a8('0x101')]){_0x4eeff2[_0x51a8('0x102')]={'user':_0x359e42[_0x51a8('0xfd')]['user'],'pass':_0x359e42['Smtp'][_0x51a8('0x103')]};}return respondWithRpcPromise(_0x51a8('0x104'),_0x51a8('0x105'),{'account':_0x4eeff2,'message':{'from':util['format'](_0x51a8('0x106'),_0x359e42[_0x51a8('0x3a')],_0x359e42[_0x51a8('0xc7')]||_0x359e42[_0x51a8('0xfd')]['user']),'to':_0x58c6df['body'][_0x51a8('0xe8')],'subject':'Mail\x20Transcript','text':util[_0x51a8('0xea')](_0x51a8('0x107'),_0x58c6df[_0x51a8('0x3b')][_0x51a8('0xe8')]),'attachments':[{'path':_0x4f8535}]}})['then'](function(){return _0x18179c;})[_0x51a8('0x2b')](function(_0x4e62f3){console[_0x51a8('0x27')](_0x4e62f3);});}else{return _0x18179c;}})[_0x51a8('0x20')](respondWithStatusCode(_0x44fa71,0xc8))[_0x51a8('0x2b')](handleError(_0x44fa71,null));};exports['addMessage']=function(_0x5e50ea,_0x3589be,_0x10fd78){return db[_0x51a8('0xd0')][_0x51a8('0x75')]({'where':{'id':_0x5e50ea[_0x51a8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3589be,null))[_0x51a8('0x20')](function(_0x288180){if(_0x288180){return _0x288180[_0x51a8('0x108')](_0x5e50ea['body'][_0x51a8('0x109')],_[_0x51a8('0x10a')](_0x5e50ea[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{});}})[_0x51a8('0x20')](respondWithResult(_0x3589be,null))[_0x51a8('0x2b')](handleError(_0x3589be,null));};exports[_0x51a8('0x10b')]=function(_0x52004e,_0x15ac9b,_0x1aed5b){var _0xeba541={'raw':![],'where':{}};var _0xbe375d={};var _0x244d95={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x52004e[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x15ac9b,null))['then'](function(_0x3c7726){if(_0x3c7726){_0xbe375d['model']=_['keys'](db[_0x51a8('0xd0')]['rawAttributes']);_0xbe375d[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x52004e['query']);_0xbe375d['filters']=_[_0x51a8('0x4e')](_0xbe375d['model'],_0xbe375d[_0x51a8('0x4c')]);_0xeba541[_0x51a8('0x4f')]=_['intersection'](_0xbe375d[_0x51a8('0x4b')],qs['fields'](_0x52004e[_0x51a8('0x4c')][_0x51a8('0x50')]));_0xeba541['attributes']=_0xeba541[_0x51a8('0x4f')][_0x51a8('0x51')]?_0xeba541[_0x51a8('0x4f')]:_0xbe375d[_0x51a8('0x4b')];if(!_0x52004e[_0x51a8('0x4c')]['hasOwnProperty']('nolimit')){_0xeba541[_0x51a8('0x31')]=qs[_0x51a8('0x31')](_0x52004e['query'][_0x51a8('0x31')]);_0xeba541['offset']=qs[_0x51a8('0x30')](_0x52004e['query'][_0x51a8('0x30')]);}_0xeba541[_0x51a8('0x9a')]=qs['sort'](_0x52004e['query'][_0x51a8('0x53')]);_0xeba541['where']=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x52004e[_0x51a8('0x4c')],_0xbe375d['filters']));_0xeba541[_0x51a8('0x54')][_0x51a8('0xb9')]=_0x3c7726['id'];if(_0x52004e['query'][_0x51a8('0x8f')]){_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541[_0x51a8('0x54')],{'$or':_[_0x51a8('0x40')](_0xeba541[_0x51a8('0x4f')],function(_0x49a943){var _0xad8ab7={};_0xad8ab7[_0x49a943]={'$like':'%'+_0x52004e[_0x51a8('0x4c')]['filter']+'%'};return _0xad8ab7;})});}if(_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')]){var _0x234a4a=_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')][_0x51a8('0x44')](',');var _0x4b1154={};_0x4b1154[_0x234a4a[0x0]]={'$gte':moment(_0x234a4a[0x1])[_0x51a8('0xea')](_0x51a8('0x10c'))};_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541['where'],_0x4b1154);}_0xeba541=_[_0x51a8('0xa6')]({},_0xeba541,_0x52004e[_0x51a8('0xbe')]);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0xeba541[_0x51a8('0x54')]})[_0x51a8('0x20')](function(_0x45bd8b){_0x244d95[_0x51a8('0x33')]=_0x45bd8b;if(_0x52004e['query'][_0x51a8('0xbc')]){_0xeba541[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0xeba541);})['then'](function(_0x59e0ed){_0x244d95['rows']=_0x59e0ed;return _0x244d95;});}})['then'](respondWithFilteredResult(_0x15ac9b,_0xeba541))[_0x51a8('0x2b')](handleError(_0x15ac9b,null));};exports['getMyMessages']=function(_0x1f1b3b,_0x3b6e0b,_0x312c20){var _0x2f9fe0={'where':{}},_0x1568f3={},_0x45677c={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x1f1b3b[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x3b6e0b,null))[_0x51a8('0x20')](function(_0x30dbd3){if(_0x30dbd3){_0x1568f3[_0x51a8('0x4b')]=_[_0x51a8('0x4d')](db[_0x51a8('0xd0')][_0x51a8('0x49')]);_0x1568f3[_0x51a8('0x4c')]=_['keys'](_0x1f1b3b['query']);_0x1568f3[_0x51a8('0x55')]=_['intersection'](_0x1568f3[_0x51a8('0x4b')],_0x1568f3[_0x51a8('0x4c')]);_0x2f9fe0['attributes']=_[_0x51a8('0x4e')](_0x1568f3[_0x51a8('0x4b')],qs[_0x51a8('0x50')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2f9fe0['attributes']=_0x2f9fe0[_0x51a8('0x4f')]['length']?_0x2f9fe0['attributes']:_0x1568f3[_0x51a8('0x4b')];if(!_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x52')](_0x51a8('0x10e'))){_0x2f9fe0[_0x51a8('0x31')]=qs['limit'](_0x1f1b3b['query'][_0x51a8('0x31')]);_0x2f9fe0[_0x51a8('0x30')]=qs[_0x51a8('0x30')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2f9fe0[_0x51a8('0x9a')]=qs[_0x51a8('0x53')](_0x1f1b3b['query']['sort']);_0x2f9fe0[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x1f1b3b[_0x51a8('0x4c')],_0x1568f3[_0x51a8('0x55')]));_0x2f9fe0[_0x51a8('0x54')]['ChatInteractionId']=_0x30dbd3['id'];if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]){_0x2f9fe0[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0x2f9fe0['where'],{'$or':_[_0x51a8('0x40')](_0x2f9fe0[_0x51a8('0x4f')],function(_0x45f627){var _0x2d5526={};_0x2d5526[_0x45f627]={'$like':'%'+_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]+'%'};return _0x2d5526;})});}_0x2f9fe0[_0x51a8('0x54')]['secret']=![];if(_0x1f1b3b[_0x51a8('0x4c')]['id']){_0x2f9fe0[_0x51a8('0x54')]['id']={'$gt':_0x1f1b3b['query']['id']};}_0x2f9fe0=_[_0x51a8('0xa6')]({},_0x2f9fe0,_0x1f1b3b['options']);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0x2f9fe0['where']})[_0x51a8('0x20')](function(_0x3b31f4){_0x45677c[_0x51a8('0x33')]=_0x3b31f4;_0x2f9fe0[_0x51a8('0xbd')]=[];if(_0x1f1b3b['query'][_0x51a8('0x10f')]){_0x2f9fe0[_0x51a8('0xbd')][_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':'User','attributes':['id','fullname',_0x51a8('0xf6')]});}if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2f9fe0[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0x2f9fe0);})[_0x51a8('0x20')](function(_0x14c1b8){_0x45677c[_0x51a8('0x110')]=_0x14c1b8;return _0x45677c;});}})[_0x51a8('0x20')](respondWithFilteredResult(_0x3b6e0b,_0x2f9fe0))[_0x51a8('0x2b')](handleError(_0x3b6e0b,null));};exports['addTags']=function(_0x675401,_0x35a751,_0x36aac9){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x675401[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x35a751,null))['then'](function(_0x4624f7){if(_0x4624f7){return _0x4624f7[_0x51a8('0x111')](_0x675401['body']['ids'],_['omit'](_0x675401[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{})[_0x51a8('0x112')](function(){return db['Tag'][_0x51a8('0x10d')]({'attributes':['id',_0x51a8('0x3a'),_0x51a8('0x59')],'where':{'id':_0x675401[_0x51a8('0x3b')][_0x51a8('0x109')]}});})['then'](function(_0xa5bcfc){socket[_0x51a8('0x113')](_0x51a8('0x114'),{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]});return{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]};});}})[_0x51a8('0x20')](respondWithResult(_0x35a751,null))[_0x51a8('0x2b')](handleError(_0x35a751,null));};exports[_0x51a8('0x115')]=function(_0x37b8e4,_0x32038c,_0x19002e){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x37b8e4['params']['id']}})['then'](handleEntityNotFound(_0x32038c,null))[_0x51a8('0x20')](function(_0x38729f){if(_0x38729f){return _0x38729f[_0x51a8('0x115')](_0x37b8e4[_0x51a8('0x4c')][_0x51a8('0x109')]);}})[_0x51a8('0x20')](respondWithStatusCode(_0x32038c,null))[_0x51a8('0x2b')](handleError(_0x32038c,null));};exports['download']=function(_0x9c6443,_0x4ec339){var _0x117d9d=moment()[_0x51a8('0x116')]()[_0x51a8('0xa4')]();var _0x5a82d7=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0x117'),'files',_0x51a8('0x118'));var _0x282ded=path['join'](config[_0x51a8('0xe3')],'server',_0x51a8('0x119'),_0x51a8('0x11a'));var _0x3e05bd=path['join'](_0x5a82d7,_0x117d9d);var _0x589252=util[_0x51a8('0xea')](_0x51a8('0x11b'),_0x9c6443['params']['id'],_0x117d9d);var _0x5370db=path[_0x51a8('0xe2')](_0x5a82d7,_0x589252);var _0x42c534=[];_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c'),'attributes':['id',_0x51a8('0x41')],'raw':!![]});_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xed')],'as':_0x51a8('0x72'),'attributes':['id',_0x51a8('0x11c'),_0x51a8('0x11d')],'raw':!![]});if(_0x9c6443[_0x51a8('0x4c')]['attachments']){_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xe0')],'as':_0x51a8('0xe0'),'raw':!![]});}var _0x556783=[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'attributes':['id','body',_0x51a8('0x86'),_0x51a8('0xf9'),'secret',_0x51a8('0x11e')],'include':_0x42c534}];_0x556783['push']({'model':db[_0x51a8('0xc1')],'as':_0x51a8('0x11f'),'attributes':['id',_0x51a8('0x3a')]});_0x556783[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x120'),'attributes':['id','fullname']});return db[_0x51a8('0x48')]['find']({'where':{'id':_0x9c6443[_0x51a8('0xbb')]['id']},'include':_0x556783})[_0x51a8('0x20')](handleEntityNotFound(_0x4ec339,null))['then'](function(_0xf80e41){if(_0xf80e41){var _0x35aed9=_0xf80e41[_0x51a8('0x121')]({'plain':!![]});fs[_0x51a8('0x122')](_0x3e05bd);var _0xcdcbb2={'channel':'Chat','account':_0x35aed9[_0x51a8('0x11f')][_0x51a8('0x3a')],'agent':_0x35aed9[_0x51a8('0x120')]?_0x35aed9[_0x51a8('0x120')]['fullname']:_0x51a8('0x123'),'createdAt':moment(_0x35aed9[_0x51a8('0x86')])['format'](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'closedAt':_0x35aed9['closed']?moment(_0x35aed9['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x35aed9['disposition'],'chatInfo':{'browser':_0x35aed9[_0x51a8('0x124')],'os':_0x35aed9['osName'],'referer':_0x35aed9['referer'],'customerIp':_0x35aed9[_0x51a8('0x125')],'customerPort':_0x35aed9[_0x51a8('0x126')]?_0x35aed9[_0x51a8('0x126')]:_0x51a8('0x123')},'messages':_(_0x35aed9[_0x51a8('0xec')])['tail']()['filter']({'secret':![]})['map'](function(_0x24b953){if(_0x24b953[_0x51a8('0xe0')]){var _0x14df4f=path[_0x51a8('0xe2')](_0x282ded,_0x24b953['Attachment']['basename']);if(fs[_0x51a8('0x127')](_0x14df4f)){fs[_0x51a8('0x128')](_0x14df4f)[_0x51a8('0x129')](fs[_0x51a8('0x12a')](path['join'](_0x3e05bd,_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')])));}}return{'date':moment(_0x24b953[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'sender':_0x24b953[_0x51a8('0xf9')]===_0x51a8('0xcf')?_0x24b953[_0x51a8('0x7c')]?_0x24b953[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0'):_0x24b953['Contact'][_0x51a8('0x11c')]+(_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]?'\x20'+_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]:''),'body':_0x24b953['Attachment']?_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')]:_0x24b953[_0x51a8('0x3b')],'direction':_0x24b953[_0x51a8('0xf9')]==='out'?'A':'C','secret':_0x24b953[_0x51a8('0xfa')],'read':_0x24b953['read'],'attachment':_0x24b953[_0x51a8('0xe0')]};})[_0x51a8('0x6f')]()};return ejs[_0x51a8('0x12b')](path[_0x51a8('0xe2')](config['root'],_0x51a8('0x117'),_0x51a8('0x12c'),_0x51a8('0x12d')),{'interaction':_0xcdcbb2})[_0x51a8('0x20')](function(_0x3f039c){var _0x3a0c33=path['join'](_0x3e05bd,'transcript-'+_0x35aed9['id']+'-'+_0x117d9d+_0x51a8('0x12e'));var _0x3e1da1={'path':_0x3a0c33,'channel':_0x51a8('0x12f'),'interactionId':_0x35aed9['id']};return pdf[_0x51a8('0x130')](_0x3f039c,_0x3e1da1);})[_0x51a8('0x20')](function(){return new BPromise(function(_0x1e55c1,_0x443db8){zipdir(_0x3e05bd,{'saveTo':_0x5370db},function(_0x192d63,_0x2263e3){if(_0x192d63)return _0x443db8(_0x192d63);return _0x1e55c1(_0x2263e3);});})[_0x51a8('0x20')](function(){return new BPromise(function(_0x32d363,_0x3030ff){rimraf(_0x3e05bd,function(_0x357e44){if(_0x357e44)_0x3030ff(_0x357e44);return _0x32d363();});});})[_0x51a8('0x20')](function(){return _0x4ec339[_0x51a8('0xe6')](_0x5370db,_0x589252,function(_0x44b406){if(_0x44b406){console[_0x51a8('0x131')](_0x51a8('0x132'),_0x44b406);}else{fs[_0x51a8('0x133')](_0x5370db);}});});});}else{return _0x4ec339[_0x51a8('0x2c')](0xc8);}})[_0x51a8('0x2b')](handleError(_0x4ec339,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a91e6cf..39c9d1f 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 _0xe222=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x28030b,_0x52dbcf){var _0x17582c=function(_0x2a17de){while(--_0x2a17de){_0x28030b['push'](_0x28030b['shift']());}};_0x17582c(++_0x52dbcf);}(_0xe222,0x10e));var _0x2e22=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xe222[_0x38de33];return _0x40f16d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2e22('0x0'))['db'][_0x2e22('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x2e22('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e22('0x3')](0x0);var events={'afterCreate':_0x2e22('0x4'),'afterUpdate':_0x2e22('0x5'),'afterDestroy':_0x2e22('0x6')};function emitEvent(_0x1df2f8){return function(_0x59343a,_0xb040e3,_0x1f6436){_0x59343a[_0x2e22('0x7')]({'attributes':['id'],'raw':!![]})[_0x2e22('0x8')](function(_0x185689){_0x59343a[_0x2e22('0x9')](_0x2e22('0xa'),_0x185689['map'](function(_0xfa1f10){return{'id':_0xfa1f10['id']};}));return ChatMessage[_0x2e22('0xb')]({'where':{'ChatInteractionId':_0x59343a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13545f){_0x59343a[_0x2e22('0x9')](_0x2e22('0xc'),_0x13545f['length']);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8+':'+_0x59343a['id'],_0x59343a);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8,_0x59343a);_0x1f6436(null);})[_0x2e22('0xe')](_0x1f6436(null));};}for(var e in events){if(events[_0x2e22('0xf')](e)){var event=events[e];ChatInteraction[_0x2e22('0x10')](e,emitEvent(event));}}module[_0x2e22('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x73df=['catch','exports','events','../../mysqldb','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','length','emit'];(function(_0x435ecc,_0x3ca2b5){var _0x2f27d5=function(_0x2f5251){while(--_0x2f5251){_0x435ecc['push'](_0x435ecc['shift']());}};_0x2f27d5(++_0x3ca2b5);}(_0x73df,0xfe));var _0xf73d=function(_0x4d5b1b,_0x148c38){_0x4d5b1b=_0x4d5b1b-0x0;var _0x4707c3=_0x73df[_0x4d5b1b];return _0x4707c3;};'use strict';var EventEmitter=require(_0xf73d('0x0'));var ChatInteraction=require(_0xf73d('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf73d('0x2')](0x0);var events={'afterCreate':_0xf73d('0x3'),'afterUpdate':'update','afterDestroy':_0xf73d('0x4')};function emitEvent(_0x21c020){return function(_0x1297be,_0x158ce7,_0x5f73e5){_0x1297be[_0xf73d('0x5')]({'attributes':['id'],'raw':!![]})[_0xf73d('0x6')](function(_0x5c92f3){_0x1297be[_0xf73d('0x7')](_0xf73d('0x8'),_0x5c92f3['map'](function(_0x1670d2){return{'id':_0x1670d2['id']};}));return ChatMessage[_0xf73d('0x9')]({'where':{'ChatInteractionId':_0x1297be['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16f8a3){_0x1297be[_0xf73d('0x7')]('unreadMessages',_0x16f8a3[_0xf73d('0xa')]);ChatInteractionEvents[_0xf73d('0xb')](_0x21c020+':'+_0x1297be['id'],_0x1297be);ChatInteractionEvents[_0xf73d('0xb')](_0x21c020,_0x1297be);_0x5f73e5(null);})[_0xf73d('0xc')](_0x5f73e5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xf73d('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f018562..6aa9f2d 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 _0x2f10=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x2f10,0x107));var _0x02f1=function(_0x3cddb2,_0x3b43f7){_0x3cddb2=_0x3cddb2-0x0;var _0x3ade7d=_0x2f10[_0x3cddb2];return _0x3ade7d;};'use strict';var _=require(_0x02f1('0x0'));var util=require(_0x02f1('0x1'));var logger=require('../../config/logger')(_0x02f1('0x2'));var moment=require(_0x02f1('0x3'));var BPromise=require(_0x02f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02f1('0x5'));var rimraf=require('rimraf');var config=require(_0x02f1('0x6'));var attributes=require(_0x02f1('0x7'));module[_0x02f1('0x8')]=function(_0xfddf8e,_0x23f202){return _0xfddf8e[_0x02f1('0x9')](_0x02f1('0xa'),attributes,{'tableName':_0x02f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4529b0,_0x176448,_0x3d7399){if(_0x4529b0[_0x02f1('0xc')](_0x02f1('0xd'))){_0x4529b0[_0x02f1('0xe')]=moment()[_0x02f1('0xf')](_0x02f1('0x10'));}_0x3d7399(null,_0x4529b0);}},'charset':'utf8mb4','collate':_0x02f1('0x11')});}; \ No newline at end of file +var _0x7db0=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5aa296,_0x392248){var _0x16b36f=function(_0x1b38a0){while(--_0x1b38a0){_0x5aa296['push'](_0x5aa296['shift']());}};_0x16b36f(++_0x392248);}(_0x7db0,0x1eb));var _0x07db=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x7db0[_0xc5a279];return _0xc755d3;};'use strict';var _=require(_0x07db('0x0'));var util=require(_0x07db('0x1'));var logger=require('../../config/logger')(_0x07db('0x2'));var moment=require(_0x07db('0x3'));var BPromise=require(_0x07db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07db('0x5'));var rimraf=require(_0x07db('0x6'));var config=require(_0x07db('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x07db('0x8')]=function(_0x1d581a,_0xb13f74){return _0x1d581a[_0x07db('0x9')](_0x07db('0xa'),attributes,{'tableName':_0x07db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57ae84,_0x321e01,_0x9a7645){if(_0x57ae84['changed'](_0x07db('0xc'))){_0x57ae84['closedAt']=moment()[_0x07db('0xd')](_0x07db('0xe'));}_0x9a7645(null,_0x57ae84);}},'charset':_0x07db('0xf'),'collate':_0x07db('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e994314..06bb6f8 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 _0x8623=['AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit'];(function(_0x5773e7,_0x435e69){var _0x5e6621=function(_0x112829){while(--_0x112829){_0x5773e7['push'](_0x5773e7['shift']());}};_0x5e6621(++_0x435e69);}(_0x8623,0x1e7));var _0x3862=function(_0x47b4ff,_0x5b68fd){_0x47b4ff=_0x47b4ff-0x0;var _0x2e6bd4=_0x8623[_0x47b4ff];return _0x2e6bd4;};'use strict';var _=require(_0x3862('0x0'));var util=require(_0x3862('0x1'));var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3862('0x4'));var db=require(_0x3862('0x5'))['db'];var utils=require(_0x3862('0x6'));var logger=require(_0x3862('0x7'))(_0x3862('0x8'));var config=require(_0x3862('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3862('0xa')]['http']({'port':0x232a});config[_0x3862('0xb')]=_[_0x3862('0xc')](config[_0x3862('0xb')],{'host':_0x3862('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3862('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x39efde,_0x26f064,_0x2d76c5){return new BPromise(function(_0xb301f6,_0x1ddb87){return client['request'](_0x39efde,_0x2d76c5)[_0x3862('0xe')](function(_0x3acefd){logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,'request\x20sent');logger[_0x3862('0x11')](_0x3862('0x12'),_0x26f064,'request\x20sent',JSON[_0x3862('0x13')](_0x3acefd));if(_0x3acefd[_0x3862('0x14')]){if(_0x3acefd[_0x3862('0x14')][_0x3862('0x15')]===0x1f4){logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd['error'][_0x3862('0x16')]);return _0x1ddb87(_0x3acefd[_0x3862('0x14')][_0x3862('0x16')]);}logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd[_0x3862('0x14')]['message']);return _0xb301f6(_0x3acefd['error'][_0x3862('0x16')]);}else{logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,_0x3862('0x17'));_0xb301f6(_0x3acefd[_0x3862('0x18')][_0x3862('0x16')]);}})['catch'](function(_0x3c31d8){logger[_0x3862('0x14')](_0x3862('0x10'),_0x26f064,_0x3c31d8);_0x1ddb87(_0x3c31d8);});});}exports[_0x3862('0x19')]=function(_0x33a62d){var _0x2f90ae=this;return new Promise(function(_0x387c2b,_0x501b75){return db[_0x3862('0x1a')][_0x3862('0x1b')](_0x33a62d[_0x3862('0x1c')],{'raw':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1f')]||null:null,'attributes':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')]['attributes']||null:null,'limit':_0x33a62d['options']?_0x33a62d[_0x3862('0x1d')][_0x3862('0x20')]||null:null})[_0x3862('0xe')](function(_0x25d2bd){logger[_0x3862('0xf')]('UpdateChatInteraction',_0x33a62d);logger['debug'](_0x3862('0x19'),_0x33a62d,JSON[_0x3862('0x13')](_0x25d2bd));_0x387c2b(_0x25d2bd);})['catch'](function(_0x283e34){logger['error']('UpdateChatInteraction',_0x283e34[_0x3862('0x16')],_0x33a62d);_0x501b75(_0x2f90ae['error'](0x1f4,_0x283e34['message']));});});};exports[_0x3862('0x21')]=function(_0x867813){return new Promise(function(_0x560964,_0x2084e0){return db['ChatInteraction']['find']({'where':_0x867813[_0x3862('0x1d')]?_0x867813['options'][_0x3862('0x1f')]||null:null})[_0x3862('0xe')](function(_0x3f82e6){if(_0x3f82e6){return _0x3f82e6[_0x3862('0x22')](_0x867813[_0x3862('0x1c')][_0x3862('0x23')],_[_0x3862('0x24')](_0x867813[_0x3862('0x1c')],[_0x3862('0x23'),'id'])||{});}})[_0x3862('0x25')](function(_0x23f0e5){logger['info'](_0x3862('0x26'),_0x867813);logger[_0x3862('0x11')](_0x3862('0x26'),_0x867813,JSON[_0x3862('0x13')](_0x23f0e5));_0x560964(_0x23f0e5);})[_0x3862('0x27')](function(_0x4deef3){logger[_0x3862('0x14')](_0x3862('0x26'),_0x4deef3[_0x3862('0x16')],_0x867813);_0x2084e0(_this['error'](0x1f4,_0x4deef3[_0x3862('0x16')]));});});}; \ No newline at end of file +var _0x8f4f=['options','raw','where','attributes','limit','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','ids','omit','debug','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction','update','body'];(function(_0x5b9a65,_0x1525d6){var _0x67097b=function(_0x3be117){while(--_0x3be117){_0x5b9a65['push'](_0x5b9a65['shift']());}};_0x67097b(++_0x1525d6);}(_0x8f4f,0xea));var _0xf8f4=function(_0x234672,_0x1a11be){_0x234672=_0x234672-0x0;var _0x1a6c76=_0x8f4f[_0x234672];return _0x1a6c76;};'use strict';var _=require('lodash');var util=require(_0xf8f4('0x0'));var moment=require('moment');var BPromise=require(_0xf8f4('0x1'));var rs=require(_0xf8f4('0x2'));var fs=require('fs');var Redis=require(_0xf8f4('0x3'));var db=require(_0xf8f4('0x4'))['db'];var utils=require(_0xf8f4('0x5'));var logger=require(_0xf8f4('0x6'))(_0xf8f4('0x7'));var config=require(_0xf8f4('0x8'));var jayson=require(_0xf8f4('0x9'));var client=jayson[_0xf8f4('0xa')][_0xf8f4('0xb')]({'port':0x232a});config[_0xf8f4('0xc')]=_[_0xf8f4('0xd')](config[_0xf8f4('0xc')],{'host':_0xf8f4('0xe'),'port':0x18eb});var socket=require(_0xf8f4('0xf'))(new Redis(config[_0xf8f4('0xc')]));require(_0xf8f4('0x10'))[_0xf8f4('0x11')](socket);function respondWithRpcPromise(_0x3d1d93,_0x14a147,_0x4c82fe){return new BPromise(function(_0x36d9cd,_0x3a18ab){return client[_0xf8f4('0x12')](_0x3d1d93,_0x4c82fe)[_0xf8f4('0x13')](function(_0x58534e){logger[_0xf8f4('0x14')](_0xf8f4('0x15'),_0x14a147,'request\x20sent');logger['debug'](_0xf8f4('0x16'),_0x14a147,_0xf8f4('0x17'),JSON['stringify'](_0x58534e));if(_0x58534e[_0xf8f4('0x18')]){if(_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x19')]===0x1f4){logger[_0xf8f4('0x18')](_0xf8f4('0x15'),_0x14a147,_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);return _0x3a18ab(_0x58534e['error']['message']);}logger[_0xf8f4('0x18')](_0xf8f4('0x15'),_0x14a147,_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);return _0x36d9cd(_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x14a147,_0xf8f4('0x17'));_0x36d9cd(_0x58534e['result'][_0xf8f4('0x1a')]);}})['catch'](function(_0x3de79c){logger[_0xf8f4('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x14a147,_0x3de79c);_0x3a18ab(_0x3de79c);});});}exports['UpdateChatInteraction']=function(_0x5ea594){var _0x4d8944=this;return new Promise(function(_0x21f967,_0x35697b){return db[_0xf8f4('0x1b')][_0xf8f4('0x1c')](_0x5ea594[_0xf8f4('0x1d')],{'raw':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ea594['options']?_0x5ea594['options'][_0xf8f4('0x20')]||null:null,'attributes':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x21')]||null:null,'limit':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x22')]||null:null})['then'](function(_0x1f9c99){logger[_0xf8f4('0x14')](_0xf8f4('0x23'),_0x5ea594);logger['debug'](_0xf8f4('0x23'),_0x5ea594,JSON[_0xf8f4('0x24')](_0x1f9c99));_0x21f967(_0x1f9c99);})[_0xf8f4('0x25')](function(_0x305fcf){logger['error'](_0xf8f4('0x23'),_0x305fcf[_0xf8f4('0x1a')],_0x5ea594);_0x35697b(_0x4d8944['error'](0x1f4,_0x305fcf['message']));});});};exports[_0xf8f4('0x26')]=function(_0x906995){return new Promise(function(_0x1c1510,_0x580bd4){return db[_0xf8f4('0x1b')][_0xf8f4('0x27')]({'where':_0x906995[_0xf8f4('0x1e')]?_0x906995['options'][_0xf8f4('0x20')]||null:null})['then'](function(_0x14b3c7){if(_0x14b3c7){return _0x14b3c7['addTags'](_0x906995[_0xf8f4('0x1d')][_0xf8f4('0x28')],_[_0xf8f4('0x29')](_0x906995[_0xf8f4('0x1d')],[_0xf8f4('0x28'),'id'])||{});}})['spread'](function(_0x44b8b1){logger[_0xf8f4('0x14')]('AddTags',_0x906995);logger[_0xf8f4('0x2a')](_0xf8f4('0x2b'),_0x906995,JSON[_0xf8f4('0x24')](_0x44b8b1));_0x1c1510(_0x44b8b1);})[_0xf8f4('0x25')](function(_0x3453d3){logger[_0xf8f4('0x18')](_0xf8f4('0x2b'),_0x3453d3['message'],_0x906995);_0x580bd4(_this[_0xf8f4('0x18')](0x1f4,_0x3453d3[_0xf8f4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index fc325f5..1b6672b 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 _0x5b7f=['emit','removeListener','register','length','./chatInteraction.events','save','remove','update'];(function(_0x23c152,_0x156378){var _0x426f2e=function(_0x51ee0d){while(--_0x51ee0d){_0x23c152['push'](_0x23c152['shift']());}};_0x426f2e(++_0x156378);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x5f0c02,_0xabb6e6){_0x5f0c02=_0x5f0c02-0x0;var _0x112d1c=_0x5b7f[_0x5f0c02];return _0x112d1c;};'use strict';var ChatInteractionEvents=require(_0xf5b7('0x0'));var events=[_0xf5b7('0x1'),_0xf5b7('0x2'),_0xf5b7('0x3')];function createListener(_0x3c760b,_0x1efe58){return function(_0x3bb362){_0x1efe58[_0xf5b7('0x4')](_0x3c760b,_0x3bb362);};}function removeListener(_0x2c5439,_0x2dfb67){return function(){ChatInteractionEvents[_0xf5b7('0x5')](_0x2c5439,_0x2dfb67);};}exports[_0xf5b7('0x6')]=function(_0x1e67ac){for(var _0x984337=0x0,_0x1d7c78=events[_0xf5b7('0x7')];_0x984337<_0x1d7c78;_0x984337++){var _0x3711ec=events[_0x984337];var _0x426253=createListener('chatInteraction:'+_0x3711ec,_0x1e67ac);ChatInteractionEvents['on'](_0x3711ec,_0x426253);}}; \ No newline at end of file +var _0xea31=['emit','register','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x328e44,_0xc580d){var _0x40ef20=function(_0x3b33e7){while(--_0x3b33e7){_0x328e44['push'](_0x328e44['shift']());}};_0x40ef20(++_0xc580d);}(_0xea31,0x123));var _0x1ea3=function(_0x500451,_0xb2718f){_0x500451=_0x500451-0x0;var _0x337344=_0xea31[_0x500451];return _0x337344;};'use strict';var ChatInteractionEvents=require(_0x1ea3('0x0'));var events=[_0x1ea3('0x1'),'remove',_0x1ea3('0x2')];function createListener(_0xf7c855,_0x320b89){return function(_0x179e04){_0x320b89[_0x1ea3('0x3')](_0xf7c855,_0x179e04);};}function removeListener(_0x3efcc1,_0x428312){return function(){ChatInteractionEvents['removeListener'](_0x3efcc1,_0x428312);};}exports[_0x1ea3('0x4')]=function(_0x24d375){for(var _0x20d26d=0x0,_0x583e20=events['length'];_0x20d26d<_0x583e20;_0x20d26d++){var _0x4100d6=events[_0x20d26d];var _0x2ee845=createListener(_0x1ea3('0x5')+_0x4100d6,_0x24d375);ChatInteractionEvents['on'](_0x4100d6,_0x2ee845);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index bf6a49c..bb53c53 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 _0x5361=['/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','%s-%s','now','originalname','single','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','delete','chatinteraction:destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','index','/describe','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show'];(function(_0x304bd5,_0xea943d){var _0x2bcd87=function(_0x53d3c5){while(--_0x53d3c5){_0x304bd5['push'](_0x304bd5['shift']());}};_0x2bcd87(++_0xea943d);}(_0x5361,0x162));var _0x1536=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5361[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1536('0x0'));var util=require('util');var path=require(_0x1536('0x1'));var timeout=require(_0x1536('0x2'));var express=require(_0x1536('0x3'));var router=express[_0x1536('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1536('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1536('0x6')]);router['get'](_0x1536('0x7'),auth[_0x1536('0x8')](),controller[_0x1536('0x9')]);router[_0x1536('0xa')](_0x1536('0xb'),auth[_0x1536('0xc')](),controller[_0x1536('0xd')]);router['get'](_0x1536('0xe'),auth[_0x1536('0xc')](),controller[_0x1536('0xf')]);router[_0x1536('0xa')](_0x1536('0x10'),auth[_0x1536('0x8')](),controller[_0x1536('0x11')]);router['get'](_0x1536('0x12'),auth[_0x1536('0xc')](),controller['getMyMessages']);router[_0x1536('0xa')](_0x1536('0x13'),auth[_0x1536('0x8')](),controller[_0x1536('0x14')]);router[_0x1536('0x15')]('/',auth[_0x1536('0x8')](),controller[_0x1536('0x16')]);router[_0x1536('0x15')]('/:id/vidaoo',auth[_0x1536('0x8')](),controller[_0x1536('0x17')]);var upload=multer({'storage':multer[_0x1536('0x18')]({'destination':function(_0x165a45,_0x43d70c,_0x2ff5a7){_0x2ff5a7(null,path[_0x1536('0x19')](config[_0x1536('0x1a')],'server/files/attachments/'));},'filename':function(_0x3fd565,_0x217497,_0x1899cf){_0x1899cf(null,util['format'](_0x1536('0x1b'),Date[_0x1536('0x1c')](),_0x217497[_0x1536('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1536('0x15')]('/:id/attachment_upload',upload[_0x1536('0x1e')]('file'),controller[_0x1536('0x1f')]);router[_0x1536('0x15')](_0x1536('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x1536('0x15')]('/:id/tags',auth[_0x1536('0x8')](),interaction[_0x1536('0x20')](_0x1536('0x21'),_0x1536('0x22')),controller[_0x1536('0x23')]);router['put'](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction['tracked'](_0x1536('0x21'),_0x1536('0x24')),controller[_0x1536('0x25')]);router[_0x1536('0x26')](_0x1536('0x27'),controller['customUpdate']);router['put'](_0x1536('0x28'),auth[_0x1536('0xc')](),controller[_0x1536('0x29')]);router[_0x1536('0x26')]('/:id/close',controller['close']);router[_0x1536('0x2a')](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction[_0x1536('0x20')]('chat',_0x1536('0x2b')),controller['destroy']);router[_0x1536('0x2a')](_0x1536('0x2c'),auth[_0x1536('0x8')](),controller['removeTags']);module[_0x1536('0x2d')]=router; \ No newline at end of file +var _0x5f68=['%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format'];(function(_0x1fd6c3,_0x5df4de){var _0x2d503a=function(_0x29527f){while(--_0x29527f){_0x1fd6c3['push'](_0x1fd6c3['shift']());}};_0x2d503a(++_0x5df4de);}(_0x5f68,0x86));var _0x85f6=function(_0x1a6905,_0x56adc4){_0x1a6905=_0x1a6905-0x0;var _0x4ef252=_0x5f68[_0x1a6905];return _0x4ef252;};'use strict';var multer=require(_0x85f6('0x0'));var util=require('util');var path=require(_0x85f6('0x1'));var timeout=require(_0x85f6('0x2'));var express=require('express');var router=express[_0x85f6('0x3')]();var fs_extra=require(_0x85f6('0x4'));var auth=require(_0x85f6('0x5'));var interaction=require(_0x85f6('0x6'));var config=require(_0x85f6('0x7'));var controller=require(_0x85f6('0x8'));router['get']('/',auth[_0x85f6('0x9')](),controller[_0x85f6('0xa')]);router[_0x85f6('0xb')](_0x85f6('0xc'),auth[_0x85f6('0x9')](),controller[_0x85f6('0xd')]);router[_0x85f6('0xb')](_0x85f6('0xe'),auth[_0x85f6('0xf')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x85f6('0xf')](),controller[_0x85f6('0x10')]);router[_0x85f6('0xb')](_0x85f6('0x11'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x12')]);router[_0x85f6('0xb')](_0x85f6('0x13'),auth[_0x85f6('0xf')](),controller[_0x85f6('0x14')]);router['get'](_0x85f6('0x15'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x16')]);router[_0x85f6('0x17')]('/',auth[_0x85f6('0x9')](),controller[_0x85f6('0x18')]);router[_0x85f6('0x17')](_0x85f6('0x19'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x1a')]);var upload=multer({'storage':multer[_0x85f6('0x1b')]({'destination':function(_0x30c92a,_0x1a4e57,_0x2b4cc5){_0x2b4cc5(null,path[_0x85f6('0x1c')](config['root'],_0x85f6('0x1d')));},'filename':function(_0x51dd70,_0x35b9a2,_0x10690b){_0x10690b(null,util[_0x85f6('0x1e')](_0x85f6('0x1f'),Date[_0x85f6('0x20')](),_0x35b9a2[_0x85f6('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x85f6('0x22'),upload[_0x85f6('0x23')](_0x85f6('0x24')),controller[_0x85f6('0x25')]);router[_0x85f6('0x17')]('/:id/messages',auth[_0x85f6('0xf')](),controller[_0x85f6('0x26')]);router['post'](_0x85f6('0x27'),auth[_0x85f6('0x9')](),interaction['tracked'](_0x85f6('0x28'),_0x85f6('0x29')),controller[_0x85f6('0x2a')]);router[_0x85f6('0x2b')](_0x85f6('0xe'),auth[_0x85f6('0x9')](),interaction[_0x85f6('0x2c')](_0x85f6('0x28'),_0x85f6('0x2d')),controller['update']);router[_0x85f6('0x2b')]('/:id/custom_update',controller[_0x85f6('0x2e')]);router[_0x85f6('0x2b')](_0x85f6('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0x85f6('0x30')]);router[_0x85f6('0x2b')](_0x85f6('0x31'),controller['close']);router[_0x85f6('0x32')](_0x85f6('0xe'),auth[_0x85f6('0x9')](),interaction[_0x85f6('0x2c')](_0x85f6('0x28'),_0x85f6('0x33')),controller[_0x85f6('0x34')]);router['delete'](_0x85f6('0x27'),auth['isAuthenticated'](),controller[_0x85f6('0x35')]);module[_0x85f6('0x36')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index a92bee6..ddba8de 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 _0x9b27=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b27,0x7b));var _0x79b2=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x9b27[_0x20e40d];return _0x558350;};'use strict';var Sequelize=require(_0x79b2('0x0'));module[_0x79b2('0x1')]={'body':{'type':Sequelize[_0x79b2('0x2')](_0x79b2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x79b2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x79b2('0x5')]}}; \ No newline at end of file +var _0xa951=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xa951,0x185));var _0x1a95=function(_0x21cfcc,_0x3fd1b9){_0x21cfcc=_0x21cfcc-0x0;var _0x4b458f=_0xa951[_0x21cfcc];return _0x4b458f;};'use strict';var Sequelize=require(_0x1a95('0x0'));module[_0x1a95('0x1')]={'body':{'type':Sequelize[_0x1a95('0x2')](_0x1a95('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1a95('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 5419388..13f96ec 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 _0xe382=['../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json','undefined','offset','count','limit','set','Content-Range','reject','update','destroy','then','sendStatus','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','createdAt','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe382,0xc4));var _0x2e38=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe382[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e38('0x0'));var jsonpatch=require(_0x2e38('0x1'));var rp=require(_0x2e38('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e38('0x3'));var util=require(_0x2e38('0x4'));var path=require(_0x2e38('0x5'));var sox=require(_0x2e38('0x6'));var csv=require(_0x2e38('0x7'));var ejs=require(_0x2e38('0x8'));var fs=require('fs');var fs_extra=require(_0x2e38('0x9'));var _=require(_0x2e38('0xa'));var squel=require(_0x2e38('0xb'));var crypto=require(_0x2e38('0xc'));var jsforce=require(_0x2e38('0xd'));var deskjs=require(_0x2e38('0xe'));var toCsv=require(_0x2e38('0x7'));var querystring=require(_0x2e38('0xf'));var Papa=require(_0x2e38('0x10'));var Redis=require(_0x2e38('0x11'));var authService=require(_0x2e38('0x12'));var qs=require(_0x2e38('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e38('0x14'));var logger=require(_0x2e38('0x15'))(_0x2e38('0x16'));var utils=require(_0x2e38('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2e38('0x18'));var db=require(_0x2e38('0x19'))['db'];config[_0x2e38('0x1a')]=_['defaults'](config[_0x2e38('0x1a')],{'host':_0x2e38('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e38('0x1a')]));require('./chatInternalMessage.socket')[_0x2e38('0x1c')](socket);function respondWithStatusCode(_0x5a7b05,_0x58ea9f){_0x58ea9f=_0x58ea9f||0xcc;return function(_0xf6ca34){if(_0xf6ca34){return _0x5a7b05['sendStatus'](_0x58ea9f);}return _0x5a7b05[_0x2e38('0x1d')](_0x58ea9f)[_0x2e38('0x1e')]();};}function respondWithResult(_0x7fab37,_0x44119c){_0x44119c=_0x44119c||0xc8;return function(_0x2ef2e4){if(_0x2ef2e4){return _0x7fab37['status'](_0x44119c)[_0x2e38('0x1f')](_0x2ef2e4);}};}function respondWithFilteredResult(_0x1d3c4c,_0x10b206){return function(_0x4c827f){if(_0x4c827f){var _0x3427d6=typeof _0x10b206['offset']===_0x2e38('0x20')&&typeof _0x10b206['limit']===_0x2e38('0x20');var _0x2cdc70=_0x4c827f['count'];var _0x554978=_0x3427d6?0x0:_0x10b206[_0x2e38('0x21')];var _0x563e8a=_0x3427d6?_0x4c827f[_0x2e38('0x22')]:_0x10b206['offset']+_0x10b206[_0x2e38('0x23')];var _0x187802;if(_0x563e8a>=_0x2cdc70){_0x563e8a=_0x2cdc70;_0x187802=0xc8;}else{_0x187802=0xce;}_0x1d3c4c[_0x2e38('0x1d')](_0x187802);return _0x1d3c4c[_0x2e38('0x24')](_0x2e38('0x25'),_0x554978+'-'+_0x563e8a+'/'+_0x2cdc70)[_0x2e38('0x1f')](_0x4c827f);}return null;};}function patchUpdates(_0xe72668){return function(_0x444052){try{jsonpatch['apply'](_0x444052,_0xe72668,!![]);}catch(_0x33674c){return BPromise[_0x2e38('0x26')](_0x33674c);}return _0x444052['save']();};}function saveUpdates(_0x10e0a0,_0x4ec0e7){return function(_0x29f3bb){if(_0x29f3bb){return _0x29f3bb[_0x2e38('0x27')](_0x10e0a0)['then'](function(_0x43b1fb){return _0x43b1fb;});}return null;};}function removeEntity(_0x2bdc0c,_0x1e0767){return function(_0x5ac312){if(_0x5ac312){return _0x5ac312[_0x2e38('0x28')]()[_0x2e38('0x29')](function(){_0x2bdc0c[_0x2e38('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4089,_0x323cdd){return function(_0x540ba2){if(!_0x540ba2){_0x5a4089[_0x2e38('0x2a')](0x194);}return _0x540ba2;};}function handleError(_0x58edfe,_0x5a2c78){_0x5a2c78=_0x5a2c78||0x1f4;return function(_0x39894e){logger['error'](_0x39894e['stack']);if(_0x39894e[_0x2e38('0x2b')]){delete _0x39894e[_0x2e38('0x2b')];}_0x58edfe[_0x2e38('0x1d')](_0x5a2c78)[_0x2e38('0x2c')](_0x39894e);};}exports[_0x2e38('0x2d')]=function(_0x1c8a70,_0x342038){var _0x32d678={},_0x28d96d={},_0x496c9c={'count':0x0,'rows':[]};var _0x472a22=_['map'](db[_0x2e38('0x2e')][_0x2e38('0x2f')],function(_0xc465b8){return{'name':_0xc465b8[_0x2e38('0x30')],'type':_0xc465b8[_0x2e38('0x31')][_0x2e38('0x32')]};});_0x28d96d[_0x2e38('0x33')]=_[_0x2e38('0x34')](_0x472a22,_0x2e38('0x2b'));_0x28d96d['query']=_['keys'](_0x1c8a70['query']);_0x28d96d[_0x2e38('0x35')]=_[_0x2e38('0x36')](_0x28d96d[_0x2e38('0x33')],_0x28d96d['query']);_0x32d678['attributes']=_[_0x2e38('0x36')](_0x28d96d['model'],qs[_0x2e38('0x37')](_0x1c8a70['query'][_0x2e38('0x37')]));_0x32d678[_0x2e38('0x38')]=_0x32d678[_0x2e38('0x38')][_0x2e38('0x39')]?_0x32d678['attributes']:_0x28d96d[_0x2e38('0x33')];if(!_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3b')](_0x2e38('0x3c'))){_0x32d678[_0x2e38('0x23')]=qs[_0x2e38('0x23')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x23')]);_0x32d678['offset']=qs[_0x2e38('0x21')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x21')]);}_0x32d678['order']=qs[_0x2e38('0x3d')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3d')]);_0x32d678[_0x2e38('0x3e')]=qs['filters'](_[_0x2e38('0x3f')](_0x1c8a70[_0x2e38('0x3a')],_0x28d96d[_0x2e38('0x35')]),_0x472a22);if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x40')]){_0x32d678[_0x2e38('0x3e')]=_[_0x2e38('0x41')](_0x32d678[_0x2e38('0x3e')],{'$or':_[_0x2e38('0x34')](_0x472a22,function(_0x274f6f){if(_0x274f6f[_0x2e38('0x31')]!==_0x2e38('0x42')){var _0x2a405b={};_0x2a405b[_0x274f6f[_0x2e38('0x2b')]]={'$like':'%'+_0x1c8a70[_0x2e38('0x3a')]['filter']+'%'};return _0x2a405b;}})});}_0x32d678=_['merge']({},_0x32d678,_0x1c8a70[_0x2e38('0x43')]);var _0x11b953={'where':_0x32d678['where']};return db[_0x2e38('0x2e')][_0x2e38('0x22')](_0x11b953)[_0x2e38('0x29')](function(_0x14d728){_0x496c9c[_0x2e38('0x22')]=_0x14d728;if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x32d678[_0x2e38('0x45')]=[{'all':!![]}];}return db[_0x2e38('0x2e')][_0x2e38('0x46')](_0x32d678);})[_0x2e38('0x29')](function(_0x546c5f){_0x496c9c[_0x2e38('0x47')]=_0x546c5f;return _0x496c9c;})[_0x2e38('0x29')](respondWithFilteredResult(_0x342038,_0x32d678))[_0x2e38('0x48')](handleError(_0x342038,null));};exports[_0x2e38('0x49')]=function(_0x4617a2,_0x541297){var _0x31d4e1={'raw':!![],'where':{'id':_0x4617a2['params']['id']}},_0x5b00f1={};_0x5b00f1[_0x2e38('0x33')]=_[_0x2e38('0x4a')](db[_0x2e38('0x2e')]['rawAttributes']);_0x5b00f1[_0x2e38('0x3a')]=_[_0x2e38('0x4a')](_0x4617a2[_0x2e38('0x3a')]);_0x5b00f1[_0x2e38('0x35')]=_['intersection'](_0x5b00f1[_0x2e38('0x33')],_0x5b00f1[_0x2e38('0x3a')]);_0x31d4e1[_0x2e38('0x38')]=_[_0x2e38('0x36')](_0x5b00f1[_0x2e38('0x33')],qs['fields'](_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x37')]));_0x31d4e1[_0x2e38('0x38')]=_0x31d4e1[_0x2e38('0x38')][_0x2e38('0x39')]?_0x31d4e1['attributes']:_0x5b00f1[_0x2e38('0x33')];if(_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x31d4e1[_0x2e38('0x45')]=[{'all':!![]}];}_0x31d4e1=_[_0x2e38('0x41')]({},_0x31d4e1,_0x4617a2[_0x2e38('0x43')]);return db['ChatInternalMessage']['find'](_0x31d4e1)[_0x2e38('0x29')](handleEntityNotFound(_0x541297,null))['then'](respondWithResult(_0x541297,null))[_0x2e38('0x48')](handleError(_0x541297,null));};exports[_0x2e38('0x4b')]=function(_0x218138,_0x8df1b6){return db[_0x2e38('0x2e')][_0x2e38('0x4b')](_0x218138[_0x2e38('0x4c')],{})[_0x2e38('0x29')](respondWithResult(_0x8df1b6,0xc9))[_0x2e38('0x48')](handleError(_0x8df1b6,null));};exports[_0x2e38('0x27')]=function(_0x2c841a,_0x307f18){if(_0x2c841a[_0x2e38('0x4c')]['id']){delete _0x2c841a[_0x2e38('0x4c')]['id'];}return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x2c841a[_0x2e38('0x4e')]['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x307f18,null))[_0x2e38('0x29')](saveUpdates(_0x2c841a[_0x2e38('0x4c')],null))[_0x2e38('0x29')](respondWithResult(_0x307f18,null))[_0x2e38('0x48')](handleError(_0x307f18,null));};exports[_0x2e38('0x28')]=function(_0x378340,_0x15be55){return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x378340['params']['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x15be55,null))['then'](removeEntity(_0x15be55,null))[_0x2e38('0x48')](handleError(_0x15be55,null));};exports['describe']=function(_0x20e03e,_0x5724e0){return db[_0x2e38('0x2e')]['describe']()[_0x2e38('0x29')](respondWithResult(_0x5724e0,null))[_0x2e38('0x48')](handleError(_0x5724e0,null));};function wrapUser(_0xb7acc9){return function(_0xd4082a){var _0x174812=_0xb7acc9['get']({'plain':!![]});_0x174812['messages']=[];if(_0xd4082a){_0x174812[_0x2e38('0x4f')]=_0xd4082a['createdAt'];_0x174812['lastMessage']=_0xd4082a;}else{_0x174812[_0x2e38('0x4f')]=moment(0x0)['format'](_0x2e38('0x50'));_0x174812['lastMessage']={};}return _0x174812;};}exports[_0x2e38('0x51')]=function(_0x4f66ae,_0x2fbf48,_0xd405c2){var _0x29935b=[];return db['User'][_0x2e38('0x46')]({'where':{'role':[_0x2e38('0x52'),_0x2e38('0x53'),_0x2e38('0x54')]},'attributes':['id',_0x2e38('0x55'),_0x2e38('0x2b'),_0x2e38('0x56'),_0x2e38('0x57'),_0x2e38('0x58'),_0x2e38('0x59'),'lastLoginAt',_0x2e38('0x5a'),_0x2e38('0x5b')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x5c')),'include':[{'model':db[_0x2e38('0x5d')],'as':_0x2e38('0x5e'),'attributes':['id',_0x2e38('0x2b'),_0x2e38('0x31')],'through':{'attributes':[]}}]})[_0x2e38('0x29')](function(_0x904954){if(_0x904954){var _0x23ee28=_0x4f66ae[_0x2e38('0x54')]['get']({'plain':!![]});if(!_0x23ee28)throw new Error(_0x2e38('0x5f'));if(_0x23ee28[_0x2e38('0x56')]===_0x2e38('0x54')){return db[_0x2e38('0x60')]['find']({'where':{'name':_0x2e38('0x61'),'userProfileId':_0x23ee28[_0x2e38('0x62')]},'raw':!![]})[_0x2e38('0x29')](function(_0x331c95){if(_0x331c95){if(_0x331c95[_0x2e38('0x63')]===0x0){return db['UserProfileResource'][_0x2e38('0x46')]({'where':{'sectionId':_0x331c95['id']},'raw':!![]})['then'](function(_0xb372ed){var _0x29b443=[];if(_[_0x2e38('0x64')](_0xb372ed)){_0x29b443=_['filter'](_0x904954,function(_0x396cd0){if(_0x396cd0[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x396cd0;}});return _0x29b443;}else{for(var _0x9fa9fd=0x0;_0x9fa9fd<_0x904954[_0x2e38('0x39')];_0x9fa9fd++){var _0x28b2ef=_0x904954[_0x9fa9fd];if(_0x28b2ef[_0x2e38('0x56')]===_0x2e38('0x52')){var _0x225e2d=_[_0x2e38('0x4d')](_0xb372ed,function(_0x45953b){return _0x45953b[_0x2e38('0x65')]===_0x28b2ef['id'];});if(_0x225e2d)_0x29b443[_0x2e38('0x66')](_0x28b2ef);}else{_0x29b443[_0x2e38('0x66')](_0x28b2ef);}}return _0x29b443;}});}else{return _0x904954;}}else{var _0x3a4889=_['filter'](_0x904954,function(_0x1d1a8b){if(_0x1d1a8b[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x1d1a8b;}});return _0x3a4889;}});}else{return _0x904954;}}})[_0x2e38('0x29')](function(_0x47fe9c){var _0x1c4406=[];if(_0x47fe9c){_0x29935b=_0x47fe9c;for(var _0x10644b=0x0;_0x10644b<_0x47fe9c['length'];_0x10644b+=0x1){_0x29935b[_0x10644b][_0x2e38('0x67')]=[];_0x1c4406[_0x2e38('0x66')](db[_0x2e38('0x2e')]['find']({'where':{'FromId':[_0x4f66ae[_0x2e38('0x54')]['id'],_0x47fe9c[_0x10644b]['id']],'ToId':[_0x4f66ae['user']['id'],_0x47fe9c[_0x10644b]['id']],'ChatGroupId':null},'attributes':['id',_0x2e38('0x68'),_0x2e38('0x69'),_0x2e38('0x6a'),_0x2e38('0x6b'),_0x2e38('0x4c')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x47fe9c[_0x10644b])));}return BPromise[_0x2e38('0x6d')](_0x1c4406);}return[];})[_0x2e38('0x29')](function(_0x1b0129){return{'rows':_0x1b0129,'count':_0x1b0129[_0x2e38('0x39')]};})[_0x2e38('0x29')](respondWithResult(_0x2fbf48,null))[_0x2e38('0x48')](handleError(_0x2fbf48,null));}; \ No newline at end of file +var _0x51ab=['socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ChatInternalMessage','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','filter','FromId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x50cf8f,_0x5a72fa){var _0x360950=function(_0x5954e1){while(--_0x5954e1){_0x50cf8f['push'](_0x50cf8f['shift']());}};_0x360950(++_0x5a72fa);}(_0x51ab,0x1a0));var _0xb51a=function(_0x526523,_0x1cb110){_0x526523=_0x526523-0x0;var _0x1be809=_0x51ab[_0x526523];return _0x1be809;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb51a('0x0'));var jsonpatch=require(_0xb51a('0x1'));var rp=require(_0xb51a('0x2'));var moment=require(_0xb51a('0x3'));var BPromise=require(_0xb51a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb51a('0x5'));var sox=require(_0xb51a('0x6'));var csv=require('to-csv');var ejs=require(_0xb51a('0x7'));var fs=require('fs');var fs_extra=require(_0xb51a('0x8'));var _=require(_0xb51a('0x9'));var squel=require(_0xb51a('0xa'));var crypto=require(_0xb51a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb51a('0xc'));var Papa=require(_0xb51a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb51a('0xe'));var as=require(_0xb51a('0xf'));var hardwareService=require(_0xb51a('0x10'));var logger=require('../../config/logger')(_0xb51a('0x11'));var utils=require(_0xb51a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb51a('0x13'));var db=require(_0xb51a('0x14'))['db'];config[_0xb51a('0x15')]=_[_0xb51a('0x16')](config[_0xb51a('0x15')],{'host':_0xb51a('0x17'),'port':0x18eb});var socket=require(_0xb51a('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb51a('0x19')](socket);function respondWithStatusCode(_0x5f52c3,_0x2ff254){_0x2ff254=_0x2ff254||0xcc;return function(_0x2fd26c){if(_0x2fd26c){return _0x5f52c3['sendStatus'](_0x2ff254);}return _0x5f52c3[_0xb51a('0x1a')](_0x2ff254)[_0xb51a('0x1b')]();};}function respondWithResult(_0x2f2297,_0x472362){_0x472362=_0x472362||0xc8;return function(_0xc3287){if(_0xc3287){return _0x2f2297[_0xb51a('0x1a')](_0x472362)[_0xb51a('0x1c')](_0xc3287);}};}function respondWithFilteredResult(_0x18ab05,_0x474ae4){return function(_0xd717d2){if(_0xd717d2){var _0x3da443=typeof _0x474ae4[_0xb51a('0x1d')]===_0xb51a('0x1e')&&typeof _0x474ae4[_0xb51a('0x1f')]===_0xb51a('0x1e');var _0x4a7ab3=_0xd717d2[_0xb51a('0x20')];var _0x893828=_0x3da443?0x0:_0x474ae4[_0xb51a('0x1d')];var _0x3c4a4b=_0x3da443?_0xd717d2[_0xb51a('0x20')]:_0x474ae4[_0xb51a('0x1d')]+_0x474ae4['limit'];var _0x1413a6;if(_0x3c4a4b>=_0x4a7ab3){_0x3c4a4b=_0x4a7ab3;_0x1413a6=0xc8;}else{_0x1413a6=0xce;}_0x18ab05['status'](_0x1413a6);return _0x18ab05[_0xb51a('0x21')](_0xb51a('0x22'),_0x893828+'-'+_0x3c4a4b+'/'+_0x4a7ab3)[_0xb51a('0x1c')](_0xd717d2);}return null;};}function patchUpdates(_0x5deac7){return function(_0x1e8148){try{jsonpatch[_0xb51a('0x23')](_0x1e8148,_0x5deac7,!![]);}catch(_0x2e7dae){return BPromise[_0xb51a('0x24')](_0x2e7dae);}return _0x1e8148[_0xb51a('0x25')]();};}function saveUpdates(_0x24e756,_0x45f1f6){return function(_0x2e8ac3){if(_0x2e8ac3){return _0x2e8ac3[_0xb51a('0x26')](_0x24e756)[_0xb51a('0x27')](function(_0x4e5c15){return _0x4e5c15;});}return null;};}function removeEntity(_0x3e3293,_0x2e9d6d){return function(_0x2a26ee){if(_0x2a26ee){return _0x2a26ee[_0xb51a('0x28')]()[_0xb51a('0x27')](function(){_0x3e3293['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0664,_0x4d52ef){return function(_0xbcb411){if(!_0xbcb411){_0x4e0664[_0xb51a('0x29')](0x194);}return _0xbcb411;};}function handleError(_0x292b52,_0x183357){_0x183357=_0x183357||0x1f4;return function(_0x3ffab4){logger[_0xb51a('0x2a')](_0x3ffab4[_0xb51a('0x2b')]);if(_0x3ffab4[_0xb51a('0x2c')]){delete _0x3ffab4['name'];}_0x292b52[_0xb51a('0x1a')](_0x183357)[_0xb51a('0x2d')](_0x3ffab4);};}exports['index']=function(_0x1878c2,_0x1953e2){var _0x3fcbfb={},_0x400dab={},_0x5cc51c={'count':0x0,'rows':[]};var _0x3f6435=_[_0xb51a('0x2e')](db[_0xb51a('0x2f')][_0xb51a('0x30')],function(_0x53bb18){return{'name':_0x53bb18['fieldName'],'type':_0x53bb18['type'][_0xb51a('0x31')]};});_0x400dab['model']=_[_0xb51a('0x2e')](_0x3f6435,_0xb51a('0x2c'));_0x400dab[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x1878c2[_0xb51a('0x32')]);_0x400dab['filters']=_[_0xb51a('0x34')](_0x400dab['model'],_0x400dab[_0xb51a('0x32')]);_0x3fcbfb['attributes']=_['intersection'](_0x400dab[_0xb51a('0x35')],qs[_0xb51a('0x36')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x36')]));_0x3fcbfb['attributes']=_0x3fcbfb[_0xb51a('0x37')][_0xb51a('0x38')]?_0x3fcbfb[_0xb51a('0x37')]:_0x400dab[_0xb51a('0x35')];if(!_0x1878c2[_0xb51a('0x32')][_0xb51a('0x39')](_0xb51a('0x3a'))){_0x3fcbfb[_0xb51a('0x1f')]=qs[_0xb51a('0x1f')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x1f')]);_0x3fcbfb['offset']=qs[_0xb51a('0x1d')](_0x1878c2['query'][_0xb51a('0x1d')]);}_0x3fcbfb[_0xb51a('0x3b')]=qs[_0xb51a('0x3c')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x3c')]);_0x3fcbfb[_0xb51a('0x3d')]=qs[_0xb51a('0x3e')](_['pick'](_0x1878c2[_0xb51a('0x32')],_0x400dab[_0xb51a('0x3e')]),_0x3f6435);if(_0x1878c2[_0xb51a('0x32')]['filter']){_0x3fcbfb[_0xb51a('0x3d')]=_[_0xb51a('0x3f')](_0x3fcbfb['where'],{'$or':_[_0xb51a('0x2e')](_0x3f6435,function(_0x16221c){if(_0x16221c[_0xb51a('0x40')]!==_0xb51a('0x41')){var _0xbc8c7d={};_0xbc8c7d[_0x16221c[_0xb51a('0x2c')]]={'$like':'%'+_0x1878c2[_0xb51a('0x32')]['filter']+'%'};return _0xbc8c7d;}})});}_0x3fcbfb=_[_0xb51a('0x3f')]({},_0x3fcbfb,_0x1878c2['options']);var _0x49250b={'where':_0x3fcbfb['where']};return db[_0xb51a('0x2f')]['count'](_0x49250b)[_0xb51a('0x27')](function(_0x1021d1){_0x5cc51c[_0xb51a('0x20')]=_0x1021d1;if(_0x1878c2[_0xb51a('0x32')][_0xb51a('0x42')]){_0x3fcbfb[_0xb51a('0x43')]=[{'all':!![]}];}return db[_0xb51a('0x2f')][_0xb51a('0x44')](_0x3fcbfb);})[_0xb51a('0x27')](function(_0xecb59d){_0x5cc51c[_0xb51a('0x45')]=_0xecb59d;return _0x5cc51c;})[_0xb51a('0x27')](respondWithFilteredResult(_0x1953e2,_0x3fcbfb))[_0xb51a('0x46')](handleError(_0x1953e2,null));};exports[_0xb51a('0x47')]=function(_0x47d992,_0x2dabd3){var _0x458bf7={'raw':!![],'where':{'id':_0x47d992[_0xb51a('0x48')]['id']}},_0x19192a={};_0x19192a[_0xb51a('0x35')]=_[_0xb51a('0x33')](db['ChatInternalMessage'][_0xb51a('0x30')]);_0x19192a[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x47d992['query']);_0x19192a[_0xb51a('0x3e')]=_[_0xb51a('0x34')](_0x19192a[_0xb51a('0x35')],_0x19192a['query']);_0x458bf7['attributes']=_[_0xb51a('0x34')](_0x19192a[_0xb51a('0x35')],qs[_0xb51a('0x36')](_0x47d992['query']['fields']));_0x458bf7[_0xb51a('0x37')]=_0x458bf7['attributes']['length']?_0x458bf7[_0xb51a('0x37')]:_0x19192a[_0xb51a('0x35')];if(_0x47d992[_0xb51a('0x32')]['includeAll']){_0x458bf7[_0xb51a('0x43')]=[{'all':!![]}];}_0x458bf7=_[_0xb51a('0x3f')]({},_0x458bf7,_0x47d992[_0xb51a('0x49')]);return db[_0xb51a('0x2f')][_0xb51a('0x4a')](_0x458bf7)[_0xb51a('0x27')](handleEntityNotFound(_0x2dabd3,null))[_0xb51a('0x27')](respondWithResult(_0x2dabd3,null))[_0xb51a('0x46')](handleError(_0x2dabd3,null));};exports[_0xb51a('0x4b')]=function(_0x35bbd0,_0x268409){return db[_0xb51a('0x2f')]['create'](_0x35bbd0[_0xb51a('0x4c')],{})[_0xb51a('0x27')](respondWithResult(_0x268409,0xc9))[_0xb51a('0x46')](handleError(_0x268409,null));};exports[_0xb51a('0x26')]=function(_0x3bf1c4,_0x427f2a){if(_0x3bf1c4[_0xb51a('0x4c')]['id']){delete _0x3bf1c4[_0xb51a('0x4c')]['id'];}return db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'id':_0x3bf1c4['params']['id']}})[_0xb51a('0x27')](handleEntityNotFound(_0x427f2a,null))[_0xb51a('0x27')](saveUpdates(_0x3bf1c4[_0xb51a('0x4c')],null))['then'](respondWithResult(_0x427f2a,null))[_0xb51a('0x46')](handleError(_0x427f2a,null));};exports[_0xb51a('0x28')]=function(_0x38f4c7,_0x42120a){return db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'id':_0x38f4c7[_0xb51a('0x48')]['id']}})[_0xb51a('0x27')](handleEntityNotFound(_0x42120a,null))[_0xb51a('0x27')](removeEntity(_0x42120a,null))[_0xb51a('0x46')](handleError(_0x42120a,null));};exports['describe']=function(_0x1f533e,_0x1d69db){return db['ChatInternalMessage'][_0xb51a('0x4d')]()[_0xb51a('0x27')](respondWithResult(_0x1d69db,null))[_0xb51a('0x46')](handleError(_0x1d69db,null));};function wrapUser(_0x317e8a){return function(_0x6e14cd){var _0x38fc91=_0x317e8a[_0xb51a('0x4e')]({'plain':!![]});_0x38fc91[_0xb51a('0x4f')]=[];if(_0x6e14cd){_0x38fc91[_0xb51a('0x50')]=_0x6e14cd[_0xb51a('0x51')];_0x38fc91['lastMessage']=_0x6e14cd;}else{_0x38fc91[_0xb51a('0x50')]=moment(0x0)[_0xb51a('0x52')](_0xb51a('0x53'));_0x38fc91[_0xb51a('0x54')]={};}return _0x38fc91;};}exports[_0xb51a('0x55')]=function(_0x41a71e,_0x2577c2,_0x5c2233){var _0x1ed5e4=[];return db['User'][_0xb51a('0x44')]({'where':{'role':[_0xb51a('0x56'),_0xb51a('0x57'),_0xb51a('0x58')]},'attributes':['id','fullname',_0xb51a('0x2c'),'role',_0xb51a('0x59'),_0xb51a('0x5a'),_0xb51a('0x5b'),_0xb51a('0x5c'),_0xb51a('0x5d'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0xb51a('0x5e')],'as':_0xb51a('0x5f'),'attributes':['id',_0xb51a('0x2c'),_0xb51a('0x40')],'through':{'attributes':[]}}]})[_0xb51a('0x27')](function(_0x1cc3b7){if(_0x1cc3b7){var _0x11bc79=_0x41a71e[_0xb51a('0x58')][_0xb51a('0x4e')]({'plain':!![]});if(!_0x11bc79)throw new Error(_0xb51a('0x60'));if(_0x11bc79[_0xb51a('0x61')]===_0xb51a('0x58')){return db[_0xb51a('0x62')][_0xb51a('0x4a')]({'where':{'name':_0xb51a('0x63'),'userProfileId':_0x11bc79['userProfileId']},'raw':!![]})[_0xb51a('0x27')](function(_0x48f9d9){if(_0x48f9d9){if(_0x48f9d9[_0xb51a('0x64')]===0x0){return db[_0xb51a('0x65')][_0xb51a('0x44')]({'where':{'sectionId':_0x48f9d9['id']},'raw':!![]})[_0xb51a('0x27')](function(_0x4b6c39){var _0x59ea66=[];if(_[_0xb51a('0x66')](_0x4b6c39)){_0x59ea66=_['filter'](_0x1cc3b7,function(_0x40a985){if(_0x40a985[_0xb51a('0x61')]!==_0xb51a('0x56')){return _0x40a985;}});return _0x59ea66;}else{for(var _0x1d1117=0x0;_0x1d1117<_0x1cc3b7[_0xb51a('0x38')];_0x1d1117++){var _0x8a5bcd=_0x1cc3b7[_0x1d1117];if(_0x8a5bcd[_0xb51a('0x61')]==='agent'){var _0x56cf23=_[_0xb51a('0x4a')](_0x4b6c39,function(_0xf62952){return _0xf62952[_0xb51a('0x67')]===_0x8a5bcd['id'];});if(_0x56cf23)_0x59ea66[_0xb51a('0x68')](_0x8a5bcd);}else{_0x59ea66[_0xb51a('0x68')](_0x8a5bcd);}}return _0x59ea66;}});}else{return _0x1cc3b7;}}else{var _0x56ee6d=_[_0xb51a('0x69')](_0x1cc3b7,function(_0x5a2559){if(_0x5a2559[_0xb51a('0x61')]!==_0xb51a('0x56')){return _0x5a2559;}});return _0x56ee6d;}});}else{return _0x1cc3b7;}}})[_0xb51a('0x27')](function(_0x55e000){var _0x1a9b78=[];if(_0x55e000){_0x1ed5e4=_0x55e000;for(var _0x509d82=0x0;_0x509d82<_0x55e000['length'];_0x509d82+=0x1){_0x1ed5e4[_0x509d82][_0xb51a('0x4f')]=[];_0x1a9b78[_0xb51a('0x68')](db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'FromId':[_0x41a71e[_0xb51a('0x58')]['id'],_0x55e000[_0x509d82]['id']],'ToId':[_0x41a71e[_0xb51a('0x58')]['id'],_0x55e000[_0x509d82]['id']],'ChatGroupId':null},'attributes':['id',_0xb51a('0x51'),_0xb51a('0x6a'),'ToId',_0xb51a('0x6b'),_0xb51a('0x4c')],'order':qs[_0xb51a('0x3c')](_0xb51a('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x55e000[_0x509d82])));}return BPromise[_0xb51a('0x6d')](_0x1a9b78);}return[];})[_0xb51a('0x27')](function(_0x17fb21){return{'rows':_0x17fb21,'count':_0x17fb21[_0xb51a('0x38')]};})[_0xb51a('0x27')](respondWithResult(_0x2577c2,null))[_0xb51a('0x46')](handleError(_0x2577c2,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 07f96ea..5b6093c 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 _0x8a8a=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2af20f,_0x5564d6){var _0x281721=function(_0x5b05ca){while(--_0x5b05ca){_0x2af20f['push'](_0x2af20f['shift']());}};_0x281721(++_0x5564d6);}(_0x8a8a,0x1f2));var _0xa8a8=function(_0x56deee,_0x121efd){_0x56deee=_0x56deee-0x0;var _0x1a52fc=_0x8a8a[_0x56deee];return _0x1a52fc;};'use strict';var EventEmitter=require(_0xa8a8('0x0'));var ChatInternalMessage=require(_0xa8a8('0x1'))['db'][_0xa8a8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa8a8('0x3')](0x0);var events={'afterCreate':_0xa8a8('0x4'),'afterUpdate':'update','afterDestroy':_0xa8a8('0x5')};function emitEvent(_0x4257eb){return function(_0x576d56,_0x26a9b8,_0x3e4ecf){ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb+':'+_0x576d56['id'],_0x576d56);ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb,_0x576d56);_0x3e4ecf(null);};}for(var e in events){if(events[_0xa8a8('0x7')](e)){var event=events[e];ChatInternalMessage[_0xa8a8('0x8')](e,emitEvent(event));}}module[_0xa8a8('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xc1d1=['remove','emit','hasOwnProperty','hook','../../mysqldb','save','update'];(function(_0xb9f437,_0x176443){var _0x3e480b=function(_0x3839a8){while(--_0x3839a8){_0xb9f437['push'](_0xb9f437['shift']());}};_0x3e480b(++_0x176443);}(_0xc1d1,0x90));var _0x1c1d=function(_0x4f9cc9,_0x51bf40){_0x4f9cc9=_0x4f9cc9-0x0;var _0x4c260b=_0xc1d1[_0x4f9cc9];return _0x4c260b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1c1d('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c1d('0x1'),'afterUpdate':_0x1c1d('0x2'),'afterDestroy':_0x1c1d('0x3')};function emitEvent(_0x6e2ed9){return function(_0x15162d,_0x28272e,_0x1dbfcf){ChatInternalMessageEvents[_0x1c1d('0x4')](_0x6e2ed9+':'+_0x15162d['id'],_0x15162d);ChatInternalMessageEvents[_0x1c1d('0x4')](_0x6e2ed9,_0x15162d);_0x1dbfcf(null);};}for(var e in events){if(events[_0x1c1d('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1c1d('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 01998eb..b463a0a 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 _0x653a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4269e2,_0x343092){var _0x29641d=function(_0x4036e5){while(--_0x4036e5){_0x4269e2['push'](_0x4269e2['shift']());}};_0x29641d(++_0x343092);}(_0x653a,0x133));var _0xa653=function(_0xf0f9ae,_0x3b02ef){_0xf0f9ae=_0xf0f9ae-0x0;var _0x46b898=_0x653a[_0xf0f9ae];return _0x46b898;};'use strict';var _=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var logger=require('../../config/logger')(_0xa653('0x2'));var moment=require(_0xa653('0x3'));var BPromise=require(_0xa653('0x4'));var rp=require(_0xa653('0x5'));var fs=require('fs');var path=require(_0xa653('0x6'));var rimraf=require(_0xa653('0x7'));var config=require(_0xa653('0x8'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x50b405,_0x52778d){return _0x50b405[_0xa653('0x9')](_0xa653('0xa'),attributes,{'tableName':_0xa653('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa653('0xc'),'collate':_0xa653('0xd')});}; \ No newline at end of file +var _0x481a=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x448f64,_0x34d4bb){var _0x1c0cf8=function(_0x3867bb){while(--_0x3867bb){_0x448f64['push'](_0x448f64['shift']());}};_0x1c0cf8(++_0x34d4bb);}(_0x481a,0x17d));var _0xa481=function(_0x5dd696,_0x441721){_0x5dd696=_0x5dd696-0x0;var _0x28f086=_0x481a[_0x5dd696];return _0x28f086;};'use strict';var _=require(_0xa481('0x0'));var util=require('util');var logger=require(_0xa481('0x1'))(_0xa481('0x2'));var moment=require(_0xa481('0x3'));var BPromise=require(_0xa481('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa481('0x5'));var rimraf=require(_0xa481('0x6'));var config=require(_0xa481('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xa481('0x8')]=function(_0x8dd61d,_0x6460c5){return _0x8dd61d[_0xa481('0x9')](_0xa481('0xa'),attributes,{'tableName':_0xa481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa481('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 10faebc..a5e747e 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 _0x03cf=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x03cf,0x64));var _0xf03c=function(_0x383ca6,_0x39dc19){_0x383ca6=_0x383ca6-0x0;var _0x7e0082=_0x03cf[_0x383ca6];return _0x7e0082;};'use strict';var _=require('lodash');var util=require(_0xf03c('0x0'));var moment=require(_0xf03c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf03c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03c('0x3'));var logger=require('../../config/logger')(_0xf03c('0x4'));var config=require(_0xf03c('0x5'));var jayson=require(_0xf03c('0x6'));var client=jayson['client'][_0xf03c('0x7')]({'port':0x232a});config[_0xf03c('0x8')]=_[_0xf03c('0x9')](config[_0xf03c('0x8')],{'host':_0xf03c('0xa'),'port':0x18eb});var socket=require(_0xf03c('0xb'))(new Redis(config['redis']));require(_0xf03c('0xc'))[_0xf03c('0xd')](socket);function respondWithRpcPromise(_0x1713d6,_0x17ff63,_0x15d5c6){return new BPromise(function(_0x36c6c3,_0xa50ef){return client[_0xf03c('0xe')](_0x1713d6,_0x15d5c6)[_0xf03c('0xf')](function(_0x30e960){logger[_0xf03c('0x10')](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));logger['debug'](_0xf03c('0x13'),_0x17ff63,_0xf03c('0x12'),JSON[_0xf03c('0x14')](_0x30e960));if(_0x30e960[_0xf03c('0x15')]){if(_0x30e960['error'][_0xf03c('0x16')]===0x1f4){logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0xa50ef(_0x30e960[_0xf03c('0x15')]['message']);}logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0x36c6c3(_0x30e960['error']['message']);}else{logger['info'](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));_0x36c6c3(_0x30e960[_0xf03c('0x18')]['message']);}})[_0xf03c('0x19')](function(_0x3eb515){logger[_0xf03c('0x15')](_0xf03c('0x11'),_0x17ff63,_0x3eb515);_0xa50ef(_0x3eb515);});});} \ No newline at end of file +var _0xb453=['redis','defaults','localhost','socket.io-emitter','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x329421,_0x414a49){var _0x5b31e8=function(_0x598ef4){while(--_0x598ef4){_0x329421['push'](_0x329421['shift']());}};_0x5b31e8(++_0x414a49);}(_0xb453,0x12e));var _0x3b45=function(_0x1fbcf0,_0x132360){_0x1fbcf0=_0x1fbcf0-0x0;var _0x50fe46=_0xb453[_0x1fbcf0];return _0x50fe46;};'use strict';var _=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var moment=require('moment');var BPromise=require(_0x3b45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b45('0x3'));var db=require(_0x3b45('0x4'))['db'];var utils=require(_0x3b45('0x5'));var logger=require(_0x3b45('0x6'))(_0x3b45('0x7'));var config=require('../../config/environment');var jayson=require(_0x3b45('0x8'));var client=jayson[_0x3b45('0x9')]['http']({'port':0x232a});config[_0x3b45('0xa')]=_[_0x3b45('0xb')](config[_0x3b45('0xa')],{'host':_0x3b45('0xc'),'port':0x18eb});var socket=require(_0x3b45('0xd'))(new Redis(config[_0x3b45('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4126a8,_0x22a111,_0xa79449){return new BPromise(function(_0x3c8a41,_0x4fe308){return client[_0x3b45('0xe')](_0x4126a8,_0xa79449)[_0x3b45('0xf')](function(_0x41d229){logger[_0x3b45('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,'request\x20sent');logger[_0x3b45('0x11')](_0x3b45('0x12'),_0x22a111,'request\x20sent',JSON[_0x3b45('0x13')](_0x41d229));if(_0x41d229[_0x3b45('0x14')]){if(_0x41d229[_0x3b45('0x14')][_0x3b45('0x15')]===0x1f4){logger[_0x3b45('0x14')](_0x3b45('0x16'),_0x22a111,_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);return _0x4fe308(_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);}logger['error'](_0x3b45('0x16'),_0x22a111,_0x41d229['error'][_0x3b45('0x17')]);return _0x3c8a41(_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,'request\x20sent');_0x3c8a41(_0x41d229[_0x3b45('0x18')][_0x3b45('0x17')]);}})[_0x3b45('0x19')](function(_0x4fd50e){logger[_0x3b45('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,_0x4fd50e);_0x4fe308(_0x4fd50e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index c33fd1b..9cbfc7a 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 _0x2c9d=['./chatInternalMessage.events','remove','emit','removeListener','length','chatInternalMessage:'];(function(_0x467b25,_0x14a29a){var _0x2ad500=function(_0x301649){while(--_0x301649){_0x467b25['push'](_0x467b25['shift']());}};_0x2ad500(++_0x14a29a);}(_0x2c9d,0x90));var _0xd2c9=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x2c9d[_0x2df507];return _0x1f7167;};'use strict';var ChatInternalMessageEvents=require(_0xd2c9('0x0'));var events=['save',_0xd2c9('0x1'),'update'];function createListener(_0x2b1376,_0x4a80c5){return function(_0x265d23){_0x4a80c5[_0xd2c9('0x2')](_0x2b1376,_0x265d23);};}function removeListener(_0x1a1cdb,_0x4ca468){return function(){ChatInternalMessageEvents[_0xd2c9('0x3')](_0x1a1cdb,_0x4ca468);};}exports['register']=function(_0x4ac6c2){for(var _0x81ff9b=0x0,_0x244c12=events[_0xd2c9('0x4')];_0x81ff9b<_0x244c12;_0x81ff9b++){var _0x44188c=events[_0x81ff9b];var _0x21fadd=createListener(_0xd2c9('0x5')+_0x44188c,_0x4ac6c2);ChatInternalMessageEvents['on'](_0x44188c,_0x21fadd);}}; \ No newline at end of file +var _0x8925=['./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x32c99a,_0x45ca14){var _0x5ee563=function(_0x809fe9){while(--_0x809fe9){_0x32c99a['push'](_0x32c99a['shift']());}};_0x5ee563(++_0x45ca14);}(_0x8925,0x1e0));var _0x5892=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x8925[_0x2d4661];return _0x42ed1e;};'use strict';var ChatInternalMessageEvents=require(_0x5892('0x0'));var events=['save',_0x5892('0x1'),_0x5892('0x2')];function createListener(_0x405481,_0x4560fd){return function(_0x541058){_0x4560fd[_0x5892('0x3')](_0x405481,_0x541058);};}function removeListener(_0x34377c,_0x3c299d){return function(){ChatInternalMessageEvents[_0x5892('0x4')](_0x34377c,_0x3c299d);};}exports[_0x5892('0x5')]=function(_0x5a59de){for(var _0x2afddf=0x0,_0x255d16=events['length'];_0x2afddf<_0x255d16;_0x2afddf++){var _0x5820cb=events[_0x2afddf];var _0x3d7c65=createListener('chatInternalMessage:'+_0x5820cb,_0x5a59de);ChatInternalMessageEvents['on'](_0x5820cb,_0x3d7c65);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e82116d..57e7817 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 _0x50ec=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getUsers','/:id','show','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x50ec,0x189));var _0xc50e=function(_0x2615e6,_0x3ef965){_0x2615e6=_0x2615e6-0x0;var _0x315886=_0x50ec[_0x2615e6];return _0x315886;};'use strict';var multer=require('multer');var util=require(_0xc50e('0x0'));var path=require('path');var timeout=require(_0xc50e('0x1'));var express=require(_0xc50e('0x2'));var router=express[_0xc50e('0x3')]();var fs_extra=require(_0xc50e('0x4'));var auth=require(_0xc50e('0x5'));var interaction=require(_0xc50e('0x6'));var config=require(_0xc50e('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xc50e('0x8')]('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xa')]);router[_0xc50e('0x8')]('/describe',auth[_0xc50e('0x9')](),controller[_0xc50e('0xb')]);router[_0xc50e('0x8')]('/users',auth['isAuthenticated'](),controller[_0xc50e('0xc')]);router[_0xc50e('0x8')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0xe')]);router['post']('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xf')]);router['put'](_0xc50e('0xd'),controller['update']);router[_0xc50e('0x10')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0x11')]);module[_0xc50e('0x12')]=router; \ No newline at end of file +var _0x9735=['/:id','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','show','post','put'];(function(_0x1a9471,_0x5c8f96){var _0x2d813f=function(_0x51e7cc){while(--_0x51e7cc){_0x1a9471['push'](_0x1a9471['shift']());}};_0x2d813f(++_0x5c8f96);}(_0x9735,0x1cd));var _0x5973=function(_0x3bd00d,_0x31c6f7){_0x3bd00d=_0x3bd00d-0x0;var _0x3d50fb=_0x9735[_0x3bd00d];return _0x3d50fb;};'use strict';var multer=require('multer');var util=require(_0x5973('0x0'));var path=require(_0x5973('0x1'));var timeout=require(_0x5973('0x2'));var express=require('express');var router=express[_0x5973('0x3')]();var fs_extra=require(_0x5973('0x4'));var auth=require(_0x5973('0x5'));var interaction=require(_0x5973('0x6'));var config=require(_0x5973('0x7'));var controller=require(_0x5973('0x8'));router[_0x5973('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5973('0x9')](_0x5973('0xa'),auth[_0x5973('0xb')](),controller['describe']);router[_0x5973('0x9')]('/users',auth[_0x5973('0xb')](),controller['getUsers']);router[_0x5973('0x9')]('/:id',auth[_0x5973('0xb')](),controller[_0x5973('0xc')]);router[_0x5973('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5973('0xe')](_0x5973('0xf'),controller[_0x5973('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d282516..f4b4085 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 _0x235b=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x3c3e48,_0x51d19f){var _0x1982eb=function(_0x4b1b45){while(--_0x4b1b45){_0x3c3e48['push'](_0x3c3e48['shift']());}};_0x1982eb(++_0x51d19f);}(_0x235b,0x1ed));var _0xb235=function(_0xd5e4d4,_0x50c61a){_0xd5e4d4=_0xd5e4d4-0x0;var _0x35181=_0x235b[_0xd5e4d4];return _0x35181;};'use strict';var Sequelize=require(_0xb235('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb235('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb235('0x3')]('in',_0xb235('0x4')),'defaultValue':_0xb235('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x5')]},'providerResponse':{'type':Sequelize[_0xb235('0x6')]}}; \ No newline at end of file +var _0x657b=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2047cd,_0x36a191){var _0xea92fd=function(_0x3b87ce){while(--_0x3b87ce){_0x2047cd['push'](_0x2047cd['shift']());}};_0xea92fd(++_0x36a191);}(_0x657b,0x131));var _0xb657=function(_0x19bcd7,_0x4a50b1){_0x19bcd7=_0x19bcd7-0x0;var _0x2f45e8=_0x657b[_0x19bcd7];return _0x2f45e8;};'use strict';var Sequelize=require(_0xb657('0x0'));module[_0xb657('0x1')]={'body':{'type':Sequelize[_0xb657('0x2')](_0xb657('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb657('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb657('0x5')]('in',_0xb657('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb657('0x7')]},'providerName':{'type':Sequelize[_0xb657('0x8')]},'providerResponse':{'type':Sequelize[_0xb657('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index db0f6f1..18fa584 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 _0x363c=['role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','map','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','body','describe','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x363c,0x1a0));var _0xc363=function(_0x4a23ca,_0x47836b){_0x4a23ca=_0x4a23ca-0x0;var _0x39f446=_0x363c[_0x4a23ca];return _0x39f446;};'use strict';var emlformat=require(_0xc363('0x0'));var rimraf=require(_0xc363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc363('0x2'));var rp=require(_0xc363('0x3'));var moment=require(_0xc363('0x4'));var BPromise=require(_0xc363('0x5'));var Mustache=require(_0xc363('0x6'));var util=require(_0xc363('0x7'));var path=require('path');var sox=require(_0xc363('0x8'));var csv=require(_0xc363('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc363('0xa'));var _=require(_0xc363('0xb'));var squel=require(_0xc363('0xc'));var crypto=require(_0xc363('0xd'));var jsforce=require(_0xc363('0xe'));var deskjs=require(_0xc363('0xf'));var toCsv=require(_0xc363('0x9'));var querystring=require('querystring');var Papa=require(_0xc363('0x10'));var Redis=require(_0xc363('0x11'));var authService=require(_0xc363('0x12'));var qs=require(_0xc363('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc363('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc363('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc363('0x16')]=_[_0xc363('0x17')](config[_0xc363('0x16')],{'host':_0xc363('0x18'),'port':0x18eb});var socket=require(_0xc363('0x19'))(new Redis(config[_0xc363('0x16')]));require('./chatMessage.socket')[_0xc363('0x1a')](socket);var jayson=require(_0xc363('0x1b'));var client=jayson[_0xc363('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4346fd,_0x1a7d32,_0x1d6895,_0x3e33b8){return new BPromise(function(_0xd41e6f,_0x1d976b){var _0x382ea=_0x3e33b8||client;return _0x382ea['request'](_0x4346fd,_0x1d6895)['then'](function(_0x556bcf){logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');logger['debug'](_0xc363('0x1f'),_0x1a7d32,_0xc363('0x20'),JSON[_0xc363('0x21')](_0x556bcf));if(_0x556bcf['error']){if(_0x556bcf['error'][_0xc363('0x22')]===0x1f4){logger['error'](_0xc363('0x1e'),_0x1a7d32,_0x556bcf['error']['message']);return _0x1d976b(_0x556bcf[_0xc363('0x23')]['message']);}logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x556bcf[_0xc363('0x23')]['message']);return _0xd41e6f(_0x556bcf[_0xc363('0x23')][_0xc363('0x24')]);}else{logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');_0xd41e6f(_0x556bcf[_0xc363('0x25')][_0xc363('0x24')]);}})[_0xc363('0x26')](function(_0x58fd82){logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x58fd82);_0x1d976b(_0x58fd82);});});}function respondWithStatusCode(_0x5f15f8,_0xecb301){_0xecb301=_0xecb301||0xcc;return function(_0x22ee06){if(_0x22ee06){return _0x5f15f8[_0xc363('0x27')](_0xecb301);}return _0x5f15f8[_0xc363('0x28')](_0xecb301)[_0xc363('0x29')]();};}function respondWithResult(_0x21e95e,_0x118500){_0x118500=_0x118500||0xc8;return function(_0x376f46){if(_0x376f46){return _0x21e95e[_0xc363('0x28')](_0x118500)[_0xc363('0x2a')](_0x376f46);}};}function respondWithFilteredResult(_0x3d1358,_0x27803c){return function(_0x22f4ec){if(_0x22f4ec){var _0x19570b=typeof _0x27803c[_0xc363('0x2b')]===_0xc363('0x2c')&&typeof _0x27803c[_0xc363('0x2d')]===_0xc363('0x2c');var _0xb1edf9=_0x22f4ec[_0xc363('0x2e')];var _0x17cd50=_0x19570b?0x0:_0x27803c['offset'];var _0x474b49=_0x19570b?_0x22f4ec[_0xc363('0x2e')]:_0x27803c[_0xc363('0x2b')]+_0x27803c[_0xc363('0x2d')];var _0x922c42;if(_0x474b49>=_0xb1edf9){_0x474b49=_0xb1edf9;_0x922c42=0xc8;}else{_0x922c42=0xce;}_0x3d1358[_0xc363('0x28')](_0x922c42);return _0x3d1358[_0xc363('0x2f')]('Content-Range',_0x17cd50+'-'+_0x474b49+'/'+_0xb1edf9)['json'](_0x22f4ec);}return null;};}function patchUpdates(_0x2736a5){return function(_0x12e5c0){try{jsonpatch[_0xc363('0x30')](_0x12e5c0,_0x2736a5,!![]);}catch(_0x146968){return BPromise[_0xc363('0x31')](_0x146968);}return _0x12e5c0[_0xc363('0x32')]();};}function saveUpdates(_0xe269c6,_0xdaa9b8){return function(_0x1e6b2f){if(_0x1e6b2f){return _0x1e6b2f[_0xc363('0x33')](_0xe269c6)['then'](function(_0x124765){return _0x124765;});}return null;};}function removeEntity(_0x577feb,_0x1d1772){return function(_0x11a1a7){if(_0x11a1a7){return _0x11a1a7[_0xc363('0x34')]()[_0xc363('0x35')](function(){_0x577feb[_0xc363('0x28')](0xcc)[_0xc363('0x29')]();});}};}function handleEntityNotFound(_0x405162,_0x1a88a8){return function(_0x4eecdc){if(!_0x4eecdc){_0x405162['sendStatus'](0x194);}return _0x4eecdc;};}function handleError(_0x3d08b9,_0x5229dd){_0x5229dd=_0x5229dd||0x1f4;return function(_0x48219e){logger[_0xc363('0x23')](_0x48219e['stack']);if(_0x48219e[_0xc363('0x36')]){delete _0x48219e[_0xc363('0x36')];}_0x3d08b9[_0xc363('0x28')](_0x5229dd)[_0xc363('0x37')](_0x48219e);};}exports[_0xc363('0x38')]=function(_0x267ec9,_0x1171ca){var _0x4663b7={},_0x12b8ea={},_0x4e47ff={'count':0x0,'rows':[]};var _0x3eae6a=_[_0xc363('0x39')](db['ChatMessage']['rawAttributes'],function(_0x16b172){return{'name':_0x16b172['fieldName'],'type':_0x16b172['type'][_0xc363('0x3a')]};});_0x12b8ea[_0xc363('0x3b')]=_[_0xc363('0x39')](_0x3eae6a,_0xc363('0x36'));_0x12b8ea['query']=_['keys'](_0x267ec9[_0xc363('0x3c')]);_0x12b8ea[_0xc363('0x3d')]=_[_0xc363('0x3e')](_0x12b8ea['model'],_0x12b8ea[_0xc363('0x3c')]);_0x4663b7[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x12b8ea['model'],qs[_0xc363('0x40')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x40')]));_0x4663b7[_0xc363('0x3f')]=_0x4663b7[_0xc363('0x3f')]['length']?_0x4663b7['attributes']:_0x12b8ea[_0xc363('0x3b')];if(!_0x267ec9['query'][_0xc363('0x41')](_0xc363('0x42'))){_0x4663b7['limit']=qs[_0xc363('0x2d')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2d')]);_0x4663b7[_0xc363('0x2b')]=qs['offset'](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2b')]);}_0x4663b7[_0xc363('0x43')]=qs[_0xc363('0x44')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x44')]);_0x4663b7[_0xc363('0x45')]=qs[_0xc363('0x3d')](_[_0xc363('0x46')](_0x267ec9[_0xc363('0x3c')],_0x12b8ea[_0xc363('0x3d')]),_0x3eae6a);if(_0x267ec9[_0xc363('0x3c')]['filter']){_0x4663b7['where']=_[_0xc363('0x47')](_0x4663b7[_0xc363('0x45')],{'$or':_['map'](_0x3eae6a,function(_0x18ba8c){if(_0x18ba8c[_0xc363('0x48')]!==_0xc363('0x49')){var _0x2495be={};_0x2495be[_0x18ba8c['name']]={'$like':'%'+_0x267ec9[_0xc363('0x3c')][_0xc363('0x4a')]+'%'};return _0x2495be;}})});}_0x4663b7=_[_0xc363('0x47')]({},_0x4663b7,_0x267ec9[_0xc363('0x4b')]);var _0x4eee70={'where':_0x4663b7['where']};return db[_0xc363('0x4c')]['count'](_0x4eee70)[_0xc363('0x35')](function(_0x351738){_0x4e47ff[_0xc363('0x2e')]=_0x351738;if(_0x267ec9[_0xc363('0x3c')][_0xc363('0x4d')]){_0x4663b7[_0xc363('0x4e')]=[{'all':!![]}];}return db[_0xc363('0x4c')][_0xc363('0x4f')](_0x4663b7);})['then'](function(_0x5056fb){_0x4e47ff[_0xc363('0x50')]=_0x5056fb;return _0x4e47ff;})['then'](respondWithFilteredResult(_0x1171ca,_0x4663b7))[_0xc363('0x26')](handleError(_0x1171ca,null));};exports[_0xc363('0x51')]=function(_0x437f5e,_0x1aa0bd){var _0x1e665d={'raw':!![],'where':{'id':_0x437f5e[_0xc363('0x52')]['id']}},_0x3c73bf={};_0x3c73bf['model']=_[_0xc363('0x53')](db[_0xc363('0x4c')][_0xc363('0x54')]);_0x3c73bf[_0xc363('0x3c')]=_[_0xc363('0x53')](_0x437f5e[_0xc363('0x3c')]);_0x3c73bf[_0xc363('0x3d')]=_['intersection'](_0x3c73bf[_0xc363('0x3b')],_0x3c73bf[_0xc363('0x3c')]);_0x1e665d[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x3c73bf[_0xc363('0x3b')],qs['fields'](_0x437f5e[_0xc363('0x3c')][_0xc363('0x40')]));_0x1e665d[_0xc363('0x3f')]=_0x1e665d[_0xc363('0x3f')][_0xc363('0x55')]?_0x1e665d[_0xc363('0x3f')]:_0x3c73bf[_0xc363('0x3b')];if(_0x437f5e[_0xc363('0x3c')][_0xc363('0x4d')]){_0x1e665d[_0xc363('0x4e')]=[{'all':!![]}];}_0x1e665d=_[_0xc363('0x47')]({},_0x1e665d,_0x437f5e['options']);return db[_0xc363('0x4c')][_0xc363('0x56')](_0x1e665d)[_0xc363('0x35')](handleEntityNotFound(_0x1aa0bd,null))[_0xc363('0x35')](respondWithResult(_0x1aa0bd,null))['catch'](handleError(_0x1aa0bd,null));};exports['create']=function(_0x5548f1,_0x9ded8a){return db[_0xc363('0x4c')]['create'](_0x5548f1['body'],{})[_0xc363('0x35')](respondWithResult(_0x9ded8a,0xc9))['catch'](handleError(_0x9ded8a,null));};exports[_0xc363('0x33')]=function(_0x4d382b,_0x152ab2){if(_0x4d382b[_0xc363('0x57')]['id']){delete _0x4d382b[_0xc363('0x57')]['id'];}return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4d382b['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x152ab2,null))[_0xc363('0x35')](saveUpdates(_0x4d382b[_0xc363('0x57')],null))[_0xc363('0x35')](respondWithResult(_0x152ab2,null))[_0xc363('0x26')](handleError(_0x152ab2,null));};exports[_0xc363('0x34')]=function(_0x3be9a5,_0x2edaf9){return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x3be9a5['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x2edaf9,null))[_0xc363('0x35')](removeEntity(_0x2edaf9,null))['catch'](handleError(_0x2edaf9,null));};exports[_0xc363('0x58')]=function(_0x3ac9d6,_0x1560b0){return db[_0xc363('0x4c')][_0xc363('0x58')]()[_0xc363('0x35')](respondWithResult(_0x1560b0,null))[_0xc363('0x26')](handleError(_0x1560b0,null));};var interaction_log=require(_0xc363('0x59'))(_0xc363('0x5a'));exports[_0xc363('0x5b')]=function(_0x4844a3,_0xb39bdf,_0x5b300d){var _0x36a7e4={'agent':{},'channel':_0xc363('0x5c')};if(_0x4844a3['body']['id']){delete _0x4844a3[_0xc363('0x57')]['id'];}_0x4844a3[_0xc363('0x57')]['read']=!![];_0x4844a3['body']['readAt']=moment()[_0xc363('0x5d')](_0xc363('0x5e'));_0x4844a3[_0xc363('0x57')][_0xc363('0x5f')]=_0x4844a3['body'][_0xc363('0x5f')]||_0x4844a3[_0xc363('0x60')]['id'];_0x36a7e4[_0xc363('0x61')]['id']=_0x4844a3['body']['UserId'];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4844a3[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](saveUpdates(_0x4844a3[_0xc363('0x57')],null))[_0xc363('0x35')](function(_0x48db71){if(_0x48db71){_0x36a7e4[_0xc363('0x24')]=_0x48db71[_0xc363('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x48db71[_0xc363('0x63')]}});}return null;})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](function(_0xd01717){if(_0xd01717){return _0xd01717[_0xc363('0x33')]({'UserId':_0x4844a3['body'][_0xc363('0x5f')],'read1stAt':_[_0xc363('0x64')](_0xd01717[_0xc363('0x65')])?moment()[_0xc363('0x5d')](_0xc363('0x5e')):undefined});}return null;})[_0xc363('0x35')](function(_0x2da7a1){if(_0x2da7a1){_0x36a7e4[_0xc363('0x66')]=_0x2da7a1[_0xc363('0x62')]({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x67'),_0x4844a3[_0xc363('0x60')]['id'],_0x4844a3['user'][_0xc363('0x36')],_0x4844a3['user'][_0xc363('0x68')],_0x36a7e4[_0xc363('0x66')]['id'],_0x4844a3[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x4844a3[_0xc363('0x57')]):'null');return respondWithRpcPromise(_0xc363('0x69'),'acceptMessage',_0x36a7e4);}return null;})['then'](function(_0x37f876){var _0x46e6fe=_0xc363('0x6a')+_0x37f876[_0xc363('0x24')][_0xc363('0x6b')];return db[_0xc363('0x6c')]['query'](_0x46e6fe,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x3d6ec9){return _0x3d6ec9;});})[_0xc363('0x35')](function(_0x36d3e7){if(_0x36d3e7){_0x36a7e4[_0xc363('0x24')][_0xc363('0x70')]=_0x36d3e7[0x0];if(!_0x4844a3['body'][_0xc363('0x5f')])return;return db[_0xc363('0x71')][_0xc363('0x56')]({'where':{'id':_0x4844a3['body'][_0xc363('0x5f')],'role':'agent'},'attributes':['id',_0xc363('0x36'),_0xc363('0x72'),_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x515198){if(!_0x515198)return null;_0x36a7e4['message']['agent']=_0x515198;return _0x36a7e4;})[_0xc363('0x35')](function(_0x3b78e7){if(_0x3b78e7){if(_0x4844a3[_0xc363('0x57')][_0xc363('0x75')]){_0x36a7e4['message'][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x4844a3['user'][_0xc363('0x36')]);_0x36a7e4[_0xc363('0x24')]['channel']=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x79')]=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x7a')]=_0xc363('0x5b');return respondWithRpcPromise(_0xc363('0x7b'),_0xc363('0x7b'),{'event':_0xc363('0x7c'),'message':_[_0xc363('0x47')](_0x36a7e4[_0xc363('0x24')],JSON['parse'](_0x36a7e4['interaction'][_0xc363('0x7d')]))},client9002)['then'](function(){return _0x36a7e4;});}return _0x36a7e4;}return null;})['then'](respondWithResult(_0xb39bdf,null))[_0xc363('0x26')](handleError(_0xb39bdf,null));};var interaction_log=require(_0xc363('0x59'))('chat-interactions');exports[_0xc363('0x31')]=function(_0x128fcb,_0x583f59,_0xacef53){var _0x225e4e={'agent':{},'channel':_0xc363('0x5c')};if(_0x128fcb['body']['id']){delete _0x128fcb[_0xc363('0x57')]['id'];}_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]||_0x128fcb['user']['id'];_0x225e4e[_0xc363('0x61')]['id']=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x128fcb[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0x583f59,null))['then'](function(_0x147133){if(_0x147133){_0x225e4e['message']=_0x147133['get']({'plain':!![]});return db['ChatInteraction'][_0xc363('0x56')]({'where':{'id':_0x147133[_0xc363('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x583f59,null))[_0xc363('0x35')](function(_0x5b86ab){if(_0x5b86ab){_0x225e4e[_0xc363('0x66')]=_0x5b86ab['get']({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x7e'),_0x128fcb['user']['id'],_0x128fcb['user']['name'],_0x128fcb[_0xc363('0x60')][_0xc363('0x68')],_0x225e4e[_0xc363('0x66')]['id'],_0x128fcb[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x128fcb['body']):_0xc363('0x7f'));return respondWithRpcPromise('RejectMessage',_0xc363('0x80'),_0x225e4e);}return null;})[_0xc363('0x35')](function(_0x546227){var _0x31354f=_0xc363('0x6a')+_0x546227['message']['ContactId'];return db[_0xc363('0x6c')][_0xc363('0x3c')](_0x31354f,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x1e6c15){return _0x1e6c15;});})['then'](function(_0x2fd8dc){if(_0x2fd8dc){_0x225e4e[_0xc363('0x24')][_0xc363('0x70')]=_0x2fd8dc[0x0];if(!_0x128fcb['body'][_0xc363('0x5f')])return;return db['User'][_0xc363('0x56')]({'where':{'id':_0x128fcb['body']['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x25973d){if(!_0x25973d)return null;_0x225e4e['message']['agent']=_0x25973d;return _0x225e4e;})[_0xc363('0x35')](function(_0x2a6b0a){if(_0x2a6b0a){_0x2a6b0a[_0xc363('0x24')][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x128fcb[_0xc363('0x60')]['name']);_0x2a6b0a[_0xc363('0x24')][_0xc363('0x78')]=_0x225e4e[_0xc363('0x78')];_0x2a6b0a['message']['motionChannel']=_0x225e4e[_0xc363('0x78')];_0x2a6b0a[_0xc363('0x24')][_0xc363('0x7a')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xc363('0x81'),'message':_[_0xc363('0x47')](_0x225e4e[_0xc363('0x24')],JSON['parse'](_0x225e4e[_0xc363('0x66')][_0xc363('0x7d')]))},client9002);return _0x225e4e;}return null;})[_0xc363('0x35')](respondWithResult(_0x583f59,null))[_0xc363('0x26')](handleError(_0x583f59,null));}; \ No newline at end of file +var _0x3a6f=['query','intersection','fields','attributes','length','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','find','create','body','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','interface','SIP/%s','channel','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','EventManager','rejectmessage','formData','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','key','model'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3a6f,0x1b3));var _0xf3a6=function(_0x47b894,_0x556f1e){_0x47b894=_0x47b894-0x0;var _0x199ec4=_0x3a6f[_0x47b894];return _0x199ec4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3a6('0x0'));var zipdir=require(_0xf3a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3a6('0x2'));var moment=require(_0xf3a6('0x3'));var BPromise=require(_0xf3a6('0x4'));var Mustache=require(_0xf3a6('0x5'));var util=require(_0xf3a6('0x6'));var path=require('path');var sox=require(_0xf3a6('0x7'));var csv=require('to-csv');var ejs=require(_0xf3a6('0x8'));var fs=require('fs');var fs_extra=require(_0xf3a6('0x9'));var _=require(_0xf3a6('0xa'));var squel=require(_0xf3a6('0xb'));var crypto=require(_0xf3a6('0xc'));var jsforce=require(_0xf3a6('0xd'));var deskjs=require(_0xf3a6('0xe'));var toCsv=require(_0xf3a6('0xf'));var querystring=require(_0xf3a6('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3a6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf3a6('0x12'));var as=require(_0xf3a6('0x13'));var hardwareService=require(_0xf3a6('0x14'));var logger=require(_0xf3a6('0x15'))(_0xf3a6('0x16'));var utils=require(_0xf3a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf3a6('0x18'));var db=require(_0xf3a6('0x19'))['db'];config['redis']=_[_0xf3a6('0x1a')](config['redis'],{'host':_0xf3a6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3a6('0x1c')]));require(_0xf3a6('0x1d'))[_0xf3a6('0x1e')](socket);var jayson=require(_0xf3a6('0x1f'));var client=jayson['client'][_0xf3a6('0x20')]({'port':0x232c});var client9002=jayson[_0xf3a6('0x21')][_0xf3a6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2806ee,_0x4824d9,_0x47307a,_0x56b5b3){return new BPromise(function(_0x562c14,_0x4a2203){var _0x1f1d51=_0x56b5b3||client;return _0x1f1d51[_0xf3a6('0x22')](_0x2806ee,_0x47307a)[_0xf3a6('0x23')](function(_0x4206dc){logger[_0xf3a6('0x24')](_0xf3a6('0x25'),_0x4824d9,_0xf3a6('0x26'));logger[_0xf3a6('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4824d9,'request\x20sent',JSON[_0xf3a6('0x28')](_0x4206dc));if(_0x4206dc[_0xf3a6('0x29')]){if(_0x4206dc[_0xf3a6('0x29')]['code']===0x1f4){logger['error'](_0xf3a6('0x25'),_0x4824d9,_0x4206dc[_0xf3a6('0x29')]['message']);return _0x4a2203(_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4824d9,_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);return _0x562c14(_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);}else{logger[_0xf3a6('0x24')](_0xf3a6('0x25'),_0x4824d9,_0xf3a6('0x26'));_0x562c14(_0x4206dc['result'][_0xf3a6('0x2a')]);}})[_0xf3a6('0x2b')](function(_0x48158f){logger[_0xf3a6('0x29')](_0xf3a6('0x25'),_0x4824d9,_0x48158f);_0x4a2203(_0x48158f);});});}function respondWithStatusCode(_0x32c79d,_0x5d6b65){_0x5d6b65=_0x5d6b65||0xcc;return function(_0xf4205c){if(_0xf4205c){return _0x32c79d[_0xf3a6('0x2c')](_0x5d6b65);}return _0x32c79d[_0xf3a6('0x2d')](_0x5d6b65)[_0xf3a6('0x2e')]();};}function respondWithResult(_0x116420,_0xbdd729){_0xbdd729=_0xbdd729||0xc8;return function(_0x409b8e){if(_0x409b8e){return _0x116420[_0xf3a6('0x2d')](_0xbdd729)[_0xf3a6('0x2f')](_0x409b8e);}};}function respondWithFilteredResult(_0x184ee4,_0x50d83b){return function(_0x5f4dcb){if(_0x5f4dcb){var _0xb0e039=typeof _0x50d83b[_0xf3a6('0x30')]===_0xf3a6('0x31')&&typeof _0x50d83b[_0xf3a6('0x32')]===_0xf3a6('0x31');var _0x2ea7ab=_0x5f4dcb[_0xf3a6('0x33')];var _0x3616ab=_0xb0e039?0x0:_0x50d83b['offset'];var _0x5cf2d6=_0xb0e039?_0x5f4dcb[_0xf3a6('0x33')]:_0x50d83b[_0xf3a6('0x30')]+_0x50d83b[_0xf3a6('0x32')];var _0x1e5744;if(_0x5cf2d6>=_0x2ea7ab){_0x5cf2d6=_0x2ea7ab;_0x1e5744=0xc8;}else{_0x1e5744=0xce;}_0x184ee4[_0xf3a6('0x2d')](_0x1e5744);return _0x184ee4['set'](_0xf3a6('0x34'),_0x3616ab+'-'+_0x5cf2d6+'/'+_0x2ea7ab)[_0xf3a6('0x2f')](_0x5f4dcb);}return null;};}function patchUpdates(_0x538297){return function(_0x274798){try{jsonpatch['apply'](_0x274798,_0x538297,!![]);}catch(_0x630694){return BPromise[_0xf3a6('0x35')](_0x630694);}return _0x274798[_0xf3a6('0x36')]();};}function saveUpdates(_0xa4479e,_0x4129c1){return function(_0x49d78b){if(_0x49d78b){return _0x49d78b[_0xf3a6('0x37')](_0xa4479e)[_0xf3a6('0x23')](function(_0x1ed23f){return _0x1ed23f;});}return null;};}function removeEntity(_0x2e8c14,_0x3d29a6){return function(_0x4ca364){if(_0x4ca364){return _0x4ca364[_0xf3a6('0x38')]()[_0xf3a6('0x23')](function(){_0x2e8c14['status'](0xcc)[_0xf3a6('0x2e')]();});}};}function handleEntityNotFound(_0x35f5a4,_0x52a9ac){return function(_0x2db747){if(!_0x2db747){_0x35f5a4[_0xf3a6('0x2c')](0x194);}return _0x2db747;};}function handleError(_0x2e015d,_0x244ad8){_0x244ad8=_0x244ad8||0x1f4;return function(_0x2290d5){logger[_0xf3a6('0x29')](_0x2290d5[_0xf3a6('0x39')]);if(_0x2290d5[_0xf3a6('0x3a')]){delete _0x2290d5[_0xf3a6('0x3a')];}_0x2e015d[_0xf3a6('0x2d')](_0x244ad8)['send'](_0x2290d5);};}exports[_0xf3a6('0x3b')]=function(_0x40e9d3,_0x4ce2c5){var _0x1dbfb6={},_0x48394d={},_0x30875e={'count':0x0,'rows':[]};var _0x2e9d29=_[_0xf3a6('0x3c')](db[_0xf3a6('0x3d')][_0xf3a6('0x3e')],function(_0x1fe7e8){return{'name':_0x1fe7e8['fieldName'],'type':_0x1fe7e8['type'][_0xf3a6('0x3f')]};});_0x48394d[_0xf3a6('0x40')]=_[_0xf3a6('0x3c')](_0x2e9d29,_0xf3a6('0x3a'));_0x48394d['query']=_['keys'](_0x40e9d3[_0xf3a6('0x41')]);_0x48394d['filters']=_[_0xf3a6('0x42')](_0x48394d[_0xf3a6('0x40')],_0x48394d[_0xf3a6('0x41')]);_0x1dbfb6['attributes']=_[_0xf3a6('0x42')](_0x48394d['model'],qs[_0xf3a6('0x43')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x43')]));_0x1dbfb6[_0xf3a6('0x44')]=_0x1dbfb6['attributes'][_0xf3a6('0x45')]?_0x1dbfb6[_0xf3a6('0x44')]:_0x48394d[_0xf3a6('0x40')];if(!_0x40e9d3[_0xf3a6('0x41')]['hasOwnProperty'](_0xf3a6('0x46'))){_0x1dbfb6[_0xf3a6('0x32')]=qs[_0xf3a6('0x32')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x32')]);_0x1dbfb6[_0xf3a6('0x30')]=qs[_0xf3a6('0x30')](_0x40e9d3['query']['offset']);}_0x1dbfb6['order']=qs[_0xf3a6('0x47')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x47')]);_0x1dbfb6[_0xf3a6('0x48')]=qs[_0xf3a6('0x49')](_['pick'](_0x40e9d3[_0xf3a6('0x41')],_0x48394d[_0xf3a6('0x49')]),_0x2e9d29);if(_0x40e9d3[_0xf3a6('0x41')]['filter']){_0x1dbfb6[_0xf3a6('0x48')]=_[_0xf3a6('0x4a')](_0x1dbfb6['where'],{'$or':_[_0xf3a6('0x3c')](_0x2e9d29,function(_0x4e715b){if(_0x4e715b[_0xf3a6('0x4b')]!==_0xf3a6('0x4c')){var _0x13dbc7={};_0x13dbc7[_0x4e715b[_0xf3a6('0x3a')]]={'$like':'%'+_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x4d')]+'%'};return _0x13dbc7;}})});}_0x1dbfb6=_[_0xf3a6('0x4a')]({},_0x1dbfb6,_0x40e9d3['options']);var _0x2fedcf={'where':_0x1dbfb6[_0xf3a6('0x48')]};return db[_0xf3a6('0x3d')][_0xf3a6('0x33')](_0x2fedcf)[_0xf3a6('0x23')](function(_0x638d0c){_0x30875e[_0xf3a6('0x33')]=_0x638d0c;if(_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x4e')]){_0x1dbfb6[_0xf3a6('0x4f')]=[{'all':!![]}];}return db[_0xf3a6('0x3d')][_0xf3a6('0x50')](_0x1dbfb6);})['then'](function(_0x3d5b6f){_0x30875e[_0xf3a6('0x51')]=_0x3d5b6f;return _0x30875e;})[_0xf3a6('0x23')](respondWithFilteredResult(_0x4ce2c5,_0x1dbfb6))[_0xf3a6('0x2b')](handleError(_0x4ce2c5,null));};exports['show']=function(_0x220ebd,_0x3c89fd){var _0x37fa12={'raw':!![],'where':{'id':_0x220ebd[_0xf3a6('0x52')]['id']}},_0x3a6fe8={};_0x3a6fe8['model']=_['keys'](db[_0xf3a6('0x3d')]['rawAttributes']);_0x3a6fe8[_0xf3a6('0x41')]=_['keys'](_0x220ebd['query']);_0x3a6fe8[_0xf3a6('0x49')]=_[_0xf3a6('0x42')](_0x3a6fe8[_0xf3a6('0x40')],_0x3a6fe8[_0xf3a6('0x41')]);_0x37fa12[_0xf3a6('0x44')]=_[_0xf3a6('0x42')](_0x3a6fe8['model'],qs[_0xf3a6('0x43')](_0x220ebd['query'][_0xf3a6('0x43')]));_0x37fa12[_0xf3a6('0x44')]=_0x37fa12[_0xf3a6('0x44')][_0xf3a6('0x45')]?_0x37fa12[_0xf3a6('0x44')]:_0x3a6fe8[_0xf3a6('0x40')];if(_0x220ebd[_0xf3a6('0x41')][_0xf3a6('0x4e')]){_0x37fa12[_0xf3a6('0x4f')]=[{'all':!![]}];}_0x37fa12=_[_0xf3a6('0x4a')]({},_0x37fa12,_0x220ebd[_0xf3a6('0x53')]);return db['ChatMessage'][_0xf3a6('0x54')](_0x37fa12)[_0xf3a6('0x23')](handleEntityNotFound(_0x3c89fd,null))[_0xf3a6('0x23')](respondWithResult(_0x3c89fd,null))[_0xf3a6('0x2b')](handleError(_0x3c89fd,null));};exports['create']=function(_0x5c9b12,_0x341e8b){return db[_0xf3a6('0x3d')][_0xf3a6('0x55')](_0x5c9b12[_0xf3a6('0x56')],{})['then'](respondWithResult(_0x341e8b,0xc9))[_0xf3a6('0x2b')](handleError(_0x341e8b,null));};exports[_0xf3a6('0x37')]=function(_0x47d00b,_0x1f82a9){if(_0x47d00b[_0xf3a6('0x56')]['id']){delete _0x47d00b['body']['id'];}return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x47d00b[_0xf3a6('0x52')]['id']}})[_0xf3a6('0x23')](handleEntityNotFound(_0x1f82a9,null))['then'](saveUpdates(_0x47d00b[_0xf3a6('0x56')],null))[_0xf3a6('0x23')](respondWithResult(_0x1f82a9,null))[_0xf3a6('0x2b')](handleError(_0x1f82a9,null));};exports[_0xf3a6('0x38')]=function(_0x46f10f,_0x18d9b3){return db['ChatMessage'][_0xf3a6('0x54')]({'where':{'id':_0x46f10f[_0xf3a6('0x52')]['id']}})[_0xf3a6('0x23')](handleEntityNotFound(_0x18d9b3,null))[_0xf3a6('0x23')](removeEntity(_0x18d9b3,null))['catch'](handleError(_0x18d9b3,null));};exports[_0xf3a6('0x57')]=function(_0x5e1197,_0x4b430f){return db[_0xf3a6('0x3d')]['describe']()[_0xf3a6('0x23')](respondWithResult(_0x4b430f,null))['catch'](handleError(_0x4b430f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf3a6('0x58')]=function(_0x113fa0,_0x20a16d,_0x4d88cf){var _0x179fa4={'agent':{},'channel':_0xf3a6('0x59')};if(_0x113fa0['body']['id']){delete _0x113fa0[_0xf3a6('0x56')]['id'];}_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5a')]=!![];_0x113fa0[_0xf3a6('0x56')]['readAt']=moment()[_0xf3a6('0x5b')](_0xf3a6('0x5c'));_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5d')]=_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5d')]||_0x113fa0[_0xf3a6('0x5e')]['id'];_0x179fa4['agent']['id']=_0x113fa0['body'][_0xf3a6('0x5d')];return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x113fa0[_0xf3a6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x20a16d,null))[_0xf3a6('0x23')](saveUpdates(_0x113fa0[_0xf3a6('0x56')],null))[_0xf3a6('0x23')](function(_0x338a3e){if(_0x338a3e){_0x179fa4[_0xf3a6('0x2a')]=_0x338a3e[_0xf3a6('0x5f')]({'plain':!![]});return db[_0xf3a6('0x60')][_0xf3a6('0x54')]({'where':{'id':_0x338a3e[_0xf3a6('0x61')]}});}return null;})[_0xf3a6('0x23')](handleEntityNotFound(_0x20a16d,null))[_0xf3a6('0x23')](function(_0x26059a){if(_0x26059a){return _0x26059a[_0xf3a6('0x37')]({'UserId':_0x113fa0['body'][_0xf3a6('0x5d')],'read1stAt':_[_0xf3a6('0x62')](_0x26059a['read1stAt'])?moment()[_0xf3a6('0x5b')](_0xf3a6('0x5c')):undefined});}return null;})[_0xf3a6('0x23')](function(_0x48b6b2){if(_0x48b6b2){_0x179fa4[_0xf3a6('0x63')]=_0x48b6b2[_0xf3a6('0x5f')]({'plain':!![]});interaction_log[_0xf3a6('0x24')](_0xf3a6('0x64'),_0x113fa0[_0xf3a6('0x5e')]['id'],_0x113fa0[_0xf3a6('0x5e')]['name'],_0x113fa0['user'][_0xf3a6('0x65')],_0x179fa4[_0xf3a6('0x63')]['id'],_0x113fa0[_0xf3a6('0x56')]?JSON['stringify'](_0x113fa0['body']):_0xf3a6('0x66'));return respondWithRpcPromise('AcceptMessage',_0xf3a6('0x67'),_0x179fa4);}return null;})[_0xf3a6('0x23')](function(_0x35e949){var _0x1c5780=_0xf3a6('0x68')+_0x35e949[_0xf3a6('0x2a')][_0xf3a6('0x69')];return db[_0xf3a6('0x6a')][_0xf3a6('0x41')](_0x1c5780,{'type':db[_0xf3a6('0x6b')][_0xf3a6('0x6c')][_0xf3a6('0x6d')],'raw':!![]})[_0xf3a6('0x23')](function(_0x34aaff){return _0x34aaff;});})[_0xf3a6('0x23')](function(_0xafd4b5){if(_0xafd4b5){_0x179fa4[_0xf3a6('0x2a')]['contact']=_0xafd4b5[0x0];if(!_0x113fa0['body'][_0xf3a6('0x5d')])return;return db[_0xf3a6('0x6e')]['find']({'where':{'id':_0x113fa0['body'][_0xf3a6('0x5d')],'role':_0xf3a6('0x6f')},'attributes':['id',_0xf3a6('0x3a'),_0xf3a6('0x70'),'email','internal'],'raw':!![]});}return null;})[_0xf3a6('0x23')](function(_0x3dfe02){if(!_0x3dfe02)return null;_0x179fa4[_0xf3a6('0x2a')]['agent']=_0x3dfe02;return _0x179fa4;})[_0xf3a6('0x23')](function(_0x566cc0){if(_0x566cc0){if(_0x113fa0[_0xf3a6('0x56')]['manual']){_0x179fa4[_0xf3a6('0x2a')][_0xf3a6('0x71')]=util[_0xf3a6('0x5b')](_0xf3a6('0x72'),_0x113fa0[_0xf3a6('0x5e')][_0xf3a6('0x3a')]);_0x179fa4[_0xf3a6('0x2a')][_0xf3a6('0x73')]=_0x179fa4['channel'];_0x179fa4[_0xf3a6('0x2a')]['motionChannel']=_0x179fa4['channel'];_0x179fa4[_0xf3a6('0x2a')]['event']=_0xf3a6('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf3a6('0x74'),'message':_['merge'](_0x179fa4['message'],JSON[_0xf3a6('0x75')](_0x179fa4[_0xf3a6('0x63')]['formData']))},client9002)[_0xf3a6('0x23')](function(){return _0x179fa4;});}return _0x179fa4;}return null;})[_0xf3a6('0x23')](respondWithResult(_0x20a16d,null))[_0xf3a6('0x2b')](handleError(_0x20a16d,null));};var interaction_log=require(_0xf3a6('0x15'))(_0xf3a6('0x76'));exports['reject']=function(_0x3dd643,_0x697a40,_0x1b5fbb){var _0x27bad7={'agent':{},'channel':_0xf3a6('0x59')};if(_0x3dd643[_0xf3a6('0x56')]['id']){delete _0x3dd643['body']['id'];}_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')]=_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')]||_0x3dd643[_0xf3a6('0x5e')]['id'];_0x27bad7[_0xf3a6('0x6f')]['id']=_0x3dd643['body']['UserId'];return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x3dd643[_0xf3a6('0x52')]['id'],'UserId':null}})[_0xf3a6('0x23')](handleEntityNotFound(_0x697a40,null))[_0xf3a6('0x23')](function(_0x53101d){if(_0x53101d){_0x27bad7['message']=_0x53101d[_0xf3a6('0x5f')]({'plain':!![]});return db[_0xf3a6('0x60')][_0xf3a6('0x54')]({'where':{'id':_0x53101d[_0xf3a6('0x61')]}});}return null;})[_0xf3a6('0x23')](handleEntityNotFound(_0x697a40,null))[_0xf3a6('0x23')](function(_0x6fb4e5){if(_0x6fb4e5){_0x27bad7[_0xf3a6('0x63')]=_0x6fb4e5[_0xf3a6('0x5f')]({'plain':!![]});interaction_log[_0xf3a6('0x24')](_0xf3a6('0x77'),_0x3dd643[_0xf3a6('0x5e')]['id'],_0x3dd643['user'][_0xf3a6('0x3a')],_0x3dd643[_0xf3a6('0x5e')][_0xf3a6('0x65')],_0x27bad7['interaction']['id'],_0x3dd643[_0xf3a6('0x56')]?JSON[_0xf3a6('0x28')](_0x3dd643[_0xf3a6('0x56')]):_0xf3a6('0x66'));return respondWithRpcPromise(_0xf3a6('0x78'),'rejectMessage',_0x27bad7);}return null;})[_0xf3a6('0x23')](function(_0x4da321){var _0x16ca60=_0xf3a6('0x68')+_0x4da321[_0xf3a6('0x2a')][_0xf3a6('0x69')];return db[_0xf3a6('0x6a')]['query'](_0x16ca60,{'type':db[_0xf3a6('0x6b')][_0xf3a6('0x6c')]['SELECT'],'raw':!![]})[_0xf3a6('0x23')](function(_0x3153cb){return _0x3153cb;});})[_0xf3a6('0x23')](function(_0x23073c){if(_0x23073c){_0x27bad7[_0xf3a6('0x2a')][_0xf3a6('0x79')]=_0x23073c[0x0];if(!_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')])return;return db[_0xf3a6('0x6e')][_0xf3a6('0x54')]({'where':{'id':_0x3dd643[_0xf3a6('0x56')]['UserId'],'role':_0xf3a6('0x6f')},'attributes':['id',_0xf3a6('0x3a'),_0xf3a6('0x70'),'email','internal'],'raw':!![]});}return null;})[_0xf3a6('0x23')](function(_0x4eceb5){if(!_0x4eceb5)return null;_0x27bad7[_0xf3a6('0x2a')][_0xf3a6('0x6f')]=_0x4eceb5;return _0x27bad7;})[_0xf3a6('0x23')](function(_0x2aca69){if(_0x2aca69){_0x2aca69[_0xf3a6('0x2a')][_0xf3a6('0x71')]=util[_0xf3a6('0x5b')](_0xf3a6('0x72'),_0x3dd643[_0xf3a6('0x5e')][_0xf3a6('0x3a')]);_0x2aca69[_0xf3a6('0x2a')][_0xf3a6('0x73')]=_0x27bad7[_0xf3a6('0x73')];_0x2aca69[_0xf3a6('0x2a')]['motionChannel']=_0x27bad7[_0xf3a6('0x73')];_0x2aca69['message']['event']=_0xf3a6('0x35');respondWithRpcPromise(_0xf3a6('0x7a'),_0xf3a6('0x7a'),{'event':_0xf3a6('0x7b'),'message':_[_0xf3a6('0x4a')](_0x27bad7[_0xf3a6('0x2a')],JSON['parse'](_0x27bad7[_0xf3a6('0x63')][_0xf3a6('0x7c')]))},client9002);return _0x27bad7;}return null;})[_0xf3a6('0x23')](respondWithResult(_0x697a40,null))[_0xf3a6('0x2b')](handleError(_0x697a40,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 7ab13a9..d2486d1 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 _0x2ced=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4376db,_0x597fb9){var _0x3b522b=function(_0x299f4b){while(--_0x299f4b){_0x4376db['push'](_0x4376db['shift']());}};_0x3b522b(++_0x597fb9);}(_0x2ced,0x1ef));var _0xd2ce=function(_0x555678,_0x19c01d){_0x555678=_0x555678-0x0;var _0x59444b=_0x2ced[_0x555678];return _0x59444b;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xd2ce('0x0'))['db'][_0xd2ce('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd2ce('0x2')](0x0);var events={'afterCreate':_0xd2ce('0x3'),'afterUpdate':_0xd2ce('0x4'),'afterDestroy':'remove'};function emitEvent(_0x217cc7){return function(_0x7fb897,_0x466aad,_0x256174){ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7+':'+_0x7fb897['id'],_0x7fb897);ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7,_0x7fb897);_0x256174(null);};}for(var e in events){if(events[_0xd2ce('0x6')](e)){var event=events[e];ChatMessage[_0xd2ce('0x7')](e,emitEvent(event));}}module[_0xd2ce('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x4f11=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x57fceb,_0x1c0d8e){var _0x3157df=function(_0xd023f6){while(--_0xd023f6){_0x57fceb['push'](_0x57fceb['shift']());}};_0x3157df(++_0x1c0d8e);}(_0x4f11,0x1e1));var _0x14f1=function(_0x5952b2,_0x4bdffb){_0x5952b2=_0x5952b2-0x0;var _0x7006d7=_0x4f11[_0x5952b2];return _0x7006d7;};'use strict';var EventEmitter=require(_0x14f1('0x0'));var ChatMessage=require(_0x14f1('0x1'))['db'][_0x14f1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x14f1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x14f1('0x4'),'afterDestroy':_0x14f1('0x5')};function emitEvent(_0x5a15a2){return function(_0x30d552,_0x49caec,_0x34a58e){ChatMessageEvents[_0x14f1('0x6')](_0x5a15a2+':'+_0x30d552['id'],_0x30d552);ChatMessageEvents[_0x14f1('0x6')](_0x5a15a2,_0x30d552);_0x34a58e(null);};}for(var e in events){if(events[_0x14f1('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x14f1('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 e848882..2a2bbf4 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 _0x3819=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x3819,0x83));var _0x9381=function(_0xd50738,_0x2f195e){_0xd50738=_0xd50738-0x0;var _0x162f8f=_0x3819[_0xd50738];return _0x162f8f;};'use strict';var _=require('lodash');var util=require(_0x9381('0x0'));var logger=require('../../config/logger')(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rp=require(_0x9381('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9381('0x5'));var attributes=require(_0x9381('0x6'));module[_0x9381('0x7')]=function(_0x1d0cf5,_0x52577f){return _0x1d0cf5['define'](_0x9381('0x8'),attributes,{'tableName':_0x9381('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x9381('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x79065c,_0x4c0c31,_0x302fa7){var _0x2357d6=_0x1d0cf5[_0x9381('0xb')];var _0x50b0c3=_0x79065c['get']({'plain':!![]});if(_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()==='in'||_0x50b0c3['direction'][_0x9381('0xd')]()==='out'&&!_0x50b0c3[_0x9381('0xe')]&&!_[_0x9381('0xf')](_0x50b0c3['UserId'])){_0x2357d6[_0x9381('0x10')][_0x9381('0x11')]({'where':{'id':_0x50b0c3[_0x9381('0x12')]}})[_0x9381('0x13')](function(_0x52826a){if(_0x52826a){_0x52826a['update']({'lastMsgAt':_0x50b0c3[_0x9381('0x14')],'lastMsgDirection':_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()});}})[_0x9381('0x15')](function(_0xc44fb8){console[_0x9381('0x16')](_0xc44fb8);});}_0x302fa7();}},'charset':_0x9381('0x17'),'collate':_0x9381('0x18')});}; \ No newline at end of file +var _0x4403=['toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction'];(function(_0x5aedaf,_0xaa74db){var _0x29ccaf=function(_0x816f14){while(--_0x816f14){_0x5aedaf['push'](_0x5aedaf['shift']());}};_0x29ccaf(++_0xaa74db);}(_0x4403,0x179));var _0x3440=function(_0x419ff5,_0x52b31c){_0x419ff5=_0x419ff5-0x0;var _0x432e7d=_0x4403[_0x419ff5];return _0x432e7d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3440('0x0'));var moment=require('moment');var BPromise=require(_0x3440('0x1'));var rp=require(_0x3440('0x2'));var fs=require('fs');var path=require(_0x3440('0x3'));var rimraf=require(_0x3440('0x4'));var config=require('../../config/environment');var attributes=require(_0x3440('0x5'));module['exports']=function(_0x5904cb,_0x1e5e8d){return _0x5904cb[_0x3440('0x6')](_0x3440('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3440('0x8'),'fields':['body'],'type':_0x3440('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x434496,_0x4559cd,_0x5bcb3e){var _0x215218=_0x5904cb[_0x3440('0xa')];var _0x41942e=_0x434496[_0x3440('0xb')]({'plain':!![]});if(_0x41942e[_0x3440('0xc')][_0x3440('0xd')]()==='in'||_0x41942e[_0x3440('0xc')]['toLowerCase']()===_0x3440('0xe')&&!_0x41942e[_0x3440('0xf')]&&!_[_0x3440('0x10')](_0x41942e['UserId'])){_0x215218[_0x3440('0x11')][_0x3440('0x12')]({'where':{'id':_0x41942e[_0x3440('0x13')]}})[_0x3440('0x14')](function(_0x26bfc4){if(_0x26bfc4){_0x26bfc4['update']({'lastMsgAt':_0x41942e[_0x3440('0x15')],'lastMsgDirection':_0x41942e['direction'][_0x3440('0xd')]()});}})[_0x3440('0x16')](function(_0x33a5bb){console[_0x3440('0x17')](_0x33a5bb);});}_0x5bcb3e();}},'charset':_0x3440('0x18'),'collate':_0x3440('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 1eb99c6..898f72d 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 _0xafea=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','defaults','localhost','redis','./chatMessage.socket','request'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xafea,0x1e0));var _0xaafe=function(_0x553c38,_0x5f53f4){_0x553c38=_0x553c38-0x0;var _0x5d8038=_0xafea[_0x553c38];return _0x5d8038;};'use strict';var _=require('lodash');var util=require(_0xaafe('0x0'));var moment=require(_0xaafe('0x1'));var BPromise=require(_0xaafe('0x2'));var rs=require(_0xaafe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafe('0x4'))['db'];var utils=require(_0xaafe('0x5'));var logger=require('../../config/logger')(_0xaafe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaafe('0x7')]['http']({'port':0x232a});config['redis']=_[_0xaafe('0x8')](config['redis'],{'host':_0xaafe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaafe('0xa')]));require(_0xaafe('0xb'))['register'](socket);function respondWithRpcPromise(_0x576b51,_0x3b0750,_0x497a78){return new BPromise(function(_0x3529cc,_0x1cf969){return client[_0xaafe('0xc')](_0x576b51,_0x497a78)['then'](function(_0x35d921){logger[_0xaafe('0xd')](_0xaafe('0xe'),_0x3b0750,_0xaafe('0xf'));logger[_0xaafe('0x10')](_0xaafe('0x11'),_0x3b0750,'request\x20sent',JSON[_0xaafe('0x12')](_0x35d921));if(_0x35d921[_0xaafe('0x13')]){if(_0x35d921[_0xaafe('0x13')]['code']===0x1f4){logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x1cf969(_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);}logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x3529cc(_0x35d921[_0xaafe('0x13')]['message']);}else{logger[_0xaafe('0xd')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,'request\x20sent');_0x3529cc(_0x35d921['result'][_0xaafe('0x14')]);}})[_0xaafe('0x15')](function(_0x58961f){logger[_0xaafe('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,_0x58961f);_0x1cf969(_0x58961f);});});}exports[_0xaafe('0x16')]=function(_0x43a6ea){var _0x226ef9=this;return new Promise(function(_0x4840c9,_0x506881){return db[_0xaafe('0x17')][_0xaafe('0x18')](_0x43a6ea[_0xaafe('0x19')],{'raw':_0x43a6ea['options']?_0x43a6ea[_0xaafe('0x1a')][_0xaafe('0x1b')]===undefined?!![]:![]:!![]})[_0xaafe('0x1c')](function(_0x3ce964){logger[_0xaafe('0xd')](_0xaafe('0x16'),_0x43a6ea);logger[_0xaafe('0x10')](_0xaafe('0x16'),_0x43a6ea,JSON[_0xaafe('0x12')](_0x3ce964));_0x4840c9(_0x3ce964);})[_0xaafe('0x15')](function(_0x48baf2){logger[_0xaafe('0x13')](_0xaafe('0x16'),_0x48baf2['message'],_0x43a6ea);_0x506881(_0x226ef9[_0xaafe('0x13')](0x1f4,_0x48baf2[_0xaafe('0x14')]));});});}; \ No newline at end of file +var _0x1e2f=['http','redis','defaults','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','body','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29ad68,_0x48953e){var _0x4ed4ca=function(_0x52aa22){while(--_0x52aa22){_0x29ad68['push'](_0x29ad68['shift']());}};_0x4ed4ca(++_0x48953e);}(_0x1e2f,0x1ee));var _0xf1e2=function(_0x313241,_0x204962){_0x313241=_0x313241-0x0;var _0x3b8844=_0x1e2f[_0x313241];return _0x3b8844;};'use strict';var _=require(_0xf1e2('0x0'));var util=require(_0xf1e2('0x1'));var moment=require(_0xf1e2('0x2'));var BPromise=require(_0xf1e2('0x3'));var rs=require(_0xf1e2('0x4'));var fs=require('fs');var Redis=require(_0xf1e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf1e2('0x6'))(_0xf1e2('0x7'));var config=require(_0xf1e2('0x8'));var jayson=require(_0xf1e2('0x9'));var client=jayson['client'][_0xf1e2('0xa')]({'port':0x232a});config[_0xf1e2('0xb')]=_[_0xf1e2('0xc')](config[_0xf1e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1e2('0xb')]));require(_0xf1e2('0xd'))[_0xf1e2('0xe')](socket);function respondWithRpcPromise(_0xdf3cec,_0x3da05b,_0x10f16d){return new BPromise(function(_0x255bdb,_0x4a3b2f){return client['request'](_0xdf3cec,_0x10f16d)[_0xf1e2('0xf')](function(_0x262138){logger[_0xf1e2('0x10')](_0xf1e2('0x11'),_0x3da05b,'request\x20sent');logger['debug'](_0xf1e2('0x12'),_0x3da05b,_0xf1e2('0x13'),JSON[_0xf1e2('0x14')](_0x262138));if(_0x262138['error']){if(_0x262138[_0xf1e2('0x15')]['code']===0x1f4){logger[_0xf1e2('0x15')]('ChatMessage,\x20%s,\x20%s',_0x3da05b,_0x262138[_0xf1e2('0x15')][_0xf1e2('0x16')]);return _0x4a3b2f(_0x262138[_0xf1e2('0x15')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3da05b,_0x262138[_0xf1e2('0x15')][_0xf1e2('0x16')]);return _0x255bdb(_0x262138[_0xf1e2('0x15')]['message']);}else{logger[_0xf1e2('0x10')](_0xf1e2('0x11'),_0x3da05b,_0xf1e2('0x13'));_0x255bdb(_0x262138[_0xf1e2('0x17')]['message']);}})[_0xf1e2('0x18')](function(_0x529017){logger[_0xf1e2('0x15')](_0xf1e2('0x11'),_0x3da05b,_0x529017);_0x4a3b2f(_0x529017);});});}exports[_0xf1e2('0x19')]=function(_0x150eb8){var _0x57d066=this;return new Promise(function(_0x4e97f9,_0x203d65){return db['ChatMessage']['create'](_0x150eb8[_0xf1e2('0x1a')],{'raw':_0x150eb8['options']?_0x150eb8['options']['raw']===undefined?!![]:![]:!![]})[_0xf1e2('0xf')](function(_0x2cbdba){logger[_0xf1e2('0x10')]('CreateChatMessage',_0x150eb8);logger[_0xf1e2('0x1b')]('CreateChatMessage',_0x150eb8,JSON[_0xf1e2('0x14')](_0x2cbdba));_0x4e97f9(_0x2cbdba);})['catch'](function(_0xae540f){logger[_0xf1e2('0x15')]('CreateChatMessage',_0xae540f[_0xf1e2('0x16')],_0x150eb8);_0x203d65(_0x57d066[_0xf1e2('0x15')](0x1f4,_0xae540f[_0xf1e2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 201ab52..fb75ba9 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 _0x0fda=['register','length','./chatMessage.events','remove','update','emit'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x92972,_0x2206b2){_0x92972=_0x92972-0x0;var _0x28a061=_0x0fda[_0x92972];return _0x28a061;};'use strict';var ChatMessageEvents=require(_0xa0fd('0x0'));var events=['save',_0xa0fd('0x1'),_0xa0fd('0x2')];function createListener(_0x314a1a,_0x2f71f3){return function(_0x426242){_0x2f71f3[_0xa0fd('0x3')](_0x314a1a,_0x426242);};}function removeListener(_0x13c734,_0x574fca){return function(){ChatMessageEvents['removeListener'](_0x13c734,_0x574fca);};}exports[_0xa0fd('0x4')]=function(_0x4aec58){for(var _0x49b3c1=0x0,_0x868183=events[_0xa0fd('0x5')];_0x49b3c1<_0x868183;_0x49b3c1++){var _0x1aab41=events[_0x49b3c1];var _0x248cca=createListener('chatMessage:'+_0x1aab41,_0x4aec58);ChatMessageEvents['on'](_0x1aab41,_0x248cca);}}; \ No newline at end of file +var _0x17c4=['save','remove','update','emit','removeListener','length','./chatMessage.events'];(function(_0x47ec06,_0x15e92b){var _0x87083e=function(_0x9446d){while(--_0x9446d){_0x47ec06['push'](_0x47ec06['shift']());}};_0x87083e(++_0x15e92b);}(_0x17c4,0x102));var _0x417c=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0x17c4[_0x4f66c2];return _0x447633;};'use strict';var ChatMessageEvents=require(_0x417c('0x0'));var events=[_0x417c('0x1'),_0x417c('0x2'),_0x417c('0x3')];function createListener(_0x2f1975,_0x2e9ccf){return function(_0x6579e5){_0x2e9ccf[_0x417c('0x4')](_0x2f1975,_0x6579e5);};}function removeListener(_0x212ac0,_0x413ee5){return function(){ChatMessageEvents[_0x417c('0x5')](_0x212ac0,_0x413ee5);};}exports['register']=function(_0x24e681){for(var _0x117c5d=0x0,_0x340095=events[_0x417c('0x6')];_0x117c5d<_0x340095;_0x117c5d++){var _0x1106df=events[_0x117c5d];var _0x4c6534=createListener('chatMessage:'+_0x1106df,_0x24e681);ChatMessageEvents['on'](_0x1106df,_0x4c6534);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 8b8af03..5db0038 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 _0xdb41=['accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xdb41,0x1e1));var _0x1db4=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0xdb41[_0x5b26cb];return _0x563d12;};'use strict';var multer=require('multer');var util=require(_0x1db4('0x0'));var path=require(_0x1db4('0x1'));var timeout=require(_0x1db4('0x2'));var express=require(_0x1db4('0x3'));var router=express['Router']();var fs_extra=require(_0x1db4('0x4'));var auth=require(_0x1db4('0x5'));var interaction=require(_0x1db4('0x6'));var config=require(_0x1db4('0x7'));var controller=require(_0x1db4('0x8'));router[_0x1db4('0x9')]('/',auth[_0x1db4('0xa')](),controller[_0x1db4('0xb')]);router['get'](_0x1db4('0xc'),auth['isAuthenticated'](),controller[_0x1db4('0xd')]);router[_0x1db4('0x9')](_0x1db4('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1db4('0xf')]('/',auth[_0x1db4('0xa')](),interaction[_0x1db4('0x10')](_0x1db4('0x11'),_0x1db4('0x12')),controller[_0x1db4('0x13')]);router[_0x1db4('0x14')](_0x1db4('0xe'),controller[_0x1db4('0x15')]);router[_0x1db4('0x14')](_0x1db4('0x16'),auth['isAuthenticated'](),controller[_0x1db4('0x17')]);router[_0x1db4('0x14')](_0x1db4('0x18'),auth[_0x1db4('0xa')](),controller['reject']);router[_0x1db4('0x19')](_0x1db4('0xe'),auth[_0x1db4('0xa')](),controller[_0x1db4('0x1a')]);module[_0x1db4('0x1b')]=router; \ No newline at end of file +var _0x905b=['/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x905b,0x1a4));var _0xb905=function(_0xf54692,_0x47f0f3){_0xf54692=_0xf54692-0x0;var _0x3ce89a=_0x905b[_0xf54692];return _0x3ce89a;};'use strict';var multer=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var path=require('path');var timeout=require(_0xb905('0x2'));var express=require(_0xb905('0x3'));var router=express[_0xb905('0x4')]();var fs_extra=require(_0xb905('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb905('0x6'));var config=require('../../config/environment');var controller=require(_0xb905('0x7'));router[_0xb905('0x8')]('/',auth['isAuthenticated'](),controller[_0xb905('0x9')]);router['get'](_0xb905('0xa'),auth[_0xb905('0xb')](),controller[_0xb905('0xc')]);router[_0xb905('0x8')](_0xb905('0xd'),auth['isAuthenticated'](),controller[_0xb905('0xe')]);router[_0xb905('0xf')]('/',auth[_0xb905('0xb')](),interaction['tracked']('chat',_0xb905('0x10')),controller[_0xb905('0x11')]);router[_0xb905('0x12')]('/:id',controller[_0xb905('0x13')]);router[_0xb905('0x12')](_0xb905('0x14'),auth[_0xb905('0xb')](),controller[_0xb905('0x15')]);router[_0xb905('0x12')](_0xb905('0x16'),auth[_0xb905('0xb')](),controller['reject']);router[_0xb905('0x17')](_0xb905('0xd'),auth['isAuthenticated'](),controller[_0xb905('0x18')]);module[_0xb905('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 065e853..289b137 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 _0x9c9a=['exports','medium'];(function(_0x2e1578,_0x102dbb){var _0x371a8e=function(_0x4ac106){while(--_0x4ac106){_0x2e1578['push'](_0x2e1578['shift']());}};_0x371a8e(++_0x102dbb);}(_0x9c9a,0xfa));var _0xa9c9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9c9a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xa9c9('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa9c9('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x7cdf=['sequelize','medium'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x7cdf,0x66));var _0xf7cd=function(_0x4e45d4,_0x3fbb93){_0x4e45d4=_0x4e45d4-0x0;var _0x20981a=_0x7cdf[_0x4e45d4];return _0x20981a;};'use strict';var Sequelize=require(_0xf7cd('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xf7cd('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index f7a1129..817b41b 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(_0x31c469,_0x391c91){var _0x3a2ac2=function(_0x5ee2bf){while(--_0x5ee2bf){_0x31c469['push'](_0x31c469['shift']());}};_0x3a2ac2(++_0x391c91);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a54,0x106));var _0x47a5=function(_0x906a,_0x15d9d6){_0x906a=_0x906a-0x0;var _0x3b3554=_0x7a54[_0x906a];return _0x3b3554;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 34c23bf..3747c37 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 _0x386a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x386a,0x1de));var _0xa386=function(_0x5ac24a,_0x135289){_0x5ac24a=_0x5ac24a-0x0;var _0x4e3896=_0x386a[_0x5ac24a];return _0x4e3896;};'use strict';var _=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var logger=require(_0xa386('0x2'))(_0xa386('0x3'));var moment=require('moment');var BPromise=require(_0xa386('0x4'));var rp=require(_0xa386('0x5'));var fs=require('fs');var path=require(_0xa386('0x6'));var rimraf=require(_0xa386('0x7'));var config=require('../../config/environment');var attributes=require(_0xa386('0x8'));module[_0xa386('0x9')]=function(_0x40c728,_0x4bdd33){return _0x40c728[_0xa386('0xa')](_0xa386('0xb'),attributes,{'tableName':_0xa386('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa386('0xd'),'collate':_0xa386('0xe')});}; \ No newline at end of file +var _0x29f1=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x29f1,0x91));var _0x129f=function(_0x3f0786,_0x39dc55){_0x3f0786=_0x3f0786-0x0;var _0x1c4e10=_0x29f1[_0x3f0786];return _0x1c4e10;};'use strict';var _=require(_0x129f('0x0'));var util=require(_0x129f('0x1'));var logger=require(_0x129f('0x2'))('api');var moment=require(_0x129f('0x3'));var BPromise=require(_0x129f('0x4'));var rp=require(_0x129f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x129f('0x6'));var config=require('../../config/environment');var attributes=require(_0x129f('0x7'));module[_0x129f('0x8')]=function(_0x268872,_0x459a63){return _0x268872['define'](_0x129f('0x9'),attributes,{'tableName':_0x129f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x129f('0xb'),'collate':_0x129f('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a5bd49b..3ab7ed4 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 _0x597b=['result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x597b,0xc7));var _0xb597=function(_0x1909a3,_0x106e97){_0x1909a3=_0x1909a3-0x0;var _0xab8ee8=_0x597b[_0x1909a3];return _0xab8ee8;};'use strict';var _=require('lodash');var util=require(_0xb597('0x0'));var moment=require(_0xb597('0x1'));var BPromise=require(_0xb597('0x2'));var rs=require(_0xb597('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb597('0x5'))(_0xb597('0x6'));var config=require(_0xb597('0x7'));var jayson=require(_0xb597('0x8'));var client=jayson[_0xb597('0x9')][_0xb597('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc48,_0x29ea54,_0x2a3d88){return new BPromise(function(_0x17310d,_0x5b5f33){return client[_0xb597('0xb')](_0x4bbc48,_0x2a3d88)[_0xb597('0xc')](function(_0x2b70cf){logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,'request\x20sent');logger[_0xb597('0xf')](_0xb597('0x10'),_0x29ea54,_0xb597('0x11'),JSON['stringify'](_0x2b70cf));if(_0x2b70cf[_0xb597('0x12')]){if(_0x2b70cf[_0xb597('0x12')][_0xb597('0x13')]===0x1f4){logger[_0xb597('0x12')](_0xb597('0xe'),_0x29ea54,_0x2b70cf['error']['message']);return _0x5b5f33(_0x2b70cf['error']['message']);}logger['error'](_0xb597('0xe'),_0x29ea54,_0x2b70cf[_0xb597('0x12')][_0xb597('0x14')]);return _0x17310d(_0x2b70cf[_0xb597('0x12')]['message']);}else{logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,_0xb597('0x11'));_0x17310d(_0x2b70cf[_0xb597('0x15')][_0xb597('0x14')]);}})['catch'](function(_0x3da474){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x29ea54,_0x3da474);_0x5b5f33(_0x3da474);});});} \ No newline at end of file +var _0x5544=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x5544,0x12e));var _0x4554=function(_0x105c0f,_0x1be1aa){_0x105c0f=_0x105c0f-0x0;var _0x8874e5=_0x5544[_0x105c0f];return _0x8874e5;};'use strict';var _=require(_0x4554('0x0'));var util=require(_0x4554('0x1'));var moment=require('moment');var BPromise=require(_0x4554('0x2'));var rs=require(_0x4554('0x3'));var fs=require('fs');var Redis=require(_0x4554('0x4'));var db=require(_0x4554('0x5'))['db'];var utils=require(_0x4554('0x6'));var logger=require(_0x4554('0x7'))('rpc');var config=require(_0x4554('0x8'));var jayson=require(_0x4554('0x9'));var client=jayson['client'][_0x4554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x182552,_0x200714,_0x2fefe3){return new BPromise(function(_0x16bf93,_0x5109d5){return client['request'](_0x182552,_0x2fefe3)['then'](function(_0x5dd660){logger[_0x4554('0xb')](_0x4554('0xc'),_0x200714,'request\x20sent');logger[_0x4554('0xd')](_0x4554('0xe'),_0x200714,'request\x20sent',JSON['stringify'](_0x5dd660));if(_0x5dd660[_0x4554('0xf')]){if(_0x5dd660['error'][_0x4554('0x10')]===0x1f4){logger[_0x4554('0xf')](_0x4554('0xc'),_0x200714,_0x5dd660[_0x4554('0xf')][_0x4554('0x11')]);return _0x5109d5(_0x5dd660[_0x4554('0xf')][_0x4554('0x11')]);}logger['error'](_0x4554('0xc'),_0x200714,_0x5dd660[_0x4554('0xf')]['message']);return _0x16bf93(_0x5dd660['error'][_0x4554('0x11')]);}else{logger[_0x4554('0xb')](_0x4554('0xc'),_0x200714,_0x4554('0x12'));_0x16bf93(_0x5dd660[_0x4554('0x13')][_0x4554('0x11')]);}})[_0x4554('0x14')](function(_0x4dd137){logger[_0x4554('0xf')](_0x4554('0xc'),_0x200714,_0x4dd137);_0x5109d5(_0x4dd137);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e4329da..f0e2669 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 _0x0dcd=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','describe','/:id','show','post','isAuthenticated','put','update'];(function(_0x4ad2f9,_0x51909b){var _0x2584bd=function(_0x22d7a3){while(--_0x22d7a3){_0x4ad2f9['push'](_0x4ad2f9['shift']());}};_0x2584bd(++_0x51909b);}(_0x0dcd,0xdb));var _0xd0dc=function(_0x4a0e2e,_0x34c3d0){_0x4a0e2e=_0x4a0e2e-0x0;var _0x26ed6c=_0x0dcd[_0x4a0e2e];return _0x26ed6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd0dc('0x0'));var timeout=require(_0xd0dc('0x1'));var express=require(_0xd0dc('0x2'));var router=express[_0xd0dc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0dc('0x4'));var config=require(_0xd0dc('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd0dc('0x6')]);router[_0xd0dc('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd0dc('0x8')]);router[_0xd0dc('0x7')](_0xd0dc('0x9'),auth['isAuthenticated'](),controller[_0xd0dc('0xa')]);router[_0xd0dc('0xb')]('/',auth[_0xd0dc('0xc')](),controller['create']);router[_0xd0dc('0xd')]('/:id',auth[_0xd0dc('0xc')](),controller[_0xd0dc('0xe')]);router[_0xd0dc('0xf')](_0xd0dc('0x9'),auth[_0xd0dc('0xc')](),controller[_0xd0dc('0x10')]);module[_0xd0dc('0x11')]=router; \ No newline at end of file +var _0xe8b1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3d34b6,_0xe3f695){var _0x647278=function(_0x245d17){while(--_0x245d17){_0x3d34b6['push'](_0x3d34b6['shift']());}};_0x647278(++_0xe3f695);}(_0xe8b1,0x1e0));var _0x1e8b=function(_0x14dfd6,_0x392fa4){_0x14dfd6=_0x14dfd6-0x0;var _0x36c19a=_0xe8b1[_0x14dfd6];return _0x36c19a;};'use strict';var multer=require('multer');var util=require(_0x1e8b('0x0'));var path=require(_0x1e8b('0x1'));var timeout=require(_0x1e8b('0x2'));var express=require('express');var router=express[_0x1e8b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1e8b('0x4'));var interaction=require(_0x1e8b('0x5'));var config=require(_0x1e8b('0x6'));var controller=require(_0x1e8b('0x7'));router['get']('/',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x9')]);router['get']('/describe',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xa')]);router[_0x1e8b('0xb')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xd')]);router[_0x1e8b('0xe')]('/',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xf')]);router[_0x1e8b('0x10')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x11')]);router[_0x1e8b('0x12')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x13')]);module[_0x1e8b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 06efdcf..056a8a0 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 _0x94d5=['INTEGER','exports','STRING','timeout','mouseOver'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0x94d5,0x1d2));var _0x594d=function(_0x3ddffc,_0x2ffe2c){_0x3ddffc=_0x3ddffc-0x0;var _0x462170=_0x94d5[_0x3ddffc];return _0x462170;};'use strict';var Sequelize=require('sequelize');module[_0x594d('0x0')]={'name':{'type':Sequelize[_0x594d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x594d('0x2')),'defaultValue':_0x594d('0x3')},'selector':{'type':Sequelize[_0x594d('0x1')]},'timeout':{'type':Sequelize[_0x594d('0x4')]}}; \ No newline at end of file +var _0xa8e2=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x5ccb8c,_0x43f4b2){var _0x3b887b=function(_0x4d7164){while(--_0x4d7164){_0x5ccb8c['push'](_0x5ccb8c['shift']());}};_0x3b887b(++_0x43f4b2);}(_0xa8e2,0x18a));var _0x2a8e=function(_0x1266c0,_0x3ddae1){_0x1266c0=_0x1266c0-0x0;var _0x49bc60=_0xa8e2[_0x1266c0];return _0x49bc60;};'use strict';var Sequelize=require(_0x2a8e('0x0'));module[_0x2a8e('0x1')]={'name':{'type':Sequelize[_0x2a8e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2a8e('0x3')](_0x2a8e('0x4'),_0x2a8e('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2a8e('0x2')]},'timeout':{'type':Sequelize[_0x2a8e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index e76f147..1ce407f 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 _0xc18a=['rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0xc18a,0x1cf));var _0xac18=function(_0x4568d1,_0xfcd25a){_0x4568d1=_0x4568d1-0x0;var _0x2e9cf5=_0xc18a[_0x4568d1];return _0x2e9cf5;};'use strict';var emlformat=require(_0xac18('0x0'));var rimraf=require(_0xac18('0x1'));var zipdir=require(_0xac18('0x2'));var jsonpatch=require(_0xac18('0x3'));var rp=require('request-promise');var moment=require(_0xac18('0x4'));var BPromise=require(_0xac18('0x5'));var Mustache=require(_0xac18('0x6'));var util=require(_0xac18('0x7'));var path=require(_0xac18('0x8'));var sox=require(_0xac18('0x9'));var csv=require(_0xac18('0xa'));var ejs=require(_0xac18('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac18('0xc'));var squel=require(_0xac18('0xd'));var crypto=require(_0xac18('0xe'));var jsforce=require(_0xac18('0xf'));var deskjs=require(_0xac18('0x10'));var toCsv=require(_0xac18('0xa'));var querystring=require(_0xac18('0x11'));var Papa=require(_0xac18('0x12'));var Redis=require(_0xac18('0x13'));var authService=require(_0xac18('0x14'));var qs=require(_0xac18('0x15'));var as=require(_0xac18('0x16'));var hardwareService=require(_0xac18('0x17'));var logger=require(_0xac18('0x18'))('api');var utils=require(_0xac18('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xac18('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x567d8d,_0x215482){_0x215482=_0x215482||0xcc;return function(_0x53b975){if(_0x53b975){return _0x567d8d['sendStatus'](_0x215482);}return _0x567d8d[_0xac18('0x1b')](_0x215482)[_0xac18('0x1c')]();};}function respondWithResult(_0x4a7219,_0x1e6150){_0x1e6150=_0x1e6150||0xc8;return function(_0x33eb5a){if(_0x33eb5a){return _0x4a7219['status'](_0x1e6150)[_0xac18('0x1d')](_0x33eb5a);}};}function respondWithFilteredResult(_0x518187,_0x362b31){return function(_0x550438){if(_0x550438){var _0x4a747c=typeof _0x362b31[_0xac18('0x1e')]===_0xac18('0x1f')&&typeof _0x362b31['limit']==='undefined';var _0x436009=_0x550438[_0xac18('0x20')];var _0x506819=_0x4a747c?0x0:_0x362b31[_0xac18('0x1e')];var _0x98b7d3=_0x4a747c?_0x550438[_0xac18('0x20')]:_0x362b31[_0xac18('0x1e')]+_0x362b31[_0xac18('0x21')];var _0x3666d0;if(_0x98b7d3>=_0x436009){_0x98b7d3=_0x436009;_0x3666d0=0xc8;}else{_0x3666d0=0xce;}_0x518187[_0xac18('0x1b')](_0x3666d0);return _0x518187['set'](_0xac18('0x22'),_0x506819+'-'+_0x98b7d3+'/'+_0x436009)[_0xac18('0x1d')](_0x550438);}return null;};}function patchUpdates(_0x3f6498){return function(_0xbcd5fd){try{jsonpatch[_0xac18('0x23')](_0xbcd5fd,_0x3f6498,!![]);}catch(_0x4a55c0){return BPromise[_0xac18('0x24')](_0x4a55c0);}return _0xbcd5fd[_0xac18('0x25')]();};}function saveUpdates(_0x3924a7,_0x147a03){return function(_0x4f2f18){if(_0x4f2f18){return _0x4f2f18[_0xac18('0x26')](_0x3924a7)[_0xac18('0x27')](function(_0x2c10f3){return _0x2c10f3;});}return null;};}function removeEntity(_0x2c5b19,_0x20d639){return function(_0x204a05){if(_0x204a05){return _0x204a05['destroy']()[_0xac18('0x27')](function(){_0x2c5b19[_0xac18('0x1b')](0xcc)[_0xac18('0x1c')]();});}};}function handleEntityNotFound(_0x53fd81,_0x2d2f69){return function(_0x302b23){if(!_0x302b23){_0x53fd81[_0xac18('0x28')](0x194);}return _0x302b23;};}function handleError(_0x39086e,_0x3e3202){_0x3e3202=_0x3e3202||0x1f4;return function(_0x1aae67){logger[_0xac18('0x29')](_0x1aae67[_0xac18('0x2a')]);if(_0x1aae67['name']){delete _0x1aae67[_0xac18('0x2b')];}_0x39086e[_0xac18('0x1b')](_0x3e3202)['send'](_0x1aae67);};}exports[_0xac18('0x2c')]=function(_0x65f692,_0x14d74a){var _0x2d1492={'raw':!![],'where':{'id':_0x65f692[_0xac18('0x2d')]['id']}},_0xb710bb={};_0xb710bb[_0xac18('0x2e')]=_[_0xac18('0x2f')](db[_0xac18('0x30')][_0xac18('0x31')]);_0xb710bb[_0xac18('0x32')]=_['keys'](_0x65f692['query']);_0xb710bb[_0xac18('0x33')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],_0xb710bb['query']);_0x2d1492[_0xac18('0x35')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],qs[_0xac18('0x36')](_0x65f692[_0xac18('0x32')]['fields']));_0x2d1492[_0xac18('0x35')]=_0x2d1492[_0xac18('0x35')]['length']?_0x2d1492[_0xac18('0x35')]:_0xb710bb[_0xac18('0x2e')];if(_0x65f692['query'][_0xac18('0x37')]){_0x2d1492[_0xac18('0x38')]=[{'all':!![]}];}_0x2d1492=_[_0xac18('0x39')]({},_0x2d1492,_0x65f692[_0xac18('0x3a')]);return db[_0xac18('0x30')][_0xac18('0x3b')](_0x2d1492)[_0xac18('0x27')](handleEntityNotFound(_0x14d74a,null))[_0xac18('0x27')](respondWithResult(_0x14d74a,null))[_0xac18('0x3c')](handleError(_0x14d74a,null));};exports['create']=function(_0x38b847,_0x3c318c){return db[_0xac18('0x30')][_0xac18('0x3d')](_0x38b847[_0xac18('0x3e')],{})[_0xac18('0x27')](respondWithResult(_0x3c318c,0xc9))[_0xac18('0x3c')](handleError(_0x3c318c,null));};exports[_0xac18('0x26')]=function(_0x2404de,_0x678f26){if(_0x2404de['body']['id']){delete _0x2404de['body']['id'];}return db[_0xac18('0x30')][_0xac18('0x3b')]({'where':{'id':_0x2404de['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x678f26,null))['then'](saveUpdates(_0x2404de[_0xac18('0x3e')],null))['then'](respondWithResult(_0x678f26,null))[_0xac18('0x3c')](handleError(_0x678f26,null));};exports[_0xac18('0x3f')]=function(_0x5d1721,_0x4ed58d){return db['ChatProactiveAction']['find']({'where':{'id':_0x5d1721['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x4ed58d,null))['then'](removeEntity(_0x4ed58d,null))[_0xac18('0x3c')](handleError(_0x4ed58d,null));}; \ No newline at end of file +var _0xdbd0=['destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','query','intersection','attributes','fields','length','includeAll','include','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','status','end','json','offset','undefined','count','limit','Content-Range','reject','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdbd0,0x88));var _0x0dbd=function(_0x4bf005,_0x43bc98){_0x4bf005=_0x4bf005-0x0;var _0x552e25=_0xdbd0[_0x4bf005];return _0x552e25;};'use strict';var emlformat=require(_0x0dbd('0x0'));var rimraf=require(_0x0dbd('0x1'));var zipdir=require(_0x0dbd('0x2'));var jsonpatch=require(_0x0dbd('0x3'));var rp=require(_0x0dbd('0x4'));var moment=require('moment');var BPromise=require(_0x0dbd('0x5'));var Mustache=require(_0x0dbd('0x6'));var util=require(_0x0dbd('0x7'));var path=require('path');var sox=require(_0x0dbd('0x8'));var csv=require(_0x0dbd('0x9'));var ejs=require(_0x0dbd('0xa'));var fs=require('fs');var fs_extra=require(_0x0dbd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0dbd('0xc'));var jsforce=require(_0x0dbd('0xd'));var deskjs=require(_0x0dbd('0xe'));var toCsv=require(_0x0dbd('0x9'));var querystring=require(_0x0dbd('0xf'));var Papa=require(_0x0dbd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0dbd('0x11'));var as=require(_0x0dbd('0x12'));var hardwareService=require(_0x0dbd('0x13'));var logger=require(_0x0dbd('0x14'))(_0x0dbd('0x15'));var utils=require(_0x0dbd('0x16'));var config=require(_0x0dbd('0x17'));var licenseUtil=require(_0x0dbd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c12f3,_0x6b2b5){_0x6b2b5=_0x6b2b5||0xcc;return function(_0xbeeb88){if(_0xbeeb88){return _0x1c12f3['sendStatus'](_0x6b2b5);}return _0x1c12f3[_0x0dbd('0x19')](_0x6b2b5)[_0x0dbd('0x1a')]();};}function respondWithResult(_0x1a45d0,_0x903a5){_0x903a5=_0x903a5||0xc8;return function(_0x19192d){if(_0x19192d){return _0x1a45d0[_0x0dbd('0x19')](_0x903a5)[_0x0dbd('0x1b')](_0x19192d);}};}function respondWithFilteredResult(_0xce4a93,_0x1b9134){return function(_0x513a76){if(_0x513a76){var _0x5714f8=typeof _0x1b9134[_0x0dbd('0x1c')]===_0x0dbd('0x1d')&&typeof _0x1b9134['limit']===_0x0dbd('0x1d');var _0x16ae44=_0x513a76['count'];var _0x500fc6=_0x5714f8?0x0:_0x1b9134[_0x0dbd('0x1c')];var _0x23db13=_0x5714f8?_0x513a76[_0x0dbd('0x1e')]:_0x1b9134['offset']+_0x1b9134[_0x0dbd('0x1f')];var _0x2a26dd;if(_0x23db13>=_0x16ae44){_0x23db13=_0x16ae44;_0x2a26dd=0xc8;}else{_0x2a26dd=0xce;}_0xce4a93['status'](_0x2a26dd);return _0xce4a93['set'](_0x0dbd('0x20'),_0x500fc6+'-'+_0x23db13+'/'+_0x16ae44)[_0x0dbd('0x1b')](_0x513a76);}return null;};}function patchUpdates(_0x3b9fc6){return function(_0x50866a){try{jsonpatch['apply'](_0x50866a,_0x3b9fc6,!![]);}catch(_0x1f31a8){return BPromise[_0x0dbd('0x21')](_0x1f31a8);}return _0x50866a['save']();};}function saveUpdates(_0x5bea28,_0x3d821a){return function(_0x425ceb){if(_0x425ceb){return _0x425ceb['update'](_0x5bea28)[_0x0dbd('0x22')](function(_0x13fb7e){return _0x13fb7e;});}return null;};}function removeEntity(_0x18edd1,_0x524a84){return function(_0x16a21c){if(_0x16a21c){return _0x16a21c[_0x0dbd('0x23')]()['then'](function(){_0x18edd1[_0x0dbd('0x19')](0xcc)[_0x0dbd('0x1a')]();});}};}function handleEntityNotFound(_0x563185,_0x265ee1){return function(_0x3491aa){if(!_0x3491aa){_0x563185['sendStatus'](0x194);}return _0x3491aa;};}function handleError(_0xb910f2,_0x13c4e1){_0x13c4e1=_0x13c4e1||0x1f4;return function(_0x66a345){logger[_0x0dbd('0x24')](_0x66a345[_0x0dbd('0x25')]);if(_0x66a345[_0x0dbd('0x26')]){delete _0x66a345['name'];}_0xb910f2['status'](_0x13c4e1)['send'](_0x66a345);};}exports[_0x0dbd('0x27')]=function(_0x5c6d5e,_0x228fc6){var _0x518cff={'raw':!![],'where':{'id':_0x5c6d5e[_0x0dbd('0x28')]['id']}},_0x57fd18={};_0x57fd18[_0x0dbd('0x29')]=_[_0x0dbd('0x2a')](db[_0x0dbd('0x2b')]['rawAttributes']);_0x57fd18[_0x0dbd('0x2c')]=_[_0x0dbd('0x2a')](_0x5c6d5e[_0x0dbd('0x2c')]);_0x57fd18['filters']=_[_0x0dbd('0x2d')](_0x57fd18[_0x0dbd('0x29')],_0x57fd18[_0x0dbd('0x2c')]);_0x518cff[_0x0dbd('0x2e')]=_['intersection'](_0x57fd18[_0x0dbd('0x29')],qs[_0x0dbd('0x2f')](_0x5c6d5e[_0x0dbd('0x2c')][_0x0dbd('0x2f')]));_0x518cff['attributes']=_0x518cff[_0x0dbd('0x2e')][_0x0dbd('0x30')]?_0x518cff[_0x0dbd('0x2e')]:_0x57fd18['model'];if(_0x5c6d5e[_0x0dbd('0x2c')][_0x0dbd('0x31')]){_0x518cff[_0x0dbd('0x32')]=[{'all':!![]}];}_0x518cff=_['merge']({},_0x518cff,_0x5c6d5e[_0x0dbd('0x33')]);return db['ChatProactiveAction'][_0x0dbd('0x34')](_0x518cff)['then'](handleEntityNotFound(_0x228fc6,null))['then'](respondWithResult(_0x228fc6,null))['catch'](handleError(_0x228fc6,null));};exports['create']=function(_0x15a6e9,_0x4a1c17){return db['ChatProactiveAction'][_0x0dbd('0x35')](_0x15a6e9[_0x0dbd('0x36')],{})['then'](respondWithResult(_0x4a1c17,0xc9))[_0x0dbd('0x37')](handleError(_0x4a1c17,null));};exports[_0x0dbd('0x38')]=function(_0x219021,_0x59e81c){if(_0x219021['body']['id']){delete _0x219021['body']['id'];}return db[_0x0dbd('0x2b')]['find']({'where':{'id':_0x219021['params']['id']}})[_0x0dbd('0x22')](handleEntityNotFound(_0x59e81c,null))['then'](saveUpdates(_0x219021[_0x0dbd('0x36')],null))[_0x0dbd('0x22')](respondWithResult(_0x59e81c,null))[_0x0dbd('0x37')](handleError(_0x59e81c,null));};exports[_0x0dbd('0x23')]=function(_0x28f86d,_0x1e52b7){return db[_0x0dbd('0x2b')][_0x0dbd('0x34')]({'where':{'id':_0x28f86d[_0x0dbd('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e52b7,null))[_0x0dbd('0x22')](removeEntity(_0x1e52b7,null))[_0x0dbd('0x37')](handleError(_0x1e52b7,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b69c28d..476d0a5 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 _0x1180=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3cc68e,_0x5a4b48){var _0x46e345=function(_0x335150){while(--_0x335150){_0x3cc68e['push'](_0x3cc68e['shift']());}};_0x46e345(++_0x5a4b48);}(_0x1180,0xce));var _0x0118=function(_0x35548f,_0x4ad849){_0x35548f=_0x35548f-0x0;var _0x10b877=_0x1180[_0x35548f];return _0x10b877;};'use strict';var _=require(_0x0118('0x0'));var util=require(_0x0118('0x1'));var logger=require(_0x0118('0x2'))(_0x0118('0x3'));var moment=require(_0x0118('0x4'));var BPromise=require(_0x0118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0118('0x6'));var config=require(_0x0118('0x7'));var attributes=require(_0x0118('0x8'));module[_0x0118('0x9')]=function(_0x1eb888,_0x97cf21){return _0x1eb888['define'](_0x0118('0xa'),attributes,{'tableName':_0x0118('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x796e=['rimraf','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','bluebird','path'];(function(_0x8d489e,_0x5b9406){var _0x57a5a4=function(_0x3e388c){while(--_0x3e388c){_0x8d489e['push'](_0x8d489e['shift']());}};_0x57a5a4(++_0x5b9406);}(_0x796e,0x188));var _0xe796=function(_0x36a71e,_0x25aeec){_0x36a71e=_0x36a71e-0x0;var _0x5703b4=_0x796e[_0x36a71e];return _0x5703b4;};'use strict';var _=require(_0xe796('0x0'));var util=require(_0xe796('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe796('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe796('0x3'));var rimraf=require(_0xe796('0x4'));var config=require(_0xe796('0x5'));var attributes=require(_0xe796('0x6'));module['exports']=function(_0x37b969,_0x370d13){return _0x37b969['define'](_0xe796('0x7'),attributes,{'tableName':_0xe796('0x8'),'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 ad66a8f..1b9e26e 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 _0xd3e8=['rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','bluebird','../../config/utils','../../config/logger'];(function(_0xf177dd,_0x51fc3d){var _0x3a6a54=function(_0x15b7c5){while(--_0x15b7c5){_0xf177dd['push'](_0xf177dd['shift']());}};_0x3a6a54(++_0x51fc3d);}(_0xd3e8,0x95));var _0x8d3e=function(_0x10f154,_0x12cf31){_0x10f154=_0x10f154-0x0;var _0xa58978=_0xd3e8[_0x10f154];return _0xa58978;};'use strict';var _=require(_0x8d3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8d3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d3e('0x2'));var logger=require(_0x8d3e('0x3'))(_0x8d3e('0x4'));var config=require(_0x8d3e('0x5'));var jayson=require(_0x8d3e('0x6'));var client=jayson['client'][_0x8d3e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x152da3,_0xd212b1,_0x210b12){return new BPromise(function(_0x3dc26d,_0x165fef){return client['request'](_0x152da3,_0x210b12)[_0x8d3e('0x8')](function(_0x537691){logger[_0x8d3e('0x9')](_0x8d3e('0xa'),_0xd212b1,'request\x20sent');logger['debug'](_0x8d3e('0xb'),_0xd212b1,'request\x20sent',JSON['stringify'](_0x537691));if(_0x537691[_0x8d3e('0xc')]){if(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xd')]===0x1f4){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x537691[_0x8d3e('0xc')]['message']);return _0x165fef(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0xd212b1,_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);return _0x3dc26d(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}else{logger['info'](_0x8d3e('0xa'),_0xd212b1,_0x8d3e('0xf'));_0x3dc26d(_0x537691[_0x8d3e('0x10')]['message']);}})['catch'](function(_0x117100){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x117100);_0x165fef(_0x117100);});});} \ No newline at end of file +var _0x2910=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis'];(function(_0x260f77,_0x9eb655){var _0x118ef2=function(_0x271fe5){while(--_0x271fe5){_0x260f77['push'](_0x260f77['shift']());}};_0x118ef2(++_0x9eb655);}(_0x2910,0x11d));var _0x0291=function(_0x4ebf6a,_0xfd0a40){_0x4ebf6a=_0x4ebf6a-0x0;var _0x1e7a72=_0x2910[_0x4ebf6a];return _0x1e7a72;};'use strict';var _=require(_0x0291('0x0'));var util=require(_0x0291('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0291('0x2'));var fs=require('fs');var Redis=require(_0x0291('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0291('0x4')][_0x0291('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x470e18,_0x368c7a,_0x534d90){return new BPromise(function(_0x2dc8a6,_0x29c658){return client[_0x0291('0x6')](_0x470e18,_0x534d90)[_0x0291('0x7')](function(_0x5e1f5c){logger[_0x0291('0x8')](_0x0291('0x9'),_0x368c7a,_0x0291('0xa'));logger[_0x0291('0xb')](_0x0291('0xc'),_0x368c7a,_0x0291('0xa'),JSON['stringify'](_0x5e1f5c));if(_0x5e1f5c[_0x0291('0xd')]){if(_0x5e1f5c[_0x0291('0xd')][_0x0291('0xe')]===0x1f4){logger[_0x0291('0xd')](_0x0291('0x9'),_0x368c7a,_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);return _0x29c658(_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x368c7a,_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);return _0x2dc8a6(_0x5e1f5c['error'][_0x0291('0xf')]);}else{logger['info'](_0x0291('0x9'),_0x368c7a,_0x0291('0xa'));_0x2dc8a6(_0x5e1f5c[_0x0291('0x10')]['message']);}})['catch'](function(_0x39f7d2){logger[_0x0291('0xd')](_0x0291('0x9'),_0x368c7a,_0x39f7d2);_0x29c658(_0x39f7d2);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 3231e4c..faaeac7 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x7da7,0x10d));var _0x77da=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x7da7[_0x21353c];return _0xa99120;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router; \ No newline at end of file +var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2eb2[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);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 dca0c43..33e079e 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 _0x7187=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x505642,_0xdbee26){var _0x541223=function(_0x3d06dd){while(--_0x3d06dd){_0x505642['push'](_0x505642['shift']());}};_0x541223(++_0xdbee26);}(_0x7187,0x88));var _0x7718=function(_0x5a3a55,_0x11e0ce){_0x5a3a55=_0x5a3a55-0x0;var _0x1ce4da=_0x7187[_0x5a3a55];return _0x1ce4da;};'use strict';var Sequelize=require(_0x7718('0x0'));module[_0x7718('0x1')]={'name':{'type':Sequelize[_0x7718('0x2')],'unique':_0x7718('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7718('0x2')]},'timeout':{'type':Sequelize[_0x7718('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7718('0x5')](_0x7718('0x6'),_0x7718('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x14a0=['STRING','name','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0xf78acc,_0x499293){var _0x51c677=function(_0x193a19){while(--_0x193a19){_0xf78acc['push'](_0xf78acc['shift']());}};_0x51c677(++_0x499293);}(_0x14a0,0x172));var _0x014a=function(_0x3a663d,_0x561dbf){_0x3a663d=_0x3a663d-0x0;var _0x1b742a=_0x14a0[_0x3a663d];return _0x1b742a;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')],'unique':_0x014a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x014a('0x1')]},'timeout':{'type':Sequelize[_0x014a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x014a('0x4')](_0x014a('0x5'),_0x014a('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index eb0388e..e67198e 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 _0x4c35=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c35,0x86));var _0x54c3=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x4c35[_0x7185f7];return _0x182e45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54c3('0x1'));var rp=require('request-promise');var moment=require(_0x54c3('0x2'));var BPromise=require(_0x54c3('0x3'));var Mustache=require(_0x54c3('0x4'));var util=require(_0x54c3('0x5'));var path=require(_0x54c3('0x6'));var sox=require(_0x54c3('0x7'));var csv=require(_0x54c3('0x8'));var ejs=require(_0x54c3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54c3('0xa'));var squel=require('squel');var crypto=require(_0x54c3('0xb'));var jsforce=require(_0x54c3('0xc'));var deskjs=require(_0x54c3('0xd'));var toCsv=require(_0x54c3('0x8'));var querystring=require(_0x54c3('0xe'));var Papa=require('papaparse');var Redis=require(_0x54c3('0xf'));var authService=require(_0x54c3('0x10'));var qs=require(_0x54c3('0x11'));var as=require(_0x54c3('0x12'));var hardwareService=require(_0x54c3('0x13'));var logger=require(_0x54c3('0x14'))(_0x54c3('0x15'));var utils=require('../../config/utils');var config=require(_0x54c3('0x16'));var licenseUtil=require(_0x54c3('0x17'));var db=require(_0x54c3('0x18'))['db'];config[_0x54c3('0x19')]=_[_0x54c3('0x1a')](config[_0x54c3('0x19')],{'host':_0x54c3('0x1b'),'port':0x18eb});var socket=require(_0x54c3('0x1c'))(new Redis(config[_0x54c3('0x19')]));require(_0x54c3('0x1d'))['register'](socket);var jayson=require(_0x54c3('0x1e'));var client=jayson[_0x54c3('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183454,_0x3a1334,_0xf5d99f,_0x17ec0b){return new BPromise(function(_0x1b1bc0,_0x2e4833){var _0x1ee2c6=_0x17ec0b||client;return _0x1ee2c6[_0x54c3('0x20')](_0x183454,_0xf5d99f)['then'](function(_0x2b8e07){logger['info'](_0x54c3('0x21'),_0x3a1334,'request\x20sent');logger[_0x54c3('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3a1334,'request\x20sent',JSON[_0x54c3('0x23')](_0x2b8e07));if(_0x2b8e07[_0x54c3('0x24')]){if(_0x2b8e07['error'][_0x54c3('0x25')]===0x1f4){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')]['message']);return _0x2e4833(_0x2b8e07['error'][_0x54c3('0x26')]);}logger['error'](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);return _0x1b1bc0(_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);}else{logger[_0x54c3('0x27')](_0x54c3('0x21'),_0x3a1334,_0x54c3('0x28'));_0x1b1bc0(_0x2b8e07[_0x54c3('0x29')][_0x54c3('0x26')]);}})[_0x54c3('0x2a')](function(_0x2a556e){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2a556e);_0x2e4833(_0x2a556e);});});}function respondWithStatusCode(_0x4918e9,_0x3f43c2){_0x3f43c2=_0x3f43c2||0xcc;return function(_0x128eb6){if(_0x128eb6){return _0x4918e9[_0x54c3('0x2b')](_0x3f43c2);}return _0x4918e9[_0x54c3('0x2c')](_0x3f43c2)[_0x54c3('0x2d')]();};}function respondWithResult(_0x217226,_0x2bbec9){_0x2bbec9=_0x2bbec9||0xc8;return function(_0x188993){if(_0x188993){return _0x217226[_0x54c3('0x2c')](_0x2bbec9)[_0x54c3('0x2e')](_0x188993);}};}function respondWithFilteredResult(_0x16b310,_0xfa7714){return function(_0x3cecc4){if(_0x3cecc4){var _0x6c24e7=typeof _0xfa7714[_0x54c3('0x2f')]===_0x54c3('0x30')&&typeof _0xfa7714[_0x54c3('0x31')]===_0x54c3('0x30');var _0x371e04=_0x3cecc4[_0x54c3('0x32')];var _0x2f4252=_0x6c24e7?0x0:_0xfa7714['offset'];var _0x51bffb=_0x6c24e7?_0x3cecc4[_0x54c3('0x32')]:_0xfa7714['offset']+_0xfa7714[_0x54c3('0x31')];var _0x4febda;if(_0x51bffb>=_0x371e04){_0x51bffb=_0x371e04;_0x4febda=0xc8;}else{_0x4febda=0xce;}_0x16b310[_0x54c3('0x2c')](_0x4febda);return _0x16b310['set'](_0x54c3('0x33'),_0x2f4252+'-'+_0x51bffb+'/'+_0x371e04)[_0x54c3('0x2e')](_0x3cecc4);}return null;};}function patchUpdates(_0x343e2d){return function(_0x1fc2aa){try{jsonpatch['apply'](_0x1fc2aa,_0x343e2d,!![]);}catch(_0x5e7855){return BPromise[_0x54c3('0x34')](_0x5e7855);}return _0x1fc2aa[_0x54c3('0x35')]();};}function saveUpdates(_0x31b918,_0x2605f6){return function(_0x1e05f7){if(_0x1e05f7){return _0x1e05f7[_0x54c3('0x36')](_0x31b918)[_0x54c3('0x37')](function(_0x3c05e6){return _0x3c05e6;});}return null;};}function removeEntity(_0x52d548,_0x420b18){return function(_0x17a716){if(_0x17a716){return _0x17a716[_0x54c3('0x38')]()[_0x54c3('0x37')](function(){var _0x38be6d=_0x17a716[_0x54c3('0x39')]({'plain':!![]});var _0x4f382b=_0x54c3('0x3a');return db[_0x54c3('0x3b')][_0x54c3('0x38')]({'where':{'type':_0x4f382b,'resourceId':_0x38be6d['id']}})['then'](function(){return _0x17a716;});})[_0x54c3('0x37')](function(){_0x52d548['status'](0xcc)[_0x54c3('0x2d')]();});}};}function handleEntityNotFound(_0x4b5999,_0x3329f9){return function(_0x14555d){if(!_0x14555d){_0x4b5999[_0x54c3('0x2b')](0x194);}return _0x14555d;};}function handleError(_0x3e95db,_0x24e965){_0x24e965=_0x24e965||0x1f4;return function(_0x2dc5f8){logger[_0x54c3('0x24')](_0x2dc5f8[_0x54c3('0x3c')]);if(_0x2dc5f8['name']){delete _0x2dc5f8[_0x54c3('0x3d')];}_0x3e95db[_0x54c3('0x2c')](_0x24e965)[_0x54c3('0x3e')](_0x2dc5f8);};}exports[_0x54c3('0x3f')]=function(_0x12dd6a,_0x376d03){var _0x41b9e2={},_0x29d1c4={},_0x2b441e={'count':0x0,'rows':[]};var _0x477be8=_['map'](db[_0x54c3('0x40')][_0x54c3('0x41')],function(_0x348709){return{'name':_0x348709[_0x54c3('0x42')],'type':_0x348709[_0x54c3('0x43')][_0x54c3('0x44')]};});_0x29d1c4[_0x54c3('0x45')]=_[_0x54c3('0x46')](_0x477be8,_0x54c3('0x3d'));_0x29d1c4['query']=_['keys'](_0x12dd6a['query']);_0x29d1c4[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x29d1c4['model'],_0x29d1c4[_0x54c3('0x49')]);_0x41b9e2[_0x54c3('0x4a')]=_['intersection'](_0x29d1c4[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x12dd6a['query'][_0x54c3('0x4b')]));_0x41b9e2[_0x54c3('0x4a')]=_0x41b9e2[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x41b9e2[_0x54c3('0x4a')]:_0x29d1c4['model'];if(!_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x4d')]('nolimit')){_0x41b9e2['limit']=qs[_0x54c3('0x31')](_0x12dd6a[_0x54c3('0x49')]['limit']);_0x41b9e2[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x41b9e2['order']=qs[_0x54c3('0x4e')](_0x12dd6a['query'][_0x54c3('0x4e')]);_0x41b9e2[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x12dd6a[_0x54c3('0x49')],_0x29d1c4[_0x54c3('0x47')]),_0x477be8);if(_0x12dd6a['query'][_0x54c3('0x51')]){_0x41b9e2['where']=_[_0x54c3('0x52')](_0x41b9e2[_0x54c3('0x4f')],{'$or':_['map'](_0x477be8,function(_0x13331c){if(_0x13331c[_0x54c3('0x43')]!==_0x54c3('0x53')){var _0x37078b={};_0x37078b[_0x13331c[_0x54c3('0x3d')]]={'$like':'%'+_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x37078b;}})});}_0x41b9e2=_[_0x54c3('0x52')]({},_0x41b9e2,_0x12dd6a[_0x54c3('0x54')]);var _0x183878={'where':_0x41b9e2[_0x54c3('0x4f')]};return db['ChatQueue'][_0x54c3('0x32')](_0x183878)[_0x54c3('0x37')](function(_0x5172c8){_0x2b441e[_0x54c3('0x32')]=_0x5172c8;if(_0x12dd6a[_0x54c3('0x49')]['includeAll']){_0x41b9e2['include']=[{'all':!![]}];}return db[_0x54c3('0x40')][_0x54c3('0x55')](_0x41b9e2);})[_0x54c3('0x37')](function(_0x2517b9){_0x2b441e[_0x54c3('0x56')]=_0x2517b9;return _0x2b441e;})[_0x54c3('0x37')](respondWithFilteredResult(_0x376d03,_0x41b9e2))[_0x54c3('0x2a')](handleError(_0x376d03,null));};exports[_0x54c3('0x57')]=function(_0x2f2793,_0x4e84d0){var _0x128618={'raw':!![],'where':{'id':_0x2f2793[_0x54c3('0x58')]['id']}},_0x4ffbc1={};_0x4ffbc1['model']=_['keys'](db['ChatQueue'][_0x54c3('0x41')]);_0x4ffbc1['query']=_[_0x54c3('0x59')](_0x2f2793[_0x54c3('0x49')]);_0x4ffbc1[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],_0x4ffbc1[_0x54c3('0x49')]);_0x128618[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],qs['fields'](_0x2f2793[_0x54c3('0x49')][_0x54c3('0x4b')]));_0x128618[_0x54c3('0x4a')]=_0x128618[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x128618['attributes']:_0x4ffbc1[_0x54c3('0x45')];if(_0x2f2793['query']['includeAll']){_0x128618[_0x54c3('0x5a')]=[{'all':!![]}];}_0x128618=_[_0x54c3('0x52')]({},_0x128618,_0x2f2793[_0x54c3('0x54')]);return db[_0x54c3('0x40')][_0x54c3('0x5b')](_0x128618)[_0x54c3('0x37')](handleEntityNotFound(_0x4e84d0,null))[_0x54c3('0x37')](respondWithResult(_0x4e84d0,null))[_0x54c3('0x2a')](handleError(_0x4e84d0,null));};exports[_0x54c3('0x5c')]=function(_0x471505,_0x273475){return db['ChatQueue'][_0x54c3('0x5c')](_0x471505[_0x54c3('0x5d')],{})[_0x54c3('0x37')](function(_0x20459a){var _0x45e7e8=_0x471505['user'][_0x54c3('0x39')]({'plain':!![]});if(!_0x45e7e8)throw new Error(_0x54c3('0x5e'));if(_0x45e7e8['role']===_0x54c3('0x5f')){var _0x4396ed=_0x20459a[_0x54c3('0x39')]({'plain':!![]});var _0x3cb2e0=_0x54c3('0x3a');return db[_0x54c3('0x60')][_0x54c3('0x5b')]({'where':{'name':_0x3cb2e0,'userProfileId':_0x45e7e8['userProfileId']},'raw':!![]})['then'](function(_0x42e58c){if(_0x42e58c&&_0x42e58c[_0x54c3('0x61')]===0x0){return db[_0x54c3('0x3b')]['create']({'name':_0x4396ed[_0x54c3('0x3d')],'resourceId':_0x4396ed['id'],'type':_0x42e58c['name'],'sectionId':_0x42e58c['id']},{})[_0x54c3('0x37')](function(){return _0x20459a;});}else{return _0x20459a;}})[_0x54c3('0x2a')](function(_0x310818){logger['error'](_0x54c3('0x62'),_0x310818);throw _0x310818;});}return _0x20459a;})['then'](respondWithResult(_0x273475,0xc9))[_0x54c3('0x2a')](handleError(_0x273475,null));};exports['update']=function(_0x50146e,_0x32b5d3){if(_0x50146e[_0x54c3('0x5d')]['id']){delete _0x50146e['body']['id'];}return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x50146e[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x32b5d3,null))[_0x54c3('0x37')](saveUpdates(_0x50146e['body'],null))[_0x54c3('0x37')](respondWithResult(_0x32b5d3,null))[_0x54c3('0x2a')](handleError(_0x32b5d3,null));};exports[_0x54c3('0x38')]=function(_0x357723,_0x25a40e){return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x357723[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x25a40e,null))[_0x54c3('0x37')](removeEntity(_0x25a40e,null))['catch'](handleError(_0x25a40e,null));};exports['describe']=function(_0x62100e,_0x288bf5){return db[_0x54c3('0x40')][_0x54c3('0x63')]()[_0x54c3('0x37')](respondWithResult(_0x288bf5,null))[_0x54c3('0x2a')](handleError(_0x288bf5,null));};exports[_0x54c3('0x64')]=function(_0x330d92,_0x9f247a,_0x39b564){var _0x583ae1={'raw':!![],'where':{}},_0xcee158={},_0x57f5ff;return db['ChatQueue'][_0x54c3('0x65')]({'where':{'id':_0x330d92[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x9f247a,null))['then'](function(_0x5cccdf){if(_0x5cccdf){_0x57f5ff=_0x5cccdf['get']({'plain':!![]});_0xcee158[_0x54c3('0x45')]=_[_0x54c3('0x59')](db[_0x54c3('0x66')][_0x54c3('0x41')]);_0xcee158[_0x54c3('0x49')]=_['keys'](_0x330d92[_0x54c3('0x49')]);_0xcee158[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],_0xcee158[_0x54c3('0x49')]);_0x583ae1[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],qs['fields'](_0x330d92['query'][_0x54c3('0x4b')]));_0x583ae1['attributes']=_0x583ae1[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x583ae1[_0x54c3('0x4a')]:_0xcee158[_0x54c3('0x45')];if(!_0x330d92['query'][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x583ae1[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x330d92['query'][_0x54c3('0x31')]);_0x583ae1[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x330d92[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x583ae1[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x330d92['query'][_0x54c3('0x4e')]);_0x583ae1[_0x54c3('0x4f')]=qs['filters'](_[_0x54c3('0x50')](_0x330d92[_0x54c3('0x49')],_0xcee158[_0x54c3('0x47')]));_0x583ae1[_0x54c3('0x4f')][_0x54c3('0x69')]=_0x5cccdf['id'];if(_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]){_0x583ae1['where']=_[_0x54c3('0x52')](_0x583ae1[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x583ae1[_0x54c3('0x4a')],function(_0xc1632a){var _0x4b2fb6={};_0x4b2fb6[_0xc1632a]={'$like':'%'+_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x4b2fb6;})});}_0x583ae1=_['merge']({},_0x583ae1,_0x330d92[_0x54c3('0x54')]);return db['UserChatQueue']['findAll'](_0x583ae1);}})[_0x54c3('0x37')](function(_0x3756ce){if(_0x3756ce){return db[_0x54c3('0x6a')][_0x54c3('0x6b')]({'where':{'id':_[_0x54c3('0x46')](_0x3756ce,'UserId'),'role':_0x54c3('0x6c')},'attributes':['id',_0x54c3('0x3d'),_0x54c3('0x6d'),_0x54c3('0x6e'),_0x54c3('0x6f')]});}})[_0x54c3('0x37')](function(_0x1a365a){if(_0x1a365a){return{'count':_0x1a365a[_0x54c3('0x32')],'rows':_['map'](_0x1a365a['rows'],function(_0xef1026){return{'membername':_0xef1026[_0x54c3('0x3d')],'UserId':_0xef1026['id'],'queue_name':_0x57f5ff[_0x54c3('0x3d')],'ChatQueueId':_0x57f5ff['id'],'interface':util[_0x54c3('0x70')]('%s/%s',_0x54c3('0x71'),_0xef1026[_0x54c3('0x3d')]),'penalty':0x0,'paused':_0xef1026['chatPause'],'createdAt':_0xef1026[_0x54c3('0x6f')],'updatedAt':_0xef1026[_0x54c3('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9f247a,_0x583ae1))[_0x54c3('0x2a')](handleError(_0x9f247a,null));};exports[_0x54c3('0x72')]=function(_0x58c9e8,_0x2b837a,_0x312f18){var _0x3bc8e3={};var _0x583e63={};var _0x118aa0;var _0x7f8a5c;return db[_0x54c3('0x40')]['findOne']({'where':{'id':_0x58c9e8[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x2b837a,null))['then'](function(_0x4f00cc){if(_0x4f00cc){_0x118aa0=_0x4f00cc;_0x583e63[_0x54c3('0x45')]=_[_0x54c3('0x59')](db['Team']['rawAttributes']);_0x583e63['query']=_[_0x54c3('0x59')](_0x58c9e8[_0x54c3('0x49')]);_0x583e63[_0x54c3('0x47')]=_['intersection'](_0x583e63[_0x54c3('0x45')],_0x583e63[_0x54c3('0x49')]);_0x3bc8e3[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x583e63[_0x54c3('0x45')],qs['fields'](_0x58c9e8[_0x54c3('0x49')]['fields']));_0x3bc8e3[_0x54c3('0x4a')]=_0x3bc8e3['attributes']['length']?_0x3bc8e3['attributes']:_0x583e63[_0x54c3('0x45')];_0x3bc8e3[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4e')]);_0x3bc8e3[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_['pick'](_0x58c9e8[_0x54c3('0x49')],_0x583e63[_0x54c3('0x47')]));if(_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]){_0x3bc8e3[_0x54c3('0x4f')]=_[_0x54c3('0x52')](_0x3bc8e3[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x3bc8e3['attributes'],function(_0x5bb20e){var _0x734cb7={};_0x734cb7[_0x5bb20e]={'$like':'%'+_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x734cb7;})});}_0x3bc8e3=_['merge']({},_0x3bc8e3,_0x58c9e8[_0x54c3('0x54')]);return _0x118aa0[_0x54c3('0x72')](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0xf75424){if(_0xf75424){_0x7f8a5c=_0xf75424[_0x54c3('0x4c')];if(!_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x3bc8e3[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x31')]);_0x3bc8e3[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x58c9e8['query'][_0x54c3('0x2f')]);}return _0x118aa0['getTeams'](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0x4785b6){if(_0x4785b6){return _0x4785b6?{'count':_0x7f8a5c,'rows':_0x4785b6}:null;}})['then'](respondWithResult(_0x2b837a,null))[_0x54c3('0x2a')](handleError(_0x2b837a,null));};exports[_0x54c3('0x73')]=function(_0x54e2c9,_0x39b8cb,_0x38e22c){var _0x57ae8c=_0x54e2c9[_0x54c3('0x5d')][_0x54c3('0x74')];return db['Team']['findAll']({'where':{'id':_0x57ae8c},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':'Agents','attributes':['id',_0x54c3('0x3d'),'online',_0x54c3('0x75'),'interface'],'raw':!![]}]})['then'](function(_0xf241b2){if(_0xf241b2){var _0x4df675=_['flatMap'](_0xf241b2,function(_0x637366){var _0x4a3670=_0x637366['get']({'plain':!![]});return _0x4a3670[_0x54c3('0x76')];});return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x54e2c9['params']['id']}})[_0x54c3('0x37')](function(_0x1ad25c){return db['sequelize'][_0x54c3('0x77')](function(_0x5d4dee){return _0x1ad25c[_0x54c3('0x73')](_0x57ae8c,{'transaction':_0x5d4dee})[_0x54c3('0x37')](function(){return BPromise[_0x54c3('0x78')](_0x4df675,function(_0x2015bd){return db[_0x54c3('0x66')][_0x54c3('0x79')]({'where':{'UserId':_0x2015bd['id'],'ChatQueueId':_0x54e2c9[_0x54c3('0x58')]['id']},'transaction':_0x5d4dee});});})['then'](function(){_0x4df675[_0x54c3('0x7a')](function(_0x559448){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':_0x559448['id'],'ChatQueueId':_0x1ad25c['id']});});});});});}})['then'](respondWithStatusCode(_0x39b8cb,null))['catch'](handleError(_0x39b8cb,null));};exports[_0x54c3('0x7d')]=function(_0x18f309,_0x51d8dd,_0x246ed7){return db[_0x54c3('0x7e')][_0x54c3('0x55')]({'where':{'id':_0x18f309['query'][_0x54c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':_0x54c3('0x76'),'attributes':['id'],'raw':!![]}]})[_0x54c3('0x37')](handleEntityNotFound(_0x51d8dd,null))[_0x54c3('0x37')](function(_0x2e795f){var _0x196bef=_['map'](_0x2e795f,'id');var _0x565f18=[];var _0x562cc0=[];var _0x2de9d6=squel[_0x54c3('0x7f')]();_0x2de9d6[_0x54c3('0x80')](_0x54c3('0x81'))[_0x54c3('0x82')]('team_has_chat_queues','tq')['join'](_0x54c3('0x83'),'ut',_0x54c3('0x84'))[_0x54c3('0x4f')](_0x54c3('0x85'),_0x18f309['params']['id']);for(var _0x52c6ec=0x0;_0x52c6ec<_0x2e795f[_0x54c3('0x4c')];_0x52c6ec+=0x1){let _0xf741=_0x2e795f[_0x52c6ec];for(var _0x1360ea=0x0;_0x1360ea<_0xf741['Agents'][_0x54c3('0x4c')];_0x1360ea+=0x1){let _0x3281a2=_0xf741[_0x54c3('0x76')][_0x1360ea];var _0x24460e=_0x2de9d6[_0x54c3('0x86')]();_0x24460e['where'](_0x54c3('0x87'),_0x3281a2['id']);_0x562cc0['push'](db['sequelize']['query'](_0x24460e[_0x54c3('0x88')](),{'type':db['sequelize'][_0x54c3('0x89')]['SELECT']})[_0x54c3('0x37')](function(_0x4df5fd){if(_0x4df5fd['length']===0x1){return _0x3281a2['id'];}else{var _0x28eee9=_['every'](_[_0x54c3('0x46')](_0x4df5fd,_0x54c3('0x8a')),function(_0x4d231c){return _['includes'](_0x196bef,_0x4d231c);});if(_0x28eee9){return _0x3281a2['id'];}}}));}}return BPromise[_0x54c3('0x8b')](_0x562cc0)[_0x54c3('0x37')](function(_0x3b2a3b){_0x565f18=_(_0x565f18)[_0x54c3('0x8c')](_0x3b2a3b)[_0x54c3('0x8d')]()[_0x54c3('0x8e')]();return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x18f309[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](function(_0xd0858a){return db[_0x54c3('0x8f')][_0x54c3('0x77')](function(_0x1e8149){return _0xd0858a[_0x54c3('0x7d')](_0x18f309['query'][_0x54c3('0x74')],{'transaction':_0x1e8149})[_0x54c3('0x37')](function(){if(!_[_0x54c3('0x90')](_0x565f18)){return _0xd0858a[_0x54c3('0x91')](_0x565f18,{'transaction':_0x1e8149});}})[_0x54c3('0x37')](function(){_0x565f18[_0x54c3('0x7a')](function(_0x64c5dc){socket[_0x54c3('0x7b')](_0x54c3('0x92'),{'UserId':_0x64c5dc,'ChatQueueId':_0xd0858a['id']});});});});});});})[_0x54c3('0x37')](respondWithStatusCode(_0x51d8dd,null))[_0x54c3('0x2a')](handleError(_0x51d8dd,null));};exports[_0x54c3('0x93')]=function(_0x569bda,_0x21a0ad,_0x5aec34){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x569bda[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x21a0ad,null))[_0x54c3('0x37')](function(_0x514949){if(_0x514949){return _0x514949[_0x54c3('0x93')](_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')],_[_0x54c3('0x94')](_0x569bda[_0x54c3('0x5d')],['ids','id'])||{})[_0x54c3('0x95')](function(_0x290987){for(var _0x301548=0x0;_0x301548<_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x301548+=0x1){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':Number(_0x569bda[_0x54c3('0x5d')]['ids'][_0x301548]),'ChatQueueId':Number(_0x569bda['params']['id'])});}return _0x290987;});}})[_0x54c3('0x37')](respondWithResult(_0x21a0ad,null))[_0x54c3('0x2a')](handleError(_0x21a0ad,null));};exports['removeAgents']=function(_0x34d33c,_0x18296a,_0x21149f){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x34d33c[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x18296a,null))[_0x54c3('0x37')](function(_0x29f9fe){if(_0x29f9fe){return _0x29f9fe['removeAgents'](_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')])[_0x54c3('0x37')](function(){if(_['isArray'](_0x34d33c[_0x54c3('0x49')]['ids'])){for(var _0x54690c=0x0;_0x54690c<_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x54690c+=0x1){socket['emit'](_0x54c3('0x92'),{'UserId':Number(_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54690c]),'ChatQueueId':Number(_0x34d33c[_0x54c3('0x58')]['id'])});}}else{socket[_0x54c3('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x34d33c[_0x54c3('0x49')]['ids']),'ChatQueueId':Number(_0x34d33c['params']['id'])});}});}})[_0x54c3('0x37')](respondWithStatusCode(_0x18296a,null))[_0x54c3('0x2a')](handleError(_0x18296a,null));};exports[_0x54c3('0x96')]=function(_0x1e26a6,_0xabd60d,_0x5a86cf){var _0xeadb86={};var _0x5e1564={};var _0x597daf;var _0x4c0c60;return db[_0x54c3('0x40')][_0x54c3('0x65')]({'where':{'id':_0x1e26a6[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0xabd60d,null))[_0x54c3('0x37')](function(_0xfd694){if(_0xfd694){_0x597daf=_0xfd694;_0x5e1564[_0x54c3('0x45')]=_['keys'](db[_0x54c3('0x6a')][_0x54c3('0x41')]);_0x5e1564['query']=_[_0x54c3('0x59')](_0x1e26a6[_0x54c3('0x49')]);_0x5e1564[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],_0x5e1564['query']);_0xeadb86['attributes']=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x1e26a6['query'][_0x54c3('0x4b')]));_0xeadb86[_0x54c3('0x4a')]=_0xeadb86[_0x54c3('0x4a')]['length']?_0xeadb86[_0x54c3('0x4a')]:_0x5e1564[_0x54c3('0x45')];_0xeadb86[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4e')]);_0xeadb86[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x1e26a6[_0x54c3('0x49')],_0x5e1564['filters']));if(_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]){_0xeadb86['where']=_[_0x54c3('0x52')](_0xeadb86['where'],{'$or':_[_0x54c3('0x46')](_0xeadb86[_0x54c3('0x4a')],function(_0x256354){var _0x5231c3={};_0x5231c3[_0x256354]={'$like':'%'+_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x5231c3;})});}_0xeadb86=_[_0x54c3('0x52')]({},_0xeadb86,_0x1e26a6[_0x54c3('0x54')]);return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x4e8422){if(_0x4e8422){_0x4c0c60=_0x4e8422[_0x54c3('0x4c')];if(!_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0xeadb86[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x1e26a6['query'][_0x54c3('0x31')]);_0xeadb86['offset']=qs[_0x54c3('0x2f')](_0x1e26a6[_0x54c3('0x49')]['offset']);}return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x3ab4c2){if(_0x3ab4c2){return _0x3ab4c2?{'count':_0x4c0c60,'rows':_0x3ab4c2}:null;}})[_0x54c3('0x37')](respondWithResult(_0xabd60d,null))['catch'](handleError(_0xabd60d,null));}; \ No newline at end of file +var _0x4a94=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','chatPause','createdAt','format','%s/%s','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','User','select','field','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','removeTeams','isEmpty','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','ChatQueue','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length'];(function(_0x323fff,_0x38f93e){var _0x326de5=function(_0x5520f9){while(--_0x5520f9){_0x323fff['push'](_0x323fff['shift']());}};_0x326de5(++_0x38f93e);}(_0x4a94,0xe4));var _0x44a9=function(_0x409ef3,_0x59f9df){_0x409ef3=_0x409ef3-0x0;var _0x2ba639=_0x4a94[_0x409ef3];return _0x2ba639;};'use strict';var emlformat=require(_0x44a9('0x0'));var rimraf=require(_0x44a9('0x1'));var zipdir=require(_0x44a9('0x2'));var jsonpatch=require(_0x44a9('0x3'));var rp=require(_0x44a9('0x4'));var moment=require('moment');var BPromise=require(_0x44a9('0x5'));var Mustache=require('mustache');var util=require(_0x44a9('0x6'));var path=require(_0x44a9('0x7'));var sox=require(_0x44a9('0x8'));var csv=require('to-csv');var ejs=require(_0x44a9('0x9'));var fs=require('fs');var fs_extra=require(_0x44a9('0xa'));var _=require(_0x44a9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x44a9('0xc'));var deskjs=require(_0x44a9('0xd'));var toCsv=require(_0x44a9('0xe'));var querystring=require(_0x44a9('0xf'));var Papa=require(_0x44a9('0x10'));var Redis=require(_0x44a9('0x11'));var authService=require(_0x44a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x44a9('0x13'));var hardwareService=require(_0x44a9('0x14'));var logger=require(_0x44a9('0x15'))(_0x44a9('0x16'));var utils=require(_0x44a9('0x17'));var config=require(_0x44a9('0x18'));var licenseUtil=require(_0x44a9('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x44a9('0x1a')](config[_0x44a9('0x1b')],{'host':_0x44a9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44a9('0x1b')]));require(_0x44a9('0x1d'))[_0x44a9('0x1e')](socket);var jayson=require(_0x44a9('0x1f'));var client=jayson[_0x44a9('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5576,_0x229d0c,_0x21d459,_0x25207c){return new BPromise(function(_0x3f47f7,_0x444d31){var _0x4528a4=_0x25207c||client;return _0x4528a4['request'](_0x3e5576,_0x21d459)['then'](function(_0x44a02a){logger[_0x44a9('0x21')](_0x44a9('0x22'),_0x229d0c,'request\x20sent');logger[_0x44a9('0x23')](_0x44a9('0x24'),_0x229d0c,_0x44a9('0x25'),JSON[_0x44a9('0x26')](_0x44a02a));if(_0x44a02a['error']){if(_0x44a02a[_0x44a9('0x27')][_0x44a9('0x28')]===0x1f4){logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);return _0x444d31(_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);}logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);return _0x3f47f7(_0x44a02a[_0x44a9('0x27')]['message']);}else{logger[_0x44a9('0x21')](_0x44a9('0x22'),_0x229d0c,_0x44a9('0x25'));_0x3f47f7(_0x44a02a[_0x44a9('0x2a')][_0x44a9('0x29')]);}})['catch'](function(_0xaf8886){logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0xaf8886);_0x444d31(_0xaf8886);});});}function respondWithStatusCode(_0x2bb90f,_0x4bd42d){_0x4bd42d=_0x4bd42d||0xcc;return function(_0x5af684){if(_0x5af684){return _0x2bb90f['sendStatus'](_0x4bd42d);}return _0x2bb90f[_0x44a9('0x2b')](_0x4bd42d)[_0x44a9('0x2c')]();};}function respondWithResult(_0x2b40b7,_0xbdd535){_0xbdd535=_0xbdd535||0xc8;return function(_0x32b13c){if(_0x32b13c){return _0x2b40b7[_0x44a9('0x2b')](_0xbdd535)[_0x44a9('0x2d')](_0x32b13c);}};}function respondWithFilteredResult(_0x1d3b67,_0x2a6971){return function(_0x5a5599){if(_0x5a5599){var _0x32bc60=typeof _0x2a6971[_0x44a9('0x2e')]==='undefined'&&typeof _0x2a6971[_0x44a9('0x2f')]===_0x44a9('0x30');var _0x2ba116=_0x5a5599[_0x44a9('0x31')];var _0x6cb758=_0x32bc60?0x0:_0x2a6971[_0x44a9('0x2e')];var _0x575316=_0x32bc60?_0x5a5599[_0x44a9('0x31')]:_0x2a6971[_0x44a9('0x2e')]+_0x2a6971[_0x44a9('0x2f')];var _0x3668b3;if(_0x575316>=_0x2ba116){_0x575316=_0x2ba116;_0x3668b3=0xc8;}else{_0x3668b3=0xce;}_0x1d3b67[_0x44a9('0x2b')](_0x3668b3);return _0x1d3b67['set'](_0x44a9('0x32'),_0x6cb758+'-'+_0x575316+'/'+_0x2ba116)[_0x44a9('0x2d')](_0x5a5599);}return null;};}function patchUpdates(_0x123523){return function(_0x32481b){try{jsonpatch[_0x44a9('0x33')](_0x32481b,_0x123523,!![]);}catch(_0x40894f){return BPromise[_0x44a9('0x34')](_0x40894f);}return _0x32481b[_0x44a9('0x35')]();};}function saveUpdates(_0x57f0d7,_0x5be56d){return function(_0x283390){if(_0x283390){return _0x283390[_0x44a9('0x36')](_0x57f0d7)[_0x44a9('0x37')](function(_0x314441){return _0x314441;});}return null;};}function removeEntity(_0x2443af,_0x3d9c77){return function(_0x437c96){if(_0x437c96){return _0x437c96[_0x44a9('0x38')]()['then'](function(){var _0x2739be=_0x437c96[_0x44a9('0x39')]({'plain':!![]});var _0x5e4ad5=_0x44a9('0x3a');return db[_0x44a9('0x3b')][_0x44a9('0x38')]({'where':{'type':_0x5e4ad5,'resourceId':_0x2739be['id']}})['then'](function(){return _0x437c96;});})[_0x44a9('0x37')](function(){_0x2443af[_0x44a9('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a78f,_0x43a054){return function(_0x25a6c8){if(!_0x25a6c8){_0x18a78f[_0x44a9('0x3c')](0x194);}return _0x25a6c8;};}function handleError(_0x459a10,_0x38723c){_0x38723c=_0x38723c||0x1f4;return function(_0x49f6cd){logger['error'](_0x49f6cd[_0x44a9('0x3d')]);if(_0x49f6cd[_0x44a9('0x3e')]){delete _0x49f6cd[_0x44a9('0x3e')];}_0x459a10[_0x44a9('0x2b')](_0x38723c)[_0x44a9('0x3f')](_0x49f6cd);};}exports['index']=function(_0x327708,_0x1ce711){var _0x2c6671={},_0x257653={},_0x3b4c24={'count':0x0,'rows':[]};var _0x3f9ade=_['map'](db[_0x44a9('0x40')][_0x44a9('0x41')],function(_0x17777c){return{'name':_0x17777c['fieldName'],'type':_0x17777c[_0x44a9('0x42')][_0x44a9('0x43')]};});_0x257653[_0x44a9('0x44')]=_[_0x44a9('0x45')](_0x3f9ade,_0x44a9('0x3e'));_0x257653[_0x44a9('0x46')]=_['keys'](_0x327708[_0x44a9('0x46')]);_0x257653[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x257653[_0x44a9('0x44')],_0x257653['query']);_0x2c6671[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x257653['model'],qs['fields'](_0x327708[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x2c6671[_0x44a9('0x49')]=_0x2c6671[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x2c6671[_0x44a9('0x49')]:_0x257653[_0x44a9('0x44')];if(!_0x327708[_0x44a9('0x46')][_0x44a9('0x4c')](_0x44a9('0x4d'))){_0x2c6671['limit']=qs[_0x44a9('0x2f')](_0x327708['query']['limit']);_0x2c6671['offset']=qs['offset'](_0x327708[_0x44a9('0x46')][_0x44a9('0x2e')]);}_0x2c6671['order']=qs[_0x44a9('0x4e')](_0x327708[_0x44a9('0x46')]['sort']);_0x2c6671[_0x44a9('0x4f')]=qs['filters'](_[_0x44a9('0x50')](_0x327708[_0x44a9('0x46')],_0x257653[_0x44a9('0x47')]),_0x3f9ade);if(_0x327708[_0x44a9('0x46')][_0x44a9('0x51')]){_0x2c6671[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x2c6671['where'],{'$or':_[_0x44a9('0x45')](_0x3f9ade,function(_0x32420e){if(_0x32420e[_0x44a9('0x42')]!==_0x44a9('0x53')){var _0x567233={};_0x567233[_0x32420e[_0x44a9('0x3e')]]={'$like':'%'+_0x327708[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x567233;}})});}_0x2c6671=_[_0x44a9('0x52')]({},_0x2c6671,_0x327708[_0x44a9('0x54')]);var _0x200112={'where':_0x2c6671[_0x44a9('0x4f')]};return db['ChatQueue'][_0x44a9('0x31')](_0x200112)['then'](function(_0x3b19a2){_0x3b4c24[_0x44a9('0x31')]=_0x3b19a2;if(_0x327708['query']['includeAll']){_0x2c6671[_0x44a9('0x55')]=[{'all':!![]}];}return db[_0x44a9('0x40')][_0x44a9('0x56')](_0x2c6671);})['then'](function(_0xd66698){_0x3b4c24[_0x44a9('0x57')]=_0xd66698;return _0x3b4c24;})[_0x44a9('0x37')](respondWithFilteredResult(_0x1ce711,_0x2c6671))[_0x44a9('0x58')](handleError(_0x1ce711,null));};exports[_0x44a9('0x59')]=function(_0x314c93,_0x125693){var _0x2aa198={'raw':!![],'where':{'id':_0x314c93[_0x44a9('0x5a')]['id']}},_0x4f5815={};_0x4f5815['model']=_['keys'](db[_0x44a9('0x40')]['rawAttributes']);_0x4f5815[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x314c93['query']);_0x4f5815[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x4f5815[_0x44a9('0x44')],_0x4f5815[_0x44a9('0x46')]);_0x2aa198[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x4f5815['model'],qs['fields'](_0x314c93['query'][_0x44a9('0x4a')]));_0x2aa198[_0x44a9('0x49')]=_0x2aa198[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x2aa198[_0x44a9('0x49')]:_0x4f5815[_0x44a9('0x44')];if(_0x314c93[_0x44a9('0x46')][_0x44a9('0x5c')]){_0x2aa198['include']=[{'all':!![]}];}_0x2aa198=_[_0x44a9('0x52')]({},_0x2aa198,_0x314c93[_0x44a9('0x54')]);return db[_0x44a9('0x40')]['find'](_0x2aa198)[_0x44a9('0x37')](handleEntityNotFound(_0x125693,null))[_0x44a9('0x37')](respondWithResult(_0x125693,null))['catch'](handleError(_0x125693,null));};exports[_0x44a9('0x5d')]=function(_0xad2077,_0x5106c5){return db['ChatQueue'][_0x44a9('0x5d')](_0xad2077[_0x44a9('0x5e')],{})[_0x44a9('0x37')](function(_0x3a5f32){var _0xa2386e=_0xad2077[_0x44a9('0x5f')][_0x44a9('0x39')]({'plain':!![]});if(!_0xa2386e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa2386e[_0x44a9('0x60')]===_0x44a9('0x5f')){var _0x3cf8f7=_0x3a5f32[_0x44a9('0x39')]({'plain':!![]});var _0x315473=_0x44a9('0x3a');return db[_0x44a9('0x61')][_0x44a9('0x62')]({'where':{'name':_0x315473,'userProfileId':_0xa2386e[_0x44a9('0x63')]},'raw':!![]})[_0x44a9('0x37')](function(_0x19f3c3){if(_0x19f3c3&&_0x19f3c3[_0x44a9('0x64')]===0x0){return db[_0x44a9('0x3b')]['create']({'name':_0x3cf8f7[_0x44a9('0x3e')],'resourceId':_0x3cf8f7['id'],'type':_0x19f3c3['name'],'sectionId':_0x19f3c3['id']},{})['then'](function(){return _0x3a5f32;});}else{return _0x3a5f32;}})[_0x44a9('0x58')](function(_0x1b1b4a){logger[_0x44a9('0x27')](_0x44a9('0x65'),_0x1b1b4a);throw _0x1b1b4a;});}return _0x3a5f32;})[_0x44a9('0x37')](respondWithResult(_0x5106c5,0xc9))['catch'](handleError(_0x5106c5,null));};exports[_0x44a9('0x36')]=function(_0x37a38f,_0x5ea941){if(_0x37a38f['body']['id']){delete _0x37a38f['body']['id'];}return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x37a38f[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x5ea941,null))[_0x44a9('0x37')](saveUpdates(_0x37a38f[_0x44a9('0x5e')],null))[_0x44a9('0x37')](respondWithResult(_0x5ea941,null))[_0x44a9('0x58')](handleError(_0x5ea941,null));};exports[_0x44a9('0x38')]=function(_0x53d374,_0x4d68fc){return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x53d374[_0x44a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d68fc,null))[_0x44a9('0x37')](removeEntity(_0x4d68fc,null))[_0x44a9('0x58')](handleError(_0x4d68fc,null));};exports[_0x44a9('0x66')]=function(_0x590e89,_0x1bb18b){return db[_0x44a9('0x40')][_0x44a9('0x66')]()[_0x44a9('0x37')](respondWithResult(_0x1bb18b,null))[_0x44a9('0x58')](handleError(_0x1bb18b,null));};exports[_0x44a9('0x67')]=function(_0x523ee7,_0x2133ad,_0x6b6933){var _0x1f6d46={'raw':!![],'where':{}},_0xf144b6={},_0x11ef48;return db['ChatQueue'][_0x44a9('0x68')]({'where':{'id':_0x523ee7[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x2133ad,null))[_0x44a9('0x37')](function(_0x316163){if(_0x316163){_0x11ef48=_0x316163[_0x44a9('0x39')]({'plain':!![]});_0xf144b6[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db[_0x44a9('0x69')][_0x44a9('0x41')]);_0xf144b6[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x523ee7[_0x44a9('0x46')]);_0xf144b6[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0xf144b6['model'],_0xf144b6[_0x44a9('0x46')]);_0x1f6d46[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0xf144b6[_0x44a9('0x44')],qs['fields'](_0x523ee7['query'][_0x44a9('0x4a')]));_0x1f6d46[_0x44a9('0x49')]=_0x1f6d46[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x1f6d46[_0x44a9('0x49')]:_0xf144b6[_0x44a9('0x44')];if(!_0x523ee7[_0x44a9('0x46')]['hasOwnProperty'](_0x44a9('0x4d'))){_0x1f6d46[_0x44a9('0x2f')]=qs['limit'](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x2f')]);_0x1f6d46[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x2e')]);}_0x1f6d46[_0x44a9('0x6a')]=qs[_0x44a9('0x4e')](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x4e')]);_0x1f6d46[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x523ee7[_0x44a9('0x46')],_0xf144b6['filters']));_0x1f6d46[_0x44a9('0x4f')][_0x44a9('0x6b')]=_0x316163['id'];if(_0x523ee7[_0x44a9('0x46')][_0x44a9('0x51')]){_0x1f6d46[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x1f6d46[_0x44a9('0x4f')],{'$or':_[_0x44a9('0x45')](_0x1f6d46[_0x44a9('0x49')],function(_0x35cbdd){var _0x6deac3={};_0x6deac3[_0x35cbdd]={'$like':'%'+_0x523ee7['query'][_0x44a9('0x51')]+'%'};return _0x6deac3;})});}_0x1f6d46=_[_0x44a9('0x52')]({},_0x1f6d46,_0x523ee7[_0x44a9('0x54')]);return db['UserChatQueue'][_0x44a9('0x56')](_0x1f6d46);}})[_0x44a9('0x37')](function(_0x2476d4){if(_0x2476d4){return db['User'][_0x44a9('0x6c')]({'where':{'id':_[_0x44a9('0x45')](_0x2476d4,'UserId'),'role':'agent'},'attributes':['id',_0x44a9('0x3e'),_0x44a9('0x6d'),'updatedAt',_0x44a9('0x6e')]});}})[_0x44a9('0x37')](function(_0x17dd6c){if(_0x17dd6c){return{'count':_0x17dd6c[_0x44a9('0x31')],'rows':_[_0x44a9('0x45')](_0x17dd6c[_0x44a9('0x57')],function(_0x2f3524){return{'membername':_0x2f3524[_0x44a9('0x3e')],'UserId':_0x2f3524['id'],'queue_name':_0x11ef48[_0x44a9('0x3e')],'ChatQueueId':_0x11ef48['id'],'interface':util[_0x44a9('0x6f')](_0x44a9('0x70'),'SIP',_0x2f3524[_0x44a9('0x3e')]),'penalty':0x0,'paused':_0x2f3524[_0x44a9('0x6d')],'createdAt':_0x2f3524['createdAt'],'updatedAt':_0x2f3524[_0x44a9('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44a9('0x37')](respondWithFilteredResult(_0x2133ad,_0x1f6d46))['catch'](handleError(_0x2133ad,null));};exports[_0x44a9('0x72')]=function(_0x54ecc4,_0x3311d1,_0x4ccb5b){var _0x257f54={};var _0x55694d={};var _0x338427;var _0x38931d;return db[_0x44a9('0x40')][_0x44a9('0x68')]({'where':{'id':_0x54ecc4[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x3311d1,null))[_0x44a9('0x37')](function(_0x3497c3){if(_0x3497c3){_0x338427=_0x3497c3;_0x55694d[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db['Team'][_0x44a9('0x41')]);_0x55694d['query']=_[_0x44a9('0x5b')](_0x54ecc4[_0x44a9('0x46')]);_0x55694d[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x55694d['model'],_0x55694d[_0x44a9('0x46')]);_0x257f54[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x55694d[_0x44a9('0x44')],qs[_0x44a9('0x4a')](_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x257f54[_0x44a9('0x49')]=_0x257f54[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x257f54[_0x44a9('0x49')]:_0x55694d[_0x44a9('0x44')];_0x257f54['order']=qs[_0x44a9('0x4e')](_0x54ecc4[_0x44a9('0x46')]['sort']);_0x257f54[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x54ecc4[_0x44a9('0x46')],_0x55694d['filters']));if(_0x54ecc4['query'][_0x44a9('0x51')]){_0x257f54[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x257f54[_0x44a9('0x4f')],{'$or':_['map'](_0x257f54[_0x44a9('0x49')],function(_0x2f386f){var _0x13d34d={};_0x13d34d[_0x2f386f]={'$like':'%'+_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x13d34d;})});}_0x257f54=_[_0x44a9('0x52')]({},_0x257f54,_0x54ecc4[_0x44a9('0x54')]);return _0x338427[_0x44a9('0x72')](_0x257f54);}})[_0x44a9('0x37')](function(_0x542bec){if(_0x542bec){_0x38931d=_0x542bec['length'];if(!_0x54ecc4['query']['hasOwnProperty'](_0x44a9('0x4d'))){_0x257f54[_0x44a9('0x2f')]=qs[_0x44a9('0x2f')](_0x54ecc4[_0x44a9('0x46')]['limit']);_0x257f54[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x2e')]);}return _0x338427[_0x44a9('0x72')](_0x257f54);}})[_0x44a9('0x37')](function(_0x1c3479){if(_0x1c3479){return _0x1c3479?{'count':_0x38931d,'rows':_0x1c3479}:null;}})[_0x44a9('0x37')](respondWithResult(_0x3311d1,null))['catch'](handleError(_0x3311d1,null));};exports['addTeams']=function(_0x2c5b9b,_0x1881c2,_0x1e5f9e){var _0x2cae46=_0x2c5b9b[_0x44a9('0x5e')][_0x44a9('0x73')];return db[_0x44a9('0x74')]['findAll']({'where':{'id':_0x2cae46},'attributes':['id'],'include':[{'model':db['User'],'as':_0x44a9('0x75'),'attributes':['id','name',_0x44a9('0x76'),_0x44a9('0x77'),_0x44a9('0x78')],'raw':!![]}]})[_0x44a9('0x37')](function(_0x58162e){if(_0x58162e){var _0x4f8309=_['flatMap'](_0x58162e,function(_0x4c5a17){var _0x470613=_0x4c5a17['get']({'plain':!![]});return _0x470613[_0x44a9('0x75')];});return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x2c5b9b[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](function(_0x3190c9){return db['sequelize'][_0x44a9('0x79')](function(_0x1d7280){return _0x3190c9[_0x44a9('0x7a')](_0x2cae46,{'transaction':_0x1d7280})[_0x44a9('0x37')](function(){return BPromise[_0x44a9('0x7b')](_0x4f8309,function(_0x5dabfe){return db[_0x44a9('0x69')][_0x44a9('0x7c')]({'where':{'UserId':_0x5dabfe['id'],'ChatQueueId':_0x2c5b9b[_0x44a9('0x5a')]['id']},'transaction':_0x1d7280});});})[_0x44a9('0x37')](function(){_0x4f8309[_0x44a9('0x7d')](function(_0x220eb5){socket[_0x44a9('0x7e')](_0x44a9('0x7f'),{'UserId':_0x220eb5['id'],'ChatQueueId':_0x3190c9['id']});});});});});}})[_0x44a9('0x37')](respondWithStatusCode(_0x1881c2,null))[_0x44a9('0x58')](handleError(_0x1881c2,null));};exports['removeTeams']=function(_0x5687af,_0x3280fe,_0x4f9f27){return db[_0x44a9('0x74')][_0x44a9('0x56')]({'where':{'id':_0x5687af[_0x44a9('0x46')][_0x44a9('0x73')]},'attributes':['id'],'include':[{'model':db[_0x44a9('0x80')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x44a9('0x37')](handleEntityNotFound(_0x3280fe,null))[_0x44a9('0x37')](function(_0xb2f405){var _0x3b4167=_[_0x44a9('0x45')](_0xb2f405,'id');var _0x598f94=[];var _0x5dca0d=[];var _0xb9aab8=squel[_0x44a9('0x81')]();_0xb9aab8[_0x44a9('0x82')]('tq.TeamId')[_0x44a9('0x83')](_0x44a9('0x84'),'tq')['join'](_0x44a9('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44a9('0x4f')](_0x44a9('0x86'),_0x5687af['params']['id']);for(var _0x402f1a=0x0;_0x402f1a<_0xb2f405[_0x44a9('0x4b')];_0x402f1a+=0x1){let _0x307441=_0xb2f405[_0x402f1a];for(var _0x491c17=0x0;_0x491c17<_0x307441['Agents']['length'];_0x491c17+=0x1){let _0x1ab080=_0x307441['Agents'][_0x491c17];var _0x567446=_0xb9aab8['clone']();_0x567446['where'](_0x44a9('0x87'),_0x1ab080['id']);_0x5dca0d[_0x44a9('0x88')](db[_0x44a9('0x89')][_0x44a9('0x46')](_0x567446[_0x44a9('0x8a')](),{'type':db['sequelize'][_0x44a9('0x8b')][_0x44a9('0x8c')]})[_0x44a9('0x37')](function(_0x45e09e){if(_0x45e09e['length']===0x1){return _0x1ab080['id'];}else{var _0x241196=_[_0x44a9('0x8d')](_[_0x44a9('0x45')](_0x45e09e,_0x44a9('0x8e')),function(_0x33ed7c){return _[_0x44a9('0x8f')](_0x3b4167,_0x33ed7c);});if(_0x241196){return _0x1ab080['id'];}}}));}}return BPromise['all'](_0x5dca0d)['then'](function(_0x4b5e4a){_0x598f94=_(_0x598f94)[_0x44a9('0x90')](_0x4b5e4a)['compact']()['value']();return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x5687af['params']['id']}})[_0x44a9('0x37')](function(_0x473c04){return db[_0x44a9('0x89')][_0x44a9('0x79')](function(_0x4f9744){return _0x473c04[_0x44a9('0x91')](_0x5687af[_0x44a9('0x46')][_0x44a9('0x73')],{'transaction':_0x4f9744})[_0x44a9('0x37')](function(){if(!_[_0x44a9('0x92')](_0x598f94)){return _0x473c04['removeAgents'](_0x598f94,{'transaction':_0x4f9744});}})[_0x44a9('0x37')](function(){_0x598f94[_0x44a9('0x7d')](function(_0x2258a4){socket[_0x44a9('0x7e')](_0x44a9('0x93'),{'UserId':_0x2258a4,'ChatQueueId':_0x473c04['id']});});});});});});})['then'](respondWithStatusCode(_0x3280fe,null))[_0x44a9('0x58')](handleError(_0x3280fe,null));};exports['addAgents']=function(_0x162626,_0x2bb33d,_0x8c928e){return db[_0x44a9('0x40')]['find']({'where':{'id':_0x162626[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x2bb33d,null))[_0x44a9('0x37')](function(_0x137387){if(_0x137387){return _0x137387[_0x44a9('0x94')](_0x162626['body'][_0x44a9('0x73')],_['omit'](_0x162626[_0x44a9('0x5e')],['ids','id'])||{})[_0x44a9('0x95')](function(_0x4b7ef1){for(var _0x2abd0c=0x0;_0x2abd0c<_0x162626['body'][_0x44a9('0x73')][_0x44a9('0x4b')];_0x2abd0c+=0x1){socket[_0x44a9('0x7e')]('userChatQueue:save',{'UserId':Number(_0x162626[_0x44a9('0x5e')][_0x44a9('0x73')][_0x2abd0c]),'ChatQueueId':Number(_0x162626[_0x44a9('0x5a')]['id'])});}return _0x4b7ef1;});}})[_0x44a9('0x37')](respondWithResult(_0x2bb33d,null))[_0x44a9('0x58')](handleError(_0x2bb33d,null));};exports['removeAgents']=function(_0x139eaf,_0x53f25c,_0x45541c){return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x139eaf['params']['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x53f25c,null))[_0x44a9('0x37')](function(_0x5f1b5c){if(_0x5f1b5c){return _0x5f1b5c['removeAgents'](_0x139eaf[_0x44a9('0x46')][_0x44a9('0x73')])[_0x44a9('0x37')](function(){if(_[_0x44a9('0x96')](_0x139eaf[_0x44a9('0x46')]['ids'])){for(var _0x5e8e21=0x0;_0x5e8e21<_0x139eaf[_0x44a9('0x46')]['ids']['length'];_0x5e8e21+=0x1){socket['emit'](_0x44a9('0x93'),{'UserId':Number(_0x139eaf[_0x44a9('0x46')][_0x44a9('0x73')][_0x5e8e21]),'ChatQueueId':Number(_0x139eaf[_0x44a9('0x5a')]['id'])});}}else{socket[_0x44a9('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x139eaf[_0x44a9('0x46')]['ids']),'ChatQueueId':Number(_0x139eaf[_0x44a9('0x5a')]['id'])});}});}})[_0x44a9('0x37')](respondWithStatusCode(_0x53f25c,null))['catch'](handleError(_0x53f25c,null));};exports[_0x44a9('0x97')]=function(_0x590953,_0x5d50e5,_0x39ca4f){var _0x37b2b2={};var _0x5257f1={};var _0x12e07c;var _0x18f347;return db['ChatQueue'][_0x44a9('0x68')]({'where':{'id':_0x590953[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x5d50e5,null))[_0x44a9('0x37')](function(_0xc33192){if(_0xc33192){_0x12e07c=_0xc33192;_0x5257f1[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db[_0x44a9('0x80')][_0x44a9('0x41')]);_0x5257f1[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x590953[_0x44a9('0x46')]);_0x5257f1[_0x44a9('0x47')]=_['intersection'](_0x5257f1[_0x44a9('0x44')],_0x5257f1[_0x44a9('0x46')]);_0x37b2b2[_0x44a9('0x49')]=_['intersection'](_0x5257f1['model'],qs[_0x44a9('0x4a')](_0x590953[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x37b2b2['attributes']=_0x37b2b2[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x37b2b2['attributes']:_0x5257f1['model'];_0x37b2b2[_0x44a9('0x6a')]=qs['sort'](_0x590953[_0x44a9('0x46')][_0x44a9('0x4e')]);_0x37b2b2[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x590953[_0x44a9('0x46')],_0x5257f1[_0x44a9('0x47')]));if(_0x590953[_0x44a9('0x46')][_0x44a9('0x51')]){_0x37b2b2[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x37b2b2['where'],{'$or':_['map'](_0x37b2b2[_0x44a9('0x49')],function(_0xecfa){var _0x157193={};_0x157193[_0xecfa]={'$like':'%'+_0x590953[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x157193;})});}_0x37b2b2=_['merge']({},_0x37b2b2,_0x590953['options']);return _0x12e07c[_0x44a9('0x97')](_0x37b2b2);}})[_0x44a9('0x37')](function(_0x360d8c){if(_0x360d8c){_0x18f347=_0x360d8c[_0x44a9('0x4b')];if(!_0x590953[_0x44a9('0x46')][_0x44a9('0x4c')](_0x44a9('0x4d'))){_0x37b2b2[_0x44a9('0x2f')]=qs[_0x44a9('0x2f')](_0x590953[_0x44a9('0x46')][_0x44a9('0x2f')]);_0x37b2b2[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x590953['query'][_0x44a9('0x2e')]);}return _0x12e07c[_0x44a9('0x97')](_0x37b2b2);}})[_0x44a9('0x37')](function(_0x4aaec2){if(_0x4aaec2){return _0x4aaec2?{'count':_0x18f347,'rows':_0x4aaec2}:null;}})['then'](respondWithResult(_0x5d50e5,null))[_0x44a9('0x58')](handleError(_0x5d50e5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8c19dda..6fa9d75 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 _0x7d70=['save','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x45bbe9,_0x5e1882){var _0x38d715=function(_0x32e2be){while(--_0x32e2be){_0x45bbe9['push'](_0x45bbe9['shift']());}};_0x38d715(++_0x5e1882);}(_0x7d70,0x12e));var _0x07d7=function(_0x27de9e,_0x43861a){_0x27de9e=_0x27de9e-0x0;var _0x53be65=_0x7d70[_0x27de9e];return _0x53be65;};'use strict';var EventEmitter=require(_0x07d7('0x0'));var ChatQueue=require(_0x07d7('0x1'))['db'][_0x07d7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x07d7('0x3')](0x0);var events={'afterCreate':_0x07d7('0x4'),'afterUpdate':'update','afterDestroy':_0x07d7('0x5')};function emitEvent(_0x1a1312){return function(_0x26f91c,_0x5ae830,_0x44e7ce){ChatQueueEvents[_0x07d7('0x6')](_0x1a1312+':'+_0x26f91c['id'],_0x26f91c);ChatQueueEvents[_0x07d7('0x6')](_0x1a1312,_0x26f91c);_0x44e7ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x07d7('0x7')](e,emitEvent(event));}}module[_0x07d7('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x64d9=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x33d4da,_0xde8f5f){var _0x3a02fd=function(_0xec26aa){while(--_0xec26aa){_0x33d4da['push'](_0x33d4da['shift']());}};_0x3a02fd(++_0xde8f5f);}(_0x64d9,0x1d9));var _0x964d=function(_0xe6eec0,_0x3fc643){_0xe6eec0=_0xe6eec0-0x0;var _0x1832cf=_0x64d9[_0xe6eec0];return _0x1832cf;};'use strict';var EventEmitter=require(_0x964d('0x0'));var ChatQueue=require(_0x964d('0x1'))['db'][_0x964d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x964d('0x3')](0x0);var events={'afterCreate':_0x964d('0x4'),'afterUpdate':'update','afterDestroy':_0x964d('0x5')};function emitEvent(_0x3bccb1){return function(_0x256240,_0x6ee1f,_0x37fcb6){ChatQueueEvents[_0x964d('0x6')](_0x3bccb1+':'+_0x256240['id'],_0x256240);ChatQueueEvents['emit'](_0x3bccb1,_0x256240);_0x37fcb6(null);};}for(var e in events){if(events[_0x964d('0x7')](e)){var event=events[e];ChatQueue[_0x964d('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0899439..d6075ae 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 _0x558f=['util','../../config/logger','api','moment','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x1eb8ab,_0x17d3d0){var _0x353c9b=function(_0x3b69b0){while(--_0x3b69b0){_0x1eb8ab['push'](_0x1eb8ab['shift']());}};_0x353c9b(++_0x17d3d0);}(_0x558f,0xcb));var _0xf558=function(_0x4fdc01,_0x4101ea){_0x4fdc01=_0x4fdc01-0x0;var _0x5bb876=_0x558f[_0x4fdc01];return _0x5bb876;};'use strict';var _=require(_0xf558('0x0'));var util=require(_0xf558('0x1'));var logger=require(_0xf558('0x2'))(_0xf558('0x3'));var moment=require(_0xf558('0x4'));var BPromise=require('bluebird');var rp=require(_0xf558('0x5'));var fs=require('fs');var path=require(_0xf558('0x6'));var rimraf=require(_0xf558('0x7'));var config=require('../../config/environment');var attributes=require(_0xf558('0x8'));module[_0xf558('0x9')]=function(_0x5c294b,_0x5771a3){return _0x5c294b['define'](_0xf558('0xa'),attributes,{'tableName':_0xf558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f0d=['chat_queues','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./chatQueue.attributes','ChatQueue'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x2f0d,0xd9));var _0xd2f0=function(_0x7d6481,_0x3cedcd){_0x7d6481=_0x7d6481-0x0;var _0x1927f8=_0x2f0d[_0x7d6481];return _0x1927f8;};'use strict';var _=require(_0xd2f0('0x0'));var util=require(_0xd2f0('0x1'));var logger=require(_0xd2f0('0x2'))('api');var moment=require(_0xd2f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd2f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2f0('0x5'));var attributes=require(_0xd2f0('0x6'));module['exports']=function(_0x2c83ea,_0x26d2eb){return _0x2c83ea['define'](_0xd2f0('0x7'),attributes,{'tableName':_0xd2f0('0x8'),'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 f4f8800..888eb5a 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 _0x13cc=['options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x13cc,0x161));var _0xc13c=function(_0x296c1a,_0xa87d73){_0x296c1a=_0x296c1a-0x0;var _0x273bf6=_0x13cc[_0x296c1a];return _0x273bf6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});config[_0xc13c('0x9')]=_[_0xc13c('0xa')](config[_0xc13c('0x9')],{'host':_0xc13c('0xb'),'port':0x18eb});var socket=require(_0xc13c('0xc'))(new Redis(config[_0xc13c('0x9')]));require(_0xc13c('0xd'))['register'](socket);function respondWithRpcPromise(_0x494d38,_0x514064,_0x294739){return new BPromise(function(_0x201daf,_0x3a895e){return client[_0xc13c('0xe')](_0x494d38,_0x294739)[_0xc13c('0xf')](function(_0x4d16f7){logger[_0xc13c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'),JSON[_0xc13c('0x12')](_0x4d16f7));if(_0x4d16f7[_0xc13c('0x13')]){if(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x14')]===0x1f4){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);return _0x3a895e(_0x4d16f7[_0xc13c('0x13')]['message']);}logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')]['message']);return _0x201daf(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);}else{logger[_0xc13c('0x10')](_0xc13c('0x15'),_0x514064,_0xc13c('0x11'));_0x201daf(_0x4d16f7[_0xc13c('0x17')][_0xc13c('0x16')]);}})[_0xc13c('0x18')](function(_0x535808){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x535808);_0x3a895e(_0x535808);});});}exports[_0xc13c('0x19')]=function(_0x59f32c){var _0x455bda=this;return new Promise(function(_0xe1deaf,_0x52bc34){return db['ChatQueue'][_0xc13c('0x1a')]({'raw':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c['options'][_0xc13c('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x59f32c['options']?_0x59f32c['options'][_0xc13c('0x1e')]||null:null,'limit':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1f')]||null:null,'include':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x59f32c[_0xc13c('0x1b')]['include'],function(_0x4abf16){return{'model':db[_0x4abf16[_0xc13c('0x22')]],'as':_0x4abf16['as'],'attributes':_0x4abf16[_0xc13c('0x1e')],'include':_0x4abf16[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x4abf16[_0xc13c('0x20')],function(_0x2a1b98){return{'model':db[_0x2a1b98[_0xc13c('0x22')]],'as':_0x2a1b98['as'],'attributes':_0x2a1b98[_0xc13c('0x1e')],'include':_0x2a1b98[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x2a1b98[_0xc13c('0x20')],function(_0x1b005a){return{'model':db[_0x1b005a['model']],'as':_0x1b005a['as'],'attributes':_0x1b005a[_0xc13c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc13c('0xf')](function(_0x1997f3){logger[_0xc13c('0x10')](_0xc13c('0x19'),_0x59f32c);logger['debug'](_0xc13c('0x19'),_0x59f32c,JSON[_0xc13c('0x12')](_0x1997f3));_0xe1deaf(_0x1997f3);})[_0xc13c('0x18')](function(_0x5b0c18){logger[_0xc13c('0x13')]('GetChatQueue',_0x5b0c18['message'],_0x59f32c);_0x52bc34(_0x455bda[_0xc13c('0x13')](0x1f4,_0x5b0c18[_0xc13c('0x16')]));});});};exports[_0xc13c('0x23')]=function(_0x153f04){var _0x544448=this;return new Promise(function(_0x1a44c4,_0x3958ec){return db['ChatQueue'][_0xc13c('0x24')]({'raw':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1e')]||null:null,'include':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')],function(_0x3552b1){return{'model':db[_0x3552b1[_0xc13c('0x22')]],'as':_0x3552b1['as'],'attributes':_0x3552b1[_0xc13c('0x1e')],'include':_0x3552b1[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x3552b1[_0xc13c('0x20')],function(_0x54a9ed){return{'model':db[_0x54a9ed[_0xc13c('0x22')]],'as':_0x54a9ed['as'],'attributes':_0x54a9ed[_0xc13c('0x1e')],'include':_0x54a9ed[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x54a9ed['include'],function(_0x11f9b9){return{'model':db[_0x11f9b9[_0xc13c('0x22')]],'as':_0x11f9b9['as'],'attributes':_0x11f9b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bb516){logger['info'](_0xc13c('0x23'),_0x153f04);logger[_0xc13c('0x25')]('ShowChatQueue',_0x153f04,JSON[_0xc13c('0x12')](_0x4bb516));_0x1a44c4(_0x4bb516);})[_0xc13c('0x18')](function(_0xf35739){logger[_0xc13c('0x13')]('ShowChatQueue',_0xf35739['message'],_0x153f04);_0x3958ec(_0x544448[_0xc13c('0x13')](0x1f4,_0xf35739['message']));});});}; \ No newline at end of file +var _0xabf9=['ChatQueue','options','raw','limit','include','map','model','attributes','find','ShowChatQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabf9,0x1e4));var _0x9abf=function(_0x57a3e1,_0x32a79a){_0x57a3e1=_0x57a3e1-0x0;var _0x326606=_0xabf9[_0x57a3e1];return _0x326606;};'use strict';var _=require(_0x9abf('0x0'));var util=require(_0x9abf('0x1'));var moment=require(_0x9abf('0x2'));var BPromise=require(_0x9abf('0x3'));var rs=require(_0x9abf('0x4'));var fs=require('fs');var Redis=require(_0x9abf('0x5'));var db=require(_0x9abf('0x6'))['db'];var utils=require(_0x9abf('0x7'));var logger=require(_0x9abf('0x8'))(_0x9abf('0x9'));var config=require(_0x9abf('0xa'));var jayson=require(_0x9abf('0xb'));var client=jayson[_0x9abf('0xc')][_0x9abf('0xd')]({'port':0x232a});config[_0x9abf('0xe')]=_[_0x9abf('0xf')](config[_0x9abf('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x9abf('0x10'))(new Redis(config['redis']));require(_0x9abf('0x11'))[_0x9abf('0x12')](socket);function respondWithRpcPromise(_0x3f9211,_0x4adc94,_0xfe83f1){return new BPromise(function(_0x2cc0e,_0x2f4c97){return client[_0x9abf('0x13')](_0x3f9211,_0xfe83f1)[_0x9abf('0x14')](function(_0x1e2bc0){logger[_0x9abf('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4adc94,_0x9abf('0x16'));logger[_0x9abf('0x17')](_0x9abf('0x18'),_0x4adc94,'request\x20sent',JSON[_0x9abf('0x19')](_0x1e2bc0));if(_0x1e2bc0[_0x9abf('0x1a')]){if(_0x1e2bc0[_0x9abf('0x1a')][_0x9abf('0x1b')]===0x1f4){logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0x1e2bc0['error'][_0x9abf('0x1d')]);return _0x2f4c97(_0x1e2bc0[_0x9abf('0x1a')]['message']);}logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0x1e2bc0['error'][_0x9abf('0x1d')]);return _0x2cc0e(_0x1e2bc0[_0x9abf('0x1a')][_0x9abf('0x1d')]);}else{logger[_0x9abf('0x15')](_0x9abf('0x1c'),_0x4adc94,'request\x20sent');_0x2cc0e(_0x1e2bc0[_0x9abf('0x1e')][_0x9abf('0x1d')]);}})['catch'](function(_0xb47dbd){logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0xb47dbd);_0x2f4c97(_0xb47dbd);});});}exports[_0x9abf('0x1f')]=function(_0x4d0878){var _0x3971c0=this;return new Promise(function(_0x5ba4ab,_0x11e19e){return db[_0x9abf('0x20')]['findAll']({'raw':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x22')]===undefined?!![]:![]:!![],'where':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')]['where']||null:null,'attributes':_0x4d0878['options']?_0x4d0878['options']['attributes']||null:null,'limit':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x23')]||null:null,'include':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x4d0878[_0x9abf('0x21')][_0x9abf('0x24')],function(_0x49bec0){return{'model':db[_0x49bec0[_0x9abf('0x26')]],'as':_0x49bec0['as'],'attributes':_0x49bec0[_0x9abf('0x27')],'include':_0x49bec0[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x49bec0[_0x9abf('0x24')],function(_0x516e02){return{'model':db[_0x516e02['model']],'as':_0x516e02['as'],'attributes':_0x516e02['attributes'],'include':_0x516e02[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x516e02[_0x9abf('0x24')],function(_0x3468cc){return{'model':db[_0x3468cc[_0x9abf('0x26')]],'as':_0x3468cc['as'],'attributes':_0x3468cc[_0x9abf('0x27')]};}):[]};}):[]};}):[]:[]})[_0x9abf('0x14')](function(_0x5422af){logger[_0x9abf('0x15')](_0x9abf('0x1f'),_0x4d0878);logger['debug']('GetChatQueue',_0x4d0878,JSON[_0x9abf('0x19')](_0x5422af));_0x5ba4ab(_0x5422af);})['catch'](function(_0x2db648){logger[_0x9abf('0x1a')](_0x9abf('0x1f'),_0x2db648[_0x9abf('0x1d')],_0x4d0878);_0x11e19e(_0x3971c0[_0x9abf('0x1a')](0x1f4,_0x2db648[_0x9abf('0x1d')]));});});};exports['ShowChatQueue']=function(_0x11461a){var _0x1cad0b=this;return new Promise(function(_0xa926b6,_0x1e4f23){return db[_0x9abf('0x20')][_0x9abf('0x28')]({'raw':_0x11461a[_0x9abf('0x21')]?_0x11461a['options'][_0x9abf('0x22')]===undefined?!![]:![]:!![],'where':_0x11461a[_0x9abf('0x21')]?_0x11461a['options']['where']||null:null,'attributes':_0x11461a[_0x9abf('0x21')]?_0x11461a[_0x9abf('0x21')][_0x9abf('0x27')]||null:null,'include':_0x11461a[_0x9abf('0x21')]?_0x11461a[_0x9abf('0x21')]['include']?_[_0x9abf('0x25')](_0x11461a['options']['include'],function(_0xb01ec7){return{'model':db[_0xb01ec7[_0x9abf('0x26')]],'as':_0xb01ec7['as'],'attributes':_0xb01ec7[_0x9abf('0x27')],'include':_0xb01ec7[_0x9abf('0x24')]?_['map'](_0xb01ec7[_0x9abf('0x24')],function(_0x4a068b){return{'model':db[_0x4a068b['model']],'as':_0x4a068b['as'],'attributes':_0x4a068b['attributes'],'include':_0x4a068b[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x4a068b[_0x9abf('0x24')],function(_0x27c66f){return{'model':db[_0x27c66f[_0x9abf('0x26')]],'as':_0x27c66f['as'],'attributes':_0x27c66f[_0x9abf('0x27')]};}):[]};}):[]};}):[]:[]})[_0x9abf('0x14')](function(_0x22e75f){logger[_0x9abf('0x15')](_0x9abf('0x29'),_0x11461a);logger['debug'](_0x9abf('0x29'),_0x11461a,JSON['stringify'](_0x22e75f));_0xa926b6(_0x22e75f);})[_0x9abf('0x2a')](function(_0x2e7aad){logger[_0x9abf('0x1a')]('ShowChatQueue',_0x2e7aad[_0x9abf('0x1d')],_0x11461a);_0x1e4f23(_0x1cad0b[_0x9abf('0x1a')](0x1f4,_0x2e7aad['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b39e2d0..97adb0b 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 _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x34f19f,_0x41209e){var _0x304ec8=function(_0x4fb45e){while(--_0x4fb45e){_0x34f19f['push'](_0x34f19f['shift']());}};_0x304ec8(++_0x41209e);}(_0x9b67,0xf6));var _0x79b6=function(_0x7f69d7,_0x1b57f1){_0x7f69d7=_0x7f69d7-0x0;var _0x5c8667=_0x9b67[_0x7f69d7];return _0x5c8667;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}}; \ No newline at end of file +var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x51fd91,_0x1a2311){var _0x2e3a30=function(_0x1f4a3d){while(--_0x1f4a3d){_0x51fd91['push'](_0x51fd91['shift']());}};_0x2e3a30(++_0x1a2311);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 211484c..8759eca 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(_0x1f9c4b,_0x3cad26){var _0xf2c727=function(_0x6bd900){while(--_0x6bd900){_0x1f9c4b['push'](_0x1f9c4b['shift']());}};_0xf2c727(++_0x3cad26);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x57dbce,_0x2a4604){var _0x2ab396=function(_0x321f80){while(--_0x321f80){_0x57dbce['push'](_0x57dbce['shift']());}};_0x2ab396(++_0x2a4604);}(_0x55ca,0x126));var _0xa55c=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x55ca[_0x8b8564];return _0x360c61;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 4e93913..781a3e3 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 _0xca60=['exports','STRING','DATE','moment'];(function(_0x31fcfc,_0x1a1cfc){var _0x535b8d=function(_0x557443){while(--_0x557443){_0x31fcfc['push'](_0x31fcfc['shift']());}};_0x535b8d(++_0x1a1cfc);}(_0xca60,0xef));var _0x0ca6=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0xca60[_0x3a7db0];return _0x17cbba;};'use strict';var moment=require(_0x0ca6('0x0'));var Sequelize=require('sequelize');module[_0x0ca6('0x1')]={'uniqueid':{'type':Sequelize[_0x0ca6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0ca6('0x2')]},'joinAt':{'type':Sequelize[_0x0ca6('0x3')]},'leaveAt':{'type':Sequelize[_0x0ca6('0x3')]},'acceptAt':{'type':Sequelize[_0x0ca6('0x3')]},'exitAt':{'type':Sequelize[_0x0ca6('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x03d3=['DATE','STRING','sequelize','exports'];(function(_0x4557c8,_0x28e59f){var _0x3b066c=function(_0x20656c){while(--_0x20656c){_0x4557c8['push'](_0x4557c8['shift']());}};_0x3b066c(++_0x28e59f);}(_0x03d3,0x6e));var _0x303d=function(_0x5b87e3,_0x30d76e){_0x5b87e3=_0x5b87e3-0x0;var _0xe1f682=_0x03d3[_0x5b87e3];return _0xe1f682;};'use strict';var moment=require('moment');var Sequelize=require(_0x303d('0x0'));module[_0x303d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x303d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x303d('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x303d('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 11ea10a..cfa6a56 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 _0x8be8=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','describe','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x8be8,0xf6));var _0x88be=function(_0x45b8ca,_0x361efb){_0x45b8ca=_0x45b8ca-0x0;var _0x589fb8=_0x8be8[_0x45b8ca];return _0x589fb8;};'use strict';var emlformat=require(_0x88be('0x0'));var rimraf=require(_0x88be('0x1'));var zipdir=require(_0x88be('0x2'));var jsonpatch=require(_0x88be('0x3'));var rp=require(_0x88be('0x4'));var moment=require(_0x88be('0x5'));var BPromise=require(_0x88be('0x6'));var Mustache=require(_0x88be('0x7'));var util=require(_0x88be('0x8'));var path=require('path');var sox=require(_0x88be('0x9'));var csv=require('to-csv');var ejs=require(_0x88be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88be('0xb'));var squel=require(_0x88be('0xc'));var crypto=require(_0x88be('0xd'));var jsforce=require(_0x88be('0xe'));var deskjs=require(_0x88be('0xf'));var toCsv=require(_0x88be('0x10'));var querystring=require('querystring');var Papa=require(_0x88be('0x11'));var Redis=require('ioredis');var authService=require(_0x88be('0x12'));var qs=require(_0x88be('0x13'));var as=require(_0x88be('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88be('0x15'))(_0x88be('0x16'));var utils=require(_0x88be('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321775,_0x484d78){_0x484d78=_0x484d78||0xcc;return function(_0x51ee23){if(_0x51ee23){return _0x321775[_0x88be('0x19')](_0x484d78);}return _0x321775[_0x88be('0x1a')](_0x484d78)[_0x88be('0x1b')]();};}function respondWithResult(_0x220d9f,_0x1f6f57){_0x1f6f57=_0x1f6f57||0xc8;return function(_0x209623){if(_0x209623){return _0x220d9f[_0x88be('0x1a')](_0x1f6f57)[_0x88be('0x1c')](_0x209623);}};}function respondWithFilteredResult(_0x4ec7cc,_0xefc67){return function(_0x94737d){if(_0x94737d){var _0x44a12f=typeof _0xefc67['offset']===_0x88be('0x1d')&&typeof _0xefc67[_0x88be('0x1e')]==='undefined';var _0x3566e7=_0x94737d[_0x88be('0x1f')];var _0xf43785=_0x44a12f?0x0:_0xefc67[_0x88be('0x20')];var _0x152918=_0x44a12f?_0x94737d[_0x88be('0x1f')]:_0xefc67[_0x88be('0x20')]+_0xefc67[_0x88be('0x1e')];var _0x53fb85;if(_0x152918>=_0x3566e7){_0x152918=_0x3566e7;_0x53fb85=0xc8;}else{_0x53fb85=0xce;}_0x4ec7cc[_0x88be('0x1a')](_0x53fb85);return _0x4ec7cc['set'](_0x88be('0x21'),_0xf43785+'-'+_0x152918+'/'+_0x3566e7)['json'](_0x94737d);}return null;};}function patchUpdates(_0x51c0e4){return function(_0x2fd77d){try{jsonpatch[_0x88be('0x22')](_0x2fd77d,_0x51c0e4,!![]);}catch(_0x4079f7){return BPromise['reject'](_0x4079f7);}return _0x2fd77d[_0x88be('0x23')]();};}function saveUpdates(_0x332e50,_0x1d0414){return function(_0x213580){if(_0x213580){return _0x213580[_0x88be('0x24')](_0x332e50)[_0x88be('0x25')](function(_0x466b19){return _0x466b19;});}return null;};}function removeEntity(_0x344c20,_0xdd27c1){return function(_0x215024){if(_0x215024){return _0x215024[_0x88be('0x26')]()[_0x88be('0x25')](function(){_0x344c20[_0x88be('0x1a')](0xcc)[_0x88be('0x1b')]();});}};}function handleEntityNotFound(_0x1c3e45,_0x2be310){return function(_0x5c1671){if(!_0x5c1671){_0x1c3e45[_0x88be('0x19')](0x194);}return _0x5c1671;};}function handleError(_0x1c9be2,_0x20c9de){_0x20c9de=_0x20c9de||0x1f4;return function(_0x58b671){logger[_0x88be('0x27')](_0x58b671[_0x88be('0x28')]);if(_0x58b671[_0x88be('0x29')]){delete _0x58b671[_0x88be('0x29')];}_0x1c9be2[_0x88be('0x1a')](_0x20c9de)['send'](_0x58b671);};}exports[_0x88be('0x2a')]=function(_0x48f6a0,_0x3dc88a){var _0x537c0b={},_0x3a08fa={},_0x2fe023={'count':0x0,'rows':[]};var _0x1af670=_[_0x88be('0x2b')](db[_0x88be('0x2c')][_0x88be('0x2d')],function(_0x3180a5){return{'name':_0x3180a5[_0x88be('0x2e')],'type':_0x3180a5[_0x88be('0x2f')]['key']};});_0x3a08fa[_0x88be('0x30')]=_[_0x88be('0x2b')](_0x1af670,_0x88be('0x29'));_0x3a08fa[_0x88be('0x31')]=_[_0x88be('0x32')](_0x48f6a0[_0x88be('0x31')]);_0x3a08fa[_0x88be('0x33')]=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],_0x3a08fa['query']);_0x537c0b['attributes']=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],qs[_0x88be('0x35')](_0x48f6a0['query']['fields']));_0x537c0b[_0x88be('0x36')]=_0x537c0b['attributes'][_0x88be('0x37')]?_0x537c0b['attributes']:_0x3a08fa[_0x88be('0x30')];if(!_0x48f6a0[_0x88be('0x31')][_0x88be('0x38')](_0x88be('0x39'))){_0x537c0b[_0x88be('0x1e')]=qs[_0x88be('0x1e')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x1e')]);_0x537c0b[_0x88be('0x20')]=qs[_0x88be('0x20')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x20')]);}_0x537c0b[_0x88be('0x3a')]=qs[_0x88be('0x3b')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x3b')]);_0x537c0b[_0x88be('0x3c')]=qs[_0x88be('0x33')](_[_0x88be('0x3d')](_0x48f6a0[_0x88be('0x31')],_0x3a08fa[_0x88be('0x33')]),_0x1af670);if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]){_0x537c0b[_0x88be('0x3c')]=_['merge'](_0x537c0b['where'],{'$or':_['map'](_0x1af670,function(_0x32d763){if(_0x32d763['type']!==_0x88be('0x3f')){var _0x3e7fdf={};_0x3e7fdf[_0x32d763[_0x88be('0x29')]]={'$like':'%'+_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]+'%'};return _0x3e7fdf;}})});}_0x537c0b=_[_0x88be('0x40')]({},_0x537c0b,_0x48f6a0[_0x88be('0x41')]);var _0x4bec59={'where':_0x537c0b['where']};return db[_0x88be('0x2c')][_0x88be('0x1f')](_0x4bec59)[_0x88be('0x25')](function(_0x63b253){_0x2fe023['count']=_0x63b253;if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x42')]){_0x537c0b[_0x88be('0x43')]=[{'all':!![]}];}return db[_0x88be('0x2c')]['findAll'](_0x537c0b);})[_0x88be('0x25')](function(_0x429f7b){_0x2fe023[_0x88be('0x44')]=_0x429f7b;return _0x2fe023;})[_0x88be('0x25')](respondWithFilteredResult(_0x3dc88a,_0x537c0b))[_0x88be('0x45')](handleError(_0x3dc88a,null));};exports[_0x88be('0x46')]=function(_0x6da13f,_0x1514d2){var _0x1dc5b4={'raw':!![],'where':{'id':_0x6da13f[_0x88be('0x47')]['id']}},_0x5261d7={};_0x5261d7['model']=_['keys'](db[_0x88be('0x2c')][_0x88be('0x2d')]);_0x5261d7[_0x88be('0x31')]=_[_0x88be('0x32')](_0x6da13f['query']);_0x5261d7[_0x88be('0x33')]=_[_0x88be('0x34')](_0x5261d7[_0x88be('0x30')],_0x5261d7[_0x88be('0x31')]);_0x1dc5b4[_0x88be('0x36')]=_['intersection'](_0x5261d7[_0x88be('0x30')],qs[_0x88be('0x35')](_0x6da13f['query'][_0x88be('0x35')]));_0x1dc5b4['attributes']=_0x1dc5b4[_0x88be('0x36')]['length']?_0x1dc5b4[_0x88be('0x36')]:_0x5261d7[_0x88be('0x30')];if(_0x6da13f['query'][_0x88be('0x42')]){_0x1dc5b4[_0x88be('0x43')]=[{'all':!![]}];}_0x1dc5b4=_[_0x88be('0x40')]({},_0x1dc5b4,_0x6da13f[_0x88be('0x41')]);return db[_0x88be('0x2c')][_0x88be('0x48')](_0x1dc5b4)['then'](handleEntityNotFound(_0x1514d2,null))['then'](respondWithResult(_0x1514d2,null))[_0x88be('0x45')](handleError(_0x1514d2,null));};exports[_0x88be('0x49')]=function(_0x1c6c8f,_0x18d1db){return db[_0x88be('0x2c')][_0x88be('0x49')](_0x1c6c8f['body'],{})['then'](respondWithResult(_0x18d1db,0xc9))[_0x88be('0x45')](handleError(_0x18d1db,null));};exports[_0x88be('0x24')]=function(_0xf60d87,_0x174488){if(_0xf60d87['body']['id']){delete _0xf60d87['body']['id'];}return db[_0x88be('0x2c')]['find']({'where':{'id':_0xf60d87[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x174488,null))[_0x88be('0x25')](saveUpdates(_0xf60d87['body'],null))[_0x88be('0x25')](respondWithResult(_0x174488,null))[_0x88be('0x45')](handleError(_0x174488,null));};exports['destroy']=function(_0x3dc85b,_0x582efa){return db[_0x88be('0x2c')]['find']({'where':{'id':_0x3dc85b[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x582efa,null))[_0x88be('0x25')](removeEntity(_0x582efa,null))[_0x88be('0x45')](handleError(_0x582efa,null));};exports[_0x88be('0x4a')]=function(_0x44577f,_0x33d797){return db[_0x88be('0x2c')]['describe']()[_0x88be('0x25')](respondWithResult(_0x33d797,null))[_0x88be('0x45')](handleError(_0x33d797,null));}; \ No newline at end of file +var _0x7c1a=['reject','then','destroy','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x28e21f,_0x55b8b9){var _0x343599=function(_0x257007){while(--_0x257007){_0x28e21f['push'](_0x28e21f['shift']());}};_0x343599(++_0x55b8b9);}(_0x7c1a,0x159));var _0xa7c1=function(_0x69102e,_0xa8fb8a){_0x69102e=_0x69102e-0x0;var _0x592209=_0x7c1a[_0x69102e];return _0x592209;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];function respondWithStatusCode(_0x1d7d67,_0x26d63a){_0x26d63a=_0x26d63a||0xcc;return function(_0x3f5f02){if(_0x3f5f02){return _0x1d7d67[_0xa7c1('0x18')](_0x26d63a);}return _0x1d7d67[_0xa7c1('0x19')](_0x26d63a)[_0xa7c1('0x1a')]();};}function respondWithResult(_0xb74ba2,_0x3fc9e6){_0x3fc9e6=_0x3fc9e6||0xc8;return function(_0x21ce41){if(_0x21ce41){return _0xb74ba2[_0xa7c1('0x19')](_0x3fc9e6)[_0xa7c1('0x1b')](_0x21ce41);}};}function respondWithFilteredResult(_0xe28779,_0x5a0c8e){return function(_0xba02b){if(_0xba02b){var _0x3a6f47=typeof _0x5a0c8e[_0xa7c1('0x1c')]===_0xa7c1('0x1d')&&typeof _0x5a0c8e[_0xa7c1('0x1e')]==='undefined';var _0x3b77af=_0xba02b['count'];var _0x440251=_0x3a6f47?0x0:_0x5a0c8e[_0xa7c1('0x1c')];var _0x5dc8e3=_0x3a6f47?_0xba02b[_0xa7c1('0x1f')]:_0x5a0c8e[_0xa7c1('0x1c')]+_0x5a0c8e[_0xa7c1('0x1e')];var _0x5d3841;if(_0x5dc8e3>=_0x3b77af){_0x5dc8e3=_0x3b77af;_0x5d3841=0xc8;}else{_0x5d3841=0xce;}_0xe28779[_0xa7c1('0x19')](_0x5d3841);return _0xe28779[_0xa7c1('0x20')](_0xa7c1('0x21'),_0x440251+'-'+_0x5dc8e3+'/'+_0x3b77af)[_0xa7c1('0x1b')](_0xba02b);}return null;};}function patchUpdates(_0x3b131e){return function(_0x31c16a){try{jsonpatch[_0xa7c1('0x22')](_0x31c16a,_0x3b131e,!![]);}catch(_0xdfcbd9){return BPromise[_0xa7c1('0x23')](_0xdfcbd9);}return _0x31c16a['save']();};}function saveUpdates(_0x42ad46,_0x1c9b7c){return function(_0x1ebcdd){if(_0x1ebcdd){return _0x1ebcdd['update'](_0x42ad46)[_0xa7c1('0x24')](function(_0x7dbe77){return _0x7dbe77;});}return null;};}function removeEntity(_0x43d61f,_0x2dc42b){return function(_0x30cb15){if(_0x30cb15){return _0x30cb15[_0xa7c1('0x25')]()[_0xa7c1('0x24')](function(){_0x43d61f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48280a,_0x1ea97e){return function(_0x40c478){if(!_0x40c478){_0x48280a[_0xa7c1('0x18')](0x194);}return _0x40c478;};}function handleError(_0x153b1a,_0x94884d){_0x94884d=_0x94884d||0x1f4;return function(_0x5d62cb){logger['error'](_0x5d62cb[_0xa7c1('0x26')]);if(_0x5d62cb[_0xa7c1('0x27')]){delete _0x5d62cb[_0xa7c1('0x27')];}_0x153b1a['status'](_0x94884d)[_0xa7c1('0x28')](_0x5d62cb);};}exports[_0xa7c1('0x29')]=function(_0x2fe45b,_0xa8a937){var _0x635792={},_0x1cc05c={},_0x302b2f={'count':0x0,'rows':[]};var _0x796ed1=_[_0xa7c1('0x2a')](db[_0xa7c1('0x2b')]['rawAttributes'],function(_0x6b764d){return{'name':_0x6b764d[_0xa7c1('0x2c')],'type':_0x6b764d[_0xa7c1('0x2d')][_0xa7c1('0x2e')]};});_0x1cc05c[_0xa7c1('0x2f')]=_[_0xa7c1('0x2a')](_0x796ed1,_0xa7c1('0x27'));_0x1cc05c[_0xa7c1('0x30')]=_[_0xa7c1('0x31')](_0x2fe45b['query']);_0x1cc05c[_0xa7c1('0x32')]=_[_0xa7c1('0x33')](_0x1cc05c[_0xa7c1('0x2f')],_0x1cc05c[_0xa7c1('0x30')]);_0x635792['attributes']=_['intersection'](_0x1cc05c[_0xa7c1('0x2f')],qs[_0xa7c1('0x34')](_0x2fe45b[_0xa7c1('0x30')]['fields']));_0x635792['attributes']=_0x635792[_0xa7c1('0x35')][_0xa7c1('0x36')]?_0x635792['attributes']:_0x1cc05c[_0xa7c1('0x2f')];if(!_0x2fe45b['query'][_0xa7c1('0x37')]('nolimit')){_0x635792[_0xa7c1('0x1e')]=qs[_0xa7c1('0x1e')](_0x2fe45b['query']['limit']);_0x635792[_0xa7c1('0x1c')]=qs[_0xa7c1('0x1c')](_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x1c')]);}_0x635792[_0xa7c1('0x38')]=qs[_0xa7c1('0x39')](_0x2fe45b[_0xa7c1('0x30')]['sort']);_0x635792[_0xa7c1('0x3a')]=qs[_0xa7c1('0x32')](_[_0xa7c1('0x3b')](_0x2fe45b[_0xa7c1('0x30')],_0x1cc05c[_0xa7c1('0x32')]),_0x796ed1);if(_0x2fe45b[_0xa7c1('0x30')]['filter']){_0x635792[_0xa7c1('0x3a')]=_[_0xa7c1('0x3c')](_0x635792[_0xa7c1('0x3a')],{'$or':_[_0xa7c1('0x2a')](_0x796ed1,function(_0x2039f0){if(_0x2039f0[_0xa7c1('0x2d')]!==_0xa7c1('0x3d')){var _0xff58c3={};_0xff58c3[_0x2039f0['name']]={'$like':'%'+_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x3e')]+'%'};return _0xff58c3;}})});}_0x635792=_[_0xa7c1('0x3c')]({},_0x635792,_0x2fe45b[_0xa7c1('0x3f')]);var _0x2bfcd0={'where':_0x635792[_0xa7c1('0x3a')]};return db[_0xa7c1('0x2b')][_0xa7c1('0x1f')](_0x2bfcd0)[_0xa7c1('0x24')](function(_0x364dcd){_0x302b2f[_0xa7c1('0x1f')]=_0x364dcd;if(_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x40')]){_0x635792[_0xa7c1('0x41')]=[{'all':!![]}];}return db[_0xa7c1('0x2b')][_0xa7c1('0x42')](_0x635792);})[_0xa7c1('0x24')](function(_0x4c0ef7){_0x302b2f[_0xa7c1('0x43')]=_0x4c0ef7;return _0x302b2f;})[_0xa7c1('0x24')](respondWithFilteredResult(_0xa8a937,_0x635792))['catch'](handleError(_0xa8a937,null));};exports[_0xa7c1('0x44')]=function(_0x2368b2,_0x46d759){var _0x8b76c2={'raw':!![],'where':{'id':_0x2368b2[_0xa7c1('0x45')]['id']}},_0x4a43c1={};_0x4a43c1['model']=_['keys'](db[_0xa7c1('0x2b')][_0xa7c1('0x46')]);_0x4a43c1[_0xa7c1('0x30')]=_[_0xa7c1('0x31')](_0x2368b2[_0xa7c1('0x30')]);_0x4a43c1['filters']=_[_0xa7c1('0x33')](_0x4a43c1[_0xa7c1('0x2f')],_0x4a43c1[_0xa7c1('0x30')]);_0x8b76c2['attributes']=_['intersection'](_0x4a43c1[_0xa7c1('0x2f')],qs[_0xa7c1('0x34')](_0x2368b2['query'][_0xa7c1('0x34')]));_0x8b76c2[_0xa7c1('0x35')]=_0x8b76c2[_0xa7c1('0x35')][_0xa7c1('0x36')]?_0x8b76c2[_0xa7c1('0x35')]:_0x4a43c1['model'];if(_0x2368b2[_0xa7c1('0x30')][_0xa7c1('0x40')]){_0x8b76c2[_0xa7c1('0x41')]=[{'all':!![]}];}_0x8b76c2=_[_0xa7c1('0x3c')]({},_0x8b76c2,_0x2368b2[_0xa7c1('0x3f')]);return db['ChatQueueReport'][_0xa7c1('0x47')](_0x8b76c2)[_0xa7c1('0x24')](handleEntityNotFound(_0x46d759,null))[_0xa7c1('0x24')](respondWithResult(_0x46d759,null))[_0xa7c1('0x48')](handleError(_0x46d759,null));};exports[_0xa7c1('0x49')]=function(_0x2672c3,_0x5180af){return db[_0xa7c1('0x2b')][_0xa7c1('0x49')](_0x2672c3[_0xa7c1('0x4a')],{})[_0xa7c1('0x24')](respondWithResult(_0x5180af,0xc9))['catch'](handleError(_0x5180af,null));};exports['update']=function(_0x33e535,_0x4b8da7){if(_0x33e535[_0xa7c1('0x4a')]['id']){delete _0x33e535[_0xa7c1('0x4a')]['id'];}return db[_0xa7c1('0x2b')]['find']({'where':{'id':_0x33e535[_0xa7c1('0x45')]['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x4b8da7,null))['then'](saveUpdates(_0x33e535['body'],null))[_0xa7c1('0x24')](respondWithResult(_0x4b8da7,null))[_0xa7c1('0x48')](handleError(_0x4b8da7,null));};exports[_0xa7c1('0x25')]=function(_0x4b58bb,_0x12d60c){return db[_0xa7c1('0x2b')][_0xa7c1('0x47')]({'where':{'id':_0x4b58bb[_0xa7c1('0x45')]['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x12d60c,null))['then'](removeEntity(_0x12d60c,null))['catch'](handleError(_0x12d60c,null));};exports[_0xa7c1('0x4b')]=function(_0x3838d8,_0x518200){return db['ChatQueueReport'][_0xa7c1('0x4b')]()[_0xa7c1('0x24')](respondWithResult(_0x518200,null))['catch'](handleError(_0x518200,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index bdb3b58..a870f75 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x409d93,_0x205e56){var _0x22eaa9=function(_0x51001e){while(--_0x51001e){_0x409d93['push'](_0x409d93['shift']());}};_0x22eaa9(++_0x205e56);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xcb91[_0x273dc5];return _0x46dae7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x18e124,_0x5ca114){var _0x2f335a=function(_0x2d752e){while(--_0x2d752e){_0x18e124['push'](_0x18e124['shift']());}};_0x2f335a(++_0x5ca114);}(_0xe706,0xa3));var _0x6e70=function(_0x12fde3,_0x4800c6){_0x12fde3=_0x12fde3-0x0;var _0x521038=_0xe706[_0x12fde3];return _0x521038;};'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/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d2d35d6..c5a6347 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 _0xff84=['UpdateChatQueueReport','body','where','attributes','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','options','raw','debug','CreateChatQueueReport'];(function(_0x5ea512,_0x2c0faa){var _0x5ab27b=function(_0x2ba725){while(--_0x2ba725){_0x5ea512['push'](_0x5ea512['shift']());}};_0x5ab27b(++_0x2c0faa);}(_0xff84,0x13a));var _0x4ff8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xff84[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4ff8('0x0'));var rs=require(_0x4ff8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ff8('0x2'))['db'];var utils=require(_0x4ff8('0x3'));var logger=require(_0x4ff8('0x4'))(_0x4ff8('0x5'));var config=require(_0x4ff8('0x6'));var jayson=require(_0x4ff8('0x7'));var client=jayson[_0x4ff8('0x8')][_0x4ff8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6ab909,_0x940bd2,_0x18d074){return new BPromise(function(_0x2afdeb,_0x11e927){return client['request'](_0x6ab909,_0x18d074)[_0x4ff8('0xa')](function(_0x9ce9b3){logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,_0x4ff8('0xd'));logger['debug'](_0x4ff8('0xe'),_0x940bd2,_0x4ff8('0xd'),JSON[_0x4ff8('0xf')](_0x9ce9b3));if(_0x9ce9b3[_0x4ff8('0x10')]){if(_0x9ce9b3['error'][_0x4ff8('0x11')]===0x1f4){logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3[_0x4ff8('0x10')][_0x4ff8('0x12')]);return _0x11e927(_0x9ce9b3[_0x4ff8('0x10')]['message']);}logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3['error'][_0x4ff8('0x12')]);return _0x2afdeb(_0x9ce9b3['error'][_0x4ff8('0x12')]);}else{logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,'request\x20sent');_0x2afdeb(_0x9ce9b3[_0x4ff8('0x13')][_0x4ff8('0x12')]);}})[_0x4ff8('0x14')](function(_0x9d03e6){logger['error'](_0x4ff8('0xc'),_0x940bd2,_0x9d03e6);_0x11e927(_0x9d03e6);});});}exports['CreateChatQueueReport']=function(_0x418d03){var _0x4f17c0=this;return new Promise(function(_0x5baebc,_0x5238c5){return db[_0x4ff8('0x15')][_0x4ff8('0x16')](_0x418d03['body'],{'raw':_0x418d03[_0x4ff8('0x17')]?_0x418d03['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![]})[_0x4ff8('0xa')](function(_0x5bce72){logger[_0x4ff8('0xb')]('CreateChatQueueReport',_0x418d03);logger[_0x4ff8('0x19')](_0x4ff8('0x1a'),_0x418d03,JSON['stringify'](_0x5bce72));_0x5baebc(_0x5bce72);})[_0x4ff8('0x14')](function(_0x3e0d1b){logger[_0x4ff8('0x10')]('CreateChatQueueReport',_0x3e0d1b[_0x4ff8('0x12')],_0x418d03);_0x5238c5(_0x4f17c0[_0x4ff8('0x10')](0x1f4,_0x3e0d1b['message']));});});};exports[_0x4ff8('0x1b')]=function(_0x5f3b6f){var _0x279b73=this;return new Promise(function(_0x3093f3,_0x552f45){return db[_0x4ff8('0x15')]['update'](_0x5f3b6f[_0x4ff8('0x1c')],{'raw':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3b6f['options']?_0x5f3b6f['options'][_0x4ff8('0x1d')]||null:null,'attributes':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f[_0x4ff8('0x17')][_0x4ff8('0x1e')]||null:null,'limit':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options']['limit']||null:null})['then'](function(_0x5955d4){logger[_0x4ff8('0xb')](_0x4ff8('0x1b'),_0x5f3b6f);logger[_0x4ff8('0x19')](_0x4ff8('0x1b'),_0x5f3b6f,JSON['stringify'](_0x5955d4));_0x3093f3(_0x5955d4);})['catch'](function(_0x41c8b9){logger['error'](_0x4ff8('0x1b'),_0x41c8b9['message'],_0x5f3b6f);_0x552f45(_0x279b73[_0x4ff8('0x10')](0x1f4,_0x41c8b9[_0x4ff8('0x12')]));});});}; \ No newline at end of file +var _0xc989=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0xc989,0x113));var _0x9c98=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc989[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9c98('0x0'));var util=require(_0x9c98('0x1'));var moment=require(_0x9c98('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c98('0x3'));var fs=require('fs');var Redis=require(_0x9c98('0x4'));var db=require(_0x9c98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c98('0x6'))(_0x9c98('0x7'));var config=require(_0x9c98('0x8'));var jayson=require(_0x9c98('0x9'));var client=jayson[_0x9c98('0xa')][_0x9c98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x193bc0,_0x577cf4,_0xadf494){return new BPromise(function(_0x4dfac2,_0x39ccfa){return client['request'](_0x193bc0,_0xadf494)[_0x9c98('0xc')](function(_0xe11771){logger[_0x9c98('0xd')](_0x9c98('0xe'),_0x577cf4,_0x9c98('0xf'));logger[_0x9c98('0x10')](_0x9c98('0x11'),_0x577cf4,_0x9c98('0xf'),JSON[_0x9c98('0x12')](_0xe11771));if(_0xe11771['error']){if(_0xe11771['error'][_0x9c98('0x13')]===0x1f4){logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0xe11771[_0x9c98('0x14')]['message']);return _0x39ccfa(_0xe11771[_0x9c98('0x14')][_0x9c98('0x15')]);}logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0xe11771['error'][_0x9c98('0x15')]);return _0x4dfac2(_0xe11771[_0x9c98('0x14')]['message']);}else{logger[_0x9c98('0xd')](_0x9c98('0xe'),_0x577cf4,'request\x20sent');_0x4dfac2(_0xe11771[_0x9c98('0x16')][_0x9c98('0x15')]);}})['catch'](function(_0x2236d6){logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0x2236d6);_0x39ccfa(_0x2236d6);});});}exports[_0x9c98('0x17')]=function(_0x2a1931){var _0x3a0f64=this;return new Promise(function(_0x24da48,_0x3b2d6d){return db[_0x9c98('0x18')][_0x9c98('0x19')](_0x2a1931['body'],{'raw':_0x2a1931[_0x9c98('0x1a')]?_0x2a1931[_0x9c98('0x1a')][_0x9c98('0x1b')]===undefined?!![]:![]:!![]})[_0x9c98('0xc')](function(_0xecf7e9){logger[_0x9c98('0xd')](_0x9c98('0x17'),_0x2a1931);logger['debug'](_0x9c98('0x17'),_0x2a1931,JSON[_0x9c98('0x12')](_0xecf7e9));_0x24da48(_0xecf7e9);})[_0x9c98('0x1c')](function(_0xf8f933){logger[_0x9c98('0x14')](_0x9c98('0x17'),_0xf8f933['message'],_0x2a1931);_0x3b2d6d(_0x3a0f64[_0x9c98('0x14')](0x1f4,_0xf8f933[_0x9c98('0x15')]));});});};exports[_0x9c98('0x1d')]=function(_0x1cb15d){var _0x13b08e=this;return new Promise(function(_0x293e20,_0x59b70e){return db[_0x9c98('0x18')][_0x9c98('0x1e')](_0x1cb15d[_0x9c98('0x1f')],{'raw':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d['options'][_0x9c98('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d['options'][_0x9c98('0x20')]||null:null,'attributes':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d[_0x9c98('0x1a')][_0x9c98('0x21')]||null:null,'limit':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d[_0x9c98('0x1a')][_0x9c98('0x22')]||null:null})[_0x9c98('0xc')](function(_0x7816b7){logger[_0x9c98('0xd')](_0x9c98('0x1d'),_0x1cb15d);logger[_0x9c98('0x10')]('UpdateChatQueueReport',_0x1cb15d,JSON[_0x9c98('0x12')](_0x7816b7));_0x293e20(_0x7816b7);})[_0x9c98('0x1c')](function(_0x45d10b){logger[_0x9c98('0x14')](_0x9c98('0x1d'),_0x45d10b[_0x9c98('0x15')],_0x1cb15d);_0x59b70e(_0x13b08e[_0x9c98('0x14')](0x1f4,_0x45d10b[_0x9c98('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index dbb06a1..701fb0c 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 _0xbbf5=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','create','put','/:id','update','destroy','util','path'];(function(_0x3a5c6a,_0x290dd1){var _0x4ac43a=function(_0x368a85){while(--_0x368a85){_0x3a5c6a['push'](_0x3a5c6a['shift']());}};_0x4ac43a(++_0x290dd1);}(_0xbbf5,0xee));var _0x5bbf=function(_0x16206e,_0x2019fe){_0x16206e=_0x16206e-0x0;var _0x1feede=_0xbbf5[_0x16206e];return _0x1feede;};'use strict';var multer=require('multer');var util=require(_0x5bbf('0x0'));var path=require(_0x5bbf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5bbf('0x2')]();var fs_extra=require(_0x5bbf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5bbf('0x4'));var config=require(_0x5bbf('0x5'));var controller=require('./chatQueueReport.controller');router[_0x5bbf('0x6')]('/',auth[_0x5bbf('0x7')](),controller['index']);router['get'](_0x5bbf('0x8'),auth[_0x5bbf('0x7')](),controller['describe']);router[_0x5bbf('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5bbf('0x9')]);router[_0x5bbf('0xa')]('/',auth['isAuthenticated'](),controller[_0x5bbf('0xb')]);router[_0x5bbf('0xc')](_0x5bbf('0xd'),auth[_0x5bbf('0x7')](),controller[_0x5bbf('0xe')]);router['delete'](_0x5bbf('0xd'),auth['isAuthenticated'](),controller[_0x5bbf('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcc64=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','./chatQueueReport.controller'];(function(_0x1cb577,_0x4f5bbb){var _0xd59f51=function(_0x2cab03){while(--_0x2cab03){_0x1cb577['push'](_0x1cb577['shift']());}};_0xd59f51(++_0x4f5bbb);}(_0xcc64,0xae));var _0x4cc6=function(_0x232e93,_0x4afb1c){_0x232e93=_0x232e93-0x0;var _0x2c5f30=_0xcc64[_0x232e93];return _0x2c5f30;};'use strict';var multer=require('multer');var util=require(_0x4cc6('0x0'));var path=require(_0x4cc6('0x1'));var timeout=require('connect-timeout');var express=require(_0x4cc6('0x2'));var router=express['Router']();var fs_extra=require(_0x4cc6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4cc6('0x4'));var config=require('../../config/environment');var controller=require(_0x4cc6('0x5'));router[_0x4cc6('0x6')]('/',auth[_0x4cc6('0x7')](),controller[_0x4cc6('0x8')]);router['get'](_0x4cc6('0x9'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0xa')]);router[_0x4cc6('0x6')](_0x4cc6('0xb'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0xc')]);router[_0x4cc6('0xd')]('/',auth[_0x4cc6('0x7')](),controller['create']);router[_0x4cc6('0xe')](_0x4cc6('0xb'),auth['isAuthenticated'](),controller[_0x4cc6('0xf')]);router['delete'](_0x4cc6('0xb'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0x10')]);module[_0x4cc6('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6496f20..968193c 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'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 +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xb43b,0x1b2));var _0xbb43=function(_0x56c81a,_0x5bfe5a){_0x56c81a=_0x56c81a-0x0;var _0x11c0db=_0xb43b[_0x56c81a];return _0x11c0db;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 9404199..15a6235 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 _0xec11=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport'];(function(_0x5afbce,_0x33b3e2){var _0x5f2ccc=function(_0x5cc929){while(--_0x5cc929){_0x5afbce['push'](_0x5afbce['shift']());}};_0x5f2ccc(++_0x33b3e2);}(_0xec11,0x157));var _0x1ec1=function(_0x5d3808,_0x424178){_0x5d3808=_0x5d3808-0x0;var _0x13f6e4=_0xec11[_0x5d3808];return _0x13f6e4;};'use strict';var emlformat=require(_0x1ec1('0x0'));var rimraf=require(_0x1ec1('0x1'));var zipdir=require(_0x1ec1('0x2'));var jsonpatch=require(_0x1ec1('0x3'));var rp=require(_0x1ec1('0x4'));var moment=require(_0x1ec1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ec1('0x6'));var util=require(_0x1ec1('0x7'));var path=require(_0x1ec1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ec1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ec1('0xa'));var _=require(_0x1ec1('0xb'));var squel=require(_0x1ec1('0xc'));var crypto=require(_0x1ec1('0xd'));var jsforce=require(_0x1ec1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ec1('0xf'));var Papa=require(_0x1ec1('0x10'));var Redis=require(_0x1ec1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ec1('0x12'));var hardwareService=require(_0x1ec1('0x13'));var logger=require(_0x1ec1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1ec1('0x15'));var licenseUtil=require(_0x1ec1('0x16'));var db=require(_0x1ec1('0x17'))['db'];function respondWithStatusCode(_0x595fb6,_0x2f430b){_0x2f430b=_0x2f430b||0xcc;return function(_0x167159){if(_0x167159){return _0x595fb6['sendStatus'](_0x2f430b);}return _0x595fb6[_0x1ec1('0x18')](_0x2f430b)[_0x1ec1('0x19')]();};}function respondWithResult(_0x5f00a1,_0x3a8854){_0x3a8854=_0x3a8854||0xc8;return function(_0x52d7cc){if(_0x52d7cc){return _0x5f00a1[_0x1ec1('0x18')](_0x3a8854)[_0x1ec1('0x1a')](_0x52d7cc);}};}function respondWithFilteredResult(_0x4a8b31,_0x2f5460){return function(_0x57706a){if(_0x57706a){var _0x4a1380=typeof _0x2f5460[_0x1ec1('0x1b')]==='undefined'&&typeof _0x2f5460['limit']===_0x1ec1('0x1c');var _0x3d94e5=_0x57706a[_0x1ec1('0x1d')];var _0x13134b=_0x4a1380?0x0:_0x2f5460[_0x1ec1('0x1b')];var _0x315d8d=_0x4a1380?_0x57706a['count']:_0x2f5460[_0x1ec1('0x1b')]+_0x2f5460[_0x1ec1('0x1e')];var _0x24ebb0;if(_0x315d8d>=_0x3d94e5){_0x315d8d=_0x3d94e5;_0x24ebb0=0xc8;}else{_0x24ebb0=0xce;}_0x4a8b31[_0x1ec1('0x18')](_0x24ebb0);return _0x4a8b31[_0x1ec1('0x1f')](_0x1ec1('0x20'),_0x13134b+'-'+_0x315d8d+'/'+_0x3d94e5)[_0x1ec1('0x1a')](_0x57706a);}return null;};}function patchUpdates(_0x415b2a){return function(_0x30c10e){try{jsonpatch[_0x1ec1('0x21')](_0x30c10e,_0x415b2a,!![]);}catch(_0x547951){return BPromise[_0x1ec1('0x22')](_0x547951);}return _0x30c10e[_0x1ec1('0x23')]();};}function saveUpdates(_0x2fda34,_0x1ab561){return function(_0xcf41f1){if(_0xcf41f1){return _0xcf41f1[_0x1ec1('0x24')](_0x2fda34)['then'](function(_0x297ce5){return _0x297ce5;});}return null;};}function removeEntity(_0x287c45,_0x24a197){return function(_0x1e2b97){if(_0x1e2b97){return _0x1e2b97[_0x1ec1('0x25')]()[_0x1ec1('0x26')](function(){_0x287c45[_0x1ec1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b14af,_0x20ead9){return function(_0x4fead1){if(!_0x4fead1){_0x4b14af[_0x1ec1('0x27')](0x194);}return _0x4fead1;};}function handleError(_0x59f0c5,_0x16cc86){_0x16cc86=_0x16cc86||0x1f4;return function(_0x50fb1f){logger[_0x1ec1('0x28')](_0x50fb1f[_0x1ec1('0x29')]);if(_0x50fb1f[_0x1ec1('0x2a')]){delete _0x50fb1f['name'];}_0x59f0c5[_0x1ec1('0x18')](_0x16cc86)[_0x1ec1('0x2b')](_0x50fb1f);};}exports[_0x1ec1('0x2c')]=function(_0x447eae,_0xc67f93){var _0xa940b5={},_0x2441dd={},_0x52bc72={'count':0x0,'rows':[]};var _0x30a432=_[_0x1ec1('0x2d')](db[_0x1ec1('0x2e')][_0x1ec1('0x2f')],function(_0x1ced7f){return{'name':_0x1ced7f[_0x1ec1('0x30')],'type':_0x1ced7f[_0x1ec1('0x31')][_0x1ec1('0x32')]};});_0x2441dd['model']=_['map'](_0x30a432,_0x1ec1('0x2a'));_0x2441dd[_0x1ec1('0x33')]=_[_0x1ec1('0x34')](_0x447eae['query']);_0x2441dd[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],_0x2441dd['query']);_0xa940b5['attributes']=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],qs[_0x1ec1('0x38')](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0xa940b5[_0x1ec1('0x39')]=_0xa940b5[_0x1ec1('0x39')][_0x1ec1('0x3a')]?_0xa940b5[_0x1ec1('0x39')]:_0x2441dd['model'];if(!_0x447eae['query'][_0x1ec1('0x3b')]('nolimit')){_0xa940b5[_0x1ec1('0x1e')]=qs[_0x1ec1('0x1e')](_0x447eae['query']['limit']);_0xa940b5[_0x1ec1('0x1b')]=qs['offset'](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x1b')]);}_0xa940b5[_0x1ec1('0x3c')]=qs[_0x1ec1('0x3d')](_0x447eae[_0x1ec1('0x33')]['sort']);_0xa940b5['where']=qs[_0x1ec1('0x35')](_[_0x1ec1('0x3e')](_0x447eae[_0x1ec1('0x33')],_0x2441dd['filters']),_0x30a432);if(_0x447eae['query']['filter']){_0xa940b5[_0x1ec1('0x3f')]=_[_0x1ec1('0x40')](_0xa940b5[_0x1ec1('0x3f')],{'$or':_[_0x1ec1('0x2d')](_0x30a432,function(_0x380fe6){if(_0x380fe6[_0x1ec1('0x31')]!==_0x1ec1('0x41')){var _0x405356={};_0x405356[_0x380fe6['name']]={'$like':'%'+_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x42')]+'%'};return _0x405356;}})});}_0xa940b5=_[_0x1ec1('0x40')]({},_0xa940b5,_0x447eae[_0x1ec1('0x43')]);var _0x5764d8={'where':_0xa940b5[_0x1ec1('0x3f')]};return db[_0x1ec1('0x2e')][_0x1ec1('0x1d')](_0x5764d8)[_0x1ec1('0x26')](function(_0x6d72a5){_0x52bc72[_0x1ec1('0x1d')]=_0x6d72a5;if(_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0xa940b5[_0x1ec1('0x45')]=[{'all':!![]}];}return db[_0x1ec1('0x2e')][_0x1ec1('0x46')](_0xa940b5);})[_0x1ec1('0x26')](function(_0x39d19c){_0x52bc72['rows']=_0x39d19c;return _0x52bc72;})[_0x1ec1('0x26')](respondWithFilteredResult(_0xc67f93,_0xa940b5))[_0x1ec1('0x47')](handleError(_0xc67f93,null));};exports[_0x1ec1('0x48')]=function(_0x118ea2,_0x5192bf){var _0x2940b5={'raw':!![],'where':{'id':_0x118ea2[_0x1ec1('0x49')]['id']}},_0x3974df={};_0x3974df[_0x1ec1('0x37')]=_[_0x1ec1('0x34')](db[_0x1ec1('0x2e')]['rawAttributes']);_0x3974df[_0x1ec1('0x33')]=_['keys'](_0x118ea2[_0x1ec1('0x33')]);_0x3974df[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],_0x3974df[_0x1ec1('0x33')]);_0x2940b5['attributes']=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],qs['fields'](_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0x2940b5[_0x1ec1('0x39')]=_0x2940b5['attributes']['length']?_0x2940b5[_0x1ec1('0x39')]:_0x3974df[_0x1ec1('0x37')];if(_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0x2940b5[_0x1ec1('0x45')]=[{'all':!![]}];}_0x2940b5=_[_0x1ec1('0x40')]({},_0x2940b5,_0x118ea2[_0x1ec1('0x43')]);return db[_0x1ec1('0x2e')]['find'](_0x2940b5)['then'](handleEntityNotFound(_0x5192bf,null))[_0x1ec1('0x26')](respondWithResult(_0x5192bf,null))[_0x1ec1('0x47')](handleError(_0x5192bf,null));};exports[_0x1ec1('0x4a')]=function(_0x384017,_0x696b3a){return db['ChatTransferReport']['create'](_0x384017[_0x1ec1('0x4b')],{})[_0x1ec1('0x26')](respondWithResult(_0x696b3a,0xc9))[_0x1ec1('0x47')](handleError(_0x696b3a,null));};exports[_0x1ec1('0x24')]=function(_0x5481a6,_0x2e6c66){if(_0x5481a6['body']['id']){delete _0x5481a6[_0x1ec1('0x4b')]['id'];}return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5481a6['params']['id']}})['then'](handleEntityNotFound(_0x2e6c66,null))[_0x1ec1('0x26')](saveUpdates(_0x5481a6[_0x1ec1('0x4b')],null))['then'](respondWithResult(_0x2e6c66,null))[_0x1ec1('0x47')](handleError(_0x2e6c66,null));};exports[_0x1ec1('0x25')]=function(_0x5360dc,_0x1dedb2){return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5360dc['params']['id']}})[_0x1ec1('0x26')](handleEntityNotFound(_0x1dedb2,null))[_0x1ec1('0x26')](removeEntity(_0x1dedb2,null))['catch'](handleError(_0x1dedb2,null));};exports[_0x1ec1('0x4d')]=function(_0x26657d,_0x25f929){return db[_0x1ec1('0x2e')][_0x1ec1('0x4d')]()['then'](respondWithResult(_0x25f929,null))[_0x1ec1('0x47')](handleError(_0x25f929,null));}; \ No newline at end of file +var _0x3aca=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3aca,0x17a));var _0xa3ac=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x3aca[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require(_0xa3ac('0x0'));var rimraf=require(_0xa3ac('0x1'));var zipdir=require(_0xa3ac('0x2'));var jsonpatch=require(_0xa3ac('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa3ac('0x4'));var Mustache=require(_0xa3ac('0x5'));var util=require(_0xa3ac('0x6'));var path=require(_0xa3ac('0x7'));var sox=require(_0xa3ac('0x8'));var csv=require(_0xa3ac('0x9'));var ejs=require(_0xa3ac('0xa'));var fs=require('fs');var fs_extra=require(_0xa3ac('0xb'));var _=require(_0xa3ac('0xc'));var squel=require(_0xa3ac('0xd'));var crypto=require(_0xa3ac('0xe'));var jsforce=require(_0xa3ac('0xf'));var deskjs=require(_0xa3ac('0x10'));var toCsv=require(_0xa3ac('0x9'));var querystring=require(_0xa3ac('0x11'));var Papa=require(_0xa3ac('0x12'));var Redis=require('ioredis');var authService=require(_0xa3ac('0x13'));var qs=require(_0xa3ac('0x14'));var as=require(_0xa3ac('0x15'));var hardwareService=require(_0xa3ac('0x16'));var logger=require('../../config/logger')(_0xa3ac('0x17'));var utils=require(_0xa3ac('0x18'));var config=require(_0xa3ac('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3ac('0x1a'))['db'];function respondWithStatusCode(_0x5ea0d0,_0x171dc0){_0x171dc0=_0x171dc0||0xcc;return function(_0x383138){if(_0x383138){return _0x5ea0d0[_0xa3ac('0x1b')](_0x171dc0);}return _0x5ea0d0['status'](_0x171dc0)[_0xa3ac('0x1c')]();};}function respondWithResult(_0x39f850,_0x8473d9){_0x8473d9=_0x8473d9||0xc8;return function(_0x41365b){if(_0x41365b){return _0x39f850[_0xa3ac('0x1d')](_0x8473d9)['json'](_0x41365b);}};}function respondWithFilteredResult(_0x4cdbc1,_0x5b2b2d){return function(_0x10f6f6){if(_0x10f6f6){var _0x473313=typeof _0x5b2b2d[_0xa3ac('0x1e')]===_0xa3ac('0x1f')&&typeof _0x5b2b2d[_0xa3ac('0x20')]==='undefined';var _0x5ca407=_0x10f6f6[_0xa3ac('0x21')];var _0x2e2274=_0x473313?0x0:_0x5b2b2d['offset'];var _0x1af192=_0x473313?_0x10f6f6[_0xa3ac('0x21')]:_0x5b2b2d[_0xa3ac('0x1e')]+_0x5b2b2d[_0xa3ac('0x20')];var _0x44bc29;if(_0x1af192>=_0x5ca407){_0x1af192=_0x5ca407;_0x44bc29=0xc8;}else{_0x44bc29=0xce;}_0x4cdbc1[_0xa3ac('0x1d')](_0x44bc29);return _0x4cdbc1[_0xa3ac('0x22')](_0xa3ac('0x23'),_0x2e2274+'-'+_0x1af192+'/'+_0x5ca407)[_0xa3ac('0x24')](_0x10f6f6);}return null;};}function patchUpdates(_0x425ffc){return function(_0x3e27f3){try{jsonpatch[_0xa3ac('0x25')](_0x3e27f3,_0x425ffc,!![]);}catch(_0x2133ed){return BPromise[_0xa3ac('0x26')](_0x2133ed);}return _0x3e27f3[_0xa3ac('0x27')]();};}function saveUpdates(_0x5289ce,_0x3db182){return function(_0x10e95b){if(_0x10e95b){return _0x10e95b[_0xa3ac('0x28')](_0x5289ce)['then'](function(_0x4b7ae8){return _0x4b7ae8;});}return null;};}function removeEntity(_0x1c6555,_0x11edf){return function(_0x57ccea){if(_0x57ccea){return _0x57ccea[_0xa3ac('0x29')]()[_0xa3ac('0x2a')](function(){_0x1c6555[_0xa3ac('0x1d')](0xcc)[_0xa3ac('0x1c')]();});}};}function handleEntityNotFound(_0x269aa2,_0x4cdf18){return function(_0xc0028c){if(!_0xc0028c){_0x269aa2[_0xa3ac('0x1b')](0x194);}return _0xc0028c;};}function handleError(_0x2491ab,_0x152b29){_0x152b29=_0x152b29||0x1f4;return function(_0x30dfb0){logger[_0xa3ac('0x2b')](_0x30dfb0[_0xa3ac('0x2c')]);if(_0x30dfb0[_0xa3ac('0x2d')]){delete _0x30dfb0[_0xa3ac('0x2d')];}_0x2491ab['status'](_0x152b29)[_0xa3ac('0x2e')](_0x30dfb0);};}exports[_0xa3ac('0x2f')]=function(_0x4d5168,_0x2991a3){var _0x5cda11={},_0x43c646={},_0x500dff={'count':0x0,'rows':[]};var _0x5bf30b=_[_0xa3ac('0x30')](db['ChatTransferReport'][_0xa3ac('0x31')],function(_0x5cb57f){return{'name':_0x5cb57f[_0xa3ac('0x32')],'type':_0x5cb57f[_0xa3ac('0x33')][_0xa3ac('0x34')]};});_0x43c646[_0xa3ac('0x35')]=_['map'](_0x5bf30b,_0xa3ac('0x2d'));_0x43c646['query']=_[_0xa3ac('0x36')](_0x4d5168[_0xa3ac('0x37')]);_0x43c646[_0xa3ac('0x38')]=_[_0xa3ac('0x39')](_0x43c646[_0xa3ac('0x35')],_0x43c646['query']);_0x5cda11[_0xa3ac('0x3a')]=_[_0xa3ac('0x39')](_0x43c646['model'],qs[_0xa3ac('0x3b')](_0x4d5168['query'][_0xa3ac('0x3b')]));_0x5cda11[_0xa3ac('0x3a')]=_0x5cda11[_0xa3ac('0x3a')][_0xa3ac('0x3c')]?_0x5cda11[_0xa3ac('0x3a')]:_0x43c646[_0xa3ac('0x35')];if(!_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x3d')]('nolimit')){_0x5cda11[_0xa3ac('0x20')]=qs[_0xa3ac('0x20')](_0x4d5168['query']['limit']);_0x5cda11[_0xa3ac('0x1e')]=qs[_0xa3ac('0x1e')](_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x1e')]);}_0x5cda11['order']=qs[_0xa3ac('0x3e')](_0x4d5168['query'][_0xa3ac('0x3e')]);_0x5cda11['where']=qs[_0xa3ac('0x38')](_['pick'](_0x4d5168[_0xa3ac('0x37')],_0x43c646[_0xa3ac('0x38')]),_0x5bf30b);if(_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x3f')]){_0x5cda11[_0xa3ac('0x40')]=_[_0xa3ac('0x41')](_0x5cda11['where'],{'$or':_[_0xa3ac('0x30')](_0x5bf30b,function(_0x2a6dd9){if(_0x2a6dd9[_0xa3ac('0x33')]!==_0xa3ac('0x42')){var _0xd5123b={};_0xd5123b[_0x2a6dd9[_0xa3ac('0x2d')]]={'$like':'%'+_0x4d5168['query']['filter']+'%'};return _0xd5123b;}})});}_0x5cda11=_[_0xa3ac('0x41')]({},_0x5cda11,_0x4d5168[_0xa3ac('0x43')]);var _0x5a3d8e={'where':_0x5cda11[_0xa3ac('0x40')]};return db[_0xa3ac('0x44')][_0xa3ac('0x21')](_0x5a3d8e)[_0xa3ac('0x2a')](function(_0x127538){_0x500dff[_0xa3ac('0x21')]=_0x127538;if(_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x45')]){_0x5cda11[_0xa3ac('0x46')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa3ac('0x47')](_0x5cda11);})[_0xa3ac('0x2a')](function(_0xe82bbf){_0x500dff['rows']=_0xe82bbf;return _0x500dff;})[_0xa3ac('0x2a')](respondWithFilteredResult(_0x2991a3,_0x5cda11))[_0xa3ac('0x48')](handleError(_0x2991a3,null));};exports['show']=function(_0x362338,_0x337287){var _0x204436={'raw':!![],'where':{'id':_0x362338[_0xa3ac('0x49')]['id']}},_0x16e5a9={};_0x16e5a9[_0xa3ac('0x35')]=_[_0xa3ac('0x36')](db[_0xa3ac('0x44')][_0xa3ac('0x31')]);_0x16e5a9[_0xa3ac('0x37')]=_[_0xa3ac('0x36')](_0x362338[_0xa3ac('0x37')]);_0x16e5a9[_0xa3ac('0x38')]=_['intersection'](_0x16e5a9[_0xa3ac('0x35')],_0x16e5a9[_0xa3ac('0x37')]);_0x204436['attributes']=_[_0xa3ac('0x39')](_0x16e5a9[_0xa3ac('0x35')],qs[_0xa3ac('0x3b')](_0x362338[_0xa3ac('0x37')]['fields']));_0x204436[_0xa3ac('0x3a')]=_0x204436['attributes'][_0xa3ac('0x3c')]?_0x204436[_0xa3ac('0x3a')]:_0x16e5a9[_0xa3ac('0x35')];if(_0x362338['query'][_0xa3ac('0x45')]){_0x204436[_0xa3ac('0x46')]=[{'all':!![]}];}_0x204436=_[_0xa3ac('0x41')]({},_0x204436,_0x362338['options']);return db[_0xa3ac('0x44')][_0xa3ac('0x4a')](_0x204436)[_0xa3ac('0x2a')](handleEntityNotFound(_0x337287,null))[_0xa3ac('0x2a')](respondWithResult(_0x337287,null))[_0xa3ac('0x48')](handleError(_0x337287,null));};exports['create']=function(_0xa6c3f1,_0x1e56ae){return db[_0xa3ac('0x44')][_0xa3ac('0x4b')](_0xa6c3f1['body'],{})[_0xa3ac('0x2a')](respondWithResult(_0x1e56ae,0xc9))['catch'](handleError(_0x1e56ae,null));};exports[_0xa3ac('0x28')]=function(_0x52a16b,_0x3df330){if(_0x52a16b['body']['id']){delete _0x52a16b['body']['id'];}return db['ChatTransferReport'][_0xa3ac('0x4a')]({'where':{'id':_0x52a16b[_0xa3ac('0x49')]['id']}})['then'](handleEntityNotFound(_0x3df330,null))['then'](saveUpdates(_0x52a16b[_0xa3ac('0x4c')],null))[_0xa3ac('0x2a')](respondWithResult(_0x3df330,null))['catch'](handleError(_0x3df330,null));};exports[_0xa3ac('0x29')]=function(_0x545136,_0xc3a298){return db['ChatTransferReport']['find']({'where':{'id':_0x545136[_0xa3ac('0x49')]['id']}})[_0xa3ac('0x2a')](handleEntityNotFound(_0xc3a298,null))[_0xa3ac('0x2a')](removeEntity(_0xc3a298,null))[_0xa3ac('0x48')](handleError(_0xc3a298,null));};exports[_0xa3ac('0x4d')]=function(_0x1aa604,_0x2ef042){return db[_0xa3ac('0x44')]['describe']()[_0xa3ac('0x2a')](respondWithResult(_0x2ef042,null))[_0xa3ac('0x48')](handleError(_0x2ef042,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index e76e832..f759a76 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 _0xddff=['exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x293500,_0x5bc106){var _0x324f05=function(_0x53ed67){while(--_0x53ed67){_0x293500['push'](_0x293500['shift']());}};_0x324f05(++_0x5bc106);}(_0xddff,0x124));var _0xfddf=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xddff[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0xfddf('0x0'));var util=require(_0xfddf('0x1'));var logger=require(_0xfddf('0x2'))('api');var moment=require(_0xfddf('0x3'));var BPromise=require(_0xfddf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfddf('0x5'));var rimraf=require(_0xfddf('0x6'));var config=require(_0xfddf('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xfddf('0x8')]=function(_0x3f9841,_0x52dc41){return _0x3f9841[_0xfddf('0x9')](_0xfddf('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xfddf('0xb'),'fields':[_0xfddf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x638b=['path','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','api','moment','request-promise'];(function(_0x41583f,_0xa138c7){var _0x14582b=function(_0x21add9){while(--_0x21add9){_0x41583f['push'](_0x41583f['shift']());}};_0x14582b(++_0xa138c7);}(_0x638b,0x1aa));var _0xb638=function(_0x1471cc,_0x15ec0e){_0x1471cc=_0x1471cc-0x0;var _0x42947f=_0x638b[_0x1471cc];return _0x42947f;};'use strict';var _=require(_0xb638('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb638('0x1'));var moment=require(_0xb638('0x2'));var BPromise=require('bluebird');var rp=require(_0xb638('0x3'));var fs=require('fs');var path=require(_0xb638('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb638('0x5'));module[_0xb638('0x6')]=function(_0x7d4891,_0x49f47b){return _0x7d4891[_0xb638('0x7')]('ChatTransferReport',attributes,{'tableName':_0xb638('0x8'),'paranoid':![],'indexes':[{'name':_0xb638('0x9'),'fields':[_0xb638('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 9de33f5..9348e64 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 _0xb101=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis'];(function(_0xfac4f8,_0x16f091){var _0x4c2a2e=function(_0x44bb18){while(--_0x44bb18){_0xfac4f8['push'](_0xfac4f8['shift']());}};_0x4c2a2e(++_0x16f091);}(_0xb101,0x188));var _0x1b10=function(_0x195054,_0x38c4ba){_0x195054=_0x195054-0x0;var _0x65352f=_0xb101[_0x195054];return _0x65352f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b10('0x0'));var BPromise=require(_0x1b10('0x1'));var rs=require(_0x1b10('0x2'));var fs=require('fs');var Redis=require(_0x1b10('0x3'));var db=require(_0x1b10('0x4'))['db'];var utils=require(_0x1b10('0x5'));var logger=require('../../config/logger')(_0x1b10('0x6'));var config=require(_0x1b10('0x7'));var jayson=require(_0x1b10('0x8'));var client=jayson['client'][_0x1b10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b560,_0xfb586b,_0x48f6ef){return new BPromise(function(_0x2c0131,_0x4df364){return client[_0x1b10('0xa')](_0x59b560,_0x48f6ef)[_0x1b10('0xb')](function(_0x2b6336){logger[_0x1b10('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xfb586b,'request\x20sent',JSON[_0x1b10('0xd')](_0x2b6336));if(_0x2b6336[_0x1b10('0xe')]){if(_0x2b6336[_0x1b10('0xe')]['code']===0x1f4){logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x4df364(_0x2b6336['error']['message']);}logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x2c0131(_0x2b6336['error'][_0x1b10('0xf')]);}else{logger[_0x1b10('0xc')](_0x1b10('0x10'),_0xfb586b,'request\x20sent');_0x2c0131(_0x2b6336[_0x1b10('0x11')][_0x1b10('0xf')]);}})['catch'](function(_0x6dcbfa){logger['error'](_0x1b10('0x10'),_0xfb586b,_0x6dcbfa);_0x4df364(_0x6dcbfa);});});} \ No newline at end of file +var _0x2564=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x4ffbd2,_0x37ef84){var _0x37c65b=function(_0x213b4e){while(--_0x213b4e){_0x4ffbd2['push'](_0x4ffbd2['shift']());}};_0x37c65b(++_0x37ef84);}(_0x2564,0xb3));var _0x4256=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2564[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4256('0x0'));var moment=require(_0x4256('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4256('0x2'));var db=require(_0x4256('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4256('0x4'))(_0x4256('0x5'));var config=require('../../config/environment');var jayson=require(_0x4256('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17ecaa,_0x3ffa39,_0x3814dc){return new BPromise(function(_0x685fea,_0x17c76e){return client[_0x4256('0x7')](_0x17ecaa,_0x3814dc)[_0x4256('0x8')](function(_0x5ad3a6){logger[_0x4256('0x9')](_0x4256('0xa'),_0x3ffa39,_0x4256('0xb'));logger[_0x4256('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3ffa39,_0x4256('0xb'),JSON[_0x4256('0xd')](_0x5ad3a6));if(_0x5ad3a6['error']){if(_0x5ad3a6[_0x4256('0xe')][_0x4256('0xf')]===0x1f4){logger['error'](_0x4256('0xa'),_0x3ffa39,_0x5ad3a6[_0x4256('0xe')]['message']);return _0x17c76e(_0x5ad3a6['error'][_0x4256('0x10')]);}logger[_0x4256('0xe')](_0x4256('0xa'),_0x3ffa39,_0x5ad3a6['error']['message']);return _0x685fea(_0x5ad3a6[_0x4256('0xe')]['message']);}else{logger[_0x4256('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x3ffa39,_0x4256('0xb'));_0x685fea(_0x5ad3a6[_0x4256('0x11')][_0x4256('0x10')]);}})[_0x4256('0x12')](function(_0x9d0610){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3ffa39,_0x9d0610);_0x17c76e(_0x9d0610);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 26009cb..f60c737 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 _0xaaa1=['index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x41dec5,_0x32ac03){var _0x249717=function(_0x500f98){while(--_0x500f98){_0x41dec5['push'](_0x41dec5['shift']());}};_0x249717(++_0x32ac03);}(_0xaaa1,0x13f));var _0x1aaa=function(_0x317c5c,_0x5d2952){_0x317c5c=_0x317c5c-0x0;var _0x504506=_0xaaa1[_0x317c5c];return _0x504506;};'use strict';var multer=require(_0x1aaa('0x0'));var util=require(_0x1aaa('0x1'));var path=require(_0x1aaa('0x2'));var timeout=require('connect-timeout');var express=require(_0x1aaa('0x3'));var router=express[_0x1aaa('0x4')]();var fs_extra=require(_0x1aaa('0x5'));var auth=require(_0x1aaa('0x6'));var interaction=require(_0x1aaa('0x7'));var config=require(_0x1aaa('0x8'));var controller=require(_0x1aaa('0x9'));router[_0x1aaa('0xa')]('/',auth['isAuthenticated'](),controller[_0x1aaa('0xb')]);router['get'](_0x1aaa('0xc'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xe')]);router[_0x1aaa('0xa')]('/:id',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xf')]);router[_0x1aaa('0x10')]('/',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x11')]);router[_0x1aaa('0x12')](_0x1aaa('0x13'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1aaa('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5560=['./chatTransferReport.controller','isAuthenticated','get','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbb11dc,_0x32fc7a){var _0x456f1b=function(_0x4a1c95){while(--_0x4a1c95){_0xbb11dc['push'](_0xbb11dc['shift']());}};_0x456f1b(++_0x32fc7a);}(_0x5560,0x11b));var _0x0556=function(_0x43e1ad,_0x5e9d01){_0x43e1ad=_0x43e1ad-0x0;var _0x3ce776=_0x5560[_0x43e1ad];return _0x3ce776;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0556('0x0'));var express=require(_0x0556('0x1'));var router=express['Router']();var fs_extra=require(_0x0556('0x2'));var auth=require(_0x0556('0x3'));var interaction=require(_0x0556('0x4'));var config=require(_0x0556('0x5'));var controller=require(_0x0556('0x6'));router['get']('/',auth[_0x0556('0x7')](),controller['index']);router[_0x0556('0x8')]('/describe',auth[_0x0556('0x7')](),controller['describe']);router[_0x0556('0x8')]('/:id',auth[_0x0556('0x7')](),controller[_0x0556('0x9')]);router[_0x0556('0xa')]('/',auth[_0x0556('0x7')](),controller[_0x0556('0xb')]);router[_0x0556('0xc')](_0x0556('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0556('0xe')](_0x0556('0xd'),auth['isAuthenticated'](),controller[_0x0556('0xf')]);module[_0x0556('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 904861a..16e9d42 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 _0x1b2c=['sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Skip','Feedback','star','thumb','TEXT','stringify','name','input','onlineForm','parse','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x19e00b,_0x16400c){var _0x533ce0=function(_0x2e2b22){while(--_0x2e2b22){_0x19e00b['push'](_0x19e00b['shift']());}};_0x533ce0(++_0x16400c);}(_0x1b2c,0x190));var _0xc1b2=function(_0x19085d,_0x5d8bc0){_0x19085d=_0x19085d-0x0;var _0xdb3f69=_0x1b2c[_0x19085d];return _0xdb3f69;};'use strict';var Sequelize=require(_0xc1b2('0x0'));var rs=require(_0xc1b2('0x1'));module[_0xc1b2('0x2')]={'name':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'unique':_0xc1b2('0x4')},'description':{'type':Sequelize[_0xc1b2('0x3')]},'mapKey':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x5')},'mapKeyOffline':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x6')},'customerAlias':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc1b2('0x3')]},'animation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0xc'),_0xc1b2('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0xe')},'start_chat_button':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x11')},'download_transcript':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x15')},'placeholderMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'skipMessageButton':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'conditionAgreement':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x17')},'ratingType':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0x18'),_0xc1b2('0x19')),'defaultValue':_0xc1b2('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xc1b2('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':_0xc1b2('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc1b2('0x1e'))?JSON[_0xc1b2('0x1f')](this[_0xc1b2('0x20')](_0xc1b2('0x1e'))):{};},'set':function(_0x210781){return this[_0xc1b2('0x21')]('onlineForm',JSON[_0xc1b2('0x1b')](_0x210781));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc1b2('0x22'),'helpText':_0xc1b2('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc1b2('0x20')](_0xc1b2('0x24'))?JSON[_0xc1b2('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x295f68){return this[_0xc1b2('0x21')](_0xc1b2('0x24'),JSON['stringify'](_0x295f68));}},'token':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return rs[_0xc1b2('0x25')]();}},'autoclose':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc1b2('0x3')]},'forwardOffline':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc1b2('0x3')]},'waitingTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x26')},'waitingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x29')},'skipUnmanaged':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc1b2('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return _0xc1b2('0x2a');}},'notificationSound':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2c')},'defaultTitle':{'type':Sequelize[_0xc1b2('0x3')]},'customerAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x198ab9){if(!_0x198ab9)this[_0xc1b2('0x21')](_0xc1b2('0x2e'),null);this[_0xc1b2('0x21')](_0xc1b2('0x2f'),_0x198ab9);}},'vidaooEscalation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc1b2('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x30')},'vidaooNote':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return _0xc1b2('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc1b2('0x1a')]}}; \ No newline at end of file +var _0xee9f=['Skip','Feedback','star','thumb','TEXT','stringify','input','text','name','onlineForm','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x2c1473,_0x5cdbf1){var _0x436fff=function(_0x5ef346){while(--_0x5ef346){_0x2c1473['push'](_0x2c1473['shift']());}};_0x436fff(++_0x5cdbf1);}(_0xee9f,0x1c8));var _0xfee9=function(_0x46ddc5,_0x3b33ef){_0x46ddc5=_0x46ddc5-0x0;var _0x4642a0=_0xee9f[_0x46ddc5];return _0x4642a0;};'use strict';var Sequelize=require(_0xfee9('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfee9('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x2')},'mapKeyOffline':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x2')},'key':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfee9('0x3')]},'animation':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xfee9('0x9')),'defaultValue':_0xfee9('0xa')},'header_online':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xb')},'start_chat_button':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xc')},'offline_chat_button':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xd')},'header_offline':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xf')},'noteTitle':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x10')},'closingMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xd')},'skipMessageButton':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x12')},'ratingType':{'type':Sequelize['ENUM'](_0xfee9('0x13'),_0xfee9('0x14')),'defaultValue':_0xfee9('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfee9('0x15')],'defaultValue':function(){return JSON[_0xfee9('0x16')]({'items':[{'type':_0xfee9('0x17'),'variable':null,'config':{'placeholder':'name','type':_0xfee9('0x18'),'required':!![]},'props':{'title':_0xfee9('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xfee9('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xfee9('0x2'),'type':_0xfee9('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xfee9('0x1a'))?JSON['parse'](this[_0xfee9('0x1b')]('onlineForm')):{};},'set':function(_0x4fee55){return this[_0xfee9('0x1c')]('onlineForm',JSON[_0xfee9('0x16')](_0x4fee55));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfee9('0x16')]({'items':[{'type':_0xfee9('0x17'),'props':{'title':_0xfee9('0x2'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xfee9('0x1d'),'config':{'placeholder':_0xfee9('0x1e')},'props':{'title':_0xfee9('0x1e'),'helpText':_0xfee9('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xfee9('0x20')](this[_0xfee9('0x1b')](_0xfee9('0x21'))):{};},'set':function(_0x3d2ec1){return this[_0xfee9('0x1c')]('offlineForm',JSON[_0xfee9('0x16')](_0x3d2ec1));}},'token':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfee9('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfee9('0x3')]},'waitingTitle':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x23')},'skipUnmanaged':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x11')},'sendUnmanaged':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfee9('0x15')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xfee9('0x15')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x27')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d2694){if(!_0x4d2694)this[_0xfee9('0x1c')](_0xfee9('0x28'),null);this[_0xfee9('0x1c')]('mandatoryDisposition',_0x4d2694);}},'vidaooEscalation':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfee9('0x29')},'vidaooNote':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':function(){return _0xfee9('0x2a');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfee9('0x15')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index be38569..76a856e 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 _0x6e9f=['referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','color_button','addApplications','transaction','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','ChatWebsite','findAll','rows','show','params','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','Disposition','findOne','includeAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','isNil','existsSync','join','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','Contacts','ListId','contact','x-forwarded-for','split','firstName','lastName','x-real-port'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6e9f,0x1ac));var _0xf6e9=function(_0x9d520b,_0x5dc955){_0x9d520b=_0x9d520b-0x0;var _0x119126=_0x6e9f[_0x9d520b];return _0x119126;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e9('0x0'));var zipdir=require(_0xf6e9('0x1'));var jsonpatch=require(_0xf6e9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6e9('0x3'));var Mustache=require(_0xf6e9('0x4'));var util=require(_0xf6e9('0x5'));var path=require('path');var sox=require(_0xf6e9('0x6'));var csv=require('to-csv');var ejs=require(_0xf6e9('0x7'));var fs=require('fs');var fs_extra=require(_0xf6e9('0x8'));var _=require(_0xf6e9('0x9'));var squel=require('squel');var crypto=require(_0xf6e9('0xa'));var jsforce=require(_0xf6e9('0xb'));var deskjs=require(_0xf6e9('0xc'));var toCsv=require(_0xf6e9('0xd'));var querystring=require(_0xf6e9('0xe'));var Papa=require(_0xf6e9('0xf'));var Redis=require(_0xf6e9('0x10'));var authService=require(_0xf6e9('0x11'));var qs=require(_0xf6e9('0x12'));var as=require(_0xf6e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf6e9('0x14'));var utils=require(_0xf6e9('0x15'));var config=require(_0xf6e9('0x16'));var licenseUtil=require(_0xf6e9('0x17'));var db=require(_0xf6e9('0x18'))['db'];config[_0xf6e9('0x19')]=_[_0xf6e9('0x1a')](config['redis'],{'host':_0xf6e9('0x1b'),'port':0x18eb});var socket=require(_0xf6e9('0x1c'))(new Redis(config[_0xf6e9('0x19')]));require('./chatWebsite.socket')[_0xf6e9('0x1d')](socket);var jayson=require(_0xf6e9('0x1e'));var client=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232c});var client9002=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232a});var client9003=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232b});var client9001=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x3cc5f2,_0xfa63db,_0x47d9d1,_0x550db6){return new BPromise(function(_0x863c76,_0xe11c0){var _0x12ae70=_0x550db6||client;return _0x12ae70[_0xf6e9('0x21')](_0x3cc5f2,_0x47d9d1)[_0xf6e9('0x22')](function(_0x33fc4b){logger[_0xf6e9('0x23')](_0xf6e9('0x24'),_0xfa63db,'request\x20sent');logger['debug'](_0xf6e9('0x25'),_0xfa63db,_0xf6e9('0x26'),JSON[_0xf6e9('0x27')](_0x33fc4b));if(_0x33fc4b[_0xf6e9('0x28')]){if(_0x33fc4b['error'][_0xf6e9('0x29')]===0x1f4){logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b[_0xf6e9('0x28')][_0xf6e9('0x2a')]);return _0xe11c0(_0x33fc4b['error'][_0xf6e9('0x2a')]);}logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b['error'][_0xf6e9('0x2a')]);return _0x863c76(_0x33fc4b[_0xf6e9('0x28')]['message']);}else{logger[_0xf6e9('0x23')]('ChatWebsite,\x20%s,\x20%s',_0xfa63db,_0xf6e9('0x26'));_0x863c76(_0x33fc4b['result'][_0xf6e9('0x2a')]);}})[_0xf6e9('0x2b')](function(_0x15b95f){logger['error'](_0xf6e9('0x24'),_0xfa63db,_0x15b95f);_0xe11c0(_0x15b95f);});});}function respondWithStatusCode(_0x2c41d1,_0x548008){_0x548008=_0x548008||0xcc;return function(_0xb10a27){if(_0xb10a27){return _0x2c41d1[_0xf6e9('0x2c')](_0x548008);}return _0x2c41d1['status'](_0x548008)[_0xf6e9('0x2d')]();};}function respondWithResult(_0x3c46df,_0x21e7a0){_0x21e7a0=_0x21e7a0||0xc8;return function(_0x45992a){if(_0x45992a){return _0x3c46df[_0xf6e9('0x2e')](_0x21e7a0)['json'](_0x45992a);}};}function respondWithFilteredResult(_0x233eb4,_0x33a4e5){return function(_0x5d61ca){if(_0x5d61ca){var _0x1c1baa=typeof _0x33a4e5[_0xf6e9('0x2f')]===_0xf6e9('0x30')&&typeof _0x33a4e5[_0xf6e9('0x31')]===_0xf6e9('0x30');var _0x228fd4=_0x5d61ca[_0xf6e9('0x32')];var _0x2fa96d=_0x1c1baa?0x0:_0x33a4e5[_0xf6e9('0x2f')];var _0x3a4ae0=_0x1c1baa?_0x5d61ca[_0xf6e9('0x32')]:_0x33a4e5['offset']+_0x33a4e5['limit'];var _0x4681dd;if(_0x3a4ae0>=_0x228fd4){_0x3a4ae0=_0x228fd4;_0x4681dd=0xc8;}else{_0x4681dd=0xce;}_0x233eb4[_0xf6e9('0x2e')](_0x4681dd);return _0x233eb4[_0xf6e9('0x33')](_0xf6e9('0x34'),_0x2fa96d+'-'+_0x3a4ae0+'/'+_0x228fd4)['json'](_0x5d61ca);}return null;};}function patchUpdates(_0x477d87){return function(_0x391ce7){try{jsonpatch[_0xf6e9('0x35')](_0x391ce7,_0x477d87,!![]);}catch(_0x4891b1){return BPromise['reject'](_0x4891b1);}return _0x391ce7['save']();};}function saveUpdates(_0x59e917,_0x28450a){return function(_0x34851f){if(_0x34851f){return _0x34851f[_0xf6e9('0x36')](_0x59e917)[_0xf6e9('0x22')](function(_0x370ad2){return _0x370ad2;});}return null;};}function removeEntity(_0x3564e8,_0x3bc73d){return function(_0xb61f30){if(_0xb61f30){return _0xb61f30[_0xf6e9('0x37')]()[_0xf6e9('0x22')](function(){var _0x25c6cb=_0xb61f30[_0xf6e9('0x38')]({'plain':!![]});var _0xd47a0e=_0xf6e9('0x39');return db[_0xf6e9('0x3a')][_0xf6e9('0x37')]({'where':{'type':_0xd47a0e,'resourceId':_0x25c6cb['id']}})['then'](function(){return _0xb61f30;});})[_0xf6e9('0x22')](function(){_0x3564e8[_0xf6e9('0x2e')](0xcc)[_0xf6e9('0x2d')]();});}};}function handleEntityNotFound(_0x5ea49b,_0x2aac78){return function(_0x1e2791){if(!_0x1e2791){_0x5ea49b[_0xf6e9('0x2c')](0x194);}return _0x1e2791;};}function handleError(_0x56b950,_0xe06593){_0xe06593=_0xe06593||0x1f4;return function(_0x891fdf){logger[_0xf6e9('0x28')](_0x891fdf[_0xf6e9('0x3b')]);if(_0x891fdf['name']){delete _0x891fdf['name'];}_0x56b950[_0xf6e9('0x2e')](_0xe06593)[_0xf6e9('0x3c')](_0x891fdf);};}exports[_0xf6e9('0x3d')]=function(_0x53c109,_0xdf5475){var _0x1547ab={'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x373377={},_0x1d61ec={'count':0x0,'rows':[]};var _0xc1509b=_[_0xf6e9('0x40')](db['ChatWebsite'][_0xf6e9('0x41')],function(_0x4fbeb6){return{'name':_0x4fbeb6['fieldName'],'type':_0x4fbeb6[_0xf6e9('0x42')][_0xf6e9('0x43')]};});_0x373377['model']=_[_0xf6e9('0x40')](_0xc1509b,_0xf6e9('0x44'));_0x373377[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x53c109['query']);_0x373377[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x373377[_0xf6e9('0x49')],_0x373377[_0xf6e9('0x45')]);_0x1547ab[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x373377['model'],qs[_0xf6e9('0x4b')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x1547ab[_0xf6e9('0x4a')]=_0x1547ab['attributes'][_0xf6e9('0x4c')]?_0x1547ab[_0xf6e9('0x4a')]:_0x373377[_0xf6e9('0x49')];if(!_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x1547ab[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x1547ab[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1547ab[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x1547ab[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x53c109[_0xf6e9('0x45')],_0x373377[_0xf6e9('0x47')]),_0xc1509b);if(_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x1547ab[_0xf6e9('0x51')]=_['merge'](_0x1547ab[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xc1509b,function(_0x1d3067){if(_0x1d3067[_0xf6e9('0x42')]!==_0xf6e9('0x54')){var _0x565389={};_0x565389[_0x1d3067[_0xf6e9('0x44')]]={'$like':'%'+_0x53c109['query'][_0xf6e9('0x53')]+'%'};return _0x565389;}})});}_0x1547ab=_['merge']({},_0x1547ab,_0x53c109[_0xf6e9('0x55')]);var _0x306b94={'where':_0x1547ab[_0xf6e9('0x51')]};return db['ChatWebsite'][_0xf6e9('0x32')](_0x306b94)[_0xf6e9('0x22')](function(_0x8e38ec){_0x1d61ec['count']=_0x8e38ec;if(_0x53c109[_0xf6e9('0x45')]['includeAll']){_0x1547ab['include']=[{'all':!![]}];}return db[_0xf6e9('0x56')][_0xf6e9('0x57')](_0x1547ab);})['then'](function(_0x18e45e){_0x1d61ec[_0xf6e9('0x58')]=_0x18e45e;return _0x1d61ec;})[_0xf6e9('0x22')](respondWithFilteredResult(_0xdf5475,_0x1547ab))[_0xf6e9('0x2b')](handleError(_0xdf5475,null));};exports[_0xf6e9('0x59')]=function(_0xe92d20,_0x36d417){var _0x4d63a0={'raw':![],'where':{'id':_0xe92d20[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x1782e6={};_0x1782e6[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x56')]['rawAttributes']);_0x1782e6[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0xe92d20[_0xf6e9('0x45')]);_0x1782e6[_0xf6e9('0x47')]=_['intersection'](_0x1782e6[_0xf6e9('0x49')],_0x1782e6[_0xf6e9('0x45')]);_0x4d63a0[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x1782e6[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0xe92d20[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4d63a0[_0xf6e9('0x4a')]=_0x4d63a0[_0xf6e9('0x4a')]['length']?_0x4d63a0[_0xf6e9('0x4a')]:_0x1782e6[_0xf6e9('0x49')];if(_0xe92d20[_0xf6e9('0x45')]['includeAll']){_0x4d63a0[_0xf6e9('0x5b')]=[{'all':!![]}];}_0x4d63a0=_[_0xf6e9('0x5c')]({},_0x4d63a0,_0xe92d20['options']);return db['ChatWebsite'][_0xf6e9('0x5d')](_0x4d63a0)[_0xf6e9('0x22')](handleEntityNotFound(_0x36d417,null))[_0xf6e9('0x22')](respondWithResult(_0x36d417,null))[_0xf6e9('0x2b')](handleError(_0x36d417,null));};exports[_0xf6e9('0x5e')]=function(_0xfd7321,_0x44bee3){return db[_0xf6e9('0x56')][_0xf6e9('0x5e')](_0xfd7321[_0xf6e9('0x5f')],{})['then'](function(_0x2d5ec5){var _0x297c07=_0xfd7321[_0xf6e9('0x60')][_0xf6e9('0x38')]({'plain':!![]});if(!_0x297c07)throw new Error(_0xf6e9('0x61'));if(_0x297c07[_0xf6e9('0x62')]===_0xf6e9('0x60')){var _0x5ddc3c=_0x2d5ec5[_0xf6e9('0x38')]({'plain':!![]});var _0x371764='ChatWebsites';return db[_0xf6e9('0x63')]['find']({'where':{'name':_0x371764,'userProfileId':_0x297c07['userProfileId']},'raw':!![]})['then'](function(_0xe83822){if(_0xe83822&&_0xe83822[_0xf6e9('0x64')]===0x0){return db[_0xf6e9('0x3a')][_0xf6e9('0x5e')]({'name':_0x5ddc3c[_0xf6e9('0x44')],'resourceId':_0x5ddc3c['id'],'type':_0xe83822[_0xf6e9('0x44')],'sectionId':_0xe83822['id']},{})['then'](function(){return _0x2d5ec5;});}else{return _0x2d5ec5;}})[_0xf6e9('0x2b')](function(_0x2db5f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db5f4);throw _0x2db5f4;});}return _0x2d5ec5;})[_0xf6e9('0x22')](respondWithResult(_0x44bee3,0xc9))[_0xf6e9('0x2b')](handleError(_0x44bee3,null));};exports[_0xf6e9('0x36')]=function(_0x40745d,_0xaf8706){if(_0x40745d[_0xf6e9('0x5f')]['id']){delete _0x40745d[_0xf6e9('0x5f')]['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x40745d[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]})['then'](handleEntityNotFound(_0xaf8706,null))[_0xf6e9('0x22')](saveUpdates(_0x40745d['body'],null))[_0xf6e9('0x22')](respondWithResult(_0xaf8706,null))[_0xf6e9('0x2b')](handleError(_0xaf8706,null));};exports[_0xf6e9('0x37')]=function(_0x57583b,_0x354509){return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x57583b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x354509,null))[_0xf6e9('0x22')](removeEntity(_0x354509,null))[_0xf6e9('0x2b')](handleError(_0x354509,null));};exports[_0xf6e9('0x65')]=function(_0x5e67f3,_0xebd1ea){return db[_0xf6e9('0x56')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](respondWithResult(_0xebd1ea,null))[_0xf6e9('0x2b')](handleError(_0xebd1ea,null));};exports[_0xf6e9('0x66')]=function(_0x529591,_0x44728b,_0x4c6638){if(_0x529591[_0xf6e9('0x5f')]['id']){delete _0x529591['body']['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x529591['params']['id']}})['then'](handleEntityNotFound(_0x44728b,null))['then'](function(_0xe4b85f){if(_0xe4b85f){_0x529591[_0xf6e9('0x5f')]['ChatWebsiteId']=_0xe4b85f['id'];return db[_0xf6e9('0x67')][_0xf6e9('0x5e')](_0x529591[_0xf6e9('0x5f')]);}})[_0xf6e9('0x22')](respondWithResult(_0x44728b,null))[_0xf6e9('0x2b')](handleError(_0x44728b,null));};exports['getDispositions']=function(_0x40ab4d,_0x142cce,_0x143bdc){var _0xbd2f8f={'raw':![],'where':{}};var _0x4bfa25={};var _0x1a9afa={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x40ab4d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x142cce,null))[_0xf6e9('0x22')](function(_0x4a7342){if(_0x4a7342){_0x4bfa25[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['Disposition']['rawAttributes']);_0x4bfa25[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x40ab4d[_0xf6e9('0x45')]);_0x4bfa25[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x4bfa25[_0xf6e9('0x49')],_0x4bfa25[_0xf6e9('0x45')]);_0xbd2f8f[_0xf6e9('0x4a')]=_['intersection'](_0x4bfa25[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0x40ab4d[_0xf6e9('0x45')]['fields']));_0xbd2f8f[_0xf6e9('0x4a')]=_0xbd2f8f['attributes'][_0xf6e9('0x4c')]?_0xbd2f8f['attributes']:_0x4bfa25[_0xf6e9('0x49')];if(!_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0xbd2f8f['limit']=qs[_0xf6e9('0x31')](_0x40ab4d['query'][_0xf6e9('0x31')]);_0xbd2f8f[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0xbd2f8f[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x40ab4d[_0xf6e9('0x45')]['sort']);_0xbd2f8f[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_['pick'](_0x40ab4d['query'],_0x4bfa25[_0xf6e9('0x47')]));_0xbd2f8f[_0xf6e9('0x51')]['ChatWebsiteId']=_0x4a7342['id'];if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0xbd2f8f[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0xbd2f8f[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xbd2f8f[_0xf6e9('0x4a')],function(_0xbf2451){var _0x22e692={};_0x22e692[_0xbf2451]={'$like':'%'+_0x40ab4d[_0xf6e9('0x45')]['filter']+'%'};return _0x22e692;})});}_0xbd2f8f=_[_0xf6e9('0x5c')]({},_0xbd2f8f,_0x40ab4d['options']);return db['Disposition']['count']({'where':_0xbd2f8f[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4aea88){_0x1a9afa[_0xf6e9('0x32')]=_0x4aea88;if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0xbd2f8f[_0xf6e9('0x5b')]=[{'all':!![]}];}return db[_0xf6e9('0x67')][_0xf6e9('0x57')](_0xbd2f8f);})[_0xf6e9('0x22')](function(_0x3098ad){_0x1a9afa[_0xf6e9('0x58')]=_0x3098ad;return _0x1a9afa;});}})['then'](respondWithFilteredResult(_0x142cce,_0xbd2f8f))['catch'](handleError(_0x142cce,null));};exports[_0xf6e9('0x6a')]=function(_0x3a764f,_0x327c13,_0x4edc21){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x3a764f['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x327c13,null))[_0xf6e9('0x22')](function(_0x3f9adb){if(_0x3f9adb){return _0x3f9adb['removeDispositions'](_0x3a764f[_0xf6e9('0x45')][_0xf6e9('0x6b')]);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x327c13,null))['catch'](handleError(_0x327c13,null));};exports[_0xf6e9('0x6c')]=function(_0x476545,_0x33382b,_0x2f9054){if(_0x476545[_0xf6e9('0x5f')]['id']){delete _0x476545[_0xf6e9('0x5f')]['id'];}return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x476545['params']['id']}})['then'](handleEntityNotFound(_0x33382b,null))[_0xf6e9('0x22')](function(_0x28e99e){if(_0x28e99e){_0x476545['body'][_0xf6e9('0x6d')]=_0x28e99e['id'];return db[_0xf6e9('0x6e')][_0xf6e9('0x5e')](_0x476545['body']);}})[_0xf6e9('0x22')](respondWithResult(_0x33382b,null))['catch'](handleError(_0x33382b,null));};exports[_0xf6e9('0x6f')]=function(_0x195ccb,_0xf7e828,_0x811de){var _0x1ab528={'raw':![],'where':{}};var _0x1e7477={};var _0xb26a12={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x195ccb['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xf7e828,null))[_0xf6e9('0x22')](function(_0x3936a5){if(_0x3936a5){_0x1e7477[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x6e')][_0xf6e9('0x41')]);_0x1e7477[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x195ccb['query']);_0x1e7477['filters']=_[_0xf6e9('0x48')](_0x1e7477[_0xf6e9('0x49')],_0x1e7477[_0xf6e9('0x45')]);_0x1ab528[_0xf6e9('0x4a')]=_['intersection'](_0x1e7477['model'],qs['fields'](_0x195ccb[_0xf6e9('0x45')]['fields']));_0x1ab528[_0xf6e9('0x4a')]=_0x1ab528[_0xf6e9('0x4a')]['length']?_0x1ab528['attributes']:_0x1e7477['model'];if(!_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x1ab528[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x195ccb['query'][_0xf6e9('0x31')]);_0x1ab528[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1ab528['order']=qs['sort'](_0x195ccb[_0xf6e9('0x45')]['sort']);_0x1ab528[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x195ccb[_0xf6e9('0x45')],_0x1e7477[_0xf6e9('0x47')]));_0x1ab528[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x3936a5['id'];if(_0x195ccb['query'][_0xf6e9('0x53')]){_0x1ab528[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x1ab528['where'],{'$or':_[_0xf6e9('0x40')](_0x1ab528[_0xf6e9('0x4a')],function(_0x2266d6){var _0x526db7={};_0x526db7[_0x2266d6]={'$like':'%'+_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x526db7;})});}_0x1ab528=_[_0xf6e9('0x5c')]({},_0x1ab528,_0x195ccb[_0xf6e9('0x55')]);return db['CannedAnswer'][_0xf6e9('0x32')]({'where':_0x1ab528[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x17a27c){_0xb26a12['count']=_0x17a27c;if(_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0x1ab528['include']=[{'all':!![]}];}return db[_0xf6e9('0x6e')][_0xf6e9('0x57')](_0x1ab528);})['then'](function(_0x404af1){_0xb26a12['rows']=_0x404af1;return _0xb26a12;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0xf7e828,_0x1ab528))[_0xf6e9('0x2b')](handleError(_0xf7e828,null));};exports[_0xf6e9('0x70')]=function(_0x2f932d,_0x2537a0,_0x3b8ede){return db['ChatWebsite']['find']({'where':{'id':_0x2f932d['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2537a0,null))[_0xf6e9('0x22')](function(_0x5c4d12){if(_0x5c4d12){return _0x5c4d12['removeAnswers'](_0x2f932d[_0xf6e9('0x45')]['ids']);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x2537a0,null))['catch'](handleError(_0x2537a0,null));};exports['addLogo']=function(_0x2273fd,_0x313baa,_0x11e215){_0x2273fd['body'][_0xf6e9('0x71')]=_0x2273fd[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x2273fd[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x313baa,null))[_0xf6e9('0x22')](saveUpdates(_0x2273fd[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x313baa,null))[_0xf6e9('0x2b')](handleError(_0x313baa,null));};exports[_0xf6e9('0x74')]=function(_0x4b7caf,_0x1ed17a,_0x1b9920){_0x4b7caf['body']['agentAvatar']=_0x4b7caf['file'][_0xf6e9('0x73')];return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x4b7caf[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1ed17a,null))[_0xf6e9('0x22')](saveUpdates(_0x4b7caf[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0x1ed17a,null))[_0xf6e9('0x2b')](handleError(_0x1ed17a,null));};exports[_0xf6e9('0x75')]=function(_0x5d84b9,_0xaaf96b,_0x573126){_0x5d84b9['body']['customerAvatar']=_0x5d84b9[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x5d84b9[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xaaf96b,null))[_0xf6e9('0x22')](saveUpdates(_0x5d84b9[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0xaaf96b,null))[_0xf6e9('0x2b')](handleError(_0xaaf96b,null));};exports[_0xf6e9('0x76')]=function(_0x21f24a,_0x1f65b2,_0x423886){_0x21f24a['body'][_0xf6e9('0x77')]=_0x21f24a[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x21f24a['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1f65b2,null))[_0xf6e9('0x22')](saveUpdates(_0x21f24a[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x1f65b2,null))[_0xf6e9('0x2b')](handleError(_0x1f65b2,null));};exports[_0xf6e9('0x78')]=function(_0x3e836b,_0x3816c7,_0x1551bb){var _0x128519=path['join'](config[_0xf6e9('0x79')],'server/files/images/logos/default_logo.svg');var _0x312906={'where':{'id':_0x3e836b[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x71')],'raw':!![]};var _0x35d754=![];return require(_0xf6e9('0x17'))[_0xf6e9('0x7a')]()[_0xf6e9('0x22')](function(_0xf1c9f0){if(_0xf1c9f0){_0x35d754=_0xf1c9f0['custom'];}})['then'](function(){return db['ChatWebsite'][_0xf6e9('0x5d')](_0x312906);})['then'](handleEntityNotFound(_0x3816c7,null))[_0xf6e9('0x22')](function(_0x23c54f){if(_0x23c54f){if(!_[_0xf6e9('0x7b')](_0x23c54f[_0xf6e9('0x71')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]))&&_0x35d754){_0x128519=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]);}}return _0x3816c7['download'](_0x128519);}})['catch'](handleError(_0x3816c7,null));};exports[_0xf6e9('0x7f')]=function(_0x255e3c,_0xf4dfc4,_0x373de4){var _0x7f2d57=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/default_avatar.png');var _0x3cefe2={'where':{'id':_0x255e3c[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x80')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x3cefe2)[_0xf6e9('0x22')](handleEntityNotFound(_0xf4dfc4,null))['then'](function(_0x5ce1f9){if(_0x5ce1f9){if(!_['isNil'](_0x5ce1f9[_0xf6e9('0x80')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]))){_0x7f2d57=path[_0xf6e9('0x7d')](config['root'],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]);}}return _0xf4dfc4[_0xf6e9('0x82')](_0x7f2d57);}})[_0xf6e9('0x2b')](handleError(_0xf4dfc4,null));};exports[_0xf6e9('0x83')]=function(_0x24201c,_0x486d02,_0x22b9e8){var _0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x84'));var _0x4ffd6c={'where':{'id':_0x24201c['params']['id']},'attributes':['id',_0xf6e9('0x85'),_0xf6e9('0x86')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x4ffd6c)[_0xf6e9('0x22')](handleEntityNotFound(_0x486d02,null))[_0xf6e9('0x22')](function(_0x309d93){if(_0x309d93){if(!_[_0xf6e9('0x7b')](_0x309d93[_0xf6e9('0x85')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93['customerAvatar']))&&_0x309d93[_0xf6e9('0x86')]){_0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93[_0xf6e9('0x85')]);}}return _0x486d02[_0xf6e9('0x82')](_0x2556d5);}})[_0xf6e9('0x2b')](handleError(_0x486d02,null));};exports[_0xf6e9('0x87')]=function(_0x26755d,_0x1879e4,_0x4ad31c){var _0x426552=path['join'](config['root'],_0xf6e9('0x88'));var _0x2fa784={'where':{'id':_0x26755d[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x77')],'raw':!![]};return db[_0xf6e9('0x56')]['find'](_0x2fa784)[_0xf6e9('0x22')](handleEntityNotFound(_0x1879e4,null))[_0xf6e9('0x22')](function(_0x1c6800){if(_0x1c6800){if(!_[_0xf6e9('0x7b')](_0x1c6800[_0xf6e9('0x77')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x1c6800[_0xf6e9('0x77')]))){_0x426552=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/',_0x1c6800[_0xf6e9('0x77')]);}}return _0x1879e4[_0xf6e9('0x82')](_0x426552);}})[_0xf6e9('0x2b')](handleError(_0x1879e4,null));};exports[_0xf6e9('0x89')]=function(_0xb83a6d,_0x93b38d,_0xbedbf4){var _0x50f448=require('user-agent-parser');var _0x49d2d0=new _0x50f448();var _0x1330cc=_0x49d2d0[_0xf6e9('0x8a')](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0x8c')])[_0xf6e9('0x8d')]();var _0x589832={'body':_0xb83a6d[_0xf6e9('0x5f')],'channel':_0xf6e9('0x8e')};var _0x19570d=[];var _0x1abdf2=[];var _0x51a9c7={};var _0x40c027=![];return db[_0xf6e9('0x8f')]['describe']()[_0xf6e9('0x22')](function(_0x5c9f82){if(!_0x5c9f82){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x92'));}_0x19570d=_[_0xf6e9('0x93')](_[_0xf6e9('0x46')](_0x5c9f82),[_0xf6e9('0x94'),_0xf6e9('0x95')]);_0x1abdf2=_['difference'](_['keys'](_0x5c9f82),[_0xf6e9('0x94'),'updatedAt',_0xf6e9('0x96'),'ListId']);if(_0xb83a6d[_0xf6e9('0x5f')]['id']){delete _0xb83a6d[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x98'));}if(_[_0xf6e9('0x7b')](_0xb83a6d['body'][_0xf6e9('0x5f')])||_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x99'));}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x9a')])){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x9b')+_0x1abdf2);}if(!_['includes'](_0x1abdf2,_0xb83a6d[_0xf6e9('0x5f')]['mapKey'])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x9c')+_0x1abdf2);}_0x51a9c7[_0xb83a6d['body'][_0xf6e9('0x9a')]]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb83a6d[_0xf6e9('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xf6e9('0x9d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51a9c7,'limit':0x1,'order':[['updatedAt',_0xf6e9('0x9e')]]}]},{'model':db[_0xf6e9('0x9f')],'as':_0xf6e9('0xa0')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x51204c){if(_0x51204c&&_0x51204c[_0xf6e9('0x9d')]){_0x589832['account']=_0x51204c;_0x589832[_0xf6e9('0xa1')]=_0x51204c[_0xf6e9('0xa0')];_0x589832['list']=_0x51204c[_0xf6e9('0x9d')];_0x589832[_0xf6e9('0xa1')]=_[_0xf6e9('0xa2')](_0x589832[_0xf6e9('0xa1')],[_0xf6e9('0xa3')],[_0xf6e9('0xa4')]);if(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')]){delete _0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')];}if(_0x589832['account'][_0xf6e9('0x9d')]&&_0x589832[_0xf6e9('0xa5')]['List']['Contacts'][_0xf6e9('0x4c')]){return _0x589832[_0xf6e9('0xa5')]['List'][_0xf6e9('0xa6')][0x0];}var _0x3a720f=_[_0xf6e9('0x1a')](_0xb83a6d[_0xf6e9('0x5f')],{'firstName':_0xb83a6d[_0xf6e9('0x5f')]['from'],'ListId':_0x51204c[_0xf6e9('0xa7')]});_0x3a720f[_0xb83a6d[_0xf6e9('0x5f')]['mapKey']]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')][_0xf6e9('0x5e')](_0x3a720f,{'fields':_0x19570d,'raw':!![]});}})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x13c448){_0x589832[_0xf6e9('0xa8')]=_0x13c448;var _0x3b4736=_0xb83a6d['body']['customerIp'];if(_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip']){_0x3b4736=_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip'];}else if(_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')]){_0x3b4736=_['first'](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')][_0xf6e9('0xaa')](','));}if(_0x13c448){var _0x2e9f75={'ContactId':_0x13c448['id'],'ChatWebsiteId':_0xb83a6d['params']['id'],'from':(_0x13c448[_0xf6e9('0xab')]||'')+'\x20'+(_0x13c448[_0xf6e9('0xac')]||''),'customerIp':_0x3b4736,'customerPort':_0xb83a6d[_0xf6e9('0x8b')]['x-real-port']?_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xad')]:null,'referer':_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xae')],'browserName':_0x1330cc['browser'][_0xf6e9('0x44')]&&_0x1330cc[_0xf6e9('0xaf')]['version']?util[_0xf6e9('0xb0')](_0xf6e9('0xb1'),_0x1330cc['browser'][_0xf6e9('0x44')],_0x1330cc['browser'][_0xf6e9('0xb2')]):_0xf6e9('0xb3'),'browserVersion':_0x1330cc[_0xf6e9('0xaf')][_0xf6e9('0xb2')]||_0xf6e9('0xb3'),'osName':util[_0xf6e9('0xb0')]('%s\x20%s',_0x1330cc['os'][_0xf6e9('0x44')],_0x1330cc['os'][_0xf6e9('0xb2')]),'osVersion':_0x1330cc['os'][_0xf6e9('0xb2')],'deviceModel':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')]&&_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')]?util[_0xf6e9('0xb0')](_0xf6e9('0xb6'),_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')],_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')],_0x1330cc[_0xf6e9('0xb4')]['type']):null,'deviceVendor':_0x1330cc[_0xf6e9('0xb4')]['vendor'],'deviceType':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x42')],'formData':JSON[_0xf6e9('0x27')](_0xb83a6d[_0xf6e9('0x5f')])};var _0x3b85a9={'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'closed':![]};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]){_0x3b85a9[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')]['threadId'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})['then'](function(_0x5b9673){if(_0x5b9673){return[_0x5b9673,![]];}_0x2e9f75[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')];_0x2e9f75[_0xf6e9('0xb9')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb9')];return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x8a9509){return[_0x8a9509,!![]];});});}_0x3b85a9[_0xf6e9('0xba')]=_0x13c448['id'];if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]&&_0xb83a6d['body'][_0xf6e9('0xbb')]['id']){_0x3b85a9['id']=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]['id'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})[_0xf6e9('0x22')](function(_0x465e4a){if(_0x465e4a){return[_0x465e4a,![]];}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x330939){return[_0x330939,!![]];});});}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)['then'](function(_0x510583){return[_0x510583,!![]];});}})[_0xf6e9('0xbc')](function(_0x15c5f5,_0x49099f){if(_0x15c5f5){_0x40c027=_0x49099f;if(!_0x49099f){var _0x22a404={'from':(_0x589832['contact'][_0xf6e9('0xab')]||'')+'\x20'+(_0x589832[_0xf6e9('0xa8')][_0xf6e9('0xac')]||'')};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]!=_0xb83a6d['body'][_0xf6e9('0xbd')]){_0x22a404[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')];}return _0x15c5f5[_0xf6e9('0x36')](_0x22a404);}else{return _0x15c5f5;}}})[_0xf6e9('0x22')](function(_0x83498a){_0x589832[_0xf6e9('0xbb')]=_0x83498a[_0xf6e9('0x38')]({'plain':!![]});_0x589832['interaction'][_0xf6e9('0xbe')]=_0x40c027;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xbe')]){if(_0x589832[_0xf6e9('0xa5')]['autoclose']){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xbf')]({'id':0x0,'priority':_0x589832[_0xf6e9('0xa1')][_0xf6e9('0x4c')]+0x1,'app':_0xf6e9('0xc0'),'appdata':_0xf6e9('0xc1'),'interval':_0xf6e9('0xc2')});}}return db[_0xf6e9('0xc3')][_0xf6e9('0x5e')]({'body':_0xb83a6d[_0xf6e9('0x5f')]['body'],'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'ChatInteractionId':_0x83498a['id'],'direction':'in','ContactId':_0x589832[_0xf6e9('0xa8')]['id'],'AttachmentId':_0xb83a6d[_0xf6e9('0x5f')]['AttachmentId']});})[_0xf6e9('0x22')](function(_0x5a739b){_0x589832[_0xf6e9('0x2a')]=_0x5a739b;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]){return db[_0xf6e9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]}})[_0xf6e9('0x22')](function(_0x405c51){if(_0x405c51){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xc6')]({'id':0x0,'priority':0x0,'app':_0xf6e9('0xc7'),'appdata':_0x405c51[_0xf6e9('0x44')]+','+(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xc8')]||0xa),'interval':_0xf6e9('0xc2')});_0x589832[_0xf6e9('0xc9')]=!![];}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);});}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);})[_0xf6e9('0x22')](function(_0x2436f6){respondWithRpcPromise(_0xf6e9('0xcc'),_0xf6e9('0xcc'),{'event':'notify','message':_0x2436f6},client9002);return _0x2436f6;})[_0xf6e9('0x22')](respondWithResult(_0x93b38d,null))[_0xf6e9('0x2b')](handleError(_0x93b38d,null));};exports['offline']=function(_0x7bc5d7,_0x3b77d5,_0x10e804){var _0x51770a,_0xbd592c,_0x4e5285;var _0x533d64=[];var _0x126c69=[];var _0x4b5c59={};var _0x3ce98b=_0x7bc5d7[_0xf6e9('0xcd')]||[];var _0x276654=[];var _0x54f87c;return db[_0xf6e9('0x8f')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](function(_0x23ddde){if(!_0x23ddde){throw new db['Sequelize'][(_0xf6e9('0x91'))]('no\x20available\x20attributes');}_0x126c69=_['difference'](_['keys'](_0x23ddde),['createdAt','updatedAt']);_0x533d64=_['difference'](_[_0xf6e9('0x46')](_0x23ddde),[_0xf6e9('0x94'),_0xf6e9('0x95'),_0xf6e9('0x96'),_0xf6e9('0xa7')]);if(_0x7bc5d7[_0xf6e9('0x5f')]['id']){delete _0x7bc5d7[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0x98')));}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')]['body'])||_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf6e9('0x7b')](_0x7bc5d7['body']['mapKeyOffline'])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0xce')+_0x533d64));}if(!_['includes'](_0x533d64,_0x7bc5d7['body'][_0xf6e9('0xcf')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0xf6e9('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x533d64));}_0x4b5c59[_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0xcf')]]=_0x7bc5d7[_0xf6e9('0x5f')]['from'];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x7bc5d7[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0xd0')],'as':_0xf6e9('0x9d')},{'model':db[_0xf6e9('0xd1')],'as':_0xf6e9('0xd1')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b77d5,null))[_0xf6e9('0x22')](function(_0x45ad55){if(_0x45ad55&&_0x45ad55[_0xf6e9('0x9d')]){_0xbd592c=_0x45ad55;var _0x40c26f=_[_0xf6e9('0x1a')](_0x7bc5d7['body'],{'firstName':_0x7bc5d7['body'][_0xf6e9('0x97')],'phone':_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')],'ListId':_0x45ad55[_0xf6e9('0xa7')]});_0x40c26f[_0x7bc5d7['body'][_0xf6e9('0xcf')]]=_0x7bc5d7['body'][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')]['findOrCreate']({'where':_0x4b5c59,'defaults':_0x40c26f});}})[_0xf6e9('0xbc')](function(_0x563e18){if(_0x563e18){_0x4e5285=_0x563e18;var _0x1c592d=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x18ddba=ejs[_0xf6e9('0xd3')](_0x1c592d,{'body':_[_0xf6e9('0xd4')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]),'bodyTitle':_0xbd592c[_0xf6e9('0xd5')]});return db[_0xf6e9('0xd6')][_0xf6e9('0x5e')]({'body':_0x18ddba,'ContactId':_0x563e18['id'],'ChatWebsiteId':_0xbd592c['id']});}})[_0xf6e9('0x22')](function(_0x6c6df4){_0x54f87c=_0x6c6df4;if(_0x3ce98b[_0xf6e9('0x4c')]){var _0x11609c=_0x3ce98b[_0xf6e9('0x40')](function(_0x42ced5){return{'name':_0x42ced5[_0xf6e9('0xd7')],'basename':_0x42ced5['filename'],'type':_0x42ced5[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x6c6df4['id']};});_0x276654=_0x11609c['map'](_0x3f27b2=>{var _0x4750e9={'filename':_0x3f27b2[_0xf6e9('0x44')],'path':path['join'](config['root'],_0xf6e9('0xd9'),_0xf6e9('0xcd'),_0xf6e9('0xda'),_0xf6e9('0xdb'),_0x3f27b2[_0xf6e9('0xdc')])};return _0x4750e9;});if(!_0xbd592c[_0xf6e9('0xdd')]){return db[_0xf6e9('0xde')]['transaction'](function(_0x422322){return db['Attachment']['bulkCreate'](_0x11609c,{'transaction':_0x422322});});}}})['then'](function(){if(_0x54f87c){_0x51770a=_0x54f87c;return db[_0xf6e9('0xd1')][_0xf6e9('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xf6e9('0xdf')],'as':_0xf6e9('0xe0'),'raw':!![]}]});}})['then'](function(_0x138b35){if(_0x138b35&&_0x138b35[_0xf6e9('0xe0')]&&_0xbd592c['forwardOffline']&&_0xbd592c[_0xf6e9('0xe1')]){var _0x1c344d={'tls':{'rejectUnauthorized':![]}};if(_0x138b35['Smtp'][_0xf6e9('0xe2')]){_0x1c344d[_0xf6e9('0xe2')]=_0x138b35['Smtp'][_0xf6e9('0xe2')];}else{_0x1c344d['host']=_0x138b35[_0xf6e9('0xe0')]['host'];_0x1c344d[_0xf6e9('0xe3')]=_0x138b35['Smtp'][_0xf6e9('0xe3')];_0x1c344d[_0xf6e9('0xe4')]=_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe4')];}if(_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe5')]){_0x1c344d[_0xf6e9('0xe6')]={'user':_0x138b35[_0xf6e9('0xe0')]['user'],'pass':_0x138b35['Smtp'][_0xf6e9('0xe7')]};}return respondWithRpcPromise('SendMail',_0xf6e9('0xe8'),{'account':_0x1c344d,'message':{'from':util['format'](_0xf6e9('0xe9'),_0x138b35[_0xf6e9('0x44')],_0x138b35['email']||_0x138b35[_0xf6e9('0xe0')]['user']),'to':_0xbd592c[_0xf6e9('0xe1')],'subject':_0xbd592c[_0xf6e9('0xea')],'html':_0x51770a['body'],'attachments':_0x276654}},client9003)['then'](function(){return _0x51770a;})['catch'](function(_0x2fdf50){console['error'](_0x2fdf50);});}})[_0xf6e9('0x22')](function(){if(_0xbd592c&&_0xbd592c[_0xf6e9('0xdd')]&&_0xbd592c[_0xf6e9('0xeb')]){var _0x1f552c=[];if(_0x3ce98b['length']){_0x1f552c=_0x3ce98b[_0xf6e9('0x40')](function(_0x1ada23){return{'name':_0x1ada23['originalname'],'basename':_0x1ada23[_0xf6e9('0x73')],'type':_0x1ada23[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x54f87c['id']};});}var _0x3c8e72;if(!_[_0xf6e9('0x7b')](_0xbd592c[_0xf6e9('0xec')])){var _0x166f86=_[_0xf6e9('0x40')](_0x7bc5d7[_0xf6e9('0x5f')],function(_0x5672e3){return _0x5672e3;});var _0x3a2d03=_[_0xf6e9('0xed')](_0x166f86)[0x0];var _0x1ea261=_[_0xf6e9('0xee')](_0x3a2d03,function(_0x267946){return _0x267946;});_0x3c8e72=_0x1ea261[0x1][_0xbd592c[_0xf6e9('0xec')]];}var _0x284fbd={'from':_0x4e5285[_0xf6e9('0xef')],'firstName':_0x4e5285['firstName'],'lastName':_0x4e5285[_0xf6e9('0xac')],'mapKey':'email','message':{'from':_0x4e5285[_0xf6e9('0xef')],'to':_0xbd592c[_0xf6e9('0xd1')]['email'],'cc':'','subject':_[_0xf6e9('0x7b')](_0x3c8e72)?_0xbd592c[_0xf6e9('0xea')]:_0x3c8e72,'messageId':'','sentAt':new Date(),'attach':_0x1f552c['length'],'attachments':_0x1f552c,'originChannel':_0xf6e9('0xf0'),'ChatWebsiteId':_0xbd592c['id'],'ChatOfflineMessageId':_0x51770a['id'],'originTo':_0xbd592c[_0xf6e9('0xd1')][_0xf6e9('0xef')]},'body':_0x51770a[_0xf6e9('0x5f')]};var _0x2144a9={'account':{'id':_0xbd592c[_0xf6e9('0xeb')]},'body':_0x284fbd,'log':_0xf6e9('0xf1')};return respondWithRpcPromise(_0xf6e9('0xf1'),_0xf6e9('0xf2'),_0x2144a9,client9001)[_0xf6e9('0x22')](function(){return _0x51770a;})['catch'](function(_0x188663){console['error'](_0x188663);});}return;})[_0xf6e9('0x22')](function(){if(_0x51770a){return _0x51770a;}})[_0xf6e9('0x22')](respondWithResult(_0x3b77d5,null))[_0xf6e9('0x2b')](function(_0x3e1db3){console[_0xf6e9('0x28')](_0xf6e9('0x2b'),_0x3e1db3);for(var _0x4bec47 of _0x3ce98b){var _0x207632=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server',_0xf6e9('0xcd'),'attachments','offline-chat',_0x4bec47['filename']);fs_extra['remove'](_0x207632)[_0xf6e9('0x2b')](function(_0x35ab66){console[_0xf6e9('0x28')](_0xf6e9('0xf3'),_0x207632,_0x35ab66);});}});};exports[_0xf6e9('0xf4')]=function(_0x297eee,_0x50e7b5,_0x111ecb){return db[_0xf6e9('0xb8')]['find']({'where':{'id':_0x297eee['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x50e7b5,null))[_0xf6e9('0x22')](function(_0xe386b){if(_0xe386b){return _0xe386b[_0xf6e9('0xf4')](_0x297eee[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x297eee['body'],['ids','id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x50e7b5,null))[_0xf6e9('0x2b')](handleError(_0x50e7b5,null));};exports[_0xf6e9('0xf6')]=function(_0x329e8c,_0x1b91ea,_0xb27843){var _0x4ee38b={'raw':![],'where':{}};var _0x2eb405={};var _0x19661b={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x329e8c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1b91ea,null))['then'](function(_0x39809a){if(_0x39809a){_0x2eb405[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xb8')][_0xf6e9('0x41')]);_0x2eb405[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x329e8c[_0xf6e9('0x45')]);_0x2eb405[_0xf6e9('0x47')]=_['intersection'](_0x2eb405['model'],_0x2eb405['query']);_0x4ee38b[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2eb405[_0xf6e9('0x49')],qs['fields'](_0x329e8c['query'][_0xf6e9('0x4b')]));_0x4ee38b[_0xf6e9('0x4a')]=_0x4ee38b[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4ee38b[_0xf6e9('0x4a')]:_0x2eb405[_0xf6e9('0x49')];if(!_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4ee38b['limit']=qs[_0xf6e9('0x31')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4ee38b['offset']=qs[_0xf6e9('0x2f')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x4ee38b[_0xf6e9('0x4f')]=qs['sort'](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4ee38b['where']=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x329e8c[_0xf6e9('0x45')],_0x2eb405[_0xf6e9('0x47')]));_0x4ee38b[_0xf6e9('0x51')]['ChatWebsiteId']=_0x39809a['id'];if(_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4ee38b[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4ee38b['where'],{'$or':_[_0xf6e9('0x40')](_0x4ee38b[_0xf6e9('0x4a')],function(_0x2f3870){var _0x1c6130={};_0x1c6130[_0x2f3870]={'$like':'%'+_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x1c6130;})});}_0x4ee38b=_[_0xf6e9('0x5c')]({},_0x4ee38b,_0x329e8c[_0xf6e9('0x55')]);return db[_0xf6e9('0xb8')]['count']({'where':_0x4ee38b[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4993e8){_0x19661b[_0xf6e9('0x32')]=_0x4993e8;if(_0x329e8c[_0xf6e9('0x45')]['includeAll']){_0x4ee38b[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':_0xf6e9('0xf7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xf6e9('0x44'),'fullname',_0xf6e9('0xf8')],'required':![]},{'model':db[_0xf6e9('0xf9')],'as':_0xf6e9('0xfa'),'attributes':['id','name','color'],'where':_0x329e8c[_0xf6e9('0x45')]['tag']?{'id':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]}:undefined,'required':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]?!![]:![]}];}return db[_0xf6e9('0xb8')][_0xf6e9('0x57')](_0x4ee38b);})['then'](function(_0x1fbb14){_0x19661b[_0xf6e9('0x58')]=_0x1fbb14;return _0x19661b;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0x1b91ea,_0x4ee38b))[_0xf6e9('0x2b')](handleError(_0x1b91ea,null));};function iftimePromise(_0x4c7f0e,_0x25610c){return respondWithRpcPromise(_0xf6e9('0xfc'),'getSnippet',{'command':_0x25610c['timezone']?util[_0xf6e9('0xb0')](_0xf6e9('0xfd'),_0x4c7f0e['interval'],_0x25610c[_0xf6e9('0xfe')]):util[_0xf6e9('0xb0')]('iftime\x20%s',_0x4c7f0e[_0xf6e9('0xff')])},client9002)[_0xf6e9('0x22')](function(_0x386748){var _0x3a2621=_0x386748&&_0x386748['indexOf'](_0xf6e9('0x100'))>=0x0?!![]:![];logger[_0xf6e9('0x23')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e[_0xf6e9('0xff')],_0x3a2621?_0xf6e9('0x102'):_0xf6e9('0x103'),_0x25610c['timezone']?_0x25610c[_0xf6e9('0xfe')]:'No\x20timezone');return _0x3a2621;})[_0xf6e9('0x2b')](function(_0x273bce){logger[_0xf6e9('0x28')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e['interval'],util[_0xf6e9('0x104')](_0x273bce,{'showHidden':![],'depth':null}),_0x25610c[_0xf6e9('0xfe')]?_0x25610c[_0xf6e9('0xfe')]:_0xf6e9('0x105'));return![];});}exports[_0xf6e9('0x106')]=function(_0x243feb,_0x3f6bf7,_0x5a7060){var _0x4fe6e8=0x0;var _0x3acee6=0x0;var _0x2b54ea=![];var _0x3bd6bc;var _0x503330;return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x243feb[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x107')],'as':'Interval','include':[{'model':db[_0xf6e9('0x107')],'as':_0xf6e9('0x108'),'attributes':['id',_0xf6e9('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3f6bf7,null))[_0xf6e9('0x22')](function(_0x3f341e){if(_0x3f341e){_0x3bd6bc=_0x3f341e;return _0x3f341e[_0xf6e9('0x109')]({'raw':!![]});}})[_0xf6e9('0x22')](function(_0x3ad84a){if(_0x3bd6bc){if(_0x3ad84a){_0x503330=_0x3ad84a;}}return require('../../config/license/util')[_0xf6e9('0x7a')]();})['then'](function(_0x4f812a){if(_0x4f812a){_0x3acee6=_0x4f812a[_0xf6e9('0x10a')];_0x2b54ea=_0x4f812a['custom'];}})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0xb8')][_0xf6e9('0x32')]({'where':{'closed':![]}});})['then'](function(_0x53374f){_0x4fe6e8=_0x53374f;if(_0x3acee6&&_0x53374f>_0x3acee6){return db[_0xf6e9('0x10b')][_0xf6e9('0x68')]({'where':{'id':0x1}})[_0xf6e9('0x22')](function(_0xfcad4a){if(_0xfcad4a){_0xfcad4a[_0xf6e9('0x10c')]('chatLicenseExceeded');}});}})[_0xf6e9('0x22')](function(){if(_0x3bd6bc[_0xf6e9('0x107')]&&_0x3bd6bc['Interval'][_0xf6e9('0x108')]){var _0x579b45=[];for(var _0x5aab7d=0x0;_0x5aab7d<_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0xf6e9('0x4c')];_0x5aab7d++){var _0x4afc43=_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0x5aab7d][_0xf6e9('0x38')]({'plain':!![]});_0x579b45['push'](iftimePromise(_0x4afc43,_0x3bd6bc));}return BPromise['all'](_0x579b45)[_0xf6e9('0x22')](function(_0x3c9dd1){return _['some'](_0x3c9dd1);});}else{return!![];}})[_0xf6e9('0x22')](function(_0x2672f0){var _0x1951cf=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x10d')),_0xf6e9('0x10e'));var _0x121a5a={'remote':_0x3bd6bc[_0xf6e9('0x10f')],'query':querystring['stringify'](_['merge'](_0x3bd6bc[_0xf6e9('0x38')]({'plain':!![]}),{'customerIp':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xa9')]||_0x243feb['headers'][_0xf6e9('0x110')]||_0x243feb[_0xf6e9('0x111')][_0xf6e9('0x112')]||_0x243feb['ip'],'referer':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xae')],'openedInteractions':_0x4fe6e8,'maxInteractions':_0x3acee6,'virtual':_0x2b54ea[_0xf6e9('0x10a')],'online':_0x2672f0,'custom':_0x2b54ea}))[_0xf6e9('0x113')](/'/g,'\x5c\x27')};_0x3f6bf7[_0xf6e9('0x3c')](ejs[_0xf6e9('0xd3')](Mustache[_0xf6e9('0xd3')](_0x1951cf,_0x121a5a),{'proactiveActions':_0x503330,'alignment':_0x3bd6bc[_0xf6e9('0x114')],'verticalAlignment':_0x3bd6bc['verticalAlignment'],'div_color':_0x3bd6bc['color'],'text_color':_0x3bd6bc[_0xf6e9('0x115')],'button_color':_0x3bd6bc[_0xf6e9('0x116')],'background_color':_0x3bd6bc['backgroundColor']}));})[_0xf6e9('0x2b')](handleError(_0x3f6bf7,null));};exports[_0xf6e9('0x117')]=function(_0x1f668b,_0x2c2a34,_0x11d665){return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x1f668b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2c2a34,null))[_0xf6e9('0x22')](function(_0x51bcfd){if(_0x51bcfd){return db[_0xf6e9('0xde')][_0xf6e9('0x118')](function(_0x2c1d54){return db['ChatApplication'][_0xf6e9('0x37')]({'where':{'ChatWebsiteId':_0x1f668b['params']['id']},'transaction':_0x2c1d54})[_0xf6e9('0x22')](function(_0x53bd22){var _0x19b486=_['map'](_0x1f668b['body'],function(_0x46f51c){_0x46f51c['ChatWebsiteId']=_0x1f668b[_0xf6e9('0x5a')]['id'];return _0x46f51c;});return db[_0xf6e9('0x9f')][_0xf6e9('0x119')](_0x19b486,{'transaction':_0x2c1d54});});})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f668b[_0xf6e9('0x5a')]['id']},'order':_0xf6e9('0xa3')});});}})[_0xf6e9('0x22')](respondWithResult(_0x2c2a34,null))[_0xf6e9('0x2b')](handleError(_0x2c2a34,null));};exports[_0xf6e9('0x11a')]=function(_0x189e1a,_0x2f7925,_0x45b455){var _0x4bb45d={};var _0x2aa387={};var _0xaab1d8;var _0x302214;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x189e1a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2f7925,null))[_0xf6e9('0x22')](function(_0x15d1b7){if(_0x15d1b7){_0xaab1d8=_0x15d1b7;_0x2aa387[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x9f')][_0xf6e9('0x41')]);_0x2aa387[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x189e1a[_0xf6e9('0x45')]);_0x2aa387['filters']=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],_0x2aa387[_0xf6e9('0x45')]);_0x4bb45d[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],qs['fields'](_0x189e1a[_0xf6e9('0x45')]['fields']));_0x4bb45d[_0xf6e9('0x4a')]=_0x4bb45d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4bb45d[_0xf6e9('0x4a')]:_0x2aa387[_0xf6e9('0x49')];_0x4bb45d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4bb45d[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x189e1a[_0xf6e9('0x45')],_0x2aa387[_0xf6e9('0x47')]));if(_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4bb45d[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4bb45d[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x4bb45d[_0xf6e9('0x4a')],function(_0x490730){var _0xea9909={};_0xea9909[_0x490730]={'$like':'%'+_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0xea9909;})});}_0x4bb45d=_[_0xf6e9('0x5c')]({},_0x4bb45d,_0x189e1a[_0xf6e9('0x55')]);return _0xaab1d8['getApplications'](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x43e60a){if(_0x43e60a){_0x302214=_0x43e60a['length'];if(!_0x189e1a[_0xf6e9('0x45')]['hasOwnProperty'](_0xf6e9('0x4e'))){_0x4bb45d[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4bb45d[_0xf6e9('0x2f')]=qs['offset'](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}return _0xaab1d8[_0xf6e9('0x11a')](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x358caf){if(_0x358caf){return _0x358caf?{'count':_0x302214,'rows':_0x358caf}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x2f7925,null))['catch'](handleError(_0x2f7925,null));};exports[_0xf6e9('0x11b')]=function(_0x449f4c,_0x3b00cd,_0x332fd0){return db[_0xf6e9('0x11c')][_0xf6e9('0x5d')]({'where':{'id':_0x449f4c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b00cd,null))[_0xf6e9('0x22')](function(_0x40e196){if(_0x40e196){return _0x40e196['addProactiveActions'](_0x449f4c[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x449f4c[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x3b00cd,null))[_0xf6e9('0x2b')](handleError(_0x3b00cd,null));};exports['getProactiveActions']=function(_0x545542,_0x303007,_0x1334a4){var _0x4232f9={};var _0x17fc8f={};var _0x55b461;var _0x335005;return db[_0xf6e9('0x56')]['findOne']({'where':{'id':_0x545542[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x303007,null))[_0xf6e9('0x22')](function(_0x572783){if(_0x572783){_0x55b461=_0x572783;_0x17fc8f[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x11d')][_0xf6e9('0x41')]);_0x17fc8f['query']=_[_0xf6e9('0x46')](_0x545542[_0xf6e9('0x45')]);_0x17fc8f[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x17fc8f[_0xf6e9('0x49')],_0x17fc8f[_0xf6e9('0x45')]);_0x4232f9['attributes']=_['intersection'](_0x17fc8f['model'],qs['fields'](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4232f9[_0xf6e9('0x4a')]=_0x4232f9['attributes'][_0xf6e9('0x4c')]?_0x4232f9[_0xf6e9('0x4a')]:_0x17fc8f[_0xf6e9('0x49')];_0x4232f9['order']=qs[_0xf6e9('0x50')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4232f9[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x545542[_0xf6e9('0x45')],_0x17fc8f[_0xf6e9('0x47')]));if(_0x545542[_0xf6e9('0x45')]['filter']){_0x4232f9[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4232f9['where'],{'$or':_['map'](_0x4232f9[_0xf6e9('0x4a')],function(_0x39c0e4){var _0x5f20ff={};_0x5f20ff[_0x39c0e4]={'$like':'%'+_0x545542[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5f20ff;})});}_0x4232f9=_[_0xf6e9('0x5c')]({},_0x4232f9,_0x545542[_0xf6e9('0x55')]);return _0x55b461['getProactiveActions'](_0x4232f9);}})['then'](function(_0x1c20be){if(_0x1c20be){_0x335005=_0x1c20be[_0xf6e9('0x4c')];if(!_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4232f9[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4232f9[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x545542['query']['offset']);}return _0x55b461[_0xf6e9('0x109')](_0x4232f9);}})[_0xf6e9('0x22')](function(_0x27afd1){if(_0x27afd1){return _0x27afd1?{'count':_0x335005,'rows':_0x27afd1}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x303007,null))[_0xf6e9('0x2b')](handleError(_0x303007,null));};exports[_0xf6e9('0x11e')]=function(_0x100edb,_0x337e37,_0x28a1a7){var _0x57d9e4=_0x100edb[_0xf6e9('0x45')]['online']===_0xf6e9('0x11f')?'offlineForm':_0xf6e9('0x120');return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'attributes':['id',_0x57d9e4],'where':{'id':_0x100edb[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x337e37,null))[_0xf6e9('0x22')](function(_0x2971e0){if(_0x2971e0){var _0xb56642=_0x2971e0[_0x57d9e4];var _0x2e03af=_0xb56642&&_0xb56642[_0xf6e9('0x121')]?_0xb56642[_0xf6e9('0x121')]:[];_0x337e37[_0xf6e9('0x3c')]({'fromKey':_[_0xf6e9('0x7b')](_0xb56642[_0xf6e9('0x122')])?undefined:_0xb56642[_0xf6e9('0x122')],'count':_0x2e03af[_0xf6e9('0x4c')],'rows':_0x2e03af});}})[_0xf6e9('0x2b')](handleError(_0x337e37,null));};exports[_0xf6e9('0x123')]=function(_0x3d1940,_0x343e35,_0x448032){var _0x4f496d={'raw':![],'where':{}};var _0x46c6ee={};var _0x21be4d={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x3d1940[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x343e35,null))[_0xf6e9('0x22')](function(_0x290252){if(_0x290252){_0x46c6ee[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['ChatOfflineMessage'][_0xf6e9('0x41')]);_0x46c6ee['query']=_[_0xf6e9('0x46')](_0x3d1940[_0xf6e9('0x45')]);_0x46c6ee['filters']=_[_0xf6e9('0x48')](_0x46c6ee['model'],_0x46c6ee[_0xf6e9('0x45')]);_0x4f496d['attributes']=_[_0xf6e9('0x48')](_0x46c6ee['model'],qs['fields'](_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4f496d[_0xf6e9('0x4a')]=_0x4f496d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4f496d['attributes']:_0x46c6ee['model'];if(!_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x4f496d['limit']=qs['limit'](_0x3d1940['query'][_0xf6e9('0x31')]);_0x4f496d[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x3d1940[_0xf6e9('0x45')]['offset']);}_0x4f496d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x3d1940[_0xf6e9('0x45')]['sort']);_0x4f496d[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x3d1940['query'],_0x46c6ee[_0xf6e9('0x47')]));_0x4f496d[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x290252['id'];if(_0x3d1940['query'][_0xf6e9('0x53')]){_0x4f496d[_0xf6e9('0x51')]=_['merge'](_0x4f496d['where'],{'$or':_[_0xf6e9('0x40')](_0x4f496d[_0xf6e9('0x4a')],function(_0x3f3556){var _0x5226f5={};_0x5226f5[_0x3f3556]={'$like':'%'+_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5226f5;})});}_0x4f496d=_['merge']({},_0x4f496d,_0x3d1940[_0xf6e9('0x55')]);return db[_0xf6e9('0xd6')][_0xf6e9('0x32')]({'where':_0x4f496d['where']})[_0xf6e9('0x22')](function(_0x57c768){_0x21be4d[_0xf6e9('0x32')]=_0x57c768;if(_0x3d1940['query']['includeAll']){_0x4f496d[_0xf6e9('0x5b')]=[{'all':!![]}];}else{_0x4f496d[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':'Contact','required':![]},{'model':db[_0xf6e9('0x124')],'as':_0xf6e9('0x125'),'required':![]}];}return db[_0xf6e9('0xd6')][_0xf6e9('0x57')](_0x4f496d);})[_0xf6e9('0x22')](function(_0x2d017c){_0x21be4d[_0xf6e9('0x58')]=_0x2d017c;return _0x21be4d;});}})['then'](respondWithFilteredResult(_0x343e35,_0x4f496d))[_0xf6e9('0x2b')](handleError(_0x343e35,null));};exports[_0xf6e9('0x126')]=function(_0xb2125a,_0x29d620,_0x3c2114){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb2125a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x29d620,null))[_0xf6e9('0x22')](function(_0x3ac055){if(_0x3ac055){return _0x3ac055[_0xf6e9('0x126')](_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0xb2125a[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{})[_0xf6e9('0xbc')](function(_0x5ebfc3){for(var _0x265e42=0x0;_0x265e42<_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0xf6e9('0x4c')];_0x265e42+=0x1){socket['emit'](_0xf6e9('0x127'),{'UserId':Number(_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0x265e42]),'ChatWebsiteId':Number(_0xb2125a['params']['id'])});}return _0x5ebfc3;});}})[_0xf6e9('0x22')](respondWithResult(_0x29d620,null))[_0xf6e9('0x2b')](handleError(_0x29d620,null));};exports[_0xf6e9('0x128')]=function(_0xc3548c,_0x5680dd,_0x5e154b){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xc3548c['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x5680dd,null))[_0xf6e9('0x22')](function(_0x1da778){if(_0x1da778){return _0x1da778[_0xf6e9('0x128')](_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')])['then'](function(){if(_[_0xf6e9('0x129')](_0xc3548c['query'][_0xf6e9('0x6b')])){for(var _0x4a8b92=0x0;_0x4a8b92<_0xc3548c[_0xf6e9('0x45')]['ids'][_0xf6e9('0x4c')];_0x4a8b92+=0x1){socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')][_0x4a8b92]),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}}else{socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c['query']['ids']),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}});}})[_0xf6e9('0x22')](respondWithStatusCode(_0x5680dd,null))[_0xf6e9('0x2b')](handleError(_0x5680dd,null));};exports[_0xf6e9('0x12c')]=function(_0x4a3d6d,_0x5531ce,_0x2849d5){var _0x5afad7={};var _0x892cca={};var _0x117820;var _0x3c78d9;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x4a3d6d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5531ce,null))[_0xf6e9('0x22')](function(_0x2881b2){if(_0x2881b2){_0x117820=_0x2881b2;_0x892cca[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xc5')][_0xf6e9('0x41')]);_0x892cca['query']=_[_0xf6e9('0x46')](_0x4a3d6d['query']);_0x892cca[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x892cca['model'],_0x892cca['query']);_0x5afad7[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x892cca[_0xf6e9('0x49')],qs['fields'](_0x4a3d6d['query'][_0xf6e9('0x4b')]));_0x5afad7[_0xf6e9('0x4a')]=_0x5afad7['attributes'][_0xf6e9('0x4c')]?_0x5afad7[_0xf6e9('0x4a')]:_0x892cca['model'];_0x5afad7['order']=qs[_0xf6e9('0x50')](_0x4a3d6d['query'][_0xf6e9('0x50')]);_0x5afad7[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x4a3d6d[_0xf6e9('0x45')],_0x892cca['filters']));if(_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x5afad7[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x5afad7[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x5afad7['attributes'],function(_0x5c3c6a){var _0x427d09={};_0x427d09[_0x5c3c6a]={'$like':'%'+_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x427d09;})});}_0x5afad7=_['merge']({},_0x5afad7,_0x4a3d6d[_0xf6e9('0x55')]);return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0xba0834){if(_0xba0834){_0x3c78d9=_0xba0834[_0xf6e9('0x4c')];if(!_0x4a3d6d['query']['hasOwnProperty'](_0xf6e9('0x4e'))){_0x5afad7[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x5afad7[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x4a3d6d['query'][_0xf6e9('0x2f')]);}return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0x1d252a){if(_0x1d252a){return _0x1d252a?{'count':_0x3c78d9,'rows':_0x1d252a}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x5531ce,null))[_0xf6e9('0x2b')](handleError(_0x5531ce,null));}; \ No newline at end of file +var _0x796f=['difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','contact','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','UserId','User','agent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','attachments','offline-chat','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','addInteraction','ids','getInteractions','Owner','internal','Tag','color','tag','getSnippet','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','custom','increment','Intervals','push','all','some','server/files/chat/iframe.ejs','connection','remoteAddress','alignment','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','undefined','limit','count','offset','set','json','apply','reject','save','get','ChatWebsites','destroy','status','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','fields','length','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0x796f,0x98));var _0xf796=function(_0x2538c5,_0x398f64){_0x2538c5=_0x2538c5-0x0;var _0x3965d5=_0x796f[_0x2538c5];return _0x3965d5;};'use strict';var emlformat=require(_0xf796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf796('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf796('0x2'));var moment=require(_0xf796('0x3'));var BPromise=require(_0xf796('0x4'));var Mustache=require(_0xf796('0x5'));var util=require(_0xf796('0x6'));var path=require(_0xf796('0x7'));var sox=require('sox');var csv=require(_0xf796('0x8'));var ejs=require(_0xf796('0x9'));var fs=require('fs');var fs_extra=require(_0xf796('0xa'));var _=require(_0xf796('0xb'));var squel=require(_0xf796('0xc'));var crypto=require('crypto');var jsforce=require(_0xf796('0xd'));var deskjs=require(_0xf796('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf796('0xf'));var authService=require(_0xf796('0x10'));var qs=require(_0xf796('0x11'));var as=require(_0xf796('0x12'));var hardwareService=require(_0xf796('0x13'));var logger=require(_0xf796('0x14'))(_0xf796('0x15'));var utils=require(_0xf796('0x16'));var config=require(_0xf796('0x17'));var licenseUtil=require(_0xf796('0x18'));var db=require('../../mysqldb')['db'];config[_0xf796('0x19')]=_[_0xf796('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf796('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xf796('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf796('0x1d')][_0xf796('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xf796('0x1d')][_0xf796('0x1e')]({'port':0x232b});var client9001=jayson[_0xf796('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0x49e3fc,_0xad61e6,_0x1312a2,_0x3b6a39){return new BPromise(function(_0x4a590f,_0x535f32){var _0x2a5b11=_0x3b6a39||client;return _0x2a5b11['request'](_0x49e3fc,_0x1312a2)[_0xf796('0x1f')](function(_0x447b98){logger[_0xf796('0x20')](_0xf796('0x21'),_0xad61e6,_0xf796('0x22'));logger['debug'](_0xf796('0x23'),_0xad61e6,_0xf796('0x22'),JSON[_0xf796('0x24')](_0x447b98));if(_0x447b98[_0xf796('0x25')]){if(_0x447b98[_0xf796('0x25')]['code']===0x1f4){logger['error'](_0xf796('0x21'),_0xad61e6,_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);return _0x535f32(_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);}logger['error'](_0xf796('0x21'),_0xad61e6,_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);return _0x4a590f(_0x447b98['error'][_0xf796('0x26')]);}else{logger[_0xf796('0x20')](_0xf796('0x21'),_0xad61e6,_0xf796('0x22'));_0x4a590f(_0x447b98[_0xf796('0x27')][_0xf796('0x26')]);}})[_0xf796('0x28')](function(_0xc0b586){logger[_0xf796('0x25')](_0xf796('0x21'),_0xad61e6,_0xc0b586);_0x535f32(_0xc0b586);});});}function respondWithStatusCode(_0x3298d5,_0xa2b8b1){_0xa2b8b1=_0xa2b8b1||0xcc;return function(_0x1011cb){if(_0x1011cb){return _0x3298d5['sendStatus'](_0xa2b8b1);}return _0x3298d5['status'](_0xa2b8b1)[_0xf796('0x29')]();};}function respondWithResult(_0x42995b,_0x40792e){_0x40792e=_0x40792e||0xc8;return function(_0x26dc3c){if(_0x26dc3c){return _0x42995b['status'](_0x40792e)['json'](_0x26dc3c);}};}function respondWithFilteredResult(_0x39423e,_0x3228b4){return function(_0x3b4447){if(_0x3b4447){var _0x16c126=typeof _0x3228b4['offset']===_0xf796('0x2a')&&typeof _0x3228b4[_0xf796('0x2b')]===_0xf796('0x2a');var _0x4d1fd4=_0x3b4447[_0xf796('0x2c')];var _0x864ee9=_0x16c126?0x0:_0x3228b4['offset'];var _0x3ed80e=_0x16c126?_0x3b4447[_0xf796('0x2c')]:_0x3228b4[_0xf796('0x2d')]+_0x3228b4['limit'];var _0x3d5961;if(_0x3ed80e>=_0x4d1fd4){_0x3ed80e=_0x4d1fd4;_0x3d5961=0xc8;}else{_0x3d5961=0xce;}_0x39423e['status'](_0x3d5961);return _0x39423e[_0xf796('0x2e')]('Content-Range',_0x864ee9+'-'+_0x3ed80e+'/'+_0x4d1fd4)[_0xf796('0x2f')](_0x3b4447);}return null;};}function patchUpdates(_0x427bf7){return function(_0x43e698){try{jsonpatch[_0xf796('0x30')](_0x43e698,_0x427bf7,!![]);}catch(_0x278df7){return BPromise[_0xf796('0x31')](_0x278df7);}return _0x43e698[_0xf796('0x32')]();};}function saveUpdates(_0x5ed8a2,_0x51815c){return function(_0x110edc){if(_0x110edc){return _0x110edc['update'](_0x5ed8a2)[_0xf796('0x1f')](function(_0x48372c){return _0x48372c;});}return null;};}function removeEntity(_0x1d2362,_0x40121a){return function(_0x5bd283){if(_0x5bd283){return _0x5bd283['destroy']()[_0xf796('0x1f')](function(){var _0x39ca3f=_0x5bd283[_0xf796('0x33')]({'plain':!![]});var _0x428180=_0xf796('0x34');return db['UserProfileResource'][_0xf796('0x35')]({'where':{'type':_0x428180,'resourceId':_0x39ca3f['id']}})[_0xf796('0x1f')](function(){return _0x5bd283;});})['then'](function(){_0x1d2362[_0xf796('0x36')](0xcc)[_0xf796('0x29')]();});}};}function handleEntityNotFound(_0x4e9a10,_0x4a39fc){return function(_0x269119){if(!_0x269119){_0x4e9a10['sendStatus'](0x194);}return _0x269119;};}function handleError(_0x1dabe8,_0x4cf717){_0x4cf717=_0x4cf717||0x1f4;return function(_0x543a82){logger['error'](_0x543a82['stack']);if(_0x543a82[_0xf796('0x37')]){delete _0x543a82[_0xf796('0x37')];}_0x1dabe8[_0xf796('0x36')](_0x4cf717)[_0xf796('0x38')](_0x543a82);};}exports[_0xf796('0x39')]=function(_0x39f073,_0x2b8b67){var _0x47997a={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x8ff137={},_0x345ceb={'count':0x0,'rows':[]};var _0x5074c3=_[_0xf796('0x3a')](db[_0xf796('0x3b')][_0xf796('0x3c')],function(_0x419ae4){return{'name':_0x419ae4[_0xf796('0x3d')],'type':_0x419ae4[_0xf796('0x3e')][_0xf796('0x3f')]};});_0x8ff137[_0xf796('0x40')]=_[_0xf796('0x3a')](_0x5074c3,'name');_0x8ff137[_0xf796('0x41')]=_[_0xf796('0x42')](_0x39f073['query']);_0x8ff137[_0xf796('0x43')]=_[_0xf796('0x44')](_0x8ff137[_0xf796('0x40')],_0x8ff137[_0xf796('0x41')]);_0x47997a['attributes']=_[_0xf796('0x44')](_0x8ff137[_0xf796('0x40')],qs['fields'](_0x39f073[_0xf796('0x41')]['fields']));_0x47997a[_0xf796('0x45')]=_0x47997a[_0xf796('0x45')]['length']?_0x47997a[_0xf796('0x45')]:_0x8ff137[_0xf796('0x40')];if(!_0x39f073['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x47997a[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x39f073[_0xf796('0x41')]['limit']);_0x47997a[_0xf796('0x2d')]=qs['offset'](_0x39f073['query'][_0xf796('0x2d')]);}_0x47997a[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x39f073[_0xf796('0x41')][_0xf796('0x49')]);_0x47997a[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x39f073[_0xf796('0x41')],_0x8ff137[_0xf796('0x43')]),_0x5074c3);if(_0x39f073[_0xf796('0x41')][_0xf796('0x4c')]){_0x47997a[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x47997a[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x5074c3,function(_0x313d97){if(_0x313d97[_0xf796('0x3e')]!==_0xf796('0x4e')){var _0x314180={};_0x314180[_0x313d97[_0xf796('0x37')]]={'$like':'%'+_0x39f073[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x314180;}})});}_0x47997a=_['merge']({},_0x47997a,_0x39f073[_0xf796('0x4f')]);var _0x5e7e4c={'where':_0x47997a[_0xf796('0x4a')]};return db['ChatWebsite'][_0xf796('0x2c')](_0x5e7e4c)['then'](function(_0x1a846f){_0x345ceb['count']=_0x1a846f;if(_0x39f073[_0xf796('0x41')][_0xf796('0x50')]){_0x47997a[_0xf796('0x51')]=[{'all':!![]}];}return db[_0xf796('0x3b')][_0xf796('0x52')](_0x47997a);})['then'](function(_0x1a6e44){_0x345ceb[_0xf796('0x53')]=_0x1a6e44;return _0x345ceb;})['then'](respondWithFilteredResult(_0x2b8b67,_0x47997a))[_0xf796('0x28')](handleError(_0x2b8b67,null));};exports[_0xf796('0x54')]=function(_0x46ec16,_0x364367){var _0x4b654c={'raw':![],'where':{'id':_0x46ec16[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x56')],'as':'mandatoryDispositionPause'}]},_0x526855={};_0x526855[_0xf796('0x40')]=_[_0xf796('0x42')](db['ChatWebsite']['rawAttributes']);_0x526855[_0xf796('0x41')]=_['keys'](_0x46ec16[_0xf796('0x41')]);_0x526855[_0xf796('0x43')]=_['intersection'](_0x526855[_0xf796('0x40')],_0x526855[_0xf796('0x41')]);_0x4b654c['attributes']=_[_0xf796('0x44')](_0x526855[_0xf796('0x40')],qs[_0xf796('0x57')](_0x46ec16[_0xf796('0x41')]['fields']));_0x4b654c[_0xf796('0x45')]=_0x4b654c[_0xf796('0x45')][_0xf796('0x58')]?_0x4b654c[_0xf796('0x45')]:_0x526855[_0xf796('0x40')];if(_0x46ec16['query'][_0xf796('0x50')]){_0x4b654c[_0xf796('0x51')]=[{'all':!![]}];}_0x4b654c=_[_0xf796('0x4d')]({},_0x4b654c,_0x46ec16[_0xf796('0x4f')]);return db['ChatWebsite']['find'](_0x4b654c)[_0xf796('0x1f')](handleEntityNotFound(_0x364367,null))[_0xf796('0x1f')](respondWithResult(_0x364367,null))[_0xf796('0x28')](handleError(_0x364367,null));};exports[_0xf796('0x59')]=function(_0x3b4e81,_0x34e295){return db['ChatWebsite'][_0xf796('0x59')](_0x3b4e81[_0xf796('0x5a')],{})[_0xf796('0x1f')](function(_0x2e3702){var _0x4ef670=_0x3b4e81[_0xf796('0x5b')]['get']({'plain':!![]});if(!_0x4ef670)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ef670['role']===_0xf796('0x5b')){var _0x28b5b8=_0x2e3702['get']({'plain':!![]});var _0x1cb62e=_0xf796('0x34');return db[_0xf796('0x5c')][_0xf796('0x5d')]({'where':{'name':_0x1cb62e,'userProfileId':_0x4ef670[_0xf796('0x5e')]},'raw':!![]})[_0xf796('0x1f')](function(_0x172bcf){if(_0x172bcf&&_0x172bcf[_0xf796('0x5f')]===0x0){return db[_0xf796('0x60')][_0xf796('0x59')]({'name':_0x28b5b8['name'],'resourceId':_0x28b5b8['id'],'type':_0x172bcf[_0xf796('0x37')],'sectionId':_0x172bcf['id']},{})[_0xf796('0x1f')](function(){return _0x2e3702;});}else{return _0x2e3702;}})['catch'](function(_0x3f4d96){logger[_0xf796('0x25')](_0xf796('0x61'),_0x3f4d96);throw _0x3f4d96;});}return _0x2e3702;})[_0xf796('0x1f')](respondWithResult(_0x34e295,0xc9))[_0xf796('0x28')](handleError(_0x34e295,null));};exports[_0xf796('0x62')]=function(_0x2f61e0,_0x53f449){if(_0x2f61e0['body']['id']){delete _0x2f61e0[_0xf796('0x5a')]['id'];}return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x2f61e0[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x56')],'as':_0xf796('0x63')}]})[_0xf796('0x1f')](handleEntityNotFound(_0x53f449,null))[_0xf796('0x1f')](saveUpdates(_0x2f61e0[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x53f449,null))['catch'](handleError(_0x53f449,null));};exports[_0xf796('0x35')]=function(_0x33ae5d,_0x12518d){return db[_0xf796('0x3b')]['find']({'where':{'id':_0x33ae5d[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x12518d,null))[_0xf796('0x1f')](removeEntity(_0x12518d,null))[_0xf796('0x28')](handleError(_0x12518d,null));};exports[_0xf796('0x64')]=function(_0x36a6ae,_0x4c6519){return db[_0xf796('0x3b')][_0xf796('0x64')]()[_0xf796('0x1f')](respondWithResult(_0x4c6519,null))['catch'](handleError(_0x4c6519,null));};exports[_0xf796('0x65')]=function(_0x522999,_0x6fa191,_0x208783){if(_0x522999[_0xf796('0x5a')]['id']){delete _0x522999[_0xf796('0x5a')]['id'];}return db[_0xf796('0x3b')]['find']({'where':{'id':_0x522999['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x6fa191,null))[_0xf796('0x1f')](function(_0x1f9875){if(_0x1f9875){_0x522999[_0xf796('0x5a')][_0xf796('0x66')]=_0x1f9875['id'];return db[_0xf796('0x67')][_0xf796('0x59')](_0x522999[_0xf796('0x5a')]);}})[_0xf796('0x1f')](respondWithResult(_0x6fa191,null))['catch'](handleError(_0x6fa191,null));};exports['getDispositions']=function(_0x54e73d,_0x29557c,_0x2291d5){var _0x4fc463={'raw':![],'where':{}};var _0xdc81c1={};var _0x17113f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf796('0x68')]({'where':{'id':_0x54e73d[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x29557c,null))[_0xf796('0x1f')](function(_0x422d71){if(_0x422d71){_0xdc81c1[_0xf796('0x40')]=_[_0xf796('0x42')](db[_0xf796('0x67')]['rawAttributes']);_0xdc81c1[_0xf796('0x41')]=_[_0xf796('0x42')](_0x54e73d[_0xf796('0x41')]);_0xdc81c1['filters']=_[_0xf796('0x44')](_0xdc81c1[_0xf796('0x40')],_0xdc81c1[_0xf796('0x41')]);_0x4fc463['attributes']=_[_0xf796('0x44')](_0xdc81c1[_0xf796('0x40')],qs[_0xf796('0x57')](_0x54e73d[_0xf796('0x41')][_0xf796('0x57')]));_0x4fc463[_0xf796('0x45')]=_0x4fc463[_0xf796('0x45')][_0xf796('0x58')]?_0x4fc463[_0xf796('0x45')]:_0xdc81c1[_0xf796('0x40')];if(!_0x54e73d['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x4fc463[_0xf796('0x2b')]=qs['limit'](_0x54e73d[_0xf796('0x41')][_0xf796('0x2b')]);_0x4fc463[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x54e73d['query'][_0xf796('0x2d')]);}_0x4fc463[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x54e73d[_0xf796('0x41')][_0xf796('0x49')]);_0x4fc463[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x54e73d[_0xf796('0x41')],_0xdc81c1[_0xf796('0x43')]));_0x4fc463[_0xf796('0x4a')][_0xf796('0x66')]=_0x422d71['id'];if(_0x54e73d['query'][_0xf796('0x4c')]){_0x4fc463[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x4fc463[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x4fc463[_0xf796('0x45')],function(_0x1ba784){var _0x59e8af={};_0x59e8af[_0x1ba784]={'$like':'%'+_0x54e73d[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x59e8af;})});}_0x4fc463=_[_0xf796('0x4d')]({},_0x4fc463,_0x54e73d['options']);return db['Disposition'][_0xf796('0x2c')]({'where':_0x4fc463[_0xf796('0x4a')]})['then'](function(_0x38c7eb){_0x17113f['count']=_0x38c7eb;if(_0x54e73d[_0xf796('0x41')][_0xf796('0x50')]){_0x4fc463[_0xf796('0x51')]=[{'all':!![]}];}return db['Disposition'][_0xf796('0x52')](_0x4fc463);})[_0xf796('0x1f')](function(_0x5114d3){_0x17113f[_0xf796('0x53')]=_0x5114d3;return _0x17113f;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x29557c,_0x4fc463))['catch'](handleError(_0x29557c,null));};exports[_0xf796('0x69')]=function(_0x167315,_0x2259b4,_0x4fc63a){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x167315['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2259b4,null))[_0xf796('0x1f')](function(_0x5bfed5){if(_0x5bfed5){return _0x5bfed5['removeDispositions'](_0x167315[_0xf796('0x41')]['ids']);}})[_0xf796('0x1f')](respondWithStatusCode(_0x2259b4,null))[_0xf796('0x28')](handleError(_0x2259b4,null));};exports[_0xf796('0x6a')]=function(_0x3f3fa2,_0x4ee6d1,_0x2659bf){if(_0x3f3fa2['body']['id']){delete _0x3f3fa2['body']['id'];}return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x3f3fa2[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ee6d1,null))[_0xf796('0x1f')](function(_0x1669a9){if(_0x1669a9){_0x3f3fa2[_0xf796('0x5a')][_0xf796('0x66')]=_0x1669a9['id'];return db[_0xf796('0x6b')]['create'](_0x3f3fa2[_0xf796('0x5a')]);}})[_0xf796('0x1f')](respondWithResult(_0x4ee6d1,null))[_0xf796('0x28')](handleError(_0x4ee6d1,null));};exports['getAnswers']=function(_0x9d905c,_0x256382,_0x4078db){var _0x47f6b9={'raw':![],'where':{}};var _0xcc63b0={};var _0x2fa78f={'count':0x0,'rows':[]};return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x9d905c['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x256382,null))[_0xf796('0x1f')](function(_0x25c79c){if(_0x25c79c){_0xcc63b0[_0xf796('0x40')]=_['keys'](db['CannedAnswer'][_0xf796('0x3c')]);_0xcc63b0[_0xf796('0x41')]=_[_0xf796('0x42')](_0x9d905c['query']);_0xcc63b0[_0xf796('0x43')]=_['intersection'](_0xcc63b0['model'],_0xcc63b0['query']);_0x47f6b9[_0xf796('0x45')]=_[_0xf796('0x44')](_0xcc63b0[_0xf796('0x40')],qs['fields'](_0x9d905c[_0xf796('0x41')][_0xf796('0x57')]));_0x47f6b9[_0xf796('0x45')]=_0x47f6b9[_0xf796('0x45')][_0xf796('0x58')]?_0x47f6b9[_0xf796('0x45')]:_0xcc63b0[_0xf796('0x40')];if(!_0x9d905c['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x47f6b9[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x9d905c['query'][_0xf796('0x2b')]);_0x47f6b9['offset']=qs[_0xf796('0x2d')](_0x9d905c[_0xf796('0x41')][_0xf796('0x2d')]);}_0x47f6b9[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x9d905c[_0xf796('0x41')]['sort']);_0x47f6b9[_0xf796('0x4a')]=qs[_0xf796('0x43')](_['pick'](_0x9d905c['query'],_0xcc63b0[_0xf796('0x43')]));_0x47f6b9['where'][_0xf796('0x66')]=_0x25c79c['id'];if(_0x9d905c[_0xf796('0x41')][_0xf796('0x4c')]){_0x47f6b9[_0xf796('0x4a')]=_['merge'](_0x47f6b9['where'],{'$or':_[_0xf796('0x3a')](_0x47f6b9['attributes'],function(_0x36efae){var _0xbe693a={};_0xbe693a[_0x36efae]={'$like':'%'+_0x9d905c['query'][_0xf796('0x4c')]+'%'};return _0xbe693a;})});}_0x47f6b9=_['merge']({},_0x47f6b9,_0x9d905c[_0xf796('0x4f')]);return db[_0xf796('0x6b')][_0xf796('0x2c')]({'where':_0x47f6b9[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0x307ff4){_0x2fa78f['count']=_0x307ff4;if(_0x9d905c['query'][_0xf796('0x50')]){_0x47f6b9[_0xf796('0x51')]=[{'all':!![]}];}return db[_0xf796('0x6b')][_0xf796('0x52')](_0x47f6b9);})['then'](function(_0x1736ac){_0x2fa78f[_0xf796('0x53')]=_0x1736ac;return _0x2fa78f;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x256382,_0x47f6b9))[_0xf796('0x28')](handleError(_0x256382,null));};exports[_0xf796('0x6c')]=function(_0x7e3650,_0x203b60,_0x4472c5){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x7e3650[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x203b60,null))[_0xf796('0x1f')](function(_0x29052a){if(_0x29052a){return _0x29052a[_0xf796('0x6c')](_0x7e3650['query']['ids']);}})[_0xf796('0x1f')](respondWithStatusCode(_0x203b60,null))[_0xf796('0x28')](handleError(_0x203b60,null));};exports[_0xf796('0x6d')]=function(_0x861962,_0x37a11b,_0x168689){_0x861962[_0xf796('0x5a')][_0xf796('0x6e')]=_0x861962['file'][_0xf796('0x6f')];return db[_0xf796('0x3b')]['find']({'where':{'id':_0x861962[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x37a11b,null))[_0xf796('0x1f')](saveUpdates(_0x861962[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x37a11b,null))[_0xf796('0x28')](handleError(_0x37a11b,null));};exports[_0xf796('0x70')]=function(_0x4b8bd2,_0x2d514f,_0x46d980){_0x4b8bd2[_0xf796('0x5a')]['agentAvatar']=_0x4b8bd2[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')]['find']({'where':{'id':_0x4b8bd2[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2d514f,null))[_0xf796('0x1f')](saveUpdates(_0x4b8bd2[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x2d514f,null))[_0xf796('0x28')](handleError(_0x2d514f,null));};exports[_0xf796('0x72')]=function(_0x38d147,_0x2f5273,_0x15e200){_0x38d147[_0xf796('0x5a')]['customerAvatar']=_0x38d147[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x38d147[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2f5273,null))[_0xf796('0x1f')](saveUpdates(_0x38d147['body'],null))[_0xf796('0x1f')](respondWithResult(_0x2f5273,null))[_0xf796('0x28')](handleError(_0x2f5273,null));};exports['addSystemAvatar']=function(_0x4e3075,_0x1c02de,_0x5633af){_0x4e3075['body'][_0xf796('0x73')]=_0x4e3075[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x4e3075[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x1c02de,null))[_0xf796('0x1f')](saveUpdates(_0x4e3075[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x1c02de,null))[_0xf796('0x28')](handleError(_0x1c02de,null));};exports['getLogo']=function(_0x5ce028,_0x3b5710,_0x4bb142){var _0x16dd13=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x76'));var _0x49568a={'where':{'id':_0x5ce028['params']['id']},'attributes':['id',_0xf796('0x6e')],'raw':!![]};var _0x4ecbe2=![];return require(_0xf796('0x18'))[_0xf796('0x77')]()[_0xf796('0x1f')](function(_0x35b865){if(_0x35b865){_0x4ecbe2=_0x35b865['custom'];}})[_0xf796('0x1f')](function(){return db[_0xf796('0x3b')]['find'](_0x49568a);})['then'](handleEntityNotFound(_0x3b5710,null))['then'](function(_0x9b3613){if(_0x9b3613){if(!_[_0xf796('0x78')](_0x9b3613[_0xf796('0x6e')])){if(fs[_0xf796('0x79')](path['join'](config[_0xf796('0x75')],'server/files/images/logos/',_0x9b3613[_0xf796('0x6e')]))&&_0x4ecbe2){_0x16dd13=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x7a'),_0x9b3613[_0xf796('0x6e')]);}}return _0x3b5710[_0xf796('0x7b')](_0x16dd13);}})[_0xf796('0x28')](handleError(_0x3b5710,null));};exports['getAvatar']=function(_0x322922,_0x240619,_0x5069c4){var _0x541960=path[_0xf796('0x74')](config['root'],_0xf796('0x7c'));var _0x5899bc={'where':{'id':_0x322922['params']['id']},'attributes':['id',_0xf796('0x7d')],'raw':!![]};return db[_0xf796('0x3b')][_0xf796('0x5d')](_0x5899bc)[_0xf796('0x1f')](handleEntityNotFound(_0x240619,null))[_0xf796('0x1f')](function(_0x7c7aca){if(_0x7c7aca){if(!_[_0xf796('0x78')](_0x7c7aca[_0xf796('0x7d')])){if(fs['existsSync'](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x7c7aca['agentAvatar']))){_0x541960=path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x7c7aca[_0xf796('0x7d')]);}}return _0x240619[_0xf796('0x7b')](_0x541960);}})['catch'](handleError(_0x240619,null));};exports[_0xf796('0x7e')]=function(_0x342e41,_0x1a1bdb,_0x22e452){var _0x1c84b8=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x7f'));var _0x187cb9={'where':{'id':_0x342e41[_0xf796('0x55')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf796('0x5d')](_0x187cb9)[_0xf796('0x1f')](handleEntityNotFound(_0x1a1bdb,null))['then'](function(_0x4cbc87){if(_0x4cbc87){if(!_[_0xf796('0x78')](_0x4cbc87[_0xf796('0x80')])){if(fs[_0xf796('0x79')](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x4cbc87[_0xf796('0x80')]))&&_0x4cbc87[_0xf796('0x81')]){_0x1c84b8=path[_0xf796('0x74')](config['root'],_0xf796('0x82'),_0x4cbc87[_0xf796('0x80')]);}}return _0x1a1bdb[_0xf796('0x7b')](_0x1c84b8);}})['catch'](handleError(_0x1a1bdb,null));};exports[_0xf796('0x83')]=function(_0x10ec14,_0x4a6099,_0x18fb7a){var _0x2936e9=path['join'](config[_0xf796('0x75')],_0xf796('0x84'));var _0xa6c8ec={'where':{'id':_0x10ec14[_0xf796('0x55')]['id']},'attributes':['id',_0xf796('0x73')],'raw':!![]};return db[_0xf796('0x3b')][_0xf796('0x5d')](_0xa6c8ec)[_0xf796('0x1f')](handleEntityNotFound(_0x4a6099,null))[_0xf796('0x1f')](function(_0x4f5c3a){if(_0x4f5c3a){if(!_[_0xf796('0x78')](_0x4f5c3a[_0xf796('0x73')])){if(fs[_0xf796('0x79')](path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x82'),_0x4f5c3a[_0xf796('0x73')]))){_0x2936e9=path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x4f5c3a[_0xf796('0x73')]);}}return _0x4a6099[_0xf796('0x7b')](_0x2936e9);}})['catch'](handleError(_0x4a6099,null));};exports[_0xf796('0x85')]=function(_0x20562a,_0x7f68c4,_0x4b6ce6){var _0x38ca57=require(_0xf796('0x86'));var _0x1a649f=new _0x38ca57();var _0x4aa8bc=_0x1a649f['setUA'](_0x20562a[_0xf796('0x87')][_0xf796('0x88')])['getResult']();var _0xf2b457={'body':_0x20562a[_0xf796('0x5a')],'channel':_0xf796('0x89')};var _0x3596fd=[];var _0x541bc1=[];var _0x5d7912={};var _0x5171e5=![];return db[_0xf796('0x8a')][_0xf796('0x64')]()[_0xf796('0x1f')](function(_0x582039){if(!_0x582039){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x8d'));}_0x3596fd=_[_0xf796('0x8e')](_['keys'](_0x582039),[_0xf796('0x8f'),_0xf796('0x90')]);_0x541bc1=_[_0xf796('0x8e')](_['keys'](_0x582039),[_0xf796('0x8f'),'updatedAt',_0xf796('0x91'),_0xf796('0x92')]);if(_0x20562a['body']['id']){delete _0x20562a[_0xf796('0x5a')]['id'];}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')][_0xf796('0x93')])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x94'));}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')][_0xf796('0x5a')])||_0x20562a[_0xf796('0x5a')][_0xf796('0x5a')]===''){throw new db['Sequelize'][(_0xf796('0x8c'))](_0xf796('0x95'));}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')]['mapKey'])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x96')+_0x541bc1);}if(!_[_0xf796('0x97')](_0x541bc1,_0x20562a[_0xf796('0x5a')][_0xf796('0x98')])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x541bc1);}_0x5d7912[_0x20562a[_0xf796('0x5a')]['mapKey']]=_0x20562a['body']['from'];})[_0xf796('0x1f')](function(){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x20562a[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x99')],'as':'List','include':[{'model':db[_0xf796('0x8a')],'as':_0xf796('0x9a'),'where':_0x5d7912,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf796('0x9b')],'as':_0xf796('0x9c')}]});})[_0xf796('0x1f')](handleEntityNotFound(_0x7f68c4,null))[_0xf796('0x1f')](function(_0x22589c){if(_0x22589c&&_0x22589c['List']){_0xf2b457[_0xf796('0x9d')]=_0x22589c;_0xf2b457[_0xf796('0x9e')]=_0x22589c[_0xf796('0x9c')];_0xf2b457[_0xf796('0x9f')]=_0x22589c[_0xf796('0xa0')];_0xf2b457[_0xf796('0x9e')]=_[_0xf796('0xa1')](_0xf2b457[_0xf796('0x9e')],[_0xf796('0xa2')],[_0xf796('0xa3')]);if(_0xf2b457['account'][_0xf796('0x9c')]){delete _0xf2b457[_0xf796('0x9d')][_0xf796('0x9c')];}if(_0xf2b457['account']['List']&&_0xf2b457[_0xf796('0x9d')][_0xf796('0xa0')][_0xf796('0x9a')][_0xf796('0x58')]){return _0xf2b457[_0xf796('0x9d')][_0xf796('0xa0')][_0xf796('0x9a')][0x0];}var _0x3c97e9=_[_0xf796('0x1a')](_0x20562a[_0xf796('0x5a')],{'firstName':_0x20562a[_0xf796('0x5a')]['from'],'ListId':_0x22589c[_0xf796('0x92')]});_0x3c97e9[_0x20562a[_0xf796('0x5a')][_0xf796('0x98')]]=_0x20562a['body'][_0xf796('0x93')];return db[_0xf796('0x8a')][_0xf796('0x59')](_0x3c97e9,{'fields':_0x3596fd,'raw':!![]});}})[_0xf796('0x1f')](handleEntityNotFound(_0x7f68c4,null))[_0xf796('0x1f')](function(_0x4fae14){_0xf2b457[_0xf796('0xa4')]=_0x4fae14;var _0x5a3d96=_0x20562a[_0xf796('0x5a')]['customerIp'];if(_0x20562a[_0xf796('0x87')][_0xf796('0xa5')]){_0x5a3d96=_0x20562a[_0xf796('0x87')]['cf-connecting-ip'];}else if(_0x20562a[_0xf796('0x87')]['x-forwarded-for']){_0x5a3d96=_[_0xf796('0xa6')](_0x20562a[_0xf796('0x87')][_0xf796('0xa7')][_0xf796('0xa8')](','));}if(_0x4fae14){var _0x251f51={'ContactId':_0x4fae14['id'],'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'from':(_0x4fae14['firstName']||'')+'\x20'+(_0x4fae14[_0xf796('0xa9')]||''),'customerIp':_0x5a3d96,'customerPort':_0x20562a['headers']['x-real-port']?_0x20562a['headers'][_0xf796('0xaa')]:null,'referer':_0x20562a[_0xf796('0x5a')][_0xf796('0xab')],'browserName':_0x4aa8bc[_0xf796('0xac')]['name']&&_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]?util['format'](_0xf796('0xae'),_0x4aa8bc[_0xf796('0xac')][_0xf796('0x37')],_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]):'unknown','browserVersion':_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]||_0xf796('0xaf'),'osName':util[_0xf796('0xb0')](_0xf796('0xae'),_0x4aa8bc['os'][_0xf796('0x37')],_0x4aa8bc['os'][_0xf796('0xad')]),'osVersion':_0x4aa8bc['os'][_0xf796('0xad')],'deviceModel':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x40')]&&_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')]?util[_0xf796('0xb0')](_0xf796('0xb3'),_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x40')],_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')],_0x4aa8bc[_0xf796('0xb1')]['type']):null,'deviceVendor':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')],'deviceType':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x3e')],'formData':JSON[_0xf796('0x24')](_0x20562a[_0xf796('0x5a')])};var _0x191982={'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'closed':![]};if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]){_0x191982[_0xf796('0xb4')]=_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')];return db[_0xf796('0xb5')]['find']({'where':_0x191982})['then'](function(_0x1f7d5a){if(_0x1f7d5a){return[_0x1f7d5a,![]];}_0x251f51[_0xf796('0xb4')]=_0x20562a['body'][_0xf796('0xb4')];_0x251f51[_0xf796('0xb6')]=_0x20562a['body'][_0xf796('0xb6')];return db['ChatInteraction'][_0xf796('0x59')](_0x251f51)[_0xf796('0x1f')](function(_0x295d7b){return[_0x295d7b,!![]];});});}_0x191982['ContactId']=_0x4fae14['id'];if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb7')]&&_0x20562a[_0xf796('0x5a')]['interaction']['id']){_0x191982['id']=_0x20562a[_0xf796('0x5a')][_0xf796('0xb7')]['id'];return db['ChatInteraction'][_0xf796('0x5d')]({'where':_0x191982})[_0xf796('0x1f')](function(_0x2622d0){if(_0x2622d0){return[_0x2622d0,![]];}return db[_0xf796('0xb5')][_0xf796('0x59')](_0x251f51)[_0xf796('0x1f')](function(_0x241039){return[_0x241039,!![]];});});}return db['ChatInteraction'][_0xf796('0x59')](_0x251f51)['then'](function(_0x1369bc){return[_0x1369bc,!![]];});}})['spread'](function(_0x12c058,_0x3d8373){if(_0x12c058){_0x5171e5=_0x3d8373;if(!_0x3d8373){var _0x2d2d0e={'from':(_0xf2b457[_0xf796('0xa4')][_0xf796('0xb8')]||'')+'\x20'+(_0xf2b457[_0xf796('0xa4')][_0xf796('0xa9')]||'')};if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]&&_0x20562a[_0xf796('0x5a')][_0xf796('0xb9')]&&_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]!=_0x20562a['body'][_0xf796('0xb9')]){_0x2d2d0e[_0xf796('0xb4')]=_0x20562a['body'][_0xf796('0xb9')];}return _0x12c058[_0xf796('0x62')](_0x2d2d0e);}else{return _0x12c058;}}})[_0xf796('0x1f')](function(_0x3433c8){_0xf2b457[_0xf796('0xb7')]=_0x3433c8[_0xf796('0x33')]({'plain':!![]});_0xf2b457[_0xf796('0xb7')][_0xf796('0xba')]=_0x5171e5;if(_0xf2b457[_0xf796('0xb7')]['created']){if(_0xf2b457[_0xf796('0x9d')][_0xf796('0xbb')]){_0xf2b457[_0xf796('0x9e')]['push']({'id':0x0,'priority':_0xf2b457[_0xf796('0x9e')][_0xf796('0x58')]+0x1,'app':_0xf796('0xbc'),'appdata':_0xf796('0xbd'),'interval':'*,*,*,*'});}}return db[_0xf796('0xbe')][_0xf796('0x59')]({'body':_0x20562a['body'][_0xf796('0x5a')],'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'ChatInteractionId':_0x3433c8['id'],'direction':'in','ContactId':_0xf2b457[_0xf796('0xa4')]['id'],'AttachmentId':_0x20562a[_0xf796('0x5a')]['AttachmentId']});})[_0xf796('0x1f')](function(_0x390237){_0xf2b457[_0xf796('0x26')]=_0x390237;if(_0xf2b457[_0xf796('0xb7')][_0xf796('0xbf')]){return db[_0xf796('0xc0')][_0xf796('0x5d')]({'attributes':['id',_0xf796('0x37')],'where':{'id':_0xf2b457[_0xf796('0xb7')][_0xf796('0xbf')]}})[_0xf796('0x1f')](function(_0x36ae70){if(_0x36ae70){_0xf2b457[_0xf796('0x9e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf796('0xc1'),'appdata':_0x36ae70[_0xf796('0x37')]+','+(_0xf2b457['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf796('0xc2')});_0xf2b457[_0xf796('0xc3')]=!![];}return respondWithRpcPromise('Start',_0xf796('0xc4'),_0xf2b457);});}return respondWithRpcPromise(_0xf796('0xc5'),'startRouting',_0xf2b457);})[_0xf796('0x1f')](function(_0x4870f3){respondWithRpcPromise(_0xf796('0xc6'),_0xf796('0xc6'),{'event':_0xf796('0x85'),'message':_0x4870f3},client9002);return _0x4870f3;})[_0xf796('0x1f')](respondWithResult(_0x7f68c4,null))[_0xf796('0x28')](handleError(_0x7f68c4,null));};exports[_0xf796('0xc7')]=function(_0x4d5068,_0x4e6276,_0x2d2098){var _0x8b202e,_0x4ce935,_0x98877;var _0x3c3d73=[];var _0x2383fd=[];var _0x5849dc={};var _0x27e5e7=_0x4d5068[_0xf796('0xc8')]||[];var _0x2fcb30=[];var _0x3aa912;return db['CmContact']['describe']()[_0xf796('0x1f')](function(_0x4231cc){if(!_0x4231cc){throw new db['Sequelize'][(_0xf796('0x8c'))](_0xf796('0x8d'));}_0x2383fd=_[_0xf796('0x8e')](_[_0xf796('0x42')](_0x4231cc),[_0xf796('0x8f'),'updatedAt']);_0x3c3d73=_[_0xf796('0x8e')](_[_0xf796('0x42')](_0x4231cc),[_0xf796('0x8f'),_0xf796('0x90'),_0xf796('0x91'),_0xf796('0x92')]);if(_0x4d5068[_0xf796('0x5a')]['id']){delete _0x4d5068['body']['id'];}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')]['from'])){throw _0x4e6276[_0xf796('0x36')](0x1f4)['send'](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x94')));}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')]['body'])||_0x4d5068[_0xf796('0x5a')][_0xf796('0x5a')]===''){throw _0x4e6276[_0xf796('0x36')](0x1f4)['send'](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')])){throw _0x4e6276[_0xf796('0x36')](0x1f4)[_0xf796('0x38')](new db[(_0xf796('0x8b'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c3d73));}if(!_[_0xf796('0x97')](_0x3c3d73,_0x4d5068[_0xf796('0x5a')]['mapKeyOffline'])){throw _0x4e6276[_0xf796('0x36')](0x1f4)[_0xf796('0x38')](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0xca')+_0x3c3d73));}_0x5849dc[_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')]]=_0x4d5068[_0xf796('0x5a')][_0xf796('0x93')];})['then'](function(){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x4d5068[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x99')],'as':_0xf796('0xa0')},{'model':db[_0xf796('0xcb')],'as':'MailAccount'}]});})[_0xf796('0x1f')](handleEntityNotFound(_0x4e6276,null))[_0xf796('0x1f')](function(_0x55e68f){if(_0x55e68f&&_0x55e68f['List']){_0x4ce935=_0x55e68f;var _0x3a6eab=_[_0xf796('0x1a')](_0x4d5068[_0xf796('0x5a')],{'firstName':_0x4d5068[_0xf796('0x5a')]['from'],'phone':_0x4d5068[_0xf796('0x5a')][_0xf796('0x93')],'ListId':_0x55e68f[_0xf796('0x92')]});_0x3a6eab[_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')]]=_0x4d5068['body'][_0xf796('0x93')];return db[_0xf796('0x8a')]['findOrCreate']({'where':_0x5849dc,'defaults':_0x3a6eab});}})[_0xf796('0xcc')](function(_0x358c4c){if(_0x358c4c){_0x98877=_0x358c4c;var _0x529660=fs[_0xf796('0xcd')](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/templates/chatOfflineMessage.ejs'),_0xf796('0xce'));var _0x2a9efc=ejs[_0xf796('0xcf')](_0x529660,{'body':_[_0xf796('0xd0')](_0x4d5068[_0xf796('0x5a')][_0xf796('0x5a')]),'bodyTitle':_0x4ce935[_0xf796('0xd1')]});return db[_0xf796('0xd2')][_0xf796('0x59')]({'body':_0x2a9efc,'ContactId':_0x358c4c['id'],'ChatWebsiteId':_0x4ce935['id']});}})[_0xf796('0x1f')](function(_0x2ac1dd){_0x3aa912=_0x2ac1dd;if(_0x27e5e7['length']){var _0x27df60=_0x27e5e7[_0xf796('0x3a')](function(_0x1de16c){return{'name':_0x1de16c['originalname'],'basename':_0x1de16c[_0xf796('0x6f')],'type':_0x1de16c[_0xf796('0xd3')],'ChatOfflineMessageId':_0x2ac1dd['id']};});_0x2fcb30=_0x27df60['map'](_0x56e3c1=>{var _0x2053b0={'filename':_0x56e3c1[_0xf796('0x37')],'path':path['join'](config['root'],'server',_0xf796('0xc8'),_0xf796('0xd4'),_0xf796('0xd5'),_0x56e3c1['basename'])};return _0x2053b0;});if(!_0x4ce935['openNewInteraction']){return db[_0xf796('0xd6')]['transaction'](function(_0x18bf5d){return db[_0xf796('0xd7')][_0xf796('0xd8')](_0x27df60,{'transaction':_0x18bf5d});});}}})['then'](function(){if(_0x3aa912){_0x8b202e=_0x3aa912;return db[_0xf796('0xcb')][_0xf796('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xf796('0xd9')],'as':_0xf796('0xda'),'raw':!![]}]});}})[_0xf796('0x1f')](function(_0x309600){if(_0x309600&&_0x309600[_0xf796('0xda')]&&_0x4ce935[_0xf796('0xdb')]&&_0x4ce935['forwardOfflineAddress']){var _0x44ba51={'tls':{'rejectUnauthorized':![]}};if(_0x309600['Smtp']['service']){_0x44ba51[_0xf796('0xdc')]=_0x309600['Smtp'][_0xf796('0xdc')];}else{_0x44ba51['host']=_0x309600[_0xf796('0xda')][_0xf796('0xdd')];_0x44ba51['port']=_0x309600[_0xf796('0xda')][_0xf796('0xde')];_0x44ba51[_0xf796('0xdf')]=_0x309600[_0xf796('0xda')]['secure'];}if(_0x309600['Smtp'][_0xf796('0xe0')]){_0x44ba51[_0xf796('0xe1')]={'user':_0x309600[_0xf796('0xda')][_0xf796('0x5b')],'pass':_0x309600[_0xf796('0xda')][_0xf796('0xe2')]};}return respondWithRpcPromise(_0xf796('0xe3'),'sendMail',{'account':_0x44ba51,'message':{'from':util[_0xf796('0xb0')](_0xf796('0xe4'),_0x309600[_0xf796('0x37')],_0x309600['email']||_0x309600[_0xf796('0xda')][_0xf796('0x5b')]),'to':_0x4ce935[_0xf796('0xe5')],'subject':_0x4ce935[_0xf796('0xe6')],'html':_0x8b202e[_0xf796('0x5a')],'attachments':_0x2fcb30}},client9003)[_0xf796('0x1f')](function(){return _0x8b202e;})[_0xf796('0x28')](function(_0x616528){console[_0xf796('0x25')](_0x616528);});}})[_0xf796('0x1f')](function(){if(_0x4ce935&&_0x4ce935[_0xf796('0xe7')]&&_0x4ce935[_0xf796('0xe8')]){var _0x2862ef=[];if(_0x27e5e7[_0xf796('0x58')]){_0x2862ef=_0x27e5e7[_0xf796('0x3a')](function(_0xbdd1ff){return{'name':_0xbdd1ff['originalname'],'basename':_0xbdd1ff[_0xf796('0x6f')],'type':_0xbdd1ff[_0xf796('0xd3')],'ChatOfflineMessageId':_0x3aa912['id']};});}var _0xb2fb98;if(!_['isNil'](_0x4ce935[_0xf796('0xe9')])){var _0x3da354=_[_0xf796('0x3a')](_0x4d5068['body'],function(_0x3712f3){return _0x3712f3;});var _0x12982c=_['toPairsIn'](_0x3da354)[0x0];var _0x317e4a=_[_0xf796('0xea')](_0x12982c,function(_0x28a28c){return _0x28a28c;});_0xb2fb98=_0x317e4a[0x1][_0x4ce935[_0xf796('0xe9')]];}var _0x4beb02={'from':_0x98877[_0xf796('0xeb')],'firstName':_0x98877[_0xf796('0xb8')],'lastName':_0x98877[_0xf796('0xa9')],'mapKey':_0xf796('0xeb'),'message':{'from':_0x98877[_0xf796('0xeb')],'to':_0x4ce935['MailAccount'][_0xf796('0xeb')],'cc':'','subject':_[_0xf796('0x78')](_0xb2fb98)?_0x4ce935[_0xf796('0xe6')]:_0xb2fb98,'messageId':'','sentAt':new Date(),'attach':_0x2862ef[_0xf796('0x58')],'attachments':_0x2862ef,'originChannel':_0xf796('0xec'),'ChatWebsiteId':_0x4ce935['id'],'ChatOfflineMessageId':_0x8b202e['id'],'originTo':_0x4ce935[_0xf796('0xcb')][_0xf796('0xeb')]},'body':_0x8b202e[_0xf796('0x5a')]};var _0x44eac6={'account':{'id':_0x4ce935[_0xf796('0xe8')]},'body':_0x4beb02,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xf796('0xed'),_0xf796('0xee'),_0x44eac6,client9001)[_0xf796('0x1f')](function(){return _0x8b202e;})[_0xf796('0x28')](function(_0x25125a){console[_0xf796('0x25')](_0x25125a);});}return;})[_0xf796('0x1f')](function(){if(_0x8b202e){return _0x8b202e;}})[_0xf796('0x1f')](respondWithResult(_0x4e6276,null))[_0xf796('0x28')](function(_0x253346){console[_0xf796('0x25')]('catch',_0x253346);for(var _0x25a4c5 of _0x27e5e7){var _0x29f6c4=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0xef'),_0xf796('0xc8'),_0xf796('0xd4'),_0xf796('0xd5'),_0x25a4c5[_0xf796('0x6f')]);fs_extra['remove'](_0x29f6c4)[_0xf796('0x28')](function(_0x160593){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x29f6c4,_0x160593);});}});};exports[_0xf796('0xf0')]=function(_0x35d078,_0x31cb46,_0x357107){return db[_0xf796('0xb5')][_0xf796('0x5d')]({'where':{'id':_0x35d078[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x31cb46,null))['then'](function(_0x407d6b){if(_0x407d6b){return _0x407d6b[_0xf796('0xf0')](_0x35d078[_0xf796('0x5a')][_0xf796('0xf1')],_['omit'](_0x35d078[_0xf796('0x5a')],[_0xf796('0xf1'),'id'])||{});}})['then'](respondWithResult(_0x31cb46,null))[_0xf796('0x28')](handleError(_0x31cb46,null));};exports[_0xf796('0xf2')]=function(_0x189714,_0x327b22,_0x44e988){var _0x3775b5={'raw':![],'where':{}};var _0x4e5ebc={};var _0x1317ff={'count':0x0,'rows':[]};return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x189714[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x327b22,null))[_0xf796('0x1f')](function(_0x182be8){if(_0x182be8){_0x4e5ebc[_0xf796('0x40')]=_['keys'](db[_0xf796('0xb5')]['rawAttributes']);_0x4e5ebc[_0xf796('0x41')]=_['keys'](_0x189714[_0xf796('0x41')]);_0x4e5ebc['filters']=_[_0xf796('0x44')](_0x4e5ebc[_0xf796('0x40')],_0x4e5ebc[_0xf796('0x41')]);_0x3775b5[_0xf796('0x45')]=_['intersection'](_0x4e5ebc[_0xf796('0x40')],qs[_0xf796('0x57')](_0x189714[_0xf796('0x41')]['fields']));_0x3775b5[_0xf796('0x45')]=_0x3775b5[_0xf796('0x45')][_0xf796('0x58')]?_0x3775b5[_0xf796('0x45')]:_0x4e5ebc[_0xf796('0x40')];if(!_0x189714['query'][_0xf796('0x46')]('nolimit')){_0x3775b5['limit']=qs[_0xf796('0x2b')](_0x189714[_0xf796('0x41')][_0xf796('0x2b')]);_0x3775b5[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x189714[_0xf796('0x41')][_0xf796('0x2d')]);}_0x3775b5[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x189714[_0xf796('0x41')][_0xf796('0x49')]);_0x3775b5[_0xf796('0x4a')]=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x189714[_0xf796('0x41')],_0x4e5ebc['filters']));_0x3775b5[_0xf796('0x4a')][_0xf796('0x66')]=_0x182be8['id'];if(_0x189714[_0xf796('0x41')][_0xf796('0x4c')]){_0x3775b5['where']=_[_0xf796('0x4d')](_0x3775b5[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x3775b5[_0xf796('0x45')],function(_0x46a8ab){var _0x8ba0c8={};_0x8ba0c8[_0x46a8ab]={'$like':'%'+_0x189714[_0xf796('0x41')]['filter']+'%'};return _0x8ba0c8;})});}_0x3775b5=_[_0xf796('0x4d')]({},_0x3775b5,_0x189714['options']);return db[_0xf796('0xb5')]['count']({'where':_0x3775b5[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0xaa549f){_0x1317ff[_0xf796('0x2c')]=_0xaa549f;if(_0x189714[_0xf796('0x41')]['includeAll']){_0x3775b5[_0xf796('0x51')]=[{'model':db[_0xf796('0x8a')],'as':'Contact','required':![]},{'model':db[_0xf796('0xc0')],'as':_0xf796('0xf3'),'attributes':['name','fullname',_0xf796('0xf4')],'required':![]},{'model':db[_0xf796('0xf5')],'as':'Tags','attributes':['id',_0xf796('0x37'),_0xf796('0xf6')],'where':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]?{'id':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]}:undefined,'required':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]?!![]:![]}];}return db[_0xf796('0xb5')][_0xf796('0x52')](_0x3775b5);})[_0xf796('0x1f')](function(_0x3034af){_0x1317ff[_0xf796('0x53')]=_0x3034af;return _0x1317ff;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x327b22,_0x3775b5))[_0xf796('0x28')](handleError(_0x327b22,null));};function iftimePromise(_0x54f061,_0x5beca0){return respondWithRpcPromise('Command',_0xf796('0xf8'),{'command':_0x5beca0['timezone']?util['format']('iftime\x20%s,%s',_0x54f061[_0xf796('0xf9')],_0x5beca0[_0xf796('0xfa')]):util[_0xf796('0xb0')](_0xf796('0xfb'),_0x54f061[_0xf796('0xf9')])},client9002)[_0xf796('0x1f')](function(_0x50981f){var _0x4dd9fe=_0x50981f&&_0x50981f[_0xf796('0xfc')](_0xf796('0xfd'))>=0x0?!![]:![];logger[_0xf796('0x20')](_0xf796('0xfe'),_0x5beca0['id'],_0x54f061['id'],_0x54f061['interval'],_0x4dd9fe?'ONLINE':_0xf796('0xff'),_0x5beca0[_0xf796('0xfa')]?_0x5beca0[_0xf796('0xfa')]:'No\x20timezone');return _0x4dd9fe;})[_0xf796('0x28')](function(_0x1ae601){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5beca0['id'],_0x54f061['id'],_0x54f061[_0xf796('0xf9')],util['inspect'](_0x1ae601,{'showHidden':![],'depth':null}),_0x5beca0[_0xf796('0xfa')]?_0x5beca0[_0xf796('0xfa')]:_0xf796('0x100'));return![];});}exports[_0xf796('0xf8')]=function(_0x1da28b,_0x575d55,_0x3917be){var _0x17cfdb=0x0;var _0x239882=0x0;var _0x2f4e27=![];var _0x32ff7c;var _0x2b5f07;return db[_0xf796('0x3b')]['find']({'where':{'id':_0x1da28b[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x101')],'as':_0xf796('0x101'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xf796('0xf9')],'raw':!![]}]}]})[_0xf796('0x1f')](handleEntityNotFound(_0x575d55,null))[_0xf796('0x1f')](function(_0x512ec9){if(_0x512ec9){_0x32ff7c=_0x512ec9;return _0x512ec9[_0xf796('0x102')]({'raw':!![]});}})[_0xf796('0x1f')](function(_0x42832c){if(_0x32ff7c){if(_0x42832c){_0x2b5f07=_0x42832c;}}return require(_0xf796('0x18'))['getLicense']();})[_0xf796('0x1f')](function(_0x544cc0){if(_0x544cc0){_0x239882=_0x544cc0[_0xf796('0x103')];_0x2f4e27=_0x544cc0[_0xf796('0x104')];}})[_0xf796('0x1f')](function(){return db[_0xf796('0xb5')][_0xf796('0x2c')]({'where':{'closed':![]}});})[_0xf796('0x1f')](function(_0x28117e){_0x17cfdb=_0x28117e;if(_0x239882&&_0x28117e>_0x239882){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x4e4ca0){if(_0x4e4ca0){_0x4e4ca0[_0xf796('0x105')]('chatLicenseExceeded');}});}})[_0xf796('0x1f')](function(){if(_0x32ff7c[_0xf796('0x101')]&&_0x32ff7c[_0xf796('0x101')][_0xf796('0x106')]){var _0x286862=[];for(var _0x557204=0x0;_0x557204<_0x32ff7c[_0xf796('0x101')][_0xf796('0x106')][_0xf796('0x58')];_0x557204++){var _0x14c0b6=_0x32ff7c[_0xf796('0x101')]['Intervals'][_0x557204]['get']({'plain':!![]});_0x286862[_0xf796('0x107')](iftimePromise(_0x14c0b6,_0x32ff7c));}return BPromise[_0xf796('0x108')](_0x286862)[_0xf796('0x1f')](function(_0x2c5902){return _[_0xf796('0x109')](_0x2c5902);});}else{return!![];}})[_0xf796('0x1f')](function(_0xaab052){var _0x31773f=fs[_0xf796('0xcd')](path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x10a')),'utf8');var _0x5d86f4={'remote':_0x32ff7c['remote'],'query':querystring[_0xf796('0x24')](_[_0xf796('0x4d')](_0x32ff7c[_0xf796('0x33')]({'plain':!![]}),{'customerIp':_0x1da28b[_0xf796('0x87')][_0xf796('0xa7')]||_0x1da28b[_0xf796('0x87')]['x-real-ip']||_0x1da28b[_0xf796('0x10b')][_0xf796('0x10c')]||_0x1da28b['ip'],'referer':_0x1da28b[_0xf796('0x87')][_0xf796('0xab')],'openedInteractions':_0x17cfdb,'maxInteractions':_0x239882,'virtual':_0x2f4e27[_0xf796('0x103')],'online':_0xaab052,'custom':_0x2f4e27}))['replace'](/'/g,'\x5c\x27')};_0x575d55[_0xf796('0x38')](ejs[_0xf796('0xcf')](Mustache['render'](_0x31773f,_0x5d86f4),{'proactiveActions':_0x2b5f07,'alignment':_0x32ff7c[_0xf796('0x10d')],'verticalAlignment':_0x32ff7c['verticalAlignment'],'div_color':_0x32ff7c[_0xf796('0xf6')],'text_color':_0x32ff7c['textColor'],'button_color':_0x32ff7c['color_button'],'background_color':_0x32ff7c[_0xf796('0x10e')]}));})[_0xf796('0x28')](handleError(_0x575d55,null));};exports[_0xf796('0x10f')]=function(_0x148732,_0x5629ef,_0x4ede6c){return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x148732[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x5629ef,null))[_0xf796('0x1f')](function(_0x4ba596){if(_0x4ba596){return db['sequelize'][_0xf796('0x110')](function(_0x309645){return db[_0xf796('0x9b')][_0xf796('0x35')]({'where':{'ChatWebsiteId':_0x148732[_0xf796('0x55')]['id']},'transaction':_0x309645})[_0xf796('0x1f')](function(_0xbf4293){var _0x2d1bc5=_[_0xf796('0x3a')](_0x148732[_0xf796('0x5a')],function(_0x4df144){_0x4df144[_0xf796('0x66')]=_0x148732[_0xf796('0x55')]['id'];return _0x4df144;});return db[_0xf796('0x9b')][_0xf796('0xd8')](_0x2d1bc5,{'transaction':_0x309645});});})[_0xf796('0x1f')](function(){return db['ChatApplication'][_0xf796('0x111')]({'where':{'ChatWebsiteId':_0x148732['params']['id']},'order':_0xf796('0xa2')});});}})[_0xf796('0x1f')](respondWithResult(_0x5629ef,null))[_0xf796('0x28')](handleError(_0x5629ef,null));};exports[_0xf796('0x112')]=function(_0x101442,_0x52a5dc,_0x22cf1c){var _0x4f35b4={};var _0x3d9404={};var _0x3ec838;var _0x2a99f8;return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x101442[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x52a5dc,null))[_0xf796('0x1f')](function(_0x21aff9){if(_0x21aff9){_0x3ec838=_0x21aff9;_0x3d9404[_0xf796('0x40')]=_['keys'](db[_0xf796('0x9b')][_0xf796('0x3c')]);_0x3d9404[_0xf796('0x41')]=_[_0xf796('0x42')](_0x101442[_0xf796('0x41')]);_0x3d9404[_0xf796('0x43')]=_['intersection'](_0x3d9404[_0xf796('0x40')],_0x3d9404[_0xf796('0x41')]);_0x4f35b4['attributes']=_[_0xf796('0x44')](_0x3d9404['model'],qs[_0xf796('0x57')](_0x101442[_0xf796('0x41')][_0xf796('0x57')]));_0x4f35b4[_0xf796('0x45')]=_0x4f35b4[_0xf796('0x45')]['length']?_0x4f35b4[_0xf796('0x45')]:_0x3d9404[_0xf796('0x40')];_0x4f35b4['order']=qs[_0xf796('0x49')](_0x101442[_0xf796('0x41')][_0xf796('0x49')]);_0x4f35b4['where']=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x101442[_0xf796('0x41')],_0x3d9404['filters']));if(_0x101442['query']['filter']){_0x4f35b4[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x4f35b4[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x4f35b4['attributes'],function(_0x12a83e){var _0x3e1563={};_0x3e1563[_0x12a83e]={'$like':'%'+_0x101442['query'][_0xf796('0x4c')]+'%'};return _0x3e1563;})});}_0x4f35b4=_[_0xf796('0x4d')]({},_0x4f35b4,_0x101442[_0xf796('0x4f')]);return _0x3ec838[_0xf796('0x112')](_0x4f35b4);}})[_0xf796('0x1f')](function(_0x5b2ba2){if(_0x5b2ba2){_0x2a99f8=_0x5b2ba2['length'];if(!_0x101442[_0xf796('0x41')][_0xf796('0x46')](_0xf796('0x47'))){_0x4f35b4[_0xf796('0x2b')]=qs['limit'](_0x101442['query'][_0xf796('0x2b')]);_0x4f35b4[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x101442[_0xf796('0x41')][_0xf796('0x2d')]);}return _0x3ec838[_0xf796('0x112')](_0x4f35b4);}})[_0xf796('0x1f')](function(_0x2ad8be){if(_0x2ad8be){return _0x2ad8be?{'count':_0x2a99f8,'rows':_0x2ad8be}:null;}})['then'](respondWithResult(_0x52a5dc,null))[_0xf796('0x28')](handleError(_0x52a5dc,null));};exports[_0xf796('0x113')]=function(_0x42e66f,_0x561aba,_0x101618){return db[_0xf796('0x114')][_0xf796('0x5d')]({'where':{'id':_0x42e66f['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x561aba,null))['then'](function(_0x198c21){if(_0x198c21){return _0x198c21['addProactiveActions'](_0x42e66f[_0xf796('0x5a')][_0xf796('0xf1')],_[_0xf796('0x115')](_0x42e66f['body'],[_0xf796('0xf1'),'id'])||{});}})[_0xf796('0x1f')](respondWithResult(_0x561aba,null))['catch'](handleError(_0x561aba,null));};exports[_0xf796('0x102')]=function(_0x4789,_0x282072,_0x26ad55){var _0x225acb={};var _0x25f6e4={};var _0x4b7644;var _0x4847ed;return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x4789[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x282072,null))['then'](function(_0x1260af){if(_0x1260af){_0x4b7644=_0x1260af;_0x25f6e4['model']=_[_0xf796('0x42')](db['ChatProactiveAction']['rawAttributes']);_0x25f6e4['query']=_['keys'](_0x4789[_0xf796('0x41')]);_0x25f6e4[_0xf796('0x43')]=_[_0xf796('0x44')](_0x25f6e4[_0xf796('0x40')],_0x25f6e4[_0xf796('0x41')]);_0x225acb[_0xf796('0x45')]=_[_0xf796('0x44')](_0x25f6e4[_0xf796('0x40')],qs[_0xf796('0x57')](_0x4789[_0xf796('0x41')][_0xf796('0x57')]));_0x225acb[_0xf796('0x45')]=_0x225acb[_0xf796('0x45')]['length']?_0x225acb[_0xf796('0x45')]:_0x25f6e4[_0xf796('0x40')];_0x225acb['order']=qs[_0xf796('0x49')](_0x4789[_0xf796('0x41')][_0xf796('0x49')]);_0x225acb[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x4789[_0xf796('0x41')],_0x25f6e4[_0xf796('0x43')]));if(_0x4789['query'][_0xf796('0x4c')]){_0x225acb['where']=_['merge'](_0x225acb[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x225acb[_0xf796('0x45')],function(_0x3e0687){var _0x25114e={};_0x25114e[_0x3e0687]={'$like':'%'+_0x4789[_0xf796('0x41')]['filter']+'%'};return _0x25114e;})});}_0x225acb=_[_0xf796('0x4d')]({},_0x225acb,_0x4789[_0xf796('0x4f')]);return _0x4b7644['getProactiveActions'](_0x225acb);}})[_0xf796('0x1f')](function(_0xf92386){if(_0xf92386){_0x4847ed=_0xf92386[_0xf796('0x58')];if(!_0x4789[_0xf796('0x41')]['hasOwnProperty'](_0xf796('0x47'))){_0x225acb[_0xf796('0x2b')]=qs['limit'](_0x4789[_0xf796('0x41')][_0xf796('0x2b')]);_0x225acb[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x4789[_0xf796('0x41')][_0xf796('0x2d')]);}return _0x4b7644[_0xf796('0x102')](_0x225acb);}})[_0xf796('0x1f')](function(_0xf872a5){if(_0xf872a5){return _0xf872a5?{'count':_0x4847ed,'rows':_0xf872a5}:null;}})['then'](respondWithResult(_0x282072,null))['catch'](handleError(_0x282072,null));};exports[_0xf796('0x116')]=function(_0x3d6474,_0x321fa4,_0x41188b){var _0x294c0d=_0x3d6474['query'][_0xf796('0x117')]===_0xf796('0x118')?_0xf796('0x119'):'onlineForm';return db[_0xf796('0x3b')]['find']({'attributes':['id',_0x294c0d],'where':{'id':_0x3d6474[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x321fa4,null))['then'](function(_0x3fbdc9){if(_0x3fbdc9){var _0xe6c73e=_0x3fbdc9[_0x294c0d];var _0x44a78f=_0xe6c73e&&_0xe6c73e['items']?_0xe6c73e[_0xf796('0x11a')]:[];_0x321fa4[_0xf796('0x38')]({'fromKey':_['isNil'](_0xe6c73e[_0xf796('0x11b')])?undefined:_0xe6c73e['fromKey'],'count':_0x44a78f[_0xf796('0x58')],'rows':_0x44a78f});}})['catch'](handleError(_0x321fa4,null));};exports[_0xf796('0x11c')]=function(_0x543346,_0x355922,_0x563f9c){var _0x309ac0={'raw':![],'where':{}};var _0x141f81={};var _0x19e1d5={'count':0x0,'rows':[]};return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x543346[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x355922,null))['then'](function(_0x1db05b){if(_0x1db05b){_0x141f81['model']=_[_0xf796('0x42')](db[_0xf796('0xd2')][_0xf796('0x3c')]);_0x141f81['query']=_[_0xf796('0x42')](_0x543346['query']);_0x141f81[_0xf796('0x43')]=_['intersection'](_0x141f81[_0xf796('0x40')],_0x141f81['query']);_0x309ac0[_0xf796('0x45')]=_[_0xf796('0x44')](_0x141f81[_0xf796('0x40')],qs['fields'](_0x543346[_0xf796('0x41')]['fields']));_0x309ac0['attributes']=_0x309ac0[_0xf796('0x45')]['length']?_0x309ac0[_0xf796('0x45')]:_0x141f81[_0xf796('0x40')];if(!_0x543346[_0xf796('0x41')][_0xf796('0x46')](_0xf796('0x47'))){_0x309ac0[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x543346[_0xf796('0x41')]['limit']);_0x309ac0['offset']=qs[_0xf796('0x2d')](_0x543346[_0xf796('0x41')][_0xf796('0x2d')]);}_0x309ac0[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x543346['query'][_0xf796('0x49')]);_0x309ac0['where']=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x543346[_0xf796('0x41')],_0x141f81[_0xf796('0x43')]));_0x309ac0[_0xf796('0x4a')][_0xf796('0x66')]=_0x1db05b['id'];if(_0x543346[_0xf796('0x41')]['filter']){_0x309ac0[_0xf796('0x4a')]=_['merge'](_0x309ac0[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x309ac0[_0xf796('0x45')],function(_0x273008){var _0x3e6c6d={};_0x3e6c6d[_0x273008]={'$like':'%'+_0x543346[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x3e6c6d;})});}_0x309ac0=_[_0xf796('0x4d')]({},_0x309ac0,_0x543346[_0xf796('0x4f')]);return db[_0xf796('0xd2')][_0xf796('0x2c')]({'where':_0x309ac0[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0x3f3322){_0x19e1d5[_0xf796('0x2c')]=_0x3f3322;if(_0x543346[_0xf796('0x41')]['includeAll']){_0x309ac0[_0xf796('0x51')]=[{'all':!![]}];}else{_0x309ac0[_0xf796('0x51')]=[{'model':db['CmContact'],'as':_0xf796('0x11d'),'required':![]},{'model':db[_0xf796('0xd7')],'as':_0xf796('0x11e'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x309ac0);})[_0xf796('0x1f')](function(_0x9daaf0){_0x19e1d5['rows']=_0x9daaf0;return _0x19e1d5;});}})['then'](respondWithFilteredResult(_0x355922,_0x309ac0))['catch'](handleError(_0x355922,null));};exports['addAgents']=function(_0x5209b4,_0x581980,_0x597586){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x5209b4[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x581980,null))[_0xf796('0x1f')](function(_0xd346ea){if(_0xd346ea){return _0xd346ea[_0xf796('0x11f')](_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')],_[_0xf796('0x115')](_0x5209b4[_0xf796('0x5a')],[_0xf796('0xf1'),'id'])||{})['spread'](function(_0x3b7d6c){for(var _0x9d1e60=0x0;_0x9d1e60<_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')][_0xf796('0x58')];_0x9d1e60+=0x1){socket[_0xf796('0x120')](_0xf796('0x121'),{'UserId':Number(_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')][_0x9d1e60]),'ChatWebsiteId':Number(_0x5209b4[_0xf796('0x55')]['id'])});}return _0x3b7d6c;});}})[_0xf796('0x1f')](respondWithResult(_0x581980,null))[_0xf796('0x28')](handleError(_0x581980,null));};exports[_0xf796('0x122')]=function(_0x8aecef,_0x119887,_0x5960fa){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x8aecef[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x119887,null))[_0xf796('0x1f')](function(_0x27afca){if(_0x27afca){return _0x27afca[_0xf796('0x122')](_0x8aecef[_0xf796('0x41')]['ids'])[_0xf796('0x1f')](function(){if(_[_0xf796('0x123')](_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')])){for(var _0x1524b4=0x0;_0x1524b4<_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')][_0xf796('0x58')];_0x1524b4+=0x1){socket[_0xf796('0x120')](_0xf796('0x124'),{'UserId':Number(_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')][_0x1524b4]),'ChatWebsiteId':Number(_0x8aecef['params']['id'])});}}else{socket[_0xf796('0x120')](_0xf796('0x124'),{'UserId':Number(_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')]),'ChatWebsiteId':Number(_0x8aecef[_0xf796('0x55')]['id'])});}});}})[_0xf796('0x1f')](respondWithStatusCode(_0x119887,null))[_0xf796('0x28')](handleError(_0x119887,null));};exports[_0xf796('0x125')]=function(_0x5a9856,_0x3472d3,_0x219ff0){var _0x5781cc={};var _0x562099={};var _0x2462eb;var _0x38a232;return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x5a9856[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x3472d3,null))[_0xf796('0x1f')](function(_0x4ed21d){if(_0x4ed21d){_0x2462eb=_0x4ed21d;_0x562099[_0xf796('0x40')]=_[_0xf796('0x42')](db[_0xf796('0xc0')][_0xf796('0x3c')]);_0x562099['query']=_['keys'](_0x5a9856[_0xf796('0x41')]);_0x562099[_0xf796('0x43')]=_[_0xf796('0x44')](_0x562099[_0xf796('0x40')],_0x562099['query']);_0x5781cc[_0xf796('0x45')]=_['intersection'](_0x562099['model'],qs[_0xf796('0x57')](_0x5a9856['query']['fields']));_0x5781cc['attributes']=_0x5781cc[_0xf796('0x45')]['length']?_0x5781cc['attributes']:_0x562099[_0xf796('0x40')];_0x5781cc['order']=qs[_0xf796('0x49')](_0x5a9856[_0xf796('0x41')]['sort']);_0x5781cc[_0xf796('0x4a')]=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x5a9856['query'],_0x562099[_0xf796('0x43')]));if(_0x5a9856[_0xf796('0x41')][_0xf796('0x4c')]){_0x5781cc['where']=_[_0xf796('0x4d')](_0x5781cc['where'],{'$or':_[_0xf796('0x3a')](_0x5781cc[_0xf796('0x45')],function(_0x3f8da0){var _0x44f2c3={};_0x44f2c3[_0x3f8da0]={'$like':'%'+_0x5a9856[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x44f2c3;})});}_0x5781cc=_[_0xf796('0x4d')]({},_0x5781cc,_0x5a9856[_0xf796('0x4f')]);return _0x2462eb[_0xf796('0x125')](_0x5781cc);}})['then'](function(_0x304855){if(_0x304855){_0x38a232=_0x304855[_0xf796('0x58')];if(!_0x5a9856[_0xf796('0x41')]['hasOwnProperty'](_0xf796('0x47'))){_0x5781cc[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x5a9856['query'][_0xf796('0x2b')]);_0x5781cc[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x5a9856[_0xf796('0x41')]['offset']);}return _0x2462eb[_0xf796('0x125')](_0x5781cc);}})[_0xf796('0x1f')](function(_0x3589eb){if(_0x3589eb){return _0x3589eb?{'count':_0x38a232,'rows':_0x3589eb}:null;}})[_0xf796('0x1f')](respondWithResult(_0x3472d3,null))[_0xf796('0x28')](handleError(_0x3472d3,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index a700267..81e9bfb 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 _0x3a0f=['exports','ChatWebsite','update','remove','emit','hook'];(function(_0x14f9b1,_0x48441c){var _0x14c44d=function(_0x4e2033){while(--_0x4e2033){_0x14f9b1['push'](_0x14f9b1['shift']());}};_0x14c44d(++_0x48441c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x1185fb,_0x37613d){_0x1185fb=_0x1185fb-0x0;var _0x478556=_0x3a0f[_0x1185fb];return _0x478556;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xf3a0('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3a0('0x1'),'afterDestroy':_0xf3a0('0x2')};function emitEvent(_0x154115){return function(_0x31a1b4,_0x3d0886,_0xa3ed18){ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115+':'+_0x31a1b4['id'],_0x31a1b4);ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115,_0x31a1b4);_0xa3ed18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf3a0('0x4')](e,emitEvent(event));}}module[_0xf3a0('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1928=['hook','exports','events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1928,0x138));var _0x8192=function(_0x5348e1,_0x4f2d77){_0x5348e1=_0x5348e1-0x0;var _0x5f2c88=_0x1928[_0x5348e1];return _0x5f2c88;};'use strict';var EventEmitter=require(_0x8192('0x0'));var ChatWebsite=require(_0x8192('0x1'))['db'][_0x8192('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8192('0x3'),'afterUpdate':_0x8192('0x4'),'afterDestroy':_0x8192('0x5')};function emitEvent(_0x1a193a){return function(_0x16f410,_0x11fa71,_0x11c753){ChatWebsiteEvents[_0x8192('0x6')](_0x1a193a+':'+_0x16f410['id'],_0x16f410);ChatWebsiteEvents[_0x8192('0x6')](_0x1a193a,_0x16f410);_0x11c753(null);};}for(var e in events){if(events[_0x8192('0x7')](e)){var event=events[e];ChatWebsite[_0x8192('0x8')](e,emitEvent(event));}}module[_0x8192('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 907b420..3afa01f 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 _0x036c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','../../config/logger','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x036c,0x189));var _0xc036=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x036c[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xc036('0x0'));var util=require('util');var logger=require(_0xc036('0x1'))('api');var moment=require(_0xc036('0x2'));var BPromise=require(_0xc036('0x3'));var rp=require(_0xc036('0x4'));var fs=require('fs');var path=require(_0xc036('0x5'));var rimraf=require(_0xc036('0x6'));var config=require(_0xc036('0x7'));var attributes=require(_0xc036('0x8'));module[_0xc036('0x9')]=function(_0x36fa5b,_0xb8f234){return _0x36fa5b['define']('ChatWebsite',attributes,{'tableName':_0xc036('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc642=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ChatWebsite','lodash'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc642,0x1d5));var _0x2c64=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xc642[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2c64('0x0'));var util=require(_0x2c64('0x1'));var logger=require(_0x2c64('0x2'))('api');var moment=require(_0x2c64('0x3'));var BPromise=require(_0x2c64('0x4'));var rp=require(_0x2c64('0x5'));var fs=require('fs');var path=require(_0x2c64('0x6'));var rimraf=require(_0x2c64('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x2c64('0x8')]=function(_0x12d7e7,_0x5db1dc){return _0x12d7e7['define'](_0x2c64('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 413ba06..d039e93 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 _0x5d9c=['message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x5d9c,0xa5));var _0xc5d9=function(_0x2387ac,_0x45fcfc){_0x2387ac=_0x2387ac-0x0;var _0xb56c58=_0x5d9c[_0x2387ac];return _0xb56c58;};'use strict';var _=require(_0xc5d9('0x0'));var util=require(_0xc5d9('0x1'));var moment=require('moment');var BPromise=require(_0xc5d9('0x2'));var rs=require(_0xc5d9('0x3'));var fs=require('fs');var Redis=require(_0xc5d9('0x4'));var db=require(_0xc5d9('0x5'))['db'];var utils=require(_0xc5d9('0x6'));var logger=require(_0xc5d9('0x7'))(_0xc5d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xc5d9('0x9'));var client=jayson[_0xc5d9('0xa')][_0xc5d9('0xb')]({'port':0x232a});config[_0xc5d9('0xc')]=_[_0xc5d9('0xd')](config[_0xc5d9('0xc')],{'host':_0xc5d9('0xe'),'port':0x18eb});var socket=require(_0xc5d9('0xf'))(new Redis(config[_0xc5d9('0xc')]));require(_0xc5d9('0x10'))[_0xc5d9('0x11')](socket);function respondWithRpcPromise(_0x5745fc,_0x20ff22,_0x5df21f){return new BPromise(function(_0x42921a,_0x38d146){return client[_0xc5d9('0x12')](_0x5745fc,_0x5df21f)[_0xc5d9('0x13')](function(_0x37954a){logger['info'](_0xc5d9('0x14'),_0x20ff22,_0xc5d9('0x15'));logger['debug'](_0xc5d9('0x16'),_0x20ff22,'request\x20sent',JSON['stringify'](_0x37954a));if(_0x37954a[_0xc5d9('0x17')]){if(_0x37954a[_0xc5d9('0x17')]['code']===0x1f4){logger['error'](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')]['message']);return _0x38d146(_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);}logger[_0xc5d9('0x17')](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);return _0x42921a(_0x37954a[_0xc5d9('0x17')]['message']);}else{logger[_0xc5d9('0x19')](_0xc5d9('0x14'),_0x20ff22,'request\x20sent');_0x42921a(_0x37954a[_0xc5d9('0x1a')]['message']);}})['catch'](function(_0x18947b){logger[_0xc5d9('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x20ff22,_0x18947b);_0x38d146(_0x18947b);});});} \ No newline at end of file +var _0x77df=['moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x77df,0x1d2));var _0xf77d=function(_0x45db1d,_0x2a1fd){_0x45db1d=_0x45db1d-0x0;var _0x483293=_0x77df[_0x45db1d];return _0x483293;};'use strict';var _=require(_0xf77d('0x0'));var util=require(_0xf77d('0x1'));var moment=require(_0xf77d('0x2'));var BPromise=require(_0xf77d('0x3'));var rs=require(_0xf77d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf77d('0x5'));var logger=require(_0xf77d('0x6'))('rpc');var config=require(_0xf77d('0x7'));var jayson=require(_0xf77d('0x8'));var client=jayson[_0xf77d('0x9')][_0xf77d('0xa')]({'port':0x232a});config[_0xf77d('0xb')]=_[_0xf77d('0xc')](config[_0xf77d('0xb')],{'host':_0xf77d('0xd'),'port':0x18eb});var socket=require(_0xf77d('0xe'))(new Redis(config[_0xf77d('0xb')]));require('./chatWebsite.socket')[_0xf77d('0xf')](socket);function respondWithRpcPromise(_0x3ccc02,_0x3fbee5,_0x18c011){return new BPromise(function(_0x4033ff,_0xb11461){return client['request'](_0x3ccc02,_0x18c011)['then'](function(_0x486e53){logger[_0xf77d('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3fbee5,_0xf77d('0x11'));logger[_0xf77d('0x12')](_0xf77d('0x13'),_0x3fbee5,_0xf77d('0x11'),JSON[_0xf77d('0x14')](_0x486e53));if(_0x486e53['error']){if(_0x486e53[_0xf77d('0x15')]['code']===0x1f4){logger[_0xf77d('0x15')](_0xf77d('0x16'),_0x3fbee5,_0x486e53['error'][_0xf77d('0x17')]);return _0xb11461(_0x486e53[_0xf77d('0x15')]['message']);}logger[_0xf77d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3fbee5,_0x486e53[_0xf77d('0x15')][_0xf77d('0x17')]);return _0x4033ff(_0x486e53[_0xf77d('0x15')][_0xf77d('0x17')]);}else{logger[_0xf77d('0x10')](_0xf77d('0x16'),_0x3fbee5,_0xf77d('0x11'));_0x4033ff(_0x486e53[_0xf77d('0x18')][_0xf77d('0x17')]);}})[_0xf77d('0x19')](function(_0xec1c94){logger['error'](_0xf77d('0x16'),_0x3fbee5,_0xec1c94);_0xb11461(_0xec1c94);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e0175b9..e45040b 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 _0xecce=['remove','emit','removeListener','chatWebsite:'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xecce,0x1a4));var _0xeecc=function(_0x51b255,_0x2a91cf){_0x51b255=_0x51b255-0x0;var _0x43bd02=_0xecce[_0x51b255];return _0x43bd02;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xeecc('0x0'),'update'];function createListener(_0x53402b,_0xd2e85b){return function(_0x56908c){_0xd2e85b[_0xeecc('0x1')](_0x53402b,_0x56908c);};}function removeListener(_0x1d3ee2,_0x361a85){return function(){ChatWebsiteEvents[_0xeecc('0x2')](_0x1d3ee2,_0x361a85);};}exports['register']=function(_0x2aa21f){for(var _0x562083=0x0,_0x167e84=events['length'];_0x562083<_0x167e84;_0x562083++){var _0x3c60f0=events[_0x562083];var _0xf86cae=createListener(_0xeecc('0x3')+_0x3c60f0,_0x2aa21f);ChatWebsiteEvents['on'](_0x3c60f0,_0xf86cae);}}; \ No newline at end of file +var _0x75a6=['emit','length','chatWebsite:','save','remove','update'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x75a6,0x147));var _0x675a=function(_0x4942dd,_0x5a2a2a){_0x4942dd=_0x4942dd-0x0;var _0x58b5aa=_0x75a6[_0x4942dd];return _0x58b5aa;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x675a('0x0'),_0x675a('0x1'),_0x675a('0x2')];function createListener(_0x9027e,_0x504710){return function(_0x418a42){_0x504710[_0x675a('0x3')](_0x9027e,_0x418a42);};}function removeListener(_0x20b278,_0x11a1ff){return function(){ChatWebsiteEvents['removeListener'](_0x20b278,_0x11a1ff);};}exports['register']=function(_0x39cfda){for(var _0x32580b=0x0,_0x4a6f69=events[_0x675a('0x4')];_0x32580b<_0x4a6f69;_0x32580b++){var _0x5f0bf3=events[_0x32580b];var _0x41dae6=createListener(_0x675a('0x5')+_0x5f0bf3,_0x39cfda);ChatWebsiteEvents['on'](_0x5f0bf3,_0x41dae6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0174234..ed85c26 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 _0xca82=['originalname','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/applications','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','join'];(function(_0x1b7e02,_0x18b016){var _0x1150a4=function(_0x2b3171){while(--_0x2b3171){_0x1b7e02['push'](_0x1b7e02['shift']());}};_0x1150a4(++_0x18b016);}(_0xca82,0x187));var _0x2ca8=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xca82[_0x3640e2];return _0x277415;};'use strict';var multer=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var path=require('path');var timeout=require(_0x2ca8('0x2'));var express=require(_0x2ca8('0x3'));var router=express[_0x2ca8('0x4')]();var fs_extra=require(_0x2ca8('0x5'));var auth=require(_0x2ca8('0x6'));var interaction=require(_0x2ca8('0x7'));var config=require('../../config/environment');var controller=require(_0x2ca8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2ca8('0x9'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0xb')]);router['get'](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0xd')]);router[_0x2ca8('0xe')](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x10')]);router[_0x2ca8('0xe')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x11')]);router[_0x2ca8('0xe')](_0x2ca8('0x12'),controller[_0x2ca8('0x13')]);router[_0x2ca8('0xe')](_0x2ca8('0x14'),controller[_0x2ca8('0x15')]);router['get'](_0x2ca8('0x16'),controller['getCustomerAvatar']);router['get'](_0x2ca8('0x17'),controller[_0x2ca8('0x18')]);router['get']('/:id/interactions',auth[_0x2ca8('0xa')](),controller['getInteractions']);router[_0x2ca8('0xe')](_0x2ca8('0x19'),controller[_0x2ca8('0x1a')]);router[_0x2ca8('0xe')]('/:id/applications',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x1b')]);router[_0x2ca8('0xe')](_0x2ca8('0x1c'),auth['isAuthenticated'](),controller[_0x2ca8('0x1d')]);router[_0x2ca8('0xe')](_0x2ca8('0x1e'),controller['getFields']);router[_0x2ca8('0xe')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2ca8('0x1f')]);router[_0x2ca8('0xe')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x21')]);router['post']('/',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x22')]);router['post'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x23')]);router[_0x2ca8('0x24')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x25')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xc932be,_0x37993b,_0x704f92){_0x704f92(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x28')));},'filename':function(_0x5f3c95,_0x5a7a2e,_0xc10569){_0xc10569(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x5a7a2e['originalname']));}})});router[_0x2ca8('0x24')](_0x2ca8('0x12'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xf86f7a,_0x52aa01,_0x29ecd1){_0x29ecd1(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],'server/files/images/avatars/'));},'filename':function(_0x5669d4,_0x4a9c29,_0x346579){_0x346579(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date['now'](),_0x4a9c29[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x14'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x379b33,_0x3361eb,_0x45ffd7){_0x45ffd7(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x5467b7,_0x1a8ad5,_0x40633e){_0x40633e(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x1a8ad5[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x16'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x31')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x3b0cb2,_0x1be8bd,_0x36a791){_0x36a791(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x817005,_0x41804e,_0x8bc892){_0x8bc892(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x41804e[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x17'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x32')]);router[_0x2ca8('0x24')](_0x2ca8('0x33'),controller[_0x2ca8('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x30255a,_0x20d4c5,_0x4d707f){const _0x4aa8fd=path['join'](config['root'],_0x2ca8('0x35'),'attachments',_0x2ca8('0x36'));fs_extra['ensureDir'](_0x4aa8fd,function(){_0x4d707f(null,_0x4aa8fd);});},'filename':function(_0x51412e,_0x1f68cb,_0xa998bc){const _0x283c12=_0x1f68cb['originalname'][_0x2ca8('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x271d88=path[_0x2ca8('0x38')](_0x283c12);const _0x3a6e8f=Date[_0x2ca8('0x2b')]()+'-'+_0x283c12[_0x2ca8('0x37')](_0x271d88,'')+_0x271d88;_0xa998bc(null,_0x3a6e8f);}})});router[_0x2ca8('0x24')](_0x2ca8('0x39'),offlineUploadMulter[_0x2ca8('0x3a')](),controller[_0x2ca8('0x3b')]);router[_0x2ca8('0x24')](_0x2ca8('0x3c'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3d')]);router[_0x2ca8('0x24')](_0x2ca8('0x3e'),auth[_0x2ca8('0xa')](),controller['addApplications']);router['post'](_0x2ca8('0x1c'),auth[_0x2ca8('0xa')](),controller['addProactiveActions']);router[_0x2ca8('0x24')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3f')]);router[_0x2ca8('0x40')]('/:id',auth['isAuthenticated'](),controller[_0x2ca8('0x41')]);router[_0x2ca8('0x42')](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0x43')]);router['delete'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x44')]);router['delete'](_0x2ca8('0x45'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x46')]);router[_0x2ca8('0x42')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x47')]);module[_0x2ca8('0x48')]=router; \ No newline at end of file +var _0xe1a4=['offline-chat','ensureDir','replace','extname','/:id/offline','offline','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','now','originalname','single','addLogo','join','server/files/images/avatars/','%s-%s','/:id/avatar','addAvatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments'];(function(_0x483ba6,_0x70851b){var _0x45b9f3=function(_0x376404){while(--_0x376404){_0x483ba6['push'](_0x483ba6['shift']());}};_0x45b9f3(++_0x70851b);}(_0xe1a4,0xa2));var _0x4e1a=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xe1a4[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require(_0x4e1a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e1a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4e1a('0x2'));var interaction=require(_0x4e1a('0x3'));var config=require(_0x4e1a('0x4'));var controller=require(_0x4e1a('0x5'));router[_0x4e1a('0x6')]('/',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x8')]);router[_0x4e1a('0x6')](_0x4e1a('0x9'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0xa')]);router['get'](_0x4e1a('0xb'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0xc')]);router[_0x4e1a('0x6')]('/:id/dispositions',auth[_0x4e1a('0x7')](),controller['getDispositions']);router[_0x4e1a('0x6')](_0x4e1a('0xd'),auth['isAuthenticated'](),controller[_0x4e1a('0xe')]);router[_0x4e1a('0x6')](_0x4e1a('0xf'),controller['getLogo']);router[_0x4e1a('0x6')]('/:id/avatar',controller[_0x4e1a('0x10')]);router['get'](_0x4e1a('0x11'),controller['getCustomerAvatar']);router[_0x4e1a('0x6')](_0x4e1a('0x12'),controller[_0x4e1a('0x13')]);router[_0x4e1a('0x6')](_0x4e1a('0x14'),auth['isAuthenticated'](),controller[_0x4e1a('0x15')]);router[_0x4e1a('0x6')]('/:id/snippet',controller[_0x4e1a('0x16')]);router['get'](_0x4e1a('0x17'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x18')]);router[_0x4e1a('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x4e1a('0x19')]);router[_0x4e1a('0x6')](_0x4e1a('0x1a'),controller[_0x4e1a('0x1b')]);router[_0x4e1a('0x6')](_0x4e1a('0x1c'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x1d')]);router['get'](_0x4e1a('0x1e'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x1f')]);router[_0x4e1a('0x20')]('/',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x21')]);router[_0x4e1a('0x20')](_0x4e1a('0x22'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x23')]);router[_0x4e1a('0x20')](_0x4e1a('0xd'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x24')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x5f475f,_0x18f67b,_0x388363){_0x388363(null,path['join'](config[_0x4e1a('0x26')],_0x4e1a('0x27')));},'filename':function(_0x520e31,_0x39d292,_0x1018ed){_0x1018ed(null,util[_0x4e1a('0x28')]('%s-%s',Date[_0x4e1a('0x29')](),_0x39d292[_0x4e1a('0x2a')]));}})});router[_0x4e1a('0x20')](_0x4e1a('0xf'),upload[_0x4e1a('0x2b')]('file'),controller[_0x4e1a('0x2c')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x58f270,_0x14b619,_0x4f809b){_0x4f809b(null,path[_0x4e1a('0x2d')](config[_0x4e1a('0x26')],_0x4e1a('0x2e')));},'filename':function(_0xbea4f0,_0x44f116,_0x5c0348){_0x5c0348(null,util[_0x4e1a('0x28')](_0x4e1a('0x2f'),Date['now'](),_0x44f116[_0x4e1a('0x2a')]));}})});router['post'](_0x4e1a('0x30'),upload['single']('file'),controller[_0x4e1a('0x31')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x2891d6,_0x3f5198,_0x244cec){_0x244cec(null,path[_0x4e1a('0x2d')](config[_0x4e1a('0x26')],'server/files/images/avatars/'));},'filename':function(_0x311417,_0x389826,_0x22eece){_0x22eece(null,util[_0x4e1a('0x28')](_0x4e1a('0x2f'),Date[_0x4e1a('0x29')](),_0x389826[_0x4e1a('0x2a')]));}})});router[_0x4e1a('0x20')]('/:id/customer_avatar',upload[_0x4e1a('0x2b')](_0x4e1a('0x32')),controller[_0x4e1a('0x33')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x2cc2e0,_0x5ba079,_0x34e2a8){_0x34e2a8(null,path['join'](config[_0x4e1a('0x26')],_0x4e1a('0x2e')));},'filename':function(_0x49e3f6,_0x5561c4,_0x27a71a){_0x27a71a(null,util[_0x4e1a('0x28')]('%s-%s',Date[_0x4e1a('0x29')](),_0x5561c4[_0x4e1a('0x2a')]));}})});router['post']('/:id/system_avatar',upload[_0x4e1a('0x2b')]('file'),controller[_0x4e1a('0x34')]);router['post'](_0x4e1a('0x35'),controller[_0x4e1a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x34beac,_0x3c1be5,_0x3facaa){const _0x176e1e=path[_0x4e1a('0x2d')](config['root'],_0x4e1a('0x37'),_0x4e1a('0x38'),_0x4e1a('0x39'));fs_extra[_0x4e1a('0x3a')](_0x176e1e,function(){_0x3facaa(null,_0x176e1e);});},'filename':function(_0x4f20ef,_0x53b558,_0x130765){const _0x5ee6fd=_0x53b558[_0x4e1a('0x2a')][_0x4e1a('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ff283=path[_0x4e1a('0x3c')](_0x5ee6fd);const _0x3cf728=Date['now']()+'-'+_0x5ee6fd[_0x4e1a('0x3b')](_0x1ff283,'')+_0x1ff283;_0x130765(null,_0x3cf728);}})});router[_0x4e1a('0x20')](_0x4e1a('0x3d'),offlineUploadMulter['any'](),controller[_0x4e1a('0x3e')]);router[_0x4e1a('0x20')](_0x4e1a('0x14'),auth[_0x4e1a('0x7')](),controller['addInteraction']);router[_0x4e1a('0x20')]('/:id/applications',auth[_0x4e1a('0x7')](),controller['addApplications']);router['post'](_0x4e1a('0x3f'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x40')]);router[_0x4e1a('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x4e1a('0x41')]);router[_0x4e1a('0x42')]('/:id',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x43')]);router[_0x4e1a('0x44')](_0x4e1a('0xb'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x45')]);router[_0x4e1a('0x44')](_0x4e1a('0x22'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x46')]);router[_0x4e1a('0x44')](_0x4e1a('0xd'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x47')]);router[_0x4e1a('0x44')](_0x4e1a('0x1e'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x48')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 5aa27e3..5ece540 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 _0x34f2=['ENUM','AmazonAWS','Google','STRING','sequelize','exports'];(function(_0x5f0b46,_0x1e9de1){var _0x53f7d4=function(_0x30fbc4){while(--_0x30fbc4){_0x5f0b46['push'](_0x5f0b46['shift']());}};_0x53f7d4(++_0x1e9de1);}(_0x34f2,0x15a));var _0x234f=function(_0x3f5e9a,_0x5bb5f1){_0x3f5e9a=_0x3f5e9a-0x0;var _0x30b558=_0x34f2[_0x3f5e9a];return _0x30b558;};'use strict';var Sequelize=require(_0x234f('0x0'));module[_0x234f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x234f('0x2')](_0x234f('0x3'),_0x234f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x234f('0x5')]},'data2':{'type':Sequelize[_0x234f('0x5')]}}; \ No newline at end of file +var _0x55c1=['STRING','sequelize','exports','Google'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55c1,0x1e5));var _0x155c=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x55c1[_0x57fa33];return _0x12e724;};'use strict';var Sequelize=require(_0x155c('0x0'));module[_0x155c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x155c('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x155c('0x3')]},'data2':{'type':Sequelize[_0x155c('0x3')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 3800f34..4f47a07 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xfe990b,_0x20bd5a){var _0x489968=function(_0x4d19ec){while(--_0x4d19ec){_0xfe990b['push'](_0xfe990b['shift']());}};_0x489968(++_0x20bd5a);}(_0x7a54,0x106));var _0x47a5=function(_0x37b089,_0x54ecc7){_0x37b089=_0x37b089-0x0;var _0x2eab80=_0x7a54[_0x37b089];return _0x2eab80;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x365cb1,_0x101d17){var _0x4c5156=function(_0x4ccaa4){while(--_0x4ccaa4){_0x365cb1['push'](_0x365cb1['shift']());}};_0x4c5156(++_0x101d17);}(_0x7a54,0x106));var _0x47a5=function(_0x501784,_0x334c5e){_0x501784=_0x501784-0x0;var _0x4a7dc9=_0x7a54[_0x501784];return _0x4a7dc9;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 35cb88f..e279caa 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 _0x510f=['define','CloudProvider','cloud_providers','util','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x510f,0x1a0));var _0xf510=function(_0x3fc59a,_0x5c0c1d){_0x3fc59a=_0x3fc59a-0x0;var _0x2af724=_0x510f[_0x3fc59a];return _0x2af724;};'use strict';var _=require('lodash');var util=require(_0xf510('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf510('0x1'));var BPromise=require(_0xf510('0x2'));var rp=require(_0xf510('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x53bf8a,_0x1fce43){return _0x53bf8a[_0xf510('0x4')](_0xf510('0x5'),attributes,{'tableName':_0xf510('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4eaf=['path','rimraf','exports','define','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5e2af3,_0xbaf821){var _0x179e7b=function(_0x5d11e3){while(--_0x5d11e3){_0x5e2af3['push'](_0x5e2af3['shift']());}};_0x179e7b(++_0xbaf821);}(_0x4eaf,0xcd));var _0xf4ea=function(_0x310009,_0x2df8df){_0x310009=_0x310009-0x0;var _0x476994=_0x4eaf[_0x310009];return _0x476994;};'use strict';var _=require(_0xf4ea('0x0'));var util=require(_0xf4ea('0x1'));var logger=require(_0xf4ea('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf4ea('0x3'));var rp=require(_0xf4ea('0x4'));var fs=require('fs');var path=require(_0xf4ea('0x5'));var rimraf=require(_0xf4ea('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xf4ea('0x7')]=function(_0x29a0b3,_0x143de5){return _0x29a0b3[_0xf4ea('0x8')]('CloudProvider',attributes,{'tableName':_0xf4ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 29036b9..f16b431 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 _0x1f81=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x1f81,0xab));var _0x11f8=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x1f81[_0x40be86];return _0xda3c3b;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var moment=require('moment');var BPromise=require(_0x11f8('0x2'));var rs=require(_0x11f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f8('0x4'))['db'];var utils=require(_0x11f8('0x5'));var logger=require(_0x11f8('0x6'))(_0x11f8('0x7'));var config=require(_0x11f8('0x8'));var jayson=require(_0x11f8('0x9'));var client=jayson[_0x11f8('0xa')][_0x11f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fd0cf,_0x1d899d,_0x8009d7){return new BPromise(function(_0x1cecbe,_0x1bc74d){return client[_0x11f8('0xc')](_0x4fd0cf,_0x8009d7)[_0x11f8('0xd')](function(_0x5ec20c){logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));logger[_0x11f8('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1d899d,_0x11f8('0x10'),JSON[_0x11f8('0x12')](_0x5ec20c));if(_0x5ec20c[_0x11f8('0x13')]){if(_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x14')]===0x1f4){logger[_0x11f8('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1bc74d(_0x5ec20c[_0x11f8('0x13')]['message']);}logger[_0x11f8('0x13')](_0x11f8('0xf'),_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1cecbe(_0x5ec20c['error'][_0x11f8('0x15')]);}else{logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));_0x1cecbe(_0x5ec20c[_0x11f8('0x16')]['message']);}})[_0x11f8('0x17')](function(_0x3e7fb3){logger['error'](_0x11f8('0xf'),_0x1d899d,_0x3e7fb3);_0x1bc74d(_0x3e7fb3);});});} \ No newline at end of file +var _0xbcae=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xbcae,0xa9));var _0xebca=function(_0x35a1e8,_0x25aec3){_0x35a1e8=_0x35a1e8-0x0;var _0x47f183=_0xbcae[_0x35a1e8];return _0x47f183;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index e327cd1..fe75d2d 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 _0x8b52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x541b39,_0x1ac387){var _0x31aec8=function(_0x13f4ea){while(--_0x13f4ea){_0x541b39['push'](_0x541b39['shift']());}};_0x31aec8(++_0x1ac387);}(_0x8b52,0x151));var _0x28b5=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8b52[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var path=require(_0x28b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b5('0x3'));var router=express[_0x28b5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28b5('0x5'));var interaction=require(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));var controller=require(_0x28b5('0x8'));router[_0x28b5('0x9')]('/',auth[_0x28b5('0xa')](),controller[_0x28b5('0xb')]);router[_0x28b5('0x9')](_0x28b5('0xc'),auth['isAuthenticated'](),controller[_0x28b5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x28b5('0xe')]);router[_0x28b5('0xf')]('/:id',auth[_0x28b5('0xa')](),controller[_0x28b5('0x10')]);router['delete'](_0x28b5('0xc'),auth[_0x28b5('0xa')](),controller[_0x28b5('0x11')]);module[_0x28b5('0x12')]=router; \ No newline at end of file +var _0xb4d9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb4d9,0xce));var _0x9b4d=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xb4d9[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var path=require('path');var timeout=require(_0x9b4d('0x2'));var express=require(_0x9b4d('0x3'));var router=express[_0x9b4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b4d('0x5'));var interaction=require(_0x9b4d('0x6'));var config=require(_0x9b4d('0x7'));var controller=require(_0x9b4d('0x8'));router[_0x9b4d('0x9')]('/',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xb')]);router[_0x9b4d('0x9')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xd')]);router['post']('/',auth[_0x9b4d('0xa')](),controller['create']);router[_0x9b4d('0xe')]('/:id',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xf')]);router[_0x9b4d('0x10')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0x11')]);module[_0x9b4d('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 3abf093..3e41052 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 _0x9df1=['name','sequelize','exports','STRING'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x9df1,0xcd));var _0x19df=function(_0x30e278,_0x30caeb){_0x30e278=_0x30e278-0x0;var _0xd74914=_0x9df1[_0x30e278];return _0xd74914;};'use strict';var Sequelize=require(_0x19df('0x0'));module[_0x19df('0x1')]={'name':{'type':Sequelize[_0x19df('0x2')],'unique':_0x19df('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x19df('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x19df('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x19df('0x2')]},'street':{'type':Sequelize[_0x19df('0x2')]},'postalCode':{'type':Sequelize[_0x19df('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x19df('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x19df('0x2')]},'sStreet':{'type':Sequelize[_0x19df('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x19df('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf0f7=['name','STRING','sequelize','exports'];(function(_0x1243af,_0x5db6d3){var _0x5d4b6a=function(_0xeec348){while(--_0xeec348){_0x1243af['push'](_0x1243af['shift']());}};_0x5d4b6a(++_0x5db6d3);}(_0xf0f7,0xb6));var _0x7f0f=function(_0x25a6ad,_0x144b42){_0x25a6ad=_0x25a6ad-0x0;var _0x1de48f=_0xf0f7[_0x25a6ad];return _0x1de48f;};'use strict';var Sequelize=require(_0x7f0f('0x0'));module[_0x7f0f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7f0f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x7f0f('0x3')]},'website':{'type':Sequelize[_0x7f0f('0x3')]},'phone':{'type':Sequelize[_0x7f0f('0x3')]},'fax':{'type':Sequelize[_0x7f0f('0x3')]},'type':{'type':Sequelize[_0x7f0f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7f0f('0x3')]},'city':{'type':Sequelize[_0x7f0f('0x3')]},'country':{'type':Sequelize[_0x7f0f('0x3')]},'email':{'type':Sequelize[_0x7f0f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7f0f('0x3')]},'sStreet':{'type':Sequelize[_0x7f0f('0x3')]},'sPostalCode':{'type':Sequelize[_0x7f0f('0x3')]},'sCity':{'type':Sequelize[_0x7f0f('0x3')]},'sCountry':{'type':Sequelize['STRING']},'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 4ec1082..0d807e7 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 _0x8391=['find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','filter','includeAll','findAll','rows','catch','rawAttributes','include','merge','options'];(function(_0xcadb58,_0x1e17d){var _0xf8c6c3=function(_0x12cdf5){while(--_0x12cdf5){_0xcadb58['push'](_0xcadb58['shift']());}};_0xf8c6c3(++_0x1e17d);}(_0x8391,0x1cd));var _0x1839=function(_0x15ae07,_0x3a6b7d){_0x15ae07=_0x15ae07-0x0;var _0x4585dc=_0x8391[_0x15ae07];return _0x4585dc;};'use strict';var emlformat=require(_0x1839('0x0'));var rimraf=require(_0x1839('0x1'));var zipdir=require(_0x1839('0x2'));var jsonpatch=require(_0x1839('0x3'));var rp=require(_0x1839('0x4'));var moment=require('moment');var BPromise=require(_0x1839('0x5'));var Mustache=require(_0x1839('0x6'));var util=require(_0x1839('0x7'));var path=require(_0x1839('0x8'));var sox=require('sox');var csv=require(_0x1839('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1839('0xa'));var _=require(_0x1839('0xb'));var squel=require(_0x1839('0xc'));var crypto=require(_0x1839('0xd'));var jsforce=require(_0x1839('0xe'));var deskjs=require(_0x1839('0xf'));var toCsv=require(_0x1839('0x9'));var querystring=require(_0x1839('0x10'));var Papa=require(_0x1839('0x11'));var Redis=require(_0x1839('0x12'));var authService=require(_0x1839('0x13'));var qs=require(_0x1839('0x14'));var as=require(_0x1839('0x15'));var hardwareService=require(_0x1839('0x16'));var logger=require(_0x1839('0x17'))(_0x1839('0x18'));var utils=require(_0x1839('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1839('0x1a'));var db=require(_0x1839('0x1b'))['db'];function respondWithStatusCode(_0x26677d,_0x813900){_0x813900=_0x813900||0xcc;return function(_0x2fb190){if(_0x2fb190){return _0x26677d['sendStatus'](_0x813900);}return _0x26677d[_0x1839('0x1c')](_0x813900)[_0x1839('0x1d')]();};}function respondWithResult(_0x1f168a,_0x4264a7){_0x4264a7=_0x4264a7||0xc8;return function(_0x4f47e4){if(_0x4f47e4){return _0x1f168a[_0x1839('0x1c')](_0x4264a7)[_0x1839('0x1e')](_0x4f47e4);}};}function respondWithFilteredResult(_0x126b16,_0x5f21b5){return function(_0x955771){if(_0x955771){var _0x3818c5=typeof _0x5f21b5[_0x1839('0x1f')]==='undefined'&&typeof _0x5f21b5[_0x1839('0x20')]===_0x1839('0x21');var _0x2b4ed7=_0x955771[_0x1839('0x22')];var _0x92994f=_0x3818c5?0x0:_0x5f21b5[_0x1839('0x1f')];var _0x27156d=_0x3818c5?_0x955771[_0x1839('0x22')]:_0x5f21b5['offset']+_0x5f21b5['limit'];var _0x563fb6;if(_0x27156d>=_0x2b4ed7){_0x27156d=_0x2b4ed7;_0x563fb6=0xc8;}else{_0x563fb6=0xce;}_0x126b16[_0x1839('0x1c')](_0x563fb6);return _0x126b16[_0x1839('0x23')]('Content-Range',_0x92994f+'-'+_0x27156d+'/'+_0x2b4ed7)[_0x1839('0x1e')](_0x955771);}return null;};}function patchUpdates(_0x32df50){return function(_0x45abdd){try{jsonpatch['apply'](_0x45abdd,_0x32df50,!![]);}catch(_0x21cd25){return BPromise[_0x1839('0x24')](_0x21cd25);}return _0x45abdd[_0x1839('0x25')]();};}function saveUpdates(_0x10e97b,_0x10e455){return function(_0x2d5246){if(_0x2d5246){return _0x2d5246[_0x1839('0x26')](_0x10e97b)['then'](function(_0x255ed0){return _0x255ed0;});}return null;};}function removeEntity(_0x1ae6a8,_0x1e5d4e){return function(_0x4957e2){if(_0x4957e2){return _0x4957e2[_0x1839('0x27')]()[_0x1839('0x28')](function(){var _0x764b85=_0x4957e2['get']({'plain':!![]});var _0xf963ce='Companies';return db[_0x1839('0x29')]['destroy']({'where':{'type':_0xf963ce,'resourceId':_0x764b85['id']}})[_0x1839('0x28')](function(){return _0x4957e2;});})['then'](function(){_0x1ae6a8[_0x1839('0x1c')](0xcc)[_0x1839('0x1d')]();});}};}function handleEntityNotFound(_0x680add,_0x134108){return function(_0x1f22ff){if(!_0x1f22ff){_0x680add[_0x1839('0x2a')](0x194);}return _0x1f22ff;};}function handleError(_0x232e18,_0x418a37){_0x418a37=_0x418a37||0x1f4;return function(_0x353a65){logger[_0x1839('0x2b')](_0x353a65['stack']);if(_0x353a65[_0x1839('0x2c')]){delete _0x353a65[_0x1839('0x2c')];}_0x232e18[_0x1839('0x1c')](_0x418a37)[_0x1839('0x2d')](_0x353a65);};}exports[_0x1839('0x2e')]=function(_0x3ad143,_0x59fc8f){var _0x1ce220={},_0x23fd57={},_0xb5e09f={'count':0x0,'rows':[]};return db[_0x1839('0x2f')][_0x1839('0x30')]()[_0x1839('0x28')](function(_0x4db2b7){_0x23fd57[_0x1839('0x31')]=_[_0x1839('0x32')](_0x4db2b7);_0x23fd57['query']=_[_0x1839('0x32')](_0x3ad143[_0x1839('0x33')]);_0x23fd57['filters']=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],_0x23fd57[_0x1839('0x33')]);_0x1ce220[_0x1839('0x35')]=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],qs[_0x1839('0x36')](_0x3ad143[_0x1839('0x33')][_0x1839('0x36')]));_0x1ce220[_0x1839('0x35')]=_0x1ce220[_0x1839('0x35')][_0x1839('0x37')]?_0x1ce220[_0x1839('0x35')]:_0x23fd57[_0x1839('0x31')];if(!_0x3ad143[_0x1839('0x33')][_0x1839('0x38')](_0x1839('0x39'))){_0x1ce220['limit']=qs[_0x1839('0x20')](_0x3ad143[_0x1839('0x33')][_0x1839('0x20')]);_0x1ce220['offset']=qs[_0x1839('0x1f')](_0x3ad143[_0x1839('0x33')][_0x1839('0x1f')]);}_0x1ce220[_0x1839('0x3a')]=qs[_0x1839('0x3b')](_0x3ad143[_0x1839('0x33')][_0x1839('0x3b')]);_0x1ce220['where']=qs[_0x1839('0x3c')](_[_0x1839('0x3d')](_0x3ad143['query'],_0x23fd57['filters']),_0x4db2b7);if(_0x3ad143['query']['filter']){_0x1ce220[_0x1839('0x3e')]=_['merge'](_0x1ce220['where'],{'$or':_[_0x1839('0x3f')](_0x1ce220[_0x1839('0x35')],function(_0x44e607){var _0x586b47={};_0x586b47[_0x44e607]={'$like':'%'+_0x3ad143['query'][_0x1839('0x40')]+'%'};return _0x586b47;})});}_0x1ce220=_['merge']({},_0x1ce220,_0x3ad143['options']);var _0x4d4b19={'where':_0x1ce220[_0x1839('0x3e')]};return db[_0x1839('0x2f')][_0x1839('0x22')](_0x4d4b19)[_0x1839('0x28')](function(_0x4680f7){_0xb5e09f['count']=_0x4680f7;if(_0x3ad143[_0x1839('0x33')][_0x1839('0x41')]){_0x1ce220['include']=[{'all':!![]}];}return db[_0x1839('0x2f')][_0x1839('0x42')](_0x1ce220);})[_0x1839('0x28')](function(_0x5d1897){_0xb5e09f[_0x1839('0x43')]=_0x5d1897;return _0xb5e09f;})[_0x1839('0x28')](respondWithFilteredResult(_0x59fc8f,_0x1ce220))[_0x1839('0x44')](handleError(_0x59fc8f,null));})[_0x1839('0x44')](handleError(_0x59fc8f,null));};exports['show']=function(_0x32684d,_0x3a8cad){var _0x46baa8={'raw':![],'where':{'id':_0x32684d['params']['id']}},_0x22ee96={};_0x22ee96['model']=_[_0x1839('0x32')](db[_0x1839('0x2f')][_0x1839('0x45')]);_0x22ee96['query']=_[_0x1839('0x32')](_0x32684d[_0x1839('0x33')]);_0x22ee96[_0x1839('0x3c')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],_0x22ee96['query']);_0x46baa8[_0x1839('0x35')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],qs[_0x1839('0x36')](_0x32684d['query']['fields']));_0x46baa8['attributes']=_0x46baa8[_0x1839('0x35')][_0x1839('0x37')]?_0x46baa8[_0x1839('0x35')]:_0x22ee96[_0x1839('0x31')];if(_0x32684d[_0x1839('0x33')]['includeAll']){_0x46baa8[_0x1839('0x46')]=[{'all':!![]}];}_0x46baa8=_[_0x1839('0x47')]({},_0x46baa8,_0x32684d[_0x1839('0x48')]);return db[_0x1839('0x2f')][_0x1839('0x49')](_0x46baa8)[_0x1839('0x28')](handleEntityNotFound(_0x3a8cad,null))['then'](respondWithResult(_0x3a8cad,null))['catch'](handleError(_0x3a8cad,null));};exports[_0x1839('0x4a')]=function(_0x2cd7ca,_0x25a592){return db[_0x1839('0x2f')][_0x1839('0x4a')](_0x2cd7ca[_0x1839('0x4b')],{})['then'](function(_0x18c680){var _0x56214d=_0x2cd7ca[_0x1839('0x4c')][_0x1839('0x4d')]({'plain':!![]});if(!_0x56214d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56214d[_0x1839('0x4e')]===_0x1839('0x4c')){var _0x42c3c6=_0x18c680[_0x1839('0x4d')]({'plain':!![]});var _0x257df8='Companies';return db[_0x1839('0x4f')][_0x1839('0x49')]({'where':{'name':_0x257df8,'userProfileId':_0x56214d[_0x1839('0x50')]},'raw':!![]})[_0x1839('0x28')](function(_0x33bd96){if(_0x33bd96&&_0x33bd96[_0x1839('0x51')]===0x0){return db[_0x1839('0x29')][_0x1839('0x4a')]({'name':_0x42c3c6[_0x1839('0x2c')],'resourceId':_0x42c3c6['id'],'type':_0x33bd96[_0x1839('0x2c')],'sectionId':_0x33bd96['id']},{})[_0x1839('0x28')](function(){return _0x18c680;});}else{return _0x18c680;}})[_0x1839('0x44')](function(_0x4c0a1d){logger[_0x1839('0x2b')](_0x1839('0x52'),_0x4c0a1d);throw _0x4c0a1d;});}return _0x18c680;})[_0x1839('0x28')](respondWithResult(_0x25a592,0xc9))['catch'](handleError(_0x25a592,null));};exports[_0x1839('0x26')]=function(_0x5abac1,_0x1a886c){if(_0x5abac1[_0x1839('0x4b')]['id']){delete _0x5abac1[_0x1839('0x4b')]['id'];}return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x5abac1[_0x1839('0x53')]['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x1a886c,null))[_0x1839('0x28')](saveUpdates(_0x5abac1['body'],null))[_0x1839('0x28')](respondWithResult(_0x1a886c,null))[_0x1839('0x44')](handleError(_0x1a886c,null));};exports[_0x1839('0x27')]=function(_0x39a137,_0x567a33){return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x39a137['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x567a33,null))[_0x1839('0x28')](removeEntity(_0x567a33,null))['catch'](handleError(_0x567a33,null));};exports[_0x1839('0x30')]=function(_0x368295,_0x5f7c8d){return db['CmCompany'][_0x1839('0x30')]()['then'](respondWithResult(_0x5f7c8d,null))['catch'](handleError(_0x5f7c8d,null));};exports[_0x1839('0x54')]=function(_0x37431c,_0x16afc5,_0x418ea0){return db[_0x1839('0x55')]['find']({'where':{'id':_0x37431c['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x16afc5,null))[_0x1839('0x28')](function(_0x1c9a07){if(_0x1c9a07){return _0x1c9a07['addContacts'](_0x37431c[_0x1839('0x4b')][_0x1839('0x56')],_[_0x1839('0x57')](_0x37431c[_0x1839('0x4b')],[_0x1839('0x56'),'id'])||{});}})[_0x1839('0x28')](respondWithResult(_0x16afc5,null))[_0x1839('0x44')](handleError(_0x16afc5,null));};exports[_0x1839('0x58')]=function(_0x2ece61,_0x270501,_0x1680b9){var _0x526fb5={};var _0x1c124e={};var _0x33d939;var _0x1cda21;return db[_0x1839('0x2f')]['findOne']({'where':{'id':_0x2ece61['params']['id']}})['then'](handleEntityNotFound(_0x270501,null))[_0x1839('0x28')](function(_0x33fdfd){if(_0x33fdfd){_0x33d939=_0x33fdfd;_0x1c124e['model']=_[_0x1839('0x32')](db[_0x1839('0x55')][_0x1839('0x45')]);_0x1c124e['query']=_[_0x1839('0x32')](_0x2ece61['query']);_0x1c124e[_0x1839('0x3c')]=_['intersection'](_0x1c124e[_0x1839('0x31')],_0x1c124e[_0x1839('0x33')]);_0x526fb5['attributes']=_[_0x1839('0x34')](_0x1c124e['model'],qs['fields'](_0x2ece61['query'][_0x1839('0x36')]));_0x526fb5['attributes']=_0x526fb5[_0x1839('0x35')][_0x1839('0x37')]?_0x526fb5[_0x1839('0x35')]:_0x1c124e['model'];_0x526fb5[_0x1839('0x3a')]=qs['sort'](_0x2ece61[_0x1839('0x33')][_0x1839('0x3b')]);_0x526fb5[_0x1839('0x3e')]=qs[_0x1839('0x3c')](_['pick'](_0x2ece61[_0x1839('0x33')],_0x1c124e[_0x1839('0x3c')]));if(_0x2ece61[_0x1839('0x33')]['filter']){_0x526fb5[_0x1839('0x3e')]=_[_0x1839('0x47')](_0x526fb5[_0x1839('0x3e')],{'$or':_[_0x1839('0x3f')](_0x526fb5[_0x1839('0x35')],function(_0x30e29b){var _0x33f5a5={};_0x33f5a5[_0x30e29b]={'$like':'%'+_0x2ece61[_0x1839('0x33')]['filter']+'%'};return _0x33f5a5;})});}_0x526fb5=_[_0x1839('0x47')]({},_0x526fb5,_0x2ece61[_0x1839('0x48')]);return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0xfe9122){if(_0xfe9122){_0x1cda21=_0xfe9122[_0x1839('0x37')];if(!_0x2ece61['query'][_0x1839('0x38')]('nolimit')){_0x526fb5[_0x1839('0x20')]=qs['limit'](_0x2ece61[_0x1839('0x33')][_0x1839('0x20')]);_0x526fb5[_0x1839('0x1f')]=qs[_0x1839('0x1f')](_0x2ece61['query'][_0x1839('0x1f')]);}return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0x119b22){if(_0x119b22){return _0x119b22?{'count':_0x1cda21,'rows':_0x119b22}:null;}})[_0x1839('0x28')](respondWithResult(_0x270501,null))['catch'](handleError(_0x270501,null));}; \ No newline at end of file +var _0x0c6b=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','Companies','error','stack','name','send','CmCompany','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x163763,_0x2c0cd6){var _0x71ea96=function(_0x44b838){while(--_0x44b838){_0x163763['push'](_0x163763['shift']());}};_0x71ea96(++_0x2c0cd6);}(_0x0c6b,0x140));var _0xb0c6=function(_0x1adee2,_0x471d1c){_0x1adee2=_0x1adee2-0x0;var _0x45e7a2=_0x0c6b[_0x1adee2];return _0x45e7a2;};'use strict';var emlformat=require(_0xb0c6('0x0'));var rimraf=require(_0xb0c6('0x1'));var zipdir=require(_0xb0c6('0x2'));var jsonpatch=require(_0xb0c6('0x3'));var rp=require(_0xb0c6('0x4'));var moment=require(_0xb0c6('0x5'));var BPromise=require(_0xb0c6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb0c6('0x7'));var csv=require(_0xb0c6('0x8'));var ejs=require(_0xb0c6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0c6('0xa'));var squel=require('squel');var crypto=require(_0xb0c6('0xb'));var jsforce=require(_0xb0c6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb0c6('0xd'));var Papa=require(_0xb0c6('0xe'));var Redis=require(_0xb0c6('0xf'));var authService=require(_0xb0c6('0x10'));var qs=require(_0xb0c6('0x11'));var as=require(_0xb0c6('0x12'));var hardwareService=require(_0xb0c6('0x13'));var logger=require('../../config/logger')(_0xb0c6('0x14'));var utils=require(_0xb0c6('0x15'));var config=require(_0xb0c6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0c6('0x17'))['db'];function respondWithStatusCode(_0x1b6d5d,_0x9340d3){_0x9340d3=_0x9340d3||0xcc;return function(_0xc91e18){if(_0xc91e18){return _0x1b6d5d[_0xb0c6('0x18')](_0x9340d3);}return _0x1b6d5d[_0xb0c6('0x19')](_0x9340d3)[_0xb0c6('0x1a')]();};}function respondWithResult(_0x5dcdb1,_0x4143e8){_0x4143e8=_0x4143e8||0xc8;return function(_0x54f508){if(_0x54f508){return _0x5dcdb1[_0xb0c6('0x19')](_0x4143e8)['json'](_0x54f508);}};}function respondWithFilteredResult(_0x4199cd,_0x718570){return function(_0x4bd763){if(_0x4bd763){var _0x5b7a9a=typeof _0x718570[_0xb0c6('0x1b')]===_0xb0c6('0x1c')&&typeof _0x718570[_0xb0c6('0x1d')]==='undefined';var _0x18dec4=_0x4bd763[_0xb0c6('0x1e')];var _0x361042=_0x5b7a9a?0x0:_0x718570['offset'];var _0xaedc9c=_0x5b7a9a?_0x4bd763[_0xb0c6('0x1e')]:_0x718570['offset']+_0x718570['limit'];var _0x223a68;if(_0xaedc9c>=_0x18dec4){_0xaedc9c=_0x18dec4;_0x223a68=0xc8;}else{_0x223a68=0xce;}_0x4199cd[_0xb0c6('0x19')](_0x223a68);return _0x4199cd['set'](_0xb0c6('0x1f'),_0x361042+'-'+_0xaedc9c+'/'+_0x18dec4)[_0xb0c6('0x20')](_0x4bd763);}return null;};}function patchUpdates(_0x1c4f91){return function(_0x595d41){try{jsonpatch['apply'](_0x595d41,_0x1c4f91,!![]);}catch(_0x2f045f){return BPromise[_0xb0c6('0x21')](_0x2f045f);}return _0x595d41[_0xb0c6('0x22')]();};}function saveUpdates(_0x1d0990,_0xb8e1f9){return function(_0x1acdec){if(_0x1acdec){return _0x1acdec[_0xb0c6('0x23')](_0x1d0990)['then'](function(_0x18524a){return _0x18524a;});}return null;};}function removeEntity(_0x2f893c,_0x588bb9){return function(_0x5b4a7d){if(_0x5b4a7d){return _0x5b4a7d[_0xb0c6('0x24')]()[_0xb0c6('0x25')](function(){var _0x1a41fc=_0x5b4a7d['get']({'plain':!![]});var _0x34dc1f=_0xb0c6('0x26');return db['UserProfileResource'][_0xb0c6('0x24')]({'where':{'type':_0x34dc1f,'resourceId':_0x1a41fc['id']}})[_0xb0c6('0x25')](function(){return _0x5b4a7d;});})[_0xb0c6('0x25')](function(){_0x2f893c['status'](0xcc)[_0xb0c6('0x1a')]();});}};}function handleEntityNotFound(_0x6ac317,_0x3582c7){return function(_0x296d48){if(!_0x296d48){_0x6ac317[_0xb0c6('0x18')](0x194);}return _0x296d48;};}function handleError(_0x3bff1a,_0x143df9){_0x143df9=_0x143df9||0x1f4;return function(_0x392b7d){logger[_0xb0c6('0x27')](_0x392b7d[_0xb0c6('0x28')]);if(_0x392b7d[_0xb0c6('0x29')]){delete _0x392b7d[_0xb0c6('0x29')];}_0x3bff1a['status'](_0x143df9)[_0xb0c6('0x2a')](_0x392b7d);};}exports['index']=function(_0x62b94a,_0xea2e0f){var _0x5ad467={},_0x56b268={},_0xff2794={'count':0x0,'rows':[]};return db[_0xb0c6('0x2b')]['describe']()['then'](function(_0x24eebd){_0x56b268[_0xb0c6('0x2c')]=_['keys'](_0x24eebd);_0x56b268[_0xb0c6('0x2d')]=_[_0xb0c6('0x2e')](_0x62b94a[_0xb0c6('0x2d')]);_0x56b268[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x56b268[_0xb0c6('0x2c')],_0x56b268[_0xb0c6('0x2d')]);_0x5ad467[_0xb0c6('0x31')]=_[_0xb0c6('0x30')](_0x56b268[_0xb0c6('0x2c')],qs[_0xb0c6('0x32')](_0x62b94a['query']['fields']));_0x5ad467[_0xb0c6('0x31')]=_0x5ad467[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x5ad467[_0xb0c6('0x31')]:_0x56b268[_0xb0c6('0x2c')];if(!_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x34')](_0xb0c6('0x35'))){_0x5ad467[_0xb0c6('0x1d')]=qs[_0xb0c6('0x1d')](_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x1d')]);_0x5ad467[_0xb0c6('0x1b')]=qs[_0xb0c6('0x1b')](_0x62b94a[_0xb0c6('0x2d')]['offset']);}_0x5ad467[_0xb0c6('0x36')]=qs[_0xb0c6('0x37')](_0x62b94a['query'][_0xb0c6('0x37')]);_0x5ad467[_0xb0c6('0x38')]=qs[_0xb0c6('0x2f')](_[_0xb0c6('0x39')](_0x62b94a['query'],_0x56b268[_0xb0c6('0x2f')]),_0x24eebd);if(_0x62b94a[_0xb0c6('0x2d')]['filter']){_0x5ad467[_0xb0c6('0x38')]=_[_0xb0c6('0x3a')](_0x5ad467[_0xb0c6('0x38')],{'$or':_[_0xb0c6('0x3b')](_0x5ad467[_0xb0c6('0x31')],function(_0x14304f){var _0x171fd5={};_0x171fd5[_0x14304f]={'$like':'%'+_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x3c')]+'%'};return _0x171fd5;})});}_0x5ad467=_[_0xb0c6('0x3a')]({},_0x5ad467,_0x62b94a[_0xb0c6('0x3d')]);var _0x4ce590={'where':_0x5ad467[_0xb0c6('0x38')]};return db[_0xb0c6('0x2b')][_0xb0c6('0x1e')](_0x4ce590)['then'](function(_0x101afa){_0xff2794['count']=_0x101afa;if(_0x62b94a['query'][_0xb0c6('0x3e')]){_0x5ad467['include']=[{'all':!![]}];}return db['CmCompany'][_0xb0c6('0x3f')](_0x5ad467);})['then'](function(_0x2b350f){_0xff2794[_0xb0c6('0x40')]=_0x2b350f;return _0xff2794;})['then'](respondWithFilteredResult(_0xea2e0f,_0x5ad467))[_0xb0c6('0x41')](handleError(_0xea2e0f,null));})[_0xb0c6('0x41')](handleError(_0xea2e0f,null));};exports[_0xb0c6('0x42')]=function(_0x4e112e,_0x2892e4){var _0x1767aa={'raw':![],'where':{'id':_0x4e112e[_0xb0c6('0x43')]['id']}},_0x50d20d={};_0x50d20d[_0xb0c6('0x2c')]=_[_0xb0c6('0x2e')](db[_0xb0c6('0x2b')][_0xb0c6('0x44')]);_0x50d20d[_0xb0c6('0x2d')]=_[_0xb0c6('0x2e')](_0x4e112e[_0xb0c6('0x2d')]);_0x50d20d[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x50d20d[_0xb0c6('0x2c')],_0x50d20d['query']);_0x1767aa[_0xb0c6('0x31')]=_['intersection'](_0x50d20d['model'],qs[_0xb0c6('0x32')](_0x4e112e['query'][_0xb0c6('0x32')]));_0x1767aa[_0xb0c6('0x31')]=_0x1767aa[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x1767aa[_0xb0c6('0x31')]:_0x50d20d[_0xb0c6('0x2c')];if(_0x4e112e['query'][_0xb0c6('0x3e')]){_0x1767aa[_0xb0c6('0x45')]=[{'all':!![]}];}_0x1767aa=_['merge']({},_0x1767aa,_0x4e112e[_0xb0c6('0x3d')]);return db[_0xb0c6('0x2b')]['find'](_0x1767aa)[_0xb0c6('0x25')](handleEntityNotFound(_0x2892e4,null))[_0xb0c6('0x25')](respondWithResult(_0x2892e4,null))['catch'](handleError(_0x2892e4,null));};exports[_0xb0c6('0x46')]=function(_0x15d807,_0x5b7d61){return db[_0xb0c6('0x2b')][_0xb0c6('0x46')](_0x15d807['body'],{})[_0xb0c6('0x25')](function(_0x388807){var _0x4161e6=_0x15d807[_0xb0c6('0x47')][_0xb0c6('0x48')]({'plain':!![]});if(!_0x4161e6)throw new Error(_0xb0c6('0x49'));if(_0x4161e6[_0xb0c6('0x4a')]===_0xb0c6('0x47')){var _0x4081ff=_0x388807[_0xb0c6('0x48')]({'plain':!![]});var _0x3d44ba=_0xb0c6('0x26');return db['UserProfileSection'][_0xb0c6('0x4b')]({'where':{'name':_0x3d44ba,'userProfileId':_0x4161e6[_0xb0c6('0x4c')]},'raw':!![]})[_0xb0c6('0x25')](function(_0x1686d1){if(_0x1686d1&&_0x1686d1[_0xb0c6('0x4d')]===0x0){return db[_0xb0c6('0x4e')]['create']({'name':_0x4081ff[_0xb0c6('0x29')],'resourceId':_0x4081ff['id'],'type':_0x1686d1[_0xb0c6('0x29')],'sectionId':_0x1686d1['id']},{})[_0xb0c6('0x25')](function(){return _0x388807;});}else{return _0x388807;}})[_0xb0c6('0x41')](function(_0x207300){logger[_0xb0c6('0x27')](_0xb0c6('0x4f'),_0x207300);throw _0x207300;});}return _0x388807;})[_0xb0c6('0x25')](respondWithResult(_0x5b7d61,0xc9))[_0xb0c6('0x41')](handleError(_0x5b7d61,null));};exports[_0xb0c6('0x23')]=function(_0x1c1e84,_0x58696e){if(_0x1c1e84['body']['id']){delete _0x1c1e84[_0xb0c6('0x50')]['id'];}return db[_0xb0c6('0x2b')]['find']({'where':{'id':_0x1c1e84[_0xb0c6('0x43')]['id']}})[_0xb0c6('0x25')](handleEntityNotFound(_0x58696e,null))['then'](saveUpdates(_0x1c1e84[_0xb0c6('0x50')],null))[_0xb0c6('0x25')](respondWithResult(_0x58696e,null))[_0xb0c6('0x41')](handleError(_0x58696e,null));};exports[_0xb0c6('0x24')]=function(_0x57bbc4,_0x3bd72f){return db['CmCompany'][_0xb0c6('0x4b')]({'where':{'id':_0x57bbc4['params']['id']}})['then'](handleEntityNotFound(_0x3bd72f,null))[_0xb0c6('0x25')](removeEntity(_0x3bd72f,null))['catch'](handleError(_0x3bd72f,null));};exports[_0xb0c6('0x51')]=function(_0x5050c4,_0x132f6b){return db[_0xb0c6('0x2b')][_0xb0c6('0x51')]()[_0xb0c6('0x25')](respondWithResult(_0x132f6b,null))[_0xb0c6('0x41')](handleError(_0x132f6b,null));};exports['addContacts']=function(_0x21c9d4,_0x4ee13a,_0x1a3f44){return db[_0xb0c6('0x52')][_0xb0c6('0x4b')]({'where':{'id':_0x21c9d4[_0xb0c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee13a,null))[_0xb0c6('0x25')](function(_0x1bc7dd){if(_0x1bc7dd){return _0x1bc7dd['addContacts'](_0x21c9d4['body'][_0xb0c6('0x53')],_[_0xb0c6('0x54')](_0x21c9d4['body'],[_0xb0c6('0x53'),'id'])||{});}})[_0xb0c6('0x25')](respondWithResult(_0x4ee13a,null))[_0xb0c6('0x41')](handleError(_0x4ee13a,null));};exports[_0xb0c6('0x55')]=function(_0x3191f0,_0xd70c3f,_0x286118){var _0x4b8126={};var _0x378b17={};var _0x81abbb;var _0x36d747;return db[_0xb0c6('0x2b')]['findOne']({'where':{'id':_0x3191f0['params']['id']}})[_0xb0c6('0x25')](handleEntityNotFound(_0xd70c3f,null))['then'](function(_0x11b53b){if(_0x11b53b){_0x81abbb=_0x11b53b;_0x378b17[_0xb0c6('0x2c')]=_[_0xb0c6('0x2e')](db[_0xb0c6('0x52')]['rawAttributes']);_0x378b17[_0xb0c6('0x2d')]=_['keys'](_0x3191f0[_0xb0c6('0x2d')]);_0x378b17[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x378b17[_0xb0c6('0x2c')],_0x378b17[_0xb0c6('0x2d')]);_0x4b8126['attributes']=_[_0xb0c6('0x30')](_0x378b17[_0xb0c6('0x2c')],qs[_0xb0c6('0x32')](_0x3191f0[_0xb0c6('0x2d')]['fields']));_0x4b8126[_0xb0c6('0x31')]=_0x4b8126[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x4b8126[_0xb0c6('0x31')]:_0x378b17[_0xb0c6('0x2c')];_0x4b8126[_0xb0c6('0x36')]=qs[_0xb0c6('0x37')](_0x3191f0[_0xb0c6('0x2d')]['sort']);_0x4b8126[_0xb0c6('0x38')]=qs['filters'](_[_0xb0c6('0x39')](_0x3191f0[_0xb0c6('0x2d')],_0x378b17[_0xb0c6('0x2f')]));if(_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x3c')]){_0x4b8126[_0xb0c6('0x38')]=_[_0xb0c6('0x3a')](_0x4b8126[_0xb0c6('0x38')],{'$or':_[_0xb0c6('0x3b')](_0x4b8126['attributes'],function(_0xf61aa1){var _0x1b6b74={};_0x1b6b74[_0xf61aa1]={'$like':'%'+_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x3c')]+'%'};return _0x1b6b74;})});}_0x4b8126=_[_0xb0c6('0x3a')]({},_0x4b8126,_0x3191f0[_0xb0c6('0x3d')]);return _0x81abbb[_0xb0c6('0x55')](_0x4b8126);}})[_0xb0c6('0x25')](function(_0x188d14){if(_0x188d14){_0x36d747=_0x188d14[_0xb0c6('0x33')];if(!_0x3191f0[_0xb0c6('0x2d')]['hasOwnProperty'](_0xb0c6('0x35'))){_0x4b8126[_0xb0c6('0x1d')]=qs[_0xb0c6('0x1d')](_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x1d')]);_0x4b8126['offset']=qs['offset'](_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x1b')]);}return _0x81abbb[_0xb0c6('0x55')](_0x4b8126);}})['then'](function(_0x39e752){if(_0x39e752){return _0x39e752?{'count':_0x36d747,'rows':_0x39e752}:null;}})[_0xb0c6('0x25')](respondWithResult(_0xd70c3f,null))[_0xb0c6('0x41')](handleError(_0xd70c3f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 76b58f2..073f316 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 _0x394a=['../../config/environment','exports','define','CmCompany','util','api','bluebird','path','rimraf'];(function(_0x12cae1,_0x71e0d2){var _0x726f43=function(_0x2e71e0){while(--_0x2e71e0){_0x12cae1['push'](_0x12cae1['shift']());}};_0x726f43(++_0x71e0d2);}(_0x394a,0x1f3));var _0xa394=function(_0x26f145,_0xfe0e1d){_0x26f145=_0x26f145-0x0;var _0x2b55f0=_0x394a[_0x26f145];return _0x2b55f0;};'use strict';var _=require('lodash');var util=require(_0xa394('0x0'));var logger=require('../../config/logger')(_0xa394('0x1'));var moment=require('moment');var BPromise=require(_0xa394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa394('0x3'));var rimraf=require(_0xa394('0x4'));var config=require(_0xa394('0x5'));var attributes=require('./cmCompany.attributes');module[_0xa394('0x6')]=function(_0x210a0b,_0x11f468){return _0x210a0b[_0xa394('0x7')](_0xa394('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63d5=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3823ac,_0x52b54c){var _0x37bf75=function(_0x2f3a65){while(--_0x2f3a65){_0x3823ac['push'](_0x3823ac['shift']());}};_0x37bf75(++_0x52b54c);}(_0x63d5,0x15a));var _0x563d=function(_0x95307c,_0x55cc74){_0x95307c=_0x95307c-0x0;var _0x28b7c3=_0x63d5[_0x95307c];return _0x28b7c3;};'use strict';var _=require(_0x563d('0x0'));var util=require(_0x563d('0x1'));var logger=require(_0x563d('0x2'))(_0x563d('0x3'));var moment=require(_0x563d('0x4'));var BPromise=require('bluebird');var rp=require(_0x563d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x563d('0x6'));var config=require(_0x563d('0x7'));var attributes=require(_0x563d('0x8'));module['exports']=function(_0x3cff40,_0x47aeb0){return _0x3cff40[_0x563d('0x9')](_0x563d('0xa'),attributes,{'tableName':'cm_companies','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 e540b6a..aa57512 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 _0xe1dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0xe1dc,0xcb));var _0xce1d=function(_0x11b43d,_0x3f1aa5){_0x11b43d=_0x11b43d-0x0;var _0x14a908=_0xe1dc[_0x11b43d];return _0x14a908;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var moment=require(_0xce1d('0x2'));var BPromise=require(_0xce1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce1d('0x4'));var db=require(_0xce1d('0x5'))['db'];var utils=require(_0xce1d('0x6'));var logger=require(_0xce1d('0x7'))(_0xce1d('0x8'));var config=require('../../config/environment');var jayson=require(_0xce1d('0x9'));var client=jayson['client'][_0xce1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x565e69,_0x5e539e,_0x55a626){return new BPromise(function(_0x2f6404,_0x30c554){return client['request'](_0x565e69,_0x55a626)[_0xce1d('0xb')](function(_0x57e3ad){logger[_0xce1d('0xc')](_0xce1d('0xd'),_0x5e539e,_0xce1d('0xe'));logger[_0xce1d('0xf')](_0xce1d('0x10'),_0x5e539e,_0xce1d('0xe'),JSON[_0xce1d('0x11')](_0x57e3ad));if(_0x57e3ad[_0xce1d('0x12')]){if(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x13')]===0x1f4){logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad['error'][_0xce1d('0x14')]);return _0x30c554(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad[_0xce1d('0x12')]['message']);return _0x2f6404(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}else{logger['info'](_0xce1d('0xd'),_0x5e539e,'request\x20sent');_0x2f6404(_0x57e3ad[_0xce1d('0x15')][_0xce1d('0x14')]);}})[_0xce1d('0x16')](function(_0x417121){logger[_0xce1d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5e539e,_0x417121);_0x30c554(_0x417121);});});} \ No newline at end of file +var _0xe27e=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xe27e,0x67));var _0xee27=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xe27e[_0x59b439];return _0x521ea3;};'use strict';var _=require(_0xee27('0x0'));var util=require(_0xee27('0x1'));var moment=require(_0xee27('0x2'));var BPromise=require(_0xee27('0x3'));var rs=require(_0xee27('0x4'));var fs=require('fs');var Redis=require(_0xee27('0x5'));var db=require(_0xee27('0x6'))['db'];var utils=require(_0xee27('0x7'));var logger=require('../../config/logger')(_0xee27('0x8'));var config=require('../../config/environment');var jayson=require(_0xee27('0x9'));var client=jayson[_0xee27('0xa')][_0xee27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58330b,_0x3c1393,_0x2ab4cc){return new BPromise(function(_0x2d3eee,_0x3aca89){return client[_0xee27('0xc')](_0x58330b,_0x2ab4cc)['then'](function(_0x29dd19){logger[_0xee27('0xd')](_0xee27('0xe'),_0x3c1393,_0xee27('0xf'));logger['debug'](_0xee27('0x10'),_0x3c1393,_0xee27('0xf'),JSON['stringify'](_0x29dd19));if(_0x29dd19[_0xee27('0x11')]){if(_0x29dd19[_0xee27('0x11')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3c1393,_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);return _0x3aca89(_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);}logger[_0xee27('0x11')](_0xee27('0xe'),_0x3c1393,_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);return _0x2d3eee(_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x3c1393,_0xee27('0xf'));_0x2d3eee(_0x29dd19['result'][_0xee27('0x12')]);}})[_0xee27('0x13')](function(_0x2f6132){logger[_0xee27('0x11')]('CmCompany,\x20%s,\x20%s',_0x3c1393,_0x2f6132);_0x3aca89(_0x2f6132);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c6a1df0..f080374 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 _0xf12d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','put','destroy','exports'];(function(_0x7ab3f9,_0x4aa58b){var _0x502b8f=function(_0x29f065){while(--_0x29f065){_0x7ab3f9['push'](_0x7ab3f9['shift']());}};_0x502b8f(++_0x4aa58b);}(_0xf12d,0xcc));var _0xdf12=function(_0x4681ae,_0x52791a){_0x4681ae=_0x4681ae-0x0;var _0x5b0ce6=_0xf12d[_0x4681ae];return _0x5b0ce6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf12('0x0'));var express=require(_0xdf12('0x1'));var router=express[_0xdf12('0x2')]();var fs_extra=require(_0xdf12('0x3'));var auth=require(_0xdf12('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf12('0x5'));router[_0xdf12('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf12('0x6')]('/describe',auth[_0xdf12('0x7')](),controller[_0xdf12('0x8')]);router['get'](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['show']);router[_0xdf12('0x6')](_0xdf12('0xa'),auth[_0xdf12('0x7')](),controller[_0xdf12('0xb')]);router[_0xdf12('0xc')]('/',auth['isAuthenticated'](),controller[_0xdf12('0xd')]);router['post']('/:id/contacts',auth[_0xdf12('0x7')](),controller['addContacts']);router[_0xdf12('0xe')](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['update']);router['delete'](_0xdf12('0x9'),auth['isAuthenticated'](),controller[_0xdf12('0xf')]);module[_0xdf12('0x10')]=router; \ No newline at end of file +var _0x8b4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','addContacts','update','multer','util','path','connect-timeout','express'];(function(_0x4144d2,_0x50d00e){var _0x2eb216=function(_0x367f5c){while(--_0x367f5c){_0x4144d2['push'](_0x4144d2['shift']());}};_0x2eb216(++_0x50d00e);}(_0x8b4c,0x87));var _0xc8b4=function(_0x49792d,_0x22afc2){_0x49792d=_0x49792d-0x0;var _0x2a468a=_0x8b4c[_0x49792d];return _0x2a468a;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var path=require(_0xc8b4('0x2'));var timeout=require(_0xc8b4('0x3'));var express=require(_0xc8b4('0x4'));var router=express[_0xc8b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8b4('0x6'));var interaction=require(_0xc8b4('0x7'));var config=require(_0xc8b4('0x8'));var controller=require(_0xc8b4('0x9'));router[_0xc8b4('0xa')]('/',auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xc')]);router[_0xc8b4('0xa')]('/describe',auth[_0xc8b4('0xb')](),controller['describe']);router['get'](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xe')]);router[_0xc8b4('0xa')](_0xc8b4('0xf'),auth['isAuthenticated'](),controller[_0xc8b4('0x10')]);router[_0xc8b4('0x11')]('/',auth[_0xc8b4('0xb')](),controller['create']);router[_0xc8b4('0x11')](_0xc8b4('0xf'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x12')]);router['put'](_0xc8b4('0xd'),auth['isAuthenticated'](),controller[_0xc8b4('0x13')]);router['delete'](_0xc8b4('0xd'),auth['isAuthenticated'](),controller['destroy']);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 fdd89d8..0664604 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 _0x210f=['UNSIGNED','NOW','exports','STRING','INTEGER'];(function(_0x9db9e,_0x4a52b0){var _0x12af4a=function(_0x17e8e4){while(--_0x17e8e4){_0x9db9e['push'](_0x9db9e['shift']());}};_0x12af4a(++_0x4a52b0);}(_0x210f,0x17e));var _0xf210=function(_0x4a38f7,_0x42419){_0x4a38f7=_0x4a38f7-0x0;var _0x1b3108=_0x210f[_0x4a38f7];return _0x1b3108;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xf210('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf210('0x1')]},'street':{'type':Sequelize[_0xf210('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf210('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf210('0x1')]},'mobile':{'type':Sequelize[_0xf210('0x1')]},'fax':{'type':Sequelize[_0xf210('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xf210('0x1')]},'facebook':{'type':Sequelize[_0xf210('0x1')]},'fb_data':{'type':Sequelize[_0xf210('0x1')]},'twitter':{'type':Sequelize[_0xf210('0x1')]},'skype':{'type':Sequelize[_0xf210('0x1')]},'teams':{'type':Sequelize[_0xf210('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xf210('0x1')]},'wechat':{'type':Sequelize[_0xf210('0x1')]},'telegram':{'type':Sequelize[_0xf210('0x1')]},'UserId':{'type':Sequelize[_0xf210('0x2')]},'priority':{'type':Sequelize[_0xf210('0x2')](0x2)[_0xf210('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf210('0x4')]}}; \ No newline at end of file +var _0xda16=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0x3a4b2a,_0x1d17d2){var _0xe2640e=function(_0x58f4d2){while(--_0x58f4d2){_0x3a4b2a['push'](_0x3a4b2a['shift']());}};_0xe2640e(++_0x1d17d2);}(_0xda16,0x148));var _0x6da1=function(_0x237418,_0x56e144){_0x237418=_0x237418-0x0;var _0x22393e=_0xda16[_0x237418];return _0x22393e;};'use strict';var _=require(_0x6da1('0x0'));var Sequelize=require('sequelize');module[_0x6da1('0x1')]={'firstName':{'type':Sequelize[_0x6da1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6da1('0x2')]},'street':{'type':Sequelize[_0x6da1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6da1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6da1('0x2')]},'description':{'type':Sequelize[_0x6da1('0x3')]},'phone':{'type':Sequelize[_0x6da1('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6da1('0x2')]},'email':{'type':Sequelize[_0x6da1('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x6da1('0x2')]},'fb_data':{'type':Sequelize[_0x6da1('0x2')]},'twitter':{'type':Sequelize[_0x6da1('0x2')]},'skype':{'type':Sequelize[_0x6da1('0x2')]},'teams':{'type':Sequelize[_0x6da1('0x2')]},'viber':{'type':Sequelize[_0x6da1('0x2')]},'line':{'type':Sequelize[_0x6da1('0x2')]},'wechat':{'type':Sequelize[_0x6da1('0x2')]},'telegram':{'type':Sequelize[_0x6da1('0x2')]},'UserId':{'type':Sequelize[_0x6da1('0x4')]},'priority':{'type':Sequelize[_0x6da1('0x4')](0x2)[_0x6da1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6da1('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 36eab8a..dfb8704 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 _0x8d76=['toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','duration','createdAt','userDisposition','userThirdDisposition','fullname','VoiceCallReport','findAndCountAll','startCase','chat','closed','note','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','status','json','undefined','count','offset','set','Content-Range','then','end','sendStatus','error','stack','name','index','keys','length','cf_','push','CmCustomField','findOne','trimStart','all','model','query','intersection','attributes','fields','limit','sort','filters','select','field','tools_tags','from','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','value','split','map','union','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','DATE','type','text','start','filter','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','order','DESC','t.id\x20IN\x20?','resolve','role','agent','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','CmContact','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','destroy','params','describe','tags','columnName','displayName','analytics','alias','custom','values','hasOwnProperty','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','info','create','ChatInteraction','ChatMessage','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','Tag','color','isNil','$and','findAll','omit','startsWith','format','cm_contacts','id\x20=\x20?','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','nolimit','ContactId','include','rows','pick','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','send','createReadStream','meta','User','binding','../../components/import/cm/csv2','stringify','message','pid','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8d76,0x14f));var _0x68d7=function(_0x5ea131,_0xbe8009){_0x5ea131=_0x5ea131-0x0;var _0x59ab8b=_0x8d76[_0x5ea131];return _0x59ab8b;};'use strict';var moment=require(_0x68d7('0x0'));var BPromise=require(_0x68d7('0x1'));var util=require(_0x68d7('0x2'));var path=require(_0x68d7('0x3'));var fs=require('fs');var _=require(_0x68d7('0x4'));var squel=require(_0x68d7('0x5'));var Papa=require('papaparse');var Redis=require(_0x68d7('0x6'));var qs=require(_0x68d7('0x7'));var as=require(_0x68d7('0x8'));var logger=require(_0x68d7('0x9'))(_0x68d7('0xa'));var config=require(_0x68d7('0xb'));var db=require(_0x68d7('0xc'))['db'];config[_0x68d7('0xd')]=_[_0x68d7('0xe')](config[_0x68d7('0xd')],{'host':_0x68d7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68d7('0xd')]));require(_0x68d7('0x10'))[_0x68d7('0x11')](socket);function respondWithResult(_0xa21f73,_0xe00bc6){_0xe00bc6=_0xe00bc6||0xc8;return function(_0x5691f4){if(_0x5691f4){return _0xa21f73[_0x68d7('0x12')](_0xe00bc6)[_0x68d7('0x13')](_0x5691f4);}};}function respondWithFilteredResult(_0x11e111,_0x50d61b){return function(_0x3230b0){if(_0x3230b0){var _0x26ad72=typeof _0x50d61b['offset']===_0x68d7('0x14')&&typeof _0x50d61b['limit']===_0x68d7('0x14');var _0x1f775a=_0x3230b0[_0x68d7('0x15')];var _0x287267=_0x26ad72?0x0:_0x50d61b[_0x68d7('0x16')];var _0x29f895=_0x26ad72?_0x3230b0[_0x68d7('0x15')]:_0x50d61b[_0x68d7('0x16')]+_0x50d61b['limit'];var _0x3cf2a8;if(_0x29f895>=_0x1f775a){_0x29f895=_0x1f775a;_0x3cf2a8=0xc8;}else{_0x3cf2a8=0xce;}_0x11e111[_0x68d7('0x12')](_0x3cf2a8);return _0x11e111[_0x68d7('0x17')](_0x68d7('0x18'),_0x287267+'-'+_0x29f895+'/'+_0x1f775a)[_0x68d7('0x13')](_0x3230b0);}return null;};}function saveUpdates(_0x4a6b4c){return function(_0xf9975b){if(_0xf9975b){return _0xf9975b['update'](_0x4a6b4c)[_0x68d7('0x19')](function(_0x170be1){return _0x170be1;});}return null;};}function removeEntity(_0x202aea){return function(_0x3ae0f4){if(_0x3ae0f4){return _0x3ae0f4['destroy']()[_0x68d7('0x19')](function(){_0x202aea['status'](0xcc)[_0x68d7('0x1a')]();});}};}function handleEntityNotFound(_0x2b13d9){return function(_0x353fa4){if(!_0x353fa4){_0x2b13d9[_0x68d7('0x1b')](0x194);}return _0x353fa4;};}function handleError(_0x4049a0,_0xccb0fc){_0xccb0fc=_0xccb0fc||0x1f4;return function(_0x4293b3){logger[_0x68d7('0x1c')](_0x4293b3[_0x68d7('0x1d')]);if(_0x4293b3[_0x68d7('0x1e')]){delete _0x4293b3['name'];}_0x4049a0['status'](_0xccb0fc)['send'](_0x4293b3);};}exports[_0x68d7('0x1f')]=function(_0xd60fd4,_0x584b4e){var _0x18c497={},_0x451a13={},_0x14220c={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x68d7('0x19')](function(_0x47fe08){var _0x24e23b=[];for(var _0x5971b6=0x0;_0x5971b60x1){_0x1f528['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2e49b8),null);}else{if(qs[_0x68d7('0x5a')](_0x2e49b8)){_0x1f528['or'](_0x68d7('0x5b'),_0x2e49b8+'%');_0x1f528['or']('c.phone\x20LIKE\x20?',_0x2e49b8+'%');_0x1f528['or'](_0x68d7('0x5c'),_0x2e49b8+'%');_0x1f528['or'](_0x68d7('0x5d'),_0x2e49b8+'%');}else if(qs[_0x68d7('0x5e')](_0x2e49b8)){_0x1f528['or'](_0x68d7('0x5f'),_0x2e49b8+'%');}else{_0x1f528['or'](_0x68d7('0x60'),'%'+_0x2e49b8+'%');_0x1f528['or']('c.lastName\x20LIKE\x20?','%'+_0x2e49b8+'%');_0x1f528['or'](_0x68d7('0x5f'),'%'+_0x2e49b8+'%');}}}}_0x1cdb4c[_0x68d7('0x39')](_0x1f528);_0x1cdb4c[_0x68d7('0x61')](_0x68d7('0x62'));var _0x1b229b={'type':db[_0x68d7('0x63')][_0x68d7('0x64')]['SELECT'],'raw':!![]};var _0xaa6b55=_0x1cdb4c['clone']()[_0x68d7('0x31')](_0x68d7('0x62'));if(_0x18c497[_0x68d7('0x65')]){_0x18c497[_0x68d7('0x65')][_0x68d7('0x51')](function(_0x1fec6c){_0x1cdb4c[_0x68d7('0x65')]('c.'+_0x1fec6c[0x0],_0x1fec6c[0x1]===_0x68d7('0x66')?![]:!![]);});}if(!_[_0x68d7('0x50')](_0x1eff8c)){_0x1cdb4c['having'](_0x45e5fa);_0xaa6b55[_0x68d7('0x39')](_0x68d7('0x67'),_0x1eff8c);}BPromise[_0x68d7('0x68')]()[_0x68d7('0x19')](function(){if(!_0x3dc67a)return;if(_0xd60fd4['user'][_0x68d7('0x69')]!==_0x68d7('0x6a'))return;if(!_['some'](_0x3dc67a[_0x68d7('0x3e')],[_0x68d7('0x31'),'User'])){return _0xd60fd4['user'][_0x68d7('0x6b')]({'attributes':['id'],'raw':!![]})[_0x68d7('0x19')](function(_0x47f4c0){if(_['isEmpty'](_0x47f4c0)){_0xaa6b55[_0x68d7('0x39')]('c.ListId\x20IS\x20NULL');_0x1cdb4c[_0x68d7('0x39')](_0x68d7('0x6c'));}else{_0xaa6b55[_0x68d7('0x39')](_0x68d7('0x53'),_[_0x68d7('0x42')](_0x47f4c0,'id'));_0x1cdb4c['where'](_0x68d7('0x53'),_[_0x68d7('0x42')](_0x47f4c0,'id'));}});}})[_0x68d7('0x19')](function(){if(_0xd60fd4['user'][_0x68d7('0x69')]==='agent'&&!_0x3dc67a&&!_0xd60fd4[_0x68d7('0x29')][_0x68d7('0x52')])return[];return db[_0x68d7('0x6d')][_0x68d7('0x29')](_0xaa6b55[_0x68d7('0x6e')](),_0x1b229b);})[_0x68d7('0x19')](function(_0x5323a1){_0x14220c['count']=_0x5323a1[_0x68d7('0x21')];if(_0x14220c[_0x68d7('0x15')]===0x0)return[];return db[_0x68d7('0x6d')][_0x68d7('0x29')](_0x24f74d[_0x68d7('0x6e')](),_0x1b229b)[_0x68d7('0x19')](function(_0xa1241e){_0x2d4ec7=_[_0x68d7('0x6f')](_0xa1241e,'id');_0x1b229b=_[_0x68d7('0x70')](_0x1b229b,{'model':db[_0x68d7('0x71')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd60fd4[_0x68d7('0x29')][_0x68d7('0x2c')]){_0x18c497[_0x68d7('0x2b')][_0x68d7('0x51')](function(_0x3009a9){_0x1cdb4c[_0x68d7('0x31')]('c.'+_0x3009a9);});}else{_0x1cdb4c[_0x68d7('0x31')]('c.id');_0x1cdb4c[_0x68d7('0x31')]('c.firstName');_0x1cdb4c[_0x68d7('0x31')]('c.lastName');_0x1cdb4c['field'](_0x68d7('0x72'));_0x1cdb4c[_0x68d7('0x31')](_0x68d7('0x73'));_0x1cdb4c['field'](_0x68d7('0x74'));_0x1cdb4c[_0x68d7('0x31')](_0x68d7('0x75'));_0x1cdb4c[_0x68d7('0x31')](_0x68d7('0x76'));_0x1cdb4c['field'](_0x68d7('0x77'));_0x1cdb4c[_0x68d7('0x31')]('c.deletedAt');_0x1cdb4c[_0x68d7('0x31')]('c.CompanyId');_0x1cdb4c[_0x68d7('0x31')](_0x68d7('0x78'),_0x68d7('0x79'));}if(_0x18c497['limit'])_0x1cdb4c['limit'](_0x18c497[_0x68d7('0x2d')]);if(_0x18c497[_0x68d7('0x16')])_0x1cdb4c[_0x68d7('0x16')](_0x18c497[_0x68d7('0x16')]);return db[_0x68d7('0x6d')][_0x68d7('0x29')](_0x1cdb4c['toString'](),_0x1b229b);});})[_0x68d7('0x19')](function(_0x1b1b34){_0x1b1b34[_0x68d7('0x51')](function(_0x5555e7){if(_0x5555e7[_0x68d7('0x79')]){_0x5555e7['Tags']=[];_0x5555e7[_0x68d7('0x79')]['split'](',')['forEach'](function(_0x56aefe){_0x5555e7[_0x68d7('0x7a')]['push'](_0x2d4ec7[_0x56aefe]);});}delete _0x5555e7[_0x68d7('0x79')];});_0x14220c['rows']=_0x1b1b34;return _0x14220c;})[_0x68d7('0x19')](respondWithFilteredResult(_0x584b4e,_0x18c497));})[_0x68d7('0x7b')](handleError(_0x584b4e,null));};exports[_0x68d7('0x7c')]=function(_0x31f298,_0x29cff7){return db[_0x68d7('0x71')][_0x68d7('0x3f')]({'where':{'id':_0x31f298[_0x68d7('0x7d')]['id']}})['then'](handleEntityNotFound(_0x29cff7,null))[_0x68d7('0x19')](removeEntity(_0x29cff7,null))[_0x68d7('0x7b')](handleError(_0x29cff7,null));};exports[_0x68d7('0x7e')]=function(_0x6ba78a,_0xce0e99){return db[_0x68d7('0x71')]['describe']()[_0x68d7('0x19')](function(_0x5946bf){delete _0x5946bf[_0x68d7('0x7f')];for(var _0x341c59=0x0;_0x341c59=_0x196ba6){_0x5dc699=_0x196ba6;_0xbc1203=0xc8;}else{_0xbc1203=0xce;}_0x53e6aa[_0x617b('0xd')](_0xbc1203);return _0x53e6aa[_0x617b('0x12')](_0x617b('0x13'),_0x25b756+'-'+_0x5dc699+'/'+_0x196ba6)[_0x617b('0x14')](_0x5c16c0);}return null;};}function saveUpdates(_0x47b826){return function(_0xd785ba){if(_0xd785ba){return _0xd785ba['update'](_0x47b826)[_0x617b('0x15')](function(_0x130a90){return _0x130a90;});}return null;};}function removeEntity(_0x138d85){return function(_0x3576b3){if(_0x3576b3){return _0x3576b3[_0x617b('0x16')]()['then'](function(){_0x138d85[_0x617b('0xd')](0xcc)[_0x617b('0x17')]();});}};}function handleEntityNotFound(_0x555e44){return function(_0x2583ad){if(!_0x2583ad){_0x555e44[_0x617b('0x18')](0x194);}return _0x2583ad;};}function handleError(_0x347a76,_0x5ad2e2){_0x5ad2e2=_0x5ad2e2||0x1f4;return function(_0xd0fc7){logger[_0x617b('0x19')](_0xd0fc7[_0x617b('0x1a')]);if(_0xd0fc7[_0x617b('0x1b')]){delete _0xd0fc7[_0x617b('0x1b')];}_0x347a76[_0x617b('0xd')](_0x5ad2e2)[_0x617b('0x1c')](_0xd0fc7);};}exports[_0x617b('0x1d')]=function(_0x3edc07,_0x5591af){var _0x24a5cf={},_0x3bef79={},_0x9fbdcf={'count':0x0,'rows':[]};return db[_0x617b('0x1e')][_0x617b('0x1f')]()[_0x617b('0x15')](function(_0x234461){var _0x57fdca=[];for(var _0x114b35=0x0;_0x114b350x1){_0x2cab40['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x39cfc1),null);}else{if(qs[_0x617b('0x5e')](_0x39cfc1)){_0x2cab40['or'](_0x617b('0x5f'),_0x39cfc1+'%');_0x2cab40['or']('c.phone\x20LIKE\x20?',_0x39cfc1+'%');_0x2cab40['or'](_0x617b('0x60'),_0x39cfc1+'%');_0x2cab40['or'](_0x617b('0x61'),_0x39cfc1+'%');}else if(qs[_0x617b('0x62')](_0x39cfc1)){_0x2cab40['or'](_0x617b('0x63'),_0x39cfc1+'%');}else{_0x2cab40['or'](_0x617b('0x64'),'%'+_0x39cfc1+'%');_0x2cab40['or'](_0x617b('0x65'),'%'+_0x39cfc1+'%');_0x2cab40['or']('c.email\x20LIKE\x20?','%'+_0x39cfc1+'%');}}}}_0x1156e1[_0x617b('0x31')](_0x2cab40);_0x1156e1[_0x617b('0x66')]('c.id');var _0x585625={'type':db['Sequelize']['QueryTypes'][_0x617b('0x67')],'raw':!![]};var _0x3ddaa8=_0x1156e1['clone']()[_0x617b('0x34')](_0x617b('0x68'));if(_0x24a5cf[_0x617b('0x2f')]){_0x24a5cf['order'][_0x617b('0x47')](function(_0x43fcaf){_0x1156e1[_0x617b('0x2f')]('c.'+_0x43fcaf[0x0],_0x43fcaf[0x1]===_0x617b('0x69')?![]:!![]);});}if(!_[_0x617b('0x58')](_0x4b3bfa)){_0x1156e1[_0x617b('0x6a')](_0x12fe8b);_0x3ddaa8['where'](_0x617b('0x6b'),_0x4b3bfa);}BPromise['resolve']()[_0x617b('0x15')](function(){if(!_0x23d1f5)return;if(_0x3edc07['user'][_0x617b('0x6c')]!==_0x617b('0x6d'))return;if(!_['some'](_0x23d1f5[_0x617b('0x43')],['field',_0x617b('0x4a')])){return _0x3edc07['user'][_0x617b('0x6e')]({'attributes':['id'],'raw':!![]})[_0x617b('0x15')](function(_0x2e8aaf){if(_[_0x617b('0x58')](_0x2e8aaf)){_0x3ddaa8['where'](_0x617b('0x6f'));_0x1156e1[_0x617b('0x31')](_0x617b('0x6f'));}else{_0x3ddaa8[_0x617b('0x31')](_0x617b('0x70'),_[_0x617b('0x46')](_0x2e8aaf,'id'));_0x1156e1['where'](_0x617b('0x70'),_[_0x617b('0x46')](_0x2e8aaf,'id'));}});}})[_0x617b('0x15')](function(){if(_0x3edc07[_0x617b('0x71')][_0x617b('0x6c')]===_0x617b('0x6d')&&!_0x23d1f5&&!_0x3edc07[_0x617b('0x29')]['ListId'])return[];return db['sequelize']['query'](_0x3ddaa8['toString'](),_0x585625);})[_0x617b('0x15')](function(_0x4f3eac){_0x9fbdcf['count']=_0x4f3eac[_0x617b('0x21')];if(_0x9fbdcf[_0x617b('0x11')]===0x0)return[];return db[_0x617b('0x72')][_0x617b('0x29')](_0x20d5fd[_0x617b('0x73')](),_0x585625)[_0x617b('0x15')](function(_0x508739){_0x11dedd=_[_0x617b('0x74')](_0x508739,'id');_0x585625=_['merge'](_0x585625,{'model':db[_0x617b('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3edc07[_0x617b('0x29')]['fields']){_0x24a5cf['attributes'][_0x617b('0x47')](function(_0x1a7bd4){_0x1156e1['field']('c.'+_0x1a7bd4);});}else{_0x1156e1['field']('c.id');_0x1156e1[_0x617b('0x34')](_0x617b('0x75'));_0x1156e1[_0x617b('0x34')]('c.lastName');_0x1156e1[_0x617b('0x34')]('c.phone');_0x1156e1[_0x617b('0x34')]('c.mobile');_0x1156e1[_0x617b('0x34')](_0x617b('0x76'));_0x1156e1[_0x617b('0x34')](_0x617b('0x77'));_0x1156e1[_0x617b('0x34')](_0x617b('0x78'));_0x1156e1[_0x617b('0x34')](_0x617b('0x79'));_0x1156e1[_0x617b('0x34')](_0x617b('0x7a'));_0x1156e1[_0x617b('0x34')]('c.CompanyId');_0x1156e1['field'](_0x617b('0x7b'),'TagIds');}if(_0x24a5cf[_0x617b('0xf')])_0x1156e1[_0x617b('0xf')](_0x24a5cf[_0x617b('0xf')]);if(_0x24a5cf['offset'])_0x1156e1['offset'](_0x24a5cf['offset']);return db['sequelize'][_0x617b('0x29')](_0x1156e1[_0x617b('0x73')](),_0x585625);});})['then'](function(_0x1857cd){_0x1857cd[_0x617b('0x47')](function(_0x3723c0){if(_0x3723c0['TagIds']){_0x3723c0[_0x617b('0x7c')]=[];_0x3723c0[_0x617b('0x7d')][_0x617b('0x45')](',')['forEach'](function(_0xd6a476){_0x3723c0[_0x617b('0x7c')][_0x617b('0x57')](_0x11dedd[_0xd6a476]);});}delete _0x3723c0[_0x617b('0x7d')];});_0x9fbdcf[_0x617b('0x7e')]=_0x1857cd;return _0x9fbdcf;})[_0x617b('0x15')](respondWithFilteredResult(_0x5591af,_0x24a5cf));})[_0x617b('0x7f')](handleError(_0x5591af,null));};exports['destroy']=function(_0x604c9,_0x59f62b){return db[_0x617b('0x1e')][_0x617b('0x80')]({'where':{'id':_0x604c9['params']['id']}})[_0x617b('0x15')](handleEntityNotFound(_0x59f62b,null))[_0x617b('0x15')](removeEntity(_0x59f62b,null))[_0x617b('0x7f')](handleError(_0x59f62b,null));};exports[_0x617b('0x1f')]=function(_0x31a8d9,_0x381482){return db[_0x617b('0x1e')][_0x617b('0x1f')]()[_0x617b('0x15')](function(_0x4dd9df){delete _0x4dd9df['tags'];for(var _0x5a66f1=0x0;_0x5a66f1{}\s\\|]/g,'-');_0x316390(null,util[_0xabed('0x23')]('%s-%s%s',path['basename'](_0x2f8426[_0xabed('0x21')],path[_0xabed('0x24')](_0x2f8426[_0xabed('0x21')])),Date[_0xabed('0x25')](),path[_0xabed('0x24')](_0x2f8426['originalname'])));}})});router[_0xabed('0x1e')]('/csv',upload[_0xabed('0x26')]('file'),controller[_0xabed('0x27')]);var upload=multer({'storage':multer[_0xabed('0x28')]({'destination':function(_0x2d0630,_0x545eac,_0x3b14ab){_0x3b14ab(null,path[_0xabed('0x29')](config[_0xabed('0x20')],'server/files/tmp'));},'filename':function(_0x1c9f4f,_0x4995ee,_0x259acf){_0x4995ee[_0xabed('0x21')]=_0x4995ee['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x259acf(null,util['format'](_0xabed('0x2a'),path[_0xabed('0x2b')](_0x4995ee[_0xabed('0x21')],path[_0xabed('0x24')](_0x4995ee['originalname'])),Date[_0xabed('0x25')](),path[_0xabed('0x24')](_0x4995ee['originalname'])));}})});router[_0xabed('0x1e')](_0xabed('0x2c'),upload[_0xabed('0x26')](_0xabed('0x2d')),controller['upload']);router[_0xabed('0x1e')](_0xabed('0x2e'),auth['isAuthenticated'](),controller[_0xabed('0x2f')]);router[_0xabed('0x30')](_0xabed('0xe'),auth['isAuthenticated'](),controller[_0xabed('0x31')]);router['delete'](_0xabed('0xe'),auth[_0xabed('0xa')](),controller[_0xabed('0x32')]);module[_0xabed('0x33')]=router; \ No newline at end of file +var _0x34fb=['/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','/create_many','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','/csv','file','uploadCsv','/upload','single','upload','/upload/:id','import','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x3f92b4,_0x78c512){var _0x3a63e5=function(_0x2f18a9){while(--_0x2f18a9){_0x3f92b4['push'](_0x3f92b4['shift']());}};_0x3a63e5(++_0x78c512);}(_0x34fb,0x14f));var _0xb34f=function(_0x717e47,_0x280b94){_0x717e47=_0x717e47-0x0;var _0x4305cf=_0x34fb[_0x717e47];return _0x4305cf;};'use strict';var multer=require(_0xb34f('0x0'));var util=require(_0xb34f('0x1'));var path=require(_0xb34f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb34f('0x3')]();var fs_extra=require(_0xb34f('0x4'));var auth=require(_0xb34f('0x5'));var interaction=require(_0xb34f('0x6'));var config=require('../../config/environment');var controller=require(_0xb34f('0x7'));router[_0xb34f('0x8')]('/',auth['isAuthenticated'](),controller[_0xb34f('0x9')]);router[_0xb34f('0x8')](_0xb34f('0xa'),auth[_0xb34f('0xb')](),controller[_0xb34f('0xc')]);router['get'](_0xb34f('0xd'),auth[_0xb34f('0xb')](),controller[_0xb34f('0xe')]);router[_0xb34f('0x8')](_0xb34f('0xf'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x10')]);router[_0xb34f('0x8')]('/:id/hoppers',auth[_0xb34f('0xb')](),controller[_0xb34f('0x11')]);router[_0xb34f('0x8')](_0xb34f('0x12'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x13')]);router[_0xb34f('0x8')](_0xb34f('0x14'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x15')]);router['get'](_0xb34f('0x16'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x17')]);router[_0xb34f('0x8')](_0xb34f('0x18'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x19')]);router['post'](_0xb34f('0x1a'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x1b')]);router['post']('/',auth[_0xb34f('0xb')](),controller['create']);router[_0xb34f('0x1c')](_0xb34f('0x1d'),auth[_0xb34f('0xb')](),controller['bulkCreate']);router[_0xb34f('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer[_0xb34f('0x1e')]({'destination':function(_0x8c80be,_0x218914,_0x453fc0){_0x453fc0(null,path[_0xb34f('0x1f')](config[_0xb34f('0x20')],_0xb34f('0x21')));},'filename':function(_0x384909,_0x2bf08a,_0x18bd09){_0x2bf08a['originalname']=_0x2bf08a[_0xb34f('0x22')][_0xb34f('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x18bd09(null,util[_0xb34f('0x24')](_0xb34f('0x25'),path[_0xb34f('0x26')](_0x2bf08a[_0xb34f('0x22')],path['extname'](_0x2bf08a[_0xb34f('0x22')])),Date[_0xb34f('0x27')](),path['extname'](_0x2bf08a[_0xb34f('0x22')])));}})});router[_0xb34f('0x1c')](_0xb34f('0x28'),upload['single'](_0xb34f('0x29')),controller[_0xb34f('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ec0b5,_0x40062e,_0x1c786c){_0x1c786c(null,path[_0xb34f('0x1f')](config[_0xb34f('0x20')],_0xb34f('0x21')));},'filename':function(_0x298a02,_0x47b8ff,_0x7b959c){_0x47b8ff[_0xb34f('0x22')]=_0x47b8ff[_0xb34f('0x22')][_0xb34f('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7b959c(null,util[_0xb34f('0x24')]('%s-%s%s',path[_0xb34f('0x26')](_0x47b8ff[_0xb34f('0x22')],path['extname'](_0x47b8ff[_0xb34f('0x22')])),Date['now'](),path['extname'](_0x47b8ff[_0xb34f('0x22')])));}})});router[_0xb34f('0x1c')](_0xb34f('0x2b'),upload[_0xb34f('0x2c')](_0xb34f('0x29')),controller[_0xb34f('0x2d')]);router['post'](_0xb34f('0x2e'),auth[_0xb34f('0xb')](),controller[_0xb34f('0x2f')]);router['put'](_0xb34f('0xd'),auth[_0xb34f('0xb')](),controller['update']);router[_0xb34f('0x30')]('/:id',auth['isAuthenticated'](),controller[_0xb34f('0x31')]);module[_0xb34f('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index f81df03..bef1744 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 _0x86d3=['parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','lodash','exports','getDataValue','alias','name','STRING','TEXT','long','type'];(function(_0x28157b,_0x1e6283){var _0x2805e0=function(_0xd207d6){while(--_0xd207d6){_0x28157b['push'](_0x28157b['shift']());}};_0x2805e0(++_0x1e6283);}(_0x86d3,0x127));var _0x386d=function(_0x1fb977,_0x1efdea){_0x1fb977=_0x1fb977-0x0;var _0x37fb64=_0x86d3[_0x1fb977];return _0x37fb64;};'use strict';var Sequelize=require('sequelize');var _=require(_0x386d('0x0'));module[_0x386d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x215df6){return this[_0x386d('0x2')](_0x386d('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x256227){this['setDataValue']('alias',_0x256227?_0x256227:this[_0x386d('0x2')](_0x386d('0x4')));}},'type':{'type':Sequelize[_0x386d('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x386d('0x6')](_0x386d('0x7')),'get':function(){if(this[_0x386d('0x2')](_0x386d('0x8'))==='select'){return JSON[_0x386d('0x9')](this[_0x386d('0x2')](_0x386d('0xa')));}else{return this[_0x386d('0x2')]('values');}},'set':function(_0x254d47){if(Array[_0x386d('0xb')](_0x254d47)){this[_0x386d('0xc')](_0x386d('0xa'),JSON[_0x386d('0xd')](_0x254d47));}else{this[_0x386d('0xc')](_0x386d('0xa'),_0x254d47);}}},'required':{'type':Sequelize[_0x386d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x386d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x386d('0xf')]('voice')}}; \ No newline at end of file +var _0x8ba9=['voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','type','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8ba9,0xbc));var _0x98ba=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x8ba9[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x98ba('0x0'));var _=require(_0x98ba('0x1'));module[_0x98ba('0x2')]={'name':{'type':Sequelize[_0x98ba('0x3')],'get':function(_0xc753f5){return this[_0x98ba('0x4')](_0x98ba('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x241979){this[_0x98ba('0x6')](_0x98ba('0x5'),_0x241979?_0x241979:this[_0x98ba('0x4')](_0x98ba('0x7')));}},'type':{'type':Sequelize[_0x98ba('0x8')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x98ba('0x9'))==='select'){return JSON[_0x98ba('0xa')](this[_0x98ba('0x4')]('values'));}else{return this[_0x98ba('0x4')](_0x98ba('0xb'));}},'set':function(_0x353905){if(Array[_0x98ba('0xc')](_0x353905)){this[_0x98ba('0x6')](_0x98ba('0xb'),JSON[_0x98ba('0xd')](_0x353905));}else{this[_0x98ba('0x6')](_0x98ba('0xb'),_0x353905);}}},'required':{'type':Sequelize[_0x98ba('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x98ba('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x98ba('0xf')](_0x98ba('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index cf62418..1e0c669 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 _0x76f0=['filter','VIRTUAL','merge','includeAll','include','findAll','show','params','keys','options','find','catch','update','body','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','cf_%d','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x76f0,0xc8));var _0x076f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x76f0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x076f('0x0'));var rp=require('request-promise');var moment=require(_0x076f('0x1'));var BPromise=require(_0x076f('0x2'));var Mustache=require(_0x076f('0x3'));var util=require(_0x076f('0x4'));var path=require(_0x076f('0x5'));var sox=require(_0x076f('0x6'));var csv=require(_0x076f('0x7'));var ejs=require(_0x076f('0x8'));var fs=require('fs');var fs_extra=require(_0x076f('0x9'));var _=require(_0x076f('0xa'));var squel=require(_0x076f('0xb'));var crypto=require(_0x076f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x076f('0x7'));var querystring=require('querystring');var Papa=require(_0x076f('0xd'));var Redis=require(_0x076f('0xe'));var authService=require(_0x076f('0xf'));var qs=require(_0x076f('0x10'));var as=require(_0x076f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x076f('0x12'));var config=require(_0x076f('0x13'));var licenseUtil=require(_0x076f('0x14'));var db=require(_0x076f('0x15'))['db'];function respondWithStatusCode(_0x28408a,_0x3f4037){_0x3f4037=_0x3f4037||0xcc;return function(_0x37e303){if(_0x37e303){return _0x28408a[_0x076f('0x16')](_0x3f4037);}return _0x28408a[_0x076f('0x17')](_0x3f4037)[_0x076f('0x18')]();};}function respondWithResult(_0x154081,_0x2735eb){_0x2735eb=_0x2735eb||0xc8;return function(_0x1c7f03){if(_0x1c7f03){return _0x154081['status'](_0x2735eb)[_0x076f('0x19')](_0x1c7f03);}};}function respondWithFilteredResult(_0x2f226a,_0x2938d7){return function(_0x3c2da5){if(_0x3c2da5){var _0x2a4251=typeof _0x2938d7['offset']===_0x076f('0x1a')&&typeof _0x2938d7['limit']===_0x076f('0x1a');var _0x3f145b=_0x3c2da5[_0x076f('0x1b')];var _0x199b62=_0x2a4251?0x0:_0x2938d7[_0x076f('0x1c')];var _0x5187df=_0x2a4251?_0x3c2da5[_0x076f('0x1b')]:_0x2938d7[_0x076f('0x1c')]+_0x2938d7[_0x076f('0x1d')];var _0x54aa92;if(_0x5187df>=_0x3f145b){_0x5187df=_0x3f145b;_0x54aa92=0xc8;}else{_0x54aa92=0xce;}_0x2f226a[_0x076f('0x17')](_0x54aa92);return _0x2f226a[_0x076f('0x1e')](_0x076f('0x1f'),_0x199b62+'-'+_0x5187df+'/'+_0x3f145b)['json'](_0x3c2da5);}return null;};}function patchUpdates(_0x4f08ec){return function(_0x6bb3e1){try{jsonpatch[_0x076f('0x20')](_0x6bb3e1,_0x4f08ec,!![]);}catch(_0x4d1f4b){return BPromise['reject'](_0x4d1f4b);}return _0x6bb3e1[_0x076f('0x21')]();};}function saveUpdates(_0x4ace4d,_0x3ea0ac){return function(_0x4c6c4f){if(_0x4c6c4f){return _0x4c6c4f['update'](_0x4ace4d)['then'](function(_0x4deccc){return _0x4deccc;});}return null;};}function removeEntity(_0x2a743e,_0x535ae8){return function(_0x45d80f){if(_0x45d80f){return _0x45d80f[_0x076f('0x22')]()[_0x076f('0x23')](function(){_0x2a743e[_0x076f('0x17')](0xcc)[_0x076f('0x18')]();});}};}function handleEntityNotFound(_0x11631a,_0x34168c){return function(_0x1d707a){if(!_0x1d707a){_0x11631a[_0x076f('0x16')](0x194);}return _0x1d707a;};}function handleError(_0x4ad1ff,_0x14c246){_0x14c246=_0x14c246||0x1f4;return function(_0x326afe){logger[_0x076f('0x24')](_0x326afe[_0x076f('0x25')]);if(_0x326afe[_0x076f('0x26')]){delete _0x326afe['name'];}_0x4ad1ff[_0x076f('0x17')](_0x14c246)[_0x076f('0x27')](_0x326afe);};}exports[_0x076f('0x28')]=function(_0x3bf853,_0x371b0f){var _0x2bc77d={},_0x846a55={},_0x1421cc={'count':0x0,'rows':[]};var _0x454da5=_[_0x076f('0x29')](db[_0x076f('0x2a')][_0x076f('0x2b')],function(_0x1d0a56){return{'name':_0x1d0a56[_0x076f('0x2c')],'type':_0x1d0a56[_0x076f('0x2d')][_0x076f('0x2e')]};});_0x846a55['model']=_[_0x076f('0x2f')](_[_0x076f('0x29')](_0x454da5,_0x076f('0x26')),['name']);_0x846a55[_0x076f('0x30')]=_['keys'](_0x3bf853[_0x076f('0x30')]);_0x846a55[_0x076f('0x31')]=_[_0x076f('0x32')](_0x846a55['model'],_0x846a55['query']);_0x2bc77d[_0x076f('0x33')]=_['intersection'](_0x846a55['model'],qs['fields'](_0x3bf853[_0x076f('0x30')][_0x076f('0x34')]));_0x2bc77d['attributes']=_0x2bc77d['attributes'][_0x076f('0x35')]?_0x2bc77d[_0x076f('0x33')]:_0x846a55[_0x076f('0x36')];if(!_0x3bf853[_0x076f('0x30')][_0x076f('0x37')](_0x076f('0x38'))){_0x2bc77d[_0x076f('0x1d')]=qs[_0x076f('0x1d')](_0x3bf853[_0x076f('0x30')]['limit']);_0x2bc77d['offset']=qs[_0x076f('0x1c')](_0x3bf853[_0x076f('0x30')][_0x076f('0x1c')]);}_0x2bc77d[_0x076f('0x39')]=qs[_0x076f('0x3a')](_0x3bf853[_0x076f('0x30')][_0x076f('0x3a')]);_0x2bc77d[_0x076f('0x3b')]=qs[_0x076f('0x31')](_[_0x076f('0x3c')](_0x3bf853[_0x076f('0x30')],_0x846a55['filters']),_0x454da5);if(_0x3bf853[_0x076f('0x30')][_0x076f('0x3d')]){_0x2bc77d[_0x076f('0x3b')]=_['merge'](_0x2bc77d[_0x076f('0x3b')],{'$or':_['map'](_0x454da5,function(_0x22272a){if(_0x22272a[_0x076f('0x2d')]!==_0x076f('0x3e')){var _0x59d160={};_0x59d160[_0x22272a[_0x076f('0x26')]]={'$like':'%'+_0x3bf853[_0x076f('0x30')]['filter']+'%'};return _0x59d160;}})});}_0x2bc77d=_[_0x076f('0x3f')]({},_0x2bc77d,_0x3bf853['options']);var _0xcad9db={'where':_0x2bc77d['where']};return db[_0x076f('0x2a')][_0x076f('0x1b')](_0xcad9db)['then'](function(_0x3c850d){_0x1421cc['count']=_0x3c850d;if(_0x3bf853[_0x076f('0x30')][_0x076f('0x40')]){_0x2bc77d[_0x076f('0x41')]=[{'all':!![]}];}return db[_0x076f('0x2a')][_0x076f('0x42')](_0x2bc77d);})['then'](function(_0x3cf620){_0x1421cc['rows']=_0x3cf620;return _0x1421cc;})[_0x076f('0x23')](respondWithFilteredResult(_0x371b0f,_0x2bc77d))['catch'](handleError(_0x371b0f,null));};exports[_0x076f('0x43')]=function(_0x5d442a,_0x31a451){var _0x4c42b1={'raw':!![],'where':{'id':_0x5d442a[_0x076f('0x44')]['id']}},_0x4001ba={};_0x4001ba['model']=_[_0x076f('0x45')](db[_0x076f('0x2a')][_0x076f('0x2b')]);_0x4001ba[_0x076f('0x30')]=_[_0x076f('0x45')](_0x5d442a[_0x076f('0x30')]);_0x4001ba[_0x076f('0x31')]=_['intersection'](_0x4001ba['model'],_0x4001ba['query']);_0x4c42b1[_0x076f('0x33')]=_[_0x076f('0x32')](_0x4001ba[_0x076f('0x36')],qs[_0x076f('0x34')](_0x5d442a[_0x076f('0x30')][_0x076f('0x34')]));_0x4c42b1[_0x076f('0x33')]=_0x4c42b1[_0x076f('0x33')][_0x076f('0x35')]?_0x4c42b1[_0x076f('0x33')]:_0x4001ba['model'];if(_0x5d442a['query'][_0x076f('0x40')]){_0x4c42b1['include']=[{'all':!![]}];}_0x4c42b1=_[_0x076f('0x3f')]({},_0x4c42b1,_0x5d442a[_0x076f('0x46')]);return db[_0x076f('0x2a')][_0x076f('0x47')](_0x4c42b1)[_0x076f('0x23')](handleEntityNotFound(_0x31a451,null))[_0x076f('0x23')](respondWithResult(_0x31a451,null))[_0x076f('0x48')](handleError(_0x31a451,null));};exports[_0x076f('0x49')]=function(_0x33026d,_0x3d0548){if(_0x33026d[_0x076f('0x4a')]['id']){delete _0x33026d[_0x076f('0x4a')]['id'];}return db[_0x076f('0x2a')][_0x076f('0x47')]({'where':{'id':_0x33026d[_0x076f('0x44')]['id']}})[_0x076f('0x23')](handleEntityNotFound(_0x3d0548,null))[_0x076f('0x23')](saveUpdates(_0x33026d[_0x076f('0x4a')],null))[_0x076f('0x23')](respondWithResult(_0x3d0548,null))[_0x076f('0x48')](handleError(_0x3d0548,null));};exports[_0x076f('0x22')]=function(_0x5daee3,_0x55da9f){return db[_0x076f('0x2a')][_0x076f('0x47')]({'where':{'id':_0x5daee3['params']['id']}})[_0x076f('0x23')](handleEntityNotFound(_0x55da9f,null))[_0x076f('0x23')](removeEntity(_0x55da9f,null))[_0x076f('0x48')](handleError(_0x55da9f,null));};exports['create']=function(_0x58a875,_0xe5cd8){var _0x11d855;return db[_0x076f('0x4b')][_0x076f('0x4c')](function(_0x468233){return db['CmCustomField'][_0x076f('0x4d')](_0x58a875[_0x076f('0x4a')],{'transaction':_0x468233})['then'](function(_0xefd9e2){_0x11d855=_0xefd9e2;var _0x3a0a3e={'type':db[_0x076f('0x4e')][_0x076f('0x4f')],'transaction':_0x468233};switch(_0x58a875[_0x076f('0x4a')][_0x076f('0x2d')]){case _0x076f('0x50'):_0x3a0a3e['type']=db[_0x076f('0x4e')][_0x076f('0x4f')];break;case _0x076f('0x51'):_0x3a0a3e[_0x076f('0x2d')]=db[_0x076f('0x4e')][_0x076f('0x52')];break;case _0x076f('0x53'):_0x3a0a3e[_0x076f('0x2d')]=db[_0x076f('0x4e')][_0x076f('0x54')];_0x3a0a3e['defaultValue']=![];break;default:}return db[_0x076f('0x4b')][_0x076f('0x55')]['addColumn']('cm_contacts',util['format'](_0x076f('0x56'),_0x11d855['id']),_0x3a0a3e);})[_0x076f('0x23')](function(){return _0x11d855;});})['then'](respondWithResult(_0xe5cd8,0xc9))[_0x076f('0x48')](handleError(_0xe5cd8,null));}; \ No newline at end of file +var _0x2532=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','CmCustomField','include','findAll','catch','show','params','options','find','body','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf'];(function(_0x1ce71c,_0x1f2369){var _0x38c215=function(_0x2777b7){while(--_0x2777b7){_0x1ce71c['push'](_0x1ce71c['shift']());}};_0x38c215(++_0x1f2369);}(_0x2532,0x152));var _0x2253=function(_0x5f3111,_0x2843f6){_0x5f3111=_0x5f3111-0x0;var _0x269dd6=_0x2532[_0x5f3111];return _0x269dd6;};'use strict';var emlformat=require(_0x2253('0x0'));var rimraf=require(_0x2253('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2253('0x2'));var rp=require('request-promise');var moment=require(_0x2253('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2253('0x4'));var util=require(_0x2253('0x5'));var path=require(_0x2253('0x6'));var sox=require(_0x2253('0x7'));var csv=require(_0x2253('0x8'));var ejs=require(_0x2253('0x9'));var fs=require('fs');var fs_extra=require(_0x2253('0xa'));var _=require(_0x2253('0xb'));var squel=require(_0x2253('0xc'));var crypto=require(_0x2253('0xd'));var jsforce=require(_0x2253('0xe'));var deskjs=require(_0x2253('0xf'));var toCsv=require(_0x2253('0x8'));var querystring=require(_0x2253('0x10'));var Papa=require(_0x2253('0x11'));var Redis=require('ioredis');var authService=require(_0x2253('0x12'));var qs=require(_0x2253('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2253('0x14'));var logger=require(_0x2253('0x15'))('api');var utils=require(_0x2253('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2253('0x17'))['db'];function respondWithStatusCode(_0x508392,_0x25d062){_0x25d062=_0x25d062||0xcc;return function(_0xd75bef){if(_0xd75bef){return _0x508392[_0x2253('0x18')](_0x25d062);}return _0x508392[_0x2253('0x19')](_0x25d062)[_0x2253('0x1a')]();};}function respondWithResult(_0x31b977,_0x26da24){_0x26da24=_0x26da24||0xc8;return function(_0x497205){if(_0x497205){return _0x31b977[_0x2253('0x19')](_0x26da24)[_0x2253('0x1b')](_0x497205);}};}function respondWithFilteredResult(_0x3a8527,_0x373873){return function(_0x3fbf45){if(_0x3fbf45){var _0x23103c=typeof _0x373873[_0x2253('0x1c')]===_0x2253('0x1d')&&typeof _0x373873[_0x2253('0x1e')]===_0x2253('0x1d');var _0x58a2c7=_0x3fbf45['count'];var _0x501baa=_0x23103c?0x0:_0x373873[_0x2253('0x1c')];var _0x577994=_0x23103c?_0x3fbf45[_0x2253('0x1f')]:_0x373873[_0x2253('0x1c')]+_0x373873[_0x2253('0x1e')];var _0x22b6b3;if(_0x577994>=_0x58a2c7){_0x577994=_0x58a2c7;_0x22b6b3=0xc8;}else{_0x22b6b3=0xce;}_0x3a8527[_0x2253('0x19')](_0x22b6b3);return _0x3a8527['set'](_0x2253('0x20'),_0x501baa+'-'+_0x577994+'/'+_0x58a2c7)['json'](_0x3fbf45);}return null;};}function patchUpdates(_0x53bb92){return function(_0x424bb5){try{jsonpatch[_0x2253('0x21')](_0x424bb5,_0x53bb92,!![]);}catch(_0x3ee78c){return BPromise[_0x2253('0x22')](_0x3ee78c);}return _0x424bb5['save']();};}function saveUpdates(_0x4c5066,_0x398a5e){return function(_0x26e248){if(_0x26e248){return _0x26e248[_0x2253('0x23')](_0x4c5066)[_0x2253('0x24')](function(_0x484dc1){return _0x484dc1;});}return null;};}function removeEntity(_0x59c2d5,_0x78fbab){return function(_0xd19289){if(_0xd19289){return _0xd19289[_0x2253('0x25')]()[_0x2253('0x24')](function(){_0x59c2d5[_0x2253('0x19')](0xcc)[_0x2253('0x1a')]();});}};}function handleEntityNotFound(_0x5e176c,_0x2122a1){return function(_0x44c9cc){if(!_0x44c9cc){_0x5e176c['sendStatus'](0x194);}return _0x44c9cc;};}function handleError(_0x13414a,_0x2ceb7d){_0x2ceb7d=_0x2ceb7d||0x1f4;return function(_0x214953){logger[_0x2253('0x26')](_0x214953[_0x2253('0x27')]);if(_0x214953[_0x2253('0x28')]){delete _0x214953[_0x2253('0x28')];}_0x13414a[_0x2253('0x19')](_0x2ceb7d)[_0x2253('0x29')](_0x214953);};}exports[_0x2253('0x2a')]=function(_0x2be913,_0x49d2cc){var _0x14f36f={},_0x3d3208={},_0x29a2d3={'count':0x0,'rows':[]};var _0x1128fc=_[_0x2253('0x2b')](db['CmCustomField'][_0x2253('0x2c')],function(_0x5a2929){return{'name':_0x5a2929['fieldName'],'type':_0x5a2929[_0x2253('0x2d')][_0x2253('0x2e')]};});_0x3d3208['model']=_[_0x2253('0x2f')](_[_0x2253('0x2b')](_0x1128fc,'name'),[_0x2253('0x28')]);_0x3d3208[_0x2253('0x30')]=_[_0x2253('0x31')](_0x2be913[_0x2253('0x30')]);_0x3d3208[_0x2253('0x32')]=_[_0x2253('0x33')](_0x3d3208[_0x2253('0x34')],_0x3d3208[_0x2253('0x30')]);_0x14f36f[_0x2253('0x35')]=_[_0x2253('0x33')](_0x3d3208[_0x2253('0x34')],qs[_0x2253('0x36')](_0x2be913[_0x2253('0x30')][_0x2253('0x36')]));_0x14f36f[_0x2253('0x35')]=_0x14f36f[_0x2253('0x35')][_0x2253('0x37')]?_0x14f36f[_0x2253('0x35')]:_0x3d3208[_0x2253('0x34')];if(!_0x2be913[_0x2253('0x30')][_0x2253('0x38')]('nolimit')){_0x14f36f[_0x2253('0x1e')]=qs[_0x2253('0x1e')](_0x2be913[_0x2253('0x30')]['limit']);_0x14f36f[_0x2253('0x1c')]=qs[_0x2253('0x1c')](_0x2be913[_0x2253('0x30')]['offset']);}_0x14f36f[_0x2253('0x39')]=qs[_0x2253('0x3a')](_0x2be913['query'][_0x2253('0x3a')]);_0x14f36f[_0x2253('0x3b')]=qs[_0x2253('0x32')](_['pick'](_0x2be913[_0x2253('0x30')],_0x3d3208[_0x2253('0x32')]),_0x1128fc);if(_0x2be913[_0x2253('0x30')][_0x2253('0x3c')]){_0x14f36f[_0x2253('0x3b')]=_['merge'](_0x14f36f['where'],{'$or':_['map'](_0x1128fc,function(_0x268346){if(_0x268346[_0x2253('0x2d')]!=='VIRTUAL'){var _0x2b55c4={};_0x2b55c4[_0x268346[_0x2253('0x28')]]={'$like':'%'+_0x2be913[_0x2253('0x30')][_0x2253('0x3c')]+'%'};return _0x2b55c4;}})});}_0x14f36f=_[_0x2253('0x3d')]({},_0x14f36f,_0x2be913['options']);var _0x34e959={'where':_0x14f36f[_0x2253('0x3b')]};return db[_0x2253('0x3e')][_0x2253('0x1f')](_0x34e959)[_0x2253('0x24')](function(_0xd0b273){_0x29a2d3[_0x2253('0x1f')]=_0xd0b273;if(_0x2be913[_0x2253('0x30')]['includeAll']){_0x14f36f[_0x2253('0x3f')]=[{'all':!![]}];}return db[_0x2253('0x3e')][_0x2253('0x40')](_0x14f36f);})[_0x2253('0x24')](function(_0x2e012d){_0x29a2d3['rows']=_0x2e012d;return _0x29a2d3;})[_0x2253('0x24')](respondWithFilteredResult(_0x49d2cc,_0x14f36f))[_0x2253('0x41')](handleError(_0x49d2cc,null));};exports[_0x2253('0x42')]=function(_0x35c92e,_0x3ab939){var _0x362cad={'raw':!![],'where':{'id':_0x35c92e[_0x2253('0x43')]['id']}},_0x55c877={};_0x55c877[_0x2253('0x34')]=_[_0x2253('0x31')](db[_0x2253('0x3e')][_0x2253('0x2c')]);_0x55c877[_0x2253('0x30')]=_['keys'](_0x35c92e['query']);_0x55c877['filters']=_[_0x2253('0x33')](_0x55c877['model'],_0x55c877[_0x2253('0x30')]);_0x362cad[_0x2253('0x35')]=_['intersection'](_0x55c877['model'],qs[_0x2253('0x36')](_0x35c92e[_0x2253('0x30')][_0x2253('0x36')]));_0x362cad[_0x2253('0x35')]=_0x362cad[_0x2253('0x35')][_0x2253('0x37')]?_0x362cad['attributes']:_0x55c877[_0x2253('0x34')];if(_0x35c92e['query']['includeAll']){_0x362cad['include']=[{'all':!![]}];}_0x362cad=_[_0x2253('0x3d')]({},_0x362cad,_0x35c92e[_0x2253('0x44')]);return db[_0x2253('0x3e')][_0x2253('0x45')](_0x362cad)[_0x2253('0x24')](handleEntityNotFound(_0x3ab939,null))['then'](respondWithResult(_0x3ab939,null))['catch'](handleError(_0x3ab939,null));};exports[_0x2253('0x23')]=function(_0x503772,_0x2520c8){if(_0x503772[_0x2253('0x46')]['id']){delete _0x503772[_0x2253('0x46')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x503772['params']['id']}})['then'](handleEntityNotFound(_0x2520c8,null))[_0x2253('0x24')](saveUpdates(_0x503772[_0x2253('0x46')],null))[_0x2253('0x24')](respondWithResult(_0x2520c8,null))[_0x2253('0x41')](handleError(_0x2520c8,null));};exports[_0x2253('0x25')]=function(_0x4e5383,_0x1100c6){return db[_0x2253('0x3e')][_0x2253('0x45')]({'where':{'id':_0x4e5383['params']['id']}})[_0x2253('0x24')](handleEntityNotFound(_0x1100c6,null))[_0x2253('0x24')](removeEntity(_0x1100c6,null))[_0x2253('0x41')](handleError(_0x1100c6,null));};exports[_0x2253('0x47')]=function(_0x52882b,_0x28c9e8){var _0x199641;return db[_0x2253('0x48')][_0x2253('0x49')](function(_0x333f09){return db[_0x2253('0x3e')][_0x2253('0x47')](_0x52882b[_0x2253('0x46')],{'transaction':_0x333f09})['then'](function(_0x4b2b07){_0x199641=_0x4b2b07;var _0x658e4e={'type':db[_0x2253('0x4a')]['TEXT'],'transaction':_0x333f09};switch(_0x52882b['body'][_0x2253('0x2d')]){case _0x2253('0x4b'):_0x658e4e[_0x2253('0x2d')]=db['Sequelize'][_0x2253('0x4c')];break;case _0x2253('0x4d'):_0x658e4e[_0x2253('0x2d')]=db[_0x2253('0x4a')][_0x2253('0x4e')];break;case _0x2253('0x4f'):_0x658e4e[_0x2253('0x2d')]=db[_0x2253('0x4a')]['BOOLEAN'];_0x658e4e[_0x2253('0x50')]=![];break;default:}return db[_0x2253('0x48')][_0x2253('0x51')]['addColumn'](_0x2253('0x52'),util[_0x2253('0x53')](_0x2253('0x54'),_0x199641['id']),_0x658e4e);})[_0x2253('0x24')](function(){return _0x199641;});})[_0x2253('0x24')](respondWithResult(_0x28c9e8,0xc9))[_0x2253('0x41')](handleError(_0x28c9e8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f89f973..fb91552 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 _0x7a24=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_custom_fields','lodash','util'];(function(_0x1ef613,_0x30b47c){var _0x509890=function(_0x40f9d0){while(--_0x40f9d0){_0x1ef613['push'](_0x1ef613['shift']());}};_0x509890(++_0x30b47c);}(_0x7a24,0x196));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x47a2('0x0'));var util=require(_0x47a2('0x1'));var logger=require(_0x47a2('0x2'))(_0x47a2('0x3'));var moment=require('moment');var BPromise=require(_0x47a2('0x4'));var rp=require(_0x47a2('0x5'));var fs=require('fs');var path=require(_0x47a2('0x6'));var rimraf=require(_0x47a2('0x7'));var config=require(_0x47a2('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x47a2('0x9')]=function(_0x2fc2fb,_0x394b19){return _0x2fc2fb[_0x47a2('0xa')]('CmCustomField',attributes,{'tableName':_0x47a2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a26=['lodash','util','api','request-promise','rimraf','../../config/environment','exports','define','cm_custom_fields'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x6a26,0x171));var _0x66a2=function(_0x517aad,_0x51f205){_0x517aad=_0x517aad-0x0;var _0x329c40=_0x6a26[_0x517aad];return _0x329c40;};'use strict';var _=require(_0x66a2('0x0'));var util=require(_0x66a2('0x1'));var logger=require('../../config/logger')(_0x66a2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66a2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66a2('0x4'));var config=require(_0x66a2('0x5'));var attributes=require('./cmCustomField.attributes');module[_0x66a2('0x6')]=function(_0x5cb6e9,_0x554f81){return _0x5cb6e9[_0x66a2('0x7')]('CmCustomField',attributes,{'tableName':_0x66a2('0x8'),'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 928ef83..95c185f 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 _0xff29=['request\x20sent','debug','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s'];(function(_0x1cc9e7,_0x2cdcd4){var _0x25c4de=function(_0x2227b6){while(--_0x2227b6){_0x1cc9e7['push'](_0x1cc9e7['shift']());}};_0x25c4de(++_0x2cdcd4);}(_0xff29,0x1c0));var _0x9ff2=function(_0x4f73dc,_0xaad6f8){_0x4f73dc=_0x4f73dc-0x0;var _0x1dcc25=_0xff29[_0x4f73dc];return _0x1dcc25;};'use strict';var _=require(_0x9ff2('0x0'));var util=require(_0x9ff2('0x1'));var moment=require('moment');var BPromise=require(_0x9ff2('0x2'));var rs=require(_0x9ff2('0x3'));var fs=require('fs');var Redis=require(_0x9ff2('0x4'));var db=require(_0x9ff2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ff2('0x6'))(_0x9ff2('0x7'));var config=require(_0x9ff2('0x8'));var jayson=require(_0x9ff2('0x9'));var client=jayson[_0x9ff2('0xa')][_0x9ff2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x363345,_0x1312a2,_0x24dbdd){return new BPromise(function(_0x436d9d,_0x57d5ee){return client[_0x9ff2('0xc')](_0x363345,_0x24dbdd)['then'](function(_0x293552){logger['info'](_0x9ff2('0xd'),_0x1312a2,_0x9ff2('0xe'));logger[_0x9ff2('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1312a2,_0x9ff2('0xe'),JSON[_0x9ff2('0x10')](_0x293552));if(_0x293552[_0x9ff2('0x11')]){if(_0x293552[_0x9ff2('0x11')]['code']===0x1f4){logger['error'](_0x9ff2('0xd'),_0x1312a2,_0x293552[_0x9ff2('0x11')][_0x9ff2('0x12')]);return _0x57d5ee(_0x293552[_0x9ff2('0x11')][_0x9ff2('0x12')]);}logger[_0x9ff2('0x11')]('CmCustomField,\x20%s,\x20%s',_0x1312a2,_0x293552[_0x9ff2('0x11')][_0x9ff2('0x12')]);return _0x436d9d(_0x293552[_0x9ff2('0x11')][_0x9ff2('0x12')]);}else{logger[_0x9ff2('0x13')](_0x9ff2('0xd'),_0x1312a2,_0x9ff2('0xe'));_0x436d9d(_0x293552['result'][_0x9ff2('0x12')]);}})[_0x9ff2('0x14')](function(_0x41142e){logger['error']('CmCustomField,\x20%s,\x20%s',_0x1312a2,_0x41142e);_0x57d5ee(_0x41142e);});});} \ No newline at end of file +var _0x3508=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x4e5df2,_0x45cb60){var _0x262af2=function(_0x34db31){while(--_0x34db31){_0x4e5df2['push'](_0x4e5df2['shift']());}};_0x262af2(++_0x45cb60);}(_0x3508,0xfa));var _0x8350=function(_0x4543fd,_0x42e075){_0x4543fd=_0x4543fd-0x0;var _0x487331=_0x3508[_0x4543fd];return _0x487331;};'use strict';var _=require(_0x8350('0x0'));var util=require(_0x8350('0x1'));var moment=require(_0x8350('0x2'));var BPromise=require(_0x8350('0x3'));var rs=require(_0x8350('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8350('0x5'))['db'];var utils=require(_0x8350('0x6'));var logger=require(_0x8350('0x7'))(_0x8350('0x8'));var config=require(_0x8350('0x9'));var jayson=require(_0x8350('0xa'));var client=jayson[_0x8350('0xb')][_0x8350('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55fc99,_0xef161d,_0x52a813){return new BPromise(function(_0x5dd4d8,_0x4ac7e3){return client[_0x8350('0xd')](_0x55fc99,_0x52a813)['then'](function(_0x50aa21){logger['info'](_0x8350('0xe'),_0xef161d,_0x8350('0xf'));logger['debug'](_0x8350('0x10'),_0xef161d,_0x8350('0xf'),JSON['stringify'](_0x50aa21));if(_0x50aa21[_0x8350('0x11')]){if(_0x50aa21[_0x8350('0x11')][_0x8350('0x12')]===0x1f4){logger[_0x8350('0x11')](_0x8350('0xe'),_0xef161d,_0x50aa21[_0x8350('0x11')][_0x8350('0x13')]);return _0x4ac7e3(_0x50aa21[_0x8350('0x11')][_0x8350('0x13')]);}logger[_0x8350('0x11')]('CmCustomField,\x20%s,\x20%s',_0xef161d,_0x50aa21['error'][_0x8350('0x13')]);return _0x5dd4d8(_0x50aa21[_0x8350('0x11')][_0x8350('0x13')]);}else{logger[_0x8350('0x14')](_0x8350('0xe'),_0xef161d,_0x8350('0xf'));_0x5dd4d8(_0x50aa21[_0x8350('0x15')][_0x8350('0x13')]);}})[_0x8350('0x16')](function(_0x4a1c50){logger[_0x8350('0x11')](_0x8350('0xe'),_0xef161d,_0x4a1c50);_0x4ac7e3(_0x4a1c50);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index a432a99..e24e1db 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 _0xd1bd=['get','index','/:id','post','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2ed740,_0x5d5927){var _0x40a100=function(_0x2b4f02){while(--_0x2b4f02){_0x2ed740['push'](_0x2ed740['shift']());}};_0x40a100(++_0x5d5927);}(_0xd1bd,0x8a));var _0xdd1b=function(_0x4c93d4,_0x5a17bd){_0x4c93d4=_0x4c93d4-0x0;var _0x29caca=_0xd1bd[_0x4c93d4];return _0x29caca;};'use strict';var multer=require(_0xdd1b('0x0'));var util=require('util');var path=require(_0xdd1b('0x1'));var timeout=require(_0xdd1b('0x2'));var express=require('express');var router=express[_0xdd1b('0x3')]();var fs_extra=require(_0xdd1b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdd1b('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xdd1b('0x6')]('/',auth['isAuthenticated'](),controller[_0xdd1b('0x7')]);router[_0xdd1b('0x6')](_0xdd1b('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xdd1b('0x9')]('/',auth[_0xdd1b('0xa')](),controller['create']);router[_0xdd1b('0xb')]('/:id',auth[_0xdd1b('0xa')](),controller[_0xdd1b('0xc')]);router[_0xdd1b('0xd')]('/:id',auth[_0xdd1b('0xa')](),controller[_0xdd1b('0xe')]);module[_0xdd1b('0xf')]=router; \ No newline at end of file +var _0x4aa3=['/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show'];(function(_0x27db39,_0x5251f6){var _0x21ef8d=function(_0x3c7199){while(--_0x3c7199){_0x27db39['push'](_0x27db39['shift']());}};_0x21ef8d(++_0x5251f6);}(_0x4aa3,0x174));var _0x34aa=function(_0xdb1d1d,_0x397aca){_0xdb1d1d=_0xdb1d1d-0x0;var _0x5ce1af=_0x4aa3[_0xdb1d1d];return _0x5ce1af;};'use strict';var multer=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var path=require('path');var timeout=require(_0x34aa('0x2'));var express=require(_0x34aa('0x3'));var router=express['Router']();var fs_extra=require(_0x34aa('0x4'));var auth=require(_0x34aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34aa('0x6'));var controller=require(_0x34aa('0x7'));router[_0x34aa('0x8')]('/',auth['isAuthenticated'](),controller[_0x34aa('0x9')]);router[_0x34aa('0x8')]('/:id',auth[_0x34aa('0xa')](),controller[_0x34aa('0xb')]);router['post']('/',auth[_0x34aa('0xa')](),controller['create']);router['put'](_0x34aa('0xc'),auth[_0x34aa('0xa')](),controller[_0x34aa('0xd')]);router[_0x34aa('0xe')](_0x34aa('0xc'),auth[_0x34aa('0xa')](),controller['destroy']);module[_0x34aa('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index d7ab5d4..6d3ba30 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 _0xf250=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf250,0xb5));var _0x0f25=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0xf250[_0x4ded50];return _0xa92135;};'use strict';var moment=require(_0x0f25('0x0'));var Sequelize=require(_0x0f25('0x1'));module[_0x0f25('0x2')]={'phone':{'type':Sequelize[_0x0f25('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x0f25('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0f25('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0f25('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0f25('0x7')]},'priority':{'type':Sequelize[_0x0f25('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0f25('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x0f25('0x8')},'UserId':{'type':Sequelize[_0x0f25('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x0f25('0x6')],'unique':_0x0f25('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0f25('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x91b3=['INTEGER','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format'];(function(_0x162901,_0x5476b3){var _0x110459=function(_0x3e06c5){while(--_0x3e06c5){_0x162901['push'](_0x162901['shift']());}};_0x110459(++_0x5476b3);}(_0x91b3,0x19a));var _0x391b=function(_0x2afb70,_0x2bd3ae){_0x2afb70=_0x2afb70-0x0;var _0x3abddb=_0x91b3[_0x2afb70];return _0x3abddb;};'use strict';var moment=require(_0x391b('0x0'));var Sequelize=require(_0x391b('0x1'));module['exports']={'phone':{'type':Sequelize[_0x391b('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x391b('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x391b('0x4')],'defaultValue':moment()[_0x391b('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x391b('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x391b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x391b('0x4')]},'priority':{'type':Sequelize[_0x391b('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x391b('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x391b('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x391b('0x6')],'unique':_0x391b('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x391b('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x391b('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x391b('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1acac92..376451e 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 _0x1df5=['send','index','map','CmHopper','rawAttributes','type','key','model','name','query','keys','filters','$and','$gt','$lte','$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','UPDATE','CmCompany','CmList','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1df5,0xfd));var _0x51df=function(_0x532300,_0x1bd669){_0x532300=_0x532300-0x0;var _0x5c8f52=_0x1df5[_0x532300];return _0x5c8f52;};'use strict';var emlformat=require(_0x51df('0x0'));var rimraf=require(_0x51df('0x1'));var zipdir=require(_0x51df('0x2'));var jsonpatch=require(_0x51df('0x3'));var rp=require(_0x51df('0x4'));var moment=require('moment');var BPromise=require(_0x51df('0x5'));var Mustache=require(_0x51df('0x6'));var util=require(_0x51df('0x7'));var path=require(_0x51df('0x8'));var sox=require(_0x51df('0x9'));var csv=require(_0x51df('0xa'));var ejs=require(_0x51df('0xb'));var fs=require('fs');var fs_extra=require(_0x51df('0xc'));var _=require('lodash');var squel=require(_0x51df('0xd'));var crypto=require('crypto');var jsforce=require(_0x51df('0xe'));var deskjs=require(_0x51df('0xf'));var toCsv=require(_0x51df('0xa'));var querystring=require(_0x51df('0x10'));var Papa=require(_0x51df('0x11'));var Redis=require(_0x51df('0x12'));var authService=require(_0x51df('0x13'));var qs=require(_0x51df('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51df('0x15'));var logger=require(_0x51df('0x16'))(_0x51df('0x17'));var utils=require(_0x51df('0x18'));var config=require(_0x51df('0x19'));var licenseUtil=require(_0x51df('0x1a'));var db=require(_0x51df('0x1b'))['db'];function respondWithStatusCode(_0x27eb0a,_0x4177cb){_0x4177cb=_0x4177cb||0xcc;return function(_0x312850){if(_0x312850){return _0x27eb0a[_0x51df('0x1c')](_0x4177cb);}return _0x27eb0a[_0x51df('0x1d')](_0x4177cb)[_0x51df('0x1e')]();};}function respondWithResult(_0x41da67,_0x4a1f){_0x4a1f=_0x4a1f||0xc8;return function(_0x4ae823){if(_0x4ae823){return _0x41da67[_0x51df('0x1d')](_0x4a1f)[_0x51df('0x1f')](_0x4ae823);}};}function respondWithFilteredResult(_0x53e65a,_0x1edb49){return function(_0x354cb2){if(_0x354cb2){var _0x37ca13=typeof _0x1edb49['offset']===_0x51df('0x20')&&typeof _0x1edb49[_0x51df('0x21')]===_0x51df('0x20');var _0x2a1158=_0x354cb2['count'];var _0x1bdba3=_0x37ca13?0x0:_0x1edb49[_0x51df('0x22')];var _0x5cd515=_0x37ca13?_0x354cb2['count']:_0x1edb49[_0x51df('0x22')]+_0x1edb49['limit'];var _0x392505;if(_0x5cd515>=_0x2a1158){_0x5cd515=_0x2a1158;_0x392505=0xc8;}else{_0x392505=0xce;}_0x53e65a[_0x51df('0x1d')](_0x392505);return _0x53e65a[_0x51df('0x23')](_0x51df('0x24'),_0x1bdba3+'-'+_0x5cd515+'/'+_0x2a1158)['json'](_0x354cb2);}return null;};}function patchUpdates(_0xfba51f){return function(_0xdf7fa4){try{jsonpatch['apply'](_0xdf7fa4,_0xfba51f,!![]);}catch(_0x354cd2){return BPromise['reject'](_0x354cd2);}return _0xdf7fa4[_0x51df('0x25')]();};}function saveUpdates(_0x4bc3bd,_0x5c4877){return function(_0x102498){if(_0x102498){return _0x102498[_0x51df('0x26')](_0x4bc3bd)[_0x51df('0x27')](function(_0x2a8321){return _0x2a8321;});}return null;};}function removeEntity(_0x42ceac,_0x105475){return function(_0x1e1c9d){if(_0x1e1c9d){return _0x1e1c9d[_0x51df('0x28')]()[_0x51df('0x27')](function(){_0x42ceac[_0x51df('0x1d')](0xcc)[_0x51df('0x1e')]();});}};}function handleEntityNotFound(_0x17e807,_0x1dae49){return function(_0x33e275){if(!_0x33e275){_0x17e807[_0x51df('0x1c')](0x194);}return _0x33e275;};}function handleError(_0x1df442,_0x1ee6e2){_0x1ee6e2=_0x1ee6e2||0x1f4;return function(_0x417942){logger[_0x51df('0x29')](_0x417942[_0x51df('0x2a')]);if(_0x417942['name']){delete _0x417942['name'];}_0x1df442[_0x51df('0x1d')](_0x1ee6e2)[_0x51df('0x2b')](_0x417942);};}exports[_0x51df('0x2c')]=function(_0x12b16a,_0x221fd4){var _0x5c4e62={},_0x4bf243={},_0x42f85c={'count':0x0,'rows':[]};var _0x35e7da=_[_0x51df('0x2d')](db[_0x51df('0x2e')][_0x51df('0x2f')],function(_0x1637ab){return{'name':_0x1637ab['fieldName'],'type':_0x1637ab[_0x51df('0x30')][_0x51df('0x31')]};});_0x4bf243[_0x51df('0x32')]=_[_0x51df('0x2d')](_0x35e7da,_0x51df('0x33'));_0x4bf243[_0x51df('0x34')]=_[_0x51df('0x35')](_0x12b16a[_0x51df('0x34')]);_0x4bf243[_0x51df('0x36')]=_['intersection'](_0x4bf243[_0x51df('0x32')],_0x4bf243[_0x51df('0x34')]);_0x4bf243[_0x51df('0x36')]=_['concat'](_0x4bf243[_0x51df('0x36')],[_0x51df('0x37'),'$or',_0x51df('0x38'),'$gte','$lt',_0x51df('0x39'),_0x51df('0x3a'),'$eq',_0x51df('0x3b'),_0x51df('0x3c'),_0x51df('0x3d'),'$in',_0x51df('0x3e'),_0x51df('0x3f'),_0x51df('0x40'),_0x51df('0x41'),_0x51df('0x42'),_0x51df('0x3f'),_0x51df('0x43'),_0x51df('0x44'),_0x51df('0x45'),'$any']);_0x5c4e62[_0x51df('0x46')]=_[_0x51df('0x47')](_0x4bf243['model'],qs[_0x51df('0x48')](_0x12b16a['query']['fields']));_0x5c4e62[_0x51df('0x46')]=_0x5c4e62[_0x51df('0x46')][_0x51df('0x49')]?_0x5c4e62[_0x51df('0x46')]:_0x4bf243[_0x51df('0x32')];if(!_0x12b16a[_0x51df('0x34')][_0x51df('0x4a')](_0x51df('0x4b'))){_0x5c4e62[_0x51df('0x21')]=qs[_0x51df('0x21')](_0x12b16a[_0x51df('0x34')][_0x51df('0x21')]);_0x5c4e62[_0x51df('0x22')]=qs[_0x51df('0x22')](_0x12b16a[_0x51df('0x34')][_0x51df('0x22')]);}_0x5c4e62[_0x51df('0x4c')]=qs[_0x51df('0x4d')](_0x12b16a[_0x51df('0x34')]['sort']);_0x5c4e62[_0x51df('0x4e')]=qs[_0x51df('0x36')](_[_0x51df('0x4f')](_0x12b16a[_0x51df('0x34')],_0x4bf243['filters']),_0x35e7da);if(_0x12b16a[_0x51df('0x34')]['filter']){_0x5c4e62['where']=_['merge'](_0x5c4e62[_0x51df('0x4e')],{'$or':_[_0x51df('0x2d')](_0x35e7da,function(_0x15b215){if(_0x15b215[_0x51df('0x30')]!==_0x51df('0x50')){var _0x1fe5e7={};_0x1fe5e7[_0x15b215[_0x51df('0x33')]]={'$like':'%'+_0x12b16a[_0x51df('0x34')][_0x51df('0x51')]+'%'};return _0x1fe5e7;}})});}_0x5c4e62=_[_0x51df('0x52')]({},_0x5c4e62,_0x12b16a[_0x51df('0x53')]);var _0x41401d={'where':_0x5c4e62[_0x51df('0x4e')]};return db[_0x51df('0x2e')][_0x51df('0x54')](_0x41401d)[_0x51df('0x27')](function(_0x341d60){_0x42f85c[_0x51df('0x54')]=_0x341d60;if(_0x12b16a[_0x51df('0x34')][_0x51df('0x55')]){_0x5c4e62[_0x51df('0x56')]=[{'all':!![]}];}return db[_0x51df('0x2e')][_0x51df('0x57')](_0x5c4e62);})['then'](function(_0x45886a){_0x42f85c[_0x51df('0x58')]=_0x45886a;return _0x42f85c;})[_0x51df('0x27')](respondWithFilteredResult(_0x221fd4,_0x5c4e62))[_0x51df('0x59')](handleError(_0x221fd4,null));};exports['show']=function(_0x299270,_0x14a787){var _0x448f6d={'raw':!![],'where':{'id':_0x299270[_0x51df('0x5a')]['id']}},_0x2ace7d={};_0x2ace7d[_0x51df('0x32')]=_[_0x51df('0x35')](db['CmHopper'][_0x51df('0x2f')]);_0x2ace7d[_0x51df('0x34')]=_[_0x51df('0x35')](_0x299270[_0x51df('0x34')]);_0x2ace7d['filters']=_['intersection'](_0x2ace7d[_0x51df('0x32')],_0x2ace7d[_0x51df('0x34')]);_0x448f6d[_0x51df('0x46')]=_[_0x51df('0x47')](_0x2ace7d[_0x51df('0x32')],qs[_0x51df('0x48')](_0x299270[_0x51df('0x34')][_0x51df('0x48')]));_0x448f6d['attributes']=_0x448f6d[_0x51df('0x46')]['length']?_0x448f6d[_0x51df('0x46')]:_0x2ace7d[_0x51df('0x32')];if(_0x299270[_0x51df('0x34')]['includeAll']){_0x448f6d['include']=[{'all':!![]}];}_0x448f6d=_[_0x51df('0x52')]({},_0x448f6d,_0x299270[_0x51df('0x53')]);return db[_0x51df('0x2e')][_0x51df('0x5b')](_0x448f6d)['then'](handleEntityNotFound(_0x14a787,null))['then'](respondWithResult(_0x14a787,null))[_0x51df('0x59')](handleError(_0x14a787,null));};exports[_0x51df('0x5c')]=function(_0x19bebe,_0x492eb0){return db['CmHopper'][_0x51df('0x5c')](_0x19bebe[_0x51df('0x5d')],{})['then'](respondWithResult(_0x492eb0,0xc9))[_0x51df('0x59')](handleError(_0x492eb0,null));};exports['update']=function(_0x4501cf,_0x533d2c){if(_0x4501cf['body']['id']){delete _0x4501cf[_0x51df('0x5d')]['id'];}return db[_0x51df('0x2e')][_0x51df('0x5b')]({'where':{'id':_0x4501cf[_0x51df('0x5a')]['id']}})[_0x51df('0x27')](handleEntityNotFound(_0x533d2c,null))[_0x51df('0x27')](saveUpdates(_0x4501cf[_0x51df('0x5d')],null))[_0x51df('0x27')](respondWithResult(_0x533d2c,null))[_0x51df('0x59')](handleError(_0x533d2c,null));};exports[_0x51df('0x5e')]=function(_0x9959cc,_0x24a27c){return db['CmHopper'][_0x51df('0x5e')]()[_0x51df('0x27')](respondWithResult(_0x24a27c,null))[_0x51df('0x59')](handleError(_0x24a27c,null));};exports['destroy']=function(_0x5f2373,_0x170c14){var _0x52369f;return db[_0x51df('0x2e')][_0x51df('0x5b')]({'where':{'id':_0x5f2373[_0x51df('0x5a')]['id']}})[_0x51df('0x27')](handleEntityNotFound(_0x170c14,null))[_0x51df('0x27')](function(_0x3bace2){if(_0x3bace2){return _0x3bace2[_0x51df('0x28')]()[_0x51df('0x27')](function(_0x5ef9fc){return _0x5ef9fc;});}})[_0x51df('0x27')](function(_0x45c03d){_0x52369f=_0x45c03d;if(_0x45c03d){if(_0x45c03d[_0x51df('0x5f')]||_0x45c03d[_0x51df('0x60')]){return db[_0x45c03d[_0x51df('0x5f')]?_0x51df('0x61'):_0x51df('0x62')][_0x51df('0x5b')]({'where':{'id':_0x45c03d[_0x51df('0x5f')]?_0x45c03d['VoiceQueueId']:_0x45c03d['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x51df('0x27')](function(_0x396de6){var _0x19d5dc={};if(_0x396de6){_[_0x51df('0x52')](_0x19d5dc,_[_0x51df('0x63')](_0x52369f[_0x51df('0x64')],[_0x51df('0x65'),_0x51df('0x66'),'id']));_0x19d5dc[_0x51df('0x67')]=0x15;_0x19d5dc[_0x51df('0x68')]='deleted';_0x19d5dc[_0x51df('0x69')]=_0x396de6[_0x51df('0x33')];_0x19d5dc[_0x51df('0x6a')]=_0x5f2373['user'][_0x51df('0x33')];_0x19d5dc['UserId']=_0x5f2373[_0x51df('0x6b')]['id'];_0x19d5dc['deleted']=!![];_0x19d5dc[_0x51df('0x6c')]=moment()[_0x51df('0x6d')](_0x51df('0x6e'));_0x19d5dc['calleridnum']=_0x52369f[_0x51df('0x6f')];_0x19d5dc['campaigntype']=_0x52369f[_0x51df('0x5f')]?_0x51df('0x70'):_0x51df('0x71');return db[_0x51df('0x72')][_0x51df('0x5b')]({'where':{'id':_0x19d5dc[_0x51df('0x73')]},'attributes':[_0x51df('0x74'),'lastName']})[_0x51df('0x27')](function(_0x3d7e1d){if(!_[_0x51df('0x75')](_0x170c14)&&!_[_0x51df('0x75')](_0x3d7e1d['firstName'])){_0x19d5dc[_0x51df('0x76')]=_0x3d7e1d['firstName'];if(!_['isNil'](_0x3d7e1d[_0x51df('0x77')])){_0x19d5dc[_0x51df('0x76')]+='\x20'+_0x3d7e1d[_0x51df('0x77')];}}})[_0x51df('0x78')](function(){return db[_0x51df('0x79')][_0x51df('0x5c')](_0x19d5dc);});}})['then'](function(){return _0x170c14[_0x51df('0x1d')](0xcc)[_0x51df('0x1e')]();})['catch'](handleError(_0x170c14,null));};exports[_0x51df('0x7a')]=function(_0x31989c,_0x2c1310,_0x49b970){var _0x320793=[];return db[_0x51df('0x72')][_0x51df('0x5e')]()[_0x51df('0x27')](function(_0xbb8b29){_0x320793=_[_0x51df('0x35')](_0xbb8b29);return _0x31989c['user'][_0x51df('0x7b')]({'where':{'type':_0x51df('0x7c'),'dialActive':!![],'dialMethod':_0x51df('0x7d')},'attributes':['id',_0x51df('0x7e'),_0x51df('0x7f')],'raw':!![]});})[_0x51df('0x27')](function(_0x1989d2){if(_0x1989d2&&_0x1989d2[_0x51df('0x49')]){return db[_0x51df('0x80')][_0x51df('0x81')](function(_0x34d916){var _0x492fe0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x51df('0x6d')](_0x51df('0x6e'))},'VoiceQueueId':{'$in':_[_0x51df('0x2d')](_0x1989d2,'id')},'$or':[{'UserId':null},{'UserId':_0x31989c[_0x51df('0x6b')]['id']}]};var _0x564652={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1989d2)['filter']([_0x51df('0x7f'),0x0])[_0x51df('0x2d')]('id')[_0x51df('0x82')]()},'$or':[{'UserId':null},{'UserId':_0x31989c[_0x51df('0x6b')]['id']}]};var _0x27c30f={'$or':[_0x492fe0,_0x564652]};var _0x21a9dd=[];if(_0x31989c['body'][_0x51df('0x83')]&&_0x31989c[_0x51df('0x5d')][_0x51df('0x83')]===_0x51df('0x84')){if(!_['isEmpty'](_0x31989c[_0x51df('0x5d')][_0x51df('0x85')])){_0x27c30f['id']={'$in':_0x31989c[_0x51df('0x5d')][_0x51df('0x85')]};}_0x21a9dd=[[_0x51df('0x86'),_0x51df('0x87')],['scheduledAt',_0x1989d2[0x0][_0x51df('0x7e')]===_0x51df('0x87')?_0x51df('0x88'):_0x51df('0x87')],db[_0x51df('0x80')][_0x51df('0x89')](_0x51df('0x8a')),['id','DESC']];}else{if(!_[_0x51df('0x8b')](_0x31989c[_0x51df('0x5d')]['hopperIds'])){_0x27c30f['id']={'$notIn':_0x31989c['body'][_0x51df('0x85')]};}_0x21a9dd=[['priority',_0x51df('0x88')],[_0x51df('0x8c'),_0x1989d2[0x0][_0x51df('0x7e')]],db['sequelize'][_0x51df('0x89')](_0x51df('0x8d')),['id',_0x51df('0x87')]];}return db[_0x51df('0x2e')]['findOne']({'attributes':['id','scheduledat',_0x51df('0x8e')],'where':_0x27c30f,'order':_0x21a9dd,'transaction':_0x34d916,'lock':_0x34d916['LOCK'][_0x51df('0x8f')],'include':[{'model':db[_0x51df('0x72')],'as':'Contact','attributes':_0x320793,'include':[{'model':db[_0x51df('0x90')],'as':'Company','attributes':['id',_0x51df('0x33')]}]},{'model':db[_0x51df('0x91')],'as':'List','attributes':['id',_0x51df('0x33')]},{'model':db[_0x51df('0x61')],'as':'Queue','attributes':['id',_0x51df('0x33'),'dialActive']}]})[_0x51df('0x27')](function(_0x3243b9){if(_0x3243b9){return _0x3243b9[_0x51df('0x26')]({'UserId':_0x31989c[_0x51df('0x6b')]['id']},{'transaction':_0x34d916});}});});}})[_0x51df('0x27')](handleEntityNotFound(_0x2c1310,null))['then'](respondWithResult(_0x2c1310,null))[_0x51df('0x59')](handleError(_0x2c1310,null));};exports[_0x51df('0x92')]=function(_0x2ad014,_0x5630a2,_0xa8cbfe){return _0x2ad014[_0x51df('0x6b')][_0x51df('0x7b')]({'where':{'type':_0x51df('0x7c'),'dialActive':!![],'dialMethod':_0x51df('0x7d')},'attributes':['id'],'raw':!![]})[_0x51df('0x27')](function(_0x55df76){if(_0x55df76&&_0x55df76[_0x51df('0x49')]){return db[_0x51df('0x2e')][_0x51df('0x54')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x51df('0x2d')](_0x55df76,'id')},'$or':[{'UserId':null},{'UserId':_0x2ad014['user']['id']}]}});}return 0x0;})[_0x51df('0x27')](function(_0x451089){if(!_[_0x51df('0x75')](_0x451089)&&_['isNumber'](_0x451089)){return _0x5630a2[_0x51df('0x1d')](0xc8)[_0x51df('0x1f')]({'contacts':_0x451089});}else{logger[_0x51df('0x29')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x51df('0x93'));_0x5630a2[_0x51df('0x1c')](0x194);}})[_0x51df('0x59')](handleError(_0x5630a2,null));}; \ No newline at end of file +var _0x8aa5=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','send','map','CmHopper','rawAttributes','fieldName','key','model','name','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','length','nolimit','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','find','omit','createdAt','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end'];(function(_0x877728,_0x2453aa){var _0x56d0dd=function(_0x5a685f){while(--_0x5a685f){_0x877728['push'](_0x877728['shift']());}};_0x56d0dd(++_0x2453aa);}(_0x8aa5,0x78));var _0x58aa=function(_0x1fc8c0,_0xf041d4){_0x1fc8c0=_0x1fc8c0-0x0;var _0x1d3024=_0x8aa5[_0x1fc8c0];return _0x1d3024;};'use strict';var emlformat=require(_0x58aa('0x0'));var rimraf=require(_0x58aa('0x1'));var zipdir=require(_0x58aa('0x2'));var jsonpatch=require(_0x58aa('0x3'));var rp=require(_0x58aa('0x4'));var moment=require(_0x58aa('0x5'));var BPromise=require(_0x58aa('0x6'));var Mustache=require(_0x58aa('0x7'));var util=require(_0x58aa('0x8'));var path=require(_0x58aa('0x9'));var sox=require('sox');var csv=require(_0x58aa('0xa'));var ejs=require(_0x58aa('0xb'));var fs=require('fs');var fs_extra=require(_0x58aa('0xc'));var _=require(_0x58aa('0xd'));var squel=require('squel');var crypto=require(_0x58aa('0xe'));var jsforce=require(_0x58aa('0xf'));var deskjs=require(_0x58aa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x58aa('0x11'));var Papa=require(_0x58aa('0x12'));var Redis=require(_0x58aa('0x13'));var authService=require(_0x58aa('0x14'));var qs=require(_0x58aa('0x15'));var as=require(_0x58aa('0x16'));var hardwareService=require(_0x58aa('0x17'));var logger=require(_0x58aa('0x18'))(_0x58aa('0x19'));var utils=require(_0x58aa('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x58aa('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa7e903,_0x5d7054){_0x5d7054=_0x5d7054||0xcc;return function(_0x389866){if(_0x389866){return _0xa7e903[_0x58aa('0x1c')](_0x5d7054);}return _0xa7e903[_0x58aa('0x1d')](_0x5d7054)[_0x58aa('0x1e')]();};}function respondWithResult(_0x3cbe28,_0x4033c4){_0x4033c4=_0x4033c4||0xc8;return function(_0xc012e9){if(_0xc012e9){return _0x3cbe28[_0x58aa('0x1d')](_0x4033c4)[_0x58aa('0x1f')](_0xc012e9);}};}function respondWithFilteredResult(_0x3c0993,_0x58d4e2){return function(_0x3da1e9){if(_0x3da1e9){var _0x2c1691=typeof _0x58d4e2[_0x58aa('0x20')]===_0x58aa('0x21')&&typeof _0x58d4e2[_0x58aa('0x22')]===_0x58aa('0x21');var _0x261ee1=_0x3da1e9[_0x58aa('0x23')];var _0x542386=_0x2c1691?0x0:_0x58d4e2['offset'];var _0x1ee792=_0x2c1691?_0x3da1e9[_0x58aa('0x23')]:_0x58d4e2[_0x58aa('0x20')]+_0x58d4e2[_0x58aa('0x22')];var _0x52bbf7;if(_0x1ee792>=_0x261ee1){_0x1ee792=_0x261ee1;_0x52bbf7=0xc8;}else{_0x52bbf7=0xce;}_0x3c0993[_0x58aa('0x1d')](_0x52bbf7);return _0x3c0993[_0x58aa('0x24')](_0x58aa('0x25'),_0x542386+'-'+_0x1ee792+'/'+_0x261ee1)[_0x58aa('0x1f')](_0x3da1e9);}return null;};}function patchUpdates(_0x22d20b){return function(_0x1799d4){try{jsonpatch[_0x58aa('0x26')](_0x1799d4,_0x22d20b,!![]);}catch(_0x3b398e){return BPromise[_0x58aa('0x27')](_0x3b398e);}return _0x1799d4[_0x58aa('0x28')]();};}function saveUpdates(_0x2af981,_0x2c7750){return function(_0x245d89){if(_0x245d89){return _0x245d89[_0x58aa('0x29')](_0x2af981)[_0x58aa('0x2a')](function(_0x25ce8a){return _0x25ce8a;});}return null;};}function removeEntity(_0x16665a,_0xbfafe7){return function(_0x485abd){if(_0x485abd){return _0x485abd['destroy']()[_0x58aa('0x2a')](function(){_0x16665a[_0x58aa('0x1d')](0xcc)[_0x58aa('0x1e')]();});}};}function handleEntityNotFound(_0x2041c6,_0x545b50){return function(_0x1cb9dd){if(!_0x1cb9dd){_0x2041c6['sendStatus'](0x194);}return _0x1cb9dd;};}function handleError(_0x1a4511,_0x27260d){_0x27260d=_0x27260d||0x1f4;return function(_0xe7ae31){logger[_0x58aa('0x2b')](_0xe7ae31[_0x58aa('0x2c')]);if(_0xe7ae31['name']){delete _0xe7ae31['name'];}_0x1a4511['status'](_0x27260d)[_0x58aa('0x2d')](_0xe7ae31);};}exports['index']=function(_0x5353ba,_0x3c894e){var _0x301aee={},_0x27c8be={},_0x4c672b={'count':0x0,'rows':[]};var _0x10312d=_[_0x58aa('0x2e')](db[_0x58aa('0x2f')][_0x58aa('0x30')],function(_0x108217){return{'name':_0x108217[_0x58aa('0x31')],'type':_0x108217['type'][_0x58aa('0x32')]};});_0x27c8be[_0x58aa('0x33')]=_[_0x58aa('0x2e')](_0x10312d,_0x58aa('0x34'));_0x27c8be[_0x58aa('0x35')]=_[_0x58aa('0x36')](_0x5353ba[_0x58aa('0x35')]);_0x27c8be[_0x58aa('0x37')]=_['intersection'](_0x27c8be[_0x58aa('0x33')],_0x27c8be[_0x58aa('0x35')]);_0x27c8be[_0x58aa('0x37')]=_[_0x58aa('0x38')](_0x27c8be[_0x58aa('0x37')],[_0x58aa('0x39'),_0x58aa('0x3a'),_0x58aa('0x3b'),_0x58aa('0x3c'),_0x58aa('0x3d'),_0x58aa('0x3e'),'$ne','$eq','$not',_0x58aa('0x3f'),_0x58aa('0x40'),'$in',_0x58aa('0x41'),_0x58aa('0x42'),_0x58aa('0x43'),_0x58aa('0x44'),_0x58aa('0x45'),'$like',_0x58aa('0x46'),_0x58aa('0x47'),'$contained',_0x58aa('0x48')]);_0x301aee[_0x58aa('0x49')]=_[_0x58aa('0x4a')](_0x27c8be[_0x58aa('0x33')],qs[_0x58aa('0x4b')](_0x5353ba[_0x58aa('0x35')][_0x58aa('0x4b')]));_0x301aee[_0x58aa('0x49')]=_0x301aee['attributes'][_0x58aa('0x4c')]?_0x301aee['attributes']:_0x27c8be[_0x58aa('0x33')];if(!_0x5353ba[_0x58aa('0x35')]['hasOwnProperty'](_0x58aa('0x4d'))){_0x301aee[_0x58aa('0x22')]=qs[_0x58aa('0x22')](_0x5353ba[_0x58aa('0x35')]['limit']);_0x301aee[_0x58aa('0x20')]=qs[_0x58aa('0x20')](_0x5353ba[_0x58aa('0x35')]['offset']);}_0x301aee['order']=qs[_0x58aa('0x4e')](_0x5353ba[_0x58aa('0x35')]['sort']);_0x301aee['where']=qs[_0x58aa('0x37')](_['pick'](_0x5353ba[_0x58aa('0x35')],_0x27c8be[_0x58aa('0x37')]),_0x10312d);if(_0x5353ba['query'][_0x58aa('0x4f')]){_0x301aee[_0x58aa('0x50')]=_['merge'](_0x301aee['where'],{'$or':_[_0x58aa('0x2e')](_0x10312d,function(_0x45c28c){if(_0x45c28c[_0x58aa('0x51')]!==_0x58aa('0x52')){var _0x139646={};_0x139646[_0x45c28c[_0x58aa('0x34')]]={'$like':'%'+_0x5353ba[_0x58aa('0x35')][_0x58aa('0x4f')]+'%'};return _0x139646;}})});}_0x301aee=_[_0x58aa('0x53')]({},_0x301aee,_0x5353ba[_0x58aa('0x54')]);var _0x510b85={'where':_0x301aee[_0x58aa('0x50')]};return db[_0x58aa('0x2f')][_0x58aa('0x23')](_0x510b85)[_0x58aa('0x2a')](function(_0x148813){_0x4c672b[_0x58aa('0x23')]=_0x148813;if(_0x5353ba['query'][_0x58aa('0x55')]){_0x301aee[_0x58aa('0x56')]=[{'all':!![]}];}return db[_0x58aa('0x2f')]['findAll'](_0x301aee);})[_0x58aa('0x2a')](function(_0x21c65b){_0x4c672b[_0x58aa('0x57')]=_0x21c65b;return _0x4c672b;})[_0x58aa('0x2a')](respondWithFilteredResult(_0x3c894e,_0x301aee))[_0x58aa('0x58')](handleError(_0x3c894e,null));};exports[_0x58aa('0x59')]=function(_0x5222fe,_0xcebc7a){var _0x14433a={'raw':!![],'where':{'id':_0x5222fe[_0x58aa('0x5a')]['id']}},_0x1dd68b={};_0x1dd68b[_0x58aa('0x33')]=_[_0x58aa('0x36')](db[_0x58aa('0x2f')][_0x58aa('0x30')]);_0x1dd68b['query']=_[_0x58aa('0x36')](_0x5222fe[_0x58aa('0x35')]);_0x1dd68b[_0x58aa('0x37')]=_[_0x58aa('0x4a')](_0x1dd68b['model'],_0x1dd68b[_0x58aa('0x35')]);_0x14433a[_0x58aa('0x49')]=_[_0x58aa('0x4a')](_0x1dd68b['model'],qs[_0x58aa('0x4b')](_0x5222fe[_0x58aa('0x35')][_0x58aa('0x4b')]));_0x14433a[_0x58aa('0x49')]=_0x14433a[_0x58aa('0x49')]['length']?_0x14433a[_0x58aa('0x49')]:_0x1dd68b[_0x58aa('0x33')];if(_0x5222fe[_0x58aa('0x35')][_0x58aa('0x55')]){_0x14433a['include']=[{'all':!![]}];}_0x14433a=_['merge']({},_0x14433a,_0x5222fe['options']);return db[_0x58aa('0x2f')]['find'](_0x14433a)['then'](handleEntityNotFound(_0xcebc7a,null))[_0x58aa('0x2a')](respondWithResult(_0xcebc7a,null))[_0x58aa('0x58')](handleError(_0xcebc7a,null));};exports[_0x58aa('0x5b')]=function(_0x5cfe92,_0x462416){return db[_0x58aa('0x2f')]['create'](_0x5cfe92[_0x58aa('0x5c')],{})['then'](respondWithResult(_0x462416,0xc9))[_0x58aa('0x58')](handleError(_0x462416,null));};exports['update']=function(_0x23f26d,_0x2fd657){if(_0x23f26d['body']['id']){delete _0x23f26d[_0x58aa('0x5c')]['id'];}return db[_0x58aa('0x2f')]['find']({'where':{'id':_0x23f26d[_0x58aa('0x5a')]['id']}})[_0x58aa('0x2a')](handleEntityNotFound(_0x2fd657,null))[_0x58aa('0x2a')](saveUpdates(_0x23f26d[_0x58aa('0x5c')],null))[_0x58aa('0x2a')](respondWithResult(_0x2fd657,null))[_0x58aa('0x58')](handleError(_0x2fd657,null));};exports[_0x58aa('0x5d')]=function(_0xd5fc7,_0x2063e9){return db[_0x58aa('0x2f')][_0x58aa('0x5d')]()[_0x58aa('0x2a')](respondWithResult(_0x2063e9,null))[_0x58aa('0x58')](handleError(_0x2063e9,null));};exports['destroy']=function(_0x150cc9,_0x44f91c){var _0x3e37e8;return db['CmHopper']['find']({'where':{'id':_0x150cc9[_0x58aa('0x5a')]['id']}})[_0x58aa('0x2a')](handleEntityNotFound(_0x44f91c,null))[_0x58aa('0x2a')](function(_0x47525b){if(_0x47525b){return _0x47525b[_0x58aa('0x5e')]()[_0x58aa('0x2a')](function(_0x53047b){return _0x53047b;});}})[_0x58aa('0x2a')](function(_0x1712e4){_0x3e37e8=_0x1712e4;if(_0x1712e4){if(_0x1712e4[_0x58aa('0x5f')]||_0x1712e4[_0x58aa('0x60')]){return db[_0x1712e4[_0x58aa('0x5f')]?_0x58aa('0x61'):_0x58aa('0x62')][_0x58aa('0x63')]({'where':{'id':_0x1712e4['VoiceQueueId']?_0x1712e4[_0x58aa('0x5f')]:_0x1712e4[_0x58aa('0x60')]},'attributes':['id',_0x58aa('0x34')],'raw':!![]});}}})['then'](function(_0x5c382b){var _0x506509={};if(_0x5c382b){_[_0x58aa('0x53')](_0x506509,_[_0x58aa('0x64')](_0x3e37e8['dataValues'],[_0x58aa('0x65'),'updatedAt','id']));_0x506509['state']=0x15;_0x506509[_0x58aa('0x66')]=_0x58aa('0x67');_0x506509[_0x58aa('0x68')]=_0x5c382b[_0x58aa('0x34')];_0x506509[_0x58aa('0x69')]=_0x150cc9[_0x58aa('0x6a')][_0x58aa('0x34')];_0x506509['UserId']=_0x150cc9[_0x58aa('0x6a')]['id'];_0x506509[_0x58aa('0x67')]=!![];_0x506509[_0x58aa('0x6b')]=moment()[_0x58aa('0x6c')](_0x58aa('0x6d'));_0x506509[_0x58aa('0x6e')]=_0x3e37e8[_0x58aa('0x6f')];_0x506509[_0x58aa('0x70')]=_0x3e37e8[_0x58aa('0x5f')]?'queue':_0x58aa('0x71');return db['CmContact'][_0x58aa('0x63')]({'where':{'id':_0x506509[_0x58aa('0x72')]},'attributes':[_0x58aa('0x73'),_0x58aa('0x74')]})[_0x58aa('0x2a')](function(_0x57ab08){if(!_[_0x58aa('0x75')](_0x44f91c)&&!_[_0x58aa('0x75')](_0x57ab08[_0x58aa('0x73')])){_0x506509[_0x58aa('0x76')]=_0x57ab08[_0x58aa('0x73')];if(!_[_0x58aa('0x75')](_0x57ab08[_0x58aa('0x74')])){_0x506509[_0x58aa('0x76')]+='\x20'+_0x57ab08['lastName'];}}})[_0x58aa('0x77')](function(){return db['CmHopperFinal'][_0x58aa('0x5b')](_0x506509);});}})[_0x58aa('0x2a')](function(){return _0x44f91c[_0x58aa('0x1d')](0xcc)[_0x58aa('0x1e')]();})[_0x58aa('0x58')](handleError(_0x44f91c,null));};exports[_0x58aa('0x78')]=function(_0x242fe9,_0x282b6b,_0x4d8f0a){var _0x453b83=[];return db['CmContact']['describe']()[_0x58aa('0x2a')](function(_0x5a1b67){_0x453b83=_['keys'](_0x5a1b67);return _0x242fe9[_0x58aa('0x6a')][_0x58aa('0x79')]({'where':{'type':_0x58aa('0x7a'),'dialActive':!![],'dialMethod':_0x58aa('0x7b')},'attributes':['id','dialOrderByScheduledAt',_0x58aa('0x7c')],'raw':!![]});})[_0x58aa('0x2a')](function(_0x39a222){if(_0x39a222&&_0x39a222[_0x58aa('0x4c')]){return db[_0x58aa('0x7d')][_0x58aa('0x7e')](function(_0x70b1f9){var _0x4df902={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x58aa('0x6c')](_0x58aa('0x6d'))},'VoiceQueueId':{'$in':_[_0x58aa('0x2e')](_0x39a222,'id')},'$or':[{'UserId':null},{'UserId':_0x242fe9[_0x58aa('0x6a')]['id']}]};var _0x35fd9a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x39a222)[_0x58aa('0x4f')](['dialPreviewAutoRecallMe',0x0])[_0x58aa('0x2e')]('id')[_0x58aa('0x7f')]()},'$or':[{'UserId':null},{'UserId':_0x242fe9[_0x58aa('0x6a')]['id']}]};var _0x1e3351={'$or':[_0x4df902,_0x35fd9a]};var _0x2444ca=[];if(_0x242fe9[_0x58aa('0x5c')][_0x58aa('0x80')]&&_0x242fe9['body']['direction']===_0x58aa('0x81')){if(!_['isEmpty'](_0x242fe9['body'][_0x58aa('0x82')])){_0x1e3351['id']={'$in':_0x242fe9[_0x58aa('0x5c')][_0x58aa('0x82')]};}_0x2444ca=[['priority',_0x58aa('0x83')],[_0x58aa('0x84'),_0x39a222[0x0]['dialOrderByScheduledAt']===_0x58aa('0x83')?_0x58aa('0x85'):_0x58aa('0x83')],db['sequelize'][_0x58aa('0x86')](_0x58aa('0x87')),['id',_0x58aa('0x85')]];}else{if(!_[_0x58aa('0x88')](_0x242fe9[_0x58aa('0x5c')]['hopperIds'])){_0x1e3351['id']={'$notIn':_0x242fe9[_0x58aa('0x5c')][_0x58aa('0x82')]};}_0x2444ca=[[_0x58aa('0x89'),'DESC'],[_0x58aa('0x84'),_0x39a222[0x0]['dialOrderByScheduledAt']],db[_0x58aa('0x7d')][_0x58aa('0x86')](_0x58aa('0x8a')),['id',_0x58aa('0x83')]];}return db[_0x58aa('0x2f')]['findOne']({'attributes':['id',_0x58aa('0x8b'),'recallme'],'where':_0x1e3351,'order':_0x2444ca,'transaction':_0x70b1f9,'lock':_0x70b1f9[_0x58aa('0x8c')][_0x58aa('0x8d')],'include':[{'model':db[_0x58aa('0x8e')],'as':_0x58aa('0x8f'),'attributes':_0x453b83,'include':[{'model':db[_0x58aa('0x90')],'as':_0x58aa('0x91'),'attributes':['id',_0x58aa('0x34')]}]},{'model':db['CmList'],'as':_0x58aa('0x92'),'attributes':['id',_0x58aa('0x34')]},{'model':db[_0x58aa('0x61')],'as':_0x58aa('0x93'),'attributes':['id',_0x58aa('0x34'),_0x58aa('0x94')]}]})['then'](function(_0x55fd85){if(_0x55fd85){return _0x55fd85[_0x58aa('0x29')]({'UserId':_0x242fe9[_0x58aa('0x6a')]['id']},{'transaction':_0x70b1f9});}});});}})[_0x58aa('0x2a')](handleEntityNotFound(_0x282b6b,null))[_0x58aa('0x2a')](respondWithResult(_0x282b6b,null))[_0x58aa('0x58')](handleError(_0x282b6b,null));};exports[_0x58aa('0x95')]=function(_0x504e40,_0x5eb3f4,_0x45b633){return _0x504e40['user'][_0x58aa('0x79')]({'where':{'type':_0x58aa('0x7a'),'dialActive':!![],'dialMethod':_0x58aa('0x7b')},'attributes':['id'],'raw':!![]})[_0x58aa('0x2a')](function(_0x8ee2d6){if(_0x8ee2d6&&_0x8ee2d6['length']){return db[_0x58aa('0x2f')][_0x58aa('0x23')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x58aa('0x6d'))},'VoiceQueueId':{'$in':_[_0x58aa('0x2e')](_0x8ee2d6,'id')},'$or':[{'UserId':null},{'UserId':_0x504e40[_0x58aa('0x6a')]['id']}]}});}return 0x0;})[_0x58aa('0x2a')](function(_0x3a7117){if(!_[_0x58aa('0x75')](_0x3a7117)&&_['isNumber'](_0x3a7117)){return _0x5eb3f4[_0x58aa('0x1d')](0xc8)[_0x58aa('0x1f')]({'contacts':_0x3a7117});}else{logger[_0x58aa('0x2b')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x58aa('0x95'),0x194,_0x58aa('0x96'));_0x5eb3f4[_0x58aa('0x1c')](0x194);}})[_0x58aa('0x58')](handleError(_0x5eb3f4,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d2caa27..cfef8ba 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 _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4931e1,_0x89e35d){_0x4931e1=_0x4931e1-0x0;var _0x49fb59=_0xc6ac[_0x4931e1];return _0x49fb59;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x153aae,_0x28cf2c){var _0xb918f7=function(_0x26d167){while(--_0x26d167){_0x153aae['push'](_0x153aae['shift']());}};_0xb918f7(++_0x28cf2c);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index a1392ce..67b0385 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 _0xd76e=['User','name','voicePause','includes','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','UserId','length','all','GetContactRecallMe','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','where','attributes','limit','include','model','GetCmHopper','stringify','catch','ShowCmHopper','find','raw','map','CreateCmHopper','CmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys'];(function(_0x249069,_0xad6400){var _0x5372e5=function(_0x3d283f){while(--_0x3d283f){_0x249069['push'](_0x249069['shift']());}};_0x5372e5(++_0xad6400);}(_0xd76e,0xac));var _0xed76=function(_0x12157c,_0x1c9dd2){_0x12157c=_0x12157c-0x0;var _0x2947a0=_0xd76e[_0x12157c];return _0x2947a0;};'use strict';var _=require(_0xed76('0x0'));var util=require(_0xed76('0x1'));var moment=require(_0xed76('0x2'));var BPromise=require(_0xed76('0x3'));var rs=require(_0xed76('0x4'));var fs=require('fs');var Redis=require(_0xed76('0x5'));var db=require(_0xed76('0x6'))['db'];var utils=require(_0xed76('0x7'));var logger=require(_0xed76('0x8'))(_0xed76('0x9'));var config=require(_0xed76('0xa'));var jayson=require(_0xed76('0xb'));var client=jayson[_0xed76('0xc')][_0xed76('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x397a14,_0x21aac4,_0x251baf){return new BPromise(function(_0x1c949f,_0x591952){return client['request'](_0x397a14,_0x251baf)[_0xed76('0xe')](function(_0x330a45){logger[_0xed76('0xf')](_0xed76('0x10'),_0x21aac4,_0xed76('0x11'));logger[_0xed76('0x12')](_0xed76('0x13'),_0x21aac4,_0xed76('0x11'),JSON['stringify'](_0x330a45));if(_0x330a45[_0xed76('0x14')]){if(_0x330a45['error'][_0xed76('0x15')]===0x1f4){logger[_0xed76('0x14')](_0xed76('0x10'),_0x21aac4,_0x330a45['error'][_0xed76('0x16')]);return _0x591952(_0x330a45['error']['message']);}logger[_0xed76('0x14')](_0xed76('0x10'),_0x21aac4,_0x330a45[_0xed76('0x14')][_0xed76('0x16')]);return _0x1c949f(_0x330a45[_0xed76('0x14')]['message']);}else{logger['info'](_0xed76('0x10'),_0x21aac4,_0xed76('0x11'));_0x1c949f(_0x330a45[_0xed76('0x17')][_0xed76('0x16')]);}})['catch'](function(_0x59bd4b){logger[_0xed76('0x14')](_0xed76('0x10'),_0x21aac4,_0x59bd4b);_0x591952(_0x59bd4b);});});}exports['GetCmHopper']=function(_0x1bdc5d){var _0x555dbf=this;return new Promise(function(_0x1e91de,_0x1853fd){return db['CmHopper'][_0xed76('0x18')]({'raw':_0x1bdc5d[_0xed76('0x19')]?_0x1bdc5d[_0xed76('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1bdc5d['options']?_0x1bdc5d[_0xed76('0x19')][_0xed76('0x1a')]||null:null,'attributes':_0x1bdc5d[_0xed76('0x19')]?_0x1bdc5d[_0xed76('0x19')][_0xed76('0x1b')]||null:null,'limit':_0x1bdc5d['options']?_0x1bdc5d[_0xed76('0x19')][_0xed76('0x1c')]||null:null,'include':_0x1bdc5d[_0xed76('0x19')]?_0x1bdc5d[_0xed76('0x19')][_0xed76('0x1d')]?_['map'](_0x1bdc5d[_0xed76('0x19')][_0xed76('0x1d')],function(_0x1f791c){return{'model':db[_0x1f791c[_0xed76('0x1e')]],'as':_0x1f791c['as'],'attributes':_0x1f791c['attributes'],'include':_0x1f791c[_0xed76('0x1d')]?_['map'](_0x1f791c[_0xed76('0x1d')],function(_0x53e6d6){return{'model':db[_0x53e6d6[_0xed76('0x1e')]],'as':_0x53e6d6['as'],'attributes':_0x53e6d6[_0xed76('0x1b')],'include':_0x53e6d6['include']?_['map'](_0x53e6d6[_0xed76('0x1d')],function(_0x45ffe9){return{'model':db[_0x45ffe9[_0xed76('0x1e')]],'as':_0x45ffe9['as'],'attributes':_0x45ffe9['attributes']};}):[]};}):[]};}):[]:[]})[_0xed76('0xe')](function(_0x492441){logger[_0xed76('0xf')](_0xed76('0x1f'),_0x1bdc5d);logger['debug'](_0xed76('0x1f'),_0x1bdc5d,JSON[_0xed76('0x20')](_0x492441));_0x1e91de(_0x492441);})[_0xed76('0x21')](function(_0x453bef){logger[_0xed76('0x14')]('GetCmHopper',_0x453bef['message'],_0x1bdc5d);_0x1853fd(_0x555dbf[_0xed76('0x14')](0x1f4,_0x453bef[_0xed76('0x16')]));});});};exports[_0xed76('0x22')]=function(_0x50f04e){var _0x1a71d1=this;return new Promise(function(_0x3ecddd,_0x59140e){return db['CmHopper'][_0xed76('0x23')]({'raw':_0x50f04e[_0xed76('0x19')]?_0x50f04e[_0xed76('0x19')][_0xed76('0x24')]===undefined?!![]:![]:!![],'where':_0x50f04e[_0xed76('0x19')]?_0x50f04e['options']['where']||null:null,'attributes':_0x50f04e[_0xed76('0x19')]?_0x50f04e['options'][_0xed76('0x1b')]||null:null,'include':_0x50f04e['options']?_0x50f04e[_0xed76('0x19')][_0xed76('0x1d')]?_['map'](_0x50f04e[_0xed76('0x19')]['include'],function(_0x2cb82e){return{'model':db[_0x2cb82e[_0xed76('0x1e')]],'as':_0x2cb82e['as'],'attributes':_0x2cb82e[_0xed76('0x1b')],'include':_0x2cb82e[_0xed76('0x1d')]?_[_0xed76('0x25')](_0x2cb82e[_0xed76('0x1d')],function(_0x3931b8){return{'model':db[_0x3931b8[_0xed76('0x1e')]],'as':_0x3931b8['as'],'attributes':_0x3931b8[_0xed76('0x1b')],'include':_0x3931b8['include']?_[_0xed76('0x25')](_0x3931b8[_0xed76('0x1d')],function(_0x5ebd29){return{'model':db[_0x5ebd29[_0xed76('0x1e')]],'as':_0x5ebd29['as'],'attributes':_0x5ebd29[_0xed76('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed76('0xe')](function(_0x29dd0f){logger[_0xed76('0xf')]('ShowCmHopper',_0x50f04e);logger[_0xed76('0x12')](_0xed76('0x22'),_0x50f04e,JSON[_0xed76('0x20')](_0x29dd0f));_0x3ecddd(_0x29dd0f);})['catch'](function(_0x2d7c98){logger[_0xed76('0x14')](_0xed76('0x22'),_0x2d7c98[_0xed76('0x16')],_0x50f04e);_0x59140e(_0x1a71d1[_0xed76('0x14')](0x1f4,_0x2d7c98[_0xed76('0x16')]));});});};exports[_0xed76('0x26')]=function(_0x4de1a8){var _0x46119e=this;return new Promise(function(_0x18ae60,_0x93d409){return db[_0xed76('0x27')][_0xed76('0x28')](_0x4de1a8[_0xed76('0x29')],{'raw':_0x4de1a8[_0xed76('0x19')]?_0x4de1a8[_0xed76('0x19')][_0xed76('0x24')]===undefined?!![]:![]:!![]})[_0xed76('0xe')](function(_0x2e8bca){logger['info'](_0xed76('0x26'),_0x4de1a8);logger[_0xed76('0x12')](_0xed76('0x26'),_0x4de1a8,JSON[_0xed76('0x20')](_0x2e8bca));_0x18ae60(_0x2e8bca);})[_0xed76('0x21')](function(_0xe21442){logger[_0xed76('0x14')]('CreateCmHopper',_0xe21442['message'],_0x4de1a8);_0x93d409(_0x46119e[_0xed76('0x14')](0x1f4,_0xe21442[_0xed76('0x16')]));});});};exports['UpdateCmHopper']=function(_0x453219){var _0x3335dc=this;return new Promise(function(_0x48d072,_0x2c29e5){return db[_0xed76('0x27')][_0xed76('0x2a')](_0x453219[_0xed76('0x29')],{'raw':_0x453219[_0xed76('0x19')]?_0x453219[_0xed76('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453219[_0xed76('0x19')]?_0x453219[_0xed76('0x19')][_0xed76('0x1a')]||null:null,'attributes':_0x453219[_0xed76('0x19')]?_0x453219[_0xed76('0x19')]['attributes']||null:null,'limit':_0x453219[_0xed76('0x19')]?_0x453219[_0xed76('0x19')][_0xed76('0x1c')]||null:null})[_0xed76('0xe')](function(_0x2e0374){logger[_0xed76('0xf')](_0xed76('0x2b'),_0x453219);logger[_0xed76('0x12')](_0xed76('0x2b'),_0x453219,JSON[_0xed76('0x20')](_0x2e0374));_0x48d072(_0x2e0374);})[_0xed76('0x21')](function(_0x36bb2d){logger[_0xed76('0x14')](_0xed76('0x2b'),_0x36bb2d[_0xed76('0x16')],_0x453219);_0x2c29e5(_0x3335dc[_0xed76('0x14')](0x1f4,_0x36bb2d[_0xed76('0x16')]));});});};exports[_0xed76('0x2c')]=function(_0x15c61e){var _0x305bca=this;return new Promise(function(_0x4cafa7,_0x367e24){return db[_0xed76('0x27')][_0xed76('0x2d')]({'where':_0x15c61e['options']?_0x15c61e[_0xed76('0x19')][_0xed76('0x1a')]||null:null})['then'](function(_0x4a0f85){logger[_0xed76('0xf')](_0xed76('0x2c'),_0x15c61e);logger[_0xed76('0x12')]('DestroyCmHopper',_0x15c61e,JSON[_0xed76('0x20')](_0x4a0f85));_0x4cafa7(_0x4a0f85);})['catch'](function(_0x35d0ff){logger[_0xed76('0x14')](_0xed76('0x2c'),_0x35d0ff[_0xed76('0x16')],_0x15c61e);_0x367e24(_0x305bca['error'](0x1f4,_0x35d0ff[_0xed76('0x16')]));});});};exports[_0xed76('0x2e')]=function(_0x32ee44){var _0x16fbae=this;return new Promise(function(_0x3009d3,_0xb2c335){return db[_0xed76('0x2f')][_0xed76('0x30')]()['then'](function(_0x327acd){return db[_0xed76('0x31')][_0xed76('0x32')](function(_0x5a4932){return db[_0xed76('0x27')][_0xed76('0x18')]({'where':_0x32ee44[_0xed76('0x19')]?_0x32ee44[_0xed76('0x19')][_0xed76('0x1a')]||null:null,'attributes':_0x32ee44[_0xed76('0x19')]?_0x32ee44[_0xed76('0x19')][_0xed76('0x1b')]||null:null,'limit':_0x32ee44[_0xed76('0x19')]?_0x32ee44[_0xed76('0x19')][_0xed76('0x1c')]||null:null,'order':_0x32ee44[_0xed76('0x19')]?_0x32ee44[_0xed76('0x19')][_0xed76('0x33')]||null:null,'transaction':_0x5a4932,'lock':_0x5a4932[_0xed76('0x34')][_0xed76('0x35')],'include':[{'model':db['CmContact'],'as':_0xed76('0x36'),'attributes':_[_0xed76('0x37')](_0x327acd)},{'model':db[_0xed76('0x38')],'as':'Agent','attributes':['id',_0xed76('0x39'),_0xed76('0x3a')]}]})[_0xed76('0xe')](function(_0x43fc59){var _0x417771=[];var _0x14744=[];for(var _0x54ff24=0x0;_0x54ff24<_0x43fc59['length'];_0x54ff24+=0x1){var _0x4db66b=_0x43fc59[_0x54ff24]['UserId'];if(_0x4db66b===null){_0x417771['push'](_0x43fc59[_0x54ff24][_0xed76('0x2a')](_0x32ee44[_0xed76('0x29')],{'transaction':_0x5a4932}));}else if(!_0x14744[_0xed76('0x3b')](_0x4db66b)){_0x14744[_0xed76('0x3c')](_0x4db66b);_0x417771[_0xed76('0x3c')](_0x43fc59[_0x54ff24][_0xed76('0x2a')](_0x32ee44[_0xed76('0x29')],{'transaction':_0x5a4932}));}}return BPromise['all'](_0x417771);});})[_0xed76('0xe')](function(_0x413faf){logger['info'](_0xed76('0x2e'),_0x32ee44);logger[_0xed76('0x12')](_0xed76('0x2e'),_0x32ee44,JSON[_0xed76('0x20')](_0x413faf));_0x3009d3(_0x413faf);})[_0xed76('0x21')](function(_0x2b4870){logger[_0xed76('0x14')]('GetContactDialer',_0x2b4870['message'],_0x32ee44);_0xb2c335(_0x16fbae[_0xed76('0x14')](0x1f4,_0x2b4870[_0xed76('0x16')]));});});});};exports['MoveContactManagedDialer']=function(_0xff90a0){var _0x4a8547=this;return new Promise(function(_0x3cb1c7,_0x22655b){return db[_0xed76('0x31')][_0xed76('0x32')](function(_0x37c0f5){return db[_0xed76('0x3d')]['create'](_0xff90a0[_0xed76('0x29')],{'raw':_0xff90a0[_0xed76('0x19')]?_0xff90a0[_0xed76('0x19')][_0xed76('0x24')]===undefined?!![]:![]:!![],'transaction':_0x37c0f5})['then'](function(){return db[_0xed76('0x27')][_0xed76('0x2d')]({'where':_0xff90a0['options']?_0xff90a0[_0xed76('0x19')]['where']||null:null,'transaction':_0x37c0f5});});})[_0xed76('0xe')](function(_0x547504){logger[_0xed76('0xf')]('MoveContactManagedDialer',_0xff90a0);logger[_0xed76('0x12')](_0xed76('0x3e'),_0xff90a0,JSON[_0xed76('0x20')](_0x547504));_0x3cb1c7(_0x547504);})[_0xed76('0x21')](function(_0x53e8fb){logger[_0xed76('0x14')](_0xed76('0x3e'),_0x53e8fb[_0xed76('0x16')],_0xff90a0);_0x22655b(_0x4a8547['error'](0x1f4,_0x53e8fb[_0xed76('0x16')]));});});};exports[_0xed76('0x3f')]=function(_0x4be70f){var _0xcd75d1=this;return new Promise(function(_0x3bbb4d,_0x1c818d){return db[_0xed76('0x27')][_0xed76('0x18')]({'raw':_0x4be70f['options']?_0x4be70f['options'][_0xed76('0x24')]===undefined?!![]:![]:!![],'where':_0x4be70f[_0xed76('0x19')]?_0x4be70f[_0xed76('0x19')]['where']||null:null,'attributes':[[db[_0xed76('0x31')]['fn'](_0xed76('0x40'),db['sequelize']['fn']('IF',db[_0xed76('0x31')][_0xed76('0x41')](_0xed76('0x42')+util[_0xed76('0x43')](_0xed76('0x44'),moment()[_0xed76('0x43')](_0xed76('0x45')))+'\x20,\x201,\x20null'))),_0xed76('0x46')]]})[_0xed76('0xe')](function(_0x46ec5e){logger[_0xed76('0xf')](_0xed76('0x3f'),_0x4be70f);logger[_0xed76('0x12')](_0xed76('0x3f'),_0x4be70f,JSON[_0xed76('0x20')](_0x46ec5e));_0x3bbb4d(_0x46ec5e);})[_0xed76('0x21')](function(_0x418a51){logger[_0xed76('0x14')](_0xed76('0x3f'),_0x418a51[_0xed76('0x16')],_0x4be70f);_0x1c818d(_0xcd75d1[_0xed76('0x14')](0x1f4,_0x418a51[_0xed76('0x16')]));});});};exports['GetContactRecallMe']=function(_0x2a4d6a){var _0x347884=this;return new Promise(function(_0x1b7163,_0x469ea7){return db[_0xed76('0x2f')][_0xed76('0x30')]()[_0xed76('0xe')](function(_0x3f1c36){return db['sequelize'][_0xed76('0x32')](function(_0x47db85){return db[_0xed76('0x27')][_0xed76('0x18')]({'where':_0x2a4d6a[_0xed76('0x19')]?_0x2a4d6a[_0xed76('0x19')][_0xed76('0x1a')]||null:null,'attributes':_0x2a4d6a[_0xed76('0x19')]?_0x2a4d6a[_0xed76('0x19')][_0xed76('0x1b')]||null:null,'limit':0x1,'order':_0x2a4d6a[_0xed76('0x19')]?_0x2a4d6a['options'][_0xed76('0x33')]||null:null,'group':db[_0xed76('0x27')][_0xed76('0x47')],'transaction':_0x47db85,'lock':_0x47db85[_0xed76('0x34')][_0xed76('0x35')],'include':_0x2a4d6a['options']?_0x2a4d6a[_0xed76('0x19')][_0xed76('0x1d')]?_[_0xed76('0x25')](_0x2a4d6a[_0xed76('0x19')][_0xed76('0x1d')],function(_0x363357){return{'model':db[_0x363357['model']],'as':_0x363357['as'],'attributes':_0x363357[_0xed76('0x1b')],'include':_0x363357['include']?_[_0xed76('0x25')](_0x363357[_0xed76('0x1d')],function(_0x515755){return{'model':db[_0x515755[_0xed76('0x1e')]],'as':_0x515755['as'],'attributes':_0x515755[_0xed76('0x1b')],'include':_0x515755['include']?_[_0xed76('0x25')](_0x515755[_0xed76('0x1d')],function(_0x40ebf1){return{'model':db[_0x40ebf1['model']],'as':_0x40ebf1['as'],'attributes':_0x40ebf1[_0xed76('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed76('0xe')](function(_0x4f82a6){var _0x178ea1=[];for(var _0x37be2f=0x0;_0x37be2f<_0x4f82a6[_0xed76('0x48')];_0x37be2f+=0x1){_0x178ea1[_0xed76('0x3c')](_0x4f82a6[_0x37be2f][_0xed76('0x2a')](_0x2a4d6a['body'],{'transaction':_0x47db85}));}return BPromise[_0xed76('0x49')](_0x178ea1);});})['then'](function(_0x557bfd){logger[_0xed76('0xf')](_0xed76('0x4a'),_0x2a4d6a);logger[_0xed76('0x12')]('GetContactRecallMe',_0x2a4d6a,JSON[_0xed76('0x20')](_0x557bfd));_0x1b7163(_0x557bfd);})[_0xed76('0x21')](function(_0x31b5c5){logger[_0xed76('0x14')](_0xed76('0x4a'),_0x31b5c5[_0xed76('0x16')],_0x2a4d6a);_0x469ea7(_0x347884[_0xed76('0x14')](0x1f4,_0x31b5c5[_0xed76('0x16')]));});});});};exports[_0xed76('0x4b')]=function(_0x1a90c7){var _0x22bbfd=this;return new Promise(function(_0x390b8d,_0x424b36){db[_0xed76('0x2f')]['describe']()[_0xed76('0xe')](function(_0x4bea25){return db[_0xed76('0x27')][_0xed76('0x18')]({'raw':_0x1a90c7['options']?_0x1a90c7[_0xed76('0x19')][_0xed76('0x24')]===undefined?!![]:![]:!![],'where':_0x1a90c7['options']?_0x1a90c7[_0xed76('0x19')][_0xed76('0x1a')]||null:null,'attributes':_0x1a90c7[_0xed76('0x19')]?_0x1a90c7[_0xed76('0x19')][_0xed76('0x1b')]||null:null,'limit':_0x1a90c7['options']?_0x1a90c7[_0xed76('0x19')]['limit']||null:null,'include':_0x1a90c7['options']?_0x1a90c7[_0xed76('0x19')]['include']?_['map'](_0x1a90c7[_0xed76('0x19')][_0xed76('0x1d')],function(_0x1cfac2){return{'model':db[_0x1cfac2[_0xed76('0x1e')]],'as':_0x1cfac2['as'],'attributes':_0x1cfac2['as']===_0xed76('0x36')?_[_0xed76('0x37')](_0x4bea25):_0x1cfac2[_0xed76('0x1b')],'include':_0x1cfac2[_0xed76('0x1d')]?_[_0xed76('0x25')](_0x1cfac2[_0xed76('0x1d')],function(_0x3d1945){return{'model':db[_0x3d1945[_0xed76('0x1e')]],'as':_0x3d1945['as'],'attributes':_0x3d1945['attributes'],'include':_0x3d1945['include']?_['map'](_0x3d1945[_0xed76('0x1d')],function(_0x16bddd){return{'model':db[_0x16bddd[_0xed76('0x1e')]],'as':_0x16bddd['as'],'attributes':_0x16bddd[_0xed76('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed76('0xe')](function(_0x5d5b7f){logger[_0xed76('0xf')]('GetCmHopper',_0x1a90c7);logger[_0xed76('0x12')](_0xed76('0x1f'),_0x1a90c7,JSON[_0xed76('0x20')](_0x5d5b7f));_0x390b8d(_0x5d5b7f);})['catch'](function(_0x5a2b99){logger['error'](_0xed76('0x1f'),_0x5a2b99[_0xed76('0x16')],_0x1a90c7);_0x424b36(_0x22bbfd[_0xed76('0x14')](0x1f4,_0x5a2b99[_0xed76('0x16')]));});});});}; \ No newline at end of file +var _0x6dea=['include','map','model','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','attributes','limit'];(function(_0x33af0a,_0x32d6df){var _0x1504f1=function(_0x3a6ae2){while(--_0x3a6ae2){_0x33af0a['push'](_0x33af0a['shift']());}};_0x1504f1(++_0x32d6df);}(_0x6dea,0x198));var _0xa6de=function(_0x6c4428,_0x5c45ef){_0x6c4428=_0x6c4428-0x0;var _0x4d7f30=_0x6dea[_0x6c4428];return _0x4d7f30;};'use strict';var _=require(_0xa6de('0x0'));var util=require(_0xa6de('0x1'));var moment=require(_0xa6de('0x2'));var BPromise=require(_0xa6de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6de('0x4'));var db=require(_0xa6de('0x5'))['db'];var utils=require(_0xa6de('0x6'));var logger=require(_0xa6de('0x7'))(_0xa6de('0x8'));var config=require(_0xa6de('0x9'));var jayson=require(_0xa6de('0xa'));var client=jayson[_0xa6de('0xb')][_0xa6de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d7164,_0x5ed018,_0x4b8ff4){return new BPromise(function(_0x4aaacc,_0x9916e0){return client['request'](_0x5d7164,_0x4b8ff4)[_0xa6de('0xd')](function(_0x2d0822){logger[_0xa6de('0xe')](_0xa6de('0xf'),_0x5ed018,_0xa6de('0x10'));logger[_0xa6de('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5ed018,'request\x20sent',JSON[_0xa6de('0x12')](_0x2d0822));if(_0x2d0822['error']){if(_0x2d0822[_0xa6de('0x13')][_0xa6de('0x14')]===0x1f4){logger['error'](_0xa6de('0xf'),_0x5ed018,_0x2d0822['error'][_0xa6de('0x15')]);return _0x9916e0(_0x2d0822[_0xa6de('0x13')][_0xa6de('0x15')]);}logger[_0xa6de('0x13')](_0xa6de('0xf'),_0x5ed018,_0x2d0822[_0xa6de('0x13')][_0xa6de('0x15')]);return _0x4aaacc(_0x2d0822[_0xa6de('0x13')][_0xa6de('0x15')]);}else{logger[_0xa6de('0xe')](_0xa6de('0xf'),_0x5ed018,_0xa6de('0x10'));_0x4aaacc(_0x2d0822[_0xa6de('0x16')][_0xa6de('0x15')]);}})[_0xa6de('0x17')](function(_0xe64d71){logger[_0xa6de('0x13')](_0xa6de('0xf'),_0x5ed018,_0xe64d71);_0x9916e0(_0xe64d71);});});}exports[_0xa6de('0x18')]=function(_0x219612){var _0x8b5c9d=this;return new Promise(function(_0x201468,_0x1e4407){return db[_0xa6de('0x19')]['findAll']({'raw':_0x219612[_0xa6de('0x1a')]?_0x219612[_0xa6de('0x1a')][_0xa6de('0x1b')]===undefined?!![]:![]:!![],'where':_0x219612[_0xa6de('0x1a')]?_0x219612[_0xa6de('0x1a')]['where']||null:null,'attributes':_0x219612['options']?_0x219612['options'][_0xa6de('0x1c')]||null:null,'limit':_0x219612[_0xa6de('0x1a')]?_0x219612[_0xa6de('0x1a')][_0xa6de('0x1d')]||null:null,'include':_0x219612[_0xa6de('0x1a')]?_0x219612['options'][_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x219612[_0xa6de('0x1a')][_0xa6de('0x1e')],function(_0x10c093){return{'model':db[_0x10c093[_0xa6de('0x20')]],'as':_0x10c093['as'],'attributes':_0x10c093[_0xa6de('0x1c')],'include':_0x10c093[_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x10c093[_0xa6de('0x1e')],function(_0x354b66){return{'model':db[_0x354b66[_0xa6de('0x20')]],'as':_0x354b66['as'],'attributes':_0x354b66[_0xa6de('0x1c')],'include':_0x354b66[_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x354b66[_0xa6de('0x1e')],function(_0x574080){return{'model':db[_0x574080['model']],'as':_0x574080['as'],'attributes':_0x574080[_0xa6de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa6de('0xd')](function(_0xfa7167){logger[_0xa6de('0xe')](_0xa6de('0x18'),_0x219612);logger[_0xa6de('0x11')](_0xa6de('0x18'),_0x219612,JSON[_0xa6de('0x12')](_0xfa7167));_0x201468(_0xfa7167);})[_0xa6de('0x17')](function(_0x1c9d45){logger[_0xa6de('0x13')](_0xa6de('0x18'),_0x1c9d45[_0xa6de('0x15')],_0x219612);_0x1e4407(_0x8b5c9d[_0xa6de('0x13')](0x1f4,_0x1c9d45[_0xa6de('0x15')]));});});};exports['ShowCmHopper']=function(_0x1bd8dc){var _0x3f5ae4=this;return new Promise(function(_0x1499cb,_0x503283){return db[_0xa6de('0x19')]['find']({'raw':_0x1bd8dc[_0xa6de('0x1a')]?_0x1bd8dc[_0xa6de('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1bd8dc[_0xa6de('0x1a')]?_0x1bd8dc['options'][_0xa6de('0x21')]||null:null,'attributes':_0x1bd8dc[_0xa6de('0x1a')]?_0x1bd8dc[_0xa6de('0x1a')][_0xa6de('0x1c')]||null:null,'include':_0x1bd8dc[_0xa6de('0x1a')]?_0x1bd8dc[_0xa6de('0x1a')][_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x1bd8dc['options']['include'],function(_0x2a3278){return{'model':db[_0x2a3278[_0xa6de('0x20')]],'as':_0x2a3278['as'],'attributes':_0x2a3278[_0xa6de('0x1c')],'include':_0x2a3278[_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x2a3278[_0xa6de('0x1e')],function(_0x1ceed1){return{'model':db[_0x1ceed1[_0xa6de('0x20')]],'as':_0x1ceed1['as'],'attributes':_0x1ceed1[_0xa6de('0x1c')],'include':_0x1ceed1['include']?_[_0xa6de('0x1f')](_0x1ceed1[_0xa6de('0x1e')],function(_0xcd3d4f){return{'model':db[_0xcd3d4f[_0xa6de('0x20')]],'as':_0xcd3d4f['as'],'attributes':_0xcd3d4f[_0xa6de('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5131e3){logger[_0xa6de('0xe')]('ShowCmHopper',_0x1bd8dc);logger['debug'](_0xa6de('0x22'),_0x1bd8dc,JSON[_0xa6de('0x12')](_0x5131e3));_0x1499cb(_0x5131e3);})[_0xa6de('0x17')](function(_0x5e1a11){logger[_0xa6de('0x13')]('ShowCmHopper',_0x5e1a11['message'],_0x1bd8dc);_0x503283(_0x3f5ae4[_0xa6de('0x13')](0x1f4,_0x5e1a11['message']));});});};exports[_0xa6de('0x23')]=function(_0x3b95be){var _0x48de5c=this;return new Promise(function(_0xba792d,_0x560c56){return db[_0xa6de('0x19')][_0xa6de('0x24')](_0x3b95be[_0xa6de('0x25')],{'raw':_0x3b95be['options']?_0x3b95be['options'][_0xa6de('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1c191a){logger['info'](_0xa6de('0x23'),_0x3b95be);logger[_0xa6de('0x11')](_0xa6de('0x23'),_0x3b95be,JSON[_0xa6de('0x12')](_0x1c191a));_0xba792d(_0x1c191a);})[_0xa6de('0x17')](function(_0x334b45){logger['error']('CreateCmHopper',_0x334b45['message'],_0x3b95be);_0x560c56(_0x48de5c[_0xa6de('0x13')](0x1f4,_0x334b45[_0xa6de('0x15')]));});});};exports[_0xa6de('0x26')]=function(_0x2a6f1c){var _0x221b6a=this;return new Promise(function(_0x45bf7a,_0x50bfeb){return db[_0xa6de('0x19')][_0xa6de('0x27')](_0x2a6f1c['body'],{'raw':_0x2a6f1c[_0xa6de('0x1a')]?_0x2a6f1c[_0xa6de('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a6f1c[_0xa6de('0x1a')]?_0x2a6f1c['options'][_0xa6de('0x21')]||null:null,'attributes':_0x2a6f1c[_0xa6de('0x1a')]?_0x2a6f1c[_0xa6de('0x1a')]['attributes']||null:null,'limit':_0x2a6f1c[_0xa6de('0x1a')]?_0x2a6f1c[_0xa6de('0x1a')][_0xa6de('0x1d')]||null:null})[_0xa6de('0xd')](function(_0xdabb7b){logger[_0xa6de('0xe')](_0xa6de('0x26'),_0x2a6f1c);logger['debug'](_0xa6de('0x26'),_0x2a6f1c,JSON[_0xa6de('0x12')](_0xdabb7b));_0x45bf7a(_0xdabb7b);})[_0xa6de('0x17')](function(_0x27d7ed){logger[_0xa6de('0x13')](_0xa6de('0x26'),_0x27d7ed['message'],_0x2a6f1c);_0x50bfeb(_0x221b6a['error'](0x1f4,_0x27d7ed['message']));});});};exports['DestroyCmHopper']=function(_0x3fa406){var _0x49ba88=this;return new Promise(function(_0x598f7c,_0x18bd59){return db[_0xa6de('0x19')][_0xa6de('0x28')]({'where':_0x3fa406[_0xa6de('0x1a')]?_0x3fa406[_0xa6de('0x1a')][_0xa6de('0x21')]||null:null})[_0xa6de('0xd')](function(_0x35bbfc){logger[_0xa6de('0xe')]('DestroyCmHopper',_0x3fa406);logger[_0xa6de('0x11')](_0xa6de('0x29'),_0x3fa406,JSON[_0xa6de('0x12')](_0x35bbfc));_0x598f7c(_0x35bbfc);})[_0xa6de('0x17')](function(_0x2476e7){logger[_0xa6de('0x13')](_0xa6de('0x29'),_0x2476e7[_0xa6de('0x15')],_0x3fa406);_0x18bd59(_0x49ba88[_0xa6de('0x13')](0x1f4,_0x2476e7[_0xa6de('0x15')]));});});};exports[_0xa6de('0x2a')]=function(_0x2772a8){var _0x387c23=this;return new Promise(function(_0x53c332,_0x3ab877){return db[_0xa6de('0x2b')][_0xa6de('0x2c')]()[_0xa6de('0xd')](function(_0x41b058){return db[_0xa6de('0x2d')]['transaction'](function(_0x1551a1){return db[_0xa6de('0x19')][_0xa6de('0x2e')]({'where':_0x2772a8[_0xa6de('0x1a')]?_0x2772a8['options'][_0xa6de('0x21')]||null:null,'attributes':_0x2772a8['options']?_0x2772a8[_0xa6de('0x1a')]['attributes']||null:null,'limit':_0x2772a8[_0xa6de('0x1a')]?_0x2772a8[_0xa6de('0x1a')]['limit']||null:null,'order':_0x2772a8[_0xa6de('0x1a')]?_0x2772a8[_0xa6de('0x1a')][_0xa6de('0x2f')]||null:null,'transaction':_0x1551a1,'lock':_0x1551a1[_0xa6de('0x30')][_0xa6de('0x31')],'include':[{'model':db[_0xa6de('0x2b')],'as':_0xa6de('0x32'),'attributes':_[_0xa6de('0x33')](_0x41b058)},{'model':db[_0xa6de('0x34')],'as':_0xa6de('0x35'),'attributes':['id',_0xa6de('0x36'),_0xa6de('0x37')]}]})['then'](function(_0xb5ced5){var _0x54f808=[];var _0x21e256=[];for(var _0x42e816=0x0;_0x42e816<_0xb5ced5[_0xa6de('0x38')];_0x42e816+=0x1){var _0x30a0cc=_0xb5ced5[_0x42e816][_0xa6de('0x39')];if(_0x30a0cc===null){_0x54f808[_0xa6de('0x3a')](_0xb5ced5[_0x42e816][_0xa6de('0x27')](_0x2772a8[_0xa6de('0x25')],{'transaction':_0x1551a1}));}else if(!_0x21e256[_0xa6de('0x3b')](_0x30a0cc)){_0x21e256[_0xa6de('0x3a')](_0x30a0cc);_0x54f808[_0xa6de('0x3a')](_0xb5ced5[_0x42e816]['update'](_0x2772a8[_0xa6de('0x25')],{'transaction':_0x1551a1}));}}return BPromise[_0xa6de('0x3c')](_0x54f808);});})['then'](function(_0x11372f){logger[_0xa6de('0xe')](_0xa6de('0x2a'),_0x2772a8);logger['debug']('GetContactDialer',_0x2772a8,JSON['stringify'](_0x11372f));_0x53c332(_0x11372f);})['catch'](function(_0x421021){logger[_0xa6de('0x13')](_0xa6de('0x2a'),_0x421021['message'],_0x2772a8);_0x3ab877(_0x387c23[_0xa6de('0x13')](0x1f4,_0x421021[_0xa6de('0x15')]));});});});};exports[_0xa6de('0x3d')]=function(_0x5c7406){var _0x12d25f=this;return new Promise(function(_0x1766d1,_0x484b6f){return db['sequelize'][_0xa6de('0x3e')](function(_0x2715e6){return db[_0xa6de('0x3f')]['create'](_0x5c7406[_0xa6de('0x25')],{'raw':_0x5c7406[_0xa6de('0x1a')]?_0x5c7406['options'][_0xa6de('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x2715e6})[_0xa6de('0xd')](function(){return db['CmHopper'][_0xa6de('0x28')]({'where':_0x5c7406[_0xa6de('0x1a')]?_0x5c7406['options'][_0xa6de('0x21')]||null:null,'transaction':_0x2715e6});});})[_0xa6de('0xd')](function(_0x4e14cc){logger[_0xa6de('0xe')](_0xa6de('0x3d'),_0x5c7406);logger['debug']('MoveContactManagedDialer',_0x5c7406,JSON[_0xa6de('0x12')](_0x4e14cc));_0x1766d1(_0x4e14cc);})[_0xa6de('0x17')](function(_0x15d994){logger['error']('MoveContactManagedDialer',_0x15d994[_0xa6de('0x15')],_0x5c7406);_0x484b6f(_0x12d25f[_0xa6de('0x13')](0x1f4,_0x15d994['message']));});});};exports[_0xa6de('0x40')]=function(_0x589563){var _0x378a3d=this;return new Promise(function(_0x2ebe49,_0x242df5){return db['CmHopper'][_0xa6de('0x2e')]({'raw':_0x589563[_0xa6de('0x1a')]?_0x589563[_0xa6de('0x1a')][_0xa6de('0x1b')]===undefined?!![]:![]:!![],'where':_0x589563[_0xa6de('0x1a')]?_0x589563[_0xa6de('0x1a')][_0xa6de('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xa6de('0x2d')]['fn']('IF',db[_0xa6de('0x2d')][_0xa6de('0x41')](_0xa6de('0x42')+util[_0xa6de('0x43')]('\x22%s\x22',moment()['format'](_0xa6de('0x44')))+_0xa6de('0x45')))),_0xa6de('0x46')]]})['then'](function(_0x59cce7){logger['info']('CountReScheduled',_0x589563);logger[_0xa6de('0x11')](_0xa6de('0x40'),_0x589563,JSON[_0xa6de('0x12')](_0x59cce7));_0x2ebe49(_0x59cce7);})[_0xa6de('0x17')](function(_0x282144){logger[_0xa6de('0x13')](_0xa6de('0x40'),_0x282144['message'],_0x589563);_0x242df5(_0x378a3d[_0xa6de('0x13')](0x1f4,_0x282144['message']));});});};exports[_0xa6de('0x47')]=function(_0x59cf8e){var _0x1437a1=this;return new Promise(function(_0x874d1b,_0x5100ac){return db['CmContact'][_0xa6de('0x2c')]()[_0xa6de('0xd')](function(_0x1ed057){return db[_0xa6de('0x2d')][_0xa6de('0x3e')](function(_0x1e1ab3){return db[_0xa6de('0x19')][_0xa6de('0x2e')]({'where':_0x59cf8e[_0xa6de('0x1a')]?_0x59cf8e['options']['where']||null:null,'attributes':_0x59cf8e['options']?_0x59cf8e[_0xa6de('0x1a')][_0xa6de('0x1c')]||null:null,'limit':0x1,'order':_0x59cf8e['options']?_0x59cf8e['options'][_0xa6de('0x2f')]||null:null,'group':db[_0xa6de('0x19')][_0xa6de('0x39')],'transaction':_0x1e1ab3,'lock':_0x1e1ab3[_0xa6de('0x30')][_0xa6de('0x31')],'include':_0x59cf8e['options']?_0x59cf8e['options']['include']?_[_0xa6de('0x1f')](_0x59cf8e[_0xa6de('0x1a')][_0xa6de('0x1e')],function(_0x384491){return{'model':db[_0x384491[_0xa6de('0x20')]],'as':_0x384491['as'],'attributes':_0x384491['attributes'],'include':_0x384491['include']?_[_0xa6de('0x1f')](_0x384491[_0xa6de('0x1e')],function(_0x4494ee){return{'model':db[_0x4494ee[_0xa6de('0x20')]],'as':_0x4494ee['as'],'attributes':_0x4494ee[_0xa6de('0x1c')],'include':_0x4494ee['include']?_['map'](_0x4494ee[_0xa6de('0x1e')],function(_0x5b7f2b){return{'model':db[_0x5b7f2b[_0xa6de('0x20')]],'as':_0x5b7f2b['as'],'attributes':_0x5b7f2b[_0xa6de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa6de('0xd')](function(_0x219c0a){var _0x4f22fc=[];for(var _0x30e3a6=0x0;_0x30e3a6<_0x219c0a[_0xa6de('0x38')];_0x30e3a6+=0x1){_0x4f22fc[_0xa6de('0x3a')](_0x219c0a[_0x30e3a6][_0xa6de('0x27')](_0x59cf8e[_0xa6de('0x25')],{'transaction':_0x1e1ab3}));}return BPromise['all'](_0x4f22fc);});})[_0xa6de('0xd')](function(_0x97fdaf){logger[_0xa6de('0xe')](_0xa6de('0x47'),_0x59cf8e);logger[_0xa6de('0x11')](_0xa6de('0x47'),_0x59cf8e,JSON[_0xa6de('0x12')](_0x97fdaf));_0x874d1b(_0x97fdaf);})[_0xa6de('0x17')](function(_0x34e7f4){logger[_0xa6de('0x13')](_0xa6de('0x47'),_0x34e7f4[_0xa6de('0x15')],_0x59cf8e);_0x5100ac(_0x1437a1['error'](0x1f4,_0x34e7f4['message']));});});});};exports[_0xa6de('0x48')]=function(_0xcac93a){var _0x14728e=this;return new Promise(function(_0x5b0ece,_0x384be6){db[_0xa6de('0x2b')][_0xa6de('0x2c')]()['then'](function(_0x76a80d){return db['CmHopper'][_0xa6de('0x2e')]({'raw':_0xcac93a[_0xa6de('0x1a')]?_0xcac93a['options']['raw']===undefined?!![]:![]:!![],'where':_0xcac93a['options']?_0xcac93a[_0xa6de('0x1a')][_0xa6de('0x21')]||null:null,'attributes':_0xcac93a['options']?_0xcac93a[_0xa6de('0x1a')]['attributes']||null:null,'limit':_0xcac93a[_0xa6de('0x1a')]?_0xcac93a['options'][_0xa6de('0x1d')]||null:null,'include':_0xcac93a[_0xa6de('0x1a')]?_0xcac93a[_0xa6de('0x1a')]['include']?_['map'](_0xcac93a['options'][_0xa6de('0x1e')],function(_0x3b48e0){return{'model':db[_0x3b48e0[_0xa6de('0x20')]],'as':_0x3b48e0['as'],'attributes':_0x3b48e0['as']===_0xa6de('0x32')?_[_0xa6de('0x33')](_0x76a80d):_0x3b48e0[_0xa6de('0x1c')],'include':_0x3b48e0[_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x3b48e0[_0xa6de('0x1e')],function(_0x19f6a6){return{'model':db[_0x19f6a6[_0xa6de('0x20')]],'as':_0x19f6a6['as'],'attributes':_0x19f6a6[_0xa6de('0x1c')],'include':_0x19f6a6[_0xa6de('0x1e')]?_[_0xa6de('0x1f')](_0x19f6a6[_0xa6de('0x1e')],function(_0x18c7bb){return{'model':db[_0x18c7bb[_0xa6de('0x20')]],'as':_0x18c7bb['as'],'attributes':_0x18c7bb[_0xa6de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa6de('0xd')](function(_0x2e5481){logger[_0xa6de('0xe')](_0xa6de('0x18'),_0xcac93a);logger[_0xa6de('0x11')](_0xa6de('0x18'),_0xcac93a,JSON['stringify'](_0x2e5481));_0x5b0ece(_0x2e5481);})['catch'](function(_0x248bee){logger['error'](_0xa6de('0x18'),_0x248bee['message'],_0xcac93a);_0x384be6(_0x14728e[_0xa6de('0x13')](0x1f4,_0x248bee[_0xa6de('0x15')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c456239..230783e 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 _0xa8c3=['../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0xa8c3,0x1ad));var _0x3a8c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa8c3[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x3a8c('0x0'));var util=require(_0x3a8c('0x1'));var path=require(_0x3a8c('0x2'));var timeout=require(_0x3a8c('0x3'));var express=require(_0x3a8c('0x4'));var router=express[_0x3a8c('0x5')]();var fs_extra=require(_0x3a8c('0x6'));var auth=require(_0x3a8c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3a8c('0x8'));var controller=require(_0x3a8c('0x9'));router[_0x3a8c('0xa')]('/',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xc')]);router[_0x3a8c('0xa')]('/describe',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xd')]);router[_0x3a8c('0xa')](_0x3a8c('0xe'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0xf')]);router[_0x3a8c('0xa')]('/:id',auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x10')]);router['post']('/',auth[_0x3a8c('0xb')](),controller['create']);router[_0x3a8c('0x11')]('/preview',auth[_0x3a8c('0xb')](),controller['getPreview']);router[_0x3a8c('0x12')](_0x3a8c('0x13'),auth[_0x3a8c('0xb')](),controller[_0x3a8c('0x14')]);router['delete'](_0x3a8c('0x13'),auth['isAuthenticated'](),controller[_0x3a8c('0x15')]);module[_0x3a8c('0x16')]=router; \ No newline at end of file +var _0x69bf=['put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','describe','get','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview'];(function(_0x1e4787,_0x1dfb29){var _0x834e95=function(_0x15a6ed){while(--_0x15a6ed){_0x1e4787['push'](_0x1e4787['shift']());}};_0x834e95(++_0x1dfb29);}(_0x69bf,0xec));var _0xf69b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69bf[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xf69b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf69b('0x1'));var express=require(_0xf69b('0x2'));var router=express['Router']();var fs_extra=require(_0xf69b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf69b('0x4'));var config=require(_0xf69b('0x5'));var controller=require(_0xf69b('0x6'));router['get']('/',auth[_0xf69b('0x7')](),controller['index']);router['get']('/describe',auth[_0xf69b('0x7')](),controller[_0xf69b('0x8')]);router[_0xf69b('0x9')](_0xf69b('0xa'),auth['isAuthenticated'](),controller[_0xf69b('0xb')]);router[_0xf69b('0x9')]('/:id',auth[_0xf69b('0x7')](),controller[_0xf69b('0xc')]);router[_0xf69b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf69b('0xe')]);router[_0xf69b('0xd')](_0xf69b('0xf'),auth['isAuthenticated'](),controller[_0xf69b('0x10')]);router[_0xf69b('0x11')]('/:id',auth[_0xf69b('0x7')](),controller[_0xf69b('0x12')]);router[_0xf69b('0x13')](_0xf69b('0x14'),auth[_0xf69b('0x7')](),controller[_0xf69b('0x15')]);module[_0xf69b('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 7673c12..72726c3 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 _0x943a=['moment','STRING','INTEGER','contactListQueue'];(function(_0x382f6d,_0x7e176){var _0x3392d3=function(_0x3892ab){while(--_0x3892ab){_0x382f6d['push'](_0x382f6d['shift']());}};_0x3392d3(++_0x7e176);}(_0x943a,0xfc));var _0xa943=function(_0x2c5a7e,_0x51120b){_0x2c5a7e=_0x2c5a7e-0x0;var _0x379f64=_0x943a[_0x2c5a7e];return _0x379f64;};'use strict';var moment=require(_0xa943('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xa943('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa943('0x2')],'unique':_0xa943('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xa943('0x2')],'unique':_0xa943('0x3')}}; \ No newline at end of file +var _0x0699=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x201304,_0x13e171){var _0x2396d1=function(_0x28f3a5){while(--_0x28f3a5){_0x201304['push'](_0x201304['shift']());}};_0x2396d1(++_0x13e171);}(_0x0699,0x181));var _0x9069=function(_0x1fa797,_0x974af7){_0x1fa797=_0x1fa797-0x0;var _0x3ae389=_0x0699[_0x1fa797];return _0x3ae389;};'use strict';var moment=require(_0x9069('0x0'));var Sequelize=require(_0x9069('0x1'));module[_0x9069('0x2')]={'phone':{'type':Sequelize[_0x9069('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9069('0x4')},'ListId':{'type':Sequelize[_0x9069('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x9069('0x5')],'unique':_0x9069('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 7c587db..f35b749 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 _0x963e=['undefined','limit','count','set','apply','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','CmHopperBlack','includeAll','rows','catch','show','params','body','find','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset'];(function(_0xbbe5c8,_0x1d1a27){var _0x54c261=function(_0x99bedc){while(--_0x99bedc){_0xbbe5c8['push'](_0xbbe5c8['shift']());}};_0x54c261(++_0x1d1a27);}(_0x963e,0xad));var _0xe963=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x963e[_0x5a7f64];return _0x3d30f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe963('0x0'));var jsonpatch=require(_0xe963('0x1'));var rp=require('request-promise');var moment=require(_0xe963('0x2'));var BPromise=require(_0xe963('0x3'));var Mustache=require(_0xe963('0x4'));var util=require('util');var path=require(_0xe963('0x5'));var sox=require(_0xe963('0x6'));var csv=require('to-csv');var ejs=require(_0xe963('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe963('0x8'));var crypto=require(_0xe963('0x9'));var jsforce=require(_0xe963('0xa'));var deskjs=require(_0xe963('0xb'));var toCsv=require(_0xe963('0xc'));var querystring=require('querystring');var Papa=require(_0xe963('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe963('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe963('0xf'));var logger=require(_0xe963('0x10'))(_0xe963('0x11'));var utils=require(_0xe963('0x12'));var config=require(_0xe963('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29cbf4,_0x4b4738){_0x4b4738=_0x4b4738||0xcc;return function(_0x14e9bf){if(_0x14e9bf){return _0x29cbf4[_0xe963('0x14')](_0x4b4738);}return _0x29cbf4[_0xe963('0x15')](_0x4b4738)[_0xe963('0x16')]();};}function respondWithResult(_0x1a282b,_0x18bdb){_0x18bdb=_0x18bdb||0xc8;return function(_0x49e7df){if(_0x49e7df){return _0x1a282b['status'](_0x18bdb)[_0xe963('0x17')](_0x49e7df);}};}function respondWithFilteredResult(_0x4eb700,_0x257843){return function(_0x8d147f){if(_0x8d147f){var _0x3bf916=typeof _0x257843[_0xe963('0x18')]===_0xe963('0x19')&&typeof _0x257843[_0xe963('0x1a')]===_0xe963('0x19');var _0x270450=_0x8d147f[_0xe963('0x1b')];var _0x2b368c=_0x3bf916?0x0:_0x257843[_0xe963('0x18')];var _0xc68a9f=_0x3bf916?_0x8d147f[_0xe963('0x1b')]:_0x257843[_0xe963('0x18')]+_0x257843[_0xe963('0x1a')];var _0x519f9f;if(_0xc68a9f>=_0x270450){_0xc68a9f=_0x270450;_0x519f9f=0xc8;}else{_0x519f9f=0xce;}_0x4eb700[_0xe963('0x15')](_0x519f9f);return _0x4eb700[_0xe963('0x1c')]('Content-Range',_0x2b368c+'-'+_0xc68a9f+'/'+_0x270450)[_0xe963('0x17')](_0x8d147f);}return null;};}function patchUpdates(_0x38c66c){return function(_0x2e2ae4){try{jsonpatch[_0xe963('0x1d')](_0x2e2ae4,_0x38c66c,!![]);}catch(_0x1e7c33){return BPromise[_0xe963('0x1e')](_0x1e7c33);}return _0x2e2ae4[_0xe963('0x1f')]();};}function saveUpdates(_0x1438cf,_0xcfac5){return function(_0x3ecf3c){if(_0x3ecf3c){return _0x3ecf3c['update'](_0x1438cf)[_0xe963('0x20')](function(_0x5a0b06){return _0x5a0b06;});}return null;};}function removeEntity(_0x33397f,_0x329341){return function(_0x381940){if(_0x381940){return _0x381940[_0xe963('0x21')]()[_0xe963('0x20')](function(){_0x33397f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x140918,_0x5e1c69){return function(_0x38de38){if(!_0x38de38){_0x140918['sendStatus'](0x194);}return _0x38de38;};}function handleError(_0xd363d2,_0xc98863){_0xc98863=_0xc98863||0x1f4;return function(_0x547cfa){logger[_0xe963('0x22')](_0x547cfa['stack']);if(_0x547cfa['name']){delete _0x547cfa[_0xe963('0x23')];}_0xd363d2[_0xe963('0x15')](_0xc98863)['send'](_0x547cfa);};}exports[_0xe963('0x24')]=function(_0xf5f869,_0x820999){var _0x156078={},_0x21d1e7={},_0x234d40={'count':0x0,'rows':[]};var _0x426ace=_[_0xe963('0x25')](db['CmHopperBlack'][_0xe963('0x26')],function(_0x46897f){return{'name':_0x46897f[_0xe963('0x27')],'type':_0x46897f['type']['key']};});_0x21d1e7[_0xe963('0x28')]=_[_0xe963('0x25')](_0x426ace,_0xe963('0x23'));_0x21d1e7[_0xe963('0x29')]=_[_0xe963('0x2a')](_0xf5f869[_0xe963('0x29')]);_0x21d1e7[_0xe963('0x2b')]=_[_0xe963('0x2c')](_0x21d1e7[_0xe963('0x28')],_0x21d1e7[_0xe963('0x29')]);_0x156078['attributes']=_[_0xe963('0x2c')](_0x21d1e7[_0xe963('0x28')],qs['fields'](_0xf5f869[_0xe963('0x29')][_0xe963('0x2d')]));_0x156078[_0xe963('0x2e')]=_0x156078[_0xe963('0x2e')][_0xe963('0x2f')]?_0x156078[_0xe963('0x2e')]:_0x21d1e7['model'];if(!_0xf5f869['query'][_0xe963('0x30')]('nolimit')){_0x156078['limit']=qs[_0xe963('0x1a')](_0xf5f869[_0xe963('0x29')][_0xe963('0x1a')]);_0x156078['offset']=qs['offset'](_0xf5f869[_0xe963('0x29')][_0xe963('0x18')]);}_0x156078[_0xe963('0x31')]=qs[_0xe963('0x32')](_0xf5f869['query'][_0xe963('0x32')]);_0x156078[_0xe963('0x33')]=qs['filters'](_[_0xe963('0x34')](_0xf5f869[_0xe963('0x29')],_0x21d1e7[_0xe963('0x2b')]),_0x426ace);if(_0xf5f869[_0xe963('0x29')][_0xe963('0x35')]){_0x156078[_0xe963('0x33')]=_[_0xe963('0x36')](_0x156078['where'],{'$or':_[_0xe963('0x25')](_0x426ace,function(_0x14ac65){if(_0x14ac65[_0xe963('0x37')]!=='VIRTUAL'){var _0x47e0bf={};_0x47e0bf[_0x14ac65[_0xe963('0x23')]]={'$like':'%'+_0xf5f869[_0xe963('0x29')][_0xe963('0x35')]+'%'};return _0x47e0bf;}})});}_0x156078=_[_0xe963('0x36')]({},_0x156078,_0xf5f869[_0xe963('0x38')]);var _0x19d0df={'where':_0x156078[_0xe963('0x33')]};return db[_0xe963('0x39')][_0xe963('0x1b')](_0x19d0df)[_0xe963('0x20')](function(_0x11eeb9){_0x234d40[_0xe963('0x1b')]=_0x11eeb9;if(_0xf5f869['query'][_0xe963('0x3a')]){_0x156078['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x156078);})[_0xe963('0x20')](function(_0x227d32){_0x234d40[_0xe963('0x3b')]=_0x227d32;return _0x234d40;})[_0xe963('0x20')](respondWithFilteredResult(_0x820999,_0x156078))[_0xe963('0x3c')](handleError(_0x820999,null));};exports[_0xe963('0x3d')]=function(_0x101335,_0x3f1ab1){var _0x4f7e2b={'raw':!![],'where':{'id':_0x101335[_0xe963('0x3e')]['id']}},_0x4f4b11={};_0x4f4b11['model']=_[_0xe963('0x2a')](db[_0xe963('0x39')]['rawAttributes']);_0x4f4b11[_0xe963('0x29')]=_[_0xe963('0x2a')](_0x101335[_0xe963('0x29')]);_0x4f4b11[_0xe963('0x2b')]=_[_0xe963('0x2c')](_0x4f4b11[_0xe963('0x28')],_0x4f4b11[_0xe963('0x29')]);_0x4f7e2b['attributes']=_[_0xe963('0x2c')](_0x4f4b11[_0xe963('0x28')],qs[_0xe963('0x2d')](_0x101335['query'][_0xe963('0x2d')]));_0x4f7e2b['attributes']=_0x4f7e2b[_0xe963('0x2e')][_0xe963('0x2f')]?_0x4f7e2b[_0xe963('0x2e')]:_0x4f4b11['model'];if(_0x101335[_0xe963('0x29')][_0xe963('0x3a')]){_0x4f7e2b['include']=[{'all':!![]}];}_0x4f7e2b=_[_0xe963('0x36')]({},_0x4f7e2b,_0x101335[_0xe963('0x38')]);return db[_0xe963('0x39')]['find'](_0x4f7e2b)[_0xe963('0x20')](handleEntityNotFound(_0x3f1ab1,null))['then'](respondWithResult(_0x3f1ab1,null))[_0xe963('0x3c')](handleError(_0x3f1ab1,null));};exports['update']=function(_0x42a825,_0x345302){if(_0x42a825[_0xe963('0x3f')]['id']){delete _0x42a825[_0xe963('0x3f')]['id'];}return db[_0xe963('0x39')][_0xe963('0x40')]({'where':{'id':_0x42a825[_0xe963('0x3e')]['id']}})[_0xe963('0x20')](handleEntityNotFound(_0x345302,null))['then'](saveUpdates(_0x42a825['body'],null))[_0xe963('0x20')](respondWithResult(_0x345302,null))[_0xe963('0x3c')](handleError(_0x345302,null));};exports[_0xe963('0x21')]=function(_0x58cdb6,_0x3376e6){return db[_0xe963('0x39')][_0xe963('0x40')]({'where':{'id':_0x58cdb6[_0xe963('0x3e')]['id']}})[_0xe963('0x20')](handleEntityNotFound(_0x3376e6,null))[_0xe963('0x20')](removeEntity(_0x3376e6,null))[_0xe963('0x3c')](handleError(_0x3376e6,null));};exports['describe']=function(_0x38243d,_0x34065e){return db[_0xe963('0x39')][_0xe963('0x41')]()[_0xe963('0x20')](respondWithResult(_0x34065e,null))[_0xe963('0x3c')](handleError(_0x34065e,null));}; \ No newline at end of file +var _0x95f7=['set','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','CmHopperBlack','count','includeAll','include','findAll','rows','catch','show','params','merge','options','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit'];(function(_0x161451,_0x1c81d0){var _0x55fe0c=function(_0x35d316){while(--_0x35d316){_0x161451['push'](_0x161451['shift']());}};_0x55fe0c(++_0x1c81d0);}(_0x95f7,0x143));var _0x795f=function(_0x47390b,_0x168906){_0x47390b=_0x47390b-0x0;var _0x550583=_0x95f7[_0x47390b];return _0x550583;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x795f('0x0'));var jsonpatch=require(_0x795f('0x1'));var rp=require(_0x795f('0x2'));var moment=require(_0x795f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x795f('0x4'));var path=require(_0x795f('0x5'));var sox=require('sox');var csv=require(_0x795f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x795f('0x7'));var _=require(_0x795f('0x8'));var squel=require(_0x795f('0x9'));var crypto=require(_0x795f('0xa'));var jsforce=require(_0x795f('0xb'));var deskjs=require(_0x795f('0xc'));var toCsv=require(_0x795f('0x6'));var querystring=require(_0x795f('0xd'));var Papa=require('papaparse');var Redis=require(_0x795f('0xe'));var authService=require(_0x795f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x795f('0x10'));var logger=require(_0x795f('0x11'))(_0x795f('0x12'));var utils=require(_0x795f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x795f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a184d,_0x153f2c){_0x153f2c=_0x153f2c||0xcc;return function(_0x3581d1){if(_0x3581d1){return _0x5a184d[_0x795f('0x15')](_0x153f2c);}return _0x5a184d[_0x795f('0x16')](_0x153f2c)[_0x795f('0x17')]();};}function respondWithResult(_0x502ac7,_0x523df8){_0x523df8=_0x523df8||0xc8;return function(_0x47fc51){if(_0x47fc51){return _0x502ac7['status'](_0x523df8)['json'](_0x47fc51);}};}function respondWithFilteredResult(_0x325ba6,_0x42726b){return function(_0x2b457e){if(_0x2b457e){var _0x478d8e=typeof _0x42726b[_0x795f('0x18')]===_0x795f('0x19')&&typeof _0x42726b[_0x795f('0x1a')]===_0x795f('0x19');var _0x4faf36=_0x2b457e['count'];var _0x10d4ac=_0x478d8e?0x0:_0x42726b['offset'];var _0x2d574f=_0x478d8e?_0x2b457e['count']:_0x42726b['offset']+_0x42726b['limit'];var _0x3164ea;if(_0x2d574f>=_0x4faf36){_0x2d574f=_0x4faf36;_0x3164ea=0xc8;}else{_0x3164ea=0xce;}_0x325ba6['status'](_0x3164ea);return _0x325ba6[_0x795f('0x1b')]('Content-Range',_0x10d4ac+'-'+_0x2d574f+'/'+_0x4faf36)['json'](_0x2b457e);}return null;};}function patchUpdates(_0x4ef871){return function(_0x5c7b73){try{jsonpatch[_0x795f('0x1c')](_0x5c7b73,_0x4ef871,!![]);}catch(_0x28e273){return BPromise['reject'](_0x28e273);}return _0x5c7b73[_0x795f('0x1d')]();};}function saveUpdates(_0x12eaf2,_0xf69d32){return function(_0x5de270){if(_0x5de270){return _0x5de270[_0x795f('0x1e')](_0x12eaf2)['then'](function(_0x515f56){return _0x515f56;});}return null;};}function removeEntity(_0x3ed390,_0x206cc6){return function(_0x538936){if(_0x538936){return _0x538936[_0x795f('0x1f')]()[_0x795f('0x20')](function(){_0x3ed390[_0x795f('0x16')](0xcc)[_0x795f('0x17')]();});}};}function handleEntityNotFound(_0x482dd0,_0x2e16d4){return function(_0x29c3e9){if(!_0x29c3e9){_0x482dd0['sendStatus'](0x194);}return _0x29c3e9;};}function handleError(_0x2e23dd,_0x34e489){_0x34e489=_0x34e489||0x1f4;return function(_0x1c6cff){logger[_0x795f('0x21')](_0x1c6cff[_0x795f('0x22')]);if(_0x1c6cff[_0x795f('0x23')]){delete _0x1c6cff[_0x795f('0x23')];}_0x2e23dd[_0x795f('0x16')](_0x34e489)[_0x795f('0x24')](_0x1c6cff);};}exports[_0x795f('0x25')]=function(_0x426b41,_0x38d060){var _0x187422={},_0x54a6cb={},_0x16fdf6={'count':0x0,'rows':[]};var _0x4399dc=_['map'](db['CmHopperBlack'][_0x795f('0x26')],function(_0x2859f6){return{'name':_0x2859f6['fieldName'],'type':_0x2859f6[_0x795f('0x27')][_0x795f('0x28')]};});_0x54a6cb[_0x795f('0x29')]=_[_0x795f('0x2a')](_0x4399dc,_0x795f('0x23'));_0x54a6cb[_0x795f('0x2b')]=_[_0x795f('0x2c')](_0x426b41['query']);_0x54a6cb['filters']=_[_0x795f('0x2d')](_0x54a6cb[_0x795f('0x29')],_0x54a6cb[_0x795f('0x2b')]);_0x187422[_0x795f('0x2e')]=_['intersection'](_0x54a6cb[_0x795f('0x29')],qs[_0x795f('0x2f')](_0x426b41[_0x795f('0x2b')][_0x795f('0x2f')]));_0x187422['attributes']=_0x187422[_0x795f('0x2e')][_0x795f('0x30')]?_0x187422[_0x795f('0x2e')]:_0x54a6cb[_0x795f('0x29')];if(!_0x426b41[_0x795f('0x2b')]['hasOwnProperty'](_0x795f('0x31'))){_0x187422['limit']=qs[_0x795f('0x1a')](_0x426b41[_0x795f('0x2b')][_0x795f('0x1a')]);_0x187422[_0x795f('0x18')]=qs['offset'](_0x426b41[_0x795f('0x2b')][_0x795f('0x18')]);}_0x187422[_0x795f('0x32')]=qs[_0x795f('0x33')](_0x426b41[_0x795f('0x2b')]['sort']);_0x187422[_0x795f('0x34')]=qs[_0x795f('0x35')](_[_0x795f('0x36')](_0x426b41[_0x795f('0x2b')],_0x54a6cb[_0x795f('0x35')]),_0x4399dc);if(_0x426b41[_0x795f('0x2b')]['filter']){_0x187422[_0x795f('0x34')]=_['merge'](_0x187422[_0x795f('0x34')],{'$or':_[_0x795f('0x2a')](_0x4399dc,function(_0x2067e2){if(_0x2067e2[_0x795f('0x27')]!=='VIRTUAL'){var _0x524614={};_0x524614[_0x2067e2[_0x795f('0x23')]]={'$like':'%'+_0x426b41[_0x795f('0x2b')][_0x795f('0x37')]+'%'};return _0x524614;}})});}_0x187422=_['merge']({},_0x187422,_0x426b41['options']);var _0x34a9e1={'where':_0x187422[_0x795f('0x34')]};return db[_0x795f('0x38')][_0x795f('0x39')](_0x34a9e1)[_0x795f('0x20')](function(_0x53bc3b){_0x16fdf6[_0x795f('0x39')]=_0x53bc3b;if(_0x426b41[_0x795f('0x2b')][_0x795f('0x3a')]){_0x187422[_0x795f('0x3b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x795f('0x3c')](_0x187422);})[_0x795f('0x20')](function(_0x57734e){_0x16fdf6[_0x795f('0x3d')]=_0x57734e;return _0x16fdf6;})[_0x795f('0x20')](respondWithFilteredResult(_0x38d060,_0x187422))[_0x795f('0x3e')](handleError(_0x38d060,null));};exports[_0x795f('0x3f')]=function(_0x5efbb3,_0x3e550f){var _0xeac9d6={'raw':!![],'where':{'id':_0x5efbb3[_0x795f('0x40')]['id']}},_0x35a90b={};_0x35a90b['model']=_[_0x795f('0x2c')](db['CmHopperBlack'][_0x795f('0x26')]);_0x35a90b[_0x795f('0x2b')]=_[_0x795f('0x2c')](_0x5efbb3[_0x795f('0x2b')]);_0x35a90b[_0x795f('0x35')]=_[_0x795f('0x2d')](_0x35a90b[_0x795f('0x29')],_0x35a90b[_0x795f('0x2b')]);_0xeac9d6[_0x795f('0x2e')]=_[_0x795f('0x2d')](_0x35a90b[_0x795f('0x29')],qs[_0x795f('0x2f')](_0x5efbb3[_0x795f('0x2b')]['fields']));_0xeac9d6[_0x795f('0x2e')]=_0xeac9d6['attributes'][_0x795f('0x30')]?_0xeac9d6['attributes']:_0x35a90b['model'];if(_0x5efbb3['query'][_0x795f('0x3a')]){_0xeac9d6[_0x795f('0x3b')]=[{'all':!![]}];}_0xeac9d6=_[_0x795f('0x41')]({},_0xeac9d6,_0x5efbb3[_0x795f('0x42')]);return db[_0x795f('0x38')][_0x795f('0x43')](_0xeac9d6)['then'](handleEntityNotFound(_0x3e550f,null))['then'](respondWithResult(_0x3e550f,null))['catch'](handleError(_0x3e550f,null));};exports[_0x795f('0x1e')]=function(_0x43d566,_0x15fc2f){if(_0x43d566[_0x795f('0x44')]['id']){delete _0x43d566[_0x795f('0x44')]['id'];}return db['CmHopperBlack'][_0x795f('0x43')]({'where':{'id':_0x43d566[_0x795f('0x40')]['id']}})[_0x795f('0x20')](handleEntityNotFound(_0x15fc2f,null))['then'](saveUpdates(_0x43d566[_0x795f('0x44')],null))[_0x795f('0x20')](respondWithResult(_0x15fc2f,null))['catch'](handleError(_0x15fc2f,null));};exports[_0x795f('0x1f')]=function(_0x6e935f,_0x17ab54){return db['CmHopperBlack'][_0x795f('0x43')]({'where':{'id':_0x6e935f[_0x795f('0x40')]['id']}})[_0x795f('0x20')](handleEntityNotFound(_0x17ab54,null))[_0x795f('0x20')](removeEntity(_0x17ab54,null))[_0x795f('0x3e')](handleError(_0x17ab54,null));};exports[_0x795f('0x45')]=function(_0xc287f4,_0x358e12){return db[_0x795f('0x38')]['describe']()['then'](respondWithResult(_0x358e12,null))[_0x795f('0x3e')](handleError(_0x358e12,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7a56e18..d78e83b 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 _0xc743=['request-promise','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0x3c37c9,_0x2e6c3a){var _0x51e91d=function(_0x49c46a){while(--_0x49c46a){_0x3c37c9['push'](_0x3c37c9['shift']());}};_0x51e91d(++_0x2e6c3a);}(_0xc743,0xeb));var _0x3c74=function(_0x5325b3,_0x5b3ad7){_0x5325b3=_0x5325b3-0x0;var _0x3cbb29=_0xc743[_0x5325b3];return _0x3cbb29;};'use strict';var _=require(_0x3c74('0x0'));var util=require(_0x3c74('0x1'));var logger=require('../../config/logger')(_0x3c74('0x2'));var moment=require(_0x3c74('0x3'));var BPromise=require(_0x3c74('0x4'));var rp=require(_0x3c74('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c74('0x6'));var config=require(_0x3c74('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x3c74('0x8')]=function(_0x77724b,_0x22f8c9){return _0x77724b[_0x3c74('0x9')](_0x3c74('0xa'),attributes,{'tableName':_0x3c74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf350=['api','moment','bluebird','path','rimraf','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x2efe1b,_0x3269cd){var _0x46bb37=function(_0x415d8b){while(--_0x415d8b){_0x2efe1b['push'](_0x2efe1b['shift']());}};_0x46bb37(++_0x3269cd);}(_0xf350,0x1e9));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0f35('0x0'));var util=require(_0x0f35('0x1'));var logger=require(_0x0f35('0x2'))(_0x0f35('0x3'));var moment=require(_0x0f35('0x4'));var BPromise=require(_0x0f35('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f35('0x6'));var rimraf=require(_0x0f35('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x0f35('0x8')]=function(_0x52ef3f,_0x3c128b){return _0x52ef3f[_0x0f35('0x9')](_0x0f35('0xa'),attributes,{'tableName':_0x0f35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 63a192d..82dd73d 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 _0x2820=['ioredis','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','map','include','model','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','util','bluebird','randomstring'];(function(_0x5aa28c,_0x505a05){var _0x23345b=function(_0x59735a){while(--_0x59735a){_0x5aa28c['push'](_0x5aa28c['shift']());}};_0x23345b(++_0x505a05);}(_0x2820,0x81));var _0x0282=function(_0x4e8eb0,_0xd2889d){_0x4e8eb0=_0x4e8eb0-0x0;var _0x5e586d=_0x2820[_0x4e8eb0];return _0x5e586d;};'use strict';var _=require('lodash');var util=require(_0x0282('0x0'));var moment=require('moment');var BPromise=require(_0x0282('0x1'));var rs=require(_0x0282('0x2'));var fs=require('fs');var Redis=require(_0x0282('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0282('0x4'))('rpc');var config=require(_0x0282('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0282('0x6')][_0x0282('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c0d45,_0x2e16c4,_0xdddfb5){return new BPromise(function(_0x15c62f,_0x4aa68d){return client[_0x0282('0x8')](_0x3c0d45,_0xdddfb5)[_0x0282('0x9')](function(_0x38138a){logger[_0x0282('0xa')](_0x0282('0xb'),_0x2e16c4,_0x0282('0xc'));logger[_0x0282('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2e16c4,_0x0282('0xc'),JSON[_0x0282('0xe')](_0x38138a));if(_0x38138a[_0x0282('0xf')]){if(_0x38138a[_0x0282('0xf')][_0x0282('0x10')]===0x1f4){logger['error'](_0x0282('0xb'),_0x2e16c4,_0x38138a[_0x0282('0xf')]['message']);return _0x4aa68d(_0x38138a[_0x0282('0xf')][_0x0282('0x11')]);}logger[_0x0282('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x2e16c4,_0x38138a[_0x0282('0xf')][_0x0282('0x11')]);return _0x15c62f(_0x38138a[_0x0282('0xf')][_0x0282('0x11')]);}else{logger[_0x0282('0xa')](_0x0282('0xb'),_0x2e16c4,_0x0282('0xc'));_0x15c62f(_0x38138a[_0x0282('0x12')]['message']);}})[_0x0282('0x13')](function(_0x2c82b2){logger[_0x0282('0xf')](_0x0282('0xb'),_0x2e16c4,_0x2c82b2);_0x4aa68d(_0x2c82b2);});});}exports[_0x0282('0x14')]=function(_0x28fd04){var _0x4b21a6=this;return new Promise(function(_0x32a287,_0x4ea9d3){return db[_0x0282('0x15')]['findAll']({'raw':_0x28fd04[_0x0282('0x16')]?_0x28fd04[_0x0282('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x28fd04['options']?_0x28fd04['options'][_0x0282('0x17')]||null:null,'attributes':_0x28fd04[_0x0282('0x16')]?_0x28fd04[_0x0282('0x16')][_0x0282('0x18')]||null:null,'limit':_0x28fd04['options']?_0x28fd04[_0x0282('0x16')]['limit']||null:null,'include':_0x28fd04['options']?_0x28fd04[_0x0282('0x16')]['include']?_[_0x0282('0x19')](_0x28fd04[_0x0282('0x16')][_0x0282('0x1a')],function(_0x4d0471){return{'model':db[_0x4d0471[_0x0282('0x1b')]],'as':_0x4d0471['as'],'attributes':_0x4d0471[_0x0282('0x18')],'include':_0x4d0471[_0x0282('0x1a')]?_[_0x0282('0x19')](_0x4d0471[_0x0282('0x1a')],function(_0x43ea87){return{'model':db[_0x43ea87['model']],'as':_0x43ea87['as'],'attributes':_0x43ea87[_0x0282('0x18')],'include':_0x43ea87['include']?_['map'](_0x43ea87[_0x0282('0x1a')],function(_0x12094c){return{'model':db[_0x12094c[_0x0282('0x1b')]],'as':_0x12094c['as'],'attributes':_0x12094c[_0x0282('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0282('0x9')](function(_0x5d4f93){logger['info']('GetCmHopperBlack',_0x28fd04);logger[_0x0282('0xd')]('GetCmHopperBlack',_0x28fd04,JSON[_0x0282('0xe')](_0x5d4f93));_0x32a287(_0x5d4f93);})['catch'](function(_0xe998a7){logger[_0x0282('0xf')]('GetCmHopperBlack',_0xe998a7[_0x0282('0x11')],_0x28fd04);_0x4ea9d3(_0x4b21a6[_0x0282('0xf')](0x1f4,_0xe998a7[_0x0282('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x1f4b90){var _0x4e35fe=this;return new Promise(function(_0x56e0a4,_0x2f2ba7){return db[_0x0282('0x15')][_0x0282('0x1c')](_0x1f4b90[_0x0282('0x1d')],{'raw':_0x1f4b90['options']?_0x1f4b90[_0x0282('0x16')][_0x0282('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f4b90[_0x0282('0x16')]?_0x1f4b90[_0x0282('0x16')][_0x0282('0x17')]||null:null,'attributes':_0x1f4b90[_0x0282('0x16')]?_0x1f4b90[_0x0282('0x16')][_0x0282('0x18')]||null:null,'limit':_0x1f4b90[_0x0282('0x16')]?_0x1f4b90[_0x0282('0x16')]['limit']||null:null})[_0x0282('0x9')](function(_0x35be84){logger['info'](_0x0282('0x1f'),_0x1f4b90);logger[_0x0282('0xd')](_0x0282('0x1f'),_0x1f4b90,JSON[_0x0282('0xe')](_0x35be84));_0x56e0a4(_0x35be84);})[_0x0282('0x13')](function(_0x56e64d){logger[_0x0282('0xf')](_0x0282('0x1f'),_0x56e64d['message'],_0x1f4b90);_0x2f2ba7(_0x4e35fe['error'](0x1f4,_0x56e64d[_0x0282('0x11')]));});});};exports[_0x0282('0x20')]=function(_0x3cb33d){var _0x1c30e9=this;return new Promise(function(_0x51ab8a,_0x1baef8){return db[_0x0282('0x15')]['destroy']({'where':_0x3cb33d[_0x0282('0x16')]?_0x3cb33d[_0x0282('0x16')]['where']||null:null})[_0x0282('0x9')](function(_0x4fa1b0){logger[_0x0282('0xa')](_0x0282('0x20'),_0x3cb33d);logger[_0x0282('0xd')]('DestroyCmHopperBlack',_0x3cb33d,JSON['stringify'](_0x4fa1b0));_0x51ab8a(_0x4fa1b0);})[_0x0282('0x13')](function(_0x3196e9){logger['error']('DestroyCmHopperBlack',_0x3196e9[_0x0282('0x11')],_0x3cb33d);_0x1baef8(_0x1c30e9[_0x0282('0xf')](0x1f4,_0x3196e9[_0x0282('0x11')]));});});}; \ No newline at end of file +var _0x59d8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','attributes','include','map','model','UpdateCmHopperBlack','CmHopperBlack','body','where','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring'];(function(_0x538bb9,_0x57ccbf){var _0x23276d=function(_0x2fe0b8){while(--_0x2fe0b8){_0x538bb9['push'](_0x538bb9['shift']());}};_0x23276d(++_0x57ccbf);}(_0x59d8,0x16e));var _0x859d=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x59d8[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0x859d('0x0'));var util=require('util');var moment=require(_0x859d('0x1'));var BPromise=require(_0x859d('0x2'));var rs=require(_0x859d('0x3'));var fs=require('fs');var Redis=require(_0x859d('0x4'));var db=require(_0x859d('0x5'))['db'];var utils=require(_0x859d('0x6'));var logger=require(_0x859d('0x7'))(_0x859d('0x8'));var config=require(_0x859d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x859d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e1860,_0x2de94a,_0x256bd8){return new BPromise(function(_0x4f5b8a,_0x14dea6){return client[_0x859d('0xb')](_0x8e1860,_0x256bd8)[_0x859d('0xc')](function(_0x1067bc){logger[_0x859d('0xd')](_0x859d('0xe'),_0x2de94a,_0x859d('0xf'));logger[_0x859d('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2de94a,_0x859d('0xf'),JSON[_0x859d('0x11')](_0x1067bc));if(_0x1067bc['error']){if(_0x1067bc['error'][_0x859d('0x12')]===0x1f4){logger[_0x859d('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x2de94a,_0x1067bc[_0x859d('0x13')][_0x859d('0x14')]);return _0x14dea6(_0x1067bc['error'][_0x859d('0x14')]);}logger[_0x859d('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x2de94a,_0x1067bc[_0x859d('0x13')]['message']);return _0x4f5b8a(_0x1067bc[_0x859d('0x13')][_0x859d('0x14')]);}else{logger[_0x859d('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x2de94a,_0x859d('0xf'));_0x4f5b8a(_0x1067bc[_0x859d('0x15')][_0x859d('0x14')]);}})[_0x859d('0x16')](function(_0x585da8){logger[_0x859d('0x13')](_0x859d('0xe'),_0x2de94a,_0x585da8);_0x14dea6(_0x585da8);});});}exports[_0x859d('0x17')]=function(_0xa779d){var _0x2f72a2=this;return new Promise(function(_0xdaa85,_0xc69a16){return db['CmHopperBlack'][_0x859d('0x18')]({'raw':_0xa779d[_0x859d('0x19')]?_0xa779d['options'][_0x859d('0x1a')]===undefined?!![]:![]:!![],'where':_0xa779d['options']?_0xa779d[_0x859d('0x19')]['where']||null:null,'attributes':_0xa779d['options']?_0xa779d['options'][_0x859d('0x1b')]||null:null,'limit':_0xa779d[_0x859d('0x19')]?_0xa779d[_0x859d('0x19')]['limit']||null:null,'include':_0xa779d[_0x859d('0x19')]?_0xa779d[_0x859d('0x19')][_0x859d('0x1c')]?_[_0x859d('0x1d')](_0xa779d['options']['include'],function(_0x26baac){return{'model':db[_0x26baac['model']],'as':_0x26baac['as'],'attributes':_0x26baac[_0x859d('0x1b')],'include':_0x26baac[_0x859d('0x1c')]?_[_0x859d('0x1d')](_0x26baac['include'],function(_0x13da91){return{'model':db[_0x13da91['model']],'as':_0x13da91['as'],'attributes':_0x13da91['attributes'],'include':_0x13da91[_0x859d('0x1c')]?_['map'](_0x13da91[_0x859d('0x1c')],function(_0x114f87){return{'model':db[_0x114f87[_0x859d('0x1e')]],'as':_0x114f87['as'],'attributes':_0x114f87[_0x859d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x859d('0xc')](function(_0xd3322c){logger[_0x859d('0xd')](_0x859d('0x17'),_0xa779d);logger[_0x859d('0x10')](_0x859d('0x17'),_0xa779d,JSON[_0x859d('0x11')](_0xd3322c));_0xdaa85(_0xd3322c);})[_0x859d('0x16')](function(_0x46f659){logger[_0x859d('0x13')](_0x859d('0x17'),_0x46f659['message'],_0xa779d);_0xc69a16(_0x2f72a2[_0x859d('0x13')](0x1f4,_0x46f659[_0x859d('0x14')]));});});};exports[_0x859d('0x1f')]=function(_0x4c6c1a){var _0x15f056=this;return new Promise(function(_0x1265d3,_0x41f966){return db[_0x859d('0x20')]['update'](_0x4c6c1a[_0x859d('0x21')],{'raw':_0x4c6c1a[_0x859d('0x19')]?_0x4c6c1a[_0x859d('0x19')][_0x859d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c6c1a[_0x859d('0x19')]?_0x4c6c1a[_0x859d('0x19')][_0x859d('0x22')]||null:null,'attributes':_0x4c6c1a[_0x859d('0x19')]?_0x4c6c1a[_0x859d('0x19')][_0x859d('0x1b')]||null:null,'limit':_0x4c6c1a[_0x859d('0x19')]?_0x4c6c1a['options']['limit']||null:null})[_0x859d('0xc')](function(_0x3a8e78){logger['info'](_0x859d('0x1f'),_0x4c6c1a);logger[_0x859d('0x10')](_0x859d('0x1f'),_0x4c6c1a,JSON[_0x859d('0x11')](_0x3a8e78));_0x1265d3(_0x3a8e78);})['catch'](function(_0x237285){logger[_0x859d('0x13')]('UpdateCmHopperBlack',_0x237285[_0x859d('0x14')],_0x4c6c1a);_0x41f966(_0x15f056[_0x859d('0x13')](0x1f4,_0x237285[_0x859d('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x2ea5d3){var _0x204e58=this;return new Promise(function(_0x4ab616,_0x1a92e5){return db[_0x859d('0x20')][_0x859d('0x23')]({'where':_0x2ea5d3[_0x859d('0x19')]?_0x2ea5d3[_0x859d('0x19')][_0x859d('0x22')]||null:null})['then'](function(_0x174377){logger['info']('DestroyCmHopperBlack',_0x2ea5d3);logger[_0x859d('0x10')](_0x859d('0x24'),_0x2ea5d3,JSON[_0x859d('0x11')](_0x174377));_0x4ab616(_0x174377);})['catch'](function(_0x41b95d){logger[_0x859d('0x13')](_0x859d('0x24'),_0x41b95d[_0x859d('0x14')],_0x2ea5d3);_0x1a92e5(_0x204e58[_0x859d('0x13')](0x1f4,_0x41b95d[_0x859d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 32f0f57..f17c582 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 _0x1967=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bf107,_0x53295e){var _0x5d09eb=function(_0x589c88){while(--_0x589c88){_0x3bf107['push'](_0x3bf107['shift']());}};_0x5d09eb(++_0x53295e);}(_0x1967,0x173));var _0x7196=function(_0x14b341,_0x191d53){_0x14b341=_0x14b341-0x0;var _0x388b8d=_0x1967[_0x14b341];return _0x388b8d;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')](_0x7196('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x7196('0x12')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);module[_0x7196('0x14')]=router; \ No newline at end of file +var _0x5fab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5c9fee,_0x1d9db8){var _0x280fa1=function(_0x5796f2){while(--_0x5796f2){_0x5c9fee['push'](_0x5c9fee['shift']());}};_0x280fa1(++_0x1d9db8);}(_0x5fab,0x177));var _0xb5fa=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x5fab[_0x486f4a];return _0x135d99;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['put']('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);module[_0xb5fa('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index abea192..7c5a588 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 _0x8ba1=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING','endtime','diff','seconds','dispositionat'];(function(_0x2f0431,_0x188307){var _0x23a38c=function(_0x47553c){while(--_0x47553c){_0x2f0431['push'](_0x2f0431['shift']());}};_0x23a38c(++_0x188307);}(_0x8ba1,0x1c3));var _0x18ba=function(_0xdd057b,_0x3be045){_0xdd057b=_0xdd057b-0x0;var _0xc61cd7=_0x8ba1[_0xdd057b];return _0xc61cd7;};'use strict';var Sequelize=require(_0x18ba('0x0'));var moment=require('moment');module[_0x18ba('0x1')]={'state':{'type':Sequelize[_0x18ba('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x18ba('0x3')]},'countbusyretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x18ba('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x18ba('0x4')]},'originatecalleridname':{'type':Sequelize[_0x18ba('0x4')]},'calleridnum':{'type':Sequelize[_0x18ba('0x4')]},'calleridname':{'type':Sequelize[_0x18ba('0x4')]},'starttime':{'type':Sequelize[_0x18ba('0x3')]},'responsetime':{'type':Sequelize[_0x18ba('0x3')]},'answertime':{'type':Sequelize[_0x18ba('0x3')]},'droptime':{'type':Sequelize[_0x18ba('0x3')]},'endtime':{'type':Sequelize[_0x18ba('0x3')]},'ringtime':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x18ba('0x4')]},'campaign':{'type':Sequelize[_0x18ba('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x18ba('0x4')]},'reason':{'type':Sequelize[_0x18ba('0x4')]},'disposition':{'type':Sequelize[_0x18ba('0x4')]},'secondDisposition':{'type':Sequelize[_0x18ba('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x18ba('0x3')],'set':function(_0x639775){var _0x58530b=this['getDataValue'](_0x18ba('0x5'));if(_0x58530b&&_0x639775){this['setDataValue']('followuptime',moment(_0x639775)[_0x18ba('0x6')](moment(_0x58530b),_0x18ba('0x7')));}return this['setDataValue'](_0x18ba('0x8'),_0x639775);}},'amd':{'type':Sequelize[_0x18ba('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x18ba('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x18ba('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x18ba('0x3')]},'callback':{'type':Sequelize[_0x18ba('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x18ba('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x18ba('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x18ba('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x18ba('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x18ba('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7965=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7965,0x145));var _0x5796=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x7965[_0x5756c6];return _0x4b5806;};'use strict';var Sequelize=require(_0x5796('0x0'));var moment=require(_0x5796('0x1'));module[_0x5796('0x2')]={'state':{'type':Sequelize[_0x5796('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x5796('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5796('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x5796('0x4')]},'originatecalleridname':{'type':Sequelize[_0x5796('0x4')]},'calleridnum':{'type':Sequelize[_0x5796('0x4')]},'calleridname':{'type':Sequelize[_0x5796('0x4')]},'starttime':{'type':Sequelize[_0x5796('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5796('0x5')]},'ringtime':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5796('0x4')]},'campaigntype':{'type':Sequelize[_0x5796('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5796('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5796('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x38ce35){var _0x5df533=this[_0x5796('0x6')](_0x5796('0x7'));if(_0x5df533&&_0x38ce35){this[_0x5796('0x8')](_0x5796('0x9'),moment(_0x38ce35)['diff'](moment(_0x5df533),_0x5796('0xa')));}return this[_0x5796('0x8')](_0x5796('0xb'),_0x38ce35);}},'amd':{'type':Sequelize[_0x5796('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5796('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5796('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5796('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5796('0x5')]},'recallme':{'type':Sequelize[_0x5796('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5796('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5796('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5796('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 cc41264..6f46ec3 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 _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x524e,0x15e));var _0xe524=function(_0x1c3dfa,_0x28c734){_0x1c3dfa=_0x1c3dfa-0x0;var _0x4f811b=_0x524e[_0x1c3dfa];return _0x4f811b;};'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['CmHopperFinal'][_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')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file +var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0x781d,0x14a));var _0xd781=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x781d[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 5431c5b..72a0428 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 _0x2f74=['util','../../config/logger','moment','bluebird','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x4e413f,_0x266ab4){var _0x2eca8a=function(_0x36dc7e){while(--_0x36dc7e){_0x4e413f['push'](_0x4e413f['shift']());}};_0x2eca8a(++_0x266ab4);}(_0x2f74,0x137));var _0x42f7=function(_0x1009c6,_0x548277){_0x1009c6=_0x1009c6-0x0;var _0x40dc08=_0x2f74[_0x1009c6];return _0x40dc08;};'use strict';var _=require(_0x42f7('0x0'));var util=require(_0x42f7('0x1'));var logger=require(_0x42f7('0x2'))('api');var moment=require(_0x42f7('0x3'));var BPromise=require(_0x42f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42f7('0x5'));var rimraf=require(_0x42f7('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x42f7('0x7')]=function(_0x4820bf,_0x4e28fb){return _0x4820bf[_0x42f7('0x8')](_0x42f7('0x9'),attributes,{'tableName':_0x42f7('0xa'),'paranoid':![],'indexes':[{'name':_0x42f7('0xb'),'fields':['calleridnum']},{'name':_0x42f7('0xc'),'fields':[_0x42f7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8186=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4eefe5,_0x511533){var _0x2664d8=function(_0x11c162){while(--_0x11c162){_0x4eefe5['push'](_0x4eefe5['shift']());}};_0x2664d8(++_0x511533);}(_0x8186,0xaf));var _0x6818=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x8186[_0x38eb23];return _0x48506a;};'use strict';var _=require('lodash');var util=require(_0x6818('0x0'));var logger=require(_0x6818('0x1'))('api');var moment=require(_0x6818('0x2'));var BPromise=require(_0x6818('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6818('0x4'));var rimraf=require('rimraf');var config=require(_0x6818('0x5'));var attributes=require(_0x6818('0x6'));module[_0x6818('0x7')]=function(_0x18ad38,_0x514c8a){return _0x18ad38[_0x6818('0x8')](_0x6818('0x9'),attributes,{'tableName':_0x6818('0xa'),'paranoid':![],'indexes':[{'name':_0x6818('0xb'),'fields':[_0x6818('0xb')]},{'name':'uniqueid','fields':[_0x6818('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index c96c638..50a2158 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(_0x1567ec,_0x58a791){var _0x1a5734=function(_0x289fd0){while(--_0x289fd0){_0x1567ec['push'](_0x1567ec['shift']());}};_0x1a5734(++_0x58a791);}(_0x7a54,0x106));var _0x47a5=function(_0x40b259,_0x43682a){_0x40b259=_0x40b259-0x0;var _0x8c386d=_0x7a54[_0x40b259];return _0x8c386d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4777c6,_0x221264){var _0x1c9459=function(_0x339714){while(--_0x339714){_0x4777c6['push'](_0x4777c6['shift']());}};_0x1c9459(++_0x221264);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d3892,_0x47d5fe){_0x1d3892=_0x1d3892-0x0;var _0x574ff2=_0xb10b[_0x1d3892];return _0x574ff2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index a50ccd1..20c1d15 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 _0x851f=['path','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x851f,0x185));var _0xf851=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0x851f[_0x1ca4cc];return _0x108010;};'use strict';var multer=require(_0xf851('0x0'));var util=require(_0xf851('0x1'));var path=require(_0xf851('0x2'));var timeout=require('connect-timeout');var express=require(_0xf851('0x3'));var router=express[_0xf851('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf851('0x5'));var interaction=require(_0xf851('0x6'));var config=require('../../config/environment');var controller=require(_0xf851('0x7'));router['get']('/',auth[_0xf851('0x8')](),controller[_0xf851('0x9')]);router[_0xf851('0xa')](_0xf851('0xb'),auth[_0xf851('0x8')](),controller[_0xf851('0xc')]);router[_0xf851('0xa')]('/:id',auth[_0xf851('0x8')](),controller['show']);router[_0xf851('0xa')](_0xf851('0xd'),auth[_0xf851('0x8')](),controller[_0xf851('0xe')]);router[_0xf851('0xa')]('/campaign/countAttributes/:id',auth[_0xf851('0x8')](),controller[_0xf851('0xf')]);router[_0xf851('0x10')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xf851('0x10')](_0xf851('0x11'),auth[_0xf851('0x8')](),controller[_0xf851('0x12')]);router[_0xf851('0x10')](_0xf851('0x13'),auth[_0xf851('0x8')](),controller[_0xf851('0x14')]);router[_0xf851('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf851('0x16')]);module['exports']=router; \ No newline at end of file +var _0x5a28=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer'];(function(_0xf23e2e,_0x1912b7){var _0x23ae4e=function(_0x45fdf2){while(--_0x45fdf2){_0xf23e2e['push'](_0xf23e2e['shift']());}};_0x23ae4e(++_0x1912b7);}(_0x5a28,0x1c7));var _0x85a2=function(_0xb39122,_0x1c4f04){_0xb39122=_0xb39122-0x0;var _0x4126c7=_0x5a28[_0xb39122];return _0x4126c7;};'use strict';var multer=require(_0x85a2('0x0'));var util=require(_0x85a2('0x1'));var path=require(_0x85a2('0x2'));var timeout=require(_0x85a2('0x3'));var express=require(_0x85a2('0x4'));var router=express['Router']();var fs_extra=require(_0x85a2('0x5'));var auth=require(_0x85a2('0x6'));var interaction=require(_0x85a2('0x7'));var config=require(_0x85a2('0x8'));var controller=require(_0x85a2('0x9'));router['get']('/',auth[_0x85a2('0xa')](),controller[_0x85a2('0xb')]);router[_0x85a2('0xc')](_0x85a2('0xd'),auth[_0x85a2('0xa')](),controller['describe']);router[_0x85a2('0xc')]('/:id',auth[_0x85a2('0xa')](),controller['show']);router[_0x85a2('0xc')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x85a2('0xe'),auth[_0x85a2('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x85a2('0xf')](_0x85a2('0x10'),auth[_0x85a2('0xa')](),controller[_0x85a2('0x11')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0x85a2('0xa')](),controller[_0x85a2('0x12')]);router[_0x85a2('0xf')](_0x85a2('0x13'),auth[_0x85a2('0xa')](),controller[_0x85a2('0x14')]);router[_0x85a2('0x15')]('/:id',auth[_0x85a2('0xa')](),controller[_0x85a2('0x16')]);module[_0x85a2('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ecc39c1..979580d 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 _0xcb55=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2f7420,_0x38d966){var _0x552391=function(_0x545247){while(--_0x545247){_0x2f7420['push'](_0x2f7420['shift']());}};_0x552391(++_0x38d966);}(_0xcb55,0x185));var _0x5cb5=function(_0x9b2f3a,_0x59d180){_0x9b2f3a=_0x9b2f3a-0x0;var _0x3a555f=_0xcb55[_0x9b2f3a];return _0x3a555f;};'use strict';var Sequelize=require(_0x5cb5('0x0'));module[_0x5cb5('0x1')]={'state':{'type':Sequelize[_0x5cb5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5cb5('0x3')]},'scheduledat':{'type':Sequelize[_0x5cb5('0x4')]},'countbusyretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5cb5('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5cb5('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5cb5('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5cb5('0x4')]},'droptime':{'type':Sequelize[_0x5cb5('0x4')]},'endtime':{'type':Sequelize[_0x5cb5('0x4')]},'ringtime':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5cb5('0x3')]},'campaigntype':{'type':Sequelize[_0x5cb5('0x3')]},'membername':{'type':Sequelize[_0x5cb5('0x3')]},'reason':{'type':Sequelize[_0x5cb5('0x3')]},'amd':{'type':Sequelize[_0x5cb5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5cb5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5cb5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5cb5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5cb5('0x4')]},'recallme':{'type':Sequelize[_0x5cb5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5cb5('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5cb5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf48b=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf48b,0x14d));var _0xbf48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf48b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xbf48('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xbf48('0x1')]},'scheduledat':{'type':Sequelize[_0xbf48('0x2')]},'countbusyretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbf48('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xbf48('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbf48('0x1')]},'starttime':{'type':Sequelize[_0xbf48('0x2')]},'responsetime':{'type':Sequelize[_0xbf48('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbf48('0x2')]},'ringtime':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbf48('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbf48('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xbf48('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xbf48('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbf48('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbf48('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbf48('0x2')]},'recallme':{'type':Sequelize[_0xbf48('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbf48('0x2')]},'edited':{'type':Sequelize[_0xbf48('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbf48('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f1510d4..d70a53d 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 _0xca51=['rows','catch','params','length','includeAll','include','create','body','describe','uniqueid','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','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','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmHopperHistory','findAll'];(function(_0x22889a,_0x4b75f7){var _0x763d34=function(_0x2040e5){while(--_0x2040e5){_0x22889a['push'](_0x22889a['shift']());}};_0x763d34(++_0x4b75f7);}(_0xca51,0x187));var _0x1ca5=function(_0x290978,_0x142464){_0x290978=_0x290978-0x0;var _0x42dc65=_0xca51[_0x290978];return _0x42dc65;};'use strict';var emlformat=require(_0x1ca5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ca5('0x1'));var jsonpatch=require(_0x1ca5('0x2'));var rp=require(_0x1ca5('0x3'));var moment=require(_0x1ca5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ca5('0x5'));var util=require(_0x1ca5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1ca5('0x7'));var ejs=require(_0x1ca5('0x8'));var fs=require('fs');var fs_extra=require(_0x1ca5('0x9'));var _=require(_0x1ca5('0xa'));var squel=require(_0x1ca5('0xb'));var crypto=require(_0x1ca5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ca5('0x7'));var querystring=require('querystring');var Papa=require(_0x1ca5('0xd'));var Redis=require(_0x1ca5('0xe'));var authService=require(_0x1ca5('0xf'));var qs=require(_0x1ca5('0x10'));var as=require(_0x1ca5('0x11'));var hardwareService=require(_0x1ca5('0x12'));var logger=require(_0x1ca5('0x13'))('api');var utils=require(_0x1ca5('0x14'));var config=require(_0x1ca5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ca5('0x16'))['db'];function respondWithStatusCode(_0x21429e,_0x18ad4c){_0x18ad4c=_0x18ad4c||0xcc;return function(_0x115501){if(_0x115501){return _0x21429e[_0x1ca5('0x17')](_0x18ad4c);}return _0x21429e[_0x1ca5('0x18')](_0x18ad4c)[_0x1ca5('0x19')]();};}function respondWithResult(_0x5b0ec8,_0x5bc984){_0x5bc984=_0x5bc984||0xc8;return function(_0x20637d){if(_0x20637d){return _0x5b0ec8[_0x1ca5('0x18')](_0x5bc984)[_0x1ca5('0x1a')](_0x20637d);}};}function respondWithFilteredResult(_0x358ab8,_0x5491ef){return function(_0x10205d){if(_0x10205d){var _0x1234bf=typeof _0x5491ef[_0x1ca5('0x1b')]===_0x1ca5('0x1c')&&typeof _0x5491ef[_0x1ca5('0x1d')]===_0x1ca5('0x1c');var _0x37a21c=_0x10205d[_0x1ca5('0x1e')];var _0x3a3fcd=_0x1234bf?0x0:_0x5491ef[_0x1ca5('0x1b')];var _0x4fe76a=_0x1234bf?_0x10205d[_0x1ca5('0x1e')]:_0x5491ef[_0x1ca5('0x1b')]+_0x5491ef[_0x1ca5('0x1d')];var _0x18f142;if(_0x4fe76a>=_0x37a21c){_0x4fe76a=_0x37a21c;_0x18f142=0xc8;}else{_0x18f142=0xce;}_0x358ab8[_0x1ca5('0x18')](_0x18f142);return _0x358ab8[_0x1ca5('0x1f')](_0x1ca5('0x20'),_0x3a3fcd+'-'+_0x4fe76a+'/'+_0x37a21c)['json'](_0x10205d);}return null;};}function patchUpdates(_0x59e6c3){return function(_0x5ee582){try{jsonpatch[_0x1ca5('0x21')](_0x5ee582,_0x59e6c3,!![]);}catch(_0x5dbc12){return BPromise['reject'](_0x5dbc12);}return _0x5ee582[_0x1ca5('0x22')]();};}function saveUpdates(_0x4c6456,_0x4f3cc6){return function(_0x5e5136){if(_0x5e5136){return _0x5e5136[_0x1ca5('0x23')](_0x4c6456)[_0x1ca5('0x24')](function(_0x2aecb9){return _0x2aecb9;});}return null;};}function removeEntity(_0x5aec3a,_0x200fa0){return function(_0x19a1f0){if(_0x19a1f0){return _0x19a1f0[_0x1ca5('0x25')]()[_0x1ca5('0x24')](function(){_0x5aec3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31da58,_0x5e5667){return function(_0x3f9f22){if(!_0x3f9f22){_0x31da58[_0x1ca5('0x17')](0x194);}return _0x3f9f22;};}function handleError(_0x297a21,_0x9733cd){_0x9733cd=_0x9733cd||0x1f4;return function(_0x3ab75a){logger[_0x1ca5('0x26')](_0x3ab75a[_0x1ca5('0x27')]);if(_0x3ab75a[_0x1ca5('0x28')]){delete _0x3ab75a[_0x1ca5('0x28')];}_0x297a21[_0x1ca5('0x18')](_0x9733cd)[_0x1ca5('0x29')](_0x3ab75a);};}exports[_0x1ca5('0x2a')]=function(_0x1c3a1f,_0x5104f2){var _0x100847={},_0x3dcab1={},_0x1c52ad={'count':0x0,'rows':[]};var _0x23ebb4=_[_0x1ca5('0x2b')](db['CmHopperHistory'][_0x1ca5('0x2c')],function(_0x416f6d){return{'name':_0x416f6d['fieldName'],'type':_0x416f6d[_0x1ca5('0x2d')][_0x1ca5('0x2e')]};});_0x3dcab1[_0x1ca5('0x2f')]=_[_0x1ca5('0x2b')](_0x23ebb4,'name');_0x3dcab1[_0x1ca5('0x30')]=_[_0x1ca5('0x31')](_0x1c3a1f[_0x1ca5('0x30')]);_0x3dcab1[_0x1ca5('0x32')]=_['intersection'](_0x3dcab1['model'],_0x3dcab1[_0x1ca5('0x30')]);_0x100847[_0x1ca5('0x33')]=_[_0x1ca5('0x34')](_0x3dcab1[_0x1ca5('0x2f')],qs[_0x1ca5('0x35')](_0x1c3a1f['query']['fields']));_0x100847[_0x1ca5('0x33')]=_0x100847['attributes']['length']?_0x100847[_0x1ca5('0x33')]:_0x3dcab1['model'];if(!_0x1c3a1f[_0x1ca5('0x30')][_0x1ca5('0x36')](_0x1ca5('0x37'))){_0x100847[_0x1ca5('0x1d')]=qs['limit'](_0x1c3a1f[_0x1ca5('0x30')][_0x1ca5('0x1d')]);_0x100847['offset']=qs['offset'](_0x1c3a1f[_0x1ca5('0x30')][_0x1ca5('0x1b')]);}_0x100847[_0x1ca5('0x38')]=qs[_0x1ca5('0x39')](_0x1c3a1f['query']['sort']);_0x100847[_0x1ca5('0x3a')]=qs['filters'](_[_0x1ca5('0x3b')](_0x1c3a1f['query'],_0x3dcab1['filters']),_0x23ebb4);if(_0x1c3a1f['query'][_0x1ca5('0x3c')]){_0x100847[_0x1ca5('0x3a')]=_['merge'](_0x100847[_0x1ca5('0x3a')],{'$or':_[_0x1ca5('0x2b')](_0x23ebb4,function(_0x2d3918){if(_0x2d3918[_0x1ca5('0x2d')]!=='VIRTUAL'){var _0x3df02e={};_0x3df02e[_0x2d3918['name']]={'$like':'%'+_0x1c3a1f[_0x1ca5('0x30')][_0x1ca5('0x3c')]+'%'};return _0x3df02e;}})});}_0x100847=_[_0x1ca5('0x3d')]({},_0x100847,_0x1c3a1f[_0x1ca5('0x3e')]);var _0x3ac5bd={'where':_0x100847[_0x1ca5('0x3a')]};return db[_0x1ca5('0x3f')][_0x1ca5('0x1e')](_0x3ac5bd)[_0x1ca5('0x24')](function(_0x383668){_0x1c52ad['count']=_0x383668;if(_0x1c3a1f[_0x1ca5('0x30')]['includeAll']){_0x100847['include']=[{'all':!![]}];}return db[_0x1ca5('0x3f')][_0x1ca5('0x40')](_0x100847);})[_0x1ca5('0x24')](function(_0x2cc83c){_0x1c52ad[_0x1ca5('0x41')]=_0x2cc83c;return _0x1c52ad;})['then'](respondWithFilteredResult(_0x5104f2,_0x100847))[_0x1ca5('0x42')](handleError(_0x5104f2,null));};exports['show']=function(_0x43f4fa,_0x4acfd9){var _0x423267={'raw':!![],'where':{'id':_0x43f4fa[_0x1ca5('0x43')]['id']}},_0x1f2df8={};_0x1f2df8[_0x1ca5('0x2f')]=_[_0x1ca5('0x31')](db['CmHopperHistory'][_0x1ca5('0x2c')]);_0x1f2df8[_0x1ca5('0x30')]=_[_0x1ca5('0x31')](_0x43f4fa['query']);_0x1f2df8[_0x1ca5('0x32')]=_[_0x1ca5('0x34')](_0x1f2df8[_0x1ca5('0x2f')],_0x1f2df8['query']);_0x423267['attributes']=_[_0x1ca5('0x34')](_0x1f2df8[_0x1ca5('0x2f')],qs[_0x1ca5('0x35')](_0x43f4fa[_0x1ca5('0x30')]['fields']));_0x423267[_0x1ca5('0x33')]=_0x423267[_0x1ca5('0x33')][_0x1ca5('0x44')]?_0x423267[_0x1ca5('0x33')]:_0x1f2df8['model'];if(_0x43f4fa[_0x1ca5('0x30')][_0x1ca5('0x45')]){_0x423267[_0x1ca5('0x46')]=[{'all':!![]}];}_0x423267=_['merge']({},_0x423267,_0x43f4fa[_0x1ca5('0x3e')]);return db[_0x1ca5('0x3f')]['find'](_0x423267)[_0x1ca5('0x24')](handleEntityNotFound(_0x4acfd9,null))[_0x1ca5('0x24')](respondWithResult(_0x4acfd9,null))[_0x1ca5('0x42')](handleError(_0x4acfd9,null));};exports[_0x1ca5('0x47')]=function(_0x4e9643,_0x335573){return db[_0x1ca5('0x3f')][_0x1ca5('0x47')](_0x4e9643[_0x1ca5('0x48')],{})['then'](respondWithResult(_0x335573,0xc9))['catch'](handleError(_0x335573,null));};exports['describe']=function(_0x8db3e9,_0x258ba6){return db['CmHopperHistory'][_0x1ca5('0x49')]()[_0x1ca5('0x24')](respondWithResult(_0x258ba6,null))[_0x1ca5('0x42')](handleError(_0x258ba6,null));};exports['update']=function(_0x1e0b37,_0x192fae){if(_0x1e0b37[_0x1ca5('0x48')][_0x1ca5('0x4a')]){delete _0x1e0b37[_0x1ca5('0x48')][_0x1ca5('0x4a')];}return db[_0x1ca5('0x3f')][_0x1ca5('0x4b')]({'where':{'uniqueid':_0x1e0b37[_0x1ca5('0x43')]['id']}})[_0x1ca5('0x24')](handleEntityNotFound(_0x192fae,null))[_0x1ca5('0x24')](saveUpdates(_0x1e0b37[_0x1ca5('0x48')],null))[_0x1ca5('0x24')](respondWithResult(_0x192fae,null))[_0x1ca5('0x42')](handleError(_0x192fae,null));}; \ No newline at end of file +var _0x97d4=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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','sendStatus','status'];(function(_0x3b29d5,_0x12faa2){var _0x20b96d=function(_0x284207){while(--_0x284207){_0x3b29d5['push'](_0x3b29d5['shift']());}};_0x20b96d(++_0x12faa2);}(_0x97d4,0x16a));var _0x497d=function(_0x4fdee1,_0x3f290c){_0x4fdee1=_0x4fdee1-0x0;var _0x87826e=_0x97d4[_0x4fdee1];return _0x87826e;};'use strict';var emlformat=require(_0x497d('0x0'));var rimraf=require(_0x497d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x497d('0x2'));var rp=require(_0x497d('0x3'));var moment=require(_0x497d('0x4'));var BPromise=require(_0x497d('0x5'));var Mustache=require('mustache');var util=require(_0x497d('0x6'));var path=require(_0x497d('0x7'));var sox=require(_0x497d('0x8'));var csv=require(_0x497d('0x9'));var ejs=require(_0x497d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x497d('0xb'));var crypto=require(_0x497d('0xc'));var jsforce=require(_0x497d('0xd'));var deskjs=require(_0x497d('0xe'));var toCsv=require(_0x497d('0x9'));var querystring=require('querystring');var Papa=require(_0x497d('0xf'));var Redis=require(_0x497d('0x10'));var authService=require(_0x497d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x497d('0x12'));var hardwareService=require(_0x497d('0x13'));var logger=require(_0x497d('0x14'))(_0x497d('0x15'));var utils=require(_0x497d('0x16'));var config=require(_0x497d('0x17'));var licenseUtil=require(_0x497d('0x18'));var db=require(_0x497d('0x19'))['db'];function respondWithStatusCode(_0x17dd18,_0x4f9ad8){_0x4f9ad8=_0x4f9ad8||0xcc;return function(_0x5382c8){if(_0x5382c8){return _0x17dd18[_0x497d('0x1a')](_0x4f9ad8);}return _0x17dd18[_0x497d('0x1b')](_0x4f9ad8)['end']();};}function respondWithResult(_0x270f08,_0x69b3da){_0x69b3da=_0x69b3da||0xc8;return function(_0x4862b0){if(_0x4862b0){return _0x270f08[_0x497d('0x1b')](_0x69b3da)[_0x497d('0x1c')](_0x4862b0);}};}function respondWithFilteredResult(_0x4174e4,_0x51e430){return function(_0x5473be){if(_0x5473be){var _0x1bf1ce=typeof _0x51e430[_0x497d('0x1d')]===_0x497d('0x1e')&&typeof _0x51e430[_0x497d('0x1f')]===_0x497d('0x1e');var _0x54cff6=_0x5473be[_0x497d('0x20')];var _0x3a0533=_0x1bf1ce?0x0:_0x51e430['offset'];var _0x5ad30d=_0x1bf1ce?_0x5473be[_0x497d('0x20')]:_0x51e430[_0x497d('0x1d')]+_0x51e430[_0x497d('0x1f')];var _0x21428a;if(_0x5ad30d>=_0x54cff6){_0x5ad30d=_0x54cff6;_0x21428a=0xc8;}else{_0x21428a=0xce;}_0x4174e4[_0x497d('0x1b')](_0x21428a);return _0x4174e4[_0x497d('0x21')](_0x497d('0x22'),_0x3a0533+'-'+_0x5ad30d+'/'+_0x54cff6)[_0x497d('0x1c')](_0x5473be);}return null;};}function patchUpdates(_0x230b41){return function(_0x361481){try{jsonpatch[_0x497d('0x23')](_0x361481,_0x230b41,!![]);}catch(_0x31e075){return BPromise[_0x497d('0x24')](_0x31e075);}return _0x361481['save']();};}function saveUpdates(_0x390d6b,_0xc36ec8){return function(_0xfeb803){if(_0xfeb803){return _0xfeb803[_0x497d('0x25')](_0x390d6b)['then'](function(_0x57fb67){return _0x57fb67;});}return null;};}function removeEntity(_0x39db9f,_0x2160a6){return function(_0x331a18){if(_0x331a18){return _0x331a18[_0x497d('0x26')]()[_0x497d('0x27')](function(){_0x39db9f['status'](0xcc)[_0x497d('0x28')]();});}};}function handleEntityNotFound(_0x47f8f9,_0x4a5f9d){return function(_0x133250){if(!_0x133250){_0x47f8f9['sendStatus'](0x194);}return _0x133250;};}function handleError(_0x53d1f1,_0x555b97){_0x555b97=_0x555b97||0x1f4;return function(_0x2ac607){logger['error'](_0x2ac607['stack']);if(_0x2ac607[_0x497d('0x29')]){delete _0x2ac607[_0x497d('0x29')];}_0x53d1f1[_0x497d('0x1b')](_0x555b97)['send'](_0x2ac607);};}exports[_0x497d('0x2a')]=function(_0x772d5c,_0x488a99){var _0x479be6={},_0x4cea26={},_0x1cb283={'count':0x0,'rows':[]};var _0x2eb7b5=_[_0x497d('0x2b')](db['CmHopperHistory'][_0x497d('0x2c')],function(_0x4abfea){return{'name':_0x4abfea[_0x497d('0x2d')],'type':_0x4abfea['type'][_0x497d('0x2e')]};});_0x4cea26[_0x497d('0x2f')]=_[_0x497d('0x2b')](_0x2eb7b5,_0x497d('0x29'));_0x4cea26[_0x497d('0x30')]=_[_0x497d('0x31')](_0x772d5c[_0x497d('0x30')]);_0x4cea26[_0x497d('0x32')]=_['intersection'](_0x4cea26[_0x497d('0x2f')],_0x4cea26['query']);_0x479be6[_0x497d('0x33')]=_[_0x497d('0x34')](_0x4cea26[_0x497d('0x2f')],qs['fields'](_0x772d5c[_0x497d('0x30')][_0x497d('0x35')]));_0x479be6[_0x497d('0x33')]=_0x479be6[_0x497d('0x33')]['length']?_0x479be6[_0x497d('0x33')]:_0x4cea26['model'];if(!_0x772d5c['query'][_0x497d('0x36')](_0x497d('0x37'))){_0x479be6['limit']=qs['limit'](_0x772d5c['query']['limit']);_0x479be6[_0x497d('0x1d')]=qs['offset'](_0x772d5c[_0x497d('0x30')][_0x497d('0x1d')]);}_0x479be6[_0x497d('0x38')]=qs[_0x497d('0x39')](_0x772d5c[_0x497d('0x30')][_0x497d('0x39')]);_0x479be6[_0x497d('0x3a')]=qs[_0x497d('0x32')](_[_0x497d('0x3b')](_0x772d5c[_0x497d('0x30')],_0x4cea26[_0x497d('0x32')]),_0x2eb7b5);if(_0x772d5c[_0x497d('0x30')][_0x497d('0x3c')]){_0x479be6[_0x497d('0x3a')]=_[_0x497d('0x3d')](_0x479be6['where'],{'$or':_['map'](_0x2eb7b5,function(_0x45001d){if(_0x45001d[_0x497d('0x3e')]!==_0x497d('0x3f')){var _0x3980b0={};_0x3980b0[_0x45001d[_0x497d('0x29')]]={'$like':'%'+_0x772d5c[_0x497d('0x30')]['filter']+'%'};return _0x3980b0;}})});}_0x479be6=_[_0x497d('0x3d')]({},_0x479be6,_0x772d5c[_0x497d('0x40')]);var _0x2c5ef2={'where':_0x479be6[_0x497d('0x3a')]};return db[_0x497d('0x41')][_0x497d('0x20')](_0x2c5ef2)[_0x497d('0x27')](function(_0x59449e){_0x1cb283[_0x497d('0x20')]=_0x59449e;if(_0x772d5c[_0x497d('0x30')][_0x497d('0x42')]){_0x479be6[_0x497d('0x43')]=[{'all':!![]}];}return db[_0x497d('0x41')][_0x497d('0x44')](_0x479be6);})[_0x497d('0x27')](function(_0x3b11b9){_0x1cb283[_0x497d('0x45')]=_0x3b11b9;return _0x1cb283;})[_0x497d('0x27')](respondWithFilteredResult(_0x488a99,_0x479be6))['catch'](handleError(_0x488a99,null));};exports[_0x497d('0x46')]=function(_0xa4eb86,_0x66c649){var _0x5b4c57={'raw':!![],'where':{'id':_0xa4eb86[_0x497d('0x47')]['id']}},_0x5ba64e={};_0x5ba64e[_0x497d('0x2f')]=_[_0x497d('0x31')](db['CmHopperHistory']['rawAttributes']);_0x5ba64e[_0x497d('0x30')]=_[_0x497d('0x31')](_0xa4eb86[_0x497d('0x30')]);_0x5ba64e[_0x497d('0x32')]=_[_0x497d('0x34')](_0x5ba64e[_0x497d('0x2f')],_0x5ba64e[_0x497d('0x30')]);_0x5b4c57[_0x497d('0x33')]=_[_0x497d('0x34')](_0x5ba64e[_0x497d('0x2f')],qs[_0x497d('0x35')](_0xa4eb86[_0x497d('0x30')][_0x497d('0x35')]));_0x5b4c57['attributes']=_0x5b4c57[_0x497d('0x33')]['length']?_0x5b4c57[_0x497d('0x33')]:_0x5ba64e[_0x497d('0x2f')];if(_0xa4eb86[_0x497d('0x30')][_0x497d('0x42')]){_0x5b4c57[_0x497d('0x43')]=[{'all':!![]}];}_0x5b4c57=_[_0x497d('0x3d')]({},_0x5b4c57,_0xa4eb86[_0x497d('0x40')]);return db[_0x497d('0x41')][_0x497d('0x48')](_0x5b4c57)['then'](handleEntityNotFound(_0x66c649,null))[_0x497d('0x27')](respondWithResult(_0x66c649,null))['catch'](handleError(_0x66c649,null));};exports[_0x497d('0x49')]=function(_0x411444,_0x2ea147){return db[_0x497d('0x41')]['create'](_0x411444[_0x497d('0x4a')],{})[_0x497d('0x27')](respondWithResult(_0x2ea147,0xc9))[_0x497d('0x4b')](handleError(_0x2ea147,null));};exports[_0x497d('0x4c')]=function(_0x226519,_0x133cb2){return db[_0x497d('0x41')]['describe']()[_0x497d('0x27')](respondWithResult(_0x133cb2,null))[_0x497d('0x4b')](handleError(_0x133cb2,null));};exports[_0x497d('0x25')]=function(_0x3c890c,_0x16ade7){if(_0x3c890c[_0x497d('0x4a')][_0x497d('0x4d')]){delete _0x3c890c[_0x497d('0x4a')]['uniqueid'];}return db[_0x497d('0x41')][_0x497d('0x48')]({'where':{'uniqueid':_0x3c890c[_0x497d('0x47')]['id']}})[_0x497d('0x27')](handleEntityNotFound(_0x16ade7,null))[_0x497d('0x27')](saveUpdates(_0x3c890c[_0x497d('0x4a')],null))['then'](respondWithResult(_0x16ade7,null))[_0x497d('0x4b')](handleError(_0x16ade7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index e722fec..0e69502 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 _0x2ebd=['rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x46cd34,_0x104b47){var _0x5bf2d4=function(_0x4d7b52){while(--_0x4d7b52){_0x46cd34['push'](_0x46cd34['shift']());}};_0x5bf2d4(++_0x104b47);}(_0x2ebd,0x1c8));var _0xd2eb=function(_0x29975a,_0x2ca253){_0x29975a=_0x29975a-0x0;var _0x41bcac=_0x2ebd[_0x29975a];return _0x41bcac;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var logger=require(_0xd2eb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd2eb('0x3'));var rp=require(_0xd2eb('0x4'));var fs=require('fs');var path=require(_0xd2eb('0x5'));var rimraf=require(_0xd2eb('0x6'));var config=require(_0xd2eb('0x7'));var attributes=require(_0xd2eb('0x8'));module['exports']=function(_0x553617,_0x2c08e5){return _0x553617[_0xd2eb('0x9')](_0xd2eb('0xa'),attributes,{'tableName':_0xd2eb('0xb'),'paranoid':![],'indexes':[{'name':_0xd2eb('0xc'),'fields':['endtime']},{'name':_0xd2eb('0xd'),'fields':[_0xd2eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4123=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x15f312,_0x1c7327){var _0x2fd3ff=function(_0x202426){while(--_0x202426){_0x15f312['push'](_0x15f312['shift']());}};_0x2fd3ff(++_0x1c7327);}(_0x4123,0x87));var _0x3412=function(_0x1af9dd,_0x441b58){_0x1af9dd=_0x1af9dd-0x0;var _0x9cdc0=_0x4123[_0x1af9dd];return _0x9cdc0;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[{'name':_0x3412('0xd'),'fields':[_0x3412('0xd')]},{'name':'uniqueid','fields':[_0x3412('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e402851..e5d09fb 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 _0x7985=['AvgHandleTime','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','catch','GetVoiceQueueHopperHistory','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7985,0x1de));var _0x5798=function(_0x4dd524,_0x2247e5){_0x4dd524=_0x4dd524-0x0;var _0x482629=_0x7985[_0x4dd524];return _0x482629;};'use strict';var _=require(_0x5798('0x0'));var util=require('util');var moment=require(_0x5798('0x1'));var BPromise=require(_0x5798('0x2'));var rs=require(_0x5798('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5798('0x4'));var logger=require(_0x5798('0x5'))(_0x5798('0x6'));var config=require('../../config/environment');var jayson=require(_0x5798('0x7'));var client=jayson[_0x5798('0x8')][_0x5798('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b18ae,_0xc5e33e,_0x5f2e1f){return new BPromise(function(_0x440294,_0x1b69d9){return client[_0x5798('0xa')](_0x5b18ae,_0x5f2e1f)[_0x5798('0xb')](function(_0x200c58){logger[_0x5798('0xc')](_0x5798('0xd'),_0xc5e33e,_0x5798('0xe'));logger['debug'](_0x5798('0xf'),_0xc5e33e,_0x5798('0xe'),JSON[_0x5798('0x10')](_0x200c58));if(_0x200c58[_0x5798('0x11')]){if(_0x200c58[_0x5798('0x11')][_0x5798('0x12')]===0x1f4){logger[_0x5798('0x11')](_0x5798('0xd'),_0xc5e33e,_0x200c58[_0x5798('0x11')]['message']);return _0x1b69d9(_0x200c58[_0x5798('0x11')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0xc5e33e,_0x200c58[_0x5798('0x11')][_0x5798('0x13')]);return _0x440294(_0x200c58[_0x5798('0x11')][_0x5798('0x13')]);}else{logger[_0x5798('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0xc5e33e,'request\x20sent');_0x440294(_0x200c58[_0x5798('0x14')]['message']);}})['catch'](function(_0x48c290){logger['error'](_0x5798('0xd'),_0xc5e33e,_0x48c290);_0x1b69d9(_0x48c290);});});}exports[_0x5798('0x15')]=function(_0xb9c076){var _0x272005=this;return new Promise(function(_0x26871f,_0x399bf6){return db[_0x5798('0x16')]['create'](_0xb9c076[_0x5798('0x17')],{'raw':_0xb9c076[_0x5798('0x18')]?_0xb9c076[_0x5798('0x18')][_0x5798('0x19')]===undefined?!![]:![]:!![]})[_0x5798('0xb')](function(_0x4dd1e2){logger[_0x5798('0xc')]('CreateCmHopperHistory',_0xb9c076);logger['debug'](_0x5798('0x15'),_0xb9c076,JSON[_0x5798('0x10')](_0x4dd1e2));_0x26871f(_0x4dd1e2);})['catch'](function(_0x4bd972){logger[_0x5798('0x11')](_0x5798('0x15'),_0x4bd972['message'],_0xb9c076);_0x399bf6(_0x272005['error'](0x1f4,_0x4bd972[_0x5798('0x13')]));});});};exports[_0x5798('0x1a')]=function(_0x5c296f){var _0x13dce5=this;return new Promise(function(_0x1096a0,_0x1867d6){return db[_0x5798('0x16')]['findAll']({'raw':_0x5c296f[_0x5798('0x18')]?_0x5c296f[_0x5798('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c296f['options']?_0x5c296f[_0x5798('0x18')]['where']||null:null,'attributes':[[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['col']('id')),_0x5798('0x1d')],[db[_0x5798('0x1b')]['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x5798('0x1e')))),_0x5798('0x1f')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0x5798('0x21')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x5798('0x1b')]['fn']('AVG',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x23')))),_0x5798('0x24')],[db['sequelize']['fn'](_0x5798('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x26')))),_0x5798('0x27')]]})['then'](function(_0x5b4379){logger[_0x5798('0xc')]('AvgHandleTime',_0x5c296f);logger[_0x5798('0x28')]('AvgHandleTime',_0x5c296f,JSON['stringify'](_0x5b4379));_0x1096a0(_0x5b4379);})[_0x5798('0x29')](function(_0x5eee64){logger[_0x5798('0x11')]('AvgHandleTime',_0x5eee64[_0x5798('0x13')],_0x5c296f);_0x1867d6(_0x13dce5[_0x5798('0x11')](0x1f4,_0x5eee64[_0x5798('0x13')]));});});};exports[_0x5798('0x2a')]=function(_0x4f5895){var _0x3518fe=this;return new Promise(function(_0x48eae3,_0x534333){return db['CmHopperHistory'][_0x5798('0x2b')]({'raw':_0x4f5895['options']?_0x4f5895[_0x5798('0x18')][_0x5798('0x19')]===undefined?!![]:![]:!![],'where':_0x4f5895[_0x5798('0x18')]?_0x4f5895[_0x5798('0x18')][_0x5798('0x2c')]||null:null,'attributes':[[_0x5798('0x2d'),_0x5798('0x2e')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db['sequelize']['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0x5798('0x30')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x1e')))),_0x5798('0x31')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x32')))),_0x5798('0x33')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x34')))),'outboundCongestionCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x35')))),_0x5798('0x36')],[db['sequelize']['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x37')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x38')))),_0x5798('0x39')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x3a')))),_0x5798('0x3b')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x3c')))),_0x5798('0x3d')],[db[_0x5798('0x1b')]['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x3e')))),'outboundRejectCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x3f')))),_0x5798('0x40')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x41')))),_0x5798('0x42')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x43')))),_0x5798('0x44')]],'group':['campaign']})[_0x5798('0xb')](function(_0x9dd130){logger[_0x5798('0xc')]('GetVoiceQueueHopperHistory',_0x4f5895);logger[_0x5798('0x28')]('GetVoiceQueueHopperHistory',_0x4f5895,JSON['stringify'](_0x9dd130));_0x48eae3(_0x9dd130);})[_0x5798('0x29')](function(_0x406468){logger[_0x5798('0x11')](_0x5798('0x2a'),_0x406468[_0x5798('0x13')],_0x4f5895);_0x534333(_0x3518fe[_0x5798('0x11')](0x1f4,_0x406468[_0x5798('0x13')]));});});};exports[_0x5798('0x45')]=function(_0x660076){var _0x1da114=this;return new Promise(function(_0x276713,_0x10bdcc){return db[_0x5798('0x16')][_0x5798('0x2b')]({'raw':_0x660076['options']?_0x660076[_0x5798('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x660076[_0x5798('0x18')]?_0x660076['options'][_0x5798('0x2c')]||null:null,'attributes':[[_0x5798('0x2d'),'name'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')][_0x5798('0x46')]('id')),'ivrTotalCallsDays'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x5798('0x47')]],'group':[_0x5798('0x2d')]})[_0x5798('0xb')](function(_0x49b469){logger[_0x5798('0xc')](_0x5798('0x45'),_0x660076);logger[_0x5798('0x28')]('GetCampaignHopperHistory',_0x660076,JSON[_0x5798('0x10')](_0x49b469));_0x276713(_0x49b469);})[_0x5798('0x29')](function(_0x28ec83){logger['error']('GetCampaignHopperHistory',_0x28ec83[_0x5798('0x13')],_0x660076);_0x10bdcc(_0x1da114[_0x5798('0x11')](0x1f4,_0x28ec83['message']));});});}; \ No newline at end of file +var _0x3df4=['findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','AvgHandleTime'];(function(_0x1e06c0,_0x3c8d32){var _0x20a073=function(_0x5e370f){while(--_0x5e370f){_0x1e06c0['push'](_0x1e06c0['shift']());}};_0x20a073(++_0x3c8d32);}(_0x3df4,0x102));var _0x43df=function(_0x5421eb,_0x426220){_0x5421eb=_0x5421eb-0x0;var _0x2a23e5=_0x3df4[_0x5421eb];return _0x2a23e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43df('0x0'));var BPromise=require(_0x43df('0x1'));var rs=require(_0x43df('0x2'));var fs=require('fs');var Redis=require(_0x43df('0x3'));var db=require(_0x43df('0x4'))['db'];var utils=require(_0x43df('0x5'));var logger=require(_0x43df('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43df('0x7'));var client=jayson[_0x43df('0x8')][_0x43df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43fd8c,_0x5ba02f,_0x5863be){return new BPromise(function(_0x2492a9,_0x44b685){return client[_0x43df('0xa')](_0x43fd8c,_0x5863be)[_0x43df('0xb')](function(_0x553304){logger[_0x43df('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x5ba02f,_0x43df('0xd'));logger[_0x43df('0xe')](_0x43df('0xf'),_0x5ba02f,_0x43df('0xd'),JSON[_0x43df('0x10')](_0x553304));if(_0x553304[_0x43df('0x11')]){if(_0x553304[_0x43df('0x11')]['code']===0x1f4){logger[_0x43df('0x11')](_0x43df('0x12'),_0x5ba02f,_0x553304['error'][_0x43df('0x13')]);return _0x44b685(_0x553304['error'][_0x43df('0x13')]);}logger[_0x43df('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x5ba02f,_0x553304[_0x43df('0x11')]['message']);return _0x2492a9(_0x553304['error'][_0x43df('0x13')]);}else{logger[_0x43df('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x5ba02f,_0x43df('0xd'));_0x2492a9(_0x553304['result'][_0x43df('0x13')]);}})[_0x43df('0x14')](function(_0x14b258){logger[_0x43df('0x11')](_0x43df('0x12'),_0x5ba02f,_0x14b258);_0x44b685(_0x14b258);});});}exports[_0x43df('0x15')]=function(_0x571404){var _0x376373=this;return new Promise(function(_0x334fae,_0x241066){return db[_0x43df('0x16')]['create'](_0x571404[_0x43df('0x17')],{'raw':_0x571404[_0x43df('0x18')]?_0x571404[_0x43df('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4303c5){logger[_0x43df('0xc')]('CreateCmHopperHistory',_0x571404);logger[_0x43df('0xe')](_0x43df('0x15'),_0x571404,JSON[_0x43df('0x10')](_0x4303c5));_0x334fae(_0x4303c5);})['catch'](function(_0x3b44d8){logger['error'](_0x43df('0x15'),_0x3b44d8['message'],_0x571404);_0x241066(_0x376373[_0x43df('0x11')](0x1f4,_0x3b44d8[_0x43df('0x13')]));});});};exports[_0x43df('0x19')]=function(_0x4d05c9){var _0x228afb=this;return new Promise(function(_0x591a8d,_0x252bcb){return db[_0x43df('0x16')][_0x43df('0x1a')]({'raw':_0x4d05c9[_0x43df('0x18')]?_0x4d05c9[_0x43df('0x18')][_0x43df('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d05c9[_0x43df('0x18')]?_0x4d05c9[_0x43df('0x18')][_0x43df('0x1c')]||null:null,'attributes':[[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db['sequelize'][_0x43df('0x1f')]('id')),_0x43df('0x20')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x22')))),_0x43df('0x23')],[db['sequelize']['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x24')))),_0x43df('0x25')],[db['sequelize']['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x26')))),_0x43df('0x27')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x28'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x29')))),_0x43df('0x2a')],[db[_0x43df('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x43df('0x1d')]['literal'](_0x43df('0x2b')))),_0x43df('0x2c')]]})[_0x43df('0xb')](function(_0x1ed18f){logger['info'](_0x43df('0x19'),_0x4d05c9);logger[_0x43df('0xe')](_0x43df('0x19'),_0x4d05c9,JSON['stringify'](_0x1ed18f));_0x591a8d(_0x1ed18f);})[_0x43df('0x14')](function(_0x24a20e){logger[_0x43df('0x11')](_0x43df('0x19'),_0x24a20e['message'],_0x4d05c9);_0x252bcb(_0x228afb[_0x43df('0x11')](0x1f4,_0x24a20e[_0x43df('0x13')]));});});};exports[_0x43df('0x2d')]=function(_0x18466b){var _0x25f1f5=this;return new Promise(function(_0x1e83ff,_0x5ed6f0){return db['CmHopperHistory'][_0x43df('0x1a')]({'raw':_0x18466b['options']?_0x18466b['options']['raw']===undefined?!![]:![]:!![],'where':_0x18466b['options']?_0x18466b[_0x43df('0x18')][_0x43df('0x1c')]||null:null,'attributes':[[_0x43df('0x2e'),_0x43df('0x2f')],[db['sequelize']['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db['sequelize'][_0x43df('0x21')](_0x43df('0x30')))),_0x43df('0x31')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db['sequelize'][_0x43df('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x22')))),'outboundAnswerCallsDay'],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x32')))),'outboundBusyCallsDay'],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')]['literal'](_0x43df('0x33')))),_0x43df('0x34')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x35')))),_0x43df('0x36')],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x43df('0x37')))),_0x43df('0x38')],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x39')))),_0x43df('0x3a')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x3b')))),'outboundBlacklistCallsDay'],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')]['literal'](_0x43df('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x3d')))),'outboundRejectCallsDay'],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x43df('0x3e')))),_0x43df('0x3f')],[db[_0x43df('0x1d')]['fn']('COUNT',db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')][_0x43df('0x21')](_0x43df('0x40')))),_0x43df('0x41')],[db[_0x43df('0x1d')]['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db[_0x43df('0x1d')]['literal'](_0x43df('0x42')))),_0x43df('0x43')]],'group':[_0x43df('0x2e')]})[_0x43df('0xb')](function(_0x5c87fc){logger[_0x43df('0xc')](_0x43df('0x2d'),_0x18466b);logger[_0x43df('0xe')](_0x43df('0x2d'),_0x18466b,JSON[_0x43df('0x10')](_0x5c87fc));_0x1e83ff(_0x5c87fc);})[_0x43df('0x14')](function(_0x576079){logger[_0x43df('0x11')](_0x43df('0x2d'),_0x576079['message'],_0x18466b);_0x5ed6f0(_0x25f1f5['error'](0x1f4,_0x576079['message']));});});};exports['GetCampaignHopperHistory']=function(_0x1974d7){var _0x357c5d=this;return new Promise(function(_0x54ad2e,_0x59341a){return db['CmHopperHistory'][_0x43df('0x1a')]({'raw':_0x1974d7[_0x43df('0x18')]?_0x1974d7[_0x43df('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1974d7[_0x43df('0x18')]?_0x1974d7['options'][_0x43df('0x1c')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['col']('id')),_0x43df('0x44')],[db['sequelize']['fn'](_0x43df('0x1e'),db[_0x43df('0x1d')]['fn']('IF',db['sequelize'][_0x43df('0x21')](_0x43df('0x22')))),_0x43df('0x45')]],'group':[_0x43df('0x2e')]})['then'](function(_0x13353f){logger[_0x43df('0xc')](_0x43df('0x46'),_0x1974d7);logger[_0x43df('0xe')](_0x43df('0x46'),_0x1974d7,JSON[_0x43df('0x10')](_0x13353f));_0x54ad2e(_0x13353f);})[_0x43df('0x14')](function(_0x18d6fc){logger[_0x43df('0x11')](_0x43df('0x46'),_0x18d6fc[_0x43df('0x13')],_0x1974d7);_0x59341a(_0x357c5d[_0x43df('0x11')](0x1f4,_0x18d6fc[_0x43df('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 733a21a..5cc65f8 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 _0x1591=['post','put','/:id','exports','path','express','Router','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','show'];(function(_0x45aac6,_0x13dafe){var _0x535760=function(_0x3dfb4d){while(--_0x3dfb4d){_0x45aac6['push'](_0x45aac6['shift']());}};_0x535760(++_0x13dafe);}(_0x1591,0x1b7));var _0x1159=function(_0x38223f,_0x3a0dfc){_0x38223f=_0x38223f-0x0;var _0x3e3fab=_0x1591[_0x38223f];return _0x3e3fab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1159('0x0'));var timeout=require('connect-timeout');var express=require(_0x1159('0x1'));var router=express[_0x1159('0x2')]();var fs_extra=require(_0x1159('0x3'));var auth=require(_0x1159('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1159('0x5'));router[_0x1159('0x6')]('/',auth[_0x1159('0x7')](),controller[_0x1159('0x8')]);router['get'](_0x1159('0x9'),auth[_0x1159('0x7')](),controller['describe']);router[_0x1159('0x6')]('/:id',auth[_0x1159('0x7')](),controller[_0x1159('0xa')]);router[_0x1159('0xb')]('/',auth[_0x1159('0x7')](),controller['create']);router[_0x1159('0xc')](_0x1159('0xd'),auth[_0x1159('0x7')](),controller['update']);module[_0x1159('0xe')]=router; \ No newline at end of file +var _0x275f=['show','post','create','/:id','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5939c9,_0x526004){var _0xe47d46=function(_0x727507){while(--_0x727507){_0x5939c9['push'](_0x5939c9['shift']());}};_0xe47d46(++_0x526004);}(_0x275f,0x92));var _0xf275=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x275f[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xf275('0x0'));var util=require(_0xf275('0x1'));var path=require(_0xf275('0x2'));var timeout=require(_0xf275('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf275('0x4'));var auth=require(_0xf275('0x5'));var interaction=require(_0xf275('0x6'));var config=require(_0xf275('0x7'));var controller=require(_0xf275('0x8'));router[_0xf275('0x9')]('/',auth[_0xf275('0xa')](),controller[_0xf275('0xb')]);router[_0xf275('0x9')](_0xf275('0xc'),auth[_0xf275('0xa')](),controller[_0xf275('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf275('0xe')]);router[_0xf275('0xf')]('/',auth['isAuthenticated'](),controller[_0xf275('0x10')]);router['put'](_0xf275('0x11'),auth['isAuthenticated'](),controller[_0xf275('0x12')]);module[_0xf275('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 7af73f2..927c1e1 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 _0x9649=['exports','STRING','name','sequelize'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0x9649,0x19f));var _0x9964=function(_0x46716f,_0x52d842){_0x46716f=_0x46716f-0x0;var _0x5c811e=_0x9649[_0x46716f];return _0x5c811e;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')],'unique':_0x9964('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x9964('0x2')]}}; \ No newline at end of file +var _0x68f5=['sequelize','exports','STRING'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x68f5,0x11a));var _0x568f=function(_0x4769eb,_0x2308b4){_0x4769eb=_0x4769eb-0x0;var _0x3db2f5=_0x68f5[_0x4769eb];return _0x3db2f5;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'name':{'type':Sequelize[_0x568f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x568f('0x2')]},'dialPrefix':{'type':Sequelize[_0x568f('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 5ce44c7..6eb8094 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 _0x7b38=['merge','type','options','includeAll','include','findAll','rows','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','ListId','removeDispositions','addContacts','tags','isArray','join','push','each','CmContact','omit','ids','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','cf_%d','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','addCustomField','transaction','addCustomFields','Sequelize','number','INTEGER','switch','defaultValue','sequelize','cf_%s','getCustomFields','findAndCountAll','spread','userCmList:save','userCmList:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Lists','then','stack','name','send','index','map','CmList','rawAttributes','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where'];(function(_0x5d80df,_0x4c8443){var _0x329b21=function(_0x3b805a){while(--_0x3b805a){_0x5d80df['push'](_0x5d80df['shift']());}};_0x329b21(++_0x4c8443);}(_0x7b38,0x167));var _0x87b3=function(_0x46aada,_0x3136ea){_0x46aada=_0x46aada-0x0;var _0x48641b=_0x7b38[_0x46aada];return _0x48641b;};'use strict';var emlformat=require(_0x87b3('0x0'));var rimraf=require(_0x87b3('0x1'));var zipdir=require(_0x87b3('0x2'));var jsonpatch=require(_0x87b3('0x3'));var rp=require('request-promise');var moment=require(_0x87b3('0x4'));var BPromise=require(_0x87b3('0x5'));var Mustache=require(_0x87b3('0x6'));var util=require(_0x87b3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x87b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87b3('0x9'));var _=require(_0x87b3('0xa'));var squel=require(_0x87b3('0xb'));var crypto=require(_0x87b3('0xc'));var jsforce=require(_0x87b3('0xd'));var deskjs=require(_0x87b3('0xe'));var toCsv=require(_0x87b3('0x8'));var querystring=require(_0x87b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x87b3('0x10'));var authService=require(_0x87b3('0x11'));var qs=require(_0x87b3('0x12'));var as=require(_0x87b3('0x13'));var hardwareService=require(_0x87b3('0x14'));var logger=require(_0x87b3('0x15'))(_0x87b3('0x16'));var utils=require(_0x87b3('0x17'));var config=require(_0x87b3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x87b3('0x19'))['db'];config[_0x87b3('0x1a')]=_[_0x87b3('0x1b')](config[_0x87b3('0x1a')],{'host':_0x87b3('0x1c'),'port':0x18eb});var socket=require(_0x87b3('0x1d'))(new Redis(config[_0x87b3('0x1a')]));require(_0x87b3('0x1e'))[_0x87b3('0x1f')](socket);function respondWithStatusCode(_0x2175c5,_0xaab5d6){_0xaab5d6=_0xaab5d6||0xcc;return function(_0x5b9ff8){if(_0x5b9ff8){return _0x2175c5[_0x87b3('0x20')](_0xaab5d6);}return _0x2175c5['status'](_0xaab5d6)[_0x87b3('0x21')]();};}function respondWithResult(_0x1e7ffa,_0x58b648){_0x58b648=_0x58b648||0xc8;return function(_0x34265b){if(_0x34265b){return _0x1e7ffa[_0x87b3('0x22')](_0x58b648)[_0x87b3('0x23')](_0x34265b);}};}function respondWithFilteredResult(_0x1f4db4,_0x6a5ee1){return function(_0x22f00b){if(_0x22f00b){var _0x2e902f=typeof _0x6a5ee1[_0x87b3('0x24')]===_0x87b3('0x25')&&typeof _0x6a5ee1[_0x87b3('0x26')]==='undefined';var _0x2d53ff=_0x22f00b[_0x87b3('0x27')];var _0x154cc8=_0x2e902f?0x0:_0x6a5ee1[_0x87b3('0x24')];var _0x454466=_0x2e902f?_0x22f00b[_0x87b3('0x27')]:_0x6a5ee1['offset']+_0x6a5ee1[_0x87b3('0x26')];var _0x503c83;if(_0x454466>=_0x2d53ff){_0x454466=_0x2d53ff;_0x503c83=0xc8;}else{_0x503c83=0xce;}_0x1f4db4['status'](_0x503c83);return _0x1f4db4[_0x87b3('0x28')](_0x87b3('0x29'),_0x154cc8+'-'+_0x454466+'/'+_0x2d53ff)[_0x87b3('0x23')](_0x22f00b);}return null;};}function patchUpdates(_0x26f845){return function(_0xbd0e7f){try{jsonpatch[_0x87b3('0x2a')](_0xbd0e7f,_0x26f845,!![]);}catch(_0x17e936){return BPromise['reject'](_0x17e936);}return _0xbd0e7f[_0x87b3('0x2b')]();};}function saveUpdates(_0x3415fe,_0x2c2521){return function(_0x3b2000){if(_0x3b2000){return _0x3b2000[_0x87b3('0x2c')](_0x3415fe)['then'](function(_0x4beed8){return _0x4beed8;});}return null;};}function removeEntity(_0x2f525b,_0x2b3f7c){return function(_0x49af85){if(_0x49af85){return _0x49af85[_0x87b3('0x2d')]()['then'](function(){var _0x2ebab3=_0x49af85[_0x87b3('0x2e')]({'plain':!![]});var _0xb07ae1=_0x87b3('0x2f');return db['UserProfileResource'][_0x87b3('0x2d')]({'where':{'type':_0xb07ae1,'resourceId':_0x2ebab3['id']}})['then'](function(){return _0x49af85;});})[_0x87b3('0x30')](function(){_0x2f525b[_0x87b3('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7dfd,_0x213922){return function(_0x21afd9){if(!_0x21afd9){_0x3b7dfd[_0x87b3('0x20')](0x194);}return _0x21afd9;};}function handleError(_0x327c4d,_0x1cdfd6){_0x1cdfd6=_0x1cdfd6||0x1f4;return function(_0x3369e4){logger['error'](_0x3369e4[_0x87b3('0x31')]);if(_0x3369e4[_0x87b3('0x32')]){delete _0x3369e4[_0x87b3('0x32')];}_0x327c4d[_0x87b3('0x22')](_0x1cdfd6)[_0x87b3('0x33')](_0x3369e4);};}exports[_0x87b3('0x34')]=function(_0x392ed6,_0xe1e07e){var _0x33590d={},_0x41297f={},_0x3e5ee1={'count':0x0,'rows':[]};var _0xf50f40=_[_0x87b3('0x35')](db[_0x87b3('0x36')][_0x87b3('0x37')],function(_0x273ce9){return{'name':_0x273ce9['fieldName'],'type':_0x273ce9['type'][_0x87b3('0x38')]};});_0x41297f[_0x87b3('0x39')]=_[_0x87b3('0x35')](_0xf50f40,_0x87b3('0x32'));_0x41297f[_0x87b3('0x3a')]=_['keys'](_0x392ed6[_0x87b3('0x3a')]);_0x41297f['filters']=_[_0x87b3('0x3b')](_0x41297f[_0x87b3('0x39')],_0x41297f[_0x87b3('0x3a')]);_0x33590d['attributes']=_['intersection'](_0x41297f['model'],qs[_0x87b3('0x3c')](_0x392ed6[_0x87b3('0x3a')]['fields']));_0x33590d['attributes']=_0x33590d[_0x87b3('0x3d')][_0x87b3('0x3e')]?_0x33590d[_0x87b3('0x3d')]:_0x41297f[_0x87b3('0x39')];if(!_0x392ed6[_0x87b3('0x3a')]['hasOwnProperty'](_0x87b3('0x3f'))){_0x33590d['limit']=qs[_0x87b3('0x26')](_0x392ed6[_0x87b3('0x3a')][_0x87b3('0x26')]);_0x33590d[_0x87b3('0x24')]=qs[_0x87b3('0x24')](_0x392ed6[_0x87b3('0x3a')]['offset']);}_0x33590d[_0x87b3('0x40')]=qs[_0x87b3('0x41')](_0x392ed6['query'][_0x87b3('0x41')]);_0x33590d['where']=qs[_0x87b3('0x42')](_[_0x87b3('0x43')](_0x392ed6['query'],_0x41297f[_0x87b3('0x42')]),_0xf50f40);if(_0x392ed6['query'][_0x87b3('0x44')]){_0x33590d[_0x87b3('0x45')]=_[_0x87b3('0x46')](_0x33590d[_0x87b3('0x45')],{'$or':_[_0x87b3('0x35')](_0xf50f40,function(_0x1063e1){if(_0x1063e1[_0x87b3('0x47')]!=='VIRTUAL'){var _0x129e7a={};_0x129e7a[_0x1063e1[_0x87b3('0x32')]]={'$like':'%'+_0x392ed6[_0x87b3('0x3a')][_0x87b3('0x44')]+'%'};return _0x129e7a;}})});}_0x33590d=_[_0x87b3('0x46')]({},_0x33590d,_0x392ed6[_0x87b3('0x48')]);var _0x5b25d3={'where':_0x33590d[_0x87b3('0x45')]};return db[_0x87b3('0x36')][_0x87b3('0x27')](_0x5b25d3)[_0x87b3('0x30')](function(_0x407553){_0x3e5ee1[_0x87b3('0x27')]=_0x407553;if(_0x392ed6[_0x87b3('0x3a')][_0x87b3('0x49')]){_0x33590d[_0x87b3('0x4a')]=[{'all':!![]}];}return db[_0x87b3('0x36')][_0x87b3('0x4b')](_0x33590d);})[_0x87b3('0x30')](function(_0x2a196c){_0x3e5ee1[_0x87b3('0x4c')]=_0x2a196c;return _0x3e5ee1;})['then'](respondWithFilteredResult(_0xe1e07e,_0x33590d))['catch'](handleError(_0xe1e07e,null));};exports['show']=function(_0x526e8d,_0x1703ba){var _0x1e1925={'raw':![],'where':{'id':_0x526e8d[_0x87b3('0x4d')]['id']}},_0x3dd550={};_0x3dd550[_0x87b3('0x39')]=_[_0x87b3('0x4e')](db[_0x87b3('0x36')][_0x87b3('0x37')]);_0x3dd550[_0x87b3('0x3a')]=_[_0x87b3('0x4e')](_0x526e8d[_0x87b3('0x3a')]);_0x3dd550[_0x87b3('0x42')]=_[_0x87b3('0x3b')](_0x3dd550[_0x87b3('0x39')],_0x3dd550[_0x87b3('0x3a')]);_0x1e1925['attributes']=_['intersection'](_0x3dd550[_0x87b3('0x39')],qs[_0x87b3('0x3c')](_0x526e8d[_0x87b3('0x3a')][_0x87b3('0x3c')]));_0x1e1925[_0x87b3('0x3d')]=_0x1e1925[_0x87b3('0x3d')][_0x87b3('0x3e')]?_0x1e1925[_0x87b3('0x3d')]:_0x3dd550['model'];if(_0x526e8d['query']['includeAll']){_0x1e1925['include']=[{'all':!![]}];}_0x1e1925=_[_0x87b3('0x46')]({},_0x1e1925,_0x526e8d[_0x87b3('0x48')]);return db[_0x87b3('0x36')][_0x87b3('0x4f')](_0x1e1925)[_0x87b3('0x30')](handleEntityNotFound(_0x1703ba,null))[_0x87b3('0x30')](respondWithResult(_0x1703ba,null))[_0x87b3('0x50')](handleError(_0x1703ba,null));};exports[_0x87b3('0x51')]=function(_0x54e9ad,_0x2a235e){return db[_0x87b3('0x36')][_0x87b3('0x51')](_0x54e9ad['body'],{})[_0x87b3('0x30')](function(_0x4c95da){var _0x551a18=_0x54e9ad[_0x87b3('0x52')][_0x87b3('0x2e')]({'plain':!![]});if(!_0x551a18)throw new Error(_0x87b3('0x53'));if(_0x551a18[_0x87b3('0x54')]===_0x87b3('0x52')){var _0x2cc8b2=_0x4c95da['get']({'plain':!![]});var _0x5a1dc0=_0x87b3('0x2f');return db[_0x87b3('0x55')][_0x87b3('0x4f')]({'where':{'name':_0x5a1dc0,'userProfileId':_0x551a18[_0x87b3('0x56')]},'raw':!![]})[_0x87b3('0x30')](function(_0x4ad6e3){if(_0x4ad6e3&&_0x4ad6e3[_0x87b3('0x57')]===0x0){return db[_0x87b3('0x58')][_0x87b3('0x51')]({'name':_0x2cc8b2[_0x87b3('0x32')],'resourceId':_0x2cc8b2['id'],'type':_0x4ad6e3['name'],'sectionId':_0x4ad6e3['id']},{})[_0x87b3('0x30')](function(){return _0x4c95da;});}else{return _0x4c95da;}})[_0x87b3('0x50')](function(_0x5e5ca5){logger['error'](_0x87b3('0x59'),_0x5e5ca5);throw _0x5e5ca5;});}return _0x4c95da;})[_0x87b3('0x30')](respondWithResult(_0x2a235e,0xc9))[_0x87b3('0x50')](handleError(_0x2a235e,null));};exports['update']=function(_0x3788c1,_0x3db83b){if(_0x3788c1[_0x87b3('0x5a')]['id']){delete _0x3788c1[_0x87b3('0x5a')]['id'];}return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x3788c1[_0x87b3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3db83b,null))['then'](saveUpdates(_0x3788c1[_0x87b3('0x5a')],null))[_0x87b3('0x30')](respondWithResult(_0x3db83b,null))[_0x87b3('0x50')](handleError(_0x3db83b,null));};exports['destroy']=function(_0x17e072,_0x553387){return db['CmList'][_0x87b3('0x4f')]({'where':{'id':_0x17e072[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x553387,null))[_0x87b3('0x30')](removeEntity(_0x553387,null))['catch'](handleError(_0x553387,null));};exports['describe']=function(_0x5f3d59,_0x5981e9){return db[_0x87b3('0x36')][_0x87b3('0x5b')]()['then'](respondWithResult(_0x5981e9,null))['catch'](handleError(_0x5981e9,null));};exports[_0x87b3('0x5c')]=function(_0x4a6883,_0x10d294,_0x51f103){if(_0x4a6883[_0x87b3('0x5a')]['id']){delete _0x4a6883[_0x87b3('0x5a')]['id'];}return db['CmList']['find']({'where':{'id':_0x4a6883[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x10d294,null))[_0x87b3('0x30')](function(_0x450f7d){if(_0x450f7d){_0x4a6883[_0x87b3('0x5a')]['ListId']=_0x450f7d['id'];return db['Disposition'][_0x87b3('0x51')](_0x4a6883[_0x87b3('0x5a')]);}})[_0x87b3('0x30')](respondWithResult(_0x10d294,null))['catch'](handleError(_0x10d294,null));};exports[_0x87b3('0x5d')]=function(_0x36f8f4,_0x557226,_0x53357d){var _0x1f52c5={'raw':![],'where':{}};var _0x47d0db={};var _0x8e535a={'count':0x0,'rows':[]};return db['CmList'][_0x87b3('0x5e')]({'where':{'id':_0x36f8f4[_0x87b3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x557226,null))[_0x87b3('0x30')](function(_0xed56ce){if(_0xed56ce){_0x47d0db[_0x87b3('0x39')]=_[_0x87b3('0x4e')](db[_0x87b3('0x5f')][_0x87b3('0x37')]);_0x47d0db[_0x87b3('0x3a')]=_[_0x87b3('0x4e')](_0x36f8f4[_0x87b3('0x3a')]);_0x47d0db[_0x87b3('0x42')]=_['intersection'](_0x47d0db['model'],_0x47d0db[_0x87b3('0x3a')]);_0x1f52c5[_0x87b3('0x3d')]=_[_0x87b3('0x3b')](_0x47d0db[_0x87b3('0x39')],qs['fields'](_0x36f8f4[_0x87b3('0x3a')][_0x87b3('0x3c')]));_0x1f52c5[_0x87b3('0x3d')]=_0x1f52c5[_0x87b3('0x3d')]['length']?_0x1f52c5[_0x87b3('0x3d')]:_0x47d0db[_0x87b3('0x39')];if(!_0x36f8f4[_0x87b3('0x3a')][_0x87b3('0x60')]('nolimit')){_0x1f52c5['limit']=qs['limit'](_0x36f8f4['query'][_0x87b3('0x26')]);_0x1f52c5['offset']=qs[_0x87b3('0x24')](_0x36f8f4[_0x87b3('0x3a')][_0x87b3('0x24')]);}_0x1f52c5['order']=qs['sort'](_0x36f8f4[_0x87b3('0x3a')]['sort']);_0x1f52c5[_0x87b3('0x45')]=qs['filters'](_['pick'](_0x36f8f4['query'],_0x47d0db[_0x87b3('0x42')]));_0x1f52c5[_0x87b3('0x45')][_0x87b3('0x61')]=_0xed56ce['id'];if(_0x36f8f4[_0x87b3('0x3a')][_0x87b3('0x44')]){_0x1f52c5['where']=_[_0x87b3('0x46')](_0x1f52c5[_0x87b3('0x45')],{'$or':_['map'](_0x1f52c5['attributes'],function(_0x533f1c){var _0xa7c282={};_0xa7c282[_0x533f1c]={'$like':'%'+_0x36f8f4['query'][_0x87b3('0x44')]+'%'};return _0xa7c282;})});}_0x1f52c5=_[_0x87b3('0x46')]({},_0x1f52c5,_0x36f8f4[_0x87b3('0x48')]);return db[_0x87b3('0x5f')][_0x87b3('0x27')]({'where':_0x1f52c5['where']})[_0x87b3('0x30')](function(_0x3da91a){_0x8e535a[_0x87b3('0x27')]=_0x3da91a;if(_0x36f8f4[_0x87b3('0x3a')][_0x87b3('0x49')]){_0x1f52c5['include']=[{'all':!![]}];}return db[_0x87b3('0x5f')]['findAll'](_0x1f52c5);})['then'](function(_0x5b17c1){_0x8e535a[_0x87b3('0x4c')]=_0x5b17c1;return _0x8e535a;});}})[_0x87b3('0x30')](respondWithFilteredResult(_0x557226,_0x1f52c5))[_0x87b3('0x50')](handleError(_0x557226,null));};exports[_0x87b3('0x62')]=function(_0x726de,_0x1df9b4,_0x1c71ea){return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x726de['params']['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x1df9b4,null))[_0x87b3('0x30')](function(_0x5b892c){if(_0x5b892c){return _0x5b892c['removeDispositions'](_0x726de[_0x87b3('0x3a')]['ids']);}})[_0x87b3('0x30')](respondWithStatusCode(_0x1df9b4,null))['catch'](handleError(_0x1df9b4,null));};exports[_0x87b3('0x63')]=function(_0x2b24d2,_0x2c7ed8,_0x38cb05){return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x2b24d2[_0x87b3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c7ed8,null))['then'](function(_0x2f5b5a){if(_0x2f5b5a){var _0x37dcc3=[];var _0x40791b={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0x5242a9){if(_0x2b24d2[_0x87b3('0x5a')][_0x87b3('0x64')]&&_[_0x87b3('0x65')](_0x2b24d2[_0x87b3('0x5a')][_0x87b3('0x64')])){if(_0x2b24d2[_0x87b3('0x5a')][_0x87b3('0x64')]['length']){_0x2b24d2['body'][_0x87b3('0x64')]=_0x2b24d2[_0x87b3('0x5a')][_0x87b3('0x64')][_0x87b3('0x66')](';')+';';}else{_0x2b24d2[_0x87b3('0x5a')]['tags']=null;}}else{_0x2b24d2[_0x87b3('0x5a')]['tags']=null;}if(_0x2b24d2[_0x87b3('0x5a')]&&_[_0x87b3('0x65')](_0x2b24d2[_0x87b3('0x5a')])){for(var _0x45609e=0x0;_0x45609e<_0x2b24d2[_0x87b3('0x5a')][_0x87b3('0x3e')];_0x45609e+=0x1){_0x2b24d2[_0x87b3('0x5a')][_0x45609e][_0x87b3('0x61')]=_0x2b24d2[_0x87b3('0x4d')]['id'];_0x37dcc3[_0x87b3('0x67')](_0x2b24d2[_0x87b3('0x5a')][_0x45609e]);}return BPromise[_0x87b3('0x68')](_0x37dcc3,function(_0x7bdb8b){return db[_0x87b3('0x69')][_0x87b3('0x51')](_[_0x87b3('0x6a')](_0x7bdb8b,[_0x87b3('0x6b'),'id'])||{},{'fields':_['keys'](_0x5242a9),'raw':!![]})['then'](function(_0x51cd7f){_0x40791b[_0x87b3('0x6c')][_0x87b3('0x67')](_0x51cd7f['dataValues']);})['catch'](function(_0x52a7eb){_0x40791b[_0x87b3('0x6d')][_0x87b3('0x67')]({'data':_0x7bdb8b,'error':_0x52a7eb[_0x87b3('0x6e')]});});})[_0x87b3('0x30')](function(_0x318bb0){return _0x40791b;})[_0x87b3('0x50')](function(_0x222cf9){return _0x222cf9;});}else{_0x2c7ed8[_0x87b3('0x22')](0x190)['json']({'message':_0x87b3('0x6f')});}});}})[_0x87b3('0x30')](respondWithResult(_0x2c7ed8,null))[_0x87b3('0x50')](handleError(_0x2c7ed8,null));};exports[_0x87b3('0x70')]=function(_0x2578f6,_0x3c8ef1,_0x3ca040){var _0x2ebe1c;return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x2578f6[_0x87b3('0x4d')]['id']},'include':[{'model':db[_0x87b3('0x71')],'as':_0x87b3('0x72')}]})[_0x87b3('0x30')](handleEntityNotFound(_0x3c8ef1,null))[_0x87b3('0x30')](function(_0x211206){if(_0x211206){_0x2ebe1c=_0x211206;return db[_0x87b3('0x69')][_0x87b3('0x37')];}})[_0x87b3('0x30')](function(_0x503adb){if(_0x503adb){var _0x247d0d={};var _0x21d9bf={};_0x21d9bf[_0x87b3('0x39')]=_[_0x87b3('0x73')](_[_0x87b3('0x4e')](_0x503adb),_[_0x87b3('0x35')](_0x2ebe1c[_0x87b3('0x72')],function(_0x57ad60){return util[_0x87b3('0x74')]('cf_%d',_0x57ad60['id']);}));_0x21d9bf[_0x87b3('0x3a')]=_['keys'](_0x2578f6[_0x87b3('0x3a')]);_0x21d9bf[_0x87b3('0x42')]=_[_0x87b3('0x3b')](_0x21d9bf[_0x87b3('0x39')],_0x21d9bf[_0x87b3('0x3a')]);_0x247d0d[_0x87b3('0x3d')]=_[_0x87b3('0x3b')](_0x21d9bf[_0x87b3('0x39')],qs[_0x87b3('0x3c')](_0x2578f6[_0x87b3('0x3a')]['fields']));_0x247d0d[_0x87b3('0x3d')]=_0x247d0d[_0x87b3('0x3d')][_0x87b3('0x3e')]?_0x247d0d[_0x87b3('0x3d')]:_0x21d9bf[_0x87b3('0x39')];if(!_0x2578f6['query'][_0x87b3('0x60')](_0x87b3('0x3f'))){_0x247d0d[_0x87b3('0x26')]=qs['limit'](_0x2578f6[_0x87b3('0x3a')]['limit']);_0x247d0d['offset']=qs[_0x87b3('0x24')](_0x2578f6[_0x87b3('0x3a')][_0x87b3('0x24')]);}_0x247d0d[_0x87b3('0x40')]=qs[_0x87b3('0x41')](_0x2578f6['query'][_0x87b3('0x41')]);_0x247d0d[_0x87b3('0x45')]=qs[_0x87b3('0x42')](_['pick'](_0x2578f6[_0x87b3('0x3a')],_0x21d9bf[_0x87b3('0x42')]));_0x247d0d[_0x87b3('0x75')]=!![];if(_0x2578f6[_0x87b3('0x3a')][_0x87b3('0x44')]){_0x247d0d['where']=_[_0x87b3('0x46')](_0x247d0d[_0x87b3('0x45')],{'$or':_[_0x87b3('0x35')](_0x247d0d[_0x87b3('0x3d')],function(_0x1d35fd){var _0x45cf33={};_0x45cf33[_0x1d35fd]={'$like':'%'+_0x2578f6['query']['filter']+'%'};return _0x45cf33;})});}_0x247d0d=_[_0x87b3('0x46')]({},_0x247d0d,_0x2578f6['options']);return _0x2ebe1c[_0x87b3('0x70')](_0x247d0d);}})['then'](respondWithResult(_0x3c8ef1,null))[_0x87b3('0x50')](handleError(_0x3c8ef1,null));};exports[_0x87b3('0x76')]=function(_0x23478c,_0x44111a,_0x123397){var _0x18134a;return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x23478c[_0x87b3('0x4d')]['id']},'include':[{'model':db[_0x87b3('0x71')],'as':'CustomFields'}]})[_0x87b3('0x30')](handleEntityNotFound(_0x44111a,null))[_0x87b3('0x30')](function(_0x534c4a){if(_0x534c4a){_0x18134a=_0x534c4a;return db[_0x87b3('0x69')]['rawAttributes'];}})[_0x87b3('0x30')](function(_0x11ab8f){if(_0x11ab8f){var _0x3c3eea={};var _0x37b409={};_0x37b409[_0x87b3('0x39')]=_['concat'](_['keys'](_0x11ab8f),_[_0x87b3('0x35')](_0x18134a[_0x87b3('0x72')],function(_0x446576){return util['format'](_0x87b3('0x77'),_0x446576['id']);}));_0x37b409[_0x87b3('0x3a')]=_[_0x87b3('0x4e')](_0x23478c[_0x87b3('0x3a')]);_0x37b409[_0x87b3('0x42')]=_[_0x87b3('0x3b')](_0x37b409[_0x87b3('0x39')],_0x37b409[_0x87b3('0x3a')]);_0x3c3eea[_0x87b3('0x3d')]=_[_0x87b3('0x3b')](_0x37b409[_0x87b3('0x39')],qs[_0x87b3('0x3c')](_0x23478c[_0x87b3('0x3a')][_0x87b3('0x3c')]));_0x3c3eea[_0x87b3('0x3d')]=_0x3c3eea[_0x87b3('0x3d')][_0x87b3('0x3e')]?_0x3c3eea[_0x87b3('0x3d')]:_0x37b409[_0x87b3('0x39')];if(!_0x23478c['query']['hasOwnProperty'](_0x87b3('0x3f'))){_0x3c3eea['limit']=qs[_0x87b3('0x26')](_0x23478c[_0x87b3('0x3a')]['limit']);_0x3c3eea['offset']=qs[_0x87b3('0x24')](_0x23478c[_0x87b3('0x3a')]['offset']);}_0x3c3eea[_0x87b3('0x40')]=qs[_0x87b3('0x41')](_0x23478c['query'][_0x87b3('0x41')]);_0x3c3eea[_0x87b3('0x45')]=qs[_0x87b3('0x42')](_[_0x87b3('0x43')](_0x23478c[_0x87b3('0x3a')],_0x37b409[_0x87b3('0x42')]));_0x3c3eea['raw']=!![];if(_0x23478c['query'][_0x87b3('0x44')]){_0x3c3eea[_0x87b3('0x45')]=_['merge'](_0x3c3eea['where'],{'$or':_['map'](_0x3c3eea['attributes'],function(_0x46a94e){var _0x24c152={};_0x24c152[_0x46a94e]={'$like':'%'+_0x23478c['query'][_0x87b3('0x44')]+'%'};return _0x24c152;})});}_0x3c3eea=_[_0x87b3('0x46')]({},_0x3c3eea,_0x23478c[_0x87b3('0x48')]);return _0x18134a[_0x87b3('0x70')](_0x3c3eea);}})[_0x87b3('0x30')](function(_0x16b1e5){if(!_['isEmpty'](_0x16b1e5)){var _0x13f0f6=toCsv(_0x16b1e5);var _0x4e21aa=Date[_0x87b3('0x78')]();fs[_0x87b3('0x79')](util['format'](_0x87b3('0x7a'),_0x18134a['id'],_0x4e21aa),_0x13f0f6);_0x44111a[_0x87b3('0x7b')]('Content-disposition',_0x87b3('0x7c')+util[_0x87b3('0x74')]('list_%d_%s.csv',_0x18134a['id'],_0x4e21aa));_0x44111a['setHeader'](_0x87b3('0x7d'),'text/csv');return _0x44111a['download'](util[_0x87b3('0x74')](_0x87b3('0x7a'),_0x18134a['id'],_0x4e21aa));}else{return _0x44111a['sendStatus'](0xcc);}})[_0x87b3('0x50')](handleError(_0x44111a,null));};exports[_0x87b3('0x7e')]=function(_0xe5cd0e,_0x2f4d09,_0x4904a8){var _0x1fc1e6;delete _0xe5cd0e['body']['id'];return db['CmList'][_0x87b3('0x5e')]({'where':{'id':_0xe5cd0e[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x2f4d09,null))['then'](function(_0x2cbb7b){if(_0x2cbb7b){return db['sequelize'][_0x87b3('0x7f')](function(_0xecb443){return db[_0x87b3('0x71')][_0x87b3('0x51')](_0xe5cd0e[_0x87b3('0x5a')],{'transaction':_0xecb443})[_0x87b3('0x30')](function(_0x1875dc){_0x1fc1e6=_0x1875dc;return _0x2cbb7b[_0x87b3('0x80')](_0x1875dc,{'transaction':_0xecb443});})[_0x87b3('0x30')](function(){var _0x5da86f={'type':db[_0x87b3('0x81')]['TEXT'],'transaction':_0xecb443};switch(_0xe5cd0e[_0x87b3('0x5a')][_0x87b3('0x47')]){case'text':_0x5da86f['type']=db[_0x87b3('0x81')]['TEXT'];break;case _0x87b3('0x82'):_0x5da86f[_0x87b3('0x47')]=db[_0x87b3('0x81')][_0x87b3('0x83')];break;case _0x87b3('0x84'):_0x5da86f[_0x87b3('0x47')]=db[_0x87b3('0x81')]['BOOLEAN'];_0x5da86f[_0x87b3('0x85')]=![];break;default:}return db[_0x87b3('0x86')]['queryInterface']['addColumn']('cm_contacts',util[_0x87b3('0x74')](_0x87b3('0x87'),_0x1fc1e6['id']),_0x5da86f);})[_0x87b3('0x30')](function(){return _0x1fc1e6;});});}})[_0x87b3('0x30')](respondWithResult(_0x2f4d09,null))[_0x87b3('0x50')](handleError(_0x2f4d09,null));};exports[_0x87b3('0x88')]=function(_0x346c9a,_0x13b48b,_0x3b1f11){var _0x58cb24={};var _0x2ded69={};var _0x27a517;var _0x388884;return db[_0x87b3('0x36')][_0x87b3('0x5e')]({'where':{'id':_0x346c9a['params']['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x13b48b,null))['then'](function(_0x2690d5){if(_0x2690d5){_0x27a517=_0x2690d5;_0x2ded69[_0x87b3('0x39')]=_[_0x87b3('0x4e')](db[_0x87b3('0x71')][_0x87b3('0x37')]);_0x2ded69['query']=_['keys'](_0x346c9a[_0x87b3('0x3a')]);_0x2ded69[_0x87b3('0x42')]=_[_0x87b3('0x3b')](_0x2ded69[_0x87b3('0x39')],_0x2ded69['query']);_0x58cb24['attributes']=_[_0x87b3('0x3b')](_0x2ded69[_0x87b3('0x39')],qs[_0x87b3('0x3c')](_0x346c9a[_0x87b3('0x3a')][_0x87b3('0x3c')]));_0x58cb24['attributes']=_0x58cb24[_0x87b3('0x3d')][_0x87b3('0x3e')]?_0x58cb24[_0x87b3('0x3d')]:_0x2ded69['model'];_0x58cb24[_0x87b3('0x40')]=qs[_0x87b3('0x41')](_0x346c9a[_0x87b3('0x3a')][_0x87b3('0x41')]);_0x58cb24[_0x87b3('0x45')]=qs[_0x87b3('0x42')](_[_0x87b3('0x43')](_0x346c9a[_0x87b3('0x3a')],_0x2ded69[_0x87b3('0x42')]));_0x58cb24[_0x87b3('0x45')]=_['merge'](_0x58cb24['where'],{'$or':[{'ListId':_0x2690d5['id']},{'ListId':null}]});if(_0x346c9a[_0x87b3('0x3a')][_0x87b3('0x44')]){_0x58cb24[_0x87b3('0x45')]=_[_0x87b3('0x46')](_0x58cb24[_0x87b3('0x45')],{'$or':_[_0x87b3('0x35')](_0x58cb24[_0x87b3('0x3d')],function(_0x3f26bb){var _0x1249ba={};_0x1249ba[_0x3f26bb]={'$like':'%'+_0x346c9a[_0x87b3('0x3a')][_0x87b3('0x44')]+'%'};return _0x1249ba;})});}_0x58cb24=_[_0x87b3('0x46')]({},_0x58cb24,_0x346c9a[_0x87b3('0x48')]);return db[_0x87b3('0x71')][_0x87b3('0x89')](_0x58cb24);}})['then'](respondWithResult(_0x13b48b,null))[_0x87b3('0x50')](handleError(_0x13b48b,null));};exports['addAgents']=function(_0x289272,_0x18d5f4,_0x1c38a8){return db[_0x87b3('0x36')][_0x87b3('0x4f')]({'where':{'id':_0x289272[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x18d5f4,null))[_0x87b3('0x30')](function(_0x23fdea){if(_0x23fdea){return _0x23fdea['addAgents'](_0x289272[_0x87b3('0x5a')][_0x87b3('0x6b')],_[_0x87b3('0x6a')](_0x289272[_0x87b3('0x5a')],[_0x87b3('0x6b'),'id'])||{})[_0x87b3('0x8a')](function(_0x29e27b){for(var _0xd250a1=0x0;_0xd250a1<_0x289272['body'][_0x87b3('0x6b')]['length'];_0xd250a1+=0x1){socket['emit'](_0x87b3('0x8b'),{'UserId':Number(_0x289272[_0x87b3('0x5a')][_0x87b3('0x6b')][_0xd250a1]),'CmListId':Number(_0x289272[_0x87b3('0x4d')]['id'])});}return _0x29e27b;});}})['then'](respondWithResult(_0x18d5f4,null))[_0x87b3('0x50')](handleError(_0x18d5f4,null));};exports['removeAgents']=function(_0x46a863,_0x2fe8fb,_0xdb2071){return db['CmList'][_0x87b3('0x4f')]({'where':{'id':_0x46a863[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x2fe8fb,null))['then'](function(_0x586595){if(_0x586595){return _0x586595['removeAgents'](_0x46a863[_0x87b3('0x3a')][_0x87b3('0x6b')])[_0x87b3('0x30')](function(){if(_[_0x87b3('0x65')](_0x46a863[_0x87b3('0x3a')][_0x87b3('0x6b')])){for(var _0x51e78f=0x0;_0x51e78f<_0x46a863[_0x87b3('0x3a')][_0x87b3('0x6b')][_0x87b3('0x3e')];_0x51e78f+=0x1){socket['emit'](_0x87b3('0x8c'),{'UserId':Number(_0x46a863['query'][_0x87b3('0x6b')][_0x51e78f]),'CmListId':Number(_0x46a863[_0x87b3('0x4d')]['id'])});}}else{socket[_0x87b3('0x8d')]('userCmList:remove',{'UserId':Number(_0x46a863[_0x87b3('0x3a')][_0x87b3('0x6b')]),'CmListId':Number(_0x46a863[_0x87b3('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fe8fb,null))[_0x87b3('0x50')](handleError(_0x2fe8fb,null));};exports[_0x87b3('0x8e')]=function(_0x2525a5,_0x27deb4,_0x4f0df3){var _0x592dff={};var _0x3edc92={};var _0x5ef575;var _0x4c006d;return db[_0x87b3('0x36')][_0x87b3('0x5e')]({'where':{'id':_0x2525a5[_0x87b3('0x4d')]['id']}})[_0x87b3('0x30')](handleEntityNotFound(_0x27deb4,null))['then'](function(_0x3cf213){if(_0x3cf213){_0x5ef575=_0x3cf213;_0x3edc92[_0x87b3('0x39')]=_[_0x87b3('0x4e')](db['User']['rawAttributes']);_0x3edc92['query']=_[_0x87b3('0x4e')](_0x2525a5['query']);_0x3edc92[_0x87b3('0x42')]=_[_0x87b3('0x3b')](_0x3edc92[_0x87b3('0x39')],_0x3edc92[_0x87b3('0x3a')]);_0x592dff[_0x87b3('0x3d')]=_[_0x87b3('0x3b')](_0x3edc92[_0x87b3('0x39')],qs[_0x87b3('0x3c')](_0x2525a5[_0x87b3('0x3a')][_0x87b3('0x3c')]));_0x592dff[_0x87b3('0x3d')]=_0x592dff[_0x87b3('0x3d')]['length']?_0x592dff['attributes']:_0x3edc92['model'];_0x592dff[_0x87b3('0x40')]=qs['sort'](_0x2525a5[_0x87b3('0x3a')]['sort']);_0x592dff[_0x87b3('0x45')]=qs['filters'](_[_0x87b3('0x43')](_0x2525a5[_0x87b3('0x3a')],_0x3edc92[_0x87b3('0x42')]));if(_0x2525a5['query'][_0x87b3('0x44')]){_0x592dff[_0x87b3('0x45')]=_[_0x87b3('0x46')](_0x592dff[_0x87b3('0x45')],{'$or':_['map'](_0x592dff[_0x87b3('0x3d')],function(_0x106f9e){var _0x33c10e={};_0x33c10e[_0x106f9e]={'$like':'%'+_0x2525a5[_0x87b3('0x3a')][_0x87b3('0x44')]+'%'};return _0x33c10e;})});}_0x592dff=_[_0x87b3('0x46')]({},_0x592dff,_0x2525a5['options']);return _0x5ef575['getAgents'](_0x592dff);}})['then'](function(_0x4fa5ec){if(_0x4fa5ec){_0x4c006d=_0x4fa5ec['length'];if(!_0x2525a5[_0x87b3('0x3a')][_0x87b3('0x60')]('nolimit')){_0x592dff['limit']=qs[_0x87b3('0x26')](_0x2525a5['query']['limit']);_0x592dff[_0x87b3('0x24')]=qs[_0x87b3('0x24')](_0x2525a5[_0x87b3('0x3a')]['offset']);}return _0x5ef575[_0x87b3('0x8e')](_0x592dff);}})[_0x87b3('0x30')](function(_0x3453cf){if(_0x3453cf){return _0x3453cf?{'count':_0x4c006d,'rows':_0x3453cf}:null;}})[_0x87b3('0x30')](respondWithResult(_0x27deb4,null))[_0x87b3('0x50')](handleError(_0x27deb4,null));}; \ No newline at end of file +var _0x2239=['addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','omit','spread','emit','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Lists','end','error','stack','name','send','index','map','CmList','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','catch','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','addDisposition','ListId','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','addCustomField','transaction'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x2239,0x1c8));var _0x9223=function(_0x352f4a,_0x460976){_0x352f4a=_0x352f4a-0x0;var _0x3a64eb=_0x2239[_0x352f4a];return _0x3a64eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9223('0x0'));var zipdir=require(_0x9223('0x1'));var jsonpatch=require(_0x9223('0x2'));var rp=require(_0x9223('0x3'));var moment=require(_0x9223('0x4'));var BPromise=require(_0x9223('0x5'));var Mustache=require(_0x9223('0x6'));var util=require('util');var path=require(_0x9223('0x7'));var sox=require(_0x9223('0x8'));var csv=require(_0x9223('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9223('0xa'));var _=require(_0x9223('0xb'));var squel=require(_0x9223('0xc'));var crypto=require(_0x9223('0xd'));var jsforce=require(_0x9223('0xe'));var deskjs=require(_0x9223('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9223('0x10'));var Papa=require(_0x9223('0x11'));var Redis=require(_0x9223('0x12'));var authService=require(_0x9223('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9223('0x14'));var hardwareService=require(_0x9223('0x15'));var logger=require(_0x9223('0x16'))(_0x9223('0x17'));var utils=require(_0x9223('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9223('0x19'));var db=require(_0x9223('0x1a'))['db'];config[_0x9223('0x1b')]=_[_0x9223('0x1c')](config[_0x9223('0x1b')],{'host':_0x9223('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9223('0x1b')]));require('./cmList.socket')[_0x9223('0x1e')](socket);function respondWithStatusCode(_0x58aa59,_0x11e72f){_0x11e72f=_0x11e72f||0xcc;return function(_0x4448bb){if(_0x4448bb){return _0x58aa59[_0x9223('0x1f')](_0x11e72f);}return _0x58aa59[_0x9223('0x20')](_0x11e72f)['end']();};}function respondWithResult(_0x265f1c,_0x4959cf){_0x4959cf=_0x4959cf||0xc8;return function(_0x219d2f){if(_0x219d2f){return _0x265f1c[_0x9223('0x20')](_0x4959cf)[_0x9223('0x21')](_0x219d2f);}};}function respondWithFilteredResult(_0x3830e6,_0x4f2be0){return function(_0x3f6a61){if(_0x3f6a61){var _0x1da58e=typeof _0x4f2be0[_0x9223('0x22')]===_0x9223('0x23')&&typeof _0x4f2be0[_0x9223('0x24')]==='undefined';var _0x3ba876=_0x3f6a61['count'];var _0x15d029=_0x1da58e?0x0:_0x4f2be0['offset'];var _0x4a7610=_0x1da58e?_0x3f6a61[_0x9223('0x25')]:_0x4f2be0['offset']+_0x4f2be0[_0x9223('0x24')];var _0x15e971;if(_0x4a7610>=_0x3ba876){_0x4a7610=_0x3ba876;_0x15e971=0xc8;}else{_0x15e971=0xce;}_0x3830e6[_0x9223('0x20')](_0x15e971);return _0x3830e6[_0x9223('0x26')](_0x9223('0x27'),_0x15d029+'-'+_0x4a7610+'/'+_0x3ba876)[_0x9223('0x21')](_0x3f6a61);}return null;};}function patchUpdates(_0x23bfd9){return function(_0x4e03eb){try{jsonpatch['apply'](_0x4e03eb,_0x23bfd9,!![]);}catch(_0x7d1f70){return BPromise[_0x9223('0x28')](_0x7d1f70);}return _0x4e03eb[_0x9223('0x29')]();};}function saveUpdates(_0x1cf1c9,_0xbe12af){return function(_0xaae147){if(_0xaae147){return _0xaae147[_0x9223('0x2a')](_0x1cf1c9)[_0x9223('0x2b')](function(_0x57cb18){return _0x57cb18;});}return null;};}function removeEntity(_0x5340d0,_0x5d7739){return function(_0x5ab7a5){if(_0x5ab7a5){return _0x5ab7a5[_0x9223('0x2c')]()['then'](function(){var _0x3a7b17=_0x5ab7a5[_0x9223('0x2d')]({'plain':!![]});var _0x45434e=_0x9223('0x2e');return db['UserProfileResource'][_0x9223('0x2c')]({'where':{'type':_0x45434e,'resourceId':_0x3a7b17['id']}})[_0x9223('0x2b')](function(){return _0x5ab7a5;});})[_0x9223('0x2b')](function(){_0x5340d0[_0x9223('0x20')](0xcc)[_0x9223('0x2f')]();});}};}function handleEntityNotFound(_0x3231ff,_0x563c64){return function(_0x48f7b7){if(!_0x48f7b7){_0x3231ff[_0x9223('0x1f')](0x194);}return _0x48f7b7;};}function handleError(_0x52c198,_0x241bf1){_0x241bf1=_0x241bf1||0x1f4;return function(_0x14ed7e){logger[_0x9223('0x30')](_0x14ed7e[_0x9223('0x31')]);if(_0x14ed7e[_0x9223('0x32')]){delete _0x14ed7e[_0x9223('0x32')];}_0x52c198[_0x9223('0x20')](_0x241bf1)[_0x9223('0x33')](_0x14ed7e);};}exports[_0x9223('0x34')]=function(_0x30a13d,_0x39c1da){var _0x34dc97={},_0x42c372={},_0x4ab5f0={'count':0x0,'rows':[]};var _0x56105d=_[_0x9223('0x35')](db[_0x9223('0x36')]['rawAttributes'],function(_0x32cb29){return{'name':_0x32cb29[_0x9223('0x37')],'type':_0x32cb29[_0x9223('0x38')][_0x9223('0x39')]};});_0x42c372['model']=_[_0x9223('0x35')](_0x56105d,_0x9223('0x32'));_0x42c372[_0x9223('0x3a')]=_[_0x9223('0x3b')](_0x30a13d[_0x9223('0x3a')]);_0x42c372[_0x9223('0x3c')]=_[_0x9223('0x3d')](_0x42c372[_0x9223('0x3e')],_0x42c372[_0x9223('0x3a')]);_0x34dc97[_0x9223('0x3f')]=_[_0x9223('0x3d')](_0x42c372['model'],qs[_0x9223('0x40')](_0x30a13d[_0x9223('0x3a')]['fields']));_0x34dc97['attributes']=_0x34dc97[_0x9223('0x3f')][_0x9223('0x41')]?_0x34dc97['attributes']:_0x42c372[_0x9223('0x3e')];if(!_0x30a13d[_0x9223('0x3a')][_0x9223('0x42')](_0x9223('0x43'))){_0x34dc97[_0x9223('0x24')]=qs[_0x9223('0x24')](_0x30a13d[_0x9223('0x3a')]['limit']);_0x34dc97[_0x9223('0x22')]=qs[_0x9223('0x22')](_0x30a13d['query']['offset']);}_0x34dc97[_0x9223('0x44')]=qs[_0x9223('0x45')](_0x30a13d['query'][_0x9223('0x45')]);_0x34dc97[_0x9223('0x46')]=qs['filters'](_[_0x9223('0x47')](_0x30a13d[_0x9223('0x3a')],_0x42c372[_0x9223('0x3c')]),_0x56105d);if(_0x30a13d[_0x9223('0x3a')][_0x9223('0x48')]){_0x34dc97['where']=_['merge'](_0x34dc97[_0x9223('0x46')],{'$or':_[_0x9223('0x35')](_0x56105d,function(_0x31ab42){if(_0x31ab42[_0x9223('0x38')]!=='VIRTUAL'){var _0x4fe74b={};_0x4fe74b[_0x31ab42[_0x9223('0x32')]]={'$like':'%'+_0x30a13d[_0x9223('0x3a')][_0x9223('0x48')]+'%'};return _0x4fe74b;}})});}_0x34dc97=_[_0x9223('0x49')]({},_0x34dc97,_0x30a13d['options']);var _0x49113a={'where':_0x34dc97[_0x9223('0x46')]};return db[_0x9223('0x36')][_0x9223('0x25')](_0x49113a)[_0x9223('0x2b')](function(_0x21324f){_0x4ab5f0['count']=_0x21324f;if(_0x30a13d['query'][_0x9223('0x4a')]){_0x34dc97['include']=[{'all':!![]}];}return db[_0x9223('0x36')]['findAll'](_0x34dc97);})[_0x9223('0x2b')](function(_0x26965b){_0x4ab5f0['rows']=_0x26965b;return _0x4ab5f0;})[_0x9223('0x2b')](respondWithFilteredResult(_0x39c1da,_0x34dc97))[_0x9223('0x4b')](handleError(_0x39c1da,null));};exports['show']=function(_0x4953ea,_0x20c314){var _0x272763={'raw':![],'where':{'id':_0x4953ea[_0x9223('0x4c')]['id']}},_0x2c369a={};_0x2c369a[_0x9223('0x3e')]=_[_0x9223('0x3b')](db[_0x9223('0x36')][_0x9223('0x4d')]);_0x2c369a['query']=_[_0x9223('0x3b')](_0x4953ea[_0x9223('0x3a')]);_0x2c369a[_0x9223('0x3c')]=_['intersection'](_0x2c369a['model'],_0x2c369a[_0x9223('0x3a')]);_0x272763[_0x9223('0x3f')]=_[_0x9223('0x3d')](_0x2c369a[_0x9223('0x3e')],qs[_0x9223('0x40')](_0x4953ea[_0x9223('0x3a')]['fields']));_0x272763[_0x9223('0x3f')]=_0x272763[_0x9223('0x3f')][_0x9223('0x41')]?_0x272763[_0x9223('0x3f')]:_0x2c369a[_0x9223('0x3e')];if(_0x4953ea[_0x9223('0x3a')][_0x9223('0x4a')]){_0x272763[_0x9223('0x4e')]=[{'all':!![]}];}_0x272763=_[_0x9223('0x49')]({},_0x272763,_0x4953ea[_0x9223('0x4f')]);return db[_0x9223('0x36')][_0x9223('0x50')](_0x272763)[_0x9223('0x2b')](handleEntityNotFound(_0x20c314,null))[_0x9223('0x2b')](respondWithResult(_0x20c314,null))[_0x9223('0x4b')](handleError(_0x20c314,null));};exports[_0x9223('0x51')]=function(_0x46b4fc,_0x595cce){return db[_0x9223('0x36')][_0x9223('0x51')](_0x46b4fc[_0x9223('0x52')],{})[_0x9223('0x2b')](function(_0x73d49c){var _0x512085=_0x46b4fc[_0x9223('0x53')]['get']({'plain':!![]});if(!_0x512085)throw new Error(_0x9223('0x54'));if(_0x512085[_0x9223('0x55')]===_0x9223('0x53')){var _0x158306=_0x73d49c['get']({'plain':!![]});var _0x3755aa=_0x9223('0x2e');return db[_0x9223('0x56')][_0x9223('0x50')]({'where':{'name':_0x3755aa,'userProfileId':_0x512085['userProfileId']},'raw':!![]})[_0x9223('0x2b')](function(_0x1ec54e){if(_0x1ec54e&&_0x1ec54e[_0x9223('0x57')]===0x0){return db[_0x9223('0x58')][_0x9223('0x51')]({'name':_0x158306[_0x9223('0x32')],'resourceId':_0x158306['id'],'type':_0x1ec54e[_0x9223('0x32')],'sectionId':_0x1ec54e['id']},{})[_0x9223('0x2b')](function(){return _0x73d49c;});}else{return _0x73d49c;}})[_0x9223('0x4b')](function(_0x5070f1){logger[_0x9223('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5070f1);throw _0x5070f1;});}return _0x73d49c;})[_0x9223('0x2b')](respondWithResult(_0x595cce,0xc9))['catch'](handleError(_0x595cce,null));};exports[_0x9223('0x2a')]=function(_0x45d000,_0x4a77e2){if(_0x45d000['body']['id']){delete _0x45d000[_0x9223('0x52')]['id'];}return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x45d000[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x4a77e2,null))['then'](saveUpdates(_0x45d000[_0x9223('0x52')],null))['then'](respondWithResult(_0x4a77e2,null))[_0x9223('0x4b')](handleError(_0x4a77e2,null));};exports[_0x9223('0x2c')]=function(_0x2b0ef6,_0x3dd5ad){return db['CmList'][_0x9223('0x50')]({'where':{'id':_0x2b0ef6[_0x9223('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3dd5ad,null))['then'](removeEntity(_0x3dd5ad,null))[_0x9223('0x4b')](handleError(_0x3dd5ad,null));};exports['describe']=function(_0x27553a,_0x21c832){return db[_0x9223('0x36')]['describe']()['then'](respondWithResult(_0x21c832,null))[_0x9223('0x4b')](handleError(_0x21c832,null));};exports[_0x9223('0x59')]=function(_0x266302,_0x1220f6,_0x2265da){if(_0x266302[_0x9223('0x52')]['id']){delete _0x266302[_0x9223('0x52')]['id'];}return db[_0x9223('0x36')]['find']({'where':{'id':_0x266302[_0x9223('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1220f6,null))[_0x9223('0x2b')](function(_0x19fce8){if(_0x19fce8){_0x266302['body'][_0x9223('0x5a')]=_0x19fce8['id'];return db['Disposition'][_0x9223('0x51')](_0x266302[_0x9223('0x52')]);}})['then'](respondWithResult(_0x1220f6,null))[_0x9223('0x4b')](handleError(_0x1220f6,null));};exports[_0x9223('0x5b')]=function(_0x529b35,_0x1b88e0,_0x5a642b){var _0x40f2b8={'raw':![],'where':{}};var _0x3a7dae={};var _0x4e14e9={'count':0x0,'rows':[]};return db[_0x9223('0x36')][_0x9223('0x5c')]({'where':{'id':_0x529b35['params']['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x1b88e0,null))[_0x9223('0x2b')](function(_0x377f7c){if(_0x377f7c){_0x3a7dae[_0x9223('0x3e')]=_[_0x9223('0x3b')](db['Disposition'][_0x9223('0x4d')]);_0x3a7dae['query']=_[_0x9223('0x3b')](_0x529b35['query']);_0x3a7dae[_0x9223('0x3c')]=_['intersection'](_0x3a7dae['model'],_0x3a7dae[_0x9223('0x3a')]);_0x40f2b8[_0x9223('0x3f')]=_['intersection'](_0x3a7dae[_0x9223('0x3e')],qs[_0x9223('0x40')](_0x529b35['query']['fields']));_0x40f2b8['attributes']=_0x40f2b8[_0x9223('0x3f')][_0x9223('0x41')]?_0x40f2b8[_0x9223('0x3f')]:_0x3a7dae[_0x9223('0x3e')];if(!_0x529b35[_0x9223('0x3a')][_0x9223('0x42')](_0x9223('0x43'))){_0x40f2b8['limit']=qs[_0x9223('0x24')](_0x529b35[_0x9223('0x3a')][_0x9223('0x24')]);_0x40f2b8[_0x9223('0x22')]=qs['offset'](_0x529b35[_0x9223('0x3a')][_0x9223('0x22')]);}_0x40f2b8['order']=qs['sort'](_0x529b35[_0x9223('0x3a')]['sort']);_0x40f2b8[_0x9223('0x46')]=qs['filters'](_['pick'](_0x529b35[_0x9223('0x3a')],_0x3a7dae[_0x9223('0x3c')]));_0x40f2b8[_0x9223('0x46')][_0x9223('0x5a')]=_0x377f7c['id'];if(_0x529b35[_0x9223('0x3a')][_0x9223('0x48')]){_0x40f2b8['where']=_[_0x9223('0x49')](_0x40f2b8[_0x9223('0x46')],{'$or':_[_0x9223('0x35')](_0x40f2b8[_0x9223('0x3f')],function(_0xa7ad37){var _0x5bcbe3={};_0x5bcbe3[_0xa7ad37]={'$like':'%'+_0x529b35['query'][_0x9223('0x48')]+'%'};return _0x5bcbe3;})});}_0x40f2b8=_['merge']({},_0x40f2b8,_0x529b35[_0x9223('0x4f')]);return db['Disposition']['count']({'where':_0x40f2b8[_0x9223('0x46')]})[_0x9223('0x2b')](function(_0x2f045c){_0x4e14e9[_0x9223('0x25')]=_0x2f045c;if(_0x529b35[_0x9223('0x3a')][_0x9223('0x4a')]){_0x40f2b8['include']=[{'all':!![]}];}return db[_0x9223('0x5d')][_0x9223('0x5e')](_0x40f2b8);})[_0x9223('0x2b')](function(_0x39b80d){_0x4e14e9['rows']=_0x39b80d;return _0x4e14e9;});}})[_0x9223('0x2b')](respondWithFilteredResult(_0x1b88e0,_0x40f2b8))[_0x9223('0x4b')](handleError(_0x1b88e0,null));};exports['removeDispositions']=function(_0x237c82,_0x45ca46,_0xd878f){return db['CmList']['find']({'where':{'id':_0x237c82[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x45ca46,null))[_0x9223('0x2b')](function(_0x231366){if(_0x231366){return _0x231366[_0x9223('0x5f')](_0x237c82[_0x9223('0x3a')][_0x9223('0x60')]);}})[_0x9223('0x2b')](respondWithStatusCode(_0x45ca46,null))[_0x9223('0x4b')](handleError(_0x45ca46,null));};exports[_0x9223('0x61')]=function(_0x86e62f,_0x1605c0,_0x476ea2){return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x86e62f[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x1605c0,null))[_0x9223('0x2b')](function(_0x2f9f22){if(_0x2f9f22){var _0x4709c3=[];var _0x4aafc7={'success':[],'errors':[]};return db[_0x9223('0x62')]['describe']()[_0x9223('0x2b')](function(_0x1ff14a){if(_0x86e62f[_0x9223('0x52')][_0x9223('0x63')]&&_['isArray'](_0x86e62f[_0x9223('0x52')][_0x9223('0x63')])){if(_0x86e62f['body'][_0x9223('0x63')][_0x9223('0x41')]){_0x86e62f['body']['tags']=_0x86e62f[_0x9223('0x52')][_0x9223('0x63')][_0x9223('0x64')](';')+';';}else{_0x86e62f[_0x9223('0x52')]['tags']=null;}}else{_0x86e62f['body']['tags']=null;}if(_0x86e62f[_0x9223('0x52')]&&_[_0x9223('0x65')](_0x86e62f['body'])){for(var _0x2249f4=0x0;_0x2249f4<_0x86e62f['body'][_0x9223('0x41')];_0x2249f4+=0x1){_0x86e62f['body'][_0x2249f4][_0x9223('0x5a')]=_0x86e62f[_0x9223('0x4c')]['id'];_0x4709c3['push'](_0x86e62f[_0x9223('0x52')][_0x2249f4]);}return BPromise['each'](_0x4709c3,function(_0x59b732){return db[_0x9223('0x62')]['create'](_['omit'](_0x59b732,[_0x9223('0x60'),'id'])||{},{'fields':_[_0x9223('0x3b')](_0x1ff14a),'raw':!![]})['then'](function(_0x53ab50){_0x4aafc7[_0x9223('0x66')][_0x9223('0x67')](_0x53ab50[_0x9223('0x68')]);})[_0x9223('0x4b')](function(_0x5e68a7){_0x4aafc7[_0x9223('0x69')][_0x9223('0x67')]({'data':_0x59b732,'error':_0x5e68a7['message']});});})[_0x9223('0x2b')](function(_0x32bfcf){return _0x4aafc7;})[_0x9223('0x4b')](function(_0x51ce1e){return _0x51ce1e;});}else{_0x1605c0[_0x9223('0x20')](0x190)[_0x9223('0x21')]({'message':_0x9223('0x6a')});}});}})['then'](respondWithResult(_0x1605c0,null))['catch'](handleError(_0x1605c0,null));};exports[_0x9223('0x6b')]=function(_0x3dd03e,_0xe21a85,_0x3f8c90){var _0x522850;return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x3dd03e[_0x9223('0x4c')]['id']},'include':[{'model':db[_0x9223('0x6c')],'as':_0x9223('0x6d')}]})['then'](handleEntityNotFound(_0xe21a85,null))['then'](function(_0x2e227e){if(_0x2e227e){_0x522850=_0x2e227e;return db[_0x9223('0x62')][_0x9223('0x4d')];}})['then'](function(_0x5aff01){if(_0x5aff01){var _0x1c493f={};var _0x2c187c={};_0x2c187c[_0x9223('0x3e')]=_[_0x9223('0x6e')](_[_0x9223('0x3b')](_0x5aff01),_[_0x9223('0x35')](_0x522850[_0x9223('0x6d')],function(_0x17a08a){return util[_0x9223('0x6f')](_0x9223('0x70'),_0x17a08a['id']);}));_0x2c187c[_0x9223('0x3a')]=_[_0x9223('0x3b')](_0x3dd03e[_0x9223('0x3a')]);_0x2c187c[_0x9223('0x3c')]=_[_0x9223('0x3d')](_0x2c187c[_0x9223('0x3e')],_0x2c187c[_0x9223('0x3a')]);_0x1c493f[_0x9223('0x3f')]=_[_0x9223('0x3d')](_0x2c187c[_0x9223('0x3e')],qs['fields'](_0x3dd03e[_0x9223('0x3a')][_0x9223('0x40')]));_0x1c493f[_0x9223('0x3f')]=_0x1c493f[_0x9223('0x3f')][_0x9223('0x41')]?_0x1c493f['attributes']:_0x2c187c['model'];if(!_0x3dd03e[_0x9223('0x3a')][_0x9223('0x42')]('nolimit')){_0x1c493f[_0x9223('0x24')]=qs[_0x9223('0x24')](_0x3dd03e[_0x9223('0x3a')]['limit']);_0x1c493f['offset']=qs[_0x9223('0x22')](_0x3dd03e[_0x9223('0x3a')][_0x9223('0x22')]);}_0x1c493f[_0x9223('0x44')]=qs['sort'](_0x3dd03e['query'][_0x9223('0x45')]);_0x1c493f[_0x9223('0x46')]=qs[_0x9223('0x3c')](_['pick'](_0x3dd03e['query'],_0x2c187c[_0x9223('0x3c')]));_0x1c493f[_0x9223('0x71')]=!![];if(_0x3dd03e[_0x9223('0x3a')][_0x9223('0x48')]){_0x1c493f['where']=_[_0x9223('0x49')](_0x1c493f[_0x9223('0x46')],{'$or':_[_0x9223('0x35')](_0x1c493f[_0x9223('0x3f')],function(_0x57d5b9){var _0xf1ac72={};_0xf1ac72[_0x57d5b9]={'$like':'%'+_0x3dd03e['query'][_0x9223('0x48')]+'%'};return _0xf1ac72;})});}_0x1c493f=_[_0x9223('0x49')]({},_0x1c493f,_0x3dd03e[_0x9223('0x4f')]);return _0x522850[_0x9223('0x6b')](_0x1c493f);}})[_0x9223('0x2b')](respondWithResult(_0xe21a85,null))[_0x9223('0x4b')](handleError(_0xe21a85,null));};exports[_0x9223('0x72')]=function(_0x2c0b5d,_0x10bb74,_0x241306){var _0x3eeab5;return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x2c0b5d['params']['id']},'include':[{'model':db[_0x9223('0x6c')],'as':_0x9223('0x6d')}]})['then'](handleEntityNotFound(_0x10bb74,null))['then'](function(_0xa92765){if(_0xa92765){_0x3eeab5=_0xa92765;return db[_0x9223('0x62')][_0x9223('0x4d')];}})[_0x9223('0x2b')](function(_0x2bf83b){if(_0x2bf83b){var _0x104f54={};var _0x30ef4d={};_0x30ef4d[_0x9223('0x3e')]=_['concat'](_['keys'](_0x2bf83b),_[_0x9223('0x35')](_0x3eeab5['CustomFields'],function(_0x4d16b9){return util[_0x9223('0x6f')](_0x9223('0x70'),_0x4d16b9['id']);}));_0x30ef4d[_0x9223('0x3a')]=_[_0x9223('0x3b')](_0x2c0b5d[_0x9223('0x3a')]);_0x30ef4d[_0x9223('0x3c')]=_[_0x9223('0x3d')](_0x30ef4d[_0x9223('0x3e')],_0x30ef4d[_0x9223('0x3a')]);_0x104f54['attributes']=_['intersection'](_0x30ef4d['model'],qs['fields'](_0x2c0b5d[_0x9223('0x3a')]['fields']));_0x104f54[_0x9223('0x3f')]=_0x104f54[_0x9223('0x3f')][_0x9223('0x41')]?_0x104f54['attributes']:_0x30ef4d[_0x9223('0x3e')];if(!_0x2c0b5d[_0x9223('0x3a')][_0x9223('0x42')]('nolimit')){_0x104f54[_0x9223('0x24')]=qs[_0x9223('0x24')](_0x2c0b5d[_0x9223('0x3a')][_0x9223('0x24')]);_0x104f54['offset']=qs[_0x9223('0x22')](_0x2c0b5d[_0x9223('0x3a')]['offset']);}_0x104f54[_0x9223('0x44')]=qs['sort'](_0x2c0b5d[_0x9223('0x3a')][_0x9223('0x45')]);_0x104f54[_0x9223('0x46')]=qs[_0x9223('0x3c')](_[_0x9223('0x47')](_0x2c0b5d['query'],_0x30ef4d[_0x9223('0x3c')]));_0x104f54[_0x9223('0x71')]=!![];if(_0x2c0b5d['query'][_0x9223('0x48')]){_0x104f54[_0x9223('0x46')]=_[_0x9223('0x49')](_0x104f54[_0x9223('0x46')],{'$or':_['map'](_0x104f54[_0x9223('0x3f')],function(_0x4aed26){var _0x2ce013={};_0x2ce013[_0x4aed26]={'$like':'%'+_0x2c0b5d[_0x9223('0x3a')][_0x9223('0x48')]+'%'};return _0x2ce013;})});}_0x104f54=_['merge']({},_0x104f54,_0x2c0b5d[_0x9223('0x4f')]);return _0x3eeab5[_0x9223('0x6b')](_0x104f54);}})[_0x9223('0x2b')](function(_0x5e4d88){if(!_['isEmpty'](_0x5e4d88)){var _0x21d31a=toCsv(_0x5e4d88);var _0x10225b=Date[_0x9223('0x73')]();fs['writeFileSync'](util['format'](_0x9223('0x74'),_0x3eeab5['id'],_0x10225b),_0x21d31a);_0x10bb74[_0x9223('0x75')](_0x9223('0x76'),'attachment;\x20filename='+util['format'](_0x9223('0x77'),_0x3eeab5['id'],_0x10225b));_0x10bb74['setHeader'](_0x9223('0x78'),'text/csv');return _0x10bb74[_0x9223('0x79')](util[_0x9223('0x6f')](_0x9223('0x74'),_0x3eeab5['id'],_0x10225b));}else{return _0x10bb74[_0x9223('0x1f')](0xcc);}})[_0x9223('0x4b')](handleError(_0x10bb74,null));};exports[_0x9223('0x7a')]=function(_0x963ed0,_0x11230b,_0x278e95){var _0xd3bdca;delete _0x963ed0['body']['id'];return db['CmList'][_0x9223('0x5c')]({'where':{'id':_0x963ed0[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x11230b,null))[_0x9223('0x2b')](function(_0x121a82){if(_0x121a82){return db['sequelize'][_0x9223('0x7b')](function(_0x36b04e){return db[_0x9223('0x6c')][_0x9223('0x51')](_0x963ed0[_0x9223('0x52')],{'transaction':_0x36b04e})['then'](function(_0x77d680){_0xd3bdca=_0x77d680;return _0x121a82[_0x9223('0x7c')](_0x77d680,{'transaction':_0x36b04e});})[_0x9223('0x2b')](function(){var _0x490fb0={'type':db['Sequelize']['TEXT'],'transaction':_0x36b04e};switch(_0x963ed0[_0x9223('0x52')][_0x9223('0x38')]){case'text':_0x490fb0[_0x9223('0x38')]=db[_0x9223('0x7d')][_0x9223('0x7e')];break;case _0x9223('0x7f'):_0x490fb0[_0x9223('0x38')]=db[_0x9223('0x7d')][_0x9223('0x80')];break;case _0x9223('0x81'):_0x490fb0[_0x9223('0x38')]=db[_0x9223('0x7d')][_0x9223('0x82')];_0x490fb0[_0x9223('0x83')]=![];break;default:}return db[_0x9223('0x84')][_0x9223('0x85')]['addColumn'](_0x9223('0x86'),util[_0x9223('0x6f')](_0x9223('0x87'),_0xd3bdca['id']),_0x490fb0);})[_0x9223('0x2b')](function(){return _0xd3bdca;});});}})[_0x9223('0x2b')](respondWithResult(_0x11230b,null))['catch'](handleError(_0x11230b,null));};exports['getCustomFields']=function(_0x4c1428,_0x4f86b5,_0x30a2f1){var _0x4138de={};var _0x28c97b={};var _0x3cb189;var _0x391792;return db['CmList']['findOne']({'where':{'id':_0x4c1428[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x4f86b5,null))[_0x9223('0x2b')](function(_0x448448){if(_0x448448){_0x3cb189=_0x448448;_0x28c97b[_0x9223('0x3e')]=_[_0x9223('0x3b')](db[_0x9223('0x6c')][_0x9223('0x4d')]);_0x28c97b[_0x9223('0x3a')]=_[_0x9223('0x3b')](_0x4c1428[_0x9223('0x3a')]);_0x28c97b[_0x9223('0x3c')]=_['intersection'](_0x28c97b[_0x9223('0x3e')],_0x28c97b[_0x9223('0x3a')]);_0x4138de[_0x9223('0x3f')]=_['intersection'](_0x28c97b[_0x9223('0x3e')],qs[_0x9223('0x40')](_0x4c1428['query'][_0x9223('0x40')]));_0x4138de[_0x9223('0x3f')]=_0x4138de[_0x9223('0x3f')][_0x9223('0x41')]?_0x4138de[_0x9223('0x3f')]:_0x28c97b['model'];_0x4138de[_0x9223('0x44')]=qs[_0x9223('0x45')](_0x4c1428['query']['sort']);_0x4138de[_0x9223('0x46')]=qs[_0x9223('0x3c')](_[_0x9223('0x47')](_0x4c1428[_0x9223('0x3a')],_0x28c97b[_0x9223('0x3c')]));_0x4138de[_0x9223('0x46')]=_[_0x9223('0x49')](_0x4138de[_0x9223('0x46')],{'$or':[{'ListId':_0x448448['id']},{'ListId':null}]});if(_0x4c1428[_0x9223('0x3a')][_0x9223('0x48')]){_0x4138de[_0x9223('0x46')]=_[_0x9223('0x49')](_0x4138de[_0x9223('0x46')],{'$or':_[_0x9223('0x35')](_0x4138de[_0x9223('0x3f')],function(_0x30cc31){var _0x214c00={};_0x214c00[_0x30cc31]={'$like':'%'+_0x4c1428[_0x9223('0x3a')]['filter']+'%'};return _0x214c00;})});}_0x4138de=_['merge']({},_0x4138de,_0x4c1428[_0x9223('0x4f')]);return db[_0x9223('0x6c')][_0x9223('0x88')](_0x4138de);}})[_0x9223('0x2b')](respondWithResult(_0x4f86b5,null))[_0x9223('0x4b')](handleError(_0x4f86b5,null));};exports[_0x9223('0x89')]=function(_0x3d6f64,_0x57b602,_0x58b820){return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x3d6f64[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x57b602,null))[_0x9223('0x2b')](function(_0x43d7b7){if(_0x43d7b7){return _0x43d7b7[_0x9223('0x89')](_0x3d6f64['body'][_0x9223('0x60')],_[_0x9223('0x8a')](_0x3d6f64[_0x9223('0x52')],[_0x9223('0x60'),'id'])||{})[_0x9223('0x8b')](function(_0x24043){for(var _0x400d3b=0x0;_0x400d3b<_0x3d6f64[_0x9223('0x52')][_0x9223('0x60')][_0x9223('0x41')];_0x400d3b+=0x1){socket[_0x9223('0x8c')]('userCmList:save',{'UserId':Number(_0x3d6f64[_0x9223('0x52')][_0x9223('0x60')][_0x400d3b]),'CmListId':Number(_0x3d6f64[_0x9223('0x4c')]['id'])});}return _0x24043;});}})[_0x9223('0x2b')](respondWithResult(_0x57b602,null))[_0x9223('0x4b')](handleError(_0x57b602,null));};exports[_0x9223('0x8d')]=function(_0x445436,_0x2fae50,_0x127e5e){return db[_0x9223('0x36')][_0x9223('0x50')]({'where':{'id':_0x445436[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x2fae50,null))[_0x9223('0x2b')](function(_0x2c757e){if(_0x2c757e){return _0x2c757e['removeAgents'](_0x445436[_0x9223('0x3a')][_0x9223('0x60')])[_0x9223('0x2b')](function(){if(_[_0x9223('0x65')](_0x445436[_0x9223('0x3a')][_0x9223('0x60')])){for(var _0x22f407=0x0;_0x22f407<_0x445436['query']['ids'][_0x9223('0x41')];_0x22f407+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x445436[_0x9223('0x3a')][_0x9223('0x60')][_0x22f407]),'CmListId':Number(_0x445436['params']['id'])});}}else{socket[_0x9223('0x8c')](_0x9223('0x8e'),{'UserId':Number(_0x445436[_0x9223('0x3a')][_0x9223('0x60')]),'CmListId':Number(_0x445436['params']['id'])});}});}})[_0x9223('0x2b')](respondWithStatusCode(_0x2fae50,null))[_0x9223('0x4b')](handleError(_0x2fae50,null));};exports[_0x9223('0x8f')]=function(_0x491ede,_0x2dd037,_0x410d8d){var _0x275ef5={};var _0x466240={};var _0x52bb3c;var _0x5038b5;return db[_0x9223('0x36')][_0x9223('0x5c')]({'where':{'id':_0x491ede[_0x9223('0x4c')]['id']}})[_0x9223('0x2b')](handleEntityNotFound(_0x2dd037,null))['then'](function(_0x1bc864){if(_0x1bc864){_0x52bb3c=_0x1bc864;_0x466240[_0x9223('0x3e')]=_[_0x9223('0x3b')](db[_0x9223('0x90')][_0x9223('0x4d')]);_0x466240[_0x9223('0x3a')]=_[_0x9223('0x3b')](_0x491ede[_0x9223('0x3a')]);_0x466240[_0x9223('0x3c')]=_[_0x9223('0x3d')](_0x466240[_0x9223('0x3e')],_0x466240[_0x9223('0x3a')]);_0x275ef5['attributes']=_[_0x9223('0x3d')](_0x466240[_0x9223('0x3e')],qs['fields'](_0x491ede[_0x9223('0x3a')]['fields']));_0x275ef5[_0x9223('0x3f')]=_0x275ef5['attributes'][_0x9223('0x41')]?_0x275ef5[_0x9223('0x3f')]:_0x466240['model'];_0x275ef5[_0x9223('0x44')]=qs[_0x9223('0x45')](_0x491ede[_0x9223('0x3a')]['sort']);_0x275ef5[_0x9223('0x46')]=qs['filters'](_[_0x9223('0x47')](_0x491ede[_0x9223('0x3a')],_0x466240[_0x9223('0x3c')]));if(_0x491ede[_0x9223('0x3a')]['filter']){_0x275ef5['where']=_[_0x9223('0x49')](_0x275ef5['where'],{'$or':_[_0x9223('0x35')](_0x275ef5[_0x9223('0x3f')],function(_0x36080d){var _0x4b1d06={};_0x4b1d06[_0x36080d]={'$like':'%'+_0x491ede['query']['filter']+'%'};return _0x4b1d06;})});}_0x275ef5=_[_0x9223('0x49')]({},_0x275ef5,_0x491ede[_0x9223('0x4f')]);return _0x52bb3c['getAgents'](_0x275ef5);}})[_0x9223('0x2b')](function(_0x47a7e1){if(_0x47a7e1){_0x5038b5=_0x47a7e1['length'];if(!_0x491ede[_0x9223('0x3a')][_0x9223('0x42')]('nolimit')){_0x275ef5[_0x9223('0x24')]=qs['limit'](_0x491ede[_0x9223('0x3a')][_0x9223('0x24')]);_0x275ef5[_0x9223('0x22')]=qs[_0x9223('0x22')](_0x491ede[_0x9223('0x3a')]['offset']);}return _0x52bb3c[_0x9223('0x8f')](_0x275ef5);}})['then'](function(_0x31ace0){if(_0x31ace0){return _0x31ace0?{'count':_0x5038b5,'rows':_0x31ace0}:null;}})[_0x9223('0x2b')](respondWithResult(_0x2dd037,null))[_0x9223('0x4b')](handleError(_0x2dd037,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 76f21b8..08fdd41 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x5fc3[_0x1db831];return _0x39ba56;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe14b,0x93));var _0xbe14=function(_0x4a0b18,_0x398af3){_0x4a0b18=_0x4a0b18-0x0;var _0x3fcccb=_0xe14b[_0x4a0b18];return _0x3fcccb;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4d0b935..d7f48ae 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 _0x4522=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api','moment','request-promise'];(function(_0x2bf031,_0x2e84d8){var _0x215504=function(_0x29a760){while(--_0x29a760){_0x2bf031['push'](_0x2bf031['shift']());}};_0x215504(++_0x2e84d8);}(_0x4522,0x1a0));var _0x2452=function(_0x163a8b,_0x2892bd){_0x163a8b=_0x163a8b-0x0;var _0x561894=_0x4522[_0x163a8b];return _0x561894;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./cmList.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18b1a9,_0x9dab6a){var _0x2542e5=function(_0xe5117e){while(--_0xe5117e){_0x18b1a9['push'](_0x18b1a9['shift']());}};_0x2542e5(++_0x9dab6a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xb4e6[_0x4f0c2b];return _0x526436;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 3958d36..f641a64 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 _0x26c1=['result','catch','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x395717,_0x49100d){var _0x377855=function(_0x3b30f2){while(--_0x3b30f2){_0x395717['push'](_0x395717['shift']());}};_0x377855(++_0x49100d);}(_0x26c1,0x15b));var _0x126c=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x26c1[_0x4bc4c8];return _0x3bb121;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x126c('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x126c('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x126c('0x2'))(_0x126c('0x3'));var config=require(_0x126c('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x126c('0x5')]({'port':0x232a});config[_0x126c('0x6')]=_['defaults'](config[_0x126c('0x6')],{'host':_0x126c('0x7'),'port':0x18eb});var socket=require(_0x126c('0x8'))(new Redis(config[_0x126c('0x6')]));require(_0x126c('0x9'))[_0x126c('0xa')](socket);function respondWithRpcPromise(_0xc6aaf6,_0x51f800,_0x47847a){return new BPromise(function(_0x43a7bf,_0x224225){return client[_0x126c('0xb')](_0xc6aaf6,_0x47847a)[_0x126c('0xc')](function(_0x4426f4){logger[_0x126c('0xd')](_0x126c('0xe'),_0x51f800,'request\x20sent');logger[_0x126c('0xf')]('CmList,\x20%s,\x20%s,\x20%s',_0x51f800,_0x126c('0x10'),JSON[_0x126c('0x11')](_0x4426f4));if(_0x4426f4[_0x126c('0x12')]){if(_0x4426f4[_0x126c('0x12')][_0x126c('0x13')]===0x1f4){logger[_0x126c('0x12')](_0x126c('0xe'),_0x51f800,_0x4426f4[_0x126c('0x12')]['message']);return _0x224225(_0x4426f4[_0x126c('0x12')][_0x126c('0x14')]);}logger[_0x126c('0x12')](_0x126c('0xe'),_0x51f800,_0x4426f4[_0x126c('0x12')][_0x126c('0x14')]);return _0x43a7bf(_0x4426f4[_0x126c('0x12')][_0x126c('0x14')]);}else{logger[_0x126c('0xd')](_0x126c('0xe'),_0x51f800,_0x126c('0x10'));_0x43a7bf(_0x4426f4[_0x126c('0x15')][_0x126c('0x14')]);}})[_0x126c('0x16')](function(_0x3076c0){logger['error'](_0x126c('0xe'),_0x51f800,_0x3076c0);_0x224225(_0x3076c0);});});} \ No newline at end of file +var _0x63ef=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./cmList.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','CmList,\x20%s,\x20%s','message','result'];(function(_0xe7fcc5,_0x3ec043){var _0x236d9b=function(_0x37b4e6){while(--_0x37b4e6){_0xe7fcc5['push'](_0xe7fcc5['shift']());}};_0x236d9b(++_0x3ec043);}(_0x63ef,0x82));var _0xf63e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x63ef[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xf63e('0x0'));var util=require(_0xf63e('0x1'));var moment=require(_0xf63e('0x2'));var BPromise=require(_0xf63e('0x3'));var rs=require(_0xf63e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf63e('0x5'))['db'];var utils=require(_0xf63e('0x6'));var logger=require(_0xf63e('0x7'))(_0xf63e('0x8'));var config=require(_0xf63e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf63e('0xa')][_0xf63e('0xb')]({'port':0x232a});config[_0xf63e('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf63e('0xc')]));require(_0xf63e('0xd'))[_0xf63e('0xe')](socket);function respondWithRpcPromise(_0x346b97,_0x5717df,_0x8fe3a5){return new BPromise(function(_0x277030,_0x560be1){return client[_0xf63e('0xf')](_0x346b97,_0x8fe3a5)[_0xf63e('0x10')](function(_0x304a6f){logger[_0xf63e('0x11')]('CmList,\x20%s,\x20%s',_0x5717df,'request\x20sent');logger[_0xf63e('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x5717df,_0xf63e('0x13'),JSON[_0xf63e('0x14')](_0x304a6f));if(_0x304a6f['error']){if(_0x304a6f[_0xf63e('0x15')][_0xf63e('0x16')]===0x1f4){logger[_0xf63e('0x15')](_0xf63e('0x17'),_0x5717df,_0x304a6f[_0xf63e('0x15')][_0xf63e('0x18')]);return _0x560be1(_0x304a6f[_0xf63e('0x15')][_0xf63e('0x18')]);}logger[_0xf63e('0x15')](_0xf63e('0x17'),_0x5717df,_0x304a6f[_0xf63e('0x15')]['message']);return _0x277030(_0x304a6f[_0xf63e('0x15')][_0xf63e('0x18')]);}else{logger['info'](_0xf63e('0x17'),_0x5717df,_0xf63e('0x13'));_0x277030(_0x304a6f[_0xf63e('0x19')][_0xf63e('0x18')]);}})['catch'](function(_0x48700a){logger['error'](_0xf63e('0x17'),_0x5717df,_0x48700a);_0x560be1(_0x48700a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 863f774..c9e0e9f 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 _0x1e72=['cmList:','save','emit','register','length'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x1e72,0x182));var _0x21e7=function(_0x11eea8,_0x5f2166){_0x11eea8=_0x11eea8-0x0;var _0x2e431e=_0x1e72[_0x11eea8];return _0x2e431e;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x21e7('0x0'),'remove','update'];function createListener(_0x4e3917,_0x505c6c){return function(_0x2a9b2f){_0x505c6c[_0x21e7('0x1')](_0x4e3917,_0x2a9b2f);};}function removeListener(_0x3f8056,_0x40ac25){return function(){CmListEvents['removeListener'](_0x3f8056,_0x40ac25);};}exports[_0x21e7('0x2')]=function(_0x3df0da){for(var _0x320561=0x0,_0x4fb0fc=events[_0x21e7('0x3')];_0x320561<_0x4fb0fc;_0x320561++){var _0x44697e=events[_0x320561];var _0x257d6f=createListener(_0x21e7('0x4')+_0x44697e,_0x3df0da);CmListEvents['on'](_0x44697e,_0x257d6f);}}; \ No newline at end of file +var _0x2aee=['update','removeListener','length','cmList:','./cmList.events','save'];(function(_0x77853f,_0xf6ee23){var _0x49270f=function(_0x4fc18b){while(--_0x4fc18b){_0x77853f['push'](_0x77853f['shift']());}};_0x49270f(++_0xf6ee23);}(_0x2aee,0x8e));var _0xe2ae=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x2aee[_0x1be3b3];return _0x4f8b2d;};'use strict';var CmListEvents=require(_0xe2ae('0x0'));var events=[_0xe2ae('0x1'),'remove',_0xe2ae('0x2')];function createListener(_0x2fbf94,_0x4f88c2){return function(_0x15e3c9){_0x4f88c2['emit'](_0x2fbf94,_0x15e3c9);};}function removeListener(_0x47fc37,_0x2c47a7){return function(){CmListEvents[_0xe2ae('0x3')](_0x47fc37,_0x2c47a7);};}exports['register']=function(_0x50998c){for(var _0x33efb6=0x0,_0x492214=events[_0xe2ae('0x4')];_0x33efb6<_0x492214;_0x33efb6++){var _0x3ddac6=events[_0x33efb6];var _0x3548d8=createListener(_0xe2ae('0x5')+_0x3ddac6,_0x50998c);CmListEvents['on'](_0x3ddac6,_0x3548d8);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8fd3d37..6579012 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 _0x3fdd=['put','delete','removeDispositions','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents'];(function(_0x460358,_0x354877){var _0xdfdfa8=function(_0x4cc317){while(--_0x4cc317){_0x460358['push'](_0x460358['shift']());}};_0xdfdfa8(++_0x354877);}(_0x3fdd,0x158));var _0xd3fd=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x3fdd[_0x3e0b8f];return _0x22f742;};'use strict';var multer=require('multer');var util=require(_0xd3fd('0x0'));var path=require(_0xd3fd('0x1'));var timeout=require(_0xd3fd('0x2'));var express=require('express');var router=express[_0xd3fd('0x3')]();var fs_extra=require(_0xd3fd('0x4'));var auth=require(_0xd3fd('0x5'));var interaction=require(_0xd3fd('0x6'));var config=require(_0xd3fd('0x7'));var controller=require(_0xd3fd('0x8'));router[_0xd3fd('0x9')]('/',auth[_0xd3fd('0xa')](),controller[_0xd3fd('0xb')]);router[_0xd3fd('0x9')](_0xd3fd('0xc'),auth['isAuthenticated'](),controller[_0xd3fd('0xd')]);router[_0xd3fd('0x9')](_0xd3fd('0xe'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0xf')]);router[_0xd3fd('0x9')](_0xd3fd('0x10'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x11')]);router[_0xd3fd('0x9')](_0xd3fd('0x12'),auth[_0xd3fd('0xa')](),controller['getContacts']);router[_0xd3fd('0x9')](_0xd3fd('0x13'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x14')]);router[_0xd3fd('0x9')]('/:id/fields',auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x15')]);router['get'](_0xd3fd('0x16'),auth[_0xd3fd('0xa')](),controller['getAgents']);router[_0xd3fd('0x17')]('/',auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x18')]);router[_0xd3fd('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd3fd('0x19')]);router['post'](_0xd3fd('0x12'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x1a')]);router[_0xd3fd('0x17')](_0xd3fd('0x1b'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x1c')]);router[_0xd3fd('0x17')]('/:id/users',auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x1d')]);router[_0xd3fd('0x1e')](_0xd3fd('0xe'),auth[_0xd3fd('0xa')](),controller['update']);router['delete'](_0xd3fd('0xe'),auth[_0xd3fd('0xa')](),controller['destroy']);router[_0xd3fd('0x1f')](_0xd3fd('0x10'),auth[_0xd3fd('0xa')](),controller[_0xd3fd('0x20')]);router[_0xd3fd('0x1f')](_0xd3fd('0x16'),auth[_0xd3fd('0xa')](),controller['removeAgents']);module[_0xd3fd('0x21')]=router; \ No newline at end of file +var _0x5e91=['put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','create','post','addDisposition','/:id/users'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5e91,0x187));var _0x15e9=function(_0x26fca8,_0x45356c){_0x26fca8=_0x26fca8-0x0;var _0x1e43df=_0x5e91[_0x26fca8];return _0x1e43df;};'use strict';var multer=require(_0x15e9('0x0'));var util=require(_0x15e9('0x1'));var path=require(_0x15e9('0x2'));var timeout=require(_0x15e9('0x3'));var express=require(_0x15e9('0x4'));var router=express[_0x15e9('0x5')]();var fs_extra=require(_0x15e9('0x6'));var auth=require(_0x15e9('0x7'));var interaction=require(_0x15e9('0x8'));var config=require(_0x15e9('0x9'));var controller=require(_0x15e9('0xa'));router['get']('/',auth[_0x15e9('0xb')](),controller[_0x15e9('0xc')]);router['get'](_0x15e9('0xd'),auth[_0x15e9('0xb')](),controller[_0x15e9('0xe')]);router['get'](_0x15e9('0xf'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x10')]);router[_0x15e9('0x11')](_0x15e9('0x12'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x13')]);router['get'](_0x15e9('0x14'),auth[_0x15e9('0xb')](),controller['getContacts']);router[_0x15e9('0x11')](_0x15e9('0x15'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x16')]);router['get'](_0x15e9('0x17'),auth[_0x15e9('0xb')](),controller['getCustomFields']);router[_0x15e9('0x11')]('/:id/users',auth[_0x15e9('0xb')](),controller[_0x15e9('0x18')]);router['post']('/',auth[_0x15e9('0xb')](),controller[_0x15e9('0x19')]);router[_0x15e9('0x1a')](_0x15e9('0x12'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x1b')]);router[_0x15e9('0x1a')](_0x15e9('0x14'),auth[_0x15e9('0xb')](),controller['addContacts']);router[_0x15e9('0x1a')](_0x15e9('0x17'),auth[_0x15e9('0xb')](),controller['addCustomField']);router['post'](_0x15e9('0x1c'),auth[_0x15e9('0xb')](),controller['addAgents']);router[_0x15e9('0x1d')](_0x15e9('0xf'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x1e')]);router['delete'](_0x15e9('0xf'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x1f')]);router[_0x15e9('0x20')](_0x15e9('0x12'),auth[_0x15e9('0xb')](),controller['removeDispositions']);router[_0x15e9('0x20')](_0x15e9('0x1c'),auth[_0x15e9('0xb')](),controller[_0x15e9('0x21')]);module[_0x15e9('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 9974be6..2776b96 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 _0xaa36=['exports','getDataValue','field','STRING','sequelize'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xaa36,0x194));var _0x6aa3=function(_0x4a22df,_0x2b7698){_0x4a22df=_0x4a22df-0x0;var _0x25b34f=_0xaa36[_0x4a22df];return _0x25b34f;};'use strict';var Sequelize=require(_0x6aa3('0x0'));module[_0x6aa3('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x210e68){return this[_0x6aa3('0x2')](_0x6aa3('0x3'));}},'field':{'type':Sequelize[_0x6aa3('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6aa3('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x6aa3('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x02fb=['STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x84fb44,_0x2c13b7){var _0x53a9f1=function(_0x3771e4){while(--_0x3771e4){_0x84fb44['push'](_0x84fb44['shift']());}};_0x53a9f1(++_0x2c13b7);}(_0x02fb,0x19b));var _0xb02f=function(_0x32808a,_0x5aa505){_0x32808a=_0x32808a-0x0;var _0xdbb971=_0x02fb[_0x32808a];return _0xdbb971;};'use strict';var Sequelize=require(_0xb02f('0x0'));module[_0xb02f('0x1')]={'name':{'type':Sequelize[_0xb02f('0x2')],'get':function(_0x1ac99e){return this[_0xb02f('0x3')]('field');}},'field':{'type':Sequelize[_0xb02f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xb02f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xb02f('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index df8e1cd..f88de0f 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(_0x43ea44,_0xadf459){var _0x35f6d4=function(_0x59a287){while(--_0x59a287){_0x43ea44['push'](_0x43ea44['shift']());}};_0x35f6d4(++_0xadf459);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x101a00,_0x5cca89){var _0x317e6f=function(_0x188d99){while(--_0x188d99){_0x101a00['push'](_0x101a00['shift']());}};_0x317e6f(++_0x5cca89);}(_0x7a54,0x106));var _0x47a5=function(_0x292c1a,_0x4f5ec8){_0x292c1a=_0x292c1a-0x0;var _0x4998b3=_0x7a54[_0x292c1a];return _0x4998b3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 9ce81c0..6963873 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 _0x243b=['lodash','moment','bluebird','rimraf','./condition.attributes','exports','Condition','tools_conditions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x243b,0x188));var _0xb243=function(_0xdcd9a9,_0x56e3cc){_0xdcd9a9=_0xdcd9a9-0x0;var _0x3f7378=_0x243b[_0xdcd9a9];return _0x3f7378;};'use strict';var _=require(_0xb243('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb243('0x1'));var BPromise=require(_0xb243('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb243('0x3'));var config=require('../../config/environment');var attributes=require(_0xb243('0x4'));module[_0xb243('0x5')]=function(_0x53a182,_0x57f1a9){return _0x53a182['define'](_0xb243('0x6'),attributes,{'tableName':_0xb243('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0290=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird'];(function(_0x4bac2e,_0x235cf1){var _0x19110a=function(_0x5e757b){while(--_0x5e757b){_0x4bac2e['push'](_0x4bac2e['shift']());}};_0x19110a(++_0x235cf1);}(_0x0290,0xcd));var _0x0029=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x0290[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0029('0x0'));var util=require(_0x0029('0x1'));var logger=require(_0x0029('0x2'))(_0x0029('0x3'));var moment=require('moment');var BPromise=require(_0x0029('0x4'));var rp=require(_0x0029('0x5'));var fs=require('fs');var path=require(_0x0029('0x6'));var rimraf=require(_0x0029('0x7'));var config=require(_0x0029('0x8'));var attributes=require(_0x0029('0x9'));module[_0x0029('0xa')]=function(_0x33e8d4,_0x4118a9){return _0x33e8d4[_0x0029('0xb')](_0x0029('0xc'),attributes,{'tableName':_0x0029('0xd'),'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 fd1f579..279d67c 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 _0xbdcf=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0xbdcf,0x116));var _0xfbdc=function(_0x456770,_0x597caa){_0x456770=_0x456770-0x0;var _0x1d4cc7=_0xbdcf[_0x456770];return _0x1d4cc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbdc('0x0'));var BPromise=require(_0xfbdc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbdc('0x2'));var db=require(_0xfbdc('0x3'))['db'];var utils=require(_0xfbdc('0x4'));var logger=require(_0xfbdc('0x5'))(_0xfbdc('0x6'));var config=require(_0xfbdc('0x7'));var jayson=require(_0xfbdc('0x8'));var client=jayson[_0xfbdc('0x9')][_0xfbdc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a2e67,_0x4ccc1a,_0x31ff9c){return new BPromise(function(_0x37ed0a,_0x3d6134){return client[_0xfbdc('0xb')](_0x5a2e67,_0x31ff9c)[_0xfbdc('0xc')](function(_0x4e25e1){logger['info'](_0xfbdc('0xd'),_0x4ccc1a,_0xfbdc('0xe'));logger[_0xfbdc('0xf')](_0xfbdc('0x10'),_0x4ccc1a,'request\x20sent',JSON[_0xfbdc('0x11')](_0x4e25e1));if(_0x4e25e1[_0xfbdc('0x12')]){if(_0x4e25e1[_0xfbdc('0x12')][_0xfbdc('0x13')]===0x1f4){logger[_0xfbdc('0x12')]('Condition,\x20%s,\x20%s',_0x4ccc1a,_0x4e25e1[_0xfbdc('0x12')][_0xfbdc('0x14')]);return _0x3d6134(_0x4e25e1[_0xfbdc('0x12')][_0xfbdc('0x14')]);}logger[_0xfbdc('0x12')](_0xfbdc('0xd'),_0x4ccc1a,_0x4e25e1[_0xfbdc('0x12')][_0xfbdc('0x14')]);return _0x37ed0a(_0x4e25e1['error'][_0xfbdc('0x14')]);}else{logger[_0xfbdc('0x15')](_0xfbdc('0xd'),_0x4ccc1a,'request\x20sent');_0x37ed0a(_0x4e25e1[_0xfbdc('0x16')][_0xfbdc('0x14')]);}})[_0xfbdc('0x17')](function(_0x402cb1){logger[_0xfbdc('0x12')](_0xfbdc('0xd'),_0x4ccc1a,_0x402cb1);_0x3d6134(_0x402cb1);});});} \ No newline at end of file +var _0x71dc=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','Condition,\x20%s,\x20%s','message','catch','lodash'];(function(_0x42bf0b,_0x2603a7){var _0x541008=function(_0x10c0ad){while(--_0x10c0ad){_0x42bf0b['push'](_0x42bf0b['shift']());}};_0x541008(++_0x2603a7);}(_0x71dc,0x179));var _0xc71d=function(_0x3ff78d,_0x475377){_0x3ff78d=_0x3ff78d-0x0;var _0x20e0af=_0x71dc[_0x3ff78d];return _0x20e0af;};'use strict';var _=require(_0xc71d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc71d('0x1'));var rs=require(_0xc71d('0x2'));var fs=require('fs');var Redis=require(_0xc71d('0x3'));var db=require(_0xc71d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc71d('0x5'))(_0xc71d('0x6'));var config=require(_0xc71d('0x7'));var jayson=require(_0xc71d('0x8'));var client=jayson[_0xc71d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4fed,_0x305344,_0xe031ce){return new BPromise(function(_0x4fc9e2,_0x3f4846){return client[_0xc71d('0xa')](_0x2e4fed,_0xe031ce)[_0xc71d('0xb')](function(_0x373871){logger[_0xc71d('0xc')]('Condition,\x20%s,\x20%s',_0x305344,_0xc71d('0xd'));logger[_0xc71d('0xe')](_0xc71d('0xf'),_0x305344,_0xc71d('0xd'),JSON['stringify'](_0x373871));if(_0x373871[_0xc71d('0x10')]){if(_0x373871['error'][_0xc71d('0x11')]===0x1f4){logger['error'](_0xc71d('0x12'),_0x305344,_0x373871[_0xc71d('0x10')][_0xc71d('0x13')]);return _0x3f4846(_0x373871['error'][_0xc71d('0x13')]);}logger['error'](_0xc71d('0x12'),_0x305344,_0x373871[_0xc71d('0x10')][_0xc71d('0x13')]);return _0x4fc9e2(_0x373871[_0xc71d('0x10')][_0xc71d('0x13')]);}else{logger[_0xc71d('0xc')](_0xc71d('0x12'),_0x305344,'request\x20sent');_0x4fc9e2(_0x373871['result'][_0xc71d('0x13')]);}})[_0xc71d('0x14')](function(_0x3e55b6){logger[_0xc71d('0x10')](_0xc71d('0x12'),_0x305344,_0x3e55b6);_0x3f4846(_0x3e55b6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fa14ccf..d51d9ca 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 _0x20ae=['../../config/environment','put','update','delete','/:id','isAuthenticated','exports','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x8212b9,_0x4b8686){var _0x10184c=function(_0x43292c){while(--_0x43292c){_0x8212b9['push'](_0x8212b9['shift']());}};_0x10184c(++_0x4b8686);}(_0x20ae,0xbb));var _0xe20a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x20ae[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0xe20a('0x0'));var util=require('util');var path=require(_0xe20a('0x1'));var timeout=require('connect-timeout');var express=require(_0xe20a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe20a('0x3'));var interaction=require(_0xe20a('0x4'));var config=require(_0xe20a('0x5'));var controller=require('./condition.controller');router[_0xe20a('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xe20a('0x7')]);router[_0xe20a('0x8')](_0xe20a('0x9'),auth[_0xe20a('0xa')](),controller['destroy']);module[_0xe20a('0xb')]=router; \ No newline at end of file +var _0x2207=['/:id','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2207,0x188));var _0x7220=function(_0x333987,_0x637b06){_0x333987=_0x333987-0x0;var _0x319755=_0x2207[_0x333987];return _0x319755;};'use strict';var multer=require('multer');var util=require(_0x7220('0x0'));var path=require(_0x7220('0x1'));var timeout=require(_0x7220('0x2'));var express=require(_0x7220('0x3'));var router=express['Router']();var fs_extra=require(_0x7220('0x4'));var auth=require(_0x7220('0x5'));var interaction=require(_0x7220('0x6'));var config=require(_0x7220('0x7'));var controller=require(_0x7220('0x8'));router[_0x7220('0x9')]('/:id',auth[_0x7220('0xa')](),controller[_0x7220('0xb')]);router[_0x7220('0xc')](_0x7220('0xd'),auth['isAuthenticated'](),controller[_0x7220('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 23d27bc..17e011b 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3d9da9,_0x4e48b0){var _0xf50cfc=function(_0x9d6cd6){while(--_0x9d6cd6){_0x3d9da9['push'](_0x3d9da9['shift']());}};_0xf50cfc(++_0x4e48b0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x46312e,_0x4843a2){var _0x25ea77=function(_0x751aa){while(--_0x751aa){_0x46312e['push'](_0x46312e['shift']());}};_0x25ea77(++_0x4843a2);}(_0x757a,0xde));var _0xa757=function(_0x297230,_0x17a111){_0x297230=_0x297230-0x0;var _0x3cb151=_0x757a[_0x297230];return _0x3cb151;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6a0721a..b7f75fd 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 _0xe3ac=['type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','Dashboard','includeAll','findAll','rows','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','include','createdAt','updatedAt','body','autoAssociation','attrUrl','attrs','https://','custom','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','end','stack','name','index','map'];(function(_0x2f6c6d,_0xc0c45){var _0x4712fe=function(_0x452504){while(--_0x452504){_0x2f6c6d['push'](_0x2f6c6d['shift']());}};_0x4712fe(++_0xc0c45);}(_0xe3ac,0x1a1));var _0xce3a=function(_0x213213,_0x337d60){_0x213213=_0x213213-0x0;var _0x204b9b=_0xe3ac[_0x213213];return _0x204b9b;};'use strict';var emlformat=require(_0xce3a('0x0'));var rimraf=require(_0xce3a('0x1'));var zipdir=require(_0xce3a('0x2'));var jsonpatch=require(_0xce3a('0x3'));var rp=require(_0xce3a('0x4'));var moment=require('moment');var BPromise=require(_0xce3a('0x5'));var Mustache=require(_0xce3a('0x6'));var util=require('util');var path=require(_0xce3a('0x7'));var sox=require(_0xce3a('0x8'));var csv=require(_0xce3a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce3a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce3a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xce3a('0xc'));var toCsv=require(_0xce3a('0x9'));var querystring=require(_0xce3a('0xd'));var Papa=require(_0xce3a('0xe'));var Redis=require(_0xce3a('0xf'));var authService=require(_0xce3a('0x10'));var qs=require(_0xce3a('0x11'));var as=require(_0xce3a('0x12'));var hardwareService=require(_0xce3a('0x13'));var logger=require(_0xce3a('0x14'))(_0xce3a('0x15'));var utils=require('../../config/utils');var config=require(_0xce3a('0x16'));var licenseUtil=require(_0xce3a('0x17'));var db=require(_0xce3a('0x18'))['db'];config[_0xce3a('0x19')]=_['defaults'](config[_0xce3a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xce3a('0x1a'))(new Redis(config[_0xce3a('0x19')]));require('./dashboard.socket')[_0xce3a('0x1b')](socket);function respondWithStatusCode(_0xc31222,_0x509a74){_0x509a74=_0x509a74||0xcc;return function(_0x31347c){if(_0x31347c){return _0xc31222['sendStatus'](_0x509a74);}return _0xc31222[_0xce3a('0x1c')](_0x509a74)['end']();};}function respondWithResult(_0x5666a0,_0x37c4b1){_0x37c4b1=_0x37c4b1||0xc8;return function(_0x5a410f){if(_0x5a410f){return _0x5666a0['status'](_0x37c4b1)[_0xce3a('0x1d')](_0x5a410f);}};}function respondWithFilteredResult(_0x14e4bf,_0xb14734){return function(_0x1f4f1c){if(_0x1f4f1c){var _0x19266f=typeof _0xb14734[_0xce3a('0x1e')]==='undefined'&&typeof _0xb14734[_0xce3a('0x1f')]==='undefined';var _0xeb064d=_0x1f4f1c[_0xce3a('0x20')];var _0x32fb5f=_0x19266f?0x0:_0xb14734[_0xce3a('0x1e')];var _0x4005d4=_0x19266f?_0x1f4f1c[_0xce3a('0x20')]:_0xb14734[_0xce3a('0x1e')]+_0xb14734[_0xce3a('0x1f')];var _0x552b7c;if(_0x4005d4>=_0xeb064d){_0x4005d4=_0xeb064d;_0x552b7c=0xc8;}else{_0x552b7c=0xce;}_0x14e4bf[_0xce3a('0x1c')](_0x552b7c);return _0x14e4bf[_0xce3a('0x21')](_0xce3a('0x22'),_0x32fb5f+'-'+_0x4005d4+'/'+_0xeb064d)[_0xce3a('0x1d')](_0x1f4f1c);}return null;};}function patchUpdates(_0x595f4a){return function(_0x22577d){try{jsonpatch[_0xce3a('0x23')](_0x22577d,_0x595f4a,!![]);}catch(_0x206b66){return BPromise[_0xce3a('0x24')](_0x206b66);}return _0x22577d[_0xce3a('0x25')]();};}function saveUpdates(_0x3a81c9,_0x50f3d3){return function(_0x479ed3){if(_0x479ed3){return _0x479ed3[_0xce3a('0x26')](_0x3a81c9)[_0xce3a('0x27')](function(_0x5b542f){return _0x5b542f;});}return null;};}function removeEntity(_0x3ce148,_0xc7978c){return function(_0x440e31){if(_0x440e31){return _0x440e31[_0xce3a('0x28')]()[_0xce3a('0x27')](function(){var _0x1ccc43=_0x440e31[_0xce3a('0x29')]({'plain':!![]});var _0x4b6d63='CustomDashboards';return db['UserProfileResource'][_0xce3a('0x28')]({'where':{'type':_0x4b6d63,'resourceId':_0x1ccc43['id']}})[_0xce3a('0x27')](function(){return _0x440e31;});})[_0xce3a('0x27')](function(){_0x3ce148['status'](0xcc)[_0xce3a('0x2a')]();});}};}function handleEntityNotFound(_0x37dc43,_0x3f6e16){return function(_0x508bc0){if(!_0x508bc0){_0x37dc43['sendStatus'](0x194);}return _0x508bc0;};}function handleError(_0x516abb,_0x1a88aa){_0x1a88aa=_0x1a88aa||0x1f4;return function(_0x152027){logger['error'](_0x152027[_0xce3a('0x2b')]);if(_0x152027[_0xce3a('0x2c')]){delete _0x152027['name'];}_0x516abb[_0xce3a('0x1c')](_0x1a88aa)['send'](_0x152027);};}exports[_0xce3a('0x2d')]=function(_0x2b0a73,_0xbf02e2){var _0x3386c4={},_0x4052cc={},_0x493c18={'count':0x0,'rows':[]};var _0x569f7e=_[_0xce3a('0x2e')](db['Dashboard']['rawAttributes'],function(_0x440d79){return{'name':_0x440d79['fieldName'],'type':_0x440d79[_0xce3a('0x2f')]['key']};});_0x4052cc[_0xce3a('0x30')]=_[_0xce3a('0x2e')](_0x569f7e,'name');_0x4052cc[_0xce3a('0x31')]=_[_0xce3a('0x32')](_0x2b0a73[_0xce3a('0x31')]);_0x4052cc[_0xce3a('0x33')]=_[_0xce3a('0x34')](_0x4052cc[_0xce3a('0x30')],_0x4052cc[_0xce3a('0x31')]);_0x3386c4[_0xce3a('0x35')]=_[_0xce3a('0x34')](_0x4052cc[_0xce3a('0x30')],qs['fields'](_0x2b0a73[_0xce3a('0x31')]['fields']));_0x3386c4['attributes']=_0x3386c4['attributes'][_0xce3a('0x36')]?_0x3386c4['attributes']:_0x4052cc['model'];if(!_0x2b0a73[_0xce3a('0x31')][_0xce3a('0x37')]('nolimit')){_0x3386c4[_0xce3a('0x1f')]=qs[_0xce3a('0x1f')](_0x2b0a73[_0xce3a('0x31')][_0xce3a('0x1f')]);_0x3386c4['offset']=qs[_0xce3a('0x1e')](_0x2b0a73['query'][_0xce3a('0x1e')]);}_0x3386c4[_0xce3a('0x38')]=qs['sort'](_0x2b0a73[_0xce3a('0x31')]['sort']);_0x3386c4[_0xce3a('0x39')]=qs[_0xce3a('0x33')](_[_0xce3a('0x3a')](_0x2b0a73[_0xce3a('0x31')],_0x4052cc[_0xce3a('0x33')]),_0x569f7e);if(_0x2b0a73[_0xce3a('0x31')][_0xce3a('0x3b')]){_0x3386c4[_0xce3a('0x39')]=_['merge'](_0x3386c4[_0xce3a('0x39')],{'$or':_['map'](_0x569f7e,function(_0x4940bd){if(_0x4940bd['type']!==_0xce3a('0x3c')){var _0x40deee={};_0x40deee[_0x4940bd[_0xce3a('0x2c')]]={'$like':'%'+_0x2b0a73[_0xce3a('0x31')][_0xce3a('0x3b')]+'%'};return _0x40deee;}})});}_0x3386c4=_[_0xce3a('0x3d')]({},_0x3386c4,_0x2b0a73[_0xce3a('0x3e')]);var _0x25ca39={'where':_0x3386c4[_0xce3a('0x39')]};return db[_0xce3a('0x3f')][_0xce3a('0x20')](_0x25ca39)[_0xce3a('0x27')](function(_0x1018f5){_0x493c18[_0xce3a('0x20')]=_0x1018f5;if(_0x2b0a73[_0xce3a('0x31')][_0xce3a('0x40')]){_0x3386c4['include']=[{'all':!![]}];}return db[_0xce3a('0x3f')][_0xce3a('0x41')](_0x3386c4);})[_0xce3a('0x27')](function(_0x1e83b2){_0x493c18[_0xce3a('0x42')]=_0x1e83b2;return _0x493c18;})['then'](respondWithFilteredResult(_0xbf02e2,_0x3386c4))['catch'](handleError(_0xbf02e2,null));};exports['show']=function(_0x21793b,_0x12e21b){var _0x3f0e36={'raw':![],'where':{'id':_0x21793b['params']['id']}},_0x2fefb4={};_0x2fefb4['model']=_[_0xce3a('0x32')](db['Dashboard'][_0xce3a('0x43')]);_0x2fefb4['query']=_[_0xce3a('0x32')](_0x21793b[_0xce3a('0x31')]);_0x2fefb4[_0xce3a('0x33')]=_[_0xce3a('0x34')](_0x2fefb4['model'],_0x2fefb4[_0xce3a('0x31')]);_0x3f0e36['attributes']=_[_0xce3a('0x34')](_0x2fefb4[_0xce3a('0x30')],qs[_0xce3a('0x44')](_0x21793b[_0xce3a('0x31')][_0xce3a('0x44')]));_0x3f0e36['attributes']=_0x3f0e36[_0xce3a('0x35')][_0xce3a('0x36')]?_0x3f0e36[_0xce3a('0x35')]:_0x2fefb4[_0xce3a('0x30')];if(_0x21793b['query'][_0xce3a('0x40')]){_0x3f0e36['include']=[{'all':!![]}];}_0x3f0e36=_['merge']({},_0x3f0e36,_0x21793b[_0xce3a('0x3e')]);return db[_0xce3a('0x3f')][_0xce3a('0x45')](_0x3f0e36)[_0xce3a('0x27')](handleEntityNotFound(_0x12e21b,null))[_0xce3a('0x27')](respondWithResult(_0x12e21b,null))['catch'](handleError(_0x12e21b,null));};exports[_0xce3a('0x46')]=function(_0x4849cb,_0x56a475){return db['Dashboard']['create'](_0x4849cb['body'],{})[_0xce3a('0x27')](function(_0xc35096){var _0x208148=_0x4849cb[_0xce3a('0x47')][_0xce3a('0x29')]({'plain':!![]});if(!_0x208148)throw new Error(_0xce3a('0x48'));if(_0x208148['role']===_0xce3a('0x47')){var _0x6a4662=_0xc35096[_0xce3a('0x29')]({'plain':!![]});var _0x44a576=_0xce3a('0x49');return db[_0xce3a('0x4a')][_0xce3a('0x45')]({'where':{'name':_0x44a576,'userProfileId':_0x208148[_0xce3a('0x4b')]},'raw':!![]})[_0xce3a('0x27')](function(_0x155d81){if(_0x155d81&&_0x155d81['autoAssociation']===0x0){return db[_0xce3a('0x4c')]['create']({'name':_0x6a4662[_0xce3a('0x2c')],'resourceId':_0x6a4662['id'],'type':_0x155d81[_0xce3a('0x2c')],'sectionId':_0x155d81['id']},{})[_0xce3a('0x27')](function(){return _0xc35096;});}else{return _0xc35096;}})['catch'](function(_0x1eab36){logger[_0xce3a('0x4d')](_0xce3a('0x4e'),_0x1eab36);throw _0x1eab36;});}return _0xc35096;})[_0xce3a('0x27')](respondWithResult(_0x56a475,0xc9))[_0xce3a('0x4f')](handleError(_0x56a475,null));};exports['clone']=function(_0x255438,_0x5ebad1){var _0x2b09d8={'where':{'id':_0x255438[_0xce3a('0x50')]['id']}},_0x4fd133={};_0x4fd133[_0xce3a('0x30')]=_[_0xce3a('0x32')](db['Dashboard']['rawAttributes']);_0x2b09d8[_0xce3a('0x35')]=_[_0xce3a('0x34')](_0x4fd133[_0xce3a('0x30')],qs[_0xce3a('0x44')](_0x255438['query'][_0xce3a('0x44')]));_0x2b09d8['attributes']=_0x2b09d8['attributes']['length']?_0x2b09d8['attributes']:_0x4fd133['model'];if(_0x255438[_0xce3a('0x31')][_0xce3a('0x40')]){_0x2b09d8[_0xce3a('0x51')]=[{'all':!![]}];}_0x2b09d8=_[_0xce3a('0x3d')]({},_0x2b09d8,_0x255438[_0xce3a('0x3e')]);return db[_0xce3a('0x3f')]['find'](_0x2b09d8)[_0xce3a('0x27')](handleEntityNotFound(_0x5ebad1,null))[_0xce3a('0x27')](function(_0x2d55fa){if(_0x2d55fa){var _0x35a60b=_0x2d55fa['get']({'plain':!![]});_0x35a60b=qs['omit'](_0x35a60b,['id',_0xce3a('0x52'),_0xce3a('0x53')]);_0x255438[_0xce3a('0x54')]=_['omit'](_0x255438[_0xce3a('0x54')],['id',_0xce3a('0x52'),'updatedAt']);return db[_0xce3a('0x3f')][_0xce3a('0x46')](_['merge'](_0x35a60b,_0x255438[_0xce3a('0x54')]),{'include':_0x255438['query'][_0xce3a('0x40')]?[{'all':!![]}]:undefined})[_0xce3a('0x27')](function(_0x515802){var _0x1ef9cb=_0x255438[_0xce3a('0x47')][_0xce3a('0x29')]({'plain':!![]});if(!_0x1ef9cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ef9cb['role']==='user'){var _0x5240ad=_0x515802['get']({'plain':!![]});var _0x1f38f8=_0xce3a('0x49');return db[_0xce3a('0x4a')][_0xce3a('0x45')]({'where':{'name':_0x1f38f8,'userProfileId':_0x1ef9cb[_0xce3a('0x4b')]},'raw':!![]})[_0xce3a('0x27')](function(_0x5ebdfc){if(_0x5ebdfc&&_0x5ebdfc[_0xce3a('0x55')]===0x0){return db[_0xce3a('0x4c')][_0xce3a('0x46')]({'name':_0x5240ad[_0xce3a('0x2c')],'resourceId':_0x5240ad['id'],'type':_0x5ebdfc['name'],'sectionId':_0x5ebdfc['id']},{})[_0xce3a('0x27')](function(){return _0x515802;});}else{return _0x515802;}})[_0xce3a('0x4f')](function(_0x264fef){logger[_0xce3a('0x4d')](_0xce3a('0x4e'),_0x264fef);throw _0x264fef;});}return _0x515802;});}})[_0xce3a('0x27')](respondWithResult(_0x5ebad1,0xc9))[_0xce3a('0x4f')](handleError(_0x5ebad1,null));};exports[_0xce3a('0x26')]=function(_0xa27fc0,_0xdb4e67){if(_0xa27fc0[_0xce3a('0x54')]['id']){delete _0xa27fc0['body']['id'];}return db['Dashboard'][_0xce3a('0x45')]({'where':{'id':_0xa27fc0[_0xce3a('0x50')]['id']}})[_0xce3a('0x27')](handleEntityNotFound(_0xdb4e67,null))[_0xce3a('0x27')](saveUpdates(_0xa27fc0[_0xce3a('0x54')],null))[_0xce3a('0x27')](respondWithResult(_0xdb4e67,null))['catch'](handleError(_0xdb4e67,null));};exports[_0xce3a('0x28')]=function(_0x5163ac,_0x2539d1){return db[_0xce3a('0x3f')][_0xce3a('0x45')]({'where':{'id':_0x5163ac[_0xce3a('0x50')]['id']}})[_0xce3a('0x27')](handleEntityNotFound(_0x2539d1,null))[_0xce3a('0x27')](removeEntity(_0x2539d1,null))['catch'](handleError(_0x2539d1,null));};function widgetAttributes(_0x4c5a7f){try{switch(_0x4c5a7f[_0xce3a('0x2f')]){case'iframe':return[{'name':_0xce3a('0x56'),'value':_0x4c5a7f[_0xce3a('0x56')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0]['value']:undefined)||_0xce3a('0x58')}];case _0xce3a('0x59'):return[{'name':'attrPath','value':_0x4c5a7f['attrPath']||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0][_0xce3a('0x5a')]:undefined)||''}];case'clock':return[{'name':_0xce3a('0x5b'),'value':_0x4c5a7f[_0xce3a('0x5b')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0][_0xce3a('0x5a')]:undefined)||_0xce3a('0x5c')},{'name':_0xce3a('0x5d'),'value':_0x4c5a7f[_0xce3a('0x5d')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x1]?_0x4c5a7f[_0xce3a('0x57')][0x1][_0xce3a('0x5a')]:undefined)||_0xce3a('0x5e')},{'name':'attrFontSize','value':_0x4c5a7f[_0xce3a('0x5f')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x2]?_0x4c5a7f[_0xce3a('0x57')][0x2]['value']:undefined)||0xc}];case _0xce3a('0x60'):return[{'name':'attrMetric','value':_0x4c5a7f['attrMetric']||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f['attrs'][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0][_0xce3a('0x5a')]:undefined)||_0xce3a('0x61')},{'name':_0xce3a('0x62'),'value':_0x4c5a7f[_0xce3a('0x62')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x1]?_0x4c5a7f[_0xce3a('0x57')][0x1][_0xce3a('0x5a')]:undefined)||[]},{'name':_0xce3a('0x5f'),'value':_0x4c5a7f[_0xce3a('0x5f')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x2]?_0x4c5a7f['attrs'][0x2]['value']:undefined)||0x14}];case _0xce3a('0x63'):case _0xce3a('0x64'):return[{'name':'attrSerie1','value':_0x4c5a7f[_0xce3a('0x65')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0][_0xce3a('0x5a')]:undefined)||_0xce3a('0x61')},{'name':'attrSerie2','value':_0x4c5a7f[_0xce3a('0x66')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x1]?_0x4c5a7f['attrs'][0x1][_0xce3a('0x5a')]:undefined)||null},{'name':_0xce3a('0x67'),'value':_0x4c5a7f[_0xce3a('0x67')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x2]?_0x4c5a7f[_0xce3a('0x57')][0x2][_0xce3a('0x5a')]:undefined)||null},{'name':_0xce3a('0x62'),'value':_0x4c5a7f[_0xce3a('0x62')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x3]?_0x4c5a7f[_0xce3a('0x57')][0x3][_0xce3a('0x5a')]:undefined)||[]}];case _0xce3a('0x68'):return[{'name':_0xce3a('0x69'),'type':_0x4c5a7f[_0xce3a('0x6a')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f['attrs'][0x0]?_0x4c5a7f[_0xce3a('0x57')][0x0][_0xce3a('0x2f')]:undefined)||null,'value':_0x4c5a7f['attrReport']||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f[_0xce3a('0x57')][0x0]?_0x4c5a7f['attrs'][0x0][_0xce3a('0x5a')]:undefined)||null},{'name':_0xce3a('0x6b'),'value':_0x4c5a7f[_0xce3a('0x6b')]||(_0x4c5a7f[_0xce3a('0x57')]&&_0x4c5a7f['attrs'][0x1]?_0x4c5a7f[_0xce3a('0x57')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4d281a){logger[_0xce3a('0x4d')](_0xce3a('0x6c'),JSON[_0xce3a('0x6d')](_0x4d281a));return[];}}exports[_0xce3a('0x6e')]=function(_0x53c857,_0x704b91,_0x295385){if(_0x53c857[_0xce3a('0x54')]['id']){delete _0x53c857[_0xce3a('0x54')]['id'];}return db[_0xce3a('0x3f')]['find']({'where':{'id':_0x53c857[_0xce3a('0x50')]['id']}})[_0xce3a('0x27')](handleEntityNotFound(_0x704b91,null))['then'](function(_0x2108c4){if(_0x2108c4){_0x53c857[_0xce3a('0x54')][_0xce3a('0x6f')]=_0x2108c4['id'];_0x53c857['body'][_0xce3a('0x57')]=widgetAttributes(_0x53c857[_0xce3a('0x54')]);return db[_0xce3a('0x70')]['create'](_0x53c857[_0xce3a('0x54')]);}})[_0xce3a('0x27')](respondWithResult(_0x704b91,null))['catch'](handleError(_0x704b91,null));};exports[_0xce3a('0x71')]=function(_0x4bd7ef,_0x4c2ec0,_0x1ccdf6){var _0x2bdd11={};var _0x5bb51e={};var _0x4a66e1;var _0x18d9e4;return db['Dashboard'][_0xce3a('0x72')]({'where':{'id':_0x4bd7ef['params']['id']}})[_0xce3a('0x27')](handleEntityNotFound(_0x4c2ec0,null))['then'](function(_0x19001a){if(_0x19001a){_0x4a66e1=_0x19001a;_0x5bb51e[_0xce3a('0x30')]=_[_0xce3a('0x32')](db[_0xce3a('0x70')][_0xce3a('0x43')]);_0x5bb51e['query']=_[_0xce3a('0x32')](_0x4bd7ef[_0xce3a('0x31')]);_0x5bb51e[_0xce3a('0x33')]=_[_0xce3a('0x34')](_0x5bb51e[_0xce3a('0x30')],_0x5bb51e[_0xce3a('0x31')]);_0x2bdd11[_0xce3a('0x35')]=_[_0xce3a('0x34')](_0x5bb51e[_0xce3a('0x30')],qs[_0xce3a('0x44')](_0x4bd7ef[_0xce3a('0x31')][_0xce3a('0x44')]));_0x2bdd11[_0xce3a('0x35')]=_0x2bdd11[_0xce3a('0x35')][_0xce3a('0x36')]?_0x2bdd11[_0xce3a('0x35')]:_0x5bb51e[_0xce3a('0x30')];_0x2bdd11[_0xce3a('0x38')]=qs['sort'](_0x4bd7ef[_0xce3a('0x31')][_0xce3a('0x73')]);_0x2bdd11[_0xce3a('0x39')]=qs[_0xce3a('0x33')](_['pick'](_0x4bd7ef[_0xce3a('0x31')],_0x5bb51e[_0xce3a('0x33')]));if(_0x4bd7ef['query']['filter']){_0x2bdd11[_0xce3a('0x39')]=_[_0xce3a('0x3d')](_0x2bdd11[_0xce3a('0x39')],{'$or':_[_0xce3a('0x2e')](_0x2bdd11[_0xce3a('0x35')],function(_0x3b8565){var _0xde948f={};_0xde948f[_0x3b8565]={'$like':'%'+_0x4bd7ef[_0xce3a('0x31')][_0xce3a('0x3b')]+'%'};return _0xde948f;})});}_0x2bdd11=_['merge']({},_0x2bdd11,_0x4bd7ef[_0xce3a('0x3e')]);return _0x4a66e1[_0xce3a('0x71')](_0x2bdd11);}})[_0xce3a('0x27')](function(_0x2baf09){if(_0x2baf09){_0x18d9e4=_0x2baf09['length'];if(!_0x4bd7ef[_0xce3a('0x31')][_0xce3a('0x37')]('nolimit')){_0x2bdd11['limit']=qs[_0xce3a('0x1f')](_0x4bd7ef[_0xce3a('0x31')][_0xce3a('0x1f')]);_0x2bdd11[_0xce3a('0x1e')]=qs[_0xce3a('0x1e')](_0x4bd7ef['query'][_0xce3a('0x1e')]);}return _0x4a66e1[_0xce3a('0x71')](_0x2bdd11);}})['then'](function(_0x5a0782){if(_0x5a0782){return _0x5a0782?{'count':_0x18d9e4,'rows':_0x5a0782}:null;}})[_0xce3a('0x27')](respondWithResult(_0x4c2ec0,null))[_0xce3a('0x4f')](handleError(_0x4c2ec0,null));}; \ No newline at end of file +var _0x204c=['catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll'];(function(_0x1cdc65,_0x1e666e){var _0x2a80e1=function(_0x1cab1c){while(--_0x1cab1c){_0x1cdc65['push'](_0x1cdc65['shift']());}};_0x2a80e1(++_0x1e666e);}(_0x204c,0x1a6));var _0xc204=function(_0x4a5246,_0x3e9b8a){_0x4a5246=_0x4a5246-0x0;var _0x49f9a7=_0x204c[_0x4a5246];return _0x49f9a7;};'use strict';var emlformat=require(_0xc204('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc204('0x1'));var jsonpatch=require(_0xc204('0x2'));var rp=require(_0xc204('0x3'));var moment=require(_0xc204('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc204('0x5'));var util=require(_0xc204('0x6'));var path=require(_0xc204('0x7'));var sox=require(_0xc204('0x8'));var csv=require(_0xc204('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc204('0xa'));var _=require(_0xc204('0xb'));var squel=require(_0xc204('0xc'));var crypto=require(_0xc204('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc204('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc204('0xf'));var Redis=require(_0xc204('0x10'));var authService=require(_0xc204('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc204('0x12'));var hardwareService=require(_0xc204('0x13'));var logger=require(_0xc204('0x14'))(_0xc204('0x15'));var utils=require(_0xc204('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc204('0x17'));var db=require(_0xc204('0x18'))['db'];config[_0xc204('0x19')]=_[_0xc204('0x1a')](config[_0xc204('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc204('0x1b'))(new Redis(config['redis']));require(_0xc204('0x1c'))[_0xc204('0x1d')](socket);function respondWithStatusCode(_0x24ae5b,_0x1b7363){_0x1b7363=_0x1b7363||0xcc;return function(_0x20891b){if(_0x20891b){return _0x24ae5b[_0xc204('0x1e')](_0x1b7363);}return _0x24ae5b[_0xc204('0x1f')](_0x1b7363)['end']();};}function respondWithResult(_0x24aa2d,_0x55e980){_0x55e980=_0x55e980||0xc8;return function(_0x345183){if(_0x345183){return _0x24aa2d[_0xc204('0x1f')](_0x55e980)[_0xc204('0x20')](_0x345183);}};}function respondWithFilteredResult(_0x2ab3bb,_0x454f04){return function(_0x1adaf3){if(_0x1adaf3){var _0x53d584=typeof _0x454f04[_0xc204('0x21')]===_0xc204('0x22')&&typeof _0x454f04['limit']===_0xc204('0x22');var _0x17ee29=_0x1adaf3[_0xc204('0x23')];var _0x59acce=_0x53d584?0x0:_0x454f04[_0xc204('0x21')];var _0x48dec7=_0x53d584?_0x1adaf3['count']:_0x454f04[_0xc204('0x21')]+_0x454f04[_0xc204('0x24')];var _0x5525da;if(_0x48dec7>=_0x17ee29){_0x48dec7=_0x17ee29;_0x5525da=0xc8;}else{_0x5525da=0xce;}_0x2ab3bb['status'](_0x5525da);return _0x2ab3bb[_0xc204('0x25')](_0xc204('0x26'),_0x59acce+'-'+_0x48dec7+'/'+_0x17ee29)[_0xc204('0x20')](_0x1adaf3);}return null;};}function patchUpdates(_0x28358d){return function(_0x43bd28){try{jsonpatch[_0xc204('0x27')](_0x43bd28,_0x28358d,!![]);}catch(_0x22af59){return BPromise[_0xc204('0x28')](_0x22af59);}return _0x43bd28[_0xc204('0x29')]();};}function saveUpdates(_0x1d7a5f,_0x1cc29c){return function(_0x23120f){if(_0x23120f){return _0x23120f[_0xc204('0x2a')](_0x1d7a5f)[_0xc204('0x2b')](function(_0x1aefe0){return _0x1aefe0;});}return null;};}function removeEntity(_0x564194,_0x2f9eec){return function(_0x57e2ca){if(_0x57e2ca){return _0x57e2ca[_0xc204('0x2c')]()['then'](function(){var _0x298a9b=_0x57e2ca[_0xc204('0x2d')]({'plain':!![]});var _0x175af6=_0xc204('0x2e');return db[_0xc204('0x2f')]['destroy']({'where':{'type':_0x175af6,'resourceId':_0x298a9b['id']}})[_0xc204('0x2b')](function(){return _0x57e2ca;});})[_0xc204('0x2b')](function(){_0x564194[_0xc204('0x1f')](0xcc)[_0xc204('0x30')]();});}};}function handleEntityNotFound(_0x2cb05c,_0x1e14b5){return function(_0x2f95c1){if(!_0x2f95c1){_0x2cb05c[_0xc204('0x1e')](0x194);}return _0x2f95c1;};}function handleError(_0x528ed0,_0x19e982){_0x19e982=_0x19e982||0x1f4;return function(_0x29189e){logger[_0xc204('0x31')](_0x29189e[_0xc204('0x32')]);if(_0x29189e['name']){delete _0x29189e[_0xc204('0x33')];}_0x528ed0[_0xc204('0x1f')](_0x19e982)['send'](_0x29189e);};}exports[_0xc204('0x34')]=function(_0x4eff26,_0x564948){var _0x4e3c5b={},_0x8c35a={},_0x31a2fa={'count':0x0,'rows':[]};var _0x4010d1=_[_0xc204('0x35')](db[_0xc204('0x36')][_0xc204('0x37')],function(_0x583ef3){return{'name':_0x583ef3[_0xc204('0x38')],'type':_0x583ef3[_0xc204('0x39')]['key']};});_0x8c35a['model']=_['map'](_0x4010d1,_0xc204('0x33'));_0x8c35a[_0xc204('0x3a')]=_[_0xc204('0x3b')](_0x4eff26[_0xc204('0x3a')]);_0x8c35a['filters']=_[_0xc204('0x3c')](_0x8c35a['model'],_0x8c35a[_0xc204('0x3a')]);_0x4e3c5b[_0xc204('0x3d')]=_[_0xc204('0x3c')](_0x8c35a[_0xc204('0x3e')],qs['fields'](_0x4eff26[_0xc204('0x3a')][_0xc204('0x3f')]));_0x4e3c5b['attributes']=_0x4e3c5b[_0xc204('0x3d')][_0xc204('0x40')]?_0x4e3c5b[_0xc204('0x3d')]:_0x8c35a[_0xc204('0x3e')];if(!_0x4eff26[_0xc204('0x3a')][_0xc204('0x41')](_0xc204('0x42'))){_0x4e3c5b[_0xc204('0x24')]=qs[_0xc204('0x24')](_0x4eff26[_0xc204('0x3a')]['limit']);_0x4e3c5b[_0xc204('0x21')]=qs[_0xc204('0x21')](_0x4eff26['query'][_0xc204('0x21')]);}_0x4e3c5b[_0xc204('0x43')]=qs[_0xc204('0x44')](_0x4eff26[_0xc204('0x3a')]['sort']);_0x4e3c5b['where']=qs[_0xc204('0x45')](_[_0xc204('0x46')](_0x4eff26['query'],_0x8c35a['filters']),_0x4010d1);if(_0x4eff26[_0xc204('0x3a')][_0xc204('0x47')]){_0x4e3c5b['where']=_[_0xc204('0x48')](_0x4e3c5b[_0xc204('0x49')],{'$or':_['map'](_0x4010d1,function(_0x1c5454){if(_0x1c5454['type']!=='VIRTUAL'){var _0x1de0a2={};_0x1de0a2[_0x1c5454[_0xc204('0x33')]]={'$like':'%'+_0x4eff26[_0xc204('0x3a')][_0xc204('0x47')]+'%'};return _0x1de0a2;}})});}_0x4e3c5b=_[_0xc204('0x48')]({},_0x4e3c5b,_0x4eff26[_0xc204('0x4a')]);var _0x36be93={'where':_0x4e3c5b[_0xc204('0x49')]};return db[_0xc204('0x36')][_0xc204('0x23')](_0x36be93)[_0xc204('0x2b')](function(_0x45e4d4){_0x31a2fa['count']=_0x45e4d4;if(_0x4eff26['query'][_0xc204('0x4b')]){_0x4e3c5b[_0xc204('0x4c')]=[{'all':!![]}];}return db[_0xc204('0x36')][_0xc204('0x4d')](_0x4e3c5b);})['then'](function(_0x50e18f){_0x31a2fa['rows']=_0x50e18f;return _0x31a2fa;})[_0xc204('0x2b')](respondWithFilteredResult(_0x564948,_0x4e3c5b))[_0xc204('0x4e')](handleError(_0x564948,null));};exports[_0xc204('0x4f')]=function(_0xd08c11,_0x514f56){var _0x5d3b59={'raw':![],'where':{'id':_0xd08c11[_0xc204('0x50')]['id']}},_0xff18dc={};_0xff18dc[_0xc204('0x3e')]=_[_0xc204('0x3b')](db[_0xc204('0x36')][_0xc204('0x37')]);_0xff18dc[_0xc204('0x3a')]=_[_0xc204('0x3b')](_0xd08c11[_0xc204('0x3a')]);_0xff18dc[_0xc204('0x45')]=_[_0xc204('0x3c')](_0xff18dc[_0xc204('0x3e')],_0xff18dc[_0xc204('0x3a')]);_0x5d3b59['attributes']=_[_0xc204('0x3c')](_0xff18dc['model'],qs[_0xc204('0x3f')](_0xd08c11[_0xc204('0x3a')]['fields']));_0x5d3b59[_0xc204('0x3d')]=_0x5d3b59[_0xc204('0x3d')][_0xc204('0x40')]?_0x5d3b59[_0xc204('0x3d')]:_0xff18dc['model'];if(_0xd08c11[_0xc204('0x3a')]['includeAll']){_0x5d3b59[_0xc204('0x4c')]=[{'all':!![]}];}_0x5d3b59=_[_0xc204('0x48')]({},_0x5d3b59,_0xd08c11['options']);return db[_0xc204('0x36')][_0xc204('0x51')](_0x5d3b59)[_0xc204('0x2b')](handleEntityNotFound(_0x514f56,null))[_0xc204('0x2b')](respondWithResult(_0x514f56,null))['catch'](handleError(_0x514f56,null));};exports[_0xc204('0x52')]=function(_0x5e03fa,_0x4cdb9a){return db['Dashboard'][_0xc204('0x52')](_0x5e03fa[_0xc204('0x53')],{})['then'](function(_0x384e00){var _0x29f1cc=_0x5e03fa[_0xc204('0x54')][_0xc204('0x2d')]({'plain':!![]});if(!_0x29f1cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29f1cc[_0xc204('0x55')]===_0xc204('0x54')){var _0x2864d6=_0x384e00['get']({'plain':!![]});var _0x1bf614=_0xc204('0x2e');return db[_0xc204('0x56')][_0xc204('0x51')]({'where':{'name':_0x1bf614,'userProfileId':_0x29f1cc[_0xc204('0x57')]},'raw':!![]})[_0xc204('0x2b')](function(_0x213e8f){if(_0x213e8f&&_0x213e8f[_0xc204('0x58')]===0x0){return db[_0xc204('0x2f')][_0xc204('0x52')]({'name':_0x2864d6[_0xc204('0x33')],'resourceId':_0x2864d6['id'],'type':_0x213e8f[_0xc204('0x33')],'sectionId':_0x213e8f['id']},{})[_0xc204('0x2b')](function(){return _0x384e00;});}else{return _0x384e00;}})['catch'](function(_0x244afc){logger[_0xc204('0x31')](_0xc204('0x59'),_0x244afc);throw _0x244afc;});}return _0x384e00;})[_0xc204('0x2b')](respondWithResult(_0x4cdb9a,0xc9))['catch'](handleError(_0x4cdb9a,null));};exports[_0xc204('0x5a')]=function(_0x45242c,_0xf40bfb){var _0xdfc2ef={'where':{'id':_0x45242c[_0xc204('0x50')]['id']}},_0x1a6795={};_0x1a6795[_0xc204('0x3e')]=_[_0xc204('0x3b')](db[_0xc204('0x36')]['rawAttributes']);_0xdfc2ef['attributes']=_[_0xc204('0x3c')](_0x1a6795[_0xc204('0x3e')],qs[_0xc204('0x3f')](_0x45242c['query'][_0xc204('0x3f')]));_0xdfc2ef[_0xc204('0x3d')]=_0xdfc2ef['attributes'][_0xc204('0x40')]?_0xdfc2ef['attributes']:_0x1a6795['model'];if(_0x45242c['query']['includeAll']){_0xdfc2ef[_0xc204('0x4c')]=[{'all':!![]}];}_0xdfc2ef=_[_0xc204('0x48')]({},_0xdfc2ef,_0x45242c[_0xc204('0x4a')]);return db[_0xc204('0x36')][_0xc204('0x51')](_0xdfc2ef)[_0xc204('0x2b')](handleEntityNotFound(_0xf40bfb,null))[_0xc204('0x2b')](function(_0x1f3638){if(_0x1f3638){var _0xef6773=_0x1f3638['get']({'plain':!![]});_0xef6773=qs[_0xc204('0x5b')](_0xef6773,['id',_0xc204('0x5c'),_0xc204('0x5d')]);_0x45242c[_0xc204('0x53')]=_[_0xc204('0x5b')](_0x45242c[_0xc204('0x53')],['id',_0xc204('0x5c'),'updatedAt']);return db[_0xc204('0x36')][_0xc204('0x52')](_[_0xc204('0x48')](_0xef6773,_0x45242c['body']),{'include':_0x45242c[_0xc204('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0xc204('0x2b')](function(_0x4ccd3f){var _0x114ee3=_0x45242c[_0xc204('0x54')]['get']({'plain':!![]});if(!_0x114ee3)throw new Error(_0xc204('0x5e'));if(_0x114ee3[_0xc204('0x55')]===_0xc204('0x54')){var _0x29f241=_0x4ccd3f['get']({'plain':!![]});var _0x2c487e='CustomDashboards';return db[_0xc204('0x56')][_0xc204('0x51')]({'where':{'name':_0x2c487e,'userProfileId':_0x114ee3[_0xc204('0x57')]},'raw':!![]})[_0xc204('0x2b')](function(_0x5894ae){if(_0x5894ae&&_0x5894ae[_0xc204('0x58')]===0x0){return db[_0xc204('0x2f')]['create']({'name':_0x29f241['name'],'resourceId':_0x29f241['id'],'type':_0x5894ae[_0xc204('0x33')],'sectionId':_0x5894ae['id']},{})[_0xc204('0x2b')](function(){return _0x4ccd3f;});}else{return _0x4ccd3f;}})[_0xc204('0x4e')](function(_0x984816){logger[_0xc204('0x31')](_0xc204('0x59'),_0x984816);throw _0x984816;});}return _0x4ccd3f;});}})[_0xc204('0x2b')](respondWithResult(_0xf40bfb,0xc9))['catch'](handleError(_0xf40bfb,null));};exports[_0xc204('0x2a')]=function(_0x37ed30,_0x54f10a){if(_0x37ed30[_0xc204('0x53')]['id']){delete _0x37ed30[_0xc204('0x53')]['id'];}return db[_0xc204('0x36')][_0xc204('0x51')]({'where':{'id':_0x37ed30[_0xc204('0x50')]['id']}})['then'](handleEntityNotFound(_0x54f10a,null))[_0xc204('0x2b')](saveUpdates(_0x37ed30[_0xc204('0x53')],null))[_0xc204('0x2b')](respondWithResult(_0x54f10a,null))[_0xc204('0x4e')](handleError(_0x54f10a,null));};exports[_0xc204('0x2c')]=function(_0x36f5a0,_0x5e69ea){return db[_0xc204('0x36')][_0xc204('0x51')]({'where':{'id':_0x36f5a0['params']['id']}})[_0xc204('0x2b')](handleEntityNotFound(_0x5e69ea,null))[_0xc204('0x2b')](removeEntity(_0x5e69ea,null))[_0xc204('0x4e')](handleError(_0x5e69ea,null));};function widgetAttributes(_0x213915){try{switch(_0x213915['type']){case _0xc204('0x5f'):return[{'name':'attrUrl','value':_0x213915[_0xc204('0x60')]||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x0]?_0x213915['attrs'][0x0][_0xc204('0x62')]:undefined)||_0xc204('0x63')}];case'custom':return[{'name':_0xc204('0x64'),'value':_0x213915['attrPath']||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x62')]:undefined)||''}];case _0xc204('0x65'):return[{'name':_0xc204('0x66'),'value':_0x213915[_0xc204('0x66')]||(_0x213915[_0xc204('0x61')]&&_0x213915['attrs'][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x62')]:undefined)||_0xc204('0x67')},{'name':_0xc204('0x68'),'value':_0x213915[_0xc204('0x68')]||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x1]?_0x213915['attrs'][0x1][_0xc204('0x62')]:undefined)||_0xc204('0x69')},{'name':_0xc204('0x6a'),'value':_0x213915[_0xc204('0x6a')]||(_0x213915['attrs']&&_0x213915['attrs'][0x2]?_0x213915['attrs'][0x2]['value']:undefined)||0xc}];case _0xc204('0x6b'):return[{'name':_0xc204('0x6c'),'value':_0x213915[_0xc204('0x6c')]||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x62')]:undefined)||_0xc204('0x6d')},{'name':'attrVoiceQueues','value':_0x213915['attrVoiceQueues']||(_0x213915['attrs']&&_0x213915[_0xc204('0x61')][0x1]?_0x213915[_0xc204('0x61')][0x1][_0xc204('0x62')]:undefined)||[]},{'name':_0xc204('0x6a'),'value':_0x213915[_0xc204('0x6a')]||(_0x213915['attrs']&&_0x213915[_0xc204('0x61')][0x2]?_0x213915[_0xc204('0x61')][0x2][_0xc204('0x62')]:undefined)||0x14}];case'multibar-chart':case _0xc204('0x6e'):return[{'name':_0xc204('0x6f'),'value':_0x213915[_0xc204('0x6f')]||(_0x213915[_0xc204('0x61')]&&_0x213915['attrs'][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x62')]:undefined)||_0xc204('0x6d')},{'name':_0xc204('0x70'),'value':_0x213915[_0xc204('0x70')]||(_0x213915['attrs']&&_0x213915[_0xc204('0x61')][0x1]?_0x213915['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x213915[_0xc204('0x71')]||(_0x213915['attrs']&&_0x213915[_0xc204('0x61')][0x2]?_0x213915[_0xc204('0x61')][0x2][_0xc204('0x62')]:undefined)||null},{'name':_0xc204('0x72'),'value':_0x213915[_0xc204('0x72')]||(_0x213915['attrs']&&_0x213915[_0xc204('0x61')][0x3]?_0x213915[_0xc204('0x61')][0x3][_0xc204('0x62')]:undefined)||[]}];case _0xc204('0x73'):return[{'name':_0xc204('0x74'),'type':_0x213915[_0xc204('0x75')]||(_0x213915['attrs']&&_0x213915['attrs'][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x39')]:undefined)||null,'value':_0x213915[_0xc204('0x74')]||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x0]?_0x213915[_0xc204('0x61')][0x0][_0xc204('0x62')]:undefined)||null},{'name':_0xc204('0x76'),'value':_0x213915[_0xc204('0x76')]||(_0x213915[_0xc204('0x61')]&&_0x213915[_0xc204('0x61')][0x1]?_0x213915[_0xc204('0x61')][0x1][_0xc204('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x3dbef5){logger[_0xc204('0x31')](_0xc204('0x77'),JSON[_0xc204('0x78')](_0x3dbef5));return[];}}exports[_0xc204('0x79')]=function(_0xe86641,_0x575255,_0x2e0004){if(_0xe86641[_0xc204('0x53')]['id']){delete _0xe86641[_0xc204('0x53')]['id'];}return db[_0xc204('0x36')][_0xc204('0x51')]({'where':{'id':_0xe86641[_0xc204('0x50')]['id']}})[_0xc204('0x2b')](handleEntityNotFound(_0x575255,null))[_0xc204('0x2b')](function(_0x21b6ad){if(_0x21b6ad){_0xe86641[_0xc204('0x53')]['DashboardId']=_0x21b6ad['id'];_0xe86641[_0xc204('0x53')]['attrs']=widgetAttributes(_0xe86641[_0xc204('0x53')]);return db[_0xc204('0x7a')][_0xc204('0x52')](_0xe86641[_0xc204('0x53')]);}})[_0xc204('0x2b')](respondWithResult(_0x575255,null))[_0xc204('0x4e')](handleError(_0x575255,null));};exports[_0xc204('0x7b')]=function(_0x591364,_0x570e51,_0x71ee73){var _0xe242f8={};var _0x58c418={};var _0x14d96d;var _0x4ed601;return db[_0xc204('0x36')][_0xc204('0x7c')]({'where':{'id':_0x591364[_0xc204('0x50')]['id']}})[_0xc204('0x2b')](handleEntityNotFound(_0x570e51,null))['then'](function(_0xe41c09){if(_0xe41c09){_0x14d96d=_0xe41c09;_0x58c418[_0xc204('0x3e')]=_[_0xc204('0x3b')](db[_0xc204('0x7a')][_0xc204('0x37')]);_0x58c418[_0xc204('0x3a')]=_[_0xc204('0x3b')](_0x591364[_0xc204('0x3a')]);_0x58c418[_0xc204('0x45')]=_[_0xc204('0x3c')](_0x58c418[_0xc204('0x3e')],_0x58c418[_0xc204('0x3a')]);_0xe242f8[_0xc204('0x3d')]=_[_0xc204('0x3c')](_0x58c418[_0xc204('0x3e')],qs[_0xc204('0x3f')](_0x591364[_0xc204('0x3a')][_0xc204('0x3f')]));_0xe242f8[_0xc204('0x3d')]=_0xe242f8[_0xc204('0x3d')][_0xc204('0x40')]?_0xe242f8['attributes']:_0x58c418[_0xc204('0x3e')];_0xe242f8[_0xc204('0x43')]=qs['sort'](_0x591364[_0xc204('0x3a')]['sort']);_0xe242f8[_0xc204('0x49')]=qs['filters'](_['pick'](_0x591364[_0xc204('0x3a')],_0x58c418[_0xc204('0x45')]));if(_0x591364[_0xc204('0x3a')][_0xc204('0x47')]){_0xe242f8[_0xc204('0x49')]=_['merge'](_0xe242f8[_0xc204('0x49')],{'$or':_[_0xc204('0x35')](_0xe242f8[_0xc204('0x3d')],function(_0x4558ec){var _0x4e10d2={};_0x4e10d2[_0x4558ec]={'$like':'%'+_0x591364[_0xc204('0x3a')][_0xc204('0x47')]+'%'};return _0x4e10d2;})});}_0xe242f8=_['merge']({},_0xe242f8,_0x591364[_0xc204('0x4a')]);return _0x14d96d[_0xc204('0x7b')](_0xe242f8);}})[_0xc204('0x2b')](function(_0x30bcd8){if(_0x30bcd8){_0x4ed601=_0x30bcd8[_0xc204('0x40')];if(!_0x591364[_0xc204('0x3a')]['hasOwnProperty'](_0xc204('0x42'))){_0xe242f8[_0xc204('0x24')]=qs[_0xc204('0x24')](_0x591364[_0xc204('0x3a')]['limit']);_0xe242f8[_0xc204('0x21')]=qs[_0xc204('0x21')](_0x591364[_0xc204('0x3a')][_0xc204('0x21')]);}return _0x14d96d[_0xc204('0x7b')](_0xe242f8);}})['then'](function(_0x16ec0b){if(_0x16ec0b){return _0x16ec0b?{'count':_0x4ed601,'rows':_0x16ec0b}:null;}})[_0xc204('0x2b')](respondWithResult(_0x570e51,null))[_0xc204('0x4e')](handleError(_0x570e51,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b633975..14ad267 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 _0x2d4c=['emit','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','remove'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x2d4c,0x92));var _0xc2d4=function(_0xfdd18a,_0x40fcae){_0xfdd18a=_0xfdd18a-0x0;var _0x5c0391=_0x2d4c[_0xfdd18a];return _0x5c0391;};'use strict';var EventEmitter=require(_0xc2d4('0x0'));var Dashboard=require(_0xc2d4('0x1'))['db'][_0xc2d4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc2d4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc2d4('0x4'),'afterDestroy':_0xc2d4('0x5')};function emitEvent(_0x28b977){return function(_0x164020,_0x189848,_0x36c568){DashboardEvents[_0xc2d4('0x6')](_0x28b977+':'+_0x164020['id'],_0x164020);DashboardEvents[_0xc2d4('0x6')](_0x28b977,_0x164020);_0x36c568(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc2d4('0x7')]=DashboardEvents; \ No newline at end of file +var _0xc337=['events','Dashboard','save','update','emit','exports'];(function(_0x4927f2,_0x47e271){var _0x518633=function(_0x170fac){while(--_0x170fac){_0x4927f2['push'](_0x4927f2['shift']());}};_0x518633(++_0x47e271);}(_0xc337,0x150));var _0x7c33=function(_0x31fbfa,_0x54d524){_0x31fbfa=_0x31fbfa-0x0;var _0x57ea04=_0xc337[_0x31fbfa];return _0x57ea04;};'use strict';var EventEmitter=require(_0x7c33('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x7c33('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c33('0x2'),'afterUpdate':_0x7c33('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54fc52){return function(_0x348dcf,_0x1183af,_0xe636f){DashboardEvents[_0x7c33('0x4')](_0x54fc52+':'+_0x348dcf['id'],_0x348dcf);DashboardEvents[_0x7c33('0x4')](_0x54fc52,_0x348dcf);_0xe636f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x7c33('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index af02e45..7727675 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 _0x9aab=['exports','define','Dashboard','dashboards','lodash','../../config/logger','moment','bluebird','path','rimraf','./dashboard.attributes'];(function(_0x17be0b,_0x54178d){var _0xb26b1=function(_0x368339){while(--_0x368339){_0x17be0b['push'](_0x17be0b['shift']());}};_0xb26b1(++_0x54178d);}(_0x9aab,0x1c7));var _0xb9aa=function(_0x2cd923,_0x25055e){_0x2cd923=_0x2cd923-0x0;var _0x5234b7=_0x9aab[_0x2cd923];return _0x5234b7;};'use strict';var _=require(_0xb9aa('0x0'));var util=require('util');var logger=require(_0xb9aa('0x1'))('api');var moment=require(_0xb9aa('0x2'));var BPromise=require(_0xb9aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9aa('0x4'));var rimraf=require(_0xb9aa('0x5'));var config=require('../../config/environment');var attributes=require(_0xb9aa('0x6'));module[_0xb9aa('0x7')]=function(_0x29ba0e,_0x69b236){return _0x29ba0e[_0xb9aa('0x8')](_0xb9aa('0x9'),attributes,{'tableName':_0xb9aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e47=['path','rimraf','./dashboard.attributes','define','Dashboard','lodash','util','api','moment','bluebird'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x6e47,0xb9));var _0x76e4=function(_0x548c07,_0x5904d5){_0x548c07=_0x548c07-0x0;var _0x169c08=_0x6e47[_0x548c07];return _0x169c08;};'use strict';var _=require(_0x76e4('0x0'));var util=require(_0x76e4('0x1'));var logger=require('../../config/logger')(_0x76e4('0x2'));var moment=require(_0x76e4('0x3'));var BPromise=require(_0x76e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e4('0x5'));var rimraf=require(_0x76e4('0x6'));var config=require('../../config/environment');var attributes=require(_0x76e4('0x7'));module['exports']=function(_0xd53aed,_0x468c0a){return _0xd53aed[_0x76e4('0x8')](_0x76e4('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 47af3cd..5624168 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 _0x661c=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x21da0f,_0x34a74e){var _0x2fd6c5=function(_0x5a5a5c){while(--_0x5a5a5c){_0x21da0f['push'](_0x21da0f['shift']());}};_0x2fd6c5(++_0x34a74e);}(_0x661c,0x122));var _0xc661=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x661c[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xc661('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc661('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc661('0x2'));var db=require(_0xc661('0x3'))['db'];var utils=require(_0xc661('0x4'));var logger=require(_0xc661('0x5'))(_0xc661('0x6'));var config=require(_0xc661('0x7'));var jayson=require(_0xc661('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xc661('0x9')]=_['defaults'](config[_0xc661('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc661('0xa'))(new Redis(config['redis']));require(_0xc661('0xb'))[_0xc661('0xc')](socket);function respondWithRpcPromise(_0x126428,_0x32cbeb,_0x45ce36){return new BPromise(function(_0xee23b2,_0x56bd30){return client[_0xc661('0xd')](_0x126428,_0x45ce36)['then'](function(_0x19aa3f){logger[_0xc661('0xe')](_0xc661('0xf'),_0x32cbeb,_0xc661('0x10'));logger['debug'](_0xc661('0x11'),_0x32cbeb,_0xc661('0x10'),JSON[_0xc661('0x12')](_0x19aa3f));if(_0x19aa3f[_0xc661('0x13')]){if(_0x19aa3f['error'][_0xc661('0x14')]===0x1f4){logger[_0xc661('0x13')]('Dashboard,\x20%s,\x20%s',_0x32cbeb,_0x19aa3f[_0xc661('0x13')]['message']);return _0x56bd30(_0x19aa3f['error'][_0xc661('0x15')]);}logger[_0xc661('0x13')]('Dashboard,\x20%s,\x20%s',_0x32cbeb,_0x19aa3f['error'][_0xc661('0x15')]);return _0xee23b2(_0x19aa3f['error']['message']);}else{logger[_0xc661('0xe')]('Dashboard,\x20%s,\x20%s',_0x32cbeb,_0xc661('0x10'));_0xee23b2(_0x19aa3f[_0xc661('0x16')][_0xc661('0x15')]);}})[_0xc661('0x17')](function(_0x2da016){logger[_0xc661('0x13')]('Dashboard,\x20%s,\x20%s',_0x32cbeb,_0x2da016);_0x56bd30(_0x2da016);});});} \ No newline at end of file +var _0x5e60=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment'];(function(_0x51b804,_0xec7a75){var _0x52a818=function(_0x47910f){while(--_0x47910f){_0x51b804['push'](_0x51b804['shift']());}};_0x52a818(++_0xec7a75);}(_0x5e60,0x184));var _0x05e6=function(_0x187be0,_0x23f74c){_0x187be0=_0x187be0-0x0;var _0x371e59=_0x5e60[_0x187be0];return _0x371e59;};'use strict';var _=require(_0x05e6('0x0'));var util=require('util');var moment=require(_0x05e6('0x1'));var BPromise=require(_0x05e6('0x2'));var rs=require(_0x05e6('0x3'));var fs=require('fs');var Redis=require(_0x05e6('0x4'));var db=require(_0x05e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x05e6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x05e6('0x7'));var client=jayson[_0x05e6('0x8')][_0x05e6('0x9')]({'port':0x232a});config[_0x05e6('0xa')]=_[_0x05e6('0xb')](config[_0x05e6('0xa')],{'host':_0x05e6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05e6('0xa')]));require(_0x05e6('0xd'))[_0x05e6('0xe')](socket);function respondWithRpcPromise(_0x43c91d,_0x1cad33,_0x58ed95){return new BPromise(function(_0x2e12dd,_0x24531a){return client[_0x05e6('0xf')](_0x43c91d,_0x58ed95)[_0x05e6('0x10')](function(_0x430e87){logger[_0x05e6('0x11')](_0x05e6('0x12'),_0x1cad33,_0x05e6('0x13'));logger[_0x05e6('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x1cad33,_0x05e6('0x13'),JSON[_0x05e6('0x15')](_0x430e87));if(_0x430e87[_0x05e6('0x16')]){if(_0x430e87[_0x05e6('0x16')][_0x05e6('0x17')]===0x1f4){logger[_0x05e6('0x16')](_0x05e6('0x12'),_0x1cad33,_0x430e87[_0x05e6('0x16')]['message']);return _0x24531a(_0x430e87[_0x05e6('0x16')][_0x05e6('0x18')]);}logger[_0x05e6('0x16')](_0x05e6('0x12'),_0x1cad33,_0x430e87[_0x05e6('0x16')][_0x05e6('0x18')]);return _0x2e12dd(_0x430e87['error']['message']);}else{logger[_0x05e6('0x11')](_0x05e6('0x12'),_0x1cad33,'request\x20sent');_0x2e12dd(_0x430e87[_0x05e6('0x19')][_0x05e6('0x18')]);}})['catch'](function(_0x30d20d){logger[_0x05e6('0x16')](_0x05e6('0x12'),_0x1cad33,_0x30d20d);_0x24531a(_0x30d20d);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6a5a865..6ab0892 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 _0x8e70=['./dashboard.events','save','remove','update','emit','register','length','dashboard:'];(function(_0x5b3b1e,_0x1ae26c){var _0x51399d=function(_0xeb7a36){while(--_0xeb7a36){_0x5b3b1e['push'](_0x5b3b1e['shift']());}};_0x51399d(++_0x1ae26c);}(_0x8e70,0xa0));var _0x08e7=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8e70[_0x7e2eb0];return _0xd92de4;};'use strict';var DashboardEvents=require(_0x08e7('0x0'));var events=[_0x08e7('0x1'),_0x08e7('0x2'),_0x08e7('0x3')];function createListener(_0x36031a,_0x5be33b){return function(_0x1a4674){_0x5be33b[_0x08e7('0x4')](_0x36031a,_0x1a4674);};}function removeListener(_0x1f4614,_0x541be7){return function(){DashboardEvents['removeListener'](_0x1f4614,_0x541be7);};}exports[_0x08e7('0x5')]=function(_0x1add2d){for(var _0x29a030=0x0,_0xd74f0e=events[_0x08e7('0x6')];_0x29a030<_0xd74f0e;_0x29a030++){var _0x5c765d=events[_0x29a030];var _0x52e8fe=createListener(_0x08e7('0x7')+_0x5c765d,_0x1add2d);DashboardEvents['on'](_0x5c765d,_0x52e8fe);}}; \ No newline at end of file +var _0xa33b=['remove','update','emit','register','length','dashboard:','./dashboard.events'];(function(_0x1518ce,_0x5ab048){var _0x112df2=function(_0x579c20){while(--_0x579c20){_0x1518ce['push'](_0x1518ce['shift']());}};_0x112df2(++_0x5ab048);}(_0xa33b,0x19c));var _0xba33=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa33b[_0x2641f9];return _0x585741;};'use strict';var DashboardEvents=require(_0xba33('0x0'));var events=['save',_0xba33('0x1'),_0xba33('0x2')];function createListener(_0xcb4a30,_0x3756dd){return function(_0x46882e){_0x3756dd[_0xba33('0x3')](_0xcb4a30,_0x46882e);};}function removeListener(_0x574e85,_0x2283cb){return function(){DashboardEvents['removeListener'](_0x574e85,_0x2283cb);};}exports[_0xba33('0x4')]=function(_0x41df5c){for(var _0x487e4d=0x0,_0x5ddfa8=events[_0xba33('0x5')];_0x487e4d<_0x5ddfa8;_0x487e4d++){var _0x46e0ef=events[_0x487e4d];var _0x52050c=createListener(_0xba33('0x6')+_0x46e0ef,_0x41df5c);DashboardEvents['on'](_0x46e0ef,_0x52050c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e291b14..49ee12b 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 _0x024d=['getItems','post','clone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items'];(function(_0x186d2a,_0x50faa7){var _0x549015=function(_0x34ec94){while(--_0x34ec94){_0x186d2a['push'](_0x186d2a['shift']());}};_0x549015(++_0x50faa7);}(_0x024d,0xd6));var _0xd024=function(_0x3d5cbe,_0x170be1){_0x3d5cbe=_0x3d5cbe-0x0;var _0x27c791=_0x024d[_0x3d5cbe];return _0x27c791;};'use strict';var multer=require(_0xd024('0x0'));var util=require(_0xd024('0x1'));var path=require(_0xd024('0x2'));var timeout=require(_0xd024('0x3'));var express=require(_0xd024('0x4'));var router=express[_0xd024('0x5')]();var fs_extra=require(_0xd024('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd024('0x7'));var config=require(_0xd024('0x8'));var controller=require(_0xd024('0x9'));router[_0xd024('0xa')]('/',auth[_0xd024('0xb')](),controller[_0xd024('0xc')]);router[_0xd024('0xa')](_0xd024('0xd'),auth[_0xd024('0xb')](),controller[_0xd024('0xe')]);router[_0xd024('0xa')](_0xd024('0xf'),auth[_0xd024('0xb')](),controller[_0xd024('0x10')]);router[_0xd024('0x11')]('/',auth[_0xd024('0xb')](),controller['create']);router[_0xd024('0x11')]('/:id/clone',auth[_0xd024('0xb')](),controller[_0xd024('0x12')]);router[_0xd024('0x11')](_0xd024('0xf'),auth[_0xd024('0xb')](),controller['addItem']);router[_0xd024('0x13')](_0xd024('0xd'),auth[_0xd024('0xb')](),controller['update']);router[_0xd024('0x14')](_0xd024('0xd'),auth[_0xd024('0xb')](),controller[_0xd024('0x15')]);module[_0xd024('0x16')]=router; \ No newline at end of file +var _0x8943=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','destroy','multer'];(function(_0x5c950d,_0x4fefd6){var _0x4eec77=function(_0x32cf9a){while(--_0x32cf9a){_0x5c950d['push'](_0x5c950d['shift']());}};_0x4eec77(++_0x4fefd6);}(_0x8943,0xe6));var _0x3894=function(_0x11f2e4,_0x2a8c65){_0x11f2e4=_0x11f2e4-0x0;var _0x2688c7=_0x8943[_0x11f2e4];return _0x2688c7;};'use strict';var multer=require(_0x3894('0x0'));var util=require(_0x3894('0x1'));var path=require(_0x3894('0x2'));var timeout=require(_0x3894('0x3'));var express=require(_0x3894('0x4'));var router=express[_0x3894('0x5')]();var fs_extra=require(_0x3894('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3894('0x7'));var config=require(_0x3894('0x8'));var controller=require(_0x3894('0x9'));router[_0x3894('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3894('0xa')](_0x3894('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3894('0xa')](_0x3894('0xc'),auth[_0x3894('0xd')](),controller[_0x3894('0xe')]);router['post']('/',auth[_0x3894('0xd')](),controller['create']);router[_0x3894('0xf')](_0x3894('0x10'),auth['isAuthenticated'](),controller[_0x3894('0x11')]);router[_0x3894('0xf')](_0x3894('0xc'),auth['isAuthenticated'](),controller[_0x3894('0x12')]);router[_0x3894('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3894('0xb'),auth[_0x3894('0xd')](),controller[_0x3894('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0944db9..683a2c5 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 _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x5d39b8,_0x281b5f){var _0x4a7d88=function(_0x3a03b4){while(--_0x3a03b4){_0x5d39b8['push'](_0x5d39b8['shift']());}};_0x4a7d88(++_0x281b5f);}(_0x814b,0x1a2));var _0xb814=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0x814b[_0x474c66];return _0xcbd9bf;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x3a09dc,_0x1deea5){var _0x3983a5=function(_0x1be042){while(--_0x1be042){_0x3a09dc['push'](_0x3a09dc['shift']());}};_0x3983a5(++_0x1deea5);}(_0x5fab,0x177));var _0xb5fa=function(_0x5b3c61,_0x3eb2aa){_0x5b3c61=_0x5b3c61-0x0;var _0x153389=_0x5fab[_0x5b3c61];return _0x153389;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index a89a3ca..920e785 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 _0x23fd=['multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x23fd,0x16d));var _0xd23f=function(_0x37239d,_0x5a63a9){_0x37239d=_0x37239d-0x0;var _0x3a3ce3=_0x23fd[_0x37239d];return _0x3a3ce3;};'use strict';var emlformat=require(_0xd23f('0x0'));var rimraf=require(_0xd23f('0x1'));var zipdir=require(_0xd23f('0x2'));var jsonpatch=require(_0xd23f('0x3'));var rp=require(_0xd23f('0x4'));var moment=require(_0xd23f('0x5'));var BPromise=require(_0xd23f('0x6'));var Mustache=require(_0xd23f('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd23f('0x8'));var csv=require(_0xd23f('0x9'));var ejs=require(_0xd23f('0xa'));var fs=require('fs');var fs_extra=require(_0xd23f('0xb'));var _=require(_0xd23f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd23f('0xd'));var deskjs=require(_0xd23f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd23f('0xf'));var authService=require(_0xd23f('0x10'));var qs=require(_0xd23f('0x11'));var as=require(_0xd23f('0x12'));var hardwareService=require(_0xd23f('0x13'));var logger=require(_0xd23f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd23f('0x15'));var licenseUtil=require(_0xd23f('0x16'));var db=require(_0xd23f('0x17'))['db'];config[_0xd23f('0x18')]=_[_0xd23f('0x19')](config[_0xd23f('0x18')],{'host':_0xd23f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd23f('0x1b'))[_0xd23f('0x1c')](socket);function respondWithStatusCode(_0x2d45c1,_0x3bb648){_0x3bb648=_0x3bb648||0xcc;return function(_0x5432e5){if(_0x5432e5){return _0x2d45c1[_0xd23f('0x1d')](_0x3bb648);}return _0x2d45c1[_0xd23f('0x1e')](_0x3bb648)[_0xd23f('0x1f')]();};}function respondWithResult(_0x1f513c,_0x10459d){_0x10459d=_0x10459d||0xc8;return function(_0x209df0){if(_0x209df0){return _0x1f513c['status'](_0x10459d)[_0xd23f('0x20')](_0x209df0);}};}function respondWithFilteredResult(_0x310219,_0x2a42a1){return function(_0x1aba09){if(_0x1aba09){var _0x3cd9d4=typeof _0x2a42a1[_0xd23f('0x21')]===_0xd23f('0x22')&&typeof _0x2a42a1[_0xd23f('0x23')]===_0xd23f('0x22');var _0x37bece=_0x1aba09[_0xd23f('0x24')];var _0x58bffa=_0x3cd9d4?0x0:_0x2a42a1[_0xd23f('0x21')];var _0x4a0c4d=_0x3cd9d4?_0x1aba09[_0xd23f('0x24')]:_0x2a42a1[_0xd23f('0x21')]+_0x2a42a1[_0xd23f('0x23')];var _0x5c9798;if(_0x4a0c4d>=_0x37bece){_0x4a0c4d=_0x37bece;_0x5c9798=0xc8;}else{_0x5c9798=0xce;}_0x310219[_0xd23f('0x1e')](_0x5c9798);return _0x310219[_0xd23f('0x25')](_0xd23f('0x26'),_0x58bffa+'-'+_0x4a0c4d+'/'+_0x37bece)['json'](_0x1aba09);}return null;};}function patchUpdates(_0x522bca){return function(_0x4401fa){try{jsonpatch['apply'](_0x4401fa,_0x522bca,!![]);}catch(_0x4d5244){return BPromise[_0xd23f('0x27')](_0x4d5244);}return _0x4401fa['save']();};}function saveUpdates(_0x1c454a,_0x231850){return function(_0x270c11){if(_0x270c11){return _0x270c11['update'](_0x1c454a)[_0xd23f('0x28')](function(_0x3585bc){return _0x3585bc;});}return null;};}function removeEntity(_0x1f442f,_0x268703){return function(_0x358d6f){if(_0x358d6f){return _0x358d6f['destroy']()[_0xd23f('0x28')](function(){_0x1f442f['status'](0xcc)[_0xd23f('0x1f')]();});}};}function handleEntityNotFound(_0x1cb1ee,_0xce9d36){return function(_0x4dfad2){if(!_0x4dfad2){_0x1cb1ee[_0xd23f('0x1d')](0x194);}return _0x4dfad2;};}function handleError(_0x461ea1,_0x2b20aa){_0x2b20aa=_0x2b20aa||0x1f4;return function(_0x26703f){logger[_0xd23f('0x29')](_0x26703f[_0xd23f('0x2a')]);if(_0x26703f[_0xd23f('0x2b')]){delete _0x26703f[_0xd23f('0x2b')];}_0x461ea1[_0xd23f('0x1e')](_0x2b20aa)['send'](_0x26703f);};}exports[_0xd23f('0x2c')]=function(_0x16978d,_0x54a216){var _0x4c0f05={'raw':![],'where':{'id':_0x16978d[_0xd23f('0x2d')]['id']}},_0x5569f9={};_0x5569f9[_0xd23f('0x2e')]=_[_0xd23f('0x2f')](db[_0xd23f('0x30')][_0xd23f('0x31')]);_0x5569f9['query']=_['keys'](_0x16978d[_0xd23f('0x32')]);_0x5569f9[_0xd23f('0x33')]=_[_0xd23f('0x34')](_0x5569f9['model'],_0x5569f9[_0xd23f('0x32')]);_0x4c0f05['attributes']=_[_0xd23f('0x34')](_0x5569f9[_0xd23f('0x2e')],qs['fields'](_0x16978d[_0xd23f('0x32')][_0xd23f('0x35')]));_0x4c0f05['attributes']=_0x4c0f05[_0xd23f('0x36')][_0xd23f('0x37')]?_0x4c0f05[_0xd23f('0x36')]:_0x5569f9[_0xd23f('0x2e')];if(_0x16978d['query'][_0xd23f('0x38')]){_0x4c0f05[_0xd23f('0x39')]=[{'all':!![]}];}_0x4c0f05=_[_0xd23f('0x3a')]({},_0x4c0f05,_0x16978d['options']);return db[_0xd23f('0x30')][_0xd23f('0x3b')](_0x4c0f05)[_0xd23f('0x28')](handleEntityNotFound(_0x54a216,null))[_0xd23f('0x28')](respondWithResult(_0x54a216,null))[_0xd23f('0x3c')](handleError(_0x54a216,null));};exports['destroy']=function(_0x3821ef,_0x328da1){return db[_0xd23f('0x30')][_0xd23f('0x3b')]({'where':{'id':_0x3821ef[_0xd23f('0x2d')]['id']}})[_0xd23f('0x28')](handleEntityNotFound(_0x328da1,null))['then'](removeEntity(_0x328da1,null))['catch'](handleError(_0x328da1,null));};function widgetAttributes(_0x203eef){try{switch(_0x203eef[_0xd23f('0x3d')]){case'iframe':return[{'name':'attrUrl','value':_0x203eef[_0xd23f('0x3e')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef['attrs'][0x0]?_0x203eef['attrs'][0x0][_0xd23f('0x40')]:undefined)||'https://'}];case _0xd23f('0x41'):return[{'name':_0xd23f('0x42'),'value':_0x203eef[_0xd23f('0x42')]||(_0x203eef['attrs']&&_0x203eef['attrs'][0x0]?_0x203eef['attrs'][0x0]['value']:undefined)||''}];case _0xd23f('0x43'):return[{'name':_0xd23f('0x44'),'value':_0x203eef[_0xd23f('0x44')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x0]?_0x203eef[_0xd23f('0x3f')][0x0][_0xd23f('0x40')]:undefined)||_0xd23f('0x45')},{'name':_0xd23f('0x46'),'value':_0x203eef[_0xd23f('0x46')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x1]?_0x203eef['attrs'][0x1][_0xd23f('0x40')]:undefined)||_0xd23f('0x47')},{'name':_0xd23f('0x48'),'value':_0x203eef['attrFontSize']||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef['attrs'][0x2]?_0x203eef['attrs'][0x2][_0xd23f('0x40')]:undefined)||0xc}];case'counter':return[{'name':_0xd23f('0x49'),'value':_0x203eef['attrMetric']||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x0]?_0x203eef[_0xd23f('0x3f')][0x0]['value']:undefined)||'total'},{'name':_0xd23f('0x4a'),'value':_0x203eef[_0xd23f('0x4a')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x1]?_0x203eef['attrs'][0x1][_0xd23f('0x40')]:undefined)||[]},{'name':'attrFontSize','value':_0x203eef['attrFontSize']||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x2]?_0x203eef[_0xd23f('0x3f')][0x2][_0xd23f('0x40')]:undefined)||0x14}];case _0xd23f('0x4b'):case _0xd23f('0x4c'):return[{'name':_0xd23f('0x4d'),'value':_0x203eef['attrSerie1']||(_0x203eef['attrs']&&_0x203eef[_0xd23f('0x3f')][0x0]?_0x203eef[_0xd23f('0x3f')][0x0]['value']:undefined)||_0xd23f('0x4e')},{'name':_0xd23f('0x4f'),'value':_0x203eef[_0xd23f('0x4f')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x1]?_0x203eef[_0xd23f('0x3f')][0x1][_0xd23f('0x40')]:undefined)||null},{'name':_0xd23f('0x50'),'value':_0x203eef[_0xd23f('0x50')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x2]?_0x203eef[_0xd23f('0x3f')][0x2][_0xd23f('0x40')]:undefined)||null},{'name':_0xd23f('0x4a'),'value':_0x203eef[_0xd23f('0x4a')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x3]?_0x203eef[_0xd23f('0x3f')][0x3][_0xd23f('0x40')]:undefined)||[]}];case _0xd23f('0x51'):return[{'name':_0xd23f('0x52'),'type':_0x203eef[_0xd23f('0x53')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x0]?_0x203eef['attrs'][0x0][_0xd23f('0x3d')]:undefined)||null,'value':_0x203eef['attrReport']||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x0]?_0x203eef[_0xd23f('0x3f')][0x0][_0xd23f('0x40')]:undefined)||null},{'name':_0xd23f('0x54'),'value':_0x203eef[_0xd23f('0x54')]||(_0x203eef[_0xd23f('0x3f')]&&_0x203eef[_0xd23f('0x3f')][0x1]?_0x203eef['attrs'][0x1][_0xd23f('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x392332){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x392332));return[];}}exports[_0xd23f('0x55')]=function(_0x4ea4e0,_0x42acb1){if(_0x4ea4e0[_0xd23f('0x56')]){_0x4ea4e0[_0xd23f('0x56')]['attrs']=widgetAttributes(_0x4ea4e0[_0xd23f('0x56')]);}return db[_0xd23f('0x30')][_0xd23f('0x55')](_0x4ea4e0[_0xd23f('0x56')],{})['then'](respondWithResult(_0x42acb1,0xc9))['catch'](handleError(_0x42acb1,null));};exports[_0xd23f('0x57')]=function(_0xc2991e,_0x51e636){if(_0xc2991e['body']['id']){delete _0xc2991e['body']['id'];}_0xc2991e[_0xd23f('0x56')][_0xd23f('0x3f')]=widgetAttributes(_0xc2991e[_0xd23f('0x56')]);return db[_0xd23f('0x30')][_0xd23f('0x3b')]({'where':{'id':_0xc2991e['params']['id']}})[_0xd23f('0x28')](handleEntityNotFound(_0x51e636,null))[_0xd23f('0x28')](saveUpdates(_0xc2991e[_0xd23f('0x56')],null))[_0xd23f('0x28')](respondWithResult(_0x51e636,null))['catch'](handleError(_0x51e636,null));}; \ No newline at end of file +var _0x20f2=['offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','includeAll','options','DashboardItem','catch','find','type','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x20f2,0x1b0));var _0x220f=function(_0x2db8e8,_0x52be61){_0x2db8e8=_0x2db8e8-0x0;var _0x504515=_0x20f2[_0x2db8e8];return _0x504515;};'use strict';var emlformat=require(_0x220f('0x0'));var rimraf=require(_0x220f('0x1'));var zipdir=require(_0x220f('0x2'));var jsonpatch=require(_0x220f('0x3'));var rp=require(_0x220f('0x4'));var moment=require('moment');var BPromise=require(_0x220f('0x5'));var Mustache=require(_0x220f('0x6'));var util=require(_0x220f('0x7'));var path=require(_0x220f('0x8'));var sox=require(_0x220f('0x9'));var csv=require(_0x220f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x220f('0xb'));var _=require('lodash');var squel=require(_0x220f('0xc'));var crypto=require(_0x220f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x220f('0xe'));var toCsv=require(_0x220f('0xa'));var querystring=require(_0x220f('0xf'));var Papa=require(_0x220f('0x10'));var Redis=require(_0x220f('0x11'));var authService=require(_0x220f('0x12'));var qs=require(_0x220f('0x13'));var as=require(_0x220f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x220f('0x15'))(_0x220f('0x16'));var utils=require(_0x220f('0x17'));var config=require(_0x220f('0x18'));var licenseUtil=require(_0x220f('0x19'));var db=require(_0x220f('0x1a'))['db'];config[_0x220f('0x1b')]=_[_0x220f('0x1c')](config[_0x220f('0x1b')],{'host':_0x220f('0x1d'),'port':0x18eb});var socket=require(_0x220f('0x1e'))(new Redis(config[_0x220f('0x1b')]));require(_0x220f('0x1f'))[_0x220f('0x20')](socket);function respondWithStatusCode(_0x1cdb70,_0xd8415f){_0xd8415f=_0xd8415f||0xcc;return function(_0x38f77c){if(_0x38f77c){return _0x1cdb70[_0x220f('0x21')](_0xd8415f);}return _0x1cdb70[_0x220f('0x22')](_0xd8415f)[_0x220f('0x23')]();};}function respondWithResult(_0x2157a5,_0x57352a){_0x57352a=_0x57352a||0xc8;return function(_0x1c6a51){if(_0x1c6a51){return _0x2157a5['status'](_0x57352a)[_0x220f('0x24')](_0x1c6a51);}};}function respondWithFilteredResult(_0x138443,_0x4486fc){return function(_0x5d3bad){if(_0x5d3bad){var _0x4256aa=typeof _0x4486fc['offset']===_0x220f('0x25')&&typeof _0x4486fc['limit']===_0x220f('0x25');var _0x147df7=_0x5d3bad['count'];var _0x10c056=_0x4256aa?0x0:_0x4486fc[_0x220f('0x26')];var _0x3d0f4f=_0x4256aa?_0x5d3bad[_0x220f('0x27')]:_0x4486fc['offset']+_0x4486fc['limit'];var _0x5c2f61;if(_0x3d0f4f>=_0x147df7){_0x3d0f4f=_0x147df7;_0x5c2f61=0xc8;}else{_0x5c2f61=0xce;}_0x138443[_0x220f('0x22')](_0x5c2f61);return _0x138443[_0x220f('0x28')](_0x220f('0x29'),_0x10c056+'-'+_0x3d0f4f+'/'+_0x147df7)[_0x220f('0x24')](_0x5d3bad);}return null;};}function patchUpdates(_0x22715f){return function(_0x56ed56){try{jsonpatch[_0x220f('0x2a')](_0x56ed56,_0x22715f,!![]);}catch(_0x282d7e){return BPromise[_0x220f('0x2b')](_0x282d7e);}return _0x56ed56[_0x220f('0x2c')]();};}function saveUpdates(_0x13fef4,_0x223978){return function(_0x485921){if(_0x485921){return _0x485921[_0x220f('0x2d')](_0x13fef4)[_0x220f('0x2e')](function(_0x5cd941){return _0x5cd941;});}return null;};}function removeEntity(_0x1d8c84,_0x45160c){return function(_0x98b3f9){if(_0x98b3f9){return _0x98b3f9[_0x220f('0x2f')]()[_0x220f('0x2e')](function(){_0x1d8c84['status'](0xcc)[_0x220f('0x23')]();});}};}function handleEntityNotFound(_0x3b9480,_0x38cec2){return function(_0x23d9ee){if(!_0x23d9ee){_0x3b9480['sendStatus'](0x194);}return _0x23d9ee;};}function handleError(_0x270c5f,_0x8e5af4){_0x8e5af4=_0x8e5af4||0x1f4;return function(_0x31842a){logger[_0x220f('0x30')](_0x31842a[_0x220f('0x31')]);if(_0x31842a['name']){delete _0x31842a[_0x220f('0x32')];}_0x270c5f[_0x220f('0x22')](_0x8e5af4)[_0x220f('0x33')](_0x31842a);};}exports[_0x220f('0x34')]=function(_0x44b4fa,_0x40362f){var _0xad170f={'raw':![],'where':{'id':_0x44b4fa[_0x220f('0x35')]['id']}},_0x387263={};_0x387263[_0x220f('0x36')]=_[_0x220f('0x37')](db['DashboardItem'][_0x220f('0x38')]);_0x387263[_0x220f('0x39')]=_['keys'](_0x44b4fa['query']);_0x387263['filters']=_[_0x220f('0x3a')](_0x387263[_0x220f('0x36')],_0x387263[_0x220f('0x39')]);_0xad170f[_0x220f('0x3b')]=_[_0x220f('0x3a')](_0x387263[_0x220f('0x36')],qs[_0x220f('0x3c')](_0x44b4fa[_0x220f('0x39')]['fields']));_0xad170f[_0x220f('0x3b')]=_0xad170f[_0x220f('0x3b')]['length']?_0xad170f[_0x220f('0x3b')]:_0x387263['model'];if(_0x44b4fa['query'][_0x220f('0x3d')]){_0xad170f['include']=[{'all':!![]}];}_0xad170f=_['merge']({},_0xad170f,_0x44b4fa[_0x220f('0x3e')]);return db[_0x220f('0x3f')]['find'](_0xad170f)['then'](handleEntityNotFound(_0x40362f,null))[_0x220f('0x2e')](respondWithResult(_0x40362f,null))[_0x220f('0x40')](handleError(_0x40362f,null));};exports[_0x220f('0x2f')]=function(_0x3ca046,_0x47d0d1){return db[_0x220f('0x3f')][_0x220f('0x41')]({'where':{'id':_0x3ca046[_0x220f('0x35')]['id']}})[_0x220f('0x2e')](handleEntityNotFound(_0x47d0d1,null))[_0x220f('0x2e')](removeEntity(_0x47d0d1,null))[_0x220f('0x40')](handleError(_0x47d0d1,null));};function widgetAttributes(_0xbd065d){try{switch(_0xbd065d[_0x220f('0x42')]){case'iframe':return[{'name':_0x220f('0x43'),'value':_0xbd065d[_0x220f('0x43')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d['attrs'][0x0]?_0xbd065d[_0x220f('0x44')][0x0][_0x220f('0x45')]:undefined)||_0x220f('0x46')}];case _0x220f('0x47'):return[{'name':_0x220f('0x48'),'value':_0xbd065d[_0x220f('0x48')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d['attrs'][0x0]?_0xbd065d[_0x220f('0x44')][0x0][_0x220f('0x45')]:undefined)||''}];case'clock':return[{'name':_0x220f('0x49'),'value':_0xbd065d['attrHourFormat']||(_0xbd065d['attrs']&&_0xbd065d['attrs'][0x0]?_0xbd065d[_0x220f('0x44')][0x0][_0x220f('0x45')]:undefined)||_0x220f('0x4a')},{'name':'attrTimezone','value':_0xbd065d[_0x220f('0x4b')]||(_0xbd065d['attrs']&&_0xbd065d[_0x220f('0x44')][0x1]?_0xbd065d['attrs'][0x1][_0x220f('0x45')]:undefined)||_0x220f('0x4c')},{'name':'attrFontSize','value':_0xbd065d[_0x220f('0x4d')]||(_0xbd065d['attrs']&&_0xbd065d['attrs'][0x2]?_0xbd065d[_0x220f('0x44')][0x2]['value']:undefined)||0xc}];case _0x220f('0x4e'):return[{'name':'attrMetric','value':_0xbd065d[_0x220f('0x4f')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x0]?_0xbd065d[_0x220f('0x44')][0x0]['value']:undefined)||_0x220f('0x50')},{'name':'attrVoiceQueues','value':_0xbd065d[_0x220f('0x51')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x1]?_0xbd065d[_0x220f('0x44')][0x1][_0x220f('0x45')]:undefined)||[]},{'name':_0x220f('0x4d'),'value':_0xbd065d[_0x220f('0x4d')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x2]?_0xbd065d[_0x220f('0x44')][0x2][_0x220f('0x45')]:undefined)||0x14}];case _0x220f('0x52'):case _0x220f('0x53'):return[{'name':_0x220f('0x54'),'value':_0xbd065d['attrSerie1']||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x0]?_0xbd065d[_0x220f('0x44')][0x0]['value']:undefined)||_0x220f('0x50')},{'name':_0x220f('0x55'),'value':_0xbd065d[_0x220f('0x55')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x1]?_0xbd065d[_0x220f('0x44')][0x1]['value']:undefined)||null},{'name':_0x220f('0x56'),'value':_0xbd065d[_0x220f('0x56')]||(_0xbd065d['attrs']&&_0xbd065d[_0x220f('0x44')][0x2]?_0xbd065d['attrs'][0x2][_0x220f('0x45')]:undefined)||null},{'name':_0x220f('0x51'),'value':_0xbd065d[_0x220f('0x51')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d['attrs'][0x3]?_0xbd065d[_0x220f('0x44')][0x3][_0x220f('0x45')]:undefined)||[]}];case _0x220f('0x57'):return[{'name':_0x220f('0x58'),'type':_0xbd065d[_0x220f('0x59')]||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d['attrs'][0x0]?_0xbd065d[_0x220f('0x44')][0x0][_0x220f('0x42')]:undefined)||null,'value':_0xbd065d['attrReport']||(_0xbd065d[_0x220f('0x44')]&&_0xbd065d[_0x220f('0x44')][0x0]?_0xbd065d['attrs'][0x0]['value']:undefined)||null},{'name':_0x220f('0x5a'),'value':_0xbd065d[_0x220f('0x5a')]||(_0xbd065d['attrs']&&_0xbd065d[_0x220f('0x44')][0x1]?_0xbd065d[_0x220f('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x275b5d){logger[_0x220f('0x30')]('widgetAttributes:\x20%s',JSON[_0x220f('0x5b')](_0x275b5d));return[];}}exports[_0x220f('0x5c')]=function(_0x565fe6,_0x32a0b4){if(_0x565fe6[_0x220f('0x5d')]){_0x565fe6[_0x220f('0x5d')][_0x220f('0x44')]=widgetAttributes(_0x565fe6[_0x220f('0x5d')]);}return db[_0x220f('0x3f')][_0x220f('0x5c')](_0x565fe6[_0x220f('0x5d')],{})[_0x220f('0x2e')](respondWithResult(_0x32a0b4,0xc9))[_0x220f('0x40')](handleError(_0x32a0b4,null));};exports['update']=function(_0x3b27fd,_0x3c2d57){if(_0x3b27fd[_0x220f('0x5d')]['id']){delete _0x3b27fd[_0x220f('0x5d')]['id'];}_0x3b27fd[_0x220f('0x5d')]['attrs']=widgetAttributes(_0x3b27fd[_0x220f('0x5d')]);return db[_0x220f('0x3f')]['find']({'where':{'id':_0x3b27fd[_0x220f('0x35')]['id']}})['then'](handleEntityNotFound(_0x3c2d57,null))[_0x220f('0x2e')](saveUpdates(_0x3b27fd[_0x220f('0x5d')],null))[_0x220f('0x2e')](respondWithResult(_0x3c2d57,null))[_0x220f('0x40')](handleError(_0x3c2d57,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ee5ae22..c361de0 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 _0xeba8=['remove','emit','hasOwnProperty','hook','events','DashboardItem','setMaxListeners','save'];(function(_0x5e3c73,_0x1f6546){var _0x149bec=function(_0x398f81){while(--_0x398f81){_0x5e3c73['push'](_0x5e3c73['shift']());}};_0x149bec(++_0x1f6546);}(_0xeba8,0x194));var _0x8eba=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xeba8[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require(_0x8eba('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x8eba('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8eba('0x2')](0x0);var events={'afterCreate':_0x8eba('0x3'),'afterUpdate':'update','afterDestroy':_0x8eba('0x4')};function emitEvent(_0xf00349){return function(_0x52446a,_0x35c5b3,_0xd9ec3b){DashboardItemEvents[_0x8eba('0x5')](_0xf00349+':'+_0x52446a['id'],_0x52446a);DashboardItemEvents[_0x8eba('0x5')](_0xf00349,_0x52446a);_0xd9ec3b(null);};}for(var e in events){if(events[_0x8eba('0x6')](e)){var event=events[e];DashboardItem[_0x8eba('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xb078=['exports','events','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x62c0d,_0x3fd1fe){var _0x3b5b6b=function(_0x496e6a){while(--_0x496e6a){_0x62c0d['push'](_0x62c0d['shift']());}};_0x3b5b6b(++_0x3fd1fe);}(_0xb078,0xb5));var _0x8b07=function(_0x49feed,_0x1f6f83){_0x49feed=_0x49feed-0x0;var _0x3182b3=_0xb078[_0x49feed];return _0x3182b3;};'use strict';var EventEmitter=require(_0x8b07('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x8b07('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8b07('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b07('0x3'),'afterDestroy':_0x8b07('0x4')};function emitEvent(_0x5d1ab6){return function(_0x2fd61a,_0x584219,_0x140feb){DashboardItemEvents[_0x8b07('0x5')](_0x5d1ab6+':'+_0x2fd61a['id'],_0x2fd61a);DashboardItemEvents[_0x8b07('0x5')](_0x5d1ab6,_0x2fd61a);_0x140feb(null);};}for(var e in events){if(events[_0x8b07('0x6')](e)){var event=events[e];DashboardItem[_0x8b07('0x7')](e,emitEvent(event));}}module[_0x8b07('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 73831a1..9f11d30 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 _0x1cde=['rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1e2cdc,_0x4689bd){var _0x4d9905=function(_0x17abf2){while(--_0x17abf2){_0x1e2cdc['push'](_0x1e2cdc['shift']());}};_0x4d9905(++_0x4689bd);}(_0x1cde,0x1e7));var _0xe1cd=function(_0x8fc6e3,_0x5dae60){_0x8fc6e3=_0x8fc6e3-0x0;var _0x284415=_0x1cde[_0x8fc6e3];return _0x284415;};'use strict';var _=require(_0xe1cd('0x0'));var util=require(_0xe1cd('0x1'));var logger=require(_0xe1cd('0x2'))('api');var moment=require(_0xe1cd('0x3'));var BPromise=require(_0xe1cd('0x4'));var rp=require(_0xe1cd('0x5'));var fs=require('fs');var path=require(_0xe1cd('0x6'));var rimraf=require(_0xe1cd('0x7'));var config=require(_0xe1cd('0x8'));var attributes=require(_0xe1cd('0x9'));module[_0xe1cd('0xa')]=function(_0x31d63c,_0x558587){return _0x31d63c['define'](_0xe1cd('0xb'),attributes,{'tableName':_0xe1cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd06e=['DashboardItem','dashboard_items','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x51f2c0,_0xb7c46e){var _0x34ffd5=function(_0x2238c0){while(--_0x2238c0){_0x51f2c0['push'](_0x51f2c0['shift']());}};_0x34ffd5(++_0xb7c46e);}(_0xd06e,0x122));var _0xed06=function(_0x3ba2fe,_0x27a76c){_0x3ba2fe=_0x3ba2fe-0x0;var _0x3baef7=_0xd06e[_0x3ba2fe];return _0x3baef7;};'use strict';var _=require(_0xed06('0x0'));var util=require(_0xed06('0x1'));var logger=require('../../config/logger')(_0xed06('0x2'));var moment=require(_0xed06('0x3'));var BPromise=require('bluebird');var rp=require(_0xed06('0x4'));var fs=require('fs');var path=require(_0xed06('0x5'));var rimraf=require(_0xed06('0x6'));var config=require(_0xed06('0x7'));var attributes=require(_0xed06('0x8'));module[_0xed06('0x9')]=function(_0x26d0b9,_0x455e03){return _0x26d0b9['define'](_0xed06('0xa'),attributes,{'tableName':_0xed06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 87e0c8b..0b6aa44 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 _0x8d2c=['DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x669f13,_0xf46f13){var _0x2d0477=function(_0x40908b){while(--_0x40908b){_0x669f13['push'](_0x669f13['shift']());}};_0x2d0477(++_0xf46f13);}(_0x8d2c,0x1a6));var _0xc8d2=function(_0x501723,_0x3fa959){_0x501723=_0x501723-0x0;var _0x4c95e3=_0x8d2c[_0x501723];return _0x4c95e3;};'use strict';var _=require('lodash');var util=require(_0xc8d2('0x0'));var moment=require(_0xc8d2('0x1'));var BPromise=require(_0xc8d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8d2('0x3'));var db=require(_0xc8d2('0x4'))['db'];var utils=require(_0xc8d2('0x5'));var logger=require(_0xc8d2('0x6'))(_0xc8d2('0x7'));var config=require('../../config/environment');var jayson=require(_0xc8d2('0x8'));var client=jayson['client'][_0xc8d2('0x9')]({'port':0x232a});config[_0xc8d2('0xa')]=_['defaults'](config[_0xc8d2('0xa')],{'host':_0xc8d2('0xb'),'port':0x18eb});var socket=require(_0xc8d2('0xc'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xc8d2('0xd')](socket);function respondWithRpcPromise(_0x348051,_0x30dd8,_0x26028c){return new BPromise(function(_0xc8ee9f,_0x4b89e4){return client[_0xc8d2('0xe')](_0x348051,_0x26028c)[_0xc8d2('0xf')](function(_0x3923ac){logger[_0xc8d2('0x10')](_0xc8d2('0x11'),_0x30dd8,_0xc8d2('0x12'));logger[_0xc8d2('0x13')](_0xc8d2('0x14'),_0x30dd8,_0xc8d2('0x12'),JSON['stringify'](_0x3923ac));if(_0x3923ac[_0xc8d2('0x15')]){if(_0x3923ac[_0xc8d2('0x15')][_0xc8d2('0x16')]===0x1f4){logger[_0xc8d2('0x15')](_0xc8d2('0x11'),_0x30dd8,_0x3923ac[_0xc8d2('0x15')][_0xc8d2('0x17')]);return _0x4b89e4(_0x3923ac[_0xc8d2('0x15')][_0xc8d2('0x17')]);}logger[_0xc8d2('0x15')](_0xc8d2('0x11'),_0x30dd8,_0x3923ac['error'][_0xc8d2('0x17')]);return _0xc8ee9f(_0x3923ac[_0xc8d2('0x15')]['message']);}else{logger['info'](_0xc8d2('0x11'),_0x30dd8,'request\x20sent');_0xc8ee9f(_0x3923ac[_0xc8d2('0x18')][_0xc8d2('0x17')]);}})[_0xc8d2('0x19')](function(_0x2ae001){logger['error'](_0xc8d2('0x11'),_0x30dd8,_0x2ae001);_0x4b89e4(_0x2ae001);});});} \ No newline at end of file +var _0xc025=['moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2ccacc,_0x51621f){var _0x16752c=function(_0x589816){while(--_0x589816){_0x2ccacc['push'](_0x2ccacc['shift']());}};_0x16752c(++_0x51621f);}(_0xc025,0x94));var _0x5c02=function(_0x16e173,_0x4147c6){_0x16e173=_0x16e173-0x0;var _0x9f44b6=_0xc025[_0x16e173];return _0x9f44b6;};'use strict';var _=require(_0x5c02('0x0'));var util=require(_0x5c02('0x1'));var moment=require(_0x5c02('0x2'));var BPromise=require(_0x5c02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c02('0x4'));var logger=require('../../config/logger')(_0x5c02('0x5'));var config=require(_0x5c02('0x6'));var jayson=require(_0x5c02('0x7'));var client=jayson[_0x5c02('0x8')]['http']({'port':0x232a});config['redis']=_[_0x5c02('0x9')](config[_0x5c02('0xa')],{'host':_0x5c02('0xb'),'port':0x18eb});var socket=require(_0x5c02('0xc'))(new Redis(config[_0x5c02('0xa')]));require('./dashboardItem.socket')[_0x5c02('0xd')](socket);function respondWithRpcPromise(_0x59c533,_0x11542e,_0x9a9a42){return new BPromise(function(_0x1e81b8,_0x5a3256){return client['request'](_0x59c533,_0x9a9a42)[_0x5c02('0xe')](function(_0x25cdfc){logger[_0x5c02('0xf')](_0x5c02('0x10'),_0x11542e,_0x5c02('0x11'));logger['debug'](_0x5c02('0x12'),_0x11542e,_0x5c02('0x11'),JSON[_0x5c02('0x13')](_0x25cdfc));if(_0x25cdfc[_0x5c02('0x14')]){if(_0x25cdfc[_0x5c02('0x14')][_0x5c02('0x15')]===0x1f4){logger['error'](_0x5c02('0x10'),_0x11542e,_0x25cdfc[_0x5c02('0x14')][_0x5c02('0x16')]);return _0x5a3256(_0x25cdfc[_0x5c02('0x14')]['message']);}logger[_0x5c02('0x14')](_0x5c02('0x10'),_0x11542e,_0x25cdfc[_0x5c02('0x14')][_0x5c02('0x16')]);return _0x1e81b8(_0x25cdfc['error'][_0x5c02('0x16')]);}else{logger['info'](_0x5c02('0x10'),_0x11542e,_0x5c02('0x11'));_0x1e81b8(_0x25cdfc[_0x5c02('0x17')]['message']);}})[_0x5c02('0x18')](function(_0x38be84){logger[_0x5c02('0x14')]('DashboardItem,\x20%s,\x20%s',_0x11542e,_0x38be84);_0x5a3256(_0x38be84);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c46a4ac..de2a1bd 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 _0x3110=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x50506e,_0x3ab243){var _0x92a67a=function(_0x53af20){while(--_0x53af20){_0x50506e['push'](_0x50506e['shift']());}};_0x92a67a(++_0x3ab243);}(_0x3110,0x135));var _0x0311=function(_0x1a5bbf,_0x3c4c72){_0x1a5bbf=_0x1a5bbf-0x0;var _0xb6a9ff=_0x3110[_0x1a5bbf];return _0xb6a9ff;};'use strict';var DashboardItemEvents=require(_0x0311('0x0'));var events=[_0x0311('0x1'),_0x0311('0x2'),_0x0311('0x3')];function createListener(_0x18bee9,_0x1e6b56){return function(_0x515992){_0x1e6b56[_0x0311('0x4')](_0x18bee9,_0x515992);};}function removeListener(_0x3bdb7e,_0x85a4bd){return function(){DashboardItemEvents[_0x0311('0x5')](_0x3bdb7e,_0x85a4bd);};}exports[_0x0311('0x6')]=function(_0x4b99f4){for(var _0x480a1d=0x0,_0x5e3401=events[_0x0311('0x7')];_0x480a1d<_0x5e3401;_0x480a1d++){var _0x3800ca=events[_0x480a1d];var _0x18bde6=createListener(_0x0311('0x8')+_0x3800ca,_0x4b99f4);DashboardItemEvents['on'](_0x3800ca,_0x18bde6);}}; \ No newline at end of file +var _0xddf9=['removeListener','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit'];(function(_0x20b13f,_0x5dc44e){var _0x3d9ae3=function(_0xf0ec98){while(--_0xf0ec98){_0x20b13f['push'](_0x20b13f['shift']());}};_0x3d9ae3(++_0x5dc44e);}(_0xddf9,0x7b));var _0x9ddf=function(_0x3a1109,_0x41156d){_0x3a1109=_0x3a1109-0x0;var _0x3c1cea=_0xddf9[_0x3a1109];return _0x3c1cea;};'use strict';var DashboardItemEvents=require(_0x9ddf('0x0'));var events=[_0x9ddf('0x1'),_0x9ddf('0x2'),_0x9ddf('0x3')];function createListener(_0x1a3c5b,_0x5d6529){return function(_0x211412){_0x5d6529[_0x9ddf('0x4')](_0x1a3c5b,_0x211412);};}function removeListener(_0xed21c8,_0x3414c4){return function(){DashboardItemEvents[_0x9ddf('0x5')](_0xed21c8,_0x3414c4);};}exports['register']=function(_0x1d64f7){for(var _0x449b31=0x0,_0x4d4b4e=events[_0x9ddf('0x6')];_0x449b31<_0x4d4b4e;_0x449b31++){var _0x36df48=events[_0x449b31];var _0x3cc183=createListener(_0x9ddf('0x7')+_0x36df48,_0x1d64f7);DashboardItemEvents['on'](_0x36df48,_0x3cc183);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 69114d7..825abbc 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 _0xd9d3=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x4fa738,_0x2a491c){var _0x55bf55=function(_0x185d53){while(--_0x185d53){_0x4fa738['push'](_0x4fa738['shift']());}};_0x55bf55(++_0x2a491c);}(_0xd9d3,0xfb));var _0x3d9d=function(_0x49026b,_0x5b2911){_0x49026b=_0x49026b-0x0;var _0x2456a2=_0xd9d3[_0x49026b];return _0x2456a2;};'use strict';var multer=require(_0x3d9d('0x0'));var util=require(_0x3d9d('0x1'));var path=require(_0x3d9d('0x2'));var timeout=require(_0x3d9d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d9d('0x4'));var auth=require(_0x3d9d('0x5'));var interaction=require(_0x3d9d('0x6'));var config=require(_0x3d9d('0x7'));var controller=require(_0x3d9d('0x8'));router[_0x3d9d('0x9')](_0x3d9d('0xa'),auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xc')]);router[_0x3d9d('0xd')]('/',auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xe')]);router['put'](_0x3d9d('0xa'),auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xf')]);router[_0x3d9d('0x10')]('/:id',auth[_0x3d9d('0xb')](),controller[_0x3d9d('0x11')]);module[_0x3d9d('0x12')]=router; \ No newline at end of file +var _0x3441=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','post','create','put','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x2cf683,_0x3213de){var _0x5cddff=function(_0x454eed){while(--_0x454eed){_0x2cf683['push'](_0x2cf683['shift']());}};_0x5cddff(++_0x3213de);}(_0x3441,0x1be));var _0x1344=function(_0x2b1762,_0x14b5ea){_0x2b1762=_0x2b1762-0x0;var _0x11863e=_0x3441[_0x2b1762];return _0x11863e;};'use strict';var multer=require(_0x1344('0x0'));var util=require(_0x1344('0x1'));var path=require(_0x1344('0x2'));var timeout=require(_0x1344('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1344('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1344('0x5'));var config=require(_0x1344('0x6'));var controller=require('./dashboardItem.controller');router[_0x1344('0x7')](_0x1344('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x1344('0x9')]('/',auth['isAuthenticated'](),controller[_0x1344('0xa')]);router[_0x1344('0xb')](_0x1344('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x1344('0xc')](_0x1344('0x8'),auth[_0x1344('0xd')](),controller[_0x1344('0xe')]);module[_0x1344('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 94cf9c9..7f7d3c6 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 _0x59aa=['exports','STRING','first','third'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x59aa,0x168));var _0xa59a=function(_0x483227,_0x3bc79){_0x483227=_0x483227-0x0;var _0x350cae=_0x59aa[_0x483227];return _0x350cae;};'use strict';var Sequelize=require('sequelize');module[_0xa59a('0x0')]={'name':{'type':Sequelize[_0xa59a('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xa59a('0x2'),'second',_0xa59a('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xa59a('0x1')]}}; \ No newline at end of file +var _0x8782=['second','third','exports','STRING','ENUM'];(function(_0x38efc9,_0x42f802){var _0x555438=function(_0x5cf353){while(--_0x5cf353){_0x38efc9['push'](_0x38efc9['shift']());}};_0x555438(++_0x42f802);}(_0x8782,0x192));var _0x2878=function(_0xda6024,_0x1434d4){_0xda6024=_0xda6024-0x0;var _0x338ba0=_0x8782[_0xda6024];return _0x338ba0;};'use strict';var Sequelize=require('sequelize');module[_0x2878('0x0')]={'name':{'type':Sequelize[_0x2878('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x2878('0x2')]('first',_0x2878('0x3'),_0x2878('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x2878('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e6c6369..f2ae039 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 _0x8e08=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Dispositions','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','index','Disposition','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8e08,0xf9));var _0x88e0=function(_0x53cba0,_0x391fba){_0x53cba0=_0x53cba0-0x0;var _0x5a0c5d=_0x8e08[_0x53cba0];return _0x5a0c5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88e0('0x1'));var rp=require(_0x88e0('0x2'));var moment=require(_0x88e0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x88e0('0x4'));var util=require(_0x88e0('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x88e0('0x6'));var fs=require('fs');var fs_extra=require(_0x88e0('0x7'));var _=require(_0x88e0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x88e0('0x9'));var deskjs=require(_0x88e0('0xa'));var toCsv=require(_0x88e0('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x88e0('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x88e0('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88e0('0xe'))('api');var utils=require(_0x88e0('0xf'));var config=require(_0x88e0('0x10'));var licenseUtil=require(_0x88e0('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480d36,_0xcd31dd){_0xcd31dd=_0xcd31dd||0xcc;return function(_0x5104ba){if(_0x5104ba){return _0x480d36[_0x88e0('0x12')](_0xcd31dd);}return _0x480d36[_0x88e0('0x13')](_0xcd31dd)[_0x88e0('0x14')]();};}function respondWithResult(_0x29cb6d,_0x368e64){_0x368e64=_0x368e64||0xc8;return function(_0x313f22){if(_0x313f22){return _0x29cb6d[_0x88e0('0x13')](_0x368e64)[_0x88e0('0x15')](_0x313f22);}};}function respondWithFilteredResult(_0x3439a8,_0x413135){return function(_0x739ed2){if(_0x739ed2){var _0x463d75=typeof _0x413135[_0x88e0('0x16')]===_0x88e0('0x17')&&typeof _0x413135['limit']===_0x88e0('0x17');var _0x6b5dc6=_0x739ed2[_0x88e0('0x18')];var _0x53d48e=_0x463d75?0x0:_0x413135[_0x88e0('0x16')];var _0x482da5=_0x463d75?_0x739ed2[_0x88e0('0x18')]:_0x413135[_0x88e0('0x16')]+_0x413135[_0x88e0('0x19')];var _0x1caa9b;if(_0x482da5>=_0x6b5dc6){_0x482da5=_0x6b5dc6;_0x1caa9b=0xc8;}else{_0x1caa9b=0xce;}_0x3439a8['status'](_0x1caa9b);return _0x3439a8['set'](_0x88e0('0x1a'),_0x53d48e+'-'+_0x482da5+'/'+_0x6b5dc6)[_0x88e0('0x15')](_0x739ed2);}return null;};}function patchUpdates(_0x234327){return function(_0xeb4600){try{jsonpatch[_0x88e0('0x1b')](_0xeb4600,_0x234327,!![]);}catch(_0x1d970b){return BPromise[_0x88e0('0x1c')](_0x1d970b);}return _0xeb4600[_0x88e0('0x1d')]();};}function saveUpdates(_0x53cafd,_0x442376){return function(_0x37d117){if(_0x37d117){return _0x37d117[_0x88e0('0x1e')](_0x53cafd)['then'](function(_0x1a5e0e){return _0x1a5e0e;});}return null;};}function removeEntity(_0x3f2726,_0x350c4c){return function(_0x22c818){if(_0x22c818){return _0x22c818[_0x88e0('0x1f')]()[_0x88e0('0x20')](function(){var _0x1e3a10=_0x22c818['get']({'plain':!![]});var _0x5551c1='Dispositions';return db[_0x88e0('0x21')][_0x88e0('0x1f')]({'where':{'type':_0x5551c1,'resourceId':_0x1e3a10['id']}})[_0x88e0('0x20')](function(){return _0x22c818;});})['then'](function(){_0x3f2726[_0x88e0('0x13')](0xcc)[_0x88e0('0x14')]();});}};}function handleEntityNotFound(_0xde6196,_0x302bf1){return function(_0x246ed5){if(!_0x246ed5){_0xde6196[_0x88e0('0x12')](0x194);}return _0x246ed5;};}function handleError(_0x279087,_0x553136){_0x553136=_0x553136||0x1f4;return function(_0x2759e5){logger[_0x88e0('0x22')](_0x2759e5[_0x88e0('0x23')]);if(_0x2759e5[_0x88e0('0x24')]){delete _0x2759e5[_0x88e0('0x24')];}_0x279087[_0x88e0('0x13')](_0x553136)['send'](_0x2759e5);};}exports[_0x88e0('0x25')]=function(_0x185b27,_0x53d993){var _0x8b8e88={},_0x195c86={},_0x12ecab={'count':0x0,'rows':[]};var _0x27b5c3=_['map'](db[_0x88e0('0x26')][_0x88e0('0x27')],function(_0x4ba3d2){return{'name':_0x4ba3d2[_0x88e0('0x28')],'type':_0x4ba3d2[_0x88e0('0x29')][_0x88e0('0x2a')]};});_0x195c86['model']=_[_0x88e0('0x2b')](_0x27b5c3,_0x88e0('0x24'));_0x195c86[_0x88e0('0x2c')]=_[_0x88e0('0x2d')](_0x185b27[_0x88e0('0x2c')]);_0x195c86[_0x88e0('0x2e')]=_[_0x88e0('0x2f')](_0x195c86[_0x88e0('0x30')],_0x195c86[_0x88e0('0x2c')]);_0x8b8e88[_0x88e0('0x31')]=_['intersection'](_0x195c86['model'],qs['fields'](_0x185b27['query']['fields']));_0x8b8e88[_0x88e0('0x31')]=_0x8b8e88[_0x88e0('0x31')][_0x88e0('0x32')]?_0x8b8e88[_0x88e0('0x31')]:_0x195c86[_0x88e0('0x30')];if(!_0x185b27['query']['hasOwnProperty'](_0x88e0('0x33'))){_0x8b8e88[_0x88e0('0x19')]=qs[_0x88e0('0x19')](_0x185b27[_0x88e0('0x2c')][_0x88e0('0x19')]);_0x8b8e88['offset']=qs['offset'](_0x185b27[_0x88e0('0x2c')][_0x88e0('0x16')]);}_0x8b8e88[_0x88e0('0x34')]=qs[_0x88e0('0x35')](_0x185b27[_0x88e0('0x2c')]['sort']);_0x8b8e88[_0x88e0('0x36')]=qs['filters'](_[_0x88e0('0x37')](_0x185b27[_0x88e0('0x2c')],_0x195c86['filters']),_0x27b5c3);if(_0x185b27[_0x88e0('0x2c')][_0x88e0('0x38')]){_0x8b8e88['where']=_[_0x88e0('0x39')](_0x8b8e88['where'],{'$or':_['map'](_0x27b5c3,function(_0x5c4c00){if(_0x5c4c00[_0x88e0('0x29')]!==_0x88e0('0x3a')){var _0x1a15cd={};_0x1a15cd[_0x5c4c00[_0x88e0('0x24')]]={'$like':'%'+_0x185b27['query']['filter']+'%'};return _0x1a15cd;}})});}_0x8b8e88=_[_0x88e0('0x39')]({},_0x8b8e88,_0x185b27[_0x88e0('0x3b')]);var _0x48ff28={'where':_0x8b8e88[_0x88e0('0x36')]};return db['Disposition'][_0x88e0('0x18')](_0x48ff28)[_0x88e0('0x20')](function(_0x4eeba1){_0x12ecab['count']=_0x4eeba1;if(_0x185b27[_0x88e0('0x2c')][_0x88e0('0x3c')]){_0x8b8e88[_0x88e0('0x3d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x8b8e88);})[_0x88e0('0x20')](function(_0x4d3aa4){_0x12ecab[_0x88e0('0x3e')]=_0x4d3aa4;return _0x12ecab;})['then'](respondWithFilteredResult(_0x53d993,_0x8b8e88))[_0x88e0('0x3f')](handleError(_0x53d993,null));};exports[_0x88e0('0x40')]=function(_0x422bcf,_0x605dbf){var _0x15d5eb={'raw':!![],'where':{'id':_0x422bcf[_0x88e0('0x41')]['id']}},_0x5868b6={};_0x5868b6['model']=_['keys'](db['Disposition'][_0x88e0('0x27')]);_0x5868b6['query']=_[_0x88e0('0x2d')](_0x422bcf[_0x88e0('0x2c')]);_0x5868b6[_0x88e0('0x2e')]=_[_0x88e0('0x2f')](_0x5868b6[_0x88e0('0x30')],_0x5868b6[_0x88e0('0x2c')]);_0x15d5eb[_0x88e0('0x31')]=_['intersection'](_0x5868b6['model'],qs[_0x88e0('0x42')](_0x422bcf[_0x88e0('0x2c')][_0x88e0('0x42')]));_0x15d5eb[_0x88e0('0x31')]=_0x15d5eb['attributes'][_0x88e0('0x32')]?_0x15d5eb['attributes']:_0x5868b6['model'];if(_0x422bcf['query'][_0x88e0('0x3c')]){_0x15d5eb[_0x88e0('0x3d')]=[{'all':!![]}];}_0x15d5eb=_[_0x88e0('0x39')]({},_0x15d5eb,_0x422bcf[_0x88e0('0x3b')]);return db[_0x88e0('0x26')]['find'](_0x15d5eb)['then'](handleEntityNotFound(_0x605dbf,null))[_0x88e0('0x20')](respondWithResult(_0x605dbf,null))[_0x88e0('0x3f')](handleError(_0x605dbf,null));};exports[_0x88e0('0x43')]=function(_0x5b8ab2,_0x404106){return db[_0x88e0('0x26')][_0x88e0('0x43')](_0x5b8ab2[_0x88e0('0x44')],{})['then'](function(_0x1d65d6){var _0x39b347=_0x5b8ab2[_0x88e0('0x45')]['get']({'plain':!![]});if(!_0x39b347)throw new Error(_0x88e0('0x46'));if(_0x39b347[_0x88e0('0x47')]==='user'){var _0x57d19e=_0x1d65d6[_0x88e0('0x48')]({'plain':!![]});var _0x11717b=_0x88e0('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x11717b,'userProfileId':_0x39b347[_0x88e0('0x4a')]},'raw':!![]})[_0x88e0('0x20')](function(_0x593b9e){if(_0x593b9e&&_0x593b9e['autoAssociation']===0x0){return db[_0x88e0('0x21')][_0x88e0('0x43')]({'name':_0x57d19e[_0x88e0('0x24')],'resourceId':_0x57d19e['id'],'type':_0x593b9e['name'],'sectionId':_0x593b9e['id']},{})[_0x88e0('0x20')](function(){return _0x1d65d6;});}else{return _0x1d65d6;}})[_0x88e0('0x3f')](function(_0x46a2b5){logger[_0x88e0('0x22')](_0x88e0('0x4b'),_0x46a2b5);throw _0x46a2b5;});}return _0x1d65d6;})[_0x88e0('0x20')](respondWithResult(_0x404106,0xc9))['catch'](handleError(_0x404106,null));};exports['update']=function(_0x464c4f,_0x42aecd){if(_0x464c4f[_0x88e0('0x44')]['id']){delete _0x464c4f['body']['id'];}return db[_0x88e0('0x26')]['find']({'where':{'id':_0x464c4f[_0x88e0('0x41')]['id']}})[_0x88e0('0x20')](handleEntityNotFound(_0x42aecd,null))['then'](saveUpdates(_0x464c4f['body'],null))[_0x88e0('0x20')](respondWithResult(_0x42aecd,null))[_0x88e0('0x3f')](handleError(_0x42aecd,null));};exports[_0x88e0('0x1f')]=function(_0x41ba1e,_0x51101b){return db[_0x88e0('0x26')]['find']({'where':{'id':_0x41ba1e[_0x88e0('0x41')]['id']}})[_0x88e0('0x20')](handleEntityNotFound(_0x51101b,null))[_0x88e0('0x20')](removeEntity(_0x51101b,null))[_0x88e0('0x3f')](handleError(_0x51101b,null));}; \ No newline at end of file +var _0xcb3a=['send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Disposition','includeAll','include','rows','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','Dispositions','destroy','error','stack','name'];(function(_0x43c428,_0x15fe1b){var _0x55f25a=function(_0x29faf4){while(--_0x29faf4){_0x43c428['push'](_0x43c428['shift']());}};_0x55f25a(++_0x15fe1b);}(_0xcb3a,0x1d7));var _0xacb3=function(_0x156ae6,_0x2c39f6){_0x156ae6=_0x156ae6-0x0;var _0x534be3=_0xcb3a[_0x156ae6];return _0x534be3;};'use strict';var emlformat=require(_0xacb3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xacb3('0x1'));var rp=require(_0xacb3('0x2'));var moment=require(_0xacb3('0x3'));var BPromise=require(_0xacb3('0x4'));var Mustache=require(_0xacb3('0x5'));var util=require(_0xacb3('0x6'));var path=require(_0xacb3('0x7'));var sox=require('sox');var csv=require(_0xacb3('0x8'));var ejs=require(_0xacb3('0x9'));var fs=require('fs');var fs_extra=require(_0xacb3('0xa'));var _=require('lodash');var squel=require(_0xacb3('0xb'));var crypto=require(_0xacb3('0xc'));var jsforce=require(_0xacb3('0xd'));var deskjs=require(_0xacb3('0xe'));var toCsv=require(_0xacb3('0x8'));var querystring=require(_0xacb3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xacb3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xacb3('0x11'));var hardwareService=require(_0xacb3('0x12'));var logger=require(_0xacb3('0x13'))(_0xacb3('0x14'));var utils=require(_0xacb3('0x15'));var config=require(_0xacb3('0x16'));var licenseUtil=require(_0xacb3('0x17'));var db=require(_0xacb3('0x18'))['db'];function respondWithStatusCode(_0x43e8ce,_0x45e03c){_0x45e03c=_0x45e03c||0xcc;return function(_0x354473){if(_0x354473){return _0x43e8ce[_0xacb3('0x19')](_0x45e03c);}return _0x43e8ce[_0xacb3('0x1a')](_0x45e03c)[_0xacb3('0x1b')]();};}function respondWithResult(_0x211c19,_0x872d01){_0x872d01=_0x872d01||0xc8;return function(_0x402abe){if(_0x402abe){return _0x211c19[_0xacb3('0x1a')](_0x872d01)[_0xacb3('0x1c')](_0x402abe);}};}function respondWithFilteredResult(_0x111461,_0x2fade4){return function(_0x477a3e){if(_0x477a3e){var _0x37b7ab=typeof _0x2fade4['offset']===_0xacb3('0x1d')&&typeof _0x2fade4[_0xacb3('0x1e')]===_0xacb3('0x1d');var _0xb813c5=_0x477a3e[_0xacb3('0x1f')];var _0x17492b=_0x37b7ab?0x0:_0x2fade4['offset'];var _0x2d8ea9=_0x37b7ab?_0x477a3e[_0xacb3('0x1f')]:_0x2fade4[_0xacb3('0x20')]+_0x2fade4[_0xacb3('0x1e')];var _0x96f50b;if(_0x2d8ea9>=_0xb813c5){_0x2d8ea9=_0xb813c5;_0x96f50b=0xc8;}else{_0x96f50b=0xce;}_0x111461[_0xacb3('0x1a')](_0x96f50b);return _0x111461[_0xacb3('0x21')](_0xacb3('0x22'),_0x17492b+'-'+_0x2d8ea9+'/'+_0xb813c5)[_0xacb3('0x1c')](_0x477a3e);}return null;};}function patchUpdates(_0x3efbfd){return function(_0x34a7b9){try{jsonpatch[_0xacb3('0x23')](_0x34a7b9,_0x3efbfd,!![]);}catch(_0x1f3559){return BPromise[_0xacb3('0x24')](_0x1f3559);}return _0x34a7b9[_0xacb3('0x25')]();};}function saveUpdates(_0x41f05,_0x1d0b9a){return function(_0x4dcf88){if(_0x4dcf88){return _0x4dcf88['update'](_0x41f05)[_0xacb3('0x26')](function(_0x120271){return _0x120271;});}return null;};}function removeEntity(_0x2724cf,_0x1a4119){return function(_0x4cb842){if(_0x4cb842){return _0x4cb842['destroy']()[_0xacb3('0x26')](function(){var _0x42c77f=_0x4cb842[_0xacb3('0x27')]({'plain':!![]});var _0x40d565=_0xacb3('0x28');return db['UserProfileResource'][_0xacb3('0x29')]({'where':{'type':_0x40d565,'resourceId':_0x42c77f['id']}})[_0xacb3('0x26')](function(){return _0x4cb842;});})[_0xacb3('0x26')](function(){_0x2724cf[_0xacb3('0x1a')](0xcc)[_0xacb3('0x1b')]();});}};}function handleEntityNotFound(_0x4503c6,_0x9f7aab){return function(_0x417004){if(!_0x417004){_0x4503c6['sendStatus'](0x194);}return _0x417004;};}function handleError(_0x2a38ab,_0x1b94de){_0x1b94de=_0x1b94de||0x1f4;return function(_0x2cebb9){logger[_0xacb3('0x2a')](_0x2cebb9[_0xacb3('0x2b')]);if(_0x2cebb9['name']){delete _0x2cebb9[_0xacb3('0x2c')];}_0x2a38ab[_0xacb3('0x1a')](_0x1b94de)[_0xacb3('0x2d')](_0x2cebb9);};}exports[_0xacb3('0x2e')]=function(_0xf914d4,_0x362a6a){var _0x54c922={},_0x27475e={},_0xf80f2f={'count':0x0,'rows':[]};var _0xd67eeb=_[_0xacb3('0x2f')](db['Disposition'][_0xacb3('0x30')],function(_0x5a9ba2){return{'name':_0x5a9ba2['fieldName'],'type':_0x5a9ba2['type'][_0xacb3('0x31')]};});_0x27475e[_0xacb3('0x32')]=_[_0xacb3('0x2f')](_0xd67eeb,_0xacb3('0x2c'));_0x27475e[_0xacb3('0x33')]=_[_0xacb3('0x34')](_0xf914d4[_0xacb3('0x33')]);_0x27475e[_0xacb3('0x35')]=_['intersection'](_0x27475e['model'],_0x27475e[_0xacb3('0x33')]);_0x54c922[_0xacb3('0x36')]=_[_0xacb3('0x37')](_0x27475e[_0xacb3('0x32')],qs['fields'](_0xf914d4[_0xacb3('0x33')][_0xacb3('0x38')]));_0x54c922[_0xacb3('0x36')]=_0x54c922[_0xacb3('0x36')][_0xacb3('0x39')]?_0x54c922[_0xacb3('0x36')]:_0x27475e[_0xacb3('0x32')];if(!_0xf914d4[_0xacb3('0x33')][_0xacb3('0x3a')](_0xacb3('0x3b'))){_0x54c922[_0xacb3('0x1e')]=qs[_0xacb3('0x1e')](_0xf914d4[_0xacb3('0x33')][_0xacb3('0x1e')]);_0x54c922[_0xacb3('0x20')]=qs[_0xacb3('0x20')](_0xf914d4['query'][_0xacb3('0x20')]);}_0x54c922[_0xacb3('0x3c')]=qs[_0xacb3('0x3d')](_0xf914d4[_0xacb3('0x33')][_0xacb3('0x3d')]);_0x54c922[_0xacb3('0x3e')]=qs[_0xacb3('0x35')](_[_0xacb3('0x3f')](_0xf914d4['query'],_0x27475e[_0xacb3('0x35')]),_0xd67eeb);if(_0xf914d4[_0xacb3('0x33')][_0xacb3('0x40')]){_0x54c922[_0xacb3('0x3e')]=_['merge'](_0x54c922[_0xacb3('0x3e')],{'$or':_[_0xacb3('0x2f')](_0xd67eeb,function(_0x54c43c){if(_0x54c43c[_0xacb3('0x41')]!==_0xacb3('0x42')){var _0x302711={};_0x302711[_0x54c43c[_0xacb3('0x2c')]]={'$like':'%'+_0xf914d4[_0xacb3('0x33')][_0xacb3('0x40')]+'%'};return _0x302711;}})});}_0x54c922=_[_0xacb3('0x43')]({},_0x54c922,_0xf914d4[_0xacb3('0x44')]);var _0x12b355={'where':_0x54c922[_0xacb3('0x3e')]};return db[_0xacb3('0x45')]['count'](_0x12b355)[_0xacb3('0x26')](function(_0x134b82){_0xf80f2f[_0xacb3('0x1f')]=_0x134b82;if(_0xf914d4['query'][_0xacb3('0x46')]){_0x54c922[_0xacb3('0x47')]=[{'all':!![]}];}return db[_0xacb3('0x45')]['findAll'](_0x54c922);})[_0xacb3('0x26')](function(_0xe82192){_0xf80f2f[_0xacb3('0x48')]=_0xe82192;return _0xf80f2f;})[_0xacb3('0x26')](respondWithFilteredResult(_0x362a6a,_0x54c922))[_0xacb3('0x49')](handleError(_0x362a6a,null));};exports[_0xacb3('0x4a')]=function(_0x848e86,_0x586f55){var _0x3282ec={'raw':!![],'where':{'id':_0x848e86[_0xacb3('0x4b')]['id']}},_0x1918fe={};_0x1918fe[_0xacb3('0x32')]=_['keys'](db[_0xacb3('0x45')][_0xacb3('0x30')]);_0x1918fe[_0xacb3('0x33')]=_[_0xacb3('0x34')](_0x848e86[_0xacb3('0x33')]);_0x1918fe[_0xacb3('0x35')]=_[_0xacb3('0x37')](_0x1918fe['model'],_0x1918fe[_0xacb3('0x33')]);_0x3282ec[_0xacb3('0x36')]=_[_0xacb3('0x37')](_0x1918fe[_0xacb3('0x32')],qs[_0xacb3('0x38')](_0x848e86[_0xacb3('0x33')][_0xacb3('0x38')]));_0x3282ec[_0xacb3('0x36')]=_0x3282ec['attributes'][_0xacb3('0x39')]?_0x3282ec[_0xacb3('0x36')]:_0x1918fe[_0xacb3('0x32')];if(_0x848e86[_0xacb3('0x33')]['includeAll']){_0x3282ec['include']=[{'all':!![]}];}_0x3282ec=_[_0xacb3('0x43')]({},_0x3282ec,_0x848e86[_0xacb3('0x44')]);return db['Disposition'][_0xacb3('0x4c')](_0x3282ec)['then'](handleEntityNotFound(_0x586f55,null))[_0xacb3('0x26')](respondWithResult(_0x586f55,null))[_0xacb3('0x49')](handleError(_0x586f55,null));};exports[_0xacb3('0x4d')]=function(_0x20045d,_0x5c408f){return db[_0xacb3('0x45')][_0xacb3('0x4d')](_0x20045d['body'],{})[_0xacb3('0x26')](function(_0x152222){var _0x19b36e=_0x20045d[_0xacb3('0x4e')][_0xacb3('0x27')]({'plain':!![]});if(!_0x19b36e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19b36e[_0xacb3('0x4f')]===_0xacb3('0x4e')){var _0x4889b0=_0x152222['get']({'plain':!![]});var _0x33aa39=_0xacb3('0x28');return db[_0xacb3('0x50')][_0xacb3('0x4c')]({'where':{'name':_0x33aa39,'userProfileId':_0x19b36e[_0xacb3('0x51')]},'raw':!![]})[_0xacb3('0x26')](function(_0x29da1d){if(_0x29da1d&&_0x29da1d[_0xacb3('0x52')]===0x0){return db[_0xacb3('0x53')][_0xacb3('0x4d')]({'name':_0x4889b0[_0xacb3('0x2c')],'resourceId':_0x4889b0['id'],'type':_0x29da1d['name'],'sectionId':_0x29da1d['id']},{})['then'](function(){return _0x152222;});}else{return _0x152222;}})[_0xacb3('0x49')](function(_0x5bfdd8){logger[_0xacb3('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bfdd8);throw _0x5bfdd8;});}return _0x152222;})[_0xacb3('0x26')](respondWithResult(_0x5c408f,0xc9))['catch'](handleError(_0x5c408f,null));};exports[_0xacb3('0x54')]=function(_0x763f13,_0x472736){if(_0x763f13[_0xacb3('0x55')]['id']){delete _0x763f13[_0xacb3('0x55')]['id'];}return db[_0xacb3('0x45')][_0xacb3('0x4c')]({'where':{'id':_0x763f13[_0xacb3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x472736,null))[_0xacb3('0x26')](saveUpdates(_0x763f13[_0xacb3('0x55')],null))[_0xacb3('0x26')](respondWithResult(_0x472736,null))[_0xacb3('0x49')](handleError(_0x472736,null));};exports[_0xacb3('0x29')]=function(_0x521db3,_0x11edf7){return db['Disposition']['find']({'where':{'id':_0x521db3['params']['id']}})['then'](handleEntityNotFound(_0x11edf7,null))['then'](removeEntity(_0x11edf7,null))[_0xacb3('0x49')](handleError(_0x11edf7,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 03e84a9..64bc89d 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 _0x8fd8=['name_voice','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','Disposition'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x8fd8,0x1c4));var _0x88fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x88fd('0x0'));var util=require(_0x88fd('0x1'));var logger=require(_0x88fd('0x2'))(_0x88fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x88fd('0x4'));var fs=require('fs');var path=require(_0x88fd('0x5'));var rimraf=require(_0x88fd('0x6'));var config=require(_0x88fd('0x7'));var attributes=require(_0x88fd('0x8'));module['exports']=function(_0x5d240d,_0x2908ad){return _0x5d240d['define'](_0x88fd('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x88fd('0xa'),'fields':['name','ListId']},{'unique':!![],'name':_0x88fd('0xb'),'fields':['name',_0x88fd('0xc')]},{'unique':!![],'name':_0x88fd('0xd'),'fields':[_0x88fd('0xe'),_0x88fd('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x88fd('0xe'),_0x88fd('0x10')]},{'unique':!![],'name':_0x88fd('0x11'),'fields':['name',_0x88fd('0x12')]},{'unique':!![],'name':_0x88fd('0x13'),'fields':[_0x88fd('0xe'),_0x88fd('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x88fd('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x10bf=['ListId','name_chat','name_mail','name_sms','SmsAccountId','name_fax','name_openchannel','name_whatsapp','WhatsappAccountId','../../config/logger','moment','path','rimraf','./disposition.attributes','exports','tools_dispositions','name_voice','name'];(function(_0x38fff7,_0x3d2f6f){var _0x335292=function(_0x2c2470){while(--_0x2c2470){_0x38fff7['push'](_0x38fff7['shift']());}};_0x335292(++_0x3d2f6f);}(_0x10bf,0x195));var _0xf10b=function(_0x5876aa,_0x4b790d){_0x5876aa=_0x5876aa-0x0;var _0x3017f3=_0x10bf[_0x5876aa];return _0x3017f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf10b('0x0'))('api');var moment=require(_0xf10b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf10b('0x2'));var rimraf=require(_0xf10b('0x3'));var config=require('../../config/environment');var attributes=require(_0xf10b('0x4'));module[_0xf10b('0x5')]=function(_0x25bea1,_0x18112b){return _0x25bea1['define']('Disposition',attributes,{'tableName':_0xf10b('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf10b('0x7'),'fields':[_0xf10b('0x8'),_0xf10b('0x9')]},{'unique':!![],'name':_0xf10b('0xa'),'fields':[_0xf10b('0x8'),'ChatWebsiteId']},{'unique':!![],'name':_0xf10b('0xb'),'fields':[_0xf10b('0x8'),'MailAccountId']},{'unique':!![],'name':_0xf10b('0xc'),'fields':[_0xf10b('0x8'),_0xf10b('0xd')]},{'unique':!![],'name':_0xf10b('0xe'),'fields':[_0xf10b('0x8'),'FaxAccountId']},{'unique':!![],'name':_0xf10b('0xf'),'fields':[_0xf10b('0x8'),'OpenchannelAccountId']},{'unique':!![],'name':_0xf10b('0x10'),'fields':[_0xf10b('0x8'),_0xf10b('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9e6e215..e1aff38 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(_0x29dbf1,_0x4fabff){var _0x4c6043=function(_0x1a75e0){while(--_0x1a75e0){_0x29dbf1['push'](_0x29dbf1['shift']());}};_0x4c6043(++_0x4fabff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x55cfbc,_0x40fafa){var _0x448c49=function(_0x5731af){while(--_0x5731af){_0x55cfbc['push'](_0x55cfbc['shift']());}};_0x448c49(++_0x40fafa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 3d16d6d..096438b 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 _0x3424=['isAuthenticated','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x33e925,_0x59457d){var _0x28c7e2=function(_0x3cb52d){while(--_0x3cb52d){_0x33e925['push'](_0x33e925['shift']());}};_0x28c7e2(++_0x59457d);}(_0x3424,0x1d2));var _0x4342=function(_0x56c342,_0x313cc8){_0x56c342=_0x56c342-0x0;var _0x22b241=_0x3424[_0x56c342];return _0x22b241;};'use strict';var multer=require(_0x4342('0x0'));var util=require(_0x4342('0x1'));var path=require(_0x4342('0x2'));var timeout=require(_0x4342('0x3'));var express=require(_0x4342('0x4'));var router=express[_0x4342('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4342('0x6'));var interaction=require(_0x4342('0x7'));var config=require(_0x4342('0x8'));var controller=require('./disposition.controller');router[_0x4342('0x9')]('/',auth[_0x4342('0xa')](),controller['index']);router['get'](_0x4342('0xb'),auth['isAuthenticated'](),controller[_0x4342('0xc')]);router['post']('/',auth[_0x4342('0xa')](),controller[_0x4342('0xd')]);router[_0x4342('0xe')](_0x4342('0xb'),auth[_0x4342('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4342('0xf')]);module[_0x4342('0x10')]=router; \ No newline at end of file +var _0x8f2d=['put','update','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4fb749,_0x456e5a){var _0x5cd0eb=function(_0x33fddf){while(--_0x33fddf){_0x4fb749['push'](_0x4fb749['shift']());}};_0x5cd0eb(++_0x456e5a);}(_0x8f2d,0x8c));var _0xd8f2=function(_0x294e7d,_0x4e7cfd){_0x294e7d=_0x294e7d-0x0;var _0x4db509=_0x8f2d[_0x294e7d];return _0x4db509;};'use strict';var multer=require(_0xd8f2('0x0'));var util=require(_0xd8f2('0x1'));var path=require('path');var timeout=require(_0xd8f2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd8f2('0x3'));var auth=require(_0xd8f2('0x4'));var interaction=require(_0xd8f2('0x5'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xd8f2('0x6')]('/',auth[_0xd8f2('0x7')](),controller[_0xd8f2('0x8')]);router[_0xd8f2('0x6')](_0xd8f2('0x9'),auth[_0xd8f2('0x7')](),controller[_0xd8f2('0xa')]);router[_0xd8f2('0xb')]('/',auth[_0xd8f2('0x7')](),controller[_0xd8f2('0xc')]);router[_0xd8f2('0xd')](_0xd8f2('0x9'),auth['isAuthenticated'](),controller[_0xd8f2('0xe')]);router[_0xd8f2('0xf')]('/:id',auth[_0xd8f2('0x7')](),controller[_0xd8f2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 8970e4a..f7ad572 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 _0x2d4d=['STRING','ENUM','yes','localstationid','2400','7200','9600','12000','14400','4800','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x2d4d,0x1ed));var _0xd2d4=function(_0x3a205e,_0x9cc94e){_0x3a205e=_0x3a205e-0x0;var _0x3437ba=_0x2d4d[_0x3a205e];return _0x3437ba;};'use strict';var Sequelize=require(_0xd2d4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2d4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd2d4('0x1')]},'ecm':{'type':Sequelize[_0xd2d4('0x2')](_0xd2d4('0x3'),'no'),'defaultValue':_0xd2d4('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd2d4('0x1')],'unique':_0xd2d4('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xd2d4('0x5'),'4800',_0xd2d4('0x6'),_0xd2d4('0x7'),_0xd2d4('0x8'),_0xd2d4('0x9')),'defaultValue':_0xd2d4('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0xd2d4('0x5'),_0xd2d4('0xa'),_0xd2d4('0x6'),_0xd2d4('0x7'),_0xd2d4('0x8'),_0xd2d4('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xd2d4('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xd2d4('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd2d4('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd2d4('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xd2d4('0xc'),'IAX',_0xd2d4('0xd'),_0xd2d4('0xe')),'defaultValue':_0xd2d4('0xc')},'key':{'type':Sequelize[_0xd2d4('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd2d4('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd2d4('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd2d4('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd2d4('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd2d4('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd2d4('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd2d4('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd2d4('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xd2d4('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xd2d4('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a256e){if(!_0x2a256e)this[_0xd2d4('0x12')]('mandatoryDispositionPauseId',null);this[_0xd2d4('0x12')]('mandatoryDisposition',_0x2a256e);}}}; \ No newline at end of file +var _0x6bef=['DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','IAX'];(function(_0x4a0ae2,_0x4930df){var _0x3986a6=function(_0xd8c3cf){while(--_0xd8c3cf){_0x4a0ae2['push'](_0x4a0ae2['shift']());}};_0x3986a6(++_0x4930df);}(_0x6bef,0x16b));var _0xf6be=function(_0x432c59,_0x4fe34d){_0x432c59=_0x432c59-0x0;var _0x164154=_0x6bef[_0x432c59];return _0x164154;};'use strict';var Sequelize=require(_0xf6be('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6be('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf6be('0x1')]},'ecm':{'type':Sequelize[_0xf6be('0x2')](_0xf6be('0x3'),'no'),'defaultValue':_0xf6be('0x3')},'headerinfo':{'type':Sequelize[_0xf6be('0x1')],'defaultValue':_0xf6be('0x4')},'localstationid':{'type':Sequelize[_0xf6be('0x1')],'unique':_0xf6be('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xf6be('0x6'),_0xf6be('0x7'),'7200','9600','12000','14400'),'defaultValue':_0xf6be('0x7')},'maxrate':{'type':Sequelize[_0xf6be('0x2')](_0xf6be('0x6'),_0xf6be('0x7'),_0xf6be('0x8'),_0xf6be('0x9'),_0xf6be('0xa'),_0xf6be('0xb')),'defaultValue':_0xf6be('0xb')},'modem':{'type':Sequelize[_0xf6be('0x1')],'defaultValue':_0xf6be('0xc')},'gateway':{'type':Sequelize[_0xf6be('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf6be('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0xf6be('0xe'),_0xf6be('0xf'),_0xf6be('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xf6be('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf6be('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf6be('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf6be('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf6be('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf6be('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf6be('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf6be('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf6be('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf6be('0x14'),'set':function(_0x3cd9cd){if(!_0x3cd9cd)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x3cd9cd);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3e2a6d7..9f7d33d 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 _0xd9e8=['sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','priority','push','Set','ecm','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','/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','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','SendFax','SendFaxRpc,\x20%s','addAgents','omit','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','ids','getInteractions','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications'];(function(_0x1b6328,_0x523313){var _0x18b5df=function(_0x437a9f){while(--_0x437a9f){_0x1b6328['push'](_0x1b6328['shift']());}};_0x18b5df(++_0x523313);}(_0xd9e8,0x104));var _0x8d9e=function(_0x74fae0,_0x4f9ac4){_0x74fae0=_0x74fae0-0x0;var _0x237f92=_0xd9e8[_0x74fae0];return _0x237f92;};'use strict';var emlformat=require(_0x8d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d9e('0x1'));var jsonpatch=require(_0x8d9e('0x2'));var rp=require(_0x8d9e('0x3'));var moment=require(_0x8d9e('0x4'));var BPromise=require(_0x8d9e('0x5'));var Mustache=require(_0x8d9e('0x6'));var util=require(_0x8d9e('0x7'));var path=require(_0x8d9e('0x8'));var sox=require(_0x8d9e('0x9'));var csv=require(_0x8d9e('0xa'));var ejs=require(_0x8d9e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d9e('0xc'));var squel=require(_0x8d9e('0xd'));var crypto=require(_0x8d9e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8d9e('0xf'));var toCsv=require(_0x8d9e('0xa'));var querystring=require(_0x8d9e('0x10'));var Papa=require(_0x8d9e('0x11'));var Redis=require(_0x8d9e('0x12'));var authService=require(_0x8d9e('0x13'));var qs=require(_0x8d9e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d9e('0x15'));var logger=require(_0x8d9e('0x16'))('api');var utils=require(_0x8d9e('0x17'));var config=require(_0x8d9e('0x18'));var licenseUtil=require(_0x8d9e('0x19'));var db=require('../../mysqldb')['db'];config[_0x8d9e('0x1a')]=_[_0x8d9e('0x1b')](config[_0x8d9e('0x1a')],{'host':_0x8d9e('0x1c'),'port':0x18eb});var socket=require(_0x8d9e('0x1d'))(new Redis(config[_0x8d9e('0x1a')]));require('./faxAccount.socket')[_0x8d9e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8d9e('0x1f')][_0x8d9e('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x218575,_0x1353d1,_0x3a1bbe,_0x259a9a){return new BPromise(function(_0x38c3d1,_0x1ce23f){var _0x123dbb=_0x259a9a||client;return _0x123dbb[_0x8d9e('0x21')](_0x218575,_0x3a1bbe)[_0x8d9e('0x22')](function(_0x2f9bae){logger[_0x8d9e('0x23')](_0x8d9e('0x24'),_0x1353d1,_0x8d9e('0x25'));logger[_0x8d9e('0x26')](_0x8d9e('0x27'),_0x1353d1,_0x8d9e('0x25'),JSON['stringify'](_0x2f9bae));if(_0x2f9bae['error']){if(_0x2f9bae[_0x8d9e('0x28')]['code']===0x1f4){logger[_0x8d9e('0x28')](_0x8d9e('0x24'),_0x1353d1,_0x2f9bae['error'][_0x8d9e('0x29')]);return _0x1ce23f(_0x2f9bae[_0x8d9e('0x28')]['message']);}logger['error'](_0x8d9e('0x24'),_0x1353d1,_0x2f9bae['error'][_0x8d9e('0x29')]);return _0x38c3d1(_0x2f9bae[_0x8d9e('0x28')][_0x8d9e('0x29')]);}else{logger[_0x8d9e('0x23')](_0x8d9e('0x24'),_0x1353d1,_0x8d9e('0x25'));_0x38c3d1(_0x2f9bae['result'][_0x8d9e('0x29')]);}})[_0x8d9e('0x2a')](function(_0x30dd2d){logger[_0x8d9e('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1353d1,_0x30dd2d);_0x1ce23f(_0x30dd2d);});});}function respondWithStatusCode(_0x4cba9d,_0xe8cc4c){_0xe8cc4c=_0xe8cc4c||0xcc;return function(_0xc1f965){if(_0xc1f965){return _0x4cba9d[_0x8d9e('0x2b')](_0xe8cc4c);}return _0x4cba9d[_0x8d9e('0x2c')](_0xe8cc4c)[_0x8d9e('0x2d')]();};}function respondWithResult(_0x370117,_0x12385f){_0x12385f=_0x12385f||0xc8;return function(_0x224720){if(_0x224720){return _0x370117[_0x8d9e('0x2c')](_0x12385f)[_0x8d9e('0x2e')](_0x224720);}};}function respondWithFilteredResult(_0xecf00f,_0x5f0c17){return function(_0x2613e9){if(_0x2613e9){var _0x404012=typeof _0x5f0c17['offset']===_0x8d9e('0x2f')&&typeof _0x5f0c17[_0x8d9e('0x30')]===_0x8d9e('0x2f');var _0x234873=_0x2613e9[_0x8d9e('0x31')];var _0x1d7877=_0x404012?0x0:_0x5f0c17[_0x8d9e('0x32')];var _0x434afb=_0x404012?_0x2613e9[_0x8d9e('0x31')]:_0x5f0c17[_0x8d9e('0x32')]+_0x5f0c17['limit'];var _0x1a7ac9;if(_0x434afb>=_0x234873){_0x434afb=_0x234873;_0x1a7ac9=0xc8;}else{_0x1a7ac9=0xce;}_0xecf00f[_0x8d9e('0x2c')](_0x1a7ac9);return _0xecf00f[_0x8d9e('0x33')](_0x8d9e('0x34'),_0x1d7877+'-'+_0x434afb+'/'+_0x234873)['json'](_0x2613e9);}return null;};}function patchUpdates(_0xee4dab){return function(_0x58f08){try{jsonpatch[_0x8d9e('0x35')](_0x58f08,_0xee4dab,!![]);}catch(_0x197e59){return BPromise[_0x8d9e('0x36')](_0x197e59);}return _0x58f08[_0x8d9e('0x37')]();};}function saveUpdates(_0x544597,_0x249b18){return function(_0x1bc459){if(_0x1bc459){return _0x1bc459['update'](_0x544597)['then'](function(_0x9e140f){return _0x9e140f;});}return null;};}function removeEntity(_0x4eddbe,_0xa9e35b){return function(_0x26d6f5){if(_0x26d6f5){return _0x26d6f5[_0x8d9e('0x38')]()['then'](function(){var _0x364ed0=_0x26d6f5[_0x8d9e('0x39')]({'plain':!![]});var _0x541d70='FaxAccounts';return db[_0x8d9e('0x3a')][_0x8d9e('0x38')]({'where':{'type':_0x541d70,'resourceId':_0x364ed0['id']}})[_0x8d9e('0x22')](function(){return _0x26d6f5;});})[_0x8d9e('0x22')](function(){_0x4eddbe[_0x8d9e('0x2c')](0xcc)[_0x8d9e('0x2d')]();});}};}function handleEntityNotFound(_0x2ed27c,_0x307b34){return function(_0x38ddb4){if(!_0x38ddb4){_0x2ed27c['sendStatus'](0x194);}return _0x38ddb4;};}function handleError(_0x367b6e,_0x522403){_0x522403=_0x522403||0x1f4;return function(_0x1599e5){logger['error'](_0x1599e5[_0x8d9e('0x3b')]);if(_0x1599e5[_0x8d9e('0x3c')]){delete _0x1599e5[_0x8d9e('0x3c')];}_0x367b6e['status'](_0x522403)['send'](_0x1599e5);};}exports['index']=function(_0x39caf4,_0x68d8ef){var _0x33807b={'include':[{'model':db[_0x8d9e('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1e9ba1={},_0x3bfd68={'count':0x0,'rows':[]};var _0x165095=_[_0x8d9e('0x3e')](db[_0x8d9e('0x3f')][_0x8d9e('0x40')],function(_0x144f16){return{'name':_0x144f16[_0x8d9e('0x41')],'type':_0x144f16[_0x8d9e('0x42')][_0x8d9e('0x43')]};});_0x1e9ba1[_0x8d9e('0x44')]=_['map'](_0x165095,'name');_0x1e9ba1['query']=_[_0x8d9e('0x45')](_0x39caf4[_0x8d9e('0x46')]);_0x1e9ba1[_0x8d9e('0x47')]=_[_0x8d9e('0x48')](_0x1e9ba1[_0x8d9e('0x44')],_0x1e9ba1['query']);_0x33807b['attributes']=_['intersection'](_0x1e9ba1[_0x8d9e('0x44')],qs[_0x8d9e('0x49')](_0x39caf4['query'][_0x8d9e('0x49')]));_0x33807b['attributes']=_0x33807b[_0x8d9e('0x4a')][_0x8d9e('0x4b')]?_0x33807b[_0x8d9e('0x4a')]:_0x1e9ba1['model'];if(!_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x4c')](_0x8d9e('0x4d'))){_0x33807b[_0x8d9e('0x30')]=qs[_0x8d9e('0x30')](_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x30')]);_0x33807b[_0x8d9e('0x32')]=qs[_0x8d9e('0x32')](_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x32')]);}_0x33807b[_0x8d9e('0x4e')]=qs[_0x8d9e('0x4f')](_0x39caf4['query'][_0x8d9e('0x4f')]);_0x33807b[_0x8d9e('0x50')]=qs['filters'](_[_0x8d9e('0x51')](_0x39caf4['query'],_0x1e9ba1['filters']),_0x165095);if(_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x52')]){_0x33807b['where']=_[_0x8d9e('0x53')](_0x33807b[_0x8d9e('0x50')],{'$or':_[_0x8d9e('0x3e')](_0x165095,function(_0xb0a8be){if(_0xb0a8be['type']!==_0x8d9e('0x54')){var _0x2fff83={};_0x2fff83[_0xb0a8be[_0x8d9e('0x3c')]]={'$like':'%'+_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x52')]+'%'};return _0x2fff83;}})});}_0x33807b=_['merge']({},_0x33807b,_0x39caf4[_0x8d9e('0x55')]);var _0x4df1c4={'where':_0x33807b[_0x8d9e('0x50')]};return db[_0x8d9e('0x3f')][_0x8d9e('0x31')](_0x4df1c4)[_0x8d9e('0x22')](function(_0x485ed2){_0x3bfd68[_0x8d9e('0x31')]=_0x485ed2;if(_0x39caf4[_0x8d9e('0x46')][_0x8d9e('0x56')]){_0x33807b[_0x8d9e('0x57')]=[{'all':!![]}];}return db[_0x8d9e('0x3f')][_0x8d9e('0x58')](_0x33807b);})[_0x8d9e('0x22')](function(_0x5b9ee5){_0x3bfd68[_0x8d9e('0x59')]=_0x5b9ee5;return _0x3bfd68;})[_0x8d9e('0x22')](respondWithFilteredResult(_0x68d8ef,_0x33807b))['catch'](handleError(_0x68d8ef,null));};exports['show']=function(_0x101c51,_0x40d2b3){var _0x5256cc={'raw':![],'where':{'id':_0x101c51[_0x8d9e('0x5a')]['id']},'include':[{'model':db[_0x8d9e('0x3d')],'as':_0x8d9e('0x5b')}]},_0x320fa0={};_0x320fa0['model']=_[_0x8d9e('0x45')](db[_0x8d9e('0x3f')][_0x8d9e('0x40')]);_0x320fa0[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x101c51[_0x8d9e('0x46')]);_0x320fa0['filters']=_[_0x8d9e('0x48')](_0x320fa0['model'],_0x320fa0['query']);_0x5256cc[_0x8d9e('0x4a')]=_[_0x8d9e('0x48')](_0x320fa0[_0x8d9e('0x44')],qs[_0x8d9e('0x49')](_0x101c51['query'][_0x8d9e('0x49')]));_0x5256cc[_0x8d9e('0x4a')]=_0x5256cc[_0x8d9e('0x4a')]['length']?_0x5256cc[_0x8d9e('0x4a')]:_0x320fa0[_0x8d9e('0x44')];if(_0x101c51[_0x8d9e('0x46')][_0x8d9e('0x56')]){_0x5256cc[_0x8d9e('0x57')]=[{'all':!![]}];}_0x5256cc=_[_0x8d9e('0x53')]({},_0x5256cc,_0x101c51[_0x8d9e('0x55')]);return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')](_0x5256cc)['then'](handleEntityNotFound(_0x40d2b3,null))[_0x8d9e('0x22')](respondWithResult(_0x40d2b3,null))[_0x8d9e('0x2a')](handleError(_0x40d2b3,null));};exports['create']=function(_0x6cbb90,_0x2cfea4){return db[_0x8d9e('0x3f')][_0x8d9e('0x5d')](_0x6cbb90[_0x8d9e('0x5e')],{})[_0x8d9e('0x22')](function(_0x39a054){var _0x5b0273=_0x6cbb90[_0x8d9e('0x5f')][_0x8d9e('0x39')]({'plain':!![]});if(!_0x5b0273)throw new Error(_0x8d9e('0x60'));if(_0x5b0273[_0x8d9e('0x61')]==='user'){var _0x5d9655=_0x39a054[_0x8d9e('0x39')]({'plain':!![]});var _0x1656db=_0x8d9e('0x62');return db['UserProfileSection'][_0x8d9e('0x5c')]({'where':{'name':_0x1656db,'userProfileId':_0x5b0273[_0x8d9e('0x63')]},'raw':!![]})[_0x8d9e('0x22')](function(_0x176417){if(_0x176417&&_0x176417[_0x8d9e('0x64')]===0x0){return db[_0x8d9e('0x3a')][_0x8d9e('0x5d')]({'name':_0x5d9655[_0x8d9e('0x3c')],'resourceId':_0x5d9655['id'],'type':_0x176417[_0x8d9e('0x3c')],'sectionId':_0x176417['id']},{})[_0x8d9e('0x22')](function(){return _0x39a054;});}else{return _0x39a054;}})[_0x8d9e('0x2a')](function(_0x2f68b4){logger[_0x8d9e('0x28')](_0x8d9e('0x65'),_0x2f68b4);throw _0x2f68b4;});}return _0x39a054;})[_0x8d9e('0x22')](respondWithResult(_0x2cfea4,0xc9))[_0x8d9e('0x2a')](handleError(_0x2cfea4,null));};exports[_0x8d9e('0x66')]=function(_0x225f67,_0x4e7e3f){if(_0x225f67[_0x8d9e('0x5e')]['id']){delete _0x225f67[_0x8d9e('0x5e')]['id'];}return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')]({'where':{'id':_0x225f67['params']['id']},'include':[{'model':db['Pause'],'as':_0x8d9e('0x5b')}]})[_0x8d9e('0x22')](handleEntityNotFound(_0x4e7e3f,null))['then'](saveUpdates(_0x225f67[_0x8d9e('0x5e')],null))[_0x8d9e('0x22')](respondWithResult(_0x4e7e3f,null))[_0x8d9e('0x2a')](handleError(_0x4e7e3f,null));};exports[_0x8d9e('0x38')]=function(_0x1a17b7,_0x4a3195){return db['FaxAccount'][_0x8d9e('0x5c')]({'where':{'id':_0x1a17b7[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x4a3195,null))[_0x8d9e('0x22')](removeEntity(_0x4a3195,null))['catch'](handleError(_0x4a3195,null));};exports[_0x8d9e('0x67')]=function(_0xadf20b,_0x2fd8e0){return db['FaxAccount'][_0x8d9e('0x67')]()['then'](respondWithResult(_0x2fd8e0,null))[_0x8d9e('0x2a')](handleError(_0x2fd8e0,null));};exports['addDisposition']=function(_0x1b8a02,_0x5af423,_0x4817cf){if(_0x1b8a02['body']['id']){delete _0x1b8a02['body']['id'];}return db['FaxAccount'][_0x8d9e('0x5c')]({'where':{'id':_0x1b8a02[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x5af423,null))[_0x8d9e('0x22')](function(_0xd91417){if(_0xd91417){_0x1b8a02[_0x8d9e('0x5e')][_0x8d9e('0x68')]=_0xd91417['id'];return db[_0x8d9e('0x69')][_0x8d9e('0x5d')](_0x1b8a02[_0x8d9e('0x5e')]);}})[_0x8d9e('0x22')](respondWithResult(_0x5af423,null))[_0x8d9e('0x2a')](handleError(_0x5af423,null));};exports[_0x8d9e('0x6a')]=function(_0x2b30bc,_0x1c1f23,_0x4ae358){var _0x15cb4={'raw':![],'where':{}};var _0x1f753c={};var _0x453a4a={'count':0x0,'rows':[]};return db[_0x8d9e('0x3f')][_0x8d9e('0x6b')]({'where':{'id':_0x2b30bc[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c1f23,null))[_0x8d9e('0x22')](function(_0x4d20ae){if(_0x4d20ae){_0x1f753c['model']=_[_0x8d9e('0x45')](db[_0x8d9e('0x69')][_0x8d9e('0x40')]);_0x1f753c[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x2b30bc[_0x8d9e('0x46')]);_0x1f753c[_0x8d9e('0x47')]=_[_0x8d9e('0x48')](_0x1f753c[_0x8d9e('0x44')],_0x1f753c[_0x8d9e('0x46')]);_0x15cb4[_0x8d9e('0x4a')]=_[_0x8d9e('0x48')](_0x1f753c['model'],qs[_0x8d9e('0x49')](_0x2b30bc[_0x8d9e('0x46')]['fields']));_0x15cb4[_0x8d9e('0x4a')]=_0x15cb4[_0x8d9e('0x4a')][_0x8d9e('0x4b')]?_0x15cb4[_0x8d9e('0x4a')]:_0x1f753c[_0x8d9e('0x44')];if(!_0x2b30bc[_0x8d9e('0x46')]['hasOwnProperty'](_0x8d9e('0x4d'))){_0x15cb4[_0x8d9e('0x30')]=qs[_0x8d9e('0x30')](_0x2b30bc[_0x8d9e('0x46')][_0x8d9e('0x30')]);_0x15cb4[_0x8d9e('0x32')]=qs['offset'](_0x2b30bc[_0x8d9e('0x46')][_0x8d9e('0x32')]);}_0x15cb4[_0x8d9e('0x4e')]=qs[_0x8d9e('0x4f')](_0x2b30bc['query'][_0x8d9e('0x4f')]);_0x15cb4[_0x8d9e('0x50')]=qs[_0x8d9e('0x47')](_[_0x8d9e('0x51')](_0x2b30bc[_0x8d9e('0x46')],_0x1f753c[_0x8d9e('0x47')]));_0x15cb4['where'][_0x8d9e('0x68')]=_0x4d20ae['id'];if(_0x2b30bc[_0x8d9e('0x46')][_0x8d9e('0x52')]){_0x15cb4[_0x8d9e('0x50')]=_[_0x8d9e('0x53')](_0x15cb4['where'],{'$or':_[_0x8d9e('0x3e')](_0x15cb4[_0x8d9e('0x4a')],function(_0x155639){var _0x4160be={};_0x4160be[_0x155639]={'$like':'%'+_0x2b30bc[_0x8d9e('0x46')][_0x8d9e('0x52')]+'%'};return _0x4160be;})});}_0x15cb4=_[_0x8d9e('0x53')]({},_0x15cb4,_0x2b30bc[_0x8d9e('0x55')]);return db[_0x8d9e('0x69')][_0x8d9e('0x31')]({'where':_0x15cb4[_0x8d9e('0x50')]})['then'](function(_0x556013){_0x453a4a[_0x8d9e('0x31')]=_0x556013;if(_0x2b30bc[_0x8d9e('0x46')][_0x8d9e('0x56')]){_0x15cb4[_0x8d9e('0x57')]=[{'all':!![]}];}return db[_0x8d9e('0x69')][_0x8d9e('0x58')](_0x15cb4);})['then'](function(_0x45483b){_0x453a4a[_0x8d9e('0x59')]=_0x45483b;return _0x453a4a;});}})[_0x8d9e('0x22')](respondWithFilteredResult(_0x1c1f23,_0x15cb4))[_0x8d9e('0x2a')](handleError(_0x1c1f23,null));};exports[_0x8d9e('0x6c')]=function(_0x4c7adf,_0xfa8806,_0x3472a8){return db[_0x8d9e('0x3f')]['find']({'where':{'id':_0x4c7adf['params']['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0xfa8806,null))[_0x8d9e('0x22')](function(_0x497aae){if(_0x497aae){return _0x497aae[_0x8d9e('0x6c')](_0x4c7adf['query']['ids']);}})[_0x8d9e('0x22')](respondWithStatusCode(_0xfa8806,null))[_0x8d9e('0x2a')](handleError(_0xfa8806,null));};exports[_0x8d9e('0x6d')]=function(_0x4c1074,_0x1cc4e4,_0xdcb9a3){if(_0x4c1074[_0x8d9e('0x5e')]['id']){delete _0x4c1074[_0x8d9e('0x5e')]['id'];}return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')]({'where':{'id':_0x4c1074[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x1cc4e4,null))[_0x8d9e('0x22')](function(_0x1f5b31){if(_0x1f5b31){_0x4c1074['body'][_0x8d9e('0x68')]=_0x1f5b31['id'];return db[_0x8d9e('0x6e')][_0x8d9e('0x5d')](_0x4c1074[_0x8d9e('0x5e')]);}})[_0x8d9e('0x22')](respondWithResult(_0x1cc4e4,null))[_0x8d9e('0x2a')](handleError(_0x1cc4e4,null));};exports[_0x8d9e('0x6f')]=function(_0x3b4a27,_0x1921f2,_0x29ee1e){var _0x13200f={'raw':![],'where':{}};var _0x5a4c05={};var _0x2f133a={'count':0x0,'rows':[]};return db[_0x8d9e('0x3f')]['findOne']({'where':{'id':_0x3b4a27[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x1921f2,null))[_0x8d9e('0x22')](function(_0x57e16d){if(_0x57e16d){_0x5a4c05[_0x8d9e('0x44')]=_['keys'](db[_0x8d9e('0x6e')][_0x8d9e('0x40')]);_0x5a4c05[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x3b4a27[_0x8d9e('0x46')]);_0x5a4c05[_0x8d9e('0x47')]=_[_0x8d9e('0x48')](_0x5a4c05['model'],_0x5a4c05[_0x8d9e('0x46')]);_0x13200f[_0x8d9e('0x4a')]=_[_0x8d9e('0x48')](_0x5a4c05['model'],qs[_0x8d9e('0x49')](_0x3b4a27[_0x8d9e('0x46')]['fields']));_0x13200f[_0x8d9e('0x4a')]=_0x13200f[_0x8d9e('0x4a')]['length']?_0x13200f[_0x8d9e('0x4a')]:_0x5a4c05['model'];if(!_0x3b4a27[_0x8d9e('0x46')][_0x8d9e('0x4c')](_0x8d9e('0x4d'))){_0x13200f['limit']=qs[_0x8d9e('0x30')](_0x3b4a27[_0x8d9e('0x46')][_0x8d9e('0x30')]);_0x13200f[_0x8d9e('0x32')]=qs[_0x8d9e('0x32')](_0x3b4a27['query'][_0x8d9e('0x32')]);}_0x13200f[_0x8d9e('0x4e')]=qs['sort'](_0x3b4a27[_0x8d9e('0x46')][_0x8d9e('0x4f')]);_0x13200f[_0x8d9e('0x50')]=qs[_0x8d9e('0x47')](_[_0x8d9e('0x51')](_0x3b4a27[_0x8d9e('0x46')],_0x5a4c05[_0x8d9e('0x47')]));_0x13200f[_0x8d9e('0x50')][_0x8d9e('0x68')]=_0x57e16d['id'];if(_0x3b4a27['query'][_0x8d9e('0x52')]){_0x13200f['where']=_[_0x8d9e('0x53')](_0x13200f[_0x8d9e('0x50')],{'$or':_[_0x8d9e('0x3e')](_0x13200f[_0x8d9e('0x4a')],function(_0x1afb95){var _0x104d4f={};_0x104d4f[_0x1afb95]={'$like':'%'+_0x3b4a27['query'][_0x8d9e('0x52')]+'%'};return _0x104d4f;})});}_0x13200f=_[_0x8d9e('0x53')]({},_0x13200f,_0x3b4a27[_0x8d9e('0x55')]);return db[_0x8d9e('0x6e')][_0x8d9e('0x31')]({'where':_0x13200f['where']})[_0x8d9e('0x22')](function(_0xa8e7f1){_0x2f133a[_0x8d9e('0x31')]=_0xa8e7f1;if(_0x3b4a27['query'][_0x8d9e('0x56')]){_0x13200f[_0x8d9e('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8d9e('0x58')](_0x13200f);})[_0x8d9e('0x22')](function(_0x6a3d37){_0x2f133a[_0x8d9e('0x59')]=_0x6a3d37;return _0x2f133a;});}})[_0x8d9e('0x22')](respondWithFilteredResult(_0x1921f2,_0x13200f))['catch'](handleError(_0x1921f2,null));};exports['removeAnswers']=function(_0x397554,_0x55bb4c,_0x3dfeb7){return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')]({'where':{'id':_0x397554[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x55bb4c,null))[_0x8d9e('0x22')](function(_0x1c2b2d){if(_0x1c2b2d){return _0x1c2b2d[_0x8d9e('0x70')](_0x397554[_0x8d9e('0x46')]['ids']);}})[_0x8d9e('0x22')](respondWithStatusCode(_0x55bb4c,null))['catch'](handleError(_0x55bb4c,null));};exports[_0x8d9e('0x71')]=function(_0x3d3ebe,_0x1e533b,_0x41b95f){return db[_0x8d9e('0x72')][_0x8d9e('0x5c')]({'where':{'id':_0x3d3ebe['params']['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x1e533b,null))[_0x8d9e('0x22')](function(_0x4ee842){if(_0x4ee842){return _0x4ee842[_0x8d9e('0x71')](_0x3d3ebe['body'][_0x8d9e('0x73')],_['omit'](_0x3d3ebe['body'],[_0x8d9e('0x73'),'id'])||{});}})[_0x8d9e('0x22')](respondWithResult(_0x1e533b,null))[_0x8d9e('0x2a')](handleError(_0x1e533b,null));};exports[_0x8d9e('0x74')]=function(_0x1c79b4,_0xe4a40f,_0x54cc0f){var _0x3c84ce={'raw':![],'where':{}};var _0x1a5fc4={};var _0x106b27={'count':0x0,'rows':[]};return db[_0x8d9e('0x3f')]['findOne']({'where':{'id':_0x1c79b4[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe4a40f,null))['then'](function(_0xd66b80){if(_0xd66b80){_0x1a5fc4[_0x8d9e('0x44')]=_[_0x8d9e('0x45')](db[_0x8d9e('0x72')][_0x8d9e('0x40')]);_0x1a5fc4[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x1c79b4[_0x8d9e('0x46')]);_0x1a5fc4[_0x8d9e('0x47')]=_[_0x8d9e('0x48')](_0x1a5fc4[_0x8d9e('0x44')],_0x1a5fc4[_0x8d9e('0x46')]);_0x3c84ce[_0x8d9e('0x4a')]=_[_0x8d9e('0x48')](_0x1a5fc4[_0x8d9e('0x44')],qs['fields'](_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x49')]));_0x3c84ce[_0x8d9e('0x4a')]=_0x3c84ce[_0x8d9e('0x4a')][_0x8d9e('0x4b')]?_0x3c84ce['attributes']:_0x1a5fc4[_0x8d9e('0x44')];if(!_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x4c')](_0x8d9e('0x4d'))){_0x3c84ce[_0x8d9e('0x30')]=qs[_0x8d9e('0x30')](_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x30')]);_0x3c84ce['offset']=qs[_0x8d9e('0x32')](_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x32')]);}_0x3c84ce[_0x8d9e('0x4e')]=qs[_0x8d9e('0x4f')](_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x4f')]);_0x3c84ce[_0x8d9e('0x50')]=qs[_0x8d9e('0x47')](_[_0x8d9e('0x51')](_0x1c79b4['query'],_0x1a5fc4[_0x8d9e('0x47')]));_0x3c84ce['where'][_0x8d9e('0x68')]=_0xd66b80['id'];if(_0x1c79b4['query'][_0x8d9e('0x52')]){_0x3c84ce['where']=_['merge'](_0x3c84ce[_0x8d9e('0x50')],{'$or':_[_0x8d9e('0x3e')](_0x3c84ce[_0x8d9e('0x4a')],function(_0x3191c5){var _0x48f289={};_0x48f289[_0x3191c5]={'$like':'%'+_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x52')]+'%'};return _0x48f289;})});}_0x3c84ce=_[_0x8d9e('0x53')]({},_0x3c84ce,_0x1c79b4[_0x8d9e('0x55')]);return db[_0x8d9e('0x72')]['count']({'where':_0x3c84ce['where']})[_0x8d9e('0x22')](function(_0x3c6a40){_0x106b27[_0x8d9e('0x31')]=_0x3c6a40;if(_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x56')]){_0x3c84ce['include']=[{'model':db[_0x8d9e('0x75')],'as':_0x8d9e('0x76'),'required':![]},{'model':db['User'],'as':_0x8d9e('0x77'),'attributes':[_0x8d9e('0x3c'),'fullname',_0x8d9e('0x78')],'required':![]},{'model':db[_0x8d9e('0x79')],'as':_0x8d9e('0x7a'),'attributes':['id','name',_0x8d9e('0x7b')],'where':_0x1c79b4['query']['tag']?{'id':_0x1c79b4[_0x8d9e('0x46')][_0x8d9e('0x7c')]}:undefined,'required':_0x1c79b4[_0x8d9e('0x46')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x8d9e('0x58')](_0x3c84ce);})[_0x8d9e('0x22')](function(_0x55d170){_0x106b27['rows']=_0x55d170;return _0x106b27;});}})[_0x8d9e('0x22')](respondWithFilteredResult(_0xe4a40f,_0x3c84ce))[_0x8d9e('0x2a')](handleError(_0xe4a40f,null));};exports[_0x8d9e('0x7d')]=function(_0x439b63,_0x476995,_0x49bdd1){return db[_0x8d9e('0x3f')][_0x8d9e('0x6b')]({'where':{'id':_0x439b63[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x476995,null))[_0x8d9e('0x22')](function(_0x19c1cd){if(_0x19c1cd){return db[_0x8d9e('0x7e')][_0x8d9e('0x7f')](function(_0x12c8ff){return db[_0x8d9e('0x80')]['destroy']({'where':{'FaxAccountId':_0x439b63['params']['id']},'transaction':_0x12c8ff})[_0x8d9e('0x22')](function(_0x11b6cf){var _0x156ed7=_[_0x8d9e('0x3e')](_0x439b63[_0x8d9e('0x5e')],function(_0x349e7e){_0x349e7e[_0x8d9e('0x68')]=_0x439b63[_0x8d9e('0x5a')]['id'];return _0x349e7e;});return db[_0x8d9e('0x80')][_0x8d9e('0x81')](_0x156ed7,{'transaction':_0x12c8ff});});})['then'](function(){return db[_0x8d9e('0x80')][_0x8d9e('0x82')]({'where':{'FaxAccountId':_0x439b63['params']['id']},'order':'priority'});});}})[_0x8d9e('0x22')](respondWithResult(_0x476995,null))[_0x8d9e('0x2a')](handleError(_0x476995,null));};exports[_0x8d9e('0x83')]=function(_0x10ee1b,_0x5bc59e,_0x2e5678){var _0x3ebd6a={};var _0x33d4e8={};var _0x545f6e;var _0x33aa3;return db[_0x8d9e('0x3f')][_0x8d9e('0x6b')]({'where':{'id':_0x10ee1b['params']['id']}})['then'](handleEntityNotFound(_0x5bc59e,null))[_0x8d9e('0x22')](function(_0x55f78b){if(_0x55f78b){_0x545f6e=_0x55f78b;_0x33d4e8['model']=_[_0x8d9e('0x45')](db[_0x8d9e('0x80')][_0x8d9e('0x40')]);_0x33d4e8[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x10ee1b['query']);_0x33d4e8[_0x8d9e('0x47')]=_['intersection'](_0x33d4e8['model'],_0x33d4e8[_0x8d9e('0x46')]);_0x3ebd6a['attributes']=_[_0x8d9e('0x48')](_0x33d4e8['model'],qs[_0x8d9e('0x49')](_0x10ee1b[_0x8d9e('0x46')][_0x8d9e('0x49')]));_0x3ebd6a['attributes']=_0x3ebd6a[_0x8d9e('0x4a')]['length']?_0x3ebd6a[_0x8d9e('0x4a')]:_0x33d4e8[_0x8d9e('0x44')];_0x3ebd6a[_0x8d9e('0x4e')]=qs[_0x8d9e('0x4f')](_0x10ee1b[_0x8d9e('0x46')][_0x8d9e('0x4f')]);_0x3ebd6a['where']=qs['filters'](_[_0x8d9e('0x51')](_0x10ee1b[_0x8d9e('0x46')],_0x33d4e8[_0x8d9e('0x47')]));if(_0x10ee1b['query'][_0x8d9e('0x52')]){_0x3ebd6a[_0x8d9e('0x50')]=_[_0x8d9e('0x53')](_0x3ebd6a[_0x8d9e('0x50')],{'$or':_['map'](_0x3ebd6a['attributes'],function(_0x35f8a6){var _0x11c398={};_0x11c398[_0x35f8a6]={'$like':'%'+_0x10ee1b[_0x8d9e('0x46')]['filter']+'%'};return _0x11c398;})});}_0x3ebd6a=_[_0x8d9e('0x53')]({},_0x3ebd6a,_0x10ee1b[_0x8d9e('0x55')]);return _0x545f6e['getApplications'](_0x3ebd6a);}})[_0x8d9e('0x22')](function(_0x2ce8a1){if(_0x2ce8a1){_0x33aa3=_0x2ce8a1[_0x8d9e('0x4b')];if(!_0x10ee1b[_0x8d9e('0x46')][_0x8d9e('0x4c')](_0x8d9e('0x4d'))){_0x3ebd6a['limit']=qs[_0x8d9e('0x30')](_0x10ee1b[_0x8d9e('0x46')][_0x8d9e('0x30')]);_0x3ebd6a['offset']=qs[_0x8d9e('0x32')](_0x10ee1b[_0x8d9e('0x46')][_0x8d9e('0x32')]);}return _0x545f6e[_0x8d9e('0x83')](_0x3ebd6a);}})['then'](function(_0x50d16d){if(_0x50d16d){return _0x50d16d?{'count':_0x33aa3,'rows':_0x50d16d}:null;}})[_0x8d9e('0x22')](respondWithResult(_0x5bc59e,null))[_0x8d9e('0x2a')](handleError(_0x5bc59e,null));};function Extension(_0x8734be,_0x1c50a8,_0x36a23b,_0x3d14e9){this[_0x8d9e('0x84')]=_0x8d9e('0x85');this[_0x8d9e('0x86')]=_0x8734be['localstationid'];this[_0x8d9e('0x87')]=_0x3d14e9;this[_0x8d9e('0x42')]=_0x8d9e('0x88');this[_0x8d9e('0x89')]=_0x8d9e('0x8a');this[_0x8d9e('0x68')]=_0x8734be['id'];this[_0x8d9e('0x8b')]=_0x1c50a8;this['appdata']=_0x36a23b;}function createExtensionsReciveFax(_0x499788){var _0x45d47a=0x1;var _0x2f690f=[];_0x2f690f[_0x8d9e('0x8c')](new Extension(_0x499788,_0x45d47a,'','Answer'));_0x45d47a+=0x1;_0x2f690f['push'](new Extension(_0x499788,_0x45d47a,'CDR(type)=inbound-fax',_0x8d9e('0x8d')));_0x45d47a+=0x1;for(var _0x47402a in _0x499788){if(_0x499788['hasOwnProperty'](_0x47402a)&&(_0x47402a===_0x8d9e('0x8e')||_0x47402a==='localstationid'||_0x47402a==='gateway'||_0x47402a==='faxdetect'||_0x47402a===_0x8d9e('0x8f')||_0x47402a===_0x8d9e('0x90')||_0x47402a===_0x8d9e('0x91')||_0x47402a==='modem'||_0x47402a===_0x8d9e('0x92'))){_0x2f690f[_0x8d9e('0x8c')](new Extension(_0x499788,_0x45d47a,_0x8d9e('0x93')+_0x47402a+')='+_0x499788[_0x47402a],_0x8d9e('0x8d')));_0x45d47a+=0x1;}}_0x2f690f['push'](new Extension(_0x499788,_0x45d47a,'6','Wait'));_0x45d47a+=0x1;_0x2f690f[_0x8d9e('0x8c')](new Extension(_0x499788,_0x45d47a,_0x8d9e('0x94'),_0x8d9e('0x95')));_0x45d47a=0x0;return _0x2f690f;}exports['addAccountApplications']=function(_0xe2acbe,_0x283477,_0x28b456){var _0x4fc0f2;return db[_0x8d9e('0x7e')][_0x8d9e('0x7f')](function(_0x110def){return db['FaxAccount'][_0x8d9e('0x5d')](_0xe2acbe[_0x8d9e('0x5e')],{'transaction':_0x110def})['then'](function(_0x279dc5){_0x4fc0f2=_0x279dc5[_0x8d9e('0x39')]({'plain':!![]});return db[_0x8d9e('0x96')][_0x8d9e('0x81')](createExtensionsReciveFax(_0x4fc0f2),{'transaction':_0x110def});});})[_0x8d9e('0x22')](function(){return _0x4fc0f2;})['then'](respondWithResult(_0x283477,null))[_0x8d9e('0x2a')](handleError(_0x283477,null));};exports[_0x8d9e('0x97')]=function(_0x88258,_0x5e252d,_0x36e173){var _0x157a9f;return db[_0x8d9e('0x7e')]['transaction'](function(_0x2cf182){return db['FaxAccount'][_0x8d9e('0x66')](_0x88258['body'],{'where':{'id':_0x88258[_0x8d9e('0x5e')]['id']},'transaction':_0x2cf182})[_0x8d9e('0x22')](function(_0x4fb9de){return db[_0x8d9e('0x96')]['destroy']({'where':{'FaxAccountId':_0x88258[_0x8d9e('0x5e')]['id']},'transaction':_0x2cf182})[_0x8d9e('0x22')](function(_0x5d0075){return db[_0x8d9e('0x96')][_0x8d9e('0x81')](createExtensionsReciveFax(_['omit'](_0x88258[_0x8d9e('0x5e')],[_0x8d9e('0x98'),'key',_0x8d9e('0x99'),'updatedAt',_0x8d9e('0x9a'),'ListId'])),{'transaction':_0x2cf182});});});})['then'](function(){return db['FaxAccount'][_0x8d9e('0x9b')](_0x88258['body']['id']);})[_0x8d9e('0x22')](respondWithResult(_0x5e252d,null))[_0x8d9e('0x2a')](handleError(_0x5e252d,null));};exports[_0x8d9e('0x9c')]=function(_0x3ed0f6,_0x50e59e,_0x4e1d2f){var _0x2dbf98={'raw':!![],'where':{}};var _0x740d1a={};var _0x5c001c={'count':0x0,'rows':[]};return db[_0x8d9e('0x3f')][_0x8d9e('0x6b')]({'where':{'id':_0x3ed0f6[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x50e59e,null))[_0x8d9e('0x22')](function(_0x4f048b){if(_0x4f048b){_0x740d1a[_0x8d9e('0x44')]=_[_0x8d9e('0x45')](db[_0x8d9e('0x9d')][_0x8d9e('0x40')]);_0x740d1a[_0x8d9e('0x46')]=_['keys'](_0x3ed0f6[_0x8d9e('0x46')]);_0x740d1a[_0x8d9e('0x47')]=_['intersection'](_0x740d1a[_0x8d9e('0x44')],_0x740d1a[_0x8d9e('0x46')]);_0x2dbf98[_0x8d9e('0x4a')]=_[_0x8d9e('0x48')](_0x740d1a['model'],qs[_0x8d9e('0x49')](_0x3ed0f6[_0x8d9e('0x46')][_0x8d9e('0x49')]));_0x2dbf98[_0x8d9e('0x4a')]=_0x2dbf98[_0x8d9e('0x4a')]['length']?_0x2dbf98['attributes']:_0x740d1a['model'];if(!_0x3ed0f6[_0x8d9e('0x46')]['hasOwnProperty'](_0x8d9e('0x4d'))){_0x2dbf98[_0x8d9e('0x30')]=qs[_0x8d9e('0x30')](_0x3ed0f6['query'][_0x8d9e('0x30')]);_0x2dbf98[_0x8d9e('0x32')]=qs['offset'](_0x3ed0f6['query'][_0x8d9e('0x32')]);}_0x2dbf98['order']=qs[_0x8d9e('0x4f')](_0x3ed0f6[_0x8d9e('0x46')][_0x8d9e('0x4f')]);_0x2dbf98[_0x8d9e('0x50')]=qs[_0x8d9e('0x47')](_[_0x8d9e('0x51')](_0x3ed0f6[_0x8d9e('0x46')],_0x740d1a[_0x8d9e('0x47')]));_0x2dbf98[_0x8d9e('0x50')]['FaxAccountId']=_0x4f048b['id'];if(_0x3ed0f6[_0x8d9e('0x46')][_0x8d9e('0x52')]){_0x2dbf98[_0x8d9e('0x50')]=_[_0x8d9e('0x53')](_0x2dbf98[_0x8d9e('0x50')],{'$or':_[_0x8d9e('0x3e')](_0x2dbf98[_0x8d9e('0x4a')],function(_0x37bb3d){var _0x2018bb={};_0x2018bb[_0x37bb3d]={'$like':'%'+_0x3ed0f6[_0x8d9e('0x46')][_0x8d9e('0x52')]+'%'};return _0x2018bb;})});}if(_0x3ed0f6[_0x8d9e('0x46')][_0x8d9e('0x9e')]){var _0x4ae654=_0x3ed0f6[_0x8d9e('0x46')]['$gte'][_0x8d9e('0x9f')](',');var _0x279df8={};_0x279df8[_0x4ae654[0x0]]={'$gte':moment(_0x4ae654[0x1])[_0x8d9e('0xa0')](_0x8d9e('0xa1'))};_0x2dbf98['where']=_['merge'](_0x2dbf98[_0x8d9e('0x50')],_0x279df8);}_0x2dbf98=_['merge']({},_0x2dbf98,_0x3ed0f6[_0x8d9e('0x55')]);return db['FaxMessage']['count']({'where':_0x2dbf98[_0x8d9e('0x50')]})[_0x8d9e('0x22')](function(_0x140f45){_0x5c001c[_0x8d9e('0x31')]=_0x140f45;if(_0x3ed0f6[_0x8d9e('0x46')]['includeAll']){_0x2dbf98[_0x8d9e('0x57')]=[{'all':!![]}];}return db[_0x8d9e('0x9d')]['findAll'](_0x2dbf98);})[_0x8d9e('0x22')](function(_0xbc919e){_0x5c001c[_0x8d9e('0x59')]=_0xbc919e;return _0x5c001c;});}})[_0x8d9e('0x22')](respondWithFilteredResult(_0x50e59e,_0x2dbf98))['catch'](handleError(_0x50e59e,null));};exports[_0x8d9e('0xa2')]=function(_0x3b82e0,_0x1a8835,_0xe2038e){var _0x2b7741,_0x3127c2={},_0x199775;if(_0x3b82e0['body']['to']){_0x199775=_0x3b82e0['body']['to'][0x0];}return db['FaxAccount'][_0x8d9e('0x5c')]({'where':{'id':_0x3b82e0['params']['id']},'include':[{'model':db[_0x8d9e('0xa3')],'as':_0x8d9e('0xa4'),'include':[{'model':db[_0x8d9e('0x75')],'as':_0x8d9e('0xa5'),'where':{'fax':_0x199775},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8d9e('0x22')](handleEntityNotFound(_0x1a8835,null))[_0x8d9e('0x22')](function(_0xb87bed){_0x2b7741=_0xb87bed;if(_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')]&&_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][_0x8d9e('0x4b')]){for(var _0x43ccd8=0x0;_0x43ccd8<_0x3b82e0['body'][_0x8d9e('0xa6')][_0x8d9e('0x4b')];_0x43ccd8+=0x1){_0x3b82e0['body'][_0x8d9e('0xa6')][_0x43ccd8]={'filename':_0x3b82e0['body'][_0x8d9e('0xa6')][_0x43ccd8][_0x8d9e('0x3c')],'id':_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][_0x43ccd8]['id'],'path':path['join'](config[_0x8d9e('0xa7')],_0x8d9e('0xa8'),_0x3b82e0[_0x8d9e('0x5e')]['attachments'][_0x43ccd8][_0x8d9e('0xa9')])};}}return respondWithRpcPromise(_0x8d9e('0xaa'),_0x8d9e('0xaa'),{'FaxAccountId':_[_0x8d9e('0xab')](_0x3b82e0['params']['id'])?undefined:_0x3b82e0['params']['id'],'path':_[_0x8d9e('0xab')](_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][0x0][_0x8d9e('0x8')])?undefined:_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][0x0][_0x8d9e('0x8')],'fax':_[_0x8d9e('0xab')](_0x3b82e0[_0x8d9e('0x5e')]['to'][0x0])?undefined:_0x3b82e0['body']['to'][0x0]},client9002);})[_0x8d9e('0x22')](function(){if(_0x2b7741){if(_[_0x8d9e('0xab')](_0x3b82e0[_0x8d9e('0x5e')]['from'])){_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xac')]=util[_0x8d9e('0xa0')](_0x8d9e('0xad'),_0x2b7741[_0x8d9e('0x3c')],_0x2b7741[_0x8d9e('0xae')]);}if(_0x2b7741[_0x8d9e('0xa4')]){if(_0x2b7741[_0x8d9e('0xa4')][_0x8d9e('0xa5')][_0x8d9e('0x4b')]){return _0x2b7741[_0x8d9e('0xa4')][_0x8d9e('0xa5')][0x0];}else{return db[_0x8d9e('0x75')][_0x8d9e('0x5d')](_[_0x8d9e('0x1b')](_0x3b82e0[_0x8d9e('0x5e')],{'firstName':_0x3b82e0[_0x8d9e('0x5e')]['to'][0x0],'phone':_0x3b82e0[_0x8d9e('0x5e')]['to'][0x0],'fax':_0x3b82e0['body']['to'][0x0],'ListId':_0x2b7741[_0x8d9e('0xaf')]}));}}else{throw new Error(_0x8d9e('0xb0'));}}else{throw new Error(_0x8d9e('0xb1'));}})[_0x8d9e('0x22')](function(_0x191624){if(_0x191624){return db['FaxInteraction'][_0x8d9e('0x5c')]({'where':{'ContactId':_0x191624['id'],'closed':![],'FaxAccountId':_0x2b7741['id']}})[_0x8d9e('0x22')](function(_0x28d8f4){if(_0x28d8f4){return[_0x28d8f4,![]];}return db[_0x8d9e('0x72')]['create']({'UserId':_0x3b82e0[_0x8d9e('0x5f')]['id'],'ContactId':_0x191624['id'],'FaxAccountId':_0x2b7741['id'],'fax':_0x3b82e0[_0x8d9e('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x8d9e('0x53')](_0x3b82e0['body'],{'read':![],'body':_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][0x0]['filename'],'FaxAccountId':_0x2b7741['id'],'UserId':_0x3b82e0['user']['id'],'ContactId':_0x191624['id'],'AttachmentId':_0x3b82e0['body'][_0x8d9e('0xa6')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8d9e('0xb2')}]})[_0x8d9e('0x22')](function(_0x18a703){return[_0x18a703,!![]];});});}else{throw new Error(_0x8d9e('0xb3'));}})[_0x8d9e('0xb4')](function(_0x70f96f,_0x1b7b4d){if(_0x1b7b4d){return _0x70f96f;}return db['FaxMessage'][_0x8d9e('0x5d')]({'direction':_0x8d9e('0xb5'),'read':![],'body':_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][0x0][_0x8d9e('0xb6')],'FaxAccountId':_0x2b7741['id'],'FaxInteractionId':_0x70f96f['id'],'UserId':_0x3b82e0[_0x8d9e('0x5f')]['id'],'ContactId':_0x70f96f['ContactId'],'AttachmentId':_0x3b82e0['body'][_0x8d9e('0xa6')][0x0]['id']})[_0x8d9e('0x22')](function(_0x26e2cc){_0x70f96f['dataValues']['Messages']=[];_0x70f96f['dataValues']['Messages'][_0x8d9e('0x8c')](_0x26e2cc['dataValues']);return _0x70f96f;});})[_0x8d9e('0x22')](function(_0x4b655a){respondWithRpcPromise(_0x8d9e('0xb7'),_0x8d9e('0xb7'),{'FaxAccountId':_['isNil'](_0x3b82e0[_0x8d9e('0x5a')]['id'])?undefined:_0x3b82e0[_0x8d9e('0x5a')]['id'],'path':_['isNil'](_0x3b82e0['body'][_0x8d9e('0xa6')][0x0][_0x8d9e('0x8')])?undefined:_0x3b82e0[_0x8d9e('0x5e')][_0x8d9e('0xa6')][0x0][_0x8d9e('0x8')],'fax':_[_0x8d9e('0xab')](_0x3b82e0['body']['to'][0x0])?undefined:_0x3b82e0[_0x8d9e('0x5e')]['to'][0x0],'AttachmentId':_0x3b82e0[_0x8d9e('0x5e')]['attachments'][0x0]['id']},client9002)['then'](function(_0x10becc){logger[_0x8d9e('0x23')]('SendFaxRpc,\x20%s',_0x10becc);})[_0x8d9e('0x2a')](function(_0x4d9373){logger[_0x8d9e('0x23')](_0x8d9e('0xb8'),_0x4d9373);});return _0x4b655a;})[_0x8d9e('0x22')](respondWithResult(_0x1a8835,null))[_0x8d9e('0x2a')](handleError(_0x1a8835,null));};exports[_0x8d9e('0xb9')]=function(_0x47584f,_0x366b48,_0x1a4257){return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')]({'where':{'id':_0x47584f[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x366b48,null))[_0x8d9e('0x22')](function(_0x1ae35d){if(_0x1ae35d){return _0x1ae35d['addAgents'](_0x47584f['body']['ids'],_[_0x8d9e('0xba')](_0x47584f['body'],['ids','id'])||{})[_0x8d9e('0xb4')](function(_0x14133e){for(var _0x15ee85=0x0;_0x15ee85<_0x47584f['body'][_0x8d9e('0x73')][_0x8d9e('0x4b')];_0x15ee85+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x47584f[_0x8d9e('0x5e')]['ids'][_0x15ee85]),'FaxAccountId':Number(_0x47584f[_0x8d9e('0x5a')]['id'])});}return _0x14133e;});}})[_0x8d9e('0x22')](respondWithResult(_0x366b48,null))[_0x8d9e('0x2a')](handleError(_0x366b48,null));};exports['removeAgents']=function(_0x1346b0,_0x4fba99,_0x1aef79){return db[_0x8d9e('0x3f')][_0x8d9e('0x5c')]({'where':{'id':_0x1346b0[_0x8d9e('0x5a')]['id']}})[_0x8d9e('0x22')](handleEntityNotFound(_0x4fba99,null))[_0x8d9e('0x22')](function(_0x45848a){if(_0x45848a){return _0x45848a[_0x8d9e('0xbb')](_0x1346b0[_0x8d9e('0x46')][_0x8d9e('0x73')])[_0x8d9e('0x22')](function(){if(_[_0x8d9e('0xbc')](_0x1346b0[_0x8d9e('0x46')][_0x8d9e('0x73')])){for(var _0x449134=0x0;_0x449134<_0x1346b0[_0x8d9e('0x46')]['ids']['length'];_0x449134+=0x1){socket['emit'](_0x8d9e('0xbd'),{'UserId':Number(_0x1346b0[_0x8d9e('0x46')]['ids'][_0x449134]),'FaxAccountId':Number(_0x1346b0[_0x8d9e('0x5a')]['id'])});}}else{socket[_0x8d9e('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x1346b0[_0x8d9e('0x46')]['ids']),'FaxAccountId':Number(_0x1346b0[_0x8d9e('0x5a')]['id'])});}});}})[_0x8d9e('0x22')](respondWithStatusCode(_0x4fba99,null))['catch'](handleError(_0x4fba99,null));};exports[_0x8d9e('0xbf')]=function(_0x8d82e2,_0x4fa8b6,_0x4e23bb){var _0x5ae76c={};var _0x2c9750={};var _0x1ecf2e;var _0xa51b14;return db[_0x8d9e('0x3f')][_0x8d9e('0x6b')]({'where':{'id':_0x8d82e2[_0x8d9e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4fa8b6,null))[_0x8d9e('0x22')](function(_0x3e16d5){if(_0x3e16d5){_0x1ecf2e=_0x3e16d5;_0x2c9750[_0x8d9e('0x44')]=_[_0x8d9e('0x45')](db[_0x8d9e('0xc0')]['rawAttributes']);_0x2c9750[_0x8d9e('0x46')]=_[_0x8d9e('0x45')](_0x8d82e2[_0x8d9e('0x46')]);_0x2c9750[_0x8d9e('0x47')]=_[_0x8d9e('0x48')](_0x2c9750[_0x8d9e('0x44')],_0x2c9750[_0x8d9e('0x46')]);_0x5ae76c[_0x8d9e('0x4a')]=_['intersection'](_0x2c9750[_0x8d9e('0x44')],qs['fields'](_0x8d82e2['query']['fields']));_0x5ae76c['attributes']=_0x5ae76c['attributes'][_0x8d9e('0x4b')]?_0x5ae76c['attributes']:_0x2c9750[_0x8d9e('0x44')];_0x5ae76c[_0x8d9e('0x4e')]=qs['sort'](_0x8d82e2[_0x8d9e('0x46')][_0x8d9e('0x4f')]);_0x5ae76c[_0x8d9e('0x50')]=qs[_0x8d9e('0x47')](_[_0x8d9e('0x51')](_0x8d82e2['query'],_0x2c9750[_0x8d9e('0x47')]));if(_0x8d82e2[_0x8d9e('0x46')]['filter']){_0x5ae76c['where']=_[_0x8d9e('0x53')](_0x5ae76c[_0x8d9e('0x50')],{'$or':_[_0x8d9e('0x3e')](_0x5ae76c[_0x8d9e('0x4a')],function(_0x58fac2){var _0x28f089={};_0x28f089[_0x58fac2]={'$like':'%'+_0x8d82e2['query'][_0x8d9e('0x52')]+'%'};return _0x28f089;})});}_0x5ae76c=_[_0x8d9e('0x53')]({},_0x5ae76c,_0x8d82e2[_0x8d9e('0x55')]);return _0x1ecf2e['getAgents'](_0x5ae76c);}})[_0x8d9e('0x22')](function(_0x56dd44){if(_0x56dd44){_0xa51b14=_0x56dd44[_0x8d9e('0x4b')];if(!_0x8d82e2[_0x8d9e('0x46')][_0x8d9e('0x4c')](_0x8d9e('0x4d'))){_0x5ae76c[_0x8d9e('0x30')]=qs[_0x8d9e('0x30')](_0x8d82e2['query'][_0x8d9e('0x30')]);_0x5ae76c[_0x8d9e('0x32')]=qs[_0x8d9e('0x32')](_0x8d82e2[_0x8d9e('0x46')][_0x8d9e('0x32')]);}return _0x1ecf2e[_0x8d9e('0xbf')](_0x5ae76c);}})[_0x8d9e('0x22')](function(_0x4499dc){if(_0x4499dc){return _0x4499dc?{'count':_0xa51b14,'rows':_0x4499dc}:null;}})[_0x8d9e('0x22')](respondWithResult(_0x4fa8b6,null))[_0x8d9e('0x2a')](handleError(_0x4fa8b6,null));}; \ No newline at end of file +var _0xa8c2=['show','params','keys','rawAttributes','length','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Tags','tag','addApplications','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','/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','sequelize','transaction','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','filename','Messages','out','ContactId','dataValues','SendFax','addAgents','spread','userFaxAccount:save','removeAgents','isArray','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','stack','send','Pause','FaxAccount','key','map','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','findAll','rows','catch'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xa8c2,0x1eb));var _0x2a8c=function(_0x1301d4,_0x67b05e){_0x1301d4=_0x1301d4-0x0;var _0x467501=_0xa8c2[_0x1301d4];return _0x467501;};'use strict';var emlformat=require(_0x2a8c('0x0'));var rimraf=require(_0x2a8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a8c('0x2'));var rp=require(_0x2a8c('0x3'));var moment=require(_0x2a8c('0x4'));var BPromise=require(_0x2a8c('0x5'));var Mustache=require(_0x2a8c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2a8c('0x7'));var csv=require('to-csv');var ejs=require(_0x2a8c('0x8'));var fs=require('fs');var fs_extra=require(_0x2a8c('0x9'));var _=require(_0x2a8c('0xa'));var squel=require(_0x2a8c('0xb'));var crypto=require(_0x2a8c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2a8c('0xd'));var toCsv=require(_0x2a8c('0xe'));var querystring=require(_0x2a8c('0xf'));var Papa=require('papaparse');var Redis=require(_0x2a8c('0x10'));var authService=require(_0x2a8c('0x11'));var qs=require(_0x2a8c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a8c('0x13'));var logger=require(_0x2a8c('0x14'))(_0x2a8c('0x15'));var utils=require(_0x2a8c('0x16'));var config=require(_0x2a8c('0x17'));var licenseUtil=require(_0x2a8c('0x18'));var db=require(_0x2a8c('0x19'))['db'];config[_0x2a8c('0x1a')]=_[_0x2a8c('0x1b')](config[_0x2a8c('0x1a')],{'host':_0x2a8c('0x1c'),'port':0x18eb});var socket=require(_0x2a8c('0x1d'))(new Redis(config[_0x2a8c('0x1a')]));require(_0x2a8c('0x1e'))['register'](socket);var jayson=require(_0x2a8c('0x1f'));var client=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232c});var client9002=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53abbd,_0xe25e34,_0xed5615,_0x1a6caa){return new BPromise(function(_0x5b6190,_0x249456){var _0x493a12=_0x1a6caa||client;return _0x493a12[_0x2a8c('0x22')](_0x53abbd,_0xed5615)[_0x2a8c('0x23')](function(_0x19420e){logger[_0x2a8c('0x24')](_0x2a8c('0x25'),_0xe25e34,'request\x20sent');logger[_0x2a8c('0x26')](_0x2a8c('0x27'),_0xe25e34,_0x2a8c('0x28'),JSON[_0x2a8c('0x29')](_0x19420e));if(_0x19420e[_0x2a8c('0x2a')]){if(_0x19420e['error'][_0x2a8c('0x2b')]===0x1f4){logger[_0x2a8c('0x2a')](_0x2a8c('0x25'),_0xe25e34,_0x19420e[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);return _0x249456(_0x19420e[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);}logger[_0x2a8c('0x2a')]('FaxAccount,\x20%s,\x20%s',_0xe25e34,_0x19420e[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);return _0x5b6190(_0x19420e['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0xe25e34,_0x2a8c('0x28'));_0x5b6190(_0x19420e[_0x2a8c('0x2d')][_0x2a8c('0x2c')]);}})['catch'](function(_0x2531d0){logger[_0x2a8c('0x2a')](_0x2a8c('0x25'),_0xe25e34,_0x2531d0);_0x249456(_0x2531d0);});});}function respondWithStatusCode(_0x57ca8b,_0x274907){_0x274907=_0x274907||0xcc;return function(_0x339175){if(_0x339175){return _0x57ca8b[_0x2a8c('0x2e')](_0x274907);}return _0x57ca8b[_0x2a8c('0x2f')](_0x274907)[_0x2a8c('0x30')]();};}function respondWithResult(_0x4c3c0e,_0x17cf0b){_0x17cf0b=_0x17cf0b||0xc8;return function(_0x1fe893){if(_0x1fe893){return _0x4c3c0e['status'](_0x17cf0b)[_0x2a8c('0x31')](_0x1fe893);}};}function respondWithFilteredResult(_0x195b28,_0x460fa7){return function(_0x31f8c4){if(_0x31f8c4){var _0x32efe0=typeof _0x460fa7[_0x2a8c('0x32')]===_0x2a8c('0x33')&&typeof _0x460fa7[_0x2a8c('0x34')]===_0x2a8c('0x33');var _0x44f6f7=_0x31f8c4[_0x2a8c('0x35')];var _0x36b4cc=_0x32efe0?0x0:_0x460fa7[_0x2a8c('0x32')];var _0x176de3=_0x32efe0?_0x31f8c4[_0x2a8c('0x35')]:_0x460fa7[_0x2a8c('0x32')]+_0x460fa7[_0x2a8c('0x34')];var _0x1b1e71;if(_0x176de3>=_0x44f6f7){_0x176de3=_0x44f6f7;_0x1b1e71=0xc8;}else{_0x1b1e71=0xce;}_0x195b28['status'](_0x1b1e71);return _0x195b28[_0x2a8c('0x36')](_0x2a8c('0x37'),_0x36b4cc+'-'+_0x176de3+'/'+_0x44f6f7)['json'](_0x31f8c4);}return null;};}function patchUpdates(_0x6d0db){return function(_0x42cae0){try{jsonpatch[_0x2a8c('0x38')](_0x42cae0,_0x6d0db,!![]);}catch(_0x28dcf9){return BPromise[_0x2a8c('0x39')](_0x28dcf9);}return _0x42cae0[_0x2a8c('0x3a')]();};}function saveUpdates(_0x4aba80,_0x51caac){return function(_0x5132e6){if(_0x5132e6){return _0x5132e6[_0x2a8c('0x3b')](_0x4aba80)[_0x2a8c('0x23')](function(_0x2c8233){return _0x2c8233;});}return null;};}function removeEntity(_0x44ec25,_0x4d1e1d){return function(_0x34785d){if(_0x34785d){return _0x34785d[_0x2a8c('0x3c')]()['then'](function(){var _0x4bbb99=_0x34785d[_0x2a8c('0x3d')]({'plain':!![]});var _0x1b5e75=_0x2a8c('0x3e');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b5e75,'resourceId':_0x4bbb99['id']}})['then'](function(){return _0x34785d;});})['then'](function(){_0x44ec25[_0x2a8c('0x2f')](0xcc)[_0x2a8c('0x30')]();});}};}function handleEntityNotFound(_0x256295,_0x585e46){return function(_0x2dbac2){if(!_0x2dbac2){_0x256295[_0x2a8c('0x2e')](0x194);}return _0x2dbac2;};}function handleError(_0x10ac36,_0x3b9406){_0x3b9406=_0x3b9406||0x1f4;return function(_0x4193d5){logger[_0x2a8c('0x2a')](_0x4193d5[_0x2a8c('0x3f')]);if(_0x4193d5['name']){delete _0x4193d5['name'];}_0x10ac36['status'](_0x3b9406)[_0x2a8c('0x40')](_0x4193d5);};}exports['index']=function(_0x51fd73,_0x4ede2b){var _0x2847c9={'include':[{'model':db[_0x2a8c('0x41')],'as':'mandatoryDispositionPause'}]},_0x3a9b83={},_0x31bc3d={'count':0x0,'rows':[]};var _0x19dc75=_['map'](db[_0x2a8c('0x42')]['rawAttributes'],function(_0x1a4e71){return{'name':_0x1a4e71['fieldName'],'type':_0x1a4e71['type'][_0x2a8c('0x43')]};});_0x3a9b83['model']=_[_0x2a8c('0x44')](_0x19dc75,_0x2a8c('0x45'));_0x3a9b83[_0x2a8c('0x46')]=_['keys'](_0x51fd73['query']);_0x3a9b83[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0x3a9b83[_0x2a8c('0x49')],_0x3a9b83[_0x2a8c('0x46')]);_0x2847c9['attributes']=_[_0x2a8c('0x48')](_0x3a9b83[_0x2a8c('0x49')],qs[_0x2a8c('0x4a')](_0x51fd73[_0x2a8c('0x46')][_0x2a8c('0x4a')]));_0x2847c9[_0x2a8c('0x4b')]=_0x2847c9[_0x2a8c('0x4b')]['length']?_0x2847c9['attributes']:_0x3a9b83[_0x2a8c('0x49')];if(!_0x51fd73[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x2847c9['limit']=qs[_0x2a8c('0x34')](_0x51fd73['query'][_0x2a8c('0x34')]);_0x2847c9[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x51fd73['query'][_0x2a8c('0x32')]);}_0x2847c9[_0x2a8c('0x4e')]=qs['sort'](_0x51fd73['query']['sort']);_0x2847c9[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_[_0x2a8c('0x50')](_0x51fd73[_0x2a8c('0x46')],_0x3a9b83[_0x2a8c('0x47')]),_0x19dc75);if(_0x51fd73[_0x2a8c('0x46')][_0x2a8c('0x51')]){_0x2847c9['where']=_[_0x2a8c('0x52')](_0x2847c9[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x19dc75,function(_0x5240cc){if(_0x5240cc[_0x2a8c('0x53')]!=='VIRTUAL'){var _0x45a919={};_0x45a919[_0x5240cc['name']]={'$like':'%'+_0x51fd73[_0x2a8c('0x46')][_0x2a8c('0x51')]+'%'};return _0x45a919;}})});}_0x2847c9=_[_0x2a8c('0x52')]({},_0x2847c9,_0x51fd73[_0x2a8c('0x54')]);var _0x33f98a={'where':_0x2847c9[_0x2a8c('0x4f')]};return db['FaxAccount']['count'](_0x33f98a)[_0x2a8c('0x23')](function(_0x619998){_0x31bc3d[_0x2a8c('0x35')]=_0x619998;if(_0x51fd73[_0x2a8c('0x46')]['includeAll']){_0x2847c9['include']=[{'all':!![]}];}return db['FaxAccount'][_0x2a8c('0x55')](_0x2847c9);})[_0x2a8c('0x23')](function(_0x3b487f){_0x31bc3d[_0x2a8c('0x56')]=_0x3b487f;return _0x31bc3d;})['then'](respondWithFilteredResult(_0x4ede2b,_0x2847c9))[_0x2a8c('0x57')](handleError(_0x4ede2b,null));};exports[_0x2a8c('0x58')]=function(_0x4b7cf8,_0x5cd4cc){var _0x25fe52={'raw':![],'where':{'id':_0x4b7cf8[_0x2a8c('0x59')]['id']},'include':[{'model':db[_0x2a8c('0x41')],'as':'mandatoryDispositionPause'}]},_0x33af10={};_0x33af10[_0x2a8c('0x49')]=_[_0x2a8c('0x5a')](db[_0x2a8c('0x42')][_0x2a8c('0x5b')]);_0x33af10[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x4b7cf8[_0x2a8c('0x46')]);_0x33af10[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0x33af10[_0x2a8c('0x49')],_0x33af10[_0x2a8c('0x46')]);_0x25fe52[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0x33af10[_0x2a8c('0x49')],qs[_0x2a8c('0x4a')](_0x4b7cf8['query'][_0x2a8c('0x4a')]));_0x25fe52[_0x2a8c('0x4b')]=_0x25fe52[_0x2a8c('0x4b')][_0x2a8c('0x5c')]?_0x25fe52[_0x2a8c('0x4b')]:_0x33af10['model'];if(_0x4b7cf8[_0x2a8c('0x46')][_0x2a8c('0x5d')]){_0x25fe52[_0x2a8c('0x5e')]=[{'all':!![]}];}_0x25fe52=_[_0x2a8c('0x52')]({},_0x25fe52,_0x4b7cf8['options']);return db[_0x2a8c('0x42')]['find'](_0x25fe52)[_0x2a8c('0x23')](handleEntityNotFound(_0x5cd4cc,null))['then'](respondWithResult(_0x5cd4cc,null))[_0x2a8c('0x57')](handleError(_0x5cd4cc,null));};exports[_0x2a8c('0x5f')]=function(_0x38d26c,_0x57603d){return db[_0x2a8c('0x42')][_0x2a8c('0x5f')](_0x38d26c[_0x2a8c('0x60')],{})[_0x2a8c('0x23')](function(_0x5b1435){var _0x53aaca=_0x38d26c[_0x2a8c('0x61')][_0x2a8c('0x3d')]({'plain':!![]});if(!_0x53aaca)throw new Error(_0x2a8c('0x62'));if(_0x53aaca[_0x2a8c('0x63')]===_0x2a8c('0x61')){var _0x179fe2=_0x5b1435[_0x2a8c('0x3d')]({'plain':!![]});var _0x2ce0bb='FaxAccounts';return db[_0x2a8c('0x64')][_0x2a8c('0x65')]({'where':{'name':_0x2ce0bb,'userProfileId':_0x53aaca[_0x2a8c('0x66')]},'raw':!![]})[_0x2a8c('0x23')](function(_0x26fe1a){if(_0x26fe1a&&_0x26fe1a['autoAssociation']===0x0){return db['UserProfileResource'][_0x2a8c('0x5f')]({'name':_0x179fe2[_0x2a8c('0x45')],'resourceId':_0x179fe2['id'],'type':_0x26fe1a['name'],'sectionId':_0x26fe1a['id']},{})['then'](function(){return _0x5b1435;});}else{return _0x5b1435;}})[_0x2a8c('0x57')](function(_0x4c5f70){logger[_0x2a8c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c5f70);throw _0x4c5f70;});}return _0x5b1435;})[_0x2a8c('0x23')](respondWithResult(_0x57603d,0xc9))[_0x2a8c('0x57')](handleError(_0x57603d,null));};exports[_0x2a8c('0x3b')]=function(_0x397c1a,_0x4557cd){if(_0x397c1a[_0x2a8c('0x60')]['id']){delete _0x397c1a['body']['id'];}return db[_0x2a8c('0x42')]['find']({'where':{'id':_0x397c1a[_0x2a8c('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x2a8c('0x67')}]})['then'](handleEntityNotFound(_0x4557cd,null))[_0x2a8c('0x23')](saveUpdates(_0x397c1a[_0x2a8c('0x60')],null))['then'](respondWithResult(_0x4557cd,null))[_0x2a8c('0x57')](handleError(_0x4557cd,null));};exports[_0x2a8c('0x3c')]=function(_0x380001,_0xfb850e){return db[_0x2a8c('0x42')][_0x2a8c('0x65')]({'where':{'id':_0x380001[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0xfb850e,null))[_0x2a8c('0x23')](removeEntity(_0xfb850e,null))['catch'](handleError(_0xfb850e,null));};exports['describe']=function(_0x1ce5e8,_0x2d37d9){return db[_0x2a8c('0x42')][_0x2a8c('0x68')]()[_0x2a8c('0x23')](respondWithResult(_0x2d37d9,null))[_0x2a8c('0x57')](handleError(_0x2d37d9,null));};exports[_0x2a8c('0x69')]=function(_0x43a52c,_0x437fd5,_0x468e47){if(_0x43a52c[_0x2a8c('0x60')]['id']){delete _0x43a52c['body']['id'];}return db[_0x2a8c('0x42')]['find']({'where':{'id':_0x43a52c[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x437fd5,null))[_0x2a8c('0x23')](function(_0x4ea88a){if(_0x4ea88a){_0x43a52c[_0x2a8c('0x60')][_0x2a8c('0x6a')]=_0x4ea88a['id'];return db[_0x2a8c('0x6b')][_0x2a8c('0x5f')](_0x43a52c[_0x2a8c('0x60')]);}})['then'](respondWithResult(_0x437fd5,null))[_0x2a8c('0x57')](handleError(_0x437fd5,null));};exports['getDispositions']=function(_0x582720,_0x3e283e,_0x5e5341){var _0x3cddc2={'raw':![],'where':{}};var _0x51e37c={};var _0x223b58={'count':0x0,'rows':[]};return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x582720[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e283e,null))[_0x2a8c('0x23')](function(_0x307bf4){if(_0x307bf4){_0x51e37c[_0x2a8c('0x49')]=_['keys'](db[_0x2a8c('0x6b')][_0x2a8c('0x5b')]);_0x51e37c[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x582720[_0x2a8c('0x46')]);_0x51e37c[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0x51e37c[_0x2a8c('0x49')],_0x51e37c[_0x2a8c('0x46')]);_0x3cddc2[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0x51e37c['model'],qs['fields'](_0x582720[_0x2a8c('0x46')][_0x2a8c('0x4a')]));_0x3cddc2[_0x2a8c('0x4b')]=_0x3cddc2[_0x2a8c('0x4b')]['length']?_0x3cddc2[_0x2a8c('0x4b')]:_0x51e37c[_0x2a8c('0x49')];if(!_0x582720[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x3cddc2['limit']=qs[_0x2a8c('0x34')](_0x582720[_0x2a8c('0x46')]['limit']);_0x3cddc2[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x582720[_0x2a8c('0x46')]['offset']);}_0x3cddc2[_0x2a8c('0x4e')]=qs[_0x2a8c('0x6d')](_0x582720[_0x2a8c('0x46')][_0x2a8c('0x6d')]);_0x3cddc2[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_[_0x2a8c('0x50')](_0x582720[_0x2a8c('0x46')],_0x51e37c['filters']));_0x3cddc2[_0x2a8c('0x4f')][_0x2a8c('0x6a')]=_0x307bf4['id'];if(_0x582720[_0x2a8c('0x46')][_0x2a8c('0x51')]){_0x3cddc2['where']=_[_0x2a8c('0x52')](_0x3cddc2[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x3cddc2[_0x2a8c('0x4b')],function(_0x2f078f){var _0x2970cb={};_0x2970cb[_0x2f078f]={'$like':'%'+_0x582720[_0x2a8c('0x46')]['filter']+'%'};return _0x2970cb;})});}_0x3cddc2=_['merge']({},_0x3cddc2,_0x582720[_0x2a8c('0x54')]);return db[_0x2a8c('0x6b')][_0x2a8c('0x35')]({'where':_0x3cddc2[_0x2a8c('0x4f')]})[_0x2a8c('0x23')](function(_0xe789da){_0x223b58[_0x2a8c('0x35')]=_0xe789da;if(_0x582720['query'][_0x2a8c('0x5d')]){_0x3cddc2[_0x2a8c('0x5e')]=[{'all':!![]}];}return db[_0x2a8c('0x6b')][_0x2a8c('0x55')](_0x3cddc2);})[_0x2a8c('0x23')](function(_0x48ba81){_0x223b58['rows']=_0x48ba81;return _0x223b58;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x3e283e,_0x3cddc2))[_0x2a8c('0x57')](handleError(_0x3e283e,null));};exports['removeDispositions']=function(_0x265371,_0x22256d,_0x5a3cae){return db['FaxAccount'][_0x2a8c('0x65')]({'where':{'id':_0x265371[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x22256d,null))[_0x2a8c('0x23')](function(_0x4d27d6){if(_0x4d27d6){return _0x4d27d6[_0x2a8c('0x6e')](_0x265371[_0x2a8c('0x46')][_0x2a8c('0x6f')]);}})['then'](respondWithStatusCode(_0x22256d,null))[_0x2a8c('0x57')](handleError(_0x22256d,null));};exports[_0x2a8c('0x70')]=function(_0xae9b7,_0xb4b439,_0x3a4cc3){if(_0xae9b7[_0x2a8c('0x60')]['id']){delete _0xae9b7[_0x2a8c('0x60')]['id'];}return db[_0x2a8c('0x42')][_0x2a8c('0x65')]({'where':{'id':_0xae9b7[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0xb4b439,null))[_0x2a8c('0x23')](function(_0x5b970a){if(_0x5b970a){_0xae9b7['body']['FaxAccountId']=_0x5b970a['id'];return db[_0x2a8c('0x71')][_0x2a8c('0x5f')](_0xae9b7['body']);}})[_0x2a8c('0x23')](respondWithResult(_0xb4b439,null))[_0x2a8c('0x57')](handleError(_0xb4b439,null));};exports[_0x2a8c('0x72')]=function(_0x381be8,_0x76c720,_0x4b212e){var _0x10eeac={'raw':![],'where':{}};var _0x3cca2c={};var _0x43d941={'count':0x0,'rows':[]};return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x381be8[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x76c720,null))[_0x2a8c('0x23')](function(_0x591192){if(_0x591192){_0x3cca2c[_0x2a8c('0x49')]=_[_0x2a8c('0x5a')](db[_0x2a8c('0x71')][_0x2a8c('0x5b')]);_0x3cca2c[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x381be8[_0x2a8c('0x46')]);_0x3cca2c[_0x2a8c('0x47')]=_['intersection'](_0x3cca2c['model'],_0x3cca2c['query']);_0x10eeac['attributes']=_[_0x2a8c('0x48')](_0x3cca2c[_0x2a8c('0x49')],qs[_0x2a8c('0x4a')](_0x381be8['query']['fields']));_0x10eeac[_0x2a8c('0x4b')]=_0x10eeac[_0x2a8c('0x4b')]['length']?_0x10eeac['attributes']:_0x3cca2c[_0x2a8c('0x49')];if(!_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x10eeac['limit']=qs[_0x2a8c('0x34')](_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x34')]);_0x10eeac[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x32')]);}_0x10eeac[_0x2a8c('0x4e')]=qs[_0x2a8c('0x6d')](_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x6d')]);_0x10eeac['where']=qs[_0x2a8c('0x47')](_['pick'](_0x381be8[_0x2a8c('0x46')],_0x3cca2c[_0x2a8c('0x47')]));_0x10eeac[_0x2a8c('0x4f')][_0x2a8c('0x6a')]=_0x591192['id'];if(_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x51')]){_0x10eeac['where']=_[_0x2a8c('0x52')](_0x10eeac[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x10eeac[_0x2a8c('0x4b')],function(_0xc439fd){var _0x3d324a={};_0x3d324a[_0xc439fd]={'$like':'%'+_0x381be8[_0x2a8c('0x46')][_0x2a8c('0x51')]+'%'};return _0x3d324a;})});}_0x10eeac=_[_0x2a8c('0x52')]({},_0x10eeac,_0x381be8[_0x2a8c('0x54')]);return db[_0x2a8c('0x71')][_0x2a8c('0x35')]({'where':_0x10eeac['where']})['then'](function(_0x93e3b2){_0x43d941[_0x2a8c('0x35')]=_0x93e3b2;if(_0x381be8[_0x2a8c('0x46')]['includeAll']){_0x10eeac[_0x2a8c('0x5e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2a8c('0x55')](_0x10eeac);})['then'](function(_0x4bca59){_0x43d941[_0x2a8c('0x56')]=_0x4bca59;return _0x43d941;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x76c720,_0x10eeac))['catch'](handleError(_0x76c720,null));};exports[_0x2a8c('0x73')]=function(_0x34baa6,_0x241364,_0x1427e5){return db['FaxAccount'][_0x2a8c('0x65')]({'where':{'id':_0x34baa6[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x241364,null))[_0x2a8c('0x23')](function(_0x75eecc){if(_0x75eecc){return _0x75eecc['removeAnswers'](_0x34baa6[_0x2a8c('0x46')]['ids']);}})[_0x2a8c('0x23')](respondWithStatusCode(_0x241364,null))[_0x2a8c('0x57')](handleError(_0x241364,null));};exports[_0x2a8c('0x74')]=function(_0x8cf603,_0x1d229a,_0x201e6e){return db[_0x2a8c('0x75')][_0x2a8c('0x65')]({'where':{'id':_0x8cf603['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x1d229a,null))[_0x2a8c('0x23')](function(_0x4e2fa0){if(_0x4e2fa0){return _0x4e2fa0[_0x2a8c('0x74')](_0x8cf603[_0x2a8c('0x60')]['ids'],_[_0x2a8c('0x76')](_0x8cf603[_0x2a8c('0x60')],[_0x2a8c('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x1d229a,null))[_0x2a8c('0x57')](handleError(_0x1d229a,null));};exports[_0x2a8c('0x77')]=function(_0x52a78c,_0x1ad577,_0x3a5f4f){var _0x3911b2={'raw':![],'where':{}};var _0x1654f0={};var _0xfd78cf={'count':0x0,'rows':[]};return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x52a78c[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x1ad577,null))['then'](function(_0x53c3f1){if(_0x53c3f1){_0x1654f0[_0x2a8c('0x49')]=_[_0x2a8c('0x5a')](db[_0x2a8c('0x75')][_0x2a8c('0x5b')]);_0x1654f0[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x52a78c[_0x2a8c('0x46')]);_0x1654f0[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0x1654f0[_0x2a8c('0x49')],_0x1654f0[_0x2a8c('0x46')]);_0x3911b2[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0x1654f0[_0x2a8c('0x49')],qs[_0x2a8c('0x4a')](_0x52a78c[_0x2a8c('0x46')]['fields']));_0x3911b2['attributes']=_0x3911b2['attributes']['length']?_0x3911b2[_0x2a8c('0x4b')]:_0x1654f0[_0x2a8c('0x49')];if(!_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x3911b2[_0x2a8c('0x34')]=qs['limit'](_0x52a78c['query'][_0x2a8c('0x34')]);_0x3911b2[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x32')]);}_0x3911b2['order']=qs[_0x2a8c('0x6d')](_0x52a78c['query']['sort']);_0x3911b2[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_[_0x2a8c('0x50')](_0x52a78c[_0x2a8c('0x46')],_0x1654f0[_0x2a8c('0x47')]));_0x3911b2[_0x2a8c('0x4f')]['FaxAccountId']=_0x53c3f1['id'];if(_0x52a78c[_0x2a8c('0x46')]['filter']){_0x3911b2['where']=_['merge'](_0x3911b2[_0x2a8c('0x4f')],{'$or':_['map'](_0x3911b2[_0x2a8c('0x4b')],function(_0x5aa057){var _0x381109={};_0x381109[_0x5aa057]={'$like':'%'+_0x52a78c['query'][_0x2a8c('0x51')]+'%'};return _0x381109;})});}_0x3911b2=_['merge']({},_0x3911b2,_0x52a78c[_0x2a8c('0x54')]);return db[_0x2a8c('0x75')][_0x2a8c('0x35')]({'where':_0x3911b2[_0x2a8c('0x4f')]})[_0x2a8c('0x23')](function(_0x1f9591){_0xfd78cf[_0x2a8c('0x35')]=_0x1f9591;if(_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x5d')]){_0x3911b2[_0x2a8c('0x5e')]=[{'model':db[_0x2a8c('0x78')],'as':_0x2a8c('0x79'),'required':![]},{'model':db[_0x2a8c('0x7a')],'as':'Owner','attributes':[_0x2a8c('0x45'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x2a8c('0x7b'),'attributes':['id',_0x2a8c('0x45'),'color'],'where':_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x7c')]?{'id':_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x7c')]}:undefined,'required':_0x52a78c[_0x2a8c('0x46')][_0x2a8c('0x7c')]?!![]:![]}];}return db[_0x2a8c('0x75')]['findAll'](_0x3911b2);})[_0x2a8c('0x23')](function(_0xd14d71){_0xfd78cf[_0x2a8c('0x56')]=_0xd14d71;return _0xfd78cf;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x1ad577,_0x3911b2))[_0x2a8c('0x57')](handleError(_0x1ad577,null));};exports[_0x2a8c('0x7d')]=function(_0x324428,_0x1f6c14,_0x57efcf){return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x324428['params']['id']}})['then'](handleEntityNotFound(_0x1f6c14,null))['then'](function(_0x31cb8d){if(_0x31cb8d){return db['sequelize']['transaction'](function(_0x723240){return db[_0x2a8c('0x7e')][_0x2a8c('0x3c')]({'where':{'FaxAccountId':_0x324428[_0x2a8c('0x59')]['id']},'transaction':_0x723240})[_0x2a8c('0x23')](function(_0x4aefcb){var _0x313fd8=_['map'](_0x324428[_0x2a8c('0x60')],function(_0x406e19){_0x406e19[_0x2a8c('0x6a')]=_0x324428['params']['id'];return _0x406e19;});return db['FaxApplication'][_0x2a8c('0x7f')](_0x313fd8,{'transaction':_0x723240});});})[_0x2a8c('0x23')](function(){return db[_0x2a8c('0x7e')][_0x2a8c('0x80')]({'where':{'FaxAccountId':_0x324428[_0x2a8c('0x59')]['id']},'order':_0x2a8c('0x81')});});}})['then'](respondWithResult(_0x1f6c14,null))[_0x2a8c('0x57')](handleError(_0x1f6c14,null));};exports[_0x2a8c('0x82')]=function(_0x3a56ee,_0x4f17a0,_0x53f81e){var _0x5d7509={};var _0xe2fc19={};var _0x38248e;var _0x2f37f;return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x3a56ee[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f17a0,null))[_0x2a8c('0x23')](function(_0x70d055){if(_0x70d055){_0x38248e=_0x70d055;_0xe2fc19['model']=_[_0x2a8c('0x5a')](db[_0x2a8c('0x7e')][_0x2a8c('0x5b')]);_0xe2fc19[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x3a56ee[_0x2a8c('0x46')]);_0xe2fc19[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0xe2fc19[_0x2a8c('0x49')],_0xe2fc19[_0x2a8c('0x46')]);_0x5d7509[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0xe2fc19[_0x2a8c('0x49')],qs['fields'](_0x3a56ee['query'][_0x2a8c('0x4a')]));_0x5d7509[_0x2a8c('0x4b')]=_0x5d7509[_0x2a8c('0x4b')]['length']?_0x5d7509[_0x2a8c('0x4b')]:_0xe2fc19['model'];_0x5d7509[_0x2a8c('0x4e')]=qs[_0x2a8c('0x6d')](_0x3a56ee['query'][_0x2a8c('0x6d')]);_0x5d7509[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_[_0x2a8c('0x50')](_0x3a56ee[_0x2a8c('0x46')],_0xe2fc19[_0x2a8c('0x47')]));if(_0x3a56ee[_0x2a8c('0x46')][_0x2a8c('0x51')]){_0x5d7509[_0x2a8c('0x4f')]=_['merge'](_0x5d7509[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x5d7509['attributes'],function(_0x4cd0b7){var _0x54e101={};_0x54e101[_0x4cd0b7]={'$like':'%'+_0x3a56ee[_0x2a8c('0x46')]['filter']+'%'};return _0x54e101;})});}_0x5d7509=_['merge']({},_0x5d7509,_0x3a56ee[_0x2a8c('0x54')]);return _0x38248e[_0x2a8c('0x82')](_0x5d7509);}})[_0x2a8c('0x23')](function(_0x29975b){if(_0x29975b){_0x2f37f=_0x29975b[_0x2a8c('0x5c')];if(!_0x3a56ee[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x5d7509[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x3a56ee['query']['limit']);_0x5d7509[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x3a56ee[_0x2a8c('0x46')][_0x2a8c('0x32')]);}return _0x38248e[_0x2a8c('0x82')](_0x5d7509);}})[_0x2a8c('0x23')](function(_0x51ca8e){if(_0x51ca8e){return _0x51ca8e?{'count':_0x2f37f,'rows':_0x51ca8e}:null;}})['then'](respondWithResult(_0x4f17a0,null))[_0x2a8c('0x57')](handleError(_0x4f17a0,null));};function Extension(_0x1311c3,_0x2f1f95,_0x3d2ff2,_0x5aec50){this[_0x2a8c('0x83')]=_0x2a8c('0x84');this[_0x2a8c('0x85')]=_0x1311c3[_0x2a8c('0x86')];this[_0x2a8c('0x87')]=_0x5aec50;this[_0x2a8c('0x53')]=_0x2a8c('0x88');this[_0x2a8c('0x89')]=_0x2a8c('0x8a');this[_0x2a8c('0x6a')]=_0x1311c3['id'];this['priority']=_0x2f1f95;this[_0x2a8c('0x8b')]=_0x3d2ff2;}function createExtensionsReciveFax(_0x5c0da6){var _0x1e19b3=0x1;var _0xec6d42=[];_0xec6d42[_0x2a8c('0x8c')](new Extension(_0x5c0da6,_0x1e19b3,'',_0x2a8c('0x8d')));_0x1e19b3+=0x1;_0xec6d42[_0x2a8c('0x8c')](new Extension(_0x5c0da6,_0x1e19b3,_0x2a8c('0x8e'),_0x2a8c('0x8f')));_0x1e19b3+=0x1;for(var _0x5237f1 in _0x5c0da6){if(_0x5c0da6['hasOwnProperty'](_0x5237f1)&&(_0x5237f1===_0x2a8c('0x90')||_0x5237f1===_0x2a8c('0x86')||_0x5237f1===_0x2a8c('0x91')||_0x5237f1==='faxdetect'||_0x5237f1===_0x2a8c('0x92')||_0x5237f1===_0x2a8c('0x93')||_0x5237f1===_0x2a8c('0x94')||_0x5237f1===_0x2a8c('0x95')||_0x5237f1==='t38timeout')){_0xec6d42[_0x2a8c('0x8c')](new Extension(_0x5c0da6,_0x1e19b3,_0x2a8c('0x96')+_0x5237f1+')='+_0x5c0da6[_0x5237f1],_0x2a8c('0x8f')));_0x1e19b3+=0x1;}}_0xec6d42[_0x2a8c('0x8c')](new Extension(_0x5c0da6,_0x1e19b3,'6','Wait'));_0x1e19b3+=0x1;_0xec6d42[_0x2a8c('0x8c')](new Extension(_0x5c0da6,_0x1e19b3,_0x2a8c('0x97'),_0x2a8c('0x98')));_0x1e19b3=0x0;return _0xec6d42;}exports[_0x2a8c('0x99')]=function(_0x332091,_0x1b5e8e,_0x14e809){var _0x5e8c02;return db[_0x2a8c('0x9a')][_0x2a8c('0x9b')](function(_0x5dd59d){return db[_0x2a8c('0x42')][_0x2a8c('0x5f')](_0x332091[_0x2a8c('0x60')],{'transaction':_0x5dd59d})[_0x2a8c('0x23')](function(_0x44c401){_0x5e8c02=_0x44c401[_0x2a8c('0x3d')]({'plain':!![]});return db[_0x2a8c('0x9c')][_0x2a8c('0x7f')](createExtensionsReciveFax(_0x5e8c02),{'transaction':_0x5dd59d});});})[_0x2a8c('0x23')](function(){return _0x5e8c02;})[_0x2a8c('0x23')](respondWithResult(_0x1b5e8e,null))[_0x2a8c('0x57')](handleError(_0x1b5e8e,null));};exports['updateAccountApplications']=function(_0x3c9757,_0x22ada9,_0x3573db){var _0x76944b;return db[_0x2a8c('0x9a')]['transaction'](function(_0x399ec6){return db['FaxAccount'][_0x2a8c('0x3b')](_0x3c9757[_0x2a8c('0x60')],{'where':{'id':_0x3c9757[_0x2a8c('0x60')]['id']},'transaction':_0x399ec6})['then'](function(_0x24e6de){return db[_0x2a8c('0x9c')][_0x2a8c('0x3c')]({'where':{'FaxAccountId':_0x3c9757[_0x2a8c('0x60')]['id']},'transaction':_0x399ec6})['then'](function(_0x11a48b){return db[_0x2a8c('0x9c')][_0x2a8c('0x7f')](createExtensionsReciveFax(_[_0x2a8c('0x76')](_0x3c9757['body'],[_0x2a8c('0x9d'),_0x2a8c('0x43'),'createdAt',_0x2a8c('0x9e'),_0x2a8c('0x9f'),_0x2a8c('0xa0')])),{'transaction':_0x399ec6});});});})[_0x2a8c('0x23')](function(){return db[_0x2a8c('0x42')][_0x2a8c('0xa1')](_0x3c9757[_0x2a8c('0x60')]['id']);})['then'](respondWithResult(_0x22ada9,null))[_0x2a8c('0x57')](handleError(_0x22ada9,null));};exports['getMessages']=function(_0x53fb0d,_0x11255e,_0xf5878a){var _0x17d12e={'raw':!![],'where':{}};var _0x47a5e4={};var _0x1ca5a7={'count':0x0,'rows':[]};return db[_0x2a8c('0x42')][_0x2a8c('0x6c')]({'where':{'id':_0x53fb0d[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x11255e,null))[_0x2a8c('0x23')](function(_0x3f666d){if(_0x3f666d){_0x47a5e4[_0x2a8c('0x49')]=_['keys'](db[_0x2a8c('0xa2')][_0x2a8c('0x5b')]);_0x47a5e4[_0x2a8c('0x46')]=_[_0x2a8c('0x5a')](_0x53fb0d[_0x2a8c('0x46')]);_0x47a5e4[_0x2a8c('0x47')]=_['intersection'](_0x47a5e4[_0x2a8c('0x49')],_0x47a5e4['query']);_0x17d12e[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0x47a5e4[_0x2a8c('0x49')],qs['fields'](_0x53fb0d['query'][_0x2a8c('0x4a')]));_0x17d12e[_0x2a8c('0x4b')]=_0x17d12e[_0x2a8c('0x4b')][_0x2a8c('0x5c')]?_0x17d12e['attributes']:_0x47a5e4[_0x2a8c('0x49')];if(!_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x17d12e[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0x34')]);_0x17d12e['offset']=qs['offset'](_0x53fb0d[_0x2a8c('0x46')]['offset']);}_0x17d12e[_0x2a8c('0x4e')]=qs[_0x2a8c('0x6d')](_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0x6d')]);_0x17d12e[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_[_0x2a8c('0x50')](_0x53fb0d[_0x2a8c('0x46')],_0x47a5e4[_0x2a8c('0x47')]));_0x17d12e['where'][_0x2a8c('0x6a')]=_0x3f666d['id'];if(_0x53fb0d['query'][_0x2a8c('0x51')]){_0x17d12e[_0x2a8c('0x4f')]=_[_0x2a8c('0x52')](_0x17d12e[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x17d12e[_0x2a8c('0x4b')],function(_0x3429b4){var _0x34af7={};_0x34af7[_0x3429b4]={'$like':'%'+_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0x51')]+'%'};return _0x34af7;})});}if(_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0xa3')]){var _0xfac2a9=_0x53fb0d[_0x2a8c('0x46')][_0x2a8c('0xa3')][_0x2a8c('0xa4')](',');var _0x471be7={};_0x471be7[_0xfac2a9[0x0]]={'$gte':moment(_0xfac2a9[0x1])[_0x2a8c('0xa5')](_0x2a8c('0xa6'))};_0x17d12e[_0x2a8c('0x4f')]=_[_0x2a8c('0x52')](_0x17d12e['where'],_0x471be7);}_0x17d12e=_[_0x2a8c('0x52')]({},_0x17d12e,_0x53fb0d[_0x2a8c('0x54')]);return db[_0x2a8c('0xa2')][_0x2a8c('0x35')]({'where':_0x17d12e[_0x2a8c('0x4f')]})[_0x2a8c('0x23')](function(_0x10f967){_0x1ca5a7[_0x2a8c('0x35')]=_0x10f967;if(_0x53fb0d['query'][_0x2a8c('0x5d')]){_0x17d12e[_0x2a8c('0x5e')]=[{'all':!![]}];}return db[_0x2a8c('0xa2')][_0x2a8c('0x55')](_0x17d12e);})[_0x2a8c('0x23')](function(_0x188db1){_0x1ca5a7[_0x2a8c('0x56')]=_0x188db1;return _0x1ca5a7;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x11255e,_0x17d12e))[_0x2a8c('0x57')](handleError(_0x11255e,null));};exports[_0x2a8c('0x40')]=function(_0x3409b4,_0x5845e2,_0x54c5ab){var _0x3c9abf,_0x20a652={},_0x437866;if(_0x3409b4[_0x2a8c('0x60')]['to']){_0x437866=_0x3409b4[_0x2a8c('0x60')]['to'][0x0];}return db['FaxAccount'][_0x2a8c('0x65')]({'where':{'id':_0x3409b4[_0x2a8c('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x2a8c('0xa7'),'where':{'fax':_0x437866},'limit':0x1,'order':[[_0x2a8c('0x9e'),'DESC']]}]}]})[_0x2a8c('0x23')](handleEntityNotFound(_0x5845e2,null))[_0x2a8c('0x23')](function(_0xf66d8a){_0x3c9abf=_0xf66d8a;if(_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')]&&_0x3409b4['body'][_0x2a8c('0xa8')][_0x2a8c('0x5c')]){for(var _0x46c86d=0x0;_0x46c86d<_0x3409b4['body']['attachments'][_0x2a8c('0x5c')];_0x46c86d+=0x1){_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][_0x46c86d]={'filename':_0x3409b4['body']['attachments'][_0x46c86d][_0x2a8c('0x45')],'id':_0x3409b4['body'][_0x2a8c('0xa8')][_0x46c86d]['id'],'path':path[_0x2a8c('0xa9')](config[_0x2a8c('0xaa')],_0x2a8c('0xab'),_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][_0x46c86d][_0x2a8c('0xac')])};}}return respondWithRpcPromise(_0x2a8c('0xad'),_0x2a8c('0xad'),{'FaxAccountId':_[_0x2a8c('0xae')](_0x3409b4[_0x2a8c('0x59')]['id'])?undefined:_0x3409b4[_0x2a8c('0x59')]['id'],'path':_[_0x2a8c('0xae')](_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0][_0x2a8c('0xaf')])?undefined:_0x3409b4[_0x2a8c('0x60')]['attachments'][0x0][_0x2a8c('0xaf')],'fax':_[_0x2a8c('0xae')](_0x3409b4[_0x2a8c('0x60')]['to'][0x0])?undefined:_0x3409b4[_0x2a8c('0x60')]['to'][0x0]},client9002);})[_0x2a8c('0x23')](function(){if(_0x3c9abf){if(_[_0x2a8c('0xae')](_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xb0')])){_0x3409b4['body']['from']=util[_0x2a8c('0xa5')](_0x2a8c('0xb1'),_0x3c9abf[_0x2a8c('0x45')],_0x3c9abf[_0x2a8c('0xb2')]);}if(_0x3c9abf['List']){if(_0x3c9abf[_0x2a8c('0xb3')][_0x2a8c('0xa7')]['length']){return _0x3c9abf[_0x2a8c('0xb3')][_0x2a8c('0xa7')][0x0];}else{return db[_0x2a8c('0x78')]['create'](_[_0x2a8c('0x1b')](_0x3409b4[_0x2a8c('0x60')],{'firstName':_0x3409b4[_0x2a8c('0x60')]['to'][0x0],'phone':_0x3409b4[_0x2a8c('0x60')]['to'][0x0],'fax':_0x3409b4[_0x2a8c('0x60')]['to'][0x0],'ListId':_0x3c9abf[_0x2a8c('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x2a8c('0x23')](function(_0x24a7e6){if(_0x24a7e6){return db[_0x2a8c('0x75')][_0x2a8c('0x65')]({'where':{'ContactId':_0x24a7e6['id'],'closed':![],'FaxAccountId':_0x3c9abf['id']}})[_0x2a8c('0x23')](function(_0x3f30f1){if(_0x3f30f1){return[_0x3f30f1,![]];}return db[_0x2a8c('0x75')][_0x2a8c('0x5f')]({'UserId':_0x3409b4[_0x2a8c('0x61')]['id'],'ContactId':_0x24a7e6['id'],'FaxAccountId':_0x3c9abf['id'],'fax':_0x3409b4[_0x2a8c('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x2a8c('0x52')](_0x3409b4[_0x2a8c('0x60')],{'read':![],'body':_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0][_0x2a8c('0xb4')],'FaxAccountId':_0x3c9abf['id'],'UserId':_0x3409b4['user']['id'],'ContactId':_0x24a7e6['id'],'AttachmentId':_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x2a8c('0xb5')}]})[_0x2a8c('0x23')](function(_0x5ab4d7){return[_0x5ab4d7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x476372,_0x774b09){if(_0x774b09){return _0x476372;}return db['FaxMessage'][_0x2a8c('0x5f')]({'direction':_0x2a8c('0xb6'),'read':![],'body':_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0]['filename'],'FaxAccountId':_0x3c9abf['id'],'FaxInteractionId':_0x476372['id'],'UserId':_0x3409b4[_0x2a8c('0x61')]['id'],'ContactId':_0x476372[_0x2a8c('0xb7')],'AttachmentId':_0x3409b4['body'][_0x2a8c('0xa8')][0x0]['id']})[_0x2a8c('0x23')](function(_0x15732d){_0x476372['dataValues'][_0x2a8c('0xb5')]=[];_0x476372[_0x2a8c('0xb8')]['Messages']['push'](_0x15732d[_0x2a8c('0xb8')]);return _0x476372;});})[_0x2a8c('0x23')](function(_0x50b390){respondWithRpcPromise(_0x2a8c('0xb9'),_0x2a8c('0xb9'),{'FaxAccountId':_[_0x2a8c('0xae')](_0x3409b4[_0x2a8c('0x59')]['id'])?undefined:_0x3409b4['params']['id'],'path':_['isNil'](_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0][_0x2a8c('0xaf')])?undefined:_0x3409b4['body'][_0x2a8c('0xa8')][0x0]['path'],'fax':_['isNil'](_0x3409b4[_0x2a8c('0x60')]['to'][0x0])?undefined:_0x3409b4[_0x2a8c('0x60')]['to'][0x0],'AttachmentId':_0x3409b4[_0x2a8c('0x60')][_0x2a8c('0xa8')][0x0]['id']},client9002)[_0x2a8c('0x23')](function(_0x142732){logger[_0x2a8c('0x24')]('SendFaxRpc,\x20%s',_0x142732);})[_0x2a8c('0x57')](function(_0x5a242d){logger[_0x2a8c('0x24')]('SendFaxRpc,\x20%s',_0x5a242d);});return _0x50b390;})[_0x2a8c('0x23')](respondWithResult(_0x5845e2,null))['catch'](handleError(_0x5845e2,null));};exports[_0x2a8c('0xba')]=function(_0x41f085,_0x909e5c,_0xfca45b){return db[_0x2a8c('0x42')][_0x2a8c('0x65')]({'where':{'id':_0x41f085[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x909e5c,null))[_0x2a8c('0x23')](function(_0x51acf5){if(_0x51acf5){return _0x51acf5[_0x2a8c('0xba')](_0x41f085[_0x2a8c('0x60')][_0x2a8c('0x6f')],_[_0x2a8c('0x76')](_0x41f085[_0x2a8c('0x60')],[_0x2a8c('0x6f'),'id'])||{})[_0x2a8c('0xbb')](function(_0x5c75e6){for(var _0x5e86a1=0x0;_0x5e86a1<_0x41f085[_0x2a8c('0x60')][_0x2a8c('0x6f')][_0x2a8c('0x5c')];_0x5e86a1+=0x1){socket['emit'](_0x2a8c('0xbc'),{'UserId':Number(_0x41f085[_0x2a8c('0x60')][_0x2a8c('0x6f')][_0x5e86a1]),'FaxAccountId':Number(_0x41f085['params']['id'])});}return _0x5c75e6;});}})[_0x2a8c('0x23')](respondWithResult(_0x909e5c,null))[_0x2a8c('0x57')](handleError(_0x909e5c,null));};exports[_0x2a8c('0xbd')]=function(_0x5c1e5b,_0x52b3c7,_0x340b7a){return db[_0x2a8c('0x42')]['find']({'where':{'id':_0x5c1e5b[_0x2a8c('0x59')]['id']}})['then'](handleEntityNotFound(_0x52b3c7,null))[_0x2a8c('0x23')](function(_0x50a29a){if(_0x50a29a){return _0x50a29a[_0x2a8c('0xbd')](_0x5c1e5b[_0x2a8c('0x46')][_0x2a8c('0x6f')])['then'](function(){if(_[_0x2a8c('0xbe')](_0x5c1e5b[_0x2a8c('0x46')][_0x2a8c('0x6f')])){for(var _0x53f349=0x0;_0x53f349<_0x5c1e5b[_0x2a8c('0x46')][_0x2a8c('0x6f')][_0x2a8c('0x5c')];_0x53f349+=0x1){socket[_0x2a8c('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x5c1e5b[_0x2a8c('0x46')][_0x2a8c('0x6f')][_0x53f349]),'FaxAccountId':Number(_0x5c1e5b[_0x2a8c('0x59')]['id'])});}}else{socket[_0x2a8c('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x5c1e5b[_0x2a8c('0x46')][_0x2a8c('0x6f')]),'FaxAccountId':Number(_0x5c1e5b[_0x2a8c('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x52b3c7,null))[_0x2a8c('0x57')](handleError(_0x52b3c7,null));};exports[_0x2a8c('0xc0')]=function(_0x454e2,_0x368207,_0x10b176){var _0x7778f2={};var _0x4df347={};var _0x18d6de;var _0x2c0698;return db['FaxAccount'][_0x2a8c('0x6c')]({'where':{'id':_0x454e2[_0x2a8c('0x59')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x368207,null))[_0x2a8c('0x23')](function(_0x3b1d42){if(_0x3b1d42){_0x18d6de=_0x3b1d42;_0x4df347[_0x2a8c('0x49')]=_[_0x2a8c('0x5a')](db['User'][_0x2a8c('0x5b')]);_0x4df347['query']=_[_0x2a8c('0x5a')](_0x454e2[_0x2a8c('0x46')]);_0x4df347[_0x2a8c('0x47')]=_[_0x2a8c('0x48')](_0x4df347[_0x2a8c('0x49')],_0x4df347[_0x2a8c('0x46')]);_0x7778f2[_0x2a8c('0x4b')]=_[_0x2a8c('0x48')](_0x4df347[_0x2a8c('0x49')],qs[_0x2a8c('0x4a')](_0x454e2[_0x2a8c('0x46')][_0x2a8c('0x4a')]));_0x7778f2[_0x2a8c('0x4b')]=_0x7778f2['attributes'][_0x2a8c('0x5c')]?_0x7778f2[_0x2a8c('0x4b')]:_0x4df347['model'];_0x7778f2[_0x2a8c('0x4e')]=qs['sort'](_0x454e2[_0x2a8c('0x46')][_0x2a8c('0x6d')]);_0x7778f2[_0x2a8c('0x4f')]=qs[_0x2a8c('0x47')](_['pick'](_0x454e2['query'],_0x4df347[_0x2a8c('0x47')]));if(_0x454e2[_0x2a8c('0x46')][_0x2a8c('0x51')]){_0x7778f2[_0x2a8c('0x4f')]=_[_0x2a8c('0x52')](_0x7778f2[_0x2a8c('0x4f')],{'$or':_[_0x2a8c('0x44')](_0x7778f2[_0x2a8c('0x4b')],function(_0x343f53){var _0x48e4ee={};_0x48e4ee[_0x343f53]={'$like':'%'+_0x454e2[_0x2a8c('0x46')][_0x2a8c('0x51')]+'%'};return _0x48e4ee;})});}_0x7778f2=_['merge']({},_0x7778f2,_0x454e2[_0x2a8c('0x54')]);return _0x18d6de['getAgents'](_0x7778f2);}})[_0x2a8c('0x23')](function(_0x1b111f){if(_0x1b111f){_0x2c0698=_0x1b111f[_0x2a8c('0x5c')];if(!_0x454e2['query'][_0x2a8c('0x4c')](_0x2a8c('0x4d'))){_0x7778f2[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x454e2[_0x2a8c('0x46')][_0x2a8c('0x34')]);_0x7778f2[_0x2a8c('0x32')]=qs['offset'](_0x454e2[_0x2a8c('0x46')]['offset']);}return _0x18d6de['getAgents'](_0x7778f2);}})[_0x2a8c('0x23')](function(_0x3b5655){if(_0x3b5655){return _0x3b5655?{'count':_0x2c0698,'rows':_0x3b5655}:null;}})[_0x2a8c('0x23')](respondWithResult(_0x368207,null))['catch'](handleError(_0x368207,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d52a6db..39760ef 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 _0xf3eb=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x37dd9d,_0x317c54){var _0x33ec83=function(_0x243af0){while(--_0x243af0){_0x37dd9d['push'](_0x37dd9d['shift']());}};_0x33ec83(++_0x317c54);}(_0xf3eb,0x1af));var _0xbf3e=function(_0x10e49a,_0xc57397){_0x10e49a=_0x10e49a-0x0;var _0xe0f195=_0xf3eb[_0x10e49a];return _0xe0f195;};'use strict';var EventEmitter=require(_0xbf3e('0x0'));var FaxAccount=require(_0xbf3e('0x1'))['db'][_0xbf3e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbf3e('0x3')](0x0);var events={'afterCreate':_0xbf3e('0x4'),'afterUpdate':_0xbf3e('0x5'),'afterDestroy':_0xbf3e('0x6')};function emitEvent(_0x3005c7){return function(_0x26f321,_0x4f95e7,_0x595d65){FaxAccountEvents[_0xbf3e('0x7')](_0x3005c7+':'+_0x26f321['id'],_0x26f321);FaxAccountEvents['emit'](_0x3005c7,_0x26f321);_0x595d65(null);};}for(var e in events){if(events[_0xbf3e('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xbf3e('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x14a5=['update','remove','emit','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x56793b,_0x2502ff){var _0x47cf0b=function(_0x32884a){while(--_0x32884a){_0x56793b['push'](_0x56793b['shift']());}};_0x47cf0b(++_0x2502ff);}(_0x14a5,0x79));var _0x514a=function(_0x126d2b,_0x399454){_0x126d2b=_0x126d2b-0x0;var _0x3cedb5=_0x14a5[_0x126d2b];return _0x3cedb5;};'use strict';var EventEmitter=require(_0x514a('0x0'));var FaxAccount=require(_0x514a('0x1'))['db'][_0x514a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x514a('0x3')](0x0);var events={'afterCreate':_0x514a('0x4'),'afterUpdate':_0x514a('0x5'),'afterDestroy':_0x514a('0x6')};function emitEvent(_0x59bf90){return function(_0x3514c2,_0x525de0,_0x5942c3){FaxAccountEvents[_0x514a('0x7')](_0x59bf90+':'+_0x3514c2['id'],_0x3514c2);FaxAccountEvents[_0x514a('0x7')](_0x59bf90,_0x3514c2);_0x5942c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x514a('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 e15821b..4015421 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 _0xc939=['FaxAccount','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x322177,_0x4a29c4){var _0x357c57=function(_0x5114c9){while(--_0x5114c9){_0x322177['push'](_0x322177['shift']());}};_0x357c57(++_0x4a29c4);}(_0xc939,0x12d));var _0x9c93=function(_0x4860a2,_0x27aa4d){_0x4860a2=_0x4860a2-0x0;var _0xefc798=_0xc939[_0x4860a2];return _0xefc798;};'use strict';var _=require(_0x9c93('0x0'));var util=require(_0x9c93('0x1'));var logger=require(_0x9c93('0x2'))('api');var moment=require(_0x9c93('0x3'));var BPromise=require(_0x9c93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c93('0x5'));var config=require(_0x9c93('0x6'));var attributes=require('./faxAccount.attributes');module[_0x9c93('0x7')]=function(_0x5c12ab,_0x1102c3){return _0x5c12ab[_0x9c93('0x8')](_0x9c93('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31dd=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x31dd,0x1a6));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd31d('0x0'));var util=require(_0xd31d('0x1'));var logger=require(_0xd31d('0x2'))(_0xd31d('0x3'));var moment=require(_0xd31d('0x4'));var BPromise=require(_0xd31d('0x5'));var rp=require(_0xd31d('0x6'));var fs=require('fs');var path=require(_0xd31d('0x7'));var rimraf=require(_0xd31d('0x8'));var config=require(_0xd31d('0x9'));var attributes=require(_0xd31d('0xa'));module[_0xd31d('0xb')]=function(_0x26b002,_0x547aeb){return _0x26b002[_0xd31d('0xc')](_0xd31d('0xd'),attributes,{'tableName':_0xd31d('0xe'),'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 b6952f6..ca7e500 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 _0x40d1=['account','applications','list','orderBy','priority','Contacts','length','ListId','fax','create','spread','get','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFaxAccount','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','FaxApplication','Applications'];(function(_0x321206,_0x22269d){var _0xb3746b=function(_0x56b796){while(--_0x56b796){_0x321206['push'](_0x321206['shift']());}};_0xb3746b(++_0x22269d);}(_0x40d1,0x123));var _0x140d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x40d1[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x140d('0x0'));var util=require('util');var moment=require(_0x140d('0x1'));var BPromise=require(_0x140d('0x2'));var rs=require(_0x140d('0x3'));var fs=require('fs');var Redis=require(_0x140d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x140d('0x5'));var logger=require('../../config/logger')(_0x140d('0x6'));var config=require(_0x140d('0x7'));var jayson=require(_0x140d('0x8'));var client=jayson[_0x140d('0x9')]['http']({'port':0x232c});config[_0x140d('0xa')]=_[_0x140d('0xb')](config[_0x140d('0xa')],{'host':_0x140d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x140d('0xa')]));require(_0x140d('0xd'))[_0x140d('0xe')](socket);function respondWithRpcPromise(_0x58936d,_0x13b24e,_0x251030){return new BPromise(function(_0x3d8978,_0xe899c3){return client['request'](_0x58936d,_0x251030)['then'](function(_0x1291fc){logger[_0x140d('0xf')](_0x140d('0x10'),_0x13b24e,_0x140d('0x11'));logger[_0x140d('0x12')](_0x140d('0x13'),_0x13b24e,_0x140d('0x11'),JSON[_0x140d('0x14')](_0x1291fc));if(_0x1291fc[_0x140d('0x15')]){if(_0x1291fc[_0x140d('0x15')][_0x140d('0x16')]===0x1f4){logger[_0x140d('0x15')](_0x140d('0x10'),_0x13b24e,_0x1291fc['error'][_0x140d('0x17')]);return _0xe899c3(_0x1291fc['error'][_0x140d('0x17')]);}logger['error'](_0x140d('0x10'),_0x13b24e,_0x1291fc[_0x140d('0x15')][_0x140d('0x17')]);return _0x3d8978(_0x1291fc['error']['message']);}else{logger['info'](_0x140d('0x10'),_0x13b24e,_0x140d('0x11'));_0x3d8978(_0x1291fc[_0x140d('0x18')][_0x140d('0x17')]);}})[_0x140d('0x19')](function(_0x311d17){logger[_0x140d('0x15')](_0x140d('0x10'),_0x13b24e,_0x311d17);_0xe899c3(_0x311d17);});});}exports['GetFaxAccount']=function(_0x59de2a){var _0x2d35fc=this;return new Promise(function(_0x437b64,_0x5327cb){return db[_0x140d('0x1a')][_0x140d('0x1b')]({'raw':_0x59de2a[_0x140d('0x1c')]?_0x59de2a[_0x140d('0x1c')][_0x140d('0x1d')]===undefined?!![]:![]:!![],'where':_0x59de2a['options']?_0x59de2a[_0x140d('0x1c')][_0x140d('0x1e')]||null:null,'attributes':_0x59de2a['options']?_0x59de2a[_0x140d('0x1c')][_0x140d('0x1f')]||null:null,'limit':_0x59de2a[_0x140d('0x1c')]?_0x59de2a[_0x140d('0x1c')][_0x140d('0x20')]||null:null,'include':_0x59de2a[_0x140d('0x1c')]?_0x59de2a[_0x140d('0x1c')][_0x140d('0x21')]?_[_0x140d('0x22')](_0x59de2a['options'][_0x140d('0x21')],function(_0x5852f6){return{'model':db[_0x5852f6['model']],'as':_0x5852f6['as'],'attributes':_0x5852f6[_0x140d('0x1f')],'include':_0x5852f6[_0x140d('0x21')]?_[_0x140d('0x22')](_0x5852f6[_0x140d('0x21')],function(_0x3e972e){return{'model':db[_0x3e972e[_0x140d('0x23')]],'as':_0x3e972e['as'],'attributes':_0x3e972e[_0x140d('0x1f')],'include':_0x3e972e[_0x140d('0x21')]?_[_0x140d('0x22')](_0x3e972e[_0x140d('0x21')],function(_0x252696){return{'model':db[_0x252696['model']],'as':_0x252696['as'],'attributes':_0x252696[_0x140d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x140d('0x24')](function(_0x239748){logger[_0x140d('0xf')]('GetFaxAccount',_0x59de2a);logger[_0x140d('0x12')](_0x140d('0x25'),_0x59de2a,JSON[_0x140d('0x14')](_0x239748));_0x437b64(_0x239748);})[_0x140d('0x19')](function(_0x1f480e){logger[_0x140d('0x15')](_0x140d('0x25'),_0x1f480e['message'],_0x59de2a);_0x5327cb(_0x2d35fc[_0x140d('0x15')](0x1f4,_0x1f480e[_0x140d('0x17')]));});});};exports[_0x140d('0x26')]=function(_0x3e061f,_0x5658a1,_0xd53980){var _0x10d38c=this;return new Promise(function(_0x423080,_0x5b01a2){var _0x102e72={'body':_0x3e061f[_0x140d('0x27')],'channel':'fax'};var _0x477813=[];var _0x40436b=[];var _0x6d42f9={};return db[_0x140d('0x28')][_0x140d('0x29')]()[_0x140d('0x24')](function(_0x42323e){if(!_0x42323e){throw new db[(_0x140d('0x2a'))][(_0x140d('0x2b'))](_0x140d('0x2c'));}_0x477813=_[_0x140d('0x2d')](_[_0x140d('0x2e')](_0x42323e),[_0x140d('0x2f'),_0x140d('0x30')]);_0x40436b=_[_0x140d('0x2d')](_[_0x140d('0x2e')](_0x42323e),[_0x140d('0x2f'),_0x140d('0x30'),'CompanyId','ListId']);if(_0x3e061f[_0x140d('0x27')]['id']){delete _0x3e061f[_0x140d('0x27')]['id'];}if(_[_0x140d('0x31')](_0x3e061f['body'][_0x140d('0x32')])){throw new db[(_0x140d('0x2a'))][(_0x140d('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x140d('0x31')](_0x3e061f[_0x140d('0x27')]['body'])||_0x3e061f[_0x140d('0x27')]['body']===''){throw new db[(_0x140d('0x2a'))]['ValidationError'](_0x140d('0x33'));}if(_[_0x140d('0x31')](_0x3e061f[_0x140d('0x27')][_0x140d('0x34')])){throw new db[(_0x140d('0x2a'))][(_0x140d('0x2b'))](_0x140d('0x35')+_0x40436b);}if(!_[_0x140d('0x36')](_0x40436b,_0x3e061f[_0x140d('0x27')][_0x140d('0x34')])){throw new db[(_0x140d('0x2a'))][(_0x140d('0x2b'))](_0x140d('0x37')+_0x40436b);}_0x6d42f9[_0x3e061f[_0x140d('0x27')][_0x140d('0x34')]]=_0x3e061f[_0x140d('0x27')][_0x140d('0x32')];})['then'](function(){return db['FaxAccount'][_0x140d('0x38')]({'where':{'id':_0x3e061f['account']['id']},'include':[{'model':db['CmList'],'as':_0x140d('0x39'),'include':[{'model':db[_0x140d('0x28')],'as':'Contacts','where':_0x6d42f9,'limit':0x1,'order':[[_0x140d('0x30'),_0x140d('0x3a')]]}]},{'model':db[_0x140d('0x3b')],'as':_0x140d('0x3c')}]});})[_0x140d('0x24')](function(_0x264e0f){if(_0x264e0f&&_0x264e0f[_0x140d('0x39')]){var _0x224516=_0x264e0f['get']({'plain':!![]});_0x102e72[_0x140d('0x3d')]=_0x224516;_0x102e72[_0x140d('0x3e')]=_0x224516[_0x140d('0x3c')];_0x102e72[_0x140d('0x3f')]=_0x224516['List'];_0x102e72[_0x140d('0x3e')]=_[_0x140d('0x40')](_0x102e72[_0x140d('0x3e')],[_0x140d('0x41')],['asc']);if(_0x102e72[_0x140d('0x3d')]['Applications']){delete _0x102e72['account'][_0x140d('0x3c')];}if(_0x102e72['account'][_0x140d('0x39')]&&_0x102e72['account']['List'][_0x140d('0x42')][_0x140d('0x43')]){return _0x102e72[_0x140d('0x3d')][_0x140d('0x39')]['Contacts'][0x0];}var _0xf25bc2=_[_0x140d('0xb')](_0x3e061f[_0x140d('0x27')],{'firstName':_0x3e061f[_0x140d('0x27')][_0x140d('0x32')],'ListId':_0x224516[_0x140d('0x44')]});_0xf25bc2[_0x3e061f[_0x140d('0x27')][_0x140d('0x34')]]=_0x3e061f[_0x140d('0x27')]['from'];return db[_0x140d('0x28')]['create'](_0xf25bc2,{'fields':_0x477813,'raw':!![]});}})[_0x140d('0x24')](function(_0x84dc2c){_0x102e72['contact']=_0x84dc2c;if(_0x84dc2c){var _0x26ad44={'ContactId':_0x84dc2c['id'],'FaxAccountId':_0x3e061f['account']['id'],'fax':_0x84dc2c[_0x140d('0x45')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x84dc2c['id'],'closed':![],'FaxAccountId':_0x3e061f[_0x140d('0x3d')]['id']}})[_0x140d('0x24')](function(_0x1b172){if(_0x1b172){return[_0x1b172,![]];}return db['FaxInteraction'][_0x140d('0x46')](_0x26ad44)[_0x140d('0x24')](function(_0x38eae9){return[_0x38eae9,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x140d('0x47')](function(_0x3091f6,_0x1017c9){var _0x5dad3a=_0x3091f6[_0x140d('0x48')]({'plain':!![]});if(_0x1017c9){if(_0x102e72[_0x140d('0x3d')][_0x140d('0x49')]){_0x102e72[_0x140d('0x3e')]['push']({'id':0x0,'priority':_0x102e72[_0x140d('0x3e')][_0x140d('0x43')]+0x1,'app':'close','appdata':_0x140d('0x4a'),'interval':_0x140d('0x4b')});}_0x5dad3a[_0x140d('0x4c')]=!![];}else{_0x5dad3a['created']=![];}_0x102e72[_0x140d('0x4d')]=_0x5dad3a;return db[_0x140d('0x4e')]['create']({'body':_0x3e061f[_0x140d('0x27')]['body'],'FaxAccountId':_0x3e061f[_0x140d('0x3d')]['id'],'FaxInteractionId':_0x3091f6['id'],'direction':'in','ContactId':_0x3091f6['ContactId'],'AttachmentId':_0x3e061f['body'][_0x140d('0x4f')]});})[_0x140d('0x24')](function(_0x52b06a){_0x102e72[_0x140d('0x17')]=_0x52b06a;if(_0x102e72[_0x140d('0x4d')]['UserId']){return db[_0x140d('0x50')][_0x140d('0x38')]({'attributes':['id','name'],'where':{'id':_0x102e72[_0x140d('0x4d')][_0x140d('0x51')]}})[_0x140d('0x24')](function(_0x1cbd49){if(_0x1cbd49){_0x102e72[_0x140d('0x3e')][_0x140d('0x52')]({'id':0x0,'priority':0x0,'app':_0x140d('0x53'),'appdata':_0x1cbd49[_0x140d('0x54')]+','+(_0x102e72[_0x140d('0x3d')][_0x140d('0x55')]||0xa),'interval':_0x140d('0x4b')});}return respondWithRpcPromise(_0x140d('0x56'),_0x140d('0x57'),_0x102e72);});}return respondWithRpcPromise(_0x140d('0x56'),_0x140d('0x57'),_0x102e72);})['then'](function(_0x428b19){_0x423080(_0x428b19);})['catch'](function(_0x428fb5){_0x5b01a2(_0x10d38c['error'](0x1f4,_0x428fb5[_0x140d('0x17')]));});});}; \ No newline at end of file +var _0xd573=['./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','map','include','model','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','unshift','agent','name','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter'];(function(_0xa9af05,_0x359e4f){var _0x79d6f2=function(_0x13806c){while(--_0x13806c){_0xa9af05['push'](_0xa9af05['shift']());}};_0x79d6f2(++_0x359e4f);}(_0xd573,0x101));var _0x3d57=function(_0x46fb6a,_0x1d0e55){_0x46fb6a=_0x46fb6a-0x0;var _0x57a5ef=_0xd573[_0x46fb6a];return _0x57a5ef;};'use strict';var _=require(_0x3d57('0x0'));var util=require(_0x3d57('0x1'));var moment=require(_0x3d57('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d57('0x3'));var fs=require('fs');var Redis=require(_0x3d57('0x4'));var db=require(_0x3d57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d57('0x6'));var config=require(_0x3d57('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3d57('0x8')][_0x3d57('0x9')]({'port':0x232c});config[_0x3d57('0xa')]=_[_0x3d57('0xb')](config[_0x3d57('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d57('0xc'))(new Redis(config[_0x3d57('0xa')]));require(_0x3d57('0xd'))[_0x3d57('0xe')](socket);function respondWithRpcPromise(_0x1da995,_0x424937,_0xdd2076){return new BPromise(function(_0x5a606d,_0x36f591){return client[_0x3d57('0xf')](_0x1da995,_0xdd2076)[_0x3d57('0x10')](function(_0x3c51c6){logger[_0x3d57('0x11')](_0x3d57('0x12'),_0x424937,'request\x20sent');logger[_0x3d57('0x13')](_0x3d57('0x14'),_0x424937,_0x3d57('0x15'),JSON[_0x3d57('0x16')](_0x3c51c6));if(_0x3c51c6[_0x3d57('0x17')]){if(_0x3c51c6['error']['code']===0x1f4){logger[_0x3d57('0x17')](_0x3d57('0x12'),_0x424937,_0x3c51c6[_0x3d57('0x17')]['message']);return _0x36f591(_0x3c51c6[_0x3d57('0x17')][_0x3d57('0x18')]);}logger[_0x3d57('0x17')](_0x3d57('0x12'),_0x424937,_0x3c51c6[_0x3d57('0x17')][_0x3d57('0x18')]);return _0x5a606d(_0x3c51c6[_0x3d57('0x17')][_0x3d57('0x18')]);}else{logger[_0x3d57('0x11')](_0x3d57('0x12'),_0x424937,'request\x20sent');_0x5a606d(_0x3c51c6['result'][_0x3d57('0x18')]);}})[_0x3d57('0x19')](function(_0x152008){logger[_0x3d57('0x17')](_0x3d57('0x12'),_0x424937,_0x152008);_0x36f591(_0x152008);});});}exports[_0x3d57('0x1a')]=function(_0x404dae){var _0x27d60f=this;return new Promise(function(_0x48d6a7,_0x559cd4){return db[_0x3d57('0x1b')]['findAll']({'raw':_0x404dae[_0x3d57('0x1c')]?_0x404dae[_0x3d57('0x1c')][_0x3d57('0x1d')]===undefined?!![]:![]:!![],'where':_0x404dae['options']?_0x404dae['options'][_0x3d57('0x1e')]||null:null,'attributes':_0x404dae['options']?_0x404dae[_0x3d57('0x1c')][_0x3d57('0x1f')]||null:null,'limit':_0x404dae['options']?_0x404dae['options'][_0x3d57('0x20')]||null:null,'include':_0x404dae['options']?_0x404dae[_0x3d57('0x1c')]['include']?_[_0x3d57('0x21')](_0x404dae['options'][_0x3d57('0x22')],function(_0x308676){return{'model':db[_0x308676['model']],'as':_0x308676['as'],'attributes':_0x308676[_0x3d57('0x1f')],'include':_0x308676['include']?_['map'](_0x308676[_0x3d57('0x22')],function(_0x4aee1e){return{'model':db[_0x4aee1e['model']],'as':_0x4aee1e['as'],'attributes':_0x4aee1e[_0x3d57('0x1f')],'include':_0x4aee1e[_0x3d57('0x22')]?_[_0x3d57('0x21')](_0x4aee1e[_0x3d57('0x22')],function(_0x1c13cc){return{'model':db[_0x1c13cc[_0x3d57('0x23')]],'as':_0x1c13cc['as'],'attributes':_0x1c13cc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45cf47){logger[_0x3d57('0x11')](_0x3d57('0x1a'),_0x404dae);logger['debug'](_0x3d57('0x1a'),_0x404dae,JSON[_0x3d57('0x16')](_0x45cf47));_0x48d6a7(_0x45cf47);})[_0x3d57('0x19')](function(_0x35f3be){logger['error']('GetFaxAccount',_0x35f3be[_0x3d57('0x18')],_0x404dae);_0x559cd4(_0x27d60f[_0x3d57('0x17')](0x1f4,_0x35f3be[_0x3d57('0x18')]));});});};exports[_0x3d57('0x24')]=function(_0x3cf27f,_0x1ebbc8,_0x24142a){var _0xe98f8d=this;return new Promise(function(_0x5bba96,_0x57961a){var _0x1060f7={'body':_0x3cf27f[_0x3d57('0x25')],'channel':_0x3d57('0x26')};var _0x364328=[];var _0x1017d=[];var _0x3dd39d={};return db['CmContact'][_0x3d57('0x27')]()['then'](function(_0x2c152){if(!_0x2c152){throw new db[(_0x3d57('0x28'))]['ValidationError'](_0x3d57('0x29'));}_0x364328=_[_0x3d57('0x2a')](_[_0x3d57('0x2b')](_0x2c152),[_0x3d57('0x2c'),_0x3d57('0x2d')]);_0x1017d=_[_0x3d57('0x2a')](_[_0x3d57('0x2b')](_0x2c152),[_0x3d57('0x2c'),'updatedAt',_0x3d57('0x2e'),_0x3d57('0x2f')]);if(_0x3cf27f['body']['id']){delete _0x3cf27f[_0x3d57('0x25')]['id'];}if(_[_0x3d57('0x30')](_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x31')])){throw new db['Sequelize'][(_0x3d57('0x32'))](_0x3d57('0x33'));}if(_[_0x3d57('0x30')](_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x25')])||_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x25')]===''){throw new db[(_0x3d57('0x28'))]['ValidationError'](_0x3d57('0x34'));}if(_[_0x3d57('0x30')](_0x3cf27f[_0x3d57('0x25')]['mapKey'])){throw new db[(_0x3d57('0x28'))][(_0x3d57('0x32'))](_0x3d57('0x35')+_0x1017d);}if(!_['includes'](_0x1017d,_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x36')])){throw new db[(_0x3d57('0x28'))][(_0x3d57('0x32'))](_0x3d57('0x37')+_0x1017d);}_0x3dd39d[_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x36')]]=_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x31')];})[_0x3d57('0x10')](function(){return db[_0x3d57('0x1b')][_0x3d57('0x38')]({'where':{'id':_0x3cf27f[_0x3d57('0x39')]['id']},'include':[{'model':db[_0x3d57('0x3a')],'as':_0x3d57('0x3b'),'include':[{'model':db[_0x3d57('0x3c')],'as':_0x3d57('0x3d'),'where':_0x3dd39d,'limit':0x1,'order':[[_0x3d57('0x2d'),_0x3d57('0x3e')]]}]},{'model':db[_0x3d57('0x3f')],'as':_0x3d57('0x40')}]});})[_0x3d57('0x10')](function(_0x171f67){if(_0x171f67&&_0x171f67[_0x3d57('0x3b')]){var _0x272c11=_0x171f67[_0x3d57('0x41')]({'plain':!![]});_0x1060f7[_0x3d57('0x39')]=_0x272c11;_0x1060f7[_0x3d57('0x42')]=_0x272c11[_0x3d57('0x40')];_0x1060f7[_0x3d57('0x43')]=_0x272c11[_0x3d57('0x3b')];_0x1060f7[_0x3d57('0x42')]=_['orderBy'](_0x1060f7[_0x3d57('0x42')],[_0x3d57('0x44')],[_0x3d57('0x45')]);if(_0x1060f7[_0x3d57('0x39')][_0x3d57('0x40')]){delete _0x1060f7[_0x3d57('0x39')][_0x3d57('0x40')];}if(_0x1060f7[_0x3d57('0x39')][_0x3d57('0x3b')]&&_0x1060f7['account'][_0x3d57('0x3b')][_0x3d57('0x3d')]['length']){return _0x1060f7[_0x3d57('0x39')][_0x3d57('0x3b')][_0x3d57('0x3d')][0x0];}var _0x48246b=_[_0x3d57('0xb')](_0x3cf27f[_0x3d57('0x25')],{'firstName':_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x31')],'ListId':_0x272c11['ListId']});_0x48246b[_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x36')]]=_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x31')];return db[_0x3d57('0x3c')][_0x3d57('0x46')](_0x48246b,{'fields':_0x364328,'raw':!![]});}})[_0x3d57('0x10')](function(_0x250ddc){_0x1060f7[_0x3d57('0x47')]=_0x250ddc;if(_0x250ddc){var _0x34f891={'ContactId':_0x250ddc['id'],'FaxAccountId':_0x3cf27f[_0x3d57('0x39')]['id'],'fax':_0x250ddc[_0x3d57('0x26')]};return db[_0x3d57('0x48')][_0x3d57('0x38')]({'where':{'ContactId':_0x250ddc['id'],'closed':![],'FaxAccountId':_0x3cf27f[_0x3d57('0x39')]['id']}})[_0x3d57('0x10')](function(_0x990e1c){if(_0x990e1c){return[_0x990e1c,![]];}return db[_0x3d57('0x48')][_0x3d57('0x46')](_0x34f891)[_0x3d57('0x10')](function(_0x59d514){return[_0x59d514,!![]];});});}else{throw new Error(_0x3d57('0x49'));}})['spread'](function(_0x3f6589,_0xde3a90){var _0x15769b=_0x3f6589[_0x3d57('0x41')]({'plain':!![]});if(_0xde3a90){if(_0x1060f7[_0x3d57('0x39')][_0x3d57('0x4a')]){_0x1060f7[_0x3d57('0x42')][_0x3d57('0x4b')]({'id':0x0,'priority':_0x1060f7[_0x3d57('0x42')][_0x3d57('0x4c')]+0x1,'app':_0x3d57('0x4d'),'appdata':_0x3d57('0x4e'),'interval':_0x3d57('0x4f')});}_0x15769b['created']=!![];}else{_0x15769b[_0x3d57('0x50')]=![];}_0x1060f7[_0x3d57('0x51')]=_0x15769b;return db['FaxMessage'][_0x3d57('0x46')]({'body':_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x25')],'FaxAccountId':_0x3cf27f[_0x3d57('0x39')]['id'],'FaxInteractionId':_0x3f6589['id'],'direction':'in','ContactId':_0x3f6589[_0x3d57('0x52')],'AttachmentId':_0x3cf27f[_0x3d57('0x25')][_0x3d57('0x53')]});})[_0x3d57('0x10')](function(_0x3911cb){_0x1060f7[_0x3d57('0x18')]=_0x3911cb;if(_0x1060f7[_0x3d57('0x51')][_0x3d57('0x54')]){return db[_0x3d57('0x55')][_0x3d57('0x38')]({'attributes':['id','name'],'where':{'id':_0x1060f7['interaction'][_0x3d57('0x54')]}})['then'](function(_0x3c37b3){if(_0x3c37b3){_0x1060f7[_0x3d57('0x42')][_0x3d57('0x56')]({'id':0x0,'priority':0x0,'app':_0x3d57('0x57'),'appdata':_0x3c37b3[_0x3d57('0x58')]+','+(_0x1060f7[_0x3d57('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x3d57('0x4f')});}return respondWithRpcPromise('Start',_0x3d57('0x59'),_0x1060f7);});}return respondWithRpcPromise('Start',_0x3d57('0x59'),_0x1060f7);})['then'](function(_0x3429b9){_0x5bba96(_0x3429b9);})[_0x3d57('0x19')](function(_0x5f4a6f){_0x57961a(_0xe98f8d[_0x3d57('0x17')](0x1f4,_0x5f4a6f[_0x3d57('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3f7eecd..0748b8f 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 _0xef01=['removeListener','register','length','faxAccount:','./faxAccount.events','save','update','emit'];(function(_0x194144,_0x54cdf3){var _0x5bbf1c=function(_0x1090ff){while(--_0x1090ff){_0x194144['push'](_0x194144['shift']());}};_0x5bbf1c(++_0x54cdf3);}(_0xef01,0x1cc));var _0x1ef0=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xef01[_0x4ae6ef];return _0x3cbb4e;};'use strict';var FaxAccountEvents=require(_0x1ef0('0x0'));var events=[_0x1ef0('0x1'),'remove',_0x1ef0('0x2')];function createListener(_0x49c3ac,_0x1b9be3){return function(_0x368e89){_0x1b9be3[_0x1ef0('0x3')](_0x49c3ac,_0x368e89);};}function removeListener(_0x469311,_0x2b7c6c){return function(){FaxAccountEvents[_0x1ef0('0x4')](_0x469311,_0x2b7c6c);};}exports[_0x1ef0('0x5')]=function(_0x5df2e2){for(var _0x2312a3=0x0,_0xecbbde=events[_0x1ef0('0x6')];_0x2312a3<_0xecbbde;_0x2312a3++){var _0x5a25e6=events[_0x2312a3];var _0x3799f9=createListener(_0x1ef0('0x7')+_0x5a25e6,_0x5df2e2);FaxAccountEvents['on'](_0x5a25e6,_0x3799f9);}}; \ No newline at end of file +var _0xc38c=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x3f6e15,_0x3748cf){var _0x334564=function(_0x31c66c){while(--_0x31c66c){_0x3f6e15['push'](_0x3f6e15['shift']());}};_0x334564(++_0x3748cf);}(_0xc38c,0x134));var _0xcc38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc38c[_0x14add3];return _0x4a174f;};'use strict';var FaxAccountEvents=require(_0xcc38('0x0'));var events=[_0xcc38('0x1'),_0xcc38('0x2'),_0xcc38('0x3')];function createListener(_0x43551e,_0x444f7b){return function(_0x11ce54){_0x444f7b['emit'](_0x43551e,_0x11ce54);};}function removeListener(_0x1c4b25,_0x37f77c){return function(){FaxAccountEvents[_0xcc38('0x4')](_0x1c4b25,_0x37f77c);};}exports[_0xcc38('0x5')]=function(_0x39d451){for(var _0x125551=0x0,_0x57489e=events[_0xcc38('0x6')];_0x125551<_0x57489e;_0x125551++){var _0x3b28bd=events[_0x125551];var _0x462d72=createListener(_0xcc38('0x7')+_0x3b28bd,_0x39d451);FaxAccountEvents['on'](_0x3b28bd,_0x462d72);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 8f1ccc5..8652ce3 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xad35fd,_0xee91b3){var _0x188450=function(_0x570f6a){while(--_0x570f6a){_0xad35fd['push'](_0xad35fd['shift']());}};_0x188450(++_0xee91b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x146e8a,_0x12ea04){var _0x36abc7=function(_0xe79d54){while(--_0xe79d54){_0x146e8a['push'](_0x146e8a['shift']());}};_0x36abc7(++_0x12ea04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 600e1ae..f38ca6f 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 _0x14ca=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1e7f4d,_0x20acaa){var _0x5f0fd9=function(_0x4dbbf4){while(--_0x4dbbf4){_0x1e7f4d['push'](_0x1e7f4d['shift']());}};_0x5f0fd9(++_0x20acaa);}(_0x14ca,0x68));var _0xa14c=function(_0x43d887,_0x56462c){_0x43d887=_0x43d887-0x0;var _0x5bbfb7=_0x14ca[_0x43d887];return _0x5bbfb7;};'use strict';var Sequelize=require(_0xa14c('0x0'));module[_0xa14c('0x1')]={'priority':{'type':Sequelize[_0xa14c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa14c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa14c('0x4')]()},'description':{'type':Sequelize[_0xa14c('0x3')]},'interval':{'type':Sequelize[_0xa14c('0x3')],'defaultValue':_0xa14c('0x5')}}; \ No newline at end of file +var _0x564f=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x31e4bb,_0x3c7802){var _0x426aa3=function(_0x4d2792){while(--_0x4d2792){_0x31e4bb['push'](_0x31e4bb['shift']());}};_0x426aa3(++_0x3c7802);}(_0x564f,0x162));var _0xf564=function(_0x57d555,_0x54dff7){_0x57d555=_0x57d555-0x0;var _0x553993=_0x564f[_0x57d555];return _0x553993;};'use strict';var Sequelize=require(_0xf564('0x0'));module[_0xf564('0x1')]={'priority':{'type':Sequelize[_0xf564('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf564('0x3')],'allowNull':![],'defaultValue':_0xf564('0x4')},'appdata':{'type':Sequelize[_0xf564('0x5')]()},'description':{'type':Sequelize[_0xf564('0x3')]},'interval':{'type':Sequelize[_0xf564('0x3')],'defaultValue':_0xf564('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4bf3e72..94b1db6 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 _0x60af=['includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','FaxApplication','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type'];(function(_0x593af2,_0x382c41){var _0xa2a9bf=function(_0x5a8a0b){while(--_0x5a8a0b){_0x593af2['push'](_0x593af2['shift']());}};_0xa2a9bf(++_0x382c41);}(_0x60af,0x17c));var _0xf60a=function(_0x11ba32,_0x5a7ba6){_0x11ba32=_0x11ba32-0x0;var _0x296558=_0x60af[_0x11ba32];return _0x296558;};'use strict';var emlformat=require(_0xf60a('0x0'));var rimraf=require(_0xf60a('0x1'));var zipdir=require(_0xf60a('0x2'));var jsonpatch=require(_0xf60a('0x3'));var rp=require(_0xf60a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf60a('0x5'));var util=require('util');var path=require(_0xf60a('0x6'));var sox=require(_0xf60a('0x7'));var csv=require(_0xf60a('0x8'));var ejs=require(_0xf60a('0x9'));var fs=require('fs');var fs_extra=require(_0xf60a('0xa'));var _=require(_0xf60a('0xb'));var squel=require(_0xf60a('0xc'));var crypto=require(_0xf60a('0xd'));var jsforce=require(_0xf60a('0xe'));var deskjs=require(_0xf60a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf60a('0x10'));var Redis=require(_0xf60a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf60a('0x12'));var as=require(_0xf60a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf60a('0x14'))(_0xf60a('0x15'));var utils=require(_0xf60a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf60a('0x17'));var db=require(_0xf60a('0x18'))['db'];function respondWithStatusCode(_0x5ee02a,_0x222b69){_0x222b69=_0x222b69||0xcc;return function(_0x340c70){if(_0x340c70){return _0x5ee02a[_0xf60a('0x19')](_0x222b69);}return _0x5ee02a[_0xf60a('0x1a')](_0x222b69)[_0xf60a('0x1b')]();};}function respondWithResult(_0x56ac87,_0x3658b1){_0x3658b1=_0x3658b1||0xc8;return function(_0x11c91d){if(_0x11c91d){return _0x56ac87[_0xf60a('0x1a')](_0x3658b1)[_0xf60a('0x1c')](_0x11c91d);}};}function respondWithFilteredResult(_0x43e073,_0xd3fa91){return function(_0x3bda3a){if(_0x3bda3a){var _0x1668cd=typeof _0xd3fa91[_0xf60a('0x1d')]===_0xf60a('0x1e')&&typeof _0xd3fa91[_0xf60a('0x1f')]==='undefined';var _0x392780=_0x3bda3a['count'];var _0x1eb5cb=_0x1668cd?0x0:_0xd3fa91['offset'];var _0x598584=_0x1668cd?_0x3bda3a[_0xf60a('0x20')]:_0xd3fa91[_0xf60a('0x1d')]+_0xd3fa91[_0xf60a('0x1f')];var _0x390203;if(_0x598584>=_0x392780){_0x598584=_0x392780;_0x390203=0xc8;}else{_0x390203=0xce;}_0x43e073[_0xf60a('0x1a')](_0x390203);return _0x43e073['set'](_0xf60a('0x21'),_0x1eb5cb+'-'+_0x598584+'/'+_0x392780)['json'](_0x3bda3a);}return null;};}function patchUpdates(_0x43da05){return function(_0x551f0d){try{jsonpatch[_0xf60a('0x22')](_0x551f0d,_0x43da05,!![]);}catch(_0x4c2b64){return BPromise[_0xf60a('0x23')](_0x4c2b64);}return _0x551f0d[_0xf60a('0x24')]();};}function saveUpdates(_0x45f1ca,_0x343d7c){return function(_0x362aee){if(_0x362aee){return _0x362aee[_0xf60a('0x25')](_0x45f1ca)['then'](function(_0xc6a413){return _0xc6a413;});}return null;};}function removeEntity(_0x538cfa,_0x1acafb){return function(_0x16eacd){if(_0x16eacd){return _0x16eacd[_0xf60a('0x26')]()[_0xf60a('0x27')](function(){_0x538cfa[_0xf60a('0x1a')](0xcc)[_0xf60a('0x1b')]();});}};}function handleEntityNotFound(_0x433e3b,_0x5053b1){return function(_0x4916a4){if(!_0x4916a4){_0x433e3b['sendStatus'](0x194);}return _0x4916a4;};}function handleError(_0x4ee134,_0x2aa76e){_0x2aa76e=_0x2aa76e||0x1f4;return function(_0x789323){logger['error'](_0x789323[_0xf60a('0x28')]);if(_0x789323[_0xf60a('0x29')]){delete _0x789323[_0xf60a('0x29')];}_0x4ee134[_0xf60a('0x1a')](_0x2aa76e)['send'](_0x789323);};}exports[_0xf60a('0x2a')]=function(_0x35c739,_0x5010dd){var _0x396263={},_0x8e4dec={},_0x33810f={'count':0x0,'rows':[]};var _0x3ea35a=_[_0xf60a('0x2b')](db[_0xf60a('0x2c')][_0xf60a('0x2d')],function(_0x1c40b4){return{'name':_0x1c40b4['fieldName'],'type':_0x1c40b4['type'][_0xf60a('0x2e')]};});_0x8e4dec[_0xf60a('0x2f')]=_['map'](_0x3ea35a,_0xf60a('0x29'));_0x8e4dec[_0xf60a('0x30')]=_[_0xf60a('0x31')](_0x35c739['query']);_0x8e4dec[_0xf60a('0x32')]=_['intersection'](_0x8e4dec[_0xf60a('0x2f')],_0x8e4dec[_0xf60a('0x30')]);_0x396263[_0xf60a('0x33')]=_[_0xf60a('0x34')](_0x8e4dec[_0xf60a('0x2f')],qs['fields'](_0x35c739[_0xf60a('0x30')][_0xf60a('0x35')]));_0x396263[_0xf60a('0x33')]=_0x396263['attributes'][_0xf60a('0x36')]?_0x396263['attributes']:_0x8e4dec[_0xf60a('0x2f')];if(!_0x35c739[_0xf60a('0x30')][_0xf60a('0x37')](_0xf60a('0x38'))){_0x396263[_0xf60a('0x1f')]=qs['limit'](_0x35c739['query'][_0xf60a('0x1f')]);_0x396263[_0xf60a('0x1d')]=qs['offset'](_0x35c739[_0xf60a('0x30')][_0xf60a('0x1d')]);}_0x396263[_0xf60a('0x39')]=qs[_0xf60a('0x3a')](_0x35c739[_0xf60a('0x30')]['sort']);_0x396263['where']=qs[_0xf60a('0x32')](_[_0xf60a('0x3b')](_0x35c739[_0xf60a('0x30')],_0x8e4dec[_0xf60a('0x32')]),_0x3ea35a);if(_0x35c739[_0xf60a('0x30')][_0xf60a('0x3c')]){_0x396263[_0xf60a('0x3d')]=_[_0xf60a('0x3e')](_0x396263[_0xf60a('0x3d')],{'$or':_['map'](_0x3ea35a,function(_0x26511c){if(_0x26511c[_0xf60a('0x3f')]!=='VIRTUAL'){var _0x3901dd={};_0x3901dd[_0x26511c[_0xf60a('0x29')]]={'$like':'%'+_0x35c739[_0xf60a('0x30')][_0xf60a('0x3c')]+'%'};return _0x3901dd;}})});}_0x396263=_[_0xf60a('0x3e')]({},_0x396263,_0x35c739['options']);var _0x59addd={'where':_0x396263[_0xf60a('0x3d')]};return db[_0xf60a('0x2c')][_0xf60a('0x20')](_0x59addd)[_0xf60a('0x27')](function(_0x1f38a5){_0x33810f['count']=_0x1f38a5;if(_0x35c739[_0xf60a('0x30')][_0xf60a('0x40')]){_0x396263[_0xf60a('0x41')]=[{'all':!![]}];}return db[_0xf60a('0x2c')][_0xf60a('0x42')](_0x396263);})[_0xf60a('0x27')](function(_0x55a8ad){_0x33810f['rows']=_0x55a8ad;return _0x33810f;})['then'](respondWithFilteredResult(_0x5010dd,_0x396263))[_0xf60a('0x43')](handleError(_0x5010dd,null));};exports[_0xf60a('0x44')]=function(_0x41f91a,_0x1d3710){var _0x52d98a={'raw':!![],'where':{'id':_0x41f91a[_0xf60a('0x45')]['id']}},_0x1bdf60={};_0x1bdf60[_0xf60a('0x2f')]=_['keys'](db[_0xf60a('0x2c')][_0xf60a('0x2d')]);_0x1bdf60['query']=_[_0xf60a('0x31')](_0x41f91a['query']);_0x1bdf60['filters']=_[_0xf60a('0x34')](_0x1bdf60['model'],_0x1bdf60[_0xf60a('0x30')]);_0x52d98a[_0xf60a('0x33')]=_[_0xf60a('0x34')](_0x1bdf60[_0xf60a('0x2f')],qs[_0xf60a('0x35')](_0x41f91a['query'][_0xf60a('0x35')]));_0x52d98a[_0xf60a('0x33')]=_0x52d98a[_0xf60a('0x33')][_0xf60a('0x36')]?_0x52d98a[_0xf60a('0x33')]:_0x1bdf60[_0xf60a('0x2f')];if(_0x41f91a['query'][_0xf60a('0x40')]){_0x52d98a[_0xf60a('0x41')]=[{'all':!![]}];}_0x52d98a=_[_0xf60a('0x3e')]({},_0x52d98a,_0x41f91a[_0xf60a('0x46')]);return db['FaxApplication'][_0xf60a('0x47')](_0x52d98a)[_0xf60a('0x27')](handleEntityNotFound(_0x1d3710,null))[_0xf60a('0x27')](respondWithResult(_0x1d3710,null))[_0xf60a('0x43')](handleError(_0x1d3710,null));};exports[_0xf60a('0x48')]=function(_0x1e5017,_0x91b912){return db[_0xf60a('0x2c')][_0xf60a('0x48')](_0x1e5017[_0xf60a('0x49')],{})[_0xf60a('0x27')](respondWithResult(_0x91b912,0xc9))['catch'](handleError(_0x91b912,null));};exports['update']=function(_0x5115f5,_0x5e0f06){if(_0x5115f5[_0xf60a('0x49')]['id']){delete _0x5115f5[_0xf60a('0x49')]['id'];}return db[_0xf60a('0x2c')]['find']({'where':{'id':_0x5115f5[_0xf60a('0x45')]['id']}})[_0xf60a('0x27')](handleEntityNotFound(_0x5e0f06,null))['then'](saveUpdates(_0x5115f5['body'],null))[_0xf60a('0x27')](respondWithResult(_0x5e0f06,null))[_0xf60a('0x43')](handleError(_0x5e0f06,null));};exports['destroy']=function(_0x12746a,_0x5c796e){return db['FaxApplication']['find']({'where':{'id':_0x12746a[_0xf60a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c796e,null))[_0xf60a('0x27')](removeEntity(_0x5c796e,null))[_0xf60a('0x43')](handleError(_0x5c796e,null));}; \ No newline at end of file +var _0xb4bf=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dca78,_0x29e95c){var _0x23a118=function(_0x54dba6){while(--_0x54dba6){_0x3dca78['push'](_0x3dca78['shift']());}};_0x23a118(++_0x29e95c);}(_0xb4bf,0x80));var _0xfb4b=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xb4bf[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb4b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb4b('0x1'));var rp=require(_0xfb4b('0x2'));var moment=require('moment');var BPromise=require(_0xfb4b('0x3'));var Mustache=require(_0xfb4b('0x4'));var util=require(_0xfb4b('0x5'));var path=require('path');var sox=require(_0xfb4b('0x6'));var csv=require(_0xfb4b('0x7'));var ejs=require(_0xfb4b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb4b('0x9'));var squel=require(_0xfb4b('0xa'));var crypto=require(_0xfb4b('0xb'));var jsforce=require(_0xfb4b('0xc'));var deskjs=require(_0xfb4b('0xd'));var toCsv=require(_0xfb4b('0x7'));var querystring=require(_0xfb4b('0xe'));var Papa=require(_0xfb4b('0xf'));var Redis=require(_0xfb4b('0x10'));var authService=require(_0xfb4b('0x11'));var qs=require(_0xfb4b('0x12'));var as=require(_0xfb4b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb4b('0x14'))(_0xfb4b('0x15'));var utils=require('../../config/utils');var config=require(_0xfb4b('0x16'));var licenseUtil=require(_0xfb4b('0x17'));var db=require(_0xfb4b('0x18'))['db'];function respondWithStatusCode(_0x1993d0,_0x3fcd4b){_0x3fcd4b=_0x3fcd4b||0xcc;return function(_0x5d1a61){if(_0x5d1a61){return _0x1993d0['sendStatus'](_0x3fcd4b);}return _0x1993d0['status'](_0x3fcd4b)[_0xfb4b('0x19')]();};}function respondWithResult(_0x17626b,_0x26fad6){_0x26fad6=_0x26fad6||0xc8;return function(_0x3e01a3){if(_0x3e01a3){return _0x17626b[_0xfb4b('0x1a')](_0x26fad6)[_0xfb4b('0x1b')](_0x3e01a3);}};}function respondWithFilteredResult(_0x15398e,_0x19dbb6){return function(_0x1d8425){if(_0x1d8425){var _0x36950b=typeof _0x19dbb6[_0xfb4b('0x1c')]==='undefined'&&typeof _0x19dbb6[_0xfb4b('0x1d')]===_0xfb4b('0x1e');var _0x382da7=_0x1d8425[_0xfb4b('0x1f')];var _0x31d179=_0x36950b?0x0:_0x19dbb6[_0xfb4b('0x1c')];var _0x575d42=_0x36950b?_0x1d8425['count']:_0x19dbb6['offset']+_0x19dbb6['limit'];var _0x5106c4;if(_0x575d42>=_0x382da7){_0x575d42=_0x382da7;_0x5106c4=0xc8;}else{_0x5106c4=0xce;}_0x15398e[_0xfb4b('0x1a')](_0x5106c4);return _0x15398e['set'](_0xfb4b('0x20'),_0x31d179+'-'+_0x575d42+'/'+_0x382da7)[_0xfb4b('0x1b')](_0x1d8425);}return null;};}function patchUpdates(_0x51032a){return function(_0x178f1c){try{jsonpatch[_0xfb4b('0x21')](_0x178f1c,_0x51032a,!![]);}catch(_0x5bcb37){return BPromise['reject'](_0x5bcb37);}return _0x178f1c[_0xfb4b('0x22')]();};}function saveUpdates(_0x5cea16,_0x5b4034){return function(_0x8d9b28){if(_0x8d9b28){return _0x8d9b28[_0xfb4b('0x23')](_0x5cea16)[_0xfb4b('0x24')](function(_0x114718){return _0x114718;});}return null;};}function removeEntity(_0x52fa86,_0x291190){return function(_0x428f6b){if(_0x428f6b){return _0x428f6b[_0xfb4b('0x25')]()[_0xfb4b('0x24')](function(){_0x52fa86['status'](0xcc)[_0xfb4b('0x19')]();});}};}function handleEntityNotFound(_0x51493e,_0xf6025){return function(_0x151f54){if(!_0x151f54){_0x51493e[_0xfb4b('0x26')](0x194);}return _0x151f54;};}function handleError(_0x2a30b8,_0x5807a6){_0x5807a6=_0x5807a6||0x1f4;return function(_0x5339d5){logger[_0xfb4b('0x27')](_0x5339d5[_0xfb4b('0x28')]);if(_0x5339d5['name']){delete _0x5339d5[_0xfb4b('0x29')];}_0x2a30b8[_0xfb4b('0x1a')](_0x5807a6)['send'](_0x5339d5);};}exports[_0xfb4b('0x2a')]=function(_0x18da4d,_0x4b077e){var _0x2f0f50={},_0x42c439={},_0xb29657={'count':0x0,'rows':[]};var _0x187780=_['map'](db[_0xfb4b('0x2b')][_0xfb4b('0x2c')],function(_0x278c42){return{'name':_0x278c42[_0xfb4b('0x2d')],'type':_0x278c42[_0xfb4b('0x2e')][_0xfb4b('0x2f')]};});_0x42c439[_0xfb4b('0x30')]=_[_0xfb4b('0x31')](_0x187780,_0xfb4b('0x29'));_0x42c439[_0xfb4b('0x32')]=_['keys'](_0x18da4d[_0xfb4b('0x32')]);_0x42c439[_0xfb4b('0x33')]=_[_0xfb4b('0x34')](_0x42c439[_0xfb4b('0x30')],_0x42c439['query']);_0x2f0f50[_0xfb4b('0x35')]=_[_0xfb4b('0x34')](_0x42c439[_0xfb4b('0x30')],qs[_0xfb4b('0x36')](_0x18da4d[_0xfb4b('0x32')]['fields']));_0x2f0f50[_0xfb4b('0x35')]=_0x2f0f50[_0xfb4b('0x35')][_0xfb4b('0x37')]?_0x2f0f50[_0xfb4b('0x35')]:_0x42c439[_0xfb4b('0x30')];if(!_0x18da4d[_0xfb4b('0x32')]['hasOwnProperty'](_0xfb4b('0x38'))){_0x2f0f50[_0xfb4b('0x1d')]=qs[_0xfb4b('0x1d')](_0x18da4d[_0xfb4b('0x32')][_0xfb4b('0x1d')]);_0x2f0f50[_0xfb4b('0x1c')]=qs[_0xfb4b('0x1c')](_0x18da4d[_0xfb4b('0x32')]['offset']);}_0x2f0f50[_0xfb4b('0x39')]=qs[_0xfb4b('0x3a')](_0x18da4d[_0xfb4b('0x32')][_0xfb4b('0x3a')]);_0x2f0f50[_0xfb4b('0x3b')]=qs[_0xfb4b('0x33')](_[_0xfb4b('0x3c')](_0x18da4d[_0xfb4b('0x32')],_0x42c439['filters']),_0x187780);if(_0x18da4d[_0xfb4b('0x32')][_0xfb4b('0x3d')]){_0x2f0f50[_0xfb4b('0x3b')]=_['merge'](_0x2f0f50[_0xfb4b('0x3b')],{'$or':_[_0xfb4b('0x31')](_0x187780,function(_0x503870){if(_0x503870[_0xfb4b('0x2e')]!==_0xfb4b('0x3e')){var _0x498973={};_0x498973[_0x503870['name']]={'$like':'%'+_0x18da4d[_0xfb4b('0x32')][_0xfb4b('0x3d')]+'%'};return _0x498973;}})});}_0x2f0f50=_['merge']({},_0x2f0f50,_0x18da4d[_0xfb4b('0x3f')]);var _0x7086c3={'where':_0x2f0f50[_0xfb4b('0x3b')]};return db[_0xfb4b('0x2b')]['count'](_0x7086c3)['then'](function(_0x579c4a){_0xb29657[_0xfb4b('0x1f')]=_0x579c4a;if(_0x18da4d[_0xfb4b('0x32')][_0xfb4b('0x40')]){_0x2f0f50[_0xfb4b('0x41')]=[{'all':!![]}];}return db[_0xfb4b('0x2b')][_0xfb4b('0x42')](_0x2f0f50);})[_0xfb4b('0x24')](function(_0x2831f5){_0xb29657[_0xfb4b('0x43')]=_0x2831f5;return _0xb29657;})[_0xfb4b('0x24')](respondWithFilteredResult(_0x4b077e,_0x2f0f50))[_0xfb4b('0x44')](handleError(_0x4b077e,null));};exports[_0xfb4b('0x45')]=function(_0x52f02c,_0x5e6925){var _0x5cc78b={'raw':!![],'where':{'id':_0x52f02c[_0xfb4b('0x46')]['id']}},_0x166c94={};_0x166c94[_0xfb4b('0x30')]=_[_0xfb4b('0x47')](db[_0xfb4b('0x2b')][_0xfb4b('0x2c')]);_0x166c94[_0xfb4b('0x32')]=_[_0xfb4b('0x47')](_0x52f02c[_0xfb4b('0x32')]);_0x166c94[_0xfb4b('0x33')]=_['intersection'](_0x166c94['model'],_0x166c94['query']);_0x5cc78b[_0xfb4b('0x35')]=_[_0xfb4b('0x34')](_0x166c94[_0xfb4b('0x30')],qs[_0xfb4b('0x36')](_0x52f02c[_0xfb4b('0x32')][_0xfb4b('0x36')]));_0x5cc78b[_0xfb4b('0x35')]=_0x5cc78b['attributes']['length']?_0x5cc78b['attributes']:_0x166c94[_0xfb4b('0x30')];if(_0x52f02c['query'][_0xfb4b('0x40')]){_0x5cc78b[_0xfb4b('0x41')]=[{'all':!![]}];}_0x5cc78b=_['merge']({},_0x5cc78b,_0x52f02c['options']);return db[_0xfb4b('0x2b')]['find'](_0x5cc78b)[_0xfb4b('0x24')](handleEntityNotFound(_0x5e6925,null))[_0xfb4b('0x24')](respondWithResult(_0x5e6925,null))['catch'](handleError(_0x5e6925,null));};exports[_0xfb4b('0x48')]=function(_0xd6a2e7,_0x1477db){return db[_0xfb4b('0x2b')]['create'](_0xd6a2e7['body'],{})[_0xfb4b('0x24')](respondWithResult(_0x1477db,0xc9))[_0xfb4b('0x44')](handleError(_0x1477db,null));};exports[_0xfb4b('0x23')]=function(_0x1165a6,_0x56557a){if(_0x1165a6['body']['id']){delete _0x1165a6[_0xfb4b('0x49')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x1165a6[_0xfb4b('0x46')]['id']}})[_0xfb4b('0x24')](handleEntityNotFound(_0x56557a,null))[_0xfb4b('0x24')](saveUpdates(_0x1165a6[_0xfb4b('0x49')],null))[_0xfb4b('0x24')](respondWithResult(_0x56557a,null))[_0xfb4b('0x44')](handleError(_0x56557a,null));};exports[_0xfb4b('0x25')]=function(_0x21f29a,_0x5a9126){return db['FaxApplication']['find']({'where':{'id':_0x21f29a[_0xfb4b('0x46')]['id']}})[_0xfb4b('0x24')](handleEntityNotFound(_0x5a9126,null))[_0xfb4b('0x24')](removeEntity(_0x5a9126,null))[_0xfb4b('0x44')](handleError(_0x5a9126,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index abe7d28..c7cef2f 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 _0xc879=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x5e8965,_0x744744){var _0x5efd03=function(_0xc82aa1){while(--_0xc82aa1){_0x5e8965['push'](_0x5e8965['shift']());}};_0x5efd03(++_0x744744);}(_0xc879,0xa2));var _0x9c87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc879[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9c87('0x0'));var logger=require(_0x9c87('0x1'))(_0x9c87('0x2'));var moment=require(_0x9c87('0x3'));var BPromise=require(_0x9c87('0x4'));var rp=require(_0x9c87('0x5'));var fs=require('fs');var path=require(_0x9c87('0x6'));var rimraf=require(_0x9c87('0x7'));var config=require(_0x9c87('0x8'));var attributes=require('./faxApplication.attributes');module[_0x9c87('0x9')]=function(_0x52871d,_0x1ecd75){return _0x52871d[_0x9c87('0xa')](_0x9c87('0xb'),attributes,{'tableName':_0x9c87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c87('0xd'),'collate':_0x9c87('0xe')});}; \ No newline at end of file +var _0xb07e=['util','api','moment','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5f2a85,_0x3caa3f){var _0x49de9c=function(_0x930583){while(--_0x930583){_0x5f2a85['push'](_0x5f2a85['shift']());}};_0x49de9c(++_0x3caa3f);}(_0xb07e,0x14f));var _0xeb07=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xb07e[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xeb07('0x0'));var util=require(_0xeb07('0x1'));var logger=require('../../config/logger')(_0xeb07('0x2'));var moment=require(_0xeb07('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb07('0x4'));var rimraf=require(_0xeb07('0x5'));var config=require(_0xeb07('0x6'));var attributes=require(_0xeb07('0x7'));module[_0xeb07('0x8')]=function(_0x4862ba,_0x3f55a9){return _0x4862ba[_0xeb07('0x9')](_0xeb07('0xa'),attributes,{'tableName':_0xeb07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb07('0xc'),'collate':_0xeb07('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0259dd6..55b4b49 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 _0x06da=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','attributes','then','moment'];(function(_0x1e40df,_0x18b1a5){var _0x4bfb7b=function(_0x3d5ca4){while(--_0x3d5ca4){_0x1e40df['push'](_0x1e40df['shift']());}};_0x4bfb7b(++_0x18b1a5);}(_0x06da,0x8f));var _0xa06d=function(_0x19a5ae,_0x43123e){_0x19a5ae=_0x19a5ae-0x0;var _0x2dc32a=_0x06da[_0x19a5ae];return _0x2dc32a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa06d('0x0'));var BPromise=require('bluebird');var rs=require(_0xa06d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa06d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa06d('0x3'))('rpc');var config=require(_0xa06d('0x4'));var jayson=require(_0xa06d('0x5'));var client=jayson[_0xa06d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3abe3f,_0x33f7b8,_0x21f2d4){return new BPromise(function(_0x25d5cb,_0x1b2f60){return client[_0xa06d('0x7')](_0x3abe3f,_0x21f2d4)['then'](function(_0x23149b){logger[_0xa06d('0x8')]('FaxApplication,\x20%s,\x20%s',_0x33f7b8,_0xa06d('0x9'));logger[_0xa06d('0xa')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x33f7b8,_0xa06d('0x9'),JSON[_0xa06d('0xb')](_0x23149b));if(_0x23149b[_0xa06d('0xc')]){if(_0x23149b[_0xa06d('0xc')]['code']===0x1f4){logger[_0xa06d('0xc')](_0xa06d('0xd'),_0x33f7b8,_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);return _0x1b2f60(_0x23149b[_0xa06d('0xc')]['message']);}logger[_0xa06d('0xc')]('FaxApplication,\x20%s,\x20%s',_0x33f7b8,_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);return _0x25d5cb(_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);}else{logger[_0xa06d('0x8')](_0xa06d('0xd'),_0x33f7b8,_0xa06d('0x9'));_0x25d5cb(_0x23149b[_0xa06d('0xf')][_0xa06d('0xe')]);}})[_0xa06d('0x10')](function(_0xee559e){logger['error'](_0xa06d('0xd'),_0x33f7b8,_0xee559e);_0x1b2f60(_0xee559e);});});}exports[_0xa06d('0x11')]=function(_0x1cdc8d){var _0x2424de=this;return new Promise(function(_0x5c9738,_0xc78abc){return db[_0xa06d('0x12')][_0xa06d('0x13')](_0x1cdc8d[_0xa06d('0x14')],{'raw':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d[_0xa06d('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d['options']['where']||null:null,'attributes':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d['options'][_0xa06d('0x16')]||null:null,'limit':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d[_0xa06d('0x15')]['limit']||null:null})[_0xa06d('0x17')](function(_0x22e57d){logger[_0xa06d('0x8')](_0xa06d('0x11'),_0x1cdc8d);logger['debug']('UpdateFaxApplication',_0x1cdc8d,JSON[_0xa06d('0xb')](_0x22e57d));_0x5c9738(_0x22e57d);})[_0xa06d('0x10')](function(_0x15c669){logger[_0xa06d('0xc')](_0xa06d('0x11'),_0x15c669['message'],_0x1cdc8d);_0xc78abc(_0x2424de[_0xa06d('0xc')](0x1f4,_0x15c669[_0xa06d('0xe')]));});});}; \ No newline at end of file +var _0x0772=['rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','message','FaxApplication,\x20%s,\x20%s','result','UpdateFaxApplication','update','body','options','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15f69a,_0x19d686){var _0x37798a=function(_0x189753){while(--_0x189753){_0x15f69a['push'](_0x15f69a['shift']());}};_0x37798a(++_0x19d686);}(_0x0772,0x7f));var _0x2077=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x0772[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x2077('0x0'));var util=require(_0x2077('0x1'));var moment=require(_0x2077('0x2'));var BPromise=require(_0x2077('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2077('0x4'));var db=require(_0x2077('0x5'))['db'];var utils=require(_0x2077('0x6'));var logger=require(_0x2077('0x7'))(_0x2077('0x8'));var config=require(_0x2077('0x9'));var jayson=require(_0x2077('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1babbf,_0x3a583a,_0x35a40f){return new BPromise(function(_0x272a44,_0x25b3f0){return client[_0x2077('0xb')](_0x1babbf,_0x35a40f)[_0x2077('0xc')](function(_0x300b8f){logger[_0x2077('0xd')]('FaxApplication,\x20%s,\x20%s',_0x3a583a,_0x2077('0xe'));logger[_0x2077('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3a583a,_0x2077('0xe'),JSON[_0x2077('0x10')](_0x300b8f));if(_0x300b8f['error']){if(_0x300b8f[_0x2077('0x11')]['code']===0x1f4){logger[_0x2077('0x11')]('FaxApplication,\x20%s,\x20%s',_0x3a583a,_0x300b8f[_0x2077('0x11')][_0x2077('0x12')]);return _0x25b3f0(_0x300b8f[_0x2077('0x11')][_0x2077('0x12')]);}logger[_0x2077('0x11')](_0x2077('0x13'),_0x3a583a,_0x300b8f[_0x2077('0x11')][_0x2077('0x12')]);return _0x272a44(_0x300b8f[_0x2077('0x11')][_0x2077('0x12')]);}else{logger['info'](_0x2077('0x13'),_0x3a583a,'request\x20sent');_0x272a44(_0x300b8f[_0x2077('0x14')][_0x2077('0x12')]);}})['catch'](function(_0xac4033){logger[_0x2077('0x11')](_0x2077('0x13'),_0x3a583a,_0xac4033);_0x25b3f0(_0xac4033);});});}exports[_0x2077('0x15')]=function(_0x41276c){var _0x1e154e=this;return new Promise(function(_0x1d782b,_0x312cdb){return db['FaxApplication'][_0x2077('0x16')](_0x41276c[_0x2077('0x17')],{'raw':_0x41276c[_0x2077('0x18')]?_0x41276c[_0x2077('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41276c['options']?_0x41276c[_0x2077('0x18')][_0x2077('0x19')]||null:null,'attributes':_0x41276c[_0x2077('0x18')]?_0x41276c['options'][_0x2077('0x1a')]||null:null,'limit':_0x41276c[_0x2077('0x18')]?_0x41276c[_0x2077('0x18')]['limit']||null:null})[_0x2077('0xc')](function(_0x73a6e8){logger[_0x2077('0xd')](_0x2077('0x15'),_0x41276c);logger['debug']('UpdateFaxApplication',_0x41276c,JSON[_0x2077('0x10')](_0x73a6e8));_0x1d782b(_0x73a6e8);})['catch'](function(_0x3fb5c5){logger['error']('UpdateFaxApplication',_0x3fb5c5['message'],_0x41276c);_0x312cdb(_0x1e154e['error'](0x1f4,_0x3fb5c5[_0x2077('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 362c708..674daec 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 _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1871f4,_0x2659db){var _0x36f5cb=function(_0x4d946f){while(--_0x4d946f){_0x1871f4['push'](_0x1871f4['shift']());}};_0x36f5cb(++_0x2659db);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file +var _0x0abf=['isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0xb')]('/',auth[_0xf0ab('0x8')](),controller['create']);router[_0xf0ab('0xc')](_0xf0ab('0xd'),auth[_0xf0ab('0x8')](),controller['update']);router['delete'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);module[_0xf0ab('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 028d947..e8e801a 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 _0xb43c=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x2ba477,_0x2bc734){var _0x8429f=function(_0x209aa2){while(--_0x209aa2){_0x2ba477['push'](_0x2ba477['shift']());}};_0x8429f(++_0x2bc734);}(_0xb43c,0x191));var _0xcb43=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb43c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xcb43('0x0'));module[_0xcb43('0x1')]={'closed':{'type':Sequelize[_0xcb43('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb43('0x3')]},'disposition':{'type':Sequelize[_0xcb43('0x4')]},'secondDisposition':{'type':Sequelize[_0xcb43('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcb43('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcb43('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcb43('0x5')]('in',_0xcb43('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x807d=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x46fdbb,_0x217295){var _0x219d7e=function(_0x1350b8){while(--_0x1350b8){_0x46fdbb['push'](_0x46fdbb['shift']());}};_0x219d7e(++_0x217295);}(_0x807d,0x78));var _0xd807=function(_0xcbb343,_0x427810){_0xcbb343=_0xcbb343-0x0;var _0x275315=_0x807d[_0xcbb343];return _0x275315;};'use strict';var Sequelize=require(_0xd807('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd807('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd807('0x2')]},'disposition':{'type':Sequelize[_0xd807('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd807('0x3')]},'note':{'type':Sequelize[_0xd807('0x3')]},'read1stAt':{'type':Sequelize[_0xd807('0x2')]},'fax':{'type':Sequelize[_0xd807('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd807('0x4')]('in',_0xd807('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd807('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd807('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index e2794e1..57de026 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 _0x8276=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Users','fullname','TagIds','Tags','forEach','index','map','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','isEmpty','FaxAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','all','rows','catch','params','includeAll','options','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','merge','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','removeTags','download','unix','server','files','join','root','format','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8276,0x19c));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6827('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6827('0x1'));var moment=require(_0x6827('0x2'));var BPromise=require(_0x6827('0x3'));var Mustache=require('mustache');var util=require(_0x6827('0x4'));var path=require(_0x6827('0x5'));var sox=require(_0x6827('0x6'));var csv=require(_0x6827('0x7'));var ejs=require(_0x6827('0x8'));var fs=require('fs');var fs_extra=require(_0x6827('0x9'));var _=require(_0x6827('0xa'));var squel=require(_0x6827('0xb'));var crypto=require(_0x6827('0xc'));var jsforce=require(_0x6827('0xd'));var deskjs=require(_0x6827('0xe'));var toCsv=require(_0x6827('0x7'));var querystring=require(_0x6827('0xf'));var Papa=require('papaparse');var Redis=require(_0x6827('0x10'));var authService=require(_0x6827('0x11'));var qs=require(_0x6827('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6827('0x13'));var logger=require('../../config/logger')(_0x6827('0x14'));var utils=require(_0x6827('0x15'));var config=require(_0x6827('0x16'));var licenseUtil=require(_0x6827('0x17'));var db=require(_0x6827('0x18'))['db'];config[_0x6827('0x19')]=_[_0x6827('0x1a')](config[_0x6827('0x19')],{'host':_0x6827('0x1b'),'port':0x18eb});var socket=require(_0x6827('0x1c'))(new Redis(config[_0x6827('0x19')]));require('./faxInteraction.socket')[_0x6827('0x1d')](socket);function respondWithStatusCode(_0x4dcfd1,_0x57683d){_0x57683d=_0x57683d||0xcc;return function(_0x4aaf35){if(_0x4aaf35){return _0x4dcfd1[_0x6827('0x1e')](_0x57683d);}return _0x4dcfd1[_0x6827('0x1f')](_0x57683d)[_0x6827('0x20')]();};}function respondWithResult(_0x11633b,_0x5442c6){_0x5442c6=_0x5442c6||0xc8;return function(_0x1e77a6){if(_0x1e77a6){return _0x11633b[_0x6827('0x1f')](_0x5442c6)[_0x6827('0x21')](_0x1e77a6);}};}function respondWithFilteredResult(_0xa4c2be,_0x2e026c){return function(_0x15bcd1){if(_0x15bcd1){var _0x3fc657=typeof _0x2e026c['offset']===_0x6827('0x22')&&typeof _0x2e026c['limit']===_0x6827('0x22');var _0x7f01a1=_0x15bcd1[_0x6827('0x23')];var _0x315d62=_0x3fc657?0x0:_0x2e026c[_0x6827('0x24')];var _0x31b757=_0x3fc657?_0x15bcd1[_0x6827('0x23')]:_0x2e026c[_0x6827('0x24')]+_0x2e026c[_0x6827('0x25')];var _0x55ffd3;if(_0x31b757>=_0x7f01a1){_0x31b757=_0x7f01a1;_0x55ffd3=0xc8;}else{_0x55ffd3=0xce;}_0xa4c2be[_0x6827('0x1f')](_0x55ffd3);return _0xa4c2be[_0x6827('0x26')](_0x6827('0x27'),_0x315d62+'-'+_0x31b757+'/'+_0x7f01a1)[_0x6827('0x21')](_0x15bcd1);}return null;};}function patchUpdates(_0x1d4617){return function(_0x347a8a){try{jsonpatch[_0x6827('0x28')](_0x347a8a,_0x1d4617,!![]);}catch(_0x58f3ba){return BPromise[_0x6827('0x29')](_0x58f3ba);}return _0x347a8a[_0x6827('0x2a')]();};}function saveUpdates(_0x3efd4f,_0x145270){return function(_0x5bfd26){if(_0x5bfd26){return _0x5bfd26[_0x6827('0x2b')](_0x3efd4f)[_0x6827('0x2c')](function(_0x16f935){return _0x16f935;});}return null;};}function removeEntity(_0xeddf23,_0x1a4895){return function(_0x344f73){if(_0x344f73){return _0x344f73['destroy']()['then'](function(){_0xeddf23[_0x6827('0x1f')](0xcc)[_0x6827('0x20')]();});}};}function handleEntityNotFound(_0x5dc6cf,_0x23dbf9){return function(_0x2c481e){if(!_0x2c481e){_0x5dc6cf['sendStatus'](0x194);}return _0x2c481e;};}function handleError(_0xcd4001,_0xb83c2e){_0xb83c2e=_0xb83c2e||0x1f4;return function(_0x7ba86e){logger[_0x6827('0x2d')](_0x7ba86e[_0x6827('0x2e')]);if(_0x7ba86e[_0x6827('0x2f')]){delete _0x7ba86e['name'];}_0xcd4001[_0x6827('0x1f')](_0xb83c2e)[_0x6827('0x30')](_0x7ba86e);};}function getInteractionUsers(_0x59142d,_0x5ca5ca){return new BPromise(function(_0x46e045,_0x37f642){try{if(_0x5ca5ca[_0x59142d['id']]){_0x59142d[_0x6827('0x31')]=_['map'](_0x5ca5ca[_0x59142d['id']],function(_0x1f1e39){return{'id':_0x1f1e39['id'],'fullname':_0x1f1e39[_0x6827('0x32')]};});}}catch(_0x3442ab){_0x37f642(_0x3442ab);}_0x46e045(_0x59142d);});}function getInteractionTags(_0x187c9d,_0x573674){return new BPromise(function(_0x1f974e,_0x4c9ebe){try{if(_0x187c9d[_0x6827('0x33')]){_0x187c9d[_0x6827('0x34')]=[];_0x187c9d[_0x6827('0x33')]['split'](',')[_0x6827('0x35')](function(_0x2b8f58){_0x187c9d[_0x6827('0x34')]['push'](_0x573674[_0x2b8f58]);});}delete _0x187c9d[_0x6827('0x33')];}catch(_0x483d71){_0x4c9ebe(_0x483d71);}_0x1f974e(_0x187c9d);});}function updateFaxInteraction(_0x346f6e,_0x3b8f95,_0x4faa83){return new BPromise(function(_0x4d9f61,_0x1ab240){return getInteractionUsers(_0x346f6e,_0x4faa83)[_0x6827('0x2c')](function(_0x1537fb){return getInteractionTags(_0x1537fb,_0x3b8f95);})[_0x6827('0x2c')](function(_0x1df58a){_0x4d9f61(_0x1df58a);})['catch'](function(_0x3d47f9){_0x1ab240(_0x3d47f9);});});}exports[_0x6827('0x36')]=function(_0x18b27b,_0x23adff){var _0x422d0c={},_0x595220={},_0x1cc322={'count':0x0,'rows':[]};var _0x2cd1b7=_[_0x6827('0x37')](db[_0x6827('0x38')][_0x6827('0x39')],function(_0x179e7c){return{'name':_0x179e7c[_0x6827('0x3a')],'type':_0x179e7c[_0x6827('0x3b')][_0x6827('0x3c')]};});_0x595220[_0x6827('0x3d')]=_[_0x6827('0x37')](_0x2cd1b7,_0x6827('0x2f'));_0x595220[_0x6827('0x3e')]=_[_0x6827('0x3f')](_0x18b27b[_0x6827('0x3e')]);_0x595220[_0x6827('0x40')]=_[_0x6827('0x41')](_0x595220[_0x6827('0x3d')],_0x595220[_0x6827('0x3e')]);_0x422d0c['attributes']=_['intersection'](_0x595220[_0x6827('0x3d')],qs[_0x6827('0x42')](_0x18b27b['query']['fields']));_0x422d0c[_0x6827('0x43')]=_0x422d0c[_0x6827('0x43')][_0x6827('0x44')]?_0x422d0c[_0x6827('0x43')]:_0x595220[_0x6827('0x3d')];if(!_0x18b27b[_0x6827('0x3e')]['hasOwnProperty'](_0x6827('0x45'))){_0x422d0c['limit']=qs[_0x6827('0x25')](_0x18b27b['query'][_0x6827('0x25')]);_0x422d0c[_0x6827('0x24')]=qs[_0x6827('0x24')](_0x18b27b[_0x6827('0x3e')]['offset']);}_0x422d0c['order']=qs['sort'](_0x18b27b[_0x6827('0x3e')][_0x6827('0x46')]);_0x422d0c[_0x6827('0x47')]=qs['filters'](_[_0x6827('0x48')](_0x18b27b[_0x6827('0x3e')],_0x595220['filters']),_0x2cd1b7);var _0x172f35=[];var _0x341017=squel[_0x6827('0x49')]()[_0x6827('0x4a')]('id')[_0x6827('0x4a')](_0x6827('0x2f'))[_0x6827('0x4a')](_0x6827('0x4b'))[_0x6827('0x4c')](_0x6827('0x4d'));var _0x6fab36=squel['select']()[_0x6827('0x4a')](_0x6827('0x4e'))[_0x6827('0x4a')](_0x6827('0x4f'))[_0x6827('0x4a')](_0x6827('0x50'))[_0x6827('0x4c')]('user_has_fax_interactions','ui')[_0x6827('0x51')]('users','u',_0x6827('0x52'));var _0x2ee900=squel[_0x6827('0x49')]()[_0x6827('0x4c')](_0x6827('0x53'),'i')[_0x6827('0x51')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6827('0x51')](_0x6827('0x54'),'o',_0x6827('0x55'))[_0x6827('0x51')]('fax_accounts','a',_0x6827('0x56'))[_0x6827('0x51')]('fax_messages','me',_0x6827('0x57'))[_0x6827('0x51')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x6827('0x51')]('tools_tags','t',_0x6827('0x58'));var _0x53065e=squel[_0x6827('0x59')]();var _0x53c15f=[];var _0x32a5ec=squel[_0x6827('0x59')]();var _0x1e4309;if(_0x18b27b[_0x6827('0x3e')][_0x6827('0x5a')]){_0x1e4309=as['parseSearch'](_0x18b27b[_0x6827('0x3e')][_0x6827('0x5a')]);var _0x2a47e4=_0x1e4309[_0x6827('0x5b')];for(var _0x573a1f=0x0;_0x573a1f<_0x1e4309['conditions']['length'];_0x573a1f++){var _0x322daf=_0x1e4309[_0x6827('0x5c')][_0x573a1f];var _0x16f56a='i';var _0x4d6831=_[_0x6827('0x5d')](_0x2cd1b7,['name',_0x322daf[_0x6827('0x4a')]]);if(!_0x4d6831){switch(_0x322daf[_0x6827('0x4a')]){case'unreadMessages':if(_0x322daf['value']==0x1){_0x2ee900[_0x6827('0x5e')]('`'+_0x322daf[_0x6827('0x4a')]+_0x6827('0x5f'));}else{_0x2ee900[_0x6827('0x5e')]('`'+_0x322daf[_0x6827('0x4a')]+_0x6827('0x60'));}break;case _0x6827('0x61'):if(_0x322daf[_0x6827('0x62')]===_0x6827('0x63')){if(_0x322daf['value'][_0x6827('0x64')]('\x20')[_0x6827('0x44')]>0x1){_0x53065e[_0x2a47e4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6827('0x65')](_0x322daf[_0x6827('0x66')]),null);}else{var _0x432e47='%'+_0x322daf[_0x6827('0x66')]+'%';_0x53065e[_0x2a47e4](_0x6827('0x67'),_0x432e47,_0x432e47,_0x432e47);}}else{_0x4d6831=_[_0x6827('0x5d')](_0x2cd1b7,[_0x6827('0x2f'),_0x6827('0x68')]);_0x322daf[_0x6827('0x4a')]=_0x6827('0x68');_0xcfae0c=as[_0x6827('0x69')](_0x16f56a,_0x4d6831[_0x6827('0x3b')],_0x322daf);_0x53065e[_0x2a47e4](_0xcfae0c['text'],_0xcfae0c['value'][_0x6827('0x6a')],_0xcfae0c['value']['end']);}break;case _0x6827('0x6b'):var _0x2117cd=_0x322daf['value'][_0x6827('0x64')](',')[_0x6827('0x37')](function(_0x28c02a){return Number(_0x28c02a);});_0x2117cd[_0x6827('0x35')](function(_0x28971a){_0x32a5ec['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x28971a+',%');});_0x53c15f=_['union'](_0x53c15f,_0x2117cd);break;case _0x6827('0x6c'):if(_0x322daf[_0x6827('0x62')]===_0x6827('0x63')){_0x53065e[_0x2a47e4](_0x6827('0x6d'),'%'+_0x322daf['value']+'%',null);}else{_0x4d6831=_['find'](_0x2cd1b7,['name','UserId']);_0x322daf['field']='UserId';_0xcfae0c=as['buildExpression'](_0x16f56a,_0x4d6831[_0x6827('0x3b')],_0x322daf);_0x53065e[_0x2a47e4](_0xcfae0c[_0x6827('0x6e')],_0xcfae0c[_0x6827('0x66')]['start'],_0xcfae0c[_0x6827('0x66')][_0x6827('0x20')]);}break;case _0x6827('0x6f'):_0xcfae0c=as['buildExpression']('me',null,_0x322daf);_0x53065e[_0x2a47e4](_0xcfae0c[_0x6827('0x6e')],_0xcfae0c['value'][_0x6827('0x6a')],_0xcfae0c[_0x6827('0x66')][_0x6827('0x20')]);break;}}else{var _0xcfae0c=as['buildExpression'](_0x16f56a,_0x4d6831[_0x6827('0x3b')],_0x322daf);_0x53065e[_0x2a47e4](_0xcfae0c['text'],_0xcfae0c[_0x6827('0x66')][_0x6827('0x6a')],_0xcfae0c[_0x6827('0x66')][_0x6827('0x20')]);}}}else{var _0x14e6b6=_(_0x18b27b[_0x6827('0x3e')])[_0x6827('0x3f')]()[_0x6827('0x37')](function(_0x3682a6){return _['some'](_0x2cd1b7,['name',_0x3682a6])?_0x3682a6:undefined;})['compact']()[_0x6827('0x66')]();if(!_[_0x6827('0x70')](_0x14e6b6)){_0x14e6b6[_0x6827('0x35')](function(_0x4e27cd){if(_0x4e27cd===_0x6827('0x71')){_0x2ee900[_0x6827('0x47')]('i.FaxAccountId\x20IN\x20?',[][_0x6827('0x72')](_0x18b27b[_0x6827('0x3e')][_0x4e27cd]));}else if(_0x4e27cd==='createdAt'){var _0x418c01=JSON[_0x6827('0x73')](_0x18b27b[_0x6827('0x3e')][_0x4e27cd])[_0x6827('0x74')];var _0x2dbb5a=JSON[_0x6827('0x73')](_0x18b27b['query'][_0x4e27cd])[_0x6827('0x75')];_0x2ee900[_0x6827('0x47')](_0x6827('0x76'),_0x418c01,_0x2dbb5a);}else{if(_0x18b27b[_0x6827('0x3e')][_0x4e27cd]===_0x6827('0x77')){_0x2ee900[_0x6827('0x47')]('i.'+_0x4e27cd+_0x6827('0x78'));}else{_0x2ee900[_0x6827('0x47')]('i.'+_0x4e27cd+_0x6827('0x79'),_0x18b27b[_0x6827('0x3e')][_0x4e27cd]);}}});}if(_0x18b27b[_0x6827('0x3e')]['read']){if(_0x18b27b[_0x6827('0x3e')][_0x6827('0x7a')]==0x1){_0x2ee900['having'](_0x6827('0x7b'));}else{_0x2ee900['having'](_0x6827('0x7c'));}}if(_0x18b27b['query'][_0x6827('0x7d')]){_0x53c15f=_[_0x6827('0x7e')](_0x18b27b['query'][_0x6827('0x7d')])?_0x18b27b[_0x6827('0x3e')][_0x6827('0x7d')]:new Array(_0x18b27b[_0x6827('0x3e')][_0x6827('0x7d')]);_0x53c15f[_0x6827('0x35')](function(_0xce0956){_0x32a5ec['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xce0956+',%');});}if(_0x18b27b['query']['filter']){var _0x2b8332=_0x18b27b[_0x6827('0x3e')][_0x6827('0x7f')][_0x6827('0x80')]('\x5c','\x5c\x5c')[_0x6827('0x80')](/'/g,'\x27\x27');if(qs[_0x6827('0x81')](_0x2b8332)){_0x53065e['or'](_0x6827('0x82'),_0x2b8332+'%')['or'](_0x6827('0x83'),_0x2b8332+'%');}_0x53065e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2b8332+'%');}}_0x2ee900[_0x6827('0x47')](_0x53065e);_0x2ee900[_0x6827('0x84')](_0x6827('0x85'));var _0x13ccbe={'type':db[_0x6827('0x86')][_0x6827('0x87')]['SELECT'],'raw':!![]};var _0x5529c3=_0x2ee900[_0x6827('0x88')]();_0x5529c3[_0x6827('0x4a')](_0x6827('0x85'));_0x5529c3[_0x6827('0x4a')](_0x6827('0x89'),_0x6827('0x8a'));if(_0x422d0c[_0x6827('0x8b')]){_0x422d0c[_0x6827('0x8b')]['forEach'](function(_0xe2b105){var _0x1db8d0=_0xe2b105[0x0]==='contactName'?_0xe2b105[0x0]:'i.'+_0xe2b105[0x0];_0x2ee900[_0x6827('0x8b')](_0x1db8d0,_0xe2b105[0x1]===_0x6827('0x8c')?![]:!![]);});}if(!_[_0x6827('0x70')](_0x53c15f)){_0x2ee900[_0x6827('0x5e')](_0x32a5ec);_0x5529c3[_0x6827('0x47')](_0x6827('0x8d'),_0x53c15f);}BPromise[_0x6827('0x8e')]()[_0x6827('0x2c')](function(){if(!_0x1e4309){if(_0x18b27b[_0x6827('0x3e')][_0x6827('0x71')])return;_0x5529c3[_0x6827('0x47')](_0x6827('0x8f'));_0x2ee900['where'](_0x6827('0x8f'));return;}if(_0x18b27b[_0x6827('0x90')]['role']!==_0x6827('0x91'))return;return _0x18b27b[_0x6827('0x90')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x6827('0x2c')](function(_0x56e060){if(_[_0x6827('0x70')](_0x56e060)){_0x5529c3['where']('i.FaxAccountId\x20IS\x20NULL');_0x2ee900[_0x6827('0x47')](_0x6827('0x92'));}else{_0x5529c3['where'](_0x6827('0x93'),_['map'](_0x56e060,'id'));_0x2ee900[_0x6827('0x47')](_0x6827('0x93'),_[_0x6827('0x37')](_0x56e060,'id'));}});})['then'](function(){if(_0x18b27b[_0x6827('0x90')][_0x6827('0x94')]===_0x6827('0x91')&&!_0x1e4309&&!_0x18b27b[_0x6827('0x3e')][_0x6827('0x71')])return[];return db[_0x6827('0x95')][_0x6827('0x3e')](_0x5529c3[_0x6827('0x96')](),_0x13ccbe);})['then'](function(_0x4af1c0){_0x1cc322[_0x6827('0x23')]=_0x4af1c0['length'];if(_0x1cc322[_0x6827('0x23')]===0x0)return[];return db['sequelize'][_0x6827('0x3e')](_0x341017[_0x6827('0x96')](),_0x13ccbe)[_0x6827('0x2c')](function(_0x3f2e9b){_0x172f35=_[_0x6827('0x97')](_0x3f2e9b,'id');_0x13ccbe=_['merge'](_0x13ccbe,{'model':db[_0x6827('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18b27b[_0x6827('0x3e')][_0x6827('0x42')]){_0x422d0c[_0x6827('0x43')][_0x6827('0x35')](function(_0x24b53d){_0x2ee900['field']('i.'+_0x24b53d);});}else{_0x2ee900['field'](_0x6827('0x89'),_0x6827('0x8a'));_0x2ee900['field'](_0x6827('0x98'),_0x6827('0x99'));_0x2ee900['field']('a.mandatoryDisposition',_0x6827('0x9a'));_0x2ee900['field'](_0x6827('0x9b'),_0x6827('0x9c'));_0x2ee900[_0x6827('0x4a')]('i.*');_0x2ee900['field'](_0x6827('0x9d'),'Contact.firstName');_0x2ee900['field'](_0x6827('0x9e'),_0x6827('0x9f'));_0x2ee900['field'](_0x6827('0xa0'),_0x6827('0xa1'));_0x2ee900[_0x6827('0x4a')](_0x6827('0xa2'),'Contact.phone');_0x2ee900[_0x6827('0x4a')]('c.mobile',_0x6827('0xa3'));_0x2ee900['field'](_0x6827('0xa4'),_0x6827('0xa5'));_0x2ee900[_0x6827('0x4a')](_0x6827('0xa6'),_0x6827('0xa7'));_0x2ee900[_0x6827('0x4a')](_0x6827('0xa8'),_0x6827('0xa9'));_0x2ee900[_0x6827('0x4a')](_0x6827('0xaa'),_0x6827('0x33'));}if(_0x422d0c[_0x6827('0x25')])_0x2ee900[_0x6827('0x25')](_0x422d0c[_0x6827('0x25')]);if(_0x422d0c[_0x6827('0x24')])_0x2ee900[_0x6827('0x24')](_0x422d0c[_0x6827('0x24')]);return db['sequelize'][_0x6827('0x3e')](_0x2ee900[_0x6827('0x96')](),_0x13ccbe);})[_0x6827('0x2c')](function(_0x11c3fb){if(_0x11c3fb[_0x6827('0x44')]>0x0)_0x6fab36[_0x6827('0x47')](_0x6827('0xab'),_[_0x6827('0x37')](_0x11c3fb,'id'));return db[_0x6827('0x95')][_0x6827('0x3e')](_0x6fab36[_0x6827('0x96')](),_0x13ccbe)[_0x6827('0x2c')](function(_0x25ee84){var _0x36bad0=_['groupBy'](_0x25ee84,_0x6827('0xac'));var _0x9715fc=[];_0x11c3fb[_0x6827('0x35')](function(_0x4b4a0b){_0x9715fc[_0x6827('0xad')](updateFaxInteraction(_0x4b4a0b,_0x172f35,_0x36bad0));});return BPromise[_0x6827('0xae')](_0x9715fc);});});})['then'](function(_0x4d4061){_0x1cc322[_0x6827('0xaf')]=_0x4d4061;return _0x1cc322;})[_0x6827('0x2c')](respondWithFilteredResult(_0x23adff,_0x422d0c))[_0x6827('0xb0')](handleError(_0x23adff,null));};exports['show']=function(_0xbaa772,_0x1d559a){var _0x332530={'raw':![],'where':{'id':_0xbaa772[_0x6827('0xb1')]['id']}},_0x5a4354={};_0x5a4354['model']=_[_0x6827('0x3f')](db[_0x6827('0x38')][_0x6827('0x39')]);_0x5a4354[_0x6827('0x3e')]=_['keys'](_0xbaa772[_0x6827('0x3e')]);_0x5a4354[_0x6827('0x40')]=_[_0x6827('0x41')](_0x5a4354[_0x6827('0x3d')],_0x5a4354[_0x6827('0x3e')]);_0x332530[_0x6827('0x43')]=_['intersection'](_0x5a4354[_0x6827('0x3d')],qs[_0x6827('0x42')](_0xbaa772[_0x6827('0x3e')][_0x6827('0x42')]));_0x332530[_0x6827('0x43')]=_0x332530['attributes'][_0x6827('0x44')]?_0x332530[_0x6827('0x43')]:_0x5a4354[_0x6827('0x3d')];if(_0xbaa772[_0x6827('0x3e')][_0x6827('0xb2')]){_0x332530['include']=[{'all':!![]}];}_0x332530=_['merge']({},_0x332530,_0xbaa772[_0x6827('0xb3')]);return db[_0x6827('0x38')][_0x6827('0x5d')](_0x332530)[_0x6827('0x2c')](handleEntityNotFound(_0x1d559a,null))[_0x6827('0x2c')](respondWithResult(_0x1d559a,null))[_0x6827('0xb0')](handleError(_0x1d559a,null));};exports['create']=function(_0x31479a,_0x4d198d){return db[_0x6827('0x38')]['create'](_0x31479a['body'],{})[_0x6827('0x2c')](respondWithResult(_0x4d198d,0xc9))[_0x6827('0xb0')](handleError(_0x4d198d,null));};exports['update']=function(_0x2022b1,_0x4cbf39){if(_0x2022b1[_0x6827('0x6f')]['id']){delete _0x2022b1[_0x6827('0x6f')]['id'];}return db['FaxInteraction'][_0x6827('0x5d')]({'where':{'id':_0x2022b1[_0x6827('0xb1')]['id']}})[_0x6827('0x2c')](handleEntityNotFound(_0x4cbf39,null))['then'](saveUpdates(_0x2022b1[_0x6827('0x6f')],null))[_0x6827('0x2c')](respondWithResult(_0x4cbf39,null))[_0x6827('0xb0')](handleError(_0x4cbf39,null));};exports[_0x6827('0xb4')]=function(_0x13b021,_0x18acb6){return db['FaxInteraction'][_0x6827('0x5d')]({'where':{'id':_0x13b021[_0x6827('0xb1')]['id']}})[_0x6827('0x2c')](handleEntityNotFound(_0x18acb6,null))[_0x6827('0x2c')](removeEntity(_0x18acb6,null))[_0x6827('0xb0')](handleError(_0x18acb6,null));};exports[_0x6827('0xb5')]=function(_0x34841c,_0x256151){return db[_0x6827('0x38')][_0x6827('0xb5')]()[_0x6827('0x2c')](respondWithResult(_0x256151,null))[_0x6827('0xb0')](handleError(_0x256151,null));};exports[_0x6827('0xb6')]=function(_0x5cfd31,_0x29d365,_0x5a7955){return db[_0x6827('0xb7')][_0x6827('0x5d')]({'where':{'id':_0x5cfd31[_0x6827('0xb1')]['id']}})['then'](handleEntityNotFound(_0x29d365,null))[_0x6827('0x2c')](function(_0x63aeb9){if(_0x63aeb9){return _0x63aeb9['addMessage'](_0x5cfd31['body'][_0x6827('0xb8')],_[_0x6827('0xb9')](_0x5cfd31['body'],['ids','id'])||{});}})[_0x6827('0x2c')](respondWithResult(_0x29d365,null))['catch'](handleError(_0x29d365,null));};exports[_0x6827('0xba')]=function(_0x106e48,_0x21786e,_0x235722){var _0x18d88c={'raw':![],'where':{}};var _0x31f7f4={};var _0x2aae2d={'count':0x0,'rows':[]};return db[_0x6827('0x38')][_0x6827('0xbb')]({'where':{'id':_0x106e48['params']['id']}})[_0x6827('0x2c')](handleEntityNotFound(_0x21786e,null))['then'](function(_0x2ca9c1){if(_0x2ca9c1){_0x31f7f4[_0x6827('0x3d')]=_[_0x6827('0x3f')](db[_0x6827('0xb7')][_0x6827('0x39')]);_0x31f7f4[_0x6827('0x3e')]=_['keys'](_0x106e48[_0x6827('0x3e')]);_0x31f7f4[_0x6827('0x40')]=_[_0x6827('0x41')](_0x31f7f4[_0x6827('0x3d')],_0x31f7f4[_0x6827('0x3e')]);_0x18d88c['attributes']=_['intersection'](_0x31f7f4[_0x6827('0x3d')],qs['fields'](_0x106e48['query']['fields']));_0x18d88c[_0x6827('0x43')]=_0x18d88c['attributes'][_0x6827('0x44')]?_0x18d88c[_0x6827('0x43')]:_0x31f7f4[_0x6827('0x3d')];if(!_0x106e48[_0x6827('0x3e')][_0x6827('0xbc')](_0x6827('0x45'))){_0x18d88c[_0x6827('0x25')]=qs[_0x6827('0x25')](_0x106e48[_0x6827('0x3e')][_0x6827('0x25')]);_0x18d88c[_0x6827('0x24')]=qs[_0x6827('0x24')](_0x106e48['query'][_0x6827('0x24')]);}_0x18d88c[_0x6827('0x8b')]=qs['sort'](_0x106e48['query'][_0x6827('0x46')]);_0x18d88c[_0x6827('0x47')]=qs[_0x6827('0x40')](_[_0x6827('0x48')](_0x106e48[_0x6827('0x3e')],_0x31f7f4[_0x6827('0x40')]));_0x18d88c[_0x6827('0x47')]['FaxInteractionId']=_0x2ca9c1['id'];if(_0x106e48[_0x6827('0x3e')][_0x6827('0x7f')]){_0x18d88c[_0x6827('0x47')]=_[_0x6827('0xbd')](_0x18d88c['where'],{'$or':_[_0x6827('0x37')](_0x18d88c[_0x6827('0x43')],function(_0xdb1d0){var _0x1bc3ef={};_0x1bc3ef[_0xdb1d0]={'$like':'%'+_0x106e48['query'][_0x6827('0x7f')]+'%'};return _0x1bc3ef;})});}if(_0x106e48[_0x6827('0x3e')][_0x6827('0x74')]){var _0x2a5457=_0x106e48['query'][_0x6827('0x74')]['split'](',');var _0x3bf6c9={};_0x3bf6c9[_0x2a5457[0x0]]={'$gte':moment(_0x2a5457[0x1])['format'](_0x6827('0xbe'))};_0x18d88c['where']=_[_0x6827('0xbd')](_0x18d88c[_0x6827('0x47')],_0x3bf6c9);}_0x18d88c=_['merge']({},_0x18d88c,_0x106e48[_0x6827('0xb3')]);return db[_0x6827('0xb7')]['count']({'where':_0x18d88c[_0x6827('0x47')]})[_0x6827('0x2c')](function(_0x56508f){_0x2aae2d[_0x6827('0x23')]=_0x56508f;if(_0x106e48[_0x6827('0x3e')][_0x6827('0xb2')]){_0x18d88c[_0x6827('0xbf')]=[{'all':!![]}];}return db[_0x6827('0xb7')][_0x6827('0xc0')](_0x18d88c);})['then'](function(_0x388e71){_0x2aae2d[_0x6827('0xaf')]=_0x388e71;return _0x2aae2d;});}})[_0x6827('0x2c')](respondWithFilteredResult(_0x21786e,_0x18d88c))[_0x6827('0xb0')](handleError(_0x21786e,null));};exports[_0x6827('0xc1')]=function(_0x5047d5,_0x2ec290,_0x34de49){return db['FaxInteraction'][_0x6827('0x5d')]({'where':{'id':_0x5047d5[_0x6827('0xb1')]['id']}})[_0x6827('0x2c')](handleEntityNotFound(_0x2ec290,null))[_0x6827('0x2c')](function(_0xedcdfa){if(_0xedcdfa){return _0xedcdfa[_0x6827('0xc2')](_0x5047d5[_0x6827('0x6f')]['ids'],_[_0x6827('0xb9')](_0x5047d5['body'],['ids','id'])||{})[_0x6827('0xc3')](function(){return db['Tag'][_0x6827('0xc0')]({'attributes':['id',_0x6827('0x2f'),_0x6827('0x4b')],'where':{'id':_0x5047d5[_0x6827('0x6f')][_0x6827('0xb8')]}});})['then'](function(_0x17bc73){socket[_0x6827('0xc4')]('faxInteractionTags:save',{'id':Number(_0x5047d5[_0x6827('0xb1')]['id']),'tags':_0x17bc73||[]});return{'id':Number(_0x5047d5[_0x6827('0xb1')]['id']),'tags':_0x17bc73||[]};});}})[_0x6827('0x2c')](respondWithResult(_0x2ec290,null))[_0x6827('0xb0')](handleError(_0x2ec290,null));};exports[_0x6827('0xc5')]=function(_0x1887bc,_0x2ac671,_0x97e555){return db[_0x6827('0x38')][_0x6827('0x5d')]({'where':{'id':_0x1887bc[_0x6827('0xb1')]['id']}})[_0x6827('0x2c')](handleEntityNotFound(_0x2ac671,null))[_0x6827('0x2c')](function(_0x5b7031){if(_0x5b7031){return _0x5b7031['removeTags'](_0x1887bc['query'][_0x6827('0xb8')]);}})[_0x6827('0x2c')](respondWithStatusCode(_0x2ac671,null))['catch'](handleError(_0x2ac671,null));};exports[_0x6827('0xc6')]=function(_0x58067b,_0x9f33b2){var _0x5d456b=moment()[_0x6827('0xc7')]()['toString']();var _0x2edce8=path['join'](config['root'],_0x6827('0xc8'),_0x6827('0xc9'),'tmp');var _0x300e2a=path[_0x6827('0xca')](config[_0x6827('0xcb')],'server',_0x6827('0xc9'),'attachments');var _0x2e4dd2=path['join'](_0x2edce8,_0x5d456b);var _0x56cab9=util[_0x6827('0xcc')]('transcript-%d-%s.zip',_0x58067b['params']['id'],_0x5d456b);var _0x118d0e=path[_0x6827('0xca')](_0x2edce8,_0x56cab9);var _0x4d0200=[];_0x4d0200[_0x6827('0xad')]({'model':db[_0x6827('0xcd')],'as':'Attachment','raw':!![]});var _0x317ef8=[{'model':db['FaxMessage'],'as':_0x6827('0xce'),'attributes':['id',_0x6827('0x6f'),_0x6827('0xcf')],'include':_0x4d0200}];return db[_0x6827('0x38')][_0x6827('0x5d')]({'where':{'id':_0x58067b[_0x6827('0xb1')]['id']},'include':_0x317ef8})['then'](handleEntityNotFound(_0x9f33b2,null))['then'](function(_0xe137){if(_0xe137&&_0xe137[_0x6827('0xce')]){var _0x41a3cd=_0xe137[_0x6827('0xd0')]({'plain':!![]});fs[_0x6827('0xd1')](_0x2e4dd2);for(var _0x520222=0x0;_0x520222<_0x41a3cd[_0x6827('0xce')]['length'];_0x520222++){var _0x489fa2=_0x41a3cd[_0x6827('0xce')][_0x520222][_0x6827('0xcd')];if(_0x489fa2){var _0x45c822=path[_0x6827('0xca')](_0x300e2a,_0x489fa2[_0x6827('0xd2')]);if(fs[_0x6827('0xd3')](_0x45c822)){fs['createReadStream'](_0x45c822)[_0x6827('0xd4')](fs[_0x6827('0xd5')](path[_0x6827('0xca')](_0x2e4dd2,_0x489fa2[_0x6827('0xd2')])));}}}return BPromise[_0x6827('0x8e')]()[_0x6827('0x2c')](function(){return new BPromise(function(_0x57d155,_0xb2f18){zipdir(_0x2e4dd2,{'saveTo':_0x118d0e},function(_0x5ba605,_0x2f0a75){if(_0x5ba605)return _0xb2f18(_0x5ba605);return _0x57d155(_0x2f0a75);});})[_0x6827('0x2c')](function(){return new BPromise(function(_0x7d7e91,_0x2b7f27){rimraf(_0x2e4dd2,function(_0x4b46ea){if(_0x4b46ea)_0x2b7f27(_0x4b46ea);return _0x7d7e91();});});})[_0x6827('0x2c')](function(){return _0x9f33b2['download'](_0x118d0e,_0x56cab9,function(_0x1b418a){if(_0x1b418a){console[_0x6827('0xd6')](_0x6827('0xd7'),_0x1b418a);}else{fs[_0x6827('0xd8')](_0x118d0e);}});});});}else{return _0x9f33b2[_0x6827('0x1e')](0xc8);}})[_0x6827('0xb0')](handleError(_0x9f33b2,null));}; \ No newline at end of file +var _0x46b4=['show','params','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','omit','pick','FaxInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','ids','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','push','Attachment','Messages','mkdirSync','basename','existsSync','pipe','resolve','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','Users','TagIds','split','forEach','Tags','index','map','FaxInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','catch'];(function(_0x24885a,_0x57e9c4){var _0x1c25b4=function(_0x2795d1){while(--_0x2795d1){_0x24885a['push'](_0x24885a['shift']());}};_0x1c25b4(++_0x57e9c4);}(_0x46b4,0x1cd));var _0x446b=function(_0x43ecbb,_0x351b58){_0x43ecbb=_0x43ecbb-0x0;var _0x42cf7b=_0x46b4[_0x43ecbb];return _0x42cf7b;};'use strict';var emlformat=require(_0x446b('0x0'));var rimraf=require(_0x446b('0x1'));var zipdir=require(_0x446b('0x2'));var jsonpatch=require(_0x446b('0x3'));var rp=require(_0x446b('0x4'));var moment=require('moment');var BPromise=require(_0x446b('0x5'));var Mustache=require(_0x446b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x446b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x446b('0x8'));var _=require('lodash');var squel=require(_0x446b('0x9'));var crypto=require(_0x446b('0xa'));var jsforce=require(_0x446b('0xb'));var deskjs=require(_0x446b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x446b('0xd'));var Redis=require('ioredis');var authService=require(_0x446b('0xe'));var qs=require(_0x446b('0xf'));var as=require(_0x446b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x446b('0x11'));var utils=require(_0x446b('0x12'));var config=require(_0x446b('0x13'));var licenseUtil=require(_0x446b('0x14'));var db=require(_0x446b('0x15'))['db'];config[_0x446b('0x16')]=_[_0x446b('0x17')](config['redis'],{'host':_0x446b('0x18'),'port':0x18eb});var socket=require(_0x446b('0x19'))(new Redis(config[_0x446b('0x16')]));require('./faxInteraction.socket')[_0x446b('0x1a')](socket);function respondWithStatusCode(_0xc270a8,_0x16a4dd){_0x16a4dd=_0x16a4dd||0xcc;return function(_0x3a81c1){if(_0x3a81c1){return _0xc270a8[_0x446b('0x1b')](_0x16a4dd);}return _0xc270a8[_0x446b('0x1c')](_0x16a4dd)[_0x446b('0x1d')]();};}function respondWithResult(_0x58b28f,_0x1ccd49){_0x1ccd49=_0x1ccd49||0xc8;return function(_0x3cc4c2){if(_0x3cc4c2){return _0x58b28f[_0x446b('0x1c')](_0x1ccd49)['json'](_0x3cc4c2);}};}function respondWithFilteredResult(_0x240c0e,_0x3795c7){return function(_0x19f814){if(_0x19f814){var _0x12e762=typeof _0x3795c7[_0x446b('0x1e')]===_0x446b('0x1f')&&typeof _0x3795c7['limit']===_0x446b('0x1f');var _0x24f007=_0x19f814['count'];var _0x15e21c=_0x12e762?0x0:_0x3795c7[_0x446b('0x1e')];var _0x367618=_0x12e762?_0x19f814[_0x446b('0x20')]:_0x3795c7[_0x446b('0x1e')]+_0x3795c7[_0x446b('0x21')];var _0x4404cc;if(_0x367618>=_0x24f007){_0x367618=_0x24f007;_0x4404cc=0xc8;}else{_0x4404cc=0xce;}_0x240c0e['status'](_0x4404cc);return _0x240c0e[_0x446b('0x22')](_0x446b('0x23'),_0x15e21c+'-'+_0x367618+'/'+_0x24f007)[_0x446b('0x24')](_0x19f814);}return null;};}function patchUpdates(_0x485a61){return function(_0x25f484){try{jsonpatch[_0x446b('0x25')](_0x25f484,_0x485a61,!![]);}catch(_0x562e7f){return BPromise[_0x446b('0x26')](_0x562e7f);}return _0x25f484[_0x446b('0x27')]();};}function saveUpdates(_0x5b4b54,_0x3c11e6){return function(_0x35fc44){if(_0x35fc44){return _0x35fc44[_0x446b('0x28')](_0x5b4b54)[_0x446b('0x29')](function(_0x1de107){return _0x1de107;});}return null;};}function removeEntity(_0x48d322,_0x51b28d){return function(_0x46bc10){if(_0x46bc10){return _0x46bc10[_0x446b('0x2a')]()[_0x446b('0x29')](function(){_0x48d322[_0x446b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd915,_0x2c9f08){return function(_0x3cbec9){if(!_0x3cbec9){_0x2fd915[_0x446b('0x1b')](0x194);}return _0x3cbec9;};}function handleError(_0x523f41,_0x569459){_0x569459=_0x569459||0x1f4;return function(_0x3d6f1f){logger[_0x446b('0x2b')](_0x3d6f1f['stack']);if(_0x3d6f1f['name']){delete _0x3d6f1f[_0x446b('0x2c')];}_0x523f41[_0x446b('0x1c')](_0x569459)[_0x446b('0x2d')](_0x3d6f1f);};}function getInteractionUsers(_0x46de3e,_0x881cca){return new BPromise(function(_0x2fd7ab,_0x1ad62a){try{if(_0x881cca[_0x46de3e['id']]){_0x46de3e[_0x446b('0x2e')]=_['map'](_0x881cca[_0x46de3e['id']],function(_0x3f95e3){return{'id':_0x3f95e3['id'],'fullname':_0x3f95e3['fullname']};});}}catch(_0x51f225){_0x1ad62a(_0x51f225);}_0x2fd7ab(_0x46de3e);});}function getInteractionTags(_0x27cdb4,_0x164e0e){return new BPromise(function(_0x17b1fd,_0x2884df){try{if(_0x27cdb4['TagIds']){_0x27cdb4['Tags']=[];_0x27cdb4[_0x446b('0x2f')][_0x446b('0x30')](',')[_0x446b('0x31')](function(_0x144186){_0x27cdb4[_0x446b('0x32')]['push'](_0x164e0e[_0x144186]);});}delete _0x27cdb4[_0x446b('0x2f')];}catch(_0x2607b8){_0x2884df(_0x2607b8);}_0x17b1fd(_0x27cdb4);});}function updateFaxInteraction(_0x3e4ce1,_0xbc9b9b,_0x54a296){return new BPromise(function(_0xb7581,_0x28a502){return getInteractionUsers(_0x3e4ce1,_0x54a296)[_0x446b('0x29')](function(_0x1fc859){return getInteractionTags(_0x1fc859,_0xbc9b9b);})[_0x446b('0x29')](function(_0x1d570f){_0xb7581(_0x1d570f);})['catch'](function(_0x3190e2){_0x28a502(_0x3190e2);});});}exports[_0x446b('0x33')]=function(_0x59048e,_0x5cfa65){var _0xe78ac={},_0x8aee9a={},_0x1ba169={'count':0x0,'rows':[]};var _0x5c83ad=_[_0x446b('0x34')](db[_0x446b('0x35')][_0x446b('0x36')],function(_0x4f1999){return{'name':_0x4f1999[_0x446b('0x37')],'type':_0x4f1999[_0x446b('0x38')]['key']};});_0x8aee9a[_0x446b('0x39')]=_[_0x446b('0x34')](_0x5c83ad,_0x446b('0x2c'));_0x8aee9a[_0x446b('0x3a')]=_[_0x446b('0x3b')](_0x59048e[_0x446b('0x3a')]);_0x8aee9a[_0x446b('0x3c')]=_[_0x446b('0x3d')](_0x8aee9a['model'],_0x8aee9a[_0x446b('0x3a')]);_0xe78ac[_0x446b('0x3e')]=_[_0x446b('0x3d')](_0x8aee9a[_0x446b('0x39')],qs[_0x446b('0x3f')](_0x59048e[_0x446b('0x3a')][_0x446b('0x3f')]));_0xe78ac['attributes']=_0xe78ac[_0x446b('0x3e')][_0x446b('0x40')]?_0xe78ac['attributes']:_0x8aee9a[_0x446b('0x39')];if(!_0x59048e['query'][_0x446b('0x41')](_0x446b('0x42'))){_0xe78ac[_0x446b('0x21')]=qs[_0x446b('0x21')](_0x59048e['query'][_0x446b('0x21')]);_0xe78ac[_0x446b('0x1e')]=qs[_0x446b('0x1e')](_0x59048e['query']['offset']);}_0xe78ac['order']=qs[_0x446b('0x43')](_0x59048e[_0x446b('0x3a')][_0x446b('0x43')]);_0xe78ac[_0x446b('0x44')]=qs[_0x446b('0x3c')](_['pick'](_0x59048e[_0x446b('0x3a')],_0x8aee9a[_0x446b('0x3c')]),_0x5c83ad);var _0x32577c=[];var _0x165ba9=squel[_0x446b('0x45')]()[_0x446b('0x46')]('id')[_0x446b('0x46')](_0x446b('0x2c'))[_0x446b('0x46')](_0x446b('0x47'))[_0x446b('0x48')](_0x446b('0x49'));var _0x32beb8=squel[_0x446b('0x45')]()[_0x446b('0x46')](_0x446b('0x4a'))[_0x446b('0x46')](_0x446b('0x4b'))[_0x446b('0x46')](_0x446b('0x4c'))[_0x446b('0x48')](_0x446b('0x4d'),'ui')['left_join'](_0x446b('0x4e'),'u',_0x446b('0x4f'));var _0x350c47=squel[_0x446b('0x45')]()[_0x446b('0x48')](_0x446b('0x50'),'i')[_0x446b('0x51')]('cm_contacts','c',_0x446b('0x52'))[_0x446b('0x51')](_0x446b('0x4e'),'o',_0x446b('0x53'))[_0x446b('0x51')](_0x446b('0x54'),'a',_0x446b('0x55'))[_0x446b('0x51')](_0x446b('0x56'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x446b('0x51')](_0x446b('0x57'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x446b('0x58'));var _0x5e405c=squel[_0x446b('0x59')]();var _0x198b95=[];var _0x578e3e=squel[_0x446b('0x59')]();var _0x5816b2;if(_0x59048e['query'][_0x446b('0x5a')]){_0x5816b2=as[_0x446b('0x5b')](_0x59048e[_0x446b('0x3a')]['search']);var _0x201d9c=_0x5816b2[_0x446b('0x5c')];for(var _0x278e20=0x0;_0x278e20<_0x5816b2[_0x446b('0x5d')]['length'];_0x278e20++){var _0x40b2af=_0x5816b2['conditions'][_0x278e20];var _0x520dd8='i';var _0x4708eb=_[_0x446b('0x5e')](_0x5c83ad,['name',_0x40b2af[_0x446b('0x46')]]);if(!_0x4708eb){switch(_0x40b2af[_0x446b('0x46')]){case _0x446b('0x5f'):if(_0x40b2af[_0x446b('0x60')]==0x1){_0x350c47[_0x446b('0x61')]('`'+_0x40b2af[_0x446b('0x46')]+'`\x20=\x200');}else{_0x350c47[_0x446b('0x61')]('`'+_0x40b2af[_0x446b('0x46')]+'`\x20>\x200');}break;case _0x446b('0x62'):if(_0x40b2af[_0x446b('0x63')]==='$substring'){if(_0x40b2af[_0x446b('0x60')][_0x446b('0x30')]('\x20')[_0x446b('0x40')]>0x1){_0x5e405c[_0x201d9c](_0x446b('0x64'),qs[_0x446b('0x65')](_0x40b2af[_0x446b('0x60')]),null);}else{var _0x470c23='%'+_0x40b2af[_0x446b('0x60')]+'%';_0x5e405c[_0x201d9c](_0x446b('0x66'),_0x470c23,_0x470c23,_0x470c23);}}else{_0x4708eb=_[_0x446b('0x5e')](_0x5c83ad,[_0x446b('0x2c'),'ContactId']);_0x40b2af[_0x446b('0x46')]=_0x446b('0x67');_0x56eecc=as[_0x446b('0x68')](_0x520dd8,_0x4708eb[_0x446b('0x38')],_0x40b2af);_0x5e405c[_0x201d9c](_0x56eecc['text'],_0x56eecc[_0x446b('0x60')][_0x446b('0x69')],_0x56eecc[_0x446b('0x60')][_0x446b('0x1d')]);}break;case _0x446b('0x6a'):var _0x589472=_0x40b2af[_0x446b('0x60')][_0x446b('0x30')](',')[_0x446b('0x34')](function(_0x23d862){return Number(_0x23d862);});_0x589472[_0x446b('0x31')](function(_0x3541db){_0x578e3e['or'](_0x446b('0x6b'),'%,'+_0x3541db+',%');});_0x198b95=_['union'](_0x198b95,_0x589472);break;case _0x446b('0x6c'):if(_0x40b2af[_0x446b('0x63')]===_0x446b('0x6d')){_0x5e405c[_0x201d9c](_0x446b('0x6e'),'%'+_0x40b2af[_0x446b('0x60')]+'%',null);}else{_0x4708eb=_[_0x446b('0x5e')](_0x5c83ad,[_0x446b('0x2c'),_0x446b('0x6f')]);_0x40b2af[_0x446b('0x46')]=_0x446b('0x6f');_0x56eecc=as[_0x446b('0x68')](_0x520dd8,_0x4708eb[_0x446b('0x38')],_0x40b2af);_0x5e405c[_0x201d9c](_0x56eecc['text'],_0x56eecc[_0x446b('0x60')][_0x446b('0x69')],_0x56eecc[_0x446b('0x60')][_0x446b('0x1d')]);}break;case _0x446b('0x70'):_0x56eecc=as[_0x446b('0x68')]('me',null,_0x40b2af);_0x5e405c[_0x201d9c](_0x56eecc[_0x446b('0x71')],_0x56eecc[_0x446b('0x60')][_0x446b('0x69')],_0x56eecc[_0x446b('0x60')]['end']);break;}}else{var _0x56eecc=as[_0x446b('0x68')](_0x520dd8,_0x4708eb[_0x446b('0x38')],_0x40b2af);_0x5e405c[_0x201d9c](_0x56eecc[_0x446b('0x71')],_0x56eecc[_0x446b('0x60')][_0x446b('0x69')],_0x56eecc[_0x446b('0x60')][_0x446b('0x1d')]);}}}else{var _0x30a3a1=_(_0x59048e[_0x446b('0x3a')])['keys']()[_0x446b('0x34')](function(_0x382575){return _[_0x446b('0x72')](_0x5c83ad,[_0x446b('0x2c'),_0x382575])?_0x382575:undefined;})[_0x446b('0x73')]()[_0x446b('0x60')]();if(!_['isEmpty'](_0x30a3a1)){_0x30a3a1[_0x446b('0x31')](function(_0x5e651e){if(_0x5e651e===_0x446b('0x74')){_0x350c47[_0x446b('0x44')](_0x446b('0x75'),[][_0x446b('0x76')](_0x59048e[_0x446b('0x3a')][_0x5e651e]));}else if(_0x5e651e===_0x446b('0x77')){var _0x530fd3=JSON[_0x446b('0x78')](_0x59048e[_0x446b('0x3a')][_0x5e651e])[_0x446b('0x79')];var _0x17bb9d=JSON[_0x446b('0x78')](_0x59048e[_0x446b('0x3a')][_0x5e651e])[_0x446b('0x7a')];_0x350c47[_0x446b('0x44')](_0x446b('0x7b'),_0x530fd3,_0x17bb9d);}else{if(_0x59048e[_0x446b('0x3a')][_0x5e651e]==='null'){_0x350c47['where']('i.'+_0x5e651e+'\x20IS\x20NULL');}else{_0x350c47[_0x446b('0x44')]('i.'+_0x5e651e+'\x20=\x20?',_0x59048e[_0x446b('0x3a')][_0x5e651e]);}}});}if(_0x59048e[_0x446b('0x3a')][_0x446b('0x7c')]){if(_0x59048e[_0x446b('0x3a')][_0x446b('0x7c')]==0x1){_0x350c47['having'](_0x446b('0x7d'));}else{_0x350c47[_0x446b('0x61')](_0x446b('0x7e'));}}if(_0x59048e['query'][_0x446b('0x7f')]){_0x198b95=_[_0x446b('0x80')](_0x59048e[_0x446b('0x3a')][_0x446b('0x7f')])?_0x59048e[_0x446b('0x3a')]['tag']:new Array(_0x59048e[_0x446b('0x3a')]['tag']);_0x198b95['forEach'](function(_0x27c07d){_0x578e3e['or'](_0x446b('0x6b'),'%,'+_0x27c07d+',%');});}if(_0x59048e['query']['filter']){var _0x391121=_0x59048e[_0x446b('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0x446b('0x81')](/'/g,'\x27\x27');if(qs[_0x446b('0x82')](_0x391121)){_0x5e405c['or'](_0x446b('0x83'),_0x391121+'%')['or'](_0x446b('0x84'),_0x391121+'%');}_0x5e405c['or'](_0x446b('0x85'),_0x391121+'%');}}_0x350c47[_0x446b('0x44')](_0x5e405c);_0x350c47[_0x446b('0x86')]('i.id');var _0x1dd6d3={'type':db[_0x446b('0x87')][_0x446b('0x88')][_0x446b('0x89')],'raw':!![]};var _0x5ccbcc=_0x350c47['clone']();_0x5ccbcc[_0x446b('0x46')]('i.id');_0x5ccbcc[_0x446b('0x46')](_0x446b('0x8a'),'unreadMessages');if(_0xe78ac['order']){_0xe78ac[_0x446b('0x8b')][_0x446b('0x31')](function(_0x2db978){var _0x266c79=_0x2db978[0x0]===_0x446b('0x8c')?_0x2db978[0x0]:'i.'+_0x2db978[0x0];_0x350c47[_0x446b('0x8b')](_0x266c79,_0x2db978[0x1]===_0x446b('0x8d')?![]:!![]);});}if(!_[_0x446b('0x8e')](_0x198b95)){_0x350c47[_0x446b('0x61')](_0x578e3e);_0x5ccbcc['where'](_0x446b('0x8f'),_0x198b95);}BPromise['resolve']()[_0x446b('0x29')](function(){if(!_0x5816b2){if(_0x59048e[_0x446b('0x3a')]['FaxAccountId'])return;_0x5ccbcc[_0x446b('0x44')](_0x446b('0x90'));_0x350c47[_0x446b('0x44')](_0x446b('0x90'));return;}if(_0x59048e['user'][_0x446b('0x91')]!==_0x446b('0x92'))return;return _0x59048e[_0x446b('0x93')][_0x446b('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x297ae3){if(_[_0x446b('0x8e')](_0x297ae3)){_0x5ccbcc[_0x446b('0x44')]('i.FaxAccountId\x20IS\x20NULL');_0x350c47['where'](_0x446b('0x95'));}else{_0x5ccbcc[_0x446b('0x44')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x297ae3,'id'));_0x350c47['where'](_0x446b('0x75'),_[_0x446b('0x34')](_0x297ae3,'id'));}});})['then'](function(){if(_0x59048e[_0x446b('0x93')][_0x446b('0x91')]==='agent'&&!_0x5816b2&&!_0x59048e[_0x446b('0x3a')][_0x446b('0x74')])return[];return db[_0x446b('0x96')][_0x446b('0x3a')](_0x5ccbcc[_0x446b('0x97')](),_0x1dd6d3);})[_0x446b('0x29')](function(_0x4b9666){_0x1ba169[_0x446b('0x20')]=_0x4b9666[_0x446b('0x40')];if(_0x1ba169[_0x446b('0x20')]===0x0)return[];return db['sequelize'][_0x446b('0x3a')](_0x165ba9[_0x446b('0x97')](),_0x1dd6d3)[_0x446b('0x29')](function(_0xff109b){_0x32577c=_['keyBy'](_0xff109b,'id');_0x1dd6d3=_['merge'](_0x1dd6d3,{'model':db[_0x446b('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x59048e[_0x446b('0x3a')][_0x446b('0x3f')]){_0xe78ac[_0x446b('0x3e')][_0x446b('0x31')](function(_0xf3fa91){_0x350c47['field']('i.'+_0xf3fa91);});}else{_0x350c47[_0x446b('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x446b('0x5f'));_0x350c47[_0x446b('0x46')](_0x446b('0x98'),_0x446b('0x99'));_0x350c47[_0x446b('0x46')](_0x446b('0x9a'),'Account.mandatoryDisposition');_0x350c47[_0x446b('0x46')](_0x446b('0x9b'),_0x446b('0x8c'));_0x350c47['field']('i.*');_0x350c47['field'](_0x446b('0x9c'),_0x446b('0x9d'));_0x350c47[_0x446b('0x46')](_0x446b('0x9e'),_0x446b('0x9f'));_0x350c47[_0x446b('0x46')](_0x446b('0xa0'),_0x446b('0xa1'));_0x350c47[_0x446b('0x46')]('c.phone','Contact.phone');_0x350c47[_0x446b('0x46')](_0x446b('0xa2'),'Contact.mobile');_0x350c47['field']('c.fax',_0x446b('0xa3'));_0x350c47[_0x446b('0x46')](_0x446b('0xa4'),_0x446b('0xa5'));_0x350c47['field']('o.internal',_0x446b('0xa6'));_0x350c47[_0x446b('0x46')](_0x446b('0xa7'),_0x446b('0x2f'));}if(_0xe78ac[_0x446b('0x21')])_0x350c47['limit'](_0xe78ac[_0x446b('0x21')]);if(_0xe78ac['offset'])_0x350c47[_0x446b('0x1e')](_0xe78ac['offset']);return db[_0x446b('0x96')]['query'](_0x350c47['toString'](),_0x1dd6d3);})[_0x446b('0x29')](function(_0x3698fd){if(_0x3698fd['length']>0x0)_0x32beb8[_0x446b('0x44')](_0x446b('0xa8'),_['map'](_0x3698fd,'id'));return db[_0x446b('0x96')][_0x446b('0x3a')](_0x32beb8[_0x446b('0x97')](),_0x1dd6d3)[_0x446b('0x29')](function(_0x47392c){var _0x12f155=_[_0x446b('0xa9')](_0x47392c,'FaxInteractionId');var _0x50e459=[];_0x3698fd[_0x446b('0x31')](function(_0x160450){_0x50e459['push'](updateFaxInteraction(_0x160450,_0x32577c,_0x12f155));});return BPromise['all'](_0x50e459);});});})['then'](function(_0x5da8cd){_0x1ba169[_0x446b('0xaa')]=_0x5da8cd;return _0x1ba169;})[_0x446b('0x29')](respondWithFilteredResult(_0x5cfa65,_0xe78ac))[_0x446b('0xab')](handleError(_0x5cfa65,null));};exports[_0x446b('0xac')]=function(_0x562269,_0xd089ec){var _0x4e3938={'raw':![],'where':{'id':_0x562269[_0x446b('0xad')]['id']}},_0x12deb4={};_0x12deb4[_0x446b('0x39')]=_[_0x446b('0x3b')](db['FaxInteraction'][_0x446b('0x36')]);_0x12deb4[_0x446b('0x3a')]=_['keys'](_0x562269['query']);_0x12deb4[_0x446b('0x3c')]=_['intersection'](_0x12deb4[_0x446b('0x39')],_0x12deb4[_0x446b('0x3a')]);_0x4e3938[_0x446b('0x3e')]=_[_0x446b('0x3d')](_0x12deb4['model'],qs[_0x446b('0x3f')](_0x562269[_0x446b('0x3a')][_0x446b('0x3f')]));_0x4e3938[_0x446b('0x3e')]=_0x4e3938[_0x446b('0x3e')]['length']?_0x4e3938[_0x446b('0x3e')]:_0x12deb4[_0x446b('0x39')];if(_0x562269[_0x446b('0x3a')][_0x446b('0xae')]){_0x4e3938[_0x446b('0xaf')]=[{'all':!![]}];}_0x4e3938=_[_0x446b('0xb0')]({},_0x4e3938,_0x562269[_0x446b('0xb1')]);return db[_0x446b('0x35')][_0x446b('0x5e')](_0x4e3938)['then'](handleEntityNotFound(_0xd089ec,null))[_0x446b('0x29')](respondWithResult(_0xd089ec,null))[_0x446b('0xab')](handleError(_0xd089ec,null));};exports[_0x446b('0xb2')]=function(_0x237881,_0x13ffd9){return db['FaxInteraction'][_0x446b('0xb2')](_0x237881[_0x446b('0x70')],{})['then'](respondWithResult(_0x13ffd9,0xc9))['catch'](handleError(_0x13ffd9,null));};exports[_0x446b('0x28')]=function(_0x2ee788,_0x27f580){if(_0x2ee788['body']['id']){delete _0x2ee788[_0x446b('0x70')]['id'];}return db[_0x446b('0x35')][_0x446b('0x5e')]({'where':{'id':_0x2ee788[_0x446b('0xad')]['id']}})[_0x446b('0x29')](handleEntityNotFound(_0x27f580,null))[_0x446b('0x29')](saveUpdates(_0x2ee788[_0x446b('0x70')],null))[_0x446b('0x29')](respondWithResult(_0x27f580,null))['catch'](handleError(_0x27f580,null));};exports[_0x446b('0x2a')]=function(_0x4e8a35,_0x2ded48){return db['FaxInteraction'][_0x446b('0x5e')]({'where':{'id':_0x4e8a35[_0x446b('0xad')]['id']}})[_0x446b('0x29')](handleEntityNotFound(_0x2ded48,null))[_0x446b('0x29')](removeEntity(_0x2ded48,null))['catch'](handleError(_0x2ded48,null));};exports['describe']=function(_0x2f60ba,_0x368438){return db['FaxInteraction'][_0x446b('0xb3')]()[_0x446b('0x29')](respondWithResult(_0x368438,null))[_0x446b('0xab')](handleError(_0x368438,null));};exports[_0x446b('0xb4')]=function(_0x553ca0,_0x26f3ad,_0x52db2b){return db[_0x446b('0xb5')][_0x446b('0x5e')]({'where':{'id':_0x553ca0[_0x446b('0xad')]['id']}})[_0x446b('0x29')](handleEntityNotFound(_0x26f3ad,null))[_0x446b('0x29')](function(_0x516b9d){if(_0x516b9d){return _0x516b9d['addMessage'](_0x553ca0[_0x446b('0x70')]['ids'],_[_0x446b('0xb6')](_0x553ca0[_0x446b('0x70')],['ids','id'])||{});}})[_0x446b('0x29')](respondWithResult(_0x26f3ad,null))[_0x446b('0xab')](handleError(_0x26f3ad,null));};exports['getMessages']=function(_0x31c193,_0x3fc242,_0x41bc5d){var _0x1b3cbe={'raw':![],'where':{}};var _0x2f1f21={};var _0x9fb588={'count':0x0,'rows':[]};return db[_0x446b('0x35')]['findOne']({'where':{'id':_0x31c193[_0x446b('0xad')]['id']}})['then'](handleEntityNotFound(_0x3fc242,null))[_0x446b('0x29')](function(_0x3d10de){if(_0x3d10de){_0x2f1f21[_0x446b('0x39')]=_[_0x446b('0x3b')](db[_0x446b('0xb5')][_0x446b('0x36')]);_0x2f1f21[_0x446b('0x3a')]=_[_0x446b('0x3b')](_0x31c193['query']);_0x2f1f21[_0x446b('0x3c')]=_[_0x446b('0x3d')](_0x2f1f21[_0x446b('0x39')],_0x2f1f21[_0x446b('0x3a')]);_0x1b3cbe[_0x446b('0x3e')]=_[_0x446b('0x3d')](_0x2f1f21[_0x446b('0x39')],qs[_0x446b('0x3f')](_0x31c193[_0x446b('0x3a')][_0x446b('0x3f')]));_0x1b3cbe['attributes']=_0x1b3cbe[_0x446b('0x3e')][_0x446b('0x40')]?_0x1b3cbe[_0x446b('0x3e')]:_0x2f1f21[_0x446b('0x39')];if(!_0x31c193[_0x446b('0x3a')][_0x446b('0x41')](_0x446b('0x42'))){_0x1b3cbe[_0x446b('0x21')]=qs[_0x446b('0x21')](_0x31c193['query'][_0x446b('0x21')]);_0x1b3cbe['offset']=qs['offset'](_0x31c193[_0x446b('0x3a')][_0x446b('0x1e')]);}_0x1b3cbe[_0x446b('0x8b')]=qs['sort'](_0x31c193[_0x446b('0x3a')][_0x446b('0x43')]);_0x1b3cbe[_0x446b('0x44')]=qs[_0x446b('0x3c')](_[_0x446b('0xb7')](_0x31c193['query'],_0x2f1f21[_0x446b('0x3c')]));_0x1b3cbe[_0x446b('0x44')][_0x446b('0xb8')]=_0x3d10de['id'];if(_0x31c193[_0x446b('0x3a')][_0x446b('0xb9')]){_0x1b3cbe[_0x446b('0x44')]=_[_0x446b('0xb0')](_0x1b3cbe[_0x446b('0x44')],{'$or':_[_0x446b('0x34')](_0x1b3cbe['attributes'],function(_0x44f51a){var _0x58cc6b={};_0x58cc6b[_0x44f51a]={'$like':'%'+_0x31c193[_0x446b('0x3a')][_0x446b('0xb9')]+'%'};return _0x58cc6b;})});}if(_0x31c193[_0x446b('0x3a')]['$gte']){var _0x31fa37=_0x31c193[_0x446b('0x3a')][_0x446b('0x79')]['split'](',');var _0x43977c={};_0x43977c[_0x31fa37[0x0]]={'$gte':moment(_0x31fa37[0x1])[_0x446b('0xba')](_0x446b('0xbb'))};_0x1b3cbe['where']=_['merge'](_0x1b3cbe[_0x446b('0x44')],_0x43977c);}_0x1b3cbe=_[_0x446b('0xb0')]({},_0x1b3cbe,_0x31c193[_0x446b('0xb1')]);return db[_0x446b('0xb5')][_0x446b('0x20')]({'where':_0x1b3cbe['where']})[_0x446b('0x29')](function(_0x4ef618){_0x9fb588[_0x446b('0x20')]=_0x4ef618;if(_0x31c193[_0x446b('0x3a')]['includeAll']){_0x1b3cbe['include']=[{'all':!![]}];}return db['FaxMessage'][_0x446b('0xbc')](_0x1b3cbe);})[_0x446b('0x29')](function(_0x5381c0){_0x9fb588['rows']=_0x5381c0;return _0x9fb588;});}})[_0x446b('0x29')](respondWithFilteredResult(_0x3fc242,_0x1b3cbe))['catch'](handleError(_0x3fc242,null));};exports[_0x446b('0xbd')]=function(_0x4e0136,_0x8c508,_0x291f8d){return db[_0x446b('0x35')][_0x446b('0x5e')]({'where':{'id':_0x4e0136[_0x446b('0xad')]['id']}})[_0x446b('0x29')](handleEntityNotFound(_0x8c508,null))[_0x446b('0x29')](function(_0x4a4d7f){if(_0x4a4d7f){return _0x4a4d7f[_0x446b('0xbe')](_0x4e0136[_0x446b('0x70')]['ids'],_[_0x446b('0xb6')](_0x4e0136[_0x446b('0x70')],['ids','id'])||{})[_0x446b('0xbf')](function(){return db[_0x446b('0x6a')][_0x446b('0xbc')]({'attributes':['id',_0x446b('0x2c'),_0x446b('0x47')],'where':{'id':_0x4e0136[_0x446b('0x70')][_0x446b('0xc0')]}});})[_0x446b('0x29')](function(_0x409530){socket['emit'](_0x446b('0xc1'),{'id':Number(_0x4e0136[_0x446b('0xad')]['id']),'tags':_0x409530||[]});return{'id':Number(_0x4e0136[_0x446b('0xad')]['id']),'tags':_0x409530||[]};});}})[_0x446b('0x29')](respondWithResult(_0x8c508,null))[_0x446b('0xab')](handleError(_0x8c508,null));};exports[_0x446b('0xc2')]=function(_0x5c0b0f,_0x1f619f,_0x4b01f0){return db[_0x446b('0x35')][_0x446b('0x5e')]({'where':{'id':_0x5c0b0f[_0x446b('0xad')]['id']}})[_0x446b('0x29')](handleEntityNotFound(_0x1f619f,null))['then'](function(_0x3c6eca){if(_0x3c6eca){return _0x3c6eca['removeTags'](_0x5c0b0f[_0x446b('0x3a')]['ids']);}})[_0x446b('0x29')](respondWithStatusCode(_0x1f619f,null))[_0x446b('0xab')](handleError(_0x1f619f,null));};exports[_0x446b('0xc3')]=function(_0x5d67cc,_0x4ed503){var _0x1794a3=moment()[_0x446b('0xc4')]()[_0x446b('0x97')]();var _0xc29e43=path[_0x446b('0xc5')](config[_0x446b('0xc6')],_0x446b('0xc7'),_0x446b('0xc8'),'tmp');var _0x50b1ab=path[_0x446b('0xc5')](config[_0x446b('0xc6')],_0x446b('0xc7'),_0x446b('0xc8'),'attachments');var _0xb314b=path[_0x446b('0xc5')](_0xc29e43,_0x1794a3);var _0x24b518=util[_0x446b('0xba')](_0x446b('0xc9'),_0x5d67cc[_0x446b('0xad')]['id'],_0x1794a3);var _0x431549=path[_0x446b('0xc5')](_0xc29e43,_0x24b518);var _0x198417=[];_0x198417[_0x446b('0xca')]({'model':db['Attachment'],'as':_0x446b('0xcb'),'raw':!![]});var _0x54b6eb=[{'model':db[_0x446b('0xb5')],'as':_0x446b('0xcc'),'attributes':['id',_0x446b('0x70'),_0x446b('0x77')],'include':_0x198417}];return db[_0x446b('0x35')][_0x446b('0x5e')]({'where':{'id':_0x5d67cc[_0x446b('0xad')]['id']},'include':_0x54b6eb})['then'](handleEntityNotFound(_0x4ed503,null))[_0x446b('0x29')](function(_0x2465cb){if(_0x2465cb&&_0x2465cb['Messages']){var _0x79b9c2=_0x2465cb['get']({'plain':!![]});fs[_0x446b('0xcd')](_0xb314b);for(var _0x3ec369=0x0;_0x3ec369<_0x79b9c2[_0x446b('0xcc')][_0x446b('0x40')];_0x3ec369++){var _0x23044b=_0x79b9c2['Messages'][_0x3ec369][_0x446b('0xcb')];if(_0x23044b){var _0x2d42c8=path[_0x446b('0xc5')](_0x50b1ab,_0x23044b[_0x446b('0xce')]);if(fs[_0x446b('0xcf')](_0x2d42c8)){fs['createReadStream'](_0x2d42c8)[_0x446b('0xd0')](fs['createWriteStream'](path[_0x446b('0xc5')](_0xb314b,_0x23044b[_0x446b('0xce')])));}}}return BPromise[_0x446b('0xd1')]()[_0x446b('0x29')](function(){return new BPromise(function(_0x328b45,_0x33d8bc){zipdir(_0xb314b,{'saveTo':_0x431549},function(_0x105c76,_0x1f1e37){if(_0x105c76)return _0x33d8bc(_0x105c76);return _0x328b45(_0x1f1e37);});})[_0x446b('0x29')](function(){return new BPromise(function(_0x595401,_0x2ba238){rimraf(_0xb314b,function(_0x594df3){if(_0x594df3)_0x2ba238(_0x594df3);return _0x595401();});});})['then'](function(){return _0x4ed503[_0x446b('0xc3')](_0x431549,_0x24b518,function(_0x14fab1){if(_0x14fab1){console['log'](_0x446b('0xd2'),_0x14fab1);}else{fs['unlinkSync'](_0x431549);}});});});}else{return _0x4ed503['sendStatus'](0xc8);}})['catch'](handleError(_0x4ed503,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index df013f1..7a9bba1 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 _0x769f=['hook','exports','../../mysqldb','FaxInteraction','FaxMessage','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x57d56c,_0x4dd016){var _0x5845ec=function(_0x162ff0){while(--_0x162ff0){_0x57d56c['push'](_0x57d56c['shift']());}};_0x5845ec(++_0x4dd016);}(_0x769f,0x19a));var _0xf769=function(_0x240069,_0x2f7ccc){_0x240069=_0x240069-0x0;var _0x1ff577=_0x769f[_0x240069];return _0x1ff577;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xf769('0x0'))['db'][_0xf769('0x1')];var FaxMessage=require(_0xf769('0x0'))['db'][_0xf769('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf769('0x3'),'afterDestroy':_0xf769('0x4')};function emitEvent(_0x515afc){return function(_0x442950,_0xd92cd2,_0x45c3cf){_0x442950['getUsers']({'attributes':['id'],'raw':!![]})[_0xf769('0x5')](function(_0x429677){_0x442950['setDataValue'](_0xf769('0x6'),_0x429677[_0xf769('0x7')](function(_0x36e29c){return{'id':_0x36e29c['id']};}));return FaxMessage[_0xf769('0x8')]({'where':{'FaxInteractionId':_0x442950['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf769('0x5')](function(_0x196335){_0x442950[_0xf769('0x9')](_0xf769('0xa'),_0x196335[_0xf769('0xb')]);FaxInteractionEvents['emit'](_0x515afc+':'+_0x442950['id'],_0x442950);FaxInteractionEvents[_0xf769('0xc')](_0x515afc,_0x442950);_0x45c3cf(null);})[_0xf769('0xd')](_0x45c3cf(null));};}for(var e in events){if(events[_0xf769('0xe')](e)){var event=events[e];FaxInteraction[_0xf769('0xf')](e,emitEvent(event));}}module[_0xf769('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x0593=['save','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x0593,0x9c));var _0x3059=function(_0x368eaa,_0x44a604){_0x368eaa=_0x368eaa-0x0;var _0x54952d=_0x0593[_0x368eaa];return _0x54952d;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x3059('0x0')];var FaxMessage=require(_0x3059('0x1'))['db'][_0x3059('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3059('0x3')](0x0);var events={'afterCreate':_0x3059('0x4'),'afterUpdate':'update','afterDestroy':_0x3059('0x5')};function emitEvent(_0x576084){return function(_0x56c635,_0xd34d16,_0xc607b8){_0x56c635[_0x3059('0x6')]({'attributes':['id'],'raw':!![]})[_0x3059('0x7')](function(_0x53f660){_0x56c635['setDataValue']('Users',_0x53f660['map'](function(_0x1c81f1){return{'id':_0x1c81f1['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x56c635['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x53f76f){_0x56c635[_0x3059('0x8')](_0x3059('0x9'),_0x53f76f[_0x3059('0xa')]);FaxInteractionEvents[_0x3059('0xb')](_0x576084+':'+_0x56c635['id'],_0x56c635);FaxInteractionEvents[_0x3059('0xb')](_0x576084,_0x56c635);_0xc607b8(null);})[_0x3059('0xc')](_0xc607b8(null));};}for(var e in events){if(events[_0x3059('0xd')](e)){var event=events[e];FaxInteraction[_0x3059('0xe')](e,emitEvent(event));}}module[_0x3059('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 44ae94c..cb88a5b 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 _0x1c01=['api','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','format','lodash','util','../../config/logger'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0x1c01,0x190));var _0x11c0=function(_0x2da036,_0x152925){_0x2da036=_0x2da036-0x0;var _0x41e84c=_0x1c01[_0x2da036];return _0x41e84c;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var logger=require(_0x11c0('0x2'))(_0x11c0('0x3'));var moment=require('moment');var BPromise=require(_0x11c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11c0('0x5'));var config=require(_0x11c0('0x6'));var attributes=require(_0x11c0('0x7'));module[_0x11c0('0x8')]=function(_0x38c591,_0x5190a4){return _0x38c591[_0x11c0('0x9')]('FaxInteraction',attributes,{'tableName':_0x11c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x558a37,_0x127b2f,_0x5e7e01){if(_0x558a37[_0x11c0('0xb')]('closed')){_0x558a37['closedAt']=moment()[_0x11c0('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e7e01(null,_0x558a37);}}});}; \ No newline at end of file +var _0xcb0e=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcb0e,0x1c0));var _0xecb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb0e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecb0('0x0'));var util=require(_0xecb0('0x1'));var logger=require(_0xecb0('0x2'))(_0xecb0('0x3'));var moment=require(_0xecb0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xecb0('0x5'));var rimraf=require('rimraf');var config=require(_0xecb0('0x6'));var attributes=require(_0xecb0('0x7'));module[_0xecb0('0x8')]=function(_0x3ad8e5,_0x40e553){return _0x3ad8e5['define']('FaxInteraction',attributes,{'tableName':_0xecb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ee9b8,_0x4aaccd,_0x12f46b){if(_0x4ee9b8[_0xecb0('0xa')](_0xecb0('0xb'))){_0x4ee9b8['closedAt']=moment()[_0xecb0('0xc')](_0xecb0('0xd'));}_0x12f46b(null,_0x4ee9b8);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 971acc3..fd625f6 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 _0x29a1=['stringify','error','message','info','catch','FaxInteraction','update','body','options','raw','where','limit','debug','UpdateFaxInteraction','AddTagsToFaxInteraction','find','ids','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2d60bb,_0x4228ea){var _0x1e7b8e=function(_0x1a8ff8){while(--_0x1a8ff8){_0x2d60bb['push'](_0x2d60bb['shift']());}};_0x1e7b8e(++_0x4228ea);}(_0x29a1,0x124));var _0x129a=function(_0x1bb37b,_0x3a0b2e){_0x1bb37b=_0x1bb37b-0x0;var _0x4bf524=_0x29a1[_0x1bb37b];return _0x4bf524;};'use strict';var _=require('lodash');var util=require(_0x129a('0x0'));var moment=require(_0x129a('0x1'));var BPromise=require(_0x129a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x129a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x129a('0x4'));var logger=require(_0x129a('0x5'))(_0x129a('0x6'));var config=require(_0x129a('0x7'));var jayson=require(_0x129a('0x8'));var client=jayson[_0x129a('0x9')]['http']({'port':0x232a});config[_0x129a('0xa')]=_[_0x129a('0xb')](config['redis'],{'host':_0x129a('0xc'),'port':0x18eb});var socket=require(_0x129a('0xd'))(new Redis(config['redis']));require(_0x129a('0xe'))['register'](socket);function respondWithRpcPromise(_0xb489c5,_0x10fc46,_0x40cf93){return new BPromise(function(_0x44e8b6,_0x59d7aa){return client[_0x129a('0xf')](_0xb489c5,_0x40cf93)[_0x129a('0x10')](function(_0x469652){logger['info'](_0x129a('0x11'),_0x10fc46,_0x129a('0x12'));logger['debug'](_0x129a('0x13'),_0x10fc46,'request\x20sent',JSON[_0x129a('0x14')](_0x469652));if(_0x469652[_0x129a('0x15')]){if(_0x469652['error']['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x10fc46,_0x469652['error'][_0x129a('0x16')]);return _0x59d7aa(_0x469652['error']['message']);}logger[_0x129a('0x15')](_0x129a('0x11'),_0x10fc46,_0x469652[_0x129a('0x15')]['message']);return _0x44e8b6(_0x469652[_0x129a('0x15')][_0x129a('0x16')]);}else{logger[_0x129a('0x17')](_0x129a('0x11'),_0x10fc46,_0x129a('0x12'));_0x44e8b6(_0x469652['result'][_0x129a('0x16')]);}})[_0x129a('0x18')](function(_0x55d3eb){logger[_0x129a('0x15')](_0x129a('0x11'),_0x10fc46,_0x55d3eb);_0x59d7aa(_0x55d3eb);});});}exports['UpdateFaxInteraction']=function(_0x27f0d0){var _0x287794=this;return new Promise(function(_0x17ce45,_0x53ebad){return db[_0x129a('0x19')][_0x129a('0x1a')](_0x27f0d0[_0x129a('0x1b')],{'raw':_0x27f0d0[_0x129a('0x1c')]?_0x27f0d0[_0x129a('0x1c')][_0x129a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f0d0[_0x129a('0x1c')]?_0x27f0d0[_0x129a('0x1c')][_0x129a('0x1e')]||null:null,'attributes':_0x27f0d0[_0x129a('0x1c')]?_0x27f0d0[_0x129a('0x1c')]['attributes']||null:null,'limit':_0x27f0d0[_0x129a('0x1c')]?_0x27f0d0[_0x129a('0x1c')][_0x129a('0x1f')]||null:null})[_0x129a('0x10')](function(_0x40fb08){logger['info']('UpdateFaxInteraction',_0x27f0d0);logger[_0x129a('0x20')](_0x129a('0x21'),_0x27f0d0,JSON[_0x129a('0x14')](_0x40fb08));_0x17ce45(_0x40fb08);})[_0x129a('0x18')](function(_0x400c4d){logger[_0x129a('0x15')](_0x129a('0x21'),_0x400c4d['message'],_0x27f0d0);_0x53ebad(_0x287794[_0x129a('0x15')](0x1f4,_0x400c4d[_0x129a('0x16')]));});});};exports[_0x129a('0x22')]=function(_0x4f8c60){return new Promise(function(_0xb47227,_0x1f42b3){return db[_0x129a('0x19')][_0x129a('0x23')]({'where':_0x4f8c60[_0x129a('0x1c')]?_0x4f8c60[_0x129a('0x1c')][_0x129a('0x1e')]||null:null})[_0x129a('0x10')](function(_0x42e74c){if(_0x42e74c){return _0x42e74c['addTags'](_0x4f8c60[_0x129a('0x1b')][_0x129a('0x24')],_['omit'](_0x4f8c60['body'],[_0x129a('0x24'),'id'])||{});}})[_0x129a('0x25')](function(_0x42feb4){logger[_0x129a('0x17')](_0x129a('0x26'),_0x4f8c60);logger['debug'](_0x129a('0x26'),_0x4f8c60,JSON[_0x129a('0x14')](_0x42feb4));_0xb47227(_0x42feb4);})['catch'](function(_0x21bb84){logger[_0x129a('0x15')](_0x129a('0x26'),_0x21bb84['message'],_0x4f8c60);_0x1f42b3(_this['error'](0x1f4,_0x21bb84[_0x129a('0x16')]));});});}; \ No newline at end of file +var _0x8e7d=['localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','FaxInteraction','update','body','options','where','attributes','UpdateFaxInteraction','stringify','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x456904,_0x4cb25c){var _0x4b0063=function(_0x2cb59f){while(--_0x2cb59f){_0x456904['push'](_0x456904['shift']());}};_0x4b0063(++_0x4cb25c);}(_0x8e7d,0x184));var _0xd8e7=function(_0x40d800,_0x5c4a47){_0x40d800=_0x40d800-0x0;var _0x22fb2f=_0x8e7d[_0x40d800];return _0x22fb2f;};'use strict';var _=require('lodash');var util=require(_0xd8e7('0x0'));var moment=require(_0xd8e7('0x1'));var BPromise=require(_0xd8e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8e7('0x3'));var db=require(_0xd8e7('0x4'))['db'];var utils=require(_0xd8e7('0x5'));var logger=require(_0xd8e7('0x6'))(_0xd8e7('0x7'));var config=require(_0xd8e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8e7('0x9')]['http']({'port':0x232a});config[_0xd8e7('0xa')]=_[_0xd8e7('0xb')](config['redis'],{'host':_0xd8e7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8e7('0xa')]));require(_0xd8e7('0xd'))[_0xd8e7('0xe')](socket);function respondWithRpcPromise(_0x5dec33,_0x416e22,_0x286ae8){return new BPromise(function(_0x1e1cb7,_0x5044a7){return client[_0xd8e7('0xf')](_0x5dec33,_0x286ae8)[_0xd8e7('0x10')](function(_0x12308e){logger[_0xd8e7('0x11')](_0xd8e7('0x12'),_0x416e22,_0xd8e7('0x13'));logger[_0xd8e7('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x416e22,_0xd8e7('0x13'),JSON['stringify'](_0x12308e));if(_0x12308e[_0xd8e7('0x15')]){if(_0x12308e[_0xd8e7('0x15')][_0xd8e7('0x16')]===0x1f4){logger['error'](_0xd8e7('0x12'),_0x416e22,_0x12308e[_0xd8e7('0x15')][_0xd8e7('0x17')]);return _0x5044a7(_0x12308e[_0xd8e7('0x15')][_0xd8e7('0x17')]);}logger[_0xd8e7('0x15')](_0xd8e7('0x12'),_0x416e22,_0x12308e[_0xd8e7('0x15')][_0xd8e7('0x17')]);return _0x1e1cb7(_0x12308e['error']['message']);}else{logger[_0xd8e7('0x11')](_0xd8e7('0x12'),_0x416e22,'request\x20sent');_0x1e1cb7(_0x12308e[_0xd8e7('0x18')][_0xd8e7('0x17')]);}})[_0xd8e7('0x19')](function(_0x4ebb27){logger[_0xd8e7('0x15')](_0xd8e7('0x12'),_0x416e22,_0x4ebb27);_0x5044a7(_0x4ebb27);});});}exports['UpdateFaxInteraction']=function(_0x255362){var _0x60e6a5=this;return new Promise(function(_0x48bcd9,_0x443ba6){return db[_0xd8e7('0x1a')][_0xd8e7('0x1b')](_0x255362[_0xd8e7('0x1c')],{'raw':_0x255362[_0xd8e7('0x1d')]?_0x255362['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x255362[_0xd8e7('0x1d')]?_0x255362['options'][_0xd8e7('0x1e')]||null:null,'attributes':_0x255362[_0xd8e7('0x1d')]?_0x255362['options'][_0xd8e7('0x1f')]||null:null,'limit':_0x255362[_0xd8e7('0x1d')]?_0x255362['options']['limit']||null:null})[_0xd8e7('0x10')](function(_0x2eb177){logger[_0xd8e7('0x11')](_0xd8e7('0x20'),_0x255362);logger[_0xd8e7('0x14')](_0xd8e7('0x20'),_0x255362,JSON[_0xd8e7('0x21')](_0x2eb177));_0x48bcd9(_0x2eb177);})[_0xd8e7('0x19')](function(_0x3b0d3b){logger[_0xd8e7('0x15')](_0xd8e7('0x20'),_0x3b0d3b[_0xd8e7('0x17')],_0x255362);_0x443ba6(_0x60e6a5[_0xd8e7('0x15')](0x1f4,_0x3b0d3b[_0xd8e7('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4e86a8){return new Promise(function(_0x2e752d,_0x52229e){return db['FaxInteraction'][_0xd8e7('0x22')]({'where':_0x4e86a8['options']?_0x4e86a8[_0xd8e7('0x1d')][_0xd8e7('0x1e')]||null:null})[_0xd8e7('0x10')](function(_0x5bbe4d){if(_0x5bbe4d){return _0x5bbe4d[_0xd8e7('0x23')](_0x4e86a8[_0xd8e7('0x1c')][_0xd8e7('0x24')],_[_0xd8e7('0x25')](_0x4e86a8[_0xd8e7('0x1c')],[_0xd8e7('0x24'),'id'])||{});}})[_0xd8e7('0x26')](function(_0x4b59de){logger[_0xd8e7('0x11')](_0xd8e7('0x27'),_0x4e86a8);logger['debug'](_0xd8e7('0x27'),_0x4e86a8,JSON['stringify'](_0x4b59de));_0x2e752d(_0x4b59de);})['catch'](function(_0x5c7acb){logger[_0xd8e7('0x15')]('AddTags',_0x5c7acb[_0xd8e7('0x17')],_0x4e86a8);_0x52229e(_this[_0xd8e7('0x15')](0x1f4,_0x5c7acb['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a7e0771..f398b5d 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 _0xe60a=['remove','emit','removeListener','length','./faxInteraction.events','save'];(function(_0x3a1433,_0x47d601){var _0x4fb3b3=function(_0x6b5200){while(--_0x6b5200){_0x3a1433['push'](_0x3a1433['shift']());}};_0x4fb3b3(++_0x47d601);}(_0xe60a,0x166));var _0xae60=function(_0x4e252b,_0x5d5a41){_0x4e252b=_0x4e252b-0x0;var _0x4f4940=_0xe60a[_0x4e252b];return _0x4f4940;};'use strict';var FaxInteractionEvents=require(_0xae60('0x0'));var events=[_0xae60('0x1'),_0xae60('0x2'),'update'];function createListener(_0x2a1a9b,_0x234e49){return function(_0x17df7d){_0x234e49[_0xae60('0x3')](_0x2a1a9b,_0x17df7d);};}function removeListener(_0x29e28b,_0x1c1d53){return function(){FaxInteractionEvents[_0xae60('0x4')](_0x29e28b,_0x1c1d53);};}exports['register']=function(_0x1435ff){for(var _0x16b2ba=0x0,_0x446858=events[_0xae60('0x5')];_0x16b2ba<_0x446858;_0x16b2ba++){var _0x22bd5c=events[_0x16b2ba];var _0x5e135a=createListener('faxInteraction:'+_0x22bd5c,_0x1435ff);FaxInteractionEvents['on'](_0x22bd5c,_0x5e135a);}}; \ No newline at end of file +var _0x81c3=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','register','length'];(function(_0x315b9f,_0x381fa7){var _0x22429e=function(_0xef1d20){while(--_0xef1d20){_0x315b9f['push'](_0x315b9f['shift']());}};_0x22429e(++_0x381fa7);}(_0x81c3,0xf9));var _0x381c=function(_0x544067,_0x4e5a2d){_0x544067=_0x544067-0x0;var _0x229e97=_0x81c3[_0x544067];return _0x229e97;};'use strict';var FaxInteractionEvents=require(_0x381c('0x0'));var events=[_0x381c('0x1'),_0x381c('0x2'),_0x381c('0x3')];function createListener(_0x8ee3e3,_0x2c5f42){return function(_0x21d11b){_0x2c5f42[_0x381c('0x4')](_0x8ee3e3,_0x21d11b);};}function removeListener(_0x206ef7,_0x4921be){return function(){FaxInteractionEvents['removeListener'](_0x206ef7,_0x4921be);};}exports[_0x381c('0x5')]=function(_0x30e15c){for(var _0x4bc9c3=0x0,_0x497428=events[_0x381c('0x6')];_0x4bc9c3<_0x497428;_0x4bc9c3++){var _0xf9da38=events[_0x4bc9c3];var _0x325d87=createListener(_0x381c('0x7')+_0xf9da38,_0x30e15c);FaxInteractionEvents['on'](_0xf9da38,_0x325d87);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e5dcae2..37eacc6 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 _0x3e03=['describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','faxinteraction:update','update','delete','fax','faxinteraction:destroy','destroy','removeTags','exports','multer','util','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x4221d8,_0x341fe7){var _0x626640=function(_0x2ca98e){while(--_0x2ca98e){_0x4221d8['push'](_0x4221d8['shift']());}};_0x626640(++_0x341fe7);}(_0x3e03,0xc2));var _0x33e0=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x3e03[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0x33e0('0x0'));var util=require(_0x33e0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33e0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x33e0('0x3'));var controller=require(_0x33e0('0x4'));router[_0x33e0('0x5')]('/',auth[_0x33e0('0x6')](),controller[_0x33e0('0x7')]);router['get'](_0x33e0('0x8'),auth['isAuthenticated'](),controller[_0x33e0('0x9')]);router[_0x33e0('0x5')](_0x33e0('0xa'),auth[_0x33e0('0x6')](),controller[_0x33e0('0xb')]);router[_0x33e0('0x5')](_0x33e0('0xc'),auth[_0x33e0('0x6')](),controller[_0x33e0('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x33e0('0xe')]('/',auth[_0x33e0('0x6')](),controller[_0x33e0('0xf')]);router['post'](_0x33e0('0xc'),auth['isAuthenticated'](),controller[_0x33e0('0x10')]);router[_0x33e0('0xe')](_0x33e0('0x11'),auth[_0x33e0('0x6')](),interaction[_0x33e0('0x12')]('fax',_0x33e0('0x13')),controller['addTags']);router[_0x33e0('0x14')](_0x33e0('0xa'),auth['isAuthenticated'](),interaction[_0x33e0('0x12')]('fax',_0x33e0('0x15')),controller[_0x33e0('0x16')]);router[_0x33e0('0x17')](_0x33e0('0xa'),auth[_0x33e0('0x6')](),interaction[_0x33e0('0x12')](_0x33e0('0x18'),_0x33e0('0x19')),controller[_0x33e0('0x1a')]);router[_0x33e0('0x17')](_0x33e0('0x11'),auth[_0x33e0('0x6')](),controller[_0x33e0('0x1b')]);module[_0x33e0('0x1c')]=router; \ No newline at end of file +var _0x7007=['/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index'];(function(_0x28332c,_0x2e9d6a){var _0x14b0af=function(_0x3c1aea){while(--_0x3c1aea){_0x28332c['push'](_0x28332c['shift']());}};_0x14b0af(++_0x2e9d6a);}(_0x7007,0xa3));var _0x7700=function(_0x5e3e5a,_0x50d8f1){_0x5e3e5a=_0x5e3e5a-0x0;var _0xa611a4=_0x7007[_0x5e3e5a];return _0xa611a4;};'use strict';var multer=require(_0x7700('0x0'));var util=require('util');var path=require(_0x7700('0x1'));var timeout=require(_0x7700('0x2'));var express=require('express');var router=express[_0x7700('0x3')]();var fs_extra=require(_0x7700('0x4'));var auth=require(_0x7700('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7700('0x6'));var controller=require(_0x7700('0x7'));router[_0x7700('0x8')]('/',auth[_0x7700('0x9')](),controller[_0x7700('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x7700('0xb'),auth[_0x7700('0x9')](),controller[_0x7700('0xc')]);router[_0x7700('0x8')](_0x7700('0xd'),auth[_0x7700('0x9')](),controller[_0x7700('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7700('0xf')]);router[_0x7700('0x10')]('/',auth[_0x7700('0x9')](),controller[_0x7700('0x11')]);router[_0x7700('0x10')](_0x7700('0xd'),auth[_0x7700('0x9')](),controller[_0x7700('0x12')]);router['post']('/:id/tags',auth[_0x7700('0x9')](),interaction[_0x7700('0x13')](_0x7700('0x14'),_0x7700('0x15')),controller[_0x7700('0x16')]);router[_0x7700('0x17')](_0x7700('0xb'),auth[_0x7700('0x9')](),interaction[_0x7700('0x13')](_0x7700('0x14'),_0x7700('0x18')),controller[_0x7700('0x19')]);router[_0x7700('0x1a')](_0x7700('0xb'),auth[_0x7700('0x9')](),interaction[_0x7700('0x13')]('fax',_0x7700('0x1b')),controller['destroy']);router[_0x7700('0x1a')]('/:id/tags',auth[_0x7700('0x9')](),controller[_0x7700('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 864c070..81875cf 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 _0xe2cc=['sequelize','exports','BOOLEAN','ENUM','out','TEXT','DATE'];(function(_0x527852,_0x43efba){var _0x584d6f=function(_0x137c8b){while(--_0x137c8b){_0x527852['push'](_0x527852['shift']());}};_0x584d6f(++_0x43efba);}(_0xe2cc,0x69));var _0xce2c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe2cc[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xce2c('0x0'));module[_0xce2c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xce2c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xce2c('0x3')]('in',_0xce2c('0x4')),'defaultValue':_0xce2c('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xce2c('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xce2c('0x6')]}}; \ No newline at end of file +var _0x79a8=['out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x460562,_0x25b32b){var _0x385368=function(_0x3f22a5){while(--_0x3f22a5){_0x460562['push'](_0x460562['shift']());}};_0x385368(++_0x25b32b);}(_0x79a8,0x1d0));var _0x879a=function(_0x4a6362,_0x9e782a){_0x4a6362=_0x4a6362-0x0;var _0x2653a5=_0x79a8[_0x4a6362];return _0x2653a5;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'body':{'type':Sequelize[_0x879a('0x1')](_0x879a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x879a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x879a('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x879a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x879a('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e1bce90..099a740 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 _0x77fc=['client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','undefined','offset','count','limit','status','set','Content-Range','apply','save','update','destroy','stack','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','include','findAll','show','params','includeAll','find','body','describe','fax','readAt','format','user','UserId','get','FaxInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','role','AcceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','agent','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','internal','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','files','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77fc,0xfb));var _0xc77f=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x77fc[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xc77f('0x0'));var rimraf=require(_0xc77f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc77f('0x2'));var rp=require('request-promise');var moment=require(_0xc77f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc77f('0x4'));var util=require(_0xc77f('0x5'));var path=require(_0xc77f('0x6'));var sox=require(_0xc77f('0x7'));var csv=require(_0xc77f('0x8'));var ejs=require(_0xc77f('0x9'));var fs=require('fs');var fs_extra=require(_0xc77f('0xa'));var _=require(_0xc77f('0xb'));var squel=require(_0xc77f('0xc'));var crypto=require('crypto');var jsforce=require(_0xc77f('0xd'));var deskjs=require(_0xc77f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc77f('0xf'));var Redis=require(_0xc77f('0x10'));var authService=require(_0xc77f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc77f('0x12'));var hardwareService=require(_0xc77f('0x13'));var logger=require(_0xc77f('0x14'))('api');var utils=require(_0xc77f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc77f('0x16'));var db=require(_0xc77f('0x17'))['db'];config[_0xc77f('0x18')]=_[_0xc77f('0x19')](config[_0xc77f('0x18')],{'host':_0xc77f('0x1a'),'port':0x18eb});var socket=require(_0xc77f('0x1b'))(new Redis(config[_0xc77f('0x18')]));require(_0xc77f('0x1c'))[_0xc77f('0x1d')](socket);var jayson=require(_0xc77f('0x1e'));var client=jayson[_0xc77f('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc77f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x508c4d,_0x4520c0,_0x4f973e,_0x1bf47d){return new BPromise(function(_0x1cdff7,_0x22db5c){var _0xf91e65=_0x1bf47d||client;return _0xf91e65['request'](_0x508c4d,_0x4f973e)[_0xc77f('0x21')](function(_0x5cc53f){logger[_0xc77f('0x22')](_0xc77f('0x23'),_0x4520c0,_0xc77f('0x24'));logger[_0xc77f('0x25')](_0xc77f('0x26'),_0x4520c0,_0xc77f('0x24'),JSON[_0xc77f('0x27')](_0x5cc53f));if(_0x5cc53f[_0xc77f('0x28')]){if(_0x5cc53f[_0xc77f('0x28')]['code']===0x1f4){logger[_0xc77f('0x28')]('FaxMessage,\x20%s,\x20%s',_0x4520c0,_0x5cc53f[_0xc77f('0x28')][_0xc77f('0x29')]);return _0x22db5c(_0x5cc53f['error'][_0xc77f('0x29')]);}logger[_0xc77f('0x28')](_0xc77f('0x23'),_0x4520c0,_0x5cc53f['error']['message']);return _0x1cdff7(_0x5cc53f[_0xc77f('0x28')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x4520c0,_0xc77f('0x24'));_0x1cdff7(_0x5cc53f[_0xc77f('0x2a')][_0xc77f('0x29')]);}})[_0xc77f('0x2b')](function(_0x453c4b){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4520c0,_0x453c4b);_0x22db5c(_0x453c4b);});});}function respondWithStatusCode(_0x35e253,_0x2750ea){_0x2750ea=_0x2750ea||0xcc;return function(_0xa3cc1b){if(_0xa3cc1b){return _0x35e253[_0xc77f('0x2c')](_0x2750ea);}return _0x35e253['status'](_0x2750ea)[_0xc77f('0x2d')]();};}function respondWithResult(_0x4cd1b7,_0x3cc933){_0x3cc933=_0x3cc933||0xc8;return function(_0x46c7ea){if(_0x46c7ea){return _0x4cd1b7['status'](_0x3cc933)[_0xc77f('0x2e')](_0x46c7ea);}};}function respondWithFilteredResult(_0x2c7216,_0x1813b5){return function(_0x18d420){if(_0x18d420){var _0x2265f6=typeof _0x1813b5['offset']===_0xc77f('0x2f')&&typeof _0x1813b5['limit']==='undefined';var _0x1cb7aa=_0x18d420['count'];var _0x55e826=_0x2265f6?0x0:_0x1813b5[_0xc77f('0x30')];var _0x57f0b9=_0x2265f6?_0x18d420[_0xc77f('0x31')]:_0x1813b5[_0xc77f('0x30')]+_0x1813b5[_0xc77f('0x32')];var _0x4077d9;if(_0x57f0b9>=_0x1cb7aa){_0x57f0b9=_0x1cb7aa;_0x4077d9=0xc8;}else{_0x4077d9=0xce;}_0x2c7216[_0xc77f('0x33')](_0x4077d9);return _0x2c7216[_0xc77f('0x34')](_0xc77f('0x35'),_0x55e826+'-'+_0x57f0b9+'/'+_0x1cb7aa)[_0xc77f('0x2e')](_0x18d420);}return null;};}function patchUpdates(_0x3c7c20){return function(_0x470c79){try{jsonpatch[_0xc77f('0x36')](_0x470c79,_0x3c7c20,!![]);}catch(_0x286755){return BPromise['reject'](_0x286755);}return _0x470c79[_0xc77f('0x37')]();};}function saveUpdates(_0x25d7bc,_0x5a36ae){return function(_0x192c32){if(_0x192c32){return _0x192c32[_0xc77f('0x38')](_0x25d7bc)[_0xc77f('0x21')](function(_0x37830d){return _0x37830d;});}return null;};}function removeEntity(_0x2f8f93,_0x43b269){return function(_0x4e0b78){if(_0x4e0b78){return _0x4e0b78[_0xc77f('0x39')]()[_0xc77f('0x21')](function(){_0x2f8f93[_0xc77f('0x33')](0xcc)[_0xc77f('0x2d')]();});}};}function handleEntityNotFound(_0x227d76,_0x36da8f){return function(_0x28e855){if(!_0x28e855){_0x227d76[_0xc77f('0x2c')](0x194);}return _0x28e855;};}function handleError(_0x130a25,_0x10d2c7){_0x10d2c7=_0x10d2c7||0x1f4;return function(_0x32fa47){logger[_0xc77f('0x28')](_0x32fa47[_0xc77f('0x3a')]);if(_0x32fa47[_0xc77f('0x3b')]){delete _0x32fa47[_0xc77f('0x3b')];}_0x130a25['status'](_0x10d2c7)['send'](_0x32fa47);};}exports[_0xc77f('0x3c')]=function(_0x1d89ac,_0x398221){var _0x17f948={},_0x2fd740={},_0x5b70a5={'count':0x0,'rows':[]};var _0x557255=_[_0xc77f('0x3d')](db[_0xc77f('0x3e')][_0xc77f('0x3f')],function(_0x4c46d7){return{'name':_0x4c46d7[_0xc77f('0x40')],'type':_0x4c46d7['type'][_0xc77f('0x41')]};});_0x2fd740[_0xc77f('0x42')]=_['map'](_0x557255,_0xc77f('0x3b'));_0x2fd740['query']=_[_0xc77f('0x43')](_0x1d89ac[_0xc77f('0x44')]);_0x2fd740['filters']=_[_0xc77f('0x45')](_0x2fd740['model'],_0x2fd740[_0xc77f('0x44')]);_0x17f948[_0xc77f('0x46')]=_['intersection'](_0x2fd740['model'],qs[_0xc77f('0x47')](_0x1d89ac[_0xc77f('0x44')]['fields']));_0x17f948[_0xc77f('0x46')]=_0x17f948['attributes'][_0xc77f('0x48')]?_0x17f948[_0xc77f('0x46')]:_0x2fd740[_0xc77f('0x42')];if(!_0x1d89ac[_0xc77f('0x44')][_0xc77f('0x49')](_0xc77f('0x4a'))){_0x17f948[_0xc77f('0x32')]=qs[_0xc77f('0x32')](_0x1d89ac[_0xc77f('0x44')][_0xc77f('0x32')]);_0x17f948[_0xc77f('0x30')]=qs['offset'](_0x1d89ac['query']['offset']);}_0x17f948[_0xc77f('0x4b')]=qs[_0xc77f('0x4c')](_0x1d89ac[_0xc77f('0x44')][_0xc77f('0x4c')]);_0x17f948[_0xc77f('0x4d')]=qs[_0xc77f('0x4e')](_[_0xc77f('0x4f')](_0x1d89ac['query'],_0x2fd740[_0xc77f('0x4e')]),_0x557255);if(_0x1d89ac[_0xc77f('0x44')][_0xc77f('0x50')]){_0x17f948['where']=_[_0xc77f('0x51')](_0x17f948[_0xc77f('0x4d')],{'$or':_[_0xc77f('0x3d')](_0x557255,function(_0x134201){if(_0x134201[_0xc77f('0x52')]!=='VIRTUAL'){var _0x241a8e={};_0x241a8e[_0x134201[_0xc77f('0x3b')]]={'$like':'%'+_0x1d89ac[_0xc77f('0x44')][_0xc77f('0x50')]+'%'};return _0x241a8e;}})});}_0x17f948=_['merge']({},_0x17f948,_0x1d89ac[_0xc77f('0x53')]);var _0x1fc477={'where':_0x17f948[_0xc77f('0x4d')]};return db[_0xc77f('0x3e')]['count'](_0x1fc477)[_0xc77f('0x21')](function(_0x544085){_0x5b70a5[_0xc77f('0x31')]=_0x544085;if(_0x1d89ac[_0xc77f('0x44')]['includeAll']){_0x17f948[_0xc77f('0x54')]=[{'all':!![]}];}return db[_0xc77f('0x3e')][_0xc77f('0x55')](_0x17f948);})[_0xc77f('0x21')](function(_0xd1f706){_0x5b70a5['rows']=_0xd1f706;return _0x5b70a5;})[_0xc77f('0x21')](respondWithFilteredResult(_0x398221,_0x17f948))['catch'](handleError(_0x398221,null));};exports[_0xc77f('0x56')]=function(_0x30e779,_0x34a12b){var _0x1f25b4={'raw':!![],'where':{'id':_0x30e779[_0xc77f('0x57')]['id']}},_0x3b296f={};_0x3b296f[_0xc77f('0x42')]=_[_0xc77f('0x43')](db[_0xc77f('0x3e')][_0xc77f('0x3f')]);_0x3b296f[_0xc77f('0x44')]=_[_0xc77f('0x43')](_0x30e779[_0xc77f('0x44')]);_0x3b296f[_0xc77f('0x4e')]=_[_0xc77f('0x45')](_0x3b296f[_0xc77f('0x42')],_0x3b296f[_0xc77f('0x44')]);_0x1f25b4[_0xc77f('0x46')]=_[_0xc77f('0x45')](_0x3b296f[_0xc77f('0x42')],qs['fields'](_0x30e779[_0xc77f('0x44')]['fields']));_0x1f25b4[_0xc77f('0x46')]=_0x1f25b4[_0xc77f('0x46')][_0xc77f('0x48')]?_0x1f25b4[_0xc77f('0x46')]:_0x3b296f[_0xc77f('0x42')];if(_0x30e779['query'][_0xc77f('0x58')]){_0x1f25b4['include']=[{'all':!![]}];}_0x1f25b4=_[_0xc77f('0x51')]({},_0x1f25b4,_0x30e779['options']);return db[_0xc77f('0x3e')][_0xc77f('0x59')](_0x1f25b4)['then'](handleEntityNotFound(_0x34a12b,null))[_0xc77f('0x21')](respondWithResult(_0x34a12b,null))['catch'](handleError(_0x34a12b,null));};exports['update']=function(_0x20e490,_0x17d292){if(_0x20e490[_0xc77f('0x5a')]['id']){delete _0x20e490['body']['id'];}return db[_0xc77f('0x3e')][_0xc77f('0x59')]({'where':{'id':_0x20e490[_0xc77f('0x57')]['id']}})[_0xc77f('0x21')](handleEntityNotFound(_0x17d292,null))[_0xc77f('0x21')](saveUpdates(_0x20e490[_0xc77f('0x5a')],null))[_0xc77f('0x21')](respondWithResult(_0x17d292,null))['catch'](handleError(_0x17d292,null));};exports['destroy']=function(_0x5a1a7a,_0x2d6481){return db[_0xc77f('0x3e')][_0xc77f('0x59')]({'where':{'id':_0x5a1a7a[_0xc77f('0x57')]['id']}})[_0xc77f('0x21')](handleEntityNotFound(_0x2d6481,null))[_0xc77f('0x21')](removeEntity(_0x2d6481,null))['catch'](handleError(_0x2d6481,null));};exports[_0xc77f('0x5b')]=function(_0x1ed60d,_0xf99c72){return db[_0xc77f('0x3e')][_0xc77f('0x5b')]()[_0xc77f('0x21')](respondWithResult(_0xf99c72,null))['catch'](handleError(_0xf99c72,null));};var interaction_log=require(_0xc77f('0x14'))('fax-interactions');exports['accept']=function(_0x11e5ca,_0x4bc14a,_0x35fd28){var _0x45ff75={'agent':{},'channel':_0xc77f('0x5c')};if(_0x11e5ca[_0xc77f('0x5a')]['id']){delete _0x11e5ca[_0xc77f('0x5a')]['id'];}_0x11e5ca[_0xc77f('0x5a')]['read']=!![];_0x11e5ca[_0xc77f('0x5a')][_0xc77f('0x5d')]=moment()[_0xc77f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x11e5ca[_0xc77f('0x5a')]['UserId']=_0x11e5ca[_0xc77f('0x5a')]['UserId']||_0x11e5ca[_0xc77f('0x5f')]['id'];_0x45ff75['agent']['id']=_0x11e5ca[_0xc77f('0x5a')][_0xc77f('0x60')];return db['FaxMessage'][_0xc77f('0x59')]({'where':{'id':_0x11e5ca[_0xc77f('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4bc14a,null))[_0xc77f('0x21')](saveUpdates(_0x11e5ca['body'],null))[_0xc77f('0x21')](function(_0x1e9799){if(_0x1e9799){_0x45ff75[_0xc77f('0x29')]=_0x1e9799[_0xc77f('0x61')]({'plain':!![]});return db[_0xc77f('0x62')][_0xc77f('0x59')]({'where':{'id':_0x1e9799['FaxInteractionId']}});}return null;})[_0xc77f('0x21')](handleEntityNotFound(_0x4bc14a,null))[_0xc77f('0x21')](function(_0x626331){if(_0x626331){return _0x626331[_0xc77f('0x38')]({'UserId':_0x11e5ca[_0xc77f('0x5a')][_0xc77f('0x60')],'read1stAt':_[_0xc77f('0x63')](_0x626331[_0xc77f('0x64')])?moment()[_0xc77f('0x5e')](_0xc77f('0x65')):undefined});}return null;})[_0xc77f('0x21')](function(_0x2f092c){if(_0x2f092c){_0x45ff75['interaction']=_0x2f092c['get']({'plain':!![]});interaction_log[_0xc77f('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11e5ca[_0xc77f('0x5f')]['id'],_0x11e5ca[_0xc77f('0x5f')][_0xc77f('0x3b')],_0x11e5ca[_0xc77f('0x5f')][_0xc77f('0x66')],_0x45ff75['interaction']['id'],_0x11e5ca[_0xc77f('0x5a')]?JSON[_0xc77f('0x27')](_0x11e5ca[_0xc77f('0x5a')]):'null');return respondWithRpcPromise(_0xc77f('0x67'),'acceptMessage',_0x45ff75);}return null;})[_0xc77f('0x21')](function(_0x263a3b){var _0x4189db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x263a3b[_0xc77f('0x29')][_0xc77f('0x68')];return db['sequelize']['query'](_0x4189db,{'type':db[_0xc77f('0x69')][_0xc77f('0x6a')][_0xc77f('0x6b')],'raw':!![]})['then'](function(_0x5562da){return _0x5562da;});})[_0xc77f('0x21')](function(_0x2a02a5){if(_0x2a02a5){_0x45ff75[_0xc77f('0x29')][_0xc77f('0x6c')]=_0x2a02a5[0x0];if(!_0x11e5ca['body']['UserId'])return;return db['User'][_0xc77f('0x59')]({'where':{'id':_0x11e5ca[_0xc77f('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xc77f('0x3b'),_0xc77f('0x6d'),_0xc77f('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x45d62d){if(!_0x45d62d)return null;_0x45ff75[_0xc77f('0x29')][_0xc77f('0x6f')]=_0x45d62d;return _0x45ff75;})['then'](function(_0x22c5db){if(_0x22c5db){if(_0x11e5ca[_0xc77f('0x5a')][_0xc77f('0x70')]){_0x45ff75[_0xc77f('0x29')]['interface']=util[_0xc77f('0x5e')](_0xc77f('0x71'),_0x11e5ca[_0xc77f('0x5f')][_0xc77f('0x3b')]);_0x45ff75[_0xc77f('0x29')][_0xc77f('0x72')]=_0x45ff75[_0xc77f('0x72')];_0x45ff75[_0xc77f('0x29')][_0xc77f('0x73')]=_0x45ff75['channel'];_0x45ff75[_0xc77f('0x29')][_0xc77f('0x74')]=_0xc77f('0x75');return respondWithRpcPromise(_0xc77f('0x76'),_0xc77f('0x76'),{'event':_0xc77f('0x77'),'message':_0x45ff75[_0xc77f('0x29')]},client9002)[_0xc77f('0x21')](function(){return _0x45ff75;});}return _0x45ff75;}return null;})[_0xc77f('0x21')](respondWithResult(_0x4bc14a,null))[_0xc77f('0x2b')](handleError(_0x4bc14a,null));};var interaction_log=require(_0xc77f('0x14'))('fax-interactions');exports[_0xc77f('0x78')]=function(_0x41c309,_0x29d019,_0x127e65){var _0x5d894c={'agent':{},'channel':_0xc77f('0x5c')};if(_0x41c309[_0xc77f('0x5a')]['id']){delete _0x41c309['body']['id'];}_0x41c309[_0xc77f('0x5a')][_0xc77f('0x60')]=_0x41c309['body'][_0xc77f('0x60')]||_0x41c309[_0xc77f('0x5f')]['id'];_0x5d894c[_0xc77f('0x6f')]['id']=_0x41c309[_0xc77f('0x5a')][_0xc77f('0x60')];return db['FaxMessage'][_0xc77f('0x59')]({'where':{'id':_0x41c309[_0xc77f('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29d019,null))['then'](function(_0x37ad12){if(_0x37ad12){_0x5d894c[_0xc77f('0x29')]=_0x37ad12[_0xc77f('0x61')]({'plain':!![]});return db[_0xc77f('0x62')]['find']({'where':{'id':_0x37ad12['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x29d019,null))[_0xc77f('0x21')](function(_0x4d11d7){if(_0x4d11d7){_0x5d894c[_0xc77f('0x79')]=_0x4d11d7[_0xc77f('0x61')]({'plain':!![]});interaction_log[_0xc77f('0x22')](_0xc77f('0x7a'),_0x41c309[_0xc77f('0x5f')]['id'],_0x41c309[_0xc77f('0x5f')][_0xc77f('0x3b')],_0x41c309['user'][_0xc77f('0x66')],_0x5d894c['interaction']['id'],_0x41c309[_0xc77f('0x5a')]?JSON[_0xc77f('0x27')](_0x41c309[_0xc77f('0x5a')]):_0xc77f('0x7b'));return respondWithRpcPromise(_0xc77f('0x7c'),_0xc77f('0x7d'),_0x5d894c);}return null;})[_0xc77f('0x21')](function(_0x254fef){var _0x317a1a=_0xc77f('0x7e')+_0x254fef[_0xc77f('0x29')][_0xc77f('0x68')];return db[_0xc77f('0x7f')]['query'](_0x317a1a,{'type':db[_0xc77f('0x69')][_0xc77f('0x6a')][_0xc77f('0x6b')],'raw':!![]})[_0xc77f('0x21')](function(_0x58608e){return _0x58608e;});})[_0xc77f('0x21')](function(_0xcbaaba){if(_0xcbaaba){_0x5d894c[_0xc77f('0x29')][_0xc77f('0x6c')]=_0xcbaaba[0x0];if(!_0x41c309[_0xc77f('0x5a')][_0xc77f('0x60')])return;return db[_0xc77f('0x80')][_0xc77f('0x59')]({'where':{'id':_0x41c309['body'][_0xc77f('0x60')],'role':_0xc77f('0x6f')},'attributes':['id',_0xc77f('0x3b'),'fullname',_0xc77f('0x6e'),_0xc77f('0x81')],'raw':!![]});}return null;})[_0xc77f('0x21')](function(_0x19a75a){if(!_0x19a75a)return null;_0x5d894c[_0xc77f('0x29')]['agent']=_0x19a75a;return _0x5d894c;})[_0xc77f('0x21')](function(_0x58a610){if(_0x58a610){_0x58a610[_0xc77f('0x29')]['interface']=util[_0xc77f('0x5e')](_0xc77f('0x71'),_0x41c309[_0xc77f('0x5f')]['name']);_0x58a610[_0xc77f('0x29')]['channel']=_0x5d894c[_0xc77f('0x72')];_0x58a610['message']['motionChannel']=_0x5d894c[_0xc77f('0x72')];_0x58a610[_0xc77f('0x29')][_0xc77f('0x74')]=_0xc77f('0x78');respondWithRpcPromise(_0xc77f('0x76'),_0xc77f('0x76'),{'event':'rejectmessage','message':_0x58a610[_0xc77f('0x29')]},client9002);return _0x5d894c;}return null;})[_0xc77f('0x21')](respondWithResult(_0x29d019,null))[_0xc77f('0x2b')](handleError(_0x29d019,null));};exports[_0xc77f('0x82')]=function(_0x23ec43,_0xb4bf0d){var _0xd5f77b;return db[_0xc77f('0x3e')]['create'](_0x23ec43[_0xc77f('0x5a')],{})[_0xc77f('0x21')](function(_0x360e04){_0xd5f77b=_0x360e04;return db[_0xc77f('0x83')][_0xc77f('0x84')]({'where':{'id':_0xd5f77b[_0xc77f('0x68')]}});})[_0xc77f('0x21')](function(_0x398024){if(_[_0xc77f('0x63')](_0x398024)){return;}else{_0xd5f77b['fax']=_0x398024['fax'];return db[_0xc77f('0x85')]['findOne']({'where':{'id':_0xd5f77b[_0xc77f('0x86')]}});}})[_0xc77f('0x21')](function(_0x2f10d8){return respondWithRpcPromise('SendFax',_0xc77f('0x87'),{'FaxAccountId':_[_0xc77f('0x63')](_0x23ec43[_0xc77f('0x5a')])?undefined:_0x23ec43['body']['FaxAccountId'],'path':_[_0xc77f('0x63')](_0x2f10d8)?undefined:util[_0xc77f('0x5e')](_0xc77f('0x88'),_0x2f10d8[_0xc77f('0x89')]),'fax':_[_0xc77f('0x63')](_0xd5f77b['fax'])?undefined:_0xd5f77b[_0xc77f('0x5c')],'AttachmentId':_0xd5f77b[_0xc77f('0x86')]},client9002);})[_0xc77f('0x21')](respondWithResult(_0xb4bf0d,0xc9))[_0xc77f('0x2b')](handleError(_0xb4bf0d,null));};exports[_0xc77f('0x8a')]=function(_0x257cfd,_0x47e5db){var _0x4758a1=path['join'](config[_0xc77f('0x8b')],'server',_0xc77f('0x8c'),'attachments');return db[_0xc77f('0x3e')][_0xc77f('0x59')]({'where':{'id':_0x257cfd[_0xc77f('0x57')]['id']},'include':[{'model':db[_0xc77f('0x85')],'as':_0xc77f('0x85')}]})[_0xc77f('0x21')](handleEntityNotFound(_0x47e5db,null))[_0xc77f('0x21')](function(_0x1ad6b3){if(_0x1ad6b3){return _0x47e5db['download'](path['join'](_0x4758a1,_0x1ad6b3[_0xc77f('0x85')][_0xc77f('0x89')]));}})[_0xc77f('0x2b')](handleError(_0x47e5db,null));}; \ No newline at end of file +var _0xec88=['join','root','files','download','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','info','result','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','filter','where','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','body','find','describe','fax-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','internal','SIP/%s','motionChannel','event','rejectmessage','create','CmContact','findOne','isNil','fax','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s'];(function(_0xfc8fe2,_0x57b329){var _0x56ec2f=function(_0x5c1a8c){while(--_0x5c1a8c){_0xfc8fe2['push'](_0xfc8fe2['shift']());}};_0x56ec2f(++_0x57b329);}(_0xec88,0x1af));var _0x8ec8=function(_0x4fa87b,_0xdb6adc){_0x4fa87b=_0x4fa87b-0x0;var _0x4130d9=_0xec88[_0x4fa87b];return _0x4130d9;};'use strict';var emlformat=require(_0x8ec8('0x0'));var rimraf=require(_0x8ec8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ec8('0x2'));var rp=require(_0x8ec8('0x3'));var moment=require('moment');var BPromise=require(_0x8ec8('0x4'));var Mustache=require(_0x8ec8('0x5'));var util=require(_0x8ec8('0x6'));var path=require('path');var sox=require(_0x8ec8('0x7'));var csv=require(_0x8ec8('0x8'));var ejs=require(_0x8ec8('0x9'));var fs=require('fs');var fs_extra=require(_0x8ec8('0xa'));var _=require(_0x8ec8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8ec8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ec8('0xd'));var Papa=require(_0x8ec8('0xe'));var Redis=require('ioredis');var authService=require(_0x8ec8('0xf'));var qs=require(_0x8ec8('0x10'));var as=require(_0x8ec8('0x11'));var hardwareService=require(_0x8ec8('0x12'));var logger=require(_0x8ec8('0x13'))(_0x8ec8('0x14'));var utils=require('../../config/utils');var config=require(_0x8ec8('0x15'));var licenseUtil=require(_0x8ec8('0x16'));var db=require(_0x8ec8('0x17'))['db'];config[_0x8ec8('0x18')]=_[_0x8ec8('0x19')](config['redis'],{'host':_0x8ec8('0x1a'),'port':0x18eb});var socket=require(_0x8ec8('0x1b'))(new Redis(config[_0x8ec8('0x18')]));require('./faxMessage.socket')[_0x8ec8('0x1c')](socket);var jayson=require(_0x8ec8('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8ec8('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x348cdf,_0x4aab53,_0x1b27d8,_0x2a46eb){return new BPromise(function(_0x56b069,_0x5de513){var _0x54ee03=_0x2a46eb||client;return _0x54ee03[_0x8ec8('0x1f')](_0x348cdf,_0x1b27d8)[_0x8ec8('0x20')](function(_0x59735a){logger['info']('FaxMessage,\x20%s,\x20%s',_0x4aab53,_0x8ec8('0x21'));logger[_0x8ec8('0x22')](_0x8ec8('0x23'),_0x4aab53,'request\x20sent',JSON['stringify'](_0x59735a));if(_0x59735a[_0x8ec8('0x24')]){if(_0x59735a[_0x8ec8('0x24')]['code']===0x1f4){logger['error'](_0x8ec8('0x25'),_0x4aab53,_0x59735a[_0x8ec8('0x24')]['message']);return _0x5de513(_0x59735a[_0x8ec8('0x24')][_0x8ec8('0x26')]);}logger['error'](_0x8ec8('0x25'),_0x4aab53,_0x59735a['error'][_0x8ec8('0x26')]);return _0x56b069(_0x59735a[_0x8ec8('0x24')][_0x8ec8('0x26')]);}else{logger[_0x8ec8('0x27')](_0x8ec8('0x25'),_0x4aab53,'request\x20sent');_0x56b069(_0x59735a[_0x8ec8('0x28')][_0x8ec8('0x26')]);}})['catch'](function(_0x57b6b9){logger[_0x8ec8('0x24')]('FaxMessage,\x20%s,\x20%s',_0x4aab53,_0x57b6b9);_0x5de513(_0x57b6b9);});});}function respondWithStatusCode(_0x57436e,_0x5d07ed){_0x5d07ed=_0x5d07ed||0xcc;return function(_0x469649){if(_0x469649){return _0x57436e['sendStatus'](_0x5d07ed);}return _0x57436e['status'](_0x5d07ed)[_0x8ec8('0x29')]();};}function respondWithResult(_0x410bc5,_0x2b87cf){_0x2b87cf=_0x2b87cf||0xc8;return function(_0x5db70d){if(_0x5db70d){return _0x410bc5[_0x8ec8('0x2a')](_0x2b87cf)[_0x8ec8('0x2b')](_0x5db70d);}};}function respondWithFilteredResult(_0x190e99,_0x2f1cf3){return function(_0x130ca5){if(_0x130ca5){var _0x21261f=typeof _0x2f1cf3[_0x8ec8('0x2c')]===_0x8ec8('0x2d')&&typeof _0x2f1cf3[_0x8ec8('0x2e')]===_0x8ec8('0x2d');var _0x3264c8=_0x130ca5[_0x8ec8('0x2f')];var _0x5a7f1a=_0x21261f?0x0:_0x2f1cf3[_0x8ec8('0x2c')];var _0x3975fb=_0x21261f?_0x130ca5[_0x8ec8('0x2f')]:_0x2f1cf3[_0x8ec8('0x2c')]+_0x2f1cf3['limit'];var _0x318cef;if(_0x3975fb>=_0x3264c8){_0x3975fb=_0x3264c8;_0x318cef=0xc8;}else{_0x318cef=0xce;}_0x190e99[_0x8ec8('0x2a')](_0x318cef);return _0x190e99[_0x8ec8('0x30')](_0x8ec8('0x31'),_0x5a7f1a+'-'+_0x3975fb+'/'+_0x3264c8)[_0x8ec8('0x2b')](_0x130ca5);}return null;};}function patchUpdates(_0x11ab29){return function(_0x3bf352){try{jsonpatch[_0x8ec8('0x32')](_0x3bf352,_0x11ab29,!![]);}catch(_0x4a7ebb){return BPromise['reject'](_0x4a7ebb);}return _0x3bf352[_0x8ec8('0x33')]();};}function saveUpdates(_0x5f1a19,_0x4a65e2){return function(_0x22ba30){if(_0x22ba30){return _0x22ba30[_0x8ec8('0x34')](_0x5f1a19)[_0x8ec8('0x20')](function(_0x27d5aa){return _0x27d5aa;});}return null;};}function removeEntity(_0x5adecf,_0x2c38aa){return function(_0x205e31){if(_0x205e31){return _0x205e31[_0x8ec8('0x35')]()[_0x8ec8('0x20')](function(){_0x5adecf['status'](0xcc)[_0x8ec8('0x29')]();});}};}function handleEntityNotFound(_0x5df89f,_0x2f6e8a){return function(_0x1a3756){if(!_0x1a3756){_0x5df89f['sendStatus'](0x194);}return _0x1a3756;};}function handleError(_0x18fdba,_0x27faa5){_0x27faa5=_0x27faa5||0x1f4;return function(_0x2d46e9){logger[_0x8ec8('0x24')](_0x2d46e9[_0x8ec8('0x36')]);if(_0x2d46e9['name']){delete _0x2d46e9[_0x8ec8('0x37')];}_0x18fdba[_0x8ec8('0x2a')](_0x27faa5)[_0x8ec8('0x38')](_0x2d46e9);};}exports['index']=function(_0x44b405,_0x2b3a19){var _0x5890f9={},_0xe438c6={},_0x125dd4={'count':0x0,'rows':[]};var _0x50b4fa=_[_0x8ec8('0x39')](db[_0x8ec8('0x3a')][_0x8ec8('0x3b')],function(_0x3781d0){return{'name':_0x3781d0['fieldName'],'type':_0x3781d0[_0x8ec8('0x3c')][_0x8ec8('0x3d')]};});_0xe438c6[_0x8ec8('0x3e')]=_[_0x8ec8('0x39')](_0x50b4fa,_0x8ec8('0x37'));_0xe438c6[_0x8ec8('0x3f')]=_[_0x8ec8('0x40')](_0x44b405[_0x8ec8('0x3f')]);_0xe438c6[_0x8ec8('0x41')]=_['intersection'](_0xe438c6[_0x8ec8('0x3e')],_0xe438c6['query']);_0x5890f9['attributes']=_['intersection'](_0xe438c6[_0x8ec8('0x3e')],qs['fields'](_0x44b405['query'][_0x8ec8('0x42')]));_0x5890f9[_0x8ec8('0x43')]=_0x5890f9[_0x8ec8('0x43')][_0x8ec8('0x44')]?_0x5890f9[_0x8ec8('0x43')]:_0xe438c6[_0x8ec8('0x3e')];if(!_0x44b405[_0x8ec8('0x3f')][_0x8ec8('0x45')](_0x8ec8('0x46'))){_0x5890f9[_0x8ec8('0x2e')]=qs['limit'](_0x44b405[_0x8ec8('0x3f')][_0x8ec8('0x2e')]);_0x5890f9[_0x8ec8('0x2c')]=qs[_0x8ec8('0x2c')](_0x44b405[_0x8ec8('0x3f')][_0x8ec8('0x2c')]);}_0x5890f9[_0x8ec8('0x47')]=qs['sort'](_0x44b405[_0x8ec8('0x3f')]['sort']);_0x5890f9['where']=qs['filters'](_['pick'](_0x44b405[_0x8ec8('0x3f')],_0xe438c6[_0x8ec8('0x41')]),_0x50b4fa);if(_0x44b405[_0x8ec8('0x3f')][_0x8ec8('0x48')]){_0x5890f9[_0x8ec8('0x49')]=_['merge'](_0x5890f9[_0x8ec8('0x49')],{'$or':_[_0x8ec8('0x39')](_0x50b4fa,function(_0x5b91e3){if(_0x5b91e3[_0x8ec8('0x3c')]!=='VIRTUAL'){var _0x5f5c57={};_0x5f5c57[_0x5b91e3[_0x8ec8('0x37')]]={'$like':'%'+_0x44b405[_0x8ec8('0x3f')][_0x8ec8('0x48')]+'%'};return _0x5f5c57;}})});}_0x5890f9=_[_0x8ec8('0x4a')]({},_0x5890f9,_0x44b405[_0x8ec8('0x4b')]);var _0x260ab0={'where':_0x5890f9[_0x8ec8('0x49')]};return db[_0x8ec8('0x3a')][_0x8ec8('0x2f')](_0x260ab0)[_0x8ec8('0x20')](function(_0x525a3f){_0x125dd4[_0x8ec8('0x2f')]=_0x525a3f;if(_0x44b405[_0x8ec8('0x3f')]['includeAll']){_0x5890f9[_0x8ec8('0x4c')]=[{'all':!![]}];}return db[_0x8ec8('0x3a')][_0x8ec8('0x4d')](_0x5890f9);})[_0x8ec8('0x20')](function(_0x17394f){_0x125dd4[_0x8ec8('0x4e')]=_0x17394f;return _0x125dd4;})[_0x8ec8('0x20')](respondWithFilteredResult(_0x2b3a19,_0x5890f9))[_0x8ec8('0x4f')](handleError(_0x2b3a19,null));};exports[_0x8ec8('0x50')]=function(_0xb5bdcc,_0x1457bd){var _0x49e8c3={'raw':!![],'where':{'id':_0xb5bdcc[_0x8ec8('0x51')]['id']}},_0x2686ee={};_0x2686ee[_0x8ec8('0x3e')]=_[_0x8ec8('0x40')](db[_0x8ec8('0x3a')][_0x8ec8('0x3b')]);_0x2686ee[_0x8ec8('0x3f')]=_['keys'](_0xb5bdcc[_0x8ec8('0x3f')]);_0x2686ee[_0x8ec8('0x41')]=_[_0x8ec8('0x52')](_0x2686ee[_0x8ec8('0x3e')],_0x2686ee[_0x8ec8('0x3f')]);_0x49e8c3['attributes']=_[_0x8ec8('0x52')](_0x2686ee[_0x8ec8('0x3e')],qs[_0x8ec8('0x42')](_0xb5bdcc['query'][_0x8ec8('0x42')]));_0x49e8c3[_0x8ec8('0x43')]=_0x49e8c3[_0x8ec8('0x43')]['length']?_0x49e8c3[_0x8ec8('0x43')]:_0x2686ee[_0x8ec8('0x3e')];if(_0xb5bdcc[_0x8ec8('0x3f')][_0x8ec8('0x53')]){_0x49e8c3[_0x8ec8('0x4c')]=[{'all':!![]}];}_0x49e8c3=_[_0x8ec8('0x4a')]({},_0x49e8c3,_0xb5bdcc['options']);return db[_0x8ec8('0x3a')]['find'](_0x49e8c3)[_0x8ec8('0x20')](handleEntityNotFound(_0x1457bd,null))[_0x8ec8('0x20')](respondWithResult(_0x1457bd,null))[_0x8ec8('0x4f')](handleError(_0x1457bd,null));};exports[_0x8ec8('0x34')]=function(_0x5596ad,_0x4adecf){if(_0x5596ad['body']['id']){delete _0x5596ad[_0x8ec8('0x54')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x5596ad['params']['id']}})['then'](handleEntityNotFound(_0x4adecf,null))[_0x8ec8('0x20')](saveUpdates(_0x5596ad['body'],null))['then'](respondWithResult(_0x4adecf,null))[_0x8ec8('0x4f')](handleError(_0x4adecf,null));};exports[_0x8ec8('0x35')]=function(_0x1a15e9,_0x41771c){return db[_0x8ec8('0x3a')][_0x8ec8('0x55')]({'where':{'id':_0x1a15e9['params']['id']}})[_0x8ec8('0x20')](handleEntityNotFound(_0x41771c,null))[_0x8ec8('0x20')](removeEntity(_0x41771c,null))[_0x8ec8('0x4f')](handleError(_0x41771c,null));};exports[_0x8ec8('0x56')]=function(_0x1864e0,_0x5dd63a){return db[_0x8ec8('0x3a')]['describe']()[_0x8ec8('0x20')](respondWithResult(_0x5dd63a,null))[_0x8ec8('0x4f')](handleError(_0x5dd63a,null));};var interaction_log=require(_0x8ec8('0x13'))(_0x8ec8('0x57'));exports[_0x8ec8('0x58')]=function(_0x3eb9b2,_0x255c55,_0xb4035a){var _0x566054={'agent':{},'channel':'fax'};if(_0x3eb9b2['body']['id']){delete _0x3eb9b2[_0x8ec8('0x54')]['id'];}_0x3eb9b2[_0x8ec8('0x54')]['read']=!![];_0x3eb9b2['body']['readAt']=moment()['format'](_0x8ec8('0x59'));_0x3eb9b2['body']['UserId']=_0x3eb9b2['body'][_0x8ec8('0x5a')]||_0x3eb9b2[_0x8ec8('0x5b')]['id'];_0x566054[_0x8ec8('0x5c')]['id']=_0x3eb9b2[_0x8ec8('0x54')][_0x8ec8('0x5a')];return db[_0x8ec8('0x3a')][_0x8ec8('0x55')]({'where':{'id':_0x3eb9b2[_0x8ec8('0x51')]['id'],'UserId':null}})[_0x8ec8('0x20')](handleEntityNotFound(_0x255c55,null))[_0x8ec8('0x20')](saveUpdates(_0x3eb9b2['body'],null))[_0x8ec8('0x20')](function(_0x3648b1){if(_0x3648b1){_0x566054['message']=_0x3648b1[_0x8ec8('0x5d')]({'plain':!![]});return db[_0x8ec8('0x5e')]['find']({'where':{'id':_0x3648b1[_0x8ec8('0x5f')]}});}return null;})[_0x8ec8('0x20')](handleEntityNotFound(_0x255c55,null))[_0x8ec8('0x20')](function(_0x13c488){if(_0x13c488){return _0x13c488[_0x8ec8('0x34')]({'UserId':_0x3eb9b2['body']['UserId'],'read1stAt':_['isNil'](_0x13c488[_0x8ec8('0x60')])?moment()[_0x8ec8('0x61')](_0x8ec8('0x59')):undefined});}return null;})[_0x8ec8('0x20')](function(_0x580b25){if(_0x580b25){_0x566054[_0x8ec8('0x62')]=_0x580b25[_0x8ec8('0x5d')]({'plain':!![]});interaction_log[_0x8ec8('0x27')](_0x8ec8('0x63'),_0x3eb9b2[_0x8ec8('0x5b')]['id'],_0x3eb9b2[_0x8ec8('0x5b')][_0x8ec8('0x37')],_0x3eb9b2[_0x8ec8('0x5b')]['role'],_0x566054[_0x8ec8('0x62')]['id'],_0x3eb9b2[_0x8ec8('0x54')]?JSON[_0x8ec8('0x64')](_0x3eb9b2[_0x8ec8('0x54')]):_0x8ec8('0x65'));return respondWithRpcPromise(_0x8ec8('0x66'),_0x8ec8('0x67'),_0x566054);}return null;})[_0x8ec8('0x20')](function(_0x22bdb4){var _0x2a6376=_0x8ec8('0x68')+_0x22bdb4['message'][_0x8ec8('0x69')];return db[_0x8ec8('0x6a')][_0x8ec8('0x3f')](_0x2a6376,{'type':db[_0x8ec8('0x6b')][_0x8ec8('0x6c')][_0x8ec8('0x6d')],'raw':!![]})[_0x8ec8('0x20')](function(_0x778c6b){return _0x778c6b;});})[_0x8ec8('0x20')](function(_0x3b7daa){if(_0x3b7daa){_0x566054[_0x8ec8('0x26')][_0x8ec8('0x6e')]=_0x3b7daa[0x0];if(!_0x3eb9b2[_0x8ec8('0x54')][_0x8ec8('0x5a')])return;return db[_0x8ec8('0x6f')][_0x8ec8('0x55')]({'where':{'id':_0x3eb9b2[_0x8ec8('0x54')][_0x8ec8('0x5a')],'role':_0x8ec8('0x5c')},'attributes':['id',_0x8ec8('0x37'),_0x8ec8('0x70'),_0x8ec8('0x71'),'internal'],'raw':!![]});}return null;})[_0x8ec8('0x20')](function(_0x453956){if(!_0x453956)return null;_0x566054['message'][_0x8ec8('0x5c')]=_0x453956;return _0x566054;})[_0x8ec8('0x20')](function(_0x130f66){if(_0x130f66){if(_0x3eb9b2[_0x8ec8('0x54')]['manual']){_0x566054[_0x8ec8('0x26')][_0x8ec8('0x72')]=util['format']('SIP/%s',_0x3eb9b2[_0x8ec8('0x5b')]['name']);_0x566054['message'][_0x8ec8('0x73')]=_0x566054['channel'];_0x566054[_0x8ec8('0x26')]['motionChannel']=_0x566054[_0x8ec8('0x73')];_0x566054['message']['event']=_0x8ec8('0x58');return respondWithRpcPromise(_0x8ec8('0x74'),'EventManager',{'event':_0x8ec8('0x75'),'message':_0x566054[_0x8ec8('0x26')]},client9002)[_0x8ec8('0x20')](function(){return _0x566054;});}return _0x566054;}return null;})[_0x8ec8('0x20')](respondWithResult(_0x255c55,null))[_0x8ec8('0x4f')](handleError(_0x255c55,null));};var interaction_log=require(_0x8ec8('0x13'))(_0x8ec8('0x57'));exports[_0x8ec8('0x76')]=function(_0xd61e0d,_0x44ff39,_0x1973b5){var _0x2ec157={'agent':{},'channel':'fax'};if(_0xd61e0d[_0x8ec8('0x54')]['id']){delete _0xd61e0d[_0x8ec8('0x54')]['id'];}_0xd61e0d[_0x8ec8('0x54')][_0x8ec8('0x5a')]=_0xd61e0d[_0x8ec8('0x54')][_0x8ec8('0x5a')]||_0xd61e0d[_0x8ec8('0x5b')]['id'];_0x2ec157['agent']['id']=_0xd61e0d[_0x8ec8('0x54')][_0x8ec8('0x5a')];return db[_0x8ec8('0x3a')][_0x8ec8('0x55')]({'where':{'id':_0xd61e0d[_0x8ec8('0x51')]['id'],'UserId':null}})[_0x8ec8('0x20')](handleEntityNotFound(_0x44ff39,null))[_0x8ec8('0x20')](function(_0x5dcbb7){if(_0x5dcbb7){_0x2ec157[_0x8ec8('0x26')]=_0x5dcbb7[_0x8ec8('0x5d')]({'plain':!![]});return db[_0x8ec8('0x5e')][_0x8ec8('0x55')]({'where':{'id':_0x5dcbb7['FaxInteractionId']}});}return null;})[_0x8ec8('0x20')](handleEntityNotFound(_0x44ff39,null))['then'](function(_0x30085e){if(_0x30085e){_0x2ec157[_0x8ec8('0x62')]=_0x30085e[_0x8ec8('0x5d')]({'plain':!![]});interaction_log['info'](_0x8ec8('0x77'),_0xd61e0d['user']['id'],_0xd61e0d['user'][_0x8ec8('0x37')],_0xd61e0d[_0x8ec8('0x5b')][_0x8ec8('0x78')],_0x2ec157['interaction']['id'],_0xd61e0d[_0x8ec8('0x54')]?JSON[_0x8ec8('0x64')](_0xd61e0d['body']):_0x8ec8('0x65'));return respondWithRpcPromise('RejectMessage',_0x8ec8('0x79'),_0x2ec157);}return null;})[_0x8ec8('0x20')](function(_0x30e95b){var _0x62c10d=_0x8ec8('0x68')+_0x30e95b[_0x8ec8('0x26')]['ContactId'];return db[_0x8ec8('0x6a')][_0x8ec8('0x3f')](_0x62c10d,{'type':db[_0x8ec8('0x6b')][_0x8ec8('0x6c')]['SELECT'],'raw':!![]})[_0x8ec8('0x20')](function(_0x7def21){return _0x7def21;});})[_0x8ec8('0x20')](function(_0x27b8d1){if(_0x27b8d1){_0x2ec157[_0x8ec8('0x26')][_0x8ec8('0x6e')]=_0x27b8d1[0x0];if(!_0xd61e0d[_0x8ec8('0x54')][_0x8ec8('0x5a')])return;return db[_0x8ec8('0x6f')][_0x8ec8('0x55')]({'where':{'id':_0xd61e0d[_0x8ec8('0x54')]['UserId'],'role':_0x8ec8('0x5c')},'attributes':['id',_0x8ec8('0x37'),_0x8ec8('0x70'),'email',_0x8ec8('0x7a')],'raw':!![]});}return null;})[_0x8ec8('0x20')](function(_0x36e905){if(!_0x36e905)return null;_0x2ec157[_0x8ec8('0x26')][_0x8ec8('0x5c')]=_0x36e905;return _0x2ec157;})[_0x8ec8('0x20')](function(_0x250115){if(_0x250115){_0x250115[_0x8ec8('0x26')][_0x8ec8('0x72')]=util[_0x8ec8('0x61')](_0x8ec8('0x7b'),_0xd61e0d[_0x8ec8('0x5b')][_0x8ec8('0x37')]);_0x250115[_0x8ec8('0x26')][_0x8ec8('0x73')]=_0x2ec157[_0x8ec8('0x73')];_0x250115[_0x8ec8('0x26')][_0x8ec8('0x7c')]=_0x2ec157['channel'];_0x250115[_0x8ec8('0x26')][_0x8ec8('0x7d')]='reject';respondWithRpcPromise(_0x8ec8('0x74'),_0x8ec8('0x74'),{'event':_0x8ec8('0x7e'),'message':_0x250115[_0x8ec8('0x26')]},client9002);return _0x2ec157;}return null;})['then'](respondWithResult(_0x44ff39,null))[_0x8ec8('0x4f')](handleError(_0x44ff39,null));};exports[_0x8ec8('0x7f')]=function(_0x196deb,_0x1da6a1){var _0x1ef334;return db['FaxMessage'][_0x8ec8('0x7f')](_0x196deb[_0x8ec8('0x54')],{})[_0x8ec8('0x20')](function(_0x105b33){_0x1ef334=_0x105b33;return db[_0x8ec8('0x80')][_0x8ec8('0x81')]({'where':{'id':_0x1ef334['ContactId']}});})[_0x8ec8('0x20')](function(_0x3a0511){if(_[_0x8ec8('0x82')](_0x3a0511)){return;}else{_0x1ef334[_0x8ec8('0x83')]=_0x3a0511[_0x8ec8('0x83')];return db[_0x8ec8('0x84')][_0x8ec8('0x81')]({'where':{'id':_0x1ef334[_0x8ec8('0x85')]}});}})['then'](function(_0x11aeb9){return respondWithRpcPromise(_0x8ec8('0x86'),_0x8ec8('0x86'),{'FaxAccountId':_[_0x8ec8('0x82')](_0x196deb[_0x8ec8('0x54')])?undefined:_0x196deb[_0x8ec8('0x54')][_0x8ec8('0x87')],'path':_[_0x8ec8('0x82')](_0x11aeb9)?undefined:util[_0x8ec8('0x61')](_0x8ec8('0x88'),_0x11aeb9['basename']),'fax':_[_0x8ec8('0x82')](_0x1ef334[_0x8ec8('0x83')])?undefined:_0x1ef334['fax'],'AttachmentId':_0x1ef334[_0x8ec8('0x85')]},client9002);})[_0x8ec8('0x20')](respondWithResult(_0x1da6a1,0xc9))[_0x8ec8('0x4f')](handleError(_0x1da6a1,null));};exports['download']=function(_0x8ecb39,_0x3f6d5a){var _0x12c351=path[_0x8ec8('0x89')](config[_0x8ec8('0x8a')],'server',_0x8ec8('0x8b'),'attachments');return db[_0x8ec8('0x3a')][_0x8ec8('0x55')]({'where':{'id':_0x8ecb39[_0x8ec8('0x51')]['id']},'include':[{'model':db[_0x8ec8('0x84')],'as':_0x8ec8('0x84')}]})[_0x8ec8('0x20')](handleEntityNotFound(_0x3f6d5a,null))['then'](function(_0x29ead8){if(_0x29ead8){return _0x3f6d5a[_0x8ec8('0x8c')](path[_0x8ec8('0x89')](_0x12c351,_0x29ead8['Attachment'][_0x8ec8('0x8d')]));}})[_0x8ec8('0x4f')](handleError(_0x3f6d5a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 90df3d6..c451a7e 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 _0xe056=['hook','exports','FaxMessage','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x4e9b0e,_0x1805e5){var _0x5250ad=function(_0x5df2bc){while(--_0x5df2bc){_0x4e9b0e['push'](_0x4e9b0e['shift']());}};_0x5250ad(++_0x1805e5);}(_0xe056,0xdb));var _0x6e05=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe056[_0x20589d];return _0x422de9;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x6e05('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6e05('0x1')](0x0);var events={'afterCreate':_0x6e05('0x2'),'afterUpdate':'update','afterDestroy':_0x6e05('0x3')};function emitEvent(_0x518934){return function(_0x13ea30,_0x1bec29,_0x5205e6){FaxMessageEvents['emit'](_0x518934+':'+_0x13ea30['id'],_0x13ea30);FaxMessageEvents['emit'](_0x518934,_0x13ea30);_0x5205e6(null);};}for(var e in events){if(events[_0x6e05('0x4')](e)){var event=events[e];FaxMessage[_0x6e05('0x5')](e,emitEvent(event));}}module[_0x6e05('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0xc1fc=['emit','hook','exports','../../mysqldb','FaxMessage','save','update','remove'];(function(_0x17898e,_0x320e26){var _0x4f6e31=function(_0x3edcf7){while(--_0x3edcf7){_0x17898e['push'](_0x17898e['shift']());}};_0x4f6e31(++_0x320e26);}(_0xc1fc,0x93));var _0xcc1f=function(_0x3c4bb7,_0x375b31){_0x3c4bb7=_0x3c4bb7-0x0;var _0x3da720=_0xc1fc[_0x3c4bb7];return _0x3da720;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xcc1f('0x0'))['db'][_0xcc1f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc1f('0x2'),'afterUpdate':_0xcc1f('0x3'),'afterDestroy':_0xcc1f('0x4')};function emitEvent(_0x3f57ea){return function(_0x26d3b2,_0x52703d,_0x42d563){FaxMessageEvents[_0xcc1f('0x5')](_0x3f57ea+':'+_0x26d3b2['id'],_0x26d3b2);FaxMessageEvents['emit'](_0x3f57ea,_0x26d3b2);_0x42d563(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xcc1f('0x6')](e,emitEvent(event));}}module[_0xcc1f('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d31dfe8..3dca2eb 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 _0x1b79=['path','rimraf','../../config/environment','exports','define','FaxMessage','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','update','createdAt','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise'];(function(_0x21bb01,_0x4988f2){var _0x4a8035=function(_0x1a91f9){while(--_0x1a91f9){_0x21bb01['push'](_0x21bb01['shift']());}};_0x4a8035(++_0x4988f2);}(_0x1b79,0xd4));var _0x91b7=function(_0x187a1c,_0x26dac9){_0x187a1c=_0x187a1c-0x0;var _0x29dd3b=_0x1b79[_0x187a1c];return _0x29dd3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x91b7('0x0'))(_0x91b7('0x1'));var moment=require(_0x91b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x91b7('0x3'));var fs=require('fs');var path=require(_0x91b7('0x4'));var rimraf=require(_0x91b7('0x5'));var config=require(_0x91b7('0x6'));var attributes=require('./faxMessage.attributes');module[_0x91b7('0x7')]=function(_0x7b79d8,_0x527ab1){return _0x7b79d8[_0x91b7('0x8')](_0x91b7('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8c02af,_0x54e726,_0x4d775c){var _0x4b45ab=_0x7b79d8[_0x91b7('0xa')];var _0x1879e3=_0x8c02af[_0x91b7('0xb')]({'plain':!![]});if(_0x1879e3[_0x91b7('0xc')][_0x91b7('0xd')]()==='in'||_0x1879e3[_0x91b7('0xc')][_0x91b7('0xd')]()===_0x91b7('0xe')&&!_0x1879e3[_0x91b7('0xf')]&&!_[_0x91b7('0x10')](_0x1879e3[_0x91b7('0x11')])){_0x4b45ab[_0x91b7('0x12')][_0x91b7('0x13')]({'where':{'id':_0x1879e3['FaxInteractionId']}})['then'](function(_0x5b6d0d){if(_0x5b6d0d){_0x5b6d0d[_0x91b7('0x14')]({'lastMsgAt':_0x1879e3[_0x91b7('0x15')],'lastMsgDirection':_0x1879e3[_0x91b7('0xc')]['toLowerCase']()});}})['catch'](function(_0x1afff5){console['error'](_0x1afff5);});}_0x4d775c();}},'charset':_0x91b7('0x16'),'collate':_0x91b7('0x17')});}; \ No newline at end of file +var _0x67fd=['fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','fax_messages'];(function(_0x69fe35,_0x16f784){var _0x4f32a4=function(_0x1db3c2){while(--_0x1db3c2){_0x69fe35['push'](_0x69fe35['shift']());}};_0x4f32a4(++_0x16f784);}(_0x67fd,0x19a));var _0xd67f=function(_0x10e8d2,_0x32304d){_0x10e8d2=_0x10e8d2-0x0;var _0x4a5195=_0x67fd[_0x10e8d2];return _0x4a5195;};'use strict';var _=require(_0xd67f('0x0'));var util=require(_0xd67f('0x1'));var logger=require('../../config/logger')(_0xd67f('0x2'));var moment=require('moment');var BPromise=require(_0xd67f('0x3'));var rp=require(_0xd67f('0x4'));var fs=require('fs');var path=require(_0xd67f('0x5'));var rimraf=require(_0xd67f('0x6'));var config=require(_0xd67f('0x7'));var attributes=require('./faxMessage.attributes');module[_0xd67f('0x8')]=function(_0x14153e,_0x4d7170){return _0x14153e['define']('FaxMessage',attributes,{'tableName':_0xd67f('0x9'),'paranoid':![],'indexes':[{'name':_0xd67f('0xa'),'fields':['body'],'type':_0xd67f('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2198ad,_0x56c5c5,_0x442029){var _0x3c85f8=_0x14153e[_0xd67f('0xc')];var _0x4aaf36=_0x2198ad[_0xd67f('0xd')]({'plain':!![]});if(_0x4aaf36[_0xd67f('0xe')][_0xd67f('0xf')]()==='in'||_0x4aaf36[_0xd67f('0xe')]['toLowerCase']()===_0xd67f('0x10')&&!_0x4aaf36[_0xd67f('0x11')]&&!_[_0xd67f('0x12')](_0x4aaf36[_0xd67f('0x13')])){_0x3c85f8['FaxInteraction'][_0xd67f('0x14')]({'where':{'id':_0x4aaf36[_0xd67f('0x15')]}})[_0xd67f('0x16')](function(_0x271255){if(_0x271255){_0x271255[_0xd67f('0x17')]({'lastMsgAt':_0x4aaf36[_0xd67f('0x18')],'lastMsgDirection':_0x4aaf36[_0xd67f('0xe')][_0xd67f('0xf')]()});}})[_0xd67f('0x19')](function(_0x543d96){console[_0xd67f('0x1a')](_0x543d96);});}_0x442029();}},'charset':_0xd67f('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 36caaf0..2256447 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 _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x224fdf,_0xac4c2c){var _0x452a7d=function(_0x538223){while(--_0x538223){_0x224fdf['push'](_0x224fdf['shift']());}};_0x452a7d(++_0xac4c2c);}(_0xe5b3,0x133));var _0x3e5b=function(_0x44b7bb,_0x460592){_0x44b7bb=_0x44b7bb-0x0;var _0x370e81=_0xe5b3[_0x44b7bb];return _0x370e81;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});}; \ No newline at end of file +var _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xbd50,0x196));var _0x0bd5=function(_0x3b9a2f,_0x4aea4d){_0x3b9a2f=_0x3b9a2f-0x0;var _0x1d6ad3=_0xbd50[_0x3b9a2f];return _0x1d6ad3;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cb3a6ea..9b65152 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 _0x2c6b=['remove','update','emit','removeListener','faxMessage:','./faxMessage.events'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x2c6b,0xd7));var _0xb2c6=function(_0x11a238,_0x1c48fa){_0x11a238=_0x11a238-0x0;var _0x517b53=_0x2c6b[_0x11a238];return _0x517b53;};'use strict';var FaxMessageEvents=require(_0xb2c6('0x0'));var events=['save',_0xb2c6('0x1'),_0xb2c6('0x2')];function createListener(_0x3538ec,_0xe86eff){return function(_0x26b7ce){_0xe86eff[_0xb2c6('0x3')](_0x3538ec,_0x26b7ce);};}function removeListener(_0x43aef3,_0x459fa0){return function(){FaxMessageEvents[_0xb2c6('0x4')](_0x43aef3,_0x459fa0);};}exports['register']=function(_0x4f7fff){for(var _0x24e120=0x0,_0x530726=events['length'];_0x24e120<_0x530726;_0x24e120++){var _0x57f5c2=events[_0x24e120];var _0x40d706=createListener(_0xb2c6('0x5')+_0x57f5c2,_0x4f7fff);FaxMessageEvents['on'](_0x57f5c2,_0x40d706);}}; \ No newline at end of file +var _0x6807=['./faxMessage.events','save','update','emit','register'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6807,0xcd));var _0x7680=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6807[_0x432682];return _0x463d05;};'use strict';var FaxMessageEvents=require(_0x7680('0x0'));var events=[_0x7680('0x1'),'remove',_0x7680('0x2')];function createListener(_0x1d95f7,_0x2b8a38){return function(_0x3f07ab){_0x2b8a38[_0x7680('0x3')](_0x1d95f7,_0x3f07ab);};}function removeListener(_0x2f6202,_0x46c01d){return function(){FaxMessageEvents['removeListener'](_0x2f6202,_0x46c01d);};}exports[_0x7680('0x4')]=function(_0x316525){for(var _0x501542=0x0,_0x59a709=events['length'];_0x501542<_0x59a709;_0x501542++){var _0x119418=events[_0x501542];var _0x209ba1=createListener('faxMessage:'+_0x119418,_0x316525);FaxMessageEvents['on'](_0x119418,_0x209ba1);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d047f8d..ac5b55a 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 _0xd64b=['tracked','fax','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','post'];(function(_0x30446d,_0x434abc){var _0x19a343=function(_0x4195a1){while(--_0x4195a1){_0x30446d['push'](_0x30446d['shift']());}};_0x19a343(++_0x434abc);}(_0xd64b,0xc1));var _0xbd64=function(_0x1a72e1,_0x1ffbea){_0x1a72e1=_0x1a72e1-0x0;var _0x3c980c=_0xd64b[_0x1a72e1];return _0x3c980c;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0x8')](_0xbd64('0xd'),auth[_0xbd64('0xa')](),controller['download']);router[_0xbd64('0xe')]('/',auth[_0xbd64('0xa')](),interaction[_0xbd64('0xf')](_0xbd64('0x10'),'faxmessage:create'),controller[_0xbd64('0x11')]);router['put'](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x12')]);router[_0xbd64('0x13')](_0xbd64('0x14'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x15')]);router[_0xbd64('0x13')](_0xbd64('0x16'),auth['isAuthenticated'](),controller[_0xbd64('0x17')]);router[_0xbd64('0x18')](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x19')]);module['exports']=router; \ No newline at end of file +var _0x76dc=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','show','post','tracked','fax','faxmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util'];(function(_0x38c547,_0x5beead){var _0x48475d=function(_0x322c0a){while(--_0x322c0a){_0x38c547['push'](_0x38c547['shift']());}};_0x48475d(++_0x5beead);}(_0x76dc,0x1f2));var _0xc76d=function(_0x104e26,_0x3e60ae){_0x104e26=_0x104e26-0x0;var _0x1525ac=_0x76dc[_0x104e26];return _0x1525ac;};'use strict';var multer=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var path=require(_0xc76d('0x2'));var timeout=require(_0xc76d('0x3'));var express=require('express');var router=express[_0xc76d('0x4')]();var fs_extra=require(_0xc76d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc76d('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xc76d('0x7')]('/',auth[_0xc76d('0x8')](),controller[_0xc76d('0x9')]);router['get']('/describe',auth[_0xc76d('0x8')](),controller[_0xc76d('0xa')]);router[_0xc76d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc76d('0xb')]);router[_0xc76d('0x7')]('/:id/download',auth[_0xc76d('0x8')](),controller['download']);router[_0xc76d('0xc')]('/',auth[_0xc76d('0x8')](),interaction[_0xc76d('0xd')](_0xc76d('0xe'),_0xc76d('0xf')),controller[_0xc76d('0x10')]);router[_0xc76d('0x11')](_0xc76d('0x12'),auth[_0xc76d('0x8')](),controller[_0xc76d('0x13')]);router[_0xc76d('0x11')](_0xc76d('0x14'),auth[_0xc76d('0x8')](),controller[_0xc76d('0x15')]);router['put'](_0xc76d('0x16'),auth[_0xc76d('0x8')](),controller['reject']);router[_0xc76d('0x17')](_0xc76d('0x12'),auth[_0xc76d('0x8')](),controller[_0xc76d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9120bfc..d0f535c 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 _0x6ad2=['name','INTEGER','beepall','sequelize','exports','STRING'];(function(_0x30a84b,_0x4edbef){var _0x47aaec=function(_0x36a47e){while(--_0x36a47e){_0x30a84b['push'](_0x30a84b['shift']());}};_0x47aaec(++_0x4edbef);}(_0x6ad2,0x159));var _0x26ad=function(_0x547bb6,_0x2d6f27){_0x547bb6=_0x547bb6-0x0;var _0x1a9154=_0x6ad2[_0x547bb6];return _0x1a9154;};'use strict';var Sequelize=require(_0x26ad('0x0'));module[_0x26ad('0x1')]={'name':{'type':Sequelize[_0x26ad('0x2')],'unique':_0x26ad('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x26ad('0x2')]},'timeout':{'type':Sequelize[_0x26ad('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x26ad('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x26ad('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcf54=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf54,0x125));var _0x4cf5=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0xcf54[_0x2298f0];return _0x39b136;};'use strict';var Sequelize=require('sequelize');module[_0x4cf5('0x0')]={'name':{'type':Sequelize[_0x4cf5('0x1')],'unique':_0x4cf5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4cf5('0x1')]},'timeout':{'type':Sequelize[_0x4cf5('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4cf5('0x4')](_0x4cf5('0x5'),'beepall',_0x4cf5('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4cf5('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index becf55e..e74969c 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 _0xcfe2=['reject','then','destroy','FaxQueues','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserFaxQueue','hasOwnProperty','order','pick','FaxQueueId','findAll','User','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userFaxQueue:save','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','userFaxQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply'];(function(_0x24cf7a,_0x290e32){var _0x3ba898=function(_0x2bf482){while(--_0x2bf482){_0x24cf7a['push'](_0x24cf7a['shift']());}};_0x3ba898(++_0x290e32);}(_0xcfe2,0x66));var _0x2cfe=function(_0x38cf70,_0x1c4cc4){_0x38cf70=_0x38cf70-0x0;var _0x3bb2e5=_0xcfe2[_0x38cf70];return _0x3bb2e5;};'use strict';var emlformat=require(_0x2cfe('0x0'));var rimraf=require(_0x2cfe('0x1'));var zipdir=require(_0x2cfe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cfe('0x3'));var moment=require(_0x2cfe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2cfe('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2cfe('0x6'));var ejs=require(_0x2cfe('0x7'));var fs=require('fs');var fs_extra=require(_0x2cfe('0x8'));var _=require('lodash');var squel=require(_0x2cfe('0x9'));var crypto=require(_0x2cfe('0xa'));var jsforce=require(_0x2cfe('0xb'));var deskjs=require(_0x2cfe('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2cfe('0xd'));var authService=require(_0x2cfe('0xe'));var qs=require(_0x2cfe('0xf'));var as=require(_0x2cfe('0x10'));var hardwareService=require(_0x2cfe('0x11'));var logger=require(_0x2cfe('0x12'))('api');var utils=require(_0x2cfe('0x13'));var config=require(_0x2cfe('0x14'));var licenseUtil=require(_0x2cfe('0x15'));var db=require(_0x2cfe('0x16'))['db'];config[_0x2cfe('0x17')]=_[_0x2cfe('0x18')](config[_0x2cfe('0x17')],{'host':_0x2cfe('0x19'),'port':0x18eb});var socket=require(_0x2cfe('0x1a'))(new Redis(config['redis']));require(_0x2cfe('0x1b'))[_0x2cfe('0x1c')](socket);function respondWithStatusCode(_0x166942,_0x1f084c){_0x1f084c=_0x1f084c||0xcc;return function(_0x2e3dc8){if(_0x2e3dc8){return _0x166942[_0x2cfe('0x1d')](_0x1f084c);}return _0x166942[_0x2cfe('0x1e')](_0x1f084c)[_0x2cfe('0x1f')]();};}function respondWithResult(_0x3b288b,_0x1032d3){_0x1032d3=_0x1032d3||0xc8;return function(_0x3a090a){if(_0x3a090a){return _0x3b288b[_0x2cfe('0x1e')](_0x1032d3)[_0x2cfe('0x20')](_0x3a090a);}};}function respondWithFilteredResult(_0xc996db,_0x20ea02){return function(_0x2386c7){if(_0x2386c7){var _0x5e01ec=typeof _0x20ea02['offset']==='undefined'&&typeof _0x20ea02[_0x2cfe('0x21')]===_0x2cfe('0x22');var _0x4bb176=_0x2386c7['count'];var _0x45bf64=_0x5e01ec?0x0:_0x20ea02[_0x2cfe('0x23')];var _0x1e76c8=_0x5e01ec?_0x2386c7[_0x2cfe('0x24')]:_0x20ea02[_0x2cfe('0x23')]+_0x20ea02[_0x2cfe('0x21')];var _0x58a469;if(_0x1e76c8>=_0x4bb176){_0x1e76c8=_0x4bb176;_0x58a469=0xc8;}else{_0x58a469=0xce;}_0xc996db['status'](_0x58a469);return _0xc996db['set'](_0x2cfe('0x25'),_0x45bf64+'-'+_0x1e76c8+'/'+_0x4bb176)[_0x2cfe('0x20')](_0x2386c7);}return null;};}function patchUpdates(_0x4cf98f){return function(_0x4007de){try{jsonpatch[_0x2cfe('0x26')](_0x4007de,_0x4cf98f,!![]);}catch(_0x41e0fc){return BPromise[_0x2cfe('0x27')](_0x41e0fc);}return _0x4007de['save']();};}function saveUpdates(_0xb2e140,_0x5042e0){return function(_0xc2a635){if(_0xc2a635){return _0xc2a635['update'](_0xb2e140)[_0x2cfe('0x28')](function(_0x5af5d7){return _0x5af5d7;});}return null;};}function removeEntity(_0x43042a,_0x3f8314){return function(_0x14bede){if(_0x14bede){return _0x14bede[_0x2cfe('0x29')]()['then'](function(){var _0x7db89b=_0x14bede['get']({'plain':!![]});var _0x57efa5=_0x2cfe('0x2a');return db['UserProfileResource'][_0x2cfe('0x29')]({'where':{'type':_0x57efa5,'resourceId':_0x7db89b['id']}})[_0x2cfe('0x28')](function(){return _0x14bede;});})[_0x2cfe('0x28')](function(){_0x43042a[_0x2cfe('0x1e')](0xcc)[_0x2cfe('0x1f')]();});}};}function handleEntityNotFound(_0x465301,_0x5854bd){return function(_0x3468f6){if(!_0x3468f6){_0x465301[_0x2cfe('0x1d')](0x194);}return _0x3468f6;};}function handleError(_0x26d95b,_0x3756ed){_0x3756ed=_0x3756ed||0x1f4;return function(_0x4323cf){logger[_0x2cfe('0x2b')](_0x4323cf[_0x2cfe('0x2c')]);if(_0x4323cf['name']){delete _0x4323cf[_0x2cfe('0x2d')];}_0x26d95b['status'](_0x3756ed)[_0x2cfe('0x2e')](_0x4323cf);};}exports[_0x2cfe('0x2f')]=function(_0x5276ca,_0x20a08b){var _0x47e73d={},_0x5b723a={},_0x35b027={'count':0x0,'rows':[]};var _0x38b85d=_[_0x2cfe('0x30')](db[_0x2cfe('0x31')][_0x2cfe('0x32')],function(_0x41dd8f){return{'name':_0x41dd8f[_0x2cfe('0x33')],'type':_0x41dd8f[_0x2cfe('0x34')][_0x2cfe('0x35')]};});_0x5b723a[_0x2cfe('0x36')]=_['map'](_0x38b85d,_0x2cfe('0x2d'));_0x5b723a['query']=_[_0x2cfe('0x37')](_0x5276ca[_0x2cfe('0x38')]);_0x5b723a[_0x2cfe('0x39')]=_[_0x2cfe('0x3a')](_0x5b723a[_0x2cfe('0x36')],_0x5b723a[_0x2cfe('0x38')]);_0x47e73d[_0x2cfe('0x3b')]=_[_0x2cfe('0x3a')](_0x5b723a['model'],qs[_0x2cfe('0x3c')](_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x3c')]));_0x47e73d[_0x2cfe('0x3b')]=_0x47e73d[_0x2cfe('0x3b')]['length']?_0x47e73d['attributes']:_0x5b723a[_0x2cfe('0x36')];if(!_0x5276ca[_0x2cfe('0x38')]['hasOwnProperty'](_0x2cfe('0x3d'))){_0x47e73d[_0x2cfe('0x21')]=qs[_0x2cfe('0x21')](_0x5276ca['query'][_0x2cfe('0x21')]);_0x47e73d[_0x2cfe('0x23')]=qs['offset'](_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x23')]);}_0x47e73d['order']=qs[_0x2cfe('0x3e')](_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x3e')]);_0x47e73d['where']=qs['filters'](_['pick'](_0x5276ca[_0x2cfe('0x38')],_0x5b723a[_0x2cfe('0x39')]),_0x38b85d);if(_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x3f')]){_0x47e73d['where']=_[_0x2cfe('0x40')](_0x47e73d[_0x2cfe('0x41')],{'$or':_['map'](_0x38b85d,function(_0x47d468){if(_0x47d468[_0x2cfe('0x34')]!==_0x2cfe('0x42')){var _0x34da77={};_0x34da77[_0x47d468[_0x2cfe('0x2d')]]={'$like':'%'+_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x3f')]+'%'};return _0x34da77;}})});}_0x47e73d=_[_0x2cfe('0x40')]({},_0x47e73d,_0x5276ca[_0x2cfe('0x43')]);var _0x36c019={'where':_0x47e73d[_0x2cfe('0x41')]};return db['FaxQueue'][_0x2cfe('0x24')](_0x36c019)['then'](function(_0x3787a8){_0x35b027[_0x2cfe('0x24')]=_0x3787a8;if(_0x5276ca[_0x2cfe('0x38')][_0x2cfe('0x44')]){_0x47e73d[_0x2cfe('0x45')]=[{'all':!![]}];}return db[_0x2cfe('0x31')]['findAll'](_0x47e73d);})['then'](function(_0x5379e6){_0x35b027[_0x2cfe('0x46')]=_0x5379e6;return _0x35b027;})[_0x2cfe('0x28')](respondWithFilteredResult(_0x20a08b,_0x47e73d))[_0x2cfe('0x47')](handleError(_0x20a08b,null));};exports[_0x2cfe('0x48')]=function(_0x332603,_0x416fcc){var _0x2f3d78={'raw':!![],'where':{'id':_0x332603[_0x2cfe('0x49')]['id']}},_0x25c38f={};_0x25c38f[_0x2cfe('0x36')]=_[_0x2cfe('0x37')](db[_0x2cfe('0x31')]['rawAttributes']);_0x25c38f['query']=_[_0x2cfe('0x37')](_0x332603[_0x2cfe('0x38')]);_0x25c38f[_0x2cfe('0x39')]=_['intersection'](_0x25c38f[_0x2cfe('0x36')],_0x25c38f['query']);_0x2f3d78['attributes']=_[_0x2cfe('0x3a')](_0x25c38f['model'],qs[_0x2cfe('0x3c')](_0x332603['query'][_0x2cfe('0x3c')]));_0x2f3d78[_0x2cfe('0x3b')]=_0x2f3d78[_0x2cfe('0x3b')][_0x2cfe('0x4a')]?_0x2f3d78['attributes']:_0x25c38f['model'];if(_0x332603[_0x2cfe('0x38')][_0x2cfe('0x44')]){_0x2f3d78['include']=[{'all':!![]}];}_0x2f3d78=_[_0x2cfe('0x40')]({},_0x2f3d78,_0x332603[_0x2cfe('0x43')]);return db['FaxQueue'][_0x2cfe('0x4b')](_0x2f3d78)['then'](handleEntityNotFound(_0x416fcc,null))[_0x2cfe('0x28')](respondWithResult(_0x416fcc,null))['catch'](handleError(_0x416fcc,null));};exports[_0x2cfe('0x4c')]=function(_0x2474cb,_0x8c1a55){return db[_0x2cfe('0x31')][_0x2cfe('0x4c')](_0x2474cb[_0x2cfe('0x4d')],{})['then'](function(_0xa24962){var _0x3a0818=_0x2474cb[_0x2cfe('0x4e')][_0x2cfe('0x4f')]({'plain':!![]});if(!_0x3a0818)throw new Error(_0x2cfe('0x50'));if(_0x3a0818[_0x2cfe('0x51')]==='user'){var _0x53be4b=_0xa24962[_0x2cfe('0x4f')]({'plain':!![]});var _0x32c24b=_0x2cfe('0x2a');return db[_0x2cfe('0x52')][_0x2cfe('0x4b')]({'where':{'name':_0x32c24b,'userProfileId':_0x3a0818[_0x2cfe('0x53')]},'raw':!![]})[_0x2cfe('0x28')](function(_0x23a159){if(_0x23a159&&_0x23a159[_0x2cfe('0x54')]===0x0){return db[_0x2cfe('0x55')][_0x2cfe('0x4c')]({'name':_0x53be4b[_0x2cfe('0x2d')],'resourceId':_0x53be4b['id'],'type':_0x23a159['name'],'sectionId':_0x23a159['id']},{})[_0x2cfe('0x28')](function(){return _0xa24962;});}else{return _0xa24962;}})[_0x2cfe('0x47')](function(_0x319184){logger[_0x2cfe('0x2b')](_0x2cfe('0x56'),_0x319184);throw _0x319184;});}return _0xa24962;})['then'](respondWithResult(_0x8c1a55,0xc9))[_0x2cfe('0x47')](handleError(_0x8c1a55,null));};exports[_0x2cfe('0x57')]=function(_0x4ac101,_0x1d9a45){if(_0x4ac101[_0x2cfe('0x4d')]['id']){delete _0x4ac101['body']['id'];}return db[_0x2cfe('0x31')][_0x2cfe('0x4b')]({'where':{'id':_0x4ac101[_0x2cfe('0x49')]['id']}})[_0x2cfe('0x28')](handleEntityNotFound(_0x1d9a45,null))[_0x2cfe('0x28')](saveUpdates(_0x4ac101[_0x2cfe('0x4d')],null))['then'](respondWithResult(_0x1d9a45,null))[_0x2cfe('0x47')](handleError(_0x1d9a45,null));};exports['destroy']=function(_0x27115f,_0x15db19){return db[_0x2cfe('0x31')]['find']({'where':{'id':_0x27115f['params']['id']}})[_0x2cfe('0x28')](handleEntityNotFound(_0x15db19,null))['then'](removeEntity(_0x15db19,null))[_0x2cfe('0x47')](handleError(_0x15db19,null));};exports[_0x2cfe('0x58')]=function(_0xb11672,_0x5c781e){return db[_0x2cfe('0x31')][_0x2cfe('0x58')]()['then'](respondWithResult(_0x5c781e,null))[_0x2cfe('0x47')](handleError(_0x5c781e,null));};exports['getMembers']=function(_0x4e81e4,_0x4c3f45,_0x28c3e9){var _0x55e0df={'raw':!![],'where':{}},_0x3aceb8={},_0x357aca;return db[_0x2cfe('0x31')][_0x2cfe('0x59')]({'where':{'id':_0x4e81e4[_0x2cfe('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c3f45,null))[_0x2cfe('0x28')](function(_0x179362){if(_0x179362){_0x357aca=_0x179362['get']({'plain':!![]});_0x3aceb8['model']=_['keys'](db[_0x2cfe('0x5a')]['rawAttributes']);_0x3aceb8['query']=_[_0x2cfe('0x37')](_0x4e81e4['query']);_0x3aceb8[_0x2cfe('0x39')]=_[_0x2cfe('0x3a')](_0x3aceb8[_0x2cfe('0x36')],_0x3aceb8[_0x2cfe('0x38')]);_0x55e0df[_0x2cfe('0x3b')]=_[_0x2cfe('0x3a')](_0x3aceb8[_0x2cfe('0x36')],qs[_0x2cfe('0x3c')](_0x4e81e4[_0x2cfe('0x38')]['fields']));_0x55e0df['attributes']=_0x55e0df[_0x2cfe('0x3b')][_0x2cfe('0x4a')]?_0x55e0df[_0x2cfe('0x3b')]:_0x3aceb8[_0x2cfe('0x36')];if(!_0x4e81e4[_0x2cfe('0x38')][_0x2cfe('0x5b')]('nolimit')){_0x55e0df[_0x2cfe('0x21')]=qs[_0x2cfe('0x21')](_0x4e81e4[_0x2cfe('0x38')]['limit']);_0x55e0df[_0x2cfe('0x23')]=qs[_0x2cfe('0x23')](_0x4e81e4[_0x2cfe('0x38')][_0x2cfe('0x23')]);}_0x55e0df[_0x2cfe('0x5c')]=qs['sort'](_0x4e81e4[_0x2cfe('0x38')][_0x2cfe('0x3e')]);_0x55e0df[_0x2cfe('0x41')]=qs[_0x2cfe('0x39')](_[_0x2cfe('0x5d')](_0x4e81e4[_0x2cfe('0x38')],_0x3aceb8[_0x2cfe('0x39')]));_0x55e0df[_0x2cfe('0x41')][_0x2cfe('0x5e')]=_0x179362['id'];if(_0x4e81e4[_0x2cfe('0x38')][_0x2cfe('0x3f')]){_0x55e0df[_0x2cfe('0x41')]=_[_0x2cfe('0x40')](_0x55e0df[_0x2cfe('0x41')],{'$or':_[_0x2cfe('0x30')](_0x55e0df[_0x2cfe('0x3b')],function(_0x403645){var _0x594001={};_0x594001[_0x403645]={'$like':'%'+_0x4e81e4[_0x2cfe('0x38')][_0x2cfe('0x3f')]+'%'};return _0x594001;})});}_0x55e0df=_[_0x2cfe('0x40')]({},_0x55e0df,_0x4e81e4[_0x2cfe('0x43')]);return db[_0x2cfe('0x5a')][_0x2cfe('0x5f')](_0x55e0df);}})[_0x2cfe('0x28')](function(_0xe521d6){if(_0xe521d6){return db[_0x2cfe('0x60')]['findAndCountAll']({'where':{'id':_[_0x2cfe('0x30')](_0xe521d6,_0x2cfe('0x61')),'role':_0x2cfe('0x62')},'attributes':['id',_0x2cfe('0x2d'),_0x2cfe('0x63'),_0x2cfe('0x64'),_0x2cfe('0x65')]});}})[_0x2cfe('0x28')](function(_0x2a3499){if(_0x2a3499){return{'count':_0x2a3499[_0x2cfe('0x24')],'rows':_['map'](_0x2a3499[_0x2cfe('0x46')],function(_0x4278f4){return{'membername':_0x4278f4['name'],'UserId':_0x4278f4['id'],'queue_name':_0x357aca[_0x2cfe('0x2d')],'FaxQueueId':_0x357aca['id'],'interface':util[_0x2cfe('0x66')]('%s/%s',_0x2cfe('0x67'),_0x4278f4['name']),'penalty':0x0,'paused':_0x4278f4[_0x2cfe('0x63')],'createdAt':_0x4278f4[_0x2cfe('0x65')],'updatedAt':_0x4278f4[_0x2cfe('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4c3f45,_0x55e0df))[_0x2cfe('0x47')](handleError(_0x4c3f45,null));};exports[_0x2cfe('0x68')]=function(_0x2d3824,_0x3cbecc,_0x18e0b6){var _0x13bfa9={};var _0x32a211={};var _0x245ca0;var _0x29bf77;return db[_0x2cfe('0x31')][_0x2cfe('0x59')]({'where':{'id':_0x2d3824[_0x2cfe('0x49')]['id']}})[_0x2cfe('0x28')](handleEntityNotFound(_0x3cbecc,null))[_0x2cfe('0x28')](function(_0xaffce5){if(_0xaffce5){_0x245ca0=_0xaffce5;_0x32a211[_0x2cfe('0x36')]=_[_0x2cfe('0x37')](db[_0x2cfe('0x69')][_0x2cfe('0x32')]);_0x32a211['query']=_[_0x2cfe('0x37')](_0x2d3824[_0x2cfe('0x38')]);_0x32a211[_0x2cfe('0x39')]=_[_0x2cfe('0x3a')](_0x32a211['model'],_0x32a211['query']);_0x13bfa9[_0x2cfe('0x3b')]=_['intersection'](_0x32a211[_0x2cfe('0x36')],qs[_0x2cfe('0x3c')](_0x2d3824[_0x2cfe('0x38')][_0x2cfe('0x3c')]));_0x13bfa9[_0x2cfe('0x3b')]=_0x13bfa9['attributes'][_0x2cfe('0x4a')]?_0x13bfa9[_0x2cfe('0x3b')]:_0x32a211[_0x2cfe('0x36')];_0x13bfa9[_0x2cfe('0x5c')]=qs[_0x2cfe('0x3e')](_0x2d3824[_0x2cfe('0x38')][_0x2cfe('0x3e')]);_0x13bfa9[_0x2cfe('0x41')]=qs['filters'](_['pick'](_0x2d3824['query'],_0x32a211[_0x2cfe('0x39')]));if(_0x2d3824[_0x2cfe('0x38')][_0x2cfe('0x3f')]){_0x13bfa9[_0x2cfe('0x41')]=_['merge'](_0x13bfa9[_0x2cfe('0x41')],{'$or':_[_0x2cfe('0x30')](_0x13bfa9[_0x2cfe('0x3b')],function(_0x2f348a){var _0xf63d66={};_0xf63d66[_0x2f348a]={'$like':'%'+_0x2d3824[_0x2cfe('0x38')][_0x2cfe('0x3f')]+'%'};return _0xf63d66;})});}_0x13bfa9=_[_0x2cfe('0x40')]({},_0x13bfa9,_0x2d3824[_0x2cfe('0x43')]);return _0x245ca0['getTeams'](_0x13bfa9);}})[_0x2cfe('0x28')](function(_0x2b14d1){if(_0x2b14d1){_0x29bf77=_0x2b14d1['length'];if(!_0x2d3824[_0x2cfe('0x38')][_0x2cfe('0x5b')](_0x2cfe('0x3d'))){_0x13bfa9[_0x2cfe('0x21')]=qs[_0x2cfe('0x21')](_0x2d3824['query']['limit']);_0x13bfa9[_0x2cfe('0x23')]=qs[_0x2cfe('0x23')](_0x2d3824[_0x2cfe('0x38')]['offset']);}return _0x245ca0[_0x2cfe('0x68')](_0x13bfa9);}})['then'](function(_0x5eff62){if(_0x5eff62){return _0x5eff62?{'count':_0x29bf77,'rows':_0x5eff62}:null;}})['then'](respondWithResult(_0x3cbecc,null))[_0x2cfe('0x47')](handleError(_0x3cbecc,null));};exports[_0x2cfe('0x6a')]=function(_0x9fc44e,_0x28d642,_0x5cf56b){var _0x208198=_0x9fc44e['body'][_0x2cfe('0x6b')];return db[_0x2cfe('0x69')][_0x2cfe('0x5f')]({'where':{'id':_0x208198},'attributes':['id'],'include':[{'model':db[_0x2cfe('0x60')],'as':'Agents','attributes':['id',_0x2cfe('0x2d'),_0x2cfe('0x6c'),'voicePause',_0x2cfe('0x6d')],'raw':!![]}]})[_0x2cfe('0x28')](function(_0x5302ff){if(_0x5302ff){var _0x3519ba=_[_0x2cfe('0x6e')](_0x5302ff,function(_0x888eb9){var _0x1199fa=_0x888eb9['get']({'plain':!![]});return _0x1199fa[_0x2cfe('0x6f')];});return db[_0x2cfe('0x31')]['find']({'where':{'id':_0x9fc44e['params']['id']}})['then'](function(_0xb39396){return db['sequelize'][_0x2cfe('0x70')](function(_0x3494cc){return _0xb39396[_0x2cfe('0x6a')](_0x208198,{'transaction':_0x3494cc})['then'](function(){return BPromise[_0x2cfe('0x71')](_0x3519ba,function(_0x35edc4){return db[_0x2cfe('0x5a')][_0x2cfe('0x72')]({'where':{'UserId':_0x35edc4['id'],'FaxQueueId':_0x9fc44e[_0x2cfe('0x49')]['id']},'transaction':_0x3494cc});});})[_0x2cfe('0x28')](function(){_0x3519ba['forEach'](function(_0x2085c3){socket[_0x2cfe('0x73')](_0x2cfe('0x74'),{'UserId':_0x2085c3['id'],'FaxQueueId':_0xb39396['id']});});});});});}})[_0x2cfe('0x28')](respondWithStatusCode(_0x28d642,null))['catch'](handleError(_0x28d642,null));};exports['removeTeams']=function(_0x7e0b7,_0x524212,_0x403749){return db['Team'][_0x2cfe('0x5f')]({'where':{'id':_0x7e0b7[_0x2cfe('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2cfe('0x60')],'as':_0x2cfe('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x2cfe('0x28')](handleEntityNotFound(_0x524212,null))['then'](function(_0x2a9372){var _0x470981=_['map'](_0x2a9372,'id');var _0x3ad53b=[];var _0x43f37b=[];var _0x318e33=squel[_0x2cfe('0x75')]();_0x318e33[_0x2cfe('0x76')]('tq.TeamId')[_0x2cfe('0x77')](_0x2cfe('0x78'),'tq')[_0x2cfe('0x79')]('user_has_teams','ut',_0x2cfe('0x7a'))[_0x2cfe('0x41')](_0x2cfe('0x7b'),_0x7e0b7[_0x2cfe('0x49')]['id']);for(var _0x20036a=0x0;_0x20036a<_0x2a9372[_0x2cfe('0x4a')];_0x20036a+=0x1){let _0x35745a=_0x2a9372[_0x20036a];for(var _0x4ebb48=0x0;_0x4ebb48<_0x35745a[_0x2cfe('0x6f')]['length'];_0x4ebb48+=0x1){let _0x15effc=_0x35745a[_0x2cfe('0x6f')][_0x4ebb48];var _0x13a53d=_0x318e33[_0x2cfe('0x7c')]();_0x13a53d[_0x2cfe('0x41')](_0x2cfe('0x7d'),_0x15effc['id']);_0x43f37b['push'](db[_0x2cfe('0x7e')][_0x2cfe('0x38')](_0x13a53d['toString'](),{'type':db[_0x2cfe('0x7e')][_0x2cfe('0x7f')][_0x2cfe('0x80')]})[_0x2cfe('0x28')](function(_0x1d8c58){if(_0x1d8c58['length']===0x1){return _0x15effc['id'];}else{var _0x568837=_[_0x2cfe('0x81')](_[_0x2cfe('0x30')](_0x1d8c58,'TeamId'),function(_0x4dd52c){return _[_0x2cfe('0x82')](_0x470981,_0x4dd52c);});if(_0x568837){return _0x15effc['id'];}}}));}}return BPromise['all'](_0x43f37b)['then'](function(_0x558b22){_0x3ad53b=_(_0x3ad53b)[_0x2cfe('0x83')](_0x558b22)[_0x2cfe('0x84')]()[_0x2cfe('0x85')]();return db['FaxQueue'][_0x2cfe('0x4b')]({'where':{'id':_0x7e0b7[_0x2cfe('0x49')]['id']}})['then'](function(_0x420eca){return db[_0x2cfe('0x7e')][_0x2cfe('0x70')](function(_0x2be632){return _0x420eca[_0x2cfe('0x86')](_0x7e0b7[_0x2cfe('0x38')][_0x2cfe('0x6b')],{'transaction':_0x2be632})[_0x2cfe('0x28')](function(){if(!_[_0x2cfe('0x87')](_0x3ad53b)){return _0x420eca['removeAgents'](_0x3ad53b,{'transaction':_0x2be632});}})[_0x2cfe('0x28')](function(){_0x3ad53b['forEach'](function(_0x389cc6){socket[_0x2cfe('0x73')](_0x2cfe('0x88'),{'UserId':_0x389cc6,'FaxQueueId':_0x420eca['id']});});});});});});})[_0x2cfe('0x28')](respondWithStatusCode(_0x524212,null))[_0x2cfe('0x47')](handleError(_0x524212,null));};exports[_0x2cfe('0x89')]=function(_0xbb4067,_0x1feaa9,_0x281869){return db['FaxQueue'][_0x2cfe('0x4b')]({'where':{'id':_0xbb4067[_0x2cfe('0x49')]['id']}})[_0x2cfe('0x28')](handleEntityNotFound(_0x1feaa9,null))[_0x2cfe('0x28')](function(_0x5bda1d){if(_0x5bda1d){return _0x5bda1d['addAgents'](_0xbb4067[_0x2cfe('0x4d')][_0x2cfe('0x6b')],_['omit'](_0xbb4067[_0x2cfe('0x4d')],[_0x2cfe('0x6b'),'id'])||{})['spread'](function(_0x43271f){for(var _0x447130=0x0;_0x447130<_0xbb4067['body'][_0x2cfe('0x6b')][_0x2cfe('0x4a')];_0x447130+=0x1){socket['emit'](_0x2cfe('0x74'),{'UserId':Number(_0xbb4067[_0x2cfe('0x4d')][_0x2cfe('0x6b')][_0x447130]),'FaxQueueId':Number(_0xbb4067[_0x2cfe('0x49')]['id'])});}return _0x43271f;});}})[_0x2cfe('0x28')](respondWithResult(_0x1feaa9,null))[_0x2cfe('0x47')](handleError(_0x1feaa9,null));};exports[_0x2cfe('0x8a')]=function(_0x54ae0e,_0x59e7ce,_0x3dda9e){return db[_0x2cfe('0x31')]['find']({'where':{'id':_0x54ae0e[_0x2cfe('0x49')]['id']}})[_0x2cfe('0x28')](handleEntityNotFound(_0x59e7ce,null))[_0x2cfe('0x28')](function(_0x46f86e){if(_0x46f86e){return _0x46f86e[_0x2cfe('0x8a')](_0x54ae0e[_0x2cfe('0x38')]['ids'])['then'](function(){if(_[_0x2cfe('0x8b')](_0x54ae0e[_0x2cfe('0x38')]['ids'])){for(var _0x5d8418=0x0;_0x5d8418<_0x54ae0e[_0x2cfe('0x38')][_0x2cfe('0x6b')][_0x2cfe('0x4a')];_0x5d8418+=0x1){socket[_0x2cfe('0x73')](_0x2cfe('0x88'),{'UserId':Number(_0x54ae0e[_0x2cfe('0x38')][_0x2cfe('0x6b')][_0x5d8418]),'FaxQueueId':Number(_0x54ae0e['params']['id'])});}}else{socket['emit'](_0x2cfe('0x88'),{'UserId':Number(_0x54ae0e['query'][_0x2cfe('0x6b')]),'FaxQueueId':Number(_0x54ae0e[_0x2cfe('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x59e7ce,null))[_0x2cfe('0x47')](handleError(_0x59e7ce,null));};exports[_0x2cfe('0x8c')]=function(_0x3ebbf8,_0x22ddb1,_0x2051ae){var _0x2ea794={};var _0x5960db={};var _0x3fa961;var _0x5e71ae;return db[_0x2cfe('0x31')][_0x2cfe('0x59')]({'where':{'id':_0x3ebbf8[_0x2cfe('0x49')]['id']}})['then'](handleEntityNotFound(_0x22ddb1,null))[_0x2cfe('0x28')](function(_0x59fa16){if(_0x59fa16){_0x3fa961=_0x59fa16;_0x5960db[_0x2cfe('0x36')]=_[_0x2cfe('0x37')](db[_0x2cfe('0x60')][_0x2cfe('0x32')]);_0x5960db[_0x2cfe('0x38')]=_['keys'](_0x3ebbf8[_0x2cfe('0x38')]);_0x5960db[_0x2cfe('0x39')]=_['intersection'](_0x5960db[_0x2cfe('0x36')],_0x5960db[_0x2cfe('0x38')]);_0x2ea794['attributes']=_[_0x2cfe('0x3a')](_0x5960db[_0x2cfe('0x36')],qs[_0x2cfe('0x3c')](_0x3ebbf8['query'][_0x2cfe('0x3c')]));_0x2ea794[_0x2cfe('0x3b')]=_0x2ea794[_0x2cfe('0x3b')][_0x2cfe('0x4a')]?_0x2ea794[_0x2cfe('0x3b')]:_0x5960db[_0x2cfe('0x36')];_0x2ea794['order']=qs[_0x2cfe('0x3e')](_0x3ebbf8['query']['sort']);_0x2ea794[_0x2cfe('0x41')]=qs['filters'](_[_0x2cfe('0x5d')](_0x3ebbf8[_0x2cfe('0x38')],_0x5960db[_0x2cfe('0x39')]));if(_0x3ebbf8[_0x2cfe('0x38')][_0x2cfe('0x3f')]){_0x2ea794[_0x2cfe('0x41')]=_[_0x2cfe('0x40')](_0x2ea794['where'],{'$or':_[_0x2cfe('0x30')](_0x2ea794[_0x2cfe('0x3b')],function(_0x457d39){var _0x366c57={};_0x366c57[_0x457d39]={'$like':'%'+_0x3ebbf8[_0x2cfe('0x38')]['filter']+'%'};return _0x366c57;})});}_0x2ea794=_[_0x2cfe('0x40')]({},_0x2ea794,_0x3ebbf8[_0x2cfe('0x43')]);return _0x3fa961[_0x2cfe('0x8c')](_0x2ea794);}})[_0x2cfe('0x28')](function(_0x37615c){if(_0x37615c){_0x5e71ae=_0x37615c[_0x2cfe('0x4a')];if(!_0x3ebbf8[_0x2cfe('0x38')][_0x2cfe('0x5b')](_0x2cfe('0x3d'))){_0x2ea794[_0x2cfe('0x21')]=qs[_0x2cfe('0x21')](_0x3ebbf8[_0x2cfe('0x38')][_0x2cfe('0x21')]);_0x2ea794[_0x2cfe('0x23')]=qs[_0x2cfe('0x23')](_0x3ebbf8[_0x2cfe('0x38')][_0x2cfe('0x23')]);}return _0x3fa961[_0x2cfe('0x8c')](_0x2ea794);}})[_0x2cfe('0x28')](function(_0x6342b9){if(_0x6342b9){return _0x6342b9?{'count':_0x5e71ae,'rows':_0x6342b9}:null;}})[_0x2cfe('0x28')](respondWithResult(_0x22ddb1,null))[_0x2cfe('0x47')](handleError(_0x22ddb1,null));}; \ No newline at end of file +var _0xc2ff=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','online','interface','flatMap','transaction','each','findOrCreate','select','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','clone','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','emit','userFaxQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5127f7,_0x1efbe2){var _0xcb1d7d=function(_0x32cf16){while(--_0x32cf16){_0x5127f7['push'](_0x5127f7['shift']());}};_0xcb1d7d(++_0x1efbe2);}(_0xc2ff,0x114));var _0xfc2f=function(_0x23549d,_0x47d2d9){_0x23549d=_0x23549d-0x0;var _0x45312b=_0xc2ff[_0x23549d];return _0x45312b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc2f('0x0'));var zipdir=require(_0xfc2f('0x1'));var jsonpatch=require(_0xfc2f('0x2'));var rp=require(_0xfc2f('0x3'));var moment=require(_0xfc2f('0x4'));var BPromise=require(_0xfc2f('0x5'));var Mustache=require('mustache');var util=require(_0xfc2f('0x6'));var path=require(_0xfc2f('0x7'));var sox=require(_0xfc2f('0x8'));var csv=require(_0xfc2f('0x9'));var ejs=require(_0xfc2f('0xa'));var fs=require('fs');var fs_extra=require(_0xfc2f('0xb'));var _=require(_0xfc2f('0xc'));var squel=require('squel');var crypto=require(_0xfc2f('0xd'));var jsforce=require(_0xfc2f('0xe'));var deskjs=require(_0xfc2f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfc2f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc2f('0x11'));var authService=require(_0xfc2f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfc2f('0x13'));var hardwareService=require(_0xfc2f('0x14'));var logger=require('../../config/logger')(_0xfc2f('0x15'));var utils=require(_0xfc2f('0x16'));var config=require(_0xfc2f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfc2f('0x18'))['db'];config[_0xfc2f('0x19')]=_[_0xfc2f('0x1a')](config['redis'],{'host':_0xfc2f('0x1b'),'port':0x18eb});var socket=require(_0xfc2f('0x1c'))(new Redis(config[_0xfc2f('0x19')]));require(_0xfc2f('0x1d'))['register'](socket);function respondWithStatusCode(_0x5a2a93,_0x45f39d){_0x45f39d=_0x45f39d||0xcc;return function(_0xe25ab2){if(_0xe25ab2){return _0x5a2a93['sendStatus'](_0x45f39d);}return _0x5a2a93[_0xfc2f('0x1e')](_0x45f39d)[_0xfc2f('0x1f')]();};}function respondWithResult(_0x3d6702,_0x396f54){_0x396f54=_0x396f54||0xc8;return function(_0x59c854){if(_0x59c854){return _0x3d6702[_0xfc2f('0x1e')](_0x396f54)[_0xfc2f('0x20')](_0x59c854);}};}function respondWithFilteredResult(_0x20d165,_0x5b84e6){return function(_0x22ee8c){if(_0x22ee8c){var _0x9bca82=typeof _0x5b84e6[_0xfc2f('0x21')]==='undefined'&&typeof _0x5b84e6[_0xfc2f('0x22')]===_0xfc2f('0x23');var _0x5ca7d3=_0x22ee8c[_0xfc2f('0x24')];var _0x4f6bed=_0x9bca82?0x0:_0x5b84e6[_0xfc2f('0x21')];var _0x30ab3f=_0x9bca82?_0x22ee8c[_0xfc2f('0x24')]:_0x5b84e6[_0xfc2f('0x21')]+_0x5b84e6['limit'];var _0x4024b0;if(_0x30ab3f>=_0x5ca7d3){_0x30ab3f=_0x5ca7d3;_0x4024b0=0xc8;}else{_0x4024b0=0xce;}_0x20d165['status'](_0x4024b0);return _0x20d165[_0xfc2f('0x25')](_0xfc2f('0x26'),_0x4f6bed+'-'+_0x30ab3f+'/'+_0x5ca7d3)[_0xfc2f('0x20')](_0x22ee8c);}return null;};}function patchUpdates(_0x303b0d){return function(_0x5e253b){try{jsonpatch[_0xfc2f('0x27')](_0x5e253b,_0x303b0d,!![]);}catch(_0x2d440d){return BPromise[_0xfc2f('0x28')](_0x2d440d);}return _0x5e253b[_0xfc2f('0x29')]();};}function saveUpdates(_0xe21ec,_0x3e8484){return function(_0x213049){if(_0x213049){return _0x213049[_0xfc2f('0x2a')](_0xe21ec)[_0xfc2f('0x2b')](function(_0x945e39){return _0x945e39;});}return null;};}function removeEntity(_0x4a5b1d,_0x48060b){return function(_0x58bd97){if(_0x58bd97){return _0x58bd97[_0xfc2f('0x2c')]()['then'](function(){var _0x501cea=_0x58bd97[_0xfc2f('0x2d')]({'plain':!![]});var _0x129d21=_0xfc2f('0x2e');return db[_0xfc2f('0x2f')]['destroy']({'where':{'type':_0x129d21,'resourceId':_0x501cea['id']}})['then'](function(){return _0x58bd97;});})[_0xfc2f('0x2b')](function(){_0x4a5b1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2795,_0x279ad3){return function(_0x1f31c8){if(!_0x1f31c8){_0x1b2795[_0xfc2f('0x30')](0x194);}return _0x1f31c8;};}function handleError(_0x484692,_0x366694){_0x366694=_0x366694||0x1f4;return function(_0x3e733b){logger['error'](_0x3e733b[_0xfc2f('0x31')]);if(_0x3e733b['name']){delete _0x3e733b[_0xfc2f('0x32')];}_0x484692['status'](_0x366694)[_0xfc2f('0x33')](_0x3e733b);};}exports[_0xfc2f('0x34')]=function(_0x4bf373,_0xbd0014){var _0x49f275={},_0x5c47d4={},_0x2dc18a={'count':0x0,'rows':[]};var _0x3c03b1=_[_0xfc2f('0x35')](db[_0xfc2f('0x36')][_0xfc2f('0x37')],function(_0x452da1){return{'name':_0x452da1[_0xfc2f('0x38')],'type':_0x452da1[_0xfc2f('0x39')][_0xfc2f('0x3a')]};});_0x5c47d4[_0xfc2f('0x3b')]=_['map'](_0x3c03b1,'name');_0x5c47d4['query']=_[_0xfc2f('0x3c')](_0x4bf373[_0xfc2f('0x3d')]);_0x5c47d4['filters']=_[_0xfc2f('0x3e')](_0x5c47d4['model'],_0x5c47d4[_0xfc2f('0x3d')]);_0x49f275['attributes']=_[_0xfc2f('0x3e')](_0x5c47d4['model'],qs[_0xfc2f('0x3f')](_0x4bf373[_0xfc2f('0x3d')][_0xfc2f('0x3f')]));_0x49f275[_0xfc2f('0x40')]=_0x49f275[_0xfc2f('0x40')]['length']?_0x49f275[_0xfc2f('0x40')]:_0x5c47d4['model'];if(!_0x4bf373['query'][_0xfc2f('0x41')](_0xfc2f('0x42'))){_0x49f275[_0xfc2f('0x22')]=qs[_0xfc2f('0x22')](_0x4bf373['query'][_0xfc2f('0x22')]);_0x49f275['offset']=qs[_0xfc2f('0x21')](_0x4bf373[_0xfc2f('0x3d')][_0xfc2f('0x21')]);}_0x49f275[_0xfc2f('0x43')]=qs[_0xfc2f('0x44')](_0x4bf373[_0xfc2f('0x3d')][_0xfc2f('0x44')]);_0x49f275[_0xfc2f('0x45')]=qs[_0xfc2f('0x46')](_[_0xfc2f('0x47')](_0x4bf373[_0xfc2f('0x3d')],_0x5c47d4[_0xfc2f('0x46')]),_0x3c03b1);if(_0x4bf373['query'][_0xfc2f('0x48')]){_0x49f275[_0xfc2f('0x45')]=_['merge'](_0x49f275[_0xfc2f('0x45')],{'$or':_[_0xfc2f('0x35')](_0x3c03b1,function(_0x531fba){if(_0x531fba['type']!=='VIRTUAL'){var _0x1fdd58={};_0x1fdd58[_0x531fba[_0xfc2f('0x32')]]={'$like':'%'+_0x4bf373[_0xfc2f('0x3d')][_0xfc2f('0x48')]+'%'};return _0x1fdd58;}})});}_0x49f275=_['merge']({},_0x49f275,_0x4bf373[_0xfc2f('0x49')]);var _0x31b20a={'where':_0x49f275[_0xfc2f('0x45')]};return db['FaxQueue'][_0xfc2f('0x24')](_0x31b20a)[_0xfc2f('0x2b')](function(_0x3407be){_0x2dc18a[_0xfc2f('0x24')]=_0x3407be;if(_0x4bf373[_0xfc2f('0x3d')][_0xfc2f('0x4a')]){_0x49f275[_0xfc2f('0x4b')]=[{'all':!![]}];}return db['FaxQueue'][_0xfc2f('0x4c')](_0x49f275);})['then'](function(_0x30f98b){_0x2dc18a[_0xfc2f('0x4d')]=_0x30f98b;return _0x2dc18a;})[_0xfc2f('0x2b')](respondWithFilteredResult(_0xbd0014,_0x49f275))[_0xfc2f('0x4e')](handleError(_0xbd0014,null));};exports[_0xfc2f('0x4f')]=function(_0x2fe884,_0x353572){var _0xca5897={'raw':!![],'where':{'id':_0x2fe884[_0xfc2f('0x50')]['id']}},_0x198d67={};_0x198d67[_0xfc2f('0x3b')]=_[_0xfc2f('0x3c')](db['FaxQueue'][_0xfc2f('0x37')]);_0x198d67[_0xfc2f('0x3d')]=_[_0xfc2f('0x3c')](_0x2fe884[_0xfc2f('0x3d')]);_0x198d67[_0xfc2f('0x46')]=_['intersection'](_0x198d67[_0xfc2f('0x3b')],_0x198d67['query']);_0xca5897[_0xfc2f('0x40')]=_[_0xfc2f('0x3e')](_0x198d67[_0xfc2f('0x3b')],qs['fields'](_0x2fe884[_0xfc2f('0x3d')][_0xfc2f('0x3f')]));_0xca5897[_0xfc2f('0x40')]=_0xca5897['attributes'][_0xfc2f('0x51')]?_0xca5897[_0xfc2f('0x40')]:_0x198d67[_0xfc2f('0x3b')];if(_0x2fe884[_0xfc2f('0x3d')][_0xfc2f('0x4a')]){_0xca5897[_0xfc2f('0x4b')]=[{'all':!![]}];}_0xca5897=_[_0xfc2f('0x52')]({},_0xca5897,_0x2fe884[_0xfc2f('0x49')]);return db['FaxQueue'][_0xfc2f('0x53')](_0xca5897)[_0xfc2f('0x2b')](handleEntityNotFound(_0x353572,null))[_0xfc2f('0x2b')](respondWithResult(_0x353572,null))[_0xfc2f('0x4e')](handleError(_0x353572,null));};exports['create']=function(_0x38e4ba,_0x521326){return db[_0xfc2f('0x36')][_0xfc2f('0x54')](_0x38e4ba['body'],{})[_0xfc2f('0x2b')](function(_0x45120c){var _0x42e179=_0x38e4ba[_0xfc2f('0x55')][_0xfc2f('0x2d')]({'plain':!![]});if(!_0x42e179)throw new Error(_0xfc2f('0x56'));if(_0x42e179['role']===_0xfc2f('0x55')){var _0x973bf8=_0x45120c[_0xfc2f('0x2d')]({'plain':!![]});var _0x396420=_0xfc2f('0x2e');return db[_0xfc2f('0x57')]['find']({'where':{'name':_0x396420,'userProfileId':_0x42e179[_0xfc2f('0x58')]},'raw':!![]})[_0xfc2f('0x2b')](function(_0x3a7d98){if(_0x3a7d98&&_0x3a7d98['autoAssociation']===0x0){return db[_0xfc2f('0x2f')][_0xfc2f('0x54')]({'name':_0x973bf8[_0xfc2f('0x32')],'resourceId':_0x973bf8['id'],'type':_0x3a7d98[_0xfc2f('0x32')],'sectionId':_0x3a7d98['id']},{})[_0xfc2f('0x2b')](function(){return _0x45120c;});}else{return _0x45120c;}})[_0xfc2f('0x4e')](function(_0x306ac8){logger[_0xfc2f('0x59')](_0xfc2f('0x5a'),_0x306ac8);throw _0x306ac8;});}return _0x45120c;})[_0xfc2f('0x2b')](respondWithResult(_0x521326,0xc9))['catch'](handleError(_0x521326,null));};exports[_0xfc2f('0x2a')]=function(_0x16e6e9,_0xe406ab){if(_0x16e6e9[_0xfc2f('0x5b')]['id']){delete _0x16e6e9[_0xfc2f('0x5b')]['id'];}return db[_0xfc2f('0x36')][_0xfc2f('0x53')]({'where':{'id':_0x16e6e9['params']['id']}})[_0xfc2f('0x2b')](handleEntityNotFound(_0xe406ab,null))[_0xfc2f('0x2b')](saveUpdates(_0x16e6e9[_0xfc2f('0x5b')],null))[_0xfc2f('0x2b')](respondWithResult(_0xe406ab,null))[_0xfc2f('0x4e')](handleError(_0xe406ab,null));};exports[_0xfc2f('0x2c')]=function(_0x3e5874,_0x4f94b9){return db['FaxQueue'][_0xfc2f('0x53')]({'where':{'id':_0x3e5874[_0xfc2f('0x50')]['id']}})[_0xfc2f('0x2b')](handleEntityNotFound(_0x4f94b9,null))[_0xfc2f('0x2b')](removeEntity(_0x4f94b9,null))['catch'](handleError(_0x4f94b9,null));};exports[_0xfc2f('0x5c')]=function(_0x477a2a,_0x53b272){return db['FaxQueue'][_0xfc2f('0x5c')]()['then'](respondWithResult(_0x53b272,null))['catch'](handleError(_0x53b272,null));};exports[_0xfc2f('0x5d')]=function(_0x30ecc0,_0x3bca35,_0xeb8737){var _0x3c9b76={'raw':!![],'where':{}},_0x3af9a1={},_0x3a3213;return db[_0xfc2f('0x36')][_0xfc2f('0x5e')]({'where':{'id':_0x30ecc0[_0xfc2f('0x50')]['id']}})[_0xfc2f('0x2b')](handleEntityNotFound(_0x3bca35,null))['then'](function(_0x25351a){if(_0x25351a){_0x3a3213=_0x25351a[_0xfc2f('0x2d')]({'plain':!![]});_0x3af9a1[_0xfc2f('0x3b')]=_['keys'](db['UserFaxQueue'][_0xfc2f('0x37')]);_0x3af9a1[_0xfc2f('0x3d')]=_[_0xfc2f('0x3c')](_0x30ecc0[_0xfc2f('0x3d')]);_0x3af9a1[_0xfc2f('0x46')]=_[_0xfc2f('0x3e')](_0x3af9a1[_0xfc2f('0x3b')],_0x3af9a1[_0xfc2f('0x3d')]);_0x3c9b76[_0xfc2f('0x40')]=_[_0xfc2f('0x3e')](_0x3af9a1[_0xfc2f('0x3b')],qs[_0xfc2f('0x3f')](_0x30ecc0[_0xfc2f('0x3d')]['fields']));_0x3c9b76[_0xfc2f('0x40')]=_0x3c9b76[_0xfc2f('0x40')]['length']?_0x3c9b76[_0xfc2f('0x40')]:_0x3af9a1[_0xfc2f('0x3b')];if(!_0x30ecc0['query'][_0xfc2f('0x41')]('nolimit')){_0x3c9b76['limit']=qs[_0xfc2f('0x22')](_0x30ecc0[_0xfc2f('0x3d')][_0xfc2f('0x22')]);_0x3c9b76[_0xfc2f('0x21')]=qs[_0xfc2f('0x21')](_0x30ecc0[_0xfc2f('0x3d')][_0xfc2f('0x21')]);}_0x3c9b76['order']=qs['sort'](_0x30ecc0[_0xfc2f('0x3d')][_0xfc2f('0x44')]);_0x3c9b76[_0xfc2f('0x45')]=qs[_0xfc2f('0x46')](_['pick'](_0x30ecc0[_0xfc2f('0x3d')],_0x3af9a1[_0xfc2f('0x46')]));_0x3c9b76[_0xfc2f('0x45')]['FaxQueueId']=_0x25351a['id'];if(_0x30ecc0[_0xfc2f('0x3d')][_0xfc2f('0x48')]){_0x3c9b76[_0xfc2f('0x45')]=_[_0xfc2f('0x52')](_0x3c9b76['where'],{'$or':_[_0xfc2f('0x35')](_0x3c9b76[_0xfc2f('0x40')],function(_0x87c654){var _0x5cf7d8={};_0x5cf7d8[_0x87c654]={'$like':'%'+_0x30ecc0['query']['filter']+'%'};return _0x5cf7d8;})});}_0x3c9b76=_[_0xfc2f('0x52')]({},_0x3c9b76,_0x30ecc0[_0xfc2f('0x49')]);return db[_0xfc2f('0x5f')]['findAll'](_0x3c9b76);}})['then'](function(_0x3c2d0a){if(_0x3c2d0a){return db[_0xfc2f('0x60')][_0xfc2f('0x61')]({'where':{'id':_[_0xfc2f('0x35')](_0x3c2d0a,_0xfc2f('0x62')),'role':'agent'},'attributes':['id',_0xfc2f('0x32'),_0xfc2f('0x63'),'updatedAt',_0xfc2f('0x64')]});}})[_0xfc2f('0x2b')](function(_0x10ae17){if(_0x10ae17){return{'count':_0x10ae17[_0xfc2f('0x24')],'rows':_['map'](_0x10ae17['rows'],function(_0x5154dd){return{'membername':_0x5154dd[_0xfc2f('0x32')],'UserId':_0x5154dd['id'],'queue_name':_0x3a3213[_0xfc2f('0x32')],'FaxQueueId':_0x3a3213['id'],'interface':util[_0xfc2f('0x65')](_0xfc2f('0x66'),_0xfc2f('0x67'),_0x5154dd[_0xfc2f('0x32')]),'penalty':0x0,'paused':_0x5154dd[_0xfc2f('0x63')],'createdAt':_0x5154dd[_0xfc2f('0x64')],'updatedAt':_0x5154dd[_0xfc2f('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfc2f('0x2b')](respondWithFilteredResult(_0x3bca35,_0x3c9b76))['catch'](handleError(_0x3bca35,null));};exports['getTeams']=function(_0x12a563,_0x40a9d1,_0xdfd7d4){var _0x217473={};var _0x3c1ceb={};var _0x3c873f;var _0x1c35a5;return db['FaxQueue']['findOne']({'where':{'id':_0x12a563[_0xfc2f('0x50')]['id']}})['then'](handleEntityNotFound(_0x40a9d1,null))['then'](function(_0x5b7227){if(_0x5b7227){_0x3c873f=_0x5b7227;_0x3c1ceb[_0xfc2f('0x3b')]=_[_0xfc2f('0x3c')](db[_0xfc2f('0x69')][_0xfc2f('0x37')]);_0x3c1ceb['query']=_[_0xfc2f('0x3c')](_0x12a563[_0xfc2f('0x3d')]);_0x3c1ceb[_0xfc2f('0x46')]=_[_0xfc2f('0x3e')](_0x3c1ceb['model'],_0x3c1ceb[_0xfc2f('0x3d')]);_0x217473[_0xfc2f('0x40')]=_[_0xfc2f('0x3e')](_0x3c1ceb[_0xfc2f('0x3b')],qs[_0xfc2f('0x3f')](_0x12a563[_0xfc2f('0x3d')][_0xfc2f('0x3f')]));_0x217473[_0xfc2f('0x40')]=_0x217473[_0xfc2f('0x40')][_0xfc2f('0x51')]?_0x217473[_0xfc2f('0x40')]:_0x3c1ceb[_0xfc2f('0x3b')];_0x217473['order']=qs[_0xfc2f('0x44')](_0x12a563[_0xfc2f('0x3d')]['sort']);_0x217473['where']=qs[_0xfc2f('0x46')](_[_0xfc2f('0x47')](_0x12a563['query'],_0x3c1ceb[_0xfc2f('0x46')]));if(_0x12a563['query'][_0xfc2f('0x48')]){_0x217473['where']=_[_0xfc2f('0x52')](_0x217473[_0xfc2f('0x45')],{'$or':_[_0xfc2f('0x35')](_0x217473[_0xfc2f('0x40')],function(_0xb704ab){var _0x76d1b2={};_0x76d1b2[_0xb704ab]={'$like':'%'+_0x12a563[_0xfc2f('0x3d')][_0xfc2f('0x48')]+'%'};return _0x76d1b2;})});}_0x217473=_[_0xfc2f('0x52')]({},_0x217473,_0x12a563[_0xfc2f('0x49')]);return _0x3c873f[_0xfc2f('0x6a')](_0x217473);}})[_0xfc2f('0x2b')](function(_0x551ba1){if(_0x551ba1){_0x1c35a5=_0x551ba1[_0xfc2f('0x51')];if(!_0x12a563[_0xfc2f('0x3d')]['hasOwnProperty'](_0xfc2f('0x42'))){_0x217473['limit']=qs[_0xfc2f('0x22')](_0x12a563[_0xfc2f('0x3d')]['limit']);_0x217473[_0xfc2f('0x21')]=qs['offset'](_0x12a563[_0xfc2f('0x3d')][_0xfc2f('0x21')]);}return _0x3c873f[_0xfc2f('0x6a')](_0x217473);}})[_0xfc2f('0x2b')](function(_0x4397b2){if(_0x4397b2){return _0x4397b2?{'count':_0x1c35a5,'rows':_0x4397b2}:null;}})[_0xfc2f('0x2b')](respondWithResult(_0x40a9d1,null))[_0xfc2f('0x4e')](handleError(_0x40a9d1,null));};exports[_0xfc2f('0x6b')]=function(_0x53e8e4,_0x3bad44,_0x347085){var _0xa62e02=_0x53e8e4['body'][_0xfc2f('0x6c')];return db['Team'][_0xfc2f('0x4c')]({'where':{'id':_0xa62e02},'attributes':['id'],'include':[{'model':db[_0xfc2f('0x60')],'as':'Agents','attributes':['id',_0xfc2f('0x32'),_0xfc2f('0x6d'),'voicePause',_0xfc2f('0x6e')],'raw':!![]}]})[_0xfc2f('0x2b')](function(_0x471edc){if(_0x471edc){var _0x3fda5b=_[_0xfc2f('0x6f')](_0x471edc,function(_0x3cecf2){var _0x2a5d67=_0x3cecf2['get']({'plain':!![]});return _0x2a5d67['Agents'];});return db['FaxQueue'][_0xfc2f('0x53')]({'where':{'id':_0x53e8e4[_0xfc2f('0x50')]['id']}})[_0xfc2f('0x2b')](function(_0x202491){return db['sequelize'][_0xfc2f('0x70')](function(_0x52e9f4){return _0x202491['addTeams'](_0xa62e02,{'transaction':_0x52e9f4})['then'](function(){return BPromise[_0xfc2f('0x71')](_0x3fda5b,function(_0x48e776){return db[_0xfc2f('0x5f')][_0xfc2f('0x72')]({'where':{'UserId':_0x48e776['id'],'FaxQueueId':_0x53e8e4['params']['id']},'transaction':_0x52e9f4});});})[_0xfc2f('0x2b')](function(){_0x3fda5b['forEach'](function(_0xe123e){socket['emit']('userFaxQueue:save',{'UserId':_0xe123e['id'],'FaxQueueId':_0x202491['id']});});});});});}})[_0xfc2f('0x2b')](respondWithStatusCode(_0x3bad44,null))[_0xfc2f('0x4e')](handleError(_0x3bad44,null));};exports['removeTeams']=function(_0x489c65,_0x3897fd,_0x42f6ee){return db[_0xfc2f('0x69')][_0xfc2f('0x4c')]({'where':{'id':_0x489c65[_0xfc2f('0x3d')][_0xfc2f('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3897fd,null))[_0xfc2f('0x2b')](function(_0x2a89ec){var _0x51b4fe=_[_0xfc2f('0x35')](_0x2a89ec,'id');var _0x316864=[];var _0x2fbb09=[];var _0x525c14=squel[_0xfc2f('0x73')]();_0x525c14['field'](_0xfc2f('0x74'))[_0xfc2f('0x75')](_0xfc2f('0x76'),'tq')[_0xfc2f('0x77')]('user_has_teams','ut',_0xfc2f('0x78'))[_0xfc2f('0x45')](_0xfc2f('0x79'),_0x489c65[_0xfc2f('0x50')]['id']);for(var _0x33b65c=0x0;_0x33b65c<_0x2a89ec[_0xfc2f('0x51')];_0x33b65c+=0x1){let _0x1b681a=_0x2a89ec[_0x33b65c];for(var _0x238bb2=0x0;_0x238bb2<_0x1b681a['Agents'][_0xfc2f('0x51')];_0x238bb2+=0x1){let _0x16b7f6=_0x1b681a[_0xfc2f('0x7a')][_0x238bb2];var _0x573d62=_0x525c14[_0xfc2f('0x7b')]();_0x573d62[_0xfc2f('0x45')]('ut.UserId\x20=\x20?',_0x16b7f6['id']);_0x2fbb09['push'](db[_0xfc2f('0x7c')][_0xfc2f('0x3d')](_0x573d62[_0xfc2f('0x7d')](),{'type':db[_0xfc2f('0x7c')]['QueryTypes'][_0xfc2f('0x7e')]})[_0xfc2f('0x2b')](function(_0x389a70){if(_0x389a70[_0xfc2f('0x51')]===0x1){return _0x16b7f6['id'];}else{var _0x4fa26c=_[_0xfc2f('0x7f')](_[_0xfc2f('0x35')](_0x389a70,_0xfc2f('0x80')),function(_0x3f3193){return _[_0xfc2f('0x81')](_0x51b4fe,_0x3f3193);});if(_0x4fa26c){return _0x16b7f6['id'];}}}));}}return BPromise[_0xfc2f('0x82')](_0x2fbb09)['then'](function(_0x3e261c){_0x316864=_(_0x316864)['union'](_0x3e261c)[_0xfc2f('0x83')]()[_0xfc2f('0x84')]();return db[_0xfc2f('0x36')][_0xfc2f('0x53')]({'where':{'id':_0x489c65['params']['id']}})['then'](function(_0xdfd959){return db[_0xfc2f('0x7c')][_0xfc2f('0x70')](function(_0x55bc11){return _0xdfd959['removeTeams'](_0x489c65[_0xfc2f('0x3d')][_0xfc2f('0x6c')],{'transaction':_0x55bc11})[_0xfc2f('0x2b')](function(){if(!_[_0xfc2f('0x85')](_0x316864)){return _0xdfd959['removeAgents'](_0x316864,{'transaction':_0x55bc11});}})[_0xfc2f('0x2b')](function(){_0x316864[_0xfc2f('0x86')](function(_0x3d0d79){socket['emit'](_0xfc2f('0x87'),{'UserId':_0x3d0d79,'FaxQueueId':_0xdfd959['id']});});});});});});})[_0xfc2f('0x2b')](respondWithStatusCode(_0x3897fd,null))['catch'](handleError(_0x3897fd,null));};exports[_0xfc2f('0x88')]=function(_0x38172e,_0x2ebbb7,_0x3fc28e){return db['FaxQueue']['find']({'where':{'id':_0x38172e[_0xfc2f('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ebbb7,null))[_0xfc2f('0x2b')](function(_0x363b5a){if(_0x363b5a){return _0x363b5a['addAgents'](_0x38172e[_0xfc2f('0x5b')]['ids'],_[_0xfc2f('0x89')](_0x38172e['body'],['ids','id'])||{})[_0xfc2f('0x8a')](function(_0x59fffd){for(var _0x44d3d5=0x0;_0x44d3d5<_0x38172e[_0xfc2f('0x5b')][_0xfc2f('0x6c')][_0xfc2f('0x51')];_0x44d3d5+=0x1){socket[_0xfc2f('0x8b')](_0xfc2f('0x8c'),{'UserId':Number(_0x38172e[_0xfc2f('0x5b')]['ids'][_0x44d3d5]),'FaxQueueId':Number(_0x38172e['params']['id'])});}return _0x59fffd;});}})[_0xfc2f('0x2b')](respondWithResult(_0x2ebbb7,null))[_0xfc2f('0x4e')](handleError(_0x2ebbb7,null));};exports[_0xfc2f('0x8d')]=function(_0x39025f,_0x5cd932,_0x4ee592){return db['FaxQueue'][_0xfc2f('0x53')]({'where':{'id':_0x39025f['params']['id']}})['then'](handleEntityNotFound(_0x5cd932,null))['then'](function(_0x27c5b5){if(_0x27c5b5){return _0x27c5b5[_0xfc2f('0x8d')](_0x39025f['query'][_0xfc2f('0x6c')])['then'](function(){if(_[_0xfc2f('0x8e')](_0x39025f['query']['ids'])){for(var _0x9e6c=0x0;_0x9e6c<_0x39025f[_0xfc2f('0x3d')][_0xfc2f('0x6c')][_0xfc2f('0x51')];_0x9e6c+=0x1){socket['emit'](_0xfc2f('0x87'),{'UserId':Number(_0x39025f[_0xfc2f('0x3d')][_0xfc2f('0x6c')][_0x9e6c]),'FaxQueueId':Number(_0x39025f[_0xfc2f('0x50')]['id'])});}}else{socket[_0xfc2f('0x8b')]('userFaxQueue:remove',{'UserId':Number(_0x39025f[_0xfc2f('0x3d')]['ids']),'FaxQueueId':Number(_0x39025f['params']['id'])});}});}})[_0xfc2f('0x2b')](respondWithStatusCode(_0x5cd932,null))[_0xfc2f('0x4e')](handleError(_0x5cd932,null));};exports[_0xfc2f('0x8f')]=function(_0x923b87,_0x4496ed,_0x1e0248){var _0x45e57f={};var _0x1a7d7c={};var _0x496a54;var _0x54c27a;return db[_0xfc2f('0x36')][_0xfc2f('0x5e')]({'where':{'id':_0x923b87['params']['id']}})['then'](handleEntityNotFound(_0x4496ed,null))[_0xfc2f('0x2b')](function(_0x4e7d75){if(_0x4e7d75){_0x496a54=_0x4e7d75;_0x1a7d7c['model']=_[_0xfc2f('0x3c')](db[_0xfc2f('0x60')][_0xfc2f('0x37')]);_0x1a7d7c[_0xfc2f('0x3d')]=_['keys'](_0x923b87['query']);_0x1a7d7c[_0xfc2f('0x46')]=_[_0xfc2f('0x3e')](_0x1a7d7c['model'],_0x1a7d7c[_0xfc2f('0x3d')]);_0x45e57f[_0xfc2f('0x40')]=_[_0xfc2f('0x3e')](_0x1a7d7c[_0xfc2f('0x3b')],qs[_0xfc2f('0x3f')](_0x923b87['query'][_0xfc2f('0x3f')]));_0x45e57f[_0xfc2f('0x40')]=_0x45e57f['attributes'][_0xfc2f('0x51')]?_0x45e57f[_0xfc2f('0x40')]:_0x1a7d7c[_0xfc2f('0x3b')];_0x45e57f[_0xfc2f('0x43')]=qs['sort'](_0x923b87[_0xfc2f('0x3d')][_0xfc2f('0x44')]);_0x45e57f['where']=qs[_0xfc2f('0x46')](_['pick'](_0x923b87['query'],_0x1a7d7c[_0xfc2f('0x46')]));if(_0x923b87[_0xfc2f('0x3d')][_0xfc2f('0x48')]){_0x45e57f[_0xfc2f('0x45')]=_[_0xfc2f('0x52')](_0x45e57f[_0xfc2f('0x45')],{'$or':_[_0xfc2f('0x35')](_0x45e57f['attributes'],function(_0x3a9a2f){var _0x7ede2c={};_0x7ede2c[_0x3a9a2f]={'$like':'%'+_0x923b87[_0xfc2f('0x3d')]['filter']+'%'};return _0x7ede2c;})});}_0x45e57f=_[_0xfc2f('0x52')]({},_0x45e57f,_0x923b87[_0xfc2f('0x49')]);return _0x496a54[_0xfc2f('0x8f')](_0x45e57f);}})['then'](function(_0x25800d){if(_0x25800d){_0x54c27a=_0x25800d[_0xfc2f('0x51')];if(!_0x923b87[_0xfc2f('0x3d')][_0xfc2f('0x41')](_0xfc2f('0x42'))){_0x45e57f[_0xfc2f('0x22')]=qs[_0xfc2f('0x22')](_0x923b87[_0xfc2f('0x3d')][_0xfc2f('0x22')]);_0x45e57f[_0xfc2f('0x21')]=qs[_0xfc2f('0x21')](_0x923b87[_0xfc2f('0x3d')][_0xfc2f('0x21')]);}return _0x496a54[_0xfc2f('0x8f')](_0x45e57f);}})[_0xfc2f('0x2b')](function(_0x27f9f5){if(_0x27f9f5){return _0x27f9f5?{'count':_0x54c27a,'rows':_0x27f9f5}:null;}})['then'](respondWithResult(_0x4496ed,null))['catch'](handleError(_0x4496ed,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d437725..4193382 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 _0xa680=['emit','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x3c4eba,_0x435bda){var _0x4f03ee=function(_0x4a637e){while(--_0x4a637e){_0x3c4eba['push'](_0x3c4eba['shift']());}};_0x4f03ee(++_0x435bda);}(_0xa680,0x12f));var _0x0a68=function(_0x2e9333,_0x105c29){_0x2e9333=_0x2e9333-0x0;var _0x214a6f=_0xa680[_0x2e9333];return _0x214a6f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x0a68('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0a68('0x1')](0x0);var events={'afterCreate':_0x0a68('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x9f7f21){return function(_0xe5aa11,_0x6f13f7,_0xdb9b63){FaxQueueEvents[_0x0a68('0x3')](_0x9f7f21+':'+_0xe5aa11['id'],_0xe5aa11);FaxQueueEvents[_0x0a68('0x3')](_0x9f7f21,_0xe5aa11);_0xdb9b63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x0a68('0x4')](e,emitEvent(event));}}module[_0x0a68('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0x6d8b=['events','../../mysqldb','remove','emit','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d8b,0xd9));var _0xb6d8=function(_0x2e2881,_0x30f68e){_0x2e2881=_0x2e2881-0x0;var _0x433217=_0x6d8b[_0x2e2881];return _0x433217;};'use strict';var EventEmitter=require(_0xb6d8('0x0'));var FaxQueue=require(_0xb6d8('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb6d8('0x2')};function emitEvent(_0x1cb61a){return function(_0x46dc2a,_0x19a5a9,_0x8b45ee){FaxQueueEvents['emit'](_0x1cb61a+':'+_0x46dc2a['id'],_0x46dc2a);FaxQueueEvents[_0xb6d8('0x3')](_0x1cb61a,_0x46dc2a);_0x8b45ee(null);};}for(var e in events){if(events[_0xb6d8('0x4')](e)){var event=events[e];FaxQueue[_0xb6d8('0x5')](e,emitEvent(event));}}module[_0xb6d8('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 35ba420..85e157a 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 _0x168e=['exports','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x98ee5b,_0x5d5749){var _0x202e40=function(_0x517762){while(--_0x517762){_0x98ee5b['push'](_0x98ee5b['shift']());}};_0x202e40(++_0x5d5749);}(_0x168e,0x85));var _0xe168=function(_0x2c3e7d,_0x5cb6bd){_0x2c3e7d=_0x2c3e7d-0x0;var _0x51f283=_0x168e[_0x2c3e7d];return _0x51f283;};'use strict';var _=require(_0xe168('0x0'));var util=require(_0xe168('0x1'));var logger=require(_0xe168('0x2'))('api');var moment=require(_0xe168('0x3'));var BPromise=require(_0xe168('0x4'));var rp=require(_0xe168('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe168('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xe168('0x7')]=function(_0x352f8f,_0x698704){return _0x352f8f['define'](_0xe168('0x8'),attributes,{'tableName':_0xe168('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x236b=['util','moment','request-promise','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x51574f,_0x25ca32){var _0x3c699e=function(_0xe8c4aa){while(--_0xe8c4aa){_0x51574f['push'](_0x51574f['shift']());}};_0x3c699e(++_0x25ca32);}(_0x236b,0x190));var _0xb236=function(_0x53b971,_0x353828){_0x53b971=_0x53b971-0x0;var _0x1f1c4d=_0x236b[_0x53b971];return _0x1f1c4d;};'use strict';var _=require('lodash');var util=require(_0xb236('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb236('0x1'));var BPromise=require('bluebird');var rp=require(_0xb236('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb236('0x3'));module[_0xb236('0x4')]=function(_0x3621bd,_0x4bc7c3){return _0x3621bd[_0xb236('0x5')](_0xb236('0x6'),attributes,{'tableName':_0xb236('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 324684a..753eb55 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 _0xe730=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','map','model','attributes','ShowFaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe730,0xbc));var _0x0e73=function(_0x58375b,_0x14059a){_0x58375b=_0x58375b-0x0;var _0x12ddb1=_0xe730[_0x58375b];return _0x12ddb1;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var moment=require('moment');var BPromise=require(_0x0e73('0x2'));var rs=require(_0x0e73('0x3'));var fs=require('fs');var Redis=require(_0x0e73('0x4'));var db=require(_0x0e73('0x5'))['db'];var utils=require(_0x0e73('0x6'));var logger=require(_0x0e73('0x7'))(_0x0e73('0x8'));var config=require(_0x0e73('0x9'));var jayson=require(_0x0e73('0xa'));var client=jayson[_0x0e73('0xb')][_0x0e73('0xc')]({'port':0x232a});config['redis']=_[_0x0e73('0xd')](config[_0x0e73('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e73('0xf'))(new Redis(config[_0x0e73('0xe')]));require(_0x0e73('0x10'))[_0x0e73('0x11')](socket);function respondWithRpcPromise(_0x4432a5,_0x5edc1b,_0x5cb3b4){return new BPromise(function(_0x560523,_0x330df1){return client[_0x0e73('0x12')](_0x4432a5,_0x5cb3b4)[_0x0e73('0x13')](function(_0x5883eb){logger[_0x0e73('0x14')]('FaxQueue,\x20%s,\x20%s',_0x5edc1b,_0x0e73('0x15'));logger[_0x0e73('0x16')](_0x0e73('0x17'),_0x5edc1b,_0x0e73('0x15'),JSON[_0x0e73('0x18')](_0x5883eb));if(_0x5883eb[_0x0e73('0x19')]){if(_0x5883eb[_0x0e73('0x19')][_0x0e73('0x1a')]===0x1f4){logger[_0x0e73('0x19')](_0x0e73('0x1b'),_0x5edc1b,_0x5883eb[_0x0e73('0x19')][_0x0e73('0x1c')]);return _0x330df1(_0x5883eb[_0x0e73('0x19')][_0x0e73('0x1c')]);}logger['error'](_0x0e73('0x1b'),_0x5edc1b,_0x5883eb[_0x0e73('0x19')][_0x0e73('0x1c')]);return _0x560523(_0x5883eb[_0x0e73('0x19')][_0x0e73('0x1c')]);}else{logger[_0x0e73('0x14')](_0x0e73('0x1b'),_0x5edc1b,_0x0e73('0x15'));_0x560523(_0x5883eb[_0x0e73('0x1d')][_0x0e73('0x1c')]);}})[_0x0e73('0x1e')](function(_0x351d46){logger[_0x0e73('0x19')](_0x0e73('0x1b'),_0x5edc1b,_0x351d46);_0x330df1(_0x351d46);});});}exports[_0x0e73('0x1f')]=function(_0x1490c4){var _0x5334fa=this;return new Promise(function(_0x22f95f,_0x1e3bb0){return db[_0x0e73('0x20')]['findAll']({'raw':_0x1490c4[_0x0e73('0x21')]?_0x1490c4['options'][_0x0e73('0x22')]===undefined?!![]:![]:!![],'where':_0x1490c4[_0x0e73('0x21')]?_0x1490c4['options'][_0x0e73('0x23')]||null:null,'attributes':_0x1490c4[_0x0e73('0x21')]?_0x1490c4[_0x0e73('0x21')]['attributes']||null:null,'limit':_0x1490c4[_0x0e73('0x21')]?_0x1490c4[_0x0e73('0x21')][_0x0e73('0x24')]||null:null,'include':_0x1490c4['options']?_0x1490c4['options'][_0x0e73('0x25')]?_[_0x0e73('0x26')](_0x1490c4['options']['include'],function(_0x17be8a){return{'model':db[_0x17be8a[_0x0e73('0x27')]],'as':_0x17be8a['as'],'attributes':_0x17be8a[_0x0e73('0x28')],'include':_0x17be8a[_0x0e73('0x25')]?_['map'](_0x17be8a['include'],function(_0x398ccf){return{'model':db[_0x398ccf[_0x0e73('0x27')]],'as':_0x398ccf['as'],'attributes':_0x398ccf[_0x0e73('0x28')],'include':_0x398ccf[_0x0e73('0x25')]?_[_0x0e73('0x26')](_0x398ccf[_0x0e73('0x25')],function(_0x4fb39d){return{'model':db[_0x4fb39d[_0x0e73('0x27')]],'as':_0x4fb39d['as'],'attributes':_0x4fb39d[_0x0e73('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59ed14){logger[_0x0e73('0x14')](_0x0e73('0x1f'),_0x1490c4);logger[_0x0e73('0x16')](_0x0e73('0x1f'),_0x1490c4,JSON[_0x0e73('0x18')](_0x59ed14));_0x22f95f(_0x59ed14);})[_0x0e73('0x1e')](function(_0x322ae5){logger[_0x0e73('0x19')](_0x0e73('0x1f'),_0x322ae5[_0x0e73('0x1c')],_0x1490c4);_0x1e3bb0(_0x5334fa['error'](0x1f4,_0x322ae5[_0x0e73('0x1c')]));});});};exports[_0x0e73('0x29')]=function(_0x84c1af){var _0x1b68a0=this;return new Promise(function(_0x4f45d0,_0x355d32){return db[_0x0e73('0x20')]['find']({'raw':_0x84c1af['options']?_0x84c1af[_0x0e73('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x84c1af['options']?_0x84c1af[_0x0e73('0x21')][_0x0e73('0x23')]||null:null,'attributes':_0x84c1af[_0x0e73('0x21')]?_0x84c1af[_0x0e73('0x21')][_0x0e73('0x28')]||null:null,'include':_0x84c1af['options']?_0x84c1af[_0x0e73('0x21')][_0x0e73('0x25')]?_['map'](_0x84c1af[_0x0e73('0x21')][_0x0e73('0x25')],function(_0x450488){return{'model':db[_0x450488[_0x0e73('0x27')]],'as':_0x450488['as'],'attributes':_0x450488[_0x0e73('0x28')],'include':_0x450488[_0x0e73('0x25')]?_[_0x0e73('0x26')](_0x450488[_0x0e73('0x25')],function(_0x386ed3){return{'model':db[_0x386ed3[_0x0e73('0x27')]],'as':_0x386ed3['as'],'attributes':_0x386ed3[_0x0e73('0x28')],'include':_0x386ed3[_0x0e73('0x25')]?_[_0x0e73('0x26')](_0x386ed3[_0x0e73('0x25')],function(_0x2065fc){return{'model':db[_0x2065fc[_0x0e73('0x27')]],'as':_0x2065fc['as'],'attributes':_0x2065fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e73('0x13')](function(_0x3312ce){logger[_0x0e73('0x14')](_0x0e73('0x29'),_0x84c1af);logger['debug']('ShowFaxQueue',_0x84c1af,JSON[_0x0e73('0x18')](_0x3312ce));_0x4f45d0(_0x3312ce);})[_0x0e73('0x1e')](function(_0x45c98d){logger[_0x0e73('0x19')](_0x0e73('0x29'),_0x45c98d[_0x0e73('0x1c')],_0x84c1af);_0x355d32(_0x1b68a0[_0x0e73('0x19')](0x1f4,_0x45c98d[_0x0e73('0x1c')]));});});}; \ No newline at end of file +var _0x7baa=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','model','map','attributes','stringify','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s'];(function(_0x155413,_0x1c89b4){var _0x434c71=function(_0x5b74a0){while(--_0x5b74a0){_0x155413['push'](_0x155413['shift']());}};_0x434c71(++_0x1c89b4);}(_0x7baa,0x11d));var _0xa7ba=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x7baa[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require(_0xa7ba('0x0'));var util=require('util');var moment=require(_0xa7ba('0x1'));var BPromise=require(_0xa7ba('0x2'));var rs=require(_0xa7ba('0x3'));var fs=require('fs');var Redis=require(_0xa7ba('0x4'));var db=require(_0xa7ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7ba('0x6'));var config=require(_0xa7ba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa7ba('0x8')]['http']({'port':0x232a});config[_0xa7ba('0x9')]=_[_0xa7ba('0xa')](config[_0xa7ba('0x9')],{'host':_0xa7ba('0xb'),'port':0x18eb});var socket=require(_0xa7ba('0xc'))(new Redis(config['redis']));require(_0xa7ba('0xd'))[_0xa7ba('0xe')](socket);function respondWithRpcPromise(_0xc5f589,_0x55c654,_0x1b0f2f){return new BPromise(function(_0x2ca750,_0x1026b0){return client[_0xa7ba('0xf')](_0xc5f589,_0x1b0f2f)[_0xa7ba('0x10')](function(_0x1a8c3c){logger[_0xa7ba('0x11')](_0xa7ba('0x12'),_0x55c654,'request\x20sent');logger[_0xa7ba('0x13')](_0xa7ba('0x14'),_0x55c654,_0xa7ba('0x15'),JSON['stringify'](_0x1a8c3c));if(_0x1a8c3c['error']){if(_0x1a8c3c[_0xa7ba('0x16')][_0xa7ba('0x17')]===0x1f4){logger[_0xa7ba('0x16')](_0xa7ba('0x12'),_0x55c654,_0x1a8c3c['error']['message']);return _0x1026b0(_0x1a8c3c['error']['message']);}logger[_0xa7ba('0x16')](_0xa7ba('0x12'),_0x55c654,_0x1a8c3c[_0xa7ba('0x16')][_0xa7ba('0x18')]);return _0x2ca750(_0x1a8c3c[_0xa7ba('0x16')][_0xa7ba('0x18')]);}else{logger[_0xa7ba('0x11')](_0xa7ba('0x12'),_0x55c654,_0xa7ba('0x15'));_0x2ca750(_0x1a8c3c['result'][_0xa7ba('0x18')]);}})[_0xa7ba('0x19')](function(_0x328c74){logger['error'](_0xa7ba('0x12'),_0x55c654,_0x328c74);_0x1026b0(_0x328c74);});});}exports[_0xa7ba('0x1a')]=function(_0x5e4fa8){var _0x47eb89=this;return new Promise(function(_0x4dd79e,_0x1fe59b){return db[_0xa7ba('0x1b')]['findAll']({'raw':_0x5e4fa8[_0xa7ba('0x1c')]?_0x5e4fa8[_0xa7ba('0x1c')][_0xa7ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e4fa8[_0xa7ba('0x1c')]?_0x5e4fa8[_0xa7ba('0x1c')][_0xa7ba('0x1e')]||null:null,'attributes':_0x5e4fa8[_0xa7ba('0x1c')]?_0x5e4fa8[_0xa7ba('0x1c')]['attributes']||null:null,'limit':_0x5e4fa8[_0xa7ba('0x1c')]?_0x5e4fa8[_0xa7ba('0x1c')][_0xa7ba('0x1f')]||null:null,'include':_0x5e4fa8[_0xa7ba('0x1c')]?_0x5e4fa8[_0xa7ba('0x1c')][_0xa7ba('0x20')]?_['map'](_0x5e4fa8['options'][_0xa7ba('0x20')],function(_0x248d59){return{'model':db[_0x248d59[_0xa7ba('0x21')]],'as':_0x248d59['as'],'attributes':_0x248d59['attributes'],'include':_0x248d59[_0xa7ba('0x20')]?_[_0xa7ba('0x22')](_0x248d59[_0xa7ba('0x20')],function(_0xb35236){return{'model':db[_0xb35236[_0xa7ba('0x21')]],'as':_0xb35236['as'],'attributes':_0xb35236[_0xa7ba('0x23')],'include':_0xb35236[_0xa7ba('0x20')]?_[_0xa7ba('0x22')](_0xb35236['include'],function(_0x2b6ff0){return{'model':db[_0x2b6ff0[_0xa7ba('0x21')]],'as':_0x2b6ff0['as'],'attributes':_0x2b6ff0[_0xa7ba('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa7ba('0x10')](function(_0x465b72){logger[_0xa7ba('0x11')](_0xa7ba('0x1a'),_0x5e4fa8);logger[_0xa7ba('0x13')](_0xa7ba('0x1a'),_0x5e4fa8,JSON[_0xa7ba('0x24')](_0x465b72));_0x4dd79e(_0x465b72);})[_0xa7ba('0x19')](function(_0x437127){logger[_0xa7ba('0x16')]('GetFaxQueue',_0x437127[_0xa7ba('0x18')],_0x5e4fa8);_0x1fe59b(_0x47eb89[_0xa7ba('0x16')](0x1f4,_0x437127[_0xa7ba('0x18')]));});});};exports['ShowFaxQueue']=function(_0x31d983){var _0x1a09fc=this;return new Promise(function(_0x537675,_0xf5d729){return db[_0xa7ba('0x1b')]['find']({'raw':_0x31d983[_0xa7ba('0x1c')]?_0x31d983[_0xa7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x31d983['options']?_0x31d983[_0xa7ba('0x1c')][_0xa7ba('0x1e')]||null:null,'attributes':_0x31d983[_0xa7ba('0x1c')]?_0x31d983['options'][_0xa7ba('0x23')]||null:null,'include':_0x31d983[_0xa7ba('0x1c')]?_0x31d983[_0xa7ba('0x1c')][_0xa7ba('0x20')]?_[_0xa7ba('0x22')](_0x31d983[_0xa7ba('0x1c')]['include'],function(_0x5ceee5){return{'model':db[_0x5ceee5[_0xa7ba('0x21')]],'as':_0x5ceee5['as'],'attributes':_0x5ceee5[_0xa7ba('0x23')],'include':_0x5ceee5[_0xa7ba('0x20')]?_[_0xa7ba('0x22')](_0x5ceee5[_0xa7ba('0x20')],function(_0x4b98f8){return{'model':db[_0x4b98f8['model']],'as':_0x4b98f8['as'],'attributes':_0x4b98f8[_0xa7ba('0x23')],'include':_0x4b98f8[_0xa7ba('0x20')]?_[_0xa7ba('0x22')](_0x4b98f8[_0xa7ba('0x20')],function(_0x206fbf){return{'model':db[_0x206fbf[_0xa7ba('0x21')]],'as':_0x206fbf['as'],'attributes':_0x206fbf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x594b3f){logger[_0xa7ba('0x11')]('ShowFaxQueue',_0x31d983);logger[_0xa7ba('0x13')](_0xa7ba('0x25'),_0x31d983,JSON[_0xa7ba('0x24')](_0x594b3f));_0x537675(_0x594b3f);})[_0xa7ba('0x19')](function(_0x441f45){logger[_0xa7ba('0x16')](_0xa7ba('0x25'),_0x441f45[_0xa7ba('0x18')],_0x31d983);_0xf5d729(_0x1a09fc[_0xa7ba('0x16')](0x1f4,_0x441f45[_0xa7ba('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 723002d..dc31808 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 _0x55e2=['./faxQueue.events','save','remove','register','length','faxQueue:'];(function(_0x560585,_0x9d921){var _0x3dfee5=function(_0x448f61){while(--_0x448f61){_0x560585['push'](_0x560585['shift']());}};_0x3dfee5(++_0x9d921);}(_0x55e2,0xd8));var _0x255e=function(_0x5ae2b8,_0x2207f4){_0x5ae2b8=_0x5ae2b8-0x0;var _0x31972d=_0x55e2[_0x5ae2b8];return _0x31972d;};'use strict';var FaxQueueEvents=require(_0x255e('0x0'));var events=[_0x255e('0x1'),_0x255e('0x2'),'update'];function createListener(_0x49c9d3,_0x6ae6b4){return function(_0x4387ff){_0x6ae6b4['emit'](_0x49c9d3,_0x4387ff);};}function removeListener(_0x3cc5df,_0x4b4799){return function(){FaxQueueEvents['removeListener'](_0x3cc5df,_0x4b4799);};}exports[_0x255e('0x3')]=function(_0x198fef){for(var _0x3cde29=0x0,_0x51cef7=events[_0x255e('0x4')];_0x3cde29<_0x51cef7;_0x3cde29++){var _0x169d4e=events[_0x3cde29];var _0x155199=createListener(_0x255e('0x5')+_0x169d4e,_0x198fef);FaxQueueEvents['on'](_0x169d4e,_0x155199);}}; \ No newline at end of file +var _0x342d=['save','update','emit','removeListener','faxQueue:','./faxQueue.events'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x342d,0x197));var _0xd342=function(_0xbf0237,_0x67b818){_0xbf0237=_0xbf0237-0x0;var _0x343795=_0x342d[_0xbf0237];return _0x343795;};'use strict';var FaxQueueEvents=require(_0xd342('0x0'));var events=[_0xd342('0x1'),'remove',_0xd342('0x2')];function createListener(_0x4b620d,_0x4a3799){return function(_0x486dbb){_0x4a3799[_0xd342('0x3')](_0x4b620d,_0x486dbb);};}function removeListener(_0x1ddc25,_0x460f07){return function(){FaxQueueEvents[_0xd342('0x4')](_0x1ddc25,_0x460f07);};}exports['register']=function(_0x8b0cdf){for(var _0x4a621c=0x0,_0x5447ef=events['length'];_0x4a621c<_0x5447ef;_0x4a621c++){var _0x2ae9a6=events[_0x4a621c];var _0x39dff9=createListener(_0xd342('0x5')+_0x2ae9a6,_0x8b0cdf);FaxQueueEvents['on'](_0x2ae9a6,_0x39dff9);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index cb59959..535ef01 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 _0x6050=['describe','get','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6050,0x196));var _0x0605=function(_0x3f3bb0,_0x2199f1){_0x3f3bb0=_0x3f3bb0-0x0;var _0x153558=_0x6050[_0x3f3bb0];return _0x153558;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./faxQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['get'](_0x0605('0xf'),auth[_0x0605('0xd')](),controller[_0x0605('0x10')]);router[_0x0605('0xb')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0xb')](_0x0605('0x13'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);router[_0x0605('0x15')]('/',auth[_0x0605('0xd')](),controller[_0x0605('0x16')]);router[_0x0605('0x15')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x17')]);router[_0x0605('0x15')]('/:id/users',auth[_0x0605('0xd')](),controller[_0x0605('0x18')]);router[_0x0605('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0605('0x1a')]);router[_0x0605('0x1b')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0x1c')]);router[_0x0605('0x1b')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x1d')]);router[_0x0605('0x1b')](_0x0605('0x13'),auth[_0x0605('0xd')](),controller[_0x0605('0x1e')]);module[_0x0605('0x1f')]=router; \ No newline at end of file +var _0x33af=['destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','delete','/:id'];(function(_0x254bac,_0x76f51b){var _0xeb2b94=function(_0x3d98b0){while(--_0x3d98b0){_0x254bac['push'](_0x254bac['shift']());}};_0xeb2b94(++_0x76f51b);}(_0x33af,0xec));var _0xf33a=function(_0x4b630,_0x151f86){_0x4b630=_0x4b630-0x0;var _0x24f855=_0x33af[_0x4b630];return _0x24f855;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x12')]('/',auth[_0xf33a('0xb')](),controller['create']);router['post'](_0xf33a('0x13'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x12')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x16')]('/:id',auth[_0xf33a('0xb')](),controller['update']);router[_0xf33a('0x17')](_0xf33a('0x18'),auth['isAuthenticated'](),controller[_0xf33a('0x19')]);router[_0xf33a('0x17')]('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x17')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x1b')]);module[_0xf33a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index db85505..d0df0e4 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 _0xa8bc=['STRING','DATE','moment','sequelize'];(function(_0xcf835,_0x25c2c4){var _0x3422bf=function(_0x4024cf){while(--_0x4024cf){_0xcf835['push'](_0xcf835['shift']());}};_0x3422bf(++_0x25c2c4);}(_0xa8bc,0x15a));var _0xca8b=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0xa8bc[_0xec034];return _0x2c5a19;};'use strict';var moment=require(_0xca8b('0x0'));var Sequelize=require(_0xca8b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xca8b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xca8b('0x2')]},'joinAt':{'type':Sequelize[_0xca8b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xca8b('0x3')]},'exitAt':{'type':Sequelize[_0xca8b('0x3')]},'reason':{'type':Sequelize[_0xca8b('0x2')]}}; \ No newline at end of file +var _0x9e42=['exports','STRING','DATE','sequelize'];(function(_0x9f6571,_0x3ed9f6){var _0x65a97b=function(_0x283c7e){while(--_0x283c7e){_0x9f6571['push'](_0x9f6571['shift']());}};_0x65a97b(++_0x3ed9f6);}(_0x9e42,0x157));var _0x29e4=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0x9e42[_0x42d2af];return _0x1d6d63;};'use strict';var moment=require('moment');var Sequelize=require(_0x29e4('0x0'));module[_0x29e4('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x29e4('0x2')]},'joinAt':{'type':Sequelize[_0x29e4('0x3')]},'leaveAt':{'type':Sequelize[_0x29e4('0x3')]},'acceptAt':{'type':Sequelize[_0x29e4('0x3')]},'exitAt':{'type':Sequelize[_0x29e4('0x3')]},'reason':{'type':Sequelize[_0x29e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index de5e2d6..c1d1e25 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 _0x5088=['intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','FaxQueueReport','key','keys','query','filters'];(function(_0x538493,_0x3c5710){var _0x44563f=function(_0x23c54e){while(--_0x23c54e){_0x538493['push'](_0x538493['shift']());}};_0x44563f(++_0x3c5710);}(_0x5088,0xa9));var _0x8508=function(_0x500211,_0x1a0367){_0x500211=_0x500211-0x0;var _0x48f4e0=_0x5088[_0x500211];return _0x48f4e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8508('0x0'));var zipdir=require(_0x8508('0x1'));var jsonpatch=require(_0x8508('0x2'));var rp=require(_0x8508('0x3'));var moment=require('moment');var BPromise=require(_0x8508('0x4'));var Mustache=require(_0x8508('0x5'));var util=require(_0x8508('0x6'));var path=require(_0x8508('0x7'));var sox=require('sox');var csv=require(_0x8508('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8508('0x9'));var _=require(_0x8508('0xa'));var squel=require('squel');var crypto=require(_0x8508('0xb'));var jsforce=require(_0x8508('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8508('0x8'));var querystring=require(_0x8508('0xd'));var Papa=require(_0x8508('0xe'));var Redis=require(_0x8508('0xf'));var authService=require(_0x8508('0x10'));var qs=require(_0x8508('0x11'));var as=require(_0x8508('0x12'));var hardwareService=require(_0x8508('0x13'));var logger=require(_0x8508('0x14'))('api');var utils=require(_0x8508('0x15'));var config=require(_0x8508('0x16'));var licenseUtil=require(_0x8508('0x17'));var db=require(_0x8508('0x18'))['db'];function respondWithStatusCode(_0x184f08,_0x129d4c){_0x129d4c=_0x129d4c||0xcc;return function(_0x2a6969){if(_0x2a6969){return _0x184f08['sendStatus'](_0x129d4c);}return _0x184f08[_0x8508('0x19')](_0x129d4c)[_0x8508('0x1a')]();};}function respondWithResult(_0x1d64a7,_0x431b14){_0x431b14=_0x431b14||0xc8;return function(_0x4c4bf9){if(_0x4c4bf9){return _0x1d64a7[_0x8508('0x19')](_0x431b14)[_0x8508('0x1b')](_0x4c4bf9);}};}function respondWithFilteredResult(_0x5b1b8d,_0x34da29){return function(_0x4f81c7){if(_0x4f81c7){var _0xe8daa7=typeof _0x34da29[_0x8508('0x1c')]===_0x8508('0x1d')&&typeof _0x34da29[_0x8508('0x1e')]===_0x8508('0x1d');var _0x5668d3=_0x4f81c7[_0x8508('0x1f')];var _0x12a592=_0xe8daa7?0x0:_0x34da29['offset'];var _0x53621f=_0xe8daa7?_0x4f81c7[_0x8508('0x1f')]:_0x34da29['offset']+_0x34da29[_0x8508('0x1e')];var _0x3a8832;if(_0x53621f>=_0x5668d3){_0x53621f=_0x5668d3;_0x3a8832=0xc8;}else{_0x3a8832=0xce;}_0x5b1b8d[_0x8508('0x19')](_0x3a8832);return _0x5b1b8d['set'](_0x8508('0x20'),_0x12a592+'-'+_0x53621f+'/'+_0x5668d3)[_0x8508('0x1b')](_0x4f81c7);}return null;};}function patchUpdates(_0x245f8c){return function(_0x1da402){try{jsonpatch[_0x8508('0x21')](_0x1da402,_0x245f8c,!![]);}catch(_0x2d041e){return BPromise[_0x8508('0x22')](_0x2d041e);}return _0x1da402[_0x8508('0x23')]();};}function saveUpdates(_0x266b93,_0x34ee74){return function(_0x455594){if(_0x455594){return _0x455594['update'](_0x266b93)[_0x8508('0x24')](function(_0x1fb31e){return _0x1fb31e;});}return null;};}function removeEntity(_0x43fa1b,_0x5874b2){return function(_0x1efffd){if(_0x1efffd){return _0x1efffd[_0x8508('0x25')]()[_0x8508('0x24')](function(){_0x43fa1b['status'](0xcc)[_0x8508('0x1a')]();});}};}function handleEntityNotFound(_0x133d37,_0x373c86){return function(_0x2ccf2d){if(!_0x2ccf2d){_0x133d37['sendStatus'](0x194);}return _0x2ccf2d;};}function handleError(_0x500849,_0x3dcdff){_0x3dcdff=_0x3dcdff||0x1f4;return function(_0x4d872c){logger[_0x8508('0x26')](_0x4d872c['stack']);if(_0x4d872c[_0x8508('0x27')]){delete _0x4d872c[_0x8508('0x27')];}_0x500849[_0x8508('0x19')](_0x3dcdff)[_0x8508('0x28')](_0x4d872c);};}exports['index']=function(_0x2a99e0,_0x3d0d71){var _0x473363={},_0x4e51db={},_0x68f48c={'count':0x0,'rows':[]};var _0x4f9cbf=_[_0x8508('0x29')](db[_0x8508('0x2a')]['rawAttributes'],function(_0x307a8a){return{'name':_0x307a8a['fieldName'],'type':_0x307a8a['type'][_0x8508('0x2b')]};});_0x4e51db['model']=_[_0x8508('0x29')](_0x4f9cbf,_0x8508('0x27'));_0x4e51db['query']=_[_0x8508('0x2c')](_0x2a99e0[_0x8508('0x2d')]);_0x4e51db[_0x8508('0x2e')]=_[_0x8508('0x2f')](_0x4e51db[_0x8508('0x30')],_0x4e51db['query']);_0x473363[_0x8508('0x31')]=_[_0x8508('0x2f')](_0x4e51db[_0x8508('0x30')],qs['fields'](_0x2a99e0[_0x8508('0x2d')][_0x8508('0x32')]));_0x473363[_0x8508('0x31')]=_0x473363[_0x8508('0x31')]['length']?_0x473363['attributes']:_0x4e51db[_0x8508('0x30')];if(!_0x2a99e0[_0x8508('0x2d')][_0x8508('0x33')]('nolimit')){_0x473363[_0x8508('0x1e')]=qs[_0x8508('0x1e')](_0x2a99e0[_0x8508('0x2d')]['limit']);_0x473363['offset']=qs[_0x8508('0x1c')](_0x2a99e0['query']['offset']);}_0x473363[_0x8508('0x34')]=qs[_0x8508('0x35')](_0x2a99e0[_0x8508('0x2d')][_0x8508('0x35')]);_0x473363[_0x8508('0x36')]=qs['filters'](_[_0x8508('0x37')](_0x2a99e0['query'],_0x4e51db['filters']),_0x4f9cbf);if(_0x2a99e0[_0x8508('0x2d')][_0x8508('0x38')]){_0x473363[_0x8508('0x36')]=_[_0x8508('0x39')](_0x473363[_0x8508('0x36')],{'$or':_[_0x8508('0x29')](_0x4f9cbf,function(_0x58de84){if(_0x58de84['type']!==_0x8508('0x3a')){var _0x4a16dd={};_0x4a16dd[_0x58de84[_0x8508('0x27')]]={'$like':'%'+_0x2a99e0[_0x8508('0x2d')][_0x8508('0x38')]+'%'};return _0x4a16dd;}})});}_0x473363=_[_0x8508('0x39')]({},_0x473363,_0x2a99e0[_0x8508('0x3b')]);var _0x12a899={'where':_0x473363[_0x8508('0x36')]};return db[_0x8508('0x2a')][_0x8508('0x1f')](_0x12a899)[_0x8508('0x24')](function(_0x366750){_0x68f48c[_0x8508('0x1f')]=_0x366750;if(_0x2a99e0[_0x8508('0x2d')][_0x8508('0x3c')]){_0x473363[_0x8508('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x8508('0x3e')](_0x473363);})[_0x8508('0x24')](function(_0x2e7b12){_0x68f48c[_0x8508('0x3f')]=_0x2e7b12;return _0x68f48c;})['then'](respondWithFilteredResult(_0x3d0d71,_0x473363))['catch'](handleError(_0x3d0d71,null));};exports[_0x8508('0x40')]=function(_0x2352fc,_0x1b8fe7){var _0x491559={'raw':!![],'where':{'id':_0x2352fc[_0x8508('0x41')]['id']}},_0x48adef={};_0x48adef[_0x8508('0x30')]=_[_0x8508('0x2c')](db['FaxQueueReport']['rawAttributes']);_0x48adef[_0x8508('0x2d')]=_[_0x8508('0x2c')](_0x2352fc[_0x8508('0x2d')]);_0x48adef['filters']=_[_0x8508('0x2f')](_0x48adef[_0x8508('0x30')],_0x48adef[_0x8508('0x2d')]);_0x491559[_0x8508('0x31')]=_[_0x8508('0x2f')](_0x48adef[_0x8508('0x30')],qs[_0x8508('0x32')](_0x2352fc['query'][_0x8508('0x32')]));_0x491559[_0x8508('0x31')]=_0x491559['attributes'][_0x8508('0x42')]?_0x491559['attributes']:_0x48adef[_0x8508('0x30')];if(_0x2352fc[_0x8508('0x2d')][_0x8508('0x3c')]){_0x491559[_0x8508('0x3d')]=[{'all':!![]}];}_0x491559=_[_0x8508('0x39')]({},_0x491559,_0x2352fc[_0x8508('0x3b')]);return db[_0x8508('0x2a')][_0x8508('0x43')](_0x491559)['then'](handleEntityNotFound(_0x1b8fe7,null))[_0x8508('0x24')](respondWithResult(_0x1b8fe7,null))[_0x8508('0x44')](handleError(_0x1b8fe7,null));};exports[_0x8508('0x45')]=function(_0x4787f6,_0x3a1907){return db['FaxQueueReport'][_0x8508('0x45')](_0x4787f6[_0x8508('0x46')],{})[_0x8508('0x24')](respondWithResult(_0x3a1907,0xc9))[_0x8508('0x44')](handleError(_0x3a1907,null));};exports['update']=function(_0x4e4d38,_0x2a8094){if(_0x4e4d38[_0x8508('0x46')]['id']){delete _0x4e4d38[_0x8508('0x46')]['id'];}return db['FaxQueueReport'][_0x8508('0x43')]({'where':{'id':_0x4e4d38[_0x8508('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a8094,null))[_0x8508('0x24')](saveUpdates(_0x4e4d38['body'],null))[_0x8508('0x24')](respondWithResult(_0x2a8094,null))[_0x8508('0x44')](handleError(_0x2a8094,null));};exports[_0x8508('0x25')]=function(_0x1dd21f,_0x2bbbd8){return db['FaxQueueReport'][_0x8508('0x43')]({'where':{'id':_0x1dd21f[_0x8508('0x41')]['id']}})[_0x8508('0x24')](handleEntityNotFound(_0x2bbbd8,null))[_0x8508('0x24')](removeEntity(_0x2bbbd8,null))[_0x8508('0x44')](handleError(_0x2bbbd8,null));};exports[_0x8508('0x47')]=function(_0x5dc061,_0x3597b6){return db[_0x8508('0x2a')][_0x8508('0x47')]()[_0x8508('0x24')](respondWithResult(_0x3597b6,null))['catch'](handleError(_0x3597b6,null));}; \ No newline at end of file +var _0x9879=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x599095,_0x1e6d84){var _0x21a687=function(_0x1a7487){while(--_0x1a7487){_0x599095['push'](_0x599095['shift']());}};_0x21a687(++_0x1e6d84);}(_0x9879,0x98));var _0x9987=function(_0x2fe661,_0x42258e){_0x2fe661=_0x2fe661-0x0;var _0x468eda=_0x9879[_0x2fe661];return _0x468eda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9987('0x0'));var zipdir=require(_0x9987('0x1'));var jsonpatch=require(_0x9987('0x2'));var rp=require(_0x9987('0x3'));var moment=require(_0x9987('0x4'));var BPromise=require(_0x9987('0x5'));var Mustache=require(_0x9987('0x6'));var util=require(_0x9987('0x7'));var path=require(_0x9987('0x8'));var sox=require(_0x9987('0x9'));var csv=require(_0x9987('0xa'));var ejs=require(_0x9987('0xb'));var fs=require('fs');var fs_extra=require(_0x9987('0xc'));var _=require(_0x9987('0xd'));var squel=require(_0x9987('0xe'));var crypto=require('crypto');var jsforce=require(_0x9987('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9987('0x10'));var Papa=require('papaparse');var Redis=require(_0x9987('0x11'));var authService=require(_0x9987('0x12'));var qs=require(_0x9987('0x13'));var as=require(_0x9987('0x14'));var hardwareService=require(_0x9987('0x15'));var logger=require(_0x9987('0x16'))(_0x9987('0x17'));var utils=require(_0x9987('0x18'));var config=require(_0x9987('0x19'));var licenseUtil=require(_0x9987('0x1a'));var db=require(_0x9987('0x1b'))['db'];function respondWithStatusCode(_0x2c353c,_0x4c91e3){_0x4c91e3=_0x4c91e3||0xcc;return function(_0x24a42b){if(_0x24a42b){return _0x2c353c[_0x9987('0x1c')](_0x4c91e3);}return _0x2c353c[_0x9987('0x1d')](_0x4c91e3)[_0x9987('0x1e')]();};}function respondWithResult(_0x1d66fe,_0x99976){_0x99976=_0x99976||0xc8;return function(_0x40cd6c){if(_0x40cd6c){return _0x1d66fe[_0x9987('0x1d')](_0x99976)[_0x9987('0x1f')](_0x40cd6c);}};}function respondWithFilteredResult(_0x1fcddb,_0x211574){return function(_0x383996){if(_0x383996){var _0x598a6f=typeof _0x211574['offset']===_0x9987('0x20')&&typeof _0x211574[_0x9987('0x21')]===_0x9987('0x20');var _0x38df2b=_0x383996[_0x9987('0x22')];var _0x563b33=_0x598a6f?0x0:_0x211574[_0x9987('0x23')];var _0x30cef2=_0x598a6f?_0x383996[_0x9987('0x22')]:_0x211574[_0x9987('0x23')]+_0x211574[_0x9987('0x21')];var _0x185842;if(_0x30cef2>=_0x38df2b){_0x30cef2=_0x38df2b;_0x185842=0xc8;}else{_0x185842=0xce;}_0x1fcddb[_0x9987('0x1d')](_0x185842);return _0x1fcddb['set'](_0x9987('0x24'),_0x563b33+'-'+_0x30cef2+'/'+_0x38df2b)[_0x9987('0x1f')](_0x383996);}return null;};}function patchUpdates(_0x5c4035){return function(_0x5b2adb){try{jsonpatch[_0x9987('0x25')](_0x5b2adb,_0x5c4035,!![]);}catch(_0x579341){return BPromise['reject'](_0x579341);}return _0x5b2adb[_0x9987('0x26')]();};}function saveUpdates(_0xd18e1f,_0x3deea2){return function(_0x1fcec7){if(_0x1fcec7){return _0x1fcec7[_0x9987('0x27')](_0xd18e1f)[_0x9987('0x28')](function(_0x5c2c13){return _0x5c2c13;});}return null;};}function removeEntity(_0x3c62e4,_0x2fe4b6){return function(_0x10b59c){if(_0x10b59c){return _0x10b59c[_0x9987('0x29')]()['then'](function(){_0x3c62e4[_0x9987('0x1d')](0xcc)[_0x9987('0x1e')]();});}};}function handleEntityNotFound(_0x490475,_0x5ebf79){return function(_0x27fa51){if(!_0x27fa51){_0x490475[_0x9987('0x1c')](0x194);}return _0x27fa51;};}function handleError(_0x5de1d0,_0xb0f9db){_0xb0f9db=_0xb0f9db||0x1f4;return function(_0x2e7059){logger[_0x9987('0x2a')](_0x2e7059[_0x9987('0x2b')]);if(_0x2e7059[_0x9987('0x2c')]){delete _0x2e7059[_0x9987('0x2c')];}_0x5de1d0[_0x9987('0x1d')](_0xb0f9db)[_0x9987('0x2d')](_0x2e7059);};}exports['index']=function(_0x5a86d2,_0x3606cd){var _0x40248f={},_0x26670f={},_0x4edecd={'count':0x0,'rows':[]};var _0x482d99=_[_0x9987('0x2e')](db[_0x9987('0x2f')][_0x9987('0x30')],function(_0x3807e5){return{'name':_0x3807e5[_0x9987('0x31')],'type':_0x3807e5['type'][_0x9987('0x32')]};});_0x26670f['model']=_['map'](_0x482d99,'name');_0x26670f[_0x9987('0x33')]=_[_0x9987('0x34')](_0x5a86d2[_0x9987('0x33')]);_0x26670f[_0x9987('0x35')]=_[_0x9987('0x36')](_0x26670f[_0x9987('0x37')],_0x26670f[_0x9987('0x33')]);_0x40248f[_0x9987('0x38')]=_[_0x9987('0x36')](_0x26670f[_0x9987('0x37')],qs[_0x9987('0x39')](_0x5a86d2[_0x9987('0x33')]['fields']));_0x40248f[_0x9987('0x38')]=_0x40248f[_0x9987('0x38')][_0x9987('0x3a')]?_0x40248f[_0x9987('0x38')]:_0x26670f[_0x9987('0x37')];if(!_0x5a86d2[_0x9987('0x33')][_0x9987('0x3b')]('nolimit')){_0x40248f[_0x9987('0x21')]=qs[_0x9987('0x21')](_0x5a86d2[_0x9987('0x33')][_0x9987('0x21')]);_0x40248f[_0x9987('0x23')]=qs[_0x9987('0x23')](_0x5a86d2[_0x9987('0x33')]['offset']);}_0x40248f['order']=qs['sort'](_0x5a86d2[_0x9987('0x33')][_0x9987('0x3c')]);_0x40248f[_0x9987('0x3d')]=qs[_0x9987('0x35')](_[_0x9987('0x3e')](_0x5a86d2[_0x9987('0x33')],_0x26670f[_0x9987('0x35')]),_0x482d99);if(_0x5a86d2['query'][_0x9987('0x3f')]){_0x40248f[_0x9987('0x3d')]=_['merge'](_0x40248f[_0x9987('0x3d')],{'$or':_[_0x9987('0x2e')](_0x482d99,function(_0x5d6d70){if(_0x5d6d70[_0x9987('0x40')]!==_0x9987('0x41')){var _0x4f445c={};_0x4f445c[_0x5d6d70[_0x9987('0x2c')]]={'$like':'%'+_0x5a86d2[_0x9987('0x33')][_0x9987('0x3f')]+'%'};return _0x4f445c;}})});}_0x40248f=_[_0x9987('0x42')]({},_0x40248f,_0x5a86d2['options']);var _0x481e9d={'where':_0x40248f[_0x9987('0x3d')]};return db[_0x9987('0x2f')]['count'](_0x481e9d)[_0x9987('0x28')](function(_0x1feb50){_0x4edecd[_0x9987('0x22')]=_0x1feb50;if(_0x5a86d2[_0x9987('0x33')][_0x9987('0x43')]){_0x40248f[_0x9987('0x44')]=[{'all':!![]}];}return db[_0x9987('0x2f')][_0x9987('0x45')](_0x40248f);})['then'](function(_0xcbaf54){_0x4edecd[_0x9987('0x46')]=_0xcbaf54;return _0x4edecd;})['then'](respondWithFilteredResult(_0x3606cd,_0x40248f))[_0x9987('0x47')](handleError(_0x3606cd,null));};exports['show']=function(_0x1bd44e,_0x3b3720){var _0xbc37dd={'raw':!![],'where':{'id':_0x1bd44e[_0x9987('0x48')]['id']}},_0x157213={};_0x157213[_0x9987('0x37')]=_['keys'](db[_0x9987('0x2f')]['rawAttributes']);_0x157213[_0x9987('0x33')]=_[_0x9987('0x34')](_0x1bd44e[_0x9987('0x33')]);_0x157213[_0x9987('0x35')]=_['intersection'](_0x157213['model'],_0x157213[_0x9987('0x33')]);_0xbc37dd['attributes']=_['intersection'](_0x157213[_0x9987('0x37')],qs[_0x9987('0x39')](_0x1bd44e[_0x9987('0x33')]['fields']));_0xbc37dd[_0x9987('0x38')]=_0xbc37dd['attributes'][_0x9987('0x3a')]?_0xbc37dd[_0x9987('0x38')]:_0x157213['model'];if(_0x1bd44e[_0x9987('0x33')][_0x9987('0x43')]){_0xbc37dd[_0x9987('0x44')]=[{'all':!![]}];}_0xbc37dd=_[_0x9987('0x42')]({},_0xbc37dd,_0x1bd44e[_0x9987('0x49')]);return db['FaxQueueReport'][_0x9987('0x4a')](_0xbc37dd)['then'](handleEntityNotFound(_0x3b3720,null))[_0x9987('0x28')](respondWithResult(_0x3b3720,null))['catch'](handleError(_0x3b3720,null));};exports[_0x9987('0x4b')]=function(_0x4c3b78,_0x593e3a){return db['FaxQueueReport'][_0x9987('0x4b')](_0x4c3b78[_0x9987('0x4c')],{})[_0x9987('0x28')](respondWithResult(_0x593e3a,0xc9))['catch'](handleError(_0x593e3a,null));};exports[_0x9987('0x27')]=function(_0x5adaea,_0x282300){if(_0x5adaea[_0x9987('0x4c')]['id']){delete _0x5adaea[_0x9987('0x4c')]['id'];}return db['FaxQueueReport'][_0x9987('0x4a')]({'where':{'id':_0x5adaea[_0x9987('0x48')]['id']}})[_0x9987('0x28')](handleEntityNotFound(_0x282300,null))[_0x9987('0x28')](saveUpdates(_0x5adaea[_0x9987('0x4c')],null))['then'](respondWithResult(_0x282300,null))[_0x9987('0x47')](handleError(_0x282300,null));};exports[_0x9987('0x29')]=function(_0x27da49,_0xcb87ce){return db[_0x9987('0x2f')]['find']({'where':{'id':_0x27da49[_0x9987('0x48')]['id']}})[_0x9987('0x28')](handleEntityNotFound(_0xcb87ce,null))['then'](removeEntity(_0xcb87ce,null))[_0x9987('0x47')](handleError(_0xcb87ce,null));};exports[_0x9987('0x4d')]=function(_0x248cca,_0x23f759){return db[_0x9987('0x2f')]['describe']()[_0x9987('0x28')](respondWithResult(_0x23f759,null))[_0x9987('0x47')](handleError(_0x23f759,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 0d8ae12..7b337d2 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0xf9c3d3,_0x11f06b){var _0xb90bdd=function(_0x5526ba){while(--_0x5526ba){_0xf9c3d3['push'](_0xf9c3d3['shift']());}};_0xb90bdd(++_0x11f06b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0x7fbe[_0x4045ff];return _0x5797ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x1f9890,_0x2c4706){var _0x3e798c=function(_0x164f0c){while(--_0x164f0c){_0x1f9890['push'](_0x1f9890['shift']());}};_0x3e798c(++_0x2c4706);}(_0x5fc3,0xa8));var _0x35fc=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x5fc3[_0x466bc5];return _0x138952;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index dd87bfc..6271ccb 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 _0x6343=['request\x20sent','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','body','options','then','CreateFaxQueueReport','debug','stringify','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1bc76e,_0x3c2452){var _0x549281=function(_0x1b2f6f){while(--_0x1b2f6f){_0x1bc76e['push'](_0x1bc76e['shift']());}};_0x549281(++_0x3c2452);}(_0x6343,0x1db));var _0x3634=function(_0x91461d,_0x4ad392){_0x91461d=_0x91461d-0x0;var _0x4df48e=_0x6343[_0x91461d];return _0x4df48e;};'use strict';var _=require(_0x3634('0x0'));var util=require(_0x3634('0x1'));var moment=require(_0x3634('0x2'));var BPromise=require(_0x3634('0x3'));var rs=require(_0x3634('0x4'));var fs=require('fs');var Redis=require(_0x3634('0x5'));var db=require(_0x3634('0x6'))['db'];var utils=require(_0x3634('0x7'));var logger=require(_0x3634('0x8'))(_0x3634('0x9'));var config=require('../../config/environment');var jayson=require(_0x3634('0xa'));var client=jayson[_0x3634('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2877da,_0x63aedc,_0x51f7f5){return new BPromise(function(_0x3b5a5c,_0x5b4965){return client[_0x3634('0xc')](_0x2877da,_0x51f7f5)['then'](function(_0x261e0e){logger[_0x3634('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x63aedc,'request\x20sent');logger['debug'](_0x3634('0xe'),_0x63aedc,_0x3634('0xf'),JSON['stringify'](_0x261e0e));if(_0x261e0e[_0x3634('0x10')]){if(_0x261e0e[_0x3634('0x10')]['code']===0x1f4){logger[_0x3634('0x10')](_0x3634('0x11'),_0x63aedc,_0x261e0e[_0x3634('0x10')][_0x3634('0x12')]);return _0x5b4965(_0x261e0e['error'][_0x3634('0x12')]);}logger[_0x3634('0x10')](_0x3634('0x11'),_0x63aedc,_0x261e0e[_0x3634('0x10')][_0x3634('0x12')]);return _0x3b5a5c(_0x261e0e[_0x3634('0x10')][_0x3634('0x12')]);}else{logger[_0x3634('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x63aedc,'request\x20sent');_0x3b5a5c(_0x261e0e[_0x3634('0x13')]['message']);}})[_0x3634('0x14')](function(_0x28c419){logger[_0x3634('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x63aedc,_0x28c419);_0x5b4965(_0x28c419);});});}exports['CreateFaxQueueReport']=function(_0x13b140){var _0x1f6680=this;return new Promise(function(_0x1989fd,_0x3d67ca){return db[_0x3634('0x15')][_0x3634('0x16')](_0x13b140[_0x3634('0x17')],{'raw':_0x13b140[_0x3634('0x18')]?_0x13b140[_0x3634('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3634('0x19')](function(_0x689ce6){logger['info'](_0x3634('0x1a'),_0x13b140);logger[_0x3634('0x1b')]('CreateFaxQueueReport',_0x13b140,JSON[_0x3634('0x1c')](_0x689ce6));_0x1989fd(_0x689ce6);})[_0x3634('0x14')](function(_0x1f2b1c){logger[_0x3634('0x10')](_0x3634('0x1a'),_0x1f2b1c[_0x3634('0x12')],_0x13b140);_0x3d67ca(_0x1f6680['error'](0x1f4,_0x1f2b1c[_0x3634('0x12')]));});});};exports[_0x3634('0x1d')]=function(_0x53bf1b){var _0x4ac218=this;return new Promise(function(_0x2901d7,_0x4ed2df){return db['FaxQueueReport'][_0x3634('0x1e')](_0x53bf1b[_0x3634('0x17')],{'raw':_0x53bf1b[_0x3634('0x18')]?_0x53bf1b[_0x3634('0x18')][_0x3634('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53bf1b[_0x3634('0x18')]?_0x53bf1b[_0x3634('0x18')][_0x3634('0x20')]||null:null,'attributes':_0x53bf1b[_0x3634('0x18')]?_0x53bf1b[_0x3634('0x18')][_0x3634('0x21')]||null:null,'limit':_0x53bf1b[_0x3634('0x18')]?_0x53bf1b[_0x3634('0x18')][_0x3634('0x22')]||null:null})[_0x3634('0x19')](function(_0x47fa96){logger[_0x3634('0xd')](_0x3634('0x1d'),_0x53bf1b);logger['debug'](_0x3634('0x1d'),_0x53bf1b,JSON[_0x3634('0x1c')](_0x47fa96));_0x2901d7(_0x47fa96);})['catch'](function(_0x491989){logger['error'](_0x3634('0x1d'),_0x491989['message'],_0x53bf1b);_0x4ed2df(_0x4ac218['error'](0x1f4,_0x491989[_0x3634('0x12')]));});});}; \ No newline at end of file +var _0x262c=['../../config/environment','jayson/promise','client','http','request','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','create','body','options','raw','then','info','stringify','UpdateFaxQueueReport','FaxQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x262c,0xc4));var _0xc262=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x262c[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0xc262('0x0'));var util=require('util');var moment=require(_0xc262('0x1'));var BPromise=require(_0xc262('0x2'));var rs=require(_0xc262('0x3'));var fs=require('fs');var Redis=require(_0xc262('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc262('0x5'));var logger=require(_0xc262('0x6'))(_0xc262('0x7'));var config=require(_0xc262('0x8'));var jayson=require(_0xc262('0x9'));var client=jayson[_0xc262('0xa')][_0xc262('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x455139,_0x5020cd,_0x12addc){return new BPromise(function(_0x5e7b81,_0x491376){return client[_0xc262('0xc')](_0x455139,_0x12addc)['then'](function(_0x213258){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5020cd,'request\x20sent');logger[_0xc262('0xd')](_0xc262('0xe'),_0x5020cd,_0xc262('0xf'),JSON['stringify'](_0x213258));if(_0x213258[_0xc262('0x10')]){if(_0x213258[_0xc262('0x10')]['code']===0x1f4){logger[_0xc262('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x5020cd,_0x213258[_0xc262('0x10')]['message']);return _0x491376(_0x213258[_0xc262('0x10')][_0xc262('0x11')]);}logger['error'](_0xc262('0x12'),_0x5020cd,_0x213258[_0xc262('0x10')][_0xc262('0x11')]);return _0x5e7b81(_0x213258[_0xc262('0x10')][_0xc262('0x11')]);}else{logger['info'](_0xc262('0x12'),_0x5020cd,_0xc262('0xf'));_0x5e7b81(_0x213258[_0xc262('0x13')][_0xc262('0x11')]);}})[_0xc262('0x14')](function(_0x212dae){logger[_0xc262('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x5020cd,_0x212dae);_0x491376(_0x212dae);});});}exports[_0xc262('0x15')]=function(_0x3e8213){var _0x4c6a74=this;return new Promise(function(_0x2aa69a,_0x4ede4e){return db['FaxQueueReport'][_0xc262('0x16')](_0x3e8213[_0xc262('0x17')],{'raw':_0x3e8213[_0xc262('0x18')]?_0x3e8213[_0xc262('0x18')][_0xc262('0x19')]===undefined?!![]:![]:!![]})[_0xc262('0x1a')](function(_0x6588b5){logger[_0xc262('0x1b')](_0xc262('0x15'),_0x3e8213);logger[_0xc262('0xd')](_0xc262('0x15'),_0x3e8213,JSON[_0xc262('0x1c')](_0x6588b5));_0x2aa69a(_0x6588b5);})[_0xc262('0x14')](function(_0x7a8881){logger[_0xc262('0x10')](_0xc262('0x15'),_0x7a8881[_0xc262('0x11')],_0x3e8213);_0x4ede4e(_0x4c6a74[_0xc262('0x10')](0x1f4,_0x7a8881[_0xc262('0x11')]));});});};exports[_0xc262('0x1d')]=function(_0x35ee15){var _0x131f98=this;return new Promise(function(_0x5a6df2,_0x2254d6){return db[_0xc262('0x1e')][_0xc262('0x1f')](_0x35ee15[_0xc262('0x17')],{'raw':_0x35ee15[_0xc262('0x18')]?_0x35ee15[_0xc262('0x18')][_0xc262('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ee15[_0xc262('0x18')]?_0x35ee15[_0xc262('0x18')][_0xc262('0x20')]||null:null,'attributes':_0x35ee15['options']?_0x35ee15[_0xc262('0x18')]['attributes']||null:null,'limit':_0x35ee15[_0xc262('0x18')]?_0x35ee15['options'][_0xc262('0x21')]||null:null})[_0xc262('0x1a')](function(_0x1441ba){logger[_0xc262('0x1b')](_0xc262('0x1d'),_0x35ee15);logger[_0xc262('0xd')](_0xc262('0x1d'),_0x35ee15,JSON['stringify'](_0x1441ba));_0x5a6df2(_0x1441ba);})[_0xc262('0x14')](function(_0x210146){logger[_0xc262('0x10')]('UpdateFaxQueueReport',_0x210146[_0xc262('0x11')],_0x35ee15);_0x2254d6(_0x131f98[_0xc262('0x10')](0x1f4,_0x210146['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index fa823af..3200e5e 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 _0x6c0c=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x6c0c,0x1a5));var _0xc6c0=function(_0xa6b443,_0x3fd555){_0xa6b443=_0xa6b443-0x0;var _0x13bb8a=_0x6c0c[_0xa6b443];return _0x13bb8a;};'use strict';var multer=require('multer');var util=require(_0xc6c0('0x0'));var path=require(_0xc6c0('0x1'));var timeout=require('connect-timeout');var express=require(_0xc6c0('0x2'));var router=express[_0xc6c0('0x3')]();var fs_extra=require(_0xc6c0('0x4'));var auth=require(_0xc6c0('0x5'));var interaction=require(_0xc6c0('0x6'));var config=require(_0xc6c0('0x7'));var controller=require('./faxQueueReport.controller');router[_0xc6c0('0x8')]('/',auth['isAuthenticated'](),controller[_0xc6c0('0x9')]);router[_0xc6c0('0x8')](_0xc6c0('0xa'),auth[_0xc6c0('0xb')](),controller[_0xc6c0('0xc')]);router[_0xc6c0('0x8')](_0xc6c0('0xd'),auth[_0xc6c0('0xb')](),controller[_0xc6c0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc6c0('0xf')]);router[_0xc6c0('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc6c0('0x11')]('/:id',auth[_0xc6c0('0xb')](),controller[_0xc6c0('0x12')]);module[_0xc6c0('0x13')]=router; \ No newline at end of file +var _0xce28=['/describe','describe','get','show','post','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2e4f22,_0x12be60){var _0x19408f=function(_0x20d374){while(--_0x20d374){_0x2e4f22['push'](_0x2e4f22['shift']());}};_0x19408f(++_0x12be60);}(_0xce28,0x11b));var _0x8ce2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xce28[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0x8ce2('0x0'));var util=require(_0x8ce2('0x1'));var path=require(_0x8ce2('0x2'));var timeout=require(_0x8ce2('0x3'));var express=require(_0x8ce2('0x4'));var router=express[_0x8ce2('0x5')]();var fs_extra=require(_0x8ce2('0x6'));var auth=require(_0x8ce2('0x7'));var interaction=require(_0x8ce2('0x8'));var config=require(_0x8ce2('0x9'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x8ce2('0xa')](),controller['index']);router['get'](_0x8ce2('0xb'),auth[_0x8ce2('0xa')](),controller[_0x8ce2('0xc')]);router[_0x8ce2('0xd')]('/:id',auth[_0x8ce2('0xa')](),controller[_0x8ce2('0xe')]);router[_0x8ce2('0xf')]('/',auth[_0x8ce2('0xa')](),controller['create']);router[_0x8ce2('0x10')]('/:id',auth[_0x8ce2('0xa')](),controller['update']);router[_0x8ce2('0x11')](_0x8ce2('0x12'),auth['isAuthenticated'](),controller[_0x8ce2('0x13')]);module[_0x8ce2('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e7787b5..b572b72 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3ebaa4,_0x2e8ec9){_0x3ebaa4=_0x3ebaa4-0x0;var _0x1d65fc=_0xb43b[_0x3ebaa4];return _0x1d65fc;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1ba0bf,_0xc8c1bd){var _0x2a7cf3=function(_0x4b7243){while(--_0x4b7243){_0x1ba0bf['push'](_0x1ba0bf['shift']());}};_0x2a7cf3(++_0xc8c1bd);}(_0xaa88,0x137));var _0x8aa8=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0xaa88[_0x51674a];return _0x13fca6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 3baf133..d41a74d 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 _0x09f1=['save','update','then','destroy','error','stack','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1ad508,_0x24c73b){var _0x272102=function(_0x34919d){while(--_0x34919d){_0x1ad508['push'](_0x1ad508['shift']());}};_0x272102(++_0x24c73b);}(_0x09f1,0x10b));var _0x109f=function(_0x5d917a,_0x3d115a){_0x5d917a=_0x5d917a-0x0;var _0x1d236d=_0x09f1[_0x5d917a];return _0x1d236d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x109f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x109f('0x1'));var rp=require(_0x109f('0x2'));var moment=require(_0x109f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x109f('0x4'));var util=require(_0x109f('0x5'));var path=require(_0x109f('0x6'));var sox=require(_0x109f('0x7'));var csv=require(_0x109f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x109f('0x9'));var _=require('lodash');var squel=require(_0x109f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x109f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x109f('0xc'));var Papa=require('papaparse');var Redis=require(_0x109f('0xd'));var authService=require(_0x109f('0xe'));var qs=require(_0x109f('0xf'));var as=require(_0x109f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x109f('0x11'))('api');var utils=require(_0x109f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x109f('0x13'));var db=require(_0x109f('0x14'))['db'];function respondWithStatusCode(_0x547dce,_0x3964ca){_0x3964ca=_0x3964ca||0xcc;return function(_0xf273cc){if(_0xf273cc){return _0x547dce[_0x109f('0x15')](_0x3964ca);}return _0x547dce['status'](_0x3964ca)[_0x109f('0x16')]();};}function respondWithResult(_0x297872,_0x1baf49){_0x1baf49=_0x1baf49||0xc8;return function(_0x4c1663){if(_0x4c1663){return _0x297872[_0x109f('0x17')](_0x1baf49)[_0x109f('0x18')](_0x4c1663);}};}function respondWithFilteredResult(_0x2a27af,_0x5568b6){return function(_0x5fd6ba){if(_0x5fd6ba){var _0x490267=typeof _0x5568b6[_0x109f('0x19')]===_0x109f('0x1a')&&typeof _0x5568b6[_0x109f('0x1b')]===_0x109f('0x1a');var _0x1d8661=_0x5fd6ba[_0x109f('0x1c')];var _0x244f4d=_0x490267?0x0:_0x5568b6['offset'];var _0x3a4819=_0x490267?_0x5fd6ba[_0x109f('0x1c')]:_0x5568b6[_0x109f('0x19')]+_0x5568b6['limit'];var _0x44a8de;if(_0x3a4819>=_0x1d8661){_0x3a4819=_0x1d8661;_0x44a8de=0xc8;}else{_0x44a8de=0xce;}_0x2a27af[_0x109f('0x17')](_0x44a8de);return _0x2a27af[_0x109f('0x1d')](_0x109f('0x1e'),_0x244f4d+'-'+_0x3a4819+'/'+_0x1d8661)['json'](_0x5fd6ba);}return null;};}function patchUpdates(_0x4edfde){return function(_0x474338){try{jsonpatch[_0x109f('0x1f')](_0x474338,_0x4edfde,!![]);}catch(_0xdc2818){return BPromise[_0x109f('0x20')](_0xdc2818);}return _0x474338[_0x109f('0x21')]();};}function saveUpdates(_0x230764,_0x267bb4){return function(_0x11c8cd){if(_0x11c8cd){return _0x11c8cd[_0x109f('0x22')](_0x230764)[_0x109f('0x23')](function(_0x217b0e){return _0x217b0e;});}return null;};}function removeEntity(_0x44c190,_0x1fc9e0){return function(_0x2cf910){if(_0x2cf910){return _0x2cf910[_0x109f('0x24')]()[_0x109f('0x23')](function(){_0x44c190['status'](0xcc)[_0x109f('0x16')]();});}};}function handleEntityNotFound(_0x5e0862,_0x3ad353){return function(_0xc5279e){if(!_0xc5279e){_0x5e0862[_0x109f('0x15')](0x194);}return _0xc5279e;};}function handleError(_0x532972,_0x7fa005){_0x7fa005=_0x7fa005||0x1f4;return function(_0x46ff8c){logger[_0x109f('0x25')](_0x46ff8c[_0x109f('0x26')]);if(_0x46ff8c['name']){delete _0x46ff8c['name'];}_0x532972[_0x109f('0x17')](_0x7fa005)[_0x109f('0x27')](_0x46ff8c);};}exports[_0x109f('0x28')]=function(_0x488a6a,_0x4e9342){var _0x1a7410={},_0x10e1bc={},_0x228df9={'count':0x0,'rows':[]};var _0x131242=_['map'](db[_0x109f('0x29')][_0x109f('0x2a')],function(_0x58953b){return{'name':_0x58953b[_0x109f('0x2b')],'type':_0x58953b[_0x109f('0x2c')][_0x109f('0x2d')]};});_0x10e1bc[_0x109f('0x2e')]=_[_0x109f('0x2f')](_0x131242,_0x109f('0x30'));_0x10e1bc[_0x109f('0x31')]=_['keys'](_0x488a6a['query']);_0x10e1bc['filters']=_[_0x109f('0x32')](_0x10e1bc[_0x109f('0x2e')],_0x10e1bc[_0x109f('0x31')]);_0x1a7410[_0x109f('0x33')]=_[_0x109f('0x32')](_0x10e1bc['model'],qs[_0x109f('0x34')](_0x488a6a['query']['fields']));_0x1a7410['attributes']=_0x1a7410['attributes']['length']?_0x1a7410[_0x109f('0x33')]:_0x10e1bc['model'];if(!_0x488a6a[_0x109f('0x31')][_0x109f('0x35')](_0x109f('0x36'))){_0x1a7410[_0x109f('0x1b')]=qs['limit'](_0x488a6a[_0x109f('0x31')][_0x109f('0x1b')]);_0x1a7410[_0x109f('0x19')]=qs[_0x109f('0x19')](_0x488a6a[_0x109f('0x31')][_0x109f('0x19')]);}_0x1a7410[_0x109f('0x37')]=qs[_0x109f('0x38')](_0x488a6a[_0x109f('0x31')][_0x109f('0x38')]);_0x1a7410[_0x109f('0x39')]=qs[_0x109f('0x3a')](_['pick'](_0x488a6a['query'],_0x10e1bc[_0x109f('0x3a')]),_0x131242);if(_0x488a6a['query'][_0x109f('0x3b')]){_0x1a7410[_0x109f('0x39')]=_[_0x109f('0x3c')](_0x1a7410[_0x109f('0x39')],{'$or':_[_0x109f('0x2f')](_0x131242,function(_0x5935c0){if(_0x5935c0[_0x109f('0x2c')]!=='VIRTUAL'){var _0x287cee={};_0x287cee[_0x5935c0[_0x109f('0x30')]]={'$like':'%'+_0x488a6a[_0x109f('0x31')]['filter']+'%'};return _0x287cee;}})});}_0x1a7410=_['merge']({},_0x1a7410,_0x488a6a[_0x109f('0x3d')]);var _0x34e9ec={'where':_0x1a7410['where']};return db[_0x109f('0x29')]['count'](_0x34e9ec)[_0x109f('0x23')](function(_0x37c49f){_0x228df9['count']=_0x37c49f;if(_0x488a6a[_0x109f('0x31')][_0x109f('0x3e')]){_0x1a7410[_0x109f('0x3f')]=[{'all':!![]}];}return db[_0x109f('0x29')][_0x109f('0x40')](_0x1a7410);})[_0x109f('0x23')](function(_0x395b0e){_0x228df9[_0x109f('0x41')]=_0x395b0e;return _0x228df9;})[_0x109f('0x23')](respondWithFilteredResult(_0x4e9342,_0x1a7410))[_0x109f('0x42')](handleError(_0x4e9342,null));};exports[_0x109f('0x43')]=function(_0x3613b7,_0x56f2d4){var _0x1fa782={'raw':!![],'where':{'id':_0x3613b7[_0x109f('0x44')]['id']}},_0xff1087={};_0xff1087[_0x109f('0x2e')]=_[_0x109f('0x45')](db['FaxTransferReport'][_0x109f('0x2a')]);_0xff1087[_0x109f('0x31')]=_[_0x109f('0x45')](_0x3613b7['query']);_0xff1087[_0x109f('0x3a')]=_[_0x109f('0x32')](_0xff1087['model'],_0xff1087[_0x109f('0x31')]);_0x1fa782[_0x109f('0x33')]=_['intersection'](_0xff1087[_0x109f('0x2e')],qs[_0x109f('0x34')](_0x3613b7[_0x109f('0x31')][_0x109f('0x34')]));_0x1fa782[_0x109f('0x33')]=_0x1fa782[_0x109f('0x33')][_0x109f('0x46')]?_0x1fa782[_0x109f('0x33')]:_0xff1087[_0x109f('0x2e')];if(_0x3613b7[_0x109f('0x31')][_0x109f('0x3e')]){_0x1fa782[_0x109f('0x3f')]=[{'all':!![]}];}_0x1fa782=_['merge']({},_0x1fa782,_0x3613b7['options']);return db[_0x109f('0x29')][_0x109f('0x47')](_0x1fa782)['then'](handleEntityNotFound(_0x56f2d4,null))[_0x109f('0x23')](respondWithResult(_0x56f2d4,null))[_0x109f('0x42')](handleError(_0x56f2d4,null));};exports['create']=function(_0x349176,_0x4c815d){return db[_0x109f('0x29')][_0x109f('0x48')](_0x349176['body'],{})[_0x109f('0x23')](respondWithResult(_0x4c815d,0xc9))['catch'](handleError(_0x4c815d,null));};exports[_0x109f('0x22')]=function(_0x3654f2,_0x9284e1){if(_0x3654f2[_0x109f('0x49')]['id']){delete _0x3654f2[_0x109f('0x49')]['id'];}return db['FaxTransferReport'][_0x109f('0x47')]({'where':{'id':_0x3654f2['params']['id']}})[_0x109f('0x23')](handleEntityNotFound(_0x9284e1,null))[_0x109f('0x23')](saveUpdates(_0x3654f2[_0x109f('0x49')],null))[_0x109f('0x23')](respondWithResult(_0x9284e1,null))['catch'](handleError(_0x9284e1,null));};exports[_0x109f('0x24')]=function(_0x250df0,_0x40e22e){return db['FaxTransferReport'][_0x109f('0x47')]({'where':{'id':_0x250df0[_0x109f('0x44')]['id']}})[_0x109f('0x23')](handleEntityNotFound(_0x40e22e,null))['then'](removeEntity(_0x40e22e,null))[_0x109f('0x42')](handleError(_0x40e22e,null));};exports['describe']=function(_0x25934b,_0x375ba5){return db['FaxTransferReport'][_0x109f('0x4a')]()[_0x109f('0x23')](respondWithResult(_0x375ba5,null))['catch'](handleError(_0x375ba5,null));}; \ No newline at end of file +var _0x7833=['update','then','destroy','end','sendStatus','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','show','include','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x7833,0x161));var _0x3783=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x7833[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3783('0x0'));var zipdir=require(_0x3783('0x1'));var jsonpatch=require(_0x3783('0x2'));var rp=require(_0x3783('0x3'));var moment=require(_0x3783('0x4'));var BPromise=require(_0x3783('0x5'));var Mustache=require('mustache');var util=require(_0x3783('0x6'));var path=require('path');var sox=require(_0x3783('0x7'));var csv=require(_0x3783('0x8'));var ejs=require(_0x3783('0x9'));var fs=require('fs');var fs_extra=require(_0x3783('0xa'));var _=require(_0x3783('0xb'));var squel=require(_0x3783('0xc'));var crypto=require(_0x3783('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3783('0xe'));var toCsv=require(_0x3783('0x8'));var querystring=require(_0x3783('0xf'));var Papa=require(_0x3783('0x10'));var Redis=require(_0x3783('0x11'));var authService=require(_0x3783('0x12'));var qs=require(_0x3783('0x13'));var as=require(_0x3783('0x14'));var hardwareService=require(_0x3783('0x15'));var logger=require('../../config/logger')(_0x3783('0x16'));var utils=require(_0x3783('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3783('0x18'));var db=require(_0x3783('0x19'))['db'];function respondWithStatusCode(_0x491cac,_0x4ec287){_0x4ec287=_0x4ec287||0xcc;return function(_0x2316f1){if(_0x2316f1){return _0x491cac['sendStatus'](_0x4ec287);}return _0x491cac['status'](_0x4ec287)['end']();};}function respondWithResult(_0x1e91d0,_0x561823){_0x561823=_0x561823||0xc8;return function(_0x4c577f){if(_0x4c577f){return _0x1e91d0[_0x3783('0x1a')](_0x561823)[_0x3783('0x1b')](_0x4c577f);}};}function respondWithFilteredResult(_0x5c1f7a,_0x2ac772){return function(_0x41d7f6){if(_0x41d7f6){var _0x4340ce=typeof _0x2ac772[_0x3783('0x1c')]===_0x3783('0x1d')&&typeof _0x2ac772['limit']===_0x3783('0x1d');var _0x4e361a=_0x41d7f6[_0x3783('0x1e')];var _0x33aaab=_0x4340ce?0x0:_0x2ac772[_0x3783('0x1c')];var _0x58ca06=_0x4340ce?_0x41d7f6[_0x3783('0x1e')]:_0x2ac772[_0x3783('0x1c')]+_0x2ac772[_0x3783('0x1f')];var _0x2828e9;if(_0x58ca06>=_0x4e361a){_0x58ca06=_0x4e361a;_0x2828e9=0xc8;}else{_0x2828e9=0xce;}_0x5c1f7a[_0x3783('0x1a')](_0x2828e9);return _0x5c1f7a[_0x3783('0x20')](_0x3783('0x21'),_0x33aaab+'-'+_0x58ca06+'/'+_0x4e361a)[_0x3783('0x1b')](_0x41d7f6);}return null;};}function patchUpdates(_0xb6bc77){return function(_0x3a036a){try{jsonpatch[_0x3783('0x22')](_0x3a036a,_0xb6bc77,!![]);}catch(_0xea4708){return BPromise[_0x3783('0x23')](_0xea4708);}return _0x3a036a[_0x3783('0x24')]();};}function saveUpdates(_0x1251b2,_0x2e2722){return function(_0x1547a3){if(_0x1547a3){return _0x1547a3[_0x3783('0x25')](_0x1251b2)[_0x3783('0x26')](function(_0x2d89d1){return _0x2d89d1;});}return null;};}function removeEntity(_0x57f8a9,_0x4a9839){return function(_0x551161){if(_0x551161){return _0x551161[_0x3783('0x27')]()[_0x3783('0x26')](function(){_0x57f8a9[_0x3783('0x1a')](0xcc)[_0x3783('0x28')]();});}};}function handleEntityNotFound(_0x14399e,_0x9658df){return function(_0xb27486){if(!_0xb27486){_0x14399e[_0x3783('0x29')](0x194);}return _0xb27486;};}function handleError(_0x904cf8,_0x25cc65){_0x25cc65=_0x25cc65||0x1f4;return function(_0x57ab19){logger[_0x3783('0x2a')](_0x57ab19['stack']);if(_0x57ab19[_0x3783('0x2b')]){delete _0x57ab19[_0x3783('0x2b')];}_0x904cf8[_0x3783('0x1a')](_0x25cc65)['send'](_0x57ab19);};}exports[_0x3783('0x2c')]=function(_0x34925,_0x8f5d6f){var _0x51e17e={},_0x359e88={},_0x5690b6={'count':0x0,'rows':[]};var _0x84fc3d=_[_0x3783('0x2d')](db[_0x3783('0x2e')][_0x3783('0x2f')],function(_0x406156){return{'name':_0x406156[_0x3783('0x30')],'type':_0x406156[_0x3783('0x31')][_0x3783('0x32')]};});_0x359e88[_0x3783('0x33')]=_[_0x3783('0x2d')](_0x84fc3d,_0x3783('0x2b'));_0x359e88[_0x3783('0x34')]=_[_0x3783('0x35')](_0x34925[_0x3783('0x34')]);_0x359e88[_0x3783('0x36')]=_[_0x3783('0x37')](_0x359e88[_0x3783('0x33')],_0x359e88['query']);_0x51e17e['attributes']=_[_0x3783('0x37')](_0x359e88[_0x3783('0x33')],qs['fields'](_0x34925[_0x3783('0x34')][_0x3783('0x38')]));_0x51e17e['attributes']=_0x51e17e[_0x3783('0x39')][_0x3783('0x3a')]?_0x51e17e[_0x3783('0x39')]:_0x359e88[_0x3783('0x33')];if(!_0x34925[_0x3783('0x34')][_0x3783('0x3b')]('nolimit')){_0x51e17e[_0x3783('0x1f')]=qs[_0x3783('0x1f')](_0x34925['query'][_0x3783('0x1f')]);_0x51e17e['offset']=qs['offset'](_0x34925[_0x3783('0x34')][_0x3783('0x1c')]);}_0x51e17e[_0x3783('0x3c')]=qs[_0x3783('0x3d')](_0x34925[_0x3783('0x34')][_0x3783('0x3d')]);_0x51e17e['where']=qs[_0x3783('0x36')](_[_0x3783('0x3e')](_0x34925[_0x3783('0x34')],_0x359e88[_0x3783('0x36')]),_0x84fc3d);if(_0x34925[_0x3783('0x34')][_0x3783('0x3f')]){_0x51e17e[_0x3783('0x40')]=_['merge'](_0x51e17e['where'],{'$or':_['map'](_0x84fc3d,function(_0x5ea56a){if(_0x5ea56a[_0x3783('0x31')]!==_0x3783('0x41')){var _0x59c292={};_0x59c292[_0x5ea56a[_0x3783('0x2b')]]={'$like':'%'+_0x34925['query']['filter']+'%'};return _0x59c292;}})});}_0x51e17e=_[_0x3783('0x42')]({},_0x51e17e,_0x34925['options']);var _0x5bee89={'where':_0x51e17e[_0x3783('0x40')]};return db[_0x3783('0x2e')][_0x3783('0x1e')](_0x5bee89)[_0x3783('0x26')](function(_0x30db06){_0x5690b6[_0x3783('0x1e')]=_0x30db06;if(_0x34925[_0x3783('0x34')][_0x3783('0x43')]){_0x51e17e['include']=[{'all':!![]}];}return db[_0x3783('0x2e')][_0x3783('0x44')](_0x51e17e);})[_0x3783('0x26')](function(_0x34a5d9){_0x5690b6[_0x3783('0x45')]=_0x34a5d9;return _0x5690b6;})[_0x3783('0x26')](respondWithFilteredResult(_0x8f5d6f,_0x51e17e))[_0x3783('0x46')](handleError(_0x8f5d6f,null));};exports[_0x3783('0x47')]=function(_0x57726f,_0x5f272a){var _0x3ad45e={'raw':!![],'where':{'id':_0x57726f['params']['id']}},_0xed5a36={};_0xed5a36['model']=_[_0x3783('0x35')](db[_0x3783('0x2e')][_0x3783('0x2f')]);_0xed5a36[_0x3783('0x34')]=_[_0x3783('0x35')](_0x57726f[_0x3783('0x34')]);_0xed5a36['filters']=_['intersection'](_0xed5a36[_0x3783('0x33')],_0xed5a36[_0x3783('0x34')]);_0x3ad45e['attributes']=_['intersection'](_0xed5a36[_0x3783('0x33')],qs[_0x3783('0x38')](_0x57726f[_0x3783('0x34')][_0x3783('0x38')]));_0x3ad45e[_0x3783('0x39')]=_0x3ad45e[_0x3783('0x39')][_0x3783('0x3a')]?_0x3ad45e[_0x3783('0x39')]:_0xed5a36[_0x3783('0x33')];if(_0x57726f['query'][_0x3783('0x43')]){_0x3ad45e[_0x3783('0x48')]=[{'all':!![]}];}_0x3ad45e=_[_0x3783('0x42')]({},_0x3ad45e,_0x57726f[_0x3783('0x49')]);return db[_0x3783('0x2e')][_0x3783('0x4a')](_0x3ad45e)['then'](handleEntityNotFound(_0x5f272a,null))[_0x3783('0x26')](respondWithResult(_0x5f272a,null))[_0x3783('0x46')](handleError(_0x5f272a,null));};exports[_0x3783('0x4b')]=function(_0x4a0665,_0x4fe2cf){return db[_0x3783('0x2e')][_0x3783('0x4b')](_0x4a0665[_0x3783('0x4c')],{})[_0x3783('0x26')](respondWithResult(_0x4fe2cf,0xc9))[_0x3783('0x46')](handleError(_0x4fe2cf,null));};exports[_0x3783('0x25')]=function(_0x4b1db5,_0x33a667){if(_0x4b1db5['body']['id']){delete _0x4b1db5['body']['id'];}return db[_0x3783('0x2e')][_0x3783('0x4a')]({'where':{'id':_0x4b1db5['params']['id']}})[_0x3783('0x26')](handleEntityNotFound(_0x33a667,null))[_0x3783('0x26')](saveUpdates(_0x4b1db5[_0x3783('0x4c')],null))['then'](respondWithResult(_0x33a667,null))[_0x3783('0x46')](handleError(_0x33a667,null));};exports[_0x3783('0x27')]=function(_0x543d07,_0x388725){return db['FaxTransferReport'][_0x3783('0x4a')]({'where':{'id':_0x543d07['params']['id']}})['then'](handleEntityNotFound(_0x388725,null))[_0x3783('0x26')](removeEntity(_0x388725,null))['catch'](handleError(_0x388725,null));};exports[_0x3783('0x4d')]=function(_0x5f63c4,_0x23b564){return db[_0x3783('0x2e')]['describe']()[_0x3783('0x26')](respondWithResult(_0x23b564,null))[_0x3783('0x46')](handleError(_0x23b564,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3ccec55..ad0ef5e 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 _0x251e=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','request-promise','path','../../config/environment','./faxTransferReport.attributes'];(function(_0x2f122b,_0x1daa2c){var _0x54c1a8=function(_0x379456){while(--_0x379456){_0x2f122b['push'](_0x2f122b['shift']());}};_0x54c1a8(++_0x1daa2c);}(_0x251e,0x102));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe251('0x0'));var logger=require(_0xe251('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe251('0x2'));var fs=require('fs');var path=require(_0xe251('0x3'));var rimraf=require('rimraf');var config=require(_0xe251('0x4'));var attributes=require(_0xe251('0x5'));module[_0xe251('0x6')]=function(_0xd86854,_0x34cb58){return _0xd86854[_0xe251('0x7')](_0xe251('0x8'),attributes,{'tableName':_0xe251('0x9'),'paranoid':![],'indexes':[{'name':_0xe251('0xa'),'fields':[_0xe251('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x03be=['exports','define','FaxTransferReport','report_fax_transfer','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes'];(function(_0x5f58bb,_0x3f0bad){var _0xcc672d=function(_0x4a0765){while(--_0x4a0765){_0x5f58bb['push'](_0x5f58bb['shift']());}};_0xcc672d(++_0x3f0bad);}(_0x03be,0xe8));var _0xe03b=function(_0x174304,_0x58beb2){_0x174304=_0x174304-0x0;var _0x6576ed=_0x03be[_0x174304];return _0x6576ed;};'use strict';var _=require(_0xe03b('0x0'));var util=require(_0xe03b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe03b('0x2'));var BPromise=require(_0xe03b('0x3'));var rp=require(_0xe03b('0x4'));var fs=require('fs');var path=require(_0xe03b('0x5'));var rimraf=require('rimraf');var config=require(_0xe03b('0x6'));var attributes=require(_0xe03b('0x7'));module[_0xe03b('0x8')]=function(_0x3a5909,_0x687eca){return _0x3a5909[_0xe03b('0x9')](_0xe03b('0xa'),attributes,{'tableName':_0xe03b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2417a28..9b55238 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 _0x02d5=['../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x548789,_0x9aff00){var _0x473ed1=function(_0x52be1a){while(--_0x52be1a){_0x548789['push'](_0x548789['shift']());}};_0x473ed1(++_0x9aff00);}(_0x02d5,0x94));var _0x502d=function(_0x2c78df,_0x20abba){_0x2c78df=_0x2c78df-0x0;var _0x50912=_0x02d5[_0x2c78df];return _0x50912;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x502d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x502d('0x1'));var db=require(_0x502d('0x2'))['db'];var utils=require(_0x502d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x502d('0x4'));var jayson=require(_0x502d('0x5'));var client=jayson[_0x502d('0x6')][_0x502d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f63c2,_0x446aed,_0x4b480f){return new BPromise(function(_0x578f2e,_0x316cf5){return client[_0x502d('0x8')](_0x5f63c2,_0x4b480f)[_0x502d('0x9')](function(_0x25ec81){logger[_0x502d('0xa')](_0x502d('0xb'),_0x446aed,_0x502d('0xc'));logger[_0x502d('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x446aed,_0x502d('0xc'),JSON[_0x502d('0xe')](_0x25ec81));if(_0x25ec81[_0x502d('0xf')]){if(_0x25ec81[_0x502d('0xf')][_0x502d('0x10')]===0x1f4){logger[_0x502d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x446aed,_0x25ec81[_0x502d('0xf')][_0x502d('0x11')]);return _0x316cf5(_0x25ec81[_0x502d('0xf')][_0x502d('0x11')]);}logger['error'](_0x502d('0xb'),_0x446aed,_0x25ec81[_0x502d('0xf')][_0x502d('0x11')]);return _0x578f2e(_0x25ec81[_0x502d('0xf')]['message']);}else{logger[_0x502d('0xa')](_0x502d('0xb'),_0x446aed,_0x502d('0xc'));_0x578f2e(_0x25ec81[_0x502d('0x12')][_0x502d('0x11')]);}})['catch'](function(_0x39bdba){logger[_0x502d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x446aed,_0x39bdba);_0x316cf5(_0x39bdba);});});} \ No newline at end of file +var _0x09aa=['util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x31378d,_0xa19cb7){var _0x1fa10a=function(_0x2977b8){while(--_0x2977b8){_0x31378d['push'](_0x31378d['shift']());}};_0x1fa10a(++_0xa19cb7);}(_0x09aa,0xc5));var _0xa09a=function(_0x32d8f6,_0x153146){_0x32d8f6=_0x32d8f6-0x0;var _0x4d6740=_0x09aa[_0x32d8f6];return _0x4d6740;};'use strict';var _=require(_0xa09a('0x0'));var util=require(_0xa09a('0x1'));var moment=require('moment');var BPromise=require(_0xa09a('0x2'));var rs=require(_0xa09a('0x3'));var fs=require('fs');var Redis=require(_0xa09a('0x4'));var db=require(_0xa09a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa09a('0x6'));var config=require(_0xa09a('0x7'));var jayson=require(_0xa09a('0x8'));var client=jayson[_0xa09a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x530983,_0x4db7f4,_0x141fef){return new BPromise(function(_0x48954c,_0x2042cc){return client[_0xa09a('0xa')](_0x530983,_0x141fef)[_0xa09a('0xb')](function(_0x3b007d){logger[_0xa09a('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x4db7f4,_0xa09a('0xd'));logger['debug'](_0xa09a('0xe'),_0x4db7f4,_0xa09a('0xd'),JSON[_0xa09a('0xf')](_0x3b007d));if(_0x3b007d[_0xa09a('0x10')]){if(_0x3b007d[_0xa09a('0x10')][_0xa09a('0x11')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x4db7f4,_0x3b007d[_0xa09a('0x10')][_0xa09a('0x12')]);return _0x2042cc(_0x3b007d[_0xa09a('0x10')]['message']);}logger['error'](_0xa09a('0x13'),_0x4db7f4,_0x3b007d['error'][_0xa09a('0x12')]);return _0x48954c(_0x3b007d[_0xa09a('0x10')][_0xa09a('0x12')]);}else{logger[_0xa09a('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x4db7f4,'request\x20sent');_0x48954c(_0x3b007d[_0xa09a('0x14')][_0xa09a('0x12')]);}})[_0xa09a('0x15')](function(_0x19053c){logger['error'](_0xa09a('0x13'),_0x4db7f4,_0x19053c);_0x2042cc(_0x19053c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d185953..04fe986 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 _0x2721=['show','post','create','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x29ee54,_0x4aa62f){var _0x522678=function(_0x215826){while(--_0x215826){_0x29ee54['push'](_0x29ee54['shift']());}};_0x522678(++_0x4aa62f);}(_0x2721,0x171));var _0x1272=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x2721[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1272('0x0'));var express=require(_0x1272('0x1'));var router=express[_0x1272('0x2')]();var fs_extra=require(_0x1272('0x3'));var auth=require(_0x1272('0x4'));var interaction=require(_0x1272('0x5'));var config=require(_0x1272('0x6'));var controller=require(_0x1272('0x7'));router[_0x1272('0x8')]('/',auth[_0x1272('0x9')](),controller['index']);router[_0x1272('0x8')](_0x1272('0xa'),auth[_0x1272('0x9')](),controller['describe']);router[_0x1272('0x8')]('/:id',auth[_0x1272('0x9')](),controller[_0x1272('0xb')]);router[_0x1272('0xc')]('/',auth[_0x1272('0x9')](),controller[_0x1272('0xd')]);router[_0x1272('0xe')](_0x1272('0xf'),auth[_0x1272('0x9')](),controller[_0x1272('0x10')]);router[_0x1272('0x11')](_0x1272('0xf'),auth[_0x1272('0x9')](),controller[_0x1272('0x12')]);module[_0x1272('0x13')]=router; \ No newline at end of file +var _0x3c3c=['/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x3c3c,0x190));var _0xc3c3=function(_0x2864a8,_0xb9c1b3){_0x2864a8=_0x2864a8-0x0;var _0x5ea7a8=_0x3c3c[_0x2864a8];return _0x5ea7a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3c3('0x0'));var timeout=require(_0xc3c3('0x1'));var express=require(_0xc3c3('0x2'));var router=express[_0xc3c3('0x3')]();var fs_extra=require(_0xc3c3('0x4'));var auth=require(_0xc3c3('0x5'));var interaction=require(_0xc3c3('0x6'));var config=require(_0xc3c3('0x7'));var controller=require(_0xc3c3('0x8'));router[_0xc3c3('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c3('0xa')]);router[_0xc3c3('0x9')](_0xc3c3('0xb'),auth[_0xc3c3('0xc')](),controller[_0xc3c3('0xd')]);router['get'](_0xc3c3('0xe'),auth[_0xc3c3('0xc')](),controller[_0xc3c3('0xf')]);router[_0xc3c3('0x10')]('/',auth[_0xc3c3('0xc')](),controller[_0xc3c3('0x11')]);router[_0xc3c3('0x12')](_0xc3c3('0xe'),auth['isAuthenticated'](),controller[_0xc3c3('0x13')]);router[_0xc3c3('0x14')](_0xc3c3('0xe'),auth[_0xc3c3('0xc')](),controller[_0xc3c3('0x15')]);module[_0xc3c3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index aefa29e..22354d7 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 _0x893e=['/:id/configurations','get','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show'];(function(_0x226f63,_0x5c348d){var _0x411da7=function(_0x61919c){while(--_0x61919c){_0x226f63['push'](_0x226f63['shift']());}};_0x411da7(++_0x5c348d);}(_0x893e,0x8f));var _0xe893=function(_0x399fcb,_0x302cad){_0x399fcb=_0x399fcb-0x0;var _0x4d5f0f=_0x893e[_0x399fcb];return _0x4d5f0f;};'use strict';var multer=require(_0xe893('0x0'));var util=require(_0xe893('0x1'));var path=require(_0xe893('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe893('0x3'));var interaction=require(_0xe893('0x4'));var config=require(_0xe893('0x5'));var controller=require(_0xe893('0x6'));router['get']('/',auth[_0xe893('0x7')](),controller[_0xe893('0x8')]);router['get'](_0xe893('0x9'),auth['isAuthenticated'](),controller[_0xe893('0xa')]);router['get'](_0xe893('0xb'),auth[_0xe893('0x7')](),controller['getConfigurations']);router[_0xe893('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe893('0xd')]);router[_0xe893('0xe')]('/',auth[_0xe893('0x7')](),controller[_0xe893('0xf')]);router[_0xe893('0xe')](_0xe893('0xb'),auth[_0xe893('0x7')](),controller[_0xe893('0x10')]);router[_0xe893('0x11')](_0xe893('0x9'),auth['isAuthenticated'](),controller[_0xe893('0x12')]);router[_0xe893('0x13')](_0xe893('0x9'),auth[_0xe893('0x7')](),controller[_0xe893('0x14')]);module[_0xe893('0x15')]=router; \ No newline at end of file +var _0xa807=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xa807,0xfd));var _0x7a80=function(_0x415f3e,_0x4db815){_0x415f3e=_0x415f3e-0x0;var _0x488126=_0xa807[_0x415f3e];return _0x488126;};'use strict';var multer=require(_0x7a80('0x0'));var util=require(_0x7a80('0x1'));var path=require(_0x7a80('0x2'));var timeout=require(_0x7a80('0x3'));var express=require(_0x7a80('0x4'));var router=express[_0x7a80('0x5')]();var fs_extra=require(_0x7a80('0x6'));var auth=require(_0x7a80('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7a80('0x8'));var controller=require(_0x7a80('0x9'));router[_0x7a80('0xa')]('/',auth[_0x7a80('0xb')](),controller['index']);router[_0x7a80('0xa')](_0x7a80('0xc'),auth[_0x7a80('0xb')](),controller[_0x7a80('0xd')]);router[_0x7a80('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7a80('0xe')]);router[_0x7a80('0xa')](_0x7a80('0xf'),auth[_0x7a80('0xb')](),controller[_0x7a80('0x10')]);router[_0x7a80('0x11')]('/',auth[_0x7a80('0xb')](),controller[_0x7a80('0x12')]);router[_0x7a80('0x11')](_0x7a80('0x13'),auth['isAuthenticated'](),controller[_0x7a80('0x14')]);router[_0x7a80('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x7a80('0x16')]);router['delete']('/:id',auth[_0x7a80('0xb')](),controller[_0x7a80('0x17')]);module[_0x7a80('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 4690236..ec77add 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 _0xf43e=['newTab','STRING','ENUM','basic','integrationTab'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf43e,0x11e));var _0xef43=function(_0x2b3c4b,_0x39f890){_0x2b3c4b=_0x2b3c4b-0x0;var _0x406119=_0xf43e[_0x2b3c4b];return _0x406119;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef43('0x0')]},'username':{'type':Sequelize[_0xef43('0x0')]},'remoteUri':{'type':Sequelize[_0xef43('0x0')]},'authType':{'type':Sequelize[_0xef43('0x1')]('basic'),'defaultValue':_0xef43('0x2')},'password':{'type':Sequelize[_0xef43('0x0')]},'consumerKey':{'type':Sequelize[_0xef43('0x0')]},'consumerSecret':{'type':Sequelize[_0xef43('0x0')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xef43('0x3'),_0xef43('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x71c2=['ENUM','integrationTab','sequelize','STRING','basic'];(function(_0x4bf391,_0x33f81a){var _0x44588c=function(_0x2ea177){while(--_0x2ea177){_0x4bf391['push'](_0x4bf391['shift']());}};_0x44588c(++_0x33f81a);}(_0x71c2,0x17e));var _0x271c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x271c('0x0'));module['exports']={'name':{'type':Sequelize[_0x271c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x271c('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x271c('0x2')),'defaultValue':_0x271c('0x2')},'password':{'type':Sequelize[_0x271c('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x271c('0x1')]},'serverUrl':{'type':Sequelize[_0x271c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x271c('0x3')](_0x271c('0x4'),'newTab'),'defaultValue':_0x271c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 96cdd97..f4ee88c 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 _0x5fe3=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','DeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra'];(function(_0x3a8ff1,_0x2b6227){var _0x47ffa7=function(_0x3ba48f){while(--_0x3ba48f){_0x3a8ff1['push'](_0x3a8ff1['shift']());}};_0x47ffa7(++_0x2b6227);}(_0x5fe3,0x6b));var _0x35fe=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x5fe3[_0x297eea];return _0x1c42d2;};'use strict';var emlformat=require(_0x35fe('0x0'));var rimraf=require(_0x35fe('0x1'));var zipdir=require(_0x35fe('0x2'));var jsonpatch=require(_0x35fe('0x3'));var rp=require(_0x35fe('0x4'));var moment=require(_0x35fe('0x5'));var BPromise=require(_0x35fe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x35fe('0x7'));var sox=require(_0x35fe('0x8'));var csv=require(_0x35fe('0x9'));var ejs=require(_0x35fe('0xa'));var fs=require('fs');var fs_extra=require(_0x35fe('0xb'));var _=require(_0x35fe('0xc'));var squel=require(_0x35fe('0xd'));var crypto=require('crypto');var jsforce=require(_0x35fe('0xe'));var deskjs=require(_0x35fe('0xf'));var toCsv=require(_0x35fe('0x9'));var querystring=require(_0x35fe('0x10'));var Papa=require(_0x35fe('0x11'));var Redis=require(_0x35fe('0x12'));var authService=require(_0x35fe('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x35fe('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fe('0x15'))('api');var utils=require(_0x35fe('0x16'));var config=require(_0x35fe('0x17'));var licenseUtil=require(_0x35fe('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x35fe('0x19'));function respondWithStatusCode(_0x288e76,_0x33bcf7){_0x33bcf7=_0x33bcf7||0xcc;return function(_0x2939f3){if(_0x2939f3){return _0x288e76[_0x35fe('0x1a')](_0x33bcf7);}return _0x288e76['status'](_0x33bcf7)[_0x35fe('0x1b')]();};}function respondWithResult(_0x5081aa,_0x3c3ef5){_0x3c3ef5=_0x3c3ef5||0xc8;return function(_0x574e4e){if(_0x574e4e){return _0x5081aa['status'](_0x3c3ef5)[_0x35fe('0x1c')](_0x574e4e);}};}function respondWithFilteredResult(_0x40a274,_0x11b684){return function(_0x3afc1c){if(_0x3afc1c){var _0x23dffb=typeof _0x11b684[_0x35fe('0x1d')]===_0x35fe('0x1e')&&typeof _0x11b684[_0x35fe('0x1f')]===_0x35fe('0x1e');var _0x3613b5=_0x3afc1c['count'];var _0xaa4a93=_0x23dffb?0x0:_0x11b684['offset'];var _0x281bf2=_0x23dffb?_0x3afc1c[_0x35fe('0x20')]:_0x11b684[_0x35fe('0x1d')]+_0x11b684[_0x35fe('0x1f')];var _0x142cee;if(_0x281bf2>=_0x3613b5){_0x281bf2=_0x3613b5;_0x142cee=0xc8;}else{_0x142cee=0xce;}_0x40a274[_0x35fe('0x21')](_0x142cee);return _0x40a274['set'](_0x35fe('0x22'),_0xaa4a93+'-'+_0x281bf2+'/'+_0x3613b5)[_0x35fe('0x1c')](_0x3afc1c);}return null;};}function patchUpdates(_0x528e7c){return function(_0x23ffde){try{jsonpatch[_0x35fe('0x23')](_0x23ffde,_0x528e7c,!![]);}catch(_0x42c2f7){return BPromise[_0x35fe('0x24')](_0x42c2f7);}return _0x23ffde[_0x35fe('0x25')]();};}function saveUpdates(_0x5e9ea4,_0x13163b){return function(_0x45090b){if(_0x45090b){return _0x45090b[_0x35fe('0x26')](_0x5e9ea4)[_0x35fe('0x27')](function(_0x7dcac7){return _0x7dcac7;});}return null;};}function removeEntity(_0x3fea25,_0xd14275){return function(_0x1c2abc){if(_0x1c2abc){return _0x1c2abc[_0x35fe('0x28')]()[_0x35fe('0x27')](function(){_0x3fea25[_0x35fe('0x21')](0xcc)[_0x35fe('0x1b')]();});}};}function handleEntityNotFound(_0x288666,_0x159dc7){return function(_0x263485){if(!_0x263485){_0x288666[_0x35fe('0x1a')](0x194);}return _0x263485;};}function handleError(_0x58a6d7,_0xb6818b){_0xb6818b=_0xb6818b||0x1f4;return function(_0x532f1a){logger[_0x35fe('0x29')](_0x532f1a[_0x35fe('0x2a')]);if(_0x532f1a[_0x35fe('0x2b')]){delete _0x532f1a[_0x35fe('0x2b')];}_0x58a6d7[_0x35fe('0x21')](_0xb6818b)['send'](_0x532f1a);};}exports[_0x35fe('0x2c')]=function(_0x1663fa,_0x378b17){var _0x3a8ad1={},_0x260719={},_0x1fecb4={'count':0x0,'rows':[]};var _0x2c67b3=_['map'](db[_0x35fe('0x2d')][_0x35fe('0x2e')],function(_0x8fc274){return{'name':_0x8fc274['fieldName'],'type':_0x8fc274[_0x35fe('0x2f')][_0x35fe('0x30')]};});_0x260719[_0x35fe('0x31')]=_['map'](_0x2c67b3,_0x35fe('0x2b'));_0x260719['query']=_[_0x35fe('0x32')](_0x1663fa[_0x35fe('0x33')]);_0x260719[_0x35fe('0x34')]=_[_0x35fe('0x35')](_0x260719['model'],_0x260719['query']);_0x3a8ad1[_0x35fe('0x36')]=_[_0x35fe('0x35')](_0x260719[_0x35fe('0x31')],qs[_0x35fe('0x37')](_0x1663fa['query']['fields']));_0x3a8ad1[_0x35fe('0x36')]=_0x3a8ad1['attributes'][_0x35fe('0x38')]?_0x3a8ad1[_0x35fe('0x36')]:_0x260719[_0x35fe('0x31')];if(!_0x1663fa['query']['hasOwnProperty'](_0x35fe('0x39'))){_0x3a8ad1[_0x35fe('0x1f')]=qs[_0x35fe('0x1f')](_0x1663fa[_0x35fe('0x33')][_0x35fe('0x1f')]);_0x3a8ad1[_0x35fe('0x1d')]=qs[_0x35fe('0x1d')](_0x1663fa[_0x35fe('0x33')]['offset']);}_0x3a8ad1['order']=qs[_0x35fe('0x3a')](_0x1663fa[_0x35fe('0x33')][_0x35fe('0x3a')]);_0x3a8ad1[_0x35fe('0x3b')]=qs[_0x35fe('0x34')](_['pick'](_0x1663fa['query'],_0x260719[_0x35fe('0x34')]),_0x2c67b3);if(_0x1663fa[_0x35fe('0x33')]['filter']){_0x3a8ad1[_0x35fe('0x3b')]=_[_0x35fe('0x3c')](_0x3a8ad1[_0x35fe('0x3b')],{'$or':_[_0x35fe('0x3d')](_0x2c67b3,function(_0x4ea821){if(_0x4ea821[_0x35fe('0x2f')]!==_0x35fe('0x3e')){var _0x18653c={};_0x18653c[_0x4ea821[_0x35fe('0x2b')]]={'$like':'%'+_0x1663fa[_0x35fe('0x33')][_0x35fe('0x3f')]+'%'};return _0x18653c;}})});}_0x3a8ad1=_[_0x35fe('0x3c')]({},_0x3a8ad1,_0x1663fa[_0x35fe('0x40')]);var _0x5763e={'where':_0x3a8ad1[_0x35fe('0x3b')]};return db[_0x35fe('0x2d')][_0x35fe('0x20')](_0x5763e)[_0x35fe('0x27')](function(_0x66a542){_0x1fecb4[_0x35fe('0x20')]=_0x66a542;if(_0x1663fa[_0x35fe('0x33')][_0x35fe('0x41')]){_0x3a8ad1['include']=[{'all':!![]}];}return db[_0x35fe('0x2d')][_0x35fe('0x42')](_0x3a8ad1);})[_0x35fe('0x27')](function(_0x183b3b){_0x1fecb4[_0x35fe('0x43')]=_0x183b3b;return _0x1fecb4;})['then'](respondWithFilteredResult(_0x378b17,_0x3a8ad1))[_0x35fe('0x44')](handleError(_0x378b17,null));};exports[_0x35fe('0x45')]=function(_0x17c84f,_0x40c9e2){var _0x7a7080={'raw':![],'where':{'id':_0x17c84f[_0x35fe('0x46')]['id']}},_0x17946c={};_0x17946c[_0x35fe('0x31')]=_[_0x35fe('0x32')](db['DeskAccount']['rawAttributes']);_0x17946c[_0x35fe('0x33')]=_[_0x35fe('0x32')](_0x17c84f[_0x35fe('0x33')]);_0x17946c[_0x35fe('0x34')]=_['intersection'](_0x17946c['model'],_0x17946c[_0x35fe('0x33')]);_0x7a7080[_0x35fe('0x36')]=_['intersection'](_0x17946c[_0x35fe('0x31')],qs['fields'](_0x17c84f[_0x35fe('0x33')][_0x35fe('0x37')]));_0x7a7080['attributes']=_0x7a7080[_0x35fe('0x36')][_0x35fe('0x38')]?_0x7a7080['attributes']:_0x17946c[_0x35fe('0x31')];if(_0x17c84f['query'][_0x35fe('0x41')]){_0x7a7080['include']=[{'all':!![]}];}_0x7a7080=_[_0x35fe('0x3c')]({},_0x7a7080,_0x17c84f[_0x35fe('0x40')]);return db[_0x35fe('0x2d')][_0x35fe('0x47')](_0x7a7080)['then'](handleEntityNotFound(_0x40c9e2,null))[_0x35fe('0x27')](respondWithResult(_0x40c9e2,null))[_0x35fe('0x44')](handleError(_0x40c9e2,null));};exports[_0x35fe('0x48')]=function(_0x4e2908,_0x1315e0){return db[_0x35fe('0x2d')]['create'](_0x4e2908[_0x35fe('0x49')],{})[_0x35fe('0x27')](respondWithResult(_0x1315e0,0xc9))['catch'](handleError(_0x1315e0,null));};exports['update']=function(_0x8906ab,_0x2f5404){if(_0x8906ab['body']['id']){delete _0x8906ab[_0x35fe('0x49')]['id'];}return db[_0x35fe('0x2d')][_0x35fe('0x47')]({'where':{'id':_0x8906ab['params']['id']}})[_0x35fe('0x27')](handleEntityNotFound(_0x2f5404,null))['then'](saveUpdates(_0x8906ab[_0x35fe('0x49')],null))[_0x35fe('0x27')](respondWithResult(_0x2f5404,null))['catch'](handleError(_0x2f5404,null));};exports[_0x35fe('0x28')]=function(_0x39fed7,_0x3ed4bb){return db[_0x35fe('0x2d')][_0x35fe('0x47')]({'where':{'id':_0x39fed7['params']['id']}})[_0x35fe('0x27')](handleEntityNotFound(_0x3ed4bb,null))[_0x35fe('0x27')](removeEntity(_0x3ed4bb,null))[_0x35fe('0x44')](handleError(_0x3ed4bb,null));};exports[_0x35fe('0x4a')]=function(_0x3a1bfb,_0x3298ff,_0x2c43a8){var _0x9776a7={};var _0x19c580={};var _0x312340;var _0x301991;return db['DeskAccount'][_0x35fe('0x4b')]({'where':{'id':_0x3a1bfb['params']['id']}})['then'](handleEntityNotFound(_0x3298ff,null))[_0x35fe('0x27')](function(_0x41c10b){if(_0x41c10b){_0x312340=_0x41c10b;_0x19c580[_0x35fe('0x31')]=_[_0x35fe('0x32')](db[_0x35fe('0x4c')][_0x35fe('0x2e')]);_0x19c580[_0x35fe('0x33')]=_[_0x35fe('0x32')](_0x3a1bfb['query']);_0x19c580['filters']=_[_0x35fe('0x35')](_0x19c580[_0x35fe('0x31')],_0x19c580[_0x35fe('0x33')]);_0x9776a7[_0x35fe('0x36')]=_[_0x35fe('0x35')](_0x19c580[_0x35fe('0x31')],qs[_0x35fe('0x37')](_0x3a1bfb[_0x35fe('0x33')][_0x35fe('0x37')]));_0x9776a7['attributes']=_0x9776a7[_0x35fe('0x36')]['length']?_0x9776a7[_0x35fe('0x36')]:_0x19c580[_0x35fe('0x31')];_0x9776a7[_0x35fe('0x4d')]=qs['sort'](_0x3a1bfb[_0x35fe('0x33')][_0x35fe('0x3a')]);_0x9776a7[_0x35fe('0x3b')]=qs[_0x35fe('0x34')](_[_0x35fe('0x4e')](_0x3a1bfb[_0x35fe('0x33')],_0x19c580['filters']));if(_0x3a1bfb['query']['filter']){_0x9776a7['where']=_[_0x35fe('0x3c')](_0x9776a7[_0x35fe('0x3b')],{'$or':_['map'](_0x9776a7[_0x35fe('0x36')],function(_0xaa92ee){var _0x3fe59a={};_0x3fe59a[_0xaa92ee]={'$like':'%'+_0x3a1bfb[_0x35fe('0x33')]['filter']+'%'};return _0x3fe59a;})});}_0x9776a7=_[_0x35fe('0x3c')]({},_0x9776a7,_0x3a1bfb[_0x35fe('0x40')]);return _0x312340['getConfigurations'](_0x9776a7);}})[_0x35fe('0x27')](function(_0xdd5f86){if(_0xdd5f86){_0x301991=_0xdd5f86[_0x35fe('0x38')];if(!_0x3a1bfb[_0x35fe('0x33')][_0x35fe('0x4f')]('nolimit')){_0x9776a7['limit']=qs['limit'](_0x3a1bfb[_0x35fe('0x33')][_0x35fe('0x1f')]);_0x9776a7[_0x35fe('0x1d')]=qs['offset'](_0x3a1bfb[_0x35fe('0x33')]['offset']);}return _0x312340['getConfigurations'](_0x9776a7);}})[_0x35fe('0x27')](function(_0x420ca6){if(_0x420ca6){return _0x420ca6?{'count':_0x301991,'rows':_0x420ca6}:null;}})[_0x35fe('0x27')](respondWithResult(_0x3298ff,null))['catch'](handleError(_0x3298ff,null));};exports[_0x35fe('0x50')]=function(_0x20c7bc,_0x1226a7,_0x5d0356){if(_0x20c7bc[_0x35fe('0x49')]['id']){delete _0x20c7bc[_0x35fe('0x49')]['id'];}return db[_0x35fe('0x2d')][_0x35fe('0x4b')]({'where':{'id':_0x20c7bc[_0x35fe('0x46')]['id']}})[_0x35fe('0x27')](handleEntityNotFound(_0x1226a7,null))[_0x35fe('0x27')](function(_0x466f18){if(_0x466f18){_0x20c7bc['body'][_0x35fe('0x51')]=_0x466f18['id'];_0x20c7bc[_0x35fe('0x49')][_0x35fe('0x52')]=integrations[_0x35fe('0x53')](_0x20c7bc[_0x35fe('0x49')][_0x35fe('0x54')],_0x20c7bc[_0x35fe('0x49')][_0x35fe('0x2f')]);_0x20c7bc[_0x35fe('0x49')][_0x35fe('0x55')]=integrations[_0x35fe('0x56')](_0x20c7bc['body']['channel'],_0x20c7bc['body'][_0x35fe('0x2f')]);return db[_0x35fe('0x4c')][_0x35fe('0x48')](_0x20c7bc[_0x35fe('0x49')],{'include':[{'model':db['DeskField'],'as':_0x35fe('0x52')},{'model':db[_0x35fe('0x57')],'as':_0x35fe('0x55')}]});}return null;})['then'](respondWithResult(_0x1226a7,null))[_0x35fe('0x44')](handleError(_0x1226a7,null));};exports[_0x35fe('0x58')]=function(_0x4bbe71,_0x4748a0,_0x3ae70b){var _0x233113=[{'name':'priority','label':_0x35fe('0x59'),'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 _0x2f05d6='';return db['DeskAccount'][_0x35fe('0x4b')]({'where':{'id':_0x4bbe71['params']['id']},'attributes':['id',_0x35fe('0x5a'),_0x35fe('0x5b'),_0x35fe('0x5c'),'password',_0x35fe('0x5d'),_0x35fe('0x5e'),_0x35fe('0x5f'),_0x35fe('0x60')]})[_0x35fe('0x27')](handleEntityNotFound(_0x4748a0,null))['then'](function(_0x87143e){if(_0x87143e){_0x2f05d6=_0x87143e[_0x35fe('0x5a')];var _0x42062d=_0x2f05d6[_0x35fe('0x61')](-0x1);if(_0x42062d==='/'){_0x2f05d6=_0x2f05d6[_0x35fe('0x62')](0x0,_0x2f05d6[_0x35fe('0x63')](_0x42062d));}var _0x373136={'method':'GET','uri':util[_0x35fe('0x64')](_0x35fe('0x65'),_0x2f05d6),'headers':{'Content-Type':_0x35fe('0x66'),'Accept':'application/json'},'json':!![]};if(_0x87143e[_0x35fe('0x5b')]===_0x35fe('0x67')){_0x373136[_0x35fe('0x68')][_0x35fe('0x69')]=util[_0x35fe('0x64')](_0x35fe('0x6a'),new Buffer(util[_0x35fe('0x64')]('%s:%s',_0x87143e[_0x35fe('0x5c')],_0x87143e['password']))[_0x35fe('0x6b')](_0x35fe('0x6c')));}return rp(_0x373136)[_0x35fe('0x27')](function(_0x3adc9){return _0x233113[_0x35fe('0x6d')](_[_0x35fe('0x3d')](_0x3adc9[_0x35fe('0x6e')][_0x35fe('0x6f')],function(_0x16477a){return{'id':_0x16477a[_0x35fe('0x2b')],'name':_0x16477a[_0x35fe('0x2b')],'type':_0x16477a['type'],'active':_0x16477a['active'],'label':_0x16477a[_0x35fe('0x70')],'custom':!![]};}));});}})[_0x35fe('0x27')](function(_0x2185d9){return{'count':_0x2185d9[_0x35fe('0x38')],'rows':_0x2185d9};})[_0x35fe('0x27')](respondWithResult(_0x4748a0,null))[_0x35fe('0x44')](function(_0x5831a4){var _0x5969f4=_0x4bbe71[_0x35fe('0x33')]['test']?0x1f4:_0x5831a4[_0x35fe('0x71')]||0x1f4;logger[_0x35fe('0x29')](_0x35fe('0x72'),'getFields',_0x5969f4,JSON[_0x35fe('0x73')](_0x5831a4));delete _0x5831a4[_0x35fe('0x2b')];if(_0x5969f4===0x191){_0x5969f4=0x190;}_0x4748a0[_0x35fe('0x21')](_0x5969f4)[_0x35fe('0x74')](_0x4bbe71[_0x35fe('0x33')][_0x35fe('0x75')]?{'message':_0x35fe('0x76'),'statusCode':_0x5831a4['statusCode']}:_0x5831a4);});}; \ No newline at end of file +var _0xd8dc=['slice','substring','GET','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd8dc,0x173));var _0xcd8d=function(_0x1f50a2,_0x387c1a){_0x1f50a2=_0x1f50a2-0x0;var _0x33a8c0=_0xd8dc[_0x1f50a2];return _0x33a8c0;};'use strict';var emlformat=require(_0xcd8d('0x0'));var rimraf=require(_0xcd8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd8d('0x2'));var rp=require('request-promise');var moment=require(_0xcd8d('0x3'));var BPromise=require(_0xcd8d('0x4'));var Mustache=require(_0xcd8d('0x5'));var util=require(_0xcd8d('0x6'));var path=require('path');var sox=require(_0xcd8d('0x7'));var csv=require(_0xcd8d('0x8'));var ejs=require(_0xcd8d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd8d('0xa'));var squel=require(_0xcd8d('0xb'));var crypto=require(_0xcd8d('0xc'));var jsforce=require(_0xcd8d('0xd'));var deskjs=require(_0xcd8d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd8d('0xf'));var Redis=require(_0xcd8d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcd8d('0x11'));var as=require(_0xcd8d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd8d('0x13'))(_0xcd8d('0x14'));var utils=require(_0xcd8d('0x15'));var config=require(_0xcd8d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd8d('0x17'))['db'];var integrations=require(_0xcd8d('0x18'));function respondWithStatusCode(_0x50d645,_0x5e4306){_0x5e4306=_0x5e4306||0xcc;return function(_0x27efcc){if(_0x27efcc){return _0x50d645['sendStatus'](_0x5e4306);}return _0x50d645[_0xcd8d('0x19')](_0x5e4306)[_0xcd8d('0x1a')]();};}function respondWithResult(_0x1a19dd,_0x53a24d){_0x53a24d=_0x53a24d||0xc8;return function(_0x7b178b){if(_0x7b178b){return _0x1a19dd[_0xcd8d('0x19')](_0x53a24d)[_0xcd8d('0x1b')](_0x7b178b);}};}function respondWithFilteredResult(_0x2c435e,_0x3d1218){return function(_0x45c64c){if(_0x45c64c){var _0x136bae=typeof _0x3d1218['offset']===_0xcd8d('0x1c')&&typeof _0x3d1218[_0xcd8d('0x1d')]===_0xcd8d('0x1c');var _0x2c8b1e=_0x45c64c['count'];var _0x3f0fa3=_0x136bae?0x0:_0x3d1218['offset'];var _0x3a4047=_0x136bae?_0x45c64c[_0xcd8d('0x1e')]:_0x3d1218[_0xcd8d('0x1f')]+_0x3d1218[_0xcd8d('0x1d')];var _0x15af11;if(_0x3a4047>=_0x2c8b1e){_0x3a4047=_0x2c8b1e;_0x15af11=0xc8;}else{_0x15af11=0xce;}_0x2c435e[_0xcd8d('0x19')](_0x15af11);return _0x2c435e['set'](_0xcd8d('0x20'),_0x3f0fa3+'-'+_0x3a4047+'/'+_0x2c8b1e)[_0xcd8d('0x1b')](_0x45c64c);}return null;};}function patchUpdates(_0xa10361){return function(_0xd5e0af){try{jsonpatch[_0xcd8d('0x21')](_0xd5e0af,_0xa10361,!![]);}catch(_0x3a380c){return BPromise[_0xcd8d('0x22')](_0x3a380c);}return _0xd5e0af[_0xcd8d('0x23')]();};}function saveUpdates(_0x5eb13c,_0x75572a){return function(_0x1c0185){if(_0x1c0185){return _0x1c0185[_0xcd8d('0x24')](_0x5eb13c)[_0xcd8d('0x25')](function(_0x2a0c9b){return _0x2a0c9b;});}return null;};}function removeEntity(_0x5b560a,_0x3501cc){return function(_0x4392ae){if(_0x4392ae){return _0x4392ae[_0xcd8d('0x26')]()[_0xcd8d('0x25')](function(){_0x5b560a['status'](0xcc)[_0xcd8d('0x1a')]();});}};}function handleEntityNotFound(_0x124599,_0x5f1144){return function(_0x330179){if(!_0x330179){_0x124599[_0xcd8d('0x27')](0x194);}return _0x330179;};}function handleError(_0x3da20a,_0x439a67){_0x439a67=_0x439a67||0x1f4;return function(_0x126ef4){logger['error'](_0x126ef4[_0xcd8d('0x28')]);if(_0x126ef4[_0xcd8d('0x29')]){delete _0x126ef4[_0xcd8d('0x29')];}_0x3da20a[_0xcd8d('0x19')](_0x439a67)[_0xcd8d('0x2a')](_0x126ef4);};}exports[_0xcd8d('0x2b')]=function(_0xe65217,_0x169e0b){var _0x125fe7={},_0x2e764a={},_0x4c53dc={'count':0x0,'rows':[]};var _0x20864c=_[_0xcd8d('0x2c')](db[_0xcd8d('0x2d')][_0xcd8d('0x2e')],function(_0x276a6b){return{'name':_0x276a6b[_0xcd8d('0x2f')],'type':_0x276a6b[_0xcd8d('0x30')][_0xcd8d('0x31')]};});_0x2e764a[_0xcd8d('0x32')]=_['map'](_0x20864c,_0xcd8d('0x29'));_0x2e764a[_0xcd8d('0x33')]=_['keys'](_0xe65217[_0xcd8d('0x33')]);_0x2e764a[_0xcd8d('0x34')]=_[_0xcd8d('0x35')](_0x2e764a[_0xcd8d('0x32')],_0x2e764a[_0xcd8d('0x33')]);_0x125fe7[_0xcd8d('0x36')]=_[_0xcd8d('0x35')](_0x2e764a[_0xcd8d('0x32')],qs[_0xcd8d('0x37')](_0xe65217[_0xcd8d('0x33')]['fields']));_0x125fe7[_0xcd8d('0x36')]=_0x125fe7[_0xcd8d('0x36')][_0xcd8d('0x38')]?_0x125fe7[_0xcd8d('0x36')]:_0x2e764a['model'];if(!_0xe65217[_0xcd8d('0x33')][_0xcd8d('0x39')]('nolimit')){_0x125fe7['limit']=qs[_0xcd8d('0x1d')](_0xe65217['query'][_0xcd8d('0x1d')]);_0x125fe7[_0xcd8d('0x1f')]=qs['offset'](_0xe65217['query'][_0xcd8d('0x1f')]);}_0x125fe7[_0xcd8d('0x3a')]=qs[_0xcd8d('0x3b')](_0xe65217['query'][_0xcd8d('0x3b')]);_0x125fe7[_0xcd8d('0x3c')]=qs[_0xcd8d('0x34')](_[_0xcd8d('0x3d')](_0xe65217[_0xcd8d('0x33')],_0x2e764a[_0xcd8d('0x34')]),_0x20864c);if(_0xe65217[_0xcd8d('0x33')][_0xcd8d('0x3e')]){_0x125fe7[_0xcd8d('0x3c')]=_[_0xcd8d('0x3f')](_0x125fe7[_0xcd8d('0x3c')],{'$or':_['map'](_0x20864c,function(_0x139bc0){if(_0x139bc0[_0xcd8d('0x30')]!==_0xcd8d('0x40')){var _0x390194={};_0x390194[_0x139bc0[_0xcd8d('0x29')]]={'$like':'%'+_0xe65217[_0xcd8d('0x33')][_0xcd8d('0x3e')]+'%'};return _0x390194;}})});}_0x125fe7=_[_0xcd8d('0x3f')]({},_0x125fe7,_0xe65217[_0xcd8d('0x41')]);var _0x109df1={'where':_0x125fe7[_0xcd8d('0x3c')]};return db[_0xcd8d('0x2d')][_0xcd8d('0x1e')](_0x109df1)[_0xcd8d('0x25')](function(_0x2a7ed6){_0x4c53dc['count']=_0x2a7ed6;if(_0xe65217[_0xcd8d('0x33')][_0xcd8d('0x42')]){_0x125fe7[_0xcd8d('0x43')]=[{'all':!![]}];}return db[_0xcd8d('0x2d')][_0xcd8d('0x44')](_0x125fe7);})['then'](function(_0x350f9b){_0x4c53dc[_0xcd8d('0x45')]=_0x350f9b;return _0x4c53dc;})[_0xcd8d('0x25')](respondWithFilteredResult(_0x169e0b,_0x125fe7))['catch'](handleError(_0x169e0b,null));};exports[_0xcd8d('0x46')]=function(_0x303105,_0x118dda){var _0x497cde={'raw':![],'where':{'id':_0x303105[_0xcd8d('0x47')]['id']}},_0x201597={};_0x201597[_0xcd8d('0x32')]=_['keys'](db[_0xcd8d('0x2d')]['rawAttributes']);_0x201597[_0xcd8d('0x33')]=_[_0xcd8d('0x48')](_0x303105[_0xcd8d('0x33')]);_0x201597[_0xcd8d('0x34')]=_[_0xcd8d('0x35')](_0x201597['model'],_0x201597[_0xcd8d('0x33')]);_0x497cde['attributes']=_[_0xcd8d('0x35')](_0x201597[_0xcd8d('0x32')],qs[_0xcd8d('0x37')](_0x303105['query'][_0xcd8d('0x37')]));_0x497cde['attributes']=_0x497cde['attributes'][_0xcd8d('0x38')]?_0x497cde['attributes']:_0x201597[_0xcd8d('0x32')];if(_0x303105[_0xcd8d('0x33')]['includeAll']){_0x497cde[_0xcd8d('0x43')]=[{'all':!![]}];}_0x497cde=_['merge']({},_0x497cde,_0x303105[_0xcd8d('0x41')]);return db['DeskAccount'][_0xcd8d('0x49')](_0x497cde)['then'](handleEntityNotFound(_0x118dda,null))[_0xcd8d('0x25')](respondWithResult(_0x118dda,null))['catch'](handleError(_0x118dda,null));};exports['create']=function(_0x597a08,_0x552db7){return db[_0xcd8d('0x2d')][_0xcd8d('0x4a')](_0x597a08[_0xcd8d('0x4b')],{})[_0xcd8d('0x25')](respondWithResult(_0x552db7,0xc9))[_0xcd8d('0x4c')](handleError(_0x552db7,null));};exports[_0xcd8d('0x24')]=function(_0x2b5154,_0x1f7ded){if(_0x2b5154['body']['id']){delete _0x2b5154[_0xcd8d('0x4b')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x2b5154['params']['id']}})['then'](handleEntityNotFound(_0x1f7ded,null))[_0xcd8d('0x25')](saveUpdates(_0x2b5154[_0xcd8d('0x4b')],null))['then'](respondWithResult(_0x1f7ded,null))[_0xcd8d('0x4c')](handleError(_0x1f7ded,null));};exports[_0xcd8d('0x26')]=function(_0x50cc79,_0xce9d56){return db[_0xcd8d('0x2d')][_0xcd8d('0x49')]({'where':{'id':_0x50cc79[_0xcd8d('0x47')]['id']}})[_0xcd8d('0x25')](handleEntityNotFound(_0xce9d56,null))[_0xcd8d('0x25')](removeEntity(_0xce9d56,null))[_0xcd8d('0x4c')](handleError(_0xce9d56,null));};exports[_0xcd8d('0x4d')]=function(_0x22b4ab,_0x35d225,_0x4f8dd7){var _0x4e69e3={};var _0x3375a4={};var _0x20ff72;var _0x20bc19;return db[_0xcd8d('0x2d')]['findOne']({'where':{'id':_0x22b4ab[_0xcd8d('0x47')]['id']}})['then'](handleEntityNotFound(_0x35d225,null))[_0xcd8d('0x25')](function(_0x34e5ed){if(_0x34e5ed){_0x20ff72=_0x34e5ed;_0x3375a4[_0xcd8d('0x32')]=_['keys'](db[_0xcd8d('0x4e')][_0xcd8d('0x2e')]);_0x3375a4[_0xcd8d('0x33')]=_['keys'](_0x22b4ab[_0xcd8d('0x33')]);_0x3375a4[_0xcd8d('0x34')]=_[_0xcd8d('0x35')](_0x3375a4['model'],_0x3375a4['query']);_0x4e69e3[_0xcd8d('0x36')]=_[_0xcd8d('0x35')](_0x3375a4[_0xcd8d('0x32')],qs['fields'](_0x22b4ab[_0xcd8d('0x33')]['fields']));_0x4e69e3[_0xcd8d('0x36')]=_0x4e69e3['attributes']['length']?_0x4e69e3[_0xcd8d('0x36')]:_0x3375a4['model'];_0x4e69e3['order']=qs['sort'](_0x22b4ab['query'][_0xcd8d('0x3b')]);_0x4e69e3[_0xcd8d('0x3c')]=qs['filters'](_['pick'](_0x22b4ab[_0xcd8d('0x33')],_0x3375a4['filters']));if(_0x22b4ab[_0xcd8d('0x33')][_0xcd8d('0x3e')]){_0x4e69e3[_0xcd8d('0x3c')]=_[_0xcd8d('0x3f')](_0x4e69e3['where'],{'$or':_[_0xcd8d('0x2c')](_0x4e69e3[_0xcd8d('0x36')],function(_0x206266){var _0x53983e={};_0x53983e[_0x206266]={'$like':'%'+_0x22b4ab[_0xcd8d('0x33')]['filter']+'%'};return _0x53983e;})});}_0x4e69e3=_[_0xcd8d('0x3f')]({},_0x4e69e3,_0x22b4ab[_0xcd8d('0x41')]);return _0x20ff72[_0xcd8d('0x4d')](_0x4e69e3);}})[_0xcd8d('0x25')](function(_0x5f1030){if(_0x5f1030){_0x20bc19=_0x5f1030['length'];if(!_0x22b4ab[_0xcd8d('0x33')][_0xcd8d('0x39')]('nolimit')){_0x4e69e3[_0xcd8d('0x1d')]=qs[_0xcd8d('0x1d')](_0x22b4ab[_0xcd8d('0x33')][_0xcd8d('0x1d')]);_0x4e69e3['offset']=qs[_0xcd8d('0x1f')](_0x22b4ab[_0xcd8d('0x33')][_0xcd8d('0x1f')]);}return _0x20ff72[_0xcd8d('0x4d')](_0x4e69e3);}})[_0xcd8d('0x25')](function(_0x29f846){if(_0x29f846){return _0x29f846?{'count':_0x20bc19,'rows':_0x29f846}:null;}})[_0xcd8d('0x25')](respondWithResult(_0x35d225,null))[_0xcd8d('0x4c')](handleError(_0x35d225,null));};exports[_0xcd8d('0x4f')]=function(_0x581b18,_0x197bb0,_0x5a52d2){if(_0x581b18[_0xcd8d('0x4b')]['id']){delete _0x581b18[_0xcd8d('0x4b')]['id'];}return db[_0xcd8d('0x2d')][_0xcd8d('0x50')]({'where':{'id':_0x581b18[_0xcd8d('0x47')]['id']}})[_0xcd8d('0x25')](handleEntityNotFound(_0x197bb0,null))[_0xcd8d('0x25')](function(_0x5c5982){if(_0x5c5982){_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x51')]=_0x5c5982['id'];_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x52')]=integrations[_0xcd8d('0x53')](_0x581b18[_0xcd8d('0x4b')]['channel'],_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x30')]);_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x54')]=integrations[_0xcd8d('0x55')](_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x56')],_0x581b18[_0xcd8d('0x4b')][_0xcd8d('0x30')]);return db[_0xcd8d('0x4e')][_0xcd8d('0x4a')](_0x581b18[_0xcd8d('0x4b')],{'include':[{'model':db[_0xcd8d('0x57')],'as':_0xcd8d('0x52')},{'model':db[_0xcd8d('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x197bb0,null))[_0xcd8d('0x4c')](handleError(_0x197bb0,null));};exports[_0xcd8d('0x58')]=function(_0x27c89d,_0x11b990,_0x4c9fde){var _0x4c24ac=[{'name':_0xcd8d('0x59'),'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 _0x36ddeb='';return db[_0xcd8d('0x2d')][_0xcd8d('0x50')]({'where':{'id':_0x27c89d[_0xcd8d('0x47')]['id']},'attributes':['id',_0xcd8d('0x5a'),_0xcd8d('0x5b'),_0xcd8d('0x5c'),_0xcd8d('0x5d'),'consumerKey',_0xcd8d('0x5e'),_0xcd8d('0x5f'),_0xcd8d('0x60')]})['then'](handleEntityNotFound(_0x11b990,null))['then'](function(_0x1dfea6){if(_0x1dfea6){_0x36ddeb=_0x1dfea6[_0xcd8d('0x5a')];var _0x1c863e=_0x36ddeb[_0xcd8d('0x61')](-0x1);if(_0x1c863e==='/'){_0x36ddeb=_0x36ddeb[_0xcd8d('0x62')](0x0,_0x36ddeb['lastIndexOf'](_0x1c863e));}var _0x5a9b9c={'method':_0xcd8d('0x63'),'uri':util[_0xcd8d('0x64')](_0xcd8d('0x65'),_0x36ddeb),'headers':{'Content-Type':_0xcd8d('0x66'),'Accept':_0xcd8d('0x66')},'json':!![]};if(_0x1dfea6[_0xcd8d('0x5b')]===_0xcd8d('0x67')){_0x5a9b9c['headers']['Authorization']=util[_0xcd8d('0x64')](_0xcd8d('0x68'),new Buffer(util[_0xcd8d('0x64')](_0xcd8d('0x69'),_0x1dfea6[_0xcd8d('0x5c')],_0x1dfea6[_0xcd8d('0x5d')]))[_0xcd8d('0x6a')](_0xcd8d('0x6b')));}return rp(_0x5a9b9c)[_0xcd8d('0x25')](function(_0x4560c8){return _0x4c24ac[_0xcd8d('0x6c')](_['map'](_0x4560c8[_0xcd8d('0x6d')][_0xcd8d('0x6e')],function(_0x123be9){return{'id':_0x123be9['name'],'name':_0x123be9['name'],'type':_0x123be9['type'],'active':_0x123be9['active'],'label':_0x123be9['label'],'custom':!![]};}));});}})[_0xcd8d('0x25')](function(_0x5c543d){return{'count':_0x5c543d[_0xcd8d('0x38')],'rows':_0x5c543d};})[_0xcd8d('0x25')](respondWithResult(_0x11b990,null))[_0xcd8d('0x4c')](function(_0x39328e){var _0x1c99fb=_0x27c89d[_0xcd8d('0x33')][_0xcd8d('0x6f')]?0x1f4:_0x39328e[_0xcd8d('0x70')]||0x1f4;logger[_0xcd8d('0x71')](_0xcd8d('0x72'),_0xcd8d('0x58'),_0x1c99fb,JSON[_0xcd8d('0x73')](_0x39328e));delete _0x39328e['name'];if(_0x1c99fb===0x191){_0x1c99fb=0x190;}_0x11b990[_0xcd8d('0x19')](_0x1c99fb)[_0xcd8d('0x2a')](_0x27c89d[_0xcd8d('0x33')][_0xcd8d('0x6f')]?{'message':_0xcd8d('0x74'),'statusCode':_0x39328e['statusCode']}:_0x39328e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 1d4eb64..cf313fd 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 _0xe50c=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskAccount.attributes','define'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe50c,0x122));var _0xce50=function(_0x5c6c28,_0x2fd353){_0x5c6c28=_0x5c6c28-0x0;var _0x3c1d0a=_0xe50c[_0x5c6c28];return _0x3c1d0a;};'use strict';var _=require(_0xce50('0x0'));var util=require(_0xce50('0x1'));var logger=require(_0xce50('0x2'))(_0xce50('0x3'));var moment=require(_0xce50('0x4'));var BPromise=require(_0xce50('0x5'));var rp=require(_0xce50('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce50('0x7'));var config=require('../../config/environment');var attributes=require(_0xce50('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5c33af,_0x5a92a3){return _0x5c33af[_0xce50('0x9')](_0xce50('0xa'),attributes,{'tableName':_0xce50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3397=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts'];(function(_0x287398,_0x276c20){var _0x1e09ff=function(_0x7e37c6){while(--_0x7e37c6){_0x287398['push'](_0x287398['shift']());}};_0x1e09ff(++_0x276c20);}(_0x3397,0x12c));var _0x7339=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x3397[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var logger=require(_0x7339('0x2'))(_0x7339('0x3'));var moment=require(_0x7339('0x4'));var BPromise=require(_0x7339('0x5'));var rp=require(_0x7339('0x6'));var fs=require('fs');var path=require(_0x7339('0x7'));var rimraf=require(_0x7339('0x8'));var config=require(_0x7339('0x9'));var attributes=require(_0x7339('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x7339('0xb')]=function(_0x354319,_0x1cd12c){return _0x354319[_0x7339('0xc')](_0x7339('0xd'),attributes,{'tableName':_0x7339('0xe'),'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 d4ce2ee..fe6df42 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 _0x3f3c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowDeskAccount'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3f3c,0x6f));var _0xc3f3=function(_0x3349bb,_0x371922){_0x3349bb=_0x3349bb-0x0;var _0x38f653=_0x3f3c[_0x3349bb];return _0x38f653;};'use strict';var _=require(_0xc3f3('0x0'));var util=require(_0xc3f3('0x1'));var moment=require(_0xc3f3('0x2'));var BPromise=require(_0xc3f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3f3('0x4'));var db=require(_0xc3f3('0x5'))['db'];var utils=require(_0xc3f3('0x6'));var logger=require(_0xc3f3('0x7'))(_0xc3f3('0x8'));var config=require(_0xc3f3('0x9'));var jayson=require(_0xc3f3('0xa'));var client=jayson[_0xc3f3('0xb')][_0xc3f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a3681,_0x337337,_0xd709b8){return new BPromise(function(_0x3f103b,_0x5be3fc){return client[_0xc3f3('0xd')](_0x1a3681,_0xd709b8)['then'](function(_0x1e45c9){logger[_0xc3f3('0xe')](_0xc3f3('0xf'),_0x337337,_0xc3f3('0x10'));logger[_0xc3f3('0x11')](_0xc3f3('0x12'),_0x337337,_0xc3f3('0x10'),JSON[_0xc3f3('0x13')](_0x1e45c9));if(_0x1e45c9[_0xc3f3('0x14')]){if(_0x1e45c9[_0xc3f3('0x14')][_0xc3f3('0x15')]===0x1f4){logger['error'](_0xc3f3('0xf'),_0x337337,_0x1e45c9[_0xc3f3('0x14')][_0xc3f3('0x16')]);return _0x5be3fc(_0x1e45c9['error']['message']);}logger[_0xc3f3('0x14')](_0xc3f3('0xf'),_0x337337,_0x1e45c9[_0xc3f3('0x14')][_0xc3f3('0x16')]);return _0x3f103b(_0x1e45c9[_0xc3f3('0x14')][_0xc3f3('0x16')]);}else{logger[_0xc3f3('0xe')]('DeskAccount,\x20%s,\x20%s',_0x337337,_0xc3f3('0x10'));_0x3f103b(_0x1e45c9[_0xc3f3('0x17')][_0xc3f3('0x16')]);}})['catch'](function(_0x1481e3){logger[_0xc3f3('0x14')](_0xc3f3('0xf'),_0x337337,_0x1481e3);_0x5be3fc(_0x1481e3);});});}exports[_0xc3f3('0x18')]=function(_0x368520){var _0x187ff0=this;return new Promise(function(_0x154df4,_0xcd33e){return db[_0xc3f3('0x19')][_0xc3f3('0x1a')]({'raw':_0x368520[_0xc3f3('0x1b')]?_0x368520[_0xc3f3('0x1b')][_0xc3f3('0x1c')]===undefined?!![]:![]:!![],'where':_0x368520[_0xc3f3('0x1b')]?_0x368520[_0xc3f3('0x1b')]['where']||null:null,'attributes':_0x368520['options']?_0x368520[_0xc3f3('0x1b')][_0xc3f3('0x1d')]||null:null,'limit':_0x368520[_0xc3f3('0x1b')]?_0x368520[_0xc3f3('0x1b')][_0xc3f3('0x1e')]||null:null,'include':_0x368520['options']?_0x368520['options'][_0xc3f3('0x1f')]?_[_0xc3f3('0x20')](_0x368520[_0xc3f3('0x1b')][_0xc3f3('0x1f')],function(_0xc60372){return{'model':db[_0xc60372['model']],'as':_0xc60372['as'],'attributes':_0xc60372['attributes'],'include':_0xc60372[_0xc3f3('0x1f')]?_[_0xc3f3('0x20')](_0xc60372['include'],function(_0x3637f9){return{'model':db[_0x3637f9[_0xc3f3('0x21')]],'as':_0x3637f9['as'],'attributes':_0x3637f9[_0xc3f3('0x1d')],'include':_0x3637f9[_0xc3f3('0x1f')]?_[_0xc3f3('0x20')](_0x3637f9[_0xc3f3('0x1f')],function(_0x56ba94){return{'model':db[_0x56ba94[_0xc3f3('0x21')]],'as':_0x56ba94['as'],'attributes':_0x56ba94[_0xc3f3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x266242){logger['info'](_0xc3f3('0x18'),_0x368520);logger[_0xc3f3('0x11')]('GetDeskAccount',_0x368520,JSON[_0xc3f3('0x13')](_0x266242));_0x154df4(_0x266242);})['catch'](function(_0x54e4ac){logger[_0xc3f3('0x14')](_0xc3f3('0x18'),_0x54e4ac[_0xc3f3('0x16')],_0x368520);_0xcd33e(_0x187ff0[_0xc3f3('0x14')](0x1f4,_0x54e4ac['message']));});});};exports['ShowDeskAccount']=function(_0x1b8ef6){var _0x324a1c=this;return new Promise(function(_0x48afac,_0x121370){return db[_0xc3f3('0x19')][_0xc3f3('0x22')]({'raw':_0x1b8ef6[_0xc3f3('0x1b')]?_0x1b8ef6[_0xc3f3('0x1b')][_0xc3f3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b8ef6['options']?_0x1b8ef6[_0xc3f3('0x1b')][_0xc3f3('0x23')]||null:null,'attributes':_0x1b8ef6[_0xc3f3('0x1b')]?_0x1b8ef6[_0xc3f3('0x1b')]['attributes']||null:null,'include':_0x1b8ef6[_0xc3f3('0x1b')]?_0x1b8ef6['options']['include']?_[_0xc3f3('0x20')](_0x1b8ef6[_0xc3f3('0x1b')]['include'],function(_0x4f126c){return{'model':db[_0x4f126c['model']],'as':_0x4f126c['as'],'attributes':_0x4f126c[_0xc3f3('0x1d')],'include':_0x4f126c['include']?_[_0xc3f3('0x20')](_0x4f126c[_0xc3f3('0x1f')],function(_0x51368e){return{'model':db[_0x51368e[_0xc3f3('0x21')]],'as':_0x51368e['as'],'attributes':_0x51368e[_0xc3f3('0x1d')],'include':_0x51368e['include']?_[_0xc3f3('0x20')](_0x51368e[_0xc3f3('0x1f')],function(_0x51208a){return{'model':db[_0x51208a['model']],'as':_0x51208a['as'],'attributes':_0x51208a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x220819){logger[_0xc3f3('0xe')](_0xc3f3('0x24'),_0x1b8ef6);logger[_0xc3f3('0x11')](_0xc3f3('0x24'),_0x1b8ef6,JSON[_0xc3f3('0x13')](_0x220819));_0x48afac(_0x220819);})['catch'](function(_0x4d4233){logger['error'](_0xc3f3('0x24'),_0x4d4233['message'],_0x1b8ef6);_0x121370(_0x324a1c[_0xc3f3('0x14')](0x1f4,_0x4d4233['message']));});});}; \ No newline at end of file +var _0xa9a6=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options','raw','attributes','include','model','map','GetDeskAccount','ShowDeskAccount','DeskAccount','find','where','stringify','lodash','util','randomstring','../../mysqldb'];(function(_0x1ec3fa,_0x3e9940){var _0x349bee=function(_0x539e67){while(--_0x539e67){_0x1ec3fa['push'](_0x1ec3fa['shift']());}};_0x349bee(++_0x3e9940);}(_0xa9a6,0x146));var _0x6a9a=function(_0x3d80b6,_0x164db3){_0x3d80b6=_0x3d80b6-0x0;var _0x26ece7=_0xa9a6[_0x3d80b6];return _0x26ece7;};'use strict';var _=require(_0x6a9a('0x0'));var util=require(_0x6a9a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a9a('0x4'))('rpc');var config=require(_0x6a9a('0x5'));var jayson=require(_0x6a9a('0x6'));var client=jayson[_0x6a9a('0x7')][_0x6a9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6232b5,_0x4b94a6,_0x2a04f9){return new BPromise(function(_0x4cefee,_0x1259da){return client[_0x6a9a('0x9')](_0x6232b5,_0x2a04f9)[_0x6a9a('0xa')](function(_0x2688d4){logger[_0x6a9a('0xb')](_0x6a9a('0xc'),_0x4b94a6,_0x6a9a('0xd'));logger[_0x6a9a('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4b94a6,'request\x20sent',JSON['stringify'](_0x2688d4));if(_0x2688d4[_0x6a9a('0xf')]){if(_0x2688d4[_0x6a9a('0xf')][_0x6a9a('0x10')]===0x1f4){logger[_0x6a9a('0xf')](_0x6a9a('0xc'),_0x4b94a6,_0x2688d4[_0x6a9a('0xf')]['message']);return _0x1259da(_0x2688d4[_0x6a9a('0xf')][_0x6a9a('0x11')]);}logger[_0x6a9a('0xf')](_0x6a9a('0xc'),_0x4b94a6,_0x2688d4[_0x6a9a('0xf')][_0x6a9a('0x11')]);return _0x4cefee(_0x2688d4[_0x6a9a('0xf')][_0x6a9a('0x11')]);}else{logger['info'](_0x6a9a('0xc'),_0x4b94a6,_0x6a9a('0xd'));_0x4cefee(_0x2688d4[_0x6a9a('0x12')][_0x6a9a('0x11')]);}})[_0x6a9a('0x13')](function(_0x4a162e){logger[_0x6a9a('0xf')](_0x6a9a('0xc'),_0x4b94a6,_0x4a162e);_0x1259da(_0x4a162e);});});}exports['GetDeskAccount']=function(_0x3aeff1){var _0x412786=this;return new Promise(function(_0x269e28,_0x30a0b2){return db['DeskAccount'][_0x6a9a('0x14')]({'raw':_0x3aeff1['options']?_0x3aeff1[_0x6a9a('0x15')][_0x6a9a('0x16')]===undefined?!![]:![]:!![],'where':_0x3aeff1[_0x6a9a('0x15')]?_0x3aeff1[_0x6a9a('0x15')]['where']||null:null,'attributes':_0x3aeff1[_0x6a9a('0x15')]?_0x3aeff1[_0x6a9a('0x15')][_0x6a9a('0x17')]||null:null,'limit':_0x3aeff1[_0x6a9a('0x15')]?_0x3aeff1[_0x6a9a('0x15')]['limit']||null:null,'include':_0x3aeff1[_0x6a9a('0x15')]?_0x3aeff1[_0x6a9a('0x15')][_0x6a9a('0x18')]?_['map'](_0x3aeff1[_0x6a9a('0x15')][_0x6a9a('0x18')],function(_0x253672){return{'model':db[_0x253672[_0x6a9a('0x19')]],'as':_0x253672['as'],'attributes':_0x253672[_0x6a9a('0x17')],'include':_0x253672[_0x6a9a('0x18')]?_['map'](_0x253672[_0x6a9a('0x18')],function(_0xb67c2){return{'model':db[_0xb67c2['model']],'as':_0xb67c2['as'],'attributes':_0xb67c2[_0x6a9a('0x17')],'include':_0xb67c2[_0x6a9a('0x18')]?_[_0x6a9a('0x1a')](_0xb67c2[_0x6a9a('0x18')],function(_0x54dae6){return{'model':db[_0x54dae6[_0x6a9a('0x19')]],'as':_0x54dae6['as'],'attributes':_0x54dae6[_0x6a9a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6a9a('0xa')](function(_0x49fc23){logger['info']('GetDeskAccount',_0x3aeff1);logger[_0x6a9a('0xe')](_0x6a9a('0x1b'),_0x3aeff1,JSON['stringify'](_0x49fc23));_0x269e28(_0x49fc23);})[_0x6a9a('0x13')](function(_0x4f6316){logger[_0x6a9a('0xf')](_0x6a9a('0x1b'),_0x4f6316[_0x6a9a('0x11')],_0x3aeff1);_0x30a0b2(_0x412786[_0x6a9a('0xf')](0x1f4,_0x4f6316[_0x6a9a('0x11')]));});});};exports[_0x6a9a('0x1c')]=function(_0x5d3443){var _0x5d41cf=this;return new Promise(function(_0x258542,_0x38d3eb){return db[_0x6a9a('0x1d')][_0x6a9a('0x1e')]({'raw':_0x5d3443['options']?_0x5d3443[_0x6a9a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5d3443[_0x6a9a('0x15')]?_0x5d3443[_0x6a9a('0x15')][_0x6a9a('0x1f')]||null:null,'attributes':_0x5d3443['options']?_0x5d3443[_0x6a9a('0x15')]['attributes']||null:null,'include':_0x5d3443[_0x6a9a('0x15')]?_0x5d3443[_0x6a9a('0x15')][_0x6a9a('0x18')]?_['map'](_0x5d3443[_0x6a9a('0x15')]['include'],function(_0x15649a){return{'model':db[_0x15649a[_0x6a9a('0x19')]],'as':_0x15649a['as'],'attributes':_0x15649a['attributes'],'include':_0x15649a[_0x6a9a('0x18')]?_[_0x6a9a('0x1a')](_0x15649a[_0x6a9a('0x18')],function(_0x51b29c){return{'model':db[_0x51b29c[_0x6a9a('0x19')]],'as':_0x51b29c['as'],'attributes':_0x51b29c['attributes'],'include':_0x51b29c[_0x6a9a('0x18')]?_['map'](_0x51b29c[_0x6a9a('0x18')],function(_0x5420ae){return{'model':db[_0x5420ae[_0x6a9a('0x19')]],'as':_0x5420ae['as'],'attributes':_0x5420ae[_0x6a9a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12b881){logger['info'](_0x6a9a('0x1c'),_0x5d3443);logger[_0x6a9a('0xe')](_0x6a9a('0x1c'),_0x5d3443,JSON[_0x6a9a('0x20')](_0x12b881));_0x258542(_0x12b881);})['catch'](function(_0x1e211e){logger[_0x6a9a('0xf')](_0x6a9a('0x1c'),_0x1e211e[_0x6a9a('0x11')],_0x5d3443);_0x38d3eb(_0x5d41cf[_0x6a9a('0xf')](0x1f4,_0x1e211e[_0x6a9a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 2b920a5..c3c8872 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ee338,_0x3ad974){var _0x3402f3=function(_0x4e3e1e){while(--_0x4e3e1e){_0x4ee338['push'](_0x4ee338['shift']());}};_0x3402f3(++_0x3ad974);}(_0x008c,0x188));var _0xc008=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x008c[_0x561f25];return _0x150e4c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x64433a,_0x475862){var _0x4de27a=function(_0x657387){while(--_0x657387){_0x64433a['push'](_0x64433a['shift']());}};_0x4de27a(++_0x475862);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 5583d26..7a8a6a6 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 _0x7b6c=['exports','STRING','sequelize'];(function(_0x15987a,_0x1afa5a){var _0x2f0656=function(_0x48f008){while(--_0x48f008){_0x15987a['push'](_0x15987a['shift']());}};_0x2f0656(++_0x1afa5a);}(_0x7b6c,0x95));var _0xc7b6=function(_0x49afee,_0x31dea5){_0x49afee=_0x49afee-0x0;var _0x4690d5=_0x7b6c[_0x49afee];return _0x4690d5;};'use strict';var Sequelize=require(_0xc7b6('0x0'));module[_0xc7b6('0x1')]={'name':{'type':Sequelize[_0xc7b6('0x2')]},'description':{'type':Sequelize[_0xc7b6('0x2')]}}; \ No newline at end of file +var _0x04ff=['STRING','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x04ff,0xb5));var _0xf04f=function(_0x2a573d,_0x31d031){_0x2a573d=_0x2a573d-0x0;var _0x166f0b=_0x04ff[_0x2a573d];return _0x166f0b;};'use strict';var Sequelize=require(_0xf04f('0x0'));module[_0xf04f('0x1')]={'name':{'type':Sequelize[_0xf04f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 4aac6d9..a8603b3 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 _0x526d=['set','apply','reject','save','update','then','end','error','stack','name','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','fields','includeAll','find','create','body','destroy','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status'];(function(_0x4da438,_0x274ea2){var _0x414986=function(_0xf5ed3e){while(--_0xf5ed3e){_0x4da438['push'](_0x4da438['shift']());}};_0x414986(++_0x274ea2);}(_0x526d,0xe2));var _0xd526=function(_0xa355ee,_0x4b6360){_0xa355ee=_0xa355ee-0x0;var _0x44307e=_0x526d[_0xa355ee];return _0x44307e;};'use strict';var emlformat=require(_0xd526('0x0'));var rimraf=require(_0xd526('0x1'));var zipdir=require(_0xd526('0x2'));var jsonpatch=require(_0xd526('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd526('0x4'));var Mustache=require(_0xd526('0x5'));var util=require('util');var path=require(_0xd526('0x6'));var sox=require(_0xd526('0x7'));var csv=require(_0xd526('0x8'));var ejs=require(_0xd526('0x9'));var fs=require('fs');var fs_extra=require(_0xd526('0xa'));var _=require(_0xd526('0xb'));var squel=require(_0xd526('0xc'));var crypto=require(_0xd526('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd526('0x8'));var querystring=require(_0xd526('0xe'));var Papa=require(_0xd526('0xf'));var Redis=require(_0xd526('0x10'));var authService=require(_0xd526('0x11'));var qs=require(_0xd526('0x12'));var as=require(_0xd526('0x13'));var hardwareService=require(_0xd526('0x14'));var logger=require('../../config/logger')(_0xd526('0x15'));var utils=require('../../config/utils');var config=require(_0xd526('0x16'));var licenseUtil=require(_0xd526('0x17'));var db=require(_0xd526('0x18'))['db'];function respondWithStatusCode(_0x1bd1ab,_0x22ed32){_0x22ed32=_0x22ed32||0xcc;return function(_0x5934a5){if(_0x5934a5){return _0x1bd1ab[_0xd526('0x19')](_0x22ed32);}return _0x1bd1ab['status'](_0x22ed32)['end']();};}function respondWithResult(_0x2eefab,_0x3d2b51){_0x3d2b51=_0x3d2b51||0xc8;return function(_0x5769a0){if(_0x5769a0){return _0x2eefab['status'](_0x3d2b51)[_0xd526('0x1a')](_0x5769a0);}};}function respondWithFilteredResult(_0x375acf,_0x567a47){return function(_0x535d56){if(_0x535d56){var _0x1d5e9c=typeof _0x567a47[_0xd526('0x1b')]===_0xd526('0x1c')&&typeof _0x567a47[_0xd526('0x1d')]===_0xd526('0x1c');var _0x2b9648=_0x535d56[_0xd526('0x1e')];var _0x30b656=_0x1d5e9c?0x0:_0x567a47[_0xd526('0x1b')];var _0x365d87=_0x1d5e9c?_0x535d56[_0xd526('0x1e')]:_0x567a47[_0xd526('0x1b')]+_0x567a47[_0xd526('0x1d')];var _0x10ddf2;if(_0x365d87>=_0x2b9648){_0x365d87=_0x2b9648;_0x10ddf2=0xc8;}else{_0x10ddf2=0xce;}_0x375acf[_0xd526('0x1f')](_0x10ddf2);return _0x375acf[_0xd526('0x20')]('Content-Range',_0x30b656+'-'+_0x365d87+'/'+_0x2b9648)[_0xd526('0x1a')](_0x535d56);}return null;};}function patchUpdates(_0xa2d64c){return function(_0x3d8aa3){try{jsonpatch[_0xd526('0x21')](_0x3d8aa3,_0xa2d64c,!![]);}catch(_0x87c9e1){return BPromise[_0xd526('0x22')](_0x87c9e1);}return _0x3d8aa3[_0xd526('0x23')]();};}function saveUpdates(_0x5646fd,_0x4b8981){return function(_0x3e6f4b){if(_0x3e6f4b){return _0x3e6f4b[_0xd526('0x24')](_0x5646fd)[_0xd526('0x25')](function(_0x4aa425){return _0x4aa425;});}return null;};}function removeEntity(_0x19116b,_0x411f2e){return function(_0x398006){if(_0x398006){return _0x398006['destroy']()[_0xd526('0x25')](function(){_0x19116b[_0xd526('0x1f')](0xcc)[_0xd526('0x26')]();});}};}function handleEntityNotFound(_0x18308a,_0x4b25f0){return function(_0xd47e35){if(!_0xd47e35){_0x18308a[_0xd526('0x19')](0x194);}return _0xd47e35;};}function handleError(_0x344c77,_0x46e295){_0x46e295=_0x46e295||0x1f4;return function(_0x5c55ce){logger[_0xd526('0x27')](_0x5c55ce[_0xd526('0x28')]);if(_0x5c55ce['name']){delete _0x5c55ce[_0xd526('0x29')];}_0x344c77['status'](_0x46e295)['send'](_0x5c55ce);};}exports[_0xd526('0x2a')]=function(_0x184230,_0x2642b1){var _0x33672c={},_0x3aab5c={},_0x10fb03={'count':0x0,'rows':[]};var _0x19b15b=_['map'](db[_0xd526('0x2b')][_0xd526('0x2c')],function(_0xdacdf2){return{'name':_0xdacdf2[_0xd526('0x2d')],'type':_0xdacdf2[_0xd526('0x2e')][_0xd526('0x2f')]};});_0x3aab5c[_0xd526('0x30')]=_[_0xd526('0x31')](_0x19b15b,'name');_0x3aab5c['query']=_[_0xd526('0x32')](_0x184230[_0xd526('0x33')]);_0x3aab5c[_0xd526('0x34')]=_['intersection'](_0x3aab5c['model'],_0x3aab5c[_0xd526('0x33')]);_0x33672c[_0xd526('0x35')]=_['intersection'](_0x3aab5c[_0xd526('0x30')],qs['fields'](_0x184230[_0xd526('0x33')]['fields']));_0x33672c['attributes']=_0x33672c[_0xd526('0x35')][_0xd526('0x36')]?_0x33672c[_0xd526('0x35')]:_0x3aab5c[_0xd526('0x30')];if(!_0x184230[_0xd526('0x33')][_0xd526('0x37')](_0xd526('0x38'))){_0x33672c[_0xd526('0x1d')]=qs['limit'](_0x184230[_0xd526('0x33')][_0xd526('0x1d')]);_0x33672c['offset']=qs['offset'](_0x184230[_0xd526('0x33')][_0xd526('0x1b')]);}_0x33672c['order']=qs['sort'](_0x184230[_0xd526('0x33')][_0xd526('0x39')]);_0x33672c['where']=qs[_0xd526('0x34')](_[_0xd526('0x3a')](_0x184230['query'],_0x3aab5c[_0xd526('0x34')]),_0x19b15b);if(_0x184230[_0xd526('0x33')][_0xd526('0x3b')]){_0x33672c[_0xd526('0x3c')]=_[_0xd526('0x3d')](_0x33672c[_0xd526('0x3c')],{'$or':_[_0xd526('0x31')](_0x19b15b,function(_0x41d1d2){if(_0x41d1d2[_0xd526('0x2e')]!==_0xd526('0x3e')){var _0xfcf0d2={};_0xfcf0d2[_0x41d1d2['name']]={'$like':'%'+_0x184230[_0xd526('0x33')][_0xd526('0x3b')]+'%'};return _0xfcf0d2;}})});}_0x33672c=_[_0xd526('0x3d')]({},_0x33672c,_0x184230[_0xd526('0x3f')]);var _0x2f3b7b={'where':_0x33672c[_0xd526('0x3c')]};return db['DeskConfiguration'][_0xd526('0x1e')](_0x2f3b7b)[_0xd526('0x25')](function(_0x256442){_0x10fb03[_0xd526('0x1e')]=_0x256442;if(_0x184230[_0xd526('0x33')]['includeAll']){_0x33672c[_0xd526('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd526('0x41')](_0x33672c);})['then'](function(_0x3d8871){_0x10fb03[_0xd526('0x42')]=_0x3d8871;return _0x10fb03;})['then'](respondWithFilteredResult(_0x2642b1,_0x33672c))[_0xd526('0x43')](handleError(_0x2642b1,null));};exports[_0xd526('0x44')]=function(_0x336e67,_0x1160a6){var _0x28df24={'raw':![],'where':{'id':_0x336e67[_0xd526('0x45')]['id']}},_0x1d350f={};_0x1d350f[_0xd526('0x30')]=_[_0xd526('0x32')](db[_0xd526('0x2b')][_0xd526('0x2c')]);_0x1d350f[_0xd526('0x33')]=_[_0xd526('0x32')](_0x336e67[_0xd526('0x33')]);_0x1d350f[_0xd526('0x34')]=_[_0xd526('0x46')](_0x1d350f[_0xd526('0x30')],_0x1d350f[_0xd526('0x33')]);_0x28df24[_0xd526('0x35')]=_[_0xd526('0x46')](_0x1d350f[_0xd526('0x30')],qs[_0xd526('0x47')](_0x336e67['query'][_0xd526('0x47')]));_0x28df24[_0xd526('0x35')]=_0x28df24[_0xd526('0x35')][_0xd526('0x36')]?_0x28df24[_0xd526('0x35')]:_0x1d350f['model'];if(_0x336e67[_0xd526('0x33')][_0xd526('0x48')]){_0x28df24['include']=[{'all':!![]}];}_0x28df24=_[_0xd526('0x3d')]({},_0x28df24,_0x336e67['options']);return db['DeskConfiguration'][_0xd526('0x49')](_0x28df24)[_0xd526('0x25')](handleEntityNotFound(_0x1160a6,null))[_0xd526('0x25')](respondWithResult(_0x1160a6,null))[_0xd526('0x43')](handleError(_0x1160a6,null));};exports['create']=function(_0x3671d0,_0x290f19){return db[_0xd526('0x2b')][_0xd526('0x4a')](_0x3671d0[_0xd526('0x4b')],{})[_0xd526('0x25')](respondWithResult(_0x290f19,0xc9))[_0xd526('0x43')](handleError(_0x290f19,null));};exports[_0xd526('0x24')]=function(_0x4a4e30,_0x5905f0){if(_0x4a4e30[_0xd526('0x4b')]['id']){delete _0x4a4e30[_0xd526('0x4b')]['id'];}return db[_0xd526('0x2b')][_0xd526('0x49')]({'where':{'id':_0x4a4e30[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x5905f0,null))[_0xd526('0x25')](saveUpdates(_0x4a4e30[_0xd526('0x4b')],null))[_0xd526('0x25')](respondWithResult(_0x5905f0,null))[_0xd526('0x43')](handleError(_0x5905f0,null));};exports[_0xd526('0x4c')]=function(_0xf60420,_0x5930a5){return db['DeskConfiguration'][_0xd526('0x49')]({'where':{'id':_0xf60420[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x5930a5,null))[_0xd526('0x25')](removeEntity(_0x5930a5,null))['catch'](handleError(_0x5930a5,null));};exports[_0xd526('0x4d')]=function(_0x25b02d,_0x257fde,_0x1f6d15){var _0x46d3be={};var _0x25727f={};var _0x3ef07a;var _0x42a243;return db[_0xd526('0x2b')][_0xd526('0x4e')]({'where':{'id':_0x25b02d[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x257fde,null))[_0xd526('0x25')](function(_0x5a3efc){if(_0x5a3efc){_0x3ef07a=_0x5a3efc;_0x25727f[_0xd526('0x30')]=_['keys'](db[_0xd526('0x4f')][_0xd526('0x2c')]);_0x25727f['query']=_[_0xd526('0x32')](_0x25b02d[_0xd526('0x33')]);_0x25727f[_0xd526('0x34')]=_[_0xd526('0x46')](_0x25727f[_0xd526('0x30')],_0x25727f[_0xd526('0x33')]);_0x46d3be[_0xd526('0x35')]=_[_0xd526('0x46')](_0x25727f[_0xd526('0x30')],qs[_0xd526('0x47')](_0x25b02d[_0xd526('0x33')][_0xd526('0x47')]));_0x46d3be[_0xd526('0x35')]=_0x46d3be['attributes'][_0xd526('0x36')]?_0x46d3be['attributes']:_0x25727f[_0xd526('0x30')];_0x46d3be[_0xd526('0x50')]=qs[_0xd526('0x39')](_0x25b02d[_0xd526('0x33')][_0xd526('0x39')]);_0x46d3be[_0xd526('0x3c')]=qs[_0xd526('0x34')](_['pick'](_0x25b02d['query'],_0x25727f[_0xd526('0x34')]));if(_0x25b02d[_0xd526('0x33')][_0xd526('0x3b')]){_0x46d3be['where']=_[_0xd526('0x3d')](_0x46d3be[_0xd526('0x3c')],{'$or':_['map'](_0x46d3be[_0xd526('0x35')],function(_0x5beea6){var _0x533541={};_0x533541[_0x5beea6]={'$like':'%'+_0x25b02d[_0xd526('0x33')][_0xd526('0x3b')]+'%'};return _0x533541;})});}_0x46d3be=_[_0xd526('0x3d')]({},_0x46d3be,_0x25b02d[_0xd526('0x3f')]);return _0x3ef07a[_0xd526('0x4d')](_0x46d3be);}})['then'](function(_0x2b780d){if(_0x2b780d){_0x42a243=_0x2b780d['length'];if(!_0x25b02d[_0xd526('0x33')][_0xd526('0x37')](_0xd526('0x38'))){_0x46d3be['limit']=qs[_0xd526('0x1d')](_0x25b02d[_0xd526('0x33')]['limit']);_0x46d3be['offset']=qs[_0xd526('0x1b')](_0x25b02d['query']['offset']);}return _0x3ef07a[_0xd526('0x4d')](_0x46d3be);}})[_0xd526('0x25')](function(_0xc1bbb1){if(_0xc1bbb1){return _0xc1bbb1?{'count':_0x42a243,'rows':_0xc1bbb1}:null;}})[_0xd526('0x25')](respondWithResult(_0x257fde,null))[_0xd526('0x43')](handleError(_0x257fde,null));};exports['getSubjects']=function(_0x3b2f40,_0x49f07d,_0x204d46){var _0x202c8f={};var _0x350a16={};var _0xdeec0d;var _0x2176ba;return db[_0xd526('0x2b')][_0xd526('0x4e')]({'where':{'id':_0x3b2f40[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x49f07d,null))[_0xd526('0x25')](function(_0x42cf05){if(_0x42cf05){_0xdeec0d=_0x42cf05;_0x350a16[_0xd526('0x30')]=_[_0xd526('0x32')](db[_0xd526('0x4f')][_0xd526('0x2c')]);_0x350a16['query']=_[_0xd526('0x32')](_0x3b2f40[_0xd526('0x33')]);_0x350a16[_0xd526('0x34')]=_[_0xd526('0x46')](_0x350a16[_0xd526('0x30')],_0x350a16['query']);_0x202c8f['attributes']=_[_0xd526('0x46')](_0x350a16[_0xd526('0x30')],qs['fields'](_0x3b2f40[_0xd526('0x33')][_0xd526('0x47')]));_0x202c8f['attributes']=_0x202c8f[_0xd526('0x35')]['length']?_0x202c8f[_0xd526('0x35')]:_0x350a16[_0xd526('0x30')];_0x202c8f[_0xd526('0x50')]=qs[_0xd526('0x39')](_0x3b2f40[_0xd526('0x33')][_0xd526('0x39')]);_0x202c8f['where']=qs['filters'](_['pick'](_0x3b2f40[_0xd526('0x33')],_0x350a16['filters']));if(_0x3b2f40[_0xd526('0x33')][_0xd526('0x3b')]){_0x202c8f[_0xd526('0x3c')]=_[_0xd526('0x3d')](_0x202c8f['where'],{'$or':_[_0xd526('0x31')](_0x202c8f[_0xd526('0x35')],function(_0x5d02ee){var _0x28633b={};_0x28633b[_0x5d02ee]={'$like':'%'+_0x3b2f40['query']['filter']+'%'};return _0x28633b;})});}_0x202c8f=_[_0xd526('0x3d')]({},_0x202c8f,_0x3b2f40[_0xd526('0x3f')]);return _0xdeec0d['getSubjects'](_0x202c8f);}})[_0xd526('0x25')](function(_0xaf9a27){if(_0xaf9a27){_0x2176ba=_0xaf9a27[_0xd526('0x36')];if(!_0x3b2f40[_0xd526('0x33')][_0xd526('0x37')](_0xd526('0x38'))){_0x202c8f['limit']=qs['limit'](_0x3b2f40[_0xd526('0x33')][_0xd526('0x1d')]);_0x202c8f['offset']=qs[_0xd526('0x1b')](_0x3b2f40[_0xd526('0x33')][_0xd526('0x1b')]);}return _0xdeec0d[_0xd526('0x51')](_0x202c8f);}})['then'](function(_0x429150){if(_0x429150){return _0x429150?{'count':_0x2176ba,'rows':_0x429150}:null;}})[_0xd526('0x25')](respondWithResult(_0x49f07d,null))[_0xd526('0x43')](handleError(_0x49f07d,null));};exports[_0xd526('0x52')]=function(_0x5991fe,_0x109fb9,_0x420c76){var _0x376f69={};var _0x4e37ed={};var _0x41d085;var _0x24bd39;return db[_0xd526('0x2b')][_0xd526('0x4e')]({'where':{'id':_0x5991fe[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x109fb9,null))[_0xd526('0x25')](function(_0x513489){if(_0x513489){_0x41d085=_0x513489;_0x4e37ed[_0xd526('0x30')]=_['keys'](db[_0xd526('0x4f')][_0xd526('0x2c')]);_0x4e37ed[_0xd526('0x33')]=_[_0xd526('0x32')](_0x5991fe[_0xd526('0x33')]);_0x4e37ed['filters']=_[_0xd526('0x46')](_0x4e37ed[_0xd526('0x30')],_0x4e37ed['query']);_0x376f69[_0xd526('0x35')]=_['intersection'](_0x4e37ed[_0xd526('0x30')],qs[_0xd526('0x47')](_0x5991fe['query'][_0xd526('0x47')]));_0x376f69[_0xd526('0x35')]=_0x376f69[_0xd526('0x35')][_0xd526('0x36')]?_0x376f69[_0xd526('0x35')]:_0x4e37ed[_0xd526('0x30')];_0x376f69[_0xd526('0x50')]=qs[_0xd526('0x39')](_0x5991fe[_0xd526('0x33')]['sort']);_0x376f69[_0xd526('0x3c')]=qs[_0xd526('0x34')](_[_0xd526('0x3a')](_0x5991fe[_0xd526('0x33')],_0x4e37ed[_0xd526('0x34')]));if(_0x5991fe[_0xd526('0x33')][_0xd526('0x3b')]){_0x376f69[_0xd526('0x3c')]=_[_0xd526('0x3d')](_0x376f69['where'],{'$or':_[_0xd526('0x31')](_0x376f69['attributes'],function(_0x5c9326){var _0x58808d={};_0x58808d[_0x5c9326]={'$like':'%'+_0x5991fe['query'][_0xd526('0x3b')]+'%'};return _0x58808d;})});}_0x376f69=_[_0xd526('0x3d')]({},_0x376f69,_0x5991fe[_0xd526('0x3f')]);return _0x41d085['getDescriptions'](_0x376f69);}})[_0xd526('0x25')](function(_0x4041b1){if(_0x4041b1){_0x24bd39=_0x4041b1[_0xd526('0x36')];if(!_0x5991fe[_0xd526('0x33')][_0xd526('0x37')](_0xd526('0x38'))){_0x376f69[_0xd526('0x1d')]=qs['limit'](_0x5991fe['query'][_0xd526('0x1d')]);_0x376f69[_0xd526('0x1b')]=qs[_0xd526('0x1b')](_0x5991fe[_0xd526('0x33')][_0xd526('0x1b')]);}return _0x41d085['getDescriptions'](_0x376f69);}})[_0xd526('0x25')](function(_0x502f10){if(_0x502f10){return _0x502f10?{'count':_0x24bd39,'rows':_0x502f10}:null;}})[_0xd526('0x25')](respondWithResult(_0x109fb9,null))[_0xd526('0x43')](handleError(_0x109fb9,null));};exports[_0xd526('0x53')]=function(_0x502ceb,_0x5dcfb0,_0x326c48){var _0x5d4c49={};var _0x1fe3bf={};var _0x1d0b89;var _0x4bc0de;return db[_0xd526('0x2b')][_0xd526('0x4e')]({'where':{'id':_0x502ceb[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x5dcfb0,null))[_0xd526('0x25')](function(_0x23839b){if(_0x23839b){_0x1d0b89=_0x23839b;_0x1fe3bf[_0xd526('0x30')]=_[_0xd526('0x32')](db[_0xd526('0x54')]['rawAttributes']);_0x1fe3bf['query']=_[_0xd526('0x32')](_0x502ceb[_0xd526('0x33')]);_0x1fe3bf['filters']=_[_0xd526('0x46')](_0x1fe3bf[_0xd526('0x30')],_0x1fe3bf[_0xd526('0x33')]);_0x5d4c49[_0xd526('0x35')]=_[_0xd526('0x46')](_0x1fe3bf[_0xd526('0x30')],qs[_0xd526('0x47')](_0x502ceb[_0xd526('0x33')][_0xd526('0x47')]));_0x5d4c49[_0xd526('0x35')]=_0x5d4c49['attributes'][_0xd526('0x36')]?_0x5d4c49[_0xd526('0x35')]:_0x1fe3bf[_0xd526('0x30')];_0x5d4c49[_0xd526('0x50')]=qs[_0xd526('0x39')](_0x502ceb[_0xd526('0x33')][_0xd526('0x39')]);_0x5d4c49[_0xd526('0x3c')]=qs[_0xd526('0x34')](_['pick'](_0x502ceb[_0xd526('0x33')],_0x1fe3bf['filters']));if(_0x502ceb[_0xd526('0x33')][_0xd526('0x3b')]){_0x5d4c49[_0xd526('0x3c')]=_[_0xd526('0x3d')](_0x5d4c49[_0xd526('0x3c')],{'$or':_[_0xd526('0x31')](_0x5d4c49[_0xd526('0x35')],function(_0x2249ed){var _0x3e0079={};_0x3e0079[_0x2249ed]={'$like':'%'+_0x502ceb[_0xd526('0x33')][_0xd526('0x3b')]+'%'};return _0x3e0079;})});}_0x5d4c49=_[_0xd526('0x3d')]({},_0x5d4c49,_0x502ceb[_0xd526('0x3f')]);return _0x1d0b89[_0xd526('0x53')](_0x5d4c49);}})['then'](function(_0x5ae9c3){if(_0x5ae9c3){_0x4bc0de=_0x5ae9c3[_0xd526('0x36')];if(!_0x502ceb[_0xd526('0x33')][_0xd526('0x37')](_0xd526('0x38'))){_0x5d4c49[_0xd526('0x1d')]=qs['limit'](_0x502ceb[_0xd526('0x33')][_0xd526('0x1d')]);_0x5d4c49['offset']=qs['offset'](_0x502ceb[_0xd526('0x33')][_0xd526('0x1b')]);}return _0x1d0b89[_0xd526('0x53')](_0x5d4c49);}})[_0xd526('0x25')](function(_0x232147){if(_0x232147){return _0x232147?{'count':_0x4bc0de,'rows':_0x232147}:null;}})['then'](respondWithResult(_0x5dcfb0,null))[_0xd526('0x43')](handleError(_0x5dcfb0,null));};exports[_0xd526('0x55')]=function(_0x5930a4,_0x4165c0,_0x922152){if(_0x5930a4[_0xd526('0x4b')]['id']){delete _0x5930a4[_0xd526('0x4b')]['id'];}return db['DeskConfiguration'][_0xd526('0x4e')]({'where':{'id':_0x5930a4[_0xd526('0x45')]['id']}})[_0xd526('0x25')](handleEntityNotFound(_0x4165c0,null))[_0xd526('0x25')](function(_0x7ddf08){if(_0x7ddf08){return _0x7ddf08[_0xd526('0x55')](_0x5930a4[_0xd526('0x4b')]['ids']||[]);}return null;})[_0xd526('0x25')](respondWithResult(_0x4165c0,null))[_0xd526('0x43')](handleError(_0x4165c0,null));}; \ No newline at end of file +var _0xf8b9=['setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/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','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','DeskConfiguration','includeAll','include','rows','catch','show','params','options','find','create','body','update','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag'];(function(_0x3e8eb3,_0x44a275){var _0x136dc4=function(_0x198fd8){while(--_0x198fd8){_0x3e8eb3['push'](_0x3e8eb3['shift']());}};_0x136dc4(++_0x44a275);}(_0xf8b9,0xb2));var _0x9f8b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f8b('0x0'));var zipdir=require(_0x9f8b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f8b('0x2'));var moment=require(_0x9f8b('0x3'));var BPromise=require(_0x9f8b('0x4'));var Mustache=require(_0x9f8b('0x5'));var util=require(_0x9f8b('0x6'));var path=require('path');var sox=require(_0x9f8b('0x7'));var csv=require(_0x9f8b('0x8'));var ejs=require(_0x9f8b('0x9'));var fs=require('fs');var fs_extra=require(_0x9f8b('0xa'));var _=require(_0x9f8b('0xb'));var squel=require('squel');var crypto=require(_0x9f8b('0xc'));var jsforce=require(_0x9f8b('0xd'));var deskjs=require(_0x9f8b('0xe'));var toCsv=require(_0x9f8b('0x8'));var querystring=require(_0x9f8b('0xf'));var Papa=require(_0x9f8b('0x10'));var Redis=require(_0x9f8b('0x11'));var authService=require(_0x9f8b('0x12'));var qs=require(_0x9f8b('0x13'));var as=require(_0x9f8b('0x14'));var hardwareService=require(_0x9f8b('0x15'));var logger=require(_0x9f8b('0x16'))(_0x9f8b('0x17'));var utils=require(_0x9f8b('0x18'));var config=require(_0x9f8b('0x19'));var licenseUtil=require(_0x9f8b('0x1a'));var db=require(_0x9f8b('0x1b'))['db'];function respondWithStatusCode(_0x2d4c1c,_0x2207f6){_0x2207f6=_0x2207f6||0xcc;return function(_0x262634){if(_0x262634){return _0x2d4c1c[_0x9f8b('0x1c')](_0x2207f6);}return _0x2d4c1c[_0x9f8b('0x1d')](_0x2207f6)[_0x9f8b('0x1e')]();};}function respondWithResult(_0x45c0aa,_0x1b2341){_0x1b2341=_0x1b2341||0xc8;return function(_0xfc0665){if(_0xfc0665){return _0x45c0aa['status'](_0x1b2341)[_0x9f8b('0x1f')](_0xfc0665);}};}function respondWithFilteredResult(_0x4e18b6,_0x1eb495){return function(_0x4b5660){if(_0x4b5660){var _0x14ea03=typeof _0x1eb495[_0x9f8b('0x20')]===_0x9f8b('0x21')&&typeof _0x1eb495[_0x9f8b('0x22')]==='undefined';var _0xd13708=_0x4b5660[_0x9f8b('0x23')];var _0x40ca18=_0x14ea03?0x0:_0x1eb495['offset'];var _0x34e8e0=_0x14ea03?_0x4b5660[_0x9f8b('0x23')]:_0x1eb495[_0x9f8b('0x20')]+_0x1eb495[_0x9f8b('0x22')];var _0x2f1d69;if(_0x34e8e0>=_0xd13708){_0x34e8e0=_0xd13708;_0x2f1d69=0xc8;}else{_0x2f1d69=0xce;}_0x4e18b6[_0x9f8b('0x1d')](_0x2f1d69);return _0x4e18b6[_0x9f8b('0x24')](_0x9f8b('0x25'),_0x40ca18+'-'+_0x34e8e0+'/'+_0xd13708)[_0x9f8b('0x1f')](_0x4b5660);}return null;};}function patchUpdates(_0x4992c1){return function(_0x4441db){try{jsonpatch[_0x9f8b('0x26')](_0x4441db,_0x4992c1,!![]);}catch(_0x256b40){return BPromise[_0x9f8b('0x27')](_0x256b40);}return _0x4441db['save']();};}function saveUpdates(_0x4cda9a,_0x18d622){return function(_0x396083){if(_0x396083){return _0x396083['update'](_0x4cda9a)[_0x9f8b('0x28')](function(_0x2c72b8){return _0x2c72b8;});}return null;};}function removeEntity(_0x14795a,_0x4a69c5){return function(_0x58a7c0){if(_0x58a7c0){return _0x58a7c0[_0x9f8b('0x29')]()[_0x9f8b('0x28')](function(){_0x14795a['status'](0xcc)[_0x9f8b('0x1e')]();});}};}function handleEntityNotFound(_0x2f17eb,_0x279c28){return function(_0x5b3083){if(!_0x5b3083){_0x2f17eb[_0x9f8b('0x1c')](0x194);}return _0x5b3083;};}function handleError(_0x2a59d7,_0x4d4e09){_0x4d4e09=_0x4d4e09||0x1f4;return function(_0x4e7db5){logger['error'](_0x4e7db5[_0x9f8b('0x2a')]);if(_0x4e7db5[_0x9f8b('0x2b')]){delete _0x4e7db5[_0x9f8b('0x2b')];}_0x2a59d7[_0x9f8b('0x1d')](_0x4d4e09)[_0x9f8b('0x2c')](_0x4e7db5);};}exports[_0x9f8b('0x2d')]=function(_0x3e504c,_0x55b925){var _0x1e3650={},_0x32931b={},_0x1df761={'count':0x0,'rows':[]};var _0x5dca70=_['map'](db['DeskConfiguration'][_0x9f8b('0x2e')],function(_0x371700){return{'name':_0x371700[_0x9f8b('0x2f')],'type':_0x371700['type'][_0x9f8b('0x30')]};});_0x32931b[_0x9f8b('0x31')]=_[_0x9f8b('0x32')](_0x5dca70,_0x9f8b('0x2b'));_0x32931b['query']=_[_0x9f8b('0x33')](_0x3e504c['query']);_0x32931b[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0x32931b[_0x9f8b('0x31')],_0x32931b[_0x9f8b('0x36')]);_0x1e3650[_0x9f8b('0x37')]=_[_0x9f8b('0x35')](_0x32931b[_0x9f8b('0x31')],qs['fields'](_0x3e504c[_0x9f8b('0x36')][_0x9f8b('0x38')]));_0x1e3650['attributes']=_0x1e3650['attributes'][_0x9f8b('0x39')]?_0x1e3650['attributes']:_0x32931b['model'];if(!_0x3e504c[_0x9f8b('0x36')][_0x9f8b('0x3a')](_0x9f8b('0x3b'))){_0x1e3650['limit']=qs[_0x9f8b('0x22')](_0x3e504c[_0x9f8b('0x36')]['limit']);_0x1e3650[_0x9f8b('0x20')]=qs['offset'](_0x3e504c[_0x9f8b('0x36')][_0x9f8b('0x20')]);}_0x1e3650[_0x9f8b('0x3c')]=qs[_0x9f8b('0x3d')](_0x3e504c[_0x9f8b('0x36')][_0x9f8b('0x3d')]);_0x1e3650['where']=qs[_0x9f8b('0x34')](_[_0x9f8b('0x3e')](_0x3e504c[_0x9f8b('0x36')],_0x32931b[_0x9f8b('0x34')]),_0x5dca70);if(_0x3e504c[_0x9f8b('0x36')]['filter']){_0x1e3650[_0x9f8b('0x3f')]=_[_0x9f8b('0x40')](_0x1e3650['where'],{'$or':_[_0x9f8b('0x32')](_0x5dca70,function(_0x43deb4){if(_0x43deb4['type']!==_0x9f8b('0x41')){var _0x9c5358={};_0x9c5358[_0x43deb4['name']]={'$like':'%'+_0x3e504c[_0x9f8b('0x36')][_0x9f8b('0x42')]+'%'};return _0x9c5358;}})});}_0x1e3650=_[_0x9f8b('0x40')]({},_0x1e3650,_0x3e504c['options']);var _0x4e1ef4={'where':_0x1e3650[_0x9f8b('0x3f')]};return db[_0x9f8b('0x43')]['count'](_0x4e1ef4)['then'](function(_0x24570f){_0x1df761[_0x9f8b('0x23')]=_0x24570f;if(_0x3e504c['query'][_0x9f8b('0x44')]){_0x1e3650[_0x9f8b('0x45')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x1e3650);})[_0x9f8b('0x28')](function(_0x2655c3){_0x1df761[_0x9f8b('0x46')]=_0x2655c3;return _0x1df761;})[_0x9f8b('0x28')](respondWithFilteredResult(_0x55b925,_0x1e3650))[_0x9f8b('0x47')](handleError(_0x55b925,null));};exports[_0x9f8b('0x48')]=function(_0x25bfe8,_0x55248e){var _0x18dda4={'raw':![],'where':{'id':_0x25bfe8[_0x9f8b('0x49')]['id']}},_0x2170fa={};_0x2170fa[_0x9f8b('0x31')]=_[_0x9f8b('0x33')](db[_0x9f8b('0x43')][_0x9f8b('0x2e')]);_0x2170fa['query']=_[_0x9f8b('0x33')](_0x25bfe8[_0x9f8b('0x36')]);_0x2170fa['filters']=_[_0x9f8b('0x35')](_0x2170fa[_0x9f8b('0x31')],_0x2170fa[_0x9f8b('0x36')]);_0x18dda4['attributes']=_['intersection'](_0x2170fa[_0x9f8b('0x31')],qs[_0x9f8b('0x38')](_0x25bfe8[_0x9f8b('0x36')][_0x9f8b('0x38')]));_0x18dda4['attributes']=_0x18dda4[_0x9f8b('0x37')]['length']?_0x18dda4['attributes']:_0x2170fa['model'];if(_0x25bfe8['query'][_0x9f8b('0x44')]){_0x18dda4[_0x9f8b('0x45')]=[{'all':!![]}];}_0x18dda4=_[_0x9f8b('0x40')]({},_0x18dda4,_0x25bfe8[_0x9f8b('0x4a')]);return db['DeskConfiguration'][_0x9f8b('0x4b')](_0x18dda4)['then'](handleEntityNotFound(_0x55248e,null))[_0x9f8b('0x28')](respondWithResult(_0x55248e,null))[_0x9f8b('0x47')](handleError(_0x55248e,null));};exports[_0x9f8b('0x4c')]=function(_0x2d8a93,_0x4b666d){return db[_0x9f8b('0x43')]['create'](_0x2d8a93[_0x9f8b('0x4d')],{})['then'](respondWithResult(_0x4b666d,0xc9))[_0x9f8b('0x47')](handleError(_0x4b666d,null));};exports[_0x9f8b('0x4e')]=function(_0x1d279d,_0x5778de){if(_0x1d279d['body']['id']){delete _0x1d279d[_0x9f8b('0x4d')]['id'];}return db[_0x9f8b('0x43')][_0x9f8b('0x4b')]({'where':{'id':_0x1d279d[_0x9f8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x5778de,null))[_0x9f8b('0x28')](saveUpdates(_0x1d279d[_0x9f8b('0x4d')],null))['then'](respondWithResult(_0x5778de,null))[_0x9f8b('0x47')](handleError(_0x5778de,null));};exports[_0x9f8b('0x29')]=function(_0x6e0f21,_0x4ff39e){return db['DeskConfiguration'][_0x9f8b('0x4b')]({'where':{'id':_0x6e0f21[_0x9f8b('0x49')]['id']}})[_0x9f8b('0x28')](handleEntityNotFound(_0x4ff39e,null))['then'](removeEntity(_0x4ff39e,null))['catch'](handleError(_0x4ff39e,null));};exports[_0x9f8b('0x4f')]=function(_0x478ee3,_0x585bd3,_0x57c398){var _0x1f5e02={};var _0x1ddf00={};var _0x43a6c9;var _0x55f150;return db['DeskConfiguration'][_0x9f8b('0x50')]({'where':{'id':_0x478ee3[_0x9f8b('0x49')]['id']}})[_0x9f8b('0x28')](handleEntityNotFound(_0x585bd3,null))['then'](function(_0x354c5a){if(_0x354c5a){_0x43a6c9=_0x354c5a;_0x1ddf00[_0x9f8b('0x31')]=_[_0x9f8b('0x33')](db[_0x9f8b('0x51')][_0x9f8b('0x2e')]);_0x1ddf00[_0x9f8b('0x36')]=_[_0x9f8b('0x33')](_0x478ee3[_0x9f8b('0x36')]);_0x1ddf00[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0x1ddf00['model'],_0x1ddf00[_0x9f8b('0x36')]);_0x1f5e02['attributes']=_[_0x9f8b('0x35')](_0x1ddf00[_0x9f8b('0x31')],qs['fields'](_0x478ee3[_0x9f8b('0x36')][_0x9f8b('0x38')]));_0x1f5e02[_0x9f8b('0x37')]=_0x1f5e02['attributes'][_0x9f8b('0x39')]?_0x1f5e02[_0x9f8b('0x37')]:_0x1ddf00['model'];_0x1f5e02[_0x9f8b('0x3c')]=qs[_0x9f8b('0x3d')](_0x478ee3['query']['sort']);_0x1f5e02[_0x9f8b('0x3f')]=qs['filters'](_[_0x9f8b('0x3e')](_0x478ee3[_0x9f8b('0x36')],_0x1ddf00[_0x9f8b('0x34')]));if(_0x478ee3[_0x9f8b('0x36')][_0x9f8b('0x42')]){_0x1f5e02['where']=_[_0x9f8b('0x40')](_0x1f5e02[_0x9f8b('0x3f')],{'$or':_['map'](_0x1f5e02['attributes'],function(_0x4e107d){var _0xd10ae3={};_0xd10ae3[_0x4e107d]={'$like':'%'+_0x478ee3[_0x9f8b('0x36')][_0x9f8b('0x42')]+'%'};return _0xd10ae3;})});}_0x1f5e02=_[_0x9f8b('0x40')]({},_0x1f5e02,_0x478ee3[_0x9f8b('0x4a')]);return _0x43a6c9['getFields'](_0x1f5e02);}})[_0x9f8b('0x28')](function(_0x51a4e2){if(_0x51a4e2){_0x55f150=_0x51a4e2['length'];if(!_0x478ee3[_0x9f8b('0x36')][_0x9f8b('0x3a')]('nolimit')){_0x1f5e02[_0x9f8b('0x22')]=qs['limit'](_0x478ee3['query'][_0x9f8b('0x22')]);_0x1f5e02[_0x9f8b('0x20')]=qs[_0x9f8b('0x20')](_0x478ee3[_0x9f8b('0x36')][_0x9f8b('0x20')]);}return _0x43a6c9[_0x9f8b('0x4f')](_0x1f5e02);}})['then'](function(_0x489f97){if(_0x489f97){return _0x489f97?{'count':_0x55f150,'rows':_0x489f97}:null;}})['then'](respondWithResult(_0x585bd3,null))[_0x9f8b('0x47')](handleError(_0x585bd3,null));};exports[_0x9f8b('0x52')]=function(_0xa4ee6e,_0x57e365,_0x4e90ba){var _0x104cbb={};var _0x4cc515={};var _0x168c63;var _0x2fb1f1;return db[_0x9f8b('0x43')][_0x9f8b('0x50')]({'where':{'id':_0xa4ee6e[_0x9f8b('0x49')]['id']}})[_0x9f8b('0x28')](handleEntityNotFound(_0x57e365,null))[_0x9f8b('0x28')](function(_0xaa47f1){if(_0xaa47f1){_0x168c63=_0xaa47f1;_0x4cc515[_0x9f8b('0x31')]=_[_0x9f8b('0x33')](db['DeskField'][_0x9f8b('0x2e')]);_0x4cc515[_0x9f8b('0x36')]=_[_0x9f8b('0x33')](_0xa4ee6e[_0x9f8b('0x36')]);_0x4cc515[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0x4cc515[_0x9f8b('0x31')],_0x4cc515['query']);_0x104cbb[_0x9f8b('0x37')]=_['intersection'](_0x4cc515[_0x9f8b('0x31')],qs['fields'](_0xa4ee6e[_0x9f8b('0x36')][_0x9f8b('0x38')]));_0x104cbb['attributes']=_0x104cbb['attributes']['length']?_0x104cbb['attributes']:_0x4cc515[_0x9f8b('0x31')];_0x104cbb[_0x9f8b('0x3c')]=qs['sort'](_0xa4ee6e['query'][_0x9f8b('0x3d')]);_0x104cbb['where']=qs[_0x9f8b('0x34')](_[_0x9f8b('0x3e')](_0xa4ee6e[_0x9f8b('0x36')],_0x4cc515[_0x9f8b('0x34')]));if(_0xa4ee6e[_0x9f8b('0x36')][_0x9f8b('0x42')]){_0x104cbb[_0x9f8b('0x3f')]=_[_0x9f8b('0x40')](_0x104cbb[_0x9f8b('0x3f')],{'$or':_['map'](_0x104cbb[_0x9f8b('0x37')],function(_0x511fc7){var _0x1a552b={};_0x1a552b[_0x511fc7]={'$like':'%'+_0xa4ee6e['query'][_0x9f8b('0x42')]+'%'};return _0x1a552b;})});}_0x104cbb=_[_0x9f8b('0x40')]({},_0x104cbb,_0xa4ee6e[_0x9f8b('0x4a')]);return _0x168c63['getSubjects'](_0x104cbb);}})[_0x9f8b('0x28')](function(_0x47c4f1){if(_0x47c4f1){_0x2fb1f1=_0x47c4f1[_0x9f8b('0x39')];if(!_0xa4ee6e[_0x9f8b('0x36')][_0x9f8b('0x3a')](_0x9f8b('0x3b'))){_0x104cbb[_0x9f8b('0x22')]=qs[_0x9f8b('0x22')](_0xa4ee6e[_0x9f8b('0x36')][_0x9f8b('0x22')]);_0x104cbb[_0x9f8b('0x20')]=qs[_0x9f8b('0x20')](_0xa4ee6e['query'][_0x9f8b('0x20')]);}return _0x168c63[_0x9f8b('0x52')](_0x104cbb);}})[_0x9f8b('0x28')](function(_0x49f68d){if(_0x49f68d){return _0x49f68d?{'count':_0x2fb1f1,'rows':_0x49f68d}:null;}})[_0x9f8b('0x28')](respondWithResult(_0x57e365,null))[_0x9f8b('0x47')](handleError(_0x57e365,null));};exports['getDescriptions']=function(_0x545376,_0x399881,_0x1307b5){var _0x4174e={};var _0x534d82={};var _0x290750;var _0x8acc8e;return db[_0x9f8b('0x43')]['findOne']({'where':{'id':_0x545376[_0x9f8b('0x49')]['id']}})[_0x9f8b('0x28')](handleEntityNotFound(_0x399881,null))[_0x9f8b('0x28')](function(_0x18f3da){if(_0x18f3da){_0x290750=_0x18f3da;_0x534d82[_0x9f8b('0x31')]=_[_0x9f8b('0x33')](db[_0x9f8b('0x51')][_0x9f8b('0x2e')]);_0x534d82['query']=_['keys'](_0x545376[_0x9f8b('0x36')]);_0x534d82['filters']=_[_0x9f8b('0x35')](_0x534d82[_0x9f8b('0x31')],_0x534d82[_0x9f8b('0x36')]);_0x4174e[_0x9f8b('0x37')]=_['intersection'](_0x534d82[_0x9f8b('0x31')],qs[_0x9f8b('0x38')](_0x545376[_0x9f8b('0x36')]['fields']));_0x4174e[_0x9f8b('0x37')]=_0x4174e[_0x9f8b('0x37')]['length']?_0x4174e[_0x9f8b('0x37')]:_0x534d82[_0x9f8b('0x31')];_0x4174e[_0x9f8b('0x3c')]=qs[_0x9f8b('0x3d')](_0x545376[_0x9f8b('0x36')][_0x9f8b('0x3d')]);_0x4174e[_0x9f8b('0x3f')]=qs[_0x9f8b('0x34')](_[_0x9f8b('0x3e')](_0x545376[_0x9f8b('0x36')],_0x534d82[_0x9f8b('0x34')]));if(_0x545376['query'][_0x9f8b('0x42')]){_0x4174e[_0x9f8b('0x3f')]=_[_0x9f8b('0x40')](_0x4174e[_0x9f8b('0x3f')],{'$or':_[_0x9f8b('0x32')](_0x4174e[_0x9f8b('0x37')],function(_0x3cab3a){var _0x29490a={};_0x29490a[_0x3cab3a]={'$like':'%'+_0x545376[_0x9f8b('0x36')][_0x9f8b('0x42')]+'%'};return _0x29490a;})});}_0x4174e=_[_0x9f8b('0x40')]({},_0x4174e,_0x545376[_0x9f8b('0x4a')]);return _0x290750[_0x9f8b('0x53')](_0x4174e);}})[_0x9f8b('0x28')](function(_0x43b6fe){if(_0x43b6fe){_0x8acc8e=_0x43b6fe['length'];if(!_0x545376[_0x9f8b('0x36')]['hasOwnProperty']('nolimit')){_0x4174e[_0x9f8b('0x22')]=qs[_0x9f8b('0x22')](_0x545376[_0x9f8b('0x36')][_0x9f8b('0x22')]);_0x4174e[_0x9f8b('0x20')]=qs['offset'](_0x545376[_0x9f8b('0x36')]['offset']);}return _0x290750['getDescriptions'](_0x4174e);}})[_0x9f8b('0x28')](function(_0x5498c0){if(_0x5498c0){return _0x5498c0?{'count':_0x8acc8e,'rows':_0x5498c0}:null;}})[_0x9f8b('0x28')](respondWithResult(_0x399881,null))[_0x9f8b('0x47')](handleError(_0x399881,null));};exports[_0x9f8b('0x54')]=function(_0xcce672,_0x4ab4da,_0x8d5869){var _0xa169c9={};var _0x3c6ab5={};var _0x3e31f3;var _0xbc41c6;return db[_0x9f8b('0x43')][_0x9f8b('0x50')]({'where':{'id':_0xcce672['params']['id']}})['then'](handleEntityNotFound(_0x4ab4da,null))[_0x9f8b('0x28')](function(_0x5d4a6d){if(_0x5d4a6d){_0x3e31f3=_0x5d4a6d;_0x3c6ab5[_0x9f8b('0x31')]=_[_0x9f8b('0x33')](db[_0x9f8b('0x55')][_0x9f8b('0x2e')]);_0x3c6ab5[_0x9f8b('0x36')]=_[_0x9f8b('0x33')](_0xcce672[_0x9f8b('0x36')]);_0x3c6ab5[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0x3c6ab5['model'],_0x3c6ab5[_0x9f8b('0x36')]);_0xa169c9['attributes']=_[_0x9f8b('0x35')](_0x3c6ab5['model'],qs[_0x9f8b('0x38')](_0xcce672[_0x9f8b('0x36')][_0x9f8b('0x38')]));_0xa169c9['attributes']=_0xa169c9['attributes'][_0x9f8b('0x39')]?_0xa169c9['attributes']:_0x3c6ab5[_0x9f8b('0x31')];_0xa169c9[_0x9f8b('0x3c')]=qs[_0x9f8b('0x3d')](_0xcce672[_0x9f8b('0x36')][_0x9f8b('0x3d')]);_0xa169c9[_0x9f8b('0x3f')]=qs[_0x9f8b('0x34')](_[_0x9f8b('0x3e')](_0xcce672['query'],_0x3c6ab5[_0x9f8b('0x34')]));if(_0xcce672[_0x9f8b('0x36')]['filter']){_0xa169c9['where']=_[_0x9f8b('0x40')](_0xa169c9['where'],{'$or':_['map'](_0xa169c9[_0x9f8b('0x37')],function(_0x4d2c70){var _0x2a010e={};_0x2a010e[_0x4d2c70]={'$like':'%'+_0xcce672[_0x9f8b('0x36')][_0x9f8b('0x42')]+'%'};return _0x2a010e;})});}_0xa169c9=_[_0x9f8b('0x40')]({},_0xa169c9,_0xcce672[_0x9f8b('0x4a')]);return _0x3e31f3[_0x9f8b('0x54')](_0xa169c9);}})[_0x9f8b('0x28')](function(_0x378db6){if(_0x378db6){_0xbc41c6=_0x378db6[_0x9f8b('0x39')];if(!_0xcce672[_0x9f8b('0x36')]['hasOwnProperty'](_0x9f8b('0x3b'))){_0xa169c9[_0x9f8b('0x22')]=qs[_0x9f8b('0x22')](_0xcce672['query'][_0x9f8b('0x22')]);_0xa169c9['offset']=qs[_0x9f8b('0x20')](_0xcce672['query'][_0x9f8b('0x20')]);}return _0x3e31f3[_0x9f8b('0x54')](_0xa169c9);}})[_0x9f8b('0x28')](function(_0x7c3c35){if(_0x7c3c35){return _0x7c3c35?{'count':_0xbc41c6,'rows':_0x7c3c35}:null;}})['then'](respondWithResult(_0x4ab4da,null))[_0x9f8b('0x47')](handleError(_0x4ab4da,null));};exports[_0x9f8b('0x56')]=function(_0xc1ac2d,_0x563e60,_0x400e75){if(_0xc1ac2d[_0x9f8b('0x4d')]['id']){delete _0xc1ac2d[_0x9f8b('0x4d')]['id'];}return db[_0x9f8b('0x43')][_0x9f8b('0x50')]({'where':{'id':_0xc1ac2d['params']['id']}})['then'](handleEntityNotFound(_0x563e60,null))[_0x9f8b('0x28')](function(_0x35940e){if(_0x35940e){return _0x35940e[_0x9f8b('0x56')](_0xc1ac2d[_0x9f8b('0x4d')][_0x9f8b('0x57')]||[]);}return null;})[_0x9f8b('0x28')](respondWithResult(_0x563e60,null))['catch'](handleError(_0x563e60,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 02d0863..b114973 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 _0x766f=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x299d43,_0x4ebe75){var _0x2173b6=function(_0x588394){while(--_0x588394){_0x299d43['push'](_0x299d43['shift']());}};_0x2173b6(++_0x4ebe75);}(_0x766f,0xe9));var _0xf766=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x766f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xf766('0x0'));var util=require(_0xf766('0x1'));var logger=require(_0xf766('0x2'))(_0xf766('0x3'));var moment=require(_0xf766('0x4'));var BPromise=require('bluebird');var rp=require(_0xf766('0x5'));var fs=require('fs');var path=require(_0xf766('0x6'));var rimraf=require(_0xf766('0x7'));var config=require(_0xf766('0x8'));var attributes=require(_0xf766('0x9'));module[_0xf766('0xa')]=function(_0x2920ac,_0x4a9221){return _0x2920ac[_0xf766('0xb')](_0xf766('0xc'),attributes,{'tableName':_0xf766('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2289=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration'];(function(_0x3df964,_0x432f3f){var _0x5e016a=function(_0x3ec43e){while(--_0x3ec43e){_0x3df964['push'](_0x3df964['shift']());}};_0x5e016a(++_0x432f3f);}(_0x2289,0xc6));var _0x9228=function(_0x86d565,_0xdec926){_0x86d565=_0x86d565-0x0;var _0x6d833a=_0x2289[_0x86d565];return _0x6d833a;};'use strict';var _=require(_0x9228('0x0'));var util=require(_0x9228('0x1'));var logger=require(_0x9228('0x2'))('api');var moment=require(_0x9228('0x3'));var BPromise=require(_0x9228('0x4'));var rp=require(_0x9228('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9228('0x6'));var config=require(_0x9228('0x7'));var attributes=require(_0x9228('0x8'));module[_0x9228('0x9')]=function(_0x1456ac,_0x22c518){return _0x1456ac['define'](_0x9228('0xa'),attributes,{'tableName':'int_desk_configurations','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 a8f1af4..c6fd760 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 _0x4c99=['debug','stringify','error','code','message','result','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x32bd44,_0x50ef4b){var _0xbc51fb=function(_0x241b86){while(--_0x241b86){_0x32bd44['push'](_0x32bd44['shift']());}};_0xbc51fb(++_0x50ef4b);}(_0x4c99,0x1ec));var _0x94c9=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x4c99[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var moment=require(_0x94c9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94c9('0x2'))['db'];var utils=require(_0x94c9('0x3'));var logger=require('../../config/logger')(_0x94c9('0x4'));var config=require(_0x94c9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x94c9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ebd2b,_0x49b85b,_0x23d961){return new BPromise(function(_0x4403ba,_0x3a1743){return client[_0x94c9('0x7')](_0x4ebd2b,_0x23d961)[_0x94c9('0x8')](function(_0x1c0983){logger[_0x94c9('0x9')](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));logger[_0x94c9('0xc')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x49b85b,_0x94c9('0xb'),JSON[_0x94c9('0xd')](_0x1c0983));if(_0x1c0983[_0x94c9('0xe')]){if(_0x1c0983['error'][_0x94c9('0xf')]===0x1f4){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);return _0x3a1743(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}logger[_0x94c9('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x49b85b,_0x1c0983['error']['message']);return _0x4403ba(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}else{logger['info'](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));_0x4403ba(_0x1c0983[_0x94c9('0x11')]['message']);}})['catch'](function(_0x447937){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x447937);_0x3a1743(_0x447937);});});} \ No newline at end of file +var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x103f6e,_0x5cc202){var _0x499225=function(_0x149764){while(--_0x149764){_0x103f6e['push'](_0x103f6e['shift']());}};_0x499225(++_0x5cc202);}(_0x4910,0x1d9));var _0x0491=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4910[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d901367..81b8680 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 _0x29b1=['show','post','put','update','destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x29b1,0xbb));var _0x129b=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x29b1[_0x1abb09];return _0xea1c07;};'use strict';var multer=require('multer');var util=require(_0x129b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x129b('0x1')]();var fs_extra=require(_0x129b('0x2'));var auth=require(_0x129b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x129b('0x4'));var controller=require(_0x129b('0x5'));router[_0x129b('0x6')]('/',auth[_0x129b('0x7')](),controller['index']);router[_0x129b('0x6')](_0x129b('0x8'),auth[_0x129b('0x7')](),controller[_0x129b('0x9')]);router[_0x129b('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x129b('0xb')](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xc')]);router['delete'](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x4e4c=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete','destroy'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x4e4c,0x176));var _0xc4e4=function(_0x5d56d8,_0x3c9d9d){_0x5d56d8=_0x5d56d8-0x0;var _0x3c1fd3=_0x4e4c[_0x5d56d8];return _0x3c1fd3;};'use strict';var multer=require(_0xc4e4('0x0'));var util=require(_0xc4e4('0x1'));var path=require(_0xc4e4('0x2'));var timeout=require(_0xc4e4('0x3'));var express=require('express');var router=express[_0xc4e4('0x4')]();var fs_extra=require(_0xc4e4('0x5'));var auth=require(_0xc4e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc4e4('0x7'));var controller=require('./intDeskField.controller');router[_0xc4e4('0x8')]('/',auth[_0xc4e4('0x9')](),controller['index']);router[_0xc4e4('0x8')](_0xc4e4('0xa'),auth[_0xc4e4('0x9')](),controller['show']);router[_0xc4e4('0xb')]('/',auth[_0xc4e4('0x9')](),controller[_0xc4e4('0xc')]);router[_0xc4e4('0xd')](_0xc4e4('0xa'),auth[_0xc4e4('0x9')](),controller[_0xc4e4('0xe')]);router[_0xc4e4('0xf')](_0xc4e4('0xa'),auth[_0xc4e4('0x9')](),controller[_0xc4e4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 16c381b..c42d9e0 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 _0x7c11=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x732e09,_0x4bd3f9){var _0x14c534=function(_0x25c636){while(--_0x25c636){_0x732e09['push'](_0x732e09['shift']());}};_0x14c534(++_0x4bd3f9);}(_0x7c11,0x101));var _0x17c1=function(_0xf8fec7,_0x4f8e96){_0xf8fec7=_0xf8fec7-0x0;var _0x18800a=_0x7c11[_0xf8fec7];return _0x18800a;};'use strict';var Sequelize=require(_0x17c1('0x0'));module[_0x17c1('0x1')]={'type':{'type':Sequelize[_0x17c1('0x2')](_0x17c1('0x3'),_0x17c1('0x4'),_0x17c1('0x5'),_0x17c1('0x6'),_0x17c1('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x17c1('0x8')]},'key':{'type':Sequelize[_0x17c1('0x8')]},'keyType':{'type':Sequelize[_0x17c1('0x2')]('string',_0x17c1('0x4'),_0x17c1('0x5'))},'keyContent':{'type':Sequelize[_0x17c1('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x17c1('0x8')]},'customField':{'type':Sequelize[_0x17c1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17c1('0x8')]}}; \ No newline at end of file +var _0x71f5=['customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x1f30fe,_0x4e89b9){var _0x3c8f0d=function(_0x115b25){while(--_0x115b25){_0x1f30fe['push'](_0x1f30fe['shift']());}};_0x3c8f0d(++_0x4e89b9);}(_0x71f5,0x14f));var _0x571f=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0x71f5[_0x24f326];return _0x488e2d;};'use strict';var Sequelize=require('sequelize');module[_0x571f('0x0')]={'type':{'type':Sequelize[_0x571f('0x1')](_0x571f('0x2'),_0x571f('0x3'),'customVariable',_0x571f('0x4'),_0x571f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x571f('0x6')]},'key':{'type':Sequelize[_0x571f('0x6')]},'keyType':{'type':Sequelize[_0x571f('0x1')](_0x571f('0x2'),_0x571f('0x3'),_0x571f('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x571f('0x6')]},'nameField':{'type':Sequelize[_0x571f('0x6')]},'customField':{'type':Sequelize[_0x571f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x571f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3feed4d..3651327 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 _0x6596=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','index','map','DeskField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x384de4,_0xad1d3b){var _0x2c6535=function(_0x21640c){while(--_0x21640c){_0x384de4['push'](_0x384de4['shift']());}};_0x2c6535(++_0xad1d3b);}(_0x6596,0x1d3));var _0x6659=function(_0x25f352,_0x5dfd97){_0x25f352=_0x25f352-0x0;var _0x37e9e6=_0x6596[_0x25f352];return _0x37e9e6;};'use strict';var emlformat=require(_0x6659('0x0'));var rimraf=require(_0x6659('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6659('0x2'));var rp=require(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var BPromise=require(_0x6659('0x5'));var Mustache=require(_0x6659('0x6'));var util=require(_0x6659('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6659('0x8'));var ejs=require(_0x6659('0x9'));var fs=require('fs');var fs_extra=require(_0x6659('0xa'));var _=require(_0x6659('0xb'));var squel=require(_0x6659('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6659('0xd'));var toCsv=require(_0x6659('0x8'));var querystring=require(_0x6659('0xe'));var Papa=require(_0x6659('0xf'));var Redis=require(_0x6659('0x10'));var authService=require(_0x6659('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6659('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6659('0x13'));var utils=require('../../config/utils');var config=require(_0x6659('0x14'));var licenseUtil=require(_0x6659('0x15'));var db=require(_0x6659('0x16'))['db'];function respondWithStatusCode(_0x438f95,_0x581baa){_0x581baa=_0x581baa||0xcc;return function(_0x3d68c5){if(_0x3d68c5){return _0x438f95[_0x6659('0x17')](_0x581baa);}return _0x438f95['status'](_0x581baa)[_0x6659('0x18')]();};}function respondWithResult(_0x2fd7da,_0x4238a7){_0x4238a7=_0x4238a7||0xc8;return function(_0x346cb6){if(_0x346cb6){return _0x2fd7da[_0x6659('0x19')](_0x4238a7)[_0x6659('0x1a')](_0x346cb6);}};}function respondWithFilteredResult(_0x5b5c16,_0x3246f1){return function(_0x36707c){if(_0x36707c){var _0x1ddce3=typeof _0x3246f1[_0x6659('0x1b')]===_0x6659('0x1c')&&typeof _0x3246f1[_0x6659('0x1d')]==='undefined';var _0x5b7658=_0x36707c[_0x6659('0x1e')];var _0x5e89f1=_0x1ddce3?0x0:_0x3246f1[_0x6659('0x1b')];var _0x38e4d6=_0x1ddce3?_0x36707c['count']:_0x3246f1[_0x6659('0x1b')]+_0x3246f1['limit'];var _0xa5e094;if(_0x38e4d6>=_0x5b7658){_0x38e4d6=_0x5b7658;_0xa5e094=0xc8;}else{_0xa5e094=0xce;}_0x5b5c16[_0x6659('0x19')](_0xa5e094);return _0x5b5c16['set'](_0x6659('0x1f'),_0x5e89f1+'-'+_0x38e4d6+'/'+_0x5b7658)[_0x6659('0x1a')](_0x36707c);}return null;};}function patchUpdates(_0x332d2c){return function(_0x3e139a){try{jsonpatch[_0x6659('0x20')](_0x3e139a,_0x332d2c,!![]);}catch(_0x3e1f83){return BPromise[_0x6659('0x21')](_0x3e1f83);}return _0x3e139a['save']();};}function saveUpdates(_0x2b4cce,_0x3506fd){return function(_0x314e40){if(_0x314e40){return _0x314e40[_0x6659('0x22')](_0x2b4cce)['then'](function(_0x4ce553){return _0x4ce553;});}return null;};}function removeEntity(_0x5a5e04,_0x564357){return function(_0xbad53f){if(_0xbad53f){return _0xbad53f[_0x6659('0x23')]()[_0x6659('0x24')](function(){_0x5a5e04[_0x6659('0x19')](0xcc)[_0x6659('0x18')]();});}};}function handleEntityNotFound(_0x12b218,_0x436691){return function(_0x3cb0dc){if(!_0x3cb0dc){_0x12b218[_0x6659('0x17')](0x194);}return _0x3cb0dc;};}function handleError(_0x5f48d6,_0x187571){_0x187571=_0x187571||0x1f4;return function(_0x373a3d){logger[_0x6659('0x25')](_0x373a3d['stack']);if(_0x373a3d['name']){delete _0x373a3d[_0x6659('0x26')];}_0x5f48d6[_0x6659('0x19')](_0x187571)['send'](_0x373a3d);};}exports[_0x6659('0x27')]=function(_0x2f5a16,_0x36dab5){var _0xcb5a33={},_0x1b721d={},_0x525b57={'count':0x0,'rows':[]};var _0x23ee05=_[_0x6659('0x28')](db[_0x6659('0x29')][_0x6659('0x2a')],function(_0xc9bd6a){return{'name':_0xc9bd6a['fieldName'],'type':_0xc9bd6a[_0x6659('0x2b')][_0x6659('0x2c')]};});_0x1b721d[_0x6659('0x2d')]=_[_0x6659('0x28')](_0x23ee05,_0x6659('0x26'));_0x1b721d[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x2f5a16['query']);_0x1b721d[_0x6659('0x30')]=_[_0x6659('0x31')](_0x1b721d['model'],_0x1b721d[_0x6659('0x2e')]);_0xcb5a33['attributes']=_[_0x6659('0x31')](_0x1b721d['model'],qs[_0x6659('0x32')](_0x2f5a16[_0x6659('0x2e')]['fields']));_0xcb5a33['attributes']=_0xcb5a33[_0x6659('0x33')]['length']?_0xcb5a33[_0x6659('0x33')]:_0x1b721d['model'];if(!_0x2f5a16[_0x6659('0x2e')]['hasOwnProperty'](_0x6659('0x34'))){_0xcb5a33[_0x6659('0x1d')]=qs['limit'](_0x2f5a16[_0x6659('0x2e')][_0x6659('0x1d')]);_0xcb5a33[_0x6659('0x1b')]=qs[_0x6659('0x1b')](_0x2f5a16[_0x6659('0x2e')]['offset']);}_0xcb5a33[_0x6659('0x35')]=qs['sort'](_0x2f5a16['query'][_0x6659('0x36')]);_0xcb5a33[_0x6659('0x37')]=qs[_0x6659('0x30')](_['pick'](_0x2f5a16[_0x6659('0x2e')],_0x1b721d['filters']),_0x23ee05);if(_0x2f5a16['query'][_0x6659('0x38')]){_0xcb5a33[_0x6659('0x37')]=_[_0x6659('0x39')](_0xcb5a33[_0x6659('0x37')],{'$or':_[_0x6659('0x28')](_0x23ee05,function(_0x90b64e){if(_0x90b64e[_0x6659('0x2b')]!=='VIRTUAL'){var _0x531a19={};_0x531a19[_0x90b64e[_0x6659('0x26')]]={'$like':'%'+_0x2f5a16[_0x6659('0x2e')][_0x6659('0x38')]+'%'};return _0x531a19;}})});}_0xcb5a33=_['merge']({},_0xcb5a33,_0x2f5a16[_0x6659('0x3a')]);var _0x3e4a93={'where':_0xcb5a33['where']};return db[_0x6659('0x29')][_0x6659('0x1e')](_0x3e4a93)[_0x6659('0x24')](function(_0x2924f4){_0x525b57[_0x6659('0x1e')]=_0x2924f4;if(_0x2f5a16['query']['includeAll']){_0xcb5a33['include']=[{'all':!![]}];}return db['DeskField'][_0x6659('0x3b')](_0xcb5a33);})['then'](function(_0x552282){_0x525b57[_0x6659('0x3c')]=_0x552282;return _0x525b57;})[_0x6659('0x24')](respondWithFilteredResult(_0x36dab5,_0xcb5a33))['catch'](handleError(_0x36dab5,null));};exports[_0x6659('0x3d')]=function(_0x4230cf,_0x55cd09){var _0x176516={'raw':!![],'where':{'id':_0x4230cf[_0x6659('0x3e')]['id']}},_0x3551d4={};_0x3551d4[_0x6659('0x2d')]=_['keys'](db[_0x6659('0x29')]['rawAttributes']);_0x3551d4[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x4230cf[_0x6659('0x2e')]);_0x3551d4[_0x6659('0x30')]=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],_0x3551d4['query']);_0x176516['attributes']=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],qs[_0x6659('0x32')](_0x4230cf[_0x6659('0x2e')][_0x6659('0x32')]));_0x176516[_0x6659('0x33')]=_0x176516[_0x6659('0x33')][_0x6659('0x3f')]?_0x176516[_0x6659('0x33')]:_0x3551d4[_0x6659('0x2d')];if(_0x4230cf['query'][_0x6659('0x40')]){_0x176516['include']=[{'all':!![]}];}_0x176516=_[_0x6659('0x39')]({},_0x176516,_0x4230cf[_0x6659('0x3a')]);return db['DeskField'][_0x6659('0x41')](_0x176516)[_0x6659('0x24')](handleEntityNotFound(_0x55cd09,null))['then'](respondWithResult(_0x55cd09,null))[_0x6659('0x42')](handleError(_0x55cd09,null));};exports[_0x6659('0x43')]=function(_0x6e0e41,_0x304733){return db['DeskField']['create'](_0x6e0e41[_0x6659('0x44')],{})[_0x6659('0x24')](respondWithResult(_0x304733,0xc9))[_0x6659('0x42')](handleError(_0x304733,null));};exports[_0x6659('0x22')]=function(_0x442355,_0x3afc78){if(_0x442355['body']['id']){delete _0x442355[_0x6659('0x44')]['id'];}return db[_0x6659('0x29')]['find']({'where':{'id':_0x442355[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x3afc78,null))['then'](saveUpdates(_0x442355[_0x6659('0x44')],null))[_0x6659('0x24')](respondWithResult(_0x3afc78,null))[_0x6659('0x42')](handleError(_0x3afc78,null));};exports[_0x6659('0x23')]=function(_0x78c901,_0x1bdf74){return db[_0x6659('0x29')][_0x6659('0x41')]({'where':{'id':_0x78c901[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x1bdf74,null))[_0x6659('0x24')](removeEntity(_0x1bdf74,null))[_0x6659('0x42')](handleError(_0x1bdf74,null));}; \ No newline at end of file +var _0xb4c7=['DeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','includeAll','find','create','body','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'];(function(_0x30d068,_0x272ff1){var _0x323815=function(_0x446983){while(--_0x446983){_0x30d068['push'](_0x30d068['shift']());}};_0x323815(++_0x272ff1);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4f042d,_0x5d1d02){_0x4f042d=_0x4f042d-0x0;var _0xa91368=_0xb4c7[_0x4f042d];return _0xa91368;};'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']=_['map'](_0x3544bc,_0x7b4c('0x2d'));_0x3585cd[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2552f9[_0x7b4c('0x35')]);_0x3585cd['filters']=_[_0x7b4c('0x37')](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],qs[_0x7b4c('0x3a')](_0x2552f9[_0x7b4c('0x35')]['fields']));_0x9a799b[_0x7b4c('0x39')]=_0x9a799b[_0x7b4c('0x39')]['length']?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x3b')]('nolimit')){_0x9a799b['limit']=qs[_0x7b4c('0x22')](_0x2552f9[_0x7b4c('0x35')]['limit']);_0x9a799b[_0x7b4c('0x1f')]=qs['offset'](_0x2552f9['query'][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3c')]=qs[_0x7b4c('0x3d')](_0x2552f9[_0x7b4c('0x35')]['sort']);_0x9a799b[_0x7b4c('0x3e')]=qs[_0x7b4c('0x3f')](_[_0x7b4c('0x40')](_0x2552f9[_0x7b4c('0x35')],_0x3585cd[_0x7b4c('0x3f')]),_0x3544bc);if(_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]){_0x9a799b['where']=_['merge'](_0x9a799b[_0x7b4c('0x3e')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0x31ef1e){if(_0x31ef1e[_0x7b4c('0x34')]!==_0x7b4c('0x42')){var _0x592834={};_0x592834[_0x31ef1e[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]+'%'};return _0x592834;}})});}_0x9a799b=_[_0x7b4c('0x43')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x44')]);var _0x25659d={'where':_0x9a799b[_0x7b4c('0x3e')]};return db[_0x7b4c('0x31')][_0x7b4c('0x21')](_0x25659d)['then'](function(_0x2a4085){_0x130ace['count']=_0x2a4085;if(_0x2552f9[_0x7b4c('0x35')]['includeAll']){_0x9a799b[_0x7b4c('0x45')]=[{'all':!![]}];}return db[_0x7b4c('0x31')]['findAll'](_0x9a799b);})['then'](function(_0x354578){_0x130ace[_0x7b4c('0x46')]=_0x354578;return _0x130ace;})[_0x7b4c('0x29')](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x47')](handleError(_0x3e4a46,null));};exports['show']=function(_0x2b1681,_0x2ed731){var _0x100774={'raw':!![],'where':{'id':_0x2b1681[_0x7b4c('0x48')]['id']}},_0x5d4ed8={};_0x5d4ed8['model']=_['keys'](db[_0x7b4c('0x31')]['rawAttributes']);_0x5d4ed8[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2b1681[_0x7b4c('0x35')]);_0x5d4ed8[_0x7b4c('0x3f')]=_[_0x7b4c('0x37')](_0x5d4ed8[_0x7b4c('0x38')],_0x5d4ed8[_0x7b4c('0x35')]);_0x100774[_0x7b4c('0x39')]=_[_0x7b4c('0x37')](_0x5d4ed8['model'],qs[_0x7b4c('0x3a')](_0x2b1681['query']['fields']));_0x100774[_0x7b4c('0x39')]=_0x100774[_0x7b4c('0x39')]['length']?_0x100774['attributes']:_0x5d4ed8[_0x7b4c('0x38')];if(_0x2b1681[_0x7b4c('0x35')][_0x7b4c('0x49')]){_0x100774[_0x7b4c('0x45')]=[{'all':!![]}];}_0x100774=_[_0x7b4c('0x43')]({},_0x100774,_0x2b1681[_0x7b4c('0x44')]);return db[_0x7b4c('0x31')][_0x7b4c('0x4a')](_0x100774)['then'](handleEntityNotFound(_0x2ed731,null))[_0x7b4c('0x29')](respondWithResult(_0x2ed731,null))[_0x7b4c('0x47')](handleError(_0x2ed731,null));};exports[_0x7b4c('0x4b')]=function(_0x387efd,_0xc76435){return db[_0x7b4c('0x31')][_0x7b4c('0x4b')](_0x387efd[_0x7b4c('0x4c')],{})[_0x7b4c('0x29')](respondWithResult(_0xc76435,0xc9))['catch'](handleError(_0xc76435,null));};exports['update']=function(_0x1884a4,_0x3f6aaa){if(_0x1884a4[_0x7b4c('0x4c')]['id']){delete _0x1884a4['body']['id'];}return db[_0x7b4c('0x31')][_0x7b4c('0x4a')]({'where':{'id':_0x1884a4['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x3f6aaa,null))['then'](saveUpdates(_0x1884a4[_0x7b4c('0x4c')],null))['then'](respondWithResult(_0x3f6aaa,null))[_0x7b4c('0x47')](handleError(_0x3f6aaa,null));};exports['destroy']=function(_0x15d7f1,_0x11faed){return db['DeskField']['find']({'where':{'id':_0x15d7f1[_0x7b4c('0x48')]['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x11faed,null))[_0x7b4c('0x29')](removeEntity(_0x11faed,null))['catch'](handleError(_0x11faed,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d334c01..450ac85 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 _0xf448=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x24ddef,_0x352eb8){var _0x344daa=function(_0x4fba9a){while(--_0x4fba9a){_0x24ddef['push'](_0x24ddef['shift']());}};_0x344daa(++_0x352eb8);}(_0xf448,0x116));var _0x8f44=function(_0x598901,_0x205f15){_0x598901=_0x598901-0x0;var _0x45acca=_0xf448[_0x598901];return _0x45acca;};'use strict';var _=require(_0x8f44('0x0'));var util=require(_0x8f44('0x1'));var logger=require(_0x8f44('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8f44('0x3'));var rp=require(_0x8f44('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f44('0x5'));var config=require(_0x8f44('0x6'));var attributes=require(_0x8f44('0x7'));module[_0x8f44('0x8')]=function(_0x49a285,_0x7b098){return _0x49a285[_0x8f44('0x9')]('DeskField',attributes,{'tableName':_0x8f44('0xa'),'paranoid':![],'indexes':[{'name':_0x8f44('0xb'),'fields':[_0x8f44('0xc'),_0x8f44('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0057=['DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0057,0x154));var _0x7005=function(_0x14bd71,_0x389274){_0x14bd71=_0x14bd71-0x0;var _0x115ad7=_0x0057[_0x14bd71];return _0x115ad7;};'use strict';var _=require(_0x7005('0x0'));var util=require('util');var logger=require(_0x7005('0x1'))(_0x7005('0x2'));var moment=require(_0x7005('0x3'));var BPromise=require(_0x7005('0x4'));var rp=require(_0x7005('0x5'));var fs=require('fs');var path=require(_0x7005('0x6'));var rimraf=require('rimraf');var config=require(_0x7005('0x7'));var attributes=require('./intDeskField.attributes');module[_0x7005('0x8')]=function(_0x1c0e2c,_0x42aa21){return _0x1c0e2c[_0x7005('0x9')](_0x7005('0xa'),attributes,{'tableName':_0x7005('0xb'),'paranoid':![],'indexes':[{'name':_0x7005('0xc'),'fields':['idField',_0x7005('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index fd1264f..1cb0c94 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 _0xe838=['code','message','catch','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xe838,0x1a5));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8e83('0x0'));var util=require('util');var moment=require(_0x8e83('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e83('0x2'));var db=require(_0x8e83('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e83('0x4'));var config=require(_0x8e83('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8e83('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x30e296,_0x3253ae,_0x46cf07){return new BPromise(function(_0x260b0e,_0x312284){return client[_0x8e83('0x7')](_0x30e296,_0x46cf07)[_0x8e83('0x8')](function(_0x2fc6b1){logger[_0x8e83('0x9')](_0x8e83('0xa'),_0x3253ae,_0x8e83('0xb'));logger[_0x8e83('0xc')](_0x8e83('0xd'),_0x3253ae,_0x8e83('0xb'),JSON[_0x8e83('0xe')](_0x2fc6b1));if(_0x2fc6b1['error']){if(_0x2fc6b1[_0x8e83('0xf')][_0x8e83('0x10')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x3253ae,_0x2fc6b1[_0x8e83('0xf')][_0x8e83('0x11')]);return _0x312284(_0x2fc6b1[_0x8e83('0xf')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x3253ae,_0x2fc6b1['error']['message']);return _0x260b0e(_0x2fc6b1[_0x8e83('0xf')][_0x8e83('0x11')]);}else{logger[_0x8e83('0x9')](_0x8e83('0xa'),_0x3253ae,'request\x20sent');_0x260b0e(_0x2fc6b1['result'][_0x8e83('0x11')]);}})[_0x8e83('0x12')](function(_0x5ee393){logger['error']('DeskField,\x20%s,\x20%s',_0x3253ae,_0x5ee393);_0x312284(_0x5ee393);});});} \ No newline at end of file +var _0x6b40=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','info','request\x20sent','debug','stringify','error','DeskField,\x20%s,\x20%s','message','catch','util','randomstring','ioredis'];(function(_0x4b66c3,_0x2bf255){var _0x16d202=function(_0x4e1fee){while(--_0x4e1fee){_0x4b66c3['push'](_0x4b66c3['shift']());}};_0x16d202(++_0x2bf255);}(_0x6b40,0xcd));var _0x06b4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b40[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x06b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x06b4('0x1'));var fs=require('fs');var Redis=require(_0x06b4('0x2'));var db=require(_0x06b4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x06b4('0x4'))(_0x06b4('0x5'));var config=require('../../config/environment');var jayson=require(_0x06b4('0x6'));var client=jayson['client'][_0x06b4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23df8,_0x19a099,_0x3f0a6e){return new BPromise(function(_0x139755,_0x1b1b47){return client['request'](_0x23df8,_0x3f0a6e)['then'](function(_0x11f586){logger[_0x06b4('0x8')]('DeskField,\x20%s,\x20%s',_0x19a099,_0x06b4('0x9'));logger[_0x06b4('0xa')]('DeskField,\x20%s,\x20%s,\x20%s',_0x19a099,_0x06b4('0x9'),JSON[_0x06b4('0xb')](_0x11f586));if(_0x11f586[_0x06b4('0xc')]){if(_0x11f586[_0x06b4('0xc')]['code']===0x1f4){logger[_0x06b4('0xc')](_0x06b4('0xd'),_0x19a099,_0x11f586[_0x06b4('0xc')][_0x06b4('0xe')]);return _0x1b1b47(_0x11f586[_0x06b4('0xc')][_0x06b4('0xe')]);}logger[_0x06b4('0xc')](_0x06b4('0xd'),_0x19a099,_0x11f586[_0x06b4('0xc')][_0x06b4('0xe')]);return _0x139755(_0x11f586[_0x06b4('0xc')][_0x06b4('0xe')]);}else{logger[_0x06b4('0x8')]('DeskField,\x20%s,\x20%s',_0x19a099,_0x06b4('0x9'));_0x139755(_0x11f586['result'][_0x06b4('0xe')]);}})[_0x06b4('0xf')](function(_0x3ce417){logger['error']('DeskField,\x20%s,\x20%s',_0x19a099,_0x3ce417);_0x1b1b47(_0x3ce417);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 42a36c3..7b364c8 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 _0x358e=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x358e,0x13b));var _0xe358=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0x358e[_0x46c9a5];return _0x5e3eec;};'use strict';var multer=require(_0xe358('0x0'));var util=require(_0xe358('0x1'));var path=require(_0xe358('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe358('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe358('0x4'));var interaction=require(_0xe358('0x5'));var config=require(_0xe358('0x6'));var controller=require('./intDynamics365Account.controller');router[_0xe358('0x7')]('/',auth[_0xe358('0x8')](),controller[_0xe358('0x9')]);router[_0xe358('0x7')](_0xe358('0xa'),auth['isAuthenticated'](),controller[_0xe358('0xb')]);router[_0xe358('0x7')](_0xe358('0xc'),auth[_0xe358('0x8')](),controller[_0xe358('0xd')]);router[_0xe358('0x7')](_0xe358('0xe'),auth[_0xe358('0x8')](),controller[_0xe358('0xf')]);router[_0xe358('0x10')]('/',auth[_0xe358('0x8')](),controller[_0xe358('0x11')]);router[_0xe358('0x10')](_0xe358('0xc'),auth[_0xe358('0x8')](),controller[_0xe358('0x12')]);router['put']('/:id',auth[_0xe358('0x8')](),controller['update']);router['delete'](_0xe358('0xa'),auth[_0xe358('0x8')](),controller[_0xe358('0x13')]);module[_0xe358('0x14')]=router; \ No newline at end of file +var _0x8921=['delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x105ea1,_0xdd0119){var _0x5ac3c6=function(_0x4b6f3a){while(--_0x4b6f3a){_0x105ea1['push'](_0x105ea1['shift']());}};_0x5ac3c6(++_0xdd0119);}(_0x8921,0x1ba));var _0x1892=function(_0x4c2a80,_0x5e4c11){_0x4c2a80=_0x4c2a80-0x0;var _0x443280=_0x8921[_0x4c2a80];return _0x443280;};'use strict';var multer=require(_0x1892('0x0'));var util=require('util');var path=require(_0x1892('0x1'));var timeout=require(_0x1892('0x2'));var express=require('express');var router=express[_0x1892('0x3')]();var fs_extra=require(_0x1892('0x4'));var auth=require(_0x1892('0x5'));var interaction=require(_0x1892('0x6'));var config=require(_0x1892('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x1892('0x8')]('/',auth[_0x1892('0x9')](),controller['index']);router['get'](_0x1892('0xa'),auth[_0x1892('0x9')](),controller[_0x1892('0xb')]);router[_0x1892('0x8')](_0x1892('0xc'),auth[_0x1892('0x9')](),controller['getConfigurations']);router[_0x1892('0x8')](_0x1892('0xd'),auth[_0x1892('0x9')](),controller[_0x1892('0xe')]);router[_0x1892('0xf')]('/',auth[_0x1892('0x9')](),controller[_0x1892('0x10')]);router['post'](_0x1892('0xc'),auth[_0x1892('0x9')](),controller[_0x1892('0x11')]);router[_0x1892('0x12')](_0x1892('0xa'),auth[_0x1892('0x9')](),controller[_0x1892('0x13')]);router[_0x1892('0x14')](_0x1892('0xa'),auth[_0x1892('0x9')](),controller['destroy']);module[_0x1892('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 7e0d8ec..4096d8b 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 _0x2801=['exports','STRING'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x2801,0x130));var _0x1280=function(_0x3571e8,_0x3dce4e){_0x3571e8=_0x3571e8-0x0;var _0x21d47d=_0x2801[_0x3571e8];return _0x21d47d;};'use strict';var Sequelize=require('sequelize');module[_0x1280('0x0')]={'name':{'type':Sequelize[_0x1280('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1280('0x1')]},'tenantId':{'type':Sequelize[_0x1280('0x1')]},'clientId':{'type':Sequelize[_0x1280('0x1')]},'clientSecret':{'type':Sequelize[_0x1280('0x1')]},'serverUrl':{'type':Sequelize[_0x1280('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfc23=['STRING','sequelize'];(function(_0x354d62,_0x4c2044){var _0x4a102c=function(_0x3e4c89){while(--_0x3e4c89){_0x354d62['push'](_0x354d62['shift']());}};_0x4a102c(++_0x4c2044);}(_0xfc23,0x10f));var _0x3fc2=function(_0x4f3d57,_0x2593a4){_0x4f3d57=_0x4f3d57-0x0;var _0x22e64c=_0xfc23[_0x4f3d57];return _0x22e64c;};'use strict';var Sequelize=require(_0x3fc2('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fc2('0x1')]},'username':{'type':Sequelize[_0x3fc2('0x1')]},'password':{'type':Sequelize[_0x3fc2('0x1')]},'remoteUri':{'type':Sequelize[_0x3fc2('0x1')]},'tenantId':{'type':Sequelize[_0x3fc2('0x1')]},'clientId':{'type':Sequelize[_0x3fc2('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3fc2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3fc2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5bbac34..27fbce4 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 _0x5d55=['IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','DisplayName','TrueOption','UserLocalizedLabel','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','destroy','getConfigurations','Dynamics365Configuration','findOne','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','ticketType','incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','clientId','clientSecret','remoteUri','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','PicklistAttributeMetadata','push','all','isNil','@odata.type','lastIndexOf','StringAttributeMetadata'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x5d55,0x1a4));var _0x55d5=function(_0x47d07f,_0x208a11){_0x47d07f=_0x47d07f-0x0;var _0x3597b5=_0x5d55[_0x47d07f];return _0x3597b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55d5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55d5('0x1'));var rp=require(_0x55d5('0x2'));var moment=require('moment');var BPromise=require(_0x55d5('0x3'));var Mustache=require(_0x55d5('0x4'));var util=require(_0x55d5('0x5'));var path=require('path');var sox=require(_0x55d5('0x6'));var csv=require(_0x55d5('0x7'));var ejs=require(_0x55d5('0x8'));var fs=require('fs');var fs_extra=require(_0x55d5('0x9'));var _=require(_0x55d5('0xa'));var squel=require(_0x55d5('0xb'));var crypto=require(_0x55d5('0xc'));var jsforce=require(_0x55d5('0xd'));var deskjs=require(_0x55d5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x55d5('0xf'));var Papa=require(_0x55d5('0x10'));var Redis=require(_0x55d5('0x11'));var authService=require(_0x55d5('0x12'));var qs=require(_0x55d5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55d5('0x14'));var logger=require('../../config/logger')(_0x55d5('0x15'));var utils=require(_0x55d5('0x16'));var config=require(_0x55d5('0x17'));var licenseUtil=require(_0x55d5('0x18'));var db=require(_0x55d5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x45ba94,_0x411e19){_0x411e19=_0x411e19||0xcc;return function(_0x300cc9){if(_0x300cc9){return _0x45ba94['sendStatus'](_0x411e19);}return _0x45ba94[_0x55d5('0x1a')](_0x411e19)['end']();};}function respondWithResult(_0x6eca0e,_0xae0754){_0xae0754=_0xae0754||0xc8;return function(_0x2c2da1){if(_0x2c2da1){return _0x6eca0e[_0x55d5('0x1a')](_0xae0754)['json'](_0x2c2da1);}};}function respondWithFilteredResult(_0x4417e2,_0xa03796){return function(_0x130727){if(_0x130727){var _0x4b4502=typeof _0xa03796[_0x55d5('0x1b')]==='undefined'&&typeof _0xa03796[_0x55d5('0x1c')]==='undefined';var _0x273e51=_0x130727[_0x55d5('0x1d')];var _0x48f919=_0x4b4502?0x0:_0xa03796[_0x55d5('0x1b')];var _0x7a97f8=_0x4b4502?_0x130727[_0x55d5('0x1d')]:_0xa03796[_0x55d5('0x1b')]+_0xa03796['limit'];var _0xf7c744;if(_0x7a97f8>=_0x273e51){_0x7a97f8=_0x273e51;_0xf7c744=0xc8;}else{_0xf7c744=0xce;}_0x4417e2[_0x55d5('0x1a')](_0xf7c744);return _0x4417e2[_0x55d5('0x1e')](_0x55d5('0x1f'),_0x48f919+'-'+_0x7a97f8+'/'+_0x273e51)[_0x55d5('0x20')](_0x130727);}return null;};}function patchUpdates(_0x474c0d){return function(_0x5f05b3){try{jsonpatch[_0x55d5('0x21')](_0x5f05b3,_0x474c0d,!![]);}catch(_0x4c6e33){return BPromise[_0x55d5('0x22')](_0x4c6e33);}return _0x5f05b3[_0x55d5('0x23')]();};}function saveUpdates(_0x3fb30a,_0x8dc90c){return function(_0x493f17){if(_0x493f17){return _0x493f17[_0x55d5('0x24')](_0x3fb30a)[_0x55d5('0x25')](function(_0xe6da61){return _0xe6da61;});}return null;};}function removeEntity(_0x39fc3b,_0x54a126){return function(_0x21b1d8){if(_0x21b1d8){return _0x21b1d8['destroy']()['then'](function(){_0x39fc3b[_0x55d5('0x1a')](0xcc)[_0x55d5('0x26')]();});}};}function handleEntityNotFound(_0x50788d,_0x5e9776){return function(_0x421cf2){if(!_0x421cf2){_0x50788d[_0x55d5('0x27')](0x194);}return _0x421cf2;};}function handleError(_0x2bd047,_0x1579a8){_0x1579a8=_0x1579a8||0x1f4;return function(_0x446014){logger[_0x55d5('0x28')](_0x446014[_0x55d5('0x29')]);if(_0x446014[_0x55d5('0x2a')]){delete _0x446014[_0x55d5('0x2a')];}_0x2bd047['status'](_0x1579a8)[_0x55d5('0x2b')](_0x446014);};}exports[_0x55d5('0x2c')]=function(_0x5ec2b5,_0x24d442){var _0x47c53c={},_0x2f671e={},_0x2b2806={'count':0x0,'rows':[]};var _0x108e60=_[_0x55d5('0x2d')](db[_0x55d5('0x2e')]['rawAttributes'],function(_0x1f5de8){return{'name':_0x1f5de8['fieldName'],'type':_0x1f5de8['type'][_0x55d5('0x2f')]};});_0x2f671e[_0x55d5('0x30')]=_[_0x55d5('0x2d')](_0x108e60,_0x55d5('0x2a'));_0x2f671e[_0x55d5('0x31')]=_[_0x55d5('0x32')](_0x5ec2b5[_0x55d5('0x31')]);_0x2f671e[_0x55d5('0x33')]=_['intersection'](_0x2f671e[_0x55d5('0x30')],_0x2f671e['query']);_0x47c53c[_0x55d5('0x34')]=_[_0x55d5('0x35')](_0x2f671e[_0x55d5('0x30')],qs[_0x55d5('0x36')](_0x5ec2b5[_0x55d5('0x31')][_0x55d5('0x36')]));_0x47c53c['attributes']=_0x47c53c['attributes'][_0x55d5('0x37')]?_0x47c53c[_0x55d5('0x34')]:_0x2f671e['model'];if(!_0x5ec2b5[_0x55d5('0x31')][_0x55d5('0x38')](_0x55d5('0x39'))){_0x47c53c[_0x55d5('0x1c')]=qs[_0x55d5('0x1c')](_0x5ec2b5['query']['limit']);_0x47c53c[_0x55d5('0x1b')]=qs[_0x55d5('0x1b')](_0x5ec2b5[_0x55d5('0x31')][_0x55d5('0x1b')]);}_0x47c53c[_0x55d5('0x3a')]=qs[_0x55d5('0x3b')](_0x5ec2b5['query'][_0x55d5('0x3b')]);_0x47c53c[_0x55d5('0x3c')]=qs[_0x55d5('0x33')](_[_0x55d5('0x3d')](_0x5ec2b5[_0x55d5('0x31')],_0x2f671e[_0x55d5('0x33')]),_0x108e60);if(_0x5ec2b5[_0x55d5('0x31')][_0x55d5('0x3e')]){_0x47c53c['where']=_[_0x55d5('0x3f')](_0x47c53c[_0x55d5('0x3c')],{'$or':_[_0x55d5('0x2d')](_0x108e60,function(_0x429b9b){if(_0x429b9b[_0x55d5('0x40')]!=='VIRTUAL'){var _0x3f5e33={};_0x3f5e33[_0x429b9b[_0x55d5('0x2a')]]={'$like':'%'+_0x5ec2b5[_0x55d5('0x31')][_0x55d5('0x3e')]+'%'};return _0x3f5e33;}})});}_0x47c53c=_[_0x55d5('0x3f')]({},_0x47c53c,_0x5ec2b5[_0x55d5('0x41')]);var _0x1bb09f={'where':_0x47c53c[_0x55d5('0x3c')]};return db['Dynamics365Account'][_0x55d5('0x1d')](_0x1bb09f)['then'](function(_0x5be808){_0x2b2806['count']=_0x5be808;if(_0x5ec2b5[_0x55d5('0x31')]['includeAll']){_0x47c53c[_0x55d5('0x42')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x55d5('0x43')](_0x47c53c);})['then'](function(_0x5892d9){_0x2b2806[_0x55d5('0x44')]=_0x5892d9;return _0x2b2806;})[_0x55d5('0x25')](respondWithFilteredResult(_0x24d442,_0x47c53c))['catch'](handleError(_0x24d442,null));};exports[_0x55d5('0x45')]=function(_0x57bdba,_0x1dc5f1){var _0x3deb8c={'raw':![],'where':{'id':_0x57bdba[_0x55d5('0x46')]['id']}},_0x371f39={};_0x371f39[_0x55d5('0x30')]=_['keys'](db['Dynamics365Account'][_0x55d5('0x47')]);_0x371f39[_0x55d5('0x31')]=_['keys'](_0x57bdba[_0x55d5('0x31')]);_0x371f39[_0x55d5('0x33')]=_[_0x55d5('0x35')](_0x371f39[_0x55d5('0x30')],_0x371f39[_0x55d5('0x31')]);_0x3deb8c[_0x55d5('0x34')]=_[_0x55d5('0x35')](_0x371f39['model'],qs[_0x55d5('0x36')](_0x57bdba['query'][_0x55d5('0x36')]));_0x3deb8c[_0x55d5('0x34')]=_0x3deb8c[_0x55d5('0x34')][_0x55d5('0x37')]?_0x3deb8c['attributes']:_0x371f39['model'];if(_0x57bdba[_0x55d5('0x31')][_0x55d5('0x48')]){_0x3deb8c[_0x55d5('0x42')]=[{'all':!![]}];}_0x3deb8c=_[_0x55d5('0x3f')]({},_0x3deb8c,_0x57bdba[_0x55d5('0x41')]);return db[_0x55d5('0x2e')][_0x55d5('0x49')](_0x3deb8c)[_0x55d5('0x25')](handleEntityNotFound(_0x1dc5f1,null))['then'](respondWithResult(_0x1dc5f1,null))[_0x55d5('0x4a')](handleError(_0x1dc5f1,null));};exports[_0x55d5('0x4b')]=function(_0x12097a,_0x2f2644){return db['Dynamics365Account']['create'](_0x12097a['body'],{})[_0x55d5('0x25')](respondWithResult(_0x2f2644,0xc9))['catch'](handleError(_0x2f2644,null));};exports['update']=function(_0x178fb1,_0x572b3a){if(_0x178fb1[_0x55d5('0x4c')]['id']){delete _0x178fb1[_0x55d5('0x4c')]['id'];}return db[_0x55d5('0x2e')][_0x55d5('0x49')]({'where':{'id':_0x178fb1[_0x55d5('0x46')]['id']}})[_0x55d5('0x25')](handleEntityNotFound(_0x572b3a,null))[_0x55d5('0x25')](saveUpdates(_0x178fb1['body'],null))[_0x55d5('0x25')](respondWithResult(_0x572b3a,null))['catch'](handleError(_0x572b3a,null));};exports[_0x55d5('0x4d')]=function(_0x42dbc7,_0x3e6f59){return db[_0x55d5('0x2e')][_0x55d5('0x49')]({'where':{'id':_0x42dbc7[_0x55d5('0x46')]['id']}})[_0x55d5('0x25')](handleEntityNotFound(_0x3e6f59,null))[_0x55d5('0x25')](removeEntity(_0x3e6f59,null))[_0x55d5('0x4a')](handleError(_0x3e6f59,null));};exports[_0x55d5('0x4e')]=function(_0x583604,_0xc6f47,_0xcaa992){var _0x4f659c={};var _0x2401b6={};var _0x2aee63;var _0x3b064b;return db[_0x55d5('0x2e')]['findOne']({'where':{'id':_0x583604[_0x55d5('0x46')]['id']}})[_0x55d5('0x25')](handleEntityNotFound(_0xc6f47,null))[_0x55d5('0x25')](function(_0x1779a2){if(_0x1779a2){_0x2aee63=_0x1779a2;_0x2401b6[_0x55d5('0x30')]=_[_0x55d5('0x32')](db[_0x55d5('0x4f')][_0x55d5('0x47')]);_0x2401b6[_0x55d5('0x31')]=_[_0x55d5('0x32')](_0x583604[_0x55d5('0x31')]);_0x2401b6[_0x55d5('0x33')]=_['intersection'](_0x2401b6[_0x55d5('0x30')],_0x2401b6[_0x55d5('0x31')]);_0x4f659c[_0x55d5('0x34')]=_[_0x55d5('0x35')](_0x2401b6[_0x55d5('0x30')],qs[_0x55d5('0x36')](_0x583604[_0x55d5('0x31')]['fields']));_0x4f659c[_0x55d5('0x34')]=_0x4f659c[_0x55d5('0x34')][_0x55d5('0x37')]?_0x4f659c[_0x55d5('0x34')]:_0x2401b6[_0x55d5('0x30')];_0x4f659c[_0x55d5('0x3a')]=qs[_0x55d5('0x3b')](_0x583604[_0x55d5('0x31')]['sort']);_0x4f659c[_0x55d5('0x3c')]=qs['filters'](_[_0x55d5('0x3d')](_0x583604[_0x55d5('0x31')],_0x2401b6['filters']));if(_0x583604['query'][_0x55d5('0x3e')]){_0x4f659c[_0x55d5('0x3c')]=_[_0x55d5('0x3f')](_0x4f659c[_0x55d5('0x3c')],{'$or':_[_0x55d5('0x2d')](_0x4f659c[_0x55d5('0x34')],function(_0x7dd830){var _0xda0702={};_0xda0702[_0x7dd830]={'$like':'%'+_0x583604[_0x55d5('0x31')][_0x55d5('0x3e')]+'%'};return _0xda0702;})});}_0x4f659c=_['merge']({},_0x4f659c,_0x583604[_0x55d5('0x41')]);return _0x2aee63['getConfigurations'](_0x4f659c);}})[_0x55d5('0x25')](function(_0x50f3c8){if(_0x50f3c8){_0x3b064b=_0x50f3c8[_0x55d5('0x37')];if(!_0x583604[_0x55d5('0x31')]['hasOwnProperty']('nolimit')){_0x4f659c[_0x55d5('0x1c')]=qs[_0x55d5('0x1c')](_0x583604[_0x55d5('0x31')][_0x55d5('0x1c')]);_0x4f659c[_0x55d5('0x1b')]=qs[_0x55d5('0x1b')](_0x583604['query'][_0x55d5('0x1b')]);}return _0x2aee63[_0x55d5('0x4e')](_0x4f659c);}})[_0x55d5('0x25')](function(_0x153773){if(_0x153773){return _0x153773?{'count':_0x3b064b,'rows':_0x153773}:null;}})[_0x55d5('0x25')](respondWithResult(_0xc6f47,null))['catch'](handleError(_0xc6f47,null));};exports['addConfiguration']=function(_0x44466f,_0x41ee49,_0x3f12f3){if(_0x44466f[_0x55d5('0x4c')]['id']){delete _0x44466f[_0x55d5('0x4c')]['id'];}return db[_0x55d5('0x2e')][_0x55d5('0x50')]({'where':{'id':_0x44466f[_0x55d5('0x46')]['id']}})['then'](handleEntityNotFound(_0x41ee49,null))[_0x55d5('0x25')](function(_0x2ada4c){if(_0x2ada4c){_0x44466f[_0x55d5('0x4c')]['AccountId']=_0x2ada4c['id'];_0x44466f[_0x55d5('0x4c')][_0x55d5('0x51')]=integrations[_0x55d5('0x52')](_0x44466f[_0x55d5('0x4c')][_0x55d5('0x53')],_0x44466f[_0x55d5('0x4c')][_0x55d5('0x40')]);_0x44466f[_0x55d5('0x4c')]['Descriptions']=integrations[_0x55d5('0x54')](_0x44466f[_0x55d5('0x4c')][_0x55d5('0x53')],_0x44466f['body'][_0x55d5('0x40')]);return db['Dynamics365Configuration']['create'](_0x44466f['body'],{'include':[{'model':db[_0x55d5('0x55')],'as':_0x55d5('0x51')},{'model':db[_0x55d5('0x55')],'as':_0x55d5('0x56')}]});}return null;})[_0x55d5('0x25')](respondWithResult(_0x41ee49,null))[_0x55d5('0x4a')](handleError(_0x41ee49,null));};exports['getFields']=function(_0x2f5669,_0x166f8c,_0x21e2bc){var _0x4882a6=_0x2f5669[_0x55d5('0x31')][_0x55d5('0x57')];var _0x2bfdce=_0x4882a6===_0x55d5('0x58')?'Incident':_0x55d5('0x59');var _0x47887f='';var _0x2da6c5='';var _0x10d5d3='';var _0x117736='';var _0x11cb2a='';var _0x5e049e='';var _0x1e6189='';var _0x4cd5d7='';var _0x1ca7f7=['title','description','customerid',_0x55d5('0x5a'),_0x55d5('0x5b'),_0x55d5('0x5c'),_0x55d5('0x5d'),_0x55d5('0x5e'),_0x55d5('0x5f'),_0x55d5('0x60')];var _0x171443=['accountidname',_0x55d5('0x61'),_0x55d5('0x62'),_0x55d5('0x63'),_0x55d5('0x64'),_0x55d5('0x65'),_0x55d5('0x66'),_0x55d5('0x67'),_0x55d5('0x68'),_0x55d5('0x69'),_0x55d5('0x6a'),_0x55d5('0x6b'),_0x55d5('0x6c'),'createdonbehalfbyname',_0x55d5('0x6d'),_0x55d5('0x6e'),_0x55d5('0x6f'),_0x55d5('0x70'),_0x55d5('0x71'),_0x55d5('0x72'),'entityimage_timestamp','entityimage_url',_0x55d5('0x73'),_0x55d5('0x74'),'firstresponsebykpiidname',_0x55d5('0x75'),_0x55d5('0x76'),_0x55d5('0x77'),_0x55d5('0x78'),'lastonholdtime','masteridname',_0x55d5('0x79'),_0x55d5('0x7a'),_0x55d5('0x7b'),_0x55d5('0x7c'),_0x55d5('0x7d'),_0x55d5('0x7e'),'modifiedonbehalfbyyominame',_0x55d5('0x7f'),_0x55d5('0x80'),_0x55d5('0x81'),_0x55d5('0x82'),_0x55d5('0x83'),_0x55d5('0x84'),_0x55d5('0x85'),_0x55d5('0x86'),'parentcaseidname',_0x55d5('0x87'),_0x55d5('0x88'),_0x55d5('0x89'),_0x55d5('0x8a'),_0x55d5('0x8b'),_0x55d5('0x8c'),'resolvebykpiidname',_0x55d5('0x8d'),_0x55d5('0x8e'),_0x55d5('0x8f'),'sentimentvalue',_0x55d5('0x90'),'slaname',_0x55d5('0x91'),'statecode',_0x55d5('0x92'),_0x55d5('0x93'),_0x55d5('0x94'),_0x55d5('0x95'),_0x55d5('0x96'),'traversedpath',_0x55d5('0x97'),'versionnumber'];var _0x106c28=_0x1ca7f7[_0x55d5('0x98')](_0x171443);return db['Dynamics365Account'][_0x55d5('0x50')]({'where':{'id':_0x2f5669[_0x55d5('0x46')]['id']},'attributes':['id',_0x55d5('0x99'),_0x55d5('0x9a'),'remoteUri','tenantId',_0x55d5('0x9b'),_0x55d5('0x9c')]})['then'](handleEntityNotFound(_0x166f8c,null))['then'](function(_0x223fd0){if(_0x223fd0){_0x4cd5d7=_0x223fd0[_0x55d5('0x9d')];var _0x3b451d=_0x4cd5d7['slice'](-0x1);if(_0x3b451d==='/'){_0x4cd5d7=_0x4cd5d7[_0x55d5('0x9e')](0x0,_0x4cd5d7['lastIndexOf'](_0x3b451d));}_0x1e6189=util[_0x55d5('0x9f')](_0x55d5('0xa0'),_0x4cd5d7);var _0x5d151f={'method':_0x55d5('0xa1'),'uri':_0x55d5('0xa2')+_0x223fd0[_0x55d5('0xa3')]+_0x55d5('0xa4'),'form':{'client_id':_0x223fd0[_0x55d5('0x9b')],'resource':_0x4cd5d7,'username':_0x223fd0[_0x55d5('0x99')],'password':_0x223fd0[_0x55d5('0x9a')],'grant_type':'password','client_secret':_0x223fd0['clientSecret']},'json':!![]};return rp(_0x5d151f);}})[_0x55d5('0x25')](function(_0x36c7e2){_0x5e049e=_0x36c7e2['access_token'];var _0x4b5b54={'method':_0x55d5('0xa5'),'uri':encodeURI(_0x1e6189+_0x55d5('0xa6')+_0x2bfdce+'\x27'),'headers':{'Authorization':_0x55d5('0xa7')+_0x5e049e,'If-None-Match':null,'OData-Version':_0x55d5('0xa8')},'json':!![]};return rp(_0x4b5b54);})[_0x55d5('0x25')](function(_0x5c28d5){var _0x23058d=_0x5c28d5['value'][0x0];var _0x332c3f=_0x23058d[_0x55d5('0xa9')];var _0x2b0ee8={'method':'GET','uri':_0x1e6189+_0x55d5('0xaa')+_0x332c3f+_0x55d5('0xab'),'headers':{'Authorization':_0x55d5('0xa7')+_0x5e049e,'If-None-Match':null,'OData-Version':_0x55d5('0xa8')},'json':!![]};return rp(_0x2b0ee8);})[_0x55d5('0x25')](function(_0x216c12){_0x47887f=_0x216c12;_0x2da6c5=_0x47887f[_0x55d5('0xac')];_0x2da6c5=_['remove'](_0x2da6c5,function(_0xbef20){return!_0x106c28[_0x55d5('0xad')](_0xbef20[_0x55d5('0xae')]);});var _0x4a69eb=[];var _0xd375ef=[];_0x2da6c5[_0x55d5('0xaf')](function(_0x5aa965){if(_0x5aa965['@odata.type']){var _0x33db13=_0x5aa965['@odata.type']['substring'](_0x5aa965['@odata.type']['lastIndexOf']('.')+0x1);if(_0x33db13===_0x55d5('0xb0')){_0x4a69eb[_0x55d5('0xb1')](getSelectList(_0x1e6189,_0x4882a6,_0xd375ef,_0x47887f[_0x55d5('0xa9')],_0x5aa965[_0x55d5('0xa9')],_0x5e049e));}}});return Promise[_0x55d5('0xb2')](_0x4a69eb);})[_0x55d5('0x25')](function(_0x54e047){_0x10d5d3=_0x54e047[0x0];var _0x2fbc32=[];var _0x1e2684=[];_0x2da6c5[_0x55d5('0xaf')](function(_0x152604){if(!_[_0x55d5('0xb3')](_0x152604[_0x55d5('0xb4')])){var _0x16c402=_0x152604[_0x55d5('0xb4')]['substring'](_0x152604[_0x55d5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x16c402==='BooleanAttributeMetadata'){_0x2fbc32[_0x55d5('0xb1')](getBooleanList(_0x1e6189,_0x4882a6,_0x1e2684,_0x47887f[_0x55d5('0xa9')],_0x152604[_0x55d5('0xa9')],_0x5e049e));}}});return Promise[_0x55d5('0xb2')](_0x2fbc32);})[_0x55d5('0x25')](function(_0x133c09){_0x117736=_0x133c09[0x0];var _0x478687=[];var _0x543712=[];_0x2da6c5[_0x55d5('0xaf')](function(_0x4170ba){if(_0x4170ba[_0x55d5('0xb4')]){var _0x3ea07f=_0x4170ba[_0x55d5('0xb4')][_0x55d5('0x9e')](_0x4170ba[_0x55d5('0xb4')][_0x55d5('0xb5')]('.')+0x1);if(_0x3ea07f===_0x55d5('0xb6')||_0x3ea07f==='DoubleAttributeMetadata'||_0x3ea07f==='BigIntAttributeMetadata'||_0x3ea07f===_0x55d5('0xb7')||_0x3ea07f==='MemoAttributeMetadata'||_0x3ea07f==='DateTimeAttributeMetadata'||_0x3ea07f===_0x55d5('0xb8')||_0x3ea07f===_0x55d5('0xb9')||_0x3ea07f===_0x55d5('0xba')||_0x3ea07f===_0x55d5('0xbb')){_0x478687['push'](getInputList(_0x1e6189,_0x4882a6,_0x3ea07f,_0x543712,_0x47887f[_0x55d5('0xa9')],_0x4170ba[_0x55d5('0xa9')],_0x5e049e));}}});return Promise[_0x55d5('0xb2')](_0x478687);})[_0x55d5('0x25')](function(_0x116816){_0x11cb2a=_0x116816[0x0];var _0x354140=_0x10d5d3[_0x55d5('0x98')](_0x117736)['concat'](_0x11cb2a);var _0x5cd05a={'count':_0x354140[_0x55d5('0x37')],'rows':_0x354140};return _0x5cd05a;})['then'](respondWithResult(_0x166f8c,null))[_0x55d5('0x4a')](function(_0x3367da){var _0x3c0970=_0x2f5669[_0x55d5('0x31')][_0x55d5('0xbc')]?0x1f4:_0x3367da[_0x55d5('0xbd')]||0x1f4;logger[_0x55d5('0x28')](_0x3367da[_0x55d5('0x29')]);delete _0x3367da[_0x55d5('0x2a')];if(_0x3c0970===0x191){_0x3c0970=0x190;}_0x166f8c[_0x55d5('0x1a')](_0x3c0970)[_0x55d5('0x2b')](_0x2f5669['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3367da[_0x55d5('0xbd')]}:_0x3367da);});};function getSelectList(_0x102e04,_0x93b229,_0x409eb5,_0x50f368,_0x13fc11,_0x10d9a5){var _0x452258={'method':_0x55d5('0xa5'),'uri':_0x102e04+_0x55d5('0xaa')+_0x50f368+_0x55d5('0xbe')+_0x13fc11+_0x55d5('0xbf')+_0x55d5('0xc0'),'headers':{'Authorization':'Bearer\x20'+_0x10d9a5,'If-None-Match':null,'OData-Version':_0x55d5('0xa8')},'json':!![]};return rp(_0x452258)[_0x55d5('0x25')](function(_0xe7847a){var _0xc69c5a=[];var _0x2fc6d6=_0xe7847a[_0x55d5('0xc1')]['Options'];_0x2fc6d6[_0x55d5('0xaf')](function(_0x1055a7){_0xc69c5a[_0x55d5('0xb1')]({'name':_0x1055a7[_0x55d5('0xc2')]['UserLocalizedLabel'][_0x55d5('0xc2')],'value':String(_0x1055a7['Value'])});});var _0x18fe7e={'id':_0x93b229+'_'+_0xe7847a[_0x55d5('0xae')],'name':_0xe7847a[_0x55d5('0xc3')]['UserLocalizedLabel'][_0x55d5('0xc2')],'custom':![],'options':_0xc69c5a};_0x409eb5[_0x55d5('0xb1')](_0x18fe7e);return _0x409eb5;});}function getBooleanList(_0x391f93,_0x1d105c,_0x5e923e,_0x310b7e,_0x317c8d,_0x27f389){var _0x117a76={'method':_0x55d5('0xa5'),'uri':_0x391f93+_0x55d5('0xaa')+_0x310b7e+_0x55d5('0xbe')+_0x317c8d+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x55d5('0xa7')+_0x27f389,'If-None-Match':null,'OData-Version':_0x55d5('0xa8')},'json':!![]};return rp(_0x117a76)[_0x55d5('0x25')](function(_0x18eeac){var _0x4c5694=[];_0x4c5694[_0x55d5('0xb1')]({'name':_0x18eeac[_0x55d5('0xc1')][_0x55d5('0xc4')][_0x55d5('0xc2')][_0x55d5('0xc5')][_0x55d5('0xc2')],'value':'true'},{'name':_0x18eeac[_0x55d5('0xc1')][_0x55d5('0xc6')][_0x55d5('0xc2')][_0x55d5('0xc5')]['Label'],'value':'false'});var _0x32c2b6={'id':_0x1d105c+'_'+_0x18eeac[_0x55d5('0xae')],'name':_0x18eeac[_0x55d5('0xc3')]['UserLocalizedLabel'][_0x55d5('0xc2')],'custom':![],'options':_0x4c5694};_0x5e923e[_0x55d5('0xb1')](_0x32c2b6);return _0x5e923e;});}function getInputList(_0x4f86cf,_0xcb975b,_0x2d8f45,_0x511774,_0x5e8531,_0x5b27e7,_0x61ae1b){var _0x46742b={'method':_0x55d5('0xa5'),'uri':_0x4f86cf+_0x55d5('0xaa')+_0x5e8531+')/Attributes('+_0x5b27e7+_0x55d5('0xc7')+_0x2d8f45+_0x55d5('0xc8'),'headers':{'Authorization':_0x55d5('0xa7')+_0x61ae1b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x46742b)['then'](function(_0x66ba2){var _0x1633dc={'id':_0xcb975b+'_'+_0x66ba2[_0x55d5('0xae')],'name':_0x66ba2[_0x55d5('0xc3')][_0x55d5('0xc5')]?_0x66ba2['DisplayName'][_0x55d5('0xc5')][_0x55d5('0xc2')]:_0x66ba2['LogicalName'],'custom':![],'options':[]};_0x511774[_0x55d5('0xb1')](_0x1633dc);return _0x511774;});} \ No newline at end of file +var _0xe292=['$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode','GET',')/Attributes('];(function(_0x1db99b,_0x470999){var _0x2206b6=function(_0x4d7c3f){while(--_0x4d7c3f){_0x1db99b['push'](_0x1db99b['shift']());}};_0x2206b6(++_0x470999);}(_0xe292,0x19e));var _0x2e29=function(_0x312070,_0x2b2821){_0x312070=_0x312070-0x0;var _0x496617=_0xe292[_0x312070];return _0x496617;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e29('0x0'));var jsonpatch=require(_0x2e29('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e29('0x2'));var Mustache=require(_0x2e29('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2e29('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e29('0x5'));var _=require(_0x2e29('0x6'));var squel=require(_0x2e29('0x7'));var crypto=require(_0x2e29('0x8'));var jsforce=require(_0x2e29('0x9'));var deskjs=require(_0x2e29('0xa'));var toCsv=require(_0x2e29('0xb'));var querystring=require(_0x2e29('0xc'));var Papa=require(_0x2e29('0xd'));var Redis=require(_0x2e29('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e29('0xf'));var as=require(_0x2e29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e29('0x11'))(_0x2e29('0x12'));var utils=require(_0x2e29('0x13'));var config=require(_0x2e29('0x14'));var licenseUtil=require(_0x2e29('0x15'));var db=require(_0x2e29('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x91d02,_0x3e1257){_0x3e1257=_0x3e1257||0xcc;return function(_0x46ea86){if(_0x46ea86){return _0x91d02[_0x2e29('0x17')](_0x3e1257);}return _0x91d02[_0x2e29('0x18')](_0x3e1257)['end']();};}function respondWithResult(_0x4b79ad,_0x32344b){_0x32344b=_0x32344b||0xc8;return function(_0x291319){if(_0x291319){return _0x4b79ad[_0x2e29('0x18')](_0x32344b)[_0x2e29('0x19')](_0x291319);}};}function respondWithFilteredResult(_0x22a196,_0x5dbc41){return function(_0x5e57c2){if(_0x5e57c2){var _0x231434=typeof _0x5dbc41['offset']==='undefined'&&typeof _0x5dbc41[_0x2e29('0x1a')]===_0x2e29('0x1b');var _0x14d92e=_0x5e57c2[_0x2e29('0x1c')];var _0x1c142d=_0x231434?0x0:_0x5dbc41[_0x2e29('0x1d')];var _0x2692fd=_0x231434?_0x5e57c2['count']:_0x5dbc41['offset']+_0x5dbc41[_0x2e29('0x1a')];var _0x4c56a5;if(_0x2692fd>=_0x14d92e){_0x2692fd=_0x14d92e;_0x4c56a5=0xc8;}else{_0x4c56a5=0xce;}_0x22a196[_0x2e29('0x18')](_0x4c56a5);return _0x22a196[_0x2e29('0x1e')](_0x2e29('0x1f'),_0x1c142d+'-'+_0x2692fd+'/'+_0x14d92e)['json'](_0x5e57c2);}return null;};}function patchUpdates(_0x5c4d4c){return function(_0x436ef0){try{jsonpatch[_0x2e29('0x20')](_0x436ef0,_0x5c4d4c,!![]);}catch(_0x38c5ea){return BPromise[_0x2e29('0x21')](_0x38c5ea);}return _0x436ef0['save']();};}function saveUpdates(_0x16a485,_0x1c3da0){return function(_0x326714){if(_0x326714){return _0x326714[_0x2e29('0x22')](_0x16a485)[_0x2e29('0x23')](function(_0x4d7369){return _0x4d7369;});}return null;};}function removeEntity(_0xee5a46,_0x47617c){return function(_0x234580){if(_0x234580){return _0x234580[_0x2e29('0x24')]()[_0x2e29('0x23')](function(){_0xee5a46[_0x2e29('0x18')](0xcc)[_0x2e29('0x25')]();});}};}function handleEntityNotFound(_0x233e29,_0x258c8e){return function(_0x35a621){if(!_0x35a621){_0x233e29[_0x2e29('0x17')](0x194);}return _0x35a621;};}function handleError(_0x57fa04,_0x35f509){_0x35f509=_0x35f509||0x1f4;return function(_0x19c6ae){logger[_0x2e29('0x26')](_0x19c6ae[_0x2e29('0x27')]);if(_0x19c6ae[_0x2e29('0x28')]){delete _0x19c6ae[_0x2e29('0x28')];}_0x57fa04[_0x2e29('0x18')](_0x35f509)[_0x2e29('0x29')](_0x19c6ae);};}exports[_0x2e29('0x2a')]=function(_0x3169b5,_0x1317d8){var _0x21f812={},_0x129de8={},_0x208ec1={'count':0x0,'rows':[]};var _0x502567=_[_0x2e29('0x2b')](db[_0x2e29('0x2c')]['rawAttributes'],function(_0x387fd0){return{'name':_0x387fd0[_0x2e29('0x2d')],'type':_0x387fd0['type'][_0x2e29('0x2e')]};});_0x129de8[_0x2e29('0x2f')]=_[_0x2e29('0x2b')](_0x502567,_0x2e29('0x28'));_0x129de8[_0x2e29('0x30')]=_['keys'](_0x3169b5[_0x2e29('0x30')]);_0x129de8[_0x2e29('0x31')]=_[_0x2e29('0x32')](_0x129de8[_0x2e29('0x2f')],_0x129de8[_0x2e29('0x30')]);_0x21f812['attributes']=_[_0x2e29('0x32')](_0x129de8[_0x2e29('0x2f')],qs[_0x2e29('0x33')](_0x3169b5[_0x2e29('0x30')][_0x2e29('0x33')]));_0x21f812['attributes']=_0x21f812[_0x2e29('0x34')][_0x2e29('0x35')]?_0x21f812['attributes']:_0x129de8[_0x2e29('0x2f')];if(!_0x3169b5['query'][_0x2e29('0x36')]('nolimit')){_0x21f812[_0x2e29('0x1a')]=qs['limit'](_0x3169b5['query']['limit']);_0x21f812[_0x2e29('0x1d')]=qs[_0x2e29('0x1d')](_0x3169b5[_0x2e29('0x30')][_0x2e29('0x1d')]);}_0x21f812[_0x2e29('0x37')]=qs[_0x2e29('0x38')](_0x3169b5[_0x2e29('0x30')][_0x2e29('0x38')]);_0x21f812[_0x2e29('0x39')]=qs[_0x2e29('0x31')](_[_0x2e29('0x3a')](_0x3169b5[_0x2e29('0x30')],_0x129de8[_0x2e29('0x31')]),_0x502567);if(_0x3169b5[_0x2e29('0x30')][_0x2e29('0x3b')]){_0x21f812['where']=_[_0x2e29('0x3c')](_0x21f812['where'],{'$or':_[_0x2e29('0x2b')](_0x502567,function(_0x4d7658){if(_0x4d7658[_0x2e29('0x3d')]!==_0x2e29('0x3e')){var _0xe44fa6={};_0xe44fa6[_0x4d7658['name']]={'$like':'%'+_0x3169b5[_0x2e29('0x30')][_0x2e29('0x3b')]+'%'};return _0xe44fa6;}})});}_0x21f812=_[_0x2e29('0x3c')]({},_0x21f812,_0x3169b5['options']);var _0x3e18dc={'where':_0x21f812[_0x2e29('0x39')]};return db[_0x2e29('0x2c')][_0x2e29('0x1c')](_0x3e18dc)[_0x2e29('0x23')](function(_0x371ad4){_0x208ec1[_0x2e29('0x1c')]=_0x371ad4;if(_0x3169b5['query'][_0x2e29('0x3f')]){_0x21f812[_0x2e29('0x40')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x2e29('0x41')](_0x21f812);})[_0x2e29('0x23')](function(_0x4dc58d){_0x208ec1[_0x2e29('0x42')]=_0x4dc58d;return _0x208ec1;})['then'](respondWithFilteredResult(_0x1317d8,_0x21f812))[_0x2e29('0x43')](handleError(_0x1317d8,null));};exports[_0x2e29('0x44')]=function(_0x14423e,_0x1cec3e){var _0x340c1a={'raw':![],'where':{'id':_0x14423e[_0x2e29('0x45')]['id']}},_0x4d4f3c={};_0x4d4f3c[_0x2e29('0x2f')]=_[_0x2e29('0x46')](db['Dynamics365Account'][_0x2e29('0x47')]);_0x4d4f3c[_0x2e29('0x30')]=_[_0x2e29('0x46')](_0x14423e[_0x2e29('0x30')]);_0x4d4f3c[_0x2e29('0x31')]=_[_0x2e29('0x32')](_0x4d4f3c[_0x2e29('0x2f')],_0x4d4f3c['query']);_0x340c1a[_0x2e29('0x34')]=_[_0x2e29('0x32')](_0x4d4f3c['model'],qs[_0x2e29('0x33')](_0x14423e[_0x2e29('0x30')]['fields']));_0x340c1a['attributes']=_0x340c1a[_0x2e29('0x34')][_0x2e29('0x35')]?_0x340c1a[_0x2e29('0x34')]:_0x4d4f3c['model'];if(_0x14423e[_0x2e29('0x30')]['includeAll']){_0x340c1a['include']=[{'all':!![]}];}_0x340c1a=_[_0x2e29('0x3c')]({},_0x340c1a,_0x14423e[_0x2e29('0x48')]);return db[_0x2e29('0x2c')][_0x2e29('0x49')](_0x340c1a)[_0x2e29('0x23')](handleEntityNotFound(_0x1cec3e,null))['then'](respondWithResult(_0x1cec3e,null))[_0x2e29('0x43')](handleError(_0x1cec3e,null));};exports[_0x2e29('0x4a')]=function(_0x338915,_0x8db8b9){return db[_0x2e29('0x2c')][_0x2e29('0x4a')](_0x338915[_0x2e29('0x4b')],{})[_0x2e29('0x23')](respondWithResult(_0x8db8b9,0xc9))[_0x2e29('0x43')](handleError(_0x8db8b9,null));};exports[_0x2e29('0x22')]=function(_0x37d4bf,_0x21d7ff){if(_0x37d4bf[_0x2e29('0x4b')]['id']){delete _0x37d4bf[_0x2e29('0x4b')]['id'];}return db['Dynamics365Account'][_0x2e29('0x49')]({'where':{'id':_0x37d4bf[_0x2e29('0x45')]['id']}})[_0x2e29('0x23')](handleEntityNotFound(_0x21d7ff,null))[_0x2e29('0x23')](saveUpdates(_0x37d4bf[_0x2e29('0x4b')],null))[_0x2e29('0x23')](respondWithResult(_0x21d7ff,null))['catch'](handleError(_0x21d7ff,null));};exports[_0x2e29('0x24')]=function(_0x3768ab,_0x1a7cad){return db[_0x2e29('0x2c')]['find']({'where':{'id':_0x3768ab['params']['id']}})[_0x2e29('0x23')](handleEntityNotFound(_0x1a7cad,null))[_0x2e29('0x23')](removeEntity(_0x1a7cad,null))[_0x2e29('0x43')](handleError(_0x1a7cad,null));};exports[_0x2e29('0x4c')]=function(_0x216acd,_0xf28de5,_0x16c253){var _0x3ec5d3={};var _0x378241={};var _0x1a1715;var _0x4485a8;return db[_0x2e29('0x2c')][_0x2e29('0x4d')]({'where':{'id':_0x216acd[_0x2e29('0x45')]['id']}})['then'](handleEntityNotFound(_0xf28de5,null))[_0x2e29('0x23')](function(_0x645030){if(_0x645030){_0x1a1715=_0x645030;_0x378241[_0x2e29('0x2f')]=_[_0x2e29('0x46')](db[_0x2e29('0x4e')][_0x2e29('0x47')]);_0x378241[_0x2e29('0x30')]=_[_0x2e29('0x46')](_0x216acd[_0x2e29('0x30')]);_0x378241[_0x2e29('0x31')]=_['intersection'](_0x378241[_0x2e29('0x2f')],_0x378241[_0x2e29('0x30')]);_0x3ec5d3['attributes']=_['intersection'](_0x378241[_0x2e29('0x2f')],qs['fields'](_0x216acd[_0x2e29('0x30')][_0x2e29('0x33')]));_0x3ec5d3[_0x2e29('0x34')]=_0x3ec5d3[_0x2e29('0x34')][_0x2e29('0x35')]?_0x3ec5d3['attributes']:_0x378241['model'];_0x3ec5d3[_0x2e29('0x37')]=qs[_0x2e29('0x38')](_0x216acd['query'][_0x2e29('0x38')]);_0x3ec5d3['where']=qs[_0x2e29('0x31')](_[_0x2e29('0x3a')](_0x216acd[_0x2e29('0x30')],_0x378241[_0x2e29('0x31')]));if(_0x216acd['query'][_0x2e29('0x3b')]){_0x3ec5d3[_0x2e29('0x39')]=_['merge'](_0x3ec5d3['where'],{'$or':_[_0x2e29('0x2b')](_0x3ec5d3[_0x2e29('0x34')],function(_0x7d85ea){var _0x2a971e={};_0x2a971e[_0x7d85ea]={'$like':'%'+_0x216acd['query']['filter']+'%'};return _0x2a971e;})});}_0x3ec5d3=_[_0x2e29('0x3c')]({},_0x3ec5d3,_0x216acd[_0x2e29('0x48')]);return _0x1a1715[_0x2e29('0x4c')](_0x3ec5d3);}})['then'](function(_0x3a2075){if(_0x3a2075){_0x4485a8=_0x3a2075[_0x2e29('0x35')];if(!_0x216acd['query']['hasOwnProperty'](_0x2e29('0x4f'))){_0x3ec5d3[_0x2e29('0x1a')]=qs['limit'](_0x216acd[_0x2e29('0x30')][_0x2e29('0x1a')]);_0x3ec5d3['offset']=qs['offset'](_0x216acd[_0x2e29('0x30')][_0x2e29('0x1d')]);}return _0x1a1715[_0x2e29('0x4c')](_0x3ec5d3);}})[_0x2e29('0x23')](function(_0x493bef){if(_0x493bef){return _0x493bef?{'count':_0x4485a8,'rows':_0x493bef}:null;}})[_0x2e29('0x23')](respondWithResult(_0xf28de5,null))[_0x2e29('0x43')](handleError(_0xf28de5,null));};exports[_0x2e29('0x50')]=function(_0x35f7dc,_0x27e8ab,_0x2f3c3f){if(_0x35f7dc['body']['id']){delete _0x35f7dc[_0x2e29('0x4b')]['id'];}return db[_0x2e29('0x2c')][_0x2e29('0x4d')]({'where':{'id':_0x35f7dc[_0x2e29('0x45')]['id']}})[_0x2e29('0x23')](handleEntityNotFound(_0x27e8ab,null))[_0x2e29('0x23')](function(_0x515e37){if(_0x515e37){_0x35f7dc[_0x2e29('0x4b')]['AccountId']=_0x515e37['id'];_0x35f7dc[_0x2e29('0x4b')][_0x2e29('0x51')]=integrations[_0x2e29('0x52')](_0x35f7dc[_0x2e29('0x4b')]['channel'],_0x35f7dc[_0x2e29('0x4b')][_0x2e29('0x3d')]);_0x35f7dc[_0x2e29('0x4b')][_0x2e29('0x53')]=integrations[_0x2e29('0x54')](_0x35f7dc['body']['channel'],_0x35f7dc[_0x2e29('0x4b')]['type']);return db[_0x2e29('0x4e')][_0x2e29('0x4a')](_0x35f7dc[_0x2e29('0x4b')],{'include':[{'model':db['Dynamics365Field'],'as':_0x2e29('0x51')},{'model':db[_0x2e29('0x55')],'as':_0x2e29('0x53')}]});}return null;})[_0x2e29('0x23')](respondWithResult(_0x27e8ab,null))[_0x2e29('0x43')](handleError(_0x27e8ab,null));};exports[_0x2e29('0x56')]=function(_0x14eb33,_0xbffd99,_0x3603ee){var _0x164749=_0x14eb33['query'][_0x2e29('0x57')];var _0x1ac2c0=_0x164749===_0x2e29('0x58')?'Incident':_0x2e29('0x59');var _0x3d817e='';var _0x5ef890='';var _0xc9a0ad='';var _0x57c4d7='';var _0xf0e62d='';var _0x35b409='';var _0x5e1ee8='';var _0x2629c3='';var _0x1191a6=[_0x2e29('0x5a'),'description',_0x2e29('0x5b'),_0x2e29('0x5c'),'caseorigincode',_0x2e29('0x5d'),_0x2e29('0x5e'),'regardingobjectid','directioncode',_0x2e29('0x5f')];var _0x15ae88=[_0x2e29('0x60'),'accountidyominame','actualserviceunits',_0x2e29('0x61'),_0x2e29('0x62'),'contactidyominame','contractdetailidname',_0x2e29('0x63'),'createdbyexternalpartyname',_0x2e29('0x64'),_0x2e29('0x65'),_0x2e29('0x66'),_0x2e29('0x67'),_0x2e29('0x68'),'createdonbehalfbyyominame',_0x2e29('0x69'),_0x2e29('0x6a'),_0x2e29('0x6b'),'emailaddress','entitlementidname',_0x2e29('0x6c'),_0x2e29('0x6d'),_0x2e29('0x6e'),_0x2e29('0x6f'),_0x2e29('0x70'),_0x2e29('0x71'),_0x2e29('0x72'),'influencescore',_0x2e29('0x73'),_0x2e29('0x74'),_0x2e29('0x75'),_0x2e29('0x76'),_0x2e29('0x77'),_0x2e29('0x78'),_0x2e29('0x79'),_0x2e29('0x7a'),'modifiedonbehalfbyname',_0x2e29('0x7b'),_0x2e29('0x7c'),_0x2e29('0x7d'),_0x2e29('0x7e'),_0x2e29('0x7f'),_0x2e29('0x80'),_0x2e29('0x81'),_0x2e29('0x82'),'owneridyominame',_0x2e29('0x83'),_0x2e29('0x84'),_0x2e29('0x85'),_0x2e29('0x86'),'productidname',_0x2e29('0x87'),_0x2e29('0x88'),_0x2e29('0x89'),_0x2e29('0x8a'),_0x2e29('0x8b'),'responsiblecontactidyominame',_0x2e29('0x8c'),'slainvokedidname',_0x2e29('0x8d'),_0x2e29('0x8e'),'statecode',_0x2e29('0x8f'),_0x2e29('0x90'),'ticketnumber',_0x2e29('0x91'),_0x2e29('0x92'),'traversedpath',_0x2e29('0x93'),'versionnumber'];var _0x2fdf1e=_0x1191a6[_0x2e29('0x94')](_0x15ae88);return db[_0x2e29('0x2c')][_0x2e29('0x4d')]({'where':{'id':_0x14eb33[_0x2e29('0x45')]['id']},'attributes':['id',_0x2e29('0x95'),_0x2e29('0x96'),_0x2e29('0x97'),_0x2e29('0x98'),_0x2e29('0x99'),_0x2e29('0x9a')]})[_0x2e29('0x23')](handleEntityNotFound(_0xbffd99,null))[_0x2e29('0x23')](function(_0x24d9db){if(_0x24d9db){_0x2629c3=_0x24d9db[_0x2e29('0x97')];var _0x358ae6=_0x2629c3[_0x2e29('0x9b')](-0x1);if(_0x358ae6==='/'){_0x2629c3=_0x2629c3[_0x2e29('0x9c')](0x0,_0x2629c3[_0x2e29('0x9d')](_0x358ae6));}_0x5e1ee8=util['format'](_0x2e29('0x9e'),_0x2629c3);var _0x433ac9={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x24d9db[_0x2e29('0x98')]+_0x2e29('0x9f'),'form':{'client_id':_0x24d9db['clientId'],'resource':_0x2629c3,'username':_0x24d9db['username'],'password':_0x24d9db[_0x2e29('0x96')],'grant_type':_0x2e29('0x96'),'client_secret':_0x24d9db[_0x2e29('0x9a')]},'json':!![]};return rp(_0x433ac9);}})['then'](function(_0x3d0b2f){_0x35b409=_0x3d0b2f[_0x2e29('0xa0')];var _0x5a9eec={'method':'GET','uri':encodeURI(_0x5e1ee8+_0x2e29('0xa1')+_0x1ac2c0+'\x27'),'headers':{'Authorization':_0x2e29('0xa2')+_0x35b409,'If-None-Match':null,'OData-Version':_0x2e29('0xa3')},'json':!![]};return rp(_0x5a9eec);})[_0x2e29('0x23')](function(_0x49adc6){var _0x5d5c1f=_0x49adc6[_0x2e29('0xa4')][0x0];var _0x212cf1=_0x5d5c1f[_0x2e29('0xa5')];var _0x539a5d={'method':'GET','uri':_0x5e1ee8+_0x2e29('0xa6')+_0x212cf1+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x2e29('0xa2')+_0x35b409,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x539a5d);})[_0x2e29('0x23')](function(_0xd704fb){_0x3d817e=_0xd704fb;_0x5ef890=_0x3d817e[_0x2e29('0xa7')];_0x5ef890=_['remove'](_0x5ef890,function(_0x49ecd8){return!_0x2fdf1e['includes'](_0x49ecd8[_0x2e29('0xa8')]);});var _0xb43a84=[];var _0x28f1df=[];_0x5ef890[_0x2e29('0xa9')](function(_0x2ee1e5){if(_0x2ee1e5[_0x2e29('0xaa')]){var _0x5ba036=_0x2ee1e5[_0x2e29('0xaa')][_0x2e29('0x9c')](_0x2ee1e5[_0x2e29('0xaa')][_0x2e29('0x9d')]('.')+0x1);if(_0x5ba036===_0x2e29('0xab')){_0xb43a84[_0x2e29('0xac')](getSelectList(_0x5e1ee8,_0x164749,_0x28f1df,_0x3d817e[_0x2e29('0xa5')],_0x2ee1e5['MetadataId'],_0x35b409));}}});return Promise[_0x2e29('0xad')](_0xb43a84);})[_0x2e29('0x23')](function(_0x88370e){_0xc9a0ad=_0x88370e[0x0];var _0xc167cc=[];var _0x3d4288=[];_0x5ef890[_0x2e29('0xa9')](function(_0x5d025e){if(!_[_0x2e29('0xae')](_0x5d025e['@odata.type'])){var _0x29b267=_0x5d025e['@odata.type'][_0x2e29('0x9c')](_0x5d025e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x29b267===_0x2e29('0xaf')){_0xc167cc[_0x2e29('0xac')](getBooleanList(_0x5e1ee8,_0x164749,_0x3d4288,_0x3d817e[_0x2e29('0xa5')],_0x5d025e[_0x2e29('0xa5')],_0x35b409));}}});return Promise['all'](_0xc167cc);})['then'](function(_0x18328b){_0x57c4d7=_0x18328b[0x0];var _0x46261e=[];var _0x19b922=[];_0x5ef890[_0x2e29('0xa9')](function(_0x59d14f){if(_0x59d14f[_0x2e29('0xaa')]){var _0xe07787=_0x59d14f[_0x2e29('0xaa')][_0x2e29('0x9c')](_0x59d14f[_0x2e29('0xaa')]['lastIndexOf']('.')+0x1);if(_0xe07787===_0x2e29('0xb0')||_0xe07787===_0x2e29('0xb1')||_0xe07787==='BigIntAttributeMetadata'||_0xe07787===_0x2e29('0xb2')||_0xe07787===_0x2e29('0xb3')||_0xe07787===_0x2e29('0xb4')||_0xe07787===_0x2e29('0xb5')||_0xe07787==='EntityNameAttributeMetadata'||_0xe07787===_0x2e29('0xb6')||_0xe07787===_0x2e29('0xb7')){_0x46261e[_0x2e29('0xac')](getInputList(_0x5e1ee8,_0x164749,_0xe07787,_0x19b922,_0x3d817e['MetadataId'],_0x59d14f['MetadataId'],_0x35b409));}}});return Promise[_0x2e29('0xad')](_0x46261e);})[_0x2e29('0x23')](function(_0x4b1731){_0xf0e62d=_0x4b1731[0x0];var _0x3781d9=_0xc9a0ad[_0x2e29('0x94')](_0x57c4d7)[_0x2e29('0x94')](_0xf0e62d);var _0x103c8a={'count':_0x3781d9[_0x2e29('0x35')],'rows':_0x3781d9};return _0x103c8a;})['then'](respondWithResult(_0xbffd99,null))[_0x2e29('0x43')](function(_0x4c81e1){var _0x229fc0=_0x14eb33[_0x2e29('0x30')]['test']?0x1f4:_0x4c81e1['statusCode']||0x1f4;logger[_0x2e29('0x26')](_0x4c81e1[_0x2e29('0x27')]);delete _0x4c81e1['name'];if(_0x229fc0===0x191){_0x229fc0=0x190;}_0xbffd99[_0x2e29('0x18')](_0x229fc0)[_0x2e29('0x29')](_0x14eb33[_0x2e29('0x30')][_0x2e29('0xb8')]?{'message':_0x2e29('0xb9'),'statusCode':_0x4c81e1[_0x2e29('0xba')]}:_0x4c81e1);});};function getSelectList(_0x5cd5d8,_0x178915,_0x598b14,_0x319384,_0x1d7ae0,_0x1f5b12){var _0x4376d2={'method':_0x2e29('0xbb'),'uri':_0x5cd5d8+_0x2e29('0xa6')+_0x319384+_0x2e29('0xbc')+_0x1d7ae0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x2e29('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x1f5b12,'If-None-Match':null,'OData-Version':_0x2e29('0xa3')},'json':!![]};return rp(_0x4376d2)['then'](function(_0x3853b1){var _0x4c1ffb=[];var _0x17a092=_0x3853b1[_0x2e29('0xbe')][_0x2e29('0xbf')];_0x17a092['forEach'](function(_0x5bf4ce){_0x4c1ffb[_0x2e29('0xac')]({'name':_0x5bf4ce[_0x2e29('0xc0')][_0x2e29('0xc1')][_0x2e29('0xc0')],'value':String(_0x5bf4ce[_0x2e29('0xc2')])});});var _0x2e9cf6={'id':_0x178915+'_'+_0x3853b1['LogicalName'],'name':_0x3853b1[_0x2e29('0xc3')][_0x2e29('0xc1')][_0x2e29('0xc0')],'custom':![],'options':_0x4c1ffb};_0x598b14[_0x2e29('0xac')](_0x2e9cf6);return _0x598b14;});}function getBooleanList(_0x147919,_0x29f903,_0x266156,_0x1851c3,_0x3ade87,_0x1f0822){var _0x1e9fc5={'method':_0x2e29('0xbb'),'uri':_0x147919+_0x2e29('0xa6')+_0x1851c3+_0x2e29('0xbc')+_0x3ade87+_0x2e29('0xc4'),'headers':{'Authorization':_0x2e29('0xa2')+_0x1f0822,'If-None-Match':null,'OData-Version':_0x2e29('0xa3')},'json':!![]};return rp(_0x1e9fc5)[_0x2e29('0x23')](function(_0xbca95b){var _0x2c8da1=[];_0x2c8da1['push']({'name':_0xbca95b['OptionSet']['TrueOption'][_0x2e29('0xc0')][_0x2e29('0xc1')][_0x2e29('0xc0')],'value':'true'},{'name':_0xbca95b[_0x2e29('0xbe')][_0x2e29('0xc5')][_0x2e29('0xc0')][_0x2e29('0xc1')][_0x2e29('0xc0')],'value':_0x2e29('0xc6')});var _0x52966e={'id':_0x29f903+'_'+_0xbca95b['LogicalName'],'name':_0xbca95b[_0x2e29('0xc3')][_0x2e29('0xc1')][_0x2e29('0xc0')],'custom':![],'options':_0x2c8da1};_0x266156[_0x2e29('0xac')](_0x52966e);return _0x266156;});}function getInputList(_0x1819d2,_0x3a4a73,_0x354c46,_0x5b0ea2,_0x4bda3a,_0x475b76,_0x589e36){var _0x5e2ecd={'method':'GET','uri':_0x1819d2+'EntityDefinitions('+_0x4bda3a+_0x2e29('0xbc')+_0x475b76+_0x2e29('0xc7')+_0x354c46+_0x2e29('0xc8'),'headers':{'Authorization':_0x2e29('0xa2')+_0x589e36,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e2ecd)[_0x2e29('0x23')](function(_0x572056){var _0x50b551={'id':_0x3a4a73+'_'+_0x572056[_0x2e29('0xa8')],'name':_0x572056['DisplayName'][_0x2e29('0xc1')]?_0x572056[_0x2e29('0xc3')]['UserLocalizedLabel'][_0x2e29('0xc0')]:_0x572056[_0x2e29('0xa8')],'custom':![],'options':[]};_0x5b0ea2[_0x2e29('0xac')](_0x50b551);return _0x5b0ea2;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7dafebf..be5e13d 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x2fd7de,_0x5b3c11){var _0x5d28cc=function(_0x2372dd){while(--_0x2372dd){_0x2fd7de['push'](_0x2fd7de['shift']());}};_0x5d28cc(++_0x5b3c11);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 6a1e1e0..39582fc 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 _0xde1d=['GetDynamics365Account','Dynamics365Account','options','raw','where','limit','map','include','model','attributes','info','ShowDynamics365Account','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x23cd34,_0xe7e8f7){var _0x1e1e48=function(_0x820992){while(--_0x820992){_0x23cd34['push'](_0x23cd34['shift']());}};_0x1e1e48(++_0xe7e8f7);}(_0xde1d,0x109));var _0xdde1=function(_0x538967,_0x464c86){_0x538967=_0x538967-0x0;var _0x30bc9b=_0xde1d[_0x538967];return _0x30bc9b;};'use strict';var _=require('lodash');var util=require(_0xdde1('0x0'));var moment=require(_0xdde1('0x1'));var BPromise=require(_0xdde1('0x2'));var rs=require(_0xdde1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdde1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdde1('0x5'))(_0xdde1('0x6'));var config=require(_0xdde1('0x7'));var jayson=require(_0xdde1('0x8'));var client=jayson[_0xdde1('0x9')][_0xdde1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570329,_0x88bff4,_0x38cb0b){return new BPromise(function(_0x47c5a7,_0x250661){return client[_0xdde1('0xb')](_0x570329,_0x38cb0b)[_0xdde1('0xc')](function(_0x8d634d){logger['info'](_0xdde1('0xd'),_0x88bff4,_0xdde1('0xe'));logger[_0xdde1('0xf')](_0xdde1('0x10'),_0x88bff4,_0xdde1('0xe'),JSON[_0xdde1('0x11')](_0x8d634d));if(_0x8d634d['error']){if(_0x8d634d['error'][_0xdde1('0x12')]===0x1f4){logger[_0xdde1('0x13')](_0xdde1('0xd'),_0x88bff4,_0x8d634d[_0xdde1('0x13')]['message']);return _0x250661(_0x8d634d['error'][_0xdde1('0x14')]);}logger[_0xdde1('0x13')](_0xdde1('0xd'),_0x88bff4,_0x8d634d['error'][_0xdde1('0x14')]);return _0x47c5a7(_0x8d634d[_0xdde1('0x13')][_0xdde1('0x14')]);}else{logger['info'](_0xdde1('0xd'),_0x88bff4,_0xdde1('0xe'));_0x47c5a7(_0x8d634d[_0xdde1('0x15')][_0xdde1('0x14')]);}})[_0xdde1('0x16')](function(_0x5ed661){logger[_0xdde1('0x13')](_0xdde1('0xd'),_0x88bff4,_0x5ed661);_0x250661(_0x5ed661);});});}exports[_0xdde1('0x17')]=function(_0x5db5be){var _0x4a3d5b=this;return new Promise(function(_0x88b9aa,_0x4d76bf){return db[_0xdde1('0x18')]['findAll']({'raw':_0x5db5be[_0xdde1('0x19')]?_0x5db5be[_0xdde1('0x19')][_0xdde1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5db5be[_0xdde1('0x19')]?_0x5db5be[_0xdde1('0x19')][_0xdde1('0x1b')]||null:null,'attributes':_0x5db5be[_0xdde1('0x19')]?_0x5db5be[_0xdde1('0x19')]['attributes']||null:null,'limit':_0x5db5be[_0xdde1('0x19')]?_0x5db5be[_0xdde1('0x19')][_0xdde1('0x1c')]||null:null,'include':_0x5db5be[_0xdde1('0x19')]?_0x5db5be['options']['include']?_[_0xdde1('0x1d')](_0x5db5be[_0xdde1('0x19')][_0xdde1('0x1e')],function(_0x2db20d){return{'model':db[_0x2db20d[_0xdde1('0x1f')]],'as':_0x2db20d['as'],'attributes':_0x2db20d['attributes'],'include':_0x2db20d[_0xdde1('0x1e')]?_[_0xdde1('0x1d')](_0x2db20d[_0xdde1('0x1e')],function(_0x372ce7){return{'model':db[_0x372ce7['model']],'as':_0x372ce7['as'],'attributes':_0x372ce7[_0xdde1('0x20')],'include':_0x372ce7[_0xdde1('0x1e')]?_[_0xdde1('0x1d')](_0x372ce7['include'],function(_0x29b1a1){return{'model':db[_0x29b1a1[_0xdde1('0x1f')]],'as':_0x29b1a1['as'],'attributes':_0x29b1a1[_0xdde1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdde1('0xc')](function(_0x223f28){logger[_0xdde1('0x21')](_0xdde1('0x17'),_0x5db5be);logger[_0xdde1('0xf')](_0xdde1('0x17'),_0x5db5be,JSON['stringify'](_0x223f28));_0x88b9aa(_0x223f28);})[_0xdde1('0x16')](function(_0x56340a){logger['error']('GetDynamics365Account',_0x56340a[_0xdde1('0x14')],_0x5db5be);_0x4d76bf(_0x4a3d5b[_0xdde1('0x13')](0x1f4,_0x56340a['message']));});});};exports[_0xdde1('0x22')]=function(_0x1917c0){var _0x4c3ead=this;return new Promise(function(_0x1c5e37,_0x416f56){return db[_0xdde1('0x18')][_0xdde1('0x23')]({'raw':_0x1917c0[_0xdde1('0x19')]?_0x1917c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x1917c0[_0xdde1('0x19')]?_0x1917c0['options'][_0xdde1('0x1b')]||null:null,'attributes':_0x1917c0[_0xdde1('0x19')]?_0x1917c0[_0xdde1('0x19')]['attributes']||null:null,'include':_0x1917c0[_0xdde1('0x19')]?_0x1917c0['options'][_0xdde1('0x1e')]?_[_0xdde1('0x1d')](_0x1917c0[_0xdde1('0x19')][_0xdde1('0x1e')],function(_0x462195){return{'model':db[_0x462195[_0xdde1('0x1f')]],'as':_0x462195['as'],'attributes':_0x462195[_0xdde1('0x20')],'include':_0x462195[_0xdde1('0x1e')]?_[_0xdde1('0x1d')](_0x462195[_0xdde1('0x1e')],function(_0x4f3e89){return{'model':db[_0x4f3e89['model']],'as':_0x4f3e89['as'],'attributes':_0x4f3e89[_0xdde1('0x20')],'include':_0x4f3e89['include']?_[_0xdde1('0x1d')](_0x4f3e89[_0xdde1('0x1e')],function(_0x56de8b){return{'model':db[_0x56de8b[_0xdde1('0x1f')]],'as':_0x56de8b['as'],'attributes':_0x56de8b[_0xdde1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdde1('0xc')](function(_0x540afd){logger[_0xdde1('0x21')](_0xdde1('0x22'),_0x1917c0);logger['debug'](_0xdde1('0x22'),_0x1917c0,JSON[_0xdde1('0x11')](_0x540afd));_0x1c5e37(_0x540afd);})[_0xdde1('0x16')](function(_0x58a452){logger['error'](_0xdde1('0x22'),_0x58a452[_0xdde1('0x14')],_0x1917c0);_0x416f56(_0x4c3ead['error'](0x1f4,_0x58a452[_0xdde1('0x14')]));});});}; \ No newline at end of file +var _0xec12=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','include','map','model','debug','ShowDynamics365Account','Dynamics365Account','find','lodash','moment'];(function(_0x41742a,_0x5d515e){var _0x37e70d=function(_0x269d03){while(--_0x269d03){_0x41742a['push'](_0x41742a['shift']());}};_0x37e70d(++_0x5d515e);}(_0xec12,0x153));var _0x2ec1=function(_0x4c74c9,_0x479774){_0x4c74c9=_0x4c74c9-0x0;var _0x10a36f=_0xec12[_0x4c74c9];return _0x10a36f;};'use strict';var _=require(_0x2ec1('0x0'));var util=require('util');var moment=require(_0x2ec1('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ec1('0x2'));var fs=require('fs');var Redis=require(_0x2ec1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2ec1('0x4'))('rpc');var config=require(_0x2ec1('0x5'));var jayson=require(_0x2ec1('0x6'));var client=jayson[_0x2ec1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x219a30,_0x369576,_0x4e071e){return new BPromise(function(_0x12984a,_0x2c7834){return client['request'](_0x219a30,_0x4e071e)[_0x2ec1('0x8')](function(_0xd2f002){logger[_0x2ec1('0x9')](_0x2ec1('0xa'),_0x369576,'request\x20sent');logger['debug'](_0x2ec1('0xb'),_0x369576,_0x2ec1('0xc'),JSON['stringify'](_0xd2f002));if(_0xd2f002[_0x2ec1('0xd')]){if(_0xd2f002[_0x2ec1('0xd')][_0x2ec1('0xe')]===0x1f4){logger[_0x2ec1('0xd')](_0x2ec1('0xa'),_0x369576,_0xd2f002[_0x2ec1('0xd')]['message']);return _0x2c7834(_0xd2f002[_0x2ec1('0xd')][_0x2ec1('0xf')]);}logger['error'](_0x2ec1('0xa'),_0x369576,_0xd2f002['error'][_0x2ec1('0xf')]);return _0x12984a(_0xd2f002['error'][_0x2ec1('0xf')]);}else{logger[_0x2ec1('0x9')](_0x2ec1('0xa'),_0x369576,'request\x20sent');_0x12984a(_0xd2f002[_0x2ec1('0x10')][_0x2ec1('0xf')]);}})[_0x2ec1('0x11')](function(_0x24fc9e){logger[_0x2ec1('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x369576,_0x24fc9e);_0x2c7834(_0x24fc9e);});});}exports[_0x2ec1('0x12')]=function(_0x41a850){var _0x88c8ae=this;return new Promise(function(_0x51b4aa,_0x21329b){return db['Dynamics365Account'][_0x2ec1('0x13')]({'raw':_0x41a850[_0x2ec1('0x14')]?_0x41a850[_0x2ec1('0x14')][_0x2ec1('0x15')]===undefined?!![]:![]:!![],'where':_0x41a850[_0x2ec1('0x14')]?_0x41a850[_0x2ec1('0x14')][_0x2ec1('0x16')]||null:null,'attributes':_0x41a850['options']?_0x41a850[_0x2ec1('0x14')][_0x2ec1('0x17')]||null:null,'limit':_0x41a850[_0x2ec1('0x14')]?_0x41a850[_0x2ec1('0x14')]['limit']||null:null,'include':_0x41a850[_0x2ec1('0x14')]?_0x41a850[_0x2ec1('0x14')][_0x2ec1('0x18')]?_[_0x2ec1('0x19')](_0x41a850[_0x2ec1('0x14')]['include'],function(_0x308d7b){return{'model':db[_0x308d7b[_0x2ec1('0x1a')]],'as':_0x308d7b['as'],'attributes':_0x308d7b['attributes'],'include':_0x308d7b[_0x2ec1('0x18')]?_['map'](_0x308d7b[_0x2ec1('0x18')],function(_0x519be1){return{'model':db[_0x519be1['model']],'as':_0x519be1['as'],'attributes':_0x519be1[_0x2ec1('0x17')],'include':_0x519be1[_0x2ec1('0x18')]?_['map'](_0x519be1[_0x2ec1('0x18')],function(_0x20fbaa){return{'model':db[_0x20fbaa[_0x2ec1('0x1a')]],'as':_0x20fbaa['as'],'attributes':_0x20fbaa[_0x2ec1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2ec1('0x8')](function(_0x2236b8){logger[_0x2ec1('0x9')](_0x2ec1('0x12'),_0x41a850);logger[_0x2ec1('0x1b')](_0x2ec1('0x12'),_0x41a850,JSON['stringify'](_0x2236b8));_0x51b4aa(_0x2236b8);})[_0x2ec1('0x11')](function(_0x4a67c){logger[_0x2ec1('0xd')](_0x2ec1('0x12'),_0x4a67c[_0x2ec1('0xf')],_0x41a850);_0x21329b(_0x88c8ae[_0x2ec1('0xd')](0x1f4,_0x4a67c[_0x2ec1('0xf')]));});});};exports[_0x2ec1('0x1c')]=function(_0x405c1f){var _0x2b5f54=this;return new Promise(function(_0x40053a,_0x3f6d85){return db[_0x2ec1('0x1d')][_0x2ec1('0x1e')]({'raw':_0x405c1f[_0x2ec1('0x14')]?_0x405c1f['options'][_0x2ec1('0x15')]===undefined?!![]:![]:!![],'where':_0x405c1f[_0x2ec1('0x14')]?_0x405c1f[_0x2ec1('0x14')][_0x2ec1('0x16')]||null:null,'attributes':_0x405c1f[_0x2ec1('0x14')]?_0x405c1f[_0x2ec1('0x14')]['attributes']||null:null,'include':_0x405c1f[_0x2ec1('0x14')]?_0x405c1f[_0x2ec1('0x14')][_0x2ec1('0x18')]?_[_0x2ec1('0x19')](_0x405c1f['options'][_0x2ec1('0x18')],function(_0x572c73){return{'model':db[_0x572c73['model']],'as':_0x572c73['as'],'attributes':_0x572c73[_0x2ec1('0x17')],'include':_0x572c73[_0x2ec1('0x18')]?_[_0x2ec1('0x19')](_0x572c73['include'],function(_0x1184e8){return{'model':db[_0x1184e8[_0x2ec1('0x1a')]],'as':_0x1184e8['as'],'attributes':_0x1184e8['attributes'],'include':_0x1184e8[_0x2ec1('0x18')]?_[_0x2ec1('0x19')](_0x1184e8[_0x2ec1('0x18')],function(_0x42a920){return{'model':db[_0x42a920['model']],'as':_0x42a920['as'],'attributes':_0x42a920[_0x2ec1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2ec1('0x8')](function(_0x577c3a){logger[_0x2ec1('0x9')](_0x2ec1('0x1c'),_0x405c1f);logger[_0x2ec1('0x1b')](_0x2ec1('0x1c'),_0x405c1f,JSON['stringify'](_0x577c3a));_0x40053a(_0x577c3a);})['catch'](function(_0x202fa6){logger[_0x2ec1('0xd')]('ShowDynamics365Account',_0x202fa6[_0x2ec1('0xf')],_0x405c1f);_0x3f6d85(_0x2b5f54[_0x2ec1('0xd')](0x1f4,_0x202fa6[_0x2ec1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index a2c17a5..159d650 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 _0x8c2d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','/:id','show','get','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x4e1119,_0x32dc78){var _0x35f53d=function(_0x2bbfe0){while(--_0x2bbfe0){_0x4e1119['push'](_0x4e1119['shift']());}};_0x35f53d(++_0x32dc78);}(_0x8c2d,0x1cb));var _0xd8c2=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x8c2d[_0x1e4150];return _0x1ce3ee;};'use strict';var multer=require(_0xd8c2('0x0'));var util=require(_0xd8c2('0x1'));var path=require(_0xd8c2('0x2'));var timeout=require(_0xd8c2('0x3'));var express=require(_0xd8c2('0x4'));var router=express[_0xd8c2('0x5')]();var fs_extra=require(_0xd8c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd8c2('0x7'));var config=require('../../config/environment');var controller=require(_0xd8c2('0x8'));router['get']('/',auth[_0xd8c2('0x9')](),controller[_0xd8c2('0xa')]);router['get'](_0xd8c2('0xb'),auth['isAuthenticated'](),controller[_0xd8c2('0xc')]);router[_0xd8c2('0xd')]('/:id/fields',auth[_0xd8c2('0x9')](),controller[_0xd8c2('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd8c2('0xf')]);router[_0xd8c2('0xd')](_0xd8c2('0x10'),auth[_0xd8c2('0x9')](),controller[_0xd8c2('0x11')]);router[_0xd8c2('0x12')]('/',auth[_0xd8c2('0x9')](),controller[_0xd8c2('0x13')]);router[_0xd8c2('0x14')](_0xd8c2('0xb'),auth['isAuthenticated'](),controller[_0xd8c2('0x15')]);router[_0xd8c2('0x16')](_0xd8c2('0xb'),auth[_0xd8c2('0x9')](),controller[_0xd8c2('0x17')]);module['exports']=router; \ No newline at end of file +var _0x1691=['/:id/fields','getFields','/:id/subjects','getSubjects','post','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','show'];(function(_0x5d0499,_0x276953){var _0x412380=function(_0x35ac90){while(--_0x35ac90){_0x5d0499['push'](_0x5d0499['shift']());}};_0x412380(++_0x276953);}(_0x1691,0x1ed));var _0x1169=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x1691[_0x45806b];return _0x3e228e;};'use strict';var multer=require(_0x1169('0x0'));var util=require(_0x1169('0x1'));var path=require('path');var timeout=require(_0x1169('0x2'));var express=require(_0x1169('0x3'));var router=express[_0x1169('0x4')]();var fs_extra=require(_0x1169('0x5'));var auth=require(_0x1169('0x6'));var interaction=require(_0x1169('0x7'));var config=require(_0x1169('0x8'));var controller=require(_0x1169('0x9'));router['get']('/',auth[_0x1169('0xa')](),controller['index']);router[_0x1169('0xb')]('/:id',auth[_0x1169('0xa')](),controller[_0x1169('0xc')]);router['get'](_0x1169('0xd'),auth[_0x1169('0xa')](),controller[_0x1169('0xe')]);router[_0x1169('0xb')](_0x1169('0xf'),auth['isAuthenticated'](),controller[_0x1169('0x10')]);router[_0x1169('0xb')]('/:id/descriptions',auth[_0x1169('0xa')](),controller['getDescriptions']);router[_0x1169('0x11')]('/',auth[_0x1169('0xa')](),controller['create']);router['put']('/:id',auth[_0x1169('0xa')](),controller['update']);router[_0x1169('0x12')](_0x1169('0x13'),auth['isAuthenticated'](),controller[_0x1169('0x14')]);module[_0x1169('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 28bb6fe..3184095 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 _0x30de=['incident','sequelize','exports','STRING','ENUM','phonecall'];(function(_0x301f45,_0x19841d){var _0x4fd7da=function(_0x4ac0d4){while(--_0x4ac0d4){_0x301f45['push'](_0x301f45['shift']());}};_0x4fd7da(++_0x19841d);}(_0x30de,0x1bd));var _0xe30d=function(_0x182e57,_0x2911e1){_0x182e57=_0x182e57-0x0;var _0x4f331b=_0x30de[_0x182e57];return _0x4f331b;};'use strict';var Sequelize=require(_0xe30d('0x0'));module[_0xe30d('0x1')]={'name':{'type':Sequelize[_0xe30d('0x2')]},'description':{'type':Sequelize[_0xe30d('0x2')]},'ticketType':{'type':Sequelize[_0xe30d('0x3')]('incident',_0xe30d('0x4')),'defaultValue':_0xe30d('0x5')}}; \ No newline at end of file +var _0x26bf=['incident','phonecall','sequelize','STRING','ENUM'];(function(_0x1d4166,_0x42a075){var _0x270079=function(_0x2c4138){while(--_0x2c4138){_0x1d4166['push'](_0x1d4166['shift']());}};_0x270079(++_0x42a075);}(_0x26bf,0x16a));var _0xf26b=function(_0x454c73,_0x50f98e){_0x454c73=_0x454c73-0x0;var _0x247e36=_0x26bf[_0x454c73];return _0x247e36;};'use strict';var Sequelize=require(_0xf26b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf26b('0x1')]},'description':{'type':Sequelize[_0xf26b('0x1')]},'ticketType':{'type':Sequelize[_0xf26b('0x2')](_0xf26b('0x3'),_0xf26b('0x4')),'defaultValue':_0xf26b('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index c2e9564..fe37665 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 _0xc9e0=['attributes','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','length','include','find','create','body','params','getFields','findOne','Dynamics365Field','rawAttributes','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','type','model','keys','query','intersection','fields'];(function(_0x4d36a4,_0x303dd0){var _0x8d4548=function(_0x295887){while(--_0x295887){_0x4d36a4['push'](_0x4d36a4['shift']());}};_0x8d4548(++_0x303dd0);}(_0xc9e0,0xb4));var _0x0c9e=function(_0x41245d,_0x4fbee2){_0x41245d=_0x41245d-0x0;var _0x3e6f5c=_0xc9e0[_0x41245d];return _0x3e6f5c;};'use strict';var emlformat=require(_0x0c9e('0x0'));var rimraf=require(_0x0c9e('0x1'));var zipdir=require(_0x0c9e('0x2'));var jsonpatch=require(_0x0c9e('0x3'));var rp=require('request-promise');var moment=require(_0x0c9e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0c9e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0c9e('0x6'));var crypto=require(_0x0c9e('0x7'));var jsforce=require(_0x0c9e('0x8'));var deskjs=require(_0x0c9e('0x9'));var toCsv=require(_0x0c9e('0xa'));var querystring=require(_0x0c9e('0xb'));var Papa=require('papaparse');var Redis=require(_0x0c9e('0xc'));var authService=require(_0x0c9e('0xd'));var qs=require(_0x0c9e('0xe'));var as=require(_0x0c9e('0xf'));var hardwareService=require(_0x0c9e('0x10'));var logger=require(_0x0c9e('0x11'))(_0x0c9e('0x12'));var utils=require(_0x0c9e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c9e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23374c,_0x7118ca){_0x7118ca=_0x7118ca||0xcc;return function(_0x330929){if(_0x330929){return _0x23374c[_0x0c9e('0x15')](_0x7118ca);}return _0x23374c[_0x0c9e('0x16')](_0x7118ca)[_0x0c9e('0x17')]();};}function respondWithResult(_0x3fa2e4,_0x2fbf5c){_0x2fbf5c=_0x2fbf5c||0xc8;return function(_0x479c7a){if(_0x479c7a){return _0x3fa2e4['status'](_0x2fbf5c)[_0x0c9e('0x18')](_0x479c7a);}};}function respondWithFilteredResult(_0x87630f,_0x330fe2){return function(_0x50c67a){if(_0x50c67a){var _0x4ee66e=typeof _0x330fe2['offset']===_0x0c9e('0x19')&&typeof _0x330fe2[_0x0c9e('0x1a')]===_0x0c9e('0x19');var _0x12abbf=_0x50c67a[_0x0c9e('0x1b')];var _0x227207=_0x4ee66e?0x0:_0x330fe2[_0x0c9e('0x1c')];var _0x5810bf=_0x4ee66e?_0x50c67a[_0x0c9e('0x1b')]:_0x330fe2[_0x0c9e('0x1c')]+_0x330fe2[_0x0c9e('0x1a')];var _0x5ba8da;if(_0x5810bf>=_0x12abbf){_0x5810bf=_0x12abbf;_0x5ba8da=0xc8;}else{_0x5ba8da=0xce;}_0x87630f[_0x0c9e('0x16')](_0x5ba8da);return _0x87630f[_0x0c9e('0x1d')](_0x0c9e('0x1e'),_0x227207+'-'+_0x5810bf+'/'+_0x12abbf)[_0x0c9e('0x18')](_0x50c67a);}return null;};}function patchUpdates(_0x111b83){return function(_0x127abb){try{jsonpatch[_0x0c9e('0x1f')](_0x127abb,_0x111b83,!![]);}catch(_0x69560f){return BPromise['reject'](_0x69560f);}return _0x127abb[_0x0c9e('0x20')]();};}function saveUpdates(_0x5037a7,_0x2abc4e){return function(_0x362190){if(_0x362190){return _0x362190[_0x0c9e('0x21')](_0x5037a7)[_0x0c9e('0x22')](function(_0x1708ed){return _0x1708ed;});}return null;};}function removeEntity(_0x8f0b59,_0x5e7f0a){return function(_0x185e70){if(_0x185e70){return _0x185e70[_0x0c9e('0x23')]()[_0x0c9e('0x22')](function(){_0x8f0b59[_0x0c9e('0x16')](0xcc)[_0x0c9e('0x17')]();});}};}function handleEntityNotFound(_0x5dd55d,_0x17ad4b){return function(_0x3256d4){if(!_0x3256d4){_0x5dd55d[_0x0c9e('0x15')](0x194);}return _0x3256d4;};}function handleError(_0x1a05c1,_0xbd4234){_0xbd4234=_0xbd4234||0x1f4;return function(_0x41ec38){logger[_0x0c9e('0x24')](_0x41ec38['stack']);if(_0x41ec38[_0x0c9e('0x25')]){delete _0x41ec38[_0x0c9e('0x25')];}_0x1a05c1[_0x0c9e('0x16')](_0xbd4234)[_0x0c9e('0x26')](_0x41ec38);};}exports[_0x0c9e('0x27')]=function(_0x26ea2f,_0x54f591){var _0xe60912={},_0x49ec8a={},_0x217f23={'count':0x0,'rows':[]};var _0x599f2f=_[_0x0c9e('0x28')](db[_0x0c9e('0x29')]['rawAttributes'],function(_0x1cf11f){return{'name':_0x1cf11f['fieldName'],'type':_0x1cf11f[_0x0c9e('0x2a')]['key']};});_0x49ec8a[_0x0c9e('0x2b')]=_[_0x0c9e('0x28')](_0x599f2f,_0x0c9e('0x25'));_0x49ec8a['query']=_[_0x0c9e('0x2c')](_0x26ea2f[_0x0c9e('0x2d')]);_0x49ec8a['filters']=_['intersection'](_0x49ec8a['model'],_0x49ec8a['query']);_0xe60912['attributes']=_[_0x0c9e('0x2e')](_0x49ec8a[_0x0c9e('0x2b')],qs[_0x0c9e('0x2f')](_0x26ea2f[_0x0c9e('0x2d')][_0x0c9e('0x2f')]));_0xe60912[_0x0c9e('0x30')]=_0xe60912['attributes']['length']?_0xe60912[_0x0c9e('0x30')]:_0x49ec8a[_0x0c9e('0x2b')];if(!_0x26ea2f[_0x0c9e('0x2d')][_0x0c9e('0x31')]('nolimit')){_0xe60912[_0x0c9e('0x1a')]=qs[_0x0c9e('0x1a')](_0x26ea2f[_0x0c9e('0x2d')][_0x0c9e('0x1a')]);_0xe60912['offset']=qs[_0x0c9e('0x1c')](_0x26ea2f[_0x0c9e('0x2d')][_0x0c9e('0x1c')]);}_0xe60912[_0x0c9e('0x32')]=qs[_0x0c9e('0x33')](_0x26ea2f['query'][_0x0c9e('0x33')]);_0xe60912[_0x0c9e('0x34')]=qs[_0x0c9e('0x35')](_[_0x0c9e('0x36')](_0x26ea2f[_0x0c9e('0x2d')],_0x49ec8a[_0x0c9e('0x35')]),_0x599f2f);if(_0x26ea2f[_0x0c9e('0x2d')][_0x0c9e('0x37')]){_0xe60912['where']=_['merge'](_0xe60912[_0x0c9e('0x34')],{'$or':_[_0x0c9e('0x28')](_0x599f2f,function(_0x410775){if(_0x410775['type']!==_0x0c9e('0x38')){var _0x338c1b={};_0x338c1b[_0x410775[_0x0c9e('0x25')]]={'$like':'%'+_0x26ea2f[_0x0c9e('0x2d')]['filter']+'%'};return _0x338c1b;}})});}_0xe60912=_[_0x0c9e('0x39')]({},_0xe60912,_0x26ea2f[_0x0c9e('0x3a')]);var _0x2d1c00={'where':_0xe60912[_0x0c9e('0x34')]};return db['Dynamics365Configuration'][_0x0c9e('0x1b')](_0x2d1c00)['then'](function(_0x3a7e86){_0x217f23[_0x0c9e('0x1b')]=_0x3a7e86;if(_0x26ea2f['query'][_0x0c9e('0x3b')]){_0xe60912['include']=[{'all':!![]}];}return db[_0x0c9e('0x29')][_0x0c9e('0x3c')](_0xe60912);})['then'](function(_0x52d81c){_0x217f23[_0x0c9e('0x3d')]=_0x52d81c;return _0x217f23;})[_0x0c9e('0x22')](respondWithFilteredResult(_0x54f591,_0xe60912))[_0x0c9e('0x3e')](handleError(_0x54f591,null));};exports['show']=function(_0x398473,_0x2ec8ba){var _0x54c00c={'raw':![],'where':{'id':_0x398473['params']['id']}},_0x449f34={};_0x449f34[_0x0c9e('0x2b')]=_[_0x0c9e('0x2c')](db[_0x0c9e('0x29')]['rawAttributes']);_0x449f34[_0x0c9e('0x2d')]=_[_0x0c9e('0x2c')](_0x398473[_0x0c9e('0x2d')]);_0x449f34['filters']=_[_0x0c9e('0x2e')](_0x449f34[_0x0c9e('0x2b')],_0x449f34[_0x0c9e('0x2d')]);_0x54c00c[_0x0c9e('0x30')]=_[_0x0c9e('0x2e')](_0x449f34['model'],qs[_0x0c9e('0x2f')](_0x398473[_0x0c9e('0x2d')]['fields']));_0x54c00c['attributes']=_0x54c00c[_0x0c9e('0x30')][_0x0c9e('0x3f')]?_0x54c00c[_0x0c9e('0x30')]:_0x449f34['model'];if(_0x398473[_0x0c9e('0x2d')][_0x0c9e('0x3b')]){_0x54c00c[_0x0c9e('0x40')]=[{'all':!![]}];}_0x54c00c=_[_0x0c9e('0x39')]({},_0x54c00c,_0x398473[_0x0c9e('0x3a')]);return db[_0x0c9e('0x29')][_0x0c9e('0x41')](_0x54c00c)[_0x0c9e('0x22')](handleEntityNotFound(_0x2ec8ba,null))[_0x0c9e('0x22')](respondWithResult(_0x2ec8ba,null))[_0x0c9e('0x3e')](handleError(_0x2ec8ba,null));};exports['create']=function(_0x4b2894,_0x4becfc){return db[_0x0c9e('0x29')][_0x0c9e('0x42')](_0x4b2894[_0x0c9e('0x43')],{})[_0x0c9e('0x22')](respondWithResult(_0x4becfc,0xc9))[_0x0c9e('0x3e')](handleError(_0x4becfc,null));};exports[_0x0c9e('0x21')]=function(_0x2e9b8c,_0x3861d9){if(_0x2e9b8c[_0x0c9e('0x43')]['id']){delete _0x2e9b8c['body']['id'];}return db[_0x0c9e('0x29')][_0x0c9e('0x41')]({'where':{'id':_0x2e9b8c[_0x0c9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3861d9,null))['then'](saveUpdates(_0x2e9b8c[_0x0c9e('0x43')],null))[_0x0c9e('0x22')](respondWithResult(_0x3861d9,null))[_0x0c9e('0x3e')](handleError(_0x3861d9,null));};exports['destroy']=function(_0x237148,_0x47d161){return db[_0x0c9e('0x29')]['find']({'where':{'id':_0x237148['params']['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x47d161,null))['then'](removeEntity(_0x47d161,null))['catch'](handleError(_0x47d161,null));};exports[_0x0c9e('0x45')]=function(_0x3397e1,_0x3ab6df,_0x130b35){var _0x4ce55b={};var _0xc83305={};var _0x10994e;var _0x23caee;return db[_0x0c9e('0x29')][_0x0c9e('0x46')]({'where':{'id':_0x3397e1['params']['id']}})['then'](handleEntityNotFound(_0x3ab6df,null))[_0x0c9e('0x22')](function(_0x1386bd){if(_0x1386bd){_0x10994e=_0x1386bd;_0xc83305['model']=_[_0x0c9e('0x2c')](db[_0x0c9e('0x47')][_0x0c9e('0x48')]);_0xc83305[_0x0c9e('0x2d')]=_[_0x0c9e('0x2c')](_0x3397e1['query']);_0xc83305['filters']=_[_0x0c9e('0x2e')](_0xc83305['model'],_0xc83305[_0x0c9e('0x2d')]);_0x4ce55b[_0x0c9e('0x30')]=_[_0x0c9e('0x2e')](_0xc83305[_0x0c9e('0x2b')],qs[_0x0c9e('0x2f')](_0x3397e1['query'][_0x0c9e('0x2f')]));_0x4ce55b[_0x0c9e('0x30')]=_0x4ce55b[_0x0c9e('0x30')][_0x0c9e('0x3f')]?_0x4ce55b['attributes']:_0xc83305[_0x0c9e('0x2b')];_0x4ce55b[_0x0c9e('0x32')]=qs[_0x0c9e('0x33')](_0x3397e1[_0x0c9e('0x2d')][_0x0c9e('0x33')]);_0x4ce55b['where']=qs[_0x0c9e('0x35')](_[_0x0c9e('0x36')](_0x3397e1[_0x0c9e('0x2d')],_0xc83305[_0x0c9e('0x35')]));if(_0x3397e1[_0x0c9e('0x2d')]['filter']){_0x4ce55b[_0x0c9e('0x34')]=_[_0x0c9e('0x39')](_0x4ce55b[_0x0c9e('0x34')],{'$or':_[_0x0c9e('0x28')](_0x4ce55b[_0x0c9e('0x30')],function(_0x1a7bea){var _0x28064c={};_0x28064c[_0x1a7bea]={'$like':'%'+_0x3397e1['query'][_0x0c9e('0x37')]+'%'};return _0x28064c;})});}_0x4ce55b=_[_0x0c9e('0x39')]({},_0x4ce55b,_0x3397e1[_0x0c9e('0x3a')]);return _0x10994e[_0x0c9e('0x45')](_0x4ce55b);}})[_0x0c9e('0x22')](function(_0x54888d){if(_0x54888d){_0x23caee=_0x54888d[_0x0c9e('0x3f')];if(!_0x3397e1[_0x0c9e('0x2d')][_0x0c9e('0x31')](_0x0c9e('0x49'))){_0x4ce55b[_0x0c9e('0x1a')]=qs['limit'](_0x3397e1[_0x0c9e('0x2d')]['limit']);_0x4ce55b[_0x0c9e('0x1c')]=qs['offset'](_0x3397e1['query'][_0x0c9e('0x1c')]);}return _0x10994e[_0x0c9e('0x45')](_0x4ce55b);}})[_0x0c9e('0x22')](function(_0x1f011c){if(_0x1f011c){return _0x1f011c?{'count':_0x23caee,'rows':_0x1f011c}:null;}})[_0x0c9e('0x22')](respondWithResult(_0x3ab6df,null))['catch'](handleError(_0x3ab6df,null));};exports[_0x0c9e('0x4a')]=function(_0x11cd07,_0xc4c579,_0x33af7b){var _0x5f2eff={};var _0x263454={};var _0x19d7c9;var _0x4c5fe0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x11cd07[_0x0c9e('0x44')]['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0xc4c579,null))[_0x0c9e('0x22')](function(_0x3f1a21){if(_0x3f1a21){_0x19d7c9=_0x3f1a21;_0x263454[_0x0c9e('0x2b')]=_[_0x0c9e('0x2c')](db['Dynamics365Field'][_0x0c9e('0x48')]);_0x263454[_0x0c9e('0x2d')]=_[_0x0c9e('0x2c')](_0x11cd07[_0x0c9e('0x2d')]);_0x263454['filters']=_[_0x0c9e('0x2e')](_0x263454[_0x0c9e('0x2b')],_0x263454['query']);_0x5f2eff[_0x0c9e('0x30')]=_[_0x0c9e('0x2e')](_0x263454['model'],qs[_0x0c9e('0x2f')](_0x11cd07[_0x0c9e('0x2d')][_0x0c9e('0x2f')]));_0x5f2eff[_0x0c9e('0x30')]=_0x5f2eff[_0x0c9e('0x30')][_0x0c9e('0x3f')]?_0x5f2eff[_0x0c9e('0x30')]:_0x263454[_0x0c9e('0x2b')];_0x5f2eff[_0x0c9e('0x32')]=qs['sort'](_0x11cd07['query'][_0x0c9e('0x33')]);_0x5f2eff[_0x0c9e('0x34')]=qs[_0x0c9e('0x35')](_[_0x0c9e('0x36')](_0x11cd07[_0x0c9e('0x2d')],_0x263454[_0x0c9e('0x35')]));if(_0x11cd07[_0x0c9e('0x2d')][_0x0c9e('0x37')]){_0x5f2eff[_0x0c9e('0x34')]=_[_0x0c9e('0x39')](_0x5f2eff['where'],{'$or':_[_0x0c9e('0x28')](_0x5f2eff[_0x0c9e('0x30')],function(_0x46dd73){var _0xe2b479={};_0xe2b479[_0x46dd73]={'$like':'%'+_0x11cd07[_0x0c9e('0x2d')][_0x0c9e('0x37')]+'%'};return _0xe2b479;})});}_0x5f2eff=_[_0x0c9e('0x39')]({},_0x5f2eff,_0x11cd07['options']);return _0x19d7c9['getSubjects'](_0x5f2eff);}})[_0x0c9e('0x22')](function(_0x230f11){if(_0x230f11){_0x4c5fe0=_0x230f11[_0x0c9e('0x3f')];if(!_0x11cd07[_0x0c9e('0x2d')]['hasOwnProperty']('nolimit')){_0x5f2eff[_0x0c9e('0x1a')]=qs['limit'](_0x11cd07[_0x0c9e('0x2d')][_0x0c9e('0x1a')]);_0x5f2eff[_0x0c9e('0x1c')]=qs[_0x0c9e('0x1c')](_0x11cd07['query'][_0x0c9e('0x1c')]);}return _0x19d7c9[_0x0c9e('0x4a')](_0x5f2eff);}})[_0x0c9e('0x22')](function(_0x1765ad){if(_0x1765ad){return _0x1765ad?{'count':_0x4c5fe0,'rows':_0x1765ad}:null;}})[_0x0c9e('0x22')](respondWithResult(_0xc4c579,null))[_0x0c9e('0x3e')](handleError(_0xc4c579,null));};exports[_0x0c9e('0x4b')]=function(_0x5371be,_0x510ac6,_0x52e2cb){var _0x2d4a18={};var _0x293faf={};var _0x1bb558;var _0x43a0b8;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5371be[_0x0c9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x510ac6,null))['then'](function(_0x53d17d){if(_0x53d17d){_0x1bb558=_0x53d17d;_0x293faf[_0x0c9e('0x2b')]=_[_0x0c9e('0x2c')](db[_0x0c9e('0x47')][_0x0c9e('0x48')]);_0x293faf['query']=_[_0x0c9e('0x2c')](_0x5371be['query']);_0x293faf[_0x0c9e('0x35')]=_[_0x0c9e('0x2e')](_0x293faf[_0x0c9e('0x2b')],_0x293faf[_0x0c9e('0x2d')]);_0x2d4a18['attributes']=_['intersection'](_0x293faf[_0x0c9e('0x2b')],qs[_0x0c9e('0x2f')](_0x5371be['query'][_0x0c9e('0x2f')]));_0x2d4a18['attributes']=_0x2d4a18['attributes']['length']?_0x2d4a18['attributes']:_0x293faf[_0x0c9e('0x2b')];_0x2d4a18[_0x0c9e('0x32')]=qs[_0x0c9e('0x33')](_0x5371be['query'][_0x0c9e('0x33')]);_0x2d4a18[_0x0c9e('0x34')]=qs[_0x0c9e('0x35')](_[_0x0c9e('0x36')](_0x5371be[_0x0c9e('0x2d')],_0x293faf[_0x0c9e('0x35')]));if(_0x5371be[_0x0c9e('0x2d')]['filter']){_0x2d4a18[_0x0c9e('0x34')]=_[_0x0c9e('0x39')](_0x2d4a18[_0x0c9e('0x34')],{'$or':_['map'](_0x2d4a18[_0x0c9e('0x30')],function(_0x550093){var _0x20c9e8={};_0x20c9e8[_0x550093]={'$like':'%'+_0x5371be[_0x0c9e('0x2d')][_0x0c9e('0x37')]+'%'};return _0x20c9e8;})});}_0x2d4a18=_['merge']({},_0x2d4a18,_0x5371be[_0x0c9e('0x3a')]);return _0x1bb558['getDescriptions'](_0x2d4a18);}})[_0x0c9e('0x22')](function(_0x124636){if(_0x124636){_0x43a0b8=_0x124636[_0x0c9e('0x3f')];if(!_0x5371be[_0x0c9e('0x2d')][_0x0c9e('0x31')](_0x0c9e('0x49'))){_0x2d4a18['limit']=qs[_0x0c9e('0x1a')](_0x5371be[_0x0c9e('0x2d')]['limit']);_0x2d4a18[_0x0c9e('0x1c')]=qs['offset'](_0x5371be[_0x0c9e('0x2d')][_0x0c9e('0x1c')]);}return _0x1bb558[_0x0c9e('0x4b')](_0x2d4a18);}})[_0x0c9e('0x22')](function(_0x92a2d1){if(_0x92a2d1){return _0x92a2d1?{'count':_0x43a0b8,'rows':_0x92a2d1}:null;}})['then'](respondWithResult(_0x510ac6,null))[_0x0c9e('0x3e')](handleError(_0x510ac6,null));}; \ No newline at end of file +var _0x5b03=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','Dynamics365Configuration','count','includeAll','include','findAll','catch','show','params','length','options','find','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment'];(function(_0x153c96,_0x40884d){var _0x570050=function(_0x16a452){while(--_0x16a452){_0x153c96['push'](_0x153c96['shift']());}};_0x570050(++_0x40884d);}(_0x5b03,0x134));var _0x35b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b03[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35b0('0x0'));var zipdir=require(_0x35b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35b0('0x2'));var moment=require(_0x35b0('0x3'));var BPromise=require(_0x35b0('0x4'));var Mustache=require(_0x35b0('0x5'));var util=require(_0x35b0('0x6'));var path=require('path');var sox=require(_0x35b0('0x7'));var csv=require(_0x35b0('0x8'));var ejs=require(_0x35b0('0x9'));var fs=require('fs');var fs_extra=require(_0x35b0('0xa'));var _=require(_0x35b0('0xb'));var squel=require(_0x35b0('0xc'));var crypto=require(_0x35b0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x35b0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35b0('0xf'));var Redis=require(_0x35b0('0x10'));var authService=require(_0x35b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x35b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35b0('0x13'))(_0x35b0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35b0('0x15'))['db'];function respondWithStatusCode(_0x1b18e3,_0x30b0b4){_0x30b0b4=_0x30b0b4||0xcc;return function(_0x370619){if(_0x370619){return _0x1b18e3['sendStatus'](_0x30b0b4);}return _0x1b18e3[_0x35b0('0x16')](_0x30b0b4)['end']();};}function respondWithResult(_0x14c906,_0x57b496){_0x57b496=_0x57b496||0xc8;return function(_0x4d606c){if(_0x4d606c){return _0x14c906['status'](_0x57b496)[_0x35b0('0x17')](_0x4d606c);}};}function respondWithFilteredResult(_0x25d58d,_0x2a3217){return function(_0x18f26){if(_0x18f26){var _0x124931=typeof _0x2a3217[_0x35b0('0x18')]===_0x35b0('0x19')&&typeof _0x2a3217['limit']==='undefined';var _0x2fb2f4=_0x18f26['count'];var _0x73d784=_0x124931?0x0:_0x2a3217[_0x35b0('0x18')];var _0x261574=_0x124931?_0x18f26['count']:_0x2a3217[_0x35b0('0x18')]+_0x2a3217[_0x35b0('0x1a')];var _0x1ed4ac;if(_0x261574>=_0x2fb2f4){_0x261574=_0x2fb2f4;_0x1ed4ac=0xc8;}else{_0x1ed4ac=0xce;}_0x25d58d[_0x35b0('0x16')](_0x1ed4ac);return _0x25d58d[_0x35b0('0x1b')]('Content-Range',_0x73d784+'-'+_0x261574+'/'+_0x2fb2f4)['json'](_0x18f26);}return null;};}function patchUpdates(_0x55eacc){return function(_0x24b728){try{jsonpatch[_0x35b0('0x1c')](_0x24b728,_0x55eacc,!![]);}catch(_0x3135d4){return BPromise[_0x35b0('0x1d')](_0x3135d4);}return _0x24b728['save']();};}function saveUpdates(_0x34920a,_0x1ca4d8){return function(_0x29155e){if(_0x29155e){return _0x29155e[_0x35b0('0x1e')](_0x34920a)['then'](function(_0x177f0f){return _0x177f0f;});}return null;};}function removeEntity(_0x40cc0c,_0x835dd0){return function(_0x5cd41b){if(_0x5cd41b){return _0x5cd41b[_0x35b0('0x1f')]()[_0x35b0('0x20')](function(){_0x40cc0c[_0x35b0('0x16')](0xcc)[_0x35b0('0x21')]();});}};}function handleEntityNotFound(_0x3bbdd4,_0x45a7fc){return function(_0x5b7661){if(!_0x5b7661){_0x3bbdd4[_0x35b0('0x22')](0x194);}return _0x5b7661;};}function handleError(_0x1017c8,_0x20408e){_0x20408e=_0x20408e||0x1f4;return function(_0x1a4671){logger[_0x35b0('0x23')](_0x1a4671[_0x35b0('0x24')]);if(_0x1a4671[_0x35b0('0x25')]){delete _0x1a4671['name'];}_0x1017c8[_0x35b0('0x16')](_0x20408e)[_0x35b0('0x26')](_0x1a4671);};}exports[_0x35b0('0x27')]=function(_0x2a42ba,_0x3bcf9f){var _0x254e25={},_0xd8c30c={},_0x50cc91={'count':0x0,'rows':[]};var _0x114c0e=_[_0x35b0('0x28')](db['Dynamics365Configuration'][_0x35b0('0x29')],function(_0x42b19b){return{'name':_0x42b19b[_0x35b0('0x2a')],'type':_0x42b19b[_0x35b0('0x2b')][_0x35b0('0x2c')]};});_0xd8c30c[_0x35b0('0x2d')]=_[_0x35b0('0x28')](_0x114c0e,_0x35b0('0x25'));_0xd8c30c[_0x35b0('0x2e')]=_[_0x35b0('0x2f')](_0x2a42ba['query']);_0xd8c30c['filters']=_[_0x35b0('0x30')](_0xd8c30c[_0x35b0('0x2d')],_0xd8c30c['query']);_0x254e25[_0x35b0('0x31')]=_[_0x35b0('0x30')](_0xd8c30c[_0x35b0('0x2d')],qs[_0x35b0('0x32')](_0x2a42ba[_0x35b0('0x2e')]['fields']));_0x254e25[_0x35b0('0x31')]=_0x254e25[_0x35b0('0x31')]['length']?_0x254e25[_0x35b0('0x31')]:_0xd8c30c['model'];if(!_0x2a42ba[_0x35b0('0x2e')][_0x35b0('0x33')](_0x35b0('0x34'))){_0x254e25['limit']=qs[_0x35b0('0x1a')](_0x2a42ba['query'][_0x35b0('0x1a')]);_0x254e25[_0x35b0('0x18')]=qs[_0x35b0('0x18')](_0x2a42ba[_0x35b0('0x2e')][_0x35b0('0x18')]);}_0x254e25[_0x35b0('0x35')]=qs[_0x35b0('0x36')](_0x2a42ba['query'][_0x35b0('0x36')]);_0x254e25['where']=qs['filters'](_[_0x35b0('0x37')](_0x2a42ba[_0x35b0('0x2e')],_0xd8c30c[_0x35b0('0x38')]),_0x114c0e);if(_0x2a42ba['query'][_0x35b0('0x39')]){_0x254e25[_0x35b0('0x3a')]=_[_0x35b0('0x3b')](_0x254e25[_0x35b0('0x3a')],{'$or':_['map'](_0x114c0e,function(_0x285840){if(_0x285840[_0x35b0('0x2b')]!==_0x35b0('0x3c')){var _0x56294c={};_0x56294c[_0x285840[_0x35b0('0x25')]]={'$like':'%'+_0x2a42ba['query'][_0x35b0('0x39')]+'%'};return _0x56294c;}})});}_0x254e25=_[_0x35b0('0x3b')]({},_0x254e25,_0x2a42ba['options']);var _0x3996bf={'where':_0x254e25['where']};return db[_0x35b0('0x3d')][_0x35b0('0x3e')](_0x3996bf)[_0x35b0('0x20')](function(_0x2b31dc){_0x50cc91[_0x35b0('0x3e')]=_0x2b31dc;if(_0x2a42ba[_0x35b0('0x2e')][_0x35b0('0x3f')]){_0x254e25[_0x35b0('0x40')]=[{'all':!![]}];}return db[_0x35b0('0x3d')][_0x35b0('0x41')](_0x254e25);})['then'](function(_0x1474df){_0x50cc91['rows']=_0x1474df;return _0x50cc91;})[_0x35b0('0x20')](respondWithFilteredResult(_0x3bcf9f,_0x254e25))[_0x35b0('0x42')](handleError(_0x3bcf9f,null));};exports[_0x35b0('0x43')]=function(_0x3fb6f2,_0x22e8c1){var _0x5d06d5={'raw':![],'where':{'id':_0x3fb6f2[_0x35b0('0x44')]['id']}},_0xbbd1f5={};_0xbbd1f5[_0x35b0('0x2d')]=_['keys'](db[_0x35b0('0x3d')][_0x35b0('0x29')]);_0xbbd1f5[_0x35b0('0x2e')]=_[_0x35b0('0x2f')](_0x3fb6f2['query']);_0xbbd1f5[_0x35b0('0x38')]=_[_0x35b0('0x30')](_0xbbd1f5[_0x35b0('0x2d')],_0xbbd1f5['query']);_0x5d06d5[_0x35b0('0x31')]=_[_0x35b0('0x30')](_0xbbd1f5[_0x35b0('0x2d')],qs[_0x35b0('0x32')](_0x3fb6f2[_0x35b0('0x2e')][_0x35b0('0x32')]));_0x5d06d5[_0x35b0('0x31')]=_0x5d06d5['attributes'][_0x35b0('0x45')]?_0x5d06d5['attributes']:_0xbbd1f5[_0x35b0('0x2d')];if(_0x3fb6f2['query'][_0x35b0('0x3f')]){_0x5d06d5['include']=[{'all':!![]}];}_0x5d06d5=_[_0x35b0('0x3b')]({},_0x5d06d5,_0x3fb6f2[_0x35b0('0x46')]);return db[_0x35b0('0x3d')][_0x35b0('0x47')](_0x5d06d5)['then'](handleEntityNotFound(_0x22e8c1,null))[_0x35b0('0x20')](respondWithResult(_0x22e8c1,null))[_0x35b0('0x42')](handleError(_0x22e8c1,null));};exports['create']=function(_0x37a947,_0x5a958d){return db[_0x35b0('0x3d')]['create'](_0x37a947[_0x35b0('0x48')],{})[_0x35b0('0x20')](respondWithResult(_0x5a958d,0xc9))[_0x35b0('0x42')](handleError(_0x5a958d,null));};exports[_0x35b0('0x1e')]=function(_0x298c62,_0x5d415b){if(_0x298c62[_0x35b0('0x48')]['id']){delete _0x298c62[_0x35b0('0x48')]['id'];}return db[_0x35b0('0x3d')]['find']({'where':{'id':_0x298c62[_0x35b0('0x44')]['id']}})[_0x35b0('0x20')](handleEntityNotFound(_0x5d415b,null))['then'](saveUpdates(_0x298c62[_0x35b0('0x48')],null))[_0x35b0('0x20')](respondWithResult(_0x5d415b,null))[_0x35b0('0x42')](handleError(_0x5d415b,null));};exports[_0x35b0('0x1f')]=function(_0x329e37,_0x384e29){return db['Dynamics365Configuration'][_0x35b0('0x47')]({'where':{'id':_0x329e37[_0x35b0('0x44')]['id']}})[_0x35b0('0x20')](handleEntityNotFound(_0x384e29,null))['then'](removeEntity(_0x384e29,null))[_0x35b0('0x42')](handleError(_0x384e29,null));};exports[_0x35b0('0x49')]=function(_0x352287,_0xf48df6,_0x41895a){var _0x2e54a2={};var _0x183f15={};var _0x303d44;var _0x205544;return db[_0x35b0('0x3d')][_0x35b0('0x4a')]({'where':{'id':_0x352287['params']['id']}})[_0x35b0('0x20')](handleEntityNotFound(_0xf48df6,null))[_0x35b0('0x20')](function(_0x579d72){if(_0x579d72){_0x303d44=_0x579d72;_0x183f15[_0x35b0('0x2d')]=_[_0x35b0('0x2f')](db[_0x35b0('0x4b')][_0x35b0('0x29')]);_0x183f15[_0x35b0('0x2e')]=_[_0x35b0('0x2f')](_0x352287[_0x35b0('0x2e')]);_0x183f15[_0x35b0('0x38')]=_[_0x35b0('0x30')](_0x183f15[_0x35b0('0x2d')],_0x183f15[_0x35b0('0x2e')]);_0x2e54a2[_0x35b0('0x31')]=_[_0x35b0('0x30')](_0x183f15[_0x35b0('0x2d')],qs[_0x35b0('0x32')](_0x352287['query']['fields']));_0x2e54a2[_0x35b0('0x31')]=_0x2e54a2[_0x35b0('0x31')][_0x35b0('0x45')]?_0x2e54a2[_0x35b0('0x31')]:_0x183f15[_0x35b0('0x2d')];_0x2e54a2[_0x35b0('0x35')]=qs[_0x35b0('0x36')](_0x352287['query'][_0x35b0('0x36')]);_0x2e54a2[_0x35b0('0x3a')]=qs[_0x35b0('0x38')](_[_0x35b0('0x37')](_0x352287[_0x35b0('0x2e')],_0x183f15[_0x35b0('0x38')]));if(_0x352287[_0x35b0('0x2e')][_0x35b0('0x39')]){_0x2e54a2['where']=_[_0x35b0('0x3b')](_0x2e54a2[_0x35b0('0x3a')],{'$or':_[_0x35b0('0x28')](_0x2e54a2[_0x35b0('0x31')],function(_0x36dc21){var _0x3657e8={};_0x3657e8[_0x36dc21]={'$like':'%'+_0x352287[_0x35b0('0x2e')][_0x35b0('0x39')]+'%'};return _0x3657e8;})});}_0x2e54a2=_[_0x35b0('0x3b')]({},_0x2e54a2,_0x352287[_0x35b0('0x46')]);return _0x303d44[_0x35b0('0x49')](_0x2e54a2);}})[_0x35b0('0x20')](function(_0x318f66){if(_0x318f66){_0x205544=_0x318f66[_0x35b0('0x45')];if(!_0x352287[_0x35b0('0x2e')]['hasOwnProperty'](_0x35b0('0x34'))){_0x2e54a2[_0x35b0('0x1a')]=qs[_0x35b0('0x1a')](_0x352287[_0x35b0('0x2e')][_0x35b0('0x1a')]);_0x2e54a2[_0x35b0('0x18')]=qs[_0x35b0('0x18')](_0x352287['query'][_0x35b0('0x18')]);}return _0x303d44[_0x35b0('0x49')](_0x2e54a2);}})[_0x35b0('0x20')](function(_0x2270ec){if(_0x2270ec){return _0x2270ec?{'count':_0x205544,'rows':_0x2270ec}:null;}})[_0x35b0('0x20')](respondWithResult(_0xf48df6,null))[_0x35b0('0x42')](handleError(_0xf48df6,null));};exports[_0x35b0('0x4c')]=function(_0xa62285,_0x26e134,_0xb63391){var _0x4d8dc6={};var _0xe72417={};var _0x114652;var _0x3778e7;return db[_0x35b0('0x3d')]['findOne']({'where':{'id':_0xa62285['params']['id']}})[_0x35b0('0x20')](handleEntityNotFound(_0x26e134,null))[_0x35b0('0x20')](function(_0x23f720){if(_0x23f720){_0x114652=_0x23f720;_0xe72417[_0x35b0('0x2d')]=_[_0x35b0('0x2f')](db['Dynamics365Field'][_0x35b0('0x29')]);_0xe72417[_0x35b0('0x2e')]=_['keys'](_0xa62285[_0x35b0('0x2e')]);_0xe72417[_0x35b0('0x38')]=_[_0x35b0('0x30')](_0xe72417[_0x35b0('0x2d')],_0xe72417[_0x35b0('0x2e')]);_0x4d8dc6['attributes']=_[_0x35b0('0x30')](_0xe72417['model'],qs['fields'](_0xa62285[_0x35b0('0x2e')][_0x35b0('0x32')]));_0x4d8dc6[_0x35b0('0x31')]=_0x4d8dc6['attributes'][_0x35b0('0x45')]?_0x4d8dc6['attributes']:_0xe72417[_0x35b0('0x2d')];_0x4d8dc6[_0x35b0('0x35')]=qs[_0x35b0('0x36')](_0xa62285[_0x35b0('0x2e')][_0x35b0('0x36')]);_0x4d8dc6[_0x35b0('0x3a')]=qs[_0x35b0('0x38')](_[_0x35b0('0x37')](_0xa62285[_0x35b0('0x2e')],_0xe72417[_0x35b0('0x38')]));if(_0xa62285['query']['filter']){_0x4d8dc6[_0x35b0('0x3a')]=_[_0x35b0('0x3b')](_0x4d8dc6['where'],{'$or':_['map'](_0x4d8dc6['attributes'],function(_0x3b198b){var _0x1f3fc9={};_0x1f3fc9[_0x3b198b]={'$like':'%'+_0xa62285[_0x35b0('0x2e')]['filter']+'%'};return _0x1f3fc9;})});}_0x4d8dc6=_[_0x35b0('0x3b')]({},_0x4d8dc6,_0xa62285[_0x35b0('0x46')]);return _0x114652[_0x35b0('0x4c')](_0x4d8dc6);}})[_0x35b0('0x20')](function(_0xc9017c){if(_0xc9017c){_0x3778e7=_0xc9017c[_0x35b0('0x45')];if(!_0xa62285['query']['hasOwnProperty'](_0x35b0('0x34'))){_0x4d8dc6[_0x35b0('0x1a')]=qs['limit'](_0xa62285[_0x35b0('0x2e')][_0x35b0('0x1a')]);_0x4d8dc6[_0x35b0('0x18')]=qs[_0x35b0('0x18')](_0xa62285[_0x35b0('0x2e')]['offset']);}return _0x114652[_0x35b0('0x4c')](_0x4d8dc6);}})[_0x35b0('0x20')](function(_0x10341d){if(_0x10341d){return _0x10341d?{'count':_0x3778e7,'rows':_0x10341d}:null;}})[_0x35b0('0x20')](respondWithResult(_0x26e134,null))[_0x35b0('0x42')](handleError(_0x26e134,null));};exports[_0x35b0('0x4d')]=function(_0x5a6276,_0x2d0f26,_0x5da825){var _0x217892={};var _0x17bb4d={};var _0x4f6ae1;var _0x2068bd;return db['Dynamics365Configuration'][_0x35b0('0x4a')]({'where':{'id':_0x5a6276[_0x35b0('0x44')]['id']}})[_0x35b0('0x20')](handleEntityNotFound(_0x2d0f26,null))['then'](function(_0x5ab5bc){if(_0x5ab5bc){_0x4f6ae1=_0x5ab5bc;_0x17bb4d[_0x35b0('0x2d')]=_[_0x35b0('0x2f')](db[_0x35b0('0x4b')][_0x35b0('0x29')]);_0x17bb4d[_0x35b0('0x2e')]=_['keys'](_0x5a6276[_0x35b0('0x2e')]);_0x17bb4d[_0x35b0('0x38')]=_['intersection'](_0x17bb4d[_0x35b0('0x2d')],_0x17bb4d[_0x35b0('0x2e')]);_0x217892[_0x35b0('0x31')]=_[_0x35b0('0x30')](_0x17bb4d[_0x35b0('0x2d')],qs[_0x35b0('0x32')](_0x5a6276[_0x35b0('0x2e')][_0x35b0('0x32')]));_0x217892['attributes']=_0x217892[_0x35b0('0x31')]['length']?_0x217892['attributes']:_0x17bb4d[_0x35b0('0x2d')];_0x217892[_0x35b0('0x35')]=qs['sort'](_0x5a6276['query'][_0x35b0('0x36')]);_0x217892[_0x35b0('0x3a')]=qs['filters'](_[_0x35b0('0x37')](_0x5a6276[_0x35b0('0x2e')],_0x17bb4d[_0x35b0('0x38')]));if(_0x5a6276['query'][_0x35b0('0x39')]){_0x217892[_0x35b0('0x3a')]=_['merge'](_0x217892[_0x35b0('0x3a')],{'$or':_[_0x35b0('0x28')](_0x217892[_0x35b0('0x31')],function(_0xda2c18){var _0xcfc634={};_0xcfc634[_0xda2c18]={'$like':'%'+_0x5a6276['query'][_0x35b0('0x39')]+'%'};return _0xcfc634;})});}_0x217892=_[_0x35b0('0x3b')]({},_0x217892,_0x5a6276[_0x35b0('0x46')]);return _0x4f6ae1[_0x35b0('0x4d')](_0x217892);}})[_0x35b0('0x20')](function(_0xcd8d43){if(_0xcd8d43){_0x2068bd=_0xcd8d43[_0x35b0('0x45')];if(!_0x5a6276[_0x35b0('0x2e')][_0x35b0('0x33')](_0x35b0('0x34'))){_0x217892[_0x35b0('0x1a')]=qs[_0x35b0('0x1a')](_0x5a6276[_0x35b0('0x2e')][_0x35b0('0x1a')]);_0x217892[_0x35b0('0x18')]=qs['offset'](_0x5a6276['query']['offset']);}return _0x4f6ae1[_0x35b0('0x4d')](_0x217892);}})[_0x35b0('0x20')](function(_0xcca154){if(_0xcca154){return _0xcca154?{'count':_0x2068bd,'rows':_0xcca154}:null;}})[_0x35b0('0x20')](respondWithResult(_0x2d0f26,null))[_0x35b0('0x42')](handleError(_0x2d0f26,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a37f9e0..62698ed 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x177c40,_0x5e69ed){var _0x539cdc=function(_0x203d5a){while(--_0x203d5a){_0x177c40['push'](_0x177c40['shift']());}};_0x539cdc(++_0x5e69ed);}(_0xbec5,0xe5));var _0x5bec=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0xbec5[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f1b5b,_0xa342ad){var _0x3a24b5=function(_0x568f17){while(--_0x568f17){_0x2f1b5b['push'](_0x2f1b5b['shift']());}};_0x3a24b5(++_0xa342ad);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xb4e6[_0x231dda];return _0x3f88cb;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','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 27e409e..f86062b 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 _0xb332=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x23b47c,_0xf16eff){var _0x471210=function(_0x5a077f){while(--_0x5a077f){_0x23b47c['push'](_0x23b47c['shift']());}};_0x471210(++_0xf16eff);}(_0xb332,0x175));var _0x2b33=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xb332[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x2b33('0x0'));var util=require(_0x2b33('0x1'));var moment=require(_0x2b33('0x2'));var BPromise=require(_0x2b33('0x3'));var rs=require(_0x2b33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b33('0x5'))(_0x2b33('0x6'));var config=require(_0x2b33('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b33('0x8')][_0x2b33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4252b,_0x2bf209,_0x354888){return new BPromise(function(_0x2ef697,_0x22fd60){return client['request'](_0x4252b,_0x354888)[_0x2b33('0xa')](function(_0x474662){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2bf209,_0x2b33('0xb'));logger[_0x2b33('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2bf209,'request\x20sent',JSON[_0x2b33('0xd')](_0x474662));if(_0x474662[_0x2b33('0xe')]){if(_0x474662[_0x2b33('0xe')][_0x2b33('0xf')]===0x1f4){logger[_0x2b33('0xe')](_0x2b33('0x10'),_0x2bf209,_0x474662[_0x2b33('0xe')]['message']);return _0x22fd60(_0x474662[_0x2b33('0xe')]['message']);}logger[_0x2b33('0xe')](_0x2b33('0x10'),_0x2bf209,_0x474662[_0x2b33('0xe')]['message']);return _0x2ef697(_0x474662[_0x2b33('0xe')][_0x2b33('0x11')]);}else{logger[_0x2b33('0x12')](_0x2b33('0x10'),_0x2bf209,_0x2b33('0xb'));_0x2ef697(_0x474662[_0x2b33('0x13')]['message']);}})[_0x2b33('0x14')](function(_0x863515){logger[_0x2b33('0xe')](_0x2b33('0x10'),_0x2bf209,_0x863515);_0x22fd60(_0x863515);});});} \ No newline at end of file +var _0xffda=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xffda,0xa6));var _0xaffd=function(_0x51642f,_0x2aaa93){_0x51642f=_0x51642f-0x0;var _0x5ca388=_0xffda[_0x51642f];return _0x5ca388;};'use strict';var _=require(_0xaffd('0x0'));var util=require(_0xaffd('0x1'));var moment=require(_0xaffd('0x2'));var BPromise=require(_0xaffd('0x3'));var rs=require(_0xaffd('0x4'));var fs=require('fs');var Redis=require(_0xaffd('0x5'));var db=require(_0xaffd('0x6'))['db'];var utils=require(_0xaffd('0x7'));var logger=require(_0xaffd('0x8'))('rpc');var config=require(_0xaffd('0x9'));var jayson=require(_0xaffd('0xa'));var client=jayson[_0xaffd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf3f220,_0x5d8c87,_0x1028ce){return new BPromise(function(_0x2cb0e4,_0x5b4194){return client[_0xaffd('0xc')](_0xf3f220,_0x1028ce)[_0xaffd('0xd')](function(_0x41ded8){logger[_0xaffd('0xe')](_0xaffd('0xf'),_0x5d8c87,_0xaffd('0x10'));logger[_0xaffd('0x11')](_0xaffd('0x12'),_0x5d8c87,'request\x20sent',JSON['stringify'](_0x41ded8));if(_0x41ded8['error']){if(_0x41ded8[_0xaffd('0x13')]['code']===0x1f4){logger[_0xaffd('0x13')](_0xaffd('0xf'),_0x5d8c87,_0x41ded8[_0xaffd('0x13')][_0xaffd('0x14')]);return _0x5b4194(_0x41ded8[_0xaffd('0x13')][_0xaffd('0x14')]);}logger[_0xaffd('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d8c87,_0x41ded8['error'][_0xaffd('0x14')]);return _0x2cb0e4(_0x41ded8[_0xaffd('0x13')][_0xaffd('0x14')]);}else{logger[_0xaffd('0xe')](_0xaffd('0xf'),_0x5d8c87,_0xaffd('0x10'));_0x2cb0e4(_0x41ded8[_0xaffd('0x15')][_0xaffd('0x14')]);}})[_0xaffd('0x16')](function(_0x4aa0ff){logger[_0xaffd('0x13')](_0xaffd('0xf'),_0x5d8c87,_0x4aa0ff);_0x5b4194(_0x4aa0ff);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index afad36a..15e1483 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 _0x2e9f=['multer','util','express','Router','fs-extra','../../components/auth/service','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x3dd67e,_0x170306){var _0x5a1757=function(_0x6d6140){while(--_0x6d6140){_0x3dd67e['push'](_0x3dd67e['shift']());}};_0x5a1757(++_0x170306);}(_0x2e9f,0x18c));var _0xf2e9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x2e9f[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xf2e9('0x0'));var util=require(_0xf2e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2e9('0x2'));var router=express[_0xf2e9('0x3')]();var fs_extra=require(_0xf2e9('0x4'));var auth=require(_0xf2e9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2e9('0x6'));router[_0xf2e9('0x7')]('/',auth['isAuthenticated'](),controller[_0xf2e9('0x8')]);router[_0xf2e9('0x7')](_0xf2e9('0x9'),auth[_0xf2e9('0xa')](),controller[_0xf2e9('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf2e9('0xc')]);router[_0xf2e9('0xd')]('/:id',auth[_0xf2e9('0xa')](),controller[_0xf2e9('0xe')]);router[_0xf2e9('0xf')](_0xf2e9('0x9'),auth[_0xf2e9('0xa')](),controller[_0xf2e9('0x10')]);module[_0xf2e9('0x11')]=router; \ No newline at end of file +var _0x223d=['index','/:id','show','post','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4b8e56,_0x59d430){var _0x5c844b=function(_0x3615c6){while(--_0x3615c6){_0x4b8e56['push'](_0x4b8e56['shift']());}};_0x5c844b(++_0x59d430);}(_0x223d,0x108));var _0xd223=function(_0x4aa795,_0x34e70b){_0x4aa795=_0x4aa795-0x0;var _0x42d66a=_0x223d[_0x4aa795];return _0x42d66a;};'use strict';var multer=require('multer');var util=require(_0xd223('0x0'));var path=require(_0xd223('0x1'));var timeout=require(_0xd223('0x2'));var express=require(_0xd223('0x3'));var router=express['Router']();var fs_extra=require(_0xd223('0x4'));var auth=require(_0xd223('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd223('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xd223('0x7')]('/',auth[_0xd223('0x8')](),controller[_0xd223('0x9')]);router[_0xd223('0x7')](_0xd223('0xa'),auth[_0xd223('0x8')](),controller[_0xd223('0xb')]);router[_0xd223('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd223('0xa'),auth[_0xd223('0x8')](),controller['update']);router['delete'](_0xd223('0xa'),auth[_0xd223('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 069e4e7..9b13b2c 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 _0x0006=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x0006,0x6f));var _0x6000=function(_0x4a0677,_0x4416ca){_0x4a0677=_0x4a0677-0x0;var _0x423552=_0x0006[_0x4a0677];return _0x423552;};'use strict';var Sequelize=require(_0x6000('0x0'));module[_0x6000('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6000('0x2'),_0x6000('0x3'),_0x6000('0x4'),_0x6000('0x5'),_0x6000('0x6')),'defaultValue':_0x6000('0x2')},'content':{'type':Sequelize[_0x6000('0x7')]},'key':{'type':Sequelize[_0x6000('0x7')]},'keyType':{'type':Sequelize[_0x6000('0x8')](_0x6000('0x2'),_0x6000('0x3'),_0x6000('0x4'))},'keyContent':{'type':Sequelize[_0x6000('0x7')]},'idField':{'type':Sequelize[_0x6000('0x7')]},'nameField':{'type':Sequelize[_0x6000('0x7')]},'customField':{'type':Sequelize[_0x6000('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6000('0x7')]}}; \ No newline at end of file +var _0xcd29=['sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x3d69ca,_0x5efe5c){var _0x2dfbdf=function(_0xc78b10){while(--_0xc78b10){_0x3d69ca['push'](_0x3d69ca['shift']());}};_0x2dfbdf(++_0x5efe5c);}(_0xcd29,0xea));var _0x9cd2=function(_0xbe3292,_0x17edba){_0xbe3292=_0xbe3292-0x0;var _0x4b9aed=_0xcd29[_0xbe3292];return _0x4b9aed;};'use strict';var Sequelize=require(_0x9cd2('0x0'));module[_0x9cd2('0x1')]={'type':{'type':Sequelize[_0x9cd2('0x2')]('string',_0x9cd2('0x3'),'customVariable',_0x9cd2('0x4'),_0x9cd2('0x5')),'defaultValue':_0x9cd2('0x6')},'content':{'type':Sequelize[_0x9cd2('0x7')]},'key':{'type':Sequelize[_0x9cd2('0x7')]},'keyType':{'type':Sequelize[_0x9cd2('0x2')](_0x9cd2('0x6'),_0x9cd2('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9cd2('0x7')]},'idField':{'type':Sequelize[_0x9cd2('0x7')]},'nameField':{'type':Sequelize[_0x9cd2('0x7')]},'customField':{'type':Sequelize[_0x9cd2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 22e84d6..470f999 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 _0x39a9=['pick','filter','map','VIRTUAL','options','include','findAll','catch','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','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','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5bc2d2,_0x47e74a){var _0x4c718f=function(_0x335a2e){while(--_0x335a2e){_0x5bc2d2['push'](_0x5bc2d2['shift']());}};_0x4c718f(++_0x47e74a);}(_0x39a9,0x194));var _0x939a=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x39a9[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require(_0x939a('0x0'));var rimraf=require(_0x939a('0x1'));var zipdir=require(_0x939a('0x2'));var jsonpatch=require(_0x939a('0x3'));var rp=require(_0x939a('0x4'));var moment=require(_0x939a('0x5'));var BPromise=require(_0x939a('0x6'));var Mustache=require(_0x939a('0x7'));var util=require(_0x939a('0x8'));var path=require('path');var sox=require(_0x939a('0x9'));var csv=require('to-csv');var ejs=require(_0x939a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x939a('0xb'));var squel=require(_0x939a('0xc'));var crypto=require(_0x939a('0xd'));var jsforce=require(_0x939a('0xe'));var deskjs=require(_0x939a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x939a('0x10'));var Papa=require(_0x939a('0x11'));var Redis=require(_0x939a('0x12'));var authService=require(_0x939a('0x13'));var qs=require(_0x939a('0x14'));var as=require(_0x939a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x939a('0x16'))(_0x939a('0x17'));var utils=require(_0x939a('0x18'));var config=require(_0x939a('0x19'));var licenseUtil=require(_0x939a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16f815,_0xd3b27e){_0xd3b27e=_0xd3b27e||0xcc;return function(_0x55d324){if(_0x55d324){return _0x16f815[_0x939a('0x1b')](_0xd3b27e);}return _0x16f815['status'](_0xd3b27e)['end']();};}function respondWithResult(_0x37d19c,_0x4c8813){_0x4c8813=_0x4c8813||0xc8;return function(_0x18c8bb){if(_0x18c8bb){return _0x37d19c[_0x939a('0x1c')](_0x4c8813)[_0x939a('0x1d')](_0x18c8bb);}};}function respondWithFilteredResult(_0x3621c9,_0x26eac7){return function(_0x3f0c32){if(_0x3f0c32){var _0x222d47=typeof _0x26eac7[_0x939a('0x1e')]==='undefined'&&typeof _0x26eac7[_0x939a('0x1f')]===_0x939a('0x20');var _0x29a3ef=_0x3f0c32[_0x939a('0x21')];var _0x45f134=_0x222d47?0x0:_0x26eac7[_0x939a('0x1e')];var _0x524da5=_0x222d47?_0x3f0c32['count']:_0x26eac7[_0x939a('0x1e')]+_0x26eac7['limit'];var _0x195099;if(_0x524da5>=_0x29a3ef){_0x524da5=_0x29a3ef;_0x195099=0xc8;}else{_0x195099=0xce;}_0x3621c9[_0x939a('0x1c')](_0x195099);return _0x3621c9[_0x939a('0x22')](_0x939a('0x23'),_0x45f134+'-'+_0x524da5+'/'+_0x29a3ef)[_0x939a('0x1d')](_0x3f0c32);}return null;};}function patchUpdates(_0x5f2537){return function(_0x4ee504){try{jsonpatch[_0x939a('0x24')](_0x4ee504,_0x5f2537,!![]);}catch(_0x316488){return BPromise[_0x939a('0x25')](_0x316488);}return _0x4ee504[_0x939a('0x26')]();};}function saveUpdates(_0xe5fcc0,_0x4531bf){return function(_0x48a839){if(_0x48a839){return _0x48a839[_0x939a('0x27')](_0xe5fcc0)[_0x939a('0x28')](function(_0x506ab3){return _0x506ab3;});}return null;};}function removeEntity(_0x5652c5,_0x516c40){return function(_0x28ed1f){if(_0x28ed1f){return _0x28ed1f[_0x939a('0x29')]()[_0x939a('0x28')](function(){_0x5652c5[_0x939a('0x1c')](0xcc)[_0x939a('0x2a')]();});}};}function handleEntityNotFound(_0x1193f6,_0xa6f6d1){return function(_0x52e14a){if(!_0x52e14a){_0x1193f6[_0x939a('0x1b')](0x194);}return _0x52e14a;};}function handleError(_0x354074,_0x33d58c){_0x33d58c=_0x33d58c||0x1f4;return function(_0x3c2288){logger[_0x939a('0x2b')](_0x3c2288[_0x939a('0x2c')]);if(_0x3c2288[_0x939a('0x2d')]){delete _0x3c2288[_0x939a('0x2d')];}_0x354074[_0x939a('0x1c')](_0x33d58c)[_0x939a('0x2e')](_0x3c2288);};}exports[_0x939a('0x2f')]=function(_0x183d6f,_0x22cbcb){var _0x5f2b13={},_0x5eeda2={},_0x48bf69={'count':0x0,'rows':[]};var _0x59794b=_['map'](db[_0x939a('0x30')][_0x939a('0x31')],function(_0x534813){return{'name':_0x534813[_0x939a('0x32')],'type':_0x534813[_0x939a('0x33')]['key']};});_0x5eeda2[_0x939a('0x34')]=_['map'](_0x59794b,_0x939a('0x2d'));_0x5eeda2[_0x939a('0x35')]=_[_0x939a('0x36')](_0x183d6f['query']);_0x5eeda2[_0x939a('0x37')]=_['intersection'](_0x5eeda2[_0x939a('0x34')],_0x5eeda2[_0x939a('0x35')]);_0x5f2b13[_0x939a('0x38')]=_[_0x939a('0x39')](_0x5eeda2[_0x939a('0x34')],qs[_0x939a('0x3a')](_0x183d6f[_0x939a('0x35')][_0x939a('0x3a')]));_0x5f2b13['attributes']=_0x5f2b13[_0x939a('0x38')]['length']?_0x5f2b13[_0x939a('0x38')]:_0x5eeda2['model'];if(!_0x183d6f[_0x939a('0x35')][_0x939a('0x3b')](_0x939a('0x3c'))){_0x5f2b13['limit']=qs['limit'](_0x183d6f['query']['limit']);_0x5f2b13[_0x939a('0x1e')]=qs[_0x939a('0x1e')](_0x183d6f['query']['offset']);}_0x5f2b13[_0x939a('0x3d')]=qs['sort'](_0x183d6f[_0x939a('0x35')][_0x939a('0x3e')]);_0x5f2b13[_0x939a('0x3f')]=qs[_0x939a('0x37')](_[_0x939a('0x40')](_0x183d6f[_0x939a('0x35')],_0x5eeda2[_0x939a('0x37')]),_0x59794b);if(_0x183d6f['query'][_0x939a('0x41')]){_0x5f2b13[_0x939a('0x3f')]=_['merge'](_0x5f2b13['where'],{'$or':_[_0x939a('0x42')](_0x59794b,function(_0x54629a){if(_0x54629a[_0x939a('0x33')]!==_0x939a('0x43')){var _0x143ea1={};_0x143ea1[_0x54629a['name']]={'$like':'%'+_0x183d6f[_0x939a('0x35')][_0x939a('0x41')]+'%'};return _0x143ea1;}})});}_0x5f2b13=_['merge']({},_0x5f2b13,_0x183d6f[_0x939a('0x44')]);var _0x57ea4a={'where':_0x5f2b13[_0x939a('0x3f')]};return db['Dynamics365Field'][_0x939a('0x21')](_0x57ea4a)[_0x939a('0x28')](function(_0x2ac624){_0x48bf69[_0x939a('0x21')]=_0x2ac624;if(_0x183d6f[_0x939a('0x35')]['includeAll']){_0x5f2b13[_0x939a('0x45')]=[{'all':!![]}];}return db[_0x939a('0x30')][_0x939a('0x46')](_0x5f2b13);})[_0x939a('0x28')](function(_0x63b7c8){_0x48bf69['rows']=_0x63b7c8;return _0x48bf69;})['then'](respondWithFilteredResult(_0x22cbcb,_0x5f2b13))[_0x939a('0x47')](handleError(_0x22cbcb,null));};exports['show']=function(_0x26e8be,_0x31e297){var _0x2bd39e={'raw':!![],'where':{'id':_0x26e8be['params']['id']}},_0x2d7401={};_0x2d7401[_0x939a('0x34')]=_[_0x939a('0x36')](db[_0x939a('0x30')]['rawAttributes']);_0x2d7401['query']=_[_0x939a('0x36')](_0x26e8be['query']);_0x2d7401[_0x939a('0x37')]=_[_0x939a('0x39')](_0x2d7401[_0x939a('0x34')],_0x2d7401[_0x939a('0x35')]);_0x2bd39e[_0x939a('0x38')]=_[_0x939a('0x39')](_0x2d7401[_0x939a('0x34')],qs['fields'](_0x26e8be['query']['fields']));_0x2bd39e[_0x939a('0x38')]=_0x2bd39e[_0x939a('0x38')][_0x939a('0x48')]?_0x2bd39e['attributes']:_0x2d7401[_0x939a('0x34')];if(_0x26e8be[_0x939a('0x35')][_0x939a('0x49')]){_0x2bd39e['include']=[{'all':!![]}];}_0x2bd39e=_['merge']({},_0x2bd39e,_0x26e8be[_0x939a('0x44')]);return db['Dynamics365Field'][_0x939a('0x4a')](_0x2bd39e)[_0x939a('0x28')](handleEntityNotFound(_0x31e297,null))[_0x939a('0x28')](respondWithResult(_0x31e297,null))[_0x939a('0x47')](handleError(_0x31e297,null));};exports[_0x939a('0x4b')]=function(_0x1764e7,_0x5e3be2){return db[_0x939a('0x30')][_0x939a('0x4b')](_0x1764e7['body'],{})['then'](respondWithResult(_0x5e3be2,0xc9))[_0x939a('0x47')](handleError(_0x5e3be2,null));};exports[_0x939a('0x27')]=function(_0x18d8f9,_0x580d07){if(_0x18d8f9[_0x939a('0x4c')]['id']){delete _0x18d8f9[_0x939a('0x4c')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x18d8f9[_0x939a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x580d07,null))[_0x939a('0x28')](saveUpdates(_0x18d8f9[_0x939a('0x4c')],null))[_0x939a('0x28')](respondWithResult(_0x580d07,null))['catch'](handleError(_0x580d07,null));};exports[_0x939a('0x29')]=function(_0x35b631,_0x25d692){return db[_0x939a('0x30')][_0x939a('0x4a')]({'where':{'id':_0x35b631[_0x939a('0x4d')]['id']}})[_0x939a('0x28')](handleEntityNotFound(_0x25d692,null))[_0x939a('0x28')](removeEntity(_0x25d692,null))[_0x939a('0x47')](handleError(_0x25d692,null));}; \ No newline at end of file +var _0x50f7=['save','update','then','destroy','error','stack','name','send','Dynamics365Field','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','count','include','rows','catch','show','params','keys','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','set','Content-Range','reject'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x50f7,0x7a));var _0x750f=function(_0x83fb,_0x5c0e8d){_0x83fb=_0x83fb-0x0;var _0x393d16=_0x50f7[_0x83fb];return _0x393d16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x750f('0x0'));var zipdir=require(_0x750f('0x1'));var jsonpatch=require(_0x750f('0x2'));var rp=require(_0x750f('0x3'));var moment=require('moment');var BPromise=require(_0x750f('0x4'));var Mustache=require(_0x750f('0x5'));var util=require(_0x750f('0x6'));var path=require(_0x750f('0x7'));var sox=require(_0x750f('0x8'));var csv=require(_0x750f('0x9'));var ejs=require(_0x750f('0xa'));var fs=require('fs');var fs_extra=require(_0x750f('0xb'));var _=require(_0x750f('0xc'));var squel=require(_0x750f('0xd'));var crypto=require(_0x750f('0xe'));var jsforce=require(_0x750f('0xf'));var deskjs=require(_0x750f('0x10'));var toCsv=require(_0x750f('0x9'));var querystring=require(_0x750f('0x11'));var Papa=require('papaparse');var Redis=require(_0x750f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x750f('0x13'));var as=require(_0x750f('0x14'));var hardwareService=require(_0x750f('0x15'));var logger=require(_0x750f('0x16'))(_0x750f('0x17'));var utils=require(_0x750f('0x18'));var config=require(_0x750f('0x19'));var licenseUtil=require(_0x750f('0x1a'));var db=require(_0x750f('0x1b'))['db'];function respondWithStatusCode(_0x523227,_0x57fc20){_0x57fc20=_0x57fc20||0xcc;return function(_0x12c8be){if(_0x12c8be){return _0x523227[_0x750f('0x1c')](_0x57fc20);}return _0x523227[_0x750f('0x1d')](_0x57fc20)[_0x750f('0x1e')]();};}function respondWithResult(_0x5a1e78,_0x1d1a3d){_0x1d1a3d=_0x1d1a3d||0xc8;return function(_0x3cd918){if(_0x3cd918){return _0x5a1e78[_0x750f('0x1d')](_0x1d1a3d)[_0x750f('0x1f')](_0x3cd918);}};}function respondWithFilteredResult(_0x653b51,_0x4b08a5){return function(_0x24f2a6){if(_0x24f2a6){var _0x17ec17=typeof _0x4b08a5[_0x750f('0x20')]===_0x750f('0x21')&&typeof _0x4b08a5[_0x750f('0x22')]==='undefined';var _0x2b3158=_0x24f2a6['count'];var _0x4e3587=_0x17ec17?0x0:_0x4b08a5['offset'];var _0x1f4296=_0x17ec17?_0x24f2a6['count']:_0x4b08a5['offset']+_0x4b08a5[_0x750f('0x22')];var _0x4a06d8;if(_0x1f4296>=_0x2b3158){_0x1f4296=_0x2b3158;_0x4a06d8=0xc8;}else{_0x4a06d8=0xce;}_0x653b51[_0x750f('0x1d')](_0x4a06d8);return _0x653b51[_0x750f('0x23')](_0x750f('0x24'),_0x4e3587+'-'+_0x1f4296+'/'+_0x2b3158)[_0x750f('0x1f')](_0x24f2a6);}return null;};}function patchUpdates(_0x1425d5){return function(_0x65a004){try{jsonpatch['apply'](_0x65a004,_0x1425d5,!![]);}catch(_0x2c2397){return BPromise[_0x750f('0x25')](_0x2c2397);}return _0x65a004[_0x750f('0x26')]();};}function saveUpdates(_0x4adaaa,_0x951e3b){return function(_0xa073ad){if(_0xa073ad){return _0xa073ad[_0x750f('0x27')](_0x4adaaa)[_0x750f('0x28')](function(_0x3499a0){return _0x3499a0;});}return null;};}function removeEntity(_0x1d3137,_0x589f83){return function(_0x573558){if(_0x573558){return _0x573558[_0x750f('0x29')]()[_0x750f('0x28')](function(){_0x1d3137[_0x750f('0x1d')](0xcc)[_0x750f('0x1e')]();});}};}function handleEntityNotFound(_0x4d0940,_0xd2e4d){return function(_0x354b08){if(!_0x354b08){_0x4d0940['sendStatus'](0x194);}return _0x354b08;};}function handleError(_0x2fdad7,_0xf9df12){_0xf9df12=_0xf9df12||0x1f4;return function(_0x535867){logger[_0x750f('0x2a')](_0x535867[_0x750f('0x2b')]);if(_0x535867[_0x750f('0x2c')]){delete _0x535867['name'];}_0x2fdad7[_0x750f('0x1d')](_0xf9df12)[_0x750f('0x2d')](_0x535867);};}exports['index']=function(_0x2df352,_0x47ad60){var _0x3a76cd={},_0x3a26a3={},_0x2cfc9b={'count':0x0,'rows':[]};var _0xb134e5=_['map'](db[_0x750f('0x2e')][_0x750f('0x2f')],function(_0x188726){return{'name':_0x188726[_0x750f('0x30')],'type':_0x188726[_0x750f('0x31')][_0x750f('0x32')]};});_0x3a26a3['model']=_['map'](_0xb134e5,_0x750f('0x2c'));_0x3a26a3[_0x750f('0x33')]=_['keys'](_0x2df352[_0x750f('0x33')]);_0x3a26a3[_0x750f('0x34')]=_[_0x750f('0x35')](_0x3a26a3[_0x750f('0x36')],_0x3a26a3[_0x750f('0x33')]);_0x3a76cd[_0x750f('0x37')]=_[_0x750f('0x35')](_0x3a26a3[_0x750f('0x36')],qs[_0x750f('0x38')](_0x2df352[_0x750f('0x33')][_0x750f('0x38')]));_0x3a76cd[_0x750f('0x37')]=_0x3a76cd[_0x750f('0x37')][_0x750f('0x39')]?_0x3a76cd['attributes']:_0x3a26a3[_0x750f('0x36')];if(!_0x2df352['query'][_0x750f('0x3a')](_0x750f('0x3b'))){_0x3a76cd[_0x750f('0x22')]=qs[_0x750f('0x22')](_0x2df352['query'][_0x750f('0x22')]);_0x3a76cd['offset']=qs['offset'](_0x2df352[_0x750f('0x33')][_0x750f('0x20')]);}_0x3a76cd[_0x750f('0x3c')]=qs[_0x750f('0x3d')](_0x2df352[_0x750f('0x33')]['sort']);_0x3a76cd[_0x750f('0x3e')]=qs[_0x750f('0x34')](_[_0x750f('0x3f')](_0x2df352[_0x750f('0x33')],_0x3a26a3[_0x750f('0x34')]),_0xb134e5);if(_0x2df352[_0x750f('0x33')]['filter']){_0x3a76cd[_0x750f('0x3e')]=_[_0x750f('0x40')](_0x3a76cd[_0x750f('0x3e')],{'$or':_[_0x750f('0x41')](_0xb134e5,function(_0x13c3d0){if(_0x13c3d0[_0x750f('0x31')]!==_0x750f('0x42')){var _0x556636={};_0x556636[_0x13c3d0[_0x750f('0x2c')]]={'$like':'%'+_0x2df352['query'][_0x750f('0x43')]+'%'};return _0x556636;}})});}_0x3a76cd=_[_0x750f('0x40')]({},_0x3a76cd,_0x2df352[_0x750f('0x44')]);var _0x313bd9={'where':_0x3a76cd[_0x750f('0x3e')]};return db[_0x750f('0x2e')][_0x750f('0x45')](_0x313bd9)[_0x750f('0x28')](function(_0x17d873){_0x2cfc9b['count']=_0x17d873;if(_0x2df352['query']['includeAll']){_0x3a76cd[_0x750f('0x46')]=[{'all':!![]}];}return db[_0x750f('0x2e')]['findAll'](_0x3a76cd);})[_0x750f('0x28')](function(_0x2406fb){_0x2cfc9b[_0x750f('0x47')]=_0x2406fb;return _0x2cfc9b;})[_0x750f('0x28')](respondWithFilteredResult(_0x47ad60,_0x3a76cd))[_0x750f('0x48')](handleError(_0x47ad60,null));};exports[_0x750f('0x49')]=function(_0x53a995,_0x317a14){var _0x102656={'raw':!![],'where':{'id':_0x53a995[_0x750f('0x4a')]['id']}},_0x3379fb={};_0x3379fb[_0x750f('0x36')]=_[_0x750f('0x4b')](db[_0x750f('0x2e')][_0x750f('0x2f')]);_0x3379fb['query']=_[_0x750f('0x4b')](_0x53a995[_0x750f('0x33')]);_0x3379fb['filters']=_['intersection'](_0x3379fb['model'],_0x3379fb[_0x750f('0x33')]);_0x102656[_0x750f('0x37')]=_['intersection'](_0x3379fb['model'],qs[_0x750f('0x38')](_0x53a995[_0x750f('0x33')][_0x750f('0x38')]));_0x102656[_0x750f('0x37')]=_0x102656['attributes'][_0x750f('0x39')]?_0x102656[_0x750f('0x37')]:_0x3379fb[_0x750f('0x36')];if(_0x53a995[_0x750f('0x33')][_0x750f('0x4c')]){_0x102656[_0x750f('0x46')]=[{'all':!![]}];}_0x102656=_[_0x750f('0x40')]({},_0x102656,_0x53a995[_0x750f('0x44')]);return db[_0x750f('0x2e')][_0x750f('0x4d')](_0x102656)[_0x750f('0x28')](handleEntityNotFound(_0x317a14,null))['then'](respondWithResult(_0x317a14,null))[_0x750f('0x48')](handleError(_0x317a14,null));};exports[_0x750f('0x4e')]=function(_0x3d73eb,_0x231310){return db[_0x750f('0x2e')][_0x750f('0x4e')](_0x3d73eb['body'],{})[_0x750f('0x28')](respondWithResult(_0x231310,0xc9))[_0x750f('0x48')](handleError(_0x231310,null));};exports['update']=function(_0x6f44af,_0x12f9bd){if(_0x6f44af['body']['id']){delete _0x6f44af[_0x750f('0x4f')]['id'];}return db[_0x750f('0x2e')][_0x750f('0x4d')]({'where':{'id':_0x6f44af['params']['id']}})[_0x750f('0x28')](handleEntityNotFound(_0x12f9bd,null))[_0x750f('0x28')](saveUpdates(_0x6f44af[_0x750f('0x4f')],null))['then'](respondWithResult(_0x12f9bd,null))[_0x750f('0x48')](handleError(_0x12f9bd,null));};exports[_0x750f('0x29')]=function(_0x1f49b4,_0x236ae6){return db[_0x750f('0x2e')][_0x750f('0x4d')]({'where':{'id':_0x1f49b4['params']['id']}})[_0x750f('0x28')](handleEntityNotFound(_0x236ae6,null))[_0x750f('0x28')](removeEntity(_0x236ae6,null))[_0x750f('0x48')](handleError(_0x236ae6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1991bd2..2801fdc 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 _0x4469=['Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intDynamics365Field.attributes','exports','define'];(function(_0x5be652,_0x129d44){var _0x3c89da=function(_0x2f01ac){while(--_0x2f01ac){_0x5be652['push'](_0x5be652['shift']());}};_0x3c89da(++_0x129d44);}(_0x4469,0x1f3));var _0x9446=function(_0x185d60,_0x458afc){_0x185d60=_0x185d60-0x0;var _0x1b90c8=_0x4469[_0x185d60];return _0x1b90c8;};'use strict';var _=require(_0x9446('0x0'));var util=require(_0x9446('0x1'));var logger=require(_0x9446('0x2'))(_0x9446('0x3'));var moment=require(_0x9446('0x4'));var BPromise=require(_0x9446('0x5'));var rp=require(_0x9446('0x6'));var fs=require('fs');var path=require(_0x9446('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9446('0x8'));module[_0x9446('0x9')]=function(_0x3d7e96,_0xafd63b){return _0x3d7e96[_0x9446('0xa')](_0x9446('0xb'),attributes,{'tableName':_0x9446('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x9446('0xd'),_0x9446('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8619=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x49452a,_0x544d88){var _0x579b46=function(_0x3699bd){while(--_0x3699bd){_0x49452a['push'](_0x49452a['shift']());}};_0x579b46(++_0x544d88);}(_0x8619,0x141));var _0x9861=function(_0x4f17a5,_0x92394f){_0x4f17a5=_0x4f17a5-0x0;var _0x4e711d=_0x8619[_0x4f17a5];return _0x4e711d;};'use strict';var _=require(_0x9861('0x0'));var util=require(_0x9861('0x1'));var logger=require(_0x9861('0x2'))(_0x9861('0x3'));var moment=require(_0x9861('0x4'));var BPromise=require(_0x9861('0x5'));var rp=require(_0x9861('0x6'));var fs=require('fs');var path=require(_0x9861('0x7'));var rimraf=require(_0x9861('0x8'));var config=require(_0x9861('0x9'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x71392a,_0x54dea2){return _0x71392a[_0x9861('0xa')](_0x9861('0xb'),attributes,{'tableName':_0x9861('0xc'),'paranoid':![],'indexes':[{'name':_0x9861('0xd'),'fields':[_0x9861('0xe'),_0x9861('0xf')],'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 8f35dbe..5d4aca9 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 _0x3871=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','debug','stringify','error','message','catch','lodash'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x3871,0x13a));var _0x1387=function(_0x305d70,_0x285fd2){_0x305d70=_0x305d70-0x0;var _0x41f586=_0x3871[_0x305d70];return _0x41f586;};'use strict';var _=require(_0x1387('0x0'));var util=require(_0x1387('0x1'));var moment=require(_0x1387('0x2'));var BPromise=require(_0x1387('0x3'));var rs=require(_0x1387('0x4'));var fs=require('fs');var Redis=require(_0x1387('0x5'));var db=require(_0x1387('0x6'))['db'];var utils=require(_0x1387('0x7'));var logger=require(_0x1387('0x8'))('rpc');var config=require(_0x1387('0x9'));var jayson=require(_0x1387('0xa'));var client=jayson[_0x1387('0xb')][_0x1387('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182434,_0x2807a6,_0x4171d3){return new BPromise(function(_0x2cb9f2,_0x3a3f6d){return client[_0x1387('0xd')](_0x182434,_0x4171d3)['then'](function(_0x4e60ef){logger[_0x1387('0xe')](_0x1387('0xf'),_0x2807a6,'request\x20sent');logger[_0x1387('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2807a6,'request\x20sent',JSON[_0x1387('0x11')](_0x4e60ef));if(_0x4e60ef[_0x1387('0x12')]){if(_0x4e60ef[_0x1387('0x12')]['code']===0x1f4){logger['error'](_0x1387('0xf'),_0x2807a6,_0x4e60ef[_0x1387('0x12')][_0x1387('0x13')]);return _0x3a3f6d(_0x4e60ef[_0x1387('0x12')][_0x1387('0x13')]);}logger[_0x1387('0x12')](_0x1387('0xf'),_0x2807a6,_0x4e60ef[_0x1387('0x12')][_0x1387('0x13')]);return _0x2cb9f2(_0x4e60ef[_0x1387('0x12')]['message']);}else{logger[_0x1387('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x2807a6,'request\x20sent');_0x2cb9f2(_0x4e60ef['result'][_0x1387('0x13')]);}})[_0x1387('0x14')](function(_0x1584e8){logger[_0x1387('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x2807a6,_0x1584e8);_0x3a3f6d(_0x1584e8);});});} \ No newline at end of file +var _0x3319=['error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4e36b2,_0x19464f){var _0x3210bf=function(_0x3135dd){while(--_0x3135dd){_0x4e36b2['push'](_0x4e36b2['shift']());}};_0x3210bf(++_0x19464f);}(_0x3319,0x1b4));var _0x9331=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3319[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0x9331('0x0'));var moment=require(_0x9331('0x1'));var BPromise=require(_0x9331('0x2'));var rs=require(_0x9331('0x3'));var fs=require('fs');var Redis=require(_0x9331('0x4'));var db=require(_0x9331('0x5'))['db'];var utils=require(_0x9331('0x6'));var logger=require(_0x9331('0x7'))('rpc');var config=require(_0x9331('0x8'));var jayson=require(_0x9331('0x9'));var client=jayson[_0x9331('0xa')][_0x9331('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0c87c,_0x179763,_0x2a698a){return new BPromise(function(_0x102d6b,_0x3da308){return client[_0x9331('0xc')](_0xb0c87c,_0x2a698a)[_0x9331('0xd')](function(_0x2f5efd){logger[_0x9331('0xe')](_0x9331('0xf'),_0x179763,_0x9331('0x10'));logger[_0x9331('0x11')](_0x9331('0x12'),_0x179763,_0x9331('0x10'),JSON[_0x9331('0x13')](_0x2f5efd));if(_0x2f5efd['error']){if(_0x2f5efd[_0x9331('0x14')][_0x9331('0x15')]===0x1f4){logger[_0x9331('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x179763,_0x2f5efd[_0x9331('0x14')][_0x9331('0x16')]);return _0x3da308(_0x2f5efd[_0x9331('0x14')]['message']);}logger['error'](_0x9331('0xf'),_0x179763,_0x2f5efd[_0x9331('0x14')][_0x9331('0x16')]);return _0x102d6b(_0x2f5efd[_0x9331('0x14')][_0x9331('0x16')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x179763,'request\x20sent');_0x102d6b(_0x2f5efd[_0x9331('0x17')][_0x9331('0x16')]);}})['catch'](function(_0x1d6481){logger[_0x9331('0x14')](_0x9331('0xf'),_0x179763,_0x1d6481);_0x3da308(_0x1d6481);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 525c883..df88a49 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 _0x0aaf=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0aaf,0xa1));var _0xf0aa=function(_0x147003,_0x36e2e3){_0x147003=_0x147003-0x0;var _0x5167b2=_0x0aaf[_0x147003];return _0x5167b2;};'use strict';var multer=require(_0xf0aa('0x0'));var util=require('util');var path=require(_0xf0aa('0x1'));var timeout=require(_0xf0aa('0x2'));var express=require(_0xf0aa('0x3'));var router=express[_0xf0aa('0x4')]();var fs_extra=require(_0xf0aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf0aa('0x6'));var config=require(_0xf0aa('0x7'));var controller=require(_0xf0aa('0x8'));router[_0xf0aa('0x9')]('/',auth['isAuthenticated'](),controller[_0xf0aa('0xa')]);router[_0xf0aa('0x9')](_0xf0aa('0xb'),auth[_0xf0aa('0xc')](),controller[_0xf0aa('0xd')]);router['get'](_0xf0aa('0xe'),auth[_0xf0aa('0xc')](),controller[_0xf0aa('0xf')]);router['get'](_0xf0aa('0x10'),auth['isAuthenticated'](),controller[_0xf0aa('0x11')]);router[_0xf0aa('0x12')]('/',auth[_0xf0aa('0xc')](),controller[_0xf0aa('0x13')]);router['post'](_0xf0aa('0xe'),auth[_0xf0aa('0xc')](),controller['addConfiguration']);router[_0xf0aa('0x14')](_0xf0aa('0xb'),auth[_0xf0aa('0xc')](),controller[_0xf0aa('0x15')]);router[_0xf0aa('0x16')](_0xf0aa('0xb'),auth[_0xf0aa('0xc')](),controller[_0xf0aa('0x17')]);module[_0xf0aa('0x18')]=router; \ No newline at end of file +var _0x57a9=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','multer'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x57a9,0xc5));var _0x957a=function(_0x5639fc,_0x953c56){_0x5639fc=_0x5639fc-0x0;var _0x13a15b=_0x57a9[_0x5639fc];return _0x13a15b;};'use strict';var multer=require(_0x957a('0x0'));var util=require('util');var path=require(_0x957a('0x1'));var timeout=require(_0x957a('0x2'));var express=require('express');var router=express[_0x957a('0x3')]();var fs_extra=require(_0x957a('0x4'));var auth=require(_0x957a('0x5'));var interaction=require(_0x957a('0x6'));var config=require(_0x957a('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x957a('0x8')]('/',auth['isAuthenticated'](),controller[_0x957a('0x9')]);router['get'](_0x957a('0xa'),auth[_0x957a('0xb')](),controller[_0x957a('0xc')]);router[_0x957a('0x8')](_0x957a('0xd'),auth['isAuthenticated'](),controller[_0x957a('0xe')]);router[_0x957a('0x8')](_0x957a('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x957a('0x10')]('/',auth[_0x957a('0xb')](),controller[_0x957a('0x11')]);router[_0x957a('0x10')]('/:id/configurations',auth[_0x957a('0xb')](),controller[_0x957a('0x12')]);router[_0x957a('0x13')](_0x957a('0xa'),auth[_0x957a('0xb')](),controller[_0x957a('0x14')]);router[_0x957a('0x15')](_0x957a('0xa'),auth[_0x957a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index dc39c42..03f45a8 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 _0x2da6=['username','sequelize','exports','STRING'];(function(_0x4c4949,_0x5f2cee){var _0x52bf3c=function(_0x47894d){while(--_0x47894d){_0x4c4949['push'](_0x4c4949['shift']());}};_0x52bf3c(++_0x5f2cee);}(_0x2da6,0x1dd));var _0x62da=function(_0x115081,_0x2932b4){_0x115081=_0x115081-0x0;var _0x5e9950=_0x2da6[_0x115081];return _0x5e9950;};'use strict';var Sequelize=require(_0x62da('0x0'));module[_0x62da('0x1')]={'name':{'type':Sequelize[_0x62da('0x2')]},'description':{'type':Sequelize[_0x62da('0x2')]},'username':{'type':Sequelize[_0x62da('0x2')],'unique':_0x62da('0x3')},'apiKey':{'type':Sequelize[_0x62da('0x2')]},'remoteUri':{'type':Sequelize[_0x62da('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xb016,0x159));var _0x6b01=function(_0x1b601d,_0x4a9855){_0x1b601d=_0x1b601d-0x0;var _0x5ad459=_0xb016[_0x1b601d];return _0x5ad459;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index f5a59a7..40e0f51 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 _0x3c2c=['group','source','ticket_type','company','remove','includes','default','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','query','keys','attributes','model','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','intersection','fields','include','find','create','body','update','destroy','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','apiKey','toString','base64','requester','subject','agent','description'];(function(_0x1bfdea,_0x1afe11){var _0x5eb627=function(_0x142dce){while(--_0x142dce){_0x1bfdea['push'](_0x1bfdea['shift']());}};_0x5eb627(++_0x1afe11);}(_0x3c2c,0x160));var _0xc3c2=function(_0xfc3f8d,_0x6618c6){_0xfc3f8d=_0xfc3f8d-0x0;var _0x5cfc6f=_0x3c2c[_0xfc3f8d];return _0x5cfc6f;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3920e7,_0x1befad){_0x1befad=_0x1befad||0xcc;return function(_0x515bbc){if(_0x515bbc){return _0x3920e7[_0xc3c2('0x16')](_0x1befad);}return _0x3920e7['status'](_0x1befad)[_0xc3c2('0x17')]();};}function respondWithResult(_0x4d7d11,_0x154071){_0x154071=_0x154071||0xc8;return function(_0x4a5c39){if(_0x4a5c39){return _0x4d7d11[_0xc3c2('0x18')](_0x154071)[_0xc3c2('0x19')](_0x4a5c39);}};}function respondWithFilteredResult(_0x56bc61,_0x1c2987){return function(_0x36f10f){if(_0x36f10f){var _0x3eb9f5=typeof _0x1c2987[_0xc3c2('0x1a')]===_0xc3c2('0x1b')&&typeof _0x1c2987[_0xc3c2('0x1c')]==='undefined';var _0x57fe9d=_0x36f10f['count'];var _0x2770f7=_0x3eb9f5?0x0:_0x1c2987[_0xc3c2('0x1a')];var _0x2b8c31=_0x3eb9f5?_0x36f10f[_0xc3c2('0x1d')]:_0x1c2987[_0xc3c2('0x1a')]+_0x1c2987['limit'];var _0x533a3d;if(_0x2b8c31>=_0x57fe9d){_0x2b8c31=_0x57fe9d;_0x533a3d=0xc8;}else{_0x533a3d=0xce;}_0x56bc61[_0xc3c2('0x18')](_0x533a3d);return _0x56bc61[_0xc3c2('0x1e')](_0xc3c2('0x1f'),_0x2770f7+'-'+_0x2b8c31+'/'+_0x57fe9d)['json'](_0x36f10f);}return null;};}function patchUpdates(_0x42feba){return function(_0x48bb27){try{jsonpatch[_0xc3c2('0x20')](_0x48bb27,_0x42feba,!![]);}catch(_0x1d317a){return BPromise[_0xc3c2('0x21')](_0x1d317a);}return _0x48bb27['save']();};}function saveUpdates(_0x2ca609,_0x340c75){return function(_0x1b44c4){if(_0x1b44c4){return _0x1b44c4['update'](_0x2ca609)[_0xc3c2('0x22')](function(_0x3287a3){return _0x3287a3;});}return null;};}function removeEntity(_0x6ad7af,_0x5d7789){return function(_0x2133bc){if(_0x2133bc){return _0x2133bc['destroy']()[_0xc3c2('0x22')](function(){_0x6ad7af[_0xc3c2('0x18')](0xcc)[_0xc3c2('0x17')]();});}};}function handleEntityNotFound(_0x38d0b9,_0x15f5f9){return function(_0x2f7a0b){if(!_0x2f7a0b){_0x38d0b9[_0xc3c2('0x16')](0x194);}return _0x2f7a0b;};}function handleError(_0x4b6504,_0x48fa15){_0x48fa15=_0x48fa15||0x1f4;return function(_0x58fd7a){logger[_0xc3c2('0x23')](_0x58fd7a[_0xc3c2('0x24')]);if(_0x58fd7a[_0xc3c2('0x25')]){delete _0x58fd7a['name'];}_0x4b6504[_0xc3c2('0x18')](_0x48fa15)[_0xc3c2('0x26')](_0x58fd7a);};}exports[_0xc3c2('0x27')]=function(_0x2bc3b7,_0x7686ac){var _0x166f8e={},_0x1b9e5e={},_0x246ea8={'count':0x0,'rows':[]};var _0x5bd00d=_[_0xc3c2('0x28')](db[_0xc3c2('0x29')][_0xc3c2('0x2a')],function(_0x3aebab){return{'name':_0x3aebab[_0xc3c2('0x2b')],'type':_0x3aebab[_0xc3c2('0x2c')]['key']};});_0x1b9e5e['model']=_[_0xc3c2('0x28')](_0x5bd00d,'name');_0x1b9e5e[_0xc3c2('0x2d')]=_[_0xc3c2('0x2e')](_0x2bc3b7[_0xc3c2('0x2d')]);_0x1b9e5e['filters']=_['intersection'](_0x1b9e5e['model'],_0x1b9e5e['query']);_0x166f8e[_0xc3c2('0x2f')]=_['intersection'](_0x1b9e5e[_0xc3c2('0x30')],qs['fields'](_0x2bc3b7[_0xc3c2('0x2d')]['fields']));_0x166f8e['attributes']=_0x166f8e[_0xc3c2('0x2f')][_0xc3c2('0x31')]?_0x166f8e[_0xc3c2('0x2f')]:_0x1b9e5e[_0xc3c2('0x30')];if(!_0x2bc3b7[_0xc3c2('0x2d')][_0xc3c2('0x32')](_0xc3c2('0x33'))){_0x166f8e[_0xc3c2('0x1c')]=qs[_0xc3c2('0x1c')](_0x2bc3b7['query']['limit']);_0x166f8e[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x2bc3b7[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);}_0x166f8e[_0xc3c2('0x34')]=qs[_0xc3c2('0x35')](_0x2bc3b7['query'][_0xc3c2('0x35')]);_0x166f8e['where']=qs[_0xc3c2('0x36')](_[_0xc3c2('0x37')](_0x2bc3b7['query'],_0x1b9e5e[_0xc3c2('0x36')]),_0x5bd00d);if(_0x2bc3b7[_0xc3c2('0x2d')]['filter']){_0x166f8e[_0xc3c2('0x38')]=_[_0xc3c2('0x39')](_0x166f8e[_0xc3c2('0x38')],{'$or':_[_0xc3c2('0x28')](_0x5bd00d,function(_0x1a2f48){if(_0x1a2f48[_0xc3c2('0x2c')]!==_0xc3c2('0x3a')){var _0x3f4fd0={};_0x3f4fd0[_0x1a2f48['name']]={'$like':'%'+_0x2bc3b7[_0xc3c2('0x2d')][_0xc3c2('0x3b')]+'%'};return _0x3f4fd0;}})});}_0x166f8e=_[_0xc3c2('0x39')]({},_0x166f8e,_0x2bc3b7[_0xc3c2('0x3c')]);var _0x311c10={'where':_0x166f8e[_0xc3c2('0x38')]};return db[_0xc3c2('0x29')][_0xc3c2('0x1d')](_0x311c10)[_0xc3c2('0x22')](function(_0x3a1d74){_0x246ea8['count']=_0x3a1d74;if(_0x2bc3b7[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x166f8e['include']=[{'all':!![]}];}return db[_0xc3c2('0x29')][_0xc3c2('0x3e')](_0x166f8e);})['then'](function(_0x34354c){_0x246ea8['rows']=_0x34354c;return _0x246ea8;})[_0xc3c2('0x22')](respondWithFilteredResult(_0x7686ac,_0x166f8e))[_0xc3c2('0x3f')](handleError(_0x7686ac,null));};exports[_0xc3c2('0x40')]=function(_0x30217b,_0x15680d){var _0x2ef1db={'raw':![],'where':{'id':_0x30217b[_0xc3c2('0x41')]['id']}},_0x24d9fc={};_0x24d9fc['model']=_[_0xc3c2('0x2e')](db[_0xc3c2('0x29')][_0xc3c2('0x2a')]);_0x24d9fc[_0xc3c2('0x2d')]=_['keys'](_0x30217b['query']);_0x24d9fc['filters']=_[_0xc3c2('0x42')](_0x24d9fc[_0xc3c2('0x30')],_0x24d9fc['query']);_0x2ef1db[_0xc3c2('0x2f')]=_['intersection'](_0x24d9fc[_0xc3c2('0x30')],qs['fields'](_0x30217b[_0xc3c2('0x2d')][_0xc3c2('0x43')]));_0x2ef1db[_0xc3c2('0x2f')]=_0x2ef1db[_0xc3c2('0x2f')][_0xc3c2('0x31')]?_0x2ef1db['attributes']:_0x24d9fc['model'];if(_0x30217b[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x2ef1db[_0xc3c2('0x44')]=[{'all':!![]}];}_0x2ef1db=_[_0xc3c2('0x39')]({},_0x2ef1db,_0x30217b[_0xc3c2('0x3c')]);return db[_0xc3c2('0x29')][_0xc3c2('0x45')](_0x2ef1db)[_0xc3c2('0x22')](handleEntityNotFound(_0x15680d,null))[_0xc3c2('0x22')](respondWithResult(_0x15680d,null))[_0xc3c2('0x3f')](handleError(_0x15680d,null));};exports[_0xc3c2('0x46')]=function(_0x287fe6,_0x3592f0){return db[_0xc3c2('0x29')]['create'](_0x287fe6[_0xc3c2('0x47')],{})[_0xc3c2('0x22')](respondWithResult(_0x3592f0,0xc9))[_0xc3c2('0x3f')](handleError(_0x3592f0,null));};exports[_0xc3c2('0x48')]=function(_0x2321a3,_0x21f50f){if(_0x2321a3[_0xc3c2('0x47')]['id']){delete _0x2321a3[_0xc3c2('0x47')]['id'];}return db[_0xc3c2('0x29')][_0xc3c2('0x45')]({'where':{'id':_0x2321a3[_0xc3c2('0x41')]['id']}})[_0xc3c2('0x22')](handleEntityNotFound(_0x21f50f,null))['then'](saveUpdates(_0x2321a3[_0xc3c2('0x47')],null))['then'](respondWithResult(_0x21f50f,null))[_0xc3c2('0x3f')](handleError(_0x21f50f,null));};exports[_0xc3c2('0x49')]=function(_0x22f607,_0x1d0e9f){return db[_0xc3c2('0x29')]['find']({'where':{'id':_0x22f607[_0xc3c2('0x41')]['id']}})[_0xc3c2('0x22')](handleEntityNotFound(_0x1d0e9f,null))[_0xc3c2('0x22')](removeEntity(_0x1d0e9f,null))[_0xc3c2('0x3f')](handleError(_0x1d0e9f,null));};exports['getConfigurations']=function(_0x16b204,_0x53b8bc,_0x19714d){var _0x3c2bf2={};var _0x1dcfe9={};var _0x148c9e;var _0x27235b;return db[_0xc3c2('0x29')]['findOne']({'where':{'id':_0x16b204[_0xc3c2('0x41')]['id']}})[_0xc3c2('0x22')](handleEntityNotFound(_0x53b8bc,null))[_0xc3c2('0x22')](function(_0x2aa1e8){if(_0x2aa1e8){_0x148c9e=_0x2aa1e8;_0x1dcfe9[_0xc3c2('0x30')]=_[_0xc3c2('0x2e')](db[_0xc3c2('0x4a')][_0xc3c2('0x2a')]);_0x1dcfe9[_0xc3c2('0x2d')]=_[_0xc3c2('0x2e')](_0x16b204[_0xc3c2('0x2d')]);_0x1dcfe9[_0xc3c2('0x36')]=_[_0xc3c2('0x42')](_0x1dcfe9[_0xc3c2('0x30')],_0x1dcfe9['query']);_0x3c2bf2[_0xc3c2('0x2f')]=_['intersection'](_0x1dcfe9[_0xc3c2('0x30')],qs['fields'](_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x43')]));_0x3c2bf2[_0xc3c2('0x2f')]=_0x3c2bf2['attributes'][_0xc3c2('0x31')]?_0x3c2bf2[_0xc3c2('0x2f')]:_0x1dcfe9[_0xc3c2('0x30')];_0x3c2bf2[_0xc3c2('0x34')]=qs[_0xc3c2('0x35')](_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x35')]);_0x3c2bf2['where']=qs[_0xc3c2('0x36')](_[_0xc3c2('0x37')](_0x16b204[_0xc3c2('0x2d')],_0x1dcfe9[_0xc3c2('0x36')]));if(_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x3b')]){_0x3c2bf2[_0xc3c2('0x38')]=_[_0xc3c2('0x39')](_0x3c2bf2[_0xc3c2('0x38')],{'$or':_['map'](_0x3c2bf2[_0xc3c2('0x2f')],function(_0x16956e){var _0x470a28={};_0x470a28[_0x16956e]={'$like':'%'+_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x3b')]+'%'};return _0x470a28;})});}_0x3c2bf2=_[_0xc3c2('0x39')]({},_0x3c2bf2,_0x16b204[_0xc3c2('0x3c')]);return _0x148c9e[_0xc3c2('0x4b')](_0x3c2bf2);}})[_0xc3c2('0x22')](function(_0x5c3bf0){if(_0x5c3bf0){_0x27235b=_0x5c3bf0['length'];if(!_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x32')](_0xc3c2('0x33'))){_0x3c2bf2['limit']=qs[_0xc3c2('0x1c')](_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x1c')]);_0x3c2bf2[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x16b204[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);}return _0x148c9e[_0xc3c2('0x4b')](_0x3c2bf2);}})[_0xc3c2('0x22')](function(_0x17cb5d){if(_0x17cb5d){return _0x17cb5d?{'count':_0x27235b,'rows':_0x17cb5d}:null;}})[_0xc3c2('0x22')](respondWithResult(_0x53b8bc,null))[_0xc3c2('0x3f')](handleError(_0x53b8bc,null));};exports[_0xc3c2('0x4c')]=function(_0x320203,_0x2684db,_0x3aaa9d){if(_0x320203['body']['id']){delete _0x320203[_0xc3c2('0x47')]['id'];}return db[_0xc3c2('0x29')][_0xc3c2('0x4d')]({'where':{'id':_0x320203[_0xc3c2('0x41')]['id']}})[_0xc3c2('0x22')](handleEntityNotFound(_0x2684db,null))['then'](function(_0x2e7dee){if(_0x2e7dee){_0x320203[_0xc3c2('0x47')][_0xc3c2('0x4e')]=_0x2e7dee['id'];_0x320203[_0xc3c2('0x47')][_0xc3c2('0x4f')]=integrations[_0xc3c2('0x50')](_0x320203['body'][_0xc3c2('0x51')],_0x320203['body'][_0xc3c2('0x2c')]);_0x320203[_0xc3c2('0x47')][_0xc3c2('0x52')]=integrations['getDescriptions'](_0x320203[_0xc3c2('0x47')][_0xc3c2('0x51')],_0x320203['body'][_0xc3c2('0x2c')]);return db[_0xc3c2('0x4a')][_0xc3c2('0x46')](_0x320203[_0xc3c2('0x47')],{'include':[{'model':db[_0xc3c2('0x53')],'as':_0xc3c2('0x4f')},{'model':db[_0xc3c2('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2684db,null))[_0xc3c2('0x3f')](handleError(_0x2684db,null));};exports[_0xc3c2('0x54')]=function(_0x36eef2,_0x2cc71c,_0x554baa){var _0x5371dc='';return db[_0xc3c2('0x29')][_0xc3c2('0x4d')]({'where':{'id':_0x36eef2[_0xc3c2('0x41')]['id']},'attributes':['id',_0xc3c2('0x55'),'apiKey']})[_0xc3c2('0x22')](handleEntityNotFound(_0x2cc71c,null))[_0xc3c2('0x22')](function(_0x24d1d8){if(_0x24d1d8){_0x5371dc=_0x24d1d8[_0xc3c2('0x55')];var _0x1324a6=_0x5371dc[_0xc3c2('0x56')](-0x1);if(_0x1324a6==='/'){_0x5371dc=_0x5371dc[_0xc3c2('0x57')](0x0,_0x5371dc[_0xc3c2('0x58')](_0x1324a6));}return rp({'method':_0xc3c2('0x59'),'uri':util[_0xc3c2('0x5a')](_0xc3c2('0x5b'),_0x5371dc,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xc3c2('0x5a')](_0xc3c2('0x5c'),_0x24d1d8[_0xc3c2('0x5d')]))[_0xc3c2('0x5e')](_0xc3c2('0x5f')))},'json':!![]});}})['then'](function(_0x10d3db){if(_0x10d3db){var _0x3f2bb7=[_0xc3c2('0x60'),_0xc3c2('0x61'),_0xc3c2('0x62'),_0xc3c2('0x63'),_0xc3c2('0x18'),'priority',_0xc3c2('0x64'),_0xc3c2('0x65'),_0xc3c2('0x66'),_0xc3c2('0x64'),_0xc3c2('0x67')];_[_0xc3c2('0x68')](_0x10d3db,function(_0x50e4e7){return _0x3f2bb7[_0xc3c2('0x69')](_0x50e4e7[_0xc3c2('0x25')])||!_0x50e4e7[_0xc3c2('0x6a')]&&_0x50e4e7[_0xc3c2('0x2c')]!=='custom_text'&&_0x50e4e7['type']!==_0xc3c2('0x6b');});return{'count':_0x10d3db['length'],'rows':_[_0xc3c2('0x28')](_0x10d3db,function(_0x366d15){return{'id':_0x366d15[_0xc3c2('0x25')],'name':_0x366d15['label'],'custom':!_0x366d15[_0xc3c2('0x6a')],'options':_0x366d15[_0xc3c2('0x6c')]?_[_0xc3c2('0x28')](_0x366d15[_0xc3c2('0x6c')],function(_0x44501f){return{'name':_['capitalize'](_0x44501f),'value':_0x44501f};}):[]};})};}})[_0xc3c2('0x22')](respondWithResult(_0x2cc71c,null))[_0xc3c2('0x3f')](function(_0x32650a){var _0x34d990=_0x36eef2[_0xc3c2('0x2d')][_0xc3c2('0x6d')]?0x1f4:_0x32650a[_0xc3c2('0x6e')]||0x1f4;logger[_0xc3c2('0x23')](_0xc3c2('0x6f'),_0xc3c2('0x54'),_0x34d990,JSON[_0xc3c2('0x70')](_0x32650a));delete _0x32650a['name'];if(_0x34d990===0x191){_0x34d990=0x190;}_0x2cc71c['status'](_0x34d990)[_0xc3c2('0x26')](_0x36eef2[_0xc3c2('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x32650a['statusCode']}:_0x32650a);});}; \ No newline at end of file +var _0x8ce8=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','AccountId','channel','Subjects','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','format','Basic\x20%s','requester','agent','description','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x55ca22,_0x59eda1){var _0x4eff83=function(_0xf763ce){while(--_0xf763ce){_0x55ca22['push'](_0x55ca22['shift']());}};_0x4eff83(++_0x59eda1);}(_0x8ce8,0xd3));var _0x88ce=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x8ce8[_0x18cac4];return _0x2227c6;};'use strict';var emlformat=require(_0x88ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88ce('0x1'));var jsonpatch=require(_0x88ce('0x2'));var rp=require(_0x88ce('0x3'));var moment=require(_0x88ce('0x4'));var BPromise=require(_0x88ce('0x5'));var Mustache=require(_0x88ce('0x6'));var util=require(_0x88ce('0x7'));var path=require(_0x88ce('0x8'));var sox=require(_0x88ce('0x9'));var csv=require(_0x88ce('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88ce('0xb'));var squel=require(_0x88ce('0xc'));var crypto=require(_0x88ce('0xd'));var jsforce=require(_0x88ce('0xe'));var deskjs=require(_0x88ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88ce('0x10'));var Papa=require('papaparse');var Redis=require(_0x88ce('0x11'));var authService=require(_0x88ce('0x12'));var qs=require(_0x88ce('0x13'));var as=require(_0x88ce('0x14'));var hardwareService=require(_0x88ce('0x15'));var logger=require(_0x88ce('0x16'))(_0x88ce('0x17'));var utils=require(_0x88ce('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x88ce('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x88ce('0x1a'));function respondWithStatusCode(_0x3b67c8,_0x50b088){_0x50b088=_0x50b088||0xcc;return function(_0x4f06d1){if(_0x4f06d1){return _0x3b67c8[_0x88ce('0x1b')](_0x50b088);}return _0x3b67c8[_0x88ce('0x1c')](_0x50b088)[_0x88ce('0x1d')]();};}function respondWithResult(_0xad722b,_0x417896){_0x417896=_0x417896||0xc8;return function(_0x210e70){if(_0x210e70){return _0xad722b[_0x88ce('0x1c')](_0x417896)['json'](_0x210e70);}};}function respondWithFilteredResult(_0x3460e5,_0x5bcd5a){return function(_0x3da93e){if(_0x3da93e){var _0x58d3da=typeof _0x5bcd5a[_0x88ce('0x1e')]===_0x88ce('0x1f')&&typeof _0x5bcd5a[_0x88ce('0x20')]===_0x88ce('0x1f');var _0x509a84=_0x3da93e['count'];var _0xdb0d1f=_0x58d3da?0x0:_0x5bcd5a[_0x88ce('0x1e')];var _0x404df9=_0x58d3da?_0x3da93e[_0x88ce('0x21')]:_0x5bcd5a[_0x88ce('0x1e')]+_0x5bcd5a[_0x88ce('0x20')];var _0x461a8a;if(_0x404df9>=_0x509a84){_0x404df9=_0x509a84;_0x461a8a=0xc8;}else{_0x461a8a=0xce;}_0x3460e5[_0x88ce('0x1c')](_0x461a8a);return _0x3460e5[_0x88ce('0x22')](_0x88ce('0x23'),_0xdb0d1f+'-'+_0x404df9+'/'+_0x509a84)[_0x88ce('0x24')](_0x3da93e);}return null;};}function patchUpdates(_0x7de0ac){return function(_0xbe7eff){try{jsonpatch[_0x88ce('0x25')](_0xbe7eff,_0x7de0ac,!![]);}catch(_0x218308){return BPromise[_0x88ce('0x26')](_0x218308);}return _0xbe7eff['save']();};}function saveUpdates(_0x356d7d,_0x34fbcc){return function(_0x3bb68b){if(_0x3bb68b){return _0x3bb68b[_0x88ce('0x27')](_0x356d7d)[_0x88ce('0x28')](function(_0x4e45eb){return _0x4e45eb;});}return null;};}function removeEntity(_0x4c9133,_0x4dcdc4){return function(_0x22c911){if(_0x22c911){return _0x22c911[_0x88ce('0x29')]()[_0x88ce('0x28')](function(){_0x4c9133['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0adc,_0x3383fa){return function(_0x1b9d39){if(!_0x1b9d39){_0x1f0adc[_0x88ce('0x1b')](0x194);}return _0x1b9d39;};}function handleError(_0x4b30db,_0x1efcea){_0x1efcea=_0x1efcea||0x1f4;return function(_0x19f00f){logger[_0x88ce('0x2a')](_0x19f00f[_0x88ce('0x2b')]);if(_0x19f00f[_0x88ce('0x2c')]){delete _0x19f00f[_0x88ce('0x2c')];}_0x4b30db[_0x88ce('0x1c')](_0x1efcea)[_0x88ce('0x2d')](_0x19f00f);};}exports[_0x88ce('0x2e')]=function(_0x12b9a1,_0x1814d1){var _0x47bbff={},_0x4f4205={},_0x5ceb03={'count':0x0,'rows':[]};var _0x157a28=_[_0x88ce('0x2f')](db[_0x88ce('0x30')][_0x88ce('0x31')],function(_0x544be7){return{'name':_0x544be7[_0x88ce('0x32')],'type':_0x544be7[_0x88ce('0x33')][_0x88ce('0x34')]};});_0x4f4205[_0x88ce('0x35')]=_[_0x88ce('0x2f')](_0x157a28,_0x88ce('0x2c'));_0x4f4205[_0x88ce('0x36')]=_['keys'](_0x12b9a1[_0x88ce('0x36')]);_0x4f4205[_0x88ce('0x37')]=_['intersection'](_0x4f4205[_0x88ce('0x35')],_0x4f4205[_0x88ce('0x36')]);_0x47bbff[_0x88ce('0x38')]=_[_0x88ce('0x39')](_0x4f4205[_0x88ce('0x35')],qs[_0x88ce('0x3a')](_0x12b9a1[_0x88ce('0x36')][_0x88ce('0x3a')]));_0x47bbff[_0x88ce('0x38')]=_0x47bbff['attributes'][_0x88ce('0x3b')]?_0x47bbff[_0x88ce('0x38')]:_0x4f4205[_0x88ce('0x35')];if(!_0x12b9a1['query'][_0x88ce('0x3c')](_0x88ce('0x3d'))){_0x47bbff['limit']=qs['limit'](_0x12b9a1[_0x88ce('0x36')][_0x88ce('0x20')]);_0x47bbff[_0x88ce('0x1e')]=qs[_0x88ce('0x1e')](_0x12b9a1[_0x88ce('0x36')][_0x88ce('0x1e')]);}_0x47bbff['order']=qs[_0x88ce('0x3e')](_0x12b9a1[_0x88ce('0x36')]['sort']);_0x47bbff[_0x88ce('0x3f')]=qs[_0x88ce('0x37')](_['pick'](_0x12b9a1[_0x88ce('0x36')],_0x4f4205['filters']),_0x157a28);if(_0x12b9a1[_0x88ce('0x36')][_0x88ce('0x40')]){_0x47bbff[_0x88ce('0x3f')]=_[_0x88ce('0x41')](_0x47bbff[_0x88ce('0x3f')],{'$or':_[_0x88ce('0x2f')](_0x157a28,function(_0x4e9b91){if(_0x4e9b91[_0x88ce('0x33')]!==_0x88ce('0x42')){var _0x24172a={};_0x24172a[_0x4e9b91[_0x88ce('0x2c')]]={'$like':'%'+_0x12b9a1['query'][_0x88ce('0x40')]+'%'};return _0x24172a;}})});}_0x47bbff=_[_0x88ce('0x41')]({},_0x47bbff,_0x12b9a1[_0x88ce('0x43')]);var _0x4cc1c2={'where':_0x47bbff['where']};return db[_0x88ce('0x30')][_0x88ce('0x21')](_0x4cc1c2)[_0x88ce('0x28')](function(_0x512e49){_0x5ceb03[_0x88ce('0x21')]=_0x512e49;if(_0x12b9a1[_0x88ce('0x36')]['includeAll']){_0x47bbff[_0x88ce('0x44')]=[{'all':!![]}];}return db[_0x88ce('0x30')][_0x88ce('0x45')](_0x47bbff);})[_0x88ce('0x28')](function(_0x3a4898){_0x5ceb03['rows']=_0x3a4898;return _0x5ceb03;})[_0x88ce('0x28')](respondWithFilteredResult(_0x1814d1,_0x47bbff))[_0x88ce('0x46')](handleError(_0x1814d1,null));};exports[_0x88ce('0x47')]=function(_0x123c83,_0x8132cc){var _0x29d440={'raw':![],'where':{'id':_0x123c83['params']['id']}},_0x39bfb8={};_0x39bfb8[_0x88ce('0x35')]=_[_0x88ce('0x48')](db['FreshdeskAccount'][_0x88ce('0x31')]);_0x39bfb8[_0x88ce('0x36')]=_['keys'](_0x123c83['query']);_0x39bfb8['filters']=_[_0x88ce('0x39')](_0x39bfb8[_0x88ce('0x35')],_0x39bfb8[_0x88ce('0x36')]);_0x29d440[_0x88ce('0x38')]=_[_0x88ce('0x39')](_0x39bfb8[_0x88ce('0x35')],qs[_0x88ce('0x3a')](_0x123c83['query'][_0x88ce('0x3a')]));_0x29d440['attributes']=_0x29d440[_0x88ce('0x38')][_0x88ce('0x3b')]?_0x29d440[_0x88ce('0x38')]:_0x39bfb8['model'];if(_0x123c83[_0x88ce('0x36')]['includeAll']){_0x29d440[_0x88ce('0x44')]=[{'all':!![]}];}_0x29d440=_[_0x88ce('0x41')]({},_0x29d440,_0x123c83[_0x88ce('0x43')]);return db[_0x88ce('0x30')][_0x88ce('0x49')](_0x29d440)[_0x88ce('0x28')](handleEntityNotFound(_0x8132cc,null))[_0x88ce('0x28')](respondWithResult(_0x8132cc,null))['catch'](handleError(_0x8132cc,null));};exports[_0x88ce('0x4a')]=function(_0x260015,_0x11f7b6){return db[_0x88ce('0x30')]['create'](_0x260015['body'],{})[_0x88ce('0x28')](respondWithResult(_0x11f7b6,0xc9))[_0x88ce('0x46')](handleError(_0x11f7b6,null));};exports[_0x88ce('0x27')]=function(_0x46d70a,_0x23967c){if(_0x46d70a[_0x88ce('0x4b')]['id']){delete _0x46d70a[_0x88ce('0x4b')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x46d70a[_0x88ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23967c,null))['then'](saveUpdates(_0x46d70a['body'],null))[_0x88ce('0x28')](respondWithResult(_0x23967c,null))['catch'](handleError(_0x23967c,null));};exports[_0x88ce('0x29')]=function(_0x23ca86,_0x2e6918){return db[_0x88ce('0x30')][_0x88ce('0x49')]({'where':{'id':_0x23ca86[_0x88ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e6918,null))['then'](removeEntity(_0x2e6918,null))[_0x88ce('0x46')](handleError(_0x2e6918,null));};exports[_0x88ce('0x4d')]=function(_0x1c9e37,_0x1b961c,_0x4a8ec2){var _0x4c37c9={};var _0x464e80={};var _0x4877a3;var _0x36524e;return db[_0x88ce('0x30')][_0x88ce('0x4e')]({'where':{'id':_0x1c9e37[_0x88ce('0x4c')]['id']}})[_0x88ce('0x28')](handleEntityNotFound(_0x1b961c,null))[_0x88ce('0x28')](function(_0x3b9708){if(_0x3b9708){_0x4877a3=_0x3b9708;_0x464e80[_0x88ce('0x35')]=_[_0x88ce('0x48')](db[_0x88ce('0x4f')][_0x88ce('0x31')]);_0x464e80['query']=_[_0x88ce('0x48')](_0x1c9e37[_0x88ce('0x36')]);_0x464e80[_0x88ce('0x37')]=_[_0x88ce('0x39')](_0x464e80[_0x88ce('0x35')],_0x464e80[_0x88ce('0x36')]);_0x4c37c9['attributes']=_[_0x88ce('0x39')](_0x464e80['model'],qs[_0x88ce('0x3a')](_0x1c9e37[_0x88ce('0x36')][_0x88ce('0x3a')]));_0x4c37c9[_0x88ce('0x38')]=_0x4c37c9[_0x88ce('0x38')]['length']?_0x4c37c9[_0x88ce('0x38')]:_0x464e80[_0x88ce('0x35')];_0x4c37c9['order']=qs[_0x88ce('0x3e')](_0x1c9e37['query'][_0x88ce('0x3e')]);_0x4c37c9[_0x88ce('0x3f')]=qs[_0x88ce('0x37')](_['pick'](_0x1c9e37[_0x88ce('0x36')],_0x464e80[_0x88ce('0x37')]));if(_0x1c9e37[_0x88ce('0x36')][_0x88ce('0x40')]){_0x4c37c9[_0x88ce('0x3f')]=_[_0x88ce('0x41')](_0x4c37c9[_0x88ce('0x3f')],{'$or':_[_0x88ce('0x2f')](_0x4c37c9[_0x88ce('0x38')],function(_0x58e019){var _0x49d9fd={};_0x49d9fd[_0x58e019]={'$like':'%'+_0x1c9e37[_0x88ce('0x36')][_0x88ce('0x40')]+'%'};return _0x49d9fd;})});}_0x4c37c9=_[_0x88ce('0x41')]({},_0x4c37c9,_0x1c9e37['options']);return _0x4877a3[_0x88ce('0x4d')](_0x4c37c9);}})['then'](function(_0x4bcd10){if(_0x4bcd10){_0x36524e=_0x4bcd10['length'];if(!_0x1c9e37[_0x88ce('0x36')]['hasOwnProperty'](_0x88ce('0x3d'))){_0x4c37c9[_0x88ce('0x20')]=qs[_0x88ce('0x20')](_0x1c9e37['query'][_0x88ce('0x20')]);_0x4c37c9['offset']=qs[_0x88ce('0x1e')](_0x1c9e37[_0x88ce('0x36')][_0x88ce('0x1e')]);}return _0x4877a3[_0x88ce('0x4d')](_0x4c37c9);}})['then'](function(_0x38e936){if(_0x38e936){return _0x38e936?{'count':_0x36524e,'rows':_0x38e936}:null;}})[_0x88ce('0x28')](respondWithResult(_0x1b961c,null))[_0x88ce('0x46')](handleError(_0x1b961c,null));};exports['addConfiguration']=function(_0x590d79,_0x5cddfd,_0x3e4a6b){if(_0x590d79[_0x88ce('0x4b')]['id']){delete _0x590d79[_0x88ce('0x4b')]['id'];}return db[_0x88ce('0x30')]['findOne']({'where':{'id':_0x590d79['params']['id']}})['then'](handleEntityNotFound(_0x5cddfd,null))[_0x88ce('0x28')](function(_0x287a7d){if(_0x287a7d){_0x590d79[_0x88ce('0x4b')][_0x88ce('0x50')]=_0x287a7d['id'];_0x590d79[_0x88ce('0x4b')]['Subjects']=integrations['getSubjects'](_0x590d79[_0x88ce('0x4b')][_0x88ce('0x51')],_0x590d79[_0x88ce('0x4b')][_0x88ce('0x33')]);_0x590d79[_0x88ce('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x590d79[_0x88ce('0x4b')][_0x88ce('0x51')],_0x590d79[_0x88ce('0x4b')][_0x88ce('0x33')]);return db['FreshdeskConfiguration'][_0x88ce('0x4a')](_0x590d79['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x88ce('0x52')},{'model':db[_0x88ce('0x53')],'as':_0x88ce('0x54')}]});}return null;})[_0x88ce('0x28')](respondWithResult(_0x5cddfd,null))[_0x88ce('0x46')](handleError(_0x5cddfd,null));};exports[_0x88ce('0x55')]=function(_0x19d365,_0x1f34d1,_0x41fc76){var _0x26d167='';return db[_0x88ce('0x30')][_0x88ce('0x4e')]({'where':{'id':_0x19d365[_0x88ce('0x4c')]['id']},'attributes':['id',_0x88ce('0x56'),_0x88ce('0x57')]})[_0x88ce('0x28')](handleEntityNotFound(_0x1f34d1,null))[_0x88ce('0x28')](function(_0x458343){if(_0x458343){_0x26d167=_0x458343[_0x88ce('0x56')];var _0x4c182b=_0x26d167['slice'](-0x1);if(_0x4c182b==='/'){_0x26d167=_0x26d167[_0x88ce('0x58')](0x0,_0x26d167[_0x88ce('0x59')](_0x4c182b));}return rp({'method':_0x88ce('0x5a'),'uri':util['format'](_0x88ce('0x5b'),_0x26d167,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x88ce('0x5c')](_0x88ce('0x5d'),new Buffer(util[_0x88ce('0x5c')]('%s:X',_0x458343['apiKey']))['toString']('base64'))},'json':!![]});}})['then'](function(_0x5220cc){if(_0x5220cc){var _0x3359ea=[_0x88ce('0x5e'),'subject',_0x88ce('0x5f'),_0x88ce('0x60'),_0x88ce('0x1c'),_0x88ce('0x61'),_0x88ce('0x62'),_0x88ce('0x63'),_0x88ce('0x64'),_0x88ce('0x62'),_0x88ce('0x65')];_[_0x88ce('0x66')](_0x5220cc,function(_0x168fd9){return _0x3359ea[_0x88ce('0x67')](_0x168fd9[_0x88ce('0x2c')])||!_0x168fd9['default']&&_0x168fd9['type']!==_0x88ce('0x68')&&_0x168fd9[_0x88ce('0x33')]!==_0x88ce('0x69');});return{'count':_0x5220cc[_0x88ce('0x3b')],'rows':_['map'](_0x5220cc,function(_0x2fb876){return{'id':_0x2fb876[_0x88ce('0x2c')],'name':_0x2fb876[_0x88ce('0x6a')],'custom':!_0x2fb876['default'],'options':_0x2fb876['choices']?_[_0x88ce('0x2f')](_0x2fb876[_0x88ce('0x6b')],function(_0x15ea43){return{'name':_[_0x88ce('0x6c')](_0x15ea43),'value':_0x15ea43};}):[]};})};}})['then'](respondWithResult(_0x1f34d1,null))[_0x88ce('0x46')](function(_0x12063a){var _0x2725b1=_0x19d365[_0x88ce('0x36')][_0x88ce('0x6d')]?0x1f4:_0x12063a[_0x88ce('0x6e')]||0x1f4;logger[_0x88ce('0x2a')](_0x88ce('0x6f'),_0x88ce('0x55'),_0x2725b1,JSON[_0x88ce('0x70')](_0x12063a));delete _0x12063a[_0x88ce('0x2c')];if(_0x2725b1===0x191){_0x2725b1=0x190;}_0x1f34d1['status'](_0x2725b1)[_0x88ce('0x2d')](_0x19d365[_0x88ce('0x36')][_0x88ce('0x6d')]?{'message':_0x88ce('0x71'),'statusCode':_0x12063a['statusCode']}:_0x12063a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 8d137d1..8d1e959 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 _0xc13c=['../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc13c,0x1e0));var _0xcc13=function(_0x210561,_0x3c1c59){_0x210561=_0x210561-0x0;var _0x435afc=_0xc13c[_0x210561];return _0x435afc;};'use strict';var _=require(_0xcc13('0x0'));var util=require('util');var logger=require(_0xcc13('0x1'))(_0xcc13('0x2'));var moment=require(_0xcc13('0x3'));var BPromise=require(_0xcc13('0x4'));var rp=require(_0xcc13('0x5'));var fs=require('fs');var path=require(_0xcc13('0x6'));var rimraf=require(_0xcc13('0x7'));var config=require(_0xcc13('0x8'));var attributes=require(_0xcc13('0x9'));var integrations=require(_0xcc13('0xa'));module[_0xcc13('0xb')]=function(_0x3effd4,_0x3b664d){return _0x3effd4[_0xcc13('0xc')](_0xcc13('0xd'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c24=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36135b,_0x19dbfd){var _0x55570c=function(_0x5aed40){while(--_0x5aed40){_0x36135b['push'](_0x36135b['shift']());}};_0x55570c(++_0x19dbfd);}(_0x0c24,0x18e));var _0x40c2=function(_0x7f82c7,_0x2bec9d){_0x7f82c7=_0x7f82c7-0x0;var _0xccd46=_0x0c24[_0x7f82c7];return _0xccd46;};'use strict';var _=require(_0x40c2('0x0'));var util=require(_0x40c2('0x1'));var logger=require(_0x40c2('0x2'))(_0x40c2('0x3'));var moment=require(_0x40c2('0x4'));var BPromise=require(_0x40c2('0x5'));var rp=require(_0x40c2('0x6'));var fs=require('fs');var path=require(_0x40c2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x40c2('0x8'));var integrations=require(_0x40c2('0x9'));module[_0x40c2('0xa')]=function(_0x2584fb,_0x115283){return _0x2584fb[_0x40c2('0xb')](_0x40c2('0xc'),attributes,{'tableName':_0x40c2('0xd'),'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 364948c..e5ebe69 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 _0x5b9c=['message','result','catch','GetFreshdeskAccount','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b9c,0x1a6));var _0xc5b9=function(_0x48783b,_0x2cfe53){_0x48783b=_0x48783b-0x0;var _0x1436d5=_0x5b9c[_0x48783b];return _0x1436d5;};'use strict';var _=require(_0xc5b9('0x0'));var util=require(_0xc5b9('0x1'));var moment=require(_0xc5b9('0x2'));var BPromise=require(_0xc5b9('0x3'));var rs=require(_0xc5b9('0x4'));var fs=require('fs');var Redis=require(_0xc5b9('0x5'));var db=require(_0xc5b9('0x6'))['db'];var utils=require(_0xc5b9('0x7'));var logger=require('../../config/logger')(_0xc5b9('0x8'));var config=require(_0xc5b9('0x9'));var jayson=require(_0xc5b9('0xa'));var client=jayson[_0xc5b9('0xb')][_0xc5b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x258c2d,_0xf835ee,_0x35a3a2){return new BPromise(function(_0x13dc3,_0x40b1fb){return client[_0xc5b9('0xd')](_0x258c2d,_0x35a3a2)[_0xc5b9('0xe')](function(_0x4026f6){logger[_0xc5b9('0xf')](_0xc5b9('0x10'),_0xf835ee,'request\x20sent');logger[_0xc5b9('0x11')](_0xc5b9('0x12'),_0xf835ee,_0xc5b9('0x13'),JSON[_0xc5b9('0x14')](_0x4026f6));if(_0x4026f6[_0xc5b9('0x15')]){if(_0x4026f6[_0xc5b9('0x15')]['code']===0x1f4){logger[_0xc5b9('0x15')](_0xc5b9('0x10'),_0xf835ee,_0x4026f6[_0xc5b9('0x15')][_0xc5b9('0x16')]);return _0x40b1fb(_0x4026f6['error']['message']);}logger[_0xc5b9('0x15')](_0xc5b9('0x10'),_0xf835ee,_0x4026f6[_0xc5b9('0x15')]['message']);return _0x13dc3(_0x4026f6['error'][_0xc5b9('0x16')]);}else{logger[_0xc5b9('0xf')](_0xc5b9('0x10'),_0xf835ee,_0xc5b9('0x13'));_0x13dc3(_0x4026f6[_0xc5b9('0x17')]['message']);}})[_0xc5b9('0x18')](function(_0x313931){logger[_0xc5b9('0x15')](_0xc5b9('0x10'),_0xf835ee,_0x313931);_0x40b1fb(_0x313931);});});}exports[_0xc5b9('0x19')]=function(_0x4f2c5e){var _0x280e7e=this;return new Promise(function(_0xe05539,_0x4bedbe){return db['FreshdeskAccount']['findAll']({'raw':_0x4f2c5e[_0xc5b9('0x1a')]?_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f2c5e[_0xc5b9('0x1a')]?_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1c')]||null:null,'attributes':_0x4f2c5e[_0xc5b9('0x1a')]?_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1d')]||null:null,'limit':_0x4f2c5e[_0xc5b9('0x1a')]?_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1e')]||null:null,'include':_0x4f2c5e[_0xc5b9('0x1a')]?_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1f')]?_[_0xc5b9('0x20')](_0x4f2c5e[_0xc5b9('0x1a')][_0xc5b9('0x1f')],function(_0x258327){return{'model':db[_0x258327[_0xc5b9('0x21')]],'as':_0x258327['as'],'attributes':_0x258327['attributes'],'include':_0x258327['include']?_[_0xc5b9('0x20')](_0x258327[_0xc5b9('0x1f')],function(_0x199635){return{'model':db[_0x199635[_0xc5b9('0x21')]],'as':_0x199635['as'],'attributes':_0x199635['attributes'],'include':_0x199635[_0xc5b9('0x1f')]?_['map'](_0x199635[_0xc5b9('0x1f')],function(_0x417d6a){return{'model':db[_0x417d6a[_0xc5b9('0x21')]],'as':_0x417d6a['as'],'attributes':_0x417d6a[_0xc5b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc5b9('0xe')](function(_0x58d438){logger[_0xc5b9('0xf')]('GetFreshdeskAccount',_0x4f2c5e);logger[_0xc5b9('0x11')](_0xc5b9('0x19'),_0x4f2c5e,JSON[_0xc5b9('0x14')](_0x58d438));_0xe05539(_0x58d438);})[_0xc5b9('0x18')](function(_0xf4717b){logger[_0xc5b9('0x15')](_0xc5b9('0x19'),_0xf4717b['message'],_0x4f2c5e);_0x4bedbe(_0x280e7e[_0xc5b9('0x15')](0x1f4,_0xf4717b[_0xc5b9('0x16')]));});});};exports[_0xc5b9('0x22')]=function(_0x2c854c){var _0x15d672=this;return new Promise(function(_0x386fdf,_0x40fbc9){return db[_0xc5b9('0x23')][_0xc5b9('0x24')]({'raw':_0x2c854c[_0xc5b9('0x1a')]?_0x2c854c['options'][_0xc5b9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c854c[_0xc5b9('0x1a')]?_0x2c854c[_0xc5b9('0x1a')][_0xc5b9('0x1c')]||null:null,'attributes':_0x2c854c[_0xc5b9('0x1a')]?_0x2c854c[_0xc5b9('0x1a')][_0xc5b9('0x1d')]||null:null,'include':_0x2c854c[_0xc5b9('0x1a')]?_0x2c854c[_0xc5b9('0x1a')][_0xc5b9('0x1f')]?_[_0xc5b9('0x20')](_0x2c854c['options']['include'],function(_0x132802){return{'model':db[_0x132802[_0xc5b9('0x21')]],'as':_0x132802['as'],'attributes':_0x132802[_0xc5b9('0x1d')],'include':_0x132802[_0xc5b9('0x1f')]?_['map'](_0x132802[_0xc5b9('0x1f')],function(_0x27b5d3){return{'model':db[_0x27b5d3[_0xc5b9('0x21')]],'as':_0x27b5d3['as'],'attributes':_0x27b5d3[_0xc5b9('0x1d')],'include':_0x27b5d3[_0xc5b9('0x1f')]?_['map'](_0x27b5d3[_0xc5b9('0x1f')],function(_0x36c568){return{'model':db[_0x36c568[_0xc5b9('0x21')]],'as':_0x36c568['as'],'attributes':_0x36c568['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5b9('0xe')](function(_0x22c14d){logger[_0xc5b9('0xf')]('ShowFreshdeskAccount',_0x2c854c);logger[_0xc5b9('0x11')](_0xc5b9('0x22'),_0x2c854c,JSON[_0xc5b9('0x14')](_0x22c14d));_0x386fdf(_0x22c14d);})[_0xc5b9('0x18')](function(_0xcb1f77){logger[_0xc5b9('0x15')]('ShowFreshdeskAccount',_0xcb1f77['message'],_0x2c854c);_0x40fbc9(_0x15d672[_0xc5b9('0x15')](0x1f4,_0xcb1f77[_0xc5b9('0x16')]));});});}; \ No newline at end of file +var _0x7b1f=['client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','FreshdeskAccount','findAll','options','where','limit','include','model','map','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x1b8698,_0x39f9ae){var _0x4dc169=function(_0x41c972){while(--_0x41c972){_0x1b8698['push'](_0x1b8698['shift']());}};_0x4dc169(++_0x39f9ae);}(_0x7b1f,0xab));var _0xf7b1=function(_0x30900b,_0x2c1d22){_0x30900b=_0x30900b-0x0;var _0x14cfa1=_0x7b1f[_0x30900b];return _0x14cfa1;};'use strict';var _=require(_0xf7b1('0x0'));var util=require(_0xf7b1('0x1'));var moment=require(_0xf7b1('0x2'));var BPromise=require(_0xf7b1('0x3'));var rs=require(_0xf7b1('0x4'));var fs=require('fs');var Redis=require(_0xf7b1('0x5'));var db=require(_0xf7b1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf7b1('0x7'));var jayson=require(_0xf7b1('0x8'));var client=jayson[_0xf7b1('0x9')][_0xf7b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed3519,_0x3f10f8,_0x1be49b){return new BPromise(function(_0x269e6b,_0xab5852){return client[_0xf7b1('0xb')](_0xed3519,_0x1be49b)['then'](function(_0x549a54){logger[_0xf7b1('0xc')](_0xf7b1('0xd'),_0x3f10f8,'request\x20sent');logger[_0xf7b1('0xe')](_0xf7b1('0xf'),_0x3f10f8,'request\x20sent',JSON[_0xf7b1('0x10')](_0x549a54));if(_0x549a54['error']){if(_0x549a54['error'][_0xf7b1('0x11')]===0x1f4){logger[_0xf7b1('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f10f8,_0x549a54[_0xf7b1('0x12')][_0xf7b1('0x13')]);return _0xab5852(_0x549a54[_0xf7b1('0x12')][_0xf7b1('0x13')]);}logger[_0xf7b1('0x12')](_0xf7b1('0xd'),_0x3f10f8,_0x549a54['error'][_0xf7b1('0x13')]);return _0x269e6b(_0x549a54[_0xf7b1('0x12')][_0xf7b1('0x13')]);}else{logger['info'](_0xf7b1('0xd'),_0x3f10f8,_0xf7b1('0x14'));_0x269e6b(_0x549a54[_0xf7b1('0x15')][_0xf7b1('0x13')]);}})[_0xf7b1('0x16')](function(_0x280010){logger[_0xf7b1('0x12')](_0xf7b1('0xd'),_0x3f10f8,_0x280010);_0xab5852(_0x280010);});});}exports['GetFreshdeskAccount']=function(_0x476c7f){var _0x2d0f11=this;return new Promise(function(_0x27d32e,_0x677f7b){return db[_0xf7b1('0x17')][_0xf7b1('0x18')]({'raw':_0x476c7f[_0xf7b1('0x19')]?_0x476c7f[_0xf7b1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x476c7f['options']?_0x476c7f[_0xf7b1('0x19')][_0xf7b1('0x1a')]||null:null,'attributes':_0x476c7f[_0xf7b1('0x19')]?_0x476c7f['options']['attributes']||null:null,'limit':_0x476c7f[_0xf7b1('0x19')]?_0x476c7f[_0xf7b1('0x19')][_0xf7b1('0x1b')]||null:null,'include':_0x476c7f[_0xf7b1('0x19')]?_0x476c7f[_0xf7b1('0x19')][_0xf7b1('0x1c')]?_['map'](_0x476c7f[_0xf7b1('0x19')][_0xf7b1('0x1c')],function(_0x5d1903){return{'model':db[_0x5d1903[_0xf7b1('0x1d')]],'as':_0x5d1903['as'],'attributes':_0x5d1903['attributes'],'include':_0x5d1903['include']?_[_0xf7b1('0x1e')](_0x5d1903[_0xf7b1('0x1c')],function(_0x103b54){return{'model':db[_0x103b54[_0xf7b1('0x1d')]],'as':_0x103b54['as'],'attributes':_0x103b54[_0xf7b1('0x1f')],'include':_0x103b54[_0xf7b1('0x1c')]?_[_0xf7b1('0x1e')](_0x103b54['include'],function(_0x1b9b33){return{'model':db[_0x1b9b33['model']],'as':_0x1b9b33['as'],'attributes':_0x1b9b33[_0xf7b1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cb8c5){logger[_0xf7b1('0xc')](_0xf7b1('0x20'),_0x476c7f);logger[_0xf7b1('0xe')](_0xf7b1('0x20'),_0x476c7f,JSON[_0xf7b1('0x10')](_0x5cb8c5));_0x27d32e(_0x5cb8c5);})[_0xf7b1('0x16')](function(_0x47902e){logger['error']('GetFreshdeskAccount',_0x47902e[_0xf7b1('0x13')],_0x476c7f);_0x677f7b(_0x2d0f11['error'](0x1f4,_0x47902e['message']));});});};exports[_0xf7b1('0x21')]=function(_0x3788be){var _0x5b83e0=this;return new Promise(function(_0x5d373b,_0x51ef3c){return db['FreshdeskAccount'][_0xf7b1('0x22')]({'raw':_0x3788be[_0xf7b1('0x19')]?_0x3788be[_0xf7b1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3788be[_0xf7b1('0x19')]?_0x3788be[_0xf7b1('0x19')][_0xf7b1('0x1a')]||null:null,'attributes':_0x3788be[_0xf7b1('0x19')]?_0x3788be['options'][_0xf7b1('0x1f')]||null:null,'include':_0x3788be['options']?_0x3788be[_0xf7b1('0x19')][_0xf7b1('0x1c')]?_[_0xf7b1('0x1e')](_0x3788be[_0xf7b1('0x19')][_0xf7b1('0x1c')],function(_0x36efcc){return{'model':db[_0x36efcc[_0xf7b1('0x1d')]],'as':_0x36efcc['as'],'attributes':_0x36efcc['attributes'],'include':_0x36efcc['include']?_['map'](_0x36efcc[_0xf7b1('0x1c')],function(_0x278114){return{'model':db[_0x278114[_0xf7b1('0x1d')]],'as':_0x278114['as'],'attributes':_0x278114['attributes'],'include':_0x278114[_0xf7b1('0x1c')]?_['map'](_0x278114['include'],function(_0x5177d7){return{'model':db[_0x5177d7['model']],'as':_0x5177d7['as'],'attributes':_0x5177d7['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7b1('0x23')](function(_0x18a0ee){logger[_0xf7b1('0xc')](_0xf7b1('0x21'),_0x3788be);logger[_0xf7b1('0xe')](_0xf7b1('0x21'),_0x3788be,JSON['stringify'](_0x18a0ee));_0x5d373b(_0x18a0ee);})[_0xf7b1('0x16')](function(_0x489476){logger[_0xf7b1('0x12')](_0xf7b1('0x21'),_0x489476[_0xf7b1('0x13')],_0x3788be);_0x51ef3c(_0x5b83e0['error'](0x1f4,_0x489476[_0xf7b1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3fc9cc2..f4e9186 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 _0x2034=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2034,0xf7));var _0x4203=function(_0x3a697e,_0x34f5ba){_0x3a697e=_0x3a697e-0x0;var _0x31d6cd=_0x2034[_0x3a697e];return _0x31d6cd;};'use strict';var multer=require(_0x4203('0x0'));var util=require(_0x4203('0x1'));var path=require(_0x4203('0x2'));var timeout=require(_0x4203('0x3'));var express=require(_0x4203('0x4'));var router=express[_0x4203('0x5')]();var fs_extra=require(_0x4203('0x6'));var auth=require(_0x4203('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4203('0x8'));var controller=require(_0x4203('0x9'));router[_0x4203('0xa')]('/',auth[_0x4203('0xb')](),controller[_0x4203('0xc')]);router[_0x4203('0xa')]('/:id',auth[_0x4203('0xb')](),controller['show']);router[_0x4203('0xa')](_0x4203('0xd'),auth[_0x4203('0xb')](),controller[_0x4203('0xe')]);router[_0x4203('0xa')](_0x4203('0xf'),auth[_0x4203('0xb')](),controller[_0x4203('0x10')]);router[_0x4203('0xa')](_0x4203('0x11'),auth[_0x4203('0xb')](),controller[_0x4203('0x12')]);router[_0x4203('0xa')](_0x4203('0x13'),auth['isAuthenticated'](),controller['getTags']);router[_0x4203('0x14')]('/',auth[_0x4203('0xb')](),controller[_0x4203('0x15')]);router[_0x4203('0x14')](_0x4203('0x13'),auth['isAuthenticated'](),controller[_0x4203('0x16')]);router[_0x4203('0x17')](_0x4203('0x18'),auth[_0x4203('0xb')](),controller[_0x4203('0x19')]);router[_0x4203('0x1a')](_0x4203('0x18'),auth['isAuthenticated'](),controller[_0x4203('0x1b')]);module[_0x4203('0x1c')]=router; \ No newline at end of file +var _0x1509=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1f0bba,_0x430c51){var _0x258c06=function(_0x4b905e){while(--_0x4b905e){_0x1f0bba['push'](_0x1f0bba['shift']());}};_0x258c06(++_0x430c51);}(_0x1509,0x10c));var _0x9150=function(_0x416b2e,_0x451413){_0x416b2e=_0x416b2e-0x0;var _0x49d222=_0x1509[_0x416b2e];return _0x49d222;};'use strict';var multer=require(_0x9150('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9150('0x1'));var express=require(_0x9150('0x2'));var router=express[_0x9150('0x3')]();var fs_extra=require(_0x9150('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9150('0x5'));var config=require(_0x9150('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x9150('0x7')]('/',auth[_0x9150('0x8')](),controller['index']);router['get'](_0x9150('0x9'),auth[_0x9150('0x8')](),controller[_0x9150('0xa')]);router[_0x9150('0x7')](_0x9150('0xb'),auth[_0x9150('0x8')](),controller[_0x9150('0xc')]);router['get'](_0x9150('0xd'),auth['isAuthenticated'](),controller[_0x9150('0xe')]);router['get']('/:id/descriptions',auth[_0x9150('0x8')](),controller[_0x9150('0xf')]);router['get'](_0x9150('0x10'),auth[_0x9150('0x8')](),controller[_0x9150('0x11')]);router[_0x9150('0x12')]('/',auth['isAuthenticated'](),controller[_0x9150('0x13')]);router[_0x9150('0x12')](_0x9150('0x10'),auth[_0x9150('0x8')](),controller[_0x9150('0x14')]);router['put'](_0x9150('0x9'),auth['isAuthenticated'](),controller[_0x9150('0x15')]);router[_0x9150('0x16')](_0x9150('0x9'),auth[_0x9150('0x8')](),controller[_0x9150('0x17')]);module[_0x9150('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index db2fb60..13c89b8 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 _0x6da6=['STRING'];(function(_0x496212,_0x5c73b1){var _0xb988eb=function(_0xbf0f4b){while(--_0xbf0f4b){_0x496212['push'](_0x496212['shift']());}};_0xb988eb(++_0x5c73b1);}(_0x6da6,0x1b8));var _0x66da=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x6da6[_0x219fa0];return _0xc603fb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x66da('0x0')]},'description':{'type':Sequelize[_0x66da('0x0')]}}; \ No newline at end of file +var _0xa555=['sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa555,0xe1));var _0x5a55=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0xa555[_0x5ec454];return _0x5ebf50;};'use strict';var Sequelize=require(_0x5a55('0x0'));module[_0x5a55('0x1')]={'name':{'type':Sequelize[_0x5a55('0x2')]},'description':{'type':Sequelize[_0x5a55('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d8fa551..433eac3 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 _0x05bc=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','FreshdeskConfiguration','catch','show','include','find','create','body','params','pick','getFields','getSubjects','findOne','getDescriptions','getTags','setTags','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3a456e,_0x41611a){var _0x45ba81=function(_0x45fded){while(--_0x45fded){_0x3a456e['push'](_0x3a456e['shift']());}};_0x45ba81(++_0x41611a);}(_0x05bc,0x14f));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc05b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc05b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc05b('0x2'));var moment=require(_0xc05b('0x3'));var BPromise=require(_0xc05b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc05b('0x5'));var csv=require(_0xc05b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc05b('0x7'));var _=require(_0xc05b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc05b('0x9'));var toCsv=require(_0xc05b('0x6'));var querystring=require('querystring');var Papa=require(_0xc05b('0xa'));var Redis=require(_0xc05b('0xb'));var authService=require(_0xc05b('0xc'));var qs=require(_0xc05b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc05b('0xe'));var logger=require(_0xc05b('0xf'))(_0xc05b('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x373951,_0xdb9692){_0xdb9692=_0xdb9692||0xcc;return function(_0x76ef61){if(_0x76ef61){return _0x373951[_0xc05b('0x11')](_0xdb9692);}return _0x373951[_0xc05b('0x12')](_0xdb9692)[_0xc05b('0x13')]();};}function respondWithResult(_0x47cf57,_0x16f1fd){_0x16f1fd=_0x16f1fd||0xc8;return function(_0x2cceea){if(_0x2cceea){return _0x47cf57[_0xc05b('0x12')](_0x16f1fd)['json'](_0x2cceea);}};}function respondWithFilteredResult(_0x3a6adb,_0x379650){return function(_0x5b555b){if(_0x5b555b){var _0x673067=typeof _0x379650[_0xc05b('0x14')]===_0xc05b('0x15')&&typeof _0x379650[_0xc05b('0x16')]===_0xc05b('0x15');var _0x422f6c=_0x5b555b[_0xc05b('0x17')];var _0x53a7e7=_0x673067?0x0:_0x379650[_0xc05b('0x14')];var _0x14e697=_0x673067?_0x5b555b[_0xc05b('0x17')]:_0x379650[_0xc05b('0x14')]+_0x379650['limit'];var _0x9ebad1;if(_0x14e697>=_0x422f6c){_0x14e697=_0x422f6c;_0x9ebad1=0xc8;}else{_0x9ebad1=0xce;}_0x3a6adb[_0xc05b('0x12')](_0x9ebad1);return _0x3a6adb[_0xc05b('0x18')](_0xc05b('0x19'),_0x53a7e7+'-'+_0x14e697+'/'+_0x422f6c)[_0xc05b('0x1a')](_0x5b555b);}return null;};}function patchUpdates(_0x49842f){return function(_0x2e066b){try{jsonpatch[_0xc05b('0x1b')](_0x2e066b,_0x49842f,!![]);}catch(_0x59a730){return BPromise['reject'](_0x59a730);}return _0x2e066b[_0xc05b('0x1c')]();};}function saveUpdates(_0x218d48,_0x46c695){return function(_0x148f40){if(_0x148f40){return _0x148f40[_0xc05b('0x1d')](_0x218d48)[_0xc05b('0x1e')](function(_0x7548e4){return _0x7548e4;});}return null;};}function removeEntity(_0x43f8a6,_0x48e448){return function(_0x50ac3f){if(_0x50ac3f){return _0x50ac3f[_0xc05b('0x1f')]()[_0xc05b('0x1e')](function(){_0x43f8a6[_0xc05b('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ac34,_0x115744){return function(_0x12b56f){if(!_0x12b56f){_0x10ac34[_0xc05b('0x11')](0x194);}return _0x12b56f;};}function handleError(_0x5e06cd,_0x33cc15){_0x33cc15=_0x33cc15||0x1f4;return function(_0x5e5487){logger[_0xc05b('0x20')](_0x5e5487[_0xc05b('0x21')]);if(_0x5e5487['name']){delete _0x5e5487[_0xc05b('0x22')];}_0x5e06cd[_0xc05b('0x12')](_0x33cc15)[_0xc05b('0x23')](_0x5e5487);};}exports[_0xc05b('0x24')]=function(_0x5dfb16,_0x1150b5){var _0x4c3403={},_0x39fbc5={},_0x23f3c6={'count':0x0,'rows':[]};var _0x3a9570=_[_0xc05b('0x25')](db['FreshdeskConfiguration'][_0xc05b('0x26')],function(_0x5402a0){return{'name':_0x5402a0[_0xc05b('0x27')],'type':_0x5402a0[_0xc05b('0x28')][_0xc05b('0x29')]};});_0x39fbc5[_0xc05b('0x2a')]=_[_0xc05b('0x25')](_0x3a9570,_0xc05b('0x22'));_0x39fbc5[_0xc05b('0x2b')]=_[_0xc05b('0x2c')](_0x5dfb16[_0xc05b('0x2b')]);_0x39fbc5[_0xc05b('0x2d')]=_[_0xc05b('0x2e')](_0x39fbc5[_0xc05b('0x2a')],_0x39fbc5[_0xc05b('0x2b')]);_0x4c3403[_0xc05b('0x2f')]=_[_0xc05b('0x2e')](_0x39fbc5[_0xc05b('0x2a')],qs[_0xc05b('0x30')](_0x5dfb16[_0xc05b('0x2b')][_0xc05b('0x30')]));_0x4c3403[_0xc05b('0x2f')]=_0x4c3403[_0xc05b('0x2f')][_0xc05b('0x31')]?_0x4c3403[_0xc05b('0x2f')]:_0x39fbc5['model'];if(!_0x5dfb16[_0xc05b('0x2b')][_0xc05b('0x32')](_0xc05b('0x33'))){_0x4c3403[_0xc05b('0x16')]=qs['limit'](_0x5dfb16[_0xc05b('0x2b')]['limit']);_0x4c3403[_0xc05b('0x14')]=qs[_0xc05b('0x14')](_0x5dfb16[_0xc05b('0x2b')][_0xc05b('0x14')]);}_0x4c3403[_0xc05b('0x34')]=qs['sort'](_0x5dfb16['query'][_0xc05b('0x35')]);_0x4c3403[_0xc05b('0x36')]=qs[_0xc05b('0x2d')](_['pick'](_0x5dfb16['query'],_0x39fbc5[_0xc05b('0x2d')]),_0x3a9570);if(_0x5dfb16[_0xc05b('0x2b')][_0xc05b('0x37')]){_0x4c3403[_0xc05b('0x36')]=_[_0xc05b('0x38')](_0x4c3403['where'],{'$or':_[_0xc05b('0x25')](_0x3a9570,function(_0xa5bb47){if(_0xa5bb47[_0xc05b('0x28')]!==_0xc05b('0x39')){var _0x2ab20e={};_0x2ab20e[_0xa5bb47[_0xc05b('0x22')]]={'$like':'%'+_0x5dfb16['query'][_0xc05b('0x37')]+'%'};return _0x2ab20e;}})});}_0x4c3403=_[_0xc05b('0x38')]({},_0x4c3403,_0x5dfb16[_0xc05b('0x3a')]);var _0x19ef0d={'where':_0x4c3403[_0xc05b('0x36')]};return db['FreshdeskConfiguration'][_0xc05b('0x17')](_0x19ef0d)[_0xc05b('0x1e')](function(_0x4acc9d){_0x23f3c6[_0xc05b('0x17')]=_0x4acc9d;if(_0x5dfb16[_0xc05b('0x2b')][_0xc05b('0x3b')]){_0x4c3403['include']=[{'all':!![]}];}return db[_0xc05b('0x3c')]['findAll'](_0x4c3403);})[_0xc05b('0x1e')](function(_0x141ac3){_0x23f3c6['rows']=_0x141ac3;return _0x23f3c6;})['then'](respondWithFilteredResult(_0x1150b5,_0x4c3403))[_0xc05b('0x3d')](handleError(_0x1150b5,null));};exports[_0xc05b('0x3e')]=function(_0x5743b4,_0x3feb5f){var _0x557012={'raw':![],'where':{'id':_0x5743b4['params']['id']}},_0x3e8187={};_0x3e8187['model']=_[_0xc05b('0x2c')](db[_0xc05b('0x3c')][_0xc05b('0x26')]);_0x3e8187['query']=_[_0xc05b('0x2c')](_0x5743b4['query']);_0x3e8187['filters']=_[_0xc05b('0x2e')](_0x3e8187[_0xc05b('0x2a')],_0x3e8187[_0xc05b('0x2b')]);_0x557012[_0xc05b('0x2f')]=_[_0xc05b('0x2e')](_0x3e8187['model'],qs[_0xc05b('0x30')](_0x5743b4[_0xc05b('0x2b')]['fields']));_0x557012[_0xc05b('0x2f')]=_0x557012[_0xc05b('0x2f')][_0xc05b('0x31')]?_0x557012[_0xc05b('0x2f')]:_0x3e8187[_0xc05b('0x2a')];if(_0x5743b4[_0xc05b('0x2b')][_0xc05b('0x3b')]){_0x557012[_0xc05b('0x3f')]=[{'all':!![]}];}_0x557012=_[_0xc05b('0x38')]({},_0x557012,_0x5743b4['options']);return db[_0xc05b('0x3c')][_0xc05b('0x40')](_0x557012)[_0xc05b('0x1e')](handleEntityNotFound(_0x3feb5f,null))[_0xc05b('0x1e')](respondWithResult(_0x3feb5f,null))[_0xc05b('0x3d')](handleError(_0x3feb5f,null));};exports[_0xc05b('0x41')]=function(_0x1a3c7b,_0x601bdb){return db['FreshdeskConfiguration'][_0xc05b('0x41')](_0x1a3c7b[_0xc05b('0x42')],{})[_0xc05b('0x1e')](respondWithResult(_0x601bdb,0xc9))['catch'](handleError(_0x601bdb,null));};exports[_0xc05b('0x1d')]=function(_0x53ae92,_0x5438c0){if(_0x53ae92[_0xc05b('0x42')]['id']){delete _0x53ae92[_0xc05b('0x42')]['id'];}return db[_0xc05b('0x3c')][_0xc05b('0x40')]({'where':{'id':_0x53ae92[_0xc05b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5438c0,null))[_0xc05b('0x1e')](saveUpdates(_0x53ae92['body'],null))[_0xc05b('0x1e')](respondWithResult(_0x5438c0,null))[_0xc05b('0x3d')](handleError(_0x5438c0,null));};exports[_0xc05b('0x1f')]=function(_0x6c3e6a,_0x44a82d){return db[_0xc05b('0x3c')]['find']({'where':{'id':_0x6c3e6a['params']['id']}})[_0xc05b('0x1e')](handleEntityNotFound(_0x44a82d,null))[_0xc05b('0x1e')](removeEntity(_0x44a82d,null))[_0xc05b('0x3d')](handleError(_0x44a82d,null));};exports['getFields']=function(_0x2bce02,_0x371c76,_0x309ddc){var _0xe1611d={};var _0x4ffce8={};var _0x5da899;var _0x45d1cf;return db[_0xc05b('0x3c')]['findOne']({'where':{'id':_0x2bce02['params']['id']}})[_0xc05b('0x1e')](handleEntityNotFound(_0x371c76,null))[_0xc05b('0x1e')](function(_0x3c3ecf){if(_0x3c3ecf){_0x5da899=_0x3c3ecf;_0x4ffce8[_0xc05b('0x2a')]=_[_0xc05b('0x2c')](db['FreshdeskField'][_0xc05b('0x26')]);_0x4ffce8[_0xc05b('0x2b')]=_[_0xc05b('0x2c')](_0x2bce02[_0xc05b('0x2b')]);_0x4ffce8[_0xc05b('0x2d')]=_[_0xc05b('0x2e')](_0x4ffce8[_0xc05b('0x2a')],_0x4ffce8[_0xc05b('0x2b')]);_0xe1611d[_0xc05b('0x2f')]=_[_0xc05b('0x2e')](_0x4ffce8['model'],qs[_0xc05b('0x30')](_0x2bce02[_0xc05b('0x2b')]['fields']));_0xe1611d[_0xc05b('0x2f')]=_0xe1611d[_0xc05b('0x2f')]['length']?_0xe1611d['attributes']:_0x4ffce8[_0xc05b('0x2a')];_0xe1611d[_0xc05b('0x34')]=qs[_0xc05b('0x35')](_0x2bce02[_0xc05b('0x2b')]['sort']);_0xe1611d['where']=qs[_0xc05b('0x2d')](_[_0xc05b('0x44')](_0x2bce02[_0xc05b('0x2b')],_0x4ffce8[_0xc05b('0x2d')]));if(_0x2bce02['query'][_0xc05b('0x37')]){_0xe1611d[_0xc05b('0x36')]=_[_0xc05b('0x38')](_0xe1611d[_0xc05b('0x36')],{'$or':_[_0xc05b('0x25')](_0xe1611d['attributes'],function(_0x137e18){var _0x1a8973={};_0x1a8973[_0x137e18]={'$like':'%'+_0x2bce02[_0xc05b('0x2b')][_0xc05b('0x37')]+'%'};return _0x1a8973;})});}_0xe1611d=_[_0xc05b('0x38')]({},_0xe1611d,_0x2bce02[_0xc05b('0x3a')]);return _0x5da899[_0xc05b('0x45')](_0xe1611d);}})['then'](function(_0x466508){if(_0x466508){_0x45d1cf=_0x466508[_0xc05b('0x31')];if(!_0x2bce02[_0xc05b('0x2b')][_0xc05b('0x32')]('nolimit')){_0xe1611d[_0xc05b('0x16')]=qs[_0xc05b('0x16')](_0x2bce02[_0xc05b('0x2b')][_0xc05b('0x16')]);_0xe1611d[_0xc05b('0x14')]=qs['offset'](_0x2bce02['query'][_0xc05b('0x14')]);}return _0x5da899[_0xc05b('0x45')](_0xe1611d);}})[_0xc05b('0x1e')](function(_0x4b5a34){if(_0x4b5a34){return _0x4b5a34?{'count':_0x45d1cf,'rows':_0x4b5a34}:null;}})[_0xc05b('0x1e')](respondWithResult(_0x371c76,null))[_0xc05b('0x3d')](handleError(_0x371c76,null));};exports[_0xc05b('0x46')]=function(_0x3d4ab9,_0x54bf0f,_0x99893c){var _0xfe6c55={};var _0x3acf94={};var _0x13c092;var _0x2dab9b;return db[_0xc05b('0x3c')][_0xc05b('0x47')]({'where':{'id':_0x3d4ab9[_0xc05b('0x43')]['id']}})[_0xc05b('0x1e')](handleEntityNotFound(_0x54bf0f,null))['then'](function(_0x691648){if(_0x691648){_0x13c092=_0x691648;_0x3acf94['model']=_[_0xc05b('0x2c')](db['FreshdeskField'][_0xc05b('0x26')]);_0x3acf94[_0xc05b('0x2b')]=_[_0xc05b('0x2c')](_0x3d4ab9[_0xc05b('0x2b')]);_0x3acf94['filters']=_[_0xc05b('0x2e')](_0x3acf94[_0xc05b('0x2a')],_0x3acf94['query']);_0xfe6c55['attributes']=_['intersection'](_0x3acf94[_0xc05b('0x2a')],qs[_0xc05b('0x30')](_0x3d4ab9['query'][_0xc05b('0x30')]));_0xfe6c55['attributes']=_0xfe6c55[_0xc05b('0x2f')][_0xc05b('0x31')]?_0xfe6c55['attributes']:_0x3acf94[_0xc05b('0x2a')];_0xfe6c55['order']=qs['sort'](_0x3d4ab9[_0xc05b('0x2b')][_0xc05b('0x35')]);_0xfe6c55['where']=qs[_0xc05b('0x2d')](_[_0xc05b('0x44')](_0x3d4ab9[_0xc05b('0x2b')],_0x3acf94[_0xc05b('0x2d')]));if(_0x3d4ab9['query'][_0xc05b('0x37')]){_0xfe6c55[_0xc05b('0x36')]=_[_0xc05b('0x38')](_0xfe6c55[_0xc05b('0x36')],{'$or':_['map'](_0xfe6c55[_0xc05b('0x2f')],function(_0x192cfc){var _0x369449={};_0x369449[_0x192cfc]={'$like':'%'+_0x3d4ab9[_0xc05b('0x2b')][_0xc05b('0x37')]+'%'};return _0x369449;})});}_0xfe6c55=_[_0xc05b('0x38')]({},_0xfe6c55,_0x3d4ab9['options']);return _0x13c092['getSubjects'](_0xfe6c55);}})[_0xc05b('0x1e')](function(_0x18d545){if(_0x18d545){_0x2dab9b=_0x18d545['length'];if(!_0x3d4ab9[_0xc05b('0x2b')]['hasOwnProperty'](_0xc05b('0x33'))){_0xfe6c55[_0xc05b('0x16')]=qs[_0xc05b('0x16')](_0x3d4ab9['query'][_0xc05b('0x16')]);_0xfe6c55[_0xc05b('0x14')]=qs[_0xc05b('0x14')](_0x3d4ab9['query'][_0xc05b('0x14')]);}return _0x13c092[_0xc05b('0x46')](_0xfe6c55);}})[_0xc05b('0x1e')](function(_0xc00b12){if(_0xc00b12){return _0xc00b12?{'count':_0x2dab9b,'rows':_0xc00b12}:null;}})[_0xc05b('0x1e')](respondWithResult(_0x54bf0f,null))[_0xc05b('0x3d')](handleError(_0x54bf0f,null));};exports[_0xc05b('0x48')]=function(_0x685fe2,_0x12c9f2,_0x38fa2f){var _0x3cbca2={};var _0x32a44b={};var _0x295697;var _0x27b542;return db[_0xc05b('0x3c')][_0xc05b('0x47')]({'where':{'id':_0x685fe2[_0xc05b('0x43')]['id']}})['then'](handleEntityNotFound(_0x12c9f2,null))[_0xc05b('0x1e')](function(_0x541aee){if(_0x541aee){_0x295697=_0x541aee;_0x32a44b[_0xc05b('0x2a')]=_[_0xc05b('0x2c')](db['FreshdeskField']['rawAttributes']);_0x32a44b[_0xc05b('0x2b')]=_[_0xc05b('0x2c')](_0x685fe2[_0xc05b('0x2b')]);_0x32a44b['filters']=_[_0xc05b('0x2e')](_0x32a44b[_0xc05b('0x2a')],_0x32a44b[_0xc05b('0x2b')]);_0x3cbca2['attributes']=_[_0xc05b('0x2e')](_0x32a44b[_0xc05b('0x2a')],qs[_0xc05b('0x30')](_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x30')]));_0x3cbca2[_0xc05b('0x2f')]=_0x3cbca2[_0xc05b('0x2f')][_0xc05b('0x31')]?_0x3cbca2[_0xc05b('0x2f')]:_0x32a44b[_0xc05b('0x2a')];_0x3cbca2[_0xc05b('0x34')]=qs[_0xc05b('0x35')](_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x35')]);_0x3cbca2[_0xc05b('0x36')]=qs[_0xc05b('0x2d')](_[_0xc05b('0x44')](_0x685fe2[_0xc05b('0x2b')],_0x32a44b[_0xc05b('0x2d')]));if(_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x37')]){_0x3cbca2[_0xc05b('0x36')]=_['merge'](_0x3cbca2['where'],{'$or':_[_0xc05b('0x25')](_0x3cbca2[_0xc05b('0x2f')],function(_0x50f558){var _0x9c7d08={};_0x9c7d08[_0x50f558]={'$like':'%'+_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x37')]+'%'};return _0x9c7d08;})});}_0x3cbca2=_['merge']({},_0x3cbca2,_0x685fe2[_0xc05b('0x3a')]);return _0x295697[_0xc05b('0x48')](_0x3cbca2);}})[_0xc05b('0x1e')](function(_0x27d3d1){if(_0x27d3d1){_0x27b542=_0x27d3d1[_0xc05b('0x31')];if(!_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x32')](_0xc05b('0x33'))){_0x3cbca2['limit']=qs[_0xc05b('0x16')](_0x685fe2[_0xc05b('0x2b')][_0xc05b('0x16')]);_0x3cbca2[_0xc05b('0x14')]=qs[_0xc05b('0x14')](_0x685fe2['query'][_0xc05b('0x14')]);}return _0x295697[_0xc05b('0x48')](_0x3cbca2);}})[_0xc05b('0x1e')](function(_0x381958){if(_0x381958){return _0x381958?{'count':_0x27b542,'rows':_0x381958}:null;}})[_0xc05b('0x1e')](respondWithResult(_0x12c9f2,null))[_0xc05b('0x3d')](handleError(_0x12c9f2,null));};exports[_0xc05b('0x49')]=function(_0x5862c4,_0x518389,_0x2cc52a){var _0x247666={};var _0x16dc8d={};var _0x4c63d6;var _0x116712;return db[_0xc05b('0x3c')][_0xc05b('0x47')]({'where':{'id':_0x5862c4[_0xc05b('0x43')]['id']}})[_0xc05b('0x1e')](handleEntityNotFound(_0x518389,null))[_0xc05b('0x1e')](function(_0x38430c){if(_0x38430c){_0x4c63d6=_0x38430c;_0x16dc8d[_0xc05b('0x2a')]=_[_0xc05b('0x2c')](db['Tag'][_0xc05b('0x26')]);_0x16dc8d[_0xc05b('0x2b')]=_[_0xc05b('0x2c')](_0x5862c4[_0xc05b('0x2b')]);_0x16dc8d['filters']=_[_0xc05b('0x2e')](_0x16dc8d[_0xc05b('0x2a')],_0x16dc8d[_0xc05b('0x2b')]);_0x247666['attributes']=_[_0xc05b('0x2e')](_0x16dc8d[_0xc05b('0x2a')],qs[_0xc05b('0x30')](_0x5862c4[_0xc05b('0x2b')][_0xc05b('0x30')]));_0x247666['attributes']=_0x247666['attributes'][_0xc05b('0x31')]?_0x247666[_0xc05b('0x2f')]:_0x16dc8d[_0xc05b('0x2a')];_0x247666[_0xc05b('0x34')]=qs[_0xc05b('0x35')](_0x5862c4['query'][_0xc05b('0x35')]);_0x247666[_0xc05b('0x36')]=qs['filters'](_[_0xc05b('0x44')](_0x5862c4[_0xc05b('0x2b')],_0x16dc8d['filters']));if(_0x5862c4[_0xc05b('0x2b')][_0xc05b('0x37')]){_0x247666[_0xc05b('0x36')]=_[_0xc05b('0x38')](_0x247666['where'],{'$or':_[_0xc05b('0x25')](_0x247666[_0xc05b('0x2f')],function(_0x221aad){var _0x4445c2={};_0x4445c2[_0x221aad]={'$like':'%'+_0x5862c4[_0xc05b('0x2b')]['filter']+'%'};return _0x4445c2;})});}_0x247666=_[_0xc05b('0x38')]({},_0x247666,_0x5862c4[_0xc05b('0x3a')]);return _0x4c63d6['getTags'](_0x247666);}})[_0xc05b('0x1e')](function(_0x3d5c47){if(_0x3d5c47){_0x116712=_0x3d5c47[_0xc05b('0x31')];if(!_0x5862c4['query'][_0xc05b('0x32')](_0xc05b('0x33'))){_0x247666['limit']=qs[_0xc05b('0x16')](_0x5862c4[_0xc05b('0x2b')][_0xc05b('0x16')]);_0x247666[_0xc05b('0x14')]=qs['offset'](_0x5862c4[_0xc05b('0x2b')][_0xc05b('0x14')]);}return _0x4c63d6[_0xc05b('0x49')](_0x247666);}})[_0xc05b('0x1e')](function(_0x5da0ba){if(_0x5da0ba){return _0x5da0ba?{'count':_0x116712,'rows':_0x5da0ba}:null;}})[_0xc05b('0x1e')](respondWithResult(_0x518389,null))[_0xc05b('0x3d')](handleError(_0x518389,null));};exports[_0xc05b('0x4a')]=function(_0x237b69,_0x18963f,_0xc3b42){if(_0x237b69[_0xc05b('0x42')]['id']){delete _0x237b69[_0xc05b('0x42')]['id'];}return db[_0xc05b('0x3c')][_0xc05b('0x47')]({'where':{'id':_0x237b69[_0xc05b('0x43')]['id']}})[_0xc05b('0x1e')](handleEntityNotFound(_0x18963f,null))['then'](function(_0x4ded09){if(_0x4ded09){return _0x4ded09['setTags'](_0x237b69['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x18963f,null))[_0xc05b('0x3d')](handleError(_0x18963f,null));}; \ No newline at end of file +var _0x7928=['nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','find','params','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','keys','query','filters','intersection','fields','length','attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7928,0x108));var _0x8792=function(_0x5c0a61,_0x31e0cc){_0x5c0a61=_0x5c0a61-0x0;var _0x52fcf5=_0x7928[_0x5c0a61];return _0x52fcf5;};'use strict';var emlformat=require(_0x8792('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8792('0x1'));var jsonpatch=require(_0x8792('0x2'));var rp=require(_0x8792('0x3'));var moment=require(_0x8792('0x4'));var BPromise=require(_0x8792('0x5'));var Mustache=require('mustache');var util=require(_0x8792('0x6'));var path=require(_0x8792('0x7'));var sox=require('sox');var csv=require(_0x8792('0x8'));var ejs=require(_0x8792('0x9'));var fs=require('fs');var fs_extra=require(_0x8792('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8792('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8792('0xc'));var toCsv=require(_0x8792('0x8'));var querystring=require('querystring');var Papa=require(_0x8792('0xd'));var Redis=require('ioredis');var authService=require(_0x8792('0xe'));var qs=require(_0x8792('0xf'));var as=require(_0x8792('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8792('0x11'))('api');var utils=require(_0x8792('0x12'));var config=require(_0x8792('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54d10f,_0x3c789d){_0x3c789d=_0x3c789d||0xcc;return function(_0x2e6abd){if(_0x2e6abd){return _0x54d10f[_0x8792('0x14')](_0x3c789d);}return _0x54d10f[_0x8792('0x15')](_0x3c789d)[_0x8792('0x16')]();};}function respondWithResult(_0x520f7d,_0x57fc2f){_0x57fc2f=_0x57fc2f||0xc8;return function(_0x5eca9a){if(_0x5eca9a){return _0x520f7d['status'](_0x57fc2f)[_0x8792('0x17')](_0x5eca9a);}};}function respondWithFilteredResult(_0xcee271,_0x4af219){return function(_0x53c50d){if(_0x53c50d){var _0x4a2e=typeof _0x4af219['offset']===_0x8792('0x18')&&typeof _0x4af219[_0x8792('0x19')]==='undefined';var _0x2c3c96=_0x53c50d[_0x8792('0x1a')];var _0x10e8ef=_0x4a2e?0x0:_0x4af219['offset'];var _0x53bd4c=_0x4a2e?_0x53c50d[_0x8792('0x1a')]:_0x4af219['offset']+_0x4af219[_0x8792('0x19')];var _0x3ee70f;if(_0x53bd4c>=_0x2c3c96){_0x53bd4c=_0x2c3c96;_0x3ee70f=0xc8;}else{_0x3ee70f=0xce;}_0xcee271[_0x8792('0x15')](_0x3ee70f);return _0xcee271['set']('Content-Range',_0x10e8ef+'-'+_0x53bd4c+'/'+_0x2c3c96)[_0x8792('0x17')](_0x53c50d);}return null;};}function patchUpdates(_0x4e89bc){return function(_0x6167d4){try{jsonpatch['apply'](_0x6167d4,_0x4e89bc,!![]);}catch(_0x5535a8){return BPromise['reject'](_0x5535a8);}return _0x6167d4[_0x8792('0x1b')]();};}function saveUpdates(_0x3ffa4b,_0x5ee801){return function(_0x5735ac){if(_0x5735ac){return _0x5735ac[_0x8792('0x1c')](_0x3ffa4b)[_0x8792('0x1d')](function(_0x1c36a3){return _0x1c36a3;});}return null;};}function removeEntity(_0x880ae6,_0x2f804a){return function(_0xe3b1bf){if(_0xe3b1bf){return _0xe3b1bf[_0x8792('0x1e')]()['then'](function(){_0x880ae6[_0x8792('0x15')](0xcc)[_0x8792('0x16')]();});}};}function handleEntityNotFound(_0x434c27,_0x36a706){return function(_0x4a1438){if(!_0x4a1438){_0x434c27['sendStatus'](0x194);}return _0x4a1438;};}function handleError(_0x3582d5,_0x2e320b){_0x2e320b=_0x2e320b||0x1f4;return function(_0x5deabf){logger[_0x8792('0x1f')](_0x5deabf[_0x8792('0x20')]);if(_0x5deabf[_0x8792('0x21')]){delete _0x5deabf[_0x8792('0x21')];}_0x3582d5[_0x8792('0x15')](_0x2e320b)[_0x8792('0x22')](_0x5deabf);};}exports[_0x8792('0x23')]=function(_0x1bda60,_0x57fc3b){var _0x8b4167={},_0x143b2e={},_0x256b1d={'count':0x0,'rows':[]};var _0x63d271=_[_0x8792('0x24')](db[_0x8792('0x25')]['rawAttributes'],function(_0x96d2c8){return{'name':_0x96d2c8[_0x8792('0x26')],'type':_0x96d2c8['type'][_0x8792('0x27')]};});_0x143b2e[_0x8792('0x28')]=_[_0x8792('0x24')](_0x63d271,_0x8792('0x21'));_0x143b2e['query']=_[_0x8792('0x29')](_0x1bda60[_0x8792('0x2a')]);_0x143b2e[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0x143b2e[_0x8792('0x28')],_0x143b2e['query']);_0x8b4167['attributes']=_[_0x8792('0x2c')](_0x143b2e[_0x8792('0x28')],qs['fields'](_0x1bda60[_0x8792('0x2a')][_0x8792('0x2d')]));_0x8b4167['attributes']=_0x8b4167['attributes'][_0x8792('0x2e')]?_0x8b4167[_0x8792('0x2f')]:_0x143b2e['model'];if(!_0x1bda60[_0x8792('0x2a')]['hasOwnProperty'](_0x8792('0x30'))){_0x8b4167['limit']=qs['limit'](_0x1bda60['query'][_0x8792('0x19')]);_0x8b4167['offset']=qs[_0x8792('0x31')](_0x1bda60[_0x8792('0x2a')][_0x8792('0x31')]);}_0x8b4167[_0x8792('0x32')]=qs[_0x8792('0x33')](_0x1bda60[_0x8792('0x2a')][_0x8792('0x33')]);_0x8b4167[_0x8792('0x34')]=qs[_0x8792('0x2b')](_[_0x8792('0x35')](_0x1bda60[_0x8792('0x2a')],_0x143b2e[_0x8792('0x2b')]),_0x63d271);if(_0x1bda60[_0x8792('0x2a')]['filter']){_0x8b4167[_0x8792('0x34')]=_[_0x8792('0x36')](_0x8b4167[_0x8792('0x34')],{'$or':_['map'](_0x63d271,function(_0x71f8a4){if(_0x71f8a4[_0x8792('0x37')]!==_0x8792('0x38')){var _0x379e56={};_0x379e56[_0x71f8a4[_0x8792('0x21')]]={'$like':'%'+_0x1bda60[_0x8792('0x2a')][_0x8792('0x39')]+'%'};return _0x379e56;}})});}_0x8b4167=_['merge']({},_0x8b4167,_0x1bda60[_0x8792('0x3a')]);var _0x360892={'where':_0x8b4167['where']};return db[_0x8792('0x25')][_0x8792('0x1a')](_0x360892)[_0x8792('0x1d')](function(_0x2c9209){_0x256b1d[_0x8792('0x1a')]=_0x2c9209;if(_0x1bda60[_0x8792('0x2a')][_0x8792('0x3b')]){_0x8b4167[_0x8792('0x3c')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x8792('0x3d')](_0x8b4167);})[_0x8792('0x1d')](function(_0x47469d){_0x256b1d[_0x8792('0x3e')]=_0x47469d;return _0x256b1d;})[_0x8792('0x1d')](respondWithFilteredResult(_0x57fc3b,_0x8b4167))[_0x8792('0x3f')](handleError(_0x57fc3b,null));};exports['show']=function(_0x1a3df2,_0xc2a945){var _0x16b73e={'raw':![],'where':{'id':_0x1a3df2['params']['id']}},_0x786404={};_0x786404['model']=_[_0x8792('0x29')](db[_0x8792('0x25')][_0x8792('0x40')]);_0x786404[_0x8792('0x2a')]=_['keys'](_0x1a3df2['query']);_0x786404[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0x786404['model'],_0x786404[_0x8792('0x2a')]);_0x16b73e[_0x8792('0x2f')]=_[_0x8792('0x2c')](_0x786404['model'],qs['fields'](_0x1a3df2[_0x8792('0x2a')][_0x8792('0x2d')]));_0x16b73e['attributes']=_0x16b73e[_0x8792('0x2f')]['length']?_0x16b73e['attributes']:_0x786404[_0x8792('0x28')];if(_0x1a3df2[_0x8792('0x2a')]['includeAll']){_0x16b73e['include']=[{'all':!![]}];}_0x16b73e=_[_0x8792('0x36')]({},_0x16b73e,_0x1a3df2[_0x8792('0x3a')]);return db['FreshdeskConfiguration']['find'](_0x16b73e)['then'](handleEntityNotFound(_0xc2a945,null))[_0x8792('0x1d')](respondWithResult(_0xc2a945,null))[_0x8792('0x3f')](handleError(_0xc2a945,null));};exports[_0x8792('0x41')]=function(_0x3ee918,_0x1b4206){return db[_0x8792('0x25')][_0x8792('0x41')](_0x3ee918['body'],{})[_0x8792('0x1d')](respondWithResult(_0x1b4206,0xc9))['catch'](handleError(_0x1b4206,null));};exports[_0x8792('0x1c')]=function(_0x281af8,_0x50db18){if(_0x281af8[_0x8792('0x42')]['id']){delete _0x281af8[_0x8792('0x42')]['id'];}return db[_0x8792('0x25')][_0x8792('0x43')]({'where':{'id':_0x281af8[_0x8792('0x44')]['id']}})[_0x8792('0x1d')](handleEntityNotFound(_0x50db18,null))[_0x8792('0x1d')](saveUpdates(_0x281af8[_0x8792('0x42')],null))['then'](respondWithResult(_0x50db18,null))['catch'](handleError(_0x50db18,null));};exports[_0x8792('0x1e')]=function(_0x476748,_0x1bef90){return db[_0x8792('0x25')]['find']({'where':{'id':_0x476748[_0x8792('0x44')]['id']}})[_0x8792('0x1d')](handleEntityNotFound(_0x1bef90,null))[_0x8792('0x1d')](removeEntity(_0x1bef90,null))[_0x8792('0x3f')](handleError(_0x1bef90,null));};exports[_0x8792('0x45')]=function(_0x58c0ca,_0x20e613,_0x133c7b){var _0x2d6554={};var _0x1822b5={};var _0x176bfe;var _0x4eb1c3;return db[_0x8792('0x25')][_0x8792('0x46')]({'where':{'id':_0x58c0ca[_0x8792('0x44')]['id']}})['then'](handleEntityNotFound(_0x20e613,null))[_0x8792('0x1d')](function(_0x3bca8a){if(_0x3bca8a){_0x176bfe=_0x3bca8a;_0x1822b5[_0x8792('0x28')]=_[_0x8792('0x29')](db[_0x8792('0x47')][_0x8792('0x40')]);_0x1822b5[_0x8792('0x2a')]=_['keys'](_0x58c0ca['query']);_0x1822b5[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0x1822b5['model'],_0x1822b5[_0x8792('0x2a')]);_0x2d6554[_0x8792('0x2f')]=_[_0x8792('0x2c')](_0x1822b5[_0x8792('0x28')],qs[_0x8792('0x2d')](_0x58c0ca[_0x8792('0x2a')][_0x8792('0x2d')]));_0x2d6554['attributes']=_0x2d6554[_0x8792('0x2f')][_0x8792('0x2e')]?_0x2d6554[_0x8792('0x2f')]:_0x1822b5[_0x8792('0x28')];_0x2d6554[_0x8792('0x32')]=qs[_0x8792('0x33')](_0x58c0ca['query'][_0x8792('0x33')]);_0x2d6554['where']=qs['filters'](_['pick'](_0x58c0ca[_0x8792('0x2a')],_0x1822b5[_0x8792('0x2b')]));if(_0x58c0ca[_0x8792('0x2a')][_0x8792('0x39')]){_0x2d6554[_0x8792('0x34')]=_[_0x8792('0x36')](_0x2d6554[_0x8792('0x34')],{'$or':_['map'](_0x2d6554['attributes'],function(_0x44a137){var _0x5474ff={};_0x5474ff[_0x44a137]={'$like':'%'+_0x58c0ca[_0x8792('0x2a')][_0x8792('0x39')]+'%'};return _0x5474ff;})});}_0x2d6554=_['merge']({},_0x2d6554,_0x58c0ca[_0x8792('0x3a')]);return _0x176bfe['getFields'](_0x2d6554);}})[_0x8792('0x1d')](function(_0x5f640c){if(_0x5f640c){_0x4eb1c3=_0x5f640c['length'];if(!_0x58c0ca[_0x8792('0x2a')][_0x8792('0x48')](_0x8792('0x30'))){_0x2d6554[_0x8792('0x19')]=qs[_0x8792('0x19')](_0x58c0ca[_0x8792('0x2a')][_0x8792('0x19')]);_0x2d6554[_0x8792('0x31')]=qs['offset'](_0x58c0ca[_0x8792('0x2a')][_0x8792('0x31')]);}return _0x176bfe['getFields'](_0x2d6554);}})[_0x8792('0x1d')](function(_0xd0af2e){if(_0xd0af2e){return _0xd0af2e?{'count':_0x4eb1c3,'rows':_0xd0af2e}:null;}})[_0x8792('0x1d')](respondWithResult(_0x20e613,null))[_0x8792('0x3f')](handleError(_0x20e613,null));};exports['getSubjects']=function(_0x16b330,_0x54c175,_0x5a8b05){var _0x400e66={};var _0xe26f57={};var _0x127b32;var _0x2ec2da;return db[_0x8792('0x25')]['findOne']({'where':{'id':_0x16b330[_0x8792('0x44')]['id']}})[_0x8792('0x1d')](handleEntityNotFound(_0x54c175,null))[_0x8792('0x1d')](function(_0x254fb8){if(_0x254fb8){_0x127b32=_0x254fb8;_0xe26f57['model']=_[_0x8792('0x29')](db[_0x8792('0x47')][_0x8792('0x40')]);_0xe26f57[_0x8792('0x2a')]=_['keys'](_0x16b330[_0x8792('0x2a')]);_0xe26f57[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0xe26f57[_0x8792('0x28')],_0xe26f57[_0x8792('0x2a')]);_0x400e66[_0x8792('0x2f')]=_[_0x8792('0x2c')](_0xe26f57[_0x8792('0x28')],qs[_0x8792('0x2d')](_0x16b330[_0x8792('0x2a')][_0x8792('0x2d')]));_0x400e66[_0x8792('0x2f')]=_0x400e66['attributes'][_0x8792('0x2e')]?_0x400e66['attributes']:_0xe26f57[_0x8792('0x28')];_0x400e66[_0x8792('0x32')]=qs[_0x8792('0x33')](_0x16b330[_0x8792('0x2a')]['sort']);_0x400e66[_0x8792('0x34')]=qs['filters'](_['pick'](_0x16b330[_0x8792('0x2a')],_0xe26f57[_0x8792('0x2b')]));if(_0x16b330[_0x8792('0x2a')][_0x8792('0x39')]){_0x400e66[_0x8792('0x34')]=_[_0x8792('0x36')](_0x400e66['where'],{'$or':_[_0x8792('0x24')](_0x400e66['attributes'],function(_0x544c60){var _0xe1e4cf={};_0xe1e4cf[_0x544c60]={'$like':'%'+_0x16b330['query'][_0x8792('0x39')]+'%'};return _0xe1e4cf;})});}_0x400e66=_[_0x8792('0x36')]({},_0x400e66,_0x16b330[_0x8792('0x3a')]);return _0x127b32[_0x8792('0x49')](_0x400e66);}})[_0x8792('0x1d')](function(_0x30c157){if(_0x30c157){_0x2ec2da=_0x30c157[_0x8792('0x2e')];if(!_0x16b330[_0x8792('0x2a')][_0x8792('0x48')](_0x8792('0x30'))){_0x400e66[_0x8792('0x19')]=qs['limit'](_0x16b330[_0x8792('0x2a')]['limit']);_0x400e66[_0x8792('0x31')]=qs['offset'](_0x16b330['query'][_0x8792('0x31')]);}return _0x127b32['getSubjects'](_0x400e66);}})[_0x8792('0x1d')](function(_0x4081c5){if(_0x4081c5){return _0x4081c5?{'count':_0x2ec2da,'rows':_0x4081c5}:null;}})[_0x8792('0x1d')](respondWithResult(_0x54c175,null))[_0x8792('0x3f')](handleError(_0x54c175,null));};exports[_0x8792('0x4a')]=function(_0x27417a,_0x4189e1,_0x4e9e17){var _0x589753={};var _0x350d42={};var _0x497af2;var _0x236f30;return db[_0x8792('0x25')][_0x8792('0x46')]({'where':{'id':_0x27417a[_0x8792('0x44')]['id']}})['then'](handleEntityNotFound(_0x4189e1,null))[_0x8792('0x1d')](function(_0x103915){if(_0x103915){_0x497af2=_0x103915;_0x350d42[_0x8792('0x28')]=_[_0x8792('0x29')](db['FreshdeskField'][_0x8792('0x40')]);_0x350d42[_0x8792('0x2a')]=_['keys'](_0x27417a[_0x8792('0x2a')]);_0x350d42[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0x350d42[_0x8792('0x28')],_0x350d42['query']);_0x589753['attributes']=_[_0x8792('0x2c')](_0x350d42[_0x8792('0x28')],qs[_0x8792('0x2d')](_0x27417a[_0x8792('0x2a')][_0x8792('0x2d')]));_0x589753['attributes']=_0x589753[_0x8792('0x2f')][_0x8792('0x2e')]?_0x589753[_0x8792('0x2f')]:_0x350d42[_0x8792('0x28')];_0x589753[_0x8792('0x32')]=qs[_0x8792('0x33')](_0x27417a[_0x8792('0x2a')][_0x8792('0x33')]);_0x589753[_0x8792('0x34')]=qs['filters'](_['pick'](_0x27417a['query'],_0x350d42['filters']));if(_0x27417a['query'][_0x8792('0x39')]){_0x589753[_0x8792('0x34')]=_[_0x8792('0x36')](_0x589753['where'],{'$or':_[_0x8792('0x24')](_0x589753[_0x8792('0x2f')],function(_0x3300af){var _0xd52f5a={};_0xd52f5a[_0x3300af]={'$like':'%'+_0x27417a[_0x8792('0x2a')][_0x8792('0x39')]+'%'};return _0xd52f5a;})});}_0x589753=_[_0x8792('0x36')]({},_0x589753,_0x27417a[_0x8792('0x3a')]);return _0x497af2['getDescriptions'](_0x589753);}})[_0x8792('0x1d')](function(_0x3dce7b){if(_0x3dce7b){_0x236f30=_0x3dce7b['length'];if(!_0x27417a[_0x8792('0x2a')][_0x8792('0x48')](_0x8792('0x30'))){_0x589753[_0x8792('0x19')]=qs[_0x8792('0x19')](_0x27417a[_0x8792('0x2a')]['limit']);_0x589753[_0x8792('0x31')]=qs[_0x8792('0x31')](_0x27417a[_0x8792('0x2a')][_0x8792('0x31')]);}return _0x497af2[_0x8792('0x4a')](_0x589753);}})[_0x8792('0x1d')](function(_0x3510eb){if(_0x3510eb){return _0x3510eb?{'count':_0x236f30,'rows':_0x3510eb}:null;}})[_0x8792('0x1d')](respondWithResult(_0x4189e1,null))[_0x8792('0x3f')](handleError(_0x4189e1,null));};exports[_0x8792('0x4b')]=function(_0x491bd1,_0x6a5585,_0x31519f){var _0x1d36f6={};var _0x5e56b6={};var _0x254447;var _0x1d8ef2;return db['FreshdeskConfiguration'][_0x8792('0x46')]({'where':{'id':_0x491bd1[_0x8792('0x44')]['id']}})[_0x8792('0x1d')](handleEntityNotFound(_0x6a5585,null))[_0x8792('0x1d')](function(_0x562d9e){if(_0x562d9e){_0x254447=_0x562d9e;_0x5e56b6[_0x8792('0x28')]=_[_0x8792('0x29')](db['Tag'][_0x8792('0x40')]);_0x5e56b6['query']=_[_0x8792('0x29')](_0x491bd1[_0x8792('0x2a')]);_0x5e56b6[_0x8792('0x2b')]=_[_0x8792('0x2c')](_0x5e56b6[_0x8792('0x28')],_0x5e56b6[_0x8792('0x2a')]);_0x1d36f6[_0x8792('0x2f')]=_[_0x8792('0x2c')](_0x5e56b6[_0x8792('0x28')],qs[_0x8792('0x2d')](_0x491bd1[_0x8792('0x2a')][_0x8792('0x2d')]));_0x1d36f6[_0x8792('0x2f')]=_0x1d36f6['attributes'][_0x8792('0x2e')]?_0x1d36f6['attributes']:_0x5e56b6[_0x8792('0x28')];_0x1d36f6[_0x8792('0x32')]=qs['sort'](_0x491bd1[_0x8792('0x2a')][_0x8792('0x33')]);_0x1d36f6[_0x8792('0x34')]=qs[_0x8792('0x2b')](_['pick'](_0x491bd1[_0x8792('0x2a')],_0x5e56b6[_0x8792('0x2b')]));if(_0x491bd1[_0x8792('0x2a')][_0x8792('0x39')]){_0x1d36f6['where']=_[_0x8792('0x36')](_0x1d36f6[_0x8792('0x34')],{'$or':_[_0x8792('0x24')](_0x1d36f6['attributes'],function(_0x521dd6){var _0x583978={};_0x583978[_0x521dd6]={'$like':'%'+_0x491bd1[_0x8792('0x2a')]['filter']+'%'};return _0x583978;})});}_0x1d36f6=_[_0x8792('0x36')]({},_0x1d36f6,_0x491bd1[_0x8792('0x3a')]);return _0x254447[_0x8792('0x4b')](_0x1d36f6);}})[_0x8792('0x1d')](function(_0x13aba7){if(_0x13aba7){_0x1d8ef2=_0x13aba7[_0x8792('0x2e')];if(!_0x491bd1['query']['hasOwnProperty']('nolimit')){_0x1d36f6[_0x8792('0x19')]=qs[_0x8792('0x19')](_0x491bd1['query'][_0x8792('0x19')]);_0x1d36f6[_0x8792('0x31')]=qs[_0x8792('0x31')](_0x491bd1[_0x8792('0x2a')]['offset']);}return _0x254447[_0x8792('0x4b')](_0x1d36f6);}})[_0x8792('0x1d')](function(_0x4f67ab){if(_0x4f67ab){return _0x4f67ab?{'count':_0x1d8ef2,'rows':_0x4f67ab}:null;}})[_0x8792('0x1d')](respondWithResult(_0x6a5585,null))['catch'](handleError(_0x6a5585,null));};exports[_0x8792('0x4c')]=function(_0xf9cdd6,_0x42652b,_0x25682b){if(_0xf9cdd6[_0x8792('0x42')]['id']){delete _0xf9cdd6[_0x8792('0x42')]['id'];}return db[_0x8792('0x25')][_0x8792('0x46')]({'where':{'id':_0xf9cdd6[_0x8792('0x44')]['id']}})[_0x8792('0x1d')](handleEntityNotFound(_0x42652b,null))['then'](function(_0x523345){if(_0x523345){return _0x523345[_0x8792('0x4c')](_0xf9cdd6[_0x8792('0x42')][_0x8792('0x4d')]||[]);}return null;})[_0x8792('0x1d')](respondWithResult(_0x42652b,null))[_0x8792('0x3f')](handleError(_0x42652b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c122331..49b7919 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 _0x22fe=['api','bluebird','path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','../../config/logger'];(function(_0x189862,_0x183fee){var _0x537724=function(_0x1531fe){while(--_0x1531fe){_0x189862['push'](_0x189862['shift']());}};_0x537724(++_0x183fee);}(_0x22fe,0x187));var _0xe22f=function(_0x5a679e,_0x5a5acc){_0x5a679e=_0x5a679e-0x0;var _0x2705a1=_0x22fe[_0x5a679e];return _0x2705a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe22f('0x0'))(_0xe22f('0x1'));var moment=require('moment');var BPromise=require(_0xe22f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe22f('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe22f('0x4'));module[_0xe22f('0x5')]=function(_0x5c357d,_0x2d42b2){return _0x5c357d[_0xe22f('0x6')](_0xe22f('0x7'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x598f=['define','FreshdeskConfiguration','util','api','moment','bluebird','request-promise','exports'];(function(_0x249565,_0x2a026a){var _0x43dee8=function(_0x15a1ab){while(--_0x15a1ab){_0x249565['push'](_0x249565['shift']());}};_0x43dee8(++_0x2a026a);}(_0x598f,0x122));var _0xf598=function(_0xb61ea8,_0x1fd363){_0xb61ea8=_0xb61ea8-0x0;var _0x5ad6af=_0x598f[_0xb61ea8];return _0x5ad6af;};'use strict';var _=require('lodash');var util=require(_0xf598('0x0'));var logger=require('../../config/logger')(_0xf598('0x1'));var moment=require(_0xf598('0x2'));var BPromise=require(_0xf598('0x3'));var rp=require(_0xf598('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xf598('0x5')]=function(_0xb71fe9,_0x299558){return _0xb71fe9[_0xf598('0x6')](_0xf598('0x7'),attributes,{'tableName':'int_freshdesk_configurations','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 14789ff..dce150e 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 _0x8bcc=['rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3f0c77,_0x41f99a){var _0x5e78a5=function(_0x516f00){while(--_0x516f00){_0x3f0c77['push'](_0x3f0c77['shift']());}};_0x5e78a5(++_0x41f99a);}(_0x8bcc,0x1f3));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc8bc('0x0'));var BPromise=require(_0xc8bc('0x1'));var rs=require(_0xc8bc('0x2'));var fs=require('fs');var Redis=require(_0xc8bc('0x3'));var db=require(_0xc8bc('0x4'))['db'];var utils=require(_0xc8bc('0x5'));var logger=require(_0xc8bc('0x6'))(_0xc8bc('0x7'));var config=require(_0xc8bc('0x8'));var jayson=require(_0xc8bc('0x9'));var client=jayson['client'][_0xc8bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d1ec6,_0x2e0667,_0x2f0e3c){return new BPromise(function(_0x59b74a,_0x1e2b1b){return client[_0xc8bc('0xb')](_0x3d1ec6,_0x2f0e3c)[_0xc8bc('0xc')](function(_0x4c1c42){logger[_0xc8bc('0xd')](_0xc8bc('0xe'),_0x2e0667,'request\x20sent');logger[_0xc8bc('0xf')](_0xc8bc('0x10'),_0x2e0667,'request\x20sent',JSON[_0xc8bc('0x11')](_0x4c1c42));if(_0x4c1c42[_0xc8bc('0x12')]){if(_0x4c1c42[_0xc8bc('0x12')][_0xc8bc('0x13')]===0x1f4){logger[_0xc8bc('0x12')](_0xc8bc('0xe'),_0x2e0667,_0x4c1c42[_0xc8bc('0x12')]['message']);return _0x1e2b1b(_0x4c1c42['error'][_0xc8bc('0x14')]);}logger[_0xc8bc('0x12')](_0xc8bc('0xe'),_0x2e0667,_0x4c1c42[_0xc8bc('0x12')]['message']);return _0x59b74a(_0x4c1c42[_0xc8bc('0x12')]['message']);}else{logger[_0xc8bc('0xd')](_0xc8bc('0xe'),_0x2e0667,'request\x20sent');_0x59b74a(_0x4c1c42[_0xc8bc('0x15')][_0xc8bc('0x14')]);}})['catch'](function(_0x214f9b){logger[_0xc8bc('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2e0667,_0x214f9b);_0x1e2b1b(_0x214f9b);});});} \ No newline at end of file +var _0x220d=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x2ba35b,_0x5383e6){var _0x25c885=function(_0x114e4f){while(--_0x114e4f){_0x2ba35b['push'](_0x2ba35b['shift']());}};_0x25c885(++_0x5383e6);}(_0x220d,0xfc));var _0xd220=function(_0x15bd05,_0x2ffa77){_0x15bd05=_0x15bd05-0x0;var _0x523632=_0x220d[_0x15bd05];return _0x523632;};'use strict';var _=require(_0xd220('0x0'));var util=require(_0xd220('0x1'));var moment=require(_0xd220('0x2'));var BPromise=require('bluebird');var rs=require(_0xd220('0x3'));var fs=require('fs');var Redis=require(_0xd220('0x4'));var db=require(_0xd220('0x5'))['db'];var utils=require(_0xd220('0x6'));var logger=require(_0xd220('0x7'))(_0xd220('0x8'));var config=require(_0xd220('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd220('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40dcf1,_0x52cbd4,_0x3a4e72){return new BPromise(function(_0x16034,_0x2dbd1d){return client[_0xd220('0xb')](_0x40dcf1,_0x3a4e72)[_0xd220('0xc')](function(_0x3a53fd){logger[_0xd220('0xd')](_0xd220('0xe'),_0x52cbd4,'request\x20sent');logger[_0xd220('0xf')](_0xd220('0x10'),_0x52cbd4,_0xd220('0x11'),JSON[_0xd220('0x12')](_0x3a53fd));if(_0x3a53fd[_0xd220('0x13')]){if(_0x3a53fd['error'][_0xd220('0x14')]===0x1f4){logger[_0xd220('0x13')](_0xd220('0xe'),_0x52cbd4,_0x3a53fd[_0xd220('0x13')]['message']);return _0x2dbd1d(_0x3a53fd[_0xd220('0x13')][_0xd220('0x15')]);}logger['error'](_0xd220('0xe'),_0x52cbd4,_0x3a53fd[_0xd220('0x13')]['message']);return _0x16034(_0x3a53fd['error'][_0xd220('0x15')]);}else{logger[_0xd220('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x52cbd4,_0xd220('0x11'));_0x16034(_0x3a53fd[_0xd220('0x16')]['message']);}})[_0xd220('0x17')](function(_0x210728){logger['error'](_0xd220('0xe'),_0x52cbd4,_0x210728);_0x2dbd1d(_0x210728);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 57938ef..a79126b 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 _0x9c1e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x52d422,_0x2d1008){var _0xaa93f9=function(_0x38a7ec){while(--_0x38a7ec){_0x52d422['push'](_0x52d422['shift']());}};_0xaa93f9(++_0x2d1008);}(_0x9c1e,0x1e4));var _0xe9c1=function(_0x32ccd6,_0x18ecc7){_0x32ccd6=_0x32ccd6-0x0;var _0x3425b6=_0x9c1e[_0x32ccd6];return _0x3425b6;};'use strict';var multer=require(_0xe9c1('0x0'));var util=require(_0xe9c1('0x1'));var path=require('path');var timeout=require(_0xe9c1('0x2'));var express=require(_0xe9c1('0x3'));var router=express[_0xe9c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe9c1('0x5'));var interaction=require(_0xe9c1('0x6'));var config=require(_0xe9c1('0x7'));var controller=require('./intFreshdeskField.controller');router[_0xe9c1('0x8')]('/',auth[_0xe9c1('0x9')](),controller[_0xe9c1('0xa')]);router[_0xe9c1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe9c1('0xb')]);router['post']('/',auth[_0xe9c1('0x9')](),controller[_0xe9c1('0xc')]);router[_0xe9c1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe9c1('0xe')]);router[_0xe9c1('0xf')]('/:id',auth[_0xe9c1('0x9')](),controller[_0xe9c1('0x10')]);module[_0xe9c1('0x11')]=router; \ No newline at end of file +var _0xec7b=['get','index','/:id','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x5b079a,_0x3a3f49){var _0x5eadaf=function(_0x31a7af){while(--_0x31a7af){_0x5b079a['push'](_0x5b079a['shift']());}};_0x5eadaf(++_0x3a3f49);}(_0xec7b,0x101));var _0xbec7=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xec7b[_0x43b08];return _0x5e05f4;};'use strict';var multer=require(_0xbec7('0x0'));var util=require(_0xbec7('0x1'));var path=require(_0xbec7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbec7('0x3'));var router=express[_0xbec7('0x4')]();var fs_extra=require(_0xbec7('0x5'));var auth=require(_0xbec7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbec7('0x7'));var controller=require(_0xbec7('0x8'));router[_0xbec7('0x9')]('/',auth['isAuthenticated'](),controller[_0xbec7('0xa')]);router[_0xbec7('0x9')](_0xbec7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xbec7('0xc')]('/',auth[_0xbec7('0xd')](),controller[_0xbec7('0xe')]);router[_0xbec7('0xf')](_0xbec7('0xb'),auth['isAuthenticated'](),controller[_0xbec7('0x10')]);router[_0xbec7('0x11')](_0xbec7('0xb'),auth[_0xbec7('0xd')](),controller['destroy']);module[_0xbec7('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 6e41ad0..0885c1c 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 _0x4d3e=['picklist','STRING','variable','exports','ENUM','string','customVariable','keyValue'];(function(_0x584162,_0x5d010b){var _0x141caf=function(_0x20fc3c){while(--_0x20fc3c){_0x584162['push'](_0x584162['shift']());}};_0x141caf(++_0x5d010b);}(_0x4d3e,0x1cb));var _0xe4d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x4d3e[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0xe4d3('0x0')]={'type':{'type':Sequelize[_0xe4d3('0x1')](_0xe4d3('0x2'),'variable',_0xe4d3('0x3'),_0xe4d3('0x4'),_0xe4d3('0x5')),'defaultValue':_0xe4d3('0x2')},'content':{'type':Sequelize[_0xe4d3('0x6')]},'key':{'type':Sequelize[_0xe4d3('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe4d3('0x2'),_0xe4d3('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x537f=['sequelize','exports','ENUM','string','picklist','STRING','variable','customVariable'];(function(_0x4b086a,_0x168c9b){var _0x484344=function(_0x3eb4f7){while(--_0x3eb4f7){_0x4b086a['push'](_0x4b086a['shift']());}};_0x484344(++_0x168c9b);}(_0x537f,0x140));var _0xf537=function(_0x2bc23e,_0x4d88eb){_0x2bc23e=_0x2bc23e-0x0;var _0x3fb640=_0x537f[_0x2bc23e];return _0x3fb640;};'use strict';var Sequelize=require(_0xf537('0x0'));module[_0xf537('0x1')]={'type':{'type':Sequelize[_0xf537('0x2')](_0xf537('0x3'),'variable','customVariable','keyValue',_0xf537('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf537('0x5')]},'key':{'type':Sequelize[_0xf537('0x5')]},'keyType':{'type':Sequelize[_0xf537('0x2')]('string',_0xf537('0x6'),_0xf537('0x7'))},'keyContent':{'type':Sequelize[_0xf537('0x5')]},'idField':{'type':Sequelize[_0xf537('0x5')]},'nameField':{'type':Sequelize[_0xf537('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index d2e939e..84b213c 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 _0x54f3=['show','params','keys','includeAll','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','stack','name','send','map','FreshdeskField','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x4c9f7f,_0x191da9){var _0x1a3fea=function(_0x18d70d){while(--_0x18d70d){_0x4c9f7f['push'](_0x4c9f7f['shift']());}};_0x1a3fea(++_0x191da9);}(_0x54f3,0x120));var _0x354f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x54f3[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x354f('0x0'));var zipdir=require(_0x354f('0x1'));var jsonpatch=require(_0x354f('0x2'));var rp=require(_0x354f('0x3'));var moment=require(_0x354f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x354f('0x5'));var path=require(_0x354f('0x6'));var sox=require(_0x354f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x354f('0x8'));var _=require('lodash');var squel=require(_0x354f('0x9'));var crypto=require(_0x354f('0xa'));var jsforce=require(_0x354f('0xb'));var deskjs=require(_0x354f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x354f('0xd'));var Papa=require('papaparse');var Redis=require(_0x354f('0xe'));var authService=require(_0x354f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x354f('0x10'));var logger=require(_0x354f('0x11'))('api');var utils=require(_0x354f('0x12'));var config=require(_0x354f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x354f('0x14'))['db'];function respondWithStatusCode(_0x824bf4,_0x13d871){_0x13d871=_0x13d871||0xcc;return function(_0x97c0da){if(_0x97c0da){return _0x824bf4[_0x354f('0x15')](_0x13d871);}return _0x824bf4[_0x354f('0x16')](_0x13d871)[_0x354f('0x17')]();};}function respondWithResult(_0x4ff8e7,_0xf2e013){_0xf2e013=_0xf2e013||0xc8;return function(_0x4b811d){if(_0x4b811d){return _0x4ff8e7[_0x354f('0x16')](_0xf2e013)['json'](_0x4b811d);}};}function respondWithFilteredResult(_0x103388,_0x234484){return function(_0x18cf66){if(_0x18cf66){var _0x4cc0e9=typeof _0x234484['offset']===_0x354f('0x18')&&typeof _0x234484[_0x354f('0x19')]===_0x354f('0x18');var _0x2ef866=_0x18cf66[_0x354f('0x1a')];var _0x36402d=_0x4cc0e9?0x0:_0x234484[_0x354f('0x1b')];var _0x598777=_0x4cc0e9?_0x18cf66[_0x354f('0x1a')]:_0x234484[_0x354f('0x1b')]+_0x234484[_0x354f('0x19')];var _0x4b87dd;if(_0x598777>=_0x2ef866){_0x598777=_0x2ef866;_0x4b87dd=0xc8;}else{_0x4b87dd=0xce;}_0x103388[_0x354f('0x16')](_0x4b87dd);return _0x103388['set'](_0x354f('0x1c'),_0x36402d+'-'+_0x598777+'/'+_0x2ef866)[_0x354f('0x1d')](_0x18cf66);}return null;};}function patchUpdates(_0x5e930c){return function(_0x14c4be){try{jsonpatch[_0x354f('0x1e')](_0x14c4be,_0x5e930c,!![]);}catch(_0x4ef4f1){return BPromise['reject'](_0x4ef4f1);}return _0x14c4be[_0x354f('0x1f')]();};}function saveUpdates(_0x574753,_0x52e7cb){return function(_0xa6050f){if(_0xa6050f){return _0xa6050f[_0x354f('0x20')](_0x574753)[_0x354f('0x21')](function(_0x2f4277){return _0x2f4277;});}return null;};}function removeEntity(_0xc0d4ca,_0x158117){return function(_0x273603){if(_0x273603){return _0x273603['destroy']()[_0x354f('0x21')](function(){_0xc0d4ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22594b,_0x4c9b18){return function(_0x4b1820){if(!_0x4b1820){_0x22594b[_0x354f('0x15')](0x194);}return _0x4b1820;};}function handleError(_0x4e2ad6,_0x3f0bfe){_0x3f0bfe=_0x3f0bfe||0x1f4;return function(_0x393622){logger['error'](_0x393622[_0x354f('0x22')]);if(_0x393622[_0x354f('0x23')]){delete _0x393622[_0x354f('0x23')];}_0x4e2ad6['status'](_0x3f0bfe)[_0x354f('0x24')](_0x393622);};}exports['index']=function(_0x227d9b,_0x26373d){var _0x16a376={},_0x2816cf={},_0x596b48={'count':0x0,'rows':[]};var _0x21c121=_[_0x354f('0x25')](db[_0x354f('0x26')][_0x354f('0x27')],function(_0x223464){return{'name':_0x223464['fieldName'],'type':_0x223464['type'][_0x354f('0x28')]};});_0x2816cf[_0x354f('0x29')]=_[_0x354f('0x25')](_0x21c121,_0x354f('0x23'));_0x2816cf['query']=_['keys'](_0x227d9b[_0x354f('0x2a')]);_0x2816cf[_0x354f('0x2b')]=_[_0x354f('0x2c')](_0x2816cf[_0x354f('0x29')],_0x2816cf['query']);_0x16a376[_0x354f('0x2d')]=_[_0x354f('0x2c')](_0x2816cf[_0x354f('0x29')],qs[_0x354f('0x2e')](_0x227d9b['query']['fields']));_0x16a376[_0x354f('0x2d')]=_0x16a376[_0x354f('0x2d')][_0x354f('0x2f')]?_0x16a376[_0x354f('0x2d')]:_0x2816cf[_0x354f('0x29')];if(!_0x227d9b[_0x354f('0x2a')][_0x354f('0x30')](_0x354f('0x31'))){_0x16a376[_0x354f('0x19')]=qs[_0x354f('0x19')](_0x227d9b[_0x354f('0x2a')]['limit']);_0x16a376[_0x354f('0x1b')]=qs['offset'](_0x227d9b[_0x354f('0x2a')][_0x354f('0x1b')]);}_0x16a376[_0x354f('0x32')]=qs[_0x354f('0x33')](_0x227d9b[_0x354f('0x2a')][_0x354f('0x33')]);_0x16a376['where']=qs[_0x354f('0x2b')](_[_0x354f('0x34')](_0x227d9b['query'],_0x2816cf[_0x354f('0x2b')]),_0x21c121);if(_0x227d9b[_0x354f('0x2a')][_0x354f('0x35')]){_0x16a376['where']=_[_0x354f('0x36')](_0x16a376[_0x354f('0x37')],{'$or':_[_0x354f('0x25')](_0x21c121,function(_0x389f82){if(_0x389f82['type']!==_0x354f('0x38')){var _0x4db9a4={};_0x4db9a4[_0x389f82[_0x354f('0x23')]]={'$like':'%'+_0x227d9b[_0x354f('0x2a')][_0x354f('0x35')]+'%'};return _0x4db9a4;}})});}_0x16a376=_[_0x354f('0x36')]({},_0x16a376,_0x227d9b[_0x354f('0x39')]);var _0x589c69={'where':_0x16a376['where']};return db[_0x354f('0x26')][_0x354f('0x1a')](_0x589c69)[_0x354f('0x21')](function(_0x327fb2){_0x596b48[_0x354f('0x1a')]=_0x327fb2;if(_0x227d9b[_0x354f('0x2a')]['includeAll']){_0x16a376[_0x354f('0x3a')]=[{'all':!![]}];}return db[_0x354f('0x26')][_0x354f('0x3b')](_0x16a376);})[_0x354f('0x21')](function(_0x512592){_0x596b48[_0x354f('0x3c')]=_0x512592;return _0x596b48;})[_0x354f('0x21')](respondWithFilteredResult(_0x26373d,_0x16a376))[_0x354f('0x3d')](handleError(_0x26373d,null));};exports[_0x354f('0x3e')]=function(_0x1da53d,_0x344666){var _0x5f33b2={'raw':!![],'where':{'id':_0x1da53d[_0x354f('0x3f')]['id']}},_0x66b4cc={};_0x66b4cc[_0x354f('0x29')]=_['keys'](db['FreshdeskField'][_0x354f('0x27')]);_0x66b4cc[_0x354f('0x2a')]=_[_0x354f('0x40')](_0x1da53d[_0x354f('0x2a')]);_0x66b4cc[_0x354f('0x2b')]=_[_0x354f('0x2c')](_0x66b4cc[_0x354f('0x29')],_0x66b4cc[_0x354f('0x2a')]);_0x5f33b2['attributes']=_[_0x354f('0x2c')](_0x66b4cc[_0x354f('0x29')],qs[_0x354f('0x2e')](_0x1da53d[_0x354f('0x2a')][_0x354f('0x2e')]));_0x5f33b2[_0x354f('0x2d')]=_0x5f33b2[_0x354f('0x2d')][_0x354f('0x2f')]?_0x5f33b2[_0x354f('0x2d')]:_0x66b4cc['model'];if(_0x1da53d[_0x354f('0x2a')][_0x354f('0x41')]){_0x5f33b2['include']=[{'all':!![]}];}_0x5f33b2=_['merge']({},_0x5f33b2,_0x1da53d[_0x354f('0x39')]);return db[_0x354f('0x26')][_0x354f('0x42')](_0x5f33b2)[_0x354f('0x21')](handleEntityNotFound(_0x344666,null))[_0x354f('0x21')](respondWithResult(_0x344666,null))[_0x354f('0x3d')](handleError(_0x344666,null));};exports['create']=function(_0x558332,_0x178313){return db[_0x354f('0x26')][_0x354f('0x43')](_0x558332[_0x354f('0x44')],{})[_0x354f('0x21')](respondWithResult(_0x178313,0xc9))[_0x354f('0x3d')](handleError(_0x178313,null));};exports['update']=function(_0x55f2c9,_0x6b7a2c){if(_0x55f2c9['body']['id']){delete _0x55f2c9[_0x354f('0x44')]['id'];}return db[_0x354f('0x26')][_0x354f('0x42')]({'where':{'id':_0x55f2c9['params']['id']}})['then'](handleEntityNotFound(_0x6b7a2c,null))[_0x354f('0x21')](saveUpdates(_0x55f2c9[_0x354f('0x44')],null))['then'](respondWithResult(_0x6b7a2c,null))[_0x354f('0x3d')](handleError(_0x6b7a2c,null));};exports[_0x354f('0x45')]=function(_0xf71a4f,_0x2dd012){return db[_0x354f('0x26')][_0x354f('0x42')]({'where':{'id':_0xf71a4f[_0x354f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2dd012,null))[_0x354f('0x21')](removeEntity(_0x2dd012,null))[_0x354f('0x3d')](handleError(_0x2dd012,null));}; \ No newline at end of file +var _0x7980=['sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FreshdeskField','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x5c5744,_0x39f298){var _0x27c3da=function(_0x2912e5){while(--_0x2912e5){_0x5c5744['push'](_0x5c5744['shift']());}};_0x27c3da(++_0x39f298);}(_0x7980,0xab));var _0x0798=function(_0x222551,_0x2716c8){_0x222551=_0x222551-0x0;var _0x48fd94=_0x7980[_0x222551];return _0x48fd94;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require('moment');var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0798('0xb'));var squel=require(_0x0798('0xc'));var crypto=require(_0x0798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0798('0xe'));var querystring=require(_0x0798('0xf'));var Papa=require(_0x0798('0x10'));var Redis=require(_0x0798('0x11'));var authService=require(_0x0798('0x12'));var qs=require(_0x0798('0x13'));var as=require(_0x0798('0x14'));var hardwareService=require(_0x0798('0x15'));var logger=require(_0x0798('0x16'))(_0x0798('0x17'));var utils=require('../../config/utils');var config=require(_0x0798('0x18'));var licenseUtil=require(_0x0798('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323e5,_0x588f9d){_0x588f9d=_0x588f9d||0xcc;return function(_0x376a60){if(_0x376a60){return _0x5323e5[_0x0798('0x1a')](_0x588f9d);}return _0x5323e5[_0x0798('0x1b')](_0x588f9d)[_0x0798('0x1c')]();};}function respondWithResult(_0x39bacd,_0xfd88af){_0xfd88af=_0xfd88af||0xc8;return function(_0x5f1640){if(_0x5f1640){return _0x39bacd['status'](_0xfd88af)[_0x0798('0x1d')](_0x5f1640);}};}function respondWithFilteredResult(_0x112362,_0x47be56){return function(_0x555c45){if(_0x555c45){var _0x21c30b=typeof _0x47be56[_0x0798('0x1e')]===_0x0798('0x1f')&&typeof _0x47be56['limit']==='undefined';var _0x1c6d6f=_0x555c45['count'];var _0x41e217=_0x21c30b?0x0:_0x47be56[_0x0798('0x1e')];var _0x288f41=_0x21c30b?_0x555c45[_0x0798('0x20')]:_0x47be56['offset']+_0x47be56[_0x0798('0x21')];var _0x3039d6;if(_0x288f41>=_0x1c6d6f){_0x288f41=_0x1c6d6f;_0x3039d6=0xc8;}else{_0x3039d6=0xce;}_0x112362['status'](_0x3039d6);return _0x112362[_0x0798('0x22')](_0x0798('0x23'),_0x41e217+'-'+_0x288f41+'/'+_0x1c6d6f)[_0x0798('0x1d')](_0x555c45);}return null;};}function patchUpdates(_0x44ac33){return function(_0xfbb4a5){try{jsonpatch[_0x0798('0x24')](_0xfbb4a5,_0x44ac33,!![]);}catch(_0x3a7f8b){return BPromise[_0x0798('0x25')](_0x3a7f8b);}return _0xfbb4a5[_0x0798('0x26')]();};}function saveUpdates(_0x4a86d5,_0x2aaabf){return function(_0x35c141){if(_0x35c141){return _0x35c141[_0x0798('0x27')](_0x4a86d5)[_0x0798('0x28')](function(_0x20654b){return _0x20654b;});}return null;};}function removeEntity(_0x23f283,_0x52037c){return function(_0x3f66e2){if(_0x3f66e2){return _0x3f66e2[_0x0798('0x29')]()[_0x0798('0x28')](function(){_0x23f283[_0x0798('0x1b')](0xcc)[_0x0798('0x1c')]();});}};}function handleEntityNotFound(_0x23d59c,_0x4f648a){return function(_0x43d99f){if(!_0x43d99f){_0x23d59c[_0x0798('0x1a')](0x194);}return _0x43d99f;};}function handleError(_0x11e24d,_0x4d4e0a){_0x4d4e0a=_0x4d4e0a||0x1f4;return function(_0x4bc3f3){logger['error'](_0x4bc3f3['stack']);if(_0x4bc3f3[_0x0798('0x2a')]){delete _0x4bc3f3[_0x0798('0x2a')];}_0x11e24d[_0x0798('0x1b')](_0x4d4e0a)[_0x0798('0x2b')](_0x4bc3f3);};}exports[_0x0798('0x2c')]=function(_0x161244,_0x30bec){var _0x23e770={},_0x5bbe3d={},_0x167960={'count':0x0,'rows':[]};var _0x4f5d1d=_['map'](db[_0x0798('0x2d')]['rawAttributes'],function(_0x1dabd5){return{'name':_0x1dabd5['fieldName'],'type':_0x1dabd5[_0x0798('0x2e')][_0x0798('0x2f')]};});_0x5bbe3d[_0x0798('0x30')]=_[_0x0798('0x31')](_0x4f5d1d,_0x0798('0x2a'));_0x5bbe3d[_0x0798('0x32')]=_[_0x0798('0x33')](_0x161244[_0x0798('0x32')]);_0x5bbe3d[_0x0798('0x34')]=_[_0x0798('0x35')](_0x5bbe3d[_0x0798('0x30')],_0x5bbe3d[_0x0798('0x32')]);_0x23e770['attributes']=_[_0x0798('0x35')](_0x5bbe3d['model'],qs['fields'](_0x161244[_0x0798('0x32')][_0x0798('0x36')]));_0x23e770['attributes']=_0x23e770['attributes'][_0x0798('0x37')]?_0x23e770[_0x0798('0x38')]:_0x5bbe3d[_0x0798('0x30')];if(!_0x161244[_0x0798('0x32')][_0x0798('0x39')](_0x0798('0x3a'))){_0x23e770['limit']=qs['limit'](_0x161244[_0x0798('0x32')][_0x0798('0x21')]);_0x23e770[_0x0798('0x1e')]=qs['offset'](_0x161244['query']['offset']);}_0x23e770[_0x0798('0x3b')]=qs[_0x0798('0x3c')](_0x161244[_0x0798('0x32')][_0x0798('0x3c')]);_0x23e770[_0x0798('0x3d')]=qs[_0x0798('0x34')](_[_0x0798('0x3e')](_0x161244[_0x0798('0x32')],_0x5bbe3d['filters']),_0x4f5d1d);if(_0x161244[_0x0798('0x32')]['filter']){_0x23e770[_0x0798('0x3d')]=_[_0x0798('0x3f')](_0x23e770[_0x0798('0x3d')],{'$or':_['map'](_0x4f5d1d,function(_0x91de){if(_0x91de['type']!==_0x0798('0x40')){var _0x138bad={};_0x138bad[_0x91de[_0x0798('0x2a')]]={'$like':'%'+_0x161244['query'][_0x0798('0x41')]+'%'};return _0x138bad;}})});}_0x23e770=_[_0x0798('0x3f')]({},_0x23e770,_0x161244['options']);var _0xddc73b={'where':_0x23e770['where']};return db['FreshdeskField'][_0x0798('0x20')](_0xddc73b)[_0x0798('0x28')](function(_0x5f3e38){_0x167960['count']=_0x5f3e38;if(_0x161244[_0x0798('0x32')][_0x0798('0x42')]){_0x23e770[_0x0798('0x43')]=[{'all':!![]}];}return db[_0x0798('0x2d')][_0x0798('0x44')](_0x23e770);})[_0x0798('0x28')](function(_0x27a671){_0x167960['rows']=_0x27a671;return _0x167960;})[_0x0798('0x28')](respondWithFilteredResult(_0x30bec,_0x23e770))[_0x0798('0x45')](handleError(_0x30bec,null));};exports[_0x0798('0x46')]=function(_0x3d6de4,_0x3a8a14){var _0x26e9cb={'raw':!![],'where':{'id':_0x3d6de4[_0x0798('0x47')]['id']}},_0x4c2d8a={};_0x4c2d8a[_0x0798('0x30')]=_[_0x0798('0x33')](db[_0x0798('0x2d')][_0x0798('0x48')]);_0x4c2d8a[_0x0798('0x32')]=_[_0x0798('0x33')](_0x3d6de4[_0x0798('0x32')]);_0x4c2d8a[_0x0798('0x34')]=_[_0x0798('0x35')](_0x4c2d8a[_0x0798('0x30')],_0x4c2d8a[_0x0798('0x32')]);_0x26e9cb['attributes']=_[_0x0798('0x35')](_0x4c2d8a[_0x0798('0x30')],qs[_0x0798('0x36')](_0x3d6de4[_0x0798('0x32')]['fields']));_0x26e9cb['attributes']=_0x26e9cb[_0x0798('0x38')][_0x0798('0x37')]?_0x26e9cb[_0x0798('0x38')]:_0x4c2d8a[_0x0798('0x30')];if(_0x3d6de4['query'][_0x0798('0x42')]){_0x26e9cb['include']=[{'all':!![]}];}_0x26e9cb=_['merge']({},_0x26e9cb,_0x3d6de4[_0x0798('0x49')]);return db[_0x0798('0x2d')][_0x0798('0x4a')](_0x26e9cb)[_0x0798('0x28')](handleEntityNotFound(_0x3a8a14,null))[_0x0798('0x28')](respondWithResult(_0x3a8a14,null))[_0x0798('0x45')](handleError(_0x3a8a14,null));};exports[_0x0798('0x4b')]=function(_0x411c2a,_0x182e3b){return db['FreshdeskField'][_0x0798('0x4b')](_0x411c2a['body'],{})[_0x0798('0x28')](respondWithResult(_0x182e3b,0xc9))[_0x0798('0x45')](handleError(_0x182e3b,null));};exports[_0x0798('0x27')]=function(_0x54634d,_0x9dea1f){if(_0x54634d[_0x0798('0x4c')]['id']){delete _0x54634d[_0x0798('0x4c')]['id'];}return db[_0x0798('0x2d')]['find']({'where':{'id':_0x54634d[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x9dea1f,null))[_0x0798('0x28')](saveUpdates(_0x54634d[_0x0798('0x4c')],null))[_0x0798('0x28')](respondWithResult(_0x9dea1f,null))['catch'](handleError(_0x9dea1f,null));};exports[_0x0798('0x29')]=function(_0x3e1c15,_0x2679b1){return db[_0x0798('0x2d')][_0x0798('0x4a')]({'where':{'id':_0x3e1c15[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x2679b1,null))[_0x0798('0x28')](removeEntity(_0x2679b1,null))[_0x0798('0x45')](handleError(_0x2679b1,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ac4f2b8..b4892cf 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 _0x57ae=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x57ae,0xb4));var _0xe57a=function(_0x349dee,_0x4916bd){_0x349dee=_0x349dee-0x0;var _0x1dfdeb=_0x57ae[_0x349dee];return _0x1dfdeb;};'use strict';var _=require('lodash');var util=require(_0xe57a('0x0'));var logger=require(_0xe57a('0x1'))(_0xe57a('0x2'));var moment=require(_0xe57a('0x3'));var BPromise=require(_0xe57a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe57a('0x5'));var rimraf=require(_0xe57a('0x6'));var config=require(_0xe57a('0x7'));var attributes=require(_0xe57a('0x8'));module['exports']=function(_0x2a0596,_0x2c870b){return _0x2a0596['define']('FreshdeskField',attributes,{'tableName':_0xe57a('0x9'),'paranoid':![],'indexes':[{'name':_0xe57a('0xa'),'fields':[_0xe57a('0xb'),_0xe57a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28aa=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3b8d89,_0x5b53ed){var _0x19136f=function(_0x2082fa){while(--_0x2082fa){_0x3b8d89['push'](_0x3b8d89['shift']());}};_0x19136f(++_0x5b53ed);}(_0x28aa,0xf8));var _0xa28a=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x28aa[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require(_0xa28a('0x0'));var logger=require(_0xa28a('0x1'))(_0xa28a('0x2'));var moment=require(_0xa28a('0x3'));var BPromise=require(_0xa28a('0x4'));var rp=require(_0xa28a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var attributes=require(_0xa28a('0x8'));module[_0xa28a('0x9')]=function(_0x526dec,_0x1fbde2){return _0x526dec[_0xa28a('0xa')](_0xa28a('0xb'),attributes,{'tableName':_0xa28a('0xc'),'paranoid':![],'indexes':[{'name':_0xa28a('0xd'),'fields':[_0xa28a('0xe'),_0xa28a('0xf')],'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 cbe64a1..cc1e2fd 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 _0x5e0f=['info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x2fe5a6,_0xc8dee0){var _0x3506eb=function(_0x361f3c){while(--_0x361f3c){_0x2fe5a6['push'](_0x2fe5a6['shift']());}};_0x3506eb(++_0xc8dee0);}(_0x5e0f,0x99));var _0xf5e0=function(_0xc06fc3,_0x31b690){_0xc06fc3=_0xc06fc3-0x0;var _0x5e81e1=_0x5e0f[_0xc06fc3];return _0x5e81e1;};'use strict';var _=require(_0xf5e0('0x0'));var util=require('util');var moment=require(_0xf5e0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5e0('0x2'));var db=require(_0xf5e0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5e0('0x4'))(_0xf5e0('0x5'));var config=require('../../config/environment');var jayson=require(_0xf5e0('0x6'));var client=jayson['client'][_0xf5e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4153ac,_0x4e7b90,_0x4bd7d5){return new BPromise(function(_0x47385d,_0x4efd00){return client['request'](_0x4153ac,_0x4bd7d5)[_0xf5e0('0x8')](function(_0x4fdaec){logger[_0xf5e0('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x4e7b90,_0xf5e0('0xa'));logger[_0xf5e0('0xb')](_0xf5e0('0xc'),_0x4e7b90,_0xf5e0('0xa'),JSON[_0xf5e0('0xd')](_0x4fdaec));if(_0x4fdaec[_0xf5e0('0xe')]){if(_0x4fdaec[_0xf5e0('0xe')][_0xf5e0('0xf')]===0x1f4){logger[_0xf5e0('0xe')](_0xf5e0('0x10'),_0x4e7b90,_0x4fdaec[_0xf5e0('0xe')]['message']);return _0x4efd00(_0x4fdaec[_0xf5e0('0xe')][_0xf5e0('0x11')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x4e7b90,_0x4fdaec[_0xf5e0('0xe')]['message']);return _0x47385d(_0x4fdaec[_0xf5e0('0xe')][_0xf5e0('0x11')]);}else{logger[_0xf5e0('0x9')](_0xf5e0('0x10'),_0x4e7b90,_0xf5e0('0xa'));_0x47385d(_0x4fdaec['result'][_0xf5e0('0x11')]);}})['catch'](function(_0x3bfbd6){logger[_0xf5e0('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x4e7b90,_0x3bfbd6);_0x4efd00(_0x3bfbd6);});});} \ No newline at end of file +var _0xe9e8=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0xe9e8,0x13c));var _0x8e9e=function(_0x437ce4,_0x1031db){_0x437ce4=_0x437ce4-0x0;var _0x495c20=_0xe9e8[_0x437ce4];return _0x495c20;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require('moment');var BPromise=require(_0x8e9e('0x2'));var rs=require(_0x8e9e('0x3'));var fs=require('fs');var Redis=require(_0x8e9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x5'))(_0x8e9e('0x6'));var config=require(_0x8e9e('0x7'));var jayson=require(_0x8e9e('0x8'));var client=jayson[_0x8e9e('0x9')][_0x8e9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d094,_0x306c73,_0x1a55e5){return new BPromise(function(_0x54e33e,_0x5c53c6){return client[_0x8e9e('0xb')](_0x36d094,_0x1a55e5)['then'](function(_0x168628){logger[_0x8e9e('0xc')](_0x8e9e('0xd'),_0x306c73,_0x8e9e('0xe'));logger[_0x8e9e('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x306c73,_0x8e9e('0xe'),JSON[_0x8e9e('0x10')](_0x168628));if(_0x168628['error']){if(_0x168628['error'][_0x8e9e('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x306c73,_0x168628[_0x8e9e('0x12')][_0x8e9e('0x13')]);return _0x5c53c6(_0x168628[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x306c73,_0x168628['error'][_0x8e9e('0x13')]);return _0x54e33e(_0x168628[_0x8e9e('0x12')][_0x8e9e('0x13')]);}else{logger['info'](_0x8e9e('0xd'),_0x306c73,_0x8e9e('0xe'));_0x54e33e(_0x168628['result'][_0x8e9e('0x13')]);}})[_0x8e9e('0x14')](function(_0xad9fe){logger['error'](_0x8e9e('0xd'),_0x306c73,_0xad9fe);_0x5c53c6(_0xad9fe);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a1a1fa1..040268c 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 _0xf4eb=['getFields','create','put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x484712,_0x1b6538){var _0x39f7b6=function(_0x4362b5){while(--_0x4362b5){_0x484712['push'](_0x484712['shift']());}};_0x39f7b6(++_0x1b6538);}(_0xf4eb,0xec));var _0xbf4e=function(_0x28eee3,_0x81f208){_0x28eee3=_0x28eee3-0x0;var _0x1ad0d1=_0xf4eb[_0x28eee3];return _0x1ad0d1;};'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['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xc')]);router['post'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['addConfiguration']);router[_0xbf4e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);module[_0xbf4e('0x12')]=router; \ No newline at end of file +var _0x39cb=['put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0x5dc3f6,_0x1fc463){var _0x257802=function(_0xc0871c){while(--_0xc0871c){_0x5dc3f6['push'](_0x5dc3f6['shift']());}};_0x257802(++_0x1fc463);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['show']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),controller[_0xb39c('0xf')]);router[_0xb39c('0xe')](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x10')]);router[_0xb39c('0x11')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x14')]);module[_0xb39c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 6d1ed4f..901853b 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 _0xb44a=['STRING'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0xb44a,0x1c2));var _0xab44=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0xb44a[_0xe4bb3d];return _0xd9e51;};'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 +var _0x7708=['sequelize','exports','STRING','remoteUri'];(function(_0x4b5935,_0x221fb0){var _0x2c86f3=function(_0x207dad){while(--_0x207dad){_0x4b5935['push'](_0x4b5935['shift']());}};_0x2c86f3(++_0x221fb0);}(_0x7708,0x188));var _0x8770=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x7708[_0x33975c];return _0x1c15ab;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8770('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8770('0x3')},'serverUrl':{'type':Sequelize[_0x8770('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 7cf061f..cecabc8 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 _0x90bd=['filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','FreshsalesConfiguration','order','nolimit','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0x90bd,0x1db));var _0xd90b=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x90bd[_0x231b2e];return _0x3feb2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd90b('0x0'));var zipdir=require(_0xd90b('0x1'));var jsonpatch=require(_0xd90b('0x2'));var rp=require(_0xd90b('0x3'));var moment=require(_0xd90b('0x4'));var BPromise=require(_0xd90b('0x5'));var Mustache=require('mustache');var util=require(_0xd90b('0x6'));var path=require(_0xd90b('0x7'));var sox=require('sox');var csv=require(_0xd90b('0x8'));var ejs=require(_0xd90b('0x9'));var fs=require('fs');var fs_extra=require(_0xd90b('0xa'));var _=require(_0xd90b('0xb'));var squel=require(_0xd90b('0xc'));var crypto=require(_0xd90b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd90b('0xe'));var toCsv=require(_0xd90b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd90b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd90b('0x10'));var as=require(_0xd90b('0x11'));var hardwareService=require(_0xd90b('0x12'));var logger=require(_0xd90b('0x13'))(_0xd90b('0x14'));var utils=require(_0xd90b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd90b('0x16'))['db'];var integrations=require(_0xd90b('0x17'));function respondWithStatusCode(_0x4ee6d3,_0x523061){_0x523061=_0x523061||0xcc;return function(_0x3a7321){if(_0x3a7321){return _0x4ee6d3[_0xd90b('0x18')](_0x523061);}return _0x4ee6d3['status'](_0x523061)['end']();};}function respondWithResult(_0x1c99bb,_0x48dc6c){_0x48dc6c=_0x48dc6c||0xc8;return function(_0xe621c0){if(_0xe621c0){return _0x1c99bb['status'](_0x48dc6c)[_0xd90b('0x19')](_0xe621c0);}};}function respondWithFilteredResult(_0x30d09a,_0xdcb648){return function(_0x550d4d){if(_0x550d4d){var _0x2e5fb7=typeof _0xdcb648['offset']===_0xd90b('0x1a')&&typeof _0xdcb648[_0xd90b('0x1b')]===_0xd90b('0x1a');var _0x21d458=_0x550d4d[_0xd90b('0x1c')];var _0x23a251=_0x2e5fb7?0x0:_0xdcb648[_0xd90b('0x1d')];var _0x2f3013=_0x2e5fb7?_0x550d4d[_0xd90b('0x1c')]:_0xdcb648['offset']+_0xdcb648[_0xd90b('0x1b')];var _0x15b845;if(_0x2f3013>=_0x21d458){_0x2f3013=_0x21d458;_0x15b845=0xc8;}else{_0x15b845=0xce;}_0x30d09a[_0xd90b('0x1e')](_0x15b845);return _0x30d09a[_0xd90b('0x1f')](_0xd90b('0x20'),_0x23a251+'-'+_0x2f3013+'/'+_0x21d458)[_0xd90b('0x19')](_0x550d4d);}return null;};}function patchUpdates(_0x5673a1){return function(_0x556255){try{jsonpatch[_0xd90b('0x21')](_0x556255,_0x5673a1,!![]);}catch(_0x358ad8){return BPromise[_0xd90b('0x22')](_0x358ad8);}return _0x556255['save']();};}function saveUpdates(_0x4a3d28,_0x4a2b98){return function(_0x5df486){if(_0x5df486){return _0x5df486[_0xd90b('0x23')](_0x4a3d28)[_0xd90b('0x24')](function(_0x24c913){return _0x24c913;});}return null;};}function removeEntity(_0x4aa3c1,_0x56e28a){return function(_0x22aae8){if(_0x22aae8){return _0x22aae8[_0xd90b('0x25')]()[_0xd90b('0x24')](function(){_0x4aa3c1[_0xd90b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e85d,_0x651be8){return function(_0xbbe504){if(!_0xbbe504){_0x31e85d[_0xd90b('0x18')](0x194);}return _0xbbe504;};}function handleError(_0x3c5ea1,_0x47dc35){_0x47dc35=_0x47dc35||0x1f4;return function(_0x36f856){logger[_0xd90b('0x26')](_0x36f856[_0xd90b('0x27')]);if(_0x36f856[_0xd90b('0x28')]){delete _0x36f856[_0xd90b('0x28')];}_0x3c5ea1[_0xd90b('0x1e')](_0x47dc35)[_0xd90b('0x29')](_0x36f856);};}exports['index']=function(_0x836c44,_0x484d23){var _0x90ba6d={},_0x3fa877={},_0x232888={'count':0x0,'rows':[]};var _0x555adc=_['map'](db[_0xd90b('0x2a')][_0xd90b('0x2b')],function(_0x4ad67c){return{'name':_0x4ad67c[_0xd90b('0x2c')],'type':_0x4ad67c[_0xd90b('0x2d')][_0xd90b('0x2e')]};});_0x3fa877[_0xd90b('0x2f')]=_['map'](_0x555adc,'name');_0x3fa877[_0xd90b('0x30')]=_[_0xd90b('0x31')](_0x836c44[_0xd90b('0x30')]);_0x3fa877[_0xd90b('0x32')]=_[_0xd90b('0x33')](_0x3fa877['model'],_0x3fa877[_0xd90b('0x30')]);_0x90ba6d[_0xd90b('0x34')]=_[_0xd90b('0x33')](_0x3fa877[_0xd90b('0x2f')],qs[_0xd90b('0x35')](_0x836c44['query']['fields']));_0x90ba6d[_0xd90b('0x34')]=_0x90ba6d[_0xd90b('0x34')][_0xd90b('0x36')]?_0x90ba6d[_0xd90b('0x34')]:_0x3fa877[_0xd90b('0x2f')];if(!_0x836c44[_0xd90b('0x30')][_0xd90b('0x37')]('nolimit')){_0x90ba6d['limit']=qs[_0xd90b('0x1b')](_0x836c44['query'][_0xd90b('0x1b')]);_0x90ba6d[_0xd90b('0x1d')]=qs[_0xd90b('0x1d')](_0x836c44[_0xd90b('0x30')][_0xd90b('0x1d')]);}_0x90ba6d['order']=qs[_0xd90b('0x38')](_0x836c44[_0xd90b('0x30')][_0xd90b('0x38')]);_0x90ba6d[_0xd90b('0x39')]=qs['filters'](_[_0xd90b('0x3a')](_0x836c44[_0xd90b('0x30')],_0x3fa877[_0xd90b('0x32')]),_0x555adc);if(_0x836c44[_0xd90b('0x30')]['filter']){_0x90ba6d[_0xd90b('0x39')]=_[_0xd90b('0x3b')](_0x90ba6d[_0xd90b('0x39')],{'$or':_[_0xd90b('0x3c')](_0x555adc,function(_0x2bcd86){if(_0x2bcd86[_0xd90b('0x2d')]!==_0xd90b('0x3d')){var _0x5167d7={};_0x5167d7[_0x2bcd86['name']]={'$like':'%'+_0x836c44[_0xd90b('0x30')][_0xd90b('0x3e')]+'%'};return _0x5167d7;}})});}_0x90ba6d=_[_0xd90b('0x3b')]({},_0x90ba6d,_0x836c44[_0xd90b('0x3f')]);var _0x5d25f0={'where':_0x90ba6d[_0xd90b('0x39')]};return db[_0xd90b('0x2a')]['count'](_0x5d25f0)['then'](function(_0x2dd0a7){_0x232888[_0xd90b('0x1c')]=_0x2dd0a7;if(_0x836c44[_0xd90b('0x30')][_0xd90b('0x40')]){_0x90ba6d[_0xd90b('0x41')]=[{'all':!![]}];}return db[_0xd90b('0x2a')][_0xd90b('0x42')](_0x90ba6d);})['then'](function(_0x1bb092){_0x232888[_0xd90b('0x43')]=_0x1bb092;return _0x232888;})[_0xd90b('0x24')](respondWithFilteredResult(_0x484d23,_0x90ba6d))[_0xd90b('0x44')](handleError(_0x484d23,null));};exports[_0xd90b('0x45')]=function(_0x5d86c4,_0x2c23b5){var _0x2bbc3e={'raw':![],'where':{'id':_0x5d86c4[_0xd90b('0x46')]['id']}},_0x50c185={};_0x50c185['model']=_[_0xd90b('0x31')](db[_0xd90b('0x2a')]['rawAttributes']);_0x50c185[_0xd90b('0x30')]=_[_0xd90b('0x31')](_0x5d86c4[_0xd90b('0x30')]);_0x50c185[_0xd90b('0x32')]=_[_0xd90b('0x33')](_0x50c185['model'],_0x50c185[_0xd90b('0x30')]);_0x2bbc3e['attributes']=_['intersection'](_0x50c185['model'],qs['fields'](_0x5d86c4[_0xd90b('0x30')]['fields']));_0x2bbc3e['attributes']=_0x2bbc3e[_0xd90b('0x34')][_0xd90b('0x36')]?_0x2bbc3e[_0xd90b('0x34')]:_0x50c185[_0xd90b('0x2f')];if(_0x5d86c4[_0xd90b('0x30')][_0xd90b('0x40')]){_0x2bbc3e[_0xd90b('0x41')]=[{'all':!![]}];}_0x2bbc3e=_['merge']({},_0x2bbc3e,_0x5d86c4[_0xd90b('0x3f')]);return db[_0xd90b('0x2a')][_0xd90b('0x47')](_0x2bbc3e)[_0xd90b('0x24')](handleEntityNotFound(_0x2c23b5,null))['then'](respondWithResult(_0x2c23b5,null))[_0xd90b('0x44')](handleError(_0x2c23b5,null));};exports[_0xd90b('0x48')]=function(_0x1788e5,_0x59a00f){return db['FreshsalesAccount'][_0xd90b('0x48')](_0x1788e5['body'],{})[_0xd90b('0x24')](respondWithResult(_0x59a00f,0xc9))['catch'](handleError(_0x59a00f,null));};exports['update']=function(_0x2da0f0,_0x3b3b85){if(_0x2da0f0[_0xd90b('0x49')]['id']){delete _0x2da0f0[_0xd90b('0x49')]['id'];}return db['FreshsalesAccount'][_0xd90b('0x47')]({'where':{'id':_0x2da0f0[_0xd90b('0x46')]['id']}})[_0xd90b('0x24')](handleEntityNotFound(_0x3b3b85,null))[_0xd90b('0x24')](saveUpdates(_0x2da0f0[_0xd90b('0x49')],null))[_0xd90b('0x24')](respondWithResult(_0x3b3b85,null))[_0xd90b('0x44')](handleError(_0x3b3b85,null));};exports[_0xd90b('0x25')]=function(_0x323498,_0x3a418a){return db[_0xd90b('0x2a')][_0xd90b('0x47')]({'where':{'id':_0x323498[_0xd90b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a418a,null))[_0xd90b('0x24')](removeEntity(_0x3a418a,null))[_0xd90b('0x44')](handleError(_0x3a418a,null));};exports[_0xd90b('0x4a')]=function(_0x5f2660,_0x2ffabf,_0x364e65){var _0x50c4c2={};var _0x2dbfff={};var _0xb6e539;var _0x1f6346;return db[_0xd90b('0x2a')]['findOne']({'where':{'id':_0x5f2660[_0xd90b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ffabf,null))[_0xd90b('0x24')](function(_0x127a32){if(_0x127a32){_0xb6e539=_0x127a32;_0x2dbfff[_0xd90b('0x2f')]=_[_0xd90b('0x31')](db[_0xd90b('0x4b')]['rawAttributes']);_0x2dbfff[_0xd90b('0x30')]=_[_0xd90b('0x31')](_0x5f2660[_0xd90b('0x30')]);_0x2dbfff['filters']=_[_0xd90b('0x33')](_0x2dbfff[_0xd90b('0x2f')],_0x2dbfff['query']);_0x50c4c2[_0xd90b('0x34')]=_[_0xd90b('0x33')](_0x2dbfff[_0xd90b('0x2f')],qs['fields'](_0x5f2660[_0xd90b('0x30')][_0xd90b('0x35')]));_0x50c4c2[_0xd90b('0x34')]=_0x50c4c2[_0xd90b('0x34')][_0xd90b('0x36')]?_0x50c4c2[_0xd90b('0x34')]:_0x2dbfff['model'];_0x50c4c2[_0xd90b('0x4c')]=qs[_0xd90b('0x38')](_0x5f2660[_0xd90b('0x30')][_0xd90b('0x38')]);_0x50c4c2[_0xd90b('0x39')]=qs[_0xd90b('0x32')](_[_0xd90b('0x3a')](_0x5f2660[_0xd90b('0x30')],_0x2dbfff[_0xd90b('0x32')]));if(_0x5f2660[_0xd90b('0x30')][_0xd90b('0x3e')]){_0x50c4c2[_0xd90b('0x39')]=_[_0xd90b('0x3b')](_0x50c4c2[_0xd90b('0x39')],{'$or':_[_0xd90b('0x3c')](_0x50c4c2[_0xd90b('0x34')],function(_0x4ef262){var _0x2b5b6d={};_0x2b5b6d[_0x4ef262]={'$like':'%'+_0x5f2660[_0xd90b('0x30')][_0xd90b('0x3e')]+'%'};return _0x2b5b6d;})});}_0x50c4c2=_[_0xd90b('0x3b')]({},_0x50c4c2,_0x5f2660[_0xd90b('0x3f')]);return _0xb6e539['getConfigurations'](_0x50c4c2);}})[_0xd90b('0x24')](function(_0x2483df){if(_0x2483df){_0x1f6346=_0x2483df[_0xd90b('0x36')];if(!_0x5f2660['query'][_0xd90b('0x37')](_0xd90b('0x4d'))){_0x50c4c2['limit']=qs[_0xd90b('0x1b')](_0x5f2660[_0xd90b('0x30')][_0xd90b('0x1b')]);_0x50c4c2[_0xd90b('0x1d')]=qs[_0xd90b('0x1d')](_0x5f2660[_0xd90b('0x30')][_0xd90b('0x1d')]);}return _0xb6e539[_0xd90b('0x4a')](_0x50c4c2);}})[_0xd90b('0x24')](function(_0x496ed8){if(_0x496ed8){return _0x496ed8?{'count':_0x1f6346,'rows':_0x496ed8}:null;}})['then'](respondWithResult(_0x2ffabf,null))[_0xd90b('0x44')](handleError(_0x2ffabf,null));};exports[_0xd90b('0x4e')]=function(_0x430036,_0x4404d2,_0x93db12){if(_0x430036['body']['id']){delete _0x430036[_0xd90b('0x49')]['id'];}return db[_0xd90b('0x2a')][_0xd90b('0x4f')]({'where':{'id':_0x430036['params']['id']}})['then'](handleEntityNotFound(_0x4404d2,null))['then'](function(_0x112505){if(_0x112505){_0x430036[_0xd90b('0x49')]['AccountId']=_0x112505['id'];_0x430036[_0xd90b('0x49')][_0xd90b('0x50')]=integrations[_0xd90b('0x51')](_0x430036['body']['channel'],_0x430036[_0xd90b('0x49')][_0xd90b('0x2d')]);_0x430036['body'][_0xd90b('0x52')]=integrations[_0xd90b('0x53')](_0x430036[_0xd90b('0x49')][_0xd90b('0x54')],_0x430036[_0xd90b('0x49')][_0xd90b('0x2d')]);return db[_0xd90b('0x4b')][_0xd90b('0x48')](_0x430036[_0xd90b('0x49')],{'include':[{'model':db[_0xd90b('0x55')],'as':'Subjects'},{'model':db[_0xd90b('0x55')],'as':_0xd90b('0x52')}]});}return null;})[_0xd90b('0x24')](respondWithResult(_0x4404d2,null))[_0xd90b('0x44')](handleError(_0x4404d2,null));};exports[_0xd90b('0x56')]=function(_0xb5596f,_0x42197e,_0x36a804){var _0x5ab668='';var _0x66697d='';return db[_0xd90b('0x2a')][_0xd90b('0x4f')]({'where':{'id':_0xb5596f['params']['id']},'attributes':['id',_0xd90b('0x57'),'remoteUri',_0xd90b('0x58')]})[_0xd90b('0x24')](handleEntityNotFound(_0x42197e,null))[_0xd90b('0x24')](function(_0xb78266){if(_0xb78266){_0x66697d=_0xb78266[_0xd90b('0x57')];_0x5ab668=_0xb78266[_0xd90b('0x59')];var _0x19dcfa=_0xb78266[_0xd90b('0x59')][_0xd90b('0x5a')](-0x1);if(_0x19dcfa==='/'){_0x5ab668=_0x5ab668[_0xd90b('0x5b')](0x0,_0x5ab668[_0xd90b('0x5c')](_0x19dcfa));}return rp({'method':_0xd90b('0x5d'),'uri':util[_0xd90b('0x5e')](_0xd90b('0x5f'),_0x5ab668,_0xd90b('0x60')),'headers':{'Authorization':_0xd90b('0x61')+_0xb78266['apiKey']},'json':!![]});}})[_0xd90b('0x24')](function(_0x30cbf7){if(_0x30cbf7){var _0x48c5cc=_0x30cbf7[_0xd90b('0x62')];var _0x2a5739=![];var _0x1ba8aa=null;for(_0x1ba8aa=0x0;_0x1ba8aa<_0x48c5cc[_0xd90b('0x36')];_0x1ba8aa++){if(_0x48c5cc[_0x1ba8aa][_0xd90b('0x63')]===_0x66697d){_0x2a5739=!![];}}if(_0x2a5739){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xd90b('0x24')](respondWithResult(_0x42197e,null))[_0xd90b('0x44')](function(_0x1b17b){var _0x3c7654=_0xb5596f[_0xd90b('0x30')][_0xd90b('0x64')]?0x1f4:_0x1b17b[_0xd90b('0x65')]||0x1f4;logger[_0xd90b('0x26')](_0xd90b('0x66'),_0xd90b('0x56'),_0x3c7654,JSON[_0xd90b('0x67')](_0x1b17b));delete _0x1b17b['name'];if(_0x3c7654===0x191){_0x3c7654=0x190;}_0x42197e['status'](_0x3c7654)[_0xd90b('0x29')](_0xb5596f[_0xd90b('0x30')]['test']?{'message':_0xd90b('0x68'),'statusCode':_0x1b17b[_0xd90b('0x65')]}:_0x1b17b);});}; \ No newline at end of file +var _0x5657=['AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','GET','format','/api/selector/owners','Token\x20token=','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','fieldName','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','merge','type','VIRTUAL','options','include','FreshsalesAccount','rows','catch','show','params','rawAttributes','intersection','length','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','sort','pick','filter','addConfiguration'];(function(_0x2b7d84,_0x2ad684){var _0x35fdda=function(_0x10fc1b){while(--_0x10fc1b){_0x2b7d84['push'](_0x2b7d84['shift']());}};_0x35fdda(++_0x2ad684);}(_0x5657,0xe4));var _0x7565=function(_0x42208e,_0x158301){_0x42208e=_0x42208e-0x0;var _0x42adbe=_0x5657[_0x42208e];return _0x42adbe;};'use strict';var emlformat=require(_0x7565('0x0'));var rimraf=require(_0x7565('0x1'));var zipdir=require(_0x7565('0x2'));var jsonpatch=require(_0x7565('0x3'));var rp=require(_0x7565('0x4'));var moment=require(_0x7565('0x5'));var BPromise=require(_0x7565('0x6'));var Mustache=require(_0x7565('0x7'));var util=require('util');var path=require(_0x7565('0x8'));var sox=require(_0x7565('0x9'));var csv=require('to-csv');var ejs=require(_0x7565('0xa'));var fs=require('fs');var fs_extra=require(_0x7565('0xb'));var _=require('lodash');var squel=require(_0x7565('0xc'));var crypto=require(_0x7565('0xd'));var jsforce=require(_0x7565('0xe'));var deskjs=require(_0x7565('0xf'));var toCsv=require(_0x7565('0x10'));var querystring=require(_0x7565('0x11'));var Papa=require('papaparse');var Redis=require(_0x7565('0x12'));var authService=require(_0x7565('0x13'));var qs=require(_0x7565('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7565('0x15'));var logger=require(_0x7565('0x16'))(_0x7565('0x17'));var utils=require('../../config/utils');var config=require(_0x7565('0x18'));var licenseUtil=require(_0x7565('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7565('0x1a'));function respondWithStatusCode(_0x189cfa,_0x379895){_0x379895=_0x379895||0xcc;return function(_0x9e04b9){if(_0x9e04b9){return _0x189cfa[_0x7565('0x1b')](_0x379895);}return _0x189cfa['status'](_0x379895)[_0x7565('0x1c')]();};}function respondWithResult(_0x4da4a8,_0x53e1f8){_0x53e1f8=_0x53e1f8||0xc8;return function(_0x32e62e){if(_0x32e62e){return _0x4da4a8[_0x7565('0x1d')](_0x53e1f8)[_0x7565('0x1e')](_0x32e62e);}};}function respondWithFilteredResult(_0x237f97,_0x148a29){return function(_0x47e8fc){if(_0x47e8fc){var _0x18a947=typeof _0x148a29[_0x7565('0x1f')]==='undefined'&&typeof _0x148a29[_0x7565('0x20')]==='undefined';var _0xef33cf=_0x47e8fc[_0x7565('0x21')];var _0x4a1e80=_0x18a947?0x0:_0x148a29[_0x7565('0x1f')];var _0x33022d=_0x18a947?_0x47e8fc[_0x7565('0x21')]:_0x148a29[_0x7565('0x1f')]+_0x148a29[_0x7565('0x20')];var _0x4f9e3f;if(_0x33022d>=_0xef33cf){_0x33022d=_0xef33cf;_0x4f9e3f=0xc8;}else{_0x4f9e3f=0xce;}_0x237f97[_0x7565('0x1d')](_0x4f9e3f);return _0x237f97[_0x7565('0x22')](_0x7565('0x23'),_0x4a1e80+'-'+_0x33022d+'/'+_0xef33cf)[_0x7565('0x1e')](_0x47e8fc);}return null;};}function patchUpdates(_0x5088ad){return function(_0x743205){try{jsonpatch['apply'](_0x743205,_0x5088ad,!![]);}catch(_0x5cec00){return BPromise[_0x7565('0x24')](_0x5cec00);}return _0x743205['save']();};}function saveUpdates(_0x2c0db5,_0x56dd66){return function(_0x5b4e9d){if(_0x5b4e9d){return _0x5b4e9d[_0x7565('0x25')](_0x2c0db5)[_0x7565('0x26')](function(_0x2648bb){return _0x2648bb;});}return null;};}function removeEntity(_0x3b8870,_0x408412){return function(_0x5064df){if(_0x5064df){return _0x5064df[_0x7565('0x27')]()[_0x7565('0x26')](function(){_0x3b8870[_0x7565('0x1d')](0xcc)[_0x7565('0x1c')]();});}};}function handleEntityNotFound(_0x1472d3,_0x154455){return function(_0x32daa7){if(!_0x32daa7){_0x1472d3[_0x7565('0x1b')](0x194);}return _0x32daa7;};}function handleError(_0x457016,_0x46e3b9){_0x46e3b9=_0x46e3b9||0x1f4;return function(_0xb13807){logger[_0x7565('0x28')](_0xb13807['stack']);if(_0xb13807['name']){delete _0xb13807[_0x7565('0x29')];}_0x457016[_0x7565('0x1d')](_0x46e3b9)[_0x7565('0x2a')](_0xb13807);};}exports[_0x7565('0x2b')]=function(_0x37bd1d,_0x6964be){var _0x21c69a={},_0x2966a1={},_0x5ead5c={'count':0x0,'rows':[]};var _0xcaa7e7=_[_0x7565('0x2c')](db['FreshsalesAccount']['rawAttributes'],function(_0x2506c5){return{'name':_0x2506c5[_0x7565('0x2d')],'type':_0x2506c5['type'][_0x7565('0x2e')]};});_0x2966a1['model']=_[_0x7565('0x2c')](_0xcaa7e7,_0x7565('0x29'));_0x2966a1[_0x7565('0x2f')]=_[_0x7565('0x30')](_0x37bd1d[_0x7565('0x2f')]);_0x2966a1['filters']=_['intersection'](_0x2966a1[_0x7565('0x31')],_0x2966a1[_0x7565('0x2f')]);_0x21c69a[_0x7565('0x32')]=_['intersection'](_0x2966a1['model'],qs[_0x7565('0x33')](_0x37bd1d[_0x7565('0x2f')][_0x7565('0x33')]));_0x21c69a['attributes']=_0x21c69a['attributes']['length']?_0x21c69a[_0x7565('0x32')]:_0x2966a1['model'];if(!_0x37bd1d[_0x7565('0x2f')][_0x7565('0x34')](_0x7565('0x35'))){_0x21c69a[_0x7565('0x20')]=qs[_0x7565('0x20')](_0x37bd1d[_0x7565('0x2f')][_0x7565('0x20')]);_0x21c69a[_0x7565('0x1f')]=qs[_0x7565('0x1f')](_0x37bd1d[_0x7565('0x2f')][_0x7565('0x1f')]);}_0x21c69a[_0x7565('0x36')]=qs['sort'](_0x37bd1d[_0x7565('0x2f')]['sort']);_0x21c69a[_0x7565('0x37')]=qs['filters'](_['pick'](_0x37bd1d[_0x7565('0x2f')],_0x2966a1[_0x7565('0x38')]),_0xcaa7e7);if(_0x37bd1d[_0x7565('0x2f')]['filter']){_0x21c69a[_0x7565('0x37')]=_[_0x7565('0x39')](_0x21c69a['where'],{'$or':_[_0x7565('0x2c')](_0xcaa7e7,function(_0x16522e){if(_0x16522e[_0x7565('0x3a')]!==_0x7565('0x3b')){var _0x291174={};_0x291174[_0x16522e[_0x7565('0x29')]]={'$like':'%'+_0x37bd1d['query']['filter']+'%'};return _0x291174;}})});}_0x21c69a=_[_0x7565('0x39')]({},_0x21c69a,_0x37bd1d[_0x7565('0x3c')]);var _0x4f73f2={'where':_0x21c69a[_0x7565('0x37')]};return db['FreshsalesAccount'][_0x7565('0x21')](_0x4f73f2)[_0x7565('0x26')](function(_0x16a939){_0x5ead5c[_0x7565('0x21')]=_0x16a939;if(_0x37bd1d['query']['includeAll']){_0x21c69a[_0x7565('0x3d')]=[{'all':!![]}];}return db[_0x7565('0x3e')]['findAll'](_0x21c69a);})['then'](function(_0x200c20){_0x5ead5c[_0x7565('0x3f')]=_0x200c20;return _0x5ead5c;})['then'](respondWithFilteredResult(_0x6964be,_0x21c69a))[_0x7565('0x40')](handleError(_0x6964be,null));};exports[_0x7565('0x41')]=function(_0x5392a0,_0x384b03){var _0x280914={'raw':![],'where':{'id':_0x5392a0[_0x7565('0x42')]['id']}},_0x389979={};_0x389979['model']=_['keys'](db[_0x7565('0x3e')][_0x7565('0x43')]);_0x389979[_0x7565('0x2f')]=_[_0x7565('0x30')](_0x5392a0['query']);_0x389979[_0x7565('0x38')]=_[_0x7565('0x44')](_0x389979['model'],_0x389979[_0x7565('0x2f')]);_0x280914[_0x7565('0x32')]=_[_0x7565('0x44')](_0x389979['model'],qs[_0x7565('0x33')](_0x5392a0[_0x7565('0x2f')][_0x7565('0x33')]));_0x280914[_0x7565('0x32')]=_0x280914[_0x7565('0x32')][_0x7565('0x45')]?_0x280914[_0x7565('0x32')]:_0x389979[_0x7565('0x31')];if(_0x5392a0[_0x7565('0x2f')][_0x7565('0x46')]){_0x280914[_0x7565('0x3d')]=[{'all':!![]}];}_0x280914=_[_0x7565('0x39')]({},_0x280914,_0x5392a0['options']);return db['FreshsalesAccount'][_0x7565('0x47')](_0x280914)[_0x7565('0x26')](handleEntityNotFound(_0x384b03,null))[_0x7565('0x26')](respondWithResult(_0x384b03,null))[_0x7565('0x40')](handleError(_0x384b03,null));};exports['create']=function(_0x5d9c64,_0x2af8cf){return db[_0x7565('0x3e')][_0x7565('0x48')](_0x5d9c64[_0x7565('0x49')],{})['then'](respondWithResult(_0x2af8cf,0xc9))[_0x7565('0x40')](handleError(_0x2af8cf,null));};exports[_0x7565('0x25')]=function(_0x29d5bd,_0x4a23a4){if(_0x29d5bd[_0x7565('0x49')]['id']){delete _0x29d5bd[_0x7565('0x49')]['id'];}return db[_0x7565('0x3e')][_0x7565('0x47')]({'where':{'id':_0x29d5bd['params']['id']}})[_0x7565('0x26')](handleEntityNotFound(_0x4a23a4,null))[_0x7565('0x26')](saveUpdates(_0x29d5bd['body'],null))[_0x7565('0x26')](respondWithResult(_0x4a23a4,null))[_0x7565('0x40')](handleError(_0x4a23a4,null));};exports[_0x7565('0x27')]=function(_0x44f51c,_0x82dd06){return db['FreshsalesAccount'][_0x7565('0x47')]({'where':{'id':_0x44f51c[_0x7565('0x42')]['id']}})['then'](handleEntityNotFound(_0x82dd06,null))['then'](removeEntity(_0x82dd06,null))['catch'](handleError(_0x82dd06,null));};exports[_0x7565('0x4a')]=function(_0x5ca895,_0x1e673c,_0x235c7b){var _0x56aa31={};var _0x5b32f3={};var _0x3f7a94;var _0x44a42e;return db[_0x7565('0x3e')][_0x7565('0x4b')]({'where':{'id':_0x5ca895['params']['id']}})[_0x7565('0x26')](handleEntityNotFound(_0x1e673c,null))['then'](function(_0x41afeb){if(_0x41afeb){_0x3f7a94=_0x41afeb;_0x5b32f3[_0x7565('0x31')]=_['keys'](db[_0x7565('0x4c')][_0x7565('0x43')]);_0x5b32f3[_0x7565('0x2f')]=_[_0x7565('0x30')](_0x5ca895[_0x7565('0x2f')]);_0x5b32f3['filters']=_[_0x7565('0x44')](_0x5b32f3[_0x7565('0x31')],_0x5b32f3[_0x7565('0x2f')]);_0x56aa31[_0x7565('0x32')]=_[_0x7565('0x44')](_0x5b32f3['model'],qs[_0x7565('0x33')](_0x5ca895['query'][_0x7565('0x33')]));_0x56aa31[_0x7565('0x32')]=_0x56aa31[_0x7565('0x32')][_0x7565('0x45')]?_0x56aa31[_0x7565('0x32')]:_0x5b32f3['model'];_0x56aa31[_0x7565('0x36')]=qs[_0x7565('0x4d')](_0x5ca895[_0x7565('0x2f')][_0x7565('0x4d')]);_0x56aa31[_0x7565('0x37')]=qs[_0x7565('0x38')](_[_0x7565('0x4e')](_0x5ca895[_0x7565('0x2f')],_0x5b32f3[_0x7565('0x38')]));if(_0x5ca895[_0x7565('0x2f')][_0x7565('0x4f')]){_0x56aa31[_0x7565('0x37')]=_['merge'](_0x56aa31[_0x7565('0x37')],{'$or':_['map'](_0x56aa31[_0x7565('0x32')],function(_0x3b2c7b){var _0x7942d={};_0x7942d[_0x3b2c7b]={'$like':'%'+_0x5ca895['query'][_0x7565('0x4f')]+'%'};return _0x7942d;})});}_0x56aa31=_[_0x7565('0x39')]({},_0x56aa31,_0x5ca895[_0x7565('0x3c')]);return _0x3f7a94[_0x7565('0x4a')](_0x56aa31);}})['then'](function(_0x16ead6){if(_0x16ead6){_0x44a42e=_0x16ead6[_0x7565('0x45')];if(!_0x5ca895[_0x7565('0x2f')][_0x7565('0x34')]('nolimit')){_0x56aa31[_0x7565('0x20')]=qs[_0x7565('0x20')](_0x5ca895[_0x7565('0x2f')][_0x7565('0x20')]);_0x56aa31['offset']=qs[_0x7565('0x1f')](_0x5ca895[_0x7565('0x2f')][_0x7565('0x1f')]);}return _0x3f7a94[_0x7565('0x4a')](_0x56aa31);}})['then'](function(_0xd5f8a6){if(_0xd5f8a6){return _0xd5f8a6?{'count':_0x44a42e,'rows':_0xd5f8a6}:null;}})[_0x7565('0x26')](respondWithResult(_0x1e673c,null))[_0x7565('0x40')](handleError(_0x1e673c,null));};exports[_0x7565('0x50')]=function(_0x92169c,_0x3692fd,_0x48fda1){if(_0x92169c[_0x7565('0x49')]['id']){delete _0x92169c[_0x7565('0x49')]['id'];}return db[_0x7565('0x3e')]['findOne']({'where':{'id':_0x92169c['params']['id']}})['then'](handleEntityNotFound(_0x3692fd,null))[_0x7565('0x26')](function(_0xd0750c){if(_0xd0750c){_0x92169c[_0x7565('0x49')][_0x7565('0x51')]=_0xd0750c['id'];_0x92169c[_0x7565('0x49')][_0x7565('0x52')]=integrations[_0x7565('0x53')](_0x92169c['body'][_0x7565('0x54')],_0x92169c[_0x7565('0x49')]['type']);_0x92169c[_0x7565('0x49')][_0x7565('0x55')]=integrations['getDescriptions'](_0x92169c['body'][_0x7565('0x54')],_0x92169c['body']['type']);return db[_0x7565('0x4c')][_0x7565('0x48')](_0x92169c[_0x7565('0x49')],{'include':[{'model':db[_0x7565('0x56')],'as':_0x7565('0x52')},{'model':db['FreshsalesField'],'as':_0x7565('0x55')}]});}return null;})[_0x7565('0x26')](respondWithResult(_0x3692fd,null))[_0x7565('0x40')](handleError(_0x3692fd,null));};exports[_0x7565('0x57')]=function(_0x47d9da,_0x1949ba,_0x5b5e69){var _0x5d9120='';var _0x4fe1d='';return db[_0x7565('0x3e')][_0x7565('0x4b')]({'where':{'id':_0x47d9da[_0x7565('0x42')]['id']},'attributes':['id',_0x7565('0x58'),'remoteUri',_0x7565('0x59')]})['then'](handleEntityNotFound(_0x1949ba,null))[_0x7565('0x26')](function(_0x285c2e){if(_0x285c2e){_0x4fe1d=_0x285c2e[_0x7565('0x58')];_0x5d9120=_0x285c2e[_0x7565('0x5a')];var _0x482cdf=_0x285c2e[_0x7565('0x5a')][_0x7565('0x5b')](-0x1);if(_0x482cdf==='/'){_0x5d9120=_0x5d9120[_0x7565('0x5c')](0x0,_0x5d9120['lastIndexOf'](_0x482cdf));}return rp({'method':_0x7565('0x5d'),'uri':util[_0x7565('0x5e')]('%s%s',_0x5d9120,_0x7565('0x5f')),'headers':{'Authorization':_0x7565('0x60')+_0x285c2e[_0x7565('0x59')]},'json':!![]});}})[_0x7565('0x26')](function(_0x1088d9){if(_0x1088d9){var _0x2ea8c7=_0x1088d9[_0x7565('0x61')];var _0x580c13=![];var _0x1173af=null;for(_0x1173af=0x0;_0x1173af<_0x2ea8c7[_0x7565('0x45')];_0x1173af++){if(_0x2ea8c7[_0x1173af][_0x7565('0x62')]===_0x4fe1d){_0x580c13=!![];}}if(_0x580c13){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x7565('0x26')](respondWithResult(_0x1949ba,null))['catch'](function(_0x947f30){var _0x2f3452=_0x47d9da[_0x7565('0x2f')]['test']?0x1f4:_0x947f30[_0x7565('0x63')]||0x1f4;logger[_0x7565('0x28')](_0x7565('0x64'),'getFields',_0x2f3452,JSON[_0x7565('0x65')](_0x947f30));delete _0x947f30['name'];if(_0x2f3452===0x191){_0x2f3452=0x190;}_0x1949ba[_0x7565('0x1d')](_0x2f3452)[_0x7565('0x2a')](_0x47d9da[_0x7565('0x2f')][_0x7565('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x947f30[_0x7565('0x63')]}:_0x947f30);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0d84800..d544e8f 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(_0x5806a2,_0x55dbf0){var _0x2057fe=function(_0xdac334){while(--_0xdac334){_0x5806a2['push'](_0x5806a2['shift']());}};_0x2057fe(++_0x55dbf0);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x24a1f3,_0x3268ec){_0x24a1f3=_0x24a1f3-0x0;var _0x428b65=_0x0adf[_0x24a1f3];return _0x428b65;};'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 _0x7bd0=['path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x72ee00,_0x4f9a0c){var _0x4da881=function(_0x5f1dc2){while(--_0x5f1dc2){_0x72ee00['push'](_0x72ee00['shift']());}};_0x4da881(++_0x4f9a0c);}(_0x7bd0,0x111));var _0x07bd=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x7bd0[_0x3d2e4b];return _0x509e78;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));var integrations=require(_0x07bd('0xa'));module[_0x07bd('0xb')]=function(_0x3e8349,_0x422a22){return _0x3e8349[_0x07bd('0xc')]('FreshsalesAccount',attributes,{'tableName':_0x07bd('0xd'),'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 311a6e3..c07df1e 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 _0x7bd0=['limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FreshsalesAccount','findAll','options','raw','where','attributes'];(function(_0x41dabb,_0x5afa1a){var _0x1c78bb=function(_0x5b3f21){while(--_0x5b3f21){_0x41dabb['push'](_0x41dabb['shift']());}};_0x1c78bb(++_0x5afa1a);}(_0x7bd0,0x111));var _0x07bd=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0x7bd0[_0xf363f0];return _0x55a386;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('FreshsalesAccount,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['GetFreshsalesAccount']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')]({'raw':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1d')]||null:null,'attributes':_0x3f9f0b['options']?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1f')]||null:null,'include':_0x3f9f0b['options']?_0x3f9f0b['options'][_0x07bd('0x20')]?_['map'](_0x3f9f0b[_0x07bd('0x1b')]['include'],function(_0x50bd12){return{'model':db[_0x50bd12[_0x07bd('0x21')]],'as':_0x50bd12['as'],'attributes':_0x50bd12[_0x07bd('0x1e')],'include':_0x50bd12[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x50bd12[_0x07bd('0x20')],function(_0x43cbc8){return{'model':db[_0x43cbc8['model']],'as':_0x43cbc8['as'],'attributes':_0x43cbc8[_0x07bd('0x1e')],'include':_0x43cbc8[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x43cbc8[_0x07bd('0x20')],function(_0x12ce26){return{'model':db[_0x12ce26[_0x07bd('0x21')]],'as':_0x12ce26['as'],'attributes':_0x12ce26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5184dc){logger[_0x07bd('0x17')](_0x07bd('0x23'),_0x3f9f0b);logger[_0x07bd('0x11')]('GetFreshsalesAccount',_0x3f9f0b,JSON[_0x07bd('0x13')](_0x5184dc));_0x4948f4(_0x5184dc);})[_0x07bd('0x18')](function(_0x253dc0){logger[_0x07bd('0x14')](_0x07bd('0x23'),_0x253dc0[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0x253dc0[_0x07bd('0x16')]));});});};exports[_0x07bd('0x24')]=function(_0x4182b9){var _0x321200=this;return new Promise(function(_0x1b6cc,_0x314bda){return db[_0x07bd('0x19')][_0x07bd('0x25')]({'raw':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')]['where']||null:null,'attributes':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'include':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x20')],function(_0x5f29c5){return{'model':db[_0x5f29c5[_0x07bd('0x21')]],'as':_0x5f29c5['as'],'attributes':_0x5f29c5[_0x07bd('0x1e')],'include':_0x5f29c5[_0x07bd('0x20')]?_['map'](_0x5f29c5[_0x07bd('0x20')],function(_0x31c381){return{'model':db[_0x31c381['model']],'as':_0x31c381['as'],'attributes':_0x31c381[_0x07bd('0x1e')],'include':_0x31c381[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x31c381[_0x07bd('0x20')],function(_0x5cde8d){return{'model':db[_0x5cde8d['model']],'as':_0x5cde8d['as'],'attributes':_0x5cde8d[_0x07bd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2878){logger[_0x07bd('0x17')](_0x07bd('0x24'),_0x4182b9);logger[_0x07bd('0x11')](_0x07bd('0x24'),_0x4182b9,JSON[_0x07bd('0x13')](_0x3c2878));_0x1b6cc(_0x3c2878);})[_0x07bd('0x18')](function(_0x333ac2){logger[_0x07bd('0x14')](_0x07bd('0x24'),_0x333ac2[_0x07bd('0x16')],_0x4182b9);_0x314bda(_0x321200[_0x07bd('0x14')](0x1f4,_0x333ac2[_0x07bd('0x16')]));});});}; \ No newline at end of file +var _0x32b6=['raw','where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','GetFreshsalesAccount','FreshsalesAccount','findAll','options'];(function(_0xbeef65,_0x3e3c1d){var _0x46f037=function(_0xcf9eb8){while(--_0xcf9eb8){_0xbeef65['push'](_0xbeef65['shift']());}};_0x46f037(++_0x3e3c1d);}(_0x32b6,0x1d1));var _0x632b=function(_0x5942a9,_0xd623a5){_0x5942a9=_0x5942a9-0x0;var _0x2b08be=_0x32b6[_0x5942a9];return _0x2b08be;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')]({'raw':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1a')]||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f['options'][_0x632b('0x1b')]||null:null,'limit':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x18')][_0x632b('0x1c')]||null:null,'include':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x3bb27f['options'][_0x632b('0x1d')],function(_0x379dc2){return{'model':db[_0x379dc2[_0x632b('0x1f')]],'as':_0x379dc2['as'],'attributes':_0x379dc2[_0x632b('0x1b')],'include':_0x379dc2[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x379dc2['include'],function(_0x5e7b20){return{'model':db[_0x5e7b20[_0x632b('0x1f')]],'as':_0x5e7b20['as'],'attributes':_0x5e7b20['attributes'],'include':_0x5e7b20[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x5e7b20['include'],function(_0x273e89){return{'model':db[_0x273e89[_0x632b('0x1f')]],'as':_0x273e89['as'],'attributes':_0x273e89[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x4728a8){logger[_0x632b('0x14')](_0x632b('0x15'),_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON['stringify'](_0x4728a8));_0x51c894(_0x4728a8);})[_0x632b('0x20')](function(_0x35348e){logger[_0x632b('0x10')](_0x632b('0x15'),_0x35348e[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x35348e[_0x632b('0x13')]));});});};exports[_0x632b('0x21')]=function(_0x1ace1b){var _0x319df3=this;return new Promise(function(_0x417793,_0x35584f){return db[_0x632b('0x16')][_0x632b('0x22')]({'raw':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1a')]||null:null,'attributes':_0x1ace1b['options']?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1b')]||null:null,'include':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')]['include']?_[_0x632b('0x1e')](_0x1ace1b['options'][_0x632b('0x1d')],function(_0x15b22d){return{'model':db[_0x15b22d['model']],'as':_0x15b22d['as'],'attributes':_0x15b22d[_0x632b('0x1b')],'include':_0x15b22d[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x15b22d[_0x632b('0x1d')],function(_0x27bbf5){return{'model':db[_0x27bbf5[_0x632b('0x1f')]],'as':_0x27bbf5['as'],'attributes':_0x27bbf5[_0x632b('0x1b')],'include':_0x27bbf5[_0x632b('0x1d')]?_['map'](_0x27bbf5['include'],function(_0x22ae6a){return{'model':db[_0x22ae6a[_0x632b('0x1f')]],'as':_0x22ae6a['as'],'attributes':_0x22ae6a[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x384420){logger[_0x632b('0x14')](_0x632b('0x21'),_0x1ace1b);logger[_0x632b('0xd')]('ShowFreshsalesAccount',_0x1ace1b,JSON['stringify'](_0x384420));_0x417793(_0x384420);})[_0x632b('0x20')](function(_0x581b92){logger[_0x632b('0x10')](_0x632b('0x21'),_0x581b92[_0x632b('0x13')],_0x1ace1b);_0x35584f(_0x319df3[_0x632b('0x10')](0x1f4,_0x581b92[_0x632b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index f5b9cc7..4b75409 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 _0x9a25=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','post','put','update','delete','destroy','exports','util'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x9a25,0x1a1));var _0x59a2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9a25[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x59a2('0x0'));var path=require(_0x59a2('0x1'));var timeout=require(_0x59a2('0x2'));var express=require(_0x59a2('0x3'));var router=express['Router']();var fs_extra=require(_0x59a2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x59a2('0x5'));var config=require(_0x59a2('0x6'));var controller=require(_0x59a2('0x7'));router[_0x59a2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x59a2('0x8')](_0x59a2('0x9'),auth[_0x59a2('0xa')](),controller[_0x59a2('0xb')]);router[_0x59a2('0x8')](_0x59a2('0xc'),auth[_0x59a2('0xa')](),controller[_0x59a2('0xd')]);router[_0x59a2('0x8')]('/:id/descriptions',auth[_0x59a2('0xa')](),controller[_0x59a2('0xe')]);router[_0x59a2('0x8')](_0x59a2('0xf'),auth[_0x59a2('0xa')](),controller['getFields']);router[_0x59a2('0x10')]('/',auth[_0x59a2('0xa')](),controller['create']);router[_0x59a2('0x11')]('/:id',auth[_0x59a2('0xa')](),controller[_0x59a2('0x12')]);router[_0x59a2('0x13')]('/:id',auth[_0x59a2('0xa')](),controller[_0x59a2('0x14')]);module[_0x59a2('0x15')]=router; \ No newline at end of file +var _0x7a11=['getDescriptions','/:id/fields','getFields','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','getSubjects','/:id/descriptions'];(function(_0x5751ac,_0x339559){var _0x449cd1=function(_0x389c9f){while(--_0x389c9f){_0x5751ac['push'](_0x5751ac['shift']());}};_0x449cd1(++_0x339559);}(_0x7a11,0x177));var _0x17a1=function(_0x5aef12,_0x1edd9d){_0x5aef12=_0x5aef12-0x0;var _0x245089=_0x7a11[_0x5aef12];return _0x245089;};'use strict';var multer=require(_0x17a1('0x0'));var util=require(_0x17a1('0x1'));var path=require(_0x17a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x17a1('0x3'));var router=express[_0x17a1('0x4')]();var fs_extra=require(_0x17a1('0x5'));var auth=require(_0x17a1('0x6'));var interaction=require(_0x17a1('0x7'));var config=require(_0x17a1('0x8'));var controller=require(_0x17a1('0x9'));router[_0x17a1('0xa')]('/',auth['isAuthenticated'](),controller[_0x17a1('0xb')]);router[_0x17a1('0xa')](_0x17a1('0xc'),auth[_0x17a1('0xd')](),controller['show']);router['get']('/:id/subjects',auth[_0x17a1('0xd')](),controller[_0x17a1('0xe')]);router[_0x17a1('0xa')](_0x17a1('0xf'),auth['isAuthenticated'](),controller[_0x17a1('0x10')]);router[_0x17a1('0xa')](_0x17a1('0x11'),auth['isAuthenticated'](),controller[_0x17a1('0x12')]);router['post']('/',auth[_0x17a1('0xd')](),controller[_0x17a1('0x13')]);router[_0x17a1('0x14')]('/:id',auth[_0x17a1('0xd')](),controller[_0x17a1('0x15')]);router['delete']('/:id',auth[_0x17a1('0xd')](),controller['destroy']);module[_0x17a1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 884b301..fb74b38 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 _0xd3a9=['STRING','sequelize'];(function(_0x4ecfff,_0x468d60){var _0x347743=function(_0x3f6872){while(--_0x3f6872){_0x4ecfff['push'](_0x4ecfff['shift']());}};_0x347743(++_0x468d60);}(_0xd3a9,0x107));var _0x9d3a=function(_0x575946,_0x1bb20e){_0x575946=_0x575946-0x0;var _0x277443=_0xd3a9[_0x575946];return _0x277443;};'use strict';var Sequelize=require(_0x9d3a('0x0'));module['exports']={'name':{'type':Sequelize[_0x9d3a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc19c=['STRING','sequelize'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xc19c,0x161));var _0xcc19=function(_0x1ecb51,_0xa0a419){_0x1ecb51=_0x1ecb51-0x0;var _0x2fb505=_0xc19c[_0x1ecb51];return _0x2fb505;};'use strict';var Sequelize=require(_0xcc19('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc19('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index dc5fd38..396e7b9 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 _0x0c8b=['include','findAll','rows','catch','show','FreshsalesConfiguration','length','find','create','body','params','destroy','getSubjects','findOne','FreshsalesField','order','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x2ee5f2,_0x2a1ad8){var _0x44138d=function(_0x2b1453){while(--_0x2b1453){_0x2ee5f2['push'](_0x2ee5f2['shift']());}};_0x44138d(++_0x2a1ad8);}(_0x0c8b,0x65));var _0xb0c8=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x0c8b[_0x7275e9];return _0x17b99d;};'use strict';var emlformat=require(_0xb0c8('0x0'));var rimraf=require(_0xb0c8('0x1'));var zipdir=require(_0xb0c8('0x2'));var jsonpatch=require(_0xb0c8('0x3'));var rp=require(_0xb0c8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb0c8('0x5'));var util=require(_0xb0c8('0x6'));var path=require('path');var sox=require(_0xb0c8('0x7'));var csv=require(_0xb0c8('0x8'));var ejs=require(_0xb0c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0c8('0xa'));var squel=require('squel');var crypto=require(_0xb0c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb0c8('0xc'));var toCsv=require(_0xb0c8('0x8'));var querystring=require(_0xb0c8('0xd'));var Papa=require(_0xb0c8('0xe'));var Redis=require(_0xb0c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb0c8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0c8('0x11'));var logger=require(_0xb0c8('0x12'))(_0xb0c8('0x13'));var utils=require(_0xb0c8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb0c8('0x15'));var db=require(_0xb0c8('0x16'))['db'];function respondWithStatusCode(_0x1be979,_0x4409c2){_0x4409c2=_0x4409c2||0xcc;return function(_0x304365){if(_0x304365){return _0x1be979[_0xb0c8('0x17')](_0x4409c2);}return _0x1be979[_0xb0c8('0x18')](_0x4409c2)[_0xb0c8('0x19')]();};}function respondWithResult(_0x44dd32,_0x45bfda){_0x45bfda=_0x45bfda||0xc8;return function(_0x2f4eda){if(_0x2f4eda){return _0x44dd32[_0xb0c8('0x18')](_0x45bfda)[_0xb0c8('0x1a')](_0x2f4eda);}};}function respondWithFilteredResult(_0x5c6bb5,_0x201c99){return function(_0x12eecf){if(_0x12eecf){var _0x331744=typeof _0x201c99[_0xb0c8('0x1b')]===_0xb0c8('0x1c')&&typeof _0x201c99[_0xb0c8('0x1d')]==='undefined';var _0x40540b=_0x12eecf[_0xb0c8('0x1e')];var _0x26f3de=_0x331744?0x0:_0x201c99[_0xb0c8('0x1b')];var _0x422f1e=_0x331744?_0x12eecf[_0xb0c8('0x1e')]:_0x201c99[_0xb0c8('0x1b')]+_0x201c99['limit'];var _0x3b7678;if(_0x422f1e>=_0x40540b){_0x422f1e=_0x40540b;_0x3b7678=0xc8;}else{_0x3b7678=0xce;}_0x5c6bb5['status'](_0x3b7678);return _0x5c6bb5[_0xb0c8('0x1f')](_0xb0c8('0x20'),_0x26f3de+'-'+_0x422f1e+'/'+_0x40540b)[_0xb0c8('0x1a')](_0x12eecf);}return null;};}function patchUpdates(_0x22dad7){return function(_0x3e6e76){try{jsonpatch[_0xb0c8('0x21')](_0x3e6e76,_0x22dad7,!![]);}catch(_0x55a70f){return BPromise[_0xb0c8('0x22')](_0x55a70f);}return _0x3e6e76[_0xb0c8('0x23')]();};}function saveUpdates(_0x482d72,_0x54e7a5){return function(_0x377cf4){if(_0x377cf4){return _0x377cf4[_0xb0c8('0x24')](_0x482d72)[_0xb0c8('0x25')](function(_0x2248f3){return _0x2248f3;});}return null;};}function removeEntity(_0x528281,_0x15070b){return function(_0x338c51){if(_0x338c51){return _0x338c51['destroy']()['then'](function(){_0x528281[_0xb0c8('0x18')](0xcc)[_0xb0c8('0x19')]();});}};}function handleEntityNotFound(_0x3e007d,_0x1af079){return function(_0x53f5d1){if(!_0x53f5d1){_0x3e007d[_0xb0c8('0x17')](0x194);}return _0x53f5d1;};}function handleError(_0x24f2fa,_0x1d7800){_0x1d7800=_0x1d7800||0x1f4;return function(_0x3f5e6f){logger[_0xb0c8('0x26')](_0x3f5e6f[_0xb0c8('0x27')]);if(_0x3f5e6f[_0xb0c8('0x28')]){delete _0x3f5e6f[_0xb0c8('0x28')];}_0x24f2fa[_0xb0c8('0x18')](_0x1d7800)[_0xb0c8('0x29')](_0x3f5e6f);};}exports[_0xb0c8('0x2a')]=function(_0x9c4832,_0x2ec27f){var _0xc884b4={},_0x2b5a05={},_0x445357={'count':0x0,'rows':[]};var _0x39beae=_[_0xb0c8('0x2b')](db['FreshsalesConfiguration'][_0xb0c8('0x2c')],function(_0x41754d){return{'name':_0x41754d[_0xb0c8('0x2d')],'type':_0x41754d[_0xb0c8('0x2e')][_0xb0c8('0x2f')]};});_0x2b5a05[_0xb0c8('0x30')]=_[_0xb0c8('0x2b')](_0x39beae,'name');_0x2b5a05[_0xb0c8('0x31')]=_[_0xb0c8('0x32')](_0x9c4832[_0xb0c8('0x31')]);_0x2b5a05[_0xb0c8('0x33')]=_[_0xb0c8('0x34')](_0x2b5a05[_0xb0c8('0x30')],_0x2b5a05[_0xb0c8('0x31')]);_0xc884b4[_0xb0c8('0x35')]=_[_0xb0c8('0x34')](_0x2b5a05['model'],qs[_0xb0c8('0x36')](_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x36')]));_0xc884b4['attributes']=_0xc884b4[_0xb0c8('0x35')]['length']?_0xc884b4['attributes']:_0x2b5a05['model'];if(!_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x37')](_0xb0c8('0x38'))){_0xc884b4[_0xb0c8('0x1d')]=qs[_0xb0c8('0x1d')](_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x1d')]);_0xc884b4[_0xb0c8('0x1b')]=qs[_0xb0c8('0x1b')](_0x9c4832[_0xb0c8('0x31')]['offset']);}_0xc884b4['order']=qs[_0xb0c8('0x39')](_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x39')]);_0xc884b4[_0xb0c8('0x3a')]=qs[_0xb0c8('0x33')](_[_0xb0c8('0x3b')](_0x9c4832[_0xb0c8('0x31')],_0x2b5a05[_0xb0c8('0x33')]),_0x39beae);if(_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x3c')]){_0xc884b4[_0xb0c8('0x3a')]=_[_0xb0c8('0x3d')](_0xc884b4[_0xb0c8('0x3a')],{'$or':_[_0xb0c8('0x2b')](_0x39beae,function(_0x4b2388){if(_0x4b2388[_0xb0c8('0x2e')]!==_0xb0c8('0x3e')){var _0x29db74={};_0x29db74[_0x4b2388[_0xb0c8('0x28')]]={'$like':'%'+_0x9c4832[_0xb0c8('0x31')][_0xb0c8('0x3c')]+'%'};return _0x29db74;}})});}_0xc884b4=_[_0xb0c8('0x3d')]({},_0xc884b4,_0x9c4832[_0xb0c8('0x3f')]);var _0x1c44ed={'where':_0xc884b4['where']};return db['FreshsalesConfiguration'][_0xb0c8('0x1e')](_0x1c44ed)[_0xb0c8('0x25')](function(_0x4016ca){_0x445357[_0xb0c8('0x1e')]=_0x4016ca;if(_0x9c4832['query'][_0xb0c8('0x40')]){_0xc884b4[_0xb0c8('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xb0c8('0x42')](_0xc884b4);})[_0xb0c8('0x25')](function(_0x35e807){_0x445357[_0xb0c8('0x43')]=_0x35e807;return _0x445357;})[_0xb0c8('0x25')](respondWithFilteredResult(_0x2ec27f,_0xc884b4))[_0xb0c8('0x44')](handleError(_0x2ec27f,null));};exports[_0xb0c8('0x45')]=function(_0x2b16b2,_0x221e08){var _0x45591f={'raw':![],'where':{'id':_0x2b16b2['params']['id']}},_0x2a0779={};_0x2a0779[_0xb0c8('0x30')]=_['keys'](db[_0xb0c8('0x46')][_0xb0c8('0x2c')]);_0x2a0779[_0xb0c8('0x31')]=_[_0xb0c8('0x32')](_0x2b16b2[_0xb0c8('0x31')]);_0x2a0779[_0xb0c8('0x33')]=_[_0xb0c8('0x34')](_0x2a0779['model'],_0x2a0779[_0xb0c8('0x31')]);_0x45591f[_0xb0c8('0x35')]=_[_0xb0c8('0x34')](_0x2a0779['model'],qs['fields'](_0x2b16b2[_0xb0c8('0x31')][_0xb0c8('0x36')]));_0x45591f['attributes']=_0x45591f[_0xb0c8('0x35')][_0xb0c8('0x47')]?_0x45591f[_0xb0c8('0x35')]:_0x2a0779['model'];if(_0x2b16b2[_0xb0c8('0x31')][_0xb0c8('0x40')]){_0x45591f[_0xb0c8('0x41')]=[{'all':!![]}];}_0x45591f=_[_0xb0c8('0x3d')]({},_0x45591f,_0x2b16b2[_0xb0c8('0x3f')]);return db[_0xb0c8('0x46')][_0xb0c8('0x48')](_0x45591f)['then'](handleEntityNotFound(_0x221e08,null))[_0xb0c8('0x25')](respondWithResult(_0x221e08,null))['catch'](handleError(_0x221e08,null));};exports['create']=function(_0xc777c9,_0x1cf0c2){return db[_0xb0c8('0x46')][_0xb0c8('0x49')](_0xc777c9[_0xb0c8('0x4a')],{})[_0xb0c8('0x25')](respondWithResult(_0x1cf0c2,0xc9))[_0xb0c8('0x44')](handleError(_0x1cf0c2,null));};exports['update']=function(_0x40cc8f,_0x4ddd7){if(_0x40cc8f['body']['id']){delete _0x40cc8f[_0xb0c8('0x4a')]['id'];}return db[_0xb0c8('0x46')]['find']({'where':{'id':_0x40cc8f[_0xb0c8('0x4b')]['id']}})[_0xb0c8('0x25')](handleEntityNotFound(_0x4ddd7,null))[_0xb0c8('0x25')](saveUpdates(_0x40cc8f['body'],null))['then'](respondWithResult(_0x4ddd7,null))[_0xb0c8('0x44')](handleError(_0x4ddd7,null));};exports[_0xb0c8('0x4c')]=function(_0x3952da,_0x2d201f){return db['FreshsalesConfiguration'][_0xb0c8('0x48')]({'where':{'id':_0x3952da[_0xb0c8('0x4b')]['id']}})[_0xb0c8('0x25')](handleEntityNotFound(_0x2d201f,null))[_0xb0c8('0x25')](removeEntity(_0x2d201f,null))[_0xb0c8('0x44')](handleError(_0x2d201f,null));};exports[_0xb0c8('0x4d')]=function(_0x265951,_0xd46e0,_0x592222){var _0x5c4c03={};var _0x56ef46={};var _0x404ac2;var _0x57493c;return db[_0xb0c8('0x46')][_0xb0c8('0x4e')]({'where':{'id':_0x265951[_0xb0c8('0x4b')]['id']}})[_0xb0c8('0x25')](handleEntityNotFound(_0xd46e0,null))[_0xb0c8('0x25')](function(_0x2f4fa0){if(_0x2f4fa0){_0x404ac2=_0x2f4fa0;_0x56ef46[_0xb0c8('0x30')]=_['keys'](db[_0xb0c8('0x4f')]['rawAttributes']);_0x56ef46[_0xb0c8('0x31')]=_[_0xb0c8('0x32')](_0x265951[_0xb0c8('0x31')]);_0x56ef46[_0xb0c8('0x33')]=_['intersection'](_0x56ef46[_0xb0c8('0x30')],_0x56ef46[_0xb0c8('0x31')]);_0x5c4c03[_0xb0c8('0x35')]=_[_0xb0c8('0x34')](_0x56ef46[_0xb0c8('0x30')],qs[_0xb0c8('0x36')](_0x265951[_0xb0c8('0x31')][_0xb0c8('0x36')]));_0x5c4c03['attributes']=_0x5c4c03[_0xb0c8('0x35')][_0xb0c8('0x47')]?_0x5c4c03[_0xb0c8('0x35')]:_0x56ef46['model'];_0x5c4c03[_0xb0c8('0x50')]=qs[_0xb0c8('0x39')](_0x265951[_0xb0c8('0x31')][_0xb0c8('0x39')]);_0x5c4c03[_0xb0c8('0x3a')]=qs[_0xb0c8('0x33')](_[_0xb0c8('0x3b')](_0x265951[_0xb0c8('0x31')],_0x56ef46['filters']));if(_0x265951[_0xb0c8('0x31')]['filter']){_0x5c4c03[_0xb0c8('0x3a')]=_[_0xb0c8('0x3d')](_0x5c4c03[_0xb0c8('0x3a')],{'$or':_[_0xb0c8('0x2b')](_0x5c4c03[_0xb0c8('0x35')],function(_0x4923af){var _0x1a2069={};_0x1a2069[_0x4923af]={'$like':'%'+_0x265951[_0xb0c8('0x31')][_0xb0c8('0x3c')]+'%'};return _0x1a2069;})});}_0x5c4c03=_[_0xb0c8('0x3d')]({},_0x5c4c03,_0x265951[_0xb0c8('0x3f')]);return _0x404ac2[_0xb0c8('0x4d')](_0x5c4c03);}})[_0xb0c8('0x25')](function(_0x34c30c){if(_0x34c30c){_0x57493c=_0x34c30c['length'];if(!_0x265951['query']['hasOwnProperty'](_0xb0c8('0x38'))){_0x5c4c03[_0xb0c8('0x1d')]=qs['limit'](_0x265951[_0xb0c8('0x31')][_0xb0c8('0x1d')]);_0x5c4c03[_0xb0c8('0x1b')]=qs[_0xb0c8('0x1b')](_0x265951[_0xb0c8('0x31')][_0xb0c8('0x1b')]);}return _0x404ac2[_0xb0c8('0x4d')](_0x5c4c03);}})[_0xb0c8('0x25')](function(_0x36477b){if(_0x36477b){return _0x36477b?{'count':_0x57493c,'rows':_0x36477b}:null;}})[_0xb0c8('0x25')](respondWithResult(_0xd46e0,null))[_0xb0c8('0x44')](handleError(_0xd46e0,null));};exports[_0xb0c8('0x51')]=function(_0x7c06d4,_0x19fdf2,_0x146b6b){var _0x13d595={};var _0x53b0d1={};var _0x1bfad7;var _0x39662f;return db[_0xb0c8('0x46')][_0xb0c8('0x4e')]({'where':{'id':_0x7c06d4[_0xb0c8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19fdf2,null))['then'](function(_0x48b2db){if(_0x48b2db){_0x1bfad7=_0x48b2db;_0x53b0d1[_0xb0c8('0x30')]=_[_0xb0c8('0x32')](db[_0xb0c8('0x4f')][_0xb0c8('0x2c')]);_0x53b0d1['query']=_[_0xb0c8('0x32')](_0x7c06d4[_0xb0c8('0x31')]);_0x53b0d1[_0xb0c8('0x33')]=_['intersection'](_0x53b0d1[_0xb0c8('0x30')],_0x53b0d1[_0xb0c8('0x31')]);_0x13d595[_0xb0c8('0x35')]=_[_0xb0c8('0x34')](_0x53b0d1[_0xb0c8('0x30')],qs[_0xb0c8('0x36')](_0x7c06d4[_0xb0c8('0x31')]['fields']));_0x13d595[_0xb0c8('0x35')]=_0x13d595['attributes'][_0xb0c8('0x47')]?_0x13d595[_0xb0c8('0x35')]:_0x53b0d1[_0xb0c8('0x30')];_0x13d595[_0xb0c8('0x50')]=qs['sort'](_0x7c06d4[_0xb0c8('0x31')][_0xb0c8('0x39')]);_0x13d595[_0xb0c8('0x3a')]=qs['filters'](_[_0xb0c8('0x3b')](_0x7c06d4['query'],_0x53b0d1['filters']));if(_0x7c06d4['query'][_0xb0c8('0x3c')]){_0x13d595[_0xb0c8('0x3a')]=_['merge'](_0x13d595[_0xb0c8('0x3a')],{'$or':_['map'](_0x13d595[_0xb0c8('0x35')],function(_0x2fbef0){var _0x30a040={};_0x30a040[_0x2fbef0]={'$like':'%'+_0x7c06d4[_0xb0c8('0x31')]['filter']+'%'};return _0x30a040;})});}_0x13d595=_[_0xb0c8('0x3d')]({},_0x13d595,_0x7c06d4[_0xb0c8('0x3f')]);return _0x1bfad7[_0xb0c8('0x51')](_0x13d595);}})['then'](function(_0x278308){if(_0x278308){_0x39662f=_0x278308[_0xb0c8('0x47')];if(!_0x7c06d4['query'][_0xb0c8('0x37')](_0xb0c8('0x38'))){_0x13d595[_0xb0c8('0x1d')]=qs[_0xb0c8('0x1d')](_0x7c06d4[_0xb0c8('0x31')][_0xb0c8('0x1d')]);_0x13d595[_0xb0c8('0x1b')]=qs['offset'](_0x7c06d4[_0xb0c8('0x31')][_0xb0c8('0x1b')]);}return _0x1bfad7[_0xb0c8('0x51')](_0x13d595);}})[_0xb0c8('0x25')](function(_0x3f948e){if(_0x3f948e){return _0x3f948e?{'count':_0x39662f,'rows':_0x3f948e}:null;}})[_0xb0c8('0x25')](respondWithResult(_0x19fdf2,null))[_0xb0c8('0x44')](handleError(_0x19fdf2,null));};exports['getFields']=function(_0xaa0f08,_0x3ab97c,_0x37bb7d){var _0x42b35c={};var _0x28e7d6={};var _0x54ebab;var _0x58f6a0;return db[_0xb0c8('0x46')][_0xb0c8('0x4e')]({'where':{'id':_0xaa0f08[_0xb0c8('0x4b')]['id']}})[_0xb0c8('0x25')](handleEntityNotFound(_0x3ab97c,null))['then'](function(_0x2adb97){if(_0x2adb97){_0x54ebab=_0x2adb97;_0x28e7d6['model']=_[_0xb0c8('0x32')](db[_0xb0c8('0x4f')]['rawAttributes']);_0x28e7d6[_0xb0c8('0x31')]=_['keys'](_0xaa0f08[_0xb0c8('0x31')]);_0x28e7d6[_0xb0c8('0x33')]=_[_0xb0c8('0x34')](_0x28e7d6[_0xb0c8('0x30')],_0x28e7d6[_0xb0c8('0x31')]);_0x42b35c[_0xb0c8('0x35')]=_[_0xb0c8('0x34')](_0x28e7d6[_0xb0c8('0x30')],qs[_0xb0c8('0x36')](_0xaa0f08[_0xb0c8('0x31')]['fields']));_0x42b35c[_0xb0c8('0x35')]=_0x42b35c[_0xb0c8('0x35')]['length']?_0x42b35c[_0xb0c8('0x35')]:_0x28e7d6['model'];_0x42b35c[_0xb0c8('0x50')]=qs[_0xb0c8('0x39')](_0xaa0f08[_0xb0c8('0x31')][_0xb0c8('0x39')]);_0x42b35c[_0xb0c8('0x3a')]=qs[_0xb0c8('0x33')](_[_0xb0c8('0x3b')](_0xaa0f08[_0xb0c8('0x31')],_0x28e7d6[_0xb0c8('0x33')]));if(_0xaa0f08[_0xb0c8('0x31')]['filter']){_0x42b35c[_0xb0c8('0x3a')]=_[_0xb0c8('0x3d')](_0x42b35c[_0xb0c8('0x3a')],{'$or':_['map'](_0x42b35c[_0xb0c8('0x35')],function(_0x20dfa4){var _0x5ab5c1={};_0x5ab5c1[_0x20dfa4]={'$like':'%'+_0xaa0f08['query']['filter']+'%'};return _0x5ab5c1;})});}_0x42b35c=_[_0xb0c8('0x3d')]({},_0x42b35c,_0xaa0f08[_0xb0c8('0x3f')]);return _0x54ebab[_0xb0c8('0x52')](_0x42b35c);}})[_0xb0c8('0x25')](function(_0x5b0b51){if(_0x5b0b51){_0x58f6a0=_0x5b0b51[_0xb0c8('0x47')];if(!_0xaa0f08[_0xb0c8('0x31')][_0xb0c8('0x37')](_0xb0c8('0x38'))){_0x42b35c[_0xb0c8('0x1d')]=qs[_0xb0c8('0x1d')](_0xaa0f08[_0xb0c8('0x31')][_0xb0c8('0x1d')]);_0x42b35c[_0xb0c8('0x1b')]=qs[_0xb0c8('0x1b')](_0xaa0f08[_0xb0c8('0x31')][_0xb0c8('0x1b')]);}return _0x54ebab[_0xb0c8('0x52')](_0x42b35c);}})['then'](function(_0x434012){if(_0x434012){return _0x434012?{'count':_0x58f6a0,'rows':_0x434012}:null;}})[_0xb0c8('0x25')](respondWithResult(_0x3ab97c,null))[_0xb0c8('0x44')](handleError(_0x3ab97c,null));}; \ No newline at end of file +var _0x8773=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','end','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xc85eb7,_0x5526b9){var _0x50f6ba=function(_0x18f6c5){while(--_0x18f6c5){_0xc85eb7['push'](_0xc85eb7['shift']());}};_0x50f6ba(++_0x5526b9);}(_0x8773,0x108));var _0x3877=function(_0x57919e,_0xd99342){_0x57919e=_0x57919e-0x0;var _0x192e98=_0x8773[_0x57919e];return _0x192e98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3877('0x0'));var zipdir=require(_0x3877('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3877('0x2'));var moment=require(_0x3877('0x3'));var BPromise=require(_0x3877('0x4'));var Mustache=require(_0x3877('0x5'));var util=require(_0x3877('0x6'));var path=require(_0x3877('0x7'));var sox=require(_0x3877('0x8'));var csv=require(_0x3877('0x9'));var ejs=require(_0x3877('0xa'));var fs=require('fs');var fs_extra=require(_0x3877('0xb'));var _=require(_0x3877('0xc'));var squel=require(_0x3877('0xd'));var crypto=require(_0x3877('0xe'));var jsforce=require(_0x3877('0xf'));var deskjs=require(_0x3877('0x10'));var toCsv=require(_0x3877('0x9'));var querystring=require(_0x3877('0x11'));var Papa=require('papaparse');var Redis=require(_0x3877('0x12'));var authService=require(_0x3877('0x13'));var qs=require(_0x3877('0x14'));var as=require(_0x3877('0x15'));var hardwareService=require(_0x3877('0x16'));var logger=require(_0x3877('0x17'))('api');var utils=require(_0x3877('0x18'));var config=require(_0x3877('0x19'));var licenseUtil=require(_0x3877('0x1a'));var db=require(_0x3877('0x1b'))['db'];function respondWithStatusCode(_0x2b0b4e,_0x4b85bf){_0x4b85bf=_0x4b85bf||0xcc;return function(_0x143202){if(_0x143202){return _0x2b0b4e[_0x3877('0x1c')](_0x4b85bf);}return _0x2b0b4e['status'](_0x4b85bf)['end']();};}function respondWithResult(_0x34b0aa,_0x10a9e3){_0x10a9e3=_0x10a9e3||0xc8;return function(_0x4ff61b){if(_0x4ff61b){return _0x34b0aa[_0x3877('0x1d')](_0x10a9e3)[_0x3877('0x1e')](_0x4ff61b);}};}function respondWithFilteredResult(_0x266afa,_0x55245c){return function(_0x45745e){if(_0x45745e){var _0x467283=typeof _0x55245c[_0x3877('0x1f')]===_0x3877('0x20')&&typeof _0x55245c[_0x3877('0x21')]===_0x3877('0x20');var _0x1dba23=_0x45745e[_0x3877('0x22')];var _0x186b7f=_0x467283?0x0:_0x55245c[_0x3877('0x1f')];var _0x101018=_0x467283?_0x45745e[_0x3877('0x22')]:_0x55245c[_0x3877('0x1f')]+_0x55245c['limit'];var _0x38f331;if(_0x101018>=_0x1dba23){_0x101018=_0x1dba23;_0x38f331=0xc8;}else{_0x38f331=0xce;}_0x266afa[_0x3877('0x1d')](_0x38f331);return _0x266afa['set']('Content-Range',_0x186b7f+'-'+_0x101018+'/'+_0x1dba23)[_0x3877('0x1e')](_0x45745e);}return null;};}function patchUpdates(_0x389dce){return function(_0x40a7ae){try{jsonpatch[_0x3877('0x23')](_0x40a7ae,_0x389dce,!![]);}catch(_0x24f9bf){return BPromise[_0x3877('0x24')](_0x24f9bf);}return _0x40a7ae['save']();};}function saveUpdates(_0x2494d1,_0x5b9b77){return function(_0x2bcd75){if(_0x2bcd75){return _0x2bcd75[_0x3877('0x25')](_0x2494d1)[_0x3877('0x26')](function(_0x28360b){return _0x28360b;});}return null;};}function removeEntity(_0x1b5036,_0xf878e1){return function(_0x110a11){if(_0x110a11){return _0x110a11[_0x3877('0x27')]()[_0x3877('0x26')](function(){_0x1b5036[_0x3877('0x1d')](0xcc)[_0x3877('0x28')]();});}};}function handleEntityNotFound(_0x287348,_0x568b88){return function(_0x3831ae){if(!_0x3831ae){_0x287348['sendStatus'](0x194);}return _0x3831ae;};}function handleError(_0x2ecb6c,_0x2d3212){_0x2d3212=_0x2d3212||0x1f4;return function(_0x1a89de){logger[_0x3877('0x29')](_0x1a89de['stack']);if(_0x1a89de[_0x3877('0x2a')]){delete _0x1a89de[_0x3877('0x2a')];}_0x2ecb6c['status'](_0x2d3212)[_0x3877('0x2b')](_0x1a89de);};}exports[_0x3877('0x2c')]=function(_0x5f1caf,_0x5cf687){var _0xd8ecf9={},_0x1e2d90={},_0x5b4eb4={'count':0x0,'rows':[]};var _0x44fc98=_[_0x3877('0x2d')](db[_0x3877('0x2e')][_0x3877('0x2f')],function(_0x1687a1){return{'name':_0x1687a1['fieldName'],'type':_0x1687a1[_0x3877('0x30')][_0x3877('0x31')]};});_0x1e2d90[_0x3877('0x32')]=_[_0x3877('0x2d')](_0x44fc98,_0x3877('0x2a'));_0x1e2d90['query']=_['keys'](_0x5f1caf[_0x3877('0x33')]);_0x1e2d90[_0x3877('0x34')]=_[_0x3877('0x35')](_0x1e2d90[_0x3877('0x32')],_0x1e2d90['query']);_0xd8ecf9[_0x3877('0x36')]=_[_0x3877('0x35')](_0x1e2d90['model'],qs[_0x3877('0x37')](_0x5f1caf[_0x3877('0x33')][_0x3877('0x37')]));_0xd8ecf9[_0x3877('0x36')]=_0xd8ecf9[_0x3877('0x36')][_0x3877('0x38')]?_0xd8ecf9[_0x3877('0x36')]:_0x1e2d90['model'];if(!_0x5f1caf['query'][_0x3877('0x39')](_0x3877('0x3a'))){_0xd8ecf9[_0x3877('0x21')]=qs[_0x3877('0x21')](_0x5f1caf[_0x3877('0x33')][_0x3877('0x21')]);_0xd8ecf9[_0x3877('0x1f')]=qs[_0x3877('0x1f')](_0x5f1caf[_0x3877('0x33')][_0x3877('0x1f')]);}_0xd8ecf9[_0x3877('0x3b')]=qs['sort'](_0x5f1caf[_0x3877('0x33')][_0x3877('0x3c')]);_0xd8ecf9[_0x3877('0x3d')]=qs[_0x3877('0x34')](_[_0x3877('0x3e')](_0x5f1caf[_0x3877('0x33')],_0x1e2d90[_0x3877('0x34')]),_0x44fc98);if(_0x5f1caf['query'][_0x3877('0x3f')]){_0xd8ecf9['where']=_[_0x3877('0x40')](_0xd8ecf9['where'],{'$or':_[_0x3877('0x2d')](_0x44fc98,function(_0x3dcced){if(_0x3dcced['type']!==_0x3877('0x41')){var _0x428ca1={};_0x428ca1[_0x3dcced['name']]={'$like':'%'+_0x5f1caf[_0x3877('0x33')][_0x3877('0x3f')]+'%'};return _0x428ca1;}})});}_0xd8ecf9=_['merge']({},_0xd8ecf9,_0x5f1caf[_0x3877('0x42')]);var _0x360445={'where':_0xd8ecf9['where']};return db[_0x3877('0x2e')][_0x3877('0x22')](_0x360445)[_0x3877('0x26')](function(_0x2b10f0){_0x5b4eb4[_0x3877('0x22')]=_0x2b10f0;if(_0x5f1caf['query'][_0x3877('0x43')]){_0xd8ecf9[_0x3877('0x44')]=[{'all':!![]}];}return db[_0x3877('0x2e')]['findAll'](_0xd8ecf9);})[_0x3877('0x26')](function(_0x2598f2){_0x5b4eb4[_0x3877('0x45')]=_0x2598f2;return _0x5b4eb4;})[_0x3877('0x26')](respondWithFilteredResult(_0x5cf687,_0xd8ecf9))['catch'](handleError(_0x5cf687,null));};exports[_0x3877('0x46')]=function(_0x57a699,_0x5b3e10){var _0x14c9d5={'raw':![],'where':{'id':_0x57a699[_0x3877('0x47')]['id']}},_0x1d94db={};_0x1d94db[_0x3877('0x32')]=_[_0x3877('0x48')](db[_0x3877('0x2e')][_0x3877('0x2f')]);_0x1d94db['query']=_[_0x3877('0x48')](_0x57a699[_0x3877('0x33')]);_0x1d94db['filters']=_[_0x3877('0x35')](_0x1d94db['model'],_0x1d94db[_0x3877('0x33')]);_0x14c9d5['attributes']=_['intersection'](_0x1d94db['model'],qs[_0x3877('0x37')](_0x57a699['query'][_0x3877('0x37')]));_0x14c9d5[_0x3877('0x36')]=_0x14c9d5[_0x3877('0x36')][_0x3877('0x38')]?_0x14c9d5[_0x3877('0x36')]:_0x1d94db[_0x3877('0x32')];if(_0x57a699[_0x3877('0x33')][_0x3877('0x43')]){_0x14c9d5['include']=[{'all':!![]}];}_0x14c9d5=_[_0x3877('0x40')]({},_0x14c9d5,_0x57a699[_0x3877('0x42')]);return db[_0x3877('0x2e')][_0x3877('0x49')](_0x14c9d5)[_0x3877('0x26')](handleEntityNotFound(_0x5b3e10,null))[_0x3877('0x26')](respondWithResult(_0x5b3e10,null))[_0x3877('0x4a')](handleError(_0x5b3e10,null));};exports['create']=function(_0x5b2bd7,_0x15b2bb){return db['FreshsalesConfiguration']['create'](_0x5b2bd7[_0x3877('0x4b')],{})[_0x3877('0x26')](respondWithResult(_0x15b2bb,0xc9))[_0x3877('0x4a')](handleError(_0x15b2bb,null));};exports['update']=function(_0x59ea87,_0x323fad){if(_0x59ea87[_0x3877('0x4b')]['id']){delete _0x59ea87[_0x3877('0x4b')]['id'];}return db[_0x3877('0x2e')][_0x3877('0x49')]({'where':{'id':_0x59ea87[_0x3877('0x47')]['id']}})['then'](handleEntityNotFound(_0x323fad,null))[_0x3877('0x26')](saveUpdates(_0x59ea87[_0x3877('0x4b')],null))[_0x3877('0x26')](respondWithResult(_0x323fad,null))[_0x3877('0x4a')](handleError(_0x323fad,null));};exports[_0x3877('0x27')]=function(_0x13c643,_0x5c23cd){return db['FreshsalesConfiguration'][_0x3877('0x49')]({'where':{'id':_0x13c643[_0x3877('0x47')]['id']}})[_0x3877('0x26')](handleEntityNotFound(_0x5c23cd,null))['then'](removeEntity(_0x5c23cd,null))[_0x3877('0x4a')](handleError(_0x5c23cd,null));};exports[_0x3877('0x4c')]=function(_0x13a05f,_0x528e6b,_0x1ed546){var _0x1d2ee8={};var _0x57bf07={};var _0x24c0e5;var _0x59428c;return db[_0x3877('0x2e')][_0x3877('0x4d')]({'where':{'id':_0x13a05f[_0x3877('0x47')]['id']}})[_0x3877('0x26')](handleEntityNotFound(_0x528e6b,null))['then'](function(_0x26c33a){if(_0x26c33a){_0x24c0e5=_0x26c33a;_0x57bf07[_0x3877('0x32')]=_[_0x3877('0x48')](db[_0x3877('0x4e')][_0x3877('0x2f')]);_0x57bf07[_0x3877('0x33')]=_[_0x3877('0x48')](_0x13a05f[_0x3877('0x33')]);_0x57bf07[_0x3877('0x34')]=_['intersection'](_0x57bf07['model'],_0x57bf07[_0x3877('0x33')]);_0x1d2ee8[_0x3877('0x36')]=_[_0x3877('0x35')](_0x57bf07[_0x3877('0x32')],qs[_0x3877('0x37')](_0x13a05f[_0x3877('0x33')][_0x3877('0x37')]));_0x1d2ee8[_0x3877('0x36')]=_0x1d2ee8[_0x3877('0x36')][_0x3877('0x38')]?_0x1d2ee8[_0x3877('0x36')]:_0x57bf07[_0x3877('0x32')];_0x1d2ee8[_0x3877('0x3b')]=qs['sort'](_0x13a05f['query'][_0x3877('0x3c')]);_0x1d2ee8['where']=qs[_0x3877('0x34')](_[_0x3877('0x3e')](_0x13a05f[_0x3877('0x33')],_0x57bf07['filters']));if(_0x13a05f['query'][_0x3877('0x3f')]){_0x1d2ee8[_0x3877('0x3d')]=_[_0x3877('0x40')](_0x1d2ee8[_0x3877('0x3d')],{'$or':_[_0x3877('0x2d')](_0x1d2ee8[_0x3877('0x36')],function(_0x3fa3a3){var _0x53a2c7={};_0x53a2c7[_0x3fa3a3]={'$like':'%'+_0x13a05f[_0x3877('0x33')]['filter']+'%'};return _0x53a2c7;})});}_0x1d2ee8=_['merge']({},_0x1d2ee8,_0x13a05f['options']);return _0x24c0e5[_0x3877('0x4c')](_0x1d2ee8);}})[_0x3877('0x26')](function(_0x4f3fc6){if(_0x4f3fc6){_0x59428c=_0x4f3fc6[_0x3877('0x38')];if(!_0x13a05f[_0x3877('0x33')][_0x3877('0x39')](_0x3877('0x3a'))){_0x1d2ee8[_0x3877('0x21')]=qs[_0x3877('0x21')](_0x13a05f[_0x3877('0x33')]['limit']);_0x1d2ee8['offset']=qs[_0x3877('0x1f')](_0x13a05f['query'][_0x3877('0x1f')]);}return _0x24c0e5['getSubjects'](_0x1d2ee8);}})[_0x3877('0x26')](function(_0x45ec22){if(_0x45ec22){return _0x45ec22?{'count':_0x59428c,'rows':_0x45ec22}:null;}})[_0x3877('0x26')](respondWithResult(_0x528e6b,null))['catch'](handleError(_0x528e6b,null));};exports['getDescriptions']=function(_0x5c5437,_0x4de8a9,_0x37c74c){var _0x5ba55a={};var _0x345f2e={};var _0x40fc90;var _0xa1cd5e;return db[_0x3877('0x2e')][_0x3877('0x4d')]({'where':{'id':_0x5c5437[_0x3877('0x47')]['id']}})[_0x3877('0x26')](handleEntityNotFound(_0x4de8a9,null))[_0x3877('0x26')](function(_0x13d9cc){if(_0x13d9cc){_0x40fc90=_0x13d9cc;_0x345f2e[_0x3877('0x32')]=_[_0x3877('0x48')](db['FreshsalesField'][_0x3877('0x2f')]);_0x345f2e['query']=_[_0x3877('0x48')](_0x5c5437[_0x3877('0x33')]);_0x345f2e[_0x3877('0x34')]=_[_0x3877('0x35')](_0x345f2e[_0x3877('0x32')],_0x345f2e[_0x3877('0x33')]);_0x5ba55a[_0x3877('0x36')]=_[_0x3877('0x35')](_0x345f2e[_0x3877('0x32')],qs['fields'](_0x5c5437[_0x3877('0x33')]['fields']));_0x5ba55a[_0x3877('0x36')]=_0x5ba55a[_0x3877('0x36')][_0x3877('0x38')]?_0x5ba55a[_0x3877('0x36')]:_0x345f2e[_0x3877('0x32')];_0x5ba55a[_0x3877('0x3b')]=qs[_0x3877('0x3c')](_0x5c5437['query'][_0x3877('0x3c')]);_0x5ba55a['where']=qs[_0x3877('0x34')](_[_0x3877('0x3e')](_0x5c5437[_0x3877('0x33')],_0x345f2e[_0x3877('0x34')]));if(_0x5c5437[_0x3877('0x33')]['filter']){_0x5ba55a[_0x3877('0x3d')]=_[_0x3877('0x40')](_0x5ba55a['where'],{'$or':_[_0x3877('0x2d')](_0x5ba55a[_0x3877('0x36')],function(_0x41579b){var _0x198384={};_0x198384[_0x41579b]={'$like':'%'+_0x5c5437[_0x3877('0x33')][_0x3877('0x3f')]+'%'};return _0x198384;})});}_0x5ba55a=_[_0x3877('0x40')]({},_0x5ba55a,_0x5c5437[_0x3877('0x42')]);return _0x40fc90[_0x3877('0x4f')](_0x5ba55a);}})[_0x3877('0x26')](function(_0x176340){if(_0x176340){_0xa1cd5e=_0x176340[_0x3877('0x38')];if(!_0x5c5437[_0x3877('0x33')][_0x3877('0x39')](_0x3877('0x3a'))){_0x5ba55a[_0x3877('0x21')]=qs['limit'](_0x5c5437['query'][_0x3877('0x21')]);_0x5ba55a[_0x3877('0x1f')]=qs[_0x3877('0x1f')](_0x5c5437[_0x3877('0x33')]['offset']);}return _0x40fc90['getDescriptions'](_0x5ba55a);}})[_0x3877('0x26')](function(_0x35c3d3){if(_0x35c3d3){return _0x35c3d3?{'count':_0xa1cd5e,'rows':_0x35c3d3}:null;}})[_0x3877('0x26')](respondWithResult(_0x4de8a9,null))[_0x3877('0x4a')](handleError(_0x4de8a9,null));};exports[_0x3877('0x50')]=function(_0x5c2dca,_0x37a95f,_0x325b7b){var _0x459ab3={};var _0x9bba7c={};var _0x3e14de;var _0xea4baa;return db['FreshsalesConfiguration'][_0x3877('0x4d')]({'where':{'id':_0x5c2dca[_0x3877('0x47')]['id']}})['then'](handleEntityNotFound(_0x37a95f,null))['then'](function(_0x48aff2){if(_0x48aff2){_0x3e14de=_0x48aff2;_0x9bba7c[_0x3877('0x32')]=_[_0x3877('0x48')](db[_0x3877('0x4e')]['rawAttributes']);_0x9bba7c[_0x3877('0x33')]=_[_0x3877('0x48')](_0x5c2dca[_0x3877('0x33')]);_0x9bba7c['filters']=_[_0x3877('0x35')](_0x9bba7c[_0x3877('0x32')],_0x9bba7c[_0x3877('0x33')]);_0x459ab3[_0x3877('0x36')]=_['intersection'](_0x9bba7c['model'],qs[_0x3877('0x37')](_0x5c2dca[_0x3877('0x33')][_0x3877('0x37')]));_0x459ab3['attributes']=_0x459ab3[_0x3877('0x36')][_0x3877('0x38')]?_0x459ab3[_0x3877('0x36')]:_0x9bba7c['model'];_0x459ab3[_0x3877('0x3b')]=qs[_0x3877('0x3c')](_0x5c2dca[_0x3877('0x33')]['sort']);_0x459ab3[_0x3877('0x3d')]=qs[_0x3877('0x34')](_[_0x3877('0x3e')](_0x5c2dca['query'],_0x9bba7c[_0x3877('0x34')]));if(_0x5c2dca['query'][_0x3877('0x3f')]){_0x459ab3['where']=_[_0x3877('0x40')](_0x459ab3[_0x3877('0x3d')],{'$or':_[_0x3877('0x2d')](_0x459ab3[_0x3877('0x36')],function(_0x370178){var _0x541738={};_0x541738[_0x370178]={'$like':'%'+_0x5c2dca['query'][_0x3877('0x3f')]+'%'};return _0x541738;})});}_0x459ab3=_[_0x3877('0x40')]({},_0x459ab3,_0x5c2dca[_0x3877('0x42')]);return _0x3e14de['getFields'](_0x459ab3);}})[_0x3877('0x26')](function(_0x3fa747){if(_0x3fa747){_0xea4baa=_0x3fa747['length'];if(!_0x5c2dca[_0x3877('0x33')]['hasOwnProperty'](_0x3877('0x3a'))){_0x459ab3[_0x3877('0x21')]=qs['limit'](_0x5c2dca['query'][_0x3877('0x21')]);_0x459ab3['offset']=qs['offset'](_0x5c2dca[_0x3877('0x33')][_0x3877('0x1f')]);}return _0x3e14de['getFields'](_0x459ab3);}})['then'](function(_0x26265c){if(_0x26265c){return _0x26265c?{'count':_0xea4baa,'rows':_0x26265c}:null;}})['then'](respondWithResult(_0x37a95f,null))['catch'](handleError(_0x37a95f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 742debf..a64a699 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 _0x9318=['define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x9318,0x10a));var _0x8931=function(_0x317cc5,_0x3b6179){_0x317cc5=_0x317cc5-0x0;var _0x44fe81=_0x9318[_0x317cc5];return _0x44fe81;};'use strict';var _=require(_0x8931('0x0'));var util=require(_0x8931('0x1'));var logger=require(_0x8931('0x2'))(_0x8931('0x3'));var moment=require(_0x8931('0x4'));var BPromise=require(_0x8931('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8931('0x6'));var rimraf=require(_0x8931('0x7'));var config=require(_0x8931('0x8'));var attributes=require(_0x8931('0x9'));module['exports']=function(_0x3967f3,_0x3c89d9){return _0x3967f3[_0x8931('0xa')](_0x8931('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aef=['./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0x1aef,0x1b0));var _0xf1ae=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1aef[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xf1ae('0x0'));var logger=require(_0xf1ae('0x1'))('api');var moment=require(_0xf1ae('0x2'));var BPromise=require(_0xf1ae('0x3'));var rp=require(_0xf1ae('0x4'));var fs=require('fs');var path=require(_0xf1ae('0x5'));var rimraf=require(_0xf1ae('0x6'));var config=require(_0xf1ae('0x7'));var attributes=require(_0xf1ae('0x8'));module['exports']=function(_0xacb9af,_0x51a15b){return _0xacb9af['define'](_0xf1ae('0x9'),attributes,{'tableName':_0xf1ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index fd46cc7..c5e7bbf 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 _0x57ed=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x9aeecc,_0x1b9c0d){var _0x551061=function(_0x7a72f7){while(--_0x7a72f7){_0x9aeecc['push'](_0x9aeecc['shift']());}};_0x551061(++_0x1b9c0d);}(_0x57ed,0x1a4));var _0xd57e=function(_0x3c31f9,_0x5914f1){_0x3c31f9=_0x3c31f9-0x0;var _0x45b251=_0x57ed[_0x3c31f9];return _0x45b251;};'use strict';var _=require(_0xd57e('0x0'));var util=require('util');var moment=require(_0xd57e('0x1'));var BPromise=require(_0xd57e('0x2'));var rs=require(_0xd57e('0x3'));var fs=require('fs');var Redis=require(_0xd57e('0x4'));var db=require(_0xd57e('0x5'))['db'];var utils=require(_0xd57e('0x6'));var logger=require(_0xd57e('0x7'))('rpc');var config=require(_0xd57e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd57e('0x9')][_0xd57e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1621cc,_0x164e8d,_0x298647){return new BPromise(function(_0x3928c0,_0x2835cb){return client['request'](_0x1621cc,_0x298647)[_0xd57e('0xb')](function(_0x1d48bd){logger[_0xd57e('0xc')](_0xd57e('0xd'),_0x164e8d,_0xd57e('0xe'));logger[_0xd57e('0xf')](_0xd57e('0x10'),_0x164e8d,_0xd57e('0xe'),JSON[_0xd57e('0x11')](_0x1d48bd));if(_0x1d48bd[_0xd57e('0x12')]){if(_0x1d48bd[_0xd57e('0x12')]['code']===0x1f4){logger[_0xd57e('0x12')](_0xd57e('0xd'),_0x164e8d,_0x1d48bd[_0xd57e('0x12')][_0xd57e('0x13')]);return _0x2835cb(_0x1d48bd[_0xd57e('0x12')][_0xd57e('0x13')]);}logger[_0xd57e('0x12')](_0xd57e('0xd'),_0x164e8d,_0x1d48bd[_0xd57e('0x12')][_0xd57e('0x13')]);return _0x3928c0(_0x1d48bd['error'][_0xd57e('0x13')]);}else{logger[_0xd57e('0xc')](_0xd57e('0xd'),_0x164e8d,'request\x20sent');_0x3928c0(_0x1d48bd[_0xd57e('0x14')][_0xd57e('0x13')]);}})[_0xd57e('0x15')](function(_0x333a1c){logger[_0xd57e('0x12')](_0xd57e('0xd'),_0x164e8d,_0x333a1c);_0x2835cb(_0x333a1c);});});} \ No newline at end of file +var _0x5fde=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x5fde,0x1de));var _0xe5fd=function(_0xccd3b5,_0x4fe7fa){_0xccd3b5=_0xccd3b5-0x0;var _0x3070ac=_0x5fde[_0xccd3b5];return _0x3070ac;};'use strict';var _=require(_0xe5fd('0x0'));var util=require(_0xe5fd('0x1'));var moment=require(_0xe5fd('0x2'));var BPromise=require(_0xe5fd('0x3'));var rs=require(_0xe5fd('0x4'));var fs=require('fs');var Redis=require(_0xe5fd('0x5'));var db=require(_0xe5fd('0x6'))['db'];var utils=require(_0xe5fd('0x7'));var logger=require('../../config/logger')(_0xe5fd('0x8'));var config=require(_0xe5fd('0x9'));var jayson=require(_0xe5fd('0xa'));var client=jayson[_0xe5fd('0xb')][_0xe5fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e80b7,_0x3876b7,_0x29fec6){return new BPromise(function(_0x2286c1,_0x33f16d){return client[_0xe5fd('0xd')](_0x1e80b7,_0x29fec6)[_0xe5fd('0xe')](function(_0x4a3b03){logger[_0xe5fd('0xf')](_0xe5fd('0x10'),_0x3876b7,'request\x20sent');logger[_0xe5fd('0x11')](_0xe5fd('0x12'),_0x3876b7,_0xe5fd('0x13'),JSON[_0xe5fd('0x14')](_0x4a3b03));if(_0x4a3b03[_0xe5fd('0x15')]){if(_0x4a3b03[_0xe5fd('0x15')]['code']===0x1f4){logger['error'](_0xe5fd('0x10'),_0x3876b7,_0x4a3b03['error'][_0xe5fd('0x16')]);return _0x33f16d(_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);}logger['error'](_0xe5fd('0x10'),_0x3876b7,_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);return _0x2286c1(_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);}else{logger[_0xe5fd('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3876b7,_0xe5fd('0x13'));_0x2286c1(_0x4a3b03[_0xe5fd('0x17')][_0xe5fd('0x16')]);}})[_0xe5fd('0x18')](function(_0x45e035){logger[_0xe5fd('0x15')](_0xe5fd('0x10'),_0x3876b7,_0x45e035);_0x33f16d(_0x45e035);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3a43f14..70d8518 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 _0x0c6d=['index','get','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated'];(function(_0x4a4743,_0x48fb20){var _0x547c20=function(_0x22db4d){while(--_0x22db4d){_0x4a4743['push'](_0x4a4743['shift']());}};_0x547c20(++_0x48fb20);}(_0x0c6d,0xf7));var _0xd0c6=function(_0xd6a4a6,_0x45fcd3){_0xd6a4a6=_0xd6a4a6-0x0;var _0x4d6605=_0x0c6d[_0xd6a4a6];return _0x4d6605;};'use strict';var multer=require('multer');var util=require(_0xd0c6('0x0'));var path=require(_0xd0c6('0x1'));var timeout=require(_0xd0c6('0x2'));var express=require(_0xd0c6('0x3'));var router=express[_0xd0c6('0x4')]();var fs_extra=require(_0xd0c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0c6('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x8')]);router[_0xd0c6('0x9')]('/:id',auth[_0xd0c6('0x7')](),controller['show']);router[_0xd0c6('0xa')]('/',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xb')]);router[_0xd0c6('0xc')](_0xd0c6('0xd'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xe')]);router[_0xd0c6('0xf')](_0xd0c6('0xd'),auth['isAuthenticated'](),controller[_0xd0c6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6597=['show','post','create','/:id','delete','exports','multer','util','path','express','fs-extra','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x6597,0x16e));var _0x7659=function(_0x3973f8,_0x3a70e6){_0x3973f8=_0x3973f8-0x0;var _0xfe4af7=_0x6597[_0x3973f8];return _0xfe4af7;};'use strict';var multer=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var path=require(_0x7659('0x2'));var timeout=require('connect-timeout');var express=require(_0x7659('0x3'));var router=express['Router']();var fs_extra=require(_0x7659('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7659('0x5'));router[_0x7659('0x6')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0x8')]);router[_0x7659('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7659('0x9')]);router[_0x7659('0xa')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0xb')]);router['put'](_0x7659('0xc'),auth[_0x7659('0x7')](),controller['update']);router[_0x7659('0xd')]('/:id',auth[_0x7659('0x7')](),controller['destroy']);module[_0x7659('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a702ff4..3a2c119 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 _0x87c2=['exports','ENUM','variable','customVariable','picklist','string','STRING','sequelize'];(function(_0x137314,_0x3e7e37){var _0x2847d0=function(_0x13e670){while(--_0x13e670){_0x137314['push'](_0x137314['shift']());}};_0x2847d0(++_0x3e7e37);}(_0x87c2,0xd7));var _0x287c=function(_0xf9e7f6,_0x3687b4){_0xf9e7f6=_0xf9e7f6-0x0;var _0xe6f6c=_0x87c2[_0xf9e7f6];return _0xe6f6c;};'use strict';var Sequelize=require(_0x287c('0x0'));module[_0x287c('0x1')]={'type':{'type':Sequelize[_0x287c('0x2')]('string',_0x287c('0x3'),_0x287c('0x4'),'keyValue',_0x287c('0x5')),'defaultValue':_0x287c('0x6')},'content':{'type':Sequelize[_0x287c('0x7')]},'key':{'type':Sequelize[_0x287c('0x7')]},'keyType':{'type':Sequelize[_0x287c('0x2')](_0x287c('0x6'),_0x287c('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x287c('0x7')]},'nameField':{'type':Sequelize[_0x287c('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x287c('0x7')]}}; \ No newline at end of file +var _0x41ab=['customVariable','picklist','STRING','exports','ENUM','string','variable'];(function(_0x6cf622,_0x146e67){var _0x1887fe=function(_0xe16cbd){while(--_0xe16cbd){_0x6cf622['push'](_0x6cf622['shift']());}};_0x1887fe(++_0x146e67);}(_0x41ab,0x1b5));var _0xb41a=function(_0x4030a1,_0x4dfb5e){_0x4030a1=_0x4030a1-0x0;var _0x40c412=_0x41ab[_0x4030a1];return _0x40c412;};'use strict';var Sequelize=require('sequelize');module[_0xb41a('0x0')]={'type':{'type':Sequelize[_0xb41a('0x1')](_0xb41a('0x2'),_0xb41a('0x3'),_0xb41a('0x4'),'keyValue',_0xb41a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb41a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb41a('0x1')](_0xb41a('0x2'),'variable',_0xb41a('0x4'))},'keyContent':{'type':Sequelize[_0xb41a('0x6')]},'idField':{'type':Sequelize[_0xb41a('0x6')]},'nameField':{'type':Sequelize[_0xb41a('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb41a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c54d2aa..2077083 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 _0x6e5d=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs'];(function(_0x5e5bb3,_0xd7b3b0){var _0x3fe176=function(_0x2f0ec1){while(--_0x2f0ec1){_0x5e5bb3['push'](_0x5e5bb3['shift']());}};_0x3fe176(++_0xd7b3b0);}(_0x6e5d,0x11f));var _0xd6e5=function(_0x3df21c,_0x4092b6){_0x3df21c=_0x3df21c-0x0;var _0x5b48d3=_0x6e5d[_0x3df21c];return _0x5b48d3;};'use strict';var emlformat=require(_0xd6e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6e5('0x1'));var jsonpatch=require(_0xd6e5('0x2'));var rp=require(_0xd6e5('0x3'));var moment=require(_0xd6e5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6e5('0x5'));var util=require('util');var path=require(_0xd6e5('0x6'));var sox=require(_0xd6e5('0x7'));var csv=require('to-csv');var ejs=require(_0xd6e5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6e5('0x9'));var squel=require('squel');var crypto=require(_0xd6e5('0xa'));var jsforce=require(_0xd6e5('0xb'));var deskjs=require(_0xd6e5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6e5('0xd'));var Papa=require(_0xd6e5('0xe'));var Redis=require(_0xd6e5('0xf'));var authService=require(_0xd6e5('0x10'));var qs=require(_0xd6e5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6e5('0x12'));var logger=require(_0xd6e5('0x13'))(_0xd6e5('0x14'));var utils=require('../../config/utils');var config=require(_0xd6e5('0x15'));var licenseUtil=require(_0xd6e5('0x16'));var db=require(_0xd6e5('0x17'))['db'];function respondWithStatusCode(_0xe86ec6,_0x534cdb){_0x534cdb=_0x534cdb||0xcc;return function(_0x4a6064){if(_0x4a6064){return _0xe86ec6[_0xd6e5('0x18')](_0x534cdb);}return _0xe86ec6[_0xd6e5('0x19')](_0x534cdb)[_0xd6e5('0x1a')]();};}function respondWithResult(_0x8f30d5,_0x49c39d){_0x49c39d=_0x49c39d||0xc8;return function(_0xf66f){if(_0xf66f){return _0x8f30d5[_0xd6e5('0x19')](_0x49c39d)[_0xd6e5('0x1b')](_0xf66f);}};}function respondWithFilteredResult(_0x596703,_0x4c4c30){return function(_0x1bbf16){if(_0x1bbf16){var _0x23daf2=typeof _0x4c4c30[_0xd6e5('0x1c')]===_0xd6e5('0x1d')&&typeof _0x4c4c30[_0xd6e5('0x1e')]===_0xd6e5('0x1d');var _0x1af868=_0x1bbf16['count'];var _0x1c4bff=_0x23daf2?0x0:_0x4c4c30[_0xd6e5('0x1c')];var _0x4ef8fc=_0x23daf2?_0x1bbf16[_0xd6e5('0x1f')]:_0x4c4c30['offset']+_0x4c4c30['limit'];var _0x398ca7;if(_0x4ef8fc>=_0x1af868){_0x4ef8fc=_0x1af868;_0x398ca7=0xc8;}else{_0x398ca7=0xce;}_0x596703[_0xd6e5('0x19')](_0x398ca7);return _0x596703[_0xd6e5('0x20')]('Content-Range',_0x1c4bff+'-'+_0x4ef8fc+'/'+_0x1af868)['json'](_0x1bbf16);}return null;};}function patchUpdates(_0x5e34db){return function(_0x4d2b36){try{jsonpatch['apply'](_0x4d2b36,_0x5e34db,!![]);}catch(_0x48ab41){return BPromise[_0xd6e5('0x21')](_0x48ab41);}return _0x4d2b36['save']();};}function saveUpdates(_0x4156ae,_0x355986){return function(_0x49d407){if(_0x49d407){return _0x49d407['update'](_0x4156ae)[_0xd6e5('0x22')](function(_0x18c8e4){return _0x18c8e4;});}return null;};}function removeEntity(_0x45fed9,_0x3e1833){return function(_0x4687e7){if(_0x4687e7){return _0x4687e7[_0xd6e5('0x23')]()[_0xd6e5('0x22')](function(){_0x45fed9[_0xd6e5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d06c1,_0x2eefe6){return function(_0x473b66){if(!_0x473b66){_0x9d06c1[_0xd6e5('0x18')](0x194);}return _0x473b66;};}function handleError(_0x5148de,_0x4ccdd2){_0x4ccdd2=_0x4ccdd2||0x1f4;return function(_0x15cc51){logger[_0xd6e5('0x24')](_0x15cc51[_0xd6e5('0x25')]);if(_0x15cc51['name']){delete _0x15cc51[_0xd6e5('0x26')];}_0x5148de['status'](_0x4ccdd2)['send'](_0x15cc51);};}exports[_0xd6e5('0x27')]=function(_0x2b35ca,_0x3d8ad2){var _0x4023c0={},_0x1ab78f={},_0x1e64aa={'count':0x0,'rows':[]};var _0x4cacd8=_[_0xd6e5('0x28')](db[_0xd6e5('0x29')][_0xd6e5('0x2a')],function(_0xe0673c){return{'name':_0xe0673c['fieldName'],'type':_0xe0673c[_0xd6e5('0x2b')][_0xd6e5('0x2c')]};});_0x1ab78f[_0xd6e5('0x2d')]=_[_0xd6e5('0x28')](_0x4cacd8,_0xd6e5('0x26'));_0x1ab78f[_0xd6e5('0x2e')]=_[_0xd6e5('0x2f')](_0x2b35ca[_0xd6e5('0x2e')]);_0x1ab78f[_0xd6e5('0x30')]=_[_0xd6e5('0x31')](_0x1ab78f[_0xd6e5('0x2d')],_0x1ab78f[_0xd6e5('0x2e')]);_0x4023c0['attributes']=_['intersection'](_0x1ab78f[_0xd6e5('0x2d')],qs[_0xd6e5('0x32')](_0x2b35ca['query']['fields']));_0x4023c0[_0xd6e5('0x33')]=_0x4023c0['attributes']['length']?_0x4023c0['attributes']:_0x1ab78f[_0xd6e5('0x2d')];if(!_0x2b35ca[_0xd6e5('0x2e')][_0xd6e5('0x34')](_0xd6e5('0x35'))){_0x4023c0[_0xd6e5('0x1e')]=qs[_0xd6e5('0x1e')](_0x2b35ca[_0xd6e5('0x2e')]['limit']);_0x4023c0[_0xd6e5('0x1c')]=qs['offset'](_0x2b35ca[_0xd6e5('0x2e')][_0xd6e5('0x1c')]);}_0x4023c0[_0xd6e5('0x36')]=qs[_0xd6e5('0x37')](_0x2b35ca[_0xd6e5('0x2e')]['sort']);_0x4023c0['where']=qs[_0xd6e5('0x30')](_[_0xd6e5('0x38')](_0x2b35ca['query'],_0x1ab78f[_0xd6e5('0x30')]),_0x4cacd8);if(_0x2b35ca[_0xd6e5('0x2e')][_0xd6e5('0x39')]){_0x4023c0['where']=_[_0xd6e5('0x3a')](_0x4023c0[_0xd6e5('0x3b')],{'$or':_[_0xd6e5('0x28')](_0x4cacd8,function(_0x403e00){if(_0x403e00[_0xd6e5('0x2b')]!==_0xd6e5('0x3c')){var _0x42234a={};_0x42234a[_0x403e00[_0xd6e5('0x26')]]={'$like':'%'+_0x2b35ca[_0xd6e5('0x2e')][_0xd6e5('0x39')]+'%'};return _0x42234a;}})});}_0x4023c0=_['merge']({},_0x4023c0,_0x2b35ca[_0xd6e5('0x3d')]);var _0x1fc6d5={'where':_0x4023c0[_0xd6e5('0x3b')]};return db[_0xd6e5('0x29')]['count'](_0x1fc6d5)['then'](function(_0x5b3937){_0x1e64aa[_0xd6e5('0x1f')]=_0x5b3937;if(_0x2b35ca['query'][_0xd6e5('0x3e')]){_0x4023c0['include']=[{'all':!![]}];}return db[_0xd6e5('0x29')][_0xd6e5('0x3f')](_0x4023c0);})[_0xd6e5('0x22')](function(_0x374d32){_0x1e64aa[_0xd6e5('0x40')]=_0x374d32;return _0x1e64aa;})[_0xd6e5('0x22')](respondWithFilteredResult(_0x3d8ad2,_0x4023c0))[_0xd6e5('0x41')](handleError(_0x3d8ad2,null));};exports[_0xd6e5('0x42')]=function(_0x12e2db,_0x222034){var _0x37ecad={'raw':!![],'where':{'id':_0x12e2db[_0xd6e5('0x43')]['id']}},_0x1364d7={};_0x1364d7[_0xd6e5('0x2d')]=_[_0xd6e5('0x2f')](db[_0xd6e5('0x29')][_0xd6e5('0x2a')]);_0x1364d7[_0xd6e5('0x2e')]=_[_0xd6e5('0x2f')](_0x12e2db[_0xd6e5('0x2e')]);_0x1364d7[_0xd6e5('0x30')]=_[_0xd6e5('0x31')](_0x1364d7[_0xd6e5('0x2d')],_0x1364d7['query']);_0x37ecad['attributes']=_['intersection'](_0x1364d7[_0xd6e5('0x2d')],qs[_0xd6e5('0x32')](_0x12e2db[_0xd6e5('0x2e')][_0xd6e5('0x32')]));_0x37ecad[_0xd6e5('0x33')]=_0x37ecad[_0xd6e5('0x33')][_0xd6e5('0x44')]?_0x37ecad[_0xd6e5('0x33')]:_0x1364d7[_0xd6e5('0x2d')];if(_0x12e2db[_0xd6e5('0x2e')][_0xd6e5('0x3e')]){_0x37ecad[_0xd6e5('0x45')]=[{'all':!![]}];}_0x37ecad=_['merge']({},_0x37ecad,_0x12e2db['options']);return db[_0xd6e5('0x29')][_0xd6e5('0x46')](_0x37ecad)['then'](handleEntityNotFound(_0x222034,null))[_0xd6e5('0x22')](respondWithResult(_0x222034,null))[_0xd6e5('0x41')](handleError(_0x222034,null));};exports[_0xd6e5('0x47')]=function(_0x48eb28,_0x1d1ccc){return db[_0xd6e5('0x29')][_0xd6e5('0x47')](_0x48eb28[_0xd6e5('0x48')],{})['then'](respondWithResult(_0x1d1ccc,0xc9))[_0xd6e5('0x41')](handleError(_0x1d1ccc,null));};exports[_0xd6e5('0x49')]=function(_0x2da070,_0x4e67bd){if(_0x2da070[_0xd6e5('0x48')]['id']){delete _0x2da070[_0xd6e5('0x48')]['id'];}return db[_0xd6e5('0x29')][_0xd6e5('0x46')]({'where':{'id':_0x2da070[_0xd6e5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e67bd,null))[_0xd6e5('0x22')](saveUpdates(_0x2da070[_0xd6e5('0x48')],null))[_0xd6e5('0x22')](respondWithResult(_0x4e67bd,null))[_0xd6e5('0x41')](handleError(_0x4e67bd,null));};exports[_0xd6e5('0x23')]=function(_0x255822,_0x42b187){return db['FreshsalesField'][_0xd6e5('0x46')]({'where':{'id':_0x255822[_0xd6e5('0x43')]['id']}})['then'](handleEntityNotFound(_0x42b187,null))[_0xd6e5('0x22')](removeEntity(_0x42b187,null))['catch'](handleError(_0x42b187,null));}; \ No newline at end of file +var _0x06d6=['json','undefined','limit','count','offset','status','set','reject','save','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0x06d6,0x7b));var _0x606d=function(_0x2a39fe,_0x315fe9){_0x2a39fe=_0x2a39fe-0x0;var _0x52a5a5=_0x06d6[_0x2a39fe];return _0x52a5a5;};'use strict';var emlformat=require(_0x606d('0x0'));var rimraf=require(_0x606d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x606d('0x2'));var rp=require('request-promise');var moment=require(_0x606d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x606d('0x4'));var util=require(_0x606d('0x5'));var path=require(_0x606d('0x6'));var sox=require(_0x606d('0x7'));var csv=require(_0x606d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x606d('0x9'));var _=require(_0x606d('0xa'));var squel=require(_0x606d('0xb'));var crypto=require(_0x606d('0xc'));var jsforce=require(_0x606d('0xd'));var deskjs=require(_0x606d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x606d('0xf'));var Papa=require(_0x606d('0x10'));var Redis=require('ioredis');var authService=require(_0x606d('0x11'));var qs=require(_0x606d('0x12'));var as=require(_0x606d('0x13'));var hardwareService=require(_0x606d('0x14'));var logger=require(_0x606d('0x15'))('api');var utils=require(_0x606d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x606d('0x17'));var db=require(_0x606d('0x18'))['db'];function respondWithStatusCode(_0x37b7c2,_0x36ece0){_0x36ece0=_0x36ece0||0xcc;return function(_0xba9b83){if(_0xba9b83){return _0x37b7c2[_0x606d('0x19')](_0x36ece0);}return _0x37b7c2['status'](_0x36ece0)[_0x606d('0x1a')]();};}function respondWithResult(_0x50cb4d,_0x2d88f9){_0x2d88f9=_0x2d88f9||0xc8;return function(_0x432db6){if(_0x432db6){return _0x50cb4d['status'](_0x2d88f9)[_0x606d('0x1b')](_0x432db6);}};}function respondWithFilteredResult(_0x1eef8e,_0xdc5008){return function(_0x534b1a){if(_0x534b1a){var _0xa2f6d4=typeof _0xdc5008['offset']===_0x606d('0x1c')&&typeof _0xdc5008[_0x606d('0x1d')]===_0x606d('0x1c');var _0xc28f65=_0x534b1a[_0x606d('0x1e')];var _0xd239f2=_0xa2f6d4?0x0:_0xdc5008[_0x606d('0x1f')];var _0x48ac47=_0xa2f6d4?_0x534b1a[_0x606d('0x1e')]:_0xdc5008[_0x606d('0x1f')]+_0xdc5008[_0x606d('0x1d')];var _0x42429f;if(_0x48ac47>=_0xc28f65){_0x48ac47=_0xc28f65;_0x42429f=0xc8;}else{_0x42429f=0xce;}_0x1eef8e[_0x606d('0x20')](_0x42429f);return _0x1eef8e[_0x606d('0x21')]('Content-Range',_0xd239f2+'-'+_0x48ac47+'/'+_0xc28f65)['json'](_0x534b1a);}return null;};}function patchUpdates(_0x50a6f6){return function(_0xb10e0a){try{jsonpatch['apply'](_0xb10e0a,_0x50a6f6,!![]);}catch(_0x421679){return BPromise[_0x606d('0x22')](_0x421679);}return _0xb10e0a[_0x606d('0x23')]();};}function saveUpdates(_0x5cf633,_0x1f9ee9){return function(_0x54d779){if(_0x54d779){return _0x54d779['update'](_0x5cf633)[_0x606d('0x24')](function(_0x219fe5){return _0x219fe5;});}return null;};}function removeEntity(_0x1bbfb7,_0x4815fa){return function(_0x418312){if(_0x418312){return _0x418312['destroy']()['then'](function(){_0x1bbfb7[_0x606d('0x20')](0xcc)[_0x606d('0x1a')]();});}};}function handleEntityNotFound(_0x1d7fa1,_0x2d6351){return function(_0x38fe56){if(!_0x38fe56){_0x1d7fa1[_0x606d('0x19')](0x194);}return _0x38fe56;};}function handleError(_0x40d2dd,_0x3180b1){_0x3180b1=_0x3180b1||0x1f4;return function(_0x1a2678){logger[_0x606d('0x25')](_0x1a2678[_0x606d('0x26')]);if(_0x1a2678[_0x606d('0x27')]){delete _0x1a2678[_0x606d('0x27')];}_0x40d2dd['status'](_0x3180b1)['send'](_0x1a2678);};}exports[_0x606d('0x28')]=function(_0x27ec8c,_0x213c0a){var _0x48faad={},_0x18f893={},_0x51dc9f={'count':0x0,'rows':[]};var _0x125ea9=_[_0x606d('0x29')](db['FreshsalesField']['rawAttributes'],function(_0x7e0d31){return{'name':_0x7e0d31[_0x606d('0x2a')],'type':_0x7e0d31[_0x606d('0x2b')][_0x606d('0x2c')]};});_0x18f893[_0x606d('0x2d')]=_[_0x606d('0x29')](_0x125ea9,'name');_0x18f893[_0x606d('0x2e')]=_[_0x606d('0x2f')](_0x27ec8c[_0x606d('0x2e')]);_0x18f893[_0x606d('0x30')]=_[_0x606d('0x31')](_0x18f893['model'],_0x18f893[_0x606d('0x2e')]);_0x48faad[_0x606d('0x32')]=_[_0x606d('0x31')](_0x18f893[_0x606d('0x2d')],qs['fields'](_0x27ec8c[_0x606d('0x2e')][_0x606d('0x33')]));_0x48faad[_0x606d('0x32')]=_0x48faad['attributes'][_0x606d('0x34')]?_0x48faad['attributes']:_0x18f893['model'];if(!_0x27ec8c['query'][_0x606d('0x35')](_0x606d('0x36'))){_0x48faad[_0x606d('0x1d')]=qs[_0x606d('0x1d')](_0x27ec8c[_0x606d('0x2e')][_0x606d('0x1d')]);_0x48faad[_0x606d('0x1f')]=qs['offset'](_0x27ec8c[_0x606d('0x2e')][_0x606d('0x1f')]);}_0x48faad[_0x606d('0x37')]=qs[_0x606d('0x38')](_0x27ec8c[_0x606d('0x2e')][_0x606d('0x38')]);_0x48faad[_0x606d('0x39')]=qs[_0x606d('0x30')](_[_0x606d('0x3a')](_0x27ec8c[_0x606d('0x2e')],_0x18f893[_0x606d('0x30')]),_0x125ea9);if(_0x27ec8c['query'][_0x606d('0x3b')]){_0x48faad[_0x606d('0x39')]=_[_0x606d('0x3c')](_0x48faad['where'],{'$or':_['map'](_0x125ea9,function(_0x36c3e6){if(_0x36c3e6[_0x606d('0x2b')]!==_0x606d('0x3d')){var _0x4a6bcb={};_0x4a6bcb[_0x36c3e6['name']]={'$like':'%'+_0x27ec8c[_0x606d('0x2e')][_0x606d('0x3b')]+'%'};return _0x4a6bcb;}})});}_0x48faad=_[_0x606d('0x3c')]({},_0x48faad,_0x27ec8c[_0x606d('0x3e')]);var _0x50e64f={'where':_0x48faad[_0x606d('0x39')]};return db[_0x606d('0x3f')][_0x606d('0x1e')](_0x50e64f)[_0x606d('0x24')](function(_0x413e6a){_0x51dc9f[_0x606d('0x1e')]=_0x413e6a;if(_0x27ec8c[_0x606d('0x2e')][_0x606d('0x40')]){_0x48faad[_0x606d('0x41')]=[{'all':!![]}];}return db[_0x606d('0x3f')][_0x606d('0x42')](_0x48faad);})[_0x606d('0x24')](function(_0x17797b){_0x51dc9f['rows']=_0x17797b;return _0x51dc9f;})[_0x606d('0x24')](respondWithFilteredResult(_0x213c0a,_0x48faad))[_0x606d('0x43')](handleError(_0x213c0a,null));};exports[_0x606d('0x44')]=function(_0xc52a3e,_0x4e14fb){var _0x32b16c={'raw':!![],'where':{'id':_0xc52a3e['params']['id']}},_0x1f4a5b={};_0x1f4a5b['model']=_[_0x606d('0x2f')](db['FreshsalesField'][_0x606d('0x45')]);_0x1f4a5b['query']=_['keys'](_0xc52a3e['query']);_0x1f4a5b[_0x606d('0x30')]=_['intersection'](_0x1f4a5b[_0x606d('0x2d')],_0x1f4a5b['query']);_0x32b16c[_0x606d('0x32')]=_[_0x606d('0x31')](_0x1f4a5b[_0x606d('0x2d')],qs[_0x606d('0x33')](_0xc52a3e['query'][_0x606d('0x33')]));_0x32b16c[_0x606d('0x32')]=_0x32b16c[_0x606d('0x32')][_0x606d('0x34')]?_0x32b16c[_0x606d('0x32')]:_0x1f4a5b[_0x606d('0x2d')];if(_0xc52a3e[_0x606d('0x2e')][_0x606d('0x40')]){_0x32b16c[_0x606d('0x41')]=[{'all':!![]}];}_0x32b16c=_[_0x606d('0x3c')]({},_0x32b16c,_0xc52a3e['options']);return db[_0x606d('0x3f')][_0x606d('0x46')](_0x32b16c)[_0x606d('0x24')](handleEntityNotFound(_0x4e14fb,null))['then'](respondWithResult(_0x4e14fb,null))[_0x606d('0x43')](handleError(_0x4e14fb,null));};exports[_0x606d('0x47')]=function(_0x3a40ec,_0x7ec45a){return db['FreshsalesField'][_0x606d('0x47')](_0x3a40ec['body'],{})['then'](respondWithResult(_0x7ec45a,0xc9))[_0x606d('0x43')](handleError(_0x7ec45a,null));};exports['update']=function(_0x3ed256,_0x861dac){if(_0x3ed256[_0x606d('0x48')]['id']){delete _0x3ed256['body']['id'];}return db[_0x606d('0x3f')]['find']({'where':{'id':_0x3ed256[_0x606d('0x49')]['id']}})['then'](handleEntityNotFound(_0x861dac,null))[_0x606d('0x24')](saveUpdates(_0x3ed256['body'],null))[_0x606d('0x24')](respondWithResult(_0x861dac,null))['catch'](handleError(_0x861dac,null));};exports[_0x606d('0x4a')]=function(_0x5c4606,_0x4178fd){return db[_0x606d('0x3f')][_0x606d('0x46')]({'where':{'id':_0x5c4606[_0x606d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4178fd,null))[_0x606d('0x24')](removeEntity(_0x4178fd,null))[_0x606d('0x43')](handleError(_0x4178fd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e20b9fc..64331ea 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 _0x05e3=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3eaacc,_0x159cc6){var _0x3b4871=function(_0x172f5a){while(--_0x172f5a){_0x3eaacc['push'](_0x3eaacc['shift']());}};_0x3b4871(++_0x159cc6);}(_0x05e3,0x86));var _0x305e=function(_0x3cb783,_0x1e70fa){_0x3cb783=_0x3cb783-0x0;var _0x2b4245=_0x05e3[_0x3cb783];return _0x2b4245;};'use strict';var _=require(_0x305e('0x0'));var util=require(_0x305e('0x1'));var logger=require(_0x305e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x305e('0x3'));var rp=require(_0x305e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x305e('0x5'));var config=require(_0x305e('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x305e('0x7')]=function(_0x404744,_0xfadd27){return _0x404744[_0x305e('0x8')](_0x305e('0x9'),attributes,{'tableName':_0x305e('0xa'),'paranoid':![],'indexes':[{'name':_0x305e('0xb'),'fields':[_0x305e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa76e=['exports','FreshsalesField','int_freshsales_fields','FieldId','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x33ef1a,_0x393b9d){var _0x2d8850=function(_0x512adb){while(--_0x512adb){_0x33ef1a['push'](_0x33ef1a['shift']());}};_0x2d8850(++_0x393b9d);}(_0xa76e,0xfe));var _0xea76=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0xa76e[_0x4d180c];return _0x49b57e;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var logger=require(_0xea76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xea76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea76('0x3'));var rimraf=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xea76('0x6')]=function(_0x48ff4f,_0x337097){return _0x48ff4f['define'](_0xea76('0x7'),attributes,{'tableName':_0xea76('0x8'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0xea76('0x9')],'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 9f5f431..ac346e3 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x38aebc,_0x8bade6){var _0x20b7e0=function(_0x571699){while(--_0x571699){_0x38aebc['push'](_0x38aebc['shift']());}};_0x20b7e0(++_0x8bade6);}(_0x187d,0x93));var _0xd187=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x187d[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x826f00,_0x75a1e6){var _0x55fc10=function(_0xce3d1e){while(--_0xce3d1e){_0x826f00['push'](_0x826f00['shift']());}};_0x55fc10(++_0x75a1e6);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5824505..ad01534 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(_0x304b94,_0x5803bc){var _0x19a461=function(_0x361269){while(--_0x361269){_0x304b94['push'](_0x304b94['shift']());}};_0x19a461(++_0x5803bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3b476c,_0x224a41){var _0x32a082=function(_0x3075cd){while(--_0x3075cd){_0x3b476c['push'](_0x3b476c['shift']());}};_0x32a082(++_0x224a41);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 5c8a29d..c68155d 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 _0x6d77=['exports','STRING','username','newTab','sequelize'];(function(_0x4f118e,_0x28b3af){var _0x384333=function(_0x4e02e9){while(--_0x4e02e9){_0x4f118e['push'](_0x4f118e['shift']());}};_0x384333(++_0x28b3af);}(_0x6d77,0x13a));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x76d7('0x0'));module[_0x76d7('0x1')]={'name':{'type':Sequelize[_0x76d7('0x2')]},'description':{'type':Sequelize[_0x76d7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x76d7('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x76d7('0x2')]},'clientId':{'type':Sequelize[_0x76d7('0x2')]},'clientSecret':{'type':Sequelize[_0x76d7('0x2')]},'securityToken':{'type':Sequelize[_0x76d7('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x76d7('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4efb=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x3dd1dc,_0x18d8b1){var _0x1c8592=function(_0x53b269){while(--_0x53b269){_0x3dd1dc['push'](_0x3dd1dc['shift']());}};_0x1c8592(++_0x18d8b1);}(_0x4efb,0xfa));var _0xb4ef=function(_0x3f3003,_0x1735a5){_0x3f3003=_0x3f3003-0x0;var _0x3d6eaf=_0x4efb[_0x3f3003];return _0x3d6eaf;};'use strict';var Sequelize=require('sequelize');module[_0xb4ef('0x0')]={'name':{'type':Sequelize[_0xb4ef('0x1')]},'description':{'type':Sequelize[_0xb4ef('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb4ef('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb4ef('0x1')]},'clientId':{'type':Sequelize[_0xb4ef('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb4ef('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb4ef('0x3')](_0xb4ef('0x4'),_0xb4ef('0x5')),'defaultValue':_0xb4ef('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 915630f..8a9e352 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 _0xbc5f=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','merge','VIRTUAL','where','include','findAll','catch','show','params','includeAll','options','create','update','body','find','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','Connection','login','concat','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','False','false','test','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xcee12e,_0x391da2){var _0x568176=function(_0x15cac1){while(--_0x15cac1){_0xcee12e['push'](_0xcee12e['shift']());}};_0x568176(++_0x391da2);}(_0xbc5f,0x1e2));var _0xfbc5=function(_0x1a7985,_0x258bf0){_0x1a7985=_0x1a7985-0x0;var _0x1a1486=_0xbc5f[_0x1a7985];return _0x1a1486;};'use strict';var emlformat=require(_0xfbc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfbc5('0x1'));var jsonpatch=require(_0xfbc5('0x2'));var rp=require('request-promise');var moment=require(_0xfbc5('0x3'));var BPromise=require(_0xfbc5('0x4'));var Mustache=require(_0xfbc5('0x5'));var util=require('util');var path=require(_0xfbc5('0x6'));var sox=require(_0xfbc5('0x7'));var csv=require('to-csv');var ejs=require(_0xfbc5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbc5('0x9'));var squel=require(_0xfbc5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfbc5('0xb'));var querystring=require(_0xfbc5('0xc'));var Papa=require(_0xfbc5('0xd'));var Redis=require(_0xfbc5('0xe'));var authService=require(_0xfbc5('0xf'));var qs=require(_0xfbc5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbc5('0x11'));var logger=require(_0xfbc5('0x12'))('api');var utils=require(_0xfbc5('0x13'));var config=require(_0xfbc5('0x14'));var licenseUtil=require(_0xfbc5('0x15'));var db=require(_0xfbc5('0x16'))['db'];var integrations=require(_0xfbc5('0x17'));function respondWithStatusCode(_0x34aa0c,_0x2fcee0){_0x2fcee0=_0x2fcee0||0xcc;return function(_0x25e6a5){if(_0x25e6a5){return _0x34aa0c[_0xfbc5('0x18')](_0x2fcee0);}return _0x34aa0c[_0xfbc5('0x19')](_0x2fcee0)['end']();};}function respondWithResult(_0x23f5bb,_0x31bf5f){_0x31bf5f=_0x31bf5f||0xc8;return function(_0x60a697){if(_0x60a697){return _0x23f5bb[_0xfbc5('0x19')](_0x31bf5f)[_0xfbc5('0x1a')](_0x60a697);}};}function respondWithFilteredResult(_0x2aebc6,_0x29d94e){return function(_0x184642){if(_0x184642){var _0x21ac8b=typeof _0x29d94e[_0xfbc5('0x1b')]===_0xfbc5('0x1c')&&typeof _0x29d94e['limit']==='undefined';var _0x457205=_0x184642[_0xfbc5('0x1d')];var _0x293726=_0x21ac8b?0x0:_0x29d94e[_0xfbc5('0x1b')];var _0x61e2db=_0x21ac8b?_0x184642[_0xfbc5('0x1d')]:_0x29d94e[_0xfbc5('0x1b')]+_0x29d94e['limit'];var _0x4a2893;if(_0x61e2db>=_0x457205){_0x61e2db=_0x457205;_0x4a2893=0xc8;}else{_0x4a2893=0xce;}_0x2aebc6['status'](_0x4a2893);return _0x2aebc6['set']('Content-Range',_0x293726+'-'+_0x61e2db+'/'+_0x457205)[_0xfbc5('0x1a')](_0x184642);}return null;};}function patchUpdates(_0x3fd656){return function(_0x7cb72c){try{jsonpatch[_0xfbc5('0x1e')](_0x7cb72c,_0x3fd656,!![]);}catch(_0x7f5ce1){return BPromise[_0xfbc5('0x1f')](_0x7f5ce1);}return _0x7cb72c[_0xfbc5('0x20')]();};}function saveUpdates(_0x461b83,_0x46eb85){return function(_0x44ff2b){if(_0x44ff2b){return _0x44ff2b['update'](_0x461b83)[_0xfbc5('0x21')](function(_0x3b6396){return _0x3b6396;});}return null;};}function removeEntity(_0x5af53a,_0x115449){return function(_0x22d0ff){if(_0x22d0ff){return _0x22d0ff[_0xfbc5('0x22')]()[_0xfbc5('0x21')](function(){_0x5af53a[_0xfbc5('0x19')](0xcc)[_0xfbc5('0x23')]();});}};}function handleEntityNotFound(_0x45ec1d,_0x3fa8e7){return function(_0x4da0fc){if(!_0x4da0fc){_0x45ec1d[_0xfbc5('0x18')](0x194);}return _0x4da0fc;};}function handleError(_0x5288be,_0x2ada6b){_0x2ada6b=_0x2ada6b||0x1f4;return function(_0x130623){logger[_0xfbc5('0x24')](_0x130623[_0xfbc5('0x25')]);if(_0x130623[_0xfbc5('0x26')]){delete _0x130623[_0xfbc5('0x26')];}_0x5288be[_0xfbc5('0x19')](_0x2ada6b)[_0xfbc5('0x27')](_0x130623);};}exports[_0xfbc5('0x28')]=function(_0x1c9345,_0xfe2a92){var _0x5aaa9b={},_0x5c8868={},_0x437e2d={'count':0x0,'rows':[]};var _0x59949e=_[_0xfbc5('0x29')](db[_0xfbc5('0x2a')][_0xfbc5('0x2b')],function(_0x218834){return{'name':_0x218834[_0xfbc5('0x2c')],'type':_0x218834['type']['key']};});_0x5c8868[_0xfbc5('0x2d')]=_[_0xfbc5('0x29')](_0x59949e,_0xfbc5('0x26'));_0x5c8868['query']=_[_0xfbc5('0x2e')](_0x1c9345[_0xfbc5('0x2f')]);_0x5c8868[_0xfbc5('0x30')]=_[_0xfbc5('0x31')](_0x5c8868['model'],_0x5c8868[_0xfbc5('0x2f')]);_0x5aaa9b[_0xfbc5('0x32')]=_[_0xfbc5('0x31')](_0x5c8868[_0xfbc5('0x2d')],qs[_0xfbc5('0x33')](_0x1c9345[_0xfbc5('0x2f')]['fields']));_0x5aaa9b[_0xfbc5('0x32')]=_0x5aaa9b['attributes'][_0xfbc5('0x34')]?_0x5aaa9b[_0xfbc5('0x32')]:_0x5c8868[_0xfbc5('0x2d')];if(!_0x1c9345[_0xfbc5('0x2f')][_0xfbc5('0x35')]('nolimit')){_0x5aaa9b[_0xfbc5('0x36')]=qs[_0xfbc5('0x36')](_0x1c9345[_0xfbc5('0x2f')]['limit']);_0x5aaa9b[_0xfbc5('0x1b')]=qs['offset'](_0x1c9345[_0xfbc5('0x2f')][_0xfbc5('0x1b')]);}_0x5aaa9b[_0xfbc5('0x37')]=qs[_0xfbc5('0x38')](_0x1c9345[_0xfbc5('0x2f')][_0xfbc5('0x38')]);_0x5aaa9b['where']=qs['filters'](_[_0xfbc5('0x39')](_0x1c9345['query'],_0x5c8868[_0xfbc5('0x30')]),_0x59949e);if(_0x1c9345[_0xfbc5('0x2f')][_0xfbc5('0x3a')]){_0x5aaa9b['where']=_[_0xfbc5('0x3b')](_0x5aaa9b['where'],{'$or':_[_0xfbc5('0x29')](_0x59949e,function(_0x9e657c){if(_0x9e657c['type']!==_0xfbc5('0x3c')){var _0x462c53={};_0x462c53[_0x9e657c['name']]={'$like':'%'+_0x1c9345[_0xfbc5('0x2f')][_0xfbc5('0x3a')]+'%'};return _0x462c53;}})});}_0x5aaa9b=_[_0xfbc5('0x3b')]({},_0x5aaa9b,_0x1c9345['options']);var _0x8e3dc7={'where':_0x5aaa9b[_0xfbc5('0x3d')]};return db[_0xfbc5('0x2a')][_0xfbc5('0x1d')](_0x8e3dc7)[_0xfbc5('0x21')](function(_0x565f97){_0x437e2d[_0xfbc5('0x1d')]=_0x565f97;if(_0x1c9345['query']['includeAll']){_0x5aaa9b[_0xfbc5('0x3e')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xfbc5('0x3f')](_0x5aaa9b);})['then'](function(_0x15ec1f){_0x437e2d['rows']=_0x15ec1f;return _0x437e2d;})['then'](respondWithFilteredResult(_0xfe2a92,_0x5aaa9b))[_0xfbc5('0x40')](handleError(_0xfe2a92,null));};exports[_0xfbc5('0x41')]=function(_0x2b5a7b,_0x1f9e6d){var _0x4ed12f={'raw':![],'where':{'id':_0x2b5a7b[_0xfbc5('0x42')]['id']}},_0x4c742f={};_0x4c742f[_0xfbc5('0x2d')]=_[_0xfbc5('0x2e')](db['SalesforceAccount'][_0xfbc5('0x2b')]);_0x4c742f['query']=_['keys'](_0x2b5a7b['query']);_0x4c742f[_0xfbc5('0x30')]=_[_0xfbc5('0x31')](_0x4c742f[_0xfbc5('0x2d')],_0x4c742f[_0xfbc5('0x2f')]);_0x4ed12f[_0xfbc5('0x32')]=_['intersection'](_0x4c742f[_0xfbc5('0x2d')],qs[_0xfbc5('0x33')](_0x2b5a7b['query'][_0xfbc5('0x33')]));_0x4ed12f[_0xfbc5('0x32')]=_0x4ed12f['attributes'][_0xfbc5('0x34')]?_0x4ed12f['attributes']:_0x4c742f[_0xfbc5('0x2d')];if(_0x2b5a7b[_0xfbc5('0x2f')][_0xfbc5('0x43')]){_0x4ed12f[_0xfbc5('0x3e')]=[{'all':!![]}];}_0x4ed12f=_[_0xfbc5('0x3b')]({},_0x4ed12f,_0x2b5a7b[_0xfbc5('0x44')]);return db[_0xfbc5('0x2a')]['find'](_0x4ed12f)[_0xfbc5('0x21')](handleEntityNotFound(_0x1f9e6d,null))[_0xfbc5('0x21')](respondWithResult(_0x1f9e6d,null))[_0xfbc5('0x40')](handleError(_0x1f9e6d,null));};exports[_0xfbc5('0x45')]=function(_0x2d73be,_0x4cd744){return db[_0xfbc5('0x2a')][_0xfbc5('0x45')](_0x2d73be['body'],{})['then'](respondWithResult(_0x4cd744,0xc9))[_0xfbc5('0x40')](handleError(_0x4cd744,null));};exports[_0xfbc5('0x46')]=function(_0x18fa59,_0x413c99){if(_0x18fa59[_0xfbc5('0x47')]['id']){delete _0x18fa59[_0xfbc5('0x47')]['id'];}return db[_0xfbc5('0x2a')][_0xfbc5('0x48')]({'where':{'id':_0x18fa59[_0xfbc5('0x42')]['id']}})[_0xfbc5('0x21')](handleEntityNotFound(_0x413c99,null))['then'](saveUpdates(_0x18fa59[_0xfbc5('0x47')],null))[_0xfbc5('0x21')](respondWithResult(_0x413c99,null))[_0xfbc5('0x40')](handleError(_0x413c99,null));};exports[_0xfbc5('0x22')]=function(_0x187a3d,_0x375f34){return db['SalesforceAccount'][_0xfbc5('0x48')]({'where':{'id':_0x187a3d[_0xfbc5('0x42')]['id']}})['then'](handleEntityNotFound(_0x375f34,null))['then'](removeEntity(_0x375f34,null))[_0xfbc5('0x40')](handleError(_0x375f34,null));};exports[_0xfbc5('0x49')]=function(_0x36a028,_0x219e8f,_0x323aa0){var _0x58abb4={};var _0x21303a={};var _0x481fda;var _0x53c84d;return db['SalesforceAccount'][_0xfbc5('0x4a')]({'where':{'id':_0x36a028['params']['id']}})['then'](handleEntityNotFound(_0x219e8f,null))['then'](function(_0x11ed94){if(_0x11ed94){_0x481fda=_0x11ed94;_0x21303a[_0xfbc5('0x2d')]=_[_0xfbc5('0x2e')](db[_0xfbc5('0x4b')]['rawAttributes']);_0x21303a[_0xfbc5('0x2f')]=_[_0xfbc5('0x2e')](_0x36a028['query']);_0x21303a['filters']=_[_0xfbc5('0x31')](_0x21303a['model'],_0x21303a[_0xfbc5('0x2f')]);_0x58abb4['attributes']=_[_0xfbc5('0x31')](_0x21303a[_0xfbc5('0x2d')],qs[_0xfbc5('0x33')](_0x36a028[_0xfbc5('0x2f')]['fields']));_0x58abb4['attributes']=_0x58abb4[_0xfbc5('0x32')][_0xfbc5('0x34')]?_0x58abb4[_0xfbc5('0x32')]:_0x21303a[_0xfbc5('0x2d')];_0x58abb4['order']=qs[_0xfbc5('0x38')](_0x36a028['query'][_0xfbc5('0x38')]);_0x58abb4['where']=qs['filters'](_[_0xfbc5('0x39')](_0x36a028[_0xfbc5('0x2f')],_0x21303a[_0xfbc5('0x30')]));if(_0x36a028[_0xfbc5('0x2f')][_0xfbc5('0x3a')]){_0x58abb4[_0xfbc5('0x3d')]=_[_0xfbc5('0x3b')](_0x58abb4[_0xfbc5('0x3d')],{'$or':_[_0xfbc5('0x29')](_0x58abb4[_0xfbc5('0x32')],function(_0x39d373){var _0x588a32={};_0x588a32[_0x39d373]={'$like':'%'+_0x36a028[_0xfbc5('0x2f')][_0xfbc5('0x3a')]+'%'};return _0x588a32;})});}_0x58abb4=_['merge']({},_0x58abb4,_0x36a028[_0xfbc5('0x44')]);return _0x481fda[_0xfbc5('0x49')](_0x58abb4);}})[_0xfbc5('0x21')](function(_0x38c327){if(_0x38c327){_0x53c84d=_0x38c327[_0xfbc5('0x34')];if(!_0x36a028['query'][_0xfbc5('0x35')](_0xfbc5('0x4c'))){_0x58abb4['limit']=qs['limit'](_0x36a028[_0xfbc5('0x2f')][_0xfbc5('0x36')]);_0x58abb4['offset']=qs[_0xfbc5('0x1b')](_0x36a028[_0xfbc5('0x2f')]['offset']);}return _0x481fda[_0xfbc5('0x49')](_0x58abb4);}})[_0xfbc5('0x21')](function(_0x4a355b){if(_0x4a355b){return _0x4a355b?{'count':_0x53c84d,'rows':_0x4a355b}:null;}})[_0xfbc5('0x21')](respondWithResult(_0x219e8f,null))[_0xfbc5('0x40')](handleError(_0x219e8f,null));};exports[_0xfbc5('0x4d')]=function(_0x15d7ab,_0x4d0c24,_0x5db533){if(_0x15d7ab[_0xfbc5('0x47')]['id']){delete _0x15d7ab[_0xfbc5('0x47')]['id'];}return db[_0xfbc5('0x2a')][_0xfbc5('0x4a')]({'where':{'id':_0x15d7ab[_0xfbc5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d0c24,null))[_0xfbc5('0x21')](function(_0x4f9fa5){if(_0x4f9fa5){_0x15d7ab[_0xfbc5('0x47')][_0xfbc5('0x4e')]=_0x4f9fa5['id'];_0x15d7ab['body'][_0xfbc5('0x4f')]=integrations[_0xfbc5('0x50')](_0x15d7ab['body'][_0xfbc5('0x51')],_0x15d7ab[_0xfbc5('0x47')][_0xfbc5('0x52')]);_0x15d7ab[_0xfbc5('0x47')][_0xfbc5('0x53')]=integrations[_0xfbc5('0x54')](_0x15d7ab[_0xfbc5('0x47')][_0xfbc5('0x51')],_0x15d7ab[_0xfbc5('0x47')]['type']);return db[_0xfbc5('0x4b')][_0xfbc5('0x45')](_0x15d7ab[_0xfbc5('0x47')],{'include':[{'model':db[_0xfbc5('0x55')],'as':_0xfbc5('0x4f')},{'model':db['SalesforceField'],'as':_0xfbc5('0x53')}]});}return null;})[_0xfbc5('0x21')](respondWithResult(_0x4d0c24,null))['catch'](handleError(_0x4d0c24,null));};exports[_0xfbc5('0x56')]=function(_0x4da95b,_0x45b6a1,_0xbe98be){var _0x195ddb;var _0x388c6e='';var _0x23f2f5=_0xfbc5('0x57');return db[_0xfbc5('0x2a')][_0xfbc5('0x4a')]({'where':{'id':_0x4da95b['params']['id']},'attributes':['id','remoteUri',_0xfbc5('0x58'),_0xfbc5('0x59'),_0xfbc5('0x5a'),_0xfbc5('0x5b'),_0xfbc5('0x5c')]})['then'](handleEntityNotFound(_0x45b6a1,null))[_0xfbc5('0x21')](function(_0x1fe32a){if(_0x1fe32a){_0x388c6e=_0x1fe32a[_0xfbc5('0x5d')];var _0x52c287=_0x388c6e[_0xfbc5('0x5e')](-0x1);if(_0x52c287==='/'){_0x388c6e=_0x388c6e[_0xfbc5('0x5f')](0x0,_0x388c6e['lastIndexOf'](_0x52c287));}_0x195ddb=new jsforce[(_0xfbc5('0x60'))]({'oauth2':{'loginUrl':_0x388c6e,'clientId':_0x1fe32a['clientId'],'clientSecret':_0x1fe32a[_0xfbc5('0x59')]}});return _0x195ddb[_0xfbc5('0x61')](_0x1fe32a[_0xfbc5('0x5a')],_0x1fe32a[_0xfbc5('0x5b')][_0xfbc5('0x62')](_0x1fe32a[_0xfbc5('0x5c')]));}})['then'](function(_0x40d80a){if(_0x40d80a){if(!_['isNil'](_0x4da95b['query'][_0xfbc5('0x63')])){_0x23f2f5=_0x4da95b['query'][_0xfbc5('0x63')];}return _0x195ddb[_0xfbc5('0x64')](_0x23f2f5)[_0xfbc5('0x65')]();}})['then'](function(_0x445ab5){var _0x21a907=[_0xfbc5('0x66'),'ActivityDate',_0xfbc5('0x67'),_0xfbc5('0x68'),_0xfbc5('0x69'),_0xfbc5('0x6a')];var _0x46da8b=[_0xfbc5('0x6b'),_0xfbc5('0x6c'),_0xfbc5('0x6d'),'boolean',_0xfbc5('0x6e'),_0xfbc5('0x6f'),_0xfbc5('0x70')];if(_0x445ab5){_[_0xfbc5('0x71')](_0x445ab5[_0xfbc5('0x33')],function(_0x3f03f4){return _0x21a907[_0xfbc5('0x72')](_0x3f03f4[_0xfbc5('0x26')])||!_0x46da8b[_0xfbc5('0x72')](_0x3f03f4['type']);});return{'count':_0x445ab5[_0xfbc5('0x33')][_0xfbc5('0x34')],'rows':_[_0xfbc5('0x29')](_0x445ab5[_0xfbc5('0x33')],function(_0x3ae08e){return{'id':_0x3ae08e[_0xfbc5('0x26')],'name':_0x3ae08e['label'],'custom':_0x3ae08e[_0xfbc5('0x73')],'options':_0x3ae08e['picklistValues']['length']>0x0?_[_0xfbc5('0x29')](_0x3ae08e[_0xfbc5('0x74')],function(_0x4fca6c){return{'name':_0x4fca6c[_0xfbc5('0x75')],'value':_0x4fca6c[_0xfbc5('0x76')]};}):_0x3ae08e[_0xfbc5('0x52')]=='boolean'?[{'name':_0xfbc5('0x77'),'value':'true'},{'name':_0xfbc5('0x78'),'value':_0xfbc5('0x79')}]:[]};})};}})[_0xfbc5('0x21')](respondWithResult(_0x45b6a1,null))[_0xfbc5('0x40')](function(_0x4eddb9){var _0x2c1e9f=_0x4da95b[_0xfbc5('0x2f')][_0xfbc5('0x7a')]?0x1f4:_0x4eddb9[_0xfbc5('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfbc5('0x56'),_0x2c1e9f,JSON[_0xfbc5('0x7c')](_0x4eddb9));delete _0x4eddb9[_0xfbc5('0x26')];if(_0x2c1e9f===0x191){_0x2c1e9f=0x190;}_0x45b6a1[_0xfbc5('0x19')](_0x2c1e9f)[_0xfbc5('0x27')](_0x4da95b[_0xfbc5('0x2f')][_0xfbc5('0x7a')]?{'message':_0xfbc5('0x7d'),'statusCode':_0x4eddb9[_0xfbc5('0x7b')]}:_0x4eddb9);});}; \ No newline at end of file +var _0xc0ce=['merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','lastIndexOf','Connection','login','username','concat','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','picklistValues','label','value','true','False','false','error','stringify','test','statusCode','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc0ce,0xbe));var _0xec0c=function(_0x164086,_0xb30a68){_0x164086=_0x164086-0x0;var _0x37a639=_0xc0ce[_0x164086];return _0x37a639;};'use strict';var emlformat=require(_0xec0c('0x0'));var rimraf=require(_0xec0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec0c('0x2'));var BPromise=require(_0xec0c('0x3'));var Mustache=require(_0xec0c('0x4'));var util=require(_0xec0c('0x5'));var path=require(_0xec0c('0x6'));var sox=require(_0xec0c('0x7'));var csv=require(_0xec0c('0x8'));var ejs=require(_0xec0c('0x9'));var fs=require('fs');var fs_extra=require(_0xec0c('0xa'));var _=require(_0xec0c('0xb'));var squel=require('squel');var crypto=require(_0xec0c('0xc'));var jsforce=require(_0xec0c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec0c('0xe'));var Papa=require('papaparse');var Redis=require(_0xec0c('0xf'));var authService=require(_0xec0c('0x10'));var qs=require(_0xec0c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec0c('0x12'));var utils=require(_0xec0c('0x13'));var config=require(_0xec0c('0x14'));var licenseUtil=require(_0xec0c('0x15'));var db=require(_0xec0c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x58e6b4,_0x20e7ac){_0x20e7ac=_0x20e7ac||0xcc;return function(_0x3a8953){if(_0x3a8953){return _0x58e6b4[_0xec0c('0x17')](_0x20e7ac);}return _0x58e6b4['status'](_0x20e7ac)[_0xec0c('0x18')]();};}function respondWithResult(_0x3e1ff6,_0x1ed8e4){_0x1ed8e4=_0x1ed8e4||0xc8;return function(_0x503c02){if(_0x503c02){return _0x3e1ff6[_0xec0c('0x19')](_0x1ed8e4)[_0xec0c('0x1a')](_0x503c02);}};}function respondWithFilteredResult(_0x227728,_0x1ec4c4){return function(_0x389301){if(_0x389301){var _0x45ce9d=typeof _0x1ec4c4['offset']===_0xec0c('0x1b')&&typeof _0x1ec4c4[_0xec0c('0x1c')]==='undefined';var _0x27421b=_0x389301[_0xec0c('0x1d')];var _0x37111a=_0x45ce9d?0x0:_0x1ec4c4[_0xec0c('0x1e')];var _0x5bc0ef=_0x45ce9d?_0x389301[_0xec0c('0x1d')]:_0x1ec4c4[_0xec0c('0x1e')]+_0x1ec4c4[_0xec0c('0x1c')];var _0xe68933;if(_0x5bc0ef>=_0x27421b){_0x5bc0ef=_0x27421b;_0xe68933=0xc8;}else{_0xe68933=0xce;}_0x227728[_0xec0c('0x19')](_0xe68933);return _0x227728[_0xec0c('0x1f')]('Content-Range',_0x37111a+'-'+_0x5bc0ef+'/'+_0x27421b)[_0xec0c('0x1a')](_0x389301);}return null;};}function patchUpdates(_0x45393f){return function(_0x3cfa76){try{jsonpatch[_0xec0c('0x20')](_0x3cfa76,_0x45393f,!![]);}catch(_0x53733f){return BPromise[_0xec0c('0x21')](_0x53733f);}return _0x3cfa76[_0xec0c('0x22')]();};}function saveUpdates(_0x2a163c,_0x3cf06c){return function(_0x520e8c){if(_0x520e8c){return _0x520e8c['update'](_0x2a163c)['then'](function(_0x3a465e){return _0x3a465e;});}return null;};}function removeEntity(_0xd07049,_0x2e92ac){return function(_0xfa0587){if(_0xfa0587){return _0xfa0587['destroy']()['then'](function(){_0xd07049['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe23b55,_0x5ce2d9){return function(_0x110af3){if(!_0x110af3){_0xe23b55[_0xec0c('0x17')](0x194);}return _0x110af3;};}function handleError(_0x369f3e,_0x3340b3){_0x3340b3=_0x3340b3||0x1f4;return function(_0xefc2fd){logger['error'](_0xefc2fd[_0xec0c('0x23')]);if(_0xefc2fd['name']){delete _0xefc2fd[_0xec0c('0x24')];}_0x369f3e[_0xec0c('0x19')](_0x3340b3)[_0xec0c('0x25')](_0xefc2fd);};}exports[_0xec0c('0x26')]=function(_0x139c1e,_0x488958){var _0x10e9ce={},_0x5d033e={},_0x467e34={'count':0x0,'rows':[]};var _0x5e18d2=_[_0xec0c('0x27')](db[_0xec0c('0x28')][_0xec0c('0x29')],function(_0xbaacbf){return{'name':_0xbaacbf['fieldName'],'type':_0xbaacbf[_0xec0c('0x2a')]['key']};});_0x5d033e[_0xec0c('0x2b')]=_[_0xec0c('0x27')](_0x5e18d2,_0xec0c('0x24'));_0x5d033e[_0xec0c('0x2c')]=_[_0xec0c('0x2d')](_0x139c1e[_0xec0c('0x2c')]);_0x5d033e[_0xec0c('0x2e')]=_[_0xec0c('0x2f')](_0x5d033e[_0xec0c('0x2b')],_0x5d033e[_0xec0c('0x2c')]);_0x10e9ce[_0xec0c('0x30')]=_[_0xec0c('0x2f')](_0x5d033e[_0xec0c('0x2b')],qs['fields'](_0x139c1e[_0xec0c('0x2c')][_0xec0c('0x31')]));_0x10e9ce[_0xec0c('0x30')]=_0x10e9ce[_0xec0c('0x30')][_0xec0c('0x32')]?_0x10e9ce[_0xec0c('0x30')]:_0x5d033e[_0xec0c('0x2b')];if(!_0x139c1e[_0xec0c('0x2c')]['hasOwnProperty'](_0xec0c('0x33'))){_0x10e9ce['limit']=qs[_0xec0c('0x1c')](_0x139c1e['query']['limit']);_0x10e9ce[_0xec0c('0x1e')]=qs[_0xec0c('0x1e')](_0x139c1e[_0xec0c('0x2c')][_0xec0c('0x1e')]);}_0x10e9ce[_0xec0c('0x34')]=qs['sort'](_0x139c1e[_0xec0c('0x2c')][_0xec0c('0x35')]);_0x10e9ce['where']=qs['filters'](_[_0xec0c('0x36')](_0x139c1e[_0xec0c('0x2c')],_0x5d033e[_0xec0c('0x2e')]),_0x5e18d2);if(_0x139c1e[_0xec0c('0x2c')]['filter']){_0x10e9ce[_0xec0c('0x37')]=_[_0xec0c('0x38')](_0x10e9ce['where'],{'$or':_[_0xec0c('0x27')](_0x5e18d2,function(_0x29c834){if(_0x29c834[_0xec0c('0x2a')]!==_0xec0c('0x39')){var _0x45c085={};_0x45c085[_0x29c834[_0xec0c('0x24')]]={'$like':'%'+_0x139c1e[_0xec0c('0x2c')][_0xec0c('0x3a')]+'%'};return _0x45c085;}})});}_0x10e9ce=_[_0xec0c('0x38')]({},_0x10e9ce,_0x139c1e['options']);var _0x31cd63={'where':_0x10e9ce[_0xec0c('0x37')]};return db[_0xec0c('0x28')][_0xec0c('0x1d')](_0x31cd63)[_0xec0c('0x3b')](function(_0x363c1a){_0x467e34['count']=_0x363c1a;if(_0x139c1e['query'][_0xec0c('0x3c')]){_0x10e9ce[_0xec0c('0x3d')]=[{'all':!![]}];}return db[_0xec0c('0x28')][_0xec0c('0x3e')](_0x10e9ce);})[_0xec0c('0x3b')](function(_0xc56df9){_0x467e34[_0xec0c('0x3f')]=_0xc56df9;return _0x467e34;})[_0xec0c('0x3b')](respondWithFilteredResult(_0x488958,_0x10e9ce))[_0xec0c('0x40')](handleError(_0x488958,null));};exports[_0xec0c('0x41')]=function(_0x34abd2,_0x6f1607){var _0x347ed3={'raw':![],'where':{'id':_0x34abd2[_0xec0c('0x42')]['id']}},_0x2bf85c={};_0x2bf85c['model']=_[_0xec0c('0x2d')](db[_0xec0c('0x28')][_0xec0c('0x29')]);_0x2bf85c['query']=_[_0xec0c('0x2d')](_0x34abd2[_0xec0c('0x2c')]);_0x2bf85c[_0xec0c('0x2e')]=_[_0xec0c('0x2f')](_0x2bf85c[_0xec0c('0x2b')],_0x2bf85c[_0xec0c('0x2c')]);_0x347ed3[_0xec0c('0x30')]=_['intersection'](_0x2bf85c[_0xec0c('0x2b')],qs[_0xec0c('0x31')](_0x34abd2['query'][_0xec0c('0x31')]));_0x347ed3[_0xec0c('0x30')]=_0x347ed3[_0xec0c('0x30')][_0xec0c('0x32')]?_0x347ed3[_0xec0c('0x30')]:_0x2bf85c[_0xec0c('0x2b')];if(_0x34abd2[_0xec0c('0x2c')]['includeAll']){_0x347ed3[_0xec0c('0x3d')]=[{'all':!![]}];}_0x347ed3=_[_0xec0c('0x38')]({},_0x347ed3,_0x34abd2[_0xec0c('0x43')]);return db[_0xec0c('0x28')][_0xec0c('0x44')](_0x347ed3)[_0xec0c('0x3b')](handleEntityNotFound(_0x6f1607,null))['then'](respondWithResult(_0x6f1607,null))[_0xec0c('0x40')](handleError(_0x6f1607,null));};exports[_0xec0c('0x45')]=function(_0x53163a,_0x935d15){return db[_0xec0c('0x28')]['create'](_0x53163a[_0xec0c('0x46')],{})[_0xec0c('0x3b')](respondWithResult(_0x935d15,0xc9))[_0xec0c('0x40')](handleError(_0x935d15,null));};exports[_0xec0c('0x47')]=function(_0x21b049,_0x2bde38){if(_0x21b049[_0xec0c('0x46')]['id']){delete _0x21b049[_0xec0c('0x46')]['id'];}return db[_0xec0c('0x28')][_0xec0c('0x44')]({'where':{'id':_0x21b049[_0xec0c('0x42')]['id']}})[_0xec0c('0x3b')](handleEntityNotFound(_0x2bde38,null))[_0xec0c('0x3b')](saveUpdates(_0x21b049[_0xec0c('0x46')],null))[_0xec0c('0x3b')](respondWithResult(_0x2bde38,null))[_0xec0c('0x40')](handleError(_0x2bde38,null));};exports['destroy']=function(_0x57fd91,_0x3f218c){return db[_0xec0c('0x28')][_0xec0c('0x44')]({'where':{'id':_0x57fd91['params']['id']}})[_0xec0c('0x3b')](handleEntityNotFound(_0x3f218c,null))[_0xec0c('0x3b')](removeEntity(_0x3f218c,null))[_0xec0c('0x40')](handleError(_0x3f218c,null));};exports[_0xec0c('0x48')]=function(_0x4d44c3,_0x21a604,_0x5a8bd5){var _0x16a588={};var _0x487578={};var _0x2e443f;var _0x635d90;return db[_0xec0c('0x28')][_0xec0c('0x49')]({'where':{'id':_0x4d44c3[_0xec0c('0x42')]['id']}})[_0xec0c('0x3b')](handleEntityNotFound(_0x21a604,null))[_0xec0c('0x3b')](function(_0x4849ab){if(_0x4849ab){_0x2e443f=_0x4849ab;_0x487578['model']=_[_0xec0c('0x2d')](db[_0xec0c('0x4a')][_0xec0c('0x29')]);_0x487578[_0xec0c('0x2c')]=_[_0xec0c('0x2d')](_0x4d44c3[_0xec0c('0x2c')]);_0x487578[_0xec0c('0x2e')]=_['intersection'](_0x487578[_0xec0c('0x2b')],_0x487578['query']);_0x16a588['attributes']=_[_0xec0c('0x2f')](_0x487578[_0xec0c('0x2b')],qs[_0xec0c('0x31')](_0x4d44c3[_0xec0c('0x2c')][_0xec0c('0x31')]));_0x16a588[_0xec0c('0x30')]=_0x16a588[_0xec0c('0x30')][_0xec0c('0x32')]?_0x16a588[_0xec0c('0x30')]:_0x487578[_0xec0c('0x2b')];_0x16a588[_0xec0c('0x34')]=qs['sort'](_0x4d44c3[_0xec0c('0x2c')][_0xec0c('0x35')]);_0x16a588[_0xec0c('0x37')]=qs[_0xec0c('0x2e')](_[_0xec0c('0x36')](_0x4d44c3[_0xec0c('0x2c')],_0x487578['filters']));if(_0x4d44c3[_0xec0c('0x2c')][_0xec0c('0x3a')]){_0x16a588[_0xec0c('0x37')]=_['merge'](_0x16a588[_0xec0c('0x37')],{'$or':_['map'](_0x16a588[_0xec0c('0x30')],function(_0x2d309c){var _0x59fa52={};_0x59fa52[_0x2d309c]={'$like':'%'+_0x4d44c3[_0xec0c('0x2c')][_0xec0c('0x3a')]+'%'};return _0x59fa52;})});}_0x16a588=_[_0xec0c('0x38')]({},_0x16a588,_0x4d44c3[_0xec0c('0x43')]);return _0x2e443f[_0xec0c('0x48')](_0x16a588);}})['then'](function(_0x4c4247){if(_0x4c4247){_0x635d90=_0x4c4247[_0xec0c('0x32')];if(!_0x4d44c3['query'][_0xec0c('0x4b')](_0xec0c('0x33'))){_0x16a588[_0xec0c('0x1c')]=qs['limit'](_0x4d44c3[_0xec0c('0x2c')][_0xec0c('0x1c')]);_0x16a588[_0xec0c('0x1e')]=qs['offset'](_0x4d44c3['query'][_0xec0c('0x1e')]);}return _0x2e443f[_0xec0c('0x48')](_0x16a588);}})[_0xec0c('0x3b')](function(_0x44d613){if(_0x44d613){return _0x44d613?{'count':_0x635d90,'rows':_0x44d613}:null;}})[_0xec0c('0x3b')](respondWithResult(_0x21a604,null))[_0xec0c('0x40')](handleError(_0x21a604,null));};exports[_0xec0c('0x4c')]=function(_0x291081,_0x2a355c,_0x2ba062){if(_0x291081[_0xec0c('0x46')]['id']){delete _0x291081['body']['id'];}return db['SalesforceAccount'][_0xec0c('0x49')]({'where':{'id':_0x291081['params']['id']}})[_0xec0c('0x3b')](handleEntityNotFound(_0x2a355c,null))[_0xec0c('0x3b')](function(_0x15c2c7){if(_0x15c2c7){_0x291081[_0xec0c('0x46')][_0xec0c('0x4d')]=_0x15c2c7['id'];_0x291081['body'][_0xec0c('0x4e')]=integrations[_0xec0c('0x4f')](_0x291081[_0xec0c('0x46')][_0xec0c('0x50')],_0x291081[_0xec0c('0x46')][_0xec0c('0x2a')]);_0x291081['body'][_0xec0c('0x51')]=integrations[_0xec0c('0x52')](_0x291081[_0xec0c('0x46')][_0xec0c('0x50')],_0x291081[_0xec0c('0x46')]['type']);return db[_0xec0c('0x4a')][_0xec0c('0x45')](_0x291081[_0xec0c('0x46')],{'include':[{'model':db[_0xec0c('0x53')],'as':_0xec0c('0x4e')},{'model':db[_0xec0c('0x53')],'as':_0xec0c('0x51')}]});}return null;})[_0xec0c('0x3b')](respondWithResult(_0x2a355c,null))['catch'](handleError(_0x2a355c,null));};exports[_0xec0c('0x54')]=function(_0x204d7d,_0x4acf59,_0xa59efe){var _0x49803b;var _0x39d5a4='';var _0x2f8969=_0xec0c('0x55');return db[_0xec0c('0x28')]['findOne']({'where':{'id':_0x204d7d[_0xec0c('0x42')]['id']},'attributes':['id',_0xec0c('0x56'),_0xec0c('0x57'),_0xec0c('0x58'),'username',_0xec0c('0x59'),_0xec0c('0x5a')]})[_0xec0c('0x3b')](handleEntityNotFound(_0x4acf59,null))['then'](function(_0x1dea06){if(_0x1dea06){_0x39d5a4=_0x1dea06[_0xec0c('0x56')];var _0x505cf8=_0x39d5a4[_0xec0c('0x5b')](-0x1);if(_0x505cf8==='/'){_0x39d5a4=_0x39d5a4['substring'](0x0,_0x39d5a4[_0xec0c('0x5c')](_0x505cf8));}_0x49803b=new jsforce[(_0xec0c('0x5d'))]({'oauth2':{'loginUrl':_0x39d5a4,'clientId':_0x1dea06[_0xec0c('0x57')],'clientSecret':_0x1dea06[_0xec0c('0x58')]}});return _0x49803b[_0xec0c('0x5e')](_0x1dea06[_0xec0c('0x5f')],_0x1dea06['password'][_0xec0c('0x60')](_0x1dea06[_0xec0c('0x5a')]));}})['then'](function(_0x498dce){if(_0x498dce){if(!_['isNil'](_0x204d7d[_0xec0c('0x2c')][_0xec0c('0x61')])){_0x2f8969=_0x204d7d[_0xec0c('0x2c')][_0xec0c('0x61')];}return _0x49803b[_0xec0c('0x62')](_0x2f8969)[_0xec0c('0x63')]();}})['then'](function(_0x484f0f){var _0x5ad0c5=[_0xec0c('0x64'),'ActivityDate',_0xec0c('0x65'),_0xec0c('0x66'),_0xec0c('0x67'),_0xec0c('0x68')];var _0x30b0c2=['string',_0xec0c('0x69'),_0xec0c('0x6a'),_0xec0c('0x6b'),_0xec0c('0x6c'),_0xec0c('0x6d'),_0xec0c('0x6e')];if(_0x484f0f){_[_0xec0c('0x6f')](_0x484f0f[_0xec0c('0x31')],function(_0x2a3e71){return _0x5ad0c5[_0xec0c('0x70')](_0x2a3e71[_0xec0c('0x24')])||!_0x30b0c2[_0xec0c('0x70')](_0x2a3e71[_0xec0c('0x2a')]);});return{'count':_0x484f0f['fields']['length'],'rows':_[_0xec0c('0x27')](_0x484f0f[_0xec0c('0x31')],function(_0x2a36aa){return{'id':_0x2a36aa[_0xec0c('0x24')],'name':_0x2a36aa['label'],'custom':_0x2a36aa['custom'],'options':_0x2a36aa[_0xec0c('0x71')][_0xec0c('0x32')]>0x0?_['map'](_0x2a36aa[_0xec0c('0x71')],function(_0x371f4d){return{'name':_0x371f4d[_0xec0c('0x72')],'value':_0x371f4d[_0xec0c('0x73')]};}):_0x2a36aa[_0xec0c('0x2a')]==_0xec0c('0x6b')?[{'name':'True','value':_0xec0c('0x74')},{'name':_0xec0c('0x75'),'value':_0xec0c('0x76')}]:[]};})};}})[_0xec0c('0x3b')](respondWithResult(_0x4acf59,null))[_0xec0c('0x40')](function(_0x59d9f8){var _0x7807f6=_0x204d7d[_0xec0c('0x2c')]['test']?0x1f4:_0x59d9f8['statusCode']||0x1f4;logger[_0xec0c('0x77')]('getFields,\x20%s,\x20%s,\x20%s',_0xec0c('0x54'),_0x7807f6,JSON[_0xec0c('0x78')](_0x59d9f8));delete _0x59d9f8['name'];if(_0x7807f6===0x191){_0x7807f6=0x190;}_0x4acf59['status'](_0x7807f6)[_0xec0c('0x25')](_0x204d7d[_0xec0c('0x2c')][_0xec0c('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x59d9f8[_0xec0c('0x7a')]}:_0x59d9f8);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4a0db7b..e580631 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 _0x2e03=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','api','moment'];(function(_0x4b2de5,_0x38e34a){var _0x1043ad=function(_0x23af71){while(--_0x23af71){_0x4b2de5['push'](_0x4b2de5['shift']());}};_0x1043ad(++_0x38e34a);}(_0x2e03,0xa2));var _0x32e0=function(_0xf1a5ba,_0x3e2722){_0xf1a5ba=_0xf1a5ba-0x0;var _0x4c7b1f=_0x2e03[_0xf1a5ba];return _0x4c7b1f;};'use strict';var _=require('lodash');var util=require(_0x32e0('0x0'));var logger=require('../../config/logger')(_0x32e0('0x1'));var moment=require(_0x32e0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x32e0('0x3'));var rimraf=require(_0x32e0('0x4'));var config=require(_0x32e0('0x5'));var attributes=require(_0x32e0('0x6'));var integrations=require(_0x32e0('0x7'));module['exports']=function(_0x49dc2e,_0x13c8ff){return _0x49dc2e[_0x32e0('0x8')](_0x32e0('0x9'),attributes,{'tableName':_0x32e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca4=['bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment'];(function(_0x1334d7,_0x110f73){var _0x315547=function(_0x5c814c){while(--_0x5c814c){_0x1334d7['push'](_0x1334d7['shift']());}};_0x315547(++_0x110f73);}(_0x0ca4,0x15a));var _0x40ca=function(_0x286a14,_0x1537d2){_0x286a14=_0x286a14-0x0;var _0x297888=_0x0ca4[_0x286a14];return _0x297888;};'use strict';var _=require(_0x40ca('0x0'));var util=require('util');var logger=require(_0x40ca('0x1'))(_0x40ca('0x2'));var moment=require(_0x40ca('0x3'));var BPromise=require(_0x40ca('0x4'));var rp=require(_0x40ca('0x5'));var fs=require('fs');var path=require(_0x40ca('0x6'));var rimraf=require('rimraf');var config=require(_0x40ca('0x7'));var attributes=require(_0x40ca('0x8'));var integrations=require(_0x40ca('0x9'));module[_0x40ca('0xa')]=function(_0x38abec,_0x446439){return _0x38abec[_0x40ca('0xb')](_0x40ca('0xc'),attributes,{'tableName':_0x40ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ac60076..dbee7ab 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 _0x7556=['include','map','model','GetSalesforceAccount','ShowSalesforceAccount','find','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','SalesforceAccount','findAll','options','where','attributes','limit'];(function(_0x30994d,_0x2cc269){var _0x4554df=function(_0x125125){while(--_0x125125){_0x30994d['push'](_0x30994d['shift']());}};_0x4554df(++_0x2cc269);}(_0x7556,0x188));var _0x6755=function(_0x4a5eca,_0x490e50){_0x4a5eca=_0x4a5eca-0x0;var _0x3caf2f=_0x7556[_0x4a5eca];return _0x3caf2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6755('0x0'));var rs=require(_0x6755('0x1'));var fs=require('fs');var Redis=require(_0x6755('0x2'));var db=require(_0x6755('0x3'))['db'];var utils=require(_0x6755('0x4'));var logger=require(_0x6755('0x5'))('rpc');var config=require(_0x6755('0x6'));var jayson=require(_0x6755('0x7'));var client=jayson[_0x6755('0x8')][_0x6755('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1af35b,_0xf19d89,_0x13a2e0){return new BPromise(function(_0x261e9e,_0x4900cd){return client[_0x6755('0xa')](_0x1af35b,_0x13a2e0)[_0x6755('0xb')](function(_0x32f838){logger[_0x6755('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0xf19d89,_0x6755('0xd'));logger[_0x6755('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xf19d89,'request\x20sent',JSON[_0x6755('0xf')](_0x32f838));if(_0x32f838[_0x6755('0x10')]){if(_0x32f838['error'][_0x6755('0x11')]===0x1f4){logger[_0x6755('0x10')](_0x6755('0x12'),_0xf19d89,_0x32f838[_0x6755('0x10')][_0x6755('0x13')]);return _0x4900cd(_0x32f838['error'][_0x6755('0x13')]);}logger['error'](_0x6755('0x12'),_0xf19d89,_0x32f838[_0x6755('0x10')][_0x6755('0x13')]);return _0x261e9e(_0x32f838[_0x6755('0x10')][_0x6755('0x13')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xf19d89,_0x6755('0xd'));_0x261e9e(_0x32f838[_0x6755('0x14')][_0x6755('0x13')]);}})[_0x6755('0x15')](function(_0x3b5141){logger[_0x6755('0x10')](_0x6755('0x12'),_0xf19d89,_0x3b5141);_0x4900cd(_0x3b5141);});});}exports['GetSalesforceAccount']=function(_0x2ee4f5){var _0x2cc629=this;return new Promise(function(_0x3d2897,_0x478667){return db[_0x6755('0x16')][_0x6755('0x17')]({'raw':_0x2ee4f5[_0x6755('0x18')]?_0x2ee4f5['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ee4f5[_0x6755('0x18')]?_0x2ee4f5[_0x6755('0x18')][_0x6755('0x19')]||null:null,'attributes':_0x2ee4f5['options']?_0x2ee4f5[_0x6755('0x18')][_0x6755('0x1a')]||null:null,'limit':_0x2ee4f5['options']?_0x2ee4f5[_0x6755('0x18')][_0x6755('0x1b')]||null:null,'include':_0x2ee4f5[_0x6755('0x18')]?_0x2ee4f5[_0x6755('0x18')][_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x2ee4f5[_0x6755('0x18')][_0x6755('0x1c')],function(_0x179135){return{'model':db[_0x179135['model']],'as':_0x179135['as'],'attributes':_0x179135[_0x6755('0x1a')],'include':_0x179135[_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x179135[_0x6755('0x1c')],function(_0x372bac){return{'model':db[_0x372bac[_0x6755('0x1e')]],'as':_0x372bac['as'],'attributes':_0x372bac[_0x6755('0x1a')],'include':_0x372bac[_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x372bac[_0x6755('0x1c')],function(_0x27d866){return{'model':db[_0x27d866[_0x6755('0x1e')]],'as':_0x27d866['as'],'attributes':_0x27d866['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18ece3){logger[_0x6755('0xc')](_0x6755('0x1f'),_0x2ee4f5);logger[_0x6755('0xe')](_0x6755('0x1f'),_0x2ee4f5,JSON[_0x6755('0xf')](_0x18ece3));_0x3d2897(_0x18ece3);})[_0x6755('0x15')](function(_0x41a1b2){logger[_0x6755('0x10')](_0x6755('0x1f'),_0x41a1b2[_0x6755('0x13')],_0x2ee4f5);_0x478667(_0x2cc629[_0x6755('0x10')](0x1f4,_0x41a1b2[_0x6755('0x13')]));});});};exports[_0x6755('0x20')]=function(_0x15b271){var _0x1fea0c=this;return new Promise(function(_0x21db2b,_0x2d997b){return db[_0x6755('0x16')][_0x6755('0x21')]({'raw':_0x15b271['options']?_0x15b271[_0x6755('0x18')][_0x6755('0x22')]===undefined?!![]:![]:!![],'where':_0x15b271['options']?_0x15b271['options']['where']||null:null,'attributes':_0x15b271[_0x6755('0x18')]?_0x15b271[_0x6755('0x18')][_0x6755('0x1a')]||null:null,'include':_0x15b271[_0x6755('0x18')]?_0x15b271[_0x6755('0x18')][_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x15b271[_0x6755('0x18')]['include'],function(_0x40cb22){return{'model':db[_0x40cb22[_0x6755('0x1e')]],'as':_0x40cb22['as'],'attributes':_0x40cb22[_0x6755('0x1a')],'include':_0x40cb22[_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x40cb22['include'],function(_0x2e07ae){return{'model':db[_0x2e07ae[_0x6755('0x1e')]],'as':_0x2e07ae['as'],'attributes':_0x2e07ae[_0x6755('0x1a')],'include':_0x2e07ae[_0x6755('0x1c')]?_[_0x6755('0x1d')](_0x2e07ae[_0x6755('0x1c')],function(_0x47382c){return{'model':db[_0x47382c[_0x6755('0x1e')]],'as':_0x47382c['as'],'attributes':_0x47382c[_0x6755('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6755('0xb')](function(_0x268133){logger[_0x6755('0xc')](_0x6755('0x20'),_0x15b271);logger[_0x6755('0xe')](_0x6755('0x20'),_0x15b271,JSON[_0x6755('0xf')](_0x268133));_0x21db2b(_0x268133);})[_0x6755('0x15')](function(_0x55cd97){logger[_0x6755('0x10')](_0x6755('0x20'),_0x55cd97[_0x6755('0x13')],_0x15b271);_0x2d997b(_0x1fea0c[_0x6755('0x10')](0x1f4,_0x55cd97[_0x6755('0x13')]));});});}; \ No newline at end of file +var _0x9de0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','ShowSalesforceAccount','find','lodash','util'];(function(_0x100d63,_0x2dfabc){var _0x3e4ed9=function(_0x467bdc){while(--_0x467bdc){_0x100d63['push'](_0x100d63['shift']());}};_0x3e4ed9(++_0x2dfabc);}(_0x9de0,0x148));var _0x09de=function(_0x852fbb,_0x3c14ae){_0x852fbb=_0x852fbb-0x0;var _0x1d0bf0=_0x9de0[_0x852fbb];return _0x1d0bf0;};'use strict';var _=require(_0x09de('0x0'));var util=require(_0x09de('0x1'));var moment=require('moment');var BPromise=require(_0x09de('0x2'));var rs=require(_0x09de('0x3'));var fs=require('fs');var Redis=require(_0x09de('0x4'));var db=require(_0x09de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x09de('0x6'))(_0x09de('0x7'));var config=require(_0x09de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x09de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x292792,_0x4f4060,_0x16243b){return new BPromise(function(_0x24b5d7,_0xa5af72){return client['request'](_0x292792,_0x16243b)[_0x09de('0xa')](function(_0x4e23a0){logger[_0x09de('0xb')](_0x09de('0xc'),_0x4f4060,_0x09de('0xd'));logger[_0x09de('0xe')](_0x09de('0xf'),_0x4f4060,_0x09de('0xd'),JSON[_0x09de('0x10')](_0x4e23a0));if(_0x4e23a0[_0x09de('0x11')]){if(_0x4e23a0['error']['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4f4060,_0x4e23a0['error'][_0x09de('0x12')]);return _0xa5af72(_0x4e23a0[_0x09de('0x11')]['message']);}logger[_0x09de('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4f4060,_0x4e23a0['error']['message']);return _0x24b5d7(_0x4e23a0[_0x09de('0x11')][_0x09de('0x12')]);}else{logger[_0x09de('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x4f4060,'request\x20sent');_0x24b5d7(_0x4e23a0[_0x09de('0x13')][_0x09de('0x12')]);}})[_0x09de('0x14')](function(_0x2c899f){logger[_0x09de('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4f4060,_0x2c899f);_0xa5af72(_0x2c899f);});});}exports[_0x09de('0x15')]=function(_0x551ce3){var _0x5cc25d=this;return new Promise(function(_0x4696eb,_0x28c27d){return db[_0x09de('0x16')][_0x09de('0x17')]({'raw':_0x551ce3[_0x09de('0x18')]?_0x551ce3['options'][_0x09de('0x19')]===undefined?!![]:![]:!![],'where':_0x551ce3['options']?_0x551ce3[_0x09de('0x18')][_0x09de('0x1a')]||null:null,'attributes':_0x551ce3['options']?_0x551ce3['options'][_0x09de('0x1b')]||null:null,'limit':_0x551ce3[_0x09de('0x18')]?_0x551ce3['options']['limit']||null:null,'include':_0x551ce3[_0x09de('0x18')]?_0x551ce3['options'][_0x09de('0x1c')]?_[_0x09de('0x1d')](_0x551ce3[_0x09de('0x18')][_0x09de('0x1c')],function(_0x1bda28){return{'model':db[_0x1bda28[_0x09de('0x1e')]],'as':_0x1bda28['as'],'attributes':_0x1bda28[_0x09de('0x1b')],'include':_0x1bda28[_0x09de('0x1c')]?_[_0x09de('0x1d')](_0x1bda28[_0x09de('0x1c')],function(_0xa74d83){return{'model':db[_0xa74d83[_0x09de('0x1e')]],'as':_0xa74d83['as'],'attributes':_0xa74d83[_0x09de('0x1b')],'include':_0xa74d83[_0x09de('0x1c')]?_[_0x09de('0x1d')](_0xa74d83['include'],function(_0x25fb7b){return{'model':db[_0x25fb7b[_0x09de('0x1e')]],'as':_0x25fb7b['as'],'attributes':_0x25fb7b[_0x09de('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e4544){logger[_0x09de('0xb')](_0x09de('0x15'),_0x551ce3);logger['debug']('GetSalesforceAccount',_0x551ce3,JSON[_0x09de('0x10')](_0x2e4544));_0x4696eb(_0x2e4544);})[_0x09de('0x14')](function(_0x39e381){logger[_0x09de('0x11')]('GetSalesforceAccount',_0x39e381[_0x09de('0x12')],_0x551ce3);_0x28c27d(_0x5cc25d[_0x09de('0x11')](0x1f4,_0x39e381[_0x09de('0x12')]));});});};exports[_0x09de('0x1f')]=function(_0x388aee){var _0x45e843=this;return new Promise(function(_0x4d4208,_0x1a2f85){return db['SalesforceAccount'][_0x09de('0x20')]({'raw':_0x388aee[_0x09de('0x18')]?_0x388aee[_0x09de('0x18')][_0x09de('0x19')]===undefined?!![]:![]:!![],'where':_0x388aee[_0x09de('0x18')]?_0x388aee[_0x09de('0x18')]['where']||null:null,'attributes':_0x388aee[_0x09de('0x18')]?_0x388aee['options']['attributes']||null:null,'include':_0x388aee[_0x09de('0x18')]?_0x388aee[_0x09de('0x18')]['include']?_[_0x09de('0x1d')](_0x388aee['options'][_0x09de('0x1c')],function(_0x591ef8){return{'model':db[_0x591ef8[_0x09de('0x1e')]],'as':_0x591ef8['as'],'attributes':_0x591ef8[_0x09de('0x1b')],'include':_0x591ef8[_0x09de('0x1c')]?_['map'](_0x591ef8[_0x09de('0x1c')],function(_0x2a8960){return{'model':db[_0x2a8960[_0x09de('0x1e')]],'as':_0x2a8960['as'],'attributes':_0x2a8960[_0x09de('0x1b')],'include':_0x2a8960[_0x09de('0x1c')]?_[_0x09de('0x1d')](_0x2a8960[_0x09de('0x1c')],function(_0x558d6d){return{'model':db[_0x558d6d[_0x09de('0x1e')]],'as':_0x558d6d['as'],'attributes':_0x558d6d[_0x09de('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x09de('0xa')](function(_0x27c52e){logger[_0x09de('0xb')]('ShowSalesforceAccount',_0x388aee);logger['debug'](_0x09de('0x1f'),_0x388aee,JSON[_0x09de('0x10')](_0x27c52e));_0x4d4208(_0x27c52e);})[_0x09de('0x14')](function(_0x12ef82){logger[_0x09de('0x11')](_0x09de('0x1f'),_0x12ef82[_0x09de('0x12')],_0x388aee);_0x1a2f85(_0x45e843[_0x09de('0x11')](0x1f4,_0x12ef82['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bc33bb5..14c6dc4 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x30f0f4,_0x34bcc0){var _0xd1c482=function(_0xe24325){while(--_0xe24325){_0x30f0f4['push'](_0x30f0f4['shift']());}};_0xd1c482(++_0x34bcc0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a510b,_0x5db1ec){_0x2a510b=_0x2a510b-0x0;var _0xae024d=_0x5f2f[_0x2a510b];return _0xae024d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0xda468e,_0x4ea07b){var _0x3767e0=function(_0x2a2c88){while(--_0x2a2c88){_0xda468e['push'](_0xda468e['shift']());}};_0x3767e0(++_0x4ea07b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4f1747,_0x2952dd){_0x4f1747=_0x4f1747-0x0;var _0x1cb86c=_0x2ef3[_0x4f1747];return _0x1cb86c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0c412cf..3c0a0bb 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 _0xfb89=['nothing','STRING','ENUM','Task','Case','contact_lead','contact','lead','account'];(function(_0x145011,_0x3eb4ef){var _0x3cb5af=function(_0x17d2e4){while(--_0x17d2e4){_0x145011['push'](_0x145011['shift']());}};_0x3cb5af(++_0x3eb4ef);}(_0xfb89,0x196));var _0x9fb8=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0xfb89[_0x4191bc];return _0x1ffd4e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9fb8('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9fb8('0x1')](_0x9fb8('0x2'),_0x9fb8('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x9fb8('0x4'),_0x9fb8('0x5'),_0x9fb8('0x6'),'account_contact_lead',_0x9fb8('0x7')),'defaultValue':_0x9fb8('0x4')},'moduleCreate':{'type':Sequelize[_0x9fb8('0x1')](_0x9fb8('0x8'),_0x9fb8('0x5'),'lead',_0x9fb8('0x7')),'defaultValue':_0x9fb8('0x6')},'leadId':{'type':Sequelize[_0x9fb8('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x9fb8('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x9fb8('0x0')]}}; \ No newline at end of file +var _0x3c03=['account_contact_lead','account','ENUM','lead','sequelize','exports','STRING','Task','Case','contact_lead','contact'];(function(_0x4b36bd,_0x25a84a){var _0xb4a41f=function(_0x51b264){while(--_0x51b264){_0x4b36bd['push'](_0x4b36bd['shift']());}};_0xb4a41f(++_0x25a84a);}(_0x3c03,0xeb));var _0x33c0=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3c03[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x33c0('0x0'));module[_0x33c0('0x1')]={'name':{'type':Sequelize[_0x33c0('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x33c0('0x3'),_0x33c0('0x4')),'defaultValue':_0x33c0('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x33c0('0x5'),_0x33c0('0x6'),'lead',_0x33c0('0x7'),_0x33c0('0x8')),'defaultValue':_0x33c0('0x5')},'moduleCreate':{'type':Sequelize[_0x33c0('0x9')]('nothing',_0x33c0('0x6'),_0x33c0('0xa'),_0x33c0('0x8')),'defaultValue':_0x33c0('0xa')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x33c0('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x33c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 25e5cc6..c522fea 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 _0x8796=['error','stack','name','send','index','map','rawAttributes','key','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','SalesforceConfiguration','findAll','catch','show','params','intersection','find','create','body','findOne','SalesforceField','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8796,0xcd));var _0x6879=function(_0x24ba0f,_0x3931e6){_0x24ba0f=_0x24ba0f-0x0;var _0x2073a6=_0x8796[_0x24ba0f];return _0x2073a6;};'use strict';var emlformat=require(_0x6879('0x0'));var rimraf=require(_0x6879('0x1'));var zipdir=require(_0x6879('0x2'));var jsonpatch=require(_0x6879('0x3'));var rp=require('request-promise');var moment=require(_0x6879('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6879('0x5'));var path=require(_0x6879('0x6'));var sox=require(_0x6879('0x7'));var csv=require(_0x6879('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6879('0x9'));var _=require(_0x6879('0xa'));var squel=require(_0x6879('0xb'));var crypto=require(_0x6879('0xc'));var jsforce=require(_0x6879('0xd'));var deskjs=require(_0x6879('0xe'));var toCsv=require(_0x6879('0x8'));var querystring=require(_0x6879('0xf'));var Papa=require(_0x6879('0x10'));var Redis=require(_0x6879('0x11'));var authService=require(_0x6879('0x12'));var qs=require(_0x6879('0x13'));var as=require(_0x6879('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6879('0x15'))(_0x6879('0x16'));var utils=require(_0x6879('0x17'));var config=require(_0x6879('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6879('0x19'))['db'];function respondWithStatusCode(_0x318641,_0x194ca6){_0x194ca6=_0x194ca6||0xcc;return function(_0x273efa){if(_0x273efa){return _0x318641[_0x6879('0x1a')](_0x194ca6);}return _0x318641[_0x6879('0x1b')](_0x194ca6)[_0x6879('0x1c')]();};}function respondWithResult(_0x4edb5d,_0x4a8654){_0x4a8654=_0x4a8654||0xc8;return function(_0x119944){if(_0x119944){return _0x4edb5d[_0x6879('0x1b')](_0x4a8654)[_0x6879('0x1d')](_0x119944);}};}function respondWithFilteredResult(_0x3f0461,_0x15dc85){return function(_0x4b2de1){if(_0x4b2de1){var _0x32868=typeof _0x15dc85['offset']===_0x6879('0x1e')&&typeof _0x15dc85[_0x6879('0x1f')]==='undefined';var _0x38b613=_0x4b2de1[_0x6879('0x20')];var _0x381ffd=_0x32868?0x0:_0x15dc85[_0x6879('0x21')];var _0x38fded=_0x32868?_0x4b2de1[_0x6879('0x20')]:_0x15dc85['offset']+_0x15dc85[_0x6879('0x1f')];var _0x1378f0;if(_0x38fded>=_0x38b613){_0x38fded=_0x38b613;_0x1378f0=0xc8;}else{_0x1378f0=0xce;}_0x3f0461[_0x6879('0x1b')](_0x1378f0);return _0x3f0461[_0x6879('0x22')](_0x6879('0x23'),_0x381ffd+'-'+_0x38fded+'/'+_0x38b613)[_0x6879('0x1d')](_0x4b2de1);}return null;};}function patchUpdates(_0x1aa076){return function(_0x3c01c2){try{jsonpatch[_0x6879('0x24')](_0x3c01c2,_0x1aa076,!![]);}catch(_0x40a463){return BPromise[_0x6879('0x25')](_0x40a463);}return _0x3c01c2[_0x6879('0x26')]();};}function saveUpdates(_0x2d00e0,_0x2fdf56){return function(_0x528b0a){if(_0x528b0a){return _0x528b0a['update'](_0x2d00e0)[_0x6879('0x27')](function(_0x4e6409){return _0x4e6409;});}return null;};}function removeEntity(_0x5b7bc2,_0x164470){return function(_0x3c9908){if(_0x3c9908){return _0x3c9908[_0x6879('0x28')]()[_0x6879('0x27')](function(){_0x5b7bc2[_0x6879('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49b95b,_0x30d846){return function(_0x246edb){if(!_0x246edb){_0x49b95b[_0x6879('0x1a')](0x194);}return _0x246edb;};}function handleError(_0x32fb96,_0x21cd13){_0x21cd13=_0x21cd13||0x1f4;return function(_0x214b24){logger[_0x6879('0x29')](_0x214b24[_0x6879('0x2a')]);if(_0x214b24[_0x6879('0x2b')]){delete _0x214b24[_0x6879('0x2b')];}_0x32fb96[_0x6879('0x1b')](_0x21cd13)[_0x6879('0x2c')](_0x214b24);};}exports[_0x6879('0x2d')]=function(_0x395070,_0x5184ee){var _0x3dee51={},_0x195c11={},_0x5645e4={'count':0x0,'rows':[]};var _0x269883=_[_0x6879('0x2e')](db['SalesforceConfiguration'][_0x6879('0x2f')],function(_0x26a37a){return{'name':_0x26a37a['fieldName'],'type':_0x26a37a['type'][_0x6879('0x30')]};});_0x195c11['model']=_[_0x6879('0x2e')](_0x269883,_0x6879('0x2b'));_0x195c11['query']=_[_0x6879('0x31')](_0x395070[_0x6879('0x32')]);_0x195c11[_0x6879('0x33')]=_['intersection'](_0x195c11[_0x6879('0x34')],_0x195c11[_0x6879('0x32')]);_0x3dee51[_0x6879('0x35')]=_['intersection'](_0x195c11[_0x6879('0x34')],qs[_0x6879('0x36')](_0x395070[_0x6879('0x32')]['fields']));_0x3dee51[_0x6879('0x35')]=_0x3dee51[_0x6879('0x35')][_0x6879('0x37')]?_0x3dee51[_0x6879('0x35')]:_0x195c11['model'];if(!_0x395070[_0x6879('0x32')]['hasOwnProperty'](_0x6879('0x38'))){_0x3dee51[_0x6879('0x1f')]=qs[_0x6879('0x1f')](_0x395070[_0x6879('0x32')][_0x6879('0x1f')]);_0x3dee51[_0x6879('0x21')]=qs[_0x6879('0x21')](_0x395070[_0x6879('0x32')]['offset']);}_0x3dee51[_0x6879('0x39')]=qs[_0x6879('0x3a')](_0x395070[_0x6879('0x32')][_0x6879('0x3a')]);_0x3dee51[_0x6879('0x3b')]=qs[_0x6879('0x33')](_[_0x6879('0x3c')](_0x395070['query'],_0x195c11[_0x6879('0x33')]),_0x269883);if(_0x395070[_0x6879('0x32')][_0x6879('0x3d')]){_0x3dee51[_0x6879('0x3b')]=_[_0x6879('0x3e')](_0x3dee51[_0x6879('0x3b')],{'$or':_[_0x6879('0x2e')](_0x269883,function(_0x5488aa){if(_0x5488aa[_0x6879('0x3f')]!=='VIRTUAL'){var _0x2e2935={};_0x2e2935[_0x5488aa[_0x6879('0x2b')]]={'$like':'%'+_0x395070[_0x6879('0x32')][_0x6879('0x3d')]+'%'};return _0x2e2935;}})});}_0x3dee51=_[_0x6879('0x3e')]({},_0x3dee51,_0x395070[_0x6879('0x40')]);var _0x376269={'where':_0x3dee51['where']};return db['SalesforceConfiguration'][_0x6879('0x20')](_0x376269)['then'](function(_0x3a154a){_0x5645e4['count']=_0x3a154a;if(_0x395070[_0x6879('0x32')][_0x6879('0x41')]){_0x3dee51[_0x6879('0x42')]=[{'all':!![]}];}return db[_0x6879('0x43')][_0x6879('0x44')](_0x3dee51);})[_0x6879('0x27')](function(_0x3b2246){_0x5645e4['rows']=_0x3b2246;return _0x5645e4;})['then'](respondWithFilteredResult(_0x5184ee,_0x3dee51))[_0x6879('0x45')](handleError(_0x5184ee,null));};exports[_0x6879('0x46')]=function(_0x2ae661,_0xfb8239){var _0x58020e={'raw':![],'where':{'id':_0x2ae661[_0x6879('0x47')]['id']}},_0xe845c3={};_0xe845c3[_0x6879('0x34')]=_[_0x6879('0x31')](db['SalesforceConfiguration'][_0x6879('0x2f')]);_0xe845c3[_0x6879('0x32')]=_[_0x6879('0x31')](_0x2ae661[_0x6879('0x32')]);_0xe845c3[_0x6879('0x33')]=_[_0x6879('0x48')](_0xe845c3[_0x6879('0x34')],_0xe845c3[_0x6879('0x32')]);_0x58020e['attributes']=_[_0x6879('0x48')](_0xe845c3[_0x6879('0x34')],qs[_0x6879('0x36')](_0x2ae661[_0x6879('0x32')]['fields']));_0x58020e[_0x6879('0x35')]=_0x58020e[_0x6879('0x35')][_0x6879('0x37')]?_0x58020e[_0x6879('0x35')]:_0xe845c3[_0x6879('0x34')];if(_0x2ae661[_0x6879('0x32')][_0x6879('0x41')]){_0x58020e[_0x6879('0x42')]=[{'all':!![]}];}_0x58020e=_[_0x6879('0x3e')]({},_0x58020e,_0x2ae661[_0x6879('0x40')]);return db[_0x6879('0x43')][_0x6879('0x49')](_0x58020e)[_0x6879('0x27')](handleEntityNotFound(_0xfb8239,null))[_0x6879('0x27')](respondWithResult(_0xfb8239,null))[_0x6879('0x45')](handleError(_0xfb8239,null));};exports[_0x6879('0x4a')]=function(_0x34f4f9,_0x4aa098){return db[_0x6879('0x43')][_0x6879('0x4a')](_0x34f4f9[_0x6879('0x4b')],{})[_0x6879('0x27')](respondWithResult(_0x4aa098,0xc9))['catch'](handleError(_0x4aa098,null));};exports['update']=function(_0x4cf440,_0x1b3200){if(_0x4cf440[_0x6879('0x4b')]['id']){delete _0x4cf440['body']['id'];}return db[_0x6879('0x43')][_0x6879('0x49')]({'where':{'id':_0x4cf440['params']['id']}})[_0x6879('0x27')](handleEntityNotFound(_0x1b3200,null))['then'](saveUpdates(_0x4cf440[_0x6879('0x4b')],null))[_0x6879('0x27')](respondWithResult(_0x1b3200,null))['catch'](handleError(_0x1b3200,null));};exports[_0x6879('0x28')]=function(_0x3fa6de,_0x1393a6){return db[_0x6879('0x43')][_0x6879('0x49')]({'where':{'id':_0x3fa6de['params']['id']}})[_0x6879('0x27')](handleEntityNotFound(_0x1393a6,null))[_0x6879('0x27')](removeEntity(_0x1393a6,null))['catch'](handleError(_0x1393a6,null));};exports['getFields']=function(_0x2b014c,_0x11485a,_0x37874c){var _0x45f0fe={};var _0x447bd8={};var _0x28fbaa;var _0xd036aa;return db[_0x6879('0x43')][_0x6879('0x4c')]({'where':{'id':_0x2b014c[_0x6879('0x47')]['id']}})['then'](handleEntityNotFound(_0x11485a,null))[_0x6879('0x27')](function(_0x3f8b13){if(_0x3f8b13){_0x28fbaa=_0x3f8b13;_0x447bd8[_0x6879('0x34')]=_[_0x6879('0x31')](db[_0x6879('0x4d')][_0x6879('0x2f')]);_0x447bd8[_0x6879('0x32')]=_['keys'](_0x2b014c['query']);_0x447bd8[_0x6879('0x33')]=_[_0x6879('0x48')](_0x447bd8[_0x6879('0x34')],_0x447bd8[_0x6879('0x32')]);_0x45f0fe['attributes']=_[_0x6879('0x48')](_0x447bd8[_0x6879('0x34')],qs['fields'](_0x2b014c[_0x6879('0x32')][_0x6879('0x36')]));_0x45f0fe[_0x6879('0x35')]=_0x45f0fe[_0x6879('0x35')][_0x6879('0x37')]?_0x45f0fe[_0x6879('0x35')]:_0x447bd8[_0x6879('0x34')];_0x45f0fe[_0x6879('0x39')]=qs[_0x6879('0x3a')](_0x2b014c['query'][_0x6879('0x3a')]);_0x45f0fe[_0x6879('0x3b')]=qs[_0x6879('0x33')](_[_0x6879('0x3c')](_0x2b014c[_0x6879('0x32')],_0x447bd8[_0x6879('0x33')]));if(_0x2b014c[_0x6879('0x32')]['filter']){_0x45f0fe[_0x6879('0x3b')]=_[_0x6879('0x3e')](_0x45f0fe['where'],{'$or':_['map'](_0x45f0fe['attributes'],function(_0x4548e9){var _0x53e5fe={};_0x53e5fe[_0x4548e9]={'$like':'%'+_0x2b014c[_0x6879('0x32')]['filter']+'%'};return _0x53e5fe;})});}_0x45f0fe=_[_0x6879('0x3e')]({},_0x45f0fe,_0x2b014c[_0x6879('0x40')]);return _0x28fbaa[_0x6879('0x4e')](_0x45f0fe);}})[_0x6879('0x27')](function(_0x21fb13){if(_0x21fb13){_0xd036aa=_0x21fb13[_0x6879('0x37')];if(!_0x2b014c['query'][_0x6879('0x4f')](_0x6879('0x38'))){_0x45f0fe['limit']=qs['limit'](_0x2b014c[_0x6879('0x32')][_0x6879('0x1f')]);_0x45f0fe[_0x6879('0x21')]=qs[_0x6879('0x21')](_0x2b014c[_0x6879('0x32')][_0x6879('0x21')]);}return _0x28fbaa[_0x6879('0x4e')](_0x45f0fe);}})[_0x6879('0x27')](function(_0x3cb06b){if(_0x3cb06b){return _0x3cb06b?{'count':_0xd036aa,'rows':_0x3cb06b}:null;}})['then'](respondWithResult(_0x11485a,null))['catch'](handleError(_0x11485a,null));};exports[_0x6879('0x50')]=function(_0x29075d,_0x50cd9d,_0x1dca29){var _0x23e7c8={};var _0x230083={};var _0x5a39d3;var _0x1d0ecd;return db[_0x6879('0x43')][_0x6879('0x4c')]({'where':{'id':_0x29075d['params']['id']}})[_0x6879('0x27')](handleEntityNotFound(_0x50cd9d,null))[_0x6879('0x27')](function(_0x458047){if(_0x458047){_0x5a39d3=_0x458047;_0x230083[_0x6879('0x34')]=_[_0x6879('0x31')](db['SalesforceField'][_0x6879('0x2f')]);_0x230083[_0x6879('0x32')]=_[_0x6879('0x31')](_0x29075d[_0x6879('0x32')]);_0x230083[_0x6879('0x33')]=_['intersection'](_0x230083['model'],_0x230083['query']);_0x23e7c8[_0x6879('0x35')]=_[_0x6879('0x48')](_0x230083[_0x6879('0x34')],qs[_0x6879('0x36')](_0x29075d[_0x6879('0x32')][_0x6879('0x36')]));_0x23e7c8['attributes']=_0x23e7c8[_0x6879('0x35')][_0x6879('0x37')]?_0x23e7c8[_0x6879('0x35')]:_0x230083[_0x6879('0x34')];_0x23e7c8['order']=qs[_0x6879('0x3a')](_0x29075d[_0x6879('0x32')]['sort']);_0x23e7c8[_0x6879('0x3b')]=qs[_0x6879('0x33')](_[_0x6879('0x3c')](_0x29075d[_0x6879('0x32')],_0x230083[_0x6879('0x33')]));if(_0x29075d[_0x6879('0x32')][_0x6879('0x3d')]){_0x23e7c8[_0x6879('0x3b')]=_[_0x6879('0x3e')](_0x23e7c8[_0x6879('0x3b')],{'$or':_[_0x6879('0x2e')](_0x23e7c8[_0x6879('0x35')],function(_0x537b07){var _0x79db3b={};_0x79db3b[_0x537b07]={'$like':'%'+_0x29075d[_0x6879('0x32')][_0x6879('0x3d')]+'%'};return _0x79db3b;})});}_0x23e7c8=_[_0x6879('0x3e')]({},_0x23e7c8,_0x29075d[_0x6879('0x40')]);return _0x5a39d3[_0x6879('0x50')](_0x23e7c8);}})[_0x6879('0x27')](function(_0x4c0247){if(_0x4c0247){_0x1d0ecd=_0x4c0247[_0x6879('0x37')];if(!_0x29075d[_0x6879('0x32')][_0x6879('0x4f')]('nolimit')){_0x23e7c8['limit']=qs[_0x6879('0x1f')](_0x29075d[_0x6879('0x32')][_0x6879('0x1f')]);_0x23e7c8[_0x6879('0x21')]=qs[_0x6879('0x21')](_0x29075d[_0x6879('0x32')][_0x6879('0x21')]);}return _0x5a39d3[_0x6879('0x50')](_0x23e7c8);}})[_0x6879('0x27')](function(_0x12588b){if(_0x12588b){return _0x12588b?{'count':_0x1d0ecd,'rows':_0x12588b}:null;}})[_0x6879('0x27')](respondWithResult(_0x50cd9d,null))[_0x6879('0x45')](handleError(_0x50cd9d,null));};exports['getDescriptions']=function(_0x4ec26a,_0x1264e2,_0x75db05){var _0x4a58f6={};var _0x5be118={};var _0x479be1;var _0xe21e73;return db[_0x6879('0x43')]['findOne']({'where':{'id':_0x4ec26a[_0x6879('0x47')]['id']}})['then'](handleEntityNotFound(_0x1264e2,null))[_0x6879('0x27')](function(_0x49b2d6){if(_0x49b2d6){_0x479be1=_0x49b2d6;_0x5be118[_0x6879('0x34')]=_[_0x6879('0x31')](db[_0x6879('0x4d')][_0x6879('0x2f')]);_0x5be118[_0x6879('0x32')]=_['keys'](_0x4ec26a[_0x6879('0x32')]);_0x5be118[_0x6879('0x33')]=_['intersection'](_0x5be118['model'],_0x5be118[_0x6879('0x32')]);_0x4a58f6[_0x6879('0x35')]=_[_0x6879('0x48')](_0x5be118['model'],qs[_0x6879('0x36')](_0x4ec26a[_0x6879('0x32')][_0x6879('0x36')]));_0x4a58f6[_0x6879('0x35')]=_0x4a58f6['attributes'][_0x6879('0x37')]?_0x4a58f6[_0x6879('0x35')]:_0x5be118['model'];_0x4a58f6[_0x6879('0x39')]=qs[_0x6879('0x3a')](_0x4ec26a['query'][_0x6879('0x3a')]);_0x4a58f6[_0x6879('0x3b')]=qs[_0x6879('0x33')](_[_0x6879('0x3c')](_0x4ec26a[_0x6879('0x32')],_0x5be118['filters']));if(_0x4ec26a['query']['filter']){_0x4a58f6['where']=_['merge'](_0x4a58f6[_0x6879('0x3b')],{'$or':_['map'](_0x4a58f6['attributes'],function(_0x592fbf){var _0x2e162b={};_0x2e162b[_0x592fbf]={'$like':'%'+_0x4ec26a[_0x6879('0x32')][_0x6879('0x3d')]+'%'};return _0x2e162b;})});}_0x4a58f6=_[_0x6879('0x3e')]({},_0x4a58f6,_0x4ec26a[_0x6879('0x40')]);return _0x479be1[_0x6879('0x51')](_0x4a58f6);}})[_0x6879('0x27')](function(_0x53af0c){if(_0x53af0c){_0xe21e73=_0x53af0c['length'];if(!_0x4ec26a[_0x6879('0x32')]['hasOwnProperty'](_0x6879('0x38'))){_0x4a58f6['limit']=qs[_0x6879('0x1f')](_0x4ec26a['query'][_0x6879('0x1f')]);_0x4a58f6[_0x6879('0x21')]=qs['offset'](_0x4ec26a['query'][_0x6879('0x21')]);}return _0x479be1[_0x6879('0x51')](_0x4a58f6);}})[_0x6879('0x27')](function(_0xcc1c1d){if(_0xcc1c1d){return _0xcc1c1d?{'count':_0xe21e73,'rows':_0xcc1c1d}:null;}})['then'](respondWithResult(_0x1264e2,null))[_0x6879('0x45')](handleError(_0x1264e2,null));}; \ No newline at end of file +var _0xa9b1=['mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3e943f,_0x42831a){var _0x78c4ae=function(_0x59b44e){while(--_0x59b44e){_0x3e943f['push'](_0x3e943f['shift']());}};_0x78c4ae(++_0x42831a);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={},_0x1d981e={},_0x5362b8={'count':0x0,'rows':[]};var _0x30278b=_[_0x1a9b('0x29')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')],function(_0x1a5085){return{'name':_0x1a5085[_0x1a9b('0x2c')],'type':_0x1a5085[_0x1a9b('0x2d')]['key']};});_0x1d981e[_0x1a9b('0x2e')]=_[_0x1a9b('0x29')](_0x30278b,_0x1a9b('0x26'));_0x1d981e[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2f')]);_0x1d981e[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x1d981e[_0x1a9b('0x2e')],_0x1d981e[_0x1a9b('0x2f')]);_0x3f8e98[_0x1a9b('0x33')]=_['intersection'](_0x1d981e['model'],qs[_0x1a9b('0x34')](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x3f8e98['attributes']=_0x3f8e98[_0x1a9b('0x33')]['length']?_0x3f8e98[_0x1a9b('0x33')]:_0x1d981e['model'];if(!_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0x3f8e98[_0x1a9b('0x1c')]=qs['limit'](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x3f8e98[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x5d70dc['query'][_0x1a9b('0x1a')]);}_0x3f8e98[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x5d70dc['query'][_0x1a9b('0x37')]);_0x3f8e98['where']=qs['filters'](_[_0x1a9b('0x38')](_0x5d70dc[_0x1a9b('0x2f')],_0x1d981e[_0x1a9b('0x31')]),_0x30278b);if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x3f8e98[_0x1a9b('0x3a')]=_[_0x1a9b('0x3b')](_0x3f8e98['where'],{'$or':_[_0x1a9b('0x29')](_0x30278b,function(_0x230fc6){if(_0x230fc6[_0x1a9b('0x2d')]!=='VIRTUAL'){var _0x466827={};_0x466827[_0x230fc6[_0x1a9b('0x26')]]={'$like':'%'+_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]+'%'};return _0x466827;}})});}_0x3f8e98=_['merge']({},_0x3f8e98,_0x5d70dc['options']);var _0x10e80f={'where':_0x3f8e98[_0x1a9b('0x3a')]};return db[_0x1a9b('0x2a')]['count'](_0x10e80f)['then'](function(_0x2b9bcf){_0x5362b8[_0x1a9b('0x1d')]=_0x2b9bcf;if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x3f8e98[_0x1a9b('0x3d')]=[{'all':!![]}];}return db[_0x1a9b('0x2a')][_0x1a9b('0x3e')](_0x3f8e98);})['then'](function(_0x313921){_0x5362b8[_0x1a9b('0x3f')]=_0x313921;return _0x5362b8;})[_0x1a9b('0x23')](respondWithFilteredResult(_0x5d7e8c,_0x3f8e98))[_0x1a9b('0x40')](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x41')]=function(_0x1decb8,_0xb4cbf4){var _0x398db3={'raw':![],'where':{'id':_0x1decb8[_0x1a9b('0x42')]['id']}},_0x35f6d8={};_0x35f6d8[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')]);_0x35f6d8[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x1decb8['query']);_0x35f6d8[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x35f6d8['model'],_0x35f6d8[_0x1a9b('0x2f')]);_0x398db3['attributes']=_['intersection'](_0x35f6d8[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x398db3[_0x1a9b('0x33')]=_0x398db3[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x398db3['attributes']:_0x35f6d8[_0x1a9b('0x2e')];if(_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x398db3[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x398db3=_['merge']({},_0x398db3,_0x1decb8[_0x1a9b('0x44')]);return db[_0x1a9b('0x2a')][_0x1a9b('0x45')](_0x398db3)[_0x1a9b('0x23')](handleEntityNotFound(_0xb4cbf4,null))['then'](respondWithResult(_0xb4cbf4,null))[_0x1a9b('0x40')](handleError(_0xb4cbf4,null));};exports[_0x1a9b('0x46')]=function(_0x41e9fc,_0x1e93df){return db[_0x1a9b('0x2a')]['create'](_0x41e9fc['body'],{})[_0x1a9b('0x23')](respondWithResult(_0x1e93df,0xc9))[_0x1a9b('0x40')](handleError(_0x1e93df,null));};exports['update']=function(_0x52b06e,_0x252140){if(_0x52b06e[_0x1a9b('0x47')]['id']){delete _0x52b06e[_0x1a9b('0x47')]['id'];}return db['SalesforceConfiguration'][_0x1a9b('0x45')]({'where':{'id':_0x52b06e[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x23')](saveUpdates(_0x52b06e[_0x1a9b('0x47')],null))[_0x1a9b('0x23')](respondWithResult(_0x252140,null))[_0x1a9b('0x40')](handleError(_0x252140,null));};exports['destroy']=function(_0x54b9ac,_0x5465d0){return db[_0x1a9b('0x2a')][_0x1a9b('0x45')]({'where':{'id':_0x54b9ac[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5465d0,null))[_0x1a9b('0x23')](removeEntity(_0x5465d0,null))['catch'](handleError(_0x5465d0,null));};exports[_0x1a9b('0x48')]=function(_0x222bba,_0x3b1fdf,_0x5ed656){var _0x396a59={};var _0x2b254a={};var _0xedb034;var _0x38eeac;return db[_0x1a9b('0x2a')][_0x1a9b('0x49')]({'where':{'id':_0x222bba[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x3b1fdf,null))[_0x1a9b('0x23')](function(_0x326f62){if(_0x326f62){_0xedb034=_0x326f62;_0x2b254a[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x4a')][_0x1a9b('0x2b')]);_0x2b254a[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x222bba[_0x1a9b('0x2f')]);_0x2b254a['filters']=_['intersection'](_0x2b254a[_0x1a9b('0x2e')],_0x2b254a[_0x1a9b('0x2f')]);_0x396a59[_0x1a9b('0x33')]=_[_0x1a9b('0x32')](_0x2b254a['model'],qs[_0x1a9b('0x34')](_0x222bba['query'][_0x1a9b('0x34')]));_0x396a59[_0x1a9b('0x33')]=_0x396a59[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x396a59[_0x1a9b('0x33')]:_0x2b254a[_0x1a9b('0x2e')];_0x396a59[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x222bba[_0x1a9b('0x2f')][_0x1a9b('0x37')]);_0x396a59[_0x1a9b('0x3a')]=qs[_0x1a9b('0x31')](_[_0x1a9b('0x38')](_0x222bba[_0x1a9b('0x2f')],_0x2b254a[_0x1a9b('0x31')]));if(_0x222bba[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x396a59[_0x1a9b('0x3a')]=_['merge'](_0x396a59[_0x1a9b('0x3a')],{'$or':_[_0x1a9b('0x29')](_0x396a59[_0x1a9b('0x33')],function(_0x2ac21f){var _0x492f16={};_0x492f16[_0x2ac21f]={'$like':'%'+_0x222bba['query'][_0x1a9b('0x39')]+'%'};return _0x492f16;})});}_0x396a59=_[_0x1a9b('0x3b')]({},_0x396a59,_0x222bba[_0x1a9b('0x44')]);return _0xedb034[_0x1a9b('0x48')](_0x396a59);}})[_0x1a9b('0x23')](function(_0x483425){if(_0x483425){_0x38eeac=_0x483425[_0x1a9b('0x43')];if(!_0x222bba[_0x1a9b('0x2f')][_0x1a9b('0x35')](_0x1a9b('0x4b'))){_0x396a59[_0x1a9b('0x1c')]=qs[_0x1a9b('0x1c')](_0x222bba[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x396a59[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x222bba[_0x1a9b('0x2f')][_0x1a9b('0x1a')]);}return _0xedb034[_0x1a9b('0x48')](_0x396a59);}})['then'](function(_0x43b15a){if(_0x43b15a){return _0x43b15a?{'count':_0x38eeac,'rows':_0x43b15a}:null;}})[_0x1a9b('0x23')](respondWithResult(_0x3b1fdf,null))[_0x1a9b('0x40')](handleError(_0x3b1fdf,null));};exports['getSubjects']=function(_0x30a956,_0x1dcac3,_0x546f17){var _0x43140a={};var _0x230a80={};var _0x121477;var _0x1ff92c;return db[_0x1a9b('0x2a')][_0x1a9b('0x49')]({'where':{'id':_0x30a956[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x1dcac3,null))['then'](function(_0x4d8ebc){if(_0x4d8ebc){_0x121477=_0x4d8ebc;_0x230a80[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x4a')][_0x1a9b('0x2b')]);_0x230a80['query']=_[_0x1a9b('0x30')](_0x30a956[_0x1a9b('0x2f')]);_0x230a80[_0x1a9b('0x31')]=_['intersection'](_0x230a80['model'],_0x230a80[_0x1a9b('0x2f')]);_0x43140a['attributes']=_['intersection'](_0x230a80[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x30a956[_0x1a9b('0x2f')]['fields']));_0x43140a[_0x1a9b('0x33')]=_0x43140a[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x43140a['attributes']:_0x230a80[_0x1a9b('0x2e')];_0x43140a['order']=qs['sort'](_0x30a956[_0x1a9b('0x2f')][_0x1a9b('0x37')]);_0x43140a[_0x1a9b('0x3a')]=qs[_0x1a9b('0x31')](_['pick'](_0x30a956['query'],_0x230a80[_0x1a9b('0x31')]));if(_0x30a956[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x43140a[_0x1a9b('0x3a')]=_['merge'](_0x43140a[_0x1a9b('0x3a')],{'$or':_[_0x1a9b('0x29')](_0x43140a[_0x1a9b('0x33')],function(_0x47be7e){var _0x77bf13={};_0x77bf13[_0x47be7e]={'$like':'%'+_0x30a956[_0x1a9b('0x2f')]['filter']+'%'};return _0x77bf13;})});}_0x43140a=_[_0x1a9b('0x3b')]({},_0x43140a,_0x30a956[_0x1a9b('0x44')]);return _0x121477[_0x1a9b('0x4c')](_0x43140a);}})[_0x1a9b('0x23')](function(_0x515a2b){if(_0x515a2b){_0x1ff92c=_0x515a2b[_0x1a9b('0x43')];if(!_0x30a956['query'][_0x1a9b('0x35')](_0x1a9b('0x4b'))){_0x43140a['limit']=qs[_0x1a9b('0x1c')](_0x30a956[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x43140a['offset']=qs[_0x1a9b('0x1a')](_0x30a956['query']['offset']);}return _0x121477['getSubjects'](_0x43140a);}})[_0x1a9b('0x23')](function(_0x38effc){if(_0x38effc){return _0x38effc?{'count':_0x1ff92c,'rows':_0x38effc}:null;}})[_0x1a9b('0x23')](respondWithResult(_0x1dcac3,null))[_0x1a9b('0x40')](handleError(_0x1dcac3,null));};exports[_0x1a9b('0x4d')]=function(_0x2c1920,_0x43928e,_0x362d29){var _0xc298cf={};var _0x5ef94f={};var _0xd2ad8a;var _0x50e706;return db[_0x1a9b('0x2a')][_0x1a9b('0x49')]({'where':{'id':_0x2c1920[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x43928e,null))[_0x1a9b('0x23')](function(_0x2ac140){if(_0x2ac140){_0xd2ad8a=_0x2ac140;_0x5ef94f[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x4a')][_0x1a9b('0x2b')]);_0x5ef94f[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x2c1920[_0x1a9b('0x2f')]);_0x5ef94f[_0x1a9b('0x31')]=_['intersection'](_0x5ef94f[_0x1a9b('0x2e')],_0x5ef94f['query']);_0xc298cf[_0x1a9b('0x33')]=_[_0x1a9b('0x32')](_0x5ef94f[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x2c1920[_0x1a9b('0x2f')]['fields']));_0xc298cf[_0x1a9b('0x33')]=_0xc298cf['attributes']['length']?_0xc298cf[_0x1a9b('0x33')]:_0x5ef94f[_0x1a9b('0x2e')];_0xc298cf[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x2c1920[_0x1a9b('0x2f')]['sort']);_0xc298cf[_0x1a9b('0x3a')]=qs['filters'](_[_0x1a9b('0x38')](_0x2c1920[_0x1a9b('0x2f')],_0x5ef94f[_0x1a9b('0x31')]));if(_0x2c1920[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0xc298cf['where']=_[_0x1a9b('0x3b')](_0xc298cf[_0x1a9b('0x3a')],{'$or':_['map'](_0xc298cf[_0x1a9b('0x33')],function(_0x192783){var _0x2a249a={};_0x2a249a[_0x192783]={'$like':'%'+_0x2c1920[_0x1a9b('0x2f')]['filter']+'%'};return _0x2a249a;})});}_0xc298cf=_['merge']({},_0xc298cf,_0x2c1920[_0x1a9b('0x44')]);return _0xd2ad8a[_0x1a9b('0x4d')](_0xc298cf);}})['then'](function(_0x400347){if(_0x400347){_0x50e706=_0x400347[_0x1a9b('0x43')];if(!_0x2c1920[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0xc298cf[_0x1a9b('0x1c')]=qs['limit'](_0x2c1920['query'][_0x1a9b('0x1c')]);_0xc298cf[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x2c1920[_0x1a9b('0x2f')][_0x1a9b('0x1a')]);}return _0xd2ad8a['getDescriptions'](_0xc298cf);}})[_0x1a9b('0x23')](function(_0x17f4b7){if(_0x17f4b7){return _0x17f4b7?{'count':_0x50e706,'rows':_0x17f4b7}:null;}})[_0x1a9b('0x23')](respondWithResult(_0x43928e,null))[_0x1a9b('0x40')](handleError(_0x43928e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c5e1eda..891dbdd 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 _0xdc3e=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x439af6,_0x479095){var _0x259601=function(_0x375ea9){while(--_0x375ea9){_0x439af6['push'](_0x439af6['shift']());}};_0x259601(++_0x479095);}(_0xdc3e,0x94));var _0xedc3=function(_0x3f6f37,_0x299837){_0x3f6f37=_0x3f6f37-0x0;var _0x1587ce=_0xdc3e[_0x3f6f37];return _0x1587ce;};'use strict';var _=require(_0xedc3('0x0'));var util=require(_0xedc3('0x1'));var logger=require(_0xedc3('0x2'))(_0xedc3('0x3'));var moment=require(_0xedc3('0x4'));var BPromise=require(_0xedc3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xedc3('0x6'));var config=require(_0xedc3('0x7'));var attributes=require(_0xedc3('0x8'));module[_0xedc3('0x9')]=function(_0x39468f,_0x130807){return _0x39468f[_0xedc3('0xa')](_0xedc3('0xb'),attributes,{'tableName':_0xedc3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfae1=['util','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0xa15826,_0x53efbe){var _0x331c68=function(_0x7ab59){while(--_0x7ab59){_0xa15826['push'](_0xa15826['shift']());}};_0x331c68(++_0x53efbe);}(_0xfae1,0x1cc));var _0x1fae=function(_0x3ce53b,_0x12519d){_0x3ce53b=_0x3ce53b-0x0;var _0x5b01c8=_0xfae1[_0x3ce53b];return _0x5b01c8;};'use strict';var _=require('lodash');var util=require(_0x1fae('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1fae('0x1'));var BPromise=require(_0x1fae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fae('0x3'));var rimraf=require(_0x1fae('0x4'));var config=require(_0x1fae('0x5'));var attributes=require(_0x1fae('0x6'));module['exports']=function(_0x517d46,_0x45704f){return _0x517d46[_0x1fae('0x7')](_0x1fae('0x8'),attributes,{'tableName':_0x1fae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 0697ba8..a0e3c99 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 _0xe609=['rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2223bd,_0x58713e){var _0x32ab5e=function(_0x483126){while(--_0x483126){_0x2223bd['push'](_0x2223bd['shift']());}};_0x32ab5e(++_0x58713e);}(_0xe609,0x143));var _0x9e60=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0xe609[_0x3eceb2];return _0x818bc4;};'use strict';var _=require(_0x9e60('0x0'));var util=require(_0x9e60('0x1'));var moment=require(_0x9e60('0x2'));var BPromise=require(_0x9e60('0x3'));var rs=require(_0x9e60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e60('0x5'))['db'];var utils=require(_0x9e60('0x6'));var logger=require('../../config/logger')(_0x9e60('0x7'));var config=require(_0x9e60('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e60('0x9')][_0x9e60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2dc0,_0x5f50cd,_0x1c7932){return new BPromise(function(_0x185572,_0x106167){return client[_0x9e60('0xb')](_0x4f2dc0,_0x1c7932)[_0x9e60('0xc')](function(_0x522581){logger[_0x9e60('0xd')](_0x9e60('0xe'),_0x5f50cd,'request\x20sent');logger[_0x9e60('0xf')](_0x9e60('0x10'),_0x5f50cd,_0x9e60('0x11'),JSON[_0x9e60('0x12')](_0x522581));if(_0x522581[_0x9e60('0x13')]){if(_0x522581[_0x9e60('0x13')]['code']===0x1f4){logger['error'](_0x9e60('0xe'),_0x5f50cd,_0x522581[_0x9e60('0x13')]['message']);return _0x106167(_0x522581[_0x9e60('0x13')][_0x9e60('0x14')]);}logger[_0x9e60('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5f50cd,_0x522581[_0x9e60('0x13')][_0x9e60('0x14')]);return _0x185572(_0x522581['error'][_0x9e60('0x14')]);}else{logger[_0x9e60('0xd')](_0x9e60('0xe'),_0x5f50cd,_0x9e60('0x11'));_0x185572(_0x522581[_0x9e60('0x15')][_0x9e60('0x14')]);}})['catch'](function(_0x493820){logger['error'](_0x9e60('0xe'),_0x5f50cd,_0x493820);_0x106167(_0x493820);});});} \ No newline at end of file +var _0xaedb=['request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x53dc8a,_0x37176a){var _0x6033f5=function(_0x288f19){while(--_0x288f19){_0x53dc8a['push'](_0x53dc8a['shift']());}};_0x6033f5(++_0x37176a);}(_0xaedb,0x109));var _0xbaed=function(_0x416117,_0x52402e){_0x416117=_0x416117-0x0;var _0x1e500c=_0xaedb[_0x416117];return _0x1e500c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbaed('0x0'));var rs=require(_0xbaed('0x1'));var fs=require('fs');var Redis=require(_0xbaed('0x2'));var db=require(_0xbaed('0x3'))['db'];var utils=require(_0xbaed('0x4'));var logger=require('../../config/logger')(_0xbaed('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbaed('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x129693,_0x56945b,_0x434337){return new BPromise(function(_0x154194,_0x4ccb47){return client[_0xbaed('0x7')](_0x129693,_0x434337)[_0xbaed('0x8')](function(_0x1d61ea){logger[_0xbaed('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x56945b,_0xbaed('0xa'));logger['debug'](_0xbaed('0xb'),_0x56945b,'request\x20sent',JSON[_0xbaed('0xc')](_0x1d61ea));if(_0x1d61ea[_0xbaed('0xd')]){if(_0x1d61ea['error'][_0xbaed('0xe')]===0x1f4){logger[_0xbaed('0xd')](_0xbaed('0xf'),_0x56945b,_0x1d61ea[_0xbaed('0xd')]['message']);return _0x4ccb47(_0x1d61ea[_0xbaed('0xd')][_0xbaed('0x10')]);}logger[_0xbaed('0xd')](_0xbaed('0xf'),_0x56945b,_0x1d61ea[_0xbaed('0xd')][_0xbaed('0x10')]);return _0x154194(_0x1d61ea['error'][_0xbaed('0x10')]);}else{logger[_0xbaed('0x9')](_0xbaed('0xf'),_0x56945b,_0xbaed('0xa'));_0x154194(_0x1d61ea['result'][_0xbaed('0x10')]);}})['catch'](function(_0x53432c){logger[_0xbaed('0xd')](_0xbaed('0xf'),_0x56945b,_0x53432c);_0x4ccb47(_0x53432c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3afc8f1..658cc5c 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 _0x3575=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4ea8c7,_0x25bb57){var _0x4ec9ac=function(_0x1f01b0){while(--_0x1f01b0){_0x4ea8c7['push'](_0x4ea8c7['shift']());}};_0x4ec9ac(++_0x25bb57);}(_0x3575,0x155));var _0x5357=function(_0x173ddb,_0x1037bd){_0x173ddb=_0x173ddb-0x0;var _0x33ad7c=_0x3575[_0x173ddb];return _0x33ad7c;};'use strict';var multer=require(_0x5357('0x0'));var util=require(_0x5357('0x1'));var path=require(_0x5357('0x2'));var timeout=require('connect-timeout');var express=require(_0x5357('0x3'));var router=express['Router']();var fs_extra=require(_0x5357('0x4'));var auth=require(_0x5357('0x5'));var interaction=require(_0x5357('0x6'));var config=require(_0x5357('0x7'));var controller=require(_0x5357('0x8'));router[_0x5357('0x9')]('/',auth[_0x5357('0xa')](),controller[_0x5357('0xb')]);router[_0x5357('0x9')](_0x5357('0xc'),auth[_0x5357('0xa')](),controller[_0x5357('0xd')]);router[_0x5357('0xe')]('/',auth[_0x5357('0xa')](),controller[_0x5357('0xf')]);router[_0x5357('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5357('0x11')]);router[_0x5357('0x12')]('/:id',auth[_0x5357('0xa')](),controller[_0x5357('0x13')]);module[_0x5357('0x14')]=router; \ No newline at end of file +var _0x4643=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x21eb6d,_0x2af66d){var _0x30afd0=function(_0x1b16c5){while(--_0x1b16c5){_0x21eb6d['push'](_0x21eb6d['shift']());}};_0x30afd0(++_0x2af66d);}(_0x4643,0xaf));var _0x3464=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4643[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x3464('0x0'));var util=require(_0x3464('0x1'));var path=require(_0x3464('0x2'));var timeout=require(_0x3464('0x3'));var express=require(_0x3464('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3464('0x5'));var interaction=require(_0x3464('0x6'));var config=require(_0x3464('0x7'));var controller=require(_0x3464('0x8'));router[_0x3464('0x9')]('/',auth[_0x3464('0xa')](),controller[_0x3464('0xb')]);router['get'](_0x3464('0xc'),auth['isAuthenticated'](),controller[_0x3464('0xd')]);router[_0x3464('0xe')]('/',auth[_0x3464('0xa')](),controller['create']);router[_0x3464('0xf')](_0x3464('0xc'),auth[_0x3464('0xa')](),controller['update']);router[_0x3464('0x10')](_0x3464('0xc'),auth[_0x3464('0xa')](),controller[_0x3464('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0b5dde0..47a7f03 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 _0xb7ab=['exports','string','variable','customVariable','picklist','STRING','ENUM','sequelize'];(function(_0x2ddc2d,_0x16be24){var _0x17ffcd=function(_0x3ca892){while(--_0x3ca892){_0x2ddc2d['push'](_0x2ddc2d['shift']());}};_0x17ffcd(++_0x16be24);}(_0xb7ab,0x13f));var _0xbb7a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb7ab[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xbb7a('0x0'));module[_0xbb7a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbb7a('0x2'),_0xbb7a('0x3'),_0xbb7a('0x4'),'keyValue',_0xbb7a('0x5')),'defaultValue':_0xbb7a('0x2')},'content':{'type':Sequelize[_0xbb7a('0x6')]},'key':{'type':Sequelize[_0xbb7a('0x6')]},'keyType':{'type':Sequelize[_0xbb7a('0x7')](_0xbb7a('0x2'),'variable',_0xbb7a('0x4'))},'keyContent':{'type':Sequelize[_0xbb7a('0x6')]},'idField':{'type':Sequelize[_0xbb7a('0x6')]},'variableName':{'type':Sequelize[_0xbb7a('0x6')]}}; \ No newline at end of file +var _0x5e0f=['ENUM','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5e0f,0x1b9));var _0xf5e0=function(_0x609fb4,_0x242e4a){_0x609fb4=_0x609fb4-0x0;var _0x5c4884=_0x5e0f[_0x609fb4];return _0x5c4884;};'use strict';var Sequelize=require(_0xf5e0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf5e0('0x1'),_0xf5e0('0x2'),_0xf5e0('0x3'),_0xf5e0('0x4'),_0xf5e0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf5e0('0x6')]},'key':{'type':Sequelize[_0xf5e0('0x6')]},'keyType':{'type':Sequelize[_0xf5e0('0x7')](_0xf5e0('0x1'),_0xf5e0('0x2'),_0xf5e0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xf5e0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 96bf5e9..fcca1b2 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 _0xa359=['model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','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','Content-Range','save','update','then','destroy','error','stack','name','send','index','SalesforceField','fieldName','type','key','map','query','keys','filters','intersection'];(function(_0x6e937e,_0x4a4057){var _0x414fbe=function(_0x5c60d2){while(--_0x5c60d2){_0x6e937e['push'](_0x6e937e['shift']());}};_0x414fbe(++_0x4a4057);}(_0xa359,0x19e));var _0x9a35=function(_0x2559fb,_0x3b3d7b){_0x2559fb=_0x2559fb-0x0;var _0x421c0b=_0xa359[_0x2559fb];return _0x421c0b;};'use strict';var emlformat=require(_0x9a35('0x0'));var rimraf=require(_0x9a35('0x1'));var zipdir=require(_0x9a35('0x2'));var jsonpatch=require(_0x9a35('0x3'));var rp=require(_0x9a35('0x4'));var moment=require(_0x9a35('0x5'));var BPromise=require(_0x9a35('0x6'));var Mustache=require(_0x9a35('0x7'));var util=require(_0x9a35('0x8'));var path=require(_0x9a35('0x9'));var sox=require(_0x9a35('0xa'));var csv=require(_0x9a35('0xb'));var ejs=require(_0x9a35('0xc'));var fs=require('fs');var fs_extra=require(_0x9a35('0xd'));var _=require('lodash');var squel=require(_0x9a35('0xe'));var crypto=require('crypto');var jsforce=require(_0x9a35('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9a35('0xb'));var querystring=require(_0x9a35('0x10'));var Papa=require(_0x9a35('0x11'));var Redis=require(_0x9a35('0x12'));var authService=require(_0x9a35('0x13'));var qs=require(_0x9a35('0x14'));var as=require(_0x9a35('0x15'));var hardwareService=require(_0x9a35('0x16'));var logger=require(_0x9a35('0x17'))('api');var utils=require(_0x9a35('0x18'));var config=require(_0x9a35('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a35('0x1a'))['db'];function respondWithStatusCode(_0xe84b94,_0x13ac97){_0x13ac97=_0x13ac97||0xcc;return function(_0x430ae1){if(_0x430ae1){return _0xe84b94[_0x9a35('0x1b')](_0x13ac97);}return _0xe84b94[_0x9a35('0x1c')](_0x13ac97)[_0x9a35('0x1d')]();};}function respondWithResult(_0x251df4,_0x2a248a){_0x2a248a=_0x2a248a||0xc8;return function(_0x1fe0a2){if(_0x1fe0a2){return _0x251df4[_0x9a35('0x1c')](_0x2a248a)[_0x9a35('0x1e')](_0x1fe0a2);}};}function respondWithFilteredResult(_0x2abbe7,_0xf9c8a7){return function(_0x102541){if(_0x102541){var _0x2196f7=typeof _0xf9c8a7[_0x9a35('0x1f')]===_0x9a35('0x20')&&typeof _0xf9c8a7[_0x9a35('0x21')]==='undefined';var _0x41d4ed=_0x102541[_0x9a35('0x22')];var _0x2fb93b=_0x2196f7?0x0:_0xf9c8a7[_0x9a35('0x1f')];var _0x311873=_0x2196f7?_0x102541[_0x9a35('0x22')]:_0xf9c8a7[_0x9a35('0x1f')]+_0xf9c8a7['limit'];var _0x475d32;if(_0x311873>=_0x41d4ed){_0x311873=_0x41d4ed;_0x475d32=0xc8;}else{_0x475d32=0xce;}_0x2abbe7[_0x9a35('0x1c')](_0x475d32);return _0x2abbe7['set'](_0x9a35('0x23'),_0x2fb93b+'-'+_0x311873+'/'+_0x41d4ed)[_0x9a35('0x1e')](_0x102541);}return null;};}function patchUpdates(_0x4daded){return function(_0x325eac){try{jsonpatch['apply'](_0x325eac,_0x4daded,!![]);}catch(_0x3b3835){return BPromise['reject'](_0x3b3835);}return _0x325eac[_0x9a35('0x24')]();};}function saveUpdates(_0x1d855e,_0x3efc24){return function(_0x1b3652){if(_0x1b3652){return _0x1b3652[_0x9a35('0x25')](_0x1d855e)[_0x9a35('0x26')](function(_0x5e1499){return _0x5e1499;});}return null;};}function removeEntity(_0xc1d644,_0x586497){return function(_0x165301){if(_0x165301){return _0x165301[_0x9a35('0x27')]()['then'](function(){_0xc1d644[_0x9a35('0x1c')](0xcc)[_0x9a35('0x1d')]();});}};}function handleEntityNotFound(_0x4bfdb6,_0x2b9401){return function(_0x4b638f){if(!_0x4b638f){_0x4bfdb6[_0x9a35('0x1b')](0x194);}return _0x4b638f;};}function handleError(_0x230c7c,_0x1cdb27){_0x1cdb27=_0x1cdb27||0x1f4;return function(_0x59830d){logger[_0x9a35('0x28')](_0x59830d[_0x9a35('0x29')]);if(_0x59830d[_0x9a35('0x2a')]){delete _0x59830d[_0x9a35('0x2a')];}_0x230c7c[_0x9a35('0x1c')](_0x1cdb27)[_0x9a35('0x2b')](_0x59830d);};}exports[_0x9a35('0x2c')]=function(_0x8fd1d1,_0x240863){var _0x2fe8fb={},_0xe34c76={},_0x1fc2e1={'count':0x0,'rows':[]};var _0x17be16=_['map'](db[_0x9a35('0x2d')]['rawAttributes'],function(_0x5e0ad6){return{'name':_0x5e0ad6[_0x9a35('0x2e')],'type':_0x5e0ad6[_0x9a35('0x2f')][_0x9a35('0x30')]};});_0xe34c76['model']=_[_0x9a35('0x31')](_0x17be16,_0x9a35('0x2a'));_0xe34c76[_0x9a35('0x32')]=_[_0x9a35('0x33')](_0x8fd1d1[_0x9a35('0x32')]);_0xe34c76[_0x9a35('0x34')]=_[_0x9a35('0x35')](_0xe34c76[_0x9a35('0x36')],_0xe34c76['query']);_0x2fe8fb['attributes']=_[_0x9a35('0x35')](_0xe34c76[_0x9a35('0x36')],qs[_0x9a35('0x37')](_0x8fd1d1[_0x9a35('0x32')][_0x9a35('0x37')]));_0x2fe8fb[_0x9a35('0x38')]=_0x2fe8fb[_0x9a35('0x38')]['length']?_0x2fe8fb['attributes']:_0xe34c76[_0x9a35('0x36')];if(!_0x8fd1d1[_0x9a35('0x32')][_0x9a35('0x39')]('nolimit')){_0x2fe8fb[_0x9a35('0x21')]=qs[_0x9a35('0x21')](_0x8fd1d1['query']['limit']);_0x2fe8fb['offset']=qs[_0x9a35('0x1f')](_0x8fd1d1['query'][_0x9a35('0x1f')]);}_0x2fe8fb[_0x9a35('0x3a')]=qs[_0x9a35('0x3b')](_0x8fd1d1[_0x9a35('0x32')]['sort']);_0x2fe8fb['where']=qs[_0x9a35('0x34')](_[_0x9a35('0x3c')](_0x8fd1d1['query'],_0xe34c76['filters']),_0x17be16);if(_0x8fd1d1[_0x9a35('0x32')][_0x9a35('0x3d')]){_0x2fe8fb[_0x9a35('0x3e')]=_['merge'](_0x2fe8fb[_0x9a35('0x3e')],{'$or':_[_0x9a35('0x31')](_0x17be16,function(_0x1dd56a){if(_0x1dd56a[_0x9a35('0x2f')]!==_0x9a35('0x3f')){var _0x21b549={};_0x21b549[_0x1dd56a['name']]={'$like':'%'+_0x8fd1d1[_0x9a35('0x32')][_0x9a35('0x3d')]+'%'};return _0x21b549;}})});}_0x2fe8fb=_[_0x9a35('0x40')]({},_0x2fe8fb,_0x8fd1d1[_0x9a35('0x41')]);var _0x20a1da={'where':_0x2fe8fb['where']};return db[_0x9a35('0x2d')]['count'](_0x20a1da)[_0x9a35('0x26')](function(_0x4fd230){_0x1fc2e1[_0x9a35('0x22')]=_0x4fd230;if(_0x8fd1d1[_0x9a35('0x32')]['includeAll']){_0x2fe8fb[_0x9a35('0x42')]=[{'all':!![]}];}return db[_0x9a35('0x2d')][_0x9a35('0x43')](_0x2fe8fb);})[_0x9a35('0x26')](function(_0x5068c9){_0x1fc2e1[_0x9a35('0x44')]=_0x5068c9;return _0x1fc2e1;})[_0x9a35('0x26')](respondWithFilteredResult(_0x240863,_0x2fe8fb))[_0x9a35('0x45')](handleError(_0x240863,null));};exports[_0x9a35('0x46')]=function(_0x49bd41,_0x346554){var _0x1ee279={'raw':!![],'where':{'id':_0x49bd41[_0x9a35('0x47')]['id']}},_0x42dc3f={};_0x42dc3f['model']=_[_0x9a35('0x33')](db[_0x9a35('0x2d')][_0x9a35('0x48')]);_0x42dc3f['query']=_['keys'](_0x49bd41[_0x9a35('0x32')]);_0x42dc3f[_0x9a35('0x34')]=_[_0x9a35('0x35')](_0x42dc3f[_0x9a35('0x36')],_0x42dc3f['query']);_0x1ee279[_0x9a35('0x38')]=_[_0x9a35('0x35')](_0x42dc3f[_0x9a35('0x36')],qs[_0x9a35('0x37')](_0x49bd41['query']['fields']));_0x1ee279['attributes']=_0x1ee279['attributes'][_0x9a35('0x49')]?_0x1ee279[_0x9a35('0x38')]:_0x42dc3f['model'];if(_0x49bd41['query'][_0x9a35('0x4a')]){_0x1ee279['include']=[{'all':!![]}];}_0x1ee279=_[_0x9a35('0x40')]({},_0x1ee279,_0x49bd41[_0x9a35('0x41')]);return db[_0x9a35('0x2d')][_0x9a35('0x4b')](_0x1ee279)[_0x9a35('0x26')](handleEntityNotFound(_0x346554,null))['then'](respondWithResult(_0x346554,null))[_0x9a35('0x45')](handleError(_0x346554,null));};exports[_0x9a35('0x4c')]=function(_0x2c5e04,_0x3fbc03){return db[_0x9a35('0x2d')]['create'](_0x2c5e04[_0x9a35('0x4d')],{})[_0x9a35('0x26')](respondWithResult(_0x3fbc03,0xc9))['catch'](handleError(_0x3fbc03,null));};exports[_0x9a35('0x25')]=function(_0x58f329,_0x38eed8){if(_0x58f329[_0x9a35('0x4d')]['id']){delete _0x58f329['body']['id'];}return db[_0x9a35('0x2d')][_0x9a35('0x4b')]({'where':{'id':_0x58f329['params']['id']}})[_0x9a35('0x26')](handleEntityNotFound(_0x38eed8,null))['then'](saveUpdates(_0x58f329[_0x9a35('0x4d')],null))['then'](respondWithResult(_0x38eed8,null))[_0x9a35('0x45')](handleError(_0x38eed8,null));};exports['destroy']=function(_0x35fcbc,_0x2c2b60){return db['SalesforceField'][_0x9a35('0x4b')]({'where':{'id':_0x35fcbc[_0x9a35('0x47')]['id']}})[_0x9a35('0x26')](handleEntityNotFound(_0x2c2b60,null))[_0x9a35('0x26')](removeEntity(_0x2c2b60,null))[_0x9a35('0x45')](handleError(_0x2c2b60,null));}; \ No newline at end of file +var _0xb28f=['end','json','offset','undefined','count','status','set','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb28f,0x7a));var _0xfb28=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xb28f[_0xd1c39b];return _0x58f5bc;};'use strict';var emlformat=require(_0xfb28('0x0'));var rimraf=require(_0xfb28('0x1'));var zipdir=require(_0xfb28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb28('0x3'));var moment=require(_0xfb28('0x4'));var BPromise=require(_0xfb28('0x5'));var Mustache=require('mustache');var util=require(_0xfb28('0x6'));var path=require('path');var sox=require(_0xfb28('0x7'));var csv=require(_0xfb28('0x8'));var ejs=require(_0xfb28('0x9'));var fs=require('fs');var fs_extra=require(_0xfb28('0xa'));var _=require(_0xfb28('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfb28('0xc'));var deskjs=require(_0xfb28('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfb28('0xe'));var Papa=require(_0xfb28('0xf'));var Redis=require('ioredis');var authService=require(_0xfb28('0x10'));var qs=require(_0xfb28('0x11'));var as=require(_0xfb28('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfb28('0x13'));var utils=require(_0xfb28('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfb28('0x15'));var db=require(_0xfb28('0x16'))['db'];function respondWithStatusCode(_0x13b060,_0x53b0e7){_0x53b0e7=_0x53b0e7||0xcc;return function(_0x178820){if(_0x178820){return _0x13b060[_0xfb28('0x17')](_0x53b0e7);}return _0x13b060['status'](_0x53b0e7)[_0xfb28('0x18')]();};}function respondWithResult(_0xe2c0dd,_0x36ecc7){_0x36ecc7=_0x36ecc7||0xc8;return function(_0x21ae3a){if(_0x21ae3a){return _0xe2c0dd['status'](_0x36ecc7)[_0xfb28('0x19')](_0x21ae3a);}};}function respondWithFilteredResult(_0x4960ac,_0x38a348){return function(_0x5c1c34){if(_0x5c1c34){var _0x57c741=typeof _0x38a348[_0xfb28('0x1a')]===_0xfb28('0x1b')&&typeof _0x38a348['limit']===_0xfb28('0x1b');var _0x4ffc65=_0x5c1c34['count'];var _0x3c4593=_0x57c741?0x0:_0x38a348[_0xfb28('0x1a')];var _0x281b0b=_0x57c741?_0x5c1c34[_0xfb28('0x1c')]:_0x38a348[_0xfb28('0x1a')]+_0x38a348['limit'];var _0x1daec8;if(_0x281b0b>=_0x4ffc65){_0x281b0b=_0x4ffc65;_0x1daec8=0xc8;}else{_0x1daec8=0xce;}_0x4960ac[_0xfb28('0x1d')](_0x1daec8);return _0x4960ac[_0xfb28('0x1e')]('Content-Range',_0x3c4593+'-'+_0x281b0b+'/'+_0x4ffc65)[_0xfb28('0x19')](_0x5c1c34);}return null;};}function patchUpdates(_0x3447f7){return function(_0x430fac){try{jsonpatch['apply'](_0x430fac,_0x3447f7,!![]);}catch(_0x198d53){return BPromise[_0xfb28('0x1f')](_0x198d53);}return _0x430fac['save']();};}function saveUpdates(_0x427d3b,_0x5ab0ed){return function(_0x4493e9){if(_0x4493e9){return _0x4493e9[_0xfb28('0x20')](_0x427d3b)[_0xfb28('0x21')](function(_0x3129f1){return _0x3129f1;});}return null;};}function removeEntity(_0x4305d1,_0xcff4a4){return function(_0x2d141c){if(_0x2d141c){return _0x2d141c[_0xfb28('0x22')]()[_0xfb28('0x21')](function(){_0x4305d1['status'](0xcc)[_0xfb28('0x18')]();});}};}function handleEntityNotFound(_0x1e3103,_0x52c67f){return function(_0x13108b){if(!_0x13108b){_0x1e3103[_0xfb28('0x17')](0x194);}return _0x13108b;};}function handleError(_0x351cbf,_0xed068f){_0xed068f=_0xed068f||0x1f4;return function(_0x341f16){logger[_0xfb28('0x23')](_0x341f16[_0xfb28('0x24')]);if(_0x341f16[_0xfb28('0x25')]){delete _0x341f16['name'];}_0x351cbf['status'](_0xed068f)[_0xfb28('0x26')](_0x341f16);};}exports[_0xfb28('0x27')]=function(_0x408cbd,_0x4e95ac){var _0x191570={},_0x336dc4={},_0x444fa1={'count':0x0,'rows':[]};var _0x4fd098=_[_0xfb28('0x28')](db[_0xfb28('0x29')][_0xfb28('0x2a')],function(_0xaf871e){return{'name':_0xaf871e[_0xfb28('0x2b')],'type':_0xaf871e['type'][_0xfb28('0x2c')]};});_0x336dc4['model']=_[_0xfb28('0x28')](_0x4fd098,_0xfb28('0x25'));_0x336dc4[_0xfb28('0x2d')]=_['keys'](_0x408cbd['query']);_0x336dc4['filters']=_[_0xfb28('0x2e')](_0x336dc4[_0xfb28('0x2f')],_0x336dc4[_0xfb28('0x2d')]);_0x191570[_0xfb28('0x30')]=_['intersection'](_0x336dc4['model'],qs[_0xfb28('0x31')](_0x408cbd['query']['fields']));_0x191570[_0xfb28('0x30')]=_0x191570[_0xfb28('0x30')]['length']?_0x191570[_0xfb28('0x30')]:_0x336dc4[_0xfb28('0x2f')];if(!_0x408cbd['query'][_0xfb28('0x32')](_0xfb28('0x33'))){_0x191570[_0xfb28('0x34')]=qs['limit'](_0x408cbd[_0xfb28('0x2d')][_0xfb28('0x34')]);_0x191570['offset']=qs['offset'](_0x408cbd['query'][_0xfb28('0x1a')]);}_0x191570[_0xfb28('0x35')]=qs[_0xfb28('0x36')](_0x408cbd[_0xfb28('0x2d')][_0xfb28('0x36')]);_0x191570[_0xfb28('0x37')]=qs[_0xfb28('0x38')](_['pick'](_0x408cbd[_0xfb28('0x2d')],_0x336dc4['filters']),_0x4fd098);if(_0x408cbd[_0xfb28('0x2d')][_0xfb28('0x39')]){_0x191570[_0xfb28('0x37')]=_[_0xfb28('0x3a')](_0x191570[_0xfb28('0x37')],{'$or':_[_0xfb28('0x28')](_0x4fd098,function(_0xf40882){if(_0xf40882[_0xfb28('0x3b')]!==_0xfb28('0x3c')){var _0x579eeb={};_0x579eeb[_0xf40882[_0xfb28('0x25')]]={'$like':'%'+_0x408cbd[_0xfb28('0x2d')][_0xfb28('0x39')]+'%'};return _0x579eeb;}})});}_0x191570=_[_0xfb28('0x3a')]({},_0x191570,_0x408cbd[_0xfb28('0x3d')]);var _0x175b0c={'where':_0x191570[_0xfb28('0x37')]};return db['SalesforceField']['count'](_0x175b0c)[_0xfb28('0x21')](function(_0x461159){_0x444fa1['count']=_0x461159;if(_0x408cbd[_0xfb28('0x2d')]['includeAll']){_0x191570[_0xfb28('0x3e')]=[{'all':!![]}];}return db[_0xfb28('0x29')][_0xfb28('0x3f')](_0x191570);})[_0xfb28('0x21')](function(_0xed8389){_0x444fa1[_0xfb28('0x40')]=_0xed8389;return _0x444fa1;})[_0xfb28('0x21')](respondWithFilteredResult(_0x4e95ac,_0x191570))[_0xfb28('0x41')](handleError(_0x4e95ac,null));};exports[_0xfb28('0x42')]=function(_0x4a9baf,_0x93dbdb){var _0x386d7e={'raw':!![],'where':{'id':_0x4a9baf[_0xfb28('0x43')]['id']}},_0x5bc315={};_0x5bc315[_0xfb28('0x2f')]=_[_0xfb28('0x44')](db[_0xfb28('0x29')][_0xfb28('0x2a')]);_0x5bc315['query']=_[_0xfb28('0x44')](_0x4a9baf[_0xfb28('0x2d')]);_0x5bc315[_0xfb28('0x38')]=_[_0xfb28('0x2e')](_0x5bc315[_0xfb28('0x2f')],_0x5bc315[_0xfb28('0x2d')]);_0x386d7e[_0xfb28('0x30')]=_[_0xfb28('0x2e')](_0x5bc315[_0xfb28('0x2f')],qs[_0xfb28('0x31')](_0x4a9baf[_0xfb28('0x2d')][_0xfb28('0x31')]));_0x386d7e[_0xfb28('0x30')]=_0x386d7e[_0xfb28('0x30')][_0xfb28('0x45')]?_0x386d7e[_0xfb28('0x30')]:_0x5bc315[_0xfb28('0x2f')];if(_0x4a9baf[_0xfb28('0x2d')]['includeAll']){_0x386d7e['include']=[{'all':!![]}];}_0x386d7e=_[_0xfb28('0x3a')]({},_0x386d7e,_0x4a9baf[_0xfb28('0x3d')]);return db[_0xfb28('0x29')][_0xfb28('0x46')](_0x386d7e)[_0xfb28('0x21')](handleEntityNotFound(_0x93dbdb,null))[_0xfb28('0x21')](respondWithResult(_0x93dbdb,null))['catch'](handleError(_0x93dbdb,null));};exports['create']=function(_0x115cbc,_0x312374){return db[_0xfb28('0x29')][_0xfb28('0x47')](_0x115cbc['body'],{})['then'](respondWithResult(_0x312374,0xc9))[_0xfb28('0x41')](handleError(_0x312374,null));};exports['update']=function(_0x1ab6a9,_0x571b8a){if(_0x1ab6a9['body']['id']){delete _0x1ab6a9[_0xfb28('0x48')]['id'];}return db[_0xfb28('0x29')]['find']({'where':{'id':_0x1ab6a9[_0xfb28('0x43')]['id']}})[_0xfb28('0x21')](handleEntityNotFound(_0x571b8a,null))['then'](saveUpdates(_0x1ab6a9[_0xfb28('0x48')],null))[_0xfb28('0x21')](respondWithResult(_0x571b8a,null))[_0xfb28('0x41')](handleError(_0x571b8a,null));};exports[_0xfb28('0x22')]=function(_0x329d17,_0x47ba38){return db[_0xfb28('0x29')][_0xfb28('0x46')]({'where':{'id':_0x329d17[_0xfb28('0x43')]['id']}})['then'](handleEntityNotFound(_0x47ba38,null))[_0xfb28('0x21')](removeEntity(_0x47ba38,null))[_0xfb28('0x41')](handleError(_0x47ba38,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2c8ff4f..a381add 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 _0xc9fd=['idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x597a47,_0x5d6661){var _0x57227e=function(_0x329089){while(--_0x329089){_0x597a47['push'](_0x597a47['shift']());}};_0x57227e(++_0x5d6661);}(_0xc9fd,0x152));var _0xdc9f=function(_0x5d750d,_0x31c451){_0x5d750d=_0x5d750d-0x0;var _0x289b17=_0xc9fd[_0x5d750d];return _0x289b17;};'use strict';var _=require(_0xdc9f('0x0'));var util=require('util');var logger=require(_0xdc9f('0x1'))(_0xdc9f('0x2'));var moment=require(_0xdc9f('0x3'));var BPromise=require(_0xdc9f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc9f('0x5'));var rimraf=require(_0xdc9f('0x6'));var config=require(_0xdc9f('0x7'));var attributes=require(_0xdc9f('0x8'));module[_0xdc9f('0x9')]=function(_0x39b124,_0x57309a){return _0x39b124[_0xdc9f('0xa')](_0xdc9f('0xb'),attributes,{'tableName':_0xdc9f('0xc'),'paranoid':![],'indexes':[{'name':_0xdc9f('0xd'),'fields':[_0xdc9f('0xe'),_0xdc9f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c1b=['int_salesforce_fields','idField','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x4fb927,_0x42f767){var _0x2178ba=function(_0x44f4bd){while(--_0x44f4bd){_0x4fb927['push'](_0x4fb927['shift']());}};_0x2178ba(++_0x42f767);}(_0x4c1b,0x11a));var _0xb4c1=function(_0xe93b64,_0x1b18f4){_0xe93b64=_0xe93b64-0x0;var _0x4c3d06=_0x4c1b[_0xe93b64];return _0x4c3d06;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4c1('0x0'))(_0xb4c1('0x1'));var moment=require(_0xb4c1('0x2'));var BPromise=require(_0xb4c1('0x3'));var rp=require(_0xb4c1('0x4'));var fs=require('fs');var path=require(_0xb4c1('0x5'));var rimraf=require(_0xb4c1('0x6'));var config=require(_0xb4c1('0x7'));var attributes=require(_0xb4c1('0x8'));module[_0xb4c1('0x9')]=function(_0x4c153e,_0x159a5e){return _0x4c153e[_0xb4c1('0xa')](_0xb4c1('0xb'),attributes,{'tableName':_0xb4c1('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xb4c1('0xd'),'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 dee8895..8bc8280 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 _0x79a7=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','SalesforceField,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x79a7,0x16e));var _0x779a=function(_0xdc0388,_0x51e2f5){_0xdc0388=_0xdc0388-0x0;var _0x1e976b=_0x79a7[_0xdc0388];return _0x1e976b;};'use strict';var _=require(_0x779a('0x0'));var util=require(_0x779a('0x1'));var moment=require('moment');var BPromise=require(_0x779a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x779a('0x3'));var db=require(_0x779a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x779a('0x5'))(_0x779a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x779a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a970f,_0x151165,_0x499f47){return new BPromise(function(_0x2cce53,_0x5863a5){return client['request'](_0x3a970f,_0x499f47)[_0x779a('0x8')](function(_0x2ea69c){logger[_0x779a('0x9')](_0x779a('0xa'),_0x151165,'request\x20sent');logger[_0x779a('0xb')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x151165,_0x779a('0xc'),JSON[_0x779a('0xd')](_0x2ea69c));if(_0x2ea69c[_0x779a('0xe')]){if(_0x2ea69c[_0x779a('0xe')][_0x779a('0xf')]===0x1f4){logger[_0x779a('0xe')](_0x779a('0xa'),_0x151165,_0x2ea69c[_0x779a('0xe')][_0x779a('0x10')]);return _0x5863a5(_0x2ea69c[_0x779a('0xe')][_0x779a('0x10')]);}logger['error'](_0x779a('0xa'),_0x151165,_0x2ea69c['error']['message']);return _0x2cce53(_0x2ea69c[_0x779a('0xe')][_0x779a('0x10')]);}else{logger[_0x779a('0x9')](_0x779a('0xa'),_0x151165,_0x779a('0xc'));_0x2cce53(_0x2ea69c[_0x779a('0x11')][_0x779a('0x10')]);}})[_0x779a('0x12')](function(_0x4badc6){logger['error'](_0x779a('0xa'),_0x151165,_0x4badc6);_0x5863a5(_0x4badc6);});});} \ No newline at end of file +var _0x80e7=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6a7421,_0x20b4f5){var _0x33f5d1=function(_0x2714a4){while(--_0x2714a4){_0x6a7421['push'](_0x6a7421['shift']());}};_0x33f5d1(++_0x20b4f5);}(_0x80e7,0xd7));var _0x780e=function(_0x492e60,_0x49ceca){_0x492e60=_0x492e60-0x0;var _0x59c3dc=_0x80e7[_0x492e60];return _0x59c3dc;};'use strict';var _=require(_0x780e('0x0'));var util=require(_0x780e('0x1'));var moment=require(_0x780e('0x2'));var BPromise=require(_0x780e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x780e('0x4'));var db=require(_0x780e('0x5'))['db'];var utils=require(_0x780e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x780e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x780e('0x8')][_0x780e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2376c6,_0x5a483e,_0x3225d0){return new BPromise(function(_0x123bd6,_0x17043f){return client[_0x780e('0xa')](_0x2376c6,_0x3225d0)['then'](function(_0x3695b6){logger[_0x780e('0xb')](_0x780e('0xc'),_0x5a483e,_0x780e('0xd'));logger['debug'](_0x780e('0xe'),_0x5a483e,_0x780e('0xd'),JSON[_0x780e('0xf')](_0x3695b6));if(_0x3695b6[_0x780e('0x10')]){if(_0x3695b6['error'][_0x780e('0x11')]===0x1f4){logger['error'](_0x780e('0xc'),_0x5a483e,_0x3695b6['error']['message']);return _0x17043f(_0x3695b6[_0x780e('0x10')][_0x780e('0x12')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x5a483e,_0x3695b6[_0x780e('0x10')]['message']);return _0x123bd6(_0x3695b6[_0x780e('0x10')][_0x780e('0x12')]);}else{logger[_0x780e('0xb')](_0x780e('0xc'),_0x5a483e,_0x780e('0xd'));_0x123bd6(_0x3695b6[_0x780e('0x13')]['message']);}})[_0x780e('0x14')](function(_0x426618){logger['error'](_0x780e('0xc'),_0x5a483e,_0x426618);_0x17043f(_0x426618);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 53eeef3..b9d2922 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 _0xd562=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create'];(function(_0x5742b9,_0x2684ee){var _0x237aa8=function(_0x258dad){while(--_0x258dad){_0x5742b9['push'](_0x5742b9['shift']());}};_0x237aa8(++_0x2684ee);}(_0xd562,0x165));var _0x2d56=function(_0x529965,_0x3a1ed2){_0x529965=_0x529965-0x0;var _0x232533=_0xd562[_0x529965];return _0x232533;};'use strict';var multer=require(_0x2d56('0x0'));var util=require(_0x2d56('0x1'));var path=require('path');var timeout=require(_0x2d56('0x2'));var express=require(_0x2d56('0x3'));var router=express[_0x2d56('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2d56('0x5'));var config=require(_0x2d56('0x6'));var controller=require(_0x2d56('0x7'));router[_0x2d56('0x8')]('/',auth[_0x2d56('0x9')](),controller[_0x2d56('0xa')]);router[_0x2d56('0x8')](_0x2d56('0xb'),auth[_0x2d56('0x9')](),controller[_0x2d56('0xc')]);router[_0x2d56('0x8')](_0x2d56('0xd'),auth[_0x2d56('0x9')](),controller['getConfigurations']);router[_0x2d56('0x8')](_0x2d56('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x2d56('0xf')]('/',auth[_0x2d56('0x9')](),controller[_0x2d56('0x10')]);router['post'](_0x2d56('0xd'),auth[_0x2d56('0x9')](),controller['addConfiguration']);router[_0x2d56('0x11')]('/:id',auth[_0x2d56('0x9')](),controller[_0x2d56('0x12')]);router[_0x2d56('0x13')]('/:id',auth[_0x2d56('0x9')](),controller[_0x2d56('0x14')]);module[_0x2d56('0x15')]=router; \ No newline at end of file +var _0x49d7=['destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','/:id','update','delete'];(function(_0x49e5d,_0x43e77e){var _0xeccb94=function(_0x3de7fb){while(--_0x3de7fb){_0x49e5d['push'](_0x49e5d['shift']());}};_0xeccb94(++_0x43e77e);}(_0x49d7,0xfe));var _0x749d=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x49d7[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require(_0x749d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x749d('0x1'));var router=express['Router']();var fs_extra=require(_0x749d('0x2'));var auth=require(_0x749d('0x3'));var interaction=require(_0x749d('0x4'));var config=require(_0x749d('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x749d('0x6')]('/',auth[_0x749d('0x7')](),controller[_0x749d('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x749d('0x9')]);router[_0x749d('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x749d('0xa')]);router[_0x749d('0x6')](_0x749d('0xb'),auth[_0x749d('0x7')](),controller['getFields']);router[_0x749d('0xc')]('/',auth[_0x749d('0x7')](),controller['create']);router[_0x749d('0xc')](_0x749d('0xd'),auth[_0x749d('0x7')](),controller[_0x749d('0xe')]);router[_0x749d('0xf')](_0x749d('0x10'),auth[_0x749d('0x7')](),controller[_0x749d('0x11')]);router[_0x749d('0x12')](_0x749d('0x10'),auth[_0x749d('0x7')](),controller[_0x749d('0x13')]);module[_0x749d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 5140322..638c912 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 _0xb36c=['STRING','username','remoteUri','sequelize','exports'];(function(_0x18cabb,_0x2532aa){var _0x235bc5=function(_0x3c0495){while(--_0x3c0495){_0x18cabb['push'](_0x18cabb['shift']());}};_0x235bc5(++_0x2532aa);}(_0xb36c,0x6c));var _0xcb36=function(_0x5ec15f,_0x5124ac){_0x5ec15f=_0x5ec15f-0x0;var _0x240350=_0xb36c[_0x5ec15f];return _0x240350;};'use strict';var Sequelize=require(_0xcb36('0x0'));module[_0xcb36('0x1')]={'name':{'type':Sequelize[_0xcb36('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xcb36('0x3')},'password':{'type':Sequelize[_0xcb36('0x2')]},'email':{'type':Sequelize[_0xcb36('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcb36('0x4')},'serverUrl':{'type':Sequelize[_0xcb36('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcb60=['STRING','username','remoteUri','sequelize','exports'];(function(_0x176259,_0x30e46f){var _0x48dc40=function(_0x3aa524){while(--_0x3aa524){_0x176259['push'](_0x176259['shift']());}};_0x48dc40(++_0x30e46f);}(_0xcb60,0x10c));var _0x0cb6=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xcb60[_0x4b6830];return _0x239e4a;};'use strict';var Sequelize=require(_0x0cb6('0x0'));module[_0x0cb6('0x1')]={'name':{'type':Sequelize[_0x0cb6('0x2')]},'description':{'type':Sequelize[_0x0cb6('0x2')]},'username':{'type':Sequelize[_0x0cb6('0x2')],'unique':_0x0cb6('0x3')},'password':{'type':Sequelize[_0x0cb6('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0cb6('0x2')],'unique':_0x0cb6('0x4')},'serverUrl':{'type':Sequelize[_0x0cb6('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 ad34beb..0854305 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 _0xf881=['name','send','index','ServicenowAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','findAll','catch','show','includeAll','include','find','create','body','params','getConfigurations','findOne','keys','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowConfiguration','made_sla','knowledge','subcategory','close_code','notify','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','priority','sys_domain_path','rfc','time_worked','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','assigned_to','approval','due_date','reopen_count','sys_tags','escalation','location','username','email','remoteUri','serverUrl','substring','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','error','stack'];(function(_0x3e2e63,_0x21dd75){var _0x499702=function(_0x4a485d){while(--_0x4a485d){_0x3e2e63['push'](_0x3e2e63['shift']());}};_0x499702(++_0x21dd75);}(_0xf881,0x87));var _0x1f88=function(_0x195fa5,_0x2fefc9){_0x195fa5=_0x195fa5-0x0;var _0x3f18ad=_0xf881[_0x195fa5];return _0x3f18ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1f88('0x0'));var rp=require(_0x1f88('0x1'));var moment=require(_0x1f88('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f88('0x3'));var path=require(_0x1f88('0x4'));var sox=require(_0x1f88('0x5'));var csv=require(_0x1f88('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f88('0x7'));var _=require('lodash');var squel=require(_0x1f88('0x8'));var crypto=require(_0x1f88('0x9'));var jsforce=require(_0x1f88('0xa'));var deskjs=require(_0x1f88('0xb'));var toCsv=require(_0x1f88('0x6'));var querystring=require(_0x1f88('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f88('0xd'));var qs=require(_0x1f88('0xe'));var as=require(_0x1f88('0xf'));var hardwareService=require(_0x1f88('0x10'));var logger=require(_0x1f88('0x11'))(_0x1f88('0x12'));var utils=require('../../config/utils');var config=require(_0x1f88('0x13'));var licenseUtil=require(_0x1f88('0x14'));var db=require(_0x1f88('0x15'))['db'];var integrations=require(_0x1f88('0x16'));function respondWithStatusCode(_0x53ab69,_0x35921d){_0x35921d=_0x35921d||0xcc;return function(_0x1b3c4c){if(_0x1b3c4c){return _0x53ab69[_0x1f88('0x17')](_0x35921d);}return _0x53ab69['status'](_0x35921d)[_0x1f88('0x18')]();};}function respondWithResult(_0x334006,_0x310e0b){_0x310e0b=_0x310e0b||0xc8;return function(_0x129793){if(_0x129793){return _0x334006[_0x1f88('0x19')](_0x310e0b)[_0x1f88('0x1a')](_0x129793);}};}function respondWithFilteredResult(_0x2ae0e1,_0x2be7bd){return function(_0x131c5f){if(_0x131c5f){var _0x57c879=typeof _0x2be7bd['offset']===_0x1f88('0x1b')&&typeof _0x2be7bd[_0x1f88('0x1c')]==='undefined';var _0x38369c=_0x131c5f['count'];var _0x41d1fb=_0x57c879?0x0:_0x2be7bd[_0x1f88('0x1d')];var _0x51327e=_0x57c879?_0x131c5f[_0x1f88('0x1e')]:_0x2be7bd[_0x1f88('0x1d')]+_0x2be7bd[_0x1f88('0x1c')];var _0x12ceda;if(_0x51327e>=_0x38369c){_0x51327e=_0x38369c;_0x12ceda=0xc8;}else{_0x12ceda=0xce;}_0x2ae0e1['status'](_0x12ceda);return _0x2ae0e1[_0x1f88('0x1f')](_0x1f88('0x20'),_0x41d1fb+'-'+_0x51327e+'/'+_0x38369c)['json'](_0x131c5f);}return null;};}function patchUpdates(_0x4dcf47){return function(_0xc812f7){try{jsonpatch[_0x1f88('0x21')](_0xc812f7,_0x4dcf47,!![]);}catch(_0x116cf3){return BPromise['reject'](_0x116cf3);}return _0xc812f7[_0x1f88('0x22')]();};}function saveUpdates(_0x13347c,_0x2503e6){return function(_0x4bd1ea){if(_0x4bd1ea){return _0x4bd1ea[_0x1f88('0x23')](_0x13347c)[_0x1f88('0x24')](function(_0x49b59f){return _0x49b59f;});}return null;};}function removeEntity(_0xcd18ff,_0x4427fb){return function(_0x579681){if(_0x579681){return _0x579681['destroy']()[_0x1f88('0x24')](function(){_0xcd18ff[_0x1f88('0x19')](0xcc)[_0x1f88('0x18')]();});}};}function handleEntityNotFound(_0x2c2513,_0x2cc09a){return function(_0x1fd041){if(!_0x1fd041){_0x2c2513[_0x1f88('0x17')](0x194);}return _0x1fd041;};}function handleError(_0x57b97d,_0x34d65e){_0x34d65e=_0x34d65e||0x1f4;return function(_0x1064e7){logger[_0x1f88('0x25')](_0x1064e7[_0x1f88('0x26')]);if(_0x1064e7[_0x1f88('0x27')]){delete _0x1064e7[_0x1f88('0x27')];}_0x57b97d[_0x1f88('0x19')](_0x34d65e)[_0x1f88('0x28')](_0x1064e7);};}exports[_0x1f88('0x29')]=function(_0x5a6b70,_0x213c24){var _0x205e28={},_0xaba7a8={},_0x370aa8={'count':0x0,'rows':[]};var _0x2cb080=_['map'](db[_0x1f88('0x2a')][_0x1f88('0x2b')],function(_0x51115d){return{'name':_0x51115d[_0x1f88('0x2c')],'type':_0x51115d[_0x1f88('0x2d')]['key']};});_0xaba7a8[_0x1f88('0x2e')]=_[_0x1f88('0x2f')](_0x2cb080,'name');_0xaba7a8['query']=_['keys'](_0x5a6b70[_0x1f88('0x30')]);_0xaba7a8[_0x1f88('0x31')]=_[_0x1f88('0x32')](_0xaba7a8[_0x1f88('0x2e')],_0xaba7a8[_0x1f88('0x30')]);_0x205e28[_0x1f88('0x33')]=_['intersection'](_0xaba7a8['model'],qs[_0x1f88('0x34')](_0x5a6b70[_0x1f88('0x30')]['fields']));_0x205e28[_0x1f88('0x33')]=_0x205e28['attributes'][_0x1f88('0x35')]?_0x205e28[_0x1f88('0x33')]:_0xaba7a8['model'];if(!_0x5a6b70[_0x1f88('0x30')][_0x1f88('0x36')](_0x1f88('0x37'))){_0x205e28[_0x1f88('0x1c')]=qs['limit'](_0x5a6b70['query']['limit']);_0x205e28[_0x1f88('0x1d')]=qs['offset'](_0x5a6b70['query']['offset']);}_0x205e28['order']=qs['sort'](_0x5a6b70[_0x1f88('0x30')][_0x1f88('0x38')]);_0x205e28[_0x1f88('0x39')]=qs['filters'](_['pick'](_0x5a6b70[_0x1f88('0x30')],_0xaba7a8[_0x1f88('0x31')]),_0x2cb080);if(_0x5a6b70[_0x1f88('0x30')][_0x1f88('0x3a')]){_0x205e28[_0x1f88('0x39')]=_[_0x1f88('0x3b')](_0x205e28[_0x1f88('0x39')],{'$or':_[_0x1f88('0x2f')](_0x2cb080,function(_0x14018e){if(_0x14018e[_0x1f88('0x2d')]!=='VIRTUAL'){var _0x2f7f11={};_0x2f7f11[_0x14018e[_0x1f88('0x27')]]={'$like':'%'+_0x5a6b70[_0x1f88('0x30')]['filter']+'%'};return _0x2f7f11;}})});}_0x205e28=_[_0x1f88('0x3b')]({},_0x205e28,_0x5a6b70[_0x1f88('0x3c')]);var _0x401f17={'where':_0x205e28['where']};return db['ServicenowAccount']['count'](_0x401f17)[_0x1f88('0x24')](function(_0x341a48){_0x370aa8[_0x1f88('0x1e')]=_0x341a48;if(_0x5a6b70[_0x1f88('0x30')]['includeAll']){_0x205e28['include']=[{'all':!![]}];}return db[_0x1f88('0x2a')][_0x1f88('0x3d')](_0x205e28);})[_0x1f88('0x24')](function(_0x57c82e){_0x370aa8['rows']=_0x57c82e;return _0x370aa8;})['then'](respondWithFilteredResult(_0x213c24,_0x205e28))[_0x1f88('0x3e')](handleError(_0x213c24,null));};exports[_0x1f88('0x3f')]=function(_0x3b5e1b,_0x832fd3){var _0x250932={'raw':![],'where':{'id':_0x3b5e1b['params']['id']}},_0xc9555a={};_0xc9555a['model']=_['keys'](db[_0x1f88('0x2a')][_0x1f88('0x2b')]);_0xc9555a[_0x1f88('0x30')]=_['keys'](_0x3b5e1b[_0x1f88('0x30')]);_0xc9555a[_0x1f88('0x31')]=_[_0x1f88('0x32')](_0xc9555a[_0x1f88('0x2e')],_0xc9555a[_0x1f88('0x30')]);_0x250932[_0x1f88('0x33')]=_[_0x1f88('0x32')](_0xc9555a['model'],qs[_0x1f88('0x34')](_0x3b5e1b[_0x1f88('0x30')]['fields']));_0x250932[_0x1f88('0x33')]=_0x250932[_0x1f88('0x33')][_0x1f88('0x35')]?_0x250932[_0x1f88('0x33')]:_0xc9555a['model'];if(_0x3b5e1b['query'][_0x1f88('0x40')]){_0x250932[_0x1f88('0x41')]=[{'all':!![]}];}_0x250932=_['merge']({},_0x250932,_0x3b5e1b[_0x1f88('0x3c')]);return db['ServicenowAccount'][_0x1f88('0x42')](_0x250932)[_0x1f88('0x24')](handleEntityNotFound(_0x832fd3,null))['then'](respondWithResult(_0x832fd3,null))[_0x1f88('0x3e')](handleError(_0x832fd3,null));};exports[_0x1f88('0x43')]=function(_0x4f146b,_0x3df333){return db[_0x1f88('0x2a')][_0x1f88('0x43')](_0x4f146b['body'],{})['then'](respondWithResult(_0x3df333,0xc9))[_0x1f88('0x3e')](handleError(_0x3df333,null));};exports[_0x1f88('0x23')]=function(_0xbdc526,_0x4f8351){if(_0xbdc526[_0x1f88('0x44')]['id']){delete _0xbdc526[_0x1f88('0x44')]['id'];}return db[_0x1f88('0x2a')][_0x1f88('0x42')]({'where':{'id':_0xbdc526[_0x1f88('0x45')]['id']}})[_0x1f88('0x24')](handleEntityNotFound(_0x4f8351,null))[_0x1f88('0x24')](saveUpdates(_0xbdc526[_0x1f88('0x44')],null))[_0x1f88('0x24')](respondWithResult(_0x4f8351,null))[_0x1f88('0x3e')](handleError(_0x4f8351,null));};exports['destroy']=function(_0x51b140,_0x2f4abb){return db[_0x1f88('0x2a')][_0x1f88('0x42')]({'where':{'id':_0x51b140[_0x1f88('0x45')]['id']}})[_0x1f88('0x24')](handleEntityNotFound(_0x2f4abb,null))[_0x1f88('0x24')](removeEntity(_0x2f4abb,null))[_0x1f88('0x3e')](handleError(_0x2f4abb,null));};exports[_0x1f88('0x46')]=function(_0x171661,_0x3bdabc,_0x47afc6){var _0x4aec80={};var _0x23142d={};var _0x4a7179;var _0x3aee30;return db[_0x1f88('0x2a')][_0x1f88('0x47')]({'where':{'id':_0x171661[_0x1f88('0x45')]['id']}})['then'](handleEntityNotFound(_0x3bdabc,null))['then'](function(_0x3b85a8){if(_0x3b85a8){_0x4a7179=_0x3b85a8;_0x23142d[_0x1f88('0x2e')]=_[_0x1f88('0x48')](db['ServicenowConfiguration'][_0x1f88('0x2b')]);_0x23142d[_0x1f88('0x30')]=_[_0x1f88('0x48')](_0x171661[_0x1f88('0x30')]);_0x23142d[_0x1f88('0x31')]=_['intersection'](_0x23142d['model'],_0x23142d['query']);_0x4aec80['attributes']=_['intersection'](_0x23142d['model'],qs['fields'](_0x171661['query']['fields']));_0x4aec80[_0x1f88('0x33')]=_0x4aec80['attributes'][_0x1f88('0x35')]?_0x4aec80[_0x1f88('0x33')]:_0x23142d[_0x1f88('0x2e')];_0x4aec80[_0x1f88('0x49')]=qs[_0x1f88('0x38')](_0x171661[_0x1f88('0x30')][_0x1f88('0x38')]);_0x4aec80[_0x1f88('0x39')]=qs[_0x1f88('0x31')](_['pick'](_0x171661[_0x1f88('0x30')],_0x23142d[_0x1f88('0x31')]));if(_0x171661[_0x1f88('0x30')]['filter']){_0x4aec80['where']=_[_0x1f88('0x3b')](_0x4aec80[_0x1f88('0x39')],{'$or':_['map'](_0x4aec80['attributes'],function(_0x67e296){var _0x1b03bb={};_0x1b03bb[_0x67e296]={'$like':'%'+_0x171661[_0x1f88('0x30')][_0x1f88('0x3a')]+'%'};return _0x1b03bb;})});}_0x4aec80=_[_0x1f88('0x3b')]({},_0x4aec80,_0x171661[_0x1f88('0x3c')]);return _0x4a7179[_0x1f88('0x46')](_0x4aec80);}})[_0x1f88('0x24')](function(_0x2435a9){if(_0x2435a9){_0x3aee30=_0x2435a9['length'];if(!_0x171661[_0x1f88('0x30')]['hasOwnProperty'](_0x1f88('0x37'))){_0x4aec80[_0x1f88('0x1c')]=qs[_0x1f88('0x1c')](_0x171661['query'][_0x1f88('0x1c')]);_0x4aec80['offset']=qs[_0x1f88('0x1d')](_0x171661[_0x1f88('0x30')][_0x1f88('0x1d')]);}return _0x4a7179[_0x1f88('0x46')](_0x4aec80);}})['then'](function(_0x1a337b){if(_0x1a337b){return _0x1a337b?{'count':_0x3aee30,'rows':_0x1a337b}:null;}})[_0x1f88('0x24')](respondWithResult(_0x3bdabc,null))[_0x1f88('0x3e')](handleError(_0x3bdabc,null));};exports[_0x1f88('0x4a')]=function(_0x1f05da,_0x2a4eda,_0x24e710){if(_0x1f05da[_0x1f88('0x44')]['id']){delete _0x1f05da[_0x1f88('0x44')]['id'];}return db[_0x1f88('0x2a')][_0x1f88('0x47')]({'where':{'id':_0x1f05da['params']['id']}})[_0x1f88('0x24')](handleEntityNotFound(_0x2a4eda,null))[_0x1f88('0x24')](function(_0x10e199){if(_0x10e199){_0x1f05da[_0x1f88('0x44')][_0x1f88('0x4b')]=_0x10e199['id'];_0x1f05da['body'][_0x1f88('0x4c')]=integrations[_0x1f88('0x4d')](_0x1f05da['body']['channel'],_0x1f05da[_0x1f88('0x44')][_0x1f88('0x2d')]);_0x1f05da[_0x1f88('0x44')][_0x1f88('0x4e')]=integrations[_0x1f88('0x4f')](_0x1f05da[_0x1f88('0x44')][_0x1f88('0x50')],_0x1f05da[_0x1f88('0x44')]['type']);return db[_0x1f88('0x51')][_0x1f88('0x43')](_0x1f05da[_0x1f88('0x44')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x1f88('0x4e')}]});}return null;})[_0x1f88('0x24')](respondWithResult(_0x2a4eda,null))[_0x1f88('0x3e')](handleError(_0x2a4eda,null));};exports['getFields']=function(_0x2be040,_0x38a2db,_0x1eb0cb){var _0x42b412=[_0x1f88('0x52'),'hold_reason',_0x1f88('0x53'),_0x1f88('0x54'),_0x1f88('0x55'),_0x1f88('0x56'),'incident_state',_0x1f88('0x57'),_0x1f88('0x58')];var _0x1f1d08=['parent','made_sla',_0x1f88('0x59'),_0x1f88('0x5a'),_0x1f88('0x5b'),_0x1f88('0x5c'),'child_incidents',_0x1f88('0x5d'),'approval_history','number',_0x1f88('0x5e'),'sys_updated_by',_0x1f88('0x5f'),_0x1f88('0x60'),_0x1f88('0x61'),'sys_domain',_0x1f88('0x62'),_0x1f88('0x63'),'knowledge','order',_0x1f88('0x64'),'closed_at',_0x1f88('0x65'),_0x1f88('0x66'),'impact',_0x1f88('0x67'),'work_notes_list','business_service',_0x1f88('0x68'),_0x1f88('0x69'),_0x1f88('0x6a'),_0x1f88('0x6b'),'expected_start','opened_at','business_duration',_0x1f88('0x6c'),_0x1f88('0x6d'),_0x1f88('0x6e'),'resolved_at',_0x1f88('0x6f'),_0x1f88('0x70'),_0x1f88('0x54'),_0x1f88('0x71'),_0x1f88('0x72'),_0x1f88('0x55'),_0x1f88('0x73'),_0x1f88('0x74'),_0x1f88('0x75'),_0x1f88('0x76'),_0x1f88('0x77'),_0x1f88('0x78'),_0x1f88('0x79'),_0x1f88('0x7a'),_0x1f88('0x56'),_0x1f88('0x7b'),'close_notes',_0x1f88('0x7c'),_0x1f88('0x7d'),_0x1f88('0x7e'),_0x1f88('0x7f'),_0x1f88('0x80'),_0x1f88('0x81'),_0x1f88('0x82'),_0x1f88('0x83'),_0x1f88('0x84'),_0x1f88('0x85'),'reassignment_count','activity_due',_0x1f88('0x86'),_0x1f88('0x57'),'comments','sla_due',_0x1f88('0x87'),'comments_and_work_notes',_0x1f88('0x88'),'sys_mod_count',_0x1f88('0x89'),_0x1f88('0x8a'),_0x1f88('0x8b'),'upon_approval','correlation_id',_0x1f88('0x8c'),'category'];var _0x343f28='';var _0x29630c='';var _0x2e8e9e=[];var _0x5d4b17='';var _0x1084bc='';var _0x564202=[];var _0x472f8d='';var _0x18c884='';var _0x2bc116={};var _0x13d529='';return db['ServicenowAccount'][_0x1f88('0x47')]({'where':{'id':_0x2be040[_0x1f88('0x45')]['id']},'attributes':['id',_0x1f88('0x8d'),'password',_0x1f88('0x8e'),_0x1f88('0x8f'),_0x1f88('0x90')]})['then'](handleEntityNotFound(_0x38a2db,null))[_0x1f88('0x24')](function(_0xdc18e6){if(_0xdc18e6){_0x13d529=_0xdc18e6[_0x1f88('0x8f')];var _0x23a301=_0x13d529['slice'](-0x1);if(_0x23a301==='/'){_0x13d529=_0x13d529[_0x1f88('0x91')](0x0,_0x13d529['lastIndexOf'](_0x23a301));}_0x18c884=util[_0x1f88('0x92')](_0x1f88('0x93'),_0x13d529);_0x472f8d=util[_0x1f88('0x92')]('%s/api/now/table/',_0x13d529);_0x2bc116={'user':_0xdc18e6[_0x1f88('0x8d')],'pass':_0xdc18e6[_0x1f88('0x94')]};var _0x1e7c7e={'method':_0x1f88('0x95'),'uri':_0x18c884+_0x1f88('0x96'),'auth':_0x2bc116,'json':!![]};return rp(_0x1e7c7e);}})[_0x1f88('0x24')](function(_0x47d8bf){if(_0x47d8bf['result'][_0x1f88('0x35')]>0x0){_0x343f28=_0x47d8bf[_0x1f88('0x97')];}console[_0x1f88('0x98')](_0x1f88('0x99'),_0x343f28);_0x564202=[];_0x29630c=Object[_0x1f88('0x9a')]([],_0x343f28);_[_0x1f88('0x9b')](_0x29630c,function(_0x1782ff){return!_0x42b412[_0x1f88('0x9c')](_0x1782ff[_0x1f88('0x27')]);});_0x29630c[_0x1f88('0x9d')](function(_0x3c3306){var _0xb2380e=createFieldObject(_0x472f8d,_0x2bc116,_0x3c3306[_0x1f88('0x9e')],_0x3c3306['name'],_0x3c3306[_0x1f88('0x9f')],![]);_0x564202[_0x1f88('0xa0')](_0xb2380e);});return Promise['all'](_0x564202);})[_0x1f88('0x24')](function(_0x49a3ec){_0x2e8e9e=_0x49a3ec;_0x5d4b17=Object[_0x1f88('0x9a')]([],_0x343f28);console[_0x1f88('0x98')](_0x1f88('0xa1'),_0x343f28);_[_0x1f88('0x9b')](_0x5d4b17,function(_0x291b95){return _0x1f1d08['includes'](_0x291b95[_0x1f88('0x27')]);});console[_0x1f88('0x98')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x5d4b17);_0x564202=[];_0x5d4b17[_0x1f88('0x9d')](function(_0x2b534d){var _0x567b59=createFieldObject(_0x472f8d,_0x2bc116,_0x2b534d[_0x1f88('0x9e')],_0x2b534d['name'],_0x2b534d[_0x1f88('0x9f')],!![]);_0x564202[_0x1f88('0xa0')](_0x567b59);});return Promise[_0x1f88('0xa2')](_0x564202);})['then'](function(_0xcfe0f4){_0x1084bc=_0xcfe0f4;var _0x5a5499=_0x2e8e9e[_0x1f88('0xa3')](_0x1084bc);return{'count':_0x5a5499[_0x1f88('0x35')],'rows':_0x5a5499};})[_0x1f88('0x24')](respondWithResult(_0x38a2db,null))[_0x1f88('0x3e')](function(_0x458312){console['log'](_0x1f88('0xa4')+_0x458312);var _0x2183e4=_0x2be040[_0x1f88('0x30')][_0x1f88('0xa5')]?0x1f4:_0x458312[_0x1f88('0xa6')]||0x1f4;logger[_0x1f88('0x25')](_0x458312[_0x1f88('0x26')]);delete _0x458312[_0x1f88('0x27')];if(_0x2183e4===0x191){_0x2183e4=0x190;}_0x38a2db[_0x1f88('0x19')](_0x2183e4)[_0x1f88('0x28')](_0x2be040[_0x1f88('0x30')][_0x1f88('0xa5')]?{'message':_0x1f88('0xa7'),'statusCode':_0x458312[_0x1f88('0xa6')]}:_0x458312);});};function createFieldObject(_0x426efe,_0x5be147,_0x35569f,_0x3c8f39,_0x3cf859,_0x30aa92){return new Promise(function(_0x5bf329,_0x11aed6){var _0x433971={'id':_0x3c8f39,'name':_0x3cf859,'custom':_0x30aa92};if(_0x35569f==='boolean'){_0x433971[_0x1f88('0x3c')]=[{'name':_0x1f88('0xa8'),'value':_0x1f88('0xa9')},{'name':'False','value':_0x1f88('0xaa')}];_0x5bf329(_0x433971);}else{var _0x27a42c={'method':_0x1f88('0x95'),'uri':_0x426efe+_0x1f88('0xab')+_0x3c8f39,'auth':_0x5be147,'json':!![]};return rp(_0x27a42c)[_0x1f88('0x24')](function(_0x422b7a){var _0x1225c3=[];if(_0x422b7a[_0x1f88('0x97')]['length']>0x0){_0x422b7a[_0x1f88('0x97')][_0x1f88('0x9d')](function(_0x51a0b2){if(_0x51a0b2[_0x1f88('0xac')]==='false'){var _0x5510e9={'name':_0x51a0b2[_0x1f88('0x9f')],'value':_0x51a0b2[_0x1f88('0xad')]};_0x1225c3[_0x1f88('0xa0')](_0x5510e9);}});}_0x433971[_0x1f88('0x3c')]=_0x1225c3;if(_0x433971[_0x1f88('0x3c')][_0x1f88('0x35')]>0x0){_0x5bf329(_0x433971);}else{if(_0x30aa92==![]){_0x5bf329();}else{_0x5bf329(_0x433971);}}});}});} \ No newline at end of file +var _0x66a3=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','options','find','catch','create','update','body','params','getConfigurations','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','short_description','delivery_task','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','reopen_count','escalation','correlation_id','location','findOne','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','forEach','label','all','assign','log','TCL:\x20_object','remove','internalType','push','concat','statusCode','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x5c136e,_0x451813){var _0x30019c=function(_0x5f0b1f){while(--_0x5f0b1f){_0x5c136e['push'](_0x5c136e['shift']());}};_0x30019c(++_0x451813);}(_0x66a3,0x130));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x366a('0x0'));var rimraf=require(_0x366a('0x1'));var zipdir=require(_0x366a('0x2'));var jsonpatch=require(_0x366a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x366a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x366a('0x5'));var sox=require(_0x366a('0x6'));var csv=require(_0x366a('0x7'));var ejs=require(_0x366a('0x8'));var fs=require('fs');var fs_extra=require(_0x366a('0x9'));var _=require(_0x366a('0xa'));var squel=require(_0x366a('0xb'));var crypto=require('crypto');var jsforce=require(_0x366a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x366a('0x7'));var querystring=require(_0x366a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x366a('0xe'));var qs=require(_0x366a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x366a('0x10'));var logger=require(_0x366a('0x11'))(_0x366a('0x12'));var utils=require('../../config/utils');var config=require(_0x366a('0x13'));var licenseUtil=require(_0x366a('0x14'));var db=require(_0x366a('0x15'))['db'];var integrations=require(_0x366a('0x16'));function respondWithStatusCode(_0x11ab3a,_0x40f7ab){_0x40f7ab=_0x40f7ab||0xcc;return function(_0x94dfd7){if(_0x94dfd7){return _0x11ab3a[_0x366a('0x17')](_0x40f7ab);}return _0x11ab3a['status'](_0x40f7ab)[_0x366a('0x18')]();};}function respondWithResult(_0x457416,_0x17fc49){_0x17fc49=_0x17fc49||0xc8;return function(_0x1e44e8){if(_0x1e44e8){return _0x457416[_0x366a('0x19')](_0x17fc49)[_0x366a('0x1a')](_0x1e44e8);}};}function respondWithFilteredResult(_0x3764d7,_0x44e789){return function(_0xdd51f0){if(_0xdd51f0){var _0x4c68ed=typeof _0x44e789['offset']===_0x366a('0x1b')&&typeof _0x44e789[_0x366a('0x1c')]===_0x366a('0x1b');var _0x4fa22f=_0xdd51f0[_0x366a('0x1d')];var _0x1878b1=_0x4c68ed?0x0:_0x44e789['offset'];var _0x4ad06f=_0x4c68ed?_0xdd51f0[_0x366a('0x1d')]:_0x44e789[_0x366a('0x1e')]+_0x44e789['limit'];var _0xa1126d;if(_0x4ad06f>=_0x4fa22f){_0x4ad06f=_0x4fa22f;_0xa1126d=0xc8;}else{_0xa1126d=0xce;}_0x3764d7[_0x366a('0x19')](_0xa1126d);return _0x3764d7[_0x366a('0x1f')](_0x366a('0x20'),_0x1878b1+'-'+_0x4ad06f+'/'+_0x4fa22f)[_0x366a('0x1a')](_0xdd51f0);}return null;};}function patchUpdates(_0xd5d66d){return function(_0x205f49){try{jsonpatch[_0x366a('0x21')](_0x205f49,_0xd5d66d,!![]);}catch(_0x298b63){return BPromise[_0x366a('0x22')](_0x298b63);}return _0x205f49['save']();};}function saveUpdates(_0x30e732,_0x45907f){return function(_0x16ddc9){if(_0x16ddc9){return _0x16ddc9['update'](_0x30e732)[_0x366a('0x23')](function(_0x2ecf82){return _0x2ecf82;});}return null;};}function removeEntity(_0xbd19f8,_0x197ddf){return function(_0x3a1f39){if(_0x3a1f39){return _0x3a1f39[_0x366a('0x24')]()[_0x366a('0x23')](function(){_0xbd19f8[_0x366a('0x19')](0xcc)[_0x366a('0x18')]();});}};}function handleEntityNotFound(_0x14bbf5,_0x1f45c7){return function(_0x568703){if(!_0x568703){_0x14bbf5['sendStatus'](0x194);}return _0x568703;};}function handleError(_0x4b2926,_0x2f6216){_0x2f6216=_0x2f6216||0x1f4;return function(_0x31364d){logger[_0x366a('0x25')](_0x31364d[_0x366a('0x26')]);if(_0x31364d['name']){delete _0x31364d[_0x366a('0x27')];}_0x4b2926[_0x366a('0x19')](_0x2f6216)[_0x366a('0x28')](_0x31364d);};}exports[_0x366a('0x29')]=function(_0x55cf97,_0x281361){var _0x3faae2={},_0x58102b={},_0x2a1c87={'count':0x0,'rows':[]};var _0x3191b2=_[_0x366a('0x2a')](db[_0x366a('0x2b')][_0x366a('0x2c')],function(_0x2c8b0d){return{'name':_0x2c8b0d[_0x366a('0x2d')],'type':_0x2c8b0d[_0x366a('0x2e')][_0x366a('0x2f')]};});_0x58102b[_0x366a('0x30')]=_['map'](_0x3191b2,_0x366a('0x27'));_0x58102b[_0x366a('0x31')]=_[_0x366a('0x32')](_0x55cf97[_0x366a('0x31')]);_0x58102b[_0x366a('0x33')]=_[_0x366a('0x34')](_0x58102b['model'],_0x58102b['query']);_0x3faae2[_0x366a('0x35')]=_[_0x366a('0x34')](_0x58102b[_0x366a('0x30')],qs[_0x366a('0x36')](_0x55cf97[_0x366a('0x31')]['fields']));_0x3faae2[_0x366a('0x35')]=_0x3faae2[_0x366a('0x35')][_0x366a('0x37')]?_0x3faae2[_0x366a('0x35')]:_0x58102b[_0x366a('0x30')];if(!_0x55cf97['query'][_0x366a('0x38')](_0x366a('0x39'))){_0x3faae2[_0x366a('0x1c')]=qs[_0x366a('0x1c')](_0x55cf97['query'][_0x366a('0x1c')]);_0x3faae2[_0x366a('0x1e')]=qs[_0x366a('0x1e')](_0x55cf97[_0x366a('0x31')][_0x366a('0x1e')]);}_0x3faae2[_0x366a('0x3a')]=qs[_0x366a('0x3b')](_0x55cf97[_0x366a('0x31')][_0x366a('0x3b')]);_0x3faae2[_0x366a('0x3c')]=qs[_0x366a('0x33')](_[_0x366a('0x3d')](_0x55cf97['query'],_0x58102b[_0x366a('0x33')]),_0x3191b2);if(_0x55cf97[_0x366a('0x31')][_0x366a('0x3e')]){_0x3faae2['where']=_[_0x366a('0x3f')](_0x3faae2[_0x366a('0x3c')],{'$or':_[_0x366a('0x2a')](_0x3191b2,function(_0x3112a1){if(_0x3112a1[_0x366a('0x2e')]!==_0x366a('0x40')){var _0x287cc8={};_0x287cc8[_0x3112a1['name']]={'$like':'%'+_0x55cf97[_0x366a('0x31')][_0x366a('0x3e')]+'%'};return _0x287cc8;}})});}_0x3faae2=_[_0x366a('0x3f')]({},_0x3faae2,_0x55cf97['options']);var _0x50f868={'where':_0x3faae2[_0x366a('0x3c')]};return db[_0x366a('0x2b')][_0x366a('0x1d')](_0x50f868)['then'](function(_0x5c7209){_0x2a1c87[_0x366a('0x1d')]=_0x5c7209;if(_0x55cf97[_0x366a('0x31')][_0x366a('0x41')]){_0x3faae2[_0x366a('0x42')]=[{'all':!![]}];}return db[_0x366a('0x2b')]['findAll'](_0x3faae2);})[_0x366a('0x23')](function(_0x2e1112){_0x2a1c87[_0x366a('0x43')]=_0x2e1112;return _0x2a1c87;})[_0x366a('0x23')](respondWithFilteredResult(_0x281361,_0x3faae2))['catch'](handleError(_0x281361,null));};exports[_0x366a('0x44')]=function(_0x445ddd,_0x12c6e9){var _0x1b08d9={'raw':![],'where':{'id':_0x445ddd['params']['id']}},_0x927240={};_0x927240[_0x366a('0x30')]=_[_0x366a('0x32')](db[_0x366a('0x2b')][_0x366a('0x2c')]);_0x927240[_0x366a('0x31')]=_['keys'](_0x445ddd[_0x366a('0x31')]);_0x927240[_0x366a('0x33')]=_['intersection'](_0x927240[_0x366a('0x30')],_0x927240[_0x366a('0x31')]);_0x1b08d9[_0x366a('0x35')]=_[_0x366a('0x34')](_0x927240[_0x366a('0x30')],qs[_0x366a('0x36')](_0x445ddd[_0x366a('0x31')][_0x366a('0x36')]));_0x1b08d9[_0x366a('0x35')]=_0x1b08d9['attributes']['length']?_0x1b08d9[_0x366a('0x35')]:_0x927240[_0x366a('0x30')];if(_0x445ddd[_0x366a('0x31')]['includeAll']){_0x1b08d9['include']=[{'all':!![]}];}_0x1b08d9=_['merge']({},_0x1b08d9,_0x445ddd[_0x366a('0x45')]);return db['ServicenowAccount'][_0x366a('0x46')](_0x1b08d9)['then'](handleEntityNotFound(_0x12c6e9,null))[_0x366a('0x23')](respondWithResult(_0x12c6e9,null))[_0x366a('0x47')](handleError(_0x12c6e9,null));};exports[_0x366a('0x48')]=function(_0x5e4b9c,_0x36761b){return db[_0x366a('0x2b')][_0x366a('0x48')](_0x5e4b9c['body'],{})[_0x366a('0x23')](respondWithResult(_0x36761b,0xc9))['catch'](handleError(_0x36761b,null));};exports[_0x366a('0x49')]=function(_0x3afb9f,_0x479ef8){if(_0x3afb9f[_0x366a('0x4a')]['id']){delete _0x3afb9f[_0x366a('0x4a')]['id'];}return db[_0x366a('0x2b')][_0x366a('0x46')]({'where':{'id':_0x3afb9f[_0x366a('0x4b')]['id']}})[_0x366a('0x23')](handleEntityNotFound(_0x479ef8,null))[_0x366a('0x23')](saveUpdates(_0x3afb9f[_0x366a('0x4a')],null))[_0x366a('0x23')](respondWithResult(_0x479ef8,null))[_0x366a('0x47')](handleError(_0x479ef8,null));};exports[_0x366a('0x24')]=function(_0x1f475b,_0x107f22){return db[_0x366a('0x2b')][_0x366a('0x46')]({'where':{'id':_0x1f475b[_0x366a('0x4b')]['id']}})[_0x366a('0x23')](handleEntityNotFound(_0x107f22,null))[_0x366a('0x23')](removeEntity(_0x107f22,null))[_0x366a('0x47')](handleError(_0x107f22,null));};exports[_0x366a('0x4c')]=function(_0x35cf66,_0x3659e9,_0x3d41fd){var _0x1d1778={};var _0x220cca={};var _0x2179ef;var _0x42f0f0;return db['ServicenowAccount']['findOne']({'where':{'id':_0x35cf66[_0x366a('0x4b')]['id']}})[_0x366a('0x23')](handleEntityNotFound(_0x3659e9,null))[_0x366a('0x23')](function(_0x12b4e2){if(_0x12b4e2){_0x2179ef=_0x12b4e2;_0x220cca[_0x366a('0x30')]=_[_0x366a('0x32')](db[_0x366a('0x4d')][_0x366a('0x2c')]);_0x220cca[_0x366a('0x31')]=_[_0x366a('0x32')](_0x35cf66[_0x366a('0x31')]);_0x220cca[_0x366a('0x33')]=_[_0x366a('0x34')](_0x220cca[_0x366a('0x30')],_0x220cca[_0x366a('0x31')]);_0x1d1778[_0x366a('0x35')]=_[_0x366a('0x34')](_0x220cca['model'],qs[_0x366a('0x36')](_0x35cf66[_0x366a('0x31')][_0x366a('0x36')]));_0x1d1778['attributes']=_0x1d1778['attributes'][_0x366a('0x37')]?_0x1d1778['attributes']:_0x220cca[_0x366a('0x30')];_0x1d1778['order']=qs[_0x366a('0x3b')](_0x35cf66[_0x366a('0x31')][_0x366a('0x3b')]);_0x1d1778['where']=qs[_0x366a('0x33')](_[_0x366a('0x3d')](_0x35cf66[_0x366a('0x31')],_0x220cca[_0x366a('0x33')]));if(_0x35cf66['query'][_0x366a('0x3e')]){_0x1d1778[_0x366a('0x3c')]=_[_0x366a('0x3f')](_0x1d1778[_0x366a('0x3c')],{'$or':_[_0x366a('0x2a')](_0x1d1778[_0x366a('0x35')],function(_0xecfee){var _0x303dce={};_0x303dce[_0xecfee]={'$like':'%'+_0x35cf66['query'][_0x366a('0x3e')]+'%'};return _0x303dce;})});}_0x1d1778=_[_0x366a('0x3f')]({},_0x1d1778,_0x35cf66[_0x366a('0x45')]);return _0x2179ef[_0x366a('0x4c')](_0x1d1778);}})['then'](function(_0x15da1b){if(_0x15da1b){_0x42f0f0=_0x15da1b['length'];if(!_0x35cf66['query'][_0x366a('0x38')](_0x366a('0x39'))){_0x1d1778['limit']=qs[_0x366a('0x1c')](_0x35cf66[_0x366a('0x31')][_0x366a('0x1c')]);_0x1d1778[_0x366a('0x1e')]=qs['offset'](_0x35cf66[_0x366a('0x31')][_0x366a('0x1e')]);}return _0x2179ef[_0x366a('0x4c')](_0x1d1778);}})[_0x366a('0x23')](function(_0x30fcd9){if(_0x30fcd9){return _0x30fcd9?{'count':_0x42f0f0,'rows':_0x30fcd9}:null;}})[_0x366a('0x23')](respondWithResult(_0x3659e9,null))[_0x366a('0x47')](handleError(_0x3659e9,null));};exports[_0x366a('0x4e')]=function(_0x989039,_0x5c953b,_0x5d850d){if(_0x989039['body']['id']){delete _0x989039[_0x366a('0x4a')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x989039['params']['id']}})[_0x366a('0x23')](handleEntityNotFound(_0x5c953b,null))[_0x366a('0x23')](function(_0x152731){if(_0x152731){_0x989039[_0x366a('0x4a')][_0x366a('0x4f')]=_0x152731['id'];_0x989039[_0x366a('0x4a')][_0x366a('0x50')]=integrations[_0x366a('0x51')](_0x989039[_0x366a('0x4a')][_0x366a('0x52')],_0x989039[_0x366a('0x4a')]['type']);_0x989039[_0x366a('0x4a')][_0x366a('0x53')]=integrations['getDescriptions'](_0x989039['body']['channel'],_0x989039[_0x366a('0x4a')][_0x366a('0x2e')]);return db[_0x366a('0x4d')][_0x366a('0x48')](_0x989039[_0x366a('0x4a')],{'include':[{'model':db[_0x366a('0x54')],'as':'Subjects'},{'model':db[_0x366a('0x54')],'as':_0x366a('0x53')}]});}return null;})['then'](respondWithResult(_0x5c953b,null))['catch'](handleError(_0x5c953b,null));};exports[_0x366a('0x55')]=function(_0x2a5a0e,_0x258b3b,_0x49f8ab){var _0x438dcc=['made_sla',_0x366a('0x56'),_0x366a('0x57'),_0x366a('0x58'),'close_code',_0x366a('0x59'),_0x366a('0x5a'),_0x366a('0x5b'),_0x366a('0x5c')];var _0x5df9e7=['parent',_0x366a('0x5d'),_0x366a('0x5e'),_0x366a('0x5f'),_0x366a('0x60'),_0x366a('0x61'),_0x366a('0x62'),_0x366a('0x56'),'approval_history',_0x366a('0x63'),_0x366a('0x64'),_0x366a('0x65'),'opened_by',_0x366a('0x66'),_0x366a('0x67'),_0x366a('0x68'),'state',_0x366a('0x69'),_0x366a('0x57'),_0x366a('0x3a'),_0x366a('0x6a'),_0x366a('0x6b'),'cmdb_ci',_0x366a('0x6c'),_0x366a('0x6d'),_0x366a('0x6e'),'work_notes_list',_0x366a('0x6f'),_0x366a('0x70'),_0x366a('0x71'),_0x366a('0x72'),_0x366a('0x73'),'expected_start',_0x366a('0x74'),_0x366a('0x75'),_0x366a('0x76'),_0x366a('0x77'),'reopened_time',_0x366a('0x78'),_0x366a('0x79'),'approval_set',_0x366a('0x58'),_0x366a('0x7a'),_0x366a('0x7b'),'close_code','correlation_display',_0x366a('0x7c'),'work_start','assignment_group',_0x366a('0x7d'),_0x366a('0x7e'),'description',_0x366a('0x7f'),'notify',_0x366a('0x80'),_0x366a('0x81'),'closed_by',_0x366a('0x82'),_0x366a('0x83'),_0x366a('0x84'),_0x366a('0x85'),_0x366a('0x86'),_0x366a('0x5a'),'urgency','problem_id','company',_0x366a('0x87'),_0x366a('0x88'),_0x366a('0x89'),_0x366a('0x5b'),_0x366a('0x8a'),_0x366a('0x8b'),_0x366a('0x8c'),'comments_and_work_notes','due_date','sys_mod_count',_0x366a('0x8d'),'sys_tags',_0x366a('0x8e'),'upon_approval',_0x366a('0x8f'),_0x366a('0x90'),_0x366a('0x5c')];var _0x170949='';var _0x2e17d5='';var _0x134314=[];var _0x4e1bd4='';var _0x119280='';var _0x4a2fa3=[];var _0x47d04e='';var _0x28f33d='';var _0x36f2cb={};var _0x25731e='';return db[_0x366a('0x2b')][_0x366a('0x91')]({'where':{'id':_0x2a5a0e[_0x366a('0x4b')]['id']},'attributes':['id',_0x366a('0x92'),_0x366a('0x93'),_0x366a('0x94'),_0x366a('0x95'),_0x366a('0x96')]})['then'](handleEntityNotFound(_0x258b3b,null))[_0x366a('0x23')](function(_0x201f87){if(_0x201f87){_0x25731e=_0x201f87[_0x366a('0x95')];var _0x342504=_0x25731e[_0x366a('0x97')](-0x1);if(_0x342504==='/'){_0x25731e=_0x25731e['substring'](0x0,_0x25731e[_0x366a('0x98')](_0x342504));}_0x28f33d=util['format'](_0x366a('0x99'),_0x25731e);_0x47d04e=util[_0x366a('0x9a')](_0x366a('0x9b'),_0x25731e);_0x36f2cb={'user':_0x201f87[_0x366a('0x92')],'pass':_0x201f87[_0x366a('0x93')]};var _0x201dc0={'method':_0x366a('0x9c'),'uri':_0x28f33d+_0x366a('0x9d'),'auth':_0x36f2cb,'json':!![]};return rp(_0x201dc0);}})[_0x366a('0x23')](function(_0x157af4){if(_0x157af4[_0x366a('0x9e')][_0x366a('0x37')]>0x0){_0x170949=_0x157af4[_0x366a('0x9e')];}console['log'](_0x366a('0x9f'),_0x170949);_0x4a2fa3=[];_0x2e17d5=Object['assign']([],_0x170949);_['remove'](_0x2e17d5,function(_0x2cf079){return!_0x438dcc[_0x366a('0xa0')](_0x2cf079['name']);});_0x2e17d5[_0x366a('0xa1')](function(_0x196f2c){var _0x41ad83=createFieldObject(_0x47d04e,_0x36f2cb,_0x196f2c['internalType'],_0x196f2c['name'],_0x196f2c[_0x366a('0xa2')],![]);_0x4a2fa3['push'](_0x41ad83);});return Promise[_0x366a('0xa3')](_0x4a2fa3);})[_0x366a('0x23')](function(_0x466d95){_0x134314=_0x466d95;_0x4e1bd4=Object[_0x366a('0xa4')]([],_0x170949);console[_0x366a('0xa5')](_0x366a('0xa6'),_0x170949);_[_0x366a('0xa7')](_0x4e1bd4,function(_0x12e24f){return _0x5df9e7['includes'](_0x12e24f['name']);});console[_0x366a('0xa5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4e1bd4);_0x4a2fa3=[];_0x4e1bd4[_0x366a('0xa1')](function(_0x6aea24){var _0x18d416=createFieldObject(_0x47d04e,_0x36f2cb,_0x6aea24[_0x366a('0xa8')],_0x6aea24[_0x366a('0x27')],_0x6aea24[_0x366a('0xa2')],!![]);_0x4a2fa3[_0x366a('0xa9')](_0x18d416);});return Promise[_0x366a('0xa3')](_0x4a2fa3);})['then'](function(_0x1ccf47){_0x119280=_0x1ccf47;var _0x2bafe9=_0x134314[_0x366a('0xaa')](_0x119280);return{'count':_0x2bafe9['length'],'rows':_0x2bafe9};})[_0x366a('0x23')](respondWithResult(_0x258b3b,null))[_0x366a('0x47')](function(_0x2a59cb){console[_0x366a('0xa5')]('ServiceNow\x20error:\x20'+_0x2a59cb);var _0x14eae5=_0x2a5a0e[_0x366a('0x31')]['test']?0x1f4:_0x2a59cb[_0x366a('0xab')]||0x1f4;logger[_0x366a('0x25')](_0x2a59cb[_0x366a('0x26')]);delete _0x2a59cb[_0x366a('0x27')];if(_0x14eae5===0x191){_0x14eae5=0x190;}_0x258b3b[_0x366a('0x19')](_0x14eae5)[_0x366a('0x28')](_0x2a5a0e[_0x366a('0x31')]['test']?{'message':_0x366a('0xac'),'statusCode':_0x2a59cb[_0x366a('0xab')]}:_0x2a59cb);});};function createFieldObject(_0x1fe8bc,_0x576ab7,_0xc56468,_0x5a906e,_0x56cb5f,_0xcd34fb){return new Promise(function(_0x1acfe8,_0x5a3804){var _0x3140de={'id':_0x5a906e,'name':_0x56cb5f,'custom':_0xcd34fb};if(_0xc56468===_0x366a('0xad')){_0x3140de[_0x366a('0x45')]=[{'name':_0x366a('0xae'),'value':_0x366a('0xaf')},{'name':'False','value':_0x366a('0xb0')}];_0x1acfe8(_0x3140de);}else{var _0x36c182={'method':_0x366a('0x9c'),'uri':_0x1fe8bc+_0x366a('0xb1')+_0x5a906e,'auth':_0x576ab7,'json':!![]};return rp(_0x36c182)[_0x366a('0x23')](function(_0x1fd2fe){var _0x2bc51f=[];if(_0x1fd2fe[_0x366a('0x9e')][_0x366a('0x37')]>0x0){_0x1fd2fe[_0x366a('0x9e')]['forEach'](function(_0x156e2d){if(_0x156e2d[_0x366a('0xb2')]===_0x366a('0xb0')){var _0xc21d72={'name':_0x156e2d[_0x366a('0xa2')],'value':_0x156e2d[_0x366a('0xb3')]};_0x2bc51f[_0x366a('0xa9')](_0xc21d72);}});}_0x3140de[_0x366a('0x45')]=_0x2bc51f;if(_0x3140de['options'][_0x366a('0x37')]>0x0){_0x1acfe8(_0x3140de);}else{if(_0xcd34fb==![]){_0x1acfe8();}else{_0x1acfe8(_0x3140de);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index dc59f9a..862c160 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 _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3828bb,_0x4745db){var _0xf0a36a=function(_0x39f573){while(--_0x39f573){_0x3828bb['push'](_0x3828bb['shift']());}};_0xf0a36a(++_0x4745db);}(_0x687b,0x14a));var _0xb687=function(_0x3ffadf,_0x47c3b1){_0x3ffadf=_0x3ffadf-0x0;var _0x46223d=_0x687b[_0x3ffadf];return _0x46223d;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd8=['bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0x285986,_0x2d021d){var _0x95e66d=function(_0x3e8b96){while(--_0x3e8b96){_0x285986['push'](_0x285986['shift']());}};_0x95e66d(++_0x2d021d);}(_0x2bd8,0x130));var _0x82bd=function(_0x14b1c1,_0x8bf89e){_0x14b1c1=_0x14b1c1-0x0;var _0x483a75=_0x2bd8[_0x14b1c1];return _0x483a75;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));var integrations=require(_0x82bd('0x9'));module[_0x82bd('0xa')]=function(_0x5ceb60,_0x19dbb1){return _0x5ceb60[_0x82bd('0xb')](_0x82bd('0xc'),attributes,{'tableName':_0x82bd('0xd'),'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 8717978..5cbb2b8 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 _0x379e=['message','result','findAll','options','raw','where','attributes','limit','map','include','model','GetServicenowAccount','catch','ShowServicenowAccount','ServicenowAccount','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c547b,_0x2e1646){var _0x1e7bb1=function(_0x4a23b3){while(--_0x4a23b3){_0x1c547b['push'](_0x1c547b['shift']());}};_0x1e7bb1(++_0x2e1646);}(_0x379e,0x104));var _0xe379=function(_0x2b710a,_0x29b3eb){_0x2b710a=_0x2b710a-0x0;var _0x4ab4c1=_0x379e[_0x2b710a];return _0x4ab4c1;};'use strict';var _=require(_0xe379('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe379('0x1'));var fs=require('fs');var Redis=require(_0xe379('0x2'));var db=require(_0xe379('0x3'))['db'];var utils=require(_0xe379('0x4'));var logger=require(_0xe379('0x5'))(_0xe379('0x6'));var config=require(_0xe379('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe379('0x8')][_0xe379('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x166621,_0x1b6fed,_0x22cb37){return new BPromise(function(_0x5475e7,_0x10acc9){return client[_0xe379('0xa')](_0x166621,_0x22cb37)[_0xe379('0xb')](function(_0x21ce22){logger[_0xe379('0xc')](_0xe379('0xd'),_0x1b6fed,_0xe379('0xe'));logger[_0xe379('0xf')](_0xe379('0x10'),_0x1b6fed,'request\x20sent',JSON[_0xe379('0x11')](_0x21ce22));if(_0x21ce22[_0xe379('0x12')]){if(_0x21ce22[_0xe379('0x12')][_0xe379('0x13')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1b6fed,_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);return _0x10acc9(_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);}logger[_0xe379('0x12')](_0xe379('0xd'),_0x1b6fed,_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);return _0x5475e7(_0x21ce22['error'][_0xe379('0x14')]);}else{logger[_0xe379('0xc')](_0xe379('0xd'),_0x1b6fed,_0xe379('0xe'));_0x5475e7(_0x21ce22[_0xe379('0x15')][_0xe379('0x14')]);}})['catch'](function(_0x2615bd){logger['error'](_0xe379('0xd'),_0x1b6fed,_0x2615bd);_0x10acc9(_0x2615bd);});});}exports['GetServicenowAccount']=function(_0x150d92){var _0x1d63ea=this;return new Promise(function(_0xe4f3d1,_0x373f03){return db['ServicenowAccount'][_0xe379('0x16')]({'raw':_0x150d92[_0xe379('0x17')]?_0x150d92[_0xe379('0x17')][_0xe379('0x18')]===undefined?!![]:![]:!![],'where':_0x150d92[_0xe379('0x17')]?_0x150d92['options'][_0xe379('0x19')]||null:null,'attributes':_0x150d92[_0xe379('0x17')]?_0x150d92['options'][_0xe379('0x1a')]||null:null,'limit':_0x150d92[_0xe379('0x17')]?_0x150d92[_0xe379('0x17')][_0xe379('0x1b')]||null:null,'include':_0x150d92[_0xe379('0x17')]?_0x150d92[_0xe379('0x17')]['include']?_[_0xe379('0x1c')](_0x150d92[_0xe379('0x17')][_0xe379('0x1d')],function(_0x48b543){return{'model':db[_0x48b543[_0xe379('0x1e')]],'as':_0x48b543['as'],'attributes':_0x48b543[_0xe379('0x1a')],'include':_0x48b543['include']?_[_0xe379('0x1c')](_0x48b543[_0xe379('0x1d')],function(_0x4da256){return{'model':db[_0x4da256['model']],'as':_0x4da256['as'],'attributes':_0x4da256[_0xe379('0x1a')],'include':_0x4da256[_0xe379('0x1d')]?_[_0xe379('0x1c')](_0x4da256['include'],function(_0x17ba51){return{'model':db[_0x17ba51[_0xe379('0x1e')]],'as':_0x17ba51['as'],'attributes':_0x17ba51[_0xe379('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe379('0xb')](function(_0x4ac753){logger[_0xe379('0xc')](_0xe379('0x1f'),_0x150d92);logger[_0xe379('0xf')]('GetServicenowAccount',_0x150d92,JSON[_0xe379('0x11')](_0x4ac753));_0xe4f3d1(_0x4ac753);})[_0xe379('0x20')](function(_0x5d9ca1){logger[_0xe379('0x12')]('GetServicenowAccount',_0x5d9ca1[_0xe379('0x14')],_0x150d92);_0x373f03(_0x1d63ea['error'](0x1f4,_0x5d9ca1[_0xe379('0x14')]));});});};exports[_0xe379('0x21')]=function(_0x3ca387){var _0x12bd00=this;return new Promise(function(_0x18a25e,_0x14d36b){return db[_0xe379('0x22')]['find']({'raw':_0x3ca387[_0xe379('0x17')]?_0x3ca387[_0xe379('0x17')][_0xe379('0x18')]===undefined?!![]:![]:!![],'where':_0x3ca387['options']?_0x3ca387[_0xe379('0x17')]['where']||null:null,'attributes':_0x3ca387['options']?_0x3ca387[_0xe379('0x17')][_0xe379('0x1a')]||null:null,'include':_0x3ca387[_0xe379('0x17')]?_0x3ca387[_0xe379('0x17')]['include']?_[_0xe379('0x1c')](_0x3ca387[_0xe379('0x17')]['include'],function(_0x361a49){return{'model':db[_0x361a49[_0xe379('0x1e')]],'as':_0x361a49['as'],'attributes':_0x361a49[_0xe379('0x1a')],'include':_0x361a49[_0xe379('0x1d')]?_['map'](_0x361a49[_0xe379('0x1d')],function(_0x5936ec){return{'model':db[_0x5936ec[_0xe379('0x1e')]],'as':_0x5936ec['as'],'attributes':_0x5936ec[_0xe379('0x1a')],'include':_0x5936ec[_0xe379('0x1d')]?_[_0xe379('0x1c')](_0x5936ec[_0xe379('0x1d')],function(_0x54aa53){return{'model':db[_0x54aa53[_0xe379('0x1e')]],'as':_0x54aa53['as'],'attributes':_0x54aa53['attributes']};}):[]};}):[]};}):[]:[]})[_0xe379('0xb')](function(_0x199e28){logger[_0xe379('0xc')]('ShowServicenowAccount',_0x3ca387);logger[_0xe379('0xf')](_0xe379('0x21'),_0x3ca387,JSON[_0xe379('0x11')](_0x199e28));_0x18a25e(_0x199e28);})[_0xe379('0x20')](function(_0x5d93b9){logger[_0xe379('0x12')]('ShowServicenowAccount',_0x5d93b9[_0xe379('0x14')],_0x3ca387);_0x14d36b(_0x12bd00[_0xe379('0x12')](0x1f4,_0x5d93b9[_0xe379('0x14')]));});});}; \ No newline at end of file +var _0x7d4f=['limit','include','map','model','catch','ShowServicenowAccount','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','GetServicenowAccount','findAll','options','where','attributes'];(function(_0x54d2ab,_0x4e3a82){var _0x5cea2b=function(_0x4f09be){while(--_0x4f09be){_0x54d2ab['push'](_0x54d2ab['shift']());}};_0x5cea2b(++_0x4e3a82);}(_0x7d4f,0x167));var _0xf7d4=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0x7d4f[_0xadc7d9];return _0x915ca1;};'use strict';var _=require(_0xf7d4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf7d4('0x1'));var rs=require(_0xf7d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d4('0x3'))['db'];var utils=require(_0xf7d4('0x4'));var logger=require(_0xf7d4('0x5'))(_0xf7d4('0x6'));var config=require(_0xf7d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7d4('0x8')][_0xf7d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24bb5a,_0x44fd45,_0x5b50a9){return new BPromise(function(_0x5e795f,_0x358e85){return client[_0xf7d4('0xa')](_0x24bb5a,_0x5b50a9)[_0xf7d4('0xb')](function(_0x4305a0){logger[_0xf7d4('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x44fd45,_0xf7d4('0xd'));logger[_0xf7d4('0xe')](_0xf7d4('0xf'),_0x44fd45,_0xf7d4('0xd'),JSON[_0xf7d4('0x10')](_0x4305a0));if(_0x4305a0[_0xf7d4('0x11')]){if(_0x4305a0[_0xf7d4('0x11')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x44fd45,_0x4305a0[_0xf7d4('0x11')][_0xf7d4('0x12')]);return _0x358e85(_0x4305a0[_0xf7d4('0x11')]['message']);}logger['error'](_0xf7d4('0x13'),_0x44fd45,_0x4305a0[_0xf7d4('0x11')][_0xf7d4('0x12')]);return _0x5e795f(_0x4305a0[_0xf7d4('0x11')]['message']);}else{logger[_0xf7d4('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x44fd45,'request\x20sent');_0x5e795f(_0x4305a0['result'][_0xf7d4('0x12')]);}})['catch'](function(_0x12c4d4){logger['error'](_0xf7d4('0x13'),_0x44fd45,_0x12c4d4);_0x358e85(_0x12c4d4);});});}exports[_0xf7d4('0x14')]=function(_0x50ce69){var _0xd6af76=this;return new Promise(function(_0x21ba43,_0x3f3e7d){return db['ServicenowAccount'][_0xf7d4('0x15')]({'raw':_0x50ce69[_0xf7d4('0x16')]?_0x50ce69[_0xf7d4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x50ce69['options']?_0x50ce69[_0xf7d4('0x16')][_0xf7d4('0x17')]||null:null,'attributes':_0x50ce69['options']?_0x50ce69[_0xf7d4('0x16')][_0xf7d4('0x18')]||null:null,'limit':_0x50ce69['options']?_0x50ce69[_0xf7d4('0x16')][_0xf7d4('0x19')]||null:null,'include':_0x50ce69[_0xf7d4('0x16')]?_0x50ce69[_0xf7d4('0x16')][_0xf7d4('0x1a')]?_[_0xf7d4('0x1b')](_0x50ce69[_0xf7d4('0x16')]['include'],function(_0x403fc3){return{'model':db[_0x403fc3['model']],'as':_0x403fc3['as'],'attributes':_0x403fc3[_0xf7d4('0x18')],'include':_0x403fc3['include']?_[_0xf7d4('0x1b')](_0x403fc3[_0xf7d4('0x1a')],function(_0xf531b7){return{'model':db[_0xf531b7[_0xf7d4('0x1c')]],'as':_0xf531b7['as'],'attributes':_0xf531b7[_0xf7d4('0x18')],'include':_0xf531b7[_0xf7d4('0x1a')]?_[_0xf7d4('0x1b')](_0xf531b7['include'],function(_0x119d39){return{'model':db[_0x119d39['model']],'as':_0x119d39['as'],'attributes':_0x119d39['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7d4('0xb')](function(_0xb23b0){logger[_0xf7d4('0xc')](_0xf7d4('0x14'),_0x50ce69);logger['debug'](_0xf7d4('0x14'),_0x50ce69,JSON[_0xf7d4('0x10')](_0xb23b0));_0x21ba43(_0xb23b0);})[_0xf7d4('0x1d')](function(_0x2a583f){logger[_0xf7d4('0x11')](_0xf7d4('0x14'),_0x2a583f['message'],_0x50ce69);_0x3f3e7d(_0xd6af76['error'](0x1f4,_0x2a583f[_0xf7d4('0x12')]));});});};exports[_0xf7d4('0x1e')]=function(_0x1425ea){var _0x1f4c47=this;return new Promise(function(_0x6cc818,_0xcff2c0){return db['ServicenowAccount']['find']({'raw':_0x1425ea[_0xf7d4('0x16')]?_0x1425ea['options'][_0xf7d4('0x1f')]===undefined?!![]:![]:!![],'where':_0x1425ea[_0xf7d4('0x16')]?_0x1425ea[_0xf7d4('0x16')][_0xf7d4('0x17')]||null:null,'attributes':_0x1425ea['options']?_0x1425ea[_0xf7d4('0x16')][_0xf7d4('0x18')]||null:null,'include':_0x1425ea[_0xf7d4('0x16')]?_0x1425ea[_0xf7d4('0x16')][_0xf7d4('0x1a')]?_[_0xf7d4('0x1b')](_0x1425ea[_0xf7d4('0x16')][_0xf7d4('0x1a')],function(_0x6633d0){return{'model':db[_0x6633d0[_0xf7d4('0x1c')]],'as':_0x6633d0['as'],'attributes':_0x6633d0[_0xf7d4('0x18')],'include':_0x6633d0['include']?_[_0xf7d4('0x1b')](_0x6633d0[_0xf7d4('0x1a')],function(_0xf19685){return{'model':db[_0xf19685['model']],'as':_0xf19685['as'],'attributes':_0xf19685[_0xf7d4('0x18')],'include':_0xf19685[_0xf7d4('0x1a')]?_[_0xf7d4('0x1b')](_0xf19685[_0xf7d4('0x1a')],function(_0x4b76e7){return{'model':db[_0x4b76e7[_0xf7d4('0x1c')]],'as':_0x4b76e7['as'],'attributes':_0x4b76e7[_0xf7d4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf7d4('0xb')](function(_0x7361bd){logger[_0xf7d4('0xc')](_0xf7d4('0x1e'),_0x1425ea);logger[_0xf7d4('0xe')](_0xf7d4('0x1e'),_0x1425ea,JSON[_0xf7d4('0x10')](_0x7361bd));_0x6cc818(_0x7361bd);})['catch'](function(_0xfb4360){logger['error']('ShowServicenowAccount',_0xfb4360[_0xf7d4('0x12')],_0x1425ea);_0xcff2c0(_0x1f4c47[_0xf7d4('0x11')](0x1f4,_0xfb4360[_0xf7d4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d16aa2d..69184ef 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 _0x75d5=['/:id','destroy','util','express','Router','../../components/auth/service','get','isAuthenticated','show','getFields','/:id/descriptions','getDescriptions','post','create'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x75d5,0xaa));var _0x575d=function(_0x2da071,_0x4a09d7){_0x2da071=_0x2da071-0x0;var _0x106846=_0x75d5[_0x2da071];return _0x106846;};'use strict';var multer=require('multer');var util=require(_0x575d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x575d('0x1'));var router=express[_0x575d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x575d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x575d('0x4')]('/',auth[_0x575d('0x5')](),controller['index']);router[_0x575d('0x4')]('/:id',auth[_0x575d('0x5')](),controller[_0x575d('0x6')]);router[_0x575d('0x4')]('/:id/fields',auth[_0x575d('0x5')](),controller[_0x575d('0x7')]);router[_0x575d('0x4')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x575d('0x4')](_0x575d('0x8'),auth[_0x575d('0x5')](),controller[_0x575d('0x9')]);router[_0x575d('0xa')]('/',auth[_0x575d('0x5')](),controller[_0x575d('0xb')]);router['put'](_0x575d('0xc'),auth[_0x575d('0x5')](),controller['update']);router['delete'](_0x575d('0xc'),auth[_0x575d('0x5')](),controller[_0x575d('0xd')]);module['exports']=router; \ No newline at end of file +var _0x11e9=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','path'];(function(_0x317257,_0x1677dc){var _0x1f235d=function(_0xda0ccf){while(--_0xda0ccf){_0x317257['push'](_0x317257['shift']());}};_0x1f235d(++_0x1677dc);}(_0x11e9,0x9f));var _0x911e=function(_0x35b275,_0x3e612a){_0x35b275=_0x35b275-0x0;var _0x4c6e5f=_0x11e9[_0x35b275];return _0x4c6e5f;};'use strict';var multer=require(_0x911e('0x0'));var util=require('util');var path=require(_0x911e('0x1'));var timeout=require(_0x911e('0x2'));var express=require('express');var router=express[_0x911e('0x3')]();var fs_extra=require(_0x911e('0x4'));var auth=require(_0x911e('0x5'));var interaction=require(_0x911e('0x6'));var config=require(_0x911e('0x7'));var controller=require(_0x911e('0x8'));router[_0x911e('0x9')]('/',auth[_0x911e('0xa')](),controller[_0x911e('0xb')]);router['get'](_0x911e('0xc'),auth[_0x911e('0xa')](),controller[_0x911e('0xd')]);router[_0x911e('0x9')](_0x911e('0xe'),auth[_0x911e('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x911e('0xf')]);router[_0x911e('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x911e('0x10')]);router['post']('/',auth[_0x911e('0xa')](),controller[_0x911e('0x11')]);router[_0x911e('0x12')](_0x911e('0xc'),auth[_0x911e('0xa')](),controller[_0x911e('0x13')]);router[_0x911e('0x14')]('/:id',auth[_0x911e('0xa')](),controller[_0x911e('0x15')]);module[_0x911e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 04b3bf8..b1100cd 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 _0x42e6=['STRING','exports'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x42e6,0x91));var _0x642e=function(_0x3f1557,_0x53e3f6){_0x3f1557=_0x3f1557-0x0;var _0x545a93=_0x42e6[_0x3f1557];return _0x545a93;};'use strict';var Sequelize=require('sequelize');module[_0x642e('0x0')]={'name':{'type':Sequelize[_0x642e('0x1')]},'description':{'type':Sequelize[_0x642e('0x1')]}}; \ No newline at end of file +var _0x31ea=['exports','STRING'];(function(_0x5e96ee,_0x1b2097){var _0x141ad7=function(_0x25ea7f){while(--_0x25ea7f){_0x5e96ee['push'](_0x5e96ee['shift']());}};_0x141ad7(++_0x1b2097);}(_0x31ea,0x1e4));var _0xa31e=function(_0x344b64,_0x357e97){_0x344b64=_0x344b64-0x0;var _0x4c5eb5=_0x31ea[_0x344b64];return _0x4c5eb5;};'use strict';var Sequelize=require('sequelize');module[_0xa31e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa31e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 858a21a..652d058 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 _0xe320=['ServicenowField','rawAttributes','pick','nolimit','getSubjects','getDescriptions','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowConfiguration','fieldName','type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','body','find','params','getFields','findOne'];(function(_0x592f09,_0x42248a){var _0x3eb7ef=function(_0x46230f){while(--_0x46230f){_0x592f09['push'](_0x592f09['shift']());}};_0x3eb7ef(++_0x42248a);}(_0xe320,0x1f2));var _0x0e32=function(_0x1c4cf4,_0x5dd363){_0x1c4cf4=_0x1c4cf4-0x0;var _0x13a8e9=_0xe320[_0x1c4cf4];return _0x13a8e9;};'use strict';var emlformat=require(_0x0e32('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e32('0x1'));var rp=require(_0x0e32('0x2'));var moment=require(_0x0e32('0x3'));var BPromise=require(_0x0e32('0x4'));var Mustache=require(_0x0e32('0x5'));var util=require(_0x0e32('0x6'));var path=require(_0x0e32('0x7'));var sox=require('sox');var csv=require(_0x0e32('0x8'));var ejs=require(_0x0e32('0x9'));var fs=require('fs');var fs_extra=require(_0x0e32('0xa'));var _=require(_0x0e32('0xb'));var squel=require(_0x0e32('0xc'));var crypto=require(_0x0e32('0xd'));var jsforce=require(_0x0e32('0xe'));var deskjs=require(_0x0e32('0xf'));var toCsv=require(_0x0e32('0x8'));var querystring=require(_0x0e32('0x10'));var Papa=require(_0x0e32('0x11'));var Redis=require(_0x0e32('0x12'));var authService=require(_0x0e32('0x13'));var qs=require(_0x0e32('0x14'));var as=require(_0x0e32('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e32('0x16'))(_0x0e32('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0e32('0x18'))['db'];function respondWithStatusCode(_0x3b8484,_0x2f5d91){_0x2f5d91=_0x2f5d91||0xcc;return function(_0x2c7403){if(_0x2c7403){return _0x3b8484[_0x0e32('0x19')](_0x2f5d91);}return _0x3b8484['status'](_0x2f5d91)[_0x0e32('0x1a')]();};}function respondWithResult(_0x18fb56,_0x2598f4){_0x2598f4=_0x2598f4||0xc8;return function(_0x442165){if(_0x442165){return _0x18fb56[_0x0e32('0x1b')](_0x2598f4)[_0x0e32('0x1c')](_0x442165);}};}function respondWithFilteredResult(_0x3d752e,_0x461164){return function(_0x523d0c){if(_0x523d0c){var _0x511419=typeof _0x461164[_0x0e32('0x1d')]===_0x0e32('0x1e')&&typeof _0x461164['limit']==='undefined';var _0x518ffe=_0x523d0c[_0x0e32('0x1f')];var _0x1a59a5=_0x511419?0x0:_0x461164['offset'];var _0x544b4=_0x511419?_0x523d0c[_0x0e32('0x1f')]:_0x461164[_0x0e32('0x1d')]+_0x461164[_0x0e32('0x20')];var _0x4bf0e9;if(_0x544b4>=_0x518ffe){_0x544b4=_0x518ffe;_0x4bf0e9=0xc8;}else{_0x4bf0e9=0xce;}_0x3d752e[_0x0e32('0x1b')](_0x4bf0e9);return _0x3d752e[_0x0e32('0x21')](_0x0e32('0x22'),_0x1a59a5+'-'+_0x544b4+'/'+_0x518ffe)['json'](_0x523d0c);}return null;};}function patchUpdates(_0x2975b1){return function(_0x27273a){try{jsonpatch[_0x0e32('0x23')](_0x27273a,_0x2975b1,!![]);}catch(_0x2f1b9b){return BPromise[_0x0e32('0x24')](_0x2f1b9b);}return _0x27273a[_0x0e32('0x25')]();};}function saveUpdates(_0x429122,_0x188b84){return function(_0x1f14f2){if(_0x1f14f2){return _0x1f14f2[_0x0e32('0x26')](_0x429122)[_0x0e32('0x27')](function(_0x80f88e){return _0x80f88e;});}return null;};}function removeEntity(_0x2f60eb,_0x3d245c){return function(_0x5b7d6b){if(_0x5b7d6b){return _0x5b7d6b[_0x0e32('0x28')]()[_0x0e32('0x27')](function(){_0x2f60eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x395acc,_0xcb2eb3){return function(_0x259890){if(!_0x259890){_0x395acc[_0x0e32('0x19')](0x194);}return _0x259890;};}function handleError(_0x784f52,_0x4ca773){_0x4ca773=_0x4ca773||0x1f4;return function(_0x456e40){logger[_0x0e32('0x29')](_0x456e40[_0x0e32('0x2a')]);if(_0x456e40[_0x0e32('0x2b')]){delete _0x456e40[_0x0e32('0x2b')];}_0x784f52['status'](_0x4ca773)[_0x0e32('0x2c')](_0x456e40);};}exports['index']=function(_0x2b614a,_0x5ec083){var _0x3070f2={},_0x2f562f={},_0x271991={'count':0x0,'rows':[]};var _0x52b3ea=_[_0x0e32('0x2d')](db[_0x0e32('0x2e')]['rawAttributes'],function(_0x3f8e43){return{'name':_0x3f8e43[_0x0e32('0x2f')],'type':_0x3f8e43[_0x0e32('0x30')][_0x0e32('0x31')]};});_0x2f562f['model']=_[_0x0e32('0x2d')](_0x52b3ea,_0x0e32('0x2b'));_0x2f562f[_0x0e32('0x32')]=_[_0x0e32('0x33')](_0x2b614a[_0x0e32('0x32')]);_0x2f562f['filters']=_[_0x0e32('0x34')](_0x2f562f['model'],_0x2f562f['query']);_0x3070f2[_0x0e32('0x35')]=_[_0x0e32('0x34')](_0x2f562f[_0x0e32('0x36')],qs['fields'](_0x2b614a['query'][_0x0e32('0x37')]));_0x3070f2[_0x0e32('0x35')]=_0x3070f2[_0x0e32('0x35')]['length']?_0x3070f2[_0x0e32('0x35')]:_0x2f562f[_0x0e32('0x36')];if(!_0x2b614a[_0x0e32('0x32')][_0x0e32('0x38')]('nolimit')){_0x3070f2[_0x0e32('0x20')]=qs[_0x0e32('0x20')](_0x2b614a[_0x0e32('0x32')][_0x0e32('0x20')]);_0x3070f2['offset']=qs[_0x0e32('0x1d')](_0x2b614a[_0x0e32('0x32')][_0x0e32('0x1d')]);}_0x3070f2[_0x0e32('0x39')]=qs[_0x0e32('0x3a')](_0x2b614a[_0x0e32('0x32')]['sort']);_0x3070f2[_0x0e32('0x3b')]=qs[_0x0e32('0x3c')](_['pick'](_0x2b614a[_0x0e32('0x32')],_0x2f562f[_0x0e32('0x3c')]),_0x52b3ea);if(_0x2b614a['query'][_0x0e32('0x3d')]){_0x3070f2['where']=_[_0x0e32('0x3e')](_0x3070f2[_0x0e32('0x3b')],{'$or':_[_0x0e32('0x2d')](_0x52b3ea,function(_0x182d42){if(_0x182d42['type']!==_0x0e32('0x3f')){var _0x5b1bd8={};_0x5b1bd8[_0x182d42[_0x0e32('0x2b')]]={'$like':'%'+_0x2b614a[_0x0e32('0x32')]['filter']+'%'};return _0x5b1bd8;}})});}_0x3070f2=_[_0x0e32('0x3e')]({},_0x3070f2,_0x2b614a[_0x0e32('0x40')]);var _0x52f1de={'where':_0x3070f2[_0x0e32('0x3b')]};return db[_0x0e32('0x2e')][_0x0e32('0x1f')](_0x52f1de)[_0x0e32('0x27')](function(_0x1c97f2){_0x271991[_0x0e32('0x1f')]=_0x1c97f2;if(_0x2b614a[_0x0e32('0x32')][_0x0e32('0x41')]){_0x3070f2[_0x0e32('0x42')]=[{'all':!![]}];}return db[_0x0e32('0x2e')][_0x0e32('0x43')](_0x3070f2);})[_0x0e32('0x27')](function(_0x1954ab){_0x271991['rows']=_0x1954ab;return _0x271991;})[_0x0e32('0x27')](respondWithFilteredResult(_0x5ec083,_0x3070f2))[_0x0e32('0x44')](handleError(_0x5ec083,null));};exports[_0x0e32('0x45')]=function(_0x3ed48e,_0x42ff5c){var _0x499f51={'raw':![],'where':{'id':_0x3ed48e['params']['id']}},_0x559200={};_0x559200[_0x0e32('0x36')]=_[_0x0e32('0x33')](db[_0x0e32('0x2e')]['rawAttributes']);_0x559200[_0x0e32('0x32')]=_[_0x0e32('0x33')](_0x3ed48e[_0x0e32('0x32')]);_0x559200[_0x0e32('0x3c')]=_['intersection'](_0x559200[_0x0e32('0x36')],_0x559200['query']);_0x499f51['attributes']=_['intersection'](_0x559200[_0x0e32('0x36')],qs[_0x0e32('0x37')](_0x3ed48e[_0x0e32('0x32')]['fields']));_0x499f51[_0x0e32('0x35')]=_0x499f51[_0x0e32('0x35')][_0x0e32('0x46')]?_0x499f51[_0x0e32('0x35')]:_0x559200['model'];if(_0x3ed48e['query'][_0x0e32('0x41')]){_0x499f51['include']=[{'all':!![]}];}_0x499f51=_[_0x0e32('0x3e')]({},_0x499f51,_0x3ed48e[_0x0e32('0x40')]);return db[_0x0e32('0x2e')]['find'](_0x499f51)[_0x0e32('0x27')](handleEntityNotFound(_0x42ff5c,null))[_0x0e32('0x27')](respondWithResult(_0x42ff5c,null))[_0x0e32('0x44')](handleError(_0x42ff5c,null));};exports['create']=function(_0x34e649,_0x322966){return db[_0x0e32('0x2e')]['create'](_0x34e649[_0x0e32('0x47')],{})[_0x0e32('0x27')](respondWithResult(_0x322966,0xc9))[_0x0e32('0x44')](handleError(_0x322966,null));};exports[_0x0e32('0x26')]=function(_0x3d287b,_0x4b4a00){if(_0x3d287b[_0x0e32('0x47')]['id']){delete _0x3d287b[_0x0e32('0x47')]['id'];}return db[_0x0e32('0x2e')][_0x0e32('0x48')]({'where':{'id':_0x3d287b[_0x0e32('0x49')]['id']}})[_0x0e32('0x27')](handleEntityNotFound(_0x4b4a00,null))[_0x0e32('0x27')](saveUpdates(_0x3d287b[_0x0e32('0x47')],null))[_0x0e32('0x27')](respondWithResult(_0x4b4a00,null))[_0x0e32('0x44')](handleError(_0x4b4a00,null));};exports['destroy']=function(_0x3f890b,_0x547b13){return db[_0x0e32('0x2e')][_0x0e32('0x48')]({'where':{'id':_0x3f890b[_0x0e32('0x49')]['id']}})['then'](handleEntityNotFound(_0x547b13,null))[_0x0e32('0x27')](removeEntity(_0x547b13,null))[_0x0e32('0x44')](handleError(_0x547b13,null));};exports[_0x0e32('0x4a')]=function(_0x44b4f5,_0x36e83f,_0xe5736){var _0x1ae31d={};var _0x4a5c66={};var _0x1141fc;var _0x31376f;return db[_0x0e32('0x2e')][_0x0e32('0x4b')]({'where':{'id':_0x44b4f5['params']['id']}})[_0x0e32('0x27')](handleEntityNotFound(_0x36e83f,null))[_0x0e32('0x27')](function(_0x191f0f){if(_0x191f0f){_0x1141fc=_0x191f0f;_0x4a5c66[_0x0e32('0x36')]=_['keys'](db[_0x0e32('0x4c')][_0x0e32('0x4d')]);_0x4a5c66[_0x0e32('0x32')]=_[_0x0e32('0x33')](_0x44b4f5[_0x0e32('0x32')]);_0x4a5c66[_0x0e32('0x3c')]=_[_0x0e32('0x34')](_0x4a5c66[_0x0e32('0x36')],_0x4a5c66[_0x0e32('0x32')]);_0x1ae31d[_0x0e32('0x35')]=_['intersection'](_0x4a5c66[_0x0e32('0x36')],qs[_0x0e32('0x37')](_0x44b4f5[_0x0e32('0x32')][_0x0e32('0x37')]));_0x1ae31d[_0x0e32('0x35')]=_0x1ae31d[_0x0e32('0x35')]['length']?_0x1ae31d[_0x0e32('0x35')]:_0x4a5c66['model'];_0x1ae31d['order']=qs[_0x0e32('0x3a')](_0x44b4f5[_0x0e32('0x32')]['sort']);_0x1ae31d[_0x0e32('0x3b')]=qs[_0x0e32('0x3c')](_[_0x0e32('0x4e')](_0x44b4f5[_0x0e32('0x32')],_0x4a5c66['filters']));if(_0x44b4f5[_0x0e32('0x32')][_0x0e32('0x3d')]){_0x1ae31d[_0x0e32('0x3b')]=_['merge'](_0x1ae31d[_0x0e32('0x3b')],{'$or':_[_0x0e32('0x2d')](_0x1ae31d[_0x0e32('0x35')],function(_0x24f336){var _0x28db02={};_0x28db02[_0x24f336]={'$like':'%'+_0x44b4f5['query'][_0x0e32('0x3d')]+'%'};return _0x28db02;})});}_0x1ae31d=_[_0x0e32('0x3e')]({},_0x1ae31d,_0x44b4f5[_0x0e32('0x40')]);return _0x1141fc[_0x0e32('0x4a')](_0x1ae31d);}})[_0x0e32('0x27')](function(_0x4f8ff3){if(_0x4f8ff3){_0x31376f=_0x4f8ff3[_0x0e32('0x46')];if(!_0x44b4f5[_0x0e32('0x32')][_0x0e32('0x38')]('nolimit')){_0x1ae31d['limit']=qs[_0x0e32('0x20')](_0x44b4f5['query']['limit']);_0x1ae31d['offset']=qs[_0x0e32('0x1d')](_0x44b4f5['query'][_0x0e32('0x1d')]);}return _0x1141fc[_0x0e32('0x4a')](_0x1ae31d);}})['then'](function(_0x3a7f95){if(_0x3a7f95){return _0x3a7f95?{'count':_0x31376f,'rows':_0x3a7f95}:null;}})[_0x0e32('0x27')](respondWithResult(_0x36e83f,null))[_0x0e32('0x44')](handleError(_0x36e83f,null));};exports['getSubjects']=function(_0x583239,_0x416003,_0x35ad1c){var _0x15ad42={};var _0x512464={};var _0x47b697;var _0x268614;return db[_0x0e32('0x2e')]['findOne']({'where':{'id':_0x583239[_0x0e32('0x49')]['id']}})[_0x0e32('0x27')](handleEntityNotFound(_0x416003,null))[_0x0e32('0x27')](function(_0x45587c){if(_0x45587c){_0x47b697=_0x45587c;_0x512464[_0x0e32('0x36')]=_[_0x0e32('0x33')](db['ServicenowField']['rawAttributes']);_0x512464[_0x0e32('0x32')]=_[_0x0e32('0x33')](_0x583239[_0x0e32('0x32')]);_0x512464[_0x0e32('0x3c')]=_[_0x0e32('0x34')](_0x512464[_0x0e32('0x36')],_0x512464['query']);_0x15ad42[_0x0e32('0x35')]=_[_0x0e32('0x34')](_0x512464['model'],qs[_0x0e32('0x37')](_0x583239['query'][_0x0e32('0x37')]));_0x15ad42[_0x0e32('0x35')]=_0x15ad42['attributes'][_0x0e32('0x46')]?_0x15ad42[_0x0e32('0x35')]:_0x512464['model'];_0x15ad42[_0x0e32('0x39')]=qs['sort'](_0x583239['query']['sort']);_0x15ad42[_0x0e32('0x3b')]=qs[_0x0e32('0x3c')](_[_0x0e32('0x4e')](_0x583239[_0x0e32('0x32')],_0x512464['filters']));if(_0x583239['query'][_0x0e32('0x3d')]){_0x15ad42['where']=_['merge'](_0x15ad42[_0x0e32('0x3b')],{'$or':_[_0x0e32('0x2d')](_0x15ad42['attributes'],function(_0xea0f2c){var _0x49e82c={};_0x49e82c[_0xea0f2c]={'$like':'%'+_0x583239[_0x0e32('0x32')][_0x0e32('0x3d')]+'%'};return _0x49e82c;})});}_0x15ad42=_['merge']({},_0x15ad42,_0x583239[_0x0e32('0x40')]);return _0x47b697['getSubjects'](_0x15ad42);}})[_0x0e32('0x27')](function(_0x34051f){if(_0x34051f){_0x268614=_0x34051f['length'];if(!_0x583239[_0x0e32('0x32')][_0x0e32('0x38')](_0x0e32('0x4f'))){_0x15ad42['limit']=qs[_0x0e32('0x20')](_0x583239[_0x0e32('0x32')][_0x0e32('0x20')]);_0x15ad42['offset']=qs['offset'](_0x583239[_0x0e32('0x32')][_0x0e32('0x1d')]);}return _0x47b697[_0x0e32('0x50')](_0x15ad42);}})[_0x0e32('0x27')](function(_0x4e4d3a){if(_0x4e4d3a){return _0x4e4d3a?{'count':_0x268614,'rows':_0x4e4d3a}:null;}})[_0x0e32('0x27')](respondWithResult(_0x416003,null))[_0x0e32('0x44')](handleError(_0x416003,null));};exports[_0x0e32('0x51')]=function(_0x2f7e04,_0x139c35,_0x7943d1){var _0x74917d={};var _0x2f145d={};var _0x490b95;var _0x1d2c9a;return db['ServicenowConfiguration'][_0x0e32('0x4b')]({'where':{'id':_0x2f7e04['params']['id']}})['then'](handleEntityNotFound(_0x139c35,null))[_0x0e32('0x27')](function(_0x2afa65){if(_0x2afa65){_0x490b95=_0x2afa65;_0x2f145d[_0x0e32('0x36')]=_[_0x0e32('0x33')](db[_0x0e32('0x4c')][_0x0e32('0x4d')]);_0x2f145d[_0x0e32('0x32')]=_['keys'](_0x2f7e04[_0x0e32('0x32')]);_0x2f145d[_0x0e32('0x3c')]=_['intersection'](_0x2f145d[_0x0e32('0x36')],_0x2f145d['query']);_0x74917d[_0x0e32('0x35')]=_[_0x0e32('0x34')](_0x2f145d[_0x0e32('0x36')],qs[_0x0e32('0x37')](_0x2f7e04[_0x0e32('0x32')][_0x0e32('0x37')]));_0x74917d['attributes']=_0x74917d[_0x0e32('0x35')][_0x0e32('0x46')]?_0x74917d[_0x0e32('0x35')]:_0x2f145d[_0x0e32('0x36')];_0x74917d[_0x0e32('0x39')]=qs[_0x0e32('0x3a')](_0x2f7e04[_0x0e32('0x32')][_0x0e32('0x3a')]);_0x74917d[_0x0e32('0x3b')]=qs[_0x0e32('0x3c')](_[_0x0e32('0x4e')](_0x2f7e04[_0x0e32('0x32')],_0x2f145d[_0x0e32('0x3c')]));if(_0x2f7e04['query'][_0x0e32('0x3d')]){_0x74917d['where']=_['merge'](_0x74917d[_0x0e32('0x3b')],{'$or':_[_0x0e32('0x2d')](_0x74917d[_0x0e32('0x35')],function(_0x7e291a){var _0x374c39={};_0x374c39[_0x7e291a]={'$like':'%'+_0x2f7e04[_0x0e32('0x32')][_0x0e32('0x3d')]+'%'};return _0x374c39;})});}_0x74917d=_[_0x0e32('0x3e')]({},_0x74917d,_0x2f7e04[_0x0e32('0x40')]);return _0x490b95['getDescriptions'](_0x74917d);}})[_0x0e32('0x27')](function(_0x343fb3){if(_0x343fb3){_0x1d2c9a=_0x343fb3[_0x0e32('0x46')];if(!_0x2f7e04[_0x0e32('0x32')]['hasOwnProperty'](_0x0e32('0x4f'))){_0x74917d['limit']=qs['limit'](_0x2f7e04[_0x0e32('0x32')]['limit']);_0x74917d[_0x0e32('0x1d')]=qs[_0x0e32('0x1d')](_0x2f7e04[_0x0e32('0x32')][_0x0e32('0x1d')]);}return _0x490b95['getDescriptions'](_0x74917d);}})[_0x0e32('0x27')](function(_0x57acb4){if(_0x57acb4){return _0x57acb4?{'count':_0x1d2c9a,'rows':_0x57acb4}:null;}})[_0x0e32('0x27')](respondWithResult(_0x139c35,null))[_0x0e32('0x44')](handleError(_0x139c35,null));}; \ No newline at end of file +var _0x1ad4=['create','body','destroy','getFields','hasOwnProperty','getSubjects','ServicenowField','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x4613f4,_0x31681b){var _0xbf5e11=function(_0x37e2b3){while(--_0x37e2b3){_0x4613f4['push'](_0x4613f4['shift']());}};_0xbf5e11(++_0x31681b);}(_0x1ad4,0xac));var _0x41ad=function(_0x22f67c,_0x4e8f91){_0x22f67c=_0x22f67c-0x0;var _0x270d5a=_0x1ad4[_0x22f67c];return _0x270d5a;};'use strict';var emlformat=require(_0x41ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41ad('0x2'));var moment=require(_0x41ad('0x3'));var BPromise=require(_0x41ad('0x4'));var Mustache=require(_0x41ad('0x5'));var util=require(_0x41ad('0x6'));var path=require('path');var sox=require(_0x41ad('0x7'));var csv=require('to-csv');var ejs=require(_0x41ad('0x8'));var fs=require('fs');var fs_extra=require(_0x41ad('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x41ad('0xa'));var deskjs=require(_0x41ad('0xb'));var toCsv=require(_0x41ad('0xc'));var querystring=require(_0x41ad('0xd'));var Papa=require(_0x41ad('0xe'));var Redis=require(_0x41ad('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x41ad('0x10'));var as=require(_0x41ad('0x11'));var hardwareService=require(_0x41ad('0x12'));var logger=require(_0x41ad('0x13'))(_0x41ad('0x14'));var utils=require(_0x41ad('0x15'));var config=require(_0x41ad('0x16'));var licenseUtil=require(_0x41ad('0x17'));var db=require(_0x41ad('0x18'))['db'];function respondWithStatusCode(_0x5ac405,_0x13aa70){_0x13aa70=_0x13aa70||0xcc;return function(_0x1df3de){if(_0x1df3de){return _0x5ac405[_0x41ad('0x19')](_0x13aa70);}return _0x5ac405[_0x41ad('0x1a')](_0x13aa70)[_0x41ad('0x1b')]();};}function respondWithResult(_0x26f386,_0x5f4a1d){_0x5f4a1d=_0x5f4a1d||0xc8;return function(_0xf4dc71){if(_0xf4dc71){return _0x26f386[_0x41ad('0x1a')](_0x5f4a1d)[_0x41ad('0x1c')](_0xf4dc71);}};}function respondWithFilteredResult(_0x153f6c,_0xd2c43){return function(_0x4d3ab2){if(_0x4d3ab2){var _0x5524ea=typeof _0xd2c43[_0x41ad('0x1d')]===_0x41ad('0x1e')&&typeof _0xd2c43['limit']==='undefined';var _0x1731f7=_0x4d3ab2['count'];var _0x36124d=_0x5524ea?0x0:_0xd2c43[_0x41ad('0x1d')];var _0x27e15e=_0x5524ea?_0x4d3ab2[_0x41ad('0x1f')]:_0xd2c43['offset']+_0xd2c43[_0x41ad('0x20')];var _0x20f7d0;if(_0x27e15e>=_0x1731f7){_0x27e15e=_0x1731f7;_0x20f7d0=0xc8;}else{_0x20f7d0=0xce;}_0x153f6c[_0x41ad('0x1a')](_0x20f7d0);return _0x153f6c[_0x41ad('0x21')](_0x41ad('0x22'),_0x36124d+'-'+_0x27e15e+'/'+_0x1731f7)[_0x41ad('0x1c')](_0x4d3ab2);}return null;};}function patchUpdates(_0x4b8a9d){return function(_0x34ba58){try{jsonpatch[_0x41ad('0x23')](_0x34ba58,_0x4b8a9d,!![]);}catch(_0x5d5543){return BPromise[_0x41ad('0x24')](_0x5d5543);}return _0x34ba58[_0x41ad('0x25')]();};}function saveUpdates(_0x594632,_0x2b1452){return function(_0x268ce6){if(_0x268ce6){return _0x268ce6[_0x41ad('0x26')](_0x594632)[_0x41ad('0x27')](function(_0x5f26b8){return _0x5f26b8;});}return null;};}function removeEntity(_0x5630d6,_0x22cecc){return function(_0x4a8111){if(_0x4a8111){return _0x4a8111['destroy']()[_0x41ad('0x27')](function(){_0x5630d6[_0x41ad('0x1a')](0xcc)[_0x41ad('0x1b')]();});}};}function handleEntityNotFound(_0x1c59b4,_0x5b1b0a){return function(_0x3651ca){if(!_0x3651ca){_0x1c59b4['sendStatus'](0x194);}return _0x3651ca;};}function handleError(_0x4f49f5,_0x1d09c5){_0x1d09c5=_0x1d09c5||0x1f4;return function(_0x26a1e3){logger['error'](_0x26a1e3[_0x41ad('0x28')]);if(_0x26a1e3[_0x41ad('0x29')]){delete _0x26a1e3[_0x41ad('0x29')];}_0x4f49f5[_0x41ad('0x1a')](_0x1d09c5)[_0x41ad('0x2a')](_0x26a1e3);};}exports[_0x41ad('0x2b')]=function(_0x5c417a,_0x3d5aff){var _0x5b8b57={},_0x203cd9={},_0x311943={'count':0x0,'rows':[]};var _0xe0cab5=_[_0x41ad('0x2c')](db[_0x41ad('0x2d')][_0x41ad('0x2e')],function(_0x54a921){return{'name':_0x54a921[_0x41ad('0x2f')],'type':_0x54a921['type'][_0x41ad('0x30')]};});_0x203cd9[_0x41ad('0x31')]=_[_0x41ad('0x2c')](_0xe0cab5,_0x41ad('0x29'));_0x203cd9['query']=_[_0x41ad('0x32')](_0x5c417a[_0x41ad('0x33')]);_0x203cd9[_0x41ad('0x34')]=_[_0x41ad('0x35')](_0x203cd9[_0x41ad('0x31')],_0x203cd9[_0x41ad('0x33')]);_0x5b8b57[_0x41ad('0x36')]=_['intersection'](_0x203cd9[_0x41ad('0x31')],qs[_0x41ad('0x37')](_0x5c417a['query'][_0x41ad('0x37')]));_0x5b8b57[_0x41ad('0x36')]=_0x5b8b57[_0x41ad('0x36')][_0x41ad('0x38')]?_0x5b8b57[_0x41ad('0x36')]:_0x203cd9[_0x41ad('0x31')];if(!_0x5c417a[_0x41ad('0x33')]['hasOwnProperty'](_0x41ad('0x39'))){_0x5b8b57[_0x41ad('0x20')]=qs['limit'](_0x5c417a['query'][_0x41ad('0x20')]);_0x5b8b57['offset']=qs['offset'](_0x5c417a[_0x41ad('0x33')][_0x41ad('0x1d')]);}_0x5b8b57[_0x41ad('0x3a')]=qs[_0x41ad('0x3b')](_0x5c417a['query']['sort']);_0x5b8b57[_0x41ad('0x3c')]=qs['filters'](_[_0x41ad('0x3d')](_0x5c417a[_0x41ad('0x33')],_0x203cd9[_0x41ad('0x34')]),_0xe0cab5);if(_0x5c417a[_0x41ad('0x33')][_0x41ad('0x3e')]){_0x5b8b57[_0x41ad('0x3c')]=_[_0x41ad('0x3f')](_0x5b8b57[_0x41ad('0x3c')],{'$or':_['map'](_0xe0cab5,function(_0xccce7a){if(_0xccce7a['type']!==_0x41ad('0x40')){var _0x2a9029={};_0x2a9029[_0xccce7a['name']]={'$like':'%'+_0x5c417a[_0x41ad('0x33')][_0x41ad('0x3e')]+'%'};return _0x2a9029;}})});}_0x5b8b57=_[_0x41ad('0x3f')]({},_0x5b8b57,_0x5c417a[_0x41ad('0x41')]);var _0x474fdb={'where':_0x5b8b57[_0x41ad('0x3c')]};return db[_0x41ad('0x2d')][_0x41ad('0x1f')](_0x474fdb)[_0x41ad('0x27')](function(_0x2bffa8){_0x311943[_0x41ad('0x1f')]=_0x2bffa8;if(_0x5c417a[_0x41ad('0x33')]['includeAll']){_0x5b8b57[_0x41ad('0x42')]=[{'all':!![]}];}return db[_0x41ad('0x2d')][_0x41ad('0x43')](_0x5b8b57);})[_0x41ad('0x27')](function(_0x548aef){_0x311943[_0x41ad('0x44')]=_0x548aef;return _0x311943;})[_0x41ad('0x27')](respondWithFilteredResult(_0x3d5aff,_0x5b8b57))[_0x41ad('0x45')](handleError(_0x3d5aff,null));};exports[_0x41ad('0x46')]=function(_0x8c7024,_0xaf0e1f){var _0xde9a2e={'raw':![],'where':{'id':_0x8c7024[_0x41ad('0x47')]['id']}},_0x2978dd={};_0x2978dd[_0x41ad('0x31')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x2978dd[_0x41ad('0x33')]=_['keys'](_0x8c7024[_0x41ad('0x33')]);_0x2978dd['filters']=_[_0x41ad('0x35')](_0x2978dd[_0x41ad('0x31')],_0x2978dd[_0x41ad('0x33')]);_0xde9a2e[_0x41ad('0x36')]=_[_0x41ad('0x35')](_0x2978dd[_0x41ad('0x31')],qs[_0x41ad('0x37')](_0x8c7024[_0x41ad('0x33')][_0x41ad('0x37')]));_0xde9a2e[_0x41ad('0x36')]=_0xde9a2e[_0x41ad('0x36')][_0x41ad('0x38')]?_0xde9a2e[_0x41ad('0x36')]:_0x2978dd[_0x41ad('0x31')];if(_0x8c7024[_0x41ad('0x33')][_0x41ad('0x48')]){_0xde9a2e[_0x41ad('0x42')]=[{'all':!![]}];}_0xde9a2e=_[_0x41ad('0x3f')]({},_0xde9a2e,_0x8c7024[_0x41ad('0x41')]);return db[_0x41ad('0x2d')][_0x41ad('0x49')](_0xde9a2e)[_0x41ad('0x27')](handleEntityNotFound(_0xaf0e1f,null))['then'](respondWithResult(_0xaf0e1f,null))[_0x41ad('0x45')](handleError(_0xaf0e1f,null));};exports[_0x41ad('0x4a')]=function(_0x1f381f,_0x1cd129){return db[_0x41ad('0x2d')][_0x41ad('0x4a')](_0x1f381f[_0x41ad('0x4b')],{})[_0x41ad('0x27')](respondWithResult(_0x1cd129,0xc9))[_0x41ad('0x45')](handleError(_0x1cd129,null));};exports[_0x41ad('0x26')]=function(_0x4e81ea,_0x2c6b1d){if(_0x4e81ea['body']['id']){delete _0x4e81ea[_0x41ad('0x4b')]['id'];}return db['ServicenowConfiguration'][_0x41ad('0x49')]({'where':{'id':_0x4e81ea[_0x41ad('0x47')]['id']}})[_0x41ad('0x27')](handleEntityNotFound(_0x2c6b1d,null))[_0x41ad('0x27')](saveUpdates(_0x4e81ea['body'],null))['then'](respondWithResult(_0x2c6b1d,null))['catch'](handleError(_0x2c6b1d,null));};exports[_0x41ad('0x4c')]=function(_0x136cf4,_0x180efc){return db[_0x41ad('0x2d')][_0x41ad('0x49')]({'where':{'id':_0x136cf4[_0x41ad('0x47')]['id']}})[_0x41ad('0x27')](handleEntityNotFound(_0x180efc,null))[_0x41ad('0x27')](removeEntity(_0x180efc,null))[_0x41ad('0x45')](handleError(_0x180efc,null));};exports[_0x41ad('0x4d')]=function(_0x5a1470,_0x4f4656,_0x1ee549){var _0x5b0327={};var _0x2fac2e={};var _0x264b62;var _0x5e9229;return db[_0x41ad('0x2d')]['findOne']({'where':{'id':_0x5a1470['params']['id']}})[_0x41ad('0x27')](handleEntityNotFound(_0x4f4656,null))[_0x41ad('0x27')](function(_0x149d5f){if(_0x149d5f){_0x264b62=_0x149d5f;_0x2fac2e[_0x41ad('0x31')]=_[_0x41ad('0x32')](db['ServicenowField'][_0x41ad('0x2e')]);_0x2fac2e[_0x41ad('0x33')]=_[_0x41ad('0x32')](_0x5a1470[_0x41ad('0x33')]);_0x2fac2e[_0x41ad('0x34')]=_[_0x41ad('0x35')](_0x2fac2e[_0x41ad('0x31')],_0x2fac2e[_0x41ad('0x33')]);_0x5b0327['attributes']=_[_0x41ad('0x35')](_0x2fac2e[_0x41ad('0x31')],qs[_0x41ad('0x37')](_0x5a1470[_0x41ad('0x33')][_0x41ad('0x37')]));_0x5b0327['attributes']=_0x5b0327[_0x41ad('0x36')]['length']?_0x5b0327[_0x41ad('0x36')]:_0x2fac2e[_0x41ad('0x31')];_0x5b0327['order']=qs['sort'](_0x5a1470[_0x41ad('0x33')][_0x41ad('0x3b')]);_0x5b0327[_0x41ad('0x3c')]=qs['filters'](_[_0x41ad('0x3d')](_0x5a1470[_0x41ad('0x33')],_0x2fac2e[_0x41ad('0x34')]));if(_0x5a1470['query']['filter']){_0x5b0327[_0x41ad('0x3c')]=_[_0x41ad('0x3f')](_0x5b0327['where'],{'$or':_[_0x41ad('0x2c')](_0x5b0327['attributes'],function(_0x255b29){var _0xc88b8a={};_0xc88b8a[_0x255b29]={'$like':'%'+_0x5a1470[_0x41ad('0x33')][_0x41ad('0x3e')]+'%'};return _0xc88b8a;})});}_0x5b0327=_['merge']({},_0x5b0327,_0x5a1470[_0x41ad('0x41')]);return _0x264b62[_0x41ad('0x4d')](_0x5b0327);}})[_0x41ad('0x27')](function(_0xca7007){if(_0xca7007){_0x5e9229=_0xca7007[_0x41ad('0x38')];if(!_0x5a1470[_0x41ad('0x33')][_0x41ad('0x4e')]('nolimit')){_0x5b0327[_0x41ad('0x20')]=qs[_0x41ad('0x20')](_0x5a1470[_0x41ad('0x33')][_0x41ad('0x20')]);_0x5b0327[_0x41ad('0x1d')]=qs[_0x41ad('0x1d')](_0x5a1470['query'][_0x41ad('0x1d')]);}return _0x264b62[_0x41ad('0x4d')](_0x5b0327);}})[_0x41ad('0x27')](function(_0x315cd8){if(_0x315cd8){return _0x315cd8?{'count':_0x5e9229,'rows':_0x315cd8}:null;}})[_0x41ad('0x27')](respondWithResult(_0x4f4656,null))[_0x41ad('0x45')](handleError(_0x4f4656,null));};exports[_0x41ad('0x4f')]=function(_0x231044,_0x417245,_0x5afc57){var _0x54b293={};var _0x2b4796={};var _0x4c55d7;var _0x3df1c3;return db[_0x41ad('0x2d')]['findOne']({'where':{'id':_0x231044[_0x41ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x417245,null))[_0x41ad('0x27')](function(_0xd02a16){if(_0xd02a16){_0x4c55d7=_0xd02a16;_0x2b4796[_0x41ad('0x31')]=_['keys'](db[_0x41ad('0x50')][_0x41ad('0x2e')]);_0x2b4796[_0x41ad('0x33')]=_[_0x41ad('0x32')](_0x231044['query']);_0x2b4796[_0x41ad('0x34')]=_[_0x41ad('0x35')](_0x2b4796[_0x41ad('0x31')],_0x2b4796[_0x41ad('0x33')]);_0x54b293[_0x41ad('0x36')]=_[_0x41ad('0x35')](_0x2b4796[_0x41ad('0x31')],qs['fields'](_0x231044['query'][_0x41ad('0x37')]));_0x54b293['attributes']=_0x54b293[_0x41ad('0x36')][_0x41ad('0x38')]?_0x54b293[_0x41ad('0x36')]:_0x2b4796[_0x41ad('0x31')];_0x54b293[_0x41ad('0x3a')]=qs[_0x41ad('0x3b')](_0x231044[_0x41ad('0x33')][_0x41ad('0x3b')]);_0x54b293[_0x41ad('0x3c')]=qs['filters'](_['pick'](_0x231044[_0x41ad('0x33')],_0x2b4796[_0x41ad('0x34')]));if(_0x231044[_0x41ad('0x33')]['filter']){_0x54b293[_0x41ad('0x3c')]=_[_0x41ad('0x3f')](_0x54b293[_0x41ad('0x3c')],{'$or':_['map'](_0x54b293[_0x41ad('0x36')],function(_0x4415d3){var _0x306337={};_0x306337[_0x4415d3]={'$like':'%'+_0x231044[_0x41ad('0x33')][_0x41ad('0x3e')]+'%'};return _0x306337;})});}_0x54b293=_[_0x41ad('0x3f')]({},_0x54b293,_0x231044['options']);return _0x4c55d7[_0x41ad('0x4f')](_0x54b293);}})[_0x41ad('0x27')](function(_0xbccce2){if(_0xbccce2){_0x3df1c3=_0xbccce2[_0x41ad('0x38')];if(!_0x231044[_0x41ad('0x33')][_0x41ad('0x4e')](_0x41ad('0x39'))){_0x54b293[_0x41ad('0x20')]=qs[_0x41ad('0x20')](_0x231044[_0x41ad('0x33')]['limit']);_0x54b293[_0x41ad('0x1d')]=qs[_0x41ad('0x1d')](_0x231044[_0x41ad('0x33')]['offset']);}return _0x4c55d7[_0x41ad('0x4f')](_0x54b293);}})[_0x41ad('0x27')](function(_0x49feb2){if(_0x49feb2){return _0x49feb2?{'count':_0x3df1c3,'rows':_0x49feb2}:null;}})[_0x41ad('0x27')](respondWithResult(_0x417245,null))[_0x41ad('0x45')](handleError(_0x417245,null));};exports[_0x41ad('0x51')]=function(_0x222f4a,_0x1742b7,_0x5b0ce0){var _0xd6556d={};var _0x23d077={};var _0x2904cb;var _0x3ddb5a;return db[_0x41ad('0x2d')]['findOne']({'where':{'id':_0x222f4a[_0x41ad('0x47')]['id']}})[_0x41ad('0x27')](handleEntityNotFound(_0x1742b7,null))['then'](function(_0x4b647b){if(_0x4b647b){_0x2904cb=_0x4b647b;_0x23d077['model']=_['keys'](db[_0x41ad('0x50')][_0x41ad('0x2e')]);_0x23d077[_0x41ad('0x33')]=_[_0x41ad('0x32')](_0x222f4a['query']);_0x23d077[_0x41ad('0x34')]=_[_0x41ad('0x35')](_0x23d077['model'],_0x23d077[_0x41ad('0x33')]);_0xd6556d[_0x41ad('0x36')]=_['intersection'](_0x23d077[_0x41ad('0x31')],qs[_0x41ad('0x37')](_0x222f4a[_0x41ad('0x33')][_0x41ad('0x37')]));_0xd6556d[_0x41ad('0x36')]=_0xd6556d[_0x41ad('0x36')][_0x41ad('0x38')]?_0xd6556d[_0x41ad('0x36')]:_0x23d077['model'];_0xd6556d[_0x41ad('0x3a')]=qs[_0x41ad('0x3b')](_0x222f4a[_0x41ad('0x33')][_0x41ad('0x3b')]);_0xd6556d[_0x41ad('0x3c')]=qs['filters'](_[_0x41ad('0x3d')](_0x222f4a[_0x41ad('0x33')],_0x23d077[_0x41ad('0x34')]));if(_0x222f4a[_0x41ad('0x33')]['filter']){_0xd6556d['where']=_[_0x41ad('0x3f')](_0xd6556d[_0x41ad('0x3c')],{'$or':_[_0x41ad('0x2c')](_0xd6556d['attributes'],function(_0x36c0a5){var _0x43b23d={};_0x43b23d[_0x36c0a5]={'$like':'%'+_0x222f4a[_0x41ad('0x33')][_0x41ad('0x3e')]+'%'};return _0x43b23d;})});}_0xd6556d=_['merge']({},_0xd6556d,_0x222f4a[_0x41ad('0x41')]);return _0x2904cb[_0x41ad('0x51')](_0xd6556d);}})[_0x41ad('0x27')](function(_0x58f377){if(_0x58f377){_0x3ddb5a=_0x58f377[_0x41ad('0x38')];if(!_0x222f4a[_0x41ad('0x33')]['hasOwnProperty']('nolimit')){_0xd6556d[_0x41ad('0x20')]=qs[_0x41ad('0x20')](_0x222f4a[_0x41ad('0x33')][_0x41ad('0x20')]);_0xd6556d[_0x41ad('0x1d')]=qs['offset'](_0x222f4a[_0x41ad('0x33')][_0x41ad('0x1d')]);}return _0x2904cb[_0x41ad('0x51')](_0xd6556d);}})[_0x41ad('0x27')](function(_0x38923e){if(_0x38923e){return _0x38923e?{'count':_0x3ddb5a,'rows':_0x38923e}:null;}})[_0x41ad('0x27')](respondWithResult(_0x1742b7,null))[_0x41ad('0x45')](handleError(_0x1742b7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e6c14b6..71fa41e 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 _0xf894=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xf894,0xfd));var _0x4f89=function(_0x2d9a5b,_0x7f31bf){_0x2d9a5b=_0x2d9a5b-0x0;var _0x1adb74=_0xf894[_0x2d9a5b];return _0x1adb74;};'use strict';var _=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var logger=require(_0x4f89('0x2'))(_0x4f89('0x3'));var moment=require(_0x4f89('0x4'));var BPromise=require(_0x4f89('0x5'));var rp=require(_0x4f89('0x6'));var fs=require('fs');var path=require(_0x4f89('0x7'));var rimraf=require(_0x4f89('0x8'));var config=require(_0x4f89('0x9'));var attributes=require(_0x4f89('0xa'));module[_0x4f89('0xb')]=function(_0x8837a0,_0x343593){return _0x8837a0[_0x4f89('0xc')](_0x4f89('0xd'),attributes,{'tableName':_0x4f89('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0825=['../../config/environment','./intServicenowConfiguration.attributes','exports','int_servicenow_configurations','lodash','util','moment','bluebird','path','rimraf'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x0825,0x1e4));var _0x5082=function(_0x115f40,_0x10c346){_0x115f40=_0x115f40-0x0;var _0x22c0ed=_0x0825[_0x115f40];return _0x22c0ed;};'use strict';var _=require(_0x5082('0x0'));var util=require(_0x5082('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5082('0x2'));var BPromise=require(_0x5082('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5082('0x4'));var rimraf=require(_0x5082('0x5'));var config=require(_0x5082('0x6'));var attributes=require(_0x5082('0x7'));module[_0x5082('0x8')]=function(_0x297cda,_0x5a119b){return _0x297cda['define']('ServicenowConfiguration',attributes,{'tableName':_0x5082('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 0737abd..cecae08 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 _0xd9f2=['then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x504c5d,_0x27a75a){var _0x4d1821=function(_0x558ffe){while(--_0x558ffe){_0x504c5d['push'](_0x504c5d['shift']());}};_0x4d1821(++_0x27a75a);}(_0xd9f2,0x1cd));var _0x2d9f=function(_0x5a7b8a,_0x16beb4){_0x5a7b8a=_0x5a7b8a-0x0;var _0x46ffab=_0xd9f2[_0x5a7b8a];return _0x46ffab;};'use strict';var _=require(_0x2d9f('0x0'));var util=require(_0x2d9f('0x1'));var moment=require(_0x2d9f('0x2'));var BPromise=require(_0x2d9f('0x3'));var rs=require(_0x2d9f('0x4'));var fs=require('fs');var Redis=require(_0x2d9f('0x5'));var db=require(_0x2d9f('0x6'))['db'];var utils=require(_0x2d9f('0x7'));var logger=require(_0x2d9f('0x8'))('rpc');var config=require(_0x2d9f('0x9'));var jayson=require(_0x2d9f('0xa'));var client=jayson[_0x2d9f('0xb')][_0x2d9f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x435b94,_0x4fcdd1,_0x171002){return new BPromise(function(_0x233637,_0x20e4da){return client[_0x2d9f('0xd')](_0x435b94,_0x171002)[_0x2d9f('0xe')](function(_0x4596cb){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4fcdd1,_0x2d9f('0xf'));logger[_0x2d9f('0x10')](_0x2d9f('0x11'),_0x4fcdd1,'request\x20sent',JSON[_0x2d9f('0x12')](_0x4596cb));if(_0x4596cb[_0x2d9f('0x13')]){if(_0x4596cb[_0x2d9f('0x13')][_0x2d9f('0x14')]===0x1f4){logger[_0x2d9f('0x13')](_0x2d9f('0x15'),_0x4fcdd1,_0x4596cb[_0x2d9f('0x13')][_0x2d9f('0x16')]);return _0x20e4da(_0x4596cb['error']['message']);}logger[_0x2d9f('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4fcdd1,_0x4596cb[_0x2d9f('0x13')]['message']);return _0x233637(_0x4596cb['error'][_0x2d9f('0x16')]);}else{logger[_0x2d9f('0x17')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4fcdd1,'request\x20sent');_0x233637(_0x4596cb[_0x2d9f('0x18')]['message']);}})['catch'](function(_0x5c884f){logger[_0x2d9f('0x13')](_0x2d9f('0x15'),_0x4fcdd1,_0x5c884f);_0x20e4da(_0x5c884f);});});} \ No newline at end of file +var _0x9432=['ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf7b656,_0x1f837e){var _0x5973d7=function(_0x230aa5){while(--_0x230aa5){_0xf7b656['push'](_0xf7b656['shift']());}};_0x5973d7(++_0x1f837e);}(_0x9432,0x1e3));var _0x2943=function(_0x255684,_0x6735a1){_0x255684=_0x255684-0x0;var _0x580e45=_0x9432[_0x255684];return _0x580e45;};'use strict';var _=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var moment=require('moment');var BPromise=require(_0x2943('0x2'));var rs=require(_0x2943('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2943('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2943('0x5'));var config=require(_0x2943('0x6'));var jayson=require(_0x2943('0x7'));var client=jayson[_0x2943('0x8')][_0x2943('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56f65f,_0x317fdc,_0x111824){return new BPromise(function(_0x6e3b61,_0x116983){return client['request'](_0x56f65f,_0x111824)[_0x2943('0xa')](function(_0x27ba76){logger[_0x2943('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x317fdc,_0x2943('0xc'));logger['debug'](_0x2943('0xd'),_0x317fdc,_0x2943('0xc'),JSON[_0x2943('0xe')](_0x27ba76));if(_0x27ba76[_0x2943('0xf')]){if(_0x27ba76[_0x2943('0xf')][_0x2943('0x10')]===0x1f4){logger[_0x2943('0xf')](_0x2943('0x11'),_0x317fdc,_0x27ba76[_0x2943('0xf')][_0x2943('0x12')]);return _0x116983(_0x27ba76[_0x2943('0xf')][_0x2943('0x12')]);}logger[_0x2943('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x317fdc,_0x27ba76[_0x2943('0xf')][_0x2943('0x12')]);return _0x6e3b61(_0x27ba76[_0x2943('0xf')][_0x2943('0x12')]);}else{logger[_0x2943('0xb')](_0x2943('0x11'),_0x317fdc,_0x2943('0xc'));_0x6e3b61(_0x27ba76['result']['message']);}})[_0x2943('0x13')](function(_0x529a55){logger['error'](_0x2943('0x11'),_0x317fdc,_0x529a55);_0x116983(_0x529a55);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index edbff81..c69bb63 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 _0x057a=['get','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x057a,0x14b));var _0xa057=function(_0x4e8f12,_0x36ef25){_0x4e8f12=_0x4e8f12-0x0;var _0x1bf373=_0x057a[_0x4e8f12];return _0x1bf373;};'use strict';var multer=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var path=require(_0xa057('0x2'));var timeout=require(_0xa057('0x3'));var express=require(_0xa057('0x4'));var router=express['Router']();var fs_extra=require(_0xa057('0x5'));var auth=require(_0xa057('0x6'));var interaction=require(_0xa057('0x7'));var config=require(_0xa057('0x8'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xa057('0x9')](),controller[_0xa057('0xa')]);router[_0xa057('0xb')](_0xa057('0xc'),auth[_0xa057('0x9')](),controller['show']);router[_0xa057('0xd')]('/',auth[_0xa057('0x9')](),controller[_0xa057('0xe')]);router[_0xa057('0xf')]('/:id',auth[_0xa057('0x9')](),controller[_0xa057('0x10')]);router[_0xa057('0x11')](_0xa057('0xc'),auth[_0xa057('0x9')](),controller['destroy']);module[_0xa057('0x12')]=router; \ No newline at end of file +var _0x58b0=['delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58b0,0x110));var _0x058b=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0x58b0[_0x589eb4];return _0xf50816;};'use strict';var multer=require(_0x058b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x058b('0x1'));var express=require(_0x058b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x058b('0x3'));var interaction=require(_0x058b('0x4'));var config=require(_0x058b('0x5'));var controller=require(_0x058b('0x6'));router[_0x058b('0x7')]('/',auth[_0x058b('0x8')](),controller[_0x058b('0x9')]);router['get'](_0x058b('0xa'),auth[_0x058b('0x8')](),controller['show']);router[_0x058b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x058b('0xc')](_0x058b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x058b('0xd')](_0x058b('0xa'),auth[_0x058b('0x8')](),controller[_0x058b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 49a5f70..974d0ab 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 _0x93e0=['sequelize','exports','string','customVariable','STRING','ENUM'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x93e0,0x150));var _0x093e=function(_0x54124f,_0x69fbb9){_0x54124f=_0x54124f-0x0;var _0x583af=_0x93e0[_0x54124f];return _0x583af;};'use strict';var Sequelize=require(_0x093e('0x0'));module[_0x093e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x093e('0x2'),'variable',_0x093e('0x3'),'keyValue','picklist'),'defaultValue':_0x093e('0x2')},'content':{'type':Sequelize[_0x093e('0x4')]},'key':{'type':Sequelize[_0x093e('0x4')]},'keyType':{'type':Sequelize[_0x093e('0x5')](_0x093e('0x2'),'variable',_0x093e('0x3'))},'keyContent':{'type':Sequelize[_0x093e('0x4')]},'idField':{'type':Sequelize[_0x093e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x093e('0x4')]}}; \ No newline at end of file +var _0xf7c0=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x1f83ed,_0x4fcd2a){var _0x4a01c3=function(_0x5c84c9){while(--_0x5c84c9){_0x1f83ed['push'](_0x1f83ed['shift']());}};_0x4a01c3(++_0x4fcd2a);}(_0xf7c0,0xd6));var _0x0f7c=function(_0x3986ba,_0x5f2729){_0x3986ba=_0x3986ba-0x0;var _0x5fccad=_0xf7c0[_0x3986ba];return _0x5fccad;};'use strict';var Sequelize=require(_0x0f7c('0x0'));module[_0x0f7c('0x1')]={'type':{'type':Sequelize[_0x0f7c('0x2')](_0x0f7c('0x3'),_0x0f7c('0x4'),_0x0f7c('0x5'),_0x0f7c('0x6'),'picklist'),'defaultValue':_0x0f7c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0f7c('0x3'),'variable',_0x0f7c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0f7c('0x7')]},'nameField':{'type':Sequelize[_0x0f7c('0x7')]},'customField':{'type':Sequelize[_0x0f7c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f7c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 07469a9..188f07e 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 _0xe7d0=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','rawAttributes','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','ServicenowField','findAll','rows','show','find','create','body','catch','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x11b4cd,_0x178af0){var _0x280506=function(_0x182e8d){while(--_0x182e8d){_0x11b4cd['push'](_0x11b4cd['shift']());}};_0x280506(++_0x178af0);}(_0xe7d0,0x173));var _0x0e7d=function(_0x1d959e,_0x308b99){_0x1d959e=_0x1d959e-0x0;var _0x20a55d=_0xe7d0[_0x1d959e];return _0x20a55d;};'use strict';var emlformat=require(_0x0e7d('0x0'));var rimraf=require(_0x0e7d('0x1'));var zipdir=require(_0x0e7d('0x2'));var jsonpatch=require(_0x0e7d('0x3'));var rp=require(_0x0e7d('0x4'));var moment=require(_0x0e7d('0x5'));var BPromise=require(_0x0e7d('0x6'));var Mustache=require(_0x0e7d('0x7'));var util=require(_0x0e7d('0x8'));var path=require('path');var sox=require(_0x0e7d('0x9'));var csv=require(_0x0e7d('0xa'));var ejs=require(_0x0e7d('0xb'));var fs=require('fs');var fs_extra=require(_0x0e7d('0xc'));var _=require(_0x0e7d('0xd'));var squel=require(_0x0e7d('0xe'));var crypto=require(_0x0e7d('0xf'));var jsforce=require(_0x0e7d('0x10'));var deskjs=require(_0x0e7d('0x11'));var toCsv=require(_0x0e7d('0xa'));var querystring=require(_0x0e7d('0x12'));var Papa=require(_0x0e7d('0x13'));var Redis=require('ioredis');var authService=require(_0x0e7d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0e7d('0x15'));var hardwareService=require(_0x0e7d('0x16'));var logger=require(_0x0e7d('0x17'))(_0x0e7d('0x18'));var utils=require(_0x0e7d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0e7d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27fc53,_0x20d418){_0x20d418=_0x20d418||0xcc;return function(_0x23fc93){if(_0x23fc93){return _0x27fc53[_0x0e7d('0x1b')](_0x20d418);}return _0x27fc53[_0x0e7d('0x1c')](_0x20d418)[_0x0e7d('0x1d')]();};}function respondWithResult(_0x395f99,_0x1347fc){_0x1347fc=_0x1347fc||0xc8;return function(_0xb94984){if(_0xb94984){return _0x395f99[_0x0e7d('0x1c')](_0x1347fc)[_0x0e7d('0x1e')](_0xb94984);}};}function respondWithFilteredResult(_0x4614b3,_0x46616c){return function(_0x35d6b3){if(_0x35d6b3){var _0x3868db=typeof _0x46616c[_0x0e7d('0x1f')]===_0x0e7d('0x20')&&typeof _0x46616c[_0x0e7d('0x21')]===_0x0e7d('0x20');var _0xa92670=_0x35d6b3['count'];var _0x521b54=_0x3868db?0x0:_0x46616c['offset'];var _0x5103d9=_0x3868db?_0x35d6b3[_0x0e7d('0x22')]:_0x46616c[_0x0e7d('0x1f')]+_0x46616c[_0x0e7d('0x21')];var _0x26fb1a;if(_0x5103d9>=_0xa92670){_0x5103d9=_0xa92670;_0x26fb1a=0xc8;}else{_0x26fb1a=0xce;}_0x4614b3[_0x0e7d('0x1c')](_0x26fb1a);return _0x4614b3[_0x0e7d('0x23')](_0x0e7d('0x24'),_0x521b54+'-'+_0x5103d9+'/'+_0xa92670)[_0x0e7d('0x1e')](_0x35d6b3);}return null;};}function patchUpdates(_0x3d0f3a){return function(_0x185f83){try{jsonpatch['apply'](_0x185f83,_0x3d0f3a,!![]);}catch(_0x108e19){return BPromise[_0x0e7d('0x25')](_0x108e19);}return _0x185f83[_0x0e7d('0x26')]();};}function saveUpdates(_0x53efc5,_0x691d3e){return function(_0xe4fda1){if(_0xe4fda1){return _0xe4fda1[_0x0e7d('0x27')](_0x53efc5)[_0x0e7d('0x28')](function(_0x306eaa){return _0x306eaa;});}return null;};}function removeEntity(_0x47f59f,_0x5ee884){return function(_0x19f1fb){if(_0x19f1fb){return _0x19f1fb['destroy']()[_0x0e7d('0x28')](function(){_0x47f59f[_0x0e7d('0x1c')](0xcc)[_0x0e7d('0x1d')]();});}};}function handleEntityNotFound(_0x45195e,_0x33556a){return function(_0x1a75b6){if(!_0x1a75b6){_0x45195e[_0x0e7d('0x1b')](0x194);}return _0x1a75b6;};}function handleError(_0x9bdfda,_0x21dd25){_0x21dd25=_0x21dd25||0x1f4;return function(_0x13dad1){logger[_0x0e7d('0x29')](_0x13dad1['stack']);if(_0x13dad1['name']){delete _0x13dad1[_0x0e7d('0x2a')];}_0x9bdfda[_0x0e7d('0x1c')](_0x21dd25)[_0x0e7d('0x2b')](_0x13dad1);};}exports['index']=function(_0xb35b3a,_0xb37468){var _0x254ff6={},_0x2598ac={},_0x378887={'count':0x0,'rows':[]};var _0x605dc9=_['map'](db['ServicenowField'][_0x0e7d('0x2c')],function(_0x9e2b1c){return{'name':_0x9e2b1c['fieldName'],'type':_0x9e2b1c[_0x0e7d('0x2d')]['key']};});_0x2598ac['model']=_[_0x0e7d('0x2e')](_0x605dc9,_0x0e7d('0x2a'));_0x2598ac['query']=_[_0x0e7d('0x2f')](_0xb35b3a[_0x0e7d('0x30')]);_0x2598ac[_0x0e7d('0x31')]=_[_0x0e7d('0x32')](_0x2598ac[_0x0e7d('0x33')],_0x2598ac[_0x0e7d('0x30')]);_0x254ff6[_0x0e7d('0x34')]=_['intersection'](_0x2598ac['model'],qs[_0x0e7d('0x35')](_0xb35b3a[_0x0e7d('0x30')][_0x0e7d('0x35')]));_0x254ff6[_0x0e7d('0x34')]=_0x254ff6[_0x0e7d('0x34')][_0x0e7d('0x36')]?_0x254ff6['attributes']:_0x2598ac[_0x0e7d('0x33')];if(!_0xb35b3a[_0x0e7d('0x30')][_0x0e7d('0x37')](_0x0e7d('0x38'))){_0x254ff6[_0x0e7d('0x21')]=qs[_0x0e7d('0x21')](_0xb35b3a[_0x0e7d('0x30')]['limit']);_0x254ff6[_0x0e7d('0x1f')]=qs[_0x0e7d('0x1f')](_0xb35b3a[_0x0e7d('0x30')][_0x0e7d('0x1f')]);}_0x254ff6[_0x0e7d('0x39')]=qs[_0x0e7d('0x3a')](_0xb35b3a[_0x0e7d('0x30')]['sort']);_0x254ff6[_0x0e7d('0x3b')]=qs[_0x0e7d('0x31')](_[_0x0e7d('0x3c')](_0xb35b3a[_0x0e7d('0x30')],_0x2598ac['filters']),_0x605dc9);if(_0xb35b3a[_0x0e7d('0x30')][_0x0e7d('0x3d')]){_0x254ff6[_0x0e7d('0x3b')]=_[_0x0e7d('0x3e')](_0x254ff6['where'],{'$or':_[_0x0e7d('0x2e')](_0x605dc9,function(_0x4c2123){if(_0x4c2123[_0x0e7d('0x2d')]!=='VIRTUAL'){var _0x316223={};_0x316223[_0x4c2123['name']]={'$like':'%'+_0xb35b3a['query'][_0x0e7d('0x3d')]+'%'};return _0x316223;}})});}_0x254ff6=_[_0x0e7d('0x3e')]({},_0x254ff6,_0xb35b3a[_0x0e7d('0x3f')]);var _0x34ac97={'where':_0x254ff6[_0x0e7d('0x3b')]};return db['ServicenowField'][_0x0e7d('0x22')](_0x34ac97)[_0x0e7d('0x28')](function(_0x4c473a){_0x378887[_0x0e7d('0x22')]=_0x4c473a;if(_0xb35b3a[_0x0e7d('0x30')][_0x0e7d('0x40')]){_0x254ff6[_0x0e7d('0x41')]=[{'all':!![]}];}return db[_0x0e7d('0x42')][_0x0e7d('0x43')](_0x254ff6);})[_0x0e7d('0x28')](function(_0x4b21ba){_0x378887[_0x0e7d('0x44')]=_0x4b21ba;return _0x378887;})[_0x0e7d('0x28')](respondWithFilteredResult(_0xb37468,_0x254ff6))['catch'](handleError(_0xb37468,null));};exports[_0x0e7d('0x45')]=function(_0x233bf4,_0x3ddb77){var _0x404ff1={'raw':!![],'where':{'id':_0x233bf4['params']['id']}},_0x581d4f={};_0x581d4f[_0x0e7d('0x33')]=_[_0x0e7d('0x2f')](db['ServicenowField'][_0x0e7d('0x2c')]);_0x581d4f['query']=_[_0x0e7d('0x2f')](_0x233bf4[_0x0e7d('0x30')]);_0x581d4f['filters']=_[_0x0e7d('0x32')](_0x581d4f[_0x0e7d('0x33')],_0x581d4f['query']);_0x404ff1[_0x0e7d('0x34')]=_[_0x0e7d('0x32')](_0x581d4f[_0x0e7d('0x33')],qs[_0x0e7d('0x35')](_0x233bf4[_0x0e7d('0x30')]['fields']));_0x404ff1[_0x0e7d('0x34')]=_0x404ff1[_0x0e7d('0x34')][_0x0e7d('0x36')]?_0x404ff1[_0x0e7d('0x34')]:_0x581d4f[_0x0e7d('0x33')];if(_0x233bf4[_0x0e7d('0x30')][_0x0e7d('0x40')]){_0x404ff1[_0x0e7d('0x41')]=[{'all':!![]}];}_0x404ff1=_[_0x0e7d('0x3e')]({},_0x404ff1,_0x233bf4['options']);return db[_0x0e7d('0x42')][_0x0e7d('0x46')](_0x404ff1)[_0x0e7d('0x28')](handleEntityNotFound(_0x3ddb77,null))[_0x0e7d('0x28')](respondWithResult(_0x3ddb77,null))['catch'](handleError(_0x3ddb77,null));};exports[_0x0e7d('0x47')]=function(_0xff8e0e,_0x2de7fc){return db[_0x0e7d('0x42')][_0x0e7d('0x47')](_0xff8e0e[_0x0e7d('0x48')],{})[_0x0e7d('0x28')](respondWithResult(_0x2de7fc,0xc9))['catch'](handleError(_0x2de7fc,null));};exports[_0x0e7d('0x27')]=function(_0x43244b,_0x3521ed){if(_0x43244b[_0x0e7d('0x48')]['id']){delete _0x43244b[_0x0e7d('0x48')]['id'];}return db[_0x0e7d('0x42')][_0x0e7d('0x46')]({'where':{'id':_0x43244b['params']['id']}})[_0x0e7d('0x28')](handleEntityNotFound(_0x3521ed,null))[_0x0e7d('0x28')](saveUpdates(_0x43244b['body'],null))['then'](respondWithResult(_0x3521ed,null))[_0x0e7d('0x49')](handleError(_0x3521ed,null));};exports[_0x0e7d('0x4a')]=function(_0x185a37,_0x17f032){return db[_0x0e7d('0x42')][_0x0e7d('0x46')]({'where':{'id':_0x185a37[_0x0e7d('0x4b')]['id']}})[_0x0e7d('0x28')](handleEntityNotFound(_0x17f032,null))['then'](removeEntity(_0x17f032,null))[_0x0e7d('0x49')](handleError(_0x17f032,null));}; \ No newline at end of file +var _0xb0d5=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','eml-format','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query'];(function(_0x34fa83,_0x4bd35a){var _0x4f02ba=function(_0x450702){while(--_0x450702){_0x34fa83['push'](_0x34fa83['shift']());}};_0x4f02ba(++_0x4bd35a);}(_0xb0d5,0x147));var _0x5b0d=function(_0x579121,_0x27e9e2){_0x579121=_0x579121-0x0;var _0x38a4ae=_0xb0d5[_0x579121];return _0x38a4ae;};'use strict';var emlformat=require(_0x5b0d('0x0'));var rimraf=require(_0x5b0d('0x1'));var zipdir=require(_0x5b0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b0d('0x3'));var Mustache=require('mustache');var util=require(_0x5b0d('0x4'));var path=require(_0x5b0d('0x5'));var sox=require('sox');var csv=require(_0x5b0d('0x6'));var ejs=require(_0x5b0d('0x7'));var fs=require('fs');var fs_extra=require(_0x5b0d('0x8'));var _=require(_0x5b0d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b0d('0xa'));var deskjs=require(_0x5b0d('0xb'));var toCsv=require(_0x5b0d('0x6'));var querystring=require('querystring');var Papa=require(_0x5b0d('0xc'));var Redis=require(_0x5b0d('0xd'));var authService=require(_0x5b0d('0xe'));var qs=require(_0x5b0d('0xf'));var as=require(_0x5b0d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b0d('0x11'))(_0x5b0d('0x12'));var utils=require(_0x5b0d('0x13'));var config=require(_0x5b0d('0x14'));var licenseUtil=require(_0x5b0d('0x15'));var db=require(_0x5b0d('0x16'))['db'];function respondWithStatusCode(_0x18a0e7,_0x6d24d2){_0x6d24d2=_0x6d24d2||0xcc;return function(_0x4129cf){if(_0x4129cf){return _0x18a0e7['sendStatus'](_0x6d24d2);}return _0x18a0e7['status'](_0x6d24d2)[_0x5b0d('0x17')]();};}function respondWithResult(_0xf29a6,_0x4f445f){_0x4f445f=_0x4f445f||0xc8;return function(_0x2eeb60){if(_0x2eeb60){return _0xf29a6[_0x5b0d('0x18')](_0x4f445f)[_0x5b0d('0x19')](_0x2eeb60);}};}function respondWithFilteredResult(_0x42bcd9,_0x5ac439){return function(_0x1e4e88){if(_0x1e4e88){var _0x44834d=typeof _0x5ac439[_0x5b0d('0x1a')]===_0x5b0d('0x1b')&&typeof _0x5ac439[_0x5b0d('0x1c')]===_0x5b0d('0x1b');var _0x484337=_0x1e4e88['count'];var _0x9f819e=_0x44834d?0x0:_0x5ac439['offset'];var _0x3871c4=_0x44834d?_0x1e4e88['count']:_0x5ac439[_0x5b0d('0x1a')]+_0x5ac439[_0x5b0d('0x1c')];var _0x193cd6;if(_0x3871c4>=_0x484337){_0x3871c4=_0x484337;_0x193cd6=0xc8;}else{_0x193cd6=0xce;}_0x42bcd9['status'](_0x193cd6);return _0x42bcd9[_0x5b0d('0x1d')](_0x5b0d('0x1e'),_0x9f819e+'-'+_0x3871c4+'/'+_0x484337)['json'](_0x1e4e88);}return null;};}function patchUpdates(_0x26d482){return function(_0x16ebeb){try{jsonpatch[_0x5b0d('0x1f')](_0x16ebeb,_0x26d482,!![]);}catch(_0x31519e){return BPromise['reject'](_0x31519e);}return _0x16ebeb[_0x5b0d('0x20')]();};}function saveUpdates(_0x33631e,_0xe526){return function(_0xf3a480){if(_0xf3a480){return _0xf3a480[_0x5b0d('0x21')](_0x33631e)[_0x5b0d('0x22')](function(_0x25bbb0){return _0x25bbb0;});}return null;};}function removeEntity(_0x225b66,_0x22014a){return function(_0x45f670){if(_0x45f670){return _0x45f670['destroy']()[_0x5b0d('0x22')](function(){_0x225b66[_0x5b0d('0x18')](0xcc)[_0x5b0d('0x17')]();});}};}function handleEntityNotFound(_0x4ed534,_0xf81c7a){return function(_0x1ac6c4){if(!_0x1ac6c4){_0x4ed534[_0x5b0d('0x23')](0x194);}return _0x1ac6c4;};}function handleError(_0x317652,_0x307e12){_0x307e12=_0x307e12||0x1f4;return function(_0x4cc73a){logger[_0x5b0d('0x24')](_0x4cc73a[_0x5b0d('0x25')]);if(_0x4cc73a['name']){delete _0x4cc73a[_0x5b0d('0x26')];}_0x317652['status'](_0x307e12)['send'](_0x4cc73a);};}exports[_0x5b0d('0x27')]=function(_0x251b5b,_0xf6e1a1){var _0x100853={},_0x393ed5={},_0xd9471e={'count':0x0,'rows':[]};var _0x58c76b=_[_0x5b0d('0x28')](db[_0x5b0d('0x29')][_0x5b0d('0x2a')],function(_0x295696){return{'name':_0x295696[_0x5b0d('0x2b')],'type':_0x295696[_0x5b0d('0x2c')][_0x5b0d('0x2d')]};});_0x393ed5[_0x5b0d('0x2e')]=_[_0x5b0d('0x28')](_0x58c76b,_0x5b0d('0x26'));_0x393ed5[_0x5b0d('0x2f')]=_[_0x5b0d('0x30')](_0x251b5b[_0x5b0d('0x2f')]);_0x393ed5['filters']=_[_0x5b0d('0x31')](_0x393ed5[_0x5b0d('0x2e')],_0x393ed5[_0x5b0d('0x2f')]);_0x100853[_0x5b0d('0x32')]=_[_0x5b0d('0x31')](_0x393ed5[_0x5b0d('0x2e')],qs[_0x5b0d('0x33')](_0x251b5b['query'][_0x5b0d('0x33')]));_0x100853[_0x5b0d('0x32')]=_0x100853[_0x5b0d('0x32')][_0x5b0d('0x34')]?_0x100853[_0x5b0d('0x32')]:_0x393ed5[_0x5b0d('0x2e')];if(!_0x251b5b[_0x5b0d('0x2f')][_0x5b0d('0x35')](_0x5b0d('0x36'))){_0x100853[_0x5b0d('0x1c')]=qs[_0x5b0d('0x1c')](_0x251b5b['query']['limit']);_0x100853[_0x5b0d('0x1a')]=qs[_0x5b0d('0x1a')](_0x251b5b[_0x5b0d('0x2f')][_0x5b0d('0x1a')]);}_0x100853[_0x5b0d('0x37')]=qs[_0x5b0d('0x38')](_0x251b5b[_0x5b0d('0x2f')][_0x5b0d('0x38')]);_0x100853[_0x5b0d('0x39')]=qs[_0x5b0d('0x3a')](_[_0x5b0d('0x3b')](_0x251b5b[_0x5b0d('0x2f')],_0x393ed5[_0x5b0d('0x3a')]),_0x58c76b);if(_0x251b5b['query'][_0x5b0d('0x3c')]){_0x100853[_0x5b0d('0x39')]=_['merge'](_0x100853[_0x5b0d('0x39')],{'$or':_[_0x5b0d('0x28')](_0x58c76b,function(_0x5294dd){if(_0x5294dd['type']!==_0x5b0d('0x3d')){var _0x1fa2d4={};_0x1fa2d4[_0x5294dd[_0x5b0d('0x26')]]={'$like':'%'+_0x251b5b['query']['filter']+'%'};return _0x1fa2d4;}})});}_0x100853=_[_0x5b0d('0x3e')]({},_0x100853,_0x251b5b[_0x5b0d('0x3f')]);var _0x532987={'where':_0x100853[_0x5b0d('0x39')]};return db['ServicenowField']['count'](_0x532987)[_0x5b0d('0x22')](function(_0x15d720){_0xd9471e[_0x5b0d('0x40')]=_0x15d720;if(_0x251b5b['query'][_0x5b0d('0x41')]){_0x100853['include']=[{'all':!![]}];}return db[_0x5b0d('0x29')][_0x5b0d('0x42')](_0x100853);})[_0x5b0d('0x22')](function(_0x3b8c7a){_0xd9471e[_0x5b0d('0x43')]=_0x3b8c7a;return _0xd9471e;})[_0x5b0d('0x22')](respondWithFilteredResult(_0xf6e1a1,_0x100853))[_0x5b0d('0x44')](handleError(_0xf6e1a1,null));};exports[_0x5b0d('0x45')]=function(_0xd03067,_0x5f48b1){var _0x1df37c={'raw':!![],'where':{'id':_0xd03067[_0x5b0d('0x46')]['id']}},_0x369243={};_0x369243[_0x5b0d('0x2e')]=_[_0x5b0d('0x30')](db[_0x5b0d('0x29')]['rawAttributes']);_0x369243[_0x5b0d('0x2f')]=_[_0x5b0d('0x30')](_0xd03067[_0x5b0d('0x2f')]);_0x369243[_0x5b0d('0x3a')]=_[_0x5b0d('0x31')](_0x369243[_0x5b0d('0x2e')],_0x369243['query']);_0x1df37c['attributes']=_['intersection'](_0x369243[_0x5b0d('0x2e')],qs[_0x5b0d('0x33')](_0xd03067[_0x5b0d('0x2f')][_0x5b0d('0x33')]));_0x1df37c['attributes']=_0x1df37c[_0x5b0d('0x32')][_0x5b0d('0x34')]?_0x1df37c['attributes']:_0x369243['model'];if(_0xd03067['query'][_0x5b0d('0x41')]){_0x1df37c[_0x5b0d('0x47')]=[{'all':!![]}];}_0x1df37c=_[_0x5b0d('0x3e')]({},_0x1df37c,_0xd03067[_0x5b0d('0x3f')]);return db[_0x5b0d('0x29')]['find'](_0x1df37c)[_0x5b0d('0x22')](handleEntityNotFound(_0x5f48b1,null))['then'](respondWithResult(_0x5f48b1,null))[_0x5b0d('0x44')](handleError(_0x5f48b1,null));};exports[_0x5b0d('0x48')]=function(_0x2b20b6,_0x444eac){return db[_0x5b0d('0x29')][_0x5b0d('0x48')](_0x2b20b6[_0x5b0d('0x49')],{})['then'](respondWithResult(_0x444eac,0xc9))[_0x5b0d('0x44')](handleError(_0x444eac,null));};exports[_0x5b0d('0x21')]=function(_0xc5cdf5,_0x5bf197){if(_0xc5cdf5[_0x5b0d('0x49')]['id']){delete _0xc5cdf5[_0x5b0d('0x49')]['id'];}return db[_0x5b0d('0x29')]['find']({'where':{'id':_0xc5cdf5[_0x5b0d('0x46')]['id']}})[_0x5b0d('0x22')](handleEntityNotFound(_0x5bf197,null))['then'](saveUpdates(_0xc5cdf5[_0x5b0d('0x49')],null))[_0x5b0d('0x22')](respondWithResult(_0x5bf197,null))[_0x5b0d('0x44')](handleError(_0x5bf197,null));};exports[_0x5b0d('0x4a')]=function(_0x20e734,_0x301369){return db[_0x5b0d('0x29')]['find']({'where':{'id':_0x20e734[_0x5b0d('0x46')]['id']}})[_0x5b0d('0x22')](handleEntityNotFound(_0x301369,null))['then'](removeEntity(_0x301369,null))[_0x5b0d('0x44')](handleError(_0x301369,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 648e933..0c04dfe 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 _0xe19f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','idField','FieldId'];(function(_0x30351b,_0x56d9d6){var _0x4d3192=function(_0x577aee){while(--_0x577aee){_0x30351b['push'](_0x30351b['shift']());}};_0x4d3192(++_0x56d9d6);}(_0xe19f,0x138));var _0xfe19=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe19f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xfe19('0x0'));var util=require(_0xfe19('0x1'));var logger=require(_0xfe19('0x2'))(_0xfe19('0x3'));var moment=require('moment');var BPromise=require(_0xfe19('0x4'));var rp=require(_0xfe19('0x5'));var fs=require('fs');var path=require(_0xfe19('0x6'));var rimraf=require(_0xfe19('0x7'));var config=require('../../config/environment');var attributes=require(_0xfe19('0x8'));module['exports']=function(_0x2873cf,_0x1a2709){return _0x2873cf['define'](_0xfe19('0x9'),attributes,{'tableName':_0xfe19('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xfe19('0xb'),_0xfe19('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e2a=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x312b50,_0x433b29){var _0x4239a9=function(_0x2c653c){while(--_0x2c653c){_0x312b50['push'](_0x312b50['shift']());}};_0x4239a9(++_0x433b29);}(_0x0e2a,0xb7));var _0xa0e2=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x0e2a[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0xa0e2('0x0'));var util=require('util');var logger=require(_0xa0e2('0x1'))(_0xa0e2('0x2'));var moment=require(_0xa0e2('0x3'));var BPromise=require(_0xa0e2('0x4'));var rp=require(_0xa0e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0e2('0x6'));var config=require(_0xa0e2('0x7'));var attributes=require(_0xa0e2('0x8'));module[_0xa0e2('0x9')]=function(_0x244240,_0x346c64){return _0x244240[_0xa0e2('0xa')](_0xa0e2('0xb'),attributes,{'tableName':_0xa0e2('0xc'),'paranoid':![],'indexes':[{'name':_0xa0e2('0xd'),'fields':[_0xa0e2('0xe'),_0xa0e2('0xf')],'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 ad3023e..5e40d25 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b74ac,_0x4abb1f){var _0x308f6c=function(_0x5bb974){while(--_0x5bb974){_0x3b74ac['push'](_0x3b74ac['shift']());}};_0x308f6c(++_0x4abb1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x231282,_0x3c8647){var _0x410de1=function(_0x2987a9){while(--_0x2987a9){_0x231282['push'](_0x231282['shift']());}};_0x410de1(++_0x3c8647);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f614fd7..4db3646 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(_0x3b4d2a,_0x4ed2f8){var _0x21d573=function(_0x400b8d){while(--_0x400b8d){_0x3b4d2a['push'](_0x3b4d2a['shift']());}};_0x21d573(++_0x4ed2f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x521b02,_0x45513f){var _0x26bacd=function(_0x4ce940){while(--_0x4ce940){_0x521b02['push'](_0x521b02['shift']());}};_0x26bacd(++_0x45513f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index f9aecb4..acfb12e 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(_0x13d9d3,_0x46550f){var _0x45b89e=function(_0x40b704){while(--_0x40b704){_0x13d9d3['push'](_0x13d9d3['shift']());}};_0x45b89e(++_0x46550f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x1651be,_0x1b8a1d){var _0x27dec1=function(_0x680607){while(--_0x680607){_0x1651be['push'](_0x1651be['shift']());}};_0x27dec1(++_0x1b8a1d);}(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index f0447d4..6099111 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 _0xbc8f=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','update','then','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','keys','pick','filter','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','substring','POST','format','login','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0xbc8f,0x154));var _0xfbc8=function(_0x4255b6,_0x31a237){_0x4255b6=_0x4255b6-0x0;var _0x164d54=_0xbc8f[_0x4255b6];return _0x164d54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfbc8('0x0'));var zipdir=require(_0xfbc8('0x1'));var jsonpatch=require(_0xfbc8('0x2'));var rp=require('request-promise');var moment=require(_0xfbc8('0x3'));var BPromise=require(_0xfbc8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfbc8('0x5'));var sox=require(_0xfbc8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbc8('0x7'));var _=require('lodash');var squel=require(_0xfbc8('0x8'));var crypto=require('crypto');var jsforce=require(_0xfbc8('0x9'));var deskjs=require(_0xfbc8('0xa'));var toCsv=require(_0xfbc8('0xb'));var querystring=require(_0xfbc8('0xc'));var Papa=require('papaparse');var Redis=require(_0xfbc8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfbc8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfbc8('0xf'));var utils=require(_0xfbc8('0x10'));var config=require(_0xfbc8('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfbc8('0x12'));function respondWithStatusCode(_0x1e754e,_0x3fff80){_0x3fff80=_0x3fff80||0xcc;return function(_0x138454){if(_0x138454){return _0x1e754e[_0xfbc8('0x13')](_0x3fff80);}return _0x1e754e[_0xfbc8('0x14')](_0x3fff80)[_0xfbc8('0x15')]();};}function respondWithResult(_0x47d3a3,_0xbb1b96){_0xbb1b96=_0xbb1b96||0xc8;return function(_0x54f38f){if(_0x54f38f){return _0x47d3a3[_0xfbc8('0x14')](_0xbb1b96)['json'](_0x54f38f);}};}function respondWithFilteredResult(_0x39cdea,_0x4e4e6e){return function(_0x1ed7fe){if(_0x1ed7fe){var _0x453715=typeof _0x4e4e6e[_0xfbc8('0x16')]===_0xfbc8('0x17')&&typeof _0x4e4e6e['limit']==='undefined';var _0x1a0456=_0x1ed7fe['count'];var _0x2e289e=_0x453715?0x0:_0x4e4e6e[_0xfbc8('0x16')];var _0x4d1042=_0x453715?_0x1ed7fe[_0xfbc8('0x18')]:_0x4e4e6e['offset']+_0x4e4e6e[_0xfbc8('0x19')];var _0x174e4d;if(_0x4d1042>=_0x1a0456){_0x4d1042=_0x1a0456;_0x174e4d=0xc8;}else{_0x174e4d=0xce;}_0x39cdea[_0xfbc8('0x14')](_0x174e4d);return _0x39cdea[_0xfbc8('0x1a')]('Content-Range',_0x2e289e+'-'+_0x4d1042+'/'+_0x1a0456)[_0xfbc8('0x1b')](_0x1ed7fe);}return null;};}function patchUpdates(_0x1ea4ed){return function(_0x23aaeb){try{jsonpatch['apply'](_0x23aaeb,_0x1ea4ed,!![]);}catch(_0x5d5ad3){return BPromise[_0xfbc8('0x1c')](_0x5d5ad3);}return _0x23aaeb['save']();};}function saveUpdates(_0x326902,_0x3d62b2){return function(_0x4ab85b){if(_0x4ab85b){return _0x4ab85b[_0xfbc8('0x1d')](_0x326902)[_0xfbc8('0x1e')](function(_0xd22981){return _0xd22981;});}return null;};}function removeEntity(_0x250552,_0x49ad5f){return function(_0x5c2dd4){if(_0x5c2dd4){return _0x5c2dd4['destroy']()['then'](function(){_0x250552[_0xfbc8('0x14')](0xcc)[_0xfbc8('0x15')]();});}};}function handleEntityNotFound(_0x17af42,_0x22f1ff){return function(_0x3ab600){if(!_0x3ab600){_0x17af42['sendStatus'](0x194);}return _0x3ab600;};}function handleError(_0x188c44,_0x147b01){_0x147b01=_0x147b01||0x1f4;return function(_0x3fcd27){logger[_0xfbc8('0x1f')](_0x3fcd27[_0xfbc8('0x20')]);if(_0x3fcd27[_0xfbc8('0x21')]){delete _0x3fcd27[_0xfbc8('0x21')];}_0x188c44[_0xfbc8('0x14')](_0x147b01)['send'](_0x3fcd27);};}exports[_0xfbc8('0x22')]=function(_0x20d9fd,_0x3c4b93){var _0x5cce41={},_0x5d35cd={},_0x325d71={'count':0x0,'rows':[]};var _0x4ec3f4=_[_0xfbc8('0x23')](db[_0xfbc8('0x24')][_0xfbc8('0x25')],function(_0x3e9c1d){return{'name':_0x3e9c1d[_0xfbc8('0x26')],'type':_0x3e9c1d[_0xfbc8('0x27')]['key']};});_0x5d35cd[_0xfbc8('0x28')]=_[_0xfbc8('0x23')](_0x4ec3f4,_0xfbc8('0x21'));_0x5d35cd[_0xfbc8('0x29')]=_['keys'](_0x20d9fd[_0xfbc8('0x29')]);_0x5d35cd[_0xfbc8('0x2a')]=_[_0xfbc8('0x2b')](_0x5d35cd['model'],_0x5d35cd[_0xfbc8('0x29')]);_0x5cce41[_0xfbc8('0x2c')]=_[_0xfbc8('0x2b')](_0x5d35cd[_0xfbc8('0x28')],qs[_0xfbc8('0x2d')](_0x20d9fd[_0xfbc8('0x29')][_0xfbc8('0x2d')]));_0x5cce41['attributes']=_0x5cce41[_0xfbc8('0x2c')][_0xfbc8('0x2e')]?_0x5cce41[_0xfbc8('0x2c')]:_0x5d35cd[_0xfbc8('0x28')];if(!_0x20d9fd[_0xfbc8('0x29')]['hasOwnProperty'](_0xfbc8('0x2f'))){_0x5cce41[_0xfbc8('0x19')]=qs[_0xfbc8('0x19')](_0x20d9fd[_0xfbc8('0x29')][_0xfbc8('0x19')]);_0x5cce41['offset']=qs[_0xfbc8('0x16')](_0x20d9fd[_0xfbc8('0x29')][_0xfbc8('0x16')]);}_0x5cce41[_0xfbc8('0x30')]=qs[_0xfbc8('0x31')](_0x20d9fd[_0xfbc8('0x29')][_0xfbc8('0x31')]);_0x5cce41['where']=qs[_0xfbc8('0x2a')](_['pick'](_0x20d9fd['query'],_0x5d35cd[_0xfbc8('0x2a')]),_0x4ec3f4);if(_0x20d9fd[_0xfbc8('0x29')]['filter']){_0x5cce41[_0xfbc8('0x32')]=_[_0xfbc8('0x33')](_0x5cce41[_0xfbc8('0x32')],{'$or':_[_0xfbc8('0x23')](_0x4ec3f4,function(_0x2e175f){if(_0x2e175f['type']!=='VIRTUAL'){var _0x5303a3={};_0x5303a3[_0x2e175f[_0xfbc8('0x21')]]={'$like':'%'+_0x20d9fd[_0xfbc8('0x29')]['filter']+'%'};return _0x5303a3;}})});}_0x5cce41=_['merge']({},_0x5cce41,_0x20d9fd[_0xfbc8('0x34')]);var _0x32f02f={'where':_0x5cce41[_0xfbc8('0x32')]};return db['SugarcrmAccount'][_0xfbc8('0x18')](_0x32f02f)[_0xfbc8('0x1e')](function(_0x4d5024){_0x325d71['count']=_0x4d5024;if(_0x20d9fd[_0xfbc8('0x29')][_0xfbc8('0x35')]){_0x5cce41['include']=[{'all':!![]}];}return db[_0xfbc8('0x24')][_0xfbc8('0x36')](_0x5cce41);})['then'](function(_0x315037){_0x325d71[_0xfbc8('0x37')]=_0x315037;return _0x325d71;})[_0xfbc8('0x1e')](respondWithFilteredResult(_0x3c4b93,_0x5cce41))[_0xfbc8('0x38')](handleError(_0x3c4b93,null));};exports[_0xfbc8('0x39')]=function(_0x2920ca,_0x4ed7e5){var _0x287bf2={'raw':![],'where':{'id':_0x2920ca[_0xfbc8('0x3a')]['id']}},_0x5b3985={};_0x5b3985[_0xfbc8('0x28')]=_['keys'](db['SugarcrmAccount'][_0xfbc8('0x25')]);_0x5b3985['query']=_['keys'](_0x2920ca['query']);_0x5b3985['filters']=_[_0xfbc8('0x2b')](_0x5b3985[_0xfbc8('0x28')],_0x5b3985['query']);_0x287bf2[_0xfbc8('0x2c')]=_[_0xfbc8('0x2b')](_0x5b3985[_0xfbc8('0x28')],qs[_0xfbc8('0x2d')](_0x2920ca[_0xfbc8('0x29')]['fields']));_0x287bf2['attributes']=_0x287bf2['attributes'][_0xfbc8('0x2e')]?_0x287bf2['attributes']:_0x5b3985[_0xfbc8('0x28')];if(_0x2920ca[_0xfbc8('0x29')][_0xfbc8('0x35')]){_0x287bf2[_0xfbc8('0x3b')]=[{'all':!![]}];}_0x287bf2=_[_0xfbc8('0x33')]({},_0x287bf2,_0x2920ca[_0xfbc8('0x34')]);return db[_0xfbc8('0x24')][_0xfbc8('0x3c')](_0x287bf2)[_0xfbc8('0x1e')](handleEntityNotFound(_0x4ed7e5,null))[_0xfbc8('0x1e')](respondWithResult(_0x4ed7e5,null))[_0xfbc8('0x38')](handleError(_0x4ed7e5,null));};exports['create']=function(_0x4ab469,_0x50b5be){return db[_0xfbc8('0x24')][_0xfbc8('0x3d')](_0x4ab469[_0xfbc8('0x3e')],{})[_0xfbc8('0x1e')](respondWithResult(_0x50b5be,0xc9))[_0xfbc8('0x38')](handleError(_0x50b5be,null));};exports[_0xfbc8('0x1d')]=function(_0x284ffa,_0x2645b9){if(_0x284ffa[_0xfbc8('0x3e')]['id']){delete _0x284ffa[_0xfbc8('0x3e')]['id'];}return db[_0xfbc8('0x24')]['find']({'where':{'id':_0x284ffa[_0xfbc8('0x3a')]['id']}})[_0xfbc8('0x1e')](handleEntityNotFound(_0x2645b9,null))['then'](saveUpdates(_0x284ffa['body'],null))[_0xfbc8('0x1e')](respondWithResult(_0x2645b9,null))[_0xfbc8('0x38')](handleError(_0x2645b9,null));};exports[_0xfbc8('0x3f')]=function(_0x12c26a,_0x53218e){return db[_0xfbc8('0x24')][_0xfbc8('0x3c')]({'where':{'id':_0x12c26a[_0xfbc8('0x3a')]['id']}})[_0xfbc8('0x1e')](handleEntityNotFound(_0x53218e,null))[_0xfbc8('0x1e')](removeEntity(_0x53218e,null))[_0xfbc8('0x38')](handleError(_0x53218e,null));};exports[_0xfbc8('0x40')]=function(_0x18f985,_0x460761,_0x4f1ca3){var _0x4dcea9={};var _0x3645d1={};var _0x5c6d31;var _0x475975;return db[_0xfbc8('0x24')]['findOne']({'where':{'id':_0x18f985[_0xfbc8('0x3a')]['id']}})[_0xfbc8('0x1e')](handleEntityNotFound(_0x460761,null))['then'](function(_0x4ffbd8){if(_0x4ffbd8){_0x5c6d31=_0x4ffbd8;_0x3645d1[_0xfbc8('0x28')]=_[_0xfbc8('0x41')](db['SugarcrmConfiguration'][_0xfbc8('0x25')]);_0x3645d1[_0xfbc8('0x29')]=_['keys'](_0x18f985[_0xfbc8('0x29')]);_0x3645d1[_0xfbc8('0x2a')]=_[_0xfbc8('0x2b')](_0x3645d1[_0xfbc8('0x28')],_0x3645d1[_0xfbc8('0x29')]);_0x4dcea9['attributes']=_[_0xfbc8('0x2b')](_0x3645d1[_0xfbc8('0x28')],qs[_0xfbc8('0x2d')](_0x18f985[_0xfbc8('0x29')][_0xfbc8('0x2d')]));_0x4dcea9['attributes']=_0x4dcea9[_0xfbc8('0x2c')][_0xfbc8('0x2e')]?_0x4dcea9[_0xfbc8('0x2c')]:_0x3645d1['model'];_0x4dcea9[_0xfbc8('0x30')]=qs[_0xfbc8('0x31')](_0x18f985['query'][_0xfbc8('0x31')]);_0x4dcea9[_0xfbc8('0x32')]=qs[_0xfbc8('0x2a')](_[_0xfbc8('0x42')](_0x18f985['query'],_0x3645d1[_0xfbc8('0x2a')]));if(_0x18f985[_0xfbc8('0x29')][_0xfbc8('0x43')]){_0x4dcea9[_0xfbc8('0x32')]=_['merge'](_0x4dcea9[_0xfbc8('0x32')],{'$or':_[_0xfbc8('0x23')](_0x4dcea9['attributes'],function(_0x5686f0){var _0x46246e={};_0x46246e[_0x5686f0]={'$like':'%'+_0x18f985['query']['filter']+'%'};return _0x46246e;})});}_0x4dcea9=_['merge']({},_0x4dcea9,_0x18f985[_0xfbc8('0x34')]);return _0x5c6d31[_0xfbc8('0x40')](_0x4dcea9);}})[_0xfbc8('0x1e')](function(_0x47f030){if(_0x47f030){_0x475975=_0x47f030[_0xfbc8('0x2e')];if(!_0x18f985[_0xfbc8('0x29')][_0xfbc8('0x44')]('nolimit')){_0x4dcea9[_0xfbc8('0x19')]=qs[_0xfbc8('0x19')](_0x18f985[_0xfbc8('0x29')][_0xfbc8('0x19')]);_0x4dcea9[_0xfbc8('0x16')]=qs[_0xfbc8('0x16')](_0x18f985[_0xfbc8('0x29')][_0xfbc8('0x16')]);}return _0x5c6d31[_0xfbc8('0x40')](_0x4dcea9);}})[_0xfbc8('0x1e')](function(_0x4bdf80){if(_0x4bdf80){return _0x4bdf80?{'count':_0x475975,'rows':_0x4bdf80}:null;}})[_0xfbc8('0x1e')](respondWithResult(_0x460761,null))[_0xfbc8('0x38')](handleError(_0x460761,null));};exports['addConfiguration']=function(_0x32add3,_0x39eafd,_0x5a5e52){if(_0x32add3['body']['id']){delete _0x32add3[_0xfbc8('0x3e')]['id'];}return db[_0xfbc8('0x24')][_0xfbc8('0x45')]({'where':{'id':_0x32add3[_0xfbc8('0x3a')]['id']}})[_0xfbc8('0x1e')](handleEntityNotFound(_0x39eafd,null))['then'](function(_0x459d3f){if(_0x459d3f){_0x32add3[_0xfbc8('0x3e')][_0xfbc8('0x46')]=_0x459d3f['id'];_0x32add3[_0xfbc8('0x3e')][_0xfbc8('0x47')]=integrations[_0xfbc8('0x48')](_0x32add3['body']['channel'],_0x32add3[_0xfbc8('0x3e')][_0xfbc8('0x27')]);_0x32add3[_0xfbc8('0x3e')][_0xfbc8('0x49')]=integrations[_0xfbc8('0x4a')](_0x32add3[_0xfbc8('0x3e')][_0xfbc8('0x4b')],_0x32add3['body']['type']);return db[_0xfbc8('0x4c')][_0xfbc8('0x3d')](_0x32add3['body'],{'include':[{'model':db[_0xfbc8('0x4d')],'as':_0xfbc8('0x47')},{'model':db['SugarcrmField'],'as':_0xfbc8('0x49')}]});}return null;})[_0xfbc8('0x1e')](respondWithResult(_0x39eafd,null))[_0xfbc8('0x38')](handleError(_0x39eafd,null));};exports[_0xfbc8('0x4e')]=function(_0x114325,_0x512a16,_0x39cdbf){var _0x55b6ff='';var _0x53e3a3=['id',_0xfbc8('0x21'),_0xfbc8('0x4f'),_0xfbc8('0x50'),_0xfbc8('0x51'),_0xfbc8('0x52'),'duration_hours',_0xfbc8('0x53'),_0xfbc8('0x54'),_0xfbc8('0x55'),_0xfbc8('0x56'),_0xfbc8('0x57')];return db[_0xfbc8('0x24')][_0xfbc8('0x45')]({'where':{'id':_0x114325[_0xfbc8('0x3a')]['id']},'attributes':['id',_0xfbc8('0x58'),'password',_0xfbc8('0x59')]})[_0xfbc8('0x1e')](handleEntityNotFound(_0x512a16,null))['then'](function(_0x22ba70){if(_0x22ba70){_0x55b6ff=_0x22ba70[_0xfbc8('0x59')];var _0x37c131=_0x55b6ff['slice'](-0x1);if(_0x37c131==='/'){_0x55b6ff=_0x55b6ff[_0xfbc8('0x5a')](0x0,_0x55b6ff['lastIndexOf'](_0x37c131));}return rp({'method':_0xfbc8('0x5b'),'uri':util[_0xfbc8('0x5c')]('%s%s',_0x55b6ff,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfbc8('0x5d'),'input_type':'JSON','response_type':_0xfbc8('0x5e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x22ba70['username'],'password':_0x22ba70['password'],'encryption':_0xfbc8('0x5f')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xfbc8('0x1e')](function(_0x246569){if(_0x246569&&_0x246569[_0xfbc8('0x21')]!==_0xfbc8('0x60')&&_0x246569[_0xfbc8('0x21')]!==_0xfbc8('0x61')){return rp({'method':_0xfbc8('0x5b'),'uri':util[_0xfbc8('0x5c')]('%s%s',_0x55b6ff,_0xfbc8('0x62')),'json':!![],'form':{'method':_0xfbc8('0x63'),'input_type':_0xfbc8('0x5e'),'response_type':'JSON','rest_data':JSON[_0xfbc8('0x64')]({'session':_0x246569['id'],'module_name':_0xfbc8('0x65')})}})[_0xfbc8('0x1e')](function(_0x18ace1){if(_0x18ace1){var _0xb55a90=_[_0xfbc8('0x66')](_0x18ace1[_0xfbc8('0x67')]);_[_0xfbc8('0x68')](_0xb55a90,function(_0x7366fe){return _0x53e3a3[_0xfbc8('0x69')](_0x7366fe[_0xfbc8('0x21')]);});return{'count':_0xb55a90[_0xfbc8('0x2e')],'rows':_[_0xfbc8('0x23')](_0xb55a90,function(_0x42beb3){return{'id':_0x42beb3[_0xfbc8('0x21')],'name':_0x42beb3[_0xfbc8('0x6a')],'custom':_[_0xfbc8('0x6b')](_0x42beb3['name'],'_c')?!![]:![],'options':_0x42beb3[_0xfbc8('0x34')]?_['map'](_[_0xfbc8('0x66')](_0x42beb3[_0xfbc8('0x34')]),function(_0x2194fa){return{'name':_0x2194fa['value'],'value':_0x2194fa['name']};}):[]};})};}})[_0xfbc8('0x1e')](respondWithResult(_0x512a16,null))[_0xfbc8('0x38')](function(_0x301e53){var _0xfc39b2=_0x114325[_0xfbc8('0x29')][_0xfbc8('0x6c')]?0x1f4:_0x301e53[_0xfbc8('0x6d')]||0x1f4;logger[_0xfbc8('0x1f')](_0xfbc8('0x6e'),'getFields',_0xfc39b2,JSON[_0xfbc8('0x64')](_0x301e53));delete _0x301e53[_0xfbc8('0x21')];if(_0xfc39b2===0x191){_0xfc39b2=0x190;}_0x512a16[_0xfbc8('0x14')](_0xfc39b2)[_0xfbc8('0x6f')](_0x114325[_0xfbc8('0x29')][_0xfbc8('0x6c')]?{'message':_0xfbc8('0x70'),'statusCode':_0x301e53['statusCode']}:_0x301e53);});}else{var _0x18b63b=0x1f4;_0x512a16['status'](_0x18b63b)[_0xfbc8('0x6f')]({'message':_0xfbc8('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xf20e=['Descriptions','getDescriptions','channel','SugarcrmField','Subjects','created_by','description','date_start','duration_minutes','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','format','Calls','values','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','SugarcrmAccount','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf20e,0x176));var _0xef20=function(_0x4c8833,_0x14e755){_0x4c8833=_0x4c8833-0x0;var _0x30df54=_0xf20e[_0x4c8833];return _0x30df54;};'use strict';var emlformat=require(_0xef20('0x0'));var rimraf=require(_0xef20('0x1'));var zipdir=require(_0xef20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef20('0x3'));var moment=require('moment');var BPromise=require(_0xef20('0x4'));var Mustache=require(_0xef20('0x5'));var util=require('util');var path=require(_0xef20('0x6'));var sox=require(_0xef20('0x7'));var csv=require(_0xef20('0x8'));var ejs=require(_0xef20('0x9'));var fs=require('fs');var fs_extra=require(_0xef20('0xa'));var _=require(_0xef20('0xb'));var squel=require('squel');var crypto=require(_0xef20('0xc'));var jsforce=require(_0xef20('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef20('0xe'));var Redis=require(_0xef20('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xef20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef20('0x11'))(_0xef20('0x12'));var utils=require(_0xef20('0x13'));var config=require(_0xef20('0x14'));var licenseUtil=require(_0xef20('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xef20('0x16'));function respondWithStatusCode(_0x522932,_0x452c26){_0x452c26=_0x452c26||0xcc;return function(_0x1b0c2e){if(_0x1b0c2e){return _0x522932['sendStatus'](_0x452c26);}return _0x522932[_0xef20('0x17')](_0x452c26)['end']();};}function respondWithResult(_0x5bb245,_0x148840){_0x148840=_0x148840||0xc8;return function(_0x228af0){if(_0x228af0){return _0x5bb245[_0xef20('0x17')](_0x148840)['json'](_0x228af0);}};}function respondWithFilteredResult(_0x1d1440,_0xd3dcc7){return function(_0x22d1bf){if(_0x22d1bf){var _0x205452=typeof _0xd3dcc7[_0xef20('0x18')]===_0xef20('0x19')&&typeof _0xd3dcc7[_0xef20('0x1a')]===_0xef20('0x19');var _0x892b31=_0x22d1bf['count'];var _0x188e37=_0x205452?0x0:_0xd3dcc7['offset'];var _0xa01880=_0x205452?_0x22d1bf[_0xef20('0x1b')]:_0xd3dcc7['offset']+_0xd3dcc7[_0xef20('0x1a')];var _0x4ad84f;if(_0xa01880>=_0x892b31){_0xa01880=_0x892b31;_0x4ad84f=0xc8;}else{_0x4ad84f=0xce;}_0x1d1440[_0xef20('0x17')](_0x4ad84f);return _0x1d1440['set']('Content-Range',_0x188e37+'-'+_0xa01880+'/'+_0x892b31)[_0xef20('0x1c')](_0x22d1bf);}return null;};}function patchUpdates(_0x26a9f9){return function(_0x42d7dd){try{jsonpatch[_0xef20('0x1d')](_0x42d7dd,_0x26a9f9,!![]);}catch(_0x5d2cb8){return BPromise[_0xef20('0x1e')](_0x5d2cb8);}return _0x42d7dd[_0xef20('0x1f')]();};}function saveUpdates(_0x14209f,_0x2fc642){return function(_0x1bc7a4){if(_0x1bc7a4){return _0x1bc7a4[_0xef20('0x20')](_0x14209f)[_0xef20('0x21')](function(_0x24c70c){return _0x24c70c;});}return null;};}function removeEntity(_0x565a69,_0xb05c86){return function(_0x12829b){if(_0x12829b){return _0x12829b[_0xef20('0x22')]()[_0xef20('0x21')](function(){_0x565a69['status'](0xcc)[_0xef20('0x23')]();});}};}function handleEntityNotFound(_0x507cc1,_0x1f4c7d){return function(_0x2fb7a0){if(!_0x2fb7a0){_0x507cc1[_0xef20('0x24')](0x194);}return _0x2fb7a0;};}function handleError(_0x59c0fa,_0x47e6dc){_0x47e6dc=_0x47e6dc||0x1f4;return function(_0x1fc5b7){logger[_0xef20('0x25')](_0x1fc5b7[_0xef20('0x26')]);if(_0x1fc5b7['name']){delete _0x1fc5b7[_0xef20('0x27')];}_0x59c0fa[_0xef20('0x17')](_0x47e6dc)[_0xef20('0x28')](_0x1fc5b7);};}exports['index']=function(_0x2beb7b,_0x4578a2){var _0x31032c={},_0x516ed2={},_0x1d3f8c={'count':0x0,'rows':[]};var _0x2b603b=_[_0xef20('0x29')](db[_0xef20('0x2a')]['rawAttributes'],function(_0x3ef085){return{'name':_0x3ef085[_0xef20('0x2b')],'type':_0x3ef085[_0xef20('0x2c')]['key']};});_0x516ed2[_0xef20('0x2d')]=_['map'](_0x2b603b,_0xef20('0x27'));_0x516ed2[_0xef20('0x2e')]=_[_0xef20('0x2f')](_0x2beb7b['query']);_0x516ed2['filters']=_[_0xef20('0x30')](_0x516ed2[_0xef20('0x2d')],_0x516ed2['query']);_0x31032c[_0xef20('0x31')]=_[_0xef20('0x30')](_0x516ed2['model'],qs[_0xef20('0x32')](_0x2beb7b['query'][_0xef20('0x32')]));_0x31032c['attributes']=_0x31032c[_0xef20('0x31')][_0xef20('0x33')]?_0x31032c['attributes']:_0x516ed2['model'];if(!_0x2beb7b[_0xef20('0x2e')][_0xef20('0x34')](_0xef20('0x35'))){_0x31032c[_0xef20('0x1a')]=qs[_0xef20('0x1a')](_0x2beb7b[_0xef20('0x2e')][_0xef20('0x1a')]);_0x31032c[_0xef20('0x18')]=qs[_0xef20('0x18')](_0x2beb7b['query'][_0xef20('0x18')]);}_0x31032c[_0xef20('0x36')]=qs[_0xef20('0x37')](_0x2beb7b[_0xef20('0x2e')][_0xef20('0x37')]);_0x31032c[_0xef20('0x38')]=qs[_0xef20('0x39')](_[_0xef20('0x3a')](_0x2beb7b[_0xef20('0x2e')],_0x516ed2[_0xef20('0x39')]),_0x2b603b);if(_0x2beb7b[_0xef20('0x2e')][_0xef20('0x3b')]){_0x31032c[_0xef20('0x38')]=_[_0xef20('0x3c')](_0x31032c[_0xef20('0x38')],{'$or':_['map'](_0x2b603b,function(_0xbc8b4e){if(_0xbc8b4e['type']!=='VIRTUAL'){var _0x1310b1={};_0x1310b1[_0xbc8b4e[_0xef20('0x27')]]={'$like':'%'+_0x2beb7b['query'][_0xef20('0x3b')]+'%'};return _0x1310b1;}})});}_0x31032c=_[_0xef20('0x3c')]({},_0x31032c,_0x2beb7b[_0xef20('0x3d')]);var _0x1c3fcd={'where':_0x31032c[_0xef20('0x38')]};return db[_0xef20('0x2a')][_0xef20('0x1b')](_0x1c3fcd)[_0xef20('0x21')](function(_0x2acb9b){_0x1d3f8c[_0xef20('0x1b')]=_0x2acb9b;if(_0x2beb7b['query'][_0xef20('0x3e')]){_0x31032c[_0xef20('0x3f')]=[{'all':!![]}];}return db[_0xef20('0x2a')][_0xef20('0x40')](_0x31032c);})[_0xef20('0x21')](function(_0x1c7508){_0x1d3f8c['rows']=_0x1c7508;return _0x1d3f8c;})[_0xef20('0x21')](respondWithFilteredResult(_0x4578a2,_0x31032c))[_0xef20('0x41')](handleError(_0x4578a2,null));};exports[_0xef20('0x42')]=function(_0x357eef,_0x2bddc0){var _0x5d28fc={'raw':![],'where':{'id':_0x357eef[_0xef20('0x43')]['id']}},_0x5c6157={};_0x5c6157[_0xef20('0x2d')]=_[_0xef20('0x2f')](db[_0xef20('0x2a')][_0xef20('0x44')]);_0x5c6157[_0xef20('0x2e')]=_[_0xef20('0x2f')](_0x357eef[_0xef20('0x2e')]);_0x5c6157[_0xef20('0x39')]=_['intersection'](_0x5c6157[_0xef20('0x2d')],_0x5c6157[_0xef20('0x2e')]);_0x5d28fc[_0xef20('0x31')]=_[_0xef20('0x30')](_0x5c6157['model'],qs[_0xef20('0x32')](_0x357eef['query'][_0xef20('0x32')]));_0x5d28fc['attributes']=_0x5d28fc[_0xef20('0x31')][_0xef20('0x33')]?_0x5d28fc[_0xef20('0x31')]:_0x5c6157[_0xef20('0x2d')];if(_0x357eef[_0xef20('0x2e')][_0xef20('0x3e')]){_0x5d28fc[_0xef20('0x3f')]=[{'all':!![]}];}_0x5d28fc=_['merge']({},_0x5d28fc,_0x357eef[_0xef20('0x3d')]);return db['SugarcrmAccount'][_0xef20('0x45')](_0x5d28fc)[_0xef20('0x21')](handleEntityNotFound(_0x2bddc0,null))['then'](respondWithResult(_0x2bddc0,null))[_0xef20('0x41')](handleError(_0x2bddc0,null));};exports[_0xef20('0x46')]=function(_0x615259,_0x4f6118){return db[_0xef20('0x2a')][_0xef20('0x46')](_0x615259[_0xef20('0x47')],{})[_0xef20('0x21')](respondWithResult(_0x4f6118,0xc9))['catch'](handleError(_0x4f6118,null));};exports[_0xef20('0x20')]=function(_0x54194e,_0x2dcf1b){if(_0x54194e[_0xef20('0x47')]['id']){delete _0x54194e[_0xef20('0x47')]['id'];}return db['SugarcrmAccount'][_0xef20('0x45')]({'where':{'id':_0x54194e[_0xef20('0x43')]['id']}})[_0xef20('0x21')](handleEntityNotFound(_0x2dcf1b,null))[_0xef20('0x21')](saveUpdates(_0x54194e[_0xef20('0x47')],null))[_0xef20('0x21')](respondWithResult(_0x2dcf1b,null))[_0xef20('0x41')](handleError(_0x2dcf1b,null));};exports[_0xef20('0x22')]=function(_0x1a01ea,_0x4c393f){return db[_0xef20('0x2a')][_0xef20('0x45')]({'where':{'id':_0x1a01ea[_0xef20('0x43')]['id']}})[_0xef20('0x21')](handleEntityNotFound(_0x4c393f,null))[_0xef20('0x21')](removeEntity(_0x4c393f,null))[_0xef20('0x41')](handleError(_0x4c393f,null));};exports[_0xef20('0x48')]=function(_0x414892,_0x4d39c6,_0x430d0f){var _0x69a4c={};var _0xcb3efa={};var _0x2470fa;var _0x8f9de8;return db[_0xef20('0x2a')][_0xef20('0x49')]({'where':{'id':_0x414892[_0xef20('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d39c6,null))[_0xef20('0x21')](function(_0x51807f){if(_0x51807f){_0x2470fa=_0x51807f;_0xcb3efa[_0xef20('0x2d')]=_[_0xef20('0x2f')](db[_0xef20('0x4a')][_0xef20('0x44')]);_0xcb3efa['query']=_['keys'](_0x414892[_0xef20('0x2e')]);_0xcb3efa[_0xef20('0x39')]=_[_0xef20('0x30')](_0xcb3efa[_0xef20('0x2d')],_0xcb3efa[_0xef20('0x2e')]);_0x69a4c[_0xef20('0x31')]=_['intersection'](_0xcb3efa[_0xef20('0x2d')],qs[_0xef20('0x32')](_0x414892[_0xef20('0x2e')][_0xef20('0x32')]));_0x69a4c['attributes']=_0x69a4c['attributes']['length']?_0x69a4c['attributes']:_0xcb3efa[_0xef20('0x2d')];_0x69a4c['order']=qs[_0xef20('0x37')](_0x414892['query'][_0xef20('0x37')]);_0x69a4c['where']=qs[_0xef20('0x39')](_['pick'](_0x414892[_0xef20('0x2e')],_0xcb3efa[_0xef20('0x39')]));if(_0x414892[_0xef20('0x2e')][_0xef20('0x3b')]){_0x69a4c[_0xef20('0x38')]=_['merge'](_0x69a4c['where'],{'$or':_[_0xef20('0x29')](_0x69a4c[_0xef20('0x31')],function(_0x1898ed){var _0x42f5fc={};_0x42f5fc[_0x1898ed]={'$like':'%'+_0x414892['query'][_0xef20('0x3b')]+'%'};return _0x42f5fc;})});}_0x69a4c=_[_0xef20('0x3c')]({},_0x69a4c,_0x414892[_0xef20('0x3d')]);return _0x2470fa[_0xef20('0x48')](_0x69a4c);}})[_0xef20('0x21')](function(_0x474688){if(_0x474688){_0x8f9de8=_0x474688[_0xef20('0x33')];if(!_0x414892[_0xef20('0x2e')][_0xef20('0x34')](_0xef20('0x35'))){_0x69a4c[_0xef20('0x1a')]=qs['limit'](_0x414892['query'][_0xef20('0x1a')]);_0x69a4c[_0xef20('0x18')]=qs[_0xef20('0x18')](_0x414892[_0xef20('0x2e')][_0xef20('0x18')]);}return _0x2470fa['getConfigurations'](_0x69a4c);}})[_0xef20('0x21')](function(_0x143409){if(_0x143409){return _0x143409?{'count':_0x8f9de8,'rows':_0x143409}:null;}})[_0xef20('0x21')](respondWithResult(_0x4d39c6,null))[_0xef20('0x41')](handleError(_0x4d39c6,null));};exports[_0xef20('0x4b')]=function(_0x2906a7,_0xc1dacc,_0x305de4){if(_0x2906a7['body']['id']){delete _0x2906a7[_0xef20('0x47')]['id'];}return db[_0xef20('0x2a')][_0xef20('0x49')]({'where':{'id':_0x2906a7[_0xef20('0x43')]['id']}})[_0xef20('0x21')](handleEntityNotFound(_0xc1dacc,null))['then'](function(_0x3d29d3){if(_0x3d29d3){_0x2906a7[_0xef20('0x47')][_0xef20('0x4c')]=_0x3d29d3['id'];_0x2906a7[_0xef20('0x47')]['Subjects']=integrations[_0xef20('0x4d')](_0x2906a7[_0xef20('0x47')]['channel'],_0x2906a7[_0xef20('0x47')][_0xef20('0x2c')]);_0x2906a7[_0xef20('0x47')][_0xef20('0x4e')]=integrations[_0xef20('0x4f')](_0x2906a7[_0xef20('0x47')][_0xef20('0x50')],_0x2906a7['body']['type']);return db[_0xef20('0x4a')]['create'](_0x2906a7['body'],{'include':[{'model':db[_0xef20('0x51')],'as':_0xef20('0x52')},{'model':db[_0xef20('0x51')],'as':_0xef20('0x4e')}]});}return null;})[_0xef20('0x21')](respondWithResult(_0xc1dacc,null))[_0xef20('0x41')](handleError(_0xc1dacc,null));};exports['getFields']=function(_0x179fbc,_0x4a4d96,_0x3c7b08){var _0xff2158='';var _0x17ef52=['id',_0xef20('0x27'),'assigned_user_id',_0xef20('0x53'),_0xef20('0x54'),_0xef20('0x55'),'duration_hours',_0xef20('0x56'),'parent_id','parent_type',_0xef20('0x57'),_0xef20('0x58')];return db['SugarcrmAccount'][_0xef20('0x49')]({'where':{'id':_0x179fbc[_0xef20('0x43')]['id']},'attributes':['id','username',_0xef20('0x59'),'remoteUri']})['then'](handleEntityNotFound(_0x4a4d96,null))[_0xef20('0x21')](function(_0x1cf18b){if(_0x1cf18b){_0xff2158=_0x1cf18b[_0xef20('0x5a')];var _0x5dc518=_0xff2158[_0xef20('0x5b')](-0x1);if(_0x5dc518==='/'){_0xff2158=_0xff2158[_0xef20('0x5c')](0x0,_0xff2158[_0xef20('0x5d')](_0x5dc518));}return rp({'method':_0xef20('0x5e'),'uri':util['format'](_0xef20('0x5f'),_0xff2158,_0xef20('0x60')),'json':!![],'form':{'method':_0xef20('0x61'),'input_type':_0xef20('0x62'),'response_type':'JSON','rest_data':JSON[_0xef20('0x63')]({'user_auth':{'user_name':_0x1cf18b[_0xef20('0x64')],'password':_0x1cf18b['password'],'encryption':_0xef20('0x65')},'application':_0xef20('0x66')})}});}})[_0xef20('0x21')](function(_0x3085e0){if(_0x3085e0&&_0x3085e0[_0xef20('0x27')]!=='Invalid\x20Login'&&_0x3085e0['name']!=='Password\x20Expired'){return rp({'method':_0xef20('0x5e'),'uri':util[_0xef20('0x67')]('%s%s',_0xff2158,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xef20('0x62'),'response_type':_0xef20('0x62'),'rest_data':JSON[_0xef20('0x63')]({'session':_0x3085e0['id'],'module_name':_0xef20('0x68')})}})[_0xef20('0x21')](function(_0x58faa3){if(_0x58faa3){var _0x682223=_[_0xef20('0x69')](_0x58faa3['module_fields']);_['remove'](_0x682223,function(_0x766c67){return _0x17ef52['includes'](_0x766c67[_0xef20('0x27')]);});return{'count':_0x682223[_0xef20('0x33')],'rows':_[_0xef20('0x29')](_0x682223,function(_0x350621){return{'id':_0x350621[_0xef20('0x27')],'name':_0x350621[_0xef20('0x6a')],'custom':_[_0xef20('0x6b')](_0x350621['name'],'_c')?!![]:![],'options':_0x350621[_0xef20('0x3d')]?_[_0xef20('0x29')](_[_0xef20('0x69')](_0x350621['options']),function(_0x1d1592){return{'name':_0x1d1592[_0xef20('0x6c')],'value':_0x1d1592[_0xef20('0x27')]};}):[]};})};}})[_0xef20('0x21')](respondWithResult(_0x4a4d96,null))[_0xef20('0x41')](function(_0x31338e){var _0x24122e=_0x179fbc[_0xef20('0x2e')][_0xef20('0x6d')]?0x1f4:_0x31338e[_0xef20('0x6e')]||0x1f4;logger[_0xef20('0x25')](_0xef20('0x6f'),'getFields',_0x24122e,JSON[_0xef20('0x63')](_0x31338e));delete _0x31338e[_0xef20('0x27')];if(_0x24122e===0x191){_0x24122e=0x190;}_0x4a4d96['status'](_0x24122e)[_0xef20('0x28')](_0x179fbc['query'][_0xef20('0x6d')]?{'message':_0xef20('0x70'),'statusCode':_0x31338e['statusCode']}:_0x31338e);});}else{var _0x41b2ac=0x1f4;_0x4a4d96[_0xef20('0x17')](_0x41b2ac)[_0xef20('0x28')]({'message':_0xef20('0x70'),'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 5d9e35f..8f2372a 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 _0x68df=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x16e9dd,_0x688c6){var _0x3ef25b=function(_0x156b70){while(--_0x156b70){_0x16e9dd['push'](_0x16e9dd['shift']());}};_0x3ef25b(++_0x688c6);}(_0x68df,0xcd));var _0xf68d=function(_0x435117,_0x2b9bad){_0x435117=_0x435117-0x0;var _0x585a63=_0x68df[_0x435117];return _0x585a63;};'use strict';var _=require(_0xf68d('0x0'));var util=require(_0xf68d('0x1'));var logger=require(_0xf68d('0x2'))('api');var moment=require(_0xf68d('0x3'));var BPromise=require(_0xf68d('0x4'));var rp=require(_0xf68d('0x5'));var fs=require('fs');var path=require(_0xf68d('0x6'));var rimraf=require(_0xf68d('0x7'));var config=require(_0xf68d('0x8'));var attributes=require(_0xf68d('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf68d('0xa')]=function(_0x5a9026,_0xee6674){return _0x5a9026['define'](_0xf68d('0xb'),attributes,{'tableName':_0xf68d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x154f=['moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','../../config/logger','api'];(function(_0x53e147,_0x3e425e){var _0x55d677=function(_0x544d47){while(--_0x544d47){_0x53e147['push'](_0x53e147['shift']());}};_0x55d677(++_0x3e425e);}(_0x154f,0x98));var _0xf154=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x154f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf154('0x0'))(_0xf154('0x1'));var moment=require(_0xf154('0x2'));var BPromise=require('bluebird');var rp=require(_0xf154('0x3'));var fs=require('fs');var path=require(_0xf154('0x4'));var rimraf=require(_0xf154('0x5'));var config=require(_0xf154('0x6'));var attributes=require(_0xf154('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf154('0x8')]=function(_0x4b0e86,_0x2a67cb){return _0x4b0e86[_0xf154('0x9')](_0xf154('0xa'),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 54bd087..65fba5a 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 _0xa037=['limit','map','model','include','GetSugarcrmAccount','find','raw','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','findAll','options','where','attributes'];(function(_0x435731,_0x2e59d4){var _0xbbb1d4=function(_0x5f5bc4){while(--_0x5f5bc4){_0x435731['push'](_0x435731['shift']());}};_0xbbb1d4(++_0x2e59d4);}(_0xa037,0x68));var _0x7a03=function(_0x50753f,_0x179899){_0x50753f=_0x50753f-0x0;var _0x106e1c=_0xa037[_0x50753f];return _0x106e1c;};'use strict';var _=require(_0x7a03('0x0'));var util=require(_0x7a03('0x1'));var moment=require('moment');var BPromise=require(_0x7a03('0x2'));var rs=require(_0x7a03('0x3'));var fs=require('fs');var Redis=require(_0x7a03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a03('0x5'));var logger=require('../../config/logger')(_0x7a03('0x6'));var config=require(_0x7a03('0x7'));var jayson=require(_0x7a03('0x8'));var client=jayson[_0x7a03('0x9')][_0x7a03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4990b1,_0x19e550,_0x3ddf7e){return new BPromise(function(_0x51685d,_0x486528){return client['request'](_0x4990b1,_0x3ddf7e)[_0x7a03('0xb')](function(_0xbd048f){logger['info'](_0x7a03('0xc'),_0x19e550,_0x7a03('0xd'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x19e550,_0x7a03('0xd'),JSON[_0x7a03('0xe')](_0xbd048f));if(_0xbd048f['error']){if(_0xbd048f[_0x7a03('0xf')][_0x7a03('0x10')]===0x1f4){logger[_0x7a03('0xf')](_0x7a03('0xc'),_0x19e550,_0xbd048f[_0x7a03('0xf')][_0x7a03('0x11')]);return _0x486528(_0xbd048f[_0x7a03('0xf')][_0x7a03('0x11')]);}logger[_0x7a03('0xf')](_0x7a03('0xc'),_0x19e550,_0xbd048f[_0x7a03('0xf')][_0x7a03('0x11')]);return _0x51685d(_0xbd048f[_0x7a03('0xf')][_0x7a03('0x11')]);}else{logger[_0x7a03('0x12')](_0x7a03('0xc'),_0x19e550,_0x7a03('0xd'));_0x51685d(_0xbd048f['result'][_0x7a03('0x11')]);}})[_0x7a03('0x13')](function(_0x180025){logger[_0x7a03('0xf')](_0x7a03('0xc'),_0x19e550,_0x180025);_0x486528(_0x180025);});});}exports['GetSugarcrmAccount']=function(_0x46f8ea){var _0x23c990=this;return new Promise(function(_0x220f31,_0xc795b1){return db['SugarcrmAccount'][_0x7a03('0x14')]({'raw':_0x46f8ea[_0x7a03('0x15')]?_0x46f8ea['options']['raw']===undefined?!![]:![]:!![],'where':_0x46f8ea['options']?_0x46f8ea['options'][_0x7a03('0x16')]||null:null,'attributes':_0x46f8ea[_0x7a03('0x15')]?_0x46f8ea[_0x7a03('0x15')][_0x7a03('0x17')]||null:null,'limit':_0x46f8ea['options']?_0x46f8ea[_0x7a03('0x15')][_0x7a03('0x18')]||null:null,'include':_0x46f8ea[_0x7a03('0x15')]?_0x46f8ea[_0x7a03('0x15')]['include']?_[_0x7a03('0x19')](_0x46f8ea['options']['include'],function(_0x3555cb){return{'model':db[_0x3555cb[_0x7a03('0x1a')]],'as':_0x3555cb['as'],'attributes':_0x3555cb['attributes'],'include':_0x3555cb[_0x7a03('0x1b')]?_['map'](_0x3555cb[_0x7a03('0x1b')],function(_0x4c0496){return{'model':db[_0x4c0496[_0x7a03('0x1a')]],'as':_0x4c0496['as'],'attributes':_0x4c0496[_0x7a03('0x17')],'include':_0x4c0496[_0x7a03('0x1b')]?_[_0x7a03('0x19')](_0x4c0496[_0x7a03('0x1b')],function(_0x590a4f){return{'model':db[_0x590a4f['model']],'as':_0x590a4f['as'],'attributes':_0x590a4f[_0x7a03('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x453fc0){logger[_0x7a03('0x12')](_0x7a03('0x1c'),_0x46f8ea);logger['debug'](_0x7a03('0x1c'),_0x46f8ea,JSON[_0x7a03('0xe')](_0x453fc0));_0x220f31(_0x453fc0);})[_0x7a03('0x13')](function(_0x3a264a){logger[_0x7a03('0xf')]('GetSugarcrmAccount',_0x3a264a[_0x7a03('0x11')],_0x46f8ea);_0xc795b1(_0x23c990[_0x7a03('0xf')](0x1f4,_0x3a264a[_0x7a03('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0xd931bf){var _0x145b56=this;return new Promise(function(_0xc23983,_0x5c41cc){return db['SugarcrmAccount'][_0x7a03('0x1d')]({'raw':_0xd931bf['options']?_0xd931bf[_0x7a03('0x15')][_0x7a03('0x1e')]===undefined?!![]:![]:!![],'where':_0xd931bf[_0x7a03('0x15')]?_0xd931bf[_0x7a03('0x15')][_0x7a03('0x16')]||null:null,'attributes':_0xd931bf['options']?_0xd931bf['options'][_0x7a03('0x17')]||null:null,'include':_0xd931bf[_0x7a03('0x15')]?_0xd931bf['options'][_0x7a03('0x1b')]?_[_0x7a03('0x19')](_0xd931bf[_0x7a03('0x15')][_0x7a03('0x1b')],function(_0x235e06){return{'model':db[_0x235e06[_0x7a03('0x1a')]],'as':_0x235e06['as'],'attributes':_0x235e06[_0x7a03('0x17')],'include':_0x235e06[_0x7a03('0x1b')]?_[_0x7a03('0x19')](_0x235e06[_0x7a03('0x1b')],function(_0x1caa7e){return{'model':db[_0x1caa7e[_0x7a03('0x1a')]],'as':_0x1caa7e['as'],'attributes':_0x1caa7e[_0x7a03('0x17')],'include':_0x1caa7e[_0x7a03('0x1b')]?_['map'](_0x1caa7e[_0x7a03('0x1b')],function(_0x54a35d){return{'model':db[_0x54a35d[_0x7a03('0x1a')]],'as':_0x54a35d['as'],'attributes':_0x54a35d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a03('0xb')](function(_0xb16623){logger[_0x7a03('0x12')](_0x7a03('0x1f'),_0xd931bf);logger['debug'](_0x7a03('0x1f'),_0xd931bf,JSON[_0x7a03('0xe')](_0xb16623));_0xc23983(_0xb16623);})[_0x7a03('0x13')](function(_0x5ef995){logger['error'](_0x7a03('0x1f'),_0x5ef995[_0x7a03('0x11')],_0xd931bf);_0x5c41cc(_0x145b56[_0x7a03('0xf')](0x1f4,_0x5ef995['message']));});});}; \ No newline at end of file +var _0x7150=['model','then','catch','ShowSugarcrmAccount','find','raw','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','include','map'];(function(_0x2978b1,_0x480dcf){var _0xaa9f41=function(_0x3a152b){while(--_0x3a152b){_0x2978b1['push'](_0x2978b1['shift']());}};_0xaa9f41(++_0x480dcf);}(_0x7150,0x147));var _0x0715=function(_0x4bc4e6,_0x4d4ecb){_0x4bc4e6=_0x4bc4e6-0x0;var _0x265ec3=_0x7150[_0x4bc4e6];return _0x265ec3;};'use strict';var _=require(_0x0715('0x0'));var util=require('util');var moment=require(_0x0715('0x1'));var BPromise=require(_0x0715('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0715('0x3'));var db=require(_0x0715('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0715('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0715('0x6')][_0x0715('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f3709,_0x221baa,_0x445562){return new BPromise(function(_0x2a83ba,_0x5cefe5){return client['request'](_0x5f3709,_0x445562)['then'](function(_0xa10dad){logger[_0x0715('0x8')](_0x0715('0x9'),_0x221baa,'request\x20sent');logger[_0x0715('0xa')](_0x0715('0xb'),_0x221baa,_0x0715('0xc'),JSON['stringify'](_0xa10dad));if(_0xa10dad[_0x0715('0xd')]){if(_0xa10dad['error'][_0x0715('0xe')]===0x1f4){logger['error'](_0x0715('0x9'),_0x221baa,_0xa10dad[_0x0715('0xd')][_0x0715('0xf')]);return _0x5cefe5(_0xa10dad['error'][_0x0715('0xf')]);}logger['error'](_0x0715('0x9'),_0x221baa,_0xa10dad[_0x0715('0xd')][_0x0715('0xf')]);return _0x2a83ba(_0xa10dad[_0x0715('0xd')][_0x0715('0xf')]);}else{logger[_0x0715('0x8')](_0x0715('0x9'),_0x221baa,_0x0715('0xc'));_0x2a83ba(_0xa10dad[_0x0715('0x10')][_0x0715('0xf')]);}})['catch'](function(_0x274711){logger[_0x0715('0xd')](_0x0715('0x9'),_0x221baa,_0x274711);_0x5cefe5(_0x274711);});});}exports[_0x0715('0x11')]=function(_0x3d7284){var _0xa62383=this;return new Promise(function(_0x58803f,_0xf74897){return db[_0x0715('0x12')][_0x0715('0x13')]({'raw':_0x3d7284[_0x0715('0x14')]?_0x3d7284[_0x0715('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3d7284[_0x0715('0x14')]?_0x3d7284['options'][_0x0715('0x15')]||null:null,'attributes':_0x3d7284[_0x0715('0x14')]?_0x3d7284[_0x0715('0x14')][_0x0715('0x16')]||null:null,'limit':_0x3d7284[_0x0715('0x14')]?_0x3d7284[_0x0715('0x14')]['limit']||null:null,'include':_0x3d7284['options']?_0x3d7284['options'][_0x0715('0x17')]?_[_0x0715('0x18')](_0x3d7284[_0x0715('0x14')][_0x0715('0x17')],function(_0x2ce28d){return{'model':db[_0x2ce28d[_0x0715('0x19')]],'as':_0x2ce28d['as'],'attributes':_0x2ce28d[_0x0715('0x16')],'include':_0x2ce28d[_0x0715('0x17')]?_[_0x0715('0x18')](_0x2ce28d[_0x0715('0x17')],function(_0x57cfac){return{'model':db[_0x57cfac[_0x0715('0x19')]],'as':_0x57cfac['as'],'attributes':_0x57cfac[_0x0715('0x16')],'include':_0x57cfac[_0x0715('0x17')]?_[_0x0715('0x18')](_0x57cfac[_0x0715('0x17')],function(_0x50322e){return{'model':db[_0x50322e['model']],'as':_0x50322e['as'],'attributes':_0x50322e[_0x0715('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0715('0x1a')](function(_0x442901){logger[_0x0715('0x8')]('GetSugarcrmAccount',_0x3d7284);logger[_0x0715('0xa')](_0x0715('0x11'),_0x3d7284,JSON['stringify'](_0x442901));_0x58803f(_0x442901);})[_0x0715('0x1b')](function(_0x1c6660){logger['error'](_0x0715('0x11'),_0x1c6660['message'],_0x3d7284);_0xf74897(_0xa62383[_0x0715('0xd')](0x1f4,_0x1c6660[_0x0715('0xf')]));});});};exports[_0x0715('0x1c')]=function(_0x4d76d7){var _0x3f5de5=this;return new Promise(function(_0x257714,_0x385d2d){return db[_0x0715('0x12')][_0x0715('0x1d')]({'raw':_0x4d76d7[_0x0715('0x14')]?_0x4d76d7['options'][_0x0715('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d76d7['options']?_0x4d76d7[_0x0715('0x14')][_0x0715('0x15')]||null:null,'attributes':_0x4d76d7[_0x0715('0x14')]?_0x4d76d7['options'][_0x0715('0x16')]||null:null,'include':_0x4d76d7[_0x0715('0x14')]?_0x4d76d7[_0x0715('0x14')]['include']?_[_0x0715('0x18')](_0x4d76d7[_0x0715('0x14')][_0x0715('0x17')],function(_0x2dee78){return{'model':db[_0x2dee78[_0x0715('0x19')]],'as':_0x2dee78['as'],'attributes':_0x2dee78[_0x0715('0x16')],'include':_0x2dee78[_0x0715('0x17')]?_['map'](_0x2dee78[_0x0715('0x17')],function(_0x33afe8){return{'model':db[_0x33afe8[_0x0715('0x19')]],'as':_0x33afe8['as'],'attributes':_0x33afe8[_0x0715('0x16')],'include':_0x33afe8[_0x0715('0x17')]?_[_0x0715('0x18')](_0x33afe8[_0x0715('0x17')],function(_0x195fbf){return{'model':db[_0x195fbf[_0x0715('0x19')]],'as':_0x195fbf['as'],'attributes':_0x195fbf[_0x0715('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0715('0x1a')](function(_0x2527a4){logger[_0x0715('0x8')](_0x0715('0x1c'),_0x4d76d7);logger[_0x0715('0xa')](_0x0715('0x1c'),_0x4d76d7,JSON[_0x0715('0x1f')](_0x2527a4));_0x257714(_0x2527a4);})[_0x0715('0x1b')](function(_0x8f49e8){logger['error'](_0x0715('0x1c'),_0x8f49e8[_0x0715('0xf')],_0x4d76d7);_0x385d2d(_0x3f5de5[_0x0715('0xd')](0x1f4,_0x8f49e8[_0x0715('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 594a52a..db8e39b 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 _0x575b=['post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1e909b,_0x4fe57f){var _0x50c163=function(_0x117a2f){while(--_0x117a2f){_0x1e909b['push'](_0x1e909b['shift']());}};_0x50c163(++_0x4fe57f);}(_0x575b,0x1a4));var _0xb575=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x575b[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb575('0x0'));var timeout=require(_0xb575('0x1'));var express=require(_0xb575('0x2'));var router=express[_0xb575('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb575('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb575('0x5'));var controller=require(_0xb575('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb575('0x7')]);router[_0xb575('0x8')](_0xb575('0x9'),auth[_0xb575('0xa')](),controller[_0xb575('0xb')]);router['get'](_0xb575('0xc'),auth[_0xb575('0xa')](),controller[_0xb575('0xd')]);router[_0xb575('0x8')](_0xb575('0xe'),auth[_0xb575('0xa')](),controller[_0xb575('0xf')]);router[_0xb575('0x8')]('/:id/descriptions',auth[_0xb575('0xa')](),controller[_0xb575('0x10')]);router[_0xb575('0x11')]('/',auth[_0xb575('0xa')](),controller['create']);router[_0xb575('0x12')](_0xb575('0x9'),auth[_0xb575('0xa')](),controller[_0xb575('0x13')]);router[_0xb575('0x14')](_0xb575('0x9'),auth['isAuthenticated'](),controller[_0xb575('0x15')]);module[_0xb575('0x16')]=router; \ No newline at end of file +var _0xffe1=['destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update'];(function(_0x26dc3f,_0x137c16){var _0x1b6ce9=function(_0x3993ff){while(--_0x3993ff){_0x26dc3f['push'](_0x26dc3f['shift']());}};_0x1b6ce9(++_0x137c16);}(_0xffe1,0xf4));var _0x1ffe=function(_0x5411e1,_0xb96341){_0x5411e1=_0x5411e1-0x0;var _0x56f915=_0xffe1[_0x5411e1];return _0x56f915;};'use strict';var multer=require('multer');var util=require(_0x1ffe('0x0'));var path=require(_0x1ffe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ffe('0x2')]();var fs_extra=require(_0x1ffe('0x3'));var auth=require(_0x1ffe('0x4'));var interaction=require(_0x1ffe('0x5'));var config=require(_0x1ffe('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x1ffe('0x7')](),controller[_0x1ffe('0x8')]);router[_0x1ffe('0x9')](_0x1ffe('0xa'),auth[_0x1ffe('0x7')](),controller['show']);router[_0x1ffe('0x9')](_0x1ffe('0xb'),auth[_0x1ffe('0x7')](),controller[_0x1ffe('0xc')]);router[_0x1ffe('0x9')](_0x1ffe('0xd'),auth['isAuthenticated'](),controller[_0x1ffe('0xe')]);router['get']('/:id/descriptions',auth[_0x1ffe('0x7')](),controller[_0x1ffe('0xf')]);router[_0x1ffe('0x10')]('/',auth[_0x1ffe('0x7')](),controller[_0x1ffe('0x11')]);router[_0x1ffe('0x12')]('/:id',auth[_0x1ffe('0x7')](),controller[_0x1ffe('0x13')]);router['delete'](_0x1ffe('0xa'),auth['isAuthenticated'](),controller[_0x1ffe('0x14')]);module[_0x1ffe('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 20806b4..af55c09 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 _0x8c25=['STRING','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8c25,0x109));var _0x58c2=function(_0x475b7c,_0x266a0d){_0x475b7c=_0x475b7c-0x0;var _0x21c3f1=_0x8c25[_0x475b7c];return _0x21c3f1;};'use strict';var Sequelize=require(_0x58c2('0x0'));module['exports']={'name':{'type':Sequelize[_0x58c2('0x1')]},'description':{'type':Sequelize[_0x58c2('0x1')]}}; \ No newline at end of file +var _0x70ce=['exports','STRING','sequelize'];(function(_0x3c6607,_0x247571){var _0x37472c=function(_0x1a09af){while(--_0x1a09af){_0x3c6607['push'](_0x3c6607['shift']());}};_0x37472c(++_0x247571);}(_0x70ce,0x1e5));var _0xe70c=function(_0x236573,_0xe2a72c){_0x236573=_0x236573-0x0;var _0x3ad9e4=_0x70ce[_0x236573];return _0x3ad9e4;};'use strict';var Sequelize=require(_0xe70c('0x0'));module[_0xe70c('0x1')]={'name':{'type':Sequelize[_0xe70c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b9d09b5..560a93a 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 _0x3941=['includeAll','options','find','create','body','catch','getFields','findOne','SugarcrmField','order','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','VIRTUAL','merge','then','include','findAll','rows','show','params','keys','rawAttributes'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x3941,0x110));var _0x1394=function(_0x58d3a9,_0x496a02){_0x58d3a9=_0x58d3a9-0x0;var _0x47e042=_0x3941[_0x58d3a9];return _0x47e042;};'use strict';var emlformat=require(_0x1394('0x0'));var rimraf=require(_0x1394('0x1'));var zipdir=require(_0x1394('0x2'));var jsonpatch=require(_0x1394('0x3'));var rp=require(_0x1394('0x4'));var moment=require(_0x1394('0x5'));var BPromise=require(_0x1394('0x6'));var Mustache=require(_0x1394('0x7'));var util=require(_0x1394('0x8'));var path=require('path');var sox=require(_0x1394('0x9'));var csv=require('to-csv');var ejs=require(_0x1394('0xa'));var fs=require('fs');var fs_extra=require(_0x1394('0xb'));var _=require('lodash');var squel=require(_0x1394('0xc'));var crypto=require(_0x1394('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1394('0xe'));var toCsv=require(_0x1394('0xf'));var querystring=require(_0x1394('0x10'));var Papa=require('papaparse');var Redis=require(_0x1394('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1394('0x12'));var as=require(_0x1394('0x13'));var hardwareService=require(_0x1394('0x14'));var logger=require(_0x1394('0x15'))(_0x1394('0x16'));var utils=require(_0x1394('0x17'));var config=require(_0x1394('0x18'));var licenseUtil=require(_0x1394('0x19'));var db=require(_0x1394('0x1a'))['db'];function respondWithStatusCode(_0x53205c,_0x17eb8c){_0x17eb8c=_0x17eb8c||0xcc;return function(_0xb8c48e){if(_0xb8c48e){return _0x53205c[_0x1394('0x1b')](_0x17eb8c);}return _0x53205c[_0x1394('0x1c')](_0x17eb8c)[_0x1394('0x1d')]();};}function respondWithResult(_0x2ac198,_0x1b4f3b){_0x1b4f3b=_0x1b4f3b||0xc8;return function(_0x128f68){if(_0x128f68){return _0x2ac198[_0x1394('0x1c')](_0x1b4f3b)[_0x1394('0x1e')](_0x128f68);}};}function respondWithFilteredResult(_0x4faad7,_0x8b1be6){return function(_0x31e7b1){if(_0x31e7b1){var _0x53324e=typeof _0x8b1be6['offset']===_0x1394('0x1f')&&typeof _0x8b1be6['limit']==='undefined';var _0x303b00=_0x31e7b1[_0x1394('0x20')];var _0x7c3e3d=_0x53324e?0x0:_0x8b1be6[_0x1394('0x21')];var _0x56c840=_0x53324e?_0x31e7b1[_0x1394('0x20')]:_0x8b1be6[_0x1394('0x21')]+_0x8b1be6[_0x1394('0x22')];var _0x2fad43;if(_0x56c840>=_0x303b00){_0x56c840=_0x303b00;_0x2fad43=0xc8;}else{_0x2fad43=0xce;}_0x4faad7[_0x1394('0x1c')](_0x2fad43);return _0x4faad7[_0x1394('0x23')](_0x1394('0x24'),_0x7c3e3d+'-'+_0x56c840+'/'+_0x303b00)[_0x1394('0x1e')](_0x31e7b1);}return null;};}function patchUpdates(_0x58512d){return function(_0x461825){try{jsonpatch[_0x1394('0x25')](_0x461825,_0x58512d,!![]);}catch(_0x2cc26d){return BPromise[_0x1394('0x26')](_0x2cc26d);}return _0x461825[_0x1394('0x27')]();};}function saveUpdates(_0x613208,_0x2af789){return function(_0x55e625){if(_0x55e625){return _0x55e625[_0x1394('0x28')](_0x613208)['then'](function(_0x52f7c0){return _0x52f7c0;});}return null;};}function removeEntity(_0x430468,_0xab0645){return function(_0x27a630){if(_0x27a630){return _0x27a630[_0x1394('0x29')]()['then'](function(){_0x430468['status'](0xcc)[_0x1394('0x1d')]();});}};}function handleEntityNotFound(_0x50a245,_0x2a168a){return function(_0xaad2a9){if(!_0xaad2a9){_0x50a245[_0x1394('0x1b')](0x194);}return _0xaad2a9;};}function handleError(_0x472716,_0xd35e0b){_0xd35e0b=_0xd35e0b||0x1f4;return function(_0x2a6079){logger[_0x1394('0x2a')](_0x2a6079[_0x1394('0x2b')]);if(_0x2a6079[_0x1394('0x2c')]){delete _0x2a6079[_0x1394('0x2c')];}_0x472716[_0x1394('0x1c')](_0xd35e0b)[_0x1394('0x2d')](_0x2a6079);};}exports['index']=function(_0x274766,_0xd5efa1){var _0x50f001={},_0x1dcbc4={},_0x3fe37f={'count':0x0,'rows':[]};var _0x14bb2d=_[_0x1394('0x2e')](db[_0x1394('0x2f')]['rawAttributes'],function(_0x45403b){return{'name':_0x45403b[_0x1394('0x30')],'type':_0x45403b[_0x1394('0x31')][_0x1394('0x32')]};});_0x1dcbc4[_0x1394('0x33')]=_['map'](_0x14bb2d,_0x1394('0x2c'));_0x1dcbc4[_0x1394('0x34')]=_['keys'](_0x274766[_0x1394('0x34')]);_0x1dcbc4[_0x1394('0x35')]=_[_0x1394('0x36')](_0x1dcbc4[_0x1394('0x33')],_0x1dcbc4['query']);_0x50f001[_0x1394('0x37')]=_['intersection'](_0x1dcbc4[_0x1394('0x33')],qs[_0x1394('0x38')](_0x274766['query'][_0x1394('0x38')]));_0x50f001[_0x1394('0x37')]=_0x50f001[_0x1394('0x37')][_0x1394('0x39')]?_0x50f001[_0x1394('0x37')]:_0x1dcbc4['model'];if(!_0x274766[_0x1394('0x34')]['hasOwnProperty'](_0x1394('0x3a'))){_0x50f001[_0x1394('0x22')]=qs['limit'](_0x274766['query'][_0x1394('0x22')]);_0x50f001[_0x1394('0x21')]=qs[_0x1394('0x21')](_0x274766[_0x1394('0x34')][_0x1394('0x21')]);}_0x50f001['order']=qs[_0x1394('0x3b')](_0x274766[_0x1394('0x34')]['sort']);_0x50f001['where']=qs['filters'](_['pick'](_0x274766[_0x1394('0x34')],_0x1dcbc4[_0x1394('0x35')]),_0x14bb2d);if(_0x274766['query'][_0x1394('0x3c')]){_0x50f001[_0x1394('0x3d')]=_['merge'](_0x50f001[_0x1394('0x3d')],{'$or':_['map'](_0x14bb2d,function(_0x523415){if(_0x523415[_0x1394('0x31')]!==_0x1394('0x3e')){var _0x44fb81={};_0x44fb81[_0x523415[_0x1394('0x2c')]]={'$like':'%'+_0x274766[_0x1394('0x34')][_0x1394('0x3c')]+'%'};return _0x44fb81;}})});}_0x50f001=_[_0x1394('0x3f')]({},_0x50f001,_0x274766['options']);var _0x256e84={'where':_0x50f001['where']};return db[_0x1394('0x2f')]['count'](_0x256e84)[_0x1394('0x40')](function(_0x4ee711){_0x3fe37f[_0x1394('0x20')]=_0x4ee711;if(_0x274766[_0x1394('0x34')]['includeAll']){_0x50f001[_0x1394('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1394('0x42')](_0x50f001);})['then'](function(_0x1d8a22){_0x3fe37f[_0x1394('0x43')]=_0x1d8a22;return _0x3fe37f;})[_0x1394('0x40')](respondWithFilteredResult(_0xd5efa1,_0x50f001))['catch'](handleError(_0xd5efa1,null));};exports[_0x1394('0x44')]=function(_0x20094d,_0x58476a){var _0x7d04a={'raw':![],'where':{'id':_0x20094d[_0x1394('0x45')]['id']}},_0x412c45={};_0x412c45[_0x1394('0x33')]=_[_0x1394('0x46')](db[_0x1394('0x2f')][_0x1394('0x47')]);_0x412c45[_0x1394('0x34')]=_[_0x1394('0x46')](_0x20094d['query']);_0x412c45[_0x1394('0x35')]=_['intersection'](_0x412c45[_0x1394('0x33')],_0x412c45[_0x1394('0x34')]);_0x7d04a['attributes']=_[_0x1394('0x36')](_0x412c45[_0x1394('0x33')],qs[_0x1394('0x38')](_0x20094d[_0x1394('0x34')][_0x1394('0x38')]));_0x7d04a[_0x1394('0x37')]=_0x7d04a[_0x1394('0x37')][_0x1394('0x39')]?_0x7d04a[_0x1394('0x37')]:_0x412c45[_0x1394('0x33')];if(_0x20094d[_0x1394('0x34')][_0x1394('0x48')]){_0x7d04a[_0x1394('0x41')]=[{'all':!![]}];}_0x7d04a=_['merge']({},_0x7d04a,_0x20094d[_0x1394('0x49')]);return db[_0x1394('0x2f')][_0x1394('0x4a')](_0x7d04a)[_0x1394('0x40')](handleEntityNotFound(_0x58476a,null))[_0x1394('0x40')](respondWithResult(_0x58476a,null))['catch'](handleError(_0x58476a,null));};exports[_0x1394('0x4b')]=function(_0x20a41d,_0x16acf5){return db['SugarcrmConfiguration'][_0x1394('0x4b')](_0x20a41d[_0x1394('0x4c')],{})[_0x1394('0x40')](respondWithResult(_0x16acf5,0xc9))[_0x1394('0x4d')](handleError(_0x16acf5,null));};exports[_0x1394('0x28')]=function(_0x1ae209,_0x5971db){if(_0x1ae209[_0x1394('0x4c')]['id']){delete _0x1ae209['body']['id'];}return db[_0x1394('0x2f')]['find']({'where':{'id':_0x1ae209[_0x1394('0x45')]['id']}})[_0x1394('0x40')](handleEntityNotFound(_0x5971db,null))['then'](saveUpdates(_0x1ae209[_0x1394('0x4c')],null))['then'](respondWithResult(_0x5971db,null))[_0x1394('0x4d')](handleError(_0x5971db,null));};exports[_0x1394('0x29')]=function(_0x3ad02d,_0x10b491){return db[_0x1394('0x2f')][_0x1394('0x4a')]({'where':{'id':_0x3ad02d['params']['id']}})['then'](handleEntityNotFound(_0x10b491,null))[_0x1394('0x40')](removeEntity(_0x10b491,null))['catch'](handleError(_0x10b491,null));};exports[_0x1394('0x4e')]=function(_0x22e568,_0x16f75c,_0x5e08b5){var _0xce27b={};var _0x48c41d={};var _0x3a980d;var _0x1bb662;return db['SugarcrmConfiguration'][_0x1394('0x4f')]({'where':{'id':_0x22e568[_0x1394('0x45')]['id']}})[_0x1394('0x40')](handleEntityNotFound(_0x16f75c,null))[_0x1394('0x40')](function(_0xfd8b0){if(_0xfd8b0){_0x3a980d=_0xfd8b0;_0x48c41d[_0x1394('0x33')]=_[_0x1394('0x46')](db[_0x1394('0x50')][_0x1394('0x47')]);_0x48c41d[_0x1394('0x34')]=_['keys'](_0x22e568['query']);_0x48c41d[_0x1394('0x35')]=_[_0x1394('0x36')](_0x48c41d[_0x1394('0x33')],_0x48c41d[_0x1394('0x34')]);_0xce27b[_0x1394('0x37')]=_['intersection'](_0x48c41d[_0x1394('0x33')],qs[_0x1394('0x38')](_0x22e568[_0x1394('0x34')]['fields']));_0xce27b[_0x1394('0x37')]=_0xce27b[_0x1394('0x37')]['length']?_0xce27b[_0x1394('0x37')]:_0x48c41d[_0x1394('0x33')];_0xce27b[_0x1394('0x51')]=qs['sort'](_0x22e568[_0x1394('0x34')]['sort']);_0xce27b[_0x1394('0x3d')]=qs[_0x1394('0x35')](_[_0x1394('0x52')](_0x22e568[_0x1394('0x34')],_0x48c41d[_0x1394('0x35')]));if(_0x22e568[_0x1394('0x34')][_0x1394('0x3c')]){_0xce27b[_0x1394('0x3d')]=_[_0x1394('0x3f')](_0xce27b['where'],{'$or':_[_0x1394('0x2e')](_0xce27b['attributes'],function(_0x46a43e){var _0x5a3d56={};_0x5a3d56[_0x46a43e]={'$like':'%'+_0x22e568[_0x1394('0x34')][_0x1394('0x3c')]+'%'};return _0x5a3d56;})});}_0xce27b=_[_0x1394('0x3f')]({},_0xce27b,_0x22e568[_0x1394('0x49')]);return _0x3a980d[_0x1394('0x4e')](_0xce27b);}})[_0x1394('0x40')](function(_0x26bcd7){if(_0x26bcd7){_0x1bb662=_0x26bcd7[_0x1394('0x39')];if(!_0x22e568[_0x1394('0x34')][_0x1394('0x53')](_0x1394('0x3a'))){_0xce27b[_0x1394('0x22')]=qs[_0x1394('0x22')](_0x22e568[_0x1394('0x34')][_0x1394('0x22')]);_0xce27b['offset']=qs[_0x1394('0x21')](_0x22e568[_0x1394('0x34')][_0x1394('0x21')]);}return _0x3a980d['getFields'](_0xce27b);}})[_0x1394('0x40')](function(_0x430146){if(_0x430146){return _0x430146?{'count':_0x1bb662,'rows':_0x430146}:null;}})[_0x1394('0x40')](respondWithResult(_0x16f75c,null))[_0x1394('0x4d')](handleError(_0x16f75c,null));};exports[_0x1394('0x54')]=function(_0xe1a0d6,_0x45843a,_0x4a370b){var _0x274d92={};var _0x159e4c={};var _0x2ca828;var _0x17649a;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0xe1a0d6[_0x1394('0x45')]['id']}})[_0x1394('0x40')](handleEntityNotFound(_0x45843a,null))[_0x1394('0x40')](function(_0x541824){if(_0x541824){_0x2ca828=_0x541824;_0x159e4c[_0x1394('0x33')]=_['keys'](db[_0x1394('0x50')]['rawAttributes']);_0x159e4c[_0x1394('0x34')]=_[_0x1394('0x46')](_0xe1a0d6[_0x1394('0x34')]);_0x159e4c['filters']=_[_0x1394('0x36')](_0x159e4c[_0x1394('0x33')],_0x159e4c[_0x1394('0x34')]);_0x274d92[_0x1394('0x37')]=_['intersection'](_0x159e4c[_0x1394('0x33')],qs[_0x1394('0x38')](_0xe1a0d6[_0x1394('0x34')][_0x1394('0x38')]));_0x274d92[_0x1394('0x37')]=_0x274d92[_0x1394('0x37')][_0x1394('0x39')]?_0x274d92[_0x1394('0x37')]:_0x159e4c['model'];_0x274d92[_0x1394('0x51')]=qs[_0x1394('0x3b')](_0xe1a0d6[_0x1394('0x34')][_0x1394('0x3b')]);_0x274d92[_0x1394('0x3d')]=qs['filters'](_['pick'](_0xe1a0d6[_0x1394('0x34')],_0x159e4c[_0x1394('0x35')]));if(_0xe1a0d6['query'][_0x1394('0x3c')]){_0x274d92['where']=_[_0x1394('0x3f')](_0x274d92[_0x1394('0x3d')],{'$or':_[_0x1394('0x2e')](_0x274d92['attributes'],function(_0x344771){var _0x1392d9={};_0x1392d9[_0x344771]={'$like':'%'+_0xe1a0d6[_0x1394('0x34')][_0x1394('0x3c')]+'%'};return _0x1392d9;})});}_0x274d92=_[_0x1394('0x3f')]({},_0x274d92,_0xe1a0d6[_0x1394('0x49')]);return _0x2ca828[_0x1394('0x54')](_0x274d92);}})['then'](function(_0x19501a){if(_0x19501a){_0x17649a=_0x19501a[_0x1394('0x39')];if(!_0xe1a0d6[_0x1394('0x34')][_0x1394('0x53')](_0x1394('0x3a'))){_0x274d92['limit']=qs['limit'](_0xe1a0d6[_0x1394('0x34')]['limit']);_0x274d92['offset']=qs[_0x1394('0x21')](_0xe1a0d6[_0x1394('0x34')][_0x1394('0x21')]);}return _0x2ca828[_0x1394('0x54')](_0x274d92);}})[_0x1394('0x40')](function(_0x36d079){if(_0x36d079){return _0x36d079?{'count':_0x17649a,'rows':_0x36d079}:null;}})[_0x1394('0x40')](respondWithResult(_0x45843a,null))[_0x1394('0x4d')](handleError(_0x45843a,null));};exports['getDescriptions']=function(_0x5bae4d,_0x572b95,_0x2ed622){var _0x744e7e={};var _0x57a487={};var _0x2c615a;var _0x579ae4;return db[_0x1394('0x2f')]['findOne']({'where':{'id':_0x5bae4d[_0x1394('0x45')]['id']}})[_0x1394('0x40')](handleEntityNotFound(_0x572b95,null))[_0x1394('0x40')](function(_0x5c8392){if(_0x5c8392){_0x2c615a=_0x5c8392;_0x57a487[_0x1394('0x33')]=_[_0x1394('0x46')](db[_0x1394('0x50')][_0x1394('0x47')]);_0x57a487[_0x1394('0x34')]=_[_0x1394('0x46')](_0x5bae4d[_0x1394('0x34')]);_0x57a487[_0x1394('0x35')]=_[_0x1394('0x36')](_0x57a487['model'],_0x57a487[_0x1394('0x34')]);_0x744e7e[_0x1394('0x37')]=_[_0x1394('0x36')](_0x57a487[_0x1394('0x33')],qs[_0x1394('0x38')](_0x5bae4d['query'][_0x1394('0x38')]));_0x744e7e['attributes']=_0x744e7e[_0x1394('0x37')][_0x1394('0x39')]?_0x744e7e[_0x1394('0x37')]:_0x57a487['model'];_0x744e7e[_0x1394('0x51')]=qs['sort'](_0x5bae4d[_0x1394('0x34')]['sort']);_0x744e7e[_0x1394('0x3d')]=qs[_0x1394('0x35')](_[_0x1394('0x52')](_0x5bae4d[_0x1394('0x34')],_0x57a487['filters']));if(_0x5bae4d[_0x1394('0x34')][_0x1394('0x3c')]){_0x744e7e['where']=_[_0x1394('0x3f')](_0x744e7e['where'],{'$or':_[_0x1394('0x2e')](_0x744e7e[_0x1394('0x37')],function(_0x383698){var _0x5e4048={};_0x5e4048[_0x383698]={'$like':'%'+_0x5bae4d[_0x1394('0x34')][_0x1394('0x3c')]+'%'};return _0x5e4048;})});}_0x744e7e=_[_0x1394('0x3f')]({},_0x744e7e,_0x5bae4d[_0x1394('0x49')]);return _0x2c615a[_0x1394('0x55')](_0x744e7e);}})[_0x1394('0x40')](function(_0x3b7be6){if(_0x3b7be6){_0x579ae4=_0x3b7be6[_0x1394('0x39')];if(!_0x5bae4d[_0x1394('0x34')][_0x1394('0x53')]('nolimit')){_0x744e7e[_0x1394('0x22')]=qs[_0x1394('0x22')](_0x5bae4d[_0x1394('0x34')][_0x1394('0x22')]);_0x744e7e[_0x1394('0x21')]=qs[_0x1394('0x21')](_0x5bae4d[_0x1394('0x34')]['offset']);}return _0x2c615a[_0x1394('0x55')](_0x744e7e);}})[_0x1394('0x40')](function(_0x20aed5){if(_0x20aed5){return _0x20aed5?{'count':_0x579ae4,'rows':_0x20aed5}:null;}})[_0x1394('0x40')](respondWithResult(_0x572b95,null))['catch'](handleError(_0x572b95,null));}; \ No newline at end of file +var _0x561b=['show','params','keys','catch','create','body','find','destroy','getFields','findOne','getSubjects','order','getDescriptions','SugarcrmField','rimraf','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows'];(function(_0x565167,_0xd160d0){var _0xe83308=function(_0x495006){while(--_0x495006){_0x565167['push'](_0x565167['shift']());}};_0xe83308(++_0xd160d0);}(_0x561b,0xf2));var _0xb561=function(_0x56ff58,_0x2a9d4f){_0x56ff58=_0x56ff58-0x0;var _0x4a3720=_0x561b[_0x56ff58];return _0x4a3720;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb561('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb561('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb561('0x2'));var util=require('util');var path=require(_0xb561('0x3'));var sox=require(_0xb561('0x4'));var csv=require(_0xb561('0x5'));var ejs=require(_0xb561('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb561('0x7'));var squel=require(_0xb561('0x8'));var crypto=require(_0xb561('0x9'));var jsforce=require(_0xb561('0xa'));var deskjs=require(_0xb561('0xb'));var toCsv=require(_0xb561('0x5'));var querystring=require(_0xb561('0xc'));var Papa=require(_0xb561('0xd'));var Redis=require(_0xb561('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb561('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb561('0x10'))(_0xb561('0x11'));var utils=require(_0xb561('0x12'));var config=require(_0xb561('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9617,_0x545e05){_0x545e05=_0x545e05||0xcc;return function(_0x386717){if(_0x386717){return _0x4b9617['sendStatus'](_0x545e05);}return _0x4b9617['status'](_0x545e05)[_0xb561('0x14')]();};}function respondWithResult(_0x24e613,_0x15e3d6){_0x15e3d6=_0x15e3d6||0xc8;return function(_0x488f0f){if(_0x488f0f){return _0x24e613[_0xb561('0x15')](_0x15e3d6)[_0xb561('0x16')](_0x488f0f);}};}function respondWithFilteredResult(_0x1cd00f,_0x1440c8){return function(_0x45b9cd){if(_0x45b9cd){var _0x3989d8=typeof _0x1440c8[_0xb561('0x17')]===_0xb561('0x18')&&typeof _0x1440c8[_0xb561('0x19')]==='undefined';var _0x547278=_0x45b9cd[_0xb561('0x1a')];var _0x2b439c=_0x3989d8?0x0:_0x1440c8[_0xb561('0x17')];var _0x34586c=_0x3989d8?_0x45b9cd[_0xb561('0x1a')]:_0x1440c8[_0xb561('0x17')]+_0x1440c8[_0xb561('0x19')];var _0x21d80f;if(_0x34586c>=_0x547278){_0x34586c=_0x547278;_0x21d80f=0xc8;}else{_0x21d80f=0xce;}_0x1cd00f[_0xb561('0x15')](_0x21d80f);return _0x1cd00f[_0xb561('0x1b')](_0xb561('0x1c'),_0x2b439c+'-'+_0x34586c+'/'+_0x547278)[_0xb561('0x16')](_0x45b9cd);}return null;};}function patchUpdates(_0x5dacb0){return function(_0x397f20){try{jsonpatch[_0xb561('0x1d')](_0x397f20,_0x5dacb0,!![]);}catch(_0x482dea){return BPromise['reject'](_0x482dea);}return _0x397f20[_0xb561('0x1e')]();};}function saveUpdates(_0x21dbae,_0x37f0f3){return function(_0x101093){if(_0x101093){return _0x101093[_0xb561('0x1f')](_0x21dbae)[_0xb561('0x20')](function(_0x5b55ee){return _0x5b55ee;});}return null;};}function removeEntity(_0x4d8161,_0x316eb5){return function(_0x199159){if(_0x199159){return _0x199159['destroy']()[_0xb561('0x20')](function(){_0x4d8161['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a0d29,_0x35e893){return function(_0x18767b){if(!_0x18767b){_0x9a0d29[_0xb561('0x21')](0x194);}return _0x18767b;};}function handleError(_0x2f3241,_0x5566b1){_0x5566b1=_0x5566b1||0x1f4;return function(_0x3feef0){logger[_0xb561('0x22')](_0x3feef0['stack']);if(_0x3feef0[_0xb561('0x23')]){delete _0x3feef0[_0xb561('0x23')];}_0x2f3241[_0xb561('0x15')](_0x5566b1)[_0xb561('0x24')](_0x3feef0);};}exports[_0xb561('0x25')]=function(_0x176ee7,_0x16e188){var _0x479f1d={},_0x3bc8f6={},_0x3056b8={'count':0x0,'rows':[]};var _0x307620=_[_0xb561('0x26')](db[_0xb561('0x27')][_0xb561('0x28')],function(_0x5e5f47){return{'name':_0x5e5f47[_0xb561('0x29')],'type':_0x5e5f47['type']['key']};});_0x3bc8f6[_0xb561('0x2a')]=_['map'](_0x307620,'name');_0x3bc8f6[_0xb561('0x2b')]=_['keys'](_0x176ee7[_0xb561('0x2b')]);_0x3bc8f6[_0xb561('0x2c')]=_['intersection'](_0x3bc8f6[_0xb561('0x2a')],_0x3bc8f6['query']);_0x479f1d[_0xb561('0x2d')]=_[_0xb561('0x2e')](_0x3bc8f6[_0xb561('0x2a')],qs[_0xb561('0x2f')](_0x176ee7[_0xb561('0x2b')][_0xb561('0x2f')]));_0x479f1d[_0xb561('0x2d')]=_0x479f1d['attributes'][_0xb561('0x30')]?_0x479f1d[_0xb561('0x2d')]:_0x3bc8f6[_0xb561('0x2a')];if(!_0x176ee7[_0xb561('0x2b')][_0xb561('0x31')](_0xb561('0x32'))){_0x479f1d[_0xb561('0x19')]=qs[_0xb561('0x19')](_0x176ee7[_0xb561('0x2b')]['limit']);_0x479f1d[_0xb561('0x17')]=qs['offset'](_0x176ee7['query'][_0xb561('0x17')]);}_0x479f1d['order']=qs[_0xb561('0x33')](_0x176ee7['query'][_0xb561('0x33')]);_0x479f1d[_0xb561('0x34')]=qs[_0xb561('0x2c')](_[_0xb561('0x35')](_0x176ee7['query'],_0x3bc8f6[_0xb561('0x2c')]),_0x307620);if(_0x176ee7[_0xb561('0x2b')][_0xb561('0x36')]){_0x479f1d['where']=_['merge'](_0x479f1d[_0xb561('0x34')],{'$or':_['map'](_0x307620,function(_0x3968f4){if(_0x3968f4['type']!==_0xb561('0x37')){var _0x3b01b8={};_0x3b01b8[_0x3968f4['name']]={'$like':'%'+_0x176ee7['query'][_0xb561('0x36')]+'%'};return _0x3b01b8;}})});}_0x479f1d=_[_0xb561('0x38')]({},_0x479f1d,_0x176ee7[_0xb561('0x39')]);var _0x12d09a={'where':_0x479f1d[_0xb561('0x34')]};return db[_0xb561('0x27')]['count'](_0x12d09a)[_0xb561('0x20')](function(_0x36bed6){_0x3056b8[_0xb561('0x1a')]=_0x36bed6;if(_0x176ee7[_0xb561('0x2b')][_0xb561('0x3a')]){_0x479f1d[_0xb561('0x3b')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xb561('0x3c')](_0x479f1d);})[_0xb561('0x20')](function(_0x20ef8d){_0x3056b8[_0xb561('0x3d')]=_0x20ef8d;return _0x3056b8;})[_0xb561('0x20')](respondWithFilteredResult(_0x16e188,_0x479f1d))['catch'](handleError(_0x16e188,null));};exports[_0xb561('0x3e')]=function(_0x4f2966,_0x4e9d41){var _0x207ee9={'raw':![],'where':{'id':_0x4f2966[_0xb561('0x3f')]['id']}},_0x53c65d={};_0x53c65d[_0xb561('0x2a')]=_['keys'](db[_0xb561('0x27')]['rawAttributes']);_0x53c65d[_0xb561('0x2b')]=_[_0xb561('0x40')](_0x4f2966[_0xb561('0x2b')]);_0x53c65d['filters']=_[_0xb561('0x2e')](_0x53c65d[_0xb561('0x2a')],_0x53c65d['query']);_0x207ee9[_0xb561('0x2d')]=_[_0xb561('0x2e')](_0x53c65d[_0xb561('0x2a')],qs[_0xb561('0x2f')](_0x4f2966[_0xb561('0x2b')][_0xb561('0x2f')]));_0x207ee9['attributes']=_0x207ee9['attributes'][_0xb561('0x30')]?_0x207ee9[_0xb561('0x2d')]:_0x53c65d[_0xb561('0x2a')];if(_0x4f2966['query']['includeAll']){_0x207ee9[_0xb561('0x3b')]=[{'all':!![]}];}_0x207ee9=_[_0xb561('0x38')]({},_0x207ee9,_0x4f2966['options']);return db[_0xb561('0x27')]['find'](_0x207ee9)[_0xb561('0x20')](handleEntityNotFound(_0x4e9d41,null))['then'](respondWithResult(_0x4e9d41,null))[_0xb561('0x41')](handleError(_0x4e9d41,null));};exports[_0xb561('0x42')]=function(_0x2d7c12,_0x5e7aa1){return db['SugarcrmConfiguration']['create'](_0x2d7c12['body'],{})[_0xb561('0x20')](respondWithResult(_0x5e7aa1,0xc9))[_0xb561('0x41')](handleError(_0x5e7aa1,null));};exports['update']=function(_0x44fc30,_0x492330){if(_0x44fc30[_0xb561('0x43')]['id']){delete _0x44fc30[_0xb561('0x43')]['id'];}return db[_0xb561('0x27')][_0xb561('0x44')]({'where':{'id':_0x44fc30[_0xb561('0x3f')]['id']}})['then'](handleEntityNotFound(_0x492330,null))[_0xb561('0x20')](saveUpdates(_0x44fc30[_0xb561('0x43')],null))['then'](respondWithResult(_0x492330,null))['catch'](handleError(_0x492330,null));};exports[_0xb561('0x45')]=function(_0x1864a8,_0x210cbb){return db['SugarcrmConfiguration'][_0xb561('0x44')]({'where':{'id':_0x1864a8['params']['id']}})[_0xb561('0x20')](handleEntityNotFound(_0x210cbb,null))[_0xb561('0x20')](removeEntity(_0x210cbb,null))[_0xb561('0x41')](handleError(_0x210cbb,null));};exports[_0xb561('0x46')]=function(_0x43965d,_0x27a2b8,_0x4e2392){var _0xfc65e1={};var _0x64a687={};var _0xf73d3f;var _0x477717;return db[_0xb561('0x27')][_0xb561('0x47')]({'where':{'id':_0x43965d[_0xb561('0x3f')]['id']}})[_0xb561('0x20')](handleEntityNotFound(_0x27a2b8,null))[_0xb561('0x20')](function(_0x641ebe){if(_0x641ebe){_0xf73d3f=_0x641ebe;_0x64a687[_0xb561('0x2a')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x64a687[_0xb561('0x2b')]=_[_0xb561('0x40')](_0x43965d[_0xb561('0x2b')]);_0x64a687[_0xb561('0x2c')]=_['intersection'](_0x64a687[_0xb561('0x2a')],_0x64a687[_0xb561('0x2b')]);_0xfc65e1[_0xb561('0x2d')]=_[_0xb561('0x2e')](_0x64a687[_0xb561('0x2a')],qs['fields'](_0x43965d[_0xb561('0x2b')][_0xb561('0x2f')]));_0xfc65e1[_0xb561('0x2d')]=_0xfc65e1['attributes'][_0xb561('0x30')]?_0xfc65e1[_0xb561('0x2d')]:_0x64a687[_0xb561('0x2a')];_0xfc65e1['order']=qs[_0xb561('0x33')](_0x43965d[_0xb561('0x2b')][_0xb561('0x33')]);_0xfc65e1[_0xb561('0x34')]=qs[_0xb561('0x2c')](_[_0xb561('0x35')](_0x43965d['query'],_0x64a687[_0xb561('0x2c')]));if(_0x43965d[_0xb561('0x2b')][_0xb561('0x36')]){_0xfc65e1[_0xb561('0x34')]=_['merge'](_0xfc65e1['where'],{'$or':_[_0xb561('0x26')](_0xfc65e1[_0xb561('0x2d')],function(_0x2d9be8){var _0x548f9b={};_0x548f9b[_0x2d9be8]={'$like':'%'+_0x43965d['query'][_0xb561('0x36')]+'%'};return _0x548f9b;})});}_0xfc65e1=_['merge']({},_0xfc65e1,_0x43965d[_0xb561('0x39')]);return _0xf73d3f[_0xb561('0x46')](_0xfc65e1);}})[_0xb561('0x20')](function(_0x110a11){if(_0x110a11){_0x477717=_0x110a11[_0xb561('0x30')];if(!_0x43965d['query'][_0xb561('0x31')]('nolimit')){_0xfc65e1['limit']=qs[_0xb561('0x19')](_0x43965d['query']['limit']);_0xfc65e1[_0xb561('0x17')]=qs[_0xb561('0x17')](_0x43965d[_0xb561('0x2b')][_0xb561('0x17')]);}return _0xf73d3f['getFields'](_0xfc65e1);}})[_0xb561('0x20')](function(_0x43804c){if(_0x43804c){return _0x43804c?{'count':_0x477717,'rows':_0x43804c}:null;}})[_0xb561('0x20')](respondWithResult(_0x27a2b8,null))[_0xb561('0x41')](handleError(_0x27a2b8,null));};exports[_0xb561('0x48')]=function(_0x291f56,_0x1775a6,_0x4088f9){var _0x198390={};var _0x36bea7={};var _0x1b294a;var _0x2da6fb;return db[_0xb561('0x27')][_0xb561('0x47')]({'where':{'id':_0x291f56[_0xb561('0x3f')]['id']}})[_0xb561('0x20')](handleEntityNotFound(_0x1775a6,null))[_0xb561('0x20')](function(_0x16d8ef){if(_0x16d8ef){_0x1b294a=_0x16d8ef;_0x36bea7['model']=_['keys'](db['SugarcrmField'][_0xb561('0x28')]);_0x36bea7['query']=_[_0xb561('0x40')](_0x291f56['query']);_0x36bea7[_0xb561('0x2c')]=_[_0xb561('0x2e')](_0x36bea7['model'],_0x36bea7['query']);_0x198390[_0xb561('0x2d')]=_[_0xb561('0x2e')](_0x36bea7[_0xb561('0x2a')],qs[_0xb561('0x2f')](_0x291f56['query'][_0xb561('0x2f')]));_0x198390[_0xb561('0x2d')]=_0x198390[_0xb561('0x2d')][_0xb561('0x30')]?_0x198390[_0xb561('0x2d')]:_0x36bea7[_0xb561('0x2a')];_0x198390[_0xb561('0x49')]=qs[_0xb561('0x33')](_0x291f56[_0xb561('0x2b')][_0xb561('0x33')]);_0x198390[_0xb561('0x34')]=qs['filters'](_[_0xb561('0x35')](_0x291f56[_0xb561('0x2b')],_0x36bea7[_0xb561('0x2c')]));if(_0x291f56[_0xb561('0x2b')][_0xb561('0x36')]){_0x198390['where']=_[_0xb561('0x38')](_0x198390[_0xb561('0x34')],{'$or':_[_0xb561('0x26')](_0x198390[_0xb561('0x2d')],function(_0x35fda2){var _0x540e89={};_0x540e89[_0x35fda2]={'$like':'%'+_0x291f56[_0xb561('0x2b')]['filter']+'%'};return _0x540e89;})});}_0x198390=_[_0xb561('0x38')]({},_0x198390,_0x291f56[_0xb561('0x39')]);return _0x1b294a[_0xb561('0x48')](_0x198390);}})[_0xb561('0x20')](function(_0x179348){if(_0x179348){_0x2da6fb=_0x179348['length'];if(!_0x291f56[_0xb561('0x2b')][_0xb561('0x31')]('nolimit')){_0x198390[_0xb561('0x19')]=qs[_0xb561('0x19')](_0x291f56[_0xb561('0x2b')][_0xb561('0x19')]);_0x198390['offset']=qs[_0xb561('0x17')](_0x291f56['query'][_0xb561('0x17')]);}return _0x1b294a['getSubjects'](_0x198390);}})[_0xb561('0x20')](function(_0x19035b){if(_0x19035b){return _0x19035b?{'count':_0x2da6fb,'rows':_0x19035b}:null;}})[_0xb561('0x20')](respondWithResult(_0x1775a6,null))[_0xb561('0x41')](handleError(_0x1775a6,null));};exports[_0xb561('0x4a')]=function(_0x1ad769,_0x522044,_0x2c7ed5){var _0x2b08f0={};var _0x184a82={};var _0x5e7cf1;var _0x106f59;return db[_0xb561('0x27')][_0xb561('0x47')]({'where':{'id':_0x1ad769[_0xb561('0x3f')]['id']}})['then'](handleEntityNotFound(_0x522044,null))[_0xb561('0x20')](function(_0x3bb269){if(_0x3bb269){_0x5e7cf1=_0x3bb269;_0x184a82[_0xb561('0x2a')]=_['keys'](db[_0xb561('0x4b')][_0xb561('0x28')]);_0x184a82[_0xb561('0x2b')]=_['keys'](_0x1ad769[_0xb561('0x2b')]);_0x184a82[_0xb561('0x2c')]=_[_0xb561('0x2e')](_0x184a82[_0xb561('0x2a')],_0x184a82['query']);_0x2b08f0[_0xb561('0x2d')]=_[_0xb561('0x2e')](_0x184a82[_0xb561('0x2a')],qs[_0xb561('0x2f')](_0x1ad769[_0xb561('0x2b')]['fields']));_0x2b08f0[_0xb561('0x2d')]=_0x2b08f0[_0xb561('0x2d')][_0xb561('0x30')]?_0x2b08f0[_0xb561('0x2d')]:_0x184a82[_0xb561('0x2a')];_0x2b08f0[_0xb561('0x49')]=qs[_0xb561('0x33')](_0x1ad769[_0xb561('0x2b')]['sort']);_0x2b08f0[_0xb561('0x34')]=qs['filters'](_[_0xb561('0x35')](_0x1ad769[_0xb561('0x2b')],_0x184a82['filters']));if(_0x1ad769[_0xb561('0x2b')][_0xb561('0x36')]){_0x2b08f0[_0xb561('0x34')]=_['merge'](_0x2b08f0[_0xb561('0x34')],{'$or':_[_0xb561('0x26')](_0x2b08f0['attributes'],function(_0x291b2b){var _0xe220bb={};_0xe220bb[_0x291b2b]={'$like':'%'+_0x1ad769[_0xb561('0x2b')][_0xb561('0x36')]+'%'};return _0xe220bb;})});}_0x2b08f0=_[_0xb561('0x38')]({},_0x2b08f0,_0x1ad769[_0xb561('0x39')]);return _0x5e7cf1[_0xb561('0x4a')](_0x2b08f0);}})[_0xb561('0x20')](function(_0xc09bd5){if(_0xc09bd5){_0x106f59=_0xc09bd5['length'];if(!_0x1ad769['query']['hasOwnProperty']('nolimit')){_0x2b08f0[_0xb561('0x19')]=qs[_0xb561('0x19')](_0x1ad769[_0xb561('0x2b')][_0xb561('0x19')]);_0x2b08f0[_0xb561('0x17')]=qs[_0xb561('0x17')](_0x1ad769[_0xb561('0x2b')]['offset']);}return _0x5e7cf1[_0xb561('0x4a')](_0x2b08f0);}})[_0xb561('0x20')](function(_0x5a0861){if(_0x5a0861){return _0x5a0861?{'count':_0x106f59,'rows':_0x5a0861}:null;}})[_0xb561('0x20')](respondWithResult(_0x522044,null))['catch'](handleError(_0x522044,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 36baa20..d10b6e6 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 _0x3ecf=['../../config/logger','bluebird','request-promise','path','rimraf','define','SugarcrmConfiguration','int_sugarcrm_configurations','util'];(function(_0x144a98,_0x525ad9){var _0x4a1b6f=function(_0x22b17b){while(--_0x22b17b){_0x144a98['push'](_0x144a98['shift']());}};_0x4a1b6f(++_0x525ad9);}(_0x3ecf,0x86));var _0xf3ec=function(_0x6be7ff,_0x684488){_0x6be7ff=_0x6be7ff-0x0;var _0x143fe7=_0x3ecf[_0x6be7ff];return _0x143fe7;};'use strict';var _=require('lodash');var util=require(_0xf3ec('0x0'));var logger=require(_0xf3ec('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf3ec('0x2'));var rp=require(_0xf3ec('0x3'));var fs=require('fs');var path=require(_0xf3ec('0x4'));var rimraf=require(_0xf3ec('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x5c1928,_0x50d09d){return _0x5c1928[_0xf3ec('0x6')](_0xf3ec('0x7'),attributes,{'tableName':_0xf3ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0b3=['rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa0b3,0x14a));var _0x3a0b=function(_0xb4353c,_0x2e59b6){_0xb4353c=_0xb4353c-0x0;var _0x8a8680=_0xa0b3[_0xb4353c];return _0x8a8680;};'use strict';var _=require('lodash');var util=require(_0x3a0b('0x0'));var logger=require(_0x3a0b('0x1'))(_0x3a0b('0x2'));var moment=require(_0x3a0b('0x3'));var BPromise=require(_0x3a0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a0b('0x5'));var rimraf=require(_0x3a0b('0x6'));var config=require('../../config/environment');var attributes=require(_0x3a0b('0x7'));module[_0x3a0b('0x8')]=function(_0x52e265,_0x2d9f8d){return _0x52e265[_0x3a0b('0x9')](_0x3a0b('0xa'),attributes,{'tableName':_0x3a0b('0xb'),'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 2b147a5..4cea729 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 _0x8fe7=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x8fe7,0x10f));var _0x78fe=function(_0x4b4305,_0xdf579d){_0x4b4305=_0x4b4305-0x0;var _0x2646ad=_0x8fe7[_0x4b4305];return _0x2646ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x78fe('0x0'));var BPromise=require('bluebird');var rs=require(_0x78fe('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78fe('0x2'))['db'];var utils=require(_0x78fe('0x3'));var logger=require(_0x78fe('0x4'))(_0x78fe('0x5'));var config=require(_0x78fe('0x6'));var jayson=require(_0x78fe('0x7'));var client=jayson[_0x78fe('0x8')][_0x78fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43301b,_0xe229f,_0xf64237){return new BPromise(function(_0x6dc4a2,_0x18c6b5){return client[_0x78fe('0xa')](_0x43301b,_0xf64237)[_0x78fe('0xb')](function(_0x2151bb){logger[_0x78fe('0xc')](_0x78fe('0xd'),_0xe229f,_0x78fe('0xe'));logger[_0x78fe('0xf')](_0x78fe('0x10'),_0xe229f,_0x78fe('0xe'),JSON[_0x78fe('0x11')](_0x2151bb));if(_0x2151bb['error']){if(_0x2151bb[_0x78fe('0x12')]['code']===0x1f4){logger[_0x78fe('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xe229f,_0x2151bb[_0x78fe('0x12')][_0x78fe('0x13')]);return _0x18c6b5(_0x2151bb[_0x78fe('0x12')][_0x78fe('0x13')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xe229f,_0x2151bb[_0x78fe('0x12')][_0x78fe('0x13')]);return _0x6dc4a2(_0x2151bb[_0x78fe('0x12')][_0x78fe('0x13')]);}else{logger['info'](_0x78fe('0xd'),_0xe229f,_0x78fe('0xe'));_0x6dc4a2(_0x2151bb[_0x78fe('0x14')][_0x78fe('0x13')]);}})[_0x78fe('0x15')](function(_0x16280e){logger['error'](_0x78fe('0xd'),_0xe229f,_0x16280e);_0x18c6b5(_0x16280e);});});} \ No newline at end of file +var _0x6543=['error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6543,0xea));var _0x3654=function(_0x21971a,_0x5ca172){_0x21971a=_0x21971a-0x0;var _0x1d26fe=_0x6543[_0x21971a];return _0x1d26fe;};'use strict';var _=require('lodash');var util=require(_0x3654('0x0'));var moment=require(_0x3654('0x1'));var BPromise=require('bluebird');var rs=require(_0x3654('0x2'));var fs=require('fs');var Redis=require(_0x3654('0x3'));var db=require(_0x3654('0x4'))['db'];var utils=require(_0x3654('0x5'));var logger=require(_0x3654('0x6'))('rpc');var config=require(_0x3654('0x7'));var jayson=require(_0x3654('0x8'));var client=jayson[_0x3654('0x9')][_0x3654('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d4a90,_0x2b25c0,_0x60af7){return new BPromise(function(_0x10463e,_0x123c17){return client[_0x3654('0xb')](_0x5d4a90,_0x60af7)[_0x3654('0xc')](function(_0x2d22a1){logger[_0x3654('0xd')](_0x3654('0xe'),_0x2b25c0,_0x3654('0xf'));logger[_0x3654('0x10')](_0x3654('0x11'),_0x2b25c0,_0x3654('0xf'),JSON['stringify'](_0x2d22a1));if(_0x2d22a1[_0x3654('0x12')]){if(_0x2d22a1[_0x3654('0x12')]['code']===0x1f4){logger['error'](_0x3654('0xe'),_0x2b25c0,_0x2d22a1[_0x3654('0x12')]['message']);return _0x123c17(_0x2d22a1['error']['message']);}logger[_0x3654('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b25c0,_0x2d22a1[_0x3654('0x12')][_0x3654('0x13')]);return _0x10463e(_0x2d22a1[_0x3654('0x12')][_0x3654('0x13')]);}else{logger['info'](_0x3654('0xe'),_0x2b25c0,'request\x20sent');_0x10463e(_0x2d22a1['result'][_0x3654('0x13')]);}})[_0x3654('0x14')](function(_0xb03ad1){logger[_0x3654('0x12')](_0x3654('0xe'),_0x2b25c0,_0xb03ad1);_0x123c17(_0xb03ad1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0435bc3..7bd11ac 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 _0xbe1d=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbe1d,0x195));var _0xdbe1=function(_0x3d5e72,_0x3ab167){_0x3d5e72=_0x3d5e72-0x0;var _0x2230e4=_0xbe1d[_0x3d5e72];return _0x2230e4;};'use strict';var multer=require(_0xdbe1('0x0'));var util=require(_0xdbe1('0x1'));var path=require(_0xdbe1('0x2'));var timeout=require(_0xdbe1('0x3'));var express=require(_0xdbe1('0x4'));var router=express[_0xdbe1('0x5')]();var fs_extra=require(_0xdbe1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdbe1('0x7'));var config=require(_0xdbe1('0x8'));var controller=require(_0xdbe1('0x9'));router['get']('/',auth[_0xdbe1('0xa')](),controller[_0xdbe1('0xb')]);router[_0xdbe1('0xc')]('/:id',auth[_0xdbe1('0xa')](),controller[_0xdbe1('0xd')]);router[_0xdbe1('0xe')]('/',auth['isAuthenticated'](),controller[_0xdbe1('0xf')]);router[_0xdbe1('0x10')](_0xdbe1('0x11'),auth[_0xdbe1('0xa')](),controller[_0xdbe1('0x12')]);router[_0xdbe1('0x13')]('/:id',auth[_0xdbe1('0xa')](),controller[_0xdbe1('0x14')]);module[_0xdbe1('0x15')]=router; \ No newline at end of file +var _0xcd9e=['show','post','create','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xcd9e,0xe7));var _0xecd9=function(_0x1759fc,_0x18ad54){_0x1759fc=_0x1759fc-0x0;var _0x35f38e=_0xcd9e[_0x1759fc];return _0x35f38e;};'use strict';var multer=require('multer');var util=require(_0xecd9('0x0'));var path=require(_0xecd9('0x1'));var timeout=require('connect-timeout');var express=require(_0xecd9('0x2'));var router=express[_0xecd9('0x3')]();var fs_extra=require(_0xecd9('0x4'));var auth=require(_0xecd9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xecd9('0x6'));router[_0xecd9('0x7')]('/',auth[_0xecd9('0x8')](),controller['index']);router[_0xecd9('0x7')]('/:id',auth[_0xecd9('0x8')](),controller[_0xecd9('0x9')]);router[_0xecd9('0xa')]('/',auth[_0xecd9('0x8')](),controller[_0xecd9('0xb')]);router['put'](_0xecd9('0xc'),auth['isAuthenticated'](),controller[_0xecd9('0xd')]);router[_0xecd9('0xe')](_0xecd9('0xc'),auth['isAuthenticated'](),controller[_0xecd9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 079a2de..4ea3056 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 _0x66da=['exports','ENUM','string','keyValue','STRING','variable','BOOLEAN','sequelize'];(function(_0x3728ca,_0x5eb80e){var _0x8deda7=function(_0x36bace){while(--_0x36bace){_0x3728ca['push'](_0x3728ca['shift']());}};_0x8deda7(++_0x5eb80e);}(_0x66da,0x107));var _0xa66d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x66da[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xa66d('0x0'));module[_0xa66d('0x1')]={'type':{'type':Sequelize[_0xa66d('0x2')](_0xa66d('0x3'),'variable','customVariable',_0xa66d('0x4'),'picklist'),'defaultValue':_0xa66d('0x3')},'content':{'type':Sequelize[_0xa66d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa66d('0x3'),_0xa66d('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa66d('0x5')]},'nameField':{'type':Sequelize[_0xa66d('0x5')]},'customField':{'type':Sequelize[_0xa66d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa66d('0x5')]}}; \ No newline at end of file +var _0x257d=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x4e8302,_0x3f0574){var _0x4facef=function(_0x2e2ff0){while(--_0x2e2ff0){_0x4e8302['push'](_0x4e8302['shift']());}};_0x4facef(++_0x3f0574);}(_0x257d,0x89));var _0xd257=function(_0x53a51f,_0x1e9256){_0x53a51f=_0x53a51f-0x0;var _0x149579=_0x257d[_0x53a51f];return _0x149579;};'use strict';var Sequelize=require(_0xd257('0x0'));module[_0xd257('0x1')]={'type':{'type':Sequelize[_0xd257('0x2')](_0xd257('0x3'),_0xd257('0x4'),_0xd257('0x5'),_0xd257('0x6'),_0xd257('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd257('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd257('0x2')](_0xd257('0x3'),_0xd257('0x4'),_0xd257('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd257('0x8')]},'nameField':{'type':Sequelize[_0xd257('0x8')]},'customField':{'type':Sequelize[_0xd257('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 14b2ec9..136a257 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 _0xcf75=['index','map','SugarcrmField','fieldName','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','save','update','then','destroy','stack','name','send'];(function(_0x3109f1,_0x31e90d){var _0x1b041b=function(_0x876ac8){while(--_0x876ac8){_0x3109f1['push'](_0x3109f1['shift']());}};_0x1b041b(++_0x31e90d);}(_0xcf75,0x67));var _0x5cf7=function(_0x1edb90,_0x3d97d4){_0x1edb90=_0x1edb90-0x0;var _0x19dd1e=_0xcf75[_0x1edb90];return _0x19dd1e;};'use strict';var emlformat=require(_0x5cf7('0x0'));var rimraf=require(_0x5cf7('0x1'));var zipdir=require(_0x5cf7('0x2'));var jsonpatch=require(_0x5cf7('0x3'));var rp=require('request-promise');var moment=require(_0x5cf7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cf7('0x5'));var util=require(_0x5cf7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5cf7('0x7'));var ejs=require(_0x5cf7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cf7('0x9'));var squel=require(_0x5cf7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5cf7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5cf7('0xc'));var Papa=require(_0x5cf7('0xd'));var Redis=require('ioredis');var authService=require(_0x5cf7('0xe'));var qs=require(_0x5cf7('0xf'));var as=require(_0x5cf7('0x10'));var hardwareService=require(_0x5cf7('0x11'));var logger=require(_0x5cf7('0x12'))('api');var utils=require(_0x5cf7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf7('0x14'));var db=require(_0x5cf7('0x15'))['db'];function respondWithStatusCode(_0x580348,_0x5f3d21){_0x5f3d21=_0x5f3d21||0xcc;return function(_0x2b9175){if(_0x2b9175){return _0x580348[_0x5cf7('0x16')](_0x5f3d21);}return _0x580348[_0x5cf7('0x17')](_0x5f3d21)[_0x5cf7('0x18')]();};}function respondWithResult(_0x2d4fb4,_0x180866){_0x180866=_0x180866||0xc8;return function(_0x1c5079){if(_0x1c5079){return _0x2d4fb4[_0x5cf7('0x17')](_0x180866)['json'](_0x1c5079);}};}function respondWithFilteredResult(_0x25bc18,_0x4d6687){return function(_0x349f2e){if(_0x349f2e){var _0x52195d=typeof _0x4d6687[_0x5cf7('0x19')]===_0x5cf7('0x1a')&&typeof _0x4d6687[_0x5cf7('0x1b')]==='undefined';var _0x560a29=_0x349f2e[_0x5cf7('0x1c')];var _0x1caa5d=_0x52195d?0x0:_0x4d6687[_0x5cf7('0x19')];var _0x787626=_0x52195d?_0x349f2e[_0x5cf7('0x1c')]:_0x4d6687[_0x5cf7('0x19')]+_0x4d6687[_0x5cf7('0x1b')];var _0x1bf04f;if(_0x787626>=_0x560a29){_0x787626=_0x560a29;_0x1bf04f=0xc8;}else{_0x1bf04f=0xce;}_0x25bc18[_0x5cf7('0x17')](_0x1bf04f);return _0x25bc18['set']('Content-Range',_0x1caa5d+'-'+_0x787626+'/'+_0x560a29)[_0x5cf7('0x1d')](_0x349f2e);}return null;};}function patchUpdates(_0x1c081d){return function(_0x13fbc0){try{jsonpatch['apply'](_0x13fbc0,_0x1c081d,!![]);}catch(_0x487b54){return BPromise['reject'](_0x487b54);}return _0x13fbc0[_0x5cf7('0x1e')]();};}function saveUpdates(_0x3ba0f2,_0x6547fc){return function(_0x4db574){if(_0x4db574){return _0x4db574[_0x5cf7('0x1f')](_0x3ba0f2)[_0x5cf7('0x20')](function(_0x1c210e){return _0x1c210e;});}return null;};}function removeEntity(_0xdd4544,_0x3a1027){return function(_0x4b09ea){if(_0x4b09ea){return _0x4b09ea[_0x5cf7('0x21')]()[_0x5cf7('0x20')](function(){_0xdd4544[_0x5cf7('0x17')](0xcc)[_0x5cf7('0x18')]();});}};}function handleEntityNotFound(_0xed7b31,_0x31a8c6){return function(_0x19edce){if(!_0x19edce){_0xed7b31[_0x5cf7('0x16')](0x194);}return _0x19edce;};}function handleError(_0x1bfb7b,_0x362a21){_0x362a21=_0x362a21||0x1f4;return function(_0x2c6df1){logger['error'](_0x2c6df1[_0x5cf7('0x22')]);if(_0x2c6df1[_0x5cf7('0x23')]){delete _0x2c6df1[_0x5cf7('0x23')];}_0x1bfb7b[_0x5cf7('0x17')](_0x362a21)[_0x5cf7('0x24')](_0x2c6df1);};}exports[_0x5cf7('0x25')]=function(_0x5dc497,_0x377c94){var _0x1ac355={},_0x557f76={},_0xb8f8f1={'count':0x0,'rows':[]};var _0x308fd2=_[_0x5cf7('0x26')](db[_0x5cf7('0x27')]['rawAttributes'],function(_0x4c97bf){return{'name':_0x4c97bf[_0x5cf7('0x28')],'type':_0x4c97bf['type'][_0x5cf7('0x29')]};});_0x557f76[_0x5cf7('0x2a')]=_[_0x5cf7('0x26')](_0x308fd2,_0x5cf7('0x23'));_0x557f76['query']=_[_0x5cf7('0x2b')](_0x5dc497[_0x5cf7('0x2c')]);_0x557f76[_0x5cf7('0x2d')]=_['intersection'](_0x557f76[_0x5cf7('0x2a')],_0x557f76[_0x5cf7('0x2c')]);_0x1ac355['attributes']=_[_0x5cf7('0x2e')](_0x557f76[_0x5cf7('0x2a')],qs[_0x5cf7('0x2f')](_0x5dc497['query'][_0x5cf7('0x2f')]));_0x1ac355['attributes']=_0x1ac355['attributes'][_0x5cf7('0x30')]?_0x1ac355[_0x5cf7('0x31')]:_0x557f76[_0x5cf7('0x2a')];if(!_0x5dc497[_0x5cf7('0x2c')][_0x5cf7('0x32')](_0x5cf7('0x33'))){_0x1ac355[_0x5cf7('0x1b')]=qs[_0x5cf7('0x1b')](_0x5dc497[_0x5cf7('0x2c')][_0x5cf7('0x1b')]);_0x1ac355['offset']=qs[_0x5cf7('0x19')](_0x5dc497[_0x5cf7('0x2c')][_0x5cf7('0x19')]);}_0x1ac355[_0x5cf7('0x34')]=qs[_0x5cf7('0x35')](_0x5dc497['query'][_0x5cf7('0x35')]);_0x1ac355['where']=qs[_0x5cf7('0x2d')](_[_0x5cf7('0x36')](_0x5dc497[_0x5cf7('0x2c')],_0x557f76[_0x5cf7('0x2d')]),_0x308fd2);if(_0x5dc497['query']['filter']){_0x1ac355[_0x5cf7('0x37')]=_[_0x5cf7('0x38')](_0x1ac355[_0x5cf7('0x37')],{'$or':_[_0x5cf7('0x26')](_0x308fd2,function(_0xc3d640){if(_0xc3d640[_0x5cf7('0x39')]!==_0x5cf7('0x3a')){var _0x9a6238={};_0x9a6238[_0xc3d640[_0x5cf7('0x23')]]={'$like':'%'+_0x5dc497['query'][_0x5cf7('0x3b')]+'%'};return _0x9a6238;}})});}_0x1ac355=_['merge']({},_0x1ac355,_0x5dc497[_0x5cf7('0x3c')]);var _0x442210={'where':_0x1ac355[_0x5cf7('0x37')]};return db[_0x5cf7('0x27')][_0x5cf7('0x1c')](_0x442210)[_0x5cf7('0x20')](function(_0x5048c9){_0xb8f8f1[_0x5cf7('0x1c')]=_0x5048c9;if(_0x5dc497[_0x5cf7('0x2c')][_0x5cf7('0x3d')]){_0x1ac355[_0x5cf7('0x3e')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x1ac355);})['then'](function(_0x52fcbb){_0xb8f8f1[_0x5cf7('0x3f')]=_0x52fcbb;return _0xb8f8f1;})[_0x5cf7('0x20')](respondWithFilteredResult(_0x377c94,_0x1ac355))[_0x5cf7('0x40')](handleError(_0x377c94,null));};exports[_0x5cf7('0x41')]=function(_0x129af0,_0x4b3e43){var _0x57455d={'raw':!![],'where':{'id':_0x129af0[_0x5cf7('0x42')]['id']}},_0x1f619a={};_0x1f619a[_0x5cf7('0x2a')]=_[_0x5cf7('0x2b')](db['SugarcrmField'][_0x5cf7('0x43')]);_0x1f619a[_0x5cf7('0x2c')]=_[_0x5cf7('0x2b')](_0x129af0[_0x5cf7('0x2c')]);_0x1f619a['filters']=_['intersection'](_0x1f619a[_0x5cf7('0x2a')],_0x1f619a[_0x5cf7('0x2c')]);_0x57455d[_0x5cf7('0x31')]=_['intersection'](_0x1f619a[_0x5cf7('0x2a')],qs[_0x5cf7('0x2f')](_0x129af0['query']['fields']));_0x57455d[_0x5cf7('0x31')]=_0x57455d[_0x5cf7('0x31')][_0x5cf7('0x30')]?_0x57455d['attributes']:_0x1f619a['model'];if(_0x129af0[_0x5cf7('0x2c')]['includeAll']){_0x57455d[_0x5cf7('0x3e')]=[{'all':!![]}];}_0x57455d=_[_0x5cf7('0x38')]({},_0x57455d,_0x129af0['options']);return db[_0x5cf7('0x27')][_0x5cf7('0x44')](_0x57455d)[_0x5cf7('0x20')](handleEntityNotFound(_0x4b3e43,null))[_0x5cf7('0x20')](respondWithResult(_0x4b3e43,null))[_0x5cf7('0x40')](handleError(_0x4b3e43,null));};exports['create']=function(_0x43afc0,_0x3d0f88){return db[_0x5cf7('0x27')]['create'](_0x43afc0['body'],{})[_0x5cf7('0x20')](respondWithResult(_0x3d0f88,0xc9))[_0x5cf7('0x40')](handleError(_0x3d0f88,null));};exports['update']=function(_0x550b8d,_0x220c83){if(_0x550b8d[_0x5cf7('0x45')]['id']){delete _0x550b8d[_0x5cf7('0x45')]['id'];}return db[_0x5cf7('0x27')]['find']({'where':{'id':_0x550b8d[_0x5cf7('0x42')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x220c83,null))['then'](saveUpdates(_0x550b8d['body'],null))['then'](respondWithResult(_0x220c83,null))[_0x5cf7('0x40')](handleError(_0x220c83,null));};exports['destroy']=function(_0x5c16a0,_0x4feb8d){return db[_0x5cf7('0x27')][_0x5cf7('0x44')]({'where':{'id':_0x5c16a0[_0x5cf7('0x42')]['id']}})[_0x5cf7('0x20')](handleEntityNotFound(_0x4feb8d,null))[_0x5cf7('0x20')](removeEntity(_0x4feb8d,null))[_0x5cf7('0x40')](handleError(_0x4feb8d,null));}; \ No newline at end of file +var _0x0ab3=['order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ab3,0x1e1));var _0x30ab=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0ab3[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x30ab('0x0'));var rimraf=require(_0x30ab('0x1'));var zipdir=require(_0x30ab('0x2'));var jsonpatch=require(_0x30ab('0x3'));var rp=require(_0x30ab('0x4'));var moment=require(_0x30ab('0x5'));var BPromise=require(_0x30ab('0x6'));var Mustache=require(_0x30ab('0x7'));var util=require(_0x30ab('0x8'));var path=require('path');var sox=require(_0x30ab('0x9'));var csv=require('to-csv');var ejs=require(_0x30ab('0xa'));var fs=require('fs');var fs_extra=require(_0x30ab('0xb'));var _=require(_0x30ab('0xc'));var squel=require(_0x30ab('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x30ab('0xe'));var toCsv=require(_0x30ab('0xf'));var querystring=require(_0x30ab('0x10'));var Papa=require('papaparse');var Redis=require(_0x30ab('0x11'));var authService=require(_0x30ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x30ab('0x13'));var hardwareService=require(_0x30ab('0x14'));var logger=require(_0x30ab('0x15'))(_0x30ab('0x16'));var utils=require(_0x30ab('0x17'));var config=require(_0x30ab('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x30ab('0x19'))['db'];function respondWithStatusCode(_0x51c782,_0x32f474){_0x32f474=_0x32f474||0xcc;return function(_0x43cfb3){if(_0x43cfb3){return _0x51c782[_0x30ab('0x1a')](_0x32f474);}return _0x51c782[_0x30ab('0x1b')](_0x32f474)[_0x30ab('0x1c')]();};}function respondWithResult(_0x24c58a,_0x244653){_0x244653=_0x244653||0xc8;return function(_0x1d9d4c){if(_0x1d9d4c){return _0x24c58a[_0x30ab('0x1b')](_0x244653)[_0x30ab('0x1d')](_0x1d9d4c);}};}function respondWithFilteredResult(_0x317392,_0x5d3d9e){return function(_0x132483){if(_0x132483){var _0x1de0c8=typeof _0x5d3d9e[_0x30ab('0x1e')]==='undefined'&&typeof _0x5d3d9e[_0x30ab('0x1f')]===_0x30ab('0x20');var _0xcc15ae=_0x132483[_0x30ab('0x21')];var _0x20eee3=_0x1de0c8?0x0:_0x5d3d9e['offset'];var _0x52e84c=_0x1de0c8?_0x132483[_0x30ab('0x21')]:_0x5d3d9e[_0x30ab('0x1e')]+_0x5d3d9e[_0x30ab('0x1f')];var _0x4c57d3;if(_0x52e84c>=_0xcc15ae){_0x52e84c=_0xcc15ae;_0x4c57d3=0xc8;}else{_0x4c57d3=0xce;}_0x317392[_0x30ab('0x1b')](_0x4c57d3);return _0x317392[_0x30ab('0x22')](_0x30ab('0x23'),_0x20eee3+'-'+_0x52e84c+'/'+_0xcc15ae)[_0x30ab('0x1d')](_0x132483);}return null;};}function patchUpdates(_0x27c63d){return function(_0x15fbbd){try{jsonpatch['apply'](_0x15fbbd,_0x27c63d,!![]);}catch(_0x286eca){return BPromise[_0x30ab('0x24')](_0x286eca);}return _0x15fbbd['save']();};}function saveUpdates(_0x5f1a1c,_0x4d8f5f){return function(_0x15133e){if(_0x15133e){return _0x15133e['update'](_0x5f1a1c)[_0x30ab('0x25')](function(_0x18d756){return _0x18d756;});}return null;};}function removeEntity(_0x1f0f6b,_0x514538){return function(_0x4f77db){if(_0x4f77db){return _0x4f77db[_0x30ab('0x26')]()[_0x30ab('0x25')](function(){_0x1f0f6b[_0x30ab('0x1b')](0xcc)[_0x30ab('0x1c')]();});}};}function handleEntityNotFound(_0x3df3aa,_0x138dde){return function(_0x2838f4){if(!_0x2838f4){_0x3df3aa[_0x30ab('0x1a')](0x194);}return _0x2838f4;};}function handleError(_0x25fdb9,_0x17b3f5){_0x17b3f5=_0x17b3f5||0x1f4;return function(_0xc4a4d5){logger[_0x30ab('0x27')](_0xc4a4d5[_0x30ab('0x28')]);if(_0xc4a4d5[_0x30ab('0x29')]){delete _0xc4a4d5[_0x30ab('0x29')];}_0x25fdb9['status'](_0x17b3f5)[_0x30ab('0x2a')](_0xc4a4d5);};}exports[_0x30ab('0x2b')]=function(_0x178628,_0x81a74a){var _0x14e3be={},_0x217e41={},_0x55f85d={'count':0x0,'rows':[]};var _0x4e7e19=_[_0x30ab('0x2c')](db[_0x30ab('0x2d')][_0x30ab('0x2e')],function(_0x41a9b4){return{'name':_0x41a9b4[_0x30ab('0x2f')],'type':_0x41a9b4[_0x30ab('0x30')][_0x30ab('0x31')]};});_0x217e41[_0x30ab('0x32')]=_[_0x30ab('0x2c')](_0x4e7e19,_0x30ab('0x29'));_0x217e41['query']=_['keys'](_0x178628[_0x30ab('0x33')]);_0x217e41['filters']=_['intersection'](_0x217e41['model'],_0x217e41[_0x30ab('0x33')]);_0x14e3be[_0x30ab('0x34')]=_[_0x30ab('0x35')](_0x217e41['model'],qs[_0x30ab('0x36')](_0x178628[_0x30ab('0x33')]['fields']));_0x14e3be['attributes']=_0x14e3be[_0x30ab('0x34')][_0x30ab('0x37')]?_0x14e3be[_0x30ab('0x34')]:_0x217e41[_0x30ab('0x32')];if(!_0x178628[_0x30ab('0x33')][_0x30ab('0x38')](_0x30ab('0x39'))){_0x14e3be[_0x30ab('0x1f')]=qs[_0x30ab('0x1f')](_0x178628['query'][_0x30ab('0x1f')]);_0x14e3be[_0x30ab('0x1e')]=qs['offset'](_0x178628['query'][_0x30ab('0x1e')]);}_0x14e3be[_0x30ab('0x3a')]=qs[_0x30ab('0x3b')](_0x178628['query'][_0x30ab('0x3b')]);_0x14e3be[_0x30ab('0x3c')]=qs[_0x30ab('0x3d')](_[_0x30ab('0x3e')](_0x178628[_0x30ab('0x33')],_0x217e41[_0x30ab('0x3d')]),_0x4e7e19);if(_0x178628['query'][_0x30ab('0x3f')]){_0x14e3be['where']=_['merge'](_0x14e3be[_0x30ab('0x3c')],{'$or':_[_0x30ab('0x2c')](_0x4e7e19,function(_0x4f62ad){if(_0x4f62ad[_0x30ab('0x30')]!=='VIRTUAL'){var _0xf6682f={};_0xf6682f[_0x4f62ad[_0x30ab('0x29')]]={'$like':'%'+_0x178628[_0x30ab('0x33')]['filter']+'%'};return _0xf6682f;}})});}_0x14e3be=_[_0x30ab('0x40')]({},_0x14e3be,_0x178628['options']);var _0x102f22={'where':_0x14e3be[_0x30ab('0x3c')]};return db[_0x30ab('0x2d')][_0x30ab('0x21')](_0x102f22)[_0x30ab('0x25')](function(_0xfb821e){_0x55f85d[_0x30ab('0x21')]=_0xfb821e;if(_0x178628[_0x30ab('0x33')][_0x30ab('0x41')]){_0x14e3be[_0x30ab('0x42')]=[{'all':!![]}];}return db[_0x30ab('0x2d')][_0x30ab('0x43')](_0x14e3be);})[_0x30ab('0x25')](function(_0x3d0fb9){_0x55f85d[_0x30ab('0x44')]=_0x3d0fb9;return _0x55f85d;})[_0x30ab('0x25')](respondWithFilteredResult(_0x81a74a,_0x14e3be))['catch'](handleError(_0x81a74a,null));};exports['show']=function(_0x2000f9,_0x1fd3c0){var _0x1c8dfc={'raw':!![],'where':{'id':_0x2000f9[_0x30ab('0x45')]['id']}},_0x1ab78f={};_0x1ab78f['model']=_[_0x30ab('0x46')](db[_0x30ab('0x2d')][_0x30ab('0x2e')]);_0x1ab78f[_0x30ab('0x33')]=_[_0x30ab('0x46')](_0x2000f9[_0x30ab('0x33')]);_0x1ab78f[_0x30ab('0x3d')]=_[_0x30ab('0x35')](_0x1ab78f['model'],_0x1ab78f[_0x30ab('0x33')]);_0x1c8dfc[_0x30ab('0x34')]=_[_0x30ab('0x35')](_0x1ab78f[_0x30ab('0x32')],qs[_0x30ab('0x36')](_0x2000f9[_0x30ab('0x33')][_0x30ab('0x36')]));_0x1c8dfc[_0x30ab('0x34')]=_0x1c8dfc[_0x30ab('0x34')][_0x30ab('0x37')]?_0x1c8dfc[_0x30ab('0x34')]:_0x1ab78f[_0x30ab('0x32')];if(_0x2000f9[_0x30ab('0x33')][_0x30ab('0x41')]){_0x1c8dfc[_0x30ab('0x42')]=[{'all':!![]}];}_0x1c8dfc=_['merge']({},_0x1c8dfc,_0x2000f9[_0x30ab('0x47')]);return db[_0x30ab('0x2d')][_0x30ab('0x48')](_0x1c8dfc)[_0x30ab('0x25')](handleEntityNotFound(_0x1fd3c0,null))[_0x30ab('0x25')](respondWithResult(_0x1fd3c0,null))[_0x30ab('0x49')](handleError(_0x1fd3c0,null));};exports[_0x30ab('0x4a')]=function(_0x233534,_0x4d4228){return db['SugarcrmField'][_0x30ab('0x4a')](_0x233534[_0x30ab('0x4b')],{})[_0x30ab('0x25')](respondWithResult(_0x4d4228,0xc9))[_0x30ab('0x49')](handleError(_0x4d4228,null));};exports[_0x30ab('0x4c')]=function(_0x2ffe55,_0x4be04d){if(_0x2ffe55[_0x30ab('0x4b')]['id']){delete _0x2ffe55[_0x30ab('0x4b')]['id'];}return db[_0x30ab('0x2d')][_0x30ab('0x48')]({'where':{'id':_0x2ffe55[_0x30ab('0x45')]['id']}})[_0x30ab('0x25')](handleEntityNotFound(_0x4be04d,null))[_0x30ab('0x25')](saveUpdates(_0x2ffe55[_0x30ab('0x4b')],null))['then'](respondWithResult(_0x4be04d,null))[_0x30ab('0x49')](handleError(_0x4be04d,null));};exports[_0x30ab('0x26')]=function(_0x1b233a,_0x2e5efe){return db['SugarcrmField'][_0x30ab('0x48')]({'where':{'id':_0x1b233a[_0x30ab('0x45')]['id']}})[_0x30ab('0x25')](handleEntityNotFound(_0x2e5efe,null))['then'](removeEntity(_0x2e5efe,null))['catch'](handleError(_0x2e5efe,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 096634c..b87369c 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 _0x9f59=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','idField','lodash','../../config/logger','api','moment','request-promise'];(function(_0xc5853e,_0x272cee){var _0x352609=function(_0x2bb1c8){while(--_0x2bb1c8){_0xc5853e['push'](_0xc5853e['shift']());}};_0x352609(++_0x272cee);}(_0x9f59,0x1cf));var _0x99f5=function(_0x22824b,_0x2c57bb){_0x22824b=_0x22824b-0x0;var _0x9cf821=_0x9f59[_0x22824b];return _0x9cf821;};'use strict';var _=require(_0x99f5('0x0'));var util=require('util');var logger=require(_0x99f5('0x1'))(_0x99f5('0x2'));var moment=require(_0x99f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x99f5('0x4'));var fs=require('fs');var path=require(_0x99f5('0x5'));var rimraf=require(_0x99f5('0x6'));var config=require(_0x99f5('0x7'));var attributes=require(_0x99f5('0x8'));module[_0x99f5('0x9')]=function(_0x2d53c9,_0x369e35){return _0x2d53c9['define'](_0x99f5('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x99f5('0xb'),'fields':[_0x99f5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf495=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0xa9c1d5,_0x56e606){var _0x3b7533=function(_0x4b8411){while(--_0x4b8411){_0xa9c1d5['push'](_0xa9c1d5['shift']());}};_0x3b7533(++_0x56e606);}(_0xf495,0x1a3));var _0x5f49=function(_0x255091,_0x109e99){_0x255091=_0x255091-0x0;var _0x3f6e10=_0xf495[_0x255091];return _0x3f6e10;};'use strict';var _=require(_0x5f49('0x0'));var util=require(_0x5f49('0x1'));var logger=require(_0x5f49('0x2'))('api');var moment=require(_0x5f49('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f49('0x4'));var fs=require('fs');var path=require(_0x5f49('0x5'));var rimraf=require(_0x5f49('0x6'));var config=require(_0x5f49('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x5f49('0x8')]=function(_0x14d437,_0x2eba0c){return _0x14d437[_0x5f49('0x9')](_0x5f49('0xa'),attributes,{'tableName':_0x5f49('0xb'),'paranoid':![],'indexes':[{'name':_0x5f49('0xc'),'fields':[_0x5f49('0xd'),_0x5f49('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ee6d4b1..5529f08 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 _0x1e1b=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xae7ebf,_0x340293){var _0x45478d=function(_0x13c083){while(--_0x13c083){_0xae7ebf['push'](_0xae7ebf['shift']());}};_0x45478d(++_0x340293);}(_0x1e1b,0xdd));var _0xb1e1=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0x1e1b[_0x450bf9];return _0x268350;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb1e1('0x0'));var BPromise=require(_0xb1e1('0x1'));var rs=require(_0xb1e1('0x2'));var fs=require('fs');var Redis=require(_0xb1e1('0x3'));var db=require(_0xb1e1('0x4'))['db'];var utils=require(_0xb1e1('0x5'));var logger=require(_0xb1e1('0x6'))('rpc');var config=require(_0xb1e1('0x7'));var jayson=require(_0xb1e1('0x8'));var client=jayson[_0xb1e1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417b19,_0x1171e1,_0x5d7ed1){return new BPromise(function(_0x14b4b6,_0x214b74){return client[_0xb1e1('0xa')](_0x417b19,_0x5d7ed1)[_0xb1e1('0xb')](function(_0x4b5d97){logger[_0xb1e1('0xc')](_0xb1e1('0xd'),_0x1171e1,_0xb1e1('0xe'));logger[_0xb1e1('0xf')](_0xb1e1('0x10'),_0x1171e1,_0xb1e1('0xe'),JSON['stringify'](_0x4b5d97));if(_0x4b5d97[_0xb1e1('0x11')]){if(_0x4b5d97['error'][_0xb1e1('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1171e1,_0x4b5d97['error'][_0xb1e1('0x13')]);return _0x214b74(_0x4b5d97[_0xb1e1('0x11')]['message']);}logger[_0xb1e1('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1171e1,_0x4b5d97[_0xb1e1('0x11')][_0xb1e1('0x13')]);return _0x14b4b6(_0x4b5d97[_0xb1e1('0x11')][_0xb1e1('0x13')]);}else{logger['info'](_0xb1e1('0xd'),_0x1171e1,_0xb1e1('0xe'));_0x14b4b6(_0x4b5d97['result'][_0xb1e1('0x13')]);}})[_0xb1e1('0x14')](function(_0xdd4dfc){logger[_0xb1e1('0x11')](_0xb1e1('0xd'),_0x1171e1,_0xdd4dfc);_0x214b74(_0xdd4dfc);});});} \ No newline at end of file +var _0xafa2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x50a29a,_0x5613c7){var _0x15b456=function(_0x53344c){while(--_0x53344c){_0x50a29a['push'](_0x50a29a['shift']());}};_0x15b456(++_0x5613c7);}(_0xafa2,0x182));var _0x2afa=function(_0x3bcc86,_0x32a508){_0x3bcc86=_0x3bcc86-0x0;var _0x118d8c=_0xafa2[_0x3bcc86];return _0x118d8c;};'use strict';var _=require(_0x2afa('0x0'));var util=require('util');var moment=require(_0x2afa('0x1'));var BPromise=require(_0x2afa('0x2'));var rs=require(_0x2afa('0x3'));var fs=require('fs');var Redis=require(_0x2afa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2afa('0x5'));var logger=require(_0x2afa('0x6'))(_0x2afa('0x7'));var config=require(_0x2afa('0x8'));var jayson=require(_0x2afa('0x9'));var client=jayson[_0x2afa('0xa')][_0x2afa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204575,_0x3172eb,_0xbb8e05){return new BPromise(function(_0x50eee1,_0x243574){return client[_0x2afa('0xc')](_0x204575,_0xbb8e05)['then'](function(_0x272998){logger[_0x2afa('0xd')](_0x2afa('0xe'),_0x3172eb,_0x2afa('0xf'));logger[_0x2afa('0x10')](_0x2afa('0x11'),_0x3172eb,_0x2afa('0xf'),JSON['stringify'](_0x272998));if(_0x272998[_0x2afa('0x12')]){if(_0x272998[_0x2afa('0x12')][_0x2afa('0x13')]===0x1f4){logger['error'](_0x2afa('0xe'),_0x3172eb,_0x272998[_0x2afa('0x12')][_0x2afa('0x14')]);return _0x243574(_0x272998[_0x2afa('0x12')][_0x2afa('0x14')]);}logger[_0x2afa('0x12')](_0x2afa('0xe'),_0x3172eb,_0x272998[_0x2afa('0x12')][_0x2afa('0x14')]);return _0x50eee1(_0x272998[_0x2afa('0x12')][_0x2afa('0x14')]);}else{logger['info'](_0x2afa('0xe'),_0x3172eb,_0x2afa('0xf'));_0x50eee1(_0x272998[_0x2afa('0x15')][_0x2afa('0x14')]);}})[_0x2afa('0x16')](function(_0x5b4d06){logger[_0x2afa('0x12')](_0x2afa('0xe'),_0x3172eb,_0x5b4d06);_0x243574(_0x5b4d06);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 134e143..75dfaef 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 _0x9224=['fs-extra','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x19e6ba,_0x210695){var _0x3aecea=function(_0x263ba5){while(--_0x263ba5){_0x19e6ba['push'](_0x19e6ba['shift']());}};_0x3aecea(++_0x210695);}(_0x9224,0xa3));var _0x4922=function(_0xb10358,_0x255326){_0xb10358=_0xb10358-0x0;var _0x23685a=_0x9224[_0xb10358];return _0x23685a;};'use strict';var multer=require('multer');var util=require(_0x4922('0x0'));var path=require(_0x4922('0x1'));var timeout=require(_0x4922('0x2'));var express=require(_0x4922('0x3'));var router=express[_0x4922('0x4')]();var fs_extra=require(_0x4922('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4922('0x6'));router['get']('/',auth[_0x4922('0x7')](),controller[_0x4922('0x8')]);router[_0x4922('0x9')](_0x4922('0xa'),auth[_0x4922('0x7')](),controller[_0x4922('0xb')]);router['get'](_0x4922('0xc'),auth[_0x4922('0x7')](),controller['getConfigurations']);router[_0x4922('0x9')](_0x4922('0xd'),auth[_0x4922('0x7')](),controller[_0x4922('0xe')]);router[_0x4922('0xf')]('/',auth[_0x4922('0x7')](),controller[_0x4922('0x10')]);router[_0x4922('0xf')]('/:id/configurations',auth[_0x4922('0x7')](),controller['addConfiguration']);router[_0x4922('0x11')](_0x4922('0xa'),auth[_0x4922('0x7')](),controller[_0x4922('0x12')]);router[_0x4922('0x13')]('/:id',auth[_0x4922('0x7')](),controller[_0x4922('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcf84=['/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcf84,0x175));var _0x4cf8=function(_0x58f8f5,_0x4cc71f){_0x58f8f5=_0x58f8f5-0x0;var _0x1887a6=_0xcf84[_0x58f8f5];return _0x1887a6;};'use strict';var multer=require(_0x4cf8('0x0'));var util=require(_0x4cf8('0x1'));var path=require(_0x4cf8('0x2'));var timeout=require(_0x4cf8('0x3'));var express=require(_0x4cf8('0x4'));var router=express[_0x4cf8('0x5')]();var fs_extra=require(_0x4cf8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4cf8('0x7'));var config=require('../../config/environment');var controller=require(_0x4cf8('0x8'));router[_0x4cf8('0x9')]('/',auth[_0x4cf8('0xa')](),controller['index']);router['get'](_0x4cf8('0xb'),auth[_0x4cf8('0xa')](),controller['show']);router[_0x4cf8('0x9')](_0x4cf8('0xc'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0xd')]);router[_0x4cf8('0x9')](_0x4cf8('0xe'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0xf')]);router[_0x4cf8('0x10')]('/',auth['isAuthenticated'](),controller[_0x4cf8('0x11')]);router[_0x4cf8('0x10')](_0x4cf8('0xc'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0x12')]);router[_0x4cf8('0x13')](_0x4cf8('0xb'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0x14')]);router[_0x4cf8('0x15')](_0x4cf8('0xb'),auth['isAuthenticated'](),controller[_0x4cf8('0x16')]);module[_0x4cf8('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index ecdf1aa..08adf7b 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 _0x68eb=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68eb,0x13e));var _0xb68e=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x68eb[_0x178856];return _0x3c7fe7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb68e('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb68e('0x0')]},'username':{'type':Sequelize[_0xb68e('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb68e('0x0')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb68e('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb68e('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x9af0=['exports','STRING','sequelize'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9af0,0x1bb));var _0x09af=function(_0x141a96,_0x3accf1){_0x141a96=_0x141a96-0x0;var _0x5993ed=_0x9af0[_0x141a96];return _0x5993ed;};'use strict';var Sequelize=require(_0x09af('0x0'));module[_0x09af('0x1')]={'name':{'type':Sequelize[_0x09af('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x09af('0x2')]},'username':{'type':Sequelize[_0x09af('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x09af('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x09af('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 7525aa9..fb00de6 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 _0xab39=['false','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','findAll','params','fields','include','catch','create','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','POST','token','describe','result','sessionName','success','autogenerated','reference','owner','editable'];(function(_0xf78d3b,_0x5e019d){var _0xe2c368=function(_0x3c553f){while(--_0x3c553f){_0xf78d3b['push'](_0xf78d3b['shift']());}};_0xe2c368(++_0x5e019d);}(_0xab39,0x16f));var _0x9ab3=function(_0x5b31f1,_0x2dcd9d){_0x5b31f1=_0x5b31f1-0x0;var _0x43853b=_0xab39[_0x5b31f1];return _0x43853b;};'use strict';var emlformat=require(_0x9ab3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ab3('0x1'));var jsonpatch=require(_0x9ab3('0x2'));var rp=require('request-promise');var moment=require(_0x9ab3('0x3'));var BPromise=require(_0x9ab3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9ab3('0x5'));var sox=require(_0x9ab3('0x6'));var csv=require(_0x9ab3('0x7'));var ejs=require(_0x9ab3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9ab3('0x9'));var crypto=require(_0x9ab3('0xa'));var jsforce=require(_0x9ab3('0xb'));var deskjs=require(_0x9ab3('0xc'));var toCsv=require(_0x9ab3('0x7'));var querystring=require(_0x9ab3('0xd'));var Papa=require(_0x9ab3('0xe'));var Redis=require(_0x9ab3('0xf'));var authService=require(_0x9ab3('0x10'));var qs=require(_0x9ab3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ab3('0x12'))(_0x9ab3('0x13'));var utils=require(_0x9ab3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9ab3('0x15'))['db'];var integrations=require(_0x9ab3('0x16'));function respondWithStatusCode(_0x509cb5,_0xbee52f){_0xbee52f=_0xbee52f||0xcc;return function(_0x13bfad){if(_0x13bfad){return _0x509cb5['sendStatus'](_0xbee52f);}return _0x509cb5[_0x9ab3('0x17')](_0xbee52f)[_0x9ab3('0x18')]();};}function respondWithResult(_0x7bfdb1,_0x3d9f17){_0x3d9f17=_0x3d9f17||0xc8;return function(_0x1e3981){if(_0x1e3981){return _0x7bfdb1[_0x9ab3('0x17')](_0x3d9f17)[_0x9ab3('0x19')](_0x1e3981);}};}function respondWithFilteredResult(_0x5b168b,_0x3d6bdf){return function(_0x333a73){if(_0x333a73){var _0x24580d=typeof _0x3d6bdf[_0x9ab3('0x1a')]==='undefined'&&typeof _0x3d6bdf[_0x9ab3('0x1b')]===_0x9ab3('0x1c');var _0x4b9b1f=_0x333a73[_0x9ab3('0x1d')];var _0x1c6dba=_0x24580d?0x0:_0x3d6bdf[_0x9ab3('0x1a')];var _0x557c2c=_0x24580d?_0x333a73['count']:_0x3d6bdf[_0x9ab3('0x1a')]+_0x3d6bdf[_0x9ab3('0x1b')];var _0xbfeb1b;if(_0x557c2c>=_0x4b9b1f){_0x557c2c=_0x4b9b1f;_0xbfeb1b=0xc8;}else{_0xbfeb1b=0xce;}_0x5b168b['status'](_0xbfeb1b);return _0x5b168b[_0x9ab3('0x1e')](_0x9ab3('0x1f'),_0x1c6dba+'-'+_0x557c2c+'/'+_0x4b9b1f)[_0x9ab3('0x19')](_0x333a73);}return null;};}function patchUpdates(_0x33c89e){return function(_0x136834){try{jsonpatch[_0x9ab3('0x20')](_0x136834,_0x33c89e,!![]);}catch(_0x31f7af){return BPromise['reject'](_0x31f7af);}return _0x136834[_0x9ab3('0x21')]();};}function saveUpdates(_0x182bad,_0x2745e4){return function(_0x4dd831){if(_0x4dd831){return _0x4dd831[_0x9ab3('0x22')](_0x182bad)[_0x9ab3('0x23')](function(_0x54467c){return _0x54467c;});}return null;};}function removeEntity(_0x52d351,_0x5f0b51){return function(_0x201789){if(_0x201789){return _0x201789[_0x9ab3('0x24')]()[_0x9ab3('0x23')](function(){_0x52d351[_0x9ab3('0x17')](0xcc)[_0x9ab3('0x18')]();});}};}function handleEntityNotFound(_0x44c1e6,_0x4cc05a){return function(_0x1523b3){if(!_0x1523b3){_0x44c1e6['sendStatus'](0x194);}return _0x1523b3;};}function handleError(_0x350e0a,_0x20019c){_0x20019c=_0x20019c||0x1f4;return function(_0x4ac6d8){logger[_0x9ab3('0x25')](_0x4ac6d8[_0x9ab3('0x26')]);if(_0x4ac6d8[_0x9ab3('0x27')]){delete _0x4ac6d8[_0x9ab3('0x27')];}_0x350e0a[_0x9ab3('0x17')](_0x20019c)[_0x9ab3('0x28')](_0x4ac6d8);};}exports[_0x9ab3('0x29')]=function(_0x3aa387,_0x562d8b){var _0x3d5091={},_0x3a7db6={},_0x3c8773={'count':0x0,'rows':[]};var _0x47252a=_['map'](db['VtigerAccount'][_0x9ab3('0x2a')],function(_0x227e29){return{'name':_0x227e29[_0x9ab3('0x2b')],'type':_0x227e29[_0x9ab3('0x2c')][_0x9ab3('0x2d')]};});_0x3a7db6[_0x9ab3('0x2e')]=_[_0x9ab3('0x2f')](_0x47252a,_0x9ab3('0x27'));_0x3a7db6[_0x9ab3('0x30')]=_[_0x9ab3('0x31')](_0x3aa387[_0x9ab3('0x30')]);_0x3a7db6[_0x9ab3('0x32')]=_[_0x9ab3('0x33')](_0x3a7db6[_0x9ab3('0x2e')],_0x3a7db6['query']);_0x3d5091[_0x9ab3('0x34')]=_[_0x9ab3('0x33')](_0x3a7db6[_0x9ab3('0x2e')],qs['fields'](_0x3aa387[_0x9ab3('0x30')]['fields']));_0x3d5091['attributes']=_0x3d5091[_0x9ab3('0x34')][_0x9ab3('0x35')]?_0x3d5091[_0x9ab3('0x34')]:_0x3a7db6[_0x9ab3('0x2e')];if(!_0x3aa387[_0x9ab3('0x30')][_0x9ab3('0x36')](_0x9ab3('0x37'))){_0x3d5091[_0x9ab3('0x1b')]=qs[_0x9ab3('0x1b')](_0x3aa387[_0x9ab3('0x30')]['limit']);_0x3d5091[_0x9ab3('0x1a')]=qs[_0x9ab3('0x1a')](_0x3aa387[_0x9ab3('0x30')][_0x9ab3('0x1a')]);}_0x3d5091[_0x9ab3('0x38')]=qs[_0x9ab3('0x39')](_0x3aa387['query'][_0x9ab3('0x39')]);_0x3d5091[_0x9ab3('0x3a')]=qs[_0x9ab3('0x32')](_[_0x9ab3('0x3b')](_0x3aa387[_0x9ab3('0x30')],_0x3a7db6['filters']),_0x47252a);if(_0x3aa387[_0x9ab3('0x30')][_0x9ab3('0x3c')]){_0x3d5091[_0x9ab3('0x3a')]=_[_0x9ab3('0x3d')](_0x3d5091[_0x9ab3('0x3a')],{'$or':_[_0x9ab3('0x2f')](_0x47252a,function(_0x162cb9){if(_0x162cb9[_0x9ab3('0x2c')]!==_0x9ab3('0x3e')){var _0x5e590b={};_0x5e590b[_0x162cb9['name']]={'$like':'%'+_0x3aa387[_0x9ab3('0x30')]['filter']+'%'};return _0x5e590b;}})});}_0x3d5091=_[_0x9ab3('0x3d')]({},_0x3d5091,_0x3aa387[_0x9ab3('0x3f')]);var _0x9bc4b5={'where':_0x3d5091[_0x9ab3('0x3a')]};return db[_0x9ab3('0x40')][_0x9ab3('0x1d')](_0x9bc4b5)[_0x9ab3('0x23')](function(_0x49b1c3){_0x3c8773[_0x9ab3('0x1d')]=_0x49b1c3;if(_0x3aa387[_0x9ab3('0x30')][_0x9ab3('0x41')]){_0x3d5091['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x9ab3('0x42')](_0x3d5091);})[_0x9ab3('0x23')](function(_0x10f1f1){_0x3c8773['rows']=_0x10f1f1;return _0x3c8773;})[_0x9ab3('0x23')](respondWithFilteredResult(_0x562d8b,_0x3d5091))['catch'](handleError(_0x562d8b,null));};exports['show']=function(_0x528002,_0x5595e4){var _0x253e2a={'raw':![],'where':{'id':_0x528002[_0x9ab3('0x43')]['id']}},_0x5d0794={};_0x5d0794[_0x9ab3('0x2e')]=_[_0x9ab3('0x31')](db[_0x9ab3('0x40')]['rawAttributes']);_0x5d0794[_0x9ab3('0x30')]=_[_0x9ab3('0x31')](_0x528002[_0x9ab3('0x30')]);_0x5d0794[_0x9ab3('0x32')]=_[_0x9ab3('0x33')](_0x5d0794[_0x9ab3('0x2e')],_0x5d0794[_0x9ab3('0x30')]);_0x253e2a[_0x9ab3('0x34')]=_['intersection'](_0x5d0794[_0x9ab3('0x2e')],qs[_0x9ab3('0x44')](_0x528002[_0x9ab3('0x30')]['fields']));_0x253e2a['attributes']=_0x253e2a[_0x9ab3('0x34')][_0x9ab3('0x35')]?_0x253e2a['attributes']:_0x5d0794['model'];if(_0x528002[_0x9ab3('0x30')]['includeAll']){_0x253e2a[_0x9ab3('0x45')]=[{'all':!![]}];}_0x253e2a=_[_0x9ab3('0x3d')]({},_0x253e2a,_0x528002[_0x9ab3('0x3f')]);return db[_0x9ab3('0x40')]['find'](_0x253e2a)[_0x9ab3('0x23')](handleEntityNotFound(_0x5595e4,null))[_0x9ab3('0x23')](respondWithResult(_0x5595e4,null))[_0x9ab3('0x46')](handleError(_0x5595e4,null));};exports[_0x9ab3('0x47')]=function(_0x300585,_0x547fd6){return db[_0x9ab3('0x40')]['create'](_0x300585[_0x9ab3('0x48')],{})[_0x9ab3('0x23')](respondWithResult(_0x547fd6,0xc9))[_0x9ab3('0x46')](handleError(_0x547fd6,null));};exports[_0x9ab3('0x22')]=function(_0x723f08,_0x4f6e42){if(_0x723f08[_0x9ab3('0x48')]['id']){delete _0x723f08[_0x9ab3('0x48')]['id'];}return db[_0x9ab3('0x40')][_0x9ab3('0x49')]({'where':{'id':_0x723f08[_0x9ab3('0x43')]['id']}})[_0x9ab3('0x23')](handleEntityNotFound(_0x4f6e42,null))[_0x9ab3('0x23')](saveUpdates(_0x723f08[_0x9ab3('0x48')],null))[_0x9ab3('0x23')](respondWithResult(_0x4f6e42,null))[_0x9ab3('0x46')](handleError(_0x4f6e42,null));};exports[_0x9ab3('0x24')]=function(_0x10698a,_0x36ad40){return db['VtigerAccount'][_0x9ab3('0x49')]({'where':{'id':_0x10698a[_0x9ab3('0x43')]['id']}})[_0x9ab3('0x23')](handleEntityNotFound(_0x36ad40,null))[_0x9ab3('0x23')](removeEntity(_0x36ad40,null))[_0x9ab3('0x46')](handleError(_0x36ad40,null));};exports[_0x9ab3('0x4a')]=function(_0x1e35d1,_0x50a965,_0xf21776){var _0x491682={};var _0xb704b0={};var _0x57b20d;var _0x4f3e39;return db[_0x9ab3('0x40')][_0x9ab3('0x4b')]({'where':{'id':_0x1e35d1[_0x9ab3('0x43')]['id']}})[_0x9ab3('0x23')](handleEntityNotFound(_0x50a965,null))['then'](function(_0x38aa15){if(_0x38aa15){_0x57b20d=_0x38aa15;_0xb704b0[_0x9ab3('0x2e')]=_[_0x9ab3('0x31')](db[_0x9ab3('0x4c')][_0x9ab3('0x2a')]);_0xb704b0[_0x9ab3('0x30')]=_['keys'](_0x1e35d1[_0x9ab3('0x30')]);_0xb704b0[_0x9ab3('0x32')]=_['intersection'](_0xb704b0['model'],_0xb704b0[_0x9ab3('0x30')]);_0x491682[_0x9ab3('0x34')]=_[_0x9ab3('0x33')](_0xb704b0['model'],qs[_0x9ab3('0x44')](_0x1e35d1[_0x9ab3('0x30')][_0x9ab3('0x44')]));_0x491682[_0x9ab3('0x34')]=_0x491682[_0x9ab3('0x34')]['length']?_0x491682['attributes']:_0xb704b0['model'];_0x491682[_0x9ab3('0x38')]=qs['sort'](_0x1e35d1[_0x9ab3('0x30')][_0x9ab3('0x39')]);_0x491682['where']=qs[_0x9ab3('0x32')](_[_0x9ab3('0x3b')](_0x1e35d1[_0x9ab3('0x30')],_0xb704b0['filters']));if(_0x1e35d1[_0x9ab3('0x30')][_0x9ab3('0x3c')]){_0x491682['where']=_['merge'](_0x491682[_0x9ab3('0x3a')],{'$or':_[_0x9ab3('0x2f')](_0x491682[_0x9ab3('0x34')],function(_0x1fde1b){var _0x215f63={};_0x215f63[_0x1fde1b]={'$like':'%'+_0x1e35d1[_0x9ab3('0x30')]['filter']+'%'};return _0x215f63;})});}_0x491682=_[_0x9ab3('0x3d')]({},_0x491682,_0x1e35d1['options']);return _0x57b20d[_0x9ab3('0x4a')](_0x491682);}})['then'](function(_0x261c6e){if(_0x261c6e){_0x4f3e39=_0x261c6e[_0x9ab3('0x35')];if(!_0x1e35d1[_0x9ab3('0x30')][_0x9ab3('0x36')](_0x9ab3('0x37'))){_0x491682[_0x9ab3('0x1b')]=qs['limit'](_0x1e35d1[_0x9ab3('0x30')][_0x9ab3('0x1b')]);_0x491682[_0x9ab3('0x1a')]=qs[_0x9ab3('0x1a')](_0x1e35d1['query'][_0x9ab3('0x1a')]);}return _0x57b20d[_0x9ab3('0x4a')](_0x491682);}})['then'](function(_0x4e90c0){if(_0x4e90c0){return _0x4e90c0?{'count':_0x4f3e39,'rows':_0x4e90c0}:null;}})[_0x9ab3('0x23')](respondWithResult(_0x50a965,null))[_0x9ab3('0x46')](handleError(_0x50a965,null));};exports[_0x9ab3('0x4d')]=function(_0x5cd69b,_0x1847fc,_0x359fba){if(_0x5cd69b['body']['id']){delete _0x5cd69b[_0x9ab3('0x48')]['id'];}return db['VtigerAccount'][_0x9ab3('0x4b')]({'where':{'id':_0x5cd69b[_0x9ab3('0x43')]['id']}})['then'](handleEntityNotFound(_0x1847fc,null))['then'](function(_0x282b84){if(_0x282b84){_0x5cd69b['body'][_0x9ab3('0x4e')]=_0x282b84['id'];_0x5cd69b['body'][_0x9ab3('0x4f')]=integrations[_0x9ab3('0x50')](_0x5cd69b[_0x9ab3('0x48')][_0x9ab3('0x51')],_0x5cd69b['body'][_0x9ab3('0x2c')]);_0x5cd69b[_0x9ab3('0x48')][_0x9ab3('0x52')]=integrations[_0x9ab3('0x53')](_0x5cd69b[_0x9ab3('0x48')][_0x9ab3('0x51')],_0x5cd69b[_0x9ab3('0x48')][_0x9ab3('0x2c')]);return db['VtigerConfiguration'][_0x9ab3('0x47')](_0x5cd69b['body'],{'include':[{'model':db[_0x9ab3('0x54')],'as':_0x9ab3('0x4f')},{'model':db[_0x9ab3('0x54')],'as':_0x9ab3('0x52')}]});}return null;})[_0x9ab3('0x23')](respondWithResult(_0x1847fc,null))[_0x9ab3('0x46')](handleError(_0x1847fc,null));};var md5=require('md5');exports['getFields']=function(_0x21410e,_0x9c19c4,_0x28b297){var _0x17fc05=null;var _0x47bbfc=null;var _0x42155a=null;var _0x31f65c=null;var _0x350eb9='';return db['VtigerAccount'][_0x9ab3('0x4b')]({'where':{'id':_0x21410e[_0x9ab3('0x43')]['id']},'attributes':['id',_0x9ab3('0x27'),_0x9ab3('0x55'),'description',_0x9ab3('0x56'),_0x9ab3('0x57'),_0x9ab3('0x58'),_0x9ab3('0x59')]})[_0x9ab3('0x23')](handleEntityNotFound(_0x9c19c4,null))[_0x9ab3('0x23')](function(_0x290336){if(_0x290336){_0x17fc05=_0x290336[_0x9ab3('0x55')];_0x47bbfc=_0x290336[_0x9ab3('0x59')];_0x42155a=_0x290336[_0x9ab3('0x56')];_0x350eb9=_0x290336[_0x9ab3('0x57')];var _0x3d8c06=_0x350eb9[_0x9ab3('0x5a')](-0x1);if(_0x3d8c06==='/'){_0x350eb9=_0x350eb9[_0x9ab3('0x5b')](0x0,_0x350eb9[_0x9ab3('0x5c')](_0x3d8c06));}_0x31f65c=util['format'](_0x9ab3('0x5d'),_0x350eb9);var _0x3de22b={'method':'GET','uri':_0x31f65c,'qs':{'operation':_0x9ab3('0x5e'),'username':_0x290336[_0x9ab3('0x55')]},'json':!![]};return rp(_0x3de22b);}})['then'](function(_0x36c73d){if(_0x36c73d['success']){var _0x47e40d={'method':_0x9ab3('0x5f'),'uri':_0x31f65c,'form':{'operation':'login','username':_0x17fc05,'accessKey':md5(_0x36c73d['result'][_0x9ab3('0x60')]+_0x47bbfc)},'json':!![]};return rp(_0x47e40d);}})[_0x9ab3('0x23')](function(_0x35122f){if(_0x35122f['success']){var _0x46b5a8={'method':'GET','uri':_0x31f65c,'qs':{'operation':_0x9ab3('0x61'),'username':_0x17fc05,'sessionName':_0x35122f[_0x9ab3('0x62')][_0x9ab3('0x63')],'elementType':_0x42155a},'json':!![]};return rp(_0x46b5a8);}})[_0x9ab3('0x23')](function(_0x150acd){if(_0x150acd[_0x9ab3('0x64')]){var _0x10eb91=[_0x9ab3('0x65'),_0x9ab3('0x66'),_0x9ab3('0x67')];_['remove'](_0x150acd['result'][_0x9ab3('0x44')],function(_0x3bd9b0){return _0x10eb91['includes'](_0x3bd9b0[_0x9ab3('0x2c')][_0x9ab3('0x27')]);});_['remove'](_0x150acd['result'][_0x9ab3('0x44')],function(_0x56d102){return _0x56d102[_0x9ab3('0x68')]===_0x9ab3('0x69');});return{'count':_0x150acd[_0x9ab3('0x62')]['fields'][_0x9ab3('0x35')],'rows':_['map'](_0x150acd[_0x9ab3('0x62')][_0x9ab3('0x44')],function(_0x1b569c){return{'id':_0x1b569c[_0x9ab3('0x27')],'name':_0x1b569c['label'],'custom':_['startsWith'](_0x1b569c[_0x9ab3('0x27')],_0x9ab3('0x6a'))?!![]:![],'options':_0x1b569c[_0x9ab3('0x2c')]['name']===_0x9ab3('0x6b')&&_0x1b569c[_0x9ab3('0x2c')][_0x9ab3('0x6c')][_0x9ab3('0x35')]>0x0?_[_0x9ab3('0x2f')](_0x1b569c['type'][_0x9ab3('0x6c')],function(_0x38c472){return{'name':_0x38c472[_0x9ab3('0x6d')],'value':_0x38c472[_0x9ab3('0x6e')]};}):[]};})};}})[_0x9ab3('0x23')](respondWithResult(_0x9c19c4,null))['catch'](function(_0x5e6663){console[_0x9ab3('0x6f')](_0x9ab3('0x70')+_0x5e6663);var _0x34a28c=_0x21410e[_0x9ab3('0x30')][_0x9ab3('0x71')]?0x1f4:_0x5e6663[_0x9ab3('0x72')]||0x1f4;logger['error'](_0x9ab3('0x73'),_0x9ab3('0x74'),_0x34a28c,JSON['stringify'](_0x5e6663));delete _0x5e6663[_0x9ab3('0x27')];if(_0x34a28c===0x191){_0x34a28c=0x190;}_0x9c19c4[_0x9ab3('0x17')](_0x34a28c)['send'](_0x21410e['query'][_0x9ab3('0x71')]?{'message':_0x9ab3('0x75'),'statusCode':_0x5e6663[_0x9ab3('0x72')]}:_0x5e6663);});}; \ No newline at end of file +var _0x8a28=['substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','describe','result','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','type','options','VtigerAccount','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','filter','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x8a28,0x192));var _0x88a2=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x8a28[_0x25bea7];return _0x175952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88a2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88a2('0x1'));var rp=require('request-promise');var moment=require(_0x88a2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x88a2('0x3'));var util=require(_0x88a2('0x4'));var path=require(_0x88a2('0x5'));var sox=require(_0x88a2('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88a2('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x88a2('0x8'));var jsforce=require(_0x88a2('0x9'));var deskjs=require(_0x88a2('0xa'));var toCsv=require('to-csv');var querystring=require(_0x88a2('0xb'));var Papa=require(_0x88a2('0xc'));var Redis=require(_0x88a2('0xd'));var authService=require(_0x88a2('0xe'));var qs=require(_0x88a2('0xf'));var as=require(_0x88a2('0x10'));var hardwareService=require(_0x88a2('0x11'));var logger=require(_0x88a2('0x12'))(_0x88a2('0x13'));var utils=require(_0x88a2('0x14'));var config=require(_0x88a2('0x15'));var licenseUtil=require(_0x88a2('0x16'));var db=require(_0x88a2('0x17'))['db'];var integrations=require(_0x88a2('0x18'));function respondWithStatusCode(_0x496017,_0x383de4){_0x383de4=_0x383de4||0xcc;return function(_0x1c3bbb){if(_0x1c3bbb){return _0x496017[_0x88a2('0x19')](_0x383de4);}return _0x496017[_0x88a2('0x1a')](_0x383de4)[_0x88a2('0x1b')]();};}function respondWithResult(_0x212510,_0x97f696){_0x97f696=_0x97f696||0xc8;return function(_0x12938d){if(_0x12938d){return _0x212510[_0x88a2('0x1a')](_0x97f696)[_0x88a2('0x1c')](_0x12938d);}};}function respondWithFilteredResult(_0x4654bb,_0x49704f){return function(_0x256544){if(_0x256544){var _0x3f4d9c=typeof _0x49704f[_0x88a2('0x1d')]===_0x88a2('0x1e')&&typeof _0x49704f[_0x88a2('0x1f')]===_0x88a2('0x1e');var _0x49d945=_0x256544[_0x88a2('0x20')];var _0x4f9d88=_0x3f4d9c?0x0:_0x49704f['offset'];var _0x3cea78=_0x3f4d9c?_0x256544[_0x88a2('0x20')]:_0x49704f['offset']+_0x49704f[_0x88a2('0x1f')];var _0x5d4c14;if(_0x3cea78>=_0x49d945){_0x3cea78=_0x49d945;_0x5d4c14=0xc8;}else{_0x5d4c14=0xce;}_0x4654bb[_0x88a2('0x1a')](_0x5d4c14);return _0x4654bb[_0x88a2('0x21')](_0x88a2('0x22'),_0x4f9d88+'-'+_0x3cea78+'/'+_0x49d945)['json'](_0x256544);}return null;};}function patchUpdates(_0x47d82a){return function(_0x508b64){try{jsonpatch['apply'](_0x508b64,_0x47d82a,!![]);}catch(_0x41ca41){return BPromise[_0x88a2('0x23')](_0x41ca41);}return _0x508b64[_0x88a2('0x24')]();};}function saveUpdates(_0x144e4f,_0x23ba0d){return function(_0x525b0a){if(_0x525b0a){return _0x525b0a[_0x88a2('0x25')](_0x144e4f)[_0x88a2('0x26')](function(_0x3077f2){return _0x3077f2;});}return null;};}function removeEntity(_0x2fb959,_0x5c060d){return function(_0x1f3dca){if(_0x1f3dca){return _0x1f3dca[_0x88a2('0x27')]()[_0x88a2('0x26')](function(){_0x2fb959['status'](0xcc)[_0x88a2('0x1b')]();});}};}function handleEntityNotFound(_0x1e28db,_0x2daac9){return function(_0x151fab){if(!_0x151fab){_0x1e28db['sendStatus'](0x194);}return _0x151fab;};}function handleError(_0x255400,_0x45b3f8){_0x45b3f8=_0x45b3f8||0x1f4;return function(_0x1339dd){logger[_0x88a2('0x28')](_0x1339dd['stack']);if(_0x1339dd['name']){delete _0x1339dd[_0x88a2('0x29')];}_0x255400[_0x88a2('0x1a')](_0x45b3f8)[_0x88a2('0x2a')](_0x1339dd);};}exports[_0x88a2('0x2b')]=function(_0xfad7ad,_0x5c0e90){var _0x4d52a7={},_0x4a78b2={},_0x4c12db={'count':0x0,'rows':[]};var _0x3e1d4d=_[_0x88a2('0x2c')](db['VtigerAccount'][_0x88a2('0x2d')],function(_0x11b7e2){return{'name':_0x11b7e2[_0x88a2('0x2e')],'type':_0x11b7e2['type'][_0x88a2('0x2f')]};});_0x4a78b2[_0x88a2('0x30')]=_[_0x88a2('0x2c')](_0x3e1d4d,_0x88a2('0x29'));_0x4a78b2[_0x88a2('0x31')]=_[_0x88a2('0x32')](_0xfad7ad[_0x88a2('0x31')]);_0x4a78b2[_0x88a2('0x33')]=_['intersection'](_0x4a78b2['model'],_0x4a78b2[_0x88a2('0x31')]);_0x4d52a7[_0x88a2('0x34')]=_[_0x88a2('0x35')](_0x4a78b2[_0x88a2('0x30')],qs[_0x88a2('0x36')](_0xfad7ad[_0x88a2('0x31')]['fields']));_0x4d52a7[_0x88a2('0x34')]=_0x4d52a7[_0x88a2('0x34')][_0x88a2('0x37')]?_0x4d52a7['attributes']:_0x4a78b2[_0x88a2('0x30')];if(!_0xfad7ad[_0x88a2('0x31')]['hasOwnProperty'](_0x88a2('0x38'))){_0x4d52a7[_0x88a2('0x1f')]=qs[_0x88a2('0x1f')](_0xfad7ad[_0x88a2('0x31')][_0x88a2('0x1f')]);_0x4d52a7[_0x88a2('0x1d')]=qs[_0x88a2('0x1d')](_0xfad7ad[_0x88a2('0x31')][_0x88a2('0x1d')]);}_0x4d52a7[_0x88a2('0x39')]=qs[_0x88a2('0x3a')](_0xfad7ad[_0x88a2('0x31')][_0x88a2('0x3a')]);_0x4d52a7[_0x88a2('0x3b')]=qs[_0x88a2('0x33')](_['pick'](_0xfad7ad[_0x88a2('0x31')],_0x4a78b2[_0x88a2('0x33')]),_0x3e1d4d);if(_0xfad7ad[_0x88a2('0x31')]['filter']){_0x4d52a7[_0x88a2('0x3b')]=_[_0x88a2('0x3c')](_0x4d52a7[_0x88a2('0x3b')],{'$or':_[_0x88a2('0x2c')](_0x3e1d4d,function(_0x135ab3){if(_0x135ab3[_0x88a2('0x3d')]!=='VIRTUAL'){var _0x76517a={};_0x76517a[_0x135ab3[_0x88a2('0x29')]]={'$like':'%'+_0xfad7ad['query']['filter']+'%'};return _0x76517a;}})});}_0x4d52a7=_[_0x88a2('0x3c')]({},_0x4d52a7,_0xfad7ad[_0x88a2('0x3e')]);var _0x24db24={'where':_0x4d52a7['where']};return db[_0x88a2('0x3f')][_0x88a2('0x20')](_0x24db24)['then'](function(_0x1ad178){_0x4c12db[_0x88a2('0x20')]=_0x1ad178;if(_0xfad7ad[_0x88a2('0x31')][_0x88a2('0x40')]){_0x4d52a7[_0x88a2('0x41')]=[{'all':!![]}];}return db[_0x88a2('0x3f')][_0x88a2('0x42')](_0x4d52a7);})[_0x88a2('0x26')](function(_0x5929bf){_0x4c12db[_0x88a2('0x43')]=_0x5929bf;return _0x4c12db;})[_0x88a2('0x26')](respondWithFilteredResult(_0x5c0e90,_0x4d52a7))[_0x88a2('0x44')](handleError(_0x5c0e90,null));};exports['show']=function(_0x672d4b,_0x1d640c){var _0x34ce4a={'raw':![],'where':{'id':_0x672d4b[_0x88a2('0x45')]['id']}},_0x51ed07={};_0x51ed07[_0x88a2('0x30')]=_[_0x88a2('0x32')](db['VtigerAccount'][_0x88a2('0x2d')]);_0x51ed07[_0x88a2('0x31')]=_['keys'](_0x672d4b['query']);_0x51ed07[_0x88a2('0x33')]=_['intersection'](_0x51ed07[_0x88a2('0x30')],_0x51ed07[_0x88a2('0x31')]);_0x34ce4a[_0x88a2('0x34')]=_[_0x88a2('0x35')](_0x51ed07[_0x88a2('0x30')],qs['fields'](_0x672d4b['query'][_0x88a2('0x36')]));_0x34ce4a[_0x88a2('0x34')]=_0x34ce4a['attributes'][_0x88a2('0x37')]?_0x34ce4a['attributes']:_0x51ed07['model'];if(_0x672d4b[_0x88a2('0x31')][_0x88a2('0x40')]){_0x34ce4a['include']=[{'all':!![]}];}_0x34ce4a=_['merge']({},_0x34ce4a,_0x672d4b[_0x88a2('0x3e')]);return db[_0x88a2('0x3f')][_0x88a2('0x46')](_0x34ce4a)[_0x88a2('0x26')](handleEntityNotFound(_0x1d640c,null))[_0x88a2('0x26')](respondWithResult(_0x1d640c,null))[_0x88a2('0x44')](handleError(_0x1d640c,null));};exports[_0x88a2('0x47')]=function(_0x10394c,_0x408f92){return db[_0x88a2('0x3f')][_0x88a2('0x47')](_0x10394c[_0x88a2('0x48')],{})[_0x88a2('0x26')](respondWithResult(_0x408f92,0xc9))[_0x88a2('0x44')](handleError(_0x408f92,null));};exports['update']=function(_0x5d4b65,_0x4f5173){if(_0x5d4b65['body']['id']){delete _0x5d4b65['body']['id'];}return db['VtigerAccount'][_0x88a2('0x46')]({'where':{'id':_0x5d4b65[_0x88a2('0x45')]['id']}})[_0x88a2('0x26')](handleEntityNotFound(_0x4f5173,null))[_0x88a2('0x26')](saveUpdates(_0x5d4b65[_0x88a2('0x48')],null))['then'](respondWithResult(_0x4f5173,null))[_0x88a2('0x44')](handleError(_0x4f5173,null));};exports[_0x88a2('0x27')]=function(_0x513813,_0x378115){return db['VtigerAccount'][_0x88a2('0x46')]({'where':{'id':_0x513813[_0x88a2('0x45')]['id']}})[_0x88a2('0x26')](handleEntityNotFound(_0x378115,null))[_0x88a2('0x26')](removeEntity(_0x378115,null))[_0x88a2('0x44')](handleError(_0x378115,null));};exports[_0x88a2('0x49')]=function(_0xfa41b1,_0x4d4c9b,_0x3224c7){var _0x5a991f={};var _0x370716={};var _0x16fc62;var _0x5a5064;return db[_0x88a2('0x3f')]['findOne']({'where':{'id':_0xfa41b1['params']['id']}})['then'](handleEntityNotFound(_0x4d4c9b,null))['then'](function(_0x299f8a){if(_0x299f8a){_0x16fc62=_0x299f8a;_0x370716[_0x88a2('0x30')]=_[_0x88a2('0x32')](db['VtigerConfiguration'][_0x88a2('0x2d')]);_0x370716[_0x88a2('0x31')]=_['keys'](_0xfa41b1[_0x88a2('0x31')]);_0x370716['filters']=_[_0x88a2('0x35')](_0x370716[_0x88a2('0x30')],_0x370716[_0x88a2('0x31')]);_0x5a991f[_0x88a2('0x34')]=_[_0x88a2('0x35')](_0x370716['model'],qs[_0x88a2('0x36')](_0xfa41b1[_0x88a2('0x31')][_0x88a2('0x36')]));_0x5a991f[_0x88a2('0x34')]=_0x5a991f['attributes'][_0x88a2('0x37')]?_0x5a991f[_0x88a2('0x34')]:_0x370716[_0x88a2('0x30')];_0x5a991f[_0x88a2('0x39')]=qs[_0x88a2('0x3a')](_0xfa41b1[_0x88a2('0x31')]['sort']);_0x5a991f[_0x88a2('0x3b')]=qs['filters'](_['pick'](_0xfa41b1['query'],_0x370716[_0x88a2('0x33')]));if(_0xfa41b1[_0x88a2('0x31')]['filter']){_0x5a991f[_0x88a2('0x3b')]=_[_0x88a2('0x3c')](_0x5a991f[_0x88a2('0x3b')],{'$or':_['map'](_0x5a991f[_0x88a2('0x34')],function(_0x5d53a7){var _0x243878={};_0x243878[_0x5d53a7]={'$like':'%'+_0xfa41b1[_0x88a2('0x31')][_0x88a2('0x4a')]+'%'};return _0x243878;})});}_0x5a991f=_[_0x88a2('0x3c')]({},_0x5a991f,_0xfa41b1[_0x88a2('0x3e')]);return _0x16fc62[_0x88a2('0x49')](_0x5a991f);}})[_0x88a2('0x26')](function(_0x3821c8){if(_0x3821c8){_0x5a5064=_0x3821c8[_0x88a2('0x37')];if(!_0xfa41b1['query'][_0x88a2('0x4b')](_0x88a2('0x38'))){_0x5a991f[_0x88a2('0x1f')]=qs[_0x88a2('0x1f')](_0xfa41b1[_0x88a2('0x31')][_0x88a2('0x1f')]);_0x5a991f[_0x88a2('0x1d')]=qs[_0x88a2('0x1d')](_0xfa41b1['query'][_0x88a2('0x1d')]);}return _0x16fc62[_0x88a2('0x49')](_0x5a991f);}})[_0x88a2('0x26')](function(_0xa6b367){if(_0xa6b367){return _0xa6b367?{'count':_0x5a5064,'rows':_0xa6b367}:null;}})[_0x88a2('0x26')](respondWithResult(_0x4d4c9b,null))['catch'](handleError(_0x4d4c9b,null));};exports[_0x88a2('0x4c')]=function(_0x3a8875,_0x17485,_0xedd1d8){if(_0x3a8875['body']['id']){delete _0x3a8875[_0x88a2('0x48')]['id'];}return db['VtigerAccount'][_0x88a2('0x4d')]({'where':{'id':_0x3a8875['params']['id']}})[_0x88a2('0x26')](handleEntityNotFound(_0x17485,null))[_0x88a2('0x26')](function(_0x758d5){if(_0x758d5){_0x3a8875[_0x88a2('0x48')]['AccountId']=_0x758d5['id'];_0x3a8875['body']['Subjects']=integrations[_0x88a2('0x4e')](_0x3a8875[_0x88a2('0x48')][_0x88a2('0x4f')],_0x3a8875[_0x88a2('0x48')][_0x88a2('0x3d')]);_0x3a8875['body'][_0x88a2('0x50')]=integrations[_0x88a2('0x51')](_0x3a8875[_0x88a2('0x48')][_0x88a2('0x4f')],_0x3a8875['body'][_0x88a2('0x3d')]);return db[_0x88a2('0x52')]['create'](_0x3a8875[_0x88a2('0x48')],{'include':[{'model':db[_0x88a2('0x53')],'as':_0x88a2('0x54')},{'model':db[_0x88a2('0x53')],'as':_0x88a2('0x50')}]});}return null;})['then'](respondWithResult(_0x17485,null))[_0x88a2('0x44')](handleError(_0x17485,null));};var md5=require(_0x88a2('0x55'));exports[_0x88a2('0x56')]=function(_0x549573,_0x578054,_0x3ae488){var _0x3cd86b=null;var _0x2b4fe9=null;var _0x404864=null;var _0x213f0f=null;var _0x319e0e='';return db['VtigerAccount'][_0x88a2('0x4d')]({'where':{'id':_0x549573[_0x88a2('0x45')]['id']},'attributes':['id','name',_0x88a2('0x57'),_0x88a2('0x58'),_0x88a2('0x59'),_0x88a2('0x5a'),_0x88a2('0x5b'),'accessKey']})[_0x88a2('0x26')](handleEntityNotFound(_0x578054,null))[_0x88a2('0x26')](function(_0x27bc49){if(_0x27bc49){_0x3cd86b=_0x27bc49[_0x88a2('0x57')];_0x2b4fe9=_0x27bc49[_0x88a2('0x5c')];_0x404864=_0x27bc49[_0x88a2('0x59')];_0x319e0e=_0x27bc49[_0x88a2('0x5a')];var _0xad9e8a=_0x319e0e[_0x88a2('0x5d')](-0x1);if(_0xad9e8a==='/'){_0x319e0e=_0x319e0e[_0x88a2('0x5e')](0x0,_0x319e0e[_0x88a2('0x5f')](_0xad9e8a));}_0x213f0f=util['format'](_0x88a2('0x60'),_0x319e0e);var _0x46ea0d={'method':_0x88a2('0x61'),'uri':_0x213f0f,'qs':{'operation':_0x88a2('0x62'),'username':_0x27bc49[_0x88a2('0x57')]},'json':!![]};return rp(_0x46ea0d);}})[_0x88a2('0x26')](function(_0x5d2af8){if(_0x5d2af8[_0x88a2('0x63')]){var _0x4666f0={'method':_0x88a2('0x64'),'uri':_0x213f0f,'form':{'operation':_0x88a2('0x65'),'username':_0x3cd86b,'accessKey':md5(_0x5d2af8['result']['token']+_0x2b4fe9)},'json':!![]};return rp(_0x4666f0);}})[_0x88a2('0x26')](function(_0x2654bc){if(_0x2654bc[_0x88a2('0x63')]){var _0x4c8852={'method':_0x88a2('0x61'),'uri':_0x213f0f,'qs':{'operation':_0x88a2('0x66'),'username':_0x3cd86b,'sessionName':_0x2654bc[_0x88a2('0x67')]['sessionName'],'elementType':_0x404864},'json':!![]};return rp(_0x4c8852);}})[_0x88a2('0x26')](function(_0x30bd7f){if(_0x30bd7f[_0x88a2('0x63')]){var _0x2940e5=[_0x88a2('0x68'),_0x88a2('0x69'),_0x88a2('0x6a')];_[_0x88a2('0x6b')](_0x30bd7f[_0x88a2('0x67')][_0x88a2('0x36')],function(_0xfc6528){return _0x2940e5[_0x88a2('0x6c')](_0xfc6528[_0x88a2('0x3d')][_0x88a2('0x29')]);});_[_0x88a2('0x6b')](_0x30bd7f[_0x88a2('0x67')][_0x88a2('0x36')],function(_0x4e9cec){return _0x4e9cec[_0x88a2('0x6d')]===_0x88a2('0x6e');});return{'count':_0x30bd7f[_0x88a2('0x67')]['fields'][_0x88a2('0x37')],'rows':_[_0x88a2('0x2c')](_0x30bd7f[_0x88a2('0x67')][_0x88a2('0x36')],function(_0x30f415){return{'id':_0x30f415[_0x88a2('0x29')],'name':_0x30f415[_0x88a2('0x6f')],'custom':_[_0x88a2('0x70')](_0x30f415[_0x88a2('0x29')],_0x88a2('0x71'))?!![]:![],'options':_0x30f415['type']['name']===_0x88a2('0x72')&&_0x30f415[_0x88a2('0x3d')][_0x88a2('0x73')][_0x88a2('0x37')]>0x0?_[_0x88a2('0x2c')](_0x30f415['type'][_0x88a2('0x73')],function(_0x4c66e2){return{'name':_0x4c66e2[_0x88a2('0x6f')],'value':_0x4c66e2[_0x88a2('0x74')]};}):[]};})};}})[_0x88a2('0x26')](respondWithResult(_0x578054,null))[_0x88a2('0x44')](function(_0x2fef86){console[_0x88a2('0x75')](_0x88a2('0x76')+_0x2fef86);var _0x130ff0=_0x549573[_0x88a2('0x31')]['test']?0x1f4:_0x2fef86[_0x88a2('0x77')]||0x1f4;logger[_0x88a2('0x28')](_0x88a2('0x78'),_0x88a2('0x56'),_0x130ff0,JSON[_0x88a2('0x79')](_0x2fef86));delete _0x2fef86['name'];if(_0x130ff0===0x191){_0x130ff0=0x190;}_0x578054['status'](_0x130ff0)[_0x88a2('0x2a')](_0x549573[_0x88a2('0x31')][_0x88a2('0x7a')]?{'message':_0x88a2('0x7b'),'statusCode':_0x2fef86[_0x88a2('0x77')]}:_0x2fef86);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4e5b92c..0395473 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 _0x7c52=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x1ea5af,_0x1b2eb1){var _0x2b31de=function(_0x4deec5){while(--_0x4deec5){_0x1ea5af['push'](_0x1ea5af['shift']());}};_0x2b31de(++_0x1b2eb1);}(_0x7c52,0x12d));var _0x27c5=function(_0x12d60f,_0x398661){_0x12d60f=_0x12d60f-0x0;var _0x3e4107=_0x7c52[_0x12d60f];return _0x3e4107;};'use strict';var _=require(_0x27c5('0x0'));var util=require(_0x27c5('0x1'));var logger=require(_0x27c5('0x2'))(_0x27c5('0x3'));var moment=require(_0x27c5('0x4'));var BPromise=require(_0x27c5('0x5'));var rp=require(_0x27c5('0x6'));var fs=require('fs');var path=require(_0x27c5('0x7'));var rimraf=require(_0x27c5('0x8'));var config=require(_0x27c5('0x9'));var attributes=require(_0x27c5('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3a1f4f,_0x35e71e){return _0x3a1f4f[_0x27c5('0xb')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24a5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerAccount','lodash'];(function(_0x24b7be,_0x5563ce){var _0x3a8c4e=function(_0x59ae83){while(--_0x59ae83){_0x24b7be['push'](_0x24b7be['shift']());}};_0x3a8c4e(++_0x5563ce);}(_0x24a5,0x110));var _0x524a=function(_0x2ddb9c,_0x10e3c4){_0x2ddb9c=_0x2ddb9c-0x0;var _0x2dfcd3=_0x24a5[_0x2ddb9c];return _0x2dfcd3;};'use strict';var _=require(_0x524a('0x0'));var util=require(_0x524a('0x1'));var logger=require(_0x524a('0x2'))(_0x524a('0x3'));var moment=require(_0x524a('0x4'));var BPromise=require(_0x524a('0x5'));var rp=require(_0x524a('0x6'));var fs=require('fs');var path=require(_0x524a('0x7'));var rimraf=require(_0x524a('0x8'));var config=require(_0x524a('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x524a('0xa')]=function(_0x47a940,_0x27a760){return _0x47a940[_0x524a('0xb')](_0x524a('0xc'),attributes,{'tableName':'int_vtiger_accounts','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 63fd3fe..04cd864 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 _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(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x91a7,0xe7));var _0x791a=function(_0x4cd7f2,_0x5e6d66){_0x4cd7f2=_0x4cd7f2-0x0;var _0x2bcfe5=_0x91a7[_0x4cd7f2];return _0x2bcfe5;};'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 +var _0x80ed=['then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','where','limit','include','map','model','attributes','GetVtigerAccount','VtigerAccount','find','raw','debug','ShowVtigerAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x80ed,0x11c));var _0xd80e=function(_0x1ca865,_0x54d7c8){_0x1ca865=_0x1ca865-0x0;var _0x3c10b9=_0x80ed[_0x1ca865];return _0x3c10b9;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});}exports['GetVtigerAccount']=function(_0x21ceec){var _0x1cc576=this;return new Promise(function(_0x3b543d,_0x34e239){return db['VtigerAccount'][_0xd80e('0x17')]({'raw':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x19')]||null:null,'attributes':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')]['attributes']||null:null,'limit':_0x21ceec['options']?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x1a')]||null:null,'include':_0x21ceec[_0xd80e('0x18')]?_0x21ceec[_0xd80e('0x18')][_0xd80e('0x1b')]?_[_0xd80e('0x1c')](_0x21ceec[_0xd80e('0x18')]['include'],function(_0x1fbf8a){return{'model':db[_0x1fbf8a[_0xd80e('0x1d')]],'as':_0x1fbf8a['as'],'attributes':_0x1fbf8a[_0xd80e('0x1e')],'include':_0x1fbf8a['include']?_[_0xd80e('0x1c')](_0x1fbf8a[_0xd80e('0x1b')],function(_0xe9bb59){return{'model':db[_0xe9bb59['model']],'as':_0xe9bb59['as'],'attributes':_0xe9bb59['attributes'],'include':_0xe9bb59['include']?_[_0xd80e('0x1c')](_0xe9bb59['include'],function(_0x9f9287){return{'model':db[_0x9f9287[_0xd80e('0x1d')]],'as':_0x9f9287['as'],'attributes':_0x9f9287['attributes']};}):[]};}):[]};}):[]:[]})[_0xd80e('0xc')](function(_0xe1c04a){logger[_0xd80e('0xd')](_0xd80e('0x1f'),_0x21ceec);logger['debug'](_0xd80e('0x1f'),_0x21ceec,JSON[_0xd80e('0x11')](_0xe1c04a));_0x3b543d(_0xe1c04a);})[_0xd80e('0x16')](function(_0x39088b){logger[_0xd80e('0x12')](_0xd80e('0x1f'),_0x39088b[_0xd80e('0x14')],_0x21ceec);_0x34e239(_0x1cc576[_0xd80e('0x12')](0x1f4,_0x39088b['message']));});});};exports['ShowVtigerAccount']=function(_0x30f9bd){var _0x1303eb=this;return new Promise(function(_0x400220,_0x32360c){return db[_0xd80e('0x20')][_0xd80e('0x21')]({'raw':_0x30f9bd['options']?_0x30f9bd['options'][_0xd80e('0x22')]===undefined?!![]:![]:!![],'where':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x19')]||null:null,'attributes':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x1e')]||null:null,'include':_0x30f9bd[_0xd80e('0x18')]?_0x30f9bd['options']['include']?_[_0xd80e('0x1c')](_0x30f9bd[_0xd80e('0x18')][_0xd80e('0x1b')],function(_0x12d113){return{'model':db[_0x12d113[_0xd80e('0x1d')]],'as':_0x12d113['as'],'attributes':_0x12d113[_0xd80e('0x1e')],'include':_0x12d113[_0xd80e('0x1b')]?_[_0xd80e('0x1c')](_0x12d113[_0xd80e('0x1b')],function(_0x192c08){return{'model':db[_0x192c08['model']],'as':_0x192c08['as'],'attributes':_0x192c08[_0xd80e('0x1e')],'include':_0x192c08['include']?_[_0xd80e('0x1c')](_0x192c08[_0xd80e('0x1b')],function(_0x366b80){return{'model':db[_0x366b80[_0xd80e('0x1d')]],'as':_0x366b80['as'],'attributes':_0x366b80['attributes']};}):[]};}):[]};}):[]:[]})[_0xd80e('0xc')](function(_0x54a969){logger[_0xd80e('0xd')]('ShowVtigerAccount',_0x30f9bd);logger[_0xd80e('0x23')](_0xd80e('0x24'),_0x30f9bd,JSON['stringify'](_0x54a969));_0x400220(_0x54a969);})[_0xd80e('0x16')](function(_0x41ac0d){logger[_0xd80e('0x12')]('ShowVtigerAccount',_0x41ac0d[_0xd80e('0x14')],_0x30f9bd);_0x32360c(_0x1303eb[_0xd80e('0x12')](0x1f4,_0x41ac0d[_0xd80e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 048359a..1e51351 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 _0xa121=['./intVtigerConfiguration.controller','isAuthenticated','index','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xa121,0xac));var _0x1a12=function(_0x79a921,_0x1fa8ab){_0x79a921=_0x79a921-0x0;var _0x1c1518=_0xa121[_0x79a921];return _0x1c1518;};'use strict';var multer=require(_0x1a12('0x0'));var util=require(_0x1a12('0x1'));var path=require(_0x1a12('0x2'));var timeout=require(_0x1a12('0x3'));var express=require(_0x1a12('0x4'));var router=express[_0x1a12('0x5')]();var fs_extra=require(_0x1a12('0x6'));var auth=require(_0x1a12('0x7'));var interaction=require(_0x1a12('0x8'));var config=require(_0x1a12('0x9'));var controller=require(_0x1a12('0xa'));router['get']('/',auth[_0x1a12('0xb')](),controller[_0x1a12('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a12('0xd')]);router['get'](_0x1a12('0xe'),auth[_0x1a12('0xb')](),controller[_0x1a12('0xf')]);router[_0x1a12('0x10')](_0x1a12('0x11'),auth['isAuthenticated'](),controller[_0x1a12('0x12')]);router[_0x1a12('0x10')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x1a12('0x13')]('/',auth[_0x1a12('0xb')](),controller['create']);router[_0x1a12('0x14')](_0x1a12('0x15'),auth[_0x1a12('0xb')](),controller[_0x1a12('0x16')]);router[_0x1a12('0x17')](_0x1a12('0x15'),auth['isAuthenticated'](),controller[_0x1a12('0x18')]);module[_0x1a12('0x19')]=router; \ No newline at end of file +var _0x89c2=['isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id'];(function(_0x45a313,_0x37a410){var _0x53c9e8=function(_0x311a93){while(--_0x311a93){_0x45a313['push'](_0x45a313['shift']());}};_0x53c9e8(++_0x37a410);}(_0x89c2,0x193));var _0x289c=function(_0x21a881,_0x180e06){_0x21a881=_0x21a881-0x0;var _0x1324ef=_0x89c2[_0x21a881];return _0x1324ef;};'use strict';var multer=require('multer');var util=require(_0x289c('0x0'));var path=require(_0x289c('0x1'));var timeout=require(_0x289c('0x2'));var express=require(_0x289c('0x3'));var router=express[_0x289c('0x4')]();var fs_extra=require(_0x289c('0x5'));var auth=require(_0x289c('0x6'));var interaction=require(_0x289c('0x7'));var config=require(_0x289c('0x8'));var controller=require(_0x289c('0x9'));router[_0x289c('0xa')]('/',auth['isAuthenticated'](),controller[_0x289c('0xb')]);router['get'](_0x289c('0xc'),auth[_0x289c('0xd')](),controller[_0x289c('0xe')]);router['get'](_0x289c('0xf'),auth[_0x289c('0xd')](),controller[_0x289c('0x10')]);router['get']('/:id/subjects',auth[_0x289c('0xd')](),controller[_0x289c('0x11')]);router[_0x289c('0xa')](_0x289c('0x12'),auth[_0x289c('0xd')](),controller[_0x289c('0x13')]);router[_0x289c('0x14')]('/',auth[_0x289c('0xd')](),controller[_0x289c('0x15')]);router['put']('/:id',auth[_0x289c('0xd')](),controller[_0x289c('0x16')]);router[_0x289c('0x17')](_0x289c('0xc'),auth[_0x289c('0xd')](),controller[_0x289c('0x18')]);module[_0x289c('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3813aaa..63f667a 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 _0x4f53=['sequelize','exports','STRING'];(function(_0x2e293a,_0x2bccfa){var _0x1524a1=function(_0x5ec7aa){while(--_0x5ec7aa){_0x2e293a['push'](_0x2e293a['shift']());}};_0x1524a1(++_0x2bccfa);}(_0x4f53,0x19b));var _0x34f5=function(_0x5acfd8,_0x27446d){_0x5acfd8=_0x5acfd8-0x0;var _0x3f2a39=_0x4f53[_0x5acfd8];return _0x3f2a39;};'use strict';var Sequelize=require(_0x34f5('0x0'));module[_0x34f5('0x1')]={'name':{'type':Sequelize[_0x34f5('0x2')]},'description':{'type':Sequelize[_0x34f5('0x2')]}}; \ No newline at end of file +var _0x43ef=['exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43ef,0x1ba));var _0xf43e=function(_0x46338d,_0x11fa24){_0x46338d=_0x46338d-0x0;var _0x38c152=_0x43ef[_0x46338d];return _0x38c152;};'use strict';var Sequelize=require('sequelize');module[_0xf43e('0x0')]={'name':{'type':Sequelize[_0xf43e('0x1')]},'description':{'type':Sequelize[_0xf43e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2f3558c..7331fc2 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 _0x7747=['stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','findOne','VtigerField','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','end','error'];(function(_0x3d19cc,_0x256657){var _0x2d8bcf=function(_0x3c9df0){while(--_0x3c9df0){_0x3d19cc['push'](_0x3d19cc['shift']());}};_0x2d8bcf(++_0x256657);}(_0x7747,0xc5));var _0x7774=function(_0x476464,_0x422a44){_0x476464=_0x476464-0x0;var _0x4cd09b=_0x7747[_0x476464];return _0x4cd09b;};'use strict';var emlformat=require(_0x7774('0x0'));var rimraf=require(_0x7774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7774('0x2'));var rp=require('request-promise');var moment=require(_0x7774('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7774('0x4'));var util=require(_0x7774('0x5'));var path=require('path');var sox=require(_0x7774('0x6'));var csv=require('to-csv');var ejs=require(_0x7774('0x7'));var fs=require('fs');var fs_extra=require(_0x7774('0x8'));var _=require('lodash');var squel=require(_0x7774('0x9'));var crypto=require('crypto');var jsforce=require(_0x7774('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7774('0xb'));var querystring=require(_0x7774('0xc'));var Papa=require('papaparse');var Redis=require(_0x7774('0xd'));var authService=require(_0x7774('0xe'));var qs=require(_0x7774('0xf'));var as=require(_0x7774('0x10'));var hardwareService=require(_0x7774('0x11'));var logger=require(_0x7774('0x12'))(_0x7774('0x13'));var utils=require(_0x7774('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7774('0x15'));var db=require(_0x7774('0x16'))['db'];function respondWithStatusCode(_0x4be5a8,_0x37d23e){_0x37d23e=_0x37d23e||0xcc;return function(_0x21b2cf){if(_0x21b2cf){return _0x4be5a8[_0x7774('0x17')](_0x37d23e);}return _0x4be5a8[_0x7774('0x18')](_0x37d23e)['end']();};}function respondWithResult(_0x289a25,_0x5ee298){_0x5ee298=_0x5ee298||0xc8;return function(_0x2ed894){if(_0x2ed894){return _0x289a25['status'](_0x5ee298)[_0x7774('0x19')](_0x2ed894);}};}function respondWithFilteredResult(_0x4e1971,_0x116cad){return function(_0x1e4c9f){if(_0x1e4c9f){var _0x2c9dea=typeof _0x116cad[_0x7774('0x1a')]===_0x7774('0x1b')&&typeof _0x116cad[_0x7774('0x1c')]==='undefined';var _0x5e1791=_0x1e4c9f['count'];var _0x1938c1=_0x2c9dea?0x0:_0x116cad[_0x7774('0x1a')];var _0xba08c5=_0x2c9dea?_0x1e4c9f[_0x7774('0x1d')]:_0x116cad[_0x7774('0x1a')]+_0x116cad['limit'];var _0xce7d51;if(_0xba08c5>=_0x5e1791){_0xba08c5=_0x5e1791;_0xce7d51=0xc8;}else{_0xce7d51=0xce;}_0x4e1971[_0x7774('0x18')](_0xce7d51);return _0x4e1971[_0x7774('0x1e')](_0x7774('0x1f'),_0x1938c1+'-'+_0xba08c5+'/'+_0x5e1791)[_0x7774('0x19')](_0x1e4c9f);}return null;};}function patchUpdates(_0x13c50f){return function(_0xad20fe){try{jsonpatch['apply'](_0xad20fe,_0x13c50f,!![]);}catch(_0x4a4700){return BPromise['reject'](_0x4a4700);}return _0xad20fe[_0x7774('0x20')]();};}function saveUpdates(_0xa80a4a,_0x2f0b92){return function(_0x1c96fc){if(_0x1c96fc){return _0x1c96fc['update'](_0xa80a4a)[_0x7774('0x21')](function(_0x146371){return _0x146371;});}return null;};}function removeEntity(_0x256d07,_0x27de44){return function(_0xe88d7){if(_0xe88d7){return _0xe88d7[_0x7774('0x22')]()[_0x7774('0x21')](function(){_0x256d07[_0x7774('0x18')](0xcc)[_0x7774('0x23')]();});}};}function handleEntityNotFound(_0x37f912,_0x53da3f){return function(_0x5a1b06){if(!_0x5a1b06){_0x37f912[_0x7774('0x17')](0x194);}return _0x5a1b06;};}function handleError(_0x56710a,_0x48fbe5){_0x48fbe5=_0x48fbe5||0x1f4;return function(_0x176f51){logger[_0x7774('0x24')](_0x176f51[_0x7774('0x25')]);if(_0x176f51[_0x7774('0x26')]){delete _0x176f51[_0x7774('0x26')];}_0x56710a['status'](_0x48fbe5)['send'](_0x176f51);};}exports[_0x7774('0x27')]=function(_0x3e0aeb,_0x185abf){var _0x379d69={},_0x42acc2={},_0x36f078={'count':0x0,'rows':[]};var _0x5a8af2=_[_0x7774('0x28')](db['VtigerConfiguration'][_0x7774('0x29')],function(_0x22c99a){return{'name':_0x22c99a[_0x7774('0x2a')],'type':_0x22c99a[_0x7774('0x2b')][_0x7774('0x2c')]};});_0x42acc2[_0x7774('0x2d')]=_['map'](_0x5a8af2,_0x7774('0x26'));_0x42acc2['query']=_[_0x7774('0x2e')](_0x3e0aeb['query']);_0x42acc2[_0x7774('0x2f')]=_[_0x7774('0x30')](_0x42acc2[_0x7774('0x2d')],_0x42acc2['query']);_0x379d69[_0x7774('0x31')]=_['intersection'](_0x42acc2[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x32')]));_0x379d69[_0x7774('0x31')]=_0x379d69['attributes'][_0x7774('0x34')]?_0x379d69[_0x7774('0x31')]:_0x42acc2[_0x7774('0x2d')];if(!_0x3e0aeb['query'][_0x7774('0x35')](_0x7774('0x36'))){_0x379d69[_0x7774('0x1c')]=qs['limit'](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x1c')]);_0x379d69[_0x7774('0x1a')]=qs[_0x7774('0x1a')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x1a')]);}_0x379d69['order']=qs[_0x7774('0x37')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x37')]);_0x379d69[_0x7774('0x38')]=qs[_0x7774('0x2f')](_[_0x7774('0x39')](_0x3e0aeb[_0x7774('0x33')],_0x42acc2['filters']),_0x5a8af2);if(_0x3e0aeb['query'][_0x7774('0x3a')]){_0x379d69[_0x7774('0x38')]=_['merge'](_0x379d69[_0x7774('0x38')],{'$or':_[_0x7774('0x28')](_0x5a8af2,function(_0x2b0ab0){if(_0x2b0ab0[_0x7774('0x2b')]!=='VIRTUAL'){var _0x1e82cb={};_0x1e82cb[_0x2b0ab0['name']]={'$like':'%'+_0x3e0aeb[_0x7774('0x33')][_0x7774('0x3a')]+'%'};return _0x1e82cb;}})});}_0x379d69=_[_0x7774('0x3b')]({},_0x379d69,_0x3e0aeb['options']);var _0x297c6b={'where':_0x379d69['where']};return db[_0x7774('0x3c')][_0x7774('0x1d')](_0x297c6b)['then'](function(_0x2785ff){_0x36f078[_0x7774('0x1d')]=_0x2785ff;if(_0x3e0aeb[_0x7774('0x33')][_0x7774('0x3d')]){_0x379d69[_0x7774('0x3e')]=[{'all':!![]}];}return db[_0x7774('0x3c')][_0x7774('0x3f')](_0x379d69);})['then'](function(_0x5e0f95){_0x36f078[_0x7774('0x40')]=_0x5e0f95;return _0x36f078;})['then'](respondWithFilteredResult(_0x185abf,_0x379d69))[_0x7774('0x41')](handleError(_0x185abf,null));};exports[_0x7774('0x42')]=function(_0x1f6edd,_0x5a1632){var _0x1b9fec={'raw':![],'where':{'id':_0x1f6edd[_0x7774('0x43')]['id']}},_0x7b6333={};_0x7b6333['model']=_[_0x7774('0x2e')](db[_0x7774('0x3c')][_0x7774('0x29')]);_0x7b6333['query']=_[_0x7774('0x2e')](_0x1f6edd[_0x7774('0x33')]);_0x7b6333['filters']=_[_0x7774('0x30')](_0x7b6333['model'],_0x7b6333[_0x7774('0x33')]);_0x1b9fec[_0x7774('0x31')]=_[_0x7774('0x30')](_0x7b6333[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x1f6edd[_0x7774('0x33')][_0x7774('0x32')]));_0x1b9fec['attributes']=_0x1b9fec[_0x7774('0x31')]['length']?_0x1b9fec[_0x7774('0x31')]:_0x7b6333[_0x7774('0x2d')];if(_0x1f6edd[_0x7774('0x33')][_0x7774('0x3d')]){_0x1b9fec[_0x7774('0x3e')]=[{'all':!![]}];}_0x1b9fec=_[_0x7774('0x3b')]({},_0x1b9fec,_0x1f6edd[_0x7774('0x44')]);return db[_0x7774('0x3c')][_0x7774('0x45')](_0x1b9fec)[_0x7774('0x21')](handleEntityNotFound(_0x5a1632,null))[_0x7774('0x21')](respondWithResult(_0x5a1632,null))[_0x7774('0x41')](handleError(_0x5a1632,null));};exports[_0x7774('0x46')]=function(_0x3d432d,_0xf44eb3){return db[_0x7774('0x3c')][_0x7774('0x46')](_0x3d432d[_0x7774('0x47')],{})['then'](respondWithResult(_0xf44eb3,0xc9))[_0x7774('0x41')](handleError(_0xf44eb3,null));};exports[_0x7774('0x48')]=function(_0x257159,_0x51640b){if(_0x257159[_0x7774('0x47')]['id']){delete _0x257159[_0x7774('0x47')]['id'];}return db[_0x7774('0x3c')][_0x7774('0x45')]({'where':{'id':_0x257159['params']['id']}})[_0x7774('0x21')](handleEntityNotFound(_0x51640b,null))[_0x7774('0x21')](saveUpdates(_0x257159[_0x7774('0x47')],null))[_0x7774('0x21')](respondWithResult(_0x51640b,null))[_0x7774('0x41')](handleError(_0x51640b,null));};exports[_0x7774('0x22')]=function(_0xc2743,_0x5005b5){return db[_0x7774('0x3c')][_0x7774('0x45')]({'where':{'id':_0xc2743[_0x7774('0x43')]['id']}})['then'](handleEntityNotFound(_0x5005b5,null))['then'](removeEntity(_0x5005b5,null))['catch'](handleError(_0x5005b5,null));};exports['getFields']=function(_0x59f5c0,_0x487aea,_0x11af46){var _0x3c1bb7={};var _0x2bf987={};var _0x9a7dac;var _0x26ce1c;return db[_0x7774('0x3c')][_0x7774('0x49')]({'where':{'id':_0x59f5c0['params']['id']}})['then'](handleEntityNotFound(_0x487aea,null))['then'](function(_0x7f2437){if(_0x7f2437){_0x9a7dac=_0x7f2437;_0x2bf987[_0x7774('0x2d')]=_[_0x7774('0x2e')](db[_0x7774('0x4a')][_0x7774('0x29')]);_0x2bf987[_0x7774('0x33')]=_['keys'](_0x59f5c0[_0x7774('0x33')]);_0x2bf987[_0x7774('0x2f')]=_[_0x7774('0x30')](_0x2bf987[_0x7774('0x2d')],_0x2bf987[_0x7774('0x33')]);_0x3c1bb7['attributes']=_[_0x7774('0x30')](_0x2bf987[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x59f5c0['query'][_0x7774('0x32')]));_0x3c1bb7['attributes']=_0x3c1bb7[_0x7774('0x31')][_0x7774('0x34')]?_0x3c1bb7[_0x7774('0x31')]:_0x2bf987['model'];_0x3c1bb7['order']=qs['sort'](_0x59f5c0[_0x7774('0x33')][_0x7774('0x37')]);_0x3c1bb7[_0x7774('0x38')]=qs[_0x7774('0x2f')](_[_0x7774('0x39')](_0x59f5c0['query'],_0x2bf987[_0x7774('0x2f')]));if(_0x59f5c0['query'][_0x7774('0x3a')]){_0x3c1bb7[_0x7774('0x38')]=_[_0x7774('0x3b')](_0x3c1bb7[_0x7774('0x38')],{'$or':_['map'](_0x3c1bb7[_0x7774('0x31')],function(_0x416476){var _0x55a6a8={};_0x55a6a8[_0x416476]={'$like':'%'+_0x59f5c0['query'][_0x7774('0x3a')]+'%'};return _0x55a6a8;})});}_0x3c1bb7=_[_0x7774('0x3b')]({},_0x3c1bb7,_0x59f5c0[_0x7774('0x44')]);return _0x9a7dac['getFields'](_0x3c1bb7);}})[_0x7774('0x21')](function(_0x96b365){if(_0x96b365){_0x26ce1c=_0x96b365[_0x7774('0x34')];if(!_0x59f5c0[_0x7774('0x33')][_0x7774('0x35')](_0x7774('0x36'))){_0x3c1bb7[_0x7774('0x1c')]=qs['limit'](_0x59f5c0[_0x7774('0x33')][_0x7774('0x1c')]);_0x3c1bb7[_0x7774('0x1a')]=qs[_0x7774('0x1a')](_0x59f5c0[_0x7774('0x33')]['offset']);}return _0x9a7dac['getFields'](_0x3c1bb7);}})[_0x7774('0x21')](function(_0x4f95a8){if(_0x4f95a8){return _0x4f95a8?{'count':_0x26ce1c,'rows':_0x4f95a8}:null;}})['then'](respondWithResult(_0x487aea,null))['catch'](handleError(_0x487aea,null));};exports[_0x7774('0x4b')]=function(_0xd39b43,_0x2a506d,_0x3c5914){var _0x1ab898={};var _0x2af78a={};var _0x52585a;var _0x3760ad;return db['VtigerConfiguration'][_0x7774('0x49')]({'where':{'id':_0xd39b43[_0x7774('0x43')]['id']}})[_0x7774('0x21')](handleEntityNotFound(_0x2a506d,null))['then'](function(_0x4a6c68){if(_0x4a6c68){_0x52585a=_0x4a6c68;_0x2af78a[_0x7774('0x2d')]=_[_0x7774('0x2e')](db[_0x7774('0x4a')][_0x7774('0x29')]);_0x2af78a[_0x7774('0x33')]=_[_0x7774('0x2e')](_0xd39b43[_0x7774('0x33')]);_0x2af78a[_0x7774('0x2f')]=_[_0x7774('0x30')](_0x2af78a[_0x7774('0x2d')],_0x2af78a['query']);_0x1ab898['attributes']=_['intersection'](_0x2af78a[_0x7774('0x2d')],qs['fields'](_0xd39b43['query'][_0x7774('0x32')]));_0x1ab898[_0x7774('0x31')]=_0x1ab898[_0x7774('0x31')][_0x7774('0x34')]?_0x1ab898[_0x7774('0x31')]:_0x2af78a[_0x7774('0x2d')];_0x1ab898[_0x7774('0x4c')]=qs['sort'](_0xd39b43[_0x7774('0x33')][_0x7774('0x37')]);_0x1ab898[_0x7774('0x38')]=qs[_0x7774('0x2f')](_[_0x7774('0x39')](_0xd39b43[_0x7774('0x33')],_0x2af78a[_0x7774('0x2f')]));if(_0xd39b43[_0x7774('0x33')][_0x7774('0x3a')]){_0x1ab898[_0x7774('0x38')]=_[_0x7774('0x3b')](_0x1ab898[_0x7774('0x38')],{'$or':_[_0x7774('0x28')](_0x1ab898[_0x7774('0x31')],function(_0x5680f0){var _0x41a240={};_0x41a240[_0x5680f0]={'$like':'%'+_0xd39b43[_0x7774('0x33')][_0x7774('0x3a')]+'%'};return _0x41a240;})});}_0x1ab898=_[_0x7774('0x3b')]({},_0x1ab898,_0xd39b43[_0x7774('0x44')]);return _0x52585a[_0x7774('0x4b')](_0x1ab898);}})[_0x7774('0x21')](function(_0x4489e7){if(_0x4489e7){_0x3760ad=_0x4489e7[_0x7774('0x34')];if(!_0xd39b43[_0x7774('0x33')]['hasOwnProperty'](_0x7774('0x36'))){_0x1ab898[_0x7774('0x1c')]=qs[_0x7774('0x1c')](_0xd39b43[_0x7774('0x33')]['limit']);_0x1ab898[_0x7774('0x1a')]=qs[_0x7774('0x1a')](_0xd39b43[_0x7774('0x33')][_0x7774('0x1a')]);}return _0x52585a['getSubjects'](_0x1ab898);}})[_0x7774('0x21')](function(_0x592e4e){if(_0x592e4e){return _0x592e4e?{'count':_0x3760ad,'rows':_0x592e4e}:null;}})['then'](respondWithResult(_0x2a506d,null))[_0x7774('0x41')](handleError(_0x2a506d,null));};exports[_0x7774('0x4d')]=function(_0x5ad115,_0x375c35,_0x1ae0fe){var _0x1bc60e={};var _0xd6cc3a={};var _0x67acaa;var _0x25f521;return db['VtigerConfiguration'][_0x7774('0x49')]({'where':{'id':_0x5ad115[_0x7774('0x43')]['id']}})['then'](handleEntityNotFound(_0x375c35,null))[_0x7774('0x21')](function(_0x51a43d){if(_0x51a43d){_0x67acaa=_0x51a43d;_0xd6cc3a[_0x7774('0x2d')]=_[_0x7774('0x2e')](db['VtigerField']['rawAttributes']);_0xd6cc3a['query']=_['keys'](_0x5ad115['query']);_0xd6cc3a[_0x7774('0x2f')]=_[_0x7774('0x30')](_0xd6cc3a[_0x7774('0x2d')],_0xd6cc3a[_0x7774('0x33')]);_0x1bc60e[_0x7774('0x31')]=_[_0x7774('0x30')](_0xd6cc3a[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x5ad115[_0x7774('0x33')]['fields']));_0x1bc60e[_0x7774('0x31')]=_0x1bc60e['attributes'][_0x7774('0x34')]?_0x1bc60e['attributes']:_0xd6cc3a['model'];_0x1bc60e[_0x7774('0x4c')]=qs[_0x7774('0x37')](_0x5ad115['query'][_0x7774('0x37')]);_0x1bc60e[_0x7774('0x38')]=qs['filters'](_[_0x7774('0x39')](_0x5ad115[_0x7774('0x33')],_0xd6cc3a['filters']));if(_0x5ad115['query'][_0x7774('0x3a')]){_0x1bc60e[_0x7774('0x38')]=_[_0x7774('0x3b')](_0x1bc60e['where'],{'$or':_[_0x7774('0x28')](_0x1bc60e['attributes'],function(_0x5cdf5c){var _0x48aa0f={};_0x48aa0f[_0x5cdf5c]={'$like':'%'+_0x5ad115[_0x7774('0x33')][_0x7774('0x3a')]+'%'};return _0x48aa0f;})});}_0x1bc60e=_[_0x7774('0x3b')]({},_0x1bc60e,_0x5ad115[_0x7774('0x44')]);return _0x67acaa[_0x7774('0x4d')](_0x1bc60e);}})[_0x7774('0x21')](function(_0x136c42){if(_0x136c42){_0x25f521=_0x136c42['length'];if(!_0x5ad115[_0x7774('0x33')]['hasOwnProperty'](_0x7774('0x36'))){_0x1bc60e[_0x7774('0x1c')]=qs[_0x7774('0x1c')](_0x5ad115[_0x7774('0x33')][_0x7774('0x1c')]);_0x1bc60e[_0x7774('0x1a')]=qs[_0x7774('0x1a')](_0x5ad115[_0x7774('0x33')]['offset']);}return _0x67acaa[_0x7774('0x4d')](_0x1bc60e);}})[_0x7774('0x21')](function(_0x3e1877){if(_0x3e1877){return _0x3e1877?{'count':_0x25f521,'rows':_0x3e1877}:null;}})[_0x7774('0x21')](respondWithResult(_0x375c35,null))[_0x7774('0x41')](handleError(_0x375c35,null));}; \ No newline at end of file +var _0x80c7=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','fields','body','find','params','findOne','VtigerField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','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/utils','../../config/environment'];(function(_0x26b73d,_0x864596){var _0x183b0f=function(_0x564994){while(--_0x564994){_0x26b73d['push'](_0x26b73d['shift']());}};_0x183b0f(++_0x864596);}(_0x80c7,0x8d));var _0x780c=function(_0x27573d,_0x14739e){_0x27573d=_0x27573d-0x0;var _0x2ed6ff=_0x80c7[_0x27573d];return _0x2ed6ff;};'use strict';var emlformat=require(_0x780c('0x0'));var rimraf=require(_0x780c('0x1'));var zipdir=require(_0x780c('0x2'));var jsonpatch=require(_0x780c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x780c('0x4'));var Mustache=require('mustache');var util=require(_0x780c('0x5'));var path=require(_0x780c('0x6'));var sox=require(_0x780c('0x7'));var csv=require(_0x780c('0x8'));var ejs=require(_0x780c('0x9'));var fs=require('fs');var fs_extra=require(_0x780c('0xa'));var _=require(_0x780c('0xb'));var squel=require(_0x780c('0xc'));var crypto=require(_0x780c('0xd'));var jsforce=require(_0x780c('0xe'));var deskjs=require(_0x780c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x780c('0x10'));var Papa=require(_0x780c('0x11'));var Redis=require('ioredis');var authService=require(_0x780c('0x12'));var qs=require(_0x780c('0x13'));var as=require(_0x780c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x780c('0x15'))(_0x780c('0x16'));var utils=require(_0x780c('0x17'));var config=require(_0x780c('0x18'));var licenseUtil=require(_0x780c('0x19'));var db=require(_0x780c('0x1a'))['db'];function respondWithStatusCode(_0x2b09af,_0x5a5986){_0x5a5986=_0x5a5986||0xcc;return function(_0x3aaa99){if(_0x3aaa99){return _0x2b09af[_0x780c('0x1b')](_0x5a5986);}return _0x2b09af[_0x780c('0x1c')](_0x5a5986)[_0x780c('0x1d')]();};}function respondWithResult(_0x5576e9,_0x4ea5df){_0x4ea5df=_0x4ea5df||0xc8;return function(_0x244934){if(_0x244934){return _0x5576e9[_0x780c('0x1c')](_0x4ea5df)['json'](_0x244934);}};}function respondWithFilteredResult(_0x5b74fb,_0x2c8c23){return function(_0xccd8c){if(_0xccd8c){var _0x21b69b=typeof _0x2c8c23[_0x780c('0x1e')]===_0x780c('0x1f')&&typeof _0x2c8c23[_0x780c('0x20')]==='undefined';var _0x45258b=_0xccd8c[_0x780c('0x21')];var _0x2127e2=_0x21b69b?0x0:_0x2c8c23[_0x780c('0x1e')];var _0x48e6fe=_0x21b69b?_0xccd8c[_0x780c('0x21')]:_0x2c8c23[_0x780c('0x1e')]+_0x2c8c23[_0x780c('0x20')];var _0x3d5269;if(_0x48e6fe>=_0x45258b){_0x48e6fe=_0x45258b;_0x3d5269=0xc8;}else{_0x3d5269=0xce;}_0x5b74fb['status'](_0x3d5269);return _0x5b74fb[_0x780c('0x22')](_0x780c('0x23'),_0x2127e2+'-'+_0x48e6fe+'/'+_0x45258b)['json'](_0xccd8c);}return null;};}function patchUpdates(_0x4f665d){return function(_0x5cccd3){try{jsonpatch[_0x780c('0x24')](_0x5cccd3,_0x4f665d,!![]);}catch(_0xe4e284){return BPromise[_0x780c('0x25')](_0xe4e284);}return _0x5cccd3[_0x780c('0x26')]();};}function saveUpdates(_0x444905,_0x21e720){return function(_0x2c66c5){if(_0x2c66c5){return _0x2c66c5[_0x780c('0x27')](_0x444905)[_0x780c('0x28')](function(_0x21b68a){return _0x21b68a;});}return null;};}function removeEntity(_0x1d0c8a,_0x55fc81){return function(_0x226f7b){if(_0x226f7b){return _0x226f7b[_0x780c('0x29')]()[_0x780c('0x28')](function(){_0x1d0c8a['status'](0xcc)[_0x780c('0x1d')]();});}};}function handleEntityNotFound(_0x121199,_0x38810b){return function(_0x27e326){if(!_0x27e326){_0x121199[_0x780c('0x1b')](0x194);}return _0x27e326;};}function handleError(_0x41a58b,_0x5d675c){_0x5d675c=_0x5d675c||0x1f4;return function(_0x1cb65e){logger[_0x780c('0x2a')](_0x1cb65e[_0x780c('0x2b')]);if(_0x1cb65e['name']){delete _0x1cb65e[_0x780c('0x2c')];}_0x41a58b[_0x780c('0x1c')](_0x5d675c)[_0x780c('0x2d')](_0x1cb65e);};}exports[_0x780c('0x2e')]=function(_0x26708b,_0x1819bf){var _0x37d6c8={},_0x35b97a={},_0x2a19b1={'count':0x0,'rows':[]};var _0x21f84e=_[_0x780c('0x2f')](db[_0x780c('0x30')][_0x780c('0x31')],function(_0x1216b4){return{'name':_0x1216b4['fieldName'],'type':_0x1216b4[_0x780c('0x32')][_0x780c('0x33')]};});_0x35b97a[_0x780c('0x34')]=_[_0x780c('0x2f')](_0x21f84e,_0x780c('0x2c'));_0x35b97a[_0x780c('0x35')]=_['keys'](_0x26708b[_0x780c('0x35')]);_0x35b97a[_0x780c('0x36')]=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],_0x35b97a['query']);_0x37d6c8['attributes']=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],qs['fields'](_0x26708b['query']['fields']));_0x37d6c8[_0x780c('0x38')]=_0x37d6c8[_0x780c('0x38')][_0x780c('0x39')]?_0x37d6c8['attributes']:_0x35b97a[_0x780c('0x34')];if(!_0x26708b['query']['hasOwnProperty'](_0x780c('0x3a'))){_0x37d6c8[_0x780c('0x20')]=qs[_0x780c('0x20')](_0x26708b[_0x780c('0x35')][_0x780c('0x20')]);_0x37d6c8[_0x780c('0x1e')]=qs['offset'](_0x26708b[_0x780c('0x35')][_0x780c('0x1e')]);}_0x37d6c8['order']=qs['sort'](_0x26708b[_0x780c('0x35')][_0x780c('0x3b')]);_0x37d6c8[_0x780c('0x3c')]=qs[_0x780c('0x36')](_[_0x780c('0x3d')](_0x26708b[_0x780c('0x35')],_0x35b97a[_0x780c('0x36')]),_0x21f84e);if(_0x26708b[_0x780c('0x35')][_0x780c('0x3e')]){_0x37d6c8[_0x780c('0x3c')]=_['merge'](_0x37d6c8[_0x780c('0x3c')],{'$or':_[_0x780c('0x2f')](_0x21f84e,function(_0x4c16b1){if(_0x4c16b1[_0x780c('0x32')]!==_0x780c('0x3f')){var _0x55ab16={};_0x55ab16[_0x4c16b1[_0x780c('0x2c')]]={'$like':'%'+_0x26708b['query'][_0x780c('0x3e')]+'%'};return _0x55ab16;}})});}_0x37d6c8=_[_0x780c('0x40')]({},_0x37d6c8,_0x26708b[_0x780c('0x41')]);var _0x5b2dfb={'where':_0x37d6c8['where']};return db[_0x780c('0x30')][_0x780c('0x21')](_0x5b2dfb)[_0x780c('0x28')](function(_0x71748b){_0x2a19b1[_0x780c('0x21')]=_0x71748b;if(_0x26708b[_0x780c('0x35')][_0x780c('0x42')]){_0x37d6c8[_0x780c('0x43')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x780c('0x44')](_0x37d6c8);})[_0x780c('0x28')](function(_0x5db660){_0x2a19b1[_0x780c('0x45')]=_0x5db660;return _0x2a19b1;})[_0x780c('0x28')](respondWithFilteredResult(_0x1819bf,_0x37d6c8))[_0x780c('0x46')](handleError(_0x1819bf,null));};exports['show']=function(_0x23cba0,_0x14a5d9){var _0x37d547={'raw':![],'where':{'id':_0x23cba0['params']['id']}},_0x4be864={};_0x4be864[_0x780c('0x34')]=_[_0x780c('0x47')](db[_0x780c('0x30')][_0x780c('0x31')]);_0x4be864[_0x780c('0x35')]=_[_0x780c('0x47')](_0x23cba0[_0x780c('0x35')]);_0x4be864['filters']=_['intersection'](_0x4be864[_0x780c('0x34')],_0x4be864[_0x780c('0x35')]);_0x37d547[_0x780c('0x38')]=_[_0x780c('0x37')](_0x4be864[_0x780c('0x34')],qs[_0x780c('0x48')](_0x23cba0[_0x780c('0x35')][_0x780c('0x48')]));_0x37d547['attributes']=_0x37d547[_0x780c('0x38')][_0x780c('0x39')]?_0x37d547[_0x780c('0x38')]:_0x4be864['model'];if(_0x23cba0['query'][_0x780c('0x42')]){_0x37d547[_0x780c('0x43')]=[{'all':!![]}];}_0x37d547=_[_0x780c('0x40')]({},_0x37d547,_0x23cba0[_0x780c('0x41')]);return db[_0x780c('0x30')]['find'](_0x37d547)[_0x780c('0x28')](handleEntityNotFound(_0x14a5d9,null))[_0x780c('0x28')](respondWithResult(_0x14a5d9,null))['catch'](handleError(_0x14a5d9,null));};exports['create']=function(_0x412f72,_0x59be69){return db['VtigerConfiguration']['create'](_0x412f72[_0x780c('0x49')],{})['then'](respondWithResult(_0x59be69,0xc9))[_0x780c('0x46')](handleError(_0x59be69,null));};exports['update']=function(_0x2deec6,_0x4eda4f){if(_0x2deec6[_0x780c('0x49')]['id']){delete _0x2deec6[_0x780c('0x49')]['id'];}return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x2deec6[_0x780c('0x4b')]['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4eda4f,null))[_0x780c('0x28')](saveUpdates(_0x2deec6[_0x780c('0x49')],null))['then'](respondWithResult(_0x4eda4f,null))[_0x780c('0x46')](handleError(_0x4eda4f,null));};exports[_0x780c('0x29')]=function(_0x3bae2d,_0x4e780e){return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x3bae2d['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4e780e,null))[_0x780c('0x28')](removeEntity(_0x4e780e,null))[_0x780c('0x46')](handleError(_0x4e780e,null));};exports['getFields']=function(_0x43f08b,_0x539358,_0x302bc){var _0x2ab39d={};var _0x21e78a={};var _0x53780d;var _0x4ac59f;return db['VtigerConfiguration'][_0x780c('0x4c')]({'where':{'id':_0x43f08b[_0x780c('0x4b')]['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x539358,null))['then'](function(_0x53a5a1){if(_0x53a5a1){_0x53780d=_0x53a5a1;_0x21e78a['model']=_['keys'](db[_0x780c('0x4d')][_0x780c('0x31')]);_0x21e78a[_0x780c('0x35')]=_[_0x780c('0x47')](_0x43f08b['query']);_0x21e78a[_0x780c('0x36')]=_['intersection'](_0x21e78a[_0x780c('0x34')],_0x21e78a[_0x780c('0x35')]);_0x2ab39d['attributes']=_[_0x780c('0x37')](_0x21e78a['model'],qs[_0x780c('0x48')](_0x43f08b['query'][_0x780c('0x48')]));_0x2ab39d['attributes']=_0x2ab39d[_0x780c('0x38')][_0x780c('0x39')]?_0x2ab39d[_0x780c('0x38')]:_0x21e78a[_0x780c('0x34')];_0x2ab39d[_0x780c('0x4e')]=qs[_0x780c('0x3b')](_0x43f08b[_0x780c('0x35')][_0x780c('0x3b')]);_0x2ab39d[_0x780c('0x3c')]=qs['filters'](_[_0x780c('0x3d')](_0x43f08b[_0x780c('0x35')],_0x21e78a[_0x780c('0x36')]));if(_0x43f08b[_0x780c('0x35')]['filter']){_0x2ab39d[_0x780c('0x3c')]=_[_0x780c('0x40')](_0x2ab39d['where'],{'$or':_[_0x780c('0x2f')](_0x2ab39d[_0x780c('0x38')],function(_0xfdac0c){var _0x2d0ef2={};_0x2d0ef2[_0xfdac0c]={'$like':'%'+_0x43f08b['query'][_0x780c('0x3e')]+'%'};return _0x2d0ef2;})});}_0x2ab39d=_['merge']({},_0x2ab39d,_0x43f08b['options']);return _0x53780d[_0x780c('0x4f')](_0x2ab39d);}})[_0x780c('0x28')](function(_0x18044d){if(_0x18044d){_0x4ac59f=_0x18044d['length'];if(!_0x43f08b[_0x780c('0x35')][_0x780c('0x50')](_0x780c('0x3a'))){_0x2ab39d[_0x780c('0x20')]=qs[_0x780c('0x20')](_0x43f08b['query'][_0x780c('0x20')]);_0x2ab39d[_0x780c('0x1e')]=qs[_0x780c('0x1e')](_0x43f08b[_0x780c('0x35')][_0x780c('0x1e')]);}return _0x53780d[_0x780c('0x4f')](_0x2ab39d);}})[_0x780c('0x28')](function(_0x4dfea1){if(_0x4dfea1){return _0x4dfea1?{'count':_0x4ac59f,'rows':_0x4dfea1}:null;}})[_0x780c('0x28')](respondWithResult(_0x539358,null))[_0x780c('0x46')](handleError(_0x539358,null));};exports[_0x780c('0x51')]=function(_0x1be790,_0x2cdda1,_0x29ef4d){var _0x51cfe9={};var _0x478b7e={};var _0xf562bd;var _0x74f2ef;return db['VtigerConfiguration'][_0x780c('0x4c')]({'where':{'id':_0x1be790[_0x780c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cdda1,null))['then'](function(_0x3800ca){if(_0x3800ca){_0xf562bd=_0x3800ca;_0x478b7e[_0x780c('0x34')]=_[_0x780c('0x47')](db['VtigerField']['rawAttributes']);_0x478b7e[_0x780c('0x35')]=_[_0x780c('0x47')](_0x1be790[_0x780c('0x35')]);_0x478b7e['filters']=_[_0x780c('0x37')](_0x478b7e[_0x780c('0x34')],_0x478b7e[_0x780c('0x35')]);_0x51cfe9[_0x780c('0x38')]=_['intersection'](_0x478b7e[_0x780c('0x34')],qs[_0x780c('0x48')](_0x1be790[_0x780c('0x35')][_0x780c('0x48')]));_0x51cfe9[_0x780c('0x38')]=_0x51cfe9[_0x780c('0x38')][_0x780c('0x39')]?_0x51cfe9['attributes']:_0x478b7e[_0x780c('0x34')];_0x51cfe9[_0x780c('0x4e')]=qs[_0x780c('0x3b')](_0x1be790['query'][_0x780c('0x3b')]);_0x51cfe9[_0x780c('0x3c')]=qs['filters'](_[_0x780c('0x3d')](_0x1be790[_0x780c('0x35')],_0x478b7e['filters']));if(_0x1be790[_0x780c('0x35')][_0x780c('0x3e')]){_0x51cfe9[_0x780c('0x3c')]=_[_0x780c('0x40')](_0x51cfe9[_0x780c('0x3c')],{'$or':_[_0x780c('0x2f')](_0x51cfe9[_0x780c('0x38')],function(_0x55f1b4){var _0xeab9f6={};_0xeab9f6[_0x55f1b4]={'$like':'%'+_0x1be790[_0x780c('0x35')][_0x780c('0x3e')]+'%'};return _0xeab9f6;})});}_0x51cfe9=_[_0x780c('0x40')]({},_0x51cfe9,_0x1be790[_0x780c('0x41')]);return _0xf562bd['getSubjects'](_0x51cfe9);}})['then'](function(_0x2807f7){if(_0x2807f7){_0x74f2ef=_0x2807f7[_0x780c('0x39')];if(!_0x1be790[_0x780c('0x35')][_0x780c('0x50')](_0x780c('0x3a'))){_0x51cfe9['limit']=qs[_0x780c('0x20')](_0x1be790[_0x780c('0x35')][_0x780c('0x20')]);_0x51cfe9[_0x780c('0x1e')]=qs[_0x780c('0x1e')](_0x1be790['query']['offset']);}return _0xf562bd[_0x780c('0x51')](_0x51cfe9);}})['then'](function(_0x5df7df){if(_0x5df7df){return _0x5df7df?{'count':_0x74f2ef,'rows':_0x5df7df}:null;}})[_0x780c('0x28')](respondWithResult(_0x2cdda1,null))[_0x780c('0x46')](handleError(_0x2cdda1,null));};exports[_0x780c('0x52')]=function(_0xd59d3,_0x46a589,_0x44d7b0){var _0x17bbe6={};var _0x247fd2={};var _0x583799;var _0x113cfb;return db[_0x780c('0x30')][_0x780c('0x4c')]({'where':{'id':_0xd59d3['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x46a589,null))['then'](function(_0x201392){if(_0x201392){_0x583799=_0x201392;_0x247fd2[_0x780c('0x34')]=_[_0x780c('0x47')](db[_0x780c('0x4d')][_0x780c('0x31')]);_0x247fd2[_0x780c('0x35')]=_['keys'](_0xd59d3['query']);_0x247fd2[_0x780c('0x36')]=_[_0x780c('0x37')](_0x247fd2[_0x780c('0x34')],_0x247fd2[_0x780c('0x35')]);_0x17bbe6['attributes']=_[_0x780c('0x37')](_0x247fd2['model'],qs[_0x780c('0x48')](_0xd59d3[_0x780c('0x35')][_0x780c('0x48')]));_0x17bbe6['attributes']=_0x17bbe6['attributes'][_0x780c('0x39')]?_0x17bbe6['attributes']:_0x247fd2[_0x780c('0x34')];_0x17bbe6['order']=qs[_0x780c('0x3b')](_0xd59d3[_0x780c('0x35')][_0x780c('0x3b')]);_0x17bbe6['where']=qs[_0x780c('0x36')](_[_0x780c('0x3d')](_0xd59d3[_0x780c('0x35')],_0x247fd2[_0x780c('0x36')]));if(_0xd59d3[_0x780c('0x35')]['filter']){_0x17bbe6[_0x780c('0x3c')]=_['merge'](_0x17bbe6[_0x780c('0x3c')],{'$or':_[_0x780c('0x2f')](_0x17bbe6[_0x780c('0x38')],function(_0x47c943){var _0x3e920c={};_0x3e920c[_0x47c943]={'$like':'%'+_0xd59d3[_0x780c('0x35')][_0x780c('0x3e')]+'%'};return _0x3e920c;})});}_0x17bbe6=_[_0x780c('0x40')]({},_0x17bbe6,_0xd59d3[_0x780c('0x41')]);return _0x583799[_0x780c('0x52')](_0x17bbe6);}})[_0x780c('0x28')](function(_0x398340){if(_0x398340){_0x113cfb=_0x398340[_0x780c('0x39')];if(!_0xd59d3[_0x780c('0x35')]['hasOwnProperty']('nolimit')){_0x17bbe6[_0x780c('0x20')]=qs[_0x780c('0x20')](_0xd59d3[_0x780c('0x35')][_0x780c('0x20')]);_0x17bbe6[_0x780c('0x1e')]=qs[_0x780c('0x1e')](_0xd59d3[_0x780c('0x35')][_0x780c('0x1e')]);}return _0x583799[_0x780c('0x52')](_0x17bbe6);}})[_0x780c('0x28')](function(_0x235142){if(_0x235142){return _0x235142?{'count':_0x113cfb,'rows':_0x235142}:null;}})['then'](respondWithResult(_0x46a589,null))[_0x780c('0x46')](handleError(_0x46a589,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3871f5c..88400dd 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 _0x10d8=['int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','define','VtigerConfiguration'];(function(_0x28b123,_0x318eca){var _0x43cb3b=function(_0x886352){while(--_0x886352){_0x28b123['push'](_0x28b123['shift']());}};_0x43cb3b(++_0x318eca);}(_0x10d8,0x109));var _0x810d=function(_0x9b0ba6,_0x465525){_0x9b0ba6=_0x9b0ba6-0x0;var _0x3c9944=_0x10d8[_0x9b0ba6];return _0x3c9944;};'use strict';var _=require(_0x810d('0x0'));var util=require('util');var logger=require(_0x810d('0x1'))(_0x810d('0x2'));var moment=require(_0x810d('0x3'));var BPromise=require(_0x810d('0x4'));var rp=require(_0x810d('0x5'));var fs=require('fs');var path=require(_0x810d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x810d('0x7'));module['exports']=function(_0x19e330,_0x45ba2e){return _0x19e330[_0x810d('0x8')](_0x810d('0x9'),attributes,{'tableName':_0x810d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea1f=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea1f,0x133));var _0xfea1=function(_0x5cff34,_0x218cec){_0x5cff34=_0x5cff34-0x0;var _0x22189b=_0xea1f[_0x5cff34];return _0x22189b;};'use strict';var _=require('lodash');var util=require(_0xfea1('0x0'));var logger=require('../../config/logger')(_0xfea1('0x1'));var moment=require(_0xfea1('0x2'));var BPromise=require(_0xfea1('0x3'));var rp=require(_0xfea1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfea1('0x5'));var config=require(_0xfea1('0x6'));var attributes=require(_0xfea1('0x7'));module[_0xfea1('0x8')]=function(_0x3f51dd,_0x4d2d91){return _0x3f51dd[_0xfea1('0x9')](_0xfea1('0xa'),attributes,{'tableName':_0xfea1('0xb'),'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 9cf5505..0e2afe5 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 _0x4aa3=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x1f117c,_0x4d9e48){var _0x2b1ee9=function(_0x52370b){while(--_0x52370b){_0x1f117c['push'](_0x1f117c['shift']());}};_0x2b1ee9(++_0x4d9e48);}(_0x4aa3,0x194));var _0x34aa=function(_0x26f517,_0x481fa7){_0x26f517=_0x26f517-0x0;var _0x5becaa=_0x4aa3[_0x26f517];return _0x5becaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34aa('0x0'));var BPromise=require(_0x34aa('0x1'));var rs=require(_0x34aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34aa('0x3'))['db'];var utils=require(_0x34aa('0x4'));var logger=require(_0x34aa('0x5'))(_0x34aa('0x6'));var config=require(_0x34aa('0x7'));var jayson=require(_0x34aa('0x8'));var client=jayson[_0x34aa('0x9')][_0x34aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a9d88,_0x2cb4b0,_0x16ebca){return new BPromise(function(_0x5a0386,_0x36a914){return client[_0x34aa('0xb')](_0x4a9d88,_0x16ebca)['then'](function(_0x1b8418){logger[_0x34aa('0xc')](_0x34aa('0xd'),_0x2cb4b0,_0x34aa('0xe'));logger[_0x34aa('0xf')](_0x34aa('0x10'),_0x2cb4b0,_0x34aa('0xe'),JSON[_0x34aa('0x11')](_0x1b8418));if(_0x1b8418[_0x34aa('0x12')]){if(_0x1b8418[_0x34aa('0x12')]['code']===0x1f4){logger['error'](_0x34aa('0xd'),_0x2cb4b0,_0x1b8418[_0x34aa('0x12')][_0x34aa('0x13')]);return _0x36a914(_0x1b8418['error']['message']);}logger[_0x34aa('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x2cb4b0,_0x1b8418[_0x34aa('0x12')][_0x34aa('0x13')]);return _0x5a0386(_0x1b8418[_0x34aa('0x12')][_0x34aa('0x13')]);}else{logger[_0x34aa('0xc')](_0x34aa('0xd'),_0x2cb4b0,_0x34aa('0xe'));_0x5a0386(_0x1b8418[_0x34aa('0x14')][_0x34aa('0x13')]);}})[_0x34aa('0x15')](function(_0x3651c7){logger[_0x34aa('0x12')](_0x34aa('0xd'),_0x2cb4b0,_0x3651c7);_0x36a914(_0x3651c7);});});} \ No newline at end of file +var _0x8cb4=['../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x8cb4,0xe0));var _0x48cb=function(_0x591543,_0x24d4c3){_0x591543=_0x591543-0x0;var _0x51ce9d=_0x8cb4[_0x591543];return _0x51ce9d;};'use strict';var _=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var moment=require('moment');var BPromise=require(_0x48cb('0x2'));var rs=require(_0x48cb('0x3'));var fs=require('fs');var Redis=require(_0x48cb('0x4'));var db=require(_0x48cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x48cb('0x6'))('rpc');var config=require(_0x48cb('0x7'));var jayson=require(_0x48cb('0x8'));var client=jayson[_0x48cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4be695,_0xa1d503,_0x24f71d){return new BPromise(function(_0x394554,_0x71148b){return client[_0x48cb('0xa')](_0x4be695,_0x24f71d)[_0x48cb('0xb')](function(_0x4da2a8){logger[_0x48cb('0xc')](_0x48cb('0xd'),_0xa1d503,_0x48cb('0xe'));logger['debug'](_0x48cb('0xf'),_0xa1d503,'request\x20sent',JSON[_0x48cb('0x10')](_0x4da2a8));if(_0x4da2a8[_0x48cb('0x11')]){if(_0x4da2a8['error'][_0x48cb('0x12')]===0x1f4){logger[_0x48cb('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0xa1d503,_0x4da2a8[_0x48cb('0x11')]['message']);return _0x71148b(_0x4da2a8[_0x48cb('0x11')][_0x48cb('0x13')]);}logger[_0x48cb('0x11')](_0x48cb('0xd'),_0xa1d503,_0x4da2a8[_0x48cb('0x11')]['message']);return _0x394554(_0x4da2a8['error']['message']);}else{logger['info'](_0x48cb('0xd'),_0xa1d503,_0x48cb('0xe'));_0x394554(_0x4da2a8[_0x48cb('0x14')]['message']);}})['catch'](function(_0x50d868){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xa1d503,_0x50d868);_0x71148b(_0x50d868);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b421ec7..853c709 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 _0xb97b=['index','/:id','create','put','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xb97b,0x17c));var _0xbb97=function(_0x3013c4,_0x2d9fb1){_0x3013c4=_0x3013c4-0x0;var _0x18222f=_0xb97b[_0x3013c4];return _0x18222f;};'use strict';var multer=require(_0xbb97('0x0'));var util=require(_0xbb97('0x1'));var path=require(_0xbb97('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb97('0x3'));var router=express['Router']();var fs_extra=require(_0xbb97('0x4'));var auth=require(_0xbb97('0x5'));var interaction=require(_0xbb97('0x6'));var config=require(_0xbb97('0x7'));var controller=require(_0xbb97('0x8'));router[_0xbb97('0x9')]('/',auth[_0xbb97('0xa')](),controller[_0xbb97('0xb')]);router[_0xbb97('0x9')](_0xbb97('0xc'),auth[_0xbb97('0xa')](),controller['show']);router['post']('/',auth[_0xbb97('0xa')](),controller[_0xbb97('0xd')]);router[_0xbb97('0xe')](_0xbb97('0xc'),auth[_0xbb97('0xa')](),controller['update']);router[_0xbb97('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbb97('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfc0a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','util'];(function(_0x54c48b,_0x10e53d){var _0x128f85=function(_0x152920){while(--_0x152920){_0x54c48b['push'](_0x54c48b['shift']());}};_0x128f85(++_0x10e53d);}(_0xfc0a,0x11c));var _0xafc0=function(_0x5b9252,_0x4bc2f8){_0x5b9252=_0x5b9252-0x0;var _0x1a4284=_0xfc0a[_0x5b9252];return _0x1a4284;};'use strict';var multer=require('multer');var util=require(_0xafc0('0x0'));var path=require(_0xafc0('0x1'));var timeout=require(_0xafc0('0x2'));var express=require('express');var router=express[_0xafc0('0x3')]();var fs_extra=require(_0xafc0('0x4'));var auth=require(_0xafc0('0x5'));var interaction=require(_0xafc0('0x6'));var config=require(_0xafc0('0x7'));var controller=require(_0xafc0('0x8'));router[_0xafc0('0x9')]('/',auth[_0xafc0('0xa')](),controller[_0xafc0('0xb')]);router[_0xafc0('0x9')](_0xafc0('0xc'),auth[_0xafc0('0xa')](),controller['show']);router[_0xafc0('0xd')]('/',auth[_0xafc0('0xa')](),controller[_0xafc0('0xe')]);router['put'](_0xafc0('0xc'),auth['isAuthenticated'](),controller[_0xafc0('0xf')]);router[_0xafc0('0x10')](_0xafc0('0xc'),auth[_0xafc0('0xa')](),controller[_0xafc0('0x11')]);module[_0xafc0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index f6a5cc5..c70ee13 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 _0xf62b=['variable','exports','ENUM','customVariable','keyValue','picklist','string','STRING'];(function(_0x47cca4,_0x572ff9){var _0xb67b3d=function(_0x5af401){while(--_0x5af401){_0x47cca4['push'](_0x47cca4['shift']());}};_0xb67b3d(++_0x572ff9);}(_0xf62b,0x1b1));var _0xbf62=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xf62b[_0x541a67];return _0x45da2a;};'use strict';var Sequelize=require('sequelize');module[_0xbf62('0x0')]={'type':{'type':Sequelize[_0xbf62('0x1')]('string','variable',_0xbf62('0x2'),_0xbf62('0x3'),_0xbf62('0x4')),'defaultValue':_0xbf62('0x5')},'content':{'type':Sequelize[_0xbf62('0x6')]},'key':{'type':Sequelize[_0xbf62('0x6')]},'keyType':{'type':Sequelize[_0xbf62('0x1')](_0xbf62('0x5'),_0xbf62('0x7'),_0xbf62('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf62('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa9c9=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x4abcad,_0x189889){var _0x18d9b4=function(_0x45e64d){while(--_0x45e64d){_0x4abcad['push'](_0x4abcad['shift']());}};_0x18d9b4(++_0x189889);}(_0xa9c9,0x173));var _0x9a9c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa9c9[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x9a9c('0x0'));module[_0x9a9c('0x1')]={'type':{'type':Sequelize[_0x9a9c('0x2')](_0x9a9c('0x3'),_0x9a9c('0x4'),'customVariable',_0x9a9c('0x5'),_0x9a9c('0x6')),'defaultValue':_0x9a9c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9a9c('0x7')]},'keyType':{'type':Sequelize[_0x9a9c('0x2')](_0x9a9c('0x3'),_0x9a9c('0x4'),_0x9a9c('0x8'))},'keyContent':{'type':Sequelize[_0x9a9c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9a9c('0x7')]},'customField':{'type':Sequelize[_0x9a9c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a9c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ab32497..37d7e4e 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 _0xf3cd=['include','findAll','rows','show','params','options','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll'];(function(_0x451730,_0x52bba7){var _0xa1f925=function(_0x4db048){while(--_0x4db048){_0x451730['push'](_0x451730['shift']());}};_0xa1f925(++_0x52bba7);}(_0xf3cd,0x9c));var _0xdf3c=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0xf3cd[_0x5cf1a1];return _0x52cbcc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf3c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf3c('0x1'));var rp=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var BPromise=require(_0xdf3c('0x4'));var Mustache=require(_0xdf3c('0x5'));var util=require(_0xdf3c('0x6'));var path=require(_0xdf3c('0x7'));var sox=require('sox');var csv=require(_0xdf3c('0x8'));var ejs=require(_0xdf3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf3c('0xa'));var jsforce=require(_0xdf3c('0xb'));var deskjs=require(_0xdf3c('0xc'));var toCsv=require(_0xdf3c('0x8'));var querystring=require('querystring');var Papa=require(_0xdf3c('0xd'));var Redis=require(_0xdf3c('0xe'));var authService=require(_0xdf3c('0xf'));var qs=require(_0xdf3c('0x10'));var as=require(_0xdf3c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf3c('0x12'))('api');var utils=require(_0xdf3c('0x13'));var config=require(_0xdf3c('0x14'));var licenseUtil=require(_0xdf3c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47d17d,_0x5c8019){_0x5c8019=_0x5c8019||0xcc;return function(_0x40c51f){if(_0x40c51f){return _0x47d17d[_0xdf3c('0x16')](_0x5c8019);}return _0x47d17d[_0xdf3c('0x17')](_0x5c8019)['end']();};}function respondWithResult(_0x17f885,_0x3578c0){_0x3578c0=_0x3578c0||0xc8;return function(_0x450388){if(_0x450388){return _0x17f885[_0xdf3c('0x17')](_0x3578c0)[_0xdf3c('0x18')](_0x450388);}};}function respondWithFilteredResult(_0x26440a,_0x3501bf){return function(_0xc658a7){if(_0xc658a7){var _0x287416=typeof _0x3501bf[_0xdf3c('0x19')]==='undefined'&&typeof _0x3501bf['limit']===_0xdf3c('0x1a');var _0x25727d=_0xc658a7[_0xdf3c('0x1b')];var _0x56ab09=_0x287416?0x0:_0x3501bf[_0xdf3c('0x19')];var _0x32c009=_0x287416?_0xc658a7['count']:_0x3501bf[_0xdf3c('0x19')]+_0x3501bf[_0xdf3c('0x1c')];var _0x319c2f;if(_0x32c009>=_0x25727d){_0x32c009=_0x25727d;_0x319c2f=0xc8;}else{_0x319c2f=0xce;}_0x26440a[_0xdf3c('0x17')](_0x319c2f);return _0x26440a['set']('Content-Range',_0x56ab09+'-'+_0x32c009+'/'+_0x25727d)[_0xdf3c('0x18')](_0xc658a7);}return null;};}function patchUpdates(_0xf61e88){return function(_0x42796b){try{jsonpatch[_0xdf3c('0x1d')](_0x42796b,_0xf61e88,!![]);}catch(_0x2eaab1){return BPromise['reject'](_0x2eaab1);}return _0x42796b[_0xdf3c('0x1e')]();};}function saveUpdates(_0x1121a7,_0x304c8b){return function(_0x442fb4){if(_0x442fb4){return _0x442fb4[_0xdf3c('0x1f')](_0x1121a7)[_0xdf3c('0x20')](function(_0x50d86f){return _0x50d86f;});}return null;};}function removeEntity(_0x661e1,_0x4af335){return function(_0xc67594){if(_0xc67594){return _0xc67594[_0xdf3c('0x21')]()['then'](function(){_0x661e1[_0xdf3c('0x17')](0xcc)[_0xdf3c('0x22')]();});}};}function handleEntityNotFound(_0x543c3b,_0x16fe84){return function(_0x51a265){if(!_0x51a265){_0x543c3b['sendStatus'](0x194);}return _0x51a265;};}function handleError(_0x37fa5b,_0x4f7908){_0x4f7908=_0x4f7908||0x1f4;return function(_0x4c0453){logger[_0xdf3c('0x23')](_0x4c0453[_0xdf3c('0x24')]);if(_0x4c0453[_0xdf3c('0x25')]){delete _0x4c0453[_0xdf3c('0x25')];}_0x37fa5b[_0xdf3c('0x17')](_0x4f7908)[_0xdf3c('0x26')](_0x4c0453);};}exports[_0xdf3c('0x27')]=function(_0x4966a7,_0x13dc05){var _0x4ee339={},_0x3162c5={},_0x405967={'count':0x0,'rows':[]};var _0x258e14=_[_0xdf3c('0x28')](db[_0xdf3c('0x29')][_0xdf3c('0x2a')],function(_0x469a36){return{'name':_0x469a36[_0xdf3c('0x2b')],'type':_0x469a36['type'][_0xdf3c('0x2c')]};});_0x3162c5[_0xdf3c('0x2d')]=_[_0xdf3c('0x28')](_0x258e14,_0xdf3c('0x25'));_0x3162c5['query']=_[_0xdf3c('0x2e')](_0x4966a7[_0xdf3c('0x2f')]);_0x3162c5[_0xdf3c('0x30')]=_['intersection'](_0x3162c5[_0xdf3c('0x2d')],_0x3162c5['query']);_0x4ee339[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x3162c5[_0xdf3c('0x2d')],qs[_0xdf3c('0x33')](_0x4966a7[_0xdf3c('0x2f')]['fields']));_0x4ee339[_0xdf3c('0x31')]=_0x4ee339[_0xdf3c('0x31')][_0xdf3c('0x34')]?_0x4ee339['attributes']:_0x3162c5[_0xdf3c('0x2d')];if(!_0x4966a7['query'][_0xdf3c('0x35')](_0xdf3c('0x36'))){_0x4ee339[_0xdf3c('0x1c')]=qs[_0xdf3c('0x1c')](_0x4966a7[_0xdf3c('0x2f')][_0xdf3c('0x1c')]);_0x4ee339[_0xdf3c('0x19')]=qs[_0xdf3c('0x19')](_0x4966a7[_0xdf3c('0x2f')][_0xdf3c('0x19')]);}_0x4ee339[_0xdf3c('0x37')]=qs[_0xdf3c('0x38')](_0x4966a7[_0xdf3c('0x2f')][_0xdf3c('0x38')]);_0x4ee339[_0xdf3c('0x39')]=qs['filters'](_[_0xdf3c('0x3a')](_0x4966a7[_0xdf3c('0x2f')],_0x3162c5[_0xdf3c('0x30')]),_0x258e14);if(_0x4966a7[_0xdf3c('0x2f')]['filter']){_0x4ee339[_0xdf3c('0x39')]=_['merge'](_0x4ee339[_0xdf3c('0x39')],{'$or':_['map'](_0x258e14,function(_0x369158){if(_0x369158[_0xdf3c('0x3b')]!==_0xdf3c('0x3c')){var _0x4bcb34={};_0x4bcb34[_0x369158['name']]={'$like':'%'+_0x4966a7[_0xdf3c('0x2f')]['filter']+'%'};return _0x4bcb34;}})});}_0x4ee339=_[_0xdf3c('0x3d')]({},_0x4ee339,_0x4966a7['options']);var _0x28f185={'where':_0x4ee339[_0xdf3c('0x39')]};return db[_0xdf3c('0x29')][_0xdf3c('0x1b')](_0x28f185)[_0xdf3c('0x20')](function(_0x482e0a){_0x405967[_0xdf3c('0x1b')]=_0x482e0a;if(_0x4966a7[_0xdf3c('0x2f')][_0xdf3c('0x3e')]){_0x4ee339[_0xdf3c('0x3f')]=[{'all':!![]}];}return db[_0xdf3c('0x29')][_0xdf3c('0x40')](_0x4ee339);})[_0xdf3c('0x20')](function(_0x3bd645){_0x405967[_0xdf3c('0x41')]=_0x3bd645;return _0x405967;})['then'](respondWithFilteredResult(_0x13dc05,_0x4ee339))['catch'](handleError(_0x13dc05,null));};exports[_0xdf3c('0x42')]=function(_0x5b69e3,_0x3dce7c){var _0x2d4c77={'raw':!![],'where':{'id':_0x5b69e3[_0xdf3c('0x43')]['id']}},_0x12eb9b={};_0x12eb9b[_0xdf3c('0x2d')]=_[_0xdf3c('0x2e')](db[_0xdf3c('0x29')][_0xdf3c('0x2a')]);_0x12eb9b[_0xdf3c('0x2f')]=_['keys'](_0x5b69e3[_0xdf3c('0x2f')]);_0x12eb9b['filters']=_[_0xdf3c('0x32')](_0x12eb9b[_0xdf3c('0x2d')],_0x12eb9b[_0xdf3c('0x2f')]);_0x2d4c77[_0xdf3c('0x31')]=_['intersection'](_0x12eb9b[_0xdf3c('0x2d')],qs['fields'](_0x5b69e3[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0x2d4c77[_0xdf3c('0x31')]=_0x2d4c77[_0xdf3c('0x31')][_0xdf3c('0x34')]?_0x2d4c77[_0xdf3c('0x31')]:_0x12eb9b['model'];if(_0x5b69e3['query'][_0xdf3c('0x3e')]){_0x2d4c77[_0xdf3c('0x3f')]=[{'all':!![]}];}_0x2d4c77=_['merge']({},_0x2d4c77,_0x5b69e3[_0xdf3c('0x44')]);return db['VtigerField'][_0xdf3c('0x45')](_0x2d4c77)['then'](handleEntityNotFound(_0x3dce7c,null))[_0xdf3c('0x20')](respondWithResult(_0x3dce7c,null))[_0xdf3c('0x46')](handleError(_0x3dce7c,null));};exports[_0xdf3c('0x47')]=function(_0xfdc7fe,_0xe79668){return db['VtigerField']['create'](_0xfdc7fe[_0xdf3c('0x48')],{})[_0xdf3c('0x20')](respondWithResult(_0xe79668,0xc9))[_0xdf3c('0x46')](handleError(_0xe79668,null));};exports[_0xdf3c('0x1f')]=function(_0x5d11ee,_0x216bb3){if(_0x5d11ee['body']['id']){delete _0x5d11ee[_0xdf3c('0x48')]['id'];}return db[_0xdf3c('0x29')][_0xdf3c('0x45')]({'where':{'id':_0x5d11ee['params']['id']}})[_0xdf3c('0x20')](handleEntityNotFound(_0x216bb3,null))[_0xdf3c('0x20')](saveUpdates(_0x5d11ee['body'],null))['then'](respondWithResult(_0x216bb3,null))[_0xdf3c('0x46')](handleError(_0x216bb3,null));};exports[_0xdf3c('0x21')]=function(_0x509366,_0x28d995){return db[_0xdf3c('0x29')][_0xdf3c('0x45')]({'where':{'id':_0x509366[_0xdf3c('0x43')]['id']}})['then'](handleEntityNotFound(_0x28d995,null))[_0xdf3c('0x20')](removeEntity(_0x28d995,null))[_0xdf3c('0x46')](handleError(_0x28d995,null));}; \ No newline at end of file +var _0x7092=['body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','then','end','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create'];(function(_0x394143,_0xa78ad0){var _0x4b54a1=function(_0x151bcb){while(--_0x151bcb){_0x394143['push'](_0x394143['shift']());}};_0x4b54a1(++_0xa78ad0);}(_0x7092,0x17f));var _0x2709=function(_0x1b890e,_0x2583f2){_0x1b890e=_0x1b890e-0x0;var _0x4278eb=_0x7092[_0x1b890e];return _0x4278eb;};'use strict';var emlformat=require(_0x2709('0x0'));var rimraf=require(_0x2709('0x1'));var zipdir=require(_0x2709('0x2'));var jsonpatch=require(_0x2709('0x3'));var rp=require(_0x2709('0x4'));var moment=require(_0x2709('0x5'));var BPromise=require(_0x2709('0x6'));var Mustache=require(_0x2709('0x7'));var util=require('util');var path=require(_0x2709('0x8'));var sox=require('sox');var csv=require(_0x2709('0x9'));var ejs=require(_0x2709('0xa'));var fs=require('fs');var fs_extra=require(_0x2709('0xb'));var _=require(_0x2709('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2709('0xd'));var deskjs=require(_0x2709('0xe'));var toCsv=require(_0x2709('0x9'));var querystring=require(_0x2709('0xf'));var Papa=require(_0x2709('0x10'));var Redis=require(_0x2709('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2709('0x12'));var as=require(_0x2709('0x13'));var hardwareService=require(_0x2709('0x14'));var logger=require(_0x2709('0x15'))(_0x2709('0x16'));var utils=require(_0x2709('0x17'));var config=require(_0x2709('0x18'));var licenseUtil=require(_0x2709('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e14c8,_0x294487){_0x294487=_0x294487||0xcc;return function(_0x2d72d5){if(_0x2d72d5){return _0x3e14c8[_0x2709('0x1a')](_0x294487);}return _0x3e14c8[_0x2709('0x1b')](_0x294487)['end']();};}function respondWithResult(_0x210f50,_0x365da4){_0x365da4=_0x365da4||0xc8;return function(_0x1d556e){if(_0x1d556e){return _0x210f50['status'](_0x365da4)[_0x2709('0x1c')](_0x1d556e);}};}function respondWithFilteredResult(_0x3e0cda,_0x3b9f5d){return function(_0x3f794c){if(_0x3f794c){var _0x2f870c=typeof _0x3b9f5d['offset']==='undefined'&&typeof _0x3b9f5d[_0x2709('0x1d')]===_0x2709('0x1e');var _0x45900a=_0x3f794c[_0x2709('0x1f')];var _0x3b7f9e=_0x2f870c?0x0:_0x3b9f5d[_0x2709('0x20')];var _0x26d995=_0x2f870c?_0x3f794c[_0x2709('0x1f')]:_0x3b9f5d[_0x2709('0x20')]+_0x3b9f5d[_0x2709('0x1d')];var _0x26d974;if(_0x26d995>=_0x45900a){_0x26d995=_0x45900a;_0x26d974=0xc8;}else{_0x26d974=0xce;}_0x3e0cda[_0x2709('0x1b')](_0x26d974);return _0x3e0cda[_0x2709('0x21')]('Content-Range',_0x3b7f9e+'-'+_0x26d995+'/'+_0x45900a)[_0x2709('0x1c')](_0x3f794c);}return null;};}function patchUpdates(_0x1c2a42){return function(_0x523a0e){try{jsonpatch[_0x2709('0x22')](_0x523a0e,_0x1c2a42,!![]);}catch(_0x4d01be){return BPromise[_0x2709('0x23')](_0x4d01be);}return _0x523a0e[_0x2709('0x24')]();};}function saveUpdates(_0x3b4a95,_0x67f2cb){return function(_0x1ada58){if(_0x1ada58){return _0x1ada58['update'](_0x3b4a95)[_0x2709('0x25')](function(_0x16883e){return _0x16883e;});}return null;};}function removeEntity(_0x3d49a2,_0x533ca2){return function(_0xfdd999){if(_0xfdd999){return _0xfdd999['destroy']()[_0x2709('0x25')](function(){_0x3d49a2[_0x2709('0x1b')](0xcc)[_0x2709('0x26')]();});}};}function handleEntityNotFound(_0x1305c4,_0x4742dd){return function(_0x8e8d44){if(!_0x8e8d44){_0x1305c4['sendStatus'](0x194);}return _0x8e8d44;};}function handleError(_0x17fee2,_0x1e1092){_0x1e1092=_0x1e1092||0x1f4;return function(_0x5324e4){logger[_0x2709('0x27')](_0x5324e4[_0x2709('0x28')]);if(_0x5324e4['name']){delete _0x5324e4[_0x2709('0x29')];}_0x17fee2[_0x2709('0x1b')](_0x1e1092)[_0x2709('0x2a')](_0x5324e4);};}exports[_0x2709('0x2b')]=function(_0x242303,_0x57972e){var _0x63fa0e={},_0x57770d={},_0x4053c9={'count':0x0,'rows':[]};var _0x3ab6ba=_['map'](db[_0x2709('0x2c')][_0x2709('0x2d')],function(_0xe0179){return{'name':_0xe0179[_0x2709('0x2e')],'type':_0xe0179[_0x2709('0x2f')][_0x2709('0x30')]};});_0x57770d[_0x2709('0x31')]=_[_0x2709('0x32')](_0x3ab6ba,_0x2709('0x29'));_0x57770d[_0x2709('0x33')]=_[_0x2709('0x34')](_0x242303[_0x2709('0x33')]);_0x57770d['filters']=_['intersection'](_0x57770d[_0x2709('0x31')],_0x57770d[_0x2709('0x33')]);_0x63fa0e['attributes']=_[_0x2709('0x35')](_0x57770d[_0x2709('0x31')],qs[_0x2709('0x36')](_0x242303[_0x2709('0x33')][_0x2709('0x36')]));_0x63fa0e['attributes']=_0x63fa0e[_0x2709('0x37')][_0x2709('0x38')]?_0x63fa0e[_0x2709('0x37')]:_0x57770d[_0x2709('0x31')];if(!_0x242303[_0x2709('0x33')][_0x2709('0x39')](_0x2709('0x3a'))){_0x63fa0e['limit']=qs[_0x2709('0x1d')](_0x242303[_0x2709('0x33')][_0x2709('0x1d')]);_0x63fa0e[_0x2709('0x20')]=qs[_0x2709('0x20')](_0x242303[_0x2709('0x33')][_0x2709('0x20')]);}_0x63fa0e['order']=qs['sort'](_0x242303[_0x2709('0x33')][_0x2709('0x3b')]);_0x63fa0e[_0x2709('0x3c')]=qs[_0x2709('0x3d')](_[_0x2709('0x3e')](_0x242303[_0x2709('0x33')],_0x57770d['filters']),_0x3ab6ba);if(_0x242303[_0x2709('0x33')][_0x2709('0x3f')]){_0x63fa0e['where']=_['merge'](_0x63fa0e[_0x2709('0x3c')],{'$or':_['map'](_0x3ab6ba,function(_0x477b79){if(_0x477b79[_0x2709('0x2f')]!==_0x2709('0x40')){var _0xa61e7b={};_0xa61e7b[_0x477b79[_0x2709('0x29')]]={'$like':'%'+_0x242303[_0x2709('0x33')]['filter']+'%'};return _0xa61e7b;}})});}_0x63fa0e=_['merge']({},_0x63fa0e,_0x242303[_0x2709('0x41')]);var _0x52ab82={'where':_0x63fa0e['where']};return db['VtigerField'][_0x2709('0x1f')](_0x52ab82)[_0x2709('0x25')](function(_0x3a56f0){_0x4053c9[_0x2709('0x1f')]=_0x3a56f0;if(_0x242303[_0x2709('0x33')][_0x2709('0x42')]){_0x63fa0e['include']=[{'all':!![]}];}return db[_0x2709('0x2c')][_0x2709('0x43')](_0x63fa0e);})['then'](function(_0x5662cb){_0x4053c9['rows']=_0x5662cb;return _0x4053c9;})[_0x2709('0x25')](respondWithFilteredResult(_0x57972e,_0x63fa0e))[_0x2709('0x44')](handleError(_0x57972e,null));};exports[_0x2709('0x45')]=function(_0x5d42f5,_0x292ca0){var _0x38d117={'raw':!![],'where':{'id':_0x5d42f5[_0x2709('0x46')]['id']}},_0x1f0737={};_0x1f0737[_0x2709('0x31')]=_['keys'](db[_0x2709('0x2c')][_0x2709('0x2d')]);_0x1f0737[_0x2709('0x33')]=_[_0x2709('0x34')](_0x5d42f5[_0x2709('0x33')]);_0x1f0737[_0x2709('0x3d')]=_[_0x2709('0x35')](_0x1f0737['model'],_0x1f0737[_0x2709('0x33')]);_0x38d117[_0x2709('0x37')]=_[_0x2709('0x35')](_0x1f0737[_0x2709('0x31')],qs['fields'](_0x5d42f5['query'][_0x2709('0x36')]));_0x38d117['attributes']=_0x38d117[_0x2709('0x37')][_0x2709('0x38')]?_0x38d117['attributes']:_0x1f0737[_0x2709('0x31')];if(_0x5d42f5['query']['includeAll']){_0x38d117['include']=[{'all':!![]}];}_0x38d117=_['merge']({},_0x38d117,_0x5d42f5[_0x2709('0x41')]);return db[_0x2709('0x2c')][_0x2709('0x47')](_0x38d117)[_0x2709('0x25')](handleEntityNotFound(_0x292ca0,null))[_0x2709('0x25')](respondWithResult(_0x292ca0,null))[_0x2709('0x44')](handleError(_0x292ca0,null));};exports[_0x2709('0x48')]=function(_0xa9858a,_0x17b620){return db[_0x2709('0x2c')]['create'](_0xa9858a[_0x2709('0x49')],{})[_0x2709('0x25')](respondWithResult(_0x17b620,0xc9))[_0x2709('0x44')](handleError(_0x17b620,null));};exports[_0x2709('0x4a')]=function(_0x1d96ca,_0x45fb0d){if(_0x1d96ca['body']['id']){delete _0x1d96ca[_0x2709('0x49')]['id'];}return db['VtigerField'][_0x2709('0x47')]({'where':{'id':_0x1d96ca[_0x2709('0x46')]['id']}})['then'](handleEntityNotFound(_0x45fb0d,null))[_0x2709('0x25')](saveUpdates(_0x1d96ca[_0x2709('0x49')],null))[_0x2709('0x25')](respondWithResult(_0x45fb0d,null))[_0x2709('0x44')](handleError(_0x45fb0d,null));};exports[_0x2709('0x4b')]=function(_0x760738,_0x2e5aa4){return db[_0x2709('0x2c')][_0x2709('0x47')]({'where':{'id':_0x760738[_0x2709('0x46')]['id']}})[_0x2709('0x25')](handleEntityNotFound(_0x2e5aa4,null))[_0x2709('0x25')](removeEntity(_0x2e5aa4,null))[_0x2709('0x44')](handleError(_0x2e5aa4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 1de1fda..ab8ac88 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 _0xbf00=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash'];(function(_0x16d903,_0x2e4805){var _0x5c4861=function(_0x24ee56){while(--_0x24ee56){_0x16d903['push'](_0x16d903['shift']());}};_0x5c4861(++_0x2e4805);}(_0xbf00,0x1cd));var _0x0bf0=function(_0x55d408,_0x25416e){_0x55d408=_0x55d408-0x0;var _0x46fec2=_0xbf00[_0x55d408];return _0x46fec2;};'use strict';var _=require(_0x0bf0('0x0'));var util=require(_0x0bf0('0x1'));var logger=require(_0x0bf0('0x2'))(_0x0bf0('0x3'));var moment=require(_0x0bf0('0x4'));var BPromise=require(_0x0bf0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bf0('0x6'));var attributes=require(_0x0bf0('0x7'));module[_0x0bf0('0x8')]=function(_0x323b25,_0x542e3c){return _0x323b25[_0x0bf0('0x9')](_0x0bf0('0xa'),attributes,{'tableName':_0x0bf0('0xb'),'paranoid':![],'indexes':[{'name':_0x0bf0('0xc'),'fields':[_0x0bf0('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x761a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x1565b2,_0x3e001a){var _0x38337b=function(_0x4589c5){while(--_0x4589c5){_0x1565b2['push'](_0x1565b2['shift']());}};_0x38337b(++_0x3e001a);}(_0x761a,0x1d0));var _0xa761=function(_0x4220e0,_0x38bffd){_0x4220e0=_0x4220e0-0x0;var _0x12e0e4=_0x761a[_0x4220e0];return _0x12e0e4;};'use strict';var _=require(_0xa761('0x0'));var util=require(_0xa761('0x1'));var logger=require(_0xa761('0x2'))(_0xa761('0x3'));var moment=require(_0xa761('0x4'));var BPromise=require(_0xa761('0x5'));var rp=require(_0xa761('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa761('0x7'));var config=require(_0xa761('0x8'));var attributes=require(_0xa761('0x9'));module[_0xa761('0xa')]=function(_0x3bbf9d,_0x5b5cc2){return _0x3bbf9d[_0xa761('0xb')](_0xa761('0xc'),attributes,{'tableName':_0xa761('0xd'),'paranoid':![],'indexes':[{'name':_0xa761('0xe'),'fields':[_0xa761('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 32090d5..4e67460 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 _0x7122=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x5545e4,_0x2026bf){var _0x2f57ac=function(_0x14004e){while(--_0x14004e){_0x5545e4['push'](_0x5545e4['shift']());}};_0x2f57ac(++_0x2026bf);}(_0x7122,0x1a5));var _0x2712=function(_0x39688d,_0x4d8886){_0x39688d=_0x39688d-0x0;var _0x290979=_0x7122[_0x39688d];return _0x290979;};'use strict';var _=require(_0x2712('0x0'));var util=require(_0x2712('0x1'));var moment=require(_0x2712('0x2'));var BPromise=require(_0x2712('0x3'));var rs=require(_0x2712('0x4'));var fs=require('fs');var Redis=require(_0x2712('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2712('0x6'));var logger=require(_0x2712('0x7'))(_0x2712('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2712('0x9')][_0x2712('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b4d5,_0x29a0e2,_0x1b2ebe){return new BPromise(function(_0x2db468,_0x504986){return client[_0x2712('0xb')](_0x36b4d5,_0x1b2ebe)[_0x2712('0xc')](function(_0x5079b2){logger[_0x2712('0xd')](_0x2712('0xe'),_0x29a0e2,_0x2712('0xf'));logger[_0x2712('0x10')](_0x2712('0x11'),_0x29a0e2,_0x2712('0xf'),JSON[_0x2712('0x12')](_0x5079b2));if(_0x5079b2[_0x2712('0x13')]){if(_0x5079b2[_0x2712('0x13')]['code']===0x1f4){logger[_0x2712('0x13')](_0x2712('0xe'),_0x29a0e2,_0x5079b2['error'][_0x2712('0x14')]);return _0x504986(_0x5079b2['error']['message']);}logger[_0x2712('0x13')](_0x2712('0xe'),_0x29a0e2,_0x5079b2['error'][_0x2712('0x14')]);return _0x2db468(_0x5079b2[_0x2712('0x13')][_0x2712('0x14')]);}else{logger[_0x2712('0xd')](_0x2712('0xe'),_0x29a0e2,_0x2712('0xf'));_0x2db468(_0x5079b2[_0x2712('0x15')][_0x2712('0x14')]);}})[_0x2712('0x16')](function(_0x1a285f){logger[_0x2712('0x13')](_0x2712('0xe'),_0x29a0e2,_0x1a285f);_0x504986(_0x1a285f);});});} \ No newline at end of file +var _0x8a63=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x8a63,0x1dd));var _0x38a6=function(_0x421a99,_0x239c08){_0x421a99=_0x421a99-0x0;var _0x16a86c=_0x8a63[_0x421a99];return _0x16a86c;};'use strict';var _=require(_0x38a6('0x0'));var util=require('util');var moment=require(_0x38a6('0x1'));var BPromise=require(_0x38a6('0x2'));var rs=require(_0x38a6('0x3'));var fs=require('fs');var Redis=require(_0x38a6('0x4'));var db=require(_0x38a6('0x5'))['db'];var utils=require(_0x38a6('0x6'));var logger=require('../../config/logger')(_0x38a6('0x7'));var config=require(_0x38a6('0x8'));var jayson=require(_0x38a6('0x9'));var client=jayson[_0x38a6('0xa')][_0x38a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226537,_0x2d4664,_0x55152d){return new BPromise(function(_0x2e8d68,_0x487237){return client['request'](_0x226537,_0x55152d)[_0x38a6('0xc')](function(_0x3f9083){logger[_0x38a6('0xd')](_0x38a6('0xe'),_0x2d4664,_0x38a6('0xf'));logger[_0x38a6('0x10')](_0x38a6('0x11'),_0x2d4664,_0x38a6('0xf'),JSON[_0x38a6('0x12')](_0x3f9083));if(_0x3f9083[_0x38a6('0x13')]){if(_0x3f9083[_0x38a6('0x13')][_0x38a6('0x14')]===0x1f4){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083[_0x38a6('0x13')][_0x38a6('0x15')]);return _0x487237(_0x3f9083['error'][_0x38a6('0x15')]);}logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083['error'][_0x38a6('0x15')]);return _0x2e8d68(_0x3f9083['error']['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x2d4664,_0x38a6('0xf'));_0x2e8d68(_0x3f9083['result'][_0x38a6('0x15')]);}})[_0x38a6('0x16')](function(_0x22b8c9){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x22b8c9);_0x487237(_0x22b8c9);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5fe5944..3e7723e 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 _0x59a1=['delete','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','addConfiguration','put'];(function(_0x21b254,_0x28c55b){var _0xa52d8c=function(_0x4f0a70){while(--_0x4f0a70){_0x21b254['push'](_0x21b254['shift']());}};_0xa52d8c(++_0x28c55b);}(_0x59a1,0xb7));var _0x159a=function(_0x45c0aa,_0x76ec58){_0x45c0aa=_0x45c0aa-0x0;var _0x2176dc=_0x59a1[_0x45c0aa];return _0x2176dc;};'use strict';var multer=require(_0x159a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x159a('0x1'));var express=require(_0x159a('0x2'));var router=express[_0x159a('0x3')]();var fs_extra=require(_0x159a('0x4'));var auth=require(_0x159a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x159a('0x6'));var controller=require(_0x159a('0x7'));router[_0x159a('0x8')]('/',auth[_0x159a('0x9')](),controller[_0x159a('0xa')]);router[_0x159a('0x8')]('/:id',auth[_0x159a('0x9')](),controller[_0x159a('0xb')]);router['get'](_0x159a('0xc'),auth[_0x159a('0x9')](),controller[_0x159a('0xd')]);router[_0x159a('0x8')]('/:id/fields',auth[_0x159a('0x9')](),controller['getFields']);router[_0x159a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x159a('0xe')](_0x159a('0xc'),auth['isAuthenticated'](),controller[_0x159a('0xf')]);router[_0x159a('0x10')]('/:id',auth[_0x159a('0x9')](),controller['update']);router[_0x159a('0x11')](_0x159a('0x12'),auth[_0x159a('0x9')](),controller[_0x159a('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc3fd=['delete','/:id','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update'];(function(_0x2b1615,_0x4c725f){var _0x518e67=function(_0x53aae5){while(--_0x53aae5){_0x2b1615['push'](_0x2b1615['shift']());}};_0x518e67(++_0x4c725f);}(_0xc3fd,0x1a2));var _0xdc3f=function(_0x5143dc,_0x366517){_0x5143dc=_0x5143dc-0x0;var _0xa78b09=_0xc3fd[_0x5143dc];return _0xa78b09;};'use strict';var multer=require(_0xdc3f('0x0'));var util=require('util');var path=require(_0xdc3f('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc3f('0x2'));var router=express[_0xdc3f('0x3')]();var fs_extra=require(_0xdc3f('0x4'));var auth=require(_0xdc3f('0x5'));var interaction=require(_0xdc3f('0x6'));var config=require(_0xdc3f('0x7'));var controller=require('./intZendeskAccount.controller');router[_0xdc3f('0x8')]('/',auth[_0xdc3f('0x9')](),controller['index']);router[_0xdc3f('0x8')]('/:id',auth[_0xdc3f('0x9')](),controller['show']);router[_0xdc3f('0x8')](_0xdc3f('0xa'),auth[_0xdc3f('0x9')](),controller[_0xdc3f('0xb')]);router[_0xdc3f('0x8')](_0xdc3f('0xc'),auth[_0xdc3f('0x9')](),controller[_0xdc3f('0xd')]);router['post']('/',auth[_0xdc3f('0x9')](),controller[_0xdc3f('0xe')]);router[_0xdc3f('0xf')]('/:id/configurations',auth[_0xdc3f('0x9')](),controller[_0xdc3f('0x10')]);router[_0xdc3f('0x11')]('/:id',auth[_0xdc3f('0x9')](),controller[_0xdc3f('0x12')]);router[_0xdc3f('0x13')](_0xdc3f('0x14'),auth['isAuthenticated'](),controller[_0xdc3f('0x15')]);module[_0xdc3f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c1238f4..66d4016 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 _0x9ab8=['token','integrationTab','newTab','sequelize','exports','STRING','username','ENUM','password'];(function(_0xb7cfef,_0x41d481){var _0x3912b6=function(_0x32b7a4){while(--_0x32b7a4){_0xb7cfef['push'](_0xb7cfef['shift']());}};_0x3912b6(++_0x41d481);}(_0x9ab8,0x81));var _0x89ab=function(_0x3e4535,_0x3e8f58){_0x3e4535=_0x3e4535-0x0;var _0x5c054b=_0x9ab8[_0x3e4535];return _0x5c054b;};'use strict';var Sequelize=require(_0x89ab('0x0'));module[_0x89ab('0x1')]={'name':{'type':Sequelize[_0x89ab('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x89ab('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x89ab('0x2')]},'remoteUri':{'type':Sequelize[_0x89ab('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x89ab('0x4')](_0x89ab('0x5'),_0x89ab('0x6')),'defaultValue':_0x89ab('0x5')},'serverUrl':{'type':Sequelize[_0x89ab('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x89ab('0x4')](_0x89ab('0x7'),_0x89ab('0x8')),'defaultValue':_0x89ab('0x7')}}; \ No newline at end of file +var _0xa24d=['integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','password'];(function(_0x38aafa,_0x6453a7){var _0x31beb2=function(_0x44e025){while(--_0x44e025){_0x38aafa['push'](_0x38aafa['shift']());}};_0x31beb2(++_0x6453a7);}(_0xa24d,0x1c1));var _0xda24=function(_0x237418,_0x56e144){_0x237418=_0x237418-0x0;var _0x22393e=_0xa24d[_0x237418];return _0x22393e;};'use strict';var Sequelize=require(_0xda24('0x0'));module[_0xda24('0x1')]={'name':{'type':Sequelize[_0xda24('0x2')]},'description':{'type':Sequelize[_0xda24('0x2')]},'username':{'type':Sequelize[_0xda24('0x2')],'unique':_0xda24('0x3')},'password':{'type':Sequelize[_0xda24('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xda24('0x2')],'unique':_0xda24('0x4')},'authType':{'type':Sequelize[_0xda24('0x5')](_0xda24('0x6'),'token'),'defaultValue':_0xda24('0x6')},'serverUrl':{'type':Sequelize[_0xda24('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xda24('0x7'),'newTab'),'defaultValue':_0xda24('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a2346dd..69fdd68 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 _0xefda=['getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','stringify','send','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','channel','type','Descriptions'];(function(_0x561049,_0x330926){var _0x52f109=function(_0x1a5d24){while(--_0x1a5d24){_0x561049['push'](_0x561049['shift']());}};_0x52f109(++_0x330926);}(_0xefda,0x96));var _0xaefd=function(_0x4a0ba2,_0x3bd15){_0x4a0ba2=_0x4a0ba2-0x0;var _0x3258d5=_0xefda[_0x4a0ba2];return _0x3258d5;};'use strict';var emlformat=require(_0xaefd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaefd('0x1'));var rp=require(_0xaefd('0x2'));var moment=require('moment');var BPromise=require(_0xaefd('0x3'));var Mustache=require(_0xaefd('0x4'));var util=require(_0xaefd('0x5'));var path=require(_0xaefd('0x6'));var sox=require(_0xaefd('0x7'));var csv=require(_0xaefd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefd('0x9'));var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0x8'));var querystring=require(_0xaefd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0xf'));var as=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var licenseUtil=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];var integrations=require(_0xaefd('0x18'));function respondWithStatusCode(_0x2a310c,_0x4b2b5c){_0x4b2b5c=_0x4b2b5c||0xcc;return function(_0x3172d3){if(_0x3172d3){return _0x2a310c['sendStatus'](_0x4b2b5c);}return _0x2a310c[_0xaefd('0x19')](_0x4b2b5c)[_0xaefd('0x1a')]();};}function respondWithResult(_0x9dfdf6,_0x43b82a){_0x43b82a=_0x43b82a||0xc8;return function(_0x4ec92a){if(_0x4ec92a){return _0x9dfdf6[_0xaefd('0x19')](_0x43b82a)[_0xaefd('0x1b')](_0x4ec92a);}};}function respondWithFilteredResult(_0x41f345,_0x411701){return function(_0x10ee28){if(_0x10ee28){var _0x32f75e=typeof _0x411701[_0xaefd('0x1c')]===_0xaefd('0x1d')&&typeof _0x411701['limit']===_0xaefd('0x1d');var _0x109604=_0x10ee28[_0xaefd('0x1e')];var _0x1737a1=_0x32f75e?0x0:_0x411701[_0xaefd('0x1c')];var _0x244956=_0x32f75e?_0x10ee28['count']:_0x411701[_0xaefd('0x1c')]+_0x411701[_0xaefd('0x1f')];var _0x24f131;if(_0x244956>=_0x109604){_0x244956=_0x109604;_0x24f131=0xc8;}else{_0x24f131=0xce;}_0x41f345[_0xaefd('0x19')](_0x24f131);return _0x41f345[_0xaefd('0x20')](_0xaefd('0x21'),_0x1737a1+'-'+_0x244956+'/'+_0x109604)['json'](_0x10ee28);}return null;};}function patchUpdates(_0x463d48){return function(_0x18e71c){try{jsonpatch[_0xaefd('0x22')](_0x18e71c,_0x463d48,!![]);}catch(_0x3d9823){return BPromise[_0xaefd('0x23')](_0x3d9823);}return _0x18e71c['save']();};}function saveUpdates(_0x479486,_0x5b9967){return function(_0x21680a){if(_0x21680a){return _0x21680a[_0xaefd('0x24')](_0x479486)[_0xaefd('0x25')](function(_0x5a44ed){return _0x5a44ed;});}return null;};}function removeEntity(_0x23060f,_0x4cd9b2){return function(_0x3deec8){if(_0x3deec8){return _0x3deec8[_0xaefd('0x26')]()[_0xaefd('0x25')](function(){_0x23060f['status'](0xcc)[_0xaefd('0x1a')]();});}};}function handleEntityNotFound(_0x3ffc9c,_0x18e720){return function(_0x14cc9d){if(!_0x14cc9d){_0x3ffc9c[_0xaefd('0x27')](0x194);}return _0x14cc9d;};}function handleError(_0x5a170c,_0x2fe27e){_0x2fe27e=_0x2fe27e||0x1f4;return function(_0x58c008){logger[_0xaefd('0x28')](_0x58c008[_0xaefd('0x29')]);if(_0x58c008['name']){delete _0x58c008[_0xaefd('0x2a')];}_0x5a170c[_0xaefd('0x19')](_0x2fe27e)['send'](_0x58c008);};}exports[_0xaefd('0x2b')]=function(_0x114ec0,_0x36b6b7){var _0x4c0898={},_0x45f0e8={},_0x5c573b={'count':0x0,'rows':[]};var _0x109e19=_['map'](db['ZendeskAccount'][_0xaefd('0x2c')],function(_0x1b470c){return{'name':_0x1b470c['fieldName'],'type':_0x1b470c['type']['key']};});_0x45f0e8[_0xaefd('0x2d')]=_[_0xaefd('0x2e')](_0x109e19,'name');_0x45f0e8['query']=_[_0xaefd('0x2f')](_0x114ec0[_0xaefd('0x30')]);_0x45f0e8[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x45f0e8['model'],_0x45f0e8[_0xaefd('0x30')]);_0x4c0898[_0xaefd('0x33')]=_[_0xaefd('0x32')](_0x45f0e8[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x34')]));_0x4c0898[_0xaefd('0x33')]=_0x4c0898[_0xaefd('0x33')][_0xaefd('0x35')]?_0x4c0898[_0xaefd('0x33')]:_0x45f0e8[_0xaefd('0x2d')];if(!_0x114ec0[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4c0898[_0xaefd('0x1f')]=qs['limit'](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4c0898[_0xaefd('0x1c')]=qs['offset'](_0x114ec0[_0xaefd('0x30')]['offset']);}_0x4c0898[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x39')]);_0x4c0898[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x114ec0[_0xaefd('0x30')],_0x45f0e8[_0xaefd('0x31')]),_0x109e19);if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4c0898[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4c0898[_0xaefd('0x3a')],{'$or':_['map'](_0x109e19,function(_0x1cfd6d){if(_0x1cfd6d['type']!==_0xaefd('0x3e')){var _0x6562={};_0x6562[_0x1cfd6d[_0xaefd('0x2a')]]={'$like':'%'+_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x6562;}})});}_0x4c0898=_[_0xaefd('0x3d')]({},_0x4c0898,_0x114ec0[_0xaefd('0x3f')]);var _0x145e9e={'where':_0x4c0898[_0xaefd('0x3a')]};return db[_0xaefd('0x40')]['count'](_0x145e9e)[_0xaefd('0x25')](function(_0x3296ac){_0x5c573b['count']=_0x3296ac;if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x41')]){_0x4c0898[_0xaefd('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x4c0898);})[_0xaefd('0x25')](function(_0x3d0abf){_0x5c573b[_0xaefd('0x43')]=_0x3d0abf;return _0x5c573b;})[_0xaefd('0x25')](respondWithFilteredResult(_0x36b6b7,_0x4c0898))[_0xaefd('0x44')](handleError(_0x36b6b7,null));};exports[_0xaefd('0x45')]=function(_0x2e17b5,_0x2e98aa){var _0x48a7af={'raw':![],'where':{'id':_0x2e17b5[_0xaefd('0x46')]['id']}},_0x26587e={};_0x26587e[_0xaefd('0x2d')]=_[_0xaefd('0x2f')](db[_0xaefd('0x40')][_0xaefd('0x2c')]);_0x26587e[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x2e17b5['query']);_0x26587e['filters']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],_0x26587e['query']);_0x48a7af['attributes']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x34')]));_0x48a7af[_0xaefd('0x33')]=_0x48a7af[_0xaefd('0x33')][_0xaefd('0x35')]?_0x48a7af[_0xaefd('0x33')]:_0x26587e['model'];if(_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x41')]){_0x48a7af[_0xaefd('0x42')]=[{'all':!![]}];}_0x48a7af=_[_0xaefd('0x3d')]({},_0x48a7af,_0x2e17b5[_0xaefd('0x3f')]);return db[_0xaefd('0x40')][_0xaefd('0x47')](_0x48a7af)['then'](handleEntityNotFound(_0x2e98aa,null))[_0xaefd('0x25')](respondWithResult(_0x2e98aa,null))['catch'](handleError(_0x2e98aa,null));};exports[_0xaefd('0x48')]=function(_0x374845,_0x16c664){return db[_0xaefd('0x40')]['create'](_0x374845['body'],{})[_0xaefd('0x25')](respondWithResult(_0x16c664,0xc9))[_0xaefd('0x44')](handleError(_0x16c664,null));};exports[_0xaefd('0x24')]=function(_0x4eeb56,_0x2a836a){if(_0x4eeb56[_0xaefd('0x49')]['id']){delete _0x4eeb56['body']['id'];}return db[_0xaefd('0x40')][_0xaefd('0x47')]({'where':{'id':_0x4eeb56[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x2a836a,null))[_0xaefd('0x25')](saveUpdates(_0x4eeb56[_0xaefd('0x49')],null))[_0xaefd('0x25')](respondWithResult(_0x2a836a,null))[_0xaefd('0x44')](handleError(_0x2a836a,null));};exports['destroy']=function(_0x567ceb,_0x1406b8){return db[_0xaefd('0x40')]['find']({'where':{'id':_0x567ceb[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x1406b8,null))[_0xaefd('0x25')](removeEntity(_0x1406b8,null))[_0xaefd('0x44')](handleError(_0x1406b8,null));};exports[_0xaefd('0x4a')]=function(_0x69185e,_0x27fd3f,_0xf727cd){var _0x4b709a={};var _0x56e180={};var _0x1fd0b0;var _0x338823;return db['ZendeskAccount'][_0xaefd('0x4b')]({'where':{'id':_0x69185e[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x27fd3f,null))[_0xaefd('0x25')](function(_0x4a883b){if(_0x4a883b){_0x1fd0b0=_0x4a883b;_0x56e180['model']=_[_0xaefd('0x2f')](db[_0xaefd('0x4c')][_0xaefd('0x2c')]);_0x56e180[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x69185e['query']);_0x56e180[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x56e180['model'],_0x56e180[_0xaefd('0x30')]);_0x4b709a[_0xaefd('0x33')]=_['intersection'](_0x56e180[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x69185e[_0xaefd('0x30')]['fields']));_0x4b709a[_0xaefd('0x33')]=_0x4b709a[_0xaefd('0x33')]['length']?_0x4b709a[_0xaefd('0x33')]:_0x56e180[_0xaefd('0x2d')];_0x4b709a[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x69185e['query']['sort']);_0x4b709a[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x69185e[_0xaefd('0x30')],_0x56e180[_0xaefd('0x31')]));if(_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4b709a[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4b709a[_0xaefd('0x3a')],{'$or':_['map'](_0x4b709a['attributes'],function(_0x324eb4){var _0x431c1a={};_0x431c1a[_0x324eb4]={'$like':'%'+_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x431c1a;})});}_0x4b709a=_['merge']({},_0x4b709a,_0x69185e[_0xaefd('0x3f')]);return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x1ad04e){if(_0x1ad04e){_0x338823=_0x1ad04e[_0xaefd('0x35')];if(!_0x69185e[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4b709a['limit']=qs[_0xaefd('0x1f')](_0x69185e[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4b709a[_0xaefd('0x1c')]=qs['offset'](_0x69185e[_0xaefd('0x30')]['offset']);}return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x516913){if(_0x516913){return _0x516913?{'count':_0x338823,'rows':_0x516913}:null;}})['then'](respondWithResult(_0x27fd3f,null))[_0xaefd('0x44')](handleError(_0x27fd3f,null));};exports['addConfiguration']=function(_0x5e0068,_0x4e75bc,_0xe2397c){if(_0x5e0068[_0xaefd('0x49')]['id']){delete _0x5e0068[_0xaefd('0x49')]['id'];}return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x5e0068[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e75bc,null))['then'](function(_0x4f8e16){if(_0x4f8e16){_0x5e0068['body'][_0xaefd('0x4d')]=_0x4f8e16['id'];_0x5e0068['body'][_0xaefd('0x4e')]=integrations['getSubjects'](_0x5e0068[_0xaefd('0x49')][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);_0x5e0068[_0xaefd('0x49')][_0xaefd('0x51')]=integrations[_0xaefd('0x52')](_0x5e0068['body'][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);return db[_0xaefd('0x4c')]['create'](_0x5e0068[_0xaefd('0x49')],{'include':[{'model':db['ZendeskField'],'as':_0xaefd('0x4e')},{'model':db[_0xaefd('0x53')],'as':_0xaefd('0x51')}]});}return null;})[_0xaefd('0x25')](respondWithResult(_0x4e75bc,null))[_0xaefd('0x44')](handleError(_0x4e75bc,null));};exports[_0xaefd('0x54')]=function(_0x57776e,_0x1a6195,_0x3b39db){var _0x4a9fa5='';return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x57776e['params']['id']},'attributes':['id',_0xaefd('0x55'),_0xaefd('0x56'),_0xaefd('0x57'),_0xaefd('0x58'),_0xaefd('0x59')]})[_0xaefd('0x25')](handleEntityNotFound(_0x1a6195,null))[_0xaefd('0x25')](function(_0x6f99b0){if(_0x6f99b0){_0x4a9fa5=_0x6f99b0[_0xaefd('0x59')];var _0x1ec9be=_0x4a9fa5[_0xaefd('0x5a')](-0x1);if(_0x1ec9be==='/'){_0x4a9fa5=_0x4a9fa5[_0xaefd('0x5b')](0x0,_0x4a9fa5[_0xaefd('0x5c')](_0x1ec9be));}var _0x43338b={'method':_0xaefd('0x5d'),'uri':util[_0xaefd('0x5e')](_0xaefd('0x5f'),_0x4a9fa5,'ticket_fields'),'json':!![]};switch(_0x6f99b0[_0xaefd('0x58')]){case _0xaefd('0x56'):_0x43338b[_0xaefd('0x60')]={'Authorization':util['format'](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')](_0xaefd('0x62'),_0x6f99b0[_0xaefd('0x55')],_0x6f99b0['password']))[_0xaefd('0x63')]('base64'))};break;case _0xaefd('0x57'):_0x43338b['headers']={'Authorization':util[_0xaefd('0x5e')](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')]('%s/token:%s',_0x6f99b0['username'],_0x6f99b0[_0xaefd('0x57')]))[_0xaefd('0x63')](_0xaefd('0x64')))};break;default:throw new db[(_0xaefd('0x65'))][(_0xaefd('0x66'))](_0xaefd('0x67'));}return rp(_0x43338b);}})['then'](function(_0x499d7d){if(_0x499d7d){var _0x58c97c=['subject','description',_0xaefd('0x68'),_0xaefd('0x69')];_[_0xaefd('0x6a')](_0x499d7d[_0xaefd('0x6b')],function(_0x5ae635){return _0x58c97c[_0xaefd('0x6c')](_0x5ae635[_0xaefd('0x50')]);});return{'count':_0x499d7d['ticket_fields'][_0xaefd('0x35')],'rows':_['map'](_0x499d7d[_0xaefd('0x6b')],function(_0x51b6f1){return{'id':_0x51b6f1['id'],'name':_0x51b6f1[_0xaefd('0x6d')]>0x7?_0x51b6f1['title']:_0x51b6f1[_0xaefd('0x50')],'custom':_0x51b6f1['position']>0x7?!![]:![],'options':_0x51b6f1[_0xaefd('0x6e')]?_0x51b6f1[_0xaefd('0x6e')]:_0x51b6f1['custom_field_options']?_0x51b6f1[_0xaefd('0x6f')]:[]};})};}})[_0xaefd('0x25')](respondWithResult(_0x1a6195,null))[_0xaefd('0x44')](function(_0x564c89){var _0x42c55c=_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?0x1f4:_0x564c89[_0xaefd('0x71')]||0x1f4;logger[_0xaefd('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xaefd('0x54'),_0x42c55c,JSON[_0xaefd('0x72')](_0x564c89));delete _0x564c89['name'];if(_0x42c55c===0x191){_0x42c55c=0x190;}_0x1a6195[_0xaefd('0x19')](_0x42c55c)[_0xaefd('0x73')](_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x564c89[_0xaefd('0x71')]}:_0x564c89);});}; \ No newline at end of file +var _0x6324=['error','name','send','index','ZendeskAccount','key','model','map','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','assignee','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x372d04,_0x101ca8){var _0x147534=function(_0x4815cd){while(--_0x4815cd){_0x372d04['push'](_0x372d04['shift']());}};_0x147534(++_0x101ca8);}(_0x6324,0x142));var _0x4632=function(_0x43e11f,_0x196da0){_0x43e11f=_0x43e11f-0x0;var _0x3c9208=_0x6324[_0x43e11f];return _0x3c9208;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4632('0x18'));function respondWithStatusCode(_0x499d88,_0x4719f7){_0x4719f7=_0x4719f7||0xcc;return function(_0x299073){if(_0x299073){return _0x499d88[_0x4632('0x19')](_0x4719f7);}return _0x499d88[_0x4632('0x1a')](_0x4719f7)['end']();};}function respondWithResult(_0x3ba361,_0x255882){_0x255882=_0x255882||0xc8;return function(_0x3b9901){if(_0x3b9901){return _0x3ba361[_0x4632('0x1a')](_0x255882)[_0x4632('0x1b')](_0x3b9901);}};}function respondWithFilteredResult(_0x5438ab,_0x47b349){return function(_0x2fd7ae){if(_0x2fd7ae){var _0x38bedd=typeof _0x47b349[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x47b349['limit']===_0x4632('0x1d');var _0x113872=_0x2fd7ae[_0x4632('0x1e')];var _0x5b28b7=_0x38bedd?0x0:_0x47b349[_0x4632('0x1c')];var _0x1894bb=_0x38bedd?_0x2fd7ae['count']:_0x47b349['offset']+_0x47b349[_0x4632('0x1f')];var _0x3cf2bd;if(_0x1894bb>=_0x113872){_0x1894bb=_0x113872;_0x3cf2bd=0xc8;}else{_0x3cf2bd=0xce;}_0x5438ab[_0x4632('0x1a')](_0x3cf2bd);return _0x5438ab[_0x4632('0x20')](_0x4632('0x21'),_0x5b28b7+'-'+_0x1894bb+'/'+_0x113872)[_0x4632('0x1b')](_0x2fd7ae);}return null;};}function patchUpdates(_0x9ab826){return function(_0x468ccb){try{jsonpatch[_0x4632('0x22')](_0x468ccb,_0x9ab826,!![]);}catch(_0x3ea0d1){return BPromise[_0x4632('0x23')](_0x3ea0d1);}return _0x468ccb[_0x4632('0x24')]();};}function saveUpdates(_0x2ca6a5,_0x263907){return function(_0x4cfebc){if(_0x4cfebc){return _0x4cfebc[_0x4632('0x25')](_0x2ca6a5)[_0x4632('0x26')](function(_0x3537ed){return _0x3537ed;});}return null;};}function removeEntity(_0x380a9f,_0x1e1b86){return function(_0x38cbbc){if(_0x38cbbc){return _0x38cbbc[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x380a9f[_0x4632('0x1a')](0xcc)[_0x4632('0x28')]();});}};}function handleEntityNotFound(_0x1b8de0,_0x4af026){return function(_0x2e3428){if(!_0x2e3428){_0x1b8de0[_0x4632('0x19')](0x194);}return _0x2e3428;};}function handleError(_0x372679,_0x22d0f5){_0x22d0f5=_0x22d0f5||0x1f4;return function(_0x2a0b11){logger[_0x4632('0x29')](_0x2a0b11['stack']);if(_0x2a0b11['name']){delete _0x2a0b11[_0x4632('0x2a')];}_0x372679[_0x4632('0x1a')](_0x22d0f5)[_0x4632('0x2b')](_0x2a0b11);};}exports[_0x4632('0x2c')]=function(_0x34079f,_0x119d1b){var _0x3570b2={},_0x5e2ee4={},_0x42d505={'count':0x0,'rows':[]};var _0x135fd2=_['map'](db[_0x4632('0x2d')]['rawAttributes'],function(_0x6599ad){return{'name':_0x6599ad['fieldName'],'type':_0x6599ad['type'][_0x4632('0x2e')]};});_0x5e2ee4[_0x4632('0x2f')]=_[_0x4632('0x30')](_0x135fd2,'name');_0x5e2ee4['query']=_[_0x4632('0x31')](_0x34079f[_0x4632('0x32')]);_0x5e2ee4['filters']=_['intersection'](_0x5e2ee4[_0x4632('0x2f')],_0x5e2ee4[_0x4632('0x32')]);_0x3570b2['attributes']=_[_0x4632('0x33')](_0x5e2ee4[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x34079f[_0x4632('0x32')][_0x4632('0x34')]));_0x3570b2['attributes']=_0x3570b2[_0x4632('0x35')][_0x4632('0x36')]?_0x3570b2['attributes']:_0x5e2ee4['model'];if(!_0x34079f[_0x4632('0x32')]['hasOwnProperty']('nolimit')){_0x3570b2[_0x4632('0x1f')]=qs['limit'](_0x34079f[_0x4632('0x32')][_0x4632('0x1f')]);_0x3570b2[_0x4632('0x1c')]=qs['offset'](_0x34079f[_0x4632('0x32')][_0x4632('0x1c')]);}_0x3570b2[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x34079f[_0x4632('0x32')]['sort']);_0x3570b2['where']=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x34079f[_0x4632('0x32')],_0x5e2ee4['filters']),_0x135fd2);if(_0x34079f['query']['filter']){_0x3570b2[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x3570b2['where'],{'$or':_[_0x4632('0x30')](_0x135fd2,function(_0x20a700){if(_0x20a700[_0x4632('0x3d')]!==_0x4632('0x3e')){var _0x2309f1={};_0x2309f1[_0x20a700[_0x4632('0x2a')]]={'$like':'%'+_0x34079f[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0x2309f1;}})});}_0x3570b2=_[_0x4632('0x3c')]({},_0x3570b2,_0x34079f[_0x4632('0x40')]);var _0x1fd3f1={'where':_0x3570b2[_0x4632('0x3b')]};return db['ZendeskAccount'][_0x4632('0x1e')](_0x1fd3f1)[_0x4632('0x26')](function(_0x4c0e13){_0x42d505[_0x4632('0x1e')]=_0x4c0e13;if(_0x34079f[_0x4632('0x32')]['includeAll']){_0x3570b2[_0x4632('0x41')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4632('0x42')](_0x3570b2);})[_0x4632('0x26')](function(_0x1bfb36){_0x42d505[_0x4632('0x43')]=_0x1bfb36;return _0x42d505;})['then'](respondWithFilteredResult(_0x119d1b,_0x3570b2))[_0x4632('0x44')](handleError(_0x119d1b,null));};exports[_0x4632('0x45')]=function(_0x23ef38,_0x279298){var _0x5cc716={'raw':![],'where':{'id':_0x23ef38[_0x4632('0x46')]['id']}},_0x5b3fa9={};_0x5b3fa9[_0x4632('0x2f')]=_[_0x4632('0x31')](db['ZendeskAccount'][_0x4632('0x47')]);_0x5b3fa9[_0x4632('0x32')]=_[_0x4632('0x31')](_0x23ef38[_0x4632('0x32')]);_0x5b3fa9[_0x4632('0x39')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],_0x5b3fa9['query']);_0x5cc716[_0x4632('0x35')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x23ef38[_0x4632('0x32')]['fields']));_0x5cc716['attributes']=_0x5cc716[_0x4632('0x35')][_0x4632('0x36')]?_0x5cc716[_0x4632('0x35')]:_0x5b3fa9[_0x4632('0x2f')];if(_0x23ef38['query'][_0x4632('0x48')]){_0x5cc716[_0x4632('0x41')]=[{'all':!![]}];}_0x5cc716=_[_0x4632('0x3c')]({},_0x5cc716,_0x23ef38[_0x4632('0x40')]);return db[_0x4632('0x2d')]['find'](_0x5cc716)[_0x4632('0x26')](handleEntityNotFound(_0x279298,null))[_0x4632('0x26')](respondWithResult(_0x279298,null))[_0x4632('0x44')](handleError(_0x279298,null));};exports[_0x4632('0x49')]=function(_0x3676fa,_0x2eb8b0){return db[_0x4632('0x2d')][_0x4632('0x49')](_0x3676fa[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x2eb8b0,0xc9))[_0x4632('0x44')](handleError(_0x2eb8b0,null));};exports['update']=function(_0xc3ffd0,_0x1ccadb){if(_0xc3ffd0[_0x4632('0x4a')]['id']){delete _0xc3ffd0['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0xc3ffd0[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x1ccadb,null))[_0x4632('0x26')](saveUpdates(_0xc3ffd0[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0x1ccadb,null))[_0x4632('0x44')](handleError(_0x1ccadb,null));};exports[_0x4632('0x27')]=function(_0x1aa831,_0x4e89e3){return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0x1aa831['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x4e89e3,null))[_0x4632('0x26')](removeEntity(_0x4e89e3,null))[_0x4632('0x44')](handleError(_0x4e89e3,null));};exports[_0x4632('0x4c')]=function(_0x2c59f5,_0xfeeac0,_0x248dcf){var _0xf4880f={};var _0x31b42d={};var _0x1b66e0;var _0x3e66d8;return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2c59f5[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xfeeac0,null))[_0x4632('0x26')](function(_0x32cd35){if(_0x32cd35){_0x1b66e0=_0x32cd35;_0x31b42d[_0x4632('0x2f')]=_[_0x4632('0x31')](db[_0x4632('0x4e')]['rawAttributes']);_0x31b42d[_0x4632('0x32')]=_[_0x4632('0x31')](_0x2c59f5[_0x4632('0x32')]);_0x31b42d[_0x4632('0x39')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],_0x31b42d['query']);_0xf4880f[_0x4632('0x35')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],qs['fields'](_0x2c59f5[_0x4632('0x32')][_0x4632('0x34')]));_0xf4880f['attributes']=_0xf4880f[_0x4632('0x35')][_0x4632('0x36')]?_0xf4880f[_0x4632('0x35')]:_0x31b42d['model'];_0xf4880f[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x38')]);_0xf4880f[_0x4632('0x3b')]=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x2c59f5[_0x4632('0x32')],_0x31b42d[_0x4632('0x39')]));if(_0x2c59f5[_0x4632('0x32')]['filter']){_0xf4880f[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0xf4880f['where'],{'$or':_[_0x4632('0x30')](_0xf4880f['attributes'],function(_0x48e942){var _0xa55d76={};_0xa55d76[_0x48e942]={'$like':'%'+_0x2c59f5[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0xa55d76;})});}_0xf4880f=_[_0x4632('0x3c')]({},_0xf4880f,_0x2c59f5[_0x4632('0x40')]);return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x3e2849){if(_0x3e2849){_0x3e66d8=_0x3e2849[_0x4632('0x36')];if(!_0x2c59f5[_0x4632('0x32')][_0x4632('0x4f')](_0x4632('0x50'))){_0xf4880f[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x2c59f5['query']['limit']);_0xf4880f[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x1c')]);}return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x5b66ee){if(_0x5b66ee){return _0x5b66ee?{'count':_0x3e66d8,'rows':_0x5b66ee}:null;}})[_0x4632('0x26')](respondWithResult(_0xfeeac0,null))[_0x4632('0x44')](handleError(_0xfeeac0,null));};exports[_0x4632('0x51')]=function(_0x2e4d57,_0x5d1994,_0x529be1){if(_0x2e4d57[_0x4632('0x4a')]['id']){delete _0x2e4d57['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2e4d57[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x5d1994,null))[_0x4632('0x26')](function(_0x5e5669){if(_0x5e5669){_0x2e4d57[_0x4632('0x4a')][_0x4632('0x52')]=_0x5e5669['id'];_0x2e4d57['body']['Subjects']=integrations[_0x4632('0x53')](_0x2e4d57[_0x4632('0x4a')][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')]['type']);_0x2e4d57['body']['Descriptions']=integrations[_0x4632('0x55')](_0x2e4d57['body'][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')][_0x4632('0x3d')]);return db[_0x4632('0x4e')][_0x4632('0x49')](_0x2e4d57[_0x4632('0x4a')],{'include':[{'model':db[_0x4632('0x56')],'as':_0x4632('0x57')},{'model':db[_0x4632('0x56')],'as':_0x4632('0x58')}]});}return null;})[_0x4632('0x26')](respondWithResult(_0x5d1994,null))[_0x4632('0x44')](handleError(_0x5d1994,null));};exports[_0x4632('0x59')]=function(_0x3d5e65,_0x461700,_0x1b2905){var _0x550c4d='';return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x3d5e65[_0x4632('0x46')]['id']},'attributes':['id',_0x4632('0x5a'),_0x4632('0x5b'),_0x4632('0x5c'),_0x4632('0x5d'),_0x4632('0x5e')]})[_0x4632('0x26')](handleEntityNotFound(_0x461700,null))[_0x4632('0x26')](function(_0x16ed40){if(_0x16ed40){_0x550c4d=_0x16ed40[_0x4632('0x5e')];var _0x27e2a6=_0x550c4d['slice'](-0x1);if(_0x27e2a6==='/'){_0x550c4d=_0x550c4d[_0x4632('0x5f')](0x0,_0x550c4d[_0x4632('0x60')](_0x27e2a6));}var _0x348af1={'method':_0x4632('0x61'),'uri':util[_0x4632('0x62')](_0x4632('0x63'),_0x550c4d,'ticket_fields'),'json':!![]};switch(_0x16ed40[_0x4632('0x5d')]){case _0x4632('0x5b'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x65'),_0x16ed40[_0x4632('0x5a')],_0x16ed40['password']))[_0x4632('0x66')](_0x4632('0x67')))};break;case _0x4632('0x5c'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x68'),_0x16ed40[_0x4632('0x5a')],_0x16ed40[_0x4632('0x5c')]))[_0x4632('0x66')](_0x4632('0x67')))};break;default:throw new db['Sequelize'][(_0x4632('0x69'))](_0x4632('0x6a'));}return rp(_0x348af1);}})[_0x4632('0x26')](function(_0x525bf9){if(_0x525bf9){var _0xfc48bd=[_0x4632('0x6b'),'description','group',_0x4632('0x6c')];_[_0x4632('0x6d')](_0x525bf9['ticket_fields'],function(_0x63d3e1){return _0xfc48bd[_0x4632('0x6e')](_0x63d3e1[_0x4632('0x3d')]);});return{'count':_0x525bf9[_0x4632('0x6f')][_0x4632('0x36')],'rows':_[_0x4632('0x30')](_0x525bf9[_0x4632('0x6f')],function(_0x130b52){return{'id':_0x130b52['id'],'name':_0x130b52['position']>0x7?_0x130b52[_0x4632('0x70')]:_0x130b52[_0x4632('0x3d')],'custom':_0x130b52[_0x4632('0x71')]>0x7?!![]:![],'options':_0x130b52[_0x4632('0x72')]?_0x130b52['system_field_options']:_0x130b52[_0x4632('0x73')]?_0x130b52[_0x4632('0x73')]:[]};})};}})[_0x4632('0x26')](respondWithResult(_0x461700,null))[_0x4632('0x44')](function(_0x3cee1d){var _0x4ca8a8=_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?0x1f4:_0x3cee1d[_0x4632('0x75')]||0x1f4;logger[_0x4632('0x29')](_0x4632('0x76'),_0x4632('0x59'),_0x4ca8a8,JSON[_0x4632('0x77')](_0x3cee1d));delete _0x3cee1d[_0x4632('0x2a')];if(_0x4ca8a8===0x191){_0x4ca8a8=0x190;}_0x461700['status'](_0x4ca8a8)[_0x4632('0x2b')](_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?{'message':_0x4632('0x78'),'statusCode':_0x3cee1d[_0x4632('0x75')]}:_0x3cee1d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 67830e9..e0ebad9 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 _0x6107=['ZendeskAccount','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6107,0x114));var _0x7610=function(_0xbcb8a8,_0x23e919){_0xbcb8a8=_0xbcb8a8-0x0;var _0xdee05d=_0x6107[_0xbcb8a8];return _0xdee05d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7610('0x0'))('api');var moment=require(_0x7610('0x1'));var BPromise=require(_0x7610('0x2'));var rp=require(_0x7610('0x3'));var fs=require('fs');var path=require(_0x7610('0x4'));var rimraf=require(_0x7610('0x5'));var config=require(_0x7610('0x6'));var attributes=require(_0x7610('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x7610('0x8')]=function(_0x382ff8,_0x1e3f1f){return _0x382ff8[_0x7610('0x9')](_0x7610('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb84=['exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0xeb84,0x103));var _0x4eb8=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0xeb84[_0x29e0eb];return _0x597d2d;};'use strict';var _=require(_0x4eb8('0x0'));var util=require(_0x4eb8('0x1'));var logger=require(_0x4eb8('0x2'))(_0x4eb8('0x3'));var moment=require(_0x4eb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4eb8('0x5'));var fs=require('fs');var path=require(_0x4eb8('0x6'));var rimraf=require(_0x4eb8('0x7'));var config=require(_0x4eb8('0x8'));var attributes=require(_0x4eb8('0x9'));var integrations=require(_0x4eb8('0xa'));module[_0x4eb8('0xb')]=function(_0x567bef,_0x209be3){return _0x567bef[_0x4eb8('0xc')](_0x4eb8('0xd'),attributes,{'tableName':_0x4eb8('0xe'),'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 b1594b9..15aebe2 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 _0x3600=['where','limit','include','map','model','attributes','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw'];(function(_0x2b9b81,_0x5fbf90){var _0x4ca88b=function(_0x13f707){while(--_0x13f707){_0x2b9b81['push'](_0x2b9b81['shift']());}};_0x4ca88b(++_0x5fbf90);}(_0x3600,0x142));var _0x0360=function(_0x51e8d2,_0x5a823e){_0x51e8d2=_0x51e8d2-0x0;var _0x65a20d=_0x3600[_0x51e8d2];return _0x65a20d;};'use strict';var _=require(_0x0360('0x0'));var util=require(_0x0360('0x1'));var moment=require(_0x0360('0x2'));var BPromise=require(_0x0360('0x3'));var rs=require(_0x0360('0x4'));var fs=require('fs');var Redis=require(_0x0360('0x5'));var db=require(_0x0360('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0360('0x7'))(_0x0360('0x8'));var config=require(_0x0360('0x9'));var jayson=require(_0x0360('0xa'));var client=jayson[_0x0360('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46d23d,_0x2179f7,_0x400e04){return new BPromise(function(_0x408931,_0x1df293){return client['request'](_0x46d23d,_0x400e04)[_0x0360('0xc')](function(_0x51aefa){logger[_0x0360('0xd')](_0x0360('0xe'),_0x2179f7,_0x0360('0xf'));logger[_0x0360('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x2179f7,_0x0360('0xf'),JSON[_0x0360('0x11')](_0x51aefa));if(_0x51aefa[_0x0360('0x12')]){if(_0x51aefa[_0x0360('0x12')][_0x0360('0x13')]===0x1f4){logger[_0x0360('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x2179f7,_0x51aefa['error'][_0x0360('0x14')]);return _0x1df293(_0x51aefa[_0x0360('0x12')][_0x0360('0x14')]);}logger[_0x0360('0x12')](_0x0360('0xe'),_0x2179f7,_0x51aefa[_0x0360('0x12')][_0x0360('0x14')]);return _0x408931(_0x51aefa[_0x0360('0x12')][_0x0360('0x14')]);}else{logger[_0x0360('0xd')](_0x0360('0xe'),_0x2179f7,_0x0360('0xf'));_0x408931(_0x51aefa[_0x0360('0x15')][_0x0360('0x14')]);}})[_0x0360('0x16')](function(_0x5dd481){logger[_0x0360('0x12')](_0x0360('0xe'),_0x2179f7,_0x5dd481);_0x1df293(_0x5dd481);});});}exports[_0x0360('0x17')]=function(_0x30cff5){var _0x1c266e=this;return new Promise(function(_0x51c4f9,_0x18ff86){return db[_0x0360('0x18')][_0x0360('0x19')]({'raw':_0x30cff5[_0x0360('0x1a')]?_0x30cff5['options'][_0x0360('0x1b')]===undefined?!![]:![]:!![],'where':_0x30cff5[_0x0360('0x1a')]?_0x30cff5[_0x0360('0x1a')][_0x0360('0x1c')]||null:null,'attributes':_0x30cff5['options']?_0x30cff5[_0x0360('0x1a')]['attributes']||null:null,'limit':_0x30cff5[_0x0360('0x1a')]?_0x30cff5[_0x0360('0x1a')][_0x0360('0x1d')]||null:null,'include':_0x30cff5[_0x0360('0x1a')]?_0x30cff5[_0x0360('0x1a')][_0x0360('0x1e')]?_[_0x0360('0x1f')](_0x30cff5[_0x0360('0x1a')][_0x0360('0x1e')],function(_0x39868e){return{'model':db[_0x39868e[_0x0360('0x20')]],'as':_0x39868e['as'],'attributes':_0x39868e[_0x0360('0x21')],'include':_0x39868e['include']?_[_0x0360('0x1f')](_0x39868e[_0x0360('0x1e')],function(_0x3cd121){return{'model':db[_0x3cd121['model']],'as':_0x3cd121['as'],'attributes':_0x3cd121[_0x0360('0x21')],'include':_0x3cd121[_0x0360('0x1e')]?_[_0x0360('0x1f')](_0x3cd121[_0x0360('0x1e')],function(_0x1f7228){return{'model':db[_0x1f7228[_0x0360('0x20')]],'as':_0x1f7228['as'],'attributes':_0x1f7228['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a6fe7){logger['info']('GetZendeskAccount',_0x30cff5);logger[_0x0360('0x10')](_0x0360('0x17'),_0x30cff5,JSON['stringify'](_0x3a6fe7));_0x51c4f9(_0x3a6fe7);})[_0x0360('0x16')](function(_0x591a32){logger[_0x0360('0x12')]('GetZendeskAccount',_0x591a32['message'],_0x30cff5);_0x18ff86(_0x1c266e['error'](0x1f4,_0x591a32[_0x0360('0x14')]));});});};exports[_0x0360('0x22')]=function(_0x1948fc){var _0xab9b26=this;return new Promise(function(_0x4ba8df,_0x2b4c45){return db[_0x0360('0x18')]['find']({'raw':_0x1948fc['options']?_0x1948fc['options'][_0x0360('0x1b')]===undefined?!![]:![]:!![],'where':_0x1948fc[_0x0360('0x1a')]?_0x1948fc[_0x0360('0x1a')][_0x0360('0x1c')]||null:null,'attributes':_0x1948fc[_0x0360('0x1a')]?_0x1948fc[_0x0360('0x1a')]['attributes']||null:null,'include':_0x1948fc[_0x0360('0x1a')]?_0x1948fc['options'][_0x0360('0x1e')]?_[_0x0360('0x1f')](_0x1948fc['options'][_0x0360('0x1e')],function(_0x1830ee){return{'model':db[_0x1830ee[_0x0360('0x20')]],'as':_0x1830ee['as'],'attributes':_0x1830ee['attributes'],'include':_0x1830ee[_0x0360('0x1e')]?_[_0x0360('0x1f')](_0x1830ee['include'],function(_0x502562){return{'model':db[_0x502562[_0x0360('0x20')]],'as':_0x502562['as'],'attributes':_0x502562[_0x0360('0x21')],'include':_0x502562[_0x0360('0x1e')]?_['map'](_0x502562[_0x0360('0x1e')],function(_0x235680){return{'model':db[_0x235680[_0x0360('0x20')]],'as':_0x235680['as'],'attributes':_0x235680['attributes']};}):[]};}):[]};}):[]:[]})[_0x0360('0xc')](function(_0x112ce0){logger[_0x0360('0xd')](_0x0360('0x22'),_0x1948fc);logger[_0x0360('0x10')](_0x0360('0x22'),_0x1948fc,JSON['stringify'](_0x112ce0));_0x4ba8df(_0x112ce0);})[_0x0360('0x16')](function(_0x127c37){logger[_0x0360('0x12')](_0x0360('0x22'),_0x127c37[_0x0360('0x14')],_0x1948fc);_0x2b4c45(_0xab9b26[_0x0360('0x12')](0x1f4,_0x127c37[_0x0360('0x14')]));});});}; \ No newline at end of file +var _0x8420=['debug','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','model','map','info','catch','ShowZendeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s'];(function(_0x423a22,_0x44da5e){var _0x40c507=function(_0x10437e){while(--_0x10437e){_0x423a22['push'](_0x423a22['shift']());}};_0x40c507(++_0x44da5e);}(_0x8420,0xbe));var _0x0842=function(_0x56cdbd,_0x449e9a){_0x56cdbd=_0x56cdbd-0x0;var _0x42be78=_0x8420[_0x56cdbd];return _0x42be78;};'use strict';var _=require(_0x0842('0x0'));var util=require(_0x0842('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0842('0x2'));var fs=require('fs');var Redis=require(_0x0842('0x3'));var db=require(_0x0842('0x4'))['db'];var utils=require(_0x0842('0x5'));var logger=require(_0x0842('0x6'))(_0x0842('0x7'));var config=require(_0x0842('0x8'));var jayson=require(_0x0842('0x9'));var client=jayson[_0x0842('0xa')][_0x0842('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16368b,_0x3c1e4a,_0x1bd980){return new BPromise(function(_0x4d79de,_0x324aac){return client['request'](_0x16368b,_0x1bd980)[_0x0842('0xc')](function(_0x285865){logger['info'](_0x0842('0xd'),_0x3c1e4a,'request\x20sent');logger[_0x0842('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3c1e4a,'request\x20sent',JSON[_0x0842('0xf')](_0x285865));if(_0x285865[_0x0842('0x10')]){if(_0x285865['error'][_0x0842('0x11')]===0x1f4){logger[_0x0842('0x10')](_0x0842('0xd'),_0x3c1e4a,_0x285865['error'][_0x0842('0x12')]);return _0x324aac(_0x285865[_0x0842('0x10')]['message']);}logger['error'](_0x0842('0xd'),_0x3c1e4a,_0x285865['error'][_0x0842('0x12')]);return _0x4d79de(_0x285865[_0x0842('0x10')][_0x0842('0x12')]);}else{logger['info'](_0x0842('0xd'),_0x3c1e4a,'request\x20sent');_0x4d79de(_0x285865[_0x0842('0x13')][_0x0842('0x12')]);}})['catch'](function(_0x2fdd5c){logger[_0x0842('0x10')](_0x0842('0xd'),_0x3c1e4a,_0x2fdd5c);_0x324aac(_0x2fdd5c);});});}exports[_0x0842('0x14')]=function(_0x3dcd2c){var _0x416e57=this;return new Promise(function(_0x526499,_0x23cf1a){return db[_0x0842('0x15')][_0x0842('0x16')]({'raw':_0x3dcd2c[_0x0842('0x17')]?_0x3dcd2c[_0x0842('0x17')][_0x0842('0x18')]===undefined?!![]:![]:!![],'where':_0x3dcd2c['options']?_0x3dcd2c[_0x0842('0x17')][_0x0842('0x19')]||null:null,'attributes':_0x3dcd2c[_0x0842('0x17')]?_0x3dcd2c['options'][_0x0842('0x1a')]||null:null,'limit':_0x3dcd2c['options']?_0x3dcd2c[_0x0842('0x17')]['limit']||null:null,'include':_0x3dcd2c[_0x0842('0x17')]?_0x3dcd2c[_0x0842('0x17')][_0x0842('0x1b')]?_['map'](_0x3dcd2c['options'][_0x0842('0x1b')],function(_0x54ef4a){return{'model':db[_0x54ef4a[_0x0842('0x1c')]],'as':_0x54ef4a['as'],'attributes':_0x54ef4a[_0x0842('0x1a')],'include':_0x54ef4a['include']?_[_0x0842('0x1d')](_0x54ef4a[_0x0842('0x1b')],function(_0x3ac369){return{'model':db[_0x3ac369[_0x0842('0x1c')]],'as':_0x3ac369['as'],'attributes':_0x3ac369[_0x0842('0x1a')],'include':_0x3ac369[_0x0842('0x1b')]?_[_0x0842('0x1d')](_0x3ac369[_0x0842('0x1b')],function(_0x20a509){return{'model':db[_0x20a509['model']],'as':_0x20a509['as'],'attributes':_0x20a509[_0x0842('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0842('0xc')](function(_0x23e3eb){logger[_0x0842('0x1e')](_0x0842('0x14'),_0x3dcd2c);logger[_0x0842('0xe')](_0x0842('0x14'),_0x3dcd2c,JSON[_0x0842('0xf')](_0x23e3eb));_0x526499(_0x23e3eb);})[_0x0842('0x1f')](function(_0x5f4b14){logger[_0x0842('0x10')](_0x0842('0x14'),_0x5f4b14['message'],_0x3dcd2c);_0x23cf1a(_0x416e57['error'](0x1f4,_0x5f4b14['message']));});});};exports[_0x0842('0x20')]=function(_0x210451){var _0x589866=this;return new Promise(function(_0x1eac71,_0x4b76c1){return db['ZendeskAccount'][_0x0842('0x21')]({'raw':_0x210451[_0x0842('0x17')]?_0x210451[_0x0842('0x17')][_0x0842('0x18')]===undefined?!![]:![]:!![],'where':_0x210451[_0x0842('0x17')]?_0x210451[_0x0842('0x17')][_0x0842('0x19')]||null:null,'attributes':_0x210451[_0x0842('0x17')]?_0x210451[_0x0842('0x17')][_0x0842('0x1a')]||null:null,'include':_0x210451[_0x0842('0x17')]?_0x210451['options'][_0x0842('0x1b')]?_[_0x0842('0x1d')](_0x210451[_0x0842('0x17')][_0x0842('0x1b')],function(_0xe5326){return{'model':db[_0xe5326[_0x0842('0x1c')]],'as':_0xe5326['as'],'attributes':_0xe5326[_0x0842('0x1a')],'include':_0xe5326[_0x0842('0x1b')]?_[_0x0842('0x1d')](_0xe5326[_0x0842('0x1b')],function(_0x33d9d7){return{'model':db[_0x33d9d7[_0x0842('0x1c')]],'as':_0x33d9d7['as'],'attributes':_0x33d9d7[_0x0842('0x1a')],'include':_0x33d9d7[_0x0842('0x1b')]?_['map'](_0x33d9d7[_0x0842('0x1b')],function(_0x5793c8){return{'model':db[_0x5793c8[_0x0842('0x1c')]],'as':_0x5793c8['as'],'attributes':_0x5793c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x0842('0xc')](function(_0x49e207){logger[_0x0842('0x1e')](_0x0842('0x20'),_0x210451);logger[_0x0842('0xe')](_0x0842('0x20'),_0x210451,JSON[_0x0842('0xf')](_0x49e207));_0x1eac71(_0x49e207);})[_0x0842('0x1f')](function(_0x469e92){logger[_0x0842('0x10')](_0x0842('0x20'),_0x469e92[_0x0842('0x12')],_0x210451);_0x4b76c1(_0x589866[_0x0842('0x10')](0x1f4,_0x469e92[_0x0842('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index fd50499..0e6f74c 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x310f1e,_0x35ee5a){var _0x339fb4=function(_0x5e157a){while(--_0x5e157a){_0x310f1e['push'](_0x310f1e['shift']());}};_0x339fb4(++_0x35ee5a);}(_0xe706,0xa3));var _0x6e70=function(_0x1a50a6,_0x400207){_0x1a50a6=_0x1a50a6-0x0;var _0x9cd101=_0xe706[_0x1a50a6];return _0x9cd101;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2bb0d9,_0x1fa51c){_0x2bb0d9=_0x2bb0d9-0x0;var _0x43fe14=_0xbdb7[_0x2bb0d9];return _0x43fe14;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index cd7332a..cf534c6 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 _0x887a=['STRING','sequelize'];(function(_0x40bd84,_0x3f1117){var _0x5cc783=function(_0x21f0ce){while(--_0x21f0ce){_0x40bd84['push'](_0x40bd84['shift']());}};_0x5cc783(++_0x3f1117);}(_0x887a,0xa7));var _0xa887=function(_0x31c00b,_0x4fc23a){_0x31c00b=_0x31c00b-0x0;var _0x493ecc=_0x887a[_0x31c00b];return _0x493ecc;};'use strict';var Sequelize=require(_0xa887('0x0'));module['exports']={'name':{'type':Sequelize[_0xa887('0x1')]},'description':{'type':Sequelize[_0xa887('0x1')]}}; \ No newline at end of file +var _0xe042=['sequelize'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xe042,0x1ce));var _0x2e04=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0xe042[_0x2850c0];return _0x21e830;};'use strict';var Sequelize=require(_0x2e04('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'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 277efd3..6ec9d8b 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 _0x6fe6=['count','apply','update','then','destroy','end','sendStatus','error','stack','map','ZendeskConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','name','merge','includeAll','include','catch','show','params','options','find','create','body','getFields','findOne','keys','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined'];(function(_0x536300,_0xe58389){var _0x416ffc=function(_0x367619){while(--_0x367619){_0x536300['push'](_0x536300['shift']());}};_0x416ffc(++_0xe58389);}(_0x6fe6,0x1a3));var _0x66fe=function(_0x43caf0,_0x5825e4){_0x43caf0=_0x43caf0-0x0;var _0x16cc04=_0x6fe6[_0x43caf0];return _0x16cc04;};'use strict';var emlformat=require(_0x66fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x66fe('0x1'));var moment=require(_0x66fe('0x2'));var BPromise=require(_0x66fe('0x3'));var Mustache=require(_0x66fe('0x4'));var util=require(_0x66fe('0x5'));var path=require('path');var sox=require(_0x66fe('0x6'));var csv=require(_0x66fe('0x7'));var ejs=require(_0x66fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66fe('0x9'));var squel=require(_0x66fe('0xa'));var crypto=require(_0x66fe('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x66fe('0xc'));var Papa=require(_0x66fe('0xd'));var Redis=require(_0x66fe('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66fe('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66fe('0x10'))('api');var utils=require(_0x66fe('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x66fe('0x12'));var db=require(_0x66fe('0x13'))['db'];function respondWithStatusCode(_0x52c607,_0x44585b){_0x44585b=_0x44585b||0xcc;return function(_0x5007b8){if(_0x5007b8){return _0x52c607['sendStatus'](_0x44585b);}return _0x52c607['status'](_0x44585b)['end']();};}function respondWithResult(_0xb69bdb,_0x5bcb55){_0x5bcb55=_0x5bcb55||0xc8;return function(_0x15fa1e){if(_0x15fa1e){return _0xb69bdb[_0x66fe('0x14')](_0x5bcb55)[_0x66fe('0x15')](_0x15fa1e);}};}function respondWithFilteredResult(_0x261d72,_0x3f6887){return function(_0x1115ef){if(_0x1115ef){var _0xbf6a05=typeof _0x3f6887[_0x66fe('0x16')]==='undefined'&&typeof _0x3f6887[_0x66fe('0x17')]===_0x66fe('0x18');var _0x576bbf=_0x1115ef[_0x66fe('0x19')];var _0x2d2ca3=_0xbf6a05?0x0:_0x3f6887[_0x66fe('0x16')];var _0x293669=_0xbf6a05?_0x1115ef[_0x66fe('0x19')]:_0x3f6887['offset']+_0x3f6887[_0x66fe('0x17')];var _0xf4098b;if(_0x293669>=_0x576bbf){_0x293669=_0x576bbf;_0xf4098b=0xc8;}else{_0xf4098b=0xce;}_0x261d72['status'](_0xf4098b);return _0x261d72['set']('Content-Range',_0x2d2ca3+'-'+_0x293669+'/'+_0x576bbf)['json'](_0x1115ef);}return null;};}function patchUpdates(_0x3ebc6f){return function(_0x1a4b87){try{jsonpatch[_0x66fe('0x1a')](_0x1a4b87,_0x3ebc6f,!![]);}catch(_0x427b87){return BPromise['reject'](_0x427b87);}return _0x1a4b87['save']();};}function saveUpdates(_0x49501f,_0x39c693){return function(_0x19a17c){if(_0x19a17c){return _0x19a17c[_0x66fe('0x1b')](_0x49501f)[_0x66fe('0x1c')](function(_0x13fc94){return _0x13fc94;});}return null;};}function removeEntity(_0x5160bb,_0x13923a){return function(_0x53ce16){if(_0x53ce16){return _0x53ce16[_0x66fe('0x1d')]()['then'](function(){_0x5160bb[_0x66fe('0x14')](0xcc)[_0x66fe('0x1e')]();});}};}function handleEntityNotFound(_0x53910b,_0x38f6ed){return function(_0x2bf18c){if(!_0x2bf18c){_0x53910b[_0x66fe('0x1f')](0x194);}return _0x2bf18c;};}function handleError(_0x3432a4,_0xa55c87){_0xa55c87=_0xa55c87||0x1f4;return function(_0xd1f4f1){logger[_0x66fe('0x20')](_0xd1f4f1[_0x66fe('0x21')]);if(_0xd1f4f1['name']){delete _0xd1f4f1['name'];}_0x3432a4[_0x66fe('0x14')](_0xa55c87)['send'](_0xd1f4f1);};}exports['index']=function(_0x101d87,_0x541a2a){var _0x1f8124={},_0x52d0c2={},_0x3f9bfc={'count':0x0,'rows':[]};var _0x2630c8=_[_0x66fe('0x22')](db[_0x66fe('0x23')][_0x66fe('0x24')],function(_0x5624c1){return{'name':_0x5624c1['fieldName'],'type':_0x5624c1['type'][_0x66fe('0x25')]};});_0x52d0c2[_0x66fe('0x26')]=_[_0x66fe('0x22')](_0x2630c8,'name');_0x52d0c2[_0x66fe('0x27')]=_['keys'](_0x101d87[_0x66fe('0x27')]);_0x52d0c2[_0x66fe('0x28')]=_[_0x66fe('0x29')](_0x52d0c2[_0x66fe('0x26')],_0x52d0c2[_0x66fe('0x27')]);_0x1f8124[_0x66fe('0x2a')]=_[_0x66fe('0x29')](_0x52d0c2[_0x66fe('0x26')],qs['fields'](_0x101d87['query'][_0x66fe('0x2b')]));_0x1f8124[_0x66fe('0x2a')]=_0x1f8124[_0x66fe('0x2a')][_0x66fe('0x2c')]?_0x1f8124[_0x66fe('0x2a')]:_0x52d0c2[_0x66fe('0x26')];if(!_0x101d87['query']['hasOwnProperty'](_0x66fe('0x2d'))){_0x1f8124[_0x66fe('0x17')]=qs[_0x66fe('0x17')](_0x101d87['query']['limit']);_0x1f8124[_0x66fe('0x16')]=qs[_0x66fe('0x16')](_0x101d87[_0x66fe('0x27')][_0x66fe('0x16')]);}_0x1f8124[_0x66fe('0x2e')]=qs['sort'](_0x101d87[_0x66fe('0x27')][_0x66fe('0x2f')]);_0x1f8124[_0x66fe('0x30')]=qs['filters'](_[_0x66fe('0x31')](_0x101d87[_0x66fe('0x27')],_0x52d0c2[_0x66fe('0x28')]),_0x2630c8);if(_0x101d87[_0x66fe('0x27')][_0x66fe('0x32')]){_0x1f8124['where']=_['merge'](_0x1f8124[_0x66fe('0x30')],{'$or':_[_0x66fe('0x22')](_0x2630c8,function(_0x77cabc){if(_0x77cabc[_0x66fe('0x33')]!==_0x66fe('0x34')){var _0x24591e={};_0x24591e[_0x77cabc[_0x66fe('0x35')]]={'$like':'%'+_0x101d87[_0x66fe('0x27')][_0x66fe('0x32')]+'%'};return _0x24591e;}})});}_0x1f8124=_[_0x66fe('0x36')]({},_0x1f8124,_0x101d87['options']);var _0x14a31d={'where':_0x1f8124[_0x66fe('0x30')]};return db[_0x66fe('0x23')][_0x66fe('0x19')](_0x14a31d)['then'](function(_0x466ec0){_0x3f9bfc[_0x66fe('0x19')]=_0x466ec0;if(_0x101d87[_0x66fe('0x27')][_0x66fe('0x37')]){_0x1f8124[_0x66fe('0x38')]=[{'all':!![]}];}return db[_0x66fe('0x23')]['findAll'](_0x1f8124);})[_0x66fe('0x1c')](function(_0x5ae995){_0x3f9bfc['rows']=_0x5ae995;return _0x3f9bfc;})[_0x66fe('0x1c')](respondWithFilteredResult(_0x541a2a,_0x1f8124))[_0x66fe('0x39')](handleError(_0x541a2a,null));};exports[_0x66fe('0x3a')]=function(_0x52ac81,_0x487027){var _0x3c36df={'raw':![],'where':{'id':_0x52ac81[_0x66fe('0x3b')]['id']}},_0x45a922={};_0x45a922[_0x66fe('0x26')]=_['keys'](db[_0x66fe('0x23')][_0x66fe('0x24')]);_0x45a922['query']=_['keys'](_0x52ac81[_0x66fe('0x27')]);_0x45a922['filters']=_['intersection'](_0x45a922[_0x66fe('0x26')],_0x45a922[_0x66fe('0x27')]);_0x3c36df['attributes']=_['intersection'](_0x45a922['model'],qs[_0x66fe('0x2b')](_0x52ac81['query'][_0x66fe('0x2b')]));_0x3c36df[_0x66fe('0x2a')]=_0x3c36df[_0x66fe('0x2a')][_0x66fe('0x2c')]?_0x3c36df[_0x66fe('0x2a')]:_0x45a922['model'];if(_0x52ac81['query'][_0x66fe('0x37')]){_0x3c36df[_0x66fe('0x38')]=[{'all':!![]}];}_0x3c36df=_[_0x66fe('0x36')]({},_0x3c36df,_0x52ac81[_0x66fe('0x3c')]);return db[_0x66fe('0x23')][_0x66fe('0x3d')](_0x3c36df)[_0x66fe('0x1c')](handleEntityNotFound(_0x487027,null))[_0x66fe('0x1c')](respondWithResult(_0x487027,null))[_0x66fe('0x39')](handleError(_0x487027,null));};exports['create']=function(_0xa38e2,_0x47fa43){return db['ZendeskConfiguration'][_0x66fe('0x3e')](_0xa38e2[_0x66fe('0x3f')],{})[_0x66fe('0x1c')](respondWithResult(_0x47fa43,0xc9))[_0x66fe('0x39')](handleError(_0x47fa43,null));};exports['update']=function(_0x53678e,_0xfa5a7a){if(_0x53678e['body']['id']){delete _0x53678e[_0x66fe('0x3f')]['id'];}return db[_0x66fe('0x23')][_0x66fe('0x3d')]({'where':{'id':_0x53678e[_0x66fe('0x3b')]['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0xfa5a7a,null))[_0x66fe('0x1c')](saveUpdates(_0x53678e['body'],null))[_0x66fe('0x1c')](respondWithResult(_0xfa5a7a,null))['catch'](handleError(_0xfa5a7a,null));};exports[_0x66fe('0x1d')]=function(_0x1a6ccb,_0x3715e5){return db[_0x66fe('0x23')][_0x66fe('0x3d')]({'where':{'id':_0x1a6ccb[_0x66fe('0x3b')]['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0x3715e5,null))[_0x66fe('0x1c')](removeEntity(_0x3715e5,null))[_0x66fe('0x39')](handleError(_0x3715e5,null));};exports[_0x66fe('0x40')]=function(_0x188d18,_0x3239bb,_0x3ac20f){var _0x3f64cd={};var _0x311d6a={};var _0x312a00;var _0x11cdba;return db[_0x66fe('0x23')][_0x66fe('0x41')]({'where':{'id':_0x188d18[_0x66fe('0x3b')]['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0x3239bb,null))[_0x66fe('0x1c')](function(_0x390127){if(_0x390127){_0x312a00=_0x390127;_0x311d6a[_0x66fe('0x26')]=_[_0x66fe('0x42')](db[_0x66fe('0x43')]['rawAttributes']);_0x311d6a[_0x66fe('0x27')]=_[_0x66fe('0x42')](_0x188d18[_0x66fe('0x27')]);_0x311d6a[_0x66fe('0x28')]=_['intersection'](_0x311d6a[_0x66fe('0x26')],_0x311d6a[_0x66fe('0x27')]);_0x3f64cd[_0x66fe('0x2a')]=_[_0x66fe('0x29')](_0x311d6a[_0x66fe('0x26')],qs['fields'](_0x188d18[_0x66fe('0x27')][_0x66fe('0x2b')]));_0x3f64cd[_0x66fe('0x2a')]=_0x3f64cd[_0x66fe('0x2a')][_0x66fe('0x2c')]?_0x3f64cd[_0x66fe('0x2a')]:_0x311d6a['model'];_0x3f64cd['order']=qs[_0x66fe('0x2f')](_0x188d18['query'][_0x66fe('0x2f')]);_0x3f64cd[_0x66fe('0x30')]=qs[_0x66fe('0x28')](_[_0x66fe('0x31')](_0x188d18['query'],_0x311d6a[_0x66fe('0x28')]));if(_0x188d18[_0x66fe('0x27')][_0x66fe('0x32')]){_0x3f64cd['where']=_[_0x66fe('0x36')](_0x3f64cd[_0x66fe('0x30')],{'$or':_['map'](_0x3f64cd['attributes'],function(_0x172b61){var _0x5281bc={};_0x5281bc[_0x172b61]={'$like':'%'+_0x188d18[_0x66fe('0x27')]['filter']+'%'};return _0x5281bc;})});}_0x3f64cd=_[_0x66fe('0x36')]({},_0x3f64cd,_0x188d18[_0x66fe('0x3c')]);return _0x312a00[_0x66fe('0x40')](_0x3f64cd);}})[_0x66fe('0x1c')](function(_0x5c1fc7){if(_0x5c1fc7){_0x11cdba=_0x5c1fc7['length'];if(!_0x188d18[_0x66fe('0x27')][_0x66fe('0x44')](_0x66fe('0x2d'))){_0x3f64cd[_0x66fe('0x17')]=qs[_0x66fe('0x17')](_0x188d18[_0x66fe('0x27')]['limit']);_0x3f64cd[_0x66fe('0x16')]=qs[_0x66fe('0x16')](_0x188d18[_0x66fe('0x27')]['offset']);}return _0x312a00[_0x66fe('0x40')](_0x3f64cd);}})[_0x66fe('0x1c')](function(_0xe41d4d){if(_0xe41d4d){return _0xe41d4d?{'count':_0x11cdba,'rows':_0xe41d4d}:null;}})[_0x66fe('0x1c')](respondWithResult(_0x3239bb,null))[_0x66fe('0x39')](handleError(_0x3239bb,null));};exports[_0x66fe('0x45')]=function(_0x481c1c,_0x100816,_0x1060bf){var _0x5a7625={};var _0xdaa6aa={};var _0x6c7e13;var _0x55c356;return db[_0x66fe('0x23')][_0x66fe('0x41')]({'where':{'id':_0x481c1c[_0x66fe('0x3b')]['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0x100816,null))['then'](function(_0x10e5ec){if(_0x10e5ec){_0x6c7e13=_0x10e5ec;_0xdaa6aa['model']=_[_0x66fe('0x42')](db[_0x66fe('0x43')]['rawAttributes']);_0xdaa6aa[_0x66fe('0x27')]=_[_0x66fe('0x42')](_0x481c1c['query']);_0xdaa6aa[_0x66fe('0x28')]=_[_0x66fe('0x29')](_0xdaa6aa[_0x66fe('0x26')],_0xdaa6aa[_0x66fe('0x27')]);_0x5a7625['attributes']=_['intersection'](_0xdaa6aa['model'],qs[_0x66fe('0x2b')](_0x481c1c[_0x66fe('0x27')]['fields']));_0x5a7625['attributes']=_0x5a7625[_0x66fe('0x2a')][_0x66fe('0x2c')]?_0x5a7625[_0x66fe('0x2a')]:_0xdaa6aa[_0x66fe('0x26')];_0x5a7625[_0x66fe('0x2e')]=qs[_0x66fe('0x2f')](_0x481c1c[_0x66fe('0x27')]['sort']);_0x5a7625[_0x66fe('0x30')]=qs[_0x66fe('0x28')](_[_0x66fe('0x31')](_0x481c1c['query'],_0xdaa6aa[_0x66fe('0x28')]));if(_0x481c1c['query'][_0x66fe('0x32')]){_0x5a7625[_0x66fe('0x30')]=_['merge'](_0x5a7625[_0x66fe('0x30')],{'$or':_[_0x66fe('0x22')](_0x5a7625[_0x66fe('0x2a')],function(_0x5394fc){var _0x478e6a={};_0x478e6a[_0x5394fc]={'$like':'%'+_0x481c1c['query'][_0x66fe('0x32')]+'%'};return _0x478e6a;})});}_0x5a7625=_[_0x66fe('0x36')]({},_0x5a7625,_0x481c1c[_0x66fe('0x3c')]);return _0x6c7e13['getSubjects'](_0x5a7625);}})[_0x66fe('0x1c')](function(_0x5dc50e){if(_0x5dc50e){_0x55c356=_0x5dc50e['length'];if(!_0x481c1c[_0x66fe('0x27')][_0x66fe('0x44')](_0x66fe('0x2d'))){_0x5a7625[_0x66fe('0x17')]=qs['limit'](_0x481c1c['query']['limit']);_0x5a7625['offset']=qs[_0x66fe('0x16')](_0x481c1c[_0x66fe('0x27')][_0x66fe('0x16')]);}return _0x6c7e13['getSubjects'](_0x5a7625);}})[_0x66fe('0x1c')](function(_0x4f1684){if(_0x4f1684){return _0x4f1684?{'count':_0x55c356,'rows':_0x4f1684}:null;}})['then'](respondWithResult(_0x100816,null))[_0x66fe('0x39')](handleError(_0x100816,null));};exports['getDescriptions']=function(_0x31f729,_0x292644,_0x5e20b6){var _0x247bed={};var _0x463910={};var _0x2d2638;var _0x1b8fbb;return db[_0x66fe('0x23')][_0x66fe('0x41')]({'where':{'id':_0x31f729['params']['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0x292644,null))[_0x66fe('0x1c')](function(_0x44a184){if(_0x44a184){_0x2d2638=_0x44a184;_0x463910[_0x66fe('0x26')]=_[_0x66fe('0x42')](db['ZendeskField'][_0x66fe('0x24')]);_0x463910[_0x66fe('0x27')]=_[_0x66fe('0x42')](_0x31f729[_0x66fe('0x27')]);_0x463910['filters']=_[_0x66fe('0x29')](_0x463910[_0x66fe('0x26')],_0x463910['query']);_0x247bed[_0x66fe('0x2a')]=_[_0x66fe('0x29')](_0x463910[_0x66fe('0x26')],qs[_0x66fe('0x2b')](_0x31f729[_0x66fe('0x27')][_0x66fe('0x2b')]));_0x247bed[_0x66fe('0x2a')]=_0x247bed[_0x66fe('0x2a')][_0x66fe('0x2c')]?_0x247bed[_0x66fe('0x2a')]:_0x463910['model'];_0x247bed[_0x66fe('0x2e')]=qs[_0x66fe('0x2f')](_0x31f729[_0x66fe('0x27')][_0x66fe('0x2f')]);_0x247bed[_0x66fe('0x30')]=qs[_0x66fe('0x28')](_[_0x66fe('0x31')](_0x31f729[_0x66fe('0x27')],_0x463910[_0x66fe('0x28')]));if(_0x31f729['query'][_0x66fe('0x32')]){_0x247bed[_0x66fe('0x30')]=_['merge'](_0x247bed[_0x66fe('0x30')],{'$or':_[_0x66fe('0x22')](_0x247bed[_0x66fe('0x2a')],function(_0x3f52d3){var _0x3e847f={};_0x3e847f[_0x3f52d3]={'$like':'%'+_0x31f729[_0x66fe('0x27')][_0x66fe('0x32')]+'%'};return _0x3e847f;})});}_0x247bed=_[_0x66fe('0x36')]({},_0x247bed,_0x31f729[_0x66fe('0x3c')]);return _0x2d2638[_0x66fe('0x46')](_0x247bed);}})['then'](function(_0x3e7a03){if(_0x3e7a03){_0x1b8fbb=_0x3e7a03[_0x66fe('0x2c')];if(!_0x31f729['query'][_0x66fe('0x44')](_0x66fe('0x2d'))){_0x247bed[_0x66fe('0x17')]=qs[_0x66fe('0x17')](_0x31f729[_0x66fe('0x27')][_0x66fe('0x17')]);_0x247bed[_0x66fe('0x16')]=qs[_0x66fe('0x16')](_0x31f729['query'][_0x66fe('0x16')]);}return _0x2d2638[_0x66fe('0x46')](_0x247bed);}})['then'](function(_0x3bfda7){if(_0x3bfda7){return _0x3bfda7?{'count':_0x1b8fbb,'rows':_0x3bfda7}:null;}})[_0x66fe('0x1c')](respondWithResult(_0x292644,null))[_0x66fe('0x39')](handleError(_0x292644,null));};exports[_0x66fe('0x47')]=function(_0x2524ff,_0x5a51af,_0x488c07){var _0x8670c4={};var _0x200e26={};var _0x44bd56;var _0x5d7a2e;return db[_0x66fe('0x23')][_0x66fe('0x41')]({'where':{'id':_0x2524ff['params']['id']}})['then'](handleEntityNotFound(_0x5a51af,null))[_0x66fe('0x1c')](function(_0x592775){if(_0x592775){_0x44bd56=_0x592775;_0x200e26[_0x66fe('0x26')]=_[_0x66fe('0x42')](db['Tag']['rawAttributes']);_0x200e26[_0x66fe('0x27')]=_[_0x66fe('0x42')](_0x2524ff[_0x66fe('0x27')]);_0x200e26[_0x66fe('0x28')]=_[_0x66fe('0x29')](_0x200e26[_0x66fe('0x26')],_0x200e26[_0x66fe('0x27')]);_0x8670c4[_0x66fe('0x2a')]=_[_0x66fe('0x29')](_0x200e26[_0x66fe('0x26')],qs['fields'](_0x2524ff[_0x66fe('0x27')][_0x66fe('0x2b')]));_0x8670c4['attributes']=_0x8670c4['attributes'][_0x66fe('0x2c')]?_0x8670c4['attributes']:_0x200e26[_0x66fe('0x26')];_0x8670c4['order']=qs['sort'](_0x2524ff[_0x66fe('0x27')][_0x66fe('0x2f')]);_0x8670c4[_0x66fe('0x30')]=qs['filters'](_[_0x66fe('0x31')](_0x2524ff['query'],_0x200e26[_0x66fe('0x28')]));if(_0x2524ff[_0x66fe('0x27')]['filter']){_0x8670c4[_0x66fe('0x30')]=_[_0x66fe('0x36')](_0x8670c4[_0x66fe('0x30')],{'$or':_[_0x66fe('0x22')](_0x8670c4[_0x66fe('0x2a')],function(_0x2749fc){var _0x366fe9={};_0x366fe9[_0x2749fc]={'$like':'%'+_0x2524ff[_0x66fe('0x27')]['filter']+'%'};return _0x366fe9;})});}_0x8670c4=_[_0x66fe('0x36')]({},_0x8670c4,_0x2524ff[_0x66fe('0x3c')]);return _0x44bd56['getTags'](_0x8670c4);}})[_0x66fe('0x1c')](function(_0x2ac431){if(_0x2ac431){_0x5d7a2e=_0x2ac431['length'];if(!_0x2524ff['query']['hasOwnProperty'](_0x66fe('0x2d'))){_0x8670c4[_0x66fe('0x17')]=qs[_0x66fe('0x17')](_0x2524ff[_0x66fe('0x27')][_0x66fe('0x17')]);_0x8670c4[_0x66fe('0x16')]=qs[_0x66fe('0x16')](_0x2524ff['query'][_0x66fe('0x16')]);}return _0x44bd56[_0x66fe('0x47')](_0x8670c4);}})['then'](function(_0xd0ee15){if(_0xd0ee15){return _0xd0ee15?{'count':_0x5d7a2e,'rows':_0xd0ee15}:null;}})[_0x66fe('0x1c')](respondWithResult(_0x5a51af,null))[_0x66fe('0x39')](handleError(_0x5a51af,null));};exports[_0x66fe('0x48')]=function(_0x281832,_0x71f489,_0x5b6887){if(_0x281832[_0x66fe('0x3f')]['id']){delete _0x281832['body']['id'];}return db[_0x66fe('0x23')][_0x66fe('0x41')]({'where':{'id':_0x281832[_0x66fe('0x3b')]['id']}})[_0x66fe('0x1c')](handleEntityNotFound(_0x71f489,null))[_0x66fe('0x1c')](function(_0x52e2be){if(_0x52e2be){return _0x52e2be['setTags'](_0x281832[_0x66fe('0x3f')][_0x66fe('0x49')]||[]);}return null;})['then'](respondWithResult(_0x71f489,null))[_0x66fe('0x39')](handleError(_0x71f489,null));}; \ No newline at end of file +var _0x1a1f=['findAll','catch','show','params','intersection','include','find','create','body','getFields','findOne','ZendeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','name','map','ZendeskConfiguration','rawAttributes','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x1a1f,0xb5));var _0xf1a1=function(_0x3a65f5,_0x30e21f){_0x3a65f5=_0x3a65f5-0x0;var _0xd94943=_0x1a1f[_0x3a65f5];return _0xd94943;};'use strict';var emlformat=require(_0xf1a1('0x0'));var rimraf=require(_0xf1a1('0x1'));var zipdir=require(_0xf1a1('0x2'));var jsonpatch=require(_0xf1a1('0x3'));var rp=require(_0xf1a1('0x4'));var moment=require(_0xf1a1('0x5'));var BPromise=require(_0xf1a1('0x6'));var Mustache=require(_0xf1a1('0x7'));var util=require(_0xf1a1('0x8'));var path=require(_0xf1a1('0x9'));var sox=require(_0xf1a1('0xa'));var csv=require(_0xf1a1('0xb'));var ejs=require(_0xf1a1('0xc'));var fs=require('fs');var fs_extra=require(_0xf1a1('0xd'));var _=require(_0xf1a1('0xe'));var squel=require(_0xf1a1('0xf'));var crypto=require(_0xf1a1('0x10'));var jsforce=require(_0xf1a1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xf1a1('0xb'));var querystring=require('querystring');var Papa=require(_0xf1a1('0x12'));var Redis=require(_0xf1a1('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1a1('0x14'));var logger=require(_0xf1a1('0x15'))('api');var utils=require(_0xf1a1('0x16'));var config=require(_0xf1a1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1a1('0x18'))['db'];function respondWithStatusCode(_0x52c574,_0x160e82){_0x160e82=_0x160e82||0xcc;return function(_0x5a91f9){if(_0x5a91f9){return _0x52c574[_0xf1a1('0x19')](_0x160e82);}return _0x52c574['status'](_0x160e82)[_0xf1a1('0x1a')]();};}function respondWithResult(_0x1160ba,_0x32fc0b){_0x32fc0b=_0x32fc0b||0xc8;return function(_0x4d234e){if(_0x4d234e){return _0x1160ba[_0xf1a1('0x1b')](_0x32fc0b)[_0xf1a1('0x1c')](_0x4d234e);}};}function respondWithFilteredResult(_0x2101af,_0xca10e8){return function(_0x3fb2bc){if(_0x3fb2bc){var _0x4a91d8=typeof _0xca10e8[_0xf1a1('0x1d')]===_0xf1a1('0x1e')&&typeof _0xca10e8['limit']===_0xf1a1('0x1e');var _0x363ae9=_0x3fb2bc[_0xf1a1('0x1f')];var _0x15b988=_0x4a91d8?0x0:_0xca10e8[_0xf1a1('0x1d')];var _0x110537=_0x4a91d8?_0x3fb2bc[_0xf1a1('0x1f')]:_0xca10e8[_0xf1a1('0x1d')]+_0xca10e8['limit'];var _0x70bca;if(_0x110537>=_0x363ae9){_0x110537=_0x363ae9;_0x70bca=0xc8;}else{_0x70bca=0xce;}_0x2101af['status'](_0x70bca);return _0x2101af[_0xf1a1('0x20')](_0xf1a1('0x21'),_0x15b988+'-'+_0x110537+'/'+_0x363ae9)['json'](_0x3fb2bc);}return null;};}function patchUpdates(_0x32845a){return function(_0x481b9e){try{jsonpatch['apply'](_0x481b9e,_0x32845a,!![]);}catch(_0x48db8a){return BPromise[_0xf1a1('0x22')](_0x48db8a);}return _0x481b9e[_0xf1a1('0x23')]();};}function saveUpdates(_0x3c2302,_0x52079b){return function(_0x459d81){if(_0x459d81){return _0x459d81['update'](_0x3c2302)[_0xf1a1('0x24')](function(_0x7541a7){return _0x7541a7;});}return null;};}function removeEntity(_0x245cf1,_0x30ed65){return function(_0x5e255d){if(_0x5e255d){return _0x5e255d[_0xf1a1('0x25')]()['then'](function(){_0x245cf1[_0xf1a1('0x1b')](0xcc)[_0xf1a1('0x1a')]();});}};}function handleEntityNotFound(_0x566105,_0x452455){return function(_0x520181){if(!_0x520181){_0x566105[_0xf1a1('0x19')](0x194);}return _0x520181;};}function handleError(_0x570076,_0x3d22b5){_0x3d22b5=_0x3d22b5||0x1f4;return function(_0x509560){logger['error'](_0x509560['stack']);if(_0x509560[_0xf1a1('0x26')]){delete _0x509560[_0xf1a1('0x26')];}_0x570076[_0xf1a1('0x1b')](_0x3d22b5)['send'](_0x509560);};}exports['index']=function(_0x58c1d6,_0x3721a7){var _0x399cf9={},_0x5b8b13={},_0x2e38a1={'count':0x0,'rows':[]};var _0x44396e=_[_0xf1a1('0x27')](db[_0xf1a1('0x28')][_0xf1a1('0x29')],function(_0x39b226){return{'name':_0x39b226['fieldName'],'type':_0x39b226[_0xf1a1('0x2a')][_0xf1a1('0x2b')]};});_0x5b8b13[_0xf1a1('0x2c')]=_[_0xf1a1('0x27')](_0x44396e,_0xf1a1('0x26'));_0x5b8b13['query']=_[_0xf1a1('0x2d')](_0x58c1d6[_0xf1a1('0x2e')]);_0x5b8b13['filters']=_['intersection'](_0x5b8b13[_0xf1a1('0x2c')],_0x5b8b13[_0xf1a1('0x2e')]);_0x399cf9[_0xf1a1('0x2f')]=_['intersection'](_0x5b8b13[_0xf1a1('0x2c')],qs[_0xf1a1('0x30')](_0x58c1d6['query'][_0xf1a1('0x30')]));_0x399cf9[_0xf1a1('0x2f')]=_0x399cf9[_0xf1a1('0x2f')]['length']?_0x399cf9['attributes']:_0x5b8b13[_0xf1a1('0x2c')];if(!_0x58c1d6[_0xf1a1('0x2e')][_0xf1a1('0x31')](_0xf1a1('0x32'))){_0x399cf9[_0xf1a1('0x33')]=qs[_0xf1a1('0x33')](_0x58c1d6[_0xf1a1('0x2e')]['limit']);_0x399cf9['offset']=qs[_0xf1a1('0x1d')](_0x58c1d6['query'][_0xf1a1('0x1d')]);}_0x399cf9[_0xf1a1('0x34')]=qs[_0xf1a1('0x35')](_0x58c1d6[_0xf1a1('0x2e')]['sort']);_0x399cf9[_0xf1a1('0x36')]=qs['filters'](_[_0xf1a1('0x37')](_0x58c1d6[_0xf1a1('0x2e')],_0x5b8b13[_0xf1a1('0x38')]),_0x44396e);if(_0x58c1d6[_0xf1a1('0x2e')]['filter']){_0x399cf9['where']=_[_0xf1a1('0x39')](_0x399cf9[_0xf1a1('0x36')],{'$or':_[_0xf1a1('0x27')](_0x44396e,function(_0x177998){if(_0x177998[_0xf1a1('0x2a')]!==_0xf1a1('0x3a')){var _0x4de420={};_0x4de420[_0x177998[_0xf1a1('0x26')]]={'$like':'%'+_0x58c1d6[_0xf1a1('0x2e')][_0xf1a1('0x3b')]+'%'};return _0x4de420;}})});}_0x399cf9=_[_0xf1a1('0x39')]({},_0x399cf9,_0x58c1d6[_0xf1a1('0x3c')]);var _0x36a36f={'where':_0x399cf9['where']};return db[_0xf1a1('0x28')]['count'](_0x36a36f)[_0xf1a1('0x24')](function(_0x4ab2a5){_0x2e38a1[_0xf1a1('0x1f')]=_0x4ab2a5;if(_0x58c1d6[_0xf1a1('0x2e')][_0xf1a1('0x3d')]){_0x399cf9['include']=[{'all':!![]}];}return db[_0xf1a1('0x28')][_0xf1a1('0x3e')](_0x399cf9);})[_0xf1a1('0x24')](function(_0x2afaf){_0x2e38a1['rows']=_0x2afaf;return _0x2e38a1;})[_0xf1a1('0x24')](respondWithFilteredResult(_0x3721a7,_0x399cf9))[_0xf1a1('0x3f')](handleError(_0x3721a7,null));};exports[_0xf1a1('0x40')]=function(_0x4529b5,_0x7c475a){var _0x162b29={'raw':![],'where':{'id':_0x4529b5[_0xf1a1('0x41')]['id']}},_0x2e35d5={};_0x2e35d5['model']=_['keys'](db[_0xf1a1('0x28')]['rawAttributes']);_0x2e35d5[_0xf1a1('0x2e')]=_[_0xf1a1('0x2d')](_0x4529b5[_0xf1a1('0x2e')]);_0x2e35d5[_0xf1a1('0x38')]=_[_0xf1a1('0x42')](_0x2e35d5[_0xf1a1('0x2c')],_0x2e35d5[_0xf1a1('0x2e')]);_0x162b29[_0xf1a1('0x2f')]=_[_0xf1a1('0x42')](_0x2e35d5[_0xf1a1('0x2c')],qs[_0xf1a1('0x30')](_0x4529b5[_0xf1a1('0x2e')][_0xf1a1('0x30')]));_0x162b29[_0xf1a1('0x2f')]=_0x162b29[_0xf1a1('0x2f')]['length']?_0x162b29[_0xf1a1('0x2f')]:_0x2e35d5['model'];if(_0x4529b5[_0xf1a1('0x2e')]['includeAll']){_0x162b29[_0xf1a1('0x43')]=[{'all':!![]}];}_0x162b29=_[_0xf1a1('0x39')]({},_0x162b29,_0x4529b5[_0xf1a1('0x3c')]);return db['ZendeskConfiguration'][_0xf1a1('0x44')](_0x162b29)[_0xf1a1('0x24')](handleEntityNotFound(_0x7c475a,null))['then'](respondWithResult(_0x7c475a,null))[_0xf1a1('0x3f')](handleError(_0x7c475a,null));};exports[_0xf1a1('0x45')]=function(_0x499866,_0x20df92){return db[_0xf1a1('0x28')][_0xf1a1('0x45')](_0x499866['body'],{})[_0xf1a1('0x24')](respondWithResult(_0x20df92,0xc9))['catch'](handleError(_0x20df92,null));};exports['update']=function(_0x18d3af,_0xbce0fe){if(_0x18d3af[_0xf1a1('0x46')]['id']){delete _0x18d3af[_0xf1a1('0x46')]['id'];}return db[_0xf1a1('0x28')][_0xf1a1('0x44')]({'where':{'id':_0x18d3af[_0xf1a1('0x41')]['id']}})[_0xf1a1('0x24')](handleEntityNotFound(_0xbce0fe,null))[_0xf1a1('0x24')](saveUpdates(_0x18d3af[_0xf1a1('0x46')],null))['then'](respondWithResult(_0xbce0fe,null))[_0xf1a1('0x3f')](handleError(_0xbce0fe,null));};exports[_0xf1a1('0x25')]=function(_0x427c5a,_0x5a76bd){return db[_0xf1a1('0x28')]['find']({'where':{'id':_0x427c5a[_0xf1a1('0x41')]['id']}})[_0xf1a1('0x24')](handleEntityNotFound(_0x5a76bd,null))[_0xf1a1('0x24')](removeEntity(_0x5a76bd,null))[_0xf1a1('0x3f')](handleError(_0x5a76bd,null));};exports[_0xf1a1('0x47')]=function(_0xe2c02a,_0x260be2,_0x5ac2fd){var _0x2e1fe8={};var _0x1229ad={};var _0x532207;var _0x1a9659;return db[_0xf1a1('0x28')][_0xf1a1('0x48')]({'where':{'id':_0xe2c02a[_0xf1a1('0x41')]['id']}})[_0xf1a1('0x24')](handleEntityNotFound(_0x260be2,null))['then'](function(_0x2292b9){if(_0x2292b9){_0x532207=_0x2292b9;_0x1229ad[_0xf1a1('0x2c')]=_[_0xf1a1('0x2d')](db[_0xf1a1('0x49')]['rawAttributes']);_0x1229ad[_0xf1a1('0x2e')]=_['keys'](_0xe2c02a[_0xf1a1('0x2e')]);_0x1229ad[_0xf1a1('0x38')]=_[_0xf1a1('0x42')](_0x1229ad[_0xf1a1('0x2c')],_0x1229ad[_0xf1a1('0x2e')]);_0x2e1fe8['attributes']=_[_0xf1a1('0x42')](_0x1229ad[_0xf1a1('0x2c')],qs[_0xf1a1('0x30')](_0xe2c02a[_0xf1a1('0x2e')]['fields']));_0x2e1fe8[_0xf1a1('0x2f')]=_0x2e1fe8[_0xf1a1('0x2f')]['length']?_0x2e1fe8[_0xf1a1('0x2f')]:_0x1229ad[_0xf1a1('0x2c')];_0x2e1fe8[_0xf1a1('0x34')]=qs[_0xf1a1('0x35')](_0xe2c02a['query'][_0xf1a1('0x35')]);_0x2e1fe8[_0xf1a1('0x36')]=qs[_0xf1a1('0x38')](_['pick'](_0xe2c02a[_0xf1a1('0x2e')],_0x1229ad['filters']));if(_0xe2c02a[_0xf1a1('0x2e')]['filter']){_0x2e1fe8[_0xf1a1('0x36')]=_[_0xf1a1('0x39')](_0x2e1fe8[_0xf1a1('0x36')],{'$or':_[_0xf1a1('0x27')](_0x2e1fe8[_0xf1a1('0x2f')],function(_0x41fb93){var _0x239152={};_0x239152[_0x41fb93]={'$like':'%'+_0xe2c02a[_0xf1a1('0x2e')][_0xf1a1('0x3b')]+'%'};return _0x239152;})});}_0x2e1fe8=_[_0xf1a1('0x39')]({},_0x2e1fe8,_0xe2c02a[_0xf1a1('0x3c')]);return _0x532207['getFields'](_0x2e1fe8);}})['then'](function(_0x512980){if(_0x512980){_0x1a9659=_0x512980['length'];if(!_0xe2c02a[_0xf1a1('0x2e')][_0xf1a1('0x31')](_0xf1a1('0x32'))){_0x2e1fe8[_0xf1a1('0x33')]=qs['limit'](_0xe2c02a[_0xf1a1('0x2e')][_0xf1a1('0x33')]);_0x2e1fe8[_0xf1a1('0x1d')]=qs['offset'](_0xe2c02a[_0xf1a1('0x2e')][_0xf1a1('0x1d')]);}return _0x532207[_0xf1a1('0x47')](_0x2e1fe8);}})[_0xf1a1('0x24')](function(_0xf059a){if(_0xf059a){return _0xf059a?{'count':_0x1a9659,'rows':_0xf059a}:null;}})[_0xf1a1('0x24')](respondWithResult(_0x260be2,null))[_0xf1a1('0x3f')](handleError(_0x260be2,null));};exports['getSubjects']=function(_0xe51f70,_0x1cfe32,_0x589bc9){var _0x24c396={};var _0x180cab={};var _0x36b59d;var _0x501258;return db['ZendeskConfiguration'][_0xf1a1('0x48')]({'where':{'id':_0xe51f70[_0xf1a1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1cfe32,null))[_0xf1a1('0x24')](function(_0x26332e){if(_0x26332e){_0x36b59d=_0x26332e;_0x180cab['model']=_[_0xf1a1('0x2d')](db['ZendeskField'][_0xf1a1('0x29')]);_0x180cab[_0xf1a1('0x2e')]=_[_0xf1a1('0x2d')](_0xe51f70['query']);_0x180cab['filters']=_[_0xf1a1('0x42')](_0x180cab['model'],_0x180cab['query']);_0x24c396[_0xf1a1('0x2f')]=_[_0xf1a1('0x42')](_0x180cab[_0xf1a1('0x2c')],qs['fields'](_0xe51f70['query'][_0xf1a1('0x30')]));_0x24c396[_0xf1a1('0x2f')]=_0x24c396['attributes'][_0xf1a1('0x4a')]?_0x24c396[_0xf1a1('0x2f')]:_0x180cab['model'];_0x24c396[_0xf1a1('0x34')]=qs[_0xf1a1('0x35')](_0xe51f70[_0xf1a1('0x2e')][_0xf1a1('0x35')]);_0x24c396['where']=qs['filters'](_['pick'](_0xe51f70[_0xf1a1('0x2e')],_0x180cab[_0xf1a1('0x38')]));if(_0xe51f70[_0xf1a1('0x2e')][_0xf1a1('0x3b')]){_0x24c396[_0xf1a1('0x36')]=_[_0xf1a1('0x39')](_0x24c396[_0xf1a1('0x36')],{'$or':_['map'](_0x24c396[_0xf1a1('0x2f')],function(_0x2edab5){var _0x20bbdd={};_0x20bbdd[_0x2edab5]={'$like':'%'+_0xe51f70[_0xf1a1('0x2e')]['filter']+'%'};return _0x20bbdd;})});}_0x24c396=_[_0xf1a1('0x39')]({},_0x24c396,_0xe51f70[_0xf1a1('0x3c')]);return _0x36b59d['getSubjects'](_0x24c396);}})['then'](function(_0x33b243){if(_0x33b243){_0x501258=_0x33b243['length'];if(!_0xe51f70['query'][_0xf1a1('0x31')](_0xf1a1('0x32'))){_0x24c396[_0xf1a1('0x33')]=qs[_0xf1a1('0x33')](_0xe51f70[_0xf1a1('0x2e')][_0xf1a1('0x33')]);_0x24c396[_0xf1a1('0x1d')]=qs[_0xf1a1('0x1d')](_0xe51f70[_0xf1a1('0x2e')][_0xf1a1('0x1d')]);}return _0x36b59d[_0xf1a1('0x4b')](_0x24c396);}})[_0xf1a1('0x24')](function(_0x40100a){if(_0x40100a){return _0x40100a?{'count':_0x501258,'rows':_0x40100a}:null;}})[_0xf1a1('0x24')](respondWithResult(_0x1cfe32,null))[_0xf1a1('0x3f')](handleError(_0x1cfe32,null));};exports[_0xf1a1('0x4c')]=function(_0x41cf82,_0x399623,_0xe0ea52){var _0x5ecd6a={};var _0x487456={};var _0x4fa2f4;var _0x1ba013;return db[_0xf1a1('0x28')]['findOne']({'where':{'id':_0x41cf82[_0xf1a1('0x41')]['id']}})[_0xf1a1('0x24')](handleEntityNotFound(_0x399623,null))[_0xf1a1('0x24')](function(_0x5b05a4){if(_0x5b05a4){_0x4fa2f4=_0x5b05a4;_0x487456[_0xf1a1('0x2c')]=_[_0xf1a1('0x2d')](db[_0xf1a1('0x49')][_0xf1a1('0x29')]);_0x487456[_0xf1a1('0x2e')]=_[_0xf1a1('0x2d')](_0x41cf82[_0xf1a1('0x2e')]);_0x487456[_0xf1a1('0x38')]=_['intersection'](_0x487456['model'],_0x487456[_0xf1a1('0x2e')]);_0x5ecd6a['attributes']=_['intersection'](_0x487456[_0xf1a1('0x2c')],qs[_0xf1a1('0x30')](_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x30')]));_0x5ecd6a['attributes']=_0x5ecd6a[_0xf1a1('0x2f')][_0xf1a1('0x4a')]?_0x5ecd6a[_0xf1a1('0x2f')]:_0x487456[_0xf1a1('0x2c')];_0x5ecd6a[_0xf1a1('0x34')]=qs[_0xf1a1('0x35')](_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x35')]);_0x5ecd6a['where']=qs[_0xf1a1('0x38')](_['pick'](_0x41cf82[_0xf1a1('0x2e')],_0x487456[_0xf1a1('0x38')]));if(_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x3b')]){_0x5ecd6a[_0xf1a1('0x36')]=_[_0xf1a1('0x39')](_0x5ecd6a[_0xf1a1('0x36')],{'$or':_[_0xf1a1('0x27')](_0x5ecd6a[_0xf1a1('0x2f')],function(_0x996b7d){var _0x17b00f={};_0x17b00f[_0x996b7d]={'$like':'%'+_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x3b')]+'%'};return _0x17b00f;})});}_0x5ecd6a=_['merge']({},_0x5ecd6a,_0x41cf82[_0xf1a1('0x3c')]);return _0x4fa2f4[_0xf1a1('0x4c')](_0x5ecd6a);}})['then'](function(_0x3360a1){if(_0x3360a1){_0x1ba013=_0x3360a1['length'];if(!_0x41cf82['query'][_0xf1a1('0x31')](_0xf1a1('0x32'))){_0x5ecd6a[_0xf1a1('0x33')]=qs[_0xf1a1('0x33')](_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x33')]);_0x5ecd6a[_0xf1a1('0x1d')]=qs['offset'](_0x41cf82[_0xf1a1('0x2e')][_0xf1a1('0x1d')]);}return _0x4fa2f4[_0xf1a1('0x4c')](_0x5ecd6a);}})[_0xf1a1('0x24')](function(_0x3ccdd9){if(_0x3ccdd9){return _0x3ccdd9?{'count':_0x1ba013,'rows':_0x3ccdd9}:null;}})['then'](respondWithResult(_0x399623,null))['catch'](handleError(_0x399623,null));};exports[_0xf1a1('0x4d')]=function(_0x438819,_0x38049b,_0x23aa61){var _0x23f84c={};var _0x48acae={};var _0x20e3b4;var _0x44a3cb;return db['ZendeskConfiguration'][_0xf1a1('0x48')]({'where':{'id':_0x438819[_0xf1a1('0x41')]['id']}})['then'](handleEntityNotFound(_0x38049b,null))[_0xf1a1('0x24')](function(_0x535193){if(_0x535193){_0x20e3b4=_0x535193;_0x48acae[_0xf1a1('0x2c')]=_['keys'](db[_0xf1a1('0x4e')][_0xf1a1('0x29')]);_0x48acae[_0xf1a1('0x2e')]=_[_0xf1a1('0x2d')](_0x438819[_0xf1a1('0x2e')]);_0x48acae[_0xf1a1('0x38')]=_[_0xf1a1('0x42')](_0x48acae['model'],_0x48acae[_0xf1a1('0x2e')]);_0x23f84c[_0xf1a1('0x2f')]=_['intersection'](_0x48acae[_0xf1a1('0x2c')],qs[_0xf1a1('0x30')](_0x438819[_0xf1a1('0x2e')][_0xf1a1('0x30')]));_0x23f84c['attributes']=_0x23f84c[_0xf1a1('0x2f')][_0xf1a1('0x4a')]?_0x23f84c[_0xf1a1('0x2f')]:_0x48acae[_0xf1a1('0x2c')];_0x23f84c[_0xf1a1('0x34')]=qs[_0xf1a1('0x35')](_0x438819[_0xf1a1('0x2e')][_0xf1a1('0x35')]);_0x23f84c[_0xf1a1('0x36')]=qs[_0xf1a1('0x38')](_['pick'](_0x438819[_0xf1a1('0x2e')],_0x48acae['filters']));if(_0x438819['query'][_0xf1a1('0x3b')]){_0x23f84c[_0xf1a1('0x36')]=_[_0xf1a1('0x39')](_0x23f84c[_0xf1a1('0x36')],{'$or':_[_0xf1a1('0x27')](_0x23f84c['attributes'],function(_0x29042d){var _0x4e9bd7={};_0x4e9bd7[_0x29042d]={'$like':'%'+_0x438819[_0xf1a1('0x2e')][_0xf1a1('0x3b')]+'%'};return _0x4e9bd7;})});}_0x23f84c=_[_0xf1a1('0x39')]({},_0x23f84c,_0x438819['options']);return _0x20e3b4[_0xf1a1('0x4d')](_0x23f84c);}})[_0xf1a1('0x24')](function(_0x150d19){if(_0x150d19){_0x44a3cb=_0x150d19['length'];if(!_0x438819['query']['hasOwnProperty'](_0xf1a1('0x32'))){_0x23f84c[_0xf1a1('0x33')]=qs[_0xf1a1('0x33')](_0x438819[_0xf1a1('0x2e')][_0xf1a1('0x33')]);_0x23f84c['offset']=qs[_0xf1a1('0x1d')](_0x438819['query'][_0xf1a1('0x1d')]);}return _0x20e3b4['getTags'](_0x23f84c);}})[_0xf1a1('0x24')](function(_0x2f6386){if(_0x2f6386){return _0x2f6386?{'count':_0x44a3cb,'rows':_0x2f6386}:null;}})[_0xf1a1('0x24')](respondWithResult(_0x38049b,null))[_0xf1a1('0x3f')](handleError(_0x38049b,null));};exports['setTags']=function(_0x3e05ff,_0x1dfcb3,_0x58edb0){if(_0x3e05ff[_0xf1a1('0x46')]['id']){delete _0x3e05ff[_0xf1a1('0x46')]['id'];}return db['ZendeskConfiguration'][_0xf1a1('0x48')]({'where':{'id':_0x3e05ff[_0xf1a1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dfcb3,null))[_0xf1a1('0x24')](function(_0x230d78){if(_0x230d78){return _0x230d78[_0xf1a1('0x4f')](_0x3e05ff[_0xf1a1('0x46')][_0xf1a1('0x50')]||[]);}return null;})['then'](respondWithResult(_0x1dfcb3,null))[_0xf1a1('0x3f')](handleError(_0x1dfcb3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 50c6b1b..d3ce029 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 _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x292870,_0xd7e91d){var _0x220914=function(_0x509785){while(--_0x509785){_0x292870['push'](_0x292870['shift']());}};_0x220914(++_0xd7e91d);}(_0x93e9,0xcc));var _0x993e=function(_0x551b13,_0x44ebc3){_0x551b13=_0x551b13-0x0;var _0x1e1e1a=_0x93e9[_0x551b13];return _0x1e1e1a;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0598=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','exports'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x0598,0x92));var _0x8059=function(_0x2a1be1,_0x55e089){_0x2a1be1=_0x2a1be1-0x0;var _0x27df2b=_0x0598[_0x2a1be1];return _0x27df2b;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'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 10204bc..6041a83 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 _0xef7e=['rpc','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x463df1,_0x2173bb){var _0x4999d6=function(_0x13832d){while(--_0x13832d){_0x463df1['push'](_0x463df1['shift']());}};_0x4999d6(++_0x2173bb);}(_0xef7e,0x1db));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeef7('0x0'));var util=require(_0xeef7('0x1'));var moment=require(_0xeef7('0x2'));var BPromise=require(_0xeef7('0x3'));var rs=require(_0xeef7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeef7('0x5'))['db'];var utils=require(_0xeef7('0x6'));var logger=require(_0xeef7('0x7'))(_0xeef7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xeef7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17667c,_0x29a9c9,_0x43c902){return new BPromise(function(_0x5e540b,_0x265ea0){return client[_0xeef7('0xa')](_0x17667c,_0x43c902)[_0xeef7('0xb')](function(_0xe447f9){logger[_0xeef7('0xc')](_0xeef7('0xd'),_0x29a9c9,_0xeef7('0xe'));logger[_0xeef7('0xf')](_0xeef7('0x10'),_0x29a9c9,_0xeef7('0xe'),JSON[_0xeef7('0x11')](_0xe447f9));if(_0xe447f9['error']){if(_0xe447f9[_0xeef7('0x12')][_0xeef7('0x13')]===0x1f4){logger[_0xeef7('0x12')](_0xeef7('0xd'),_0x29a9c9,_0xe447f9[_0xeef7('0x12')][_0xeef7('0x14')]);return _0x265ea0(_0xe447f9[_0xeef7('0x12')]['message']);}logger[_0xeef7('0x12')](_0xeef7('0xd'),_0x29a9c9,_0xe447f9['error'][_0xeef7('0x14')]);return _0x5e540b(_0xe447f9['error']['message']);}else{logger[_0xeef7('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29a9c9,_0xeef7('0xe'));_0x5e540b(_0xe447f9[_0xeef7('0x15')][_0xeef7('0x14')]);}})[_0xeef7('0x16')](function(_0x2a1899){logger[_0xeef7('0x12')](_0xeef7('0xd'),_0x29a9c9,_0x2a1899);_0x265ea0(_0x2a1899);});});} \ No newline at end of file +var _0x0856=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x23a520,_0x1030d6){var _0x406bc5=function(_0x4bcf88){while(--_0x4bcf88){_0x23a520['push'](_0x23a520['shift']());}};_0x406bc5(++_0x1030d6);}(_0x0856,0x118));var _0x6085=function(_0x26e528,_0x52521a){_0x26e528=_0x26e528-0x0;var _0xcfc77c=_0x0856[_0x26e528];return _0xcfc77c;};'use strict';var _=require(_0x6085('0x0'));var util=require(_0x6085('0x1'));var moment=require(_0x6085('0x2'));var BPromise=require(_0x6085('0x3'));var rs=require(_0x6085('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6085('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6085('0x6'))(_0x6085('0x7'));var config=require(_0x6085('0x8'));var jayson=require(_0x6085('0x9'));var client=jayson[_0x6085('0xa')][_0x6085('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346071,_0x255d3d,_0x53946b){return new BPromise(function(_0x3185ca,_0x3b5478){return client[_0x6085('0xc')](_0x346071,_0x53946b)[_0x6085('0xd')](function(_0x49f66c){logger[_0x6085('0xe')](_0x6085('0xf'),_0x255d3d,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x255d3d,'request\x20sent',JSON[_0x6085('0x10')](_0x49f66c));if(_0x49f66c['error']){if(_0x49f66c['error']['code']===0x1f4){logger[_0x6085('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x255d3d,_0x49f66c[_0x6085('0x11')][_0x6085('0x12')]);return _0x3b5478(_0x49f66c['error'][_0x6085('0x12')]);}logger[_0x6085('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x255d3d,_0x49f66c[_0x6085('0x11')]['message']);return _0x3185ca(_0x49f66c[_0x6085('0x11')][_0x6085('0x12')]);}else{logger[_0x6085('0xe')](_0x6085('0xf'),_0x255d3d,_0x6085('0x13'));_0x3185ca(_0x49f66c[_0x6085('0x14')][_0x6085('0x12')]);}})[_0x6085('0x15')](function(_0x337872){logger[_0x6085('0x11')](_0x6085('0xf'),_0x255d3d,_0x337872);_0x3b5478(_0x337872);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2761c01..699bf7d 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 _0x1fbd=['show','create','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x280656,_0x1d69bf){var _0x152fff=function(_0x39fde){while(--_0x39fde){_0x280656['push'](_0x280656['shift']());}};_0x152fff(++_0x1d69bf);}(_0x1fbd,0xe5));var _0xd1fb=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x1fbd[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xd1fb('0x0'));var util=require(_0xd1fb('0x1'));var path=require(_0xd1fb('0x2'));var timeout=require(_0xd1fb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1fb('0x4'));var interaction=require(_0xd1fb('0x5'));var config=require('../../config/environment');var controller=require(_0xd1fb('0x6'));router[_0xd1fb('0x7')]('/',auth[_0xd1fb('0x8')](),controller[_0xd1fb('0x9')]);router[_0xd1fb('0x7')](_0xd1fb('0xa'),auth[_0xd1fb('0x8')](),controller[_0xd1fb('0xb')]);router['post']('/',auth[_0xd1fb('0x8')](),controller[_0xd1fb('0xc')]);router['put']('/:id',auth[_0xd1fb('0x8')](),controller['update']);router[_0xd1fb('0xd')](_0xd1fb('0xa'),auth[_0xd1fb('0x8')](),controller[_0xd1fb('0xe')]);module[_0xd1fb('0xf')]=router; \ No newline at end of file +var _0x4ca5=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','put','update','delete','destroy','exports'];(function(_0x1f3579,_0x11357d){var _0x4d6cec=function(_0x406a30){while(--_0x406a30){_0x1f3579['push'](_0x1f3579['shift']());}};_0x4d6cec(++_0x11357d);}(_0x4ca5,0x104));var _0x54ca=function(_0x2684e3,_0x30610a){_0x2684e3=_0x2684e3-0x0;var _0x532e9a=_0x4ca5[_0x2684e3];return _0x532e9a;};'use strict';var multer=require(_0x54ca('0x0'));var util=require(_0x54ca('0x1'));var path=require(_0x54ca('0x2'));var timeout=require('connect-timeout');var express=require(_0x54ca('0x3'));var router=express[_0x54ca('0x4')]();var fs_extra=require(_0x54ca('0x5'));var auth=require(_0x54ca('0x6'));var interaction=require(_0x54ca('0x7'));var config=require(_0x54ca('0x8'));var controller=require(_0x54ca('0x9'));router[_0x54ca('0xa')]('/',auth[_0x54ca('0xb')](),controller[_0x54ca('0xc')]);router[_0x54ca('0xa')]('/:id',auth[_0x54ca('0xb')](),controller[_0x54ca('0xd')]);router[_0x54ca('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x54ca('0xf')]('/:id',auth[_0x54ca('0xb')](),controller[_0x54ca('0x10')]);router[_0x54ca('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x54ca('0x12')]);module[_0x54ca('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b28680e..eda9980 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 _0xc977=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x26eace,_0x3df62c){var _0x8ff8b4=function(_0x100874){while(--_0x100874){_0x26eace['push'](_0x26eace['shift']());}};_0x8ff8b4(++_0x3df62c);}(_0xc977,0x1a3));var _0x7c97=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xc977[_0x4dbba7];return _0x43ef83;};'use strict';var Sequelize=require(_0x7c97('0x0'));module[_0x7c97('0x1')]={'type':{'type':Sequelize[_0x7c97('0x2')](_0x7c97('0x3'),_0x7c97('0x4'),'customVariable',_0x7c97('0x5'),_0x7c97('0x6')),'defaultValue':_0x7c97('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7c97('0x7')]},'keyType':{'type':Sequelize[_0x7c97('0x2')](_0x7c97('0x3'),'variable',_0x7c97('0x8'))},'keyContent':{'type':Sequelize[_0x7c97('0x7')]},'idField':{'type':Sequelize[_0x7c97('0x7')]},'nameField':{'type':Sequelize[_0x7c97('0x7')]},'customField':{'type':Sequelize[_0x7c97('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7c97('0x7')]}}; \ No newline at end of file +var _0x5113=['picklist','STRING','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x2c27cd,_0x5a89bd){var _0xebcbf0=function(_0x48fae0){while(--_0x48fae0){_0x2c27cd['push'](_0x2c27cd['shift']());}};_0xebcbf0(++_0x5a89bd);}(_0x5113,0xb2));var _0x3511=function(_0x7bc4a8,_0x19022a){_0x7bc4a8=_0x7bc4a8-0x0;var _0x4a13e9=_0x5113[_0x7bc4a8];return _0x4a13e9;};'use strict';var Sequelize=require(_0x3511('0x0'));module[_0x3511('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3511('0x2'),_0x3511('0x3'),_0x3511('0x4'),_0x3511('0x5'),_0x3511('0x6')),'defaultValue':_0x3511('0x2')},'content':{'type':Sequelize[_0x3511('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x3511('0x2'),_0x3511('0x3'),_0x3511('0x4'))},'keyContent':{'type':Sequelize[_0x3511('0x7')]},'idField':{'type':Sequelize[_0x3511('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3511('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8aaed56..488036a 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 _0x5374=['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','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','ZendeskField','includeAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5374,0xd6));var _0x4537=function(_0x4565cb,_0x3c447e){_0x4565cb=_0x4565cb-0x0;var _0x1ccd83=_0x5374[_0x4565cb];return _0x1ccd83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4537('0x0'));var zipdir=require(_0x4537('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4537('0x2'));var moment=require(_0x4537('0x3'));var BPromise=require(_0x4537('0x4'));var Mustache=require(_0x4537('0x5'));var util=require(_0x4537('0x6'));var path=require(_0x4537('0x7'));var sox=require(_0x4537('0x8'));var csv=require('to-csv');var ejs=require(_0x4537('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4537('0xa'));var squel=require(_0x4537('0xb'));var crypto=require(_0x4537('0xc'));var jsforce=require(_0x4537('0xd'));var deskjs=require(_0x4537('0xe'));var toCsv=require(_0x4537('0xf'));var querystring=require(_0x4537('0x10'));var Papa=require(_0x4537('0x11'));var Redis=require(_0x4537('0x12'));var authService=require(_0x4537('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4537('0x14'));var hardwareService=require(_0x4537('0x15'));var logger=require(_0x4537('0x16'))('api');var utils=require(_0x4537('0x17'));var config=require(_0x4537('0x18'));var licenseUtil=require(_0x4537('0x19'));var db=require(_0x4537('0x1a'))['db'];function respondWithStatusCode(_0x2d25d6,_0x4221a6){_0x4221a6=_0x4221a6||0xcc;return function(_0x39f360){if(_0x39f360){return _0x2d25d6['sendStatus'](_0x4221a6);}return _0x2d25d6[_0x4537('0x1b')](_0x4221a6)[_0x4537('0x1c')]();};}function respondWithResult(_0x300103,_0x3b5b4e){_0x3b5b4e=_0x3b5b4e||0xc8;return function(_0x5b7b7c){if(_0x5b7b7c){return _0x300103[_0x4537('0x1b')](_0x3b5b4e)[_0x4537('0x1d')](_0x5b7b7c);}};}function respondWithFilteredResult(_0x2958ce,_0x4518e7){return function(_0x3df8ce){if(_0x3df8ce){var _0x18e263=typeof _0x4518e7[_0x4537('0x1e')]==='undefined'&&typeof _0x4518e7[_0x4537('0x1f')]===_0x4537('0x20');var _0x23193f=_0x3df8ce['count'];var _0x5724a4=_0x18e263?0x0:_0x4518e7[_0x4537('0x1e')];var _0x4a9bb0=_0x18e263?_0x3df8ce[_0x4537('0x21')]:_0x4518e7[_0x4537('0x1e')]+_0x4518e7[_0x4537('0x1f')];var _0x1e097f;if(_0x4a9bb0>=_0x23193f){_0x4a9bb0=_0x23193f;_0x1e097f=0xc8;}else{_0x1e097f=0xce;}_0x2958ce['status'](_0x1e097f);return _0x2958ce[_0x4537('0x22')]('Content-Range',_0x5724a4+'-'+_0x4a9bb0+'/'+_0x23193f)[_0x4537('0x1d')](_0x3df8ce);}return null;};}function patchUpdates(_0x78c80e){return function(_0x3c5e86){try{jsonpatch['apply'](_0x3c5e86,_0x78c80e,!![]);}catch(_0x5f46b8){return BPromise[_0x4537('0x23')](_0x5f46b8);}return _0x3c5e86[_0x4537('0x24')]();};}function saveUpdates(_0x17356d,_0x5b2ab3){return function(_0x586d25){if(_0x586d25){return _0x586d25[_0x4537('0x25')](_0x17356d)[_0x4537('0x26')](function(_0x8b094a){return _0x8b094a;});}return null;};}function removeEntity(_0xb619e5,_0x40c7ab){return function(_0x442cf7){if(_0x442cf7){return _0x442cf7[_0x4537('0x27')]()[_0x4537('0x26')](function(){_0xb619e5[_0x4537('0x1b')](0xcc)[_0x4537('0x1c')]();});}};}function handleEntityNotFound(_0x21b70d,_0xc38a27){return function(_0x4fb2f3){if(!_0x4fb2f3){_0x21b70d['sendStatus'](0x194);}return _0x4fb2f3;};}function handleError(_0x2e83e4,_0x52670a){_0x52670a=_0x52670a||0x1f4;return function(_0x1ca0d6){logger[_0x4537('0x28')](_0x1ca0d6[_0x4537('0x29')]);if(_0x1ca0d6['name']){delete _0x1ca0d6['name'];}_0x2e83e4['status'](_0x52670a)[_0x4537('0x2a')](_0x1ca0d6);};}exports[_0x4537('0x2b')]=function(_0x2aaa2b,_0x487405){var _0xe9e363={},_0x42fe40={},_0x286921={'count':0x0,'rows':[]};var _0x18bfd4=_['map'](db['ZendeskField'][_0x4537('0x2c')],function(_0x3947bf){return{'name':_0x3947bf['fieldName'],'type':_0x3947bf['type'][_0x4537('0x2d')]};});_0x42fe40[_0x4537('0x2e')]=_[_0x4537('0x2f')](_0x18bfd4,_0x4537('0x30'));_0x42fe40[_0x4537('0x31')]=_[_0x4537('0x32')](_0x2aaa2b['query']);_0x42fe40[_0x4537('0x33')]=_[_0x4537('0x34')](_0x42fe40['model'],_0x42fe40[_0x4537('0x31')]);_0xe9e363[_0x4537('0x35')]=_[_0x4537('0x34')](_0x42fe40['model'],qs[_0x4537('0x36')](_0x2aaa2b[_0x4537('0x31')][_0x4537('0x36')]));_0xe9e363['attributes']=_0xe9e363[_0x4537('0x35')][_0x4537('0x37')]?_0xe9e363['attributes']:_0x42fe40['model'];if(!_0x2aaa2b[_0x4537('0x31')][_0x4537('0x38')](_0x4537('0x39'))){_0xe9e363[_0x4537('0x1f')]=qs[_0x4537('0x1f')](_0x2aaa2b['query'][_0x4537('0x1f')]);_0xe9e363[_0x4537('0x1e')]=qs[_0x4537('0x1e')](_0x2aaa2b[_0x4537('0x31')]['offset']);}_0xe9e363[_0x4537('0x3a')]=qs[_0x4537('0x3b')](_0x2aaa2b[_0x4537('0x31')][_0x4537('0x3b')]);_0xe9e363[_0x4537('0x3c')]=qs[_0x4537('0x33')](_['pick'](_0x2aaa2b['query'],_0x42fe40[_0x4537('0x33')]),_0x18bfd4);if(_0x2aaa2b['query'][_0x4537('0x3d')]){_0xe9e363[_0x4537('0x3c')]=_['merge'](_0xe9e363[_0x4537('0x3c')],{'$or':_[_0x4537('0x2f')](_0x18bfd4,function(_0x474781){if(_0x474781[_0x4537('0x3e')]!==_0x4537('0x3f')){var _0x9931fe={};_0x9931fe[_0x474781[_0x4537('0x30')]]={'$like':'%'+_0x2aaa2b['query'][_0x4537('0x3d')]+'%'};return _0x9931fe;}})});}_0xe9e363=_[_0x4537('0x40')]({},_0xe9e363,_0x2aaa2b[_0x4537('0x41')]);var _0x31449a={'where':_0xe9e363[_0x4537('0x3c')]};return db[_0x4537('0x42')][_0x4537('0x21')](_0x31449a)[_0x4537('0x26')](function(_0x2cef95){_0x286921[_0x4537('0x21')]=_0x2cef95;if(_0x2aaa2b[_0x4537('0x31')][_0x4537('0x43')]){_0xe9e363['include']=[{'all':!![]}];}return db[_0x4537('0x42')]['findAll'](_0xe9e363);})['then'](function(_0x5f4210){_0x286921[_0x4537('0x44')]=_0x5f4210;return _0x286921;})[_0x4537('0x26')](respondWithFilteredResult(_0x487405,_0xe9e363))[_0x4537('0x45')](handleError(_0x487405,null));};exports[_0x4537('0x46')]=function(_0x1688dd,_0x20f035){var _0x556a78={'raw':!![],'where':{'id':_0x1688dd['params']['id']}},_0x78d4ee={};_0x78d4ee[_0x4537('0x2e')]=_['keys'](db['ZendeskField'][_0x4537('0x2c')]);_0x78d4ee['query']=_[_0x4537('0x32')](_0x1688dd[_0x4537('0x31')]);_0x78d4ee[_0x4537('0x33')]=_['intersection'](_0x78d4ee[_0x4537('0x2e')],_0x78d4ee[_0x4537('0x31')]);_0x556a78[_0x4537('0x35')]=_[_0x4537('0x34')](_0x78d4ee[_0x4537('0x2e')],qs[_0x4537('0x36')](_0x1688dd['query']['fields']));_0x556a78[_0x4537('0x35')]=_0x556a78[_0x4537('0x35')]['length']?_0x556a78[_0x4537('0x35')]:_0x78d4ee[_0x4537('0x2e')];if(_0x1688dd[_0x4537('0x31')][_0x4537('0x43')]){_0x556a78['include']=[{'all':!![]}];}_0x556a78=_[_0x4537('0x40')]({},_0x556a78,_0x1688dd[_0x4537('0x41')]);return db[_0x4537('0x42')][_0x4537('0x47')](_0x556a78)[_0x4537('0x26')](handleEntityNotFound(_0x20f035,null))['then'](respondWithResult(_0x20f035,null))[_0x4537('0x45')](handleError(_0x20f035,null));};exports[_0x4537('0x48')]=function(_0x5e2f00,_0x45fd27){return db[_0x4537('0x42')]['create'](_0x5e2f00[_0x4537('0x49')],{})[_0x4537('0x26')](respondWithResult(_0x45fd27,0xc9))[_0x4537('0x45')](handleError(_0x45fd27,null));};exports['update']=function(_0x26dd7c,_0x67a49e){if(_0x26dd7c[_0x4537('0x49')]['id']){delete _0x26dd7c[_0x4537('0x49')]['id'];}return db[_0x4537('0x42')][_0x4537('0x47')]({'where':{'id':_0x26dd7c[_0x4537('0x4a')]['id']}})['then'](handleEntityNotFound(_0x67a49e,null))['then'](saveUpdates(_0x26dd7c[_0x4537('0x49')],null))[_0x4537('0x26')](respondWithResult(_0x67a49e,null))[_0x4537('0x45')](handleError(_0x67a49e,null));};exports[_0x4537('0x27')]=function(_0x19d38c,_0x399b38){return db[_0x4537('0x42')]['find']({'where':{'id':_0x19d38c[_0x4537('0x4a')]['id']}})[_0x4537('0x26')](handleEntityNotFound(_0x399b38,null))[_0x4537('0x26')](removeEntity(_0x399b38,null))[_0x4537('0x45')](handleError(_0x399b38,null));}; \ No newline at end of file +var _0x82f4=['filters','filter','merge','VIRTUAL','options','ZendeskField','include','findAll','rows','catch','params','keys','length','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','end','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','where','pick'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x82f4,0xed));var _0x482f=function(_0x3bbad5,_0x39f834){_0x3bbad5=_0x3bbad5-0x0;var _0x338d99=_0x82f4[_0x3bbad5];return _0x338d99;};'use strict';var emlformat=require(_0x482f('0x0'));var rimraf=require(_0x482f('0x1'));var zipdir=require(_0x482f('0x2'));var jsonpatch=require(_0x482f('0x3'));var rp=require(_0x482f('0x4'));var moment=require(_0x482f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x482f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x482f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x482f('0x8'));var _=require(_0x482f('0x9'));var squel=require('squel');var crypto=require(_0x482f('0xa'));var jsforce=require(_0x482f('0xb'));var deskjs=require(_0x482f('0xc'));var toCsv=require(_0x482f('0xd'));var querystring=require(_0x482f('0xe'));var Papa=require(_0x482f('0xf'));var Redis=require(_0x482f('0x10'));var authService=require(_0x482f('0x11'));var qs=require(_0x482f('0x12'));var as=require(_0x482f('0x13'));var hardwareService=require(_0x482f('0x14'));var logger=require(_0x482f('0x15'))(_0x482f('0x16'));var utils=require(_0x482f('0x17'));var config=require(_0x482f('0x18'));var licenseUtil=require(_0x482f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d9807,_0x16a04b){_0x16a04b=_0x16a04b||0xcc;return function(_0x296d99){if(_0x296d99){return _0x4d9807[_0x482f('0x1a')](_0x16a04b);}return _0x4d9807[_0x482f('0x1b')](_0x16a04b)['end']();};}function respondWithResult(_0x4a9714,_0x189f6c){_0x189f6c=_0x189f6c||0xc8;return function(_0x1de64a){if(_0x1de64a){return _0x4a9714[_0x482f('0x1b')](_0x189f6c)[_0x482f('0x1c')](_0x1de64a);}};}function respondWithFilteredResult(_0x3d1564,_0x477de9){return function(_0x2c7048){if(_0x2c7048){var _0x1343f8=typeof _0x477de9['offset']===_0x482f('0x1d')&&typeof _0x477de9[_0x482f('0x1e')]===_0x482f('0x1d');var _0x517986=_0x2c7048[_0x482f('0x1f')];var _0x1147e0=_0x1343f8?0x0:_0x477de9[_0x482f('0x20')];var _0x1e9182=_0x1343f8?_0x2c7048['count']:_0x477de9[_0x482f('0x20')]+_0x477de9['limit'];var _0x2c5980;if(_0x1e9182>=_0x517986){_0x1e9182=_0x517986;_0x2c5980=0xc8;}else{_0x2c5980=0xce;}_0x3d1564['status'](_0x2c5980);return _0x3d1564['set'](_0x482f('0x21'),_0x1147e0+'-'+_0x1e9182+'/'+_0x517986)[_0x482f('0x1c')](_0x2c7048);}return null;};}function patchUpdates(_0x4d5366){return function(_0x9b65ad){try{jsonpatch['apply'](_0x9b65ad,_0x4d5366,!![]);}catch(_0x28d09a){return BPromise[_0x482f('0x22')](_0x28d09a);}return _0x9b65ad[_0x482f('0x23')]();};}function saveUpdates(_0x2ecdde,_0x4c0d00){return function(_0x348b13){if(_0x348b13){return _0x348b13[_0x482f('0x24')](_0x2ecdde)[_0x482f('0x25')](function(_0x17cb7e){return _0x17cb7e;});}return null;};}function removeEntity(_0x3f3c38,_0x2364a6){return function(_0x11b6bb){if(_0x11b6bb){return _0x11b6bb['destroy']()[_0x482f('0x25')](function(){_0x3f3c38[_0x482f('0x1b')](0xcc)[_0x482f('0x26')]();});}};}function handleEntityNotFound(_0x571e2b,_0x316a38){return function(_0x5a21cf){if(!_0x5a21cf){_0x571e2b['sendStatus'](0x194);}return _0x5a21cf;};}function handleError(_0x121a1a,_0x1aea32){_0x1aea32=_0x1aea32||0x1f4;return function(_0x1affa5){logger['error'](_0x1affa5['stack']);if(_0x1affa5[_0x482f('0x27')]){delete _0x1affa5[_0x482f('0x27')];}_0x121a1a['status'](_0x1aea32)[_0x482f('0x28')](_0x1affa5);};}exports[_0x482f('0x29')]=function(_0x388cbb,_0x41583e){var _0x804982={},_0x355c04={},_0x2c9e3b={'count':0x0,'rows':[]};var _0x95e166=_[_0x482f('0x2a')](db['ZendeskField'][_0x482f('0x2b')],function(_0x1984d2){return{'name':_0x1984d2['fieldName'],'type':_0x1984d2[_0x482f('0x2c')][_0x482f('0x2d')]};});_0x355c04[_0x482f('0x2e')]=_[_0x482f('0x2a')](_0x95e166,'name');_0x355c04[_0x482f('0x2f')]=_['keys'](_0x388cbb[_0x482f('0x2f')]);_0x355c04['filters']=_[_0x482f('0x30')](_0x355c04['model'],_0x355c04[_0x482f('0x2f')]);_0x804982[_0x482f('0x31')]=_['intersection'](_0x355c04[_0x482f('0x2e')],qs[_0x482f('0x32')](_0x388cbb[_0x482f('0x2f')][_0x482f('0x32')]));_0x804982[_0x482f('0x31')]=_0x804982['attributes']['length']?_0x804982[_0x482f('0x31')]:_0x355c04[_0x482f('0x2e')];if(!_0x388cbb[_0x482f('0x2f')][_0x482f('0x33')]('nolimit')){_0x804982['limit']=qs[_0x482f('0x1e')](_0x388cbb[_0x482f('0x2f')][_0x482f('0x1e')]);_0x804982[_0x482f('0x20')]=qs[_0x482f('0x20')](_0x388cbb[_0x482f('0x2f')][_0x482f('0x20')]);}_0x804982[_0x482f('0x34')]=qs['sort'](_0x388cbb[_0x482f('0x2f')]['sort']);_0x804982[_0x482f('0x35')]=qs['filters'](_[_0x482f('0x36')](_0x388cbb[_0x482f('0x2f')],_0x355c04[_0x482f('0x37')]),_0x95e166);if(_0x388cbb[_0x482f('0x2f')][_0x482f('0x38')]){_0x804982[_0x482f('0x35')]=_[_0x482f('0x39')](_0x804982[_0x482f('0x35')],{'$or':_['map'](_0x95e166,function(_0x446e97){if(_0x446e97['type']!==_0x482f('0x3a')){var _0x42b7dd={};_0x42b7dd[_0x446e97['name']]={'$like':'%'+_0x388cbb[_0x482f('0x2f')][_0x482f('0x38')]+'%'};return _0x42b7dd;}})});}_0x804982=_[_0x482f('0x39')]({},_0x804982,_0x388cbb[_0x482f('0x3b')]);var _0x1091f7={'where':_0x804982['where']};return db[_0x482f('0x3c')]['count'](_0x1091f7)[_0x482f('0x25')](function(_0x2478bf){_0x2c9e3b[_0x482f('0x1f')]=_0x2478bf;if(_0x388cbb['query']['includeAll']){_0x804982[_0x482f('0x3d')]=[{'all':!![]}];}return db[_0x482f('0x3c')][_0x482f('0x3e')](_0x804982);})[_0x482f('0x25')](function(_0x14f3ec){_0x2c9e3b[_0x482f('0x3f')]=_0x14f3ec;return _0x2c9e3b;})[_0x482f('0x25')](respondWithFilteredResult(_0x41583e,_0x804982))[_0x482f('0x40')](handleError(_0x41583e,null));};exports['show']=function(_0x2d691e,_0x1e2601){var _0x2aa307={'raw':!![],'where':{'id':_0x2d691e[_0x482f('0x41')]['id']}},_0x5a3192={};_0x5a3192[_0x482f('0x2e')]=_[_0x482f('0x42')](db[_0x482f('0x3c')]['rawAttributes']);_0x5a3192[_0x482f('0x2f')]=_[_0x482f('0x42')](_0x2d691e['query']);_0x5a3192[_0x482f('0x37')]=_['intersection'](_0x5a3192['model'],_0x5a3192[_0x482f('0x2f')]);_0x2aa307[_0x482f('0x31')]=_[_0x482f('0x30')](_0x5a3192[_0x482f('0x2e')],qs['fields'](_0x2d691e[_0x482f('0x2f')][_0x482f('0x32')]));_0x2aa307[_0x482f('0x31')]=_0x2aa307[_0x482f('0x31')][_0x482f('0x43')]?_0x2aa307[_0x482f('0x31')]:_0x5a3192[_0x482f('0x2e')];if(_0x2d691e[_0x482f('0x2f')][_0x482f('0x44')]){_0x2aa307[_0x482f('0x3d')]=[{'all':!![]}];}_0x2aa307=_[_0x482f('0x39')]({},_0x2aa307,_0x2d691e['options']);return db[_0x482f('0x3c')]['find'](_0x2aa307)[_0x482f('0x25')](handleEntityNotFound(_0x1e2601,null))['then'](respondWithResult(_0x1e2601,null))['catch'](handleError(_0x1e2601,null));};exports[_0x482f('0x45')]=function(_0x4b4432,_0x5475bb){return db[_0x482f('0x3c')]['create'](_0x4b4432[_0x482f('0x46')],{})[_0x482f('0x25')](respondWithResult(_0x5475bb,0xc9))[_0x482f('0x40')](handleError(_0x5475bb,null));};exports['update']=function(_0x2ca748,_0x5370d7){if(_0x2ca748[_0x482f('0x46')]['id']){delete _0x2ca748[_0x482f('0x46')]['id'];}return db['ZendeskField'][_0x482f('0x47')]({'where':{'id':_0x2ca748[_0x482f('0x41')]['id']}})[_0x482f('0x25')](handleEntityNotFound(_0x5370d7,null))[_0x482f('0x25')](saveUpdates(_0x2ca748[_0x482f('0x46')],null))[_0x482f('0x25')](respondWithResult(_0x5370d7,null))[_0x482f('0x40')](handleError(_0x5370d7,null));};exports[_0x482f('0x48')]=function(_0x4fb828,_0x5527cf){return db[_0x482f('0x3c')][_0x482f('0x47')]({'where':{'id':_0x4fb828[_0x482f('0x41')]['id']}})[_0x482f('0x25')](handleEntityNotFound(_0x5527cf,null))[_0x482f('0x25')](removeEntity(_0x5527cf,null))['catch'](handleError(_0x5527cf,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index bd9a82c..fbec29f 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 _0x17cf=['FieldId','lodash','util','api','moment','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x31711a,_0x10590e){var _0x3b407f=function(_0x2f552c){while(--_0x2f552c){_0x31711a['push'](_0x31711a['shift']());}};_0x3b407f(++_0x10590e);}(_0x17cf,0xd9));var _0xf17c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x17cf[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xf17c('0x0'));var util=require(_0xf17c('0x1'));var logger=require('../../config/logger')(_0xf17c('0x2'));var moment=require(_0xf17c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf17c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf17c('0x5'));module[_0xf17c('0x6')]=function(_0x29d400,_0x50aebe){return _0x29d400['define'](_0xf17c('0x7'),attributes,{'tableName':_0xf17c('0x8'),'paranoid':![],'indexes':[{'name':_0xf17c('0x9'),'fields':[_0xf17c('0xa'),_0xf17c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecf3=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1c0835,_0x6d70e4){var _0x158ede=function(_0x26d6b8){while(--_0x26d6b8){_0x1c0835['push'](_0x1c0835['shift']());}};_0x158ede(++_0x6d70e4);}(_0xecf3,0xd9));var _0x3ecf=function(_0x2910c4,_0x2f43bd){_0x2910c4=_0x2910c4-0x0;var _0x480a4b=_0xecf3[_0x2910c4];return _0x480a4b;};'use strict';var _=require(_0x3ecf('0x0'));var util=require(_0x3ecf('0x1'));var logger=require(_0x3ecf('0x2'))(_0x3ecf('0x3'));var moment=require(_0x3ecf('0x4'));var BPromise=require(_0x3ecf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ecf('0x6'));var config=require(_0x3ecf('0x7'));var attributes=require(_0x3ecf('0x8'));module[_0x3ecf('0x9')]=function(_0x599d23,_0x27390d){return _0x599d23[_0x3ecf('0xa')](_0x3ecf('0xb'),attributes,{'tableName':_0x3ecf('0xc'),'paranoid':![],'indexes':[{'name':_0x3ecf('0xd'),'fields':[_0x3ecf('0xe'),_0x3ecf('0xf')],'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 7111cc2..6d29e57 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 _0x1882=['client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x15474f,_0x32a464){var _0x34ca60=function(_0x23b934){while(--_0x23b934){_0x15474f['push'](_0x15474f['shift']());}};_0x34ca60(++_0x32a464);}(_0x1882,0x81));var _0x2188=function(_0x12d17e,_0x1de194){_0x12d17e=_0x12d17e-0x0;var _0x2bef50=_0x1882[_0x12d17e];return _0x2bef50;};'use strict';var _=require(_0x2188('0x0'));var util=require(_0x2188('0x1'));var moment=require(_0x2188('0x2'));var BPromise=require('bluebird');var rs=require(_0x2188('0x3'));var fs=require('fs');var Redis=require(_0x2188('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2188('0x5'));var logger=require('../../config/logger')(_0x2188('0x6'));var config=require(_0x2188('0x7'));var jayson=require(_0x2188('0x8'));var client=jayson[_0x2188('0x9')][_0x2188('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22ff5d,_0x41e0b7,_0x183d08){return new BPromise(function(_0x28bad2,_0x4c6309){return client['request'](_0x22ff5d,_0x183d08)[_0x2188('0xb')](function(_0xc2304b){logger[_0x2188('0xc')](_0x2188('0xd'),_0x41e0b7,_0x2188('0xe'));logger[_0x2188('0xf')](_0x2188('0x10'),_0x41e0b7,_0x2188('0xe'),JSON[_0x2188('0x11')](_0xc2304b));if(_0xc2304b[_0x2188('0x12')]){if(_0xc2304b[_0x2188('0x12')][_0x2188('0x13')]===0x1f4){logger[_0x2188('0x12')](_0x2188('0xd'),_0x41e0b7,_0xc2304b[_0x2188('0x12')][_0x2188('0x14')]);return _0x4c6309(_0xc2304b[_0x2188('0x12')]['message']);}logger[_0x2188('0x12')](_0x2188('0xd'),_0x41e0b7,_0xc2304b[_0x2188('0x12')][_0x2188('0x14')]);return _0x28bad2(_0xc2304b[_0x2188('0x12')][_0x2188('0x14')]);}else{logger[_0x2188('0xc')](_0x2188('0xd'),_0x41e0b7,_0x2188('0xe'));_0x28bad2(_0xc2304b[_0x2188('0x15')][_0x2188('0x14')]);}})[_0x2188('0x16')](function(_0x179b0b){logger[_0x2188('0x12')](_0x2188('0xd'),_0x41e0b7,_0x179b0b);_0x4c6309(_0x179b0b);});});} \ No newline at end of file +var _0x8458=['jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x2ef9fe,_0x1f8cbd){var _0x3fde40=function(_0x5a387b){while(--_0x5a387b){_0x2ef9fe['push'](_0x2ef9fe['shift']());}};_0x3fde40(++_0x1f8cbd);}(_0x8458,0x139));var _0x8845=function(_0x1afc4a,_0xc145ff){_0x1afc4a=_0x1afc4a-0x0;var _0x3d02e5=_0x8458[_0x1afc4a];return _0x3d02e5;};'use strict';var _=require('lodash');var util=require(_0x8845('0x0'));var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x5'))('rpc');var config=require(_0x8845('0x6'));var jayson=require(_0x8845('0x7'));var client=jayson[_0x8845('0x8')][_0x8845('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b5d3f,_0x27cc38,_0x1df14e){return new BPromise(function(_0x507900,_0x52540f){return client['request'](_0x5b5d3f,_0x1df14e)['then'](function(_0x5930b0){logger[_0x8845('0xa')](_0x8845('0xb'),_0x27cc38,'request\x20sent');logger['debug'](_0x8845('0xc'),_0x27cc38,'request\x20sent',JSON[_0x8845('0xd')](_0x5930b0));if(_0x5930b0[_0x8845('0xe')]){if(_0x5930b0[_0x8845('0xe')][_0x8845('0xf')]===0x1f4){logger[_0x8845('0xe')](_0x8845('0xb'),_0x27cc38,_0x5930b0[_0x8845('0xe')][_0x8845('0x10')]);return _0x52540f(_0x5930b0[_0x8845('0xe')][_0x8845('0x10')]);}logger[_0x8845('0xe')](_0x8845('0xb'),_0x27cc38,_0x5930b0[_0x8845('0xe')][_0x8845('0x10')]);return _0x507900(_0x5930b0[_0x8845('0xe')][_0x8845('0x10')]);}else{logger[_0x8845('0xa')](_0x8845('0xb'),_0x27cc38,_0x8845('0x11'));_0x507900(_0x5930b0[_0x8845('0x12')]['message']);}})[_0x8845('0x13')](function(_0x515052){logger[_0x8845('0xe')]('ZendeskField,\x20%s,\x20%s',_0x27cc38,_0x515052);_0x52540f(_0x515052);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 82dceac..ed1799a 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 _0x4311=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','isAuthenticated','/:id/fields','getFields','post','/:id/configurations','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0xe9f4a2,_0x50f0c4){var _0x25e066=function(_0x32557f){while(--_0x32557f){_0xe9f4a2['push'](_0xe9f4a2['shift']());}};_0x25e066(++_0x50f0c4);}(_0x4311,0x161));var _0x1431=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4311[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x1431('0x0'));var util=require('util');var path=require(_0x1431('0x1'));var timeout=require(_0x1431('0x2'));var express=require(_0x1431('0x3'));var router=express[_0x1431('0x4')]();var fs_extra=require(_0x1431('0x5'));var auth=require(_0x1431('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1431('0x7'));var controller=require('./intZohoAccount.controller');router[_0x1431('0x8')]('/',auth['isAuthenticated'](),controller[_0x1431('0x9')]);router['get'](_0x1431('0xa'),auth['isAuthenticated'](),controller[_0x1431('0xb')]);router[_0x1431('0x8')]('/:id/configurations',auth[_0x1431('0xc')](),controller['getConfigurations']);router[_0x1431('0x8')](_0x1431('0xd'),auth['isAuthenticated'](),controller[_0x1431('0xe')]);router['post']('/',auth[_0x1431('0xc')](),controller['create']);router[_0x1431('0xf')](_0x1431('0x10'),auth[_0x1431('0xc')](),controller['addConfiguration']);router[_0x1431('0x11')](_0x1431('0xa'),auth[_0x1431('0xc')](),controller[_0x1431('0x12')]);router[_0x1431('0x13')](_0x1431('0xa'),auth[_0x1431('0xc')](),controller[_0x1431('0x14')]);module['exports']=router; \ No newline at end of file +var _0x70b1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x4ca187,_0x345760){var _0x564169=function(_0x5e5f35){while(--_0x5e5f35){_0x4ca187['push'](_0x4ca187['shift']());}};_0x564169(++_0x345760);}(_0x70b1,0x19a));var _0x170b=function(_0x1104ac,_0x48c9cf){_0x1104ac=_0x1104ac-0x0;var _0x336b1f=_0x70b1[_0x1104ac];return _0x336b1f;};'use strict';var multer=require(_0x170b('0x0'));var util=require(_0x170b('0x1'));var path=require(_0x170b('0x2'));var timeout=require(_0x170b('0x3'));var express=require(_0x170b('0x4'));var router=express[_0x170b('0x5')]();var fs_extra=require(_0x170b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x170b('0x7'));var config=require(_0x170b('0x8'));var controller=require(_0x170b('0x9'));router[_0x170b('0xa')]('/',auth[_0x170b('0xb')](),controller['index']);router['get'](_0x170b('0xc'),auth[_0x170b('0xb')](),controller[_0x170b('0xd')]);router[_0x170b('0xa')]('/:id/configurations',auth[_0x170b('0xb')](),controller[_0x170b('0xe')]);router[_0x170b('0xa')](_0x170b('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x170b('0x10')]('/',auth[_0x170b('0xb')](),controller[_0x170b('0x11')]);router[_0x170b('0x10')](_0x170b('0x12'),auth['isAuthenticated'](),controller[_0x170b('0x13')]);router[_0x170b('0x14')](_0x170b('0xc'),auth[_0x170b('0xb')](),controller[_0x170b('0x15')]);router['delete'](_0x170b('0xc'),auth['isAuthenticated'](),controller[_0x170b('0x16')]);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 e9ade1b..3610b31 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 _0xee5b=['sequelize','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xee5b,0x1f4));var _0xbee5=function(_0x366270,_0x4ca8cc){_0x366270=_0x366270-0x0;var _0x1fd8d6=_0xee5b[_0x366270];return _0x1fd8d6;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1be1=['STRING'];(function(_0x379b37,_0x46ad19){var _0x2dea5f=function(_0x478aad){while(--_0x478aad){_0x379b37['push'](_0x379b37['shift']());}};_0x2dea5f(++_0x46ad19);}(_0x1be1,0x192));var _0x11be=function(_0x287e43,_0x526911){_0x287e43=_0x287e43-0x0;var _0x44e90e=_0x1be1[_0x287e43];return _0x44e90e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11be('0x0')]},'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x11be('0x0')]},'clientId':{'type':Sequelize[_0x11be('0x0')]},'clientSecret':{'type':Sequelize[_0x11be('0x0')]},'serverUrl':{'type':Sequelize[_0x11be('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 012699f..78e4bc9 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 _0x84db=['body','update','destroy','findOne','ZohoConfiguration','filter','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','substring','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Result','Call_Start_Time','includes','api_name','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ZohoAccount','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','type','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create'];(function(_0x10a67b,_0x287b95){var _0x10b328=function(_0x431554){while(--_0x431554){_0x10a67b['push'](_0x10a67b['shift']());}};_0x10b328(++_0x287b95);}(_0x84db,0x1ad));var _0xb84d=function(_0x18f42f,_0x397bc1){_0x18f42f=_0x18f42f-0x0;var _0x306ff1=_0x84db[_0x18f42f];return _0x306ff1;};'use strict';var emlformat=require(_0xb84d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb84d('0x1'));var rp=require(_0xb84d('0x2'));var moment=require(_0xb84d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb84d('0x4'));var path=require(_0xb84d('0x5'));var sox=require(_0xb84d('0x6'));var csv=require(_0xb84d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb84d('0x8'));var _=require(_0xb84d('0x9'));var squel=require(_0xb84d('0xa'));var crypto=require(_0xb84d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb84d('0xc'));var toCsv=require(_0xb84d('0x7'));var querystring=require('querystring');var Papa=require(_0xb84d('0xd'));var Redis=require('ioredis');var authService=require(_0xb84d('0xe'));var qs=require(_0xb84d('0xf'));var as=require(_0xb84d('0x10'));var hardwareService=require(_0xb84d('0x11'));var logger=require(_0xb84d('0x12'))(_0xb84d('0x13'));var utils=require('../../config/utils');var config=require(_0xb84d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb84d('0x15'))['db'];var integrations=require(_0xb84d('0x16'));function respondWithStatusCode(_0x41ac3d,_0x55ac13){_0x55ac13=_0x55ac13||0xcc;return function(_0x24808e){if(_0x24808e){return _0x41ac3d[_0xb84d('0x17')](_0x55ac13);}return _0x41ac3d['status'](_0x55ac13)[_0xb84d('0x18')]();};}function respondWithResult(_0x4037ed,_0x49d89b){_0x49d89b=_0x49d89b||0xc8;return function(_0x9302ad){if(_0x9302ad){return _0x4037ed[_0xb84d('0x19')](_0x49d89b)[_0xb84d('0x1a')](_0x9302ad);}};}function respondWithFilteredResult(_0x54ced2,_0x954116){return function(_0x1adaf0){if(_0x1adaf0){var _0x4c4a00=typeof _0x954116[_0xb84d('0x1b')]===_0xb84d('0x1c')&&typeof _0x954116[_0xb84d('0x1d')]==='undefined';var _0x543404=_0x1adaf0[_0xb84d('0x1e')];var _0x3bf9a3=_0x4c4a00?0x0:_0x954116[_0xb84d('0x1b')];var _0x33497d=_0x4c4a00?_0x1adaf0['count']:_0x954116[_0xb84d('0x1b')]+_0x954116['limit'];var _0x36737b;if(_0x33497d>=_0x543404){_0x33497d=_0x543404;_0x36737b=0xc8;}else{_0x36737b=0xce;}_0x54ced2[_0xb84d('0x19')](_0x36737b);return _0x54ced2['set'](_0xb84d('0x1f'),_0x3bf9a3+'-'+_0x33497d+'/'+_0x543404)[_0xb84d('0x1a')](_0x1adaf0);}return null;};}function patchUpdates(_0x1dac94){return function(_0x565331){try{jsonpatch[_0xb84d('0x20')](_0x565331,_0x1dac94,!![]);}catch(_0x970fc8){return BPromise[_0xb84d('0x21')](_0x970fc8);}return _0x565331[_0xb84d('0x22')]();};}function saveUpdates(_0x38f15d,_0x1ab631){return function(_0x14cf4c){if(_0x14cf4c){return _0x14cf4c['update'](_0x38f15d)[_0xb84d('0x23')](function(_0x385acc){return _0x385acc;});}return null;};}function removeEntity(_0x1ecce0,_0x519fc7){return function(_0x4abfb7){if(_0x4abfb7){return _0x4abfb7['destroy']()[_0xb84d('0x23')](function(){_0x1ecce0[_0xb84d('0x19')](0xcc)[_0xb84d('0x18')]();});}};}function handleEntityNotFound(_0x14b207,_0x3e11a9){return function(_0x9686e7){if(!_0x9686e7){_0x14b207['sendStatus'](0x194);}return _0x9686e7;};}function handleError(_0x2ab743,_0x217a8f){_0x217a8f=_0x217a8f||0x1f4;return function(_0x98fcfe){logger[_0xb84d('0x24')](_0x98fcfe[_0xb84d('0x25')]);if(_0x98fcfe['name']){delete _0x98fcfe[_0xb84d('0x26')];}_0x2ab743[_0xb84d('0x19')](_0x217a8f)[_0xb84d('0x27')](_0x98fcfe);};}exports[_0xb84d('0x28')]=function(_0x4dd7f9,_0x4a0c28){var _0x3061c1={},_0x47d6ef={},_0x274614={'count':0x0,'rows':[]};var _0xdbe168=_[_0xb84d('0x29')](db[_0xb84d('0x2a')]['rawAttributes'],function(_0xcf7cb5){return{'name':_0xcf7cb5[_0xb84d('0x2b')],'type':_0xcf7cb5['type'][_0xb84d('0x2c')]};});_0x47d6ef[_0xb84d('0x2d')]=_[_0xb84d('0x29')](_0xdbe168,'name');_0x47d6ef[_0xb84d('0x2e')]=_[_0xb84d('0x2f')](_0x4dd7f9[_0xb84d('0x2e')]);_0x47d6ef['filters']=_['intersection'](_0x47d6ef['model'],_0x47d6ef['query']);_0x3061c1[_0xb84d('0x30')]=_[_0xb84d('0x31')](_0x47d6ef[_0xb84d('0x2d')],qs['fields'](_0x4dd7f9[_0xb84d('0x2e')][_0xb84d('0x32')]));_0x3061c1['attributes']=_0x3061c1['attributes'][_0xb84d('0x33')]?_0x3061c1[_0xb84d('0x30')]:_0x47d6ef[_0xb84d('0x2d')];if(!_0x4dd7f9[_0xb84d('0x2e')][_0xb84d('0x34')](_0xb84d('0x35'))){_0x3061c1[_0xb84d('0x1d')]=qs[_0xb84d('0x1d')](_0x4dd7f9['query'][_0xb84d('0x1d')]);_0x3061c1['offset']=qs[_0xb84d('0x1b')](_0x4dd7f9[_0xb84d('0x2e')]['offset']);}_0x3061c1[_0xb84d('0x36')]=qs[_0xb84d('0x37')](_0x4dd7f9[_0xb84d('0x2e')][_0xb84d('0x37')]);_0x3061c1['where']=qs['filters'](_[_0xb84d('0x38')](_0x4dd7f9[_0xb84d('0x2e')],_0x47d6ef[_0xb84d('0x39')]),_0xdbe168);if(_0x4dd7f9[_0xb84d('0x2e')]['filter']){_0x3061c1[_0xb84d('0x3a')]=_[_0xb84d('0x3b')](_0x3061c1[_0xb84d('0x3a')],{'$or':_[_0xb84d('0x29')](_0xdbe168,function(_0x4ef92a){if(_0x4ef92a[_0xb84d('0x3c')]!=='VIRTUAL'){var _0x244960={};_0x244960[_0x4ef92a['name']]={'$like':'%'+_0x4dd7f9[_0xb84d('0x2e')]['filter']+'%'};return _0x244960;}})});}_0x3061c1=_[_0xb84d('0x3b')]({},_0x3061c1,_0x4dd7f9[_0xb84d('0x3d')]);var _0x36858c={'where':_0x3061c1[_0xb84d('0x3a')]};return db[_0xb84d('0x2a')][_0xb84d('0x1e')](_0x36858c)[_0xb84d('0x23')](function(_0x1cd57e){_0x274614[_0xb84d('0x1e')]=_0x1cd57e;if(_0x4dd7f9[_0xb84d('0x2e')][_0xb84d('0x3e')]){_0x3061c1[_0xb84d('0x3f')]=[{'all':!![]}];}return db[_0xb84d('0x2a')][_0xb84d('0x40')](_0x3061c1);})[_0xb84d('0x23')](function(_0x43c2f0){_0x274614[_0xb84d('0x41')]=_0x43c2f0;return _0x274614;})[_0xb84d('0x23')](respondWithFilteredResult(_0x4a0c28,_0x3061c1))['catch'](handleError(_0x4a0c28,null));};exports['show']=function(_0x484b1c,_0x9b939f){var _0x204003={'raw':![],'where':{'id':_0x484b1c[_0xb84d('0x42')]['id']}},_0x3bb669={};_0x3bb669['model']=_[_0xb84d('0x2f')](db[_0xb84d('0x2a')][_0xb84d('0x43')]);_0x3bb669[_0xb84d('0x2e')]=_[_0xb84d('0x2f')](_0x484b1c[_0xb84d('0x2e')]);_0x3bb669[_0xb84d('0x39')]=_[_0xb84d('0x31')](_0x3bb669[_0xb84d('0x2d')],_0x3bb669[_0xb84d('0x2e')]);_0x204003[_0xb84d('0x30')]=_[_0xb84d('0x31')](_0x3bb669[_0xb84d('0x2d')],qs[_0xb84d('0x32')](_0x484b1c['query'][_0xb84d('0x32')]));_0x204003['attributes']=_0x204003[_0xb84d('0x30')][_0xb84d('0x33')]?_0x204003[_0xb84d('0x30')]:_0x3bb669[_0xb84d('0x2d')];if(_0x484b1c[_0xb84d('0x2e')][_0xb84d('0x3e')]){_0x204003['include']=[{'all':!![]}];}_0x204003=_[_0xb84d('0x3b')]({},_0x204003,_0x484b1c[_0xb84d('0x3d')]);return db[_0xb84d('0x2a')][_0xb84d('0x44')](_0x204003)[_0xb84d('0x23')](handleEntityNotFound(_0x9b939f,null))[_0xb84d('0x23')](respondWithResult(_0x9b939f,null))[_0xb84d('0x45')](handleError(_0x9b939f,null));};exports[_0xb84d('0x46')]=function(_0xecfc1e,_0x4b353b){return db['ZohoAccount']['create'](_0xecfc1e[_0xb84d('0x47')],{})[_0xb84d('0x23')](respondWithResult(_0x4b353b,0xc9))[_0xb84d('0x45')](handleError(_0x4b353b,null));};exports[_0xb84d('0x48')]=function(_0x1d5d51,_0x392e3c){if(_0x1d5d51[_0xb84d('0x47')]['id']){delete _0x1d5d51[_0xb84d('0x47')]['id'];}return db[_0xb84d('0x2a')][_0xb84d('0x44')]({'where':{'id':_0x1d5d51['params']['id']}})[_0xb84d('0x23')](handleEntityNotFound(_0x392e3c,null))[_0xb84d('0x23')](saveUpdates(_0x1d5d51['body'],null))[_0xb84d('0x23')](respondWithResult(_0x392e3c,null))[_0xb84d('0x45')](handleError(_0x392e3c,null));};exports[_0xb84d('0x49')]=function(_0x4d6b32,_0x29972e){return db[_0xb84d('0x2a')][_0xb84d('0x44')]({'where':{'id':_0x4d6b32['params']['id']}})[_0xb84d('0x23')](handleEntityNotFound(_0x29972e,null))[_0xb84d('0x23')](removeEntity(_0x29972e,null))[_0xb84d('0x45')](handleError(_0x29972e,null));};exports['getConfigurations']=function(_0x2e4c42,_0x44e099,_0x148a95){var _0x19c84b={};var _0x31fab8={};var _0x45b5df;var _0x5af199;return db[_0xb84d('0x2a')][_0xb84d('0x4a')]({'where':{'id':_0x2e4c42[_0xb84d('0x42')]['id']}})['then'](handleEntityNotFound(_0x44e099,null))[_0xb84d('0x23')](function(_0x42a2e6){if(_0x42a2e6){_0x45b5df=_0x42a2e6;_0x31fab8[_0xb84d('0x2d')]=_[_0xb84d('0x2f')](db[_0xb84d('0x4b')][_0xb84d('0x43')]);_0x31fab8[_0xb84d('0x2e')]=_[_0xb84d('0x2f')](_0x2e4c42['query']);_0x31fab8[_0xb84d('0x39')]=_[_0xb84d('0x31')](_0x31fab8['model'],_0x31fab8[_0xb84d('0x2e')]);_0x19c84b[_0xb84d('0x30')]=_[_0xb84d('0x31')](_0x31fab8['model'],qs['fields'](_0x2e4c42[_0xb84d('0x2e')][_0xb84d('0x32')]));_0x19c84b[_0xb84d('0x30')]=_0x19c84b[_0xb84d('0x30')]['length']?_0x19c84b[_0xb84d('0x30')]:_0x31fab8[_0xb84d('0x2d')];_0x19c84b['order']=qs['sort'](_0x2e4c42['query'][_0xb84d('0x37')]);_0x19c84b[_0xb84d('0x3a')]=qs[_0xb84d('0x39')](_[_0xb84d('0x38')](_0x2e4c42[_0xb84d('0x2e')],_0x31fab8[_0xb84d('0x39')]));if(_0x2e4c42[_0xb84d('0x2e')][_0xb84d('0x4c')]){_0x19c84b[_0xb84d('0x3a')]=_['merge'](_0x19c84b[_0xb84d('0x3a')],{'$or':_[_0xb84d('0x29')](_0x19c84b['attributes'],function(_0x56079b){var _0xcefaf9={};_0xcefaf9[_0x56079b]={'$like':'%'+_0x2e4c42[_0xb84d('0x2e')][_0xb84d('0x4c')]+'%'};return _0xcefaf9;})});}_0x19c84b=_[_0xb84d('0x3b')]({},_0x19c84b,_0x2e4c42[_0xb84d('0x3d')]);return _0x45b5df['getConfigurations'](_0x19c84b);}})[_0xb84d('0x23')](function(_0x34c60a){if(_0x34c60a){_0x5af199=_0x34c60a['length'];if(!_0x2e4c42[_0xb84d('0x2e')]['hasOwnProperty']('nolimit')){_0x19c84b[_0xb84d('0x1d')]=qs['limit'](_0x2e4c42[_0xb84d('0x2e')][_0xb84d('0x1d')]);_0x19c84b[_0xb84d('0x1b')]=qs['offset'](_0x2e4c42[_0xb84d('0x2e')][_0xb84d('0x1b')]);}return _0x45b5df[_0xb84d('0x4d')](_0x19c84b);}})[_0xb84d('0x23')](function(_0x536480){if(_0x536480){return _0x536480?{'count':_0x5af199,'rows':_0x536480}:null;}})[_0xb84d('0x23')](respondWithResult(_0x44e099,null))['catch'](handleError(_0x44e099,null));};exports['addConfiguration']=function(_0xdb26ec,_0x592c0e,_0x24528c){if(_0xdb26ec[_0xb84d('0x47')]['id']){delete _0xdb26ec[_0xb84d('0x47')]['id'];}return db[_0xb84d('0x2a')]['findOne']({'where':{'id':_0xdb26ec[_0xb84d('0x42')]['id']}})['then'](handleEntityNotFound(_0x592c0e,null))['then'](function(_0x4aee9a){if(_0x4aee9a){_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x4e')]=_0x4aee9a['id'];_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x4f')]=integrations[_0xb84d('0x50')](_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x51')],_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x3c')]);_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x52')]=integrations['getDescriptions'](_0xdb26ec[_0xb84d('0x47')][_0xb84d('0x51')],_0xdb26ec['body'][_0xb84d('0x3c')]);return db[_0xb84d('0x4b')]['create'](_0xdb26ec[_0xb84d('0x47')],{'include':[{'model':db[_0xb84d('0x53')],'as':_0xb84d('0x4f')},{'model':db[_0xb84d('0x53')],'as':_0xb84d('0x52')}]});}return null;})[_0xb84d('0x23')](respondWithResult(_0x592c0e,null))[_0xb84d('0x45')](handleError(_0x592c0e,null));};function getAccessToken(_0x4a2f72){return new Promise(function(_0x38c5bd,_0x4f5da3){var _0x532801;switch(_0x4a2f72[_0xb84d('0x54')]){case'US':_0x532801=_0xb84d('0x55');break;case'AU':_0x532801=_0xb84d('0x56');break;case'EU':_0x532801=_0xb84d('0x57');break;case'IN':_0x532801=_0xb84d('0x58');break;case'CN':_0x532801='https://accounts.zoho.com.cn';break;default:_0x532801=_0xb84d('0x57');break;}var _0x11c08a={'method':_0xb84d('0x59'),'uri':_0x532801+_0xb84d('0x5a'),'qs':{'refresh_token':_0x4a2f72[_0xb84d('0x5b')],'client_id':_0x4a2f72[_0xb84d('0x5c')],'client_secret':_0x4a2f72[_0xb84d('0x5d')],'grant_type':_0xb84d('0x5e')},'json':!![]};return rp(_0x11c08a)[_0xb84d('0x23')](function(_0x3d7fb1){if(_0x3d7fb1[_0xb84d('0x5f')]){_0x38c5bd(_0x3d7fb1[_0xb84d('0x5f')]);}else{_0x4f5da3(_0xb84d('0x60'));}})['catch'](function(_0x73339c){_0x4f5da3(_0x73339c);});});}exports[_0xb84d('0x61')]=function(_0xd2a1fd,_0x1ed085,_0x1b7c17){var _0xf7db59,_0x437af8,_0x579e98,_0x2e2549,_0x5ca3e8;return db[_0xb84d('0x2a')]['findOne']({'where':{'id':_0xd2a1fd[_0xb84d('0x42')]['id']},'attributes':['id',_0xb84d('0x62'),_0xb84d('0x54'),_0xb84d('0x5c'),'clientSecret',_0xb84d('0x63'),'code',_0xb84d('0x5b')]})[_0xb84d('0x23')](handleEntityNotFound(_0x1ed085,null))['then'](function(_0x20248f){_0x5ca3e8=_0x20248f;_0xf7db59=_0x5ca3e8[_0xb84d('0x62')];_0x437af8=_0xf7db59===_0xb84d('0x64')?'eu':_0xb84d('0x65');_0x579e98=_0x5ca3e8[_0xb84d('0x63')];var _0x752430=_0x579e98['slice'](-0x1);if(_0x752430==='/'||_0x752430==='\x5c'||_0x752430===':'){_0x579e98=_0x579e98[_0xb84d('0x66')](0x0,_0x579e98['lastIndexOf'](_0x752430));}if(!_0x5ca3e8[_0xb84d('0x5b')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5ca3e8);})[_0xb84d('0x23')](function(_0x5d9262){if(_0x5d9262){return rp({'method':'GET','uri':util[_0xb84d('0x67')](_0xb84d('0x68'),_0x437af8),'qs':{'module':_0xb84d('0x69')},'headers':{'Authorization':_0xb84d('0x6a')+_0x5d9262},'json':!![]});}})[_0xb84d('0x23')](function(_0x281a85){if(_0x281a85){if(_0x281a85[_0xb84d('0x6b')]&&_0x281a85['response']['error']){throw new Error(_0x281a85[_0xb84d('0x6b')][_0xb84d('0x24')]['message']);}var _0xb6beab=[];var _0x346ae6=[];var _0x2e0018=['Owner',_0xb84d('0x6c'),_0xb84d('0x6d'),_0xb84d('0x6e'),'Call_Duration',_0xb84d('0x6f'),_0xb84d('0x70'),'Call_Type'];_0x346ae6=_['remove'](_0x281a85[_0xb84d('0x32')],function(_0xb6446d){return _0x2e0018[_0xb84d('0x71')](_0xb6446d[_0xb84d('0x72')]);});for(var _0x52bd26=0x0;_0x52bd26<_0x346ae6[_0xb84d('0x33')];_0x52bd26++){if(_0x346ae6[_0x52bd26]['system_mandatory']===![]){_0xb6beab['push']({'id':_0x346ae6[_0x52bd26]['id'],'name':_0x346ae6[_0x52bd26][_0xb84d('0x73')],'custom':_0x346ae6[_0x52bd26][_0xb84d('0x74')],'options':_0x346ae6[_0x52bd26][_0xb84d('0x75')]===_0xb84d('0x76')&&_0x346ae6[_0x52bd26][_0xb84d('0x77')][_0xb84d('0x33')]>-0x1?_[_0xb84d('0x29')](_0x346ae6[_0x52bd26][_0xb84d('0x77')],function(_0x47f8b9){return{'name':_0x47f8b9,'value':_0x47f8b9};}):[]});}}return{'count':_0xb6beab[_0xb84d('0x33')],'rows':_0xb6beab};}else{return{'count':0x0,'rows':[]};}})[_0xb84d('0x23')](respondWithResult(_0x1ed085,null))[_0xb84d('0x45')](function(_0xbca1d1){var _0x12b4c9=_0xd2a1fd['query']['test']?0x1f4:_0xbca1d1['statusCode']||0x1f4;logger[_0xb84d('0x24')](_0xb84d('0x78'),_0xb84d('0x61'),_0x12b4c9,JSON[_0xb84d('0x79')](_0xbca1d1));delete _0xbca1d1['name'];if(_0x12b4c9===0x191){_0x12b4c9=0x190;}_0x1ed085[_0xb84d('0x19')](_0x12b4c9)[_0xb84d('0x27')](_0xd2a1fd[_0xb84d('0x2e')][_0xb84d('0x7a')]?{'message':_0xb84d('0x7b'),'statusCode':_0xbca1d1[_0xb84d('0x7c')]}:_0xbca1d1);});}; \ No newline at end of file +var _0xe94f=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','create','body','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','refreshToken','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','Description','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise'];(function(_0x27b0f5,_0x48baab){var _0x5dc761=function(_0x3e4b71){while(--_0x3e4b71){_0x27b0f5['push'](_0x27b0f5['shift']());}};_0x5dc761(++_0x48baab);}(_0xe94f,0x179));var _0xfe94=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0xe94f[_0x152136];return _0x20df44;};'use strict';var emlformat=require(_0xfe94('0x0'));var rimraf=require(_0xfe94('0x1'));var zipdir=require(_0xfe94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe94('0x3'));var moment=require(_0xfe94('0x4'));var BPromise=require(_0xfe94('0x5'));var Mustache=require(_0xfe94('0x6'));var util=require(_0xfe94('0x7'));var path=require('path');var sox=require(_0xfe94('0x8'));var csv=require(_0xfe94('0x9'));var ejs=require(_0xfe94('0xa'));var fs=require('fs');var fs_extra=require(_0xfe94('0xb'));var _=require(_0xfe94('0xc'));var squel=require(_0xfe94('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe94('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe94('0xf'));var Papa=require(_0xfe94('0x10'));var Redis=require(_0xfe94('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfe94('0x12'));var as=require(_0xfe94('0x13'));var hardwareService=require(_0xfe94('0x14'));var logger=require(_0xfe94('0x15'))(_0xfe94('0x16'));var utils=require(_0xfe94('0x17'));var config=require(_0xfe94('0x18'));var licenseUtil=require(_0xfe94('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfe94('0x1a'));function respondWithStatusCode(_0x2bd30a,_0x71fcf){_0x71fcf=_0x71fcf||0xcc;return function(_0x4ec55d){if(_0x4ec55d){return _0x2bd30a[_0xfe94('0x1b')](_0x71fcf);}return _0x2bd30a[_0xfe94('0x1c')](_0x71fcf)[_0xfe94('0x1d')]();};}function respondWithResult(_0x3cb7d3,_0x2d9ac5){_0x2d9ac5=_0x2d9ac5||0xc8;return function(_0x47e2e7){if(_0x47e2e7){return _0x3cb7d3[_0xfe94('0x1c')](_0x2d9ac5)['json'](_0x47e2e7);}};}function respondWithFilteredResult(_0x4bfbce,_0x337c0f){return function(_0x13b0c2){if(_0x13b0c2){var _0x59c8b9=typeof _0x337c0f[_0xfe94('0x1e')]===_0xfe94('0x1f')&&typeof _0x337c0f[_0xfe94('0x20')]===_0xfe94('0x1f');var _0x21519d=_0x13b0c2['count'];var _0x5124cd=_0x59c8b9?0x0:_0x337c0f[_0xfe94('0x1e')];var _0x235f98=_0x59c8b9?_0x13b0c2[_0xfe94('0x21')]:_0x337c0f[_0xfe94('0x1e')]+_0x337c0f[_0xfe94('0x20')];var _0x211ebc;if(_0x235f98>=_0x21519d){_0x235f98=_0x21519d;_0x211ebc=0xc8;}else{_0x211ebc=0xce;}_0x4bfbce['status'](_0x211ebc);return _0x4bfbce[_0xfe94('0x22')]('Content-Range',_0x5124cd+'-'+_0x235f98+'/'+_0x21519d)[_0xfe94('0x23')](_0x13b0c2);}return null;};}function patchUpdates(_0x5ec7ea){return function(_0x24607a){try{jsonpatch[_0xfe94('0x24')](_0x24607a,_0x5ec7ea,!![]);}catch(_0x4451c3){return BPromise['reject'](_0x4451c3);}return _0x24607a[_0xfe94('0x25')]();};}function saveUpdates(_0x2caf53,_0x52045b){return function(_0x1d8eb3){if(_0x1d8eb3){return _0x1d8eb3['update'](_0x2caf53)[_0xfe94('0x26')](function(_0x58a397){return _0x58a397;});}return null;};}function removeEntity(_0x519cba,_0x48fe38){return function(_0x2906ca){if(_0x2906ca){return _0x2906ca[_0xfe94('0x27')]()['then'](function(){_0x519cba[_0xfe94('0x1c')](0xcc)[_0xfe94('0x1d')]();});}};}function handleEntityNotFound(_0x37f08d,_0x4dc566){return function(_0x5d08a4){if(!_0x5d08a4){_0x37f08d['sendStatus'](0x194);}return _0x5d08a4;};}function handleError(_0x338e94,_0x23def4){_0x23def4=_0x23def4||0x1f4;return function(_0x2bab04){logger[_0xfe94('0x28')](_0x2bab04[_0xfe94('0x29')]);if(_0x2bab04[_0xfe94('0x2a')]){delete _0x2bab04[_0xfe94('0x2a')];}_0x338e94[_0xfe94('0x1c')](_0x23def4)[_0xfe94('0x2b')](_0x2bab04);};}exports['index']=function(_0x15f740,_0x305307){var _0x3b9729={},_0xc97e43={},_0x764db0={'count':0x0,'rows':[]};var _0xb4bdfc=_[_0xfe94('0x2c')](db[_0xfe94('0x2d')][_0xfe94('0x2e')],function(_0x32f8c7){return{'name':_0x32f8c7[_0xfe94('0x2f')],'type':_0x32f8c7[_0xfe94('0x30')][_0xfe94('0x31')]};});_0xc97e43[_0xfe94('0x32')]=_['map'](_0xb4bdfc,_0xfe94('0x2a'));_0xc97e43[_0xfe94('0x33')]=_[_0xfe94('0x34')](_0x15f740[_0xfe94('0x33')]);_0xc97e43[_0xfe94('0x35')]=_[_0xfe94('0x36')](_0xc97e43[_0xfe94('0x32')],_0xc97e43[_0xfe94('0x33')]);_0x3b9729[_0xfe94('0x37')]=_[_0xfe94('0x36')](_0xc97e43[_0xfe94('0x32')],qs['fields'](_0x15f740[_0xfe94('0x33')]['fields']));_0x3b9729['attributes']=_0x3b9729[_0xfe94('0x37')][_0xfe94('0x38')]?_0x3b9729[_0xfe94('0x37')]:_0xc97e43['model'];if(!_0x15f740[_0xfe94('0x33')][_0xfe94('0x39')]('nolimit')){_0x3b9729[_0xfe94('0x20')]=qs[_0xfe94('0x20')](_0x15f740[_0xfe94('0x33')][_0xfe94('0x20')]);_0x3b9729[_0xfe94('0x1e')]=qs[_0xfe94('0x1e')](_0x15f740['query'][_0xfe94('0x1e')]);}_0x3b9729[_0xfe94('0x3a')]=qs[_0xfe94('0x3b')](_0x15f740['query'][_0xfe94('0x3b')]);_0x3b9729['where']=qs[_0xfe94('0x35')](_[_0xfe94('0x3c')](_0x15f740[_0xfe94('0x33')],_0xc97e43[_0xfe94('0x35')]),_0xb4bdfc);if(_0x15f740[_0xfe94('0x33')][_0xfe94('0x3d')]){_0x3b9729[_0xfe94('0x3e')]=_[_0xfe94('0x3f')](_0x3b9729[_0xfe94('0x3e')],{'$or':_['map'](_0xb4bdfc,function(_0x457fd7){if(_0x457fd7['type']!==_0xfe94('0x40')){var _0x1e9cfa={};_0x1e9cfa[_0x457fd7[_0xfe94('0x2a')]]={'$like':'%'+_0x15f740[_0xfe94('0x33')][_0xfe94('0x3d')]+'%'};return _0x1e9cfa;}})});}_0x3b9729=_['merge']({},_0x3b9729,_0x15f740[_0xfe94('0x41')]);var _0x38d32e={'where':_0x3b9729['where']};return db[_0xfe94('0x2d')][_0xfe94('0x21')](_0x38d32e)[_0xfe94('0x26')](function(_0x33d247){_0x764db0[_0xfe94('0x21')]=_0x33d247;if(_0x15f740[_0xfe94('0x33')][_0xfe94('0x42')]){_0x3b9729['include']=[{'all':!![]}];}return db[_0xfe94('0x2d')][_0xfe94('0x43')](_0x3b9729);})['then'](function(_0x14a57c){_0x764db0[_0xfe94('0x44')]=_0x14a57c;return _0x764db0;})[_0xfe94('0x26')](respondWithFilteredResult(_0x305307,_0x3b9729))[_0xfe94('0x45')](handleError(_0x305307,null));};exports[_0xfe94('0x46')]=function(_0x2a9acc,_0x2c173f){var _0x267b44={'raw':![],'where':{'id':_0x2a9acc[_0xfe94('0x47')]['id']}},_0xca788a={};_0xca788a[_0xfe94('0x32')]=_[_0xfe94('0x34')](db[_0xfe94('0x2d')][_0xfe94('0x2e')]);_0xca788a[_0xfe94('0x33')]=_[_0xfe94('0x34')](_0x2a9acc[_0xfe94('0x33')]);_0xca788a[_0xfe94('0x35')]=_[_0xfe94('0x36')](_0xca788a[_0xfe94('0x32')],_0xca788a[_0xfe94('0x33')]);_0x267b44[_0xfe94('0x37')]=_[_0xfe94('0x36')](_0xca788a[_0xfe94('0x32')],qs[_0xfe94('0x48')](_0x2a9acc[_0xfe94('0x33')][_0xfe94('0x48')]));_0x267b44['attributes']=_0x267b44[_0xfe94('0x37')][_0xfe94('0x38')]?_0x267b44['attributes']:_0xca788a[_0xfe94('0x32')];if(_0x2a9acc[_0xfe94('0x33')][_0xfe94('0x42')]){_0x267b44[_0xfe94('0x49')]=[{'all':!![]}];}_0x267b44=_[_0xfe94('0x3f')]({},_0x267b44,_0x2a9acc[_0xfe94('0x41')]);return db[_0xfe94('0x2d')]['find'](_0x267b44)[_0xfe94('0x26')](handleEntityNotFound(_0x2c173f,null))[_0xfe94('0x26')](respondWithResult(_0x2c173f,null))[_0xfe94('0x45')](handleError(_0x2c173f,null));};exports['create']=function(_0x2ab75e,_0xa9da7){return db[_0xfe94('0x2d')][_0xfe94('0x4a')](_0x2ab75e[_0xfe94('0x4b')],{})[_0xfe94('0x26')](respondWithResult(_0xa9da7,0xc9))[_0xfe94('0x45')](handleError(_0xa9da7,null));};exports['update']=function(_0x4924a4,_0x54037c){if(_0x4924a4[_0xfe94('0x4b')]['id']){delete _0x4924a4[_0xfe94('0x4b')]['id'];}return db[_0xfe94('0x2d')]['find']({'where':{'id':_0x4924a4[_0xfe94('0x47')]['id']}})[_0xfe94('0x26')](handleEntityNotFound(_0x54037c,null))[_0xfe94('0x26')](saveUpdates(_0x4924a4[_0xfe94('0x4b')],null))[_0xfe94('0x26')](respondWithResult(_0x54037c,null))['catch'](handleError(_0x54037c,null));};exports['destroy']=function(_0x4c2216,_0x34c851){return db[_0xfe94('0x2d')][_0xfe94('0x4c')]({'where':{'id':_0x4c2216['params']['id']}})['then'](handleEntityNotFound(_0x34c851,null))['then'](removeEntity(_0x34c851,null))[_0xfe94('0x45')](handleError(_0x34c851,null));};exports[_0xfe94('0x4d')]=function(_0x144b39,_0x585dcf,_0x14dd19){var _0x4c7eb6={};var _0x4a5cdd={};var _0x144d7e;var _0x2fb474;return db['ZohoAccount'][_0xfe94('0x4e')]({'where':{'id':_0x144b39['params']['id']}})['then'](handleEntityNotFound(_0x585dcf,null))[_0xfe94('0x26')](function(_0x442a03){if(_0x442a03){_0x144d7e=_0x442a03;_0x4a5cdd['model']=_[_0xfe94('0x34')](db[_0xfe94('0x4f')][_0xfe94('0x2e')]);_0x4a5cdd['query']=_[_0xfe94('0x34')](_0x144b39[_0xfe94('0x33')]);_0x4a5cdd[_0xfe94('0x35')]=_[_0xfe94('0x36')](_0x4a5cdd[_0xfe94('0x32')],_0x4a5cdd[_0xfe94('0x33')]);_0x4c7eb6[_0xfe94('0x37')]=_['intersection'](_0x4a5cdd[_0xfe94('0x32')],qs['fields'](_0x144b39['query'][_0xfe94('0x48')]));_0x4c7eb6[_0xfe94('0x37')]=_0x4c7eb6[_0xfe94('0x37')]['length']?_0x4c7eb6[_0xfe94('0x37')]:_0x4a5cdd[_0xfe94('0x32')];_0x4c7eb6[_0xfe94('0x3a')]=qs['sort'](_0x144b39['query'][_0xfe94('0x3b')]);_0x4c7eb6[_0xfe94('0x3e')]=qs[_0xfe94('0x35')](_[_0xfe94('0x3c')](_0x144b39[_0xfe94('0x33')],_0x4a5cdd[_0xfe94('0x35')]));if(_0x144b39['query'][_0xfe94('0x3d')]){_0x4c7eb6[_0xfe94('0x3e')]=_[_0xfe94('0x3f')](_0x4c7eb6[_0xfe94('0x3e')],{'$or':_[_0xfe94('0x2c')](_0x4c7eb6[_0xfe94('0x37')],function(_0x4580cc){var _0xc0339e={};_0xc0339e[_0x4580cc]={'$like':'%'+_0x144b39[_0xfe94('0x33')][_0xfe94('0x3d')]+'%'};return _0xc0339e;})});}_0x4c7eb6=_['merge']({},_0x4c7eb6,_0x144b39[_0xfe94('0x41')]);return _0x144d7e[_0xfe94('0x4d')](_0x4c7eb6);}})[_0xfe94('0x26')](function(_0xa454fb){if(_0xa454fb){_0x2fb474=_0xa454fb[_0xfe94('0x38')];if(!_0x144b39[_0xfe94('0x33')][_0xfe94('0x39')]('nolimit')){_0x4c7eb6[_0xfe94('0x20')]=qs['limit'](_0x144b39['query']['limit']);_0x4c7eb6[_0xfe94('0x1e')]=qs['offset'](_0x144b39[_0xfe94('0x33')]['offset']);}return _0x144d7e[_0xfe94('0x4d')](_0x4c7eb6);}})[_0xfe94('0x26')](function(_0x3ea758){if(_0x3ea758){return _0x3ea758?{'count':_0x2fb474,'rows':_0x3ea758}:null;}})[_0xfe94('0x26')](respondWithResult(_0x585dcf,null))['catch'](handleError(_0x585dcf,null));};exports[_0xfe94('0x50')]=function(_0x27e151,_0x46a54d,_0x2c5697){if(_0x27e151[_0xfe94('0x4b')]['id']){delete _0x27e151[_0xfe94('0x4b')]['id'];}return db[_0xfe94('0x2d')][_0xfe94('0x4e')]({'where':{'id':_0x27e151[_0xfe94('0x47')]['id']}})[_0xfe94('0x26')](handleEntityNotFound(_0x46a54d,null))[_0xfe94('0x26')](function(_0xb158a6){if(_0xb158a6){_0x27e151[_0xfe94('0x4b')]['AccountId']=_0xb158a6['id'];_0x27e151[_0xfe94('0x4b')][_0xfe94('0x51')]=integrations[_0xfe94('0x52')](_0x27e151[_0xfe94('0x4b')][_0xfe94('0x53')],_0x27e151[_0xfe94('0x4b')][_0xfe94('0x30')]);_0x27e151['body'][_0xfe94('0x54')]=integrations['getDescriptions'](_0x27e151[_0xfe94('0x4b')][_0xfe94('0x53')],_0x27e151[_0xfe94('0x4b')][_0xfe94('0x30')]);return db[_0xfe94('0x4f')][_0xfe94('0x4a')](_0x27e151[_0xfe94('0x4b')],{'include':[{'model':db[_0xfe94('0x55')],'as':_0xfe94('0x51')},{'model':db[_0xfe94('0x55')],'as':_0xfe94('0x54')}]});}return null;})[_0xfe94('0x26')](respondWithResult(_0x46a54d,null))['catch'](handleError(_0x46a54d,null));};function getAccessToken(_0x26ecd5){return new Promise(function(_0xd2188c,_0x27e4ca){var _0x46664a;switch(_0x26ecd5[_0xfe94('0x56')]){case'US':_0x46664a=_0xfe94('0x57');break;case'AU':_0x46664a='https://accounts.zoho.com.au';break;case'EU':_0x46664a=_0xfe94('0x58');break;case'IN':_0x46664a=_0xfe94('0x59');break;case'CN':_0x46664a=_0xfe94('0x5a');break;default:_0x46664a=_0xfe94('0x58');break;}var _0x4d175b={'method':_0xfe94('0x5b'),'uri':_0x46664a+_0xfe94('0x5c'),'qs':{'refresh_token':_0x26ecd5['refreshToken'],'client_id':_0x26ecd5[_0xfe94('0x5d')],'client_secret':_0x26ecd5[_0xfe94('0x5e')],'grant_type':_0xfe94('0x5f')},'json':!![]};return rp(_0x4d175b)[_0xfe94('0x26')](function(_0x4e90d6){if(_0x4e90d6['access_token']){_0xd2188c(_0x4e90d6[_0xfe94('0x60')]);}else{_0x27e4ca(_0xfe94('0x61'));}})['catch'](function(_0xfaff18){_0x27e4ca(_0xfaff18);});});}exports[_0xfe94('0x62')]=function(_0x5bbeda,_0x248b9f,_0x2c436f){var _0x4bf288,_0x1c16a8,_0xef3c95,_0x12a7d0,_0x2dbc07;return db[_0xfe94('0x2d')][_0xfe94('0x4e')]({'where':{'id':_0x5bbeda[_0xfe94('0x47')]['id']},'attributes':['id',_0xfe94('0x63'),_0xfe94('0x56'),'clientId','clientSecret','serverUrl',_0xfe94('0x64'),_0xfe94('0x65')]})['then'](handleEntityNotFound(_0x248b9f,null))['then'](function(_0x2ae77a){_0x2dbc07=_0x2ae77a;_0x4bf288=_0x2dbc07['host'];_0x1c16a8=_0x4bf288===_0xfe94('0x66')?'eu':'com';_0xef3c95=_0x2dbc07['serverUrl'];var _0x2ed236=_0xef3c95[_0xfe94('0x67')](-0x1);if(_0x2ed236==='/'||_0x2ed236==='\x5c'||_0x2ed236===':'){_0xef3c95=_0xef3c95[_0xfe94('0x68')](0x0,_0xef3c95['lastIndexOf'](_0x2ed236));}if(!_0x2dbc07[_0xfe94('0x65')]){throw new Error(_0xfe94('0x69'));}return getAccessToken(_0x2dbc07);})[_0xfe94('0x26')](function(_0x5c0bfb){if(_0x5c0bfb){return rp({'method':_0xfe94('0x6a'),'uri':util[_0xfe94('0x6b')](_0xfe94('0x6c'),_0x1c16a8),'qs':{'module':_0xfe94('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5c0bfb},'json':!![]});}})['then'](function(_0x4a0df5){if(_0x4a0df5){if(_0x4a0df5[_0xfe94('0x6e')]&&_0x4a0df5[_0xfe94('0x6e')]['error']){throw new Error(_0x4a0df5[_0xfe94('0x6e')]['error'][_0xfe94('0x6f')]);}var _0x54fb43=[];var _0x58c9c4=[];var _0x198d1c=['Owner',_0xfe94('0x70'),_0xfe94('0x71'),'WhoId',_0xfe94('0x72'),'Call_Result',_0xfe94('0x73'),_0xfe94('0x74')];_0x58c9c4=_[_0xfe94('0x75')](_0x4a0df5[_0xfe94('0x48')],function(_0x5013e1){return _0x198d1c['includes'](_0x5013e1[_0xfe94('0x76')]);});for(var _0x383e27=0x0;_0x383e27<_0x58c9c4[_0xfe94('0x38')];_0x383e27++){if(_0x58c9c4[_0x383e27][_0xfe94('0x77')]===![]){_0x54fb43['push']({'id':_0x58c9c4[_0x383e27]['id'],'name':_0x58c9c4[_0x383e27]['display_label'],'custom':_0x58c9c4[_0x383e27]['custom_field'],'options':_0x58c9c4[_0x383e27]['data_type']===_0xfe94('0x78')&&_0x58c9c4[_0x383e27][_0xfe94('0x79')][_0xfe94('0x38')]>-0x1?_[_0xfe94('0x2c')](_0x58c9c4[_0x383e27][_0xfe94('0x79')],function(_0x1a549f){return{'name':_0x1a549f,'value':_0x1a549f};}):[]});}}return{'count':_0x54fb43['length'],'rows':_0x54fb43};}else{return{'count':0x0,'rows':[]};}})[_0xfe94('0x26')](respondWithResult(_0x248b9f,null))[_0xfe94('0x45')](function(_0x1649a3){var _0x4235d1=_0x5bbeda[_0xfe94('0x33')][_0xfe94('0x7a')]?0x1f4:_0x1649a3[_0xfe94('0x7b')]||0x1f4;logger[_0xfe94('0x28')](_0xfe94('0x7c'),_0xfe94('0x62'),_0x4235d1,JSON[_0xfe94('0x7d')](_0x1649a3));delete _0x1649a3['name'];if(_0x4235d1===0x191){_0x4235d1=0x190;}_0x248b9f[_0xfe94('0x1c')](_0x4235d1)[_0xfe94('0x2b')](_0x5bbeda[_0xfe94('0x33')]['test']?{'message':_0xfe94('0x7e'),'statusCode':_0x1649a3['statusCode']}:_0x1649a3);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a27b026..7e5b754 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 _0x758e=['https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','POST','then','inspect','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x758e,0xec));var _0xe758=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x758e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var logger=require(_0xe758('0x1'))(_0xe758('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe758('0x3'));var fs=require('fs');var path=require(_0xe758('0x4'));var rimraf=require(_0xe758('0x5'));var config=require(_0xe758('0x6'));var attributes=require(_0xe758('0x7'));var integrations=require(_0xe758('0x8'));module[_0xe758('0x9')]=function(_0x24c237,_0x45f39b){return _0x24c237[_0xe758('0xa')](_0xe758('0xb'),attributes,{'tableName':_0xe758('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1daf89,_0x2386e8,_0x70b626){if(_0x1daf89['changed'](_0xe758('0xd'))||_0x1daf89[_0xe758('0xe')](_0xe758('0xf'))||_0x1daf89[_0xe758('0xe')]('clientId')||_0x1daf89[_0xe758('0xe')](_0xe758('0x10'))||_0x1daf89[_0xe758('0xe')](_0xe758('0x11'))||_0x1daf89[_0xe758('0xe')](_0xe758('0x12'))){var _0x4a26f4,_0x55b6a8;_0x4a26f4=_0x1daf89['serverUrl'];var _0x490e78=_0x4a26f4[_0xe758('0x13')](-0x1);if(_0x490e78==='/'||_0x490e78==='\x5c'||_0x490e78===':'){_0x4a26f4=_0x4a26f4[_0xe758('0x14')](0x0,_0x4a26f4[_0xe758('0x15')](_0x490e78));}switch(_0x1daf89['zone']){case'US':_0x55b6a8=_0xe758('0x16');break;case'AU':_0x55b6a8=_0xe758('0x17');break;case'IN':_0x55b6a8=_0xe758('0x18');break;case'CN':_0x55b6a8=_0xe758('0x19');break;default:_0x55b6a8=_0xe758('0x1a');break;}var _0x159a0e={'method':'POST','uri':_0x55b6a8+_0xe758('0x1b'),'form':{'grant_type':_0xe758('0x1c'),'client_id':_0x1daf89[_0xe758('0x1d')],'client_secret':_0x1daf89['clientSecret'],'redirect_uri':_0x1daf89['serverUrl'],'code':_0x1daf89[_0xe758('0x11')]},'headers':{'Content-Type':_0xe758('0x1e')}};return rp(_0x159a0e)['then'](function(_0x4eb42d){var _0x85c4c=JSON[_0xe758('0x1f')](_0x4eb42d);if(_0x85c4c[_0xe758('0x20')]){_0x1daf89[_0xe758('0x21')]=_0x85c4c[_0xe758('0x20')];logger['info'](util[_0xe758('0x22')](_0xe758('0x23'),_0x1daf89[_0xe758('0x24')],_0x1daf89['id']));}else{logger['error'](util[_0xe758('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1daf89['name'],_0x1daf89['id']),util['inspect'](_0x85c4c,{'showHidden':![],'depth':null}));}return _0x70b626(null,_0x2386e8);})[_0xe758('0x25')](function(_0x545360){logger[_0xe758('0x26')](util['format'](_0xe758('0x27'),_0x1daf89['name'],_0x1daf89['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x70b626(_0x545360);});}else{return _0x70b626(null,_0x2386e8);}},'beforeUpdate':function(_0x26482a,_0x1db698,_0x253a86){if(_0x26482a['changed']('zone')||_0x26482a[_0xe758('0xe')](_0xe758('0xf'))||_0x26482a[_0xe758('0xe')](_0xe758('0x1d'))||_0x26482a[_0xe758('0xe')](_0xe758('0x10'))||_0x26482a[_0xe758('0xe')](_0xe758('0x11'))||_0x26482a[_0xe758('0xe')](_0xe758('0x12'))){var _0x53e0d8,_0x34b67f;_0x53e0d8=_0x26482a['serverUrl'];var _0x1c65ee=_0x53e0d8[_0xe758('0x13')](-0x1);if(_0x1c65ee==='/'||_0x1c65ee==='\x5c'||_0x1c65ee===':'){_0x53e0d8=_0x53e0d8[_0xe758('0x14')](0x0,_0x53e0d8[_0xe758('0x15')](_0x1c65ee));}switch(_0x26482a['zone']){case'US':_0x34b67f=_0xe758('0x16');break;case'AU':_0x34b67f=_0xe758('0x17');break;case'IN':_0x34b67f=_0xe758('0x18');break;case'CN':_0x34b67f=_0xe758('0x19');break;default:_0x34b67f=_0xe758('0x1a');break;}var _0x3e6ae4={'method':_0xe758('0x28'),'uri':_0x34b67f+_0xe758('0x1b'),'form':{'grant_type':_0xe758('0x1c'),'client_id':_0x26482a[_0xe758('0x1d')],'client_secret':_0x26482a[_0xe758('0x10')],'redirect_uri':_0x26482a[_0xe758('0xf')],'code':_0x26482a[_0xe758('0x11')]},'headers':{'Content-Type':_0xe758('0x1e')}};return rp(_0x3e6ae4)[_0xe758('0x29')](function(_0x5e3bc4){var _0x32bde1=JSON[_0xe758('0x1f')](_0x5e3bc4);if(_0x32bde1[_0xe758('0x20')]){_0x26482a[_0xe758('0x21')]=_0x32bde1[_0xe758('0x20')];logger['info'](util[_0xe758('0x22')](_0xe758('0x23'),_0x26482a[_0xe758('0x24')],_0x26482a['id']));}else{logger['error'](util[_0xe758('0x22')](_0xe758('0x27'),_0x26482a[_0xe758('0x24')],_0x26482a['id']),util[_0xe758('0x2a')](_0x32bde1,{'showHidden':![],'depth':null}));}return _0x253a86(null,_0x1db698);})['catch'](function(_0x5ed756){logger[_0xe758('0x26')](util[_0xe758('0x22')](_0xe758('0x27'),_0x26482a[_0xe758('0x24')],_0x26482a['id']),util[_0xe758('0x2a')](parsedResult,{'showHidden':![],'depth':null}));return _0x253a86(_0x5ed756);});}else{return _0x253a86(null,_0x1db698);}}}});}; \ No newline at end of file +var _0xaee1=['https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','https://accounts.zoho.in','https://accounts.zoho.eu','refreshToken','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','define','ZohoAccount','changed','serverUrl','clientId','slice','substring','lastIndexOf','zone'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xaee1,0x12f));var _0x1aee=function(_0x10b06b,_0x292766){_0x10b06b=_0x10b06b-0x0;var _0x5472c7=_0xaee1[_0x10b06b];return _0x5472c7;};'use strict';var _=require(_0x1aee('0x0'));var util=require('util');var logger=require(_0x1aee('0x1'))('api');var moment=require(_0x1aee('0x2'));var BPromise=require(_0x1aee('0x3'));var rp=require(_0x1aee('0x4'));var fs=require('fs');var path=require(_0x1aee('0x5'));var rimraf=require(_0x1aee('0x6'));var config=require('../../config/environment');var attributes=require(_0x1aee('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x132e49,_0x26daba){return _0x132e49[_0x1aee('0x8')](_0x1aee('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x442481,_0xd26ec5,_0x3816c0){if(_0x442481[_0x1aee('0xa')]('zone')||_0x442481[_0x1aee('0xa')](_0x1aee('0xb'))||_0x442481[_0x1aee('0xa')](_0x1aee('0xc'))||_0x442481[_0x1aee('0xa')]('clientSecret')||_0x442481['changed']('code')||_0x442481[_0x1aee('0xa')]('host')){var _0x3eda32,_0x4aea85;_0x3eda32=_0x442481[_0x1aee('0xb')];var _0x340565=_0x3eda32[_0x1aee('0xd')](-0x1);if(_0x340565==='/'||_0x340565==='\x5c'||_0x340565===':'){_0x3eda32=_0x3eda32[_0x1aee('0xe')](0x0,_0x3eda32[_0x1aee('0xf')](_0x340565));}switch(_0x442481[_0x1aee('0x10')]){case'US':_0x4aea85=_0x1aee('0x11');break;case'AU':_0x4aea85=_0x1aee('0x12');break;case'IN':_0x4aea85='https://accounts.zoho.in';break;case'CN':_0x4aea85=_0x1aee('0x13');break;default:_0x4aea85='https://accounts.zoho.eu';break;}var _0x4b770c={'method':_0x1aee('0x14'),'uri':_0x4aea85+_0x1aee('0x15'),'form':{'grant_type':_0x1aee('0x16'),'client_id':_0x442481[_0x1aee('0xc')],'client_secret':_0x442481[_0x1aee('0x17')],'redirect_uri':_0x442481['serverUrl'],'code':_0x442481[_0x1aee('0x18')]},'headers':{'Content-Type':_0x1aee('0x19')}};return rp(_0x4b770c)[_0x1aee('0x1a')](function(_0x2f1191){var _0x40f8a3=JSON[_0x1aee('0x1b')](_0x2f1191);if(_0x40f8a3['refresh_token']){_0x442481['refreshToken']=_0x40f8a3[_0x1aee('0x1c')];logger[_0x1aee('0x1d')](util[_0x1aee('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x442481[_0x1aee('0x1f')],_0x442481['id']));}else{logger[_0x1aee('0x20')](util[_0x1aee('0x1e')](_0x1aee('0x21'),_0x442481[_0x1aee('0x1f')],_0x442481['id']),util[_0x1aee('0x22')](_0x40f8a3,{'showHidden':![],'depth':null}));}return _0x3816c0(null,_0xd26ec5);})[_0x1aee('0x23')](function(_0x5b4ea7){logger['error'](util['format'](_0x1aee('0x21'),_0x442481['name'],_0x442481['id']),util[_0x1aee('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3816c0(_0x5b4ea7);});}else{return _0x3816c0(null,_0xd26ec5);}},'beforeUpdate':function(_0x4538af,_0x127a8b,_0x5c431f){if(_0x4538af[_0x1aee('0xa')](_0x1aee('0x10'))||_0x4538af[_0x1aee('0xa')](_0x1aee('0xb'))||_0x4538af[_0x1aee('0xa')]('clientId')||_0x4538af[_0x1aee('0xa')](_0x1aee('0x17'))||_0x4538af[_0x1aee('0xa')]('code')||_0x4538af['changed'](_0x1aee('0x24'))){var _0x29941d,_0x5e36e0;_0x29941d=_0x4538af[_0x1aee('0xb')];var _0x110cc5=_0x29941d[_0x1aee('0xd')](-0x1);if(_0x110cc5==='/'||_0x110cc5==='\x5c'||_0x110cc5===':'){_0x29941d=_0x29941d[_0x1aee('0xe')](0x0,_0x29941d[_0x1aee('0xf')](_0x110cc5));}switch(_0x4538af['zone']){case'US':_0x5e36e0=_0x1aee('0x11');break;case'AU':_0x5e36e0=_0x1aee('0x12');break;case'IN':_0x5e36e0=_0x1aee('0x25');break;case'CN':_0x5e36e0=_0x1aee('0x13');break;default:_0x5e36e0=_0x1aee('0x26');break;}var _0x5a8106={'method':_0x1aee('0x14'),'uri':_0x5e36e0+_0x1aee('0x15'),'form':{'grant_type':_0x1aee('0x16'),'client_id':_0x4538af['clientId'],'client_secret':_0x4538af[_0x1aee('0x17')],'redirect_uri':_0x4538af[_0x1aee('0xb')],'code':_0x4538af[_0x1aee('0x18')]},'headers':{'Content-Type':_0x1aee('0x19')}};return rp(_0x5a8106)[_0x1aee('0x1a')](function(_0x3bc981){var _0x10574e=JSON[_0x1aee('0x1b')](_0x3bc981);if(_0x10574e['refresh_token']){_0x4538af[_0x1aee('0x27')]=_0x10574e[_0x1aee('0x1c')];logger[_0x1aee('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4538af[_0x1aee('0x1f')],_0x4538af['id']));}else{logger[_0x1aee('0x20')](util['format'](_0x1aee('0x21'),_0x4538af[_0x1aee('0x1f')],_0x4538af['id']),util[_0x1aee('0x22')](_0x10574e,{'showHidden':![],'depth':null}));}return _0x5c431f(null,_0x127a8b);})[_0x1aee('0x23')](function(_0x18d3c7){logger['error'](util[_0x1aee('0x1e')](_0x1aee('0x21'),_0x4538af['name'],_0x4538af['id']),util[_0x1aee('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x5c431f(_0x18d3c7);});}else{return _0x5c431f(null,_0x127a8b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e7d1906..ce6255c 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 _0x6ab9=['request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowZohoAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x6ab9,0x19a));var _0x96ab=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x6ab9[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2a35,_0xf8e2b1,_0x516cf7){return new BPromise(function(_0x313efb,_0x1e3f17){return client[_0x96ab('0xa')](_0x3d2a35,_0x516cf7)[_0x96ab('0xb')](function(_0x39b50e){logger[_0x96ab('0xc')](_0x96ab('0xd'),_0xf8e2b1,_0x96ab('0xe'));logger[_0x96ab('0xf')](_0x96ab('0x10'),_0xf8e2b1,_0x96ab('0xe'),JSON[_0x96ab('0x11')](_0x39b50e));if(_0x39b50e[_0x96ab('0x12')]){if(_0x39b50e['error'][_0x96ab('0x13')]===0x1f4){logger['error'](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x1e3f17(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}logger[_0x96ab('0x12')](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x313efb(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0xf8e2b1,_0x96ab('0xe'));_0x313efb(_0x39b50e[_0x96ab('0x15')][_0x96ab('0x14')]);}})['catch'](function(_0x43e35e){logger[_0x96ab('0x12')]('ZohoAccount,\x20%s,\x20%s',_0xf8e2b1,_0x43e35e);_0x1e3f17(_0x43e35e);});});}exports[_0x96ab('0x16')]=function(_0x4eca78){var _0x231ed5=this;return new Promise(function(_0x1a502a,_0x397ffc){return db[_0x96ab('0x17')][_0x96ab('0x18')]({'raw':_0x4eca78[_0x96ab('0x19')]?_0x4eca78[_0x96ab('0x19')][_0x96ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eca78[_0x96ab('0x19')]?_0x4eca78[_0x96ab('0x19')][_0x96ab('0x1b')]||null:null,'attributes':_0x4eca78['options']?_0x4eca78['options'][_0x96ab('0x1c')]||null:null,'limit':_0x4eca78[_0x96ab('0x19')]?_0x4eca78[_0x96ab('0x19')]['limit']||null:null,'include':_0x4eca78[_0x96ab('0x19')]?_0x4eca78['options'][_0x96ab('0x1d')]?_['map'](_0x4eca78[_0x96ab('0x19')][_0x96ab('0x1d')],function(_0x5a02d0){return{'model':db[_0x5a02d0[_0x96ab('0x1e')]],'as':_0x5a02d0['as'],'attributes':_0x5a02d0[_0x96ab('0x1c')],'include':_0x5a02d0[_0x96ab('0x1d')]?_[_0x96ab('0x1f')](_0x5a02d0[_0x96ab('0x1d')],function(_0x27d6d5){return{'model':db[_0x27d6d5[_0x96ab('0x1e')]],'as':_0x27d6d5['as'],'attributes':_0x27d6d5[_0x96ab('0x1c')],'include':_0x27d6d5[_0x96ab('0x1d')]?_['map'](_0x27d6d5[_0x96ab('0x1d')],function(_0x524e1c){return{'model':db[_0x524e1c[_0x96ab('0x1e')]],'as':_0x524e1c['as'],'attributes':_0x524e1c[_0x96ab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96ab('0xb')](function(_0x240553){logger[_0x96ab('0xc')](_0x96ab('0x16'),_0x4eca78);logger[_0x96ab('0xf')](_0x96ab('0x16'),_0x4eca78,JSON['stringify'](_0x240553));_0x1a502a(_0x240553);})[_0x96ab('0x20')](function(_0x269c51){logger[_0x96ab('0x12')]('GetZohoAccount',_0x269c51[_0x96ab('0x14')],_0x4eca78);_0x397ffc(_0x231ed5[_0x96ab('0x12')](0x1f4,_0x269c51[_0x96ab('0x14')]));});});};exports[_0x96ab('0x21')]=function(_0xaccba6){var _0x4c9a55=this;return new Promise(function(_0x40a55b,_0x44529b){return db['ZohoAccount'][_0x96ab('0x22')]({'raw':_0xaccba6['options']?_0xaccba6['options']['raw']===undefined?!![]:![]:!![],'where':_0xaccba6['options']?_0xaccba6[_0x96ab('0x19')]['where']||null:null,'attributes':_0xaccba6[_0x96ab('0x19')]?_0xaccba6[_0x96ab('0x19')][_0x96ab('0x1c')]||null:null,'include':_0xaccba6[_0x96ab('0x19')]?_0xaccba6[_0x96ab('0x19')]['include']?_['map'](_0xaccba6[_0x96ab('0x19')][_0x96ab('0x1d')],function(_0x56e3e2){return{'model':db[_0x56e3e2[_0x96ab('0x1e')]],'as':_0x56e3e2['as'],'attributes':_0x56e3e2[_0x96ab('0x1c')],'include':_0x56e3e2['include']?_['map'](_0x56e3e2[_0x96ab('0x1d')],function(_0x39f56d){return{'model':db[_0x39f56d[_0x96ab('0x1e')]],'as':_0x39f56d['as'],'attributes':_0x39f56d[_0x96ab('0x1c')],'include':_0x39f56d['include']?_[_0x96ab('0x1f')](_0x39f56d['include'],function(_0x5e9020){return{'model':db[_0x5e9020[_0x96ab('0x1e')]],'as':_0x5e9020['as'],'attributes':_0x5e9020['attributes']};}):[]};}):[]};}):[]:[]})[_0x96ab('0xb')](function(_0xd3ec3b){logger[_0x96ab('0xc')](_0x96ab('0x21'),_0xaccba6);logger['debug'](_0x96ab('0x21'),_0xaccba6,JSON[_0x96ab('0x11')](_0xd3ec3b));_0x40a55b(_0xd3ec3b);})[_0x96ab('0x20')](function(_0x376775){logger[_0x96ab('0x12')]('ShowZohoAccount',_0x376775[_0x96ab('0x14')],_0xaccba6);_0x44529b(_0x4c9a55['error'](0x1f4,_0x376775[_0x96ab('0x14')]));});});}; \ No newline at end of file +var _0xa817=['stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','info','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xa817,0x7b));var _0x7a81=function(_0x31281a,_0x10040e){_0x31281a=_0x31281a-0x0;var _0x23aa3f=_0xa817[_0x31281a];return _0x23aa3f;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35c35a,_0x3ab25c,_0x705d4e){return new BPromise(function(_0x1869fb,_0x18f6f6){return client['request'](_0x35c35a,_0x705d4e)[_0x7a81('0xc')](function(_0x5b3b66){logger['info'](_0x7a81('0xd'),_0x3ab25c,'request\x20sent');logger[_0x7a81('0xe')](_0x7a81('0xf'),_0x3ab25c,_0x7a81('0x10'),JSON[_0x7a81('0x11')](_0x5b3b66));if(_0x5b3b66[_0x7a81('0x12')]){if(_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x13')]===0x1f4){logger['error'](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x18f6f6(_0x5b3b66['error'][_0x7a81('0x14')]);}logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x1869fb(_0x5b3b66[_0x7a81('0x12')]['message']);}else{logger['info'](_0x7a81('0xd'),_0x3ab25c,_0x7a81('0x10'));_0x1869fb(_0x5b3b66['result'][_0x7a81('0x14')]);}})[_0x7a81('0x15')](function(_0x179afd){logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x179afd);_0x18f6f6(_0x179afd);});});}exports[_0x7a81('0x16')]=function(_0x114cfa){var _0x3d9a4f=this;return new Promise(function(_0x2b5720,_0x220da9){return db[_0x7a81('0x17')][_0x7a81('0x18')]({'raw':_0x114cfa[_0x7a81('0x19')]?_0x114cfa['options'][_0x7a81('0x1a')]===undefined?!![]:![]:!![],'where':_0x114cfa[_0x7a81('0x19')]?_0x114cfa[_0x7a81('0x19')][_0x7a81('0x1b')]||null:null,'attributes':_0x114cfa[_0x7a81('0x19')]?_0x114cfa[_0x7a81('0x19')][_0x7a81('0x1c')]||null:null,'limit':_0x114cfa[_0x7a81('0x19')]?_0x114cfa[_0x7a81('0x19')]['limit']||null:null,'include':_0x114cfa[_0x7a81('0x19')]?_0x114cfa[_0x7a81('0x19')][_0x7a81('0x1d')]?_[_0x7a81('0x1e')](_0x114cfa[_0x7a81('0x19')][_0x7a81('0x1d')],function(_0x249ae1){return{'model':db[_0x249ae1[_0x7a81('0x1f')]],'as':_0x249ae1['as'],'attributes':_0x249ae1['attributes'],'include':_0x249ae1[_0x7a81('0x1d')]?_['map'](_0x249ae1['include'],function(_0x1e2476){return{'model':db[_0x1e2476[_0x7a81('0x1f')]],'as':_0x1e2476['as'],'attributes':_0x1e2476[_0x7a81('0x1c')],'include':_0x1e2476['include']?_[_0x7a81('0x1e')](_0x1e2476[_0x7a81('0x1d')],function(_0x87e708){return{'model':db[_0x87e708[_0x7a81('0x1f')]],'as':_0x87e708['as'],'attributes':_0x87e708[_0x7a81('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38de7c){logger[_0x7a81('0x20')](_0x7a81('0x16'),_0x114cfa);logger[_0x7a81('0xe')](_0x7a81('0x16'),_0x114cfa,JSON[_0x7a81('0x11')](_0x38de7c));_0x2b5720(_0x38de7c);})[_0x7a81('0x15')](function(_0x551c14){logger[_0x7a81('0x12')]('GetZohoAccount',_0x551c14[_0x7a81('0x14')],_0x114cfa);_0x220da9(_0x3d9a4f[_0x7a81('0x12')](0x1f4,_0x551c14[_0x7a81('0x14')]));});});};exports['ShowZohoAccount']=function(_0x3f7e20){var _0x4fc73a=this;return new Promise(function(_0x5e9589,_0x1441bf){return db[_0x7a81('0x17')][_0x7a81('0x21')]({'raw':_0x3f7e20[_0x7a81('0x19')]?_0x3f7e20[_0x7a81('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3f7e20[_0x7a81('0x19')]?_0x3f7e20[_0x7a81('0x19')][_0x7a81('0x1b')]||null:null,'attributes':_0x3f7e20[_0x7a81('0x19')]?_0x3f7e20[_0x7a81('0x19')][_0x7a81('0x1c')]||null:null,'include':_0x3f7e20[_0x7a81('0x19')]?_0x3f7e20['options'][_0x7a81('0x1d')]?_[_0x7a81('0x1e')](_0x3f7e20[_0x7a81('0x19')]['include'],function(_0x3161fe){return{'model':db[_0x3161fe[_0x7a81('0x1f')]],'as':_0x3161fe['as'],'attributes':_0x3161fe[_0x7a81('0x1c')],'include':_0x3161fe[_0x7a81('0x1d')]?_['map'](_0x3161fe[_0x7a81('0x1d')],function(_0x262a0f){return{'model':db[_0x262a0f[_0x7a81('0x1f')]],'as':_0x262a0f['as'],'attributes':_0x262a0f[_0x7a81('0x1c')],'include':_0x262a0f[_0x7a81('0x1d')]?_['map'](_0x262a0f[_0x7a81('0x1d')],function(_0x200b03){return{'model':db[_0x200b03[_0x7a81('0x1f')]],'as':_0x200b03['as'],'attributes':_0x200b03[_0x7a81('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7a81('0xc')](function(_0x41a124){logger[_0x7a81('0x20')]('ShowZohoAccount',_0x3f7e20);logger['debug'](_0x7a81('0x22'),_0x3f7e20,JSON[_0x7a81('0x11')](_0x41a124));_0x5e9589(_0x41a124);})['catch'](function(_0x11c809){logger[_0x7a81('0x12')](_0x7a81('0x22'),_0x11c809['message'],_0x3f7e20);_0x1441bf(_0x4fc73a[_0x7a81('0x12')](0x1f4,_0x11c809[_0x7a81('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index d7d115d..8545b38 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 _0x0c42=['show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x0c42,0x105));var _0x20c4=function(_0x510b33,_0x58ec20){_0x510b33=_0x510b33-0x0;var _0x5a6a89=_0x0c42[_0x510b33];return _0x5a6a89;};'use strict';var multer=require(_0x20c4('0x0'));var util=require(_0x20c4('0x1'));var path=require(_0x20c4('0x2'));var timeout=require('connect-timeout');var express=require(_0x20c4('0x3'));var router=express[_0x20c4('0x4')]();var fs_extra=require(_0x20c4('0x5'));var auth=require(_0x20c4('0x6'));var interaction=require(_0x20c4('0x7'));var config=require(_0x20c4('0x8'));var controller=require(_0x20c4('0x9'));router[_0x20c4('0xa')]('/',auth[_0x20c4('0xb')](),controller[_0x20c4('0xc')]);router['get'](_0x20c4('0xd'),auth[_0x20c4('0xb')](),controller[_0x20c4('0xe')]);router[_0x20c4('0xa')]('/:id/fields',auth[_0x20c4('0xb')](),controller[_0x20c4('0xf')]);router[_0x20c4('0xa')](_0x20c4('0x10'),auth[_0x20c4('0xb')](),controller[_0x20c4('0x11')]);router['get'](_0x20c4('0x12'),auth[_0x20c4('0xb')](),controller[_0x20c4('0x13')]);router['post']('/',auth[_0x20c4('0xb')](),controller['create']);router[_0x20c4('0x14')](_0x20c4('0xd'),auth[_0x20c4('0xb')](),controller[_0x20c4('0x15')]);router[_0x20c4('0x16')](_0x20c4('0xd'),auth[_0x20c4('0xb')](),controller[_0x20c4('0x17')]);module[_0x20c4('0x18')]=router; \ No newline at end of file +var _0xe151=['./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5e0e90,_0x1c8363){var _0x33cfe3=function(_0x44f842){while(--_0x44f842){_0x5e0e90['push'](_0x5e0e90['shift']());}};_0x33cfe3(++_0x1c8363);}(_0xe151,0x1c4));var _0x1e15=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0xe151[_0x4df671];return _0x3f9658;};'use strict';var multer=require(_0x1e15('0x0'));var util=require('util');var path=require(_0x1e15('0x1'));var timeout=require(_0x1e15('0x2'));var express=require(_0x1e15('0x3'));var router=express[_0x1e15('0x4')]();var fs_extra=require(_0x1e15('0x5'));var auth=require(_0x1e15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e15('0x7'));var controller=require(_0x1e15('0x8'));router[_0x1e15('0x9')]('/',auth[_0x1e15('0xa')](),controller[_0x1e15('0xb')]);router[_0x1e15('0x9')](_0x1e15('0xc'),auth[_0x1e15('0xa')](),controller[_0x1e15('0xd')]);router[_0x1e15('0x9')](_0x1e15('0xe'),auth[_0x1e15('0xa')](),controller['getFields']);router[_0x1e15('0x9')]('/:id/subjects',auth[_0x1e15('0xa')](),controller['getSubjects']);router[_0x1e15('0x9')](_0x1e15('0xf'),auth[_0x1e15('0xa')](),controller[_0x1e15('0x10')]);router[_0x1e15('0x11')]('/',auth[_0x1e15('0xa')](),controller[_0x1e15('0x12')]);router[_0x1e15('0x13')](_0x1e15('0xc'),auth[_0x1e15('0xa')](),controller[_0x1e15('0x14')]);router['delete'](_0x1e15('0xc'),auth['isAuthenticated'](),controller[_0x1e15('0x15')]);module[_0x1e15('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 881a70c..127f681 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 _0x58f0=['STRING','ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x1234da,_0x22abc8){var _0x30308d=function(_0xcb4883){while(--_0xcb4883){_0x1234da['push'](_0x1234da['shift']());}};_0x30308d(++_0x22abc8);}(_0x58f0,0x1a6));var _0x058f=function(_0x411223,_0x960fb4){_0x411223=_0x411223-0x0;var _0x3beed8=_0x58f0[_0x411223];return _0x3beed8;};'use strict';var Sequelize=require(_0x058f('0x0'));module[_0x058f('0x1')]={'name':{'type':Sequelize[_0x058f('0x2')]},'moduleCreate':{'type':Sequelize[_0x058f('0x3')](_0x058f('0x4'),_0x058f('0x5'),_0x058f('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x058f('0x3')]('contact_lead',_0x058f('0x5'),_0x058f('0x4')),'defaultValue':_0x058f('0x7')},'description':{'type':Sequelize[_0x058f('0x2')]}}; \ No newline at end of file +var _0xea1b=['exports','STRING','ENUM','lead','nothing','contact','sequelize'];(function(_0x382d24,_0x16ae23){var _0x81b9c=function(_0x5b7dd1){while(--_0x5b7dd1){_0x382d24['push'](_0x382d24['shift']());}};_0x81b9c(++_0x16ae23);}(_0xea1b,0xd8));var _0xbea1=function(_0x4cb9d7,_0x1fd5e5){_0x4cb9d7=_0x4cb9d7-0x0;var _0x422323=_0xea1b[_0x4cb9d7];return _0x422323;};'use strict';var Sequelize=require(_0xbea1('0x0'));module[_0xbea1('0x1')]={'name':{'type':Sequelize[_0xbea1('0x2')]},'moduleCreate':{'type':Sequelize[_0xbea1('0x3')](_0xbea1('0x4'),'contact',_0xbea1('0x5')),'defaultValue':_0xbea1('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xbea1('0x6'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2e46de7..07bd497 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 _0x6a67=['moment','bluebird','mustache','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','getFields','ZohoField','filter','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6a67,0xd7));var _0x76a6=function(_0x30e4c0,_0x58fed1){_0x30e4c0=_0x30e4c0-0x0;var _0x30b6d0=_0x6a67[_0x30e4c0];return _0x30b6d0;};'use strict';var emlformat=require(_0x76a6('0x0'));var rimraf=require(_0x76a6('0x1'));var zipdir=require(_0x76a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76a6('0x3'));var moment=require(_0x76a6('0x4'));var BPromise=require(_0x76a6('0x5'));var Mustache=require(_0x76a6('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x76a6('0x7'));var ejs=require(_0x76a6('0x8'));var fs=require('fs');var fs_extra=require(_0x76a6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x76a6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x76a6('0x7'));var querystring=require('querystring');var Papa=require(_0x76a6('0xb'));var Redis=require(_0x76a6('0xc'));var authService=require(_0x76a6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x76a6('0xe'));var hardwareService=require(_0x76a6('0xf'));var logger=require('../../config/logger')(_0x76a6('0x10'));var utils=require('../../config/utils');var config=require(_0x76a6('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x76a6('0x12'))['db'];function respondWithStatusCode(_0x510e30,_0x343e96){_0x343e96=_0x343e96||0xcc;return function(_0x107899){if(_0x107899){return _0x510e30[_0x76a6('0x13')](_0x343e96);}return _0x510e30[_0x76a6('0x14')](_0x343e96)[_0x76a6('0x15')]();};}function respondWithResult(_0x3b5842,_0xbf3ee0){_0xbf3ee0=_0xbf3ee0||0xc8;return function(_0x2d23d2){if(_0x2d23d2){return _0x3b5842['status'](_0xbf3ee0)[_0x76a6('0x16')](_0x2d23d2);}};}function respondWithFilteredResult(_0x35130f,_0x4796ec){return function(_0x12f86e){if(_0x12f86e){var _0x1e21af=typeof _0x4796ec['offset']===_0x76a6('0x17')&&typeof _0x4796ec['limit']==='undefined';var _0xc11de4=_0x12f86e[_0x76a6('0x18')];var _0x2f50e9=_0x1e21af?0x0:_0x4796ec[_0x76a6('0x19')];var _0x367973=_0x1e21af?_0x12f86e[_0x76a6('0x18')]:_0x4796ec[_0x76a6('0x19')]+_0x4796ec[_0x76a6('0x1a')];var _0x57ba41;if(_0x367973>=_0xc11de4){_0x367973=_0xc11de4;_0x57ba41=0xc8;}else{_0x57ba41=0xce;}_0x35130f[_0x76a6('0x14')](_0x57ba41);return _0x35130f[_0x76a6('0x1b')](_0x76a6('0x1c'),_0x2f50e9+'-'+_0x367973+'/'+_0xc11de4)['json'](_0x12f86e);}return null;};}function patchUpdates(_0x125502){return function(_0x1cd919){try{jsonpatch[_0x76a6('0x1d')](_0x1cd919,_0x125502,!![]);}catch(_0x23ac19){return BPromise['reject'](_0x23ac19);}return _0x1cd919['save']();};}function saveUpdates(_0x41b673,_0x1cc26b){return function(_0x2d8584){if(_0x2d8584){return _0x2d8584[_0x76a6('0x1e')](_0x41b673)['then'](function(_0x583b8d){return _0x583b8d;});}return null;};}function removeEntity(_0x158ed0,_0x296062){return function(_0x463463){if(_0x463463){return _0x463463[_0x76a6('0x1f')]()[_0x76a6('0x20')](function(){_0x158ed0[_0x76a6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5070dc,_0x3b66b9){return function(_0x20dc07){if(!_0x20dc07){_0x5070dc[_0x76a6('0x13')](0x194);}return _0x20dc07;};}function handleError(_0x5252be,_0x3ebe0b){_0x3ebe0b=_0x3ebe0b||0x1f4;return function(_0x601e94){logger['error'](_0x601e94[_0x76a6('0x21')]);if(_0x601e94[_0x76a6('0x22')]){delete _0x601e94['name'];}_0x5252be['status'](_0x3ebe0b)[_0x76a6('0x23')](_0x601e94);};}exports[_0x76a6('0x24')]=function(_0x82d9d4,_0x42d224){var _0x1e1595={},_0x363f8c={},_0xf0024={'count':0x0,'rows':[]};var _0x282084=_[_0x76a6('0x25')](db[_0x76a6('0x26')][_0x76a6('0x27')],function(_0x48e150){return{'name':_0x48e150['fieldName'],'type':_0x48e150[_0x76a6('0x28')]['key']};});_0x363f8c[_0x76a6('0x29')]=_[_0x76a6('0x25')](_0x282084,'name');_0x363f8c[_0x76a6('0x2a')]=_[_0x76a6('0x2b')](_0x82d9d4['query']);_0x363f8c[_0x76a6('0x2c')]=_['intersection'](_0x363f8c['model'],_0x363f8c['query']);_0x1e1595['attributes']=_[_0x76a6('0x2d')](_0x363f8c['model'],qs[_0x76a6('0x2e')](_0x82d9d4[_0x76a6('0x2a')]['fields']));_0x1e1595['attributes']=_0x1e1595[_0x76a6('0x2f')]['length']?_0x1e1595[_0x76a6('0x2f')]:_0x363f8c[_0x76a6('0x29')];if(!_0x82d9d4['query'][_0x76a6('0x30')](_0x76a6('0x31'))){_0x1e1595[_0x76a6('0x1a')]=qs[_0x76a6('0x1a')](_0x82d9d4['query']['limit']);_0x1e1595['offset']=qs[_0x76a6('0x19')](_0x82d9d4[_0x76a6('0x2a')][_0x76a6('0x19')]);}_0x1e1595[_0x76a6('0x32')]=qs['sort'](_0x82d9d4['query'][_0x76a6('0x33')]);_0x1e1595['where']=qs[_0x76a6('0x2c')](_[_0x76a6('0x34')](_0x82d9d4[_0x76a6('0x2a')],_0x363f8c[_0x76a6('0x2c')]),_0x282084);if(_0x82d9d4['query']['filter']){_0x1e1595[_0x76a6('0x35')]=_[_0x76a6('0x36')](_0x1e1595[_0x76a6('0x35')],{'$or':_[_0x76a6('0x25')](_0x282084,function(_0x1ba847){if(_0x1ba847['type']!=='VIRTUAL'){var _0xade791={};_0xade791[_0x1ba847[_0x76a6('0x22')]]={'$like':'%'+_0x82d9d4[_0x76a6('0x2a')]['filter']+'%'};return _0xade791;}})});}_0x1e1595=_['merge']({},_0x1e1595,_0x82d9d4[_0x76a6('0x37')]);var _0x11f64f={'where':_0x1e1595[_0x76a6('0x35')]};return db['ZohoConfiguration'][_0x76a6('0x18')](_0x11f64f)[_0x76a6('0x20')](function(_0x1d8496){_0xf0024[_0x76a6('0x18')]=_0x1d8496;if(_0x82d9d4[_0x76a6('0x2a')]['includeAll']){_0x1e1595[_0x76a6('0x38')]=[{'all':!![]}];}return db[_0x76a6('0x26')][_0x76a6('0x39')](_0x1e1595);})[_0x76a6('0x20')](function(_0x180c2a){_0xf0024[_0x76a6('0x3a')]=_0x180c2a;return _0xf0024;})[_0x76a6('0x20')](respondWithFilteredResult(_0x42d224,_0x1e1595))[_0x76a6('0x3b')](handleError(_0x42d224,null));};exports[_0x76a6('0x3c')]=function(_0x1593f5,_0x9d4756){var _0x4d154d={'raw':![],'where':{'id':_0x1593f5['params']['id']}},_0x22b9bf={};_0x22b9bf['model']=_[_0x76a6('0x2b')](db[_0x76a6('0x26')]['rawAttributes']);_0x22b9bf['query']=_[_0x76a6('0x2b')](_0x1593f5[_0x76a6('0x2a')]);_0x22b9bf[_0x76a6('0x2c')]=_[_0x76a6('0x2d')](_0x22b9bf[_0x76a6('0x29')],_0x22b9bf[_0x76a6('0x2a')]);_0x4d154d[_0x76a6('0x2f')]=_[_0x76a6('0x2d')](_0x22b9bf[_0x76a6('0x29')],qs['fields'](_0x1593f5[_0x76a6('0x2a')][_0x76a6('0x2e')]));_0x4d154d[_0x76a6('0x2f')]=_0x4d154d['attributes'][_0x76a6('0x3d')]?_0x4d154d[_0x76a6('0x2f')]:_0x22b9bf[_0x76a6('0x29')];if(_0x1593f5[_0x76a6('0x2a')][_0x76a6('0x3e')]){_0x4d154d[_0x76a6('0x38')]=[{'all':!![]}];}_0x4d154d=_[_0x76a6('0x36')]({},_0x4d154d,_0x1593f5[_0x76a6('0x37')]);return db['ZohoConfiguration'][_0x76a6('0x3f')](_0x4d154d)['then'](handleEntityNotFound(_0x9d4756,null))['then'](respondWithResult(_0x9d4756,null))['catch'](handleError(_0x9d4756,null));};exports[_0x76a6('0x40')]=function(_0x4c60f6,_0x901f07){return db[_0x76a6('0x26')][_0x76a6('0x40')](_0x4c60f6[_0x76a6('0x41')],{})['then'](respondWithResult(_0x901f07,0xc9))['catch'](handleError(_0x901f07,null));};exports['update']=function(_0x33d8a2,_0x231679){if(_0x33d8a2['body']['id']){delete _0x33d8a2[_0x76a6('0x41')]['id'];}return db['ZohoConfiguration'][_0x76a6('0x3f')]({'where':{'id':_0x33d8a2[_0x76a6('0x42')]['id']}})[_0x76a6('0x20')](handleEntityNotFound(_0x231679,null))[_0x76a6('0x20')](saveUpdates(_0x33d8a2[_0x76a6('0x41')],null))[_0x76a6('0x20')](respondWithResult(_0x231679,null))[_0x76a6('0x3b')](handleError(_0x231679,null));};exports['destroy']=function(_0x33cc78,_0x158d87){return db[_0x76a6('0x26')][_0x76a6('0x3f')]({'where':{'id':_0x33cc78[_0x76a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x158d87,null))[_0x76a6('0x20')](removeEntity(_0x158d87,null))[_0x76a6('0x3b')](handleError(_0x158d87,null));};exports[_0x76a6('0x43')]=function(_0x3b1b44,_0x15e3ba,_0x14e873){var _0x30fa8e={};var _0x13b38f={};var _0x43bdcc;var _0x486ba7;return db[_0x76a6('0x26')]['findOne']({'where':{'id':_0x3b1b44[_0x76a6('0x42')]['id']}})[_0x76a6('0x20')](handleEntityNotFound(_0x15e3ba,null))[_0x76a6('0x20')](function(_0x11d45b){if(_0x11d45b){_0x43bdcc=_0x11d45b;_0x13b38f['model']=_['keys'](db[_0x76a6('0x44')][_0x76a6('0x27')]);_0x13b38f['query']=_['keys'](_0x3b1b44[_0x76a6('0x2a')]);_0x13b38f[_0x76a6('0x2c')]=_[_0x76a6('0x2d')](_0x13b38f['model'],_0x13b38f[_0x76a6('0x2a')]);_0x30fa8e[_0x76a6('0x2f')]=_[_0x76a6('0x2d')](_0x13b38f[_0x76a6('0x29')],qs[_0x76a6('0x2e')](_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x2e')]));_0x30fa8e[_0x76a6('0x2f')]=_0x30fa8e[_0x76a6('0x2f')][_0x76a6('0x3d')]?_0x30fa8e['attributes']:_0x13b38f['model'];_0x30fa8e[_0x76a6('0x32')]=qs[_0x76a6('0x33')](_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x33')]);_0x30fa8e[_0x76a6('0x35')]=qs['filters'](_['pick'](_0x3b1b44[_0x76a6('0x2a')],_0x13b38f['filters']));if(_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x45')]){_0x30fa8e[_0x76a6('0x35')]=_[_0x76a6('0x36')](_0x30fa8e[_0x76a6('0x35')],{'$or':_[_0x76a6('0x25')](_0x30fa8e['attributes'],function(_0xd6d6b5){var _0x32c410={};_0x32c410[_0xd6d6b5]={'$like':'%'+_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x45')]+'%'};return _0x32c410;})});}_0x30fa8e=_[_0x76a6('0x36')]({},_0x30fa8e,_0x3b1b44['options']);return _0x43bdcc[_0x76a6('0x43')](_0x30fa8e);}})[_0x76a6('0x20')](function(_0xf79479){if(_0xf79479){_0x486ba7=_0xf79479[_0x76a6('0x3d')];if(!_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x30')](_0x76a6('0x31'))){_0x30fa8e[_0x76a6('0x1a')]=qs['limit'](_0x3b1b44[_0x76a6('0x2a')][_0x76a6('0x1a')]);_0x30fa8e[_0x76a6('0x19')]=qs[_0x76a6('0x19')](_0x3b1b44['query'][_0x76a6('0x19')]);}return _0x43bdcc[_0x76a6('0x43')](_0x30fa8e);}})[_0x76a6('0x20')](function(_0x4a307c){if(_0x4a307c){return _0x4a307c?{'count':_0x486ba7,'rows':_0x4a307c}:null;}})[_0x76a6('0x20')](respondWithResult(_0x15e3ba,null))[_0x76a6('0x3b')](handleError(_0x15e3ba,null));};exports[_0x76a6('0x46')]=function(_0xd7f07a,_0x5b9407,_0x277da3){var _0x54f362={};var _0x3b8306={};var _0xc4fa11;var _0xa46d49;return db['ZohoConfiguration'][_0x76a6('0x47')]({'where':{'id':_0xd7f07a[_0x76a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b9407,null))['then'](function(_0x20c319){if(_0x20c319){_0xc4fa11=_0x20c319;_0x3b8306['model']=_[_0x76a6('0x2b')](db['ZohoField']['rawAttributes']);_0x3b8306['query']=_[_0x76a6('0x2b')](_0xd7f07a[_0x76a6('0x2a')]);_0x3b8306[_0x76a6('0x2c')]=_['intersection'](_0x3b8306[_0x76a6('0x29')],_0x3b8306['query']);_0x54f362[_0x76a6('0x2f')]=_[_0x76a6('0x2d')](_0x3b8306['model'],qs[_0x76a6('0x2e')](_0xd7f07a['query'][_0x76a6('0x2e')]));_0x54f362[_0x76a6('0x2f')]=_0x54f362[_0x76a6('0x2f')][_0x76a6('0x3d')]?_0x54f362[_0x76a6('0x2f')]:_0x3b8306[_0x76a6('0x29')];_0x54f362[_0x76a6('0x32')]=qs[_0x76a6('0x33')](_0xd7f07a[_0x76a6('0x2a')][_0x76a6('0x33')]);_0x54f362['where']=qs[_0x76a6('0x2c')](_[_0x76a6('0x34')](_0xd7f07a[_0x76a6('0x2a')],_0x3b8306[_0x76a6('0x2c')]));if(_0xd7f07a[_0x76a6('0x2a')][_0x76a6('0x45')]){_0x54f362[_0x76a6('0x35')]=_[_0x76a6('0x36')](_0x54f362[_0x76a6('0x35')],{'$or':_[_0x76a6('0x25')](_0x54f362[_0x76a6('0x2f')],function(_0x2ca98d){var _0x9d7be2={};_0x9d7be2[_0x2ca98d]={'$like':'%'+_0xd7f07a[_0x76a6('0x2a')][_0x76a6('0x45')]+'%'};return _0x9d7be2;})});}_0x54f362=_[_0x76a6('0x36')]({},_0x54f362,_0xd7f07a['options']);return _0xc4fa11[_0x76a6('0x46')](_0x54f362);}})[_0x76a6('0x20')](function(_0x2ae986){if(_0x2ae986){_0xa46d49=_0x2ae986[_0x76a6('0x3d')];if(!_0xd7f07a[_0x76a6('0x2a')][_0x76a6('0x30')](_0x76a6('0x31'))){_0x54f362[_0x76a6('0x1a')]=qs[_0x76a6('0x1a')](_0xd7f07a['query']['limit']);_0x54f362[_0x76a6('0x19')]=qs['offset'](_0xd7f07a[_0x76a6('0x2a')][_0x76a6('0x19')]);}return _0xc4fa11[_0x76a6('0x46')](_0x54f362);}})[_0x76a6('0x20')](function(_0x171984){if(_0x171984){return _0x171984?{'count':_0xa46d49,'rows':_0x171984}:null;}})[_0x76a6('0x20')](respondWithResult(_0x5b9407,null))[_0x76a6('0x3b')](handleError(_0x5b9407,null));};exports[_0x76a6('0x48')]=function(_0x26b0da,_0xd05150,_0x5c5643){var _0x5bcf18={};var _0x572bf7={};var _0x2e77b1;var _0xbb500d;return db[_0x76a6('0x26')][_0x76a6('0x47')]({'where':{'id':_0x26b0da[_0x76a6('0x42')]['id']}})[_0x76a6('0x20')](handleEntityNotFound(_0xd05150,null))[_0x76a6('0x20')](function(_0x5cd627){if(_0x5cd627){_0x2e77b1=_0x5cd627;_0x572bf7['model']=_['keys'](db[_0x76a6('0x44')][_0x76a6('0x27')]);_0x572bf7[_0x76a6('0x2a')]=_[_0x76a6('0x2b')](_0x26b0da[_0x76a6('0x2a')]);_0x572bf7[_0x76a6('0x2c')]=_[_0x76a6('0x2d')](_0x572bf7[_0x76a6('0x29')],_0x572bf7[_0x76a6('0x2a')]);_0x5bcf18[_0x76a6('0x2f')]=_[_0x76a6('0x2d')](_0x572bf7[_0x76a6('0x29')],qs[_0x76a6('0x2e')](_0x26b0da[_0x76a6('0x2a')]['fields']));_0x5bcf18[_0x76a6('0x2f')]=_0x5bcf18['attributes'][_0x76a6('0x3d')]?_0x5bcf18[_0x76a6('0x2f')]:_0x572bf7[_0x76a6('0x29')];_0x5bcf18[_0x76a6('0x32')]=qs[_0x76a6('0x33')](_0x26b0da[_0x76a6('0x2a')][_0x76a6('0x33')]);_0x5bcf18['where']=qs['filters'](_[_0x76a6('0x34')](_0x26b0da[_0x76a6('0x2a')],_0x572bf7['filters']));if(_0x26b0da[_0x76a6('0x2a')][_0x76a6('0x45')]){_0x5bcf18[_0x76a6('0x35')]=_[_0x76a6('0x36')](_0x5bcf18[_0x76a6('0x35')],{'$or':_[_0x76a6('0x25')](_0x5bcf18[_0x76a6('0x2f')],function(_0x3c8760){var _0x5d2130={};_0x5d2130[_0x3c8760]={'$like':'%'+_0x26b0da['query'][_0x76a6('0x45')]+'%'};return _0x5d2130;})});}_0x5bcf18=_['merge']({},_0x5bcf18,_0x26b0da['options']);return _0x2e77b1[_0x76a6('0x48')](_0x5bcf18);}})[_0x76a6('0x20')](function(_0x5444da){if(_0x5444da){_0xbb500d=_0x5444da[_0x76a6('0x3d')];if(!_0x26b0da[_0x76a6('0x2a')][_0x76a6('0x30')](_0x76a6('0x31'))){_0x5bcf18['limit']=qs['limit'](_0x26b0da['query'][_0x76a6('0x1a')]);_0x5bcf18[_0x76a6('0x19')]=qs[_0x76a6('0x19')](_0x26b0da[_0x76a6('0x2a')][_0x76a6('0x19')]);}return _0x2e77b1[_0x76a6('0x48')](_0x5bcf18);}})['then'](function(_0x5234cd){if(_0x5234cd){return _0x5234cd?{'count':_0xbb500d,'rows':_0x5234cd}:null;}})[_0x76a6('0x20')](respondWithResult(_0xd05150,null))['catch'](handleError(_0xd05150,null));}; \ No newline at end of file +var _0x8253=['create','body','update','find','getFields','findOne','ZohoField','pick','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','reject','save','destroy','then','error','stack','name','send','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','findAll','catch','show','params','include'];(function(_0x533437,_0x4d59d1){var _0x53f4ce=function(_0x483f6b){while(--_0x483f6b){_0x533437['push'](_0x533437['shift']());}};_0x53f4ce(++_0x4d59d1);}(_0x8253,0x153));var _0x3825=function(_0x60fb10,_0xd27019){_0x60fb10=_0x60fb10-0x0;var _0x1de1ef=_0x8253[_0x60fb10];return _0x1de1ef;};'use strict';var emlformat=require(_0x3825('0x0'));var rimraf=require(_0x3825('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3825('0x2'));var rp=require(_0x3825('0x3'));var moment=require(_0x3825('0x4'));var BPromise=require(_0x3825('0x5'));var Mustache=require(_0x3825('0x6'));var util=require(_0x3825('0x7'));var path=require(_0x3825('0x8'));var sox=require(_0x3825('0x9'));var csv=require(_0x3825('0xa'));var ejs=require(_0x3825('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3825('0xc'));var squel=require(_0x3825('0xd'));var crypto=require(_0x3825('0xe'));var jsforce=require(_0x3825('0xf'));var deskjs=require(_0x3825('0x10'));var toCsv=require(_0x3825('0xa'));var querystring=require(_0x3825('0x11'));var Papa=require(_0x3825('0x12'));var Redis=require(_0x3825('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3825('0x14'));var logger=require(_0x3825('0x15'))(_0x3825('0x16'));var utils=require(_0x3825('0x17'));var config=require(_0x3825('0x18'));var licenseUtil=require(_0x3825('0x19'));var db=require(_0x3825('0x1a'))['db'];function respondWithStatusCode(_0x182ad5,_0x50a5dc){_0x50a5dc=_0x50a5dc||0xcc;return function(_0x248f6f){if(_0x248f6f){return _0x182ad5[_0x3825('0x1b')](_0x50a5dc);}return _0x182ad5['status'](_0x50a5dc)[_0x3825('0x1c')]();};}function respondWithResult(_0x103259,_0x46620b){_0x46620b=_0x46620b||0xc8;return function(_0x931e8f){if(_0x931e8f){return _0x103259[_0x3825('0x1d')](_0x46620b)[_0x3825('0x1e')](_0x931e8f);}};}function respondWithFilteredResult(_0x43dbff,_0x1d98fb){return function(_0x38ca68){if(_0x38ca68){var _0x4a1cfb=typeof _0x1d98fb[_0x3825('0x1f')]==='undefined'&&typeof _0x1d98fb[_0x3825('0x20')]==='undefined';var _0x2a066d=_0x38ca68[_0x3825('0x21')];var _0x24470e=_0x4a1cfb?0x0:_0x1d98fb['offset'];var _0x1704da=_0x4a1cfb?_0x38ca68[_0x3825('0x21')]:_0x1d98fb[_0x3825('0x1f')]+_0x1d98fb[_0x3825('0x20')];var _0x498f3a;if(_0x1704da>=_0x2a066d){_0x1704da=_0x2a066d;_0x498f3a=0xc8;}else{_0x498f3a=0xce;}_0x43dbff[_0x3825('0x1d')](_0x498f3a);return _0x43dbff[_0x3825('0x22')]('Content-Range',_0x24470e+'-'+_0x1704da+'/'+_0x2a066d)['json'](_0x38ca68);}return null;};}function patchUpdates(_0x4ce91b){return function(_0x14f3e1){try{jsonpatch[_0x3825('0x23')](_0x14f3e1,_0x4ce91b,!![]);}catch(_0x5730eb){return BPromise[_0x3825('0x24')](_0x5730eb);}return _0x14f3e1[_0x3825('0x25')]();};}function saveUpdates(_0x3619dc,_0x4c84dd){return function(_0x5a92d2){if(_0x5a92d2){return _0x5a92d2['update'](_0x3619dc)['then'](function(_0x6bfd7f){return _0x6bfd7f;});}return null;};}function removeEntity(_0x1ae009,_0x3ca92a){return function(_0x1fef29){if(_0x1fef29){return _0x1fef29[_0x3825('0x26')]()[_0x3825('0x27')](function(){_0x1ae009[_0x3825('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53e293,_0x23e52f){return function(_0x208a0e){if(!_0x208a0e){_0x53e293[_0x3825('0x1b')](0x194);}return _0x208a0e;};}function handleError(_0x317458,_0x23db7e){_0x23db7e=_0x23db7e||0x1f4;return function(_0x50da70){logger[_0x3825('0x28')](_0x50da70[_0x3825('0x29')]);if(_0x50da70[_0x3825('0x2a')]){delete _0x50da70[_0x3825('0x2a')];}_0x317458[_0x3825('0x1d')](_0x23db7e)[_0x3825('0x2b')](_0x50da70);};}exports['index']=function(_0x2fe2ea,_0x593389){var _0x42cbf0={},_0xcea8fb={},_0x7c4154={'count':0x0,'rows':[]};var _0x5aa5d8=_['map'](db[_0x3825('0x2c')][_0x3825('0x2d')],function(_0x4d7963){return{'name':_0x4d7963[_0x3825('0x2e')],'type':_0x4d7963[_0x3825('0x2f')][_0x3825('0x30')]};});_0xcea8fb[_0x3825('0x31')]=_[_0x3825('0x32')](_0x5aa5d8,_0x3825('0x2a'));_0xcea8fb[_0x3825('0x33')]=_[_0x3825('0x34')](_0x2fe2ea[_0x3825('0x33')]);_0xcea8fb[_0x3825('0x35')]=_['intersection'](_0xcea8fb[_0x3825('0x31')],_0xcea8fb[_0x3825('0x33')]);_0x42cbf0[_0x3825('0x36')]=_[_0x3825('0x37')](_0xcea8fb['model'],qs[_0x3825('0x38')](_0x2fe2ea['query'][_0x3825('0x38')]));_0x42cbf0['attributes']=_0x42cbf0['attributes'][_0x3825('0x39')]?_0x42cbf0[_0x3825('0x36')]:_0xcea8fb[_0x3825('0x31')];if(!_0x2fe2ea[_0x3825('0x33')][_0x3825('0x3a')](_0x3825('0x3b'))){_0x42cbf0['limit']=qs[_0x3825('0x20')](_0x2fe2ea[_0x3825('0x33')][_0x3825('0x20')]);_0x42cbf0[_0x3825('0x1f')]=qs[_0x3825('0x1f')](_0x2fe2ea[_0x3825('0x33')][_0x3825('0x1f')]);}_0x42cbf0['order']=qs['sort'](_0x2fe2ea[_0x3825('0x33')][_0x3825('0x3c')]);_0x42cbf0['where']=qs[_0x3825('0x35')](_['pick'](_0x2fe2ea[_0x3825('0x33')],_0xcea8fb[_0x3825('0x35')]),_0x5aa5d8);if(_0x2fe2ea['query'][_0x3825('0x3d')]){_0x42cbf0['where']=_[_0x3825('0x3e')](_0x42cbf0[_0x3825('0x3f')],{'$or':_[_0x3825('0x32')](_0x5aa5d8,function(_0x5061f8){if(_0x5061f8[_0x3825('0x2f')]!=='VIRTUAL'){var _0x5b1823={};_0x5b1823[_0x5061f8[_0x3825('0x2a')]]={'$like':'%'+_0x2fe2ea[_0x3825('0x33')][_0x3825('0x3d')]+'%'};return _0x5b1823;}})});}_0x42cbf0=_[_0x3825('0x3e')]({},_0x42cbf0,_0x2fe2ea[_0x3825('0x40')]);var _0x54d267={'where':_0x42cbf0[_0x3825('0x3f')]};return db[_0x3825('0x2c')][_0x3825('0x21')](_0x54d267)[_0x3825('0x27')](function(_0x347a4c){_0x7c4154[_0x3825('0x21')]=_0x347a4c;if(_0x2fe2ea[_0x3825('0x33')][_0x3825('0x41')]){_0x42cbf0['include']=[{'all':!![]}];}return db[_0x3825('0x2c')][_0x3825('0x42')](_0x42cbf0);})['then'](function(_0x1b32f9){_0x7c4154['rows']=_0x1b32f9;return _0x7c4154;})[_0x3825('0x27')](respondWithFilteredResult(_0x593389,_0x42cbf0))[_0x3825('0x43')](handleError(_0x593389,null));};exports[_0x3825('0x44')]=function(_0x4b2fcc,_0x30aea4){var _0x13ac73={'raw':![],'where':{'id':_0x4b2fcc[_0x3825('0x45')]['id']}},_0x13f744={};_0x13f744[_0x3825('0x31')]=_['keys'](db[_0x3825('0x2c')][_0x3825('0x2d')]);_0x13f744[_0x3825('0x33')]=_[_0x3825('0x34')](_0x4b2fcc[_0x3825('0x33')]);_0x13f744['filters']=_['intersection'](_0x13f744[_0x3825('0x31')],_0x13f744[_0x3825('0x33')]);_0x13ac73[_0x3825('0x36')]=_[_0x3825('0x37')](_0x13f744[_0x3825('0x31')],qs['fields'](_0x4b2fcc[_0x3825('0x33')][_0x3825('0x38')]));_0x13ac73[_0x3825('0x36')]=_0x13ac73[_0x3825('0x36')][_0x3825('0x39')]?_0x13ac73['attributes']:_0x13f744[_0x3825('0x31')];if(_0x4b2fcc[_0x3825('0x33')][_0x3825('0x41')]){_0x13ac73[_0x3825('0x46')]=[{'all':!![]}];}_0x13ac73=_[_0x3825('0x3e')]({},_0x13ac73,_0x4b2fcc['options']);return db[_0x3825('0x2c')]['find'](_0x13ac73)[_0x3825('0x27')](handleEntityNotFound(_0x30aea4,null))[_0x3825('0x27')](respondWithResult(_0x30aea4,null))['catch'](handleError(_0x30aea4,null));};exports[_0x3825('0x47')]=function(_0x36f8a5,_0x4d0fb4){return db[_0x3825('0x2c')][_0x3825('0x47')](_0x36f8a5[_0x3825('0x48')],{})['then'](respondWithResult(_0x4d0fb4,0xc9))[_0x3825('0x43')](handleError(_0x4d0fb4,null));};exports[_0x3825('0x49')]=function(_0x5e058c,_0x38aba9){if(_0x5e058c[_0x3825('0x48')]['id']){delete _0x5e058c[_0x3825('0x48')]['id'];}return db['ZohoConfiguration'][_0x3825('0x4a')]({'where':{'id':_0x5e058c[_0x3825('0x45')]['id']}})[_0x3825('0x27')](handleEntityNotFound(_0x38aba9,null))[_0x3825('0x27')](saveUpdates(_0x5e058c[_0x3825('0x48')],null))[_0x3825('0x27')](respondWithResult(_0x38aba9,null))['catch'](handleError(_0x38aba9,null));};exports[_0x3825('0x26')]=function(_0x4f4331,_0xa2da43){return db[_0x3825('0x2c')][_0x3825('0x4a')]({'where':{'id':_0x4f4331[_0x3825('0x45')]['id']}})['then'](handleEntityNotFound(_0xa2da43,null))[_0x3825('0x27')](removeEntity(_0xa2da43,null))['catch'](handleError(_0xa2da43,null));};exports[_0x3825('0x4b')]=function(_0x16fe8c,_0x101bf6,_0xd33872){var _0x4db78c={};var _0x3fd746={};var _0x30fa71;var _0x7740f4;return db[_0x3825('0x2c')][_0x3825('0x4c')]({'where':{'id':_0x16fe8c['params']['id']}})['then'](handleEntityNotFound(_0x101bf6,null))[_0x3825('0x27')](function(_0x278cf5){if(_0x278cf5){_0x30fa71=_0x278cf5;_0x3fd746[_0x3825('0x31')]=_[_0x3825('0x34')](db[_0x3825('0x4d')][_0x3825('0x2d')]);_0x3fd746[_0x3825('0x33')]=_['keys'](_0x16fe8c['query']);_0x3fd746[_0x3825('0x35')]=_[_0x3825('0x37')](_0x3fd746[_0x3825('0x31')],_0x3fd746['query']);_0x4db78c[_0x3825('0x36')]=_['intersection'](_0x3fd746['model'],qs[_0x3825('0x38')](_0x16fe8c[_0x3825('0x33')][_0x3825('0x38')]));_0x4db78c[_0x3825('0x36')]=_0x4db78c[_0x3825('0x36')][_0x3825('0x39')]?_0x4db78c[_0x3825('0x36')]:_0x3fd746[_0x3825('0x31')];_0x4db78c['order']=qs['sort'](_0x16fe8c[_0x3825('0x33')]['sort']);_0x4db78c[_0x3825('0x3f')]=qs['filters'](_[_0x3825('0x4e')](_0x16fe8c[_0x3825('0x33')],_0x3fd746[_0x3825('0x35')]));if(_0x16fe8c['query'][_0x3825('0x3d')]){_0x4db78c['where']=_['merge'](_0x4db78c[_0x3825('0x3f')],{'$or':_[_0x3825('0x32')](_0x4db78c[_0x3825('0x36')],function(_0x78f43c){var _0x171cc2={};_0x171cc2[_0x78f43c]={'$like':'%'+_0x16fe8c[_0x3825('0x33')][_0x3825('0x3d')]+'%'};return _0x171cc2;})});}_0x4db78c=_[_0x3825('0x3e')]({},_0x4db78c,_0x16fe8c['options']);return _0x30fa71[_0x3825('0x4b')](_0x4db78c);}})[_0x3825('0x27')](function(_0x11c621){if(_0x11c621){_0x7740f4=_0x11c621[_0x3825('0x39')];if(!_0x16fe8c[_0x3825('0x33')][_0x3825('0x3a')](_0x3825('0x3b'))){_0x4db78c[_0x3825('0x20')]=qs[_0x3825('0x20')](_0x16fe8c[_0x3825('0x33')][_0x3825('0x20')]);_0x4db78c[_0x3825('0x1f')]=qs[_0x3825('0x1f')](_0x16fe8c[_0x3825('0x33')][_0x3825('0x1f')]);}return _0x30fa71[_0x3825('0x4b')](_0x4db78c);}})[_0x3825('0x27')](function(_0x6a1732){if(_0x6a1732){return _0x6a1732?{'count':_0x7740f4,'rows':_0x6a1732}:null;}})['then'](respondWithResult(_0x101bf6,null))['catch'](handleError(_0x101bf6,null));};exports[_0x3825('0x4f')]=function(_0x1826c4,_0x1a8b5e,_0x6d9545){var _0x3d332c={};var _0x19f134={};var _0xdc27bf;var _0x38c40c;return db[_0x3825('0x2c')][_0x3825('0x4c')]({'where':{'id':_0x1826c4[_0x3825('0x45')]['id']}})[_0x3825('0x27')](handleEntityNotFound(_0x1a8b5e,null))[_0x3825('0x27')](function(_0x1c7f23){if(_0x1c7f23){_0xdc27bf=_0x1c7f23;_0x19f134[_0x3825('0x31')]=_[_0x3825('0x34')](db[_0x3825('0x4d')]['rawAttributes']);_0x19f134[_0x3825('0x33')]=_[_0x3825('0x34')](_0x1826c4[_0x3825('0x33')]);_0x19f134['filters']=_[_0x3825('0x37')](_0x19f134[_0x3825('0x31')],_0x19f134['query']);_0x3d332c[_0x3825('0x36')]=_[_0x3825('0x37')](_0x19f134['model'],qs[_0x3825('0x38')](_0x1826c4[_0x3825('0x33')][_0x3825('0x38')]));_0x3d332c[_0x3825('0x36')]=_0x3d332c[_0x3825('0x36')][_0x3825('0x39')]?_0x3d332c[_0x3825('0x36')]:_0x19f134['model'];_0x3d332c[_0x3825('0x50')]=qs[_0x3825('0x3c')](_0x1826c4[_0x3825('0x33')]['sort']);_0x3d332c[_0x3825('0x3f')]=qs[_0x3825('0x35')](_['pick'](_0x1826c4[_0x3825('0x33')],_0x19f134[_0x3825('0x35')]));if(_0x1826c4['query']['filter']){_0x3d332c['where']=_[_0x3825('0x3e')](_0x3d332c[_0x3825('0x3f')],{'$or':_[_0x3825('0x32')](_0x3d332c[_0x3825('0x36')],function(_0x14f15c){var _0x4315b3={};_0x4315b3[_0x14f15c]={'$like':'%'+_0x1826c4[_0x3825('0x33')][_0x3825('0x3d')]+'%'};return _0x4315b3;})});}_0x3d332c=_['merge']({},_0x3d332c,_0x1826c4[_0x3825('0x40')]);return _0xdc27bf[_0x3825('0x4f')](_0x3d332c);}})[_0x3825('0x27')](function(_0xcfd62f){if(_0xcfd62f){_0x38c40c=_0xcfd62f[_0x3825('0x39')];if(!_0x1826c4[_0x3825('0x33')][_0x3825('0x3a')]('nolimit')){_0x3d332c[_0x3825('0x20')]=qs[_0x3825('0x20')](_0x1826c4['query'][_0x3825('0x20')]);_0x3d332c[_0x3825('0x1f')]=qs['offset'](_0x1826c4[_0x3825('0x33')][_0x3825('0x1f')]);}return _0xdc27bf[_0x3825('0x4f')](_0x3d332c);}})['then'](function(_0x475c29){if(_0x475c29){return _0x475c29?{'count':_0x38c40c,'rows':_0x475c29}:null;}})[_0x3825('0x27')](respondWithResult(_0x1a8b5e,null))[_0x3825('0x43')](handleError(_0x1a8b5e,null));};exports[_0x3825('0x51')]=function(_0x1cc72e,_0x19a497,_0x2d8672){var _0x3a448a={};var _0x1fddd0={};var _0x4f5fc0;var _0x256cfa;return db[_0x3825('0x2c')][_0x3825('0x4c')]({'where':{'id':_0x1cc72e['params']['id']}})[_0x3825('0x27')](handleEntityNotFound(_0x19a497,null))[_0x3825('0x27')](function(_0x172441){if(_0x172441){_0x4f5fc0=_0x172441;_0x1fddd0[_0x3825('0x31')]=_[_0x3825('0x34')](db['ZohoField'][_0x3825('0x2d')]);_0x1fddd0['query']=_[_0x3825('0x34')](_0x1cc72e[_0x3825('0x33')]);_0x1fddd0[_0x3825('0x35')]=_[_0x3825('0x37')](_0x1fddd0[_0x3825('0x31')],_0x1fddd0['query']);_0x3a448a[_0x3825('0x36')]=_['intersection'](_0x1fddd0[_0x3825('0x31')],qs['fields'](_0x1cc72e[_0x3825('0x33')][_0x3825('0x38')]));_0x3a448a[_0x3825('0x36')]=_0x3a448a[_0x3825('0x36')][_0x3825('0x39')]?_0x3a448a[_0x3825('0x36')]:_0x1fddd0[_0x3825('0x31')];_0x3a448a[_0x3825('0x50')]=qs[_0x3825('0x3c')](_0x1cc72e['query'][_0x3825('0x3c')]);_0x3a448a['where']=qs[_0x3825('0x35')](_[_0x3825('0x4e')](_0x1cc72e[_0x3825('0x33')],_0x1fddd0[_0x3825('0x35')]));if(_0x1cc72e['query'][_0x3825('0x3d')]){_0x3a448a[_0x3825('0x3f')]=_[_0x3825('0x3e')](_0x3a448a[_0x3825('0x3f')],{'$or':_[_0x3825('0x32')](_0x3a448a['attributes'],function(_0x4eea45){var _0x36b442={};_0x36b442[_0x4eea45]={'$like':'%'+_0x1cc72e[_0x3825('0x33')]['filter']+'%'};return _0x36b442;})});}_0x3a448a=_[_0x3825('0x3e')]({},_0x3a448a,_0x1cc72e[_0x3825('0x40')]);return _0x4f5fc0['getDescriptions'](_0x3a448a);}})[_0x3825('0x27')](function(_0x49d0d8){if(_0x49d0d8){_0x256cfa=_0x49d0d8[_0x3825('0x39')];if(!_0x1cc72e[_0x3825('0x33')][_0x3825('0x3a')](_0x3825('0x3b'))){_0x3a448a[_0x3825('0x20')]=qs[_0x3825('0x20')](_0x1cc72e[_0x3825('0x33')][_0x3825('0x20')]);_0x3a448a[_0x3825('0x1f')]=qs[_0x3825('0x1f')](_0x1cc72e['query']['offset']);}return _0x4f5fc0[_0x3825('0x51')](_0x3a448a);}})[_0x3825('0x27')](function(_0x32bacf){if(_0x32bacf){return _0x32bacf?{'count':_0x256cfa,'rows':_0x32bacf}:null;}})[_0x3825('0x27')](respondWithResult(_0x19a497,null))[_0x3825('0x43')](handleError(_0x19a497,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 17634de..40f683c 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 _0x804a=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x804a,0xcc));var _0xa804=function(_0x59eed3,_0x3d53a6){_0x59eed3=_0x59eed3-0x0;var _0x45ca9e=_0x804a[_0x59eed3];return _0x45ca9e;};'use strict';var _=require(_0xa804('0x0'));var util=require('util');var logger=require(_0xa804('0x1'))(_0xa804('0x2'));var moment=require(_0xa804('0x3'));var BPromise=require(_0xa804('0x4'));var rp=require(_0xa804('0x5'));var fs=require('fs');var path=require(_0xa804('0x6'));var rimraf=require('rimraf');var config=require(_0xa804('0x7'));var attributes=require(_0xa804('0x8'));module[_0xa804('0x9')]=function(_0x2a95bf,_0x5ae5d7){return _0x2a95bf[_0xa804('0xa')](_0xa804('0xb'),attributes,{'tableName':_0xa804('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac2d=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x540703,_0x52285f){var _0xe50349=function(_0xced716){while(--_0xced716){_0x540703['push'](_0x540703['shift']());}};_0xe50349(++_0x52285f);}(_0xac2d,0x157));var _0xdac2=function(_0x20d536,_0x467185){_0x20d536=_0x20d536-0x0;var _0x37c3a6=_0xac2d[_0x20d536];return _0x37c3a6;};'use strict';var _=require(_0xdac2('0x0'));var util=require(_0xdac2('0x1'));var logger=require(_0xdac2('0x2'))(_0xdac2('0x3'));var moment=require(_0xdac2('0x4'));var BPromise=require('bluebird');var rp=require(_0xdac2('0x5'));var fs=require('fs');var path=require(_0xdac2('0x6'));var rimraf=require(_0xdac2('0x7'));var config=require(_0xdac2('0x8'));var attributes=require(_0xdac2('0x9'));module[_0xdac2('0xa')]=function(_0x22681f,_0x1077ce){return _0x22681f['define'](_0xdac2('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 2061a79..ae2f7ec 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 _0xf8a4=['error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x269018,_0x5c01c5){var _0xb0f016=function(_0x5f0f41){while(--_0x5f0f41){_0x269018['push'](_0x269018['shift']());}};_0xb0f016(++_0x5c01c5);}(_0xf8a4,0xf0));var _0x4f8a=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xf8a4[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0x4f8a('0x0'));var util=require(_0x4f8a('0x1'));var moment=require(_0x4f8a('0x2'));var BPromise=require(_0x4f8a('0x3'));var rs=require(_0x4f8a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f8a('0x5'))['db'];var utils=require(_0x4f8a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f8a('0x7'));var jayson=require(_0x4f8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53f4ad,_0x2a1590,_0x38a848){return new BPromise(function(_0xfadbb,_0x4344ff){return client[_0x4f8a('0x9')](_0x53f4ad,_0x38a848)[_0x4f8a('0xa')](function(_0x555b8a){logger['info'](_0x4f8a('0xb'),_0x2a1590,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2a1590,'request\x20sent',JSON['stringify'](_0x555b8a));if(_0x555b8a[_0x4f8a('0xc')]){if(_0x555b8a['error'][_0x4f8a('0xd')]===0x1f4){logger[_0x4f8a('0xc')](_0x4f8a('0xb'),_0x2a1590,_0x555b8a[_0x4f8a('0xc')][_0x4f8a('0xe')]);return _0x4344ff(_0x555b8a[_0x4f8a('0xc')][_0x4f8a('0xe')]);}logger['error'](_0x4f8a('0xb'),_0x2a1590,_0x555b8a[_0x4f8a('0xc')][_0x4f8a('0xe')]);return _0xfadbb(_0x555b8a[_0x4f8a('0xc')][_0x4f8a('0xe')]);}else{logger[_0x4f8a('0xf')](_0x4f8a('0xb'),_0x2a1590,_0x4f8a('0x10'));_0xfadbb(_0x555b8a['result']['message']);}})[_0x4f8a('0x11')](function(_0x20a2cf){logger['error'](_0x4f8a('0xb'),_0x2a1590,_0x20a2cf);_0x4344ff(_0x20a2cf);});});} \ No newline at end of file +var _0xe515=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f9c65,_0x534378){var _0x17cd9a=function(_0x5337e2){while(--_0x5337e2){_0x3f9c65['push'](_0x3f9c65['shift']());}};_0x17cd9a(++_0x534378);}(_0xe515,0x199));var _0x5e51=function(_0x536cb0,_0x3e2ac6){_0x536cb0=_0x536cb0-0x0;var _0x4d9728=_0xe515[_0x536cb0];return _0x4d9728;};'use strict';var _=require(_0x5e51('0x0'));var util=require('util');var moment=require(_0x5e51('0x1'));var BPromise=require(_0x5e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e51('0x3'));var db=require(_0x5e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e51('0x5'))(_0x5e51('0x6'));var config=require(_0x5e51('0x7'));var jayson=require(_0x5e51('0x8'));var client=jayson[_0x5e51('0x9')][_0x5e51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e4da,_0x3ec89f,_0x1d429b){return new BPromise(function(_0xae2e7f,_0x2adf89){return client[_0x5e51('0xb')](_0x45e4da,_0x1d429b)[_0x5e51('0xc')](function(_0x38768a){logger[_0x5e51('0xd')](_0x5e51('0xe'),_0x3ec89f,_0x5e51('0xf'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3ec89f,_0x5e51('0xf'),JSON[_0x5e51('0x10')](_0x38768a));if(_0x38768a['error']){if(_0x38768a[_0x5e51('0x11')]['code']===0x1f4){logger[_0x5e51('0x11')](_0x5e51('0xe'),_0x3ec89f,_0x38768a[_0x5e51('0x11')][_0x5e51('0x12')]);return _0x2adf89(_0x38768a[_0x5e51('0x11')]['message']);}logger['error'](_0x5e51('0xe'),_0x3ec89f,_0x38768a[_0x5e51('0x11')][_0x5e51('0x12')]);return _0xae2e7f(_0x38768a[_0x5e51('0x11')][_0x5e51('0x12')]);}else{logger['info'](_0x5e51('0xe'),_0x3ec89f,_0x5e51('0xf'));_0xae2e7f(_0x38768a[_0x5e51('0x13')][_0x5e51('0x12')]);}})[_0x5e51('0x14')](function(_0x535571){logger[_0x5e51('0x11')](_0x5e51('0xe'),_0x3ec89f,_0x535571);_0x2adf89(_0x535571);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 249d81f..4770a3b 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 _0x1441=['put','/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','show','post','create'];(function(_0x16508c,_0x4dcdfc){var _0x25614d=function(_0x55fed2){while(--_0x55fed2){_0x16508c['push'](_0x16508c['shift']());}};_0x25614d(++_0x4dcdfc);}(_0x1441,0x71));var _0x1144=function(_0x119fc9,_0x344319){_0x119fc9=_0x119fc9-0x0;var _0x5cea78=_0x1441[_0x119fc9];return _0x5cea78;};'use strict';var multer=require(_0x1144('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1144('0x1'));var express=require(_0x1144('0x2'));var router=express[_0x1144('0x3')]();var fs_extra=require(_0x1144('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1144('0x5'));var config=require(_0x1144('0x6'));var controller=require(_0x1144('0x7'));router['get']('/',auth[_0x1144('0x8')](),controller[_0x1144('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1144('0xa')]);router[_0x1144('0xb')]('/',auth[_0x1144('0x8')](),controller[_0x1144('0xc')]);router[_0x1144('0xd')](_0x1144('0xe'),auth[_0x1144('0x8')](),controller[_0x1144('0xf')]);router[_0x1144('0x10')](_0x1144('0xe'),auth[_0x1144('0x8')](),controller['destroy']);module[_0x1144('0x11')]=router; \ No newline at end of file +var _0x6839=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','create','update','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2aead6,_0x273d63){var _0x1ac18d=function(_0x31633a){while(--_0x31633a){_0x2aead6['push'](_0x2aead6['shift']());}};_0x1ac18d(++_0x273d63);}(_0x6839,0x1d9));var _0x9683=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0x6839[_0x45ce90];return _0x313c45;};'use strict';var multer=require(_0x9683('0x0'));var util=require('util');var path=require(_0x9683('0x1'));var timeout=require(_0x9683('0x2'));var express=require(_0x9683('0x3'));var router=express['Router']();var fs_extra=require(_0x9683('0x4'));var auth=require(_0x9683('0x5'));var interaction=require(_0x9683('0x6'));var config=require(_0x9683('0x7'));var controller=require(_0x9683('0x8'));router[_0x9683('0x9')]('/',auth[_0x9683('0xa')](),controller[_0x9683('0xb')]);router[_0x9683('0x9')]('/:id',auth[_0x9683('0xa')](),controller['show']);router['post']('/',auth[_0x9683('0xa')](),controller[_0x9683('0xc')]);router['put']('/:id',auth[_0x9683('0xa')](),controller[_0x9683('0xd')]);router['delete'](_0x9683('0xe'),auth[_0x9683('0xa')](),controller[_0x9683('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 87ee86f..5299c5e 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 _0xbe7e=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0x16eed2,_0x14d1d2){var _0x102394=function(_0x20aca6){while(--_0x20aca6){_0x16eed2['push'](_0x16eed2['shift']());}};_0x102394(++_0x14d1d2);}(_0xbe7e,0xa9));var _0xebe7=function(_0x1d7790,_0x180cf9){_0x1d7790=_0x1d7790-0x0;var _0xf4f99a=_0xbe7e[_0x1d7790];return _0xf4f99a;};'use strict';var Sequelize=require(_0xebe7('0x0'));module['exports']={'type':{'type':Sequelize[_0xebe7('0x1')](_0xebe7('0x2'),'variable',_0xebe7('0x3'),_0xebe7('0x4'),_0xebe7('0x5')),'defaultValue':_0xebe7('0x2')},'content':{'type':Sequelize[_0xebe7('0x6')]},'key':{'type':Sequelize[_0xebe7('0x6')]},'keyType':{'type':Sequelize[_0xebe7('0x1')](_0xebe7('0x2'),_0xebe7('0x7'),_0xebe7('0x3'))},'keyContent':{'type':Sequelize[_0xebe7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xebe7('0x6')]},'customField':{'type':Sequelize[_0xebe7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xebe7('0x6')]}}; \ No newline at end of file +var _0x6d77=['exports','ENUM','string','customVariable','keyValue','picklist','variable','STRING','sequelize'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x6d77,0xaa));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x76d7('0x0'));module[_0x76d7('0x1')]={'type':{'type':Sequelize[_0x76d7('0x2')](_0x76d7('0x3'),'variable',_0x76d7('0x4'),_0x76d7('0x5'),_0x76d7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x76d7('0x2')]('string',_0x76d7('0x7'),_0x76d7('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x76d7('0x8')]},'nameField':{'type':Sequelize[_0x76d7('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 15cda06..6c06a08 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 _0x5d45=['keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','params','create','body','find','destroy','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','model','query'];(function(_0xcb1bec,_0x2453c2){var _0x49c323=function(_0x4b0b20){while(--_0x4b0b20){_0xcb1bec['push'](_0xcb1bec['shift']());}};_0x49c323(++_0x2453c2);}(_0x5d45,0x165));var _0x55d4=function(_0x2a21fb,_0x50ad15){_0x2a21fb=_0x2a21fb-0x0;var _0x4f7128=_0x5d45[_0x2a21fb];return _0x4f7128;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x55d4('0x0'));var jsonpatch=require(_0x55d4('0x1'));var rp=require(_0x55d4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x55d4('0x3'));var sox=require(_0x55d4('0x4'));var csv=require(_0x55d4('0x5'));var ejs=require(_0x55d4('0x6'));var fs=require('fs');var fs_extra=require(_0x55d4('0x7'));var _=require(_0x55d4('0x8'));var squel=require(_0x55d4('0x9'));var crypto=require('crypto');var jsforce=require(_0x55d4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x55d4('0x5'));var querystring=require(_0x55d4('0xb'));var Papa=require(_0x55d4('0xc'));var Redis=require(_0x55d4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x55d4('0xe'));var hardwareService=require(_0x55d4('0xf'));var logger=require(_0x55d4('0x10'))('api');var utils=require(_0x55d4('0x11'));var config=require(_0x55d4('0x12'));var licenseUtil=require(_0x55d4('0x13'));var db=require(_0x55d4('0x14'))['db'];function respondWithStatusCode(_0x4c0e5d,_0x11a757){_0x11a757=_0x11a757||0xcc;return function(_0x4745cb){if(_0x4745cb){return _0x4c0e5d[_0x55d4('0x15')](_0x11a757);}return _0x4c0e5d[_0x55d4('0x16')](_0x11a757)[_0x55d4('0x17')]();};}function respondWithResult(_0xdd6ce2,_0x19f704){_0x19f704=_0x19f704||0xc8;return function(_0x140dc0){if(_0x140dc0){return _0xdd6ce2['status'](_0x19f704)[_0x55d4('0x18')](_0x140dc0);}};}function respondWithFilteredResult(_0x2ae021,_0x560462){return function(_0x5e3138){if(_0x5e3138){var _0x5ad40e=typeof _0x560462[_0x55d4('0x19')]===_0x55d4('0x1a')&&typeof _0x560462[_0x55d4('0x1b')]===_0x55d4('0x1a');var _0x5cf2bb=_0x5e3138[_0x55d4('0x1c')];var _0x3d8c2b=_0x5ad40e?0x0:_0x560462[_0x55d4('0x19')];var _0x3ffc9f=_0x5ad40e?_0x5e3138['count']:_0x560462[_0x55d4('0x19')]+_0x560462[_0x55d4('0x1b')];var _0x3e71ea;if(_0x3ffc9f>=_0x5cf2bb){_0x3ffc9f=_0x5cf2bb;_0x3e71ea=0xc8;}else{_0x3e71ea=0xce;}_0x2ae021['status'](_0x3e71ea);return _0x2ae021[_0x55d4('0x1d')]('Content-Range',_0x3d8c2b+'-'+_0x3ffc9f+'/'+_0x5cf2bb)[_0x55d4('0x18')](_0x5e3138);}return null;};}function patchUpdates(_0x25d5c4){return function(_0x34283b){try{jsonpatch[_0x55d4('0x1e')](_0x34283b,_0x25d5c4,!![]);}catch(_0x2ede15){return BPromise[_0x55d4('0x1f')](_0x2ede15);}return _0x34283b[_0x55d4('0x20')]();};}function saveUpdates(_0x1260fc,_0x15a3c5){return function(_0x921e2c){if(_0x921e2c){return _0x921e2c[_0x55d4('0x21')](_0x1260fc)['then'](function(_0xc04cf){return _0xc04cf;});}return null;};}function removeEntity(_0x55bbc9,_0x564fc9){return function(_0x4afc5d){if(_0x4afc5d){return _0x4afc5d['destroy']()[_0x55d4('0x22')](function(){_0x55bbc9[_0x55d4('0x16')](0xcc)[_0x55d4('0x17')]();});}};}function handleEntityNotFound(_0x904187,_0x4f9f21){return function(_0x17bf8b){if(!_0x17bf8b){_0x904187[_0x55d4('0x15')](0x194);}return _0x17bf8b;};}function handleError(_0x55bb22,_0x3ddbb1){_0x3ddbb1=_0x3ddbb1||0x1f4;return function(_0x49b4db){logger[_0x55d4('0x23')](_0x49b4db[_0x55d4('0x24')]);if(_0x49b4db['name']){delete _0x49b4db[_0x55d4('0x25')];}_0x55bb22['status'](_0x3ddbb1)['send'](_0x49b4db);};}exports[_0x55d4('0x26')]=function(_0x551ebf,_0x5ef027){var _0x20a2e4={},_0x5c168b={},_0x32f1b4={'count':0x0,'rows':[]};var _0x483e84=_[_0x55d4('0x27')](db[_0x55d4('0x28')][_0x55d4('0x29')],function(_0x5f45af){return{'name':_0x5f45af[_0x55d4('0x2a')],'type':_0x5f45af['type']['key']};});_0x5c168b[_0x55d4('0x2b')]=_[_0x55d4('0x27')](_0x483e84,'name');_0x5c168b[_0x55d4('0x2c')]=_[_0x55d4('0x2d')](_0x551ebf['query']);_0x5c168b[_0x55d4('0x2e')]=_['intersection'](_0x5c168b[_0x55d4('0x2b')],_0x5c168b[_0x55d4('0x2c')]);_0x20a2e4['attributes']=_[_0x55d4('0x2f')](_0x5c168b[_0x55d4('0x2b')],qs[_0x55d4('0x30')](_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x30')]));_0x20a2e4[_0x55d4('0x31')]=_0x20a2e4[_0x55d4('0x31')][_0x55d4('0x32')]?_0x20a2e4[_0x55d4('0x31')]:_0x5c168b[_0x55d4('0x2b')];if(!_0x551ebf['query']['hasOwnProperty'](_0x55d4('0x33'))){_0x20a2e4[_0x55d4('0x1b')]=qs[_0x55d4('0x1b')](_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x1b')]);_0x20a2e4[_0x55d4('0x19')]=qs['offset'](_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x19')]);}_0x20a2e4['order']=qs['sort'](_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x34')]);_0x20a2e4[_0x55d4('0x35')]=qs[_0x55d4('0x2e')](_[_0x55d4('0x36')](_0x551ebf[_0x55d4('0x2c')],_0x5c168b[_0x55d4('0x2e')]),_0x483e84);if(_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x37')]){_0x20a2e4[_0x55d4('0x35')]=_[_0x55d4('0x38')](_0x20a2e4['where'],{'$or':_['map'](_0x483e84,function(_0x11adc0){if(_0x11adc0[_0x55d4('0x39')]!=='VIRTUAL'){var _0x1a1004={};_0x1a1004[_0x11adc0['name']]={'$like':'%'+_0x551ebf['query'][_0x55d4('0x37')]+'%'};return _0x1a1004;}})});}_0x20a2e4=_['merge']({},_0x20a2e4,_0x551ebf['options']);var _0x20d49f={'where':_0x20a2e4['where']};return db[_0x55d4('0x28')][_0x55d4('0x1c')](_0x20d49f)[_0x55d4('0x22')](function(_0x37f6e3){_0x32f1b4[_0x55d4('0x1c')]=_0x37f6e3;if(_0x551ebf[_0x55d4('0x2c')][_0x55d4('0x3a')]){_0x20a2e4[_0x55d4('0x3b')]=[{'all':!![]}];}return db[_0x55d4('0x28')][_0x55d4('0x3c')](_0x20a2e4);})[_0x55d4('0x22')](function(_0x3bd7da){_0x32f1b4['rows']=_0x3bd7da;return _0x32f1b4;})[_0x55d4('0x22')](respondWithFilteredResult(_0x5ef027,_0x20a2e4))[_0x55d4('0x3d')](handleError(_0x5ef027,null));};exports['show']=function(_0x202579,_0x205b69){var _0x60177b={'raw':!![],'where':{'id':_0x202579[_0x55d4('0x3e')]['id']}},_0x1fece6={};_0x1fece6['model']=_[_0x55d4('0x2d')](db['ZohoField'][_0x55d4('0x29')]);_0x1fece6[_0x55d4('0x2c')]=_['keys'](_0x202579['query']);_0x1fece6['filters']=_[_0x55d4('0x2f')](_0x1fece6[_0x55d4('0x2b')],_0x1fece6[_0x55d4('0x2c')]);_0x60177b[_0x55d4('0x31')]=_[_0x55d4('0x2f')](_0x1fece6[_0x55d4('0x2b')],qs[_0x55d4('0x30')](_0x202579['query']['fields']));_0x60177b[_0x55d4('0x31')]=_0x60177b[_0x55d4('0x31')][_0x55d4('0x32')]?_0x60177b[_0x55d4('0x31')]:_0x1fece6[_0x55d4('0x2b')];if(_0x202579[_0x55d4('0x2c')]['includeAll']){_0x60177b[_0x55d4('0x3b')]=[{'all':!![]}];}_0x60177b=_[_0x55d4('0x38')]({},_0x60177b,_0x202579['options']);return db[_0x55d4('0x28')]['find'](_0x60177b)[_0x55d4('0x22')](handleEntityNotFound(_0x205b69,null))[_0x55d4('0x22')](respondWithResult(_0x205b69,null))[_0x55d4('0x3d')](handleError(_0x205b69,null));};exports[_0x55d4('0x3f')]=function(_0x2a5044,_0x83a7c2){return db['ZohoField'][_0x55d4('0x3f')](_0x2a5044[_0x55d4('0x40')],{})[_0x55d4('0x22')](respondWithResult(_0x83a7c2,0xc9))[_0x55d4('0x3d')](handleError(_0x83a7c2,null));};exports['update']=function(_0x33e545,_0x5b616a){if(_0x33e545[_0x55d4('0x40')]['id']){delete _0x33e545[_0x55d4('0x40')]['id'];}return db[_0x55d4('0x28')][_0x55d4('0x41')]({'where':{'id':_0x33e545['params']['id']}})['then'](handleEntityNotFound(_0x5b616a,null))[_0x55d4('0x22')](saveUpdates(_0x33e545['body'],null))[_0x55d4('0x22')](respondWithResult(_0x5b616a,null))[_0x55d4('0x3d')](handleError(_0x5b616a,null));};exports[_0x55d4('0x42')]=function(_0x469668,_0x2ba1cd){return db[_0x55d4('0x28')][_0x55d4('0x41')]({'where':{'id':_0x469668[_0x55d4('0x3e')]['id']}})[_0x55d4('0x22')](handleEntityNotFound(_0x2ba1cd,null))[_0x55d4('0x22')](removeEntity(_0x2ba1cd,null))[_0x55d4('0x3d')](handleError(_0x2ba1cd,null));}; \ No newline at end of file +var _0x6c0c=['rows','catch','show','params','intersection','includeAll','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x6c0c,0x18f));var _0xc6c0=function(_0x4ee441,_0x460f58){_0x4ee441=_0x4ee441-0x0;var _0x3ca149=_0x6c0c[_0x4ee441];return _0x3ca149;};'use strict';var emlformat=require(_0xc6c0('0x0'));var rimraf=require(_0xc6c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc6c0('0x2'));var moment=require('moment');var BPromise=require(_0xc6c0('0x3'));var Mustache=require(_0xc6c0('0x4'));var util=require(_0xc6c0('0x5'));var path=require(_0xc6c0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc6c0('0x7'));var fs=require('fs');var fs_extra=require(_0xc6c0('0x8'));var _=require(_0xc6c0('0x9'));var squel=require(_0xc6c0('0xa'));var crypto=require(_0xc6c0('0xb'));var jsforce=require(_0xc6c0('0xc'));var deskjs=require(_0xc6c0('0xd'));var toCsv=require(_0xc6c0('0xe'));var querystring=require(_0xc6c0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc6c0('0x10'));var qs=require(_0xc6c0('0x11'));var as=require(_0xc6c0('0x12'));var hardwareService=require(_0xc6c0('0x13'));var logger=require(_0xc6c0('0x14'))(_0xc6c0('0x15'));var utils=require(_0xc6c0('0x16'));var config=require(_0xc6c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6c0('0x18'))['db'];function respondWithStatusCode(_0x3978ce,_0x5815ea){_0x5815ea=_0x5815ea||0xcc;return function(_0x15c667){if(_0x15c667){return _0x3978ce[_0xc6c0('0x19')](_0x5815ea);}return _0x3978ce[_0xc6c0('0x1a')](_0x5815ea)['end']();};}function respondWithResult(_0x12468e,_0x1dc301){_0x1dc301=_0x1dc301||0xc8;return function(_0x5c950d){if(_0x5c950d){return _0x12468e['status'](_0x1dc301)[_0xc6c0('0x1b')](_0x5c950d);}};}function respondWithFilteredResult(_0x11a63f,_0x4e9e71){return function(_0x5d8e53){if(_0x5d8e53){var _0x2b194e=typeof _0x4e9e71[_0xc6c0('0x1c')]==='undefined'&&typeof _0x4e9e71[_0xc6c0('0x1d')]===_0xc6c0('0x1e');var _0x4ac08d=_0x5d8e53[_0xc6c0('0x1f')];var _0x69d8b0=_0x2b194e?0x0:_0x4e9e71[_0xc6c0('0x1c')];var _0x482224=_0x2b194e?_0x5d8e53[_0xc6c0('0x1f')]:_0x4e9e71[_0xc6c0('0x1c')]+_0x4e9e71['limit'];var _0x5122a8;if(_0x482224>=_0x4ac08d){_0x482224=_0x4ac08d;_0x5122a8=0xc8;}else{_0x5122a8=0xce;}_0x11a63f['status'](_0x5122a8);return _0x11a63f[_0xc6c0('0x20')](_0xc6c0('0x21'),_0x69d8b0+'-'+_0x482224+'/'+_0x4ac08d)[_0xc6c0('0x1b')](_0x5d8e53);}return null;};}function patchUpdates(_0x3e9d09){return function(_0x28f305){try{jsonpatch[_0xc6c0('0x22')](_0x28f305,_0x3e9d09,!![]);}catch(_0x21bd90){return BPromise[_0xc6c0('0x23')](_0x21bd90);}return _0x28f305[_0xc6c0('0x24')]();};}function saveUpdates(_0x3b77da,_0x105364){return function(_0x1f5386){if(_0x1f5386){return _0x1f5386[_0xc6c0('0x25')](_0x3b77da)[_0xc6c0('0x26')](function(_0x191026){return _0x191026;});}return null;};}function removeEntity(_0xc90d09,_0x47c4f2){return function(_0x2e2990){if(_0x2e2990){return _0x2e2990[_0xc6c0('0x27')]()[_0xc6c0('0x26')](function(){_0xc90d09[_0xc6c0('0x1a')](0xcc)[_0xc6c0('0x28')]();});}};}function handleEntityNotFound(_0x5e2a9f,_0x11093e){return function(_0x4272fc){if(!_0x4272fc){_0x5e2a9f[_0xc6c0('0x19')](0x194);}return _0x4272fc;};}function handleError(_0x24a501,_0x4b42bb){_0x4b42bb=_0x4b42bb||0x1f4;return function(_0x5e713d){logger[_0xc6c0('0x29')](_0x5e713d[_0xc6c0('0x2a')]);if(_0x5e713d[_0xc6c0('0x2b')]){delete _0x5e713d[_0xc6c0('0x2b')];}_0x24a501[_0xc6c0('0x1a')](_0x4b42bb)[_0xc6c0('0x2c')](_0x5e713d);};}exports[_0xc6c0('0x2d')]=function(_0x5d40cb,_0x37687a){var _0x5c264d={},_0x4d2bef={},_0x263ec8={'count':0x0,'rows':[]};var _0x16271b=_['map'](db[_0xc6c0('0x2e')][_0xc6c0('0x2f')],function(_0x2e783f){return{'name':_0x2e783f[_0xc6c0('0x30')],'type':_0x2e783f[_0xc6c0('0x31')]['key']};});_0x4d2bef[_0xc6c0('0x32')]=_['map'](_0x16271b,'name');_0x4d2bef[_0xc6c0('0x33')]=_[_0xc6c0('0x34')](_0x5d40cb['query']);_0x4d2bef[_0xc6c0('0x35')]=_['intersection'](_0x4d2bef[_0xc6c0('0x32')],_0x4d2bef[_0xc6c0('0x33')]);_0x5c264d[_0xc6c0('0x36')]=_['intersection'](_0x4d2bef['model'],qs[_0xc6c0('0x37')](_0x5d40cb['query'][_0xc6c0('0x37')]));_0x5c264d['attributes']=_0x5c264d['attributes'][_0xc6c0('0x38')]?_0x5c264d[_0xc6c0('0x36')]:_0x4d2bef[_0xc6c0('0x32')];if(!_0x5d40cb[_0xc6c0('0x33')][_0xc6c0('0x39')](_0xc6c0('0x3a'))){_0x5c264d[_0xc6c0('0x1d')]=qs['limit'](_0x5d40cb[_0xc6c0('0x33')][_0xc6c0('0x1d')]);_0x5c264d[_0xc6c0('0x1c')]=qs[_0xc6c0('0x1c')](_0x5d40cb['query'][_0xc6c0('0x1c')]);}_0x5c264d[_0xc6c0('0x3b')]=qs[_0xc6c0('0x3c')](_0x5d40cb['query'][_0xc6c0('0x3c')]);_0x5c264d[_0xc6c0('0x3d')]=qs['filters'](_[_0xc6c0('0x3e')](_0x5d40cb['query'],_0x4d2bef['filters']),_0x16271b);if(_0x5d40cb[_0xc6c0('0x33')][_0xc6c0('0x3f')]){_0x5c264d['where']=_['merge'](_0x5c264d['where'],{'$or':_['map'](_0x16271b,function(_0x23f094){if(_0x23f094[_0xc6c0('0x31')]!==_0xc6c0('0x40')){var _0x9a5968={};_0x9a5968[_0x23f094['name']]={'$like':'%'+_0x5d40cb[_0xc6c0('0x33')][_0xc6c0('0x3f')]+'%'};return _0x9a5968;}})});}_0x5c264d=_[_0xc6c0('0x41')]({},_0x5c264d,_0x5d40cb[_0xc6c0('0x42')]);var _0x3bb8ef={'where':_0x5c264d[_0xc6c0('0x3d')]};return db['ZohoField'][_0xc6c0('0x1f')](_0x3bb8ef)[_0xc6c0('0x26')](function(_0x1fb5fa){_0x263ec8['count']=_0x1fb5fa;if(_0x5d40cb[_0xc6c0('0x33')]['includeAll']){_0x5c264d[_0xc6c0('0x43')]=[{'all':!![]}];}return db[_0xc6c0('0x2e')][_0xc6c0('0x44')](_0x5c264d);})['then'](function(_0x48c8ed){_0x263ec8[_0xc6c0('0x45')]=_0x48c8ed;return _0x263ec8;})[_0xc6c0('0x26')](respondWithFilteredResult(_0x37687a,_0x5c264d))[_0xc6c0('0x46')](handleError(_0x37687a,null));};exports[_0xc6c0('0x47')]=function(_0x5c3b23,_0x5098b2){var _0x395a45={'raw':!![],'where':{'id':_0x5c3b23[_0xc6c0('0x48')]['id']}},_0x531655={};_0x531655[_0xc6c0('0x32')]=_[_0xc6c0('0x34')](db[_0xc6c0('0x2e')][_0xc6c0('0x2f')]);_0x531655[_0xc6c0('0x33')]=_[_0xc6c0('0x34')](_0x5c3b23[_0xc6c0('0x33')]);_0x531655[_0xc6c0('0x35')]=_[_0xc6c0('0x49')](_0x531655[_0xc6c0('0x32')],_0x531655[_0xc6c0('0x33')]);_0x395a45[_0xc6c0('0x36')]=_[_0xc6c0('0x49')](_0x531655[_0xc6c0('0x32')],qs['fields'](_0x5c3b23[_0xc6c0('0x33')][_0xc6c0('0x37')]));_0x395a45[_0xc6c0('0x36')]=_0x395a45[_0xc6c0('0x36')][_0xc6c0('0x38')]?_0x395a45[_0xc6c0('0x36')]:_0x531655[_0xc6c0('0x32')];if(_0x5c3b23[_0xc6c0('0x33')][_0xc6c0('0x4a')]){_0x395a45['include']=[{'all':!![]}];}_0x395a45=_[_0xc6c0('0x41')]({},_0x395a45,_0x5c3b23[_0xc6c0('0x42')]);return db[_0xc6c0('0x2e')][_0xc6c0('0x4b')](_0x395a45)['then'](handleEntityNotFound(_0x5098b2,null))[_0xc6c0('0x26')](respondWithResult(_0x5098b2,null))[_0xc6c0('0x46')](handleError(_0x5098b2,null));};exports[_0xc6c0('0x4c')]=function(_0x1ef1aa,_0xac6f5f){return db[_0xc6c0('0x2e')][_0xc6c0('0x4c')](_0x1ef1aa[_0xc6c0('0x4d')],{})[_0xc6c0('0x26')](respondWithResult(_0xac6f5f,0xc9))[_0xc6c0('0x46')](handleError(_0xac6f5f,null));};exports[_0xc6c0('0x25')]=function(_0x4612ae,_0x1c12de){if(_0x4612ae[_0xc6c0('0x4d')]['id']){delete _0x4612ae[_0xc6c0('0x4d')]['id'];}return db[_0xc6c0('0x2e')][_0xc6c0('0x4b')]({'where':{'id':_0x4612ae[_0xc6c0('0x48')]['id']}})[_0xc6c0('0x26')](handleEntityNotFound(_0x1c12de,null))['then'](saveUpdates(_0x4612ae[_0xc6c0('0x4d')],null))['then'](respondWithResult(_0x1c12de,null))['catch'](handleError(_0x1c12de,null));};exports[_0xc6c0('0x27')]=function(_0xbc0f9e,_0x26a327){return db[_0xc6c0('0x2e')][_0xc6c0('0x4b')]({'where':{'id':_0xbc0f9e[_0xc6c0('0x48')]['id']}})[_0xc6c0('0x26')](handleEntityNotFound(_0x26a327,null))[_0xc6c0('0x26')](removeEntity(_0x26a327,null))[_0xc6c0('0x46')](handleError(_0x26a327,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b3e526e..505c122 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 _0x2272=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x2739d9,_0x9d6e34){var _0xe7a648=function(_0x1b744d){while(--_0x1b744d){_0x2739d9['push'](_0x2739d9['shift']());}};_0xe7a648(++_0x9d6e34);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x2227('0x8')]=function(_0x3b8661,_0xb33647){return _0x3b8661[_0x2227('0x9')](_0x2227('0xa'),attributes,{'tableName':_0x2227('0xb'),'paranoid':![],'indexes':[{'name':_0x2227('0xc'),'fields':[_0x2227('0xd'),_0x2227('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','zoho_unique_index','idField','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6050,0x196));var _0x0605=function(_0x3be2ac,_0xaea517){_0x3be2ac=_0x3be2ac-0x0;var _0x55692f=_0x6050[_0x3be2ac];return _0x55692f;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0605('0x9'),'fields':[_0x0605('0xa'),_0x0605('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 6aaadf6..8bb33e6 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 _0xad90=['../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3df4d5,_0x5da3e9){var _0x2942ec=function(_0x385f82){while(--_0x385f82){_0x3df4d5['push'](_0x3df4d5['shift']());}};_0x2942ec(++_0x5da3e9);}(_0xad90,0x6c));var _0x0ad9=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xad90[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x0ad9('0x0'));var util=require('util');var moment=require(_0x0ad9('0x1'));var BPromise=require(_0x0ad9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ad9('0x3'))['db'];var utils=require(_0x0ad9('0x4'));var logger=require(_0x0ad9('0x5'))(_0x0ad9('0x6'));var config=require(_0x0ad9('0x7'));var jayson=require(_0x0ad9('0x8'));var client=jayson[_0x0ad9('0x9')][_0x0ad9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x580b04,_0x554cc1,_0x22c8fb){return new BPromise(function(_0x18ec3e,_0x2b9eb3){return client[_0x0ad9('0xb')](_0x580b04,_0x22c8fb)['then'](function(_0x4fd9ba){logger[_0x0ad9('0xc')](_0x0ad9('0xd'),_0x554cc1,_0x0ad9('0xe'));logger[_0x0ad9('0xf')](_0x0ad9('0x10'),_0x554cc1,_0x0ad9('0xe'),JSON[_0x0ad9('0x11')](_0x4fd9ba));if(_0x4fd9ba[_0x0ad9('0x12')]){if(_0x4fd9ba[_0x0ad9('0x12')][_0x0ad9('0x13')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x554cc1,_0x4fd9ba['error']['message']);return _0x2b9eb3(_0x4fd9ba[_0x0ad9('0x12')][_0x0ad9('0x14')]);}logger[_0x0ad9('0x12')](_0x0ad9('0xd'),_0x554cc1,_0x4fd9ba[_0x0ad9('0x12')][_0x0ad9('0x14')]);return _0x18ec3e(_0x4fd9ba[_0x0ad9('0x12')][_0x0ad9('0x14')]);}else{logger[_0x0ad9('0xc')](_0x0ad9('0xd'),_0x554cc1,'request\x20sent');_0x18ec3e(_0x4fd9ba[_0x0ad9('0x15')]['message']);}})[_0x0ad9('0x16')](function(_0x20f164){logger[_0x0ad9('0x12')](_0x0ad9('0xd'),_0x554cc1,_0x20f164);_0x2b9eb3(_0x20f164);});});} \ No newline at end of file +var _0x10d3=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s','message'];(function(_0x226879,_0x30a56b){var _0x20964c=function(_0x4a1ea6){while(--_0x4a1ea6){_0x226879['push'](_0x226879['shift']());}};_0x20964c(++_0x30a56b);}(_0x10d3,0xb1));var _0x310d=function(_0x27a4e8,_0x2a224d){_0x27a4e8=_0x27a4e8-0x0;var _0x6fb132=_0x10d3[_0x27a4e8];return _0x6fb132;};'use strict';var _=require(_0x310d('0x0'));var util=require(_0x310d('0x1'));var moment=require(_0x310d('0x2'));var BPromise=require(_0x310d('0x3'));var rs=require(_0x310d('0x4'));var fs=require('fs');var Redis=require(_0x310d('0x5'));var db=require(_0x310d('0x6'))['db'];var utils=require(_0x310d('0x7'));var logger=require(_0x310d('0x8'))(_0x310d('0x9'));var config=require(_0x310d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x310d('0xb')][_0x310d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x269ad5,_0x880f79,_0x29bc86){return new BPromise(function(_0x488db1,_0x2a6b9c){return client[_0x310d('0xd')](_0x269ad5,_0x29bc86)[_0x310d('0xe')](function(_0x34541f){logger[_0x310d('0xf')]('ZohoField,\x20%s,\x20%s',_0x880f79,_0x310d('0x10'));logger['debug'](_0x310d('0x11'),_0x880f79,_0x310d('0x10'),JSON['stringify'](_0x34541f));if(_0x34541f[_0x310d('0x12')]){if(_0x34541f[_0x310d('0x12')]['code']===0x1f4){logger[_0x310d('0x12')](_0x310d('0x13'),_0x880f79,_0x34541f[_0x310d('0x12')]['message']);return _0x2a6b9c(_0x34541f[_0x310d('0x12')][_0x310d('0x14')]);}logger[_0x310d('0x12')]('ZohoField,\x20%s,\x20%s',_0x880f79,_0x34541f[_0x310d('0x12')]['message']);return _0x488db1(_0x34541f[_0x310d('0x12')][_0x310d('0x14')]);}else{logger[_0x310d('0xf')](_0x310d('0x13'),_0x880f79,_0x310d('0x10'));_0x488db1(_0x34541f[_0x310d('0x15')][_0x310d('0x14')]);}})['catch'](function(_0x14745e){logger[_0x310d('0x12')](_0x310d('0x13'),_0x880f79,_0x14745e);_0x2a6b9c(_0x14745e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 0651a1c..02f568a 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3440a4,_0x32c12c){var _0x5db7d6=function(_0x11fe60){while(--_0x11fe60){_0x3440a4['push'](_0x3440a4['shift']());}};_0x5db7d6(++_0x32c12c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3199ea,_0x4d36e5){var _0x41abc4=function(_0x1da2e8){while(--_0x1da2e8){_0x3199ea['push'](_0x3199ea['shift']());}};_0x41abc4(++_0x4d36e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 5fc1c96..fec150d 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 _0x6a53=['STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0xb8111f,_0x2b0a3b){var _0x233d1b=function(_0x416f63){while(--_0x416f63){_0xb8111f['push'](_0xb8111f['shift']());}};_0x233d1b(++_0x2b0a3b);}(_0x6a53,0x1ef));var _0x36a5=function(_0x3c4016,_0x2e220f){_0x3c4016=_0x3c4016-0x0;var _0x3cebbd=_0x6a53[_0x3c4016];return _0x3cebbd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x36a5('0x0')],'allowNull':![],'unique':_0x36a5('0x1')},'version':{'type':Sequelize[_0x36a5('0x0')],'allowNull':![],'unique':_0x36a5('0x1')},'main':{'type':Sequelize[_0x36a5('0x0')],'defaultValue':_0x36a5('0x2')},'filename':{'type':Sequelize[_0x36a5('0x0')]},'path':{'type':Sequelize[_0x36a5('0x0')]},'type':{'type':Sequelize[_0x36a5('0x0')]},'size':{'type':Sequelize[_0x36a5('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x36a5('0x0')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x36a5('0x0')],'unique':_0x36a5('0x4')},'description':{'type':Sequelize[_0x36a5('0x0')]},'title':{'type':Sequelize[_0x36a5('0x0')]},'remoteUri':{'type':Sequelize[_0x36a5('0x0')]},'link':{'type':Sequelize[_0x36a5('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4345=['sequelize','exports','unique_name_and_version','STRING','INTEGER','BOOLEAN','state'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0x4345,0x77));var _0x5434=function(_0x404e89,_0x2c1114){_0x404e89=_0x404e89-0x0;var _0x4bab2e=_0x4345[_0x404e89];return _0x4bab2e;};'use strict';var Sequelize=require(_0x5434('0x0'));module[_0x5434('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5434('0x2')},'version':{'type':Sequelize[_0x5434('0x3')],'allowNull':![],'unique':_0x5434('0x2')},'main':{'type':Sequelize[_0x5434('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x5434('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5434('0x3')]},'size':{'type':Sequelize[_0x5434('0x4')]},'active':{'type':Sequelize[_0x5434('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x5434('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x5434('0x6')},'description':{'type':Sequelize[_0x5434('0x3')]},'title':{'type':Sequelize[_0x5434('0x3')]},'remoteUri':{'type':Sequelize[_0x5434('0x3')]},'link':{'type':Sequelize[_0x5434('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index f511467..ea667aa 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 _0x430c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3e7b59,_0x14a4cd){var _0x4bd64a=function(_0x144656){while(--_0x144656){_0x3e7b59['push'](_0x3e7b59['shift']());}};_0x4bd64a(++_0x14a4cd);}(_0x430c,0x1a1));var _0xc430=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0x430c[_0x43026b];return _0x4a96cd;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));}; \ No newline at end of file +var _0xba34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1a2edc,_0x44cb65){var _0x337dc9=function(_0x5b9c75){while(--_0x5b9c75){_0x1a2edc['push'](_0x1a2edc['shift']());}};_0x337dc9(++_0x44cb65);}(_0xba34,0x119));var _0x4ba3=function(_0x1639a5,_0x26567e){_0x1639a5=_0x1639a5-0x0;var _0xd92f07=_0xba34[_0x1639a5];return _0xd92f07;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['Integration']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 86c6adc..c8844d6 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 _0x4822=['api','moment','bluebird','path','rimraf','exports','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x229445,_0x59ed67){var _0x8e8878=function(_0x18fbd4){while(--_0x18fbd4){_0x229445['push'](_0x229445['shift']());}};_0x8e8878(++_0x59ed67);}(_0x4822,0x99));var _0x2482=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x4822[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x2482('0x0'));var util=require(_0x2482('0x1'));var logger=require(_0x2482('0x2'))(_0x2482('0x3'));var moment=require(_0x2482('0x4'));var BPromise=require(_0x2482('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2482('0x6'));var rimraf=require(_0x2482('0x7'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x2482('0x8')]=function(_0x5ba7f2,_0x9cd324){return _0x5ba7f2[_0x2482('0x9')](_0x2482('0xa'),attributes,{'tableName':_0x2482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a2b=['rimraf','../../config/environment','./integration.attributes','integrations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x2a2b,0x7d));var _0xb2a2=function(_0x21653a,_0x441008){_0x21653a=_0x21653a-0x0;var _0x217be8=_0x2a2b[_0x21653a];return _0x217be8;};'use strict';var _=require(_0xb2a2('0x0'));var util=require(_0xb2a2('0x1'));var logger=require(_0xb2a2('0x2'))(_0xb2a2('0x3'));var moment=require(_0xb2a2('0x4'));var BPromise=require(_0xb2a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2a2('0x6'));var rimraf=require(_0xb2a2('0x7'));var config=require(_0xb2a2('0x8'));var attributes=require(_0xb2a2('0x9'));module['exports']=function(_0x2181e6,_0x31c93b){return _0x2181e6['define']('Integration',attributes,{'tableName':_0xb2a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 1d44c1d..139c9b8 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x143aa4,_0x1f4af4){var _0xc9d11=function(_0x4c6dc3){while(--_0x4c6dc3){_0x143aa4['push'](_0x143aa4['shift']());}};_0xc9d11(++_0x1f4af4);}(_0x2542,0x169));var _0x2254=function(_0xb23018,_0x1ea35d){_0xb23018=_0xb23018-0x0;var _0x2687a8=_0x2542[_0xb23018];return _0x2687a8;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x41f1d3,_0x198c5f){_0x41f1d3=_0x41f1d3-0x0;var _0x114ab6=_0xc2c7[_0x41f1d3];return _0x114ab6;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 71f00ed..5f2d0ab 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x1c5dec,_0x930fd3){var _0xee8b88=function(_0x4a6fb5){while(--_0x4a6fb5){_0x1c5dec['push'](_0x1c5dec['shift']());}};_0xee8b88(++_0x930fd3);}(_0x955f,0x1eb));var _0xf955=function(_0x30f8ff,_0x4f260a){_0x30f8ff=_0x30f8ff-0x0;var _0x28449e=_0x955f[_0x30f8ff];return _0x28449e;};'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('./integrationReport.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('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3938d2,_0x8e9793){var _0x45513c=function(_0x2684ea){while(--_0x2684ea){_0x3938d2['push'](_0x3938d2['shift']());}};_0x45513c(++_0x8e9793);}(_0x66fa,0x117));var _0xa66f=function(_0x48c547,_0x2a17af){_0x48c547=_0x48c547-0x0;var _0x200c3d=_0x66fa[_0x48c547];return _0x200c3d;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a42d488..2b555fc 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 _0x42d8=['TEXT','SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x24b897,_0x38df26){var _0x522698=function(_0x1757a3){while(--_0x1757a3){_0x24b897['push'](_0x24b897['shift']());}};_0x522698(++_0x38df26);}(_0x42d8,0xaa));var _0x842d=function(_0x20a001,_0x326e17){_0x20a001=_0x20a001-0x0;var _0x3d0500=_0x42d8[_0x20a001];return _0x3d0500;};'use strict';var Sequelize=require(_0x842d('0x0'));module[_0x842d('0x1')]={'integration':{'type':Sequelize[_0x842d('0x2')]},'eventChannel':{'type':Sequelize[_0x842d('0x2')]},'exitStatus':{'type':Sequelize[_0x842d('0x2')]},'ticketId':{'type':Sequelize[_0x842d('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x842d('0x2')]},'uniqueid':{'type':Sequelize[_0x842d('0x2')]},'calleridnum':{'type':Sequelize[_0x842d('0x2')]},'calleridname':{'type':Sequelize[_0x842d('0x2')]},'queue':{'type':Sequelize[_0x842d('0x2')]},'interface':{'type':Sequelize[_0x842d('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x842d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x842d('0x3')]},'holdtime':{'type':Sequelize[_0x842d('0x4')]},'agentcomplete':{'type':Sequelize[_0x842d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x842d('0x3')]},'talktime':{'type':Sequelize[_0x842d('0x4')]},'agentacw':{'type':Sequelize[_0x842d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x842d('0x4')]},'reason':{'type':Sequelize[_0x842d('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x842d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x842d('0x3')]},'lastevent':{'type':Sequelize[_0x842d('0x2')]},'channel':{'type':Sequelize[_0x842d('0x2')]},'channelstate':{'type':Sequelize[_0x842d('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x842d('0x2')]},'connectedlinename':{'type':Sequelize[_0x842d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x842d('0x2')]},'context':{'type':Sequelize[_0x842d('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x842d('0x2')]},'destchannelstate':{'type':Sequelize[_0x842d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x842d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x842d('0x2')]},'destcalleridname':{'type':Sequelize[_0x842d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x842d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x842d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x842d('0x2')]},'destcontext':{'type':Sequelize[_0x842d('0x2')]},'destexten':{'type':Sequelize[_0x842d('0x2')]},'destpriority':{'type':Sequelize[_0x842d('0x2')]},'destuniqueid':{'type':Sequelize[_0x842d('0x2')]},'messageId':{'type':Sequelize[_0x842d('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x842d('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x842d('0x2')]},'attachment':{'type':Sequelize[_0x842d('0x6')]},'html':{'type':Sequelize[_0x842d('0x6')]},'text':{'type':Sequelize[_0x842d('0x6')]},'status':{'type':Sequelize['ENUM']('SENT',_0x842d('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x842d('0x2')]},'app':{'type':Sequelize[_0x842d('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x842d('0x4')]}}; \ No newline at end of file +var _0xf39c=['sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','FAILED'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf39c,0x87));var _0xcf39=function(_0x44a9d9,_0x5c9750){_0x44a9d9=_0x44a9d9-0x0;var _0x2a38e5=_0xf39c[_0x44a9d9];return _0x2a38e5;};'use strict';var Sequelize=require(_0xcf39('0x0'));module['exports']={'integration':{'type':Sequelize[_0xcf39('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xcf39('0x1')]},'ticketId':{'type':Sequelize[_0xcf39('0x1')]},'integrationId':{'type':Sequelize[_0xcf39('0x2')]},'contacts':{'type':Sequelize[_0xcf39('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcf39('0x1')]},'calleridname':{'type':Sequelize[_0xcf39('0x1')]},'queue':{'type':Sequelize[_0xcf39('0x1')]},'interface':{'type':Sequelize[_0xcf39('0x1')]},'membername':{'type':Sequelize[_0xcf39('0x1')]},'agentcalledAt':{'type':Sequelize[_0xcf39('0x3')]},'agentconnectAt':{'type':Sequelize[_0xcf39('0x3')]},'holdtime':{'type':Sequelize[_0xcf39('0x2')]},'agentcomplete':{'type':Sequelize[_0xcf39('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcf39('0x3')]},'talktime':{'type':Sequelize[_0xcf39('0x2')]},'agentacw':{'type':Sequelize[_0xcf39('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xcf39('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xcf39('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcf39('0x3')]},'agentdump':{'type':Sequelize[_0xcf39('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcf39('0x3')]},'lastevent':{'type':Sequelize[_0xcf39('0x1')]},'channel':{'type':Sequelize[_0xcf39('0x1')]},'channelstate':{'type':Sequelize[_0xcf39('0x2')]},'channelstatedesc':{'type':Sequelize[_0xcf39('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcf39('0x1')]},'connectedlinename':{'type':Sequelize[_0xcf39('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcf39('0x1')]},'context':{'type':Sequelize[_0xcf39('0x1')]},'exten':{'type':Sequelize[_0xcf39('0x1')]},'priority':{'type':Sequelize[_0xcf39('0x1')]},'destchannel':{'type':Sequelize[_0xcf39('0x1')]},'destchannelstate':{'type':Sequelize[_0xcf39('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xcf39('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xcf39('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xcf39('0x1')]},'destlanguage':{'type':Sequelize[_0xcf39('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xcf39('0x1')]},'destuniqueid':{'type':Sequelize[_0xcf39('0x1')]},'messageId':{'type':Sequelize[_0xcf39('0x1')]},'inReplyTo':{'type':Sequelize[_0xcf39('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xcf39('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xcf39('0x1')]},'attachment':{'type':Sequelize[_0xcf39('0x5')]},'html':{'type':Sequelize[_0xcf39('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xcf39('0x6')](_0xcf39('0x7'),'SENDING','RECEIVED',_0xcf39('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xcf39('0x1')]},'appdata':{'type':Sequelize[_0xcf39('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 494386a..24b5109 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 _0x1d3d=['index','map','IntegrationReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','name'];(function(_0x201a6e,_0x495ce2){var _0x5909ca=function(_0x55b8d9){while(--_0x55b8d9){_0x201a6e['push'](_0x201a6e['shift']());}};_0x5909ca(++_0x495ce2);}(_0x1d3d,0x188));var _0xd1d3=function(_0x5b9c9e,_0x19730e){_0x5b9c9e=_0x5b9c9e-0x0;var _0x58f3d5=_0x1d3d[_0x5b9c9e];return _0x58f3d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1d3('0x0'));var zipdir=require(_0xd1d3('0x1'));var jsonpatch=require(_0xd1d3('0x2'));var rp=require(_0xd1d3('0x3'));var moment=require(_0xd1d3('0x4'));var BPromise=require(_0xd1d3('0x5'));var Mustache=require(_0xd1d3('0x6'));var util=require(_0xd1d3('0x7'));var path=require('path');var sox=require(_0xd1d3('0x8'));var csv=require(_0xd1d3('0x9'));var ejs=require(_0xd1d3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1d3('0xb'));var squel=require(_0xd1d3('0xc'));var crypto=require(_0xd1d3('0xd'));var jsforce=require(_0xd1d3('0xe'));var deskjs=require(_0xd1d3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd1d3('0x10'));var Redis=require(_0xd1d3('0x11'));var authService=require(_0xd1d3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1d3('0x13'));var hardwareService=require(_0xd1d3('0x14'));var logger=require(_0xd1d3('0x15'))(_0xd1d3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd1d3('0x17'));var db=require(_0xd1d3('0x18'))['db'];function respondWithStatusCode(_0x12726e,_0x5f1fd6){_0x5f1fd6=_0x5f1fd6||0xcc;return function(_0x447bb9){if(_0x447bb9){return _0x12726e[_0xd1d3('0x19')](_0x5f1fd6);}return _0x12726e['status'](_0x5f1fd6)[_0xd1d3('0x1a')]();};}function respondWithResult(_0x38cad0,_0x56afcc){_0x56afcc=_0x56afcc||0xc8;return function(_0x3b71c5){if(_0x3b71c5){return _0x38cad0['status'](_0x56afcc)[_0xd1d3('0x1b')](_0x3b71c5);}};}function respondWithFilteredResult(_0x40d267,_0x458e2e){return function(_0x50d448){if(_0x50d448){var _0x172db1=typeof _0x458e2e[_0xd1d3('0x1c')]===_0xd1d3('0x1d')&&typeof _0x458e2e[_0xd1d3('0x1e')]==='undefined';var _0x5916b0=_0x50d448[_0xd1d3('0x1f')];var _0x314416=_0x172db1?0x0:_0x458e2e['offset'];var _0x1316c8=_0x172db1?_0x50d448[_0xd1d3('0x1f')]:_0x458e2e[_0xd1d3('0x1c')]+_0x458e2e[_0xd1d3('0x1e')];var _0x16e93e;if(_0x1316c8>=_0x5916b0){_0x1316c8=_0x5916b0;_0x16e93e=0xc8;}else{_0x16e93e=0xce;}_0x40d267[_0xd1d3('0x20')](_0x16e93e);return _0x40d267['set'](_0xd1d3('0x21'),_0x314416+'-'+_0x1316c8+'/'+_0x5916b0)[_0xd1d3('0x1b')](_0x50d448);}return null;};}function patchUpdates(_0x944087){return function(_0x43ce2e){try{jsonpatch[_0xd1d3('0x22')](_0x43ce2e,_0x944087,!![]);}catch(_0x22d062){return BPromise[_0xd1d3('0x23')](_0x22d062);}return _0x43ce2e[_0xd1d3('0x24')]();};}function saveUpdates(_0x55f2e8,_0x1a0e20){return function(_0x2fb724){if(_0x2fb724){return _0x2fb724[_0xd1d3('0x25')](_0x55f2e8)[_0xd1d3('0x26')](function(_0x4578a1){return _0x4578a1;});}return null;};}function removeEntity(_0x4fa0b8,_0x1f1224){return function(_0x404dc8){if(_0x404dc8){return _0x404dc8['destroy']()[_0xd1d3('0x26')](function(){_0x4fa0b8['status'](0xcc)[_0xd1d3('0x1a')]();});}};}function handleEntityNotFound(_0x565aeb,_0x506ee2){return function(_0x24f4b9){if(!_0x24f4b9){_0x565aeb[_0xd1d3('0x19')](0x194);}return _0x24f4b9;};}function handleError(_0x29b673,_0x136b0f){_0x136b0f=_0x136b0f||0x1f4;return function(_0x42623e){logger['error'](_0x42623e['stack']);if(_0x42623e[_0xd1d3('0x27')]){delete _0x42623e[_0xd1d3('0x27')];}_0x29b673[_0xd1d3('0x20')](_0x136b0f)['send'](_0x42623e);};}exports[_0xd1d3('0x28')]=function(_0x5b47c7,_0x37e0ce){var _0x327eb4={},_0x2cf88a={},_0xeec77a={'count':0x0,'rows':[]};var _0x1c3910=_[_0xd1d3('0x29')](db[_0xd1d3('0x2a')][_0xd1d3('0x2b')],function(_0x4c0741){return{'name':_0x4c0741['fieldName'],'type':_0x4c0741[_0xd1d3('0x2c')]['key']};});_0x2cf88a[_0xd1d3('0x2d')]=_['map'](_0x1c3910,_0xd1d3('0x27'));_0x2cf88a[_0xd1d3('0x2e')]=_[_0xd1d3('0x2f')](_0x5b47c7['query']);_0x2cf88a['filters']=_[_0xd1d3('0x30')](_0x2cf88a[_0xd1d3('0x2d')],_0x2cf88a[_0xd1d3('0x2e')]);_0x327eb4[_0xd1d3('0x31')]=_[_0xd1d3('0x30')](_0x2cf88a[_0xd1d3('0x2d')],qs[_0xd1d3('0x32')](_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x32')]));_0x327eb4['attributes']=_0x327eb4['attributes'][_0xd1d3('0x33')]?_0x327eb4['attributes']:_0x2cf88a['model'];if(!_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x34')](_0xd1d3('0x35'))){_0x327eb4[_0xd1d3('0x1e')]=qs['limit'](_0x5b47c7[_0xd1d3('0x2e')]['limit']);_0x327eb4[_0xd1d3('0x1c')]=qs[_0xd1d3('0x1c')](_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x1c')]);}_0x327eb4['order']=qs['sort'](_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x36')]);_0x327eb4['where']=qs[_0xd1d3('0x37')](_[_0xd1d3('0x38')](_0x5b47c7[_0xd1d3('0x2e')],_0x2cf88a[_0xd1d3('0x37')]),_0x1c3910);if(_0x5b47c7[_0xd1d3('0x2e')]['filter']){_0x327eb4[_0xd1d3('0x39')]=_[_0xd1d3('0x3a')](_0x327eb4[_0xd1d3('0x39')],{'$or':_[_0xd1d3('0x29')](_0x1c3910,function(_0x44d5b4){if(_0x44d5b4['type']!==_0xd1d3('0x3b')){var _0x565fac={};_0x565fac[_0x44d5b4[_0xd1d3('0x27')]]={'$like':'%'+_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x3c')]+'%'};return _0x565fac;}})});}_0x327eb4=_[_0xd1d3('0x3a')]({},_0x327eb4,_0x5b47c7[_0xd1d3('0x3d')]);var _0x444eaf={'where':_0x327eb4[_0xd1d3('0x39')]};return db[_0xd1d3('0x2a')][_0xd1d3('0x1f')](_0x444eaf)['then'](function(_0x249f02){_0xeec77a[_0xd1d3('0x1f')]=_0x249f02;if(_0x5b47c7[_0xd1d3('0x2e')][_0xd1d3('0x3e')]){_0x327eb4[_0xd1d3('0x3f')]=[{'all':!![]}];}return db[_0xd1d3('0x2a')]['findAll'](_0x327eb4);})[_0xd1d3('0x26')](function(_0x5c7798){_0xeec77a[_0xd1d3('0x40')]=_0x5c7798;return _0xeec77a;})[_0xd1d3('0x26')](respondWithFilteredResult(_0x37e0ce,_0x327eb4))[_0xd1d3('0x41')](handleError(_0x37e0ce,null));};exports[_0xd1d3('0x42')]=function(_0x560778,_0x4be6b6){var _0x3e95fa={'raw':![],'where':{'id':_0x560778['params']['id']}},_0x70cebf={};_0x70cebf[_0xd1d3('0x2d')]=_[_0xd1d3('0x2f')](db[_0xd1d3('0x2a')][_0xd1d3('0x2b')]);_0x70cebf['query']=_[_0xd1d3('0x2f')](_0x560778[_0xd1d3('0x2e')]);_0x70cebf[_0xd1d3('0x37')]=_[_0xd1d3('0x30')](_0x70cebf['model'],_0x70cebf[_0xd1d3('0x2e')]);_0x3e95fa[_0xd1d3('0x31')]=_[_0xd1d3('0x30')](_0x70cebf[_0xd1d3('0x2d')],qs[_0xd1d3('0x32')](_0x560778[_0xd1d3('0x2e')][_0xd1d3('0x32')]));_0x3e95fa['attributes']=_0x3e95fa['attributes'][_0xd1d3('0x33')]?_0x3e95fa[_0xd1d3('0x31')]:_0x70cebf[_0xd1d3('0x2d')];if(_0x560778['query'][_0xd1d3('0x3e')]){_0x3e95fa['include']=[{'all':!![]}];}_0x3e95fa=_['merge']({},_0x3e95fa,_0x560778['options']);return db[_0xd1d3('0x2a')][_0xd1d3('0x43')](_0x3e95fa)[_0xd1d3('0x26')](handleEntityNotFound(_0x4be6b6,null))[_0xd1d3('0x26')](respondWithResult(_0x4be6b6,null))['catch'](handleError(_0x4be6b6,null));};exports[_0xd1d3('0x44')]=function(_0xc357c1,_0x50e132){return db[_0xd1d3('0x2a')]['create'](_0xc357c1[_0xd1d3('0x45')],{})[_0xd1d3('0x26')](respondWithResult(_0x50e132,0xc9))['catch'](handleError(_0x50e132,null));};exports['update']=function(_0xa45078,_0x22cc1d){if(_0xa45078[_0xd1d3('0x45')]['id']){delete _0xa45078[_0xd1d3('0x45')]['id'];}return db[_0xd1d3('0x2a')][_0xd1d3('0x43')]({'where':{'id':_0xa45078[_0xd1d3('0x46')]['id']}})[_0xd1d3('0x26')](handleEntityNotFound(_0x22cc1d,null))[_0xd1d3('0x26')](saveUpdates(_0xa45078[_0xd1d3('0x45')],null))[_0xd1d3('0x26')](respondWithResult(_0x22cc1d,null))[_0xd1d3('0x41')](handleError(_0x22cc1d,null));};exports[_0xd1d3('0x47')]=function(_0xeca133,_0xa2c6a5){return db[_0xd1d3('0x2a')][_0xd1d3('0x43')]({'where':{'id':_0xeca133['params']['id']}})[_0xd1d3('0x26')](handleEntityNotFound(_0xa2c6a5,null))[_0xd1d3('0x26')](removeEntity(_0xa2c6a5,null))[_0xd1d3('0x41')](handleError(_0xa2c6a5,null));};exports['describe']=function(_0x44adcc,_0x455902){return db[_0xd1d3('0x2a')]['describe']()[_0xd1d3('0x26')](respondWithResult(_0x455902,null))[_0xd1d3('0x41')](handleError(_0x455902,null));}; \ No newline at end of file +var _0x4a38=['includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','IntegrationReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count'];(function(_0x8a51a1,_0x5507d7){var _0x715d66=function(_0x557e2f){while(--_0x557e2f){_0x8a51a1['push'](_0x8a51a1['shift']());}};_0x715d66(++_0x5507d7);}(_0x4a38,0x9c));var _0x84a3=function(_0x3c0a1b,_0x5a452){_0x3c0a1b=_0x3c0a1b-0x0;var _0x38c9df=_0x4a38[_0x3c0a1b];return _0x38c9df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84a3('0x0'));var jsonpatch=require(_0x84a3('0x1'));var rp=require('request-promise');var moment=require(_0x84a3('0x2'));var BPromise=require(_0x84a3('0x3'));var Mustache=require(_0x84a3('0x4'));var util=require(_0x84a3('0x5'));var path=require(_0x84a3('0x6'));var sox=require('sox');var csv=require(_0x84a3('0x7'));var ejs=require(_0x84a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84a3('0x9'));var squel=require(_0x84a3('0xa'));var crypto=require(_0x84a3('0xb'));var jsforce=require(_0x84a3('0xc'));var deskjs=require(_0x84a3('0xd'));var toCsv=require(_0x84a3('0x7'));var querystring=require('querystring');var Papa=require(_0x84a3('0xe'));var Redis=require(_0x84a3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84a3('0x10'));var logger=require('../../config/logger')(_0x84a3('0x11'));var utils=require(_0x84a3('0x12'));var config=require(_0x84a3('0x13'));var licenseUtil=require(_0x84a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef3cc,_0x1fc0af){_0x1fc0af=_0x1fc0af||0xcc;return function(_0x1fbc96){if(_0x1fbc96){return _0x1ef3cc[_0x84a3('0x15')](_0x1fc0af);}return _0x1ef3cc['status'](_0x1fc0af)[_0x84a3('0x16')]();};}function respondWithResult(_0x99aace,_0x44aa7d){_0x44aa7d=_0x44aa7d||0xc8;return function(_0x41ac54){if(_0x41ac54){return _0x99aace[_0x84a3('0x17')](_0x44aa7d)[_0x84a3('0x18')](_0x41ac54);}};}function respondWithFilteredResult(_0x4caee2,_0x31fadb){return function(_0x430646){if(_0x430646){var _0x51372e=typeof _0x31fadb[_0x84a3('0x19')]==='undefined'&&typeof _0x31fadb[_0x84a3('0x1a')]===_0x84a3('0x1b');var _0x1afd6f=_0x430646['count'];var _0x24a9c8=_0x51372e?0x0:_0x31fadb['offset'];var _0x3c1943=_0x51372e?_0x430646['count']:_0x31fadb[_0x84a3('0x19')]+_0x31fadb[_0x84a3('0x1a')];var _0x4e6e0b;if(_0x3c1943>=_0x1afd6f){_0x3c1943=_0x1afd6f;_0x4e6e0b=0xc8;}else{_0x4e6e0b=0xce;}_0x4caee2[_0x84a3('0x17')](_0x4e6e0b);return _0x4caee2[_0x84a3('0x1c')](_0x84a3('0x1d'),_0x24a9c8+'-'+_0x3c1943+'/'+_0x1afd6f)[_0x84a3('0x18')](_0x430646);}return null;};}function patchUpdates(_0x3f6c40){return function(_0x1b1799){try{jsonpatch[_0x84a3('0x1e')](_0x1b1799,_0x3f6c40,!![]);}catch(_0x4347a3){return BPromise[_0x84a3('0x1f')](_0x4347a3);}return _0x1b1799[_0x84a3('0x20')]();};}function saveUpdates(_0x414176,_0x2d8651){return function(_0x3e4c2d){if(_0x3e4c2d){return _0x3e4c2d['update'](_0x414176)[_0x84a3('0x21')](function(_0x31be8b){return _0x31be8b;});}return null;};}function removeEntity(_0x54a677,_0x11a241){return function(_0x3bd26c){if(_0x3bd26c){return _0x3bd26c[_0x84a3('0x22')]()[_0x84a3('0x21')](function(){_0x54a677[_0x84a3('0x17')](0xcc)[_0x84a3('0x16')]();});}};}function handleEntityNotFound(_0x2774ed,_0x21395e){return function(_0x2c9dfb){if(!_0x2c9dfb){_0x2774ed[_0x84a3('0x15')](0x194);}return _0x2c9dfb;};}function handleError(_0x1fed28,_0x77288d){_0x77288d=_0x77288d||0x1f4;return function(_0x591881){logger[_0x84a3('0x23')](_0x591881['stack']);if(_0x591881[_0x84a3('0x24')]){delete _0x591881['name'];}_0x1fed28['status'](_0x77288d)['send'](_0x591881);};}exports[_0x84a3('0x25')]=function(_0x1bd18d,_0x18fa7a){var _0x3ed6d9={},_0x38a83d={},_0xd0575a={'count':0x0,'rows':[]};var _0x5c2fdb=_[_0x84a3('0x26')](db[_0x84a3('0x27')][_0x84a3('0x28')],function(_0x2b0006){return{'name':_0x2b0006[_0x84a3('0x29')],'type':_0x2b0006['type']['key']};});_0x38a83d[_0x84a3('0x2a')]=_[_0x84a3('0x26')](_0x5c2fdb,'name');_0x38a83d[_0x84a3('0x2b')]=_[_0x84a3('0x2c')](_0x1bd18d[_0x84a3('0x2b')]);_0x38a83d[_0x84a3('0x2d')]=_[_0x84a3('0x2e')](_0x38a83d[_0x84a3('0x2a')],_0x38a83d[_0x84a3('0x2b')]);_0x3ed6d9[_0x84a3('0x2f')]=_[_0x84a3('0x2e')](_0x38a83d[_0x84a3('0x2a')],qs[_0x84a3('0x30')](_0x1bd18d[_0x84a3('0x2b')]['fields']));_0x3ed6d9[_0x84a3('0x2f')]=_0x3ed6d9['attributes'][_0x84a3('0x31')]?_0x3ed6d9[_0x84a3('0x2f')]:_0x38a83d[_0x84a3('0x2a')];if(!_0x1bd18d['query'][_0x84a3('0x32')](_0x84a3('0x33'))){_0x3ed6d9[_0x84a3('0x1a')]=qs[_0x84a3('0x1a')](_0x1bd18d['query']['limit']);_0x3ed6d9[_0x84a3('0x19')]=qs[_0x84a3('0x19')](_0x1bd18d[_0x84a3('0x2b')][_0x84a3('0x19')]);}_0x3ed6d9[_0x84a3('0x34')]=qs['sort'](_0x1bd18d[_0x84a3('0x2b')][_0x84a3('0x35')]);_0x3ed6d9[_0x84a3('0x36')]=qs[_0x84a3('0x2d')](_['pick'](_0x1bd18d[_0x84a3('0x2b')],_0x38a83d[_0x84a3('0x2d')]),_0x5c2fdb);if(_0x1bd18d[_0x84a3('0x2b')][_0x84a3('0x37')]){_0x3ed6d9[_0x84a3('0x36')]=_['merge'](_0x3ed6d9['where'],{'$or':_[_0x84a3('0x26')](_0x5c2fdb,function(_0x1ea1f2){if(_0x1ea1f2['type']!==_0x84a3('0x38')){var _0xb18e48={};_0xb18e48[_0x1ea1f2['name']]={'$like':'%'+_0x1bd18d[_0x84a3('0x2b')][_0x84a3('0x37')]+'%'};return _0xb18e48;}})});}_0x3ed6d9=_[_0x84a3('0x39')]({},_0x3ed6d9,_0x1bd18d[_0x84a3('0x3a')]);var _0x509691={'where':_0x3ed6d9[_0x84a3('0x36')]};return db[_0x84a3('0x27')][_0x84a3('0x3b')](_0x509691)[_0x84a3('0x21')](function(_0x2fcdfa){_0xd0575a['count']=_0x2fcdfa;if(_0x1bd18d[_0x84a3('0x2b')][_0x84a3('0x3c')]){_0x3ed6d9[_0x84a3('0x3d')]=[{'all':!![]}];}return db[_0x84a3('0x27')][_0x84a3('0x3e')](_0x3ed6d9);})[_0x84a3('0x21')](function(_0x3dd70b){_0xd0575a[_0x84a3('0x3f')]=_0x3dd70b;return _0xd0575a;})[_0x84a3('0x21')](respondWithFilteredResult(_0x18fa7a,_0x3ed6d9))[_0x84a3('0x40')](handleError(_0x18fa7a,null));};exports[_0x84a3('0x41')]=function(_0x433453,_0x4b92b1){var _0x3c7ac4={'raw':![],'where':{'id':_0x433453[_0x84a3('0x42')]['id']}},_0x774b8b={};_0x774b8b['model']=_['keys'](db[_0x84a3('0x27')][_0x84a3('0x28')]);_0x774b8b[_0x84a3('0x2b')]=_[_0x84a3('0x2c')](_0x433453[_0x84a3('0x2b')]);_0x774b8b[_0x84a3('0x2d')]=_[_0x84a3('0x2e')](_0x774b8b[_0x84a3('0x2a')],_0x774b8b[_0x84a3('0x2b')]);_0x3c7ac4['attributes']=_[_0x84a3('0x2e')](_0x774b8b['model'],qs[_0x84a3('0x30')](_0x433453[_0x84a3('0x2b')][_0x84a3('0x30')]));_0x3c7ac4[_0x84a3('0x2f')]=_0x3c7ac4['attributes']['length']?_0x3c7ac4['attributes']:_0x774b8b['model'];if(_0x433453[_0x84a3('0x2b')][_0x84a3('0x3c')]){_0x3c7ac4['include']=[{'all':!![]}];}_0x3c7ac4=_[_0x84a3('0x39')]({},_0x3c7ac4,_0x433453[_0x84a3('0x3a')]);return db[_0x84a3('0x27')][_0x84a3('0x43')](_0x3c7ac4)[_0x84a3('0x21')](handleEntityNotFound(_0x4b92b1,null))[_0x84a3('0x21')](respondWithResult(_0x4b92b1,null))[_0x84a3('0x40')](handleError(_0x4b92b1,null));};exports['create']=function(_0x1ebb17,_0x25f05f){return db[_0x84a3('0x27')][_0x84a3('0x44')](_0x1ebb17[_0x84a3('0x45')],{})[_0x84a3('0x21')](respondWithResult(_0x25f05f,0xc9))[_0x84a3('0x40')](handleError(_0x25f05f,null));};exports[_0x84a3('0x46')]=function(_0x569a56,_0x579399){if(_0x569a56['body']['id']){delete _0x569a56[_0x84a3('0x45')]['id'];}return db[_0x84a3('0x27')]['find']({'where':{'id':_0x569a56['params']['id']}})[_0x84a3('0x21')](handleEntityNotFound(_0x579399,null))['then'](saveUpdates(_0x569a56[_0x84a3('0x45')],null))[_0x84a3('0x21')](respondWithResult(_0x579399,null))['catch'](handleError(_0x579399,null));};exports['destroy']=function(_0x541e08,_0x1d4421){return db[_0x84a3('0x27')][_0x84a3('0x43')]({'where':{'id':_0x541e08[_0x84a3('0x42')]['id']}})[_0x84a3('0x21')](handleEntityNotFound(_0x1d4421,null))['then'](removeEntity(_0x1d4421,null))[_0x84a3('0x40')](handleError(_0x1d4421,null));};exports[_0x84a3('0x47')]=function(_0x2ca29d,_0xf061df){return db[_0x84a3('0x27')][_0x84a3('0x47')]()[_0x84a3('0x21')](respondWithResult(_0xf061df,null))[_0x84a3('0x40')](handleError(_0xf061df,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 68f2350..42524f6 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 _0xa7ad=['request-promise','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0xa7ad,0x139));var _0xda7a=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xa7ad[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xda7a('0x0'));var util=require(_0xda7a('0x1'));var logger=require(_0xda7a('0x2'))(_0xda7a('0x3'));var moment=require(_0xda7a('0x4'));var BPromise=require(_0xda7a('0x5'));var rp=require(_0xda7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda7a('0x7'));var config=require(_0xda7a('0x8'));var attributes=require(_0xda7a('0x9'));module['exports']=function(_0x15c227,_0x9960a0){return _0x15c227['define'](_0xda7a('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc370=['define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./integrationReport.attributes','exports'];(function(_0x27334c,_0x3e1647){var _0x296305=function(_0x294e34){while(--_0x294e34){_0x27334c['push'](_0x27334c['shift']());}};_0x296305(++_0x3e1647);}(_0xc370,0x15f));var _0x0c37=function(_0xabaf96,_0x41570a){_0xabaf96=_0xabaf96-0x0;var _0x2768d3=_0xc370[_0xabaf96];return _0x2768d3;};'use strict';var _=require(_0x0c37('0x0'));var util=require('util');var logger=require(_0x0c37('0x1'))(_0x0c37('0x2'));var moment=require(_0x0c37('0x3'));var BPromise=require(_0x0c37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c37('0x5'));var rimraf=require('rimraf');var config=require(_0x0c37('0x6'));var attributes=require(_0x0c37('0x7'));module[_0x0c37('0x8')]=function(_0xc777ff,_0x3c70a3){return _0xc777ff[_0x0c37('0x9')](_0x0c37('0xa'),attributes,{'tableName':_0x0c37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index fb1460a..c706b23 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x35b76f,_0x324c48){var _0x582906=function(_0x5e4a7b){while(--_0x5e4a7b){_0x35b76f['push'](_0x35b76f['shift']());}};_0x582906(++_0x324c48);}(_0xadb5,0xad));var _0x5adb=function(_0xf0fc64,_0x8cdc95){_0xf0fc64=_0xf0fc64-0x0;var _0x248b47=_0xadb5[_0xf0fc64];return _0x248b47;};'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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x281b52,_0x888318){var _0x56f0cd=function(_0x24e0f9){while(--_0x24e0f9){_0x281b52['push'](_0x281b52['shift']());}};_0x56f0cd(++_0x888318);}(_0x326f,0xd1));var _0xf326=function(_0x499e39,_0x15e45f){_0x499e39=_0x499e39-0x0;var _0x2f2bb4=_0x326f[_0x499e39];return _0x2f2bb4;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 3d67807..63b6115 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 _0x2bd8=['addIntervals','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','/:id/sub_intervals/create_many'];(function(_0x2f1089,_0x42d03d){var _0x1af573=function(_0x13d931){while(--_0x13d931){_0x2f1089['push'](_0x2f1089['shift']());}};_0x1af573(++_0x42d03d);}(_0x2bd8,0x130));var _0x82bd=function(_0x24881e,_0x5ca0c7){_0x24881e=_0x24881e-0x0;var _0x40675b=_0x2bd8[_0x24881e];return _0x40675b;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['post'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['addInterval']);router[_0x82bd('0xe')](_0x82bd('0xf'),auth['isAuthenticated'](),controller[_0x82bd('0x10')]);router['put'](_0x82bd('0xb'),auth['isAuthenticated'](),controller[_0x82bd('0x11')]);router[_0x82bd('0x12')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller['destroy']);module[_0x82bd('0x13')]=router; \ No newline at end of file +var _0x8d0a=['/:id/sub_intervals','create','addInterval','post','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x8d0a,0x65));var _0xa8d0=function(_0x55fd89,_0x28096d){_0x55fd89=_0x55fd89-0x0;var _0x28fa12=_0x8d0a[_0x55fd89];return _0x28fa12;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['show']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0xa8d0('0xf')]);router['post'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')](_0xa8d0('0x12'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x13')]);router[_0xa8d0('0x14')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x15')]);router['delete'](_0xa8d0('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa8d0('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4999d9b..2712d19 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 _0xf52b=['exports','STRING','sequelize'];(function(_0x33bad8,_0xa77a59){var _0xed1658=function(_0x1864f4){while(--_0x1864f4){_0x33bad8['push'](_0x33bad8['shift']());}};_0xed1658(++_0xa77a59);}(_0xf52b,0xe6));var _0xbf52=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0xf52b[_0x55ff79];return _0x579067;};'use strict';var Sequelize=require(_0xbf52('0x0'));module[_0xbf52('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbf52('0x2')]},'interval':{'type':Sequelize[_0xbf52('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x366c=['STRING','exports'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x366c,0xed));var _0xc366=function(_0x3287bf,_0x18f673){_0x3287bf=_0x3287bf-0x0;var _0x1496a8=_0x366c[_0x3287bf];return _0x1496a8;};'use strict';var Sequelize=require('sequelize');module[_0xc366('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc366('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index bab2d0c..5295ce1 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 _0xd726=['../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','then','get','Intervals','UserProfileResource','sendStatus','stack','name','send','map','Interval','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getIntervals','findOne','order','addIntervals','transaction','IntervalId','bulkCreate','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xd726,0x19c));var _0x6d72=function(_0x255b5c,_0x225f8c){_0x255b5c=_0x255b5c-0x0;var _0x3a4585=_0xd726[_0x255b5c];return _0x3a4585;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6d72('0x0'));var rp=require(_0x6d72('0x1'));var moment=require(_0x6d72('0x2'));var BPromise=require(_0x6d72('0x3'));var Mustache=require(_0x6d72('0x4'));var util=require(_0x6d72('0x5'));var path=require(_0x6d72('0x6'));var sox=require(_0x6d72('0x7'));var csv=require(_0x6d72('0x8'));var ejs=require(_0x6d72('0x9'));var fs=require('fs');var fs_extra=require(_0x6d72('0xa'));var _=require('lodash');var squel=require(_0x6d72('0xb'));var crypto=require(_0x6d72('0xc'));var jsforce=require(_0x6d72('0xd'));var deskjs=require(_0x6d72('0xe'));var toCsv=require(_0x6d72('0x8'));var querystring=require(_0x6d72('0xf'));var Papa=require(_0x6d72('0x10'));var Redis=require(_0x6d72('0x11'));var authService=require(_0x6d72('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d72('0x13'));var logger=require(_0x6d72('0x14'))(_0x6d72('0x15'));var utils=require(_0x6d72('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x6d72('0x17'));function respondWithStatusCode(_0x51e8ff,_0x1212d8){_0x1212d8=_0x1212d8||0xcc;return function(_0x135ae7){if(_0x135ae7){return _0x51e8ff['sendStatus'](_0x1212d8);}return _0x51e8ff[_0x6d72('0x18')](_0x1212d8)[_0x6d72('0x19')]();};}function respondWithResult(_0x4d06a5,_0xc2fbd3){_0xc2fbd3=_0xc2fbd3||0xc8;return function(_0xf892a){if(_0xf892a){return _0x4d06a5[_0x6d72('0x18')](_0xc2fbd3)[_0x6d72('0x1a')](_0xf892a);}};}function respondWithFilteredResult(_0x4a1191,_0x224cc1){return function(_0x37af53){if(_0x37af53){var _0x1d8593=typeof _0x224cc1[_0x6d72('0x1b')]===_0x6d72('0x1c')&&typeof _0x224cc1[_0x6d72('0x1d')]===_0x6d72('0x1c');var _0x5082ab=_0x37af53[_0x6d72('0x1e')];var _0x49801b=_0x1d8593?0x0:_0x224cc1['offset'];var _0x53fb42=_0x1d8593?_0x37af53['count']:_0x224cc1[_0x6d72('0x1b')]+_0x224cc1['limit'];var _0xafef1e;if(_0x53fb42>=_0x5082ab){_0x53fb42=_0x5082ab;_0xafef1e=0xc8;}else{_0xafef1e=0xce;}_0x4a1191[_0x6d72('0x18')](_0xafef1e);return _0x4a1191[_0x6d72('0x1f')]('Content-Range',_0x49801b+'-'+_0x53fb42+'/'+_0x5082ab)[_0x6d72('0x1a')](_0x37af53);}return null;};}function patchUpdates(_0x147b56){return function(_0x4e75f5){try{jsonpatch['apply'](_0x4e75f5,_0x147b56,!![]);}catch(_0x3b9bfa){return BPromise[_0x6d72('0x20')](_0x3b9bfa);}return _0x4e75f5['save']();};}function saveUpdates(_0x4510dc,_0x2e7099){return function(_0x4e46d5){if(_0x4e46d5){return _0x4e46d5[_0x6d72('0x21')](_0x4510dc)['then'](function(_0xf85ad8){return _0xf85ad8;});}return null;};}function removeEntity(_0x319c22,_0x478a0f){return function(_0x381055){if(_0x381055){return _0x381055[_0x6d72('0x22')]()[_0x6d72('0x23')](function(){var _0x1fa228=_0x381055[_0x6d72('0x24')]({'plain':!![]});var _0x50880b=_0x6d72('0x25');return db[_0x6d72('0x26')][_0x6d72('0x22')]({'where':{'type':_0x50880b,'resourceId':_0x1fa228['id']}})['then'](function(){return _0x381055;});})['then'](function(){_0x319c22['status'](0xcc)[_0x6d72('0x19')]();});}};}function handleEntityNotFound(_0x8455a8,_0x44fc1c){return function(_0xd98d91){if(!_0xd98d91){_0x8455a8[_0x6d72('0x27')](0x194);}return _0xd98d91;};}function handleError(_0x4f37e2,_0x3f848a){_0x3f848a=_0x3f848a||0x1f4;return function(_0x1a147d){logger['error'](_0x1a147d[_0x6d72('0x28')]);if(_0x1a147d['name']){delete _0x1a147d[_0x6d72('0x29')];}_0x4f37e2[_0x6d72('0x18')](_0x3f848a)[_0x6d72('0x2a')](_0x1a147d);};}exports['index']=function(_0x58d54f,_0x3f6727){var _0x1bbe65={},_0x30632e={},_0x15b75f={'count':0x0,'rows':[]};var _0x35e1f4=_[_0x6d72('0x2b')](db[_0x6d72('0x2c')][_0x6d72('0x2d')],function(_0x1ea2f8){return{'name':_0x1ea2f8[_0x6d72('0x2e')],'type':_0x1ea2f8[_0x6d72('0x2f')]['key']};});_0x30632e['model']=_['map'](_0x35e1f4,_0x6d72('0x29'));_0x30632e['query']=_[_0x6d72('0x30')](_0x58d54f[_0x6d72('0x31')]);_0x30632e[_0x6d72('0x32')]=_[_0x6d72('0x33')](_0x30632e[_0x6d72('0x34')],_0x30632e[_0x6d72('0x31')]);_0x1bbe65['attributes']=_[_0x6d72('0x33')](_0x30632e[_0x6d72('0x34')],qs[_0x6d72('0x35')](_0x58d54f['query']['fields']));_0x1bbe65[_0x6d72('0x36')]=_0x1bbe65[_0x6d72('0x36')][_0x6d72('0x37')]?_0x1bbe65[_0x6d72('0x36')]:_0x30632e[_0x6d72('0x34')];if(!_0x58d54f['query'][_0x6d72('0x38')](_0x6d72('0x39'))){_0x1bbe65[_0x6d72('0x1d')]=qs['limit'](_0x58d54f['query'][_0x6d72('0x1d')]);_0x1bbe65[_0x6d72('0x1b')]=qs[_0x6d72('0x1b')](_0x58d54f[_0x6d72('0x31')]['offset']);}_0x1bbe65['order']=qs['sort'](_0x58d54f['query'][_0x6d72('0x3a')]);_0x1bbe65[_0x6d72('0x3b')]=qs[_0x6d72('0x32')](_[_0x6d72('0x3c')](_0x58d54f[_0x6d72('0x31')],_0x30632e[_0x6d72('0x32')]),_0x35e1f4);if(_0x58d54f[_0x6d72('0x31')][_0x6d72('0x3d')]){_0x1bbe65['where']=_['merge'](_0x1bbe65[_0x6d72('0x3b')],{'$or':_[_0x6d72('0x2b')](_0x35e1f4,function(_0x9ce8fa){if(_0x9ce8fa[_0x6d72('0x2f')]!==_0x6d72('0x3e')){var _0x522408={};_0x522408[_0x9ce8fa[_0x6d72('0x29')]]={'$like':'%'+_0x58d54f[_0x6d72('0x31')][_0x6d72('0x3d')]+'%'};return _0x522408;}})});}_0x1bbe65=_['merge']({},_0x1bbe65,_0x58d54f[_0x6d72('0x3f')]);var _0x5983ee={'where':_0x1bbe65[_0x6d72('0x3b')]};return db[_0x6d72('0x2c')][_0x6d72('0x1e')](_0x5983ee)[_0x6d72('0x23')](function(_0x483e97){_0x15b75f[_0x6d72('0x1e')]=_0x483e97;if(_0x58d54f[_0x6d72('0x31')]['includeAll']){_0x1bbe65[_0x6d72('0x40')]=[{'all':!![]}];}return db[_0x6d72('0x2c')][_0x6d72('0x41')](_0x1bbe65);})[_0x6d72('0x23')](function(_0x382d3f){_0x15b75f[_0x6d72('0x42')]=_0x382d3f;return _0x15b75f;})[_0x6d72('0x23')](respondWithFilteredResult(_0x3f6727,_0x1bbe65))[_0x6d72('0x43')](handleError(_0x3f6727,null));};exports['show']=function(_0x3054c0,_0x3dafab){var _0x5bea06={'raw':!![],'where':{'id':_0x3054c0['params']['id']}},_0x20ff00={};_0x20ff00[_0x6d72('0x34')]=_[_0x6d72('0x30')](db[_0x6d72('0x2c')][_0x6d72('0x2d')]);_0x20ff00[_0x6d72('0x31')]=_[_0x6d72('0x30')](_0x3054c0[_0x6d72('0x31')]);_0x20ff00['filters']=_[_0x6d72('0x33')](_0x20ff00['model'],_0x20ff00['query']);_0x5bea06[_0x6d72('0x36')]=_[_0x6d72('0x33')](_0x20ff00[_0x6d72('0x34')],qs['fields'](_0x3054c0[_0x6d72('0x31')][_0x6d72('0x35')]));_0x5bea06[_0x6d72('0x36')]=_0x5bea06[_0x6d72('0x36')][_0x6d72('0x37')]?_0x5bea06[_0x6d72('0x36')]:_0x20ff00['model'];if(_0x3054c0['query'][_0x6d72('0x44')]){_0x5bea06[_0x6d72('0x40')]=[{'all':!![]}];}_0x5bea06=_[_0x6d72('0x45')]({},_0x5bea06,_0x3054c0[_0x6d72('0x3f')]);return db[_0x6d72('0x2c')]['find'](_0x5bea06)['then'](handleEntityNotFound(_0x3dafab,null))['then'](respondWithResult(_0x3dafab,null))[_0x6d72('0x43')](handleError(_0x3dafab,null));};exports[_0x6d72('0x46')]=function(_0x4e0aca,_0x2a6c95){return db[_0x6d72('0x2c')]['create'](_0x4e0aca[_0x6d72('0x47')],{})[_0x6d72('0x23')](function(_0x163d37){var _0x4896fb=_0x4e0aca[_0x6d72('0x48')]['get']({'plain':!![]});if(!_0x4896fb)throw new Error(_0x6d72('0x49'));if(_0x4896fb[_0x6d72('0x4a')]===_0x6d72('0x48')){var _0xbd642e=_0x163d37[_0x6d72('0x24')]({'plain':!![]});var _0x30eed0='Intervals';return db[_0x6d72('0x4b')][_0x6d72('0x4c')]({'where':{'name':_0x30eed0,'userProfileId':_0x4896fb['userProfileId']},'raw':!![]})[_0x6d72('0x23')](function(_0x4a5414){if(_0x4a5414&&_0x4a5414['autoAssociation']===0x0){return db['UserProfileResource'][_0x6d72('0x46')]({'name':_0xbd642e['name'],'resourceId':_0xbd642e['id'],'type':_0x4a5414[_0x6d72('0x29')],'sectionId':_0x4a5414['id']},{})[_0x6d72('0x23')](function(){return _0x163d37;});}else{return _0x163d37;}})['catch'](function(_0x57a0ec){logger[_0x6d72('0x4d')](_0x6d72('0x4e'),_0x57a0ec);throw _0x57a0ec;});}return _0x163d37;})['then'](respondWithResult(_0x2a6c95,0xc9))[_0x6d72('0x43')](handleError(_0x2a6c95,null));};exports[_0x6d72('0x21')]=function(_0x3cedc1,_0x3c7bf5){if(_0x3cedc1[_0x6d72('0x47')]['id']){delete _0x3cedc1[_0x6d72('0x47')]['id'];}return db[_0x6d72('0x2c')][_0x6d72('0x4c')]({'where':{'id':_0x3cedc1[_0x6d72('0x4f')]['id']}})[_0x6d72('0x23')](handleEntityNotFound(_0x3c7bf5,null))[_0x6d72('0x23')](saveUpdates(_0x3cedc1['body'],null))[_0x6d72('0x23')](respondWithResult(_0x3c7bf5,null))['catch'](handleError(_0x3c7bf5,null));};exports['destroy']=function(_0x5f276a,_0x1cc0a6){return db[_0x6d72('0x2c')][_0x6d72('0x4c')]({'where':{'id':_0x5f276a[_0x6d72('0x4f')]['id']}})[_0x6d72('0x23')](handleEntityNotFound(_0x1cc0a6,null))[_0x6d72('0x23')](removeEntity(_0x1cc0a6,null))['catch'](handleError(_0x1cc0a6,null));};exports['addInterval']=function(_0x2b0c00,_0x5bb997,_0x4f212d){if(_0x2b0c00[_0x6d72('0x47')]['id']){delete _0x2b0c00[_0x6d72('0x47')]['id'];}return db['Interval']['find']({'where':{'id':_0x2b0c00[_0x6d72('0x4f')]['id']}})[_0x6d72('0x23')](handleEntityNotFound(_0x5bb997,null))[_0x6d72('0x23')](function(_0x494999){if(_0x494999){_0x2b0c00[_0x6d72('0x47')]['IntervalId']=_0x494999['id'];return db[_0x6d72('0x2c')][_0x6d72('0x46')](_0x2b0c00[_0x6d72('0x47')]);}})[_0x6d72('0x23')](respondWithResult(_0x5bb997,null))[_0x6d72('0x43')](handleError(_0x5bb997,null));};exports[_0x6d72('0x50')]=function(_0x529b39,_0x4f25fe,_0x4d2c64){var _0x211e8d={};var _0x3cd939={};var _0x33014b;var _0x43725e;return db['Interval'][_0x6d72('0x51')]({'where':{'id':_0x529b39[_0x6d72('0x4f')]['id']}})[_0x6d72('0x23')](handleEntityNotFound(_0x4f25fe,null))['then'](function(_0x8bac11){if(_0x8bac11){_0x33014b=_0x8bac11;_0x3cd939[_0x6d72('0x34')]=_[_0x6d72('0x30')](db[_0x6d72('0x2c')][_0x6d72('0x2d')]);_0x3cd939['query']=_[_0x6d72('0x30')](_0x529b39[_0x6d72('0x31')]);_0x3cd939['filters']=_['intersection'](_0x3cd939[_0x6d72('0x34')],_0x3cd939[_0x6d72('0x31')]);_0x211e8d[_0x6d72('0x36')]=_['intersection'](_0x3cd939[_0x6d72('0x34')],qs['fields'](_0x529b39[_0x6d72('0x31')][_0x6d72('0x35')]));_0x211e8d[_0x6d72('0x36')]=_0x211e8d[_0x6d72('0x36')]['length']?_0x211e8d['attributes']:_0x3cd939[_0x6d72('0x34')];_0x211e8d[_0x6d72('0x52')]=qs[_0x6d72('0x3a')](_0x529b39[_0x6d72('0x31')][_0x6d72('0x3a')]);_0x211e8d[_0x6d72('0x3b')]=qs[_0x6d72('0x32')](_['pick'](_0x529b39[_0x6d72('0x31')],_0x3cd939[_0x6d72('0x32')]));if(_0x529b39[_0x6d72('0x31')][_0x6d72('0x3d')]){_0x211e8d[_0x6d72('0x3b')]=_['merge'](_0x211e8d[_0x6d72('0x3b')],{'$or':_[_0x6d72('0x2b')](_0x211e8d['attributes'],function(_0x2a92c4){var _0x322dfe={};_0x322dfe[_0x2a92c4]={'$like':'%'+_0x529b39[_0x6d72('0x31')][_0x6d72('0x3d')]+'%'};return _0x322dfe;})});}_0x211e8d=_['merge']({},_0x211e8d,_0x529b39[_0x6d72('0x3f')]);return _0x33014b[_0x6d72('0x50')](_0x211e8d);}})[_0x6d72('0x23')](function(_0x5c9f97){if(_0x5c9f97){_0x43725e=_0x5c9f97[_0x6d72('0x37')];if(!_0x529b39[_0x6d72('0x31')][_0x6d72('0x38')](_0x6d72('0x39'))){_0x211e8d[_0x6d72('0x1d')]=qs[_0x6d72('0x1d')](_0x529b39[_0x6d72('0x31')]['limit']);_0x211e8d[_0x6d72('0x1b')]=qs[_0x6d72('0x1b')](_0x529b39['query'][_0x6d72('0x1b')]);}return _0x33014b['getIntervals'](_0x211e8d);}})[_0x6d72('0x23')](function(_0x33c9ff){if(_0x33c9ff){return _0x33c9ff?{'count':_0x43725e,'rows':_0x33c9ff}:null;}})[_0x6d72('0x23')](respondWithResult(_0x4f25fe,null))[_0x6d72('0x43')](handleError(_0x4f25fe,null));};exports[_0x6d72('0x53')]=function(_0xc495c2,_0x13abcd,_0x458779){return db['Interval'][_0x6d72('0x51')]({'where':{'id':_0xc495c2[_0x6d72('0x4f')]['id']}})[_0x6d72('0x23')](handleEntityNotFound(_0x13abcd,null))[_0x6d72('0x23')](function(_0x1a89d6){if(_0x1a89d6){return db['sequelize'][_0x6d72('0x54')](function(_0x122f20){return db[_0x6d72('0x2c')][_0x6d72('0x22')]({'where':{'IntervalId':_0xc495c2[_0x6d72('0x4f')]['id']},'transaction':_0x122f20})[_0x6d72('0x23')](function(_0x3ebd5d){var _0x542d06=_[_0x6d72('0x2b')](_0xc495c2[_0x6d72('0x47')],function(_0x3ad2e9){delete _0x3ad2e9['id'];_0x3ad2e9[_0x6d72('0x55')]=_0xc495c2['params']['id'];return _0x3ad2e9;});return db[_0x6d72('0x2c')][_0x6d72('0x56')](_0x542d06,{'transaction':_0x122f20});});})[_0x6d72('0x23')](function(){return db[_0x6d72('0x2c')][_0x6d72('0x41')]({'where':{'IntervalId':_0xc495c2[_0x6d72('0x4f')]['id']}});});}})[_0x6d72('0x23')](respondWithResult(_0x13abcd,null))[_0x6d72('0x43')](handleError(_0x13abcd,null));}; \ No newline at end of file +var _0x8ba1=['api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','Intervals','UserProfileResource','then','stack','name','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','Interval','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','findOne','filter','getIntervals','addIntervals','sequelize','IntervalId','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x594b16,_0x1bef5a){var _0xab72be=function(_0x6d4330){while(--_0x6d4330){_0x594b16['push'](_0x594b16['shift']());}};_0xab72be(++_0x1bef5a);}(_0x8ba1,0x160));var _0x18ba=function(_0x2fd705,_0xe3d10c){_0x2fd705=_0x2fd705-0x0;var _0x4fed2f=_0x8ba1[_0x2fd705];return _0x4fed2f;};'use strict';var emlformat=require(_0x18ba('0x0'));var rimraf=require(_0x18ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18ba('0x2'));var rp=require(_0x18ba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x18ba('0x4'));var util=require(_0x18ba('0x5'));var path=require(_0x18ba('0x6'));var sox=require(_0x18ba('0x7'));var csv=require(_0x18ba('0x8'));var ejs=require(_0x18ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18ba('0xa'));var squel=require(_0x18ba('0xb'));var crypto=require(_0x18ba('0xc'));var jsforce=require(_0x18ba('0xd'));var deskjs=require(_0x18ba('0xe'));var toCsv=require(_0x18ba('0x8'));var querystring=require('querystring');var Papa=require(_0x18ba('0xf'));var Redis=require(_0x18ba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18ba('0x11'));var as=require(_0x18ba('0x12'));var hardwareService=require(_0x18ba('0x13'));var logger=require('../../config/logger')(_0x18ba('0x14'));var utils=require('../../config/utils');var config=require(_0x18ba('0x15'));var licenseUtil=require(_0x18ba('0x16'));var db=require(_0x18ba('0x17'))['db'];var extensions=require(_0x18ba('0x18'));function respondWithStatusCode(_0x361c49,_0x48e186){_0x48e186=_0x48e186||0xcc;return function(_0x27aaa7){if(_0x27aaa7){return _0x361c49[_0x18ba('0x19')](_0x48e186);}return _0x361c49[_0x18ba('0x1a')](_0x48e186)[_0x18ba('0x1b')]();};}function respondWithResult(_0x3196db,_0x5a10e4){_0x5a10e4=_0x5a10e4||0xc8;return function(_0x2f3ee4){if(_0x2f3ee4){return _0x3196db[_0x18ba('0x1a')](_0x5a10e4)[_0x18ba('0x1c')](_0x2f3ee4);}};}function respondWithFilteredResult(_0x33faf9,_0x2ccc56){return function(_0x47adb8){if(_0x47adb8){var _0x3c4864=typeof _0x2ccc56[_0x18ba('0x1d')]===_0x18ba('0x1e')&&typeof _0x2ccc56[_0x18ba('0x1f')]==='undefined';var _0x489f91=_0x47adb8[_0x18ba('0x20')];var _0x3e323e=_0x3c4864?0x0:_0x2ccc56[_0x18ba('0x1d')];var _0x120d4b=_0x3c4864?_0x47adb8[_0x18ba('0x20')]:_0x2ccc56[_0x18ba('0x1d')]+_0x2ccc56[_0x18ba('0x1f')];var _0x25fc91;if(_0x120d4b>=_0x489f91){_0x120d4b=_0x489f91;_0x25fc91=0xc8;}else{_0x25fc91=0xce;}_0x33faf9[_0x18ba('0x1a')](_0x25fc91);return _0x33faf9['set'](_0x18ba('0x21'),_0x3e323e+'-'+_0x120d4b+'/'+_0x489f91)[_0x18ba('0x1c')](_0x47adb8);}return null;};}function patchUpdates(_0x11696f){return function(_0x20d18a){try{jsonpatch[_0x18ba('0x22')](_0x20d18a,_0x11696f,!![]);}catch(_0x2ef201){return BPromise[_0x18ba('0x23')](_0x2ef201);}return _0x20d18a[_0x18ba('0x24')]();};}function saveUpdates(_0xab3534,_0x1170e1){return function(_0x3e75ad){if(_0x3e75ad){return _0x3e75ad[_0x18ba('0x25')](_0xab3534)['then'](function(_0x29ddfe){return _0x29ddfe;});}return null;};}function removeEntity(_0x5a9e4a,_0x3a8729){return function(_0x1c62c7){if(_0x1c62c7){return _0x1c62c7[_0x18ba('0x26')]()['then'](function(){var _0x2fe0e2=_0x1c62c7[_0x18ba('0x27')]({'plain':!![]});var _0x1077f4=_0x18ba('0x28');return db[_0x18ba('0x29')]['destroy']({'where':{'type':_0x1077f4,'resourceId':_0x2fe0e2['id']}})[_0x18ba('0x2a')](function(){return _0x1c62c7;});})['then'](function(){_0x5a9e4a[_0x18ba('0x1a')](0xcc)[_0x18ba('0x1b')]();});}};}function handleEntityNotFound(_0x2d8c57,_0x1703a7){return function(_0x1d4b15){if(!_0x1d4b15){_0x2d8c57[_0x18ba('0x19')](0x194);}return _0x1d4b15;};}function handleError(_0x1d3456,_0x4ffe2d){_0x4ffe2d=_0x4ffe2d||0x1f4;return function(_0x4c8443){logger['error'](_0x4c8443[_0x18ba('0x2b')]);if(_0x4c8443[_0x18ba('0x2c')]){delete _0x4c8443[_0x18ba('0x2c')];}_0x1d3456[_0x18ba('0x1a')](_0x4ffe2d)['send'](_0x4c8443);};}exports[_0x18ba('0x2d')]=function(_0x382f76,_0x26f756){var _0x3c204c={},_0x52cfb6={},_0x5a2165={'count':0x0,'rows':[]};var _0x2f02ff=_[_0x18ba('0x2e')](db['Interval']['rawAttributes'],function(_0x3c380c){return{'name':_0x3c380c['fieldName'],'type':_0x3c380c[_0x18ba('0x2f')][_0x18ba('0x30')]};});_0x52cfb6[_0x18ba('0x31')]=_[_0x18ba('0x2e')](_0x2f02ff,_0x18ba('0x2c'));_0x52cfb6[_0x18ba('0x32')]=_[_0x18ba('0x33')](_0x382f76[_0x18ba('0x32')]);_0x52cfb6[_0x18ba('0x34')]=_['intersection'](_0x52cfb6['model'],_0x52cfb6['query']);_0x3c204c[_0x18ba('0x35')]=_[_0x18ba('0x36')](_0x52cfb6[_0x18ba('0x31')],qs['fields'](_0x382f76['query'][_0x18ba('0x37')]));_0x3c204c['attributes']=_0x3c204c[_0x18ba('0x35')][_0x18ba('0x38')]?_0x3c204c['attributes']:_0x52cfb6[_0x18ba('0x31')];if(!_0x382f76[_0x18ba('0x32')][_0x18ba('0x39')](_0x18ba('0x3a'))){_0x3c204c[_0x18ba('0x1f')]=qs[_0x18ba('0x1f')](_0x382f76[_0x18ba('0x32')][_0x18ba('0x1f')]);_0x3c204c[_0x18ba('0x1d')]=qs[_0x18ba('0x1d')](_0x382f76[_0x18ba('0x32')][_0x18ba('0x1d')]);}_0x3c204c[_0x18ba('0x3b')]=qs[_0x18ba('0x3c')](_0x382f76[_0x18ba('0x32')][_0x18ba('0x3c')]);_0x3c204c[_0x18ba('0x3d')]=qs[_0x18ba('0x34')](_[_0x18ba('0x3e')](_0x382f76['query'],_0x52cfb6[_0x18ba('0x34')]),_0x2f02ff);if(_0x382f76[_0x18ba('0x32')]['filter']){_0x3c204c['where']=_[_0x18ba('0x3f')](_0x3c204c[_0x18ba('0x3d')],{'$or':_[_0x18ba('0x2e')](_0x2f02ff,function(_0x2b7169){if(_0x2b7169[_0x18ba('0x2f')]!=='VIRTUAL'){var _0x17b4d5={};_0x17b4d5[_0x2b7169['name']]={'$like':'%'+_0x382f76[_0x18ba('0x32')]['filter']+'%'};return _0x17b4d5;}})});}_0x3c204c=_[_0x18ba('0x3f')]({},_0x3c204c,_0x382f76[_0x18ba('0x40')]);var _0x1cc98b={'where':_0x3c204c[_0x18ba('0x3d')]};return db[_0x18ba('0x41')][_0x18ba('0x20')](_0x1cc98b)['then'](function(_0x350354){_0x5a2165[_0x18ba('0x20')]=_0x350354;if(_0x382f76['query'][_0x18ba('0x42')]){_0x3c204c['include']=[{'all':!![]}];}return db[_0x18ba('0x41')][_0x18ba('0x43')](_0x3c204c);})[_0x18ba('0x2a')](function(_0x49b7dd){_0x5a2165[_0x18ba('0x44')]=_0x49b7dd;return _0x5a2165;})['then'](respondWithFilteredResult(_0x26f756,_0x3c204c))[_0x18ba('0x45')](handleError(_0x26f756,null));};exports[_0x18ba('0x46')]=function(_0x391920,_0x391d1e){var _0x5c4706={'raw':!![],'where':{'id':_0x391920[_0x18ba('0x47')]['id']}},_0x50d06b={};_0x50d06b['model']=_['keys'](db[_0x18ba('0x41')][_0x18ba('0x48')]);_0x50d06b[_0x18ba('0x32')]=_[_0x18ba('0x33')](_0x391920[_0x18ba('0x32')]);_0x50d06b[_0x18ba('0x34')]=_[_0x18ba('0x36')](_0x50d06b[_0x18ba('0x31')],_0x50d06b['query']);_0x5c4706[_0x18ba('0x35')]=_[_0x18ba('0x36')](_0x50d06b[_0x18ba('0x31')],qs['fields'](_0x391920['query'][_0x18ba('0x37')]));_0x5c4706[_0x18ba('0x35')]=_0x5c4706[_0x18ba('0x35')][_0x18ba('0x38')]?_0x5c4706[_0x18ba('0x35')]:_0x50d06b['model'];if(_0x391920[_0x18ba('0x32')][_0x18ba('0x42')]){_0x5c4706[_0x18ba('0x49')]=[{'all':!![]}];}_0x5c4706=_[_0x18ba('0x3f')]({},_0x5c4706,_0x391920[_0x18ba('0x40')]);return db[_0x18ba('0x41')][_0x18ba('0x4a')](_0x5c4706)['then'](handleEntityNotFound(_0x391d1e,null))['then'](respondWithResult(_0x391d1e,null))[_0x18ba('0x45')](handleError(_0x391d1e,null));};exports['create']=function(_0x2f5a6c,_0x300322){return db[_0x18ba('0x41')]['create'](_0x2f5a6c['body'],{})[_0x18ba('0x2a')](function(_0x4e19b5){var _0x4b9e3a=_0x2f5a6c[_0x18ba('0x4b')]['get']({'plain':!![]});if(!_0x4b9e3a)throw new Error(_0x18ba('0x4c'));if(_0x4b9e3a[_0x18ba('0x4d')]===_0x18ba('0x4b')){var _0x35a9a5=_0x4e19b5[_0x18ba('0x27')]({'plain':!![]});var _0x75cfd7='Intervals';return db[_0x18ba('0x4e')][_0x18ba('0x4a')]({'where':{'name':_0x75cfd7,'userProfileId':_0x4b9e3a[_0x18ba('0x4f')]},'raw':!![]})[_0x18ba('0x2a')](function(_0x8a9c55){if(_0x8a9c55&&_0x8a9c55[_0x18ba('0x50')]===0x0){return db[_0x18ba('0x29')][_0x18ba('0x51')]({'name':_0x35a9a5[_0x18ba('0x2c')],'resourceId':_0x35a9a5['id'],'type':_0x8a9c55[_0x18ba('0x2c')],'sectionId':_0x8a9c55['id']},{})[_0x18ba('0x2a')](function(){return _0x4e19b5;});}else{return _0x4e19b5;}})[_0x18ba('0x45')](function(_0x63377a){logger[_0x18ba('0x52')](_0x18ba('0x53'),_0x63377a);throw _0x63377a;});}return _0x4e19b5;})['then'](respondWithResult(_0x300322,0xc9))['catch'](handleError(_0x300322,null));};exports['update']=function(_0x51ff1e,_0x5b4d29){if(_0x51ff1e[_0x18ba('0x54')]['id']){delete _0x51ff1e[_0x18ba('0x54')]['id'];}return db[_0x18ba('0x41')][_0x18ba('0x4a')]({'where':{'id':_0x51ff1e[_0x18ba('0x47')]['id']}})[_0x18ba('0x2a')](handleEntityNotFound(_0x5b4d29,null))[_0x18ba('0x2a')](saveUpdates(_0x51ff1e[_0x18ba('0x54')],null))[_0x18ba('0x2a')](respondWithResult(_0x5b4d29,null))[_0x18ba('0x45')](handleError(_0x5b4d29,null));};exports[_0x18ba('0x26')]=function(_0x315423,_0x176d18){return db[_0x18ba('0x41')][_0x18ba('0x4a')]({'where':{'id':_0x315423[_0x18ba('0x47')]['id']}})[_0x18ba('0x2a')](handleEntityNotFound(_0x176d18,null))[_0x18ba('0x2a')](removeEntity(_0x176d18,null))[_0x18ba('0x45')](handleError(_0x176d18,null));};exports[_0x18ba('0x55')]=function(_0x256278,_0x481499,_0x461d88){if(_0x256278[_0x18ba('0x54')]['id']){delete _0x256278['body']['id'];}return db[_0x18ba('0x41')]['find']({'where':{'id':_0x256278[_0x18ba('0x47')]['id']}})[_0x18ba('0x2a')](handleEntityNotFound(_0x481499,null))[_0x18ba('0x2a')](function(_0x16972b){if(_0x16972b){_0x256278['body']['IntervalId']=_0x16972b['id'];return db['Interval'][_0x18ba('0x51')](_0x256278[_0x18ba('0x54')]);}})[_0x18ba('0x2a')](respondWithResult(_0x481499,null))[_0x18ba('0x45')](handleError(_0x481499,null));};exports['getIntervals']=function(_0x1ee2b2,_0x4926a7,_0x4a5242){var _0x2f4ce2={};var _0x3fcc3f={};var _0x3912fe;var _0x15bfa0;return db[_0x18ba('0x41')][_0x18ba('0x56')]({'where':{'id':_0x1ee2b2[_0x18ba('0x47')]['id']}})[_0x18ba('0x2a')](handleEntityNotFound(_0x4926a7,null))[_0x18ba('0x2a')](function(_0x57879c){if(_0x57879c){_0x3912fe=_0x57879c;_0x3fcc3f['model']=_[_0x18ba('0x33')](db['Interval'][_0x18ba('0x48')]);_0x3fcc3f[_0x18ba('0x32')]=_[_0x18ba('0x33')](_0x1ee2b2[_0x18ba('0x32')]);_0x3fcc3f['filters']=_[_0x18ba('0x36')](_0x3fcc3f[_0x18ba('0x31')],_0x3fcc3f[_0x18ba('0x32')]);_0x2f4ce2[_0x18ba('0x35')]=_['intersection'](_0x3fcc3f[_0x18ba('0x31')],qs[_0x18ba('0x37')](_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x37')]));_0x2f4ce2['attributes']=_0x2f4ce2[_0x18ba('0x35')][_0x18ba('0x38')]?_0x2f4ce2[_0x18ba('0x35')]:_0x3fcc3f[_0x18ba('0x31')];_0x2f4ce2['order']=qs[_0x18ba('0x3c')](_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x3c')]);_0x2f4ce2[_0x18ba('0x3d')]=qs[_0x18ba('0x34')](_['pick'](_0x1ee2b2[_0x18ba('0x32')],_0x3fcc3f['filters']));if(_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x57')]){_0x2f4ce2[_0x18ba('0x3d')]=_[_0x18ba('0x3f')](_0x2f4ce2[_0x18ba('0x3d')],{'$or':_[_0x18ba('0x2e')](_0x2f4ce2['attributes'],function(_0x19aad4){var _0x4606f8={};_0x4606f8[_0x19aad4]={'$like':'%'+_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x57')]+'%'};return _0x4606f8;})});}_0x2f4ce2=_[_0x18ba('0x3f')]({},_0x2f4ce2,_0x1ee2b2[_0x18ba('0x40')]);return _0x3912fe[_0x18ba('0x58')](_0x2f4ce2);}})[_0x18ba('0x2a')](function(_0x9b711c){if(_0x9b711c){_0x15bfa0=_0x9b711c['length'];if(!_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x39')]('nolimit')){_0x2f4ce2['limit']=qs[_0x18ba('0x1f')](_0x1ee2b2[_0x18ba('0x32')][_0x18ba('0x1f')]);_0x2f4ce2[_0x18ba('0x1d')]=qs[_0x18ba('0x1d')](_0x1ee2b2['query'][_0x18ba('0x1d')]);}return _0x3912fe[_0x18ba('0x58')](_0x2f4ce2);}})[_0x18ba('0x2a')](function(_0x3a0b65){if(_0x3a0b65){return _0x3a0b65?{'count':_0x15bfa0,'rows':_0x3a0b65}:null;}})[_0x18ba('0x2a')](respondWithResult(_0x4926a7,null))[_0x18ba('0x45')](handleError(_0x4926a7,null));};exports[_0x18ba('0x59')]=function(_0x2632b5,_0x1d3d45,_0x5b7181){return db[_0x18ba('0x41')][_0x18ba('0x56')]({'where':{'id':_0x2632b5[_0x18ba('0x47')]['id']}})[_0x18ba('0x2a')](handleEntityNotFound(_0x1d3d45,null))[_0x18ba('0x2a')](function(_0x13b5c0){if(_0x13b5c0){return db[_0x18ba('0x5a')]['transaction'](function(_0x5584b4){return db[_0x18ba('0x41')][_0x18ba('0x26')]({'where':{'IntervalId':_0x2632b5[_0x18ba('0x47')]['id']},'transaction':_0x5584b4})[_0x18ba('0x2a')](function(_0x4bfb90){var _0x492dbc=_[_0x18ba('0x2e')](_0x2632b5[_0x18ba('0x54')],function(_0x500dc5){delete _0x500dc5['id'];_0x500dc5[_0x18ba('0x5b')]=_0x2632b5[_0x18ba('0x47')]['id'];return _0x500dc5;});return db['Interval'][_0x18ba('0x5c')](_0x492dbc,{'transaction':_0x5584b4});});})[_0x18ba('0x2a')](function(){return db[_0x18ba('0x41')][_0x18ba('0x43')]({'where':{'IntervalId':_0x2632b5[_0x18ba('0x47')]['id']}});});}})[_0x18ba('0x2a')](respondWithResult(_0x1d3d45,null))[_0x18ba('0x45')](handleError(_0x1d3d45,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d2a126c..f0ba8be 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 _0xdf77=['rewrite','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals'];(function(_0x3cd128,_0x4c36f5){var _0x1c3e99=function(_0x2b009f){while(--_0x2b009f){_0x3cd128['push'](_0x3cd128['shift']());}};_0x1c3e99(++_0x4c36f5);}(_0xdf77,0x1a1));var _0x7df7=function(_0x2ac054,_0x5c0053){_0x2ac054=_0x2ac054-0x0;var _0x13703d=_0xdf77[_0x2ac054];return _0x13703d;};'use strict';var _=require(_0x7df7('0x0'));var util=require(_0x7df7('0x1'));var logger=require('../../config/logger')(_0x7df7('0x2'));var moment=require(_0x7df7('0x3'));var BPromise=require(_0x7df7('0x4'));var rp=require(_0x7df7('0x5'));var fs=require('fs');var path=require(_0x7df7('0x6'));var rimraf=require(_0x7df7('0x7'));var config=require(_0x7df7('0x8'));var attributes=require(_0x7df7('0x9'));var extensions=require(_0x7df7('0xa'));module[_0x7df7('0xb')]=function(_0x4cc6f8,_0x349f37){return _0x4cc6f8[_0x7df7('0xc')](_0x7df7('0xd'),attributes,{'tableName':_0x7df7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x973f22,_0x49ea23){extensions['rewrite'](_0x4cc6f8,_0x973f22);},'afterBulkCreate':function(_0xe6e22c,_0xcdfed4,_0x195fbe){_0x195fbe();extensions[_0x7df7('0xf')](_0x4cc6f8,_0xe6e22c[0x0]);},'afterUpdate':function(_0x34c225,_0x44d91b){extensions[_0x7df7('0xf')](_0x4cc6f8,_0x34c225);},'afterDestroy':function(_0x592f0a,_0x51ca45){extensions[_0x7df7('0xf')](_0x4cc6f8,_0x592f0a);}}});}; \ No newline at end of file +var _0xb926=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x4eee28,_0x3090d1){var _0x581969=function(_0x2e0dc5){while(--_0x2e0dc5){_0x4eee28['push'](_0x4eee28['shift']());}};_0x581969(++_0x3090d1);}(_0xb926,0x1a7));var _0x6b92=function(_0xa23d8a,_0x1eb227){_0xa23d8a=_0xa23d8a-0x0;var _0x3349e5=_0xb926[_0xa23d8a];return _0x3349e5;};'use strict';var _=require(_0x6b92('0x0'));var util=require(_0x6b92('0x1'));var logger=require(_0x6b92('0x2'))('api');var moment=require(_0x6b92('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b92('0x5'));var config=require(_0x6b92('0x6'));var attributes=require(_0x6b92('0x7'));var extensions=require(_0x6b92('0x8'));module['exports']=function(_0x3fcf0e,_0x4b7882){return _0x3fcf0e['define'](_0x6b92('0x9'),attributes,{'tableName':_0x6b92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3596bd,_0x1ddf60){extensions['rewrite'](_0x3fcf0e,_0x3596bd);},'afterBulkCreate':function(_0xb26625,_0x4edb80,_0x41d243){_0x41d243();extensions[_0x6b92('0xb')](_0x3fcf0e,_0xb26625[0x0]);},'afterUpdate':function(_0x4fadeb,_0x3ca3fd){extensions['rewrite'](_0x3fcf0e,_0x4fadeb);},'afterDestroy':function(_0x2a34ee,_0x15d9e7){extensions['rewrite'](_0x3fcf0e,_0x2a34ee);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c995a01..ee289c3 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index b687b8c..cb4d3cc 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x287091,_0x42cf2f){var _0x19aabb=function(_0x1b2090){while(--_0x1b2090){_0x287091['push'](_0x287091['shift']());}};_0x19aabb(++_0x42cf2f);}(_0xadb5,0xad));var _0x5adb=function(_0x16c76f,_0x4b7924){_0x16c76f=_0x16c76f-0x0;var _0x29c698=_0xadb5[_0x16c76f];return _0x29c698;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x32dbdc,_0x1fbc8f){var _0x4b70e4=function(_0x1fe2bd){while(--_0x1fe2bd){_0x32dbdc['push'](_0x32dbdc['shift']());}};_0x4b70e4(++_0x1fbc8f);}(_0xadb5,0xad));var _0x5adb=function(_0x3a9f8b,_0x245e82){_0x3a9f8b=_0x3a9f8b-0x0;var _0x2a6c8e=_0xadb5[_0x3a9f8b];return _0x2a6c8e;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index e4bd048..c3960d4 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 _0xea7b=['remoteAddress','socket','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','fields','email','oldToken','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','stringify','request','setEncoding','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection'];(function(_0x1a4357,_0x37e110){var _0x35ff13=function(_0x5b94fa){while(--_0x5b94fa){_0x1a4357['push'](_0x1a4357['shift']());}};_0x35ff13(++_0x37e110);}(_0xea7b,0x13d));var _0xbea7=function(_0x2c2d38,_0x43e690){_0x2c2d38=_0x2c2d38-0x0;var _0x4d558f=_0xea7b[_0x2c2d38];return _0x4d558f;};'use strict';var BPromise=require(_0xbea7('0x0'));var https=require(_0xbea7('0x1'));var logger=require('../../config/logger')(_0xbea7('0x2'));var USERNAME=_0xbea7('0x3');var PASSWORD=_0xbea7('0x4');function openIssue(_0x5d0fd9,_0x277737){var _0x2b5726={'fields':{'project':{'key':_0x5d0fd9[_0xbea7('0x5')]||_0xbea7('0x6')},'summary':(_0x5d0fd9[_0xbea7('0x7')]||_0xbea7('0x8'))+_0xbea7('0x9')+_0x5d0fd9['ip'],'description':_0x5d0fd9[_0xbea7('0xa')]||JSON['stringify'](_0x5d0fd9),'issuetype':{'name':_0x5d0fd9['issuetype']||'Bug'}}};_0x2b5726[_0xbea7('0xb')]['customfield_11500']=_0x5d0fd9[_0xbea7('0xc')];_0x2b5726[_0xbea7('0xb')]['customfield_11501']=_0x5d0fd9[_0xbea7('0xd')];_0x2b5726[_0xbea7('0xb')]['customfield_11502']=_0x5d0fd9[_0xbea7('0xe')];_0x2b5726[_0xbea7('0xb')]['customfield_11503']=_0x5d0fd9[_0xbea7('0xf')];_0x2b5726[_0xbea7('0xb')][_0xbea7('0x10')]=_0x5d0fd9[_0xbea7('0x11')];_0x2b5726[_0xbea7('0xb')][_0xbea7('0x12')]=_0x5d0fd9['ip'];var _0x423de9={'host':_0xbea7('0x13'),'port':0x1bb,'path':_0xbea7('0x14'),'method':_0xbea7('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xbea7('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xbea7('0x17')](_0xbea7('0x18'))}};var _0x3fb71f=JSON[_0xbea7('0x19')](_0x2b5726);var _0x319a33=https[_0xbea7('0x1a')](_0x423de9,function(_0x21d41c){_0x21d41c[_0xbea7('0x1b')](_0xbea7('0x1c'));var _0x5d0814='';_0x21d41c['on'](_0xbea7('0x1d'),function(_0x5da452){_0x5d0814+=_0x5da452;});_0x21d41c['on'](_0xbea7('0x1e'),function(){if(_0x277737){return _0x277737[_0xbea7('0x1f')](_0x21d41c['statusCode'])[_0xbea7('0x20')](JSON['parse'](_0x5d0814));}});});_0x319a33['on'](_0xbea7('0x21'),function(_0x2fe16a){if(_0x277737){return _0x277737[_0xbea7('0x1f')](0x1f4)[_0xbea7('0x20')]({'errors':[{'message':_0xbea7('0x22'),'type':_0xbea7('0x23')}]});}});_0x319a33[_0xbea7('0x24')](_0x3fb71f);_0x319a33['end']();}exports[_0xbea7('0x25')]=openIssue;exports[_0xbea7('0x26')]=function(_0x2cbe28,_0x468fea){_0x2cbe28[_0xbea7('0x27')]['ip']=_0x2cbe28[_0xbea7('0x28')][_0xbea7('0x29')]||_0x2cbe28[_0xbea7('0x2a')][_0xbea7('0x2b')]||_0x2cbe28[_0xbea7('0x2c')]['remoteAddress']||_0x2cbe28[_0xbea7('0x2a')]['socket'][_0xbea7('0x2b')];return openIssue(_0x2cbe28[_0xbea7('0x27')],_0x468fea);}; \ No newline at end of file +var _0x032a=['openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','application/json','toString','setEncoding','data','end','statusCode','json','parse','status','api.jira','write'];(function(_0x89c28c,_0xf187ec){var _0x2c0601=function(_0x47b479){while(--_0x47b479){_0x89c28c['push'](_0x89c28c['shift']());}};_0x2c0601(++_0xf187ec);}(_0x032a,0x80));var _0xa032=function(_0x5f002d,_0x1b9dc8){_0x5f002d=_0x5f002d-0x0;var _0x544598=_0x032a[_0x5f002d];return _0x544598;};'use strict';var BPromise=require('bluebird');var https=require(_0xa032('0x0'));var logger=require(_0xa032('0x1'))(_0xa032('0x2'));var USERNAME=_0xa032('0x3');var PASSWORD=_0xa032('0x4');function openIssue(_0x31b83a,_0x553249){var _0x1018b8={'fields':{'project':{'key':_0x31b83a[_0xa032('0x5')]||'MOTGUI'},'summary':(_0x31b83a[_0xa032('0x6')]||'Report')+_0xa032('0x7')+_0x31b83a['ip'],'description':_0x31b83a['description']||JSON[_0xa032('0x8')](_0x31b83a),'issuetype':{'name':_0x31b83a['issuetype']||_0xa032('0x9')}}};_0x1018b8[_0xa032('0xa')][_0xa032('0xb')]=_0x31b83a[_0xa032('0xc')];_0x1018b8['fields'][_0xa032('0xd')]=_0x31b83a[_0xa032('0xe')];_0x1018b8[_0xa032('0xa')][_0xa032('0xf')]=_0x31b83a[_0xa032('0x10')];_0x1018b8[_0xa032('0xa')][_0xa032('0x11')]=_0x31b83a['name'];_0x1018b8[_0xa032('0xa')]['customfield_11504']=_0x31b83a[_0xa032('0x12')];_0x1018b8['fields'][_0xa032('0x13')]=_0x31b83a['ip'];var _0x84c5da={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xa032('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xa032('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xa032('0x16')]('base64')}};var _0x5894d5=JSON[_0xa032('0x8')](_0x1018b8);var _0x239bb2=https['request'](_0x84c5da,function(_0x2964aa){_0x2964aa[_0xa032('0x17')]('utf8');var _0x4e2325='';_0x2964aa['on'](_0xa032('0x18'),function(_0x4b43c9){_0x4e2325+=_0x4b43c9;});_0x2964aa['on'](_0xa032('0x19'),function(){if(_0x553249){return _0x553249['status'](_0x2964aa[_0xa032('0x1a')])[_0xa032('0x1b')](JSON[_0xa032('0x1c')](_0x4e2325));}});});_0x239bb2['on']('error',function(_0x49f5ea){if(_0x553249){return _0x553249[_0xa032('0x1d')](0x1f4)[_0xa032('0x1b')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xa032('0x1e')}]});}});_0x239bb2[_0xa032('0x1f')](_0x5894d5);_0x239bb2['end']();}exports[_0xa032('0x20')]=openIssue;exports[_0xa032('0x21')]=function(_0x423a5d,_0x129f42){_0x423a5d[_0xa032('0x22')]['ip']=_0x423a5d[_0xa032('0x23')][_0xa032('0x24')]||_0x423a5d[_0xa032('0x25')][_0xa032('0x26')]||_0x423a5d[_0xa032('0x27')]['remoteAddress']||_0x423a5d[_0xa032('0x25')][_0xa032('0x27')][_0xa032('0x26')];return openIssue(_0x423a5d['body'],_0x129f42);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 79bb0dc..e44fcd1 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 _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x649c04,_0x5b5f52){var _0x573528=function(_0x282037){while(--_0x282037){_0x649c04['push'](_0x649c04['shift']());}};_0x573528(++_0x5b5f52);}(_0xbec5,0xe5));var _0x5bec=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0xbec5[_0xd1a252];return _0x560ee1;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file +var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x2dae,0xc3));var _0xe2da=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x2dae[_0x367a3d];return _0x460539;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 21384d6..243da36 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x1b213e,_0x5697cf){_0x1b213e=_0x1b213e-0x0;var _0x200702=_0x7a54[_0x1b213e];return _0x200702;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x47896b,_0x2e521b){_0x47896b=_0x47896b-0x0;var _0x596e6f=_0x7a54[_0x47896b];return _0x596e6f;};'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 2cc66cd..43e2e0e 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x3f9ea9,_0x19840d){var _0x291e7f=function(_0x8012b4){while(--_0x8012b4){_0x3f9ea9['push'](_0x3f9ea9['shift']());}};_0x291e7f(++_0x19840d);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x23797c,_0xf2cfe6){_0x23797c=_0x23797c-0x0;var _0x24d521=_0x6b8f[_0x23797c];return _0x24d521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));}; \ No newline at end of file +var _0x8ba0=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','JscriptyAnswerReport','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','find','catch','create','body','params','describe','eml-format'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x26a2e8,_0x2feb34){_0x26a2e8=_0x26a2e8-0x0;var _0x3dc3eb=_0x8ba0[_0x26a2e8];return _0x3dc3eb;};'use strict';var emlformat=require(_0x08ba('0x0'));var rimraf=require(_0x08ba('0x1'));var zipdir=require(_0x08ba('0x2'));var jsonpatch=require(_0x08ba('0x3'));var rp=require(_0x08ba('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x08ba('0x5'));var util=require(_0x08ba('0x6'));var path=require(_0x08ba('0x7'));var sox=require(_0x08ba('0x8'));var csv=require(_0x08ba('0x9'));var ejs=require(_0x08ba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08ba('0xb'));var squel=require(_0x08ba('0xc'));var crypto=require(_0x08ba('0xd'));var jsforce=require(_0x08ba('0xe'));var deskjs=require(_0x08ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x08ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x08ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08ba('0x12'));var as=require(_0x08ba('0x13'));var hardwareService=require(_0x08ba('0x14'));var logger=require(_0x08ba('0x15'))(_0x08ba('0x16'));var utils=require(_0x08ba('0x17'));var config=require(_0x08ba('0x18'));var licenseUtil=require(_0x08ba('0x19'));var db=require(_0x08ba('0x1a'))['db'];function respondWithStatusCode(_0x33d2b6,_0x1b0f0a){_0x1b0f0a=_0x1b0f0a||0xcc;return function(_0x1f9f6e){if(_0x1f9f6e){return _0x33d2b6['sendStatus'](_0x1b0f0a);}return _0x33d2b6[_0x08ba('0x1b')](_0x1b0f0a)[_0x08ba('0x1c')]();};}function respondWithResult(_0x2a9b54,_0x210419){_0x210419=_0x210419||0xc8;return function(_0x2c047c){if(_0x2c047c){return _0x2a9b54[_0x08ba('0x1b')](_0x210419)['json'](_0x2c047c);}};}function respondWithFilteredResult(_0x325b2f,_0x2886a7){return function(_0x337fe9){if(_0x337fe9){var _0x2887c8=typeof _0x2886a7[_0x08ba('0x1d')]==='undefined'&&typeof _0x2886a7[_0x08ba('0x1e')]===_0x08ba('0x1f');var _0x507c5a=_0x337fe9[_0x08ba('0x20')];var _0x57e1d5=_0x2887c8?0x0:_0x2886a7['offset'];var _0x24623c=_0x2887c8?_0x337fe9[_0x08ba('0x20')]:_0x2886a7[_0x08ba('0x1d')]+_0x2886a7[_0x08ba('0x1e')];var _0x6a9cc6;if(_0x24623c>=_0x507c5a){_0x24623c=_0x507c5a;_0x6a9cc6=0xc8;}else{_0x6a9cc6=0xce;}_0x325b2f[_0x08ba('0x1b')](_0x6a9cc6);return _0x325b2f[_0x08ba('0x21')]('Content-Range',_0x57e1d5+'-'+_0x24623c+'/'+_0x507c5a)['json'](_0x337fe9);}return null;};}function patchUpdates(_0x4081c5){return function(_0x53cf3a){try{jsonpatch[_0x08ba('0x22')](_0x53cf3a,_0x4081c5,!![]);}catch(_0x39fb5e){return BPromise['reject'](_0x39fb5e);}return _0x53cf3a[_0x08ba('0x23')]();};}function saveUpdates(_0x108024,_0x303d3a){return function(_0x15700e){if(_0x15700e){return _0x15700e[_0x08ba('0x24')](_0x108024)[_0x08ba('0x25')](function(_0x5695c0){return _0x5695c0;});}return null;};}function removeEntity(_0x3e6160,_0x3741bf){return function(_0x951b35){if(_0x951b35){return _0x951b35[_0x08ba('0x26')]()[_0x08ba('0x25')](function(){_0x3e6160['status'](0xcc)[_0x08ba('0x1c')]();});}};}function handleEntityNotFound(_0x17c24c,_0x19c501){return function(_0x23225d){if(!_0x23225d){_0x17c24c[_0x08ba('0x27')](0x194);}return _0x23225d;};}function handleError(_0x33fba6,_0xb6b373){_0xb6b373=_0xb6b373||0x1f4;return function(_0x529c32){logger[_0x08ba('0x28')](_0x529c32[_0x08ba('0x29')]);if(_0x529c32[_0x08ba('0x2a')]){delete _0x529c32['name'];}_0x33fba6['status'](_0xb6b373)['send'](_0x529c32);};}exports[_0x08ba('0x2b')]=function(_0x1f8e64,_0xb67f0d){var _0x939b76={},_0x419ff7={},_0x56194a={'count':0x0,'rows':[]};var _0x3483fe=_['map'](db[_0x08ba('0x2c')][_0x08ba('0x2d')],function(_0x519f54){return{'name':_0x519f54['fieldName'],'type':_0x519f54['type'][_0x08ba('0x2e')]};});_0x419ff7[_0x08ba('0x2f')]=_[_0x08ba('0x30')](_0x3483fe,_0x08ba('0x2a'));_0x419ff7['query']=_[_0x08ba('0x31')](_0x1f8e64[_0x08ba('0x32')]);_0x419ff7[_0x08ba('0x33')]=_[_0x08ba('0x34')](_0x419ff7['model'],_0x419ff7[_0x08ba('0x32')]);_0x939b76[_0x08ba('0x35')]=_[_0x08ba('0x34')](_0x419ff7[_0x08ba('0x2f')],qs[_0x08ba('0x36')](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x36')]));_0x939b76[_0x08ba('0x35')]=_0x939b76['attributes'][_0x08ba('0x37')]?_0x939b76[_0x08ba('0x35')]:_0x419ff7[_0x08ba('0x2f')];if(!_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x38')]('nolimit')){_0x939b76[_0x08ba('0x1e')]=qs[_0x08ba('0x1e')](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x1e')]);_0x939b76[_0x08ba('0x1d')]=qs['offset'](_0x1f8e64[_0x08ba('0x32')]['offset']);}_0x939b76[_0x08ba('0x39')]=qs['sort'](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3a')]);_0x939b76[_0x08ba('0x3b')]=qs[_0x08ba('0x33')](_[_0x08ba('0x3c')](_0x1f8e64[_0x08ba('0x32')],_0x419ff7[_0x08ba('0x33')]),_0x3483fe);if(_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3d')]){_0x939b76[_0x08ba('0x3b')]=_[_0x08ba('0x3e')](_0x939b76[_0x08ba('0x3b')],{'$or':_[_0x08ba('0x30')](_0x3483fe,function(_0x268d30){if(_0x268d30['type']!==_0x08ba('0x3f')){var _0x222690={};_0x222690[_0x268d30[_0x08ba('0x2a')]]={'$like':'%'+_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3d')]+'%'};return _0x222690;}})});}_0x939b76=_[_0x08ba('0x3e')]({},_0x939b76,_0x1f8e64['options']);var _0x4de276={'where':_0x939b76[_0x08ba('0x3b')]};return db['JscriptyAnswerReport'][_0x08ba('0x20')](_0x4de276)[_0x08ba('0x25')](function(_0x3b8a54){_0x56194a['count']=_0x3b8a54;if(_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x40')]){_0x939b76['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x08ba('0x41')](_0x939b76);})[_0x08ba('0x25')](function(_0x546bfe){_0x56194a[_0x08ba('0x42')]=_0x546bfe;return _0x56194a;})[_0x08ba('0x25')](respondWithFilteredResult(_0xb67f0d,_0x939b76))['catch'](handleError(_0xb67f0d,null));};exports[_0x08ba('0x43')]=function(_0x280707,_0x403d74){var _0x474730={'raw':!![],'where':{'id':_0x280707['params']['id']}},_0x519375={};_0x519375[_0x08ba('0x2f')]=_['keys'](db[_0x08ba('0x2c')]['rawAttributes']);_0x519375['query']=_[_0x08ba('0x31')](_0x280707['query']);_0x519375[_0x08ba('0x33')]=_[_0x08ba('0x34')](_0x519375[_0x08ba('0x2f')],_0x519375[_0x08ba('0x32')]);_0x474730[_0x08ba('0x35')]=_['intersection'](_0x519375['model'],qs[_0x08ba('0x36')](_0x280707[_0x08ba('0x32')][_0x08ba('0x36')]));_0x474730['attributes']=_0x474730[_0x08ba('0x35')][_0x08ba('0x37')]?_0x474730['attributes']:_0x519375[_0x08ba('0x2f')];if(_0x280707[_0x08ba('0x32')][_0x08ba('0x40')]){_0x474730[_0x08ba('0x44')]=[{'all':!![]}];}_0x474730=_[_0x08ba('0x3e')]({},_0x474730,_0x280707[_0x08ba('0x45')]);return db['JscriptyAnswerReport'][_0x08ba('0x46')](_0x474730)[_0x08ba('0x25')](handleEntityNotFound(_0x403d74,null))['then'](respondWithResult(_0x403d74,null))[_0x08ba('0x47')](handleError(_0x403d74,null));};exports[_0x08ba('0x48')]=function(_0x178271,_0x42e474){return db[_0x08ba('0x2c')]['create'](_0x178271[_0x08ba('0x49')],{})[_0x08ba('0x25')](respondWithResult(_0x42e474,0xc9))[_0x08ba('0x47')](handleError(_0x42e474,null));};exports[_0x08ba('0x24')]=function(_0x39f960,_0x1cb435){if(_0x39f960[_0x08ba('0x49')]['id']){delete _0x39f960['body']['id'];}return db[_0x08ba('0x2c')][_0x08ba('0x46')]({'where':{'id':_0x39f960[_0x08ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1cb435,null))[_0x08ba('0x25')](saveUpdates(_0x39f960[_0x08ba('0x49')],null))[_0x08ba('0x25')](respondWithResult(_0x1cb435,null))['catch'](handleError(_0x1cb435,null));};exports[_0x08ba('0x26')]=function(_0x20b1b0,_0x1679a1){return db[_0x08ba('0x2c')][_0x08ba('0x46')]({'where':{'id':_0x20b1b0[_0x08ba('0x4a')]['id']}})[_0x08ba('0x25')](handleEntityNotFound(_0x1679a1,null))[_0x08ba('0x25')](removeEntity(_0x1679a1,null))[_0x08ba('0x47')](handleError(_0x1679a1,null));};exports[_0x08ba('0x4b')]=function(_0x34dc9e,_0x3d06b3){return db[_0x08ba('0x2c')][_0x08ba('0x4b')]()[_0x08ba('0x25')](respondWithResult(_0x3d06b3,null))[_0x08ba('0x47')](handleError(_0x3d06b3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 5af49e7..328d3a9 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 _0x16f1=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x9f0919,_0x167941){var _0x27c8c5=function(_0x365055){while(--_0x365055){_0x9f0919['push'](_0x9f0919['shift']());}};_0x27c8c5(++_0x167941);}(_0x16f1,0x163));var _0x116f=function(_0x16b599,_0x406327){_0x16b599=_0x16b599-0x0;var _0x5a92b7=_0x16f1[_0x16b599];return _0x5a92b7;};'use strict';var _=require(_0x116f('0x0'));var util=require(_0x116f('0x1'));var logger=require(_0x116f('0x2'))(_0x116f('0x3'));var moment=require(_0x116f('0x4'));var BPromise=require(_0x116f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x116f('0x6'));var config=require(_0x116f('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0xae92d7,_0x54674b){return _0xae92d7[_0x116f('0x8')](_0x116f('0x9'),attributes,{'tableName':_0x116f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94d5=['report_jscripty_answers','util','../../config/logger','bluebird','path','rimraf','exports'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x94d5,0x135));var _0x594d=function(_0x454861,_0x25a3a0){_0x454861=_0x454861-0x0;var _0x1064dc=_0x94d5[_0x454861];return _0x1064dc;};'use strict';var _=require('lodash');var util=require(_0x594d('0x0'));var logger=require(_0x594d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x594d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x594d('0x3'));var rimraf=require(_0x594d('0x4'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x594d('0x5')]=function(_0x554d72,_0x4a8c15){return _0x554d72['define']('JscriptyAnswerReport',attributes,{'tableName':_0x594d('0x6'),'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 b5f435a..61e2db1 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 _0x4061=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f75b6,_0x4c5a3a){var _0x3092d1=function(_0x3bb379){while(--_0x3bb379){_0x1f75b6['push'](_0x1f75b6['shift']());}};_0x3092d1(++_0x4c5a3a);}(_0x4061,0x88));var _0x1406=function(_0x5dffad,_0x4db2e2){_0x5dffad=_0x5dffad-0x0;var _0x393a9c=_0x4061[_0x5dffad];return _0x393a9c;};'use strict';var _=require(_0x1406('0x0'));var util=require(_0x1406('0x1'));var moment=require(_0x1406('0x2'));var BPromise=require(_0x1406('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1406('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1406('0x5'))(_0x1406('0x6'));var config=require(_0x1406('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1406('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41b126,_0x2dfa88,_0x5e42f6){return new BPromise(function(_0x357ff7,_0x5230af){return client[_0x1406('0x9')](_0x41b126,_0x5e42f6)[_0x1406('0xa')](function(_0x380063){logger[_0x1406('0xb')](_0x1406('0xc'),_0x2dfa88,_0x1406('0xd'));logger[_0x1406('0xe')](_0x1406('0xf'),_0x2dfa88,_0x1406('0xd'),JSON[_0x1406('0x10')](_0x380063));if(_0x380063['error']){if(_0x380063[_0x1406('0x11')][_0x1406('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2dfa88,_0x380063[_0x1406('0x11')]['message']);return _0x5230af(_0x380063[_0x1406('0x11')][_0x1406('0x13')]);}logger[_0x1406('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2dfa88,_0x380063[_0x1406('0x11')][_0x1406('0x13')]);return _0x357ff7(_0x380063[_0x1406('0x11')]['message']);}else{logger[_0x1406('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2dfa88,_0x1406('0xd'));_0x357ff7(_0x380063[_0x1406('0x14')][_0x1406('0x13')]);}})[_0x1406('0x15')](function(_0x598dc2){logger[_0x1406('0x11')](_0x1406('0xc'),_0x2dfa88,_0x598dc2);_0x5230af(_0x598dc2);});});} \ No newline at end of file +var _0x5c3b=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x7ea0eb,_0x81b036){var _0x3cc880=function(_0x870df6){while(--_0x870df6){_0x7ea0eb['push'](_0x7ea0eb['shift']());}};_0x3cc880(++_0x81b036);}(_0x5c3b,0xb3));var _0xb5c3=function(_0x111165,_0x4f9303){_0x111165=_0x111165-0x0;var _0x64f7b6=_0x5c3b[_0x111165];return _0x64f7b6;};'use strict';var _=require(_0xb5c3('0x0'));var util=require(_0xb5c3('0x1'));var moment=require(_0xb5c3('0x2'));var BPromise=require(_0xb5c3('0x3'));var rs=require(_0xb5c3('0x4'));var fs=require('fs');var Redis=require(_0xb5c3('0x5'));var db=require(_0xb5c3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5c3('0x7'))(_0xb5c3('0x8'));var config=require(_0xb5c3('0x9'));var jayson=require(_0xb5c3('0xa'));var client=jayson[_0xb5c3('0xb')][_0xb5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182850,_0x5b47a0,_0x21bba1){return new BPromise(function(_0x2e9f1d,_0x3f0ffe){return client[_0xb5c3('0xd')](_0x182850,_0x21bba1)[_0xb5c3('0xe')](function(_0x3e59cf){logger[_0xb5c3('0xf')](_0xb5c3('0x10'),_0x5b47a0,'request\x20sent');logger[_0xb5c3('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5b47a0,'request\x20sent',JSON[_0xb5c3('0x12')](_0x3e59cf));if(_0x3e59cf[_0xb5c3('0x13')]){if(_0x3e59cf[_0xb5c3('0x13')]['code']===0x1f4){logger[_0xb5c3('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5b47a0,_0x3e59cf[_0xb5c3('0x13')][_0xb5c3('0x14')]);return _0x3f0ffe(_0x3e59cf[_0xb5c3('0x13')][_0xb5c3('0x14')]);}logger['error'](_0xb5c3('0x10'),_0x5b47a0,_0x3e59cf[_0xb5c3('0x13')][_0xb5c3('0x14')]);return _0x2e9f1d(_0x3e59cf['error'][_0xb5c3('0x14')]);}else{logger[_0xb5c3('0xf')](_0xb5c3('0x10'),_0x5b47a0,_0xb5c3('0x15'));_0x2e9f1d(_0x3e59cf[_0xb5c3('0x16')][_0xb5c3('0x14')]);}})[_0xb5c3('0x17')](function(_0x26411e){logger[_0xb5c3('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5b47a0,_0x26411e);_0x3f0ffe(_0x26411e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 0631267..298a739 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 _0x19c3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','show','isAuthenticated','getSessions','getAnswers','30s','getSummary','create','post','/:id/clone','clone','put','update','delete','exports','path','connect-timeout','express'];(function(_0x4e9345,_0x2aa5b4){var _0x3e3e48=function(_0x303505){while(--_0x303505){_0x4e9345['push'](_0x4e9345['shift']());}};_0x3e3e48(++_0x2aa5b4);}(_0x19c3,0x7f));var _0x319c=function(_0x4003c1,_0x4cb7b2){_0x4003c1=_0x4003c1-0x0;var _0xc8d345=_0x19c3[_0x4003c1];return _0xc8d345;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x319c('0x0'));var timeout=require(_0x319c('0x1'));var express=require(_0x319c('0x2'));var router=express[_0x319c('0x3')]();var fs_extra=require(_0x319c('0x4'));var auth=require(_0x319c('0x5'));var interaction=require(_0x319c('0x6'));var config=require(_0x319c('0x7'));var controller=require(_0x319c('0x8'));router[_0x319c('0x9')]('/',auth['isAuthenticated'](),controller[_0x319c('0xa')]);router['get'](_0x319c('0xb'),auth['isAuthenticated'](),controller[_0x319c('0xc')]);router[_0x319c('0x9')]('/:id/sessions',auth[_0x319c('0xd')](),controller[_0x319c('0xe')]);router[_0x319c('0x9')]('/:id/answers',auth[_0x319c('0xd')](),controller[_0x319c('0xf')]);router['get']('/:id/summary',auth[_0x319c('0xd')](),timeout(_0x319c('0x10')),controller[_0x319c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x319c('0x12')]);router[_0x319c('0x13')](_0x319c('0x14'),auth[_0x319c('0xd')](),controller[_0x319c('0x15')]);router[_0x319c('0x16')](_0x319c('0xb'),auth['isAuthenticated'](),controller[_0x319c('0x17')]);router[_0x319c('0x18')]('/:id',auth[_0x319c('0xd')](),controller['destroy']);module[_0x319c('0x19')]=router; \ No newline at end of file +var _0x6bb1=['/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put'];(function(_0x3cb01a,_0x17e24b){var _0x491af2=function(_0x4cc0dc){while(--_0x4cc0dc){_0x3cb01a['push'](_0x3cb01a['shift']());}};_0x491af2(++_0x17e24b);}(_0x6bb1,0x1df));var _0x16bb=function(_0x3e74f4,_0x3e9c91){_0x3e74f4=_0x3e74f4-0x0;var _0x489758=_0x6bb1[_0x3e74f4];return _0x489758;};'use strict';var multer=require(_0x16bb('0x0'));var util=require(_0x16bb('0x1'));var path=require('path');var timeout=require(_0x16bb('0x2'));var express=require(_0x16bb('0x3'));var router=express[_0x16bb('0x4')]();var fs_extra=require(_0x16bb('0x5'));var auth=require(_0x16bb('0x6'));var interaction=require(_0x16bb('0x7'));var config=require(_0x16bb('0x8'));var controller=require('./jscriptyProject.controller');router[_0x16bb('0x9')]('/',auth['isAuthenticated'](),controller[_0x16bb('0xa')]);router[_0x16bb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x16bb('0xb')]);router[_0x16bb('0x9')](_0x16bb('0xc'),auth[_0x16bb('0xd')](),controller[_0x16bb('0xe')]);router[_0x16bb('0x9')](_0x16bb('0xf'),auth[_0x16bb('0xd')](),controller[_0x16bb('0x10')]);router['get'](_0x16bb('0x11'),auth[_0x16bb('0xd')](),timeout(_0x16bb('0x12')),controller[_0x16bb('0x13')]);router[_0x16bb('0x14')]('/',auth[_0x16bb('0xd')](),controller[_0x16bb('0x15')]);router['post'](_0x16bb('0x16'),auth[_0x16bb('0xd')](),controller[_0x16bb('0x17')]);router[_0x16bb('0x18')](_0x16bb('0x19'),auth[_0x16bb('0xd')](),controller[_0x16bb('0x1a')]);router[_0x16bb('0x1b')](_0x16bb('0x19'),auth[_0x16bb('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8359821..1d50490 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 _0x9f5b=['name','TEXT','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','util','exports'];(function(_0x2795ff,_0x48d3ea){var _0x9d96be=function(_0x14c181){while(--_0x14c181){_0x2795ff['push'](_0x2795ff['shift']());}};_0x9d96be(++_0x48d3ea);}(_0x9f5b,0xbd));var _0xb9f5=function(_0x4e9e24,_0x34b638){_0x4e9e24=_0x4e9e24-0x0;var _0x3ef905=_0x9f5b[_0x4e9e24];return _0x3ef905;};'use strict';var Sequelize=require(_0xb9f5('0x0'));var _=require('lodash');var util=require(_0xb9f5('0x1'));module[_0xb9f5('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xb9f5('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb9f5('0x4')]('long'),'set':function(_0x4a3e09){if(_[_0xb9f5('0x5')](_0x4a3e09)){this[_0xb9f5('0x6')](_0xb9f5('0x7'),JSON[_0xb9f5('0x8')](_0x4a3e09));}else if(_[_0xb9f5('0x9')](_0x4a3e09)){this[_0xb9f5('0x6')]('formData',_0x4a3e09);}else{this[_0xb9f5('0x6')](_0xb9f5('0x7'),util['format'](_0xb9f5('0xa'),this[_0xb9f5('0xb')](_0xb9f5('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xac23=['util','STRING','name','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac23,0xfb));var _0x3ac2=function(_0x4c65fd,_0x2ba5cc){_0x4c65fd=_0x4c65fd-0x0;var _0x315e4b=_0xac23[_0x4c65fd];return _0x315e4b;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3ac2('0x0'));var util=require(_0x3ac2('0x1'));module['exports']={'name':{'type':Sequelize[_0x3ac2('0x2')],'unique':_0x3ac2('0x3')},'description':{'type':Sequelize[_0x3ac2('0x2')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x3cff74){if(_[_0x3ac2('0x4')](_0x3cff74)){this[_0x3ac2('0x5')](_0x3ac2('0x6'),JSON[_0x3ac2('0x7')](_0x3cff74));}else if(_[_0x3ac2('0x8')](_0x3cff74)){this[_0x3ac2('0x5')]('formData',_0x3cff74);}else{this['setDataValue']('formData',util[_0x3ac2('0x9')](_0x3ac2('0xa'),this[_0x3ac2('0xb')](_0x3ac2('0x3'))||'',this[_0x3ac2('0xb')](_0x3ac2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3ac2('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3ac2('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 055f9a3..2f0d7d9 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 _0x85ed=['api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','fieldName','type','key','query','keys','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x432b5e,_0x4a7c91){var _0xbbe93b=function(_0xd25444){while(--_0xd25444){_0x432b5e['push'](_0x432b5e['shift']());}};_0xbbe93b(++_0x4a7c91);}(_0x85ed,0x66));var _0xd85e=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x85ed[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0xd85e('0x0'));var rimraf=require(_0xd85e('0x1'));var zipdir=require(_0xd85e('0x2'));var jsonpatch=require(_0xd85e('0x3'));var rp=require(_0xd85e('0x4'));var moment=require(_0xd85e('0x5'));var BPromise=require(_0xd85e('0x6'));var Mustache=require('mustache');var util=require(_0xd85e('0x7'));var path=require(_0xd85e('0x8'));var sox=require(_0xd85e('0x9'));var csv=require(_0xd85e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd85e('0xb'));var _=require(_0xd85e('0xc'));var squel=require('squel');var crypto=require(_0xd85e('0xd'));var jsforce=require(_0xd85e('0xe'));var deskjs=require(_0xd85e('0xf'));var toCsv=require(_0xd85e('0xa'));var querystring=require('querystring');var Papa=require(_0xd85e('0x10'));var Redis=require(_0xd85e('0x11'));var authService=require(_0xd85e('0x12'));var qs=require(_0xd85e('0x13'));var as=require(_0xd85e('0x14'));var hardwareService=require(_0xd85e('0x15'));var logger=require('../../config/logger')(_0xd85e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd85e('0x17'));var db=require(_0xd85e('0x18'))['db'];function respondWithStatusCode(_0x5e9b20,_0x374652){_0x374652=_0x374652||0xcc;return function(_0x7d5918){if(_0x7d5918){return _0x5e9b20[_0xd85e('0x19')](_0x374652);}return _0x5e9b20['status'](_0x374652)[_0xd85e('0x1a')]();};}function respondWithResult(_0x33addd,_0xe0c8df){_0xe0c8df=_0xe0c8df||0xc8;return function(_0x32a52c){if(_0x32a52c){return _0x33addd[_0xd85e('0x1b')](_0xe0c8df)['json'](_0x32a52c);}};}function respondWithFilteredResult(_0x356b3f,_0x5ba31d){return function(_0x3aa5f6){if(_0x3aa5f6){var _0x3123a3=typeof _0x5ba31d[_0xd85e('0x1c')]==='undefined'&&typeof _0x5ba31d[_0xd85e('0x1d')]===_0xd85e('0x1e');var _0x56b412=_0x3aa5f6[_0xd85e('0x1f')];var _0x673820=_0x3123a3?0x0:_0x5ba31d[_0xd85e('0x1c')];var _0x4c432d=_0x3123a3?_0x3aa5f6[_0xd85e('0x1f')]:_0x5ba31d[_0xd85e('0x1c')]+_0x5ba31d[_0xd85e('0x1d')];var _0x1dfff9;if(_0x4c432d>=_0x56b412){_0x4c432d=_0x56b412;_0x1dfff9=0xc8;}else{_0x1dfff9=0xce;}_0x356b3f[_0xd85e('0x1b')](_0x1dfff9);return _0x356b3f[_0xd85e('0x20')](_0xd85e('0x21'),_0x673820+'-'+_0x4c432d+'/'+_0x56b412)[_0xd85e('0x22')](_0x3aa5f6);}return null;};}function patchUpdates(_0x2e0c94){return function(_0x3834ad){try{jsonpatch['apply'](_0x3834ad,_0x2e0c94,!![]);}catch(_0x255785){return BPromise[_0xd85e('0x23')](_0x255785);}return _0x3834ad[_0xd85e('0x24')]();};}function saveUpdates(_0x2ef958,_0xe9991){return function(_0x595199){if(_0x595199){return _0x595199[_0xd85e('0x25')](_0x2ef958)[_0xd85e('0x26')](function(_0x194173){return _0x194173;});}return null;};}function removeEntity(_0x4f620e,_0x45c727){return function(_0x44168e){if(_0x44168e){return _0x44168e[_0xd85e('0x27')]()[_0xd85e('0x26')](function(){var _0x26e64a=_0x44168e[_0xd85e('0x28')]({'plain':!![]});var _0x5604ae=_0xd85e('0x29');return db[_0xd85e('0x2a')][_0xd85e('0x27')]({'where':{'type':_0x5604ae,'resourceId':_0x26e64a['id']}})[_0xd85e('0x26')](function(){return _0x44168e;});})[_0xd85e('0x26')](function(){_0x4f620e[_0xd85e('0x1b')](0xcc)[_0xd85e('0x1a')]();});}};}function handleEntityNotFound(_0x1d659e,_0x540149){return function(_0x5e0914){if(!_0x5e0914){_0x1d659e[_0xd85e('0x19')](0x194);}return _0x5e0914;};}function handleError(_0x2fab0f,_0x3000cf){_0x3000cf=_0x3000cf||0x1f4;return function(_0x5dc7ac){logger['error'](_0x5dc7ac[_0xd85e('0x2b')]);if(_0x5dc7ac['name']){delete _0x5dc7ac[_0xd85e('0x2c')];}_0x2fab0f[_0xd85e('0x1b')](_0x3000cf)[_0xd85e('0x2d')](_0x5dc7ac);};}exports[_0xd85e('0x2e')]=function(_0x49cd47,_0x5ec4e9){var _0x5c5d9e={},_0x5c9879={},_0x5d4154={'count':0x0,'rows':[]};var _0x385823=_[_0xd85e('0x2f')](db[_0xd85e('0x30')]['rawAttributes'],function(_0x6a901d){return{'name':_0x6a901d[_0xd85e('0x31')],'type':_0x6a901d[_0xd85e('0x32')][_0xd85e('0x33')]};});_0x5c9879['model']=_[_0xd85e('0x2f')](_0x385823,_0xd85e('0x2c'));_0x5c9879[_0xd85e('0x34')]=_[_0xd85e('0x35')](_0x49cd47[_0xd85e('0x34')]);_0x5c9879['filters']=_[_0xd85e('0x36')](_0x5c9879['model'],_0x5c9879['query']);_0x5c5d9e[_0xd85e('0x37')]=_[_0xd85e('0x36')](_0x5c9879[_0xd85e('0x38')],qs['fields'](_0x49cd47['query'][_0xd85e('0x39')]));_0x5c5d9e['attributes']=_0x5c5d9e[_0xd85e('0x37')]['length']?_0x5c5d9e['attributes']:_0x5c9879[_0xd85e('0x38')];if(!_0x49cd47[_0xd85e('0x34')]['hasOwnProperty'](_0xd85e('0x3a'))){_0x5c5d9e[_0xd85e('0x1d')]=qs[_0xd85e('0x1d')](_0x49cd47[_0xd85e('0x34')][_0xd85e('0x1d')]);_0x5c5d9e[_0xd85e('0x1c')]=qs[_0xd85e('0x1c')](_0x49cd47[_0xd85e('0x34')][_0xd85e('0x1c')]);}_0x5c5d9e[_0xd85e('0x3b')]=qs[_0xd85e('0x3c')](_0x49cd47[_0xd85e('0x34')][_0xd85e('0x3c')]);_0x5c5d9e[_0xd85e('0x3d')]=qs['filters'](_[_0xd85e('0x3e')](_0x49cd47[_0xd85e('0x34')],_0x5c9879[_0xd85e('0x3f')]),_0x385823);if(_0x49cd47[_0xd85e('0x34')][_0xd85e('0x40')]){_0x5c5d9e[_0xd85e('0x3d')]=_[_0xd85e('0x41')](_0x5c5d9e[_0xd85e('0x3d')],{'$or':_[_0xd85e('0x2f')](_0x385823,function(_0x34349f){if(_0x34349f[_0xd85e('0x32')]!==_0xd85e('0x42')){var _0x2b3848={};_0x2b3848[_0x34349f[_0xd85e('0x2c')]]={'$like':'%'+_0x49cd47['query'][_0xd85e('0x40')]+'%'};return _0x2b3848;}})});}_0x5c5d9e=_[_0xd85e('0x41')]({},_0x5c5d9e,_0x49cd47[_0xd85e('0x43')]);var _0x5363ae={'where':_0x5c5d9e['where']};return db[_0xd85e('0x30')][_0xd85e('0x1f')](_0x5363ae)[_0xd85e('0x26')](function(_0x562cbd){_0x5d4154[_0xd85e('0x1f')]=_0x562cbd;if(_0x49cd47[_0xd85e('0x34')][_0xd85e('0x44')]){_0x5c5d9e[_0xd85e('0x45')]=[{'all':!![]}];}return db[_0xd85e('0x30')][_0xd85e('0x46')](_0x5c5d9e);})[_0xd85e('0x26')](function(_0x304fb2){_0x5d4154[_0xd85e('0x47')]=_0x304fb2;return _0x5d4154;})[_0xd85e('0x26')](respondWithFilteredResult(_0x5ec4e9,_0x5c5d9e))['catch'](handleError(_0x5ec4e9,null));};exports[_0xd85e('0x48')]=function(_0x564355,_0x141db){var _0x22e004={'raw':![],'where':{'id':_0x564355[_0xd85e('0x49')]['id']}},_0x15b997={};_0x15b997[_0xd85e('0x38')]=_[_0xd85e('0x35')](db[_0xd85e('0x30')][_0xd85e('0x4a')]);_0x15b997[_0xd85e('0x34')]=_[_0xd85e('0x35')](_0x564355[_0xd85e('0x34')]);_0x15b997['filters']=_['intersection'](_0x15b997[_0xd85e('0x38')],_0x15b997[_0xd85e('0x34')]);_0x22e004[_0xd85e('0x37')]=_[_0xd85e('0x36')](_0x15b997[_0xd85e('0x38')],qs['fields'](_0x564355['query'][_0xd85e('0x39')]));_0x22e004[_0xd85e('0x37')]=_0x22e004[_0xd85e('0x37')][_0xd85e('0x4b')]?_0x22e004[_0xd85e('0x37')]:_0x15b997[_0xd85e('0x38')];if(_0x564355[_0xd85e('0x34')]['includeAll']){_0x22e004[_0xd85e('0x45')]=[{'all':!![]}];}_0x22e004=_[_0xd85e('0x41')]({},_0x22e004,_0x564355[_0xd85e('0x43')]);return db[_0xd85e('0x30')][_0xd85e('0x4c')](_0x22e004)[_0xd85e('0x26')](handleEntityNotFound(_0x141db,null))[_0xd85e('0x26')](respondWithResult(_0x141db,null))[_0xd85e('0x4d')](handleError(_0x141db,null));};exports[_0xd85e('0x4e')]=function(_0x29773a,_0x11945f){return db[_0xd85e('0x30')][_0xd85e('0x4e')](_0x29773a[_0xd85e('0x4f')],{})[_0xd85e('0x26')](function(_0x402c4f){var _0x530b97=_0x29773a[_0xd85e('0x50')][_0xd85e('0x28')]({'plain':!![]});if(!_0x530b97)throw new Error(_0xd85e('0x51'));if(_0x530b97[_0xd85e('0x52')]==='user'){var _0x464bbd=_0x402c4f[_0xd85e('0x28')]({'plain':!![]});var _0x2a5bbb='Projects';return db[_0xd85e('0x53')][_0xd85e('0x4c')]({'where':{'name':_0x2a5bbb,'userProfileId':_0x530b97[_0xd85e('0x54')]},'raw':!![]})['then'](function(_0x6de8ae){if(_0x6de8ae&&_0x6de8ae[_0xd85e('0x55')]===0x0){return db['UserProfileResource'][_0xd85e('0x4e')]({'name':_0x464bbd[_0xd85e('0x2c')],'resourceId':_0x464bbd['id'],'type':_0x6de8ae['name'],'sectionId':_0x6de8ae['id']},{})[_0xd85e('0x26')](function(){return _0x402c4f;});}else{return _0x402c4f;}})[_0xd85e('0x4d')](function(_0x23b83a){logger[_0xd85e('0x56')](_0xd85e('0x57'),_0x23b83a);throw _0x23b83a;});}return _0x402c4f;})[_0xd85e('0x26')](respondWithResult(_0x11945f,0xc9))[_0xd85e('0x4d')](handleError(_0x11945f,null));};exports['clone']=function(_0x17049c,_0x132cd6){var _0x70f6bf={'where':{'id':_0x17049c[_0xd85e('0x49')]['id']}},_0x25c241={};_0x25c241['model']=_[_0xd85e('0x35')](db['JscriptyProject'][_0xd85e('0x4a')]);_0x70f6bf['attributes']=_['intersection'](_0x25c241[_0xd85e('0x38')],qs[_0xd85e('0x39')](_0x17049c[_0xd85e('0x34')]['fields']));_0x70f6bf[_0xd85e('0x37')]=_0x70f6bf['attributes'][_0xd85e('0x4b')]?_0x70f6bf['attributes']:_0x25c241['model'];if(_0x17049c[_0xd85e('0x34')][_0xd85e('0x44')]){_0x70f6bf[_0xd85e('0x45')]=[{'all':!![]}];}_0x70f6bf=_[_0xd85e('0x41')]({},_0x70f6bf,_0x17049c[_0xd85e('0x43')]);return db[_0xd85e('0x30')][_0xd85e('0x4c')](_0x70f6bf)[_0xd85e('0x26')](handleEntityNotFound(_0x132cd6,null))[_0xd85e('0x26')](function(_0x4be7d6){if(_0x4be7d6){var _0x4985b6=_0x4be7d6[_0xd85e('0x28')]({'plain':!![]});_0x4985b6=qs[_0xd85e('0x58')](_0x4985b6,['id',_0xd85e('0x59'),'updatedAt']);_0x17049c[_0xd85e('0x4f')]=_[_0xd85e('0x58')](_0x17049c[_0xd85e('0x4f')],['id',_0xd85e('0x59'),'updatedAt']);return db[_0xd85e('0x30')][_0xd85e('0x4e')](_[_0xd85e('0x41')](_0x4985b6,_0x17049c['body']),{'include':_0x17049c['query'][_0xd85e('0x44')]?[{'all':!![]}]:undefined})[_0xd85e('0x26')](function(_0x1dca75){var _0x5b9ff6=_0x17049c[_0xd85e('0x50')][_0xd85e('0x28')]({'plain':!![]});if(!_0x5b9ff6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b9ff6[_0xd85e('0x52')]===_0xd85e('0x50')){var _0x180e0a=_0x1dca75[_0xd85e('0x28')]({'plain':!![]});var _0x1e421a=_0xd85e('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x1e421a,'userProfileId':_0x5b9ff6[_0xd85e('0x54')]},'raw':!![]})['then'](function(_0x28988d){if(_0x28988d&&_0x28988d[_0xd85e('0x55')]===0x0){return db[_0xd85e('0x2a')][_0xd85e('0x4e')]({'name':_0x180e0a[_0xd85e('0x2c')],'resourceId':_0x180e0a['id'],'type':_0x28988d['name'],'sectionId':_0x28988d['id']},{})[_0xd85e('0x26')](function(){return _0x1dca75;});}else{return _0x1dca75;}})['catch'](function(_0x3b8a30){logger[_0xd85e('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b8a30);throw _0x3b8a30;});}return _0x1dca75;});}})[_0xd85e('0x26')](respondWithResult(_0x132cd6,0xc9))[_0xd85e('0x4d')](handleError(_0x132cd6,null));};exports['update']=function(_0x14de94,_0x118420){if(_0x14de94[_0xd85e('0x4f')]['id']){delete _0x14de94['body']['id'];}return db[_0xd85e('0x30')][_0xd85e('0x4c')]({'where':{'id':_0x14de94[_0xd85e('0x49')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x118420,null))[_0xd85e('0x26')](saveUpdates(_0x14de94[_0xd85e('0x4f')],null))[_0xd85e('0x26')](respondWithResult(_0x118420,null))['catch'](handleError(_0x118420,null));};exports[_0xd85e('0x27')]=function(_0x215632,_0x54528a){return db['JscriptyProject'][_0xd85e('0x4c')]({'where':{'id':_0x215632[_0xd85e('0x49')]['id']}})['then'](handleEntityNotFound(_0x54528a,null))[_0xd85e('0x26')](removeEntity(_0x54528a,null))[_0xd85e('0x4d')](handleError(_0x54528a,null));};exports[_0xd85e('0x5a')]=function(_0x3f2e6e,_0x3a5305,_0x496156){var _0x4382bf={'raw':!![],'where':{}};var _0xf4f01c={};var _0x15b741={'count':0x0,'rows':[]};return db[_0xd85e('0x30')][_0xd85e('0x5b')]({'where':{'id':_0x3f2e6e[_0xd85e('0x49')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x3a5305,null))[_0xd85e('0x26')](function(_0x4290a2){if(_0x4290a2){_0xf4f01c[_0xd85e('0x38')]=_[_0xd85e('0x35')](db[_0xd85e('0x5c')][_0xd85e('0x4a')]);_0xf4f01c[_0xd85e('0x34')]=_['keys'](_0x3f2e6e[_0xd85e('0x34')]);_0xf4f01c['filters']=_[_0xd85e('0x36')](_0xf4f01c[_0xd85e('0x38')],_0xf4f01c[_0xd85e('0x34')]);_0x4382bf[_0xd85e('0x37')]=_[_0xd85e('0x36')](_0xf4f01c[_0xd85e('0x38')],qs[_0xd85e('0x39')](_0x3f2e6e['query'][_0xd85e('0x39')]));_0x4382bf[_0xd85e('0x37')]=_0x4382bf[_0xd85e('0x37')][_0xd85e('0x4b')]?_0x4382bf[_0xd85e('0x37')]:_0xf4f01c[_0xd85e('0x38')];if(!_0x3f2e6e[_0xd85e('0x34')][_0xd85e('0x5d')]('nolimit')){_0x4382bf[_0xd85e('0x1d')]=qs[_0xd85e('0x1d')](_0x3f2e6e[_0xd85e('0x34')][_0xd85e('0x1d')]);_0x4382bf[_0xd85e('0x1c')]=qs[_0xd85e('0x1c')](_0x3f2e6e[_0xd85e('0x34')][_0xd85e('0x1c')]);}_0x4382bf['order']=qs[_0xd85e('0x3c')](_0x3f2e6e[_0xd85e('0x34')]['sort']);_0x4382bf[_0xd85e('0x3d')]=qs[_0xd85e('0x3f')](_[_0xd85e('0x3e')](_0x3f2e6e[_0xd85e('0x34')],_0xf4f01c[_0xd85e('0x3f')]));_0x4382bf[_0xd85e('0x3d')][_0xd85e('0x5e')]=_0x4290a2['id'];if(_0x3f2e6e[_0xd85e('0x34')][_0xd85e('0x40')]){_0x4382bf['where']=_[_0xd85e('0x41')](_0x4382bf[_0xd85e('0x3d')],{'$or':_[_0xd85e('0x2f')](_0x4382bf[_0xd85e('0x37')],function(_0x4892f2){var _0x2f284e={};_0x2f284e[_0x4892f2]={'$like':'%'+_0x3f2e6e['query'][_0xd85e('0x40')]+'%'};return _0x2f284e;})});}_0x4382bf=_[_0xd85e('0x41')]({},_0x4382bf,_0x3f2e6e['options']);return db[_0xd85e('0x5c')][_0xd85e('0x1f')]({'where':_0x4382bf[_0xd85e('0x3d')]})[_0xd85e('0x26')](function(_0x675b22){_0x15b741[_0xd85e('0x1f')]=_0x675b22;if(_0x3f2e6e['query'][_0xd85e('0x44')]){_0x4382bf['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd85e('0x46')](_0x4382bf);})[_0xd85e('0x26')](function(_0xbfbd04){_0x15b741[_0xd85e('0x47')]=_0xbfbd04;return _0x15b741;});}})[_0xd85e('0x26')](respondWithFilteredResult(_0x3a5305,_0x4382bf))[_0xd85e('0x4d')](handleError(_0x3a5305,null));};exports[_0xd85e('0x5f')]=function(_0x467da8,_0x39491b,_0x4d704f){var _0x177d4f={'raw':!![],'where':{}};var _0x3494fa={};var _0x4e8e49={'count':0x0,'rows':[]};return db[_0xd85e('0x30')][_0xd85e('0x5b')]({'where':{'id':_0x467da8[_0xd85e('0x49')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x39491b,null))[_0xd85e('0x26')](function(_0x4cd435){if(_0x4cd435){_0x3494fa[_0xd85e('0x38')]=_['keys'](db[_0xd85e('0x60')][_0xd85e('0x4a')]);_0x3494fa['query']=_[_0xd85e('0x35')](_0x467da8[_0xd85e('0x34')]);_0x3494fa[_0xd85e('0x3f')]=_[_0xd85e('0x36')](_0x3494fa['model'],_0x3494fa[_0xd85e('0x34')]);_0x177d4f[_0xd85e('0x37')]=_[_0xd85e('0x36')](_0x3494fa[_0xd85e('0x38')],qs[_0xd85e('0x39')](_0x467da8['query']['fields']));_0x177d4f[_0xd85e('0x37')]=_0x177d4f['attributes'][_0xd85e('0x4b')]?_0x177d4f[_0xd85e('0x37')]:_0x3494fa[_0xd85e('0x38')];if(!_0x467da8[_0xd85e('0x34')][_0xd85e('0x5d')]('nolimit')){_0x177d4f[_0xd85e('0x1d')]=qs[_0xd85e('0x1d')](_0x467da8['query'][_0xd85e('0x1d')]);_0x177d4f['offset']=qs[_0xd85e('0x1c')](_0x467da8['query'][_0xd85e('0x1c')]);}_0x177d4f[_0xd85e('0x3b')]=qs['sort'](_0x467da8['query'][_0xd85e('0x3c')]);_0x177d4f[_0xd85e('0x3d')]=qs[_0xd85e('0x3f')](_[_0xd85e('0x3e')](_0x467da8['query'],_0x3494fa[_0xd85e('0x3f')]));_0x177d4f[_0xd85e('0x3d')][_0xd85e('0x5e')]=_0x4cd435['id'];if(_0x467da8[_0xd85e('0x34')]['filter']){_0x177d4f[_0xd85e('0x3d')]=_['merge'](_0x177d4f[_0xd85e('0x3d')],{'$or':_[_0xd85e('0x2f')](_0x177d4f[_0xd85e('0x37')],function(_0xc48ea0){var _0x2c98ef={};_0x2c98ef[_0xc48ea0]={'$like':'%'+_0x467da8[_0xd85e('0x34')][_0xd85e('0x40')]+'%'};return _0x2c98ef;})});}_0x177d4f=_[_0xd85e('0x41')]({},_0x177d4f,_0x467da8[_0xd85e('0x43')]);return db[_0xd85e('0x60')][_0xd85e('0x1f')]({'where':_0x177d4f[_0xd85e('0x3d')]})[_0xd85e('0x26')](function(_0x300356){_0x4e8e49[_0xd85e('0x1f')]=_0x300356;if(_0x467da8[_0xd85e('0x34')][_0xd85e('0x44')]){_0x177d4f[_0xd85e('0x45')]=[{'all':!![]}];}return db[_0xd85e('0x60')][_0xd85e('0x46')](_0x177d4f);})['then'](function(_0x15c870){_0x4e8e49[_0xd85e('0x47')]=_0x15c870;return _0x4e8e49;});}})[_0xd85e('0x26')](respondWithFilteredResult(_0x39491b,_0x177d4f))[_0xd85e('0x4d')](handleError(_0x39491b,null));};function char(_0x2b4c67){return _0xd85e('0x61')===typeof _0x2b4c67?String[_0xd85e('0x62')][_0xd85e('0x63')](null,arguments):_0x2b4c67;}function needsEncapsulation(_0x2fe071){return!!_0x2fe071&&(_0x2fe071[_0xd85e('0x64')]()[_0xd85e('0x65')](char(0xd))>=0x0||_0x2fe071[_0xd85e('0x64')]()[_0xd85e('0x65')](char(0xa))>=0x0||_0x2fe071[_0xd85e('0x64')]()[_0xd85e('0x65')](char(0x2c))>=0x0||_0x2fe071[_0xd85e('0x64')]()[_0xd85e('0x65')](char(0x22))>=0x0);}function encapsulate(_0x4831dd){var _0x576770=char(0x22),_0x167a9b='\x5c'+char(0x22),_0x5c821d=_0x4831dd['toString']()[_0xd85e('0x66')](new RegExp(_0x576770,'g'),_0x167a9b);return _0x576770+_0x5c821d+_0x576770;}exports[_0xd85e('0x67')]=function(_0x427e81,_0x3b9038,_0x38597c){var _0x428f06,_0x14e23e;var _0x251d8c={'where':{'ProjectId':_0x427e81[_0xd85e('0x49')]['id']}};if(_0x427e81[_0xd85e('0x34')]['startTime']){_0x251d8c[_0xd85e('0x3d')][_0xd85e('0x68')]=JSON[_0xd85e('0x69')](_0x427e81[_0xd85e('0x34')][_0xd85e('0x6a')]);}return db['JscriptySessionReport'][_0xd85e('0x46')](_0x251d8c)[_0xd85e('0x26')](handleEntityNotFound(_0x3b9038,null))['then'](function(_0x3fca9f){if(_0x3fca9f){_0x428f06=_0x3fca9f;return db[_0xd85e('0x6b')]['findAll']({'where':{'SessionId':{'$in':_[_0xd85e('0x2f')](_0x428f06,'id')},'ProjectId':_0x427e81[_0xd85e('0x49')]['id']},'order':_0xd85e('0x6c')});}})['then'](handleEntityNotFound(_0x3b9038,null))[_0xd85e('0x26')](function(_0x3d037a){if(_0x3d037a){_0x14e23e=_0x3d037a;var _0x5f402f={};for(var _0x49fbfe=0x0,_0x2cfb57=_0x14e23e[_0xd85e('0x4b')];_0x49fbfe<_0x2cfb57;_0x49fbfe++){if(!_0x5f402f['hasOwnProperty'](_0x14e23e[_0x49fbfe][_0xd85e('0x6d')])){_0x5f402f[_0x14e23e[_0x49fbfe][_0xd85e('0x6d')]]=needsEncapsulation(_0x14e23e[_0x49fbfe]['question'])?encapsulate(_0x14e23e[_0x49fbfe][_0xd85e('0x6e')]):_0x14e23e[_0x49fbfe][_0xd85e('0x6e')];}}var _0x3ef8cf=[],_0x474fb3={};for(var _0x4ed082=0x0,_0x1e6494=_0x428f06['length'];_0x4ed082<_0x1e6494;_0x4ed082++){_0x474fb3={'ProjectId':_0x427e81[_0xd85e('0x49')]['id'],'SessionId':_0x428f06[_0x4ed082]['id'],'StartTime':moment(_0x428f06[_0x4ed082][_0xd85e('0x68')])[_0xd85e('0x6f')](_0xd85e('0x70'))};for(var _0x2a1b92=0x0,_0x1c5b76=_0x14e23e['length'];_0x2a1b92<_0x1c5b76;_0x2a1b92++){if(_0x14e23e[_0x2a1b92]['SessionId']==_0x428f06[_0x4ed082]['id']&&_0x5f402f['hasOwnProperty'](_0x14e23e[_0x2a1b92][_0xd85e('0x6d')])){_0x474fb3[_0x5f402f[_0x14e23e[_0x2a1b92][_0xd85e('0x6d')]]]=_0x14e23e[_0x2a1b92][_0xd85e('0x71')];}}for(var _0x26f69f in _0x5f402f){if(!_0x474fb3[_0xd85e('0x5d')](_0x5f402f[_0x26f69f])){_0x474fb3[_0x5f402f[_0x26f69f]]=null;}}_0x3ef8cf[_0xd85e('0x72')](_0x474fb3);}return _0x3ef8cf;}})['then'](function(_0x6a15b6){if(!_[_0xd85e('0x73')](_0x6a15b6)){var _0x4f22bc=toCsv(_0x6a15b6);var _0xa1816b=Date[_0xd85e('0x74')]();fs[_0xd85e('0x75')](util[_0xd85e('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x427e81[_0xd85e('0x49')]['id'],_0xa1816b),_0x4f22bc);_0x3b9038[_0xd85e('0x76')](_0xd85e('0x77'),_0xd85e('0x78')+util[_0xd85e('0x6f')]('Jscripty_Project_%d_Summary_%s.csv',_0x427e81[_0xd85e('0x49')]['id'],_0xa1816b));_0x3b9038[_0xd85e('0x76')](_0xd85e('0x79'),_0xd85e('0x7a'));return _0x3b9038[_0xd85e('0x7b')](util[_0xd85e('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x427e81[_0xd85e('0x49')]['id'],_0xa1816b));}else{return _0x3b9038[_0xd85e('0x19')](0xcc);}})[_0xd85e('0x4d')](handleError(_0x3b9038,null));}; \ No newline at end of file +var _0xb584=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','destroy','then','get','Projects','UserProfileResource','stack','name','index','JscriptyProject','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','body','userProfileId','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','rows','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x252675,_0x334ef1){var _0x316fdf=function(_0x59cd9e){while(--_0x59cd9e){_0x252675['push'](_0x252675['shift']());}};_0x316fdf(++_0x334ef1);}(_0xb584,0x1c1));var _0x4b58=function(_0x4bf90f,_0x209232){_0x4bf90f=_0x4bf90f-0x0;var _0x35d418=_0xb584[_0x4bf90f];return _0x35d418;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4b58('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b58('0x1'));var moment=require('moment');var BPromise=require(_0x4b58('0x2'));var Mustache=require(_0x4b58('0x3'));var util=require(_0x4b58('0x4'));var path=require(_0x4b58('0x5'));var sox=require(_0x4b58('0x6'));var csv=require(_0x4b58('0x7'));var ejs=require(_0x4b58('0x8'));var fs=require('fs');var fs_extra=require(_0x4b58('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4b58('0xa'));var jsforce=require(_0x4b58('0xb'));var deskjs=require(_0x4b58('0xc'));var toCsv=require(_0x4b58('0x7'));var querystring=require('querystring');var Papa=require(_0x4b58('0xd'));var Redis=require(_0x4b58('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4b58('0xf'));var as=require(_0x4b58('0x10'));var hardwareService=require(_0x4b58('0x11'));var logger=require(_0x4b58('0x12'))(_0x4b58('0x13'));var utils=require('../../config/utils');var config=require(_0x4b58('0x14'));var licenseUtil=require(_0x4b58('0x15'));var db=require(_0x4b58('0x16'))['db'];function respondWithStatusCode(_0xc60643,_0x4863e5){_0x4863e5=_0x4863e5||0xcc;return function(_0x272239){if(_0x272239){return _0xc60643[_0x4b58('0x17')](_0x4863e5);}return _0xc60643['status'](_0x4863e5)['end']();};}function respondWithResult(_0x44f015,_0x354876){_0x354876=_0x354876||0xc8;return function(_0xc34c50){if(_0xc34c50){return _0x44f015['status'](_0x354876)[_0x4b58('0x18')](_0xc34c50);}};}function respondWithFilteredResult(_0xe0da74,_0x34d82c){return function(_0x5a1a8e){if(_0x5a1a8e){var _0x4b55de=typeof _0x34d82c[_0x4b58('0x19')]===_0x4b58('0x1a')&&typeof _0x34d82c[_0x4b58('0x1b')]===_0x4b58('0x1a');var _0x2698c4=_0x5a1a8e['count'];var _0x1b19ba=_0x4b55de?0x0:_0x34d82c[_0x4b58('0x19')];var _0x2faf7c=_0x4b55de?_0x5a1a8e[_0x4b58('0x1c')]:_0x34d82c[_0x4b58('0x19')]+_0x34d82c[_0x4b58('0x1b')];var _0x49f825;if(_0x2faf7c>=_0x2698c4){_0x2faf7c=_0x2698c4;_0x49f825=0xc8;}else{_0x49f825=0xce;}_0xe0da74[_0x4b58('0x1d')](_0x49f825);return _0xe0da74[_0x4b58('0x1e')](_0x4b58('0x1f'),_0x1b19ba+'-'+_0x2faf7c+'/'+_0x2698c4)[_0x4b58('0x18')](_0x5a1a8e);}return null;};}function patchUpdates(_0x25c737){return function(_0x170246){try{jsonpatch[_0x4b58('0x20')](_0x170246,_0x25c737,!![]);}catch(_0x4bd07e){return BPromise[_0x4b58('0x21')](_0x4bd07e);}return _0x170246['save']();};}function saveUpdates(_0x59715c,_0x32130b){return function(_0x21aa1c){if(_0x21aa1c){return _0x21aa1c['update'](_0x59715c)['then'](function(_0x238e74){return _0x238e74;});}return null;};}function removeEntity(_0x284f8b,_0x185c7d){return function(_0x30e57e){if(_0x30e57e){return _0x30e57e[_0x4b58('0x22')]()[_0x4b58('0x23')](function(){var _0x4926d5=_0x30e57e[_0x4b58('0x24')]({'plain':!![]});var _0x42eff5=_0x4b58('0x25');return db[_0x4b58('0x26')][_0x4b58('0x22')]({'where':{'type':_0x42eff5,'resourceId':_0x4926d5['id']}})['then'](function(){return _0x30e57e;});})[_0x4b58('0x23')](function(){_0x284f8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x145de4,_0x373279){return function(_0x25b6c9){if(!_0x25b6c9){_0x145de4['sendStatus'](0x194);}return _0x25b6c9;};}function handleError(_0x3d052e,_0x51ebb6){_0x51ebb6=_0x51ebb6||0x1f4;return function(_0x2786c1){logger['error'](_0x2786c1[_0x4b58('0x27')]);if(_0x2786c1[_0x4b58('0x28')]){delete _0x2786c1[_0x4b58('0x28')];}_0x3d052e[_0x4b58('0x1d')](_0x51ebb6)['send'](_0x2786c1);};}exports[_0x4b58('0x29')]=function(_0x2527ac,_0x5dcfb1){var _0x584587={},_0x161ea2={},_0x569528={'count':0x0,'rows':[]};var _0x144a5e=_['map'](db[_0x4b58('0x2a')][_0x4b58('0x2b')],function(_0x3168df){return{'name':_0x3168df['fieldName'],'type':_0x3168df[_0x4b58('0x2c')][_0x4b58('0x2d')]};});_0x161ea2[_0x4b58('0x2e')]=_[_0x4b58('0x2f')](_0x144a5e,_0x4b58('0x28'));_0x161ea2[_0x4b58('0x30')]=_[_0x4b58('0x31')](_0x2527ac['query']);_0x161ea2[_0x4b58('0x32')]=_[_0x4b58('0x33')](_0x161ea2[_0x4b58('0x2e')],_0x161ea2[_0x4b58('0x30')]);_0x584587[_0x4b58('0x34')]=_[_0x4b58('0x33')](_0x161ea2[_0x4b58('0x2e')],qs['fields'](_0x2527ac['query'][_0x4b58('0x35')]));_0x584587[_0x4b58('0x34')]=_0x584587[_0x4b58('0x34')]['length']?_0x584587[_0x4b58('0x34')]:_0x161ea2[_0x4b58('0x2e')];if(!_0x2527ac[_0x4b58('0x30')][_0x4b58('0x36')](_0x4b58('0x37'))){_0x584587[_0x4b58('0x1b')]=qs[_0x4b58('0x1b')](_0x2527ac[_0x4b58('0x30')][_0x4b58('0x1b')]);_0x584587[_0x4b58('0x19')]=qs[_0x4b58('0x19')](_0x2527ac[_0x4b58('0x30')][_0x4b58('0x19')]);}_0x584587[_0x4b58('0x38')]=qs[_0x4b58('0x39')](_0x2527ac[_0x4b58('0x30')][_0x4b58('0x39')]);_0x584587[_0x4b58('0x3a')]=qs[_0x4b58('0x32')](_[_0x4b58('0x3b')](_0x2527ac[_0x4b58('0x30')],_0x161ea2[_0x4b58('0x32')]),_0x144a5e);if(_0x2527ac['query'][_0x4b58('0x3c')]){_0x584587[_0x4b58('0x3a')]=_[_0x4b58('0x3d')](_0x584587['where'],{'$or':_[_0x4b58('0x2f')](_0x144a5e,function(_0x5a490e){if(_0x5a490e[_0x4b58('0x2c')]!==_0x4b58('0x3e')){var _0x466335={};_0x466335[_0x5a490e[_0x4b58('0x28')]]={'$like':'%'+_0x2527ac['query'][_0x4b58('0x3c')]+'%'};return _0x466335;}})});}_0x584587=_[_0x4b58('0x3d')]({},_0x584587,_0x2527ac[_0x4b58('0x3f')]);var _0x96d531={'where':_0x584587[_0x4b58('0x3a')]};return db[_0x4b58('0x2a')]['count'](_0x96d531)['then'](function(_0x32296a){_0x569528[_0x4b58('0x1c')]=_0x32296a;if(_0x2527ac[_0x4b58('0x30')][_0x4b58('0x40')]){_0x584587[_0x4b58('0x41')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x584587);})['then'](function(_0x36ead3){_0x569528['rows']=_0x36ead3;return _0x569528;})[_0x4b58('0x23')](respondWithFilteredResult(_0x5dcfb1,_0x584587))[_0x4b58('0x42')](handleError(_0x5dcfb1,null));};exports['show']=function(_0xe2603e,_0x523664){var _0x1785b7={'raw':![],'where':{'id':_0xe2603e[_0x4b58('0x43')]['id']}},_0x3b9525={};_0x3b9525[_0x4b58('0x2e')]=_[_0x4b58('0x31')](db['JscriptyProject']['rawAttributes']);_0x3b9525[_0x4b58('0x30')]=_['keys'](_0xe2603e[_0x4b58('0x30')]);_0x3b9525[_0x4b58('0x32')]=_[_0x4b58('0x33')](_0x3b9525['model'],_0x3b9525['query']);_0x1785b7[_0x4b58('0x34')]=_[_0x4b58('0x33')](_0x3b9525['model'],qs[_0x4b58('0x35')](_0xe2603e['query'][_0x4b58('0x35')]));_0x1785b7[_0x4b58('0x34')]=_0x1785b7[_0x4b58('0x34')]['length']?_0x1785b7['attributes']:_0x3b9525[_0x4b58('0x2e')];if(_0xe2603e[_0x4b58('0x30')]['includeAll']){_0x1785b7['include']=[{'all':!![]}];}_0x1785b7=_[_0x4b58('0x3d')]({},_0x1785b7,_0xe2603e[_0x4b58('0x3f')]);return db[_0x4b58('0x2a')][_0x4b58('0x44')](_0x1785b7)[_0x4b58('0x23')](handleEntityNotFound(_0x523664,null))[_0x4b58('0x23')](respondWithResult(_0x523664,null))[_0x4b58('0x42')](handleError(_0x523664,null));};exports['create']=function(_0x31f969,_0x161ac8){return db[_0x4b58('0x2a')][_0x4b58('0x45')](_0x31f969['body'],{})[_0x4b58('0x23')](function(_0x2ddde8){var _0x2d9ff9=_0x31f969[_0x4b58('0x46')][_0x4b58('0x24')]({'plain':!![]});if(!_0x2d9ff9)throw new Error(_0x4b58('0x47'));if(_0x2d9ff9[_0x4b58('0x48')]===_0x4b58('0x46')){var _0x165840=_0x2ddde8[_0x4b58('0x24')]({'plain':!![]});var _0x230616=_0x4b58('0x25');return db[_0x4b58('0x49')][_0x4b58('0x44')]({'where':{'name':_0x230616,'userProfileId':_0x2d9ff9['userProfileId']},'raw':!![]})['then'](function(_0x286189){if(_0x286189&&_0x286189[_0x4b58('0x4a')]===0x0){return db[_0x4b58('0x26')][_0x4b58('0x45')]({'name':_0x165840[_0x4b58('0x28')],'resourceId':_0x165840['id'],'type':_0x286189[_0x4b58('0x28')],'sectionId':_0x286189['id']},{})['then'](function(){return _0x2ddde8;});}else{return _0x2ddde8;}})[_0x4b58('0x42')](function(_0x31320f){logger[_0x4b58('0x4b')](_0x4b58('0x4c'),_0x31320f);throw _0x31320f;});}return _0x2ddde8;})[_0x4b58('0x23')](respondWithResult(_0x161ac8,0xc9))[_0x4b58('0x42')](handleError(_0x161ac8,null));};exports[_0x4b58('0x4d')]=function(_0x317433,_0x1b5717){var _0x3c2dcc={'where':{'id':_0x317433[_0x4b58('0x43')]['id']}},_0x5864fe={};_0x5864fe[_0x4b58('0x2e')]=_['keys'](db[_0x4b58('0x2a')][_0x4b58('0x2b')]);_0x3c2dcc[_0x4b58('0x34')]=_[_0x4b58('0x33')](_0x5864fe[_0x4b58('0x2e')],qs[_0x4b58('0x35')](_0x317433['query']['fields']));_0x3c2dcc[_0x4b58('0x34')]=_0x3c2dcc[_0x4b58('0x34')][_0x4b58('0x4e')]?_0x3c2dcc[_0x4b58('0x34')]:_0x5864fe['model'];if(_0x317433[_0x4b58('0x30')][_0x4b58('0x40')]){_0x3c2dcc[_0x4b58('0x41')]=[{'all':!![]}];}_0x3c2dcc=_['merge']({},_0x3c2dcc,_0x317433[_0x4b58('0x3f')]);return db['JscriptyProject'][_0x4b58('0x44')](_0x3c2dcc)[_0x4b58('0x23')](handleEntityNotFound(_0x1b5717,null))['then'](function(_0x33c160){if(_0x33c160){var _0x51f200=_0x33c160[_0x4b58('0x24')]({'plain':!![]});_0x51f200=qs[_0x4b58('0x4f')](_0x51f200,['id',_0x4b58('0x50'),_0x4b58('0x51')]);_0x317433[_0x4b58('0x52')]=_[_0x4b58('0x4f')](_0x317433[_0x4b58('0x52')],['id','createdAt',_0x4b58('0x51')]);return db[_0x4b58('0x2a')]['create'](_[_0x4b58('0x3d')](_0x51f200,_0x317433[_0x4b58('0x52')]),{'include':_0x317433['query'][_0x4b58('0x40')]?[{'all':!![]}]:undefined})[_0x4b58('0x23')](function(_0x3b917e){var _0x3c49df=_0x317433[_0x4b58('0x46')][_0x4b58('0x24')]({'plain':!![]});if(!_0x3c49df)throw new Error(_0x4b58('0x47'));if(_0x3c49df['role']===_0x4b58('0x46')){var _0x44cbda=_0x3b917e[_0x4b58('0x24')]({'plain':!![]});var _0x4fe4da=_0x4b58('0x25');return db[_0x4b58('0x49')][_0x4b58('0x44')]({'where':{'name':_0x4fe4da,'userProfileId':_0x3c49df[_0x4b58('0x53')]},'raw':!![]})[_0x4b58('0x23')](function(_0x5f8ff1){if(_0x5f8ff1&&_0x5f8ff1[_0x4b58('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x44cbda[_0x4b58('0x28')],'resourceId':_0x44cbda['id'],'type':_0x5f8ff1['name'],'sectionId':_0x5f8ff1['id']},{})[_0x4b58('0x23')](function(){return _0x3b917e;});}else{return _0x3b917e;}})[_0x4b58('0x42')](function(_0x3ebc3a){logger[_0x4b58('0x4b')](_0x4b58('0x4c'),_0x3ebc3a);throw _0x3ebc3a;});}return _0x3b917e;});}})['then'](respondWithResult(_0x1b5717,0xc9))[_0x4b58('0x42')](handleError(_0x1b5717,null));};exports['update']=function(_0xb2d24a,_0x58af8d){if(_0xb2d24a['body']['id']){delete _0xb2d24a[_0x4b58('0x52')]['id'];}return db[_0x4b58('0x2a')]['find']({'where':{'id':_0xb2d24a['params']['id']}})['then'](handleEntityNotFound(_0x58af8d,null))[_0x4b58('0x23')](saveUpdates(_0xb2d24a[_0x4b58('0x52')],null))[_0x4b58('0x23')](respondWithResult(_0x58af8d,null))[_0x4b58('0x42')](handleError(_0x58af8d,null));};exports['destroy']=function(_0x354e75,_0xb67048){return db[_0x4b58('0x2a')]['find']({'where':{'id':_0x354e75[_0x4b58('0x43')]['id']}})[_0x4b58('0x23')](handleEntityNotFound(_0xb67048,null))[_0x4b58('0x23')](removeEntity(_0xb67048,null))['catch'](handleError(_0xb67048,null));};exports[_0x4b58('0x54')]=function(_0x5d7ef6,_0x4193f7,_0x8ac86){var _0x4a8495={'raw':!![],'where':{}};var _0x2eda56={};var _0x4aba74={'count':0x0,'rows':[]};return db[_0x4b58('0x2a')][_0x4b58('0x55')]({'where':{'id':_0x5d7ef6[_0x4b58('0x43')]['id']}})[_0x4b58('0x23')](handleEntityNotFound(_0x4193f7,null))['then'](function(_0xf03326){if(_0xf03326){_0x2eda56['model']=_[_0x4b58('0x31')](db[_0x4b58('0x56')][_0x4b58('0x2b')]);_0x2eda56[_0x4b58('0x30')]=_[_0x4b58('0x31')](_0x5d7ef6['query']);_0x2eda56[_0x4b58('0x32')]=_['intersection'](_0x2eda56[_0x4b58('0x2e')],_0x2eda56['query']);_0x4a8495[_0x4b58('0x34')]=_['intersection'](_0x2eda56['model'],qs[_0x4b58('0x35')](_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x35')]));_0x4a8495[_0x4b58('0x34')]=_0x4a8495[_0x4b58('0x34')][_0x4b58('0x4e')]?_0x4a8495[_0x4b58('0x34')]:_0x2eda56[_0x4b58('0x2e')];if(!_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x36')](_0x4b58('0x37'))){_0x4a8495[_0x4b58('0x1b')]=qs[_0x4b58('0x1b')](_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x1b')]);_0x4a8495[_0x4b58('0x19')]=qs['offset'](_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x19')]);}_0x4a8495[_0x4b58('0x38')]=qs[_0x4b58('0x39')](_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x39')]);_0x4a8495['where']=qs[_0x4b58('0x32')](_[_0x4b58('0x3b')](_0x5d7ef6[_0x4b58('0x30')],_0x2eda56[_0x4b58('0x32')]));_0x4a8495[_0x4b58('0x3a')][_0x4b58('0x57')]=_0xf03326['id'];if(_0x5d7ef6[_0x4b58('0x30')][_0x4b58('0x3c')]){_0x4a8495[_0x4b58('0x3a')]=_[_0x4b58('0x3d')](_0x4a8495[_0x4b58('0x3a')],{'$or':_[_0x4b58('0x2f')](_0x4a8495[_0x4b58('0x34')],function(_0x267ca8){var _0x25b877={};_0x25b877[_0x267ca8]={'$like':'%'+_0x5d7ef6[_0x4b58('0x30')]['filter']+'%'};return _0x25b877;})});}_0x4a8495=_[_0x4b58('0x3d')]({},_0x4a8495,_0x5d7ef6['options']);return db[_0x4b58('0x56')][_0x4b58('0x1c')]({'where':_0x4a8495[_0x4b58('0x3a')]})[_0x4b58('0x23')](function(_0x196b75){_0x4aba74[_0x4b58('0x1c')]=_0x196b75;if(_0x5d7ef6[_0x4b58('0x30')]['includeAll']){_0x4a8495[_0x4b58('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4b58('0x58')](_0x4a8495);})[_0x4b58('0x23')](function(_0x324763){_0x4aba74[_0x4b58('0x59')]=_0x324763;return _0x4aba74;});}})[_0x4b58('0x23')](respondWithFilteredResult(_0x4193f7,_0x4a8495))[_0x4b58('0x42')](handleError(_0x4193f7,null));};exports[_0x4b58('0x5a')]=function(_0x17d222,_0x98f7ef,_0x55f3fb){var _0x96112d={'raw':!![],'where':{}};var _0x4576b8={};var _0x419f70={'count':0x0,'rows':[]};return db[_0x4b58('0x2a')]['findOne']({'where':{'id':_0x17d222['params']['id']}})[_0x4b58('0x23')](handleEntityNotFound(_0x98f7ef,null))[_0x4b58('0x23')](function(_0x3ec6be){if(_0x3ec6be){_0x4576b8[_0x4b58('0x2e')]=_['keys'](db[_0x4b58('0x5b')][_0x4b58('0x2b')]);_0x4576b8[_0x4b58('0x30')]=_[_0x4b58('0x31')](_0x17d222[_0x4b58('0x30')]);_0x4576b8[_0x4b58('0x32')]=_[_0x4b58('0x33')](_0x4576b8[_0x4b58('0x2e')],_0x4576b8[_0x4b58('0x30')]);_0x96112d[_0x4b58('0x34')]=_['intersection'](_0x4576b8[_0x4b58('0x2e')],qs[_0x4b58('0x35')](_0x17d222[_0x4b58('0x30')][_0x4b58('0x35')]));_0x96112d[_0x4b58('0x34')]=_0x96112d[_0x4b58('0x34')][_0x4b58('0x4e')]?_0x96112d['attributes']:_0x4576b8[_0x4b58('0x2e')];if(!_0x17d222[_0x4b58('0x30')][_0x4b58('0x36')](_0x4b58('0x37'))){_0x96112d['limit']=qs[_0x4b58('0x1b')](_0x17d222[_0x4b58('0x30')][_0x4b58('0x1b')]);_0x96112d[_0x4b58('0x19')]=qs[_0x4b58('0x19')](_0x17d222[_0x4b58('0x30')]['offset']);}_0x96112d[_0x4b58('0x38')]=qs[_0x4b58('0x39')](_0x17d222[_0x4b58('0x30')]['sort']);_0x96112d[_0x4b58('0x3a')]=qs[_0x4b58('0x32')](_[_0x4b58('0x3b')](_0x17d222[_0x4b58('0x30')],_0x4576b8['filters']));_0x96112d[_0x4b58('0x3a')][_0x4b58('0x57')]=_0x3ec6be['id'];if(_0x17d222[_0x4b58('0x30')][_0x4b58('0x3c')]){_0x96112d[_0x4b58('0x3a')]=_[_0x4b58('0x3d')](_0x96112d[_0x4b58('0x3a')],{'$or':_[_0x4b58('0x2f')](_0x96112d[_0x4b58('0x34')],function(_0x1ec4e0){var _0x3f8fdb={};_0x3f8fdb[_0x1ec4e0]={'$like':'%'+_0x17d222[_0x4b58('0x30')]['filter']+'%'};return _0x3f8fdb;})});}_0x96112d=_[_0x4b58('0x3d')]({},_0x96112d,_0x17d222[_0x4b58('0x3f')]);return db[_0x4b58('0x5b')][_0x4b58('0x1c')]({'where':_0x96112d['where']})[_0x4b58('0x23')](function(_0x16d2a6){_0x419f70[_0x4b58('0x1c')]=_0x16d2a6;if(_0x17d222[_0x4b58('0x30')]['includeAll']){_0x96112d[_0x4b58('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x96112d);})[_0x4b58('0x23')](function(_0x27e536){_0x419f70[_0x4b58('0x59')]=_0x27e536;return _0x419f70;});}})['then'](respondWithFilteredResult(_0x98f7ef,_0x96112d))['catch'](handleError(_0x98f7ef,null));};function char(_0x309746){return _0x4b58('0x5c')===typeof _0x309746?String['fromCharCode'][_0x4b58('0x20')](null,arguments):_0x309746;}function needsEncapsulation(_0x1c42f6){return!!_0x1c42f6&&(_0x1c42f6[_0x4b58('0x5d')]()[_0x4b58('0x5e')](char(0xd))>=0x0||_0x1c42f6[_0x4b58('0x5d')]()[_0x4b58('0x5e')](char(0xa))>=0x0||_0x1c42f6[_0x4b58('0x5d')]()[_0x4b58('0x5e')](char(0x2c))>=0x0||_0x1c42f6[_0x4b58('0x5d')]()[_0x4b58('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x5447d6){var _0x1a10d3=char(0x22),_0xf8555f='\x5c'+char(0x22),_0x23e0c5=_0x5447d6[_0x4b58('0x5d')]()[_0x4b58('0x5f')](new RegExp(_0x1a10d3,'g'),_0xf8555f);return _0x1a10d3+_0x23e0c5+_0x1a10d3;}exports[_0x4b58('0x60')]=function(_0x4a92d9,_0x42745b,_0x45a94c){var _0x46ec6b,_0x7b6f88;var _0x3080b3={'where':{'ProjectId':_0x4a92d9[_0x4b58('0x43')]['id']}};if(_0x4a92d9[_0x4b58('0x30')][_0x4b58('0x61')]){_0x3080b3[_0x4b58('0x3a')]['starttime']=JSON[_0x4b58('0x62')](_0x4a92d9[_0x4b58('0x30')][_0x4b58('0x61')]);}return db[_0x4b58('0x56')][_0x4b58('0x58')](_0x3080b3)[_0x4b58('0x23')](handleEntityNotFound(_0x42745b,null))[_0x4b58('0x23')](function(_0x3d8cf4){if(_0x3d8cf4){_0x46ec6b=_0x3d8cf4;return db[_0x4b58('0x63')]['findAll']({'where':{'SessionId':{'$in':_[_0x4b58('0x2f')](_0x46ec6b,'id')},'ProjectId':_0x4a92d9[_0x4b58('0x43')]['id']},'order':_0x4b58('0x64')});}})[_0x4b58('0x23')](handleEntityNotFound(_0x42745b,null))[_0x4b58('0x23')](function(_0x24e037){if(_0x24e037){_0x7b6f88=_0x24e037;var _0x330bb3={};for(var _0x39ae63=0x0,_0x511a78=_0x7b6f88[_0x4b58('0x4e')];_0x39ae63<_0x511a78;_0x39ae63++){if(!_0x330bb3[_0x4b58('0x36')](_0x7b6f88[_0x39ae63][_0x4b58('0x65')])){_0x330bb3[_0x7b6f88[_0x39ae63]['questionId']]=needsEncapsulation(_0x7b6f88[_0x39ae63][_0x4b58('0x66')])?encapsulate(_0x7b6f88[_0x39ae63]['question']):_0x7b6f88[_0x39ae63][_0x4b58('0x66')];}}var _0x186122=[],_0x45a09b={};for(var _0x5b37fc=0x0,_0x3c80d0=_0x46ec6b[_0x4b58('0x4e')];_0x5b37fc<_0x3c80d0;_0x5b37fc++){_0x45a09b={'ProjectId':_0x4a92d9[_0x4b58('0x43')]['id'],'SessionId':_0x46ec6b[_0x5b37fc]['id'],'StartTime':moment(_0x46ec6b[_0x5b37fc][_0x4b58('0x67')])[_0x4b58('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x531d84=0x0,_0x200d95=_0x7b6f88[_0x4b58('0x4e')];_0x531d84<_0x200d95;_0x531d84++){if(_0x7b6f88[_0x531d84][_0x4b58('0x69')]==_0x46ec6b[_0x5b37fc]['id']&&_0x330bb3['hasOwnProperty'](_0x7b6f88[_0x531d84][_0x4b58('0x65')])){_0x45a09b[_0x330bb3[_0x7b6f88[_0x531d84]['questionId']]]=_0x7b6f88[_0x531d84][_0x4b58('0x6a')];}}for(var _0x35bdf7 in _0x330bb3){if(!_0x45a09b[_0x4b58('0x36')](_0x330bb3[_0x35bdf7])){_0x45a09b[_0x330bb3[_0x35bdf7]]=null;}}_0x186122[_0x4b58('0x6b')](_0x45a09b);}return _0x186122;}})[_0x4b58('0x23')](function(_0x5b90ed){if(!_[_0x4b58('0x6c')](_0x5b90ed)){var _0x4ec95b=toCsv(_0x5b90ed);var _0x30edb9=Date['now']();fs['writeFileSync'](util[_0x4b58('0x68')](_0x4b58('0x6d'),_0x4a92d9['params']['id'],_0x30edb9),_0x4ec95b);_0x42745b['setHeader'](_0x4b58('0x6e'),'attachment;\x20filename='+util[_0x4b58('0x68')](_0x4b58('0x6f'),_0x4a92d9[_0x4b58('0x43')]['id'],_0x30edb9));_0x42745b['setHeader'](_0x4b58('0x70'),_0x4b58('0x71'));return _0x42745b['download'](util[_0x4b58('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4a92d9[_0x4b58('0x43')]['id'],_0x30edb9));}else{return _0x42745b[_0x4b58('0x17')](0xcc);}})[_0x4b58('0x42')](handleError(_0x42745b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5dc6286..4790984 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 _0x0dd6=['../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5abfb1,_0x312afe){var _0x307c08=function(_0x97832a){while(--_0x97832a){_0x5abfb1['push'](_0x5abfb1['shift']());}};_0x307c08(++_0x312afe);}(_0x0dd6,0xca));var _0x60dd=function(_0xa0cea8,_0x1e23ef){_0xa0cea8=_0xa0cea8-0x0;var _0x49522b=_0x0dd6[_0xa0cea8];return _0x49522b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x60dd('0x0'))(_0x60dd('0x1'));var moment=require(_0x60dd('0x2'));var BPromise=require(_0x60dd('0x3'));var rp=require(_0x60dd('0x4'));var fs=require('fs');var path=require(_0x60dd('0x5'));var rimraf=require(_0x60dd('0x6'));var config=require(_0x60dd('0x7'));var attributes=require(_0x60dd('0x8'));module['exports']=function(_0x1c8c4e,_0x4875cb){return _0x1c8c4e[_0x60dd('0x9')]('JscriptyProject',attributes,{'tableName':_0x60dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1224=['moment','bluebird','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1224,0x10d));var _0x4122=function(_0x1de9ed,_0x4ff7e1){_0x1de9ed=_0x1de9ed-0x0;var _0x31a0c9=_0x1224[_0x1de9ed];return _0x31a0c9;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var logger=require(_0x4122('0x2'))(_0x4122('0x3'));var moment=require(_0x4122('0x4'));var BPromise=require(_0x4122('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4122('0x6'));var rimraf=require(_0x4122('0x7'));var config=require(_0x4122('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x4122('0x9')]=function(_0x76278c,_0xc6dfaf){return _0x76278c[_0x4122('0xa')](_0x4122('0xb'),attributes,{'tableName':_0x4122('0xc'),'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 e050ad4..01c4eae 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x54b8c0,_0x101de8){var _0x53330d=function(_0x307d06){while(--_0x307d06){_0x54b8c0['push'](_0x54b8c0['shift']());}};_0x53330d(++_0x101de8);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xb7e7=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x44955b,_0x1384fc){var _0x2c9a8d=function(_0x711c2e){while(--_0x711c2e){_0x44955b['push'](_0x44955b['shift']());}};_0x2c9a8d(++_0x1384fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 220567c..2243d9c 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 _0x810e=['delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','update'];(function(_0x5b8939,_0x46b0b4){var _0x2c58ad=function(_0x48baa2){while(--_0x48baa2){_0x5b8939['push'](_0x5b8939['shift']());}};_0x2c58ad(++_0x46b0b4);}(_0x810e,0x1a8));var _0xe810=function(_0x3f7204,_0x3146fc){_0x3f7204=_0x3f7204-0x0;var _0x416f71=_0x810e[_0x3f7204];return _0x416f71;};'use strict';var multer=require(_0xe810('0x0'));var util=require(_0xe810('0x1'));var path=require('path');var timeout=require(_0xe810('0x2'));var express=require('express');var router=express[_0xe810('0x3')]();var fs_extra=require(_0xe810('0x4'));var auth=require(_0xe810('0x5'));var interaction=require(_0xe810('0x6'));var config=require(_0xe810('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xe810('0x8')]('/',auth[_0xe810('0x9')](),controller[_0xe810('0xa')]);router[_0xe810('0x8')](_0xe810('0xb'),auth['isAuthenticated'](),controller[_0xe810('0xc')]);router[_0xe810('0x8')]('/:id',auth[_0xe810('0x9')](),controller['show']);router[_0xe810('0xd')]('/',auth[_0xe810('0x9')](),controller[_0xe810('0xe')]);router['put']('/:id',auth[_0xe810('0x9')](),controller[_0xe810('0xf')]);router[_0xe810('0x10')](_0xe810('0x11'),auth[_0xe810('0x9')](),controller[_0xe810('0x12')]);module[_0xe810('0x13')]=router; \ No newline at end of file +var _0x924e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x378a48,_0x5b012f){var _0x1538c5=function(_0x372bcc){while(--_0x372bcc){_0x378a48['push'](_0x378a48['shift']());}};_0x1538c5(++_0x5b012f);}(_0x924e,0x153));var _0xe924=function(_0x201d98,_0x56fd1f){_0x201d98=_0x201d98-0x0;var _0x1ae057=_0x924e[_0x201d98];return _0x1ae057;};'use strict';var multer=require(_0xe924('0x0'));var util=require('util');var path=require(_0xe924('0x1'));var timeout=require(_0xe924('0x2'));var express=require(_0xe924('0x3'));var router=express[_0xe924('0x4')]();var fs_extra=require(_0xe924('0x5'));var auth=require(_0xe924('0x6'));var interaction=require(_0xe924('0x7'));var config=require(_0xe924('0x8'));var controller=require(_0xe924('0x9'));router[_0xe924('0xa')]('/',auth[_0xe924('0xb')](),controller[_0xe924('0xc')]);router['get'](_0xe924('0xd'),auth[_0xe924('0xb')](),controller[_0xe924('0xe')]);router[_0xe924('0xa')]('/:id',auth[_0xe924('0xb')](),controller[_0xe924('0xf')]);router[_0xe924('0x10')]('/',auth[_0xe924('0xb')](),controller[_0xe924('0x11')]);router[_0xe924('0x12')](_0xe924('0x13'),auth[_0xe924('0xb')](),controller[_0xe924('0x14')]);router['delete']('/:id',auth[_0xe924('0xb')](),controller[_0xe924('0x15')]);module[_0xe924('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d5374b7..080abad 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x5e56e9,_0x4b1e4e){_0x5e56e9=_0x5e56e9-0x0;var _0x3259f3=_0x7a54[_0x5e56e9];return _0x3259f3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x766d26,_0x27a26e){_0x766d26=_0x766d26-0x0;var _0x518b3d=_0x7a54[_0x766d26];return _0x518b3d;};'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 d1c29ac..f3b8495 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 _0xdadc=['index','JscriptyQuestionReport','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send'];(function(_0x31a9be,_0x4989ef){var _0x22c699=function(_0x3b34b){while(--_0x3b34b){_0x31a9be['push'](_0x31a9be['shift']());}};_0x22c699(++_0x4989ef);}(_0xdadc,0x1ca));var _0xcdad=function(_0x5bd5e4,_0xc2787b){_0x5bd5e4=_0x5bd5e4-0x0;var _0x13be05=_0xdadc[_0x5bd5e4];return _0x13be05;};'use strict';var emlformat=require(_0xcdad('0x0'));var rimraf=require(_0xcdad('0x1'));var zipdir=require(_0xcdad('0x2'));var jsonpatch=require(_0xcdad('0x3'));var rp=require('request-promise');var moment=require(_0xcdad('0x4'));var BPromise=require(_0xcdad('0x5'));var Mustache=require(_0xcdad('0x6'));var util=require(_0xcdad('0x7'));var path=require(_0xcdad('0x8'));var sox=require(_0xcdad('0x9'));var csv=require(_0xcdad('0xa'));var ejs=require(_0xcdad('0xb'));var fs=require('fs');var fs_extra=require(_0xcdad('0xc'));var _=require(_0xcdad('0xd'));var squel=require('squel');var crypto=require(_0xcdad('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcdad('0xf'));var toCsv=require(_0xcdad('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdad('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcdad('0x11'));var as=require(_0xcdad('0x12'));var hardwareService=require(_0xcdad('0x13'));var logger=require(_0xcdad('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcdad('0x15'));var db=require(_0xcdad('0x16'))['db'];function respondWithStatusCode(_0x92dc8e,_0x266beb){_0x266beb=_0x266beb||0xcc;return function(_0xa7ea81){if(_0xa7ea81){return _0x92dc8e[_0xcdad('0x17')](_0x266beb);}return _0x92dc8e['status'](_0x266beb)[_0xcdad('0x18')]();};}function respondWithResult(_0x5945e6,_0x1266e0){_0x1266e0=_0x1266e0||0xc8;return function(_0x76f202){if(_0x76f202){return _0x5945e6[_0xcdad('0x19')](_0x1266e0)['json'](_0x76f202);}};}function respondWithFilteredResult(_0x41136d,_0x5d26dc){return function(_0x57367c){if(_0x57367c){var _0x1545bf=typeof _0x5d26dc[_0xcdad('0x1a')]===_0xcdad('0x1b')&&typeof _0x5d26dc[_0xcdad('0x1c')]===_0xcdad('0x1b');var _0x46e792=_0x57367c['count'];var _0x54b084=_0x1545bf?0x0:_0x5d26dc[_0xcdad('0x1a')];var _0x152e1a=_0x1545bf?_0x57367c[_0xcdad('0x1d')]:_0x5d26dc[_0xcdad('0x1a')]+_0x5d26dc[_0xcdad('0x1c')];var _0x1e92a6;if(_0x152e1a>=_0x46e792){_0x152e1a=_0x46e792;_0x1e92a6=0xc8;}else{_0x1e92a6=0xce;}_0x41136d['status'](_0x1e92a6);return _0x41136d[_0xcdad('0x1e')]('Content-Range',_0x54b084+'-'+_0x152e1a+'/'+_0x46e792)['json'](_0x57367c);}return null;};}function patchUpdates(_0x1720a9){return function(_0x43ca76){try{jsonpatch[_0xcdad('0x1f')](_0x43ca76,_0x1720a9,!![]);}catch(_0x31d81d){return BPromise[_0xcdad('0x20')](_0x31d81d);}return _0x43ca76['save']();};}function saveUpdates(_0x50cfd7,_0x4f0ac7){return function(_0x49f3cc){if(_0x49f3cc){return _0x49f3cc[_0xcdad('0x21')](_0x50cfd7)[_0xcdad('0x22')](function(_0x400a77){return _0x400a77;});}return null;};}function removeEntity(_0x43a900,_0x5dbcc5){return function(_0x547925){if(_0x547925){return _0x547925[_0xcdad('0x23')]()[_0xcdad('0x22')](function(){_0x43a900['status'](0xcc)[_0xcdad('0x18')]();});}};}function handleEntityNotFound(_0x2867f3,_0x2c1a35){return function(_0x57d0a2){if(!_0x57d0a2){_0x2867f3[_0xcdad('0x17')](0x194);}return _0x57d0a2;};}function handleError(_0xe2786f,_0x574fa3){_0x574fa3=_0x574fa3||0x1f4;return function(_0x3b4421){logger['error'](_0x3b4421[_0xcdad('0x24')]);if(_0x3b4421[_0xcdad('0x25')]){delete _0x3b4421['name'];}_0xe2786f[_0xcdad('0x19')](_0x574fa3)[_0xcdad('0x26')](_0x3b4421);};}exports[_0xcdad('0x27')]=function(_0x2f62ba,_0x2132b8){var _0x113ecb={},_0x4617dd={},_0x5b9a9a={'count':0x0,'rows':[]};var _0x4eae06=_['map'](db[_0xcdad('0x28')]['rawAttributes'],function(_0x27c4b9){return{'name':_0x27c4b9[_0xcdad('0x29')],'type':_0x27c4b9['type'][_0xcdad('0x2a')]};});_0x4617dd['model']=_[_0xcdad('0x2b')](_0x4eae06,_0xcdad('0x25'));_0x4617dd[_0xcdad('0x2c')]=_[_0xcdad('0x2d')](_0x2f62ba[_0xcdad('0x2c')]);_0x4617dd[_0xcdad('0x2e')]=_['intersection'](_0x4617dd[_0xcdad('0x2f')],_0x4617dd[_0xcdad('0x2c')]);_0x113ecb[_0xcdad('0x30')]=_[_0xcdad('0x31')](_0x4617dd[_0xcdad('0x2f')],qs['fields'](_0x2f62ba[_0xcdad('0x2c')][_0xcdad('0x32')]));_0x113ecb[_0xcdad('0x30')]=_0x113ecb['attributes']['length']?_0x113ecb[_0xcdad('0x30')]:_0x4617dd[_0xcdad('0x2f')];if(!_0x2f62ba[_0xcdad('0x2c')]['hasOwnProperty'](_0xcdad('0x33'))){_0x113ecb[_0xcdad('0x1c')]=qs[_0xcdad('0x1c')](_0x2f62ba['query']['limit']);_0x113ecb[_0xcdad('0x1a')]=qs[_0xcdad('0x1a')](_0x2f62ba[_0xcdad('0x2c')][_0xcdad('0x1a')]);}_0x113ecb[_0xcdad('0x34')]=qs[_0xcdad('0x35')](_0x2f62ba[_0xcdad('0x2c')][_0xcdad('0x35')]);_0x113ecb['where']=qs[_0xcdad('0x2e')](_[_0xcdad('0x36')](_0x2f62ba[_0xcdad('0x2c')],_0x4617dd[_0xcdad('0x2e')]),_0x4eae06);if(_0x2f62ba['query'][_0xcdad('0x37')]){_0x113ecb[_0xcdad('0x38')]=_[_0xcdad('0x39')](_0x113ecb[_0xcdad('0x38')],{'$or':_['map'](_0x4eae06,function(_0x4e1b64){if(_0x4e1b64['type']!==_0xcdad('0x3a')){var _0x1bb502={};_0x1bb502[_0x4e1b64[_0xcdad('0x25')]]={'$like':'%'+_0x2f62ba['query'][_0xcdad('0x37')]+'%'};return _0x1bb502;}})});}_0x113ecb=_[_0xcdad('0x39')]({},_0x113ecb,_0x2f62ba[_0xcdad('0x3b')]);var _0x26b8fb={'where':_0x113ecb[_0xcdad('0x38')]};return db[_0xcdad('0x28')][_0xcdad('0x1d')](_0x26b8fb)[_0xcdad('0x22')](function(_0x531573){_0x5b9a9a[_0xcdad('0x1d')]=_0x531573;if(_0x2f62ba['query'][_0xcdad('0x3c')]){_0x113ecb['include']=[{'all':!![]}];}return db[_0xcdad('0x28')]['findAll'](_0x113ecb);})[_0xcdad('0x22')](function(_0x43e1b1){_0x5b9a9a['rows']=_0x43e1b1;return _0x5b9a9a;})['then'](respondWithFilteredResult(_0x2132b8,_0x113ecb))[_0xcdad('0x3d')](handleError(_0x2132b8,null));};exports[_0xcdad('0x3e')]=function(_0x4f17ef,_0x42038e){var _0x31d5c2={'raw':!![],'where':{'id':_0x4f17ef[_0xcdad('0x3f')]['id']}},_0xcb4666={};_0xcb4666[_0xcdad('0x2f')]=_[_0xcdad('0x2d')](db[_0xcdad('0x28')][_0xcdad('0x40')]);_0xcb4666[_0xcdad('0x2c')]=_['keys'](_0x4f17ef[_0xcdad('0x2c')]);_0xcb4666[_0xcdad('0x2e')]=_['intersection'](_0xcb4666[_0xcdad('0x2f')],_0xcb4666[_0xcdad('0x2c')]);_0x31d5c2[_0xcdad('0x30')]=_[_0xcdad('0x31')](_0xcb4666[_0xcdad('0x2f')],qs[_0xcdad('0x32')](_0x4f17ef[_0xcdad('0x2c')][_0xcdad('0x32')]));_0x31d5c2['attributes']=_0x31d5c2['attributes'][_0xcdad('0x41')]?_0x31d5c2[_0xcdad('0x30')]:_0xcb4666[_0xcdad('0x2f')];if(_0x4f17ef[_0xcdad('0x2c')][_0xcdad('0x3c')]){_0x31d5c2[_0xcdad('0x42')]=[{'all':!![]}];}_0x31d5c2=_[_0xcdad('0x39')]({},_0x31d5c2,_0x4f17ef[_0xcdad('0x3b')]);return db[_0xcdad('0x28')][_0xcdad('0x43')](_0x31d5c2)[_0xcdad('0x22')](handleEntityNotFound(_0x42038e,null))['then'](respondWithResult(_0x42038e,null))[_0xcdad('0x3d')](handleError(_0x42038e,null));};exports[_0xcdad('0x44')]=function(_0x2ab1a6,_0x4c4d10){return db['JscriptyQuestionReport'][_0xcdad('0x44')](_0x2ab1a6['body'],{})[_0xcdad('0x22')](respondWithResult(_0x4c4d10,0xc9))[_0xcdad('0x3d')](handleError(_0x4c4d10,null));};exports['update']=function(_0x55f842,_0x3eaa89){if(_0x55f842[_0xcdad('0x45')]['id']){delete _0x55f842[_0xcdad('0x45')]['id'];}return db[_0xcdad('0x28')][_0xcdad('0x43')]({'where':{'id':_0x55f842['params']['id']}})[_0xcdad('0x22')](handleEntityNotFound(_0x3eaa89,null))[_0xcdad('0x22')](saveUpdates(_0x55f842['body'],null))['then'](respondWithResult(_0x3eaa89,null))[_0xcdad('0x3d')](handleError(_0x3eaa89,null));};exports[_0xcdad('0x23')]=function(_0x44311e,_0xd3226e){return db['JscriptyQuestionReport'][_0xcdad('0x43')]({'where':{'id':_0x44311e[_0xcdad('0x3f')]['id']}})[_0xcdad('0x22')](handleEntityNotFound(_0xd3226e,null))['then'](removeEntity(_0xd3226e,null))[_0xcdad('0x3d')](handleError(_0xd3226e,null));};exports[_0xcdad('0x46')]=function(_0x2a7c70,_0x3b525d){return db[_0xcdad('0x28')][_0xcdad('0x46')]()['then'](respondWithResult(_0x3b525d,null))[_0xcdad('0x3d')](handleError(_0x3b525d,null));}; \ No newline at end of file +var _0x6711=['filters','attributes','fields','length','nolimit','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','catch','show','intersection','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','reject','save','update','destroy','then','sendStatus','name','send','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x3b5e1f,_0x5bf3e7){var _0x5c0be5=function(_0x47ee46){while(--_0x47ee46){_0x3b5e1f['push'](_0x3b5e1f['shift']());}};_0x5c0be5(++_0x5bf3e7);}(_0x6711,0x1cd));var _0x1671=function(_0x499099,_0x4139dd){_0x499099=_0x499099-0x0;var _0x2c6bd4=_0x6711[_0x499099];return _0x2c6bd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1671('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1671('0x1'));var rp=require(_0x1671('0x2'));var moment=require(_0x1671('0x3'));var BPromise=require(_0x1671('0x4'));var Mustache=require(_0x1671('0x5'));var util=require(_0x1671('0x6'));var path=require(_0x1671('0x7'));var sox=require(_0x1671('0x8'));var csv=require(_0x1671('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1671('0xa'));var squel=require(_0x1671('0xb'));var crypto=require(_0x1671('0xc'));var jsforce=require(_0x1671('0xd'));var deskjs=require(_0x1671('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1671('0xf'));var Papa=require(_0x1671('0x10'));var Redis=require(_0x1671('0x11'));var authService=require(_0x1671('0x12'));var qs=require(_0x1671('0x13'));var as=require(_0x1671('0x14'));var hardwareService=require(_0x1671('0x15'));var logger=require(_0x1671('0x16'))(_0x1671('0x17'));var utils=require(_0x1671('0x18'));var config=require(_0x1671('0x19'));var licenseUtil=require(_0x1671('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5530b2,_0x1bb078){_0x1bb078=_0x1bb078||0xcc;return function(_0x1322bf){if(_0x1322bf){return _0x5530b2['sendStatus'](_0x1bb078);}return _0x5530b2['status'](_0x1bb078)[_0x1671('0x1b')]();};}function respondWithResult(_0x4c242c,_0x18fa16){_0x18fa16=_0x18fa16||0xc8;return function(_0x1d9deb){if(_0x1d9deb){return _0x4c242c[_0x1671('0x1c')](_0x18fa16)[_0x1671('0x1d')](_0x1d9deb);}};}function respondWithFilteredResult(_0x4e9cfe,_0x1bd1f4){return function(_0x156afd){if(_0x156afd){var _0x46678f=typeof _0x1bd1f4[_0x1671('0x1e')]===_0x1671('0x1f')&&typeof _0x1bd1f4[_0x1671('0x20')]===_0x1671('0x1f');var _0x351f77=_0x156afd[_0x1671('0x21')];var _0x57645b=_0x46678f?0x0:_0x1bd1f4[_0x1671('0x1e')];var _0x13432a=_0x46678f?_0x156afd[_0x1671('0x21')]:_0x1bd1f4[_0x1671('0x1e')]+_0x1bd1f4[_0x1671('0x20')];var _0x4bf69f;if(_0x13432a>=_0x351f77){_0x13432a=_0x351f77;_0x4bf69f=0xc8;}else{_0x4bf69f=0xce;}_0x4e9cfe[_0x1671('0x1c')](_0x4bf69f);return _0x4e9cfe['set']('Content-Range',_0x57645b+'-'+_0x13432a+'/'+_0x351f77)[_0x1671('0x1d')](_0x156afd);}return null;};}function patchUpdates(_0x3010a0){return function(_0x352385){try{jsonpatch['apply'](_0x352385,_0x3010a0,!![]);}catch(_0x500fb6){return BPromise[_0x1671('0x22')](_0x500fb6);}return _0x352385[_0x1671('0x23')]();};}function saveUpdates(_0x5ce188,_0x39b007){return function(_0x2eefbb){if(_0x2eefbb){return _0x2eefbb[_0x1671('0x24')](_0x5ce188)['then'](function(_0x58f471){return _0x58f471;});}return null;};}function removeEntity(_0x5d6958,_0x19643f){return function(_0x5ac5b2){if(_0x5ac5b2){return _0x5ac5b2[_0x1671('0x25')]()[_0x1671('0x26')](function(){_0x5d6958[_0x1671('0x1c')](0xcc)[_0x1671('0x1b')]();});}};}function handleEntityNotFound(_0x4305c2,_0x46846f){return function(_0x50e44a){if(!_0x50e44a){_0x4305c2[_0x1671('0x27')](0x194);}return _0x50e44a;};}function handleError(_0x488f85,_0xe32d5){_0xe32d5=_0xe32d5||0x1f4;return function(_0x20cb71){logger['error'](_0x20cb71['stack']);if(_0x20cb71[_0x1671('0x28')]){delete _0x20cb71[_0x1671('0x28')];}_0x488f85[_0x1671('0x1c')](_0xe32d5)[_0x1671('0x29')](_0x20cb71);};}exports['index']=function(_0x519a6d,_0x651a82){var _0x39c013={},_0x4ca50c={},_0x2bca3f={'count':0x0,'rows':[]};var _0x20f854=_['map'](db[_0x1671('0x2a')][_0x1671('0x2b')],function(_0x3e82cc){return{'name':_0x3e82cc[_0x1671('0x2c')],'type':_0x3e82cc[_0x1671('0x2d')][_0x1671('0x2e')]};});_0x4ca50c[_0x1671('0x2f')]=_['map'](_0x20f854,_0x1671('0x28'));_0x4ca50c[_0x1671('0x30')]=_[_0x1671('0x31')](_0x519a6d[_0x1671('0x30')]);_0x4ca50c[_0x1671('0x32')]=_['intersection'](_0x4ca50c['model'],_0x4ca50c[_0x1671('0x30')]);_0x39c013[_0x1671('0x33')]=_['intersection'](_0x4ca50c[_0x1671('0x2f')],qs[_0x1671('0x34')](_0x519a6d[_0x1671('0x30')]['fields']));_0x39c013['attributes']=_0x39c013[_0x1671('0x33')][_0x1671('0x35')]?_0x39c013[_0x1671('0x33')]:_0x4ca50c['model'];if(!_0x519a6d[_0x1671('0x30')]['hasOwnProperty'](_0x1671('0x36'))){_0x39c013[_0x1671('0x20')]=qs[_0x1671('0x20')](_0x519a6d['query'][_0x1671('0x20')]);_0x39c013[_0x1671('0x1e')]=qs[_0x1671('0x1e')](_0x519a6d['query'][_0x1671('0x1e')]);}_0x39c013['order']=qs[_0x1671('0x37')](_0x519a6d[_0x1671('0x30')][_0x1671('0x37')]);_0x39c013['where']=qs[_0x1671('0x32')](_[_0x1671('0x38')](_0x519a6d['query'],_0x4ca50c[_0x1671('0x32')]),_0x20f854);if(_0x519a6d[_0x1671('0x30')][_0x1671('0x39')]){_0x39c013['where']=_[_0x1671('0x3a')](_0x39c013[_0x1671('0x3b')],{'$or':_[_0x1671('0x3c')](_0x20f854,function(_0x5c3d84){if(_0x5c3d84[_0x1671('0x2d')]!=='VIRTUAL'){var _0x36b5b7={};_0x36b5b7[_0x5c3d84[_0x1671('0x28')]]={'$like':'%'+_0x519a6d[_0x1671('0x30')][_0x1671('0x39')]+'%'};return _0x36b5b7;}})});}_0x39c013=_[_0x1671('0x3a')]({},_0x39c013,_0x519a6d[_0x1671('0x3d')]);var _0x16ca86={'where':_0x39c013['where']};return db[_0x1671('0x2a')][_0x1671('0x21')](_0x16ca86)[_0x1671('0x26')](function(_0x451da2){_0x2bca3f[_0x1671('0x21')]=_0x451da2;if(_0x519a6d['query'][_0x1671('0x3e')]){_0x39c013[_0x1671('0x3f')]=[{'all':!![]}];}return db[_0x1671('0x2a')][_0x1671('0x40')](_0x39c013);})[_0x1671('0x26')](function(_0x54e636){_0x2bca3f['rows']=_0x54e636;return _0x2bca3f;})[_0x1671('0x26')](respondWithFilteredResult(_0x651a82,_0x39c013))[_0x1671('0x41')](handleError(_0x651a82,null));};exports[_0x1671('0x42')]=function(_0x11d657,_0x3eb50c){var _0x57fd5c={'raw':!![],'where':{'id':_0x11d657['params']['id']}},_0x4fca8d={};_0x4fca8d[_0x1671('0x2f')]=_['keys'](db[_0x1671('0x2a')][_0x1671('0x2b')]);_0x4fca8d['query']=_[_0x1671('0x31')](_0x11d657[_0x1671('0x30')]);_0x4fca8d[_0x1671('0x32')]=_[_0x1671('0x43')](_0x4fca8d[_0x1671('0x2f')],_0x4fca8d[_0x1671('0x30')]);_0x57fd5c[_0x1671('0x33')]=_[_0x1671('0x43')](_0x4fca8d[_0x1671('0x2f')],qs[_0x1671('0x34')](_0x11d657[_0x1671('0x30')][_0x1671('0x34')]));_0x57fd5c[_0x1671('0x33')]=_0x57fd5c['attributes'][_0x1671('0x35')]?_0x57fd5c[_0x1671('0x33')]:_0x4fca8d[_0x1671('0x2f')];if(_0x11d657[_0x1671('0x30')]['includeAll']){_0x57fd5c['include']=[{'all':!![]}];}_0x57fd5c=_[_0x1671('0x3a')]({},_0x57fd5c,_0x11d657[_0x1671('0x3d')]);return db[_0x1671('0x2a')][_0x1671('0x44')](_0x57fd5c)['then'](handleEntityNotFound(_0x3eb50c,null))[_0x1671('0x26')](respondWithResult(_0x3eb50c,null))[_0x1671('0x41')](handleError(_0x3eb50c,null));};exports[_0x1671('0x45')]=function(_0x5442ab,_0x5e61bc){return db[_0x1671('0x2a')][_0x1671('0x45')](_0x5442ab[_0x1671('0x46')],{})[_0x1671('0x26')](respondWithResult(_0x5e61bc,0xc9))[_0x1671('0x41')](handleError(_0x5e61bc,null));};exports[_0x1671('0x24')]=function(_0x25de7a,_0x33f20f){if(_0x25de7a[_0x1671('0x46')]['id']){delete _0x25de7a['body']['id'];}return db[_0x1671('0x2a')]['find']({'where':{'id':_0x25de7a[_0x1671('0x47')]['id']}})[_0x1671('0x26')](handleEntityNotFound(_0x33f20f,null))[_0x1671('0x26')](saveUpdates(_0x25de7a[_0x1671('0x46')],null))[_0x1671('0x26')](respondWithResult(_0x33f20f,null))[_0x1671('0x41')](handleError(_0x33f20f,null));};exports[_0x1671('0x25')]=function(_0x134918,_0x47cd7a){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x134918[_0x1671('0x47')]['id']}})[_0x1671('0x26')](handleEntityNotFound(_0x47cd7a,null))[_0x1671('0x26')](removeEntity(_0x47cd7a,null))[_0x1671('0x41')](handleError(_0x47cd7a,null));};exports['describe']=function(_0x59cdf7,_0xdf3493){return db[_0x1671('0x2a')][_0x1671('0x48')]()[_0x1671('0x26')](respondWithResult(_0xdf3493,null))[_0x1671('0x41')](handleError(_0xdf3493,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index c4eb41d..6975782 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 _0x80b8=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x3a63c7,_0x2c6823){var _0xc23462=function(_0x43aca1){while(--_0x43aca1){_0x3a63c7['push'](_0x3a63c7['shift']());}};_0xc23462(++_0x2c6823);}(_0x80b8,0x12b));var _0x880b=function(_0x51f33f,_0x42fecb){_0x51f33f=_0x51f33f-0x0;var _0x377677=_0x80b8[_0x51f33f];return _0x377677;};'use strict';var _=require(_0x880b('0x0'));var util=require(_0x880b('0x1'));var logger=require(_0x880b('0x2'))('api');var moment=require(_0x880b('0x3'));var BPromise=require(_0x880b('0x4'));var rp=require(_0x880b('0x5'));var fs=require('fs');var path=require(_0x880b('0x6'));var rimraf=require(_0x880b('0x7'));var config=require(_0x880b('0x8'));var attributes=require(_0x880b('0x9'));module[_0x880b('0xa')]=function(_0x40ee35,_0x297ff0){return _0x40ee35['define'](_0x880b('0xb'),attributes,{'tableName':_0x880b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5d9=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0x2c741f,_0x60be39){var _0x32c82c=function(_0x4554b1){while(--_0x4554b1){_0x2c741f['push'](_0x2c741f['shift']());}};_0x32c82c(++_0x60be39);}(_0xa5d9,0x65));var _0x9a5d=function(_0x400841,_0x3a6691){_0x400841=_0x400841-0x0;var _0x4ed0d5=_0xa5d9[_0x400841];return _0x4ed0d5;};'use strict';var _=require(_0x9a5d('0x0'));var util=require('util');var logger=require(_0x9a5d('0x1'))(_0x9a5d('0x2'));var moment=require(_0x9a5d('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a5d('0x4'));var fs=require('fs');var path=require(_0x9a5d('0x5'));var rimraf=require('rimraf');var config=require(_0x9a5d('0x6'));var attributes=require(_0x9a5d('0x7'));module['exports']=function(_0x135cf5,_0x4fe6dd){return _0x135cf5[_0x9a5d('0x8')](_0x9a5d('0x9'),attributes,{'tableName':_0x9a5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 6c2b92d..4a342be 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 _0x8d9e=['info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x782071,_0x278cee){var _0x9c7802=function(_0x746de0){while(--_0x746de0){_0x782071['push'](_0x782071['shift']());}};_0x9c7802(++_0x278cee);}(_0x8d9e,0x79));var _0xe8d9=function(_0x456b86,_0x42ca24){_0x456b86=_0x456b86-0x0;var _0x2cd607=_0x8d9e[_0x456b86];return _0x2cd607;};'use strict';var _=require(_0xe8d9('0x0'));var util=require(_0xe8d9('0x1'));var moment=require(_0xe8d9('0x2'));var BPromise=require(_0xe8d9('0x3'));var rs=require(_0xe8d9('0x4'));var fs=require('fs');var Redis=require(_0xe8d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe8d9('0x6'))(_0xe8d9('0x7'));var config=require(_0xe8d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8d9('0x9')][_0xe8d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3db472,_0xf16b80,_0x4703d1){return new BPromise(function(_0x5506ff,_0x3e561e){return client[_0xe8d9('0xb')](_0x3db472,_0x4703d1)['then'](function(_0x48d6f3){logger['info'](_0xe8d9('0xc'),_0xf16b80,'request\x20sent');logger['debug'](_0xe8d9('0xd'),_0xf16b80,_0xe8d9('0xe'),JSON[_0xe8d9('0xf')](_0x48d6f3));if(_0x48d6f3[_0xe8d9('0x10')]){if(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x11')]===0x1f4){logger[_0xe8d9('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xf16b80,_0x48d6f3['error'][_0xe8d9('0x12')]);return _0x3e561e(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x12')]);}logger['error'](_0xe8d9('0xc'),_0xf16b80,_0x48d6f3['error'][_0xe8d9('0x12')]);return _0x5506ff(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x12')]);}else{logger[_0xe8d9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xf16b80,_0xe8d9('0xe'));_0x5506ff(_0x48d6f3['result'][_0xe8d9('0x12')]);}})['catch'](function(_0x2d15fc){logger[_0xe8d9('0x10')](_0xe8d9('0xc'),_0xf16b80,_0x2d15fc);_0x3e561e(_0x2d15fc);});});} \ No newline at end of file +var _0x194b=['code','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x194b,0xae));var _0xb194=function(_0x436f80,_0x41f65d){_0x436f80=_0x436f80-0x0;var _0x5d3772=_0x194b[_0x436f80];return _0x5d3772;};'use strict';var _=require(_0xb194('0x0'));var util=require(_0xb194('0x1'));var moment=require('moment');var BPromise=require(_0xb194('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb194('0x3'));var db=require(_0xb194('0x4'))['db'];var utils=require(_0xb194('0x5'));var logger=require('../../config/logger')(_0xb194('0x6'));var config=require(_0xb194('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb194('0x8')][_0xb194('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x204140,_0x2986db,_0x3a0593){return new BPromise(function(_0x25e58a,_0x188389){return client['request'](_0x204140,_0x3a0593)['then'](function(_0x270ab0){logger[_0xb194('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2986db,_0xb194('0xb'));logger[_0xb194('0xc')](_0xb194('0xd'),_0x2986db,_0xb194('0xb'),JSON[_0xb194('0xe')](_0x270ab0));if(_0x270ab0['error']){if(_0x270ab0['error'][_0xb194('0xf')]===0x1f4){logger[_0xb194('0x10')](_0xb194('0x11'),_0x2986db,_0x270ab0[_0xb194('0x10')][_0xb194('0x12')]);return _0x188389(_0x270ab0['error'][_0xb194('0x12')]);}logger[_0xb194('0x10')](_0xb194('0x11'),_0x2986db,_0x270ab0[_0xb194('0x10')][_0xb194('0x12')]);return _0x25e58a(_0x270ab0[_0xb194('0x10')][_0xb194('0x12')]);}else{logger[_0xb194('0xa')](_0xb194('0x11'),_0x2986db,_0xb194('0xb'));_0x25e58a(_0x270ab0[_0xb194('0x13')]['message']);}})[_0xb194('0x14')](function(_0x104c87){logger[_0xb194('0x10')](_0xb194('0x11'),_0x2986db,_0x104c87);_0x188389(_0x104c87);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 53b9d75..5fb15fb 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 _0xdd0e=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x15a14f,_0x571ecf){var _0x4a893b=function(_0x4d8907){while(--_0x4d8907){_0x15a14f['push'](_0x15a14f['shift']());}};_0x4a893b(++_0x571ecf);}(_0xdd0e,0x1b1));var _0xedd0=function(_0x23ee34,_0x5cfc7d){_0x23ee34=_0x23ee34-0x0;var _0x44093c=_0xdd0e[_0x23ee34];return _0x44093c;};'use strict';var multer=require(_0xedd0('0x0'));var util=require(_0xedd0('0x1'));var path=require(_0xedd0('0x2'));var timeout=require(_0xedd0('0x3'));var express=require('express');var router=express[_0xedd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xedd0('0x5'));var interaction=require(_0xedd0('0x6'));var config=require('../../config/environment');var controller=require(_0xedd0('0x7'));router[_0xedd0('0x8')]('/',auth[_0xedd0('0x9')](),controller[_0xedd0('0xa')]);router[_0xedd0('0x8')](_0xedd0('0xb'),auth['isAuthenticated'](),controller[_0xedd0('0xc')]);router[_0xedd0('0x8')](_0xedd0('0xd'),auth[_0xedd0('0x9')](),controller[_0xedd0('0xe')]);router[_0xedd0('0x8')](_0xedd0('0xf'),auth[_0xedd0('0x9')](),controller[_0xedd0('0x10')]);router['post']('/',auth[_0xedd0('0x9')](),controller['create']);router['put'](_0xedd0('0xd'),auth[_0xedd0('0x9')](),controller['update']);router[_0xedd0('0x11')](_0xedd0('0xd'),auth['isAuthenticated'](),controller[_0xedd0('0x12')]);module[_0xedd0('0x13')]=router; \ No newline at end of file +var _0xa92c=['isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x85b6e1,_0x3d6713){var _0x2c89f4=function(_0x31e722){while(--_0x31e722){_0x85b6e1['push'](_0x85b6e1['shift']());}};_0x2c89f4(++_0x3d6713);}(_0xa92c,0x194));var _0xca92=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xa92c[_0x270adf];return _0x29eda9;};'use strict';var multer=require(_0xca92('0x0'));var util=require(_0xca92('0x1'));var path=require(_0xca92('0x2'));var timeout=require('connect-timeout');var express=require(_0xca92('0x3'));var router=express[_0xca92('0x4')]();var fs_extra=require(_0xca92('0x5'));var auth=require(_0xca92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca92('0x7'));var controller=require(_0xca92('0x8'));router[_0xca92('0x9')]('/',auth[_0xca92('0xa')](),controller[_0xca92('0xb')]);router[_0xca92('0x9')](_0xca92('0xc'),auth[_0xca92('0xa')](),controller[_0xca92('0xd')]);router[_0xca92('0x9')](_0xca92('0xe'),auth[_0xca92('0xa')](),controller[_0xca92('0xf')]);router['get'](_0xca92('0x10'),auth[_0xca92('0xa')](),controller[_0xca92('0x11')]);router[_0xca92('0x12')]('/',auth[_0xca92('0xa')](),controller[_0xca92('0x13')]);router[_0xca92('0x14')](_0xca92('0xe'),auth['isAuthenticated'](),controller[_0xca92('0x15')]);router[_0xca92('0x16')](_0xca92('0xe'),auth['isAuthenticated'](),controller['destroy']);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 b0e9213..ca0ec0a 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 _0x0294=['starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','moment','exports'];(function(_0x2a9250,_0x263508){var _0x1839fe=function(_0x49bd3e){while(--_0x49bd3e){_0x2a9250['push'](_0x2a9250['shift']());}};_0x1839fe(++_0x263508);}(_0x0294,0x15e));var _0x4029=function(_0x73971d,_0x3e675f){_0x73971d=_0x73971d-0x0;var _0x4217fb=_0x0294[_0x73971d];return _0x4217fb;};'use strict';var moment=require(_0x4029('0x0'));var Sequelize=require('sequelize');module[_0x4029('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x40344c){this['setDataValue'](_0x4029('0x2'),_0x40344c);this[_0x4029('0x3')]('endtime',moment()[_0x4029('0x4')](_0x4029('0x5')));}},'endtime':{'type':Sequelize[_0x4029('0x6')]},'membername':{'type':Sequelize[_0x4029('0x7')]},'projectname':{'type':Sequelize[_0x4029('0x7')]},'queue':{'type':Sequelize[_0x4029('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4029('0x7')]},'calleridnum':{'type':Sequelize[_0x4029('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7ed4=['BOOLEAN','sequelize','exports','DATE','setDataValue','endtime','STRING'];(function(_0x30d428,_0x5cd5fd){var _0x2f8a98=function(_0x1362f9){while(--_0x1362f9){_0x30d428['push'](_0x30d428['shift']());}};_0x2f8a98(++_0x5cd5fd);}(_0x7ed4,0xcc));var _0x47ed=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0x7ed4[_0x5c049a];return _0x168e70;};'use strict';var moment=require('moment');var Sequelize=require(_0x47ed('0x0'));module[_0x47ed('0x1')]={'starttime':{'type':Sequelize[_0x47ed('0x2')],'set':function(_0x148388){this[_0x47ed('0x3')]('starttime',_0x148388);this[_0x47ed('0x3')](_0x47ed('0x4'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x47ed('0x5')]},'queue':{'type':Sequelize[_0x47ed('0x5')]},'uniqueid':{'type':Sequelize[_0x47ed('0x5')]},'calleridname':{'type':Sequelize[_0x47ed('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x47ed('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 2d5054b..e5293a8 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 _0x465f=['create','body','find','destroy','describe','findOne','nolimit','SessionId','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','map','JscriptySessionReport','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','catch'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x465f,0x1d1));var _0xf465=function(_0x5ac72f,_0xa0794a){_0x5ac72f=_0x5ac72f-0x0;var _0x1f6d80=_0x465f[_0x5ac72f];return _0x1f6d80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf465('0x0'));var zipdir=require(_0xf465('0x1'));var jsonpatch=require(_0xf465('0x2'));var rp=require('request-promise');var moment=require(_0xf465('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf465('0x4'));var util=require('util');var path=require(_0xf465('0x5'));var sox=require(_0xf465('0x6'));var csv=require('to-csv');var ejs=require(_0xf465('0x7'));var fs=require('fs');var fs_extra=require(_0xf465('0x8'));var _=require(_0xf465('0x9'));var squel=require(_0xf465('0xa'));var crypto=require(_0xf465('0xb'));var jsforce=require(_0xf465('0xc'));var deskjs=require(_0xf465('0xd'));var toCsv=require(_0xf465('0xe'));var querystring=require(_0xf465('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf465('0x10'));var qs=require(_0xf465('0x11'));var as=require(_0xf465('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf465('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf465('0x14'));var licenseUtil=require(_0xf465('0x15'));var db=require(_0xf465('0x16'))['db'];function respondWithStatusCode(_0x26c1c5,_0x268fe3){_0x268fe3=_0x268fe3||0xcc;return function(_0x56410a){if(_0x56410a){return _0x26c1c5[_0xf465('0x17')](_0x268fe3);}return _0x26c1c5['status'](_0x268fe3)[_0xf465('0x18')]();};}function respondWithResult(_0x28cb8a,_0x140ede){_0x140ede=_0x140ede||0xc8;return function(_0xabbee5){if(_0xabbee5){return _0x28cb8a[_0xf465('0x19')](_0x140ede)[_0xf465('0x1a')](_0xabbee5);}};}function respondWithFilteredResult(_0x311e33,_0x205971){return function(_0x582a2c){if(_0x582a2c){var _0x55d6d1=typeof _0x205971[_0xf465('0x1b')]===_0xf465('0x1c')&&typeof _0x205971[_0xf465('0x1d')]===_0xf465('0x1c');var _0x510776=_0x582a2c[_0xf465('0x1e')];var _0x390ee3=_0x55d6d1?0x0:_0x205971[_0xf465('0x1b')];var _0x4c2bdb=_0x55d6d1?_0x582a2c['count']:_0x205971['offset']+_0x205971[_0xf465('0x1d')];var _0x2de862;if(_0x4c2bdb>=_0x510776){_0x4c2bdb=_0x510776;_0x2de862=0xc8;}else{_0x2de862=0xce;}_0x311e33[_0xf465('0x19')](_0x2de862);return _0x311e33[_0xf465('0x1f')](_0xf465('0x20'),_0x390ee3+'-'+_0x4c2bdb+'/'+_0x510776)['json'](_0x582a2c);}return null;};}function patchUpdates(_0x1e226b){return function(_0x12bcc8){try{jsonpatch['apply'](_0x12bcc8,_0x1e226b,!![]);}catch(_0x5585c0){return BPromise[_0xf465('0x21')](_0x5585c0);}return _0x12bcc8[_0xf465('0x22')]();};}function saveUpdates(_0x3f07d0,_0x390778){return function(_0x2daa37){if(_0x2daa37){return _0x2daa37[_0xf465('0x23')](_0x3f07d0)[_0xf465('0x24')](function(_0x176dfc){return _0x176dfc;});}return null;};}function removeEntity(_0x54a161,_0x173ff3){return function(_0x36c9c8){if(_0x36c9c8){return _0x36c9c8['destroy']()[_0xf465('0x24')](function(){_0x54a161['status'](0xcc)[_0xf465('0x18')]();});}};}function handleEntityNotFound(_0x3f1bff,_0x3cde31){return function(_0x175b3a){if(!_0x175b3a){_0x3f1bff[_0xf465('0x17')](0x194);}return _0x175b3a;};}function handleError(_0x50cfed,_0x17d660){_0x17d660=_0x17d660||0x1f4;return function(_0x4dd9e7){logger[_0xf465('0x25')](_0x4dd9e7[_0xf465('0x26')]);if(_0x4dd9e7['name']){delete _0x4dd9e7[_0xf465('0x27')];}_0x50cfed[_0xf465('0x19')](_0x17d660)['send'](_0x4dd9e7);};}exports['index']=function(_0x3cf795,_0x310756){var _0xca7df2={},_0x24c3c7={},_0x28d281={'count':0x0,'rows':[]};var _0x4beb7b=_[_0xf465('0x28')](db[_0xf465('0x29')]['rawAttributes'],function(_0x552f11){return{'name':_0x552f11['fieldName'],'type':_0x552f11['type'][_0xf465('0x2a')]};});_0x24c3c7[_0xf465('0x2b')]=_['map'](_0x4beb7b,_0xf465('0x27'));_0x24c3c7[_0xf465('0x2c')]=_[_0xf465('0x2d')](_0x3cf795[_0xf465('0x2c')]);_0x24c3c7[_0xf465('0x2e')]=_[_0xf465('0x2f')](_0x24c3c7['model'],_0x24c3c7['query']);_0xca7df2['attributes']=_[_0xf465('0x2f')](_0x24c3c7[_0xf465('0x2b')],qs['fields'](_0x3cf795[_0xf465('0x2c')][_0xf465('0x30')]));_0xca7df2[_0xf465('0x31')]=_0xca7df2[_0xf465('0x31')][_0xf465('0x32')]?_0xca7df2[_0xf465('0x31')]:_0x24c3c7[_0xf465('0x2b')];if(!_0x3cf795['query'][_0xf465('0x33')]('nolimit')){_0xca7df2[_0xf465('0x1d')]=qs[_0xf465('0x1d')](_0x3cf795[_0xf465('0x2c')][_0xf465('0x1d')]);_0xca7df2[_0xf465('0x1b')]=qs[_0xf465('0x1b')](_0x3cf795[_0xf465('0x2c')][_0xf465('0x1b')]);}_0xca7df2[_0xf465('0x34')]=qs[_0xf465('0x35')](_0x3cf795['query'][_0xf465('0x35')]);_0xca7df2[_0xf465('0x36')]=qs[_0xf465('0x2e')](_['pick'](_0x3cf795['query'],_0x24c3c7[_0xf465('0x2e')]),_0x4beb7b);if(_0x3cf795[_0xf465('0x2c')][_0xf465('0x37')]){_0xca7df2['where']=_[_0xf465('0x38')](_0xca7df2[_0xf465('0x36')],{'$or':_[_0xf465('0x28')](_0x4beb7b,function(_0x1a8ada){if(_0x1a8ada['type']!==_0xf465('0x39')){var _0x53f50a={};_0x53f50a[_0x1a8ada[_0xf465('0x27')]]={'$like':'%'+_0x3cf795[_0xf465('0x2c')][_0xf465('0x37')]+'%'};return _0x53f50a;}})});}_0xca7df2=_[_0xf465('0x38')]({},_0xca7df2,_0x3cf795['options']);var _0x457d67={'where':_0xca7df2[_0xf465('0x36')]};return db['JscriptySessionReport'][_0xf465('0x1e')](_0x457d67)[_0xf465('0x24')](function(_0x58ac43){_0x28d281[_0xf465('0x1e')]=_0x58ac43;if(_0x3cf795[_0xf465('0x2c')][_0xf465('0x3a')]){_0xca7df2[_0xf465('0x3b')]=[{'all':!![]}];}return db[_0xf465('0x29')][_0xf465('0x3c')](_0xca7df2);})[_0xf465('0x24')](function(_0x27e320){_0x28d281[_0xf465('0x3d')]=_0x27e320;return _0x28d281;})['then'](respondWithFilteredResult(_0x310756,_0xca7df2))['catch'](handleError(_0x310756,null));};exports[_0xf465('0x3e')]=function(_0x43a0ab,_0x2e23df){var _0x40913e={'raw':!![],'where':{'id':_0x43a0ab[_0xf465('0x3f')]['id']}},_0x38db84={};_0x38db84['model']=_[_0xf465('0x2d')](db[_0xf465('0x29')][_0xf465('0x40')]);_0x38db84['query']=_['keys'](_0x43a0ab['query']);_0x38db84[_0xf465('0x2e')]=_['intersection'](_0x38db84['model'],_0x38db84[_0xf465('0x2c')]);_0x40913e[_0xf465('0x31')]=_['intersection'](_0x38db84[_0xf465('0x2b')],qs[_0xf465('0x30')](_0x43a0ab[_0xf465('0x2c')]['fields']));_0x40913e[_0xf465('0x31')]=_0x40913e[_0xf465('0x31')]['length']?_0x40913e[_0xf465('0x31')]:_0x38db84[_0xf465('0x2b')];if(_0x43a0ab[_0xf465('0x2c')][_0xf465('0x3a')]){_0x40913e[_0xf465('0x3b')]=[{'all':!![]}];}_0x40913e=_[_0xf465('0x38')]({},_0x40913e,_0x43a0ab[_0xf465('0x41')]);return db[_0xf465('0x29')]['find'](_0x40913e)['then'](handleEntityNotFound(_0x2e23df,null))['then'](respondWithResult(_0x2e23df,null))[_0xf465('0x42')](handleError(_0x2e23df,null));};exports[_0xf465('0x43')]=function(_0x1c6d9e,_0x47c427){return db['JscriptySessionReport'][_0xf465('0x43')](_0x1c6d9e['body'],{})[_0xf465('0x24')](respondWithResult(_0x47c427,0xc9))['catch'](handleError(_0x47c427,null));};exports[_0xf465('0x23')]=function(_0x5b3b7a,_0x13a9de){if(_0x5b3b7a[_0xf465('0x44')]['id']){delete _0x5b3b7a[_0xf465('0x44')]['id'];}return db[_0xf465('0x29')][_0xf465('0x45')]({'where':{'id':_0x5b3b7a[_0xf465('0x3f')]['id']}})['then'](handleEntityNotFound(_0x13a9de,null))[_0xf465('0x24')](saveUpdates(_0x5b3b7a[_0xf465('0x44')],null))[_0xf465('0x24')](respondWithResult(_0x13a9de,null))['catch'](handleError(_0x13a9de,null));};exports[_0xf465('0x46')]=function(_0x34adbe,_0x46633e){return db[_0xf465('0x29')][_0xf465('0x45')]({'where':{'id':_0x34adbe[_0xf465('0x3f')]['id']}})['then'](handleEntityNotFound(_0x46633e,null))['then'](removeEntity(_0x46633e,null))[_0xf465('0x42')](handleError(_0x46633e,null));};exports[_0xf465('0x47')]=function(_0x26bed9,_0x42c67d){return db[_0xf465('0x29')][_0xf465('0x47')]()[_0xf465('0x24')](respondWithResult(_0x42c67d,null))['catch'](handleError(_0x42c67d,null));};exports['getQuestions']=function(_0x515559,_0x76e0fa,_0xb8828a){var _0x425004={'raw':!![],'where':{}};var _0x3ca845={};var _0xa2a855={'count':0x0,'rows':[]};return db[_0xf465('0x29')][_0xf465('0x48')]({'where':{'id':_0x515559[_0xf465('0x3f')]['id']}})['then'](handleEntityNotFound(_0x76e0fa,null))[_0xf465('0x24')](function(_0xdfa0b0){if(_0xdfa0b0){_0x3ca845[_0xf465('0x2b')]=_[_0xf465('0x2d')](db['JscriptyQuestionReport'][_0xf465('0x40')]);_0x3ca845[_0xf465('0x2c')]=_['keys'](_0x515559[_0xf465('0x2c')]);_0x3ca845[_0xf465('0x2e')]=_[_0xf465('0x2f')](_0x3ca845[_0xf465('0x2b')],_0x3ca845[_0xf465('0x2c')]);_0x425004[_0xf465('0x31')]=_['intersection'](_0x3ca845['model'],qs['fields'](_0x515559[_0xf465('0x2c')][_0xf465('0x30')]));_0x425004['attributes']=_0x425004[_0xf465('0x31')][_0xf465('0x32')]?_0x425004['attributes']:_0x3ca845['model'];if(!_0x515559['query'][_0xf465('0x33')](_0xf465('0x49'))){_0x425004[_0xf465('0x1d')]=qs['limit'](_0x515559[_0xf465('0x2c')]['limit']);_0x425004[_0xf465('0x1b')]=qs[_0xf465('0x1b')](_0x515559[_0xf465('0x2c')][_0xf465('0x1b')]);}_0x425004['order']=qs[_0xf465('0x35')](_0x515559[_0xf465('0x2c')][_0xf465('0x35')]);_0x425004[_0xf465('0x36')]=qs[_0xf465('0x2e')](_['pick'](_0x515559[_0xf465('0x2c')],_0x3ca845['filters']));_0x425004[_0xf465('0x36')][_0xf465('0x4a')]=_0xdfa0b0['id'];if(_0x515559[_0xf465('0x2c')][_0xf465('0x37')]){_0x425004[_0xf465('0x36')]=_[_0xf465('0x38')](_0x425004[_0xf465('0x36')],{'$or':_[_0xf465('0x28')](_0x425004[_0xf465('0x31')],function(_0x5ac71e){var _0x24cfb0={};_0x24cfb0[_0x5ac71e]={'$like':'%'+_0x515559[_0xf465('0x2c')][_0xf465('0x37')]+'%'};return _0x24cfb0;})});}_0x425004=_[_0xf465('0x38')]({},_0x425004,_0x515559[_0xf465('0x41')]);return db[_0xf465('0x4b')]['count']({'where':_0x425004[_0xf465('0x36')]})[_0xf465('0x24')](function(_0x5a766d){_0xa2a855[_0xf465('0x1e')]=_0x5a766d;if(_0x515559[_0xf465('0x2c')][_0xf465('0x3a')]){_0x425004['include']=[{'all':!![]}];}return db[_0xf465('0x4b')]['findAll'](_0x425004);})[_0xf465('0x24')](function(_0x4f016f){_0xa2a855[_0xf465('0x3d')]=_0x4f016f;return _0xa2a855;});}})[_0xf465('0x24')](respondWithFilteredResult(_0x76e0fa,_0x425004))['catch'](handleError(_0x76e0fa,null));}; \ No newline at end of file +var _0xbf50=['zip-dir','fast-json-patch','request-promise','util','path','to-csv','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','rows','catch','show','include','find','body','params','describe','getQuestions','keys','JscriptyQuestionReport','SessionId','findAll'];(function(_0x115d91,_0x1a986d){var _0x4dd253=function(_0x117856){while(--_0x117856){_0x115d91['push'](_0x115d91['shift']());}};_0x4dd253(++_0x1a986d);}(_0xbf50,0x90));var _0x0bf5=function(_0x19258b,_0x22e850){_0x19258b=_0x19258b-0x0;var _0x5be66a=_0xbf50[_0x19258b];return _0x5be66a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bf5('0x0'));var jsonpatch=require(_0x0bf5('0x1'));var rp=require(_0x0bf5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0bf5('0x3'));var path=require(_0x0bf5('0x4'));var sox=require('sox');var csv=require(_0x0bf5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bf5('0x6'));var deskjs=require(_0x0bf5('0x7'));var toCsv=require(_0x0bf5('0x5'));var querystring=require(_0x0bf5('0x8'));var Papa=require(_0x0bf5('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bf5('0xa'));var hardwareService=require(_0x0bf5('0xb'));var logger=require(_0x0bf5('0xc'))(_0x0bf5('0xd'));var utils=require(_0x0bf5('0xe'));var config=require(_0x0bf5('0xf'));var licenseUtil=require(_0x0bf5('0x10'));var db=require(_0x0bf5('0x11'))['db'];function respondWithStatusCode(_0x452794,_0x4f6037){_0x4f6037=_0x4f6037||0xcc;return function(_0x293ed5){if(_0x293ed5){return _0x452794[_0x0bf5('0x12')](_0x4f6037);}return _0x452794[_0x0bf5('0x13')](_0x4f6037)['end']();};}function respondWithResult(_0x3ace20,_0x5beaa4){_0x5beaa4=_0x5beaa4||0xc8;return function(_0x1ba899){if(_0x1ba899){return _0x3ace20['status'](_0x5beaa4)[_0x0bf5('0x14')](_0x1ba899);}};}function respondWithFilteredResult(_0x26756c,_0x4945bd){return function(_0x455bdb){if(_0x455bdb){var _0x2411c4=typeof _0x4945bd[_0x0bf5('0x15')]===_0x0bf5('0x16')&&typeof _0x4945bd[_0x0bf5('0x17')]==='undefined';var _0x2016be=_0x455bdb[_0x0bf5('0x18')];var _0x2345ce=_0x2411c4?0x0:_0x4945bd[_0x0bf5('0x15')];var _0x34038f=_0x2411c4?_0x455bdb[_0x0bf5('0x18')]:_0x4945bd[_0x0bf5('0x15')]+_0x4945bd[_0x0bf5('0x17')];var _0x4be0be;if(_0x34038f>=_0x2016be){_0x34038f=_0x2016be;_0x4be0be=0xc8;}else{_0x4be0be=0xce;}_0x26756c[_0x0bf5('0x13')](_0x4be0be);return _0x26756c[_0x0bf5('0x19')]('Content-Range',_0x2345ce+'-'+_0x34038f+'/'+_0x2016be)[_0x0bf5('0x14')](_0x455bdb);}return null;};}function patchUpdates(_0x54b024){return function(_0x1c4fbb){try{jsonpatch[_0x0bf5('0x1a')](_0x1c4fbb,_0x54b024,!![]);}catch(_0x4e06ea){return BPromise['reject'](_0x4e06ea);}return _0x1c4fbb[_0x0bf5('0x1b')]();};}function saveUpdates(_0x557e6a,_0x1a2ac4){return function(_0xd06fb0){if(_0xd06fb0){return _0xd06fb0[_0x0bf5('0x1c')](_0x557e6a)[_0x0bf5('0x1d')](function(_0x350477){return _0x350477;});}return null;};}function removeEntity(_0x4da5f5,_0x4c01cf){return function(_0x240ed9){if(_0x240ed9){return _0x240ed9[_0x0bf5('0x1e')]()[_0x0bf5('0x1d')](function(){_0x4da5f5[_0x0bf5('0x13')](0xcc)[_0x0bf5('0x1f')]();});}};}function handleEntityNotFound(_0x531305,_0xc51cf){return function(_0x4fae40){if(!_0x4fae40){_0x531305[_0x0bf5('0x12')](0x194);}return _0x4fae40;};}function handleError(_0xf34bf3,_0x1e55b9){_0x1e55b9=_0x1e55b9||0x1f4;return function(_0x7501e4){logger[_0x0bf5('0x20')](_0x7501e4[_0x0bf5('0x21')]);if(_0x7501e4[_0x0bf5('0x22')]){delete _0x7501e4[_0x0bf5('0x22')];}_0xf34bf3[_0x0bf5('0x13')](_0x1e55b9)[_0x0bf5('0x23')](_0x7501e4);};}exports[_0x0bf5('0x24')]=function(_0xca8ec8,_0x263752){var _0x3bfcba={},_0x225463={},_0x45a805={'count':0x0,'rows':[]};var _0x4a0156=_[_0x0bf5('0x25')](db['JscriptySessionReport'][_0x0bf5('0x26')],function(_0x8a757f){return{'name':_0x8a757f[_0x0bf5('0x27')],'type':_0x8a757f[_0x0bf5('0x28')]['key']};});_0x225463[_0x0bf5('0x29')]=_['map'](_0x4a0156,_0x0bf5('0x22'));_0x225463['query']=_['keys'](_0xca8ec8['query']);_0x225463['filters']=_[_0x0bf5('0x2a')](_0x225463[_0x0bf5('0x29')],_0x225463['query']);_0x3bfcba[_0x0bf5('0x2b')]=_['intersection'](_0x225463[_0x0bf5('0x29')],qs[_0x0bf5('0x2c')](_0xca8ec8[_0x0bf5('0x2d')]['fields']));_0x3bfcba[_0x0bf5('0x2b')]=_0x3bfcba[_0x0bf5('0x2b')][_0x0bf5('0x2e')]?_0x3bfcba[_0x0bf5('0x2b')]:_0x225463[_0x0bf5('0x29')];if(!_0xca8ec8['query'][_0x0bf5('0x2f')](_0x0bf5('0x30'))){_0x3bfcba[_0x0bf5('0x17')]=qs[_0x0bf5('0x17')](_0xca8ec8['query'][_0x0bf5('0x17')]);_0x3bfcba['offset']=qs[_0x0bf5('0x15')](_0xca8ec8[_0x0bf5('0x2d')][_0x0bf5('0x15')]);}_0x3bfcba['order']=qs[_0x0bf5('0x31')](_0xca8ec8[_0x0bf5('0x2d')]['sort']);_0x3bfcba[_0x0bf5('0x32')]=qs['filters'](_[_0x0bf5('0x33')](_0xca8ec8['query'],_0x225463[_0x0bf5('0x34')]),_0x4a0156);if(_0xca8ec8[_0x0bf5('0x2d')][_0x0bf5('0x35')]){_0x3bfcba[_0x0bf5('0x32')]=_[_0x0bf5('0x36')](_0x3bfcba[_0x0bf5('0x32')],{'$or':_[_0x0bf5('0x25')](_0x4a0156,function(_0x3c597b){if(_0x3c597b[_0x0bf5('0x28')]!==_0x0bf5('0x37')){var _0x1a818c={};_0x1a818c[_0x3c597b['name']]={'$like':'%'+_0xca8ec8[_0x0bf5('0x2d')][_0x0bf5('0x35')]+'%'};return _0x1a818c;}})});}_0x3bfcba=_['merge']({},_0x3bfcba,_0xca8ec8[_0x0bf5('0x38')]);var _0x92e255={'where':_0x3bfcba[_0x0bf5('0x32')]};return db[_0x0bf5('0x39')]['count'](_0x92e255)[_0x0bf5('0x1d')](function(_0x169d78){_0x45a805['count']=_0x169d78;if(_0xca8ec8[_0x0bf5('0x2d')][_0x0bf5('0x3a')]){_0x3bfcba['include']=[{'all':!![]}];}return db[_0x0bf5('0x39')]['findAll'](_0x3bfcba);})['then'](function(_0x4d2881){_0x45a805[_0x0bf5('0x3b')]=_0x4d2881;return _0x45a805;})[_0x0bf5('0x1d')](respondWithFilteredResult(_0x263752,_0x3bfcba))[_0x0bf5('0x3c')](handleError(_0x263752,null));};exports[_0x0bf5('0x3d')]=function(_0x39cf78,_0x514170){var _0x2fff99={'raw':!![],'where':{'id':_0x39cf78['params']['id']}},_0x2683a3={};_0x2683a3['model']=_['keys'](db[_0x0bf5('0x39')][_0x0bf5('0x26')]);_0x2683a3[_0x0bf5('0x2d')]=_['keys'](_0x39cf78['query']);_0x2683a3[_0x0bf5('0x34')]=_[_0x0bf5('0x2a')](_0x2683a3['model'],_0x2683a3[_0x0bf5('0x2d')]);_0x2fff99[_0x0bf5('0x2b')]=_['intersection'](_0x2683a3[_0x0bf5('0x29')],qs[_0x0bf5('0x2c')](_0x39cf78[_0x0bf5('0x2d')][_0x0bf5('0x2c')]));_0x2fff99[_0x0bf5('0x2b')]=_0x2fff99[_0x0bf5('0x2b')]['length']?_0x2fff99[_0x0bf5('0x2b')]:_0x2683a3[_0x0bf5('0x29')];if(_0x39cf78[_0x0bf5('0x2d')]['includeAll']){_0x2fff99[_0x0bf5('0x3e')]=[{'all':!![]}];}_0x2fff99=_['merge']({},_0x2fff99,_0x39cf78[_0x0bf5('0x38')]);return db[_0x0bf5('0x39')][_0x0bf5('0x3f')](_0x2fff99)['then'](handleEntityNotFound(_0x514170,null))[_0x0bf5('0x1d')](respondWithResult(_0x514170,null))[_0x0bf5('0x3c')](handleError(_0x514170,null));};exports['create']=function(_0xe4a931,_0x5c7a7d){return db[_0x0bf5('0x39')]['create'](_0xe4a931['body'],{})[_0x0bf5('0x1d')](respondWithResult(_0x5c7a7d,0xc9))[_0x0bf5('0x3c')](handleError(_0x5c7a7d,null));};exports[_0x0bf5('0x1c')]=function(_0x419853,_0x31750d){if(_0x419853[_0x0bf5('0x40')]['id']){delete _0x419853[_0x0bf5('0x40')]['id'];}return db[_0x0bf5('0x39')][_0x0bf5('0x3f')]({'where':{'id':_0x419853[_0x0bf5('0x41')]['id']}})['then'](handleEntityNotFound(_0x31750d,null))[_0x0bf5('0x1d')](saveUpdates(_0x419853[_0x0bf5('0x40')],null))[_0x0bf5('0x1d')](respondWithResult(_0x31750d,null))['catch'](handleError(_0x31750d,null));};exports[_0x0bf5('0x1e')]=function(_0x2dbca0,_0x443200){return db['JscriptySessionReport'][_0x0bf5('0x3f')]({'where':{'id':_0x2dbca0[_0x0bf5('0x41')]['id']}})[_0x0bf5('0x1d')](handleEntityNotFound(_0x443200,null))[_0x0bf5('0x1d')](removeEntity(_0x443200,null))[_0x0bf5('0x3c')](handleError(_0x443200,null));};exports[_0x0bf5('0x42')]=function(_0x59036c,_0x40a717){return db[_0x0bf5('0x39')][_0x0bf5('0x42')]()[_0x0bf5('0x1d')](respondWithResult(_0x40a717,null))[_0x0bf5('0x3c')](handleError(_0x40a717,null));};exports[_0x0bf5('0x43')]=function(_0x5991b5,_0x424887,_0x1c27b6){var _0xbda5e={'raw':!![],'where':{}};var _0x2ef6ef={};var _0x2631d6={'count':0x0,'rows':[]};return db[_0x0bf5('0x39')]['findOne']({'where':{'id':_0x5991b5['params']['id']}})['then'](handleEntityNotFound(_0x424887,null))[_0x0bf5('0x1d')](function(_0xa5edef){if(_0xa5edef){_0x2ef6ef[_0x0bf5('0x29')]=_[_0x0bf5('0x44')](db[_0x0bf5('0x45')][_0x0bf5('0x26')]);_0x2ef6ef['query']=_[_0x0bf5('0x44')](_0x5991b5['query']);_0x2ef6ef[_0x0bf5('0x34')]=_['intersection'](_0x2ef6ef['model'],_0x2ef6ef[_0x0bf5('0x2d')]);_0xbda5e[_0x0bf5('0x2b')]=_[_0x0bf5('0x2a')](_0x2ef6ef[_0x0bf5('0x29')],qs[_0x0bf5('0x2c')](_0x5991b5[_0x0bf5('0x2d')]['fields']));_0xbda5e[_0x0bf5('0x2b')]=_0xbda5e[_0x0bf5('0x2b')]['length']?_0xbda5e[_0x0bf5('0x2b')]:_0x2ef6ef[_0x0bf5('0x29')];if(!_0x5991b5[_0x0bf5('0x2d')]['hasOwnProperty'](_0x0bf5('0x30'))){_0xbda5e[_0x0bf5('0x17')]=qs[_0x0bf5('0x17')](_0x5991b5['query'][_0x0bf5('0x17')]);_0xbda5e[_0x0bf5('0x15')]=qs[_0x0bf5('0x15')](_0x5991b5[_0x0bf5('0x2d')][_0x0bf5('0x15')]);}_0xbda5e['order']=qs['sort'](_0x5991b5[_0x0bf5('0x2d')][_0x0bf5('0x31')]);_0xbda5e[_0x0bf5('0x32')]=qs[_0x0bf5('0x34')](_[_0x0bf5('0x33')](_0x5991b5[_0x0bf5('0x2d')],_0x2ef6ef[_0x0bf5('0x34')]));_0xbda5e[_0x0bf5('0x32')][_0x0bf5('0x46')]=_0xa5edef['id'];if(_0x5991b5[_0x0bf5('0x2d')][_0x0bf5('0x35')]){_0xbda5e[_0x0bf5('0x32')]=_[_0x0bf5('0x36')](_0xbda5e['where'],{'$or':_[_0x0bf5('0x25')](_0xbda5e['attributes'],function(_0x4c6b9f){var _0x13bcac={};_0x13bcac[_0x4c6b9f]={'$like':'%'+_0x5991b5[_0x0bf5('0x2d')][_0x0bf5('0x35')]+'%'};return _0x13bcac;})});}_0xbda5e=_[_0x0bf5('0x36')]({},_0xbda5e,_0x5991b5[_0x0bf5('0x38')]);return db['JscriptyQuestionReport']['count']({'where':_0xbda5e[_0x0bf5('0x32')]})['then'](function(_0x3628de){_0x2631d6['count']=_0x3628de;if(_0x5991b5[_0x0bf5('0x2d')][_0x0bf5('0x3a')]){_0xbda5e[_0x0bf5('0x3e')]=[{'all':!![]}];}return db[_0x0bf5('0x45')][_0x0bf5('0x47')](_0xbda5e);})[_0x0bf5('0x1d')](function(_0x277a3b){_0x2631d6[_0x0bf5('0x3b')]=_0x277a3b;return _0x2631d6;});}})['then'](respondWithFilteredResult(_0x424887,_0xbda5e))[_0x0bf5('0x3c')](handleError(_0x424887,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index caa5eda..d11a781 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 _0x9fd4=['rimraf','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x2d42e7,_0x5992d1){_0x2d42e7=_0x2d42e7-0x0;var _0x3de4e6=_0x9fd4[_0x2d42e7];return _0x3de4e6;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var BPromise=require(_0x49fd('0x5'));var rp=require(_0x49fd('0x6'));var fs=require('fs');var path=require(_0x49fd('0x7'));var rimraf=require(_0x49fd('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x49fd('0x9')]=function(_0x42fdc7,_0x1bc16e){return _0x42fdc7[_0x49fd('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x49fd('0xb'),'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5075,0x73));var _0x5507=function(_0x1612d6,_0x5577bf){_0x1612d6=_0x1612d6-0x0;var _0x27a583=_0x5075[_0x1612d6];return _0x27a583;};'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 9b7ed90..bfd1b35 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 _0x4bd3=['request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x28781a,_0x21d586){var _0x7a2c47=function(_0x2c0232){while(--_0x2c0232){_0x28781a['push'](_0x28781a['shift']());}};_0x7a2c47(++_0x21d586);}(_0x4bd3,0x174));var _0x34bd=function(_0x2a457a,_0x1d3207){_0x2a457a=_0x2a457a-0x0;var _0x34531e=_0x4bd3[_0x2a457a];return _0x34531e;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('JscriptySessionReport,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});} \ No newline at end of file +var _0x2da6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x2da6,0x1dd));var _0x62da=function(_0x347df9,_0x2c474a){_0x347df9=_0x347df9-0x0;var _0x59227c=_0x2da6[_0x347df9];return _0x59227c;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 685aed1..a73878c 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 _0x1de4=['./license.controller','index','put','/:id','isAuthenticated','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x47d483,_0xb9683){var _0x580869=function(_0x54e83f){while(--_0x54e83f){_0x47d483['push'](_0x47d483['shift']());}};_0x580869(++_0xb9683);}(_0x1de4,0x94));var _0x41de=function(_0xcf6b84,_0x380ac5){_0xcf6b84=_0xcf6b84-0x0;var _0x5cf7d0=_0x1de4[_0xcf6b84];return _0x5cf7d0;};'use strict';var multer=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var path=require(_0x41de('0x2'));var timeout=require(_0x41de('0x3'));var express=require('express');var router=express[_0x41de('0x4')]();var fs_extra=require(_0x41de('0x5'));var auth=require(_0x41de('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x41de('0x7'));var controller=require(_0x41de('0x8'));router['get']('/',controller[_0x41de('0x9')]);router[_0x41de('0xa')](_0x41de('0xb'),auth[_0x41de('0xc')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xc818=['/:id','isAuthenticated','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put'];(function(_0x304320,_0x232a69){var _0xe607da=function(_0x2eb451){while(--_0x2eb451){_0x304320['push'](_0x304320['shift']());}};_0xe607da(++_0x232a69);}(_0xc818,0x1e3));var _0x8c81=function(_0xbbba1b,_0x5400d0){_0xbbba1b=_0xbbba1b-0x0;var _0x3d8a0f=_0xc818[_0xbbba1b];return _0x3d8a0f;};'use strict';var multer=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var path=require(_0x8c81('0x2'));var timeout=require(_0x8c81('0x3'));var express=require('express');var router=express[_0x8c81('0x4')]();var fs_extra=require(_0x8c81('0x5'));var auth=require(_0x8c81('0x6'));var interaction=require(_0x8c81('0x7'));var config=require(_0x8c81('0x8'));var controller=require(_0x8c81('0x9'));router[_0x8c81('0xa')]('/',controller['index']);router[_0x8c81('0xb')](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller[_0x8c81('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 1a7a051..49de4f7 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 _0xbd26=['INTEGER','sequelize','TEXT'];(function(_0x44b4fe,_0x5e9b20){var _0x4b4603=function(_0x127362){while(--_0x127362){_0x44b4fe['push'](_0x44b4fe['shift']());}};_0x4b4603(++_0x5e9b20);}(_0xbd26,0xeb));var _0x6bd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd26[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6bd2('0x0'));module['exports']={'license':{'type':Sequelize[_0x6bd2('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x6bd2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbc99=['TEXT','STRING','INTEGER','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc99,0x1eb));var _0x9bc9=function(_0x4ce45f,_0x124532){_0x4ce45f=_0x4ce45f-0x0;var _0x2debde=_0xbc99[_0x4ce45f];return _0x2debde;};'use strict';var Sequelize=require('sequelize');module[_0x9bc9('0x0')]={'license':{'type':Sequelize[_0x9bc9('0x1')]},'data1':{'type':Sequelize[_0x9bc9('0x2')]},'data2':{'type':Sequelize[_0x9bc9('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x9bc9('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 9d3f8bb..c2f01cf 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x1e69af,_0x17b675){var _0x34f6c4=function(_0x2762b5){while(--_0x2762b5){_0x1e69af['push'](_0x1e69af['shift']());}};_0x34f6c4(++_0x17b675);}(_0x1967,0x173));var _0x7196=function(_0x70cfcc,_0x1dcb97){_0x70cfcc=_0x70cfcc-0x0;var _0x4dc639=_0x1967[_0x70cfcc];return _0x4dc639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file +var _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3f61fe,_0x1dd377){var _0x5be55e=function(_0x43db45){while(--_0x43db45){_0x3f61fe['push'](_0x3f61fe['shift']());}};_0x5be55e(++_0x1dd377);}(_0xabce,0x103));var _0xeabc=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xabce[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e5aa831..865d82a 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 _0x1635=['rimraf','./license.attributes','exports','lodash','api','moment','request-promise','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1635,0x14b));var _0x5163=function(_0x47487e,_0x4efc25){_0x47487e=_0x47487e-0x0;var _0x459102=_0x1635[_0x47487e];return _0x459102;};'use strict';var _=require(_0x5163('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5163('0x1'));var moment=require(_0x5163('0x2'));var BPromise=require('bluebird');var rp=require(_0x5163('0x3'));var fs=require('fs');var path=require(_0x5163('0x4'));var rimraf=require(_0x5163('0x5'));var config=require('../../config/environment');var attributes=require(_0x5163('0x6'));module[_0x5163('0x7')]=function(_0x3a5042,_0x570f3c){return _0x3a5042['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cd2=['License','license','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0xc19a5d,_0x28a4e8){var _0x4ac37a=function(_0x30481c){while(--_0x30481c){_0xc19a5d['push'](_0xc19a5d['shift']());}};_0x4ac37a(++_0x28a4e8);}(_0x2cd2,0x147));var _0x22cd=function(_0x49fcf1,_0x33fbaf){_0x49fcf1=_0x49fcf1-0x0;var _0x447c21=_0x2cd2[_0x49fcf1];return _0x447c21;};'use strict';var _=require(_0x22cd('0x0'));var util=require(_0x22cd('0x1'));var logger=require(_0x22cd('0x2'))(_0x22cd('0x3'));var moment=require(_0x22cd('0x4'));var BPromise=require('bluebird');var rp=require(_0x22cd('0x5'));var fs=require('fs');var path=require(_0x22cd('0x6'));var rimraf=require(_0x22cd('0x7'));var config=require(_0x22cd('0x8'));var attributes=require(_0x22cd('0x9'));module[_0x22cd('0xa')]=function(_0x5117db,_0x39d5f5){return _0x5117db['define'](_0x22cd('0xb'),attributes,{'tableName':_0x22cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index bedfa61..e670318 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 _0x4fc8=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x42655b,_0x46e45b){var _0x12be12=function(_0x53444b){while(--_0x53444b){_0x42655b['push'](_0x42655b['shift']());}};_0x12be12(++_0x46e45b);}(_0x4fc8,0x1bc));var _0x84fc=function(_0x266270,_0x1e16ce){_0x266270=_0x266270-0x0;var _0x3ec561=_0x4fc8[_0x266270];return _0x3ec561;};'use strict';var _=require(_0x84fc('0x0'));var util=require(_0x84fc('0x1'));var moment=require(_0x84fc('0x2'));var BPromise=require(_0x84fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84fc('0x4'));var db=require(_0x84fc('0x5'))['db'];var utils=require(_0x84fc('0x6'));var logger=require('../../config/logger')(_0x84fc('0x7'));var config=require(_0x84fc('0x8'));var jayson=require(_0x84fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcda,_0x4fa111,_0x1f5230){return new BPromise(function(_0x46b43f,_0x4752cc){return client[_0x84fc('0xa')](_0x25fcda,_0x1f5230)[_0x84fc('0xb')](function(_0x71e22){logger[_0x84fc('0xc')](_0x84fc('0xd'),_0x4fa111,_0x84fc('0xe'));logger[_0x84fc('0xf')](_0x84fc('0x10'),_0x4fa111,_0x84fc('0xe'),JSON['stringify'](_0x71e22));if(_0x71e22[_0x84fc('0x11')]){if(_0x71e22[_0x84fc('0x11')][_0x84fc('0x12')]===0x1f4){logger[_0x84fc('0x11')](_0x84fc('0xd'),_0x4fa111,_0x71e22['error'][_0x84fc('0x13')]);return _0x4752cc(_0x71e22['error'][_0x84fc('0x13')]);}logger[_0x84fc('0x11')](_0x84fc('0xd'),_0x4fa111,_0x71e22['error'][_0x84fc('0x13')]);return _0x46b43f(_0x71e22[_0x84fc('0x11')][_0x84fc('0x13')]);}else{logger[_0x84fc('0xc')](_0x84fc('0xd'),_0x4fa111,_0x84fc('0xe'));_0x46b43f(_0x71e22[_0x84fc('0x14')][_0x84fc('0x13')]);}})[_0x84fc('0x15')](function(_0x5c6486){logger['error'](_0x84fc('0xd'),_0x4fa111,_0x5c6486);_0x4752cc(_0x5c6486);});});} \ No newline at end of file +var _0x3c98=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1a9ca4,_0x5115db){var _0x19a2c2=function(_0x13a68f){while(--_0x13a68f){_0x1a9ca4['push'](_0x1a9ca4['shift']());}};_0x19a2c2(++_0x5115db);}(_0x3c98,0x1d2));var _0x83c9=function(_0x2964d7,_0x373991){_0x2964d7=_0x2964d7-0x0;var _0x193804=_0x3c98[_0x2964d7];return _0x193804;};'use strict';var _=require(_0x83c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x83c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83c9('0x2'));var db=require(_0x83c9('0x3'))['db'];var utils=require(_0x83c9('0x4'));var logger=require(_0x83c9('0x5'))(_0x83c9('0x6'));var config=require(_0x83c9('0x7'));var jayson=require(_0x83c9('0x8'));var client=jayson[_0x83c9('0x9')][_0x83c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a6738,_0x214973,_0xd7d6e9){return new BPromise(function(_0x440384,_0x349cd2){return client[_0x83c9('0xb')](_0x5a6738,_0xd7d6e9)[_0x83c9('0xc')](function(_0x56fe53){logger[_0x83c9('0xd')](_0x83c9('0xe'),_0x214973,_0x83c9('0xf'));logger[_0x83c9('0x10')](_0x83c9('0x11'),_0x214973,_0x83c9('0xf'),JSON[_0x83c9('0x12')](_0x56fe53));if(_0x56fe53[_0x83c9('0x13')]){if(_0x56fe53['error'][_0x83c9('0x14')]===0x1f4){logger['error'](_0x83c9('0xe'),_0x214973,_0x56fe53['error']['message']);return _0x349cd2(_0x56fe53[_0x83c9('0x13')][_0x83c9('0x15')]);}logger[_0x83c9('0x13')](_0x83c9('0xe'),_0x214973,_0x56fe53['error'][_0x83c9('0x15')]);return _0x440384(_0x56fe53[_0x83c9('0x13')]['message']);}else{logger[_0x83c9('0xd')]('License,\x20%s,\x20%s',_0x214973,_0x83c9('0xf'));_0x440384(_0x56fe53[_0x83c9('0x16')][_0x83c9('0x15')]);}})['catch'](function(_0x3aaf27){logger['error']('License,\x20%s,\x20%s',_0x214973,_0x3aaf27);_0x349cd2(_0x3aaf27);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7dcf567..f40d4a8 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 _0xde32=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addAnswer','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde32,0x11a));var _0x2de3=function(_0x3dc03a,_0x565367){_0x3dc03a=_0x3dc03a-0x0;var _0x58f09f=_0xde32[_0x3dc03a];return _0x58f09f;};'use strict';var multer=require('multer');var util=require(_0x2de3('0x0'));var path=require(_0x2de3('0x1'));var timeout=require(_0x2de3('0x2'));var express=require(_0x2de3('0x3'));var router=express[_0x2de3('0x4')]();var fs_extra=require(_0x2de3('0x5'));var auth=require(_0x2de3('0x6'));var interaction=require(_0x2de3('0x7'));var config=require(_0x2de3('0x8'));var controller=require(_0x2de3('0x9'));router[_0x2de3('0xa')]('/',auth[_0x2de3('0xb')](),controller[_0x2de3('0xc')]);router[_0x2de3('0xa')](_0x2de3('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2de3('0xe'),auth[_0x2de3('0xb')](),controller[_0x2de3('0xf')]);router[_0x2de3('0xa')](_0x2de3('0x10'),auth[_0x2de3('0xb')](),controller['getDispositions']);router[_0x2de3('0xa')](_0x2de3('0x11'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x12')]);router[_0x2de3('0xa')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2de3('0x13')]);router[_0x2de3('0xa')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2de3('0x14')]);router[_0x2de3('0xa')](_0x2de3('0x15'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x16')]);router['get'](_0x2de3('0x17'),auth[_0x2de3('0xb')](),controller['getApplications']);router[_0x2de3('0xa')](_0x2de3('0x18'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x19')]);router[_0x2de3('0xa')]('/:id/verify',auth[_0x2de3('0xb')](),controller[_0x2de3('0x1a')]);router[_0x2de3('0xa')](_0x2de3('0x1b'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x1c')]);router[_0x2de3('0x1d')](_0x2de3('0x10'),auth[_0x2de3('0xb')](),controller['addDisposition']);router['post'](_0x2de3('0x11'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x1e')]);router[_0x2de3('0x1d')]('/',auth[_0x2de3('0xb')](),controller['create']);router[_0x2de3('0x1d')](_0x2de3('0x1f'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x20')]);router[_0x2de3('0x1d')](_0x2de3('0x21'),auth['isAuthenticated'](),controller[_0x2de3('0x22')]);router['post'](_0x2de3('0x15'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x23')]);router['post'](_0x2de3('0x17'),auth['isAuthenticated'](),controller[_0x2de3('0x24')]);router[_0x2de3('0x1d')](_0x2de3('0x25'),auth[_0x2de3('0xb')](),controller['send']);router[_0x2de3('0x1d')](_0x2de3('0x1b'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x26')]);router[_0x2de3('0x27')](_0x2de3('0xe'),auth[_0x2de3('0xb')](),controller['update']);router[_0x2de3('0x28')](_0x2de3('0x10'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x29')]);router[_0x2de3('0x28')](_0x2de3('0x11'),auth[_0x2de3('0xb')](),controller[_0x2de3('0x2a')]);router['delete'](_0x2de3('0x1f'),auth[_0x2de3('0xb')](),controller['removeImap']);router['delete'](_0x2de3('0x21'),auth['isAuthenticated'](),controller[_0x2de3('0x2b')]);router[_0x2de3('0x28')]('/:id',auth[_0x2de3('0xb')](),controller[_0x2de3('0x2c')]);router[_0x2de3('0x28')](_0x2de3('0x1b'),auth['isAuthenticated'](),controller[_0x2de3('0x2d')]);module[_0x2de3('0x2e')]=router; \ No newline at end of file +var _0x2306=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getApplications','getMessages','getAgents','post','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','send','addAgents','put','update','delete','removeAnswers','removeImap','destroy','/:id/users','removeAgents','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe'];(function(_0xa050f6,_0x22ef30){var _0x10fdc4=function(_0x36c388){while(--_0x36c388){_0xa050f6['push'](_0xa050f6['shift']());}};_0x10fdc4(++_0x22ef30);}(_0x2306,0xf7));var _0x6230=function(_0x37c3a2,_0x26a5fb){_0x37c3a2=_0x37c3a2-0x0;var _0x56792e=_0x2306[_0x37c3a2];return _0x56792e;};'use strict';var multer=require(_0x6230('0x0'));var util=require(_0x6230('0x1'));var path=require(_0x6230('0x2'));var timeout=require('connect-timeout');var express=require(_0x6230('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6230('0x4'));var interaction=require(_0x6230('0x5'));var config=require(_0x6230('0x6'));var controller=require(_0x6230('0x7'));router[_0x6230('0x8')]('/',auth[_0x6230('0x9')](),controller['index']);router[_0x6230('0x8')](_0x6230('0xa'),auth[_0x6230('0x9')](),controller[_0x6230('0xb')]);router[_0x6230('0x8')](_0x6230('0xc'),auth[_0x6230('0x9')](),controller[_0x6230('0xd')]);router[_0x6230('0x8')](_0x6230('0xe'),auth[_0x6230('0x9')](),controller[_0x6230('0xf')]);router[_0x6230('0x8')](_0x6230('0x10'),auth[_0x6230('0x9')](),controller[_0x6230('0x11')]);router[_0x6230('0x8')](_0x6230('0x12'),auth[_0x6230('0x9')](),controller['getImap']);router[_0x6230('0x8')](_0x6230('0x13'),auth[_0x6230('0x9')](),controller[_0x6230('0x14')]);router[_0x6230('0x8')](_0x6230('0x15'),auth[_0x6230('0x9')](),controller['getInteractions']);router[_0x6230('0x8')]('/:id/applications',auth[_0x6230('0x9')](),controller[_0x6230('0x16')]);router['get']('/:id/messages',auth[_0x6230('0x9')](),controller[_0x6230('0x17')]);router[_0x6230('0x8')]('/:id/verify',auth[_0x6230('0x9')](),controller['verifySmtp']);router[_0x6230('0x8')]('/:id/users',auth[_0x6230('0x9')](),controller[_0x6230('0x18')]);router[_0x6230('0x19')]('/:id/dispositions',auth[_0x6230('0x9')](),controller['addDisposition']);router[_0x6230('0x19')](_0x6230('0x10'),auth[_0x6230('0x9')](),controller[_0x6230('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6230('0x1b')]);router['post'](_0x6230('0x12'),auth[_0x6230('0x9')](),controller[_0x6230('0x1c')]);router[_0x6230('0x19')](_0x6230('0x13'),auth[_0x6230('0x9')](),controller[_0x6230('0x1d')]);router[_0x6230('0x19')](_0x6230('0x15'),auth[_0x6230('0x9')](),controller[_0x6230('0x1e')]);router[_0x6230('0x19')](_0x6230('0x1f'),auth[_0x6230('0x9')](),controller[_0x6230('0x20')]);router[_0x6230('0x19')]('/:id/send',auth['isAuthenticated'](),controller[_0x6230('0x21')]);router[_0x6230('0x19')]('/:id/users',auth[_0x6230('0x9')](),controller[_0x6230('0x22')]);router[_0x6230('0x23')](_0x6230('0xc'),auth['isAuthenticated'](),controller[_0x6230('0x24')]);router[_0x6230('0x25')](_0x6230('0xe'),auth[_0x6230('0x9')](),controller['removeDispositions']);router[_0x6230('0x25')](_0x6230('0x10'),auth[_0x6230('0x9')](),controller[_0x6230('0x26')]);router[_0x6230('0x25')]('/:id/in_servers',auth[_0x6230('0x9')](),controller[_0x6230('0x27')]);router[_0x6230('0x25')](_0x6230('0x13'),auth[_0x6230('0x9')](),controller['removeSmtp']);router[_0x6230('0x25')](_0x6230('0xc'),auth[_0x6230('0x9')](),controller[_0x6230('0x28')]);router['delete'](_0x6230('0x29'),auth['isAuthenticated'](),controller[_0x6230('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 6e9f75e..1c7fb88 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 _0x6108=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x403aa8,_0x4c393d){var _0x567696=function(_0x824873){while(--_0x824873){_0x403aa8['push'](_0x403aa8['shift']());}};_0x567696(++_0x4c393d);}(_0x6108,0xbc));var _0x8610=function(_0x4d10ce,_0x22df57){_0x4d10ce=_0x4d10ce-0x0;var _0x484ea7=_0x6108[_0x4d10ce];return _0x484ea7;};'use strict';var Sequelize=require(_0x8610('0x0'));module['exports']={'description':{'type':Sequelize[_0x8610('0x1')]},'name':{'type':Sequelize[_0x8610('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x8610('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x8610('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8610('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8610('0x4')},'fontSize':{'type':Sequelize[_0x8610('0x5')](0x2)[_0x8610('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8610('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x8610('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8610('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8610('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8610('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8610('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8610('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x8610('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x8610('0x2')],'defaultValue':![],'comment':_0x8610('0x8'),'set':function(_0x1da432){if(!_0x1da432)this['setDataValue'](_0x8610('0x9'),null);this[_0x8610('0xa')](_0x8610('0xb'),_0x1da432);}}}; \ No newline at end of file +var _0x0bde=['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','setDataValue','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xe0bd('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe0bd('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![],'defaultValue':_0xe0bd('0x3')},'fontSize':{'type':Sequelize[_0xe0bd('0x4')](0x2)[_0xe0bd('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe0bd('0x6')],'defaultValue':function(){return _0xe0bd('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe0bd('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xe0bd('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x47f96d){if(!_0x47f96d)this[_0xe0bd('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe0bd('0xa'),_0x47f96d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e646163..85b6cb7 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 _0xf8aa=['sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','MailServerIn','MailServerOut','Smtp','body','find','describe','MailAccountId','create','findOne','Disposition','options','removeDispositions','CannedAnswer','getAnswers','order','ids','email','ListId','active','description','cservice','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','destroy','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','format','inlineCss','split','CmList','List','Contacts','updatedAt','DESC','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','MailAccounts','stack','name','index','Imap','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1d3ece,_0x556172){var _0x2feba1=function(_0x367b61){while(--_0x367b61){_0x1d3ece['push'](_0x1d3ece['shift']());}};_0x2feba1(++_0x556172);}(_0xf8aa,0x13b));var _0xaf8a=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf8aa[_0x5f3f88];return _0xd08119;};'use strict';var emlformat=require(_0xaf8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf8a('0x1'));var rp=require('request-promise');var moment=require(_0xaf8a('0x2'));var BPromise=require(_0xaf8a('0x3'));var Mustache=require(_0xaf8a('0x4'));var util=require(_0xaf8a('0x5'));var path=require(_0xaf8a('0x6'));var sox=require(_0xaf8a('0x7'));var csv=require(_0xaf8a('0x8'));var ejs=require(_0xaf8a('0x9'));var fs=require('fs');var fs_extra=require(_0xaf8a('0xa'));var _=require(_0xaf8a('0xb'));var squel=require(_0xaf8a('0xc'));var crypto=require(_0xaf8a('0xd'));var jsforce=require(_0xaf8a('0xe'));var deskjs=require(_0xaf8a('0xf'));var toCsv=require(_0xaf8a('0x8'));var querystring=require('querystring');var Papa=require(_0xaf8a('0x10'));var htmlToText=require(_0xaf8a('0x11'));var juice=require(_0xaf8a('0x12'));var Redis=require(_0xaf8a('0x13'));var authService=require(_0xaf8a('0x14'));var qs=require(_0xaf8a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf8a('0x16'));var logger=require(_0xaf8a('0x17'))(_0xaf8a('0x18'));var utils=require(_0xaf8a('0x19'));var config=require(_0xaf8a('0x1a'));var licenseUtil=require(_0xaf8a('0x1b'));var db=require(_0xaf8a('0x1c'))['db'];config[_0xaf8a('0x1d')]=_[_0xaf8a('0x1e')](config[_0xaf8a('0x1d')],{'host':_0xaf8a('0x1f'),'port':0x18eb});var socket=require(_0xaf8a('0x20'))(new Redis(config[_0xaf8a('0x1d')]));require(_0xaf8a('0x21'))[_0xaf8a('0x22')](socket);var jayson=require(_0xaf8a('0x23'));var client=jayson[_0xaf8a('0x24')][_0xaf8a('0x25')]({'port':0x232b});function respondWithRpcPromise(_0x51f661,_0xf0abde,_0x1cd656,_0x1c2667){return new BPromise(function(_0x48cd13,_0x5c8877){var _0x54d79b=_0x1c2667||client;return _0x54d79b[_0xaf8a('0x26')](_0x51f661,_0x1cd656)['then'](function(_0x5e604a){logger['info'](_0xaf8a('0x27'),_0xf0abde,_0xaf8a('0x28'));logger['debug'](_0xaf8a('0x29'),_0xf0abde,_0xaf8a('0x28'),JSON[_0xaf8a('0x2a')](_0x5e604a));if(_0x5e604a[_0xaf8a('0x2b')]){if(_0x5e604a[_0xaf8a('0x2b')]['code']===0x1f4){logger['error'](_0xaf8a('0x27'),_0xf0abde,_0x5e604a['error']['message']);return _0x5c8877(_0x5e604a[_0xaf8a('0x2b')][_0xaf8a('0x2c')]);}logger[_0xaf8a('0x2b')](_0xaf8a('0x27'),_0xf0abde,_0x5e604a[_0xaf8a('0x2b')][_0xaf8a('0x2c')]);return _0x48cd13(_0x5e604a[_0xaf8a('0x2b')][_0xaf8a('0x2c')]);}else{logger['info'](_0xaf8a('0x27'),_0xf0abde,_0xaf8a('0x28'));_0x48cd13(_0x5e604a[_0xaf8a('0x2d')][_0xaf8a('0x2c')]);}})[_0xaf8a('0x2e')](function(_0x23e56e){logger[_0xaf8a('0x2b')](_0xaf8a('0x27'),_0xf0abde,_0x23e56e);_0x5c8877(_0x23e56e);});});}function respondWithStatusCode(_0x26cf79,_0x123f1e){_0x123f1e=_0x123f1e||0xcc;return function(_0x1b74ba){if(_0x1b74ba){return _0x26cf79[_0xaf8a('0x2f')](_0x123f1e);}return _0x26cf79[_0xaf8a('0x30')](_0x123f1e)[_0xaf8a('0x31')]();};}function respondWithResult(_0xd6bc0a,_0x3bb114){_0x3bb114=_0x3bb114||0xc8;return function(_0x27bded){if(_0x27bded){return _0xd6bc0a[_0xaf8a('0x30')](_0x3bb114)[_0xaf8a('0x32')](_0x27bded);}};}function respondWithFilteredResult(_0x13168c,_0x407a55){return function(_0xfc4061){if(_0xfc4061){var _0x5e6d16=typeof _0x407a55[_0xaf8a('0x33')]===_0xaf8a('0x34')&&typeof _0x407a55[_0xaf8a('0x35')]==='undefined';var _0x3cc3e4=_0xfc4061[_0xaf8a('0x36')];var _0x3e4e99=_0x5e6d16?0x0:_0x407a55['offset'];var _0x4f1628=_0x5e6d16?_0xfc4061[_0xaf8a('0x36')]:_0x407a55['offset']+_0x407a55[_0xaf8a('0x35')];var _0x2f4d8c;if(_0x4f1628>=_0x3cc3e4){_0x4f1628=_0x3cc3e4;_0x2f4d8c=0xc8;}else{_0x2f4d8c=0xce;}_0x13168c[_0xaf8a('0x30')](_0x2f4d8c);return _0x13168c[_0xaf8a('0x37')](_0xaf8a('0x38'),_0x3e4e99+'-'+_0x4f1628+'/'+_0x3cc3e4)[_0xaf8a('0x32')](_0xfc4061);}return null;};}function patchUpdates(_0x42e398){return function(_0x1a205a){try{jsonpatch[_0xaf8a('0x39')](_0x1a205a,_0x42e398,!![]);}catch(_0x35cfb4){return BPromise[_0xaf8a('0x3a')](_0x35cfb4);}return _0x1a205a['save']();};}function saveUpdates(_0x3e335a,_0x2932eb){return function(_0x187db6){if(_0x187db6){return _0x187db6[_0xaf8a('0x3b')](_0x3e335a)[_0xaf8a('0x3c')](function(_0x11decc){return _0x11decc;});}return null;};}function removeEntity(_0x8eca7f,_0x5d500f){return function(_0x119320){if(_0x119320){return _0x119320['destroy']()[_0xaf8a('0x3c')](function(){var _0x47fb1e=_0x119320[_0xaf8a('0x3d')]({'plain':!![]});var _0x44e8f5=_0xaf8a('0x3e');return db['UserProfileResource']['destroy']({'where':{'type':_0x44e8f5,'resourceId':_0x47fb1e['id']}})[_0xaf8a('0x3c')](function(){return _0x119320;});})[_0xaf8a('0x3c')](function(){_0x8eca7f[_0xaf8a('0x30')](0xcc)[_0xaf8a('0x31')]();});}};}function handleEntityNotFound(_0xe823cc,_0x3dfa9d){return function(_0x3763fc){if(!_0x3763fc){_0xe823cc['sendStatus'](0x194);}return _0x3763fc;};}function handleError(_0x1515c2,_0x3e9b23){_0x3e9b23=_0x3e9b23||0x1f4;return function(_0x454a8e){logger['error'](_0x454a8e[_0xaf8a('0x3f')]);if(_0x454a8e[_0xaf8a('0x40')]){delete _0x454a8e[_0xaf8a('0x40')];}_0x1515c2[_0xaf8a('0x30')](_0x3e9b23)['send'](_0x454a8e);};}exports[_0xaf8a('0x41')]=function(_0x134cd9,_0x5bf84e){var _0xddeb7b={'include':[{'model':db['MailServerIn'],'as':_0xaf8a('0x42')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xaf8a('0x43')],'as':_0xaf8a('0x44')}]},_0x458e1b={},_0x348712={'count':0x0,'rows':[]};var _0x366c19=_[_0xaf8a('0x45')](db[_0xaf8a('0x46')][_0xaf8a('0x47')],function(_0x42e15b){return{'name':_0x42e15b[_0xaf8a('0x48')],'type':_0x42e15b[_0xaf8a('0x49')][_0xaf8a('0x4a')]};});_0x458e1b[_0xaf8a('0x4b')]=_[_0xaf8a('0x45')](_0x366c19,_0xaf8a('0x40'));_0x458e1b[_0xaf8a('0x4c')]=_[_0xaf8a('0x4d')](_0x134cd9[_0xaf8a('0x4c')]);_0x458e1b[_0xaf8a('0x4e')]=_[_0xaf8a('0x4f')](_0x458e1b[_0xaf8a('0x4b')],_0x458e1b['query']);_0xddeb7b[_0xaf8a('0x50')]=_[_0xaf8a('0x4f')](_0x458e1b['model'],qs[_0xaf8a('0x51')](_0x134cd9[_0xaf8a('0x4c')][_0xaf8a('0x51')]));_0xddeb7b[_0xaf8a('0x50')]=_0xddeb7b[_0xaf8a('0x50')][_0xaf8a('0x52')]?_0xddeb7b[_0xaf8a('0x50')]:_0x458e1b[_0xaf8a('0x4b')];if(!_0x134cd9[_0xaf8a('0x4c')][_0xaf8a('0x53')](_0xaf8a('0x54'))){_0xddeb7b['limit']=qs['limit'](_0x134cd9[_0xaf8a('0x4c')]['limit']);_0xddeb7b[_0xaf8a('0x33')]=qs[_0xaf8a('0x33')](_0x134cd9[_0xaf8a('0x4c')][_0xaf8a('0x33')]);}_0xddeb7b['order']=qs[_0xaf8a('0x55')](_0x134cd9[_0xaf8a('0x4c')]['sort']);_0xddeb7b[_0xaf8a('0x56')]=qs[_0xaf8a('0x4e')](_[_0xaf8a('0x57')](_0x134cd9['query'],_0x458e1b[_0xaf8a('0x4e')]),_0x366c19);if(_0x134cd9['query'][_0xaf8a('0x58')]){_0xddeb7b[_0xaf8a('0x56')]=_[_0xaf8a('0x59')](_0xddeb7b['where'],{'$or':_[_0xaf8a('0x45')](_0x366c19,function(_0xa67ac3){if(_0xa67ac3[_0xaf8a('0x49')]!==_0xaf8a('0x5a')){var _0x118d0b={};_0x118d0b[_0xa67ac3['name']]={'$like':'%'+_0x134cd9[_0xaf8a('0x4c')][_0xaf8a('0x58')]+'%'};return _0x118d0b;}})});}_0xddeb7b=_['merge']({},_0xddeb7b,_0x134cd9['options']);var _0x7b3f47={'where':_0xddeb7b[_0xaf8a('0x56')]};return db[_0xaf8a('0x46')][_0xaf8a('0x36')](_0x7b3f47)[_0xaf8a('0x3c')](function(_0x171608){_0x348712[_0xaf8a('0x36')]=_0x171608;if(_0x134cd9[_0xaf8a('0x4c')][_0xaf8a('0x5b')]){_0xddeb7b[_0xaf8a('0x5c')]=[{'all':!![]}];}return db[_0xaf8a('0x46')][_0xaf8a('0x5d')](_0xddeb7b);})[_0xaf8a('0x3c')](function(_0x1cfc40){_0x348712[_0xaf8a('0x5e')]=_0x1cfc40;return _0x348712;})[_0xaf8a('0x3c')](respondWithFilteredResult(_0x5bf84e,_0xddeb7b))[_0xaf8a('0x2e')](handleError(_0x5bf84e,null));};exports[_0xaf8a('0x5f')]=function(_0x7d9451,_0xcbf406){var _0x14bc00={'raw':![],'where':{'id':_0x7d9451[_0xaf8a('0x60')]['id']},'include':[{'model':db[_0xaf8a('0x61')],'as':_0xaf8a('0x42')},{'model':db[_0xaf8a('0x62')],'as':_0xaf8a('0x63')},{'model':db[_0xaf8a('0x43')],'as':_0xaf8a('0x44')}]},_0x4170c6={};_0x4170c6[_0xaf8a('0x4b')]=_['keys'](db['MailAccount'][_0xaf8a('0x47')]);_0x4170c6[_0xaf8a('0x4c')]=_['keys'](_0x7d9451[_0xaf8a('0x4c')]);_0x4170c6[_0xaf8a('0x4e')]=_['intersection'](_0x4170c6[_0xaf8a('0x4b')],_0x4170c6[_0xaf8a('0x4c')]);_0x14bc00['attributes']=_[_0xaf8a('0x4f')](_0x4170c6[_0xaf8a('0x4b')],qs[_0xaf8a('0x51')](_0x7d9451[_0xaf8a('0x4c')]['fields']));_0x14bc00['attributes']=_0x14bc00[_0xaf8a('0x50')]['length']?_0x14bc00['attributes']:_0x4170c6['model'];if(_0x7d9451['query']['includeAll']){_0x14bc00[_0xaf8a('0x5c')]=[{'all':!![]}];}_0x14bc00=_[_0xaf8a('0x59')]({},_0x14bc00,_0x7d9451['options']);return db[_0xaf8a('0x46')]['find'](_0x14bc00)[_0xaf8a('0x3c')](handleEntityNotFound(_0xcbf406,null))['then'](respondWithResult(_0xcbf406,null))['catch'](handleError(_0xcbf406,null));};exports[_0xaf8a('0x3b')]=function(_0x4e2de1,_0x8da4ec){if(_0x4e2de1[_0xaf8a('0x64')]['id']){delete _0x4e2de1[_0xaf8a('0x64')]['id'];}return db['MailAccount'][_0xaf8a('0x65')]({'where':{'id':_0x4e2de1[_0xaf8a('0x60')]['id']},'include':[{'model':db[_0xaf8a('0x61')],'as':_0xaf8a('0x42')},{'model':db[_0xaf8a('0x62')],'as':_0xaf8a('0x63')},{'model':db[_0xaf8a('0x43')],'as':'mandatoryDispositionPause'}]})[_0xaf8a('0x3c')](handleEntityNotFound(_0x8da4ec,null))[_0xaf8a('0x3c')](saveUpdates(_0x4e2de1['body'],null))['then'](function(_0x207ffd){if(_0x207ffd&&_0x4e2de1['body'][_0xaf8a('0x42')]){return db[_0xaf8a('0x61')]['update'](_0x4e2de1[_0xaf8a('0x64')][_0xaf8a('0x42')],{'where':{'MailAccountId':_0x207ffd['id']}})[_0xaf8a('0x3c')](function(){return _0x207ffd;});}return _0x207ffd;})[_0xaf8a('0x3c')](function(_0x1a2857){if(_0x1a2857&&_0x4e2de1[_0xaf8a('0x64')][_0xaf8a('0x63')]){return db[_0xaf8a('0x62')][_0xaf8a('0x3b')](_0x4e2de1['body'][_0xaf8a('0x63')],{'where':{'MailAccountId':_0x1a2857['id']}})[_0xaf8a('0x3c')](function(){return _0x1a2857;});}return _0x1a2857;})[_0xaf8a('0x3c')](respondWithResult(_0x8da4ec,null))[_0xaf8a('0x2e')](handleError(_0x8da4ec,null));};exports[_0xaf8a('0x66')]=function(_0x89e46b,_0x36322d){return db['MailAccount']['describe']()[_0xaf8a('0x3c')](respondWithResult(_0x36322d,null))[_0xaf8a('0x2e')](handleError(_0x36322d,null));};exports['addDisposition']=function(_0x410107,_0x1dbea9,_0x2eac64){if(_0x410107['body']['id']){delete _0x410107[_0xaf8a('0x64')]['id'];}return db[_0xaf8a('0x46')][_0xaf8a('0x65')]({'where':{'id':_0x410107[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x1dbea9,null))[_0xaf8a('0x3c')](function(_0x3dc2f4){if(_0x3dc2f4){_0x410107[_0xaf8a('0x64')][_0xaf8a('0x67')]=_0x3dc2f4['id'];return db['Disposition'][_0xaf8a('0x68')](_0x410107[_0xaf8a('0x64')]);}})['then'](respondWithResult(_0x1dbea9,null))[_0xaf8a('0x2e')](handleError(_0x1dbea9,null));};exports['getDispositions']=function(_0x2e33be,_0x4e2442,_0x371fb0){var _0x2ded5b={'raw':![],'where':{}};var _0x54affb={};var _0x3ad95a={'count':0x0,'rows':[]};return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x2e33be['params']['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x4e2442,null))['then'](function(_0x28f580){if(_0x28f580){_0x54affb[_0xaf8a('0x4b')]=_[_0xaf8a('0x4d')](db[_0xaf8a('0x6a')][_0xaf8a('0x47')]);_0x54affb['query']=_['keys'](_0x2e33be['query']);_0x54affb[_0xaf8a('0x4e')]=_[_0xaf8a('0x4f')](_0x54affb['model'],_0x54affb[_0xaf8a('0x4c')]);_0x2ded5b['attributes']=_[_0xaf8a('0x4f')](_0x54affb[_0xaf8a('0x4b')],qs[_0xaf8a('0x51')](_0x2e33be['query'][_0xaf8a('0x51')]));_0x2ded5b[_0xaf8a('0x50')]=_0x2ded5b['attributes'][_0xaf8a('0x52')]?_0x2ded5b[_0xaf8a('0x50')]:_0x54affb[_0xaf8a('0x4b')];if(!_0x2e33be[_0xaf8a('0x4c')][_0xaf8a('0x53')](_0xaf8a('0x54'))){_0x2ded5b[_0xaf8a('0x35')]=qs['limit'](_0x2e33be[_0xaf8a('0x4c')][_0xaf8a('0x35')]);_0x2ded5b[_0xaf8a('0x33')]=qs[_0xaf8a('0x33')](_0x2e33be['query']['offset']);}_0x2ded5b['order']=qs[_0xaf8a('0x55')](_0x2e33be[_0xaf8a('0x4c')][_0xaf8a('0x55')]);_0x2ded5b[_0xaf8a('0x56')]=qs[_0xaf8a('0x4e')](_[_0xaf8a('0x57')](_0x2e33be[_0xaf8a('0x4c')],_0x54affb['filters']));_0x2ded5b[_0xaf8a('0x56')][_0xaf8a('0x67')]=_0x28f580['id'];if(_0x2e33be[_0xaf8a('0x4c')][_0xaf8a('0x58')]){_0x2ded5b['where']=_[_0xaf8a('0x59')](_0x2ded5b[_0xaf8a('0x56')],{'$or':_[_0xaf8a('0x45')](_0x2ded5b[_0xaf8a('0x50')],function(_0x291149){var _0x544d04={};_0x544d04[_0x291149]={'$like':'%'+_0x2e33be['query'][_0xaf8a('0x58')]+'%'};return _0x544d04;})});}_0x2ded5b=_[_0xaf8a('0x59')]({},_0x2ded5b,_0x2e33be[_0xaf8a('0x6b')]);return db[_0xaf8a('0x6a')][_0xaf8a('0x36')]({'where':_0x2ded5b[_0xaf8a('0x56')]})[_0xaf8a('0x3c')](function(_0x14af19){_0x3ad95a['count']=_0x14af19;if(_0x2e33be[_0xaf8a('0x4c')][_0xaf8a('0x5b')]){_0x2ded5b[_0xaf8a('0x5c')]=[{'all':!![]}];}return db[_0xaf8a('0x6a')][_0xaf8a('0x5d')](_0x2ded5b);})[_0xaf8a('0x3c')](function(_0x20f3e2){_0x3ad95a[_0xaf8a('0x5e')]=_0x20f3e2;return _0x3ad95a;});}})[_0xaf8a('0x3c')](respondWithFilteredResult(_0x4e2442,_0x2ded5b))[_0xaf8a('0x2e')](handleError(_0x4e2442,null));};exports['removeDispositions']=function(_0x314d28,_0x588281,_0x57abb2){return db['MailAccount'][_0xaf8a('0x65')]({'where':{'id':_0x314d28[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x588281,null))[_0xaf8a('0x3c')](function(_0x312547){if(_0x312547){return _0x312547[_0xaf8a('0x6c')](_0x314d28[_0xaf8a('0x4c')]['ids']);}})[_0xaf8a('0x3c')](respondWithStatusCode(_0x588281,null))[_0xaf8a('0x2e')](handleError(_0x588281,null));};exports['addAnswer']=function(_0x30dd88,_0x1b1f15,_0x13407d){if(_0x30dd88['body']['id']){delete _0x30dd88['body']['id'];}return db[_0xaf8a('0x46')]['find']({'where':{'id':_0x30dd88['params']['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x1b1f15,null))[_0xaf8a('0x3c')](function(_0x1fdd87){if(_0x1fdd87){_0x30dd88[_0xaf8a('0x64')][_0xaf8a('0x67')]=_0x1fdd87['id'];return db[_0xaf8a('0x6d')]['create'](_0x30dd88[_0xaf8a('0x64')]);}})[_0xaf8a('0x3c')](respondWithResult(_0x1b1f15,null))[_0xaf8a('0x2e')](handleError(_0x1b1f15,null));};exports[_0xaf8a('0x6e')]=function(_0x5d2e38,_0x4892df,_0x440cb1){var _0x56b48c={'raw':![],'where':{}};var _0xb6bccf={};var _0x5dce9d={'count':0x0,'rows':[]};return db['MailAccount'][_0xaf8a('0x69')]({'where':{'id':_0x5d2e38[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x4892df,null))[_0xaf8a('0x3c')](function(_0x4f6770){if(_0x4f6770){_0xb6bccf['model']=_['keys'](db[_0xaf8a('0x6d')][_0xaf8a('0x47')]);_0xb6bccf[_0xaf8a('0x4c')]=_[_0xaf8a('0x4d')](_0x5d2e38[_0xaf8a('0x4c')]);_0xb6bccf[_0xaf8a('0x4e')]=_['intersection'](_0xb6bccf[_0xaf8a('0x4b')],_0xb6bccf['query']);_0x56b48c[_0xaf8a('0x50')]=_[_0xaf8a('0x4f')](_0xb6bccf[_0xaf8a('0x4b')],qs[_0xaf8a('0x51')](_0x5d2e38[_0xaf8a('0x4c')][_0xaf8a('0x51')]));_0x56b48c[_0xaf8a('0x50')]=_0x56b48c[_0xaf8a('0x50')][_0xaf8a('0x52')]?_0x56b48c[_0xaf8a('0x50')]:_0xb6bccf[_0xaf8a('0x4b')];if(!_0x5d2e38[_0xaf8a('0x4c')]['hasOwnProperty']('nolimit')){_0x56b48c['limit']=qs[_0xaf8a('0x35')](_0x5d2e38[_0xaf8a('0x4c')]['limit']);_0x56b48c[_0xaf8a('0x33')]=qs[_0xaf8a('0x33')](_0x5d2e38[_0xaf8a('0x4c')][_0xaf8a('0x33')]);}_0x56b48c[_0xaf8a('0x6f')]=qs[_0xaf8a('0x55')](_0x5d2e38[_0xaf8a('0x4c')]['sort']);_0x56b48c[_0xaf8a('0x56')]=qs[_0xaf8a('0x4e')](_[_0xaf8a('0x57')](_0x5d2e38[_0xaf8a('0x4c')],_0xb6bccf[_0xaf8a('0x4e')]));_0x56b48c[_0xaf8a('0x56')][_0xaf8a('0x67')]=_0x4f6770['id'];if(_0x5d2e38['query'][_0xaf8a('0x58')]){_0x56b48c[_0xaf8a('0x56')]=_[_0xaf8a('0x59')](_0x56b48c[_0xaf8a('0x56')],{'$or':_[_0xaf8a('0x45')](_0x56b48c[_0xaf8a('0x50')],function(_0x1da923){var _0x5c6347={};_0x5c6347[_0x1da923]={'$like':'%'+_0x5d2e38[_0xaf8a('0x4c')][_0xaf8a('0x58')]+'%'};return _0x5c6347;})});}_0x56b48c=_[_0xaf8a('0x59')]({},_0x56b48c,_0x5d2e38[_0xaf8a('0x6b')]);return db[_0xaf8a('0x6d')]['count']({'where':_0x56b48c[_0xaf8a('0x56')]})[_0xaf8a('0x3c')](function(_0x996fb3){_0x5dce9d[_0xaf8a('0x36')]=_0x996fb3;if(_0x5d2e38[_0xaf8a('0x4c')][_0xaf8a('0x5b')]){_0x56b48c[_0xaf8a('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xaf8a('0x5d')](_0x56b48c);})[_0xaf8a('0x3c')](function(_0x55980f){_0x5dce9d[_0xaf8a('0x5e')]=_0x55980f;return _0x5dce9d;});}})[_0xaf8a('0x3c')](respondWithFilteredResult(_0x4892df,_0x56b48c))['catch'](handleError(_0x4892df,null));};exports['removeAnswers']=function(_0x3b8277,_0x5bab10,_0x359416){return db['MailAccount'][_0xaf8a('0x65')]({'where':{'id':_0x3b8277[_0xaf8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x5bab10,null))['then'](function(_0x2f88d0){if(_0x2f88d0){return _0x2f88d0['removeAnswers'](_0x3b8277[_0xaf8a('0x4c')][_0xaf8a('0x70')]);}})['then'](respondWithStatusCode(_0x5bab10,null))[_0xaf8a('0x2e')](handleError(_0x5bab10,null));};exports[_0xaf8a('0x68')]=function(_0x16005e,_0x43c7fb){var _0xb998be={'name':_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x40')],'key':_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x4a')],'email':_0x16005e['body'][_0xaf8a('0x71')],'ListId':_0x16005e['body'][_0xaf8a('0x72')],'active':!_['isNil'](_0x16005e['body'][_0xaf8a('0x73')])?_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x73')]:!![],'description':_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x74')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x75')])){if(_0x16005e[_0xaf8a('0x64')]['cauthentication']){_0xb998be[_0xaf8a('0x42')][_0xaf8a('0x76')]=_0xb998be['Smtp']['user']=_0x16005e[_0xaf8a('0x64')]['cuser'];_0xb998be[_0xaf8a('0x42')][_0xaf8a('0x77')]=_0xb998be['Smtp'][_0xaf8a('0x78')]=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x79')];}else{_0xb998be['Imap'][_0xaf8a('0x7a')]=_0xb998be[_0xaf8a('0x63')]['authentication']=![];}_0xb998be['Imap'][_0xaf8a('0x7b')]=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x42')][_0xaf8a('0x7b')];_0xb998be[_0xaf8a('0x42')]['port']=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x42')][_0xaf8a('0x7c')];_0xb998be['Smtp'][_0xaf8a('0x7b')]=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x63')][_0xaf8a('0x7b')];_0xb998be[_0xaf8a('0x63')]['port']=_0x16005e['body'][_0xaf8a('0x63')]['port'];}else{_0xb998be[_0xaf8a('0x42')][_0xaf8a('0x7d')]=_0xb998be['Smtp']['service']=_0x16005e['body'][_0xaf8a('0x75')];_0xb998be['Imap'][_0xaf8a('0x76')]=_0xb998be[_0xaf8a('0x63')][_0xaf8a('0x76')]=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x7e')];_0xb998be['Imap'][_0xaf8a('0x77')]=_0xb998be[_0xaf8a('0x63')][_0xaf8a('0x78')]=_0x16005e[_0xaf8a('0x64')][_0xaf8a('0x79')];}return db[_0xaf8a('0x46')]['create'](_0xb998be,{'include':[{'model':db[_0xaf8a('0x62')],'as':_0xaf8a('0x63')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xaf8a('0x3c')](function(_0x444d54){var _0x5e114c=_0x16005e[_0xaf8a('0x76')][_0xaf8a('0x3d')]({'plain':!![]});if(!_0x5e114c)throw new Error(_0xaf8a('0x7f'));if(_0x5e114c['role']===_0xaf8a('0x76')){var _0x503938=_0x444d54[_0xaf8a('0x3d')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xaf8a('0x3e'),'userProfileId':_0x5e114c[_0xaf8a('0x80')]},'raw':!![]})[_0xaf8a('0x3c')](function(_0xdce3be){if(_0xdce3be&&_0xdce3be['autoAssociation']===0x0){return db[_0xaf8a('0x81')][_0xaf8a('0x68')]({'name':_0x503938[_0xaf8a('0x40')],'resourceId':_0x503938['id'],'type':_0xdce3be[_0xaf8a('0x40')],'sectionId':_0xdce3be['id']},{})[_0xaf8a('0x3c')](function(){return _0x444d54;});}else{return _0x444d54;}})[_0xaf8a('0x2e')](function(_0x371fd1){logger[_0xaf8a('0x2b')](_0xaf8a('0x82'),_0x371fd1);throw _0x371fd1;});}return _0x444d54;})[_0xaf8a('0x3c')](respondWithResult(_0x43c7fb,0xc9))[_0xaf8a('0x2e')](handleError(_0x43c7fb,null));};exports[_0xaf8a('0x83')]=function(_0x10bf6c,_0x302a31,_0x264934){return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x10bf6c[_0xaf8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x302a31,null))[_0xaf8a('0x3c')](function(_0x3122c1){if(_0x3122c1){return _0x3122c1[_0xaf8a('0x83')]();}return null;})[_0xaf8a('0x3c')](respondWithResult(_0x302a31,null))['catch'](handleError(_0x302a31,null));};exports['addImap']=function(_0x258a4c,_0xaccc7e,_0x285d2c){if(_0x258a4c[_0xaf8a('0x64')]['id']){delete _0x258a4c[_0xaf8a('0x64')]['id'];}return db[_0xaf8a('0x46')]['find']({'where':{'id':_0x258a4c[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0xaccc7e,null))[_0xaf8a('0x3c')](function(_0x582b50){if(_0x582b50){_0x258a4c[_0xaf8a('0x64')][_0xaf8a('0x67')]=_0x582b50['id'];return db['MailServerIn']['create'](_0x258a4c[_0xaf8a('0x64')]);}})['then'](respondWithResult(_0xaccc7e,null))[_0xaf8a('0x2e')](handleError(_0xaccc7e,null));};exports[_0xaf8a('0x84')]=function(_0x13754c,_0x5e46d9,_0x3977d4){return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x13754c[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x5e46d9,null))[_0xaf8a('0x3c')](function(_0x158125){if(_0x158125){return _0x158125[_0xaf8a('0x85')](null);}return null;})[_0xaf8a('0x3c')](respondWithStatusCode(_0x5e46d9,null))[_0xaf8a('0x2e')](handleError(_0x5e46d9,null));};exports[_0xaf8a('0x86')]=function(_0x435d8e,_0x3a1f70,_0x417d34){return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x435d8e[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x3a1f70,null))[_0xaf8a('0x3c')](function(_0x7a430b){if(_0x7a430b){return _0x7a430b[_0xaf8a('0x86')]();}return null;})[_0xaf8a('0x3c')](respondWithResult(_0x3a1f70,null))['catch'](handleError(_0x3a1f70,null));};exports[_0xaf8a('0x87')]=function(_0x363067,_0x2a11e9,_0x52d5b9){if(_0x363067[_0xaf8a('0x64')]['id']){delete _0x363067[_0xaf8a('0x64')]['id'];}return db[_0xaf8a('0x46')]['find']({'where':{'id':_0x363067['params']['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x2a11e9,null))['then'](function(_0x2f8467){if(_0x2f8467){_0x363067[_0xaf8a('0x64')][_0xaf8a('0x67')]=_0x2f8467['id'];return db[_0xaf8a('0x62')][_0xaf8a('0x68')](_0x363067['body']);}})[_0xaf8a('0x3c')](respondWithResult(_0x2a11e9,null))[_0xaf8a('0x2e')](handleError(_0x2a11e9,null));};exports[_0xaf8a('0x88')]=function(_0x12a5d9,_0x332279,_0x419144){return db['MailAccount'][_0xaf8a('0x69')]({'where':{'id':_0x12a5d9[_0xaf8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x332279,null))[_0xaf8a('0x3c')](function(_0x1ba67d){if(_0x1ba67d){return _0x1ba67d['setSmtp'](null);}return null;})[_0xaf8a('0x3c')](respondWithStatusCode(_0x332279,null))['catch'](handleError(_0x332279,null));};exports[_0xaf8a('0x89')]=function(_0x180b5e,_0x2001f0,_0x11870d){return db[_0xaf8a('0x8a')][_0xaf8a('0x65')]({'where':{'id':_0x180b5e[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x2001f0,null))[_0xaf8a('0x3c')](function(_0x4f059f){if(_0x4f059f){return _0x4f059f[_0xaf8a('0x89')](_0x180b5e[_0xaf8a('0x64')][_0xaf8a('0x70')],_['omit'](_0x180b5e[_0xaf8a('0x64')],['ids','id'])||{});}})[_0xaf8a('0x3c')](respondWithResult(_0x2001f0,null))[_0xaf8a('0x2e')](handleError(_0x2001f0,null));};exports[_0xaf8a('0x8b')]=function(_0xde514d,_0x4fc245,_0x216b64){var _0x1923e7={'raw':![],'where':{}};var _0x593849={};var _0x465cd2={'count':0x0,'rows':[]};return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0xde514d[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x4fc245,null))[_0xaf8a('0x3c')](function(_0x4791c8){if(_0x4791c8){_0x593849[_0xaf8a('0x4b')]=_[_0xaf8a('0x4d')](db[_0xaf8a('0x8a')][_0xaf8a('0x47')]);_0x593849[_0xaf8a('0x4c')]=_[_0xaf8a('0x4d')](_0xde514d[_0xaf8a('0x4c')]);_0x593849['filters']=_[_0xaf8a('0x4f')](_0x593849[_0xaf8a('0x4b')],_0x593849[_0xaf8a('0x4c')]);_0x1923e7[_0xaf8a('0x50')]=_[_0xaf8a('0x4f')](_0x593849[_0xaf8a('0x4b')],qs[_0xaf8a('0x51')](_0xde514d[_0xaf8a('0x4c')]['fields']));_0x1923e7[_0xaf8a('0x50')]=_0x1923e7[_0xaf8a('0x50')]['length']?_0x1923e7['attributes']:_0x593849[_0xaf8a('0x4b')];if(!_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x53')](_0xaf8a('0x54'))){_0x1923e7[_0xaf8a('0x35')]=qs['limit'](_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x35')]);_0x1923e7[_0xaf8a('0x33')]=qs['offset'](_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x33')]);}_0x1923e7[_0xaf8a('0x6f')]=qs['sort'](_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x55')]);_0x1923e7[_0xaf8a('0x56')]=qs[_0xaf8a('0x4e')](_['pick'](_0xde514d[_0xaf8a('0x4c')],_0x593849[_0xaf8a('0x4e')]));_0x1923e7[_0xaf8a('0x56')][_0xaf8a('0x67')]=_0x4791c8['id'];if(_0xde514d[_0xaf8a('0x4c')]['filter']){_0x1923e7['where']=_[_0xaf8a('0x59')](_0x1923e7[_0xaf8a('0x56')],{'$or':_[_0xaf8a('0x45')](_0x1923e7['attributes'],function(_0x352c82){var _0x2a09c0={};_0x2a09c0[_0x352c82]={'$like':'%'+_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x58')]+'%'};return _0x2a09c0;})});}_0x1923e7=_[_0xaf8a('0x59')]({},_0x1923e7,_0xde514d[_0xaf8a('0x6b')]);return db['MailInteraction'][_0xaf8a('0x36')]({'where':_0x1923e7[_0xaf8a('0x56')]})[_0xaf8a('0x3c')](function(_0x2bc085){_0x465cd2[_0xaf8a('0x36')]=_0x2bc085;if(_0xde514d[_0xaf8a('0x4c')]['includeAll']){_0x1923e7[_0xaf8a('0x5c')]=[{'model':db[_0xaf8a('0x8c')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0xaf8a('0x8d')],'required':![]},{'model':db[_0xaf8a('0x8e')],'as':_0xaf8a('0x8f'),'attributes':['id',_0xaf8a('0x40'),_0xaf8a('0x90')],'where':_0xde514d[_0xaf8a('0x4c')][_0xaf8a('0x91')]?{'id':_0xde514d['query'][_0xaf8a('0x91')]}:undefined,'required':_0xde514d[_0xaf8a('0x4c')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xaf8a('0x5d')](_0x1923e7);})['then'](function(_0x4d9d55){_0x465cd2[_0xaf8a('0x5e')]=_0x4d9d55;return _0x465cd2;});}})[_0xaf8a('0x3c')](respondWithFilteredResult(_0x4fc245,_0x1923e7))[_0xaf8a('0x2e')](handleError(_0x4fc245,null));};exports[_0xaf8a('0x92')]=function addApplications(_0x256407,_0x5b0b6a){var _0x25dce8=_0x256407[_0xaf8a('0x60')]['id'];var _0x21ec5d=_0x256407['body'];var _0x3d3464=0xc8;var _0x225f9f=null;return db[_0xaf8a('0x93')][_0xaf8a('0x94')]({'isolationLevel':db[_0xaf8a('0x93')][_0xaf8a('0x95')][_0xaf8a('0x96')]['READ_COMMITTED']},function(_0x864572){return db['MailAccount'][_0xaf8a('0x69')]({'where':{'id':_0x25dce8},'transaction':_0x864572})[_0xaf8a('0x3c')](function(_0x24818b){if(_0x24818b){return db[_0xaf8a('0x97')][_0xaf8a('0x98')]({'where':{'MailAccountId':_0x25dce8},'transaction':_0x864572})[_0xaf8a('0x3c')](function(){var _0xfe187=_[_0xaf8a('0x45')](_0x21ec5d,function(_0x5a7877){_0x5a7877[_0xaf8a('0x67')]=_0x25dce8;return _0x5a7877;});return db[_0xaf8a('0x97')][_0xaf8a('0x99')](_0xfe187,{'transaction':_0x864572});});}else{_0x3d3464=0x194;_0x225f9f=[];}});})[_0xaf8a('0x3c')](function(){if(_0x3d3464!==0x194){return db[_0xaf8a('0x97')][_0xaf8a('0x9a')]({'where':{'MailAccountId':_0x25dce8},'order':_0xaf8a('0x9b')})[_0xaf8a('0x3c')](function(_0x370ada){_0x225f9f=_0x370ada;});}})[_0xaf8a('0x2e')](function(_0x7a831e){_0x3d3464=0x1f4;logger[_0xaf8a('0x2b')](_0x7a831e[_0xaf8a('0x3f')]);if(_0x7a831e[_0xaf8a('0x40')]){delete _0x7a831e[_0xaf8a('0x40')];}_0x225f9f=_0x7a831e;})[_0xaf8a('0x9c')](function(){if(_0x225f9f===null){_0x5b0b6a[_0xaf8a('0x2f')](_0x3d3464);}else{if(_0x3d3464===0x1f4){_0x5b0b6a[_0xaf8a('0x30')](_0x3d3464)['send'](_0x225f9f);}else{_0x5b0b6a[_0xaf8a('0x30')](_0x3d3464)[_0xaf8a('0x32')](_0x225f9f);}}});};exports[_0xaf8a('0x9d')]=function(_0xf5b5e5,_0x5d2742,_0x5af880){var _0x408f1c={};var _0x2ed08f={};var _0x195f85;var _0xab4065;return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0xf5b5e5['params']['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x5d2742,null))['then'](function(_0x50562a){if(_0x50562a){_0x195f85=_0x50562a;_0x2ed08f[_0xaf8a('0x4b')]=_[_0xaf8a('0x4d')](db[_0xaf8a('0x97')][_0xaf8a('0x47')]);_0x2ed08f[_0xaf8a('0x4c')]=_[_0xaf8a('0x4d')](_0xf5b5e5[_0xaf8a('0x4c')]);_0x2ed08f['filters']=_[_0xaf8a('0x4f')](_0x2ed08f[_0xaf8a('0x4b')],_0x2ed08f[_0xaf8a('0x4c')]);_0x408f1c['attributes']=_[_0xaf8a('0x4f')](_0x2ed08f[_0xaf8a('0x4b')],qs['fields'](_0xf5b5e5['query'][_0xaf8a('0x51')]));_0x408f1c[_0xaf8a('0x50')]=_0x408f1c[_0xaf8a('0x50')][_0xaf8a('0x52')]?_0x408f1c[_0xaf8a('0x50')]:_0x2ed08f['model'];_0x408f1c[_0xaf8a('0x6f')]=qs[_0xaf8a('0x55')](_0xf5b5e5['query'][_0xaf8a('0x55')]);_0x408f1c[_0xaf8a('0x56')]=qs['filters'](_[_0xaf8a('0x57')](_0xf5b5e5['query'],_0x2ed08f[_0xaf8a('0x4e')]));if(_0xf5b5e5[_0xaf8a('0x4c')][_0xaf8a('0x58')]){_0x408f1c[_0xaf8a('0x56')]=_['merge'](_0x408f1c['where'],{'$or':_['map'](_0x408f1c['attributes'],function(_0x1ad893){var _0xbdc7de={};_0xbdc7de[_0x1ad893]={'$like':'%'+_0xf5b5e5[_0xaf8a('0x4c')][_0xaf8a('0x58')]+'%'};return _0xbdc7de;})});}_0x408f1c=_['merge']({},_0x408f1c,_0xf5b5e5[_0xaf8a('0x6b')]);return _0x195f85[_0xaf8a('0x9d')](_0x408f1c);}})[_0xaf8a('0x3c')](function(_0x253e1d){if(_0x253e1d){_0xab4065=_0x253e1d[_0xaf8a('0x52')];if(!_0xf5b5e5[_0xaf8a('0x4c')][_0xaf8a('0x53')]('nolimit')){_0x408f1c[_0xaf8a('0x35')]=qs[_0xaf8a('0x35')](_0xf5b5e5['query'][_0xaf8a('0x35')]);_0x408f1c[_0xaf8a('0x33')]=qs['offset'](_0xf5b5e5['query']['offset']);}return _0x195f85['getApplications'](_0x408f1c);}})[_0xaf8a('0x3c')](function(_0x23e82d){if(_0x23e82d){return _0x23e82d?{'count':_0xab4065,'rows':_0x23e82d}:null;}})['then'](respondWithResult(_0x5d2742,null))[_0xaf8a('0x2e')](handleError(_0x5d2742,null));};exports['getMessages']=function(_0x169af1,_0x421669,_0x54e388){var _0x20c4df={'raw':!![],'where':{}};var _0x46f46b={};var _0x404e33={'count':0x0,'rows':[]};return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x169af1[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x421669,null))[_0xaf8a('0x3c')](function(_0x1a2c16){if(_0x1a2c16){_0x46f46b[_0xaf8a('0x4b')]=_[_0xaf8a('0x4d')](db[_0xaf8a('0x9e')][_0xaf8a('0x47')]);_0x46f46b['query']=_[_0xaf8a('0x4d')](_0x169af1[_0xaf8a('0x4c')]);_0x46f46b[_0xaf8a('0x4e')]=_['intersection'](_0x46f46b[_0xaf8a('0x4b')],_0x46f46b['query']);_0x20c4df[_0xaf8a('0x50')]=_[_0xaf8a('0x4f')](_0x46f46b[_0xaf8a('0x4b')],qs[_0xaf8a('0x51')](_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x51')]));_0x20c4df['attributes']=_0x20c4df[_0xaf8a('0x50')][_0xaf8a('0x52')]?_0x20c4df[_0xaf8a('0x50')]:_0x46f46b[_0xaf8a('0x4b')];if(!_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x53')](_0xaf8a('0x54'))){_0x20c4df[_0xaf8a('0x35')]=qs[_0xaf8a('0x35')](_0x169af1['query'][_0xaf8a('0x35')]);_0x20c4df['offset']=qs[_0xaf8a('0x33')](_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x33')]);}_0x20c4df['order']=qs[_0xaf8a('0x55')](_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x55')]);_0x20c4df[_0xaf8a('0x56')]=qs['filters'](_[_0xaf8a('0x57')](_0x169af1['query'],_0x46f46b['filters']));_0x20c4df['where'][_0xaf8a('0x67')]=_0x1a2c16['id'];if(_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x58')]){_0x20c4df['where']=_[_0xaf8a('0x59')](_0x20c4df['where'],{'$or':_[_0xaf8a('0x45')](_0x20c4df[_0xaf8a('0x50')],function(_0x10cab2){var _0x317f65={};_0x317f65[_0x10cab2]={'$like':'%'+_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x58')]+'%'};return _0x317f65;})});}if(_0x169af1[_0xaf8a('0x4c')][_0xaf8a('0x9f')]){var _0x3c2b43=_0x169af1[_0xaf8a('0x4c')]['$gte']['split'](',');var _0x156294={};_0x156294[_0x3c2b43[0x0]]={'$gte':moment(_0x3c2b43[0x1])[_0xaf8a('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x20c4df['where']=_[_0xaf8a('0x59')](_0x20c4df[_0xaf8a('0x56')],_0x156294);}_0x20c4df=_[_0xaf8a('0x59')]({},_0x20c4df,_0x169af1[_0xaf8a('0x6b')]);return db[_0xaf8a('0x9e')][_0xaf8a('0x36')]({'where':_0x20c4df['where']})[_0xaf8a('0x3c')](function(_0x5b9cd2){_0x404e33[_0xaf8a('0x36')]=_0x5b9cd2;if(_0x169af1[_0xaf8a('0x4c')]['includeAll']){_0x20c4df[_0xaf8a('0x5c')]=[{'all':!![]}];}return db[_0xaf8a('0x9e')]['findAll'](_0x20c4df);})['then'](function(_0x46f464){if(_0x169af1['query'][_0xaf8a('0xa1')]==='true'){for(var _0x5503ee=0x0;_0x5503ee<_0x46f464[_0xaf8a('0x52')];_0x5503ee++){_0x46f464[_0x5503ee][_0xaf8a('0x64')]=juice(_0x46f464[_0x5503ee][_0xaf8a('0x64')]);}}_0x404e33[_0xaf8a('0x5e')]=_0x46f464;return _0x404e33;});}})[_0xaf8a('0x3c')](respondWithFilteredResult(_0x421669,_0x20c4df))['catch'](handleError(_0x421669,null));};exports['send']=function(_0x52ba4f,_0x58b3e4,_0x5d828e){var _0x250d6c,_0x11555f={},_0x258096;if(_0x52ba4f[_0xaf8a('0x64')]['to']){_0x258096=_0x52ba4f[_0xaf8a('0x64')]['to'][_0xaf8a('0xa2')](',')[0x0];}return db[_0xaf8a('0x46')][_0xaf8a('0x65')]({'where':{'id':_0x52ba4f[_0xaf8a('0x60')]['id']},'include':[{'model':db[_0xaf8a('0xa3')],'as':_0xaf8a('0xa4'),'include':[{'model':db[_0xaf8a('0x8c')],'as':_0xaf8a('0xa5'),'where':{'email':_0x258096},'limit':0x1,'order':[[_0xaf8a('0xa6'),_0xaf8a('0xa7')]]}]},{'model':db[_0xaf8a('0x62')],'as':_0xaf8a('0x63'),'raw':!![]}]})[_0xaf8a('0x3c')](handleEntityNotFound(_0x58b3e4,null))[_0xaf8a('0x3c')](function(_0x2c5e8d){if(_0x2c5e8d){_0x250d6c=_0x2c5e8d;if(_0x2c5e8d[_0xaf8a('0x63')]){if(_[_0xaf8a('0xa8')](_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xa9')])){_0x52ba4f[_0xaf8a('0x64')]['from']=util[_0xaf8a('0xa0')](_0xaf8a('0xaa'),_0x2c5e8d[_0xaf8a('0x40')],_0x2c5e8d[_0xaf8a('0x71')]||_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x76')]);}if(_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xab')]&&_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xab')][_0xaf8a('0x52')]){for(var _0x3bcaf6=0x0;_0x3bcaf6<_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xab')][_0xaf8a('0x52')];_0x3bcaf6+=0x1){_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xab')][_0x3bcaf6]={'filename':_0x52ba4f[_0xaf8a('0x64')]['attachments'][_0x3bcaf6][_0xaf8a('0x40')],'path':path[_0xaf8a('0xac')](config[_0xaf8a('0xad')],_0xaf8a('0xae'),_0x52ba4f[_0xaf8a('0x64')]['attachments'][_0x3bcaf6][_0xaf8a('0xaf')])};}}var _0x486cd3={'tls':{'rejectUnauthorized':![]}};if(_[_0xaf8a('0xa8')](_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x7d')])){if(_0x2c5e8d[_0xaf8a('0x63')]['authentication']){_0x486cd3[_0xaf8a('0xb0')]={'user':_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x76')],'pass':_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x78')]};}_0x486cd3['host']=_0x2c5e8d['Smtp'][_0xaf8a('0x7b')];_0x486cd3[_0xaf8a('0x7c')]=_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x7c')];_0x486cd3['secure']=_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0xb1')];}else{_0x486cd3['service']=_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x7d')];_0x486cd3[_0xaf8a('0xb0')]={'user':_0x2c5e8d['Smtp'][_0xaf8a('0x76')],'pass':_0x2c5e8d[_0xaf8a('0x63')][_0xaf8a('0x78')]};}return respondWithRpcPromise('SendMail',_0xaf8a('0xb2'),{'account':_0x486cd3,'message':_0x52ba4f[_0xaf8a('0x64')]});}else{throw new Error(_0xaf8a('0xb3'));}}})[_0xaf8a('0x3c')](function(_0x10e448){if(_0x10e448){_0x11555f=_0x10e448;if(_0x250d6c['List']){if(_0x250d6c['List'][_0xaf8a('0xa5')][_0xaf8a('0x52')]){return _0x250d6c[_0xaf8a('0xa4')][_0xaf8a('0xa5')][0x0];}else{return db['CmContact']['create'](_[_0xaf8a('0x1e')](_0x52ba4f['body'],{'firstName':_0x52ba4f[_0xaf8a('0x64')]['to'],'email':_0x52ba4f[_0xaf8a('0x64')]['to'],'phone':_0x52ba4f['body']['to'],'ListId':_0x250d6c[_0xaf8a('0x72')]}));}}else{throw new Error(_0xaf8a('0xb3'));}}})[_0xaf8a('0x3c')](function(_0x24bfc3){if(_0x24bfc3){var _0x237234={'UserId':_0x52ba4f[_0xaf8a('0x76')]['id'],'ContactId':_0x24bfc3['id'],'MailAccountId':_0x250d6c['id'],'inReplyTo':_0x11555f[_0xaf8a('0xb4')],'to':_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xa9')],'cc':_0x52ba4f[_0xaf8a('0x64')]['cc'],'subject':_0x52ba4f['body'][_0xaf8a('0xb5')],'attach':_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xb6')],'firstMsgDirection':_0xaf8a('0xb7'),'lastMsgAt':moment()[_0xaf8a('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xaf8a('0xb7'),'Messages':[_[_0xaf8a('0x59')](_0x52ba4f[_0xaf8a('0x64')],{'messageId':_0x11555f[_0xaf8a('0xb4')],'sentAt':moment()[_0xaf8a('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x250d6c['id'],'UserId':_0x52ba4f[_0xaf8a('0x76')]['id'],'ContactId':_0x24bfc3['id']})]};if(_0x52ba4f[_0xaf8a('0x64')][_0xaf8a('0xb8')]){_0x237234=_[_0xaf8a('0x59')](_0x237234,_0x52ba4f[_0xaf8a('0x64')]['Interaction']);}return db['MailInteraction'][_0xaf8a('0x68')](_0x237234,{'include':[{'model':db[_0xaf8a('0x9e')],'as':_0xaf8a('0xb9')}]});}})['then'](respondWithResult(_0x58b3e4,null))['catch'](handleError(_0x58b3e4,null));};exports[_0xaf8a('0xba')]=function(_0xf69796,_0x2098dc,_0x28d7c8){return db['MailAccount'][_0xaf8a('0x65')]({'where':{'id':_0xf69796[_0xaf8a('0x60')]['id']},'include':[{'model':db[_0xaf8a('0x62')],'as':_0xaf8a('0x63'),'raw':!![]}]})['then'](handleEntityNotFound(_0x2098dc,null))[_0xaf8a('0x3c')](function(_0x2e4a00){if(_0x2e4a00&&_0x2e4a00['Smtp']){var _0x37bcc8={'id':_0x2e4a00['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e4a00[_0xaf8a('0x63')]['service']){_0x37bcc8[_0xaf8a('0x7d')]=_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x7d')];}else{_0x37bcc8['host']=_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x7b')];_0x37bcc8[_0xaf8a('0x7c')]=_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x7c')];_0x37bcc8[_0xaf8a('0xb1')]=_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0xb1')];}if(_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x7a')]){_0x37bcc8[_0xaf8a('0xb0')]={'user':_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x76')],'pass':_0x2e4a00[_0xaf8a('0x63')][_0xaf8a('0x78')]};}return respondWithRpcPromise(_0xaf8a('0xbb'),_0xaf8a('0xba'),{'account':_0x37bcc8});}})['then'](respondWithResult(_0x2098dc,null))[_0xaf8a('0x2e')](handleError(_0x2098dc,null));};exports['destroy']=function(_0x150126,_0x3f9f7a){return db[_0xaf8a('0x46')][_0xaf8a('0x65')]({'where':{'id':_0x150126[_0xaf8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x3f9f7a,null))[_0xaf8a('0x3c')](function(_0x26a773){if(_0x26a773&&_0x26a773[_0xaf8a('0x7d')]){throw new db[(_0xaf8a('0xbc'))][(_0xaf8a('0xbd'))](_0xaf8a('0xbe'));}return _0x26a773;})[_0xaf8a('0x3c')](removeEntity(_0x3f9f7a,null))[_0xaf8a('0x2e')](handleError(_0x3f9f7a,null));};exports[_0xaf8a('0xbf')]=function(_0x43abdf,_0x3dc823,_0x13edc9){return db[_0xaf8a('0x46')][_0xaf8a('0x65')]({'where':{'id':_0x43abdf[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x3dc823,null))[_0xaf8a('0x3c')](function(_0x549cd0){if(_0x549cd0){return _0x549cd0[_0xaf8a('0xbf')](_0x43abdf[_0xaf8a('0x64')][_0xaf8a('0x70')],_['omit'](_0x43abdf['body'],[_0xaf8a('0x70'),'id'])||{})[_0xaf8a('0xc0')](function(_0x7d14e5){for(var _0x4f20c0=0x0;_0x4f20c0<_0x43abdf[_0xaf8a('0x64')]['ids'][_0xaf8a('0x52')];_0x4f20c0+=0x1){socket[_0xaf8a('0xc1')](_0xaf8a('0xc2'),{'UserId':Number(_0x43abdf['body'][_0xaf8a('0x70')][_0x4f20c0]),'MailAccountId':Number(_0x43abdf['params']['id'])});}return _0x7d14e5;});}})[_0xaf8a('0x3c')](respondWithResult(_0x3dc823,null))[_0xaf8a('0x2e')](handleError(_0x3dc823,null));};exports[_0xaf8a('0xc3')]=function(_0xb2af21,_0x4b76ea,_0x55a1d2){return db['MailAccount'][_0xaf8a('0x65')]({'where':{'id':_0xb2af21[_0xaf8a('0x60')]['id']}})[_0xaf8a('0x3c')](handleEntityNotFound(_0x4b76ea,null))[_0xaf8a('0x3c')](function(_0x2bbbde){if(_0x2bbbde){return _0x2bbbde['removeAgents'](_0xb2af21[_0xaf8a('0x4c')][_0xaf8a('0x70')])['then'](function(){if(_[_0xaf8a('0xc4')](_0xb2af21['query']['ids'])){for(var _0x4a3c73=0x0;_0x4a3c73<_0xb2af21[_0xaf8a('0x4c')][_0xaf8a('0x70')][_0xaf8a('0x52')];_0x4a3c73+=0x1){socket[_0xaf8a('0xc1')](_0xaf8a('0xc5'),{'UserId':Number(_0xb2af21[_0xaf8a('0x4c')]['ids'][_0x4a3c73]),'MailAccountId':Number(_0xb2af21[_0xaf8a('0x60')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0xb2af21[_0xaf8a('0x4c')][_0xaf8a('0x70')]),'MailAccountId':Number(_0xb2af21[_0xaf8a('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b76ea,null))[_0xaf8a('0x2e')](handleError(_0x4b76ea,null));};exports[_0xaf8a('0xc6')]=function(_0x329a87,_0x79c6cf,_0xf2dd82){var _0x7f7385={};var _0x425c57={};var _0x5d6b14;var _0x416542;return db[_0xaf8a('0x46')][_0xaf8a('0x69')]({'where':{'id':_0x329a87['params']['id']}})['then'](handleEntityNotFound(_0x79c6cf,null))[_0xaf8a('0x3c')](function(_0x2e782c){if(_0x2e782c){_0x5d6b14=_0x2e782c;_0x425c57['model']=_[_0xaf8a('0x4d')](db[_0xaf8a('0xc7')]['rawAttributes']);_0x425c57[_0xaf8a('0x4c')]=_[_0xaf8a('0x4d')](_0x329a87[_0xaf8a('0x4c')]);_0x425c57[_0xaf8a('0x4e')]=_[_0xaf8a('0x4f')](_0x425c57[_0xaf8a('0x4b')],_0x425c57['query']);_0x7f7385['attributes']=_[_0xaf8a('0x4f')](_0x425c57['model'],qs['fields'](_0x329a87[_0xaf8a('0x4c')][_0xaf8a('0x51')]));_0x7f7385[_0xaf8a('0x50')]=_0x7f7385[_0xaf8a('0x50')][_0xaf8a('0x52')]?_0x7f7385[_0xaf8a('0x50')]:_0x425c57['model'];_0x7f7385[_0xaf8a('0x6f')]=qs[_0xaf8a('0x55')](_0x329a87[_0xaf8a('0x4c')]['sort']);_0x7f7385['where']=qs['filters'](_['pick'](_0x329a87['query'],_0x425c57[_0xaf8a('0x4e')]));if(_0x329a87[_0xaf8a('0x4c')][_0xaf8a('0x58')]){_0x7f7385['where']=_[_0xaf8a('0x59')](_0x7f7385[_0xaf8a('0x56')],{'$or':_[_0xaf8a('0x45')](_0x7f7385[_0xaf8a('0x50')],function(_0x4b6afa){var _0xa179d7={};_0xa179d7[_0x4b6afa]={'$like':'%'+_0x329a87[_0xaf8a('0x4c')]['filter']+'%'};return _0xa179d7;})});}_0x7f7385=_[_0xaf8a('0x59')]({},_0x7f7385,_0x329a87[_0xaf8a('0x6b')]);return _0x5d6b14[_0xaf8a('0xc6')](_0x7f7385);}})[_0xaf8a('0x3c')](function(_0x4a56be){if(_0x4a56be){_0x416542=_0x4a56be['length'];if(!_0x329a87[_0xaf8a('0x4c')][_0xaf8a('0x53')](_0xaf8a('0x54'))){_0x7f7385[_0xaf8a('0x35')]=qs[_0xaf8a('0x35')](_0x329a87[_0xaf8a('0x4c')][_0xaf8a('0x35')]);_0x7f7385[_0xaf8a('0x33')]=qs[_0xaf8a('0x33')](_0x329a87[_0xaf8a('0x4c')]['offset']);}return _0x5d6b14[_0xaf8a('0xc6')](_0x7f7385);}})[_0xaf8a('0x3c')](function(_0x2f606a){if(_0x2f606a){return _0x2f606a?{'count':_0x416542,'rows':_0x2f606a}:null;}})[_0xaf8a('0x3c')](respondWithResult(_0x79c6cf,null))[_0xaf8a('0x2e')](handleError(_0x79c6cf,null));}; \ No newline at end of file +var _0xabe7=['finally','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','authentication','secure','auth','SendMail','sendMail','CmContact','defaults','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','redis','./mailAccount.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','MailAccounts','UserProfileResource','destroy','end','stack','name','send','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailAccount','include','findAll','show','params','MailServerOut','body','describe','find','MailAccountId','Disposition','create','findOne','pick','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','port','host','service','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','MailInteraction','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority'];(function(_0x2841e4,_0x34bb40){var _0x21df4c=function(_0x29a3b8){while(--_0x29a3b8){_0x2841e4['push'](_0x2841e4['shift']());}};_0x21df4c(++_0x34bb40);}(_0xabe7,0x1b0));var _0x7abe=function(_0x45b55b,_0x458b97){_0x45b55b=_0x45b55b-0x0;var _0x1d8900=_0xabe7[_0x45b55b];return _0x1d8900;};'use strict';var emlformat=require(_0x7abe('0x0'));var rimraf=require(_0x7abe('0x1'));var zipdir=require(_0x7abe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7abe('0x3'));var moment=require(_0x7abe('0x4'));var BPromise=require(_0x7abe('0x5'));var Mustache=require('mustache');var util=require(_0x7abe('0x6'));var path=require(_0x7abe('0x7'));var sox=require('sox');var csv=require(_0x7abe('0x8'));var ejs=require(_0x7abe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7abe('0xa'));var squel=require(_0x7abe('0xb'));var crypto=require(_0x7abe('0xc'));var jsforce=require(_0x7abe('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7abe('0xe'));var Papa=require(_0x7abe('0xf'));var htmlToText=require(_0x7abe('0x10'));var juice=require(_0x7abe('0x11'));var Redis=require(_0x7abe('0x12'));var authService=require(_0x7abe('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7abe('0x14'));var logger=require('../../config/logger')(_0x7abe('0x15'));var utils=require(_0x7abe('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7abe('0x17'));var db=require(_0x7abe('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7abe('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7abe('0x1a')]));require(_0x7abe('0x1b'))[_0x7abe('0x1c')](socket);var jayson=require(_0x7abe('0x1d'));var client=jayson[_0x7abe('0x1e')][_0x7abe('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x4e0d20,_0x4fe2f4,_0x467052,_0x4a6cbf){return new BPromise(function(_0x35929f,_0x454427){var _0x56dbe3=_0x4a6cbf||client;return _0x56dbe3['request'](_0x4e0d20,_0x467052)['then'](function(_0x5c3db1){logger[_0x7abe('0x20')]('MailAccount,\x20%s,\x20%s',_0x4fe2f4,_0x7abe('0x21'));logger[_0x7abe('0x22')](_0x7abe('0x23'),_0x4fe2f4,_0x7abe('0x21'),JSON[_0x7abe('0x24')](_0x5c3db1));if(_0x5c3db1[_0x7abe('0x25')]){if(_0x5c3db1['error'][_0x7abe('0x26')]===0x1f4){logger['error'](_0x7abe('0x27'),_0x4fe2f4,_0x5c3db1['error'][_0x7abe('0x28')]);return _0x454427(_0x5c3db1[_0x7abe('0x25')][_0x7abe('0x28')]);}logger[_0x7abe('0x25')](_0x7abe('0x27'),_0x4fe2f4,_0x5c3db1[_0x7abe('0x25')]['message']);return _0x35929f(_0x5c3db1[_0x7abe('0x25')][_0x7abe('0x28')]);}else{logger['info'](_0x7abe('0x27'),_0x4fe2f4,_0x7abe('0x21'));_0x35929f(_0x5c3db1[_0x7abe('0x29')][_0x7abe('0x28')]);}})[_0x7abe('0x2a')](function(_0x19ce00){logger[_0x7abe('0x25')](_0x7abe('0x27'),_0x4fe2f4,_0x19ce00);_0x454427(_0x19ce00);});});}function respondWithStatusCode(_0x4c40e5,_0x585595){_0x585595=_0x585595||0xcc;return function(_0x3cdd47){if(_0x3cdd47){return _0x4c40e5['sendStatus'](_0x585595);}return _0x4c40e5['status'](_0x585595)['end']();};}function respondWithResult(_0x2339a4,_0xa6a52d){_0xa6a52d=_0xa6a52d||0xc8;return function(_0x39cd99){if(_0x39cd99){return _0x2339a4[_0x7abe('0x2b')](_0xa6a52d)[_0x7abe('0x2c')](_0x39cd99);}};}function respondWithFilteredResult(_0x311d44,_0x276f15){return function(_0x38454e){if(_0x38454e){var _0x20cfd9=typeof _0x276f15[_0x7abe('0x2d')]===_0x7abe('0x2e')&&typeof _0x276f15[_0x7abe('0x2f')]===_0x7abe('0x2e');var _0x2b1975=_0x38454e[_0x7abe('0x30')];var _0x3212f8=_0x20cfd9?0x0:_0x276f15[_0x7abe('0x2d')];var _0x527de8=_0x20cfd9?_0x38454e[_0x7abe('0x30')]:_0x276f15[_0x7abe('0x2d')]+_0x276f15[_0x7abe('0x2f')];var _0x3b3fcb;if(_0x527de8>=_0x2b1975){_0x527de8=_0x2b1975;_0x3b3fcb=0xc8;}else{_0x3b3fcb=0xce;}_0x311d44[_0x7abe('0x2b')](_0x3b3fcb);return _0x311d44[_0x7abe('0x31')](_0x7abe('0x32'),_0x3212f8+'-'+_0x527de8+'/'+_0x2b1975)[_0x7abe('0x2c')](_0x38454e);}return null;};}function patchUpdates(_0xe1b38b){return function(_0x592cbe){try{jsonpatch[_0x7abe('0x33')](_0x592cbe,_0xe1b38b,!![]);}catch(_0x39e20f){return BPromise[_0x7abe('0x34')](_0x39e20f);}return _0x592cbe[_0x7abe('0x35')]();};}function saveUpdates(_0x3b1fed,_0x54a30e){return function(_0xbbf06b){if(_0xbbf06b){return _0xbbf06b[_0x7abe('0x36')](_0x3b1fed)['then'](function(_0x11926c){return _0x11926c;});}return null;};}function removeEntity(_0x2c1380,_0x122807){return function(_0xd998f5){if(_0xd998f5){return _0xd998f5['destroy']()[_0x7abe('0x37')](function(){var _0x45cb53=_0xd998f5['get']({'plain':!![]});var _0x322292=_0x7abe('0x38');return db[_0x7abe('0x39')][_0x7abe('0x3a')]({'where':{'type':_0x322292,'resourceId':_0x45cb53['id']}})[_0x7abe('0x37')](function(){return _0xd998f5;});})[_0x7abe('0x37')](function(){_0x2c1380[_0x7abe('0x2b')](0xcc)[_0x7abe('0x3b')]();});}};}function handleEntityNotFound(_0x2f447a,_0x13ab7c){return function(_0x383a3d){if(!_0x383a3d){_0x2f447a['sendStatus'](0x194);}return _0x383a3d;};}function handleError(_0x3ba854,_0x4cd8c7){_0x4cd8c7=_0x4cd8c7||0x1f4;return function(_0x415419){logger[_0x7abe('0x25')](_0x415419[_0x7abe('0x3c')]);if(_0x415419[_0x7abe('0x3d')]){delete _0x415419[_0x7abe('0x3d')];}_0x3ba854[_0x7abe('0x2b')](_0x4cd8c7)[_0x7abe('0x3e')](_0x415419);};}exports['index']=function(_0x2e31f8,_0x4a5f6a){var _0x115b03={'include':[{'model':db[_0x7abe('0x3f')],'as':_0x7abe('0x40')},{'model':db['MailServerOut'],'as':_0x7abe('0x41')},{'model':db[_0x7abe('0x42')],'as':_0x7abe('0x43')}]},_0x2182d8={},_0x1b895a={'count':0x0,'rows':[]};var _0xdbfd8b=_[_0x7abe('0x44')](db['MailAccount'][_0x7abe('0x45')],function(_0x1c85a1){return{'name':_0x1c85a1[_0x7abe('0x46')],'type':_0x1c85a1[_0x7abe('0x47')][_0x7abe('0x48')]};});_0x2182d8[_0x7abe('0x49')]=_[_0x7abe('0x44')](_0xdbfd8b,_0x7abe('0x3d'));_0x2182d8[_0x7abe('0x4a')]=_[_0x7abe('0x4b')](_0x2e31f8[_0x7abe('0x4a')]);_0x2182d8[_0x7abe('0x4c')]=_[_0x7abe('0x4d')](_0x2182d8[_0x7abe('0x49')],_0x2182d8['query']);_0x115b03[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x2182d8[_0x7abe('0x49')],qs['fields'](_0x2e31f8['query'][_0x7abe('0x4f')]));_0x115b03['attributes']=_0x115b03[_0x7abe('0x4e')][_0x7abe('0x50')]?_0x115b03[_0x7abe('0x4e')]:_0x2182d8[_0x7abe('0x49')];if(!_0x2e31f8[_0x7abe('0x4a')][_0x7abe('0x51')](_0x7abe('0x52'))){_0x115b03['limit']=qs['limit'](_0x2e31f8[_0x7abe('0x4a')]['limit']);_0x115b03['offset']=qs[_0x7abe('0x2d')](_0x2e31f8[_0x7abe('0x4a')][_0x7abe('0x2d')]);}_0x115b03[_0x7abe('0x53')]=qs[_0x7abe('0x54')](_0x2e31f8[_0x7abe('0x4a')][_0x7abe('0x54')]);_0x115b03[_0x7abe('0x55')]=qs[_0x7abe('0x4c')](_['pick'](_0x2e31f8[_0x7abe('0x4a')],_0x2182d8[_0x7abe('0x4c')]),_0xdbfd8b);if(_0x2e31f8[_0x7abe('0x4a')][_0x7abe('0x56')]){_0x115b03[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0x115b03['where'],{'$or':_[_0x7abe('0x44')](_0xdbfd8b,function(_0x273c6){if(_0x273c6['type']!==_0x7abe('0x58')){var _0x415d33={};_0x415d33[_0x273c6[_0x7abe('0x3d')]]={'$like':'%'+_0x2e31f8[_0x7abe('0x4a')][_0x7abe('0x56')]+'%'};return _0x415d33;}})});}_0x115b03=_['merge']({},_0x115b03,_0x2e31f8[_0x7abe('0x59')]);var _0x1b21fe={'where':_0x115b03[_0x7abe('0x55')]};return db[_0x7abe('0x5a')][_0x7abe('0x30')](_0x1b21fe)[_0x7abe('0x37')](function(_0xc61f27){_0x1b895a[_0x7abe('0x30')]=_0xc61f27;if(_0x2e31f8[_0x7abe('0x4a')]['includeAll']){_0x115b03[_0x7abe('0x5b')]=[{'all':!![]}];}return db[_0x7abe('0x5a')][_0x7abe('0x5c')](_0x115b03);})[_0x7abe('0x37')](function(_0x3a3a40){_0x1b895a['rows']=_0x3a3a40;return _0x1b895a;})[_0x7abe('0x37')](respondWithFilteredResult(_0x4a5f6a,_0x115b03))[_0x7abe('0x2a')](handleError(_0x4a5f6a,null));};exports[_0x7abe('0x5d')]=function(_0x191104,_0xee8b3a){var _0x517dbf={'raw':![],'where':{'id':_0x191104[_0x7abe('0x5e')]['id']},'include':[{'model':db[_0x7abe('0x3f')],'as':_0x7abe('0x40')},{'model':db[_0x7abe('0x5f')],'as':_0x7abe('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x219c65={};_0x219c65[_0x7abe('0x49')]=_['keys'](db[_0x7abe('0x5a')]['rawAttributes']);_0x219c65['query']=_[_0x7abe('0x4b')](_0x191104[_0x7abe('0x4a')]);_0x219c65[_0x7abe('0x4c')]=_[_0x7abe('0x4d')](_0x219c65['model'],_0x219c65['query']);_0x517dbf[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x219c65[_0x7abe('0x49')],qs[_0x7abe('0x4f')](_0x191104[_0x7abe('0x4a')]['fields']));_0x517dbf['attributes']=_0x517dbf[_0x7abe('0x4e')][_0x7abe('0x50')]?_0x517dbf['attributes']:_0x219c65[_0x7abe('0x49')];if(_0x191104['query']['includeAll']){_0x517dbf[_0x7abe('0x5b')]=[{'all':!![]}];}_0x517dbf=_[_0x7abe('0x57')]({},_0x517dbf,_0x191104['options']);return db[_0x7abe('0x5a')]['find'](_0x517dbf)['then'](handleEntityNotFound(_0xee8b3a,null))[_0x7abe('0x37')](respondWithResult(_0xee8b3a,null))['catch'](handleError(_0xee8b3a,null));};exports['update']=function(_0x15627a,_0xd228f5){if(_0x15627a[_0x7abe('0x60')]['id']){delete _0x15627a[_0x7abe('0x60')]['id'];}return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x15627a[_0x7abe('0x5e')]['id']},'include':[{'model':db[_0x7abe('0x3f')],'as':_0x7abe('0x40')},{'model':db[_0x7abe('0x5f')],'as':_0x7abe('0x41')},{'model':db[_0x7abe('0x42')],'as':_0x7abe('0x43')}]})[_0x7abe('0x37')](handleEntityNotFound(_0xd228f5,null))['then'](saveUpdates(_0x15627a[_0x7abe('0x60')],null))[_0x7abe('0x37')](function(_0x592398){if(_0x592398&&_0x15627a[_0x7abe('0x60')]['Imap']){return db[_0x7abe('0x3f')][_0x7abe('0x36')](_0x15627a['body']['Imap'],{'where':{'MailAccountId':_0x592398['id']}})[_0x7abe('0x37')](function(){return _0x592398;});}return _0x592398;})[_0x7abe('0x37')](function(_0x27f38d){if(_0x27f38d&&_0x15627a[_0x7abe('0x60')][_0x7abe('0x41')]){return db[_0x7abe('0x5f')][_0x7abe('0x36')](_0x15627a['body'][_0x7abe('0x41')],{'where':{'MailAccountId':_0x27f38d['id']}})[_0x7abe('0x37')](function(){return _0x27f38d;});}return _0x27f38d;})['then'](respondWithResult(_0xd228f5,null))[_0x7abe('0x2a')](handleError(_0xd228f5,null));};exports[_0x7abe('0x61')]=function(_0x20f7bd,_0x5b5aea){return db['MailAccount'][_0x7abe('0x61')]()[_0x7abe('0x37')](respondWithResult(_0x5b5aea,null))['catch'](handleError(_0x5b5aea,null));};exports['addDisposition']=function(_0x35d59a,_0x5d78b1,_0x23629f){if(_0x35d59a['body']['id']){delete _0x35d59a[_0x7abe('0x60')]['id'];}return db[_0x7abe('0x5a')][_0x7abe('0x62')]({'where':{'id':_0x35d59a[_0x7abe('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5d78b1,null))[_0x7abe('0x37')](function(_0x34e3ff){if(_0x34e3ff){_0x35d59a[_0x7abe('0x60')][_0x7abe('0x63')]=_0x34e3ff['id'];return db[_0x7abe('0x64')][_0x7abe('0x65')](_0x35d59a[_0x7abe('0x60')]);}})['then'](respondWithResult(_0x5d78b1,null))[_0x7abe('0x2a')](handleError(_0x5d78b1,null));};exports['getDispositions']=function(_0x2cf5ef,_0x164308,_0x1ab51d){var _0xe4dbea={'raw':![],'where':{}};var _0x109d94={};var _0xc7b22a={'count':0x0,'rows':[]};return db[_0x7abe('0x5a')][_0x7abe('0x66')]({'where':{'id':_0x2cf5ef[_0x7abe('0x5e')]['id']}})['then'](handleEntityNotFound(_0x164308,null))[_0x7abe('0x37')](function(_0x4acc30){if(_0x4acc30){_0x109d94[_0x7abe('0x49')]=_['keys'](db[_0x7abe('0x64')][_0x7abe('0x45')]);_0x109d94[_0x7abe('0x4a')]=_[_0x7abe('0x4b')](_0x2cf5ef[_0x7abe('0x4a')]);_0x109d94[_0x7abe('0x4c')]=_['intersection'](_0x109d94['model'],_0x109d94[_0x7abe('0x4a')]);_0xe4dbea['attributes']=_[_0x7abe('0x4d')](_0x109d94[_0x7abe('0x49')],qs[_0x7abe('0x4f')](_0x2cf5ef[_0x7abe('0x4a')][_0x7abe('0x4f')]));_0xe4dbea[_0x7abe('0x4e')]=_0xe4dbea['attributes'][_0x7abe('0x50')]?_0xe4dbea[_0x7abe('0x4e')]:_0x109d94[_0x7abe('0x49')];if(!_0x2cf5ef[_0x7abe('0x4a')]['hasOwnProperty'](_0x7abe('0x52'))){_0xe4dbea[_0x7abe('0x2f')]=qs['limit'](_0x2cf5ef[_0x7abe('0x4a')]['limit']);_0xe4dbea[_0x7abe('0x2d')]=qs[_0x7abe('0x2d')](_0x2cf5ef[_0x7abe('0x4a')][_0x7abe('0x2d')]);}_0xe4dbea[_0x7abe('0x53')]=qs[_0x7abe('0x54')](_0x2cf5ef['query'][_0x7abe('0x54')]);_0xe4dbea[_0x7abe('0x55')]=qs['filters'](_[_0x7abe('0x67')](_0x2cf5ef[_0x7abe('0x4a')],_0x109d94[_0x7abe('0x4c')]));_0xe4dbea[_0x7abe('0x55')][_0x7abe('0x63')]=_0x4acc30['id'];if(_0x2cf5ef[_0x7abe('0x4a')][_0x7abe('0x56')]){_0xe4dbea[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0xe4dbea[_0x7abe('0x55')],{'$or':_['map'](_0xe4dbea['attributes'],function(_0x515b3c){var _0x35c5b3={};_0x35c5b3[_0x515b3c]={'$like':'%'+_0x2cf5ef[_0x7abe('0x4a')][_0x7abe('0x56')]+'%'};return _0x35c5b3;})});}_0xe4dbea=_[_0x7abe('0x57')]({},_0xe4dbea,_0x2cf5ef[_0x7abe('0x59')]);return db['Disposition']['count']({'where':_0xe4dbea[_0x7abe('0x55')]})[_0x7abe('0x37')](function(_0xc10dc2){_0xc7b22a['count']=_0xc10dc2;if(_0x2cf5ef[_0x7abe('0x4a')][_0x7abe('0x68')]){_0xe4dbea[_0x7abe('0x5b')]=[{'all':!![]}];}return db[_0x7abe('0x64')]['findAll'](_0xe4dbea);})[_0x7abe('0x37')](function(_0x16e8f0){_0xc7b22a[_0x7abe('0x69')]=_0x16e8f0;return _0xc7b22a;});}})[_0x7abe('0x37')](respondWithFilteredResult(_0x164308,_0xe4dbea))[_0x7abe('0x2a')](handleError(_0x164308,null));};exports['removeDispositions']=function(_0x133690,_0x454791,_0x17c353){return db['MailAccount']['find']({'where':{'id':_0x133690[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x454791,null))[_0x7abe('0x37')](function(_0x29f11d){if(_0x29f11d){return _0x29f11d[_0x7abe('0x6a')](_0x133690[_0x7abe('0x4a')][_0x7abe('0x6b')]);}})['then'](respondWithStatusCode(_0x454791,null))[_0x7abe('0x2a')](handleError(_0x454791,null));};exports[_0x7abe('0x6c')]=function(_0x28a7e2,_0x394385,_0x5148bb){if(_0x28a7e2['body']['id']){delete _0x28a7e2['body']['id'];}return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x28a7e2[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x394385,null))[_0x7abe('0x37')](function(_0x596152){if(_0x596152){_0x28a7e2['body'][_0x7abe('0x63')]=_0x596152['id'];return db[_0x7abe('0x6d')][_0x7abe('0x65')](_0x28a7e2[_0x7abe('0x60')]);}})[_0x7abe('0x37')](respondWithResult(_0x394385,null))[_0x7abe('0x2a')](handleError(_0x394385,null));};exports[_0x7abe('0x6e')]=function(_0x4d3f9d,_0xed6354,_0x3845b8){var _0x4342ec={'raw':![],'where':{}};var _0x293f40={};var _0x4cd5d9={'count':0x0,'rows':[]};return db[_0x7abe('0x5a')][_0x7abe('0x66')]({'where':{'id':_0x4d3f9d[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0xed6354,null))['then'](function(_0x19403c){if(_0x19403c){_0x293f40[_0x7abe('0x49')]=_[_0x7abe('0x4b')](db[_0x7abe('0x6d')][_0x7abe('0x45')]);_0x293f40[_0x7abe('0x4a')]=_[_0x7abe('0x4b')](_0x4d3f9d[_0x7abe('0x4a')]);_0x293f40[_0x7abe('0x4c')]=_[_0x7abe('0x4d')](_0x293f40['model'],_0x293f40['query']);_0x4342ec[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x293f40['model'],qs[_0x7abe('0x4f')](_0x4d3f9d[_0x7abe('0x4a')]['fields']));_0x4342ec[_0x7abe('0x4e')]=_0x4342ec[_0x7abe('0x4e')][_0x7abe('0x50')]?_0x4342ec[_0x7abe('0x4e')]:_0x293f40[_0x7abe('0x49')];if(!_0x4d3f9d[_0x7abe('0x4a')][_0x7abe('0x51')](_0x7abe('0x52'))){_0x4342ec[_0x7abe('0x2f')]=qs['limit'](_0x4d3f9d[_0x7abe('0x4a')][_0x7abe('0x2f')]);_0x4342ec[_0x7abe('0x2d')]=qs['offset'](_0x4d3f9d[_0x7abe('0x4a')]['offset']);}_0x4342ec['order']=qs[_0x7abe('0x54')](_0x4d3f9d[_0x7abe('0x4a')][_0x7abe('0x54')]);_0x4342ec[_0x7abe('0x55')]=qs[_0x7abe('0x4c')](_['pick'](_0x4d3f9d['query'],_0x293f40['filters']));_0x4342ec['where']['MailAccountId']=_0x19403c['id'];if(_0x4d3f9d[_0x7abe('0x4a')]['filter']){_0x4342ec[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0x4342ec[_0x7abe('0x55')],{'$or':_[_0x7abe('0x44')](_0x4342ec[_0x7abe('0x4e')],function(_0x16c667){var _0x1f237f={};_0x1f237f[_0x16c667]={'$like':'%'+_0x4d3f9d[_0x7abe('0x4a')][_0x7abe('0x56')]+'%'};return _0x1f237f;})});}_0x4342ec=_[_0x7abe('0x57')]({},_0x4342ec,_0x4d3f9d[_0x7abe('0x59')]);return db[_0x7abe('0x6d')][_0x7abe('0x30')]({'where':_0x4342ec[_0x7abe('0x55')]})[_0x7abe('0x37')](function(_0x465b06){_0x4cd5d9[_0x7abe('0x30')]=_0x465b06;if(_0x4d3f9d[_0x7abe('0x4a')]['includeAll']){_0x4342ec[_0x7abe('0x5b')]=[{'all':!![]}];}return db[_0x7abe('0x6d')][_0x7abe('0x5c')](_0x4342ec);})[_0x7abe('0x37')](function(_0x404192){_0x4cd5d9[_0x7abe('0x69')]=_0x404192;return _0x4cd5d9;});}})[_0x7abe('0x37')](respondWithFilteredResult(_0xed6354,_0x4342ec))[_0x7abe('0x2a')](handleError(_0xed6354,null));};exports['removeAnswers']=function(_0x594cf6,_0x3970e1,_0x1beb9d){return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x594cf6['params']['id']}})['then'](handleEntityNotFound(_0x3970e1,null))[_0x7abe('0x37')](function(_0x445a6f){if(_0x445a6f){return _0x445a6f['removeAnswers'](_0x594cf6['query'][_0x7abe('0x6b')]);}})[_0x7abe('0x37')](respondWithStatusCode(_0x3970e1,null))['catch'](handleError(_0x3970e1,null));};exports[_0x7abe('0x65')]=function(_0x1fb95d,_0x341ce1){var _0x525c9a={'name':_0x1fb95d[_0x7abe('0x60')]['name'],'key':_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x48')],'email':_0x1fb95d[_0x7abe('0x60')]['email'],'ListId':_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x6f')],'active':!_['isNil'](_0x1fb95d[_0x7abe('0x60')]['active'])?_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x70')]:!![],'description':_0x1fb95d['body'][_0x7abe('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0x7abe('0x72')](_0x1fb95d['body'][_0x7abe('0x73')])){if(_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x74')]){_0x525c9a[_0x7abe('0x40')]['user']=_0x525c9a[_0x7abe('0x41')][_0x7abe('0x75')]=_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x76')];_0x525c9a[_0x7abe('0x40')][_0x7abe('0x77')]=_0x525c9a[_0x7abe('0x41')][_0x7abe('0x78')]=_0x1fb95d['body'][_0x7abe('0x79')];}else{_0x525c9a['Imap']['authentication']=_0x525c9a[_0x7abe('0x41')]['authentication']=![];}_0x525c9a[_0x7abe('0x40')]['host']=_0x1fb95d['body'][_0x7abe('0x40')]['host'];_0x525c9a[_0x7abe('0x40')]['port']=_0x1fb95d['body'][_0x7abe('0x40')][_0x7abe('0x7a')];_0x525c9a[_0x7abe('0x41')]['host']=_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x41')][_0x7abe('0x7b')];_0x525c9a[_0x7abe('0x41')][_0x7abe('0x7a')]=_0x1fb95d['body']['Smtp']['port'];}else{_0x525c9a[_0x7abe('0x40')][_0x7abe('0x7c')]=_0x525c9a[_0x7abe('0x41')]['service']=_0x1fb95d[_0x7abe('0x60')][_0x7abe('0x73')];_0x525c9a['Imap']['user']=_0x525c9a[_0x7abe('0x41')]['user']=_0x1fb95d['body'][_0x7abe('0x76')];_0x525c9a[_0x7abe('0x40')]['password']=_0x525c9a[_0x7abe('0x41')][_0x7abe('0x78')]=_0x1fb95d[_0x7abe('0x60')]['cpassword'];}return db[_0x7abe('0x5a')][_0x7abe('0x65')](_0x525c9a,{'include':[{'model':db[_0x7abe('0x5f')],'as':_0x7abe('0x41')},{'model':db[_0x7abe('0x3f')],'as':_0x7abe('0x40')}]})[_0x7abe('0x37')](function(_0x133cee){var _0x168e72=_0x1fb95d[_0x7abe('0x75')][_0x7abe('0x7d')]({'plain':!![]});if(!_0x168e72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x168e72[_0x7abe('0x7e')]===_0x7abe('0x75')){var _0x36f13b=_0x133cee['get']({'plain':!![]});return db['UserProfileSection'][_0x7abe('0x62')]({'where':{'name':_0x7abe('0x38'),'userProfileId':_0x168e72['userProfileId']},'raw':!![]})[_0x7abe('0x37')](function(_0x8f905){if(_0x8f905&&_0x8f905[_0x7abe('0x7f')]===0x0){return db[_0x7abe('0x39')][_0x7abe('0x65')]({'name':_0x36f13b[_0x7abe('0x3d')],'resourceId':_0x36f13b['id'],'type':_0x8f905[_0x7abe('0x3d')],'sectionId':_0x8f905['id']},{})['then'](function(){return _0x133cee;});}else{return _0x133cee;}})[_0x7abe('0x2a')](function(_0x3e8287){logger[_0x7abe('0x25')](_0x7abe('0x80'),_0x3e8287);throw _0x3e8287;});}return _0x133cee;})[_0x7abe('0x37')](respondWithResult(_0x341ce1,0xc9))[_0x7abe('0x2a')](handleError(_0x341ce1,null));};exports[_0x7abe('0x81')]=function(_0x8d5d59,_0x37e07e,_0x18ce76){return db['MailAccount'][_0x7abe('0x66')]({'where':{'id':_0x8d5d59[_0x7abe('0x5e')]['id']}})['then'](handleEntityNotFound(_0x37e07e,null))[_0x7abe('0x37')](function(_0x50efbe){if(_0x50efbe){return _0x50efbe['getImap']();}return null;})[_0x7abe('0x37')](respondWithResult(_0x37e07e,null))['catch'](handleError(_0x37e07e,null));};exports[_0x7abe('0x82')]=function(_0x22e461,_0x33df1e,_0x56fa1e){if(_0x22e461[_0x7abe('0x60')]['id']){delete _0x22e461[_0x7abe('0x60')]['id'];}return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x22e461['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x33df1e,null))[_0x7abe('0x37')](function(_0x2df670){if(_0x2df670){_0x22e461['body']['MailAccountId']=_0x2df670['id'];return db[_0x7abe('0x3f')]['create'](_0x22e461['body']);}})[_0x7abe('0x37')](respondWithResult(_0x33df1e,null))['catch'](handleError(_0x33df1e,null));};exports[_0x7abe('0x83')]=function(_0x515592,_0x48e784,_0x5368de){return db['MailAccount']['findOne']({'where':{'id':_0x515592[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x48e784,null))['then'](function(_0x32f14f){if(_0x32f14f){return _0x32f14f[_0x7abe('0x84')](null);}return null;})[_0x7abe('0x37')](respondWithStatusCode(_0x48e784,null))['catch'](handleError(_0x48e784,null));};exports[_0x7abe('0x85')]=function(_0x30e1cc,_0xffa923,_0x23d9b6){return db[_0x7abe('0x5a')]['findOne']({'where':{'id':_0x30e1cc['params']['id']}})['then'](handleEntityNotFound(_0xffa923,null))[_0x7abe('0x37')](function(_0x50d29e){if(_0x50d29e){return _0x50d29e[_0x7abe('0x85')]();}return null;})['then'](respondWithResult(_0xffa923,null))[_0x7abe('0x2a')](handleError(_0xffa923,null));};exports['addSmtp']=function(_0x24e798,_0x568c7a,_0xb06089){if(_0x24e798[_0x7abe('0x60')]['id']){delete _0x24e798[_0x7abe('0x60')]['id'];}return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x24e798['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x568c7a,null))['then'](function(_0x580e7c){if(_0x580e7c){_0x24e798[_0x7abe('0x60')][_0x7abe('0x63')]=_0x580e7c['id'];return db[_0x7abe('0x5f')][_0x7abe('0x65')](_0x24e798[_0x7abe('0x60')]);}})[_0x7abe('0x37')](respondWithResult(_0x568c7a,null))[_0x7abe('0x2a')](handleError(_0x568c7a,null));};exports[_0x7abe('0x86')]=function(_0x580676,_0x237434,_0x2424c1){return db['MailAccount'][_0x7abe('0x66')]({'where':{'id':_0x580676[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x237434,null))[_0x7abe('0x37')](function(_0x44cc8b){if(_0x44cc8b){return _0x44cc8b['setSmtp'](null);}return null;})[_0x7abe('0x37')](respondWithStatusCode(_0x237434,null))[_0x7abe('0x2a')](handleError(_0x237434,null));};exports['addInteraction']=function(_0x13bd50,_0x26f560,_0x36d724){return db[_0x7abe('0x87')][_0x7abe('0x62')]({'where':{'id':_0x13bd50['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x26f560,null))[_0x7abe('0x37')](function(_0x1af4c0){if(_0x1af4c0){return _0x1af4c0['addInteraction'](_0x13bd50[_0x7abe('0x60')][_0x7abe('0x6b')],_['omit'](_0x13bd50[_0x7abe('0x60')],['ids','id'])||{});}})[_0x7abe('0x37')](respondWithResult(_0x26f560,null))[_0x7abe('0x2a')](handleError(_0x26f560,null));};exports['getInteractions']=function(_0x15b5d7,_0x459a87,_0x2a6ad6){var _0x38e948={'raw':![],'where':{}};var _0x3de13d={};var _0x2e4fdc={'count':0x0,'rows':[]};return db['MailAccount'][_0x7abe('0x66')]({'where':{'id':_0x15b5d7[_0x7abe('0x5e')]['id']}})['then'](handleEntityNotFound(_0x459a87,null))[_0x7abe('0x37')](function(_0x2ef3b8){if(_0x2ef3b8){_0x3de13d[_0x7abe('0x49')]=_[_0x7abe('0x4b')](db[_0x7abe('0x87')][_0x7abe('0x45')]);_0x3de13d['query']=_[_0x7abe('0x4b')](_0x15b5d7[_0x7abe('0x4a')]);_0x3de13d[_0x7abe('0x4c')]=_[_0x7abe('0x4d')](_0x3de13d[_0x7abe('0x49')],_0x3de13d['query']);_0x38e948[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x3de13d[_0x7abe('0x49')],qs[_0x7abe('0x4f')](_0x15b5d7[_0x7abe('0x4a')]['fields']));_0x38e948[_0x7abe('0x4e')]=_0x38e948[_0x7abe('0x4e')][_0x7abe('0x50')]?_0x38e948[_0x7abe('0x4e')]:_0x3de13d[_0x7abe('0x49')];if(!_0x15b5d7[_0x7abe('0x4a')]['hasOwnProperty']('nolimit')){_0x38e948[_0x7abe('0x2f')]=qs['limit'](_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x2f')]);_0x38e948[_0x7abe('0x2d')]=qs[_0x7abe('0x2d')](_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x2d')]);}_0x38e948[_0x7abe('0x53')]=qs[_0x7abe('0x54')](_0x15b5d7['query']['sort']);_0x38e948[_0x7abe('0x55')]=qs[_0x7abe('0x4c')](_[_0x7abe('0x67')](_0x15b5d7[_0x7abe('0x4a')],_0x3de13d['filters']));_0x38e948[_0x7abe('0x55')][_0x7abe('0x63')]=_0x2ef3b8['id'];if(_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x56')]){_0x38e948[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0x38e948['where'],{'$or':_[_0x7abe('0x44')](_0x38e948[_0x7abe('0x4e')],function(_0x546c8d){var _0x102ce8={};_0x102ce8[_0x546c8d]={'$like':'%'+_0x15b5d7[_0x7abe('0x4a')]['filter']+'%'};return _0x102ce8;})});}_0x38e948=_[_0x7abe('0x57')]({},_0x38e948,_0x15b5d7[_0x7abe('0x59')]);return db['MailInteraction'][_0x7abe('0x30')]({'where':_0x38e948[_0x7abe('0x55')]})['then'](function(_0x4c97a7){_0x2e4fdc[_0x7abe('0x30')]=_0x4c97a7;if(_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x68')]){_0x38e948[_0x7abe('0x5b')]=[{'model':db['CmContact'],'as':_0x7abe('0x88'),'required':![]},{'model':db[_0x7abe('0x89')],'as':'Owner','attributes':['name',_0x7abe('0x8a'),_0x7abe('0x8b')],'required':![]},{'model':db[_0x7abe('0x8c')],'as':_0x7abe('0x8d'),'attributes':['id',_0x7abe('0x3d'),_0x7abe('0x8e')],'where':_0x15b5d7['query'][_0x7abe('0x8f')]?{'id':_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x8f')]}:undefined,'required':_0x15b5d7[_0x7abe('0x4a')][_0x7abe('0x8f')]?!![]:![]}];}return db[_0x7abe('0x87')][_0x7abe('0x5c')](_0x38e948);})['then'](function(_0x4701fd){_0x2e4fdc[_0x7abe('0x69')]=_0x4701fd;return _0x2e4fdc;});}})[_0x7abe('0x37')](respondWithFilteredResult(_0x459a87,_0x38e948))[_0x7abe('0x2a')](handleError(_0x459a87,null));};exports['addApplications']=function addApplications(_0x1fca31,_0x3edf0f){var _0x16e62b=_0x1fca31['params']['id'];var _0x4be600=_0x1fca31['body'];var _0x373795=0xc8;var _0x4fed5c=null;return db[_0x7abe('0x90')][_0x7abe('0x91')]({'isolationLevel':db[_0x7abe('0x90')][_0x7abe('0x92')][_0x7abe('0x93')][_0x7abe('0x94')]},function(_0x4dba40){return db[_0x7abe('0x5a')][_0x7abe('0x66')]({'where':{'id':_0x16e62b},'transaction':_0x4dba40})['then'](function(_0x3f5e8c){if(_0x3f5e8c){return db[_0x7abe('0x95')][_0x7abe('0x3a')]({'where':{'MailAccountId':_0x16e62b},'transaction':_0x4dba40})[_0x7abe('0x37')](function(){var _0x415aac=_[_0x7abe('0x44')](_0x4be600,function(_0x208e91){_0x208e91['MailAccountId']=_0x16e62b;return _0x208e91;});return db[_0x7abe('0x95')][_0x7abe('0x96')](_0x415aac,{'transaction':_0x4dba40});});}else{_0x373795=0x194;_0x4fed5c=[];}});})['then'](function(){if(_0x373795!==0x194){return db['MailApplication'][_0x7abe('0x97')]({'where':{'MailAccountId':_0x16e62b},'order':_0x7abe('0x98')})[_0x7abe('0x37')](function(_0x5c8791){_0x4fed5c=_0x5c8791;});}})[_0x7abe('0x2a')](function(_0x380ea0){_0x373795=0x1f4;logger[_0x7abe('0x25')](_0x380ea0[_0x7abe('0x3c')]);if(_0x380ea0[_0x7abe('0x3d')]){delete _0x380ea0[_0x7abe('0x3d')];}_0x4fed5c=_0x380ea0;})[_0x7abe('0x99')](function(){if(_0x4fed5c===null){_0x3edf0f['sendStatus'](_0x373795);}else{if(_0x373795===0x1f4){_0x3edf0f[_0x7abe('0x2b')](_0x373795)[_0x7abe('0x3e')](_0x4fed5c);}else{_0x3edf0f[_0x7abe('0x2b')](_0x373795)[_0x7abe('0x2c')](_0x4fed5c);}}});};exports[_0x7abe('0x9a')]=function(_0x23df17,_0x3cd6f1,_0x1f032e){var _0x5e8c45={};var _0x1a5487={};var _0x2432bb;var _0x4abc43;return db['MailAccount'][_0x7abe('0x66')]({'where':{'id':_0x23df17[_0x7abe('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3cd6f1,null))[_0x7abe('0x37')](function(_0x38c244){if(_0x38c244){_0x2432bb=_0x38c244;_0x1a5487['model']=_['keys'](db[_0x7abe('0x95')][_0x7abe('0x45')]);_0x1a5487[_0x7abe('0x4a')]=_[_0x7abe('0x4b')](_0x23df17[_0x7abe('0x4a')]);_0x1a5487['filters']=_['intersection'](_0x1a5487['model'],_0x1a5487['query']);_0x5e8c45[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x1a5487['model'],qs['fields'](_0x23df17[_0x7abe('0x4a')]['fields']));_0x5e8c45['attributes']=_0x5e8c45[_0x7abe('0x4e')][_0x7abe('0x50')]?_0x5e8c45[_0x7abe('0x4e')]:_0x1a5487['model'];_0x5e8c45[_0x7abe('0x53')]=qs[_0x7abe('0x54')](_0x23df17[_0x7abe('0x4a')][_0x7abe('0x54')]);_0x5e8c45[_0x7abe('0x55')]=qs['filters'](_['pick'](_0x23df17['query'],_0x1a5487[_0x7abe('0x4c')]));if(_0x23df17['query'][_0x7abe('0x56')]){_0x5e8c45[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0x5e8c45['where'],{'$or':_[_0x7abe('0x44')](_0x5e8c45['attributes'],function(_0x5c526f){var _0x2bd472={};_0x2bd472[_0x5c526f]={'$like':'%'+_0x23df17['query'][_0x7abe('0x56')]+'%'};return _0x2bd472;})});}_0x5e8c45=_[_0x7abe('0x57')]({},_0x5e8c45,_0x23df17[_0x7abe('0x59')]);return _0x2432bb['getApplications'](_0x5e8c45);}})[_0x7abe('0x37')](function(_0x18d38e){if(_0x18d38e){_0x4abc43=_0x18d38e[_0x7abe('0x50')];if(!_0x23df17['query'][_0x7abe('0x51')](_0x7abe('0x52'))){_0x5e8c45[_0x7abe('0x2f')]=qs[_0x7abe('0x2f')](_0x23df17[_0x7abe('0x4a')]['limit']);_0x5e8c45['offset']=qs[_0x7abe('0x2d')](_0x23df17[_0x7abe('0x4a')][_0x7abe('0x2d')]);}return _0x2432bb['getApplications'](_0x5e8c45);}})[_0x7abe('0x37')](function(_0x3344b5){if(_0x3344b5){return _0x3344b5?{'count':_0x4abc43,'rows':_0x3344b5}:null;}})[_0x7abe('0x37')](respondWithResult(_0x3cd6f1,null))[_0x7abe('0x2a')](handleError(_0x3cd6f1,null));};exports['getMessages']=function(_0x53bb8d,_0xa8e180,_0x1c4180){var _0x41d7e7={'raw':!![],'where':{}};var _0x4d9aed={};var _0x3b91a7={'count':0x0,'rows':[]};return db[_0x7abe('0x5a')][_0x7abe('0x66')]({'where':{'id':_0x53bb8d['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0xa8e180,null))[_0x7abe('0x37')](function(_0x1cebcb){if(_0x1cebcb){_0x4d9aed[_0x7abe('0x49')]=_[_0x7abe('0x4b')](db[_0x7abe('0x9b')][_0x7abe('0x45')]);_0x4d9aed[_0x7abe('0x4a')]=_[_0x7abe('0x4b')](_0x53bb8d[_0x7abe('0x4a')]);_0x4d9aed[_0x7abe('0x4c')]=_[_0x7abe('0x4d')](_0x4d9aed[_0x7abe('0x49')],_0x4d9aed['query']);_0x41d7e7[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x4d9aed[_0x7abe('0x49')],qs[_0x7abe('0x4f')](_0x53bb8d[_0x7abe('0x4a')]['fields']));_0x41d7e7[_0x7abe('0x4e')]=_0x41d7e7['attributes'][_0x7abe('0x50')]?_0x41d7e7[_0x7abe('0x4e')]:_0x4d9aed['model'];if(!_0x53bb8d[_0x7abe('0x4a')]['hasOwnProperty'](_0x7abe('0x52'))){_0x41d7e7['limit']=qs['limit'](_0x53bb8d['query'][_0x7abe('0x2f')]);_0x41d7e7[_0x7abe('0x2d')]=qs[_0x7abe('0x2d')](_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x2d')]);}_0x41d7e7[_0x7abe('0x53')]=qs['sort'](_0x53bb8d['query']['sort']);_0x41d7e7['where']=qs[_0x7abe('0x4c')](_['pick'](_0x53bb8d[_0x7abe('0x4a')],_0x4d9aed[_0x7abe('0x4c')]));_0x41d7e7['where'][_0x7abe('0x63')]=_0x1cebcb['id'];if(_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x56')]){_0x41d7e7['where']=_['merge'](_0x41d7e7[_0x7abe('0x55')],{'$or':_[_0x7abe('0x44')](_0x41d7e7[_0x7abe('0x4e')],function(_0x814b3f){var _0x5561dd={};_0x5561dd[_0x814b3f]={'$like':'%'+_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x56')]+'%'};return _0x5561dd;})});}if(_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x9c')]){var _0x138625=_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x9c')][_0x7abe('0x9d')](',');var _0x12c8b2={};_0x12c8b2[_0x138625[0x0]]={'$gte':moment(_0x138625[0x1])[_0x7abe('0x9e')](_0x7abe('0x9f'))};_0x41d7e7[_0x7abe('0x55')]=_[_0x7abe('0x57')](_0x41d7e7[_0x7abe('0x55')],_0x12c8b2);}_0x41d7e7=_[_0x7abe('0x57')]({},_0x41d7e7,_0x53bb8d[_0x7abe('0x59')]);return db[_0x7abe('0x9b')]['count']({'where':_0x41d7e7[_0x7abe('0x55')]})[_0x7abe('0x37')](function(_0x13a007){_0x3b91a7[_0x7abe('0x30')]=_0x13a007;if(_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0x68')]){_0x41d7e7['include']=[{'all':!![]}];}return db[_0x7abe('0x9b')]['findAll'](_0x41d7e7);})['then'](function(_0x18bd27){if(_0x53bb8d[_0x7abe('0x4a')][_0x7abe('0xa0')]===_0x7abe('0xa1')){for(var _0x21f85e=0x0;_0x21f85e<_0x18bd27[_0x7abe('0x50')];_0x21f85e++){_0x18bd27[_0x21f85e]['body']=juice(_0x18bd27[_0x21f85e][_0x7abe('0x60')]);}}_0x3b91a7['rows']=_0x18bd27;return _0x3b91a7;});}})[_0x7abe('0x37')](respondWithFilteredResult(_0xa8e180,_0x41d7e7))[_0x7abe('0x2a')](handleError(_0xa8e180,null));};exports['send']=function(_0x513f4c,_0x5c5eeb,_0x1cfe5f){var _0x39c6f5,_0x2ad848={},_0x15741c;if(_0x513f4c['body']['to']){_0x15741c=_0x513f4c[_0x7abe('0x60')]['to'][_0x7abe('0x9d')](',')[0x0];}return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x513f4c['params']['id']},'include':[{'model':db[_0x7abe('0xa2')],'as':_0x7abe('0xa3'),'include':[{'model':db['CmContact'],'as':_0x7abe('0xa4'),'where':{'email':_0x15741c},'limit':0x1,'order':[['updatedAt',_0x7abe('0xa5')]]}]},{'model':db['MailServerOut'],'as':_0x7abe('0x41'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5c5eeb,null))[_0x7abe('0x37')](function(_0x2bd2d1){if(_0x2bd2d1){_0x39c6f5=_0x2bd2d1;if(_0x2bd2d1[_0x7abe('0x41')]){if(_[_0x7abe('0x72')](_0x513f4c[_0x7abe('0x60')]['from'])){_0x513f4c['body'][_0x7abe('0xa6')]=util['format'](_0x7abe('0xa7'),_0x2bd2d1['name'],_0x2bd2d1['email']||_0x2bd2d1['Smtp']['user']);}if(_0x513f4c[_0x7abe('0x60')][_0x7abe('0xa8')]&&_0x513f4c[_0x7abe('0x60')][_0x7abe('0xa8')]['length']){for(var _0xa55a58=0x0;_0xa55a58<_0x513f4c[_0x7abe('0x60')][_0x7abe('0xa8')][_0x7abe('0x50')];_0xa55a58+=0x1){_0x513f4c['body'][_0x7abe('0xa8')][_0xa55a58]={'filename':_0x513f4c[_0x7abe('0x60')][_0x7abe('0xa8')][_0xa55a58][_0x7abe('0x3d')],'path':path['join'](config[_0x7abe('0xa9')],_0x7abe('0xaa'),_0x513f4c[_0x7abe('0x60')][_0x7abe('0xa8')][_0xa55a58]['basename'])};}}var _0x36541d={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x2bd2d1[_0x7abe('0x41')][_0x7abe('0x7c')])){if(_0x2bd2d1['Smtp'][_0x7abe('0xab')]){_0x36541d['auth']={'user':_0x2bd2d1[_0x7abe('0x41')]['user'],'pass':_0x2bd2d1[_0x7abe('0x41')][_0x7abe('0x78')]};}_0x36541d[_0x7abe('0x7b')]=_0x2bd2d1['Smtp'][_0x7abe('0x7b')];_0x36541d[_0x7abe('0x7a')]=_0x2bd2d1[_0x7abe('0x41')]['port'];_0x36541d[_0x7abe('0xac')]=_0x2bd2d1[_0x7abe('0x41')]['secure'];}else{_0x36541d['service']=_0x2bd2d1[_0x7abe('0x41')]['service'];_0x36541d[_0x7abe('0xad')]={'user':_0x2bd2d1[_0x7abe('0x41')][_0x7abe('0x75')],'pass':_0x2bd2d1[_0x7abe('0x41')]['pass']};}return respondWithRpcPromise(_0x7abe('0xae'),_0x7abe('0xaf'),{'account':_0x36541d,'message':_0x513f4c['body']});}else{throw new Error('List\x20not\x20found');}}})[_0x7abe('0x37')](function(_0x8d126a){if(_0x8d126a){_0x2ad848=_0x8d126a;if(_0x39c6f5[_0x7abe('0xa3')]){if(_0x39c6f5[_0x7abe('0xa3')][_0x7abe('0xa4')]['length']){return _0x39c6f5[_0x7abe('0xa3')][_0x7abe('0xa4')][0x0];}else{return db[_0x7abe('0xb0')][_0x7abe('0x65')](_[_0x7abe('0xb1')](_0x513f4c['body'],{'firstName':_0x513f4c[_0x7abe('0x60')]['to'],'email':_0x513f4c['body']['to'],'phone':_0x513f4c['body']['to'],'ListId':_0x39c6f5[_0x7abe('0x6f')]}));}}else{throw new Error(_0x7abe('0xb2'));}}})[_0x7abe('0x37')](function(_0x1a996e){if(_0x1a996e){var _0x342431={'UserId':_0x513f4c[_0x7abe('0x75')]['id'],'ContactId':_0x1a996e['id'],'MailAccountId':_0x39c6f5['id'],'inReplyTo':_0x2ad848[_0x7abe('0xb3')],'to':_0x513f4c['body'][_0x7abe('0xa6')],'cc':_0x513f4c['body']['cc'],'subject':_0x513f4c[_0x7abe('0x60')][_0x7abe('0xb4')],'attach':_0x513f4c[_0x7abe('0x60')][_0x7abe('0xb5')],'firstMsgDirection':_0x7abe('0xb6'),'lastMsgAt':moment()['format'](_0x7abe('0x9f')),'lastMsgDirection':'out','Messages':[_['merge'](_0x513f4c['body'],{'messageId':_0x2ad848[_0x7abe('0xb3')],'sentAt':moment()['format'](_0x7abe('0x9f')),'read':!![],'MailAccountId':_0x39c6f5['id'],'UserId':_0x513f4c[_0x7abe('0x75')]['id'],'ContactId':_0x1a996e['id']})]};if(_0x513f4c[_0x7abe('0x60')][_0x7abe('0xb7')]){_0x342431=_[_0x7abe('0x57')](_0x342431,_0x513f4c['body'][_0x7abe('0xb7')]);}return db['MailInteraction']['create'](_0x342431,{'include':[{'model':db[_0x7abe('0x9b')],'as':_0x7abe('0xb8')}]});}})[_0x7abe('0x37')](respondWithResult(_0x5c5eeb,null))[_0x7abe('0x2a')](handleError(_0x5c5eeb,null));};exports[_0x7abe('0xb9')]=function(_0x13ce37,_0x158e5f,_0x53b08e){return db[_0x7abe('0x5a')]['find']({'where':{'id':_0x13ce37[_0x7abe('0x5e')]['id']},'include':[{'model':db[_0x7abe('0x5f')],'as':_0x7abe('0x41'),'raw':!![]}]})[_0x7abe('0x37')](handleEntityNotFound(_0x158e5f,null))[_0x7abe('0x37')](function(_0x3977a5){if(_0x3977a5&&_0x3977a5[_0x7abe('0x41')]){var _0x19370c={'id':_0x3977a5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3977a5['Smtp']['service']){_0x19370c[_0x7abe('0x7c')]=_0x3977a5['Smtp'][_0x7abe('0x7c')];}else{_0x19370c[_0x7abe('0x7b')]=_0x3977a5[_0x7abe('0x41')][_0x7abe('0x7b')];_0x19370c[_0x7abe('0x7a')]=_0x3977a5['Smtp'][_0x7abe('0x7a')];_0x19370c[_0x7abe('0xac')]=_0x3977a5[_0x7abe('0x41')][_0x7abe('0xac')];}if(_0x3977a5[_0x7abe('0x41')][_0x7abe('0xab')]){_0x19370c[_0x7abe('0xad')]={'user':_0x3977a5[_0x7abe('0x41')][_0x7abe('0x75')],'pass':_0x3977a5[_0x7abe('0x41')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x7abe('0xb9'),{'account':_0x19370c});}})[_0x7abe('0x37')](respondWithResult(_0x158e5f,null))[_0x7abe('0x2a')](handleError(_0x158e5f,null));};exports[_0x7abe('0x3a')]=function(_0x54c98b,_0x852a59){return db['MailAccount'][_0x7abe('0x62')]({'where':{'id':_0x54c98b[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x852a59,null))[_0x7abe('0x37')](function(_0x4f3330){if(_0x4f3330&&_0x4f3330[_0x7abe('0x7c')]){throw new db[(_0x7abe('0xba'))]['ValidationError'](_0x7abe('0xbb'));}return _0x4f3330;})['then'](removeEntity(_0x852a59,null))[_0x7abe('0x2a')](handleError(_0x852a59,null));};exports[_0x7abe('0xbc')]=function(_0x566f61,_0x22ac2b,_0x4d0c19){return db['MailAccount'][_0x7abe('0x62')]({'where':{'id':_0x566f61['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x22ac2b,null))[_0x7abe('0x37')](function(_0x1ddcee){if(_0x1ddcee){return _0x1ddcee['addAgents'](_0x566f61[_0x7abe('0x60')][_0x7abe('0x6b')],_[_0x7abe('0xbd')](_0x566f61[_0x7abe('0x60')],['ids','id'])||{})['spread'](function(_0x5ad449){for(var _0x3cb066=0x0;_0x3cb066<_0x566f61[_0x7abe('0x60')][_0x7abe('0x6b')][_0x7abe('0x50')];_0x3cb066+=0x1){socket[_0x7abe('0xbe')](_0x7abe('0xbf'),{'UserId':Number(_0x566f61[_0x7abe('0x60')][_0x7abe('0x6b')][_0x3cb066]),'MailAccountId':Number(_0x566f61[_0x7abe('0x5e')]['id'])});}return _0x5ad449;});}})[_0x7abe('0x37')](respondWithResult(_0x22ac2b,null))[_0x7abe('0x2a')](handleError(_0x22ac2b,null));};exports[_0x7abe('0xc0')]=function(_0x359468,_0x56b63a,_0x47f30a){return db[_0x7abe('0x5a')][_0x7abe('0x62')]({'where':{'id':_0x359468['params']['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x56b63a,null))[_0x7abe('0x37')](function(_0x12eb92){if(_0x12eb92){return _0x12eb92['removeAgents'](_0x359468[_0x7abe('0x4a')][_0x7abe('0x6b')])['then'](function(){if(_['isArray'](_0x359468[_0x7abe('0x4a')][_0x7abe('0x6b')])){for(var _0x498ab3=0x0;_0x498ab3<_0x359468[_0x7abe('0x4a')][_0x7abe('0x6b')][_0x7abe('0x50')];_0x498ab3+=0x1){socket[_0x7abe('0xbe')](_0x7abe('0xc1'),{'UserId':Number(_0x359468[_0x7abe('0x4a')][_0x7abe('0x6b')][_0x498ab3]),'MailAccountId':Number(_0x359468[_0x7abe('0x5e')]['id'])});}}else{socket[_0x7abe('0xbe')](_0x7abe('0xc1'),{'UserId':Number(_0x359468[_0x7abe('0x4a')][_0x7abe('0x6b')]),'MailAccountId':Number(_0x359468[_0x7abe('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x56b63a,null))[_0x7abe('0x2a')](handleError(_0x56b63a,null));};exports['getAgents']=function(_0x59c54e,_0x156d79,_0x38a882){var _0x5dd16b={};var _0x1aca3f={};var _0x4ee231;var _0x165f3e;return db['MailAccount'][_0x7abe('0x66')]({'where':{'id':_0x59c54e[_0x7abe('0x5e')]['id']}})[_0x7abe('0x37')](handleEntityNotFound(_0x156d79,null))['then'](function(_0x51edbc){if(_0x51edbc){_0x4ee231=_0x51edbc;_0x1aca3f['model']=_[_0x7abe('0x4b')](db[_0x7abe('0x89')][_0x7abe('0x45')]);_0x1aca3f['query']=_[_0x7abe('0x4b')](_0x59c54e['query']);_0x1aca3f['filters']=_[_0x7abe('0x4d')](_0x1aca3f[_0x7abe('0x49')],_0x1aca3f[_0x7abe('0x4a')]);_0x5dd16b[_0x7abe('0x4e')]=_[_0x7abe('0x4d')](_0x1aca3f['model'],qs[_0x7abe('0x4f')](_0x59c54e[_0x7abe('0x4a')][_0x7abe('0x4f')]));_0x5dd16b['attributes']=_0x5dd16b['attributes'][_0x7abe('0x50')]?_0x5dd16b[_0x7abe('0x4e')]:_0x1aca3f['model'];_0x5dd16b['order']=qs[_0x7abe('0x54')](_0x59c54e[_0x7abe('0x4a')][_0x7abe('0x54')]);_0x5dd16b[_0x7abe('0x55')]=qs[_0x7abe('0x4c')](_[_0x7abe('0x67')](_0x59c54e[_0x7abe('0x4a')],_0x1aca3f[_0x7abe('0x4c')]));if(_0x59c54e[_0x7abe('0x4a')][_0x7abe('0x56')]){_0x5dd16b['where']=_[_0x7abe('0x57')](_0x5dd16b[_0x7abe('0x55')],{'$or':_[_0x7abe('0x44')](_0x5dd16b[_0x7abe('0x4e')],function(_0x11266a){var _0x289d77={};_0x289d77[_0x11266a]={'$like':'%'+_0x59c54e[_0x7abe('0x4a')][_0x7abe('0x56')]+'%'};return _0x289d77;})});}_0x5dd16b=_[_0x7abe('0x57')]({},_0x5dd16b,_0x59c54e[_0x7abe('0x59')]);return _0x4ee231[_0x7abe('0xc2')](_0x5dd16b);}})[_0x7abe('0x37')](function(_0x11b720){if(_0x11b720){_0x165f3e=_0x11b720[_0x7abe('0x50')];if(!_0x59c54e[_0x7abe('0x4a')][_0x7abe('0x51')](_0x7abe('0x52'))){_0x5dd16b['limit']=qs[_0x7abe('0x2f')](_0x59c54e[_0x7abe('0x4a')]['limit']);_0x5dd16b['offset']=qs[_0x7abe('0x2d')](_0x59c54e['query'][_0x7abe('0x2d')]);}return _0x4ee231[_0x7abe('0xc2')](_0x5dd16b);}})['then'](function(_0x542966){if(_0x542966){return _0x542966?{'count':_0x165f3e,'rows':_0x542966}:null;}})['then'](respondWithResult(_0x156d79,null))['catch'](handleError(_0x156d79,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d502e63..9ebeeb1 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 _0x3d49=['emit','../../mysqldb','MailAccount','setMaxListeners','save','remove'];(function(_0x1e0f5f,_0x430c5f){var _0x51e29c=function(_0x1cbabe){while(--_0x1cbabe){_0x1e0f5f['push'](_0x1e0f5f['shift']());}};_0x51e29c(++_0x430c5f);}(_0x3d49,0x151));var _0x93d4=function(_0xae9024,_0x17f58e){_0xae9024=_0xae9024-0x0;var _0x23e7d3=_0x3d49[_0xae9024];return _0x23e7d3;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x93d4('0x0'))['db'][_0x93d4('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x93d4('0x2')](0x0);var events={'afterCreate':_0x93d4('0x3'),'afterUpdate':'update','afterDestroy':_0x93d4('0x4')};function emitEvent(_0x9846c2){return function(_0xa1de2e,_0x41313a,_0x20e6c7){MailAccountEvents[_0x93d4('0x5')](_0x9846c2+':'+_0xa1de2e['id'],_0xa1de2e);MailAccountEvents['emit'](_0x9846c2,_0xa1de2e);_0x20e6c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xfb11=['hasOwnProperty','exports','events','MailAccount','setMaxListeners','update','emit'];(function(_0x20013b,_0x53030c){var _0x390bb6=function(_0x1c2bc1){while(--_0x1c2bc1){_0x20013b['push'](_0x20013b['shift']());}};_0x390bb6(++_0x53030c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xfb11[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x1fb1('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1fb1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18108f){return function(_0x5a830e,_0x190f74,_0x2ae20f){MailAccountEvents['emit'](_0x18108f+':'+_0x5a830e['id'],_0x5a830e);MailAccountEvents[_0x1fb1('0x4')](_0x18108f,_0x5a830e);_0x2ae20f(null);};}for(var e in events){if(events[_0x1fb1('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1fb1('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 27942e8..3188cef 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 _0x96bc=['../../config/logger','api','moment','bluebird','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash'];(function(_0x280bb5,_0x4a1aff){var _0x2b760c=function(_0x53b65a){while(--_0x53b65a){_0x280bb5['push'](_0x280bb5['shift']());}};_0x2b760c(++_0x4a1aff);}(_0x96bc,0xfc));var _0xc96b=function(_0xcb48ca,_0x540ecb){_0xcb48ca=_0xcb48ca-0x0;var _0x37be10=_0x96bc[_0xcb48ca];return _0x37be10;};'use strict';var _=require(_0xc96b('0x0'));var util=require('util');var logger=require(_0xc96b('0x1'))(_0xc96b('0x2'));var moment=require(_0xc96b('0x3'));var BPromise=require(_0xc96b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc96b('0x5'));var rimraf=require('rimraf');var config=require(_0xc96b('0x6'));var attributes=require(_0xc96b('0x7'));module[_0xc96b('0x8')]=function(_0xfdcd93,_0x413038){return _0xfdcd93[_0xc96b('0x9')](_0xc96b('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12ea=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x221f12,_0x544366){var _0x21964d=function(_0x7063ac){while(--_0x7063ac){_0x221f12['push'](_0x221f12['shift']());}};_0x21964d(++_0x544366);}(_0x12ea,0xae));var _0xa12e=function(_0x53096c,_0xf518b){_0x53096c=_0x53096c-0x0;var _0x2cab6d=_0x12ea[_0x53096c];return _0x2cab6d;};'use strict';var _=require(_0xa12e('0x0'));var util=require('util');var logger=require(_0xa12e('0x1'))(_0xa12e('0x2'));var moment=require('moment');var BPromise=require(_0xa12e('0x3'));var rp=require(_0xa12e('0x4'));var fs=require('fs');var path=require(_0xa12e('0x5'));var rimraf=require(_0xa12e('0x6'));var config=require(_0xa12e('0x7'));var attributes=require(_0xa12e('0x8'));module[_0xa12e('0x9')]=function(_0xb0844c,_0x21dbd9){return _0xb0844c[_0xa12e('0xa')](_0xa12e('0xb'),attributes,{'tableName':_0xa12e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7842d27..b780b71 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 _0x3867=['update','interaction','created','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','UserId','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','find','ShowMailAccount','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','MailApplication','MailServerOut','get','omit','Applications','applications','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread'];(function(_0x5f06c0,_0x2637c4){var _0x323312=function(_0x2236ec){while(--_0x2236ec){_0x5f06c0['push'](_0x5f06c0['shift']());}};_0x323312(++_0x2637c4);}(_0x3867,0x14f));var _0x7386=function(_0x13cb14,_0x555607){_0x13cb14=_0x13cb14-0x0;var _0x47e515=_0x3867[_0x13cb14];return _0x47e515;};'use strict';var _=require(_0x7386('0x0'));var util=require(_0x7386('0x1'));var moment=require(_0x7386('0x2'));var BPromise=require(_0x7386('0x3'));var rs=require(_0x7386('0x4'));var fs=require('fs');var Redis=require(_0x7386('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7386('0x6'));var logger=require('../../config/logger')(_0x7386('0x7'));var config=require(_0x7386('0x8'));var jayson=require(_0x7386('0x9'));var client=jayson[_0x7386('0xa')]['http']({'port':0x232c});config[_0x7386('0xb')]=_[_0x7386('0xc')](config[_0x7386('0xb')],{'host':_0x7386('0xd'),'port':0x18eb});var socket=require(_0x7386('0xe'))(new Redis(config[_0x7386('0xb')]));require(_0x7386('0xf'))['register'](socket);function respondWithRpcPromise(_0x2afde5,_0x37e5cd,_0x31a8bb){return new BPromise(function(_0x199c06,_0x1f99da){return client['request'](_0x2afde5,_0x31a8bb)['then'](function(_0x916b77){logger[_0x7386('0x10')]('MailAccount,\x20%s,\x20%s',_0x37e5cd,_0x7386('0x11'));logger[_0x7386('0x12')](_0x7386('0x13'),_0x37e5cd,'request\x20sent',JSON[_0x7386('0x14')](_0x916b77));if(_0x916b77['error']){if(_0x916b77[_0x7386('0x15')][_0x7386('0x16')]===0x1f4){logger[_0x7386('0x15')](_0x7386('0x17'),_0x37e5cd,_0x916b77[_0x7386('0x15')][_0x7386('0x18')]);return _0x1f99da(_0x916b77[_0x7386('0x15')]['message']);}logger[_0x7386('0x15')](_0x7386('0x17'),_0x37e5cd,_0x916b77[_0x7386('0x15')][_0x7386('0x18')]);return _0x199c06(_0x916b77[_0x7386('0x15')]['message']);}else{logger[_0x7386('0x10')](_0x7386('0x17'),_0x37e5cd,_0x7386('0x11'));_0x199c06(_0x916b77[_0x7386('0x19')]['message']);}})[_0x7386('0x1a')](function(_0x19d051){logger[_0x7386('0x15')](_0x7386('0x17'),_0x37e5cd,_0x19d051);_0x1f99da(_0x19d051);});});}exports[_0x7386('0x1b')]=function(_0x528d18){var _0x3a6ed1=this;return new Promise(function(_0x18f310,_0x140b76){return db[_0x7386('0x1c')][_0x7386('0x1d')]({'raw':_0x528d18[_0x7386('0x1e')]?_0x528d18[_0x7386('0x1e')][_0x7386('0x1f')]===undefined?!![]:![]:!![],'where':_0x528d18[_0x7386('0x1e')]?_0x528d18[_0x7386('0x1e')][_0x7386('0x20')]||null:null,'attributes':_0x528d18[_0x7386('0x1e')]?_0x528d18['options'][_0x7386('0x21')]||null:null,'limit':_0x528d18[_0x7386('0x1e')]?_0x528d18[_0x7386('0x1e')][_0x7386('0x22')]||null:null,'include':_0x528d18[_0x7386('0x1e')]?_0x528d18[_0x7386('0x1e')]['include']?_[_0x7386('0x23')](_0x528d18['options'][_0x7386('0x24')],function(_0xf5164a){return{'model':db[_0xf5164a['model']],'as':_0xf5164a['as'],'attributes':_0xf5164a['attributes'],'include':_0xf5164a[_0x7386('0x24')]?_[_0x7386('0x23')](_0xf5164a[_0x7386('0x24')],function(_0x1a3593){return{'model':db[_0x1a3593[_0x7386('0x25')]],'as':_0x1a3593['as'],'attributes':_0x1a3593['attributes'],'include':_0x1a3593[_0x7386('0x24')]?_[_0x7386('0x23')](_0x1a3593[_0x7386('0x24')],function(_0x146828){return{'model':db[_0x146828['model']],'as':_0x146828['as'],'attributes':_0x146828[_0x7386('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7386('0x26')](function(_0x8d5e03){logger[_0x7386('0x10')](_0x7386('0x1b'),_0x528d18);logger[_0x7386('0x12')]('GetMailAccount',_0x528d18,JSON[_0x7386('0x14')](_0x8d5e03));_0x18f310(_0x8d5e03);})[_0x7386('0x1a')](function(_0x1f2ffe){logger[_0x7386('0x15')](_0x7386('0x1b'),_0x1f2ffe[_0x7386('0x18')],_0x528d18);_0x140b76(_0x3a6ed1['error'](0x1f4,_0x1f2ffe[_0x7386('0x18')]));});});};exports['ShowMailAccount']=function(_0x3ac50c){var _0x578d56=this;return new Promise(function(_0x36aa6f,_0xf38b13){return db['MailAccount'][_0x7386('0x27')]({'raw':_0x3ac50c['options']?_0x3ac50c[_0x7386('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3ac50c[_0x7386('0x1e')]?_0x3ac50c[_0x7386('0x1e')][_0x7386('0x20')]||null:null,'attributes':_0x3ac50c[_0x7386('0x1e')]?_0x3ac50c[_0x7386('0x1e')]['attributes']||null:null,'include':_0x3ac50c[_0x7386('0x1e')]?_0x3ac50c[_0x7386('0x1e')][_0x7386('0x24')]?_['map'](_0x3ac50c[_0x7386('0x1e')][_0x7386('0x24')],function(_0x3d0158){return{'model':db[_0x3d0158['model']],'as':_0x3d0158['as'],'attributes':_0x3d0158['attributes'],'include':_0x3d0158[_0x7386('0x24')]?_['map'](_0x3d0158['include'],function(_0x4070b8){return{'model':db[_0x4070b8[_0x7386('0x25')]],'as':_0x4070b8['as'],'attributes':_0x4070b8[_0x7386('0x21')],'include':_0x4070b8['include']?_[_0x7386('0x23')](_0x4070b8[_0x7386('0x24')],function(_0x1905ac){return{'model':db[_0x1905ac[_0x7386('0x25')]],'as':_0x1905ac['as'],'attributes':_0x1905ac[_0x7386('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7386('0x26')](function(_0x149fbe){logger['info'](_0x7386('0x28'),_0x3ac50c);logger['debug'](_0x7386('0x28'),_0x3ac50c,JSON[_0x7386('0x14')](_0x149fbe));_0x36aa6f(_0x149fbe);})[_0x7386('0x1a')](function(_0x459b50){logger[_0x7386('0x15')]('ShowMailAccount',_0x459b50[_0x7386('0x18')],_0x3ac50c);_0xf38b13(_0x578d56['error'](0x1f4,_0x459b50[_0x7386('0x18')]));});});};exports['NotifyMailAccount']=function(_0x413bbd){var _0x374455=this;return new Promise(function(_0x194d12,_0x196436){var _0x5cefab={'body':_0x413bbd['body'],'channel':_0x7386('0x29')};var _0x2d2c86=_[_0x7386('0x2a')](_[_0x7386('0x2b')](db[_0x7386('0x2c')]['rawAttributes']),[_0x7386('0x2d'),_0x7386('0x2e'),_0x7386('0x2f'),_0x7386('0x30')]);var _0x2ebd73=![];if(_0x413bbd[_0x7386('0x31')]['id']){delete _0x413bbd[_0x7386('0x31')]['id'];}if(_['isNil'](_0x413bbd[_0x7386('0x31')][_0x7386('0x32')])){return _0x196436(_0x374455['error'](0x1f4,_0x7386('0x33')));}if(_['isNil'](_0x413bbd[_0x7386('0x31')]['body'])||_0x413bbd[_0x7386('0x31')][_0x7386('0x31')]===''){return _0x196436(_0x374455[_0x7386('0x15')](0x1f4,_0x7386('0x34')));}if(_[_0x7386('0x35')](_0x413bbd['body'][_0x7386('0x36')])){return _0x196436(_0x374455['error'](0x1f4,_0x7386('0x37')+_0x2d2c86));}if(!_[_0x7386('0x38')](_0x2d2c86,_0x413bbd[_0x7386('0x31')]['mapKey'])){return _0x196436(_0x374455['error'](0x1f4,_0x7386('0x39')+_0x2d2c86));}var _0x2ea885={};_0x2ea885[_0x413bbd[_0x7386('0x31')]['mapKey']]=_0x413bbd[_0x7386('0x31')][_0x7386('0x32')];return db[_0x7386('0x1c')][_0x7386('0x27')]({'where':{'id':_0x413bbd[_0x7386('0x3a')]['id']},'include':[{'model':db[_0x7386('0x3b')],'as':_0x7386('0x3c'),'include':[{'model':db[_0x7386('0x2c')],'as':_0x7386('0x3d'),'where':_0x2ea885,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x7386('0x3e')],'as':'Applications'},{'model':db[_0x7386('0x3f')],'as':'Smtp'}]})[_0x7386('0x26')](function(_0x241565){if(_0x241565&&_0x241565['List']){var _0x16d08a=_0x241565[_0x7386('0x40')]({'plain':!![]});_0x5cefab[_0x7386('0x3a')]=_[_0x7386('0x41')](_0x16d08a,[_0x7386('0x42'),'List']);_0x5cefab['applications']=_0x16d08a[_0x7386('0x42')];_0x5cefab['list']=_0x16d08a['List'];_0x5cefab[_0x7386('0x43')]=_[_0x7386('0x44')](_0x5cefab['applications'],[_0x7386('0x45')],[_0x7386('0x46')]);if(_0x5cefab[_0x7386('0x3a')]&&_0x5cefab[_0x7386('0x3a')]['autoclose']){_0x5cefab[_0x7386('0x43')][_0x7386('0x47')]({'id':0x0,'priority':_0x5cefab[_0x7386('0x43')][_0x7386('0x48')]+0x1,'app':_0x7386('0x49'),'appdata':_0x7386('0x4a'),'interval':_0x7386('0x4b')});}if(_0x5cefab['account'][_0x7386('0x42')]){delete _0x5cefab[_0x7386('0x3a')][_0x7386('0x42')];}if(_0x5cefab['account'][_0x7386('0x3c')]){delete _0x5cefab[_0x7386('0x3a')][_0x7386('0x3c')];}if(_0x16d08a[_0x7386('0x3c')]['Contacts']['length']){return _0x16d08a[_0x7386('0x3c')][_0x7386('0x3d')][0x0];}var _0x1a5721=_[_0x7386('0xc')](_0x413bbd[_0x7386('0x31')],{'firstName':_0x413bbd['body'][_0x7386('0x32')],'ListId':_0x16d08a['ListId']});_0x1a5721[_0x413bbd[_0x7386('0x31')][_0x7386('0x36')]]=_0x413bbd[_0x7386('0x31')]['from'];return db[_0x7386('0x2c')][_0x7386('0x4c')](_0x1a5721);}else{throw new Error('List\x20not\x20found');}})[_0x7386('0x26')](function(_0x26f57e){_0x5cefab[_0x7386('0x4d')]=_0x26f57e;if(_0x26f57e){if(!_0x413bbd['body'][_0x7386('0x18')]['messageId']){_0x413bbd[_0x7386('0x31')]['message'][_0x7386('0x4e')]=rs[_0x7386('0x4f')]()+'\x20'+_0x413bbd['body'][_0x7386('0x18')][_0x7386('0x32')];}var _0x3e20c9={'ContactId':_0x26f57e['id'],'MailAccountId':_0x413bbd[_0x7386('0x3a')]['id'],'inReplyTo':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x4e')],'to':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')]['from'],'cc':_0x413bbd['body']['message']['cc'],'subject':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x50')],'attach':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x51')],'lastMsgAt':moment()[_0x7386('0x52')](_0x7386('0x53')),'lastMsgDirection':'in'};return db[_0x7386('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x413bbd[_0x7386('0x3a')]['id']},'include':[{'model':db[_0x7386('0x55')],'as':_0x7386('0x56'),'attributes':[_0x7386('0x4e')],'where':{'messageId':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x57')]}}]})[_0x7386('0x26')](function(_0x2d094c){if(_0x2d094c){return[_0x2d094c,![]];}return db[_0x7386('0x54')][_0x7386('0x4c')](_0x3e20c9)['then'](function(_0x1880ac){return[_0x1880ac,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7386('0x58')](function(_0x48b0c9,_0x5eacd9){if(_0x48b0c9){_0x2ebd73=_0x5eacd9;if(!_0x5eacd9){return _0x48b0c9[_0x7386('0x59')]({'inReplyTo':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x4e')],'to':_0x413bbd['body'][_0x7386('0x18')][_0x7386('0x32')],'cc':_0x413bbd[_0x7386('0x31')]['message']['cc'],'subject':_0x413bbd['body'][_0x7386('0x18')][_0x7386('0x50')],'attach':_0x48b0c9['attach']?_0x48b0c9['attach']:_0x413bbd['body'][_0x7386('0x18')][_0x7386('0x51')],'substatus':null,'substatusAt':moment()[_0x7386('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7386('0x52')](_0x7386('0x53')),'lastMsgDirection':'in'});}else{return _0x48b0c9;}}})['then'](function(_0xcb9f69){_0x5cefab[_0x7386('0x5a')]=_0xcb9f69[_0x7386('0x40')]({'plain':!![]});_0x5cefab['interaction'][_0x7386('0x5b')]=_0x2ebd73;return db['MailMessage'][_0x7386('0x4c')]({'body':_0x413bbd[_0x7386('0x31')][_0x7386('0x31')],'MailAccountId':_0x413bbd[_0x7386('0x3a')]['id'],'MailInteractionId':_0xcb9f69['id'],'direction':'in','ContactId':_0x5cefab[_0x7386('0x4d')]['id'],'messageId':_0x413bbd['body']['message'][_0x7386('0x4e')],'from':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x32')],'to':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')]['to'],'cc':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')]['cc'],'subject':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')]['subject'],'attach':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x51')],'Attachments':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x5c')],'originTo':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x5d')],'originCc':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x5e')],'bcc':_0x413bbd['body'][_0x7386('0x18')][_0x7386('0x5f')],'ChatWebsiteId':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')]['ChatWebsiteId']||null,'originChannel':_0x413bbd[_0x7386('0x31')][_0x7386('0x18')][_0x7386('0x60')]||_0x7386('0x61'),'ChatOfflineMessageId':_0x413bbd['body'][_0x7386('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7386('0x62')],'as':_0x7386('0x63')}]});})[_0x7386('0x26')](function(_0x1443ec){_0x5cefab[_0x7386('0x18')]=_0x1443ec;if(_0x5cefab[_0x7386('0x5a')][_0x7386('0x64')]){return db['User'][_0x7386('0x27')]({'attributes':['id',_0x7386('0x65')],'where':{'id':_0x5cefab[_0x7386('0x5a')]['UserId']}})[_0x7386('0x26')](function(_0x1e164e){if(_0x1e164e){_0x5cefab[_0x7386('0x43')][_0x7386('0x66')]({'id':0x0,'priority':0x0,'app':_0x7386('0x67'),'appdata':_0x1e164e[_0x7386('0x65')]+','+(_0x5cefab['account']['waitForTheAssignedAgent']||0xa),'interval':_0x7386('0x4b')});}return respondWithRpcPromise(_0x7386('0x68'),'startRouting',_0x5cefab);});}return respondWithRpcPromise('Start',_0x7386('0x69'),_0x5cefab);})[_0x7386('0x26')](function(_0x16408c){_0x194d12(_0x16408c);})['catch'](function(_0x39e893){_0x196436(_0x374455[_0x7386('0x15')](0x1f4,_0x39e893[_0x7386('0x18')]));});});}; \ No newline at end of file +var _0x0e56=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','from','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','then','get','omit','applications','list','orderBy','priority','asc','push','length','close','autoclose','create','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','MailAccount','options','raw','limit','include','model','map','attributes','GetMailAccount','find','where','ShowMailAccount','stringify','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','body','isNil'];(function(_0x425922,_0x257eea){var _0x44b8d7=function(_0x53189e){while(--_0x53189e){_0x425922['push'](_0x425922['shift']());}};_0x44b8d7(++_0x257eea);}(_0x0e56,0xf9));var _0x60e5=function(_0x306ddc,_0x9c4d60){_0x306ddc=_0x306ddc-0x0;var _0x11767f=_0x0e56[_0x306ddc];return _0x11767f;};'use strict';var _=require(_0x60e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60e5('0x1'));var rs=require(_0x60e5('0x2'));var fs=require('fs');var Redis=require(_0x60e5('0x3'));var db=require(_0x60e5('0x4'))['db'];var utils=require(_0x60e5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x60e5('0x6'));var jayson=require(_0x60e5('0x7'));var client=jayson[_0x60e5('0x8')][_0x60e5('0x9')]({'port':0x232c});config['redis']=_[_0x60e5('0xa')](config[_0x60e5('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60e5('0xb')]));require(_0x60e5('0xc'))['register'](socket);function respondWithRpcPromise(_0x57e383,_0x5cabd2,_0x4b06a9){return new BPromise(function(_0x289a0c,_0x387971){return client[_0x60e5('0xd')](_0x57e383,_0x4b06a9)['then'](function(_0x369cd1){logger[_0x60e5('0xe')](_0x60e5('0xf'),_0x5cabd2,_0x60e5('0x10'));logger[_0x60e5('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5cabd2,_0x60e5('0x10'),JSON['stringify'](_0x369cd1));if(_0x369cd1[_0x60e5('0x12')]){if(_0x369cd1[_0x60e5('0x12')]['code']===0x1f4){logger[_0x60e5('0x12')](_0x60e5('0xf'),_0x5cabd2,_0x369cd1['error'][_0x60e5('0x13')]);return _0x387971(_0x369cd1[_0x60e5('0x12')]['message']);}logger[_0x60e5('0x12')](_0x60e5('0xf'),_0x5cabd2,_0x369cd1[_0x60e5('0x12')][_0x60e5('0x13')]);return _0x289a0c(_0x369cd1['error'][_0x60e5('0x13')]);}else{logger[_0x60e5('0xe')](_0x60e5('0xf'),_0x5cabd2,'request\x20sent');_0x289a0c(_0x369cd1[_0x60e5('0x14')][_0x60e5('0x13')]);}})[_0x60e5('0x15')](function(_0x564f88){logger[_0x60e5('0x12')](_0x60e5('0xf'),_0x5cabd2,_0x564f88);_0x387971(_0x564f88);});});}exports['GetMailAccount']=function(_0x388cd1){var _0x5723f0=this;return new Promise(function(_0x590df9,_0x3179e9){return db[_0x60e5('0x16')]['findAll']({'raw':_0x388cd1[_0x60e5('0x17')]?_0x388cd1['options'][_0x60e5('0x18')]===undefined?!![]:![]:!![],'where':_0x388cd1[_0x60e5('0x17')]?_0x388cd1[_0x60e5('0x17')]['where']||null:null,'attributes':_0x388cd1[_0x60e5('0x17')]?_0x388cd1[_0x60e5('0x17')]['attributes']||null:null,'limit':_0x388cd1[_0x60e5('0x17')]?_0x388cd1['options'][_0x60e5('0x19')]||null:null,'include':_0x388cd1[_0x60e5('0x17')]?_0x388cd1[_0x60e5('0x17')][_0x60e5('0x1a')]?_['map'](_0x388cd1[_0x60e5('0x17')][_0x60e5('0x1a')],function(_0x269086){return{'model':db[_0x269086[_0x60e5('0x1b')]],'as':_0x269086['as'],'attributes':_0x269086['attributes'],'include':_0x269086[_0x60e5('0x1a')]?_[_0x60e5('0x1c')](_0x269086['include'],function(_0x1ebc8a){return{'model':db[_0x1ebc8a[_0x60e5('0x1b')]],'as':_0x1ebc8a['as'],'attributes':_0x1ebc8a[_0x60e5('0x1d')],'include':_0x1ebc8a['include']?_[_0x60e5('0x1c')](_0x1ebc8a[_0x60e5('0x1a')],function(_0x1e8061){return{'model':db[_0x1e8061[_0x60e5('0x1b')]],'as':_0x1e8061['as'],'attributes':_0x1e8061[_0x60e5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14580c){logger[_0x60e5('0xe')]('GetMailAccount',_0x388cd1);logger[_0x60e5('0x11')](_0x60e5('0x1e'),_0x388cd1,JSON['stringify'](_0x14580c));_0x590df9(_0x14580c);})[_0x60e5('0x15')](function(_0x43c8eb){logger[_0x60e5('0x12')](_0x60e5('0x1e'),_0x43c8eb[_0x60e5('0x13')],_0x388cd1);_0x3179e9(_0x5723f0['error'](0x1f4,_0x43c8eb[_0x60e5('0x13')]));});});};exports['ShowMailAccount']=function(_0x5b5784){var _0x353d53=this;return new Promise(function(_0x34630,_0x182b55){return db['MailAccount'][_0x60e5('0x1f')]({'raw':_0x5b5784['options']?_0x5b5784[_0x60e5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5b5784[_0x60e5('0x17')]?_0x5b5784['options'][_0x60e5('0x20')]||null:null,'attributes':_0x5b5784[_0x60e5('0x17')]?_0x5b5784[_0x60e5('0x17')][_0x60e5('0x1d')]||null:null,'include':_0x5b5784[_0x60e5('0x17')]?_0x5b5784[_0x60e5('0x17')][_0x60e5('0x1a')]?_['map'](_0x5b5784['options']['include'],function(_0x29cef1){return{'model':db[_0x29cef1[_0x60e5('0x1b')]],'as':_0x29cef1['as'],'attributes':_0x29cef1[_0x60e5('0x1d')],'include':_0x29cef1[_0x60e5('0x1a')]?_[_0x60e5('0x1c')](_0x29cef1[_0x60e5('0x1a')],function(_0x465c29){return{'model':db[_0x465c29[_0x60e5('0x1b')]],'as':_0x465c29['as'],'attributes':_0x465c29['attributes'],'include':_0x465c29[_0x60e5('0x1a')]?_['map'](_0x465c29[_0x60e5('0x1a')],function(_0x22cdb0){return{'model':db[_0x22cdb0[_0x60e5('0x1b')]],'as':_0x22cdb0['as'],'attributes':_0x22cdb0[_0x60e5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x262951){logger['info'](_0x60e5('0x21'),_0x5b5784);logger[_0x60e5('0x11')](_0x60e5('0x21'),_0x5b5784,JSON[_0x60e5('0x22')](_0x262951));_0x34630(_0x262951);})[_0x60e5('0x15')](function(_0x3a3631){logger[_0x60e5('0x12')]('ShowMailAccount',_0x3a3631[_0x60e5('0x13')],_0x5b5784);_0x182b55(_0x353d53[_0x60e5('0x12')](0x1f4,_0x3a3631[_0x60e5('0x13')]));});});};exports[_0x60e5('0x23')]=function(_0x239683){var _0x474986=this;return new Promise(function(_0x5c1881,_0xd67836){var _0x5a2c29={'body':_0x239683['body'],'channel':'mail'};var _0x95e789=_[_0x60e5('0x24')](_[_0x60e5('0x25')](db[_0x60e5('0x26')][_0x60e5('0x27')]),[_0x60e5('0x28'),_0x60e5('0x29'),'CompanyId',_0x60e5('0x2a')]);var _0xac521=![];if(_0x239683[_0x60e5('0x2b')]['id']){delete _0x239683[_0x60e5('0x2b')]['id'];}if(_[_0x60e5('0x2c')](_0x239683[_0x60e5('0x2b')]['from'])){return _0xd67836(_0x474986['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x60e5('0x2c')](_0x239683[_0x60e5('0x2b')]['body'])||_0x239683['body']['body']===''){return _0xd67836(_0x474986[_0x60e5('0x12')](0x1f4,_0x60e5('0x2d')));}if(_[_0x60e5('0x2c')](_0x239683[_0x60e5('0x2b')][_0x60e5('0x2e')])){return _0xd67836(_0x474986[_0x60e5('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x95e789));}if(!_['includes'](_0x95e789,_0x239683[_0x60e5('0x2b')][_0x60e5('0x2e')])){return _0xd67836(_0x474986[_0x60e5('0x12')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x95e789));}var _0x244e63={};_0x244e63[_0x239683['body']['mapKey']]=_0x239683['body'][_0x60e5('0x2f')];return db['MailAccount'][_0x60e5('0x1f')]({'where':{'id':_0x239683[_0x60e5('0x30')]['id']},'include':[{'model':db[_0x60e5('0x31')],'as':_0x60e5('0x32'),'include':[{'model':db[_0x60e5('0x26')],'as':_0x60e5('0x33'),'where':_0x244e63,'limit':0x1,'order':[[_0x60e5('0x29'),_0x60e5('0x34')]]}]},{'model':db[_0x60e5('0x35')],'as':_0x60e5('0x36')},{'model':db['MailServerOut'],'as':_0x60e5('0x37')}]})[_0x60e5('0x38')](function(_0x225bcb){if(_0x225bcb&&_0x225bcb[_0x60e5('0x32')]){var _0x512c2=_0x225bcb[_0x60e5('0x39')]({'plain':!![]});_0x5a2c29[_0x60e5('0x30')]=_[_0x60e5('0x3a')](_0x512c2,[_0x60e5('0x36'),_0x60e5('0x32')]);_0x5a2c29[_0x60e5('0x3b')]=_0x512c2[_0x60e5('0x36')];_0x5a2c29[_0x60e5('0x3c')]=_0x512c2[_0x60e5('0x32')];_0x5a2c29[_0x60e5('0x3b')]=_[_0x60e5('0x3d')](_0x5a2c29['applications'],[_0x60e5('0x3e')],[_0x60e5('0x3f')]);if(_0x5a2c29[_0x60e5('0x30')]&&_0x5a2c29[_0x60e5('0x30')]['autoclose']){_0x5a2c29['applications'][_0x60e5('0x40')]({'id':0x0,'priority':_0x5a2c29[_0x60e5('0x3b')][_0x60e5('0x41')]+0x1,'app':_0x60e5('0x42'),'appdata':_0x60e5('0x43'),'interval':'*,*,*,*'});}if(_0x5a2c29[_0x60e5('0x30')][_0x60e5('0x36')]){delete _0x5a2c29[_0x60e5('0x30')][_0x60e5('0x36')];}if(_0x5a2c29[_0x60e5('0x30')]['List']){delete _0x5a2c29[_0x60e5('0x30')][_0x60e5('0x32')];}if(_0x512c2[_0x60e5('0x32')][_0x60e5('0x33')][_0x60e5('0x41')]){return _0x512c2['List'][_0x60e5('0x33')][0x0];}var _0xcd71a3=_[_0x60e5('0xa')](_0x239683[_0x60e5('0x2b')],{'firstName':_0x239683[_0x60e5('0x2b')]['from'],'ListId':_0x512c2[_0x60e5('0x2a')]});_0xcd71a3[_0x239683['body'][_0x60e5('0x2e')]]=_0x239683[_0x60e5('0x2b')][_0x60e5('0x2f')];return db[_0x60e5('0x26')][_0x60e5('0x44')](_0xcd71a3);}else{throw new Error('List\x20not\x20found');}})[_0x60e5('0x38')](function(_0x390cc4){_0x5a2c29['contact']=_0x390cc4;if(_0x390cc4){if(!_0x239683['body'][_0x60e5('0x13')][_0x60e5('0x45')]){_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['messageId']=rs['generate']()+'\x20'+_0x239683['body'][_0x60e5('0x13')]['from'];}var _0x118876={'ContactId':_0x390cc4['id'],'MailAccountId':_0x239683['account']['id'],'inReplyTo':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x45')],'to':_0x239683[_0x60e5('0x2b')]['message'][_0x60e5('0x2f')],'cc':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['cc'],'subject':_0x239683[_0x60e5('0x2b')]['message'][_0x60e5('0x46')],'attach':_0x239683[_0x60e5('0x2b')]['message'][_0x60e5('0x47')],'lastMsgAt':moment()[_0x60e5('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x60e5('0x49')]['find']({'where':{'closed':![],'MailAccountId':_0x239683[_0x60e5('0x30')]['id']},'include':[{'model':db[_0x60e5('0x4a')],'as':_0x60e5('0x4b'),'attributes':[_0x60e5('0x45')],'where':{'messageId':_0x239683['body'][_0x60e5('0x13')][_0x60e5('0x4c')]}}]})[_0x60e5('0x38')](function(_0x542df1){if(_0x542df1){return[_0x542df1,![]];}return db[_0x60e5('0x49')][_0x60e5('0x44')](_0x118876)[_0x60e5('0x38')](function(_0xc4759d){return[_0xc4759d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x60e5('0x4d')](function(_0x478434,_0x36f324){if(_0x478434){_0xac521=_0x36f324;if(!_0x36f324){return _0x478434[_0x60e5('0x4e')]({'inReplyTo':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x45')],'to':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x2f')],'cc':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['cc'],'subject':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['subject'],'attach':_0x478434['attach']?_0x478434['attach']:_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x47')],'substatus':null,'substatusAt':moment()[_0x60e5('0x48')](_0x60e5('0x4f')),'lastMsgAt':moment()[_0x60e5('0x48')](_0x60e5('0x4f')),'lastMsgDirection':'in'});}else{return _0x478434;}}})['then'](function(_0x420740){_0x5a2c29[_0x60e5('0x50')]=_0x420740[_0x60e5('0x39')]({'plain':!![]});_0x5a2c29[_0x60e5('0x50')]['created']=_0xac521;return db[_0x60e5('0x4a')]['create']({'body':_0x239683[_0x60e5('0x2b')][_0x60e5('0x2b')],'MailAccountId':_0x239683[_0x60e5('0x30')]['id'],'MailInteractionId':_0x420740['id'],'direction':'in','ContactId':_0x5a2c29[_0x60e5('0x51')]['id'],'messageId':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x45')],'from':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x2f')],'to':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['to'],'cc':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['cc'],'subject':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x46')],'attach':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x47')],'Attachments':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['attachments'],'originTo':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['originTo'],'originCc':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x52')],'bcc':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x53')],'ChatWebsiteId':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x54')]||null,'originChannel':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')]['originChannel']||_0x60e5('0x55'),'ChatOfflineMessageId':_0x239683[_0x60e5('0x2b')][_0x60e5('0x13')][_0x60e5('0x56')]||null},{'include':[{'model':db[_0x60e5('0x57')],'as':_0x60e5('0x58')}]});})[_0x60e5('0x38')](function(_0x5add77){_0x5a2c29[_0x60e5('0x13')]=_0x5add77;if(_0x5a2c29[_0x60e5('0x50')][_0x60e5('0x59')]){return db[_0x60e5('0x5a')][_0x60e5('0x1f')]({'attributes':['id',_0x60e5('0x5b')],'where':{'id':_0x5a2c29['interaction'][_0x60e5('0x59')]}})[_0x60e5('0x38')](function(_0x29a53d){if(_0x29a53d){_0x5a2c29[_0x60e5('0x3b')][_0x60e5('0x5c')]({'id':0x0,'priority':0x0,'app':_0x60e5('0x5d'),'appdata':_0x29a53d[_0x60e5('0x5b')]+','+(_0x5a2c29[_0x60e5('0x30')][_0x60e5('0x5e')]||0xa),'interval':_0x60e5('0x5f')});}return respondWithRpcPromise('Start',_0x60e5('0x60'),_0x5a2c29);});}return respondWithRpcPromise(_0x60e5('0x61'),_0x60e5('0x60'),_0x5a2c29);})[_0x60e5('0x38')](function(_0x3d38d1){_0x5c1881(_0x3d38d1);})[_0x60e5('0x15')](function(_0x36ee3d){_0xd67836(_0x474986[_0x60e5('0x12')](0x1f4,_0x36ee3d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 7fea16f..c77abc6 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 _0xc4be=['register','length','./mailAccount.events','remove','update','emit','removeListener'];(function(_0x4f6683,_0x4b9f35){var _0x380b43=function(_0x2d4a96){while(--_0x2d4a96){_0x4f6683['push'](_0x4f6683['shift']());}};_0x380b43(++_0x4b9f35);}(_0xc4be,0x1bb));var _0xec4b=function(_0x36133f,_0x20d328){_0x36133f=_0x36133f-0x0;var _0x37295d=_0xc4be[_0x36133f];return _0x37295d;};'use strict';var MailAccountEvents=require(_0xec4b('0x0'));var events=['save',_0xec4b('0x1'),_0xec4b('0x2')];function createListener(_0x2d67f3,_0x4a1cab){return function(_0x4b7f15){_0x4a1cab[_0xec4b('0x3')](_0x2d67f3,_0x4b7f15);};}function removeListener(_0x1be41a,_0x45bbcb){return function(){MailAccountEvents[_0xec4b('0x4')](_0x1be41a,_0x45bbcb);};}exports[_0xec4b('0x5')]=function(_0x47f83d){for(var _0x5987c9=0x0,_0x36d465=events[_0xec4b('0x6')];_0x5987c9<_0x36d465;_0x5987c9++){var _0x313794=events[_0x5987c9];var _0x57059c=createListener('mailAccount:'+_0x313794,_0x47f83d);MailAccountEvents['on'](_0x313794,_0x57059c);}}; \ No newline at end of file +var _0xa9e2=['removeListener','register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x498953,_0x82d4af){var _0x4b2237=function(_0x5eda56){while(--_0x5eda56){_0x498953['push'](_0x498953['shift']());}};_0x4b2237(++_0x82d4af);}(_0xa9e2,0xc0));var _0x2a9e=function(_0x549808,_0x1c2594){_0x549808=_0x549808-0x0;var _0x5d7a7a=_0xa9e2[_0x549808];return _0x5d7a7a;};'use strict';var MailAccountEvents=require(_0x2a9e('0x0'));var events=[_0x2a9e('0x1'),_0x2a9e('0x2'),_0x2a9e('0x3')];function createListener(_0x55e4e9,_0x171570){return function(_0x598aea){_0x171570['emit'](_0x55e4e9,_0x598aea);};}function removeListener(_0x1adf2a,_0x562528){return function(){MailAccountEvents[_0x2a9e('0x4')](_0x1adf2a,_0x562528);};}exports[_0x2a9e('0x5')]=function(_0x2eb623){for(var _0x2c8a5e=0x0,_0x15a389=events['length'];_0x2c8a5e<_0x15a389;_0x2c8a5e++){var _0x524a57=events[_0x2c8a5e];var _0x4f5b58=createListener(_0x2a9e('0x6')+_0x524a57,_0x2eb623);MailAccountEvents['on'](_0x524a57,_0x4f5b58);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index bd00747..739e56b 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 _0x8912=['express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','show','put','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8912,0xb1));var _0x2891=function(_0x50b345,_0x34ea21){_0x50b345=_0x50b345-0x0;var _0x3804d8=_0x8912[_0x50b345];return _0x3804d8;};'use strict';var multer=require(_0x2891('0x0'));var util=require(_0x2891('0x1'));var path=require(_0x2891('0x2'));var timeout=require('connect-timeout');var express=require(_0x2891('0x3'));var router=express[_0x2891('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2891('0x5'));var interaction=require(_0x2891('0x6'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x2891('0x7')](_0x2891('0x8'),auth['isAuthenticated'](),controller[_0x2891('0x9')]);router[_0x2891('0xa')](_0x2891('0x8'),auth[_0x2891('0xb')](),controller[_0x2891('0xc')]);router[_0x2891('0xd')](_0x2891('0x8'),auth[_0x2891('0xb')](),controller['destroy']);module[_0x2891('0xe')]=router; \ No newline at end of file +var _0xe928=['/:id','show','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x4935bf,_0x401f41){var _0x4bdb8c=function(_0x2f5757){while(--_0x2f5757){_0x4935bf['push'](_0x4935bf['shift']());}};_0x4bdb8c(++_0x401f41);}(_0xe928,0x177));var _0x8e92=function(_0x119fb1,_0x357863){_0x119fb1=_0x119fb1-0x0;var _0x2c8168=_0xe928[_0x119fb1];return _0x2c8168;};'use strict';var multer=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var path=require(_0x8e92('0x2'));var timeout=require(_0x8e92('0x3'));var express=require(_0x8e92('0x4'));var router=express['Router']();var fs_extra=require(_0x8e92('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e92('0x6'));var config=require(_0x8e92('0x7'));var controller=require(_0x8e92('0x8'));router['get'](_0x8e92('0x9'),auth['isAuthenticated'](),controller[_0x8e92('0xa')]);router[_0x8e92('0xb')](_0x8e92('0x9'),auth[_0x8e92('0xc')](),controller[_0x8e92('0xd')]);router[_0x8e92('0xe')]('/:id',auth[_0x8e92('0xc')](),controller[_0x8e92('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 450926c..33eb260 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 _0x3c0f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2edf62,_0x335035){var _0x1e67ff=function(_0x3e1203){while(--_0x3e1203){_0x2edf62['push'](_0x2edf62['shift']());}};_0x1e67ff(++_0x335035);}(_0x3c0f,0xa9));var _0xf3c0=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x3c0f[_0x102f97];return _0xd22058;};'use strict';var Sequelize=require(_0xf3c0('0x0'));module[_0xf3c0('0x1')]={'priority':{'type':Sequelize[_0xf3c0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf3c0('0x3')],'allowNull':![],'defaultValue':_0xf3c0('0x4')},'appdata':{'type':Sequelize[_0xf3c0('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf3c0('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xf5f6=['INTEGER','STRING','sequelize','exports'];(function(_0x55fb6e,_0x2874ed){var _0xe88932=function(_0x14e6ea){while(--_0x14e6ea){_0x55fb6e['push'](_0x55fb6e['shift']());}};_0xe88932(++_0x2874ed);}(_0xf5f6,0x13e));var _0x6f5f=function(_0x5262c1,_0x518a77){_0x5262c1=_0x5262c1-0x0;var _0x35530e=_0xf5f6[_0x5262c1];return _0x35530e;};'use strict';var Sequelize=require(_0x6f5f('0x0'));module[_0x6f5f('0x1')]={'priority':{'type':Sequelize[_0x6f5f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6f5f('0x3')]},'interval':{'type':Sequelize[_0x6f5f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 965d9a1..2ec468a 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../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','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x3b9149,_0x2f93ab){var _0x2067f4=function(_0x5a78ce){while(--_0x5a78ce){_0x3b9149['push'](_0x3b9149['shift']());}};_0x2067f4(++_0x2f93ab);}(_0x70e0,0x17b));var _0x070e=function(_0x366afd,_0x5b3062){_0x366afd=_0x366afd-0x0;var _0x3cc994=_0x70e0[_0x366afd];return _0x3cc994;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0xaa88[_0x4cfc1d];return _0x1c01a0;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index e0c8640..1d258a5 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 _0x769b=['mail_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication'];(function(_0x3c7201,_0x1e26f3){var _0xaeff37=function(_0x1856bd){while(--_0x1856bd){_0x3c7201['push'](_0x3c7201['shift']());}};_0xaeff37(++_0x1e26f3);}(_0x769b,0x14c));var _0xb769=function(_0x4f02d8,_0x5a99e3){_0x4f02d8=_0x4f02d8-0x0;var _0x420e26=_0x769b[_0x4f02d8];return _0x420e26;};'use strict';var _=require('lodash');var util=require(_0xb769('0x0'));var logger=require('../../config/logger')(_0xb769('0x1'));var moment=require(_0xb769('0x2'));var BPromise=require(_0xb769('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb769('0x4'));var config=require(_0xb769('0x5'));var attributes=require(_0xb769('0x6'));module['exports']=function(_0x2c3764,_0x5511bc){return _0x2c3764[_0xb769('0x7')](_0xb769('0x8'),attributes,{'tableName':_0xb769('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb769('0xa')});}; \ No newline at end of file +var _0x604b=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4373ec,_0x5262c4){var _0x38bb8=function(_0x11d4ed){while(--_0x11d4ed){_0x4373ec['push'](_0x4373ec['shift']());}};_0x38bb8(++_0x5262c4);}(_0x604b,0xb6));var _0xb604=function(_0xc9fe9b,_0x2d472a){_0xc9fe9b=_0xc9fe9b-0x0;var _0x231282=_0x604b[_0xc9fe9b];return _0x231282;};'use strict';var _=require('lodash');var util=require(_0xb604('0x0'));var logger=require(_0xb604('0x1'))(_0xb604('0x2'));var moment=require(_0xb604('0x3'));var BPromise=require('bluebird');var rp=require(_0xb604('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb604('0x5'));var config=require(_0xb604('0x6'));var attributes=require(_0xb604('0x7'));module[_0xb604('0x8')]=function(_0x132b9c,_0x176af3){return _0x132b9c[_0xb604('0x9')](_0xb604('0xa'),attributes,{'tableName':_0xb604('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb604('0xc'),'collate':_0xb604('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 83cfb53..1f3d02d 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 _0x39b8=['jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x296266,_0x230c62){var _0x15e1bb=function(_0x3831c9){while(--_0x3831c9){_0x296266['push'](_0x296266['shift']());}};_0x15e1bb(++_0x230c62);}(_0x39b8,0x190));var _0x839b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x39b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x839b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x839b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x839b('0x2'))['db'];var utils=require(_0x839b('0x3'));var logger=require('../../config/logger')(_0x839b('0x4'));var config=require('../../config/environment');var jayson=require(_0x839b('0x5'));var client=jayson[_0x839b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568452,_0x38c511,_0x5941a4){return new BPromise(function(_0x5e3241,_0x298693){return client[_0x839b('0x7')](_0x568452,_0x5941a4)[_0x839b('0x8')](function(_0x29813d){logger[_0x839b('0x9')](_0x839b('0xa'),_0x38c511,_0x839b('0xb'));logger[_0x839b('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x38c511,_0x839b('0xb'),JSON[_0x839b('0xd')](_0x29813d));if(_0x29813d[_0x839b('0xe')]){if(_0x29813d[_0x839b('0xe')][_0x839b('0xf')]===0x1f4){logger[_0x839b('0xe')]('MailApplication,\x20%s,\x20%s',_0x38c511,_0x29813d[_0x839b('0xe')]['message']);return _0x298693(_0x29813d['error'][_0x839b('0x10')]);}logger[_0x839b('0xe')](_0x839b('0xa'),_0x38c511,_0x29813d[_0x839b('0xe')][_0x839b('0x10')]);return _0x5e3241(_0x29813d[_0x839b('0xe')][_0x839b('0x10')]);}else{logger[_0x839b('0x9')](_0x839b('0xa'),_0x38c511,'request\x20sent');_0x5e3241(_0x29813d[_0x839b('0x11')][_0x839b('0x10')]);}})[_0x839b('0x12')](function(_0x4b2e4b){logger['error'](_0x839b('0xa'),_0x38c511,_0x4b2e4b);_0x298693(_0x4b2e4b);});});}exports[_0x839b('0x13')]=function(_0x50431b){var _0x38b99c=this;return new Promise(function(_0x1c6fee,_0x401ab1){return db[_0x839b('0x14')]['update'](_0x50431b[_0x839b('0x15')],{'raw':_0x50431b['options']?_0x50431b[_0x839b('0x16')][_0x839b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50431b['options']?_0x50431b[_0x839b('0x16')][_0x839b('0x18')]||null:null,'attributes':_0x50431b[_0x839b('0x16')]?_0x50431b['options'][_0x839b('0x19')]||null:null,'limit':_0x50431b[_0x839b('0x16')]?_0x50431b[_0x839b('0x16')][_0x839b('0x1a')]||null:null})[_0x839b('0x8')](function(_0x3ecb9d){logger[_0x839b('0x9')](_0x839b('0x13'),_0x50431b);logger[_0x839b('0xc')](_0x839b('0x13'),_0x50431b,JSON['stringify'](_0x3ecb9d));_0x1c6fee(_0x3ecb9d);})[_0x839b('0x12')](function(_0x169879){logger[_0x839b('0xe')]('UpdateMailApplication',_0x169879['message'],_0x50431b);_0x401ab1(_0x38b99c['error'](0x1f4,_0x169879[_0x839b('0x10')]));});});}; \ No newline at end of file +var _0x94e6=['debug','error','code','message','info','result','catch','UpdateMailApplication','update','options','where','limit','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x94e6,0x93));var _0x694e=function(_0x391329,_0x38e3a0){_0x391329=_0x391329-0x0;var _0x515fb5=_0x94e6[_0x391329];return _0x515fb5;};'use strict';var _=require('lodash');var util=require(_0x694e('0x0'));var moment=require(_0x694e('0x1'));var BPromise=require('bluebird');var rs=require(_0x694e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x694e('0x3'))['db'];var utils=require(_0x694e('0x4'));var logger=require(_0x694e('0x5'))(_0x694e('0x6'));var config=require(_0x694e('0x7'));var jayson=require(_0x694e('0x8'));var client=jayson[_0x694e('0x9')][_0x694e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59e793,_0x5d7fc3,_0x12501e){return new BPromise(function(_0x1a81c5,_0x52f076){return client[_0x694e('0xb')](_0x59e793,_0x12501e)[_0x694e('0xc')](function(_0x24f4ad){logger['info'](_0x694e('0xd'),_0x5d7fc3,_0x694e('0xe'));logger[_0x694e('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5d7fc3,_0x694e('0xe'),JSON['stringify'](_0x24f4ad));if(_0x24f4ad[_0x694e('0x10')]){if(_0x24f4ad[_0x694e('0x10')][_0x694e('0x11')]===0x1f4){logger[_0x694e('0x10')]('MailApplication,\x20%s,\x20%s',_0x5d7fc3,_0x24f4ad[_0x694e('0x10')][_0x694e('0x12')]);return _0x52f076(_0x24f4ad[_0x694e('0x10')]['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x5d7fc3,_0x24f4ad[_0x694e('0x10')][_0x694e('0x12')]);return _0x1a81c5(_0x24f4ad[_0x694e('0x10')]['message']);}else{logger[_0x694e('0x13')](_0x694e('0xd'),_0x5d7fc3,'request\x20sent');_0x1a81c5(_0x24f4ad[_0x694e('0x14')]['message']);}})[_0x694e('0x15')](function(_0x2d12bc){logger[_0x694e('0x10')]('MailApplication,\x20%s,\x20%s',_0x5d7fc3,_0x2d12bc);_0x52f076(_0x2d12bc);});});}exports[_0x694e('0x16')]=function(_0x421584){var _0xa0d6f1=this;return new Promise(function(_0x5ab413,_0x4eee5a){return db['MailApplication'][_0x694e('0x17')](_0x421584['body'],{'raw':_0x421584[_0x694e('0x18')]?_0x421584['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421584[_0x694e('0x18')]?_0x421584['options'][_0x694e('0x19')]||null:null,'attributes':_0x421584[_0x694e('0x18')]?_0x421584[_0x694e('0x18')]['attributes']||null:null,'limit':_0x421584['options']?_0x421584[_0x694e('0x18')][_0x694e('0x1a')]||null:null})[_0x694e('0xc')](function(_0x253533){logger[_0x694e('0x13')](_0x694e('0x16'),_0x421584);logger['debug'](_0x694e('0x16'),_0x421584,JSON['stringify'](_0x253533));_0x5ab413(_0x253533);})[_0x694e('0x15')](function(_0x3f8156){logger[_0x694e('0x10')](_0x694e('0x16'),_0x3f8156[_0x694e('0x12')],_0x421584);_0x4eee5a(_0xa0d6f1[_0x694e('0x10')](0x1f4,_0x3f8156[_0x694e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index ada6fbf..2cef041 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 _0x7c47=['exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','mailinteraction:update','mailinteraction:destroy','destroy','delete','removeTags'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7c47,0xa9));var _0x77c4=function(_0x194838,_0x69a2ca){_0x194838=_0x194838-0x0;var _0x7ecc7c=_0x7c47[_0x194838];return _0x7ecc7c;};'use strict';var express=require('express');var router=express[_0x77c4('0x0')]();var auth=require(_0x77c4('0x1'));var interaction=require(_0x77c4('0x2'));var controller=require(_0x77c4('0x3'));router[_0x77c4('0x4')]('/',auth[_0x77c4('0x5')](),controller['index']);router[_0x77c4('0x4')](_0x77c4('0x6'),auth['isAuthenticated'](),controller[_0x77c4('0x7')]);router[_0x77c4('0x4')]('/:id',auth[_0x77c4('0x5')](),controller[_0x77c4('0x8')]);router[_0x77c4('0x4')](_0x77c4('0x9'),auth[_0x77c4('0x5')](),controller[_0x77c4('0xa')]);router[_0x77c4('0x4')](_0x77c4('0xb'),auth[_0x77c4('0x5')](),controller[_0x77c4('0xc')]);router['post']('/',auth[_0x77c4('0x5')](),controller[_0x77c4('0xd')]);router[_0x77c4('0xe')](_0x77c4('0x9'),auth[_0x77c4('0x5')](),controller['addMessage']);router[_0x77c4('0xe')](_0x77c4('0xf'),auth[_0x77c4('0x5')](),interaction[_0x77c4('0x10')]('mail',_0x77c4('0x11')),controller[_0x77c4('0x12')]);router[_0x77c4('0x13')](_0x77c4('0x14'),auth[_0x77c4('0x5')](),interaction['tracked'](_0x77c4('0x15'),_0x77c4('0x16')),controller['update']);router['delete'](_0x77c4('0x14'),auth[_0x77c4('0x5')](),interaction[_0x77c4('0x10')](_0x77c4('0x15'),_0x77c4('0x17')),controller[_0x77c4('0x18')]);router[_0x77c4('0x19')](_0x77c4('0xf'),auth[_0x77c4('0x5')](),controller[_0x77c4('0x1a')]);module[_0x77c4('0x1b')]=router; \ No newline at end of file +var _0xa092=['put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','/describe','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa092,0xd9));var _0x2a09=function(_0x2b9af6,_0x475a9b){_0x2b9af6=_0x2b9af6-0x0;var _0x20ed39=_0xa092[_0x2b9af6];return _0x20ed39;};'use strict';var express=require(_0x2a09('0x0'));var router=express[_0x2a09('0x1')]();var auth=require(_0x2a09('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x2a09('0x3'));router[_0x2a09('0x4')]('/',auth[_0x2a09('0x5')](),controller['index']);router[_0x2a09('0x4')](_0x2a09('0x6'),auth[_0x2a09('0x5')](),controller['describe']);router[_0x2a09('0x4')]('/:id',auth[_0x2a09('0x5')](),controller['show']);router[_0x2a09('0x4')](_0x2a09('0x7'),auth[_0x2a09('0x5')](),controller[_0x2a09('0x8')]);router[_0x2a09('0x4')]('/:id/download',auth['isAuthenticated'](),controller[_0x2a09('0x9')]);router[_0x2a09('0xa')]('/',auth[_0x2a09('0x5')](),controller[_0x2a09('0xb')]);router['post'](_0x2a09('0x7'),auth[_0x2a09('0x5')](),controller['addMessage']);router['post'](_0x2a09('0xc'),auth[_0x2a09('0x5')](),interaction[_0x2a09('0xd')](_0x2a09('0xe'),_0x2a09('0xf')),controller[_0x2a09('0x10')]);router[_0x2a09('0x11')]('/:id',auth[_0x2a09('0x5')](),interaction['tracked'](_0x2a09('0xe'),_0x2a09('0x12')),controller[_0x2a09('0x13')]);router[_0x2a09('0x14')](_0x2a09('0x15'),auth[_0x2a09('0x5')](),interaction[_0x2a09('0xd')](_0x2a09('0xe'),_0x2a09('0x16')),controller[_0x2a09('0x17')]);router[_0x2a09('0x14')](_0x2a09('0xc'),auth['isAuthenticated'](),controller[_0x2a09('0x18')]);module[_0x2a09('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index ff5e898..b445ebd 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 _0xeb36=['DATE','STRING','TEXT','out','sequelize','exports','BOOLEAN'];(function(_0xf805a6,_0x566679){var _0x30f441=function(_0x101a14){while(--_0x101a14){_0xf805a6['push'](_0xf805a6['shift']());}};_0x30f441(++_0x566679);}(_0xeb36,0x74));var _0x6eb3=function(_0x23116c,_0x22e524){_0x23116c=_0x23116c-0x0;var _0x5a7323=_0xeb36[_0x23116c];return _0x5a7323;};'use strict';var Sequelize=require(_0x6eb3('0x0'));var iconv=require('iconv');module[_0x6eb3('0x1')]={'closed':{'type':Sequelize[_0x6eb3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6eb3('0x3')]},'disposition':{'type':Sequelize[_0x6eb3('0x4')]},'secondDisposition':{'type':Sequelize[_0x6eb3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6eb3('0x4')]},'note':{'type':Sequelize[_0x6eb3('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x6eb3('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6eb3('0x3')]},'substatus':{'type':Sequelize[_0x6eb3('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6eb3('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6eb3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6eb3('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3981=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x25ede0,_0x29dc39){var _0x16fc37=function(_0x13e4d1){while(--_0x13e4d1){_0x25ede0['push'](_0x25ede0['shift']());}};_0x16fc37(++_0x29dc39);}(_0x3981,0x144));var _0x1398=function(_0x208682,_0x3de7d3){_0x208682=_0x208682-0x0;var _0x3fa4b0=_0x3981[_0x208682];return _0x3fa4b0;};'use strict';var Sequelize=require(_0x1398('0x0'));var iconv=require('iconv');module[_0x1398('0x1')]={'closed':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1398('0x3')]},'disposition':{'type':Sequelize[_0x1398('0x4')]},'secondDisposition':{'type':Sequelize[_0x1398('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1398('0x4')]},'note':{'type':Sequelize[_0x1398('0x4')]},'inReplyTo':{'type':Sequelize[_0x1398('0x4')](0x1fe)},'to':{'type':Sequelize[_0x1398('0x4')]},'cc':{'type':Sequelize[_0x1398('0x5')](_0x1398('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1398('0x3')]},'substatus':{'type':Sequelize[_0x1398('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1398('0x7')]('in',_0x1398('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1398('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1398('0x7')]('in',_0x1398('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b0a7cbd..806a005 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 _0x9934=['`\x20>\x200','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','isEmpty','MailAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','sequelize','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','rows','show','includeAll','create','body','params','destroy','describe','addMessage','ids','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','true','spread','color','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','format','Messages','bcc','get','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','count','limit','set','update','then','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','index','MailInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','length','conditions','find','unreadMessages','having','`\x20=\x200'];(function(_0x5ae28c,_0x59bcb2){var _0x4ae7dd=function(_0xf4f96a){while(--_0xf4f96a){_0x5ae28c['push'](_0x5ae28c['shift']());}};_0x4ae7dd(++_0x59bcb2);}(_0x9934,0x162));var _0x4993=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x9934[_0x120123];return _0x3bec4c;};'use strict';var emlformat=require(_0x4993('0x0'));var rimraf=require(_0x4993('0x1'));var zipdir=require(_0x4993('0x2'));var moment=require(_0x4993('0x3'));var BPromise=require('bluebird');var util=require(_0x4993('0x4'));var path=require(_0x4993('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4993('0x6'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x4993('0x7'));var as=require(_0x4993('0x8'));var logger=require('../../config/logger')(_0x4993('0x9'));var config=require('../../config/environment');var db=require(_0x4993('0xa'))['db'];var htmlEntities=require(_0x4993('0xb'));config['redis']=_[_0x4993('0xc')](config[_0x4993('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4993('0xe'))(new Redis(config[_0x4993('0xd')]));require(_0x4993('0xf'))[_0x4993('0x10')](socket);function respondWithStatusCode(_0x3bf4b4,_0x288ebf){_0x288ebf=_0x288ebf||0xcc;return function(_0x60936b){if(_0x60936b){return _0x3bf4b4['sendStatus'](_0x288ebf);}return _0x3bf4b4[_0x4993('0x11')](_0x288ebf)[_0x4993('0x12')]();};}function respondWithResult(_0x4702f1,_0x1960a9){_0x1960a9=_0x1960a9||0xc8;return function(_0x2450ec){if(_0x2450ec){return _0x4702f1['status'](_0x1960a9)[_0x4993('0x13')](_0x2450ec);}};}function respondWithFilteredResult(_0x37a107,_0x1794db){return function(_0xed2cc7){if(_0xed2cc7){var _0x10bb95=typeof _0x1794db[_0x4993('0x14')]===_0x4993('0x15')&&typeof _0x1794db['limit']===_0x4993('0x15');var _0x171450=_0xed2cc7[_0x4993('0x16')];var _0x33831b=_0x10bb95?0x0:_0x1794db[_0x4993('0x14')];var _0x1d351d=_0x10bb95?_0xed2cc7[_0x4993('0x16')]:_0x1794db['offset']+_0x1794db[_0x4993('0x17')];var _0x3acb78;if(_0x1d351d>=_0x171450){_0x1d351d=_0x171450;_0x3acb78=0xc8;}else{_0x3acb78=0xce;}_0x37a107['status'](_0x3acb78);return _0x37a107[_0x4993('0x18')]('Content-Range',_0x33831b+'-'+_0x1d351d+'/'+_0x171450)[_0x4993('0x13')](_0xed2cc7);}return null;};}function saveUpdates(_0x1f39c9){return function(_0x4e7a38){if(_0x4e7a38){return _0x4e7a38[_0x4993('0x19')](_0x1f39c9)[_0x4993('0x1a')](function(_0x64c32){return _0x64c32;});}return null;};}function removeEntity(_0x1bd923){return function(_0x264260){if(_0x264260){return _0x264260['destroy']()['then'](function(){_0x1bd923[_0x4993('0x11')](0xcc)[_0x4993('0x12')]();});}};}function handleEntityNotFound(_0x1942e4){return function(_0x1d02ad){if(!_0x1d02ad){_0x1942e4[_0x4993('0x1b')](0x194);}return _0x1d02ad;};}function handleError(_0x236f65,_0x15f5c2){_0x15f5c2=_0x15f5c2||0x1f4;return function(_0x3d8ccf){logger['error'](_0x3d8ccf[_0x4993('0x1c')]);if(_0x3d8ccf[_0x4993('0x1d')]){delete _0x3d8ccf['name'];}_0x236f65[_0x4993('0x11')](_0x15f5c2)[_0x4993('0x1e')](_0x3d8ccf);};}function getInteractionUsers(_0xb809bc,_0x586af5){return new BPromise(function(_0x469133,_0x92997d){try{if(_0x586af5[_0xb809bc['id']]){_0xb809bc[_0x4993('0x1f')]=_[_0x4993('0x20')](_0x586af5[_0xb809bc['id']],function(_0x49a5b1){return{'id':_0x49a5b1['id'],'fullname':_0x49a5b1[_0x4993('0x21')]};});}}catch(_0x2e3ca4){_0x92997d(_0x2e3ca4);}_0x469133(_0xb809bc);});}function getInteractionTags(_0x494097,_0xcf2250){return new BPromise(function(_0x2af4f9,_0x940ab4){try{if(_0x494097[_0x4993('0x22')]){_0x494097[_0x4993('0x23')]=[];_0x494097['TagIds']['split'](',')[_0x4993('0x24')](function(_0x3513fa){_0x494097['Tags'][_0x4993('0x25')](_0xcf2250[_0x3513fa]);});}delete _0x494097[_0x4993('0x22')];}catch(_0x23c8c9){_0x940ab4(_0x23c8c9);}_0x2af4f9(_0x494097);});}function getLastMessageText(_0x378bb1){return new BPromise(function(_0x31ef78,_0x39a79b){return db[_0x4993('0x26')][_0x4993('0x27')]({'where':{'$and':[{'MailInteractionId':_0x378bb1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4993('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x4993('0x29')],'order':_0x4993('0x2a'),'raw':!![]})[_0x4993('0x1a')](function(_0x417b44){if(_0x417b44&&_0x417b44[_0x4993('0x29')]){_0x378bb1['lastMsgText']=_[_0x4993('0x2b')](_0x417b44['plainBody']);}_0x31ef78(_0x378bb1);})[_0x4993('0x2c')](function(_0xcdbc26){_0x39a79b(_0xcdbc26);});});}function updateMailInteraction(_0x46434e,_0x54c492,_0x2f1ea0,_0x21ca1f){return new BPromise(function(_0x2e464a,_0x36ff6a){return getInteractionUsers(_0x46434e,_0x2f1ea0)['then'](function(_0x983142){return getInteractionTags(_0x983142,_0x54c492);})['then'](function(_0x4ad138){if(_0x21ca1f){_0x2e464a(getLastMessageText(_0x4ad138));}else{_0x2e464a(_0x4ad138);}})[_0x4993('0x2c')](function(_0x244a4d){_0x36ff6a(_0x244a4d);});});}exports[_0x4993('0x2d')]=function(_0x5ad0a9,_0x57dd0f){var _0x287c68={},_0x5d3c1b={},_0x203b29={'count':0x0,'rows':[]};var _0x8e5ae=_[_0x4993('0x20')](db[_0x4993('0x2e')][_0x4993('0x2f')],function(_0xc1d1e4){return{'name':_0xc1d1e4['fieldName'],'type':_0xc1d1e4[_0x4993('0x30')][_0x4993('0x31')]};});_0x5d3c1b[_0x4993('0x32')]=_[_0x4993('0x20')](_0x8e5ae,_0x4993('0x1d'));_0x5d3c1b[_0x4993('0x33')]=_[_0x4993('0x34')](_0x5ad0a9[_0x4993('0x33')]);_0x5d3c1b[_0x4993('0x35')]=_[_0x4993('0x36')](_0x5d3c1b[_0x4993('0x32')],_0x5d3c1b[_0x4993('0x33')]);_0x287c68[_0x4993('0x37')]=_[_0x4993('0x36')](_0x5d3c1b[_0x4993('0x32')],qs[_0x4993('0x38')](_0x5ad0a9['query'][_0x4993('0x38')]));_0x287c68[_0x4993('0x37')]=_0x287c68[_0x4993('0x37')]['length']?_0x287c68[_0x4993('0x37')]:_0x5d3c1b[_0x4993('0x32')];if(!_0x5ad0a9['query'][_0x4993('0x39')]('nolimit')){_0x287c68['limit']=qs[_0x4993('0x17')](_0x5ad0a9[_0x4993('0x33')][_0x4993('0x17')]);_0x287c68[_0x4993('0x14')]=qs[_0x4993('0x14')](_0x5ad0a9[_0x4993('0x33')][_0x4993('0x14')]);}_0x287c68[_0x4993('0x3a')]=qs[_0x4993('0x3b')](_0x5ad0a9['query'][_0x4993('0x3b')]);_0x287c68[_0x4993('0x3c')]=qs['filters'](_[_0x4993('0x3d')](_0x5ad0a9[_0x4993('0x33')],_0x5d3c1b['filters']),_0x8e5ae);var _0x372ed7=[];var _0x4dd61c=squel[_0x4993('0x3e')]()[_0x4993('0x3f')]('id')['field'](_0x4993('0x1d'))[_0x4993('0x3f')]('color')[_0x4993('0x40')](_0x4993('0x41'));var _0x19638f=squel['select']()['field'](_0x4993('0x42'))['field'](_0x4993('0x43'))[_0x4993('0x3f')](_0x4993('0x44'))[_0x4993('0x40')]('user_has_mail_interactions','ui')[_0x4993('0x45')](_0x4993('0x46'),'u','u.id\x20=\x20ui.UserId');var _0x4fae30=squel['select']()[_0x4993('0x40')](_0x4993('0x47'),'i')[_0x4993('0x45')](_0x4993('0x48'),'c',_0x4993('0x49'))['left_join']('users','o',_0x4993('0x4a'))[_0x4993('0x45')](_0x4993('0x4b'),'a',_0x4993('0x4c'))['left_join'](_0x4993('0x4d'),'me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it',_0x4993('0x4e'))[_0x4993('0x45')](_0x4993('0x41'),'t',_0x4993('0x4f'));var _0x412d9e=squel[_0x4993('0x50')]();var _0x328a75=[];var _0x3e5f69=squel[_0x4993('0x50')]();var _0x52fa23;if(_0x5ad0a9[_0x4993('0x33')]['search']){_0x52fa23=as[_0x4993('0x51')](_0x5ad0a9[_0x4993('0x33')][_0x4993('0x52')]);var _0x1bf82d=_0x52fa23[_0x4993('0x53')];for(var _0x2cabe8=0x0;_0x2cabe8<_0x52fa23['conditions'][_0x4993('0x54')];_0x2cabe8++){var _0x42f956=_0x52fa23[_0x4993('0x55')][_0x2cabe8];var _0x363708='i';var _0x3fe20e=_[_0x4993('0x56')](_0x8e5ae,[_0x4993('0x1d'),_0x42f956[_0x4993('0x3f')]]);if(!_0x3fe20e){switch(_0x42f956['field']){case _0x4993('0x57'):if(_0x42f956['value']==0x1){_0x4fae30[_0x4993('0x58')]('`'+_0x42f956[_0x4993('0x3f')]+_0x4993('0x59'));}else{_0x4fae30[_0x4993('0x58')]('`'+_0x42f956[_0x4993('0x3f')]+_0x4993('0x5a'));}break;case'Contact':if(_0x42f956[_0x4993('0x5b')]===_0x4993('0x5c')){if(_0x42f956[_0x4993('0x5d')][_0x4993('0x5e')]('\x20')[_0x4993('0x54')]>0x1){_0x412d9e[_0x1bf82d](_0x4993('0x5f'),qs[_0x4993('0x60')](_0x42f956[_0x4993('0x5d')]),null);}else{var _0x24295a='%'+_0x42f956[_0x4993('0x5d')]+'%';_0x412d9e[_0x1bf82d](_0x4993('0x61'),_0x24295a,_0x24295a,_0x24295a);}}else{_0x3fe20e=_[_0x4993('0x56')](_0x8e5ae,[_0x4993('0x1d'),_0x4993('0x62')]);_0x42f956[_0x4993('0x3f')]='ContactId';_0x256025=as[_0x4993('0x63')](_0x363708,_0x3fe20e['type'],_0x42f956);_0x412d9e[_0x1bf82d](_0x256025[_0x4993('0x64')],_0x256025['value'][_0x4993('0x65')],_0x256025[_0x4993('0x5d')][_0x4993('0x12')]);}break;case _0x4993('0x66'):var _0x3b9006=_0x42f956[_0x4993('0x5d')][_0x4993('0x5e')](',')['map'](function(_0x1f2508){return Number(_0x1f2508);});_0x3b9006[_0x4993('0x24')](function(_0x11efb8){_0x3e5f69['or'](_0x4993('0x67'),'%,'+_0x11efb8+',%');});_0x328a75=_[_0x4993('0x68')](_0x328a75,_0x3b9006);break;case _0x4993('0x69'):if(_0x42f956[_0x4993('0x5b')]===_0x4993('0x5c')){_0x412d9e[_0x1bf82d](_0x4993('0x6a'),'%'+_0x42f956[_0x4993('0x5d')]+'%',null);}else{_0x3fe20e=_['find'](_0x8e5ae,['name',_0x4993('0x6b')]);_0x42f956[_0x4993('0x3f')]='UserId';_0x256025=as[_0x4993('0x63')](_0x363708,_0x3fe20e['type'],_0x42f956);_0x412d9e[_0x1bf82d](_0x256025[_0x4993('0x64')],_0x256025['value'][_0x4993('0x65')],_0x256025['value'][_0x4993('0x12')]);}break;case'plainBody':_0x256025=as[_0x4993('0x63')]('me',null,_0x42f956);_0x412d9e[_0x1bf82d](_0x256025[_0x4993('0x64')],_0x256025[_0x4993('0x5d')]['start'],_0x256025[_0x4993('0x5d')]['end']);break;}}else{var _0x256025=as[_0x4993('0x63')](_0x363708,_0x3fe20e[_0x4993('0x30')],_0x42f956);_0x412d9e[_0x1bf82d](_0x256025[_0x4993('0x64')],_0x256025['value'][_0x4993('0x65')],_0x256025[_0x4993('0x5d')][_0x4993('0x12')]);}}}else{var _0x30a357=_(_0x5ad0a9[_0x4993('0x33')])[_0x4993('0x34')]()[_0x4993('0x20')](function(_0x5bf366){return _[_0x4993('0x6c')](_0x8e5ae,[_0x4993('0x1d'),_0x5bf366])?_0x5bf366:undefined;})['compact']()[_0x4993('0x5d')]();if(!_[_0x4993('0x6d')](_0x30a357)){_0x30a357[_0x4993('0x24')](function(_0x2ad521){if(_0x2ad521===_0x4993('0x6e')){_0x4fae30[_0x4993('0x3c')]('i.MailAccountId\x20IN\x20?',[][_0x4993('0x6f')](_0x5ad0a9[_0x4993('0x33')][_0x2ad521]));}else if(_0x2ad521===_0x4993('0x70')){var _0x2fbdcf=JSON[_0x4993('0x71')](_0x5ad0a9['query'][_0x2ad521])[_0x4993('0x72')];var _0x36395b=JSON[_0x4993('0x71')](_0x5ad0a9[_0x4993('0x33')][_0x2ad521])['$lte'];_0x4fae30['where'](_0x4993('0x73'),_0x2fbdcf,_0x36395b);}else{if(_0x5ad0a9[_0x4993('0x33')][_0x2ad521]==='null'){_0x4fae30[_0x4993('0x3c')]('i.'+_0x2ad521+_0x4993('0x74'));}else{_0x4fae30[_0x4993('0x3c')]('i.'+_0x2ad521+_0x4993('0x75'),_0x5ad0a9[_0x4993('0x33')][_0x2ad521]);}}});}if(_0x5ad0a9[_0x4993('0x33')]['read']){if(_0x5ad0a9[_0x4993('0x33')][_0x4993('0x76')]==0x1){_0x4fae30['having'](_0x4993('0x77'));}else{_0x4fae30[_0x4993('0x58')](_0x4993('0x78'));}}if(_0x5ad0a9['query'][_0x4993('0x79')]){_0x328a75=_[_0x4993('0x7a')](_0x5ad0a9['query'][_0x4993('0x79')])?_0x5ad0a9[_0x4993('0x33')][_0x4993('0x79')]:new Array(_0x5ad0a9[_0x4993('0x33')][_0x4993('0x79')]);_0x328a75[_0x4993('0x24')](function(_0x5164ea){_0x3e5f69['or'](_0x4993('0x67'),'%,'+_0x5164ea+',%');});}if(_0x5ad0a9[_0x4993('0x33')][_0x4993('0x7b')]){var _0x5de66b=_0x5ad0a9['query'][_0x4993('0x7b')][_0x4993('0x7c')]('\x5c','\x5c\x5c')[_0x4993('0x7c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5de66b)){_0x412d9e['or'](_0x4993('0x7d'),_0x5de66b+'%');}else if(qs[_0x4993('0x7e')](_0x5de66b)){_0x412d9e['or']('c.email\x20LIKE\x20?',_0x5de66b+'%');}else{_0x412d9e['or'](_0x4993('0x7f'),qs[_0x4993('0x60')](_0x5de66b))['or'](_0x4993('0x80'),qs[_0x4993('0x60')](_0x5de66b));}}}_0x4fae30[_0x4993('0x3c')](_0x412d9e);_0x4fae30[_0x4993('0x81')]('i.id');var _0x202402={'type':db[_0x4993('0x82')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3702c6=_0x4fae30[_0x4993('0x83')]();_0x3702c6['field'](_0x4993('0x84'));_0x3702c6['field'](_0x4993('0x85'),'unreadMessages');if(_0x287c68[_0x4993('0x3a')]){_0x287c68[_0x4993('0x3a')][_0x4993('0x24')](function(_0x2e24ac){var _0x23ac05=_0x2e24ac[0x0]==='contactName'?_0x2e24ac[0x0]:'i.'+_0x2e24ac[0x0];_0x4fae30[_0x4993('0x3a')](_0x23ac05,_0x2e24ac[0x1]===_0x4993('0x86')?![]:!![]);});}if(!_[_0x4993('0x6d')](_0x328a75)){_0x4fae30['having'](_0x3e5f69);_0x3702c6[_0x4993('0x3c')](_0x4993('0x87'),_0x328a75);}BPromise[_0x4993('0x88')]()[_0x4993('0x1a')](function(){if(!_0x52fa23){if(_0x5ad0a9[_0x4993('0x33')][_0x4993('0x6e')])return;_0x3702c6[_0x4993('0x3c')](_0x4993('0x89'));_0x4fae30[_0x4993('0x3c')](_0x4993('0x89'));return;}if(_0x5ad0a9[_0x4993('0x8a')]['role']!==_0x4993('0x8b'))return;return _0x5ad0a9[_0x4993('0x8a')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x4993('0x1a')](function(_0x5085d4){if(_['isEmpty'](_0x5085d4)){_0x3702c6['where'](_0x4993('0x8c'));_0x4fae30[_0x4993('0x3c')]('i.MailAccountId\x20IS\x20NULL');}else{_0x3702c6[_0x4993('0x3c')](_0x4993('0x8d'),_[_0x4993('0x20')](_0x5085d4,'id'));_0x4fae30['where']('i.MailAccountId\x20IN\x20?',_['map'](_0x5085d4,'id'));}});})['then'](function(){if(_0x5ad0a9[_0x4993('0x8a')]['role']===_0x4993('0x8b')&&!_0x52fa23&&!_0x5ad0a9[_0x4993('0x33')][_0x4993('0x6e')])return[];return db['sequelize'][_0x4993('0x33')](_0x3702c6[_0x4993('0x8e')](),_0x202402);})[_0x4993('0x1a')](function(_0x5ecb2b){_0x203b29['count']=_0x5ecb2b[_0x4993('0x54')];if(_0x203b29[_0x4993('0x16')]===0x0)return[];return db[_0x4993('0x8f')][_0x4993('0x33')](_0x4dd61c[_0x4993('0x8e')](),_0x202402)['then'](function(_0x34087c){_0x372ed7=_['keyBy'](_0x34087c,'id');_0x202402=_[_0x4993('0x90')](_0x202402,{'model':db[_0x4993('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ad0a9[_0x4993('0x33')][_0x4993('0x38')]){_0x287c68['attributes'][_0x4993('0x24')](function(_0x5f3cd6){_0x4fae30['field']('i.'+_0x5f3cd6);});}else{_0x4fae30['field'](_0x4993('0x85'),_0x4993('0x57'));_0x4fae30['field']('a.key',_0x4993('0x91'));_0x4fae30['field'](_0x4993('0x92'),_0x4993('0x93'));_0x4fae30[_0x4993('0x3f')](_0x4993('0x94'),'contactName');_0x4fae30['field'](_0x4993('0x84'));_0x4fae30[_0x4993('0x3f')]('i.createdAt');_0x4fae30['field'](_0x4993('0x95'));_0x4fae30['field'](_0x4993('0x96'));_0x4fae30[_0x4993('0x3f')](_0x4993('0x97'));_0x4fae30[_0x4993('0x3f')]('i.attach');_0x4fae30[_0x4993('0x3f')]('i.lastMsgAt');_0x4fae30[_0x4993('0x3f')](_0x4993('0x98'));_0x4fae30[_0x4993('0x3f')]('i.subject');_0x4fae30[_0x4993('0x3f')](_0x4993('0x99'));_0x4fae30[_0x4993('0x3f')]('i.secondDisposition');_0x4fae30[_0x4993('0x3f')](_0x4993('0x9a'));_0x4fae30['field'](_0x4993('0x9b'));_0x4fae30['field'](_0x4993('0x9c'));_0x4fae30[_0x4993('0x3f')](_0x4993('0x9d'));_0x4fae30[_0x4993('0x3f')]('i.MailAccountId');_0x4fae30['field']('i.UserId');_0x4fae30[_0x4993('0x3f')](_0x4993('0x9e'),_0x4993('0x9f'));_0x4fae30[_0x4993('0x3f')](_0x4993('0xa0'),_0x4993('0xa1'));_0x4fae30[_0x4993('0x3f')](_0x4993('0xa2'),'Contact.email');_0x4fae30[_0x4993('0x3f')]('c.phone',_0x4993('0xa3'));_0x4fae30['field'](_0x4993('0xa4'),_0x4993('0xa5'));_0x4fae30[_0x4993('0x3f')]('c.fax',_0x4993('0xa6'));_0x4fae30['field']('o.fullname',_0x4993('0xa7'));_0x4fae30['field'](_0x4993('0xa8'),_0x4993('0xa9'));_0x4fae30[_0x4993('0x3f')](_0x4993('0xaa'),_0x4993('0x22'));}if(_0x287c68[_0x4993('0x17')])_0x4fae30[_0x4993('0x17')](_0x287c68['limit']);if(_0x287c68[_0x4993('0x14')])_0x4fae30[_0x4993('0x14')](_0x287c68[_0x4993('0x14')]);return db['sequelize']['query'](_0x4fae30[_0x4993('0x8e')](),_0x202402);})[_0x4993('0x1a')](function(_0x35adda){if(_0x35adda[_0x4993('0x54')]>0x0)_0x19638f[_0x4993('0x3c')](_0x4993('0xab'),_[_0x4993('0x20')](_0x35adda,'id'));return db['sequelize'][_0x4993('0x33')](_0x19638f[_0x4993('0x8e')](),_0x202402)[_0x4993('0x1a')](function(_0x3bf7fd){var _0x527a0b=_['groupBy'](_0x3bf7fd,_0x4993('0xac'));var _0x1e04de=[];return db[_0x4993('0xad')][_0x4993('0x27')]({'attributes':[_0x4993('0xae')],'raw':!![]})[_0x4993('0x1a')](function(_0x471a12){var _0x22a720=_0x471a12[_0x4993('0xae')];_0x35adda[_0x4993('0x24')](function(_0x28a883){_0x1e04de[_0x4993('0x25')](updateMailInteraction(_0x28a883,_0x372ed7,_0x527a0b,_0x22a720));});return BPromise[_0x4993('0xaf')](_0x1e04de);});});});})[_0x4993('0x1a')](function(_0xbbaa42){_0x203b29[_0x4993('0xb0')]=_0xbbaa42;return _0x203b29;})['then'](respondWithFilteredResult(_0x57dd0f,_0x287c68))[_0x4993('0x2c')](handleError(_0x57dd0f,null));};exports[_0x4993('0xb1')]=function(_0x526b9e,_0xe59e3a){var _0x884349={'raw':![],'where':{'id':_0x526b9e['params']['id']}},_0x3fec40={};_0x3fec40[_0x4993('0x32')]=_[_0x4993('0x34')](db[_0x4993('0x2e')]['rawAttributes']);_0x3fec40['query']=_[_0x4993('0x34')](_0x526b9e['query']);_0x3fec40[_0x4993('0x35')]=_[_0x4993('0x36')](_0x3fec40[_0x4993('0x32')],_0x3fec40[_0x4993('0x33')]);_0x884349[_0x4993('0x37')]=_['intersection'](_0x3fec40[_0x4993('0x32')],qs[_0x4993('0x38')](_0x526b9e[_0x4993('0x33')][_0x4993('0x38')]));_0x884349['attributes']=_0x884349[_0x4993('0x37')][_0x4993('0x54')]?_0x884349['attributes']:_0x3fec40[_0x4993('0x32')];if(_0x526b9e[_0x4993('0x33')][_0x4993('0xb2')]){_0x884349['include']=[{'all':!![]}];}_0x884349=_[_0x4993('0x90')]({},_0x884349,_0x526b9e['options']);return db[_0x4993('0x2e')][_0x4993('0x56')](_0x884349)[_0x4993('0x1a')](handleEntityNotFound(_0xe59e3a,null))['then'](respondWithResult(_0xe59e3a,null))[_0x4993('0x2c')](handleError(_0xe59e3a,null));};exports['create']=function(_0x223192,_0x452a02){return db[_0x4993('0x2e')][_0x4993('0xb3')](_0x223192['body'],{})['then'](respondWithResult(_0x452a02,0xc9))[_0x4993('0x2c')](handleError(_0x452a02,null));};exports[_0x4993('0x19')]=function(_0x505b14,_0x23c94d){if(_0x505b14[_0x4993('0xb4')]['id']){delete _0x505b14[_0x4993('0xb4')]['id'];}return db['MailInteraction'][_0x4993('0x56')]({'where':{'id':_0x505b14[_0x4993('0xb5')]['id']}})[_0x4993('0x1a')](handleEntityNotFound(_0x23c94d,null))[_0x4993('0x1a')](saveUpdates(_0x505b14[_0x4993('0xb4')],null))[_0x4993('0x1a')](respondWithResult(_0x23c94d,null))[_0x4993('0x2c')](handleError(_0x23c94d,null));};exports[_0x4993('0xb6')]=function(_0x45e215,_0x1f1cbe){return db[_0x4993('0x2e')][_0x4993('0x56')]({'where':{'id':_0x45e215[_0x4993('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1f1cbe,null))[_0x4993('0x1a')](removeEntity(_0x1f1cbe,null))['catch'](handleError(_0x1f1cbe,null));};exports[_0x4993('0xb7')]=function(_0x355d6b,_0x6eb606){return db[_0x4993('0x2e')]['describe']()[_0x4993('0x1a')](respondWithResult(_0x6eb606,null))[_0x4993('0x2c')](handleError(_0x6eb606,null));};exports[_0x4993('0xb8')]=function(_0x1e40ed,_0x216360){return db[_0x4993('0x26')][_0x4993('0x56')]({'where':{'id':_0x1e40ed[_0x4993('0xb5')]['id']}})[_0x4993('0x1a')](handleEntityNotFound(_0x216360,null))['then'](function(_0x11f6f9){if(_0x11f6f9){return _0x11f6f9[_0x4993('0xb8')](_0x1e40ed[_0x4993('0xb4')][_0x4993('0xb9')],_['omit'](_0x1e40ed['body'],[_0x4993('0xb9'),'id'])||{});}})[_0x4993('0x1a')](respondWithResult(_0x216360,null))[_0x4993('0x2c')](handleError(_0x216360,null));};exports['getMessages']=function(_0x415ea3,_0x5b33ea){var _0x440d4e={'raw':![],'where':{}};var _0x53da7e={};var _0x2bab0c={'count':0x0,'rows':[]};return db[_0x4993('0x2e')][_0x4993('0x27')]({'where':{'id':_0x415ea3[_0x4993('0xb5')]['id']}})[_0x4993('0x1a')](handleEntityNotFound(_0x5b33ea,null))[_0x4993('0x1a')](function(_0x368666){if(_0x368666){_0x53da7e['model']=_['keys'](db[_0x4993('0x26')]['rawAttributes']);_0x53da7e[_0x4993('0x33')]=_['keys'](_0x415ea3['query']);_0x53da7e['filters']=_['intersection'](_0x53da7e[_0x4993('0x32')],_0x53da7e[_0x4993('0x33')]);_0x440d4e[_0x4993('0x37')]=_[_0x4993('0x36')](_0x53da7e[_0x4993('0x32')],qs[_0x4993('0x38')](_0x415ea3[_0x4993('0x33')][_0x4993('0x38')]));_0x440d4e[_0x4993('0x37')]=_0x440d4e[_0x4993('0x37')][_0x4993('0x54')]?_0x440d4e['attributes']:_0x53da7e[_0x4993('0x32')];if(!_0x415ea3[_0x4993('0x33')]['hasOwnProperty'](_0x4993('0xba'))){_0x440d4e[_0x4993('0x17')]=qs['limit'](_0x415ea3[_0x4993('0x33')][_0x4993('0x17')]);_0x440d4e['offset']=qs[_0x4993('0x14')](_0x415ea3[_0x4993('0x33')][_0x4993('0x14')]);}_0x440d4e['order']=qs[_0x4993('0x3b')](_0x415ea3[_0x4993('0x33')]['sort']);_0x440d4e['where']=qs[_0x4993('0x35')](_[_0x4993('0x3d')](_0x415ea3[_0x4993('0x33')],_0x53da7e[_0x4993('0x35')]));_0x440d4e['where']['MailInteractionId']=_0x368666['id'];if(_0x415ea3[_0x4993('0x33')][_0x4993('0x7b')]){_0x440d4e[_0x4993('0x3c')]=_[_0x4993('0x90')](_0x440d4e['where'],{'$or':_['map'](_0x440d4e[_0x4993('0x37')],function(_0x2c5d53){var _0x5c5ec5={};_0x5c5ec5[_0x2c5d53]={'$like':'%'+_0x415ea3[_0x4993('0x33')][_0x4993('0x7b')]+'%'};return _0x5c5ec5;})});}if(_0x415ea3[_0x4993('0x33')][_0x4993('0x72')]){var _0x389716=_0x415ea3[_0x4993('0x33')][_0x4993('0x72')]['split'](',');var _0xf31088={};_0xf31088[_0x389716[0x0]]={'$gte':moment(_0x389716[0x1])['format'](_0x4993('0xbb'))};_0x440d4e[_0x4993('0x3c')]=_[_0x4993('0x90')](_0x440d4e['where'],_0xf31088);}_0x440d4e=_[_0x4993('0x90')]({},_0x440d4e,_0x415ea3[_0x4993('0xbc')]);return db[_0x4993('0x26')]['count']({'where':_0x440d4e[_0x4993('0x3c')]})[_0x4993('0x1a')](function(_0x95f204){_0x2bab0c[_0x4993('0x16')]=_0x95f204;if(_0x415ea3['query'][_0x4993('0xb2')]){_0x440d4e[_0x4993('0xbd')]=[{'all':!![]}];}return db[_0x4993('0x26')][_0x4993('0xbe')](_0x440d4e);})[_0x4993('0x1a')](function(_0x4f5e27){if(_0x415ea3[_0x4993('0x33')]['inlineCss']===_0x4993('0xbf')){for(var _0x1d3d13=0x0;_0x1d3d13<_0x4f5e27[_0x4993('0x54')];_0x1d3d13++){_0x4f5e27[_0x1d3d13][_0x4993('0xb4')]=juice(_0x4f5e27[_0x1d3d13]['body']);}}_0x2bab0c['rows']=_0x4f5e27;return _0x2bab0c;});}})['then'](respondWithFilteredResult(_0x5b33ea,_0x440d4e))[_0x4993('0x2c')](handleError(_0x5b33ea,null));};exports['addTags']=function(_0x90ea6,_0x26e9f7){return db[_0x4993('0x2e')][_0x4993('0x56')]({'where':{'id':_0x90ea6['params']['id']}})[_0x4993('0x1a')](handleEntityNotFound(_0x26e9f7,null))[_0x4993('0x1a')](function(_0x53be72){if(_0x53be72){return _0x53be72['setTags'](_0x90ea6['body'][_0x4993('0xb9')],_['omit'](_0x90ea6['body'],[_0x4993('0xb9'),'id'])||{})[_0x4993('0xc0')](function(){return db[_0x4993('0x66')][_0x4993('0xbe')]({'attributes':['id',_0x4993('0x1d'),_0x4993('0xc1')],'where':{'id':_0x90ea6['body']['ids']}});})[_0x4993('0x1a')](function(_0x341b5e){socket['emit'](_0x4993('0xc2'),{'id':Number(_0x90ea6['params']['id']),'tags':_0x341b5e||[]});return{'id':Number(_0x90ea6[_0x4993('0xb5')]['id']),'tags':_0x341b5e||[]};});}})[_0x4993('0x1a')](respondWithResult(_0x26e9f7,null))[_0x4993('0x2c')](handleError(_0x26e9f7,null));};exports[_0x4993('0xc3')]=function(_0xcb8bd,_0x1b525a){return db['MailInteraction']['find']({'where':{'id':_0xcb8bd[_0x4993('0xb5')]['id']}})[_0x4993('0x1a')](handleEntityNotFound(_0x1b525a,null))['then'](function(_0x3849fe){if(_0x3849fe){return _0x3849fe[_0x4993('0xc3')](_0xcb8bd[_0x4993('0x33')][_0x4993('0xb9')]);}})[_0x4993('0x1a')](respondWithStatusCode(_0x1b525a,null))[_0x4993('0x2c')](handleError(_0x1b525a,null));};exports['download']=function(_0x16fca0,_0x31203d){var _0x18e5fa=moment()[_0x4993('0xc4')]()['toString']();var _0x16eac1=path['join'](config[_0x4993('0xc5')],_0x4993('0xc6'),_0x4993('0xc7'),_0x4993('0xc8'));var _0x4f98fe=path[_0x4993('0xc9')](config[_0x4993('0xc5')],_0x4993('0xc6'),_0x4993('0xc7'),_0x4993('0xca'));var _0x1e6b3b=path[_0x4993('0xc9')](_0x16eac1,_0x18e5fa);var _0x2a0f93=util[_0x4993('0xcb')]('transcript-%d-%s.zip',_0x16fca0[_0x4993('0xb5')]['id'],_0x18e5fa);var _0x59a043=path['join'](_0x16eac1,_0x2a0f93);var _0x2c6bd4=[];if(_0x16fca0['query'][_0x4993('0xca')]){_0x2c6bd4[_0x4993('0x25')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x3cfeb6=[{'model':db[_0x4993('0x26')],'as':_0x4993('0xcc'),'attributes':['id',_0x4993('0xb4'),_0x4993('0x40'),'to','cc',_0x4993('0xcd'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x4993('0x3b')]('id'),'include':_0x2c6bd4}];return db[_0x4993('0x2e')][_0x4993('0x56')]({'where':{'id':_0x16fca0[_0x4993('0xb5')]['id']},'include':_0x3cfeb6})[_0x4993('0x1a')](handleEntityNotFound(_0x31203d,null))['then'](function(_0x53af43){if(_0x53af43&&_0x53af43[_0x4993('0xcc')]){var _0x26e5ff=_0x53af43[_0x4993('0xce')]({'plain':!![]});fs['mkdirSync'](_0x1e6b3b);return BPromise[_0x4993('0xcf')](_0x26e5ff['Messages'],function(_0x363ea3,_0x1c68b7){var _0x8e6c6f={'from':_0x363ea3[_0x4993('0x40')],'to':_0x363ea3['to'],'subject':_0x363ea3[_0x4993('0xd0')],'html':htmlEntities[_0x4993('0xd1')](_0x363ea3['body']),'headers':{'Date':moment(_0x363ea3[_0x4993('0x70')])[_0x4993('0xcb')](_0x4993('0xd2'))},'attachments':[]};if(_0x363ea3['cc']){_0x8e6c6f[_0x4993('0xd3')]['Cc']=_0x363ea3['cc'];}if(_0x363ea3[_0x4993('0xcd')]){_0x8e6c6f['headers'][_0x4993('0xd4')]=_0x363ea3[_0x4993('0xcd')];}return new BPromise(function(_0x4ada4d,_0x51cdee){if(_0x363ea3[_0x4993('0xd5')]){for(var _0x3065fc=0x0;_0x3065fc<_0x363ea3[_0x4993('0xd5')][_0x4993('0x54')];_0x3065fc++){var _0x577815=_0x363ea3[_0x4993('0xd5')][_0x3065fc];var _0x1d63c8=path['join'](_0x4f98fe,_0x577815[_0x4993('0xd6')]);if(fs[_0x4993('0xd7')](_0x1d63c8)){_0x8e6c6f[_0x4993('0xca')][_0x4993('0x25')]({'name':_0x577815[_0x4993('0x1d')],'contentType':_0x577815[_0x4993('0x30')],'data':fs[_0x4993('0xd8')](_0x1d63c8)});}}}emlformat[_0x4993('0xd9')](_0x8e6c6f,function(_0x96e1f2,_0x4dcb20){if(_0x96e1f2)return _0x51cdee(_0x96e1f2);fs[_0x4993('0xda')](path[_0x4993('0xc9')](_0x1e6b3b,util[_0x4993('0xcb')](_0x4993('0xdb'),_0x1c68b7)),_0x4dcb20);return _0x4ada4d(_0x4dcb20);});});})[_0x4993('0x1a')](function(){return new BPromise(function(_0x436c57,_0x37ce71){zipdir(_0x1e6b3b,{'saveTo':_0x59a043},function(_0x3f859a,_0x402a71){if(_0x3f859a)return _0x37ce71(_0x3f859a);return _0x436c57(_0x402a71);});})[_0x4993('0x1a')](function(){return new BPromise(function(_0x34acdc,_0x2ad236){rimraf(_0x1e6b3b,function(_0x53fa43){if(_0x53fa43)_0x2ad236(_0x53fa43);return _0x34acdc();});});})['then'](function(){return _0x31203d[_0x4993('0xdc')](_0x59a043,_0x2a0f93,function(_0x534176){if(!_0x534176)fs[_0x4993('0xdd')](_0x59a043);});});});}else{return _0x31203d[_0x4993('0x1b')](0xc8);}})['catch'](handleError(_0x31203d,null));}; \ No newline at end of file +var _0xdc58=['moment','bluebird','path','squel','juice','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','end','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','push','findOne','out','-id','lastMsgText','trimStart','plainBody','catch','MailInteraction','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','keys','some','compact','isEmpty','MailAccountId','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','user','sequelize','toString','keyBy','a.key','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','show','params','include','merge','options','create','body','addMessage','ids','MailInteractionId','$gte','format','MailMessage','includeAll','findAll','inlineCss','true','rows','omit','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','rimraf','zip-dir'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdc58,0xe4));var _0x8dc5=function(_0x576bfd,_0x18d76f){_0x576bfd=_0x576bfd-0x0;var _0x50c2d6=_0xdc58[_0x576bfd];return _0x50c2d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dc5('0x0'));var zipdir=require(_0x8dc5('0x1'));var moment=require(_0x8dc5('0x2'));var BPromise=require(_0x8dc5('0x3'));var util=require('util');var path=require(_0x8dc5('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8dc5('0x5'));var juice=require(_0x8dc5('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')('api');var config=require(_0x8dc5('0x7'));var db=require(_0x8dc5('0x8'))['db'];var htmlEntities=require(_0x8dc5('0x9'));config[_0x8dc5('0xa')]=_[_0x8dc5('0xb')](config[_0x8dc5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dc5('0xc'))(new Redis(config[_0x8dc5('0xa')]));require(_0x8dc5('0xd'))[_0x8dc5('0xe')](socket);function respondWithStatusCode(_0x8f8ee4,_0x20e78b){_0x20e78b=_0x20e78b||0xcc;return function(_0x5943d6){if(_0x5943d6){return _0x8f8ee4['sendStatus'](_0x20e78b);}return _0x8f8ee4['status'](_0x20e78b)[_0x8dc5('0xf')]();};}function respondWithResult(_0x42ad68,_0x47db80){_0x47db80=_0x47db80||0xc8;return function(_0x11d6bb){if(_0x11d6bb){return _0x42ad68[_0x8dc5('0x10')](_0x47db80)['json'](_0x11d6bb);}};}function respondWithFilteredResult(_0x1cdb1a,_0x1b0d1d){return function(_0x19e716){if(_0x19e716){var _0x4de3f5=typeof _0x1b0d1d[_0x8dc5('0x11')]===_0x8dc5('0x12')&&typeof _0x1b0d1d['limit']==='undefined';var _0x2b4734=_0x19e716[_0x8dc5('0x13')];var _0x168074=_0x4de3f5?0x0:_0x1b0d1d[_0x8dc5('0x11')];var _0x5112bb=_0x4de3f5?_0x19e716['count']:_0x1b0d1d[_0x8dc5('0x11')]+_0x1b0d1d[_0x8dc5('0x14')];var _0x240c99;if(_0x5112bb>=_0x2b4734){_0x5112bb=_0x2b4734;_0x240c99=0xc8;}else{_0x240c99=0xce;}_0x1cdb1a[_0x8dc5('0x10')](_0x240c99);return _0x1cdb1a[_0x8dc5('0x15')](_0x8dc5('0x16'),_0x168074+'-'+_0x5112bb+'/'+_0x2b4734)[_0x8dc5('0x17')](_0x19e716);}return null;};}function saveUpdates(_0x3e5e4c){return function(_0x1a3d67){if(_0x1a3d67){return _0x1a3d67[_0x8dc5('0x18')](_0x3e5e4c)[_0x8dc5('0x19')](function(_0x19310a){return _0x19310a;});}return null;};}function removeEntity(_0x5d287c){return function(_0x140239){if(_0x140239){return _0x140239[_0x8dc5('0x1a')]()['then'](function(){_0x5d287c[_0x8dc5('0x10')](0xcc)[_0x8dc5('0xf')]();});}};}function handleEntityNotFound(_0x9f953a){return function(_0x2a9c3f){if(!_0x2a9c3f){_0x9f953a[_0x8dc5('0x1b')](0x194);}return _0x2a9c3f;};}function handleError(_0x38d290,_0x2b7142){_0x2b7142=_0x2b7142||0x1f4;return function(_0x3b8b35){logger[_0x8dc5('0x1c')](_0x3b8b35[_0x8dc5('0x1d')]);if(_0x3b8b35[_0x8dc5('0x1e')]){delete _0x3b8b35[_0x8dc5('0x1e')];}_0x38d290[_0x8dc5('0x10')](_0x2b7142)['send'](_0x3b8b35);};}function getInteractionUsers(_0x579f7e,_0x1c329e){return new BPromise(function(_0x116400,_0x3c43ae){try{if(_0x1c329e[_0x579f7e['id']]){_0x579f7e[_0x8dc5('0x1f')]=_[_0x8dc5('0x20')](_0x1c329e[_0x579f7e['id']],function(_0x37fbec){return{'id':_0x37fbec['id'],'fullname':_0x37fbec[_0x8dc5('0x21')]};});}}catch(_0x44e1d7){_0x3c43ae(_0x44e1d7);}_0x116400(_0x579f7e);});}function getInteractionTags(_0x438096,_0x17192c){return new BPromise(function(_0x29bdf2,_0x33762c){try{if(_0x438096[_0x8dc5('0x22')]){_0x438096['Tags']=[];_0x438096['TagIds']['split'](',')['forEach'](function(_0x3dd45d){_0x438096['Tags'][_0x8dc5('0x23')](_0x17192c[_0x3dd45d]);});}delete _0x438096[_0x8dc5('0x22')];}catch(_0x2b68a2){_0x33762c(_0x2b68a2);}_0x29bdf2(_0x438096);});}function getLastMessageText(_0x1cd390){return new BPromise(function(_0x291af4,_0x476786){return db['MailMessage'][_0x8dc5('0x24')]({'where':{'$and':[{'MailInteractionId':_0x1cd390['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8dc5('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x8dc5('0x26'),'raw':!![]})[_0x8dc5('0x19')](function(_0x3de550){if(_0x3de550&&_0x3de550['plainBody']){_0x1cd390[_0x8dc5('0x27')]=_[_0x8dc5('0x28')](_0x3de550[_0x8dc5('0x29')]);}_0x291af4(_0x1cd390);})[_0x8dc5('0x2a')](function(_0x286b88){_0x476786(_0x286b88);});});}function updateMailInteraction(_0x542f19,_0x34d76f,_0xb9d074,_0x4d5863){return new BPromise(function(_0x3e07b6,_0x2b443d){return getInteractionUsers(_0x542f19,_0xb9d074)[_0x8dc5('0x19')](function(_0x48e50d){return getInteractionTags(_0x48e50d,_0x34d76f);})[_0x8dc5('0x19')](function(_0x4d8ff4){if(_0x4d5863){_0x3e07b6(getLastMessageText(_0x4d8ff4));}else{_0x3e07b6(_0x4d8ff4);}})[_0x8dc5('0x2a')](function(_0x3a1a15){_0x2b443d(_0x3a1a15);});});}exports['index']=function(_0x2fa6e0,_0x373bf5){var _0x32110d={},_0x715f11={},_0x57ee95={'count':0x0,'rows':[]};var _0x55145f=_[_0x8dc5('0x20')](db[_0x8dc5('0x2b')][_0x8dc5('0x2c')],function(_0x5991c6){return{'name':_0x5991c6[_0x8dc5('0x2d')],'type':_0x5991c6['type']['key']};});_0x715f11['model']=_[_0x8dc5('0x20')](_0x55145f,_0x8dc5('0x1e'));_0x715f11[_0x8dc5('0x2e')]=_['keys'](_0x2fa6e0['query']);_0x715f11[_0x8dc5('0x2f')]=_[_0x8dc5('0x30')](_0x715f11[_0x8dc5('0x31')],_0x715f11['query']);_0x32110d[_0x8dc5('0x32')]=_[_0x8dc5('0x30')](_0x715f11['model'],qs[_0x8dc5('0x33')](_0x2fa6e0[_0x8dc5('0x2e')]['fields']));_0x32110d[_0x8dc5('0x32')]=_0x32110d['attributes'][_0x8dc5('0x34')]?_0x32110d[_0x8dc5('0x32')]:_0x715f11['model'];if(!_0x2fa6e0['query'][_0x8dc5('0x35')](_0x8dc5('0x36'))){_0x32110d[_0x8dc5('0x14')]=qs[_0x8dc5('0x14')](_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x14')]);_0x32110d[_0x8dc5('0x11')]=qs[_0x8dc5('0x11')](_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x11')]);}_0x32110d['order']=qs[_0x8dc5('0x37')](_0x2fa6e0['query'][_0x8dc5('0x37')]);_0x32110d[_0x8dc5('0x38')]=qs['filters'](_[_0x8dc5('0x39')](_0x2fa6e0[_0x8dc5('0x2e')],_0x715f11['filters']),_0x55145f);var _0x35c4ea=[];var _0x1e8803=squel[_0x8dc5('0x3a')]()['field']('id')[_0x8dc5('0x3b')](_0x8dc5('0x1e'))[_0x8dc5('0x3b')](_0x8dc5('0x3c'))[_0x8dc5('0x3d')](_0x8dc5('0x3e'));var _0x136a6a=squel[_0x8dc5('0x3a')]()[_0x8dc5('0x3b')](_0x8dc5('0x3f'))[_0x8dc5('0x3b')](_0x8dc5('0x40'))['field'](_0x8dc5('0x41'))['from'](_0x8dc5('0x42'),'ui')[_0x8dc5('0x43')](_0x8dc5('0x44'),'u','u.id\x20=\x20ui.UserId');var _0x21e480=squel[_0x8dc5('0x3a')]()['from'](_0x8dc5('0x45'),'i')[_0x8dc5('0x43')](_0x8dc5('0x46'),'c',_0x8dc5('0x47'))[_0x8dc5('0x43')](_0x8dc5('0x44'),'o',_0x8dc5('0x48'))[_0x8dc5('0x43')](_0x8dc5('0x49'),'a',_0x8dc5('0x4a'))['left_join'](_0x8dc5('0x4b'),'me',_0x8dc5('0x4c'))[_0x8dc5('0x43')](_0x8dc5('0x4d'),'it','it.MailInteractionId\x20=\x20i.id')[_0x8dc5('0x43')]('tools_tags','t',_0x8dc5('0x4e'));var _0x2a2111=squel[_0x8dc5('0x4f')]();var _0x51697b=[];var _0x30bc8a=squel['expr']();var _0x2ac8da;if(_0x2fa6e0['query'][_0x8dc5('0x50')]){_0x2ac8da=as[_0x8dc5('0x51')](_0x2fa6e0['query'][_0x8dc5('0x50')]);var _0x34a973=_0x2ac8da[_0x8dc5('0x52')];for(var _0x4f2db6=0x0;_0x4f2db6<_0x2ac8da[_0x8dc5('0x53')][_0x8dc5('0x34')];_0x4f2db6++){var _0x2d5897=_0x2ac8da[_0x8dc5('0x53')][_0x4f2db6];var _0x39484d='i';var _0x21a560=_[_0x8dc5('0x54')](_0x55145f,[_0x8dc5('0x1e'),_0x2d5897[_0x8dc5('0x3b')]]);if(!_0x21a560){switch(_0x2d5897[_0x8dc5('0x3b')]){case _0x8dc5('0x55'):if(_0x2d5897[_0x8dc5('0x56')]==0x1){_0x21e480['having']('`'+_0x2d5897[_0x8dc5('0x3b')]+_0x8dc5('0x57'));}else{_0x21e480[_0x8dc5('0x58')]('`'+_0x2d5897[_0x8dc5('0x3b')]+_0x8dc5('0x59'));}break;case'Contact':if(_0x2d5897[_0x8dc5('0x5a')]==='$substring'){if(_0x2d5897['value'][_0x8dc5('0x5b')]('\x20')[_0x8dc5('0x34')]>0x1){_0x2a2111[_0x34a973](_0x8dc5('0x5c'),qs[_0x8dc5('0x5d')](_0x2d5897[_0x8dc5('0x56')]),null);}else{var _0x106b32='%'+_0x2d5897[_0x8dc5('0x56')]+'%';_0x2a2111[_0x34a973]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x106b32,_0x106b32,_0x106b32);}}else{_0x21a560=_['find'](_0x55145f,[_0x8dc5('0x1e'),'ContactId']);_0x2d5897[_0x8dc5('0x3b')]=_0x8dc5('0x5e');_0x3b74e7=as[_0x8dc5('0x5f')](_0x39484d,_0x21a560[_0x8dc5('0x60')],_0x2d5897);_0x2a2111[_0x34a973](_0x3b74e7[_0x8dc5('0x61')],_0x3b74e7['value'][_0x8dc5('0x62')],_0x3b74e7['value'][_0x8dc5('0xf')]);}break;case _0x8dc5('0x63'):var _0x57c573=_0x2d5897[_0x8dc5('0x56')][_0x8dc5('0x5b')](',')['map'](function(_0x83ba2a){return Number(_0x83ba2a);});_0x57c573[_0x8dc5('0x64')](function(_0x54347b){_0x30bc8a['or'](_0x8dc5('0x65'),'%,'+_0x54347b+',%');});_0x51697b=_[_0x8dc5('0x66')](_0x51697b,_0x57c573);break;case _0x8dc5('0x67'):if(_0x2d5897[_0x8dc5('0x5a')]===_0x8dc5('0x68')){_0x2a2111[_0x34a973]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2d5897[_0x8dc5('0x56')]+'%',null);}else{_0x21a560=_[_0x8dc5('0x54')](_0x55145f,[_0x8dc5('0x1e'),_0x8dc5('0x69')]);_0x2d5897['field']=_0x8dc5('0x69');_0x3b74e7=as[_0x8dc5('0x5f')](_0x39484d,_0x21a560['type'],_0x2d5897);_0x2a2111[_0x34a973](_0x3b74e7[_0x8dc5('0x61')],_0x3b74e7[_0x8dc5('0x56')][_0x8dc5('0x62')],_0x3b74e7[_0x8dc5('0x56')]['end']);}break;case _0x8dc5('0x29'):_0x3b74e7=as[_0x8dc5('0x5f')]('me',null,_0x2d5897);_0x2a2111[_0x34a973](_0x3b74e7[_0x8dc5('0x61')],_0x3b74e7[_0x8dc5('0x56')][_0x8dc5('0x62')],_0x3b74e7['value']['end']);break;}}else{var _0x3b74e7=as[_0x8dc5('0x5f')](_0x39484d,_0x21a560[_0x8dc5('0x60')],_0x2d5897);_0x2a2111[_0x34a973](_0x3b74e7[_0x8dc5('0x61')],_0x3b74e7['value']['start'],_0x3b74e7[_0x8dc5('0x56')]['end']);}}}else{var _0x1b3cb5=_(_0x2fa6e0[_0x8dc5('0x2e')])[_0x8dc5('0x6a')]()[_0x8dc5('0x20')](function(_0x1506cf){return _[_0x8dc5('0x6b')](_0x55145f,[_0x8dc5('0x1e'),_0x1506cf])?_0x1506cf:undefined;})[_0x8dc5('0x6c')]()['value']();if(!_[_0x8dc5('0x6d')](_0x1b3cb5)){_0x1b3cb5['forEach'](function(_0x447b10){if(_0x447b10===_0x8dc5('0x6e')){_0x21e480[_0x8dc5('0x38')]('i.MailAccountId\x20IN\x20?',[][_0x8dc5('0x6f')](_0x2fa6e0['query'][_0x447b10]));}else if(_0x447b10===_0x8dc5('0x70')){var _0x4d4b31=JSON[_0x8dc5('0x71')](_0x2fa6e0[_0x8dc5('0x2e')][_0x447b10])['$gte'];var _0x44e0a9=JSON['parse'](_0x2fa6e0[_0x8dc5('0x2e')][_0x447b10])[_0x8dc5('0x72')];_0x21e480[_0x8dc5('0x38')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4d4b31,_0x44e0a9);}else{if(_0x2fa6e0[_0x8dc5('0x2e')][_0x447b10]===_0x8dc5('0x73')){_0x21e480[_0x8dc5('0x38')]('i.'+_0x447b10+_0x8dc5('0x74'));}else{_0x21e480[_0x8dc5('0x38')]('i.'+_0x447b10+_0x8dc5('0x75'),_0x2fa6e0['query'][_0x447b10]);}}});}if(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x76')]){if(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x76')]==0x1){_0x21e480['having'](_0x8dc5('0x77'));}else{_0x21e480[_0x8dc5('0x58')]('`unreadMessages`\x20>\x200');}}if(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x78')]){_0x51697b=_[_0x8dc5('0x79')](_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x78')])?_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x78')]:new Array(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x78')]);_0x51697b[_0x8dc5('0x64')](function(_0x3c0e22){_0x30bc8a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c0e22+',%');});}if(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x7a')]){var _0x89d512=_0x2fa6e0['query']['filter'][_0x8dc5('0x7b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8dc5('0x7c')](_0x89d512)){_0x2a2111['or'](_0x8dc5('0x7d'),_0x89d512+'%');}else if(qs[_0x8dc5('0x7e')](_0x89d512)){_0x2a2111['or'](_0x8dc5('0x7f'),_0x89d512+'%');}else{_0x2a2111['or'](_0x8dc5('0x80'),qs[_0x8dc5('0x5d')](_0x89d512))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x89d512));}}}_0x21e480[_0x8dc5('0x38')](_0x2a2111);_0x21e480[_0x8dc5('0x81')]('i.id');var _0x315000={'type':db[_0x8dc5('0x82')][_0x8dc5('0x83')]['SELECT'],'raw':!![]};var _0x4c0f8f=_0x21e480[_0x8dc5('0x84')]();_0x4c0f8f[_0x8dc5('0x3b')](_0x8dc5('0x85'));_0x4c0f8f[_0x8dc5('0x3b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8dc5('0x55'));if(_0x32110d[_0x8dc5('0x86')]){_0x32110d[_0x8dc5('0x86')][_0x8dc5('0x64')](function(_0x26fcea){var _0x28be1e=_0x26fcea[0x0]===_0x8dc5('0x87')?_0x26fcea[0x0]:'i.'+_0x26fcea[0x0];_0x21e480[_0x8dc5('0x86')](_0x28be1e,_0x26fcea[0x1]===_0x8dc5('0x88')?![]:!![]);});}if(!_[_0x8dc5('0x6d')](_0x51697b)){_0x21e480[_0x8dc5('0x58')](_0x30bc8a);_0x4c0f8f['where'](_0x8dc5('0x89'),_0x51697b);}BPromise[_0x8dc5('0x8a')]()['then'](function(){if(!_0x2ac8da){if(_0x2fa6e0[_0x8dc5('0x2e')][_0x8dc5('0x6e')])return;_0x4c0f8f[_0x8dc5('0x38')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x21e480['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2fa6e0['user'][_0x8dc5('0x8b')]!==_0x8dc5('0x8c'))return;return _0x2fa6e0['user'][_0x8dc5('0x8d')]({'attributes':['id'],'raw':!![]})[_0x8dc5('0x19')](function(_0x359a4d){if(_[_0x8dc5('0x6d')](_0x359a4d)){_0x4c0f8f['where'](_0x8dc5('0x8e'));_0x21e480[_0x8dc5('0x38')](_0x8dc5('0x8e'));}else{_0x4c0f8f['where'](_0x8dc5('0x8f'),_[_0x8dc5('0x20')](_0x359a4d,'id'));_0x21e480['where'](_0x8dc5('0x8f'),_[_0x8dc5('0x20')](_0x359a4d,'id'));}});})[_0x8dc5('0x19')](function(){if(_0x2fa6e0[_0x8dc5('0x90')][_0x8dc5('0x8b')]===_0x8dc5('0x8c')&&!_0x2ac8da&&!_0x2fa6e0['query']['MailAccountId'])return[];return db[_0x8dc5('0x91')][_0x8dc5('0x2e')](_0x4c0f8f[_0x8dc5('0x92')](),_0x315000);})[_0x8dc5('0x19')](function(_0x185e26){_0x57ee95['count']=_0x185e26['length'];if(_0x57ee95[_0x8dc5('0x13')]===0x0)return[];return db['sequelize'][_0x8dc5('0x2e')](_0x1e8803[_0x8dc5('0x92')](),_0x315000)[_0x8dc5('0x19')](function(_0x33d424){_0x35c4ea=_[_0x8dc5('0x93')](_0x33d424,'id');_0x315000=_['merge'](_0x315000,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fa6e0['query'][_0x8dc5('0x33')]){_0x32110d[_0x8dc5('0x32')]['forEach'](function(_0x410669){_0x21e480['field']('i.'+_0x410669);});}else{_0x21e480[_0x8dc5('0x3b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8dc5('0x55'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x94'),'Account.key');_0x21e480[_0x8dc5('0x3b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x95'),_0x8dc5('0x87'));_0x21e480['field']('i.id');_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x96'));_0x21e480['field'](_0x8dc5('0x97'));_0x21e480['field']('i.closed');_0x21e480['field'](_0x8dc5('0x98'));_0x21e480['field'](_0x8dc5('0x99'));_0x21e480['field']('i.lastMsgAt');_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x9a'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x9b'));_0x21e480['field'](_0x8dc5('0x9c'));_0x21e480[_0x8dc5('0x3b')]('i.secondDisposition');_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x9d'));_0x21e480[_0x8dc5('0x3b')]('i.substatus');_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x9e'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0x9f'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa0'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa1'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa2'),_0x8dc5('0xa3'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa4'),_0x8dc5('0xa5'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa6'),_0x8dc5('0xa7'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xa8'),_0x8dc5('0xa9'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xaa'),_0x8dc5('0xab'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xac'),_0x8dc5('0xad'));_0x21e480[_0x8dc5('0x3b')]('o.fullname',_0x8dc5('0xae'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xaf'),_0x8dc5('0xb0'));_0x21e480[_0x8dc5('0x3b')](_0x8dc5('0xb1'),_0x8dc5('0x22'));}if(_0x32110d[_0x8dc5('0x14')])_0x21e480[_0x8dc5('0x14')](_0x32110d[_0x8dc5('0x14')]);if(_0x32110d[_0x8dc5('0x11')])_0x21e480[_0x8dc5('0x11')](_0x32110d[_0x8dc5('0x11')]);return db[_0x8dc5('0x91')][_0x8dc5('0x2e')](_0x21e480[_0x8dc5('0x92')](),_0x315000);})[_0x8dc5('0x19')](function(_0x2a063c){if(_0x2a063c[_0x8dc5('0x34')]>0x0)_0x136a6a['where'](_0x8dc5('0xb2'),_['map'](_0x2a063c,'id'));return db[_0x8dc5('0x91')][_0x8dc5('0x2e')](_0x136a6a[_0x8dc5('0x92')](),_0x315000)[_0x8dc5('0x19')](function(_0x3f41c3){var _0x31ad6a=_[_0x8dc5('0xb3')](_0x3f41c3,'MailInteractionId');var _0x32d1ce=[];return db[_0x8dc5('0xb4')][_0x8dc5('0x24')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x8dc5('0x19')](function(_0x3a93a0){var _0x1cdbc5=_0x3a93a0[_0x8dc5('0xb5')];_0x2a063c[_0x8dc5('0x64')](function(_0x1ff53d){_0x32d1ce['push'](updateMailInteraction(_0x1ff53d,_0x35c4ea,_0x31ad6a,_0x1cdbc5));});return BPromise[_0x8dc5('0xb6')](_0x32d1ce);});});});})['then'](function(_0x22625d){_0x57ee95['rows']=_0x22625d;return _0x57ee95;})[_0x8dc5('0x19')](respondWithFilteredResult(_0x373bf5,_0x32110d))[_0x8dc5('0x2a')](handleError(_0x373bf5,null));};exports[_0x8dc5('0xb7')]=function(_0x5e746e,_0xeee690){var _0xe908b1={'raw':![],'where':{'id':_0x5e746e[_0x8dc5('0xb8')]['id']}},_0x151180={};_0x151180[_0x8dc5('0x31')]=_[_0x8dc5('0x6a')](db['MailInteraction'][_0x8dc5('0x2c')]);_0x151180[_0x8dc5('0x2e')]=_[_0x8dc5('0x6a')](_0x5e746e['query']);_0x151180[_0x8dc5('0x2f')]=_[_0x8dc5('0x30')](_0x151180['model'],_0x151180[_0x8dc5('0x2e')]);_0xe908b1[_0x8dc5('0x32')]=_[_0x8dc5('0x30')](_0x151180[_0x8dc5('0x31')],qs[_0x8dc5('0x33')](_0x5e746e[_0x8dc5('0x2e')][_0x8dc5('0x33')]));_0xe908b1[_0x8dc5('0x32')]=_0xe908b1['attributes'][_0x8dc5('0x34')]?_0xe908b1['attributes']:_0x151180[_0x8dc5('0x31')];if(_0x5e746e['query']['includeAll']){_0xe908b1[_0x8dc5('0xb9')]=[{'all':!![]}];}_0xe908b1=_[_0x8dc5('0xba')]({},_0xe908b1,_0x5e746e[_0x8dc5('0xbb')]);return db['MailInteraction'][_0x8dc5('0x54')](_0xe908b1)[_0x8dc5('0x19')](handleEntityNotFound(_0xeee690,null))[_0x8dc5('0x19')](respondWithResult(_0xeee690,null))[_0x8dc5('0x2a')](handleError(_0xeee690,null));};exports[_0x8dc5('0xbc')]=function(_0x33dedb,_0x261c4f){return db[_0x8dc5('0x2b')][_0x8dc5('0xbc')](_0x33dedb[_0x8dc5('0xbd')],{})[_0x8dc5('0x19')](respondWithResult(_0x261c4f,0xc9))[_0x8dc5('0x2a')](handleError(_0x261c4f,null));};exports[_0x8dc5('0x18')]=function(_0x3a95c4,_0x3ecc98){if(_0x3a95c4[_0x8dc5('0xbd')]['id']){delete _0x3a95c4[_0x8dc5('0xbd')]['id'];}return db[_0x8dc5('0x2b')][_0x8dc5('0x54')]({'where':{'id':_0x3a95c4[_0x8dc5('0xb8')]['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0x3ecc98,null))[_0x8dc5('0x19')](saveUpdates(_0x3a95c4['body'],null))['then'](respondWithResult(_0x3ecc98,null))['catch'](handleError(_0x3ecc98,null));};exports[_0x8dc5('0x1a')]=function(_0xdf194a,_0x58a186){return db[_0x8dc5('0x2b')]['find']({'where':{'id':_0xdf194a[_0x8dc5('0xb8')]['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0x58a186,null))['then'](removeEntity(_0x58a186,null))[_0x8dc5('0x2a')](handleError(_0x58a186,null));};exports['describe']=function(_0x11d395,_0x2c5f3d){return db[_0x8dc5('0x2b')]['describe']()[_0x8dc5('0x19')](respondWithResult(_0x2c5f3d,null))['catch'](handleError(_0x2c5f3d,null));};exports[_0x8dc5('0xbe')]=function(_0x148c20,_0xf6b482){return db['MailMessage'][_0x8dc5('0x54')]({'where':{'id':_0x148c20['params']['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0xf6b482,null))[_0x8dc5('0x19')](function(_0x5cbd2d){if(_0x5cbd2d){return _0x5cbd2d['addMessage'](_0x148c20['body']['ids'],_['omit'](_0x148c20[_0x8dc5('0xbd')],[_0x8dc5('0xbf'),'id'])||{});}})[_0x8dc5('0x19')](respondWithResult(_0xf6b482,null))[_0x8dc5('0x2a')](handleError(_0xf6b482,null));};exports['getMessages']=function(_0x4169e2,_0x4a970f){var _0xd4fd3a={'raw':![],'where':{}};var _0x56f423={};var _0x42a5c1={'count':0x0,'rows':[]};return db[_0x8dc5('0x2b')][_0x8dc5('0x24')]({'where':{'id':_0x4169e2[_0x8dc5('0xb8')]['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0x4a970f,null))[_0x8dc5('0x19')](function(_0x4eddc1){if(_0x4eddc1){_0x56f423[_0x8dc5('0x31')]=_[_0x8dc5('0x6a')](db['MailMessage'][_0x8dc5('0x2c')]);_0x56f423[_0x8dc5('0x2e')]=_['keys'](_0x4169e2['query']);_0x56f423[_0x8dc5('0x2f')]=_[_0x8dc5('0x30')](_0x56f423[_0x8dc5('0x31')],_0x56f423[_0x8dc5('0x2e')]);_0xd4fd3a[_0x8dc5('0x32')]=_[_0x8dc5('0x30')](_0x56f423[_0x8dc5('0x31')],qs['fields'](_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0x33')]));_0xd4fd3a[_0x8dc5('0x32')]=_0xd4fd3a[_0x8dc5('0x32')][_0x8dc5('0x34')]?_0xd4fd3a[_0x8dc5('0x32')]:_0x56f423[_0x8dc5('0x31')];if(!_0x4169e2['query'][_0x8dc5('0x35')](_0x8dc5('0x36'))){_0xd4fd3a[_0x8dc5('0x14')]=qs[_0x8dc5('0x14')](_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0x14')]);_0xd4fd3a[_0x8dc5('0x11')]=qs[_0x8dc5('0x11')](_0x4169e2['query']['offset']);}_0xd4fd3a[_0x8dc5('0x86')]=qs[_0x8dc5('0x37')](_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0x37')]);_0xd4fd3a[_0x8dc5('0x38')]=qs[_0x8dc5('0x2f')](_[_0x8dc5('0x39')](_0x4169e2[_0x8dc5('0x2e')],_0x56f423['filters']));_0xd4fd3a[_0x8dc5('0x38')][_0x8dc5('0xc0')]=_0x4eddc1['id'];if(_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0x7a')]){_0xd4fd3a[_0x8dc5('0x38')]=_['merge'](_0xd4fd3a[_0x8dc5('0x38')],{'$or':_[_0x8dc5('0x20')](_0xd4fd3a[_0x8dc5('0x32')],function(_0x3adbe0){var _0x35076d={};_0x35076d[_0x3adbe0]={'$like':'%'+_0x4169e2['query']['filter']+'%'};return _0x35076d;})});}if(_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0xc1')]){var _0x368435=_0x4169e2['query']['$gte'][_0x8dc5('0x5b')](',');var _0x36a19a={};_0x36a19a[_0x368435[0x0]]={'$gte':moment(_0x368435[0x1])[_0x8dc5('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd4fd3a[_0x8dc5('0x38')]=_[_0x8dc5('0xba')](_0xd4fd3a['where'],_0x36a19a);}_0xd4fd3a=_[_0x8dc5('0xba')]({},_0xd4fd3a,_0x4169e2[_0x8dc5('0xbb')]);return db[_0x8dc5('0xc3')][_0x8dc5('0x13')]({'where':_0xd4fd3a['where']})[_0x8dc5('0x19')](function(_0x435422){_0x42a5c1[_0x8dc5('0x13')]=_0x435422;if(_0x4169e2['query'][_0x8dc5('0xc4')]){_0xd4fd3a[_0x8dc5('0xb9')]=[{'all':!![]}];}return db[_0x8dc5('0xc3')][_0x8dc5('0xc5')](_0xd4fd3a);})[_0x8dc5('0x19')](function(_0x102100){if(_0x4169e2[_0x8dc5('0x2e')][_0x8dc5('0xc6')]===_0x8dc5('0xc7')){for(var _0x33b2e0=0x0;_0x33b2e0<_0x102100[_0x8dc5('0x34')];_0x33b2e0++){_0x102100[_0x33b2e0][_0x8dc5('0xbd')]=juice(_0x102100[_0x33b2e0][_0x8dc5('0xbd')]);}}_0x42a5c1[_0x8dc5('0xc8')]=_0x102100;return _0x42a5c1;});}})[_0x8dc5('0x19')](respondWithFilteredResult(_0x4a970f,_0xd4fd3a))[_0x8dc5('0x2a')](handleError(_0x4a970f,null));};exports['addTags']=function(_0x4d9fc7,_0x7a275a){return db[_0x8dc5('0x2b')][_0x8dc5('0x54')]({'where':{'id':_0x4d9fc7[_0x8dc5('0xb8')]['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0x7a275a,null))[_0x8dc5('0x19')](function(_0x3c7480){if(_0x3c7480){return _0x3c7480['setTags'](_0x4d9fc7[_0x8dc5('0xbd')][_0x8dc5('0xbf')],_[_0x8dc5('0xc9')](_0x4d9fc7[_0x8dc5('0xbd')],['ids','id'])||{})[_0x8dc5('0xca')](function(){return db[_0x8dc5('0x63')]['findAll']({'attributes':['id',_0x8dc5('0x1e'),_0x8dc5('0x3c')],'where':{'id':_0x4d9fc7[_0x8dc5('0xbd')][_0x8dc5('0xbf')]}});})[_0x8dc5('0x19')](function(_0x3ecb2d){socket[_0x8dc5('0xcb')]('mailInteractionTags:save',{'id':Number(_0x4d9fc7[_0x8dc5('0xb8')]['id']),'tags':_0x3ecb2d||[]});return{'id':Number(_0x4d9fc7[_0x8dc5('0xb8')]['id']),'tags':_0x3ecb2d||[]};});}})['then'](respondWithResult(_0x7a275a,null))['catch'](handleError(_0x7a275a,null));};exports[_0x8dc5('0xcc')]=function(_0x327a3d,_0x4d0300){return db[_0x8dc5('0x2b')][_0x8dc5('0x54')]({'where':{'id':_0x327a3d[_0x8dc5('0xb8')]['id']}})[_0x8dc5('0x19')](handleEntityNotFound(_0x4d0300,null))['then'](function(_0x1d6705){if(_0x1d6705){return _0x1d6705[_0x8dc5('0xcc')](_0x327a3d[_0x8dc5('0x2e')][_0x8dc5('0xbf')]);}})[_0x8dc5('0x19')](respondWithStatusCode(_0x4d0300,null))['catch'](handleError(_0x4d0300,null));};exports[_0x8dc5('0xcd')]=function(_0x1dd6fe,_0x398913){var _0x4f4c10=moment()[_0x8dc5('0xce')]()[_0x8dc5('0x92')]();var _0x1f4d70=path[_0x8dc5('0xcf')](config[_0x8dc5('0xd0')],_0x8dc5('0xd1'),_0x8dc5('0xd2'),_0x8dc5('0xd3'));var _0xf0c298=path[_0x8dc5('0xcf')](config['root'],_0x8dc5('0xd1'),'files',_0x8dc5('0xd4'));var _0x52ecfb=path['join'](_0x1f4d70,_0x4f4c10);var _0x5e5f6a=util[_0x8dc5('0xc2')]('transcript-%d-%s.zip',_0x1dd6fe[_0x8dc5('0xb8')]['id'],_0x4f4c10);var _0x644da8=path[_0x8dc5('0xcf')](_0x1f4d70,_0x5e5f6a);var _0x37dd84=[];if(_0x1dd6fe[_0x8dc5('0x2e')][_0x8dc5('0xd4')]){_0x37dd84[_0x8dc5('0x23')]({'model':db[_0x8dc5('0xd5')],'as':_0x8dc5('0xd6'),'raw':!![]});}var _0x2940c5=[{'model':db[_0x8dc5('0xc3')],'as':_0x8dc5('0xd7'),'attributes':['id',_0x8dc5('0xbd'),_0x8dc5('0x3d'),'to','cc',_0x8dc5('0xd8'),_0x8dc5('0xd9'),_0x8dc5('0x70')],'where':{'secret':![]},'order':qs[_0x8dc5('0x37')]('id'),'include':_0x37dd84}];return db[_0x8dc5('0x2b')][_0x8dc5('0x54')]({'where':{'id':_0x1dd6fe[_0x8dc5('0xb8')]['id']},'include':_0x2940c5})[_0x8dc5('0x19')](handleEntityNotFound(_0x398913,null))['then'](function(_0x1bade3){if(_0x1bade3&&_0x1bade3['Messages']){var _0x493b53=_0x1bade3[_0x8dc5('0xda')]({'plain':!![]});fs[_0x8dc5('0xdb')](_0x52ecfb);return BPromise[_0x8dc5('0xdc')](_0x493b53[_0x8dc5('0xd7')],function(_0xdbd247,_0x22bfa2){var _0x5c441f={'from':_0xdbd247['from'],'to':_0xdbd247['to'],'subject':_0xdbd247[_0x8dc5('0xd9')],'html':htmlEntities[_0x8dc5('0xdd')](_0xdbd247[_0x8dc5('0xbd')]),'headers':{'Date':moment(_0xdbd247['createdAt'])[_0x8dc5('0xc2')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xdbd247['cc']){_0x5c441f[_0x8dc5('0xde')]['Cc']=_0xdbd247['cc'];}if(_0xdbd247[_0x8dc5('0xd8')]){_0x5c441f[_0x8dc5('0xde')][_0x8dc5('0xdf')]=_0xdbd247['bcc'];}return new BPromise(function(_0x3bb2dd,_0x40c328){if(_0xdbd247[_0x8dc5('0xd6')]){for(var _0x363989=0x0;_0x363989<_0xdbd247[_0x8dc5('0xd6')][_0x8dc5('0x34')];_0x363989++){var _0x36162d=_0xdbd247[_0x8dc5('0xd6')][_0x363989];var _0xb0366b=path[_0x8dc5('0xcf')](_0xf0c298,_0x36162d[_0x8dc5('0xe0')]);if(fs[_0x8dc5('0xe1')](_0xb0366b)){_0x5c441f[_0x8dc5('0xd4')][_0x8dc5('0x23')]({'name':_0x36162d[_0x8dc5('0x1e')],'contentType':_0x36162d[_0x8dc5('0x60')],'data':fs[_0x8dc5('0xe2')](_0xb0366b)});}}}emlformat[_0x8dc5('0xe3')](_0x5c441f,function(_0x5823ba,_0x2aac32){if(_0x5823ba)return _0x40c328(_0x5823ba);fs[_0x8dc5('0xe4')](path[_0x8dc5('0xcf')](_0x52ecfb,util[_0x8dc5('0xc2')]('message%d.eml',_0x22bfa2)),_0x2aac32);return _0x3bb2dd(_0x2aac32);});});})[_0x8dc5('0x19')](function(){return new BPromise(function(_0x31e290,_0x3971db){zipdir(_0x52ecfb,{'saveTo':_0x644da8},function(_0x19c4de,_0x32d86d){if(_0x19c4de)return _0x3971db(_0x19c4de);return _0x31e290(_0x32d86d);});})[_0x8dc5('0x19')](function(){return new BPromise(function(_0xd46efb,_0x48047a){rimraf(_0x52ecfb,function(_0x4db70b){if(_0x4db70b)_0x48047a(_0x4db70b);return _0xd46efb();});});})['then'](function(){return _0x398913[_0x8dc5('0xcd')](_0x644da8,_0x5e5f6a,function(_0x2c9e72){if(!_0x2c9e72)fs[_0x8dc5('0xe5')](_0x644da8);});});});}else{return _0x398913[_0x8dc5('0x1b')](0xc8);}})[_0x8dc5('0x2a')](handleError(_0x398913,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 683bf4e..1d16a5e 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 _0xf181=['save','update','remove','then','Users','map','setDataValue','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','setMaxListeners'];(function(_0x17df64,_0x3455e5){var _0x368031=function(_0x4ff31c){while(--_0x4ff31c){_0x17df64['push'](_0x17df64['shift']());}};_0x368031(++_0x3455e5);}(_0xf181,0x6c));var _0x1f18=function(_0xa59345,_0x86f01c){_0xa59345=_0xa59345-0x0;var _0x22fc32=_0xf181[_0xa59345];return _0x22fc32;};'use strict';var EventEmitter=require(_0x1f18('0x0'));var MailInteraction=require(_0x1f18('0x1'))['db'][_0x1f18('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1f18('0x3')](0x0);var events={'afterCreate':_0x1f18('0x4'),'afterUpdate':_0x1f18('0x5'),'afterDestroy':_0x1f18('0x6')};function emitEvent(_0x236434){return function(_0x5add59,_0x1f386c,_0x446163){_0x5add59['getUsers']({'attributes':['id'],'raw':!![]})[_0x1f18('0x7')](function(_0x2c05ba){_0x5add59['setDataValue'](_0x1f18('0x8'),_0x2c05ba[_0x1f18('0x9')](function(_0x5da7fc){return{'id':_0x5da7fc['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5add59['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1f18('0x7')](function(_0x41bc8b){_0x5add59[_0x1f18('0xa')]('unreadMessages',_0x41bc8b[_0x1f18('0xb')]);MailInteractionEvents[_0x1f18('0xc')](_0x236434+':'+_0x5add59['id'],_0x5add59);MailInteractionEvents[_0x1f18('0xc')](_0x236434,_0x5add59);_0x446163(null);})[_0x1f18('0xd')](_0x446163(null));};}for(var e in events){if(events[_0x1f18('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x1f18('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x8689=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8689,0x64));var _0x9868=function(_0x171316,_0x1b5db5){_0x171316=_0x171316-0x0;var _0x33c451=_0x8689[_0x171316];return _0x33c451;};'use strict';var EventEmitter=require(_0x9868('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x9868('0x1')];var MailMessage=require(_0x9868('0x2'))['db'][_0x9868('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9868('0x4')](0x0);var events={'afterCreate':_0x9868('0x5'),'afterUpdate':'update','afterDestroy':_0x9868('0x6')};function emitEvent(_0x3ddaa6){return function(_0x4af3d2,_0x349500,_0x3cf8cb){_0x4af3d2[_0x9868('0x7')]({'attributes':['id'],'raw':!![]})[_0x9868('0x8')](function(_0x224033){_0x4af3d2[_0x9868('0x9')](_0x9868('0xa'),_0x224033['map'](function(_0x5c742b){return{'id':_0x5c742b['id']};}));return MailMessage[_0x9868('0xb')]({'where':{'MailInteractionId':_0x4af3d2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9868('0x8')](function(_0x4836e6){_0x4af3d2[_0x9868('0x9')](_0x9868('0xc'),_0x4836e6[_0x9868('0xd')]);MailInteractionEvents[_0x9868('0xe')](_0x3ddaa6+':'+_0x4af3d2['id'],_0x4af3d2);MailInteractionEvents[_0x9868('0xe')](_0x3ddaa6,_0x4af3d2);_0x3cf8cb(null);})[_0x9868('0xf')](_0x3cf8cb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x9868('0x10')](e,emitEvent(event));}}module[_0x9868('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 a58d624..e4ba7b7 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 _0x2718=['format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x2718,0x8d));var _0x8271=function(_0x576a62,_0x152536){_0x576a62=_0x576a62-0x0;var _0x44bdff=_0x2718[_0x576a62];return _0x44bdff;};'use strict';var _=require('lodash');var util=require(_0x8271('0x0'));var logger=require(_0x8271('0x1'))('api');var moment=require(_0x8271('0x2'));var BPromise=require(_0x8271('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8271('0x4'));var config=require(_0x8271('0x5'));var attributes=require(_0x8271('0x6'));module[_0x8271('0x7')]=function(_0x95e7b5,_0x5668b7){return _0x95e7b5[_0x8271('0x8')]('MailInteraction',attributes,{'tableName':_0x8271('0x9'),'paranoid':![],'indexes':[{'name':_0x8271('0xa'),'fields':[_0x8271('0xb'),'to'],'type':_0x8271('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x197f09,_0x44c72b,_0x1751d9){if(_0x197f09[_0x8271('0xd')]){_0x197f09[_0x8271('0xe')]=moment()[_0x8271('0xf')](_0x8271('0x10'));}if(_0x197f09[_0x8271('0x11')]){_0x197f09[_0x8271('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1751d9(null,_0x44c72b);},'beforeUpdate':function(_0xafde83,_0x150050,_0x10b1bd){if(_0xafde83['changed']('substatus')){_0xafde83[_0x8271('0xe')]=_0xafde83[_0x8271('0xd')]?moment()[_0x8271('0xf')](_0x8271('0x10')):null;}if(_0xafde83['changed'](_0x8271('0x11'))){_0xafde83[_0x8271('0x12')]=moment()[_0x8271('0xf')](_0x8271('0x10'));_0xafde83['substatus']=null;_0xafde83['substatusAt']=null;}_0x10b1bd(null,_0xafde83);},'afterUpdate':function(_0x3f74de,_0x533024,_0x50f7fc){var _0x382c26=_0x95e7b5[_0x8271('0x13')];var _0x5cd8ae=_0x3f74de[_0x8271('0x14')]({'plain':!![]});if(_0x5cd8ae[_0x8271('0x11')]){return _0x382c26[_0x8271('0x15')][_0x8271('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5cd8ae['id']}})[_0x8271('0x17')](function(){_0x50f7fc();})[_0x8271('0x18')](function(_0x17c99f){_0x50f7fc(_0x17c99f);});}else{_0x50f7fc();}}},'charset':'utf8mb4','collate':_0x8271('0x19')});}; \ No newline at end of file +var _0xbb36=['then','catch','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatusAt','closed','models','update'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xbb36,0x193));var _0x6bb3=function(_0xd88ec4,_0x5cf41a){_0xd88ec4=_0xd88ec4-0x0;var _0x16fe26=_0xbb36[_0xd88ec4];return _0x16fe26;};'use strict';var _=require(_0x6bb3('0x0'));var util=require(_0x6bb3('0x1'));var logger=require('../../config/logger')(_0x6bb3('0x2'));var moment=require(_0x6bb3('0x3'));var BPromise=require(_0x6bb3('0x4'));var rp=require(_0x6bb3('0x5'));var fs=require('fs');var path=require(_0x6bb3('0x6'));var rimraf=require(_0x6bb3('0x7'));var config=require(_0x6bb3('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x6bb3('0x9')]=function(_0x36548c,_0x48134b){return _0x36548c[_0x6bb3('0xa')](_0x6bb3('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x6bb3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5694f9,_0x2acedd,_0x387272){if(_0x5694f9[_0x6bb3('0xd')]){_0x5694f9['substatusAt']=moment()[_0x6bb3('0xe')](_0x6bb3('0xf'));}if(_0x5694f9['closed']){_0x5694f9[_0x6bb3('0x10')]=moment()[_0x6bb3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x387272(null,_0x2acedd);},'beforeUpdate':function(_0x55570a,_0xed9336,_0x41bc66){if(_0x55570a[_0x6bb3('0x11')](_0x6bb3('0xd'))){_0x55570a[_0x6bb3('0x12')]=_0x55570a[_0x6bb3('0xd')]?moment()['format'](_0x6bb3('0xf')):null;}if(_0x55570a[_0x6bb3('0x11')](_0x6bb3('0x13'))){_0x55570a['closedAt']=moment()['format'](_0x6bb3('0xf'));_0x55570a[_0x6bb3('0xd')]=null;_0x55570a[_0x6bb3('0x12')]=null;}_0x41bc66(null,_0x55570a);},'afterUpdate':function(_0x285a89,_0x6cfab6,_0x51cfff){var _0xc292ba=_0x36548c[_0x6bb3('0x14')];var _0xafce1e=_0x285a89['get']({'plain':!![]});if(_0xafce1e['closed']){return _0xc292ba['MailMessage'][_0x6bb3('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0xafce1e['id']}})[_0x6bb3('0x16')](function(){_0x51cfff();})[_0x6bb3('0x17')](function(_0x27cc3d){_0x51cfff(_0x27cc3d);});}else{_0x51cfff();}}},'charset':_0x6bb3('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 83e2ad7..d769b5b 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 _0xed20=['./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0x4b107d,_0x3ffc6f){var _0x35a1f4=function(_0x4c5664){while(--_0x4c5664){_0x4b107d['push'](_0x4b107d['shift']());}};_0x35a1f4(++_0x3ffc6f);}(_0xed20,0xce));var _0x0ed2=function(_0x2f6bf6,_0x180a99){_0x2f6bf6=_0x2f6bf6-0x0;var _0x1d95a5=_0xed20[_0x2f6bf6];return _0x1d95a5;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var moment=require(_0x0ed2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ed2('0x3'));var fs=require('fs');var Redis=require(_0x0ed2('0x4'));var db=require(_0x0ed2('0x5'))['db'];var utils=require(_0x0ed2('0x6'));var logger=require(_0x0ed2('0x7'))(_0x0ed2('0x8'));var config=require('../../config/environment');var jayson=require(_0x0ed2('0x9'));var client=jayson[_0x0ed2('0xa')]['http']({'port':0x232a});config[_0x0ed2('0xb')]=_[_0x0ed2('0xc')](config[_0x0ed2('0xb')],{'host':_0x0ed2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ed2('0xb')]));require(_0x0ed2('0xe'))[_0x0ed2('0xf')](socket);function respondWithRpcPromise(_0x25a2d8,_0x48f0aa,_0x4d6fe2){return new BPromise(function(_0x36bd70,_0x1a3885){return client[_0x0ed2('0x10')](_0x25a2d8,_0x4d6fe2)[_0x0ed2('0x11')](function(_0x187709){logger[_0x0ed2('0x12')](_0x0ed2('0x13'),_0x48f0aa,_0x0ed2('0x14'));logger[_0x0ed2('0x15')](_0x0ed2('0x16'),_0x48f0aa,_0x0ed2('0x14'),JSON[_0x0ed2('0x17')](_0x187709));if(_0x187709['error']){if(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x19')]===0x1f4){logger[_0x0ed2('0x18')](_0x0ed2('0x13'),_0x48f0aa,_0x187709[_0x0ed2('0x18')]['message']);return _0x1a3885(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x1a')]);}logger[_0x0ed2('0x18')]('MailInteraction,\x20%s,\x20%s',_0x48f0aa,_0x187709[_0x0ed2('0x18')]['message']);return _0x36bd70(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x1a')]);}else{logger[_0x0ed2('0x12')]('MailInteraction,\x20%s,\x20%s',_0x48f0aa,'request\x20sent');_0x36bd70(_0x187709[_0x0ed2('0x1b')][_0x0ed2('0x1a')]);}})['catch'](function(_0x322e35){logger['error'](_0x0ed2('0x13'),_0x48f0aa,_0x322e35);_0x1a3885(_0x322e35);});});}exports[_0x0ed2('0x1c')]=function(_0x4d5c76){var _0x5ac0aa=this;return new Promise(function(_0x585ac1,_0x13060b){return db[_0x0ed2('0x1d')][_0x0ed2('0x1e')](_0x4d5c76[_0x0ed2('0x1f')],{'raw':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5c76['options']?_0x4d5c76['options'][_0x0ed2('0x22')]||null:null,'attributes':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x23')]||null:null,'limit':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x24')]||null:null})[_0x0ed2('0x11')](function(_0x5f2660){logger[_0x0ed2('0x12')](_0x0ed2('0x1c'),_0x4d5c76);logger[_0x0ed2('0x15')](_0x0ed2('0x1c'),_0x4d5c76,JSON[_0x0ed2('0x17')](_0x5f2660));_0x585ac1(_0x5f2660);})['catch'](function(_0x14c0e6){logger[_0x0ed2('0x18')](_0x0ed2('0x1c'),_0x14c0e6[_0x0ed2('0x1a')],_0x4d5c76);_0x13060b(_0x5ac0aa[_0x0ed2('0x18')](0x1f4,_0x14c0e6[_0x0ed2('0x1a')]));});});};exports[_0x0ed2('0x25')]=function(_0x1d90ee){return new Promise(function(_0x1e62a8,_0x1e6efe){return db['MailInteraction'][_0x0ed2('0x26')]({'where':_0x1d90ee['options']?_0x1d90ee['options'][_0x0ed2('0x22')]||null:null})[_0x0ed2('0x11')](function(_0x11add7){if(_0x11add7){return _0x11add7[_0x0ed2('0x27')](_0x1d90ee[_0x0ed2('0x1f')][_0x0ed2('0x28')],_['omit'](_0x1d90ee['body'],['ids','id'])||{});}})[_0x0ed2('0x29')](function(_0x35eff4){logger[_0x0ed2('0x12')](_0x0ed2('0x2a'),_0x1d90ee);logger['debug'](_0x0ed2('0x2a'),_0x1d90ee,JSON['stringify'](_0x35eff4));_0x1e62a8(_0x35eff4);})[_0x0ed2('0x2b')](function(_0x793700){logger['error'](_0x0ed2('0x2a'),_0x793700['message'],_0x1d90ee);_0x1e6efe(_this[_0x0ed2('0x18')](0x1f4,_0x793700[_0x0ed2('0x1a')]));});});}; \ No newline at end of file +var _0xe135=['where','AddTagsToMailInteraction','omit','ids','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw'];(function(_0x40f638,_0x573615){var _0x27f781=function(_0x723177){while(--_0x723177){_0x40f638['push'](_0x40f638['shift']());}};_0x27f781(++_0x573615);}(_0xe135,0x1a7));var _0x5e13=function(_0x39cdb8,_0x15ee98){_0x39cdb8=_0x39cdb8-0x0;var _0x44bbc9=_0xe135[_0x39cdb8];return _0x44bbc9;};'use strict';var _=require('lodash');var util=require(_0x5e13('0x0'));var moment=require(_0x5e13('0x1'));var BPromise=require(_0x5e13('0x2'));var rs=require(_0x5e13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e13('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5e13('0x5'));var jayson=require(_0x5e13('0x6'));var client=jayson[_0x5e13('0x7')][_0x5e13('0x8')]({'port':0x232a});config['redis']=_[_0x5e13('0x9')](config[_0x5e13('0xa')],{'host':_0x5e13('0xb'),'port':0x18eb});var socket=require(_0x5e13('0xc'))(new Redis(config['redis']));require(_0x5e13('0xd'))[_0x5e13('0xe')](socket);function respondWithRpcPromise(_0x5e0b40,_0x3fe0e2,_0x50d979){return new BPromise(function(_0x518371,_0x24700d){return client[_0x5e13('0xf')](_0x5e0b40,_0x50d979)[_0x5e13('0x10')](function(_0x16e3fb){logger['info'](_0x5e13('0x11'),_0x3fe0e2,_0x5e13('0x12'));logger[_0x5e13('0x13')](_0x5e13('0x14'),_0x3fe0e2,_0x5e13('0x12'),JSON['stringify'](_0x16e3fb));if(_0x16e3fb[_0x5e13('0x15')]){if(_0x16e3fb['error'][_0x5e13('0x16')]===0x1f4){logger['error'](_0x5e13('0x11'),_0x3fe0e2,_0x16e3fb['error'][_0x5e13('0x17')]);return _0x24700d(_0x16e3fb[_0x5e13('0x15')][_0x5e13('0x17')]);}logger[_0x5e13('0x15')](_0x5e13('0x11'),_0x3fe0e2,_0x16e3fb['error'][_0x5e13('0x17')]);return _0x518371(_0x16e3fb[_0x5e13('0x15')][_0x5e13('0x17')]);}else{logger[_0x5e13('0x18')](_0x5e13('0x11'),_0x3fe0e2,_0x5e13('0x12'));_0x518371(_0x16e3fb[_0x5e13('0x19')][_0x5e13('0x17')]);}})[_0x5e13('0x1a')](function(_0x53e10a){logger[_0x5e13('0x15')](_0x5e13('0x11'),_0x3fe0e2,_0x53e10a);_0x24700d(_0x53e10a);});});}exports[_0x5e13('0x1b')]=function(_0x660847){var _0x13e385=this;return new Promise(function(_0x19d552,_0x19509f){return db[_0x5e13('0x1c')][_0x5e13('0x1d')](_0x660847[_0x5e13('0x1e')],{'raw':_0x660847[_0x5e13('0x1f')]?_0x660847[_0x5e13('0x1f')][_0x5e13('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x660847[_0x5e13('0x1f')]?_0x660847['options'][_0x5e13('0x21')]||null:null,'attributes':_0x660847['options']?_0x660847[_0x5e13('0x1f')]['attributes']||null:null,'limit':_0x660847[_0x5e13('0x1f')]?_0x660847[_0x5e13('0x1f')]['limit']||null:null})[_0x5e13('0x10')](function(_0x221b26){logger['info'](_0x5e13('0x1b'),_0x660847);logger[_0x5e13('0x13')](_0x5e13('0x1b'),_0x660847,JSON['stringify'](_0x221b26));_0x19d552(_0x221b26);})[_0x5e13('0x1a')](function(_0x1686a7){logger[_0x5e13('0x15')]('UpdateMailInteraction',_0x1686a7[_0x5e13('0x17')],_0x660847);_0x19509f(_0x13e385[_0x5e13('0x15')](0x1f4,_0x1686a7[_0x5e13('0x17')]));});});};exports[_0x5e13('0x22')]=function(_0x5c46a4){return new Promise(function(_0x54d455,_0x23e83c){return db[_0x5e13('0x1c')]['find']({'where':_0x5c46a4['options']?_0x5c46a4['options'][_0x5e13('0x21')]||null:null})[_0x5e13('0x10')](function(_0x1070c9){if(_0x1070c9){return _0x1070c9['addTags'](_0x5c46a4[_0x5e13('0x1e')]['ids'],_[_0x5e13('0x23')](_0x5c46a4['body'],[_0x5e13('0x24'),'id'])||{});}})['spread'](function(_0x2b062a){logger[_0x5e13('0x18')](_0x5e13('0x25'),_0x5c46a4);logger[_0x5e13('0x13')]('AddTags',_0x5c46a4,JSON['stringify'](_0x2b062a));_0x54d455(_0x2b062a);})[_0x5e13('0x1a')](function(_0x3819c9){logger[_0x5e13('0x15')](_0x5e13('0x25'),_0x3819c9[_0x5e13('0x17')],_0x5c46a4);_0x23e83c(_this[_0x5e13('0x15')](0x1f4,_0x3819c9['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3a33fe1..5084665 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 _0x29bf=['remove','update','emit','removeListener','register','length','save'];(function(_0x2313e8,_0x332e97){var _0x482a35=function(_0xe736a0){while(--_0xe736a0){_0x2313e8['push'](_0x2313e8['shift']());}};_0x482a35(++_0x332e97);}(_0x29bf,0xdf));var _0xf29b=function(_0x56c540,_0x3ca49c){_0x56c540=_0x56c540-0x0;var _0x1ee77c=_0x29bf[_0x56c540];return _0x1ee77c;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xf29b('0x0'),_0xf29b('0x1'),_0xf29b('0x2')];function createListener(_0x39a991,_0x45db15){return function(_0x216b02){_0x45db15[_0xf29b('0x3')](_0x39a991,_0x216b02);};}function removeListener(_0x1307ea,_0x4c279c){return function(){MailInteractionEvents[_0xf29b('0x4')](_0x1307ea,_0x4c279c);};}exports[_0xf29b('0x5')]=function(_0x53a1ea){for(var _0x570142=0x0,_0xbdc0c8=events[_0xf29b('0x6')];_0x570142<_0xbdc0c8;_0x570142++){var _0x7e3102=events[_0x570142];var _0x5df0d4=createListener('mailInteraction:'+_0x7e3102,_0x53a1ea);MailInteractionEvents['on'](_0x7e3102,_0x5df0d4);}}; \ No newline at end of file +var _0xf967=['save','remove','update','removeListener','mailInteraction:'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf967,0x159));var _0x7f96=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf967[_0x3bf83f];return _0x22c4a9;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x7f96('0x0'),_0x7f96('0x1'),_0x7f96('0x2')];function createListener(_0x4a0702,_0x51b5d0){return function(_0x46d0b2){_0x51b5d0['emit'](_0x4a0702,_0x46d0b2);};}function removeListener(_0x46eab0,_0x4edf90){return function(){MailInteractionEvents[_0x7f96('0x3')](_0x46eab0,_0x4edf90);};}exports['register']=function(_0x314aba){for(var _0x5a4e87=0x0,_0x5b97b5=events['length'];_0x5a4e87<_0x5b97b5;_0x5a4e87++){var _0x517e2e=events[_0x5a4e87];var _0x12e374=createListener(_0x7f96('0x4')+_0x517e2e,_0x314aba);MailInteractionEvents['on'](_0x517e2e,_0x12e374);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 13297d8..6faa1e1 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 _0xfcc5=['/:id/accept','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','mail','put','update'];(function(_0xca171e,_0x22b904){var _0x26e039=function(_0x420a26){while(--_0x420a26){_0xca171e['push'](_0xca171e['shift']());}};_0x26e039(++_0x22b904);}(_0xfcc5,0x14a));var _0x5fcc=function(_0x217b53,_0x19068f){_0x217b53=_0x217b53-0x0;var _0x505328=_0xfcc5[_0x217b53];return _0x505328;};'use strict';var multer=require('multer');var util=require(_0x5fcc('0x0'));var path=require(_0x5fcc('0x1'));var timeout=require(_0x5fcc('0x2'));var express=require(_0x5fcc('0x3'));var router=express['Router']();var fs_extra=require(_0x5fcc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fcc('0x5'));var controller=require(_0x5fcc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5fcc('0x7')]);router[_0x5fcc('0x8')](_0x5fcc('0x9'),auth[_0x5fcc('0xa')](),controller[_0x5fcc('0xb')]);router['get'](_0x5fcc('0xc'),auth['isAuthenticated'](),controller[_0x5fcc('0xd')]);router[_0x5fcc('0x8')]('/:id/download',auth[_0x5fcc('0xa')](),controller[_0x5fcc('0xe')]);router[_0x5fcc('0xf')]('/',auth[_0x5fcc('0xa')](),interaction[_0x5fcc('0x10')](_0x5fcc('0x11'),'mailmessage:create'),controller['create']);router[_0x5fcc('0x12')](_0x5fcc('0xc'),auth[_0x5fcc('0xa')](),controller[_0x5fcc('0x13')]);router[_0x5fcc('0x12')](_0x5fcc('0x14'),auth[_0x5fcc('0xa')](),controller['accept']);router[_0x5fcc('0x12')]('/:id/reject',auth[_0x5fcc('0xa')](),controller[_0x5fcc('0x15')]);router[_0x5fcc('0x16')](_0x5fcc('0xc'),auth['isAuthenticated'](),controller[_0x5fcc('0x17')]);module[_0x5fcc('0x18')]=router; \ No newline at end of file +var _0xf290=['/:id','show','/:id/download','download','post','mail','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x2fa2fb,_0x5a0cc0){var _0x2f1b34=function(_0x2aa0f0){while(--_0x2aa0f0){_0x2fa2fb['push'](_0x2fa2fb['shift']());}};_0x2f1b34(++_0x5a0cc0);}(_0xf290,0xde));var _0x0f29=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xf290[_0x492af5];return _0x59f529;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./mailMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'mailmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a830ba3..9e384db 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 _0xcb62=['out','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xcb62,0x70));var _0x2cb6=function(_0x44fa55,_0x4e5332){_0x44fa55=_0x44fa55-0x0;var _0x1c7665=_0xcb62[_0x44fa55];return _0x1c7665;};'use strict';var Sequelize=require(_0x2cb6('0x0'));var _=require(_0x2cb6('0x1'));module[_0x2cb6('0x2')]={'body':{'type':Sequelize[_0x2cb6('0x3')](_0x2cb6('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2cb6('0x3')](_0x2cb6('0x5'))},'read':{'type':Sequelize[_0x2cb6('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2cb6('0x7')]('in','out'),'defaultValue':_0x2cb6('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2cb6('0x3')](_0x2cb6('0x4'))},'cc':{'type':Sequelize[_0x2cb6('0x3')](_0x2cb6('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x2cb6('0x4'))},'subject':{'type':Sequelize[_0x2cb6('0x3')]},'sentAt':{'type':Sequelize[_0x2cb6('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2cb6('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2cb6('0x9')]},'originTo':{'type':Sequelize[_0x2cb6('0x3')]('long')},'originCc':{'type':Sequelize[_0x2cb6('0x3')]('long')},'originChannel':{'type':Sequelize[_0x2cb6('0x7')](_0x2cb6('0xa'),_0x2cb6('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xf59a=['long','medium','BOOLEAN','ENUM','out','STRING','DATE','Email','sequelize','TEXT'];(function(_0x62a18b,_0x29656d){var _0x4394dd=function(_0x62e1d2){while(--_0x62e1d2){_0x62a18b['push'](_0x62a18b['shift']());}};_0x4394dd(++_0x29656d);}(_0xf59a,0x116));var _0xaf59=function(_0x127310,_0x4cf891){_0x127310=_0x127310-0x0;var _0x1bf412=_0xf59a[_0x127310];return _0x1bf412;};'use strict';var Sequelize=require(_0xaf59('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x3'))},'read':{'type':Sequelize[_0xaf59('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaf59('0x5')]('in',_0xaf59('0x6')),'defaultValue':_0xaf59('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaf59('0x7')](0x1fe)},'from':{'type':Sequelize[_0xaf59('0x7')]},'to':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xaf59('0x2'))},'bcc':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x2'))},'subject':{'type':Sequelize[_0xaf59('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xaf59('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xaf59('0x8')]},'originTo':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x2'))},'originCc':{'type':Sequelize[_0xaf59('0x1')](_0xaf59('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0xaf59('0x9'),'Chat'),'defaultValue':_0xaf59('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index be2d2d8..2707fdd 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 _0xf50c=['fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','find','body','describe','create','direction','secret','MailAccount','MailAccountId','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','length','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','get','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','interface','rejectmessage','download','toString','join','server','files','tmp','message-%s.eml','from','subject','Attachments','decode','headers','Bcc','bcc','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes'];(function(_0x5baa3e,_0x2266a1){var _0x3cd3c8=function(_0x5d507f){while(--_0x5d507f){_0x5baa3e['push'](_0x5baa3e['shift']());}};_0x3cd3c8(++_0x2266a1);}(_0xf50c,0x1b3));var _0xcf50=function(_0x530dad,_0x20b1b7){_0x530dad=_0x530dad-0x0;var _0x469723=_0xf50c[_0x530dad];return _0x469723;};'use strict';var emlformat=require('eml-format');var moment=require(_0xcf50('0x0'));var BPromise=require(_0xcf50('0x1'));var util=require(_0xcf50('0x2'));var path=require(_0xcf50('0x3'));var fs=require('fs');var _=require(_0xcf50('0x4'));var Redis=require(_0xcf50('0x5'));var htmlToText=require(_0xcf50('0x6'));var qs=require(_0xcf50('0x7'));var logger=require(_0xcf50('0x8'))(_0xcf50('0x9'));var interaction_log=require(_0xcf50('0x8'))('mail-interactions');var config=require(_0xcf50('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xcf50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf50('0xc'))(new Redis(config[_0xcf50('0xb')]));var htmlEntities=require(_0xcf50('0xd'));require(_0xcf50('0xe'))[_0xcf50('0xf')](socket);var jayson=require(_0xcf50('0x10'));var client=jayson[_0xcf50('0x11')][_0xcf50('0x12')]({'port':0x232c});var client9003=jayson[_0xcf50('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xcf50('0x11')][_0xcf50('0x12')]({'port':0x232a});function respondWithRpcPromise(_0xd9396a,_0x3af409,_0x5f0c57,_0x25936d){return new BPromise(function(_0x5063d9,_0xa6dcda){var _0x1ac89d=_0x25936d||client;return _0x1ac89d[_0xcf50('0x13')](_0xd9396a,_0x5f0c57)[_0xcf50('0x14')](function(_0x3d866c){logger[_0xcf50('0x15')]('MailMessage,\x20%s,\x20%s',_0x3af409,_0xcf50('0x16'));logger[_0xcf50('0x17')](_0xcf50('0x18'),_0x3af409,_0xcf50('0x16'),JSON['stringify'](_0x3d866c));if(_0x3d866c[_0xcf50('0x19')]){if(_0x3d866c[_0xcf50('0x19')][_0xcf50('0x1a')]===0x1f4){logger['error'](_0xcf50('0x1b'),_0x3af409,_0x3d866c[_0xcf50('0x19')][_0xcf50('0x1c')]);return _0xa6dcda(_0x3d866c[_0xcf50('0x19')]['message']);}logger['error'](_0xcf50('0x1b'),_0x3af409,_0x3d866c[_0xcf50('0x19')][_0xcf50('0x1c')]);return _0x5063d9(_0x3d866c['error'][_0xcf50('0x1c')]);}else{logger['info'](_0xcf50('0x1b'),_0x3af409,_0xcf50('0x16'));_0x5063d9(_0x3d866c[_0xcf50('0x1d')][_0xcf50('0x1c')]);}})[_0xcf50('0x1e')](function(_0x1f82fe){logger['error'](_0xcf50('0x1b'),_0x3af409,_0x1f82fe);_0xa6dcda(_0x1f82fe);});});}function respondWithResult(_0x4af1b7,_0x38769f){_0x38769f=_0x38769f||0xc8;return function(_0x1a78d6){if(_0x1a78d6){return _0x4af1b7[_0xcf50('0x1f')](_0x38769f)[_0xcf50('0x20')](_0x1a78d6);}};}function respondWithFilteredResult(_0x184df0,_0x560cb5){return function(_0x4cf9a0){if(_0x4cf9a0){var _0x3437ff=typeof _0x560cb5[_0xcf50('0x21')]===_0xcf50('0x22')&&typeof _0x560cb5[_0xcf50('0x23')]===_0xcf50('0x22');var _0x1ba188=_0x4cf9a0[_0xcf50('0x24')];var _0x20944a=_0x3437ff?0x0:_0x560cb5['offset'];var _0x431e63=_0x3437ff?_0x4cf9a0[_0xcf50('0x24')]:_0x560cb5[_0xcf50('0x21')]+_0x560cb5[_0xcf50('0x23')];var _0x150f80;if(_0x431e63>=_0x1ba188){_0x431e63=_0x1ba188;_0x150f80=0xc8;}else{_0x150f80=0xce;}_0x184df0['status'](_0x150f80);return _0x184df0[_0xcf50('0x25')](_0xcf50('0x26'),_0x20944a+'-'+_0x431e63+'/'+_0x1ba188)['json'](_0x4cf9a0);}return null;};}function saveUpdates(_0x263df9){return function(_0x4b1448){if(_0x4b1448){return _0x4b1448[_0xcf50('0x27')](_0x263df9)[_0xcf50('0x14')](function(_0x3d40b4){return _0x3d40b4;});}return null;};}function removeEntity(_0x4a3e0f){return function(_0x1cb7e2){if(_0x1cb7e2){return _0x1cb7e2[_0xcf50('0x28')]()[_0xcf50('0x14')](function(){_0x4a3e0f['status'](0xcc)[_0xcf50('0x29')]();});}};}function handleEntityNotFound(_0x114f60){return function(_0x292673){if(!_0x292673){_0x114f60[_0xcf50('0x2a')](0x194);}return _0x292673;};}function handleError(_0x3f99b2,_0x312301){_0x312301=_0x312301||0x1f4;return function(_0x503bb8){logger[_0xcf50('0x19')](_0x503bb8[_0xcf50('0x2b')]);if(_0x503bb8[_0xcf50('0x2c')]){delete _0x503bb8[_0xcf50('0x2c')];}_0x3f99b2[_0xcf50('0x1f')](_0x312301)['send'](_0x503bb8);};}exports['index']=function(_0x240399,_0x37b3be){var _0x1ecad2={},_0x226655={},_0x204f93={'count':0x0,'rows':[]};var _0x405485=_[_0xcf50('0x2d')](db[_0xcf50('0x2e')][_0xcf50('0x2f')],function(_0x104fa6){return{'name':_0x104fa6[_0xcf50('0x30')],'type':_0x104fa6[_0xcf50('0x31')]['key']};});_0x226655[_0xcf50('0x32')]=_['map'](_0x405485,_0xcf50('0x2c'));_0x226655[_0xcf50('0x33')]=_['keys'](_0x240399[_0xcf50('0x33')]);_0x226655[_0xcf50('0x34')]=_[_0xcf50('0x35')](_0x226655[_0xcf50('0x32')],_0x226655[_0xcf50('0x33')]);_0x1ecad2[_0xcf50('0x36')]=_[_0xcf50('0x35')](_0x226655[_0xcf50('0x32')],qs[_0xcf50('0x37')](_0x240399[_0xcf50('0x33')][_0xcf50('0x37')]));_0x1ecad2['attributes']=_0x1ecad2[_0xcf50('0x36')]['length']?_0x1ecad2[_0xcf50('0x36')]:_0x226655['model'];if(!_0x240399['query'][_0xcf50('0x38')]('nolimit')){_0x1ecad2['limit']=qs[_0xcf50('0x23')](_0x240399[_0xcf50('0x33')][_0xcf50('0x23')]);_0x1ecad2[_0xcf50('0x21')]=qs[_0xcf50('0x21')](_0x240399[_0xcf50('0x33')][_0xcf50('0x21')]);}_0x1ecad2[_0xcf50('0x39')]=qs['sort'](_0x240399[_0xcf50('0x33')][_0xcf50('0x3a')]);_0x1ecad2[_0xcf50('0x3b')]=qs[_0xcf50('0x34')](_[_0xcf50('0x3c')](_0x240399['query'],_0x226655[_0xcf50('0x34')]),_0x405485);if(_0x240399['query'][_0xcf50('0x3d')]){_0x1ecad2[_0xcf50('0x3b')]=_[_0xcf50('0x3e')](_0x1ecad2[_0xcf50('0x3b')],{'$or':_[_0xcf50('0x2d')](_0x405485,function(_0x57d9c5){if(_0x57d9c5['type']!==_0xcf50('0x3f')){var _0x34ec58={};_0x34ec58[_0x57d9c5['name']]={'$like':'%'+_0x240399['query']['filter']+'%'};return _0x34ec58;}})});}_0x1ecad2=_[_0xcf50('0x3e')]({},_0x1ecad2,_0x240399[_0xcf50('0x40')]);var _0x37381c={'where':_0x1ecad2[_0xcf50('0x3b')]};return db['MailMessage'][_0xcf50('0x24')](_0x37381c)[_0xcf50('0x14')](function(_0x37bc83){_0x204f93[_0xcf50('0x24')]=_0x37bc83;if(_0x240399[_0xcf50('0x33')]['includeAll']){_0x1ecad2['include']=[{'all':!![]}];}return db[_0xcf50('0x2e')][_0xcf50('0x41')](_0x1ecad2);})[_0xcf50('0x14')](function(_0x5bea5b){_0x204f93[_0xcf50('0x42')]=_0x5bea5b;return _0x204f93;})[_0xcf50('0x14')](respondWithFilteredResult(_0x37b3be,_0x1ecad2))[_0xcf50('0x1e')](handleError(_0x37b3be,null));};exports[_0xcf50('0x43')]=function(_0x2dfdfd,_0x3aab30){var _0x3bb9e0={'raw':!![],'where':{'id':_0x2dfdfd[_0xcf50('0x44')]['id']}},_0x13e96e={};_0x13e96e[_0xcf50('0x32')]=_['keys'](db['MailMessage'][_0xcf50('0x2f')]);_0x13e96e[_0xcf50('0x33')]=_[_0xcf50('0x45')](_0x2dfdfd[_0xcf50('0x33')]);_0x13e96e[_0xcf50('0x34')]=_['intersection'](_0x13e96e[_0xcf50('0x32')],_0x13e96e['query']);_0x3bb9e0[_0xcf50('0x36')]=_[_0xcf50('0x35')](_0x13e96e[_0xcf50('0x32')],qs[_0xcf50('0x37')](_0x2dfdfd[_0xcf50('0x33')][_0xcf50('0x37')]));_0x3bb9e0[_0xcf50('0x36')]=_0x3bb9e0[_0xcf50('0x36')]['length']?_0x3bb9e0[_0xcf50('0x36')]:_0x13e96e[_0xcf50('0x32')];if(_0x2dfdfd[_0xcf50('0x33')]['includeAll']){_0x3bb9e0['include']=[{'all':!![]}];}_0x3bb9e0=_['merge']({},_0x3bb9e0,_0x2dfdfd[_0xcf50('0x40')]);return db[_0xcf50('0x2e')][_0xcf50('0x46')](_0x3bb9e0)['then'](handleEntityNotFound(_0x3aab30,null))[_0xcf50('0x14')](respondWithResult(_0x3aab30,null))[_0xcf50('0x1e')](handleError(_0x3aab30,null));};exports[_0xcf50('0x27')]=function(_0x3f9ff2,_0x3c3b27){if(_0x3f9ff2['body']['id']){delete _0x3f9ff2[_0xcf50('0x47')]['id'];}return db[_0xcf50('0x2e')][_0xcf50('0x46')]({'where':{'id':_0x3f9ff2['params']['id']}})['then'](handleEntityNotFound(_0x3c3b27,null))['then'](saveUpdates(_0x3f9ff2[_0xcf50('0x47')],null))[_0xcf50('0x14')](respondWithResult(_0x3c3b27,null))[_0xcf50('0x1e')](handleError(_0x3c3b27,null));};exports['destroy']=function(_0x2352e0,_0x2a62aa){return db[_0xcf50('0x2e')][_0xcf50('0x46')]({'where':{'id':_0x2352e0[_0xcf50('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a62aa,null))[_0xcf50('0x14')](removeEntity(_0x2a62aa,null))[_0xcf50('0x1e')](handleError(_0x2a62aa,null));};exports[_0xcf50('0x48')]=function(_0x3d8a71,_0x53d5df){return db[_0xcf50('0x2e')][_0xcf50('0x48')]()[_0xcf50('0x14')](respondWithResult(_0x53d5df,null))['catch'](handleError(_0x53d5df,null));};exports[_0xcf50('0x49')]=function(_0x15336c,_0x508626){return db['MailMessage'][_0xcf50('0x49')](_0x15336c[_0xcf50('0x47')])['then'](function(_0xa66d00){if(_0xa66d00){if(_0xa66d00[_0xcf50('0x4a')]==='out'&&!_0xa66d00[_0xcf50('0x4b')]){var _0x5bf0c2,_0x33176a,_0x10fabe;if(_0x15336c['body']['to']){_0x33176a=_0x15336c[_0xcf50('0x47')]['to']['split'](',')[0x0];}return db[_0xcf50('0x4c')]['findOne']({'where':{'id':_0xa66d00[_0xcf50('0x4d')]},'include':[{'model':db['CmList'],'as':_0xcf50('0x4e'),'include':[{'model':db[_0xcf50('0x4f')],'as':_0xcf50('0x50'),'where':{'email':_0x33176a},'limit':0x1,'order':[['updatedAt',_0xcf50('0x51')]]}]},{'model':db[_0xcf50('0x52')],'as':_0xcf50('0x53'),'raw':!![]}]})['then'](function(_0x3cbbc5){_0x5bf0c2=_0x3cbbc5;if(_0x5bf0c2&&_0x5bf0c2[_0xcf50('0x53')]){var _0x14febc={'tls':{'rejectUnauthorized':![]}};if(_[_0xcf50('0x54')](_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x55')])){_0x14febc[_0xcf50('0x56')]=_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x56')];_0x14febc['port']=_0x5bf0c2['Smtp'][_0xcf50('0x57')];_0x14febc[_0xcf50('0x58')]=_0x5bf0c2[_0xcf50('0x53')]['secure'];if(_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x59')]){_0x14febc[_0xcf50('0x5a')]={'user':_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x5b')],'pass':_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x5c')]};}}else{_0x14febc[_0xcf50('0x55')]=_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x55')];_0x14febc['auth']={'user':_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x5b')],'pass':_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x5c')]};_0x14febc['secure']=_0x5bf0c2[_0xcf50('0x53')][_0xcf50('0x58')];}if(_0x15336c['body']['attachments']&&_0x15336c['body'][_0xcf50('0x5d')][_0xcf50('0x5e')]){for(var _0x5555b6=0x0;_0x5555b6<_0x15336c[_0xcf50('0x47')][_0xcf50('0x5d')]['length'];_0x5555b6+=0x1){_0x15336c['body'][_0xcf50('0x5d')][_0x5555b6]={'filename':_0x15336c[_0xcf50('0x47')][_0xcf50('0x5d')][_0x5555b6][_0xcf50('0x2c')],'path':path['join'](config[_0xcf50('0x5f')],_0xcf50('0x60'),_0x15336c[_0xcf50('0x47')]['attachments'][_0x5555b6][_0xcf50('0x61')])};}}_0x10fabe={'account':_0x14febc,'message':_0x15336c[_0xcf50('0x47')]};return;}})[_0xcf50('0x14')](function(){if(_0x5bf0c2['List']){if(_0x5bf0c2[_0xcf50('0x4e')][_0xcf50('0x50')][_0xcf50('0x5e')]){return _0x5bf0c2[_0xcf50('0x4e')][_0xcf50('0x50')][0x0];}else{return db[_0xcf50('0x4f')][_0xcf50('0x49')](_[_0xcf50('0x62')](_0x15336c[_0xcf50('0x47')],{'firstName':_0x15336c['body']['to'],'email':_0x15336c[_0xcf50('0x47')]['to'],'phone':_0x15336c[_0xcf50('0x47')]['to'],'ListId':_0x5bf0c2[_0xcf50('0x63')]}));}}else{throw new Error(_0xcf50('0x64'));}})[_0xcf50('0x14')](function(){if(_0x10fabe){return respondWithRpcPromise(_0xcf50('0x65'),_0xcf50('0x66'),_0x10fabe,client9003)['then'](function(_0x1331bd){return _0xa66d00[_0xcf50('0x27')]({'read':!![],'messageId':_0x1331bd[_0xcf50('0x67')],'sentAt':moment()[_0xcf50('0x68')](_0xcf50('0x69'))});})['catch'](function(_0x34d916){logger[_0xcf50('0x19')]('%s',JSON['stringify'](_0x34d916));return _0xa66d00;});}return _0xa66d00;});}return _0xa66d00;}})[_0xcf50('0x14')](respondWithResult(_0x508626,0xc9))['catch'](handleError(_0x508626,null));};exports[_0xcf50('0x6a')]=function(_0x4efb16,_0x5cf6bb){var _0x22ddea={'agent':{},'channel':'mail'};if(_0x4efb16['body']['id']){delete _0x4efb16[_0xcf50('0x47')]['id'];}_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6b')]=!![];_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6c')]=moment()['format'](_0xcf50('0x69'));_0x4efb16['body'][_0xcf50('0x6d')]=_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6d')]||_0x4efb16[_0xcf50('0x5b')]['id'];_0x22ddea[_0xcf50('0x6e')]['id']=_0x4efb16['body'][_0xcf50('0x6d')];return db[_0xcf50('0x2e')]['find']({'where':{'id':_0x4efb16[_0xcf50('0x44')]['id'],'UserId':null}})[_0xcf50('0x14')](handleEntityNotFound(_0x5cf6bb,null))[_0xcf50('0x14')](saveUpdates(_0x4efb16[_0xcf50('0x47')],null))['then'](function(_0x5559b1){if(_0x5559b1){_0x22ddea[_0xcf50('0x1c')]=_0x5559b1[_0xcf50('0x6f')]({'plain':!![]});return db['MailInteraction'][_0xcf50('0x46')]({'where':{'id':_0x5559b1['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5cf6bb,null))['then'](function(_0x2699d1){if(_0x2699d1){return _0x2699d1[_0xcf50('0x27')]({'UserId':_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6d')],'read1stAt':_[_0xcf50('0x54')](_0x2699d1['read1stAt'])?moment()['format'](_0xcf50('0x69')):undefined});}return null;})[_0xcf50('0x14')](function(_0x1355bc){if(_0x1355bc){_0x22ddea[_0xcf50('0x70')]=_0x1355bc[_0xcf50('0x6f')]({'plain':!![]});interaction_log[_0xcf50('0x15')](_0xcf50('0x71'),_0x4efb16[_0xcf50('0x5b')]['id'],_0x4efb16[_0xcf50('0x5b')][_0xcf50('0x2c')],_0x4efb16[_0xcf50('0x5b')]['role'],_0x22ddea[_0xcf50('0x70')]['id'],_0x4efb16[_0xcf50('0x47')]?JSON['stringify'](_0x4efb16[_0xcf50('0x47')]):_0xcf50('0x72'));return respondWithRpcPromise(_0xcf50('0x73'),'acceptMessage',_0x22ddea);}return null;})[_0xcf50('0x14')](function(_0x336fde){var _0x51e6c8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x336fde['message'][_0xcf50('0x74')];return db[_0xcf50('0x75')][_0xcf50('0x33')](_0x51e6c8,{'type':db[_0xcf50('0x76')][_0xcf50('0x77')][_0xcf50('0x78')],'raw':!![]})['then'](function(_0x3e4681){return _0x3e4681;});})[_0xcf50('0x14')](function(_0x4b7b25){if(_0x4b7b25){_0x22ddea[_0xcf50('0x1c')][_0xcf50('0x79')]=_0x4b7b25[0x0];if(!_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6d')])return;return db[_0xcf50('0x7a')]['find']({'where':{'id':_0x4efb16[_0xcf50('0x47')][_0xcf50('0x6d')],'role':_0xcf50('0x6e')},'attributes':['id','name',_0xcf50('0x7b'),'email',_0xcf50('0x7c')],'raw':!![]});}return null;})[_0xcf50('0x14')](function(_0x7c9d16){if(!_0x7c9d16)return null;_0x22ddea['message'][_0xcf50('0x6e')]=_0x7c9d16;return _0x22ddea;})['then'](function(_0x2a5328){if(_0x2a5328){if(_0x4efb16[_0xcf50('0x47')][_0xcf50('0x7d')]){_0x22ddea['message']['interface']=util[_0xcf50('0x68')](_0xcf50('0x7e'),_0x4efb16['user'][_0xcf50('0x2c')]);_0x22ddea['message'][_0xcf50('0x7f')]=_0x22ddea[_0xcf50('0x7f')];_0x22ddea[_0xcf50('0x1c')][_0xcf50('0x80')]=_0x22ddea[_0xcf50('0x7f')];_0x22ddea[_0xcf50('0x1c')]['event']='accept';_0x22ddea[_0xcf50('0x1c')][_0xcf50('0x47')]=htmlToText[_0xcf50('0x81')](_0x22ddea[_0xcf50('0x1c')]['body']);return respondWithRpcPromise('EventManager',_0xcf50('0x82'),{'event':_0xcf50('0x83'),'message':_0x22ddea[_0xcf50('0x1c')]},client9002)['then'](function(){return _0x22ddea;});}return _0x22ddea;}return null;})[_0xcf50('0x14')](respondWithResult(_0x5cf6bb,null))[_0xcf50('0x1e')](handleError(_0x5cf6bb,null));};exports['reject']=function(_0x483e16,_0x1fd8da){var _0x1fe9d2={'agent':{},'channel':_0xcf50('0x84')};if(_0x483e16[_0xcf50('0x47')]['id']){delete _0x483e16[_0xcf50('0x47')]['id'];}_0x483e16[_0xcf50('0x47')]['UserId']=_0x483e16['body']['UserId']||_0x483e16[_0xcf50('0x5b')]['id'];_0x1fe9d2['agent']['id']=_0x483e16[_0xcf50('0x47')][_0xcf50('0x6d')];return db[_0xcf50('0x2e')][_0xcf50('0x46')]({'where':{'id':_0x483e16[_0xcf50('0x44')]['id'],'UserId':null}})[_0xcf50('0x14')](handleEntityNotFound(_0x1fd8da,null))[_0xcf50('0x14')](function(_0x496d5f){if(_0x496d5f){_0x1fe9d2[_0xcf50('0x1c')]=_0x496d5f['get']({'plain':!![]});return db['MailInteraction'][_0xcf50('0x46')]({'where':{'id':_0x496d5f['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1fd8da,null))['then'](function(_0x48dc9f){if(_0x48dc9f){_0x1fe9d2['interaction']=_0x48dc9f[_0xcf50('0x6f')]({'plain':!![]});interaction_log[_0xcf50('0x15')](_0xcf50('0x85'),_0x483e16['user']['id'],_0x483e16['user'][_0xcf50('0x2c')],_0x483e16['user'][_0xcf50('0x86')],_0x1fe9d2['interaction']['id'],_0x483e16['body']?JSON[_0xcf50('0x87')](_0x483e16[_0xcf50('0x47')]):'null');return respondWithRpcPromise(_0xcf50('0x88'),_0xcf50('0x89'),_0x1fe9d2);}return null;})[_0xcf50('0x14')](function(_0x1511fd){var _0x5a67d5=_0xcf50('0x8a')+_0x1511fd[_0xcf50('0x1c')]['ContactId'];return db[_0xcf50('0x75')][_0xcf50('0x33')](_0x5a67d5,{'type':db['Sequelize'][_0xcf50('0x77')][_0xcf50('0x78')],'raw':!![]})[_0xcf50('0x14')](function(_0x35daae){return _0x35daae;});})[_0xcf50('0x14')](function(_0x262dfc){if(_0x262dfc){_0x1fe9d2['message']['contact']=_0x262dfc[0x0];if(!_0x483e16[_0xcf50('0x47')][_0xcf50('0x6d')])return;return db['User'][_0xcf50('0x46')]({'where':{'id':_0x483e16['body'][_0xcf50('0x6d')],'role':_0xcf50('0x6e')},'attributes':['id',_0xcf50('0x2c'),_0xcf50('0x7b'),_0xcf50('0x8b'),_0xcf50('0x7c')],'raw':!![]});}return null;})[_0xcf50('0x14')](function(_0xbe20c6){if(!_0xbe20c6)return null;_0x1fe9d2[_0xcf50('0x1c')]['agent']=_0xbe20c6;return _0x1fe9d2;})['then'](function(_0x1f000b){if(_0x1f000b){_0x1f000b[_0xcf50('0x1c')][_0xcf50('0x8c')]=util[_0xcf50('0x68')]('SIP/%s',_0x483e16[_0xcf50('0x5b')]['name']);_0x1f000b[_0xcf50('0x1c')][_0xcf50('0x7f')]=_0x1fe9d2[_0xcf50('0x7f')];_0x1f000b[_0xcf50('0x1c')]['motionChannel']=_0x1fe9d2[_0xcf50('0x7f')];_0x1f000b[_0xcf50('0x1c')]['event']='reject';_0x1f000b['message']['body']=htmlToText[_0xcf50('0x81')](_0x1fe9d2[_0xcf50('0x1c')][_0xcf50('0x47')]);respondWithRpcPromise(_0xcf50('0x82'),_0xcf50('0x82'),{'event':_0xcf50('0x8d'),'message':_0x1f000b[_0xcf50('0x1c')]},client9002);return _0x1fe9d2;}return null;})[_0xcf50('0x14')](respondWithResult(_0x1fd8da,null))[_0xcf50('0x1e')](handleError(_0x1fd8da,null));};exports[_0xcf50('0x8e')]=function(_0x31b037,_0x2ca541){var _0x14d0e4=moment()['unix']()[_0xcf50('0x8f')]();var _0x1fe91d=path[_0xcf50('0x90')](config[_0xcf50('0x5f')],_0xcf50('0x91'),_0xcf50('0x92'),_0xcf50('0x93'));var _0x2bdbba=path[_0xcf50('0x90')](config[_0xcf50('0x5f')],_0xcf50('0x91'),_0xcf50('0x92'),'attachments');var _0x12a21e=util[_0xcf50('0x68')](_0xcf50('0x94'),_0x14d0e4);return db[_0xcf50('0x2e')][_0xcf50('0x46')]({'where':{'id':_0x31b037[_0xcf50('0x44')]['id']},'attributes':['id','body',_0xcf50('0x95'),'to','cc','bcc',_0xcf50('0x96'),'createdAt'],'include':_0x31b037[_0xcf50('0x33')][_0xcf50('0x5d')]?[{'model':db['Attachment'],'as':_0xcf50('0x97')}]:undefined})[_0xcf50('0x14')](handleEntityNotFound(_0x2ca541,null))['then'](function(_0x44b7ae){if(_0x44b7ae){var _0x1d2bed=_0x44b7ae;var _0x59f9d8={'from':_0x1d2bed['from'],'to':_0x1d2bed['to'],'subject':_0x1d2bed[_0xcf50('0x96')],'html':htmlEntities[_0xcf50('0x98')](_0x1d2bed[_0xcf50('0x47')]),'headers':{'Date':moment(_0x1d2bed['createdAt'])[_0xcf50('0x68')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x44b7ae['cc']){_0x59f9d8[_0xcf50('0x99')]['Cc']=_0x44b7ae['cc'];}if(_0x44b7ae['bcc']){_0x59f9d8[_0xcf50('0x99')][_0xcf50('0x9a')]=_0x44b7ae[_0xcf50('0x9b')];}return new BPromise(function(_0x4ef8d4,_0x583270){if(_0x44b7ae[_0xcf50('0x97')]){for(var _0x2b4bf3=0x0;_0x2b4bf3<_0x44b7ae[_0xcf50('0x97')]['length'];_0x2b4bf3++){var _0x29ed66=_0x44b7ae['Attachments'][_0x2b4bf3];var _0x5b6eae=path[_0xcf50('0x90')](_0x2bdbba,_0x29ed66[_0xcf50('0x61')]);if(fs['existsSync'](_0x5b6eae)){_0x59f9d8[_0xcf50('0x5d')][_0xcf50('0x9c')]({'name':_0x29ed66[_0xcf50('0x2c')],'contentType':_0x29ed66[_0xcf50('0x31')],'data':fs[_0xcf50('0x9d')](_0x5b6eae)});}}}emlformat[_0xcf50('0x9e')](_0x59f9d8,function(_0xca4065,_0x802892){if(_0xca4065)return _0x583270(_0xca4065);fs[_0xcf50('0x9f')](path['join'](_0x1fe91d,_0x12a21e),_0x802892);return _0x4ef8d4(_0x802892);});});}})[_0xcf50('0x14')](function(_0x3660b0){if(_0x3660b0){return _0x2ca541[_0xcf50('0x8e')](path[_0xcf50('0x90')](_0x1fe91d,_0x12a21e),_0x12a21e,function(_0x3897ac){if(!_0x3897ac)fs[_0xcf50('0xa0')](path[_0xcf50('0x90')](_0x1fe91d,_0x12a21e));});}})[_0xcf50('0x1e')](handleError(_0x2ca541,null));}; \ No newline at end of file +var _0x765c=['../../config/environment','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','json','offset','undefined','limit','count','set','Content-Range','destroy','name','status','send','index','MailMessage','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','body','params','describe','create','direction','secret','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','root','server/files/attachments','basename','List','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','internal','interface','SIP/%s','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util','path','html-to-text','../../components/parsers/qs','../../config/logger'];(function(_0x23851a,_0x3e9466){var _0x54ecc8=function(_0x69eb84){while(--_0x69eb84){_0x23851a['push'](_0x23851a['shift']());}};_0x54ecc8(++_0x3e9466);}(_0x765c,0x96));var _0xc765=function(_0x41fff1,_0x2db613){_0x41fff1=_0x41fff1-0x0;var _0x2cc318=_0x765c[_0x41fff1];return _0x2cc318;};'use strict';var emlformat=require(_0xc765('0x0'));var moment=require(_0xc765('0x1'));var BPromise=require('bluebird');var util=require(_0xc765('0x2'));var path=require(_0xc765('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xc765('0x4'));var qs=require(_0xc765('0x5'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xc765('0x6'))('mail-interactions');var config=require(_0xc765('0x7'));var db=require('../../mysqldb')['db'];config[_0xc765('0x8')]=_[_0xc765('0x9')](config[_0xc765('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc765('0xa'))(new Redis(config[_0xc765('0x8')]));var htmlEntities=require(_0xc765('0xb'));require(_0xc765('0xc'))[_0xc765('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc765('0xe')][_0xc765('0xf')]({'port':0x232c});var client9003=jayson[_0xc765('0xe')][_0xc765('0xf')]({'port':0x232b});var client9002=jayson[_0xc765('0xe')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1649df,_0xd97114,_0x40312c,_0x506401){return new BPromise(function(_0x487d19,_0x35db33){var _0x5e426f=_0x506401||client;return _0x5e426f[_0xc765('0x10')](_0x1649df,_0x40312c)[_0xc765('0x11')](function(_0x1ff838){logger[_0xc765('0x12')](_0xc765('0x13'),_0xd97114,_0xc765('0x14'));logger['debug'](_0xc765('0x15'),_0xd97114,_0xc765('0x14'),JSON['stringify'](_0x1ff838));if(_0x1ff838[_0xc765('0x16')]){if(_0x1ff838[_0xc765('0x16')]['code']===0x1f4){logger[_0xc765('0x16')]('MailMessage,\x20%s,\x20%s',_0xd97114,_0x1ff838[_0xc765('0x16')][_0xc765('0x17')]);return _0x35db33(_0x1ff838[_0xc765('0x16')][_0xc765('0x17')]);}logger[_0xc765('0x16')](_0xc765('0x13'),_0xd97114,_0x1ff838[_0xc765('0x16')][_0xc765('0x17')]);return _0x487d19(_0x1ff838[_0xc765('0x16')][_0xc765('0x17')]);}else{logger[_0xc765('0x12')](_0xc765('0x13'),_0xd97114,_0xc765('0x14'));_0x487d19(_0x1ff838[_0xc765('0x18')][_0xc765('0x17')]);}})['catch'](function(_0x39756f){logger['error'](_0xc765('0x13'),_0xd97114,_0x39756f);_0x35db33(_0x39756f);});});}function respondWithResult(_0x46c550,_0x3ba6e0){_0x3ba6e0=_0x3ba6e0||0xc8;return function(_0x3e1a08){if(_0x3e1a08){return _0x46c550['status'](_0x3ba6e0)[_0xc765('0x19')](_0x3e1a08);}};}function respondWithFilteredResult(_0x1a1892,_0x2d2b43){return function(_0x5382f9){if(_0x5382f9){var _0xdd47e0=typeof _0x2d2b43[_0xc765('0x1a')]===_0xc765('0x1b')&&typeof _0x2d2b43[_0xc765('0x1c')]===_0xc765('0x1b');var _0x41a89d=_0x5382f9['count'];var _0x3b36ad=_0xdd47e0?0x0:_0x2d2b43[_0xc765('0x1a')];var _0x22ee02=_0xdd47e0?_0x5382f9[_0xc765('0x1d')]:_0x2d2b43['offset']+_0x2d2b43[_0xc765('0x1c')];var _0x1a1def;if(_0x22ee02>=_0x41a89d){_0x22ee02=_0x41a89d;_0x1a1def=0xc8;}else{_0x1a1def=0xce;}_0x1a1892['status'](_0x1a1def);return _0x1a1892[_0xc765('0x1e')](_0xc765('0x1f'),_0x3b36ad+'-'+_0x22ee02+'/'+_0x41a89d)['json'](_0x5382f9);}return null;};}function saveUpdates(_0x31d739){return function(_0x2a4c80){if(_0x2a4c80){return _0x2a4c80['update'](_0x31d739)[_0xc765('0x11')](function(_0x297952){return _0x297952;});}return null;};}function removeEntity(_0x162fd6){return function(_0x57db1c){if(_0x57db1c){return _0x57db1c[_0xc765('0x20')]()[_0xc765('0x11')](function(){_0x162fd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5346fe){return function(_0x26b63d){if(!_0x26b63d){_0x5346fe['sendStatus'](0x194);}return _0x26b63d;};}function handleError(_0xdf1777,_0x34f649){_0x34f649=_0x34f649||0x1f4;return function(_0x4f2de){logger[_0xc765('0x16')](_0x4f2de['stack']);if(_0x4f2de[_0xc765('0x21')]){delete _0x4f2de[_0xc765('0x21')];}_0xdf1777[_0xc765('0x22')](_0x34f649)[_0xc765('0x23')](_0x4f2de);};}exports[_0xc765('0x24')]=function(_0x4acdb1,_0x42262d){var _0xb502fc={},_0x2e9c07={},_0x163f97={'count':0x0,'rows':[]};var _0x199ed6=_['map'](db[_0xc765('0x25')]['rawAttributes'],function(_0x1f20c1){return{'name':_0x1f20c1['fieldName'],'type':_0x1f20c1[_0xc765('0x26')]['key']};});_0x2e9c07[_0xc765('0x27')]=_['map'](_0x199ed6,_0xc765('0x21'));_0x2e9c07['query']=_[_0xc765('0x28')](_0x4acdb1[_0xc765('0x29')]);_0x2e9c07['filters']=_[_0xc765('0x2a')](_0x2e9c07[_0xc765('0x27')],_0x2e9c07[_0xc765('0x29')]);_0xb502fc[_0xc765('0x2b')]=_['intersection'](_0x2e9c07[_0xc765('0x27')],qs[_0xc765('0x2c')](_0x4acdb1[_0xc765('0x29')][_0xc765('0x2c')]));_0xb502fc[_0xc765('0x2b')]=_0xb502fc[_0xc765('0x2b')]['length']?_0xb502fc['attributes']:_0x2e9c07[_0xc765('0x27')];if(!_0x4acdb1[_0xc765('0x29')][_0xc765('0x2d')](_0xc765('0x2e'))){_0xb502fc[_0xc765('0x1c')]=qs['limit'](_0x4acdb1[_0xc765('0x29')]['limit']);_0xb502fc['offset']=qs[_0xc765('0x1a')](_0x4acdb1[_0xc765('0x29')][_0xc765('0x1a')]);}_0xb502fc[_0xc765('0x2f')]=qs[_0xc765('0x30')](_0x4acdb1[_0xc765('0x29')][_0xc765('0x30')]);_0xb502fc[_0xc765('0x31')]=qs[_0xc765('0x32')](_['pick'](_0x4acdb1[_0xc765('0x29')],_0x2e9c07[_0xc765('0x32')]),_0x199ed6);if(_0x4acdb1['query'][_0xc765('0x33')]){_0xb502fc[_0xc765('0x31')]=_[_0xc765('0x34')](_0xb502fc[_0xc765('0x31')],{'$or':_['map'](_0x199ed6,function(_0x27a3eb){if(_0x27a3eb['type']!==_0xc765('0x35')){var _0x2d6a1e={};_0x2d6a1e[_0x27a3eb['name']]={'$like':'%'+_0x4acdb1[_0xc765('0x29')]['filter']+'%'};return _0x2d6a1e;}})});}_0xb502fc=_[_0xc765('0x34')]({},_0xb502fc,_0x4acdb1[_0xc765('0x36')]);var _0x35b283={'where':_0xb502fc[_0xc765('0x31')]};return db[_0xc765('0x25')][_0xc765('0x1d')](_0x35b283)[_0xc765('0x11')](function(_0x318683){_0x163f97[_0xc765('0x1d')]=_0x318683;if(_0x4acdb1[_0xc765('0x29')][_0xc765('0x37')]){_0xb502fc['include']=[{'all':!![]}];}return db[_0xc765('0x25')][_0xc765('0x38')](_0xb502fc);})[_0xc765('0x11')](function(_0x2380d3){_0x163f97[_0xc765('0x39')]=_0x2380d3;return _0x163f97;})[_0xc765('0x11')](respondWithFilteredResult(_0x42262d,_0xb502fc))[_0xc765('0x3a')](handleError(_0x42262d,null));};exports[_0xc765('0x3b')]=function(_0x1c22ba,_0x5c2cb7){var _0x14d6a0={'raw':!![],'where':{'id':_0x1c22ba['params']['id']}},_0x54b2fe={};_0x54b2fe['model']=_[_0xc765('0x28')](db[_0xc765('0x25')][_0xc765('0x3c')]);_0x54b2fe[_0xc765('0x29')]=_['keys'](_0x1c22ba[_0xc765('0x29')]);_0x54b2fe[_0xc765('0x32')]=_['intersection'](_0x54b2fe['model'],_0x54b2fe[_0xc765('0x29')]);_0x14d6a0[_0xc765('0x2b')]=_[_0xc765('0x2a')](_0x54b2fe[_0xc765('0x27')],qs[_0xc765('0x2c')](_0x1c22ba['query']['fields']));_0x14d6a0['attributes']=_0x14d6a0[_0xc765('0x2b')][_0xc765('0x3d')]?_0x14d6a0[_0xc765('0x2b')]:_0x54b2fe[_0xc765('0x27')];if(_0x1c22ba[_0xc765('0x29')][_0xc765('0x37')]){_0x14d6a0[_0xc765('0x3e')]=[{'all':!![]}];}_0x14d6a0=_[_0xc765('0x34')]({},_0x14d6a0,_0x1c22ba['options']);return db[_0xc765('0x25')][_0xc765('0x3f')](_0x14d6a0)[_0xc765('0x11')](handleEntityNotFound(_0x5c2cb7,null))[_0xc765('0x11')](respondWithResult(_0x5c2cb7,null))['catch'](handleError(_0x5c2cb7,null));};exports['update']=function(_0x2ecb21,_0xbf6f5){if(_0x2ecb21[_0xc765('0x40')]['id']){delete _0x2ecb21['body']['id'];}return db[_0xc765('0x25')][_0xc765('0x3f')]({'where':{'id':_0x2ecb21['params']['id']}})[_0xc765('0x11')](handleEntityNotFound(_0xbf6f5,null))[_0xc765('0x11')](saveUpdates(_0x2ecb21['body'],null))[_0xc765('0x11')](respondWithResult(_0xbf6f5,null))[_0xc765('0x3a')](handleError(_0xbf6f5,null));};exports[_0xc765('0x20')]=function(_0x2f8d87,_0x356eae){return db['MailMessage'][_0xc765('0x3f')]({'where':{'id':_0x2f8d87[_0xc765('0x41')]['id']}})[_0xc765('0x11')](handleEntityNotFound(_0x356eae,null))[_0xc765('0x11')](removeEntity(_0x356eae,null))[_0xc765('0x3a')](handleError(_0x356eae,null));};exports['describe']=function(_0x33476d,_0x3ec3a7){return db[_0xc765('0x25')][_0xc765('0x42')]()['then'](respondWithResult(_0x3ec3a7,null))['catch'](handleError(_0x3ec3a7,null));};exports[_0xc765('0x43')]=function(_0x58f578,_0x1ebe0f){return db['MailMessage'][_0xc765('0x43')](_0x58f578[_0xc765('0x40')])[_0xc765('0x11')](function(_0x348307){if(_0x348307){if(_0x348307[_0xc765('0x44')]==='out'&&!_0x348307[_0xc765('0x45')]){var _0x2a1123,_0x412e36,_0x1fa00d;if(_0x58f578[_0xc765('0x40')]['to']){_0x412e36=_0x58f578['body']['to']['split'](',')[0x0];}return db[_0xc765('0x46')]['findOne']({'where':{'id':_0x348307[_0xc765('0x47')]},'include':[{'model':db[_0xc765('0x48')],'as':'List','include':[{'model':db[_0xc765('0x49')],'as':_0xc765('0x4a'),'where':{'email':_0x412e36},'limit':0x1,'order':[[_0xc765('0x4b'),_0xc765('0x4c')]]}]},{'model':db['MailServerOut'],'as':_0xc765('0x4d'),'raw':!![]}]})[_0xc765('0x11')](function(_0x191e0b){_0x2a1123=_0x191e0b;if(_0x2a1123&&_0x2a1123[_0xc765('0x4d')]){var _0x57391a={'tls':{'rejectUnauthorized':![]}};if(_[_0xc765('0x4e')](_0x2a1123['Smtp'][_0xc765('0x4f')])){_0x57391a[_0xc765('0x50')]=_0x2a1123[_0xc765('0x4d')]['host'];_0x57391a[_0xc765('0x51')]=_0x2a1123[_0xc765('0x4d')][_0xc765('0x51')];_0x57391a['secure']=_0x2a1123[_0xc765('0x4d')][_0xc765('0x52')];if(_0x2a1123['Smtp'][_0xc765('0x53')]){_0x57391a[_0xc765('0x54')]={'user':_0x2a1123[_0xc765('0x4d')]['user'],'pass':_0x2a1123[_0xc765('0x4d')][_0xc765('0x55')]};}}else{_0x57391a[_0xc765('0x4f')]=_0x2a1123[_0xc765('0x4d')][_0xc765('0x4f')];_0x57391a[_0xc765('0x54')]={'user':_0x2a1123[_0xc765('0x4d')][_0xc765('0x56')],'pass':_0x2a1123[_0xc765('0x4d')][_0xc765('0x55')]};_0x57391a['secure']=_0x2a1123['Smtp']['secure'];}if(_0x58f578[_0xc765('0x40')][_0xc765('0x57')]&&_0x58f578[_0xc765('0x40')][_0xc765('0x57')]['length']){for(var _0x526efc=0x0;_0x526efc<_0x58f578[_0xc765('0x40')]['attachments'][_0xc765('0x3d')];_0x526efc+=0x1){_0x58f578[_0xc765('0x40')][_0xc765('0x57')][_0x526efc]={'filename':_0x58f578[_0xc765('0x40')][_0xc765('0x57')][_0x526efc]['name'],'path':path['join'](config[_0xc765('0x58')],_0xc765('0x59'),_0x58f578[_0xc765('0x40')][_0xc765('0x57')][_0x526efc][_0xc765('0x5a')])};}}_0x1fa00d={'account':_0x57391a,'message':_0x58f578[_0xc765('0x40')]};return;}})['then'](function(){if(_0x2a1123['List']){if(_0x2a1123[_0xc765('0x5b')][_0xc765('0x4a')][_0xc765('0x3d')]){return _0x2a1123[_0xc765('0x5b')]['Contacts'][0x0];}else{return db[_0xc765('0x49')]['create'](_[_0xc765('0x9')](_0x58f578['body'],{'firstName':_0x58f578['body']['to'],'email':_0x58f578[_0xc765('0x40')]['to'],'phone':_0x58f578['body']['to'],'ListId':_0x2a1123['ListId']}));}}else{throw new Error(_0xc765('0x5c'));}})[_0xc765('0x11')](function(){if(_0x1fa00d){return respondWithRpcPromise('SendMail',_0xc765('0x5d'),_0x1fa00d,client9003)[_0xc765('0x11')](function(_0x87a660){return _0x348307['update']({'read':!![],'messageId':_0x87a660[_0xc765('0x5e')],'sentAt':moment()[_0xc765('0x5f')](_0xc765('0x60'))});})[_0xc765('0x3a')](function(_0x2a2f73){logger['error']('%s',JSON[_0xc765('0x61')](_0x2a2f73));return _0x348307;});}return _0x348307;});}return _0x348307;}})[_0xc765('0x11')](respondWithResult(_0x1ebe0f,0xc9))[_0xc765('0x3a')](handleError(_0x1ebe0f,null));};exports[_0xc765('0x62')]=function(_0x3a4c78,_0xe47c7f){var _0x3e7dc9={'agent':{},'channel':'mail'};if(_0x3a4c78[_0xc765('0x40')]['id']){delete _0x3a4c78[_0xc765('0x40')]['id'];}_0x3a4c78['body'][_0xc765('0x63')]=!![];_0x3a4c78[_0xc765('0x40')][_0xc765('0x64')]=moment()['format'](_0xc765('0x60'));_0x3a4c78['body']['UserId']=_0x3a4c78[_0xc765('0x40')][_0xc765('0x65')]||_0x3a4c78['user']['id'];_0x3e7dc9['agent']['id']=_0x3a4c78[_0xc765('0x40')][_0xc765('0x65')];return db[_0xc765('0x25')][_0xc765('0x3f')]({'where':{'id':_0x3a4c78[_0xc765('0x41')]['id'],'UserId':null}})[_0xc765('0x11')](handleEntityNotFound(_0xe47c7f,null))[_0xc765('0x11')](saveUpdates(_0x3a4c78['body'],null))[_0xc765('0x11')](function(_0x518714){if(_0x518714){_0x3e7dc9[_0xc765('0x17')]=_0x518714[_0xc765('0x66')]({'plain':!![]});return db['MailInteraction'][_0xc765('0x3f')]({'where':{'id':_0x518714[_0xc765('0x67')]}});}return null;})[_0xc765('0x11')](handleEntityNotFound(_0xe47c7f,null))[_0xc765('0x11')](function(_0x5c06d3){if(_0x5c06d3){return _0x5c06d3['update']({'UserId':_0x3a4c78['body']['UserId'],'read1stAt':_[_0xc765('0x4e')](_0x5c06d3[_0xc765('0x68')])?moment()[_0xc765('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc765('0x11')](function(_0x2dc9a4){if(_0x2dc9a4){_0x3e7dc9[_0xc765('0x69')]=_0x2dc9a4['get']({'plain':!![]});interaction_log[_0xc765('0x12')](_0xc765('0x6a'),_0x3a4c78[_0xc765('0x56')]['id'],_0x3a4c78[_0xc765('0x56')][_0xc765('0x21')],_0x3a4c78['user'][_0xc765('0x6b')],_0x3e7dc9[_0xc765('0x69')]['id'],_0x3a4c78[_0xc765('0x40')]?JSON[_0xc765('0x61')](_0x3a4c78['body']):_0xc765('0x6c'));return respondWithRpcPromise(_0xc765('0x6d'),_0xc765('0x6e'),_0x3e7dc9);}return null;})[_0xc765('0x11')](function(_0xc3c628){var _0x422ac4=_0xc765('0x6f')+_0xc3c628[_0xc765('0x17')][_0xc765('0x70')];return db['sequelize'][_0xc765('0x29')](_0x422ac4,{'type':db[_0xc765('0x71')][_0xc765('0x72')][_0xc765('0x73')],'raw':!![]})[_0xc765('0x11')](function(_0x4dad57){return _0x4dad57;});})[_0xc765('0x11')](function(_0x21e4fa){if(_0x21e4fa){_0x3e7dc9[_0xc765('0x17')][_0xc765('0x74')]=_0x21e4fa[0x0];if(!_0x3a4c78[_0xc765('0x40')][_0xc765('0x65')])return;return db['User'][_0xc765('0x3f')]({'where':{'id':_0x3a4c78[_0xc765('0x40')][_0xc765('0x65')],'role':_0xc765('0x75')},'attributes':['id',_0xc765('0x21'),_0xc765('0x76'),_0xc765('0x77'),'internal'],'raw':!![]});}return null;})[_0xc765('0x11')](function(_0x3e822f){if(!_0x3e822f)return null;_0x3e7dc9[_0xc765('0x17')][_0xc765('0x75')]=_0x3e822f;return _0x3e7dc9;})['then'](function(_0x2d8e90){if(_0x2d8e90){if(_0x3a4c78[_0xc765('0x40')][_0xc765('0x78')]){_0x3e7dc9[_0xc765('0x17')]['interface']=util['format']('SIP/%s',_0x3a4c78['user'][_0xc765('0x21')]);_0x3e7dc9[_0xc765('0x17')][_0xc765('0x79')]=_0x3e7dc9[_0xc765('0x79')];_0x3e7dc9[_0xc765('0x17')][_0xc765('0x7a')]=_0x3e7dc9['channel'];_0x3e7dc9[_0xc765('0x17')][_0xc765('0x7b')]=_0xc765('0x62');_0x3e7dc9[_0xc765('0x17')][_0xc765('0x40')]=htmlToText['fromString'](_0x3e7dc9[_0xc765('0x17')][_0xc765('0x40')]);return respondWithRpcPromise(_0xc765('0x7c'),_0xc765('0x7c'),{'event':_0xc765('0x7d'),'message':_0x3e7dc9['message']},client9002)[_0xc765('0x11')](function(){return _0x3e7dc9;});}return _0x3e7dc9;}return null;})[_0xc765('0x11')](respondWithResult(_0xe47c7f,null))['catch'](handleError(_0xe47c7f,null));};exports[_0xc765('0x7e')]=function(_0xd420d3,_0x969036){var _0x585918={'agent':{},'channel':_0xc765('0x7f')};if(_0xd420d3[_0xc765('0x40')]['id']){delete _0xd420d3['body']['id'];}_0xd420d3['body'][_0xc765('0x65')]=_0xd420d3['body'][_0xc765('0x65')]||_0xd420d3[_0xc765('0x56')]['id'];_0x585918[_0xc765('0x75')]['id']=_0xd420d3[_0xc765('0x40')]['UserId'];return db[_0xc765('0x25')][_0xc765('0x3f')]({'where':{'id':_0xd420d3[_0xc765('0x41')]['id'],'UserId':null}})[_0xc765('0x11')](handleEntityNotFound(_0x969036,null))[_0xc765('0x11')](function(_0x31ef2c){if(_0x31ef2c){_0x585918[_0xc765('0x17')]=_0x31ef2c['get']({'plain':!![]});return db[_0xc765('0x80')][_0xc765('0x3f')]({'where':{'id':_0x31ef2c[_0xc765('0x67')]}});}return null;})[_0xc765('0x11')](handleEntityNotFound(_0x969036,null))['then'](function(_0x248acb){if(_0x248acb){_0x585918[_0xc765('0x69')]=_0x248acb[_0xc765('0x66')]({'plain':!![]});interaction_log['info'](_0xc765('0x81'),_0xd420d3[_0xc765('0x56')]['id'],_0xd420d3[_0xc765('0x56')][_0xc765('0x21')],_0xd420d3['user'][_0xc765('0x6b')],_0x585918['interaction']['id'],_0xd420d3[_0xc765('0x40')]?JSON[_0xc765('0x61')](_0xd420d3[_0xc765('0x40')]):_0xc765('0x6c'));return respondWithRpcPromise(_0xc765('0x82'),_0xc765('0x83'),_0x585918);}return null;})[_0xc765('0x11')](function(_0xb4cc24){var _0xa603f0=_0xc765('0x6f')+_0xb4cc24[_0xc765('0x17')]['ContactId'];return db[_0xc765('0x84')][_0xc765('0x29')](_0xa603f0,{'type':db[_0xc765('0x71')][_0xc765('0x72')][_0xc765('0x73')],'raw':!![]})[_0xc765('0x11')](function(_0x2da379){return _0x2da379;});})['then'](function(_0x218a55){if(_0x218a55){_0x585918[_0xc765('0x17')]['contact']=_0x218a55[0x0];if(!_0xd420d3[_0xc765('0x40')][_0xc765('0x65')])return;return db['User']['find']({'where':{'id':_0xd420d3[_0xc765('0x40')][_0xc765('0x65')],'role':_0xc765('0x75')},'attributes':['id','name',_0xc765('0x76'),_0xc765('0x77'),_0xc765('0x85')],'raw':!![]});}return null;})[_0xc765('0x11')](function(_0x352446){if(!_0x352446)return null;_0x585918[_0xc765('0x17')][_0xc765('0x75')]=_0x352446;return _0x585918;})[_0xc765('0x11')](function(_0x196a85){if(_0x196a85){_0x196a85['message'][_0xc765('0x86')]=util['format'](_0xc765('0x87'),_0xd420d3[_0xc765('0x56')][_0xc765('0x21')]);_0x196a85['message']['channel']=_0x585918[_0xc765('0x79')];_0x196a85[_0xc765('0x17')][_0xc765('0x7a')]=_0x585918[_0xc765('0x79')];_0x196a85[_0xc765('0x17')][_0xc765('0x7b')]=_0xc765('0x7e');_0x196a85[_0xc765('0x17')]['body']=htmlToText['fromString'](_0x585918[_0xc765('0x17')][_0xc765('0x40')]);respondWithRpcPromise('EventManager',_0xc765('0x7c'),{'event':'rejectmessage','message':_0x196a85[_0xc765('0x17')]},client9002);return _0x585918;}return null;})[_0xc765('0x11')](respondWithResult(_0x969036,null))[_0xc765('0x3a')](handleError(_0x969036,null));};exports[_0xc765('0x88')]=function(_0x555ebe,_0x66e056){var _0x5e1908=moment()[_0xc765('0x89')]()[_0xc765('0x8a')]();var _0x1b1abd=path[_0xc765('0x8b')](config['root'],_0xc765('0x8c'),_0xc765('0x8d'),_0xc765('0x8e'));var _0x13f658=path[_0xc765('0x8b')](config[_0xc765('0x58')],_0xc765('0x8c'),_0xc765('0x8d'),_0xc765('0x57'));var _0x3bb15a=util['format'](_0xc765('0x8f'),_0x5e1908);return db['MailMessage'][_0xc765('0x3f')]({'where':{'id':_0x555ebe[_0xc765('0x41')]['id']},'attributes':['id','body',_0xc765('0x90'),'to','cc',_0xc765('0x91'),_0xc765('0x92'),'createdAt'],'include':_0x555ebe[_0xc765('0x29')][_0xc765('0x57')]?[{'model':db[_0xc765('0x93')],'as':_0xc765('0x94')}]:undefined})['then'](handleEntityNotFound(_0x66e056,null))['then'](function(_0xd738e1){if(_0xd738e1){var _0x41e60e=_0xd738e1;var _0x23a01a={'from':_0x41e60e[_0xc765('0x90')],'to':_0x41e60e['to'],'subject':_0x41e60e[_0xc765('0x92')],'html':htmlEntities[_0xc765('0x95')](_0x41e60e['body']),'headers':{'Date':moment(_0x41e60e['createdAt'])[_0xc765('0x5f')](_0xc765('0x96'))},'attachments':[]};if(_0xd738e1['cc']){_0x23a01a[_0xc765('0x97')]['Cc']=_0xd738e1['cc'];}if(_0xd738e1['bcc']){_0x23a01a[_0xc765('0x97')][_0xc765('0x98')]=_0xd738e1[_0xc765('0x91')];}return new BPromise(function(_0x32db8d,_0x18c3ae){if(_0xd738e1[_0xc765('0x94')]){for(var _0x55281d=0x0;_0x55281d<_0xd738e1[_0xc765('0x94')]['length'];_0x55281d++){var _0x276e4b=_0xd738e1[_0xc765('0x94')][_0x55281d];var _0x5dfa60=path[_0xc765('0x8b')](_0x13f658,_0x276e4b[_0xc765('0x5a')]);if(fs['existsSync'](_0x5dfa60)){_0x23a01a[_0xc765('0x57')]['push']({'name':_0x276e4b[_0xc765('0x21')],'contentType':_0x276e4b[_0xc765('0x26')],'data':fs[_0xc765('0x99')](_0x5dfa60)});}}}emlformat[_0xc765('0x9a')](_0x23a01a,function(_0x1a0f84,_0x562e01){if(_0x1a0f84)return _0x18c3ae(_0x1a0f84);fs[_0xc765('0x9b')](path[_0xc765('0x8b')](_0x1b1abd,_0x3bb15a),_0x562e01);return _0x32db8d(_0x562e01);});});}})['then'](function(_0x574331){if(_0x574331){return _0x66e056['download'](path[_0xc765('0x8b')](_0x1b1abd,_0x3bb15a),_0x3bb15a,function(_0x2a151c){if(!_0x2a151c)fs[_0xc765('0x9c')](path[_0xc765('0x8b')](_0x1b1abd,_0x3bb15a));});}})['catch'](handleError(_0x66e056,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 6503f14..aa889a9 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 _0x19ed=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x115b0a,_0x5c5982){var _0x4421de=function(_0x144f05){while(--_0x144f05){_0x115b0a['push'](_0x115b0a['shift']());}};_0x4421de(++_0x5c5982);}(_0x19ed,0x1df));var _0xd19e=function(_0x5c920d,_0x4b12ca){_0x5c920d=_0x5c920d-0x0;var _0x35e4ad=_0x19ed[_0x5c920d];return _0x35e4ad;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xd19e('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd19e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd19e('0x2')};function emitEvent(_0x10aa01){return function(_0x2dfb79,_0x3b3aa6,_0x580f0a){MailMessageEvents[_0xd19e('0x3')](_0x10aa01+':'+_0x2dfb79['id'],_0x2dfb79);MailMessageEvents[_0xd19e('0x3')](_0x10aa01,_0x2dfb79);_0x580f0a(null);};}for(var e in events){if(events[_0xd19e('0x4')](e)){var event=events[e];MailMessage[_0xd19e('0x5')](e,emitEvent(event));}}module[_0xd19e('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xb6f2=['MailMessage','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x13cc3b,_0x11dd51){var _0x90fd94=function(_0x4a07f0){while(--_0x4a07f0){_0x13cc3b['push'](_0x13cc3b['shift']());}};_0x90fd94(++_0x11dd51);}(_0xb6f2,0x19d));var _0x2b6f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb6f2[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0x2b6f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x2b6f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2b6f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x139dbd){return function(_0xf41dc8,_0x42c64c,_0x499c4a){MailMessageEvents[_0x2b6f('0x3')](_0x139dbd+':'+_0xf41dc8['id'],_0xf41dc8);MailMessageEvents[_0x2b6f('0x3')](_0x139dbd,_0xf41dc8);_0x499c4a(null);};}for(var e in events){if(events[_0x2b6f('0x4')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x2b6f('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 56a608e..fb6376b 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 _0xc006=['out','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','direction','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','fromString','body','toLowerCase'];(function(_0x1a0330,_0x3ff9f5){var _0x472141=function(_0x2e1e76){while(--_0x2e1e76){_0x1a0330['push'](_0x1a0330['shift']());}};_0x472141(++_0x3ff9f5);}(_0xc006,0x1bd));var _0x6c00=function(_0x478708,_0x816b6c){_0x478708=_0x478708-0x0;var _0x5c4bf0=_0xc006[_0x478708];return _0x5c4bf0;};'use strict';var _=require(_0x6c00('0x0'));var util=require(_0x6c00('0x1'));var logger=require(_0x6c00('0x2'))('api');var moment=require(_0x6c00('0x3'));var BPromise=require(_0x6c00('0x4'));var rp=require('request-promise');var htmlToText=require(_0x6c00('0x5'));var fs=require('fs');var path=require(_0x6c00('0x6'));var rimraf=require(_0x6c00('0x7'));var config=require(_0x6c00('0x8'));var attributes=require(_0x6c00('0x9'));module[_0x6c00('0xa')]=function(_0x47ff09,_0x5e1dd0){return _0x47ff09[_0x6c00('0xb')](_0x6c00('0xc'),attributes,{'tableName':_0x6c00('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x6c00('0xe'),'fields':[_0x6c00('0xf'),_0x6c00('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x598e4c,_0x1b0e48,_0x5a15a8){if(_0x598e4c['body']){_0x598e4c[_0x6c00('0xf')]=htmlToText[_0x6c00('0x11')](_0x598e4c[_0x6c00('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5a15a8(null,_0x1b0e48);},'afterCreate':function(_0x17ab58,_0x27736d,_0x1e1d21){var _0x574f52=_0x47ff09['models'];var _0x121481=_0x17ab58['get']({'plain':!![]});if(_0x121481['direction'][_0x6c00('0x13')]()==='in'||_0x121481['direction']['toLowerCase']()===_0x6c00('0x14')&&!_0x121481['secret']&&!_[_0x6c00('0x15')](_0x121481['UserId'])){_0x574f52[_0x6c00('0x16')][_0x6c00('0x17')]({'where':{'id':_0x121481[_0x6c00('0x18')]}})[_0x6c00('0x19')](function(_0x4c5961){if(_0x4c5961){_0x4c5961[_0x6c00('0x1a')]({'lastMsgAt':_0x121481[_0x6c00('0x1b')],'lastMsgDirection':_0x121481[_0x6c00('0x1c')][_0x6c00('0x13')]()});}})[_0x6c00('0x1d')](function(_0x128492){console['error'](_0x128492);});}_0x1e1d21();}},'charset':'utf8mb4','collate':_0x6c00('0x1e')});}; \ No newline at end of file +var _0xa1c5=['html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1bb56a,_0x58ea09){var _0x2f70ca=function(_0x4a1f1c){while(--_0x4a1f1c){_0x1bb56a['push'](_0x1bb56a['shift']());}};_0x2f70ca(++_0x58ea09);}(_0xa1c5,0x13e));var _0x5a1c=function(_0xdeb776,_0x40a245){_0xdeb776=_0xdeb776-0x0;var _0x50e950=_0xa1c5[_0xdeb776];return _0x50e950;};'use strict';var _=require(_0x5a1c('0x0'));var util=require(_0x5a1c('0x1'));var logger=require(_0x5a1c('0x2'))(_0x5a1c('0x3'));var moment=require(_0x5a1c('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a1c('0x5'));var htmlToText=require(_0x5a1c('0x6'));var fs=require('fs');var path=require(_0x5a1c('0x7'));var rimraf=require(_0x5a1c('0x8'));var config=require(_0x5a1c('0x9'));var attributes=require('./mailMessage.attributes');module[_0x5a1c('0xa')]=function(_0x41ea54,_0x2b9df1){return _0x41ea54[_0x5a1c('0xb')](_0x5a1c('0xc'),attributes,{'tableName':_0x5a1c('0xd'),'paranoid':![],'indexes':[{'name':_0x5a1c('0xe'),'fields':['messageId']},{'name':_0x5a1c('0xf'),'fields':[_0x5a1c('0x10'),_0x5a1c('0x11')],'type':_0x5a1c('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41b6a8,_0x186a03,_0xd98de6){if(_0x41b6a8[_0x5a1c('0x13')]){_0x41b6a8['plainBody']=htmlToText[_0x5a1c('0x14')](_0x41b6a8['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xd98de6(null,_0x186a03);},'afterCreate':function(_0x1432a0,_0x4feb61,_0x306ae2){var _0x13e4af=_0x41ea54[_0x5a1c('0x15')];var _0xe6df7c=_0x1432a0[_0x5a1c('0x16')]({'plain':!![]});if(_0xe6df7c[_0x5a1c('0x17')][_0x5a1c('0x18')]()==='in'||_0xe6df7c['direction'][_0x5a1c('0x18')]()==='out'&&!_0xe6df7c[_0x5a1c('0x19')]&&!_[_0x5a1c('0x1a')](_0xe6df7c[_0x5a1c('0x1b')])){_0x13e4af[_0x5a1c('0x1c')]['findOne']({'where':{'id':_0xe6df7c[_0x5a1c('0x1d')]}})[_0x5a1c('0x1e')](function(_0x4fb29e){if(_0x4fb29e){_0x4fb29e[_0x5a1c('0x1f')]({'lastMsgAt':_0xe6df7c[_0x5a1c('0x20')],'lastMsgDirection':_0xe6df7c[_0x5a1c('0x17')]['toLowerCase']()});}})[_0x5a1c('0x21')](function(_0x1ba377){console['error'](_0x1ba377);});}_0x306ae2();}},'charset':_0x5a1c('0x22'),'collate':_0x5a1c('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b74b768..6342f05 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 _0xd914=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash'];(function(_0x64bfc4,_0x46d7fe){var _0x4f6d04=function(_0x4db4bd){while(--_0x4db4bd){_0x64bfc4['push'](_0x64bfc4['shift']());}};_0x4f6d04(++_0x46d7fe);}(_0xd914,0x17f));var _0x4d91=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0xd914[_0x290fa6];return _0x47f1f3;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});config[_0x4d91('0xb')]=_[_0x4d91('0xc')](config[_0x4d91('0xb')],{'host':_0x4d91('0xd'),'port':0x18eb});var socket=require(_0x4d91('0xe'))(new Redis(config[_0x4d91('0xb')]));require('./mailMessage.socket')[_0x4d91('0xf')](socket);function respondWithRpcPromise(_0xa4bb25,_0xc07c64,_0x278648){return new BPromise(function(_0xb234d2,_0x266b31){return client['request'](_0xa4bb25,_0x278648)['then'](function(_0x2ccd08){logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));logger[_0x4d91('0x13')](_0x4d91('0x14'),_0xc07c64,'request\x20sent',JSON['stringify'](_0x2ccd08));if(_0x2ccd08[_0x4d91('0x15')]){if(_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x16')]===0x1f4){logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0x266b31(_0x2ccd08['error'][_0x4d91('0x17')]);}logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0xb234d2(_0x2ccd08['error'][_0x4d91('0x17')]);}else{logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));_0xb234d2(_0x2ccd08['result'][_0x4d91('0x17')]);}})[_0x4d91('0x18')](function(_0x13254c){logger['error'](_0x4d91('0x11'),_0xc07c64,_0x13254c);_0x266b31(_0x13254c);});});}exports[_0x4d91('0x19')]=function(_0x351388){var _0xd59fe=this;return new Promise(function(_0x10b767,_0x40cde4){return db[_0x4d91('0x1a')][_0x4d91('0x1b')](_0x351388[_0x4d91('0x1c')],{'raw':_0x351388[_0x4d91('0x1d')]?_0x351388['options'][_0x4d91('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x57913e){logger[_0x4d91('0x10')](_0x4d91('0x19'),_0x351388);logger[_0x4d91('0x13')](_0x4d91('0x19'),_0x351388,JSON[_0x4d91('0x1f')](_0x57913e));_0x10b767(_0x57913e);})[_0x4d91('0x18')](function(_0x100cd4){logger[_0x4d91('0x15')]('CreateMailMessage',_0x100cd4['message'],_0x351388);_0x40cde4(_0xd59fe[_0x4d91('0x15')](0x1f4,_0x100cd4[_0x4d91('0x17')]));});});}; \ No newline at end of file +var _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xb9be,0xc5));var _0xeb9b=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb9be[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 039ce7f..57f1276 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 _0x2c81=['./mailMessage.events','save','removeListener','length','mailMessage:'];(function(_0x25368b,_0x7cf3e1){var _0x5ec93f=function(_0x27a231){while(--_0x27a231){_0x25368b['push'](_0x25368b['shift']());}};_0x5ec93f(++_0x7cf3e1);}(_0x2c81,0x1d1));var _0x12c8=function(_0x3e0f9c,_0x54fc51){_0x3e0f9c=_0x3e0f9c-0x0;var _0x15a0b5=_0x2c81[_0x3e0f9c];return _0x15a0b5;};'use strict';var MailMessageEvents=require(_0x12c8('0x0'));var events=[_0x12c8('0x1'),'remove','update'];function createListener(_0x12d152,_0x512e60){return function(_0x70bdcf){_0x512e60['emit'](_0x12d152,_0x70bdcf);};}function removeListener(_0x43c1d2,_0x3cfb77){return function(){MailMessageEvents[_0x12c8('0x2')](_0x43c1d2,_0x3cfb77);};}exports['register']=function(_0x3177cf){for(var _0x450e8a=0x0,_0xcf5ec4=events[_0x12c8('0x3')];_0x450e8a<_0xcf5ec4;_0x450e8a++){var _0x3f3588=events[_0x450e8a];var _0x188aa6=createListener(_0x12c8('0x4')+_0x3f3588,_0x3177cf);MailMessageEvents['on'](_0x3f3588,_0x188aa6);}}; \ No newline at end of file +var _0xeb79=['removeListener','register','mailMessage:','remove'];(function(_0x599fa4,_0x36a365){var _0x342fd3=function(_0x1ebb6b){while(--_0x1ebb6b){_0x599fa4['push'](_0x599fa4['shift']());}};_0x342fd3(++_0x36a365);}(_0xeb79,0x87));var _0x9eb7=function(_0x149b9,_0x85803e){_0x149b9=_0x149b9-0x0;var _0x111a7e=_0xeb79[_0x149b9];return _0x111a7e;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x9eb7('0x0'),'update'];function createListener(_0x265160,_0x5cfb76){return function(_0x20a493){_0x5cfb76['emit'](_0x265160,_0x20a493);};}function removeListener(_0x3ee5c6,_0x2987e1){return function(){MailMessageEvents[_0x9eb7('0x1')](_0x3ee5c6,_0x2987e1);};}exports[_0x9eb7('0x2')]=function(_0x58bc03){for(var _0x501d0c=0x0,_0xaa486a=events['length'];_0x501d0c<_0xaa486a;_0x501d0c++){var _0x152a72=events[_0x501d0c];var _0x127fb9=createListener(_0x9eb7('0x3')+_0x152a72,_0x58bc03);MailMessageEvents['on'](_0x152a72,_0x127fb9);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index d210d4d..f86f200 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 _0x36f7=['/:id/teams','addTeams','addAgents','update','destroy','removeTeams','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post'];(function(_0x3868e4,_0x1149b0){var _0x4c77f1=function(_0x2afa93){while(--_0x2afa93){_0x3868e4['push'](_0x3868e4['shift']());}};_0x4c77f1(++_0x1149b0);}(_0x36f7,0x18f));var _0x736f=function(_0x144b50,_0x597960){_0x144b50=_0x144b50-0x0;var _0x90f20b=_0x36f7[_0x144b50];return _0x90f20b;};'use strict';var multer=require(_0x736f('0x0'));var util=require(_0x736f('0x1'));var path=require('path');var timeout=require(_0x736f('0x2'));var express=require(_0x736f('0x3'));var router=express[_0x736f('0x4')]();var fs_extra=require(_0x736f('0x5'));var auth=require(_0x736f('0x6'));var interaction=require(_0x736f('0x7'));var config=require('../../config/environment');var controller=require(_0x736f('0x8'));router['get']('/',auth[_0x736f('0x9')](),controller[_0x736f('0xa')]);router[_0x736f('0xb')](_0x736f('0xc'),auth[_0x736f('0x9')](),controller[_0x736f('0xd')]);router[_0x736f('0xb')](_0x736f('0xe'),auth['isAuthenticated'](),controller[_0x736f('0xf')]);router[_0x736f('0xb')](_0x736f('0x10'),auth[_0x736f('0x9')](),controller[_0x736f('0x11')]);router[_0x736f('0xb')]('/:id/teams',auth[_0x736f('0x9')](),controller[_0x736f('0x12')]);router[_0x736f('0xb')](_0x736f('0x13'),auth[_0x736f('0x9')](),controller['getAgents']);router[_0x736f('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x736f('0x14')](_0x736f('0x15'),auth[_0x736f('0x9')](),controller[_0x736f('0x16')]);router[_0x736f('0x14')](_0x736f('0x13'),auth[_0x736f('0x9')](),controller[_0x736f('0x17')]);router['put'](_0x736f('0xe'),auth[_0x736f('0x9')](),controller[_0x736f('0x18')]);router['delete'](_0x736f('0xe'),auth[_0x736f('0x9')](),controller[_0x736f('0x19')]);router['delete']('/:id/teams',auth[_0x736f('0x9')](),controller[_0x736f('0x1a')]);router[_0x736f('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x95e2=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','index','get','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','/:id','delete'];(function(_0x4af766,_0x3294c0){var _0x137dac=function(_0x520f79){while(--_0x520f79){_0x4af766['push'](_0x4af766['shift']());}};_0x137dac(++_0x3294c0);}(_0x95e2,0x9d));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x295e('0x0'));var util=require(_0x295e('0x1'));var path=require(_0x295e('0x2'));var timeout=require(_0x295e('0x3'));var express=require(_0x295e('0x4'));var router=express[_0x295e('0x5')]();var fs_extra=require(_0x295e('0x6'));var auth=require(_0x295e('0x7'));var interaction=require(_0x295e('0x8'));var config=require(_0x295e('0x9'));var controller=require(_0x295e('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x295e('0xb')]);router[_0x295e('0xc')]('/describe',auth[_0x295e('0xd')](),controller[_0x295e('0xe')]);router['get']('/:id',auth[_0x295e('0xd')](),controller[_0x295e('0xf')]);router[_0x295e('0xc')](_0x295e('0x10'),auth[_0x295e('0xd')](),controller[_0x295e('0x11')]);router[_0x295e('0xc')](_0x295e('0x12'),auth[_0x295e('0xd')](),controller['getTeams']);router[_0x295e('0xc')](_0x295e('0x13'),auth[_0x295e('0xd')](),controller[_0x295e('0x14')]);router[_0x295e('0x15')]('/',auth[_0x295e('0xd')](),controller[_0x295e('0x16')]);router[_0x295e('0x15')](_0x295e('0x12'),auth[_0x295e('0xd')](),controller[_0x295e('0x17')]);router[_0x295e('0x15')]('/:id/users',auth[_0x295e('0xd')](),controller[_0x295e('0x18')]);router[_0x295e('0x19')]('/:id',auth[_0x295e('0xd')](),controller[_0x295e('0x1a')]);router['delete'](_0x295e('0x1b'),auth[_0x295e('0xd')](),controller['destroy']);router[_0x295e('0x1c')](_0x295e('0x12'),auth[_0x295e('0xd')](),controller['removeTeams']);router[_0x295e('0x1c')](_0x295e('0x13'),auth['isAuthenticated'](),controller[_0x295e('0x1d')]);module[_0x295e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index a086f24..543bff3 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 _0x6631=['name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x1301b0,_0x46eb10){var _0x1300fa=function(_0x439162){while(--_0x439162){_0x1301b0['push'](_0x1301b0['shift']());}};_0x1300fa(++_0x46eb10);}(_0x6631,0x66));var _0x1663=function(_0x4beb67,_0x5c290a){_0x4beb67=_0x4beb67-0x0;var _0x3f5d70=_0x6631[_0x4beb67];return _0x3f5d70;};'use strict';var Sequelize=require(_0x1663('0x0'));module[_0x1663('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1663('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1663('0x3')]},'timeout':{'type':Sequelize[_0x1663('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1663('0x5')](_0x1663('0x6'),_0x1663('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x7977=['name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x1a4782,_0x4f05eb){var _0x58acd5=function(_0x586472){while(--_0x586472){_0x1a4782['push'](_0x1a4782['shift']());}};_0x58acd5(++_0x4f05eb);}(_0x7977,0x9d));var _0x7797=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x7977[_0x1460f6];return _0x46ce94;};'use strict';var Sequelize=require(_0x7797('0x0'));module[_0x7797('0x1')]={'name':{'type':Sequelize[_0x7797('0x2')],'unique':_0x7797('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7797('0x2')]},'timeout':{'type':Sequelize[_0x7797('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7797('0x5')]('rrmemory',_0x7797('0x6'),_0x7797('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index fe42d8a..8258d93 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 _0xc116=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./mailQueue.socket','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index','map','MailQueue','type','key','model','keys','intersection','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x27a399,_0x4f9e3c){var _0x41991a=function(_0x3d5184){while(--_0x3d5184){_0x27a399['push'](_0x27a399['shift']());}};_0x41991a(++_0x4f9e3c);}(_0xc116,0x164));var _0x6c11=function(_0x5de43a,_0xc3ce09){_0x5de43a=_0x5de43a-0x0;var _0x124fed=_0xc116[_0x5de43a];return _0x124fed;};'use strict';var emlformat=require(_0x6c11('0x0'));var rimraf=require(_0x6c11('0x1'));var zipdir=require(_0x6c11('0x2'));var jsonpatch=require(_0x6c11('0x3'));var rp=require(_0x6c11('0x4'));var moment=require(_0x6c11('0x5'));var BPromise=require(_0x6c11('0x6'));var Mustache=require(_0x6c11('0x7'));var util=require('util');var path=require(_0x6c11('0x8'));var sox=require(_0x6c11('0x9'));var csv=require(_0x6c11('0xa'));var ejs=require(_0x6c11('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c11('0xc'));var squel=require(_0x6c11('0xd'));var crypto=require('crypto');var jsforce=require(_0x6c11('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c11('0xf'));var Papa=require(_0x6c11('0x10'));var Redis=require(_0x6c11('0x11'));var authService=require(_0x6c11('0x12'));var qs=require(_0x6c11('0x13'));var as=require(_0x6c11('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c11('0x15'))('api');var utils=require(_0x6c11('0x16'));var config=require(_0x6c11('0x17'));var licenseUtil=require(_0x6c11('0x18'));var db=require('../../mysqldb')['db'];config[_0x6c11('0x19')]=_[_0x6c11('0x1a')](config[_0x6c11('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c11('0x19')]));require(_0x6c11('0x1b'))['register'](socket);function respondWithStatusCode(_0x460afb,_0x401ee0){_0x401ee0=_0x401ee0||0xcc;return function(_0x355f9d){if(_0x355f9d){return _0x460afb[_0x6c11('0x1c')](_0x401ee0);}return _0x460afb['status'](_0x401ee0)['end']();};}function respondWithResult(_0x2a70ea,_0x2bf7bc){_0x2bf7bc=_0x2bf7bc||0xc8;return function(_0x1cb5c3){if(_0x1cb5c3){return _0x2a70ea['status'](_0x2bf7bc)['json'](_0x1cb5c3);}};}function respondWithFilteredResult(_0x3c9d0f,_0x27ddd9){return function(_0x53f629){if(_0x53f629){var _0x33be46=typeof _0x27ddd9[_0x6c11('0x1d')]===_0x6c11('0x1e')&&typeof _0x27ddd9[_0x6c11('0x1f')]===_0x6c11('0x1e');var _0x4747e5=_0x53f629[_0x6c11('0x20')];var _0x41ff73=_0x33be46?0x0:_0x27ddd9['offset'];var _0x146d4c=_0x33be46?_0x53f629['count']:_0x27ddd9[_0x6c11('0x1d')]+_0x27ddd9['limit'];var _0x55c894;if(_0x146d4c>=_0x4747e5){_0x146d4c=_0x4747e5;_0x55c894=0xc8;}else{_0x55c894=0xce;}_0x3c9d0f[_0x6c11('0x21')](_0x55c894);return _0x3c9d0f['set'](_0x6c11('0x22'),_0x41ff73+'-'+_0x146d4c+'/'+_0x4747e5)[_0x6c11('0x23')](_0x53f629);}return null;};}function patchUpdates(_0x4ea79e){return function(_0x49b15d){try{jsonpatch[_0x6c11('0x24')](_0x49b15d,_0x4ea79e,!![]);}catch(_0x4d3aa3){return BPromise[_0x6c11('0x25')](_0x4d3aa3);}return _0x49b15d[_0x6c11('0x26')]();};}function saveUpdates(_0x5066a1,_0x4d4fb5){return function(_0x123b30){if(_0x123b30){return _0x123b30[_0x6c11('0x27')](_0x5066a1)[_0x6c11('0x28')](function(_0x43e954){return _0x43e954;});}return null;};}function removeEntity(_0x9fddec,_0x39b29d){return function(_0x42b491){if(_0x42b491){return _0x42b491[_0x6c11('0x29')]()[_0x6c11('0x28')](function(){var _0x125976=_0x42b491[_0x6c11('0x2a')]({'plain':!![]});var _0x249058='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x249058,'resourceId':_0x125976['id']}})[_0x6c11('0x28')](function(){return _0x42b491;});})[_0x6c11('0x28')](function(){_0x9fddec['status'](0xcc)[_0x6c11('0x2b')]();});}};}function handleEntityNotFound(_0x2e7330,_0x1504c3){return function(_0x3a22de){if(!_0x3a22de){_0x2e7330[_0x6c11('0x1c')](0x194);}return _0x3a22de;};}function handleError(_0x255318,_0x1e175d){_0x1e175d=_0x1e175d||0x1f4;return function(_0x2d261d){logger[_0x6c11('0x2c')](_0x2d261d[_0x6c11('0x2d')]);if(_0x2d261d[_0x6c11('0x2e')]){delete _0x2d261d[_0x6c11('0x2e')];}_0x255318[_0x6c11('0x21')](_0x1e175d)[_0x6c11('0x2f')](_0x2d261d);};}exports[_0x6c11('0x30')]=function(_0x24cc12,_0x1f0ae6){var _0x215c0c={},_0x4643a2={},_0x139406={'count':0x0,'rows':[]};var _0x174ccf=_[_0x6c11('0x31')](db[_0x6c11('0x32')]['rawAttributes'],function(_0x5bee56){return{'name':_0x5bee56['fieldName'],'type':_0x5bee56[_0x6c11('0x33')][_0x6c11('0x34')]};});_0x4643a2[_0x6c11('0x35')]=_[_0x6c11('0x31')](_0x174ccf,'name');_0x4643a2['query']=_[_0x6c11('0x36')](_0x24cc12['query']);_0x4643a2['filters']=_[_0x6c11('0x37')](_0x4643a2[_0x6c11('0x35')],_0x4643a2[_0x6c11('0x38')]);_0x215c0c[_0x6c11('0x39')]=_[_0x6c11('0x37')](_0x4643a2['model'],qs[_0x6c11('0x3a')](_0x24cc12[_0x6c11('0x38')][_0x6c11('0x3a')]));_0x215c0c[_0x6c11('0x39')]=_0x215c0c[_0x6c11('0x39')]['length']?_0x215c0c[_0x6c11('0x39')]:_0x4643a2['model'];if(!_0x24cc12['query']['hasOwnProperty'](_0x6c11('0x3b'))){_0x215c0c[_0x6c11('0x1f')]=qs[_0x6c11('0x1f')](_0x24cc12[_0x6c11('0x38')][_0x6c11('0x1f')]);_0x215c0c['offset']=qs[_0x6c11('0x1d')](_0x24cc12[_0x6c11('0x38')]['offset']);}_0x215c0c[_0x6c11('0x3c')]=qs[_0x6c11('0x3d')](_0x24cc12['query']['sort']);_0x215c0c[_0x6c11('0x3e')]=qs[_0x6c11('0x3f')](_[_0x6c11('0x40')](_0x24cc12[_0x6c11('0x38')],_0x4643a2['filters']),_0x174ccf);if(_0x24cc12['query'][_0x6c11('0x41')]){_0x215c0c[_0x6c11('0x3e')]=_[_0x6c11('0x42')](_0x215c0c['where'],{'$or':_[_0x6c11('0x31')](_0x174ccf,function(_0x5c5f81){if(_0x5c5f81[_0x6c11('0x33')]!=='VIRTUAL'){var _0x329854={};_0x329854[_0x5c5f81['name']]={'$like':'%'+_0x24cc12['query'][_0x6c11('0x41')]+'%'};return _0x329854;}})});}_0x215c0c=_[_0x6c11('0x42')]({},_0x215c0c,_0x24cc12[_0x6c11('0x43')]);var _0x221cfa={'where':_0x215c0c[_0x6c11('0x3e')]};return db[_0x6c11('0x32')][_0x6c11('0x20')](_0x221cfa)[_0x6c11('0x28')](function(_0xa5fed1){_0x139406[_0x6c11('0x20')]=_0xa5fed1;if(_0x24cc12[_0x6c11('0x38')][_0x6c11('0x44')]){_0x215c0c[_0x6c11('0x45')]=[{'all':!![]}];}return db[_0x6c11('0x32')][_0x6c11('0x46')](_0x215c0c);})['then'](function(_0x364d8b){_0x139406[_0x6c11('0x47')]=_0x364d8b;return _0x139406;})[_0x6c11('0x28')](respondWithFilteredResult(_0x1f0ae6,_0x215c0c))[_0x6c11('0x48')](handleError(_0x1f0ae6,null));};exports[_0x6c11('0x49')]=function(_0x177cb2,_0x4eabf5){var _0x4c3b89={'raw':!![],'where':{'id':_0x177cb2[_0x6c11('0x4a')]['id']}},_0x1ef39f={};_0x1ef39f[_0x6c11('0x35')]=_[_0x6c11('0x36')](db[_0x6c11('0x32')][_0x6c11('0x4b')]);_0x1ef39f[_0x6c11('0x38')]=_['keys'](_0x177cb2[_0x6c11('0x38')]);_0x1ef39f[_0x6c11('0x3f')]=_[_0x6c11('0x37')](_0x1ef39f['model'],_0x1ef39f['query']);_0x4c3b89['attributes']=_['intersection'](_0x1ef39f[_0x6c11('0x35')],qs[_0x6c11('0x3a')](_0x177cb2[_0x6c11('0x38')]['fields']));_0x4c3b89[_0x6c11('0x39')]=_0x4c3b89[_0x6c11('0x39')][_0x6c11('0x4c')]?_0x4c3b89[_0x6c11('0x39')]:_0x1ef39f[_0x6c11('0x35')];if(_0x177cb2[_0x6c11('0x38')]['includeAll']){_0x4c3b89['include']=[{'all':!![]}];}_0x4c3b89=_[_0x6c11('0x42')]({},_0x4c3b89,_0x177cb2['options']);return db[_0x6c11('0x32')][_0x6c11('0x4d')](_0x4c3b89)[_0x6c11('0x28')](handleEntityNotFound(_0x4eabf5,null))['then'](respondWithResult(_0x4eabf5,null))[_0x6c11('0x48')](handleError(_0x4eabf5,null));};exports[_0x6c11('0x4e')]=function(_0x3ce928,_0x46db12){return db[_0x6c11('0x32')][_0x6c11('0x4e')](_0x3ce928[_0x6c11('0x4f')],{})['then'](function(_0x18d7e4){var _0x5cafea=_0x3ce928[_0x6c11('0x50')][_0x6c11('0x2a')]({'plain':!![]});if(!_0x5cafea)throw new Error(_0x6c11('0x51'));if(_0x5cafea['role']===_0x6c11('0x50')){var _0x56af70=_0x18d7e4[_0x6c11('0x2a')]({'plain':!![]});var _0x14df5a='MailQueues';return db[_0x6c11('0x52')]['find']({'where':{'name':_0x14df5a,'userProfileId':_0x5cafea[_0x6c11('0x53')]},'raw':!![]})['then'](function(_0x41f820){if(_0x41f820&&_0x41f820[_0x6c11('0x54')]===0x0){return db[_0x6c11('0x55')]['create']({'name':_0x56af70[_0x6c11('0x2e')],'resourceId':_0x56af70['id'],'type':_0x41f820['name'],'sectionId':_0x41f820['id']},{})[_0x6c11('0x28')](function(){return _0x18d7e4;});}else{return _0x18d7e4;}})['catch'](function(_0x58e4e8){logger[_0x6c11('0x2c')](_0x6c11('0x56'),_0x58e4e8);throw _0x58e4e8;});}return _0x18d7e4;})[_0x6c11('0x28')](respondWithResult(_0x46db12,0xc9))[_0x6c11('0x48')](handleError(_0x46db12,null));};exports[_0x6c11('0x27')]=function(_0xfc3b0b,_0x4bee6e){if(_0xfc3b0b[_0x6c11('0x4f')]['id']){delete _0xfc3b0b[_0x6c11('0x4f')]['id'];}return db[_0x6c11('0x32')][_0x6c11('0x4d')]({'where':{'id':_0xfc3b0b[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x4bee6e,null))[_0x6c11('0x28')](saveUpdates(_0xfc3b0b['body'],null))['then'](respondWithResult(_0x4bee6e,null))[_0x6c11('0x48')](handleError(_0x4bee6e,null));};exports['destroy']=function(_0xd80c2,_0x3ba5ae){return db[_0x6c11('0x32')][_0x6c11('0x4d')]({'where':{'id':_0xd80c2[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x3ba5ae,null))[_0x6c11('0x28')](removeEntity(_0x3ba5ae,null))[_0x6c11('0x48')](handleError(_0x3ba5ae,null));};exports[_0x6c11('0x57')]=function(_0x3dbf34,_0x5ee738){return db[_0x6c11('0x32')][_0x6c11('0x57')]()['then'](respondWithResult(_0x5ee738,null))['catch'](handleError(_0x5ee738,null));};exports[_0x6c11('0x58')]=function(_0x2fe6ed,_0x5aac27,_0x55755b){var _0x4b54be={'raw':!![],'where':{}},_0x3df84d={},_0x12b309;return db[_0x6c11('0x32')][_0x6c11('0x59')]({'where':{'id':_0x2fe6ed['params']['id']}})['then'](handleEntityNotFound(_0x5aac27,null))['then'](function(_0x43dd5e){if(_0x43dd5e){_0x12b309=_0x43dd5e[_0x6c11('0x2a')]({'plain':!![]});_0x3df84d[_0x6c11('0x35')]=_['keys'](db[_0x6c11('0x5a')][_0x6c11('0x4b')]);_0x3df84d[_0x6c11('0x38')]=_[_0x6c11('0x36')](_0x2fe6ed[_0x6c11('0x38')]);_0x3df84d[_0x6c11('0x3f')]=_[_0x6c11('0x37')](_0x3df84d[_0x6c11('0x35')],_0x3df84d[_0x6c11('0x38')]);_0x4b54be['attributes']=_[_0x6c11('0x37')](_0x3df84d[_0x6c11('0x35')],qs['fields'](_0x2fe6ed[_0x6c11('0x38')][_0x6c11('0x3a')]));_0x4b54be[_0x6c11('0x39')]=_0x4b54be[_0x6c11('0x39')][_0x6c11('0x4c')]?_0x4b54be['attributes']:_0x3df84d[_0x6c11('0x35')];if(!_0x2fe6ed[_0x6c11('0x38')][_0x6c11('0x5b')](_0x6c11('0x3b'))){_0x4b54be['limit']=qs[_0x6c11('0x1f')](_0x2fe6ed[_0x6c11('0x38')][_0x6c11('0x1f')]);_0x4b54be[_0x6c11('0x1d')]=qs[_0x6c11('0x1d')](_0x2fe6ed[_0x6c11('0x38')][_0x6c11('0x1d')]);}_0x4b54be['order']=qs[_0x6c11('0x3d')](_0x2fe6ed['query'][_0x6c11('0x3d')]);_0x4b54be[_0x6c11('0x3e')]=qs['filters'](_[_0x6c11('0x40')](_0x2fe6ed['query'],_0x3df84d[_0x6c11('0x3f')]));_0x4b54be[_0x6c11('0x3e')][_0x6c11('0x5c')]=_0x43dd5e['id'];if(_0x2fe6ed[_0x6c11('0x38')]['filter']){_0x4b54be[_0x6c11('0x3e')]=_[_0x6c11('0x42')](_0x4b54be[_0x6c11('0x3e')],{'$or':_[_0x6c11('0x31')](_0x4b54be[_0x6c11('0x39')],function(_0xd0aa2a){var _0x45d83d={};_0x45d83d[_0xd0aa2a]={'$like':'%'+_0x2fe6ed[_0x6c11('0x38')]['filter']+'%'};return _0x45d83d;})});}_0x4b54be=_[_0x6c11('0x42')]({},_0x4b54be,_0x2fe6ed['options']);return db[_0x6c11('0x5a')][_0x6c11('0x46')](_0x4b54be);}})['then'](function(_0x14a539){if(_0x14a539){return db[_0x6c11('0x5d')][_0x6c11('0x5e')]({'where':{'id':_[_0x6c11('0x31')](_0x14a539,_0x6c11('0x5f')),'role':'agent'},'attributes':['id','name','mailPause','updatedAt',_0x6c11('0x60')]});}})[_0x6c11('0x28')](function(_0x402b52){if(_0x402b52){return{'count':_0x402b52[_0x6c11('0x20')],'rows':_[_0x6c11('0x31')](_0x402b52[_0x6c11('0x47')],function(_0x58a503){return{'membername':_0x58a503['name'],'UserId':_0x58a503['id'],'queue_name':_0x12b309['name'],'MailQueueId':_0x12b309['id'],'interface':util['format'](_0x6c11('0x61'),_0x6c11('0x62'),_0x58a503[_0x6c11('0x2e')]),'penalty':0x0,'paused':_0x58a503[_0x6c11('0x63')],'createdAt':_0x58a503[_0x6c11('0x60')],'updatedAt':_0x58a503[_0x6c11('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6c11('0x28')](respondWithFilteredResult(_0x5aac27,_0x4b54be))[_0x6c11('0x48')](handleError(_0x5aac27,null));};exports[_0x6c11('0x65')]=function(_0x3c47cc,_0x441a75,_0x4da4c9){var _0x4b7696={};var _0x5dfddb={};var _0x476185;var _0x3fe105;return db[_0x6c11('0x32')][_0x6c11('0x59')]({'where':{'id':_0x3c47cc[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x441a75,null))[_0x6c11('0x28')](function(_0x1e685d){if(_0x1e685d){_0x476185=_0x1e685d;_0x5dfddb[_0x6c11('0x35')]=_[_0x6c11('0x36')](db[_0x6c11('0x66')]['rawAttributes']);_0x5dfddb[_0x6c11('0x38')]=_['keys'](_0x3c47cc[_0x6c11('0x38')]);_0x5dfddb[_0x6c11('0x3f')]=_['intersection'](_0x5dfddb['model'],_0x5dfddb[_0x6c11('0x38')]);_0x4b7696[_0x6c11('0x39')]=_[_0x6c11('0x37')](_0x5dfddb[_0x6c11('0x35')],qs[_0x6c11('0x3a')](_0x3c47cc[_0x6c11('0x38')][_0x6c11('0x3a')]));_0x4b7696[_0x6c11('0x39')]=_0x4b7696[_0x6c11('0x39')][_0x6c11('0x4c')]?_0x4b7696[_0x6c11('0x39')]:_0x5dfddb[_0x6c11('0x35')];_0x4b7696['order']=qs[_0x6c11('0x3d')](_0x3c47cc[_0x6c11('0x38')][_0x6c11('0x3d')]);_0x4b7696[_0x6c11('0x3e')]=qs[_0x6c11('0x3f')](_[_0x6c11('0x40')](_0x3c47cc[_0x6c11('0x38')],_0x5dfddb[_0x6c11('0x3f')]));if(_0x3c47cc[_0x6c11('0x38')][_0x6c11('0x41')]){_0x4b7696[_0x6c11('0x3e')]=_[_0x6c11('0x42')](_0x4b7696[_0x6c11('0x3e')],{'$or':_[_0x6c11('0x31')](_0x4b7696[_0x6c11('0x39')],function(_0x2868b5){var _0x5a24c2={};_0x5a24c2[_0x2868b5]={'$like':'%'+_0x3c47cc['query'][_0x6c11('0x41')]+'%'};return _0x5a24c2;})});}_0x4b7696=_['merge']({},_0x4b7696,_0x3c47cc[_0x6c11('0x43')]);return _0x476185['getTeams'](_0x4b7696);}})[_0x6c11('0x28')](function(_0x5641b8){if(_0x5641b8){_0x3fe105=_0x5641b8['length'];if(!_0x3c47cc['query'][_0x6c11('0x5b')](_0x6c11('0x3b'))){_0x4b7696[_0x6c11('0x1f')]=qs[_0x6c11('0x1f')](_0x3c47cc[_0x6c11('0x38')][_0x6c11('0x1f')]);_0x4b7696[_0x6c11('0x1d')]=qs['offset'](_0x3c47cc['query']['offset']);}return _0x476185[_0x6c11('0x65')](_0x4b7696);}})[_0x6c11('0x28')](function(_0x36e1b7){if(_0x36e1b7){return _0x36e1b7?{'count':_0x3fe105,'rows':_0x36e1b7}:null;}})['then'](respondWithResult(_0x441a75,null))[_0x6c11('0x48')](handleError(_0x441a75,null));};exports[_0x6c11('0x67')]=function(_0x41d696,_0x4cd775,_0x22319c){var _0x5a3e2b=_0x41d696[_0x6c11('0x4f')][_0x6c11('0x68')];return db['Team'][_0x6c11('0x46')]({'where':{'id':_0x5a3e2b},'attributes':['id'],'include':[{'model':db[_0x6c11('0x5d')],'as':_0x6c11('0x69'),'attributes':['id',_0x6c11('0x2e'),_0x6c11('0x6a'),_0x6c11('0x6b'),'interface'],'raw':!![]}]})[_0x6c11('0x28')](function(_0x9e1033){if(_0x9e1033){var _0x51ed27=_[_0x6c11('0x6c')](_0x9e1033,function(_0x226031){var _0x580b06=_0x226031[_0x6c11('0x2a')]({'plain':!![]});return _0x580b06['Agents'];});return db[_0x6c11('0x32')]['find']({'where':{'id':_0x41d696[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](function(_0x37cf8e){return db[_0x6c11('0x6d')][_0x6c11('0x6e')](function(_0x5088ae){return _0x37cf8e[_0x6c11('0x67')](_0x5a3e2b,{'transaction':_0x5088ae})['then'](function(){return BPromise[_0x6c11('0x6f')](_0x51ed27,function(_0xa86eed){return db[_0x6c11('0x5a')][_0x6c11('0x70')]({'where':{'UserId':_0xa86eed['id'],'MailQueueId':_0x41d696['params']['id']},'transaction':_0x5088ae});});})[_0x6c11('0x28')](function(){_0x51ed27[_0x6c11('0x71')](function(_0x548b91){socket['emit'](_0x6c11('0x72'),{'UserId':_0x548b91['id'],'MailQueueId':_0x37cf8e['id']});});});});});}})[_0x6c11('0x28')](respondWithStatusCode(_0x4cd775,null))[_0x6c11('0x48')](handleError(_0x4cd775,null));};exports['removeTeams']=function(_0x1c423b,_0x580e4f,_0x3bcc45){return db[_0x6c11('0x66')]['findAll']({'where':{'id':_0x1c423b[_0x6c11('0x38')][_0x6c11('0x68')]},'attributes':['id'],'include':[{'model':db[_0x6c11('0x5d')],'as':_0x6c11('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x580e4f,null))['then'](function(_0x2dab93){var _0x3097ed=_[_0x6c11('0x31')](_0x2dab93,'id');var _0x1999fe=[];var _0x411a61=[];var _0x5f2cf4=squel[_0x6c11('0x73')]();_0x5f2cf4[_0x6c11('0x74')](_0x6c11('0x75'))['from'](_0x6c11('0x76'),'tq')['join'](_0x6c11('0x77'),'ut',_0x6c11('0x78'))[_0x6c11('0x3e')](_0x6c11('0x79'),_0x1c423b['params']['id']);for(var _0x4b9a85=0x0;_0x4b9a85<_0x2dab93[_0x6c11('0x4c')];_0x4b9a85+=0x1){let _0x375c69=_0x2dab93[_0x4b9a85];for(var _0x595034=0x0;_0x595034<_0x375c69[_0x6c11('0x69')]['length'];_0x595034+=0x1){let _0x5f14c6=_0x375c69['Agents'][_0x595034];var _0x13127d=_0x5f2cf4[_0x6c11('0x7a')]();_0x13127d[_0x6c11('0x3e')](_0x6c11('0x7b'),_0x5f14c6['id']);_0x411a61[_0x6c11('0x7c')](db[_0x6c11('0x6d')][_0x6c11('0x38')](_0x13127d[_0x6c11('0x7d')](),{'type':db[_0x6c11('0x6d')]['QueryTypes'][_0x6c11('0x7e')]})['then'](function(_0xbdad98){if(_0xbdad98[_0x6c11('0x4c')]===0x1){return _0x5f14c6['id'];}else{var _0x47a962=_['every'](_[_0x6c11('0x31')](_0xbdad98,_0x6c11('0x7f')),function(_0x5a7628){return _[_0x6c11('0x80')](_0x3097ed,_0x5a7628);});if(_0x47a962){return _0x5f14c6['id'];}}}));}}return BPromise[_0x6c11('0x81')](_0x411a61)[_0x6c11('0x28')](function(_0x29928f){_0x1999fe=_(_0x1999fe)[_0x6c11('0x82')](_0x29928f)[_0x6c11('0x83')]()[_0x6c11('0x84')]();return db['MailQueue'][_0x6c11('0x4d')]({'where':{'id':_0x1c423b[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](function(_0x527495){return db[_0x6c11('0x6d')]['transaction'](function(_0x5079d){return _0x527495[_0x6c11('0x85')](_0x1c423b[_0x6c11('0x38')][_0x6c11('0x68')],{'transaction':_0x5079d})[_0x6c11('0x28')](function(){if(!_['isEmpty'](_0x1999fe)){return _0x527495[_0x6c11('0x86')](_0x1999fe,{'transaction':_0x5079d});}})['then'](function(){_0x1999fe[_0x6c11('0x71')](function(_0x3d9c8a){socket[_0x6c11('0x87')](_0x6c11('0x88'),{'UserId':_0x3d9c8a,'MailQueueId':_0x527495['id']});});});});});});})[_0x6c11('0x28')](respondWithStatusCode(_0x580e4f,null))[_0x6c11('0x48')](handleError(_0x580e4f,null));};exports[_0x6c11('0x89')]=function(_0x432988,_0x1271a9,_0x1b1ece){return db['MailQueue']['find']({'where':{'id':_0x432988[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x1271a9,null))['then'](function(_0x5c9a31){if(_0x5c9a31){return _0x5c9a31['addAgents'](_0x432988[_0x6c11('0x4f')]['ids'],_[_0x6c11('0x8a')](_0x432988[_0x6c11('0x4f')],[_0x6c11('0x68'),'id'])||{})['spread'](function(_0x256bc7){for(var _0x2d71aa=0x0;_0x2d71aa<_0x432988[_0x6c11('0x4f')][_0x6c11('0x68')][_0x6c11('0x4c')];_0x2d71aa+=0x1){socket[_0x6c11('0x87')](_0x6c11('0x72'),{'UserId':Number(_0x432988[_0x6c11('0x4f')][_0x6c11('0x68')][_0x2d71aa]),'MailQueueId':Number(_0x432988[_0x6c11('0x4a')]['id'])});}return _0x256bc7;});}})[_0x6c11('0x28')](respondWithResult(_0x1271a9,null))[_0x6c11('0x48')](handleError(_0x1271a9,null));};exports[_0x6c11('0x86')]=function(_0x445fe2,_0x31b3b2,_0x3346e2){return db[_0x6c11('0x32')][_0x6c11('0x4d')]({'where':{'id':_0x445fe2['params']['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x31b3b2,null))[_0x6c11('0x28')](function(_0x48c936){if(_0x48c936){return _0x48c936[_0x6c11('0x86')](_0x445fe2['query'][_0x6c11('0x68')])[_0x6c11('0x28')](function(){if(_[_0x6c11('0x8b')](_0x445fe2[_0x6c11('0x38')][_0x6c11('0x68')])){for(var _0x876142=0x0;_0x876142<_0x445fe2[_0x6c11('0x38')][_0x6c11('0x68')]['length'];_0x876142+=0x1){socket[_0x6c11('0x87')](_0x6c11('0x88'),{'UserId':Number(_0x445fe2['query'][_0x6c11('0x68')][_0x876142]),'MailQueueId':Number(_0x445fe2[_0x6c11('0x4a')]['id'])});}}else{socket['emit'](_0x6c11('0x88'),{'UserId':Number(_0x445fe2[_0x6c11('0x38')]['ids']),'MailQueueId':Number(_0x445fe2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x31b3b2,null))[_0x6c11('0x48')](handleError(_0x31b3b2,null));};exports[_0x6c11('0x8c')]=function(_0x435ebd,_0x380088,_0x526a5a){var _0x16f2d5={};var _0x3b24fa={};var _0x46881c;var _0xb5e8df;return db[_0x6c11('0x32')][_0x6c11('0x59')]({'where':{'id':_0x435ebd[_0x6c11('0x4a')]['id']}})[_0x6c11('0x28')](handleEntityNotFound(_0x380088,null))[_0x6c11('0x28')](function(_0x56f304){if(_0x56f304){_0x46881c=_0x56f304;_0x3b24fa[_0x6c11('0x35')]=_[_0x6c11('0x36')](db[_0x6c11('0x5d')][_0x6c11('0x4b')]);_0x3b24fa[_0x6c11('0x38')]=_[_0x6c11('0x36')](_0x435ebd[_0x6c11('0x38')]);_0x3b24fa[_0x6c11('0x3f')]=_[_0x6c11('0x37')](_0x3b24fa[_0x6c11('0x35')],_0x3b24fa[_0x6c11('0x38')]);_0x16f2d5[_0x6c11('0x39')]=_['intersection'](_0x3b24fa[_0x6c11('0x35')],qs[_0x6c11('0x3a')](_0x435ebd[_0x6c11('0x38')][_0x6c11('0x3a')]));_0x16f2d5['attributes']=_0x16f2d5[_0x6c11('0x39')][_0x6c11('0x4c')]?_0x16f2d5['attributes']:_0x3b24fa[_0x6c11('0x35')];_0x16f2d5[_0x6c11('0x3c')]=qs[_0x6c11('0x3d')](_0x435ebd[_0x6c11('0x38')][_0x6c11('0x3d')]);_0x16f2d5[_0x6c11('0x3e')]=qs['filters'](_['pick'](_0x435ebd['query'],_0x3b24fa[_0x6c11('0x3f')]));if(_0x435ebd[_0x6c11('0x38')][_0x6c11('0x41')]){_0x16f2d5['where']=_['merge'](_0x16f2d5[_0x6c11('0x3e')],{'$or':_[_0x6c11('0x31')](_0x16f2d5[_0x6c11('0x39')],function(_0x3d179a){var _0x1e7e86={};_0x1e7e86[_0x3d179a]={'$like':'%'+_0x435ebd[_0x6c11('0x38')][_0x6c11('0x41')]+'%'};return _0x1e7e86;})});}_0x16f2d5=_[_0x6c11('0x42')]({},_0x16f2d5,_0x435ebd[_0x6c11('0x43')]);return _0x46881c[_0x6c11('0x8c')](_0x16f2d5);}})[_0x6c11('0x28')](function(_0x441e89){if(_0x441e89){_0xb5e8df=_0x441e89['length'];if(!_0x435ebd['query'][_0x6c11('0x5b')](_0x6c11('0x3b'))){_0x16f2d5[_0x6c11('0x1f')]=qs[_0x6c11('0x1f')](_0x435ebd[_0x6c11('0x38')][_0x6c11('0x1f')]);_0x16f2d5[_0x6c11('0x1d')]=qs[_0x6c11('0x1d')](_0x435ebd[_0x6c11('0x38')][_0x6c11('0x1d')]);}return _0x46881c[_0x6c11('0x8c')](_0x16f2d5);}})['then'](function(_0x44daec){if(_0x44daec){return _0x44daec?{'count':_0xb5e8df,'rows':_0x44daec}:null;}})[_0x6c11('0x28')](respondWithResult(_0x380088,null))[_0x6c11('0x48')](handleError(_0x380088,null));}; \ No newline at end of file +var _0xbb53=['team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','MailQueues','sendStatus','stack','name','send','index','map','MailQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','update','describe','findOne','UserMailQueue','hasOwnProperty','nolimit','MailQueueId','findAndCountAll','UserId','mailPause','createdAt','updatedAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','from'];(function(_0x3c93e3,_0xf78679){var _0x5f2279=function(_0x104232){while(--_0x104232){_0x3c93e3['push'](_0x3c93e3['shift']());}};_0x5f2279(++_0xf78679);}(_0xbb53,0x121));var _0x3bb5=function(_0x52d127,_0x20484b){_0x52d127=_0x52d127-0x0;var _0x4ddf33=_0xbb53[_0x52d127];return _0x4ddf33;};'use strict';var emlformat=require(_0x3bb5('0x0'));var rimraf=require(_0x3bb5('0x1'));var zipdir=require(_0x3bb5('0x2'));var jsonpatch=require(_0x3bb5('0x3'));var rp=require(_0x3bb5('0x4'));var moment=require(_0x3bb5('0x5'));var BPromise=require(_0x3bb5('0x6'));var Mustache=require(_0x3bb5('0x7'));var util=require(_0x3bb5('0x8'));var path=require(_0x3bb5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x3bb5('0xb'));var _=require(_0x3bb5('0xc'));var squel=require(_0x3bb5('0xd'));var crypto=require(_0x3bb5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3bb5('0xf'));var Papa=require(_0x3bb5('0x10'));var Redis=require(_0x3bb5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3bb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bb5('0x13'))(_0x3bb5('0x14'));var utils=require('../../config/utils');var config=require(_0x3bb5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bb5('0x16'))['db'];config['redis']=_['defaults'](config[_0x3bb5('0x17')],{'host':_0x3bb5('0x18'),'port':0x18eb});var socket=require(_0x3bb5('0x19'))(new Redis(config['redis']));require(_0x3bb5('0x1a'))[_0x3bb5('0x1b')](socket);function respondWithStatusCode(_0x519123,_0x3de733){_0x3de733=_0x3de733||0xcc;return function(_0x15c369){if(_0x15c369){return _0x519123['sendStatus'](_0x3de733);}return _0x519123['status'](_0x3de733)['end']();};}function respondWithResult(_0x42ef1b,_0x4693d6){_0x4693d6=_0x4693d6||0xc8;return function(_0x5245cc){if(_0x5245cc){return _0x42ef1b[_0x3bb5('0x1c')](_0x4693d6)[_0x3bb5('0x1d')](_0x5245cc);}};}function respondWithFilteredResult(_0x4656c4,_0x262059){return function(_0x48bc25){if(_0x48bc25){var _0x13cb3a=typeof _0x262059[_0x3bb5('0x1e')]===_0x3bb5('0x1f')&&typeof _0x262059['limit']==='undefined';var _0x19b177=_0x48bc25[_0x3bb5('0x20')];var _0x3c3818=_0x13cb3a?0x0:_0x262059['offset'];var _0x3fbca6=_0x13cb3a?_0x48bc25[_0x3bb5('0x20')]:_0x262059[_0x3bb5('0x1e')]+_0x262059[_0x3bb5('0x21')];var _0x21a3ff;if(_0x3fbca6>=_0x19b177){_0x3fbca6=_0x19b177;_0x21a3ff=0xc8;}else{_0x21a3ff=0xce;}_0x4656c4[_0x3bb5('0x1c')](_0x21a3ff);return _0x4656c4['set'](_0x3bb5('0x22'),_0x3c3818+'-'+_0x3fbca6+'/'+_0x19b177)[_0x3bb5('0x1d')](_0x48bc25);}return null;};}function patchUpdates(_0x438a8d){return function(_0x2d4dae){try{jsonpatch[_0x3bb5('0x23')](_0x2d4dae,_0x438a8d,!![]);}catch(_0xfb9e8){return BPromise[_0x3bb5('0x24')](_0xfb9e8);}return _0x2d4dae['save']();};}function saveUpdates(_0x1d2a24,_0x3ef331){return function(_0x559720){if(_0x559720){return _0x559720['update'](_0x1d2a24)[_0x3bb5('0x25')](function(_0x36cfda){return _0x36cfda;});}return null;};}function removeEntity(_0x58acdb,_0x483689){return function(_0x477d1f){if(_0x477d1f){return _0x477d1f[_0x3bb5('0x26')]()[_0x3bb5('0x25')](function(){var _0xc1c149=_0x477d1f['get']({'plain':!![]});var _0x5baf9a=_0x3bb5('0x27');return db['UserProfileResource'][_0x3bb5('0x26')]({'where':{'type':_0x5baf9a,'resourceId':_0xc1c149['id']}})[_0x3bb5('0x25')](function(){return _0x477d1f;});})[_0x3bb5('0x25')](function(){_0x58acdb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e61d,_0x39f1ad){return function(_0x17ada7){if(!_0x17ada7){_0x19e61d[_0x3bb5('0x28')](0x194);}return _0x17ada7;};}function handleError(_0x311680,_0x33571b){_0x33571b=_0x33571b||0x1f4;return function(_0x3ed2cc){logger['error'](_0x3ed2cc[_0x3bb5('0x29')]);if(_0x3ed2cc[_0x3bb5('0x2a')]){delete _0x3ed2cc[_0x3bb5('0x2a')];}_0x311680[_0x3bb5('0x1c')](_0x33571b)[_0x3bb5('0x2b')](_0x3ed2cc);};}exports[_0x3bb5('0x2c')]=function(_0x464c2f,_0x52cd46){var _0x13aff9={},_0x25ba4c={},_0x53654b={'count':0x0,'rows':[]};var _0x396345=_[_0x3bb5('0x2d')](db[_0x3bb5('0x2e')][_0x3bb5('0x2f')],function(_0x18ce1f){return{'name':_0x18ce1f['fieldName'],'type':_0x18ce1f[_0x3bb5('0x30')][_0x3bb5('0x31')]};});_0x25ba4c[_0x3bb5('0x32')]=_[_0x3bb5('0x2d')](_0x396345,'name');_0x25ba4c['query']=_[_0x3bb5('0x33')](_0x464c2f[_0x3bb5('0x34')]);_0x25ba4c[_0x3bb5('0x35')]=_[_0x3bb5('0x36')](_0x25ba4c[_0x3bb5('0x32')],_0x25ba4c[_0x3bb5('0x34')]);_0x13aff9[_0x3bb5('0x37')]=_[_0x3bb5('0x36')](_0x25ba4c[_0x3bb5('0x32')],qs['fields'](_0x464c2f[_0x3bb5('0x34')][_0x3bb5('0x38')]));_0x13aff9['attributes']=_0x13aff9['attributes'][_0x3bb5('0x39')]?_0x13aff9[_0x3bb5('0x37')]:_0x25ba4c[_0x3bb5('0x32')];if(!_0x464c2f[_0x3bb5('0x34')]['hasOwnProperty']('nolimit')){_0x13aff9[_0x3bb5('0x21')]=qs['limit'](_0x464c2f[_0x3bb5('0x34')]['limit']);_0x13aff9['offset']=qs[_0x3bb5('0x1e')](_0x464c2f['query']['offset']);}_0x13aff9[_0x3bb5('0x3a')]=qs[_0x3bb5('0x3b')](_0x464c2f[_0x3bb5('0x34')]['sort']);_0x13aff9[_0x3bb5('0x3c')]=qs['filters'](_[_0x3bb5('0x3d')](_0x464c2f['query'],_0x25ba4c[_0x3bb5('0x35')]),_0x396345);if(_0x464c2f[_0x3bb5('0x34')][_0x3bb5('0x3e')]){_0x13aff9[_0x3bb5('0x3c')]=_[_0x3bb5('0x3f')](_0x13aff9[_0x3bb5('0x3c')],{'$or':_['map'](_0x396345,function(_0x12767d){if(_0x12767d[_0x3bb5('0x30')]!=='VIRTUAL'){var _0x111633={};_0x111633[_0x12767d[_0x3bb5('0x2a')]]={'$like':'%'+_0x464c2f[_0x3bb5('0x34')]['filter']+'%'};return _0x111633;}})});}_0x13aff9=_[_0x3bb5('0x3f')]({},_0x13aff9,_0x464c2f[_0x3bb5('0x40')]);var _0x495de7={'where':_0x13aff9[_0x3bb5('0x3c')]};return db[_0x3bb5('0x2e')][_0x3bb5('0x20')](_0x495de7)[_0x3bb5('0x25')](function(_0x663685){_0x53654b[_0x3bb5('0x20')]=_0x663685;if(_0x464c2f[_0x3bb5('0x34')][_0x3bb5('0x41')]){_0x13aff9[_0x3bb5('0x42')]=[{'all':!![]}];}return db[_0x3bb5('0x2e')][_0x3bb5('0x43')](_0x13aff9);})[_0x3bb5('0x25')](function(_0x20478a){_0x53654b[_0x3bb5('0x44')]=_0x20478a;return _0x53654b;})['then'](respondWithFilteredResult(_0x52cd46,_0x13aff9))[_0x3bb5('0x45')](handleError(_0x52cd46,null));};exports[_0x3bb5('0x46')]=function(_0x55b42a,_0x56073e){var _0x195e55={'raw':!![],'where':{'id':_0x55b42a[_0x3bb5('0x47')]['id']}},_0x40a6b4={};_0x40a6b4[_0x3bb5('0x32')]=_[_0x3bb5('0x33')](db[_0x3bb5('0x2e')][_0x3bb5('0x2f')]);_0x40a6b4[_0x3bb5('0x34')]=_['keys'](_0x55b42a['query']);_0x40a6b4[_0x3bb5('0x35')]=_[_0x3bb5('0x36')](_0x40a6b4[_0x3bb5('0x32')],_0x40a6b4['query']);_0x195e55[_0x3bb5('0x37')]=_['intersection'](_0x40a6b4[_0x3bb5('0x32')],qs[_0x3bb5('0x38')](_0x55b42a[_0x3bb5('0x34')][_0x3bb5('0x38')]));_0x195e55[_0x3bb5('0x37')]=_0x195e55[_0x3bb5('0x37')]['length']?_0x195e55[_0x3bb5('0x37')]:_0x40a6b4[_0x3bb5('0x32')];if(_0x55b42a['query'][_0x3bb5('0x41')]){_0x195e55[_0x3bb5('0x42')]=[{'all':!![]}];}_0x195e55=_['merge']({},_0x195e55,_0x55b42a[_0x3bb5('0x40')]);return db[_0x3bb5('0x2e')][_0x3bb5('0x48')](_0x195e55)[_0x3bb5('0x25')](handleEntityNotFound(_0x56073e,null))[_0x3bb5('0x25')](respondWithResult(_0x56073e,null))['catch'](handleError(_0x56073e,null));};exports[_0x3bb5('0x49')]=function(_0x277233,_0x5067e5){return db['MailQueue'][_0x3bb5('0x49')](_0x277233[_0x3bb5('0x4a')],{})[_0x3bb5('0x25')](function(_0x90d5b6){var _0x1e4edd=_0x277233['user'][_0x3bb5('0x4b')]({'plain':!![]});if(!_0x1e4edd)throw new Error(_0x3bb5('0x4c'));if(_0x1e4edd[_0x3bb5('0x4d')]===_0x3bb5('0x4e')){var _0x2d03c0=_0x90d5b6[_0x3bb5('0x4b')]({'plain':!![]});var _0x3baf6a='MailQueues';return db[_0x3bb5('0x4f')][_0x3bb5('0x48')]({'where':{'name':_0x3baf6a,'userProfileId':_0x1e4edd[_0x3bb5('0x50')]},'raw':!![]})[_0x3bb5('0x25')](function(_0x29e695){if(_0x29e695&&_0x29e695['autoAssociation']===0x0){return db[_0x3bb5('0x51')][_0x3bb5('0x49')]({'name':_0x2d03c0[_0x3bb5('0x2a')],'resourceId':_0x2d03c0['id'],'type':_0x29e695[_0x3bb5('0x2a')],'sectionId':_0x29e695['id']},{})[_0x3bb5('0x25')](function(){return _0x90d5b6;});}else{return _0x90d5b6;}})[_0x3bb5('0x45')](function(_0x421bbf){logger[_0x3bb5('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x421bbf);throw _0x421bbf;});}return _0x90d5b6;})[_0x3bb5('0x25')](respondWithResult(_0x5067e5,0xc9))[_0x3bb5('0x45')](handleError(_0x5067e5,null));};exports[_0x3bb5('0x53')]=function(_0x24a9a1,_0x5d6d39){if(_0x24a9a1[_0x3bb5('0x4a')]['id']){delete _0x24a9a1['body']['id'];}return db[_0x3bb5('0x2e')][_0x3bb5('0x48')]({'where':{'id':_0x24a9a1[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x5d6d39,null))[_0x3bb5('0x25')](saveUpdates(_0x24a9a1['body'],null))[_0x3bb5('0x25')](respondWithResult(_0x5d6d39,null))[_0x3bb5('0x45')](handleError(_0x5d6d39,null));};exports[_0x3bb5('0x26')]=function(_0x22aca1,_0x4fc8a4){return db[_0x3bb5('0x2e')][_0x3bb5('0x48')]({'where':{'id':_0x22aca1[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x4fc8a4,null))[_0x3bb5('0x25')](removeEntity(_0x4fc8a4,null))[_0x3bb5('0x45')](handleError(_0x4fc8a4,null));};exports[_0x3bb5('0x54')]=function(_0x458854,_0x4a711b){return db[_0x3bb5('0x2e')][_0x3bb5('0x54')]()[_0x3bb5('0x25')](respondWithResult(_0x4a711b,null))['catch'](handleError(_0x4a711b,null));};exports['getMembers']=function(_0x27d764,_0x336f0d,_0x399352){var _0x5bbf19={'raw':!![],'where':{}},_0x2b0d73={},_0x901d51;return db[_0x3bb5('0x2e')][_0x3bb5('0x55')]({'where':{'id':_0x27d764[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x336f0d,null))[_0x3bb5('0x25')](function(_0x4c8edd){if(_0x4c8edd){_0x901d51=_0x4c8edd['get']({'plain':!![]});_0x2b0d73[_0x3bb5('0x32')]=_[_0x3bb5('0x33')](db[_0x3bb5('0x56')][_0x3bb5('0x2f')]);_0x2b0d73[_0x3bb5('0x34')]=_[_0x3bb5('0x33')](_0x27d764['query']);_0x2b0d73[_0x3bb5('0x35')]=_[_0x3bb5('0x36')](_0x2b0d73[_0x3bb5('0x32')],_0x2b0d73[_0x3bb5('0x34')]);_0x5bbf19['attributes']=_[_0x3bb5('0x36')](_0x2b0d73[_0x3bb5('0x32')],qs[_0x3bb5('0x38')](_0x27d764[_0x3bb5('0x34')][_0x3bb5('0x38')]));_0x5bbf19[_0x3bb5('0x37')]=_0x5bbf19[_0x3bb5('0x37')][_0x3bb5('0x39')]?_0x5bbf19['attributes']:_0x2b0d73[_0x3bb5('0x32')];if(!_0x27d764[_0x3bb5('0x34')][_0x3bb5('0x57')](_0x3bb5('0x58'))){_0x5bbf19[_0x3bb5('0x21')]=qs['limit'](_0x27d764[_0x3bb5('0x34')]['limit']);_0x5bbf19[_0x3bb5('0x1e')]=qs['offset'](_0x27d764[_0x3bb5('0x34')][_0x3bb5('0x1e')]);}_0x5bbf19[_0x3bb5('0x3a')]=qs['sort'](_0x27d764[_0x3bb5('0x34')][_0x3bb5('0x3b')]);_0x5bbf19[_0x3bb5('0x3c')]=qs['filters'](_[_0x3bb5('0x3d')](_0x27d764[_0x3bb5('0x34')],_0x2b0d73[_0x3bb5('0x35')]));_0x5bbf19['where'][_0x3bb5('0x59')]=_0x4c8edd['id'];if(_0x27d764[_0x3bb5('0x34')][_0x3bb5('0x3e')]){_0x5bbf19[_0x3bb5('0x3c')]=_[_0x3bb5('0x3f')](_0x5bbf19[_0x3bb5('0x3c')],{'$or':_[_0x3bb5('0x2d')](_0x5bbf19['attributes'],function(_0x4c9ff0){var _0x2b3ed8={};_0x2b3ed8[_0x4c9ff0]={'$like':'%'+_0x27d764[_0x3bb5('0x34')]['filter']+'%'};return _0x2b3ed8;})});}_0x5bbf19=_[_0x3bb5('0x3f')]({},_0x5bbf19,_0x27d764['options']);return db[_0x3bb5('0x56')][_0x3bb5('0x43')](_0x5bbf19);}})[_0x3bb5('0x25')](function(_0x380dcb){if(_0x380dcb){return db['User'][_0x3bb5('0x5a')]({'where':{'id':_[_0x3bb5('0x2d')](_0x380dcb,_0x3bb5('0x5b')),'role':'agent'},'attributes':['id',_0x3bb5('0x2a'),_0x3bb5('0x5c'),'updatedAt',_0x3bb5('0x5d')]});}})[_0x3bb5('0x25')](function(_0x162854){if(_0x162854){return{'count':_0x162854[_0x3bb5('0x20')],'rows':_[_0x3bb5('0x2d')](_0x162854[_0x3bb5('0x44')],function(_0x180219){return{'membername':_0x180219['name'],'UserId':_0x180219['id'],'queue_name':_0x901d51['name'],'MailQueueId':_0x901d51['id'],'interface':util['format']('%s/%s','SIP',_0x180219[_0x3bb5('0x2a')]),'penalty':0x0,'paused':_0x180219[_0x3bb5('0x5c')],'createdAt':_0x180219[_0x3bb5('0x5d')],'updatedAt':_0x180219[_0x3bb5('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3bb5('0x25')](respondWithFilteredResult(_0x336f0d,_0x5bbf19))[_0x3bb5('0x45')](handleError(_0x336f0d,null));};exports[_0x3bb5('0x5f')]=function(_0x1c4c75,_0x4addcc,_0xbaf942){var _0xd2ec3d={};var _0x16b170={};var _0x395af6;var _0x33277b;return db[_0x3bb5('0x2e')][_0x3bb5('0x55')]({'where':{'id':_0x1c4c75['params']['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x4addcc,null))['then'](function(_0x3e2d15){if(_0x3e2d15){_0x395af6=_0x3e2d15;_0x16b170[_0x3bb5('0x32')]=_[_0x3bb5('0x33')](db['Team'][_0x3bb5('0x2f')]);_0x16b170[_0x3bb5('0x34')]=_[_0x3bb5('0x33')](_0x1c4c75[_0x3bb5('0x34')]);_0x16b170['filters']=_[_0x3bb5('0x36')](_0x16b170['model'],_0x16b170['query']);_0xd2ec3d[_0x3bb5('0x37')]=_[_0x3bb5('0x36')](_0x16b170[_0x3bb5('0x32')],qs[_0x3bb5('0x38')](_0x1c4c75['query'][_0x3bb5('0x38')]));_0xd2ec3d['attributes']=_0xd2ec3d[_0x3bb5('0x37')][_0x3bb5('0x39')]?_0xd2ec3d[_0x3bb5('0x37')]:_0x16b170[_0x3bb5('0x32')];_0xd2ec3d[_0x3bb5('0x3a')]=qs['sort'](_0x1c4c75[_0x3bb5('0x34')]['sort']);_0xd2ec3d[_0x3bb5('0x3c')]=qs['filters'](_[_0x3bb5('0x3d')](_0x1c4c75[_0x3bb5('0x34')],_0x16b170[_0x3bb5('0x35')]));if(_0x1c4c75[_0x3bb5('0x34')][_0x3bb5('0x3e')]){_0xd2ec3d[_0x3bb5('0x3c')]=_[_0x3bb5('0x3f')](_0xd2ec3d['where'],{'$or':_['map'](_0xd2ec3d['attributes'],function(_0x59e0c4){var _0x3fb277={};_0x3fb277[_0x59e0c4]={'$like':'%'+_0x1c4c75[_0x3bb5('0x34')][_0x3bb5('0x3e')]+'%'};return _0x3fb277;})});}_0xd2ec3d=_[_0x3bb5('0x3f')]({},_0xd2ec3d,_0x1c4c75['options']);return _0x395af6[_0x3bb5('0x5f')](_0xd2ec3d);}})['then'](function(_0x2e989c){if(_0x2e989c){_0x33277b=_0x2e989c[_0x3bb5('0x39')];if(!_0x1c4c75[_0x3bb5('0x34')][_0x3bb5('0x57')](_0x3bb5('0x58'))){_0xd2ec3d[_0x3bb5('0x21')]=qs[_0x3bb5('0x21')](_0x1c4c75[_0x3bb5('0x34')][_0x3bb5('0x21')]);_0xd2ec3d['offset']=qs[_0x3bb5('0x1e')](_0x1c4c75[_0x3bb5('0x34')][_0x3bb5('0x1e')]);}return _0x395af6[_0x3bb5('0x5f')](_0xd2ec3d);}})[_0x3bb5('0x25')](function(_0x1d577d){if(_0x1d577d){return _0x1d577d?{'count':_0x33277b,'rows':_0x1d577d}:null;}})[_0x3bb5('0x25')](respondWithResult(_0x4addcc,null))[_0x3bb5('0x45')](handleError(_0x4addcc,null));};exports[_0x3bb5('0x60')]=function(_0x4b970b,_0x4f5b26,_0x329f02){var _0xb434d8=_0x4b970b[_0x3bb5('0x4a')][_0x3bb5('0x61')];return db[_0x3bb5('0x62')][_0x3bb5('0x43')]({'where':{'id':_0xb434d8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3bb5('0x63'),'attributes':['id',_0x3bb5('0x2a'),_0x3bb5('0x64'),_0x3bb5('0x65'),_0x3bb5('0x66')],'raw':!![]}]})['then'](function(_0x1e835c){if(_0x1e835c){var _0x1635ee=_[_0x3bb5('0x67')](_0x1e835c,function(_0x3799f9){var _0x10c127=_0x3799f9[_0x3bb5('0x4b')]({'plain':!![]});return _0x10c127['Agents'];});return db[_0x3bb5('0x2e')][_0x3bb5('0x48')]({'where':{'id':_0x4b970b[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](function(_0x4d3d86){return db[_0x3bb5('0x68')][_0x3bb5('0x69')](function(_0x4bdd9c){return _0x4d3d86[_0x3bb5('0x60')](_0xb434d8,{'transaction':_0x4bdd9c})['then'](function(){return BPromise[_0x3bb5('0x6a')](_0x1635ee,function(_0x2de65b){return db[_0x3bb5('0x56')][_0x3bb5('0x6b')]({'where':{'UserId':_0x2de65b['id'],'MailQueueId':_0x4b970b[_0x3bb5('0x47')]['id']},'transaction':_0x4bdd9c});});})[_0x3bb5('0x25')](function(){_0x1635ee[_0x3bb5('0x6c')](function(_0x2e6ccb){socket[_0x3bb5('0x6d')]('userMailQueue:save',{'UserId':_0x2e6ccb['id'],'MailQueueId':_0x4d3d86['id']});});});});});}})[_0x3bb5('0x25')](respondWithStatusCode(_0x4f5b26,null))[_0x3bb5('0x45')](handleError(_0x4f5b26,null));};exports[_0x3bb5('0x6e')]=function(_0x92a269,_0x54787d,_0x17db1b){return db['Team']['findAll']({'where':{'id':_0x92a269[_0x3bb5('0x34')][_0x3bb5('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3bb5('0x63'),'attributes':['id'],'raw':!![]}]})[_0x3bb5('0x25')](handleEntityNotFound(_0x54787d,null))[_0x3bb5('0x25')](function(_0x303048){var _0xaa1f07=_['map'](_0x303048,'id');var _0x10e5f9=[];var _0x15238c=[];var _0x18e3b5=squel[_0x3bb5('0x6f')]();_0x18e3b5['field']('tq.TeamId')[_0x3bb5('0x70')](_0x3bb5('0x71'),'tq')['join']('user_has_teams','ut',_0x3bb5('0x72'))[_0x3bb5('0x3c')](_0x3bb5('0x73'),_0x92a269[_0x3bb5('0x47')]['id']);for(var _0x231d6f=0x0;_0x231d6f<_0x303048[_0x3bb5('0x39')];_0x231d6f+=0x1){let _0xf39ca4=_0x303048[_0x231d6f];for(var _0x595d82=0x0;_0x595d82<_0xf39ca4[_0x3bb5('0x63')][_0x3bb5('0x39')];_0x595d82+=0x1){let _0xdf5bc4=_0xf39ca4['Agents'][_0x595d82];var _0x1d07b1=_0x18e3b5[_0x3bb5('0x74')]();_0x1d07b1['where']('ut.UserId\x20=\x20?',_0xdf5bc4['id']);_0x15238c[_0x3bb5('0x75')](db[_0x3bb5('0x68')][_0x3bb5('0x34')](_0x1d07b1[_0x3bb5('0x76')](),{'type':db['sequelize'][_0x3bb5('0x77')][_0x3bb5('0x78')]})[_0x3bb5('0x25')](function(_0x4aedc2){if(_0x4aedc2[_0x3bb5('0x39')]===0x1){return _0xdf5bc4['id'];}else{var _0x4e5f2f=_[_0x3bb5('0x79')](_[_0x3bb5('0x2d')](_0x4aedc2,_0x3bb5('0x7a')),function(_0x4ae3c4){return _['includes'](_0xaa1f07,_0x4ae3c4);});if(_0x4e5f2f){return _0xdf5bc4['id'];}}}));}}return BPromise[_0x3bb5('0x7b')](_0x15238c)['then'](function(_0x52b10d){_0x10e5f9=_(_0x10e5f9)['union'](_0x52b10d)[_0x3bb5('0x7c')]()['value']();return db[_0x3bb5('0x2e')]['find']({'where':{'id':_0x92a269[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](function(_0x2e5fad){return db['sequelize'][_0x3bb5('0x69')](function(_0x25164b){return _0x2e5fad[_0x3bb5('0x6e')](_0x92a269['query'][_0x3bb5('0x61')],{'transaction':_0x25164b})[_0x3bb5('0x25')](function(){if(!_[_0x3bb5('0x7d')](_0x10e5f9)){return _0x2e5fad[_0x3bb5('0x7e')](_0x10e5f9,{'transaction':_0x25164b});}})[_0x3bb5('0x25')](function(){_0x10e5f9[_0x3bb5('0x6c')](function(_0x3b29ca){socket[_0x3bb5('0x6d')](_0x3bb5('0x7f'),{'UserId':_0x3b29ca,'MailQueueId':_0x2e5fad['id']});});});});});});})[_0x3bb5('0x25')](respondWithStatusCode(_0x54787d,null))[_0x3bb5('0x45')](handleError(_0x54787d,null));};exports[_0x3bb5('0x80')]=function(_0x2165d6,_0x5a9606,_0x596f3f){return db[_0x3bb5('0x2e')]['find']({'where':{'id':_0x2165d6[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x5a9606,null))[_0x3bb5('0x25')](function(_0x19bf90){if(_0x19bf90){return _0x19bf90[_0x3bb5('0x80')](_0x2165d6[_0x3bb5('0x4a')]['ids'],_[_0x3bb5('0x81')](_0x2165d6[_0x3bb5('0x4a')],[_0x3bb5('0x61'),'id'])||{})[_0x3bb5('0x82')](function(_0x3e80bb){for(var _0x2fce7c=0x0;_0x2fce7c<_0x2165d6[_0x3bb5('0x4a')][_0x3bb5('0x61')]['length'];_0x2fce7c+=0x1){socket[_0x3bb5('0x6d')](_0x3bb5('0x83'),{'UserId':Number(_0x2165d6[_0x3bb5('0x4a')]['ids'][_0x2fce7c]),'MailQueueId':Number(_0x2165d6[_0x3bb5('0x47')]['id'])});}return _0x3e80bb;});}})[_0x3bb5('0x25')](respondWithResult(_0x5a9606,null))['catch'](handleError(_0x5a9606,null));};exports[_0x3bb5('0x7e')]=function(_0x402d11,_0x31f72e,_0x4911dc){return db['MailQueue'][_0x3bb5('0x48')]({'where':{'id':_0x402d11[_0x3bb5('0x47')]['id']}})['then'](handleEntityNotFound(_0x31f72e,null))['then'](function(_0x1b1cbd){if(_0x1b1cbd){return _0x1b1cbd[_0x3bb5('0x7e')](_0x402d11[_0x3bb5('0x34')][_0x3bb5('0x61')])[_0x3bb5('0x25')](function(){if(_[_0x3bb5('0x84')](_0x402d11[_0x3bb5('0x34')][_0x3bb5('0x61')])){for(var _0x2be900=0x0;_0x2be900<_0x402d11['query'][_0x3bb5('0x61')][_0x3bb5('0x39')];_0x2be900+=0x1){socket[_0x3bb5('0x6d')](_0x3bb5('0x7f'),{'UserId':Number(_0x402d11[_0x3bb5('0x34')][_0x3bb5('0x61')][_0x2be900]),'MailQueueId':Number(_0x402d11['params']['id'])});}}else{socket[_0x3bb5('0x6d')](_0x3bb5('0x7f'),{'UserId':Number(_0x402d11[_0x3bb5('0x34')][_0x3bb5('0x61')]),'MailQueueId':Number(_0x402d11[_0x3bb5('0x47')]['id'])});}});}})[_0x3bb5('0x25')](respondWithStatusCode(_0x31f72e,null))[_0x3bb5('0x45')](handleError(_0x31f72e,null));};exports[_0x3bb5('0x85')]=function(_0x257172,_0x43f062,_0x3dd23a){var _0x34c272={};var _0x40f97d={};var _0x3bdbf1;var _0x2f38a5;return db[_0x3bb5('0x2e')][_0x3bb5('0x55')]({'where':{'id':_0x257172[_0x3bb5('0x47')]['id']}})[_0x3bb5('0x25')](handleEntityNotFound(_0x43f062,null))[_0x3bb5('0x25')](function(_0x2dd4f3){if(_0x2dd4f3){_0x3bdbf1=_0x2dd4f3;_0x40f97d['model']=_[_0x3bb5('0x33')](db['User'][_0x3bb5('0x2f')]);_0x40f97d[_0x3bb5('0x34')]=_['keys'](_0x257172[_0x3bb5('0x34')]);_0x40f97d['filters']=_[_0x3bb5('0x36')](_0x40f97d[_0x3bb5('0x32')],_0x40f97d[_0x3bb5('0x34')]);_0x34c272[_0x3bb5('0x37')]=_[_0x3bb5('0x36')](_0x40f97d[_0x3bb5('0x32')],qs[_0x3bb5('0x38')](_0x257172[_0x3bb5('0x34')][_0x3bb5('0x38')]));_0x34c272[_0x3bb5('0x37')]=_0x34c272[_0x3bb5('0x37')]['length']?_0x34c272[_0x3bb5('0x37')]:_0x40f97d['model'];_0x34c272[_0x3bb5('0x3a')]=qs[_0x3bb5('0x3b')](_0x257172[_0x3bb5('0x34')][_0x3bb5('0x3b')]);_0x34c272[_0x3bb5('0x3c')]=qs[_0x3bb5('0x35')](_[_0x3bb5('0x3d')](_0x257172[_0x3bb5('0x34')],_0x40f97d['filters']));if(_0x257172[_0x3bb5('0x34')][_0x3bb5('0x3e')]){_0x34c272['where']=_[_0x3bb5('0x3f')](_0x34c272[_0x3bb5('0x3c')],{'$or':_['map'](_0x34c272[_0x3bb5('0x37')],function(_0x292bd4){var _0x4d13cf={};_0x4d13cf[_0x292bd4]={'$like':'%'+_0x257172['query']['filter']+'%'};return _0x4d13cf;})});}_0x34c272=_[_0x3bb5('0x3f')]({},_0x34c272,_0x257172['options']);return _0x3bdbf1[_0x3bb5('0x85')](_0x34c272);}})[_0x3bb5('0x25')](function(_0x16881b){if(_0x16881b){_0x2f38a5=_0x16881b[_0x3bb5('0x39')];if(!_0x257172[_0x3bb5('0x34')][_0x3bb5('0x57')](_0x3bb5('0x58'))){_0x34c272[_0x3bb5('0x21')]=qs['limit'](_0x257172['query'][_0x3bb5('0x21')]);_0x34c272[_0x3bb5('0x1e')]=qs[_0x3bb5('0x1e')](_0x257172[_0x3bb5('0x34')][_0x3bb5('0x1e')]);}return _0x3bdbf1[_0x3bb5('0x85')](_0x34c272);}})[_0x3bb5('0x25')](function(_0x578c15){if(_0x578c15){return _0x578c15?{'count':_0x2f38a5,'rows':_0x578c15}:null;}})[_0x3bb5('0x25')](respondWithResult(_0x43f062,null))[_0x3bb5('0x45')](handleError(_0x43f062,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 51cf8d5..f978ede 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 _0x324f=['hook','exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57c501,_0x319f03){var _0x4f15ba=function(_0x52e0c1){while(--_0x52e0c1){_0x57c501['push'](_0x57c501['shift']());}};_0x4f15ba(++_0x319f03);}(_0x324f,0xaa));var _0xf324=function(_0x3ff454,_0x564d83){_0x3ff454=_0x3ff454-0x0;var _0x40f602=_0x324f[_0x3ff454];return _0x40f602;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xf324('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf324('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf324('0x2'),'afterDestroy':_0xf324('0x3')};function emitEvent(_0x6d9c77){return function(_0x52c85c,_0x4f4cab,_0x32f62c){MailQueueEvents[_0xf324('0x4')](_0x6d9c77+':'+_0x52c85c['id'],_0x52c85c);MailQueueEvents[_0xf324('0x4')](_0x6d9c77,_0x52c85c);_0x32f62c(null);};}for(var e in events){if(events[_0xf324('0x5')](e)){var event=events[e];MailQueue[_0xf324('0x6')](e,emitEvent(event));}}module[_0xf324('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xb195=['hasOwnProperty','hook','events','../../mysqldb','MailQueue','update','remove','emit'];(function(_0x572e47,_0x572318){var _0x48ce8c=function(_0x66f1da){while(--_0x66f1da){_0x572e47['push'](_0x572e47['shift']());}};_0x48ce8c(++_0x572318);}(_0xb195,0x102));var _0x5b19=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xb195[_0x1a9204];return _0x17ca68;};'use strict';var EventEmitter=require(_0x5b19('0x0'));var MailQueue=require(_0x5b19('0x1'))['db'][_0x5b19('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b19('0x3'),'afterDestroy':_0x5b19('0x4')};function emitEvent(_0x1293bd){return function(_0x33df7e,_0x295b14,_0x13b732){MailQueueEvents[_0x5b19('0x5')](_0x1293bd+':'+_0x33df7e['id'],_0x33df7e);MailQueueEvents['emit'](_0x1293bd,_0x33df7e);_0x13b732(null);};}for(var e in events){if(events[_0x5b19('0x6')](e)){var event=events[e];MailQueue[_0x5b19('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b824510..435443e 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 _0xab98=['bluebird','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3cc7c3,_0x2ecaa6){var _0x14cf19=function(_0xe16039){while(--_0xe16039){_0x3cc7c3['push'](_0x3cc7c3['shift']());}};_0x14cf19(++_0x2ecaa6);}(_0xab98,0xff));var _0x8ab9=function(_0x35507b,_0x247cbe){_0x35507b=_0x35507b-0x0;var _0x4ff363=_0xab98[_0x35507b];return _0x4ff363;};'use strict';var _=require(_0x8ab9('0x0'));var util=require(_0x8ab9('0x1'));var logger=require(_0x8ab9('0x2'))(_0x8ab9('0x3'));var moment=require(_0x8ab9('0x4'));var BPromise=require(_0x8ab9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ab9('0x6'));var rimraf=require('rimraf');var config=require(_0x8ab9('0x7'));var attributes=require(_0x8ab9('0x8'));module[_0x8ab9('0x9')]=function(_0x2339ac,_0x154dfb){return _0x2339ac[_0x8ab9('0xa')](_0x8ab9('0xb'),attributes,{'tableName':_0x8ab9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e59=['request-promise','path','./mailQueue.attributes','exports','define','MailQueue','lodash','util','moment'];(function(_0xdc5917,_0x3ece19){var _0x594ba7=function(_0x10bc18){while(--_0x10bc18){_0xdc5917['push'](_0xdc5917['shift']());}};_0x594ba7(++_0x3ece19);}(_0x3e59,0x1b6));var _0x93e5=function(_0x391bce,_0x4dcec1){_0x391bce=_0x391bce-0x0;var _0x14075b=_0x3e59[_0x391bce];return _0x14075b;};'use strict';var _=require(_0x93e5('0x0'));var util=require(_0x93e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x93e5('0x2'));var BPromise=require('bluebird');var rp=require(_0x93e5('0x3'));var fs=require('fs');var path=require(_0x93e5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x93e5('0x5'));module[_0x93e5('0x6')]=function(_0x1b6e6c,_0x30a6ee){return _0x1b6e6c[_0x93e5('0x7')](_0x93e5('0x8'),attributes,{'tableName':'mail_queues','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 a01e0db..fceb3ce 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 _0x4fd9=['attributes','limit','include','map','model','debug','ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4fd9,0xf1));var _0x94fd=function(_0x4ee781,_0x5a8076){_0x4ee781=_0x4ee781-0x0;var _0x29baa3=_0x4fd9[_0x4ee781];return _0x29baa3;};'use strict';var _=require(_0x94fd('0x0'));var util=require(_0x94fd('0x1'));var moment=require(_0x94fd('0x2'));var BPromise=require(_0x94fd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94fd('0x4'));var db=require(_0x94fd('0x5'))['db'];var utils=require(_0x94fd('0x6'));var logger=require(_0x94fd('0x7'))(_0x94fd('0x8'));var config=require(_0x94fd('0x9'));var jayson=require(_0x94fd('0xa'));var client=jayson[_0x94fd('0xb')][_0x94fd('0xc')]({'port':0x232a});config[_0x94fd('0xd')]=_[_0x94fd('0xe')](config[_0x94fd('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94fd('0xd')]));require('./mailQueue.socket')[_0x94fd('0xf')](socket);function respondWithRpcPromise(_0x57ea90,_0x36a3c7,_0x5d54fc){return new BPromise(function(_0x3a5a89,_0x315600){return client['request'](_0x57ea90,_0x5d54fc)[_0x94fd('0x10')](function(_0x406d5a){logger[_0x94fd('0x11')](_0x94fd('0x12'),_0x36a3c7,_0x94fd('0x13'));logger['debug'](_0x94fd('0x14'),_0x36a3c7,_0x94fd('0x13'),JSON[_0x94fd('0x15')](_0x406d5a));if(_0x406d5a[_0x94fd('0x16')]){if(_0x406d5a[_0x94fd('0x16')][_0x94fd('0x17')]===0x1f4){logger[_0x94fd('0x16')](_0x94fd('0x12'),_0x36a3c7,_0x406d5a[_0x94fd('0x16')]['message']);return _0x315600(_0x406d5a[_0x94fd('0x16')][_0x94fd('0x18')]);}logger[_0x94fd('0x16')](_0x94fd('0x12'),_0x36a3c7,_0x406d5a[_0x94fd('0x16')]['message']);return _0x3a5a89(_0x406d5a[_0x94fd('0x16')][_0x94fd('0x18')]);}else{logger['info'](_0x94fd('0x12'),_0x36a3c7,'request\x20sent');_0x3a5a89(_0x406d5a['result'][_0x94fd('0x18')]);}})[_0x94fd('0x19')](function(_0x395063){logger[_0x94fd('0x16')](_0x94fd('0x12'),_0x36a3c7,_0x395063);_0x315600(_0x395063);});});}exports[_0x94fd('0x1a')]=function(_0x3e11a3){var _0x538fb7=this;return new Promise(function(_0x1a0a5c,_0x3b0db7){return db[_0x94fd('0x1b')][_0x94fd('0x1c')]({'raw':_0x3e11a3[_0x94fd('0x1d')]?_0x3e11a3[_0x94fd('0x1d')][_0x94fd('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e11a3['options']?_0x3e11a3[_0x94fd('0x1d')][_0x94fd('0x1f')]||null:null,'attributes':_0x3e11a3['options']?_0x3e11a3['options'][_0x94fd('0x20')]||null:null,'limit':_0x3e11a3[_0x94fd('0x1d')]?_0x3e11a3[_0x94fd('0x1d')][_0x94fd('0x21')]||null:null,'include':_0x3e11a3[_0x94fd('0x1d')]?_0x3e11a3[_0x94fd('0x1d')][_0x94fd('0x22')]?_[_0x94fd('0x23')](_0x3e11a3[_0x94fd('0x1d')][_0x94fd('0x22')],function(_0x326819){return{'model':db[_0x326819['model']],'as':_0x326819['as'],'attributes':_0x326819[_0x94fd('0x20')],'include':_0x326819[_0x94fd('0x22')]?_[_0x94fd('0x23')](_0x326819[_0x94fd('0x22')],function(_0x44cb85){return{'model':db[_0x44cb85[_0x94fd('0x24')]],'as':_0x44cb85['as'],'attributes':_0x44cb85['attributes'],'include':_0x44cb85['include']?_[_0x94fd('0x23')](_0x44cb85[_0x94fd('0x22')],function(_0x32f0d0){return{'model':db[_0x32f0d0[_0x94fd('0x24')]],'as':_0x32f0d0['as'],'attributes':_0x32f0d0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dce33){logger['info'](_0x94fd('0x1a'),_0x3e11a3);logger[_0x94fd('0x25')](_0x94fd('0x1a'),_0x3e11a3,JSON['stringify'](_0x2dce33));_0x1a0a5c(_0x2dce33);})['catch'](function(_0x51972b){logger[_0x94fd('0x16')]('GetMailQueue',_0x51972b[_0x94fd('0x18')],_0x3e11a3);_0x3b0db7(_0x538fb7[_0x94fd('0x16')](0x1f4,_0x51972b[_0x94fd('0x18')]));});});};exports[_0x94fd('0x26')]=function(_0x44016c){var _0x43f4dc=this;return new Promise(function(_0x697d95,_0xed6def){return db[_0x94fd('0x1b')]['find']({'raw':_0x44016c['options']?_0x44016c[_0x94fd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x44016c[_0x94fd('0x1d')]?_0x44016c[_0x94fd('0x1d')]['where']||null:null,'attributes':_0x44016c[_0x94fd('0x1d')]?_0x44016c['options'][_0x94fd('0x20')]||null:null,'include':_0x44016c[_0x94fd('0x1d')]?_0x44016c['options']['include']?_[_0x94fd('0x23')](_0x44016c[_0x94fd('0x1d')]['include'],function(_0x42e145){return{'model':db[_0x42e145[_0x94fd('0x24')]],'as':_0x42e145['as'],'attributes':_0x42e145[_0x94fd('0x20')],'include':_0x42e145['include']?_[_0x94fd('0x23')](_0x42e145[_0x94fd('0x22')],function(_0x55eeca){return{'model':db[_0x55eeca[_0x94fd('0x24')]],'as':_0x55eeca['as'],'attributes':_0x55eeca[_0x94fd('0x20')],'include':_0x55eeca[_0x94fd('0x22')]?_[_0x94fd('0x23')](_0x55eeca['include'],function(_0x5d27b4){return{'model':db[_0x5d27b4['model']],'as':_0x5d27b4['as'],'attributes':_0x5d27b4[_0x94fd('0x20')]};}):[]};}):[]};}):[]:[]})[_0x94fd('0x10')](function(_0x5686d3){logger['info'](_0x94fd('0x26'),_0x44016c);logger[_0x94fd('0x25')](_0x94fd('0x26'),_0x44016c,JSON[_0x94fd('0x15')](_0x5686d3));_0x697d95(_0x5686d3);})[_0x94fd('0x19')](function(_0x7db74e){logger[_0x94fd('0x16')](_0x94fd('0x26'),_0x7db74e[_0x94fd('0x18')],_0x44016c);_0xed6def(_0x43f4dc[_0x94fd('0x16')](0x1f4,_0x7db74e[_0x94fd('0x18')]));});});}; \ No newline at end of file +var _0x766f=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','model','map','stringify','ShowMailQueue','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s'];(function(_0x1b2e34,_0x8d3ab5){var _0x13c2b9=function(_0x1d4bb3){while(--_0x1d4bb3){_0x1b2e34['push'](_0x1b2e34['shift']());}};_0x13c2b9(++_0x8d3ab5);}(_0x766f,0x14f));var _0xf766=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x766f[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf766('0x0'));var fs=require('fs');var Redis=require(_0xf766('0x1'));var db=require(_0xf766('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf766('0x3'));var config=require(_0xf766('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf766('0x5')]({'port':0x232a});config[_0xf766('0x6')]=_[_0xf766('0x7')](config['redis'],{'host':_0xf766('0x8'),'port':0x18eb});var socket=require(_0xf766('0x9'))(new Redis(config[_0xf766('0x6')]));require(_0xf766('0xa'))['register'](socket);function respondWithRpcPromise(_0x56ef4e,_0x93a549,_0x9da454){return new BPromise(function(_0x65a845,_0x554814){return client[_0xf766('0xb')](_0x56ef4e,_0x9da454)[_0xf766('0xc')](function(_0x4485c2){logger[_0xf766('0xd')](_0xf766('0xe'),_0x93a549,_0xf766('0xf'));logger[_0xf766('0x10')](_0xf766('0x11'),_0x93a549,'request\x20sent',JSON['stringify'](_0x4485c2));if(_0x4485c2[_0xf766('0x12')]){if(_0x4485c2[_0xf766('0x12')][_0xf766('0x13')]===0x1f4){logger[_0xf766('0x12')](_0xf766('0xe'),_0x93a549,_0x4485c2['error'][_0xf766('0x14')]);return _0x554814(_0x4485c2[_0xf766('0x12')][_0xf766('0x14')]);}logger['error'](_0xf766('0xe'),_0x93a549,_0x4485c2['error'][_0xf766('0x14')]);return _0x65a845(_0x4485c2[_0xf766('0x12')][_0xf766('0x14')]);}else{logger[_0xf766('0xd')](_0xf766('0xe'),_0x93a549,_0xf766('0xf'));_0x65a845(_0x4485c2[_0xf766('0x15')][_0xf766('0x14')]);}})[_0xf766('0x16')](function(_0x3f3fbd){logger[_0xf766('0x12')](_0xf766('0xe'),_0x93a549,_0x3f3fbd);_0x554814(_0x3f3fbd);});});}exports[_0xf766('0x17')]=function(_0x34b15b){var _0x29712f=this;return new Promise(function(_0x37be6f,_0x3dc405){return db[_0xf766('0x18')][_0xf766('0x19')]({'raw':_0x34b15b['options']?_0x34b15b[_0xf766('0x1a')][_0xf766('0x1b')]===undefined?!![]:![]:!![],'where':_0x34b15b['options']?_0x34b15b[_0xf766('0x1a')][_0xf766('0x1c')]||null:null,'attributes':_0x34b15b[_0xf766('0x1a')]?_0x34b15b[_0xf766('0x1a')][_0xf766('0x1d')]||null:null,'limit':_0x34b15b[_0xf766('0x1a')]?_0x34b15b[_0xf766('0x1a')]['limit']||null:null,'include':_0x34b15b[_0xf766('0x1a')]?_0x34b15b[_0xf766('0x1a')]['include']?_['map'](_0x34b15b[_0xf766('0x1a')][_0xf766('0x1e')],function(_0x17db6c){return{'model':db[_0x17db6c[_0xf766('0x1f')]],'as':_0x17db6c['as'],'attributes':_0x17db6c['attributes'],'include':_0x17db6c[_0xf766('0x1e')]?_[_0xf766('0x20')](_0x17db6c[_0xf766('0x1e')],function(_0x1b866f){return{'model':db[_0x1b866f[_0xf766('0x1f')]],'as':_0x1b866f['as'],'attributes':_0x1b866f['attributes'],'include':_0x1b866f[_0xf766('0x1e')]?_[_0xf766('0x20')](_0x1b866f[_0xf766('0x1e')],function(_0x3be1dc){return{'model':db[_0x3be1dc[_0xf766('0x1f')]],'as':_0x3be1dc['as'],'attributes':_0x3be1dc[_0xf766('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf766('0xc')](function(_0x195d92){logger['info'](_0xf766('0x17'),_0x34b15b);logger[_0xf766('0x10')](_0xf766('0x17'),_0x34b15b,JSON[_0xf766('0x21')](_0x195d92));_0x37be6f(_0x195d92);})['catch'](function(_0x614130){logger[_0xf766('0x12')](_0xf766('0x17'),_0x614130[_0xf766('0x14')],_0x34b15b);_0x3dc405(_0x29712f[_0xf766('0x12')](0x1f4,_0x614130[_0xf766('0x14')]));});});};exports[_0xf766('0x22')]=function(_0xa32b41){var _0x57551d=this;return new Promise(function(_0x27c003,_0xd1674c){return db[_0xf766('0x18')]['find']({'raw':_0xa32b41[_0xf766('0x1a')]?_0xa32b41['options'][_0xf766('0x1b')]===undefined?!![]:![]:!![],'where':_0xa32b41[_0xf766('0x1a')]?_0xa32b41['options'][_0xf766('0x1c')]||null:null,'attributes':_0xa32b41[_0xf766('0x1a')]?_0xa32b41[_0xf766('0x1a')]['attributes']||null:null,'include':_0xa32b41['options']?_0xa32b41[_0xf766('0x1a')][_0xf766('0x1e')]?_['map'](_0xa32b41['options'][_0xf766('0x1e')],function(_0xe3bd3f){return{'model':db[_0xe3bd3f[_0xf766('0x1f')]],'as':_0xe3bd3f['as'],'attributes':_0xe3bd3f['attributes'],'include':_0xe3bd3f[_0xf766('0x1e')]?_[_0xf766('0x20')](_0xe3bd3f['include'],function(_0x287214){return{'model':db[_0x287214[_0xf766('0x1f')]],'as':_0x287214['as'],'attributes':_0x287214[_0xf766('0x1d')],'include':_0x287214[_0xf766('0x1e')]?_[_0xf766('0x20')](_0x287214[_0xf766('0x1e')],function(_0x2ca88b){return{'model':db[_0x2ca88b['model']],'as':_0x2ca88b['as'],'attributes':_0x2ca88b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf766('0xc')](function(_0x132a03){logger[_0xf766('0xd')](_0xf766('0x22'),_0xa32b41);logger[_0xf766('0x10')](_0xf766('0x22'),_0xa32b41,JSON[_0xf766('0x21')](_0x132a03));_0x27c003(_0x132a03);})[_0xf766('0x16')](function(_0xd70fa9){logger[_0xf766('0x12')](_0xf766('0x22'),_0xd70fa9[_0xf766('0x14')],_0xa32b41);_0xd1674c(_0x57551d[_0xf766('0x12')](0x1f4,_0xd70fa9[_0xf766('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index f64b274..4f8309a 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 _0x635b=['length','mailQueue:','./mailQueue.events','save','remove','removeListener'];(function(_0x104b6e,_0x5bc6f9){var _0x15d1af=function(_0x3129ce){while(--_0x3129ce){_0x104b6e['push'](_0x104b6e['shift']());}};_0x15d1af(++_0x5bc6f9);}(_0x635b,0x16a));var _0xb635=function(_0x1c312e,_0x5cc58c){_0x1c312e=_0x1c312e-0x0;var _0x5d69c8=_0x635b[_0x1c312e];return _0x5d69c8;};'use strict';var MailQueueEvents=require(_0xb635('0x0'));var events=[_0xb635('0x1'),_0xb635('0x2'),'update'];function createListener(_0x1c23ef,_0x3d7b0d){return function(_0x174812){_0x3d7b0d['emit'](_0x1c23ef,_0x174812);};}function removeListener(_0x5f0bba,_0x5799ee){return function(){MailQueueEvents[_0xb635('0x3')](_0x5f0bba,_0x5799ee);};}exports['register']=function(_0x304add){for(var _0x4d81c2=0x0,_0x12fef0=events[_0xb635('0x4')];_0x4d81c2<_0x12fef0;_0x4d81c2++){var _0x3c9cff=events[_0x4d81c2];var _0x36fe81=createListener(_0xb635('0x5')+_0x3c9cff,_0x304add);MailQueueEvents['on'](_0x3c9cff,_0x36fe81);}}; \ No newline at end of file +var _0xd3ee=['mailQueue:','save','remove','update','removeListener','register','length'];(function(_0x4fe4fc,_0x59cf50){var _0x57ae93=function(_0x4d9015){while(--_0x4d9015){_0x4fe4fc['push'](_0x4fe4fc['shift']());}};_0x57ae93(++_0x59cf50);}(_0xd3ee,0x190));var _0xed3e=function(_0x332740,_0x267c85){_0x332740=_0x332740-0x0;var _0x2681ed=_0xd3ee[_0x332740];return _0x2681ed;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xed3e('0x0'),_0xed3e('0x1'),_0xed3e('0x2')];function createListener(_0x12b892,_0x22c54d){return function(_0x525099){_0x22c54d['emit'](_0x12b892,_0x525099);};}function removeListener(_0x3af229,_0x1a59da){return function(){MailQueueEvents[_0xed3e('0x3')](_0x3af229,_0x1a59da);};}exports[_0xed3e('0x4')]=function(_0xa91b0b){for(var _0x3c665e=0x0,_0x878d58=events[_0xed3e('0x5')];_0x3c665e<_0x878d58;_0x3c665e++){var _0x2deaad=events[_0x3c665e];var _0x44aec7=createListener(_0xed3e('0x6')+_0x2deaad,_0xa91b0b);MailQueueEvents['on'](_0x2deaad,_0x44aec7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0c69e1a..6708e0d 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 _0x94b6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94b6,0x189));var _0x694b=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x94b6[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x694b('0x0'));var util=require(_0x694b('0x1'));var path=require('path');var timeout=require(_0x694b('0x2'));var express=require(_0x694b('0x3'));var router=express[_0x694b('0x4')]();var fs_extra=require(_0x694b('0x5'));var auth=require(_0x694b('0x6'));var interaction=require(_0x694b('0x7'));var config=require(_0x694b('0x8'));var controller=require(_0x694b('0x9'));router[_0x694b('0xa')]('/',auth[_0x694b('0xb')](),controller[_0x694b('0xc')]);router[_0x694b('0xa')](_0x694b('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x694b('0xa')](_0x694b('0xe'),auth[_0x694b('0xb')](),controller[_0x694b('0xf')]);router[_0x694b('0x10')]('/',auth[_0x694b('0xb')](),controller[_0x694b('0x11')]);router[_0x694b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x694b('0x13')]);router['delete'](_0x694b('0xe'),auth[_0x694b('0xb')](),controller[_0x694b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7071=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','get','/:id','create','update','delete','exports','multer','util'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x7071,0x17a));var _0x1707=function(_0x433000,_0x32a65b){_0x433000=_0x433000-0x0;var _0x56d851=_0x7071[_0x433000];return _0x56d851;};'use strict';var multer=require(_0x1707('0x0'));var util=require(_0x1707('0x1'));var path=require(_0x1707('0x2'));var timeout=require(_0x1707('0x3'));var express=require(_0x1707('0x4'));var router=express[_0x1707('0x5')]();var fs_extra=require(_0x1707('0x6'));var auth=require(_0x1707('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1707('0x8'));var controller=require(_0x1707('0x9'));router['get']('/',auth[_0x1707('0xa')](),controller[_0x1707('0xb')]);router['get'](_0x1707('0xc'),auth[_0x1707('0xa')](),controller['describe']);router[_0x1707('0xd')](_0x1707('0xe'),auth[_0x1707('0xa')](),controller['show']);router['post']('/',auth[_0x1707('0xa')](),controller[_0x1707('0xf')]);router['put'](_0x1707('0xe'),auth['isAuthenticated'](),controller[_0x1707('0x10')]);router[_0x1707('0x11')](_0x1707('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1707('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index c95ac67..a10ad0b 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 _0xb9d5=['STRING','DATE','sequelize','exports'];(function(_0x45c7eb,_0x3f15e4){var _0x5f1f19=function(_0x107319){while(--_0x107319){_0x45c7eb['push'](_0x45c7eb['shift']());}};_0x5f1f19(++_0x3f15e4);}(_0xb9d5,0xb6));var _0x5b9d=function(_0x34df62,_0xabfcf9){_0x34df62=_0x34df62-0x0;var _0x307190=_0xb9d5[_0x34df62];return _0x307190;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b9d('0x0'));module[_0x5b9d('0x1')]={'uniqueid':{'type':Sequelize[_0x5b9d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5b9d('0x3')]},'acceptAt':{'type':Sequelize[_0x5b9d('0x3')]},'exitAt':{'type':Sequelize[_0x5b9d('0x3')]},'reason':{'type':Sequelize[_0x5b9d('0x2')]}}; \ No newline at end of file +var _0xb2bb=['moment','exports','STRING','DATE'];(function(_0x1fc1b3,_0x5442f){var _0x45a999=function(_0x33f65d){while(--_0x33f65d){_0x1fc1b3['push'](_0x1fc1b3['shift']());}};_0x45a999(++_0x5442f);}(_0xb2bb,0x198));var _0xbb2b=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0xb2bb[_0x69a451];return _0x3d6ef5;};'use strict';var moment=require(_0xbb2b('0x0'));var Sequelize=require('sequelize');module[_0xbb2b('0x1')]={'uniqueid':{'type':Sequelize[_0xbb2b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbb2b('0x2')]},'joinAt':{'type':Sequelize[_0xbb2b('0x3')]},'leaveAt':{'type':Sequelize[_0xbb2b('0x3')]},'acceptAt':{'type':Sequelize[_0xbb2b('0x3')]},'exitAt':{'type':Sequelize[_0xbb2b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 4444af9..6900f1f 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 _0xa456=['where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa456,0x142));var _0x6a45=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xa456[_0xe73080];return _0x12cbc4;};'use strict';var emlformat=require(_0x6a45('0x0'));var rimraf=require(_0x6a45('0x1'));var zipdir=require(_0x6a45('0x2'));var jsonpatch=require(_0x6a45('0x3'));var rp=require('request-promise');var moment=require(_0x6a45('0x4'));var BPromise=require(_0x6a45('0x5'));var Mustache=require(_0x6a45('0x6'));var util=require('util');var path=require(_0x6a45('0x7'));var sox=require(_0x6a45('0x8'));var csv=require(_0x6a45('0x9'));var ejs=require(_0x6a45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x511b92,_0x1aa4b4){_0x1aa4b4=_0x1aa4b4||0xcc;return function(_0x25a8b9){if(_0x25a8b9){return _0x511b92[_0x6a45('0x18')](_0x1aa4b4);}return _0x511b92[_0x6a45('0x19')](_0x1aa4b4)[_0x6a45('0x1a')]();};}function respondWithResult(_0x5a9f29,_0x563c3b){_0x563c3b=_0x563c3b||0xc8;return function(_0x3a5d94){if(_0x3a5d94){return _0x5a9f29[_0x6a45('0x19')](_0x563c3b)['json'](_0x3a5d94);}};}function respondWithFilteredResult(_0x2c20db,_0x171176){return function(_0x3fab82){if(_0x3fab82){var _0x13adc0=typeof _0x171176['offset']==='undefined'&&typeof _0x171176['limit']===_0x6a45('0x1b');var _0x391f81=_0x3fab82[_0x6a45('0x1c')];var _0x52a055=_0x13adc0?0x0:_0x171176[_0x6a45('0x1d')];var _0x102981=_0x13adc0?_0x3fab82[_0x6a45('0x1c')]:_0x171176['offset']+_0x171176['limit'];var _0x573453;if(_0x102981>=_0x391f81){_0x102981=_0x391f81;_0x573453=0xc8;}else{_0x573453=0xce;}_0x2c20db[_0x6a45('0x19')](_0x573453);return _0x2c20db[_0x6a45('0x1e')]('Content-Range',_0x52a055+'-'+_0x102981+'/'+_0x391f81)[_0x6a45('0x1f')](_0x3fab82);}return null;};}function patchUpdates(_0x1be485){return function(_0x4f7000){try{jsonpatch[_0x6a45('0x20')](_0x4f7000,_0x1be485,!![]);}catch(_0xdf10c6){return BPromise[_0x6a45('0x21')](_0xdf10c6);}return _0x4f7000[_0x6a45('0x22')]();};}function saveUpdates(_0x15ad0e,_0x487666){return function(_0x5d990e){if(_0x5d990e){return _0x5d990e[_0x6a45('0x23')](_0x15ad0e)[_0x6a45('0x24')](function(_0x11290c){return _0x11290c;});}return null;};}function removeEntity(_0x22373c,_0x25a380){return function(_0x3ad898){if(_0x3ad898){return _0x3ad898[_0x6a45('0x25')]()[_0x6a45('0x24')](function(){_0x22373c[_0x6a45('0x19')](0xcc)[_0x6a45('0x1a')]();});}};}function handleEntityNotFound(_0x1310d7,_0x46587a){return function(_0x5cd761){if(!_0x5cd761){_0x1310d7[_0x6a45('0x18')](0x194);}return _0x5cd761;};}function handleError(_0x5a0389,_0x1b83fa){_0x1b83fa=_0x1b83fa||0x1f4;return function(_0x25467d){logger[_0x6a45('0x26')](_0x25467d[_0x6a45('0x27')]);if(_0x25467d[_0x6a45('0x28')]){delete _0x25467d['name'];}_0x5a0389[_0x6a45('0x19')](_0x1b83fa)[_0x6a45('0x29')](_0x25467d);};}exports[_0x6a45('0x2a')]=function(_0x1ccff0,_0x8265d9){var _0x227b6f={},_0x3fac9b={},_0x313c13={'count':0x0,'rows':[]};var _0x54286d=_[_0x6a45('0x2b')](db[_0x6a45('0x2c')][_0x6a45('0x2d')],function(_0x201369){return{'name':_0x201369[_0x6a45('0x2e')],'type':_0x201369['type'][_0x6a45('0x2f')]};});_0x3fac9b[_0x6a45('0x30')]=_[_0x6a45('0x2b')](_0x54286d,_0x6a45('0x28'));_0x3fac9b['query']=_['keys'](_0x1ccff0[_0x6a45('0x31')]);_0x3fac9b['filters']=_[_0x6a45('0x32')](_0x3fac9b['model'],_0x3fac9b[_0x6a45('0x31')]);_0x227b6f[_0x6a45('0x33')]=_[_0x6a45('0x32')](_0x3fac9b[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x34')]));_0x227b6f[_0x6a45('0x33')]=_0x227b6f[_0x6a45('0x33')][_0x6a45('0x35')]?_0x227b6f[_0x6a45('0x33')]:_0x3fac9b[_0x6a45('0x30')];if(!_0x1ccff0[_0x6a45('0x31')]['hasOwnProperty'](_0x6a45('0x36'))){_0x227b6f['limit']=qs[_0x6a45('0x37')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x37')]);_0x227b6f[_0x6a45('0x1d')]=qs[_0x6a45('0x1d')](_0x1ccff0[_0x6a45('0x31')]['offset']);}_0x227b6f[_0x6a45('0x38')]=qs[_0x6a45('0x39')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x39')]);_0x227b6f[_0x6a45('0x3a')]=qs[_0x6a45('0x3b')](_['pick'](_0x1ccff0[_0x6a45('0x31')],_0x3fac9b[_0x6a45('0x3b')]),_0x54286d);if(_0x1ccff0['query'][_0x6a45('0x3c')]){_0x227b6f[_0x6a45('0x3a')]=_[_0x6a45('0x3d')](_0x227b6f[_0x6a45('0x3a')],{'$or':_[_0x6a45('0x2b')](_0x54286d,function(_0x50ebe0){if(_0x50ebe0[_0x6a45('0x3e')]!==_0x6a45('0x3f')){var _0x205afd={};_0x205afd[_0x50ebe0[_0x6a45('0x28')]]={'$like':'%'+_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x3c')]+'%'};return _0x205afd;}})});}_0x227b6f=_[_0x6a45('0x3d')]({},_0x227b6f,_0x1ccff0['options']);var _0x1c941a={'where':_0x227b6f['where']};return db[_0x6a45('0x2c')][_0x6a45('0x1c')](_0x1c941a)[_0x6a45('0x24')](function(_0x2715dc){_0x313c13['count']=_0x2715dc;if(_0x1ccff0['query'][_0x6a45('0x40')]){_0x227b6f[_0x6a45('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6a45('0x42')](_0x227b6f);})[_0x6a45('0x24')](function(_0x3bd926){_0x313c13[_0x6a45('0x43')]=_0x3bd926;return _0x313c13;})['then'](respondWithFilteredResult(_0x8265d9,_0x227b6f))['catch'](handleError(_0x8265d9,null));};exports['show']=function(_0x5b9798,_0xe90201){var _0xb5d191={'raw':!![],'where':{'id':_0x5b9798[_0x6a45('0x44')]['id']}},_0x328d9f={};_0x328d9f[_0x6a45('0x30')]=_[_0x6a45('0x45')](db[_0x6a45('0x2c')][_0x6a45('0x2d')]);_0x328d9f['query']=_[_0x6a45('0x45')](_0x5b9798['query']);_0x328d9f['filters']=_[_0x6a45('0x32')](_0x328d9f[_0x6a45('0x30')],_0x328d9f['query']);_0xb5d191[_0x6a45('0x33')]=_['intersection'](_0x328d9f[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x5b9798[_0x6a45('0x31')][_0x6a45('0x34')]));_0xb5d191['attributes']=_0xb5d191[_0x6a45('0x33')][_0x6a45('0x35')]?_0xb5d191[_0x6a45('0x33')]:_0x328d9f[_0x6a45('0x30')];if(_0x5b9798[_0x6a45('0x31')]['includeAll']){_0xb5d191[_0x6a45('0x41')]=[{'all':!![]}];}_0xb5d191=_['merge']({},_0xb5d191,_0x5b9798[_0x6a45('0x46')]);return db[_0x6a45('0x2c')]['find'](_0xb5d191)[_0x6a45('0x24')](handleEntityNotFound(_0xe90201,null))[_0x6a45('0x24')](respondWithResult(_0xe90201,null))[_0x6a45('0x47')](handleError(_0xe90201,null));};exports[_0x6a45('0x48')]=function(_0x524296,_0x34bbb7){return db['MailQueueReport'][_0x6a45('0x48')](_0x524296['body'],{})[_0x6a45('0x24')](respondWithResult(_0x34bbb7,0xc9))[_0x6a45('0x47')](handleError(_0x34bbb7,null));};exports[_0x6a45('0x23')]=function(_0x2bf8d3,_0x5d9f52){if(_0x2bf8d3[_0x6a45('0x49')]['id']){delete _0x2bf8d3[_0x6a45('0x49')]['id'];}return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x2bf8d3[_0x6a45('0x44')]['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x5d9f52,null))[_0x6a45('0x24')](saveUpdates(_0x2bf8d3[_0x6a45('0x49')],null))[_0x6a45('0x24')](respondWithResult(_0x5d9f52,null))[_0x6a45('0x47')](handleError(_0x5d9f52,null));};exports['destroy']=function(_0x3ea4a7,_0x8877c7){return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x3ea4a7['params']['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x8877c7,null))[_0x6a45('0x24')](removeEntity(_0x8877c7,null))[_0x6a45('0x47')](handleError(_0x8877c7,null));};exports['describe']=function(_0x4e7967,_0x5a17b8){return db[_0x6a45('0x2c')][_0x6a45('0x4b')]()[_0x6a45('0x24')](respondWithResult(_0x5a17b8,null))[_0x6a45('0x47')](handleError(_0x5a17b8,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0x0295,0x1f0));var _0x5029=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0x0295[_0x51d71a];return _0xff01f1;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c2c471a..08c96ea 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 _0x5ad7=['util','../../config/logger','api','moment','bluebird','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x58de95,_0x533852){var _0x58ab14=function(_0x11bbc7){while(--_0x11bbc7){_0x58de95['push'](_0x58de95['shift']());}};_0x58ab14(++_0x533852);}(_0x5ad7,0xbb));var _0x75ad=function(_0x48077f,_0x3bf7e1){_0x48077f=_0x48077f-0x0;var _0x27a417=_0x5ad7[_0x48077f];return _0x27a417;};'use strict';var _=require('lodash');var util=require(_0x75ad('0x0'));var logger=require(_0x75ad('0x1'))(_0x75ad('0x2'));var moment=require(_0x75ad('0x3'));var BPromise=require(_0x75ad('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(_0x75ad('0x5'));module[_0x75ad('0x6')]=function(_0x4a4ee4,_0x15f049){return _0x4a4ee4[_0x75ad('0x7')](_0x75ad('0x8'),attributes,{'tableName':_0x75ad('0x9'),'paranoid':![],'indexes':[{'name':_0x75ad('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a97=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','report_mail_queue','uniqueid'];(function(_0x54b7a1,_0x9a3a29){var _0x3f74f3=function(_0x176e1c){while(--_0x176e1c){_0x54b7a1['push'](_0x54b7a1['shift']());}};_0x3f74f3(++_0x9a3a29);}(_0x8a97,0x15c));var _0x78a9=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8a97[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x78a9('0x0'));var util=require(_0x78a9('0x1'));var logger=require(_0x78a9('0x2'))(_0x78a9('0x3'));var moment=require(_0x78a9('0x4'));var BPromise=require(_0x78a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78a9('0x6'));var rimraf=require(_0x78a9('0x7'));var config=require(_0x78a9('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x78a9('0x9')]=function(_0x4cd92b,_0x1e196d){return _0x4cd92b['define']('MailQueueReport',attributes,{'tableName':_0x78a9('0xa'),'paranoid':![],'indexes':[{'name':_0x78a9('0xb'),'fields':[_0x78a9('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 cc4e621..6257b8b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x54de37,_0x16912b){var _0x5c0a8b=function(_0x2ce455){while(--_0x2ce455){_0x54de37['push'](_0x54de37['shift']());}};_0x5c0a8b(++_0x16912b);}(_0x1261,0x144));var _0x1126=function(_0x465533,_0x56ab66){_0x465533=_0x465533-0x0;var _0x49489b=_0x1261[_0x465533];return _0x49489b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0xe327be,_0x3fbe7f){var _0x3e677a=function(_0x5109b1){while(--_0x5109b1){_0xe327be['push'](_0xe327be['shift']());}};_0x3e677a(++_0x3fbe7f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index ed5b1ea..19f8570 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(_0x44e78e,_0x5f2ba5){var _0xff1bb2=function(_0x1dc6a8){while(--_0x1dc6a8){_0x44e78e['push'](_0x44e78e['shift']());}};_0xff1bb2(++_0x5f2ba5);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3c9df8,_0x387a5d){var _0x3c8cd3=function(_0x4a0541){while(--_0x4a0541){_0x3c9df8['push'](_0x3c9df8['shift']());}};_0x3c8cd3(++_0x387a5d);}(_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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0594861..08d8d4b 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 _0xb7e7=['INBOX','sequelize','STRING','BOOLEAN'];(function(_0x3b740d,_0x243824){var _0x90546c=function(_0x5c96df){while(--_0x5c96df){_0x3b740d['push'](_0x3b740d['shift']());}};_0x90546c(++_0x243824);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7b7e('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x823c=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x16bd44,_0x3c91ba){var _0x368a61=function(_0x1c68ab){while(--_0x1c68ab){_0x16bd44['push'](_0x16bd44['shift']());}};_0x368a61(++_0x3c91ba);}(_0x823c,0x143));var _0xc823=function(_0x29f42a,_0x544352){_0x29f42a=_0x29f42a-0x0;var _0xbcb9db=_0x823c[_0x29f42a];return _0xbcb9db;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'description':{'type':Sequelize[_0xc823('0x1')]},'host':{'type':Sequelize[_0xc823('0x1')]},'authentication':{'type':Sequelize[_0xc823('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc823('0x1')]},'password':{'type':Sequelize[_0xc823('0x1')]},'port':{'type':Sequelize[_0xc823('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc823('0x1')],'defaultValue':_0xc823('0x4')},'connTimeout':{'type':Sequelize[_0xc823('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc823('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc823('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 695bc49..9525bb6 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 _0x06a4=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in'];(function(_0x329703,_0x5368c9){var _0x5e2928=function(_0x33792e){while(--_0x33792e){_0x329703['push'](_0x329703['shift']());}};_0x5e2928(++_0x5368c9);}(_0x06a4,0x1c3));var _0x406a=function(_0xd3c515,_0x27b9bf){_0xd3c515=_0xd3c515-0x0;var _0x526fac=_0x06a4[_0xd3c515];return _0x526fac;};'use strict';var _=require(_0x406a('0x0'));var util=require(_0x406a('0x1'));var logger=require(_0x406a('0x2'))(_0x406a('0x3'));var moment=require('moment');var BPromise=require(_0x406a('0x4'));var rp=require(_0x406a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x406a('0x6'));var config=require(_0x406a('0x7'));var attributes=require(_0x406a('0x8'));module['exports']=function(_0x4c3e0d,_0xc2163b){return _0x4c3e0d['define'](_0x406a('0x9'),attributes,{'tableName':_0x406a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x423a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x70d1cf,_0x37a23c){var _0x15d03b=function(_0x255495){while(--_0x255495){_0x70d1cf['push'](_0x70d1cf['shift']());}};_0x15d03b(++_0x37a23c);}(_0x423a,0x1b8));var _0xa423=function(_0x2e7bc8,_0x4aa22a){_0x2e7bc8=_0x2e7bc8-0x0;var _0x49ee89=_0x423a[_0x2e7bc8];return _0x49ee89;};'use strict';var _=require(_0xa423('0x0'));var util=require(_0xa423('0x1'));var logger=require('../../config/logger')(_0xa423('0x2'));var moment=require(_0xa423('0x3'));var BPromise=require(_0xa423('0x4'));var rp=require(_0xa423('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa423('0x6'));var config=require(_0xa423('0x7'));var attributes=require(_0xa423('0x8'));module[_0xa423('0x9')]=function(_0x398267,_0x243b02){return _0x398267[_0xa423('0xa')](_0xa423('0xb'),attributes,{'tableName':_0xa423('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 b0e0b86..d6a6fad 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 _0xa0aa=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','options','raw','limit','include','model','attributes','map','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x1c3763,_0x15f7ee){var _0x29509c=function(_0x351228){while(--_0x351228){_0x1c3763['push'](_0x1c3763['shift']());}};_0x29509c(++_0x15f7ee);}(_0xa0aa,0x19b));var _0xaa0a=function(_0x4f08b9,_0xfa989f){_0x4f08b9=_0x4f08b9-0x0;var _0x42fcb6=_0xa0aa[_0x4f08b9];return _0x42fcb6;};'use strict';var _=require(_0xaa0a('0x0'));var util=require(_0xaa0a('0x1'));var moment=require('moment');var BPromise=require(_0xaa0a('0x2'));var rs=require(_0xaa0a('0x3'));var fs=require('fs');var Redis=require(_0xaa0a('0x4'));var db=require(_0xaa0a('0x5'))['db'];var utils=require(_0xaa0a('0x6'));var logger=require(_0xaa0a('0x7'))(_0xaa0a('0x8'));var config=require(_0xaa0a('0x9'));var jayson=require(_0xaa0a('0xa'));var client=jayson[_0xaa0a('0xb')][_0xaa0a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf80d91,_0x1cc2da,_0x5431c8){return new BPromise(function(_0x18a450,_0x441c7f){return client[_0xaa0a('0xd')](_0xf80d91,_0x5431c8)[_0xaa0a('0xe')](function(_0x4e41e9){logger[_0xaa0a('0xf')](_0xaa0a('0x10'),_0x1cc2da,_0xaa0a('0x11'));logger['debug'](_0xaa0a('0x12'),_0x1cc2da,_0xaa0a('0x11'),JSON[_0xaa0a('0x13')](_0x4e41e9));if(_0x4e41e9[_0xaa0a('0x14')]){if(_0x4e41e9[_0xaa0a('0x14')][_0xaa0a('0x15')]===0x1f4){logger['error'](_0xaa0a('0x10'),_0x1cc2da,_0x4e41e9[_0xaa0a('0x14')]['message']);return _0x441c7f(_0x4e41e9['error'][_0xaa0a('0x16')]);}logger['error'](_0xaa0a('0x10'),_0x1cc2da,_0x4e41e9[_0xaa0a('0x14')][_0xaa0a('0x16')]);return _0x18a450(_0x4e41e9[_0xaa0a('0x14')][_0xaa0a('0x16')]);}else{logger['info'](_0xaa0a('0x10'),_0x1cc2da,_0xaa0a('0x11'));_0x18a450(_0x4e41e9['result']['message']);}})[_0xaa0a('0x17')](function(_0x439af3){logger[_0xaa0a('0x14')](_0xaa0a('0x10'),_0x1cc2da,_0x439af3);_0x441c7f(_0x439af3);});});}exports[_0xaa0a('0x18')]=function(_0x5dd81f){var _0x1e6e48=this;return new Promise(function(_0x4061a9,_0x4f84b7){return db['MailServerIn']['findAll']({'raw':_0x5dd81f['options']?_0x5dd81f[_0xaa0a('0x19')][_0xaa0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5dd81f[_0xaa0a('0x19')]?_0x5dd81f[_0xaa0a('0x19')]['where']||null:null,'attributes':_0x5dd81f[_0xaa0a('0x19')]?_0x5dd81f[_0xaa0a('0x19')]['attributes']||null:null,'limit':_0x5dd81f['options']?_0x5dd81f['options'][_0xaa0a('0x1b')]||null:null,'include':_0x5dd81f[_0xaa0a('0x19')]?_0x5dd81f['options'][_0xaa0a('0x1c')]?_['map'](_0x5dd81f[_0xaa0a('0x19')][_0xaa0a('0x1c')],function(_0x2d0b29){return{'model':db[_0x2d0b29[_0xaa0a('0x1d')]],'as':_0x2d0b29['as'],'attributes':_0x2d0b29[_0xaa0a('0x1e')],'include':_0x2d0b29[_0xaa0a('0x1c')]?_['map'](_0x2d0b29[_0xaa0a('0x1c')],function(_0x4d56ee){return{'model':db[_0x4d56ee[_0xaa0a('0x1d')]],'as':_0x4d56ee['as'],'attributes':_0x4d56ee[_0xaa0a('0x1e')],'include':_0x4d56ee['include']?_[_0xaa0a('0x1f')](_0x4d56ee[_0xaa0a('0x1c')],function(_0x1e0d5b){return{'model':db[_0x1e0d5b[_0xaa0a('0x1d')]],'as':_0x1e0d5b['as'],'attributes':_0x1e0d5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa0a('0xe')](function(_0x101c43){logger[_0xaa0a('0xf')](_0xaa0a('0x18'),_0x5dd81f);logger[_0xaa0a('0x20')](_0xaa0a('0x18'),_0x5dd81f,JSON[_0xaa0a('0x13')](_0x101c43));_0x4061a9(_0x101c43);})[_0xaa0a('0x17')](function(_0x51adbb){logger[_0xaa0a('0x14')](_0xaa0a('0x18'),_0x51adbb[_0xaa0a('0x16')],_0x5dd81f);_0x4f84b7(_0x1e6e48[_0xaa0a('0x14')](0x1f4,_0x51adbb[_0xaa0a('0x16')]));});});}; \ No newline at end of file +var _0x2379=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','request\x20sent','result','MailServerIn','findAll','raw','options','where','include','map','attributes','debug','catch','GetMailServerIn','bluebird','randomstring'];(function(_0x1c336b,_0x53b499){var _0x469321=function(_0x2e6512){while(--_0x2e6512){_0x1c336b['push'](_0x1c336b['shift']());}};_0x469321(++_0x53b499);}(_0x2379,0x82));var _0x9237=function(_0x3a03f0,_0xcd2bc2){_0x3a03f0=_0x3a03f0-0x0;var _0x241961=_0x2379[_0x3a03f0];return _0x241961;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9237('0x0'));var rs=require(_0x9237('0x1'));var fs=require('fs');var Redis=require(_0x9237('0x2'));var db=require(_0x9237('0x3'))['db'];var utils=require(_0x9237('0x4'));var logger=require(_0x9237('0x5'))(_0x9237('0x6'));var config=require(_0x9237('0x7'));var jayson=require(_0x9237('0x8'));var client=jayson[_0x9237('0x9')][_0x9237('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f5692,_0x4c961a,_0x3895f9){return new BPromise(function(_0x14d42f,_0x460dff){return client[_0x9237('0xb')](_0x5f5692,_0x3895f9)[_0x9237('0xc')](function(_0x227265){logger[_0x9237('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4c961a,'request\x20sent');logger['debug'](_0x9237('0xe'),_0x4c961a,'request\x20sent',JSON[_0x9237('0xf')](_0x227265));if(_0x227265[_0x9237('0x10')]){if(_0x227265[_0x9237('0x10')][_0x9237('0x11')]===0x1f4){logger['error'](_0x9237('0x12'),_0x4c961a,_0x227265['error']['message']);return _0x460dff(_0x227265[_0x9237('0x10')][_0x9237('0x13')]);}logger[_0x9237('0x10')](_0x9237('0x12'),_0x4c961a,_0x227265['error'][_0x9237('0x13')]);return _0x14d42f(_0x227265[_0x9237('0x10')]['message']);}else{logger[_0x9237('0xd')](_0x9237('0x12'),_0x4c961a,_0x9237('0x14'));_0x14d42f(_0x227265[_0x9237('0x15')]['message']);}})['catch'](function(_0x36666f){logger['error']('MailServerIn,\x20%s,\x20%s',_0x4c961a,_0x36666f);_0x460dff(_0x36666f);});});}exports['GetMailServerIn']=function(_0x1ff34b){var _0x48fe14=this;return new Promise(function(_0x427404,_0x14128e){return db[_0x9237('0x16')][_0x9237('0x17')]({'raw':_0x1ff34b['options']?_0x1ff34b['options'][_0x9237('0x18')]===undefined?!![]:![]:!![],'where':_0x1ff34b[_0x9237('0x19')]?_0x1ff34b[_0x9237('0x19')][_0x9237('0x1a')]||null:null,'attributes':_0x1ff34b[_0x9237('0x19')]?_0x1ff34b[_0x9237('0x19')]['attributes']||null:null,'limit':_0x1ff34b[_0x9237('0x19')]?_0x1ff34b[_0x9237('0x19')]['limit']||null:null,'include':_0x1ff34b['options']?_0x1ff34b[_0x9237('0x19')][_0x9237('0x1b')]?_[_0x9237('0x1c')](_0x1ff34b['options'][_0x9237('0x1b')],function(_0x4007b5){return{'model':db[_0x4007b5['model']],'as':_0x4007b5['as'],'attributes':_0x4007b5[_0x9237('0x1d')],'include':_0x4007b5[_0x9237('0x1b')]?_[_0x9237('0x1c')](_0x4007b5[_0x9237('0x1b')],function(_0x21fcc9){return{'model':db[_0x21fcc9['model']],'as':_0x21fcc9['as'],'attributes':_0x21fcc9[_0x9237('0x1d')],'include':_0x21fcc9[_0x9237('0x1b')]?_[_0x9237('0x1c')](_0x21fcc9[_0x9237('0x1b')],function(_0x561be9){return{'model':db[_0x561be9['model']],'as':_0x561be9['as'],'attributes':_0x561be9[_0x9237('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9237('0xc')](function(_0x250dd4){logger[_0x9237('0xd')]('GetMailServerIn',_0x1ff34b);logger[_0x9237('0x1e')]('GetMailServerIn',_0x1ff34b,JSON[_0x9237('0xf')](_0x250dd4));_0x427404(_0x250dd4);})[_0x9237('0x1f')](function(_0x58025e){logger[_0x9237('0x10')](_0x9237('0x20'),_0x58025e[_0x9237('0x13')],_0x1ff34b);_0x14128e(_0x48fe14[_0x9237('0x10')](0x1f4,_0x58025e[_0x9237('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3c9c568..cacf75d 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(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x213ee6,_0x3b6c56){_0x213ee6=_0x213ee6-0x0;var _0x5e5d1d=_0x7a54[_0x213ee6];return _0x5e5d1d;};'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(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7a54,0x106));var _0x47a5=function(_0x29b346,_0x28cdae){_0x29b346=_0x29b346-0x0;var _0x45b025=_0x7a54[_0x29b346];return _0x45b025;};'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 8ec74fc..1d115bc 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 _0x116a=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x13f73c,_0x9a5352){var _0x19ada4=function(_0x2802a5){while(--_0x2802a5){_0x13f73c['push'](_0x13f73c['shift']());}};_0x19ada4(++_0x9a5352);}(_0x116a,0x174));var _0xa116=function(_0x57bdd5,_0x16e514){_0x57bdd5=_0x57bdd5-0x0;var _0x288a8f=_0x116a[_0x57bdd5];return _0x288a8f;};'use strict';var Sequelize=require(_0xa116('0x0'));module[_0xa116('0x1')]={'description':{'type':Sequelize[_0xa116('0x2')]},'host':{'type':Sequelize[_0xa116('0x2')]},'user':{'type':Sequelize[_0xa116('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa116('0x3')]},'secure':{'type':Sequelize[_0xa116('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xa116('0x2')]},'authentication':{'type':Sequelize[_0xa116('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc0ef=['STRING','BOOLEAN','sequelize','exports'];(function(_0x53c39b,_0x1d98a5){var _0x5a7c05=function(_0x3a5c8d){while(--_0x3a5c8d){_0x53c39b['push'](_0x53c39b['shift']());}};_0x5a7c05(++_0x1d98a5);}(_0xc0ef,0xee));var _0xfc0e=function(_0x30fd2c,_0x344750){_0x30fd2c=_0x30fd2c-0x0;var _0x4a4f1f=_0xc0ef[_0x30fd2c];return _0x4a4f1f;};'use strict';var Sequelize=require(_0xfc0e('0x0'));module[_0xfc0e('0x1')]={'description':{'type':Sequelize[_0xfc0e('0x2')]},'host':{'type':Sequelize[_0xfc0e('0x2')]},'user':{'type':Sequelize[_0xfc0e('0x2')]},'pass':{'type':Sequelize[_0xfc0e('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xfc0e('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xfc0e('0x2')]},'authentication':{'type':Sequelize[_0xfc0e('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 8198b11..18901b5 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 _0x46ea=['merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','pick','where'];(function(_0x49090b,_0x158c9d){var _0x29caa7=function(_0x23e6f0){while(--_0x23e6f0){_0x49090b['push'](_0x49090b['shift']());}};_0x29caa7(++_0x158c9d);}(_0x46ea,0x13c));var _0xa46e=function(_0x3bd4a5,_0x2597bd){_0x3bd4a5=_0x3bd4a5-0x0;var _0x41d843=_0x46ea[_0x3bd4a5];return _0x41d843;};'use strict';var emlformat=require(_0xa46e('0x0'));var rimraf=require(_0xa46e('0x1'));var zipdir=require(_0xa46e('0x2'));var jsonpatch=require(_0xa46e('0x3'));var rp=require(_0xa46e('0x4'));var moment=require(_0xa46e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa46e('0x6'));var util=require(_0xa46e('0x7'));var path=require(_0xa46e('0x8'));var sox=require(_0xa46e('0x9'));var csv=require('to-csv');var ejs=require(_0xa46e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa46e('0xb'));var squel=require(_0xa46e('0xc'));var crypto=require(_0xa46e('0xd'));var jsforce=require(_0xa46e('0xe'));var deskjs=require(_0xa46e('0xf'));var toCsv=require(_0xa46e('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa46e('0x11'));var authService=require(_0xa46e('0x12'));var qs=require(_0xa46e('0x13'));var as=require(_0xa46e('0x14'));var hardwareService=require(_0xa46e('0x15'));var logger=require('../../config/logger')(_0xa46e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa46e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3569a2,_0x34c2f2){_0x34c2f2=_0x34c2f2||0xcc;return function(_0x4db09b){if(_0x4db09b){return _0x3569a2[_0xa46e('0x18')](_0x34c2f2);}return _0x3569a2['status'](_0x34c2f2)['end']();};}function respondWithResult(_0x3694e9,_0x537717){_0x537717=_0x537717||0xc8;return function(_0x19db40){if(_0x19db40){return _0x3694e9[_0xa46e('0x19')](_0x537717)[_0xa46e('0x1a')](_0x19db40);}};}function respondWithFilteredResult(_0x5b53a1,_0x545bb2){return function(_0x1c874a){if(_0x1c874a){var _0x1c4d78=typeof _0x545bb2[_0xa46e('0x1b')]===_0xa46e('0x1c')&&typeof _0x545bb2[_0xa46e('0x1d')]==='undefined';var _0x3e08b5=_0x1c874a['count'];var _0x3d9f2b=_0x1c4d78?0x0:_0x545bb2[_0xa46e('0x1b')];var _0x2a1a21=_0x1c4d78?_0x1c874a['count']:_0x545bb2[_0xa46e('0x1b')]+_0x545bb2[_0xa46e('0x1d')];var _0x5a8521;if(_0x2a1a21>=_0x3e08b5){_0x2a1a21=_0x3e08b5;_0x5a8521=0xc8;}else{_0x5a8521=0xce;}_0x5b53a1['status'](_0x5a8521);return _0x5b53a1[_0xa46e('0x1e')](_0xa46e('0x1f'),_0x3d9f2b+'-'+_0x2a1a21+'/'+_0x3e08b5)[_0xa46e('0x1a')](_0x1c874a);}return null;};}function patchUpdates(_0x698a4){return function(_0x5e8b6e){try{jsonpatch[_0xa46e('0x20')](_0x5e8b6e,_0x698a4,!![]);}catch(_0x246c9c){return BPromise[_0xa46e('0x21')](_0x246c9c);}return _0x5e8b6e[_0xa46e('0x22')]();};}function saveUpdates(_0x1ff20e,_0x251480){return function(_0x141a08){if(_0x141a08){return _0x141a08[_0xa46e('0x23')](_0x1ff20e)[_0xa46e('0x24')](function(_0x579738){return _0x579738;});}return null;};}function removeEntity(_0x1c6bdf,_0x38113d){return function(_0x4d0fd6){if(_0x4d0fd6){return _0x4d0fd6[_0xa46e('0x25')]()['then'](function(){_0x1c6bdf[_0xa46e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218dd4,_0x2dd29c){return function(_0x146cf8){if(!_0x146cf8){_0x218dd4[_0xa46e('0x18')](0x194);}return _0x146cf8;};}function handleError(_0x50730d,_0x3c410b){_0x3c410b=_0x3c410b||0x1f4;return function(_0x1c60eb){logger['error'](_0x1c60eb[_0xa46e('0x26')]);if(_0x1c60eb['name']){delete _0x1c60eb[_0xa46e('0x27')];}_0x50730d[_0xa46e('0x19')](_0x3c410b)[_0xa46e('0x28')](_0x1c60eb);};}exports[_0xa46e('0x29')]=function(_0xa1421c,_0x4e2c89){var _0x413a92={},_0x41dc9f={},_0x4c4c4d={'count':0x0,'rows':[]};var _0x341e45=_[_0xa46e('0x2a')](db[_0xa46e('0x2b')][_0xa46e('0x2c')],function(_0x1cb708){return{'name':_0x1cb708[_0xa46e('0x2d')],'type':_0x1cb708[_0xa46e('0x2e')][_0xa46e('0x2f')]};});_0x41dc9f['model']=_[_0xa46e('0x2a')](_0x341e45,_0xa46e('0x27'));_0x41dc9f[_0xa46e('0x30')]=_[_0xa46e('0x31')](_0xa1421c[_0xa46e('0x30')]);_0x41dc9f[_0xa46e('0x32')]=_[_0xa46e('0x33')](_0x41dc9f['model'],_0x41dc9f[_0xa46e('0x30')]);_0x413a92[_0xa46e('0x34')]=_[_0xa46e('0x33')](_0x41dc9f[_0xa46e('0x35')],qs[_0xa46e('0x36')](_0xa1421c[_0xa46e('0x30')]['fields']));_0x413a92['attributes']=_0x413a92[_0xa46e('0x34')]['length']?_0x413a92[_0xa46e('0x34')]:_0x41dc9f[_0xa46e('0x35')];if(!_0xa1421c[_0xa46e('0x30')][_0xa46e('0x37')]('nolimit')){_0x413a92['limit']=qs[_0xa46e('0x1d')](_0xa1421c[_0xa46e('0x30')][_0xa46e('0x1d')]);_0x413a92['offset']=qs[_0xa46e('0x1b')](_0xa1421c[_0xa46e('0x30')]['offset']);}_0x413a92['order']=qs[_0xa46e('0x38')](_0xa1421c[_0xa46e('0x30')][_0xa46e('0x38')]);_0x413a92['where']=qs['filters'](_[_0xa46e('0x39')](_0xa1421c['query'],_0x41dc9f[_0xa46e('0x32')]),_0x341e45);if(_0xa1421c[_0xa46e('0x30')]['filter']){_0x413a92[_0xa46e('0x3a')]=_[_0xa46e('0x3b')](_0x413a92['where'],{'$or':_[_0xa46e('0x2a')](_0x341e45,function(_0xb82734){if(_0xb82734['type']!==_0xa46e('0x3c')){var _0x2204eb={};_0x2204eb[_0xb82734[_0xa46e('0x27')]]={'$like':'%'+_0xa1421c[_0xa46e('0x30')][_0xa46e('0x3d')]+'%'};return _0x2204eb;}})});}_0x413a92=_[_0xa46e('0x3b')]({},_0x413a92,_0xa1421c[_0xa46e('0x3e')]);var _0x2e28ce={'where':_0x413a92['where']};return db['MailServerOut'][_0xa46e('0x3f')](_0x2e28ce)[_0xa46e('0x24')](function(_0x41d5be){_0x4c4c4d[_0xa46e('0x3f')]=_0x41d5be;if(_0xa1421c['query']['includeAll']){_0x413a92[_0xa46e('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0xa46e('0x41')](_0x413a92);})[_0xa46e('0x24')](function(_0x408641){_0x4c4c4d[_0xa46e('0x42')]=_0x408641;return _0x4c4c4d;})[_0xa46e('0x24')](respondWithFilteredResult(_0x4e2c89,_0x413a92))[_0xa46e('0x43')](handleError(_0x4e2c89,null));};exports[_0xa46e('0x44')]=function(_0x16b52f,_0x395be2){var _0x52aea6={'raw':!![],'where':{'id':_0x16b52f[_0xa46e('0x45')]['id']}},_0x43ee10={};_0x43ee10[_0xa46e('0x35')]=_[_0xa46e('0x31')](db[_0xa46e('0x2b')][_0xa46e('0x2c')]);_0x43ee10[_0xa46e('0x30')]=_[_0xa46e('0x31')](_0x16b52f['query']);_0x43ee10['filters']=_['intersection'](_0x43ee10['model'],_0x43ee10[_0xa46e('0x30')]);_0x52aea6[_0xa46e('0x34')]=_[_0xa46e('0x33')](_0x43ee10[_0xa46e('0x35')],qs['fields'](_0x16b52f[_0xa46e('0x30')][_0xa46e('0x36')]));_0x52aea6[_0xa46e('0x34')]=_0x52aea6[_0xa46e('0x34')][_0xa46e('0x46')]?_0x52aea6[_0xa46e('0x34')]:_0x43ee10['model'];if(_0x16b52f[_0xa46e('0x30')][_0xa46e('0x47')]){_0x52aea6[_0xa46e('0x40')]=[{'all':!![]}];}_0x52aea6=_[_0xa46e('0x3b')]({},_0x52aea6,_0x16b52f['options']);return db['MailServerOut'][_0xa46e('0x48')](_0x52aea6)[_0xa46e('0x24')](handleEntityNotFound(_0x395be2,null))[_0xa46e('0x24')](respondWithResult(_0x395be2,null))[_0xa46e('0x43')](handleError(_0x395be2,null));};exports[_0xa46e('0x49')]=function(_0xcf7bf1,_0x3ee064){return db[_0xa46e('0x2b')][_0xa46e('0x49')](_0xcf7bf1[_0xa46e('0x4a')],{})[_0xa46e('0x24')](respondWithResult(_0x3ee064,0xc9))[_0xa46e('0x43')](handleError(_0x3ee064,null));};exports['update']=function(_0x48a535,_0x3db1ae){if(_0x48a535[_0xa46e('0x4a')]['id']){delete _0x48a535[_0xa46e('0x4a')]['id'];}return db[_0xa46e('0x2b')]['find']({'where':{'id':_0x48a535[_0xa46e('0x45')]['id']}})[_0xa46e('0x24')](handleEntityNotFound(_0x3db1ae,null))[_0xa46e('0x24')](saveUpdates(_0x48a535['body'],null))[_0xa46e('0x24')](respondWithResult(_0x3db1ae,null))['catch'](handleError(_0x3db1ae,null));};exports[_0xa46e('0x25')]=function(_0x414613,_0x24c17c){return db[_0xa46e('0x2b')][_0xa46e('0x48')]({'where':{'id':_0x414613[_0xa46e('0x45')]['id']}})[_0xa46e('0x24')](handleEntityNotFound(_0x24c17c,null))[_0xa46e('0x24')](removeEntity(_0x24c17c,null))[_0xa46e('0x43')](handleError(_0x24c17c,null));}; \ No newline at end of file +var _0xc764=['count','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','stack','name','index','map','MailServerOut','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','VIRTUAL','where','includeAll','include','findAll','catch','show','params','keys','rawAttributes','options','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc764,0x15c));var _0x4c76=function(_0xd9bd1f,_0x197f52){_0xd9bd1f=_0xd9bd1f-0x0;var _0x1d1a0d=_0xc764[_0xd9bd1f];return _0x1d1a0d;};'use strict';var emlformat=require(_0x4c76('0x0'));var rimraf=require(_0x4c76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c76('0x2'));var rp=require(_0x4c76('0x3'));var moment=require(_0x4c76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c76('0x5'));var util=require(_0x4c76('0x6'));var path=require(_0x4c76('0x7'));var sox=require('sox');var csv=require(_0x4c76('0x8'));var ejs=require(_0x4c76('0x9'));var fs=require('fs');var fs_extra=require(_0x4c76('0xa'));var _=require(_0x4c76('0xb'));var squel=require('squel');var crypto=require(_0x4c76('0xc'));var jsforce=require(_0x4c76('0xd'));var deskjs=require(_0x4c76('0xe'));var toCsv=require(_0x4c76('0x8'));var querystring=require(_0x4c76('0xf'));var Papa=require(_0x4c76('0x10'));var Redis=require(_0x4c76('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4c76('0x12'));var as=require(_0x4c76('0x13'));var hardwareService=require(_0x4c76('0x14'));var logger=require(_0x4c76('0x15'))(_0x4c76('0x16'));var utils=require(_0x4c76('0x17'));var config=require(_0x4c76('0x18'));var licenseUtil=require(_0x4c76('0x19'));var db=require(_0x4c76('0x1a'))['db'];function respondWithStatusCode(_0x34a67f,_0x431e94){_0x431e94=_0x431e94||0xcc;return function(_0x26f4e8){if(_0x26f4e8){return _0x34a67f['sendStatus'](_0x431e94);}return _0x34a67f[_0x4c76('0x1b')](_0x431e94)['end']();};}function respondWithResult(_0x5d30cd,_0x4da698){_0x4da698=_0x4da698||0xc8;return function(_0x506178){if(_0x506178){return _0x5d30cd['status'](_0x4da698)[_0x4c76('0x1c')](_0x506178);}};}function respondWithFilteredResult(_0x11677d,_0x5df55e){return function(_0x2e806c){if(_0x2e806c){var _0x55ca63=typeof _0x5df55e[_0x4c76('0x1d')]===_0x4c76('0x1e')&&typeof _0x5df55e[_0x4c76('0x1f')]==='undefined';var _0x5bffe1=_0x2e806c[_0x4c76('0x20')];var _0x209fd7=_0x55ca63?0x0:_0x5df55e[_0x4c76('0x1d')];var _0x515d07=_0x55ca63?_0x2e806c['count']:_0x5df55e['offset']+_0x5df55e[_0x4c76('0x1f')];var _0x2e4259;if(_0x515d07>=_0x5bffe1){_0x515d07=_0x5bffe1;_0x2e4259=0xc8;}else{_0x2e4259=0xce;}_0x11677d[_0x4c76('0x1b')](_0x2e4259);return _0x11677d[_0x4c76('0x21')](_0x4c76('0x22'),_0x209fd7+'-'+_0x515d07+'/'+_0x5bffe1)['json'](_0x2e806c);}return null;};}function patchUpdates(_0x2d4d02){return function(_0x5b983c){try{jsonpatch[_0x4c76('0x23')](_0x5b983c,_0x2d4d02,!![]);}catch(_0x5b8172){return BPromise[_0x4c76('0x24')](_0x5b8172);}return _0x5b983c[_0x4c76('0x25')]();};}function saveUpdates(_0x490b38,_0x3154a3){return function(_0x3199cb){if(_0x3199cb){return _0x3199cb['update'](_0x490b38)['then'](function(_0x4b5ac4){return _0x4b5ac4;});}return null;};}function removeEntity(_0x59efaf,_0x342310){return function(_0x1f5990){if(_0x1f5990){return _0x1f5990[_0x4c76('0x26')]()[_0x4c76('0x27')](function(){_0x59efaf[_0x4c76('0x1b')](0xcc)[_0x4c76('0x28')]();});}};}function handleEntityNotFound(_0x3dced1,_0x483c20){return function(_0x1a26e0){if(!_0x1a26e0){_0x3dced1[_0x4c76('0x29')](0x194);}return _0x1a26e0;};}function handleError(_0x13b407,_0x1e433b){_0x1e433b=_0x1e433b||0x1f4;return function(_0x527c9a){logger['error'](_0x527c9a[_0x4c76('0x2a')]);if(_0x527c9a['name']){delete _0x527c9a[_0x4c76('0x2b')];}_0x13b407[_0x4c76('0x1b')](_0x1e433b)['send'](_0x527c9a);};}exports[_0x4c76('0x2c')]=function(_0x4ecb0d,_0x23c3cc){var _0x27acc3={},_0x56269b={},_0x27e6d0={'count':0x0,'rows':[]};var _0x393745=_[_0x4c76('0x2d')](db[_0x4c76('0x2e')]['rawAttributes'],function(_0xa5be74){return{'name':_0xa5be74[_0x4c76('0x2f')],'type':_0xa5be74[_0x4c76('0x30')][_0x4c76('0x31')]};});_0x56269b[_0x4c76('0x32')]=_[_0x4c76('0x2d')](_0x393745,_0x4c76('0x2b'));_0x56269b[_0x4c76('0x33')]=_['keys'](_0x4ecb0d['query']);_0x56269b[_0x4c76('0x34')]=_[_0x4c76('0x35')](_0x56269b[_0x4c76('0x32')],_0x56269b[_0x4c76('0x33')]);_0x27acc3[_0x4c76('0x36')]=_[_0x4c76('0x35')](_0x56269b[_0x4c76('0x32')],qs[_0x4c76('0x37')](_0x4ecb0d['query'][_0x4c76('0x37')]));_0x27acc3[_0x4c76('0x36')]=_0x27acc3[_0x4c76('0x36')][_0x4c76('0x38')]?_0x27acc3['attributes']:_0x56269b['model'];if(!_0x4ecb0d[_0x4c76('0x33')]['hasOwnProperty']('nolimit')){_0x27acc3['limit']=qs[_0x4c76('0x1f')](_0x4ecb0d[_0x4c76('0x33')][_0x4c76('0x1f')]);_0x27acc3[_0x4c76('0x1d')]=qs['offset'](_0x4ecb0d[_0x4c76('0x33')][_0x4c76('0x1d')]);}_0x27acc3[_0x4c76('0x39')]=qs[_0x4c76('0x3a')](_0x4ecb0d[_0x4c76('0x33')][_0x4c76('0x3a')]);_0x27acc3['where']=qs[_0x4c76('0x34')](_[_0x4c76('0x3b')](_0x4ecb0d[_0x4c76('0x33')],_0x56269b[_0x4c76('0x34')]),_0x393745);if(_0x4ecb0d[_0x4c76('0x33')][_0x4c76('0x3c')]){_0x27acc3['where']=_['merge'](_0x27acc3['where'],{'$or':_[_0x4c76('0x2d')](_0x393745,function(_0x289736){if(_0x289736[_0x4c76('0x30')]!==_0x4c76('0x3d')){var _0x14009b={};_0x14009b[_0x289736['name']]={'$like':'%'+_0x4ecb0d['query'][_0x4c76('0x3c')]+'%'};return _0x14009b;}})});}_0x27acc3=_['merge']({},_0x27acc3,_0x4ecb0d['options']);var _0x2d8a53={'where':_0x27acc3[_0x4c76('0x3e')]};return db[_0x4c76('0x2e')][_0x4c76('0x20')](_0x2d8a53)[_0x4c76('0x27')](function(_0x3db286){_0x27e6d0[_0x4c76('0x20')]=_0x3db286;if(_0x4ecb0d[_0x4c76('0x33')][_0x4c76('0x3f')]){_0x27acc3[_0x4c76('0x40')]=[{'all':!![]}];}return db[_0x4c76('0x2e')][_0x4c76('0x41')](_0x27acc3);})[_0x4c76('0x27')](function(_0x25ba85){_0x27e6d0['rows']=_0x25ba85;return _0x27e6d0;})[_0x4c76('0x27')](respondWithFilteredResult(_0x23c3cc,_0x27acc3))[_0x4c76('0x42')](handleError(_0x23c3cc,null));};exports[_0x4c76('0x43')]=function(_0x21c446,_0x1014a){var _0x482da0={'raw':!![],'where':{'id':_0x21c446[_0x4c76('0x44')]['id']}},_0x68f524={};_0x68f524[_0x4c76('0x32')]=_[_0x4c76('0x45')](db['MailServerOut'][_0x4c76('0x46')]);_0x68f524[_0x4c76('0x33')]=_['keys'](_0x21c446[_0x4c76('0x33')]);_0x68f524[_0x4c76('0x34')]=_['intersection'](_0x68f524['model'],_0x68f524[_0x4c76('0x33')]);_0x482da0[_0x4c76('0x36')]=_[_0x4c76('0x35')](_0x68f524[_0x4c76('0x32')],qs[_0x4c76('0x37')](_0x21c446[_0x4c76('0x33')][_0x4c76('0x37')]));_0x482da0['attributes']=_0x482da0[_0x4c76('0x36')][_0x4c76('0x38')]?_0x482da0[_0x4c76('0x36')]:_0x68f524[_0x4c76('0x32')];if(_0x21c446[_0x4c76('0x33')][_0x4c76('0x3f')]){_0x482da0[_0x4c76('0x40')]=[{'all':!![]}];}_0x482da0=_['merge']({},_0x482da0,_0x21c446[_0x4c76('0x47')]);return db[_0x4c76('0x2e')]['find'](_0x482da0)[_0x4c76('0x27')](handleEntityNotFound(_0x1014a,null))[_0x4c76('0x27')](respondWithResult(_0x1014a,null))[_0x4c76('0x42')](handleError(_0x1014a,null));};exports[_0x4c76('0x48')]=function(_0x178318,_0x2f3afc){return db[_0x4c76('0x2e')][_0x4c76('0x48')](_0x178318[_0x4c76('0x49')],{})[_0x4c76('0x27')](respondWithResult(_0x2f3afc,0xc9))[_0x4c76('0x42')](handleError(_0x2f3afc,null));};exports[_0x4c76('0x4a')]=function(_0x2407f3,_0x3dd453){if(_0x2407f3[_0x4c76('0x49')]['id']){delete _0x2407f3['body']['id'];}return db[_0x4c76('0x2e')]['find']({'where':{'id':_0x2407f3[_0x4c76('0x44')]['id']}})[_0x4c76('0x27')](handleEntityNotFound(_0x3dd453,null))[_0x4c76('0x27')](saveUpdates(_0x2407f3[_0x4c76('0x49')],null))[_0x4c76('0x27')](respondWithResult(_0x3dd453,null))[_0x4c76('0x42')](handleError(_0x3dd453,null));};exports['destroy']=function(_0x1badc0,_0x4cb01b){return db['MailServerOut'][_0x4c76('0x4b')]({'where':{'id':_0x1badc0[_0x4c76('0x44')]['id']}})[_0x4c76('0x27')](handleEntityNotFound(_0x4cb01b,null))[_0x4c76('0x27')](removeEntity(_0x4cb01b,null))[_0x4c76('0x42')](handleError(_0x4cb01b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9504142..bcdbfd5 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 _0x3358=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x510f70,_0x5b9064){var _0x1a4aaf=function(_0x342557){while(--_0x342557){_0x510f70['push'](_0x510f70['shift']());}};_0x1a4aaf(++_0x5b9064);}(_0x3358,0x19d));var _0x8335=function(_0x4ac650,_0x27e24b){_0x4ac650=_0x4ac650-0x0;var _0xdd26aa=_0x3358[_0x4ac650];return _0xdd26aa;};'use strict';var _=require(_0x8335('0x0'));var util=require('util');var logger=require(_0x8335('0x1'))('api');var moment=require(_0x8335('0x2'));var BPromise=require('bluebird');var rp=require(_0x8335('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8335('0x4'));var config=require(_0x8335('0x5'));var attributes=require(_0x8335('0x6'));module[_0x8335('0x7')]=function(_0x3baf7d,_0x397c60){return _0x3baf7d[_0x8335('0x8')](_0x8335('0x9'),attributes,{'tableName':_0x8335('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45f8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','MailServerOut','mail_servers_out','lodash','util','api','moment'];(function(_0x51a82b,_0x1331e0){var _0x3e18ab=function(_0x2ea84c){while(--_0x2ea84c){_0x51a82b['push'](_0x51a82b['shift']());}};_0x3e18ab(++_0x1331e0);}(_0x45f8,0xec));var _0x845f=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x45f8[_0x28fbbf];return _0x543af6;};'use strict';var _=require(_0x845f('0x0'));var util=require(_0x845f('0x1'));var logger=require('../../config/logger')(_0x845f('0x2'));var moment=require(_0x845f('0x3'));var BPromise=require(_0x845f('0x4'));var rp=require(_0x845f('0x5'));var fs=require('fs');var path=require(_0x845f('0x6'));var rimraf=require(_0x845f('0x7'));var config=require(_0x845f('0x8'));var attributes=require('./mailServerOut.attributes');module[_0x845f('0x9')]=function(_0x7e899b,_0x2f3dba){return _0x7e899b['define'](_0x845f('0xa'),attributes,{'tableName':_0x845f('0xb'),'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 7073cca..fd956d4 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1127bf,_0x542714){var _0x5bdfce=function(_0x29b766){while(--_0x29b766){_0x1127bf['push'](_0x1127bf['shift']());}};_0x5bdfce(++_0x542714);}(_0x2ef3,0xba));var _0x32ef=function(_0x47514d,_0x45588c){_0x47514d=_0x47514d-0x0;var _0x4c500f=_0x2ef3[_0x47514d];return _0x4c500f;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x16180a,_0x1aa2d6){_0x16180a=_0x16180a-0x0;var _0x4c8de8=_0x7a54[_0x16180a];return _0x4c8de8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 202b2d3..e5fa9ca 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 _0x4815=['isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get'];(function(_0xf19d4f,_0x3fa6a0){var _0x569eb5=function(_0x38bb95){while(--_0x38bb95){_0xf19d4f['push'](_0xf19d4f['shift']());}};_0x569eb5(++_0x3fa6a0);}(_0x4815,0xee));var _0x5481=function(_0x3b1e18,_0x5c194d){_0x3b1e18=_0x3b1e18-0x0;var _0xc6ce52=_0x4815[_0x3b1e18];return _0xc6ce52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5481('0x0'));var timeout=require(_0x5481('0x1'));var express=require(_0x5481('0x2'));var router=express[_0x5481('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5481('0x4'));var interaction=require(_0x5481('0x5'));var config=require(_0x5481('0x6'));var controller=require(_0x5481('0x7'));router[_0x5481('0x8')]('/',auth[_0x5481('0x9')](),controller[_0x5481('0xa')]);router[_0x5481('0x8')](_0x5481('0xb'),auth[_0x5481('0x9')](),controller[_0x5481('0xc')]);router[_0x5481('0x8')](_0x5481('0xd'),auth[_0x5481('0x9')](),controller[_0x5481('0xe')]);router['post']('/',auth[_0x5481('0x9')](),controller['create']);router['put']('/:id',auth[_0x5481('0x9')](),controller[_0x5481('0xf')]);router[_0x5481('0x10')](_0x5481('0xd'),auth[_0x5481('0x9')](),controller[_0x5481('0x11')]);module[_0x5481('0x12')]=router; \ No newline at end of file +var _0x6ac1=['isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6ac1,0x1d4));var _0x16ac=function(_0x2df2c4,_0x3b183b){_0x2df2c4=_0x2df2c4-0x0;var _0x3244d3=_0x6ac1[_0x2df2c4];return _0x3244d3;};'use strict';var multer=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var path=require(_0x16ac('0x2'));var timeout=require(_0x16ac('0x3'));var express=require(_0x16ac('0x4'));var router=express[_0x16ac('0x5')]();var fs_extra=require(_0x16ac('0x6'));var auth=require(_0x16ac('0x7'));var interaction=require(_0x16ac('0x8'));var config=require(_0x16ac('0x9'));var controller=require(_0x16ac('0xa'));router[_0x16ac('0xb')]('/',auth[_0x16ac('0xc')](),controller[_0x16ac('0xd')]);router[_0x16ac('0xb')]('/describe',auth[_0x16ac('0xc')](),controller['describe']);router['get'](_0x16ac('0xe'),auth[_0x16ac('0xc')](),controller[_0x16ac('0xf')]);router[_0x16ac('0x10')]('/',auth[_0x16ac('0xc')](),controller[_0x16ac('0x11')]);router['put'](_0x16ac('0xe'),auth[_0x16ac('0xc')](),controller['update']);router[_0x16ac('0x12')](_0x16ac('0xe'),auth[_0x16ac('0xc')](),controller['destroy']);module[_0x16ac('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d65e03d..43eaa67 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 _0x82c4=['STRING','name','sequelize','exports'];(function(_0x45179e,_0xfd7c00){var _0x48df38=function(_0x5d2892){while(--_0x5d2892){_0x45179e['push'](_0x45179e['shift']());}};_0x48df38(++_0xfd7c00);}(_0x82c4,0x1ca));var _0x482c=function(_0x2a036a,_0x2cbbdf){_0x2a036a=_0x2a036a-0x0;var _0xee0b06=_0x82c4[_0x2a036a];return _0xee0b06;};'use strict';var Sequelize=require(_0x482c('0x0'));module[_0x482c('0x1')]={'name':{'type':Sequelize[_0x482c('0x2')],'unique':_0x482c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x482c('0x2')]}}; \ No newline at end of file +var _0x723e=['STRING','name','exports'];(function(_0x78f3a8,_0x4d9551){var _0x48af0d=function(_0x243b35){while(--_0x243b35){_0x78f3a8['push'](_0x78f3a8['shift']());}};_0x48af0d(++_0x4d9551);}(_0x723e,0x179));var _0xe723=function(_0x5ccff8,_0x3d85cc){_0x5ccff8=_0x5ccff8-0x0;var _0x5a97d9=_0x723e[_0x5ccff8];return _0x5a97d9;};'use strict';var Sequelize=require('sequelize');module[_0xe723('0x0')]={'name':{'type':Sequelize[_0xe723('0x1')],'unique':_0xe723('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe723('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d319aab..091b0be 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 _0x0f7c=['lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','sendStatus','error','name','send','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x48a766,_0x2b095a){var _0x4a2207=function(_0x5ad397){while(--_0x5ad397){_0x48a766['push'](_0x48a766['shift']());}};_0x4a2207(++_0x2b095a);}(_0x0f7c,0x16b));var _0xc0f7=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0f7c[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xc0f7('0x0'));var rimraf=require(_0xc0f7('0x1'));var zipdir=require(_0xc0f7('0x2'));var jsonpatch=require(_0xc0f7('0x3'));var rp=require(_0xc0f7('0x4'));var moment=require('moment');var BPromise=require(_0xc0f7('0x5'));var Mustache=require('mustache');var util=require(_0xc0f7('0x6'));var path=require(_0xc0f7('0x7'));var sox=require(_0xc0f7('0x8'));var csv=require(_0xc0f7('0x9'));var ejs=require(_0xc0f7('0xa'));var fs=require('fs');var fs_extra=require(_0xc0f7('0xb'));var _=require(_0xc0f7('0xc'));var squel=require('squel');var crypto=require(_0xc0f7('0xd'));var jsforce=require(_0xc0f7('0xe'));var deskjs=require(_0xc0f7('0xf'));var toCsv=require(_0xc0f7('0x9'));var querystring=require('querystring');var Papa=require(_0xc0f7('0x10'));var Redis=require(_0xc0f7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc0f7('0x12'));var hardwareService=require(_0xc0f7('0x13'));var logger=require(_0xc0f7('0x14'))(_0xc0f7('0x15'));var utils=require(_0xc0f7('0x16'));var config=require(_0xc0f7('0x17'));var licenseUtil=require(_0xc0f7('0x18'));var db=require(_0xc0f7('0x19'))['db'];function respondWithStatusCode(_0x5c30f6,_0x243c38){_0x243c38=_0x243c38||0xcc;return function(_0xd51c0a){if(_0xd51c0a){return _0x5c30f6['sendStatus'](_0x243c38);}return _0x5c30f6[_0xc0f7('0x1a')](_0x243c38)[_0xc0f7('0x1b')]();};}function respondWithResult(_0x1a78fb,_0x8511af){_0x8511af=_0x8511af||0xc8;return function(_0x4fdb6b){if(_0x4fdb6b){return _0x1a78fb[_0xc0f7('0x1a')](_0x8511af)[_0xc0f7('0x1c')](_0x4fdb6b);}};}function respondWithFilteredResult(_0x2c1ba3,_0x523c29){return function(_0x43ab60){if(_0x43ab60){var _0x558487=typeof _0x523c29[_0xc0f7('0x1d')]==='undefined'&&typeof _0x523c29['limit']===_0xc0f7('0x1e');var _0x5b499f=_0x43ab60[_0xc0f7('0x1f')];var _0x15faf1=_0x558487?0x0:_0x523c29[_0xc0f7('0x1d')];var _0xc05bcf=_0x558487?_0x43ab60[_0xc0f7('0x1f')]:_0x523c29[_0xc0f7('0x1d')]+_0x523c29[_0xc0f7('0x20')];var _0x1eacb1;if(_0xc05bcf>=_0x5b499f){_0xc05bcf=_0x5b499f;_0x1eacb1=0xc8;}else{_0x1eacb1=0xce;}_0x2c1ba3[_0xc0f7('0x1a')](_0x1eacb1);return _0x2c1ba3['set']('Content-Range',_0x15faf1+'-'+_0xc05bcf+'/'+_0x5b499f)[_0xc0f7('0x1c')](_0x43ab60);}return null;};}function patchUpdates(_0x2b2708){return function(_0x1c6b82){try{jsonpatch['apply'](_0x1c6b82,_0x2b2708,!![]);}catch(_0x5c5944){return BPromise[_0xc0f7('0x21')](_0x5c5944);}return _0x1c6b82[_0xc0f7('0x22')]();};}function saveUpdates(_0x471352,_0xa537c0){return function(_0x1dc09c){if(_0x1dc09c){return _0x1dc09c[_0xc0f7('0x23')](_0x471352)[_0xc0f7('0x24')](function(_0x37a42f){return _0x37a42f;});}return null;};}function removeEntity(_0x2f2429,_0x2b1696){return function(_0x2357f4){if(_0x2357f4){return _0x2357f4[_0xc0f7('0x25')]()[_0xc0f7('0x24')](function(){_0x2f2429[_0xc0f7('0x1a')](0xcc)[_0xc0f7('0x1b')]();});}};}function handleEntityNotFound(_0x2029dd,_0x2c525d){return function(_0x425bfd){if(!_0x425bfd){_0x2029dd[_0xc0f7('0x26')](0x194);}return _0x425bfd;};}function handleError(_0xb40dc2,_0x320903){_0x320903=_0x320903||0x1f4;return function(_0x3c22ee){logger[_0xc0f7('0x27')](_0x3c22ee['stack']);if(_0x3c22ee[_0xc0f7('0x28')]){delete _0x3c22ee[_0xc0f7('0x28')];}_0xb40dc2['status'](_0x320903)[_0xc0f7('0x29')](_0x3c22ee);};}exports['index']=function(_0x4def5a,_0x17702e){var _0x160b6f={},_0x13add9={},_0x5768ad={'count':0x0,'rows':[]};var _0x32c23b=_['map'](db[_0xc0f7('0x2a')][_0xc0f7('0x2b')],function(_0x1b7dce){return{'name':_0x1b7dce[_0xc0f7('0x2c')],'type':_0x1b7dce[_0xc0f7('0x2d')][_0xc0f7('0x2e')]};});_0x13add9[_0xc0f7('0x2f')]=_[_0xc0f7('0x30')](_0x32c23b,'name');_0x13add9[_0xc0f7('0x31')]=_[_0xc0f7('0x32')](_0x4def5a[_0xc0f7('0x31')]);_0x13add9[_0xc0f7('0x33')]=_[_0xc0f7('0x34')](_0x13add9[_0xc0f7('0x2f')],_0x13add9[_0xc0f7('0x31')]);_0x160b6f[_0xc0f7('0x35')]=_['intersection'](_0x13add9[_0xc0f7('0x2f')],qs['fields'](_0x4def5a[_0xc0f7('0x31')][_0xc0f7('0x36')]));_0x160b6f['attributes']=_0x160b6f[_0xc0f7('0x35')]['length']?_0x160b6f['attributes']:_0x13add9[_0xc0f7('0x2f')];if(!_0x4def5a['query'][_0xc0f7('0x37')](_0xc0f7('0x38'))){_0x160b6f['limit']=qs[_0xc0f7('0x20')](_0x4def5a[_0xc0f7('0x31')][_0xc0f7('0x20')]);_0x160b6f[_0xc0f7('0x1d')]=qs[_0xc0f7('0x1d')](_0x4def5a[_0xc0f7('0x31')][_0xc0f7('0x1d')]);}_0x160b6f[_0xc0f7('0x39')]=qs[_0xc0f7('0x3a')](_0x4def5a['query'][_0xc0f7('0x3a')]);_0x160b6f[_0xc0f7('0x3b')]=qs['filters'](_['pick'](_0x4def5a[_0xc0f7('0x31')],_0x13add9[_0xc0f7('0x33')]),_0x32c23b);if(_0x4def5a[_0xc0f7('0x31')][_0xc0f7('0x3c')]){_0x160b6f[_0xc0f7('0x3b')]=_[_0xc0f7('0x3d')](_0x160b6f[_0xc0f7('0x3b')],{'$or':_['map'](_0x32c23b,function(_0x3405b4){if(_0x3405b4[_0xc0f7('0x2d')]!=='VIRTUAL'){var _0x41538f={};_0x41538f[_0x3405b4[_0xc0f7('0x28')]]={'$like':'%'+_0x4def5a[_0xc0f7('0x31')]['filter']+'%'};return _0x41538f;}})});}_0x160b6f=_[_0xc0f7('0x3d')]({},_0x160b6f,_0x4def5a['options']);var _0x1e5676={'where':_0x160b6f[_0xc0f7('0x3b')]};return db['MailSubstatus'][_0xc0f7('0x1f')](_0x1e5676)[_0xc0f7('0x24')](function(_0x2f2749){_0x5768ad['count']=_0x2f2749;if(_0x4def5a[_0xc0f7('0x31')][_0xc0f7('0x3e')]){_0x160b6f[_0xc0f7('0x3f')]=[{'all':!![]}];}return db[_0xc0f7('0x2a')][_0xc0f7('0x40')](_0x160b6f);})[_0xc0f7('0x24')](function(_0x21716b){_0x5768ad[_0xc0f7('0x41')]=_0x21716b;return _0x5768ad;})[_0xc0f7('0x24')](respondWithFilteredResult(_0x17702e,_0x160b6f))[_0xc0f7('0x42')](handleError(_0x17702e,null));};exports[_0xc0f7('0x43')]=function(_0x26a389,_0x101713){var _0x479b77={'raw':!![],'where':{'id':_0x26a389[_0xc0f7('0x44')]['id']}},_0x46114c={};_0x46114c[_0xc0f7('0x2f')]=_[_0xc0f7('0x32')](db['MailSubstatus']['rawAttributes']);_0x46114c[_0xc0f7('0x31')]=_['keys'](_0x26a389[_0xc0f7('0x31')]);_0x46114c['filters']=_[_0xc0f7('0x34')](_0x46114c['model'],_0x46114c[_0xc0f7('0x31')]);_0x479b77[_0xc0f7('0x35')]=_[_0xc0f7('0x34')](_0x46114c['model'],qs[_0xc0f7('0x36')](_0x26a389[_0xc0f7('0x31')][_0xc0f7('0x36')]));_0x479b77[_0xc0f7('0x35')]=_0x479b77['attributes'][_0xc0f7('0x45')]?_0x479b77[_0xc0f7('0x35')]:_0x46114c['model'];if(_0x26a389[_0xc0f7('0x31')][_0xc0f7('0x3e')]){_0x479b77['include']=[{'all':!![]}];}_0x479b77=_[_0xc0f7('0x3d')]({},_0x479b77,_0x26a389[_0xc0f7('0x46')]);return db[_0xc0f7('0x2a')][_0xc0f7('0x47')](_0x479b77)['then'](handleEntityNotFound(_0x101713,null))['then'](respondWithResult(_0x101713,null))[_0xc0f7('0x42')](handleError(_0x101713,null));};exports[_0xc0f7('0x48')]=function(_0x1ed571,_0x175769){return db[_0xc0f7('0x2a')]['create'](_0x1ed571['body'],{})['then'](respondWithResult(_0x175769,0xc9))[_0xc0f7('0x42')](handleError(_0x175769,null));};exports['update']=function(_0x1c3d57,_0x787858){if(_0x1c3d57[_0xc0f7('0x49')]['id']){delete _0x1c3d57[_0xc0f7('0x49')]['id'];}return db[_0xc0f7('0x2a')][_0xc0f7('0x47')]({'where':{'id':_0x1c3d57[_0xc0f7('0x44')]['id']}})[_0xc0f7('0x24')](handleEntityNotFound(_0x787858,null))[_0xc0f7('0x24')](saveUpdates(_0x1c3d57[_0xc0f7('0x49')],null))[_0xc0f7('0x24')](respondWithResult(_0x787858,null))[_0xc0f7('0x42')](handleError(_0x787858,null));};exports[_0xc0f7('0x25')]=function(_0x56666c,_0x46e384){return db[_0xc0f7('0x2a')][_0xc0f7('0x47')]({'where':{'id':_0x56666c[_0xc0f7('0x44')]['id']}})['then'](handleEntityNotFound(_0x46e384,null))[_0xc0f7('0x24')](removeEntity(_0x46e384,null))[_0xc0f7('0x42')](handleError(_0x46e384,null));};exports[_0xc0f7('0x4a')]=function(_0x4149d2,_0x2804ca){return db[_0xc0f7('0x2a')][_0xc0f7('0x4a')]()[_0xc0f7('0x24')](respondWithResult(_0x2804ca,null))[_0xc0f7('0x42')](handleError(_0x2804ca,null));}; \ No newline at end of file +var _0xfe36=['limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','length','query','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','fields','find','create','body','params','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x21d421,_0x35a5f4){var _0x146a10=function(_0x287445){while(--_0x287445){_0x21d421['push'](_0x21d421['shift']());}};_0x146a10(++_0x35a5f4);}(_0xfe36,0xc1));var _0x6fe3=function(_0x59cfd3,_0x108982){_0x59cfd3=_0x59cfd3-0x0;var _0x138e33=_0xfe36[_0x59cfd3];return _0x138e33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fe3('0x0'));var zipdir=require(_0x6fe3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6fe3('0x2'));var BPromise=require(_0x6fe3('0x3'));var Mustache=require(_0x6fe3('0x4'));var util=require(_0x6fe3('0x5'));var path=require(_0x6fe3('0x6'));var sox=require(_0x6fe3('0x7'));var csv=require(_0x6fe3('0x8'));var ejs=require(_0x6fe3('0x9'));var fs=require('fs');var fs_extra=require(_0x6fe3('0xa'));var _=require(_0x6fe3('0xb'));var squel=require(_0x6fe3('0xc'));var crypto=require('crypto');var jsforce=require(_0x6fe3('0xd'));var deskjs=require(_0x6fe3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6fe3('0xf'));var Papa=require(_0x6fe3('0x10'));var Redis=require('ioredis');var authService=require(_0x6fe3('0x11'));var qs=require(_0x6fe3('0x12'));var as=require(_0x6fe3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6fe3('0x14'));var utils=require(_0x6fe3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6fe3('0x16'));var db=require(_0x6fe3('0x17'))['db'];function respondWithStatusCode(_0x4ca3f9,_0x427b32){_0x427b32=_0x427b32||0xcc;return function(_0x5cd081){if(_0x5cd081){return _0x4ca3f9[_0x6fe3('0x18')](_0x427b32);}return _0x4ca3f9[_0x6fe3('0x19')](_0x427b32)[_0x6fe3('0x1a')]();};}function respondWithResult(_0x26e585,_0x164cc8){_0x164cc8=_0x164cc8||0xc8;return function(_0x4ad4fe){if(_0x4ad4fe){return _0x26e585[_0x6fe3('0x19')](_0x164cc8)['json'](_0x4ad4fe);}};}function respondWithFilteredResult(_0x43ad72,_0x598707){return function(_0x51c791){if(_0x51c791){var _0x4feea5=typeof _0x598707[_0x6fe3('0x1b')]===_0x6fe3('0x1c')&&typeof _0x598707[_0x6fe3('0x1d')]===_0x6fe3('0x1c');var _0x29c04c=_0x51c791[_0x6fe3('0x1e')];var _0x1a39aa=_0x4feea5?0x0:_0x598707[_0x6fe3('0x1b')];var _0x3d5c92=_0x4feea5?_0x51c791[_0x6fe3('0x1e')]:_0x598707[_0x6fe3('0x1b')]+_0x598707['limit'];var _0x30c607;if(_0x3d5c92>=_0x29c04c){_0x3d5c92=_0x29c04c;_0x30c607=0xc8;}else{_0x30c607=0xce;}_0x43ad72[_0x6fe3('0x19')](_0x30c607);return _0x43ad72[_0x6fe3('0x1f')](_0x6fe3('0x20'),_0x1a39aa+'-'+_0x3d5c92+'/'+_0x29c04c)['json'](_0x51c791);}return null;};}function patchUpdates(_0x28e1b3){return function(_0x2f5162){try{jsonpatch[_0x6fe3('0x21')](_0x2f5162,_0x28e1b3,!![]);}catch(_0x334753){return BPromise[_0x6fe3('0x22')](_0x334753);}return _0x2f5162[_0x6fe3('0x23')]();};}function saveUpdates(_0x395450,_0x2d2d48){return function(_0x242e85){if(_0x242e85){return _0x242e85[_0x6fe3('0x24')](_0x395450)[_0x6fe3('0x25')](function(_0x2973fe){return _0x2973fe;});}return null;};}function removeEntity(_0x39775d,_0x4e5869){return function(_0x22a67a){if(_0x22a67a){return _0x22a67a['destroy']()[_0x6fe3('0x25')](function(){_0x39775d[_0x6fe3('0x19')](0xcc)[_0x6fe3('0x1a')]();});}};}function handleEntityNotFound(_0x34fda6,_0x1aef85){return function(_0xd72b8d){if(!_0xd72b8d){_0x34fda6['sendStatus'](0x194);}return _0xd72b8d;};}function handleError(_0x207871,_0x418bbf){_0x418bbf=_0x418bbf||0x1f4;return function(_0x1715f3){logger[_0x6fe3('0x26')](_0x1715f3['stack']);if(_0x1715f3[_0x6fe3('0x27')]){delete _0x1715f3['name'];}_0x207871[_0x6fe3('0x19')](_0x418bbf)[_0x6fe3('0x28')](_0x1715f3);};}exports[_0x6fe3('0x29')]=function(_0x3675ac,_0x4cec6a){var _0x4b3f8b={},_0x5d127b={},_0x187535={'count':0x0,'rows':[]};var _0x187d5c=_[_0x6fe3('0x2a')](db[_0x6fe3('0x2b')][_0x6fe3('0x2c')],function(_0x42ef15){return{'name':_0x42ef15[_0x6fe3('0x2d')],'type':_0x42ef15['type'][_0x6fe3('0x2e')]};});_0x5d127b['model']=_['map'](_0x187d5c,_0x6fe3('0x27'));_0x5d127b['query']=_[_0x6fe3('0x2f')](_0x3675ac['query']);_0x5d127b[_0x6fe3('0x30')]=_[_0x6fe3('0x31')](_0x5d127b['model'],_0x5d127b['query']);_0x4b3f8b['attributes']=_['intersection'](_0x5d127b[_0x6fe3('0x32')],qs['fields'](_0x3675ac['query']['fields']));_0x4b3f8b[_0x6fe3('0x33')]=_0x4b3f8b[_0x6fe3('0x33')][_0x6fe3('0x34')]?_0x4b3f8b[_0x6fe3('0x33')]:_0x5d127b[_0x6fe3('0x32')];if(!_0x3675ac[_0x6fe3('0x35')][_0x6fe3('0x36')](_0x6fe3('0x37'))){_0x4b3f8b[_0x6fe3('0x1d')]=qs[_0x6fe3('0x1d')](_0x3675ac['query'][_0x6fe3('0x1d')]);_0x4b3f8b[_0x6fe3('0x1b')]=qs[_0x6fe3('0x1b')](_0x3675ac[_0x6fe3('0x35')][_0x6fe3('0x1b')]);}_0x4b3f8b['order']=qs[_0x6fe3('0x38')](_0x3675ac[_0x6fe3('0x35')]['sort']);_0x4b3f8b[_0x6fe3('0x39')]=qs[_0x6fe3('0x30')](_['pick'](_0x3675ac[_0x6fe3('0x35')],_0x5d127b[_0x6fe3('0x30')]),_0x187d5c);if(_0x3675ac[_0x6fe3('0x35')][_0x6fe3('0x3a')]){_0x4b3f8b[_0x6fe3('0x39')]=_[_0x6fe3('0x3b')](_0x4b3f8b['where'],{'$or':_[_0x6fe3('0x2a')](_0x187d5c,function(_0x57ad65){if(_0x57ad65[_0x6fe3('0x3c')]!==_0x6fe3('0x3d')){var _0x5e5681={};_0x5e5681[_0x57ad65['name']]={'$like':'%'+_0x3675ac[_0x6fe3('0x35')][_0x6fe3('0x3a')]+'%'};return _0x5e5681;}})});}_0x4b3f8b=_[_0x6fe3('0x3b')]({},_0x4b3f8b,_0x3675ac[_0x6fe3('0x3e')]);var _0xb2e26b={'where':_0x4b3f8b[_0x6fe3('0x39')]};return db[_0x6fe3('0x2b')][_0x6fe3('0x1e')](_0xb2e26b)[_0x6fe3('0x25')](function(_0x25f728){_0x187535[_0x6fe3('0x1e')]=_0x25f728;if(_0x3675ac[_0x6fe3('0x35')][_0x6fe3('0x3f')]){_0x4b3f8b[_0x6fe3('0x40')]=[{'all':!![]}];}return db[_0x6fe3('0x2b')]['findAll'](_0x4b3f8b);})[_0x6fe3('0x25')](function(_0x5b41c8){_0x187535[_0x6fe3('0x41')]=_0x5b41c8;return _0x187535;})['then'](respondWithFilteredResult(_0x4cec6a,_0x4b3f8b))[_0x6fe3('0x42')](handleError(_0x4cec6a,null));};exports[_0x6fe3('0x43')]=function(_0x7e172b,_0x954af9){var _0x2d572c={'raw':!![],'where':{'id':_0x7e172b['params']['id']}},_0x48a60c={};_0x48a60c[_0x6fe3('0x32')]=_[_0x6fe3('0x2f')](db[_0x6fe3('0x2b')]['rawAttributes']);_0x48a60c[_0x6fe3('0x35')]=_[_0x6fe3('0x2f')](_0x7e172b['query']);_0x48a60c[_0x6fe3('0x30')]=_[_0x6fe3('0x31')](_0x48a60c[_0x6fe3('0x32')],_0x48a60c[_0x6fe3('0x35')]);_0x2d572c[_0x6fe3('0x33')]=_[_0x6fe3('0x31')](_0x48a60c[_0x6fe3('0x32')],qs['fields'](_0x7e172b['query'][_0x6fe3('0x44')]));_0x2d572c[_0x6fe3('0x33')]=_0x2d572c[_0x6fe3('0x33')][_0x6fe3('0x34')]?_0x2d572c['attributes']:_0x48a60c[_0x6fe3('0x32')];if(_0x7e172b[_0x6fe3('0x35')][_0x6fe3('0x3f')]){_0x2d572c['include']=[{'all':!![]}];}_0x2d572c=_[_0x6fe3('0x3b')]({},_0x2d572c,_0x7e172b[_0x6fe3('0x3e')]);return db[_0x6fe3('0x2b')][_0x6fe3('0x45')](_0x2d572c)['then'](handleEntityNotFound(_0x954af9,null))[_0x6fe3('0x25')](respondWithResult(_0x954af9,null))[_0x6fe3('0x42')](handleError(_0x954af9,null));};exports[_0x6fe3('0x46')]=function(_0x94687b,_0x1ae97e){return db[_0x6fe3('0x2b')][_0x6fe3('0x46')](_0x94687b['body'],{})[_0x6fe3('0x25')](respondWithResult(_0x1ae97e,0xc9))['catch'](handleError(_0x1ae97e,null));};exports[_0x6fe3('0x24')]=function(_0x770e96,_0x16258f){if(_0x770e96[_0x6fe3('0x47')]['id']){delete _0x770e96[_0x6fe3('0x47')]['id'];}return db['MailSubstatus'][_0x6fe3('0x45')]({'where':{'id':_0x770e96[_0x6fe3('0x48')]['id']}})[_0x6fe3('0x25')](handleEntityNotFound(_0x16258f,null))[_0x6fe3('0x25')](saveUpdates(_0x770e96[_0x6fe3('0x47')],null))[_0x6fe3('0x25')](respondWithResult(_0x16258f,null))[_0x6fe3('0x42')](handleError(_0x16258f,null));};exports['destroy']=function(_0x1fa223,_0x5e1ed4){return db[_0x6fe3('0x2b')][_0x6fe3('0x45')]({'where':{'id':_0x1fa223['params']['id']}})[_0x6fe3('0x25')](handleEntityNotFound(_0x5e1ed4,null))[_0x6fe3('0x25')](removeEntity(_0x5e1ed4,null))[_0x6fe3('0x42')](handleError(_0x5e1ed4,null));};exports[_0x6fe3('0x49')]=function(_0xc70170,_0x54fc58){return db[_0x6fe3('0x2b')][_0x6fe3('0x49')]()[_0x6fe3('0x25')](respondWithResult(_0x54fc58,null))['catch'](handleError(_0x54fc58,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 6b5ab64..bf2cc45 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 _0x614e=['rimraf','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfe4a8d,_0x33d75d){var _0x1bf633=function(_0x57f0e5){while(--_0x57f0e5){_0xfe4a8d['push'](_0xfe4a8d['shift']());}};_0x1bf633(++_0x33d75d);}(_0x614e,0x10d));var _0xe614=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x614e[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe614('0x0'));var logger=require(_0xe614('0x1'))(_0xe614('0x2'));var moment=require(_0xe614('0x3'));var BPromise=require(_0xe614('0x4'));var rp=require(_0xe614('0x5'));var fs=require('fs');var path=require(_0xe614('0x6'));var rimraf=require(_0xe614('0x7'));var config=require('../../config/environment');var attributes=require(_0xe614('0x8'));module[_0xe614('0x9')]=function(_0x432e84,_0x4265b6){return _0x432e84['define'](_0xe614('0xa'),attributes,{'tableName':_0xe614('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6cd=['./mailSubstatus.attributes','exports','MailSubstatus','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4fd442,_0x2fee57){var _0x36b986=function(_0x179202){while(--_0x179202){_0x4fd442['push'](_0x4fd442['shift']());}};_0x36b986(++_0x2fee57);}(_0xd6cd,0x19d));var _0xdd6c=function(_0x453b9c,_0x287e58){_0x453b9c=_0x453b9c-0x0;var _0xfd9f24=_0xd6cd[_0x453b9c];return _0xfd9f24;};'use strict';var _=require(_0xdd6c('0x0'));var util=require('util');var logger=require(_0xdd6c('0x1'))('api');var moment=require(_0xdd6c('0x2'));var BPromise=require(_0xdd6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd6c('0x4'));var rimraf=require(_0xdd6c('0x5'));var config=require(_0xdd6c('0x6'));var attributes=require(_0xdd6c('0x7'));module[_0xdd6c('0x8')]=function(_0x144b70,_0x10b8b9){return _0x144b70['define'](_0xdd6c('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 853b05f..bc94577 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 _0x15f8=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x5376db,_0x43e304){var _0x135021=function(_0x3d3325){while(--_0x3d3325){_0x5376db['push'](_0x5376db['shift']());}};_0x135021(++_0x43e304);}(_0x15f8,0x149));var _0x815f=function(_0x25058c,_0xd951a9){_0x25058c=_0x25058c-0x0;var _0x43c098=_0x15f8[_0x25058c];return _0x43c098;};'use strict';var _=require(_0x815f('0x0'));var util=require('util');var moment=require(_0x815f('0x1'));var BPromise=require('bluebird');var rs=require(_0x815f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x815f('0x3'))['db'];var utils=require(_0x815f('0x4'));var logger=require(_0x815f('0x5'))(_0x815f('0x6'));var config=require(_0x815f('0x7'));var jayson=require(_0x815f('0x8'));var client=jayson[_0x815f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43b91e,_0x5ae99e,_0x5af0b0){return new BPromise(function(_0x50b3a4,_0xc7861c){return client[_0x815f('0xa')](_0x43b91e,_0x5af0b0)[_0x815f('0xb')](function(_0x4cbf2f){logger['info'](_0x815f('0xc'),_0x5ae99e,_0x815f('0xd'));logger[_0x815f('0xe')](_0x815f('0xf'),_0x5ae99e,_0x815f('0xd'),JSON['stringify'](_0x4cbf2f));if(_0x4cbf2f['error']){if(_0x4cbf2f[_0x815f('0x10')][_0x815f('0x11')]===0x1f4){logger[_0x815f('0x10')](_0x815f('0xc'),_0x5ae99e,_0x4cbf2f['error'][_0x815f('0x12')]);return _0xc7861c(_0x4cbf2f[_0x815f('0x10')][_0x815f('0x12')]);}logger['error'](_0x815f('0xc'),_0x5ae99e,_0x4cbf2f[_0x815f('0x10')][_0x815f('0x12')]);return _0x50b3a4(_0x4cbf2f[_0x815f('0x10')][_0x815f('0x12')]);}else{logger[_0x815f('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x5ae99e,_0x815f('0xd'));_0x50b3a4(_0x4cbf2f[_0x815f('0x14')]['message']);}})[_0x815f('0x15')](function(_0x396be7){logger['error'](_0x815f('0xc'),_0x5ae99e,_0x396be7);_0xc7861c(_0x396be7);});});} \ No newline at end of file +var _0xfe77=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x17e849,_0x588a88){var _0x35d503=function(_0x1d7eb7){while(--_0x1d7eb7){_0x17e849['push'](_0x17e849['shift']());}};_0x35d503(++_0x588a88);}(_0xfe77,0x129));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7fe7('0x0'));var util=require(_0x7fe7('0x1'));var moment=require(_0x7fe7('0x2'));var BPromise=require(_0x7fe7('0x3'));var rs=require(_0x7fe7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fe7('0x5'))['db'];var utils=require(_0x7fe7('0x6'));var logger=require(_0x7fe7('0x7'))(_0x7fe7('0x8'));var config=require(_0x7fe7('0x9'));var jayson=require(_0x7fe7('0xa'));var client=jayson['client'][_0x7fe7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40d24c,_0x26ebaf,_0x4211ea){return new BPromise(function(_0x30657d,_0x2c91df){return client[_0x7fe7('0xc')](_0x40d24c,_0x4211ea)[_0x7fe7('0xd')](function(_0x43af25){logger[_0x7fe7('0xe')](_0x7fe7('0xf'),_0x26ebaf,_0x7fe7('0x10'));logger[_0x7fe7('0x11')](_0x7fe7('0x12'),_0x26ebaf,_0x7fe7('0x10'),JSON[_0x7fe7('0x13')](_0x43af25));if(_0x43af25[_0x7fe7('0x14')]){if(_0x43af25['error']['code']===0x1f4){logger[_0x7fe7('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x26ebaf,_0x43af25[_0x7fe7('0x14')]['message']);return _0x2c91df(_0x43af25['error'][_0x7fe7('0x15')]);}logger[_0x7fe7('0x14')](_0x7fe7('0xf'),_0x26ebaf,_0x43af25[_0x7fe7('0x14')]['message']);return _0x30657d(_0x43af25[_0x7fe7('0x14')]['message']);}else{logger[_0x7fe7('0xe')](_0x7fe7('0xf'),_0x26ebaf,'request\x20sent');_0x30657d(_0x43af25[_0x7fe7('0x16')][_0x7fe7('0x15')]);}})[_0x7fe7('0x17')](function(_0x216515){logger[_0x7fe7('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x26ebaf,_0x216515);_0x2c91df(_0x216515);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d84417c..0d07bee 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 _0x2ef0=['create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/:id','post'];(function(_0x48efc4,_0x4035c0){var _0x151c20=function(_0x53104f){while(--_0x53104f){_0x48efc4['push'](_0x48efc4['shift']());}};_0x151c20(++_0x4035c0);}(_0x2ef0,0xf0));var _0x02ef=function(_0x4cfff0,_0x4a5795){_0x4cfff0=_0x4cfff0-0x0;var _0x8dae99=_0x2ef0[_0x4cfff0];return _0x8dae99;};'use strict';var multer=require('multer');var util=require(_0x02ef('0x0'));var path=require('path');var timeout=require(_0x02ef('0x1'));var express=require('express');var router=express[_0x02ef('0x2')]();var fs_extra=require(_0x02ef('0x3'));var auth=require(_0x02ef('0x4'));var interaction=require(_0x02ef('0x5'));var config=require(_0x02ef('0x6'));var controller=require(_0x02ef('0x7'));router['get']('/',auth[_0x02ef('0x8')](),controller['index']);router[_0x02ef('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x02ef('0x9')](_0x02ef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x02ef('0xb')]('/',auth[_0x02ef('0x8')](),controller[_0x02ef('0xc')]);router[_0x02ef('0xd')](_0x02ef('0xa'),auth[_0x02ef('0x8')](),controller[_0x02ef('0xe')]);router[_0x02ef('0xf')](_0x02ef('0xa'),auth[_0x02ef('0x8')](),controller[_0x02ef('0x10')]);module[_0x02ef('0x11')]=router; \ No newline at end of file +var _0x5e36=['isAuthenticated','show','create','update','delete','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','/:id'];(function(_0x18ba01,_0x3e2a98){var _0x43d51c=function(_0x46bbf4){while(--_0x46bbf4){_0x18ba01['push'](_0x18ba01['shift']());}};_0x43d51c(++_0x3e2a98);}(_0x5e36,0x135));var _0x65e3=function(_0x3b0d04,_0x51e349){_0x3b0d04=_0x3b0d04-0x0;var _0x10a8c0=_0x5e36[_0x3b0d04];return _0x10a8c0;};'use strict';var multer=require(_0x65e3('0x0'));var util=require('util');var path=require(_0x65e3('0x1'));var timeout=require(_0x65e3('0x2'));var express=require(_0x65e3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x65e3('0x4'));var interaction=require(_0x65e3('0x5'));var config=require('../../config/environment');var controller=require(_0x65e3('0x6'));router[_0x65e3('0x7')]('/',auth['isAuthenticated'](),controller[_0x65e3('0x8')]);router[_0x65e3('0x7')](_0x65e3('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x65e3('0x7')](_0x65e3('0xa'),auth[_0x65e3('0xb')](),controller[_0x65e3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65e3('0xd')]);router['put'](_0x65e3('0xa'),auth[_0x65e3('0xb')](),controller[_0x65e3('0xe')]);router[_0x65e3('0xf')]('/:id',auth[_0x65e3('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9823e7c..3ced978 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x10f9ea,_0x13b417){var _0x5856a6=function(_0x2c0c65){while(--_0x2c0c65){_0x10f9ea['push'](_0x10f9ea['shift']());}};_0x5856a6(++_0x13b417);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x294b6,_0x2907ae){_0x294b6=_0x294b6-0x0;var _0x38bb97=_0xf3cd[_0x294b6];return _0x38bb97;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x53e6a8,_0x5839ab){var _0x2b6dcc=function(_0x2b4215){while(--_0x2b4215){_0x53e6a8['push'](_0x53e6a8['shift']());}};_0x2b6dcc(++_0x5839ab);}(_0x34e8,0x12c));var _0x834e=function(_0x49de90,_0x40675b){_0x49de90=_0x49de90-0x0;var _0x15e17a=_0x34e8[_0x49de90];return _0x15e17a;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 80be6bd..cc4f919 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 _0x0d72=['sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','MailTransferReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0xb88d40,_0x53a65b){var _0x193479=function(_0x31220e){while(--_0x31220e){_0xb88d40['push'](_0xb88d40['shift']());}};_0x193479(++_0x53a65b);}(_0x0d72,0x193));var _0x20d7=function(_0x45a3f1,_0xd0a6c9){_0x45a3f1=_0x45a3f1-0x0;var _0x2534ec=_0x0d72[_0x45a3f1];return _0x2534ec;};'use strict';var emlformat=require(_0x20d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20d7('0x2'));var BPromise=require(_0x20d7('0x3'));var Mustache=require(_0x20d7('0x4'));var util=require(_0x20d7('0x5'));var path=require(_0x20d7('0x6'));var sox=require(_0x20d7('0x7'));var csv=require(_0x20d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20d7('0x9'));var squel=require(_0x20d7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20d7('0xb'));var toCsv=require(_0x20d7('0x8'));var querystring=require(_0x20d7('0xc'));var Papa=require(_0x20d7('0xd'));var Redis=require('ioredis');var authService=require(_0x20d7('0xe'));var qs=require(_0x20d7('0xf'));var as=require(_0x20d7('0x10'));var hardwareService=require(_0x20d7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x20d7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x20d7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x282d14,_0x34e09c){_0x34e09c=_0x34e09c||0xcc;return function(_0x4c522b){if(_0x4c522b){return _0x282d14['sendStatus'](_0x34e09c);}return _0x282d14[_0x20d7('0x14')](_0x34e09c)['end']();};}function respondWithResult(_0x11c31e,_0x32f7c3){_0x32f7c3=_0x32f7c3||0xc8;return function(_0x10dfea){if(_0x10dfea){return _0x11c31e[_0x20d7('0x14')](_0x32f7c3)[_0x20d7('0x15')](_0x10dfea);}};}function respondWithFilteredResult(_0xfeb950,_0x14a965){return function(_0x5e7105){if(_0x5e7105){var _0x27d6e2=typeof _0x14a965[_0x20d7('0x16')]===_0x20d7('0x17')&&typeof _0x14a965[_0x20d7('0x18')]==='undefined';var _0x2366c8=_0x5e7105[_0x20d7('0x19')];var _0x35aea0=_0x27d6e2?0x0:_0x14a965[_0x20d7('0x16')];var _0x57c508=_0x27d6e2?_0x5e7105[_0x20d7('0x19')]:_0x14a965[_0x20d7('0x16')]+_0x14a965['limit'];var _0x3c781d;if(_0x57c508>=_0x2366c8){_0x57c508=_0x2366c8;_0x3c781d=0xc8;}else{_0x3c781d=0xce;}_0xfeb950[_0x20d7('0x14')](_0x3c781d);return _0xfeb950[_0x20d7('0x1a')](_0x20d7('0x1b'),_0x35aea0+'-'+_0x57c508+'/'+_0x2366c8)[_0x20d7('0x15')](_0x5e7105);}return null;};}function patchUpdates(_0x22f65d){return function(_0x23e497){try{jsonpatch[_0x20d7('0x1c')](_0x23e497,_0x22f65d,!![]);}catch(_0x41a402){return BPromise[_0x20d7('0x1d')](_0x41a402);}return _0x23e497[_0x20d7('0x1e')]();};}function saveUpdates(_0x4e9809,_0x2e9c26){return function(_0x50acfa){if(_0x50acfa){return _0x50acfa[_0x20d7('0x1f')](_0x4e9809)[_0x20d7('0x20')](function(_0x3e6bd0){return _0x3e6bd0;});}return null;};}function removeEntity(_0x3bc9b2,_0x32c379){return function(_0x44f7aa){if(_0x44f7aa){return _0x44f7aa[_0x20d7('0x21')]()[_0x20d7('0x20')](function(){_0x3bc9b2[_0x20d7('0x14')](0xcc)[_0x20d7('0x22')]();});}};}function handleEntityNotFound(_0x470d15,_0x77f5dc){return function(_0x4a2fac){if(!_0x4a2fac){_0x470d15[_0x20d7('0x23')](0x194);}return _0x4a2fac;};}function handleError(_0xaf10ce,_0x9d27f8){_0x9d27f8=_0x9d27f8||0x1f4;return function(_0x5bcf24){logger[_0x20d7('0x24')](_0x5bcf24[_0x20d7('0x25')]);if(_0x5bcf24[_0x20d7('0x26')]){delete _0x5bcf24[_0x20d7('0x26')];}_0xaf10ce['status'](_0x9d27f8)[_0x20d7('0x27')](_0x5bcf24);};}exports[_0x20d7('0x28')]=function(_0x581c39,_0x334fad){var _0x2bb8f5={},_0x1b77c9={},_0x584646={'count':0x0,'rows':[]};var _0x59de44=_[_0x20d7('0x29')](db['MailTransferReport'][_0x20d7('0x2a')],function(_0x42eae6){return{'name':_0x42eae6[_0x20d7('0x2b')],'type':_0x42eae6[_0x20d7('0x2c')]['key']};});_0x1b77c9[_0x20d7('0x2d')]=_['map'](_0x59de44,_0x20d7('0x26'));_0x1b77c9[_0x20d7('0x2e')]=_[_0x20d7('0x2f')](_0x581c39[_0x20d7('0x2e')]);_0x1b77c9[_0x20d7('0x30')]=_[_0x20d7('0x31')](_0x1b77c9[_0x20d7('0x2d')],_0x1b77c9['query']);_0x2bb8f5[_0x20d7('0x32')]=_[_0x20d7('0x31')](_0x1b77c9['model'],qs[_0x20d7('0x33')](_0x581c39['query']['fields']));_0x2bb8f5['attributes']=_0x2bb8f5[_0x20d7('0x32')][_0x20d7('0x34')]?_0x2bb8f5[_0x20d7('0x32')]:_0x1b77c9[_0x20d7('0x2d')];if(!_0x581c39[_0x20d7('0x2e')][_0x20d7('0x35')]('nolimit')){_0x2bb8f5[_0x20d7('0x18')]=qs['limit'](_0x581c39[_0x20d7('0x2e')][_0x20d7('0x18')]);_0x2bb8f5['offset']=qs['offset'](_0x581c39[_0x20d7('0x2e')][_0x20d7('0x16')]);}_0x2bb8f5[_0x20d7('0x36')]=qs[_0x20d7('0x37')](_0x581c39['query'][_0x20d7('0x37')]);_0x2bb8f5['where']=qs['filters'](_[_0x20d7('0x38')](_0x581c39[_0x20d7('0x2e')],_0x1b77c9[_0x20d7('0x30')]),_0x59de44);if(_0x581c39[_0x20d7('0x2e')]['filter']){_0x2bb8f5[_0x20d7('0x39')]=_[_0x20d7('0x3a')](_0x2bb8f5[_0x20d7('0x39')],{'$or':_['map'](_0x59de44,function(_0x488423){if(_0x488423['type']!==_0x20d7('0x3b')){var _0x3dd0dc={};_0x3dd0dc[_0x488423[_0x20d7('0x26')]]={'$like':'%'+_0x581c39[_0x20d7('0x2e')][_0x20d7('0x3c')]+'%'};return _0x3dd0dc;}})});}_0x2bb8f5=_[_0x20d7('0x3a')]({},_0x2bb8f5,_0x581c39[_0x20d7('0x3d')]);var _0xeb3465={'where':_0x2bb8f5['where']};return db[_0x20d7('0x3e')][_0x20d7('0x19')](_0xeb3465)[_0x20d7('0x20')](function(_0x12f6bb){_0x584646[_0x20d7('0x19')]=_0x12f6bb;if(_0x581c39[_0x20d7('0x2e')][_0x20d7('0x3f')]){_0x2bb8f5[_0x20d7('0x40')]=[{'all':!![]}];}return db[_0x20d7('0x3e')][_0x20d7('0x41')](_0x2bb8f5);})['then'](function(_0x536956){_0x584646[_0x20d7('0x42')]=_0x536956;return _0x584646;})[_0x20d7('0x20')](respondWithFilteredResult(_0x334fad,_0x2bb8f5))[_0x20d7('0x43')](handleError(_0x334fad,null));};exports['show']=function(_0x3b7b11,_0x26574e){var _0x1081a7={'raw':!![],'where':{'id':_0x3b7b11[_0x20d7('0x44')]['id']}},_0x290c57={};_0x290c57[_0x20d7('0x2d')]=_[_0x20d7('0x2f')](db[_0x20d7('0x3e')][_0x20d7('0x2a')]);_0x290c57['query']=_[_0x20d7('0x2f')](_0x3b7b11[_0x20d7('0x2e')]);_0x290c57[_0x20d7('0x30')]=_['intersection'](_0x290c57[_0x20d7('0x2d')],_0x290c57[_0x20d7('0x2e')]);_0x1081a7[_0x20d7('0x32')]=_['intersection'](_0x290c57['model'],qs[_0x20d7('0x33')](_0x3b7b11[_0x20d7('0x2e')][_0x20d7('0x33')]));_0x1081a7[_0x20d7('0x32')]=_0x1081a7[_0x20d7('0x32')][_0x20d7('0x34')]?_0x1081a7['attributes']:_0x290c57['model'];if(_0x3b7b11[_0x20d7('0x2e')]['includeAll']){_0x1081a7[_0x20d7('0x40')]=[{'all':!![]}];}_0x1081a7=_[_0x20d7('0x3a')]({},_0x1081a7,_0x3b7b11[_0x20d7('0x3d')]);return db[_0x20d7('0x3e')]['find'](_0x1081a7)['then'](handleEntityNotFound(_0x26574e,null))[_0x20d7('0x20')](respondWithResult(_0x26574e,null))[_0x20d7('0x43')](handleError(_0x26574e,null));};exports[_0x20d7('0x45')]=function(_0x10a105,_0x16c248){return db[_0x20d7('0x3e')][_0x20d7('0x45')](_0x10a105[_0x20d7('0x46')],{})['then'](respondWithResult(_0x16c248,0xc9))[_0x20d7('0x43')](handleError(_0x16c248,null));};exports[_0x20d7('0x1f')]=function(_0x1e16ae,_0x3de7fd){if(_0x1e16ae[_0x20d7('0x46')]['id']){delete _0x1e16ae[_0x20d7('0x46')]['id'];}return db[_0x20d7('0x3e')][_0x20d7('0x47')]({'where':{'id':_0x1e16ae['params']['id']}})[_0x20d7('0x20')](handleEntityNotFound(_0x3de7fd,null))['then'](saveUpdates(_0x1e16ae['body'],null))[_0x20d7('0x20')](respondWithResult(_0x3de7fd,null))['catch'](handleError(_0x3de7fd,null));};exports['destroy']=function(_0x108b6d,_0x1a80ec){return db[_0x20d7('0x3e')]['find']({'where':{'id':_0x108b6d['params']['id']}})[_0x20d7('0x20')](handleEntityNotFound(_0x1a80ec,null))[_0x20d7('0x20')](removeEntity(_0x1a80ec,null))['catch'](handleError(_0x1a80ec,null));};exports[_0x20d7('0x48')]=function(_0x12c9ec,_0x45f398){return db[_0x20d7('0x3e')][_0x20d7('0x48')]()[_0x20d7('0x20')](respondWithResult(_0x45f398,null))['catch'](handleError(_0x45f398,null));}; \ No newline at end of file +var _0xe4c4=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','MailTransferReport','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe4c4,0x81));var _0x4e4c=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0xe4c4[_0x30c649];return _0x3edfb9;};'use strict';var emlformat=require(_0x4e4c('0x0'));var rimraf=require(_0x4e4c('0x1'));var zipdir=require(_0x4e4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4e4c('0x3'));var Mustache=require(_0x4e4c('0x4'));var util=require(_0x4e4c('0x5'));var path=require(_0x4e4c('0x6'));var sox=require(_0x4e4c('0x7'));var csv=require(_0x4e4c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e4c('0x9'));var _=require('lodash');var squel=require(_0x4e4c('0xa'));var crypto=require('crypto');var jsforce=require(_0x4e4c('0xb'));var deskjs=require(_0x4e4c('0xc'));var toCsv=require(_0x4e4c('0x8'));var querystring=require('querystring');var Papa=require(_0x4e4c('0xd'));var Redis=require(_0x4e4c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e4c('0xf'));var hardwareService=require(_0x4e4c('0x10'));var logger=require(_0x4e4c('0x11'))(_0x4e4c('0x12'));var utils=require('../../config/utils');var config=require(_0x4e4c('0x13'));var licenseUtil=require(_0x4e4c('0x14'));var db=require(_0x4e4c('0x15'))['db'];function respondWithStatusCode(_0xa6f6c,_0x19cade){_0x19cade=_0x19cade||0xcc;return function(_0x2dcb71){if(_0x2dcb71){return _0xa6f6c[_0x4e4c('0x16')](_0x19cade);}return _0xa6f6c[_0x4e4c('0x17')](_0x19cade)[_0x4e4c('0x18')]();};}function respondWithResult(_0x29ef6,_0x4d7835){_0x4d7835=_0x4d7835||0xc8;return function(_0x5809c8){if(_0x5809c8){return _0x29ef6[_0x4e4c('0x17')](_0x4d7835)[_0x4e4c('0x19')](_0x5809c8);}};}function respondWithFilteredResult(_0x2251a9,_0x107300){return function(_0x39e905){if(_0x39e905){var _0x47ffbe=typeof _0x107300[_0x4e4c('0x1a')]===_0x4e4c('0x1b')&&typeof _0x107300[_0x4e4c('0x1c')]==='undefined';var _0x39f580=_0x39e905[_0x4e4c('0x1d')];var _0x38f307=_0x47ffbe?0x0:_0x107300[_0x4e4c('0x1a')];var _0x1893d1=_0x47ffbe?_0x39e905[_0x4e4c('0x1d')]:_0x107300[_0x4e4c('0x1a')]+_0x107300[_0x4e4c('0x1c')];var _0x2ed317;if(_0x1893d1>=_0x39f580){_0x1893d1=_0x39f580;_0x2ed317=0xc8;}else{_0x2ed317=0xce;}_0x2251a9[_0x4e4c('0x17')](_0x2ed317);return _0x2251a9[_0x4e4c('0x1e')](_0x4e4c('0x1f'),_0x38f307+'-'+_0x1893d1+'/'+_0x39f580)[_0x4e4c('0x19')](_0x39e905);}return null;};}function patchUpdates(_0x2e0bf1){return function(_0x4ef28c){try{jsonpatch[_0x4e4c('0x20')](_0x4ef28c,_0x2e0bf1,!![]);}catch(_0x41a1bc){return BPromise['reject'](_0x41a1bc);}return _0x4ef28c[_0x4e4c('0x21')]();};}function saveUpdates(_0x2ef0f1,_0x1faa90){return function(_0x264dc8){if(_0x264dc8){return _0x264dc8['update'](_0x2ef0f1)[_0x4e4c('0x22')](function(_0x14111b){return _0x14111b;});}return null;};}function removeEntity(_0x212cb4,_0x318a55){return function(_0x5c2026){if(_0x5c2026){return _0x5c2026[_0x4e4c('0x23')]()[_0x4e4c('0x22')](function(){_0x212cb4['status'](0xcc)[_0x4e4c('0x18')]();});}};}function handleEntityNotFound(_0x636a6,_0x24f93b){return function(_0x3b6433){if(!_0x3b6433){_0x636a6['sendStatus'](0x194);}return _0x3b6433;};}function handleError(_0x3fec87,_0x3ca972){_0x3ca972=_0x3ca972||0x1f4;return function(_0x456719){logger[_0x4e4c('0x24')](_0x456719[_0x4e4c('0x25')]);if(_0x456719[_0x4e4c('0x26')]){delete _0x456719[_0x4e4c('0x26')];}_0x3fec87['status'](_0x3ca972)['send'](_0x456719);};}exports[_0x4e4c('0x27')]=function(_0x10c03a,_0x26de82){var _0x1a0cc4={},_0x77ee4e={},_0x3416b5={'count':0x0,'rows':[]};var _0x48bfef=_[_0x4e4c('0x28')](db['MailTransferReport']['rawAttributes'],function(_0x47a660){return{'name':_0x47a660[_0x4e4c('0x29')],'type':_0x47a660[_0x4e4c('0x2a')][_0x4e4c('0x2b')]};});_0x77ee4e[_0x4e4c('0x2c')]=_[_0x4e4c('0x28')](_0x48bfef,'name');_0x77ee4e['query']=_[_0x4e4c('0x2d')](_0x10c03a[_0x4e4c('0x2e')]);_0x77ee4e['filters']=_['intersection'](_0x77ee4e[_0x4e4c('0x2c')],_0x77ee4e[_0x4e4c('0x2e')]);_0x1a0cc4['attributes']=_[_0x4e4c('0x2f')](_0x77ee4e[_0x4e4c('0x2c')],qs['fields'](_0x10c03a[_0x4e4c('0x2e')][_0x4e4c('0x30')]));_0x1a0cc4['attributes']=_0x1a0cc4[_0x4e4c('0x31')][_0x4e4c('0x32')]?_0x1a0cc4[_0x4e4c('0x31')]:_0x77ee4e[_0x4e4c('0x2c')];if(!_0x10c03a['query'][_0x4e4c('0x33')](_0x4e4c('0x34'))){_0x1a0cc4[_0x4e4c('0x1c')]=qs[_0x4e4c('0x1c')](_0x10c03a[_0x4e4c('0x2e')]['limit']);_0x1a0cc4[_0x4e4c('0x1a')]=qs[_0x4e4c('0x1a')](_0x10c03a[_0x4e4c('0x2e')][_0x4e4c('0x1a')]);}_0x1a0cc4[_0x4e4c('0x35')]=qs[_0x4e4c('0x36')](_0x10c03a['query'][_0x4e4c('0x36')]);_0x1a0cc4[_0x4e4c('0x37')]=qs[_0x4e4c('0x38')](_['pick'](_0x10c03a[_0x4e4c('0x2e')],_0x77ee4e[_0x4e4c('0x38')]),_0x48bfef);if(_0x10c03a[_0x4e4c('0x2e')]['filter']){_0x1a0cc4[_0x4e4c('0x37')]=_[_0x4e4c('0x39')](_0x1a0cc4[_0x4e4c('0x37')],{'$or':_[_0x4e4c('0x28')](_0x48bfef,function(_0x22f654){if(_0x22f654[_0x4e4c('0x2a')]!==_0x4e4c('0x3a')){var _0x3d7541={};_0x3d7541[_0x22f654[_0x4e4c('0x26')]]={'$like':'%'+_0x10c03a[_0x4e4c('0x2e')][_0x4e4c('0x3b')]+'%'};return _0x3d7541;}})});}_0x1a0cc4=_[_0x4e4c('0x39')]({},_0x1a0cc4,_0x10c03a[_0x4e4c('0x3c')]);var _0x3703b1={'where':_0x1a0cc4[_0x4e4c('0x37')]};return db[_0x4e4c('0x3d')][_0x4e4c('0x1d')](_0x3703b1)['then'](function(_0x22d030){_0x3416b5['count']=_0x22d030;if(_0x10c03a[_0x4e4c('0x2e')][_0x4e4c('0x3e')]){_0x1a0cc4[_0x4e4c('0x3f')]=[{'all':!![]}];}return db[_0x4e4c('0x3d')][_0x4e4c('0x40')](_0x1a0cc4);})[_0x4e4c('0x22')](function(_0x2c820c){_0x3416b5['rows']=_0x2c820c;return _0x3416b5;})['then'](respondWithFilteredResult(_0x26de82,_0x1a0cc4))[_0x4e4c('0x41')](handleError(_0x26de82,null));};exports[_0x4e4c('0x42')]=function(_0x3c7bcc,_0x2f358d){var _0x2ce02d={'raw':!![],'where':{'id':_0x3c7bcc[_0x4e4c('0x43')]['id']}},_0x45e5a8={};_0x45e5a8[_0x4e4c('0x2c')]=_[_0x4e4c('0x2d')](db[_0x4e4c('0x3d')]['rawAttributes']);_0x45e5a8[_0x4e4c('0x2e')]=_[_0x4e4c('0x2d')](_0x3c7bcc[_0x4e4c('0x2e')]);_0x45e5a8[_0x4e4c('0x38')]=_[_0x4e4c('0x2f')](_0x45e5a8[_0x4e4c('0x2c')],_0x45e5a8[_0x4e4c('0x2e')]);_0x2ce02d[_0x4e4c('0x31')]=_['intersection'](_0x45e5a8[_0x4e4c('0x2c')],qs[_0x4e4c('0x30')](_0x3c7bcc[_0x4e4c('0x2e')][_0x4e4c('0x30')]));_0x2ce02d[_0x4e4c('0x31')]=_0x2ce02d[_0x4e4c('0x31')][_0x4e4c('0x32')]?_0x2ce02d[_0x4e4c('0x31')]:_0x45e5a8[_0x4e4c('0x2c')];if(_0x3c7bcc[_0x4e4c('0x2e')][_0x4e4c('0x3e')]){_0x2ce02d[_0x4e4c('0x3f')]=[{'all':!![]}];}_0x2ce02d=_[_0x4e4c('0x39')]({},_0x2ce02d,_0x3c7bcc['options']);return db[_0x4e4c('0x3d')][_0x4e4c('0x44')](_0x2ce02d)['then'](handleEntityNotFound(_0x2f358d,null))['then'](respondWithResult(_0x2f358d,null))[_0x4e4c('0x41')](handleError(_0x2f358d,null));};exports[_0x4e4c('0x45')]=function(_0x4bd873,_0x46e2fd){return db['MailTransferReport'][_0x4e4c('0x45')](_0x4bd873[_0x4e4c('0x46')],{})[_0x4e4c('0x22')](respondWithResult(_0x46e2fd,0xc9))[_0x4e4c('0x41')](handleError(_0x46e2fd,null));};exports['update']=function(_0x16e02a,_0x40c304){if(_0x16e02a['body']['id']){delete _0x16e02a['body']['id'];}return db[_0x4e4c('0x3d')]['find']({'where':{'id':_0x16e02a['params']['id']}})[_0x4e4c('0x22')](handleEntityNotFound(_0x40c304,null))[_0x4e4c('0x22')](saveUpdates(_0x16e02a[_0x4e4c('0x46')],null))[_0x4e4c('0x22')](respondWithResult(_0x40c304,null))[_0x4e4c('0x41')](handleError(_0x40c304,null));};exports[_0x4e4c('0x23')]=function(_0x306410,_0x4d9f39){return db[_0x4e4c('0x3d')][_0x4e4c('0x44')]({'where':{'id':_0x306410[_0x4e4c('0x43')]['id']}})[_0x4e4c('0x22')](handleEntityNotFound(_0x4d9f39,null))[_0x4e4c('0x22')](removeEntity(_0x4d9f39,null))[_0x4e4c('0x41')](handleError(_0x4d9f39,null));};exports[_0x4e4c('0x47')]=function(_0x1751ff,_0x52c330){return db[_0x4e4c('0x3d')][_0x4e4c('0x47')]()[_0x4e4c('0x22')](respondWithResult(_0x52c330,null))[_0x4e4c('0x41')](handleError(_0x52c330,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 19b6ac6..1a0e672 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 _0x3d6d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x26dfca,_0x131ede){var _0x42da68=function(_0x5f0d3a){while(--_0x5f0d3a){_0x26dfca['push'](_0x26dfca['shift']());}};_0x42da68(++_0x131ede);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x3d6d[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xd3d6('0x0'));var util=require(_0xd3d6('0x1'));var logger=require(_0xd3d6('0x2'))(_0xd3d6('0x3'));var moment=require(_0xd3d6('0x4'));var BPromise=require(_0xd3d6('0x5'));var rp=require(_0xd3d6('0x6'));var fs=require('fs');var path=require(_0xd3d6('0x7'));var rimraf=require(_0xd3d6('0x8'));var config=require(_0xd3d6('0x9'));var attributes=require(_0xd3d6('0xa'));module['exports']=function(_0x5400f8,_0x3f36){return _0x5400f8[_0xd3d6('0xb')](_0xd3d6('0xc'),attributes,{'tableName':_0xd3d6('0xd'),'paranoid':![],'indexes':[{'name':_0xd3d6('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb82=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xfb82,0x17f));var _0x2fb8=function(_0xb1fbde,_0x498cad){_0xb1fbde=_0xb1fbde-0x0;var _0x1204a6=_0xfb82[_0xb1fbde];return _0x1204a6;};'use strict';var _=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var logger=require(_0x2fb8('0x2'))('api');var moment=require(_0x2fb8('0x3'));var BPromise=require(_0x2fb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fb8('0x5'));var rimraf=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var attributes=require(_0x2fb8('0x8'));module[_0x2fb8('0x9')]=function(_0xe9a5b5,_0x3e6900){return _0xe9a5b5[_0x2fb8('0xa')](_0x2fb8('0xb'),attributes,{'tableName':_0x2fb8('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2fb8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index cbd770a..34f794c 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 _0x7df4=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x7df4,0x1de));var _0x47df=function(_0x1d0e9b,_0x4e9fc1){_0x1d0e9b=_0x1d0e9b-0x0;var _0x22c87e=_0x7df4[_0x1d0e9b];return _0x22c87e;};'use strict';var _=require(_0x47df('0x0'));var util=require(_0x47df('0x1'));var moment=require(_0x47df('0x2'));var BPromise=require(_0x47df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47df('0x4'));var db=require(_0x47df('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47df('0x6'))('rpc');var config=require(_0x47df('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x47df('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c0db4,_0xba8627,_0x35c4f6){return new BPromise(function(_0x49c5fd,_0x398cbc){return client[_0x47df('0x9')](_0x5c0db4,_0x35c4f6)['then'](function(_0x2a2eb3){logger[_0x47df('0xa')](_0x47df('0xb'),_0xba8627,_0x47df('0xc'));logger[_0x47df('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xba8627,'request\x20sent',JSON[_0x47df('0xe')](_0x2a2eb3));if(_0x2a2eb3[_0x47df('0xf')]){if(_0x2a2eb3[_0x47df('0xf')][_0x47df('0x10')]===0x1f4){logger[_0x47df('0xf')](_0x47df('0xb'),_0xba8627,_0x2a2eb3[_0x47df('0xf')][_0x47df('0x11')]);return _0x398cbc(_0x2a2eb3['error'][_0x47df('0x11')]);}logger[_0x47df('0xf')]('MailTransferReport,\x20%s,\x20%s',_0xba8627,_0x2a2eb3[_0x47df('0xf')][_0x47df('0x11')]);return _0x49c5fd(_0x2a2eb3['error'][_0x47df('0x11')]);}else{logger['info'](_0x47df('0xb'),_0xba8627,_0x47df('0xc'));_0x49c5fd(_0x2a2eb3[_0x47df('0x12')][_0x47df('0x11')]);}})[_0x47df('0x13')](function(_0xdc3db1){logger['error'](_0x47df('0xb'),_0xba8627,_0xdc3db1);_0x398cbc(_0xdc3db1);});});} \ No newline at end of file +var _0x61ce=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x61ce,0x121));var _0xe61c=function(_0x38beb4,_0x21c8e6){_0x38beb4=_0x38beb4-0x0;var _0x36fc24=_0x61ce[_0x38beb4];return _0x36fc24;};'use strict';var _=require(_0xe61c('0x0'));var util=require(_0xe61c('0x1'));var moment=require(_0xe61c('0x2'));var BPromise=require(_0xe61c('0x3'));var rs=require(_0xe61c('0x4'));var fs=require('fs');var Redis=require(_0xe61c('0x5'));var db=require(_0xe61c('0x6'))['db'];var utils=require(_0xe61c('0x7'));var logger=require(_0xe61c('0x8'))(_0xe61c('0x9'));var config=require(_0xe61c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52b801,_0xb1f69a,_0x23cfe6){return new BPromise(function(_0xcaa8b6,_0x43f24d){return client[_0xe61c('0xb')](_0x52b801,_0x23cfe6)['then'](function(_0x2bd724){logger[_0xe61c('0xc')](_0xe61c('0xd'),_0xb1f69a,'request\x20sent');logger[_0xe61c('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xb1f69a,_0xe61c('0xf'),JSON[_0xe61c('0x10')](_0x2bd724));if(_0x2bd724[_0xe61c('0x11')]){if(_0x2bd724[_0xe61c('0x11')][_0xe61c('0x12')]===0x1f4){logger['error'](_0xe61c('0xd'),_0xb1f69a,_0x2bd724[_0xe61c('0x11')]['message']);return _0x43f24d(_0x2bd724[_0xe61c('0x11')][_0xe61c('0x13')]);}logger[_0xe61c('0x11')](_0xe61c('0xd'),_0xb1f69a,_0x2bd724[_0xe61c('0x11')][_0xe61c('0x13')]);return _0xcaa8b6(_0x2bd724[_0xe61c('0x11')][_0xe61c('0x13')]);}else{logger[_0xe61c('0xc')](_0xe61c('0xd'),_0xb1f69a,_0xe61c('0xf'));_0xcaa8b6(_0x2bd724[_0xe61c('0x14')][_0xe61c('0x13')]);}})[_0xe61c('0x15')](function(_0x25af1e){logger[_0xe61c('0x11')]('MailTransferReport,\x20%s,\x20%s',_0xb1f69a,_0x25af1e);_0x43f24d(_0x25af1e);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index c55b82c..8af21e6 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 _0x3139=['create','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','describe','/:id','post'];(function(_0x4f6c8c,_0x287dd3){var _0x48d510=function(_0x2bfdd7){while(--_0x2bfdd7){_0x4f6c8c['push'](_0x4f6c8c['shift']());}};_0x48d510(++_0x287dd3);}(_0x3139,0x88));var _0x9313=function(_0xc4bd9d,_0x33852c){_0xc4bd9d=_0xc4bd9d-0x0;var _0x103569=_0x3139[_0xc4bd9d];return _0x103569;};'use strict';var multer=require(_0x9313('0x0'));var util=require(_0x9313('0x1'));var path=require(_0x9313('0x2'));var timeout=require(_0x9313('0x3'));var express=require(_0x9313('0x4'));var router=express['Router']();var fs_extra=require(_0x9313('0x5'));var auth=require(_0x9313('0x6'));var interaction=require(_0x9313('0x7'));var config=require(_0x9313('0x8'));var controller=require(_0x9313('0x9'));router['get']('/',auth[_0x9313('0xa')](),controller[_0x9313('0xb')]);router[_0x9313('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x9313('0xd')]);router[_0x9313('0xc')](_0x9313('0xe'),auth[_0x9313('0xa')](),controller['show']);router[_0x9313('0xf')]('/',auth['isAuthenticated'](),controller[_0x9313('0x10')]);router['put'](_0x9313('0xe'),auth[_0x9313('0xa')](),controller['update']);router['delete'](_0x9313('0xe'),auth[_0x9313('0xa')](),controller[_0x9313('0x11')]);module[_0x9313('0x12')]=router; \ No newline at end of file +var _0x133f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0x133f,0x1e3));var _0xf133=function(_0x52c69a,_0x4757c9){_0x52c69a=_0x52c69a-0x0;var _0x35b7eb=_0x133f[_0x52c69a];return _0x35b7eb;};'use strict';var multer=require(_0xf133('0x0'));var util=require(_0xf133('0x1'));var path=require(_0xf133('0x2'));var timeout=require(_0xf133('0x3'));var express=require(_0xf133('0x4'));var router=express[_0xf133('0x5')]();var fs_extra=require(_0xf133('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf133('0x7'));var config=require(_0xf133('0x8'));var controller=require(_0xf133('0x9'));router[_0xf133('0xa')]('/',auth[_0xf133('0xb')](),controller[_0xf133('0xc')]);router[_0xf133('0xa')](_0xf133('0xd'),auth[_0xf133('0xb')](),controller[_0xf133('0xe')]);router[_0xf133('0xa')]('/:id',auth[_0xf133('0xb')](),controller[_0xf133('0xf')]);router[_0xf133('0x10')]('/',auth['isAuthenticated'](),controller[_0xf133('0x11')]);router[_0xf133('0x12')](_0xf133('0x13'),auth[_0xf133('0xb')](),controller[_0xf133('0x14')]);router[_0xf133('0x15')](_0xf133('0x13'),auth[_0xf133('0xb')](),controller['destroy']);module[_0xf133('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 71dbf80..090a4b2 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 _0x96a2=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING'];(function(_0x154204,_0x555ebf){var _0x14d0bc=function(_0x8af7f2){while(--_0x8af7f2){_0x154204['push'](_0x154204['shift']());}};_0x14d0bc(++_0x555ebf);}(_0x96a2,0x96));var _0x296a=function(_0x2ce3c8,_0x511a98){_0x2ce3c8=_0x2ce3c8-0x0;var _0x434e9e=_0x96a2[_0x2ce3c8];return _0x434e9e;};'use strict';var Sequelize=require(_0x296a('0x0'));var moment=require('moment');module[_0x296a('0x1')]={'channel':{'type':Sequelize[_0x296a('0x2')]},'membername':{'type':Sequelize[_0x296a('0x2')]},'interface':{'type':Sequelize[_0x296a('0x2')]},'type':{'type':Sequelize[_0x296a('0x2')],'defaultValue':_0x296a('0x3'),'comment':_0x296a('0x4')},'duration':{'type':Sequelize[_0x296a('0x5')]},'enterAt':{'type':Sequelize[_0x296a('0x6')]},'exitAt':{'type':Sequelize[_0x296a('0x6')],'set':function(_0x285be8){var _0x31bb42=moment(_0x285be8);var _0x4eb919=moment(this[_0x296a('0x7')](_0x296a('0x8')));var _0x3a2b44=_0x31bb42[_0x296a('0x9')](_0x4eb919,_0x296a('0xa'));this['setDataValue'](_0x296a('0xb'),_0x285be8);this[_0x296a('0xc')]('duration',_0x3a2b44||null);}},'data1':{'type':Sequelize[_0x296a('0x2')],'comment':_0x296a('0xd')},'data2':{'type':Sequelize[_0x296a('0x2')],'comment':_0x296a('0xe')},'data3':{'type':Sequelize[_0x296a('0x2')],'comment':_0x296a('0xf')},'data4':{'type':Sequelize[_0x296a('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x296a('0x2')],'comment':_0x296a('0x10')},'role':{'type':Sequelize[_0x296a('0x2')]},'internal':{'type':Sequelize[_0x296a('0x5')]},'uniqueid':{'type':Sequelize[_0x296a('0x2')]}}; \ No newline at end of file +var _0x652b=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize'];(function(_0x1f8ee0,_0x2cc035){var _0x34536b=function(_0x39948d){while(--_0x39948d){_0x1f8ee0['push'](_0x1f8ee0['shift']());}};_0x34536b(++_0x2cc035);}(_0x652b,0x68));var _0xb652=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x652b[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0xb652('0x0'));var moment=require(_0xb652('0x1'));module[_0xb652('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb652('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xb652('0x4'),'comment':_0xb652('0x5')},'duration':{'type':Sequelize[_0xb652('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x43f467){var _0x491ce7=moment(_0x43f467);var _0x58d168=moment(this[_0xb652('0x7')]('enterAt'));var _0x2b82fd=_0x491ce7[_0xb652('0x8')](_0x58d168,_0xb652('0x9'));this[_0xb652('0xa')](_0xb652('0xb'),_0x43f467);this[_0xb652('0xa')]('duration',_0x2b82fd||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb652('0xc')},'data2':{'type':Sequelize[_0xb652('0x3')],'comment':_0xb652('0xd')},'data3':{'type':Sequelize[_0xb652('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xb652('0x3')],'comment':_0xb652('0xe')},'data5':{'type':Sequelize[_0xb652('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xb652('0x3')]},'internal':{'type':Sequelize[_0xb652('0x6')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 2ca7d4b..69401f7 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x6317d6,_0x424384){var _0x5add4d=function(_0x176118){while(--_0x176118){_0x6317d6['push'](_0x6317d6['shift']());}};_0x5add4d(++_0x424384);}(_0x3e74,0x175));var _0x43e7=function(_0x41d231,_0x14cb07){_0x41d231=_0x41d231-0x0;var _0x3c0136=_0x3e74[_0x41d231];return _0x3c0136;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x1e4edf,_0x365b36){var _0x5dd558=function(_0x387b02){while(--_0x387b02){_0x1e4edf['push'](_0x1e4edf['shift']());}};_0x5dd558(++_0x365b36);}(_0x3e74,0x175));var _0x43e7=function(_0x22d091,_0x48d4f8){_0x22d091=_0x22d091-0x0;var _0x2e1295=_0x3e74[_0x22d091];return _0x2e1295;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8bb239f..2cb761b 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 _0xa87e=['membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface'];(function(_0x4e54c4,_0x3e1eda){var _0x1b4745=function(_0x3369e4){while(--_0x3369e4){_0x4e54c4['push'](_0x4e54c4['shift']());}};_0x1b4745(++_0x3e1eda);}(_0xa87e,0x1c2));var _0xea87=function(_0xe3a3eb,_0x2a121c){_0xe3a3eb=_0xe3a3eb-0x0;var _0x527657=_0xa87e[_0xe3a3eb];return _0x527657;};'use strict';var _=require(_0xea87('0x0'));var util=require(_0xea87('0x1'));var logger=require(_0xea87('0x2'))(_0xea87('0x3'));var moment=require('moment');var BPromise=require(_0xea87('0x4'));var rp=require(_0xea87('0x5'));var fs=require('fs');var path=require(_0xea87('0x6'));var rimraf=require('rimraf');var config=require(_0xea87('0x7'));var attributes=require(_0xea87('0x8'));module[_0xea87('0x9')]=function(_0x33f15b,_0x5ea863){return _0x33f15b[_0xea87('0xa')](_0xea87('0xb'),attributes,{'tableName':_0xea87('0xc'),'paranoid':![],'indexes':[{'name':_0xea87('0xd'),'fields':[_0xea87('0xe'),_0xea87('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82a2=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3daf63,_0x25528a){var _0x558174=function(_0x40756c){while(--_0x40756c){_0x3daf63['push'](_0x3daf63['shift']());}};_0x558174(++_0x25528a);}(_0x82a2,0x1e8));var _0x282a=function(_0x431214,_0x1d6113){_0x431214=_0x431214-0x0;var _0x56ff3d=_0x82a2[_0x431214];return _0x56ff3d;};'use strict';var _=require(_0x282a('0x0'));var util=require(_0x282a('0x1'));var logger=require(_0x282a('0x2'))(_0x282a('0x3'));var moment=require(_0x282a('0x4'));var BPromise=require(_0x282a('0x5'));var rp=require(_0x282a('0x6'));var fs=require('fs');var path=require(_0x282a('0x7'));var rimraf=require(_0x282a('0x8'));var config=require(_0x282a('0x9'));var attributes=require(_0x282a('0xa'));module[_0x282a('0xb')]=function(_0xa10380,_0x3b85dc){return _0xa10380[_0x282a('0xc')](_0x282a('0xd'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x282a('0xe'),'fields':[_0x282a('0xf'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ea7bad0..f0fbea3 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 _0x4ce6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','map','model','include','catch','CreateMemberReport','create','raw','UpdateMemberReport','update','debug','lodash','moment'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x4ce6,0x108));var _0x64ce=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x4ce6[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0x64ce('0x0'));var util=require('util');var moment=require(_0x64ce('0x1'));var BPromise=require(_0x64ce('0x2'));var rs=require(_0x64ce('0x3'));var fs=require('fs');var Redis=require(_0x64ce('0x4'));var db=require(_0x64ce('0x5'))['db'];var utils=require(_0x64ce('0x6'));var logger=require('../../config/logger')(_0x64ce('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x64ce('0x8')][_0x64ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b8f2d,_0x538b74,_0x3c279f){return new BPromise(function(_0x134230,_0x1b253e){return client[_0x64ce('0xa')](_0x5b8f2d,_0x3c279f)[_0x64ce('0xb')](function(_0x135482){logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));logger['debug'](_0x64ce('0xf'),_0x538b74,_0x64ce('0xe'),JSON[_0x64ce('0x10')](_0x135482));if(_0x135482[_0x64ce('0x11')]){if(_0x135482[_0x64ce('0x11')][_0x64ce('0x12')]===0x1f4){logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x538b74,_0x135482['error'][_0x64ce('0x13')]);return _0x1b253e(_0x135482['error']['message']);}logger[_0x64ce('0x11')]('MemberReport,\x20%s,\x20%s',_0x538b74,_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);return _0x134230(_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);}else{logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));_0x134230(_0x135482[_0x64ce('0x14')][_0x64ce('0x13')]);}})['catch'](function(_0x4b49be){logger['error'](_0x64ce('0xd'),_0x538b74,_0x4b49be);_0x1b253e(_0x4b49be);});});}exports[_0x64ce('0x15')]=function(_0x1f6fd4){var _0x9cb092=this;return new Promise(function(_0x38d441,_0x3742c0){return db[_0x64ce('0x16')][_0x64ce('0x17')]({'raw':_0x1f6fd4[_0x64ce('0x18')]?_0x1f6fd4[_0x64ce('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6fd4['options']?_0x1f6fd4[_0x64ce('0x18')][_0x64ce('0x19')]||null:null,'attributes':_0x1f6fd4['options']?_0x1f6fd4[_0x64ce('0x18')][_0x64ce('0x1a')]||null:null,'limit':_0x1f6fd4[_0x64ce('0x18')]?_0x1f6fd4[_0x64ce('0x18')][_0x64ce('0x1b')]||null:null,'include':_0x1f6fd4[_0x64ce('0x18')]?_0x1f6fd4[_0x64ce('0x18')]['include']?_[_0x64ce('0x1c')](_0x1f6fd4[_0x64ce('0x18')]['include'],function(_0x1aec1f){return{'model':db[_0x1aec1f[_0x64ce('0x1d')]],'as':_0x1aec1f['as'],'attributes':_0x1aec1f['attributes'],'include':_0x1aec1f[_0x64ce('0x1e')]?_[_0x64ce('0x1c')](_0x1aec1f[_0x64ce('0x1e')],function(_0x33feb3){return{'model':db[_0x33feb3[_0x64ce('0x1d')]],'as':_0x33feb3['as'],'attributes':_0x33feb3[_0x64ce('0x1a')],'include':_0x33feb3['include']?_[_0x64ce('0x1c')](_0x33feb3[_0x64ce('0x1e')],function(_0x5415de){return{'model':db[_0x5415de[_0x64ce('0x1d')]],'as':_0x5415de['as'],'attributes':_0x5415de[_0x64ce('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34957c){logger[_0x64ce('0xc')](_0x64ce('0x15'),_0x1f6fd4);logger['debug'](_0x64ce('0x15'),_0x1f6fd4,JSON[_0x64ce('0x10')](_0x34957c));_0x38d441(_0x34957c);})[_0x64ce('0x1f')](function(_0x3e7a52){logger[_0x64ce('0x11')](_0x64ce('0x15'),_0x3e7a52[_0x64ce('0x13')],_0x1f6fd4);_0x3742c0(_0x9cb092[_0x64ce('0x11')](0x1f4,_0x3e7a52[_0x64ce('0x13')]));});});};exports[_0x64ce('0x20')]=function(_0x30d688){var _0xba6e8b=this;return new Promise(function(_0x531378,_0x14c100){return db['MemberReport'][_0x64ce('0x21')](_0x30d688['body'],{'raw':_0x30d688[_0x64ce('0x18')]?_0x30d688['options'][_0x64ce('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x563407){logger['info'](_0x64ce('0x20'),_0x30d688);logger['debug']('CreateMemberReport',_0x30d688,JSON[_0x64ce('0x10')](_0x563407));_0x531378(_0x563407);})[_0x64ce('0x1f')](function(_0x1e8ea8){logger[_0x64ce('0x11')](_0x64ce('0x20'),_0x1e8ea8['message'],_0x30d688);_0x14c100(_0xba6e8b[_0x64ce('0x11')](0x1f4,_0x1e8ea8[_0x64ce('0x13')]));});});};exports[_0x64ce('0x23')]=function(_0x3a0448){var _0x3a2389=this;return new Promise(function(_0x505db6,_0x3b9d90){return db[_0x64ce('0x16')][_0x64ce('0x24')](_0x3a0448['body'],{'raw':_0x3a0448[_0x64ce('0x18')]?_0x3a0448[_0x64ce('0x18')][_0x64ce('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0448[_0x64ce('0x18')]?_0x3a0448[_0x64ce('0x18')][_0x64ce('0x19')]||null:null,'attributes':_0x3a0448[_0x64ce('0x18')]?_0x3a0448[_0x64ce('0x18')]['attributes']||null:null,'limit':_0x3a0448[_0x64ce('0x18')]?_0x3a0448['options']['limit']||null:null})[_0x64ce('0xb')](function(_0x4e8d70){logger[_0x64ce('0xc')](_0x64ce('0x23'),_0x3a0448);logger[_0x64ce('0x25')]('UpdateMemberReport',_0x3a0448,JSON[_0x64ce('0x10')](_0x4e8d70));_0x505db6(_0x4e8d70);})[_0x64ce('0x1f')](function(_0x5dd007){logger[_0x64ce('0x11')]('UpdateMemberReport',_0x5dd007[_0x64ce('0x13')],_0x3a0448);_0x3b9d90(_0x3a2389[_0x64ce('0x11')](0x1f4,_0x5dd007[_0x64ce('0x13')]));});});}; \ No newline at end of file +var _0x0c23=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model','then','CreateMemberReport','MemberReport','create','body','update','UpdateMemberReport','lodash','util'];(function(_0x34db75,_0x4d44a2){var _0x1d15b6=function(_0x5dee19){while(--_0x5dee19){_0x34db75['push'](_0x34db75['shift']());}};_0x1d15b6(++_0x4d44a2);}(_0x0c23,0x13e));var _0x30c2=function(_0x7e66de,_0xcd1f41){_0x7e66de=_0x7e66de-0x0;var _0x3fb642=_0x0c23[_0x7e66de];return _0x3fb642;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var moment=require(_0x30c2('0x2'));var BPromise=require(_0x30c2('0x3'));var rs=require(_0x30c2('0x4'));var fs=require('fs');var Redis=require(_0x30c2('0x5'));var db=require(_0x30c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x30c2('0x7'))(_0x30c2('0x8'));var config=require(_0x30c2('0x9'));var jayson=require(_0x30c2('0xa'));var client=jayson[_0x30c2('0xb')][_0x30c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f1eba,_0x406fd0,_0x41b74d){return new BPromise(function(_0x202dfe,_0xdc044c){return client[_0x30c2('0xd')](_0x4f1eba,_0x41b74d)['then'](function(_0x410fc0){logger[_0x30c2('0xe')]('MemberReport,\x20%s,\x20%s',_0x406fd0,_0x30c2('0xf'));logger[_0x30c2('0x10')](_0x30c2('0x11'),_0x406fd0,_0x30c2('0xf'),JSON[_0x30c2('0x12')](_0x410fc0));if(_0x410fc0[_0x30c2('0x13')]){if(_0x410fc0['error']['code']===0x1f4){logger['error'](_0x30c2('0x14'),_0x406fd0,_0x410fc0[_0x30c2('0x13')][_0x30c2('0x15')]);return _0xdc044c(_0x410fc0[_0x30c2('0x13')][_0x30c2('0x15')]);}logger[_0x30c2('0x13')](_0x30c2('0x14'),_0x406fd0,_0x410fc0['error'][_0x30c2('0x15')]);return _0x202dfe(_0x410fc0[_0x30c2('0x13')]['message']);}else{logger[_0x30c2('0xe')](_0x30c2('0x14'),_0x406fd0,_0x30c2('0xf'));_0x202dfe(_0x410fc0[_0x30c2('0x16')][_0x30c2('0x15')]);}})[_0x30c2('0x17')](function(_0x170f58){logger[_0x30c2('0x13')](_0x30c2('0x14'),_0x406fd0,_0x170f58);_0xdc044c(_0x170f58);});});}exports[_0x30c2('0x18')]=function(_0x108900){var _0x3003df=this;return new Promise(function(_0x549e8c,_0x3ad366){return db['MemberReport']['findAll']({'raw':_0x108900[_0x30c2('0x19')]?_0x108900[_0x30c2('0x19')][_0x30c2('0x1a')]===undefined?!![]:![]:!![],'where':_0x108900['options']?_0x108900[_0x30c2('0x19')][_0x30c2('0x1b')]||null:null,'attributes':_0x108900[_0x30c2('0x19')]?_0x108900[_0x30c2('0x19')][_0x30c2('0x1c')]||null:null,'limit':_0x108900[_0x30c2('0x19')]?_0x108900[_0x30c2('0x19')][_0x30c2('0x1d')]||null:null,'include':_0x108900['options']?_0x108900['options'][_0x30c2('0x1e')]?_[_0x30c2('0x1f')](_0x108900[_0x30c2('0x19')][_0x30c2('0x1e')],function(_0x428ce8){return{'model':db[_0x428ce8['model']],'as':_0x428ce8['as'],'attributes':_0x428ce8[_0x30c2('0x1c')],'include':_0x428ce8[_0x30c2('0x1e')]?_[_0x30c2('0x1f')](_0x428ce8['include'],function(_0x3dca66){return{'model':db[_0x3dca66[_0x30c2('0x20')]],'as':_0x3dca66['as'],'attributes':_0x3dca66[_0x30c2('0x1c')],'include':_0x3dca66['include']?_[_0x30c2('0x1f')](_0x3dca66[_0x30c2('0x1e')],function(_0x104c6d){return{'model':db[_0x104c6d['model']],'as':_0x104c6d['as'],'attributes':_0x104c6d[_0x30c2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x30c2('0x21')](function(_0x1ae067){logger[_0x30c2('0xe')]('GetMemberReport',_0x108900);logger['debug'](_0x30c2('0x18'),_0x108900,JSON['stringify'](_0x1ae067));_0x549e8c(_0x1ae067);})[_0x30c2('0x17')](function(_0xf3e0d2){logger[_0x30c2('0x13')]('GetMemberReport',_0xf3e0d2[_0x30c2('0x15')],_0x108900);_0x3ad366(_0x3003df[_0x30c2('0x13')](0x1f4,_0xf3e0d2['message']));});});};exports[_0x30c2('0x22')]=function(_0xd4eace){var _0x1434f7=this;return new Promise(function(_0x345872,_0x2c268d){return db[_0x30c2('0x23')][_0x30c2('0x24')](_0xd4eace[_0x30c2('0x25')],{'raw':_0xd4eace[_0x30c2('0x19')]?_0xd4eace[_0x30c2('0x19')][_0x30c2('0x1a')]===undefined?!![]:![]:!![]})[_0x30c2('0x21')](function(_0xebf5d8){logger[_0x30c2('0xe')](_0x30c2('0x22'),_0xd4eace);logger[_0x30c2('0x10')](_0x30c2('0x22'),_0xd4eace,JSON['stringify'](_0xebf5d8));_0x345872(_0xebf5d8);})['catch'](function(_0xe64bbd){logger['error']('CreateMemberReport',_0xe64bbd[_0x30c2('0x15')],_0xd4eace);_0x2c268d(_0x1434f7[_0x30c2('0x13')](0x1f4,_0xe64bbd['message']));});});};exports['UpdateMemberReport']=function(_0x32c36c){var _0xe1a5a=this;return new Promise(function(_0x11d265,_0x18bbf7){return db[_0x30c2('0x23')][_0x30c2('0x26')](_0x32c36c[_0x30c2('0x25')],{'raw':_0x32c36c['options']?_0x32c36c[_0x30c2('0x19')][_0x30c2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c36c[_0x30c2('0x19')]?_0x32c36c['options']['where']||null:null,'attributes':_0x32c36c[_0x30c2('0x19')]?_0x32c36c[_0x30c2('0x19')][_0x30c2('0x1c')]||null:null,'limit':_0x32c36c[_0x30c2('0x19')]?_0x32c36c[_0x30c2('0x19')][_0x30c2('0x1d')]||null:null})[_0x30c2('0x21')](function(_0x37e6c1){logger[_0x30c2('0xe')](_0x30c2('0x27'),_0x32c36c);logger['debug'](_0x30c2('0x27'),_0x32c36c,JSON[_0x30c2('0x12')](_0x37e6c1));_0x11d265(_0x37e6c1);})[_0x30c2('0x17')](function(_0x4d7325){logger[_0x30c2('0x13')](_0x30c2('0x27'),_0x4d7325[_0x30c2('0x15')],_0x32c36c);_0x18bbf7(_0xe1a5a[_0x30c2('0x13')](0x1f4,_0x4d7325[_0x30c2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 41bc0d6..604c3dd 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 _0x84e7=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x1b7127,_0x1b68dd){var _0x46c025=function(_0x14bc61){while(--_0x14bc61){_0x1b7127['push'](_0x1b7127['shift']());}};_0x46c025(++_0x1b68dd);}(_0x84e7,0x122));var _0x784e=function(_0x5baab1,_0x12dd2f){_0x5baab1=_0x5baab1-0x0;var _0x362b0e=_0x84e7[_0x5baab1];return _0x362b0e;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',controller[_0x784e('0x9')]);module['exports']=router; \ No newline at end of file +var _0x5d77=['connect-timeout','../../components/interaction/service','../../config/environment','get','index','exports','multer','util'];(function(_0x3b78dd,_0x1f6c4a){var _0x27f0ac=function(_0x304e7a){while(--_0x304e7a){_0x3b78dd['push'](_0x3b78dd['shift']());}};_0x27f0ac(++_0x1f6c4a);}(_0x5d77,0xee));var _0x75d7=function(_0x3ba96e,_0x5abf6e){_0x3ba96e=_0x3ba96e-0x0;var _0x49020f=_0x5d77[_0x3ba96e];return _0x49020f;};'use strict';var multer=require(_0x75d7('0x0'));var util=require(_0x75d7('0x1'));var path=require('path');var timeout=require(_0x75d7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x75d7('0x3'));var config=require(_0x75d7('0x4'));var controller=require('./migration.controller');router[_0x75d7('0x5')]('/',controller[_0x75d7('0x6')]);module[_0x75d7('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 03ce7c3..6a8b781 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 _0xaa22=['exports','version','sequelize'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xaa22,0x12b));var _0x2aa2=function(_0x27a350,_0x3c5874){_0x27a350=_0x27a350-0x0;var _0x4a459b=_0xaa22[_0x27a350];return _0x4a459b;};'use strict';var Sequelize=require(_0x2aa2('0x0'));module[_0x2aa2('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x2aa2('0x2')}}; \ No newline at end of file +var _0x1778=['sequelize','exports','STRING'];(function(_0x558d70,_0x4681bb){var _0xbe7782=function(_0x547379){while(--_0x547379){_0x558d70['push'](_0x558d70['shift']());}};_0xbe7782(++_0x4681bb);}(_0x1778,0x123));var _0x8177=function(_0x29ccf3,_0x416e46){_0x29ccf3=_0x29ccf3-0x0;var _0x1898b7=_0x1778[_0x29ccf3];return _0x1898b7;};'use strict';var Sequelize=require(_0x8177('0x0'));module[_0x8177('0x1')]={'version':{'type':Sequelize[_0x8177('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6ed1495..c78d1fb 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 _0x50c1=['sort','where','merge','filter','includeAll','include','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x2cbccb,_0x27cbda){var _0x3c358a=function(_0x105c75){while(--_0x105c75){_0x2cbccb['push'](_0x2cbccb['shift']());}};_0x3c358a(++_0x27cbda);}(_0x50c1,0x162));var _0x150c=function(_0x229aa0,_0x5989ed){_0x229aa0=_0x229aa0-0x0;var _0x56b2c7=_0x50c1[_0x229aa0];return _0x56b2c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x150c('0x0'));var zipdir=require(_0x150c('0x1'));var jsonpatch=require(_0x150c('0x2'));var rp=require(_0x150c('0x3'));var moment=require(_0x150c('0x4'));var BPromise=require(_0x150c('0x5'));var Mustache=require(_0x150c('0x6'));var util=require(_0x150c('0x7'));var path=require(_0x150c('0x8'));var sox=require(_0x150c('0x9'));var csv=require(_0x150c('0xa'));var ejs=require(_0x150c('0xb'));var fs=require('fs');var fs_extra=require(_0x150c('0xc'));var _=require(_0x150c('0xd'));var squel=require(_0x150c('0xe'));var crypto=require(_0x150c('0xf'));var jsforce=require(_0x150c('0x10'));var deskjs=require(_0x150c('0x11'));var toCsv=require(_0x150c('0xa'));var querystring=require('querystring');var Papa=require(_0x150c('0x12'));var Redis=require(_0x150c('0x13'));var authService=require(_0x150c('0x14'));var qs=require(_0x150c('0x15'));var as=require(_0x150c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x150c('0x17'))('api');var utils=require(_0x150c('0x18'));var config=require(_0x150c('0x19'));var licenseUtil=require(_0x150c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1acc6b,_0x4127ac){_0x4127ac=_0x4127ac||0xcc;return function(_0x248524){if(_0x248524){return _0x1acc6b[_0x150c('0x1b')](_0x4127ac);}return _0x1acc6b[_0x150c('0x1c')](_0x4127ac)['end']();};}function respondWithResult(_0x29e3e6,_0x126e16){_0x126e16=_0x126e16||0xc8;return function(_0x33f4cf){if(_0x33f4cf){return _0x29e3e6[_0x150c('0x1c')](_0x126e16)[_0x150c('0x1d')](_0x33f4cf);}};}function respondWithFilteredResult(_0x21f8e9,_0x2ba711){return function(_0x4ad723){if(_0x4ad723){var _0x48b731=typeof _0x2ba711[_0x150c('0x1e')]==='undefined'&&typeof _0x2ba711[_0x150c('0x1f')]===_0x150c('0x20');var _0x23247b=_0x4ad723['count'];var _0x31bfeb=_0x48b731?0x0:_0x2ba711[_0x150c('0x1e')];var _0x1a4fde=_0x48b731?_0x4ad723[_0x150c('0x21')]:_0x2ba711[_0x150c('0x1e')]+_0x2ba711[_0x150c('0x1f')];var _0x1ddc14;if(_0x1a4fde>=_0x23247b){_0x1a4fde=_0x23247b;_0x1ddc14=0xc8;}else{_0x1ddc14=0xce;}_0x21f8e9['status'](_0x1ddc14);return _0x21f8e9[_0x150c('0x22')](_0x150c('0x23'),_0x31bfeb+'-'+_0x1a4fde+'/'+_0x23247b)['json'](_0x4ad723);}return null;};}function patchUpdates(_0x202514){return function(_0x364604){try{jsonpatch[_0x150c('0x24')](_0x364604,_0x202514,!![]);}catch(_0x56e716){return BPromise[_0x150c('0x25')](_0x56e716);}return _0x364604[_0x150c('0x26')]();};}function saveUpdates(_0x566189,_0x37cba4){return function(_0x3167a9){if(_0x3167a9){return _0x3167a9[_0x150c('0x27')](_0x566189)[_0x150c('0x28')](function(_0xf29c53){return _0xf29c53;});}return null;};}function removeEntity(_0x5b45f1,_0x487010){return function(_0x384e18){if(_0x384e18){return _0x384e18[_0x150c('0x29')]()[_0x150c('0x28')](function(){_0x5b45f1[_0x150c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223848,_0xd1558c){return function(_0x308dc1){if(!_0x308dc1){_0x223848['sendStatus'](0x194);}return _0x308dc1;};}function handleError(_0x2ac8f9,_0x557345){_0x557345=_0x557345||0x1f4;return function(_0x3603a8){logger[_0x150c('0x2a')](_0x3603a8[_0x150c('0x2b')]);if(_0x3603a8['name']){delete _0x3603a8[_0x150c('0x2c')];}_0x2ac8f9[_0x150c('0x1c')](_0x557345)[_0x150c('0x2d')](_0x3603a8);};}exports[_0x150c('0x2e')]=function(_0x2f217,_0x37e326){var _0x2ad70c={},_0x4eb06b={},_0x3cfcec={'count':0x0,'rows':[]};var _0x436653=_[_0x150c('0x2f')](db[_0x150c('0x30')][_0x150c('0x31')],function(_0x55a827){return{'name':_0x55a827['fieldName'],'type':_0x55a827[_0x150c('0x32')][_0x150c('0x33')]};});_0x4eb06b[_0x150c('0x34')]=_['map'](_0x436653,_0x150c('0x2c'));_0x4eb06b[_0x150c('0x35')]=_[_0x150c('0x36')](_0x2f217[_0x150c('0x35')]);_0x4eb06b[_0x150c('0x37')]=_[_0x150c('0x38')](_0x4eb06b[_0x150c('0x34')],_0x4eb06b[_0x150c('0x35')]);_0x2ad70c[_0x150c('0x39')]=_[_0x150c('0x38')](_0x4eb06b[_0x150c('0x34')],qs['fields'](_0x2f217[_0x150c('0x35')]['fields']));_0x2ad70c[_0x150c('0x39')]=_0x2ad70c[_0x150c('0x39')][_0x150c('0x3a')]?_0x2ad70c[_0x150c('0x39')]:_0x4eb06b[_0x150c('0x34')];if(!_0x2f217['query'][_0x150c('0x3b')]('nolimit')){_0x2ad70c['limit']=qs[_0x150c('0x1f')](_0x2f217[_0x150c('0x35')][_0x150c('0x1f')]);_0x2ad70c[_0x150c('0x1e')]=qs[_0x150c('0x1e')](_0x2f217[_0x150c('0x35')][_0x150c('0x1e')]);}_0x2ad70c['order']=qs[_0x150c('0x3c')](_0x2f217['query']['sort']);_0x2ad70c[_0x150c('0x3d')]=qs[_0x150c('0x37')](_['pick'](_0x2f217[_0x150c('0x35')],_0x4eb06b['filters']),_0x436653);if(_0x2f217[_0x150c('0x35')]['filter']){_0x2ad70c[_0x150c('0x3d')]=_[_0x150c('0x3e')](_0x2ad70c[_0x150c('0x3d')],{'$or':_[_0x150c('0x2f')](_0x436653,function(_0x3c04ba){if(_0x3c04ba[_0x150c('0x32')]!=='VIRTUAL'){var _0x33413b={};_0x33413b[_0x3c04ba['name']]={'$like':'%'+_0x2f217[_0x150c('0x35')][_0x150c('0x3f')]+'%'};return _0x33413b;}})});}_0x2ad70c=_[_0x150c('0x3e')]({},_0x2ad70c,_0x2f217['options']);var _0xc73142={'where':_0x2ad70c[_0x150c('0x3d')]};return db[_0x150c('0x30')]['count'](_0xc73142)[_0x150c('0x28')](function(_0x501909){_0x3cfcec[_0x150c('0x21')]=_0x501909;if(_0x2f217[_0x150c('0x35')][_0x150c('0x40')]){_0x2ad70c[_0x150c('0x41')]=[{'all':!![]}];}return db[_0x150c('0x30')][_0x150c('0x42')](_0x2ad70c);})[_0x150c('0x28')](function(_0xf45677){_0x3cfcec[_0x150c('0x43')]=_0xf45677;return _0x3cfcec;})[_0x150c('0x28')](respondWithFilteredResult(_0x37e326,_0x2ad70c))[_0x150c('0x44')](handleError(_0x37e326,null));}; \ No newline at end of file +var _0xc8e6=['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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','Migration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc8e6,0x1bf));var _0x6c8e=function(_0x43316e,_0x318677){_0x43316e=_0x43316e-0x0;var _0x5b2881=_0xc8e6[_0x43316e];return _0x5b2881;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c8e('0x0'));var zipdir=require(_0x6c8e('0x1'));var jsonpatch=require(_0x6c8e('0x2'));var rp=require(_0x6c8e('0x3'));var moment=require('moment');var BPromise=require(_0x6c8e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c8e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c8e('0x6'));var fs=require('fs');var fs_extra=require(_0x6c8e('0x7'));var _=require(_0x6c8e('0x8'));var squel=require(_0x6c8e('0x9'));var crypto=require(_0x6c8e('0xa'));var jsforce=require(_0x6c8e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c8e('0xc'));var Redis=require(_0x6c8e('0xd'));var authService=require(_0x6c8e('0xe'));var qs=require(_0x6c8e('0xf'));var as=require(_0x6c8e('0x10'));var hardwareService=require(_0x6c8e('0x11'));var logger=require(_0x6c8e('0x12'))(_0x6c8e('0x13'));var utils=require(_0x6c8e('0x14'));var config=require(_0x6c8e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c8e('0x16'))['db'];function respondWithStatusCode(_0x200c9c,_0x45a610){_0x45a610=_0x45a610||0xcc;return function(_0x362569){if(_0x362569){return _0x200c9c[_0x6c8e('0x17')](_0x45a610);}return _0x200c9c[_0x6c8e('0x18')](_0x45a610)[_0x6c8e('0x19')]();};}function respondWithResult(_0x467607,_0x173454){_0x173454=_0x173454||0xc8;return function(_0x8e5355){if(_0x8e5355){return _0x467607['status'](_0x173454)[_0x6c8e('0x1a')](_0x8e5355);}};}function respondWithFilteredResult(_0x21188a,_0x5f5d9b){return function(_0x3f9aab){if(_0x3f9aab){var _0x7d0417=typeof _0x5f5d9b[_0x6c8e('0x1b')]===_0x6c8e('0x1c')&&typeof _0x5f5d9b[_0x6c8e('0x1d')]===_0x6c8e('0x1c');var _0x5dac6d=_0x3f9aab[_0x6c8e('0x1e')];var _0x51dfce=_0x7d0417?0x0:_0x5f5d9b[_0x6c8e('0x1b')];var _0x44dcf9=_0x7d0417?_0x3f9aab['count']:_0x5f5d9b[_0x6c8e('0x1b')]+_0x5f5d9b['limit'];var _0x47a4ec;if(_0x44dcf9>=_0x5dac6d){_0x44dcf9=_0x5dac6d;_0x47a4ec=0xc8;}else{_0x47a4ec=0xce;}_0x21188a[_0x6c8e('0x18')](_0x47a4ec);return _0x21188a[_0x6c8e('0x1f')]('Content-Range',_0x51dfce+'-'+_0x44dcf9+'/'+_0x5dac6d)[_0x6c8e('0x1a')](_0x3f9aab);}return null;};}function patchUpdates(_0x3a8765){return function(_0x377bb0){try{jsonpatch[_0x6c8e('0x20')](_0x377bb0,_0x3a8765,!![]);}catch(_0x238f8a){return BPromise[_0x6c8e('0x21')](_0x238f8a);}return _0x377bb0[_0x6c8e('0x22')]();};}function saveUpdates(_0x1547d7,_0x2bac60){return function(_0x5cc40b){if(_0x5cc40b){return _0x5cc40b['update'](_0x1547d7)[_0x6c8e('0x23')](function(_0x3435ee){return _0x3435ee;});}return null;};}function removeEntity(_0x388599,_0x3cd998){return function(_0x3e0e06){if(_0x3e0e06){return _0x3e0e06['destroy']()[_0x6c8e('0x23')](function(){_0x388599[_0x6c8e('0x18')](0xcc)[_0x6c8e('0x19')]();});}};}function handleEntityNotFound(_0x8eb86b,_0x5c75d1){return function(_0x2ae922){if(!_0x2ae922){_0x8eb86b[_0x6c8e('0x17')](0x194);}return _0x2ae922;};}function handleError(_0x38137b,_0xfb3044){_0xfb3044=_0xfb3044||0x1f4;return function(_0x567f05){logger[_0x6c8e('0x24')](_0x567f05[_0x6c8e('0x25')]);if(_0x567f05[_0x6c8e('0x26')]){delete _0x567f05['name'];}_0x38137b[_0x6c8e('0x18')](_0xfb3044)[_0x6c8e('0x27')](_0x567f05);};}exports[_0x6c8e('0x28')]=function(_0x47f2fe,_0x1343ae){var _0xb95dde={},_0x57cdd9={},_0x44368a={'count':0x0,'rows':[]};var _0x20fa7f=_[_0x6c8e('0x29')](db[_0x6c8e('0x2a')][_0x6c8e('0x2b')],function(_0x40ad82){return{'name':_0x40ad82['fieldName'],'type':_0x40ad82[_0x6c8e('0x2c')]['key']};});_0x57cdd9[_0x6c8e('0x2d')]=_['map'](_0x20fa7f,_0x6c8e('0x26'));_0x57cdd9[_0x6c8e('0x2e')]=_[_0x6c8e('0x2f')](_0x47f2fe[_0x6c8e('0x2e')]);_0x57cdd9[_0x6c8e('0x30')]=_[_0x6c8e('0x31')](_0x57cdd9[_0x6c8e('0x2d')],_0x57cdd9[_0x6c8e('0x2e')]);_0xb95dde[_0x6c8e('0x32')]=_[_0x6c8e('0x31')](_0x57cdd9['model'],qs[_0x6c8e('0x33')](_0x47f2fe['query'][_0x6c8e('0x33')]));_0xb95dde[_0x6c8e('0x32')]=_0xb95dde['attributes'][_0x6c8e('0x34')]?_0xb95dde[_0x6c8e('0x32')]:_0x57cdd9['model'];if(!_0x47f2fe[_0x6c8e('0x2e')][_0x6c8e('0x35')](_0x6c8e('0x36'))){_0xb95dde[_0x6c8e('0x1d')]=qs[_0x6c8e('0x1d')](_0x47f2fe['query'][_0x6c8e('0x1d')]);_0xb95dde[_0x6c8e('0x1b')]=qs[_0x6c8e('0x1b')](_0x47f2fe[_0x6c8e('0x2e')]['offset']);}_0xb95dde[_0x6c8e('0x37')]=qs['sort'](_0x47f2fe[_0x6c8e('0x2e')][_0x6c8e('0x38')]);_0xb95dde[_0x6c8e('0x39')]=qs[_0x6c8e('0x30')](_['pick'](_0x47f2fe['query'],_0x57cdd9[_0x6c8e('0x30')]),_0x20fa7f);if(_0x47f2fe[_0x6c8e('0x2e')][_0x6c8e('0x3a')]){_0xb95dde['where']=_[_0x6c8e('0x3b')](_0xb95dde[_0x6c8e('0x39')],{'$or':_[_0x6c8e('0x29')](_0x20fa7f,function(_0x18b015){if(_0x18b015['type']!==_0x6c8e('0x3c')){var _0x47aff9={};_0x47aff9[_0x18b015['name']]={'$like':'%'+_0x47f2fe[_0x6c8e('0x2e')][_0x6c8e('0x3a')]+'%'};return _0x47aff9;}})});}_0xb95dde=_[_0x6c8e('0x3b')]({},_0xb95dde,_0x47f2fe['options']);var _0x28be7c={'where':_0xb95dde['where']};return db[_0x6c8e('0x2a')][_0x6c8e('0x1e')](_0x28be7c)[_0x6c8e('0x23')](function(_0x3bddbd){_0x44368a[_0x6c8e('0x1e')]=_0x3bddbd;if(_0x47f2fe[_0x6c8e('0x2e')][_0x6c8e('0x3d')]){_0xb95dde[_0x6c8e('0x3e')]=[{'all':!![]}];}return db[_0x6c8e('0x2a')]['findAll'](_0xb95dde);})['then'](function(_0x36e05a){_0x44368a[_0x6c8e('0x3f')]=_0x36e05a;return _0x44368a;})['then'](respondWithFilteredResult(_0x1343ae,_0xb95dde))[_0x6c8e('0x40')](handleError(_0x1343ae,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b742ee3..19d5a3c 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 _0x790e=['request-promise','../../config/environment','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x53438b,_0x441ee9){var _0x1af01a=function(_0x2f87a1){while(--_0x2f87a1){_0x53438b['push'](_0x53438b['shift']());}};_0x1af01a(++_0x441ee9);}(_0x790e,0x1a8));var _0xe790=function(_0x4da30d,_0x54c94b){_0x4da30d=_0x4da30d-0x0;var _0x27f0e6=_0x790e[_0x4da30d];return _0x27f0e6;};'use strict';var _=require(_0xe790('0x0'));var util=require(_0xe790('0x1'));var logger=require(_0xe790('0x2'))(_0xe790('0x3'));var moment=require(_0xe790('0x4'));var BPromise=require('bluebird');var rp=require(_0xe790('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe790('0x6'));var attributes=require('./migration.attributes');module[_0xe790('0x7')]=function(_0xb1aa2c,_0x9bcee5){return _0xb1aa2c[_0xe790('0x8')](_0xe790('0x9'),attributes,{'tableName':_0xe790('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fc4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x6fc4,0xdc));var _0x46fc=function(_0x1a63b6,_0x45b328){_0x1a63b6=_0x1a63b6-0x0;var _0xb75519=_0x6fc4[_0x1a63b6];return _0xb75519;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x46fc('0x0'));var BPromise=require(_0x46fc('0x1'));var rp=require(_0x46fc('0x2'));var fs=require('fs');var path=require(_0x46fc('0x3'));var rimraf=require(_0x46fc('0x4'));var config=require(_0x46fc('0x5'));var attributes=require(_0x46fc('0x6'));module[_0x46fc('0x7')]=function(_0xe03059,_0x4b0826){return _0xe03059[_0x46fc('0x8')](_0x46fc('0x9'),attributes,{'tableName':_0x46fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 910afc6..411e558 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 _0x9bc3=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x50c369,_0x2fa32b){var _0x513d79=function(_0x533830){while(--_0x533830){_0x50c369['push'](_0x50c369['shift']());}};_0x513d79(++_0x2fa32b);}(_0x9bc3,0x137));var _0x39bc=function(_0x2768ab,_0x59be88){_0x2768ab=_0x2768ab-0x0;var _0x2b715f=_0x9bc3[_0x2768ab];return _0x2b715f;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var moment=require(_0x39bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x39bc('0x3'));var fs=require('fs');var Redis=require(_0x39bc('0x4'));var db=require(_0x39bc('0x5'))['db'];var utils=require(_0x39bc('0x6'));var logger=require('../../config/logger')(_0x39bc('0x7'));var config=require(_0x39bc('0x8'));var jayson=require(_0x39bc('0x9'));var client=jayson[_0x39bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d6ce,_0x1367c6,_0x86cff3){return new BPromise(function(_0x10be27,_0x3fa4bd){return client[_0x39bc('0xb')](_0x38d6ce,_0x86cff3)[_0x39bc('0xc')](function(_0x2533c1){logger['info'](_0x39bc('0xd'),_0x1367c6,_0x39bc('0xe'));logger[_0x39bc('0xf')](_0x39bc('0x10'),_0x1367c6,_0x39bc('0xe'),JSON[_0x39bc('0x11')](_0x2533c1));if(_0x2533c1['error']){if(_0x2533c1['error'][_0x39bc('0x12')]===0x1f4){logger[_0x39bc('0x13')]('Migration,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')][_0x39bc('0x14')]);return _0x3fa4bd(_0x2533c1[_0x39bc('0x13')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')]['message']);return _0x10be27(_0x2533c1['error'][_0x39bc('0x14')]);}else{logger[_0x39bc('0x15')]('Migration,\x20%s,\x20%s',_0x1367c6,'request\x20sent');_0x10be27(_0x2533c1[_0x39bc('0x16')][_0x39bc('0x14')]);}})[_0x39bc('0x17')](function(_0x5d6b18){logger[_0x39bc('0x13')](_0x39bc('0xd'),_0x1367c6,_0x5d6b18);_0x3fa4bd(_0x5d6b18);});});} \ No newline at end of file +var _0xc874=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment'];(function(_0x31390e,_0x534624){var _0x4fcf93=function(_0x52c258){while(--_0x52c258){_0x31390e['push'](_0x31390e['shift']());}};_0x4fcf93(++_0x534624);}(_0xc874,0x154));var _0x4c87=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc874[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dafe0,_0x30c939,_0xdc4a29){return new BPromise(function(_0x116649,_0x5b7720){return client[_0x4c87('0x9')](_0x3dafe0,_0xdc4a29)['then'](function(_0x384268){logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,_0x4c87('0xc'));logger[_0x4c87('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x30c939,_0x4c87('0xc'),JSON[_0x4c87('0xe')](_0x384268));if(_0x384268['error']){if(_0x384268[_0x4c87('0xf')][_0x4c87('0x10')]===0x1f4){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')]['message']);return _0x5b7720(_0x384268['error']['message']);}logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);return _0x116649(_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);}else{logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,'request\x20sent');_0x116649(_0x384268[_0x4c87('0x12')][_0x4c87('0x11')]);}})['catch'](function(_0x575de5){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x575de5);_0x5b7720(_0x575de5);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ae8820f..51c686e 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 _0x6cb2=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','put','/:id'];(function(_0x12c7e5,_0x4f82a7){var _0x266fe0=function(_0xe76c9){while(--_0xe76c9){_0x12c7e5['push'](_0x12c7e5['shift']());}};_0x266fe0(++_0x4f82a7);}(_0x6cb2,0xfa));var _0x26cb=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6cb2[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x26cb('0x0'));var util=require(_0x26cb('0x1'));var path=require(_0x26cb('0x2'));var timeout=require(_0x26cb('0x3'));var express=require('express');var router=express[_0x26cb('0x4')]();var fs_extra=require(_0x26cb('0x5'));var auth=require(_0x26cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x26cb('0x7'));var controller=require(_0x26cb('0x8'));router[_0x26cb('0x9')]('/',auth[_0x26cb('0xa')](),controller[_0x26cb('0xb')]);router[_0x26cb('0x9')]('/:id',auth[_0x26cb('0xa')](),controller[_0x26cb('0xc')]);router[_0x26cb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x26cb('0xe')](_0x26cb('0xf'),auth[_0x26cb('0xa')](),controller['update']);router[_0x26cb('0x10')](_0x26cb('0xf'),auth['isAuthenticated'](),controller[_0x26cb('0x11')]);module[_0x26cb('0x12')]=router; \ No newline at end of file +var _0x02b6=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer'];(function(_0x29c927,_0x19cd01){var _0x2b7432=function(_0x393cc9){while(--_0x393cc9){_0x29c927['push'](_0x29c927['shift']());}};_0x2b7432(++_0x19cd01);}(_0x02b6,0xfe));var _0x602b=function(_0xdf1c0c,_0x3a7abd){_0xdf1c0c=_0xdf1c0c-0x0;var _0x5bce12=_0x02b6[_0xdf1c0c];return _0x5bce12;};'use strict';var multer=require(_0x602b('0x0'));var util=require('util');var path=require(_0x602b('0x1'));var timeout=require(_0x602b('0x2'));var express=require(_0x602b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x602b('0x4'));var interaction=require(_0x602b('0x5'));var config=require(_0x602b('0x6'));var controller=require(_0x602b('0x7'));router['get']('/',auth[_0x602b('0x8')](),controller['index']);router[_0x602b('0x9')](_0x602b('0xa'),auth[_0x602b('0x8')](),controller[_0x602b('0xb')]);router[_0x602b('0xc')]('/',auth[_0x602b('0x8')](),controller[_0x602b('0xd')]);router[_0x602b('0xe')](_0x602b('0xa'),auth[_0x602b('0x8')](),controller['update']);router[_0x602b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x602b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 5f12da8..47c2ace 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 _0x17ac=['localnet','externip','STRING','sequelize','exports'];(function(_0x4e4861,_0x5bef58){var _0x1c98bc=function(_0x17f607){while(--_0x17f607){_0x4e4861['push'](_0x4e4861['shift']());}};_0x1c98bc(++_0x5bef58);}(_0x17ac,0x85));var _0xc17a=function(_0x38feee,_0x5609d5){_0x38feee=_0x38feee-0x0;var _0x3e7bc3=_0x17ac[_0x38feee];return _0x3e7bc3;};'use strict';var Sequelize=require(_0xc17a('0x0'));module[_0xc17a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc17a('0x2'),_0xc17a('0x3'),'stun','turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc17a('0x4')]}}; \ No newline at end of file +var _0xdff5=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x166e71,_0x3a1cd4){var _0x2ebc75=function(_0x4889d9){while(--_0x4889d9){_0x166e71['push'](_0x166e71['shift']());}};_0x2ebc75(++_0x3a1cd4);}(_0xdff5,0x126));var _0x5dff=function(_0x2e5913,_0x370927){_0x2e5913=_0x2e5913-0x0;var _0x47bcef=_0xdff5[_0x2e5913];return _0x47bcef;};'use strict';var Sequelize=require(_0x5dff('0x0'));module[_0x5dff('0x1')]={'type':{'type':Sequelize[_0x5dff('0x2')](_0x5dff('0x3'),_0x5dff('0x4'),_0x5dff('0x5'),_0x5dff('0x6'))},'value':{'type':Sequelize[_0x5dff('0x7')]},'username':{'type':Sequelize[_0x5dff('0x7')]},'password':{'type':Sequelize[_0x5dff('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 27a767b..111d776 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 _0x43c8=['stack','name','send','Network','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','create','transaction','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','utf8','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','toUpperCase','find','TURN','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','catch','end','status','json','limit','count','offset','set','Content-Range','save','update','then','destroy','sendStatus'];(function(_0x2dd68d,_0x276bbe){var _0x2ac747=function(_0x1bf1e2){while(--_0x1bf1e2){_0x2dd68d['push'](_0x2dd68d['shift']());}};_0x2ac747(++_0x276bbe);}(_0x43c8,0x1d6));var _0x843c=function(_0x2b3bc0,_0x506686){_0x2b3bc0=_0x2b3bc0-0x0;var _0x3ac12b=_0x43c8[_0x2b3bc0];return _0x3ac12b;};'use strict';var emlformat=require(_0x843c('0x0'));var rimraf=require(_0x843c('0x1'));var zipdir=require(_0x843c('0x2'));var jsonpatch=require(_0x843c('0x3'));var rp=require(_0x843c('0x4'));var moment=require(_0x843c('0x5'));var BPromise=require(_0x843c('0x6'));var Mustache=require(_0x843c('0x7'));var util=require('util');var path=require(_0x843c('0x8'));var sox=require(_0x843c('0x9'));var csv=require(_0x843c('0xa'));var ejs=require(_0x843c('0xb'));var fs=require('fs');var fs_extra=require(_0x843c('0xc'));var _=require('lodash');var squel=require(_0x843c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x843c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x843c('0xf'));var Papa=require(_0x843c('0x10'));var Redis=require(_0x843c('0x11'));var authService=require(_0x843c('0x12'));var qs=require(_0x843c('0x13'));var as=require(_0x843c('0x14'));var hardwareService=require(_0x843c('0x15'));var logger=require(_0x843c('0x16'))('api');var utils=require(_0x843c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x843c('0x18'));var db=require(_0x843c('0x19'))['db'];var jayson=require(_0x843c('0x1a'));var client=jayson[_0x843c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5530ea,_0x5ab39f,_0x112085,_0xe8ccba){return new BPromise(function(_0x260c6c,_0x503e00){var _0x5f400d=_0xe8ccba||client;return _0x5f400d['request'](_0x5530ea,_0x112085)['then'](function(_0x500e36){logger[_0x843c('0x1c')]('Network,\x20%s,\x20%s',_0x5ab39f,_0x843c('0x1d'));logger[_0x843c('0x1e')](_0x843c('0x1f'),_0x5ab39f,_0x843c('0x1d'),JSON['stringify'](_0x500e36));if(_0x500e36['error']){if(_0x500e36[_0x843c('0x20')][_0x843c('0x21')]===0x1f4){logger[_0x843c('0x20')](_0x843c('0x22'),_0x5ab39f,_0x500e36[_0x843c('0x20')][_0x843c('0x23')]);return _0x503e00(_0x500e36['error'][_0x843c('0x23')]);}logger[_0x843c('0x20')](_0x843c('0x22'),_0x5ab39f,_0x500e36['error'][_0x843c('0x23')]);return _0x260c6c(_0x500e36[_0x843c('0x20')][_0x843c('0x23')]);}else{logger['info'](_0x843c('0x22'),_0x5ab39f,_0x843c('0x1d'));_0x260c6c(_0x500e36['result'][_0x843c('0x23')]);}})[_0x843c('0x24')](function(_0x1e8f6e){logger[_0x843c('0x20')](_0x843c('0x22'),_0x5ab39f,_0x1e8f6e);_0x503e00(_0x1e8f6e);});});}function respondWithStatusCode(_0x32b4e5,_0x380045){_0x380045=_0x380045||0xcc;return function(_0x1dbd64){if(_0x1dbd64){return _0x32b4e5['sendStatus'](_0x380045);}return _0x32b4e5['status'](_0x380045)[_0x843c('0x25')]();};}function respondWithResult(_0x3c1f75,_0x33a3d7){_0x33a3d7=_0x33a3d7||0xc8;return function(_0x485571){if(_0x485571){return _0x3c1f75[_0x843c('0x26')](_0x33a3d7)[_0x843c('0x27')](_0x485571);}};}function respondWithFilteredResult(_0x4948d3,_0xf09eca){return function(_0x5f2165){if(_0x5f2165){var _0x257947=typeof _0xf09eca['offset']==='undefined'&&typeof _0xf09eca[_0x843c('0x28')]==='undefined';var _0x1d61ff=_0x5f2165[_0x843c('0x29')];var _0x21aa1e=_0x257947?0x0:_0xf09eca['offset'];var _0x2d44bf=_0x257947?_0x5f2165[_0x843c('0x29')]:_0xf09eca[_0x843c('0x2a')]+_0xf09eca[_0x843c('0x28')];var _0x41da5d;if(_0x2d44bf>=_0x1d61ff){_0x2d44bf=_0x1d61ff;_0x41da5d=0xc8;}else{_0x41da5d=0xce;}_0x4948d3[_0x843c('0x26')](_0x41da5d);return _0x4948d3[_0x843c('0x2b')](_0x843c('0x2c'),_0x21aa1e+'-'+_0x2d44bf+'/'+_0x1d61ff)[_0x843c('0x27')](_0x5f2165);}return null;};}function patchUpdates(_0x4adcc6){return function(_0x2a8ba3){try{jsonpatch['apply'](_0x2a8ba3,_0x4adcc6,!![]);}catch(_0x212f07){return BPromise['reject'](_0x212f07);}return _0x2a8ba3[_0x843c('0x2d')]();};}function saveUpdates(_0x7edc2f,_0x252223){return function(_0x11454){if(_0x11454){return _0x11454[_0x843c('0x2e')](_0x7edc2f)[_0x843c('0x2f')](function(_0x1341a7){return _0x1341a7;});}return null;};}function removeEntity(_0x1236fd,_0x3d577c){return function(_0x385c82){if(_0x385c82){return _0x385c82[_0x843c('0x30')]()[_0x843c('0x2f')](function(){_0x1236fd[_0x843c('0x26')](0xcc)[_0x843c('0x25')]();});}};}function handleEntityNotFound(_0x2c5ac9,_0xf0134a){return function(_0xe911d0){if(!_0xe911d0){_0x2c5ac9[_0x843c('0x31')](0x194);}return _0xe911d0;};}function handleError(_0x5cf9d4,_0x405f69){_0x405f69=_0x405f69||0x1f4;return function(_0x258c91){logger[_0x843c('0x20')](_0x258c91[_0x843c('0x32')]);if(_0x258c91[_0x843c('0x33')]){delete _0x258c91[_0x843c('0x33')];}_0x5cf9d4[_0x843c('0x26')](_0x405f69)[_0x843c('0x34')](_0x258c91);};}exports['index']=function(_0x286196,_0x1241c3){var _0x3c98f6={},_0x28fea0={},_0xe2210={'count':0x0,'rows':[]};var _0x256c24=_['map'](db[_0x843c('0x35')][_0x843c('0x36')],function(_0x53eb36){return{'name':_0x53eb36['fieldName'],'type':_0x53eb36[_0x843c('0x37')][_0x843c('0x38')]};});_0x28fea0[_0x843c('0x39')]=_[_0x843c('0x3a')](_0x256c24,_0x843c('0x33'));_0x28fea0['query']=_[_0x843c('0x3b')](_0x286196['query']);_0x28fea0[_0x843c('0x3c')]=_[_0x843c('0x3d')](_0x28fea0['model'],_0x28fea0[_0x843c('0x3e')]);_0x3c98f6['attributes']=_['intersection'](_0x28fea0[_0x843c('0x39')],qs[_0x843c('0x3f')](_0x286196['query'][_0x843c('0x3f')]));_0x3c98f6[_0x843c('0x40')]=_0x3c98f6[_0x843c('0x40')][_0x843c('0x41')]?_0x3c98f6[_0x843c('0x40')]:_0x28fea0[_0x843c('0x39')];if(!_0x286196[_0x843c('0x3e')][_0x843c('0x42')](_0x843c('0x43'))){_0x3c98f6[_0x843c('0x28')]=qs[_0x843c('0x28')](_0x286196[_0x843c('0x3e')]['limit']);_0x3c98f6['offset']=qs['offset'](_0x286196['query'][_0x843c('0x2a')]);}_0x3c98f6['order']=qs[_0x843c('0x44')](_0x286196['query'][_0x843c('0x44')]);_0x3c98f6[_0x843c('0x45')]=qs[_0x843c('0x3c')](_[_0x843c('0x46')](_0x286196[_0x843c('0x3e')],_0x28fea0['filters']),_0x256c24);if(_0x286196[_0x843c('0x3e')][_0x843c('0x47')]){_0x3c98f6[_0x843c('0x45')]=_[_0x843c('0x48')](_0x3c98f6[_0x843c('0x45')],{'$or':_[_0x843c('0x3a')](_0x256c24,function(_0x34dfed){if(_0x34dfed['type']!=='VIRTUAL'){var _0xd13670={};_0xd13670[_0x34dfed[_0x843c('0x33')]]={'$like':'%'+_0x286196[_0x843c('0x3e')][_0x843c('0x47')]+'%'};return _0xd13670;}})});}_0x3c98f6=_[_0x843c('0x48')]({},_0x3c98f6,_0x286196['options']);var _0x41bd28={'where':_0x3c98f6['where']};return db[_0x843c('0x35')][_0x843c('0x29')](_0x41bd28)['then'](function(_0x5c421c){_0xe2210[_0x843c('0x29')]=_0x5c421c;if(_0x286196['query'][_0x843c('0x49')]){_0x3c98f6[_0x843c('0x4a')]=[{'all':!![]}];}return db[_0x843c('0x35')][_0x843c('0x4b')](_0x3c98f6);})[_0x843c('0x2f')](function(_0x5078f1){_0xe2210[_0x843c('0x4c')]=_0x5078f1;return _0xe2210;})[_0x843c('0x2f')](respondWithFilteredResult(_0x1241c3,_0x3c98f6))['catch'](handleError(_0x1241c3,null));};exports[_0x843c('0x4d')]=function(_0x292ca3,_0xf08e6b){var _0xc44e70={'raw':!![],'where':{'id':_0x292ca3[_0x843c('0x4e')]['id']}},_0x171f80={};_0x171f80['model']=_[_0x843c('0x3b')](db['Network'][_0x843c('0x36')]);_0x171f80[_0x843c('0x3e')]=_[_0x843c('0x3b')](_0x292ca3['query']);_0x171f80[_0x843c('0x3c')]=_[_0x843c('0x3d')](_0x171f80[_0x843c('0x39')],_0x171f80['query']);_0xc44e70[_0x843c('0x40')]=_[_0x843c('0x3d')](_0x171f80[_0x843c('0x39')],qs['fields'](_0x292ca3[_0x843c('0x3e')][_0x843c('0x3f')]));_0xc44e70['attributes']=_0xc44e70[_0x843c('0x40')][_0x843c('0x41')]?_0xc44e70[_0x843c('0x40')]:_0x171f80[_0x843c('0x39')];if(_0x292ca3[_0x843c('0x3e')][_0x843c('0x49')]){_0xc44e70[_0x843c('0x4a')]=[{'all':!![]}];}_0xc44e70=_['merge']({},_0xc44e70,_0x292ca3['options']);return db[_0x843c('0x35')]['find'](_0xc44e70)[_0x843c('0x2f')](handleEntityNotFound(_0xf08e6b,null))[_0x843c('0x2f')](respondWithResult(_0xf08e6b,null))['catch'](handleError(_0xf08e6b,null));};exports[_0x843c('0x4f')]=function(_0x5052c2,_0xa87086,_0x36c309){var _0x3a0943;return db['sequelize'][_0x843c('0x50')](function(_0x103b0c){return db[_0x843c('0x35')][_0x843c('0x4f')](_0x5052c2[_0x843c('0x51')],{'raw':!![]})['then'](function(_0x29b6e6){_0x3a0943=_0x29b6e6;return db[_0x843c('0x35')][_0x843c('0x4b')]({'where':{'type':_0x5052c2[_0x843c('0x51')][_0x843c('0x37')]},'raw':!![]});})['then'](function(_0x11aa89){if(_0x3a0943[_0x843c('0x37')]['toUpperCase']()==_0x843c('0x52')){var _0x33848d=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],_0x843c('0x56')),'utf8');var _0x29a384=ejs[_0x843c('0x57')](_0x33848d,{'networks':_0x11aa89||[]});fs[_0x843c('0x58')](_0x843c('0x59'),_0x29a384);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x4f'),{'module':_0x843c('0x5b')});}else if(_0x3a0943[_0x843c('0x37')]['toUpperCase']()=='TURN'){var _0x1b7799=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],_0x843c('0x5c')),'utf8');var _0x2f478d=ejs[_0x843c('0x57')](_0x1b7799,{'networks':_0x11aa89||[]});fs['writeFileSync'](_0x843c('0x5d'),_0x2f478d);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x4f'),{'module':_0x843c('0x5b')});}else{var _0x1150c4=fs['readFileSync'](path[_0x843c('0x54')](config[_0x843c('0x55')],'server/files/templates/network.ejs'),_0x843c('0x5e'));var _0x1732f2=ejs[_0x843c('0x57')](_0x1150c4,{'networks':_0x11aa89||[]});fs[_0x843c('0x58')](util[_0x843c('0x5f')](_0x843c('0x60'),_0x5052c2[_0x843c('0x51')]['type'][_0x843c('0x61')]()),_0x1732f2);return respondWithRpcPromise('Reload',_0x843c('0x4f'),{'module':_0x843c('0x62')});}return null;})[_0x843c('0x2f')](function(){return _0x3a0943;});})[_0x843c('0x2f')](respondWithResult(_0xa87086,0xc9))['catch'](handleError(_0xa87086,null));};exports[_0x843c('0x2e')]=function(_0x7c5314,_0xec6df6,_0x54e07d){var _0x381d12;return db[_0x843c('0x63')][_0x843c('0x50')](function(_0x257642){return db['Network']['find']({'where':{'id':_0x7c5314['params']['id']}})[_0x843c('0x2f')](handleEntityNotFound(_0xec6df6,null))['then'](saveUpdates(_0x7c5314[_0x843c('0x51')],null))['then'](function(_0x51d6d8){if(_0x51d6d8){_0x381d12=_0x51d6d8;return db['Network'][_0x843c('0x4b')]({'where':{'type':_0x381d12['type']},'raw':!![]});}return null;})[_0x843c('0x2f')](function(_0x29e20c){if(_0x381d12[_0x843c('0x37')][_0x843c('0x64')]()==_0x843c('0x52')){var _0xc44bc5=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],_0x843c('0x56')),_0x843c('0x5e'));var _0x572b69=ejs[_0x843c('0x57')](_0xc44bc5,{'networks':_0x29e20c||[]});fs['writeFileSync'](_0x843c('0x59'),_0x572b69);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x2e'),{'module':_0x843c('0x5b')});}else if(_0x381d12[_0x843c('0x37')][_0x843c('0x64')]()=='TURN'){var _0xea95ab=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],_0x843c('0x5c')),_0x843c('0x5e'));var _0x5dbcc4=ejs['render'](_0xea95ab,{'networks':_0x29e20c||[]});fs[_0x843c('0x58')](_0x843c('0x5d'),_0x5dbcc4);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x2e'),{'module':_0x843c('0x5b')});}else{var _0x1983f6=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],'server/files/templates/network.ejs'),_0x843c('0x5e'));var _0x1520f3=ejs[_0x843c('0x57')](_0x1983f6,{'networks':_0x29e20c||[]});fs['writeFileSync'](util['format'](_0x843c('0x60'),_0x7c5314['body'][_0x843c('0x37')]['toLowerCase']()),_0x1520f3);return respondWithRpcPromise('Reload',_0x843c('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x843c('0x2f')](function(_0x428b13){if(_0x428b13){return _0x381d12;}return null;});})['then'](respondWithResult(_0xec6df6,null))[_0x843c('0x24')](handleError(_0xec6df6,null));};exports['destroy']=function(_0x19e7f3,_0x36ca90,_0x43b314){var _0x262008;return db[_0x843c('0x35')][_0x843c('0x65')]({'where':{'id':_0x19e7f3[_0x843c('0x4e')]['id']}})[_0x843c('0x2f')](function(_0x449ba8){_0x262008=_0x449ba8;return _0x449ba8;})[_0x843c('0x2f')](handleEntityNotFound(_0x36ca90,null))[_0x843c('0x2f')](removeEntity(_0x36ca90,null))[_0x843c('0x2f')](function(){if(_0x262008){return db['Network'][_0x843c('0x4b')]({'where':{'type':_0x262008[_0x843c('0x37')]},'raw':!![]});}})['then'](function(_0x56d9ae){if(_0x262008[_0x843c('0x37')][_0x843c('0x64')]()=='STUN'){var _0x5d747c=fs[_0x843c('0x53')](path[_0x843c('0x54')](config[_0x843c('0x55')],_0x843c('0x56')),_0x843c('0x5e'));var _0x5c811f=ejs[_0x843c('0x57')](_0x5d747c,{'networks':_0x56d9ae||[]});fs[_0x843c('0x58')](_0x843c('0x59'),_0x5c811f);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x262008[_0x843c('0x37')]['toUpperCase']()==_0x843c('0x66')){var _0x203947=fs[_0x843c('0x53')](path[_0x843c('0x54')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x843c('0x5e'));var _0x5a9c1e=ejs['render'](_0x203947,{'networks':_0x56d9ae||[]});fs[_0x843c('0x58')](_0x843c('0x5d'),_0x5a9c1e);return respondWithRpcPromise('Reload','destroy',{'module':_0x843c('0x5b')});}else{var _0x51d49f=fs[_0x843c('0x53')](path['join'](config[_0x843c('0x55')],_0x843c('0x67')),_0x843c('0x5e'));var _0x893f62=ejs[_0x843c('0x57')](_0x51d49f,{'networks':_0x56d9ae||[]});fs[_0x843c('0x58')](util[_0x843c('0x5f')](_0x843c('0x60'),_0x19e7f3[_0x843c('0x51')][_0x843c('0x37')][_0x843c('0x61')]()),_0x893f62);return respondWithRpcPromise(_0x843c('0x5a'),_0x843c('0x30'),{'module':_0x843c('0x62')});}return null;})[_0x843c('0x24')](handleError(_0x36ca90,null));}; \ No newline at end of file +var _0x5b4a=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','rawAttributes','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','root','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','params','/etc/asterisk/turn_xcally.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','undefined','limit','count','offset','save','destroy','stack','name','status','send','map','Network','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields'];(function(_0x5b05de,_0x441400){var _0x1dbd07=function(_0x2ebed2){while(--_0x2ebed2){_0x5b05de['push'](_0x5b05de['shift']());}};_0x1dbd07(++_0x441400);}(_0x5b4a,0x1d1));var _0xa5b4=function(_0x51d144,_0x485455){_0x51d144=_0x51d144-0x0;var _0x154422=_0x5b4a[_0x51d144];return _0x154422;};'use strict';var emlformat=require(_0xa5b4('0x0'));var rimraf=require(_0xa5b4('0x1'));var zipdir=require(_0xa5b4('0x2'));var jsonpatch=require(_0xa5b4('0x3'));var rp=require(_0xa5b4('0x4'));var moment=require(_0xa5b4('0x5'));var BPromise=require(_0xa5b4('0x6'));var Mustache=require(_0xa5b4('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa5b4('0x8'));var csv=require(_0xa5b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5b4('0xa'));var _=require(_0xa5b4('0xb'));var squel=require(_0xa5b4('0xc'));var crypto=require(_0xa5b4('0xd'));var jsforce=require(_0xa5b4('0xe'));var deskjs=require(_0xa5b4('0xf'));var toCsv=require(_0xa5b4('0x9'));var querystring=require(_0xa5b4('0x10'));var Papa=require(_0xa5b4('0x11'));var Redis=require(_0xa5b4('0x12'));var authService=require(_0xa5b4('0x13'));var qs=require(_0xa5b4('0x14'));var as=require(_0xa5b4('0x15'));var hardwareService=require(_0xa5b4('0x16'));var logger=require(_0xa5b4('0x17'))('api');var utils=require(_0xa5b4('0x18'));var config=require(_0xa5b4('0x19'));var licenseUtil=require(_0xa5b4('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa5b4('0x1b'));var client=jayson[_0xa5b4('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x488a5c,_0x1789f7,_0x4fd792,_0x4638ae){return new BPromise(function(_0x1a0dfc,_0x4b5604){var _0x4d05c0=_0x4638ae||client;return _0x4d05c0[_0xa5b4('0x1d')](_0x488a5c,_0x4fd792)[_0xa5b4('0x1e')](function(_0x2a2301){logger[_0xa5b4('0x1f')]('Network,\x20%s,\x20%s',_0x1789f7,_0xa5b4('0x20'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x1789f7,_0xa5b4('0x20'),JSON[_0xa5b4('0x21')](_0x2a2301));if(_0x2a2301[_0xa5b4('0x22')]){if(_0x2a2301['error'][_0xa5b4('0x23')]===0x1f4){logger[_0xa5b4('0x22')](_0xa5b4('0x24'),_0x1789f7,_0x2a2301[_0xa5b4('0x22')]['message']);return _0x4b5604(_0x2a2301[_0xa5b4('0x22')][_0xa5b4('0x25')]);}logger[_0xa5b4('0x22')](_0xa5b4('0x24'),_0x1789f7,_0x2a2301[_0xa5b4('0x22')][_0xa5b4('0x25')]);return _0x1a0dfc(_0x2a2301[_0xa5b4('0x22')]['message']);}else{logger[_0xa5b4('0x1f')](_0xa5b4('0x24'),_0x1789f7,_0xa5b4('0x20'));_0x1a0dfc(_0x2a2301[_0xa5b4('0x26')][_0xa5b4('0x25')]);}})[_0xa5b4('0x27')](function(_0x34d4c4){logger[_0xa5b4('0x22')]('Network,\x20%s,\x20%s',_0x1789f7,_0x34d4c4);_0x4b5604(_0x34d4c4);});});}function respondWithStatusCode(_0x1bcf22,_0x4e72a5){_0x4e72a5=_0x4e72a5||0xcc;return function(_0x48e94a){if(_0x48e94a){return _0x1bcf22[_0xa5b4('0x28')](_0x4e72a5);}return _0x1bcf22['status'](_0x4e72a5)[_0xa5b4('0x29')]();};}function respondWithResult(_0x4fff42,_0x2b9ba9){_0x2b9ba9=_0x2b9ba9||0xc8;return function(_0x1185fb){if(_0x1185fb){return _0x4fff42['status'](_0x2b9ba9)[_0xa5b4('0x2a')](_0x1185fb);}};}function respondWithFilteredResult(_0x350bb4,_0x1d7a9a){return function(_0x352a2f){if(_0x352a2f){var _0x433eb3=typeof _0x1d7a9a['offset']===_0xa5b4('0x2b')&&typeof _0x1d7a9a[_0xa5b4('0x2c')]===_0xa5b4('0x2b');var _0x2556bc=_0x352a2f[_0xa5b4('0x2d')];var _0x263a58=_0x433eb3?0x0:_0x1d7a9a[_0xa5b4('0x2e')];var _0xc5fb88=_0x433eb3?_0x352a2f[_0xa5b4('0x2d')]:_0x1d7a9a[_0xa5b4('0x2e')]+_0x1d7a9a[_0xa5b4('0x2c')];var _0x30e1b6;if(_0xc5fb88>=_0x2556bc){_0xc5fb88=_0x2556bc;_0x30e1b6=0xc8;}else{_0x30e1b6=0xce;}_0x350bb4['status'](_0x30e1b6);return _0x350bb4['set']('Content-Range',_0x263a58+'-'+_0xc5fb88+'/'+_0x2556bc)[_0xa5b4('0x2a')](_0x352a2f);}return null;};}function patchUpdates(_0x245af3){return function(_0x6be733){try{jsonpatch['apply'](_0x6be733,_0x245af3,!![]);}catch(_0x1bd438){return BPromise['reject'](_0x1bd438);}return _0x6be733[_0xa5b4('0x2f')]();};}function saveUpdates(_0x51580c,_0x338d36){return function(_0x171058){if(_0x171058){return _0x171058['update'](_0x51580c)[_0xa5b4('0x1e')](function(_0x5dd2a0){return _0x5dd2a0;});}return null;};}function removeEntity(_0x2e1dc9,_0x5b40fe){return function(_0x30e7bb){if(_0x30e7bb){return _0x30e7bb[_0xa5b4('0x30')]()[_0xa5b4('0x1e')](function(){_0x2e1dc9['status'](0xcc)[_0xa5b4('0x29')]();});}};}function handleEntityNotFound(_0x19f283,_0x5022b2){return function(_0x435ac6){if(!_0x435ac6){_0x19f283['sendStatus'](0x194);}return _0x435ac6;};}function handleError(_0x42f3b3,_0x549f9f){_0x549f9f=_0x549f9f||0x1f4;return function(_0x402de4){logger[_0xa5b4('0x22')](_0x402de4[_0xa5b4('0x31')]);if(_0x402de4[_0xa5b4('0x32')]){delete _0x402de4[_0xa5b4('0x32')];}_0x42f3b3[_0xa5b4('0x33')](_0x549f9f)[_0xa5b4('0x34')](_0x402de4);};}exports['index']=function(_0x302ef0,_0x62c817){var _0x5beaab={},_0x20f9e6={},_0x5ab617={'count':0x0,'rows':[]};var _0x475e04=_[_0xa5b4('0x35')](db[_0xa5b4('0x36')]['rawAttributes'],function(_0x58fd23){return{'name':_0x58fd23[_0xa5b4('0x37')],'type':_0x58fd23[_0xa5b4('0x38')][_0xa5b4('0x39')]};});_0x20f9e6['model']=_['map'](_0x475e04,_0xa5b4('0x32'));_0x20f9e6[_0xa5b4('0x3a')]=_[_0xa5b4('0x3b')](_0x302ef0[_0xa5b4('0x3a')]);_0x20f9e6[_0xa5b4('0x3c')]=_[_0xa5b4('0x3d')](_0x20f9e6['model'],_0x20f9e6[_0xa5b4('0x3a')]);_0x5beaab[_0xa5b4('0x3e')]=_[_0xa5b4('0x3d')](_0x20f9e6[_0xa5b4('0x3f')],qs[_0xa5b4('0x40')](_0x302ef0[_0xa5b4('0x3a')][_0xa5b4('0x40')]));_0x5beaab[_0xa5b4('0x3e')]=_0x5beaab['attributes'][_0xa5b4('0x41')]?_0x5beaab[_0xa5b4('0x3e')]:_0x20f9e6['model'];if(!_0x302ef0[_0xa5b4('0x3a')][_0xa5b4('0x42')](_0xa5b4('0x43'))){_0x5beaab[_0xa5b4('0x2c')]=qs['limit'](_0x302ef0[_0xa5b4('0x3a')][_0xa5b4('0x2c')]);_0x5beaab[_0xa5b4('0x2e')]=qs[_0xa5b4('0x2e')](_0x302ef0[_0xa5b4('0x3a')][_0xa5b4('0x2e')]);}_0x5beaab[_0xa5b4('0x44')]=qs[_0xa5b4('0x45')](_0x302ef0[_0xa5b4('0x3a')]['sort']);_0x5beaab[_0xa5b4('0x46')]=qs[_0xa5b4('0x3c')](_[_0xa5b4('0x47')](_0x302ef0[_0xa5b4('0x3a')],_0x20f9e6['filters']),_0x475e04);if(_0x302ef0[_0xa5b4('0x3a')]['filter']){_0x5beaab[_0xa5b4('0x46')]=_[_0xa5b4('0x48')](_0x5beaab['where'],{'$or':_[_0xa5b4('0x35')](_0x475e04,function(_0x40b95c){if(_0x40b95c[_0xa5b4('0x38')]!=='VIRTUAL'){var _0x3354eb={};_0x3354eb[_0x40b95c[_0xa5b4('0x32')]]={'$like':'%'+_0x302ef0[_0xa5b4('0x3a')][_0xa5b4('0x49')]+'%'};return _0x3354eb;}})});}_0x5beaab=_[_0xa5b4('0x48')]({},_0x5beaab,_0x302ef0[_0xa5b4('0x4a')]);var _0xf7dfd0={'where':_0x5beaab[_0xa5b4('0x46')]};return db[_0xa5b4('0x36')][_0xa5b4('0x2d')](_0xf7dfd0)[_0xa5b4('0x1e')](function(_0x191dd9){_0x5ab617['count']=_0x191dd9;if(_0x302ef0['query'][_0xa5b4('0x4b')]){_0x5beaab[_0xa5b4('0x4c')]=[{'all':!![]}];}return db['Network'][_0xa5b4('0x4d')](_0x5beaab);})[_0xa5b4('0x1e')](function(_0x3f3089){_0x5ab617['rows']=_0x3f3089;return _0x5ab617;})[_0xa5b4('0x1e')](respondWithFilteredResult(_0x62c817,_0x5beaab))['catch'](handleError(_0x62c817,null));};exports[_0xa5b4('0x4e')]=function(_0x5881d5,_0x16a944){var _0x246113={'raw':!![],'where':{'id':_0x5881d5['params']['id']}},_0x2b702c={};_0x2b702c[_0xa5b4('0x3f')]=_[_0xa5b4('0x3b')](db[_0xa5b4('0x36')][_0xa5b4('0x4f')]);_0x2b702c[_0xa5b4('0x3a')]=_[_0xa5b4('0x3b')](_0x5881d5[_0xa5b4('0x3a')]);_0x2b702c[_0xa5b4('0x3c')]=_[_0xa5b4('0x3d')](_0x2b702c[_0xa5b4('0x3f')],_0x2b702c[_0xa5b4('0x3a')]);_0x246113[_0xa5b4('0x3e')]=_['intersection'](_0x2b702c[_0xa5b4('0x3f')],qs[_0xa5b4('0x40')](_0x5881d5[_0xa5b4('0x3a')][_0xa5b4('0x40')]));_0x246113['attributes']=_0x246113[_0xa5b4('0x3e')][_0xa5b4('0x41')]?_0x246113[_0xa5b4('0x3e')]:_0x2b702c['model'];if(_0x5881d5[_0xa5b4('0x3a')][_0xa5b4('0x4b')]){_0x246113[_0xa5b4('0x4c')]=[{'all':!![]}];}_0x246113=_['merge']({},_0x246113,_0x5881d5[_0xa5b4('0x4a')]);return db[_0xa5b4('0x36')]['find'](_0x246113)['then'](handleEntityNotFound(_0x16a944,null))[_0xa5b4('0x1e')](respondWithResult(_0x16a944,null))[_0xa5b4('0x27')](handleError(_0x16a944,null));};exports[_0xa5b4('0x50')]=function(_0x27f3da,_0xc3f641,_0x84f27b){var _0x5252ec;return db[_0xa5b4('0x51')][_0xa5b4('0x52')](function(_0x15f659){return db[_0xa5b4('0x36')][_0xa5b4('0x50')](_0x27f3da[_0xa5b4('0x53')],{'raw':!![]})[_0xa5b4('0x1e')](function(_0x325b79){_0x5252ec=_0x325b79;return db[_0xa5b4('0x36')][_0xa5b4('0x4d')]({'where':{'type':_0x27f3da[_0xa5b4('0x53')][_0xa5b4('0x38')]},'raw':!![]});})[_0xa5b4('0x1e')](function(_0x59b57a){if(_0x5252ec[_0xa5b4('0x38')][_0xa5b4('0x54')]()==_0xa5b4('0x55')){var _0x3abed2=fs[_0xa5b4('0x56')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xa5b4('0x57'));var _0x197002=ejs['render'](_0x3abed2,{'networks':_0x59b57a||[]});fs[_0xa5b4('0x58')](_0xa5b4('0x59'),_0x197002);return respondWithRpcPromise(_0xa5b4('0x5a'),_0xa5b4('0x50'),{'module':_0xa5b4('0x5b')});}else if(_0x5252ec['type'][_0xa5b4('0x54')]()==_0xa5b4('0x5c')){var _0x1af335=fs[_0xa5b4('0x56')](path[_0xa5b4('0x5d')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xe5e28a=ejs[_0xa5b4('0x5e')](_0x1af335,{'networks':_0x59b57a||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xe5e28a);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else{var _0x327ef8=fs[_0xa5b4('0x56')](path[_0xa5b4('0x5d')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x1f6768=ejs[_0xa5b4('0x5e')](_0x327ef8,{'networks':_0x59b57a||[]});fs[_0xa5b4('0x58')](util[_0xa5b4('0x5f')](_0xa5b4('0x60'),_0x27f3da['body']['type'][_0xa5b4('0x61')]()),_0x1f6768);return respondWithRpcPromise(_0xa5b4('0x5a'),_0xa5b4('0x50'),{'module':'chan_sip.so'});}return null;})[_0xa5b4('0x1e')](function(){return _0x5252ec;});})[_0xa5b4('0x1e')](respondWithResult(_0xc3f641,0xc9))[_0xa5b4('0x27')](handleError(_0xc3f641,null));};exports[_0xa5b4('0x62')]=function(_0x34a353,_0xc0d413,_0x523641){var _0x2f399c;return db[_0xa5b4('0x51')][_0xa5b4('0x52')](function(_0x3f8365){return db[_0xa5b4('0x36')]['find']({'where':{'id':_0x34a353['params']['id']}})[_0xa5b4('0x1e')](handleEntityNotFound(_0xc0d413,null))[_0xa5b4('0x1e')](saveUpdates(_0x34a353[_0xa5b4('0x53')],null))[_0xa5b4('0x1e')](function(_0x5af408){if(_0x5af408){_0x2f399c=_0x5af408;return db[_0xa5b4('0x36')]['findAll']({'where':{'type':_0x2f399c[_0xa5b4('0x38')]},'raw':!![]});}return null;})[_0xa5b4('0x1e')](function(_0x2a7e6e){if(_0x2f399c['type'][_0xa5b4('0x54')]()==_0xa5b4('0x55')){var _0x36c775=fs[_0xa5b4('0x56')](path[_0xa5b4('0x5d')](config[_0xa5b4('0x63')],_0xa5b4('0x64')),_0xa5b4('0x57'));var _0x2fef18=ejs['render'](_0x36c775,{'networks':_0x2a7e6e||[]});fs[_0xa5b4('0x58')](_0xa5b4('0x59'),_0x2fef18);return respondWithRpcPromise('Reload','update',{'module':_0xa5b4('0x5b')});}else if(_0x2f399c[_0xa5b4('0x38')][_0xa5b4('0x54')]()==_0xa5b4('0x5c')){var _0x3b0d0c=fs['readFileSync'](path[_0xa5b4('0x5d')](config['root'],_0xa5b4('0x65')),_0xa5b4('0x57'));var _0x5b9c79=ejs['render'](_0x3b0d0c,{'networks':_0x2a7e6e||[]});fs[_0xa5b4('0x58')]('/etc/asterisk/turn_xcally.conf',_0x5b9c79);return respondWithRpcPromise(_0xa5b4('0x5a'),_0xa5b4('0x62'),{'module':_0xa5b4('0x5b')});}else{var _0x46b50c=fs[_0xa5b4('0x56')](path[_0xa5b4('0x5d')](config[_0xa5b4('0x63')],_0xa5b4('0x66')),_0xa5b4('0x57'));var _0x5f244f=ejs[_0xa5b4('0x5e')](_0x46b50c,{'networks':_0x2a7e6e||[]});fs[_0xa5b4('0x58')](util[_0xa5b4('0x5f')](_0xa5b4('0x60'),_0x34a353[_0xa5b4('0x53')][_0xa5b4('0x38')][_0xa5b4('0x61')]()),_0x5f244f);return respondWithRpcPromise(_0xa5b4('0x5a'),_0xa5b4('0x62'),{'module':_0xa5b4('0x67')});}return null;})[_0xa5b4('0x1e')](function(_0x2ae39e){if(_0x2ae39e){return _0x2f399c;}return null;});})[_0xa5b4('0x1e')](respondWithResult(_0xc0d413,null))[_0xa5b4('0x27')](handleError(_0xc0d413,null));};exports[_0xa5b4('0x30')]=function(_0x34ce67,_0x284463,_0x477a0f){var _0x727006;return db[_0xa5b4('0x36')]['find']({'where':{'id':_0x34ce67[_0xa5b4('0x68')]['id']}})['then'](function(_0x2837fc){_0x727006=_0x2837fc;return _0x2837fc;})[_0xa5b4('0x1e')](handleEntityNotFound(_0x284463,null))[_0xa5b4('0x1e')](removeEntity(_0x284463,null))[_0xa5b4('0x1e')](function(){if(_0x727006){return db[_0xa5b4('0x36')][_0xa5b4('0x4d')]({'where':{'type':_0x727006['type']},'raw':!![]});}})[_0xa5b4('0x1e')](function(_0x299e86){if(_0x727006[_0xa5b4('0x38')][_0xa5b4('0x54')]()==_0xa5b4('0x55')){var _0x2b864d=fs['readFileSync'](path[_0xa5b4('0x5d')](config[_0xa5b4('0x63')],_0xa5b4('0x64')),_0xa5b4('0x57'));var _0x19ced7=ejs[_0xa5b4('0x5e')](_0x2b864d,{'networks':_0x299e86||[]});fs['writeFileSync'](_0xa5b4('0x59'),_0x19ced7);return respondWithRpcPromise(_0xa5b4('0x5a'),'destroy',{'module':_0xa5b4('0x5b')});}else if(_0x727006[_0xa5b4('0x38')][_0xa5b4('0x54')]()==_0xa5b4('0x5c')){var _0x4dd467=fs['readFileSync'](path[_0xa5b4('0x5d')](config[_0xa5b4('0x63')],_0xa5b4('0x65')),_0xa5b4('0x57'));var _0x35851e=ejs[_0xa5b4('0x5e')](_0x4dd467,{'networks':_0x299e86||[]});fs[_0xa5b4('0x58')](_0xa5b4('0x69'),_0x35851e);return respondWithRpcPromise(_0xa5b4('0x5a'),_0xa5b4('0x30'),{'module':_0xa5b4('0x5b')});}else{var _0x41b9ad=fs[_0xa5b4('0x56')](path[_0xa5b4('0x5d')](config[_0xa5b4('0x63')],'server/files/templates/network.ejs'),_0xa5b4('0x57'));var _0x3f5192=ejs[_0xa5b4('0x5e')](_0x41b9ad,{'networks':_0x299e86||[]});fs[_0xa5b4('0x58')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x34ce67[_0xa5b4('0x53')]['type'][_0xa5b4('0x61')]()),_0x3f5192);return respondWithRpcPromise(_0xa5b4('0x5a'),'destroy',{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x284463,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 84e0b3e..b374b0e 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 _0xd547=['define','../../config/logger','api','moment','bluebird','rimraf','./network.attributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd547,0x1c1));var _0x7d54=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0xd547[_0x17406e];return _0x2bfc5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d54('0x0'))(_0x7d54('0x1'));var moment=require(_0x7d54('0x2'));var BPromise=require(_0x7d54('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7d54('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d54('0x5'));module['exports']=function(_0x296dd6,_0x37defc){return _0x296dd6[_0x7d54('0x6')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe28e=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12eba7,_0x5a8abb){var _0x4876b7=function(_0x699e4a){while(--_0x699e4a){_0x12eba7['push'](_0x12eba7['shift']());}};_0x4876b7(++_0x5a8abb);}(_0xe28e,0x1ba));var _0xee28=function(_0x5cca30,_0x19a02f){_0x5cca30=_0x5cca30-0x0;var _0x5a3678=_0xe28e[_0x5cca30];return _0x5a3678;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var logger=require(_0xee28('0x2'))(_0xee28('0x3'));var moment=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var rp=require(_0xee28('0x6'));var fs=require('fs');var path=require(_0xee28('0x7'));var rimraf=require(_0xee28('0x8'));var config=require(_0xee28('0x9'));var attributes=require(_0xee28('0xa'));module[_0xee28('0xb')]=function(_0x162d3f,_0x48e72f){return _0x162d3f[_0xee28('0xc')](_0xee28('0xd'),attributes,{'tableName':_0xee28('0xe'),'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 f450c47..d9fb211 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(_0x26161d,_0x1e5132){var _0x4bcff3=function(_0x421ce0){while(--_0x421ce0){_0x26161d['push'](_0x26161d['shift']());}};_0x4bcff3(++_0x1e5132);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0xa0750e,_0x1b3c18){_0xa0750e=_0xa0750e-0x0;var _0x27a020=_0x7a54[_0xa0750e];return _0x27a020;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index dbc52f4..fdbe293 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 _0x557d=['/:id/send','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','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x557d,0x88));var _0xd557=function(_0x59b4e6,_0x142f5b){_0x59b4e6=_0x59b4e6-0x0;var _0x165939=_0x557d[_0x59b4e6];return _0x165939;};'use strict';var multer=require(_0xd557('0x0'));var util=require(_0xd557('0x1'));var path=require(_0xd557('0x2'));var timeout=require(_0xd557('0x3'));var express=require(_0xd557('0x4'));var router=express[_0xd557('0x5')]();var fs_extra=require(_0xd557('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd557('0x7'));var config=require(_0xd557('0x8'));var controller=require(_0xd557('0x9'));router[_0xd557('0xa')]('/',auth[_0xd557('0xb')](),controller[_0xd557('0xc')]);router[_0xd557('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xd557('0xd')]);router['get'](_0xd557('0xe'),auth[_0xd557('0xb')](),controller[_0xd557('0xf')]);router['get'](_0xd557('0x10'),auth[_0xd557('0xb')](),controller[_0xd557('0x11')]);router[_0xd557('0xa')](_0xd557('0x12'),auth[_0xd557('0xb')](),controller[_0xd557('0x13')]);router[_0xd557('0xa')]('/:id/applications',auth[_0xd557('0xb')](),controller['getApplications']);router[_0xd557('0xa')]('/:id/interactions',auth[_0xd557('0xb')](),controller[_0xd557('0x14')]);router[_0xd557('0xa')](_0xd557('0x15'),auth[_0xd557('0xb')](),controller[_0xd557('0x16')]);router[_0xd557('0x17')]('/',auth['isAuthenticated'](),controller[_0xd557('0x18')]);router[_0xd557('0x17')](_0xd557('0x10'),auth[_0xd557('0xb')](),controller[_0xd557('0x19')]);router[_0xd557('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd557('0x1a')]);router[_0xd557('0x17')](_0xd557('0x1b'),controller[_0xd557('0x1c')]);router[_0xd557('0x17')](_0xd557('0x1d'),auth['isAuthenticated'](),controller[_0xd557('0x1e')]);router['post'](_0xd557('0x15'),auth[_0xd557('0xb')](),controller[_0xd557('0x1f')]);router[_0xd557('0x17')](_0xd557('0x20'),auth['isAuthenticated'](),controller[_0xd557('0x21')]);router[_0xd557('0x22')](_0xd557('0xe'),auth[_0xd557('0xb')](),controller[_0xd557('0x23')]);router[_0xd557('0x24')](_0xd557('0xe'),auth[_0xd557('0xb')](),controller[_0xd557('0x25')]);router[_0xd557('0x24')](_0xd557('0x10'),auth[_0xd557('0xb')](),controller[_0xd557('0x26')]);router[_0xd557('0x24')](_0xd557('0x12'),auth[_0xd557('0xb')](),controller[_0xd557('0x27')]);router[_0xd557('0x24')](_0xd557('0x15'),auth['isAuthenticated'](),controller[_0xd557('0x28')]);module[_0xd557('0x29')]=router; \ No newline at end of file +var _0x9259=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/canned_answers','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout'];(function(_0x2cad39,_0x6fc43b){var _0xb022dc=function(_0xcbaa61){while(--_0xcbaa61){_0x2cad39['push'](_0x2cad39['shift']());}};_0xb022dc(++_0x6fc43b);}(_0x9259,0xe0));var _0x9925=function(_0x32bbb1,_0xa0e27e){_0x32bbb1=_0x32bbb1-0x0;var _0x42b415=_0x9259[_0x32bbb1];return _0x42b415;};'use strict';var multer=require(_0x9925('0x0'));var util=require(_0x9925('0x1'));var path=require(_0x9925('0x2'));var timeout=require(_0x9925('0x3'));var express=require(_0x9925('0x4'));var router=express[_0x9925('0x5')]();var fs_extra=require(_0x9925('0x6'));var auth=require(_0x9925('0x7'));var interaction=require(_0x9925('0x8'));var config=require(_0x9925('0x9'));var controller=require(_0x9925('0xa'));router[_0x9925('0xb')]('/',auth[_0x9925('0xc')](),controller[_0x9925('0xd')]);router['get'](_0x9925('0xe'),auth[_0x9925('0xc')](),controller[_0x9925('0xf')]);router[_0x9925('0xb')](_0x9925('0x10'),auth[_0x9925('0xc')](),controller['show']);router[_0x9925('0xb')](_0x9925('0x11'),auth[_0x9925('0xc')](),controller[_0x9925('0x12')]);router[_0x9925('0xb')]('/:id/canned_answers',auth[_0x9925('0xc')](),controller['getAnswers']);router[_0x9925('0xb')](_0x9925('0x13'),auth['isAuthenticated'](),controller[_0x9925('0x14')]);router[_0x9925('0xb')](_0x9925('0x15'),auth[_0x9925('0xc')](),controller[_0x9925('0x16')]);router[_0x9925('0xb')](_0x9925('0x17'),auth[_0x9925('0xc')](),controller['getAgents']);router[_0x9925('0x18')]('/',auth[_0x9925('0xc')](),controller[_0x9925('0x19')]);router[_0x9925('0x18')](_0x9925('0x11'),auth[_0x9925('0xc')](),controller[_0x9925('0x1a')]);router['post'](_0x9925('0x1b'),auth[_0x9925('0xc')](),controller['addAnswer']);router[_0x9925('0x18')]('/:id/notify',controller[_0x9925('0x1c')]);router[_0x9925('0x18')](_0x9925('0x13'),auth[_0x9925('0xc')](),controller[_0x9925('0x1d')]);router[_0x9925('0x18')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x9925('0x18')](_0x9925('0x1e'),auth[_0x9925('0xc')](),controller[_0x9925('0x1f')]);router[_0x9925('0x20')](_0x9925('0x10'),auth[_0x9925('0xc')](),controller[_0x9925('0x21')]);router[_0x9925('0x22')]('/:id',auth['isAuthenticated'](),controller[_0x9925('0x23')]);router[_0x9925('0x22')](_0x9925('0x11'),auth[_0x9925('0xc')](),controller['removeDispositions']);router[_0x9925('0x22')](_0x9925('0x1b'),auth[_0x9925('0xc')](),controller[_0x9925('0x24')]);router[_0x9925('0x22')](_0x9925('0x17'),auth['isAuthenticated'](),controller[_0x9925('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9da20f1..03b838a 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 _0x77ef=['randomstring','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0xef3e80,_0x1edef3){var _0x47887d=function(_0x5e1162){while(--_0x5e1162){_0xef3e80['push'](_0xef3e80['shift']());}};_0x47887d(++_0x1edef3);}(_0x77ef,0x137));var _0xf77e=function(_0x3a1dc0,_0x34b610){_0x3a1dc0=_0x3a1dc0-0x0;var _0x28af92=_0x77ef[_0x3a1dc0];return _0x28af92;};'use strict';var Sequelize=require(_0xf77e('0x0'));var rs=require(_0xf77e('0x1'));module[_0xf77e('0x2')]={'name':{'type':Sequelize[_0xf77e('0x3')],'unique':_0xf77e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xf77e('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xf77e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf77e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf77e('0x5')],'defaultValue':function(){return _0xf77e('0x6');}},'notificationSound':{'type':Sequelize[_0xf77e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf77e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf77e('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf77e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf77e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf77e('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf77e('0x7')],'defaultValue':![],'comment':_0xf77e('0x9'),'set':function(_0x5440d5){if(!_0x5440d5)this[_0xf77e('0xa')](_0xf77e('0xb'),null);this[_0xf77e('0xa')](_0xf77e('0xc'),_0x5440d5);}}}; \ No newline at end of file +var _0x34fa=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER'];(function(_0x4b9abc,_0x25bb42){var _0x568162=function(_0x4a52f5){while(--_0x4a52f5){_0x4b9abc['push'](_0x4b9abc['shift']());}};_0x568162(++_0x25bb42);}(_0x34fa,0x13c));var _0xa34f=function(_0x3ee4d2,_0x2b2e7a){_0x3ee4d2=_0x3ee4d2-0x0;var _0x3df836=_0x34fa[_0x3ee4d2];return _0x3df836;};'use strict';var Sequelize=require(_0xa34f('0x0'));var rs=require(_0xa34f('0x1'));module[_0xa34f('0x2')]={'name':{'type':Sequelize[_0xa34f('0x3')],'unique':_0xa34f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa34f('0x3')]},'token':{'type':Sequelize[_0xa34f('0x3')],'defaultValue':function(){return rs[_0xa34f('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa34f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa34f('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa34f('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa34f('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa34f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa34f('0x3')]},'queueTransfer':{'type':Sequelize[_0xa34f('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa34f('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa34f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa34f('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xa34f('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa34f('0xa'),'set':function(_0x1a7d95){if(!_0x1a7d95)this[_0xa34f('0xb')](_0xa34f('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x1a7d95);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d88cf17..21abe42 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 _0x4bf9=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','nolimit','sort','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','OpenchannelApplication','Applications','List','account','applications','list','asc','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','lastName','messageId','interaction','created','autoclose','push','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','sequelize','transaction','bulkCreate','priority','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','DESC','out','Messages','spread','dataValues','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','UserProfileSection','userProfileId'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4bf9,0x1cc));var _0x94bf=function(_0x415e0e,_0x4b6f92){_0x415e0e=_0x415e0e-0x0;var _0x36e9c1=_0x4bf9[_0x415e0e];return _0x36e9c1;};'use strict';var emlformat=require(_0x94bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94bf('0x2'));var moment=require(_0x94bf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x94bf('0x4'));var util=require(_0x94bf('0x5'));var path=require(_0x94bf('0x6'));var sox=require(_0x94bf('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x94bf('0x8'));var _=require(_0x94bf('0x9'));var squel=require('squel');var crypto=require(_0x94bf('0xa'));var jsforce=require(_0x94bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x94bf('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x94bf('0xd'));var authService=require(_0x94bf('0xe'));var qs=require(_0x94bf('0xf'));var as=require(_0x94bf('0x10'));var hardwareService=require(_0x94bf('0x11'));var logger=require('../../config/logger')(_0x94bf('0x12'));var utils=require(_0x94bf('0x13'));var config=require(_0x94bf('0x14'));var licenseUtil=require(_0x94bf('0x15'));var db=require('../../mysqldb')['db'];config[_0x94bf('0x16')]=_[_0x94bf('0x17')](config[_0x94bf('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x94bf('0x18'))(new Redis(config[_0x94bf('0x16')]));require(_0x94bf('0x19'))[_0x94bf('0x1a')](socket);var jayson=require(_0x94bf('0x1b'));var client=jayson[_0x94bf('0x1c')][_0x94bf('0x1d')]({'port':0x232c});var client9002=jayson[_0x94bf('0x1c')][_0x94bf('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x456da5,_0x25d1c2,_0x396e4b,_0x3f6fb0){return new BPromise(function(_0x4fc4ca,_0xa8221b){var _0x37846a=_0x3f6fb0||client;return _0x37846a[_0x94bf('0x1e')](_0x456da5,_0x396e4b)['then'](function(_0x46b8d9){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x25d1c2,'request\x20sent');logger['debug'](_0x94bf('0x1f'),_0x25d1c2,_0x94bf('0x20'),JSON[_0x94bf('0x21')](_0x46b8d9));if(_0x46b8d9[_0x94bf('0x22')]){if(_0x46b8d9[_0x94bf('0x22')]['code']===0x1f4){logger[_0x94bf('0x22')](_0x94bf('0x23'),_0x25d1c2,_0x46b8d9[_0x94bf('0x22')][_0x94bf('0x24')]);return _0xa8221b(_0x46b8d9['error']['message']);}logger[_0x94bf('0x22')](_0x94bf('0x23'),_0x25d1c2,_0x46b8d9[_0x94bf('0x22')][_0x94bf('0x24')]);return _0x4fc4ca(_0x46b8d9[_0x94bf('0x22')]['message']);}else{logger['info'](_0x94bf('0x23'),_0x25d1c2,'request\x20sent');_0x4fc4ca(_0x46b8d9['result'][_0x94bf('0x24')]);}})['catch'](function(_0x322ac0){logger['error'](_0x94bf('0x23'),_0x25d1c2,_0x322ac0);_0xa8221b(_0x322ac0);});});}function respondWithStatusCode(_0x4fdfaf,_0x50854c){_0x50854c=_0x50854c||0xcc;return function(_0x4cc346){if(_0x4cc346){return _0x4fdfaf[_0x94bf('0x25')](_0x50854c);}return _0x4fdfaf[_0x94bf('0x26')](_0x50854c)[_0x94bf('0x27')]();};}function respondWithResult(_0x2739d0,_0x3640c6){_0x3640c6=_0x3640c6||0xc8;return function(_0x3f67f5){if(_0x3f67f5){return _0x2739d0[_0x94bf('0x26')](_0x3640c6)[_0x94bf('0x28')](_0x3f67f5);}};}function respondWithFilteredResult(_0x2426e2,_0x56a72b){return function(_0x518585){if(_0x518585){var _0x313cce=typeof _0x56a72b[_0x94bf('0x29')]===_0x94bf('0x2a')&&typeof _0x56a72b['limit']==='undefined';var _0x586534=_0x518585[_0x94bf('0x2b')];var _0xf63a95=_0x313cce?0x0:_0x56a72b[_0x94bf('0x29')];var _0x1222ff=_0x313cce?_0x518585[_0x94bf('0x2b')]:_0x56a72b['offset']+_0x56a72b[_0x94bf('0x2c')];var _0x14a43f;if(_0x1222ff>=_0x586534){_0x1222ff=_0x586534;_0x14a43f=0xc8;}else{_0x14a43f=0xce;}_0x2426e2['status'](_0x14a43f);return _0x2426e2[_0x94bf('0x2d')](_0x94bf('0x2e'),_0xf63a95+'-'+_0x1222ff+'/'+_0x586534)[_0x94bf('0x28')](_0x518585);}return null;};}function patchUpdates(_0x21056f){return function(_0x21c0fe){try{jsonpatch['apply'](_0x21c0fe,_0x21056f,!![]);}catch(_0x446fc9){return BPromise['reject'](_0x446fc9);}return _0x21c0fe['save']();};}function saveUpdates(_0x2010f5,_0x336b4c){return function(_0x106679){if(_0x106679){return _0x106679[_0x94bf('0x2f')](_0x2010f5)[_0x94bf('0x30')](function(_0x326ca8){return _0x326ca8;});}return null;};}function removeEntity(_0x2b3b23,_0x4016dc){return function(_0x2fb23e){if(_0x2fb23e){return _0x2fb23e['destroy']()[_0x94bf('0x30')](function(){var _0x1d3fb7=_0x2fb23e[_0x94bf('0x31')]({'plain':!![]});var _0x43c12c=_0x94bf('0x32');return db[_0x94bf('0x33')][_0x94bf('0x34')]({'where':{'type':_0x43c12c,'resourceId':_0x1d3fb7['id']}})[_0x94bf('0x30')](function(){return _0x2fb23e;});})[_0x94bf('0x30')](function(){_0x2b3b23[_0x94bf('0x26')](0xcc)[_0x94bf('0x27')]();});}};}function handleEntityNotFound(_0x5114f0,_0x54132c){return function(_0x425117){if(!_0x425117){_0x5114f0[_0x94bf('0x25')](0x194);}return _0x425117;};}function handleError(_0x10a911,_0x26d71e){_0x26d71e=_0x26d71e||0x1f4;return function(_0x3d89d0){logger[_0x94bf('0x22')](_0x3d89d0[_0x94bf('0x35')]);if(_0x3d89d0['name']){delete _0x3d89d0[_0x94bf('0x36')];}_0x10a911[_0x94bf('0x26')](_0x26d71e)[_0x94bf('0x37')](_0x3d89d0);};}exports[_0x94bf('0x38')]=function(_0x2f1b39,_0x16b1ea){var _0x12b70f={'include':[{'model':db[_0x94bf('0x39')],'as':_0x94bf('0x3a')}]},_0xc31ffe={},_0x475415={'count':0x0,'rows':[]};var _0x4985cb=_[_0x94bf('0x3b')](db[_0x94bf('0x3c')][_0x94bf('0x3d')],function(_0x6a75c9){return{'name':_0x6a75c9[_0x94bf('0x3e')],'type':_0x6a75c9['type'][_0x94bf('0x3f')]};});_0xc31ffe[_0x94bf('0x40')]=_[_0x94bf('0x3b')](_0x4985cb,'name');_0xc31ffe[_0x94bf('0x41')]=_[_0x94bf('0x42')](_0x2f1b39[_0x94bf('0x41')]);_0xc31ffe[_0x94bf('0x43')]=_[_0x94bf('0x44')](_0xc31ffe[_0x94bf('0x40')],_0xc31ffe[_0x94bf('0x41')]);_0x12b70f[_0x94bf('0x45')]=_['intersection'](_0xc31ffe[_0x94bf('0x40')],qs[_0x94bf('0x46')](_0x2f1b39[_0x94bf('0x41')][_0x94bf('0x46')]));_0x12b70f[_0x94bf('0x45')]=_0x12b70f[_0x94bf('0x45')][_0x94bf('0x47')]?_0x12b70f[_0x94bf('0x45')]:_0xc31ffe[_0x94bf('0x40')];if(!_0x2f1b39[_0x94bf('0x41')][_0x94bf('0x48')]('nolimit')){_0x12b70f[_0x94bf('0x2c')]=qs[_0x94bf('0x2c')](_0x2f1b39[_0x94bf('0x41')][_0x94bf('0x2c')]);_0x12b70f[_0x94bf('0x29')]=qs[_0x94bf('0x29')](_0x2f1b39['query'][_0x94bf('0x29')]);}_0x12b70f[_0x94bf('0x49')]=qs['sort'](_0x2f1b39[_0x94bf('0x41')]['sort']);_0x12b70f[_0x94bf('0x4a')]=qs[_0x94bf('0x43')](_[_0x94bf('0x4b')](_0x2f1b39[_0x94bf('0x41')],_0xc31ffe['filters']),_0x4985cb);if(_0x2f1b39[_0x94bf('0x41')][_0x94bf('0x4c')]){_0x12b70f[_0x94bf('0x4a')]=_[_0x94bf('0x4d')](_0x12b70f[_0x94bf('0x4a')],{'$or':_['map'](_0x4985cb,function(_0x8439aa){if(_0x8439aa[_0x94bf('0x4e')]!==_0x94bf('0x4f')){var _0x582723={};_0x582723[_0x8439aa['name']]={'$like':'%'+_0x2f1b39[_0x94bf('0x41')]['filter']+'%'};return _0x582723;}})});}_0x12b70f=_[_0x94bf('0x4d')]({},_0x12b70f,_0x2f1b39[_0x94bf('0x50')]);var _0x202848={'where':_0x12b70f[_0x94bf('0x4a')]};return db[_0x94bf('0x3c')][_0x94bf('0x2b')](_0x202848)[_0x94bf('0x30')](function(_0x28375b){_0x475415[_0x94bf('0x2b')]=_0x28375b;if(_0x2f1b39[_0x94bf('0x41')][_0x94bf('0x51')]){_0x12b70f[_0x94bf('0x52')]=[{'all':!![]}];}return db[_0x94bf('0x3c')][_0x94bf('0x53')](_0x12b70f);})[_0x94bf('0x30')](function(_0x3ae826){_0x475415[_0x94bf('0x54')]=_0x3ae826;return _0x475415;})[_0x94bf('0x30')](respondWithFilteredResult(_0x16b1ea,_0x12b70f))['catch'](handleError(_0x16b1ea,null));};exports[_0x94bf('0x55')]=function(_0x2b3153,_0x2b26ba){var _0x1fe4e6={'raw':![],'where':{'id':_0x2b3153[_0x94bf('0x56')]['id']},'include':[{'model':db[_0x94bf('0x39')],'as':'mandatoryDispositionPause'}]},_0x46d779={};_0x46d779[_0x94bf('0x40')]=_[_0x94bf('0x42')](db[_0x94bf('0x3c')]['rawAttributes']);_0x46d779['query']=_['keys'](_0x2b3153[_0x94bf('0x41')]);_0x46d779[_0x94bf('0x43')]=_['intersection'](_0x46d779[_0x94bf('0x40')],_0x46d779[_0x94bf('0x41')]);_0x1fe4e6['attributes']=_['intersection'](_0x46d779['model'],qs['fields'](_0x2b3153[_0x94bf('0x41')][_0x94bf('0x46')]));_0x1fe4e6['attributes']=_0x1fe4e6['attributes'][_0x94bf('0x47')]?_0x1fe4e6[_0x94bf('0x45')]:_0x46d779[_0x94bf('0x40')];if(_0x2b3153[_0x94bf('0x41')][_0x94bf('0x51')]){_0x1fe4e6[_0x94bf('0x52')]=[{'all':!![]}];}_0x1fe4e6=_['merge']({},_0x1fe4e6,_0x2b3153[_0x94bf('0x50')]);return db[_0x94bf('0x3c')][_0x94bf('0x57')](_0x1fe4e6)[_0x94bf('0x30')](handleEntityNotFound(_0x2b26ba,null))[_0x94bf('0x30')](respondWithResult(_0x2b26ba,null))[_0x94bf('0x58')](handleError(_0x2b26ba,null));};exports[_0x94bf('0x59')]=function(_0x39ea58,_0x149d1d){return db[_0x94bf('0x3c')][_0x94bf('0x59')](_0x39ea58[_0x94bf('0x5a')],{})['then'](function(_0x59fc61){var _0x224992=_0x39ea58[_0x94bf('0x5b')][_0x94bf('0x31')]({'plain':!![]});if(!_0x224992)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x224992[_0x94bf('0x5c')]===_0x94bf('0x5b')){var _0x30e6bc=_0x59fc61[_0x94bf('0x31')]({'plain':!![]});var _0x44fb9e=_0x94bf('0x32');return db[_0x94bf('0x5d')][_0x94bf('0x57')]({'where':{'name':_0x44fb9e,'userProfileId':_0x224992[_0x94bf('0x5e')]},'raw':!![]})['then'](function(_0x20e9c3){if(_0x20e9c3&&_0x20e9c3[_0x94bf('0x5f')]===0x0){return db[_0x94bf('0x33')][_0x94bf('0x59')]({'name':_0x30e6bc['name'],'resourceId':_0x30e6bc['id'],'type':_0x20e9c3[_0x94bf('0x36')],'sectionId':_0x20e9c3['id']},{})[_0x94bf('0x30')](function(){return _0x59fc61;});}else{return _0x59fc61;}})[_0x94bf('0x58')](function(_0x549719){logger['error'](_0x94bf('0x60'),_0x549719);throw _0x549719;});}return _0x59fc61;})[_0x94bf('0x30')](respondWithResult(_0x149d1d,0xc9))['catch'](handleError(_0x149d1d,null));};exports['update']=function(_0x3f0c01,_0x263a04){if(_0x3f0c01[_0x94bf('0x5a')]['id']){delete _0x3f0c01[_0x94bf('0x5a')]['id'];}return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x3f0c01[_0x94bf('0x56')]['id']},'include':[{'model':db[_0x94bf('0x39')],'as':_0x94bf('0x3a')}]})['then'](handleEntityNotFound(_0x263a04,null))[_0x94bf('0x30')](saveUpdates(_0x3f0c01[_0x94bf('0x5a')],null))['then'](respondWithResult(_0x263a04,null))[_0x94bf('0x58')](handleError(_0x263a04,null));};exports[_0x94bf('0x34')]=function(_0x3881d0,_0x2088d9){return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x3881d0[_0x94bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x2088d9,null))['then'](removeEntity(_0x2088d9,null))[_0x94bf('0x58')](handleError(_0x2088d9,null));};exports[_0x94bf('0x61')]=function(_0x52b5c7,_0x397735){return db[_0x94bf('0x3c')][_0x94bf('0x61')]()[_0x94bf('0x30')](respondWithResult(_0x397735,null))[_0x94bf('0x58')](handleError(_0x397735,null));};exports[_0x94bf('0x62')]=function(_0x26b7ad,_0x211d2b,_0x22d214){if(_0x26b7ad[_0x94bf('0x5a')]['id']){delete _0x26b7ad[_0x94bf('0x5a')]['id'];}return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x26b7ad['params']['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x211d2b,null))['then'](function(_0x541982){if(_0x541982){_0x26b7ad[_0x94bf('0x5a')][_0x94bf('0x63')]=_0x541982['id'];return db[_0x94bf('0x64')][_0x94bf('0x59')](_0x26b7ad[_0x94bf('0x5a')]);}})[_0x94bf('0x30')](respondWithResult(_0x211d2b,null))[_0x94bf('0x58')](handleError(_0x211d2b,null));};exports[_0x94bf('0x65')]=function(_0x5151f0,_0x476b0c,_0x434818){var _0x228101={'raw':![],'where':{}};var _0x2f2caa={};var _0x360f26={'count':0x0,'rows':[]};return db[_0x94bf('0x3c')]['findOne']({'where':{'id':_0x5151f0['params']['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x476b0c,null))[_0x94bf('0x30')](function(_0x4f1d65){if(_0x4f1d65){_0x2f2caa[_0x94bf('0x40')]=_[_0x94bf('0x42')](db['Disposition'][_0x94bf('0x3d')]);_0x2f2caa['query']=_[_0x94bf('0x42')](_0x5151f0['query']);_0x2f2caa[_0x94bf('0x43')]=_['intersection'](_0x2f2caa['model'],_0x2f2caa[_0x94bf('0x41')]);_0x228101[_0x94bf('0x45')]=_[_0x94bf('0x44')](_0x2f2caa[_0x94bf('0x40')],qs[_0x94bf('0x46')](_0x5151f0[_0x94bf('0x41')][_0x94bf('0x46')]));_0x228101[_0x94bf('0x45')]=_0x228101['attributes']['length']?_0x228101['attributes']:_0x2f2caa[_0x94bf('0x40')];if(!_0x5151f0['query'][_0x94bf('0x48')](_0x94bf('0x66'))){_0x228101[_0x94bf('0x2c')]=qs[_0x94bf('0x2c')](_0x5151f0[_0x94bf('0x41')]['limit']);_0x228101[_0x94bf('0x29')]=qs[_0x94bf('0x29')](_0x5151f0[_0x94bf('0x41')][_0x94bf('0x29')]);}_0x228101['order']=qs[_0x94bf('0x67')](_0x5151f0['query'][_0x94bf('0x67')]);_0x228101[_0x94bf('0x4a')]=qs[_0x94bf('0x43')](_[_0x94bf('0x4b')](_0x5151f0[_0x94bf('0x41')],_0x2f2caa['filters']));_0x228101[_0x94bf('0x4a')][_0x94bf('0x63')]=_0x4f1d65['id'];if(_0x5151f0['query']['filter']){_0x228101[_0x94bf('0x4a')]=_[_0x94bf('0x4d')](_0x228101['where'],{'$or':_['map'](_0x228101[_0x94bf('0x45')],function(_0x18d3fc){var _0x199184={};_0x199184[_0x18d3fc]={'$like':'%'+_0x5151f0['query'][_0x94bf('0x4c')]+'%'};return _0x199184;})});}_0x228101=_[_0x94bf('0x4d')]({},_0x228101,_0x5151f0[_0x94bf('0x50')]);return db['Disposition'][_0x94bf('0x2b')]({'where':_0x228101[_0x94bf('0x4a')]})[_0x94bf('0x30')](function(_0x4abdf6){_0x360f26[_0x94bf('0x2b')]=_0x4abdf6;if(_0x5151f0[_0x94bf('0x41')][_0x94bf('0x51')]){_0x228101['include']=[{'all':!![]}];}return db[_0x94bf('0x64')][_0x94bf('0x53')](_0x228101);})[_0x94bf('0x30')](function(_0x6c49cb){_0x360f26[_0x94bf('0x54')]=_0x6c49cb;return _0x360f26;});}})['then'](respondWithFilteredResult(_0x476b0c,_0x228101))[_0x94bf('0x58')](handleError(_0x476b0c,null));};exports[_0x94bf('0x68')]=function(_0x2e5ad8,_0x43d498,_0x26234f){return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x2e5ad8[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x43d498,null))[_0x94bf('0x30')](function(_0x49c8e3){if(_0x49c8e3){return _0x49c8e3[_0x94bf('0x68')](_0x2e5ad8[_0x94bf('0x41')][_0x94bf('0x69')]);}})['then'](respondWithStatusCode(_0x43d498,null))[_0x94bf('0x58')](handleError(_0x43d498,null));};exports[_0x94bf('0x6a')]=function(_0x409c67,_0xa759dd,_0x5a28f2){if(_0x409c67[_0x94bf('0x5a')]['id']){delete _0x409c67[_0x94bf('0x5a')]['id'];}return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x409c67['params']['id']}})['then'](handleEntityNotFound(_0xa759dd,null))[_0x94bf('0x30')](function(_0x25feea){if(_0x25feea){_0x409c67[_0x94bf('0x5a')][_0x94bf('0x63')]=_0x25feea['id'];return db['CannedAnswer'][_0x94bf('0x59')](_0x409c67['body']);}})['then'](respondWithResult(_0xa759dd,null))['catch'](handleError(_0xa759dd,null));};exports['getAnswers']=function(_0x25397d,_0x590336,_0x35e3bb){var _0x137279={'raw':![],'where':{}};var _0xf855b={};var _0x2c54b2={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x25397d[_0x94bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x590336,null))[_0x94bf('0x30')](function(_0x5bbe48){if(_0x5bbe48){_0xf855b['model']=_[_0x94bf('0x42')](db[_0x94bf('0x6b')]['rawAttributes']);_0xf855b[_0x94bf('0x41')]=_['keys'](_0x25397d[_0x94bf('0x41')]);_0xf855b['filters']=_[_0x94bf('0x44')](_0xf855b['model'],_0xf855b[_0x94bf('0x41')]);_0x137279[_0x94bf('0x45')]=_[_0x94bf('0x44')](_0xf855b[_0x94bf('0x40')],qs[_0x94bf('0x46')](_0x25397d['query'][_0x94bf('0x46')]));_0x137279[_0x94bf('0x45')]=_0x137279[_0x94bf('0x45')][_0x94bf('0x47')]?_0x137279[_0x94bf('0x45')]:_0xf855b['model'];if(!_0x25397d['query'][_0x94bf('0x48')](_0x94bf('0x66'))){_0x137279[_0x94bf('0x2c')]=qs['limit'](_0x25397d['query'][_0x94bf('0x2c')]);_0x137279[_0x94bf('0x29')]=qs[_0x94bf('0x29')](_0x25397d['query'][_0x94bf('0x29')]);}_0x137279[_0x94bf('0x49')]=qs[_0x94bf('0x67')](_0x25397d[_0x94bf('0x41')]['sort']);_0x137279['where']=qs[_0x94bf('0x43')](_[_0x94bf('0x4b')](_0x25397d['query'],_0xf855b[_0x94bf('0x43')]));_0x137279[_0x94bf('0x4a')][_0x94bf('0x63')]=_0x5bbe48['id'];if(_0x25397d[_0x94bf('0x41')]['filter']){_0x137279[_0x94bf('0x4a')]=_[_0x94bf('0x4d')](_0x137279['where'],{'$or':_['map'](_0x137279['attributes'],function(_0x528240){var _0x4cdf0e={};_0x4cdf0e[_0x528240]={'$like':'%'+_0x25397d[_0x94bf('0x41')][_0x94bf('0x4c')]+'%'};return _0x4cdf0e;})});}_0x137279=_[_0x94bf('0x4d')]({},_0x137279,_0x25397d['options']);return db[_0x94bf('0x6b')][_0x94bf('0x2b')]({'where':_0x137279[_0x94bf('0x4a')]})[_0x94bf('0x30')](function(_0x1deca2){_0x2c54b2[_0x94bf('0x2b')]=_0x1deca2;if(_0x25397d['query'][_0x94bf('0x51')]){_0x137279[_0x94bf('0x52')]=[{'all':!![]}];}return db[_0x94bf('0x6b')][_0x94bf('0x53')](_0x137279);})['then'](function(_0xda658f){_0x2c54b2[_0x94bf('0x54')]=_0xda658f;return _0x2c54b2;});}})[_0x94bf('0x30')](respondWithFilteredResult(_0x590336,_0x137279))[_0x94bf('0x58')](handleError(_0x590336,null));};exports[_0x94bf('0x6c')]=function(_0x5f0578,_0x533c10,_0x1feb27){return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x5f0578['params']['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x533c10,null))[_0x94bf('0x30')](function(_0x596e46){if(_0x596e46){return _0x596e46[_0x94bf('0x6c')](_0x5f0578['query']['ids']);}})[_0x94bf('0x30')](respondWithStatusCode(_0x533c10,null))[_0x94bf('0x58')](handleError(_0x533c10,null));};exports[_0x94bf('0x6d')]=function(_0x5065e3,_0x3ed2f3,_0x34201e){var _0xe2939d={'body':_0x5065e3[_0x94bf('0x5a')],'channel':_0x94bf('0x6e')};var _0x48951e=[];var _0x2d309f=[];var _0x1371f3={};var _0x5e6825=![];return db[_0x94bf('0x6f')]['describe']()[_0x94bf('0x30')](function(_0x3de32b){if(!_0x3de32b){throw new db[(_0x94bf('0x70'))]['ValidationError']('no\x20available\x20attributes');}_0x48951e=_[_0x94bf('0x71')](_[_0x94bf('0x42')](_0x3de32b),[_0x94bf('0x72'),_0x94bf('0x73')]);_0x2d309f=_['difference'](_['keys'](_0x3de32b),['createdAt',_0x94bf('0x73'),_0x94bf('0x74'),'ListId']);if(_0x5065e3[_0x94bf('0x5a')]['id']){delete _0x5065e3[_0x94bf('0x5a')]['id'];}if(_[_0x94bf('0x75')](_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x76')])){throw new db[(_0x94bf('0x70'))][(_0x94bf('0x77'))](_0x94bf('0x78'));}if(_[_0x94bf('0x75')](_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x5a')])||_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x5a')]===''){throw new db[(_0x94bf('0x70'))][(_0x94bf('0x77'))](_0x94bf('0x79'));}if(_[_0x94bf('0x75')](_0x5065e3['body'][_0x94bf('0x7a')])){throw new db[(_0x94bf('0x70'))][(_0x94bf('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d309f);}if(!_[_0x94bf('0x7b')](_0x2d309f,_0x5065e3['body'][_0x94bf('0x7a')])){throw new db[(_0x94bf('0x70'))][(_0x94bf('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d309f);}_0x1371f3[_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x7a')]]=_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x76')];})[_0x94bf('0x30')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x5065e3['params']['id']},'include':[{'model':db[_0x94bf('0x7c')],'as':'List','include':[{'model':db[_0x94bf('0x6f')],'as':_0x94bf('0x7d'),'where':_0x1371f3,'limit':0x1,'order':[[_0x94bf('0x73'),'DESC']]}]},{'model':db[_0x94bf('0x7e')],'as':_0x94bf('0x7f')}]});})[_0x94bf('0x30')](handleEntityNotFound(_0x3ed2f3,null))[_0x94bf('0x30')](function(_0x1f71bf){if(_0x1f71bf&&_0x1f71bf[_0x94bf('0x80')]){_0xe2939d[_0x94bf('0x81')]=_0x1f71bf;_0xe2939d[_0x94bf('0x82')]=_0x1f71bf['Applications'];_0xe2939d[_0x94bf('0x83')]=_0x1f71bf[_0x94bf('0x80')];_0xe2939d['applications']=_['orderBy'](_0xe2939d[_0x94bf('0x82')],['priority'],[_0x94bf('0x84')]);if(_0xe2939d['account']['Applications']){delete _0xe2939d[_0x94bf('0x81')][_0x94bf('0x7f')];}if(_0xe2939d[_0x94bf('0x81')][_0x94bf('0x80')]&&_0xe2939d['account'][_0x94bf('0x80')][_0x94bf('0x7d')][_0x94bf('0x47')]){return _0xe2939d['account'][_0x94bf('0x80')]['Contacts'][0x0];}var _0x18383b=_[_0x94bf('0x17')](_0x5065e3['body'],{'firstName':_0x5065e3[_0x94bf('0x5a')]['from'],'ListId':_0x1f71bf[_0x94bf('0x85')]});_0x18383b[_0x5065e3[_0x94bf('0x5a')]['mapKey']]=_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x76')];return db[_0x94bf('0x6f')][_0x94bf('0x59')](_0x18383b,{'fields':_0x48951e,'raw':!![]});}})[_0x94bf('0x30')](handleEntityNotFound(_0x3ed2f3,null))[_0x94bf('0x30')](function(_0x3db11b){_0xe2939d[_0x94bf('0x86')]=_0x3db11b;if(_0x3db11b){var _0x3b6644={'ContactId':_0x3db11b['id'],'OpenchannelAccountId':_0x5065e3[_0x94bf('0x56')]['id'],'from':(_0x3db11b[_0x94bf('0x87')]||'')+'\x20'+(_0x3db11b['lastName']||'')};var _0x5d86ea={'OpenchannelAccountId':_0x5065e3[_0x94bf('0x56')]['id'],'closed':![]};if(_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x88')]){_0x5d86ea[_0x94bf('0x88')]=_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x88')];return db[_0x94bf('0x89')]['find']({'where':_0x5d86ea})[_0x94bf('0x30')](function(_0x1eca01){if(_0x1eca01){return[_0x1eca01,![]];}_0x3b6644[_0x94bf('0x88')]=_0x5065e3['body'][_0x94bf('0x88')];_0x3b6644[_0x94bf('0x8a')]=_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x8a')];return db[_0x94bf('0x89')][_0x94bf('0x59')](_0x3b6644)['then'](function(_0x57514f){return[_0x57514f,!![]];});});}else{_0x5d86ea['threadId']=null;}_0x5d86ea['ContactId']=_0x3db11b['id'];return db['OpenchannelInteraction'][_0x94bf('0x57')]({'where':_0x5d86ea})[_0x94bf('0x30')](function(_0x4a091e){if(_0x4a091e){return[_0x4a091e,![]];}return db['OpenchannelInteraction'][_0x94bf('0x59')](_0x3b6644)[_0x94bf('0x30')](function(_0x2489ea){return[_0x2489ea,!![]];});});}})['spread'](function(_0x393cda,_0x50548e){if(_0x393cda){_0x5e6825=_0x50548e;if(!_0x50548e){var _0x2976a2={'from':(_0xe2939d[_0x94bf('0x86')][_0x94bf('0x87')]||'')+'\x20'+(_0xe2939d[_0x94bf('0x86')][_0x94bf('0x8b')]||'')};if(_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x88')]&&_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x8c')]&&_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x88')]!=_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x8c')]){_0x2976a2[_0x94bf('0x88')]=_0x5065e3[_0x94bf('0x5a')]['messageId'];}return _0x393cda[_0x94bf('0x2f')](_0x2976a2);}else{return _0x393cda;}}})[_0x94bf('0x30')](function(_0x4c1f94){_0xe2939d[_0x94bf('0x8d')]=_0x4c1f94[_0x94bf('0x31')]({'plain':!![]});_0xe2939d[_0x94bf('0x8d')][_0x94bf('0x8e')]=_0x5e6825;if(_0xe2939d[_0x94bf('0x8d')][_0x94bf('0x8e')]){if(_0xe2939d[_0x94bf('0x81')][_0x94bf('0x8f')]){_0xe2939d['applications'][_0x94bf('0x90')]({'id':0x0,'priority':_0xe2939d['applications'][_0x94bf('0x47')]+0x1,'app':_0x94bf('0x91'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x94bf('0x92')]['create']({'body':_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x5a')],'OpenchannelAccountId':_0x5065e3[_0x94bf('0x56')]['id'],'OpenchannelInteractionId':_0x4c1f94['id'],'direction':'in','ContactId':_0xe2939d[_0x94bf('0x86')]['id'],'AttachmentId':_0x5065e3[_0x94bf('0x5a')][_0x94bf('0x93')]});})[_0x94bf('0x30')](function(_0x526c06){_0xe2939d[_0x94bf('0x24')]=_0x526c06;if(_0xe2939d[_0x94bf('0x8d')][_0x94bf('0x94')]){return db[_0x94bf('0x95')]['find']({'attributes':['id',_0x94bf('0x36')],'where':{'id':_0xe2939d[_0x94bf('0x8d')][_0x94bf('0x94')]}})[_0x94bf('0x30')](function(_0x20d89e){if(_0x20d89e){_0xe2939d['applications'][_0x94bf('0x96')]({'id':0x0,'priority':0x0,'app':_0x94bf('0x97'),'appdata':_0x20d89e['name']+','+(_0xe2939d[_0x94bf('0x81')][_0x94bf('0x98')]||0xa),'interval':_0x94bf('0x99')});_0xe2939d[_0x94bf('0x9a')]=![];}return respondWithRpcPromise('Start','startRouting',_0xe2939d);});}return respondWithRpcPromise(_0x94bf('0x9b'),_0x94bf('0x9c'),_0xe2939d);})[_0x94bf('0x30')](function(_0x1283c4){respondWithRpcPromise(_0x94bf('0x9d'),'EventManager',{'event':_0x94bf('0x6d'),'message':_0x1283c4},client9002);return _0x1283c4;})[_0x94bf('0x30')](respondWithResult(_0x3ed2f3,null))[_0x94bf('0x58')](handleError(_0x3ed2f3,null));};exports[_0x94bf('0x9e')]=function(_0x5b09eb,_0x26aa8a,_0x33bff4){return db[_0x94bf('0x3c')][_0x94bf('0x9f')]({'where':{'id':_0x5b09eb[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x26aa8a,null))['then'](function(_0x30d5b6){if(_0x30d5b6){return db[_0x94bf('0xa0')][_0x94bf('0xa1')](function(_0x318cd9){return db[_0x94bf('0x7e')][_0x94bf('0x34')]({'where':{'OpenchannelAccountId':_0x5b09eb[_0x94bf('0x56')]['id']},'transaction':_0x318cd9})[_0x94bf('0x30')](function(_0x192136){var _0xad89d3=_[_0x94bf('0x3b')](_0x5b09eb[_0x94bf('0x5a')],function(_0x227059){_0x227059['OpenchannelAccountId']=_0x5b09eb['params']['id'];return _0x227059;});return db[_0x94bf('0x7e')][_0x94bf('0xa2')](_0xad89d3,{'transaction':_0x318cd9});});})[_0x94bf('0x30')](function(){return db[_0x94bf('0x7e')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x5b09eb[_0x94bf('0x56')]['id']},'order':_0x94bf('0xa3')});});}})[_0x94bf('0x30')](respondWithResult(_0x26aa8a,null))['catch'](handleError(_0x26aa8a,null));};exports[_0x94bf('0xa4')]=function(_0x33cf02,_0x15b711,_0x3d9e0c){var _0x28443b={};var _0xfc3db7={};var _0x5decd3;var _0x431103;return db['OpenchannelAccount'][_0x94bf('0x9f')]({'where':{'id':_0x33cf02[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x15b711,null))['then'](function(_0x40d1c3){if(_0x40d1c3){_0x5decd3=_0x40d1c3;_0xfc3db7['model']=_[_0x94bf('0x42')](db[_0x94bf('0x7e')][_0x94bf('0x3d')]);_0xfc3db7['query']=_[_0x94bf('0x42')](_0x33cf02['query']);_0xfc3db7['filters']=_[_0x94bf('0x44')](_0xfc3db7[_0x94bf('0x40')],_0xfc3db7[_0x94bf('0x41')]);_0x28443b['attributes']=_[_0x94bf('0x44')](_0xfc3db7['model'],qs['fields'](_0x33cf02[_0x94bf('0x41')][_0x94bf('0x46')]));_0x28443b['attributes']=_0x28443b[_0x94bf('0x45')][_0x94bf('0x47')]?_0x28443b[_0x94bf('0x45')]:_0xfc3db7[_0x94bf('0x40')];_0x28443b[_0x94bf('0x49')]=qs['sort'](_0x33cf02[_0x94bf('0x41')][_0x94bf('0x67')]);_0x28443b[_0x94bf('0x4a')]=qs[_0x94bf('0x43')](_[_0x94bf('0x4b')](_0x33cf02[_0x94bf('0x41')],_0xfc3db7[_0x94bf('0x43')]));if(_0x33cf02[_0x94bf('0x41')][_0x94bf('0x4c')]){_0x28443b[_0x94bf('0x4a')]=_[_0x94bf('0x4d')](_0x28443b[_0x94bf('0x4a')],{'$or':_['map'](_0x28443b[_0x94bf('0x45')],function(_0x521dc1){var _0x5827ff={};_0x5827ff[_0x521dc1]={'$like':'%'+_0x33cf02[_0x94bf('0x41')]['filter']+'%'};return _0x5827ff;})});}_0x28443b=_['merge']({},_0x28443b,_0x33cf02['options']);return _0x5decd3['getApplications'](_0x28443b);}})['then'](function(_0x427710){if(_0x427710){_0x431103=_0x427710['length'];if(!_0x33cf02[_0x94bf('0x41')][_0x94bf('0x48')](_0x94bf('0x66'))){_0x28443b[_0x94bf('0x2c')]=qs['limit'](_0x33cf02[_0x94bf('0x41')][_0x94bf('0x2c')]);_0x28443b[_0x94bf('0x29')]=qs[_0x94bf('0x29')](_0x33cf02[_0x94bf('0x41')]['offset']);}return _0x5decd3[_0x94bf('0xa4')](_0x28443b);}})[_0x94bf('0x30')](function(_0x69c34f){if(_0x69c34f){return _0x69c34f?{'count':_0x431103,'rows':_0x69c34f}:null;}})[_0x94bf('0x30')](respondWithResult(_0x15b711,null))[_0x94bf('0x58')](handleError(_0x15b711,null));};exports[_0x94bf('0xa5')]=function(_0x17e4d5,_0x473d3a,_0x19cc72){var _0x5f4078={'raw':![],'where':{}};var _0x2e12e7={};var _0x3d75b7={'count':0x0,'rows':[]};return db[_0x94bf('0x3c')][_0x94bf('0x9f')]({'where':{'id':_0x17e4d5['params']['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x473d3a,null))[_0x94bf('0x30')](function(_0x4624db){if(_0x4624db){_0x2e12e7['model']=_[_0x94bf('0x42')](db[_0x94bf('0x89')][_0x94bf('0x3d')]);_0x2e12e7[_0x94bf('0x41')]=_[_0x94bf('0x42')](_0x17e4d5['query']);_0x2e12e7['filters']=_[_0x94bf('0x44')](_0x2e12e7['model'],_0x2e12e7[_0x94bf('0x41')]);_0x5f4078[_0x94bf('0x45')]=_['intersection'](_0x2e12e7['model'],qs[_0x94bf('0x46')](_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x46')]));_0x5f4078[_0x94bf('0x45')]=_0x5f4078[_0x94bf('0x45')][_0x94bf('0x47')]?_0x5f4078[_0x94bf('0x45')]:_0x2e12e7[_0x94bf('0x40')];if(!_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x48')](_0x94bf('0x66'))){_0x5f4078['limit']=qs[_0x94bf('0x2c')](_0x17e4d5[_0x94bf('0x41')]['limit']);_0x5f4078[_0x94bf('0x29')]=qs['offset'](_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x29')]);}_0x5f4078[_0x94bf('0x49')]=qs[_0x94bf('0x67')](_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x67')]);_0x5f4078['where']=qs[_0x94bf('0x43')](_['pick'](_0x17e4d5[_0x94bf('0x41')],_0x2e12e7[_0x94bf('0x43')]));_0x5f4078[_0x94bf('0x4a')][_0x94bf('0x63')]=_0x4624db['id'];if(_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x4c')]){_0x5f4078['where']=_[_0x94bf('0x4d')](_0x5f4078[_0x94bf('0x4a')],{'$or':_[_0x94bf('0x3b')](_0x5f4078[_0x94bf('0x45')],function(_0x326bd6){var _0x2d2b52={};_0x2d2b52[_0x326bd6]={'$like':'%'+_0x17e4d5['query']['filter']+'%'};return _0x2d2b52;})});}_0x5f4078=_[_0x94bf('0x4d')]({},_0x5f4078,_0x17e4d5[_0x94bf('0x50')]);return db['OpenchannelInteraction'][_0x94bf('0x2b')]({'where':_0x5f4078['where']})['then'](function(_0x17c1ba){_0x3d75b7['count']=_0x17c1ba;if(_0x17e4d5[_0x94bf('0x41')][_0x94bf('0x51')]){_0x5f4078[_0x94bf('0x52')]=[{'model':db[_0x94bf('0x6f')],'as':_0x94bf('0xa6'),'required':![]},{'model':db[_0x94bf('0x95')],'as':'Owner','attributes':['name',_0x94bf('0xa7'),_0x94bf('0xa8')],'required':![]},{'model':db[_0x94bf('0xa9')],'as':_0x94bf('0xaa'),'attributes':['id',_0x94bf('0x36'),_0x94bf('0xab')],'where':_0x17e4d5['query'][_0x94bf('0xac')]?{'id':_0x17e4d5[_0x94bf('0x41')]['tag']}:undefined,'required':_0x17e4d5[_0x94bf('0x41')]['tag']?!![]:![]}];}return db[_0x94bf('0x89')]['findAll'](_0x5f4078);})[_0x94bf('0x30')](function(_0x8afb04){_0x3d75b7['rows']=_0x8afb04;return _0x3d75b7;});}})[_0x94bf('0x30')](respondWithFilteredResult(_0x473d3a,_0x5f4078))[_0x94bf('0x58')](handleError(_0x473d3a,null));};exports[_0x94bf('0xad')]=function(_0x38c680,_0x7b2698,_0x5aba3f){return db[_0x94bf('0x3c')]['find']({'where':{'id':_0x38c680[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x7b2698,null))[_0x94bf('0x30')](function(_0x5a5f94){if(_0x5a5f94){return _0x5a5f94[_0x94bf('0xad')](_0x38c680[_0x94bf('0x5a')][_0x94bf('0x69')],_[_0x94bf('0xae')](_0x38c680['body'],[_0x94bf('0x69'),'id'])||{})['spread'](function(_0x571e14){for(var _0x3fc73f=0x0;_0x3fc73f<_0x38c680[_0x94bf('0x5a')][_0x94bf('0x69')][_0x94bf('0x47')];_0x3fc73f+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x38c680[_0x94bf('0x5a')][_0x94bf('0x69')][_0x3fc73f]),'OpenchannelAccountId':Number(_0x38c680[_0x94bf('0x56')]['id'])});}return _0x571e14;});}})[_0x94bf('0x30')](respondWithResult(_0x7b2698,null))['catch'](handleError(_0x7b2698,null));};exports[_0x94bf('0xaf')]=function(_0x2524dd,_0x377cc9,_0x2559c8){return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x2524dd[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x377cc9,null))[_0x94bf('0x30')](function(_0xe34282){if(_0xe34282){return _0xe34282[_0x94bf('0xaf')](_0x2524dd[_0x94bf('0x41')][_0x94bf('0x69')])['then'](function(){if(_[_0x94bf('0xb0')](_0x2524dd[_0x94bf('0x41')][_0x94bf('0x69')])){for(var _0x39ed51=0x0;_0x39ed51<_0x2524dd[_0x94bf('0x41')][_0x94bf('0x69')][_0x94bf('0x47')];_0x39ed51+=0x1){socket['emit'](_0x94bf('0xb1'),{'UserId':Number(_0x2524dd['query'][_0x94bf('0x69')][_0x39ed51]),'OpenchannelAccountId':Number(_0x2524dd['params']['id'])});}}else{socket[_0x94bf('0xb2')](_0x94bf('0xb1'),{'UserId':Number(_0x2524dd[_0x94bf('0x41')][_0x94bf('0x69')]),'OpenchannelAccountId':Number(_0x2524dd[_0x94bf('0x56')]['id'])});}});}})[_0x94bf('0x30')](respondWithStatusCode(_0x377cc9,null))['catch'](handleError(_0x377cc9,null));};exports['getAgents']=function(_0x2162de,_0x53ce4a,_0x839e4a){var _0x1291b4={};var _0x299b54={};var _0x362376;var _0x33515e;return db[_0x94bf('0x3c')][_0x94bf('0x9f')]({'where':{'id':_0x2162de[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x53ce4a,null))[_0x94bf('0x30')](function(_0x37f716){if(_0x37f716){_0x362376=_0x37f716;_0x299b54['model']=_[_0x94bf('0x42')](db[_0x94bf('0x95')][_0x94bf('0x3d')]);_0x299b54[_0x94bf('0x41')]=_['keys'](_0x2162de['query']);_0x299b54['filters']=_[_0x94bf('0x44')](_0x299b54[_0x94bf('0x40')],_0x299b54['query']);_0x1291b4[_0x94bf('0x45')]=_['intersection'](_0x299b54[_0x94bf('0x40')],qs[_0x94bf('0x46')](_0x2162de[_0x94bf('0x41')][_0x94bf('0x46')]));_0x1291b4[_0x94bf('0x45')]=_0x1291b4[_0x94bf('0x45')][_0x94bf('0x47')]?_0x1291b4[_0x94bf('0x45')]:_0x299b54[_0x94bf('0x40')];_0x1291b4[_0x94bf('0x49')]=qs[_0x94bf('0x67')](_0x2162de[_0x94bf('0x41')][_0x94bf('0x67')]);_0x1291b4['where']=qs['filters'](_[_0x94bf('0x4b')](_0x2162de[_0x94bf('0x41')],_0x299b54[_0x94bf('0x43')]));if(_0x2162de[_0x94bf('0x41')][_0x94bf('0x4c')]){_0x1291b4[_0x94bf('0x4a')]=_[_0x94bf('0x4d')](_0x1291b4[_0x94bf('0x4a')],{'$or':_[_0x94bf('0x3b')](_0x1291b4[_0x94bf('0x45')],function(_0x3735a1){var _0x4bd26e={};_0x4bd26e[_0x3735a1]={'$like':'%'+_0x2162de[_0x94bf('0x41')]['filter']+'%'};return _0x4bd26e;})});}_0x1291b4=_['merge']({},_0x1291b4,_0x2162de['options']);return _0x362376[_0x94bf('0xb3')](_0x1291b4);}})[_0x94bf('0x30')](function(_0xcf9568){if(_0xcf9568){_0x33515e=_0xcf9568[_0x94bf('0x47')];if(!_0x2162de[_0x94bf('0x41')][_0x94bf('0x48')]('nolimit')){_0x1291b4[_0x94bf('0x2c')]=qs[_0x94bf('0x2c')](_0x2162de[_0x94bf('0x41')][_0x94bf('0x2c')]);_0x1291b4[_0x94bf('0x29')]=qs[_0x94bf('0x29')](_0x2162de['query'][_0x94bf('0x29')]);}return _0x362376[_0x94bf('0xb3')](_0x1291b4);}})[_0x94bf('0x30')](function(_0x7db31c){if(_0x7db31c){return _0x7db31c?{'count':_0x33515e,'rows':_0x7db31c}:null;}})[_0x94bf('0x30')](respondWithResult(_0x53ce4a,null))['catch'](handleError(_0x53ce4a,null));};exports[_0x94bf('0x37')]=function(_0x5d327b,_0x147f60,_0x12918a){var _0x4bf1cd,_0x2ca325,_0x3b8235;if(_[_0x94bf('0x75')](_0x5d327b['body']['body'])||_0x5d327b['body']['body']===''){throw new db['Sequelize'][(_0x94bf('0x77'))](_0x94bf('0x79'));}if(_[_0x94bf('0x75')](_0x5d327b['body']['to'])){}_0x4bf1cd=_0x5d327b[_0x94bf('0x5a')]['to'];return db[_0x94bf('0x3c')][_0x94bf('0x9f')]({'where':{'id':_0x5d327b[_0x94bf('0x56')]['id']}})[_0x94bf('0x30')](handleEntityNotFound(_0x147f60,null))[_0x94bf('0x30')](function(_0x1ae61f){if(_0x1ae61f){return db[_0x94bf('0x3c')][_0x94bf('0x57')]({'where':{'id':_0x1ae61f['id']},'include':[{'model':db[_0x94bf('0x7c')],'as':_0x94bf('0x80'),'include':[{'model':db['CmContact'],'as':_0x94bf('0x7d'),'where':{[_0x1ae61f[_0x94bf('0x7a')]]:_0x4bf1cd},'limit':0x1,'order':[[_0x94bf('0x73'),_0x94bf('0xb4')]]}]}]})['then'](handleEntityNotFound(_0x147f60,null))[_0x94bf('0x30')](function(_0x1f27f2){if(_0x1f27f2&&_0x1f27f2[_0x94bf('0x80')]){_0x2ca325=_0x1f27f2['get']({'plain':!![]});if(_0x2ca325[_0x94bf('0x80')]&&_0x2ca325[_0x94bf('0x80')][_0x94bf('0x7d')][_0x94bf('0x47')]){return _0x2ca325['List'][_0x94bf('0x7d')][0x0];}return db[_0x94bf('0x6f')][_0x94bf('0x59')](_[_0x94bf('0x17')](_0x5d327b['body'],{'firstName':_0x4bf1cd,[_0x1f27f2[_0x94bf('0x7a')]]:_0x4bf1cd,'phone':_0x4bf1cd,'ListId':_0x2ca325['ListId']}));}})[_0x94bf('0x30')](handleEntityNotFound(_0x147f60,null))[_0x94bf('0x30')](function(_0x94c712){if(_0x94c712){_0x3b8235=_0x94c712;return db[_0x94bf('0x89')][_0x94bf('0x57')]({'where':{'ContactId':_0x3b8235['id'],'closed':![],'OpenchannelAccountId':_0x2ca325['id']}})[_0x94bf('0x30')](function(_0x4486a6){if(_0x4486a6){return[_0x4486a6,![]];}return db[_0x94bf('0x89')][_0x94bf('0x59')]({'UserId':_0x5d327b[_0x94bf('0x5b')]['id'],'ContactId':_0x3b8235['id'],'OpenchannelAccountId':_0x2ca325['id'],'lastMsgDirection':_0x94bf('0xb5'),'Messages':[_[_0x94bf('0x4d')](_0x5d327b[_0x94bf('0x5a')],{'read':![],'body':_0x5d327b['body']['body'],'OpenchannelAccountId':_0x2ca325['id'],'UserId':_0x5d327b[_0x94bf('0x5b')]['id'],'ContactId':_0x3b8235['id']})]},{'include':[{'model':db[_0x94bf('0x92')],'as':_0x94bf('0xb6')}]})[_0x94bf('0x30')](function(_0x69b219){return[_0x69b219,!![]];});});}})[_0x94bf('0xb7')](function(_0x142fd1,_0x379cdf){if(_0x379cdf){return _0x142fd1;}return db[_0x94bf('0x92')][_0x94bf('0x59')](_[_0x94bf('0x4d')](_0x5d327b[_0x94bf('0x5a')],{'read':![],'body':_0x5d327b[_0x94bf('0x5a')][_0x94bf('0x5a')],'OpenchannelAccountId':_0x2ca325['id'],'OpenchannelInteractionId':_0x142fd1['id'],'UserId':_0x5d327b[_0x94bf('0x5b')]['id'],'ContactId':_0x3b8235['id']}))['then'](function(_0x46e43a){_0x142fd1[_0x94bf('0xb8')]['Messages']=[];_0x142fd1['dataValues'][_0x94bf('0xb6')][_0x94bf('0x90')](_0x46e43a[_0x94bf('0xb8')]);return _0x142fd1;});});}})[_0x94bf('0x30')](respondWithResult(_0x147f60,null))[_0x94bf('0x58')](handleError(_0x147f60,null));}; \ No newline at end of file +var _0xa468=['jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','OpenchannelAccounts','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','destroy','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','keys','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','Applications','List','account','list','orderBy','applications','priority','asc','ListId','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','OpenchannelApplication','bulkCreate','getApplications','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','defaults','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelAccount.socket'];(function(_0x7fa1be,_0x1e8289){var _0x54e138=function(_0x1915c5){while(--_0x1915c5){_0x7fa1be['push'](_0x7fa1be['shift']());}};_0x54e138(++_0x1e8289);}(_0xa468,0x9f));var _0x8a46=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa468[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a46('0x0'));var zipdir=require(_0x8a46('0x1'));var jsonpatch=require(_0x8a46('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a46('0x3'));var Mustache=require('mustache');var util=require(_0x8a46('0x4'));var path=require('path');var sox=require(_0x8a46('0x5'));var csv=require('to-csv');var ejs=require(_0x8a46('0x6'));var fs=require('fs');var fs_extra=require(_0x8a46('0x7'));var _=require(_0x8a46('0x8'));var squel=require(_0x8a46('0x9'));var crypto=require(_0x8a46('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8a46('0xb'));var toCsv=require(_0x8a46('0xc'));var querystring=require(_0x8a46('0xd'));var Papa=require(_0x8a46('0xe'));var Redis=require(_0x8a46('0xf'));var authService=require(_0x8a46('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8a46('0x11'));var hardwareService=require(_0x8a46('0x12'));var logger=require(_0x8a46('0x13'))(_0x8a46('0x14'));var utils=require(_0x8a46('0x15'));var config=require(_0x8a46('0x16'));var licenseUtil=require(_0x8a46('0x17'));var db=require(_0x8a46('0x18'))['db'];config[_0x8a46('0x19')]=_['defaults'](config[_0x8a46('0x19')],{'host':_0x8a46('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a46('0x19')]));require(_0x8a46('0x1b'))['register'](socket);var jayson=require(_0x8a46('0x1c'));var client=jayson[_0x8a46('0x1d')][_0x8a46('0x1e')]({'port':0x232c});var client9002=jayson[_0x8a46('0x1d')][_0x8a46('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x37bd2a,_0x5cbc9f,_0x2910c6,_0xaaea74){return new BPromise(function(_0x501c8c,_0x3f2e12){var _0x16ba36=_0xaaea74||client;return _0x16ba36[_0x8a46('0x1f')](_0x37bd2a,_0x2910c6)[_0x8a46('0x20')](function(_0x2a3f21){logger[_0x8a46('0x21')](_0x8a46('0x22'),_0x5cbc9f,'request\x20sent');logger['debug'](_0x8a46('0x23'),_0x5cbc9f,'request\x20sent',JSON['stringify'](_0x2a3f21));if(_0x2a3f21[_0x8a46('0x24')]){if(_0x2a3f21[_0x8a46('0x24')][_0x8a46('0x25')]===0x1f4){logger[_0x8a46('0x24')](_0x8a46('0x22'),_0x5cbc9f,_0x2a3f21[_0x8a46('0x24')][_0x8a46('0x26')]);return _0x3f2e12(_0x2a3f21[_0x8a46('0x24')][_0x8a46('0x26')]);}logger[_0x8a46('0x24')](_0x8a46('0x22'),_0x5cbc9f,_0x2a3f21[_0x8a46('0x24')]['message']);return _0x501c8c(_0x2a3f21['error']['message']);}else{logger[_0x8a46('0x21')](_0x8a46('0x22'),_0x5cbc9f,_0x8a46('0x27'));_0x501c8c(_0x2a3f21['result'][_0x8a46('0x26')]);}})[_0x8a46('0x28')](function(_0x5a5f72){logger['error'](_0x8a46('0x22'),_0x5cbc9f,_0x5a5f72);_0x3f2e12(_0x5a5f72);});});}function respondWithStatusCode(_0x317c8d,_0x3cb369){_0x3cb369=_0x3cb369||0xcc;return function(_0x2a1e5a){if(_0x2a1e5a){return _0x317c8d[_0x8a46('0x29')](_0x3cb369);}return _0x317c8d['status'](_0x3cb369)[_0x8a46('0x2a')]();};}function respondWithResult(_0x33ca61,_0x388ce1){_0x388ce1=_0x388ce1||0xc8;return function(_0x334c5d){if(_0x334c5d){return _0x33ca61[_0x8a46('0x2b')](_0x388ce1)[_0x8a46('0x2c')](_0x334c5d);}};}function respondWithFilteredResult(_0x1c6088,_0x3c2e49){return function(_0x5e51e9){if(_0x5e51e9){var _0x1adf5e=typeof _0x3c2e49[_0x8a46('0x2d')]===_0x8a46('0x2e')&&typeof _0x3c2e49['limit']===_0x8a46('0x2e');var _0x36f750=_0x5e51e9[_0x8a46('0x2f')];var _0x4c1322=_0x1adf5e?0x0:_0x3c2e49[_0x8a46('0x2d')];var _0xd37729=_0x1adf5e?_0x5e51e9['count']:_0x3c2e49['offset']+_0x3c2e49[_0x8a46('0x30')];var _0xf4a69d;if(_0xd37729>=_0x36f750){_0xd37729=_0x36f750;_0xf4a69d=0xc8;}else{_0xf4a69d=0xce;}_0x1c6088[_0x8a46('0x2b')](_0xf4a69d);return _0x1c6088[_0x8a46('0x31')](_0x8a46('0x32'),_0x4c1322+'-'+_0xd37729+'/'+_0x36f750)[_0x8a46('0x2c')](_0x5e51e9);}return null;};}function patchUpdates(_0x2a7320){return function(_0x383a61){try{jsonpatch['apply'](_0x383a61,_0x2a7320,!![]);}catch(_0xed399f){return BPromise['reject'](_0xed399f);}return _0x383a61[_0x8a46('0x33')]();};}function saveUpdates(_0x1b87d6,_0x3add){return function(_0x3e1aac){if(_0x3e1aac){return _0x3e1aac[_0x8a46('0x34')](_0x1b87d6)[_0x8a46('0x20')](function(_0x3f2587){return _0x3f2587;});}return null;};}function removeEntity(_0x229605,_0x455f87){return function(_0xbbeae7){if(_0xbbeae7){return _0xbbeae7['destroy']()[_0x8a46('0x20')](function(){var _0x5ea4fe=_0xbbeae7['get']({'plain':!![]});var _0x3732f0=_0x8a46('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x3732f0,'resourceId':_0x5ea4fe['id']}})[_0x8a46('0x20')](function(){return _0xbbeae7;});})['then'](function(){_0x229605[_0x8a46('0x2b')](0xcc)[_0x8a46('0x2a')]();});}};}function handleEntityNotFound(_0x4f3017,_0x3af6e7){return function(_0x5cac9c){if(!_0x5cac9c){_0x4f3017[_0x8a46('0x29')](0x194);}return _0x5cac9c;};}function handleError(_0xafbdf5,_0x32385b){_0x32385b=_0x32385b||0x1f4;return function(_0x4bf9cd){logger[_0x8a46('0x24')](_0x4bf9cd[_0x8a46('0x36')]);if(_0x4bf9cd[_0x8a46('0x37')]){delete _0x4bf9cd[_0x8a46('0x37')];}_0xafbdf5['status'](_0x32385b)[_0x8a46('0x38')](_0x4bf9cd);};}exports[_0x8a46('0x39')]=function(_0x42ef98,_0x5c3452){var _0x49b2a7={'include':[{'model':db[_0x8a46('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1758e5={},_0x47c0a3={'count':0x0,'rows':[]};var _0x6edea=_['map'](db[_0x8a46('0x3b')][_0x8a46('0x3c')],function(_0x5d2652){return{'name':_0x5d2652[_0x8a46('0x3d')],'type':_0x5d2652[_0x8a46('0x3e')][_0x8a46('0x3f')]};});_0x1758e5[_0x8a46('0x40')]=_[_0x8a46('0x41')](_0x6edea,_0x8a46('0x37'));_0x1758e5[_0x8a46('0x42')]=_['keys'](_0x42ef98[_0x8a46('0x42')]);_0x1758e5[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x1758e5[_0x8a46('0x40')],_0x1758e5[_0x8a46('0x42')]);_0x49b2a7['attributes']=_[_0x8a46('0x44')](_0x1758e5[_0x8a46('0x40')],qs[_0x8a46('0x45')](_0x42ef98['query'][_0x8a46('0x45')]));_0x49b2a7[_0x8a46('0x46')]=_0x49b2a7[_0x8a46('0x46')]['length']?_0x49b2a7[_0x8a46('0x46')]:_0x1758e5[_0x8a46('0x40')];if(!_0x42ef98[_0x8a46('0x42')][_0x8a46('0x47')](_0x8a46('0x48'))){_0x49b2a7['limit']=qs[_0x8a46('0x30')](_0x42ef98[_0x8a46('0x42')][_0x8a46('0x30')]);_0x49b2a7[_0x8a46('0x2d')]=qs['offset'](_0x42ef98[_0x8a46('0x42')]['offset']);}_0x49b2a7[_0x8a46('0x49')]=qs[_0x8a46('0x4a')](_0x42ef98[_0x8a46('0x42')][_0x8a46('0x4a')]);_0x49b2a7['where']=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0x42ef98[_0x8a46('0x42')],_0x1758e5[_0x8a46('0x43')]),_0x6edea);if(_0x42ef98[_0x8a46('0x42')]['filter']){_0x49b2a7['where']=_[_0x8a46('0x4c')](_0x49b2a7[_0x8a46('0x4d')],{'$or':_[_0x8a46('0x41')](_0x6edea,function(_0xb79d25){if(_0xb79d25['type']!==_0x8a46('0x4e')){var _0x171607={};_0x171607[_0xb79d25['name']]={'$like':'%'+_0x42ef98[_0x8a46('0x42')][_0x8a46('0x4f')]+'%'};return _0x171607;}})});}_0x49b2a7=_['merge']({},_0x49b2a7,_0x42ef98[_0x8a46('0x50')]);var _0x48c4c9={'where':_0x49b2a7[_0x8a46('0x4d')]};return db['OpenchannelAccount']['count'](_0x48c4c9)[_0x8a46('0x20')](function(_0x21bf15){_0x47c0a3[_0x8a46('0x2f')]=_0x21bf15;if(_0x42ef98['query'][_0x8a46('0x51')]){_0x49b2a7[_0x8a46('0x52')]=[{'all':!![]}];}return db[_0x8a46('0x3b')][_0x8a46('0x53')](_0x49b2a7);})[_0x8a46('0x20')](function(_0x3aac75){_0x47c0a3[_0x8a46('0x54')]=_0x3aac75;return _0x47c0a3;})[_0x8a46('0x20')](respondWithFilteredResult(_0x5c3452,_0x49b2a7))['catch'](handleError(_0x5c3452,null));};exports[_0x8a46('0x55')]=function(_0x3f89a4,_0x41d4d4){var _0x111f31={'raw':![],'where':{'id':_0x3f89a4[_0x8a46('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ed992={};_0x3ed992['model']=_['keys'](db['OpenchannelAccount'][_0x8a46('0x3c')]);_0x3ed992['query']=_['keys'](_0x3f89a4[_0x8a46('0x42')]);_0x3ed992[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x3ed992[_0x8a46('0x40')],_0x3ed992[_0x8a46('0x42')]);_0x111f31[_0x8a46('0x46')]=_[_0x8a46('0x44')](_0x3ed992[_0x8a46('0x40')],qs[_0x8a46('0x45')](_0x3f89a4[_0x8a46('0x42')]['fields']));_0x111f31['attributes']=_0x111f31[_0x8a46('0x46')][_0x8a46('0x57')]?_0x111f31['attributes']:_0x3ed992[_0x8a46('0x40')];if(_0x3f89a4[_0x8a46('0x42')][_0x8a46('0x51')]){_0x111f31[_0x8a46('0x52')]=[{'all':!![]}];}_0x111f31=_[_0x8a46('0x4c')]({},_0x111f31,_0x3f89a4[_0x8a46('0x50')]);return db[_0x8a46('0x3b')][_0x8a46('0x58')](_0x111f31)['then'](handleEntityNotFound(_0x41d4d4,null))[_0x8a46('0x20')](respondWithResult(_0x41d4d4,null))[_0x8a46('0x28')](handleError(_0x41d4d4,null));};exports['create']=function(_0x590424,_0x79568c){return db['OpenchannelAccount'][_0x8a46('0x59')](_0x590424['body'],{})[_0x8a46('0x20')](function(_0x51d7f7){var _0x2dc0f1=_0x590424[_0x8a46('0x5a')]['get']({'plain':!![]});if(!_0x2dc0f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dc0f1['role']===_0x8a46('0x5a')){var _0x1a8807=_0x51d7f7[_0x8a46('0x5b')]({'plain':!![]});var _0x3e24bb='OpenchannelAccounts';return db[_0x8a46('0x5c')]['find']({'where':{'name':_0x3e24bb,'userProfileId':_0x2dc0f1[_0x8a46('0x5d')]},'raw':!![]})[_0x8a46('0x20')](function(_0x36b8e1){if(_0x36b8e1&&_0x36b8e1[_0x8a46('0x5e')]===0x0){return db[_0x8a46('0x5f')]['create']({'name':_0x1a8807[_0x8a46('0x37')],'resourceId':_0x1a8807['id'],'type':_0x36b8e1['name'],'sectionId':_0x36b8e1['id']},{})[_0x8a46('0x20')](function(){return _0x51d7f7;});}else{return _0x51d7f7;}})['catch'](function(_0x3bf317){logger[_0x8a46('0x24')](_0x8a46('0x60'),_0x3bf317);throw _0x3bf317;});}return _0x51d7f7;})[_0x8a46('0x20')](respondWithResult(_0x79568c,0xc9))[_0x8a46('0x28')](handleError(_0x79568c,null));};exports[_0x8a46('0x34')]=function(_0x71c4af,_0x4e46a8){if(_0x71c4af[_0x8a46('0x61')]['id']){delete _0x71c4af[_0x8a46('0x61')]['id'];}return db[_0x8a46('0x3b')][_0x8a46('0x58')]({'where':{'id':_0x71c4af['params']['id']},'include':[{'model':db['Pause'],'as':_0x8a46('0x62')}]})['then'](handleEntityNotFound(_0x4e46a8,null))[_0x8a46('0x20')](saveUpdates(_0x71c4af[_0x8a46('0x61')],null))[_0x8a46('0x20')](respondWithResult(_0x4e46a8,null))[_0x8a46('0x28')](handleError(_0x4e46a8,null));};exports[_0x8a46('0x63')]=function(_0x4f4205,_0x53c856){return db[_0x8a46('0x3b')]['find']({'where':{'id':_0x4f4205[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x53c856,null))[_0x8a46('0x20')](removeEntity(_0x53c856,null))[_0x8a46('0x28')](handleError(_0x53c856,null));};exports[_0x8a46('0x64')]=function(_0x2d47dc,_0x1edfb0){return db[_0x8a46('0x3b')][_0x8a46('0x64')]()[_0x8a46('0x20')](respondWithResult(_0x1edfb0,null))[_0x8a46('0x28')](handleError(_0x1edfb0,null));};exports[_0x8a46('0x65')]=function(_0x398e12,_0x387e80,_0x29efe3){if(_0x398e12[_0x8a46('0x61')]['id']){delete _0x398e12[_0x8a46('0x61')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x398e12[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x387e80,null))[_0x8a46('0x20')](function(_0x55380e){if(_0x55380e){_0x398e12[_0x8a46('0x61')][_0x8a46('0x66')]=_0x55380e['id'];return db[_0x8a46('0x67')][_0x8a46('0x59')](_0x398e12[_0x8a46('0x61')]);}})[_0x8a46('0x20')](respondWithResult(_0x387e80,null))[_0x8a46('0x28')](handleError(_0x387e80,null));};exports[_0x8a46('0x68')]=function(_0xd83350,_0x3048aa,_0x260763){var _0x1dd30e={'raw':![],'where':{}};var _0x2265e9={};var _0xba0a2f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8a46('0x69')]({'where':{'id':_0xd83350['params']['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x3048aa,null))[_0x8a46('0x20')](function(_0x3ad456){if(_0x3ad456){_0x2265e9[_0x8a46('0x40')]=_['keys'](db[_0x8a46('0x67')][_0x8a46('0x3c')]);_0x2265e9[_0x8a46('0x42')]=_[_0x8a46('0x6a')](_0xd83350[_0x8a46('0x42')]);_0x2265e9[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x2265e9[_0x8a46('0x40')],_0x2265e9[_0x8a46('0x42')]);_0x1dd30e['attributes']=_[_0x8a46('0x44')](_0x2265e9[_0x8a46('0x40')],qs[_0x8a46('0x45')](_0xd83350[_0x8a46('0x42')][_0x8a46('0x45')]));_0x1dd30e[_0x8a46('0x46')]=_0x1dd30e[_0x8a46('0x46')][_0x8a46('0x57')]?_0x1dd30e['attributes']:_0x2265e9[_0x8a46('0x40')];if(!_0xd83350['query'][_0x8a46('0x47')](_0x8a46('0x48'))){_0x1dd30e[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0xd83350[_0x8a46('0x42')][_0x8a46('0x30')]);_0x1dd30e[_0x8a46('0x2d')]=qs[_0x8a46('0x2d')](_0xd83350[_0x8a46('0x42')][_0x8a46('0x2d')]);}_0x1dd30e['order']=qs['sort'](_0xd83350[_0x8a46('0x42')][_0x8a46('0x4a')]);_0x1dd30e[_0x8a46('0x4d')]=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0xd83350[_0x8a46('0x42')],_0x2265e9['filters']));_0x1dd30e['where'][_0x8a46('0x66')]=_0x3ad456['id'];if(_0xd83350[_0x8a46('0x42')][_0x8a46('0x4f')]){_0x1dd30e[_0x8a46('0x4d')]=_['merge'](_0x1dd30e[_0x8a46('0x4d')],{'$or':_[_0x8a46('0x41')](_0x1dd30e[_0x8a46('0x46')],function(_0x456d10){var _0x2f06b7={};_0x2f06b7[_0x456d10]={'$like':'%'+_0xd83350['query'][_0x8a46('0x4f')]+'%'};return _0x2f06b7;})});}_0x1dd30e=_[_0x8a46('0x4c')]({},_0x1dd30e,_0xd83350[_0x8a46('0x50')]);return db[_0x8a46('0x67')][_0x8a46('0x2f')]({'where':_0x1dd30e[_0x8a46('0x4d')]})[_0x8a46('0x20')](function(_0x463cd0){_0xba0a2f['count']=_0x463cd0;if(_0xd83350[_0x8a46('0x42')][_0x8a46('0x51')]){_0x1dd30e['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1dd30e);})[_0x8a46('0x20')](function(_0x29ec4e){_0xba0a2f[_0x8a46('0x54')]=_0x29ec4e;return _0xba0a2f;});}})[_0x8a46('0x20')](respondWithFilteredResult(_0x3048aa,_0x1dd30e))['catch'](handleError(_0x3048aa,null));};exports[_0x8a46('0x6b')]=function(_0x2e0f25,_0x3be1cc,_0x56f7c1){return db[_0x8a46('0x3b')][_0x8a46('0x58')]({'where':{'id':_0x2e0f25[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x3be1cc,null))[_0x8a46('0x20')](function(_0x5ccb78){if(_0x5ccb78){return _0x5ccb78[_0x8a46('0x6b')](_0x2e0f25['query'][_0x8a46('0x6c')]);}})['then'](respondWithStatusCode(_0x3be1cc,null))[_0x8a46('0x28')](handleError(_0x3be1cc,null));};exports['addAnswer']=function(_0x471e4e,_0xeb10d,_0x50a583){if(_0x471e4e[_0x8a46('0x61')]['id']){delete _0x471e4e['body']['id'];}return db['OpenchannelAccount'][_0x8a46('0x58')]({'where':{'id':_0x471e4e[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0xeb10d,null))[_0x8a46('0x20')](function(_0x3654f8){if(_0x3654f8){_0x471e4e[_0x8a46('0x61')]['OpenchannelAccountId']=_0x3654f8['id'];return db[_0x8a46('0x6d')][_0x8a46('0x59')](_0x471e4e[_0x8a46('0x61')]);}})[_0x8a46('0x20')](respondWithResult(_0xeb10d,null))[_0x8a46('0x28')](handleError(_0xeb10d,null));};exports[_0x8a46('0x6e')]=function(_0x211cad,_0x4e7fb5,_0xc60265){var _0x283125={'raw':![],'where':{}};var _0x219f5d={};var _0x130d36={'count':0x0,'rows':[]};return db[_0x8a46('0x3b')]['findOne']({'where':{'id':_0x211cad[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x4e7fb5,null))['then'](function(_0x4aba7e){if(_0x4aba7e){_0x219f5d[_0x8a46('0x40')]=_[_0x8a46('0x6a')](db[_0x8a46('0x6d')][_0x8a46('0x3c')]);_0x219f5d[_0x8a46('0x42')]=_[_0x8a46('0x6a')](_0x211cad[_0x8a46('0x42')]);_0x219f5d[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x219f5d[_0x8a46('0x40')],_0x219f5d['query']);_0x283125[_0x8a46('0x46')]=_['intersection'](_0x219f5d[_0x8a46('0x40')],qs[_0x8a46('0x45')](_0x211cad[_0x8a46('0x42')]['fields']));_0x283125['attributes']=_0x283125[_0x8a46('0x46')]['length']?_0x283125[_0x8a46('0x46')]:_0x219f5d['model'];if(!_0x211cad['query'][_0x8a46('0x47')](_0x8a46('0x48'))){_0x283125[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x211cad[_0x8a46('0x42')][_0x8a46('0x30')]);_0x283125[_0x8a46('0x2d')]=qs[_0x8a46('0x2d')](_0x211cad[_0x8a46('0x42')][_0x8a46('0x2d')]);}_0x283125['order']=qs[_0x8a46('0x4a')](_0x211cad['query'][_0x8a46('0x4a')]);_0x283125[_0x8a46('0x4d')]=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0x211cad[_0x8a46('0x42')],_0x219f5d['filters']));_0x283125[_0x8a46('0x4d')]['OpenchannelAccountId']=_0x4aba7e['id'];if(_0x211cad[_0x8a46('0x42')]['filter']){_0x283125[_0x8a46('0x4d')]=_[_0x8a46('0x4c')](_0x283125['where'],{'$or':_[_0x8a46('0x41')](_0x283125[_0x8a46('0x46')],function(_0x13002a){var _0x54ea3d={};_0x54ea3d[_0x13002a]={'$like':'%'+_0x211cad['query'][_0x8a46('0x4f')]+'%'};return _0x54ea3d;})});}_0x283125=_[_0x8a46('0x4c')]({},_0x283125,_0x211cad[_0x8a46('0x50')]);return db[_0x8a46('0x6d')][_0x8a46('0x2f')]({'where':_0x283125[_0x8a46('0x4d')]})[_0x8a46('0x20')](function(_0x343faa){_0x130d36[_0x8a46('0x2f')]=_0x343faa;if(_0x211cad['query'][_0x8a46('0x51')]){_0x283125[_0x8a46('0x52')]=[{'all':!![]}];}return db[_0x8a46('0x6d')][_0x8a46('0x53')](_0x283125);})['then'](function(_0x2d6fc7){_0x130d36['rows']=_0x2d6fc7;return _0x130d36;});}})[_0x8a46('0x20')](respondWithFilteredResult(_0x4e7fb5,_0x283125))[_0x8a46('0x28')](handleError(_0x4e7fb5,null));};exports[_0x8a46('0x6f')]=function(_0x4cb2dc,_0x1441d1,_0x5bfe25){return db[_0x8a46('0x3b')]['find']({'where':{'id':_0x4cb2dc[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x1441d1,null))['then'](function(_0x1f4b80){if(_0x1f4b80){return _0x1f4b80[_0x8a46('0x6f')](_0x4cb2dc[_0x8a46('0x42')]['ids']);}})[_0x8a46('0x20')](respondWithStatusCode(_0x1441d1,null))['catch'](handleError(_0x1441d1,null));};exports[_0x8a46('0x70')]=function(_0x3ec7f3,_0x4f5d70,_0x33c940){var _0xf73174={'body':_0x3ec7f3['body'],'channel':_0x8a46('0x71')};var _0xbf7088=[];var _0xfb218c=[];var _0x3811a0={};var _0x8556a6=![];return db[_0x8a46('0x72')][_0x8a46('0x64')]()['then'](function(_0x19987d){if(!_0x19987d){throw new db[(_0x8a46('0x73'))][(_0x8a46('0x74'))]('no\x20available\x20attributes');}_0xbf7088=_['difference'](_['keys'](_0x19987d),[_0x8a46('0x75'),_0x8a46('0x76')]);_0xfb218c=_[_0x8a46('0x77')](_[_0x8a46('0x6a')](_0x19987d),['createdAt',_0x8a46('0x76'),_0x8a46('0x78'),'ListId']);if(_0x3ec7f3['body']['id']){delete _0x3ec7f3[_0x8a46('0x61')]['id'];}if(_[_0x8a46('0x79')](_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x7a')])){throw new db['Sequelize']['ValidationError'](_0x8a46('0x7b'));}if(_[_0x8a46('0x79')](_0x3ec7f3[_0x8a46('0x61')]['body'])||_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x61')]===''){throw new db[(_0x8a46('0x73'))]['ValidationError'](_0x8a46('0x7c'));}if(_[_0x8a46('0x79')](_0x3ec7f3['body'][_0x8a46('0x7d')])){throw new db[(_0x8a46('0x73'))][(_0x8a46('0x74'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xfb218c);}if(!_[_0x8a46('0x7e')](_0xfb218c,_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x7d')])){throw new db['Sequelize']['ValidationError'](_0x8a46('0x7f')+_0xfb218c);}_0x3811a0[_0x3ec7f3['body'][_0x8a46('0x7d')]]=_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x7a')];})[_0x8a46('0x20')](function(){return db[_0x8a46('0x3b')][_0x8a46('0x58')]({'where':{'id':_0x3ec7f3[_0x8a46('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x8a46('0x80'),'where':_0x3811a0,'limit':0x1,'order':[['updatedAt',_0x8a46('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0x8a46('0x82')}]});})[_0x8a46('0x20')](handleEntityNotFound(_0x4f5d70,null))[_0x8a46('0x20')](function(_0x40335e){if(_0x40335e&&_0x40335e[_0x8a46('0x83')]){_0xf73174[_0x8a46('0x84')]=_0x40335e;_0xf73174['applications']=_0x40335e[_0x8a46('0x82')];_0xf73174[_0x8a46('0x85')]=_0x40335e[_0x8a46('0x83')];_0xf73174['applications']=_[_0x8a46('0x86')](_0xf73174[_0x8a46('0x87')],[_0x8a46('0x88')],[_0x8a46('0x89')]);if(_0xf73174[_0x8a46('0x84')][_0x8a46('0x82')]){delete _0xf73174[_0x8a46('0x84')][_0x8a46('0x82')];}if(_0xf73174[_0x8a46('0x84')]['List']&&_0xf73174['account'][_0x8a46('0x83')]['Contacts']['length']){return _0xf73174[_0x8a46('0x84')]['List'][_0x8a46('0x80')][0x0];}var _0x127449=_['defaults'](_0x3ec7f3[_0x8a46('0x61')],{'firstName':_0x3ec7f3[_0x8a46('0x61')]['from'],'ListId':_0x40335e[_0x8a46('0x8a')]});_0x127449[_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x7d')]]=_0x3ec7f3[_0x8a46('0x61')]['from'];return db[_0x8a46('0x72')][_0x8a46('0x59')](_0x127449,{'fields':_0xbf7088,'raw':!![]});}})['then'](handleEntityNotFound(_0x4f5d70,null))[_0x8a46('0x20')](function(_0x462565){_0xf73174[_0x8a46('0x8b')]=_0x462565;if(_0x462565){var _0x34f23d={'ContactId':_0x462565['id'],'OpenchannelAccountId':_0x3ec7f3[_0x8a46('0x56')]['id'],'from':(_0x462565[_0x8a46('0x8c')]||'')+'\x20'+(_0x462565[_0x8a46('0x8d')]||'')};var _0x1bce3d={'OpenchannelAccountId':_0x3ec7f3[_0x8a46('0x56')]['id'],'closed':![]};if(_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x8e')]){_0x1bce3d[_0x8a46('0x8e')]=_0x3ec7f3[_0x8a46('0x61')]['threadId'];return db['OpenchannelInteraction'][_0x8a46('0x58')]({'where':_0x1bce3d})[_0x8a46('0x20')](function(_0x577699){if(_0x577699){return[_0x577699,![]];}_0x34f23d['threadId']=_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x8e')];_0x34f23d[_0x8a46('0x8f')]=_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x8f')];return db['OpenchannelInteraction'][_0x8a46('0x59')](_0x34f23d)[_0x8a46('0x20')](function(_0x34c5a6){return[_0x34c5a6,!![]];});});}else{_0x1bce3d[_0x8a46('0x8e')]=null;}_0x1bce3d[_0x8a46('0x90')]=_0x462565['id'];return db[_0x8a46('0x91')]['find']({'where':_0x1bce3d})[_0x8a46('0x20')](function(_0x319cde){if(_0x319cde){return[_0x319cde,![]];}return db[_0x8a46('0x91')][_0x8a46('0x59')](_0x34f23d)[_0x8a46('0x20')](function(_0x5d1eb1){return[_0x5d1eb1,!![]];});});}})[_0x8a46('0x92')](function(_0x3f8a69,_0x307b9e){if(_0x3f8a69){_0x8556a6=_0x307b9e;if(!_0x307b9e){var _0x3a1d7c={'from':(_0xf73174[_0x8a46('0x8b')][_0x8a46('0x8c')]||'')+'\x20'+(_0xf73174[_0x8a46('0x8b')][_0x8a46('0x8d')]||'')};if(_0x3ec7f3['body'][_0x8a46('0x8e')]&&_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x93')]&&_0x3ec7f3[_0x8a46('0x61')]['threadId']!=_0x3ec7f3['body'][_0x8a46('0x93')]){_0x3a1d7c['threadId']=_0x3ec7f3[_0x8a46('0x61')]['messageId'];}return _0x3f8a69[_0x8a46('0x34')](_0x3a1d7c);}else{return _0x3f8a69;}}})['then'](function(_0x384c8d){_0xf73174[_0x8a46('0x94')]=_0x384c8d[_0x8a46('0x5b')]({'plain':!![]});_0xf73174[_0x8a46('0x94')][_0x8a46('0x95')]=_0x8556a6;if(_0xf73174[_0x8a46('0x94')]['created']){if(_0xf73174[_0x8a46('0x84')][_0x8a46('0x96')]){_0xf73174['applications']['push']({'id':0x0,'priority':_0xf73174[_0x8a46('0x87')][_0x8a46('0x57')]+0x1,'app':_0x8a46('0x97'),'appdata':_0x8a46('0x98'),'interval':_0x8a46('0x99')});}}return db[_0x8a46('0x9a')][_0x8a46('0x59')]({'body':_0x3ec7f3[_0x8a46('0x61')]['body'],'OpenchannelAccountId':_0x3ec7f3['params']['id'],'OpenchannelInteractionId':_0x384c8d['id'],'direction':'in','ContactId':_0xf73174[_0x8a46('0x8b')]['id'],'AttachmentId':_0x3ec7f3[_0x8a46('0x61')][_0x8a46('0x9b')]});})['then'](function(_0x542e87){_0xf73174['message']=_0x542e87;if(_0xf73174[_0x8a46('0x94')]['UserId']){return db[_0x8a46('0x9c')][_0x8a46('0x58')]({'attributes':['id',_0x8a46('0x37')],'where':{'id':_0xf73174[_0x8a46('0x94')][_0x8a46('0x9d')]}})[_0x8a46('0x20')](function(_0x344a99){if(_0x344a99){_0xf73174[_0x8a46('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x344a99[_0x8a46('0x37')]+','+(_0xf73174[_0x8a46('0x84')][_0x8a46('0x9e')]||0xa),'interval':_0x8a46('0x99')});_0xf73174[_0x8a46('0x9f')]=![];}return respondWithRpcPromise(_0x8a46('0xa0'),'startRouting',_0xf73174);});}return respondWithRpcPromise(_0x8a46('0xa0'),_0x8a46('0xa1'),_0xf73174);})[_0x8a46('0x20')](function(_0x4f8a87){respondWithRpcPromise(_0x8a46('0xa2'),_0x8a46('0xa2'),{'event':_0x8a46('0x70'),'message':_0x4f8a87},client9002);return _0x4f8a87;})[_0x8a46('0x20')](respondWithResult(_0x4f5d70,null))[_0x8a46('0x28')](handleError(_0x4f5d70,null));};exports['addApplications']=function(_0x168161,_0x2fdbb9,_0x4d2f81){return db[_0x8a46('0x3b')][_0x8a46('0x69')]({'where':{'id':_0x168161['params']['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x2fdbb9,null))[_0x8a46('0x20')](function(_0x1da933){if(_0x1da933){return db[_0x8a46('0xa3')]['transaction'](function(_0x1b2309){return db[_0x8a46('0xa4')][_0x8a46('0x63')]({'where':{'OpenchannelAccountId':_0x168161['params']['id']},'transaction':_0x1b2309})['then'](function(_0x252ed4){var _0x2eff5f=_[_0x8a46('0x41')](_0x168161[_0x8a46('0x61')],function(_0x3947ee){_0x3947ee['OpenchannelAccountId']=_0x168161[_0x8a46('0x56')]['id'];return _0x3947ee;});return db[_0x8a46('0xa4')][_0x8a46('0xa5')](_0x2eff5f,{'transaction':_0x1b2309});});})[_0x8a46('0x20')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x168161[_0x8a46('0x56')]['id']},'order':_0x8a46('0x88')});});}})['then'](respondWithResult(_0x2fdbb9,null))[_0x8a46('0x28')](handleError(_0x2fdbb9,null));};exports[_0x8a46('0xa6')]=function(_0x362e49,_0x426370,_0x40901a){var _0x48bc40={};var _0x4f536d={};var _0x539dab;var _0x4fbfb5;return db['OpenchannelAccount'][_0x8a46('0x69')]({'where':{'id':_0x362e49[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x426370,null))[_0x8a46('0x20')](function(_0x4fd35e){if(_0x4fd35e){_0x539dab=_0x4fd35e;_0x4f536d['model']=_['keys'](db[_0x8a46('0xa4')]['rawAttributes']);_0x4f536d[_0x8a46('0x42')]=_[_0x8a46('0x6a')](_0x362e49['query']);_0x4f536d[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x4f536d[_0x8a46('0x40')],_0x4f536d[_0x8a46('0x42')]);_0x48bc40['attributes']=_[_0x8a46('0x44')](_0x4f536d['model'],qs[_0x8a46('0x45')](_0x362e49[_0x8a46('0x42')]['fields']));_0x48bc40[_0x8a46('0x46')]=_0x48bc40[_0x8a46('0x46')][_0x8a46('0x57')]?_0x48bc40[_0x8a46('0x46')]:_0x4f536d['model'];_0x48bc40[_0x8a46('0x49')]=qs[_0x8a46('0x4a')](_0x362e49[_0x8a46('0x42')][_0x8a46('0x4a')]);_0x48bc40['where']=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0x362e49[_0x8a46('0x42')],_0x4f536d[_0x8a46('0x43')]));if(_0x362e49['query']['filter']){_0x48bc40['where']=_[_0x8a46('0x4c')](_0x48bc40[_0x8a46('0x4d')],{'$or':_[_0x8a46('0x41')](_0x48bc40['attributes'],function(_0x494f86){var _0xd081fa={};_0xd081fa[_0x494f86]={'$like':'%'+_0x362e49[_0x8a46('0x42')]['filter']+'%'};return _0xd081fa;})});}_0x48bc40=_[_0x8a46('0x4c')]({},_0x48bc40,_0x362e49['options']);return _0x539dab[_0x8a46('0xa6')](_0x48bc40);}})[_0x8a46('0x20')](function(_0x404a86){if(_0x404a86){_0x4fbfb5=_0x404a86[_0x8a46('0x57')];if(!_0x362e49['query'][_0x8a46('0x47')](_0x8a46('0x48'))){_0x48bc40['limit']=qs[_0x8a46('0x30')](_0x362e49['query']['limit']);_0x48bc40['offset']=qs['offset'](_0x362e49[_0x8a46('0x42')]['offset']);}return _0x539dab[_0x8a46('0xa6')](_0x48bc40);}})['then'](function(_0x5074ab){if(_0x5074ab){return _0x5074ab?{'count':_0x4fbfb5,'rows':_0x5074ab}:null;}})[_0x8a46('0x20')](respondWithResult(_0x426370,null))[_0x8a46('0x28')](handleError(_0x426370,null));};exports['getInteractions']=function(_0x12225f,_0x2f7268,_0x2844c2){var _0x5848fa={'raw':![],'where':{}};var _0x4bff15={};var _0x22b3da={'count':0x0,'rows':[]};return db[_0x8a46('0x3b')][_0x8a46('0x69')]({'where':{'id':_0x12225f['params']['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x2f7268,null))[_0x8a46('0x20')](function(_0x242f82){if(_0x242f82){_0x4bff15['model']=_[_0x8a46('0x6a')](db[_0x8a46('0x91')][_0x8a46('0x3c')]);_0x4bff15[_0x8a46('0x42')]=_[_0x8a46('0x6a')](_0x12225f[_0x8a46('0x42')]);_0x4bff15[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x4bff15[_0x8a46('0x40')],_0x4bff15[_0x8a46('0x42')]);_0x5848fa['attributes']=_['intersection'](_0x4bff15[_0x8a46('0x40')],qs['fields'](_0x12225f[_0x8a46('0x42')][_0x8a46('0x45')]));_0x5848fa[_0x8a46('0x46')]=_0x5848fa['attributes']['length']?_0x5848fa[_0x8a46('0x46')]:_0x4bff15[_0x8a46('0x40')];if(!_0x12225f['query'][_0x8a46('0x47')]('nolimit')){_0x5848fa[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x12225f[_0x8a46('0x42')][_0x8a46('0x30')]);_0x5848fa[_0x8a46('0x2d')]=qs['offset'](_0x12225f['query'][_0x8a46('0x2d')]);}_0x5848fa[_0x8a46('0x49')]=qs[_0x8a46('0x4a')](_0x12225f['query'][_0x8a46('0x4a')]);_0x5848fa[_0x8a46('0x4d')]=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0x12225f[_0x8a46('0x42')],_0x4bff15['filters']));_0x5848fa[_0x8a46('0x4d')][_0x8a46('0x66')]=_0x242f82['id'];if(_0x12225f[_0x8a46('0x42')][_0x8a46('0x4f')]){_0x5848fa['where']=_[_0x8a46('0x4c')](_0x5848fa[_0x8a46('0x4d')],{'$or':_[_0x8a46('0x41')](_0x5848fa[_0x8a46('0x46')],function(_0x50deaf){var _0x4a0181={};_0x4a0181[_0x50deaf]={'$like':'%'+_0x12225f[_0x8a46('0x42')][_0x8a46('0x4f')]+'%'};return _0x4a0181;})});}_0x5848fa=_['merge']({},_0x5848fa,_0x12225f[_0x8a46('0x50')]);return db[_0x8a46('0x91')][_0x8a46('0x2f')]({'where':_0x5848fa[_0x8a46('0x4d')]})[_0x8a46('0x20')](function(_0x13ea84){_0x22b3da['count']=_0x13ea84;if(_0x12225f['query']['includeAll']){_0x5848fa[_0x8a46('0x52')]=[{'model':db[_0x8a46('0x72')],'as':_0x8a46('0xa7'),'required':![]},{'model':db[_0x8a46('0x9c')],'as':_0x8a46('0xa8'),'attributes':[_0x8a46('0x37'),_0x8a46('0xa9'),_0x8a46('0xaa')],'required':![]},{'model':db[_0x8a46('0xab')],'as':_0x8a46('0xac'),'attributes':['id',_0x8a46('0x37'),'color'],'where':_0x12225f['query'][_0x8a46('0xad')]?{'id':_0x12225f[_0x8a46('0x42')][_0x8a46('0xad')]}:undefined,'required':_0x12225f[_0x8a46('0x42')][_0x8a46('0xad')]?!![]:![]}];}return db[_0x8a46('0x91')][_0x8a46('0x53')](_0x5848fa);})[_0x8a46('0x20')](function(_0x2e42ef){_0x22b3da['rows']=_0x2e42ef;return _0x22b3da;});}})[_0x8a46('0x20')](respondWithFilteredResult(_0x2f7268,_0x5848fa))[_0x8a46('0x28')](handleError(_0x2f7268,null));};exports[_0x8a46('0xae')]=function(_0x3dddf4,_0x44e2f4,_0x4f7fe7){return db[_0x8a46('0x3b')][_0x8a46('0x58')]({'where':{'id':_0x3dddf4['params']['id']}})['then'](handleEntityNotFound(_0x44e2f4,null))[_0x8a46('0x20')](function(_0x33c5af){if(_0x33c5af){return _0x33c5af[_0x8a46('0xae')](_0x3dddf4[_0x8a46('0x61')][_0x8a46('0x6c')],_[_0x8a46('0xaf')](_0x3dddf4['body'],[_0x8a46('0x6c'),'id'])||{})[_0x8a46('0x92')](function(_0x414100){for(var _0x58a09f=0x0;_0x58a09f<_0x3dddf4[_0x8a46('0x61')]['ids']['length'];_0x58a09f+=0x1){socket[_0x8a46('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x3dddf4['body'][_0x8a46('0x6c')][_0x58a09f]),'OpenchannelAccountId':Number(_0x3dddf4[_0x8a46('0x56')]['id'])});}return _0x414100;});}})['then'](respondWithResult(_0x44e2f4,null))['catch'](handleError(_0x44e2f4,null));};exports[_0x8a46('0xb1')]=function(_0x4cc0ec,_0x81cca1,_0x4ce232){return db[_0x8a46('0x3b')]['find']({'where':{'id':_0x4cc0ec[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x81cca1,null))[_0x8a46('0x20')](function(_0x29644f){if(_0x29644f){return _0x29644f['removeAgents'](_0x4cc0ec[_0x8a46('0x42')][_0x8a46('0x6c')])['then'](function(){if(_[_0x8a46('0xb2')](_0x4cc0ec['query']['ids'])){for(var _0x586424=0x0;_0x586424<_0x4cc0ec[_0x8a46('0x42')][_0x8a46('0x6c')][_0x8a46('0x57')];_0x586424+=0x1){socket[_0x8a46('0xb0')](_0x8a46('0xb3'),{'UserId':Number(_0x4cc0ec[_0x8a46('0x42')][_0x8a46('0x6c')][_0x586424]),'OpenchannelAccountId':Number(_0x4cc0ec[_0x8a46('0x56')]['id'])});}}else{socket[_0x8a46('0xb0')](_0x8a46('0xb3'),{'UserId':Number(_0x4cc0ec[_0x8a46('0x42')][_0x8a46('0x6c')]),'OpenchannelAccountId':Number(_0x4cc0ec[_0x8a46('0x56')]['id'])});}});}})[_0x8a46('0x20')](respondWithStatusCode(_0x81cca1,null))[_0x8a46('0x28')](handleError(_0x81cca1,null));};exports[_0x8a46('0xb4')]=function(_0x11b02c,_0x4d9de2,_0x188746){var _0x837955={};var _0x1d500a={};var _0x567975;var _0x11241f;return db[_0x8a46('0x3b')][_0x8a46('0x69')]({'where':{'id':_0x11b02c[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x4d9de2,null))['then'](function(_0x794c14){if(_0x794c14){_0x567975=_0x794c14;_0x1d500a['model']=_[_0x8a46('0x6a')](db[_0x8a46('0x9c')][_0x8a46('0x3c')]);_0x1d500a[_0x8a46('0x42')]=_['keys'](_0x11b02c['query']);_0x1d500a[_0x8a46('0x43')]=_[_0x8a46('0x44')](_0x1d500a[_0x8a46('0x40')],_0x1d500a['query']);_0x837955[_0x8a46('0x46')]=_[_0x8a46('0x44')](_0x1d500a[_0x8a46('0x40')],qs[_0x8a46('0x45')](_0x11b02c['query'][_0x8a46('0x45')]));_0x837955['attributes']=_0x837955[_0x8a46('0x46')][_0x8a46('0x57')]?_0x837955[_0x8a46('0x46')]:_0x1d500a[_0x8a46('0x40')];_0x837955[_0x8a46('0x49')]=qs[_0x8a46('0x4a')](_0x11b02c[_0x8a46('0x42')]['sort']);_0x837955[_0x8a46('0x4d')]=qs[_0x8a46('0x43')](_[_0x8a46('0x4b')](_0x11b02c[_0x8a46('0x42')],_0x1d500a[_0x8a46('0x43')]));if(_0x11b02c[_0x8a46('0x42')][_0x8a46('0x4f')]){_0x837955[_0x8a46('0x4d')]=_['merge'](_0x837955[_0x8a46('0x4d')],{'$or':_['map'](_0x837955[_0x8a46('0x46')],function(_0x4cf616){var _0xc4b773={};_0xc4b773[_0x4cf616]={'$like':'%'+_0x11b02c['query'][_0x8a46('0x4f')]+'%'};return _0xc4b773;})});}_0x837955=_[_0x8a46('0x4c')]({},_0x837955,_0x11b02c['options']);return _0x567975[_0x8a46('0xb4')](_0x837955);}})[_0x8a46('0x20')](function(_0x303c04){if(_0x303c04){_0x11241f=_0x303c04['length'];if(!_0x11b02c[_0x8a46('0x42')][_0x8a46('0x47')](_0x8a46('0x48'))){_0x837955[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x11b02c[_0x8a46('0x42')][_0x8a46('0x30')]);_0x837955[_0x8a46('0x2d')]=qs[_0x8a46('0x2d')](_0x11b02c[_0x8a46('0x42')][_0x8a46('0x2d')]);}return _0x567975[_0x8a46('0xb4')](_0x837955);}})[_0x8a46('0x20')](function(_0x29231a){if(_0x29231a){return _0x29231a?{'count':_0x11241f,'rows':_0x29231a}:null;}})['then'](respondWithResult(_0x4d9de2,null))[_0x8a46('0x28')](handleError(_0x4d9de2,null));};exports['send']=function(_0x3acc06,_0x3196aa,_0x5fccdb){var _0x5e704b,_0x2b4b93,_0x17d9c7;if(_[_0x8a46('0x79')](_0x3acc06[_0x8a46('0x61')][_0x8a46('0x61')])||_0x3acc06[_0x8a46('0x61')][_0x8a46('0x61')]===''){throw new db[(_0x8a46('0x73'))][(_0x8a46('0x74'))](_0x8a46('0x7c'));}if(_['isNil'](_0x3acc06[_0x8a46('0x61')]['to'])){}_0x5e704b=_0x3acc06[_0x8a46('0x61')]['to'];return db['OpenchannelAccount'][_0x8a46('0x69')]({'where':{'id':_0x3acc06[_0x8a46('0x56')]['id']}})[_0x8a46('0x20')](handleEntityNotFound(_0x3196aa,null))['then'](function(_0x1f61d9){if(_0x1f61d9){return db[_0x8a46('0x3b')][_0x8a46('0x58')]({'where':{'id':_0x1f61d9['id']},'include':[{'model':db[_0x8a46('0xb5')],'as':'List','include':[{'model':db[_0x8a46('0x72')],'as':_0x8a46('0x80'),'where':{[_0x1f61d9[_0x8a46('0x7d')]]:_0x5e704b},'limit':0x1,'order':[['updatedAt',_0x8a46('0x81')]]}]}]})[_0x8a46('0x20')](handleEntityNotFound(_0x3196aa,null))[_0x8a46('0x20')](function(_0x3999e7){if(_0x3999e7&&_0x3999e7[_0x8a46('0x83')]){_0x2b4b93=_0x3999e7[_0x8a46('0x5b')]({'plain':!![]});if(_0x2b4b93[_0x8a46('0x83')]&&_0x2b4b93[_0x8a46('0x83')]['Contacts'][_0x8a46('0x57')]){return _0x2b4b93[_0x8a46('0x83')][_0x8a46('0x80')][0x0];}return db[_0x8a46('0x72')][_0x8a46('0x59')](_[_0x8a46('0xb6')](_0x3acc06[_0x8a46('0x61')],{'firstName':_0x5e704b,[_0x3999e7['mapKey']]:_0x5e704b,'phone':_0x5e704b,'ListId':_0x2b4b93[_0x8a46('0x8a')]}));}})[_0x8a46('0x20')](handleEntityNotFound(_0x3196aa,null))[_0x8a46('0x20')](function(_0x3636e4){if(_0x3636e4){_0x17d9c7=_0x3636e4;return db[_0x8a46('0x91')]['find']({'where':{'ContactId':_0x17d9c7['id'],'closed':![],'OpenchannelAccountId':_0x2b4b93['id']}})[_0x8a46('0x20')](function(_0x27a306){if(_0x27a306){return[_0x27a306,![]];}return db[_0x8a46('0x91')][_0x8a46('0x59')]({'UserId':_0x3acc06[_0x8a46('0x5a')]['id'],'ContactId':_0x17d9c7['id'],'OpenchannelAccountId':_0x2b4b93['id'],'lastMsgDirection':_0x8a46('0xb7'),'Messages':[_[_0x8a46('0x4c')](_0x3acc06[_0x8a46('0x61')],{'read':![],'body':_0x3acc06[_0x8a46('0x61')][_0x8a46('0x61')],'OpenchannelAccountId':_0x2b4b93['id'],'UserId':_0x3acc06[_0x8a46('0x5a')]['id'],'ContactId':_0x17d9c7['id']})]},{'include':[{'model':db[_0x8a46('0x9a')],'as':_0x8a46('0xb8')}]})[_0x8a46('0x20')](function(_0x57acb5){return[_0x57acb5,!![]];});});}})['spread'](function(_0x1b3692,_0x1db5b7){if(_0x1db5b7){return _0x1b3692;}return db[_0x8a46('0x9a')][_0x8a46('0x59')](_[_0x8a46('0x4c')](_0x3acc06[_0x8a46('0x61')],{'read':![],'body':_0x3acc06[_0x8a46('0x61')][_0x8a46('0x61')],'OpenchannelAccountId':_0x2b4b93['id'],'OpenchannelInteractionId':_0x1b3692['id'],'UserId':_0x3acc06[_0x8a46('0x5a')]['id'],'ContactId':_0x17d9c7['id']}))[_0x8a46('0x20')](function(_0x9f7563){_0x1b3692[_0x8a46('0xb9')][_0x8a46('0xb8')]=[];_0x1b3692[_0x8a46('0xb9')][_0x8a46('0xb8')][_0x8a46('0xba')](_0x9f7563[_0x8a46('0xb9')]);return _0x1b3692;});});}})['then'](respondWithResult(_0x3196aa,null))[_0x8a46('0x28')](handleError(_0x3196aa,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 8016b88..9091a41 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 _0x153f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount'];(function(_0x4b10e8,_0x22279e){var _0x4aa183=function(_0xb46b1e){while(--_0xb46b1e){_0x4b10e8['push'](_0x4b10e8['shift']());}};_0x4aa183(++_0x22279e);}(_0x153f,0x15b));var _0xf153=function(_0x5e2acf,_0x1ac4b7){_0x5e2acf=_0x5e2acf-0x0;var _0x9d6f05=_0x153f[_0x5e2acf];return _0x9d6f05;};'use strict';var EventEmitter=require(_0xf153('0x0'));var OpenchannelAccount=require(_0xf153('0x1'))['db'][_0xf153('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf153('0x3')](0x0);var events={'afterCreate':_0xf153('0x4'),'afterUpdate':_0xf153('0x5'),'afterDestroy':_0xf153('0x6')};function emitEvent(_0x59757c){return function(_0x364e65,_0x5c49c7,_0x1f9ead){OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c+':'+_0x364e65['id'],_0x364e65);OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c,_0x364e65);_0x1f9ead(null);};}for(var e in events){if(events[_0xf153('0x8')](e)){var event=events[e];OpenchannelAccount[_0xf153('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x32c4e7,_0x90662b){var _0x4bf90a=function(_0xed624d){while(--_0xed624d){_0x32c4e7['push'](_0x32c4e7['shift']());}};_0x4bf90a(++_0x90662b);}(_0x41bb,0xc5));var _0xb41b=function(_0x4ce71d,_0x26ad52){_0x4ce71d=_0x4ce71d-0x0;var _0x38ce74=_0x41bb[_0x4ce71d];return _0x38ce74;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1ca03f0..c0029cf 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(_0x439282,_0xeb9a28){var _0x2adb31=function(_0x2366f9){while(--_0x2366f9){_0x439282['push'](_0x439282['shift']());}};_0x2adb31(++_0xeb9a28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x12e346,_0x29f7bd){var _0x324b5c=function(_0x15b752){while(--_0x15b752){_0x12e346['push'](_0x12e346['shift']());}};_0x324b5c(++_0x29f7bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index f2b6393..534ab26 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 _0xeffd=['redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xeffd,0x6b));var _0xdeff=function(_0x136ee3,_0x5d3527){_0x136ee3=_0x136ee3-0x0;var _0x1fe589=_0xeffd[_0x136ee3];return _0x1fe589;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});config[_0xdeff('0xd')]=_[_0xdeff('0xe')](config[_0xdeff('0xd')],{'host':_0xdeff('0xf'),'port':0x18eb});var socket=require(_0xdeff('0x10'))(new Redis(config['redis']));require(_0xdeff('0x11'))[_0xdeff('0x12')](socket);function respondWithRpcPromise(_0xf6d58d,_0x51fcb7,_0x1ff265){return new BPromise(function(_0x4423e9,_0x3c1482){return client[_0xdeff('0x13')](_0xf6d58d,_0x1ff265)[_0xdeff('0x14')](function(_0x256b73){logger[_0xdeff('0x15')](_0xdeff('0x16'),_0x51fcb7,'request\x20sent');logger[_0xdeff('0x17')](_0xdeff('0x18'),_0x51fcb7,'request\x20sent',JSON[_0xdeff('0x19')](_0x256b73));if(_0x256b73['error']){if(_0x256b73['error'][_0xdeff('0x1a')]===0x1f4){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')]['message']);return _0x3c1482(_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);}logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);return _0x4423e9(_0x256b73['error']['message']);}else{logger[_0xdeff('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x51fcb7,'request\x20sent');_0x4423e9(_0x256b73[_0xdeff('0x1d')][_0xdeff('0x1c')]);}})['catch'](function(_0x2de203){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x2de203);_0x3c1482(_0x2de203);});});} \ No newline at end of file +var _0x1b32=['http','redis','defaults','localhost','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x44946a,_0x581b02){var _0x572619=function(_0x2eaaf5){while(--_0x2eaaf5){_0x44946a['push'](_0x44946a['shift']());}};_0x572619(++_0x581b02);}(_0x1b32,0x85));var _0x21b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b32[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});config[_0x21b3('0xd')]=_[_0x21b3('0xe')](config['redis'],{'host':_0x21b3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x21b3('0x10')](socket);function respondWithRpcPromise(_0x36b2a1,_0x56009d,_0x4aa0d7){return new BPromise(function(_0x253f2b,_0x270969){return client[_0x21b3('0x11')](_0x36b2a1,_0x4aa0d7)['then'](function(_0x370338){logger[_0x21b3('0x12')](_0x21b3('0x13'),_0x56009d,_0x21b3('0x14'));logger[_0x21b3('0x15')](_0x21b3('0x16'),_0x56009d,_0x21b3('0x14'),JSON[_0x21b3('0x17')](_0x370338));if(_0x370338[_0x21b3('0x18')]){if(_0x370338['error'][_0x21b3('0x19')]===0x1f4){logger[_0x21b3('0x18')](_0x21b3('0x13'),_0x56009d,_0x370338['error'][_0x21b3('0x1a')]);return _0x270969(_0x370338['error'][_0x21b3('0x1a')]);}logger['error'](_0x21b3('0x13'),_0x56009d,_0x370338[_0x21b3('0x18')][_0x21b3('0x1a')]);return _0x253f2b(_0x370338[_0x21b3('0x18')]['message']);}else{logger[_0x21b3('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x56009d,_0x21b3('0x14'));_0x253f2b(_0x370338[_0x21b3('0x1b')][_0x21b3('0x1a')]);}})[_0x21b3('0x1c')](function(_0x513c32){logger[_0x21b3('0x18')](_0x21b3('0x13'),_0x56009d,_0x513c32);_0x270969(_0x513c32);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index df4a0bb..81757c0 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 _0x76dc=['./openchannelAccount.events','save','remove','update','register','openchannelAccount:'];(function(_0x57c25d,_0x36a59d){var _0x4ad82c=function(_0x1a47f4){while(--_0x1a47f4){_0x57c25d['push'](_0x57c25d['shift']());}};_0x4ad82c(++_0x36a59d);}(_0x76dc,0x1f2));var _0xc76d=function(_0x4b4ee7,_0x37a1a2){_0x4b4ee7=_0x4b4ee7-0x0;var _0x16a01c=_0x76dc[_0x4b4ee7];return _0x16a01c;};'use strict';var OpenchannelAccountEvents=require(_0xc76d('0x0'));var events=[_0xc76d('0x1'),_0xc76d('0x2'),_0xc76d('0x3')];function createListener(_0x49c651,_0x2a8b7d){return function(_0x1ba6a1){_0x2a8b7d['emit'](_0x49c651,_0x1ba6a1);};}function removeListener(_0x300f11,_0x50ed3a){return function(){OpenchannelAccountEvents['removeListener'](_0x300f11,_0x50ed3a);};}exports[_0xc76d('0x4')]=function(_0x29ab70){for(var _0x1c86fc=0x0,_0x4832bd=events['length'];_0x1c86fc<_0x4832bd;_0x1c86fc++){var _0x119f38=events[_0x1c86fc];var _0x114572=createListener(_0xc76d('0x5')+_0x119f38,_0x29ab70);OpenchannelAccountEvents['on'](_0x119f38,_0x114572);}}; \ No newline at end of file +var _0xe130=['openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener','register'];(function(_0x434d68,_0xcbdfed){var _0x56f3ce=function(_0x3553ab){while(--_0x3553ab){_0x434d68['push'](_0x434d68['shift']());}};_0x56f3ce(++_0xcbdfed);}(_0xe130,0x127));var _0x0e13=function(_0x1b1e18,_0x334539){_0x1b1e18=_0x1b1e18-0x0;var _0x4ba6e4=_0xe130[_0x1b1e18];return _0x4ba6e4;};'use strict';var OpenchannelAccountEvents=require(_0x0e13('0x0'));var events=[_0x0e13('0x1'),'remove',_0x0e13('0x2')];function createListener(_0x3cbccc,_0x1dd4fa){return function(_0x360489){_0x1dd4fa[_0x0e13('0x3')](_0x3cbccc,_0x360489);};}function removeListener(_0x504f15,_0x1489a9){return function(){OpenchannelAccountEvents[_0x0e13('0x4')](_0x504f15,_0x1489a9);};}exports[_0x0e13('0x5')]=function(_0xcd92e){for(var _0x50a80e=0x0,_0x1774a5=events['length'];_0x50a80e<_0x1774a5;_0x50a80e++){var _0x567031=events[_0x50a80e];var _0x5aaa22=createListener(_0x0e13('0x6')+_0x567031,_0xcd92e);OpenchannelAccountEvents['on'](_0x567031,_0x5aaa22);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index a22a17c..3764f9d 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 _0x421a=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','post','isAuthenticated','put','update','multer','path'];(function(_0x5896d6,_0x5e7ff3){var _0x566def=function(_0x31aa8c){while(--_0x31aa8c){_0x5896d6['push'](_0x5896d6['shift']());}};_0x566def(++_0x5e7ff3);}(_0x421a,0x1c0));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa421('0x0'));var util=require('util');var path=require(_0xa421('0x1'));var timeout=require(_0xa421('0x2'));var express=require(_0xa421('0x3'));var router=express['Router']();var fs_extra=require(_0xa421('0x4'));var auth=require(_0xa421('0x5'));var interaction=require(_0xa421('0x6'));var config=require(_0xa421('0x7'));var controller=require(_0xa421('0x8'));router[_0xa421('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa421('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa421('0xb')]('/',auth[_0xa421('0xc')](),controller['create']);router[_0xa421('0xd')](_0xa421('0xa'),auth[_0xa421('0xc')](),controller[_0xa421('0xe')]);router['delete'](_0xa421('0xa'),auth[_0xa421('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ae7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x2aaf57,_0x810f9e){var _0x76c110=function(_0x2d8e22){while(--_0x2d8e22){_0x2aaf57['push'](_0x2aaf57['shift']());}};_0x76c110(++_0x810f9e);}(_0x1ae7,0xc6));var _0x71ae=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x1ae7[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x71ae('0x0'));var util=require(_0x71ae('0x1'));var path=require(_0x71ae('0x2'));var timeout=require(_0x71ae('0x3'));var express=require(_0x71ae('0x4'));var router=express[_0x71ae('0x5')]();var fs_extra=require(_0x71ae('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x71ae('0x7'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x71ae('0x8')](),controller['index']);router[_0x71ae('0x9')](_0x71ae('0xa'),auth['isAuthenticated'](),controller[_0x71ae('0xb')]);router[_0x71ae('0xc')]('/',auth[_0x71ae('0x8')](),controller[_0x71ae('0xd')]);router[_0x71ae('0xe')](_0x71ae('0xa'),auth[_0x71ae('0x8')](),controller[_0x71ae('0xf')]);router[_0x71ae('0x10')](_0x71ae('0xa'),auth[_0x71ae('0x8')](),controller[_0x71ae('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 20f0770..40b1932 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 _0x6de7=['sequelize','exports','TEXT','STRING','*,*,*,*'];(function(_0x18e4a9,_0x483058){var _0xeb55c3=function(_0x218497){while(--_0x218497){_0x18e4a9['push'](_0x18e4a9['shift']());}};_0xeb55c3(++_0x483058);}(_0x6de7,0x1cc));var _0x76de=function(_0x767fe7,_0x1db449){_0x767fe7=_0x767fe7-0x0;var _0x47771d=_0x6de7[_0x767fe7];return _0x47771d;};'use strict';var Sequelize=require(_0x76de('0x0'));module[_0x76de('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x76de('0x2')]()},'description':{'type':Sequelize[_0x76de('0x3')]},'interval':{'type':Sequelize[_0x76de('0x3')],'defaultValue':_0x76de('0x4')}}; \ No newline at end of file +var _0xf2a8=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x6e48aa,_0xfe82c3){var _0x5b54c2=function(_0xe381bb){while(--_0xe381bb){_0x6e48aa['push'](_0x6e48aa['shift']());}};_0x5b54c2(++_0xfe82c3);}(_0xf2a8,0x113));var _0x8f2a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf2a8[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x8f2a('0x0'));module[_0x8f2a('0x1')]={'priority':{'type':Sequelize[_0x8f2a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8f2a('0x3')},'appdata':{'type':Sequelize[_0x8f2a('0x4')]()},'description':{'type':Sequelize[_0x8f2a('0x5')]},'interval':{'type':Sequelize[_0x8f2a('0x5')],'defaultValue':_0x8f2a('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9d0ca56..1feedac 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 _0xbd5d=['set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','body','find','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset'];(function(_0xdf6334,_0x1658f8){var _0x8ca5f7=function(_0x48e60e){while(--_0x48e60e){_0xdf6334['push'](_0xdf6334['shift']());}};_0x8ca5f7(++_0x1658f8);}(_0xbd5d,0x73));var _0xdbd5=function(_0x11ba75,_0x31fbd2){_0x11ba75=_0x11ba75-0x0;var _0x118378=_0xbd5d[_0x11ba75];return _0x118378;};'use strict';var emlformat=require(_0xdbd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbd5('0x1'));var jsonpatch=require(_0xdbd5('0x2'));var rp=require(_0xdbd5('0x3'));var moment=require(_0xdbd5('0x4'));var BPromise=require(_0xdbd5('0x5'));var Mustache=require(_0xdbd5('0x6'));var util=require(_0xdbd5('0x7'));var path=require(_0xdbd5('0x8'));var sox=require('sox');var csv=require(_0xdbd5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbd5('0xa'));var _=require(_0xdbd5('0xb'));var squel=require(_0xdbd5('0xc'));var crypto=require(_0xdbd5('0xd'));var jsforce=require(_0xdbd5('0xe'));var deskjs=require(_0xdbd5('0xf'));var toCsv=require(_0xdbd5('0x9'));var querystring=require(_0xdbd5('0x10'));var Papa=require(_0xdbd5('0x11'));var Redis=require(_0xdbd5('0x12'));var authService=require(_0xdbd5('0x13'));var qs=require(_0xdbd5('0x14'));var as=require(_0xdbd5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbd5('0x16'))('api');var utils=require(_0xdbd5('0x17'));var config=require(_0xdbd5('0x18'));var licenseUtil=require(_0xdbd5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd458d4,_0x901390){_0x901390=_0x901390||0xcc;return function(_0x75fbdf){if(_0x75fbdf){return _0xd458d4[_0xdbd5('0x1a')](_0x901390);}return _0xd458d4[_0xdbd5('0x1b')](_0x901390)[_0xdbd5('0x1c')]();};}function respondWithResult(_0x13131f,_0x5c62bd){_0x5c62bd=_0x5c62bd||0xc8;return function(_0x328c95){if(_0x328c95){return _0x13131f['status'](_0x5c62bd)['json'](_0x328c95);}};}function respondWithFilteredResult(_0x898e06,_0x3c2570){return function(_0x25ec92){if(_0x25ec92){var _0x435f6e=typeof _0x3c2570['offset']===_0xdbd5('0x1d')&&typeof _0x3c2570[_0xdbd5('0x1e')]==='undefined';var _0x49f176=_0x25ec92[_0xdbd5('0x1f')];var _0x432c5c=_0x435f6e?0x0:_0x3c2570[_0xdbd5('0x20')];var _0x55db31=_0x435f6e?_0x25ec92['count']:_0x3c2570['offset']+_0x3c2570['limit'];var _0x4de109;if(_0x55db31>=_0x49f176){_0x55db31=_0x49f176;_0x4de109=0xc8;}else{_0x4de109=0xce;}_0x898e06[_0xdbd5('0x1b')](_0x4de109);return _0x898e06[_0xdbd5('0x21')](_0xdbd5('0x22'),_0x432c5c+'-'+_0x55db31+'/'+_0x49f176)['json'](_0x25ec92);}return null;};}function patchUpdates(_0x438a90){return function(_0x3b1108){try{jsonpatch[_0xdbd5('0x23')](_0x3b1108,_0x438a90,!![]);}catch(_0x3e208e){return BPromise[_0xdbd5('0x24')](_0x3e208e);}return _0x3b1108[_0xdbd5('0x25')]();};}function saveUpdates(_0x3b4672,_0x273594){return function(_0x3192a6){if(_0x3192a6){return _0x3192a6[_0xdbd5('0x26')](_0x3b4672)[_0xdbd5('0x27')](function(_0x3033d7){return _0x3033d7;});}return null;};}function removeEntity(_0x5105e4,_0x3f98a5){return function(_0x34753b){if(_0x34753b){return _0x34753b[_0xdbd5('0x28')]()[_0xdbd5('0x27')](function(){_0x5105e4[_0xdbd5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19bdd9,_0x3cfbc5){return function(_0x5afa02){if(!_0x5afa02){_0x19bdd9['sendStatus'](0x194);}return _0x5afa02;};}function handleError(_0x4a5f6e,_0x3f916c){_0x3f916c=_0x3f916c||0x1f4;return function(_0x4748a4){logger[_0xdbd5('0x29')](_0x4748a4['stack']);if(_0x4748a4['name']){delete _0x4748a4[_0xdbd5('0x2a')];}_0x4a5f6e['status'](_0x3f916c)[_0xdbd5('0x2b')](_0x4748a4);};}exports[_0xdbd5('0x2c')]=function(_0x407780,_0x478caa){var _0x31498c={},_0x5ff2f2={},_0x2f9ee9={'count':0x0,'rows':[]};var _0x5e1dff=_[_0xdbd5('0x2d')](db[_0xdbd5('0x2e')][_0xdbd5('0x2f')],function(_0xffe85){return{'name':_0xffe85[_0xdbd5('0x30')],'type':_0xffe85['type'][_0xdbd5('0x31')]};});_0x5ff2f2[_0xdbd5('0x32')]=_['map'](_0x5e1dff,_0xdbd5('0x2a'));_0x5ff2f2['query']=_[_0xdbd5('0x33')](_0x407780[_0xdbd5('0x34')]);_0x5ff2f2['filters']=_[_0xdbd5('0x35')](_0x5ff2f2[_0xdbd5('0x32')],_0x5ff2f2[_0xdbd5('0x34')]);_0x31498c[_0xdbd5('0x36')]=_[_0xdbd5('0x35')](_0x5ff2f2[_0xdbd5('0x32')],qs['fields'](_0x407780[_0xdbd5('0x34')][_0xdbd5('0x37')]));_0x31498c[_0xdbd5('0x36')]=_0x31498c[_0xdbd5('0x36')][_0xdbd5('0x38')]?_0x31498c['attributes']:_0x5ff2f2[_0xdbd5('0x32')];if(!_0x407780[_0xdbd5('0x34')]['hasOwnProperty'](_0xdbd5('0x39'))){_0x31498c[_0xdbd5('0x1e')]=qs['limit'](_0x407780[_0xdbd5('0x34')][_0xdbd5('0x1e')]);_0x31498c[_0xdbd5('0x20')]=qs[_0xdbd5('0x20')](_0x407780[_0xdbd5('0x34')][_0xdbd5('0x20')]);}_0x31498c[_0xdbd5('0x3a')]=qs[_0xdbd5('0x3b')](_0x407780[_0xdbd5('0x34')][_0xdbd5('0x3b')]);_0x31498c[_0xdbd5('0x3c')]=qs[_0xdbd5('0x3d')](_[_0xdbd5('0x3e')](_0x407780[_0xdbd5('0x34')],_0x5ff2f2[_0xdbd5('0x3d')]),_0x5e1dff);if(_0x407780[_0xdbd5('0x34')][_0xdbd5('0x3f')]){_0x31498c['where']=_[_0xdbd5('0x40')](_0x31498c[_0xdbd5('0x3c')],{'$or':_[_0xdbd5('0x2d')](_0x5e1dff,function(_0x39cc1e){if(_0x39cc1e['type']!==_0xdbd5('0x41')){var _0x1f41dc={};_0x1f41dc[_0x39cc1e[_0xdbd5('0x2a')]]={'$like':'%'+_0x407780['query']['filter']+'%'};return _0x1f41dc;}})});}_0x31498c=_[_0xdbd5('0x40')]({},_0x31498c,_0x407780[_0xdbd5('0x42')]);var _0xf5d354={'where':_0x31498c[_0xdbd5('0x3c')]};return db['OpenchannelApplication']['count'](_0xf5d354)[_0xdbd5('0x27')](function(_0x3aef7e){_0x2f9ee9['count']=_0x3aef7e;if(_0x407780[_0xdbd5('0x34')][_0xdbd5('0x43')]){_0x31498c[_0xdbd5('0x44')]=[{'all':!![]}];}return db[_0xdbd5('0x2e')][_0xdbd5('0x45')](_0x31498c);})[_0xdbd5('0x27')](function(_0x4dd97e){_0x2f9ee9['rows']=_0x4dd97e;return _0x2f9ee9;})[_0xdbd5('0x27')](respondWithFilteredResult(_0x478caa,_0x31498c))[_0xdbd5('0x46')](handleError(_0x478caa,null));};exports['show']=function(_0x4ccdc9,_0x399557){var _0x2357b6={'raw':!![],'where':{'id':_0x4ccdc9[_0xdbd5('0x47')]['id']}},_0x16bb98={};_0x16bb98[_0xdbd5('0x32')]=_['keys'](db[_0xdbd5('0x2e')]['rawAttributes']);_0x16bb98[_0xdbd5('0x34')]=_[_0xdbd5('0x33')](_0x4ccdc9[_0xdbd5('0x34')]);_0x16bb98['filters']=_[_0xdbd5('0x35')](_0x16bb98[_0xdbd5('0x32')],_0x16bb98[_0xdbd5('0x34')]);_0x2357b6[_0xdbd5('0x36')]=_[_0xdbd5('0x35')](_0x16bb98[_0xdbd5('0x32')],qs['fields'](_0x4ccdc9['query']['fields']));_0x2357b6[_0xdbd5('0x36')]=_0x2357b6[_0xdbd5('0x36')]['length']?_0x2357b6[_0xdbd5('0x36')]:_0x16bb98[_0xdbd5('0x32')];if(_0x4ccdc9[_0xdbd5('0x34')][_0xdbd5('0x43')]){_0x2357b6[_0xdbd5('0x44')]=[{'all':!![]}];}_0x2357b6=_['merge']({},_0x2357b6,_0x4ccdc9[_0xdbd5('0x42')]);return db['OpenchannelApplication']['find'](_0x2357b6)[_0xdbd5('0x27')](handleEntityNotFound(_0x399557,null))['then'](respondWithResult(_0x399557,null))[_0xdbd5('0x46')](handleError(_0x399557,null));};exports['create']=function(_0x574451,_0x3cd33c){return db['OpenchannelApplication']['create'](_0x574451['body'],{})[_0xdbd5('0x27')](respondWithResult(_0x3cd33c,0xc9))[_0xdbd5('0x46')](handleError(_0x3cd33c,null));};exports[_0xdbd5('0x26')]=function(_0x953cb5,_0x177f01){if(_0x953cb5['body']['id']){delete _0x953cb5[_0xdbd5('0x48')]['id'];}return db['OpenchannelApplication'][_0xdbd5('0x49')]({'where':{'id':_0x953cb5['params']['id']}})[_0xdbd5('0x27')](handleEntityNotFound(_0x177f01,null))[_0xdbd5('0x27')](saveUpdates(_0x953cb5[_0xdbd5('0x48')],null))[_0xdbd5('0x27')](respondWithResult(_0x177f01,null))[_0xdbd5('0x46')](handleError(_0x177f01,null));};exports[_0xdbd5('0x28')]=function(_0x3f6d35,_0xaaa845){return db[_0xdbd5('0x2e')][_0xdbd5('0x49')]({'where':{'id':_0x3f6d35[_0xdbd5('0x47')]['id']}})[_0xdbd5('0x27')](handleEntityNotFound(_0xaaa845,null))[_0xdbd5('0x27')](removeEntity(_0xaaa845,null))[_0xdbd5('0x46')](handleError(_0xaaa845,null));}; \ No newline at end of file +var _0x074b=['send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name'];(function(_0x24a72a,_0x19fd59){var _0xb02b6=function(_0x44a464){while(--_0x44a464){_0x24a72a['push'](_0x24a72a['shift']());}};_0xb02b6(++_0x19fd59);}(_0x074b,0x157));var _0xb074=function(_0x4465a8,_0x36ca1b){_0x4465a8=_0x4465a8-0x0;var _0x49adee=_0x074b[_0x4465a8];return _0x49adee;};'use strict';var emlformat=require(_0xb074('0x0'));var rimraf=require(_0xb074('0x1'));var zipdir=require(_0xb074('0x2'));var jsonpatch=require(_0xb074('0x3'));var rp=require('request-promise');var moment=require(_0xb074('0x4'));var BPromise=require(_0xb074('0x5'));var Mustache=require('mustache');var util=require(_0xb074('0x6'));var path=require(_0xb074('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb074('0x8'));var fs=require('fs');var fs_extra=require(_0xb074('0x9'));var _=require(_0xb074('0xa'));var squel=require('squel');var crypto=require(_0xb074('0xb'));var jsforce=require(_0xb074('0xc'));var deskjs=require(_0xb074('0xd'));var toCsv=require(_0xb074('0xe'));var querystring=require(_0xb074('0xf'));var Papa=require(_0xb074('0x10'));var Redis=require(_0xb074('0x11'));var authService=require(_0xb074('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb074('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb074('0x14'))('api');var utils=require(_0xb074('0x15'));var config=require(_0xb074('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb074('0x17'))['db'];function respondWithStatusCode(_0xd6d214,_0x3d7734){_0x3d7734=_0x3d7734||0xcc;return function(_0x5cae35){if(_0x5cae35){return _0xd6d214[_0xb074('0x18')](_0x3d7734);}return _0xd6d214[_0xb074('0x19')](_0x3d7734)[_0xb074('0x1a')]();};}function respondWithResult(_0x32afac,_0x18ca8b){_0x18ca8b=_0x18ca8b||0xc8;return function(_0x9082d6){if(_0x9082d6){return _0x32afac[_0xb074('0x19')](_0x18ca8b)[_0xb074('0x1b')](_0x9082d6);}};}function respondWithFilteredResult(_0x63512a,_0x44b23e){return function(_0x5b2956){if(_0x5b2956){var _0x38f97f=typeof _0x44b23e[_0xb074('0x1c')]===_0xb074('0x1d')&&typeof _0x44b23e[_0xb074('0x1e')]===_0xb074('0x1d');var _0x17b1c1=_0x5b2956[_0xb074('0x1f')];var _0x163729=_0x38f97f?0x0:_0x44b23e[_0xb074('0x1c')];var _0x3e2f3a=_0x38f97f?_0x5b2956[_0xb074('0x1f')]:_0x44b23e[_0xb074('0x1c')]+_0x44b23e['limit'];var _0x3cc018;if(_0x3e2f3a>=_0x17b1c1){_0x3e2f3a=_0x17b1c1;_0x3cc018=0xc8;}else{_0x3cc018=0xce;}_0x63512a[_0xb074('0x19')](_0x3cc018);return _0x63512a[_0xb074('0x20')](_0xb074('0x21'),_0x163729+'-'+_0x3e2f3a+'/'+_0x17b1c1)['json'](_0x5b2956);}return null;};}function patchUpdates(_0xd67576){return function(_0x22c277){try{jsonpatch[_0xb074('0x22')](_0x22c277,_0xd67576,!![]);}catch(_0x2b9b65){return BPromise['reject'](_0x2b9b65);}return _0x22c277[_0xb074('0x23')]();};}function saveUpdates(_0x460206,_0x41eeb6){return function(_0x579858){if(_0x579858){return _0x579858[_0xb074('0x24')](_0x460206)[_0xb074('0x25')](function(_0x163106){return _0x163106;});}return null;};}function removeEntity(_0x2d6b59,_0x29ac3a){return function(_0x15259f){if(_0x15259f){return _0x15259f[_0xb074('0x26')]()[_0xb074('0x25')](function(){_0x2d6b59[_0xb074('0x19')](0xcc)[_0xb074('0x1a')]();});}};}function handleEntityNotFound(_0x778a0f,_0x3472c2){return function(_0x8d418a){if(!_0x8d418a){_0x778a0f['sendStatus'](0x194);}return _0x8d418a;};}function handleError(_0x34b1ab,_0x2df343){_0x2df343=_0x2df343||0x1f4;return function(_0xf270fa){logger[_0xb074('0x27')](_0xf270fa[_0xb074('0x28')]);if(_0xf270fa[_0xb074('0x29')]){delete _0xf270fa[_0xb074('0x29')];}_0x34b1ab[_0xb074('0x19')](_0x2df343)[_0xb074('0x2a')](_0xf270fa);};}exports[_0xb074('0x2b')]=function(_0x485219,_0x59f16d){var _0x4795cb={},_0xb11070={},_0x549396={'count':0x0,'rows':[]};var _0x37d843=_[_0xb074('0x2c')](db[_0xb074('0x2d')][_0xb074('0x2e')],function(_0x57c36e){return{'name':_0x57c36e[_0xb074('0x2f')],'type':_0x57c36e[_0xb074('0x30')]['key']};});_0xb11070[_0xb074('0x31')]=_['map'](_0x37d843,'name');_0xb11070[_0xb074('0x32')]=_[_0xb074('0x33')](_0x485219[_0xb074('0x32')]);_0xb11070[_0xb074('0x34')]=_[_0xb074('0x35')](_0xb11070[_0xb074('0x31')],_0xb11070['query']);_0x4795cb[_0xb074('0x36')]=_['intersection'](_0xb11070[_0xb074('0x31')],qs[_0xb074('0x37')](_0x485219[_0xb074('0x32')]['fields']));_0x4795cb[_0xb074('0x36')]=_0x4795cb[_0xb074('0x36')][_0xb074('0x38')]?_0x4795cb[_0xb074('0x36')]:_0xb11070[_0xb074('0x31')];if(!_0x485219[_0xb074('0x32')][_0xb074('0x39')](_0xb074('0x3a'))){_0x4795cb[_0xb074('0x1e')]=qs[_0xb074('0x1e')](_0x485219['query'][_0xb074('0x1e')]);_0x4795cb['offset']=qs[_0xb074('0x1c')](_0x485219[_0xb074('0x32')]['offset']);}_0x4795cb[_0xb074('0x3b')]=qs[_0xb074('0x3c')](_0x485219[_0xb074('0x32')][_0xb074('0x3c')]);_0x4795cb[_0xb074('0x3d')]=qs[_0xb074('0x34')](_[_0xb074('0x3e')](_0x485219[_0xb074('0x32')],_0xb11070['filters']),_0x37d843);if(_0x485219[_0xb074('0x32')][_0xb074('0x3f')]){_0x4795cb[_0xb074('0x3d')]=_['merge'](_0x4795cb[_0xb074('0x3d')],{'$or':_[_0xb074('0x2c')](_0x37d843,function(_0x41f156){if(_0x41f156[_0xb074('0x30')]!==_0xb074('0x40')){var _0x1c2cef={};_0x1c2cef[_0x41f156[_0xb074('0x29')]]={'$like':'%'+_0x485219[_0xb074('0x32')][_0xb074('0x3f')]+'%'};return _0x1c2cef;}})});}_0x4795cb=_[_0xb074('0x41')]({},_0x4795cb,_0x485219[_0xb074('0x42')]);var _0x2bd2af={'where':_0x4795cb['where']};return db[_0xb074('0x2d')][_0xb074('0x1f')](_0x2bd2af)[_0xb074('0x25')](function(_0x20f4b6){_0x549396[_0xb074('0x1f')]=_0x20f4b6;if(_0x485219['query'][_0xb074('0x43')]){_0x4795cb['include']=[{'all':!![]}];}return db[_0xb074('0x2d')][_0xb074('0x44')](_0x4795cb);})[_0xb074('0x25')](function(_0x443fa5){_0x549396[_0xb074('0x45')]=_0x443fa5;return _0x549396;})[_0xb074('0x25')](respondWithFilteredResult(_0x59f16d,_0x4795cb))['catch'](handleError(_0x59f16d,null));};exports[_0xb074('0x46')]=function(_0x5ee7f3,_0x18fe3b){var _0x445c2f={'raw':!![],'where':{'id':_0x5ee7f3[_0xb074('0x47')]['id']}},_0x48a25b={};_0x48a25b['model']=_[_0xb074('0x33')](db[_0xb074('0x2d')][_0xb074('0x2e')]);_0x48a25b[_0xb074('0x32')]=_['keys'](_0x5ee7f3[_0xb074('0x32')]);_0x48a25b['filters']=_[_0xb074('0x35')](_0x48a25b['model'],_0x48a25b[_0xb074('0x32')]);_0x445c2f[_0xb074('0x36')]=_['intersection'](_0x48a25b['model'],qs[_0xb074('0x37')](_0x5ee7f3[_0xb074('0x32')][_0xb074('0x37')]));_0x445c2f['attributes']=_0x445c2f[_0xb074('0x36')][_0xb074('0x38')]?_0x445c2f[_0xb074('0x36')]:_0x48a25b[_0xb074('0x31')];if(_0x5ee7f3['query'][_0xb074('0x43')]){_0x445c2f[_0xb074('0x48')]=[{'all':!![]}];}_0x445c2f=_['merge']({},_0x445c2f,_0x5ee7f3[_0xb074('0x42')]);return db[_0xb074('0x2d')]['find'](_0x445c2f)['then'](handleEntityNotFound(_0x18fe3b,null))['then'](respondWithResult(_0x18fe3b,null))[_0xb074('0x49')](handleError(_0x18fe3b,null));};exports['create']=function(_0x316a44,_0x240872){return db['OpenchannelApplication'][_0xb074('0x4a')](_0x316a44[_0xb074('0x4b')],{})[_0xb074('0x25')](respondWithResult(_0x240872,0xc9))[_0xb074('0x49')](handleError(_0x240872,null));};exports['update']=function(_0x20afba,_0x208fab){if(_0x20afba[_0xb074('0x4b')]['id']){delete _0x20afba[_0xb074('0x4b')]['id'];}return db['OpenchannelApplication'][_0xb074('0x4c')]({'where':{'id':_0x20afba['params']['id']}})['then'](handleEntityNotFound(_0x208fab,null))[_0xb074('0x25')](saveUpdates(_0x20afba['body'],null))[_0xb074('0x25')](respondWithResult(_0x208fab,null))[_0xb074('0x49')](handleError(_0x208fab,null));};exports[_0xb074('0x26')]=function(_0x531185,_0x374cba){return db[_0xb074('0x2d')][_0xb074('0x4c')]({'where':{'id':_0x531185[_0xb074('0x47')]['id']}})[_0xb074('0x25')](handleEntityNotFound(_0x374cba,null))[_0xb074('0x25')](removeEntity(_0x374cba,null))[_0xb074('0x49')](handleError(_0x374cba,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index f1a3c27..074cf11 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 _0x4f5d=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1a210e,_0x18a85a){var _0x368a5d=function(_0x247e77){while(--_0x247e77){_0x1a210e['push'](_0x1a210e['shift']());}};_0x368a5d(++_0x18a85a);}(_0x4f5d,0xef));var _0xd4f5=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x4f5d[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xd4f5('0x0'));var util=require('util');var logger=require(_0xd4f5('0x1'))('api');var moment=require(_0xd4f5('0x2'));var BPromise=require(_0xd4f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x4'));var rimraf=require(_0xd4f5('0x5'));var config=require(_0xd4f5('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xd4f5('0x7')]=function(_0xfb941e,_0x4f8677){return _0xfb941e[_0xd4f5('0x8')](_0xd4f5('0x9'),attributes,{'tableName':_0xd4f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4f5('0xb'),'collate':_0xd4f5('0xc')});}; \ No newline at end of file +var _0xa1be=['define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x192bc9,_0x4408c7){var _0x48397b=function(_0x2e03e6){while(--_0x2e03e6){_0x192bc9['push'](_0x192bc9['shift']());}};_0x48397b(++_0x4408c7);}(_0xa1be,0x145));var _0xea1b=function(_0x4c4b32,_0x8c3529){_0x4c4b32=_0x4c4b32-0x0;var _0x4d1577=_0xa1be[_0x4c4b32];return _0x4d1577;};'use strict';var _=require(_0xea1b('0x0'));var util=require(_0xea1b('0x1'));var logger=require(_0xea1b('0x2'))(_0xea1b('0x3'));var moment=require('moment');var BPromise=require(_0xea1b('0x4'));var rp=require(_0xea1b('0x5'));var fs=require('fs');var path=require(_0xea1b('0x6'));var rimraf=require(_0xea1b('0x7'));var config=require(_0xea1b('0x8'));var attributes=require(_0xea1b('0x9'));module[_0xea1b('0xa')]=function(_0x499d14,_0x24ccdf){return _0x499d14[_0xea1b('0xb')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 472269a..f907cd0 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 _0x43fb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','raw','options','where','limit','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2c25c7,_0x57f2d7){var _0x1e51bd=function(_0x544467){while(--_0x544467){_0x2c25c7['push'](_0x2c25c7['shift']());}};_0x1e51bd(++_0x57f2d7);}(_0x43fb,0xb5));var _0xb43f=function(_0x5c6b87,_0x6d552e){_0x5c6b87=_0x5c6b87-0x0;var _0x4a07cf=_0x43fb[_0x5c6b87];return _0x4a07cf;};'use strict';var _=require(_0xb43f('0x0'));var util=require(_0xb43f('0x1'));var moment=require(_0xb43f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb43f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb43f('0x4'))['db'];var utils=require(_0xb43f('0x5'));var logger=require(_0xb43f('0x6'))(_0xb43f('0x7'));var config=require(_0xb43f('0x8'));var jayson=require(_0xb43f('0x9'));var client=jayson[_0xb43f('0xa')][_0xb43f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26b7f1,_0x1d5ea6,_0x46f72d){return new BPromise(function(_0x2c0b13,_0x3bdfcb){return client['request'](_0x26b7f1,_0x46f72d)[_0xb43f('0xc')](function(_0x2e32c2){logger[_0xb43f('0xd')](_0xb43f('0xe'),_0x1d5ea6,_0xb43f('0xf'));logger[_0xb43f('0x10')](_0xb43f('0x11'),_0x1d5ea6,_0xb43f('0xf'),JSON[_0xb43f('0x12')](_0x2e32c2));if(_0x2e32c2[_0xb43f('0x13')]){if(_0x2e32c2[_0xb43f('0x13')][_0xb43f('0x14')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x1d5ea6,_0x2e32c2[_0xb43f('0x13')][_0xb43f('0x15')]);return _0x3bdfcb(_0x2e32c2['error'][_0xb43f('0x15')]);}logger[_0xb43f('0x13')](_0xb43f('0xe'),_0x1d5ea6,_0x2e32c2[_0xb43f('0x13')][_0xb43f('0x15')]);return _0x2c0b13(_0x2e32c2[_0xb43f('0x13')][_0xb43f('0x15')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x1d5ea6,_0xb43f('0xf'));_0x2c0b13(_0x2e32c2['result'][_0xb43f('0x15')]);}})[_0xb43f('0x16')](function(_0x537678){logger[_0xb43f('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x1d5ea6,_0x537678);_0x3bdfcb(_0x537678);});});}exports[_0xb43f('0x17')]=function(_0x4eed08){var _0x1df48b=this;return new Promise(function(_0x188669,_0x4e15fb){return db[_0xb43f('0x18')][_0xb43f('0x19')](_0x4eed08[_0xb43f('0x1a')],{'raw':_0x4eed08['options']?_0x4eed08['options'][_0xb43f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eed08[_0xb43f('0x1c')]?_0x4eed08[_0xb43f('0x1c')][_0xb43f('0x1d')]||null:null,'attributes':_0x4eed08[_0xb43f('0x1c')]?_0x4eed08[_0xb43f('0x1c')]['attributes']||null:null,'limit':_0x4eed08[_0xb43f('0x1c')]?_0x4eed08[_0xb43f('0x1c')][_0xb43f('0x1e')]||null:null})[_0xb43f('0xc')](function(_0x34231d){logger[_0xb43f('0xd')](_0xb43f('0x17'),_0x4eed08);logger['debug'](_0xb43f('0x17'),_0x4eed08,JSON[_0xb43f('0x12')](_0x34231d));_0x188669(_0x34231d);})[_0xb43f('0x16')](function(_0x1bb328){logger[_0xb43f('0x13')]('UpdateOpenchannelApplication',_0x1bb328[_0xb43f('0x15')],_0x4eed08);_0x4e15fb(_0x1df48b[_0xb43f('0x13')](0x1f4,_0x1bb328[_0xb43f('0x15')]));});});}; \ No newline at end of file +var _0xae32=['jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','OpenchannelApplication','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0xae32,0x9b));var _0x2ae3=function(_0x4b2d4a,_0xffdb7c){_0x4b2d4a=_0x4b2d4a-0x0;var _0x6fe91d=_0xae32[_0x4b2d4a];return _0x6fe91d;};'use strict';var _=require(_0x2ae3('0x0'));var util=require(_0x2ae3('0x1'));var moment=require(_0x2ae3('0x2'));var BPromise=require(_0x2ae3('0x3'));var rs=require(_0x2ae3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ae3('0x5'))['db'];var utils=require(_0x2ae3('0x6'));var logger=require(_0x2ae3('0x7'))(_0x2ae3('0x8'));var config=require(_0x2ae3('0x9'));var jayson=require(_0x2ae3('0xa'));var client=jayson[_0x2ae3('0xb')][_0x2ae3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47e030,_0x3bb60c,_0x4b1302){return new BPromise(function(_0x2afbbe,_0x3b8b0d){return client[_0x2ae3('0xd')](_0x47e030,_0x4b1302)[_0x2ae3('0xe')](function(_0x3e6744){logger[_0x2ae3('0xf')](_0x2ae3('0x10'),_0x3bb60c,_0x2ae3('0x11'));logger[_0x2ae3('0x12')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3bb60c,'request\x20sent',JSON['stringify'](_0x3e6744));if(_0x3e6744[_0x2ae3('0x13')]){if(_0x3e6744[_0x2ae3('0x13')][_0x2ae3('0x14')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3bb60c,_0x3e6744['error']['message']);return _0x3b8b0d(_0x3e6744[_0x2ae3('0x13')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3bb60c,_0x3e6744['error']['message']);return _0x2afbbe(_0x3e6744[_0x2ae3('0x13')][_0x2ae3('0x15')]);}else{logger[_0x2ae3('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x3bb60c,'request\x20sent');_0x2afbbe(_0x3e6744[_0x2ae3('0x16')][_0x2ae3('0x15')]);}})['catch'](function(_0x32219b){logger[_0x2ae3('0x13')](_0x2ae3('0x10'),_0x3bb60c,_0x32219b);_0x3b8b0d(_0x32219b);});});}exports['UpdateOpenchannelApplication']=function(_0x11b81b){var _0x124855=this;return new Promise(function(_0x4da63b,_0x2957db){return db[_0x2ae3('0x17')][_0x2ae3('0x18')](_0x11b81b[_0x2ae3('0x19')],{'raw':_0x11b81b['options']?_0x11b81b[_0x2ae3('0x1a')][_0x2ae3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11b81b[_0x2ae3('0x1a')]?_0x11b81b[_0x2ae3('0x1a')][_0x2ae3('0x1c')]||null:null,'attributes':_0x11b81b['options']?_0x11b81b['options'][_0x2ae3('0x1d')]||null:null,'limit':_0x11b81b['options']?_0x11b81b[_0x2ae3('0x1a')][_0x2ae3('0x1e')]||null:null})[_0x2ae3('0xe')](function(_0x155e49){logger[_0x2ae3('0xf')](_0x2ae3('0x1f'),_0x11b81b);logger[_0x2ae3('0x12')](_0x2ae3('0x1f'),_0x11b81b,JSON[_0x2ae3('0x20')](_0x155e49));_0x4da63b(_0x155e49);})['catch'](function(_0x31f952){logger['error'](_0x2ae3('0x1f'),_0x31f952[_0x2ae3('0x15')],_0x11b81b);_0x2957db(_0x124855['error'](0x1f4,_0x31f952[_0x2ae3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 1ae43e5..dd9016a 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 _0xdeed=['removeTags','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','openchannelinteraction:addtags','addTags','put','tracked','update','delete','openchannel'];(function(_0x315751,_0x42107d){var _0x2cdcd5=function(_0x3de2eb){while(--_0x3de2eb){_0x315751['push'](_0x315751['shift']());}};_0x2cdcd5(++_0x42107d);}(_0xdeed,0x16d));var _0xddee=function(_0x2c1f52,_0x1e6f49){_0x2c1f52=_0x2c1f52-0x0;var _0x241bc1=_0xdeed[_0x2c1f52];return _0x241bc1;};'use strict';var multer=require(_0xddee('0x0'));var util=require('util');var path=require(_0xddee('0x1'));var timeout=require(_0xddee('0x2'));var express=require(_0xddee('0x3'));var router=express[_0xddee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xddee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddee('0x6'));var controller=require(_0xddee('0x7'));router[_0xddee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xddee('0x8')](_0xddee('0x9'),auth[_0xddee('0xa')](),controller[_0xddee('0xb')]);router[_0xddee('0x8')](_0xddee('0xc'),auth['isAuthenticated'](),controller[_0xddee('0xd')]);router[_0xddee('0x8')](_0xddee('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xddee('0xf'),auth[_0xddee('0xa')](),controller[_0xddee('0x10')]);router[_0xddee('0x11')]('/',auth['isAuthenticated'](),controller[_0xddee('0x12')]);router[_0xddee('0x11')](_0xddee('0xe'),auth[_0xddee('0xa')](),controller[_0xddee('0x13')]);router[_0xddee('0x11')]('/:id/tags',auth[_0xddee('0xa')](),interaction['tracked']('openchannel',_0xddee('0x14')),controller[_0xddee('0x15')]);router[_0xddee('0x16')](_0xddee('0xc'),auth[_0xddee('0xa')](),interaction[_0xddee('0x17')]('openchannel','openchannelinteraction:update'),controller[_0xddee('0x18')]);router[_0xddee('0x19')](_0xddee('0xc'),auth['isAuthenticated'](),interaction[_0xddee('0x17')](_0xddee('0x1a'),'openchannelinteraction:destroy'),controller['destroy']);router[_0xddee('0x19')]('/:id/tags',auth[_0xddee('0xa')](),controller[_0xddee('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x41b0=['./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','/:id/download','download','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x41b0,0x1a9));var _0x041b=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x41b0[_0x54c9dd];return _0x855156;};'use strict';var multer=require(_0x041b('0x0'));var util=require(_0x041b('0x1'));var path=require(_0x041b('0x2'));var timeout=require(_0x041b('0x3'));var express=require(_0x041b('0x4'));var router=express[_0x041b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x041b('0x6'));var interaction=require(_0x041b('0x7'));var config=require(_0x041b('0x8'));var controller=require(_0x041b('0x9'));router[_0x041b('0xa')]('/',auth[_0x041b('0xb')](),controller[_0x041b('0xc')]);router[_0x041b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x041b('0xd')]);router['get']('/:id',auth[_0x041b('0xb')](),controller['show']);router[_0x041b('0xa')](_0x041b('0xe'),auth[_0x041b('0xb')](),controller['getMessages']);router[_0x041b('0xa')](_0x041b('0xf'),auth['isAuthenticated'](),controller[_0x041b('0x10')]);router['post']('/',auth[_0x041b('0xb')](),controller[_0x041b('0x11')]);router['post'](_0x041b('0xe'),auth[_0x041b('0xb')](),controller[_0x041b('0x12')]);router['post'](_0x041b('0x13'),auth[_0x041b('0xb')](),interaction[_0x041b('0x14')](_0x041b('0x15'),'openchannelinteraction:addtags'),controller[_0x041b('0x16')]);router[_0x041b('0x17')]('/:id',auth[_0x041b('0xb')](),interaction[_0x041b('0x14')](_0x041b('0x15'),_0x041b('0x18')),controller[_0x041b('0x19')]);router[_0x041b('0x1a')]('/:id',auth[_0x041b('0xb')](),interaction[_0x041b('0x14')](_0x041b('0x15'),_0x041b('0x1b')),controller[_0x041b('0x1c')]);router[_0x041b('0x1a')](_0x041b('0x13'),auth['isAuthenticated'](),controller[_0x041b('0x1d')]);module[_0x041b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 17a72a0..68a02c4 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 _0x32ef=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1eb05b,_0x190b22){var _0x134f13=function(_0x103c18){while(--_0x103c18){_0x1eb05b['push'](_0x1eb05b['shift']());}};_0x134f13(++_0x190b22);}(_0x32ef,0xf9));var _0xf32e=function(_0x215e1b,_0x447a1a){_0x215e1b=_0x215e1b-0x0;var _0x1db15c=_0x32ef[_0x215e1b];return _0x1db15c;};'use strict';var Sequelize=require(_0xf32e('0x0'));module[_0xf32e('0x1')]={'closed':{'type':Sequelize[_0xf32e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf32e('0x3')]},'disposition':{'type':Sequelize[_0xf32e('0x4')]},'secondDisposition':{'type':Sequelize[_0xf32e('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf32e('0x4')]},'read1stAt':{'type':Sequelize[_0xf32e('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xf32e('0x4')]},'lastMsgAt':{'type':Sequelize[_0xf32e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf32e('0x5')]('in',_0xf32e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf32e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xf32e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c88=['out','BOOLEAN','sequelize','exports','DATE','STRING'];(function(_0x163ab5,_0x55ec89){var _0x8180cc=function(_0x1a6bea){while(--_0x1a6bea){_0x163ab5['push'](_0x163ab5['shift']());}};_0x8180cc(++_0x55ec89);}(_0x5c88,0x158));var _0x85c8=function(_0x479a9e,_0x13399f){_0x479a9e=_0x479a9e-0x0;var _0x5c811c=_0x5c88[_0x479a9e];return _0x5c811c;};'use strict';var Sequelize=require(_0x85c8('0x0'));module[_0x85c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x85c8('0x2')]},'disposition':{'type':Sequelize[_0x85c8('0x3')]},'secondDisposition':{'type':Sequelize[_0x85c8('0x3')]},'thirdDisposition':{'type':Sequelize[_0x85c8('0x3')]},'note':{'type':Sequelize[_0x85c8('0x3')]},'read1stAt':{'type':Sequelize[_0x85c8('0x2')]},'threadId':{'type':Sequelize[_0x85c8('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x85c8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x85c8('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x85c8('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x85c8('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ef0e555..4111500 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 _0xb3cf=['jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','end','name','send','Users','map','fullname','Tags','TagIds','split','forEach','catch','index','OpenchannelInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','isEmpty','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','OpenchannelAccount','Account','Owner','get','N.A.','createdAt','closed','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','root','downloadInteraction.ejs','transcript-','.pdf','Openchannel','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x5b9ad6,_0x1bb22e){var _0xf726be=function(_0x2acf8a){while(--_0x2acf8a){_0x5b9ad6['push'](_0x5b9ad6['shift']());}};_0xf726be(++_0x1bb22e);}(_0xb3cf,0x1d1));var _0xfb3c=function(_0x375b7d,_0x243a50){_0x375b7d=_0x375b7d-0x0;var _0x4b4cfb=_0xb3cf[_0x375b7d];return _0x4b4cfb;};'use strict';var emlformat=require(_0xfb3c('0x0'));var rimraf=require(_0xfb3c('0x1'));var zipdir=require(_0xfb3c('0x2'));var jsonpatch=require(_0xfb3c('0x3'));var rp=require(_0xfb3c('0x4'));var moment=require(_0xfb3c('0x5'));var BPromise=require(_0xfb3c('0x6'));var Mustache=require(_0xfb3c('0x7'));var util=require(_0xfb3c('0x8'));var path=require(_0xfb3c('0x9'));var sox=require(_0xfb3c('0xa'));var csv=require('to-csv');var ejs=require(_0xfb3c('0xb'));var fs=require('fs');var fs_extra=require(_0xfb3c('0xc'));var _=require(_0xfb3c('0xd'));var squel=require(_0xfb3c('0xe'));var crypto=require('crypto');var jsforce=require(_0xfb3c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb3c('0x10'));var querystring=require(_0xfb3c('0x11'));var Papa=require(_0xfb3c('0x12'));var Redis=require('ioredis');var authService=require(_0xfb3c('0x13'));var qs=require(_0xfb3c('0x14'));var as=require(_0xfb3c('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xfb3c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xfb3c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfb3c('0x18'));var db=require('../../mysqldb')['db'];config[_0xfb3c('0x19')]=_[_0xfb3c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb3c('0x1b'))(new Redis(config[_0xfb3c('0x19')]));require(_0xfb3c('0x1c'))[_0xfb3c('0x1d')](socket);function respondWithStatusCode(_0x3ce884,_0x15ea77){_0x15ea77=_0x15ea77||0xcc;return function(_0x40f3ca){if(_0x40f3ca){return _0x3ce884[_0xfb3c('0x1e')](_0x15ea77);}return _0x3ce884['status'](_0x15ea77)['end']();};}function respondWithResult(_0x57ae45,_0x3a6ccc){_0x3a6ccc=_0x3a6ccc||0xc8;return function(_0x16ceb4){if(_0x16ceb4){return _0x57ae45[_0xfb3c('0x1f')](_0x3a6ccc)[_0xfb3c('0x20')](_0x16ceb4);}};}function respondWithFilteredResult(_0xac43bf,_0x2e846c){return function(_0x3cb1db){if(_0x3cb1db){var _0x33f9c9=typeof _0x2e846c['offset']==='undefined'&&typeof _0x2e846c[_0xfb3c('0x21')]===_0xfb3c('0x22');var _0x2f16e1=_0x3cb1db[_0xfb3c('0x23')];var _0x282014=_0x33f9c9?0x0:_0x2e846c[_0xfb3c('0x24')];var _0x271056=_0x33f9c9?_0x3cb1db[_0xfb3c('0x23')]:_0x2e846c['offset']+_0x2e846c[_0xfb3c('0x21')];var _0x4c3859;if(_0x271056>=_0x2f16e1){_0x271056=_0x2f16e1;_0x4c3859=0xc8;}else{_0x4c3859=0xce;}_0xac43bf[_0xfb3c('0x1f')](_0x4c3859);return _0xac43bf[_0xfb3c('0x25')](_0xfb3c('0x26'),_0x282014+'-'+_0x271056+'/'+_0x2f16e1)[_0xfb3c('0x20')](_0x3cb1db);}return null;};}function patchUpdates(_0x155994){return function(_0x57bd93){try{jsonpatch['apply'](_0x57bd93,_0x155994,!![]);}catch(_0x2e1ef7){return BPromise[_0xfb3c('0x27')](_0x2e1ef7);}return _0x57bd93[_0xfb3c('0x28')]();};}function saveUpdates(_0x48061e,_0x5cb4ea){return function(_0x2a84fd){if(_0x2a84fd){return _0x2a84fd['update'](_0x48061e)[_0xfb3c('0x29')](function(_0x47b38b){return _0x47b38b;});}return null;};}function removeEntity(_0x273ff3,_0x1c0bcd){return function(_0x3340c9){if(_0x3340c9){return _0x3340c9[_0xfb3c('0x2a')]()[_0xfb3c('0x29')](function(){_0x273ff3['status'](0xcc)[_0xfb3c('0x2b')]();});}};}function handleEntityNotFound(_0x17ace2,_0x304ea5){return function(_0x4d1092){if(!_0x4d1092){_0x17ace2[_0xfb3c('0x1e')](0x194);}return _0x4d1092;};}function handleError(_0x39dcd2,_0x576fc4){_0x576fc4=_0x576fc4||0x1f4;return function(_0x5a978c){logger['error'](_0x5a978c['stack']);if(_0x5a978c[_0xfb3c('0x2c')]){delete _0x5a978c[_0xfb3c('0x2c')];}_0x39dcd2[_0xfb3c('0x1f')](_0x576fc4)[_0xfb3c('0x2d')](_0x5a978c);};}function getInteractionUsers(_0x3f2cfa,_0x3050f6){return new BPromise(function(_0x2bfd64,_0x4f48d2){try{if(_0x3050f6[_0x3f2cfa['id']]){_0x3f2cfa[_0xfb3c('0x2e')]=_[_0xfb3c('0x2f')](_0x3050f6[_0x3f2cfa['id']],function(_0x33d4f6){return{'id':_0x33d4f6['id'],'fullname':_0x33d4f6[_0xfb3c('0x30')]};});}}catch(_0x30bb7a){_0x4f48d2(_0x30bb7a);}_0x2bfd64(_0x3f2cfa);});}function getInteractionTags(_0x32c7e7,_0x33cd29){return new BPromise(function(_0xc31c9,_0x4ca239){try{if(_0x32c7e7['TagIds']){_0x32c7e7[_0xfb3c('0x31')]=[];_0x32c7e7[_0xfb3c('0x32')][_0xfb3c('0x33')](',')[_0xfb3c('0x34')](function(_0x4a6924){_0x32c7e7[_0xfb3c('0x31')]['push'](_0x33cd29[_0x4a6924]);});}delete _0x32c7e7[_0xfb3c('0x32')];}catch(_0x136854){_0x4ca239(_0x136854);}_0xc31c9(_0x32c7e7);});}function updateOpenchannelInteraction(_0x58fbaa,_0x298a58,_0x4ee356){return new BPromise(function(_0x4e1b73,_0x2d1825){return getInteractionUsers(_0x58fbaa,_0x4ee356)[_0xfb3c('0x29')](function(_0x1c3afb){return getInteractionTags(_0x1c3afb,_0x298a58);})[_0xfb3c('0x29')](function(_0x44e6dc){_0x4e1b73(_0x44e6dc);})[_0xfb3c('0x35')](function(_0x232aa8){_0x2d1825(_0x232aa8);});});}exports[_0xfb3c('0x36')]=function(_0x31ce97,_0x4334c2){var _0x4c7fe2={},_0x42fab1={},_0x46f9db={'count':0x0,'rows':[]};var _0xbff696=_[_0xfb3c('0x2f')](db[_0xfb3c('0x37')]['rawAttributes'],function(_0x32e49d){return{'name':_0x32e49d[_0xfb3c('0x38')],'type':_0x32e49d[_0xfb3c('0x39')][_0xfb3c('0x3a')]};});_0x42fab1[_0xfb3c('0x3b')]=_[_0xfb3c('0x2f')](_0xbff696,_0xfb3c('0x2c'));_0x42fab1[_0xfb3c('0x3c')]=_['keys'](_0x31ce97[_0xfb3c('0x3c')]);_0x42fab1[_0xfb3c('0x3d')]=_[_0xfb3c('0x3e')](_0x42fab1[_0xfb3c('0x3b')],_0x42fab1[_0xfb3c('0x3c')]);_0x4c7fe2[_0xfb3c('0x3f')]=_[_0xfb3c('0x3e')](_0x42fab1[_0xfb3c('0x3b')],qs[_0xfb3c('0x40')](_0x31ce97['query']['fields']));_0x4c7fe2['attributes']=_0x4c7fe2[_0xfb3c('0x3f')][_0xfb3c('0x41')]?_0x4c7fe2[_0xfb3c('0x3f')]:_0x42fab1[_0xfb3c('0x3b')];if(!_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x42')](_0xfb3c('0x43'))){_0x4c7fe2[_0xfb3c('0x21')]=qs['limit'](_0x31ce97['query']['limit']);_0x4c7fe2[_0xfb3c('0x24')]=qs[_0xfb3c('0x24')](_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x24')]);}_0x4c7fe2['order']=qs['sort'](_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x44')]);_0x4c7fe2[_0xfb3c('0x45')]=qs[_0xfb3c('0x3d')](_[_0xfb3c('0x46')](_0x31ce97['query'],_0x42fab1[_0xfb3c('0x3d')]),_0xbff696);var _0x52e3bd=[];var _0x6f68ce=squel['select']()[_0xfb3c('0x47')]('id')[_0xfb3c('0x47')]('name')[_0xfb3c('0x47')](_0xfb3c('0x48'))[_0xfb3c('0x49')](_0xfb3c('0x4a'));var _0x12d363=squel[_0xfb3c('0x4b')]()[_0xfb3c('0x47')](_0xfb3c('0x4c'))[_0xfb3c('0x47')](_0xfb3c('0x4d'))[_0xfb3c('0x47')]('ui.OpenchannelInteractionId')[_0xfb3c('0x49')](_0xfb3c('0x4e'),'ui')[_0xfb3c('0x4f')](_0xfb3c('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x376bca=squel['select']()[_0xfb3c('0x49')]('openchannel_interactions','i')[_0xfb3c('0x4f')](_0xfb3c('0x51'),'c',_0xfb3c('0x52'))[_0xfb3c('0x4f')](_0xfb3c('0x50'),'o',_0xfb3c('0x53'))[_0xfb3c('0x4f')](_0xfb3c('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xfb3c('0x55'),'me',_0xfb3c('0x56'))['left_join'](_0xfb3c('0x57'),'it',_0xfb3c('0x58'))[_0xfb3c('0x4f')](_0xfb3c('0x4a'),'t',_0xfb3c('0x59'));var _0xa0cab1=squel[_0xfb3c('0x5a')]();var _0x212dc7=[];var _0x37b1c1=squel[_0xfb3c('0x5a')]();var _0x50c242;if(_0x31ce97['query'][_0xfb3c('0x5b')]){_0x50c242=as[_0xfb3c('0x5c')](_0x31ce97[_0xfb3c('0x3c')]['search']);var _0x2e2be9=_0x50c242['sqlOperator'];for(var _0x2637d1=0x0;_0x2637d1<_0x50c242[_0xfb3c('0x5d')][_0xfb3c('0x41')];_0x2637d1++){var _0x34e9a3=_0x50c242['conditions'][_0x2637d1];var _0x593bdc='i';var _0xf6afaa=_[_0xfb3c('0x5e')](_0xbff696,[_0xfb3c('0x2c'),_0x34e9a3[_0xfb3c('0x47')]]);if(!_0xf6afaa){switch(_0x34e9a3[_0xfb3c('0x47')]){case _0xfb3c('0x5f'):if(_0x34e9a3[_0xfb3c('0x60')]==0x1){_0x376bca[_0xfb3c('0x61')]('`'+_0x34e9a3[_0xfb3c('0x47')]+_0xfb3c('0x62'));}else{_0x376bca['having']('`'+_0x34e9a3['field']+_0xfb3c('0x63'));}break;case'Contact':if(_0x34e9a3[_0xfb3c('0x64')]===_0xfb3c('0x65')){if(_0x34e9a3[_0xfb3c('0x60')][_0xfb3c('0x33')]('\x20')[_0xfb3c('0x41')]>0x1){_0xa0cab1[_0x2e2be9](_0xfb3c('0x66'),qs[_0xfb3c('0x67')](_0x34e9a3['value']),null);}else{var _0x867e09='%'+_0x34e9a3[_0xfb3c('0x60')]+'%';_0xa0cab1[_0x2e2be9](_0xfb3c('0x68'),_0x867e09,_0x867e09,_0x867e09);}}else{_0xf6afaa=_['find'](_0xbff696,[_0xfb3c('0x2c'),'ContactId']);_0x34e9a3[_0xfb3c('0x47')]=_0xfb3c('0x69');_0x4d4af9=as[_0xfb3c('0x6a')](_0x593bdc,_0xf6afaa[_0xfb3c('0x39')],_0x34e9a3);_0xa0cab1[_0x2e2be9](_0x4d4af9[_0xfb3c('0x6b')],_0x4d4af9['value'][_0xfb3c('0x6c')],_0x4d4af9[_0xfb3c('0x60')]['end']);}break;case _0xfb3c('0x6d'):var _0x2ff99f=_0x34e9a3[_0xfb3c('0x60')]['split'](',')[_0xfb3c('0x2f')](function(_0x56afe1){return Number(_0x56afe1);});_0x2ff99f[_0xfb3c('0x34')](function(_0x2a8118){_0x37b1c1['or'](_0xfb3c('0x6e'),'%,'+_0x2a8118+',%');});_0x212dc7=_['union'](_0x212dc7,_0x2ff99f);break;case _0xfb3c('0x6f'):if(_0x34e9a3['operator']===_0xfb3c('0x65')){_0xa0cab1[_0x2e2be9](_0xfb3c('0x70'),'%'+_0x34e9a3[_0xfb3c('0x60')]+'%',null);}else{_0xf6afaa=_['find'](_0xbff696,[_0xfb3c('0x2c'),_0xfb3c('0x71')]);_0x34e9a3[_0xfb3c('0x47')]=_0xfb3c('0x71');_0x4d4af9=as[_0xfb3c('0x6a')](_0x593bdc,_0xf6afaa['type'],_0x34e9a3);_0xa0cab1[_0x2e2be9](_0x4d4af9[_0xfb3c('0x6b')],_0x4d4af9['value'][_0xfb3c('0x6c')],_0x4d4af9[_0xfb3c('0x60')][_0xfb3c('0x2b')]);}break;case _0xfb3c('0x72'):_0x4d4af9=as[_0xfb3c('0x6a')]('me',null,_0x34e9a3);_0xa0cab1[_0x2e2be9](_0x4d4af9[_0xfb3c('0x6b')],_0x4d4af9[_0xfb3c('0x60')][_0xfb3c('0x6c')],_0x4d4af9[_0xfb3c('0x60')][_0xfb3c('0x2b')]);break;}}else{var _0x4d4af9=as[_0xfb3c('0x6a')](_0x593bdc,_0xf6afaa[_0xfb3c('0x39')],_0x34e9a3);_0xa0cab1[_0x2e2be9](_0x4d4af9[_0xfb3c('0x6b')],_0x4d4af9[_0xfb3c('0x60')][_0xfb3c('0x6c')],_0x4d4af9['value'][_0xfb3c('0x2b')]);}}}else{var _0x325b35=_(_0x31ce97[_0xfb3c('0x3c')])[_0xfb3c('0x73')]()[_0xfb3c('0x2f')](function(_0x6ff2f5){return _['some'](_0xbff696,[_0xfb3c('0x2c'),_0x6ff2f5])?_0x6ff2f5:undefined;})[_0xfb3c('0x74')]()[_0xfb3c('0x60')]();if(!_[_0xfb3c('0x75')](_0x325b35)){_0x325b35['forEach'](function(_0x379479){if(_0x379479===_0xfb3c('0x76')){_0x376bca[_0xfb3c('0x45')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xfb3c('0x77')](_0x31ce97[_0xfb3c('0x3c')][_0x379479]));}else if(_0x379479==='createdAt'){var _0x10fd19=JSON[_0xfb3c('0x78')](_0x31ce97['query'][_0x379479])[_0xfb3c('0x79')];var _0x17f9c2=JSON[_0xfb3c('0x78')](_0x31ce97[_0xfb3c('0x3c')][_0x379479])[_0xfb3c('0x7a')];_0x376bca[_0xfb3c('0x45')](_0xfb3c('0x7b'),_0x10fd19,_0x17f9c2);}else{if(_0x31ce97[_0xfb3c('0x3c')][_0x379479]===_0xfb3c('0x7c')){_0x376bca[_0xfb3c('0x45')]('i.'+_0x379479+_0xfb3c('0x7d'));}else{_0x376bca[_0xfb3c('0x45')]('i.'+_0x379479+_0xfb3c('0x7e'),_0x31ce97[_0xfb3c('0x3c')][_0x379479]);}}});}if(_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x7f')]){if(_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x7f')]==0x1){_0x376bca[_0xfb3c('0x61')](_0xfb3c('0x80'));}else{_0x376bca['having'](_0xfb3c('0x81'));}}if(_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x82')]){_0x212dc7=_[_0xfb3c('0x83')](_0x31ce97[_0xfb3c('0x3c')]['tag'])?_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x82')]:new Array(_0x31ce97['query'][_0xfb3c('0x82')]);_0x212dc7['forEach'](function(_0x322e69){_0x37b1c1['or'](_0xfb3c('0x6e'),'%,'+_0x322e69+',%');});}if(_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x84')]){var _0x353733=_0x31ce97['query'][_0xfb3c('0x84')][_0xfb3c('0x85')]('\x5c','\x5c\x5c')[_0xfb3c('0x85')](/'/g,'\x27\x27');if(qs[_0xfb3c('0x86')](_0x353733)){_0xa0cab1['or']('i.id\x20LIKE\x20?',_0x353733+'%');}else{_0xa0cab1['or'](_0xfb3c('0x87'),qs[_0xfb3c('0x67')](_0x353733))['or'](_0xfb3c('0x88'),_0x353733+'%')['or'](_0xfb3c('0x89'),_0x353733+'%');}}}_0x376bca[_0xfb3c('0x45')](_0xa0cab1);_0x376bca[_0xfb3c('0x8a')](_0xfb3c('0x8b'));var _0x5f29e4={'type':db['Sequelize'][_0xfb3c('0x8c')][_0xfb3c('0x8d')],'raw':!![]};var _0x1c1ca0=_0x376bca[_0xfb3c('0x8e')]();_0x1c1ca0['field'](_0xfb3c('0x8b'));_0x1c1ca0[_0xfb3c('0x47')](_0xfb3c('0x8f'),_0xfb3c('0x5f'));if(_0x4c7fe2[_0xfb3c('0x90')]){_0x4c7fe2[_0xfb3c('0x90')][_0xfb3c('0x34')](function(_0x1473d1){var _0x1535a0=_0x1473d1[0x0]===_0xfb3c('0x91')?_0x1473d1[0x0]:'i.'+_0x1473d1[0x0];_0x376bca[_0xfb3c('0x90')](_0x1535a0,_0x1473d1[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfb3c('0x75')](_0x212dc7)){_0x376bca[_0xfb3c('0x61')](_0x37b1c1);_0x1c1ca0[_0xfb3c('0x45')](_0xfb3c('0x92'),_0x212dc7);}BPromise[_0xfb3c('0x93')]()[_0xfb3c('0x29')](function(){if(!_0x50c242){if(_0x31ce97[_0xfb3c('0x3c')]['OpenchannelAccountId'])return;_0x1c1ca0[_0xfb3c('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x376bca[_0xfb3c('0x45')](_0xfb3c('0x94'));return;}if(_0x31ce97[_0xfb3c('0x95')][_0xfb3c('0x96')]!==_0xfb3c('0x97'))return;return _0x31ce97[_0xfb3c('0x95')][_0xfb3c('0x98')]({'attributes':['id'],'raw':!![]})[_0xfb3c('0x29')](function(_0x23b497){if(_[_0xfb3c('0x75')](_0x23b497)){_0x1c1ca0[_0xfb3c('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x376bca[_0xfb3c('0x45')](_0xfb3c('0x99'));}else{_0x1c1ca0['where'](_0xfb3c('0x9a'),_[_0xfb3c('0x2f')](_0x23b497,'id'));_0x376bca[_0xfb3c('0x45')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xfb3c('0x2f')](_0x23b497,'id'));}});})[_0xfb3c('0x29')](function(){if(_0x31ce97[_0xfb3c('0x95')]['role']==='agent'&&!_0x50c242&&!_0x31ce97[_0xfb3c('0x3c')][_0xfb3c('0x76')])return[];return db[_0xfb3c('0x9b')][_0xfb3c('0x3c')](_0x1c1ca0[_0xfb3c('0x9c')](),_0x5f29e4);})[_0xfb3c('0x29')](function(_0x46255c){_0x46f9db[_0xfb3c('0x23')]=_0x46255c['length'];if(_0x46f9db[_0xfb3c('0x23')]===0x0)return[];return db[_0xfb3c('0x9b')][_0xfb3c('0x3c')](_0x6f68ce[_0xfb3c('0x9c')](),_0x5f29e4)[_0xfb3c('0x29')](function(_0x2c3fd7){_0x52e3bd=_['keyBy'](_0x2c3fd7,'id');_0x5f29e4=_[_0xfb3c('0x9d')](_0x5f29e4,{'model':db[_0xfb3c('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31ce97['query'][_0xfb3c('0x40')]){_0x4c7fe2[_0xfb3c('0x3f')][_0xfb3c('0x34')](function(_0x22f6fd){_0x376bca[_0xfb3c('0x47')]('i.'+_0x22f6fd);});}else{_0x376bca[_0xfb3c('0x47')](_0xfb3c('0x8f'),_0xfb3c('0x5f'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0x9e'),'Account.key');_0x376bca[_0xfb3c('0x47')](_0xfb3c('0x9f'),_0xfb3c('0xa0'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xa1'),_0xfb3c('0x91'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xa2'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xa3'),_0xfb3c('0xa4'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xa5'),_0xfb3c('0xa6'));_0x376bca['field'](_0xfb3c('0xa7'),_0xfb3c('0xa8'));_0x376bca[_0xfb3c('0x47')]('c.phone',_0xfb3c('0xa9'));_0x376bca[_0xfb3c('0x47')]('c.mobile',_0xfb3c('0xaa'));_0x376bca[_0xfb3c('0x47')]('c.fax','Contact.fax');_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xab'),_0xfb3c('0xac'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xad'),_0xfb3c('0xae'));_0x376bca[_0xfb3c('0x47')](_0xfb3c('0xaf'),'TagIds');}if(_0x4c7fe2[_0xfb3c('0x21')])_0x376bca['limit'](_0x4c7fe2[_0xfb3c('0x21')]);if(_0x4c7fe2[_0xfb3c('0x24')])_0x376bca['offset'](_0x4c7fe2['offset']);return db[_0xfb3c('0x9b')][_0xfb3c('0x3c')](_0x376bca[_0xfb3c('0x9c')](),_0x5f29e4);})[_0xfb3c('0x29')](function(_0x3ac0a4){if(_0x3ac0a4[_0xfb3c('0x41')]>0x0)_0x12d363[_0xfb3c('0x45')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xfb3c('0x2f')](_0x3ac0a4,'id'));return db[_0xfb3c('0x9b')][_0xfb3c('0x3c')](_0x12d363[_0xfb3c('0x9c')](),_0x5f29e4)['then'](function(_0x214054){var _0x47b560=_[_0xfb3c('0xb0')](_0x214054,_0xfb3c('0xb1'));var _0x3b66e4=[];_0x3ac0a4[_0xfb3c('0x34')](function(_0x3074fe){_0x3b66e4[_0xfb3c('0xb2')](updateOpenchannelInteraction(_0x3074fe,_0x52e3bd,_0x47b560));});return BPromise[_0xfb3c('0xb3')](_0x3b66e4);});});})[_0xfb3c('0x29')](function(_0x4e2608){_0x46f9db[_0xfb3c('0xb4')]=_0x4e2608;return _0x46f9db;})['then'](respondWithFilteredResult(_0x4334c2,_0x4c7fe2))[_0xfb3c('0x35')](handleError(_0x4334c2,null));};exports[_0xfb3c('0xb5')]=function(_0x306047,_0x5eddb4){var _0xd8d5f0={};if(_0x306047[_0xfb3c('0x3c')]['type']&&_0x306047[_0xfb3c('0x3c')][_0xfb3c('0x39')]===_0xfb3c('0x49')){_0xd8d5f0[_0xfb3c('0x49')]=_0x306047['params']['id'];}else{_0xd8d5f0['id']=_0x306047[_0xfb3c('0xb6')]['id'];}var _0x500bd2={'raw':![],'where':_0xd8d5f0},_0x3cf5db={};_0x3cf5db[_0xfb3c('0x3b')]=_[_0xfb3c('0x73')](db[_0xfb3c('0x37')][_0xfb3c('0xb7')]);_0x3cf5db[_0xfb3c('0x3c')]=_[_0xfb3c('0x73')](_0x306047[_0xfb3c('0x3c')]);_0x3cf5db[_0xfb3c('0x3d')]=_['intersection'](_0x3cf5db[_0xfb3c('0x3b')],_0x3cf5db[_0xfb3c('0x3c')]);_0x500bd2['attributes']=_['intersection'](_0x3cf5db[_0xfb3c('0x3b')],qs[_0xfb3c('0x40')](_0x306047['query'][_0xfb3c('0x40')]));_0x500bd2[_0xfb3c('0x3f')]=_0x500bd2[_0xfb3c('0x3f')][_0xfb3c('0x41')]?_0x500bd2['attributes']:_0x3cf5db[_0xfb3c('0x3b')];if(_0x306047['query'][_0xfb3c('0xb8')]){_0x500bd2[_0xfb3c('0xb9')]=[{'all':!![]}];}_0x500bd2=_[_0xfb3c('0x9d')]({},_0x500bd2,_0x306047[_0xfb3c('0xba')]);return db[_0xfb3c('0x37')][_0xfb3c('0x5e')](_0x500bd2)['then'](handleEntityNotFound(_0x5eddb4,null))[_0xfb3c('0x29')](respondWithResult(_0x5eddb4,null))[_0xfb3c('0x35')](handleError(_0x5eddb4,null));};exports[_0xfb3c('0xbb')]=function(_0x4e689f,_0x9b2e76){return db[_0xfb3c('0x37')]['create'](_0x4e689f[_0xfb3c('0x72')],{})[_0xfb3c('0x29')](respondWithResult(_0x9b2e76,0xc9))[_0xfb3c('0x35')](handleError(_0x9b2e76,null));};exports['update']=function(_0xa94bc8,_0x5e3b52){if(_0xa94bc8[_0xfb3c('0x72')]['id']){delete _0xa94bc8['body']['id'];}return db['OpenchannelInteraction'][_0xfb3c('0x5e')]({'where':{'id':_0xa94bc8[_0xfb3c('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5e3b52,null))[_0xfb3c('0x29')](saveUpdates(_0xa94bc8['body'],null))['then'](respondWithResult(_0x5e3b52,null))[_0xfb3c('0x35')](handleError(_0x5e3b52,null));};exports[_0xfb3c('0x2a')]=function(_0x14e53f,_0x42e2b1){return db['OpenchannelInteraction'][_0xfb3c('0x5e')]({'where':{'id':_0x14e53f[_0xfb3c('0xb6')]['id']}})['then'](handleEntityNotFound(_0x42e2b1,null))['then'](removeEntity(_0x42e2b1,null))['catch'](handleError(_0x42e2b1,null));};exports[_0xfb3c('0xbc')]=function(_0x2a9091,_0x3fee76){return db[_0xfb3c('0x37')]['describe']()[_0xfb3c('0x29')](respondWithResult(_0x3fee76,null))['catch'](handleError(_0x3fee76,null));};exports['addMessage']=function(_0x16e47c,_0x1cf688,_0xee7e58){return db[_0xfb3c('0xbd')]['find']({'where':{'id':_0x16e47c[_0xfb3c('0xb6')]['id']}})[_0xfb3c('0x29')](handleEntityNotFound(_0x1cf688,null))['then'](function(_0x58e7d4){if(_0x58e7d4){return _0x58e7d4['addMessage'](_0x16e47c['body'][_0xfb3c('0xbe')],_[_0xfb3c('0xbf')](_0x16e47c[_0xfb3c('0x72')],['ids','id'])||{});}})[_0xfb3c('0x29')](respondWithResult(_0x1cf688,null))['catch'](handleError(_0x1cf688,null));};exports[_0xfb3c('0xc0')]=function(_0x8e8207,_0x24e2a9,_0x53844d){var _0x2762ba={'raw':![],'where':{}};var _0x1ce14c={};var _0x20dcc8={'count':0x0,'rows':[]};return db[_0xfb3c('0x37')]['findOne']({'where':{'id':_0x8e8207[_0xfb3c('0xb6')]['id']}})[_0xfb3c('0x29')](handleEntityNotFound(_0x24e2a9,null))['then'](function(_0x19352f){if(_0x19352f){_0x1ce14c[_0xfb3c('0x3b')]=_[_0xfb3c('0x73')](db[_0xfb3c('0xbd')][_0xfb3c('0xb7')]);_0x1ce14c['query']=_[_0xfb3c('0x73')](_0x8e8207[_0xfb3c('0x3c')]);_0x1ce14c[_0xfb3c('0x3d')]=_['intersection'](_0x1ce14c[_0xfb3c('0x3b')],_0x1ce14c[_0xfb3c('0x3c')]);_0x2762ba[_0xfb3c('0x3f')]=_[_0xfb3c('0x3e')](_0x1ce14c['model'],qs['fields'](_0x8e8207['query'][_0xfb3c('0x40')]));_0x2762ba['attributes']=_0x2762ba['attributes'][_0xfb3c('0x41')]?_0x2762ba[_0xfb3c('0x3f')]:_0x1ce14c['model'];if(!_0x8e8207['query'][_0xfb3c('0x42')]('nolimit')){_0x2762ba[_0xfb3c('0x21')]=qs[_0xfb3c('0x21')](_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x21')]);_0x2762ba[_0xfb3c('0x24')]=qs['offset'](_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x24')]);}_0x2762ba[_0xfb3c('0x90')]=qs[_0xfb3c('0x44')](_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x44')]);_0x2762ba[_0xfb3c('0x45')]=qs[_0xfb3c('0x3d')](_[_0xfb3c('0x46')](_0x8e8207[_0xfb3c('0x3c')],_0x1ce14c[_0xfb3c('0x3d')]));_0x2762ba['where']['OpenchannelInteractionId']=_0x19352f['id'];if(_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x84')]){_0x2762ba[_0xfb3c('0x45')]=_['merge'](_0x2762ba[_0xfb3c('0x45')],{'$or':_[_0xfb3c('0x2f')](_0x2762ba[_0xfb3c('0x3f')],function(_0xbb11d4){var _0x34fe23={};_0x34fe23[_0xbb11d4]={'$like':'%'+_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x84')]+'%'};return _0x34fe23;})});}if(_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x79')]){var _0x1b3918=_0x8e8207[_0xfb3c('0x3c')][_0xfb3c('0x79')]['split'](',');var _0x3a53dd={};_0x3a53dd[_0x1b3918[0x0]]={'$gte':moment(_0x1b3918[0x1])[_0xfb3c('0xc1')](_0xfb3c('0xc2'))};_0x2762ba[_0xfb3c('0x45')]=_['merge'](_0x2762ba[_0xfb3c('0x45')],_0x3a53dd);}_0x2762ba=_[_0xfb3c('0x9d')]({},_0x2762ba,_0x8e8207['options']);return db[_0xfb3c('0xbd')]['count']({'where':_0x2762ba[_0xfb3c('0x45')]})[_0xfb3c('0x29')](function(_0x2949b0){_0x20dcc8[_0xfb3c('0x23')]=_0x2949b0;if(_0x8e8207['query'][_0xfb3c('0xb8')]){_0x2762ba[_0xfb3c('0xb9')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xfb3c('0xc3')](_0x2762ba);})[_0xfb3c('0x29')](function(_0x3372f){_0x20dcc8[_0xfb3c('0xb4')]=_0x3372f;return _0x20dcc8;});}})[_0xfb3c('0x29')](respondWithFilteredResult(_0x24e2a9,_0x2762ba))[_0xfb3c('0x35')](handleError(_0x24e2a9,null));};exports['addTags']=function(_0x18b488,_0x31a3cd,_0x19b492){return db[_0xfb3c('0x37')][_0xfb3c('0x5e')]({'where':{'id':_0x18b488['params']['id']}})[_0xfb3c('0x29')](handleEntityNotFound(_0x31a3cd,null))[_0xfb3c('0x29')](function(_0x35d3e0){if(_0x35d3e0){return _0x35d3e0['setTags'](_0x18b488[_0xfb3c('0x72')]['ids'],_[_0xfb3c('0xbf')](_0x18b488[_0xfb3c('0x72')],['ids','id'])||{})[_0xfb3c('0xc4')](function(){return db[_0xfb3c('0x6d')][_0xfb3c('0xc3')]({'attributes':['id','name',_0xfb3c('0x48')],'where':{'id':_0x18b488[_0xfb3c('0x72')][_0xfb3c('0xbe')]}});})['then'](function(_0x478fef){socket[_0xfb3c('0xc5')](_0xfb3c('0xc6'),{'id':Number(_0x18b488[_0xfb3c('0xb6')]['id']),'tags':_0x478fef||[]});return{'id':Number(_0x18b488[_0xfb3c('0xb6')]['id']),'tags':_0x478fef||[]};});}})[_0xfb3c('0x29')](respondWithResult(_0x31a3cd,null))[_0xfb3c('0x35')](handleError(_0x31a3cd,null));};exports[_0xfb3c('0xc7')]=function(_0x7d4b12,_0x48687e,_0x1e2da3){return db[_0xfb3c('0x37')]['find']({'where':{'id':_0x7d4b12['params']['id']}})[_0xfb3c('0x29')](handleEntityNotFound(_0x48687e,null))[_0xfb3c('0x29')](function(_0xafbfd3){if(_0xafbfd3){return _0xafbfd3[_0xfb3c('0xc7')](_0x7d4b12[_0xfb3c('0x3c')][_0xfb3c('0xbe')]);}})[_0xfb3c('0x29')](respondWithStatusCode(_0x48687e,null))[_0xfb3c('0x35')](handleError(_0x48687e,null));};exports[_0xfb3c('0xc8')]=function(_0x97efe8,_0x18b29a){var _0xb666db=moment()[_0xfb3c('0xc9')]()[_0xfb3c('0x9c')]();var _0x147852=path[_0xfb3c('0xca')](config['root'],'server',_0xfb3c('0xcb'),_0xfb3c('0xcc'));var _0xd09865=path[_0xfb3c('0xca')](config['root'],_0xfb3c('0xcd'),_0xfb3c('0xcb'),_0xfb3c('0xce'));var _0x202fb3=path[_0xfb3c('0xca')](_0x147852,_0xb666db);var _0x8b9bf6=util[_0xfb3c('0xc1')](_0xfb3c('0xcf'),_0x97efe8[_0xfb3c('0xb6')]['id'],_0xb666db);var _0x588c6c=path['join'](_0x147852,_0x8b9bf6);var _0x266805=[];_0x266805[_0xfb3c('0xb2')]({'model':db[_0xfb3c('0x6f')],'as':_0xfb3c('0x6f'),'attributes':['id',_0xfb3c('0x30')],'raw':!![]});_0x266805['push']({'model':db[_0xfb3c('0xd0')],'as':_0xfb3c('0xd1'),'attributes':['id',_0xfb3c('0xd2'),_0xfb3c('0xd3')],'raw':!![]});if(_0x97efe8[_0xfb3c('0x3c')][_0xfb3c('0xce')]){_0x266805[_0xfb3c('0xb2')]({'model':db[_0xfb3c('0xd4')],'as':'Attachment','raw':!![]});}var _0x4952b0=[{'model':db['OpenchannelMessage'],'as':_0xfb3c('0xd5'),'attributes':['id',_0xfb3c('0x72'),'createdAt',_0xfb3c('0xd6'),'secret',_0xfb3c('0x7f')],'include':_0x266805}];_0x4952b0[_0xfb3c('0xb2')]({'model':db[_0xfb3c('0xd7')],'as':_0xfb3c('0xd8'),'attributes':['id','name']});_0x4952b0[_0xfb3c('0xb2')]({'model':db[_0xfb3c('0x6f')],'as':_0xfb3c('0xd9'),'attributes':['id',_0xfb3c('0x30')]});return db[_0xfb3c('0x37')][_0xfb3c('0x5e')]({'where':{'id':_0x97efe8[_0xfb3c('0xb6')]['id']},'include':_0x4952b0})['then'](handleEntityNotFound(_0x18b29a,null))[_0xfb3c('0x29')](function(_0xcef396){if(_0xcef396){var _0x17ac95=_0xcef396[_0xfb3c('0xda')]({'plain':!![]});fs['mkdirSync'](_0x202fb3);var _0x56be0b={'channel':'Openchannel','account':_0x17ac95[_0xfb3c('0xd8')][_0xfb3c('0x2c')],'agent':_0x17ac95['Owner']?_0x17ac95[_0xfb3c('0xd9')]['fullname']:_0xfb3c('0xdb'),'createdAt':moment(_0x17ac95[_0xfb3c('0xdc')])[_0xfb3c('0xc1')](_0xfb3c('0xc2'))[_0xfb3c('0x9c')](),'closedAt':_0x17ac95[_0xfb3c('0xdd')]?moment(_0x17ac95['closedAt'])[_0xfb3c('0xc1')](_0xfb3c('0xc2'))[_0xfb3c('0x9c')]():'','disposition':_0x17ac95[_0xfb3c('0xde')],'visibility':_0x17ac95[_0xfb3c('0xdf')]?_0xfb3c('0xe0'):_0xfb3c('0xe1'),'messages':_(_0x17ac95[_0xfb3c('0xd5')])['filter']({'secret':![]})['map'](function(_0x11cec8){if(_0x11cec8[_0xfb3c('0xd4')]){var _0xc9da00=path[_0xfb3c('0xca')](_0xd09865,_0x11cec8[_0xfb3c('0xd4')][_0xfb3c('0xe2')]);if(fs[_0xfb3c('0xe3')](_0xc9da00)){fs[_0xfb3c('0xe4')](_0xc9da00)[_0xfb3c('0xe5')](fs[_0xfb3c('0xe6')](path[_0xfb3c('0xca')](_0x202fb3,_0x11cec8[_0xfb3c('0xd4')][_0xfb3c('0xe2')])));}}return{'date':moment(_0x11cec8[_0xfb3c('0xdc')])[_0xfb3c('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfb3c('0x9c')](),'sender':_0x11cec8[_0xfb3c('0xd6')]===_0xfb3c('0xe7')?_0x11cec8[_0xfb3c('0x6f')]?_0x11cec8[_0xfb3c('0x6f')][_0xfb3c('0x30')]:_0xfb3c('0xe8'):_0x11cec8[_0xfb3c('0xd1')][_0xfb3c('0xd2')]+(_0x11cec8[_0xfb3c('0xd1')][_0xfb3c('0xd3')]?'\x20'+_0x11cec8[_0xfb3c('0xd1')][_0xfb3c('0xd3')]:''),'body':_0x11cec8[_0xfb3c('0xd4')]?_0x11cec8['Attachment'][_0xfb3c('0xe2')]:_0x11cec8[_0xfb3c('0x72')],'direction':_0x11cec8['direction']===_0xfb3c('0xe7')?'A':'C','secret':_0x11cec8['secret'],'read':_0x11cec8[_0xfb3c('0x7f')],'attachment':_0x11cec8[_0xfb3c('0xd4')]};})['value']()};return ejs[_0xfb3c('0xe9')](path[_0xfb3c('0xca')](config[_0xfb3c('0xea')],_0xfb3c('0xcd'),'views',_0xfb3c('0xeb')),{'interaction':_0x56be0b})['then'](function(_0x59abaa){var _0x58a860=path[_0xfb3c('0xca')](_0x202fb3,_0xfb3c('0xec')+_0x17ac95['id']+'-'+_0xb666db+_0xfb3c('0xed'));var _0x15a8c2={'path':_0x58a860,'channel':_0xfb3c('0xee'),'interactionId':_0x17ac95['id']};return pdf['createPdfFromHTML'](_0x59abaa,_0x15a8c2);})[_0xfb3c('0x29')](function(){return new BPromise(function(_0x65b452,_0x18921e){zipdir(_0x202fb3,{'saveTo':_0x588c6c},function(_0x342d5c,_0x26379d){if(_0x342d5c)return _0x18921e(_0x342d5c);return _0x65b452(_0x26379d);});})[_0xfb3c('0x29')](function(){return new BPromise(function(_0x42fbe7,_0x10f5d8){rimraf(_0x202fb3,function(_0x95e462){if(_0x95e462)_0x10f5d8(_0x95e462);return _0x42fbe7();});});})[_0xfb3c('0x29')](function(){return _0x18b29a[_0xfb3c('0xc8')](_0x588c6c,_0x8b9bf6,function(_0x12983d){if(_0x12983d){console['log']('err',_0x12983d);}else{fs[_0xfb3c('0xef')](_0x588c6c);}});});});}else{return _0x18b29a['sendStatus'](0xc8);}})[_0xfb3c('0x35')](handleError(_0x18b29a,null));}; \ No newline at end of file +var _0x5f5b=['`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','OpenchannelAccountId','where','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','options','create','describe','OpenchannelMessage','addMessage','omit','ids','getMessages','findOne','$gte','include','findAll','addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','join','root','server','tmp','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Public','Private','existsSync','createReadStream','pipe','basename','System','out','renderFile','views','.pdf','createPdfFromHTML','download','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x5f5b,0x8d));var _0xb5f5=function(_0x3e81c6,_0x3efae2){_0x3e81c6=_0x3e81c6-0x0;var _0xe494db=_0x5f5b[_0x3e81c6];return _0xe494db;};'use strict';var emlformat=require(_0xb5f5('0x0'));var rimraf=require(_0xb5f5('0x1'));var zipdir=require(_0xb5f5('0x2'));var jsonpatch=require(_0xb5f5('0x3'));var rp=require(_0xb5f5('0x4'));var moment=require(_0xb5f5('0x5'));var BPromise=require(_0xb5f5('0x6'));var Mustache=require('mustache');var util=require(_0xb5f5('0x7'));var path=require(_0xb5f5('0x8'));var sox=require(_0xb5f5('0x9'));var csv=require(_0xb5f5('0xa'));var ejs=require(_0xb5f5('0xb'));var fs=require('fs');var fs_extra=require(_0xb5f5('0xc'));var _=require(_0xb5f5('0xd'));var squel=require(_0xb5f5('0xe'));var crypto=require(_0xb5f5('0xf'));var jsforce=require(_0xb5f5('0x10'));var deskjs=require(_0xb5f5('0x11'));var toCsv=require(_0xb5f5('0xa'));var querystring=require('querystring');var Papa=require(_0xb5f5('0x12'));var Redis=require(_0xb5f5('0x13'));var authService=require(_0xb5f5('0x14'));var qs=require(_0xb5f5('0x15'));var as=require(_0xb5f5('0x16'));var pdf=require(_0xb5f5('0x17'));var hardwareService=require(_0xb5f5('0x18'));var logger=require(_0xb5f5('0x19'))(_0xb5f5('0x1a'));var utils=require(_0xb5f5('0x1b'));var config=require(_0xb5f5('0x1c'));var licenseUtil=require(_0xb5f5('0x1d'));var db=require(_0xb5f5('0x1e'))['db'];config[_0xb5f5('0x1f')]=_['defaults'](config[_0xb5f5('0x1f')],{'host':_0xb5f5('0x20'),'port':0x18eb});var socket=require(_0xb5f5('0x21'))(new Redis(config['redis']));require(_0xb5f5('0x22'))[_0xb5f5('0x23')](socket);function respondWithStatusCode(_0x498b3d,_0xe0691f){_0xe0691f=_0xe0691f||0xcc;return function(_0x220059){if(_0x220059){return _0x498b3d[_0xb5f5('0x24')](_0xe0691f);}return _0x498b3d[_0xb5f5('0x25')](_0xe0691f)[_0xb5f5('0x26')]();};}function respondWithResult(_0x5af065,_0x42044a){_0x42044a=_0x42044a||0xc8;return function(_0x3ae613){if(_0x3ae613){return _0x5af065['status'](_0x42044a)[_0xb5f5('0x27')](_0x3ae613);}};}function respondWithFilteredResult(_0x13e251,_0xf5bdfe){return function(_0x1496c0){if(_0x1496c0){var _0x41c774=typeof _0xf5bdfe['offset']===_0xb5f5('0x28')&&typeof _0xf5bdfe[_0xb5f5('0x29')]==='undefined';var _0x56f779=_0x1496c0[_0xb5f5('0x2a')];var _0x4a6234=_0x41c774?0x0:_0xf5bdfe['offset'];var _0xaa5c35=_0x41c774?_0x1496c0[_0xb5f5('0x2a')]:_0xf5bdfe[_0xb5f5('0x2b')]+_0xf5bdfe[_0xb5f5('0x29')];var _0x91f672;if(_0xaa5c35>=_0x56f779){_0xaa5c35=_0x56f779;_0x91f672=0xc8;}else{_0x91f672=0xce;}_0x13e251[_0xb5f5('0x25')](_0x91f672);return _0x13e251[_0xb5f5('0x2c')]('Content-Range',_0x4a6234+'-'+_0xaa5c35+'/'+_0x56f779)[_0xb5f5('0x27')](_0x1496c0);}return null;};}function patchUpdates(_0xb3df0f){return function(_0x1db35b){try{jsonpatch[_0xb5f5('0x2d')](_0x1db35b,_0xb3df0f,!![]);}catch(_0x80f794){return BPromise[_0xb5f5('0x2e')](_0x80f794);}return _0x1db35b[_0xb5f5('0x2f')]();};}function saveUpdates(_0x1836f8,_0x8d8f9a){return function(_0x74adc3){if(_0x74adc3){return _0x74adc3[_0xb5f5('0x30')](_0x1836f8)[_0xb5f5('0x31')](function(_0x518ed1){return _0x518ed1;});}return null;};}function removeEntity(_0x45e7c0,_0x1e67a3){return function(_0x565c0b){if(_0x565c0b){return _0x565c0b[_0xb5f5('0x32')]()[_0xb5f5('0x31')](function(){_0x45e7c0[_0xb5f5('0x25')](0xcc)[_0xb5f5('0x26')]();});}};}function handleEntityNotFound(_0x27cee9,_0x1c5463){return function(_0x1a1945){if(!_0x1a1945){_0x27cee9[_0xb5f5('0x24')](0x194);}return _0x1a1945;};}function handleError(_0x3807b2,_0x43e11f){_0x43e11f=_0x43e11f||0x1f4;return function(_0x264fe3){logger[_0xb5f5('0x33')](_0x264fe3[_0xb5f5('0x34')]);if(_0x264fe3[_0xb5f5('0x35')]){delete _0x264fe3[_0xb5f5('0x35')];}_0x3807b2[_0xb5f5('0x25')](_0x43e11f)[_0xb5f5('0x36')](_0x264fe3);};}function getInteractionUsers(_0x22b3a9,_0x41e593){return new BPromise(function(_0x3d73f9,_0x441c95){try{if(_0x41e593[_0x22b3a9['id']]){_0x22b3a9[_0xb5f5('0x37')]=_[_0xb5f5('0x38')](_0x41e593[_0x22b3a9['id']],function(_0xd30c04){return{'id':_0xd30c04['id'],'fullname':_0xd30c04[_0xb5f5('0x39')]};});}}catch(_0x443ce6){_0x441c95(_0x443ce6);}_0x3d73f9(_0x22b3a9);});}function getInteractionTags(_0x14b286,_0x2f8851){return new BPromise(function(_0x28f66f,_0x371136){try{if(_0x14b286[_0xb5f5('0x3a')]){_0x14b286[_0xb5f5('0x3b')]=[];_0x14b286[_0xb5f5('0x3a')]['split'](',')[_0xb5f5('0x3c')](function(_0x5d1893){_0x14b286[_0xb5f5('0x3b')][_0xb5f5('0x3d')](_0x2f8851[_0x5d1893]);});}delete _0x14b286[_0xb5f5('0x3a')];}catch(_0x4d4eff){_0x371136(_0x4d4eff);}_0x28f66f(_0x14b286);});}function updateOpenchannelInteraction(_0x2ce965,_0x5a2a1a,_0x508bab){return new BPromise(function(_0x426f24,_0x2de0e7){return getInteractionUsers(_0x2ce965,_0x508bab)[_0xb5f5('0x31')](function(_0x372609){return getInteractionTags(_0x372609,_0x5a2a1a);})[_0xb5f5('0x31')](function(_0x32a278){_0x426f24(_0x32a278);})[_0xb5f5('0x3e')](function(_0x2f95d7){_0x2de0e7(_0x2f95d7);});});}exports[_0xb5f5('0x3f')]=function(_0x1610cf,_0x104aba){var _0x4b5043={},_0x3bae11={},_0x3ab291={'count':0x0,'rows':[]};var _0x5e8b5d=_[_0xb5f5('0x38')](db[_0xb5f5('0x40')][_0xb5f5('0x41')],function(_0x31909e){return{'name':_0x31909e[_0xb5f5('0x42')],'type':_0x31909e[_0xb5f5('0x43')][_0xb5f5('0x44')]};});_0x3bae11[_0xb5f5('0x45')]=_[_0xb5f5('0x38')](_0x5e8b5d,_0xb5f5('0x35'));_0x3bae11[_0xb5f5('0x46')]=_['keys'](_0x1610cf[_0xb5f5('0x46')]);_0x3bae11[_0xb5f5('0x47')]=_[_0xb5f5('0x48')](_0x3bae11['model'],_0x3bae11[_0xb5f5('0x46')]);_0x4b5043[_0xb5f5('0x49')]=_[_0xb5f5('0x48')](_0x3bae11[_0xb5f5('0x45')],qs[_0xb5f5('0x4a')](_0x1610cf[_0xb5f5('0x46')]['fields']));_0x4b5043[_0xb5f5('0x49')]=_0x4b5043['attributes']['length']?_0x4b5043[_0xb5f5('0x49')]:_0x3bae11[_0xb5f5('0x45')];if(!_0x1610cf['query'][_0xb5f5('0x4b')](_0xb5f5('0x4c'))){_0x4b5043[_0xb5f5('0x29')]=qs['limit'](_0x1610cf['query']['limit']);_0x4b5043['offset']=qs[_0xb5f5('0x2b')](_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x2b')]);}_0x4b5043[_0xb5f5('0x4d')]=qs[_0xb5f5('0x4e')](_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x4e')]);_0x4b5043['where']=qs[_0xb5f5('0x47')](_[_0xb5f5('0x4f')](_0x1610cf[_0xb5f5('0x46')],_0x3bae11[_0xb5f5('0x47')]),_0x5e8b5d);var _0x270d36=[];var _0x194a42=squel['select']()['field']('id')[_0xb5f5('0x50')](_0xb5f5('0x35'))[_0xb5f5('0x50')](_0xb5f5('0x51'))[_0xb5f5('0x52')]('tools_tags');var _0x2ea2c0=squel[_0xb5f5('0x53')]()[_0xb5f5('0x50')](_0xb5f5('0x54'))['field'](_0xb5f5('0x55'))[_0xb5f5('0x50')](_0xb5f5('0x56'))['from'](_0xb5f5('0x57'),'ui')[_0xb5f5('0x58')](_0xb5f5('0x59'),'u',_0xb5f5('0x5a'));var _0x34621c=squel[_0xb5f5('0x53')]()[_0xb5f5('0x52')](_0xb5f5('0x5b'),'i')[_0xb5f5('0x58')](_0xb5f5('0x5c'),'c',_0xb5f5('0x5d'))[_0xb5f5('0x58')](_0xb5f5('0x59'),'o',_0xb5f5('0x5e'))['left_join'](_0xb5f5('0x5f'),'a',_0xb5f5('0x60'))[_0xb5f5('0x58')](_0xb5f5('0x61'),'me',_0xb5f5('0x62'))[_0xb5f5('0x58')](_0xb5f5('0x63'),'it',_0xb5f5('0x64'))[_0xb5f5('0x58')](_0xb5f5('0x65'),'t',_0xb5f5('0x66'));var _0x211e18=squel[_0xb5f5('0x67')]();var _0x551696=[];var _0x1f3e75=squel['expr']();var _0x235d8e;if(_0x1610cf[_0xb5f5('0x46')]['search']){_0x235d8e=as[_0xb5f5('0x68')](_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x69')]);var _0xf486d5=_0x235d8e[_0xb5f5('0x6a')];for(var _0x40995e=0x0;_0x40995e<_0x235d8e[_0xb5f5('0x6b')][_0xb5f5('0x6c')];_0x40995e++){var _0x2ce267=_0x235d8e[_0xb5f5('0x6b')][_0x40995e];var _0x2c79a4='i';var _0x2cec02=_[_0xb5f5('0x6d')](_0x5e8b5d,[_0xb5f5('0x35'),_0x2ce267['field']]);if(!_0x2cec02){switch(_0x2ce267[_0xb5f5('0x50')]){case _0xb5f5('0x6e'):if(_0x2ce267[_0xb5f5('0x6f')]==0x1){_0x34621c[_0xb5f5('0x70')]('`'+_0x2ce267[_0xb5f5('0x50')]+_0xb5f5('0x71'));}else{_0x34621c[_0xb5f5('0x70')]('`'+_0x2ce267[_0xb5f5('0x50')]+_0xb5f5('0x72'));}break;case'Contact':if(_0x2ce267[_0xb5f5('0x73')]===_0xb5f5('0x74')){if(_0x2ce267[_0xb5f5('0x6f')][_0xb5f5('0x75')]('\x20')['length']>0x1){_0x211e18[_0xf486d5](_0xb5f5('0x76'),qs[_0xb5f5('0x77')](_0x2ce267[_0xb5f5('0x6f')]),null);}else{var _0x5da468='%'+_0x2ce267[_0xb5f5('0x6f')]+'%';_0x211e18[_0xf486d5](_0xb5f5('0x78'),_0x5da468,_0x5da468,_0x5da468);}}else{_0x2cec02=_[_0xb5f5('0x6d')](_0x5e8b5d,[_0xb5f5('0x35'),_0xb5f5('0x79')]);_0x2ce267[_0xb5f5('0x50')]='ContactId';_0x1c51fc=as[_0xb5f5('0x7a')](_0x2c79a4,_0x2cec02[_0xb5f5('0x43')],_0x2ce267);_0x211e18[_0xf486d5](_0x1c51fc[_0xb5f5('0x7b')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x7c')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x26')]);}break;case'Tag':var _0x6d0898=_0x2ce267[_0xb5f5('0x6f')][_0xb5f5('0x75')](',')[_0xb5f5('0x38')](function(_0x31229e){return Number(_0x31229e);});_0x6d0898['forEach'](function(_0x51ab30){_0x1f3e75['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x51ab30+',%');});_0x551696=_[_0xb5f5('0x7d')](_0x551696,_0x6d0898);break;case _0xb5f5('0x7e'):if(_0x2ce267[_0xb5f5('0x73')]===_0xb5f5('0x74')){_0x211e18[_0xf486d5](_0xb5f5('0x7f'),'%'+_0x2ce267[_0xb5f5('0x6f')]+'%',null);}else{_0x2cec02=_[_0xb5f5('0x6d')](_0x5e8b5d,[_0xb5f5('0x35'),_0xb5f5('0x80')]);_0x2ce267[_0xb5f5('0x50')]=_0xb5f5('0x80');_0x1c51fc=as[_0xb5f5('0x7a')](_0x2c79a4,_0x2cec02[_0xb5f5('0x43')],_0x2ce267);_0x211e18[_0xf486d5](_0x1c51fc[_0xb5f5('0x7b')],_0x1c51fc['value'][_0xb5f5('0x7c')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x26')]);}break;case _0xb5f5('0x81'):_0x1c51fc=as[_0xb5f5('0x7a')]('me',null,_0x2ce267);_0x211e18[_0xf486d5](_0x1c51fc[_0xb5f5('0x7b')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x7c')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x26')]);break;}}else{var _0x1c51fc=as[_0xb5f5('0x7a')](_0x2c79a4,_0x2cec02['type'],_0x2ce267);_0x211e18[_0xf486d5](_0x1c51fc[_0xb5f5('0x7b')],_0x1c51fc['value'][_0xb5f5('0x7c')],_0x1c51fc[_0xb5f5('0x6f')][_0xb5f5('0x26')]);}}}else{var _0x46805f=_(_0x1610cf[_0xb5f5('0x46')])[_0xb5f5('0x82')]()[_0xb5f5('0x38')](function(_0x4ae1b6){return _[_0xb5f5('0x83')](_0x5e8b5d,['name',_0x4ae1b6])?_0x4ae1b6:undefined;})['compact']()[_0xb5f5('0x6f')]();if(!_[_0xb5f5('0x84')](_0x46805f)){_0x46805f[_0xb5f5('0x3c')](function(_0x4f240e){if(_0x4f240e===_0xb5f5('0x85')){_0x34621c[_0xb5f5('0x86')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x1610cf[_0xb5f5('0x46')][_0x4f240e]));}else if(_0x4f240e===_0xb5f5('0x87')){var _0x291558=JSON[_0xb5f5('0x88')](_0x1610cf['query'][_0x4f240e])['$gte'];var _0x344a9f=JSON['parse'](_0x1610cf[_0xb5f5('0x46')][_0x4f240e])[_0xb5f5('0x89')];_0x34621c['where'](_0xb5f5('0x8a'),_0x291558,_0x344a9f);}else{if(_0x1610cf[_0xb5f5('0x46')][_0x4f240e]==='null'){_0x34621c['where']('i.'+_0x4f240e+_0xb5f5('0x8b'));}else{_0x34621c[_0xb5f5('0x86')]('i.'+_0x4f240e+_0xb5f5('0x8c'),_0x1610cf[_0xb5f5('0x46')][_0x4f240e]);}}});}if(_0x1610cf['query'][_0xb5f5('0x8d')]){if(_0x1610cf[_0xb5f5('0x46')]['read']==0x1){_0x34621c['having'](_0xb5f5('0x8e'));}else{_0x34621c['having'](_0xb5f5('0x8f'));}}if(_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x90')]){_0x551696=_['isArray'](_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x90')])?_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x90')]:new Array(_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x90')]);_0x551696[_0xb5f5('0x3c')](function(_0x370c49){_0x1f3e75['or'](_0xb5f5('0x91'),'%,'+_0x370c49+',%');});}if(_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x92')]){var _0x556df2=_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x92')]['replace']('\x5c','\x5c\x5c')[_0xb5f5('0x93')](/'/g,'\x27\x27');if(qs[_0xb5f5('0x94')](_0x556df2)){_0x211e18['or'](_0xb5f5('0x95'),_0x556df2+'%');}else{_0x211e18['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb5f5('0x77')](_0x556df2))['or'](_0xb5f5('0x96'),_0x556df2+'%')['or'](_0xb5f5('0x97'),_0x556df2+'%');}}}_0x34621c[_0xb5f5('0x86')](_0x211e18);_0x34621c[_0xb5f5('0x98')](_0xb5f5('0x99'));var _0x342918={'type':db[_0xb5f5('0x9a')][_0xb5f5('0x9b')][_0xb5f5('0x9c')],'raw':!![]};var _0x2eb79a=_0x34621c[_0xb5f5('0x9d')]();_0x2eb79a[_0xb5f5('0x50')](_0xb5f5('0x99'));_0x2eb79a[_0xb5f5('0x50')](_0xb5f5('0x9e'),'unreadMessages');if(_0x4b5043[_0xb5f5('0x4d')]){_0x4b5043[_0xb5f5('0x4d')][_0xb5f5('0x3c')](function(_0x54a67a){var _0x3b76a0=_0x54a67a[0x0]===_0xb5f5('0x9f')?_0x54a67a[0x0]:'i.'+_0x54a67a[0x0];_0x34621c['order'](_0x3b76a0,_0x54a67a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb5f5('0x84')](_0x551696)){_0x34621c[_0xb5f5('0x70')](_0x1f3e75);_0x2eb79a[_0xb5f5('0x86')](_0xb5f5('0xa0'),_0x551696);}BPromise[_0xb5f5('0xa1')]()[_0xb5f5('0x31')](function(){if(!_0x235d8e){if(_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x85')])return;_0x2eb79a[_0xb5f5('0x86')](_0xb5f5('0xa2'));_0x34621c[_0xb5f5('0x86')](_0xb5f5('0xa2'));return;}if(_0x1610cf[_0xb5f5('0xa3')][_0xb5f5('0xa4')]!==_0xb5f5('0xa5'))return;return _0x1610cf[_0xb5f5('0xa3')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xb5f5('0x31')](function(_0x4cf557){if(_[_0xb5f5('0x84')](_0x4cf557)){_0x2eb79a['where'](_0xb5f5('0xa6'));_0x34621c[_0xb5f5('0x86')](_0xb5f5('0xa6'));}else{_0x2eb79a[_0xb5f5('0x86')](_0xb5f5('0xa7'),_[_0xb5f5('0x38')](_0x4cf557,'id'));_0x34621c[_0xb5f5('0x86')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb5f5('0x38')](_0x4cf557,'id'));}});})[_0xb5f5('0x31')](function(){if(_0x1610cf[_0xb5f5('0xa3')][_0xb5f5('0xa4')]===_0xb5f5('0xa5')&&!_0x235d8e&&!_0x1610cf[_0xb5f5('0x46')][_0xb5f5('0x85')])return[];return db[_0xb5f5('0xa8')]['query'](_0x2eb79a['toString'](),_0x342918);})[_0xb5f5('0x31')](function(_0xb3898e){_0x3ab291[_0xb5f5('0x2a')]=_0xb3898e[_0xb5f5('0x6c')];if(_0x3ab291['count']===0x0)return[];return db[_0xb5f5('0xa8')]['query'](_0x194a42[_0xb5f5('0xa9')](),_0x342918)[_0xb5f5('0x31')](function(_0x22ba24){_0x270d36=_[_0xb5f5('0xaa')](_0x22ba24,'id');_0x342918=_[_0xb5f5('0xab')](_0x342918,{'model':db[_0xb5f5('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1610cf[_0xb5f5('0x46')]['fields']){_0x4b5043['attributes'][_0xb5f5('0x3c')](function(_0x4dd20c){_0x34621c[_0xb5f5('0x50')]('i.'+_0x4dd20c);});}else{_0x34621c[_0xb5f5('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xac'),_0xb5f5('0xad'));_0x34621c['field'](_0xb5f5('0xae'),_0xb5f5('0xaf'));_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xb0'),_0xb5f5('0x9f'));_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xb1'));_0x34621c['field'](_0xb5f5('0xb2'),_0xb5f5('0xb3'));_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xb4'),_0xb5f5('0xb5'));_0x34621c[_0xb5f5('0x50')]('c.email',_0xb5f5('0xb6'));_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xb7'),'Contact.phone');_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xb8'),_0xb5f5('0xb9'));_0x34621c[_0xb5f5('0x50')]('c.fax',_0xb5f5('0xba'));_0x34621c['field'](_0xb5f5('0xbb'),_0xb5f5('0xbc'));_0x34621c['field'](_0xb5f5('0xbd'),'Owner.internal');_0x34621c[_0xb5f5('0x50')](_0xb5f5('0xbe'),_0xb5f5('0x3a'));}if(_0x4b5043[_0xb5f5('0x29')])_0x34621c[_0xb5f5('0x29')](_0x4b5043['limit']);if(_0x4b5043[_0xb5f5('0x2b')])_0x34621c[_0xb5f5('0x2b')](_0x4b5043[_0xb5f5('0x2b')]);return db[_0xb5f5('0xa8')][_0xb5f5('0x46')](_0x34621c[_0xb5f5('0xa9')](),_0x342918);})[_0xb5f5('0x31')](function(_0x25f1d0){if(_0x25f1d0['length']>0x0)_0x2ea2c0[_0xb5f5('0x86')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xb5f5('0x38')](_0x25f1d0,'id'));return db[_0xb5f5('0xa8')][_0xb5f5('0x46')](_0x2ea2c0['toString'](),_0x342918)[_0xb5f5('0x31')](function(_0x22b641){var _0x1ee1d1=_[_0xb5f5('0xbf')](_0x22b641,_0xb5f5('0xc0'));var _0x546977=[];_0x25f1d0[_0xb5f5('0x3c')](function(_0x2ae033){_0x546977['push'](updateOpenchannelInteraction(_0x2ae033,_0x270d36,_0x1ee1d1));});return BPromise[_0xb5f5('0xc1')](_0x546977);});});})[_0xb5f5('0x31')](function(_0x4c3f25){_0x3ab291[_0xb5f5('0xc2')]=_0x4c3f25;return _0x3ab291;})[_0xb5f5('0x31')](respondWithFilteredResult(_0x104aba,_0x4b5043))[_0xb5f5('0x3e')](handleError(_0x104aba,null));};exports['show']=function(_0x232989,_0x1a618b){var _0xbe97d9={};if(_0x232989[_0xb5f5('0x46')][_0xb5f5('0x43')]&&_0x232989[_0xb5f5('0x46')][_0xb5f5('0x43')]===_0xb5f5('0x52')){_0xbe97d9[_0xb5f5('0x52')]=_0x232989[_0xb5f5('0xc3')]['id'];}else{_0xbe97d9['id']=_0x232989[_0xb5f5('0xc3')]['id'];}var _0x3adf52={'raw':![],'where':_0xbe97d9},_0x43e0d7={};_0x43e0d7[_0xb5f5('0x45')]=_[_0xb5f5('0x82')](db['OpenchannelInteraction'][_0xb5f5('0x41')]);_0x43e0d7['query']=_[_0xb5f5('0x82')](_0x232989[_0xb5f5('0x46')]);_0x43e0d7['filters']=_[_0xb5f5('0x48')](_0x43e0d7[_0xb5f5('0x45')],_0x43e0d7[_0xb5f5('0x46')]);_0x3adf52['attributes']=_[_0xb5f5('0x48')](_0x43e0d7[_0xb5f5('0x45')],qs[_0xb5f5('0x4a')](_0x232989[_0xb5f5('0x46')][_0xb5f5('0x4a')]));_0x3adf52[_0xb5f5('0x49')]=_0x3adf52[_0xb5f5('0x49')][_0xb5f5('0x6c')]?_0x3adf52[_0xb5f5('0x49')]:_0x43e0d7[_0xb5f5('0x45')];if(_0x232989[_0xb5f5('0x46')][_0xb5f5('0xc4')]){_0x3adf52['include']=[{'all':!![]}];}_0x3adf52=_[_0xb5f5('0xab')]({},_0x3adf52,_0x232989[_0xb5f5('0xc5')]);return db[_0xb5f5('0x40')][_0xb5f5('0x6d')](_0x3adf52)['then'](handleEntityNotFound(_0x1a618b,null))['then'](respondWithResult(_0x1a618b,null))[_0xb5f5('0x3e')](handleError(_0x1a618b,null));};exports[_0xb5f5('0xc6')]=function(_0x310f65,_0x158f18){return db[_0xb5f5('0x40')][_0xb5f5('0xc6')](_0x310f65[_0xb5f5('0x81')],{})[_0xb5f5('0x31')](respondWithResult(_0x158f18,0xc9))[_0xb5f5('0x3e')](handleError(_0x158f18,null));};exports[_0xb5f5('0x30')]=function(_0x2ab143,_0x117084){if(_0x2ab143[_0xb5f5('0x81')]['id']){delete _0x2ab143[_0xb5f5('0x81')]['id'];}return db[_0xb5f5('0x40')]['find']({'where':{'id':_0x2ab143[_0xb5f5('0xc3')]['id']}})[_0xb5f5('0x31')](handleEntityNotFound(_0x117084,null))[_0xb5f5('0x31')](saveUpdates(_0x2ab143['body'],null))[_0xb5f5('0x31')](respondWithResult(_0x117084,null))[_0xb5f5('0x3e')](handleError(_0x117084,null));};exports[_0xb5f5('0x32')]=function(_0x449668,_0x4c8a1f){return db[_0xb5f5('0x40')][_0xb5f5('0x6d')]({'where':{'id':_0x449668['params']['id']}})['then'](handleEntityNotFound(_0x4c8a1f,null))['then'](removeEntity(_0x4c8a1f,null))[_0xb5f5('0x3e')](handleError(_0x4c8a1f,null));};exports[_0xb5f5('0xc7')]=function(_0x33548a,_0xf6927b){return db[_0xb5f5('0x40')]['describe']()[_0xb5f5('0x31')](respondWithResult(_0xf6927b,null))['catch'](handleError(_0xf6927b,null));};exports['addMessage']=function(_0x1a3ff9,_0xb80db9,_0x264f59){return db[_0xb5f5('0xc8')][_0xb5f5('0x6d')]({'where':{'id':_0x1a3ff9[_0xb5f5('0xc3')]['id']}})[_0xb5f5('0x31')](handleEntityNotFound(_0xb80db9,null))[_0xb5f5('0x31')](function(_0x3091b8){if(_0x3091b8){return _0x3091b8[_0xb5f5('0xc9')](_0x1a3ff9[_0xb5f5('0x81')]['ids'],_[_0xb5f5('0xca')](_0x1a3ff9['body'],[_0xb5f5('0xcb'),'id'])||{});}})[_0xb5f5('0x31')](respondWithResult(_0xb80db9,null))['catch'](handleError(_0xb80db9,null));};exports[_0xb5f5('0xcc')]=function(_0x24d856,_0x5d397b,_0x5b5c49){var _0x3a1097={'raw':![],'where':{}};var _0xcbe79c={};var _0x2d4f34={'count':0x0,'rows':[]};return db[_0xb5f5('0x40')][_0xb5f5('0xcd')]({'where':{'id':_0x24d856['params']['id']}})[_0xb5f5('0x31')](handleEntityNotFound(_0x5d397b,null))['then'](function(_0xb718c0){if(_0xb718c0){_0xcbe79c[_0xb5f5('0x45')]=_[_0xb5f5('0x82')](db[_0xb5f5('0xc8')][_0xb5f5('0x41')]);_0xcbe79c[_0xb5f5('0x46')]=_[_0xb5f5('0x82')](_0x24d856[_0xb5f5('0x46')]);_0xcbe79c[_0xb5f5('0x47')]=_[_0xb5f5('0x48')](_0xcbe79c['model'],_0xcbe79c[_0xb5f5('0x46')]);_0x3a1097[_0xb5f5('0x49')]=_[_0xb5f5('0x48')](_0xcbe79c[_0xb5f5('0x45')],qs[_0xb5f5('0x4a')](_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x4a')]));_0x3a1097['attributes']=_0x3a1097[_0xb5f5('0x49')]['length']?_0x3a1097[_0xb5f5('0x49')]:_0xcbe79c[_0xb5f5('0x45')];if(!_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x4b')](_0xb5f5('0x4c'))){_0x3a1097[_0xb5f5('0x29')]=qs[_0xb5f5('0x29')](_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x29')]);_0x3a1097[_0xb5f5('0x2b')]=qs[_0xb5f5('0x2b')](_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x2b')]);}_0x3a1097['order']=qs['sort'](_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x4e')]);_0x3a1097['where']=qs[_0xb5f5('0x47')](_[_0xb5f5('0x4f')](_0x24d856[_0xb5f5('0x46')],_0xcbe79c[_0xb5f5('0x47')]));_0x3a1097['where'][_0xb5f5('0xc0')]=_0xb718c0['id'];if(_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x92')]){_0x3a1097['where']=_[_0xb5f5('0xab')](_0x3a1097['where'],{'$or':_[_0xb5f5('0x38')](_0x3a1097[_0xb5f5('0x49')],function(_0x2e6bc7){var _0xc22979={};_0xc22979[_0x2e6bc7]={'$like':'%'+_0x24d856[_0xb5f5('0x46')][_0xb5f5('0x92')]+'%'};return _0xc22979;})});}if(_0x24d856[_0xb5f5('0x46')]['$gte']){var _0x40f69c=_0x24d856[_0xb5f5('0x46')][_0xb5f5('0xce')][_0xb5f5('0x75')](',');var _0x4c835d={};_0x4c835d[_0x40f69c[0x0]]={'$gte':moment(_0x40f69c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3a1097['where']=_[_0xb5f5('0xab')](_0x3a1097[_0xb5f5('0x86')],_0x4c835d);}_0x3a1097=_[_0xb5f5('0xab')]({},_0x3a1097,_0x24d856[_0xb5f5('0xc5')]);return db['OpenchannelMessage']['count']({'where':_0x3a1097['where']})[_0xb5f5('0x31')](function(_0x437ba7){_0x2d4f34['count']=_0x437ba7;if(_0x24d856[_0xb5f5('0x46')][_0xb5f5('0xc4')]){_0x3a1097[_0xb5f5('0xcf')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb5f5('0xd0')](_0x3a1097);})[_0xb5f5('0x31')](function(_0x1d0d1b){_0x2d4f34[_0xb5f5('0xc2')]=_0x1d0d1b;return _0x2d4f34;});}})[_0xb5f5('0x31')](respondWithFilteredResult(_0x5d397b,_0x3a1097))[_0xb5f5('0x3e')](handleError(_0x5d397b,null));};exports[_0xb5f5('0xd1')]=function(_0x43fa7e,_0x86ee15,_0x46ce96){return db[_0xb5f5('0x40')][_0xb5f5('0x6d')]({'where':{'id':_0x43fa7e['params']['id']}})['then'](handleEntityNotFound(_0x86ee15,null))[_0xb5f5('0x31')](function(_0x27f8c8){if(_0x27f8c8){return _0x27f8c8[_0xb5f5('0xd2')](_0x43fa7e[_0xb5f5('0x81')][_0xb5f5('0xcb')],_[_0xb5f5('0xca')](_0x43fa7e[_0xb5f5('0x81')],[_0xb5f5('0xcb'),'id'])||{})['spread'](function(){return db[_0xb5f5('0xd3')][_0xb5f5('0xd0')]({'attributes':['id',_0xb5f5('0x35'),_0xb5f5('0x51')],'where':{'id':_0x43fa7e['body'][_0xb5f5('0xcb')]}});})[_0xb5f5('0x31')](function(_0x39378d){socket[_0xb5f5('0xd4')](_0xb5f5('0xd5'),{'id':Number(_0x43fa7e[_0xb5f5('0xc3')]['id']),'tags':_0x39378d||[]});return{'id':Number(_0x43fa7e['params']['id']),'tags':_0x39378d||[]};});}})[_0xb5f5('0x31')](respondWithResult(_0x86ee15,null))[_0xb5f5('0x3e')](handleError(_0x86ee15,null));};exports['removeTags']=function(_0x56a4a3,_0x3b8157,_0x476843){return db[_0xb5f5('0x40')][_0xb5f5('0x6d')]({'where':{'id':_0x56a4a3['params']['id']}})['then'](handleEntityNotFound(_0x3b8157,null))['then'](function(_0x4c6260){if(_0x4c6260){return _0x4c6260[_0xb5f5('0xd6')](_0x56a4a3[_0xb5f5('0x46')][_0xb5f5('0xcb')]);}})['then'](respondWithStatusCode(_0x3b8157,null))['catch'](handleError(_0x3b8157,null));};exports['download']=function(_0x330d4a,_0xa21f36){var _0x36d853=moment()['unix']()[_0xb5f5('0xa9')]();var _0x34196f=path[_0xb5f5('0xd7')](config[_0xb5f5('0xd8')],_0xb5f5('0xd9'),'files',_0xb5f5('0xda'));var _0x141bde=path[_0xb5f5('0xd7')](config[_0xb5f5('0xd8')],_0xb5f5('0xd9'),'files','attachments');var _0x25e198=path[_0xb5f5('0xd7')](_0x34196f,_0x36d853);var _0x4d4b69=util['format'](_0xb5f5('0xdb'),_0x330d4a[_0xb5f5('0xc3')]['id'],_0x36d853);var _0x2e524a=path[_0xb5f5('0xd7')](_0x34196f,_0x4d4b69);var _0x5b4b34=[];_0x5b4b34[_0xb5f5('0x3d')]({'model':db[_0xb5f5('0x7e')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5b4b34[_0xb5f5('0x3d')]({'model':db[_0xb5f5('0xdc')],'as':_0xb5f5('0xdd'),'attributes':['id',_0xb5f5('0xde'),_0xb5f5('0xdf')],'raw':!![]});if(_0x330d4a['query'][_0xb5f5('0xe0')]){_0x5b4b34['push']({'model':db[_0xb5f5('0xe1')],'as':'Attachment','raw':!![]});}var _0xb24f8c=[{'model':db['OpenchannelMessage'],'as':_0xb5f5('0xe2'),'attributes':['id',_0xb5f5('0x81'),_0xb5f5('0x87'),_0xb5f5('0xe3'),_0xb5f5('0xe4'),_0xb5f5('0x8d')],'include':_0x5b4b34}];_0xb24f8c[_0xb5f5('0x3d')]({'model':db[_0xb5f5('0xe5')],'as':'Account','attributes':['id',_0xb5f5('0x35')]});_0xb24f8c['push']({'model':db[_0xb5f5('0x7e')],'as':_0xb5f5('0xe6'),'attributes':['id',_0xb5f5('0x39')]});return db[_0xb5f5('0x40')][_0xb5f5('0x6d')]({'where':{'id':_0x330d4a[_0xb5f5('0xc3')]['id']},'include':_0xb24f8c})[_0xb5f5('0x31')](handleEntityNotFound(_0xa21f36,null))[_0xb5f5('0x31')](function(_0x149d5d){if(_0x149d5d){var _0x2e67dd=_0x149d5d['get']({'plain':!![]});fs[_0xb5f5('0xe7')](_0x25e198);var _0x41a9b8={'channel':_0xb5f5('0xe8'),'account':_0x2e67dd[_0xb5f5('0xe9')][_0xb5f5('0x35')],'agent':_0x2e67dd[_0xb5f5('0xe6')]?_0x2e67dd[_0xb5f5('0xe6')][_0xb5f5('0x39')]:_0xb5f5('0xea'),'createdAt':moment(_0x2e67dd['createdAt'])[_0xb5f5('0xeb')](_0xb5f5('0xec'))['toString'](),'closedAt':_0x2e67dd[_0xb5f5('0xed')]?moment(_0x2e67dd[_0xb5f5('0xee')])['format'](_0xb5f5('0xec'))[_0xb5f5('0xa9')]():'','disposition':_0x2e67dd[_0xb5f5('0xef')],'visibility':_0x2e67dd['threadId']?_0xb5f5('0xf0'):_0xb5f5('0xf1'),'messages':_(_0x2e67dd[_0xb5f5('0xe2')])[_0xb5f5('0x92')]({'secret':![]})['map'](function(_0x32109e){if(_0x32109e[_0xb5f5('0xe1')]){var _0x4469ec=path[_0xb5f5('0xd7')](_0x141bde,_0x32109e[_0xb5f5('0xe1')]['basename']);if(fs[_0xb5f5('0xf2')](_0x4469ec)){fs[_0xb5f5('0xf3')](_0x4469ec)[_0xb5f5('0xf4')](fs['createWriteStream'](path[_0xb5f5('0xd7')](_0x25e198,_0x32109e[_0xb5f5('0xe1')][_0xb5f5('0xf5')])));}}return{'date':moment(_0x32109e[_0xb5f5('0x87')])[_0xb5f5('0xeb')](_0xb5f5('0xec'))[_0xb5f5('0xa9')](),'sender':_0x32109e['direction']==='out'?_0x32109e[_0xb5f5('0x7e')]?_0x32109e[_0xb5f5('0x7e')][_0xb5f5('0x39')]:_0xb5f5('0xf6'):_0x32109e[_0xb5f5('0xdd')][_0xb5f5('0xde')]+(_0x32109e[_0xb5f5('0xdd')][_0xb5f5('0xdf')]?'\x20'+_0x32109e['Contact'][_0xb5f5('0xdf')]:''),'body':_0x32109e['Attachment']?_0x32109e[_0xb5f5('0xe1')][_0xb5f5('0xf5')]:_0x32109e[_0xb5f5('0x81')],'direction':_0x32109e[_0xb5f5('0xe3')]===_0xb5f5('0xf7')?'A':'C','secret':_0x32109e[_0xb5f5('0xe4')],'read':_0x32109e['read'],'attachment':_0x32109e[_0xb5f5('0xe1')]};})['value']()};return ejs[_0xb5f5('0xf8')](path[_0xb5f5('0xd7')](config['root'],_0xb5f5('0xd9'),_0xb5f5('0xf9'),'downloadInteraction.ejs'),{'interaction':_0x41a9b8})[_0xb5f5('0x31')](function(_0x207b27){var _0x36df5d=path[_0xb5f5('0xd7')](_0x25e198,'transcript-'+_0x2e67dd['id']+'-'+_0x36d853+_0xb5f5('0xfa'));var _0x5cd713={'path':_0x36df5d,'channel':_0xb5f5('0xe8'),'interactionId':_0x2e67dd['id']};return pdf[_0xb5f5('0xfb')](_0x207b27,_0x5cd713);})[_0xb5f5('0x31')](function(){return new BPromise(function(_0x35bad5,_0x1361da){zipdir(_0x25e198,{'saveTo':_0x2e524a},function(_0x336b49,_0x88c07){if(_0x336b49)return _0x1361da(_0x336b49);return _0x35bad5(_0x88c07);});})['then'](function(){return new BPromise(function(_0xbacb7b,_0x5f139b){rimraf(_0x25e198,function(_0x4b4e86){if(_0x4b4e86)_0x5f139b(_0x4b4e86);return _0xbacb7b();});});})['then'](function(){return _0xa21f36[_0xb5f5('0xfc')](_0x2e524a,_0x4d4b69,function(_0x20855b){if(_0x20855b){console['log'](_0xb5f5('0xfd'),_0x20855b);}else{fs['unlinkSync'](_0x2e524a);}});});});}else{return _0xa21f36[_0xb5f5('0x24')](0xc8);}})[_0xb5f5('0x3e')](handleError(_0xa21f36,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ad8785a..87464a0 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 _0x4bd3=['map','setDataValue','length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','Users'];(function(_0x3486aa,_0x16ff6b){var _0x592017=function(_0x4d170c){while(--_0x4d170c){_0x3486aa['push'](_0x3486aa['shift']());}};_0x592017(++_0x16ff6b);}(_0x4bd3,0x70));var _0x34bd=function(_0x5d0df6,_0x3c790c){_0x5d0df6=_0x5d0df6-0x0;var _0x31b504=_0x4bd3[_0x5d0df6];return _0x31b504;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x34bd('0x0'))['db'][_0x34bd('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x34bd('0x2')](0x0);var events={'afterCreate':_0x34bd('0x3'),'afterUpdate':'update','afterDestroy':_0x34bd('0x4')};function emitEvent(_0x32f121){return function(_0x4c75e9,_0x24e6b1,_0x31cfca){_0x4c75e9[_0x34bd('0x5')]({'attributes':['id'],'raw':!![]})[_0x34bd('0x6')](function(_0x4f1f38){_0x4c75e9['setDataValue'](_0x34bd('0x7'),_0x4f1f38[_0x34bd('0x8')](function(_0x4a82d5){return{'id':_0x4a82d5['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4c75e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x34bd('0x6')](function(_0x5e4079){_0x4c75e9[_0x34bd('0x9')]('unreadMessages',_0x5e4079[_0x34bd('0xa')]);OpenchannelInteractionEvents[_0x34bd('0xb')](_0x32f121+':'+_0x4c75e9['id'],_0x4c75e9);OpenchannelInteractionEvents['emit'](_0x32f121,_0x4c75e9);_0x31cfca(null);})[_0x34bd('0xc')](_0x31cfca(null));};}for(var e in events){if(events[_0x34bd('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x34bd('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xcc3e=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports'];(function(_0x44a3ff,_0x60421){var _0x38d3f0=function(_0x37f879){while(--_0x37f879){_0x44a3ff['push'](_0x44a3ff['shift']());}};_0x38d3f0(++_0x60421);}(_0xcc3e,0x1ba));var _0xecc3=function(_0x27caa6,_0x14b889){_0x27caa6=_0x27caa6-0x0;var _0x5a8ef9=_0xcc3e[_0x27caa6];return _0x5a8ef9;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xecc3('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xecc3('0x0'))['db'][_0xecc3('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xecc3('0x2')](0x0);var events={'afterCreate':_0xecc3('0x3'),'afterUpdate':_0xecc3('0x4'),'afterDestroy':_0xecc3('0x5')};function emitEvent(_0x57e3c5){return function(_0x2999f5,_0x3ac5cd,_0x166671){_0x2999f5[_0xecc3('0x6')]({'attributes':['id'],'raw':!![]})[_0xecc3('0x7')](function(_0x35a279){_0x2999f5[_0xecc3('0x8')](_0xecc3('0x9'),_0x35a279[_0xecc3('0xa')](function(_0x3b6ee2){return{'id':_0x3b6ee2['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2999f5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xecc3('0x7')](function(_0x59a8d9){_0x2999f5['setDataValue'](_0xecc3('0xb'),_0x59a8d9[_0xecc3('0xc')]);OpenchannelInteractionEvents['emit'](_0x57e3c5+':'+_0x2999f5['id'],_0x2999f5);OpenchannelInteractionEvents[_0xecc3('0xd')](_0x57e3c5,_0x2999f5);_0x166671(null);})[_0xecc3('0xe')](_0x166671(null));};}for(var e in events){if(events[_0xecc3('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xecc3('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8dedd50..ca61c3b 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 _0x2f3e=['utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions'];(function(_0x1be5eb,_0x1928ac){var _0x22d66a=function(_0x5132c5){while(--_0x5132c5){_0x1be5eb['push'](_0x1be5eb['shift']());}};_0x22d66a(++_0x1928ac);}(_0x2f3e,0x1d6));var _0xe2f3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2f3e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var logger=require(_0xe2f3('0x2'))(_0xe2f3('0x3'));var moment=require('moment');var BPromise=require(_0xe2f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2f3('0x5'));var rimraf=require('rimraf');var config=require(_0xe2f3('0x6'));var attributes=require(_0xe2f3('0x7'));module['exports']=function(_0x5c09f5,_0x151eb3){return _0x5c09f5['define'](_0xe2f3('0x8'),attributes,{'tableName':_0xe2f3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe2f3('0xa'),'hooks':{'beforeUpdate':function(_0x3ef056,_0x46cf1b,_0x2340e1){if(_0x3ef056['changed'](_0xe2f3('0xb'))){_0x3ef056[_0xe2f3('0xc')]=moment()[_0xe2f3('0xd')](_0xe2f3('0xe'));}_0x2340e1(null,_0x3ef056);}}});}; \ No newline at end of file +var _0x5709=['changed','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9570('0x0'));var util=require(_0x9570('0x1'));var logger=require(_0x9570('0x2'))('api');var moment=require(_0x9570('0x3'));var BPromise=require(_0x9570('0x4'));var rp=require(_0x9570('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9570('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x9570('0x7')]=function(_0x4717ba,_0x2fe63e){return _0x4717ba[_0x9570('0x8')](_0x9570('0x9'),attributes,{'tableName':_0x9570('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9570('0xb'),'collate':_0x9570('0xc'),'hooks':{'beforeUpdate':function(_0x546539,_0x4d9a63,_0x3681eb){if(_0x546539[_0x9570('0xd')](_0x9570('0xe'))){_0x546539[_0x9570('0xf')]=moment()[_0x9570('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3681eb(null,_0x546539);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 34aee46..5f2479b 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 _0xea3c=['options','where','attributes','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0xe1309a,_0xf8f2ab){var _0xe69827=function(_0x139698){while(--_0x139698){_0xe1309a['push'](_0xe1309a['shift']());}};_0xe69827(++_0xf8f2ab);}(_0xea3c,0xa9));var _0xcea3=function(_0x5cdf5d,_0x616e66){_0x5cdf5d=_0x5cdf5d-0x0;var _0x2b947a=_0xea3c[_0x5cdf5d];return _0x2b947a;};'use strict';var _=require(_0xcea3('0x0'));var util=require(_0xcea3('0x1'));var moment=require(_0xcea3('0x2'));var BPromise=require(_0xcea3('0x3'));var rs=require(_0xcea3('0x4'));var fs=require('fs');var Redis=require(_0xcea3('0x5'));var db=require(_0xcea3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcea3('0x7'))(_0xcea3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcea3('0x9')][_0xcea3('0xa')]({'port':0x232a});config[_0xcea3('0xb')]=_[_0xcea3('0xc')](config[_0xcea3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcea3('0xd'))(new Redis(config[_0xcea3('0xb')]));require(_0xcea3('0xe'))[_0xcea3('0xf')](socket);function respondWithRpcPromise(_0x5606a1,_0x5ac2e3,_0x5b05d9){return new BPromise(function(_0x330296,_0x5ed683){return client[_0xcea3('0x10')](_0x5606a1,_0x5b05d9)[_0xcea3('0x11')](function(_0x28e66c){logger[_0xcea3('0x12')](_0xcea3('0x13'),_0x5ac2e3,_0xcea3('0x14'));logger[_0xcea3('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x5ac2e3,_0xcea3('0x14'),JSON[_0xcea3('0x16')](_0x28e66c));if(_0x28e66c[_0xcea3('0x17')]){if(_0x28e66c[_0xcea3('0x17')][_0xcea3('0x18')]===0x1f4){logger[_0xcea3('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5ac2e3,_0x28e66c[_0xcea3('0x17')][_0xcea3('0x19')]);return _0x5ed683(_0x28e66c[_0xcea3('0x17')]['message']);}logger[_0xcea3('0x17')](_0xcea3('0x13'),_0x5ac2e3,_0x28e66c[_0xcea3('0x17')][_0xcea3('0x19')]);return _0x330296(_0x28e66c[_0xcea3('0x17')][_0xcea3('0x19')]);}else{logger[_0xcea3('0x12')](_0xcea3('0x13'),_0x5ac2e3,_0xcea3('0x14'));_0x330296(_0x28e66c['result'][_0xcea3('0x19')]);}})[_0xcea3('0x1a')](function(_0x40c86a){logger[_0xcea3('0x17')](_0xcea3('0x13'),_0x5ac2e3,_0x40c86a);_0x5ed683(_0x40c86a);});});}exports[_0xcea3('0x1b')]=function(_0x48535c){var _0x9a7a6d=this;return new Promise(function(_0x3eeb60,_0x1096fa){return db[_0xcea3('0x1c')][_0xcea3('0x1d')](_0x48535c[_0xcea3('0x1e')],{'raw':_0x48535c['options']?_0x48535c[_0xcea3('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48535c[_0xcea3('0x1f')]?_0x48535c[_0xcea3('0x1f')][_0xcea3('0x20')]||null:null,'attributes':_0x48535c['options']?_0x48535c['options'][_0xcea3('0x21')]||null:null,'limit':_0x48535c[_0xcea3('0x1f')]?_0x48535c['options']['limit']||null:null})['then'](function(_0x465de4){logger[_0xcea3('0x12')](_0xcea3('0x1b'),_0x48535c);logger['debug'](_0xcea3('0x1b'),_0x48535c,JSON[_0xcea3('0x16')](_0x465de4));_0x3eeb60(_0x465de4);})['catch'](function(_0xe51b08){logger[_0xcea3('0x17')](_0xcea3('0x1b'),_0xe51b08[_0xcea3('0x19')],_0x48535c);_0x1096fa(_0x9a7a6d[_0xcea3('0x17')](0x1f4,_0xe51b08[_0xcea3('0x19')]));});});};exports[_0xcea3('0x22')]=function(_0x4528dc){return new Promise(function(_0x390049,_0x596fa2){return db[_0xcea3('0x1c')]['find']({'where':_0x4528dc[_0xcea3('0x1f')]?_0x4528dc[_0xcea3('0x1f')][_0xcea3('0x20')]||null:null})[_0xcea3('0x11')](function(_0x4efb3f){if(_0x4efb3f){return _0x4efb3f[_0xcea3('0x23')](_0x4528dc[_0xcea3('0x1e')][_0xcea3('0x24')],_[_0xcea3('0x25')](_0x4528dc[_0xcea3('0x1e')],[_0xcea3('0x24'),'id'])||{});}})[_0xcea3('0x26')](function(_0x4d80db){logger[_0xcea3('0x12')](_0xcea3('0x27'),_0x4528dc);logger[_0xcea3('0x15')](_0xcea3('0x27'),_0x4528dc,JSON[_0xcea3('0x16')](_0x4d80db));_0x390049(_0x4d80db);})[_0xcea3('0x1a')](function(_0xf1a810){logger[_0xcea3('0x17')](_0xcea3('0x27'),_0xf1a810[_0xcea3('0x19')],_0x4528dc);_0x596fa2(_this['error'](0x1f4,_0xf1a810['message']));});});}; \ No newline at end of file +var _0x6de1=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','catch','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis'];(function(_0x1bb8d2,_0x551745){var _0x2a960d=function(_0x2b385e){while(--_0x2b385e){_0x1bb8d2['push'](_0x1bb8d2['shift']());}};_0x2a960d(++_0x551745);}(_0x6de1,0x143));var _0x16de=function(_0x111ccc,_0x4f5094){_0x111ccc=_0x111ccc-0x0;var _0x5bd2a5=_0x6de1[_0x111ccc];return _0x5bd2a5;};'use strict';var _=require('lodash');var util=require(_0x16de('0x0'));var moment=require(_0x16de('0x1'));var BPromise=require(_0x16de('0x2'));var rs=require(_0x16de('0x3'));var fs=require('fs');var Redis=require(_0x16de('0x4'));var db=require(_0x16de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x16de('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x16de('0x7'));var client=jayson[_0x16de('0x8')][_0x16de('0x9')]({'port':0x232a});config[_0x16de('0xa')]=_[_0x16de('0xb')](config[_0x16de('0xa')],{'host':_0x16de('0xc'),'port':0x18eb});var socket=require(_0x16de('0xd'))(new Redis(config[_0x16de('0xa')]));require(_0x16de('0xe'))['register'](socket);function respondWithRpcPromise(_0x1258df,_0x29f386,_0x594284){return new BPromise(function(_0x3ce7bf,_0x338d6d){return client[_0x16de('0xf')](_0x1258df,_0x594284)['then'](function(_0x35e957){logger[_0x16de('0x10')](_0x16de('0x11'),_0x29f386,'request\x20sent');logger[_0x16de('0x12')](_0x16de('0x13'),_0x29f386,_0x16de('0x14'),JSON[_0x16de('0x15')](_0x35e957));if(_0x35e957['error']){if(_0x35e957[_0x16de('0x16')][_0x16de('0x17')]===0x1f4){logger[_0x16de('0x16')](_0x16de('0x11'),_0x29f386,_0x35e957[_0x16de('0x16')][_0x16de('0x18')]);return _0x338d6d(_0x35e957[_0x16de('0x16')][_0x16de('0x18')]);}logger[_0x16de('0x16')](_0x16de('0x11'),_0x29f386,_0x35e957[_0x16de('0x16')][_0x16de('0x18')]);return _0x3ce7bf(_0x35e957[_0x16de('0x16')][_0x16de('0x18')]);}else{logger[_0x16de('0x10')](_0x16de('0x11'),_0x29f386,_0x16de('0x14'));_0x3ce7bf(_0x35e957[_0x16de('0x19')][_0x16de('0x18')]);}})['catch'](function(_0x1aac33){logger[_0x16de('0x16')](_0x16de('0x11'),_0x29f386,_0x1aac33);_0x338d6d(_0x1aac33);});});}exports[_0x16de('0x1a')]=function(_0x1ba75a){var _0x35c2ae=this;return new Promise(function(_0x74c935,_0x36a35b){return db[_0x16de('0x1b')][_0x16de('0x1c')](_0x1ba75a[_0x16de('0x1d')],{'raw':_0x1ba75a[_0x16de('0x1e')]?_0x1ba75a[_0x16de('0x1e')][_0x16de('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ba75a['options']?_0x1ba75a['options'][_0x16de('0x20')]||null:null,'attributes':_0x1ba75a[_0x16de('0x1e')]?_0x1ba75a[_0x16de('0x1e')][_0x16de('0x21')]||null:null,'limit':_0x1ba75a[_0x16de('0x1e')]?_0x1ba75a[_0x16de('0x1e')][_0x16de('0x22')]||null:null})[_0x16de('0x23')](function(_0x5b2344){logger[_0x16de('0x10')](_0x16de('0x1a'),_0x1ba75a);logger[_0x16de('0x12')]('UpdateOpenchannelInteraction',_0x1ba75a,JSON[_0x16de('0x15')](_0x5b2344));_0x74c935(_0x5b2344);})[_0x16de('0x24')](function(_0x532ef1){logger[_0x16de('0x16')](_0x16de('0x1a'),_0x532ef1[_0x16de('0x18')],_0x1ba75a);_0x36a35b(_0x35c2ae[_0x16de('0x16')](0x1f4,_0x532ef1[_0x16de('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x332cea){return new Promise(function(_0x587588,_0x501495){return db[_0x16de('0x1b')]['find']({'where':_0x332cea[_0x16de('0x1e')]?_0x332cea['options']['where']||null:null})[_0x16de('0x23')](function(_0x2bdc8b){if(_0x2bdc8b){return _0x2bdc8b['addTags'](_0x332cea[_0x16de('0x1d')][_0x16de('0x25')],_[_0x16de('0x26')](_0x332cea[_0x16de('0x1d')],[_0x16de('0x25'),'id'])||{});}})[_0x16de('0x27')](function(_0x22ced4){logger['info'](_0x16de('0x28'),_0x332cea);logger[_0x16de('0x12')](_0x16de('0x28'),_0x332cea,JSON[_0x16de('0x15')](_0x22ced4));_0x587588(_0x22ced4);})['catch'](function(_0x2c5d8d){logger[_0x16de('0x16')](_0x16de('0x28'),_0x2c5d8d['message'],_0x332cea);_0x501495(_this[_0x16de('0x16')](0x1f4,_0x2c5d8d[_0x16de('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 75f850a..6c159a4 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 _0xc29f=['openchannelInteraction:','./openchannelInteraction.events','save','removeListener','register','length'];(function(_0x3977ea,_0x1c023d){var _0x47f984=function(_0x5ebe35){while(--_0x5ebe35){_0x3977ea['push'](_0x3977ea['shift']());}};_0x47f984(++_0x1c023d);}(_0xc29f,0x1cf));var _0xfc29=function(_0x53fdd5,_0x1f3f58){_0x53fdd5=_0x53fdd5-0x0;var _0x1cc7bf=_0xc29f[_0x53fdd5];return _0x1cc7bf;};'use strict';var OpenchannelInteractionEvents=require(_0xfc29('0x0'));var events=[_0xfc29('0x1'),'remove','update'];function createListener(_0x2ffa92,_0x30c1fe){return function(_0x20e50d){_0x30c1fe['emit'](_0x2ffa92,_0x20e50d);};}function removeListener(_0x36edbc,_0x348e2b){return function(){OpenchannelInteractionEvents[_0xfc29('0x2')](_0x36edbc,_0x348e2b);};}exports[_0xfc29('0x3')]=function(_0x815e6){for(var _0x1e311e=0x0,_0x301ef3=events[_0xfc29('0x4')];_0x1e311e<_0x301ef3;_0x1e311e++){var _0x2b3677=events[_0x1e311e];var _0x2150f1=createListener(_0xfc29('0x5')+_0x2b3677,_0x815e6);OpenchannelInteractionEvents['on'](_0x2b3677,_0x2150f1);}}; \ No newline at end of file +var _0x9c97=['./openchannelInteraction.events','save','remove','update','register','length','openchannelInteraction:'];(function(_0x7e95c9,_0xe40903){var _0x55f967=function(_0x53b9c5){while(--_0x53b9c5){_0x7e95c9['push'](_0x7e95c9['shift']());}};_0x55f967(++_0xe40903);}(_0x9c97,0x15e));var _0x79c9=function(_0x1617bf,_0xc31459){_0x1617bf=_0x1617bf-0x0;var _0x5371b8=_0x9c97[_0x1617bf];return _0x5371b8;};'use strict';var OpenchannelInteractionEvents=require(_0x79c9('0x0'));var events=[_0x79c9('0x1'),_0x79c9('0x2'),_0x79c9('0x3')];function createListener(_0x22592a,_0x51275b){return function(_0xc73c6){_0x51275b['emit'](_0x22592a,_0xc73c6);};}function removeListener(_0x33064f,_0x575343){return function(){OpenchannelInteractionEvents['removeListener'](_0x33064f,_0x575343);};}exports[_0x79c9('0x4')]=function(_0x26db57){for(var _0x44bf29=0x0,_0x137bc3=events[_0x79c9('0x5')];_0x44bf29<_0x137bc3;_0x44bf29++){var _0xd0f6d=events[_0x44bf29];var _0x57e72d=createListener(_0x79c9('0x6')+_0xd0f6d,_0x26db57);OpenchannelInteractionEvents['on'](_0xd0f6d,_0x57e72d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 9669998..2ae57bd 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 _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(_0x520663,_0x4d37dd){var _0x391fe3=function(_0x3b99cc){while(--_0x3b99cc){_0x520663['push'](_0x520663['shift']());}};_0x391fe3(++_0x4d37dd);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');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 +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x240ad2,_0x29db41){_0x240ad2=_0x240ad2-0x0;var _0x527009=_0x70e0[_0x240ad2];return _0x527009;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 18f68f5..b24fd9d 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 _0xf894=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf894,0xfd));var _0x4f89=function(_0x21c09f,_0x2e5e11){_0x21c09f=_0x21c09f-0x0;var _0x321a05=_0xf894[_0x21c09f];return _0x321a05;};'use strict';var Sequelize=require(_0x4f89('0x0'));module[_0x4f89('0x1')]={'body':{'type':Sequelize[_0x4f89('0x2')](_0x4f89('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f89('0x5')]('in',_0x4f89('0x6')),'defaultValue':_0x4f89('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f89('0x7')]},'providerName':{'type':Sequelize[_0x4f89('0x8')]},'providerResponse':{'type':Sequelize[_0x4f89('0x2')]}}; \ No newline at end of file +var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x1d21,0x158));var _0x11d2=function(_0x18474f,_0x51e0f9){_0x18474f=_0x18474f-0x0;var _0xab5297=_0x1d21[_0x18474f];return _0xab5297;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 88b336f..d674c19 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 _0x2777=['includeAll','include','findAll','params','intersection','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','interface','channel','motionChannel','event','EventManager','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','fullname','email','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','result','message','catch','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x1140d6,_0x349fdc){var _0x598781=function(_0x4f7e06){while(--_0x4f7e06){_0x1140d6['push'](_0x1140d6['shift']());}};_0x598781(++_0x349fdc);}(_0x2777,0x130));var _0x7277=function(_0x493536,_0x2e9217){_0x493536=_0x493536-0x0;var _0xac9660=_0x2777[_0x493536];return _0xac9660;};'use strict';var emlformat=require(_0x7277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7277('0x1'));var jsonpatch=require(_0x7277('0x2'));var rp=require(_0x7277('0x3'));var moment=require(_0x7277('0x4'));var BPromise=require(_0x7277('0x5'));var Mustache=require(_0x7277('0x6'));var util=require(_0x7277('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7277('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7277('0x9'));var _=require(_0x7277('0xa'));var squel=require(_0x7277('0xb'));var crypto=require(_0x7277('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7277('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7277('0xe'));var Papa=require(_0x7277('0xf'));var Redis=require(_0x7277('0x10'));var authService=require(_0x7277('0x11'));var qs=require(_0x7277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7277('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7277('0x14'));var config=require(_0x7277('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7277('0x16')]=_[_0x7277('0x17')](config[_0x7277('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x7277('0x18'))(new Redis(config[_0x7277('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x7277('0x19'));var client=jayson[_0x7277('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x7277('0x1a')][_0x7277('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x62552e,_0xe08f89,_0x48174e,_0x5e6df4){return new BPromise(function(_0x59b273,_0x1a2d76){var _0x173c0c=_0x5e6df4||client;return _0x173c0c[_0x7277('0x1c')](_0x62552e,_0x48174e)['then'](function(_0x41465){logger[_0x7277('0x1d')](_0x7277('0x1e'),_0xe08f89,_0x7277('0x1f'));logger[_0x7277('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xe08f89,_0x7277('0x1f'),JSON[_0x7277('0x21')](_0x41465));if(_0x41465['error']){if(_0x41465[_0x7277('0x22')]['code']===0x1f4){logger[_0x7277('0x22')](_0x7277('0x1e'),_0xe08f89,_0x41465[_0x7277('0x22')]['message']);return _0x1a2d76(_0x41465[_0x7277('0x22')]['message']);}logger['error'](_0x7277('0x1e'),_0xe08f89,_0x41465[_0x7277('0x22')]['message']);return _0x59b273(_0x41465[_0x7277('0x22')]['message']);}else{logger[_0x7277('0x1d')](_0x7277('0x1e'),_0xe08f89,_0x7277('0x1f'));_0x59b273(_0x41465[_0x7277('0x23')][_0x7277('0x24')]);}})[_0x7277('0x25')](function(_0x2ba4b7){logger[_0x7277('0x22')](_0x7277('0x1e'),_0xe08f89,_0x2ba4b7);_0x1a2d76(_0x2ba4b7);});});}function respondWithStatusCode(_0x4f1c0e,_0x10dc0b){_0x10dc0b=_0x10dc0b||0xcc;return function(_0x276336){if(_0x276336){return _0x4f1c0e[_0x7277('0x26')](_0x10dc0b);}return _0x4f1c0e['status'](_0x10dc0b)[_0x7277('0x27')]();};}function respondWithResult(_0x40aa58,_0x13cca7){_0x13cca7=_0x13cca7||0xc8;return function(_0x17d0a1){if(_0x17d0a1){return _0x40aa58[_0x7277('0x28')](_0x13cca7)[_0x7277('0x29')](_0x17d0a1);}};}function respondWithFilteredResult(_0xc42f16,_0xdf8172){return function(_0x15c7d3){if(_0x15c7d3){var _0x31a582=typeof _0xdf8172['offset']===_0x7277('0x2a')&&typeof _0xdf8172[_0x7277('0x2b')]==='undefined';var _0x473de2=_0x15c7d3[_0x7277('0x2c')];var _0x409ba8=_0x31a582?0x0:_0xdf8172['offset'];var _0xd32665=_0x31a582?_0x15c7d3[_0x7277('0x2c')]:_0xdf8172['offset']+_0xdf8172[_0x7277('0x2b')];var _0x3cd256;if(_0xd32665>=_0x473de2){_0xd32665=_0x473de2;_0x3cd256=0xc8;}else{_0x3cd256=0xce;}_0xc42f16[_0x7277('0x28')](_0x3cd256);return _0xc42f16[_0x7277('0x2d')](_0x7277('0x2e'),_0x409ba8+'-'+_0xd32665+'/'+_0x473de2)[_0x7277('0x29')](_0x15c7d3);}return null;};}function patchUpdates(_0x2c7895){return function(_0x196cd2){try{jsonpatch[_0x7277('0x2f')](_0x196cd2,_0x2c7895,!![]);}catch(_0x3811be){return BPromise[_0x7277('0x30')](_0x3811be);}return _0x196cd2[_0x7277('0x31')]();};}function saveUpdates(_0x12b234,_0x10dcae){return function(_0x3139da){if(_0x3139da){return _0x3139da[_0x7277('0x32')](_0x12b234)[_0x7277('0x33')](function(_0x247b48){return _0x247b48;});}return null;};}function removeEntity(_0x45fde8,_0x4a5543){return function(_0x42ac52){if(_0x42ac52){return _0x42ac52[_0x7277('0x34')]()['then'](function(){_0x45fde8[_0x7277('0x28')](0xcc)[_0x7277('0x27')]();});}};}function handleEntityNotFound(_0x5b5b90,_0x38a64b){return function(_0x5cead4){if(!_0x5cead4){_0x5b5b90[_0x7277('0x26')](0x194);}return _0x5cead4;};}function handleError(_0x1801d7,_0x2eb36c){_0x2eb36c=_0x2eb36c||0x1f4;return function(_0x19ef78){logger[_0x7277('0x22')](_0x19ef78['stack']);if(_0x19ef78[_0x7277('0x35')]){delete _0x19ef78[_0x7277('0x35')];}_0x1801d7['status'](_0x2eb36c)['send'](_0x19ef78);};}exports[_0x7277('0x36')]=function(_0x1a22c8,_0x11cc3f){var _0x26e242={},_0x2fa823={},_0x137d6e={'count':0x0,'rows':[]};var _0x1214c6=_[_0x7277('0x37')](db[_0x7277('0x38')][_0x7277('0x39')],function(_0x381347){return{'name':_0x381347[_0x7277('0x3a')],'type':_0x381347[_0x7277('0x3b')]['key']};});_0x2fa823['model']=_[_0x7277('0x37')](_0x1214c6,'name');_0x2fa823[_0x7277('0x3c')]=_[_0x7277('0x3d')](_0x1a22c8[_0x7277('0x3c')]);_0x2fa823[_0x7277('0x3e')]=_['intersection'](_0x2fa823[_0x7277('0x3f')],_0x2fa823[_0x7277('0x3c')]);_0x26e242['attributes']=_['intersection'](_0x2fa823['model'],qs[_0x7277('0x40')](_0x1a22c8['query'][_0x7277('0x40')]));_0x26e242[_0x7277('0x41')]=_0x26e242['attributes'][_0x7277('0x42')]?_0x26e242[_0x7277('0x41')]:_0x2fa823[_0x7277('0x3f')];if(!_0x1a22c8[_0x7277('0x3c')][_0x7277('0x43')]('nolimit')){_0x26e242['limit']=qs[_0x7277('0x2b')](_0x1a22c8[_0x7277('0x3c')]['limit']);_0x26e242['offset']=qs[_0x7277('0x44')](_0x1a22c8[_0x7277('0x3c')][_0x7277('0x44')]);}_0x26e242[_0x7277('0x45')]=qs['sort'](_0x1a22c8[_0x7277('0x3c')][_0x7277('0x46')]);_0x26e242[_0x7277('0x47')]=qs['filters'](_[_0x7277('0x48')](_0x1a22c8[_0x7277('0x3c')],_0x2fa823[_0x7277('0x3e')]),_0x1214c6);if(_0x1a22c8[_0x7277('0x3c')][_0x7277('0x49')]){_0x26e242[_0x7277('0x47')]=_[_0x7277('0x4a')](_0x26e242['where'],{'$or':_[_0x7277('0x37')](_0x1214c6,function(_0x1aba45){if(_0x1aba45[_0x7277('0x3b')]!==_0x7277('0x4b')){var _0x414c54={};_0x414c54[_0x1aba45['name']]={'$like':'%'+_0x1a22c8[_0x7277('0x3c')]['filter']+'%'};return _0x414c54;}})});}_0x26e242=_[_0x7277('0x4a')]({},_0x26e242,_0x1a22c8[_0x7277('0x4c')]);var _0x5efc59={'where':_0x26e242['where']};return db[_0x7277('0x38')][_0x7277('0x2c')](_0x5efc59)[_0x7277('0x33')](function(_0x324571){_0x137d6e[_0x7277('0x2c')]=_0x324571;if(_0x1a22c8[_0x7277('0x3c')][_0x7277('0x4d')]){_0x26e242[_0x7277('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7277('0x4f')](_0x26e242);})[_0x7277('0x33')](function(_0x3f1231){_0x137d6e['rows']=_0x3f1231;return _0x137d6e;})[_0x7277('0x33')](respondWithFilteredResult(_0x11cc3f,_0x26e242))[_0x7277('0x25')](handleError(_0x11cc3f,null));};exports['show']=function(_0x15a421,_0x5f316d){var _0x46a124={'raw':!![],'where':{'id':_0x15a421[_0x7277('0x50')]['id']}},_0x434535={};_0x434535[_0x7277('0x3f')]=_[_0x7277('0x3d')](db['OpenchannelMessage']['rawAttributes']);_0x434535[_0x7277('0x3c')]=_[_0x7277('0x3d')](_0x15a421[_0x7277('0x3c')]);_0x434535[_0x7277('0x3e')]=_[_0x7277('0x51')](_0x434535['model'],_0x434535[_0x7277('0x3c')]);_0x46a124['attributes']=_[_0x7277('0x51')](_0x434535[_0x7277('0x3f')],qs[_0x7277('0x40')](_0x15a421[_0x7277('0x3c')][_0x7277('0x40')]));_0x46a124[_0x7277('0x41')]=_0x46a124['attributes'][_0x7277('0x42')]?_0x46a124['attributes']:_0x434535['model'];if(_0x15a421['query'][_0x7277('0x4d')]){_0x46a124['include']=[{'all':!![]}];}_0x46a124=_[_0x7277('0x4a')]({},_0x46a124,_0x15a421[_0x7277('0x4c')]);return db[_0x7277('0x38')][_0x7277('0x52')](_0x46a124)[_0x7277('0x33')](handleEntityNotFound(_0x5f316d,null))[_0x7277('0x33')](respondWithResult(_0x5f316d,null))[_0x7277('0x25')](handleError(_0x5f316d,null));};exports[_0x7277('0x53')]=function(_0x1604ab,_0x173622){return db[_0x7277('0x38')][_0x7277('0x53')](_0x1604ab[_0x7277('0x54')],{})[_0x7277('0x33')](respondWithResult(_0x173622,0xc9))[_0x7277('0x25')](handleError(_0x173622,null));};exports[_0x7277('0x32')]=function(_0x4b140f,_0x57091c){if(_0x4b140f[_0x7277('0x54')]['id']){delete _0x4b140f['body']['id'];}return db[_0x7277('0x38')]['find']({'where':{'id':_0x4b140f['params']['id']}})['then'](handleEntityNotFound(_0x57091c,null))[_0x7277('0x33')](saveUpdates(_0x4b140f[_0x7277('0x54')],null))[_0x7277('0x33')](respondWithResult(_0x57091c,null))[_0x7277('0x25')](handleError(_0x57091c,null));};exports[_0x7277('0x34')]=function(_0x392536,_0x1292e4){return db[_0x7277('0x38')][_0x7277('0x52')]({'where':{'id':_0x392536[_0x7277('0x50')]['id']}})[_0x7277('0x33')](handleEntityNotFound(_0x1292e4,null))[_0x7277('0x33')](removeEntity(_0x1292e4,null))[_0x7277('0x25')](handleError(_0x1292e4,null));};exports[_0x7277('0x55')]=function(_0x5586a4,_0x249b53){return db[_0x7277('0x38')][_0x7277('0x55')]()[_0x7277('0x33')](respondWithResult(_0x249b53,null))[_0x7277('0x25')](handleError(_0x249b53,null));};var interaction_log=require('../../config/logger')(_0x7277('0x56'));exports[_0x7277('0x57')]=function(_0x58e161,_0x2e24b9,_0xe200e0){var _0x96b1ae={'agent':{},'channel':_0x7277('0x58')};if(_0x58e161[_0x7277('0x54')]['id']){delete _0x58e161['body']['id'];}_0x58e161['body'][_0x7277('0x59')]=!![];_0x58e161[_0x7277('0x54')][_0x7277('0x5a')]=moment()[_0x7277('0x5b')](_0x7277('0x5c'));_0x58e161[_0x7277('0x54')][_0x7277('0x5d')]=_0x58e161[_0x7277('0x54')][_0x7277('0x5d')]||_0x58e161[_0x7277('0x5e')]['id'];_0x96b1ae['agent']['id']=_0x58e161[_0x7277('0x54')]['UserId'];return db['OpenchannelMessage'][_0x7277('0x52')]({'where':{'id':_0x58e161['params']['id'],'UserId':null}})[_0x7277('0x33')](handleEntityNotFound(_0x2e24b9,null))[_0x7277('0x33')](saveUpdates(_0x58e161[_0x7277('0x54')],null))[_0x7277('0x33')](function(_0x1b7614){if(_0x1b7614){_0x96b1ae[_0x7277('0x24')]=_0x1b7614[_0x7277('0x5f')]({'plain':!![]});return db[_0x7277('0x60')][_0x7277('0x52')]({'where':{'id':_0x1b7614[_0x7277('0x61')]}});}return null;})[_0x7277('0x33')](handleEntityNotFound(_0x2e24b9,null))['then'](function(_0x4ed32b){if(_0x4ed32b){return _0x4ed32b[_0x7277('0x32')]({'UserId':_0x58e161[_0x7277('0x54')]['UserId'],'read1stAt':_['isNil'](_0x4ed32b[_0x7277('0x62')])?moment()[_0x7277('0x5b')](_0x7277('0x5c')):undefined});}return null;})[_0x7277('0x33')](function(_0x40e8df){if(_0x40e8df){_0x96b1ae[_0x7277('0x63')]=_0x40e8df[_0x7277('0x5f')]({'plain':!![]});interaction_log['info'](_0x7277('0x64'),_0x58e161[_0x7277('0x5e')]['id'],_0x58e161[_0x7277('0x5e')][_0x7277('0x35')],_0x58e161[_0x7277('0x5e')]['role'],_0x96b1ae['interaction']['id'],_0x58e161[_0x7277('0x54')]?JSON[_0x7277('0x21')](_0x58e161[_0x7277('0x54')]):'null');return respondWithRpcPromise(_0x7277('0x65'),'acceptMessage',_0x96b1ae);}return null;})[_0x7277('0x33')](function(_0x18ebef){var _0x54535d=_0x7277('0x66')+_0x18ebef[_0x7277('0x24')][_0x7277('0x67')];return db[_0x7277('0x68')][_0x7277('0x3c')](_0x54535d,{'type':db[_0x7277('0x69')][_0x7277('0x6a')][_0x7277('0x6b')],'raw':!![]})['then'](function(_0x2237de){return _0x2237de;});})[_0x7277('0x33')](function(_0xa54d52){if(_0xa54d52){_0x96b1ae[_0x7277('0x24')][_0x7277('0x6c')]=_0xa54d52[0x0];if(!_0x58e161[_0x7277('0x54')][_0x7277('0x5d')])return;return db[_0x7277('0x6d')][_0x7277('0x52')]({'where':{'id':_0x58e161['body']['UserId'],'role':_0x7277('0x6e')},'attributes':['id',_0x7277('0x35'),'fullname','email',_0x7277('0x6f')],'raw':!![]});}return null;})[_0x7277('0x33')](function(_0x2ab3d9){if(!_0x2ab3d9)return null;_0x96b1ae[_0x7277('0x24')][_0x7277('0x6e')]=_0x2ab3d9;return _0x96b1ae;})[_0x7277('0x33')](function(_0x2c603a){if(_0x2c603a){if(_0x58e161[_0x7277('0x54')][_0x7277('0x70')]){_0x96b1ae['message'][_0x7277('0x71')]=util[_0x7277('0x5b')]('SIP/%s',_0x58e161['user'][_0x7277('0x35')]);_0x96b1ae[_0x7277('0x24')][_0x7277('0x72')]=_0x96b1ae[_0x7277('0x72')];_0x96b1ae['message'][_0x7277('0x73')]=_0x96b1ae[_0x7277('0x72')];_0x96b1ae[_0x7277('0x24')][_0x7277('0x74')]='accept';return respondWithRpcPromise(_0x7277('0x75'),'EventManager',{'event':'acceptmessage','message':_0x96b1ae[_0x7277('0x24')]},client9002)[_0x7277('0x33')](function(){return _0x96b1ae;});}return _0x96b1ae;}return null;})['then'](respondWithResult(_0x2e24b9,null))[_0x7277('0x25')](handleError(_0x2e24b9,null));};var interaction_log=require(_0x7277('0x76'))('openchannel-interactions');exports['reject']=function(_0x241434,_0x2960b3,_0xf87dbc){var _0xadd9e7={'agent':{},'channel':_0x7277('0x58')};if(_0x241434['body']['id']){delete _0x241434[_0x7277('0x54')]['id'];}_0x241434[_0x7277('0x54')]['UserId']=_0x241434[_0x7277('0x54')]['UserId']||_0x241434['user']['id'];_0xadd9e7[_0x7277('0x6e')]['id']=_0x241434['body'][_0x7277('0x5d')];return db[_0x7277('0x38')][_0x7277('0x52')]({'where':{'id':_0x241434[_0x7277('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2960b3,null))[_0x7277('0x33')](function(_0x30ac4c){if(_0x30ac4c){_0xadd9e7[_0x7277('0x24')]=_0x30ac4c['get']({'plain':!![]});return db[_0x7277('0x60')][_0x7277('0x52')]({'where':{'id':_0x30ac4c['OpenchannelInteractionId']}});}return null;})[_0x7277('0x33')](handleEntityNotFound(_0x2960b3,null))[_0x7277('0x33')](function(_0x4c1444){if(_0x4c1444){_0xadd9e7[_0x7277('0x63')]=_0x4c1444[_0x7277('0x5f')]({'plain':!![]});interaction_log[_0x7277('0x1d')](_0x7277('0x77'),_0x241434[_0x7277('0x5e')]['id'],_0x241434['user'][_0x7277('0x35')],_0x241434[_0x7277('0x5e')][_0x7277('0x78')],_0xadd9e7[_0x7277('0x63')]['id'],_0x241434[_0x7277('0x54')]?JSON[_0x7277('0x21')](_0x241434[_0x7277('0x54')]):_0x7277('0x79'));return respondWithRpcPromise('RejectMessage',_0x7277('0x7a'),_0xadd9e7);}return null;})[_0x7277('0x33')](function(_0x37d889){var _0x3384b6=_0x7277('0x66')+_0x37d889[_0x7277('0x24')]['ContactId'];return db[_0x7277('0x68')][_0x7277('0x3c')](_0x3384b6,{'type':db['Sequelize'][_0x7277('0x6a')][_0x7277('0x6b')],'raw':!![]})[_0x7277('0x33')](function(_0x383838){return _0x383838;});})[_0x7277('0x33')](function(_0x2a087c){if(_0x2a087c){_0xadd9e7[_0x7277('0x24')][_0x7277('0x6c')]=_0x2a087c[0x0];if(!_0x241434[_0x7277('0x54')][_0x7277('0x5d')])return;return db[_0x7277('0x6d')][_0x7277('0x52')]({'where':{'id':_0x241434[_0x7277('0x54')][_0x7277('0x5d')],'role':'agent'},'attributes':['id',_0x7277('0x35'),_0x7277('0x7b'),_0x7277('0x7c'),_0x7277('0x6f')],'raw':!![]});}return null;})['then'](function(_0x417a3e){if(!_0x417a3e)return null;_0xadd9e7[_0x7277('0x24')]['agent']=_0x417a3e;return _0xadd9e7;})[_0x7277('0x33')](function(_0x191ec3){if(_0x191ec3){_0x191ec3[_0x7277('0x24')][_0x7277('0x71')]=util[_0x7277('0x5b')](_0x7277('0x7d'),_0x241434['user']['name']);_0x191ec3[_0x7277('0x24')][_0x7277('0x72')]=_0xadd9e7['channel'];_0x191ec3[_0x7277('0x24')][_0x7277('0x73')]=_0xadd9e7[_0x7277('0x72')];_0x191ec3[_0x7277('0x24')][_0x7277('0x74')]=_0x7277('0x30');respondWithRpcPromise(_0x7277('0x75'),_0x7277('0x75'),{'event':_0x7277('0x7e'),'message':_0x191ec3[_0x7277('0x24')]},client9002);return _0xadd9e7;}return null;})[_0x7277('0x33')](respondWithResult(_0x2960b3,null))[_0x7277('0x25')](handleError(_0x2960b3,null));}; \ No newline at end of file +var _0x2544=['papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','show','merge','options','find','create','body','params','describe','openchannel-interactions','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE: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','contact','email','internal','manual','motionChannel','event','EventManager','acceptmessage','../../config/logger','null','rejectMessage','Sequelize','SELECT','User','fullname','SIP/%s','channel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x565292,_0x57eb92){var _0x521b61=function(_0x123434){while(--_0x123434){_0x565292['push'](_0x565292['shift']());}};_0x521b61(++_0x57eb92);}(_0x2544,0x1ec));var _0x4254=function(_0x1e2cb8,_0x1b2bbb){_0x1e2cb8=_0x1e2cb8-0x0;var _0x3c914a=_0x2544[_0x1e2cb8];return _0x3c914a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4254('0x0'));var zipdir=require(_0x4254('0x1'));var jsonpatch=require(_0x4254('0x2'));var rp=require(_0x4254('0x3'));var moment=require('moment');var BPromise=require(_0x4254('0x4'));var Mustache=require(_0x4254('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4254('0x6'));var csv=require('to-csv');var ejs=require(_0x4254('0x7'));var fs=require('fs');var fs_extra=require(_0x4254('0x8'));var _=require(_0x4254('0x9'));var squel=require(_0x4254('0xa'));var crypto=require(_0x4254('0xb'));var jsforce=require(_0x4254('0xc'));var deskjs=require(_0x4254('0xd'));var toCsv=require(_0x4254('0xe'));var querystring=require(_0x4254('0xf'));var Papa=require(_0x4254('0x10'));var Redis=require(_0x4254('0x11'));var authService=require(_0x4254('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4254('0x13'));var config=require(_0x4254('0x14'));var licenseUtil=require(_0x4254('0x15'));var db=require(_0x4254('0x16'))['db'];config[_0x4254('0x17')]=_['defaults'](config[_0x4254('0x17')],{'host':_0x4254('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4254('0x17')]));require(_0x4254('0x19'))['register'](socket);var jayson=require(_0x4254('0x1a'));var client=jayson['client'][_0x4254('0x1b')]({'port':0x232c});var client9002=jayson[_0x4254('0x1c')][_0x4254('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x47b816,_0x466b84,_0x56def8,_0x4f3da2){return new BPromise(function(_0x1dd188,_0x2e371d){var _0x43532d=_0x4f3da2||client;return _0x43532d[_0x4254('0x1d')](_0x47b816,_0x56def8)[_0x4254('0x1e')](function(_0x5cfdbb){logger[_0x4254('0x1f')](_0x4254('0x20'),_0x466b84,_0x4254('0x21'));logger['debug'](_0x4254('0x22'),_0x466b84,_0x4254('0x21'),JSON[_0x4254('0x23')](_0x5cfdbb));if(_0x5cfdbb[_0x4254('0x24')]){if(_0x5cfdbb['error']['code']===0x1f4){logger[_0x4254('0x24')](_0x4254('0x20'),_0x466b84,_0x5cfdbb[_0x4254('0x24')][_0x4254('0x25')]);return _0x2e371d(_0x5cfdbb[_0x4254('0x24')][_0x4254('0x25')]);}logger[_0x4254('0x24')](_0x4254('0x20'),_0x466b84,_0x5cfdbb['error'][_0x4254('0x25')]);return _0x1dd188(_0x5cfdbb[_0x4254('0x24')]['message']);}else{logger[_0x4254('0x1f')](_0x4254('0x20'),_0x466b84,'request\x20sent');_0x1dd188(_0x5cfdbb[_0x4254('0x26')][_0x4254('0x25')]);}})[_0x4254('0x27')](function(_0x41d51e){logger[_0x4254('0x24')](_0x4254('0x20'),_0x466b84,_0x41d51e);_0x2e371d(_0x41d51e);});});}function respondWithStatusCode(_0x45e6b8,_0x248fa3){_0x248fa3=_0x248fa3||0xcc;return function(_0x545f70){if(_0x545f70){return _0x45e6b8['sendStatus'](_0x248fa3);}return _0x45e6b8[_0x4254('0x28')](_0x248fa3)[_0x4254('0x29')]();};}function respondWithResult(_0x442294,_0xd541fd){_0xd541fd=_0xd541fd||0xc8;return function(_0x3135b7){if(_0x3135b7){return _0x442294[_0x4254('0x28')](_0xd541fd)['json'](_0x3135b7);}};}function respondWithFilteredResult(_0x1a7ba3,_0x1600cf){return function(_0x14d55a){if(_0x14d55a){var _0x41f705=typeof _0x1600cf['offset']===_0x4254('0x2a')&&typeof _0x1600cf['limit']==='undefined';var _0x3dd104=_0x14d55a[_0x4254('0x2b')];var _0xca7803=_0x41f705?0x0:_0x1600cf[_0x4254('0x2c')];var _0x5d1cdf=_0x41f705?_0x14d55a[_0x4254('0x2b')]:_0x1600cf[_0x4254('0x2c')]+_0x1600cf[_0x4254('0x2d')];var _0x2a8733;if(_0x5d1cdf>=_0x3dd104){_0x5d1cdf=_0x3dd104;_0x2a8733=0xc8;}else{_0x2a8733=0xce;}_0x1a7ba3[_0x4254('0x28')](_0x2a8733);return _0x1a7ba3[_0x4254('0x2e')](_0x4254('0x2f'),_0xca7803+'-'+_0x5d1cdf+'/'+_0x3dd104)[_0x4254('0x30')](_0x14d55a);}return null;};}function patchUpdates(_0x3a3bb7){return function(_0x156b99){try{jsonpatch[_0x4254('0x31')](_0x156b99,_0x3a3bb7,!![]);}catch(_0x1af4cb){return BPromise[_0x4254('0x32')](_0x1af4cb);}return _0x156b99[_0x4254('0x33')]();};}function saveUpdates(_0x1ad16f,_0x3c325f){return function(_0x31927c){if(_0x31927c){return _0x31927c[_0x4254('0x34')](_0x1ad16f)[_0x4254('0x1e')](function(_0x1b90b6){return _0x1b90b6;});}return null;};}function removeEntity(_0x45ac3c,_0x1081d4){return function(_0x2afa68){if(_0x2afa68){return _0x2afa68[_0x4254('0x35')]()[_0x4254('0x1e')](function(){_0x45ac3c[_0x4254('0x28')](0xcc)[_0x4254('0x29')]();});}};}function handleEntityNotFound(_0x3c71d6,_0x36787f){return function(_0x1b5aff){if(!_0x1b5aff){_0x3c71d6[_0x4254('0x36')](0x194);}return _0x1b5aff;};}function handleError(_0x335775,_0x21109d){_0x21109d=_0x21109d||0x1f4;return function(_0xf6e1f7){logger[_0x4254('0x24')](_0xf6e1f7[_0x4254('0x37')]);if(_0xf6e1f7[_0x4254('0x38')]){delete _0xf6e1f7['name'];}_0x335775[_0x4254('0x28')](_0x21109d)[_0x4254('0x39')](_0xf6e1f7);};}exports['index']=function(_0x2b4b72,_0x5bdc9d){var _0x60c046={},_0x295f11={},_0x4b479c={'count':0x0,'rows':[]};var _0x260c67=_['map'](db[_0x4254('0x3a')][_0x4254('0x3b')],function(_0x335ef3){return{'name':_0x335ef3[_0x4254('0x3c')],'type':_0x335ef3[_0x4254('0x3d')]['key']};});_0x295f11[_0x4254('0x3e')]=_[_0x4254('0x3f')](_0x260c67,_0x4254('0x38'));_0x295f11[_0x4254('0x40')]=_[_0x4254('0x41')](_0x2b4b72['query']);_0x295f11[_0x4254('0x42')]=_['intersection'](_0x295f11[_0x4254('0x3e')],_0x295f11['query']);_0x60c046['attributes']=_[_0x4254('0x43')](_0x295f11[_0x4254('0x3e')],qs[_0x4254('0x44')](_0x2b4b72[_0x4254('0x40')]['fields']));_0x60c046[_0x4254('0x45')]=_0x60c046[_0x4254('0x45')][_0x4254('0x46')]?_0x60c046[_0x4254('0x45')]:_0x295f11['model'];if(!_0x2b4b72[_0x4254('0x40')]['hasOwnProperty'](_0x4254('0x47'))){_0x60c046[_0x4254('0x2d')]=qs[_0x4254('0x2d')](_0x2b4b72[_0x4254('0x40')]['limit']);_0x60c046[_0x4254('0x2c')]=qs[_0x4254('0x2c')](_0x2b4b72[_0x4254('0x40')][_0x4254('0x2c')]);}_0x60c046[_0x4254('0x48')]=qs[_0x4254('0x49')](_0x2b4b72[_0x4254('0x40')][_0x4254('0x49')]);_0x60c046[_0x4254('0x4a')]=qs[_0x4254('0x42')](_['pick'](_0x2b4b72['query'],_0x295f11[_0x4254('0x42')]),_0x260c67);if(_0x2b4b72[_0x4254('0x40')][_0x4254('0x4b')]){_0x60c046[_0x4254('0x4a')]=_['merge'](_0x60c046[_0x4254('0x4a')],{'$or':_[_0x4254('0x3f')](_0x260c67,function(_0x308159){if(_0x308159['type']!==_0x4254('0x4c')){var _0x4338b1={};_0x4338b1[_0x308159[_0x4254('0x38')]]={'$like':'%'+_0x2b4b72[_0x4254('0x40')][_0x4254('0x4b')]+'%'};return _0x4338b1;}})});}_0x60c046=_['merge']({},_0x60c046,_0x2b4b72['options']);var _0x10d287={'where':_0x60c046[_0x4254('0x4a')]};return db['OpenchannelMessage'][_0x4254('0x2b')](_0x10d287)[_0x4254('0x1e')](function(_0x4085e2){_0x4b479c[_0x4254('0x2b')]=_0x4085e2;if(_0x2b4b72['query'][_0x4254('0x4d')]){_0x60c046[_0x4254('0x4e')]=[{'all':!![]}];}return db[_0x4254('0x3a')][_0x4254('0x4f')](_0x60c046);})[_0x4254('0x1e')](function(_0x330dc6){_0x4b479c['rows']=_0x330dc6;return _0x4b479c;})[_0x4254('0x1e')](respondWithFilteredResult(_0x5bdc9d,_0x60c046))['catch'](handleError(_0x5bdc9d,null));};exports[_0x4254('0x50')]=function(_0xc2a60c,_0x23dc11){var _0x2a2c37={'raw':!![],'where':{'id':_0xc2a60c['params']['id']}},_0x244b3b={};_0x244b3b['model']=_[_0x4254('0x41')](db[_0x4254('0x3a')][_0x4254('0x3b')]);_0x244b3b[_0x4254('0x40')]=_[_0x4254('0x41')](_0xc2a60c['query']);_0x244b3b[_0x4254('0x42')]=_[_0x4254('0x43')](_0x244b3b[_0x4254('0x3e')],_0x244b3b[_0x4254('0x40')]);_0x2a2c37[_0x4254('0x45')]=_[_0x4254('0x43')](_0x244b3b[_0x4254('0x3e')],qs[_0x4254('0x44')](_0xc2a60c[_0x4254('0x40')][_0x4254('0x44')]));_0x2a2c37[_0x4254('0x45')]=_0x2a2c37[_0x4254('0x45')]['length']?_0x2a2c37[_0x4254('0x45')]:_0x244b3b['model'];if(_0xc2a60c[_0x4254('0x40')]['includeAll']){_0x2a2c37[_0x4254('0x4e')]=[{'all':!![]}];}_0x2a2c37=_[_0x4254('0x51')]({},_0x2a2c37,_0xc2a60c[_0x4254('0x52')]);return db[_0x4254('0x3a')][_0x4254('0x53')](_0x2a2c37)['then'](handleEntityNotFound(_0x23dc11,null))[_0x4254('0x1e')](respondWithResult(_0x23dc11,null))['catch'](handleError(_0x23dc11,null));};exports[_0x4254('0x54')]=function(_0x112c57,_0xf0fbce){return db['OpenchannelMessage'][_0x4254('0x54')](_0x112c57[_0x4254('0x55')],{})[_0x4254('0x1e')](respondWithResult(_0xf0fbce,0xc9))[_0x4254('0x27')](handleError(_0xf0fbce,null));};exports['update']=function(_0x1b4aea,_0x217d42){if(_0x1b4aea[_0x4254('0x55')]['id']){delete _0x1b4aea[_0x4254('0x55')]['id'];}return db[_0x4254('0x3a')][_0x4254('0x53')]({'where':{'id':_0x1b4aea[_0x4254('0x56')]['id']}})[_0x4254('0x1e')](handleEntityNotFound(_0x217d42,null))['then'](saveUpdates(_0x1b4aea[_0x4254('0x55')],null))[_0x4254('0x1e')](respondWithResult(_0x217d42,null))[_0x4254('0x27')](handleError(_0x217d42,null));};exports[_0x4254('0x35')]=function(_0x30cca0,_0x491877){return db[_0x4254('0x3a')][_0x4254('0x53')]({'where':{'id':_0x30cca0[_0x4254('0x56')]['id']}})[_0x4254('0x1e')](handleEntityNotFound(_0x491877,null))[_0x4254('0x1e')](removeEntity(_0x491877,null))['catch'](handleError(_0x491877,null));};exports[_0x4254('0x57')]=function(_0x886893,_0x45bb89){return db[_0x4254('0x3a')][_0x4254('0x57')]()['then'](respondWithResult(_0x45bb89,null))[_0x4254('0x27')](handleError(_0x45bb89,null));};var interaction_log=require('../../config/logger')(_0x4254('0x58'));exports['accept']=function(_0x3fc1fb,_0x1e1c45,_0x203e5c){var _0x362dab={'agent':{},'channel':_0x4254('0x59')};if(_0x3fc1fb[_0x4254('0x55')]['id']){delete _0x3fc1fb[_0x4254('0x55')]['id'];}_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5a')]=!![];_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5b')]=moment()[_0x4254('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fc1fb[_0x4254('0x55')]['UserId']=_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5d')]||_0x3fc1fb[_0x4254('0x5e')]['id'];_0x362dab[_0x4254('0x5f')]['id']=_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5d')];return db['OpenchannelMessage']['find']({'where':{'id':_0x3fc1fb[_0x4254('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e1c45,null))[_0x4254('0x1e')](saveUpdates(_0x3fc1fb[_0x4254('0x55')],null))[_0x4254('0x1e')](function(_0x5ee3f9){if(_0x5ee3f9){_0x362dab['message']=_0x5ee3f9[_0x4254('0x60')]({'plain':!![]});return db[_0x4254('0x61')][_0x4254('0x53')]({'where':{'id':_0x5ee3f9['OpenchannelInteractionId']}});}return null;})[_0x4254('0x1e')](handleEntityNotFound(_0x1e1c45,null))[_0x4254('0x1e')](function(_0x553491){if(_0x553491){return _0x553491[_0x4254('0x34')]({'UserId':_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5d')],'read1stAt':_[_0x4254('0x62')](_0x553491[_0x4254('0x63')])?moment()[_0x4254('0x5c')](_0x4254('0x64')):undefined});}return null;})['then'](function(_0x1e00dd){if(_0x1e00dd){_0x362dab[_0x4254('0x65')]=_0x1e00dd[_0x4254('0x60')]({'plain':!![]});interaction_log[_0x4254('0x1f')](_0x4254('0x66'),_0x3fc1fb['user']['id'],_0x3fc1fb['user'][_0x4254('0x38')],_0x3fc1fb[_0x4254('0x5e')][_0x4254('0x67')],_0x362dab[_0x4254('0x65')]['id'],_0x3fc1fb[_0x4254('0x55')]?JSON[_0x4254('0x23')](_0x3fc1fb[_0x4254('0x55')]):'null');return respondWithRpcPromise(_0x4254('0x68'),_0x4254('0x69'),_0x362dab);}return null;})[_0x4254('0x1e')](function(_0x46752a){var _0x2f4ac8=_0x4254('0x6a')+_0x46752a[_0x4254('0x25')][_0x4254('0x6b')];return db[_0x4254('0x6c')][_0x4254('0x40')](_0x2f4ac8,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x4254('0x1e')](function(_0x5cb32c){return _0x5cb32c;});})[_0x4254('0x1e')](function(_0x50dde4){if(_0x50dde4){_0x362dab[_0x4254('0x25')][_0x4254('0x6d')]=_0x50dde4[0x0];if(!_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5d')])return;return db['User']['find']({'where':{'id':_0x3fc1fb[_0x4254('0x55')][_0x4254('0x5d')],'role':_0x4254('0x5f')},'attributes':['id',_0x4254('0x38'),'fullname',_0x4254('0x6e'),_0x4254('0x6f')],'raw':!![]});}return null;})['then'](function(_0x26c6de){if(!_0x26c6de)return null;_0x362dab['message'][_0x4254('0x5f')]=_0x26c6de;return _0x362dab;})[_0x4254('0x1e')](function(_0x1eb529){if(_0x1eb529){if(_0x3fc1fb[_0x4254('0x55')][_0x4254('0x70')]){_0x362dab[_0x4254('0x25')]['interface']=util[_0x4254('0x5c')]('SIP/%s',_0x3fc1fb[_0x4254('0x5e')][_0x4254('0x38')]);_0x362dab['message']['channel']=_0x362dab['channel'];_0x362dab[_0x4254('0x25')][_0x4254('0x71')]=_0x362dab['channel'];_0x362dab['message'][_0x4254('0x72')]='accept';return respondWithRpcPromise(_0x4254('0x73'),'EventManager',{'event':_0x4254('0x74'),'message':_0x362dab[_0x4254('0x25')]},client9002)[_0x4254('0x1e')](function(){return _0x362dab;});}return _0x362dab;}return null;})[_0x4254('0x1e')](respondWithResult(_0x1e1c45,null))['catch'](handleError(_0x1e1c45,null));};var interaction_log=require(_0x4254('0x75'))(_0x4254('0x58'));exports[_0x4254('0x32')]=function(_0x352c4d,_0x5ebfba,_0x48a478){var _0x26ec73={'agent':{},'channel':_0x4254('0x59')};if(_0x352c4d[_0x4254('0x55')]['id']){delete _0x352c4d[_0x4254('0x55')]['id'];}_0x352c4d['body'][_0x4254('0x5d')]=_0x352c4d['body']['UserId']||_0x352c4d[_0x4254('0x5e')]['id'];_0x26ec73[_0x4254('0x5f')]['id']=_0x352c4d[_0x4254('0x55')]['UserId'];return db['OpenchannelMessage'][_0x4254('0x53')]({'where':{'id':_0x352c4d[_0x4254('0x56')]['id'],'UserId':null}})[_0x4254('0x1e')](handleEntityNotFound(_0x5ebfba,null))[_0x4254('0x1e')](function(_0x28f27b){if(_0x28f27b){_0x26ec73['message']=_0x28f27b[_0x4254('0x60')]({'plain':!![]});return db[_0x4254('0x61')][_0x4254('0x53')]({'where':{'id':_0x28f27b['OpenchannelInteractionId']}});}return null;})[_0x4254('0x1e')](handleEntityNotFound(_0x5ebfba,null))[_0x4254('0x1e')](function(_0x5edca4){if(_0x5edca4){_0x26ec73[_0x4254('0x65')]=_0x5edca4['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x352c4d[_0x4254('0x5e')]['id'],_0x352c4d['user'][_0x4254('0x38')],_0x352c4d['user'][_0x4254('0x67')],_0x26ec73[_0x4254('0x65')]['id'],_0x352c4d[_0x4254('0x55')]?JSON[_0x4254('0x23')](_0x352c4d['body']):_0x4254('0x76'));return respondWithRpcPromise('RejectMessage',_0x4254('0x77'),_0x26ec73);}return null;})[_0x4254('0x1e')](function(_0x1d2b93){var _0x1d2007=_0x4254('0x6a')+_0x1d2b93['message'][_0x4254('0x6b')];return db[_0x4254('0x6c')][_0x4254('0x40')](_0x1d2007,{'type':db[_0x4254('0x78')]['QueryTypes'][_0x4254('0x79')],'raw':!![]})[_0x4254('0x1e')](function(_0x51e244){return _0x51e244;});})[_0x4254('0x1e')](function(_0x1f574b){if(_0x1f574b){_0x26ec73['message'][_0x4254('0x6d')]=_0x1f574b[0x0];if(!_0x352c4d['body'][_0x4254('0x5d')])return;return db[_0x4254('0x7a')][_0x4254('0x53')]({'where':{'id':_0x352c4d['body'][_0x4254('0x5d')],'role':_0x4254('0x5f')},'attributes':['id',_0x4254('0x38'),_0x4254('0x7b'),'email',_0x4254('0x6f')],'raw':!![]});}return null;})[_0x4254('0x1e')](function(_0x2960a1){if(!_0x2960a1)return null;_0x26ec73[_0x4254('0x25')]['agent']=_0x2960a1;return _0x26ec73;})[_0x4254('0x1e')](function(_0x97c4b8){if(_0x97c4b8){_0x97c4b8[_0x4254('0x25')]['interface']=util[_0x4254('0x5c')](_0x4254('0x7c'),_0x352c4d[_0x4254('0x5e')][_0x4254('0x38')]);_0x97c4b8[_0x4254('0x25')][_0x4254('0x7d')]=_0x26ec73[_0x4254('0x7d')];_0x97c4b8[_0x4254('0x25')]['motionChannel']=_0x26ec73['channel'];_0x97c4b8[_0x4254('0x25')]['event']=_0x4254('0x32');respondWithRpcPromise(_0x4254('0x73'),'EventManager',{'event':_0x4254('0x7e'),'message':_0x97c4b8[_0x4254('0x25')]},client9002);return _0x26ec73;}return null;})[_0x4254('0x1e')](respondWithResult(_0x5ebfba,null))[_0x4254('0x27')](handleError(_0x5ebfba,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index aff0cb2..2939a23 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 _0x88ba=['setMaxListeners','save','remove','emit','hook','events','../../mysqldb'];(function(_0x9ae2e2,_0x3ac847){var _0x18c74f=function(_0x52a07b){while(--_0x52a07b){_0x9ae2e2['push'](_0x9ae2e2['shift']());}};_0x18c74f(++_0x3ac847);}(_0x88ba,0xc2));var _0xa88b=function(_0x51e5bd,_0x3c2cf1){_0x51e5bd=_0x51e5bd-0x0;var _0x250aed=_0x88ba[_0x51e5bd];return _0x250aed;};'use strict';var EventEmitter=require(_0xa88b('0x0'));var OpenchannelMessage=require(_0xa88b('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa88b('0x2')](0x0);var events={'afterCreate':_0xa88b('0x3'),'afterUpdate':'update','afterDestroy':_0xa88b('0x4')};function emitEvent(_0x21e8e7){return function(_0x5a1728,_0x298642,_0x2c941){OpenchannelMessageEvents[_0xa88b('0x5')](_0x21e8e7+':'+_0x5a1728['id'],_0x5a1728);OpenchannelMessageEvents[_0xa88b('0x5')](_0x21e8e7,_0x5a1728);_0x2c941(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xa88b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x26c2=['save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x196305,_0x38e850){var _0xec5680=function(_0x2b4c93){while(--_0x2b4c93){_0x196305['push'](_0x196305['shift']());}};_0xec5680(++_0x38e850);}(_0x26c2,0x1bf));var _0x226c=function(_0x40f5fe,_0x2a9786){_0x40f5fe=_0x40f5fe-0x0;var _0x45d801=_0x26c2[_0x40f5fe];return _0x45d801;};'use strict';var EventEmitter=require(_0x226c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x226c('0x1'),'afterUpdate':_0x226c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4d8088){return function(_0x366911,_0x2bd61c,_0x389965){OpenchannelMessageEvents[_0x226c('0x3')](_0x4d8088+':'+_0x366911['id'],_0x366911);OpenchannelMessageEvents[_0x226c('0x3')](_0x4d8088,_0x366911);_0x389965(null);};}for(var e in events){if(events[_0x226c('0x4')](e)){var event=events[e];OpenchannelMessage[_0x226c('0x5')](e,emitEvent(event));}}module[_0x226c('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 9529188..60e7e9b 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 _0x34b7=['moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x34b7,0x196));var _0x734b=function(_0x46eb0e,_0x296d16){_0x46eb0e=_0x46eb0e-0x0;var _0x523297=_0x34b7[_0x46eb0e];return _0x523297;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x734b('0xa'),'fields':[_0x734b('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53f163,_0x5f4b3a,_0x19a88e){var _0x598dee=_0x2f3128[_0x734b('0xc')];var _0x333738=_0x53f163[_0x734b('0xd')]({'plain':!![]});if(_0x333738[_0x734b('0xe')][_0x734b('0xf')]()==='in'||_0x333738[_0x734b('0xe')][_0x734b('0xf')]()===_0x734b('0x10')&&!_0x333738[_0x734b('0x11')]&&!_[_0x734b('0x12')](_0x333738[_0x734b('0x13')])){_0x598dee[_0x734b('0x14')][_0x734b('0x15')]({'where':{'id':_0x333738[_0x734b('0x16')]}})['then'](function(_0x18fc18){if(_0x18fc18){_0x18fc18[_0x734b('0x17')]({'lastMsgAt':_0x333738[_0x734b('0x18')],'lastMsgDirection':_0x333738[_0x734b('0xe')][_0x734b('0xf')]()});}})[_0x734b('0x19')](function(_0x2372bd){console[_0x734b('0x1a')](_0x2372bd);});}if(_0x333738[_0x734b('0xe')]===_0x734b('0x10')&&!_0x333738[_0x734b('0x11')]){var _0x4d2d23;_0x598dee[_0x734b('0x1b')][_0x734b('0x1c')]()[_0x734b('0x1d')](function(_0x5edbe9){return _0x598dee['OpenchannelAccount']['find']({'where':{'id':_0x333738[_0x734b('0x1e')]},'include':[{'model':_0x598dee[_0x734b('0x14')],'as':_0x734b('0x1f'),'where':{'id':_0x333738[_0x734b('0x16')]},'limit':0x1,'include':[{'model':_0x598dee[_0x734b('0x1b')],'as':_0x734b('0x20'),'attributes':_[_0x734b('0x21')](_0x5edbe9)}]}]});})[_0x734b('0x1d')](function(_0x67eed){_0x4d2d23=_0x67eed[_0x734b('0xd')]({'plain':!![]});if(_0x4d2d23&&_0x4d2d23[_0x734b('0x22')]){logger[_0x734b('0x23')](_0x734b('0x24'),_0x734b('0x25'),util['format'](_0x734b('0x26'),_0x333738['id'],_0x4d2d23[_0x734b('0x22')]));if(_0x4d2d23['Interactions']&&_0x4d2d23[_0x734b('0x1f')][_0x734b('0x27')]){_0x333738[_0x734b('0x28')]=_[_0x734b('0x29')](_0x4d2d23[_0x734b('0x1f')][0x0],_0x734b('0x20'));_0x333738[_0x734b('0x20')]=_0x4d2d23[_0x734b('0x1f')][0x0][_0x734b('0x20')];}var _0x5f4b3a={'method':_0x734b('0x2a'),'uri':encodeURI(_0x4d2d23[_0x734b('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5f4b3a[_0x734b('0x2b')]){case'GET':_0x5f4b3a['qs']=_0x333738;break;case'POST':_0x5f4b3a[_0x734b('0xb')]=_0x333738;break;}return rp(_0x5f4b3a)[_0x734b('0x1d')](function(_0x47a0a9){logger[_0x734b('0x23')](_0x734b('0x24'),_0x734b('0x25'),util[_0x734b('0x2c')](_0x734b('0x2d'),_0x333738['id'],_0x4d2d23[_0x734b('0x22')]));if(_0x47a0a9[_0x734b('0xb')]['threadId']&&_0x47a0a9[_0x734b('0xb')][_0x734b('0x2e')]!=_0x333738[_0x734b('0x28')][_0x734b('0x2e')]){return _0x598dee[_0x734b('0x14')][_0x734b('0x17')]({'threadId':_0x47a0a9[_0x734b('0xb')][_0x734b('0x2e')]},{'logging':!![],'where':{'id':_0x333738[_0x734b('0x28')]['id']}});}else{return;}})[_0x734b('0x1d')](function(){return _0x53f163['update']({'read':!![]});})[_0x734b('0x19')](function(_0x37f1a1){logger['error'](_0x734b('0x24'),_0x734b('0x25'),util[_0x734b('0x2f')](_0x37f1a1,{'showHidden':![],'depth':null}));_0x19a88e();});}else{_0x19a88e();}})[_0x734b('0x30')](function(){_0x19a88e();});}else{_0x19a88e();}}},'charset':_0x734b('0x31'),'collate':_0x734b('0x32')});}; \ No newline at end of file +var _0x9348=['catch','error','CmContact','describe','find','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0x71eacc,_0x5578bb){var _0x2ff226=function(_0x5be2c0){while(--_0x5be2c0){_0x71eacc['push'](_0x71eacc['shift']());}};_0x2ff226(++_0x5578bb);}(_0x9348,0x10d));var _0x8934=function(_0x29b724,_0xc476d){_0x29b724=_0x29b724-0x0;var _0xae6b8c=_0x9348[_0x29b724];return _0xae6b8c;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[{'name':_0x8934('0xc'),'fields':[_0x8934('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b470d,_0x5ec16d,_0x5336f0){var _0x2c722b=_0x2bce03['models'];var _0xe1adf4=_0x4b470d[_0x8934('0xe')]({'plain':!![]});if(_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()==='in'||_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()===_0x8934('0x11')&&!_0xe1adf4[_0x8934('0x12')]&&!_['isNil'](_0xe1adf4[_0x8934('0x13')])){_0x2c722b[_0x8934('0x14')][_0x8934('0x15')]({'where':{'id':_0xe1adf4[_0x8934('0x16')]}})[_0x8934('0x17')](function(_0xdf59f4){if(_0xdf59f4){_0xdf59f4['update']({'lastMsgAt':_0xe1adf4[_0x8934('0x18')],'lastMsgDirection':_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()});}})[_0x8934('0x19')](function(_0x34d4dc){console[_0x8934('0x1a')](_0x34d4dc);});}if(_0xe1adf4[_0x8934('0xf')]===_0x8934('0x11')&&!_0xe1adf4['secret']){var _0xb86bc9;_0x2c722b[_0x8934('0x1b')][_0x8934('0x1c')]()['then'](function(_0x47f25e){return _0x2c722b['OpenchannelAccount'][_0x8934('0x1d')]({'where':{'id':_0xe1adf4['OpenchannelAccountId']},'include':[{'model':_0x2c722b[_0x8934('0x14')],'as':_0x8934('0x1e'),'where':{'id':_0xe1adf4[_0x8934('0x16')]},'limit':0x1,'include':[{'model':_0x2c722b[_0x8934('0x1b')],'as':_0x8934('0x1f'),'attributes':_['keys'](_0x47f25e)}]}]});})[_0x8934('0x17')](function(_0x5ae49f){_0xb86bc9=_0x5ae49f[_0x8934('0xe')]({'plain':!![]});if(_0xb86bc9&&_0xb86bc9[_0x8934('0x20')]){logger[_0x8934('0x21')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x25'),_0xe1adf4['id'],_0xb86bc9['replyUri']));if(_0xb86bc9[_0x8934('0x1e')]&&_0xb86bc9[_0x8934('0x1e')][_0x8934('0x26')]){_0xe1adf4[_0x8934('0x27')]=_[_0x8934('0x28')](_0xb86bc9['Interactions'][0x0],_0x8934('0x1f'));_0xe1adf4[_0x8934('0x1f')]=_0xb86bc9[_0x8934('0x1e')][0x0]['Contact'];}var _0x5ec16d={'method':'POST','uri':encodeURI(_0xb86bc9[_0x8934('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5ec16d[_0x8934('0x29')]){case _0x8934('0x2a'):_0x5ec16d['qs']=_0xe1adf4;break;case'POST':_0x5ec16d[_0x8934('0xd')]=_0xe1adf4;break;}return rp(_0x5ec16d)[_0x8934('0x17')](function(_0x310454){logger[_0x8934('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x2b'),_0xe1adf4['id'],_0xb86bc9[_0x8934('0x20')]));if(_0x310454[_0x8934('0xd')][_0x8934('0x2c')]&&_0x310454[_0x8934('0xd')][_0x8934('0x2c')]!=_0xe1adf4[_0x8934('0x27')][_0x8934('0x2c')]){return _0x2c722b['OpenchannelInteraction'][_0x8934('0x2d')]({'threadId':_0x310454[_0x8934('0xd')]['threadId']},{'logging':!![],'where':{'id':_0xe1adf4[_0x8934('0x27')]['id']}});}else{return;}})[_0x8934('0x17')](function(){return _0x4b470d[_0x8934('0x2d')]({'read':!![]});})[_0x8934('0x19')](function(_0x4b3cb9){logger[_0x8934('0x1a')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x2e')](_0x4b3cb9,{'showHidden':![],'depth':null}));_0x5336f0();});}else{_0x5336f0();}})[_0x8934('0x2f')](function(){_0x5336f0();});}else{_0x5336f0();}}},'charset':'utf8mb4','collate':_0x8934('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 1eba0ee..1676d92 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3f46fe,_0x5f359c){var _0x1c8bdd=function(_0x13f4e9){while(--_0x13f4e9){_0x3f46fe['push'](_0x3f46fe['shift']());}};_0x1c8bdd(++_0x5f359c);}(_0xadb5,0xad));var _0x5adb=function(_0x5d4d5c,_0x1dc8e3){_0x5d4d5c=_0x5d4d5c-0x0;var _0x326c33=_0xadb5[_0x5d4d5c];return _0x326c33;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5dafb0,_0x955377){var _0x552df6=function(_0x22ebe0){while(--_0x22ebe0){_0x5dafb0['push'](_0x5dafb0['shift']());}};_0x552df6(++_0x955377);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index cc956e7..0c0715d 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 _0x0d91=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x0d91,0x76));var _0x10d9=function(_0x2ebce5,_0x4d089a){_0x2ebce5=_0x2ebce5-0x0;var _0x2173cf=_0x0d91[_0x2ebce5];return _0x2173cf;};'use strict';var OpenchannelMessageEvents=require(_0x10d9('0x0'));var events=[_0x10d9('0x1'),_0x10d9('0x2'),_0x10d9('0x3')];function createListener(_0x5497db,_0xc2882){return function(_0x38311f){_0xc2882[_0x10d9('0x4')](_0x5497db,_0x38311f);};}function removeListener(_0x56ab5d,_0x2f6e57){return function(){OpenchannelMessageEvents[_0x10d9('0x5')](_0x56ab5d,_0x2f6e57);};}exports[_0x10d9('0x6')]=function(_0x4d89f0){for(var _0x3cc578=0x0,_0x3a49ab=events[_0x10d9('0x7')];_0x3cc578<_0x3a49ab;_0x3cc578++){var _0x26b6cf=events[_0x3cc578];var _0x2558bb=createListener(_0x10d9('0x8')+_0x26b6cf,_0x4d89f0);OpenchannelMessageEvents['on'](_0x26b6cf,_0x2558bb);}}; \ No newline at end of file +var _0x06f4=['register','openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener'];(function(_0x6893a2,_0x3c271f){var _0x3fc882=function(_0x299318){while(--_0x299318){_0x6893a2['push'](_0x6893a2['shift']());}};_0x3fc882(++_0x3c271f);}(_0x06f4,0x136));var _0x406f=function(_0x386910,_0xbc78fc){_0x386910=_0x386910-0x0;var _0x486a55=_0x06f4[_0x386910];return _0x486a55;};'use strict';var OpenchannelMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){OpenchannelMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);OpenchannelMessageEvents['on'](_0x1afec4,_0x1c39ce);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 1c2b10b..23ef05d 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 _0x8625=['/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x8625,0x1eb));var _0x5862=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x8625[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0x5862('0x0'));var util=require(_0x5862('0x1'));var path=require(_0x5862('0x2'));var timeout=require('connect-timeout');var express=require(_0x5862('0x3'));var router=express[_0x5862('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5862('0x5'));var interaction=require(_0x5862('0x6'));var config=require(_0x5862('0x7'));var controller=require(_0x5862('0x8'));router[_0x5862('0x9')]('/',auth[_0x5862('0xa')](),controller['index']);router[_0x5862('0x9')](_0x5862('0xb'),auth[_0x5862('0xa')](),controller[_0x5862('0xc')]);router[_0x5862('0x9')](_0x5862('0xd'),auth[_0x5862('0xa')](),controller['show']);router['get'](_0x5862('0xe'),auth[_0x5862('0xa')](),controller[_0x5862('0xf')]);router[_0x5862('0x9')](_0x5862('0x10'),auth[_0x5862('0xa')](),controller[_0x5862('0x11')]);router[_0x5862('0x9')]('/:id/users',auth[_0x5862('0xa')](),controller[_0x5862('0x12')]);router[_0x5862('0x13')]('/',auth[_0x5862('0xa')](),controller[_0x5862('0x14')]);router['post'](_0x5862('0x10'),auth[_0x5862('0xa')](),controller[_0x5862('0x15')]);router[_0x5862('0x13')](_0x5862('0x16'),auth[_0x5862('0xa')](),controller[_0x5862('0x17')]);router['put'](_0x5862('0xd'),auth[_0x5862('0xa')](),controller[_0x5862('0x18')]);router[_0x5862('0x19')](_0x5862('0xd'),auth[_0x5862('0xa')](),controller[_0x5862('0x1a')]);router['delete'](_0x5862('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x5862('0x16'),auth[_0x5862('0xa')](),controller[_0x5862('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xfe3b=['isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xfe3b,0x150));var _0xbfe3=function(_0x178c03,_0x31c7b2){_0x178c03=_0x178c03-0x0;var _0x13e510=_0xfe3b[_0x178c03];return _0x13e510;};'use strict';var multer=require('multer');var util=require(_0xbfe3('0x0'));var path=require(_0xbfe3('0x1'));var timeout=require(_0xbfe3('0x2'));var express=require('express');var router=express[_0xbfe3('0x3')]();var fs_extra=require(_0xbfe3('0x4'));var auth=require(_0xbfe3('0x5'));var interaction=require(_0xbfe3('0x6'));var config=require(_0xbfe3('0x7'));var controller=require(_0xbfe3('0x8'));router[_0xbfe3('0x9')]('/',auth['isAuthenticated'](),controller[_0xbfe3('0xa')]);router[_0xbfe3('0x9')](_0xbfe3('0xb'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0xd')]);router[_0xbfe3('0x9')](_0xbfe3('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbfe3('0x9')](_0xbfe3('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbfe3('0x9')](_0xbfe3('0x10'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x11')]);router['get'](_0xbfe3('0x12'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x13')]);router[_0xbfe3('0x14')]('/',auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x15')]);router['post'](_0xbfe3('0x10'),auth[_0xbfe3('0xc')](),controller['addTeams']);router['post'](_0xbfe3('0x12'),auth[_0xbfe3('0xc')](),controller['addAgents']);router[_0xbfe3('0x16')](_0xbfe3('0xe'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x17')]);router['delete'](_0xbfe3('0xe'),auth['isAuthenticated'](),controller[_0xbfe3('0x18')]);router[_0xbfe3('0x19')](_0xbfe3('0x10'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x1a')]);router[_0xbfe3('0x19')](_0xbfe3('0x12'),auth[_0xbfe3('0xc')](),controller[_0xbfe3('0x1b')]);module[_0xbfe3('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 75b2223..6a23eb8 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 _0x964e=['sequelize','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x533a4b,_0x3fef3d){var _0x10dcd9=function(_0x27c088){while(--_0x27c088){_0x533a4b['push'](_0x533a4b['shift']());}};_0x10dcd9(++_0x3fef3d);}(_0x964e,0x108));var _0xe964=function(_0x15a72f,_0x412d0b){_0x15a72f=_0x15a72f-0x0;var _0x23142d=_0x964e[_0x15a72f];return _0x23142d;};'use strict';var Sequelize=require(_0xe964('0x0'));module['exports']={'name':{'type':Sequelize[_0xe964('0x1')],'unique':_0xe964('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe964('0x1')]},'timeout':{'type':Sequelize[_0xe964('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe964('0x4')]('rrmemory','beepall',_0xe964('0x5'))}}; \ No newline at end of file +var _0xf14f=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xf14f,0x172));var _0xff14=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf14f[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xff14('0x0'));module['exports']={'name':{'type':Sequelize[_0xff14('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xff14('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff14('0x3')](_0xff14('0x4'),_0xff14('0x5'),_0xff14('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 05bdf64..3d7b25f 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 _0x2222=['push','sequelize','toString','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','stack','name','send','index','OpenchannelQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','Agents','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x2222,0x128));var _0x2222=function(_0x4f06ac,_0x1b73e1){_0x4f06ac=_0x4f06ac-0x0;var _0x12618f=_0x2222[_0x4f06ac];return _0x12618f;};'use strict';var emlformat=require(_0x2222('0x0'));var rimraf=require(_0x2222('0x1'));var zipdir=require(_0x2222('0x2'));var jsonpatch=require(_0x2222('0x3'));var rp=require(_0x2222('0x4'));var moment=require(_0x2222('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2222('0x6'));var util=require('util');var path=require(_0x2222('0x7'));var sox=require(_0x2222('0x8'));var csv=require('to-csv');var ejs=require(_0x2222('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2222('0xa'));var crypto=require(_0x2222('0xb'));var jsforce=require(_0x2222('0xc'));var deskjs=require(_0x2222('0xd'));var toCsv=require(_0x2222('0xe'));var querystring=require('querystring');var Papa=require(_0x2222('0xf'));var Redis=require(_0x2222('0x10'));var authService=require(_0x2222('0x11'));var qs=require(_0x2222('0x12'));var as=require(_0x2222('0x13'));var hardwareService=require(_0x2222('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2222('0x15'));var config=require(_0x2222('0x16'));var licenseUtil=require(_0x2222('0x17'));var db=require(_0x2222('0x18'))['db'];config['redis']=_[_0x2222('0x19')](config[_0x2222('0x1a')],{'host':_0x2222('0x1b'),'port':0x18eb});var socket=require(_0x2222('0x1c'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4176a7,_0x36d220){_0x36d220=_0x36d220||0xcc;return function(_0x24f669){if(_0x24f669){return _0x4176a7[_0x2222('0x1d')](_0x36d220);}return _0x4176a7[_0x2222('0x1e')](_0x36d220)[_0x2222('0x1f')]();};}function respondWithResult(_0x2cf385,_0x1eb430){_0x1eb430=_0x1eb430||0xc8;return function(_0x36d08e){if(_0x36d08e){return _0x2cf385['status'](_0x1eb430)[_0x2222('0x20')](_0x36d08e);}};}function respondWithFilteredResult(_0x139785,_0xecb589){return function(_0x4153ad){if(_0x4153ad){var _0x39b9ea=typeof _0xecb589[_0x2222('0x21')]===_0x2222('0x22')&&typeof _0xecb589[_0x2222('0x23')]===_0x2222('0x22');var _0x1ff6dc=_0x4153ad[_0x2222('0x24')];var _0x50c32b=_0x39b9ea?0x0:_0xecb589[_0x2222('0x21')];var _0xdd7232=_0x39b9ea?_0x4153ad[_0x2222('0x24')]:_0xecb589[_0x2222('0x21')]+_0xecb589['limit'];var _0x1bd230;if(_0xdd7232>=_0x1ff6dc){_0xdd7232=_0x1ff6dc;_0x1bd230=0xc8;}else{_0x1bd230=0xce;}_0x139785[_0x2222('0x1e')](_0x1bd230);return _0x139785[_0x2222('0x25')](_0x2222('0x26'),_0x50c32b+'-'+_0xdd7232+'/'+_0x1ff6dc)[_0x2222('0x20')](_0x4153ad);}return null;};}function patchUpdates(_0x148978){return function(_0x469004){try{jsonpatch[_0x2222('0x27')](_0x469004,_0x148978,!![]);}catch(_0x9fe3dd){return BPromise['reject'](_0x9fe3dd);}return _0x469004[_0x2222('0x28')]();};}function saveUpdates(_0xa9749,_0x962828){return function(_0x16ecab){if(_0x16ecab){return _0x16ecab[_0x2222('0x29')](_0xa9749)['then'](function(_0xb4aafa){return _0xb4aafa;});}return null;};}function removeEntity(_0x2a4b6c,_0x49d4f0){return function(_0x5c9c5e){if(_0x5c9c5e){return _0x5c9c5e[_0x2222('0x2a')]()[_0x2222('0x2b')](function(){var _0x522a72=_0x5c9c5e[_0x2222('0x2c')]({'plain':!![]});var _0xdecce4=_0x2222('0x2d');return db[_0x2222('0x2e')][_0x2222('0x2a')]({'where':{'type':_0xdecce4,'resourceId':_0x522a72['id']}})[_0x2222('0x2b')](function(){return _0x5c9c5e;});})[_0x2222('0x2b')](function(){_0x2a4b6c['status'](0xcc)[_0x2222('0x1f')]();});}};}function handleEntityNotFound(_0x1f80b3,_0x5567b4){return function(_0x440bbc){if(!_0x440bbc){_0x1f80b3[_0x2222('0x1d')](0x194);}return _0x440bbc;};}function handleError(_0x580dee,_0x503866){_0x503866=_0x503866||0x1f4;return function(_0x217ae4){logger['error'](_0x217ae4[_0x2222('0x2f')]);if(_0x217ae4[_0x2222('0x30')]){delete _0x217ae4[_0x2222('0x30')];}_0x580dee[_0x2222('0x1e')](_0x503866)[_0x2222('0x31')](_0x217ae4);};}exports[_0x2222('0x32')]=function(_0x358be5,_0x1185c2){var _0xd356ed={},_0x146d63={},_0x2c7919={'count':0x0,'rows':[]};var _0x1a3d93=_['map'](db[_0x2222('0x33')][_0x2222('0x34')],function(_0x2678fa){return{'name':_0x2678fa['fieldName'],'type':_0x2678fa[_0x2222('0x35')][_0x2222('0x36')]};});_0x146d63[_0x2222('0x37')]=_[_0x2222('0x38')](_0x1a3d93,'name');_0x146d63[_0x2222('0x39')]=_[_0x2222('0x3a')](_0x358be5[_0x2222('0x39')]);_0x146d63[_0x2222('0x3b')]=_[_0x2222('0x3c')](_0x146d63['model'],_0x146d63[_0x2222('0x39')]);_0xd356ed[_0x2222('0x3d')]=_[_0x2222('0x3c')](_0x146d63[_0x2222('0x37')],qs[_0x2222('0x3e')](_0x358be5['query'][_0x2222('0x3e')]));_0xd356ed[_0x2222('0x3d')]=_0xd356ed['attributes'][_0x2222('0x3f')]?_0xd356ed[_0x2222('0x3d')]:_0x146d63[_0x2222('0x37')];if(!_0x358be5[_0x2222('0x39')][_0x2222('0x40')](_0x2222('0x41'))){_0xd356ed['limit']=qs[_0x2222('0x23')](_0x358be5[_0x2222('0x39')][_0x2222('0x23')]);_0xd356ed[_0x2222('0x21')]=qs[_0x2222('0x21')](_0x358be5[_0x2222('0x39')][_0x2222('0x21')]);}_0xd356ed[_0x2222('0x42')]=qs[_0x2222('0x43')](_0x358be5[_0x2222('0x39')][_0x2222('0x43')]);_0xd356ed[_0x2222('0x44')]=qs[_0x2222('0x3b')](_[_0x2222('0x45')](_0x358be5[_0x2222('0x39')],_0x146d63[_0x2222('0x3b')]),_0x1a3d93);if(_0x358be5[_0x2222('0x39')][_0x2222('0x46')]){_0xd356ed[_0x2222('0x44')]=_[_0x2222('0x47')](_0xd356ed[_0x2222('0x44')],{'$or':_[_0x2222('0x38')](_0x1a3d93,function(_0x4e848a){if(_0x4e848a['type']!==_0x2222('0x48')){var _0x487c5b={};_0x487c5b[_0x4e848a[_0x2222('0x30')]]={'$like':'%'+_0x358be5[_0x2222('0x39')][_0x2222('0x46')]+'%'};return _0x487c5b;}})});}_0xd356ed=_[_0x2222('0x47')]({},_0xd356ed,_0x358be5[_0x2222('0x49')]);var _0x231e51={'where':_0xd356ed[_0x2222('0x44')]};return db[_0x2222('0x33')][_0x2222('0x24')](_0x231e51)['then'](function(_0x2b8906){_0x2c7919[_0x2222('0x24')]=_0x2b8906;if(_0x358be5[_0x2222('0x39')]['includeAll']){_0xd356ed[_0x2222('0x4a')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0xd356ed);})[_0x2222('0x2b')](function(_0x5a538b){_0x2c7919[_0x2222('0x4b')]=_0x5a538b;return _0x2c7919;})[_0x2222('0x2b')](respondWithFilteredResult(_0x1185c2,_0xd356ed))[_0x2222('0x4c')](handleError(_0x1185c2,null));};exports[_0x2222('0x4d')]=function(_0x1c95a4,_0x2469ad){var _0x4387ad={'raw':!![],'where':{'id':_0x1c95a4[_0x2222('0x4e')]['id']}},_0x100bfd={};_0x100bfd['model']=_[_0x2222('0x3a')](db['OpenchannelQueue'][_0x2222('0x34')]);_0x100bfd[_0x2222('0x39')]=_[_0x2222('0x3a')](_0x1c95a4[_0x2222('0x39')]);_0x100bfd[_0x2222('0x3b')]=_['intersection'](_0x100bfd[_0x2222('0x37')],_0x100bfd[_0x2222('0x39')]);_0x4387ad[_0x2222('0x3d')]=_['intersection'](_0x100bfd[_0x2222('0x37')],qs[_0x2222('0x3e')](_0x1c95a4[_0x2222('0x39')][_0x2222('0x3e')]));_0x4387ad['attributes']=_0x4387ad[_0x2222('0x3d')][_0x2222('0x3f')]?_0x4387ad[_0x2222('0x3d')]:_0x100bfd['model'];if(_0x1c95a4['query'][_0x2222('0x4f')]){_0x4387ad['include']=[{'all':!![]}];}_0x4387ad=_[_0x2222('0x47')]({},_0x4387ad,_0x1c95a4[_0x2222('0x49')]);return db['OpenchannelQueue'][_0x2222('0x50')](_0x4387ad)[_0x2222('0x2b')](handleEntityNotFound(_0x2469ad,null))[_0x2222('0x2b')](respondWithResult(_0x2469ad,null))[_0x2222('0x4c')](handleError(_0x2469ad,null));};exports['create']=function(_0x446b7c,_0x5e69aa){return db['OpenchannelQueue'][_0x2222('0x51')](_0x446b7c['body'],{})['then'](function(_0x53a61b){var _0x244c08=_0x446b7c['user']['get']({'plain':!![]});if(!_0x244c08)throw new Error(_0x2222('0x52'));if(_0x244c08[_0x2222('0x53')]==='user'){var _0x10043a=_0x53a61b[_0x2222('0x2c')]({'plain':!![]});var _0x1cb3bb='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x1cb3bb,'userProfileId':_0x244c08['userProfileId']},'raw':!![]})[_0x2222('0x2b')](function(_0x4144a6){if(_0x4144a6&&_0x4144a6[_0x2222('0x54')]===0x0){return db[_0x2222('0x2e')][_0x2222('0x51')]({'name':_0x10043a[_0x2222('0x30')],'resourceId':_0x10043a['id'],'type':_0x4144a6[_0x2222('0x30')],'sectionId':_0x4144a6['id']},{})[_0x2222('0x2b')](function(){return _0x53a61b;});}else{return _0x53a61b;}})[_0x2222('0x4c')](function(_0xc5afcb){logger[_0x2222('0x55')](_0x2222('0x56'),_0xc5afcb);throw _0xc5afcb;});}return _0x53a61b;})['then'](respondWithResult(_0x5e69aa,0xc9))[_0x2222('0x4c')](handleError(_0x5e69aa,null));};exports['update']=function(_0x1f6ab3,_0x320736){if(_0x1f6ab3['body']['id']){delete _0x1f6ab3['body']['id'];}return db[_0x2222('0x33')][_0x2222('0x50')]({'where':{'id':_0x1f6ab3[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x320736,null))[_0x2222('0x2b')](saveUpdates(_0x1f6ab3[_0x2222('0x57')],null))[_0x2222('0x2b')](respondWithResult(_0x320736,null))[_0x2222('0x4c')](handleError(_0x320736,null));};exports[_0x2222('0x2a')]=function(_0xe92369,_0x5ca977){return db[_0x2222('0x33')][_0x2222('0x50')]({'where':{'id':_0xe92369['params']['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x5ca977,null))['then'](removeEntity(_0x5ca977,null))['catch'](handleError(_0x5ca977,null));};exports[_0x2222('0x58')]=function(_0x21ac72,_0x4c627e){return db[_0x2222('0x33')]['describe']()[_0x2222('0x2b')](respondWithResult(_0x4c627e,null))[_0x2222('0x4c')](handleError(_0x4c627e,null));};exports[_0x2222('0x59')]=function(_0x2173b5,_0x14b89f,_0x5b9700){var _0x4c0b8e={'raw':!![],'where':{}},_0x3c9ebd={},_0x349151;return db[_0x2222('0x33')][_0x2222('0x5a')]({'where':{'id':_0x2173b5[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x14b89f,null))[_0x2222('0x2b')](function(_0x55cc5b){if(_0x55cc5b){_0x349151=_0x55cc5b['get']({'plain':!![]});_0x3c9ebd[_0x2222('0x37')]=_[_0x2222('0x3a')](db[_0x2222('0x5b')][_0x2222('0x34')]);_0x3c9ebd[_0x2222('0x39')]=_[_0x2222('0x3a')](_0x2173b5[_0x2222('0x39')]);_0x3c9ebd[_0x2222('0x3b')]=_[_0x2222('0x3c')](_0x3c9ebd[_0x2222('0x37')],_0x3c9ebd['query']);_0x4c0b8e[_0x2222('0x3d')]=_[_0x2222('0x3c')](_0x3c9ebd[_0x2222('0x37')],qs['fields'](_0x2173b5[_0x2222('0x39')][_0x2222('0x3e')]));_0x4c0b8e['attributes']=_0x4c0b8e[_0x2222('0x3d')][_0x2222('0x3f')]?_0x4c0b8e[_0x2222('0x3d')]:_0x3c9ebd['model'];if(!_0x2173b5[_0x2222('0x39')][_0x2222('0x40')](_0x2222('0x41'))){_0x4c0b8e[_0x2222('0x23')]=qs[_0x2222('0x23')](_0x2173b5[_0x2222('0x39')][_0x2222('0x23')]);_0x4c0b8e[_0x2222('0x21')]=qs['offset'](_0x2173b5[_0x2222('0x39')][_0x2222('0x21')]);}_0x4c0b8e['order']=qs[_0x2222('0x43')](_0x2173b5[_0x2222('0x39')]['sort']);_0x4c0b8e[_0x2222('0x44')]=qs['filters'](_['pick'](_0x2173b5[_0x2222('0x39')],_0x3c9ebd[_0x2222('0x3b')]));_0x4c0b8e['where']['OpenchannelQueueId']=_0x55cc5b['id'];if(_0x2173b5[_0x2222('0x39')][_0x2222('0x46')]){_0x4c0b8e[_0x2222('0x44')]=_[_0x2222('0x47')](_0x4c0b8e[_0x2222('0x44')],{'$or':_['map'](_0x4c0b8e[_0x2222('0x3d')],function(_0x37612b){var _0x3dfc24={};_0x3dfc24[_0x37612b]={'$like':'%'+_0x2173b5[_0x2222('0x39')][_0x2222('0x46')]+'%'};return _0x3dfc24;})});}_0x4c0b8e=_[_0x2222('0x47')]({},_0x4c0b8e,_0x2173b5[_0x2222('0x49')]);return db['UserOpenchannelQueue'][_0x2222('0x5c')](_0x4c0b8e);}})[_0x2222('0x2b')](function(_0x3ed34d){if(_0x3ed34d){return db[_0x2222('0x5d')][_0x2222('0x5e')]({'where':{'id':_[_0x2222('0x38')](_0x3ed34d,_0x2222('0x5f')),'role':_0x2222('0x60')},'attributes':['id','name',_0x2222('0x61'),_0x2222('0x62'),_0x2222('0x63')]});}})[_0x2222('0x2b')](function(_0x227cf2){if(_0x227cf2){return{'count':_0x227cf2[_0x2222('0x24')],'rows':_[_0x2222('0x38')](_0x227cf2[_0x2222('0x4b')],function(_0x559140){return{'membername':_0x559140[_0x2222('0x30')],'UserId':_0x559140['id'],'queue_name':_0x349151[_0x2222('0x30')],'OpenchannelQueueId':_0x349151['id'],'interface':util[_0x2222('0x64')](_0x2222('0x65'),_0x2222('0x66'),_0x559140[_0x2222('0x30')]),'penalty':0x0,'paused':_0x559140[_0x2222('0x61')],'createdAt':_0x559140[_0x2222('0x63')],'updatedAt':_0x559140[_0x2222('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x14b89f,_0x4c0b8e))[_0x2222('0x4c')](handleError(_0x14b89f,null));};exports[_0x2222('0x67')]=function(_0x20ef20,_0x147606,_0x530414){var _0xe899bd={};var _0x3979c3={};var _0x43867c;var _0x3becae;return db[_0x2222('0x33')]['findOne']({'where':{'id':_0x20ef20['params']['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x147606,null))[_0x2222('0x2b')](function(_0x3c1873){if(_0x3c1873){_0x43867c=_0x3c1873;_0x3979c3['model']=_[_0x2222('0x3a')](db[_0x2222('0x68')][_0x2222('0x34')]);_0x3979c3[_0x2222('0x39')]=_[_0x2222('0x3a')](_0x20ef20[_0x2222('0x39')]);_0x3979c3[_0x2222('0x3b')]=_[_0x2222('0x3c')](_0x3979c3[_0x2222('0x37')],_0x3979c3[_0x2222('0x39')]);_0xe899bd['attributes']=_[_0x2222('0x3c')](_0x3979c3[_0x2222('0x37')],qs['fields'](_0x20ef20[_0x2222('0x39')][_0x2222('0x3e')]));_0xe899bd['attributes']=_0xe899bd['attributes'][_0x2222('0x3f')]?_0xe899bd[_0x2222('0x3d')]:_0x3979c3[_0x2222('0x37')];_0xe899bd['order']=qs[_0x2222('0x43')](_0x20ef20['query']['sort']);_0xe899bd[_0x2222('0x44')]=qs[_0x2222('0x3b')](_['pick'](_0x20ef20[_0x2222('0x39')],_0x3979c3['filters']));if(_0x20ef20['query'][_0x2222('0x46')]){_0xe899bd[_0x2222('0x44')]=_['merge'](_0xe899bd[_0x2222('0x44')],{'$or':_[_0x2222('0x38')](_0xe899bd[_0x2222('0x3d')],function(_0x5d1cd8){var _0x65db82={};_0x65db82[_0x5d1cd8]={'$like':'%'+_0x20ef20[_0x2222('0x39')]['filter']+'%'};return _0x65db82;})});}_0xe899bd=_['merge']({},_0xe899bd,_0x20ef20[_0x2222('0x49')]);return _0x43867c['getTeams'](_0xe899bd);}})[_0x2222('0x2b')](function(_0x462c33){if(_0x462c33){_0x3becae=_0x462c33['length'];if(!_0x20ef20[_0x2222('0x39')][_0x2222('0x40')](_0x2222('0x41'))){_0xe899bd['limit']=qs[_0x2222('0x23')](_0x20ef20[_0x2222('0x39')][_0x2222('0x23')]);_0xe899bd[_0x2222('0x21')]=qs[_0x2222('0x21')](_0x20ef20[_0x2222('0x39')][_0x2222('0x21')]);}return _0x43867c[_0x2222('0x67')](_0xe899bd);}})[_0x2222('0x2b')](function(_0x5a5482){if(_0x5a5482){return _0x5a5482?{'count':_0x3becae,'rows':_0x5a5482}:null;}})[_0x2222('0x2b')](respondWithResult(_0x147606,null))['catch'](handleError(_0x147606,null));};exports[_0x2222('0x69')]=function(_0x1dd43a,_0x34c50d,_0x3d9cf2){var _0x2caa0c=_0x1dd43a[_0x2222('0x57')]['ids'];return db[_0x2222('0x68')][_0x2222('0x5c')]({'where':{'id':_0x2caa0c},'attributes':['id'],'include':[{'model':db[_0x2222('0x5d')],'as':'Agents','attributes':['id',_0x2222('0x30'),_0x2222('0x6a'),_0x2222('0x6b'),_0x2222('0x6c')],'raw':!![]}]})[_0x2222('0x2b')](function(_0x4ae7e8){if(_0x4ae7e8){var _0x48600b=_['flatMap'](_0x4ae7e8,function(_0x1da4fc){var _0x17af63=_0x1da4fc['get']({'plain':!![]});return _0x17af63[_0x2222('0x6d')];});return db[_0x2222('0x33')][_0x2222('0x50')]({'where':{'id':_0x1dd43a[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](function(_0x4603b3){return db['sequelize'][_0x2222('0x6e')](function(_0x3e1fdd){return _0x4603b3[_0x2222('0x69')](_0x2caa0c,{'transaction':_0x3e1fdd})['then'](function(){return BPromise[_0x2222('0x6f')](_0x48600b,function(_0x40167){return db[_0x2222('0x5b')]['findOrCreate']({'where':{'UserId':_0x40167['id'],'OpenchannelQueueId':_0x1dd43a[_0x2222('0x4e')]['id']},'transaction':_0x3e1fdd});});})[_0x2222('0x2b')](function(){_0x48600b[_0x2222('0x70')](function(_0xe1b268){socket[_0x2222('0x71')](_0x2222('0x72'),{'UserId':_0xe1b268['id'],'OpenchannelQueueId':_0x4603b3['id']});});});});});}})[_0x2222('0x2b')](respondWithStatusCode(_0x34c50d,null))[_0x2222('0x4c')](handleError(_0x34c50d,null));};exports[_0x2222('0x73')]=function(_0x323d9a,_0x5cb66b,_0x334be7){return db[_0x2222('0x68')][_0x2222('0x5c')]({'where':{'id':_0x323d9a['query'][_0x2222('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2222('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5cb66b,null))[_0x2222('0x2b')](function(_0x8d55a1){var _0x3e6744=_[_0x2222('0x38')](_0x8d55a1,'id');var _0x59bca1=[];var _0x2b5116=[];var _0x36cee4=squel[_0x2222('0x75')]();_0x36cee4[_0x2222('0x76')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0x2222('0x77')](_0x2222('0x78'),'ut',_0x2222('0x79'))[_0x2222('0x44')](_0x2222('0x7a'),_0x323d9a[_0x2222('0x4e')]['id']);for(var _0x870252=0x0;_0x870252<_0x8d55a1[_0x2222('0x3f')];_0x870252+=0x1){let _0x152cb2=_0x8d55a1[_0x870252];for(var _0x70ac04=0x0;_0x70ac04<_0x152cb2[_0x2222('0x6d')]['length'];_0x70ac04+=0x1){let _0x3a3f19=_0x152cb2[_0x2222('0x6d')][_0x70ac04];var _0x4efcbd=_0x36cee4[_0x2222('0x7b')]();_0x4efcbd[_0x2222('0x44')]('ut.UserId\x20=\x20?',_0x3a3f19['id']);_0x2b5116[_0x2222('0x7c')](db[_0x2222('0x7d')][_0x2222('0x39')](_0x4efcbd[_0x2222('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0x2222('0x7f')]})['then'](function(_0x389cde){if(_0x389cde[_0x2222('0x3f')]===0x1){return _0x3a3f19['id'];}else{var _0x13e8c6=_[_0x2222('0x80')](_[_0x2222('0x38')](_0x389cde,_0x2222('0x81')),function(_0x45e091){return _[_0x2222('0x82')](_0x3e6744,_0x45e091);});if(_0x13e8c6){return _0x3a3f19['id'];}}}));}}return BPromise[_0x2222('0x83')](_0x2b5116)[_0x2222('0x2b')](function(_0x1ff394){_0x59bca1=_(_0x59bca1)['union'](_0x1ff394)['compact']()['value']();return db[_0x2222('0x33')][_0x2222('0x50')]({'where':{'id':_0x323d9a[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](function(_0x201e7a){return db[_0x2222('0x7d')][_0x2222('0x6e')](function(_0x2141cb){return _0x201e7a[_0x2222('0x73')](_0x323d9a[_0x2222('0x39')][_0x2222('0x74')],{'transaction':_0x2141cb})[_0x2222('0x2b')](function(){if(!_[_0x2222('0x84')](_0x59bca1)){return _0x201e7a[_0x2222('0x85')](_0x59bca1,{'transaction':_0x2141cb});}})[_0x2222('0x2b')](function(){_0x59bca1['forEach'](function(_0x4ad7e6){socket[_0x2222('0x71')](_0x2222('0x86'),{'UserId':_0x4ad7e6,'OpenchannelQueueId':_0x201e7a['id']});});});});});});})[_0x2222('0x2b')](respondWithStatusCode(_0x5cb66b,null))[_0x2222('0x4c')](handleError(_0x5cb66b,null));};exports['addAgents']=function(_0x569fda,_0x64073f,_0x2f14cd){return db[_0x2222('0x33')][_0x2222('0x50')]({'where':{'id':_0x569fda[_0x2222('0x4e')]['id']}})['then'](handleEntityNotFound(_0x64073f,null))[_0x2222('0x2b')](function(_0x243ed8){if(_0x243ed8){return _0x243ed8[_0x2222('0x87')](_0x569fda[_0x2222('0x57')][_0x2222('0x74')],_[_0x2222('0x88')](_0x569fda[_0x2222('0x57')],['ids','id'])||{})[_0x2222('0x89')](function(_0x5af970){for(var _0x4f4995=0x0;_0x4f4995<_0x569fda[_0x2222('0x57')]['ids']['length'];_0x4f4995+=0x1){socket[_0x2222('0x71')](_0x2222('0x72'),{'UserId':Number(_0x569fda['body'][_0x2222('0x74')][_0x4f4995]),'OpenchannelQueueId':Number(_0x569fda[_0x2222('0x4e')]['id'])});}return _0x5af970;});}})[_0x2222('0x2b')](respondWithResult(_0x64073f,null))['catch'](handleError(_0x64073f,null));};exports['removeAgents']=function(_0x2c6079,_0x4f4f62,_0x56b9b0){return db[_0x2222('0x33')]['find']({'where':{'id':_0x2c6079[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x4f4f62,null))[_0x2222('0x2b')](function(_0x57114b){if(_0x57114b){return _0x57114b[_0x2222('0x85')](_0x2c6079[_0x2222('0x39')][_0x2222('0x74')])[_0x2222('0x2b')](function(){if(_[_0x2222('0x8a')](_0x2c6079[_0x2222('0x39')]['ids'])){for(var _0x17d24d=0x0;_0x17d24d<_0x2c6079[_0x2222('0x39')]['ids'][_0x2222('0x3f')];_0x17d24d+=0x1){socket[_0x2222('0x71')](_0x2222('0x86'),{'UserId':Number(_0x2c6079[_0x2222('0x39')][_0x2222('0x74')][_0x17d24d]),'OpenchannelQueueId':Number(_0x2c6079['params']['id'])});}}else{socket[_0x2222('0x71')](_0x2222('0x86'),{'UserId':Number(_0x2c6079[_0x2222('0x39')][_0x2222('0x74')]),'OpenchannelQueueId':Number(_0x2c6079[_0x2222('0x4e')]['id'])});}});}})[_0x2222('0x2b')](respondWithStatusCode(_0x4f4f62,null))[_0x2222('0x4c')](handleError(_0x4f4f62,null));};exports[_0x2222('0x8b')]=function(_0x1b008b,_0x10fe29,_0x3ad984){var _0x343957={};var _0x22bef5={};var _0x26f8b5;var _0x2b9175;return db[_0x2222('0x33')][_0x2222('0x5a')]({'where':{'id':_0x1b008b[_0x2222('0x4e')]['id']}})[_0x2222('0x2b')](handleEntityNotFound(_0x10fe29,null))[_0x2222('0x2b')](function(_0x177996){if(_0x177996){_0x26f8b5=_0x177996;_0x22bef5[_0x2222('0x37')]=_[_0x2222('0x3a')](db['User']['rawAttributes']);_0x22bef5[_0x2222('0x39')]=_[_0x2222('0x3a')](_0x1b008b[_0x2222('0x39')]);_0x22bef5['filters']=_['intersection'](_0x22bef5[_0x2222('0x37')],_0x22bef5[_0x2222('0x39')]);_0x343957[_0x2222('0x3d')]=_['intersection'](_0x22bef5[_0x2222('0x37')],qs[_0x2222('0x3e')](_0x1b008b['query'][_0x2222('0x3e')]));_0x343957[_0x2222('0x3d')]=_0x343957[_0x2222('0x3d')][_0x2222('0x3f')]?_0x343957['attributes']:_0x22bef5[_0x2222('0x37')];_0x343957[_0x2222('0x42')]=qs[_0x2222('0x43')](_0x1b008b[_0x2222('0x39')][_0x2222('0x43')]);_0x343957[_0x2222('0x44')]=qs[_0x2222('0x3b')](_[_0x2222('0x45')](_0x1b008b['query'],_0x22bef5[_0x2222('0x3b')]));if(_0x1b008b[_0x2222('0x39')]['filter']){_0x343957[_0x2222('0x44')]=_['merge'](_0x343957['where'],{'$or':_[_0x2222('0x38')](_0x343957[_0x2222('0x3d')],function(_0x3377ef){var _0x1dacd0={};_0x1dacd0[_0x3377ef]={'$like':'%'+_0x1b008b[_0x2222('0x39')][_0x2222('0x46')]+'%'};return _0x1dacd0;})});}_0x343957=_['merge']({},_0x343957,_0x1b008b[_0x2222('0x49')]);return _0x26f8b5[_0x2222('0x8b')](_0x343957);}})[_0x2222('0x2b')](function(_0x459539){if(_0x459539){_0x2b9175=_0x459539[_0x2222('0x3f')];if(!_0x1b008b[_0x2222('0x39')][_0x2222('0x40')](_0x2222('0x41'))){_0x343957[_0x2222('0x23')]=qs['limit'](_0x1b008b[_0x2222('0x39')][_0x2222('0x23')]);_0x343957['offset']=qs[_0x2222('0x21')](_0x1b008b[_0x2222('0x39')][_0x2222('0x21')]);}return _0x26f8b5[_0x2222('0x8b')](_0x343957);}})['then'](function(_0x491c47){if(_0x491c47){return _0x491c47?{'count':_0x2b9175,'rows':_0x491c47}:null;}})[_0x2222('0x2b')](respondWithResult(_0x10fe29,null))[_0x2222('0x4c')](handleError(_0x10fe29,null));}; \ No newline at end of file +var _0x96a3=['forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','get','OpenchannelQueues','UserProfileResource','then','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','pick','OpenchannelQueueId','User','agent','updatedAt','%s/%s','SIP','openchannelPause','createdAt','getTeams','Team','ids','Agents','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate'];(function(_0x10e34f,_0x5cb6a6){var _0x2cecbb=function(_0x48e367){while(--_0x48e367){_0x10e34f['push'](_0x10e34f['shift']());}};_0x2cecbb(++_0x5cb6a6);}(_0x96a3,0x1ba));var _0x396a=function(_0x38f134,_0x29f2e2){_0x38f134=_0x38f134-0x0;var _0x2d877d=_0x96a3[_0x38f134];return _0x2d877d;};'use strict';var emlformat=require(_0x396a('0x0'));var rimraf=require(_0x396a('0x1'));var zipdir=require(_0x396a('0x2'));var jsonpatch=require(_0x396a('0x3'));var rp=require('request-promise');var moment=require(_0x396a('0x4'));var BPromise=require(_0x396a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x396a('0x6'));var sox=require(_0x396a('0x7'));var csv=require('to-csv');var ejs=require(_0x396a('0x8'));var fs=require('fs');var fs_extra=require(_0x396a('0x9'));var _=require(_0x396a('0xa'));var squel=require(_0x396a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x396a('0xc'));var toCsv=require(_0x396a('0xd'));var querystring=require('querystring');var Papa=require(_0x396a('0xe'));var Redis=require(_0x396a('0xf'));var authService=require(_0x396a('0x10'));var qs=require(_0x396a('0x11'));var as=require(_0x396a('0x12'));var hardwareService=require(_0x396a('0x13'));var logger=require(_0x396a('0x14'))('api');var utils=require(_0x396a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x396a('0x16'));var db=require(_0x396a('0x17'))['db'];config[_0x396a('0x18')]=_['defaults'](config[_0x396a('0x18')],{'host':_0x396a('0x19'),'port':0x18eb});var socket=require(_0x396a('0x1a'))(new Redis(config[_0x396a('0x18')]));require(_0x396a('0x1b'))[_0x396a('0x1c')](socket);function respondWithStatusCode(_0x41a54c,_0x19ec10){_0x19ec10=_0x19ec10||0xcc;return function(_0x4bd5bf){if(_0x4bd5bf){return _0x41a54c[_0x396a('0x1d')](_0x19ec10);}return _0x41a54c['status'](_0x19ec10)[_0x396a('0x1e')]();};}function respondWithResult(_0x1675f4,_0x5064a6){_0x5064a6=_0x5064a6||0xc8;return function(_0x3a661d){if(_0x3a661d){return _0x1675f4[_0x396a('0x1f')](_0x5064a6)[_0x396a('0x20')](_0x3a661d);}};}function respondWithFilteredResult(_0xb05511,_0x165734){return function(_0x3ce421){if(_0x3ce421){var _0x3d4adb=typeof _0x165734[_0x396a('0x21')]===_0x396a('0x22')&&typeof _0x165734[_0x396a('0x23')]===_0x396a('0x22');var _0x16350b=_0x3ce421[_0x396a('0x24')];var _0x3cde8f=_0x3d4adb?0x0:_0x165734[_0x396a('0x21')];var _0x1ab13b=_0x3d4adb?_0x3ce421[_0x396a('0x24')]:_0x165734['offset']+_0x165734[_0x396a('0x23')];var _0x3e3d66;if(_0x1ab13b>=_0x16350b){_0x1ab13b=_0x16350b;_0x3e3d66=0xc8;}else{_0x3e3d66=0xce;}_0xb05511[_0x396a('0x1f')](_0x3e3d66);return _0xb05511[_0x396a('0x25')]('Content-Range',_0x3cde8f+'-'+_0x1ab13b+'/'+_0x16350b)['json'](_0x3ce421);}return null;};}function patchUpdates(_0xee9776){return function(_0x209502){try{jsonpatch[_0x396a('0x26')](_0x209502,_0xee9776,!![]);}catch(_0x33f28c){return BPromise['reject'](_0x33f28c);}return _0x209502[_0x396a('0x27')]();};}function saveUpdates(_0x486007,_0x444aab){return function(_0x3572af){if(_0x3572af){return _0x3572af[_0x396a('0x28')](_0x486007)['then'](function(_0x43fd33){return _0x43fd33;});}return null;};}function removeEntity(_0x332326,_0x32ba4d){return function(_0x368d0b){if(_0x368d0b){return _0x368d0b[_0x396a('0x29')]()['then'](function(){var _0x1f940d=_0x368d0b[_0x396a('0x2a')]({'plain':!![]});var _0x276a29=_0x396a('0x2b');return db[_0x396a('0x2c')][_0x396a('0x29')]({'where':{'type':_0x276a29,'resourceId':_0x1f940d['id']}})[_0x396a('0x2d')](function(){return _0x368d0b;});})[_0x396a('0x2d')](function(){_0x332326[_0x396a('0x1f')](0xcc)[_0x396a('0x1e')]();});}};}function handleEntityNotFound(_0x29ea88,_0xe148b6){return function(_0x52a105){if(!_0x52a105){_0x29ea88['sendStatus'](0x194);}return _0x52a105;};}function handleError(_0x27fa91,_0x34bc3e){_0x34bc3e=_0x34bc3e||0x1f4;return function(_0x1f63d2){logger['error'](_0x1f63d2['stack']);if(_0x1f63d2[_0x396a('0x2e')]){delete _0x1f63d2['name'];}_0x27fa91[_0x396a('0x1f')](_0x34bc3e)[_0x396a('0x2f')](_0x1f63d2);};}exports[_0x396a('0x30')]=function(_0x1ea1ce,_0x52c2e5){var _0xb2313b={},_0x416637={},_0x25eac9={'count':0x0,'rows':[]};var _0x59414d=_['map'](db[_0x396a('0x31')][_0x396a('0x32')],function(_0x155347){return{'name':_0x155347[_0x396a('0x33')],'type':_0x155347[_0x396a('0x34')]['key']};});_0x416637['model']=_[_0x396a('0x35')](_0x59414d,_0x396a('0x2e'));_0x416637[_0x396a('0x36')]=_[_0x396a('0x37')](_0x1ea1ce[_0x396a('0x36')]);_0x416637[_0x396a('0x38')]=_[_0x396a('0x39')](_0x416637[_0x396a('0x3a')],_0x416637['query']);_0xb2313b[_0x396a('0x3b')]=_[_0x396a('0x39')](_0x416637[_0x396a('0x3a')],qs[_0x396a('0x3c')](_0x1ea1ce[_0x396a('0x36')]['fields']));_0xb2313b['attributes']=_0xb2313b[_0x396a('0x3b')]['length']?_0xb2313b[_0x396a('0x3b')]:_0x416637[_0x396a('0x3a')];if(!_0x1ea1ce['query']['hasOwnProperty'](_0x396a('0x3d'))){_0xb2313b[_0x396a('0x23')]=qs[_0x396a('0x23')](_0x1ea1ce[_0x396a('0x36')][_0x396a('0x23')]);_0xb2313b[_0x396a('0x21')]=qs['offset'](_0x1ea1ce[_0x396a('0x36')][_0x396a('0x21')]);}_0xb2313b[_0x396a('0x3e')]=qs[_0x396a('0x3f')](_0x1ea1ce[_0x396a('0x36')][_0x396a('0x3f')]);_0xb2313b[_0x396a('0x40')]=qs['filters'](_['pick'](_0x1ea1ce['query'],_0x416637['filters']),_0x59414d);if(_0x1ea1ce[_0x396a('0x36')][_0x396a('0x41')]){_0xb2313b[_0x396a('0x40')]=_[_0x396a('0x42')](_0xb2313b['where'],{'$or':_[_0x396a('0x35')](_0x59414d,function(_0x1fcaa3){if(_0x1fcaa3[_0x396a('0x34')]!=='VIRTUAL'){var _0x35af45={};_0x35af45[_0x1fcaa3[_0x396a('0x2e')]]={'$like':'%'+_0x1ea1ce[_0x396a('0x36')]['filter']+'%'};return _0x35af45;}})});}_0xb2313b=_['merge']({},_0xb2313b,_0x1ea1ce[_0x396a('0x43')]);var _0x298974={'where':_0xb2313b['where']};return db[_0x396a('0x31')][_0x396a('0x24')](_0x298974)[_0x396a('0x2d')](function(_0x457b6e){_0x25eac9[_0x396a('0x24')]=_0x457b6e;if(_0x1ea1ce[_0x396a('0x36')][_0x396a('0x44')]){_0xb2313b['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x396a('0x45')](_0xb2313b);})[_0x396a('0x2d')](function(_0x3f1c07){_0x25eac9[_0x396a('0x46')]=_0x3f1c07;return _0x25eac9;})['then'](respondWithFilteredResult(_0x52c2e5,_0xb2313b))[_0x396a('0x47')](handleError(_0x52c2e5,null));};exports[_0x396a('0x48')]=function(_0x3f7b60,_0x42bb5b){var _0x4f3081={'raw':!![],'where':{'id':_0x3f7b60['params']['id']}},_0x42e6b0={};_0x42e6b0[_0x396a('0x3a')]=_[_0x396a('0x37')](db[_0x396a('0x31')]['rawAttributes']);_0x42e6b0[_0x396a('0x36')]=_['keys'](_0x3f7b60[_0x396a('0x36')]);_0x42e6b0[_0x396a('0x38')]=_['intersection'](_0x42e6b0[_0x396a('0x3a')],_0x42e6b0['query']);_0x4f3081[_0x396a('0x3b')]=_[_0x396a('0x39')](_0x42e6b0['model'],qs[_0x396a('0x3c')](_0x3f7b60[_0x396a('0x36')][_0x396a('0x3c')]));_0x4f3081['attributes']=_0x4f3081['attributes'][_0x396a('0x49')]?_0x4f3081[_0x396a('0x3b')]:_0x42e6b0[_0x396a('0x3a')];if(_0x3f7b60[_0x396a('0x36')][_0x396a('0x44')]){_0x4f3081['include']=[{'all':!![]}];}_0x4f3081=_[_0x396a('0x42')]({},_0x4f3081,_0x3f7b60[_0x396a('0x43')]);return db[_0x396a('0x31')][_0x396a('0x4a')](_0x4f3081)['then'](handleEntityNotFound(_0x42bb5b,null))[_0x396a('0x2d')](respondWithResult(_0x42bb5b,null))[_0x396a('0x47')](handleError(_0x42bb5b,null));};exports[_0x396a('0x4b')]=function(_0x372527,_0xf6c67b){return db['OpenchannelQueue'][_0x396a('0x4b')](_0x372527['body'],{})[_0x396a('0x2d')](function(_0x155324){var _0xb71c21=_0x372527[_0x396a('0x4c')][_0x396a('0x2a')]({'plain':!![]});if(!_0xb71c21)throw new Error(_0x396a('0x4d'));if(_0xb71c21[_0x396a('0x4e')]==='user'){var _0x13728c=_0x155324['get']({'plain':!![]});var _0x3aa62a=_0x396a('0x2b');return db[_0x396a('0x4f')][_0x396a('0x4a')]({'where':{'name':_0x3aa62a,'userProfileId':_0xb71c21[_0x396a('0x50')]},'raw':!![]})[_0x396a('0x2d')](function(_0x2ae05f){if(_0x2ae05f&&_0x2ae05f['autoAssociation']===0x0){return db[_0x396a('0x2c')]['create']({'name':_0x13728c[_0x396a('0x2e')],'resourceId':_0x13728c['id'],'type':_0x2ae05f['name'],'sectionId':_0x2ae05f['id']},{})['then'](function(){return _0x155324;});}else{return _0x155324;}})[_0x396a('0x47')](function(_0x5cefd4){logger[_0x396a('0x51')](_0x396a('0x52'),_0x5cefd4);throw _0x5cefd4;});}return _0x155324;})['then'](respondWithResult(_0xf6c67b,0xc9))['catch'](handleError(_0xf6c67b,null));};exports[_0x396a('0x28')]=function(_0x530bb4,_0x2947c1){if(_0x530bb4[_0x396a('0x53')]['id']){delete _0x530bb4['body']['id'];}return db[_0x396a('0x31')]['find']({'where':{'id':_0x530bb4[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](handleEntityNotFound(_0x2947c1,null))[_0x396a('0x2d')](saveUpdates(_0x530bb4[_0x396a('0x53')],null))[_0x396a('0x2d')](respondWithResult(_0x2947c1,null))[_0x396a('0x47')](handleError(_0x2947c1,null));};exports[_0x396a('0x29')]=function(_0x283924,_0xfe819d){return db[_0x396a('0x31')][_0x396a('0x4a')]({'where':{'id':_0x283924[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](handleEntityNotFound(_0xfe819d,null))['then'](removeEntity(_0xfe819d,null))[_0x396a('0x47')](handleError(_0xfe819d,null));};exports[_0x396a('0x55')]=function(_0xc2714a,_0x4e2427){return db['OpenchannelQueue']['describe']()[_0x396a('0x2d')](respondWithResult(_0x4e2427,null))[_0x396a('0x47')](handleError(_0x4e2427,null));};exports[_0x396a('0x56')]=function(_0x3dc12e,_0x1ab9ac,_0x1a03d7){var _0x52742c={'raw':!![],'where':{}},_0x458014={},_0x4c54f1;return db[_0x396a('0x31')][_0x396a('0x57')]({'where':{'id':_0x3dc12e[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](handleEntityNotFound(_0x1ab9ac,null))[_0x396a('0x2d')](function(_0x4dee8e){if(_0x4dee8e){_0x4c54f1=_0x4dee8e[_0x396a('0x2a')]({'plain':!![]});_0x458014['model']=_[_0x396a('0x37')](db[_0x396a('0x58')][_0x396a('0x32')]);_0x458014[_0x396a('0x36')]=_[_0x396a('0x37')](_0x3dc12e[_0x396a('0x36')]);_0x458014['filters']=_[_0x396a('0x39')](_0x458014[_0x396a('0x3a')],_0x458014[_0x396a('0x36')]);_0x52742c['attributes']=_[_0x396a('0x39')](_0x458014['model'],qs[_0x396a('0x3c')](_0x3dc12e[_0x396a('0x36')][_0x396a('0x3c')]));_0x52742c['attributes']=_0x52742c[_0x396a('0x3b')]['length']?_0x52742c['attributes']:_0x458014['model'];if(!_0x3dc12e[_0x396a('0x36')][_0x396a('0x59')](_0x396a('0x3d'))){_0x52742c[_0x396a('0x23')]=qs['limit'](_0x3dc12e[_0x396a('0x36')]['limit']);_0x52742c['offset']=qs[_0x396a('0x21')](_0x3dc12e[_0x396a('0x36')][_0x396a('0x21')]);}_0x52742c[_0x396a('0x3e')]=qs['sort'](_0x3dc12e[_0x396a('0x36')][_0x396a('0x3f')]);_0x52742c[_0x396a('0x40')]=qs['filters'](_[_0x396a('0x5a')](_0x3dc12e[_0x396a('0x36')],_0x458014[_0x396a('0x38')]));_0x52742c[_0x396a('0x40')][_0x396a('0x5b')]=_0x4dee8e['id'];if(_0x3dc12e[_0x396a('0x36')][_0x396a('0x41')]){_0x52742c['where']=_[_0x396a('0x42')](_0x52742c[_0x396a('0x40')],{'$or':_['map'](_0x52742c['attributes'],function(_0x42f803){var _0x16c5af={};_0x16c5af[_0x42f803]={'$like':'%'+_0x3dc12e[_0x396a('0x36')][_0x396a('0x41')]+'%'};return _0x16c5af;})});}_0x52742c=_[_0x396a('0x42')]({},_0x52742c,_0x3dc12e['options']);return db[_0x396a('0x58')][_0x396a('0x45')](_0x52742c);}})[_0x396a('0x2d')](function(_0x5719f0){if(_0x5719f0){return db[_0x396a('0x5c')]['findAndCountAll']({'where':{'id':_[_0x396a('0x35')](_0x5719f0,'UserId'),'role':_0x396a('0x5d')},'attributes':['id','name','openchannelPause',_0x396a('0x5e'),'createdAt']});}})[_0x396a('0x2d')](function(_0xc97a9c){if(_0xc97a9c){return{'count':_0xc97a9c[_0x396a('0x24')],'rows':_[_0x396a('0x35')](_0xc97a9c[_0x396a('0x46')],function(_0x35e572){return{'membername':_0x35e572[_0x396a('0x2e')],'UserId':_0x35e572['id'],'queue_name':_0x4c54f1[_0x396a('0x2e')],'OpenchannelQueueId':_0x4c54f1['id'],'interface':util['format'](_0x396a('0x5f'),_0x396a('0x60'),_0x35e572[_0x396a('0x2e')]),'penalty':0x0,'paused':_0x35e572[_0x396a('0x61')],'createdAt':_0x35e572[_0x396a('0x62')],'updatedAt':_0x35e572[_0x396a('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ab9ac,_0x52742c))[_0x396a('0x47')](handleError(_0x1ab9ac,null));};exports[_0x396a('0x63')]=function(_0x344b30,_0x504734,_0x2d4b11){var _0x3ce57b={};var _0x288086={};var _0x4b7302;var _0x401827;return db[_0x396a('0x31')][_0x396a('0x57')]({'where':{'id':_0x344b30[_0x396a('0x54')]['id']}})['then'](handleEntityNotFound(_0x504734,null))[_0x396a('0x2d')](function(_0x3981ac){if(_0x3981ac){_0x4b7302=_0x3981ac;_0x288086[_0x396a('0x3a')]=_[_0x396a('0x37')](db[_0x396a('0x64')][_0x396a('0x32')]);_0x288086['query']=_['keys'](_0x344b30[_0x396a('0x36')]);_0x288086[_0x396a('0x38')]=_[_0x396a('0x39')](_0x288086[_0x396a('0x3a')],_0x288086['query']);_0x3ce57b[_0x396a('0x3b')]=_[_0x396a('0x39')](_0x288086[_0x396a('0x3a')],qs[_0x396a('0x3c')](_0x344b30[_0x396a('0x36')][_0x396a('0x3c')]));_0x3ce57b[_0x396a('0x3b')]=_0x3ce57b[_0x396a('0x3b')][_0x396a('0x49')]?_0x3ce57b[_0x396a('0x3b')]:_0x288086[_0x396a('0x3a')];_0x3ce57b[_0x396a('0x3e')]=qs[_0x396a('0x3f')](_0x344b30[_0x396a('0x36')][_0x396a('0x3f')]);_0x3ce57b[_0x396a('0x40')]=qs[_0x396a('0x38')](_[_0x396a('0x5a')](_0x344b30[_0x396a('0x36')],_0x288086['filters']));if(_0x344b30[_0x396a('0x36')]['filter']){_0x3ce57b[_0x396a('0x40')]=_['merge'](_0x3ce57b[_0x396a('0x40')],{'$or':_[_0x396a('0x35')](_0x3ce57b[_0x396a('0x3b')],function(_0x1d57bb){var _0x547219={};_0x547219[_0x1d57bb]={'$like':'%'+_0x344b30[_0x396a('0x36')][_0x396a('0x41')]+'%'};return _0x547219;})});}_0x3ce57b=_[_0x396a('0x42')]({},_0x3ce57b,_0x344b30[_0x396a('0x43')]);return _0x4b7302[_0x396a('0x63')](_0x3ce57b);}})[_0x396a('0x2d')](function(_0x599877){if(_0x599877){_0x401827=_0x599877[_0x396a('0x49')];if(!_0x344b30['query'][_0x396a('0x59')](_0x396a('0x3d'))){_0x3ce57b['limit']=qs[_0x396a('0x23')](_0x344b30[_0x396a('0x36')][_0x396a('0x23')]);_0x3ce57b[_0x396a('0x21')]=qs[_0x396a('0x21')](_0x344b30[_0x396a('0x36')][_0x396a('0x21')]);}return _0x4b7302['getTeams'](_0x3ce57b);}})[_0x396a('0x2d')](function(_0x27c073){if(_0x27c073){return _0x27c073?{'count':_0x401827,'rows':_0x27c073}:null;}})[_0x396a('0x2d')](respondWithResult(_0x504734,null))[_0x396a('0x47')](handleError(_0x504734,null));};exports['addTeams']=function(_0x260067,_0x410041,_0xf166e8){var _0x39b5c9=_0x260067[_0x396a('0x53')][_0x396a('0x65')];return db[_0x396a('0x64')][_0x396a('0x45')]({'where':{'id':_0x39b5c9},'attributes':['id'],'include':[{'model':db[_0x396a('0x5c')],'as':_0x396a('0x66'),'attributes':['id','name','online','voicePause',_0x396a('0x67')],'raw':!![]}]})['then'](function(_0xfe2c7c){if(_0xfe2c7c){var _0x6496ac=_[_0x396a('0x68')](_0xfe2c7c,function(_0x2f163d){var _0x233e65=_0x2f163d[_0x396a('0x2a')]({'plain':!![]});return _0x233e65['Agents'];});return db[_0x396a('0x31')][_0x396a('0x4a')]({'where':{'id':_0x260067[_0x396a('0x54')]['id']}})['then'](function(_0x26c681){return db[_0x396a('0x69')][_0x396a('0x6a')](function(_0x28ab2a){return _0x26c681[_0x396a('0x6b')](_0x39b5c9,{'transaction':_0x28ab2a})[_0x396a('0x2d')](function(){return BPromise[_0x396a('0x6c')](_0x6496ac,function(_0x362faa){return db[_0x396a('0x58')][_0x396a('0x6d')]({'where':{'UserId':_0x362faa['id'],'OpenchannelQueueId':_0x260067[_0x396a('0x54')]['id']},'transaction':_0x28ab2a});});})['then'](function(){_0x6496ac[_0x396a('0x6e')](function(_0x23a903){socket['emit'](_0x396a('0x6f'),{'UserId':_0x23a903['id'],'OpenchannelQueueId':_0x26c681['id']});});});});});}})[_0x396a('0x2d')](respondWithStatusCode(_0x410041,null))[_0x396a('0x47')](handleError(_0x410041,null));};exports[_0x396a('0x70')]=function(_0x38731b,_0x3a82fe,_0x3edaa4){return db[_0x396a('0x64')][_0x396a('0x45')]({'where':{'id':_0x38731b['query'][_0x396a('0x65')]},'attributes':['id'],'include':[{'model':db[_0x396a('0x5c')],'as':_0x396a('0x66'),'attributes':['id'],'raw':!![]}]})[_0x396a('0x2d')](handleEntityNotFound(_0x3a82fe,null))[_0x396a('0x2d')](function(_0x341afa){var _0x34d412=_['map'](_0x341afa,'id');var _0x5b7924=[];var _0x51fe84=[];var _0x92ec9d=squel[_0x396a('0x71')]();_0x92ec9d[_0x396a('0x72')](_0x396a('0x73'))[_0x396a('0x74')]('team_has_openchannel_queues','tq')['join'](_0x396a('0x75'),'ut',_0x396a('0x76'))[_0x396a('0x40')]('OpenchannelQueueId\x20=\x20?',_0x38731b[_0x396a('0x54')]['id']);for(var _0x115c0c=0x0;_0x115c0c<_0x341afa[_0x396a('0x49')];_0x115c0c+=0x1){let _0x286880=_0x341afa[_0x115c0c];for(var _0x429234=0x0;_0x429234<_0x286880['Agents'][_0x396a('0x49')];_0x429234+=0x1){let _0x4fa1ff=_0x286880[_0x396a('0x66')][_0x429234];var _0x54fdca=_0x92ec9d[_0x396a('0x77')]();_0x54fdca[_0x396a('0x40')]('ut.UserId\x20=\x20?',_0x4fa1ff['id']);_0x51fe84[_0x396a('0x78')](db[_0x396a('0x69')][_0x396a('0x36')](_0x54fdca[_0x396a('0x79')](),{'type':db[_0x396a('0x69')][_0x396a('0x7a')][_0x396a('0x7b')]})[_0x396a('0x2d')](function(_0x381147){if(_0x381147['length']===0x1){return _0x4fa1ff['id'];}else{var _0x51a260=_[_0x396a('0x7c')](_[_0x396a('0x35')](_0x381147,_0x396a('0x7d')),function(_0x5f1f05){return _['includes'](_0x34d412,_0x5f1f05);});if(_0x51a260){return _0x4fa1ff['id'];}}}));}}return BPromise[_0x396a('0x7e')](_0x51fe84)['then'](function(_0x3c03ab){_0x5b7924=_(_0x5b7924)['union'](_0x3c03ab)[_0x396a('0x7f')]()[_0x396a('0x80')]();return db[_0x396a('0x31')][_0x396a('0x4a')]({'where':{'id':_0x38731b[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](function(_0x54a1c3){return db[_0x396a('0x69')][_0x396a('0x6a')](function(_0x322682){return _0x54a1c3[_0x396a('0x70')](_0x38731b[_0x396a('0x36')][_0x396a('0x65')],{'transaction':_0x322682})[_0x396a('0x2d')](function(){if(!_[_0x396a('0x81')](_0x5b7924)){return _0x54a1c3['removeAgents'](_0x5b7924,{'transaction':_0x322682});}})[_0x396a('0x2d')](function(){_0x5b7924['forEach'](function(_0x54c14e){socket[_0x396a('0x82')](_0x396a('0x83'),{'UserId':_0x54c14e,'OpenchannelQueueId':_0x54a1c3['id']});});});});});});})[_0x396a('0x2d')](respondWithStatusCode(_0x3a82fe,null))[_0x396a('0x47')](handleError(_0x3a82fe,null));};exports['addAgents']=function(_0x32618c,_0x46966f,_0x5379d6){return db[_0x396a('0x31')][_0x396a('0x4a')]({'where':{'id':_0x32618c[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](handleEntityNotFound(_0x46966f,null))['then'](function(_0x7f1782){if(_0x7f1782){return _0x7f1782[_0x396a('0x84')](_0x32618c[_0x396a('0x53')]['ids'],_[_0x396a('0x85')](_0x32618c['body'],[_0x396a('0x65'),'id'])||{})[_0x396a('0x86')](function(_0x1f1a77){for(var _0x49ad65=0x0;_0x49ad65<_0x32618c['body'][_0x396a('0x65')][_0x396a('0x49')];_0x49ad65+=0x1){socket[_0x396a('0x82')](_0x396a('0x6f'),{'UserId':Number(_0x32618c['body'][_0x396a('0x65')][_0x49ad65]),'OpenchannelQueueId':Number(_0x32618c['params']['id'])});}return _0x1f1a77;});}})['then'](respondWithResult(_0x46966f,null))['catch'](handleError(_0x46966f,null));};exports[_0x396a('0x87')]=function(_0x3c75b4,_0x3baa01,_0x160f8a){return db[_0x396a('0x31')][_0x396a('0x4a')]({'where':{'id':_0x3c75b4[_0x396a('0x54')]['id']}})[_0x396a('0x2d')](handleEntityNotFound(_0x3baa01,null))[_0x396a('0x2d')](function(_0x3faa4e){if(_0x3faa4e){return _0x3faa4e[_0x396a('0x87')](_0x3c75b4[_0x396a('0x36')]['ids'])[_0x396a('0x2d')](function(){if(_[_0x396a('0x88')](_0x3c75b4[_0x396a('0x36')][_0x396a('0x65')])){for(var _0x209b8b=0x0;_0x209b8b<_0x3c75b4[_0x396a('0x36')][_0x396a('0x65')][_0x396a('0x49')];_0x209b8b+=0x1){socket[_0x396a('0x82')](_0x396a('0x83'),{'UserId':Number(_0x3c75b4['query'][_0x396a('0x65')][_0x209b8b]),'OpenchannelQueueId':Number(_0x3c75b4[_0x396a('0x54')]['id'])});}}else{socket[_0x396a('0x82')](_0x396a('0x83'),{'UserId':Number(_0x3c75b4[_0x396a('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3c75b4[_0x396a('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3baa01,null))[_0x396a('0x47')](handleError(_0x3baa01,null));};exports[_0x396a('0x89')]=function(_0x18e246,_0x162aa1,_0x2a972d){var _0x263e97={};var _0x2064f3={};var _0x322e0a;var _0x2b8460;return db['OpenchannelQueue'][_0x396a('0x57')]({'where':{'id':_0x18e246[_0x396a('0x54')]['id']}})['then'](handleEntityNotFound(_0x162aa1,null))[_0x396a('0x2d')](function(_0x50377f){if(_0x50377f){_0x322e0a=_0x50377f;_0x2064f3[_0x396a('0x3a')]=_[_0x396a('0x37')](db[_0x396a('0x5c')][_0x396a('0x32')]);_0x2064f3[_0x396a('0x36')]=_[_0x396a('0x37')](_0x18e246[_0x396a('0x36')]);_0x2064f3[_0x396a('0x38')]=_[_0x396a('0x39')](_0x2064f3[_0x396a('0x3a')],_0x2064f3['query']);_0x263e97['attributes']=_['intersection'](_0x2064f3['model'],qs[_0x396a('0x3c')](_0x18e246['query'][_0x396a('0x3c')]));_0x263e97[_0x396a('0x3b')]=_0x263e97['attributes']['length']?_0x263e97[_0x396a('0x3b')]:_0x2064f3['model'];_0x263e97[_0x396a('0x3e')]=qs[_0x396a('0x3f')](_0x18e246[_0x396a('0x36')][_0x396a('0x3f')]);_0x263e97[_0x396a('0x40')]=qs['filters'](_[_0x396a('0x5a')](_0x18e246[_0x396a('0x36')],_0x2064f3['filters']));if(_0x18e246['query'][_0x396a('0x41')]){_0x263e97[_0x396a('0x40')]=_[_0x396a('0x42')](_0x263e97[_0x396a('0x40')],{'$or':_[_0x396a('0x35')](_0x263e97[_0x396a('0x3b')],function(_0x10b59c){var _0x156c3e={};_0x156c3e[_0x10b59c]={'$like':'%'+_0x18e246[_0x396a('0x36')][_0x396a('0x41')]+'%'};return _0x156c3e;})});}_0x263e97=_[_0x396a('0x42')]({},_0x263e97,_0x18e246[_0x396a('0x43')]);return _0x322e0a[_0x396a('0x89')](_0x263e97);}})[_0x396a('0x2d')](function(_0x3212a4){if(_0x3212a4){_0x2b8460=_0x3212a4[_0x396a('0x49')];if(!_0x18e246[_0x396a('0x36')][_0x396a('0x59')]('nolimit')){_0x263e97[_0x396a('0x23')]=qs['limit'](_0x18e246[_0x396a('0x36')]['limit']);_0x263e97['offset']=qs[_0x396a('0x21')](_0x18e246['query'][_0x396a('0x21')]);}return _0x322e0a[_0x396a('0x89')](_0x263e97);}})[_0x396a('0x2d')](function(_0x3924e9){if(_0x3924e9){return _0x3924e9?{'count':_0x2b8460,'rows':_0x3924e9}:null;}})['then'](respondWithResult(_0x162aa1,null))['catch'](handleError(_0x162aa1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 183c30d..3821948 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 _0x21c1=['update','remove','emit','hook','exports','events','OpenchannelQueue','setMaxListeners'];(function(_0x37eca7,_0x3e016e){var _0x222bce=function(_0xebd0b7){while(--_0xebd0b7){_0x37eca7['push'](_0x37eca7['shift']());}};_0x222bce(++_0x3e016e);}(_0x21c1,0x185));var _0x121c=function(_0x15cf2d,_0x4c292e){_0x15cf2d=_0x15cf2d-0x0;var _0x3dd84b=_0x21c1[_0x15cf2d];return _0x3dd84b;};'use strict';var EventEmitter=require(_0x121c('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x121c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x121c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x121c('0x3'),'afterDestroy':_0x121c('0x4')};function emitEvent(_0x3143b8){return function(_0x2da26c,_0x4b9855,_0x5426fc){OpenchannelQueueEvents[_0x121c('0x5')](_0x3143b8+':'+_0x2da26c['id'],_0x2da26c);OpenchannelQueueEvents[_0x121c('0x5')](_0x3143b8,_0x2da26c);_0x5426fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x121c('0x6')](e,emitEvent(event));}}module[_0x121c('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2834=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x424454,_0x5492c6){var _0x38f606=function(_0x195386){while(--_0x195386){_0x424454['push'](_0x424454['shift']());}};_0x38f606(++_0x5492c6);}(_0x2834,0x1df));var _0x4283=function(_0x17e21f,_0xf69369){_0x17e21f=_0x17e21f-0x0;var _0x2875f6=_0x2834[_0x17e21f];return _0x2875f6;};'use strict';var EventEmitter=require(_0x4283('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4283('0x1')](0x0);var events={'afterCreate':_0x4283('0x2'),'afterUpdate':'update','afterDestroy':_0x4283('0x3')};function emitEvent(_0x14f32c){return function(_0x48fae6,_0x1e1feb,_0x158f23){OpenchannelQueueEvents[_0x4283('0x4')](_0x14f32c+':'+_0x48fae6['id'],_0x48fae6);OpenchannelQueueEvents[_0x4283('0x4')](_0x14f32c,_0x48fae6);_0x158f23(null);};}for(var e in events){if(events[_0x4283('0x5')](e)){var event=events[e];OpenchannelQueue[_0x4283('0x6')](e,emitEvent(event));}}module[_0x4283('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 13a1ab4..0530036 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 _0x9134=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x303d9f,_0x5af1f4){var _0x15b530=function(_0x1f8f9a){while(--_0x1f8f9a){_0x303d9f['push'](_0x303d9f['shift']());}};_0x15b530(++_0x5af1f4);}(_0x9134,0x15a));var _0x4913=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9134[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var logger=require('../../config/logger')(_0x4913('0x1'));var moment=require('moment');var BPromise=require(_0x4913('0x2'));var rp=require(_0x4913('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4913('0x4'));var config=require(_0x4913('0x5'));var attributes=require(_0x4913('0x6'));module[_0x4913('0x7')]=function(_0x485484,_0x251019){return _0x485484[_0x4913('0x8')](_0x4913('0x9'),attributes,{'tableName':_0x4913('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x118d=['lodash','util','bluebird','request-promise','path','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x5d1af2,_0x56eb80){var _0x33f3bd=function(_0x4bc760){while(--_0x4bc760){_0x5d1af2['push'](_0x5d1af2['shift']());}};_0x33f3bd(++_0x56eb80);}(_0x118d,0x17a));var _0xd118=function(_0x56272f,_0x1e4581){_0x56272f=_0x56272f-0x0;var _0x57f0ba=_0x118d[_0x56272f];return _0x57f0ba;};'use strict';var _=require(_0xd118('0x0'));var util=require(_0xd118('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd118('0x2'));var rp=require(_0xd118('0x3'));var fs=require('fs');var path=require(_0xd118('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0xd118('0x5')]=function(_0x1768a5,_0x56319e){return _0x1768a5[_0xd118('0x6')](_0xd118('0x7'),attributes,{'tableName':_0xd118('0x8'),'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 187942a..901b20a 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 _0x54fe=['map','model','ShowOpenchannelQueue','OpenchannelQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','include'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x54fe,0x136));var _0xe54f=function(_0x3bf999,_0x516512){_0x3bf999=_0x3bf999-0x0;var _0x4f8efb=_0x54fe[_0x3bf999];return _0x4f8efb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe54f('0x0'));var BPromise=require(_0xe54f('0x1'));var rs=require(_0xe54f('0x2'));var fs=require('fs');var Redis=require(_0xe54f('0x3'));var db=require(_0xe54f('0x4'))['db'];var utils=require(_0xe54f('0x5'));var logger=require('../../config/logger')(_0xe54f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe54f('0x7')](config[_0xe54f('0x8')],{'host':_0xe54f('0x9'),'port':0x18eb});var socket=require(_0xe54f('0xa'))(new Redis(config[_0xe54f('0x8')]));require('./openchannelQueue.socket')[_0xe54f('0xb')](socket);function respondWithRpcPromise(_0xc45ae5,_0x24872f,_0x1add5d){return new BPromise(function(_0x7cb572,_0x3c96c6){return client[_0xe54f('0xc')](_0xc45ae5,_0x1add5d)[_0xe54f('0xd')](function(_0x291fb1){logger[_0xe54f('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x24872f,_0xe54f('0xf'));logger[_0xe54f('0x10')](_0xe54f('0x11'),_0x24872f,_0xe54f('0xf'),JSON[_0xe54f('0x12')](_0x291fb1));if(_0x291fb1[_0xe54f('0x13')]){if(_0x291fb1[_0xe54f('0x13')][_0xe54f('0x14')]===0x1f4){logger[_0xe54f('0x13')](_0xe54f('0x15'),_0x24872f,_0x291fb1[_0xe54f('0x13')][_0xe54f('0x16')]);return _0x3c96c6(_0x291fb1[_0xe54f('0x13')][_0xe54f('0x16')]);}logger[_0xe54f('0x13')](_0xe54f('0x15'),_0x24872f,_0x291fb1['error'][_0xe54f('0x16')]);return _0x7cb572(_0x291fb1[_0xe54f('0x13')][_0xe54f('0x16')]);}else{logger[_0xe54f('0xe')](_0xe54f('0x15'),_0x24872f,_0xe54f('0xf'));_0x7cb572(_0x291fb1[_0xe54f('0x17')][_0xe54f('0x16')]);}})[_0xe54f('0x18')](function(_0x1a5d9e){logger[_0xe54f('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x24872f,_0x1a5d9e);_0x3c96c6(_0x1a5d9e);});});}exports[_0xe54f('0x19')]=function(_0x5dc6d3){var _0x515830=this;return new Promise(function(_0x4eefa8,_0x2ff516){return db['OpenchannelQueue'][_0xe54f('0x1a')]({'raw':_0x5dc6d3[_0xe54f('0x1b')]?_0x5dc6d3[_0xe54f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5dc6d3[_0xe54f('0x1b')]?_0x5dc6d3[_0xe54f('0x1b')][_0xe54f('0x1c')]||null:null,'attributes':_0x5dc6d3[_0xe54f('0x1b')]?_0x5dc6d3[_0xe54f('0x1b')][_0xe54f('0x1d')]||null:null,'limit':_0x5dc6d3[_0xe54f('0x1b')]?_0x5dc6d3[_0xe54f('0x1b')][_0xe54f('0x1e')]||null:null,'include':_0x5dc6d3[_0xe54f('0x1b')]?_0x5dc6d3[_0xe54f('0x1b')][_0xe54f('0x1f')]?_[_0xe54f('0x20')](_0x5dc6d3[_0xe54f('0x1b')][_0xe54f('0x1f')],function(_0x4ae93c){return{'model':db[_0x4ae93c[_0xe54f('0x21')]],'as':_0x4ae93c['as'],'attributes':_0x4ae93c[_0xe54f('0x1d')],'include':_0x4ae93c[_0xe54f('0x1f')]?_['map'](_0x4ae93c[_0xe54f('0x1f')],function(_0x1d9462){return{'model':db[_0x1d9462['model']],'as':_0x1d9462['as'],'attributes':_0x1d9462[_0xe54f('0x1d')],'include':_0x1d9462[_0xe54f('0x1f')]?_[_0xe54f('0x20')](_0x1d9462[_0xe54f('0x1f')],function(_0x78b81e){return{'model':db[_0x78b81e[_0xe54f('0x21')]],'as':_0x78b81e['as'],'attributes':_0x78b81e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe54f('0xd')](function(_0x226a17){logger[_0xe54f('0xe')](_0xe54f('0x19'),_0x5dc6d3);logger[_0xe54f('0x10')]('GetOpenchannelQueue',_0x5dc6d3,JSON[_0xe54f('0x12')](_0x226a17));_0x4eefa8(_0x226a17);})['catch'](function(_0x1aee23){logger[_0xe54f('0x13')](_0xe54f('0x19'),_0x1aee23[_0xe54f('0x16')],_0x5dc6d3);_0x2ff516(_0x515830[_0xe54f('0x13')](0x1f4,_0x1aee23[_0xe54f('0x16')]));});});};exports[_0xe54f('0x22')]=function(_0x42f99b){var _0x12ad07=this;return new Promise(function(_0x570aad,_0x19bef6){return db[_0xe54f('0x23')][_0xe54f('0x24')]({'raw':_0x42f99b['options']?_0x42f99b['options'][_0xe54f('0x25')]===undefined?!![]:![]:!![],'where':_0x42f99b['options']?_0x42f99b['options'][_0xe54f('0x1c')]||null:null,'attributes':_0x42f99b['options']?_0x42f99b[_0xe54f('0x1b')][_0xe54f('0x1d')]||null:null,'include':_0x42f99b[_0xe54f('0x1b')]?_0x42f99b[_0xe54f('0x1b')][_0xe54f('0x1f')]?_[_0xe54f('0x20')](_0x42f99b['options'][_0xe54f('0x1f')],function(_0x326c94){return{'model':db[_0x326c94[_0xe54f('0x21')]],'as':_0x326c94['as'],'attributes':_0x326c94['attributes'],'include':_0x326c94['include']?_['map'](_0x326c94['include'],function(_0x3e2471){return{'model':db[_0x3e2471[_0xe54f('0x21')]],'as':_0x3e2471['as'],'attributes':_0x3e2471[_0xe54f('0x1d')],'include':_0x3e2471[_0xe54f('0x1f')]?_[_0xe54f('0x20')](_0x3e2471['include'],function(_0x5cfaa9){return{'model':db[_0x5cfaa9[_0xe54f('0x21')]],'as':_0x5cfaa9['as'],'attributes':_0x5cfaa9[_0xe54f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594354){logger[_0xe54f('0xe')]('ShowOpenchannelQueue',_0x42f99b);logger['debug']('ShowOpenchannelQueue',_0x42f99b,JSON[_0xe54f('0x12')](_0x594354));_0x570aad(_0x594354);})[_0xe54f('0x18')](function(_0xaac587){logger['error'](_0xe54f('0x22'),_0xaac587[_0xe54f('0x16')],_0x42f99b);_0x19bef6(_0x12ad07[_0xe54f('0x13')](0x1f4,_0xaac587['message']));});});}; \ No newline at end of file +var _0xfc9e=['model','then','ShowOpenchannelQueue','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x2ec3e2,_0x56fa9e){var _0x4f0234=function(_0x3363b3){while(--_0x3363b3){_0x2ec3e2['push'](_0x2ec3e2['shift']());}};_0x4f0234(++_0x56fa9e);}(_0xfc9e,0xa4));var _0xefc9=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0xfc9e[_0x403c8d];return _0x4ca60d;};'use strict';var _=require(_0xefc9('0x0'));var util=require(_0xefc9('0x1'));var moment=require(_0xefc9('0x2'));var BPromise=require(_0xefc9('0x3'));var rs=require(_0xefc9('0x4'));var fs=require('fs');var Redis=require(_0xefc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xefc9('0x6'));var logger=require(_0xefc9('0x7'))(_0xefc9('0x8'));var config=require(_0xefc9('0x9'));var jayson=require(_0xefc9('0xa'));var client=jayson['client'][_0xefc9('0xb')]({'port':0x232a});config[_0xefc9('0xc')]=_[_0xefc9('0xd')](config[_0xefc9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xefc9('0xe'))(new Redis(config[_0xefc9('0xc')]));require('./openchannelQueue.socket')[_0xefc9('0xf')](socket);function respondWithRpcPromise(_0x2cecfa,_0x83f5d6,_0x344c81){return new BPromise(function(_0x207290,_0x484151){return client[_0xefc9('0x10')](_0x2cecfa,_0x344c81)['then'](function(_0x36471e){logger['info'](_0xefc9('0x11'),_0x83f5d6,_0xefc9('0x12'));logger[_0xefc9('0x13')](_0xefc9('0x14'),_0x83f5d6,_0xefc9('0x12'),JSON['stringify'](_0x36471e));if(_0x36471e[_0xefc9('0x15')]){if(_0x36471e[_0xefc9('0x15')]['code']===0x1f4){logger[_0xefc9('0x15')](_0xefc9('0x11'),_0x83f5d6,_0x36471e[_0xefc9('0x15')][_0xefc9('0x16')]);return _0x484151(_0x36471e[_0xefc9('0x15')][_0xefc9('0x16')]);}logger[_0xefc9('0x15')](_0xefc9('0x11'),_0x83f5d6,_0x36471e['error']['message']);return _0x207290(_0x36471e['error'][_0xefc9('0x16')]);}else{logger[_0xefc9('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x83f5d6,_0xefc9('0x12'));_0x207290(_0x36471e[_0xefc9('0x18')][_0xefc9('0x16')]);}})[_0xefc9('0x19')](function(_0x4f53b0){logger[_0xefc9('0x15')](_0xefc9('0x11'),_0x83f5d6,_0x4f53b0);_0x484151(_0x4f53b0);});});}exports[_0xefc9('0x1a')]=function(_0x80ef5a){var _0x423f0e=this;return new Promise(function(_0x454418,_0x1f3dea){return db[_0xefc9('0x1b')][_0xefc9('0x1c')]({'raw':_0x80ef5a[_0xefc9('0x1d')]?_0x80ef5a[_0xefc9('0x1d')][_0xefc9('0x1e')]===undefined?!![]:![]:!![],'where':_0x80ef5a[_0xefc9('0x1d')]?_0x80ef5a[_0xefc9('0x1d')][_0xefc9('0x1f')]||null:null,'attributes':_0x80ef5a[_0xefc9('0x1d')]?_0x80ef5a['options'][_0xefc9('0x20')]||null:null,'limit':_0x80ef5a[_0xefc9('0x1d')]?_0x80ef5a[_0xefc9('0x1d')][_0xefc9('0x21')]||null:null,'include':_0x80ef5a[_0xefc9('0x1d')]?_0x80ef5a[_0xefc9('0x1d')][_0xefc9('0x22')]?_[_0xefc9('0x23')](_0x80ef5a[_0xefc9('0x1d')]['include'],function(_0xd90aba){return{'model':db[_0xd90aba[_0xefc9('0x24')]],'as':_0xd90aba['as'],'attributes':_0xd90aba[_0xefc9('0x20')],'include':_0xd90aba['include']?_[_0xefc9('0x23')](_0xd90aba[_0xefc9('0x22')],function(_0x8afb1a){return{'model':db[_0x8afb1a[_0xefc9('0x24')]],'as':_0x8afb1a['as'],'attributes':_0x8afb1a['attributes'],'include':_0x8afb1a['include']?_[_0xefc9('0x23')](_0x8afb1a[_0xefc9('0x22')],function(_0x315a72){return{'model':db[_0x315a72['model']],'as':_0x315a72['as'],'attributes':_0x315a72[_0xefc9('0x20')]};}):[]};}):[]};}):[]:[]})[_0xefc9('0x25')](function(_0x44402f){logger[_0xefc9('0x17')](_0xefc9('0x1a'),_0x80ef5a);logger[_0xefc9('0x13')](_0xefc9('0x1a'),_0x80ef5a,JSON['stringify'](_0x44402f));_0x454418(_0x44402f);})[_0xefc9('0x19')](function(_0x3fc566){logger['error'](_0xefc9('0x1a'),_0x3fc566[_0xefc9('0x16')],_0x80ef5a);_0x1f3dea(_0x423f0e[_0xefc9('0x15')](0x1f4,_0x3fc566[_0xefc9('0x16')]));});});};exports[_0xefc9('0x26')]=function(_0xd9aa7b){var _0x161070=this;return new Promise(function(_0x355a10,_0x24f30b){return db['OpenchannelQueue']['find']({'raw':_0xd9aa7b[_0xefc9('0x1d')]?_0xd9aa7b[_0xefc9('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xd9aa7b[_0xefc9('0x1d')]?_0xd9aa7b[_0xefc9('0x1d')][_0xefc9('0x1f')]||null:null,'attributes':_0xd9aa7b[_0xefc9('0x1d')]?_0xd9aa7b['options'][_0xefc9('0x20')]||null:null,'include':_0xd9aa7b[_0xefc9('0x1d')]?_0xd9aa7b[_0xefc9('0x1d')][_0xefc9('0x22')]?_[_0xefc9('0x23')](_0xd9aa7b['options'][_0xefc9('0x22')],function(_0x452202){return{'model':db[_0x452202[_0xefc9('0x24')]],'as':_0x452202['as'],'attributes':_0x452202[_0xefc9('0x20')],'include':_0x452202[_0xefc9('0x22')]?_[_0xefc9('0x23')](_0x452202[_0xefc9('0x22')],function(_0x36a0f6){return{'model':db[_0x36a0f6['model']],'as':_0x36a0f6['as'],'attributes':_0x36a0f6[_0xefc9('0x20')],'include':_0x36a0f6[_0xefc9('0x22')]?_[_0xefc9('0x23')](_0x36a0f6[_0xefc9('0x22')],function(_0x581a70){return{'model':db[_0x581a70[_0xefc9('0x24')]],'as':_0x581a70['as'],'attributes':_0x581a70['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58b594){logger[_0xefc9('0x17')](_0xefc9('0x26'),_0xd9aa7b);logger[_0xefc9('0x13')]('ShowOpenchannelQueue',_0xd9aa7b,JSON[_0xefc9('0x27')](_0x58b594));_0x355a10(_0x58b594);})[_0xefc9('0x19')](function(_0x2e9f56){logger[_0xefc9('0x15')]('ShowOpenchannelQueue',_0x2e9f56[_0xefc9('0x16')],_0xd9aa7b);_0x24f30b(_0x161070['error'](0x1f4,_0x2e9f56[_0xefc9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 30ed036..afd80c7 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 _0xa714=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x225634,_0x2822e2){var _0x2f3c62=function(_0x4ffe0e){while(--_0x4ffe0e){_0x225634['push'](_0x225634['shift']());}};_0x2f3c62(++_0x2822e2);}(_0xa714,0xaf));var _0x4a71=function(_0x39b72b,_0x2f8999){_0x39b72b=_0x39b72b-0x0;var _0x2c2848=_0xa714[_0x39b72b];return _0x2c2848;};'use strict';var OpenchannelQueueEvents=require(_0x4a71('0x0'));var events=[_0x4a71('0x1'),_0x4a71('0x2'),_0x4a71('0x3')];function createListener(_0x4ba1ff,_0x4ec3c8){return function(_0x301bf0){_0x4ec3c8[_0x4a71('0x4')](_0x4ba1ff,_0x301bf0);};}function removeListener(_0x1bd47c,_0x3662f3){return function(){OpenchannelQueueEvents[_0x4a71('0x5')](_0x1bd47c,_0x3662f3);};}exports[_0x4a71('0x6')]=function(_0x32aef8){for(var _0xee9b53=0x0,_0x31bcb1=events[_0x4a71('0x7')];_0xee9b53<_0x31bcb1;_0xee9b53++){var _0x389625=events[_0xee9b53];var _0x27439d=createListener(_0x4a71('0x8')+_0x389625,_0x32aef8);OpenchannelQueueEvents['on'](_0x389625,_0x27439d);}}; \ No newline at end of file +var _0x6981=['emit','removeListener','register','length','./openchannelQueue.events','save','update'];(function(_0x3e436c,_0xebf949){var _0x3e4924=function(_0xab2179){while(--_0xab2179){_0x3e436c['push'](_0x3e436c['shift']());}};_0x3e4924(++_0xebf949);}(_0x6981,0x1e0));var _0x1698=function(_0x330003,_0x24ad42){_0x330003=_0x330003-0x0;var _0x282296=_0x6981[_0x330003];return _0x282296;};'use strict';var OpenchannelQueueEvents=require(_0x1698('0x0'));var events=[_0x1698('0x1'),'remove',_0x1698('0x2')];function createListener(_0x3ae98d,_0x3463f8){return function(_0x38a335){_0x3463f8[_0x1698('0x3')](_0x3ae98d,_0x38a335);};}function removeListener(_0x53a8f3,_0x589d63){return function(){OpenchannelQueueEvents[_0x1698('0x4')](_0x53a8f3,_0x589d63);};}exports[_0x1698('0x5')]=function(_0x5b28c0){for(var _0x24451d=0x0,_0x1b2805=events[_0x1698('0x6')];_0x24451d<_0x1b2805;_0x24451d++){var _0x559540=events[_0x24451d];var _0x464549=createListener('openchannelQueue:'+_0x559540,_0x5b28c0);OpenchannelQueueEvents['on'](_0x559540,_0x464549);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8a79b24..35e80b6 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 _0xf41a=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x4a66f0,_0xb1ad99){var _0x5eebbf=function(_0x1e21aa){while(--_0x1e21aa){_0x4a66f0['push'](_0x4a66f0['shift']());}};_0x5eebbf(++_0xb1ad99);}(_0xf41a,0x163));var _0xaf41=function(_0x14eafa,_0x1f47c7){_0x14eafa=_0x14eafa-0x0;var _0x20cbd3=_0xf41a[_0x14eafa];return _0x20cbd3;};'use strict';var multer=require(_0xaf41('0x0'));var util=require(_0xaf41('0x1'));var path=require('path');var timeout=require(_0xaf41('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaf41('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaf41('0x4'));var config=require(_0xaf41('0x5'));var controller=require(_0xaf41('0x6'));router[_0xaf41('0x7')]('/',auth[_0xaf41('0x8')](),controller[_0xaf41('0x9')]);router[_0xaf41('0x7')](_0xaf41('0xa'),auth[_0xaf41('0x8')](),controller[_0xaf41('0xb')]);router[_0xaf41('0x7')]('/:id',auth[_0xaf41('0x8')](),controller[_0xaf41('0xc')]);router[_0xaf41('0xd')]('/',auth['isAuthenticated'](),controller[_0xaf41('0xe')]);router['put'](_0xaf41('0xf'),auth[_0xaf41('0x8')](),controller[_0xaf41('0x10')]);router[_0xaf41('0x11')]('/:id',auth[_0xaf41('0x8')](),controller[_0xaf41('0x12')]);module[_0xaf41('0x13')]=router; \ No newline at end of file +var _0x01e8=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x21272d,_0x4c9633){var _0xddfffc=function(_0x3e79af){while(--_0x3e79af){_0x21272d['push'](_0x21272d['shift']());}};_0xddfffc(++_0x4c9633);}(_0x01e8,0x120));var _0x801e=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x01e8[_0x3ff4a3];return _0x38676f;};'use strict';var multer=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var path=require('path');var timeout=require(_0x801e('0x2'));var express=require(_0x801e('0x3'));var router=express['Router']();var fs_extra=require(_0x801e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x801e('0x5'));var config=require(_0x801e('0x6'));var controller=require(_0x801e('0x7'));router[_0x801e('0x8')]('/',auth[_0x801e('0x9')](),controller[_0x801e('0xa')]);router[_0x801e('0x8')](_0x801e('0xb'),auth[_0x801e('0x9')](),controller[_0x801e('0xc')]);router[_0x801e('0x8')](_0x801e('0xd'),auth['isAuthenticated'](),controller[_0x801e('0xe')]);router[_0x801e('0xf')]('/',auth[_0x801e('0x9')](),controller[_0x801e('0x10')]);router[_0x801e('0x11')](_0x801e('0xd'),auth[_0x801e('0x9')](),controller[_0x801e('0x12')]);router[_0x801e('0x13')]('/:id',auth[_0x801e('0x9')](),controller[_0x801e('0x14')]);module[_0x801e('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3383bde..3df9eae 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 _0xc09f=['moment','sequelize','STRING','DATE'];(function(_0x24e3a1,_0x3a7096){var _0x3b58cf=function(_0x50242c){while(--_0x50242c){_0x24e3a1['push'](_0x24e3a1['shift']());}};_0x3b58cf(++_0x3a7096);}(_0xc09f,0xe4));var _0xfc09=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0xc09f[_0x17ebb6];return _0x32ec22;};'use strict';var moment=require(_0xfc09('0x0'));var Sequelize=require(_0xfc09('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xfc09('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfc09('0x2')]},'joinAt':{'type':Sequelize[_0xfc09('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc09('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfc09('0x2')]}}; \ No newline at end of file +var _0xb47f=['DATE','moment','sequelize','exports','STRING'];(function(_0x5be689,_0x108b9a){var _0x1b9ec6=function(_0x48f86d){while(--_0x48f86d){_0x5be689['push'](_0x5be689['shift']());}};_0x1b9ec6(++_0x108b9a);}(_0xb47f,0x83));var _0xfb47=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0xb47f[_0x2c944e];return _0x2cc529;};'use strict';var moment=require(_0xfb47('0x0'));var Sequelize=require(_0xfb47('0x1'));module[_0xfb47('0x2')]={'uniqueid':{'type':Sequelize[_0xfb47('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfb47('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfb47('0x4')]},'exitAt':{'type':Sequelize[_0xfb47('0x4')]},'reason':{'type':Sequelize[_0xfb47('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 02133e2..8446a60 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 _0x8439=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','find','catch','body','describe','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model'];(function(_0x2ced4f,_0x3e2bec){var _0x4cf01a=function(_0x1c0a08){while(--_0x1c0a08){_0x2ced4f['push'](_0x2ced4f['shift']());}};_0x4cf01a(++_0x3e2bec);}(_0x8439,0x13d));var _0x9843=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8439[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9843('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9843('0x1'));var moment=require('moment');var BPromise=require(_0x9843('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9843('0x3'));var sox=require(_0x9843('0x4'));var csv=require(_0x9843('0x5'));var ejs=require(_0x9843('0x6'));var fs=require('fs');var fs_extra=require(_0x9843('0x7'));var _=require('lodash');var squel=require(_0x9843('0x8'));var crypto=require('crypto');var jsforce=require(_0x9843('0x9'));var deskjs=require(_0x9843('0xa'));var toCsv=require(_0x9843('0x5'));var querystring=require(_0x9843('0xb'));var Papa=require(_0x9843('0xc'));var Redis=require(_0x9843('0xd'));var authService=require(_0x9843('0xe'));var qs=require(_0x9843('0xf'));var as=require(_0x9843('0x10'));var hardwareService=require(_0x9843('0x11'));var logger=require('../../config/logger')(_0x9843('0x12'));var utils=require(_0x9843('0x13'));var config=require(_0x9843('0x14'));var licenseUtil=require(_0x9843('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x503320,_0x3bb39f){_0x3bb39f=_0x3bb39f||0xcc;return function(_0x32b237){if(_0x32b237){return _0x503320[_0x9843('0x16')](_0x3bb39f);}return _0x503320['status'](_0x3bb39f)[_0x9843('0x17')]();};}function respondWithResult(_0x2ebf93,_0x47ee56){_0x47ee56=_0x47ee56||0xc8;return function(_0x918014){if(_0x918014){return _0x2ebf93[_0x9843('0x18')](_0x47ee56)[_0x9843('0x19')](_0x918014);}};}function respondWithFilteredResult(_0x368202,_0x496f8a){return function(_0x114205){if(_0x114205){var _0x178849=typeof _0x496f8a[_0x9843('0x1a')]===_0x9843('0x1b')&&typeof _0x496f8a[_0x9843('0x1c')]===_0x9843('0x1b');var _0x1eabe5=_0x114205['count'];var _0x59d570=_0x178849?0x0:_0x496f8a[_0x9843('0x1a')];var _0xe7beca=_0x178849?_0x114205[_0x9843('0x1d')]:_0x496f8a[_0x9843('0x1a')]+_0x496f8a[_0x9843('0x1c')];var _0x3974c8;if(_0xe7beca>=_0x1eabe5){_0xe7beca=_0x1eabe5;_0x3974c8=0xc8;}else{_0x3974c8=0xce;}_0x368202[_0x9843('0x18')](_0x3974c8);return _0x368202[_0x9843('0x1e')](_0x9843('0x1f'),_0x59d570+'-'+_0xe7beca+'/'+_0x1eabe5)['json'](_0x114205);}return null;};}function patchUpdates(_0x5e77ae){return function(_0x4b40e2){try{jsonpatch['apply'](_0x4b40e2,_0x5e77ae,!![]);}catch(_0x585ef3){return BPromise[_0x9843('0x20')](_0x585ef3);}return _0x4b40e2[_0x9843('0x21')]();};}function saveUpdates(_0x35eada,_0x19829e){return function(_0x1faebd){if(_0x1faebd){return _0x1faebd[_0x9843('0x22')](_0x35eada)[_0x9843('0x23')](function(_0xfc4850){return _0xfc4850;});}return null;};}function removeEntity(_0x58bee2,_0x49f13e){return function(_0x2c8d7a){if(_0x2c8d7a){return _0x2c8d7a[_0x9843('0x24')]()['then'](function(){_0x58bee2[_0x9843('0x18')](0xcc)[_0x9843('0x17')]();});}};}function handleEntityNotFound(_0x1b40de,_0x3ebcaa){return function(_0x447a32){if(!_0x447a32){_0x1b40de['sendStatus'](0x194);}return _0x447a32;};}function handleError(_0x1b5fa6,_0x1578a9){_0x1578a9=_0x1578a9||0x1f4;return function(_0x25bf60){logger[_0x9843('0x25')](_0x25bf60[_0x9843('0x26')]);if(_0x25bf60[_0x9843('0x27')]){delete _0x25bf60[_0x9843('0x27')];}_0x1b5fa6[_0x9843('0x18')](_0x1578a9)['send'](_0x25bf60);};}exports[_0x9843('0x28')]=function(_0x3fd687,_0x56a713){var _0x23171d={},_0x4b321c={},_0x247844={'count':0x0,'rows':[]};var _0x1a821d=_[_0x9843('0x29')](db[_0x9843('0x2a')][_0x9843('0x2b')],function(_0x1db064){return{'name':_0x1db064[_0x9843('0x2c')],'type':_0x1db064[_0x9843('0x2d')][_0x9843('0x2e')]};});_0x4b321c[_0x9843('0x2f')]=_['map'](_0x1a821d,_0x9843('0x27'));_0x4b321c[_0x9843('0x30')]=_[_0x9843('0x31')](_0x3fd687[_0x9843('0x30')]);_0x4b321c[_0x9843('0x32')]=_[_0x9843('0x33')](_0x4b321c[_0x9843('0x2f')],_0x4b321c['query']);_0x23171d[_0x9843('0x34')]=_[_0x9843('0x33')](_0x4b321c[_0x9843('0x2f')],qs[_0x9843('0x35')](_0x3fd687['query']['fields']));_0x23171d[_0x9843('0x34')]=_0x23171d[_0x9843('0x34')][_0x9843('0x36')]?_0x23171d[_0x9843('0x34')]:_0x4b321c[_0x9843('0x2f')];if(!_0x3fd687[_0x9843('0x30')][_0x9843('0x37')](_0x9843('0x38'))){_0x23171d['limit']=qs[_0x9843('0x1c')](_0x3fd687[_0x9843('0x30')][_0x9843('0x1c')]);_0x23171d['offset']=qs['offset'](_0x3fd687[_0x9843('0x30')]['offset']);}_0x23171d[_0x9843('0x39')]=qs[_0x9843('0x3a')](_0x3fd687['query'][_0x9843('0x3a')]);_0x23171d[_0x9843('0x3b')]=qs['filters'](_['pick'](_0x3fd687['query'],_0x4b321c[_0x9843('0x32')]),_0x1a821d);if(_0x3fd687[_0x9843('0x30')][_0x9843('0x3c')]){_0x23171d[_0x9843('0x3b')]=_[_0x9843('0x3d')](_0x23171d['where'],{'$or':_['map'](_0x1a821d,function(_0x19d4d2){if(_0x19d4d2[_0x9843('0x2d')]!==_0x9843('0x3e')){var _0x5bd997={};_0x5bd997[_0x19d4d2[_0x9843('0x27')]]={'$like':'%'+_0x3fd687[_0x9843('0x30')][_0x9843('0x3c')]+'%'};return _0x5bd997;}})});}_0x23171d=_['merge']({},_0x23171d,_0x3fd687[_0x9843('0x3f')]);var _0x229e34={'where':_0x23171d['where']};return db[_0x9843('0x2a')]['count'](_0x229e34)[_0x9843('0x23')](function(_0x21f86b){_0x247844['count']=_0x21f86b;if(_0x3fd687[_0x9843('0x30')]['includeAll']){_0x23171d['include']=[{'all':!![]}];}return db[_0x9843('0x2a')][_0x9843('0x40')](_0x23171d);})[_0x9843('0x23')](function(_0x596603){_0x247844[_0x9843('0x41')]=_0x596603;return _0x247844;})[_0x9843('0x23')](respondWithFilteredResult(_0x56a713,_0x23171d))['catch'](handleError(_0x56a713,null));};exports[_0x9843('0x42')]=function(_0x4cbc7b,_0x1be9d4){var _0x3f3a0c={'raw':!![],'where':{'id':_0x4cbc7b[_0x9843('0x43')]['id']}},_0x2e17b7={};_0x2e17b7[_0x9843('0x2f')]=_['keys'](db['OpenchannelQueueReport']['rawAttributes']);_0x2e17b7[_0x9843('0x30')]=_['keys'](_0x4cbc7b[_0x9843('0x30')]);_0x2e17b7['filters']=_[_0x9843('0x33')](_0x2e17b7['model'],_0x2e17b7[_0x9843('0x30')]);_0x3f3a0c[_0x9843('0x34')]=_[_0x9843('0x33')](_0x2e17b7[_0x9843('0x2f')],qs[_0x9843('0x35')](_0x4cbc7b['query']['fields']));_0x3f3a0c['attributes']=_0x3f3a0c['attributes']['length']?_0x3f3a0c[_0x9843('0x34')]:_0x2e17b7['model'];if(_0x4cbc7b[_0x9843('0x30')][_0x9843('0x44')]){_0x3f3a0c['include']=[{'all':!![]}];}_0x3f3a0c=_[_0x9843('0x3d')]({},_0x3f3a0c,_0x4cbc7b[_0x9843('0x3f')]);return db[_0x9843('0x2a')][_0x9843('0x45')](_0x3f3a0c)['then'](handleEntityNotFound(_0x1be9d4,null))[_0x9843('0x23')](respondWithResult(_0x1be9d4,null))[_0x9843('0x46')](handleError(_0x1be9d4,null));};exports['create']=function(_0x25df9d,_0x368361){return db[_0x9843('0x2a')]['create'](_0x25df9d[_0x9843('0x47')],{})[_0x9843('0x23')](respondWithResult(_0x368361,0xc9))[_0x9843('0x46')](handleError(_0x368361,null));};exports['update']=function(_0xf8f05,_0xb9befc){if(_0xf8f05[_0x9843('0x47')]['id']){delete _0xf8f05['body']['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0xf8f05[_0x9843('0x43')]['id']}})[_0x9843('0x23')](handleEntityNotFound(_0xb9befc,null))[_0x9843('0x23')](saveUpdates(_0xf8f05[_0x9843('0x47')],null))[_0x9843('0x23')](respondWithResult(_0xb9befc,null))[_0x9843('0x46')](handleError(_0xb9befc,null));};exports[_0x9843('0x24')]=function(_0xcf0624,_0x931a6a){return db[_0x9843('0x2a')][_0x9843('0x45')]({'where':{'id':_0xcf0624[_0x9843('0x43')]['id']}})[_0x9843('0x23')](handleEntityNotFound(_0x931a6a,null))['then'](removeEntity(_0x931a6a,null))[_0x9843('0x46')](handleError(_0x931a6a,null));};exports[_0x9843('0x48')]=function(_0x1d6459,_0x99411c){return db['OpenchannelQueueReport'][_0x9843('0x48')]()[_0x9843('0x23')](respondWithResult(_0x99411c,null))['catch'](handleError(_0x99411c,null));}; \ No newline at end of file +var _0xb78c=['fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','options','includeAll','include','OpenchannelQueueReport','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','index','rawAttributes','key','query','keys','filters','intersection','model'];(function(_0x2b5ee5,_0x3741bf){var _0x1c480b=function(_0x437a18){while(--_0x437a18){_0x2b5ee5['push'](_0x2b5ee5['shift']());}};_0x1c480b(++_0x3741bf);}(_0xb78c,0xaf));var _0xcb78=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0xb78c[_0x131e60];return _0x4bc497;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcb78('0x0'));var jsonpatch=require(_0xcb78('0x1'));var rp=require('request-promise');var moment=require(_0xcb78('0x2'));var BPromise=require(_0xcb78('0x3'));var Mustache=require(_0xcb78('0x4'));var util=require(_0xcb78('0x5'));var path=require(_0xcb78('0x6'));var sox=require('sox');var csv=require(_0xcb78('0x7'));var ejs=require(_0xcb78('0x8'));var fs=require('fs');var fs_extra=require(_0xcb78('0x9'));var _=require(_0xcb78('0xa'));var squel=require(_0xcb78('0xb'));var crypto=require(_0xcb78('0xc'));var jsforce=require(_0xcb78('0xd'));var deskjs=require(_0xcb78('0xe'));var toCsv=require(_0xcb78('0x7'));var querystring=require('querystring');var Papa=require(_0xcb78('0xf'));var Redis=require(_0xcb78('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb78('0x11'));var as=require(_0xcb78('0x12'));var hardwareService=require(_0xcb78('0x13'));var logger=require(_0xcb78('0x14'))(_0xcb78('0x15'));var utils=require('../../config/utils');var config=require(_0xcb78('0x16'));var licenseUtil=require(_0xcb78('0x17'));var db=require(_0xcb78('0x18'))['db'];function respondWithStatusCode(_0x46c24c,_0x127cc9){_0x127cc9=_0x127cc9||0xcc;return function(_0x260188){if(_0x260188){return _0x46c24c[_0xcb78('0x19')](_0x127cc9);}return _0x46c24c[_0xcb78('0x1a')](_0x127cc9)['end']();};}function respondWithResult(_0x2146b,_0x59aa78){_0x59aa78=_0x59aa78||0xc8;return function(_0x3f2f7e){if(_0x3f2f7e){return _0x2146b[_0xcb78('0x1a')](_0x59aa78)[_0xcb78('0x1b')](_0x3f2f7e);}};}function respondWithFilteredResult(_0x274c11,_0xb8603){return function(_0x27c061){if(_0x27c061){var _0x3c773d=typeof _0xb8603[_0xcb78('0x1c')]===_0xcb78('0x1d')&&typeof _0xb8603['limit']===_0xcb78('0x1d');var _0x3913ae=_0x27c061[_0xcb78('0x1e')];var _0xf35f4a=_0x3c773d?0x0:_0xb8603[_0xcb78('0x1c')];var _0x359e36=_0x3c773d?_0x27c061[_0xcb78('0x1e')]:_0xb8603[_0xcb78('0x1c')]+_0xb8603['limit'];var _0x2c0faa;if(_0x359e36>=_0x3913ae){_0x359e36=_0x3913ae;_0x2c0faa=0xc8;}else{_0x2c0faa=0xce;}_0x274c11[_0xcb78('0x1a')](_0x2c0faa);return _0x274c11[_0xcb78('0x1f')](_0xcb78('0x20'),_0xf35f4a+'-'+_0x359e36+'/'+_0x3913ae)[_0xcb78('0x1b')](_0x27c061);}return null;};}function patchUpdates(_0x2bf37d){return function(_0x492d9b){try{jsonpatch[_0xcb78('0x21')](_0x492d9b,_0x2bf37d,!![]);}catch(_0x2caeeb){return BPromise[_0xcb78('0x22')](_0x2caeeb);}return _0x492d9b[_0xcb78('0x23')]();};}function saveUpdates(_0x982711,_0x4bb950){return function(_0x1010c2){if(_0x1010c2){return _0x1010c2[_0xcb78('0x24')](_0x982711)['then'](function(_0x5550f8){return _0x5550f8;});}return null;};}function removeEntity(_0x5428e8,_0x41abca){return function(_0x47d336){if(_0x47d336){return _0x47d336[_0xcb78('0x25')]()[_0xcb78('0x26')](function(){_0x5428e8['status'](0xcc)[_0xcb78('0x27')]();});}};}function handleEntityNotFound(_0x24d5bc,_0x36ae2f){return function(_0x51a469){if(!_0x51a469){_0x24d5bc[_0xcb78('0x19')](0x194);}return _0x51a469;};}function handleError(_0x40b704,_0x30e9a3){_0x30e9a3=_0x30e9a3||0x1f4;return function(_0x342506){logger[_0xcb78('0x28')](_0x342506['stack']);if(_0x342506[_0xcb78('0x29')]){delete _0x342506[_0xcb78('0x29')];}_0x40b704[_0xcb78('0x1a')](_0x30e9a3)['send'](_0x342506);};}exports[_0xcb78('0x2a')]=function(_0xf3fa38,_0x200d02){var _0x3372c2={},_0x13461f={},_0x4d40b3={'count':0x0,'rows':[]};var _0x15f5a6=_['map'](db['OpenchannelQueueReport'][_0xcb78('0x2b')],function(_0x1d555f){return{'name':_0x1d555f['fieldName'],'type':_0x1d555f['type'][_0xcb78('0x2c')]};});_0x13461f['model']=_['map'](_0x15f5a6,_0xcb78('0x29'));_0x13461f[_0xcb78('0x2d')]=_[_0xcb78('0x2e')](_0xf3fa38[_0xcb78('0x2d')]);_0x13461f[_0xcb78('0x2f')]=_[_0xcb78('0x30')](_0x13461f[_0xcb78('0x31')],_0x13461f[_0xcb78('0x2d')]);_0x3372c2['attributes']=_[_0xcb78('0x30')](_0x13461f[_0xcb78('0x31')],qs[_0xcb78('0x32')](_0xf3fa38[_0xcb78('0x2d')]['fields']));_0x3372c2[_0xcb78('0x33')]=_0x3372c2[_0xcb78('0x33')][_0xcb78('0x34')]?_0x3372c2[_0xcb78('0x33')]:_0x13461f[_0xcb78('0x31')];if(!_0xf3fa38[_0xcb78('0x2d')][_0xcb78('0x35')](_0xcb78('0x36'))){_0x3372c2[_0xcb78('0x37')]=qs['limit'](_0xf3fa38[_0xcb78('0x2d')]['limit']);_0x3372c2[_0xcb78('0x1c')]=qs['offset'](_0xf3fa38[_0xcb78('0x2d')]['offset']);}_0x3372c2[_0xcb78('0x38')]=qs[_0xcb78('0x39')](_0xf3fa38[_0xcb78('0x2d')][_0xcb78('0x39')]);_0x3372c2['where']=qs[_0xcb78('0x2f')](_[_0xcb78('0x3a')](_0xf3fa38['query'],_0x13461f['filters']),_0x15f5a6);if(_0xf3fa38[_0xcb78('0x2d')][_0xcb78('0x3b')]){_0x3372c2[_0xcb78('0x3c')]=_[_0xcb78('0x3d')](_0x3372c2[_0xcb78('0x3c')],{'$or':_[_0xcb78('0x3e')](_0x15f5a6,function(_0x59e1dc){if(_0x59e1dc[_0xcb78('0x3f')]!=='VIRTUAL'){var _0x2a2056={};_0x2a2056[_0x59e1dc[_0xcb78('0x29')]]={'$like':'%'+_0xf3fa38[_0xcb78('0x2d')][_0xcb78('0x3b')]+'%'};return _0x2a2056;}})});}_0x3372c2=_[_0xcb78('0x3d')]({},_0x3372c2,_0xf3fa38[_0xcb78('0x40')]);var _0x3532d6={'where':_0x3372c2['where']};return db['OpenchannelQueueReport'][_0xcb78('0x1e')](_0x3532d6)['then'](function(_0x2fcb00){_0x4d40b3[_0xcb78('0x1e')]=_0x2fcb00;if(_0xf3fa38[_0xcb78('0x2d')][_0xcb78('0x41')]){_0x3372c2[_0xcb78('0x42')]=[{'all':!![]}];}return db[_0xcb78('0x43')]['findAll'](_0x3372c2);})[_0xcb78('0x26')](function(_0x616955){_0x4d40b3['rows']=_0x616955;return _0x4d40b3;})[_0xcb78('0x26')](respondWithFilteredResult(_0x200d02,_0x3372c2))[_0xcb78('0x44')](handleError(_0x200d02,null));};exports[_0xcb78('0x45')]=function(_0x3a632b,_0x12c4cb){var _0x4db429={'raw':!![],'where':{'id':_0x3a632b[_0xcb78('0x46')]['id']}},_0x2c2f92={};_0x2c2f92['model']=_[_0xcb78('0x2e')](db[_0xcb78('0x43')][_0xcb78('0x2b')]);_0x2c2f92[_0xcb78('0x2d')]=_['keys'](_0x3a632b[_0xcb78('0x2d')]);_0x2c2f92[_0xcb78('0x2f')]=_['intersection'](_0x2c2f92['model'],_0x2c2f92[_0xcb78('0x2d')]);_0x4db429[_0xcb78('0x33')]=_['intersection'](_0x2c2f92[_0xcb78('0x31')],qs[_0xcb78('0x32')](_0x3a632b['query']['fields']));_0x4db429[_0xcb78('0x33')]=_0x4db429[_0xcb78('0x33')][_0xcb78('0x34')]?_0x4db429[_0xcb78('0x33')]:_0x2c2f92[_0xcb78('0x31')];if(_0x3a632b[_0xcb78('0x2d')][_0xcb78('0x41')]){_0x4db429['include']=[{'all':!![]}];}_0x4db429=_['merge']({},_0x4db429,_0x3a632b[_0xcb78('0x40')]);return db[_0xcb78('0x43')][_0xcb78('0x47')](_0x4db429)[_0xcb78('0x26')](handleEntityNotFound(_0x12c4cb,null))[_0xcb78('0x26')](respondWithResult(_0x12c4cb,null))['catch'](handleError(_0x12c4cb,null));};exports['create']=function(_0x3450ec,_0x4f0d99){return db['OpenchannelQueueReport'][_0xcb78('0x48')](_0x3450ec[_0xcb78('0x49')],{})['then'](respondWithResult(_0x4f0d99,0xc9))['catch'](handleError(_0x4f0d99,null));};exports[_0xcb78('0x24')]=function(_0x485368,_0xe9a5f2){if(_0x485368[_0xcb78('0x49')]['id']){delete _0x485368[_0xcb78('0x49')]['id'];}return db[_0xcb78('0x43')]['find']({'where':{'id':_0x485368[_0xcb78('0x46')]['id']}})[_0xcb78('0x26')](handleEntityNotFound(_0xe9a5f2,null))[_0xcb78('0x26')](saveUpdates(_0x485368[_0xcb78('0x49')],null))['then'](respondWithResult(_0xe9a5f2,null))[_0xcb78('0x44')](handleError(_0xe9a5f2,null));};exports[_0xcb78('0x25')]=function(_0x28cd6c,_0x23e17c){return db[_0xcb78('0x43')][_0xcb78('0x47')]({'where':{'id':_0x28cd6c[_0xcb78('0x46')]['id']}})['then'](handleEntityNotFound(_0x23e17c,null))['then'](removeEntity(_0x23e17c,null))['catch'](handleError(_0x23e17c,null));};exports[_0xcb78('0x4a')]=function(_0x4fd8fe,_0x31e8b9){return db['OpenchannelQueueReport']['describe']()[_0xcb78('0x26')](respondWithResult(_0x31e8b9,null))[_0xcb78('0x44')](handleError(_0x31e8b9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 47c21d4..b764e36 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x1c5278,_0x28e1b6){var _0x320820=function(_0x268763){while(--_0x268763){_0x1c5278['push'](_0x1c5278['shift']());}};_0x320820(++_0x28e1b6);}(_0x1261,0x144));var _0x1126=function(_0x1aac60,_0x2e5ce5){_0x1aac60=_0x1aac60-0x0;var _0x186adf=_0x1261[_0x1aac60];return _0x186adf;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x814b,0x1a2));var _0xb814=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0x814b[_0x1b5a5a];return _0x42b32d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 26a0f9e..5f37277 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 _0x94d4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueueReport,\x20%s,\x20%s','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','then','stringify','UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x94d4,0xa5));var _0x494d=function(_0x35653e,_0x49e23c){_0x35653e=_0x35653e-0x0;var _0x169ed8=_0x94d4[_0x35653e];return _0x169ed8;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var moment=require('moment');var BPromise=require(_0x494d('0x2'));var rs=require(_0x494d('0x3'));var fs=require('fs');var Redis=require(_0x494d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x494d('0x5'));var logger=require(_0x494d('0x6'))(_0x494d('0x7'));var config=require(_0x494d('0x8'));var jayson=require(_0x494d('0x9'));var client=jayson[_0x494d('0xa')][_0x494d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c53d7,_0x4f4576,_0x5269db){return new BPromise(function(_0x396280,_0x3f6b68){return client['request'](_0x4c53d7,_0x5269db)['then'](function(_0x456fe8){logger[_0x494d('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));logger[_0x494d('0xe')](_0x494d('0xf'),_0x4f4576,_0x494d('0xd'),JSON['stringify'](_0x456fe8));if(_0x456fe8[_0x494d('0x10')]){if(_0x456fe8[_0x494d('0x10')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x3f6b68(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x396280(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}else{logger[_0x494d('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));_0x396280(_0x456fe8[_0x494d('0x13')][_0x494d('0x11')]);}})[_0x494d('0x14')](function(_0x120488){logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x120488);_0x3f6b68(_0x120488);});});}exports[_0x494d('0x15')]=function(_0x4301fc){var _0x1552bb=this;return new Promise(function(_0x12a484,_0xd67ea4){return db[_0x494d('0x16')][_0x494d('0x17')](_0x4301fc[_0x494d('0x18')],{'raw':_0x4301fc[_0x494d('0x19')]?_0x4301fc[_0x494d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x494d('0x1a')](function(_0x172763){logger[_0x494d('0xc')](_0x494d('0x15'),_0x4301fc);logger['debug']('CreateOpenchannelQueueReport',_0x4301fc,JSON[_0x494d('0x1b')](_0x172763));_0x12a484(_0x172763);})[_0x494d('0x14')](function(_0x56e992){logger['error'](_0x494d('0x15'),_0x56e992['message'],_0x4301fc);_0xd67ea4(_0x1552bb[_0x494d('0x10')](0x1f4,_0x56e992['message']));});});};exports[_0x494d('0x1c')]=function(_0x29220e){var _0x49120d=this;return new Promise(function(_0x2fdb5b,_0xc107f4){return db[_0x494d('0x16')][_0x494d('0x1d')](_0x29220e[_0x494d('0x18')],{'raw':_0x29220e['options']?_0x29220e[_0x494d('0x19')][_0x494d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29220e['options']?_0x29220e['options'][_0x494d('0x1f')]||null:null,'attributes':_0x29220e[_0x494d('0x19')]?_0x29220e[_0x494d('0x19')][_0x494d('0x20')]||null:null,'limit':_0x29220e[_0x494d('0x19')]?_0x29220e[_0x494d('0x19')][_0x494d('0x21')]||null:null})[_0x494d('0x1a')](function(_0x213939){logger[_0x494d('0xc')](_0x494d('0x1c'),_0x29220e);logger[_0x494d('0xe')](_0x494d('0x1c'),_0x29220e,JSON['stringify'](_0x213939));_0x2fdb5b(_0x213939);})[_0x494d('0x14')](function(_0xa78384){logger[_0x494d('0x10')](_0x494d('0x1c'),_0xa78384[_0x494d('0x11')],_0x29220e);_0xc107f4(_0x49120d[_0x494d('0x10')](0x1f4,_0xa78384[_0x494d('0x11')]));});});}; \ No newline at end of file +var _0x6343=['create','options','CreateOpenchannelQueueReport','stringify','update','body','raw','debug','UpdateOpenchannelQueueReport','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','OpenchannelQueueReport'];(function(_0x24672e,_0x182c59){var _0x5e7c87=function(_0x21208d){while(--_0x21208d){_0x24672e['push'](_0x24672e['shift']());}};_0x5e7c87(++_0x182c59);}(_0x6343,0x168));var _0x3634=function(_0x3296b7,_0x10e661){_0x3296b7=_0x3296b7-0x0;var _0x222d37=_0x6343[_0x3296b7];return _0x222d37;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});}exports['CreateOpenchannelQueueReport']=function(_0x50350d){var _0x2aaac7=this;return new Promise(function(_0x4b2115,_0x2fac8b){return db[_0x3634('0x11')][_0x3634('0x12')](_0x50350d['body'],{'raw':_0x50350d[_0x3634('0x13')]?_0x50350d[_0x3634('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x3634('0x7')](function(_0x506281){logger[_0x3634('0x8')](_0x3634('0x14'),_0x50350d);logger['debug'](_0x3634('0x14'),_0x50350d,JSON[_0x3634('0x15')](_0x506281));_0x4b2115(_0x506281);})[_0x3634('0x10')](function(_0x505026){logger[_0x3634('0xc')](_0x3634('0x14'),_0x505026['message'],_0x50350d);_0x2fac8b(_0x2aaac7[_0x3634('0xc')](0x1f4,_0x505026['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x3a8c41){var _0x862ab5=this;return new Promise(function(_0x5df6fb,_0x1b25be){return db[_0x3634('0x11')][_0x3634('0x16')](_0x3a8c41[_0x3634('0x17')],{'raw':_0x3a8c41[_0x3634('0x13')]?_0x3a8c41[_0x3634('0x13')][_0x3634('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a8c41[_0x3634('0x13')]?_0x3a8c41[_0x3634('0x13')]['where']||null:null,'attributes':_0x3a8c41[_0x3634('0x13')]?_0x3a8c41['options']['attributes']||null:null,'limit':_0x3a8c41['options']?_0x3a8c41[_0x3634('0x13')]['limit']||null:null})[_0x3634('0x7')](function(_0x12b80e){logger['info']('UpdateOpenchannelQueueReport',_0x3a8c41);logger[_0x3634('0x19')]('UpdateOpenchannelQueueReport',_0x3a8c41,JSON[_0x3634('0x15')](_0x12b80e));_0x5df6fb(_0x12b80e);})['catch'](function(_0x1e04cc){logger[_0x3634('0xc')](_0x3634('0x1a'),_0x1e04cc[_0x3634('0xe')],_0x3a8c41);_0x1b25be(_0x862ab5[_0x3634('0xc')](0x1f4,_0x1e04cc[_0x3634('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index da7ec91..d55a939 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 _0x59b0=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x538dd2,_0x553983){var _0x3b7899=function(_0x240153){while(--_0x240153){_0x538dd2['push'](_0x538dd2['shift']());}};_0x3b7899(++_0x553983);}(_0x59b0,0x16f));var _0x059b=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x59b0[_0x276468];return _0x36dc3a;};'use strict';var multer=require(_0x059b('0x0'));var util=require(_0x059b('0x1'));var path=require(_0x059b('0x2'));var timeout=require(_0x059b('0x3'));var express=require(_0x059b('0x4'));var router=express[_0x059b('0x5')]();var fs_extra=require(_0x059b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x059b('0x7'));var config=require('../../config/environment');var controller=require(_0x059b('0x8'));router[_0x059b('0x9')]('/',auth[_0x059b('0xa')](),controller[_0x059b('0xb')]);router[_0x059b('0x9')](_0x059b('0xc'),auth[_0x059b('0xa')](),controller[_0x059b('0xd')]);router['get'](_0x059b('0xe'),auth[_0x059b('0xa')](),controller[_0x059b('0xf')]);router[_0x059b('0x10')]('/',auth[_0x059b('0xa')](),controller[_0x059b('0x11')]);router[_0x059b('0x12')](_0x059b('0xe'),auth[_0x059b('0xa')](),controller[_0x059b('0x13')]);router[_0x059b('0x14')](_0x059b('0xe'),auth[_0x059b('0xa')](),controller[_0x059b('0x15')]);module[_0x059b('0x16')]=router; \ No newline at end of file +var _0x1ce2=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x595e54,_0x57ad10){var _0x2cf240=function(_0x4e5bd5){while(--_0x4e5bd5){_0x595e54['push'](_0x595e54['shift']());}};_0x2cf240(++_0x57ad10);}(_0x1ce2,0x1b8));var _0x21ce=function(_0x54dff0,_0x426b7d){_0x54dff0=_0x54dff0-0x0;var _0x15d7f9=_0x1ce2[_0x54dff0];return _0x15d7f9;};'use strict';var multer=require(_0x21ce('0x0'));var util=require(_0x21ce('0x1'));var path=require('path');var timeout=require(_0x21ce('0x2'));var express=require(_0x21ce('0x3'));var router=express[_0x21ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21ce('0x5'));var interaction=require(_0x21ce('0x6'));var config=require(_0x21ce('0x7'));var controller=require(_0x21ce('0x8'));router[_0x21ce('0x9')]('/',auth[_0x21ce('0xa')](),controller[_0x21ce('0xb')]);router[_0x21ce('0x9')]('/describe',auth[_0x21ce('0xa')](),controller[_0x21ce('0xc')]);router[_0x21ce('0x9')](_0x21ce('0xd'),auth[_0x21ce('0xa')](),controller[_0x21ce('0xe')]);router['post']('/',auth[_0x21ce('0xa')](),controller[_0x21ce('0xf')]);router[_0x21ce('0x10')](_0x21ce('0xd'),auth[_0x21ce('0xa')](),controller[_0x21ce('0x11')]);router[_0x21ce('0x12')](_0x21ce('0xd'),auth[_0x21ce('0xa')](),controller[_0x21ce('0x13')]);module[_0x21ce('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 03ba57e..862a601 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x220c2e,_0x5e2e5d){_0x220c2e=_0x220c2e-0x0;var _0x39a5a5=_0x9bde[_0x220c2e];return _0x39a5a5;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2f7be9,_0x173b28){var _0x22b2ad=function(_0x2f50e4){while(--_0x2f50e4){_0x2f7be9['push'](_0x2f7be9['shift']());}};_0x22b2ad(++_0x173b28);}(_0x54ef,0x112));var _0xf54e=function(_0x4b6591,_0xf8e84){_0x4b6591=_0x4b6591-0x0;var _0x4e7e01=_0x54ef[_0x4b6591];return _0x4e7e01;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b474f8c..36578e9 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 _0xf30e=['apply','reject','update','then','end','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','show','params','fields','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf30e,0xc1));var _0xef30=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xf30e[_0x7a3247];return _0x1bfde5;};'use strict';var emlformat=require(_0xef30('0x0'));var rimraf=require(_0xef30('0x1'));var zipdir=require(_0xef30('0x2'));var jsonpatch=require(_0xef30('0x3'));var rp=require(_0xef30('0x4'));var moment=require(_0xef30('0x5'));var BPromise=require(_0xef30('0x6'));var Mustache=require(_0xef30('0x7'));var util=require(_0xef30('0x8'));var path=require('path');var sox=require(_0xef30('0x9'));var csv=require('to-csv');var ejs=require(_0xef30('0xa'));var fs=require('fs');var fs_extra=require(_0xef30('0xb'));var _=require(_0xef30('0xc'));var squel=require(_0xef30('0xd'));var crypto=require(_0xef30('0xe'));var jsforce=require(_0xef30('0xf'));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(_0xef30('0x10'));var qs=require(_0xef30('0x11'));var as=require(_0xef30('0x12'));var hardwareService=require(_0xef30('0x13'));var logger=require('../../config/logger')(_0xef30('0x14'));var utils=require(_0xef30('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xef30('0x16'));var db=require(_0xef30('0x17'))['db'];function respondWithStatusCode(_0x4ca552,_0x14039a){_0x14039a=_0x14039a||0xcc;return function(_0x151587){if(_0x151587){return _0x4ca552[_0xef30('0x18')](_0x14039a);}return _0x4ca552[_0xef30('0x19')](_0x14039a)['end']();};}function respondWithResult(_0x4aea9c,_0x56369d){_0x56369d=_0x56369d||0xc8;return function(_0x34b5c3){if(_0x34b5c3){return _0x4aea9c[_0xef30('0x19')](_0x56369d)['json'](_0x34b5c3);}};}function respondWithFilteredResult(_0x51b2f6,_0x38bee4){return function(_0x5eea55){if(_0x5eea55){var _0x52e21e=typeof _0x38bee4[_0xef30('0x1a')]===_0xef30('0x1b')&&typeof _0x38bee4['limit']===_0xef30('0x1b');var _0x4da26f=_0x5eea55[_0xef30('0x1c')];var _0x2393c8=_0x52e21e?0x0:_0x38bee4[_0xef30('0x1a')];var _0x52b959=_0x52e21e?_0x5eea55['count']:_0x38bee4['offset']+_0x38bee4[_0xef30('0x1d')];var _0x55cdf2;if(_0x52b959>=_0x4da26f){_0x52b959=_0x4da26f;_0x55cdf2=0xc8;}else{_0x55cdf2=0xce;}_0x51b2f6[_0xef30('0x19')](_0x55cdf2);return _0x51b2f6[_0xef30('0x1e')]('Content-Range',_0x2393c8+'-'+_0x52b959+'/'+_0x4da26f)[_0xef30('0x1f')](_0x5eea55);}return null;};}function patchUpdates(_0x38f439){return function(_0x24eee3){try{jsonpatch[_0xef30('0x20')](_0x24eee3,_0x38f439,!![]);}catch(_0x269533){return BPromise[_0xef30('0x21')](_0x269533);}return _0x24eee3['save']();};}function saveUpdates(_0x5348fe,_0x48dc1f){return function(_0x5e84de){if(_0x5e84de){return _0x5e84de[_0xef30('0x22')](_0x5348fe)[_0xef30('0x23')](function(_0x3e0e1d){return _0x3e0e1d;});}return null;};}function removeEntity(_0x1d0ae9,_0x3f5ff9){return function(_0x369b49){if(_0x369b49){return _0x369b49['destroy']()['then'](function(){_0x1d0ae9['status'](0xcc)[_0xef30('0x24')]();});}};}function handleEntityNotFound(_0x39fbfc,_0x265025){return function(_0x433bc9){if(!_0x433bc9){_0x39fbfc[_0xef30('0x18')](0x194);}return _0x433bc9;};}function handleError(_0x930410,_0x5846f2){_0x5846f2=_0x5846f2||0x1f4;return function(_0x2bdfa7){logger[_0xef30('0x25')](_0x2bdfa7['stack']);if(_0x2bdfa7[_0xef30('0x26')]){delete _0x2bdfa7[_0xef30('0x26')];}_0x930410[_0xef30('0x19')](_0x5846f2)[_0xef30('0x27')](_0x2bdfa7);};}exports['index']=function(_0x338024,_0x371ec9){var _0x1161f8={},_0x551b68={},_0x3d77e7={'count':0x0,'rows':[]};var _0x27fbcf=_[_0xef30('0x28')](db['OpenchannelTransferReport'][_0xef30('0x29')],function(_0x44b932){return{'name':_0x44b932[_0xef30('0x2a')],'type':_0x44b932['type'][_0xef30('0x2b')]};});_0x551b68[_0xef30('0x2c')]=_[_0xef30('0x28')](_0x27fbcf,_0xef30('0x26'));_0x551b68[_0xef30('0x2d')]=_[_0xef30('0x2e')](_0x338024[_0xef30('0x2d')]);_0x551b68[_0xef30('0x2f')]=_[_0xef30('0x30')](_0x551b68[_0xef30('0x2c')],_0x551b68[_0xef30('0x2d')]);_0x1161f8[_0xef30('0x31')]=_[_0xef30('0x30')](_0x551b68[_0xef30('0x2c')],qs['fields'](_0x338024[_0xef30('0x2d')]['fields']));_0x1161f8[_0xef30('0x31')]=_0x1161f8[_0xef30('0x31')][_0xef30('0x32')]?_0x1161f8[_0xef30('0x31')]:_0x551b68[_0xef30('0x2c')];if(!_0x338024[_0xef30('0x2d')][_0xef30('0x33')](_0xef30('0x34'))){_0x1161f8[_0xef30('0x1d')]=qs['limit'](_0x338024[_0xef30('0x2d')][_0xef30('0x1d')]);_0x1161f8[_0xef30('0x1a')]=qs[_0xef30('0x1a')](_0x338024[_0xef30('0x2d')][_0xef30('0x1a')]);}_0x1161f8[_0xef30('0x35')]=qs['sort'](_0x338024[_0xef30('0x2d')][_0xef30('0x36')]);_0x1161f8['where']=qs[_0xef30('0x2f')](_[_0xef30('0x37')](_0x338024[_0xef30('0x2d')],_0x551b68['filters']),_0x27fbcf);if(_0x338024[_0xef30('0x2d')]['filter']){_0x1161f8[_0xef30('0x38')]=_[_0xef30('0x39')](_0x1161f8[_0xef30('0x38')],{'$or':_[_0xef30('0x28')](_0x27fbcf,function(_0x1923f4){if(_0x1923f4[_0xef30('0x3a')]!==_0xef30('0x3b')){var _0x4d9d8f={};_0x4d9d8f[_0x1923f4[_0xef30('0x26')]]={'$like':'%'+_0x338024[_0xef30('0x2d')]['filter']+'%'};return _0x4d9d8f;}})});}_0x1161f8=_['merge']({},_0x1161f8,_0x338024[_0xef30('0x3c')]);var _0x2bbd7d={'where':_0x1161f8[_0xef30('0x38')]};return db[_0xef30('0x3d')][_0xef30('0x1c')](_0x2bbd7d)[_0xef30('0x23')](function(_0x3aba58){_0x3d77e7[_0xef30('0x1c')]=_0x3aba58;if(_0x338024[_0xef30('0x2d')][_0xef30('0x3e')]){_0x1161f8[_0xef30('0x3f')]=[{'all':!![]}];}return db[_0xef30('0x3d')][_0xef30('0x40')](_0x1161f8);})[_0xef30('0x23')](function(_0x155337){_0x3d77e7[_0xef30('0x41')]=_0x155337;return _0x3d77e7;})[_0xef30('0x23')](respondWithFilteredResult(_0x371ec9,_0x1161f8))['catch'](handleError(_0x371ec9,null));};exports[_0xef30('0x42')]=function(_0x30cc05,_0x4ba4cd){var _0x16b78a={'raw':!![],'where':{'id':_0x30cc05[_0xef30('0x43')]['id']}},_0x34d9b9={};_0x34d9b9['model']=_[_0xef30('0x2e')](db[_0xef30('0x3d')][_0xef30('0x29')]);_0x34d9b9['query']=_['keys'](_0x30cc05['query']);_0x34d9b9[_0xef30('0x2f')]=_[_0xef30('0x30')](_0x34d9b9[_0xef30('0x2c')],_0x34d9b9[_0xef30('0x2d')]);_0x16b78a[_0xef30('0x31')]=_['intersection'](_0x34d9b9[_0xef30('0x2c')],qs[_0xef30('0x44')](_0x30cc05['query']['fields']));_0x16b78a['attributes']=_0x16b78a[_0xef30('0x31')][_0xef30('0x32')]?_0x16b78a['attributes']:_0x34d9b9[_0xef30('0x2c')];if(_0x30cc05[_0xef30('0x2d')][_0xef30('0x3e')]){_0x16b78a['include']=[{'all':!![]}];}_0x16b78a=_[_0xef30('0x39')]({},_0x16b78a,_0x30cc05[_0xef30('0x3c')]);return db[_0xef30('0x3d')][_0xef30('0x45')](_0x16b78a)['then'](handleEntityNotFound(_0x4ba4cd,null))[_0xef30('0x23')](respondWithResult(_0x4ba4cd,null))['catch'](handleError(_0x4ba4cd,null));};exports['create']=function(_0x2ebfd3,_0x31bbd6){return db[_0xef30('0x3d')][_0xef30('0x46')](_0x2ebfd3['body'],{})['then'](respondWithResult(_0x31bbd6,0xc9))['catch'](handleError(_0x31bbd6,null));};exports[_0xef30('0x22')]=function(_0x4d882d,_0x2933dd){if(_0x4d882d[_0xef30('0x47')]['id']){delete _0x4d882d[_0xef30('0x47')]['id'];}return db[_0xef30('0x3d')][_0xef30('0x45')]({'where':{'id':_0x4d882d[_0xef30('0x43')]['id']}})[_0xef30('0x23')](handleEntityNotFound(_0x2933dd,null))['then'](saveUpdates(_0x4d882d[_0xef30('0x47')],null))[_0xef30('0x23')](respondWithResult(_0x2933dd,null))[_0xef30('0x48')](handleError(_0x2933dd,null));};exports[_0xef30('0x49')]=function(_0x2753a5,_0x3ca73a){return db[_0xef30('0x3d')]['find']({'where':{'id':_0x2753a5[_0xef30('0x43')]['id']}})[_0xef30('0x23')](handleEntityNotFound(_0x3ca73a,null))[_0xef30('0x23')](removeEntity(_0x3ca73a,null))[_0xef30('0x48')](handleError(_0x3ca73a,null));};exports[_0xef30('0x4a')]=function(_0x149b5a,_0x564e3e){return db[_0xef30('0x3d')][_0xef30('0x4a')]()[_0xef30('0x23')](respondWithResult(_0x564e3e,null))['catch'](handleError(_0x564e3e,null));}; \ No newline at end of file +var _0xbf3c=['intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','filters','attributes'];(function(_0x33d615,_0x1a5af7){var _0x254611=function(_0x23c410){while(--_0x23c410){_0x33d615['push'](_0x33d615['shift']());}};_0x254611(++_0x1a5af7);}(_0xbf3c,0x163));var _0xcbf3=function(_0x404f0e,_0x1aa8aa){_0x404f0e=_0x404f0e-0x0;var _0x33f0a2=_0xbf3c[_0x404f0e];return _0x33f0a2;};'use strict';var emlformat=require(_0xcbf3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcbf3('0x1'));var jsonpatch=require(_0xcbf3('0x2'));var rp=require(_0xcbf3('0x3'));var moment=require(_0xcbf3('0x4'));var BPromise=require(_0xcbf3('0x5'));var Mustache=require('mustache');var util=require(_0xcbf3('0x6'));var path=require(_0xcbf3('0x7'));var sox=require(_0xcbf3('0x8'));var csv=require('to-csv');var ejs=require(_0xcbf3('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf3('0xa'));var _=require(_0xcbf3('0xb'));var squel=require(_0xcbf3('0xc'));var crypto=require(_0xcbf3('0xd'));var jsforce=require(_0xcbf3('0xe'));var deskjs=require(_0xcbf3('0xf'));var toCsv=require(_0xcbf3('0x10'));var querystring=require(_0xcbf3('0x11'));var Papa=require(_0xcbf3('0x12'));var Redis=require(_0xcbf3('0x13'));var authService=require(_0xcbf3('0x14'));var qs=require(_0xcbf3('0x15'));var as=require(_0xcbf3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbf3('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xcbf3('0x18'));var licenseUtil=require(_0xcbf3('0x19'));var db=require(_0xcbf3('0x1a'))['db'];function respondWithStatusCode(_0x3c5ce6,_0x12cc33){_0x12cc33=_0x12cc33||0xcc;return function(_0x3026e3){if(_0x3026e3){return _0x3c5ce6[_0xcbf3('0x1b')](_0x12cc33);}return _0x3c5ce6[_0xcbf3('0x1c')](_0x12cc33)[_0xcbf3('0x1d')]();};}function respondWithResult(_0x560e26,_0x429899){_0x429899=_0x429899||0xc8;return function(_0x2c48e0){if(_0x2c48e0){return _0x560e26['status'](_0x429899)[_0xcbf3('0x1e')](_0x2c48e0);}};}function respondWithFilteredResult(_0x42ea53,_0x5871fc){return function(_0x5d692e){if(_0x5d692e){var _0x2402e1=typeof _0x5871fc[_0xcbf3('0x1f')]==='undefined'&&typeof _0x5871fc[_0xcbf3('0x20')]===_0xcbf3('0x21');var _0x26b1da=_0x5d692e[_0xcbf3('0x22')];var _0xa68f9=_0x2402e1?0x0:_0x5871fc[_0xcbf3('0x1f')];var _0x19cb22=_0x2402e1?_0x5d692e[_0xcbf3('0x22')]:_0x5871fc[_0xcbf3('0x1f')]+_0x5871fc['limit'];var _0x56e5a1;if(_0x19cb22>=_0x26b1da){_0x19cb22=_0x26b1da;_0x56e5a1=0xc8;}else{_0x56e5a1=0xce;}_0x42ea53[_0xcbf3('0x1c')](_0x56e5a1);return _0x42ea53[_0xcbf3('0x23')](_0xcbf3('0x24'),_0xa68f9+'-'+_0x19cb22+'/'+_0x26b1da)[_0xcbf3('0x1e')](_0x5d692e);}return null;};}function patchUpdates(_0x2cadf5){return function(_0x35679a){try{jsonpatch[_0xcbf3('0x25')](_0x35679a,_0x2cadf5,!![]);}catch(_0x3e9702){return BPromise[_0xcbf3('0x26')](_0x3e9702);}return _0x35679a[_0xcbf3('0x27')]();};}function saveUpdates(_0x313fe2,_0x28946a){return function(_0x4b456c){if(_0x4b456c){return _0x4b456c[_0xcbf3('0x28')](_0x313fe2)[_0xcbf3('0x29')](function(_0x25a3e7){return _0x25a3e7;});}return null;};}function removeEntity(_0x1fe1fe,_0x4ab66d){return function(_0x35b4bb){if(_0x35b4bb){return _0x35b4bb[_0xcbf3('0x2a')]()['then'](function(){_0x1fe1fe[_0xcbf3('0x1c')](0xcc)[_0xcbf3('0x1d')]();});}};}function handleEntityNotFound(_0x3f207f,_0x535cd7){return function(_0x3bd871){if(!_0x3bd871){_0x3f207f[_0xcbf3('0x1b')](0x194);}return _0x3bd871;};}function handleError(_0x578b2b,_0x5ddb25){_0x5ddb25=_0x5ddb25||0x1f4;return function(_0x5ab302){logger[_0xcbf3('0x2b')](_0x5ab302[_0xcbf3('0x2c')]);if(_0x5ab302[_0xcbf3('0x2d')]){delete _0x5ab302[_0xcbf3('0x2d')];}_0x578b2b[_0xcbf3('0x1c')](_0x5ddb25)[_0xcbf3('0x2e')](_0x5ab302);};}exports['index']=function(_0x4d9271,_0x453a70){var _0x4373c0={},_0x7f37f2={},_0x53c60e={'count':0x0,'rows':[]};var _0x42517a=_[_0xcbf3('0x2f')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x7a30d){return{'name':_0x7a30d[_0xcbf3('0x30')],'type':_0x7a30d[_0xcbf3('0x31')][_0xcbf3('0x32')]};});_0x7f37f2[_0xcbf3('0x33')]=_['map'](_0x42517a,_0xcbf3('0x2d'));_0x7f37f2[_0xcbf3('0x34')]=_['keys'](_0x4d9271[_0xcbf3('0x34')]);_0x7f37f2[_0xcbf3('0x35')]=_['intersection'](_0x7f37f2[_0xcbf3('0x33')],_0x7f37f2[_0xcbf3('0x34')]);_0x4373c0[_0xcbf3('0x36')]=_[_0xcbf3('0x37')](_0x7f37f2[_0xcbf3('0x33')],qs['fields'](_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x38')]));_0x4373c0[_0xcbf3('0x36')]=_0x4373c0[_0xcbf3('0x36')]['length']?_0x4373c0[_0xcbf3('0x36')]:_0x7f37f2[_0xcbf3('0x33')];if(!_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x39')](_0xcbf3('0x3a'))){_0x4373c0[_0xcbf3('0x20')]=qs[_0xcbf3('0x20')](_0x4d9271[_0xcbf3('0x34')]['limit']);_0x4373c0[_0xcbf3('0x1f')]=qs[_0xcbf3('0x1f')](_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x1f')]);}_0x4373c0[_0xcbf3('0x3b')]=qs[_0xcbf3('0x3c')](_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x3c')]);_0x4373c0['where']=qs['filters'](_[_0xcbf3('0x3d')](_0x4d9271[_0xcbf3('0x34')],_0x7f37f2['filters']),_0x42517a);if(_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x3e')]){_0x4373c0[_0xcbf3('0x3f')]=_[_0xcbf3('0x40')](_0x4373c0[_0xcbf3('0x3f')],{'$or':_[_0xcbf3('0x2f')](_0x42517a,function(_0x5a5416){if(_0x5a5416[_0xcbf3('0x31')]!==_0xcbf3('0x41')){var _0x337e00={};_0x337e00[_0x5a5416[_0xcbf3('0x2d')]]={'$like':'%'+_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x3e')]+'%'};return _0x337e00;}})});}_0x4373c0=_['merge']({},_0x4373c0,_0x4d9271[_0xcbf3('0x42')]);var _0x40cd38={'where':_0x4373c0[_0xcbf3('0x3f')]};return db[_0xcbf3('0x43')][_0xcbf3('0x22')](_0x40cd38)['then'](function(_0x2baa24){_0x53c60e['count']=_0x2baa24;if(_0x4d9271[_0xcbf3('0x34')][_0xcbf3('0x44')]){_0x4373c0[_0xcbf3('0x45')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xcbf3('0x46')](_0x4373c0);})[_0xcbf3('0x29')](function(_0xb3fb){_0x53c60e[_0xcbf3('0x47')]=_0xb3fb;return _0x53c60e;})[_0xcbf3('0x29')](respondWithFilteredResult(_0x453a70,_0x4373c0))[_0xcbf3('0x48')](handleError(_0x453a70,null));};exports[_0xcbf3('0x49')]=function(_0x2e7f74,_0x2cac2e){var _0x4af3dc={'raw':!![],'where':{'id':_0x2e7f74[_0xcbf3('0x4a')]['id']}},_0x160de3={};_0x160de3['model']=_['keys'](db[_0xcbf3('0x43')][_0xcbf3('0x4b')]);_0x160de3['query']=_[_0xcbf3('0x4c')](_0x2e7f74['query']);_0x160de3[_0xcbf3('0x35')]=_[_0xcbf3('0x37')](_0x160de3['model'],_0x160de3[_0xcbf3('0x34')]);_0x4af3dc[_0xcbf3('0x36')]=_[_0xcbf3('0x37')](_0x160de3[_0xcbf3('0x33')],qs[_0xcbf3('0x38')](_0x2e7f74['query'][_0xcbf3('0x38')]));_0x4af3dc['attributes']=_0x4af3dc[_0xcbf3('0x36')][_0xcbf3('0x4d')]?_0x4af3dc[_0xcbf3('0x36')]:_0x160de3[_0xcbf3('0x33')];if(_0x2e7f74[_0xcbf3('0x34')][_0xcbf3('0x44')]){_0x4af3dc[_0xcbf3('0x45')]=[{'all':!![]}];}_0x4af3dc=_[_0xcbf3('0x40')]({},_0x4af3dc,_0x2e7f74[_0xcbf3('0x42')]);return db[_0xcbf3('0x43')][_0xcbf3('0x4e')](_0x4af3dc)[_0xcbf3('0x29')](handleEntityNotFound(_0x2cac2e,null))[_0xcbf3('0x29')](respondWithResult(_0x2cac2e,null))['catch'](handleError(_0x2cac2e,null));};exports[_0xcbf3('0x4f')]=function(_0x5cd7ec,_0x499df2){return db['OpenchannelTransferReport']['create'](_0x5cd7ec[_0xcbf3('0x50')],{})[_0xcbf3('0x29')](respondWithResult(_0x499df2,0xc9))[_0xcbf3('0x48')](handleError(_0x499df2,null));};exports[_0xcbf3('0x28')]=function(_0x280b71,_0x46dd61){if(_0x280b71[_0xcbf3('0x50')]['id']){delete _0x280b71[_0xcbf3('0x50')]['id'];}return db['OpenchannelTransferReport'][_0xcbf3('0x4e')]({'where':{'id':_0x280b71[_0xcbf3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46dd61,null))[_0xcbf3('0x29')](saveUpdates(_0x280b71[_0xcbf3('0x50')],null))['then'](respondWithResult(_0x46dd61,null))[_0xcbf3('0x48')](handleError(_0x46dd61,null));};exports[_0xcbf3('0x2a')]=function(_0x3aee8e,_0x18edfd){return db[_0xcbf3('0x43')][_0xcbf3('0x4e')]({'where':{'id':_0x3aee8e['params']['id']}})[_0xcbf3('0x29')](handleEntityNotFound(_0x18edfd,null))['then'](removeEntity(_0x18edfd,null))[_0xcbf3('0x48')](handleError(_0x18edfd,null));};exports[_0xcbf3('0x51')]=function(_0x10afe3,_0x4f1bcb){return db['OpenchannelTransferReport']['describe']()[_0xcbf3('0x29')](respondWithResult(_0x4f1bcb,null))[_0xcbf3('0x48')](handleError(_0x4f1bcb,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 09e1cc1..8a623be 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 _0xed4d=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','./openchannelTransferReport.attributes','OpenchannelTransferReport'];(function(_0xf738ad,_0x5e1d7f){var _0x598570=function(_0x35088e){while(--_0x35088e){_0xf738ad['push'](_0xf738ad['shift']());}};_0x598570(++_0x5e1d7f);}(_0xed4d,0xb6));var _0xded4=function(_0x37c541,_0x13c53a){_0x37c541=_0x37c541-0x0;var _0x5321d8=_0xed4d[_0x37c541];return _0x5321d8;};'use strict';var _=require(_0xded4('0x0'));var util=require(_0xded4('0x1'));var logger=require(_0xded4('0x2'))('api');var moment=require(_0xded4('0x3'));var BPromise=require('bluebird');var rp=require(_0xded4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xded4('0x5'));module['exports']=function(_0x55fba3,_0x511e11){return _0x55fba3['define'](_0xded4('0x6'),attributes,{'tableName':_0xded4('0x7'),'paranoid':![],'indexes':[{'name':_0xded4('0x8'),'fields':[_0xded4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2ca=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x535ba2,_0x11eec9){var _0x284cec=function(_0x41ded2){while(--_0x41ded2){_0x535ba2['push'](_0x535ba2['shift']());}};_0x284cec(++_0x11eec9);}(_0xe2ca,0xc6));var _0xae2c=function(_0x49a977,_0x2d1a58){_0x49a977=_0x49a977-0x0;var _0x2a9017=_0xe2ca[_0x49a977];return _0x2a9017;};'use strict';var _=require('lodash');var util=require(_0xae2c('0x0'));var logger=require(_0xae2c('0x1'))(_0xae2c('0x2'));var moment=require('moment');var BPromise=require(_0xae2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xae2c('0x4'));var config=require(_0xae2c('0x5'));var attributes=require(_0xae2c('0x6'));module[_0xae2c('0x7')]=function(_0x5eb851,_0x26ad12){return _0x5eb851[_0xae2c('0x8')](_0xae2c('0x9'),attributes,{'tableName':_0xae2c('0xa'),'paranoid':![],'indexes':[{'name':_0xae2c('0xb'),'fields':[_0xae2c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 72867da..29a54ba 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 _0x85d0=['../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2b2191,_0x1a52aa){var _0x390958=function(_0x588440){while(--_0x588440){_0x2b2191['push'](_0x2b2191['shift']());}};_0x390958(++_0x1a52aa);}(_0x85d0,0x164));var _0x085d=function(_0x427d22,_0x59de4d){_0x427d22=_0x427d22-0x0;var _0x5450c6=_0x85d0[_0x427d22];return _0x5450c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x085d('0x0'));var fs=require('fs');var Redis=require(_0x085d('0x1'));var db=require(_0x085d('0x2'))['db'];var utils=require(_0x085d('0x3'));var logger=require(_0x085d('0x4'))(_0x085d('0x5'));var config=require('../../config/environment');var jayson=require(_0x085d('0x6'));var client=jayson['client'][_0x085d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9acc97,_0x2a6902,_0x4a12b7){return new BPromise(function(_0xf65d01,_0xa94124){return client[_0x085d('0x8')](_0x9acc97,_0x4a12b7)[_0x085d('0x9')](function(_0x349271){logger[_0x085d('0xa')](_0x085d('0xb'),_0x2a6902,_0x085d('0xc'));logger[_0x085d('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2a6902,_0x085d('0xc'),JSON[_0x085d('0xe')](_0x349271));if(_0x349271[_0x085d('0xf')]){if(_0x349271[_0x085d('0xf')]['code']===0x1f4){logger[_0x085d('0xf')](_0x085d('0xb'),_0x2a6902,_0x349271['error'][_0x085d('0x10')]);return _0xa94124(_0x349271[_0x085d('0xf')][_0x085d('0x10')]);}logger[_0x085d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2a6902,_0x349271[_0x085d('0xf')][_0x085d('0x10')]);return _0xf65d01(_0x349271['error']['message']);}else{logger[_0x085d('0xa')](_0x085d('0xb'),_0x2a6902,_0x085d('0xc'));_0xf65d01(_0x349271[_0x085d('0x11')][_0x085d('0x10')]);}})['catch'](function(_0x2b29be){logger[_0x085d('0xf')](_0x085d('0xb'),_0x2a6902,_0x2b29be);_0xa94124(_0x2b29be);});});} \ No newline at end of file +var _0xaa5c=['client','http','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','../../config/logger','jayson/promise'];(function(_0x32f5e8,_0x42f1e9){var _0x8e657=function(_0x1b81ec){while(--_0x1b81ec){_0x32f5e8['push'](_0x32f5e8['shift']());}};_0x8e657(++_0x42f1e9);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x299f57,_0xe6d596){_0x299f57=_0x299f57-0x0;var _0x502035=_0xaa5c[_0x299f57];return _0x502035;};'use strict';var _=require(_0xcaa5('0x0'));var util=require(_0xcaa5('0x1'));var moment=require(_0xcaa5('0x2'));var BPromise=require(_0xcaa5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcaa5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcaa5('0x5'));var client=jayson[_0xcaa5('0x6')][_0xcaa5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f56bc,_0x3d0a81,_0x24edf5){return new BPromise(function(_0xb27ac1,_0x1b8683){return client['request'](_0x5f56bc,_0x24edf5)[_0xcaa5('0x8')](function(_0x11b4d1){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d0a81,_0xcaa5('0x9'));logger[_0xcaa5('0xa')](_0xcaa5('0xb'),_0x3d0a81,'request\x20sent',JSON[_0xcaa5('0xc')](_0x11b4d1));if(_0x11b4d1['error']){if(_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0xe')]===0x1f4){logger[_0xcaa5('0xd')](_0xcaa5('0xf'),_0x3d0a81,_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);return _0x1b8683(_0x11b4d1[_0xcaa5('0xd')]['message']);}logger[_0xcaa5('0xd')](_0xcaa5('0xf'),_0x3d0a81,_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);return _0xb27ac1(_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);}else{logger[_0xcaa5('0x11')](_0xcaa5('0xf'),_0x3d0a81,_0xcaa5('0x9'));_0xb27ac1(_0x11b4d1['result'][_0xcaa5('0x10')]);}})['catch'](function(_0x17e3d2){logger[_0xcaa5('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d0a81,_0x17e3d2);_0x1b8683(_0x17e3d2);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index bb83de4..781d578 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 _0x15ac=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x373222,_0x5a4d08){var _0x10f86e=function(_0x49f448){while(--_0x49f448){_0x373222['push'](_0x373222['shift']());}};_0x10f86e(++_0x5a4d08);}(_0x15ac,0x68));var _0xc15a=function(_0x40a9c5,_0x10af6a){_0x40a9c5=_0x40a9c5-0x0;var _0x4ab17d=_0x15ac[_0x40a9c5];return _0x4ab17d;};'use strict';var multer=require(_0xc15a('0x0'));var util=require(_0xc15a('0x1'));var path=require(_0xc15a('0x2'));var timeout=require(_0xc15a('0x3'));var express=require(_0xc15a('0x4'));var router=express[_0xc15a('0x5')]();var fs_extra=require(_0xc15a('0x6'));var auth=require(_0xc15a('0x7'));var interaction=require(_0xc15a('0x8'));var config=require(_0xc15a('0x9'));var controller=require(_0xc15a('0xa'));router[_0xc15a('0xb')]('/',auth[_0xc15a('0xc')](),controller[_0xc15a('0xd')]);router[_0xc15a('0xb')](_0xc15a('0xe'),auth[_0xc15a('0xc')](),controller[_0xc15a('0xf')]);router[_0xc15a('0x10')]('/',auth[_0xc15a('0xc')](),controller[_0xc15a('0x11')]);router['put']('/:id',auth[_0xc15a('0xc')](),controller[_0xc15a('0x12')]);router[_0xc15a('0x13')](_0xc15a('0xe'),auth[_0xc15a('0xc')](),controller[_0xc15a('0x14')]);module[_0xc15a('0x15')]=router; \ No newline at end of file +var _0x7d69=['show','create','/:id','update','destroy','exports','multer','util','connect-timeout','fs-extra','./pause.controller','isAuthenticated','get'];(function(_0x2d8830,_0x44d528){var _0x4f0b60=function(_0x218774){while(--_0x218774){_0x2d8830['push'](_0x2d8830['shift']());}};_0x4f0b60(++_0x44d528);}(_0x7d69,0xf0));var _0x97d6=function(_0x1ac862,_0x5e2002){_0x1ac862=_0x1ac862-0x0;var _0x4d6b2f=_0x7d69[_0x1ac862];return _0x4d6b2f;};'use strict';var multer=require(_0x97d6('0x0'));var util=require(_0x97d6('0x1'));var path=require('path');var timeout=require(_0x97d6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x97d6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97d6('0x4'));router['get']('/',auth[_0x97d6('0x5')](),controller['index']);router[_0x97d6('0x6')]('/:id',auth[_0x97d6('0x5')](),controller[_0x97d6('0x7')]);router['post']('/',auth[_0x97d6('0x5')](),controller[_0x97d6('0x8')]);router['put'](_0x97d6('0x9'),auth[_0x97d6('0x5')](),controller[_0x97d6('0xa')]);router['delete'](_0x97d6('0x9'),auth[_0x97d6('0x5')](),controller[_0x97d6('0xb')]);module[_0x97d6('0xc')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6597f82..12dbeb9 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 _0xecb2=['name','sequelize','exports','STRING'];(function(_0x15aa6b,_0x2de48c){var _0x61e8=function(_0x21df49){while(--_0x21df49){_0x15aa6b['push'](_0x15aa6b['shift']());}};_0x61e8(++_0x2de48c);}(_0xecb2,0xa5));var _0x2ecb=function(_0xbcf41e,_0x2d0f39){_0xbcf41e=_0xbcf41e-0x0;var _0x5675ce=_0xecb2[_0xbcf41e];return _0x5675ce;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module[_0x2ecb('0x1')]={'name':{'type':Sequelize[_0x2ecb('0x2')],'unique':_0x2ecb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2ecb('0x2')]}}; \ No newline at end of file +var _0x5461=['sequelize','exports','name'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x5461,0x10b));var _0x1546=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x5461[_0x273dc5];return _0x46dae7;};'use strict';var Sequelize=require(_0x1546('0x0'));module[_0x1546('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1546('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d2548e9..ded7bda 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 _0x1a66=['include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x4b2667,_0x53659c){var _0x3ba2f7=function(_0x1cb2e6){while(--_0x1cb2e6){_0x4b2667['push'](_0x4b2667['shift']());}};_0x3ba2f7(++_0x53659c);}(_0x1a66,0x69));var _0x61a6=function(_0x5241a8,_0x32fa8e){_0x5241a8=_0x5241a8-0x0;var _0x4563f3=_0x1a66[_0x5241a8];return _0x4563f3;};'use strict';var emlformat=require(_0x61a6('0x0'));var rimraf=require(_0x61a6('0x1'));var zipdir=require(_0x61a6('0x2'));var jsonpatch=require(_0x61a6('0x3'));var rp=require('request-promise');var moment=require(_0x61a6('0x4'));var BPromise=require(_0x61a6('0x5'));var Mustache=require(_0x61a6('0x6'));var util=require('util');var path=require(_0x61a6('0x7'));var sox=require(_0x61a6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61a6('0x9'));var _=require(_0x61a6('0xa'));var squel=require(_0x61a6('0xb'));var crypto=require(_0x61a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x61a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x61a6('0xe'));var Papa=require(_0x61a6('0xf'));var Redis=require(_0x61a6('0x10'));var authService=require(_0x61a6('0x11'));var qs=require(_0x61a6('0x12'));var as=require(_0x61a6('0x13'));var hardwareService=require(_0x61a6('0x14'));var logger=require(_0x61a6('0x15'))(_0x61a6('0x16'));var utils=require(_0x61a6('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x61a6('0x18'))['db'];function respondWithStatusCode(_0x2e4185,_0x5a7a19){_0x5a7a19=_0x5a7a19||0xcc;return function(_0x4231ff){if(_0x4231ff){return _0x2e4185[_0x61a6('0x19')](_0x5a7a19);}return _0x2e4185[_0x61a6('0x1a')](_0x5a7a19)[_0x61a6('0x1b')]();};}function respondWithResult(_0x7ebd42,_0x128372){_0x128372=_0x128372||0xc8;return function(_0x5683ac){if(_0x5683ac){return _0x7ebd42[_0x61a6('0x1a')](_0x128372)[_0x61a6('0x1c')](_0x5683ac);}};}function respondWithFilteredResult(_0x483533,_0x228ef2){return function(_0x22cbc1){if(_0x22cbc1){var _0x11fa91=typeof _0x228ef2[_0x61a6('0x1d')]===_0x61a6('0x1e')&&typeof _0x228ef2['limit']===_0x61a6('0x1e');var _0x586273=_0x22cbc1['count'];var _0x35492f=_0x11fa91?0x0:_0x228ef2[_0x61a6('0x1d')];var _0x26700b=_0x11fa91?_0x22cbc1[_0x61a6('0x1f')]:_0x228ef2[_0x61a6('0x1d')]+_0x228ef2[_0x61a6('0x20')];var _0x564c97;if(_0x26700b>=_0x586273){_0x26700b=_0x586273;_0x564c97=0xc8;}else{_0x564c97=0xce;}_0x483533['status'](_0x564c97);return _0x483533[_0x61a6('0x21')](_0x61a6('0x22'),_0x35492f+'-'+_0x26700b+'/'+_0x586273)[_0x61a6('0x1c')](_0x22cbc1);}return null;};}function patchUpdates(_0x15d073){return function(_0x302db8){try{jsonpatch['apply'](_0x302db8,_0x15d073,!![]);}catch(_0x1aa014){return BPromise[_0x61a6('0x23')](_0x1aa014);}return _0x302db8[_0x61a6('0x24')]();};}function saveUpdates(_0x44a922,_0x3b8169){return function(_0x5ecb67){if(_0x5ecb67){return _0x5ecb67[_0x61a6('0x25')](_0x44a922)[_0x61a6('0x26')](function(_0x2e0702){return _0x2e0702;});}return null;};}function removeEntity(_0x33ddc9,_0x33c967){return function(_0x57176f){if(_0x57176f){return _0x57176f[_0x61a6('0x27')]()[_0x61a6('0x26')](function(){var _0x5ced58=_0x57176f[_0x61a6('0x28')]({'plain':!![]});var _0x4608fa='Pauses';return db[_0x61a6('0x29')]['destroy']({'where':{'type':_0x4608fa,'resourceId':_0x5ced58['id']}})['then'](function(){return _0x57176f;});})[_0x61a6('0x26')](function(){_0x33ddc9[_0x61a6('0x1a')](0xcc)[_0x61a6('0x1b')]();});}};}function handleEntityNotFound(_0x5e7c81,_0x5aa35f){return function(_0x40c1d5){if(!_0x40c1d5){_0x5e7c81['sendStatus'](0x194);}return _0x40c1d5;};}function handleError(_0x51ce79,_0x20c019){_0x20c019=_0x20c019||0x1f4;return function(_0x255f75){logger['error'](_0x255f75['stack']);if(_0x255f75['name']){delete _0x255f75[_0x61a6('0x2a')];}_0x51ce79['status'](_0x20c019)[_0x61a6('0x2b')](_0x255f75);};}exports[_0x61a6('0x2c')]=function(_0x2dff4f,_0x37539e){var _0x233a21={},_0x3d9d2d={},_0x5d9658={'count':0x0,'rows':[]};var _0x51494c=_[_0x61a6('0x2d')](db[_0x61a6('0x2e')][_0x61a6('0x2f')],function(_0x231ab0){return{'name':_0x231ab0[_0x61a6('0x30')],'type':_0x231ab0[_0x61a6('0x31')][_0x61a6('0x32')]};});_0x3d9d2d[_0x61a6('0x33')]=_[_0x61a6('0x2d')](_0x51494c,_0x61a6('0x2a'));_0x3d9d2d[_0x61a6('0x34')]=_[_0x61a6('0x35')](_0x2dff4f[_0x61a6('0x34')]);_0x3d9d2d[_0x61a6('0x36')]=_[_0x61a6('0x37')](_0x3d9d2d['model'],_0x3d9d2d[_0x61a6('0x34')]);_0x233a21[_0x61a6('0x38')]=_[_0x61a6('0x37')](_0x3d9d2d[_0x61a6('0x33')],qs[_0x61a6('0x39')](_0x2dff4f[_0x61a6('0x34')]['fields']));_0x233a21[_0x61a6('0x38')]=_0x233a21[_0x61a6('0x38')][_0x61a6('0x3a')]?_0x233a21[_0x61a6('0x38')]:_0x3d9d2d[_0x61a6('0x33')];if(!_0x2dff4f[_0x61a6('0x34')][_0x61a6('0x3b')](_0x61a6('0x3c'))){_0x233a21['limit']=qs[_0x61a6('0x20')](_0x2dff4f[_0x61a6('0x34')][_0x61a6('0x20')]);_0x233a21[_0x61a6('0x1d')]=qs['offset'](_0x2dff4f['query'][_0x61a6('0x1d')]);}_0x233a21[_0x61a6('0x3d')]=qs[_0x61a6('0x3e')](_0x2dff4f['query'][_0x61a6('0x3e')]);_0x233a21[_0x61a6('0x3f')]=qs[_0x61a6('0x36')](_[_0x61a6('0x40')](_0x2dff4f[_0x61a6('0x34')],_0x3d9d2d[_0x61a6('0x36')]),_0x51494c);if(_0x2dff4f[_0x61a6('0x34')][_0x61a6('0x41')]){_0x233a21[_0x61a6('0x3f')]=_[_0x61a6('0x42')](_0x233a21[_0x61a6('0x3f')],{'$or':_[_0x61a6('0x2d')](_0x51494c,function(_0x96e3fe){if(_0x96e3fe[_0x61a6('0x31')]!==_0x61a6('0x43')){var _0x4dc14f={};_0x4dc14f[_0x96e3fe[_0x61a6('0x2a')]]={'$like':'%'+_0x2dff4f[_0x61a6('0x34')][_0x61a6('0x41')]+'%'};return _0x4dc14f;}})});}_0x233a21=_['merge']({},_0x233a21,_0x2dff4f[_0x61a6('0x44')]);var _0x5a5627={'where':_0x233a21['where']};return db[_0x61a6('0x2e')]['count'](_0x5a5627)[_0x61a6('0x26')](function(_0x41c31f){_0x5d9658[_0x61a6('0x1f')]=_0x41c31f;if(_0x2dff4f['query']['includeAll']){_0x233a21[_0x61a6('0x45')]=[{'all':!![]}];}return db[_0x61a6('0x2e')][_0x61a6('0x46')](_0x233a21);})[_0x61a6('0x26')](function(_0x5b9833){_0x5d9658['rows']=_0x5b9833;return _0x5d9658;})[_0x61a6('0x26')](respondWithFilteredResult(_0x37539e,_0x233a21))[_0x61a6('0x47')](handleError(_0x37539e,null));};exports[_0x61a6('0x48')]=function(_0xfbad72,_0x553662){var _0x35d492={'raw':!![],'where':{'id':_0xfbad72[_0x61a6('0x49')]['id']}},_0x2454e4={};_0x2454e4['model']=_[_0x61a6('0x35')](db[_0x61a6('0x2e')][_0x61a6('0x2f')]);_0x2454e4[_0x61a6('0x34')]=_['keys'](_0xfbad72['query']);_0x2454e4[_0x61a6('0x36')]=_[_0x61a6('0x37')](_0x2454e4[_0x61a6('0x33')],_0x2454e4['query']);_0x35d492[_0x61a6('0x38')]=_[_0x61a6('0x37')](_0x2454e4[_0x61a6('0x33')],qs[_0x61a6('0x39')](_0xfbad72[_0x61a6('0x34')][_0x61a6('0x39')]));_0x35d492[_0x61a6('0x38')]=_0x35d492[_0x61a6('0x38')][_0x61a6('0x3a')]?_0x35d492[_0x61a6('0x38')]:_0x2454e4[_0x61a6('0x33')];if(_0xfbad72[_0x61a6('0x34')][_0x61a6('0x4a')]){_0x35d492[_0x61a6('0x45')]=[{'all':!![]}];}_0x35d492=_[_0x61a6('0x42')]({},_0x35d492,_0xfbad72[_0x61a6('0x44')]);return db['Pause'][_0x61a6('0x4b')](_0x35d492)[_0x61a6('0x26')](handleEntityNotFound(_0x553662,null))['then'](respondWithResult(_0x553662,null))[_0x61a6('0x47')](handleError(_0x553662,null));};exports[_0x61a6('0x4c')]=function(_0x1c5a89,_0x292e66){return db['Pause']['create'](_0x1c5a89[_0x61a6('0x4d')],{})[_0x61a6('0x26')](function(_0x1b1f27){var _0x5e62f7=_0x1c5a89[_0x61a6('0x4e')][_0x61a6('0x28')]({'plain':!![]});if(!_0x5e62f7)throw new Error(_0x61a6('0x4f'));if(_0x5e62f7[_0x61a6('0x50')]===_0x61a6('0x4e')){var _0x1e24f6=_0x1b1f27[_0x61a6('0x28')]({'plain':!![]});var _0x48716c=_0x61a6('0x51');return db[_0x61a6('0x52')]['find']({'where':{'name':_0x48716c,'userProfileId':_0x5e62f7[_0x61a6('0x53')]},'raw':!![]})['then'](function(_0x3d46be){if(_0x3d46be&&_0x3d46be[_0x61a6('0x54')]===0x0){return db['UserProfileResource'][_0x61a6('0x4c')]({'name':_0x1e24f6['name'],'resourceId':_0x1e24f6['id'],'type':_0x3d46be[_0x61a6('0x2a')],'sectionId':_0x3d46be['id']},{})[_0x61a6('0x26')](function(){return _0x1b1f27;});}else{return _0x1b1f27;}})['catch'](function(_0x30de7a){logger[_0x61a6('0x55')](_0x61a6('0x56'),_0x30de7a);throw _0x30de7a;});}return _0x1b1f27;})[_0x61a6('0x26')](respondWithResult(_0x292e66,0xc9))[_0x61a6('0x47')](handleError(_0x292e66,null));};exports[_0x61a6('0x25')]=function(_0x38a738,_0x5e51cf){if(_0x38a738[_0x61a6('0x4d')]['id']){delete _0x38a738[_0x61a6('0x4d')]['id'];}return db[_0x61a6('0x2e')][_0x61a6('0x4b')]({'where':{'id':_0x38a738[_0x61a6('0x49')]['id']}})[_0x61a6('0x26')](handleEntityNotFound(_0x5e51cf,null))['then'](saveUpdates(_0x38a738['body'],null))[_0x61a6('0x26')](respondWithResult(_0x5e51cf,null))[_0x61a6('0x47')](handleError(_0x5e51cf,null));};exports['destroy']=function(_0x170406,_0x36aef9){return db[_0x61a6('0x2e')]['find']({'where':{'id':_0x170406[_0x61a6('0x49')]['id']}})[_0x61a6('0x26')](handleEntityNotFound(_0x36aef9,null))[_0x61a6('0x26')](removeEntity(_0x36aef9,null))[_0x61a6('0x47')](handleError(_0x36aef9,null));}; \ No newline at end of file +var _0xe74a=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','Pause','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe74a,0x13a));var _0xae74=function(_0x475eac,_0x2fa495){_0x475eac=_0x475eac-0x0;var _0x4ad158=_0xe74a[_0x475eac];return _0x4ad158;};'use strict';var emlformat=require(_0xae74('0x0'));var rimraf=require(_0xae74('0x1'));var zipdir=require(_0xae74('0x2'));var jsonpatch=require(_0xae74('0x3'));var rp=require('request-promise');var moment=require(_0xae74('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae74('0x5'));var util=require('util');var path=require(_0xae74('0x6'));var sox=require(_0xae74('0x7'));var csv=require(_0xae74('0x8'));var ejs=require(_0xae74('0x9'));var fs=require('fs');var fs_extra=require(_0xae74('0xa'));var _=require('lodash');var squel=require(_0xae74('0xb'));var crypto=require(_0xae74('0xc'));var jsforce=require(_0xae74('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xae74('0xe'));var Papa=require(_0xae74('0xf'));var Redis=require('ioredis');var authService=require(_0xae74('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xae74('0x11'));var hardwareService=require(_0xae74('0x12'));var logger=require(_0xae74('0x13'))(_0xae74('0x14'));var utils=require('../../config/utils');var config=require(_0xae74('0x15'));var licenseUtil=require(_0xae74('0x16'));var db=require(_0xae74('0x17'))['db'];function respondWithStatusCode(_0x51cf78,_0x42cf4f){_0x42cf4f=_0x42cf4f||0xcc;return function(_0x28cb76){if(_0x28cb76){return _0x51cf78['sendStatus'](_0x42cf4f);}return _0x51cf78['status'](_0x42cf4f)[_0xae74('0x18')]();};}function respondWithResult(_0x3bbad3,_0x3d11d4){_0x3d11d4=_0x3d11d4||0xc8;return function(_0x5b2e56){if(_0x5b2e56){return _0x3bbad3[_0xae74('0x19')](_0x3d11d4)[_0xae74('0x1a')](_0x5b2e56);}};}function respondWithFilteredResult(_0x1a2102,_0x5b89fb){return function(_0xad0dd5){if(_0xad0dd5){var _0x40a5e9=typeof _0x5b89fb[_0xae74('0x1b')]===_0xae74('0x1c')&&typeof _0x5b89fb['limit']===_0xae74('0x1c');var _0x10fe9d=_0xad0dd5['count'];var _0x435995=_0x40a5e9?0x0:_0x5b89fb[_0xae74('0x1b')];var _0x11f15e=_0x40a5e9?_0xad0dd5[_0xae74('0x1d')]:_0x5b89fb[_0xae74('0x1b')]+_0x5b89fb[_0xae74('0x1e')];var _0xed108f;if(_0x11f15e>=_0x10fe9d){_0x11f15e=_0x10fe9d;_0xed108f=0xc8;}else{_0xed108f=0xce;}_0x1a2102[_0xae74('0x19')](_0xed108f);return _0x1a2102[_0xae74('0x1f')]('Content-Range',_0x435995+'-'+_0x11f15e+'/'+_0x10fe9d)[_0xae74('0x1a')](_0xad0dd5);}return null;};}function patchUpdates(_0x19b71c){return function(_0xdf43ac){try{jsonpatch[_0xae74('0x20')](_0xdf43ac,_0x19b71c,!![]);}catch(_0x5337bd){return BPromise['reject'](_0x5337bd);}return _0xdf43ac[_0xae74('0x21')]();};}function saveUpdates(_0x246183,_0x4f8576){return function(_0x3caf9f){if(_0x3caf9f){return _0x3caf9f['update'](_0x246183)[_0xae74('0x22')](function(_0x396d2a){return _0x396d2a;});}return null;};}function removeEntity(_0x43c088,_0x4be818){return function(_0x47b9f1){if(_0x47b9f1){return _0x47b9f1[_0xae74('0x23')]()[_0xae74('0x22')](function(){var _0x17cd8c=_0x47b9f1[_0xae74('0x24')]({'plain':!![]});var _0x4294d0=_0xae74('0x25');return db[_0xae74('0x26')][_0xae74('0x23')]({'where':{'type':_0x4294d0,'resourceId':_0x17cd8c['id']}})['then'](function(){return _0x47b9f1;});})['then'](function(){_0x43c088['status'](0xcc)[_0xae74('0x18')]();});}};}function handleEntityNotFound(_0x556983,_0x2eb844){return function(_0x4f6505){if(!_0x4f6505){_0x556983[_0xae74('0x27')](0x194);}return _0x4f6505;};}function handleError(_0x1edb34,_0x37631c){_0x37631c=_0x37631c||0x1f4;return function(_0xf83d1c){logger[_0xae74('0x28')](_0xf83d1c[_0xae74('0x29')]);if(_0xf83d1c[_0xae74('0x2a')]){delete _0xf83d1c[_0xae74('0x2a')];}_0x1edb34[_0xae74('0x19')](_0x37631c)[_0xae74('0x2b')](_0xf83d1c);};}exports[_0xae74('0x2c')]=function(_0x461e3d,_0x3f2144){var _0x59305a={},_0x208448={},_0x241a0f={'count':0x0,'rows':[]};var _0x560097=_[_0xae74('0x2d')](db['Pause']['rawAttributes'],function(_0x14d548){return{'name':_0x14d548[_0xae74('0x2e')],'type':_0x14d548[_0xae74('0x2f')][_0xae74('0x30')]};});_0x208448[_0xae74('0x31')]=_[_0xae74('0x2d')](_0x560097,_0xae74('0x2a'));_0x208448['query']=_[_0xae74('0x32')](_0x461e3d[_0xae74('0x33')]);_0x208448[_0xae74('0x34')]=_[_0xae74('0x35')](_0x208448[_0xae74('0x31')],_0x208448[_0xae74('0x33')]);_0x59305a[_0xae74('0x36')]=_[_0xae74('0x35')](_0x208448[_0xae74('0x31')],qs[_0xae74('0x37')](_0x461e3d['query'][_0xae74('0x37')]));_0x59305a['attributes']=_0x59305a[_0xae74('0x36')][_0xae74('0x38')]?_0x59305a['attributes']:_0x208448[_0xae74('0x31')];if(!_0x461e3d[_0xae74('0x33')][_0xae74('0x39')](_0xae74('0x3a'))){_0x59305a[_0xae74('0x1e')]=qs[_0xae74('0x1e')](_0x461e3d[_0xae74('0x33')][_0xae74('0x1e')]);_0x59305a[_0xae74('0x1b')]=qs[_0xae74('0x1b')](_0x461e3d[_0xae74('0x33')]['offset']);}_0x59305a['order']=qs[_0xae74('0x3b')](_0x461e3d[_0xae74('0x33')][_0xae74('0x3b')]);_0x59305a['where']=qs[_0xae74('0x34')](_['pick'](_0x461e3d[_0xae74('0x33')],_0x208448[_0xae74('0x34')]),_0x560097);if(_0x461e3d[_0xae74('0x33')][_0xae74('0x3c')]){_0x59305a['where']=_[_0xae74('0x3d')](_0x59305a[_0xae74('0x3e')],{'$or':_['map'](_0x560097,function(_0x35652f){if(_0x35652f['type']!==_0xae74('0x3f')){var _0x5047dc={};_0x5047dc[_0x35652f[_0xae74('0x2a')]]={'$like':'%'+_0x461e3d['query'][_0xae74('0x3c')]+'%'};return _0x5047dc;}})});}_0x59305a=_[_0xae74('0x3d')]({},_0x59305a,_0x461e3d[_0xae74('0x40')]);var _0x4d56ce={'where':_0x59305a[_0xae74('0x3e')]};return db[_0xae74('0x41')][_0xae74('0x1d')](_0x4d56ce)['then'](function(_0x2c1edd){_0x241a0f[_0xae74('0x1d')]=_0x2c1edd;if(_0x461e3d[_0xae74('0x33')][_0xae74('0x42')]){_0x59305a[_0xae74('0x43')]=[{'all':!![]}];}return db['Pause'][_0xae74('0x44')](_0x59305a);})[_0xae74('0x22')](function(_0x1b058f){_0x241a0f[_0xae74('0x45')]=_0x1b058f;return _0x241a0f;})[_0xae74('0x22')](respondWithFilteredResult(_0x3f2144,_0x59305a))[_0xae74('0x46')](handleError(_0x3f2144,null));};exports[_0xae74('0x47')]=function(_0x4c103a,_0x31d9bd){var _0x3e8154={'raw':!![],'where':{'id':_0x4c103a[_0xae74('0x48')]['id']}},_0x272e50={};_0x272e50[_0xae74('0x31')]=_['keys'](db['Pause']['rawAttributes']);_0x272e50[_0xae74('0x33')]=_[_0xae74('0x32')](_0x4c103a[_0xae74('0x33')]);_0x272e50[_0xae74('0x34')]=_['intersection'](_0x272e50['model'],_0x272e50[_0xae74('0x33')]);_0x3e8154[_0xae74('0x36')]=_[_0xae74('0x35')](_0x272e50[_0xae74('0x31')],qs[_0xae74('0x37')](_0x4c103a[_0xae74('0x33')][_0xae74('0x37')]));_0x3e8154[_0xae74('0x36')]=_0x3e8154[_0xae74('0x36')][_0xae74('0x38')]?_0x3e8154['attributes']:_0x272e50[_0xae74('0x31')];if(_0x4c103a[_0xae74('0x33')]['includeAll']){_0x3e8154[_0xae74('0x43')]=[{'all':!![]}];}_0x3e8154=_['merge']({},_0x3e8154,_0x4c103a[_0xae74('0x40')]);return db[_0xae74('0x41')]['find'](_0x3e8154)[_0xae74('0x22')](handleEntityNotFound(_0x31d9bd,null))['then'](respondWithResult(_0x31d9bd,null))[_0xae74('0x46')](handleError(_0x31d9bd,null));};exports[_0xae74('0x49')]=function(_0x52087c,_0x10629b){return db[_0xae74('0x41')][_0xae74('0x49')](_0x52087c[_0xae74('0x4a')],{})['then'](function(_0x40fa04){var _0x213e23=_0x52087c['user']['get']({'plain':!![]});if(!_0x213e23)throw new Error(_0xae74('0x4b'));if(_0x213e23['role']==='user'){var _0x30db51=_0x40fa04[_0xae74('0x24')]({'plain':!![]});var _0x2b0a78='Pauses';return db[_0xae74('0x4c')]['find']({'where':{'name':_0x2b0a78,'userProfileId':_0x213e23[_0xae74('0x4d')]},'raw':!![]})[_0xae74('0x22')](function(_0x59427d){if(_0x59427d&&_0x59427d[_0xae74('0x4e')]===0x0){return db[_0xae74('0x26')][_0xae74('0x49')]({'name':_0x30db51[_0xae74('0x2a')],'resourceId':_0x30db51['id'],'type':_0x59427d['name'],'sectionId':_0x59427d['id']},{})['then'](function(){return _0x40fa04;});}else{return _0x40fa04;}})['catch'](function(_0x3e4126){logger[_0xae74('0x28')](_0xae74('0x4f'),_0x3e4126);throw _0x3e4126;});}return _0x40fa04;})['then'](respondWithResult(_0x10629b,0xc9))[_0xae74('0x46')](handleError(_0x10629b,null));};exports[_0xae74('0x50')]=function(_0x963f07,_0x715116){if(_0x963f07[_0xae74('0x4a')]['id']){delete _0x963f07[_0xae74('0x4a')]['id'];}return db[_0xae74('0x41')][_0xae74('0x51')]({'where':{'id':_0x963f07['params']['id']}})[_0xae74('0x22')](handleEntityNotFound(_0x715116,null))[_0xae74('0x22')](saveUpdates(_0x963f07['body'],null))['then'](respondWithResult(_0x715116,null))['catch'](handleError(_0x715116,null));};exports[_0xae74('0x23')]=function(_0x55fbc7,_0x4640ad){return db[_0xae74('0x41')][_0xae74('0x51')]({'where':{'id':_0x55fbc7[_0xae74('0x48')]['id']}})['then'](handleEntityNotFound(_0x4640ad,null))[_0xae74('0x22')](removeEntity(_0x4640ad,null))[_0xae74('0x46')](handleError(_0x4640ad,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2064ced..a343065 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x22eba1,_0x20c1e0){var _0x18ce06=function(_0x427102){while(--_0x427102){_0x22eba1['push'](_0x22eba1['shift']());}};_0x18ce06(++_0x20c1e0);}(_0xf494,0x1c6));var _0x4f49=function(_0x29e83b,_0x275a30){_0x29e83b=_0x29e83b-0x0;var _0x26cf3a=_0xf494[_0x29e83b];return _0x26cf3a;};'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 +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x168340,_0x1bae8e){var _0x542042=function(_0x3234bf){while(--_0x3234bf){_0x168340['push'](_0x168340['shift']());}};_0x542042(++_0x1bae8e);}(_0xe14b,0x93));var _0xbe14=function(_0x5b3405,_0xc9b4d){_0x5b3405=_0x5b3405-0x0;var _0x41fce3=_0xe14b[_0x5b3405];return _0x41fce3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 929e88b..cf3e25e 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xda2dda,_0x3eef05){var _0xd9ddb0=function(_0x1651ba){while(--_0x1651ba){_0xda2dda['push'](_0xda2dda['shift']());}};_0xd9ddb0(++_0x3eef05);}(_0x7a54,0x106));var _0x47a5=function(_0x480de7,_0x3923de){_0x480de7=_0x480de7-0x0;var _0x49ac0b=_0x7a54[_0x480de7];return _0x49ac0b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xc3d103,_0x5d4b10){var _0x4c2a59=function(_0x4037b3){while(--_0x4037b3){_0xc3d103['push'](_0xc3d103['shift']());}};_0x4c2a59(++_0x5d4b10);}(_0x7a54,0x106));var _0x47a5=function(_0x220f00,_0x3d462e){_0x220f00=_0x220f00-0x0;var _0x16859c=_0x7a54[_0x220f00];return _0x16859c;};'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 ff2ce09..e1f9bdb 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 _0x6f0d=['delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x367353,_0x29d448){_0x367353=_0x367353-0x0;var _0x1bd728=_0x6f0d[_0x367353];return _0x1bd728;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xa')](_0xd6f0('0xe'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x136eee,_0xee144c,_0x329f69){_0x329f69(null,path[_0xd6f0('0x10')](config['root'],_0xd6f0('0x11')));},'filename':function(_0x2f0459,_0x306aad,_0x45973d){_0x306aad[_0xd6f0('0x12')]=_0x306aad[_0xd6f0('0x12')][_0xd6f0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45973d(null,util[_0xd6f0('0x14')](_0xd6f0('0x15'),path['basename'](_0x306aad[_0xd6f0('0x12')],path[_0xd6f0('0x16')](_0x306aad['originalname'])),Date[_0xd6f0('0x17')](),path['extname'](_0x306aad[_0xd6f0('0x12')])));}})});router[_0xd6f0('0x18')]('/',upload[_0xd6f0('0x19')](_0xd6f0('0x1a')),controller[_0xd6f0('0x1b')]);router[_0xd6f0('0x18')](_0xd6f0('0xb'),controller[_0xd6f0('0x1c')]);router[_0xd6f0('0x1d')](_0xd6f0('0x1e'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x1f')]);router[_0xd6f0('0x20')](_0xd6f0('0x1e'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x20')]);module['exports']=router; \ No newline at end of file +var _0x6334=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','format','%s-%s%s','extname','now','originalname','post','file','upload','webhookPost','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xfe91b,_0x1d4227){var _0x341dbf=function(_0x2de682){while(--_0x2de682){_0xfe91b['push'](_0xfe91b['shift']());}};_0x341dbf(++_0x1d4227);}(_0x6334,0x119));var _0x4633=function(_0x34d6bd,_0x55b744){_0x34d6bd=_0x34d6bd-0x0;var _0x248396=_0x6334[_0x34d6bd];return _0x248396;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),controller['webhookGet']);router[_0x4633('0xa')](_0x4633('0xe'),auth['isAuthenticated'](),controller[_0x4633('0xf')]);router[_0x4633('0xa')](_0x4633('0x10'),auth['isAuthenticated'](),controller[_0x4633('0x11')]);var upload=multer({'storage':multer[_0x4633('0x12')]({'destination':function(_0x5157a7,_0x6a63b,_0x3d5182){_0x3d5182(null,path[_0x4633('0x13')](config[_0x4633('0x14')],'server/files/plugins'));},'filename':function(_0x73b5e4,_0xad405,_0x438e87){_0xad405['originalname']=_0xad405['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x438e87(null,util[_0x4633('0x15')](_0x4633('0x16'),path['basename'](_0xad405['originalname'],path[_0x4633('0x17')](_0xad405['originalname'])),Date[_0x4633('0x18')](),path[_0x4633('0x17')](_0xad405[_0x4633('0x19')])));}})});router[_0x4633('0x1a')]('/',upload['single'](_0x4633('0x1b')),controller[_0x4633('0x1c')]);router[_0x4633('0x1a')]('/webhook',controller[_0x4633('0x1d')]);router[_0x4633('0x1e')](_0x4633('0xe'),auth[_0x4633('0xb')](),controller[_0x4633('0x1f')]);router['delete'](_0x4633('0xe'),auth[_0x4633('0xb')](),controller['delete']);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 4aeb8c5..9fca41f 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 _0x295c=['html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','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','STRING','ENUM'];(function(_0x141b3a,_0xb7e037){var _0x15a7b3=function(_0x10c61a){while(--_0x10c61a){_0x141b3a['push'](_0x141b3a['shift']());}};_0x15a7b3(++_0xb7e037);}(_0x295c,0x165));var _0xc295=function(_0xddb03,_0x4b9362){_0xddb03=_0xddb03-0x0;var _0xdfd0fd=_0x295c[_0xddb03];return _0xdfd0fd;};'use strict';var Sequelize=require(_0xc295('0x0'));module['exports']={'name':{'type':Sequelize[_0xc295('0x1')]},'type':{'type':Sequelize[_0xc295('0x2')](_0xc295('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc295('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0xc295('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc295('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xc295('0x7'),_0xc295('0x8'),_0xc295('0x9'),_0xc295('0xa')),'defaultValue':_0xc295('0x9'),'comment':_0xc295('0xb')},'icon':{'type':Sequelize[_0xc295('0x1')]},'adminUrl':{'type':Sequelize[_0xc295('0x1')]},'agentUrl':{'type':Sequelize[_0xc295('0x1')]},'scriptName':{'type':Sequelize[_0xc295('0x1')]},'scriptPath':{'type':Sequelize[_0xc295('0x1')]}}; \ No newline at end of file +var _0x310b=['sequelize','STRING','ENUM','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x310b,0x19e));var _0xb310=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x310b[_0x49d41c];return _0xb64c5f;};'use strict';var Sequelize=require(_0xb310('0x0'));module['exports']={'name':{'type':Sequelize[_0xb310('0x1')]},'type':{'type':Sequelize[_0xb310('0x2')](_0xb310('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xb310('0x1')],'comment':_0xb310('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xb310('0x2')](_0xb310('0x5'),_0xb310('0x6'),'always','never'),'defaultValue':_0xb310('0x7'),'comment':_0xb310('0x8')},'icon':{'type':Sequelize[_0xb310('0x1')]},'adminUrl':{'type':Sequelize[_0xb310('0x1')]},'agentUrl':{'type':Sequelize[_0xb310('0x1')]},'scriptName':{'type':Sequelize[_0xb310('0x1')]},'scriptPath':{'type':Sequelize[_0xb310('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1aba6e4..364c186 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 _0x8a47=['readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','type','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','body','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','statusCode','send','webhookPost','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','Plugin','show','includeAll','include','find','download','params','server/files/plugins','format','%s.zip','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','root','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','Plugin\x20manifest\x20missing'];(function(_0x2d84d5,_0x290676){var _0x3c914e=function(_0x219836){while(--_0x219836){_0x2d84d5['push'](_0x2d84d5['shift']());}};_0x3c914e(++_0x290676);}(_0x8a47,0x189));var _0x78a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a47[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x78a4('0x0'));var rimraf=require(_0x78a4('0x1'));var zipdir=require(_0x78a4('0x2'));var jsonpatch=require(_0x78a4('0x3'));var rp=require(_0x78a4('0x4'));var moment=require(_0x78a4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x78a4('0x6'));var util=require(_0x78a4('0x7'));var path=require(_0x78a4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x78a4('0x9'));var fs=require('fs');var fs_extra=require(_0x78a4('0xa'));var _=require('lodash');var squel=require(_0x78a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x78a4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x78a4('0xd'));var querystring=require(_0x78a4('0xe'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x78a4('0xf'));var Redis=require(_0x78a4('0x10'));var authService=require(_0x78a4('0x11'));var qs=require(_0x78a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78a4('0x13'));var logger=require(_0x78a4('0x14'))('api');var utils=require(_0x78a4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x78a4('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x78a4('0x17')](config['redis'],{'host':_0x78a4('0x18'),'port':0x18eb});var socket=require(_0x78a4('0x19'))(new Redis(config[_0x78a4('0x1a')]));require('./plugin.socket')[_0x78a4('0x1b')](socket);function respondWithStatusCode(_0x32d310,_0xf908b){_0xf908b=_0xf908b||0xcc;return function(_0xb7a11){if(_0xb7a11){return _0x32d310[_0x78a4('0x1c')](_0xf908b);}return _0x32d310['status'](_0xf908b)[_0x78a4('0x1d')]();};}function respondWithResult(_0x39db55,_0x4a1a21){_0x4a1a21=_0x4a1a21||0xc8;return function(_0x26cca0){if(_0x26cca0){return _0x39db55[_0x78a4('0x1e')](_0x4a1a21)[_0x78a4('0x1f')](_0x26cca0);}};}function respondWithFilteredResult(_0x1b477e,_0x3a7447){return function(_0xf9cca6){if(_0xf9cca6){var _0x5e1d3e=typeof _0x3a7447[_0x78a4('0x20')]===_0x78a4('0x21')&&typeof _0x3a7447['limit']===_0x78a4('0x21');var _0x1fa861=_0xf9cca6[_0x78a4('0x22')];var _0x32e7b0=_0x5e1d3e?0x0:_0x3a7447[_0x78a4('0x20')];var _0xb3080=_0x5e1d3e?_0xf9cca6[_0x78a4('0x22')]:_0x3a7447['offset']+_0x3a7447['limit'];var _0x3df50c;if(_0xb3080>=_0x1fa861){_0xb3080=_0x1fa861;_0x3df50c=0xc8;}else{_0x3df50c=0xce;}_0x1b477e[_0x78a4('0x1e')](_0x3df50c);return _0x1b477e[_0x78a4('0x23')](_0x78a4('0x24'),_0x32e7b0+'-'+_0xb3080+'/'+_0x1fa861)[_0x78a4('0x1f')](_0xf9cca6);}return null;};}function patchUpdates(_0x52c4a2){return function(_0x4cfadd){try{jsonpatch[_0x78a4('0x25')](_0x4cfadd,_0x52c4a2,!![]);}catch(_0x38af30){return BPromise['reject'](_0x38af30);}return _0x4cfadd[_0x78a4('0x26')]();};}function saveUpdates(_0x17ef2d,_0x2ea8f9){return function(_0x35e99a){if(_0x35e99a){return _0x35e99a[_0x78a4('0x27')](_0x17ef2d)[_0x78a4('0x28')](function(_0x251db4){return _0x251db4;});}return null;};}function removeEntity(_0x51ff4b,_0x155a03){return function(_0x4d2be5){if(_0x4d2be5){return _0x4d2be5[_0x78a4('0x29')]()['then'](function(){var _0x53c5af=_0x4d2be5[_0x78a4('0x2a')]({'plain':!![]});var _0x5daf00=_0x78a4('0x2b');return db[_0x78a4('0x2c')]['destroy']({'where':{'type':_0x5daf00,'resourceId':_0x53c5af['id']}})['then'](function(){return _0x4d2be5;});})[_0x78a4('0x28')](function(){_0x51ff4b[_0x78a4('0x1e')](0xcc)[_0x78a4('0x1d')]();});}};}function handleEntityNotFound(_0x3e6b73,_0x29d603){return function(_0x1ba040){if(!_0x1ba040){_0x3e6b73[_0x78a4('0x1c')](0x194);}return _0x1ba040;};}function handleError(_0x392e8d,_0x463697){_0x463697=_0x463697||0x1f4;return function(_0x5d09fc){logger[_0x78a4('0x2d')](_0x5d09fc[_0x78a4('0x2e')]);if(_0x5d09fc[_0x78a4('0x2f')]){delete _0x5d09fc['name'];}_0x392e8d[_0x78a4('0x1e')](_0x463697)['send'](_0x5d09fc);};}exports[_0x78a4('0x30')]=function(_0x2ea74d,_0x4187e3){var _0x48e421={},_0x5d7970={},_0x391eac={'count':0x0,'rows':[]};var _0x472647=_[_0x78a4('0x31')](db['Plugin'][_0x78a4('0x32')],function(_0x2d3c2d){return{'name':_0x2d3c2d['fieldName'],'type':_0x2d3c2d['type'][_0x78a4('0x33')]};});_0x5d7970[_0x78a4('0x34')]=_[_0x78a4('0x31')](_0x472647,_0x78a4('0x2f'));_0x5d7970[_0x78a4('0x35')]=_[_0x78a4('0x36')](_0x2ea74d['query']);_0x5d7970['filters']=_[_0x78a4('0x37')](_0x5d7970['model'],_0x5d7970[_0x78a4('0x35')]);_0x48e421[_0x78a4('0x38')]=_[_0x78a4('0x37')](_0x5d7970[_0x78a4('0x34')],qs[_0x78a4('0x39')](_0x2ea74d[_0x78a4('0x35')][_0x78a4('0x39')]));_0x48e421[_0x78a4('0x38')]=_0x48e421['attributes'][_0x78a4('0x3a')]?_0x48e421[_0x78a4('0x38')]:_0x5d7970[_0x78a4('0x34')];if(!_0x2ea74d[_0x78a4('0x35')][_0x78a4('0x3b')](_0x78a4('0x3c'))){_0x48e421[_0x78a4('0x3d')]=qs[_0x78a4('0x3d')](_0x2ea74d[_0x78a4('0x35')]['limit']);_0x48e421['offset']=qs['offset'](_0x2ea74d[_0x78a4('0x35')][_0x78a4('0x20')]);}_0x48e421[_0x78a4('0x3e')]=qs['sort'](_0x2ea74d[_0x78a4('0x35')][_0x78a4('0x3f')]);_0x48e421[_0x78a4('0x40')]=qs[_0x78a4('0x41')](_['pick'](_0x2ea74d['query'],_0x5d7970['filters']),_0x472647);if(_0x2ea74d['query'][_0x78a4('0x42')]){_0x48e421[_0x78a4('0x40')]=_[_0x78a4('0x43')](_0x48e421[_0x78a4('0x40')],{'$or':_[_0x78a4('0x31')](_0x472647,function(_0x4f195f){if(_0x4f195f['type']!=='VIRTUAL'){var _0x154095={};_0x154095[_0x4f195f[_0x78a4('0x2f')]]={'$like':'%'+_0x2ea74d['query']['filter']+'%'};return _0x154095;}})});}_0x48e421=_[_0x78a4('0x43')]({},_0x48e421,_0x2ea74d[_0x78a4('0x44')]);var _0x17ca55={'where':_0x48e421['where']};return db['Plugin'][_0x78a4('0x22')](_0x17ca55)[_0x78a4('0x28')](function(_0x3e3666){_0x391eac['count']=_0x3e3666;if(_0x2ea74d[_0x78a4('0x35')]['includeAll']){_0x48e421['include']=[{'all':!![]}];}return db[_0x78a4('0x45')]['findAll'](_0x48e421);})[_0x78a4('0x28')](function(_0x413a5d){_0x391eac['rows']=_0x413a5d;return _0x391eac;})['then'](respondWithFilteredResult(_0x4187e3,_0x48e421))['catch'](handleError(_0x4187e3,null));};exports[_0x78a4('0x46')]=function(_0x2d4e76,_0x5301e6){var _0x332389={'raw':!![],'where':{'id':_0x2d4e76['params']['id']}},_0x189fb5={};_0x189fb5['model']=_['keys'](db[_0x78a4('0x45')][_0x78a4('0x32')]);_0x189fb5[_0x78a4('0x35')]=_['keys'](_0x2d4e76['query']);_0x189fb5[_0x78a4('0x41')]=_[_0x78a4('0x37')](_0x189fb5[_0x78a4('0x34')],_0x189fb5['query']);_0x332389[_0x78a4('0x38')]=_[_0x78a4('0x37')](_0x189fb5[_0x78a4('0x34')],qs['fields'](_0x2d4e76['query'][_0x78a4('0x39')]));_0x332389['attributes']=_0x332389[_0x78a4('0x38')][_0x78a4('0x3a')]?_0x332389[_0x78a4('0x38')]:_0x189fb5['model'];if(_0x2d4e76[_0x78a4('0x35')][_0x78a4('0x47')]){_0x332389[_0x78a4('0x48')]=[{'all':!![]}];}_0x332389=_[_0x78a4('0x43')]({},_0x332389,_0x2d4e76[_0x78a4('0x44')]);return db[_0x78a4('0x45')][_0x78a4('0x49')](_0x332389)[_0x78a4('0x28')](handleEntityNotFound(_0x5301e6,null))[_0x78a4('0x28')](respondWithResult(_0x5301e6,null))['catch'](handleError(_0x5301e6,null));};exports[_0x78a4('0x4a')]=function(_0x4c9bac,_0x2aca74,_0x343e21){return db[_0x78a4('0x45')][_0x78a4('0x49')]({'where':{'id':_0x4c9bac[_0x78a4('0x4b')]['id']},'attributes':['name',_0x78a4('0x8')],'raw':!![]})[_0x78a4('0x28')](handleEntityNotFound(_0x2aca74,null))[_0x78a4('0x28')](function(_0x44116f){if(_0x44116f){var _0x4adab1=path['join'](config['root'],_0x78a4('0x4c'),util[_0x78a4('0x4d')](_0x78a4('0x4e'),path['basename'](_0x44116f[_0x78a4('0x8')])));var _0x2e204b=fs[_0x78a4('0x4f')](_0x4adab1);var _0x2af433=archiver('zip',{'zlib':{'level':0x9}});_0x2af433['on'](_0x78a4('0x50'),function(_0x1c25a2){if(_0x1c25a2[_0x78a4('0x51')]===_0x78a4('0x52')){logger[_0x78a4('0x2d')](_0x1c25a2);}else{throw new db[(_0x78a4('0x53'))][(_0x78a4('0x54'))](_0x78a4('0x55'));}});_0x2af433['on']('error',function(_0x45a544){throw new db[(_0x78a4('0x53'))][(_0x78a4('0x54'))](_0x78a4('0x55'));});_0x2af433[_0x78a4('0x56')](_0x2e204b);_0x2af433['glob'](_0x78a4('0x57'),{'cwd':path[_0x78a4('0x58')](config[_0x78a4('0x59')],_0x78a4('0x4c'),path[_0x78a4('0x5a')](_0x44116f['path'])),'ignore':[path[_0x78a4('0x58')](path[_0x78a4('0x5b')](_0x44116f[_0x78a4('0x8')]),_0x78a4('0x5c')),path[_0x78a4('0x58')](path[_0x78a4('0x5b')](_0x44116f[_0x78a4('0x8')]),_0x78a4('0x5d'))],'nodir':!![]})[_0x78a4('0x5e')]();_0x2e204b['on'](_0x78a4('0x5f'),function(){if(!fs[_0x78a4('0x60')](_0x4adab1)){throw new db[(_0x78a4('0x53'))][(_0x78a4('0x54'))](_0x78a4('0x61'));}return _0x2aca74['download'](_0x4adab1,util[_0x78a4('0x4d')](_0x78a4('0x4e'),path[_0x78a4('0x5b')](_0x44116f['path'])),function(_0xf39269){if(_0xf39269){throw new db[(_0x78a4('0x53'))][(_0x78a4('0x54'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x78a4('0x62')](_0x4adab1);logger[_0x78a4('0x63')](_0x78a4('0x64'));logger[_0x78a4('0x63')](_0x78a4('0x65'));});});}return null;})['catch'](handleError(_0x2aca74,null));};exports['upload']=function(_0x403e85,_0x170558,_0x472bb1){var _0x5b7e83=path[_0x78a4('0x5b')](_0x403e85[_0x78a4('0x66')][_0x78a4('0x67')],path[_0x78a4('0x68')](_0x403e85[_0x78a4('0x66')][_0x78a4('0x67')]));var _0x3773f8=path[_0x78a4('0x58')](config[_0x78a4('0x59')],_0x78a4('0x4c'),_0x403e85[_0x78a4('0x66')][_0x78a4('0x67')]);var _0x5b092a=path[_0x78a4('0x58')](config[_0x78a4('0x59')],'server/files/plugins',_0x5b7e83);logger[_0x78a4('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x3773f8);logger[_0x78a4('0x63')](_0x78a4('0x69'),_0x5b092a);try{fs[_0x78a4('0x6a')](_0x3773f8,parseInt(_0x78a4('0x6b'),0x8));extract(_0x3773f8,{'dir':_0x5b092a},function(_0x17f6f0){if(_0x17f6f0){logger[_0x78a4('0x2d')](_0x17f6f0);handleError(_0x17f6f0,!![]);};var _0x3cc732=fs[_0x78a4('0x6c')](_0x5b092a);if(_0x3cc732[_0x78a4('0x3a')]>0x1){removeReferences(_0x3773f8,_0x5b092a);logger['error'](_0x78a4('0x6d'));return _0x472bb1(new Error('Invalid\x20plugin\x20structure'));}var _0x552821=fs['lstatSync'](path[_0x78a4('0x58')](_0x5b092a,_0x3cc732[0x0]));if(_0x552821[_0x78a4('0x6e')]()){removeReferences(_0x3773f8,_0x5b092a);logger['error'](_0x78a4('0x6d'));return _0x472bb1(new Error(_0x78a4('0x6d')));}if(_0x552821[_0x78a4('0x6f')]()){var _0x369ea5=fs[_0x78a4('0x6c')](path['join'](_0x5b092a,_0x3cc732[0x0]));if(_0x369ea5[_0x78a4('0x3a')]===0x0){removeReferences(_0x3773f8,_0x5b092a);logger[_0x78a4('0x2d')](_0x78a4('0x6d'));return _0x472bb1(new Error(_0x78a4('0x6d')));}var _0x271981=_0x369ea5[_0x78a4('0x70')](function(_0x5a03fd){return _0x5a03fd==='manifest.json';});if(!_0x271981){return _0x472bb1(new Error(_0x78a4('0x71')));}var _0x33fd53=fs[_0x78a4('0x72')](path[_0x78a4('0x58')](_0x5b092a,_0x3cc732[0x0],_0x78a4('0x73')));var _0x23c2ce=JSON[_0x78a4('0x74')](_0x33fd53);if(_0x78a4('0x21')==typeof _0x23c2ce['name']){return _0x472bb1(new Error(_0x78a4('0x75')));}if(_0x78a4('0x21')==typeof _0x23c2ce['type']){return _0x472bb1(new Error(_0x78a4('0x76')));}if(_0x78a4('0x21')==typeof _0x23c2ce[_0x78a4('0x77')]){return _0x472bb1(new Error(_0x78a4('0x78')));}if(_0x78a4('0x21')==typeof _0x23c2ce['parameters']){return _0x472bb1(new Error(_0x78a4('0x79')));}if(_0x23c2ce['type']===_0x78a4('0x7a')){if(_0x78a4('0x21')==typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')]){return _0x472bb1(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x78a4('0x21')==typeof _0x23c2ce['parameters'][_0x78a4('0x7c')][_0x78a4('0x7d')]&&'undefined'==typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7e')]){return _0x472bb1(new Error(_0x78a4('0x7f')));}}else if(_0x23c2ce[_0x78a4('0x80')]===_0x78a4('0x81')){if(_0x78a4('0x21')==typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x82')]){return _0x472bb1(new Error(_0x78a4('0x83')));}if(_0x78a4('0x21')==typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x84')]){return _0x472bb1(new Error(_0x78a4('0x85')));}}else{return _0x472bb1(new Error(_0x78a4('0x86')));}var _0x48bb5e=_0x23c2ce['name'];var _0x777fa6=_0x23c2ce['description'];var _0x4142b6=_0x23c2ce['type'];var _0x1508a4=_0x23c2ce[_0x78a4('0x87')]?_0x23c2ce[_0x78a4('0x87')]:'always';var _0x3778bd=_0x23c2ce[_0x78a4('0x88')]?_0x23c2ce['icon']:_0x78a4('0x89');var _0x233b48='';var _0x151961='';var _0x309d10='';var _0x16a36d='';var _0x55e7bc=_0x23c2ce[_0x78a4('0x77')];if(_0x4142b6===_0x78a4('0x7a')){if(_0x78a4('0x21')!=typeof _0x23c2ce[_0x78a4('0x7b')]['views'][_0x78a4('0x7d')]){var _0x31d79a=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x78a4('0x8a')](_0x31d79a)){_0x233b48=path['join'](_0x78a4('0x8b'),_0x5b7e83,_0x3cc732[0x0],_0x31d79a);}else{_0x233b48=_0x31d79a;}}else{logger[_0x78a4('0x63')](_0x78a4('0x8c'));}if(_0x78a4('0x21')!=typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')]['agent']){var _0x6fd63a=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x6fd63a)){_0x151961=path[_0x78a4('0x58')]('plugins',_0x5b7e83,_0x3cc732[0x0],_0x6fd63a);}else{_0x151961=_0x6fd63a;}}else{logger[_0x78a4('0x63')](_0x78a4('0x8d'));}}else if(_0x4142b6===_0x78a4('0x81')){_0x309d10=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x82')];_0x16a36d=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x84')];if('undefined'!=typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')]){if('undefined'!=typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7d')]){var _0x31d79a=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x78a4('0x8a')](_0x31d79a)){_0x233b48=path['join']('plugins',_0x5b7e83,_0x3cc732[0x0],_0x31d79a);}else{_0x233b48=_0x31d79a;}}if('undefined'!=typeof _0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')][_0x78a4('0x7e')]){var _0x6fd63a=_0x23c2ce[_0x78a4('0x7b')][_0x78a4('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x6fd63a)){_0x151961=path[_0x78a4('0x58')]('plugins',_0x5b7e83,_0x3cc732[0x0],_0x6fd63a);}else{_0x151961=_0x6fd63a;}}}}var _0x24fe87={'name':_0x48bb5e,'description':_0x777fa6,'path':path['join'](_0x5b7e83,_0x3cc732[0x0]),'type':_0x4142b6,'sidebar':_0x1508a4,'icon':_0x3778bd,'adminUrl':_0x233b48,'agentUrl':_0x151961,'scriptName':_0x309d10,'scriptPath':_0x16a36d,'version':_0x55e7bc};removeReferences(_0x3773f8,null);return db[_0x78a4('0x45')]['create'](_0x24fe87)['then'](function(_0x4d6afb){var _0x1c3f8b={'role':_0x403e85['body'][_0x78a4('0x8e')],'userProfileId':_0x403e85['body'][_0x78a4('0x8f')]};if(!_0x1c3f8b)throw new Error(_0x78a4('0x90'));if(_0x1c3f8b[_0x78a4('0x8e')]===_0x78a4('0x91')){var _0x2464ca=_0x4d6afb[_0x78a4('0x2a')]({'plain':!![]});return db[_0x78a4('0x92')][_0x78a4('0x49')]({'where':{'name':_0x78a4('0x2b'),'userProfileId':_0x1c3f8b['userProfileId']},'raw':!![]})[_0x78a4('0x28')](function(_0x307fff){if(_0x307fff&&_0x307fff[_0x78a4('0x93')]===0x0){return db[_0x78a4('0x2c')][_0x78a4('0x94')]({'name':_0x2464ca[_0x78a4('0x2f')],'resourceId':_0x2464ca['id'],'type':_0x307fff[_0x78a4('0x2f')],'sectionId':_0x307fff['id']},{})[_0x78a4('0x28')](function(){return _0x4d6afb;});}else{return _0x4d6afb;}})[_0x78a4('0x95')](function(_0x3ec368){logger[_0x78a4('0x2d')](_0x78a4('0x96'),_0x3ec368);throw _0x3ec368;});}return _0x4d6afb;})[_0x78a4('0x28')](respondWithResult(_0x170558,null))[_0x78a4('0x95')](handleError(_0x170558,null));}});}catch(_0x13a371){_0x170558[_0x78a4('0x1e')](0x1f4)['send'](_0x13a371);}};function removeReferences(_0x28d1cb,_0x4028a1){try{if(_0x28d1cb){fs[_0x78a4('0x62')](_0x28d1cb);logger[_0x78a4('0x63')](_0x78a4('0x97'));}if(_0x4028a1){rimraf(_0x4028a1,function(){});logger[_0x78a4('0x63')]('Extracted\x20folder\x20removed');}}catch(_0x2d293b){logger[_0x78a4('0x2d')](_0x2d293b);}}exports[_0x78a4('0x27')]=function(_0x176a08,_0x3f9700,_0x1c9005){return db[_0x78a4('0x45')][_0x78a4('0x49')]({'where':{'id':_0x176a08[_0x78a4('0x4b')]['id']}})[_0x78a4('0x28')](handleEntityNotFound(_0x3f9700,null))[_0x78a4('0x28')](saveUpdates(_0x176a08[_0x78a4('0x98')],null))['then'](respondWithResult(_0x3f9700,null))[_0x78a4('0x95')](handleError(_0x3f9700,null));};exports['delete']=function(_0x51a259,_0x19f3b1,_0x2467c2){return db['Plugin'][_0x78a4('0x49')]({'where':{'id':_0x51a259[_0x78a4('0x4b')]['id']}})[_0x78a4('0x28')](function(_0x2313c5){if(_0x2313c5){return _0x2313c5[_0x78a4('0x29')]();}})[_0x78a4('0x28')](function(_0x321808){rimraf(path[_0x78a4('0x58')](config['root'],_0x78a4('0x4c'),path[_0x78a4('0x5a')](_0x321808[_0x78a4('0x8')])),function(){});return _0x321808;})[_0x78a4('0x28')](handleEntityNotFound(_0x19f3b1,null))[_0x78a4('0x28')](respondWithStatusCode(_0x19f3b1,null))[_0x78a4('0x95')](handleError(_0x19f3b1,null));};exports[_0x78a4('0x99')]=function(_0x4bd3ca,_0x3ab55b,_0x358746){return BPromise[_0x78a4('0x9a')]()[_0x78a4('0x28')](function(){if(!_0x4bd3ca['query']['path']){throw new Error(_0x78a4('0x9b'));}if(!_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x9c')]){throw new Error(_0x78a4('0x9d'));}var _0x3710ee=_0x4bd3ca['query'][_0x78a4('0x9e')]?_0x4bd3ca['query'][_0x78a4('0x9e')]+':'+_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x9c')]:'http://localhost:'+_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x9c')];var _0x486e86=_0x4bd3ca['query'][_0x78a4('0x1f')]?_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x1f')]:!![];var _0x3dece2=_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x9f')]?_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x9f')]:null;var _0x5cce43={'method':_0x4bd3ca[_0x78a4('0xa0')],'uri':util['format'](_0x78a4('0xa1'),_0x3710ee,_0x4bd3ca['query'][_0x78a4('0x8')]),'json':_0x486e86,'resolveWithFullResponse':!![],'encoding':_0x3dece2,'qs':_0x4bd3ca['query']};if(_0x4bd3ca[_0x78a4('0xa2')]){_0x5cce43[_0x78a4('0xa2')]=_0x4bd3ca[_0x78a4('0xa2')];if(_0x5cce43[_0x78a4('0xa2')]['content-length']){delete _0x5cce43[_0x78a4('0xa2')][_0x78a4('0xa3')];}}if(_0x5cce43[_0x78a4('0xa2')][_0x78a4('0xa4')]){delete _0x5cce43[_0x78a4('0xa2')]['content-type'];}return rp(_0x5cce43);})[_0x78a4('0x28')](function(_0x2009f9){if(_0x2009f9){_0x3ab55b['set'](_0x2009f9[_0x78a4('0xa2')]);logger['info'](_0x2009f9[_0x78a4('0x98')]);if(_['endsWith'](_0x4bd3ca[_0x78a4('0x35')][_0x78a4('0x8')],_0x78a4('0x4a'))&&_0x2009f9['statusCode']==0x1f4){return _0x3ab55b['sendStatus'](_0x2009f9[_0x78a4('0xa5')]);}else{return _0x3ab55b[_0x78a4('0x1e')](_0x2009f9[_0x78a4('0xa5')])[_0x78a4('0xa6')](_0x2009f9[_0x78a4('0x98')]);}}else{return _0x3ab55b[_0x78a4('0x1c')](0xc8);}})[_0x78a4('0x95')](handleError(_0x3ab55b,null));};exports[_0x78a4('0xa7')]=function(_0x466d6b,_0x1c7686,_0x2cb124){return BPromise['resolve']()['then'](function(){if(!_0x466d6b['query'][_0x78a4('0x8')]){throw new Error(_0x78a4('0x9b'));}if(!_0x466d6b[_0x78a4('0x35')]['port']){throw new Error(_0x78a4('0x9d'));}var _0x336368=_0x466d6b[_0x78a4('0x35')]['hostname']?_0x466d6b[_0x78a4('0x35')][_0x78a4('0x9e')]+':'+_0x466d6b[_0x78a4('0x35')][_0x78a4('0x9c')]:_0x78a4('0xa8')+_0x466d6b[_0x78a4('0x35')][_0x78a4('0x9c')];var _0x26e3b9=_0x466d6b[_0x78a4('0x35')][_0x78a4('0x1f')]?_0x466d6b[_0x78a4('0x35')]['json']:!![];var _0x4fefd4=_0x466d6b[_0x78a4('0x35')]['encoding']?_0x466d6b[_0x78a4('0x35')][_0x78a4('0x9f')]:null;var _0x25e9fa={'method':_0x466d6b['method'],'uri':util[_0x78a4('0x4d')](_0x78a4('0xa1'),_0x336368,_0x466d6b[_0x78a4('0x35')][_0x78a4('0x8')]),'json':_0x26e3b9,'resolveWithFullResponse':!![],'encoding':_0x4fefd4,'body':_0x466d6b[_0x78a4('0x98')]};if(_0x466d6b['headers']){_0x25e9fa[_0x78a4('0xa2')]=_0x466d6b['headers'];if(_0x25e9fa[_0x78a4('0xa2')][_0x78a4('0xa3')]){delete _0x25e9fa['headers'][_0x78a4('0xa3')];}}if(_0x25e9fa[_0x78a4('0xa2')][_0x78a4('0xa4')]){delete _0x25e9fa[_0x78a4('0xa2')]['content-type'];}return rp(_0x25e9fa);})[_0x78a4('0x28')](function(_0x580d7d){if(_0x580d7d){_0x1c7686['set'](_0x580d7d[_0x78a4('0xa2')]);logger[_0x78a4('0x63')](_0x580d7d[_0x78a4('0x98')]);return _0x1c7686[_0x78a4('0x1e')](_0x580d7d['statusCode'])[_0x78a4('0xa6')](_0x580d7d['body']);}else{return _0x1c7686['sendStatus'](0xc8);}})[_0x78a4('0x95')](handleError(_0x1c7686,null));}; \ No newline at end of file +var _0x6c61=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','Plugins','end','error','stack','name','send','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','UserProfileResource','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','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','papaparse','extract-zip','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x8c443b,_0x16cd6c){var _0xd538c0=function(_0x3ae215){while(--_0x3ae215){_0x8c443b['push'](_0x8c443b['shift']());}};_0xd538c0(++_0x16cd6c);}(_0x6c61,0x95));var _0x16c6=function(_0x436c06,_0x559320){_0x436c06=_0x436c06-0x0;var _0x35ab53=_0x6c61[_0x436c06];return _0x35ab53;};'use strict';var emlformat=require(_0x16c6('0x0'));var rimraf=require(_0x16c6('0x1'));var zipdir=require(_0x16c6('0x2'));var jsonpatch=require(_0x16c6('0x3'));var rp=require(_0x16c6('0x4'));var moment=require(_0x16c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x16c6('0x6'));var util=require(_0x16c6('0x7'));var path=require(_0x16c6('0x8'));var sox=require('sox');var csv=require(_0x16c6('0x9'));var ejs=require(_0x16c6('0xa'));var fs=require('fs');var fs_extra=require(_0x16c6('0xb'));var _=require(_0x16c6('0xc'));var squel=require(_0x16c6('0xd'));var crypto=require(_0x16c6('0xe'));var jsforce=require(_0x16c6('0xf'));var deskjs=require(_0x16c6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x16c6('0x11'));var Papa=require(_0x16c6('0x12'));var extract=require(_0x16c6('0x13'));var rimraf=require(_0x16c6('0x1'));var archiver=require('archiver');var Redis=require(_0x16c6('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x16c6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16c6('0x16'));var logger=require(_0x16c6('0x17'))(_0x16c6('0x18'));var utils=require(_0x16c6('0x19'));var config=require(_0x16c6('0x1a'));var licenseUtil=require(_0x16c6('0x1b'));var db=require(_0x16c6('0x1c'))['db'];config[_0x16c6('0x1d')]=_[_0x16c6('0x1e')](config[_0x16c6('0x1d')],{'host':_0x16c6('0x1f'),'port':0x18eb});var socket=require(_0x16c6('0x20'))(new Redis(config[_0x16c6('0x1d')]));require(_0x16c6('0x21'))['register'](socket);function respondWithStatusCode(_0x256c8f,_0x20fae1){_0x20fae1=_0x20fae1||0xcc;return function(_0x4b34a9){if(_0x4b34a9){return _0x256c8f[_0x16c6('0x22')](_0x20fae1);}return _0x256c8f[_0x16c6('0x23')](_0x20fae1)['end']();};}function respondWithResult(_0x236fc5,_0x30f562){_0x30f562=_0x30f562||0xc8;return function(_0x263821){if(_0x263821){return _0x236fc5[_0x16c6('0x23')](_0x30f562)[_0x16c6('0x24')](_0x263821);}};}function respondWithFilteredResult(_0x2a1f5e,_0x48f886){return function(_0x3ad889){if(_0x3ad889){var _0x220c01=typeof _0x48f886['offset']==='undefined'&&typeof _0x48f886['limit']===_0x16c6('0x25');var _0x3c4aa9=_0x3ad889[_0x16c6('0x26')];var _0x3e7dba=_0x220c01?0x0:_0x48f886[_0x16c6('0x27')];var _0x12cefa=_0x220c01?_0x3ad889[_0x16c6('0x26')]:_0x48f886['offset']+_0x48f886[_0x16c6('0x28')];var _0x49f55c;if(_0x12cefa>=_0x3c4aa9){_0x12cefa=_0x3c4aa9;_0x49f55c=0xc8;}else{_0x49f55c=0xce;}_0x2a1f5e[_0x16c6('0x23')](_0x49f55c);return _0x2a1f5e[_0x16c6('0x29')](_0x16c6('0x2a'),_0x3e7dba+'-'+_0x12cefa+'/'+_0x3c4aa9)['json'](_0x3ad889);}return null;};}function patchUpdates(_0x286d3e){return function(_0x40159d){try{jsonpatch['apply'](_0x40159d,_0x286d3e,!![]);}catch(_0x458659){return BPromise[_0x16c6('0x2b')](_0x458659);}return _0x40159d[_0x16c6('0x2c')]();};}function saveUpdates(_0x29739c,_0x49fe09){return function(_0xaf6f92){if(_0xaf6f92){return _0xaf6f92[_0x16c6('0x2d')](_0x29739c)[_0x16c6('0x2e')](function(_0x149699){return _0x149699;});}return null;};}function removeEntity(_0x289597,_0x250784){return function(_0x1ebb3e){if(_0x1ebb3e){return _0x1ebb3e[_0x16c6('0x2f')]()[_0x16c6('0x2e')](function(){var _0x214031=_0x1ebb3e['get']({'plain':!![]});var _0x1e550d=_0x16c6('0x30');return db['UserProfileResource'][_0x16c6('0x2f')]({'where':{'type':_0x1e550d,'resourceId':_0x214031['id']}})[_0x16c6('0x2e')](function(){return _0x1ebb3e;});})[_0x16c6('0x2e')](function(){_0x289597[_0x16c6('0x23')](0xcc)[_0x16c6('0x31')]();});}};}function handleEntityNotFound(_0x558b02,_0x2e8433){return function(_0x3da5eb){if(!_0x3da5eb){_0x558b02[_0x16c6('0x22')](0x194);}return _0x3da5eb;};}function handleError(_0x3768c0,_0x99eaf3){_0x99eaf3=_0x99eaf3||0x1f4;return function(_0x1f6bf1){logger[_0x16c6('0x32')](_0x1f6bf1[_0x16c6('0x33')]);if(_0x1f6bf1[_0x16c6('0x34')]){delete _0x1f6bf1[_0x16c6('0x34')];}_0x3768c0['status'](_0x99eaf3)[_0x16c6('0x35')](_0x1f6bf1);};}exports['index']=function(_0x1c20df,_0x46b16d){var _0x439e06={},_0x1ed26c={},_0x38634f={'count':0x0,'rows':[]};var _0x2325db=_['map'](db[_0x16c6('0x36')][_0x16c6('0x37')],function(_0x4b9e1d){return{'name':_0x4b9e1d[_0x16c6('0x38')],'type':_0x4b9e1d[_0x16c6('0x39')][_0x16c6('0x3a')]};});_0x1ed26c[_0x16c6('0x3b')]=_[_0x16c6('0x3c')](_0x2325db,_0x16c6('0x34'));_0x1ed26c[_0x16c6('0x3d')]=_[_0x16c6('0x3e')](_0x1c20df[_0x16c6('0x3d')]);_0x1ed26c[_0x16c6('0x3f')]=_[_0x16c6('0x40')](_0x1ed26c['model'],_0x1ed26c[_0x16c6('0x3d')]);_0x439e06[_0x16c6('0x41')]=_['intersection'](_0x1ed26c['model'],qs[_0x16c6('0x42')](_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x42')]));_0x439e06[_0x16c6('0x41')]=_0x439e06['attributes'][_0x16c6('0x43')]?_0x439e06[_0x16c6('0x41')]:_0x1ed26c[_0x16c6('0x3b')];if(!_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x44')](_0x16c6('0x45'))){_0x439e06[_0x16c6('0x28')]=qs['limit'](_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x28')]);_0x439e06[_0x16c6('0x27')]=qs[_0x16c6('0x27')](_0x1c20df['query'][_0x16c6('0x27')]);}_0x439e06[_0x16c6('0x46')]=qs['sort'](_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x47')]);_0x439e06[_0x16c6('0x48')]=qs['filters'](_[_0x16c6('0x49')](_0x1c20df['query'],_0x1ed26c[_0x16c6('0x3f')]),_0x2325db);if(_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x4a')]){_0x439e06[_0x16c6('0x48')]=_[_0x16c6('0x4b')](_0x439e06[_0x16c6('0x48')],{'$or':_[_0x16c6('0x3c')](_0x2325db,function(_0xcd1f30){if(_0xcd1f30[_0x16c6('0x39')]!=='VIRTUAL'){var _0x466f5e={};_0x466f5e[_0xcd1f30[_0x16c6('0x34')]]={'$like':'%'+_0x1c20df[_0x16c6('0x3d')][_0x16c6('0x4a')]+'%'};return _0x466f5e;}})});}_0x439e06=_[_0x16c6('0x4b')]({},_0x439e06,_0x1c20df[_0x16c6('0x4c')]);var _0x367e18={'where':_0x439e06[_0x16c6('0x48')]};return db[_0x16c6('0x36')][_0x16c6('0x26')](_0x367e18)[_0x16c6('0x2e')](function(_0x31babb){_0x38634f[_0x16c6('0x26')]=_0x31babb;if(_0x1c20df['query'][_0x16c6('0x4d')]){_0x439e06[_0x16c6('0x4e')]=[{'all':!![]}];}return db[_0x16c6('0x36')][_0x16c6('0x4f')](_0x439e06);})[_0x16c6('0x2e')](function(_0x3f47b0){_0x38634f[_0x16c6('0x50')]=_0x3f47b0;return _0x38634f;})['then'](respondWithFilteredResult(_0x46b16d,_0x439e06))['catch'](handleError(_0x46b16d,null));};exports[_0x16c6('0x51')]=function(_0x8b3e19,_0x2d38f5){var _0x488215={'raw':!![],'where':{'id':_0x8b3e19['params']['id']}},_0x5c11b8={};_0x5c11b8[_0x16c6('0x3b')]=_[_0x16c6('0x3e')](db[_0x16c6('0x36')][_0x16c6('0x37')]);_0x5c11b8[_0x16c6('0x3d')]=_[_0x16c6('0x3e')](_0x8b3e19['query']);_0x5c11b8[_0x16c6('0x3f')]=_[_0x16c6('0x40')](_0x5c11b8['model'],_0x5c11b8[_0x16c6('0x3d')]);_0x488215['attributes']=_[_0x16c6('0x40')](_0x5c11b8[_0x16c6('0x3b')],qs[_0x16c6('0x42')](_0x8b3e19[_0x16c6('0x3d')][_0x16c6('0x42')]));_0x488215[_0x16c6('0x41')]=_0x488215['attributes'][_0x16c6('0x43')]?_0x488215[_0x16c6('0x41')]:_0x5c11b8[_0x16c6('0x3b')];if(_0x8b3e19['query']['includeAll']){_0x488215[_0x16c6('0x4e')]=[{'all':!![]}];}_0x488215=_[_0x16c6('0x4b')]({},_0x488215,_0x8b3e19[_0x16c6('0x4c')]);return db[_0x16c6('0x36')][_0x16c6('0x52')](_0x488215)['then'](handleEntityNotFound(_0x2d38f5,null))['then'](respondWithResult(_0x2d38f5,null))[_0x16c6('0x53')](handleError(_0x2d38f5,null));};exports[_0x16c6('0x54')]=function(_0x4d899c,_0xbf9828,_0x59b5e6){return db['Plugin'][_0x16c6('0x52')]({'where':{'id':_0x4d899c[_0x16c6('0x55')]['id']},'attributes':[_0x16c6('0x34'),_0x16c6('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0xbf9828,null))[_0x16c6('0x2e')](function(_0x56410c){if(_0x56410c){var _0x1bbea2=path[_0x16c6('0x56')](config[_0x16c6('0x57')],_0x16c6('0x58'),util[_0x16c6('0x59')](_0x16c6('0x5a'),path[_0x16c6('0x5b')](_0x56410c[_0x16c6('0x8')])));var _0x348e2c=fs[_0x16c6('0x5c')](_0x1bbea2);var _0x31fb7d=archiver(_0x16c6('0x5d'),{'zlib':{'level':0x9}});_0x31fb7d['on'](_0x16c6('0x5e'),function(_0x496e50){if(_0x496e50[_0x16c6('0x5f')]===_0x16c6('0x60')){logger[_0x16c6('0x32')](_0x496e50);}else{throw new db['Sequelize'][(_0x16c6('0x61'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x31fb7d['on'](_0x16c6('0x32'),function(_0x1693ee){throw new db[(_0x16c6('0x62'))][(_0x16c6('0x61'))](_0x16c6('0x63'));});_0x31fb7d['pipe'](_0x348e2c);_0x31fb7d[_0x16c6('0x64')](_0x16c6('0x65'),{'cwd':path[_0x16c6('0x56')](config['root'],_0x16c6('0x58'),path['dirname'](_0x56410c['path'])),'ignore':[path[_0x16c6('0x56')](path[_0x16c6('0x5b')](_0x56410c['path']),'node_modules/**/*'),path['join'](path['basename'](_0x56410c[_0x16c6('0x8')]),_0x16c6('0x66'))],'nodir':!![]})['finalize']();_0x348e2c['on']('close',function(){if(!fs[_0x16c6('0x67')](_0x1bbea2)){throw new db['Sequelize'][(_0x16c6('0x61'))](_0x16c6('0x68'));}return _0xbf9828['download'](_0x1bbea2,util[_0x16c6('0x59')](_0x16c6('0x5a'),path[_0x16c6('0x5b')](_0x56410c[_0x16c6('0x8')])),function(_0x549564){if(_0x549564){throw new db[(_0x16c6('0x62'))]['Error'](_0x16c6('0x69'));}fs[_0x16c6('0x6a')](_0x1bbea2);logger[_0x16c6('0x6b')](_0x16c6('0x6c'));logger[_0x16c6('0x6b')](_0x16c6('0x6d'));});});}return null;})[_0x16c6('0x53')](handleError(_0xbf9828,null));};exports[_0x16c6('0x6e')]=function(_0x165f70,_0x3b68ff,_0x22f306){var _0x48830b=path['basename'](_0x165f70['file'][_0x16c6('0x6f')],path[_0x16c6('0x70')](_0x165f70[_0x16c6('0x71')][_0x16c6('0x6f')]));var _0x4a55c2=path[_0x16c6('0x56')](config[_0x16c6('0x57')],_0x16c6('0x58'),_0x165f70[_0x16c6('0x71')][_0x16c6('0x6f')]);var _0x42c9dd=path['join'](config[_0x16c6('0x57')],_0x16c6('0x58'),_0x48830b);logger[_0x16c6('0x6b')](_0x16c6('0x72'),_0x4a55c2);logger[_0x16c6('0x6b')](_0x16c6('0x73'),_0x42c9dd);try{fs[_0x16c6('0x74')](_0x4a55c2,parseInt(_0x16c6('0x75'),0x8));extract(_0x4a55c2,{'dir':_0x42c9dd},function(_0x418d4a){if(_0x418d4a){logger[_0x16c6('0x32')](_0x418d4a);handleError(_0x418d4a,!![]);};var _0x1c54b5=fs['readdirSync'](_0x42c9dd);if(_0x1c54b5[_0x16c6('0x43')]>0x1){removeReferences(_0x4a55c2,_0x42c9dd);logger[_0x16c6('0x32')](_0x16c6('0x76'));return _0x22f306(new Error(_0x16c6('0x76')));}var _0x40f119=fs['lstatSync'](path['join'](_0x42c9dd,_0x1c54b5[0x0]));if(_0x40f119['isFile']()){removeReferences(_0x4a55c2,_0x42c9dd);logger[_0x16c6('0x32')](_0x16c6('0x76'));return _0x22f306(new Error(_0x16c6('0x76')));}if(_0x40f119[_0x16c6('0x77')]()){var _0x4ff6a5=fs[_0x16c6('0x78')](path[_0x16c6('0x56')](_0x42c9dd,_0x1c54b5[0x0]));if(_0x4ff6a5[_0x16c6('0x43')]===0x0){removeReferences(_0x4a55c2,_0x42c9dd);logger[_0x16c6('0x32')](_0x16c6('0x76'));return _0x22f306(new Error(_0x16c6('0x76')));}var _0x31b8c5=_0x4ff6a5[_0x16c6('0x79')](function(_0x3ab07b){return _0x3ab07b===_0x16c6('0x7a');});if(!_0x31b8c5){return _0x22f306(new Error(_0x16c6('0x7b')));}var _0x3ae361=fs[_0x16c6('0x7c')](path[_0x16c6('0x56')](_0x42c9dd,_0x1c54b5[0x0],_0x16c6('0x7a')));var _0x12d727=JSON['parse'](_0x3ae361);if(_0x16c6('0x25')==typeof _0x12d727['name']){return _0x22f306(new Error(_0x16c6('0x7d')));}if('undefined'==typeof _0x12d727[_0x16c6('0x39')]){return _0x22f306(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x16c6('0x25')==typeof _0x12d727[_0x16c6('0x7e')]){return _0x22f306(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x16c6('0x25')==typeof _0x12d727[_0x16c6('0x7f')]){return _0x22f306(new Error(_0x16c6('0x80')));}if(_0x12d727[_0x16c6('0x39')]===_0x16c6('0x81')){if(_0x16c6('0x25')==typeof _0x12d727[_0x16c6('0x7f')][_0x16c6('0x82')]){return _0x22f306(new Error(_0x16c6('0x83')));}if(_0x16c6('0x25')==typeof _0x12d727[_0x16c6('0x7f')]['views']['admin']&&'undefined'==typeof _0x12d727['parameters'][_0x16c6('0x82')][_0x16c6('0x84')]){return _0x22f306(new Error(_0x16c6('0x85')));}}else if(_0x12d727[_0x16c6('0x39')]===_0x16c6('0x86')){if(_0x16c6('0x25')==typeof _0x12d727[_0x16c6('0x7f')]['scriptName']){return _0x22f306(new Error(_0x16c6('0x87')));}if('undefined'==typeof _0x12d727[_0x16c6('0x7f')]['scriptPath']){return _0x22f306(new Error(_0x16c6('0x88')));}}else{return _0x22f306(new Error(_0x16c6('0x89')));}var _0x424ecf=_0x12d727[_0x16c6('0x34')];var _0x5e5f9b=_0x12d727[_0x16c6('0x8a')];var _0x169915=_0x12d727[_0x16c6('0x39')];var _0x40291d=_0x12d727[_0x16c6('0x8b')]?_0x12d727[_0x16c6('0x8b')]:_0x16c6('0x8c');var _0x25e30a=_0x12d727['icon']?_0x12d727[_0x16c6('0x8d')]:_0x16c6('0x8e');var _0x67539d='';var _0x14a8d9='';var _0x4250f8='';var _0x26edf5='';var _0x38112e=_0x12d727[_0x16c6('0x7e')];if(_0x169915===_0x16c6('0x81')){if(_0x16c6('0x25')!=typeof _0x12d727[_0x16c6('0x7f')]['views'][_0x16c6('0x8f')]){var _0x21c730=_0x12d727[_0x16c6('0x7f')][_0x16c6('0x82')][_0x16c6('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x16c6('0x90')](_0x21c730)){_0x67539d=path[_0x16c6('0x56')](_0x16c6('0x91'),_0x48830b,_0x1c54b5[0x0],_0x21c730);}else{_0x67539d=_0x21c730;}}else{logger[_0x16c6('0x6b')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x16c6('0x25')!=typeof _0x12d727[_0x16c6('0x7f')]['views'][_0x16c6('0x84')]){var _0x406dca=_0x12d727['parameters'][_0x16c6('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x16c6('0x90')](_0x406dca)){_0x14a8d9=path[_0x16c6('0x56')](_0x16c6('0x91'),_0x48830b,_0x1c54b5[0x0],_0x406dca);}else{_0x14a8d9=_0x406dca;}}else{logger[_0x16c6('0x6b')](_0x16c6('0x92'));}}else if(_0x169915===_0x16c6('0x86')){_0x4250f8=_0x12d727['parameters'][_0x16c6('0x93')];_0x26edf5=_0x12d727[_0x16c6('0x7f')][_0x16c6('0x94')];if(_0x16c6('0x25')!=typeof _0x12d727[_0x16c6('0x7f')][_0x16c6('0x82')]){if('undefined'!=typeof _0x12d727[_0x16c6('0x7f')][_0x16c6('0x82')]['admin']){var _0x21c730=_0x12d727[_0x16c6('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x16c6('0x90')](_0x21c730)){_0x67539d=path[_0x16c6('0x56')](_0x16c6('0x91'),_0x48830b,_0x1c54b5[0x0],_0x21c730);}else{_0x67539d=_0x21c730;}}if(_0x16c6('0x25')!=typeof _0x12d727['parameters'][_0x16c6('0x82')]['agent']){var _0x406dca=_0x12d727['parameters'][_0x16c6('0x82')][_0x16c6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x16c6('0x90')](_0x406dca)){_0x14a8d9=path['join'](_0x16c6('0x91'),_0x48830b,_0x1c54b5[0x0],_0x406dca);}else{_0x14a8d9=_0x406dca;}}}}var _0xc2d3b9={'name':_0x424ecf,'description':_0x5e5f9b,'path':path[_0x16c6('0x56')](_0x48830b,_0x1c54b5[0x0]),'type':_0x169915,'sidebar':_0x40291d,'icon':_0x25e30a,'adminUrl':_0x67539d,'agentUrl':_0x14a8d9,'scriptName':_0x4250f8,'scriptPath':_0x26edf5,'version':_0x38112e};removeReferences(_0x4a55c2,null);return db['Plugin'][_0x16c6('0x95')](_0xc2d3b9)[_0x16c6('0x2e')](function(_0x471a18){var _0x4daad2={'role':_0x165f70[_0x16c6('0x96')][_0x16c6('0x97')],'userProfileId':_0x165f70[_0x16c6('0x96')]['userProfileId']};if(!_0x4daad2)throw new Error(_0x16c6('0x98'));if(_0x4daad2[_0x16c6('0x97')]===_0x16c6('0x99')){var _0x3dcf21=_0x471a18[_0x16c6('0x9a')]({'plain':!![]});return db[_0x16c6('0x9b')][_0x16c6('0x52')]({'where':{'name':_0x16c6('0x30'),'userProfileId':_0x4daad2[_0x16c6('0x9c')]},'raw':!![]})['then'](function(_0x2f8474){if(_0x2f8474&&_0x2f8474['autoAssociation']===0x0){return db[_0x16c6('0x9d')][_0x16c6('0x95')]({'name':_0x3dcf21[_0x16c6('0x34')],'resourceId':_0x3dcf21['id'],'type':_0x2f8474[_0x16c6('0x34')],'sectionId':_0x2f8474['id']},{})[_0x16c6('0x2e')](function(){return _0x471a18;});}else{return _0x471a18;}})['catch'](function(_0x57c852){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57c852);throw _0x57c852;});}return _0x471a18;})[_0x16c6('0x2e')](respondWithResult(_0x3b68ff,null))[_0x16c6('0x53')](handleError(_0x3b68ff,null));}});}catch(_0x126f6a){_0x3b68ff[_0x16c6('0x23')](0x1f4)['send'](_0x126f6a);}};function removeReferences(_0x1cf236,_0x394a00){try{if(_0x1cf236){fs['unlinkSync'](_0x1cf236);logger[_0x16c6('0x6b')]('Zip\x20archive\x20removed');}if(_0x394a00){rimraf(_0x394a00,function(){});logger[_0x16c6('0x6b')](_0x16c6('0x9e'));}}catch(_0x26c3e0){logger[_0x16c6('0x32')](_0x26c3e0);}}exports['update']=function(_0x317745,_0x202651,_0x488a05){return db[_0x16c6('0x36')][_0x16c6('0x52')]({'where':{'id':_0x317745[_0x16c6('0x55')]['id']}})[_0x16c6('0x2e')](handleEntityNotFound(_0x202651,null))[_0x16c6('0x2e')](saveUpdates(_0x317745[_0x16c6('0x96')],null))[_0x16c6('0x2e')](respondWithResult(_0x202651,null))[_0x16c6('0x53')](handleError(_0x202651,null));};exports['delete']=function(_0x1a0f8a,_0x334843,_0x309172){return db[_0x16c6('0x36')][_0x16c6('0x52')]({'where':{'id':_0x1a0f8a[_0x16c6('0x55')]['id']}})[_0x16c6('0x2e')](function(_0x51b65c){if(_0x51b65c){return _0x51b65c[_0x16c6('0x2f')]();}})[_0x16c6('0x2e')](function(_0x4bda44){rimraf(path['join'](config[_0x16c6('0x57')],_0x16c6('0x58'),path[_0x16c6('0x9f')](_0x4bda44[_0x16c6('0x8')])),function(){});return _0x4bda44;})['then'](handleEntityNotFound(_0x334843,null))[_0x16c6('0x2e')](respondWithStatusCode(_0x334843,null))[_0x16c6('0x53')](handleError(_0x334843,null));};exports[_0x16c6('0xa0')]=function(_0x392650,_0x415aa6,_0x263c2e){return BPromise[_0x16c6('0xa1')]()[_0x16c6('0x2e')](function(){if(!_0x392650['query'][_0x16c6('0x8')]){throw new Error(_0x16c6('0xa2'));}if(!_0x392650[_0x16c6('0x3d')][_0x16c6('0xa3')]){throw new Error(_0x16c6('0xa4'));}var _0x3129a8=_0x392650[_0x16c6('0x3d')][_0x16c6('0xa5')]?_0x392650[_0x16c6('0x3d')][_0x16c6('0xa5')]+':'+_0x392650[_0x16c6('0x3d')][_0x16c6('0xa3')]:_0x16c6('0xa6')+_0x392650[_0x16c6('0x3d')]['port'];var _0x1f4ff6=_0x392650[_0x16c6('0x3d')]['json']?_0x392650[_0x16c6('0x3d')][_0x16c6('0x24')]:!![];var _0x596741=_0x392650[_0x16c6('0x3d')][_0x16c6('0xa7')]?_0x392650[_0x16c6('0x3d')][_0x16c6('0xa7')]:null;var _0x1694a9={'method':_0x392650[_0x16c6('0xa8')],'uri':util[_0x16c6('0x59')](_0x16c6('0xa9'),_0x3129a8,_0x392650[_0x16c6('0x3d')][_0x16c6('0x8')]),'json':_0x1f4ff6,'resolveWithFullResponse':!![],'encoding':_0x596741,'qs':_0x392650[_0x16c6('0x3d')]};if(_0x392650['headers']){_0x1694a9[_0x16c6('0xaa')]=_0x392650[_0x16c6('0xaa')];if(_0x1694a9['headers'][_0x16c6('0xab')]){delete _0x1694a9[_0x16c6('0xaa')][_0x16c6('0xab')];}}if(_0x1694a9[_0x16c6('0xaa')][_0x16c6('0xac')]){delete _0x1694a9[_0x16c6('0xaa')][_0x16c6('0xac')];}return rp(_0x1694a9);})[_0x16c6('0x2e')](function(_0x141b0b){if(_0x141b0b){_0x415aa6[_0x16c6('0x29')](_0x141b0b[_0x16c6('0xaa')]);logger[_0x16c6('0x6b')](_0x141b0b[_0x16c6('0x96')]);if(_[_0x16c6('0xad')](_0x392650[_0x16c6('0x3d')][_0x16c6('0x8')],_0x16c6('0x54'))&&_0x141b0b['statusCode']==0x1f4){return _0x415aa6[_0x16c6('0x22')](_0x141b0b['statusCode']);}else{return _0x415aa6['status'](_0x141b0b[_0x16c6('0xae')])[_0x16c6('0x35')](_0x141b0b['body']);}}else{return _0x415aa6[_0x16c6('0x22')](0xc8);}})[_0x16c6('0x53')](handleError(_0x415aa6,null));};exports[_0x16c6('0xaf')]=function(_0x16c1b1,_0x4c3f9c,_0x5197f5){return BPromise[_0x16c6('0xa1')]()[_0x16c6('0x2e')](function(){if(!_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0x8')]){throw new Error(_0x16c6('0xa2'));}if(!_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa3')]){throw new Error(_0x16c6('0xa4'));}var _0x117ab1=_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa5')]?_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa5')]+':'+_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa3')]:_0x16c6('0xa6')+_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa3')];var _0x164bb2=_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0x24')]?_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0x24')]:!![];var _0x169e36=_0x16c1b1['query'][_0x16c6('0xa7')]?_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0xa7')]:null;var _0xd26a1d={'method':_0x16c1b1[_0x16c6('0xa8')],'uri':util[_0x16c6('0x59')](_0x16c6('0xa9'),_0x117ab1,_0x16c1b1[_0x16c6('0x3d')][_0x16c6('0x8')]),'json':_0x164bb2,'resolveWithFullResponse':!![],'encoding':_0x169e36,'body':_0x16c1b1[_0x16c6('0x96')]};if(_0x16c1b1[_0x16c6('0xaa')]){_0xd26a1d[_0x16c6('0xaa')]=_0x16c1b1[_0x16c6('0xaa')];if(_0xd26a1d[_0x16c6('0xaa')][_0x16c6('0xab')]){delete _0xd26a1d[_0x16c6('0xaa')]['content-length'];}}if(_0xd26a1d[_0x16c6('0xaa')][_0x16c6('0xac')]){delete _0xd26a1d['headers'][_0x16c6('0xac')];}return rp(_0xd26a1d);})[_0x16c6('0x2e')](function(_0x106b76){if(_0x106b76){_0x4c3f9c[_0x16c6('0x29')](_0x106b76['headers']);logger['info'](_0x106b76[_0x16c6('0x96')]);return _0x4c3f9c[_0x16c6('0x23')](_0x106b76['statusCode'])[_0x16c6('0x35')](_0x106b76[_0x16c6('0x96')]);}else{return _0x4c3f9c['sendStatus'](0xc8);}})[_0x16c6('0x53')](handleError(_0x4c3f9c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b0f86d6..73b83ed 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 _0x8ac9=['remove','emit','exports','events','../../mysqldb','Plugin','update'];(function(_0x1366c2,_0x219667){var _0x53ce5c=function(_0x3fbf74){while(--_0x3fbf74){_0x1366c2['push'](_0x1366c2['shift']());}};_0x53ce5c(++_0x219667);}(_0x8ac9,0x199));var _0x98ac=function(_0x30f2d2,_0x413650){_0x30f2d2=_0x30f2d2-0x0;var _0x285f5c=_0x8ac9[_0x30f2d2];return _0x285f5c;};'use strict';var EventEmitter=require(_0x98ac('0x0'));var Plugin=require(_0x98ac('0x1'))['db'][_0x98ac('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x98ac('0x3'),'afterDestroy':_0x98ac('0x4')};function emitEvent(_0xd555bb){return function(_0x59f76b,_0x4bac60,_0x18968a){PluginEvents[_0x98ac('0x5')](_0xd555bb+':'+_0x59f76b['id'],_0x59f76b);PluginEvents[_0x98ac('0x5')](_0xd555bb,_0x59f76b);_0x18968a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x98ac('0x6')]=PluginEvents; \ No newline at end of file +var _0x36c3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2e0342,_0x2bae01){var _0xe38517=function(_0x427432){while(--_0x427432){_0x2e0342['push'](_0x2e0342['shift']());}};_0xe38517(++_0x2bae01);}(_0x36c3,0x1a6));var _0x336c=function(_0x3b59ed,_0x281a70){_0x3b59ed=_0x3b59ed-0x0;var _0x5cf829=_0x36c3[_0x3b59ed];return _0x5cf829;};'use strict';var EventEmitter=require(_0x336c('0x0'));var Plugin=require(_0x336c('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x336c('0x2')](0x0);var events={'afterCreate':_0x336c('0x3'),'afterUpdate':_0x336c('0x4'),'afterDestroy':_0x336c('0x5')};function emitEvent(_0x32aed2){return function(_0x2b1194,_0x39ed12,_0x4e4c07){PluginEvents[_0x336c('0x6')](_0x32aed2+':'+_0x2b1194['id'],_0x2b1194);PluginEvents[_0x336c('0x6')](_0x32aed2,_0x2b1194);_0x4e4c07(null);};}for(var e in events){if(events[_0x336c('0x7')](e)){var event=events[e];Plugin[_0x336c('0x8')](e,emitEvent(event));}}module[_0x336c('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 64b63f6..1f42643 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 _0xf881=['define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x1bb1c0,_0x4d0be1){var _0x51722c=function(_0x2c4a65){while(--_0x2c4a65){_0x1bb1c0['push'](_0x1bb1c0['shift']());}};_0x51722c(++_0x4d0be1);}(_0xf881,0x9f));var _0x1f88=function(_0x84b7f2,_0x3bbc1d){_0x84b7f2=_0x84b7f2-0x0;var _0x52f617=_0xf881[_0x84b7f2];return _0x52f617;};'use strict';var _=require(_0x1f88('0x0'));var util=require(_0x1f88('0x1'));var logger=require(_0x1f88('0x2'))('api');var moment=require(_0x1f88('0x3'));var BPromise=require(_0x1f88('0x4'));var rp=require(_0x1f88('0x5'));var fs=require('fs');var path=require(_0x1f88('0x6'));var rimraf=require('rimraf');var config=require(_0x1f88('0x7'));var attributes=require('./plugin.attributes');module[_0x1f88('0x8')]=function(_0x451378,_0x4b7548){return _0x451378[_0x1f88('0x9')](_0x1f88('0xa'),attributes,{'tableName':_0x1f88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c55=['rimraf','../../config/environment','./plugin.attributes','exports','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1365f,_0x5c7d6c){var _0x44b645=function(_0x30bf4b){while(--_0x30bf4b){_0x1365f['push'](_0x1365f['shift']());}};_0x44b645(++_0x5c7d6c);}(_0x7c55,0x180));var _0x57c5=function(_0x313fab,_0x12b630){_0x313fab=_0x313fab-0x0;var _0xbd1834=_0x7c55[_0x313fab];return _0xbd1834;};'use strict';var _=require(_0x57c5('0x0'));var util=require(_0x57c5('0x1'));var logger=require(_0x57c5('0x2'))(_0x57c5('0x3'));var moment=require(_0x57c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x57c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57c5('0x6'));var config=require(_0x57c5('0x7'));var attributes=require(_0x57c5('0x8'));module[_0x57c5('0x9')]=function(_0x1be252,_0x51fa53){return _0x1be252['define']('Plugin',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 daa42dc..1c14281 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 _0x290f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','Plugin,\x20%s,\x20%s','result','Plugin','create','body','options','raw','CreatePlugin','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x8d29a8,_0x5582c3){var _0x1c6535=function(_0x338c){while(--_0x338c){_0x8d29a8['push'](_0x8d29a8['shift']());}};_0x1c6535(++_0x5582c3);}(_0x290f,0x110));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf290('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf290('0x1'));var rs=require(_0xf290('0x2'));var fs=require('fs');var Redis=require(_0xf290('0x3'));var db=require(_0xf290('0x4'))['db'];var utils=require(_0xf290('0x5'));var logger=require(_0xf290('0x6'))(_0xf290('0x7'));var config=require(_0xf290('0x8'));var jayson=require(_0xf290('0x9'));var client=jayson[_0xf290('0xa')][_0xf290('0xb')]({'port':0x232a});config[_0xf290('0xc')]=_[_0xf290('0xd')](config[_0xf290('0xc')],{'host':_0xf290('0xe'),'port':0x18eb});var socket=require(_0xf290('0xf'))(new Redis(config[_0xf290('0xc')]));require(_0xf290('0x10'))['register'](socket);function respondWithRpcPromise(_0x2e39cb,_0x54df86,_0x546b2){return new BPromise(function(_0x13826d,_0x5e9386){return client[_0xf290('0x11')](_0x2e39cb,_0x546b2)[_0xf290('0x12')](function(_0x10c8b4){logger[_0xf290('0x13')]('Plugin,\x20%s,\x20%s',_0x54df86,_0xf290('0x14'));logger[_0xf290('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x54df86,'request\x20sent',JSON[_0xf290('0x16')](_0x10c8b4));if(_0x10c8b4[_0xf290('0x17')]){if(_0x10c8b4[_0xf290('0x17')][_0xf290('0x18')]===0x1f4){logger[_0xf290('0x17')]('Plugin,\x20%s,\x20%s',_0x54df86,_0x10c8b4['error'][_0xf290('0x19')]);return _0x5e9386(_0x10c8b4[_0xf290('0x17')][_0xf290('0x19')]);}logger[_0xf290('0x17')]('Plugin,\x20%s,\x20%s',_0x54df86,_0x10c8b4['error'][_0xf290('0x19')]);return _0x13826d(_0x10c8b4[_0xf290('0x17')][_0xf290('0x19')]);}else{logger[_0xf290('0x13')](_0xf290('0x1a'),_0x54df86,'request\x20sent');_0x13826d(_0x10c8b4[_0xf290('0x1b')][_0xf290('0x19')]);}})['catch'](function(_0x33ddda){logger[_0xf290('0x17')](_0xf290('0x1a'),_0x54df86,_0x33ddda);_0x5e9386(_0x33ddda);});});}exports['CreatePlugin']=function(_0x165641){var _0x16c7c1=this;return new Promise(function(_0x50b07e,_0x32e1d1){return db[_0xf290('0x1c')][_0xf290('0x1d')](_0x165641[_0xf290('0x1e')],{'raw':_0x165641[_0xf290('0x1f')]?_0x165641[_0xf290('0x1f')][_0xf290('0x20')]===undefined?!![]:![]:!![]})[_0xf290('0x12')](function(_0x87ece){logger[_0xf290('0x13')](_0xf290('0x21'),_0x165641);logger[_0xf290('0x15')](_0xf290('0x21'),_0x165641,JSON[_0xf290('0x16')](_0x87ece));_0x50b07e(_0x87ece);})[_0xf290('0x22')](function(_0xcae9f){logger['error'](_0xf290('0x21'),_0xcae9f[_0xf290('0x19')],_0x165641);_0x32e1d1(_0x16c7c1[_0xf290('0x17')](0x1f4,_0xcae9f['message']));});});}; \ No newline at end of file +var _0xbd3b=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreatePlugin','Plugin','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1fb60f,_0x1bc7f3){var _0x5871af=function(_0x152390){while(--_0x152390){_0x1fb60f['push'](_0x1fb60f['shift']());}};_0x5871af(++_0x1bc7f3);}(_0xbd3b,0x9a));var _0xbbd3=function(_0x1d0458,_0x389f29){_0x1d0458=_0x1d0458-0x0;var _0x35eea4=_0xbd3b[_0x1d0458];return _0x35eea4;};'use strict';var _=require(_0xbbd3('0x0'));var util=require('util');var moment=require(_0xbbd3('0x1'));var BPromise=require(_0xbbd3('0x2'));var rs=require(_0xbbd3('0x3'));var fs=require('fs');var Redis=require(_0xbbd3('0x4'));var db=require(_0xbbd3('0x5'))['db'];var utils=require(_0xbbd3('0x6'));var logger=require(_0xbbd3('0x7'))('rpc');var config=require(_0xbbd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbbd3('0x9')][_0xbbd3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbbd3('0xb')],{'host':_0xbbd3('0xc'),'port':0x18eb});var socket=require(_0xbbd3('0xd'))(new Redis(config['redis']));require(_0xbbd3('0xe'))[_0xbbd3('0xf')](socket);function respondWithRpcPromise(_0x1a4684,_0x452ab7,_0x192be3){return new BPromise(function(_0xa090e3,_0x564814){return client['request'](_0x1a4684,_0x192be3)[_0xbbd3('0x10')](function(_0x1d7646){logger['info'](_0xbbd3('0x11'),_0x452ab7,_0xbbd3('0x12'));logger[_0xbbd3('0x13')](_0xbbd3('0x14'),_0x452ab7,_0xbbd3('0x12'),JSON[_0xbbd3('0x15')](_0x1d7646));if(_0x1d7646[_0xbbd3('0x16')]){if(_0x1d7646['error']['code']===0x1f4){logger[_0xbbd3('0x16')](_0xbbd3('0x11'),_0x452ab7,_0x1d7646[_0xbbd3('0x16')][_0xbbd3('0x17')]);return _0x564814(_0x1d7646[_0xbbd3('0x16')][_0xbbd3('0x17')]);}logger[_0xbbd3('0x16')](_0xbbd3('0x11'),_0x452ab7,_0x1d7646['error'][_0xbbd3('0x17')]);return _0xa090e3(_0x1d7646[_0xbbd3('0x16')][_0xbbd3('0x17')]);}else{logger[_0xbbd3('0x18')](_0xbbd3('0x11'),_0x452ab7,_0xbbd3('0x12'));_0xa090e3(_0x1d7646[_0xbbd3('0x19')][_0xbbd3('0x17')]);}})[_0xbbd3('0x1a')](function(_0xaa9dd8){logger[_0xbbd3('0x16')](_0xbbd3('0x11'),_0x452ab7,_0xaa9dd8);_0x564814(_0xaa9dd8);});});}exports[_0xbbd3('0x1b')]=function(_0x49d24b){var _0x50b4b2=this;return new Promise(function(_0x626baa,_0x34d3ba){return db[_0xbbd3('0x1c')][_0xbbd3('0x1d')](_0x49d24b[_0xbbd3('0x1e')],{'raw':_0x49d24b[_0xbbd3('0x1f')]?_0x49d24b[_0xbbd3('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xbbd3('0x10')](function(_0xd165aa){logger[_0xbbd3('0x18')]('CreatePlugin',_0x49d24b);logger[_0xbbd3('0x13')]('CreatePlugin',_0x49d24b,JSON[_0xbbd3('0x15')](_0xd165aa));_0x626baa(_0xd165aa);})['catch'](function(_0x5ecce0){logger[_0xbbd3('0x16')](_0xbbd3('0x1b'),_0x5ecce0[_0xbbd3('0x17')],_0x49d24b);_0x34d3ba(_0x50b4b2[_0xbbd3('0x16')](0x1f4,_0x5ecce0['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c3636c4..bb1bf0a 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 _0x65d4=['removeListener','register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x1a57d1,_0x4281ff){var _0x394876=function(_0x268ec9){while(--_0x268ec9){_0x1a57d1['push'](_0x1a57d1['shift']());}};_0x394876(++_0x4281ff);}(_0x65d4,0x163));var _0x465d=function(_0x3fb86b,_0x3b30c8){_0x3fb86b=_0x3fb86b-0x0;var _0x13ffc7=_0x65d4[_0x3fb86b];return _0x13ffc7;};'use strict';var PluginEvents=require(_0x465d('0x0'));var events=[_0x465d('0x1'),_0x465d('0x2'),_0x465d('0x3')];function createListener(_0x37db00,_0x2e4659){return function(_0x3e9b4b){_0x2e4659[_0x465d('0x4')](_0x37db00,_0x3e9b4b);};}function removeListener(_0x58148e,_0x491914){return function(){PluginEvents[_0x465d('0x5')](_0x58148e,_0x491914);};}exports[_0x465d('0x6')]=function(_0xf315ee){for(var _0x35f20d=0x0,_0x547dd4=events[_0x465d('0x7')];_0x35f20d<_0x547dd4;_0x35f20d++){var _0x16af6c=events[_0x35f20d];var _0x214a17=createListener(_0x465d('0x8')+_0x16af6c,_0xf315ee);PluginEvents['on'](_0x16af6c,_0x214a17);}}; \ No newline at end of file +var _0xf551=['./plugin.events','update','removeListener','register','length','plugin:'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf551,0x144));var _0x1f55=function(_0x2cb0c9,_0x520dda){_0x2cb0c9=_0x2cb0c9-0x0;var _0x599c5e=_0xf551[_0x2cb0c9];return _0x599c5e;};'use strict';var PluginEvents=require(_0x1f55('0x0'));var events=['save','remove',_0x1f55('0x1')];function createListener(_0x2d6583,_0x51eb4a){return function(_0xdbadfd){_0x51eb4a['emit'](_0x2d6583,_0xdbadfd);};}function removeListener(_0x419a20,_0xd2ef7a){return function(){PluginEvents[_0x1f55('0x2')](_0x419a20,_0xd2ef7a);};}exports[_0x1f55('0x3')]=function(_0x243034){for(var _0xd2562b=0x0,_0x5a3509=events[_0x1f55('0x4')];_0xd2562b<_0x5a3509;_0xd2562b++){var _0x521dad=events[_0xd2562b];var _0xb6675b=createListener(_0x1f55('0x5')+_0x521dad,_0x243034);PluginEvents['on'](_0x521dad,_0xb6675b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9a890ac..fe1db4e 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(_0x18fd88,_0x32fb37){var _0xe4298d=function(_0x15583c){while(--_0x15583c){_0x18fd88['push'](_0x18fd88['shift']());}};_0xe4298d(++_0x32fb37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x1c7763,_0x30e338){var _0x4d2058=function(_0x59fa03){while(--_0x59fa03){_0x1c7763['push'](_0x1c7763['shift']());}};_0x4d2058(++_0x30e338);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 906aad4..bedca5b 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 _0x2bc6=['json','error','stack','name','send','npm\x20install','info','then','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','bluebird','status'];(function(_0x1ee04b,_0x554b3d){var _0x412848=function(_0x11917a){while(--_0x11917a){_0x1ee04b['push'](_0x1ee04b['shift']());}};_0x412848(++_0x554b3d);}(_0x2bc6,0x163));var _0x62bc=function(_0x34401e,_0x169eaa){_0x34401e=_0x34401e-0x0;var _0x181b0e=_0x2bc6[_0x34401e];return _0x181b0e;};'use strict';var _=require(_0x62bc('0x0'));var pm2=require(_0x62bc('0x1'));var logger=require(_0x62bc('0x2'))('api');var path=require('path');var exec=require('child_process')['exec'];var BPromise=require(_0x62bc('0x3'));function handleEntityNotFound(_0x576608,_0x2a1959){return function(_0x2b12de){if(!_0x2b12de){_0x576608['sendStatus'](0x194);;}return _0x2b12de;};}function respondWithResult(_0x3cce26,_0x450cb6){_0x450cb6=_0x450cb6||0xc8;return function(_0x40af10){if(_0x40af10){return _0x3cce26[_0x62bc('0x4')](_0x450cb6)[_0x62bc('0x5')](_0x40af10);}return null;};}function handleError(_0x3f625c,_0x5bedeb){_0x5bedeb=_0x5bedeb||0x1f4;return function(_0x441722){logger[_0x62bc('0x6')](_0x441722[_0x62bc('0x7')]);if(_0x441722[_0x62bc('0x8')]){delete _0x441722['name'];}_0x3f625c[_0x62bc('0x4')](_0x5bedeb)[_0x62bc('0x9')](_0x441722);};}function execChildProcess(){return new BPromise(function(_0x1e3a57,_0x546acc){exec(_0x62bc('0xa'),function(_0x22e6c8,_0x256784,_0x444910){logger[_0x62bc('0xb')](_0x256784);logger[_0x62bc('0xb')](_0x444910);if(_0x22e6c8){logger[_0x62bc('0x6')](_0x22e6c8);return _0x546acc(_0x22e6c8);}return _0x1e3a57(_0x256784);});});}exports['index']=function(_0x2a96ae,_0x28390b){return pm2['list']()[_0x62bc('0xc')](function(_0x10230f){if(_0x10230f){var _0xc14ac9=_['reject'](_0x10230f,function(_0x263424){return _0x263424[_0x62bc('0x8')]==='express'||_0x263424['name']===_0x62bc('0xd');});return{'rows':_0xc14ac9,'count':_0xc14ac9[_0x62bc('0xe')]};}return null;})['then'](respondWithResult(_0x28390b,null))[_0x62bc('0xf')](handleError(_0x28390b,null));};exports[_0x62bc('0x10')]=function(_0xc1211c,_0x1e2405){return pm2[_0x62bc('0x11')](_0xc1211c[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x1e2405,null))[_0x62bc('0xc')](handleEntityNotFound(_0x1e2405,null))[_0x62bc('0xf')](handleError(_0x1e2405,null));};exports['create']=function(_0x5dd6f0,_0x2b2e5f){if(_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')]&&_0x5dd6f0['body'][_0x62bc('0x14')]){var _0x495f99=path[_0x62bc('0x15')](__dirname,_0x62bc('0x16'),_0x5dd6f0[_0x62bc('0x13')]['script']);var _0x3b8644=process[_0x62bc('0x17')]();process[_0x62bc('0x18')](path[_0x62bc('0x19')](_0x495f99));return execChildProcess()[_0x62bc('0xc')](function(_0x3b2eb0){process['chdir'](_0x3b8644);return pm2[_0x62bc('0x1a')]({'name':_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')],'script':_0x495f99});})[_0x62bc('0xc')](function(_0x117ebc){pm2['dump']();return _0x117ebc[0x0];})['then'](respondWithResult(_0x2b2e5f,0xc9))[_0x62bc('0xf')](handleError(_0x2b2e5f,null));}else{return _0x2b2e5f['status'](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('0x1b')});}};exports[_0x62bc('0x1c')]=function(_0x4a72d6,_0x3d55df){if(_0x4a72d6[_0x62bc('0x13')]['id']){delete _0x4a72d6[_0x62bc('0x13')]['id'];}var _0x5c03ac={'online':'restart','stopped':_0x62bc('0x1d')};if(_0x5c03ac[_0x62bc('0x1e')](_0x4a72d6[_0x62bc('0x13')]['status'])){return pm2[_0x5c03ac[_0x4a72d6[_0x62bc('0x13')][_0x62bc('0x4')]]](_0x4a72d6[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x3d55df,0xc8))['catch'](handleError(_0x3d55df,null));}else{return _0x3d55df[_0x62bc('0x4')](0x1f4)['send']({'message':_0x62bc('0x1f')});}};exports[_0x62bc('0x20')]=function(_0x32048f,_0x2dd7fd){if(_0x32048f[_0x62bc('0x13')]['id']){delete _0x32048f[_0x62bc('0x13')]['id'];}if(_0x32048f[_0x62bc('0x12')]['id']){return pm2[_0x62bc('0x21')](_0x32048f[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](function(_0x156f95){pm2[_0x62bc('0x22')]();return _0x156f95[0x0];})[_0x62bc('0xc')](respondWithResult(_0x2dd7fd,null))[_0x62bc('0xf')](handleError(_0x2dd7fd,null));}else{return _0x2dd7fd[_0x62bc('0x4')](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('0x23')});}}; \ No newline at end of file +var _0x70e0=['dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','json','error','stack','name','send','npm\x20install','info','index','list','reject','motion2','length','then','describe','params','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start'];(function(_0x4db2db,_0x5c7fc8){var _0x278a30=function(_0x1806a7){while(--_0x1806a7){_0x4db2db['push'](_0x4db2db['shift']());}};_0x278a30(++_0x5c7fc8);}(_0x70e0,0x17b));var _0x070e=function(_0x358a2c,_0x3a9ab6){_0x358a2c=_0x358a2c-0x0;var _0x58e53a=_0x70e0[_0x358a2c];return _0x58e53a;};'use strict';var _=require(_0x070e('0x0'));var pm2=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var path=require('path');var exec=require(_0x070e('0x3'))[_0x070e('0x4')];var BPromise=require(_0x070e('0x5'));function handleEntityNotFound(_0x2593e5,_0x5c90fc){return function(_0x7bce9b){if(!_0x7bce9b){_0x2593e5['sendStatus'](0x194);;}return _0x7bce9b;};}function respondWithResult(_0x46fe68,_0x4b041d){_0x4b041d=_0x4b041d||0xc8;return function(_0x56e420){if(_0x56e420){return _0x46fe68['status'](_0x4b041d)[_0x070e('0x6')](_0x56e420);}return null;};}function handleError(_0x1e11f0,_0x604664){_0x604664=_0x604664||0x1f4;return function(_0x2611e6){logger[_0x070e('0x7')](_0x2611e6[_0x070e('0x8')]);if(_0x2611e6[_0x070e('0x9')]){delete _0x2611e6['name'];}_0x1e11f0['status'](_0x604664)[_0x070e('0xa')](_0x2611e6);};}function execChildProcess(){return new BPromise(function(_0x2e3e5e,_0x12bb37){exec(_0x070e('0xb'),function(_0xa927a2,_0xffcdd6,_0x25cfe1){logger[_0x070e('0xc')](_0xffcdd6);logger[_0x070e('0xc')](_0x25cfe1);if(_0xa927a2){logger[_0x070e('0x7')](_0xa927a2);return _0x12bb37(_0xa927a2);}return _0x2e3e5e(_0xffcdd6);});});}exports[_0x070e('0xd')]=function(_0x52da3b,_0x5dca0f){return pm2[_0x070e('0xe')]()['then'](function(_0x4a33d2){if(_0x4a33d2){var _0x5bae0f=_[_0x070e('0xf')](_0x4a33d2,function(_0x14c3fd){return _0x14c3fd['name']==='express'||_0x14c3fd[_0x070e('0x9')]===_0x070e('0x10');});return{'rows':_0x5bae0f,'count':_0x5bae0f[_0x070e('0x11')]};}return null;})[_0x070e('0x12')](respondWithResult(_0x5dca0f,null))['catch'](handleError(_0x5dca0f,null));};exports['show']=function(_0x17e2e4,_0x2bd937){return pm2[_0x070e('0x13')](_0x17e2e4[_0x070e('0x14')]['id'])[_0x070e('0x12')](respondWithResult(_0x2bd937,null))['then'](handleEntityNotFound(_0x2bd937,null))[_0x070e('0x15')](handleError(_0x2bd937,null));};exports[_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){if(_0x1ad3de[_0x070e('0x17')]['name']&&_0x1ad3de['body']['script']){var _0x9907cf=path[_0x070e('0x18')](__dirname,_0x070e('0x19'),_0x1ad3de['body'][_0x070e('0x1a')]);var _0x5dc5d2=process[_0x070e('0x1b')]();process[_0x070e('0x1c')](path[_0x070e('0x1d')](_0x9907cf));return execChildProcess()[_0x070e('0x12')](function(_0x28a1c3){process[_0x070e('0x1c')](_0x5dc5d2);return pm2[_0x070e('0x1e')]({'name':_0x1ad3de[_0x070e('0x17')]['name'],'script':_0x9907cf});})[_0x070e('0x12')](function(_0x270061){pm2[_0x070e('0x1f')]();return _0x270061[0x0];})['then'](respondWithResult(_0x3ea105,0xc9))[_0x070e('0x15')](handleError(_0x3ea105,null));}else{return _0x3ea105['status'](0x1f4)['send']({'message':_0x070e('0x20')});}};exports[_0x070e('0x21')]=function(_0x41deb1,_0x1743cc){if(_0x41deb1[_0x070e('0x17')]['id']){delete _0x41deb1['body']['id'];}var _0x374c54={'online':_0x070e('0x22'),'stopped':_0x070e('0x23')};if(_0x374c54[_0x070e('0x24')](_0x41deb1[_0x070e('0x17')][_0x070e('0x25')])){return pm2[_0x374c54[_0x41deb1[_0x070e('0x17')][_0x070e('0x25')]]](_0x41deb1['params']['id'])[_0x070e('0x12')](respondWithResult(_0x1743cc,0xc8))[_0x070e('0x15')](handleError(_0x1743cc,null));}else{return _0x1743cc[_0x070e('0x25')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x070e('0x26')]=function(_0x46065c,_0xa6c0ab){if(_0x46065c['body']['id']){delete _0x46065c[_0x070e('0x17')]['id'];}if(_0x46065c[_0x070e('0x14')]['id']){return pm2[_0x070e('0x27')](_0x46065c[_0x070e('0x14')]['id'])['then'](function(_0x5bf522){pm2['dump']();return _0x5bf522[0x0];})['then'](respondWithResult(_0xa6c0ab,null))[_0x070e('0x15')](handleError(_0xa6c0ab,null));}else{return _0xa6c0ab['status'](0x1f4)[_0x070e('0xa')]({'message':_0x070e('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 50e5dab..507d145 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 _0xafec=['../../components/auth/service','./realtime.controller','get','isAuthenticated','exports','Router'];(function(_0x6f67ca,_0x2bda69){var _0x485f4d=function(_0x56d0d6){while(--_0x56d0d6){_0x6f67ca['push'](_0x6f67ca['shift']());}};_0x485f4d(++_0x2bda69);}(_0xafec,0x161));var _0xcafe=function(_0x2e2763,_0x5cfb9c){_0x2e2763=_0x2e2763-0x0;var _0x26aef0=_0xafec[_0x2e2763];return _0x26aef0;};'use strict';var express=require('express');var router=express[_0xcafe('0x0')]();var auth=require(_0xcafe('0x1'));var controller=require(_0xcafe('0x2'));router[_0xcafe('0x3')]('/queues',auth[_0xcafe('0x4')](),controller['getQueues']);module[_0xcafe('0x5')]=router; \ No newline at end of file +var _0xe558=['/queues','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x5d12e5,_0x4dc861){var _0x1a4fe5=function(_0x1dd9ed){while(--_0x1dd9ed){_0x5d12e5['push'](_0x5d12e5['shift']());}};_0x1a4fe5(++_0x4dc861);}(_0xe558,0x70));var _0x8e55=function(_0x40c8b3,_0xef0286){_0x40c8b3=_0x40c8b3-0x0;var _0x6541a1=_0xe558[_0x40c8b3];return _0x6541a1;};'use strict';var express=require(_0x8e55('0x0'));var router=express[_0x8e55('0x1')]();var auth=require(_0x8e55('0x2'));var controller=require(_0x8e55('0x3'));router[_0x8e55('0x4')](_0x8e55('0x5'),auth[_0x8e55('0x6')](),controller[_0x8e55('0x7')]);module[_0x8e55('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 017b900..148f505 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 _0x6046=['predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','available','busy','filter','queue','length','some','internal','talking','find','getMembers','accountcode','online','voiceStatus','agents','User','Pause','findAll','QueueId','UserId','mail','chat','sms','openchannel','fax','whatsapp','resolve','query','includes','channel','toLowerCase','Invalid\x20channel','Queue','rawAttributes','fieldName','type','key','getOptions','user','QueueCampaigns','UserProfile','getResources','findAndCountAll','rows','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','count','offset','limit','status','set','Content-Range','json','name','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls'];(function(_0x40bef3,_0x12f30d){var _0x4c8d09=function(_0x18a37f){while(--_0x18a37f){_0x40bef3['push'](_0x40bef3['shift']());}};_0x4c8d09(++_0x12f30d);}(_0x6046,0x96));var _0x6604=function(_0x21e000,_0x32db1f){_0x21e000=_0x21e000-0x0;var _0x218e1c=_0x6046[_0x21e000];return _0x218e1c;};'use strict';var util=require(_0x6604('0x0'));var _=require(_0x6604('0x1'));var jayson=require(_0x6604('0x2'));var qs=require(_0x6604('0x3'));var logger=require(_0x6604('0x4'))(_0x6604('0x5'));var db=require(_0x6604('0x6'))['db'];var amiClient=jayson[_0x6604('0x7')][_0x6604('0x8')]({'port':0x232a});var routingClient=jayson[_0x6604('0x7')][_0x6604('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x56e90e,_0x4536b3){return function(_0x48897f){if(_0x48897f){var _0x38c656=typeof _0x4536b3['offset']===_0x6604('0x9')&&typeof _0x4536b3['limit']===_0x6604('0x9');var _0x215b48=_0x48897f[_0x6604('0xa')];var _0x1db593=_0x38c656?0x0:_0x4536b3['offset'];var _0x18da9f=_0x38c656?_0x48897f[_0x6604('0xa')]:_0x4536b3[_0x6604('0xb')]+_0x4536b3[_0x6604('0xc')];var _0x32fc9a;if(_0x18da9f>=_0x215b48){_0x18da9f=_0x215b48;_0x32fc9a=0xc8;}else{_0x32fc9a=0xce;}_0x56e90e[_0x6604('0xd')](_0x32fc9a);return _0x56e90e[_0x6604('0xe')](_0x6604('0xf'),_0x1db593+'-'+_0x18da9f+'/'+_0x215b48)[_0x6604('0x10')](_0x48897f);}return null;};}function handleError(_0x55a0b9,_0x349cfd){_0x349cfd=_0x349cfd||0x1f4;return function(_0x9fc9d4){logger['error'](_0x9fc9d4['stack']);if(_0x9fc9d4[_0x6604('0x11')]){delete _0x9fc9d4[_0x6604('0x11')];}_0x55a0b9[_0x6604('0xd')](_0x349cfd)[_0x6604('0x12')](_0x9fc9d4);};}function getRealtimeAgents(){return new Promise(function(_0x370a36,_0x15d00b){return amiClient[_0x6604('0x13')](_0x6604('0x14'),{})[_0x6604('0x15')](function(_0x474f1b){if(_0x474f1b[_0x6604('0x16')])throw new Error(_0x6604('0x17'));var _0x456c67=_0x474f1b[_0x6604('0x18')];return routingClient[_0x6604('0x13')]('Agents',{})[_0x6604('0x15')](function(_0x509616){if(_0x509616[_0x6604('0x16')])throw new Error(_0x6604('0x19'));var _0x3c27d9=_0x509616[_0x6604('0x18')];return _0x370a36(_[_0x6604('0x1a')]({},_0x456c67,_0x3c27d9));});})[_0x6604('0x1b')](function(_0x5f06cd){_0x15d00b(_0x5f06cd);});});}function getRealtimeQueues(_0x543914,_0x420486){return new Promise(function(_0x3ecc0a,_0x3539fb){var _0x55338c=_0x420486===_0x6604('0x1c')?amiClient:routingClient;return _0x55338c[_0x6604('0x13')](_[_0x6604('0x1d')](_0x420486)+_0x6604('0x1e'),_0x543914)[_0x6604('0x15')](function(_0x2a6287){if(_0x2a6287[_0x6604('0x16')])throw new Error(util[_0x6604('0x1f')](_0x6604('0x20'),_0x420486));return _0x3ecc0a(_0x2a6287['result']);})[_0x6604('0x1b')](function(_0x57a9f5){_0x3539fb(_0x57a9f5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5a1942,_0x23be8b){return amiClient[_0x6604('0x13')](_0x6604('0x21'),{})['then'](function(_0xf0349){if(_0xf0349['error'])throw new Error(_0x6604('0x22'));return _0x5a1942(_0xf0349[_0x6604('0x18')]);})[_0x6604('0x1b')](function(_0x7bff4f){_0x23be8b(_0x7bff4f);});});}function initializeQueues(_0x5685a1,_0x39089b,_0x35cdd2,_0x28c287){var _0x30946c=[_0x6604('0x23'),'available',_0x6604('0x24'),'talking',_0x6604('0x25')];if(_0x35cdd2===_0x6604('0x1c')&&_0x28c287===_0x6604('0x26')){_0x30946c[_0x6604('0x27')](_0x6604('0x28'),_0x6604('0x29'),_0x6604('0x2a'),_0x6604('0x2b'),_0x6604('0x2c'),_0x6604('0x2d'),_0x6604('0x2e'),'startProgressive',_0x6604('0x2f'),_0x6604('0x30'),_0x6604('0x31'),'erlangBusyFactor','dialPredictiveInterval',_0x6604('0x32'),_0x6604('0x33'),_0x6604('0x34'),'predictiveIntervalTotalCalls',_0x6604('0x35'),'predictiveIntervalDroppedCallsTimeout',_0x6604('0x36'),'predictiveIntervalAvgHoldtime',_0x6604('0x37'));}return _0x5685a1[_0x6604('0x38')](function(_0x7a3af){var _0x5dd649=_0x7a3af[_0x6604('0x39')]({'plain':!![]});_0x5dd649['agents']=[];_0x5dd649[_0x6604('0x25')]=0x0;_0x5dd649[_0x6604('0x3a')]=0x0;_0x5dd649[_0x6604('0x23')]=0x0;_0x5dd649[_0x6604('0x3b')]=0x0;_0x5dd649[_0x6604('0x24')]=0x0;if(_0x35cdd2===_0x6604('0x1c')){_0x5dd649['talking']=0x0;_0x5dd649[_0x6604('0x3c')]=0x0;if(_0x28c287==='outbound'){_0x5dd649['pTalking']=0x0;_0x5dd649['originated']=0x0;}}var _0x1eafe5=_['find'](_0x39089b,['id',_0x5dd649['id']]);if(_0x1eafe5)_[_0x6604('0x1a')](_0x5dd649,_['pick'](_0x1eafe5,_0x30946c));return _0x5dd649;});}function updateAgentVoiceStatus(_0x236975,_0x1e61ae,_0x3429f9){var _0x55c806=_[_0x6604('0x3d')](_0x3429f9,[_0x6604('0x3e'),_0x1e61ae[_0x6604('0x11')]]);if(_0x55c806[_0x6604('0x3f')]===0x0)return _0x236975[_0x6604('0x3c')]=!![];if(_[_0x6604('0x40')](_0x55c806,['connectedlinenum',_0x236975[_0x6604('0x41')]['toString']()]))return _0x236975[_0x6604('0x42')]=!![];if(!_0x236975[_0x6604('0x42')])return _0x236975['busy']=!![];}function getVoiceQueueAgents(_0x38fb70,_0x1af198,_0x3832d7,_0x1b3555){var _0x38eec5=_[_0x6604('0x43')](_0x1af198,['id',_0x38fb70['id']]);if(!_0x38eec5)return _0x38fb70;return _0x38eec5[_0x6604('0x44')]({'raw':!![]})['then'](function(_0x404801){for(var _0x3045d8=0x0;_0x3045d8<_0x404801['length'];_0x3045d8++){var _0x4e5386=_[_0x6604('0x43')](_0x3832d7,['id',_0x404801[_0x3045d8]['UserId']]);if(!_0x4e5386){_0x4e5386={'id':_0x404801[_0x3045d8]['UserId'],'name':_0x404801[_0x3045d8]['UserId'],'accountcode':'','online':![]};}var _0x21a0d2={'id':_0x4e5386['id'],'name':_0x4e5386[_0x6604('0x11')],'internal':_0x4e5386[_0x6604('0x45')],'online':Boolean(_0x4e5386[_0x6604('0x46')]),'paused':Boolean(_0x404801[_0x3045d8][_0x6604('0x25')])};if(_0x4e5386[_0x6604('0x47')]===_0x6604('0x42'))updateAgentVoiceStatus(_0x21a0d2,_0x38fb70,_0x1b3555);if(_0x21a0d2['online'])_0x38fb70[_0x6604('0x3a')]++;if(_0x21a0d2[_0x6604('0x3c')])_0x38fb70[_0x6604('0x3c')]++;if(_0x21a0d2['paused']&&!_0x21a0d2['busy']&&!_0x21a0d2['talking'])_0x38fb70[_0x6604('0x25')]++;_0x38fb70[_0x6604('0x48')]['push'](_0x21a0d2);}return _0x38fb70;});}function getQueueAgents(_0x41f10f,_0x187598,_0x58bce0){var _0x982b49=_0x6604('0x49')+_[_0x6604('0x1d')](_0x58bce0)+'Queue';var _0x4c229f=_0x58bce0+_0x6604('0x4a');return db[_0x982b49][_0x6604('0x4b')]({'where':{[_[_0x6604('0x1d')](_0x58bce0)+_0x6604('0x4c')]:_0x41f10f['id']},'raw':!![]})[_0x6604('0x15')](function(_0xb71b51){for(var _0x141cbc=0x0;_0x141cbc<_0xb71b51[_0x6604('0x3f')];_0x141cbc++){var _0x265bca=_[_0x6604('0x43')](_0x187598,['id',_0xb71b51[_0x141cbc]['UserId']]);if(!_0x265bca){_0x265bca={'id':_0xb71b51[_0x141cbc][_0x6604('0x4d')],'name':_0xb71b51[_0x141cbc][_0x6604('0x4d')],'online':![],['pauseField']:![]};}var _0xcb96ad={'id':_0x265bca['id'],'name':_0x265bca['name'],'online':Boolean(_0x265bca[_0x6604('0x46')]),'paused':Boolean(_0x265bca[_0x4c229f])};if(_0xcb96ad[_0x6604('0x46')])_0x41f10f['loggedInDb']++;_0x41f10f['agents'][_0x6604('0x27')](_0xcb96ad);}return _0x41f10f;});}exports['getQueues']=function(_0x234241,_0x2392ca){var _0x2b5c74=[_0x6604('0x4e'),_0x6604('0x4f'),_0x6604('0x50'),_0x6604('0x51'),_0x6604('0x52'),_0x6604('0x53'),_0x6604('0x1c')];var _0x465588={'count':0x0,'rows':[]},_0x3c0479={},_0x544b9c,_0x5244a8,_0x3ecec9,_0x312f2f,_0x5b487b;Promise[_0x6604('0x54')]()['then'](function(){if(_0x234241[_0x6604('0x55')]['channel']){if(!_[_0x6604('0x56')](_0x2b5c74,_0x234241[_0x6604('0x55')][_0x6604('0x57')][_0x6604('0x58')]()))throw new Error(_0x6604('0x59'));_0x544b9c=_0x234241[_0x6604('0x55')][_0x6604('0x57')][_0x6604('0x58')]();}var _0xe65940=_[_0x6604('0x1d')](_0x544b9c)+_0x6604('0x5a');var _0xb50c74=_[_0x6604('0x38')](db[_0xe65940][_0x6604('0x5b')],function(_0x4a33f4){return{'name':_0x4a33f4[_0x6604('0x5c')],'type':_0x4a33f4[_0x6604('0x5d')][_0x6604('0x5e')]};});_0x3c0479=qs[_0x6604('0x5f')](_0xb50c74,_0x234241);if(_0x234241[_0x6604('0x60')]['role']==='user'){var _0x2e5ad4={'params':{'id':_0x234241['user']['userProfileId']},'query':{'section':_0x544b9c==='voice'&&_0x234241['query'][_0x6604('0x5d')]===_0x6604('0x26')?_0x6604('0x61'):_[_0x6604('0x1d')](_0x544b9c)+_0x6604('0x1e'),'type':_0x234241[_0x6604('0x55')]['type'],'nolimit':!![],'sort':_0x6604('0x11'),'filter':_0x234241[_0x6604('0x55')]['filter']}};return db[_0x6604('0x62')][_0x6604('0x63')](_0x2e5ad4);}return db[_0xe65940][_0x6604('0x64')](_0x3c0479);})['then'](function(_0x4f98e4){_0x465588[_0x6604('0xa')]=_0x4f98e4[_0x6604('0xa')];_0x5244a8=_0x4f98e4['rows'];return getRealtimeQueues(_0x234241,_0x544b9c);})['then'](function(_0x12a86c){_0x312f2f=_0x12a86c['rows'];return getRealtimeAgents();})[_0x6604('0x15')](function(_0x68e4c7){_0x3ecec9=_0x68e4c7['rows'];if(_0x544b9c!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x6604('0x15')](function(_0x2635e3){_0x5b487b=_0x2635e3?_0x2635e3[_0x6604('0x65')]:[];return initializeQueues(_0x5244a8,_0x312f2f,_0x544b9c,_0x234241[_0x6604('0x55')][_0x6604('0x5d')]);})[_0x6604('0x15')](function(_0x942cd6){var _0x16e9fc=_0x942cd6[_0x6604('0x38')](function(_0x5c9b2e){if(_0x544b9c===_0x6604('0x1c'))return getVoiceQueueAgents(_0x5c9b2e,_0x5244a8,_0x3ecec9,_0x5b487b);else return getQueueAgents(_0x5c9b2e,_0x3ecec9,_0x544b9c);});return Promise['all'](_0x16e9fc);})[_0x6604('0x15')](function(_0x3b4408){_0x465588[_0x6604('0x65')]=_0x3b4408;return _0x465588;})[_0x6604('0x15')](respondWithFilteredResult(_0x2392ca,_0x3c0479))[_0x6604('0x1b')](handleError(_0x2392ca,null));}; \ No newline at end of file +var _0xc209=['undefined','limit','count','status','Content-Range','json','error','stack','name','send','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','loggedIn','waiting','talking','paused','voice','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','available','busy','find','pick','queue','some','connectedlinenum','internal','toString','getMembers','length','UserId','voiceStatus','online','startCase','Queue','Pause','findAll','QueueId','getQueues','chat','openchannel','fax','whatsapp','resolve','channel','includes','toLowerCase','query','rawAttributes','fieldName','type','key','getOptions','user','userProfileId','filter','UserProfile','getResources','findAndCountAll','rows','all','util','lodash','jayson/promise','../../config/logger','api','../../mysqldb','http','client','offset'];(function(_0x3243df,_0xacfdd3){var _0x1e2a1a=function(_0x4e005c){while(--_0x4e005c){_0x3243df['push'](_0x3243df['shift']());}};_0x1e2a1a(++_0xacfdd3);}(_0xc209,0x1e6));var _0x9c20=function(_0xaca7f4,_0x5aa1fd){_0xaca7f4=_0xaca7f4-0x0;var _0x5a1d83=_0xc209[_0xaca7f4];return _0x5a1d83;};'use strict';var util=require(_0x9c20('0x0'));var _=require(_0x9c20('0x1'));var jayson=require(_0x9c20('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9c20('0x3'))(_0x9c20('0x4'));var db=require(_0x9c20('0x5'))['db'];var amiClient=jayson['client'][_0x9c20('0x6')]({'port':0x232a});var routingClient=jayson[_0x9c20('0x7')][_0x9c20('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x261283,_0x40e20e){return function(_0x52e346){if(_0x52e346){var _0x8e2e79=typeof _0x40e20e[_0x9c20('0x8')]===_0x9c20('0x9')&&typeof _0x40e20e[_0x9c20('0xa')]===_0x9c20('0x9');var _0x54e64c=_0x52e346[_0x9c20('0xb')];var _0x1184b5=_0x8e2e79?0x0:_0x40e20e[_0x9c20('0x8')];var _0x8e790e=_0x8e2e79?_0x52e346['count']:_0x40e20e['offset']+_0x40e20e[_0x9c20('0xa')];var _0x1afbed;if(_0x8e790e>=_0x54e64c){_0x8e790e=_0x54e64c;_0x1afbed=0xc8;}else{_0x1afbed=0xce;}_0x261283[_0x9c20('0xc')](_0x1afbed);return _0x261283['set'](_0x9c20('0xd'),_0x1184b5+'-'+_0x8e790e+'/'+_0x54e64c)[_0x9c20('0xe')](_0x52e346);}return null;};}function handleError(_0x250f1b,_0x444256){_0x444256=_0x444256||0x1f4;return function(_0x557217){logger[_0x9c20('0xf')](_0x557217[_0x9c20('0x10')]);if(_0x557217[_0x9c20('0x11')]){delete _0x557217[_0x9c20('0x11')];}_0x250f1b[_0x9c20('0xc')](_0x444256)[_0x9c20('0x12')](_0x557217);};}function getRealtimeAgents(){return new Promise(function(_0x121ed8,_0x44f69d){return amiClient[_0x9c20('0x13')](_0x9c20('0x14'),{})['then'](function(_0x27b557){if(_0x27b557[_0x9c20('0xf')])throw new Error(_0x9c20('0x15'));var _0x4d19d3=_0x27b557[_0x9c20('0x16')];return routingClient[_0x9c20('0x13')](_0x9c20('0x14'),{})[_0x9c20('0x17')](function(_0xeb69ce){if(_0xeb69ce['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x51f839=_0xeb69ce['result'];return _0x121ed8(_[_0x9c20('0x18')]({},_0x4d19d3,_0x51f839));});})['catch'](function(_0x2d79fd){_0x44f69d(_0x2d79fd);});});}function getRealtimeQueues(_0x42aa01,_0x348a74){return new Promise(function(_0x46e8e4,_0x5446a8){var _0x2c7a9b=_0x348a74==='voice'?amiClient:routingClient;return _0x2c7a9b[_0x9c20('0x13')](_['startCase'](_0x348a74)+_0x9c20('0x19'),_0x42aa01)[_0x9c20('0x17')](function(_0x43c79d){if(_0x43c79d[_0x9c20('0xf')])throw new Error(util['format'](_0x9c20('0x1a'),_0x348a74));return _0x46e8e4(_0x43c79d[_0x9c20('0x16')]);})[_0x9c20('0x1b')](function(_0x38ec01){_0x5446a8(_0x38ec01);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2c5193,_0x3cd8ea){return amiClient[_0x9c20('0x13')](_0x9c20('0x1c'),{})['then'](function(_0x1e635c){if(_0x1e635c['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x2c5193(_0x1e635c[_0x9c20('0x16')]);})['catch'](function(_0x9403ff){_0x3cd8ea(_0x9403ff);});});}function initializeQueues(_0x184429,_0x4418e2,_0x2c6c74,_0x238724){var _0x3c8023=[_0x9c20('0x1d'),'available',_0x9c20('0x1e'),_0x9c20('0x1f'),_0x9c20('0x20')];if(_0x2c6c74===_0x9c20('0x21')&&_0x238724===_0x9c20('0x22')){_0x3c8023[_0x9c20('0x23')](_0x9c20('0x24'),_0x9c20('0x25'),_0x9c20('0x26'),_0x9c20('0x27'),_0x9c20('0x28'),_0x9c20('0x29'),_0x9c20('0x2a'),'startProgressive',_0x9c20('0x2b'),_0x9c20('0x2c'),_0x9c20('0x2d'),'erlangBusyFactor',_0x9c20('0x2e'),_0x9c20('0x2f'),_0x9c20('0x30'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x9c20('0x31'),_0x9c20('0x32'),'predictiveIntervalDroppedCallsCallersExit',_0x9c20('0x33'),_0x9c20('0x34'));}return _0x184429[_0x9c20('0x35')](function(_0x1f15b1){var _0x3e10ee=_0x1f15b1[_0x9c20('0x36')]({'plain':!![]});_0x3e10ee[_0x9c20('0x37')]=[];_0x3e10ee[_0x9c20('0x20')]=0x0;_0x3e10ee[_0x9c20('0x38')]=0x0;_0x3e10ee[_0x9c20('0x1d')]=0x0;_0x3e10ee[_0x9c20('0x39')]=0x0;_0x3e10ee[_0x9c20('0x1e')]=0x0;if(_0x2c6c74===_0x9c20('0x21')){_0x3e10ee[_0x9c20('0x1f')]=0x0;_0x3e10ee[_0x9c20('0x3a')]=0x0;if(_0x238724===_0x9c20('0x22')){_0x3e10ee['pTalking']=0x0;_0x3e10ee['originated']=0x0;}}var _0x390ed5=_[_0x9c20('0x3b')](_0x4418e2,['id',_0x3e10ee['id']]);if(_0x390ed5)_[_0x9c20('0x18')](_0x3e10ee,_[_0x9c20('0x3c')](_0x390ed5,_0x3c8023));return _0x3e10ee;});}function updateAgentVoiceStatus(_0x18ddf0,_0xd1c2f,_0x12e05b){var _0xc226eb=_['filter'](_0x12e05b,[_0x9c20('0x3d'),_0xd1c2f[_0x9c20('0x11')]]);if(_0xc226eb['length']===0x0)return _0x18ddf0[_0x9c20('0x3a')]=!![];if(_[_0x9c20('0x3e')](_0xc226eb,[_0x9c20('0x3f'),_0x18ddf0[_0x9c20('0x40')][_0x9c20('0x41')]()]))return _0x18ddf0[_0x9c20('0x1f')]=!![];if(!_0x18ddf0['talking'])return _0x18ddf0[_0x9c20('0x3a')]=!![];}function getVoiceQueueAgents(_0x153698,_0x22a55a,_0x49087f,_0x43c08c){var _0x5339ac=_[_0x9c20('0x3b')](_0x22a55a,['id',_0x153698['id']]);if(!_0x5339ac)return _0x153698;return _0x5339ac[_0x9c20('0x42')]({'raw':!![]})[_0x9c20('0x17')](function(_0x379740){for(var _0x3064ac=0x0;_0x3064ac<_0x379740[_0x9c20('0x43')];_0x3064ac++){var _0x3759ea=_['find'](_0x49087f,['id',_0x379740[_0x3064ac][_0x9c20('0x44')]]);if(!_0x3759ea){_0x3759ea={'id':_0x379740[_0x3064ac][_0x9c20('0x44')],'name':_0x379740[_0x3064ac][_0x9c20('0x44')],'accountcode':'','online':![]};}var _0x161536={'id':_0x3759ea['id'],'name':_0x3759ea[_0x9c20('0x11')],'internal':_0x3759ea['accountcode'],'online':Boolean(_0x3759ea['online']),'paused':Boolean(_0x379740[_0x3064ac][_0x9c20('0x20')])};if(_0x3759ea[_0x9c20('0x45')]===_0x9c20('0x1f'))updateAgentVoiceStatus(_0x161536,_0x153698,_0x43c08c);if(_0x161536[_0x9c20('0x46')])_0x153698['loggedInDb']++;if(_0x161536[_0x9c20('0x3a')])_0x153698[_0x9c20('0x3a')]++;if(_0x161536['paused']&&!_0x161536[_0x9c20('0x3a')]&&!_0x161536[_0x9c20('0x1f')])_0x153698[_0x9c20('0x20')]++;_0x153698[_0x9c20('0x37')][_0x9c20('0x23')](_0x161536);}return _0x153698;});}function getQueueAgents(_0x3eda8b,_0x140c2d,_0x876661){var _0xf41f75='User'+_[_0x9c20('0x47')](_0x876661)+_0x9c20('0x48');var _0x40a730=_0x876661+_0x9c20('0x49');return db[_0xf41f75][_0x9c20('0x4a')]({'where':{[_[_0x9c20('0x47')](_0x876661)+_0x9c20('0x4b')]:_0x3eda8b['id']},'raw':!![]})[_0x9c20('0x17')](function(_0x5550b3){for(var _0x16136c=0x0;_0x16136c<_0x5550b3[_0x9c20('0x43')];_0x16136c++){var _0xc853f1=_[_0x9c20('0x3b')](_0x140c2d,['id',_0x5550b3[_0x16136c][_0x9c20('0x44')]]);if(!_0xc853f1){_0xc853f1={'id':_0x5550b3[_0x16136c][_0x9c20('0x44')],'name':_0x5550b3[_0x16136c]['UserId'],'online':![],['pauseField']:![]};}var _0x1d83da={'id':_0xc853f1['id'],'name':_0xc853f1[_0x9c20('0x11')],'online':Boolean(_0xc853f1[_0x9c20('0x46')]),'paused':Boolean(_0xc853f1[_0x40a730])};if(_0x1d83da[_0x9c20('0x46')])_0x3eda8b[_0x9c20('0x38')]++;_0x3eda8b['agents'][_0x9c20('0x23')](_0x1d83da);}return _0x3eda8b;});}exports[_0x9c20('0x4c')]=function(_0x2a4a33,_0x54051c){var _0x21e7b3=['mail',_0x9c20('0x4d'),'sms',_0x9c20('0x4e'),_0x9c20('0x4f'),_0x9c20('0x50'),_0x9c20('0x21')];var _0x136d99={'count':0x0,'rows':[]},_0x45b367={},_0x514653,_0x4541d5,_0x3f6798,_0x5a2eab,_0x3a0a21;Promise[_0x9c20('0x51')]()[_0x9c20('0x17')](function(){if(_0x2a4a33['query'][_0x9c20('0x52')]){if(!_[_0x9c20('0x53')](_0x21e7b3,_0x2a4a33['query'][_0x9c20('0x52')][_0x9c20('0x54')]()))throw new Error('Invalid\x20channel');_0x514653=_0x2a4a33[_0x9c20('0x55')]['channel']['toLowerCase']();}var _0x50c5c2=_[_0x9c20('0x47')](_0x514653)+_0x9c20('0x48');var _0x3d3cd0=_[_0x9c20('0x35')](db[_0x50c5c2][_0x9c20('0x56')],function(_0x49bf50){return{'name':_0x49bf50[_0x9c20('0x57')],'type':_0x49bf50[_0x9c20('0x58')][_0x9c20('0x59')]};});_0x45b367=qs[_0x9c20('0x5a')](_0x3d3cd0,_0x2a4a33);if(_0x2a4a33[_0x9c20('0x5b')]['role']==='user'){var _0x46ef6c={'params':{'id':_0x2a4a33[_0x9c20('0x5b')][_0x9c20('0x5c')]},'query':{'section':_0x514653===_0x9c20('0x21')&&_0x2a4a33['query'][_0x9c20('0x58')]===_0x9c20('0x22')?'QueueCampaigns':_['startCase'](_0x514653)+'Queues','type':_0x2a4a33['query'][_0x9c20('0x58')],'nolimit':!![],'sort':_0x9c20('0x11'),'filter':_0x2a4a33[_0x9c20('0x55')][_0x9c20('0x5d')]}};return db[_0x9c20('0x5e')][_0x9c20('0x5f')](_0x46ef6c);}return db[_0x50c5c2][_0x9c20('0x60')](_0x45b367);})['then'](function(_0x2d1859){_0x136d99['count']=_0x2d1859[_0x9c20('0xb')];_0x4541d5=_0x2d1859[_0x9c20('0x61')];return getRealtimeQueues(_0x2a4a33,_0x514653);})['then'](function(_0x183975){_0x5a2eab=_0x183975[_0x9c20('0x61')];return getRealtimeAgents();})['then'](function(_0xc1505d){_0x3f6798=_0xc1505d[_0x9c20('0x61')];if(_0x514653!=_0x9c20('0x21'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x33403c){_0x3a0a21=_0x33403c?_0x33403c[_0x9c20('0x61')]:[];return initializeQueues(_0x4541d5,_0x5a2eab,_0x514653,_0x2a4a33[_0x9c20('0x55')][_0x9c20('0x58')]);})[_0x9c20('0x17')](function(_0x11cdde){var _0x3d8af8=_0x11cdde[_0x9c20('0x35')](function(_0x2ba6e6){if(_0x514653===_0x9c20('0x21'))return getVoiceQueueAgents(_0x2ba6e6,_0x4541d5,_0x3f6798,_0x3a0a21);else return getQueueAgents(_0x2ba6e6,_0x3f6798,_0x514653);});return Promise[_0x9c20('0x62')](_0x3d8af8);})[_0x9c20('0x17')](function(_0x1c70a6){_0x136d99[_0x9c20('0x61')]=_0x1c70a6;return _0x136d99;})[_0x9c20('0x17')](respondWithFilteredResult(_0x54051c,_0x45b367))[_0x9c20('0x1b')](handleError(_0x54051c,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index dfca472..93850f8 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x226e40,_0x5d4f63){var _0x28d859=function(_0x4d4262){while(--_0x4d4262){_0x226e40['push'](_0x226e40['shift']());}};_0x28d859(++_0x5d4f63);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e2902,_0x2ac965){_0x3e2902=_0x3e2902-0x0;var _0xa4f9fb=_0xedd9[_0x3e2902];return _0xa4f9fb;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40446f,_0x3f0a65){var _0x141ccd=function(_0x100617){while(--_0x100617){_0x40446f['push'](_0x40446f['shift']());}};_0x141ccd(++_0x3f0a65);}(_0xe706,0xa3));var _0x6e70=function(_0x45eacc,_0x3727a4){_0x45eacc=_0x45eacc-0x0;var _0x3f1252=_0xe706[_0x45eacc];return _0x3f1252;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 91b7dc0..d7f361e 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 _0x31c2=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x3f9196,_0x5bd933){var _0x262568=function(_0x504dbd){while(--_0x504dbd){_0x3f9196['push'](_0x3f9196['shift']());}};_0x262568(++_0x5bd933);}(_0x31c2,0x1e1));var _0x231c=function(_0x5a5916,_0x3750a2){_0x5a5916=_0x5a5916-0x0;var _0x46e08a=_0x31c2[_0x5a5916];return _0x46e08a;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'state':{'type':Sequelize[_0x231c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x231c('0x3')]},'scheduledat':{'type':Sequelize[_0x231c('0x4')]},'uniqueid':{'type':Sequelize[_0x231c('0x3')]},'starttime':{'type':Sequelize[_0x231c('0x4')]},'responsetime':{'type':Sequelize[_0x231c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x231c('0x3')]},'membername':{'type':Sequelize[_0x231c('0x3')]}}; \ No newline at end of file +var _0x3dba=['INTEGER','STRING','DATE'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x3dba,0x73));var _0xa3db=function(_0x50b750,_0xe5817b){_0x50b750=_0x50b750-0x0;var _0x1b60a8=_0x3dba[_0x50b750];return _0x1b60a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa3db('0x0')]},'scheduledat':{'type':Sequelize[_0xa3db('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa3db('0x1')]},'responsetime':{'type':Sequelize[_0xa3db('0x1')]},'ringtime':{'type':Sequelize[_0xa3db('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa3db('0x0')]},'campaigntype':{'type':Sequelize[_0xa3db('0x0')]},'membername':{'type':Sequelize[_0xa3db('0x0')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8d54509..c83e869 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 _0x715d=['moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','lodash','api'];(function(_0x25f441,_0x2398c6){var _0x3db26d=function(_0x2cea05){while(--_0x2cea05){_0x25f441['push'](_0x25f441['shift']());}};_0x3db26d(++_0x2398c6);}(_0x715d,0x166));var _0xd715=function(_0x2cf2ac,_0x30d668){_0x2cf2ac=_0x2cf2ac-0x0;var _0x569207=_0x715d[_0x2cf2ac];return _0x569207;};'use strict';var _=require(_0xd715('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd715('0x1'));var moment=require(_0xd715('0x2'));var BPromise=require(_0xd715('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd715('0x4'));var rimraf=require(_0xd715('0x5'));var config=require(_0xd715('0x6'));var attributes=require(_0xd715('0x7'));module['exports']=function(_0xa732b5,_0x117114){return _0xa732b5[_0xd715('0x8')](_0xd715('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3a9=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','util','../../config/logger'];(function(_0x50aa3d,_0x445ec3){var _0x34b88b=function(_0x39168b){while(--_0x39168b){_0x50aa3d['push'](_0x50aa3d['shift']());}};_0x34b88b(++_0x445ec3);}(_0xb3a9,0xc4));var _0x9b3a=function(_0x1d7123,_0x2538e7){_0x1d7123=_0x1d7123-0x0;var _0x5863bf=_0xb3a9[_0x1d7123];return _0x5863bf;};'use strict';var _=require('lodash');var util=require(_0x9b3a('0x0'));var logger=require(_0x9b3a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9b3a('0x2'));var rp=require(_0x9b3a('0x3'));var fs=require('fs');var path=require(_0x9b3a('0x4'));var rimraf=require(_0x9b3a('0x5'));var config=require(_0x9b3a('0x6'));var attributes=require(_0x9b3a('0x7'));module['exports']=function(_0x20d1db,_0x5ac1f8){return _0x20d1db['define'](_0x9b3a('0x8'),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 2367eaa..6bb766d 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 _0x3718=['info','catch','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','body','options','raw'];(function(_0x406ab4,_0x34da25){var _0x3339d5=function(_0x58a25e){while(--_0x58a25e){_0x406ab4['push'](_0x406ab4['shift']());}};_0x3339d5(++_0x34da25);}(_0x3718,0xa5));var _0x8371=function(_0x32622f,_0x423af5){_0x32622f=_0x32622f-0x0;var _0x1ad00c=_0x3718[_0x32622f];return _0x1ad00c;};'use strict';var _=require(_0x8371('0x0'));var util=require(_0x8371('0x1'));var moment=require(_0x8371('0x2'));var BPromise=require(_0x8371('0x3'));var rs=require(_0x8371('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8371('0x5'))['db'];var utils=require(_0x8371('0x6'));var logger=require('../../config/logger')(_0x8371('0x7'));var config=require('../../config/environment');var jayson=require(_0x8371('0x8'));var client=jayson[_0x8371('0x9')][_0x8371('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c9018,_0x5cef9f,_0x500a97){return new BPromise(function(_0x1fe329,_0x4ee243){return client[_0x8371('0xb')](_0x4c9018,_0x500a97)[_0x8371('0xc')](function(_0x483209){logger['info'](_0x8371('0xd'),_0x5cef9f,_0x8371('0xe'));logger['debug'](_0x8371('0xf'),_0x5cef9f,'request\x20sent',JSON[_0x8371('0x10')](_0x483209));if(_0x483209[_0x8371('0x11')]){if(_0x483209[_0x8371('0x11')][_0x8371('0x12')]===0x1f4){logger['error'](_0x8371('0xd'),_0x5cef9f,_0x483209[_0x8371('0x11')][_0x8371('0x13')]);return _0x4ee243(_0x483209[_0x8371('0x11')][_0x8371('0x13')]);}logger[_0x8371('0x11')](_0x8371('0xd'),_0x5cef9f,_0x483209[_0x8371('0x11')][_0x8371('0x13')]);return _0x1fe329(_0x483209['error'][_0x8371('0x13')]);}else{logger['info'](_0x8371('0xd'),_0x5cef9f,_0x8371('0xe'));_0x1fe329(_0x483209[_0x8371('0x14')][_0x8371('0x13')]);}})['catch'](function(_0x51c213){logger[_0x8371('0x11')](_0x8371('0xd'),_0x5cef9f,_0x51c213);_0x4ee243(_0x51c213);});});}exports['CreateReportAgentPreview']=function(_0x38f070){var _0x2fe563=this;return new Promise(function(_0x28df26,_0x4e1024){return db['ReportAgentPreview']['create'](_0x38f070[_0x8371('0x15')],{'raw':_0x38f070[_0x8371('0x16')]?_0x38f070[_0x8371('0x16')][_0x8371('0x17')]===undefined?!![]:![]:!![]})[_0x8371('0xc')](function(_0x1acb2c){logger[_0x8371('0x18')]('CreateReportAgentPreview',_0x38f070);logger['debug']('CreateReportAgentPreview',_0x38f070,JSON['stringify'](_0x1acb2c));_0x28df26(_0x1acb2c);})[_0x8371('0x19')](function(_0x50cd1d){logger[_0x8371('0x11')](_0x8371('0x1a'),_0x50cd1d[_0x8371('0x13')],_0x38f070);_0x4e1024(_0x2fe563[_0x8371('0x11')](0x1f4,_0x50cd1d[_0x8371('0x13')]));});});}; \ No newline at end of file +var _0xd01d=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','util','bluebird','randomstring','../../mysqldb'];(function(_0x1fc8ec,_0x460755){var _0x471533=function(_0x2e9f56){while(--_0x2e9f56){_0x1fc8ec['push'](_0x1fc8ec['shift']());}};_0x471533(++_0x460755);}(_0xd01d,0x15b));var _0xdd01=function(_0x3b1da7,_0x1061b3){_0x3b1da7=_0x3b1da7-0x0;var _0x55f927=_0xd01d[_0x3b1da7];return _0x55f927;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var moment=require('moment');var BPromise=require(_0xdd01('0x1'));var rs=require(_0xdd01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd01('0x3'))['db'];var utils=require(_0xdd01('0x4'));var logger=require(_0xdd01('0x5'))(_0xdd01('0x6'));var config=require('../../config/environment');var jayson=require(_0xdd01('0x7'));var client=jayson[_0xdd01('0x8')][_0xdd01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428f73,_0x3fd7ed,_0x1b50b4){return new BPromise(function(_0x3d6966,_0x43ed36){return client[_0xdd01('0xa')](_0x428f73,_0x1b50b4)[_0xdd01('0xb')](function(_0x5c7dcd){logger[_0xdd01('0xc')](_0xdd01('0xd'),_0x3fd7ed,_0xdd01('0xe'));logger[_0xdd01('0xf')](_0xdd01('0x10'),_0x3fd7ed,'request\x20sent',JSON[_0xdd01('0x11')](_0x5c7dcd));if(_0x5c7dcd[_0xdd01('0x12')]){if(_0x5c7dcd[_0xdd01('0x12')]['code']===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3fd7ed,_0x5c7dcd['error'][_0xdd01('0x13')]);return _0x43ed36(_0x5c7dcd[_0xdd01('0x12')][_0xdd01('0x13')]);}logger[_0xdd01('0x12')](_0xdd01('0xd'),_0x3fd7ed,_0x5c7dcd['error'][_0xdd01('0x13')]);return _0x3d6966(_0x5c7dcd[_0xdd01('0x12')][_0xdd01('0x13')]);}else{logger[_0xdd01('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x3fd7ed,'request\x20sent');_0x3d6966(_0x5c7dcd[_0xdd01('0x14')]['message']);}})[_0xdd01('0x15')](function(_0x276767){logger[_0xdd01('0x12')](_0xdd01('0xd'),_0x3fd7ed,_0x276767);_0x43ed36(_0x276767);});});}exports[_0xdd01('0x16')]=function(_0x3f2d80){var _0x1b645f=this;return new Promise(function(_0x28115b,_0x421109){return db[_0xdd01('0x17')][_0xdd01('0x18')](_0x3f2d80[_0xdd01('0x19')],{'raw':_0x3f2d80['options']?_0x3f2d80[_0xdd01('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xdd01('0xb')](function(_0x56c7bf){logger[_0xdd01('0xc')](_0xdd01('0x16'),_0x3f2d80);logger['debug'](_0xdd01('0x16'),_0x3f2d80,JSON[_0xdd01('0x11')](_0x56c7bf));_0x28115b(_0x56c7bf);})[_0xdd01('0x15')](function(_0x3773c5){logger[_0xdd01('0x12')]('CreateReportAgentPreview',_0x3773c5[_0xdd01('0x13')],_0x3f2d80);_0x421109(_0x1b645f[_0xdd01('0x12')](0x1f4,_0x3773c5[_0xdd01('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index e7fa8f1..35be6c6 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 _0xde2c=['sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','get','/voice/queues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','mail','showMailQueues','post','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x4fc955,_0x493aa0){var _0x3a2cb4=function(_0x2f4704){while(--_0x2f4704){_0x4fc955['push'](_0x4fc955['shift']());}};_0x3a2cb4(++_0x493aa0);}(_0xde2c,0x1ad));var _0xcde2=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0xde2c[_0x3b0912];return _0xa8f339;};'use strict';var multer=require('multer');var util=require(_0xcde2('0x0'));var path=require(_0xcde2('0x1'));var express=require('express');var router=express[_0xcde2('0x2')]();var auth=require(_0xcde2('0x3'));var controller=require('./rpc.controller');router['get'](_0xcde2('0x4'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x6')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xcde2('0x5')](),controller[_0xcde2('0x7')]);router['get'](_0xcde2('0x8'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x9')]);router[_0xcde2('0xa')](_0xcde2('0xb'),auth[_0xcde2('0x5')](),controller['voiceQueues']);router['get'](_0xcde2('0xc'),auth['isAuthenticated'](),controller[_0xcde2('0xd')]);router[_0xcde2('0xa')]('/mail/queues',auth[_0xcde2('0x5')](),controller['mailQueues']);router[_0xcde2('0xa')](_0xcde2('0xe'),auth[_0xcde2('0x5')](),controller[_0xcde2('0xf')]);router[_0xcde2('0xa')]('/openchannel/queues',auth[_0xcde2('0x5')](),controller['openchannelQueues']);router[_0xcde2('0xa')](_0xcde2('0x10'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x11')]);router[_0xcde2('0xa')](_0xcde2('0x12'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x13')]);router[_0xcde2('0xa')](_0xcde2('0x14'),auth['isAuthenticated'](),controller[_0xcde2('0x15')]);router[_0xcde2('0xa')](_0xcde2('0x16'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x17')]);router[_0xcde2('0xa')](_0xcde2('0x18'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x19')]);router[_0xcde2('0xa')](_0xcde2('0x1a'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x1b')]);router[_0xcde2('0xa')](_0xcde2('0x1c'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x1d')]);router[_0xcde2('0xa')](_0xcde2('0x1e'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x1f')]);router['get']('/voice/queues/:id',auth[_0xcde2('0x5')](),controller[_0xcde2('0x20')]);router[_0xcde2('0x21')](_0xcde2('0x22'),auth['isAuthenticated'](),controller[_0xcde2('0x23')]);router['get'](_0xcde2('0x24'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x25')]);router[_0xcde2('0xa')](_0xcde2('0x26'),auth[_0xcde2('0x5')](),controller['outboundChannels']);router[_0xcde2('0xa')](_0xcde2('0x27'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x28')]);router['put'](_0xcde2('0x29'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x2a')]);router[_0xcde2('0xa')](_0xcde2('0x2b'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x2c')]);router['get'](_0xcde2('0x2d'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x2e')]);router[_0xcde2('0xa')](_0xcde2('0x2f'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x30')]);router[_0xcde2('0xa')]('/fax/accounts',auth[_0xcde2('0x5')](),controller[_0xcde2('0x31')]);router[_0xcde2('0xa')](_0xcde2('0x32'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x33')]);router['get'](_0xcde2('0x34'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0xcde2('0xa')](_0xcde2('0x35'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x36')]);router[_0xcde2('0xa')](_0xcde2('0x37'),auth[_0xcde2('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0xcde2('0x38'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x39')]);router[_0xcde2('0xa')]('/whatsapp/queues/waitinginteractions',auth[_0xcde2('0x5')](),controller[_0xcde2('0x3a')]);router[_0xcde2('0xa')]('/fax/queues/waitinginteractions',auth[_0xcde2('0x5')](),controller[_0xcde2('0x3b')]);router['post']('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xcde2('0x3c')));router[_0xcde2('0xa')]('/mail/queues/:id',auth[_0xcde2('0x5')](),controller[_0xcde2('0x3d')]);router[_0xcde2('0x3e')](_0xcde2('0x3f'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x40')]('chat'));router['get'](_0xcde2('0x41'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x42')]);router[_0xcde2('0x3e')](_0xcde2('0x43'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x40')](_0xcde2('0x44')));router['get'](_0xcde2('0x45'),auth['isAuthenticated'](),controller[_0xcde2('0x46')]);router[_0xcde2('0x3e')](_0xcde2('0x47'),auth[_0xcde2('0x5')](),controller['queueNotify'](_0xcde2('0x48')));router[_0xcde2('0xa')]('/openchannel/queues/:id',auth[_0xcde2('0x5')](),controller[_0xcde2('0x49')]);router['post'](_0xcde2('0x4a'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x40')](_0xcde2('0x4b')));router['post'](_0xcde2('0x4c'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x40')](_0xcde2('0x4d')));router['get'](_0xcde2('0x4e'),auth[_0xcde2('0x5')](),controller['showSmsQueues']);router['get'](_0xcde2('0x4f'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x50')]);router[_0xcde2('0x3e')](_0xcde2('0x51'),auth[_0xcde2('0x5')](),controller[_0xcde2('0x52')]);module[_0xcde2('0x53')]=router; \ No newline at end of file +var _0x22dd=['/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','/chat/queues/:id/notify','queueNotify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues'];(function(_0x372a57,_0x9aa407){var _0x358f6d=function(_0x34e8b9){while(--_0x34e8b9){_0x372a57['push'](_0x372a57['shift']());}};_0x358f6d(++_0x9aa407);}(_0x22dd,0x199));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd22d('0x0'));var util=require(_0xd22d('0x1'));var path=require(_0xd22d('0x2'));var express=require(_0xd22d('0x3'));var router=express[_0xd22d('0x4')]();var auth=require(_0xd22d('0x5'));var controller=require(_0xd22d('0x6'));router[_0xd22d('0x7')](_0xd22d('0x8'),auth[_0xd22d('0x9')](),controller['voiceChannels']);router[_0xd22d('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xd22d('0x9')](),controller[_0xd22d('0xa')]);router[_0xd22d('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xd22d('0x9')](),controller[_0xd22d('0xb')]);router['get']('/voice/queues',auth[_0xd22d('0x9')](),controller[_0xd22d('0xc')]);router[_0xd22d('0x7')](_0xd22d('0xd'),auth['isAuthenticated'](),controller[_0xd22d('0xe')]);router[_0xd22d('0x7')](_0xd22d('0xf'),auth[_0xd22d('0x9')](),controller['mailQueues']);router[_0xd22d('0x7')](_0xd22d('0x10'),auth['isAuthenticated'](),controller[_0xd22d('0x11')]);router[_0xd22d('0x7')](_0xd22d('0x12'),auth['isAuthenticated'](),controller[_0xd22d('0x13')]);router[_0xd22d('0x7')]('/sms/queues',auth['isAuthenticated'](),controller[_0xd22d('0x14')]);router[_0xd22d('0x7')](_0xd22d('0x15'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x16')]);router['get'](_0xd22d('0x17'),auth[_0xd22d('0x9')](),controller['faxQueues']);router[_0xd22d('0x7')](_0xd22d('0x18'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x19')]);router[_0xd22d('0x7')](_0xd22d('0x1a'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x1b')]);router[_0xd22d('0x7')]('/voice/queues/channels/:uniqueid',auth[_0xd22d('0x9')](),controller[_0xd22d('0x1c')]);router[_0xd22d('0x7')](_0xd22d('0x1d'),auth[_0xd22d('0x9')](),controller['voiceQueuesChannelHangup']);router[_0xd22d('0x7')](_0xd22d('0x1e'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x1f')]);router[_0xd22d('0x7')](_0xd22d('0x20'),auth[_0xd22d('0x9')](),controller['showVoiceQueues']);router[_0xd22d('0x21')](_0xd22d('0x20'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x22')]);router['get'](_0xd22d('0x23'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x24')]);router[_0xd22d('0x7')](_0xd22d('0x25'),auth[_0xd22d('0x9')](),controller['outboundChannels']);router[_0xd22d('0x7')](_0xd22d('0x26'),auth['isAuthenticated'](),controller[_0xd22d('0x27')]);router[_0xd22d('0x21')](_0xd22d('0x28'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x29')]);router['get'](_0xd22d('0x2a'),auth[_0xd22d('0x9')](),controller['telephones']);router[_0xd22d('0x7')](_0xd22d('0x2b'),auth['isAuthenticated'](),controller['trunks']);router[_0xd22d('0x7')](_0xd22d('0x2c'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x2d')]);router['get'](_0xd22d('0x2e'),auth['isAuthenticated'](),controller[_0xd22d('0x2f')]);router[_0xd22d('0x7')](_0xd22d('0x30'),auth['isAuthenticated'](),controller[_0xd22d('0x31')]);router['get'](_0xd22d('0x32'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x33')]);router['get'](_0xd22d('0x34'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x35')]);router['get'](_0xd22d('0x36'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x37')]);router[_0xd22d('0x7')]('/sms/queues/waitinginteractions',auth[_0xd22d('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0xd22d('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0xd22d('0x9')](),controller[_0xd22d('0x38')]);router[_0xd22d('0x7')](_0xd22d('0x39'),auth[_0xd22d('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0xd22d('0x3a')](_0xd22d('0x3b'),auth['isAuthenticated'](),controller['queueNotify']('mail'));router['get']('/mail/queues/:id',auth[_0xd22d('0x9')](),controller['showMailQueues']);router[_0xd22d('0x3a')](_0xd22d('0x3c'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x3d')](_0xd22d('0x3e')));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller[_0xd22d('0x3f')]);router[_0xd22d('0x3a')]('/fax/queues/:id/notify',auth[_0xd22d('0x9')](),controller['queueNotify'](_0xd22d('0x40')));router[_0xd22d('0x7')](_0xd22d('0x41'),auth['isAuthenticated'](),controller[_0xd22d('0x42')]);router[_0xd22d('0x3a')](_0xd22d('0x43'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x3d')](_0xd22d('0x44')));router['get'](_0xd22d('0x45'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x46')]);router['post'](_0xd22d('0x47'),auth[_0xd22d('0x9')](),controller[_0xd22d('0x3d')](_0xd22d('0x48')));router[_0xd22d('0x3a')]('/whatsapp/queues/:id/notify',auth[_0xd22d('0x9')](),controller[_0xd22d('0x3d')](_0xd22d('0x49')));router['get'](_0xd22d('0x4a'),auth['isAuthenticated'](),controller[_0xd22d('0x4b')]);router[_0xd22d('0x7')]('/whatsapp/queues/:id',auth[_0xd22d('0x9')](),controller[_0xd22d('0x4c')]);router[_0xd22d('0x3a')](_0xd22d('0x4d'),auth['isAuthenticated'](),controller[_0xd22d('0x4e')]);module[_0xd22d('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 925529b..04eaedb 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 _0xd8fb=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Message','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd8fb,0x99));var _0xbd8f=function(_0xfa2d5f,_0x564dfa){_0xfa2d5f=_0xfa2d5f-0x0;var _0x274473=_0xd8fb[_0xfa2d5f];return _0x274473;};'use strict';var BPromise=require(_0xbd8f('0x0'));var moment=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));var util=require(_0xbd8f('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xbd8f('0x4'));var amiClient=jayson[_0xbd8f('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xbd8f('0x5')][_0xbd8f('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0xbd8f('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){var _0x493298=_0x578499?_0x578499:amiClient;return _0x493298['request'](_0x4e97cf,_0xf503c4)[_0xbd8f('0x7')](function(_0x2393a9){if(_0x2393a9[_0xbd8f('0x8')]){if(_0x2393a9['error'][_0xbd8f('0x9')]===0x1f4){return _0x403edc(_0x2393a9[_0xbd8f('0x8')]['message']);}return _0x197827(_0x2393a9['error'][_0xbd8f('0xa')]);}else{_0x197827(_0x2393a9[_0xbd8f('0xb')]);}})[_0xbd8f('0xc')](function(_0x5d5705){_0x403edc(_0x5d5705);});});}function respondWithResult(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xc8;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0xd')](_0x159f09)[_0xbd8f('0xe')](_0x39be16);}return _0x230988[_0xbd8f('0xf')](0x194);};}function handleError(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0x1f4;return function(_0x14606c){logger['error'](_0x14606c[_0xbd8f('0x10')]);if(_0x14606c[_0xbd8f('0x11')]){delete _0x14606c[_0xbd8f('0x11')];}_0x37d4d5[_0xbd8f('0xd')](_0x29ffe8)['send'](_0x14606c);};}function findById(_0x174929){return function(_0x63db18){if(!_['isNil'](_0x174929)&&!_[_0xbd8f('0x12')](_0x63db18)&&!_[_0xbd8f('0x12')](_0x63db18['rows'])){return _[_0xbd8f('0x13')](_0x63db18[_0xbd8f('0x14')],function(_0x47d317){return _0x47d317['id']==_0x174929;});}return null;};}exports['voiceChannels']=function(_0x33f77c,_0x5d2fdb){return respondWithRpcPromise('VoiceChannels',_0x33f77c[_0xbd8f('0x15')])['then'](respondWithResult(_0x5d2fdb,null))[_0xbd8f('0xc')](handleError(_0x5d2fdb,null));};exports[_0xbd8f('0x16')]=function(_0xb47c8e,_0x897f25){return respondWithRpcPromise(_0xbd8f('0x17'),_[_0xbd8f('0x18')](_0xb47c8e[_0xbd8f('0x15')],_0xb47c8e[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x897f25,null))[_0xbd8f('0xc')](handleError(_0x897f25,null));};exports[_0xbd8f('0x1a')]=function(_0x1628f5,_0x2f7c45){return respondWithRpcPromise(_0xbd8f('0x1b'),_[_0xbd8f('0x18')](_0x1628f5[_0xbd8f('0x15')],_0x1628f5[_0xbd8f('0x19')]))['then'](respondWithResult(_0x2f7c45,null))[_0xbd8f('0xc')](handleError(_0x2f7c45,null));};exports[_0xbd8f('0x1c')]=function(_0x1f9fcc,_0x2f3df7){return respondWithRpcPromise(_0xbd8f('0x1d'),_0x1f9fcc[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2f3df7,null))[_0xbd8f('0xc')](handleError(_0x2f3df7,null));};exports['showVoiceQueues']=function(_0x40cb43,_0x421f3e){return respondWithRpcPromise('VoiceQueues',_0x40cb43[_0xbd8f('0x15')])['then'](findById(_0x40cb43[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x421f3e,null))[_0xbd8f('0xc')](handleError(_0x421f3e,null));};exports[_0xbd8f('0x1e')]=function(_0x2aefa2,_0x247b07){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xbd8f('0x18')](_0x2aefa2[_0xbd8f('0x1f')],_0x2aefa2[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x247b07,null))[_0xbd8f('0xc')](handleError(_0x247b07,null));};exports[_0xbd8f('0x20')]=function(_0x2a4b32,_0x479a0c){return respondWithRpcPromise(_0xbd8f('0x21'),_[_0xbd8f('0x18')](_0x2a4b32[_0xbd8f('0x15')],_0x2a4b32[_0xbd8f('0x19')]))['then'](respondWithResult(_0x479a0c,null))['catch'](handleError(_0x479a0c,null));};exports[_0xbd8f('0x22')]=function(_0x3cdec2,_0x2fd6f8){return respondWithRpcPromise(_0xbd8f('0x23'),_0x3cdec2['query'])[_0xbd8f('0x7')](respondWithResult(_0x2fd6f8,null))[_0xbd8f('0xc')](handleError(_0x2fd6f8,null));};exports[_0xbd8f('0x24')]=function(_0x2137ed,_0x25ad9a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xbd8f('0x18')](_0x2137ed[_0xbd8f('0x15')],_0x2137ed[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x25ad9a,null))[_0xbd8f('0xc')](handleError(_0x25ad9a,null));};exports['voiceQueuesChannelHangup']=function(_0x24e5f4,_0x5f404e){return respondWithRpcPromise(_0xbd8f('0x25'),_[_0xbd8f('0x18')](_0x24e5f4[_0xbd8f('0x15')],_0x24e5f4[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x5f404e,null))[_0xbd8f('0xc')](handleError(_0x5f404e,null));};exports['voiceQueuesChannelRedirect']=function(_0x4bafcd,_0x4c9a8d){return respondWithRpcPromise(_0xbd8f('0x26'),_[_0xbd8f('0x18')](_0x4bafcd[_0xbd8f('0x15')],_0x4bafcd[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x4c9a8d,null))[_0xbd8f('0xc')](handleError(_0x4c9a8d,null));};exports[_0xbd8f('0x27')]=function(_0x30c1c2,_0x2d4882){return respondWithRpcPromise(_0xbd8f('0x28'),_0x30c1c2[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2d4882,null))[_0xbd8f('0xc')](handleError(_0x2d4882,null));};exports[_0xbd8f('0x29')]=function(_0x391d45,_0x50e081){return respondWithRpcPromise(_0xbd8f('0x2a'),_0x391d45[_0xbd8f('0x15')])['then'](respondWithResult(_0x50e081,null))[_0xbd8f('0xc')](handleError(_0x50e081,null));};exports[_0xbd8f('0x2b')]=function(_0x3d3902,_0x582bcf){var _0x21da54;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')])[_0xbd8f('0x7')](function(_0x298952){_0x21da54=_0x298952;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')],routingClient);})[_0xbd8f('0x7')](function(_0xdab323){return _['merge']({},_0xdab323,_0x21da54);})[_0xbd8f('0x7')](respondWithResult(_0x582bcf,null))[_0xbd8f('0xc')](handleError(_0x582bcf,null));};exports[_0xbd8f('0x2c')]=function(_0x351027,_0x280d95){if(_0x351027[_0xbd8f('0x1f')]&&_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]&&_0x351027[_0xbd8f('0x2e')]&&_0x351027['user']['name']){for(var _0x2907a3 in _0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]){if(_0x351027[_0xbd8f('0x1f')]['interaction'][_0xbd8f('0x2f')](_0x2907a3)){db[_0xbd8f('0x30')][_0xbd8f('0x31')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3]&&_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')]?{'$notIn':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3]}:{'$ne':null}}})[_0xbd8f('0x7')](function(_0x151f82){var _0x1ea49a=moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36c43f=0x0,_0x2fbbbe=_0x151f82[_0xbd8f('0x32')];_0x36c43f<_0x2fbbbe;_0x36c43f+=0x1){_0x151f82[_0x36c43f][_0xbd8f('0x34')]({'exitAt':_0x1ea49a});}});for(var _0x229bc0=0x0;_0x229bc0<_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')];_0x229bc0+=0x1){db['MemberReport'][_0xbd8f('0x35')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':_0xbd8f('0x36'),'uniqueid':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0x229bc0],'exitAt':null},'defaults':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'interface':_[_0xbd8f('0x12')](_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')])?util[_0xbd8f('0x33')](_0xbd8f('0x38'),_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')]):_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')],'type':_0xbd8f('0x36'),'enterAt':moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xbd8f('0x39'),'internal':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x3a')],'uniqueid':_0x351027[_0xbd8f('0x1f')]['interaction'][_0x2907a3][_0x229bc0]}});}}}}return respondWithRpcPromise(_0xbd8f('0x3b'),{'id':_0x351027['params']['id'],'capacity':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x3c')]},routingClient)[_0xbd8f('0x7')](respondWithResult(_0x280d95,null))[_0xbd8f('0xc')](handleError(_0x280d95,null));};exports['telephones']=function(_0x3964f5,_0x35b814){return respondWithRpcPromise(_0xbd8f('0x3d'),_0x3964f5[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x35b814,null))[_0xbd8f('0xc')](handleError(_0x35b814,null));};exports['trunks']=function(_0x42a597,_0x4a2da8){return respondWithRpcPromise(_0xbd8f('0x3e'),_0x42a597[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x4a2da8,null))[_0xbd8f('0xc')](handleError(_0x4a2da8,null));};exports[_0xbd8f('0x3f')]=function(_0x358424,_0x2a331d){return respondWithRpcPromise(_0xbd8f('0x40'),_0x358424[_0xbd8f('0x15')])['then'](respondWithResult(_0x2a331d,null))[_0xbd8f('0xc')](handleError(_0x2a331d,null));};exports['chatQueues']=function(_0xd09e5,_0xb04dae){return respondWithRpcPromise('ChatQueues',_0xd09e5[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0xb04dae,null))['catch'](handleError(_0xb04dae,null));};exports['showChatQueues']=function(_0x55de68,_0x4042e0){return respondWithRpcPromise(_0xbd8f('0x41'),_0x55de68[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x55de68[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x4042e0,null))['catch'](handleError(_0x4042e0,null));};exports[_0xbd8f('0x42')]=function(_0x3848cb,_0x21d40b){return respondWithRpcPromise(_0xbd8f('0x43'),_0x3848cb[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x21d40b,null))[_0xbd8f('0xc')](handleError(_0x21d40b,null));};exports['showMailQueues']=function(_0x9cf2d5,_0x40c834){return respondWithRpcPromise(_0xbd8f('0x43'),_0x9cf2d5['query'],routingClient)[_0xbd8f('0x7')](findById(_0x9cf2d5[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x40c834,null))[_0xbd8f('0xc')](handleError(_0x40c834,null));};exports['mailAccounts']=function(_0x5327f2,_0x388af8){return respondWithRpcPromise('MailAccounts',_0x5327f2[_0xbd8f('0x15')],mailClient)[_0xbd8f('0x7')](respondWithResult(_0x388af8,null))[_0xbd8f('0xc')](handleError(_0x388af8,null));};exports[_0xbd8f('0x44')]=function(_0x4a86a9,_0x5ea275){return respondWithRpcPromise(_0xbd8f('0x45'),_0x4a86a9[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5ea275,null))[_0xbd8f('0xc')](handleError(_0x5ea275,null));};exports[_0xbd8f('0x46')]=function(_0x21cad7,_0x31adfb){return respondWithRpcPromise(_0xbd8f('0x45'),_0x21cad7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x21cad7[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x31adfb,null))[_0xbd8f('0xc')](handleError(_0x31adfb,null));};exports[_0xbd8f('0x47')]=function(_0x225ebd,_0x12ee82){return respondWithRpcPromise(_0xbd8f('0x48'),_0x225ebd[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x12ee82,null))[_0xbd8f('0xc')](handleError(_0x12ee82,null));};exports[_0xbd8f('0x49')]=function(_0x538fd7,_0x5e18fc){return respondWithRpcPromise(_0xbd8f('0x48'),_0x538fd7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x538fd7['params']['id']))['then'](respondWithResult(_0x5e18fc,null))[_0xbd8f('0xc')](handleError(_0x5e18fc,null));};exports['whatsappQueues']=function(_0x565e63,_0x5b5bd8){return respondWithRpcPromise('WhatsappQueues',_0x565e63['query'],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b5bd8,null))['catch'](handleError(_0x5b5bd8,null));};exports[_0xbd8f('0x4a')]=function(_0x400aac,_0x53f297){return respondWithRpcPromise(_0xbd8f('0x4b'),_0x400aac[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x400aac[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x53f297,null))['catch'](handleError(_0x53f297,null));};exports['faxQueues']=function(_0x378e72,_0x44469e){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x378e72[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x44469e,null))[_0xbd8f('0xc')](handleError(_0x44469e,null));};exports['showFaxQueues']=function(_0x4eddf2,_0x467b0f){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x4eddf2['query'],routingClient)[_0xbd8f('0x7')](findById(_0x4eddf2[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x467b0f,null))[_0xbd8f('0xc')](handleError(_0x467b0f,null));};exports[_0xbd8f('0x4d')]=function(_0x10268a,_0x5a8c8f){return respondWithRpcPromise('FaxAccounts',_0x10268a[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x5a8c8f,null))[_0xbd8f('0xc')](handleError(_0x5a8c8f,null));};exports[_0xbd8f('0x4e')]=function(_0x41be86,_0x5b900c){return respondWithRpcPromise(_0xbd8f('0x4f'),_0x41be86[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b900c,null))[_0xbd8f('0xc')](handleError(_0x5b900c,null));};exports[_0xbd8f('0x50')]=function(_0x3574a6,_0x2a7eaa){return respondWithRpcPromise(_0xbd8f('0x51'),_0x3574a6[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2a7eaa,null))[_0xbd8f('0xc')](handleError(_0x2a7eaa,null));};exports[_0xbd8f('0x52')]=function(_0x34eec5,_0x40fc53){return respondWithRpcPromise(_0xbd8f('0x53'),_0x34eec5[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x40fc53,null))[_0xbd8f('0xc')](handleError(_0x40fc53,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x38d98e,_0x2957fd){return respondWithRpcPromise(_0xbd8f('0x53'),_0x38d98e[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](function(_0x18ccf2){if(_0x38d98e['query']['type']!==undefined){var _0x2a3982=_(_0x18ccf2[_0xbd8f('0x14')])['filter']([_0x38d98e[_0xbd8f('0x15')]['type'],_0x38d98e[_0xbd8f('0x19')]['id']])[_0xbd8f('0x54')](_0xbd8f('0x55'))[_0xbd8f('0x56')]()['value']();return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x84e98d){return _0x2a3982['indexOf'](_0x84e98d[_0xbd8f('0x55')])>-0x1;});}else{return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x161ec8){return _0x161ec8['queue_id']===parseInt(_0x38d98e[_0xbd8f('0x19')]['id']);});}})[_0xbd8f('0x7')](respondWithResult(_0x2957fd,null))[_0xbd8f('0xc')](handleError(_0x2957fd,null));};exports[_0xbd8f('0x58')]=function(_0x18645e,_0x23e962){return respondWithRpcPromise(_0xbd8f('0x59'),_0x18645e[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x23e962,null))[_0xbd8f('0xc')](handleError(_0x23e962,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3da31b,_0x4e908d){return respondWithRpcPromise(_0xbd8f('0x5a'),_0x3da31b[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x4e908d,null))[_0xbd8f('0xc')](handleError(_0x4e908d,null));};exports[_0xbd8f('0x5b')]=function(_0x60cd2b,_0x2ab853){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x60cd2b[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2ab853,null))[_0xbd8f('0xc')](handleError(_0x2ab853,null));};exports[_0xbd8f('0x5c')]=function(_0x58651d){return function(_0x4e19ec,_0x2fb942){var _0x3641e9,_0x1f685d;var _0x2acd13=_[_0xbd8f('0x5d')](_0x58651d);var _0x53076d=_0x58651d===_0xbd8f('0x5e')?_0xbd8f('0x5f'):_0xbd8f('0x60');return db[_0x2acd13+_0xbd8f('0x61')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x4e19ec['params']['id']}})['then'](function(_0x542075){if(_[_0xbd8f('0x12')](_0x542075)){throw new Error(_0x2acd13+'\x20Queue\x20not\x20found');}_0x3641e9=_0x542075;return db[_0x2acd13+'Message']['findOne']({'where':{'id':_0x4e19ec[_0xbd8f('0x1f')][_0xbd8f('0x63')]},'include':[{'model':db[_0x2acd13+_0xbd8f('0x64')],'as':_0xbd8f('0x64')},{'model':db[_0x2acd13+_0x53076d],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0xefcfc1){if(_[_0xbd8f('0x12')](_0xefcfc1)){throw new Error(_0x2acd13+'\x20Message\x20not\x20found');}_0x1f685d=_0xefcfc1;return _0xefcfc1[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3caa98={'uniqueid':_0x58651d+'.'+_0x1f685d['id']+'.'+_0x1f685d['Interaction']['id'],'FromUserId':_0x4e19ec[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66')};_0x3caa98[_0x2acd13+_0xbd8f('0x67')]=_0x1f685d['id'];_0x3caa98[_0x2acd13+_0xbd8f('0x68')]=_0x1f685d[_0xbd8f('0x64')]['id'];_0x3caa98[_0xbd8f('0x69')+_0x2acd13+_0x53076d+'Id']=_0x1f685d[_0xbd8f('0x60')]['id'];_0x3caa98['To'+_0x2acd13+_0xbd8f('0x6a')]=_0x3641e9['id'];return db[_0x2acd13+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3caa98);})['then'](function(){return respondWithRpcPromise(_0xbd8f('0x6d'),{'channel':_0x58651d,'interaction':_0x1f685d[_0xbd8f('0x64')],'message':_0x1f685d,'account':_0x1f685d[_0xbd8f('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3641e9[_0xbd8f('0x11')]+','+(_0x1f685d['Account'][_0xbd8f('0x6e')]||0x12c),'interval':_0xbd8f('0x6f')}]},routingClient);})[_0xbd8f('0x7')](respondWithResult(_0x2fb942,null))[_0xbd8f('0xc')](handleError(_0x2fb942,null));};};exports[_0xbd8f('0x70')]=function(_0x57762c,_0xe58b64){var _0x198d4b,_0x60c94c;if(_[_0xbd8f('0x12')](_0x57762c[_0xbd8f('0x1f')][_0xbd8f('0x71')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x672cfb=_0x57762c[_0xbd8f('0x1f')]['channel'];var _0x49e15e=_[_0xbd8f('0x5d')](_0x672cfb);var _0x5b0716=_0x672cfb==='chat'?'Website':_0xbd8f('0x60');return db[_0xbd8f('0x72')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x57762c[_0xbd8f('0x19')]['id'],'role':'agent'}})[_0xbd8f('0x7')](function(_0x398cc9){if(_['isNil'](_0x398cc9)){throw new Error('Agent\x20not\x20found');}_0x198d4b=_0x398cc9;return db[_0x49e15e+_0xbd8f('0x73')]['findOne']({'where':{'id':_0x57762c[_0xbd8f('0x1f')]['messageId']},'include':[{'model':db[_0x49e15e+'Interaction'],'as':_0xbd8f('0x64')},{'model':db[_0x49e15e+_0x5b0716],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0x18e9f0){if(_[_0xbd8f('0x12')](_0x18e9f0)){throw new Error(_0x49e15e+'\x20Message\x20not\x20found');}_0x60c94c=_0x18e9f0;return _0x18e9f0[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3a6ec4={'uniqueid':_0x672cfb+'.'+_0x60c94c['id']+'.'+_0x60c94c['Interaction']['id'],'FromUserId':_0x57762c[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66'),'ToUserId':_0x198d4b['id']};_0x3a6ec4[_0x49e15e+_0xbd8f('0x67')]=_0x60c94c['id'];_0x3a6ec4[_0x49e15e+_0xbd8f('0x68')]=_0x60c94c[_0xbd8f('0x64')]['id'];_0x3a6ec4[_0xbd8f('0x69')+_0x49e15e+_0x5b0716+'Id']=_0x60c94c[_0xbd8f('0x60')]['id'];return db[_0x49e15e+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3a6ec4);})[_0xbd8f('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x672cfb,'interaction':_0x60c94c['Interaction'],'message':_0x60c94c,'account':_0x60c94c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x198d4b[_0xbd8f('0x11')]+','+(_0x60c94c[_0xbd8f('0x60')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xe58b64,null))['catch'](handleError(_0xe58b64,null));}; \ No newline at end of file +var _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x2fa6b0,_0x2fc59b){var _0xf1049d=function(_0x35c9c4){while(--_0x35c9c4){_0x2fa6b0['push'](_0x2fa6b0['shift']());}};_0xf1049d(++_0x2fc59b);}(_0x7bae,0x13b));var _0xe7ba=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7bae[_0x618414];return _0x21c19a;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5b95999..daf0a8b 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 _0xf446=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','index','/:id','show','post','create','put','update','delete','isAuthenticated','exports','multer'];(function(_0x27833a,_0x531af2){var _0x2f2594=function(_0x837f16){while(--_0x837f16){_0x27833a['push'](_0x27833a['shift']());}};_0x2f2594(++_0x531af2);}(_0xf446,0x1e5));var _0x6f44=function(_0x286b55,_0x723c8b){_0x286b55=_0x286b55-0x0;var _0x5efe59=_0xf446[_0x286b55];return _0x5efe59;};'use strict';var multer=require(_0x6f44('0x0'));var util=require('util');var path=require(_0x6f44('0x1'));var timeout=require(_0x6f44('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f44('0x3'));var auth=require(_0x6f44('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f44('0x5'));var controller=require(_0x6f44('0x6'));router[_0x6f44('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f44('0x8')]);router[_0x6f44('0x7')](_0x6f44('0x9'),auth['isAuthenticated'](),controller[_0x6f44('0xa')]);router[_0x6f44('0x7')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x6f44('0xb')]('/',auth['isAuthenticated'](),controller[_0x6f44('0xc')]);router[_0x6f44('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6f44('0xe')]);router[_0x6f44('0xf')](_0x6f44('0x9'),auth[_0x6f44('0x10')](),controller['destroy']);module[_0x6f44('0x11')]=router; \ No newline at end of file +var _0x6b69=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','run','post','put','delete','multer','util','connect-timeout'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x6b69,0x1b7));var _0x96b6=function(_0x4d9133,_0x192360){_0x4d9133=_0x4d9133-0x0;var _0x233c69=_0x6b69[_0x4d9133];return _0x233c69;};'use strict';var multer=require(_0x96b6('0x0'));var util=require(_0x96b6('0x1'));var path=require('path');var timeout=require(_0x96b6('0x2'));var express=require(_0x96b6('0x3'));var router=express['Router']();var fs_extra=require(_0x96b6('0x4'));var auth=require(_0x96b6('0x5'));var interaction=require(_0x96b6('0x6'));var config=require(_0x96b6('0x7'));var controller=require(_0x96b6('0x8'));router[_0x96b6('0x9')]('/',auth[_0x96b6('0xa')](),controller['index']);router[_0x96b6('0x9')](_0x96b6('0xb'),auth[_0x96b6('0xa')](),controller[_0x96b6('0xc')]);router[_0x96b6('0x9')]('/:id/run',auth[_0x96b6('0xa')](),controller[_0x96b6('0xd')]);router[_0x96b6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96b6('0xf')](_0x96b6('0xb'),auth[_0x96b6('0xa')](),controller['update']);router[_0x96b6('0x10')](_0x96b6('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 242561c..59fdcc1 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 _0x0c6a=['years','months','weeks','days','hours','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x0c6a,0x14d));var _0xa0c6=function(_0x48d6c2,_0x1ce5d2){_0x48d6c2=_0x48d6c2-0x0;var _0x39eeb1=_0x0c6a[_0x48d6c2];return _0x39eeb1;};'use strict';var Sequelize=require(_0xa0c6('0x0'));module[_0xa0c6('0x1')]={'name':{'type':Sequelize[_0xa0c6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa0c6('0x2')]},'active':{'type':Sequelize[_0xa0c6('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa0c6('0x4')},'startAt':{'type':Sequelize[_0xa0c6('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa0c6('0x6')](_0xa0c6('0x7'),'quarters',_0xa0c6('0x8'),_0xa0c6('0x9'),_0xa0c6('0xa'),_0xa0c6('0xb'),'minutes'),'allowNull':![],'defaultValue':_0xa0c6('0xa')},'output':{'type':Sequelize[_0xa0c6('0x6')](_0xa0c6('0xc'),_0xa0c6('0xd'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xa0c6('0x6')](_0xa0c6('0xe'),_0xa0c6('0xf')),'allowNull':![],'defaultValue':_0xa0c6('0xe')},'sendMail':{'type':Sequelize[_0xa0c6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa0c6('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xa0c6('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7b98=['weeks','days','hours','minutes','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months'];(function(_0x2e1507,_0x362340){var _0x4da96f=function(_0x1f7c9b){while(--_0x1f7c9b){_0x2e1507['push'](_0x2e1507['shift']());}};_0x4da96f(++_0x362340);}(_0x7b98,0x1d1));var _0x87b9=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x7b98[_0x3daa8c];return _0x2b1bd7;};'use strict';var Sequelize=require(_0x87b9('0x0'));module[_0x87b9('0x1')]={'name':{'type':Sequelize[_0x87b9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x87b9('0x2')]},'active':{'type':Sequelize[_0x87b9('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x87b9('0x2')],'allowNull':![],'defaultValue':_0x87b9('0x4')},'startAt':{'type':Sequelize[_0x87b9('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x87b9('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x87b9('0x7')](_0x87b9('0x8'),'quarters',_0x87b9('0x9'),_0x87b9('0xa'),_0x87b9('0xb'),_0x87b9('0xc'),_0x87b9('0xd')),'allowNull':![],'defaultValue':_0x87b9('0xb')},'output':{'type':Sequelize[_0x87b9('0x7')](_0x87b9('0xe'),_0x87b9('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x87b9('0xe')},'type':{'type':Sequelize['ENUM'](_0x87b9('0x10'),_0x87b9('0x11')),'allowNull':![],'defaultValue':_0x87b9('0x10')},'sendMail':{'type':Sequelize[_0x87b9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x87b9('0x2')]},'cc':{'type':Sequelize[_0x87b9('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x87b9('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 5861e67..c0c6d5a 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 _0x2ee1=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','model','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Scheduler','destroy','error','name','send','index','map','Schedule','rawAttributes','fieldName','query','filters','attributes','fields','length','hasOwnProperty','nolimit','where','pick'];(function(_0x237f1e,_0x32e440){var _0x18985d=function(_0x253e7e){while(--_0x253e7e){_0x237f1e['push'](_0x237f1e['shift']());}};_0x18985d(++_0x32e440);}(_0x2ee1,0x6e));var _0x12ee=function(_0x4ed827,_0x54d776){_0x4ed827=_0x4ed827-0x0;var _0x2e1038=_0x2ee1[_0x4ed827];return _0x2e1038;};'use strict';var emlformat=require(_0x12ee('0x0'));var rimraf=require(_0x12ee('0x1'));var zipdir=require(_0x12ee('0x2'));var jsonpatch=require(_0x12ee('0x3'));var rp=require(_0x12ee('0x4'));var moment=require('moment');var BPromise=require(_0x12ee('0x5'));var Mustache=require(_0x12ee('0x6'));var util=require(_0x12ee('0x7'));var path=require(_0x12ee('0x8'));var sox=require(_0x12ee('0x9'));var csv=require(_0x12ee('0xa'));var ejs=require(_0x12ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12ee('0xc'));var squel=require(_0x12ee('0xd'));var crypto=require(_0x12ee('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x12ee('0xa'));var querystring=require(_0x12ee('0xf'));var Papa=require(_0x12ee('0x10'));var Redis=require(_0x12ee('0x11'));var authService=require(_0x12ee('0x12'));var qs=require(_0x12ee('0x13'));var as=require(_0x12ee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x12ee('0x15'));var utils=require('../../config/utils');var config=require(_0x12ee('0x16'));var licenseUtil=require(_0x12ee('0x17'));var db=require(_0x12ee('0x18'))['db'];function respondWithStatusCode(_0xd3cec5,_0xc1f2ff){_0xc1f2ff=_0xc1f2ff||0xcc;return function(_0x5341cd){if(_0x5341cd){return _0xd3cec5[_0x12ee('0x19')](_0xc1f2ff);}return _0xd3cec5[_0x12ee('0x1a')](_0xc1f2ff)[_0x12ee('0x1b')]();};}function respondWithResult(_0x2f5cb4,_0x4cca4a){_0x4cca4a=_0x4cca4a||0xc8;return function(_0x4bf6c4){if(_0x4bf6c4){return _0x2f5cb4['status'](_0x4cca4a)[_0x12ee('0x1c')](_0x4bf6c4);}};}function respondWithFilteredResult(_0x510c47,_0x28d140){return function(_0x27b518){if(_0x27b518){var _0x5e78ef=typeof _0x28d140[_0x12ee('0x1d')]===_0x12ee('0x1e')&&typeof _0x28d140['limit']===_0x12ee('0x1e');var _0x3bfc9f=_0x27b518[_0x12ee('0x1f')];var _0x5d8716=_0x5e78ef?0x0:_0x28d140[_0x12ee('0x1d')];var _0x340554=_0x5e78ef?_0x27b518[_0x12ee('0x1f')]:_0x28d140[_0x12ee('0x1d')]+_0x28d140[_0x12ee('0x20')];var _0x49014b;if(_0x340554>=_0x3bfc9f){_0x340554=_0x3bfc9f;_0x49014b=0xc8;}else{_0x49014b=0xce;}_0x510c47[_0x12ee('0x1a')](_0x49014b);return _0x510c47[_0x12ee('0x21')](_0x12ee('0x22'),_0x5d8716+'-'+_0x340554+'/'+_0x3bfc9f)[_0x12ee('0x1c')](_0x27b518);}return null;};}function patchUpdates(_0x18082f){return function(_0xb4f3c3){try{jsonpatch[_0x12ee('0x23')](_0xb4f3c3,_0x18082f,!![]);}catch(_0x197786){return BPromise[_0x12ee('0x24')](_0x197786);}return _0xb4f3c3[_0x12ee('0x25')]();};}function saveUpdates(_0x5f5260,_0x564ebe){return function(_0x22afdf){if(_0x22afdf){return _0x22afdf[_0x12ee('0x26')](_0x5f5260)[_0x12ee('0x27')](function(_0x1fa5d0){return _0x1fa5d0;});}return null;};}function removeEntity(_0x343d5f,_0x283c6f){return function(_0x3ea26f){if(_0x3ea26f){return _0x3ea26f['destroy']()[_0x12ee('0x27')](function(){var _0x2739c8=_0x3ea26f[_0x12ee('0x28')]({'plain':!![]});var _0x5b647f=_0x12ee('0x29');return db['UserProfileResource'][_0x12ee('0x2a')]({'where':{'type':_0x5b647f,'resourceId':_0x2739c8['id']}})[_0x12ee('0x27')](function(){return _0x3ea26f;});})[_0x12ee('0x27')](function(){_0x343d5f[_0x12ee('0x1a')](0xcc)[_0x12ee('0x1b')]();});}};}function handleEntityNotFound(_0x2fcb29,_0x59b82f){return function(_0x24368c){if(!_0x24368c){_0x2fcb29[_0x12ee('0x19')](0x194);}return _0x24368c;};}function handleError(_0x2f80eb,_0x33a7a6){_0x33a7a6=_0x33a7a6||0x1f4;return function(_0x2593ef){logger[_0x12ee('0x2b')](_0x2593ef['stack']);if(_0x2593ef['name']){delete _0x2593ef[_0x12ee('0x2c')];}_0x2f80eb[_0x12ee('0x1a')](_0x33a7a6)[_0x12ee('0x2d')](_0x2593ef);};}exports[_0x12ee('0x2e')]=function(_0x245ea9,_0x30597b){var _0xb6e6e={},_0x26607f={},_0x1cba83={'count':0x0,'rows':[]};var _0x24e50a=_[_0x12ee('0x2f')](db[_0x12ee('0x30')][_0x12ee('0x31')],function(_0x2baf82){return{'name':_0x2baf82[_0x12ee('0x32')],'type':_0x2baf82['type']['key']};});_0x26607f['model']=_[_0x12ee('0x2f')](_0x24e50a,_0x12ee('0x2c'));_0x26607f['query']=_['keys'](_0x245ea9[_0x12ee('0x33')]);_0x26607f[_0x12ee('0x34')]=_['intersection'](_0x26607f['model'],_0x26607f[_0x12ee('0x33')]);_0xb6e6e[_0x12ee('0x35')]=_['intersection'](_0x26607f['model'],qs['fields'](_0x245ea9[_0x12ee('0x33')][_0x12ee('0x36')]));_0xb6e6e[_0x12ee('0x35')]=_0xb6e6e[_0x12ee('0x35')][_0x12ee('0x37')]?_0xb6e6e['attributes']:_0x26607f['model'];if(!_0x245ea9[_0x12ee('0x33')][_0x12ee('0x38')](_0x12ee('0x39'))){_0xb6e6e[_0x12ee('0x20')]=qs[_0x12ee('0x20')](_0x245ea9[_0x12ee('0x33')][_0x12ee('0x20')]);_0xb6e6e[_0x12ee('0x1d')]=qs['offset'](_0x245ea9['query'][_0x12ee('0x1d')]);}_0xb6e6e['order']=qs['sort'](_0x245ea9[_0x12ee('0x33')]['sort']);_0xb6e6e[_0x12ee('0x3a')]=qs[_0x12ee('0x34')](_[_0x12ee('0x3b')](_0x245ea9['query'],_0x26607f[_0x12ee('0x34')]),_0x24e50a);if(_0x245ea9[_0x12ee('0x33')][_0x12ee('0x3c')]){_0xb6e6e[_0x12ee('0x3a')]=_[_0x12ee('0x3d')](_0xb6e6e[_0x12ee('0x3a')],{'$or':_[_0x12ee('0x2f')](_0x24e50a,function(_0x51bb88){if(_0x51bb88[_0x12ee('0x3e')]!==_0x12ee('0x3f')){var _0x514a85={};_0x514a85[_0x51bb88[_0x12ee('0x2c')]]={'$like':'%'+_0x245ea9[_0x12ee('0x33')]['filter']+'%'};return _0x514a85;}})});}_0xb6e6e=_[_0x12ee('0x3d')]({},_0xb6e6e,_0x245ea9[_0x12ee('0x40')]);var _0x9a0c97={'where':_0xb6e6e[_0x12ee('0x3a')]};return db[_0x12ee('0x30')]['count'](_0x9a0c97)[_0x12ee('0x27')](function(_0x523056){_0x1cba83['count']=_0x523056;if(_0x245ea9['query'][_0x12ee('0x41')]){_0xb6e6e[_0x12ee('0x42')]=[{'all':!![]}];}return db[_0x12ee('0x30')][_0x12ee('0x43')](_0xb6e6e);})['then'](function(_0x891018){_0x1cba83[_0x12ee('0x44')]=_0x891018;return _0x1cba83;})[_0x12ee('0x27')](respondWithFilteredResult(_0x30597b,_0xb6e6e))['catch'](handleError(_0x30597b,null));};exports[_0x12ee('0x45')]=function(_0xd99a07,_0x9da518){var _0x30d70d={'raw':![],'where':{'id':_0xd99a07['params']['id']}},_0x1df4c2={};_0x1df4c2[_0x12ee('0x46')]=_[_0x12ee('0x47')](db['Schedule'][_0x12ee('0x31')]);_0x1df4c2[_0x12ee('0x33')]=_[_0x12ee('0x47')](_0xd99a07[_0x12ee('0x33')]);_0x1df4c2[_0x12ee('0x34')]=_['intersection'](_0x1df4c2['model'],_0x1df4c2['query']);_0x30d70d[_0x12ee('0x35')]=_['intersection'](_0x1df4c2[_0x12ee('0x46')],qs['fields'](_0xd99a07[_0x12ee('0x33')][_0x12ee('0x36')]));_0x30d70d['attributes']=_0x30d70d['attributes'][_0x12ee('0x37')]?_0x30d70d[_0x12ee('0x35')]:_0x1df4c2[_0x12ee('0x46')];if(_0xd99a07[_0x12ee('0x33')][_0x12ee('0x41')]){_0x30d70d['include']=[{'all':!![]}];}_0x30d70d=_['merge']({},_0x30d70d,_0xd99a07[_0x12ee('0x40')]);return db['Schedule'][_0x12ee('0x48')](_0x30d70d)['then'](handleEntityNotFound(_0x9da518,null))[_0x12ee('0x27')](respondWithResult(_0x9da518,null))[_0x12ee('0x49')](handleError(_0x9da518,null));};exports[_0x12ee('0x4a')]=function(_0x50cc6d,_0x289caa){return db['Schedule'][_0x12ee('0x4a')](_0x50cc6d[_0x12ee('0x4b')],{})[_0x12ee('0x27')](function(_0x547ca5){var _0x5a45c9=_0x50cc6d[_0x12ee('0x4c')][_0x12ee('0x28')]({'plain':!![]});if(!_0x5a45c9)throw new Error(_0x12ee('0x4d'));if(_0x5a45c9[_0x12ee('0x4e')]===_0x12ee('0x4c')){var _0xe899aa=_0x547ca5[_0x12ee('0x28')]({'plain':!![]});var _0x24a086=_0x12ee('0x29');return db['UserProfileSection'][_0x12ee('0x48')]({'where':{'name':_0x24a086,'userProfileId':_0x5a45c9[_0x12ee('0x4f')]},'raw':!![]})[_0x12ee('0x27')](function(_0x3f7b14){if(_0x3f7b14&&_0x3f7b14[_0x12ee('0x50')]===0x0){return db[_0x12ee('0x51')][_0x12ee('0x4a')]({'name':_0xe899aa['name'],'resourceId':_0xe899aa['id'],'type':_0x3f7b14[_0x12ee('0x2c')],'sectionId':_0x3f7b14['id']},{})['then'](function(){return _0x547ca5;});}else{return _0x547ca5;}})[_0x12ee('0x49')](function(_0x594417){logger[_0x12ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x594417);throw _0x594417;});}return _0x547ca5;})['then'](respondWithResult(_0x289caa,0xc9))[_0x12ee('0x49')](handleError(_0x289caa,null));};exports[_0x12ee('0x26')]=function(_0x35e6e2,_0xbf9894){if(_0x35e6e2['body']['id']){delete _0x35e6e2[_0x12ee('0x4b')]['id'];}return db[_0x12ee('0x30')][_0x12ee('0x48')]({'where':{'id':_0x35e6e2[_0x12ee('0x52')]['id']}})[_0x12ee('0x27')](handleEntityNotFound(_0xbf9894,null))['then'](saveUpdates(_0x35e6e2['body'],null))['then'](respondWithResult(_0xbf9894,null))[_0x12ee('0x49')](handleError(_0xbf9894,null));};exports[_0x12ee('0x2a')]=function(_0x4bb372,_0x3b490c){return db[_0x12ee('0x30')]['find']({'where':{'id':_0x4bb372[_0x12ee('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b490c,null))[_0x12ee('0x27')](removeEntity(_0x3b490c,null))[_0x12ee('0x49')](handleError(_0x3b490c,null));};exports[_0x12ee('0x53')]=function(_0x1e368b,_0x97c118,_0x559185){var _0x4f9b32=require(_0x12ee('0x54'));return db[_0x12ee('0x30')][_0x12ee('0x48')]({'where':{'id':_0x1e368b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x97c118,null))[_0x12ee('0x27')](function(){_0x4f9b32['run'](_0x1e368b['params']['id']);})[_0x12ee('0x27')](respondWithStatusCode(_0x97c118,null))[_0x12ee('0x49')](handleError(_0x97c118,null));}; \ No newline at end of file +var _0x122f=['count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','error','name','send','Schedule','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','json','offset','undefined'];(function(_0x19a028,_0x161bbc){var _0x2822b0=function(_0x3596e6){while(--_0x3596e6){_0x19a028['push'](_0x19a028['shift']());}};_0x2822b0(++_0x161bbc);}(_0x122f,0x88));var _0xf122=function(_0x20e525,_0x5bcca5){_0x20e525=_0x20e525-0x0;var _0xf6ebcb=_0x122f[_0x20e525];return _0xf6ebcb;};'use strict';var emlformat=require(_0xf122('0x0'));var rimraf=require(_0xf122('0x1'));var zipdir=require(_0xf122('0x2'));var jsonpatch=require(_0xf122('0x3'));var rp=require('request-promise');var moment=require(_0xf122('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf122('0x5'));var util=require('util');var path=require(_0xf122('0x6'));var sox=require(_0xf122('0x7'));var csv=require(_0xf122('0x8'));var ejs=require(_0xf122('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf122('0xa'));var crypto=require(_0xf122('0xb'));var jsforce=require(_0xf122('0xc'));var deskjs=require(_0xf122('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf122('0xe'));var Papa=require(_0xf122('0xf'));var Redis=require('ioredis');var authService=require(_0xf122('0x10'));var qs=require(_0xf122('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf122('0x12'));var logger=require(_0xf122('0x13'))(_0xf122('0x14'));var utils=require(_0xf122('0x15'));var config=require(_0xf122('0x16'));var licenseUtil=require(_0xf122('0x17'));var db=require(_0xf122('0x18'))['db'];function respondWithStatusCode(_0x23add6,_0x3e5501){_0x3e5501=_0x3e5501||0xcc;return function(_0x36ad80){if(_0x36ad80){return _0x23add6[_0xf122('0x19')](_0x3e5501);}return _0x23add6[_0xf122('0x1a')](_0x3e5501)['end']();};}function respondWithResult(_0x1f1e49,_0x200c9a){_0x200c9a=_0x200c9a||0xc8;return function(_0x414cbc){if(_0x414cbc){return _0x1f1e49[_0xf122('0x1a')](_0x200c9a)[_0xf122('0x1b')](_0x414cbc);}};}function respondWithFilteredResult(_0x5f6845,_0x46bea2){return function(_0x5a3e7f){if(_0x5a3e7f){var _0x5a0613=typeof _0x46bea2[_0xf122('0x1c')]===_0xf122('0x1d')&&typeof _0x46bea2['limit']==='undefined';var _0x2be4e7=_0x5a3e7f[_0xf122('0x1e')];var _0x264d1b=_0x5a0613?0x0:_0x46bea2[_0xf122('0x1c')];var _0xcba1f4=_0x5a0613?_0x5a3e7f[_0xf122('0x1e')]:_0x46bea2[_0xf122('0x1c')]+_0x46bea2[_0xf122('0x1f')];var _0x154138;if(_0xcba1f4>=_0x2be4e7){_0xcba1f4=_0x2be4e7;_0x154138=0xc8;}else{_0x154138=0xce;}_0x5f6845[_0xf122('0x1a')](_0x154138);return _0x5f6845[_0xf122('0x20')](_0xf122('0x21'),_0x264d1b+'-'+_0xcba1f4+'/'+_0x2be4e7)[_0xf122('0x1b')](_0x5a3e7f);}return null;};}function patchUpdates(_0x32d616){return function(_0xf2ede){try{jsonpatch[_0xf122('0x22')](_0xf2ede,_0x32d616,!![]);}catch(_0x56f3e8){return BPromise[_0xf122('0x23')](_0x56f3e8);}return _0xf2ede[_0xf122('0x24')]();};}function saveUpdates(_0x4a88a,_0x26618e){return function(_0x1d7f0d){if(_0x1d7f0d){return _0x1d7f0d[_0xf122('0x25')](_0x4a88a)[_0xf122('0x26')](function(_0x4f8fca){return _0x4f8fca;});}return null;};}function removeEntity(_0x1e9e0c,_0x205c5d){return function(_0x42dfb2){if(_0x42dfb2){return _0x42dfb2[_0xf122('0x27')]()[_0xf122('0x26')](function(){var _0x29bf2b=_0x42dfb2[_0xf122('0x28')]({'plain':!![]});var _0x5c3be8=_0xf122('0x29');return db['UserProfileResource'][_0xf122('0x27')]({'where':{'type':_0x5c3be8,'resourceId':_0x29bf2b['id']}})['then'](function(){return _0x42dfb2;});})[_0xf122('0x26')](function(){_0x1e9e0c[_0xf122('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x154473,_0x5d6cb6){return function(_0x5c8f9b){if(!_0x5c8f9b){_0x154473[_0xf122('0x19')](0x194);}return _0x5c8f9b;};}function handleError(_0x4972db,_0x4f13c9){_0x4f13c9=_0x4f13c9||0x1f4;return function(_0x5e1fa5){logger[_0xf122('0x2a')](_0x5e1fa5['stack']);if(_0x5e1fa5['name']){delete _0x5e1fa5[_0xf122('0x2b')];}_0x4972db['status'](_0x4f13c9)[_0xf122('0x2c')](_0x5e1fa5);};}exports['index']=function(_0x5a2728,_0x226116){var _0x470204={},_0x4cc457={},_0x344c9e={'count':0x0,'rows':[]};var _0x1610f8=_['map'](db[_0xf122('0x2d')]['rawAttributes'],function(_0x1f1e13){return{'name':_0x1f1e13[_0xf122('0x2e')],'type':_0x1f1e13[_0xf122('0x2f')][_0xf122('0x30')]};});_0x4cc457[_0xf122('0x31')]=_['map'](_0x1610f8,_0xf122('0x2b'));_0x4cc457[_0xf122('0x32')]=_[_0xf122('0x33')](_0x5a2728[_0xf122('0x32')]);_0x4cc457['filters']=_['intersection'](_0x4cc457[_0xf122('0x31')],_0x4cc457['query']);_0x470204[_0xf122('0x34')]=_[_0xf122('0x35')](_0x4cc457[_0xf122('0x31')],qs['fields'](_0x5a2728[_0xf122('0x32')][_0xf122('0x36')]));_0x470204[_0xf122('0x34')]=_0x470204[_0xf122('0x34')]['length']?_0x470204[_0xf122('0x34')]:_0x4cc457['model'];if(!_0x5a2728[_0xf122('0x32')]['hasOwnProperty'](_0xf122('0x37'))){_0x470204['limit']=qs[_0xf122('0x1f')](_0x5a2728[_0xf122('0x32')][_0xf122('0x1f')]);_0x470204[_0xf122('0x1c')]=qs[_0xf122('0x1c')](_0x5a2728[_0xf122('0x32')][_0xf122('0x1c')]);}_0x470204[_0xf122('0x38')]=qs[_0xf122('0x39')](_0x5a2728[_0xf122('0x32')]['sort']);_0x470204[_0xf122('0x3a')]=qs[_0xf122('0x3b')](_['pick'](_0x5a2728[_0xf122('0x32')],_0x4cc457[_0xf122('0x3b')]),_0x1610f8);if(_0x5a2728[_0xf122('0x32')][_0xf122('0x3c')]){_0x470204[_0xf122('0x3a')]=_[_0xf122('0x3d')](_0x470204[_0xf122('0x3a')],{'$or':_[_0xf122('0x3e')](_0x1610f8,function(_0x3c3a38){if(_0x3c3a38[_0xf122('0x2f')]!==_0xf122('0x3f')){var _0x29274f={};_0x29274f[_0x3c3a38[_0xf122('0x2b')]]={'$like':'%'+_0x5a2728['query'][_0xf122('0x3c')]+'%'};return _0x29274f;}})});}_0x470204=_[_0xf122('0x3d')]({},_0x470204,_0x5a2728['options']);var _0x400a1c={'where':_0x470204[_0xf122('0x3a')]};return db[_0xf122('0x2d')][_0xf122('0x1e')](_0x400a1c)['then'](function(_0x30e065){_0x344c9e['count']=_0x30e065;if(_0x5a2728[_0xf122('0x32')][_0xf122('0x40')]){_0x470204[_0xf122('0x41')]=[{'all':!![]}];}return db[_0xf122('0x2d')][_0xf122('0x42')](_0x470204);})[_0xf122('0x26')](function(_0xdcb3b9){_0x344c9e[_0xf122('0x43')]=_0xdcb3b9;return _0x344c9e;})[_0xf122('0x26')](respondWithFilteredResult(_0x226116,_0x470204))[_0xf122('0x44')](handleError(_0x226116,null));};exports[_0xf122('0x45')]=function(_0x67c0cc,_0x10d809){var _0x3e1e44={'raw':![],'where':{'id':_0x67c0cc[_0xf122('0x46')]['id']}},_0x498618={};_0x498618[_0xf122('0x31')]=_[_0xf122('0x33')](db[_0xf122('0x2d')]['rawAttributes']);_0x498618[_0xf122('0x32')]=_[_0xf122('0x33')](_0x67c0cc[_0xf122('0x32')]);_0x498618[_0xf122('0x3b')]=_['intersection'](_0x498618[_0xf122('0x31')],_0x498618[_0xf122('0x32')]);_0x3e1e44[_0xf122('0x34')]=_[_0xf122('0x35')](_0x498618[_0xf122('0x31')],qs[_0xf122('0x36')](_0x67c0cc['query']['fields']));_0x3e1e44['attributes']=_0x3e1e44[_0xf122('0x34')][_0xf122('0x47')]?_0x3e1e44[_0xf122('0x34')]:_0x498618['model'];if(_0x67c0cc[_0xf122('0x32')][_0xf122('0x40')]){_0x3e1e44['include']=[{'all':!![]}];}_0x3e1e44=_[_0xf122('0x3d')]({},_0x3e1e44,_0x67c0cc[_0xf122('0x48')]);return db[_0xf122('0x2d')][_0xf122('0x49')](_0x3e1e44)[_0xf122('0x26')](handleEntityNotFound(_0x10d809,null))[_0xf122('0x26')](respondWithResult(_0x10d809,null))[_0xf122('0x44')](handleError(_0x10d809,null));};exports['create']=function(_0x3f7549,_0x3174cc){return db[_0xf122('0x2d')][_0xf122('0x4a')](_0x3f7549[_0xf122('0x4b')],{})[_0xf122('0x26')](function(_0xe40bb1){var _0x18cb57=_0x3f7549[_0xf122('0x4c')]['get']({'plain':!![]});if(!_0x18cb57)throw new Error(_0xf122('0x4d'));if(_0x18cb57[_0xf122('0x4e')]===_0xf122('0x4c')){var _0x457f22=_0xe40bb1['get']({'plain':!![]});var _0x22e80f=_0xf122('0x29');return db[_0xf122('0x4f')][_0xf122('0x49')]({'where':{'name':_0x22e80f,'userProfileId':_0x18cb57[_0xf122('0x50')]},'raw':!![]})[_0xf122('0x26')](function(_0x1e5e50){if(_0x1e5e50&&_0x1e5e50['autoAssociation']===0x0){return db[_0xf122('0x51')][_0xf122('0x4a')]({'name':_0x457f22[_0xf122('0x2b')],'resourceId':_0x457f22['id'],'type':_0x1e5e50[_0xf122('0x2b')],'sectionId':_0x1e5e50['id']},{})[_0xf122('0x26')](function(){return _0xe40bb1;});}else{return _0xe40bb1;}})[_0xf122('0x44')](function(_0x4586e8){logger['error'](_0xf122('0x52'),_0x4586e8);throw _0x4586e8;});}return _0xe40bb1;})[_0xf122('0x26')](respondWithResult(_0x3174cc,0xc9))[_0xf122('0x44')](handleError(_0x3174cc,null));};exports[_0xf122('0x25')]=function(_0x92fdf5,_0x13fc87){if(_0x92fdf5[_0xf122('0x4b')]['id']){delete _0x92fdf5['body']['id'];}return db[_0xf122('0x2d')][_0xf122('0x49')]({'where':{'id':_0x92fdf5[_0xf122('0x46')]['id']}})[_0xf122('0x26')](handleEntityNotFound(_0x13fc87,null))['then'](saveUpdates(_0x92fdf5[_0xf122('0x4b')],null))[_0xf122('0x26')](respondWithResult(_0x13fc87,null))[_0xf122('0x44')](handleError(_0x13fc87,null));};exports[_0xf122('0x27')]=function(_0x586a20,_0x37e7bb){return db[_0xf122('0x2d')][_0xf122('0x49')]({'where':{'id':_0x586a20[_0xf122('0x46')]['id']}})[_0xf122('0x26')](handleEntityNotFound(_0x37e7bb,null))[_0xf122('0x26')](removeEntity(_0x37e7bb,null))[_0xf122('0x44')](handleError(_0x37e7bb,null));};exports['run']=function(_0x3d0151,_0x4da95c,_0x8da9c3){var _0x1c87fc=require('../../config/schedule');return db[_0xf122('0x2d')][_0xf122('0x49')]({'where':{'id':_0x3d0151[_0xf122('0x46')]['id']},'raw':!![]})[_0xf122('0x26')](handleEntityNotFound(_0x4da95c,null))[_0xf122('0x26')](function(){_0x1c87fc['run'](_0x3d0151[_0xf122('0x46')]['id']);})[_0xf122('0x26')](respondWithStatusCode(_0x4da95c,null))[_0xf122('0x44')](handleError(_0x4da95c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 4869be0..a7ed893 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 _0xa394=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x432376,_0x4e4325){var _0x535945=function(_0x3cef1d){while(--_0x3cef1d){_0x432376['push'](_0x432376['shift']());}};_0x535945(++_0x4e4325);}(_0xa394,0xdd));var _0x4a39=function(_0x1de6e8,_0x2df922){_0x1de6e8=_0x1de6e8-0x0;var _0x471740=_0xa394[_0x1de6e8];return _0x471740;};'use strict';var _=require(_0x4a39('0x0'));var util=require(_0x4a39('0x1'));var logger=require(_0x4a39('0x2'))(_0x4a39('0x3'));var moment=require(_0x4a39('0x4'));var BPromise=require(_0x4a39('0x5'));var rp=require(_0x4a39('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a39('0x7'));var config=require(_0x4a39('0x8'));var attributes=require(_0x4a39('0x9'));module[_0x4a39('0xa')]=function(_0x1f59f5,_0x5587e1){return _0x1f59f5[_0x4a39('0xb')](_0x4a39('0xc'),attributes,{'tableName':_0x4a39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb98d=['api','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','tools_schedules','lodash','util'];(function(_0x2383f7,_0x53e3ca){var _0x1432c6=function(_0x123766){while(--_0x123766){_0x2383f7['push'](_0x2383f7['shift']());}};_0x1432c6(++_0x53e3ca);}(_0xb98d,0xe5));var _0xdb98=function(_0x4e192c,_0xe18f66){_0x4e192c=_0x4e192c-0x0;var _0x4f3a86=_0xb98d[_0x4e192c];return _0x4f3a86;};'use strict';var _=require(_0xdb98('0x0'));var util=require(_0xdb98('0x1'));var logger=require('../../config/logger')(_0xdb98('0x2'));var moment=require('moment');var BPromise=require(_0xdb98('0x3'));var rp=require(_0xdb98('0x4'));var fs=require('fs');var path=require(_0xdb98('0x5'));var rimraf=require(_0xdb98('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb98('0x7'));module[_0xdb98('0x8')]=function(_0x36890f,_0x438d54){return _0x36890f[_0xdb98('0x9')]('Schedule',attributes,{'tableName':_0xdb98('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 e023cbc..82c84a0 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 _0xf242=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0xd794a0,_0x54b8ad){var _0x3f7967=function(_0x441b6f){while(--_0x441b6f){_0xd794a0['push'](_0xd794a0['shift']());}};_0x3f7967(++_0x54b8ad);}(_0xf242,0x178));var _0x2f24=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xf242[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x2f24('0x0'));var util=require(_0x2f24('0x1'));var moment=require('moment');var BPromise=require(_0x2f24('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f24('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f24('0x4'));var logger=require('../../config/logger')(_0x2f24('0x5'));var config=require(_0x2f24('0x6'));var jayson=require(_0x2f24('0x7'));var client=jayson['client'][_0x2f24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10c818,_0x198f8c,_0x3a4a78){return new BPromise(function(_0x2e68ca,_0x422705){return client[_0x2f24('0x9')](_0x10c818,_0x3a4a78)[_0x2f24('0xa')](function(_0x644220){logger[_0x2f24('0xb')](_0x2f24('0xc'),_0x198f8c,_0x2f24('0xd'));logger[_0x2f24('0xe')](_0x2f24('0xf'),_0x198f8c,_0x2f24('0xd'),JSON[_0x2f24('0x10')](_0x644220));if(_0x644220[_0x2f24('0x11')]){if(_0x644220[_0x2f24('0x11')][_0x2f24('0x12')]===0x1f4){logger[_0x2f24('0x11')]('Schedule,\x20%s,\x20%s',_0x198f8c,_0x644220[_0x2f24('0x11')]['message']);return _0x422705(_0x644220[_0x2f24('0x11')]['message']);}logger[_0x2f24('0x11')](_0x2f24('0xc'),_0x198f8c,_0x644220[_0x2f24('0x11')]['message']);return _0x2e68ca(_0x644220[_0x2f24('0x11')][_0x2f24('0x13')]);}else{logger['info'](_0x2f24('0xc'),_0x198f8c,'request\x20sent');_0x2e68ca(_0x644220[_0x2f24('0x14')][_0x2f24('0x13')]);}})['catch'](function(_0x3287d8){logger[_0x2f24('0x11')]('Schedule,\x20%s,\x20%s',_0x198f8c,_0x3287d8);_0x422705(_0x3287d8);});});} \ No newline at end of file +var _0x46b7=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x29976,_0x35de12){var _0x5cd575=function(_0x5cfc4f){while(--_0x5cfc4f){_0x29976['push'](_0x29976['shift']());}};_0x5cd575(++_0x35de12);}(_0x46b7,0x16b));var _0x746b=function(_0x21f2e8,_0x3c5d90){_0x21f2e8=_0x21f2e8-0x0;var _0x14b228=_0x46b7[_0x21f2e8];return _0x14b228;};'use strict';var _=require(_0x746b('0x0'));var util=require(_0x746b('0x1'));var moment=require(_0x746b('0x2'));var BPromise=require(_0x746b('0x3'));var rs=require(_0x746b('0x4'));var fs=require('fs');var Redis=require(_0x746b('0x5'));var db=require(_0x746b('0x6'))['db'];var utils=require(_0x746b('0x7'));var logger=require(_0x746b('0x8'))(_0x746b('0x9'));var config=require(_0x746b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x746b('0xb')][_0x746b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dabd4,_0x32c5c5,_0x667186){return new BPromise(function(_0x1b7288,_0x23377c){return client[_0x746b('0xd')](_0x3dabd4,_0x667186)[_0x746b('0xe')](function(_0x5edcfe){logger[_0x746b('0xf')](_0x746b('0x10'),_0x32c5c5,'request\x20sent');logger[_0x746b('0x11')]('Schedule,\x20%s,\x20%s,\x20%s',_0x32c5c5,_0x746b('0x12'),JSON['stringify'](_0x5edcfe));if(_0x5edcfe[_0x746b('0x13')]){if(_0x5edcfe[_0x746b('0x13')][_0x746b('0x14')]===0x1f4){logger[_0x746b('0x13')]('Schedule,\x20%s,\x20%s',_0x32c5c5,_0x5edcfe[_0x746b('0x13')][_0x746b('0x15')]);return _0x23377c(_0x5edcfe[_0x746b('0x13')][_0x746b('0x15')]);}logger[_0x746b('0x13')](_0x746b('0x10'),_0x32c5c5,_0x5edcfe['error'][_0x746b('0x15')]);return _0x1b7288(_0x5edcfe[_0x746b('0x13')][_0x746b('0x15')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x32c5c5,_0x746b('0x12'));_0x1b7288(_0x5edcfe[_0x746b('0x16')]['message']);}})[_0x746b('0x17')](function(_0xeade8b){logger[_0x746b('0x13')](_0x746b('0x10'),_0x32c5c5,_0xeade8b);_0x23377c(_0xeade8b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 51d3dc2..5421250 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 _0xac11=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x221637,_0x42a5e0){var _0x11bf9e=function(_0xbc416e){while(--_0xbc416e){_0x221637['push'](_0x221637['shift']());}};_0x11bf9e(++_0x42a5e0);}(_0xac11,0x14f));var _0x1ac1=function(_0xe97dd5,_0x5af602){_0xe97dd5=_0xe97dd5-0x0;var _0x5ec6ca=_0xac11[_0xe97dd5];return _0x5ec6ca;};'use strict';var multer=require(_0x1ac1('0x0'));var util=require(_0x1ac1('0x1'));var path=require(_0x1ac1('0x2'));var timeout=require(_0x1ac1('0x3'));var express=require(_0x1ac1('0x4'));var router=express['Router']();var fs_extra=require(_0x1ac1('0x5'));var auth=require(_0x1ac1('0x6'));var interaction=require(_0x1ac1('0x7'));var config=require(_0x1ac1('0x8'));var controller=require(_0x1ac1('0x9'));router[_0x1ac1('0xa')]('/',auth[_0x1ac1('0xb')](),controller[_0x1ac1('0xc')]);router[_0x1ac1('0xa')](_0x1ac1('0xd'),auth[_0x1ac1('0xb')](),controller[_0x1ac1('0xe')]);router['get'](_0x1ac1('0xf'),auth[_0x1ac1('0xb')](),controller[_0x1ac1('0x10')]);router['get'](_0x1ac1('0x11'),auth[_0x1ac1('0xb')](),controller[_0x1ac1('0x12')]);router[_0x1ac1('0x13')]('/',auth[_0x1ac1('0xb')](),controller[_0x1ac1('0x14')]);router[_0x1ac1('0x15')](_0x1ac1('0xf'),auth['isAuthenticated'](),controller[_0x1ac1('0x16')]);router[_0x1ac1('0x17')](_0x1ac1('0xf'),auth['isAuthenticated'](),controller[_0x1ac1('0x18')]);module[_0x1ac1('0x19')]=router; \ No newline at end of file +var _0x1e77=['/:id','show','/:id/download','download','post','create','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4f47a6,_0x49eed0){var _0x8cc885=function(_0x2d3f94){while(--_0x2d3f94){_0x4f47a6['push'](_0x4f47a6['shift']());}};_0x8cc885(++_0x49eed0);}(_0x1e77,0x15c));var _0x71e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e77[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x71e7('0x0'));var path=require(_0x71e7('0x1'));var timeout=require(_0x71e7('0x2'));var express=require('express');var router=express[_0x71e7('0x3')]();var fs_extra=require(_0x71e7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x71e7('0x5'));var controller=require(_0x71e7('0x6'));router[_0x71e7('0x7')]('/',auth[_0x71e7('0x8')](),controller[_0x71e7('0x9')]);router[_0x71e7('0x7')](_0x71e7('0xa'),auth['isAuthenticated'](),controller[_0x71e7('0xb')]);router[_0x71e7('0x7')](_0x71e7('0xc'),auth[_0x71e7('0x8')](),controller[_0x71e7('0xd')]);router[_0x71e7('0x7')](_0x71e7('0xe'),auth['isAuthenticated'](),controller[_0x71e7('0xf')]);router[_0x71e7('0x10')]('/',auth['isAuthenticated'](),controller[_0x71e7('0x11')]);router['put'](_0x71e7('0xc'),auth[_0x71e7('0x8')](),controller['update']);router['delete'](_0x71e7('0xc'),auth['isAuthenticated'](),controller[_0x71e7('0x12')]);module[_0x71e7('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 3b04be6..9036970 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 _0xdacc=['getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','createdAt','toString','updatedAt','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x1d4c1d,_0x5216a7){var _0x525869=function(_0x1e18ac){while(--_0x1e18ac){_0x1d4c1d['push'](_0x1d4c1d['shift']());}};_0x525869(++_0x5216a7);}(_0xdacc,0x14f));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcdac('0x0'));var path=require(_0xcdac('0x1'));var config=require(_0xcdac('0x2'));module[_0xcdac('0x3')]={'format':{'type':Sequelize[_0xcdac('0x4')],'get':function(){return this[_0xcdac('0x5')](_0xcdac('0x6'))?path['extname'](this[_0xcdac('0x5')](_0xcdac('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xcdac('0x7')]},'channel':{'type':Sequelize[_0xcdac('0x7')]},'value':{'type':Sequelize[_0xcdac('0x7')],'set':function(_0x2a10a1){var _0x20a66e=_0x2a10a1[_0xcdac('0x8')](/\\/g,'/');this[_0xcdac('0x9')](_0xcdac('0x6'),_0x20a66e);}},'rating':{'type':Sequelize[_0xcdac('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xcdac('0xa')],'set':function(_0x33c4af){this[_0xcdac('0x9')](_0xcdac('0xb'),moment()[_0xcdac('0xc')](_0x33c4af,'ms'));this['setDataValue'](_0xcdac('0xd'),moment());this[_0xcdac('0x9')]('duration',_0x33c4af);}},'startedAt':{'type':Sequelize[_0xcdac('0xe')],'get':function(){return moment(this[_0xcdac('0x5')](_0xcdac('0xb')))[_0xcdac('0xf')](_0xcdac('0x10'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcdac('0x5')]('closedAt'))[_0xcdac('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0xcdac('0xe')],'get':function(){return moment(this[_0xcdac('0x5')](_0xcdac('0x11')))[_0xcdac('0xf')](_0xcdac('0x10'))[_0xcdac('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcdac('0x5')](_0xcdac('0x13')))['format'](_0xcdac('0x10'))[_0xcdac('0x12')]();}}}; \ No newline at end of file +var _0xd237=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL'];(function(_0x26c0a5,_0x50755f){var _0x491dfc=function(_0x236ed8){while(--_0x236ed8){_0x26c0a5['push'](_0x26c0a5['shift']());}};_0x491dfc(++_0x50755f);}(_0xd237,0x14f));var _0x7d23=function(_0x1f2b4f,_0x15fc6e){_0x1f2b4f=_0x1f2b4f-0x0;var _0x1cb58e=_0xd237[_0x1f2b4f];return _0x1cb58e;};'use strict';var Sequelize=require(_0x7d23('0x0'));var moment=require(_0x7d23('0x1'));var path=require(_0x7d23('0x2'));var config=require(_0x7d23('0x3'));module['exports']={'format':{'type':Sequelize[_0x7d23('0x4')],'get':function(){return this[_0x7d23('0x5')](_0x7d23('0x6'))?path[_0x7d23('0x7')](this[_0x7d23('0x5')](_0x7d23('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7d23('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x5ca126){var _0x48358f=_0x5ca126[_0x7d23('0x9')](/\\/g,'/');this[_0x7d23('0xa')](_0x7d23('0x6'),_0x48358f);}},'rating':{'type':Sequelize[_0x7d23('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7d23('0xb')],'set':function(_0x23f1d6){this[_0x7d23('0xa')](_0x7d23('0xc'),moment()['subtract'](_0x23f1d6,'ms'));this[_0x7d23('0xa')](_0x7d23('0xd'),moment());this[_0x7d23('0xa')]('duration',_0x23f1d6);}},'startedAt':{'type':Sequelize[_0x7d23('0xe')],'get':function(){return moment(this['getDataValue'](_0x7d23('0xc')))[_0x7d23('0xf')](_0x7d23('0x10'))[_0x7d23('0x11')]();}},'closedAt':{'type':Sequelize[_0x7d23('0xe')],'get':function(){return moment(this[_0x7d23('0x5')](_0x7d23('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x7d23('0x11')]();}},'createdAt':{'type':Sequelize[_0x7d23('0xe')],'get':function(){return moment(this[_0x7d23('0x5')](_0x7d23('0x12')))['format'](_0x7d23('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0x7d23('0xe')],'get':function(){return moment(this['getDataValue'](_0x7d23('0x13')))[_0x7d23('0xf')](_0x7d23('0x10'))[_0x7d23('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 222f68c..d212cce 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 _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x323f99,_0x906add){var _0x35eb59=function(_0x21162d){while(--_0x21162d){_0x323f99['push'](_0x323f99['shift']());}};_0x35eb59(++_0x906add);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file +var _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2c67f4,_0x2a5849){var _0x389610=function(_0xbaecd1){while(--_0xbaecd1){_0x2c67f4['push'](_0x2c67f4['shift']());}};_0x389610(++_0x2a5849);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1191da,_0x1f49b7){_0x1191da=_0x1191da-0x0;var _0x288acf=_0x7fbe[_0x1191da];return _0x288acf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 07157ab..9dafab4 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 _0xdf8f=['api','moment','path','rimraf','../../config/environment','screen_recordings','interactionid','util','../../config/logger'];(function(_0x3828da,_0x1f3772){var _0x5977da=function(_0xd81cea){while(--_0xd81cea){_0x3828da['push'](_0x3828da['shift']());}};_0x5977da(++_0x1f3772);}(_0xdf8f,0xa9));var _0xfdf8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf8f[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0xfdf8('0x0'));var logger=require(_0xfdf8('0x1'))(_0xfdf8('0x2'));var moment=require(_0xfdf8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdf8('0x4'));var rimraf=require(_0xfdf8('0x5'));var config=require(_0xfdf8('0x6'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x37f4b5,_0x2529e8){return _0x37f4b5['define']('ScreenRecording',attributes,{'tableName':_0xfdf8('0x7'),'paranoid':![],'indexes':[{'name':_0xfdf8('0x8'),'fields':[_0xfdf8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf462=['request-promise','path','../../config/environment','./screenRecording.attributes','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird'];(function(_0x55b79e,_0x38b5cd){var _0x213264=function(_0x69397a){while(--_0x69397a){_0x55b79e['push'](_0x55b79e['shift']());}};_0x213264(++_0x38b5cd);}(_0xf462,0x69));var _0x2f46=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0xf462[_0x4884a7];return _0x56b60e;};'use strict';var _=require('lodash');var util=require(_0x2f46('0x0'));var logger=require(_0x2f46('0x1'))(_0x2f46('0x2'));var moment=require(_0x2f46('0x3'));var BPromise=require(_0x2f46('0x4'));var rp=require(_0x2f46('0x5'));var fs=require('fs');var path=require(_0x2f46('0x6'));var rimraf=require('rimraf');var config=require(_0x2f46('0x7'));var attributes=require(_0x2f46('0x8'));module['exports']=function(_0x26da54,_0x128358){return _0x26da54['define']('ScreenRecording',attributes,{'tableName':_0x2f46('0x9'),'paranoid':![],'indexes':[{'name':_0x2f46('0xa'),'fields':[_0x2f46('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 396ee1e..6f332c1 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 _0x9ea4=['info','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','bluebird','ioredis','../../config/utils','../../config/logger','client','http','then'];(function(_0xd10b43,_0x440ec1){var _0x369090=function(_0x5ae495){while(--_0x5ae495){_0xd10b43['push'](_0xd10b43['shift']());}};_0x369090(++_0x440ec1);}(_0x9ea4,0x15d));var _0x49ea=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9ea4[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x49ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x49ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49ea('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x49ea('0x3'));var logger=require(_0x49ea('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x49ea('0x5')][_0x49ea('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x552785,_0x22bf0e,_0x48c9a8){return new BPromise(function(_0x368c34,_0x38c56a){return client['request'](_0x552785,_0x48c9a8)[_0x49ea('0x7')](function(_0x277c3f){logger[_0x49ea('0x8')]('ScreenRecording,\x20%s,\x20%s',_0x22bf0e,_0x49ea('0x9'));logger[_0x49ea('0xa')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x22bf0e,_0x49ea('0x9'),JSON[_0x49ea('0xb')](_0x277c3f));if(_0x277c3f[_0x49ea('0xc')]){if(_0x277c3f[_0x49ea('0xc')][_0x49ea('0xd')]===0x1f4){logger[_0x49ea('0xc')](_0x49ea('0xe'),_0x22bf0e,_0x277c3f['error'][_0x49ea('0xf')]);return _0x38c56a(_0x277c3f[_0x49ea('0xc')][_0x49ea('0xf')]);}logger[_0x49ea('0xc')](_0x49ea('0xe'),_0x22bf0e,_0x277c3f[_0x49ea('0xc')]['message']);return _0x368c34(_0x277c3f[_0x49ea('0xc')][_0x49ea('0xf')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x22bf0e,_0x49ea('0x9'));_0x368c34(_0x277c3f[_0x49ea('0x10')][_0x49ea('0xf')]);}})['catch'](function(_0x37e248){logger[_0x49ea('0xc')](_0x49ea('0xe'),_0x22bf0e,_0x37e248);_0x38c56a(_0x37e248);});});} \ No newline at end of file +var _0x2831=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x20a4dc,_0x2bd7c7){var _0x49000f=function(_0x2246e7){while(--_0x2246e7){_0x20a4dc['push'](_0x20a4dc['shift']());}};_0x49000f(++_0x2bd7c7);}(_0x2831,0x65));var _0x1283=function(_0x2bba73,_0x82bb5d){_0x2bba73=_0x2bba73-0x0;var _0x19870b=_0x2831[_0x2bba73];return _0x19870b;};'use strict';var _=require(_0x1283('0x0'));var util=require(_0x1283('0x1'));var moment=require(_0x1283('0x2'));var BPromise=require(_0x1283('0x3'));var rs=require(_0x1283('0x4'));var fs=require('fs');var Redis=require(_0x1283('0x5'));var db=require(_0x1283('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1283('0x7'))(_0x1283('0x8'));var config=require(_0x1283('0x9'));var jayson=require(_0x1283('0xa'));var client=jayson[_0x1283('0xb')][_0x1283('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28938b,_0x26f2ea,_0x54f800){return new BPromise(function(_0x2da36f,_0x52280f){return client[_0x1283('0xd')](_0x28938b,_0x54f800)[_0x1283('0xe')](function(_0x297215){logger[_0x1283('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x26f2ea,_0x1283('0x10'));logger[_0x1283('0x11')](_0x1283('0x12'),_0x26f2ea,_0x1283('0x10'),JSON[_0x1283('0x13')](_0x297215));if(_0x297215['error']){if(_0x297215['error'][_0x1283('0x14')]===0x1f4){logger[_0x1283('0x15')](_0x1283('0x16'),_0x26f2ea,_0x297215[_0x1283('0x15')][_0x1283('0x17')]);return _0x52280f(_0x297215[_0x1283('0x15')][_0x1283('0x17')]);}logger[_0x1283('0x15')](_0x1283('0x16'),_0x26f2ea,_0x297215[_0x1283('0x15')][_0x1283('0x17')]);return _0x2da36f(_0x297215['error'][_0x1283('0x17')]);}else{logger[_0x1283('0xf')](_0x1283('0x16'),_0x26f2ea,'request\x20sent');_0x2da36f(_0x297215[_0x1283('0x18')][_0x1283('0x17')]);}})[_0x1283('0x19')](function(_0x1da453){logger[_0x1283('0x15')](_0x1283('0x16'),_0x26f2ea,_0x1da453);_0x52280f(_0x1da453);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index cacb02b..2f578ad 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 _0x2a92=['index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','post','single','file','addLogo','format','logologin','originalname','addLogoLogin','preferred','/:id/preferred','favicon','addFavicon','put','update','exports','multer','util','path','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x354320,_0x52423d){var _0x30071a=function(_0x33b89d){while(--_0x33b89d){_0x354320['push'](_0x354320['shift']());}};_0x30071a(++_0x52423d);}(_0x2a92,0x9c));var _0x22a9=function(_0x3bac2b,_0x2de937){_0x3bac2b=_0x3bac2b-0x0;var _0xc43b6a=_0x2a92[_0x3bac2b];return _0xc43b6a;};'use strict';var multer=require(_0x22a9('0x0'));var util=require(_0x22a9('0x1'));var path=require(_0x22a9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x22a9('0x3'));var config=require(_0x22a9('0x4'));var controller=require(_0x22a9('0x5'));router[_0x22a9('0x6')]('/',auth[_0x22a9('0x7')](),controller[_0x22a9('0x8')]);router[_0x22a9('0x6')](_0x22a9('0x9'),controller[_0x22a9('0xa')]);router[_0x22a9('0x6')](_0x22a9('0xb'),controller['show']);router['get'](_0x22a9('0xc'),controller[_0x22a9('0xd')]);router[_0x22a9('0x6')](_0x22a9('0xe'),controller[_0x22a9('0xf')]);router[_0x22a9('0x6')](_0x22a9('0x10'),controller[_0x22a9('0x11')]);router[_0x22a9('0x6')]('/:id/preferred',controller[_0x22a9('0x12')]);router[_0x22a9('0x6')]('/:id/favicon',controller[_0x22a9('0x13')]);var upload=multer({'storage':multer[_0x22a9('0x14')]({'destination':function(_0xc48f5,_0x1efb78,_0x2a6c84){_0x2a6c84(null,path[_0x22a9('0x15')](config[_0x22a9('0x16')],_0x22a9('0x17')));},'filename':function(_0xc3edb,_0x2f9243,_0x25df46){_0x25df46(null,util['format'](_0x22a9('0x18'),'logo',path[_0x22a9('0x19')](_0x2f9243['originalname'])));}})});router[_0x22a9('0x1a')](_0x22a9('0xc'),upload[_0x22a9('0x1b')](_0x22a9('0x1c')),controller[_0x22a9('0x1d')]);var upload=multer({'storage':multer[_0x22a9('0x14')]({'destination':function(_0x18710b,_0x21ee93,_0x214d07){_0x214d07(null,path[_0x22a9('0x15')](config[_0x22a9('0x16')],_0x22a9('0x17')));},'filename':function(_0x13c66e,_0x987469,_0x554c3e){_0x554c3e(null,util[_0x22a9('0x1e')](_0x22a9('0x18'),_0x22a9('0x1f'),path['extname'](_0x987469[_0x22a9('0x20')])));}})});router[_0x22a9('0x1a')]('/:id/logo_login',upload[_0x22a9('0x1b')](_0x22a9('0x1c')),controller[_0x22a9('0x21')]);var upload=multer({'storage':multer[_0x22a9('0x14')]({'destination':function(_0x40936e,_0x4caf22,_0x282fac){_0x282fac(null,path[_0x22a9('0x15')](config['root'],_0x22a9('0x17')));},'filename':function(_0x5138e8,_0xb019e0,_0x146e21){_0x146e21(null,util['format']('%s%s',_0x22a9('0x22'),path[_0x22a9('0x19')](_0xb019e0['originalname'])));}})});router[_0x22a9('0x1a')](_0x22a9('0x23'),upload['single'](_0x22a9('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer[_0x22a9('0x14')]({'destination':function(_0x5296a0,_0xd07821,_0x414040){_0x414040(null,path[_0x22a9('0x15')](config[_0x22a9('0x16')],_0x22a9('0x17')));},'filename':function(_0xa5baa7,_0xbc4f60,_0x270f15){_0x270f15(null,util[_0x22a9('0x1e')](_0x22a9('0x18'),_0x22a9('0x24'),path[_0x22a9('0x19')](_0xbc4f60['originalname'])));}})});router[_0x22a9('0x1a')]('/:id/favicon',upload['single']('file'),controller[_0x22a9('0x25')]);router[_0x22a9('0x26')](_0x22a9('0xb'),auth[_0x22a9('0x7')](),controller[_0x22a9('0x27')]);module[_0x22a9('0x28')]=router; \ No newline at end of file +var _0x7b9c=['extname','/:id/logo_login','addLogoLogin','diskStorage','/:id/preferred','file','favicon','addFavicon','put','isAuthenticated','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','/now','getDate','get','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/favicon','getFavicon','join','root','server/files/images/logos/','logo','originalname','post','single','addLogo','format','%s%s'];(function(_0x283ea8,_0x5968de){var _0x263108=function(_0x5a314b){while(--_0x5a314b){_0x283ea8['push'](_0x283ea8['shift']());}};_0x263108(++_0x5968de);}(_0x7b9c,0xfc));var _0xc7b9=function(_0x36b261,_0x504c02){_0x36b261=_0x36b261-0x0;var _0x2cf069=_0x7b9c[_0x36b261];return _0x2cf069;};'use strict';var multer=require('multer');var util=require(_0xc7b9('0x0'));var path=require(_0xc7b9('0x1'));var timeout=require(_0xc7b9('0x2'));var express=require('express');var router=express[_0xc7b9('0x3')]();var fs_extra=require(_0xc7b9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7b9('0x5'));var config=require(_0xc7b9('0x6'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc7b9('0x7'),controller[_0xc7b9('0x8')]);router[_0xc7b9('0x9')](_0xc7b9('0xa'),controller[_0xc7b9('0xb')]);router[_0xc7b9('0x9')](_0xc7b9('0xc'),controller[_0xc7b9('0xd')]);router[_0xc7b9('0x9')]('/:id/logo_login',controller[_0xc7b9('0xe')]);router['get'](_0xc7b9('0xf'),controller['gdpr']);router[_0xc7b9('0x9')]('/:id/preferred',controller['getPreferred']);router['get'](_0xc7b9('0x10'),controller[_0xc7b9('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1938f0,_0x578044,_0x465707){_0x465707(null,path[_0xc7b9('0x12')](config[_0xc7b9('0x13')],_0xc7b9('0x14')));},'filename':function(_0x14bed3,_0x209185,_0x142ae5){_0x142ae5(null,util['format']('%s%s',_0xc7b9('0x15'),path['extname'](_0x209185[_0xc7b9('0x16')])));}})});router[_0xc7b9('0x17')](_0xc7b9('0xc'),upload[_0xc7b9('0x18')]('file'),controller[_0xc7b9('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x298b47,_0x412c54,_0x2c71ea){_0x2c71ea(null,path[_0xc7b9('0x12')](config['root'],_0xc7b9('0x14')));},'filename':function(_0xdcc066,_0x261e95,_0x216a07){_0x216a07(null,util[_0xc7b9('0x1a')](_0xc7b9('0x1b'),'logologin',path[_0xc7b9('0x1c')](_0x261e95['originalname'])));}})});router[_0xc7b9('0x17')](_0xc7b9('0x1d'),upload[_0xc7b9('0x18')]('file'),controller[_0xc7b9('0x1e')]);var upload=multer({'storage':multer[_0xc7b9('0x1f')]({'destination':function(_0x21766f,_0x46b06a,_0x47bfdc){_0x47bfdc(null,path[_0xc7b9('0x12')](config[_0xc7b9('0x13')],_0xc7b9('0x14')));},'filename':function(_0x48518d,_0x501577,_0x4562d3){_0x4562d3(null,util[_0xc7b9('0x1a')](_0xc7b9('0x1b'),'preferred',path[_0xc7b9('0x1c')](_0x501577[_0xc7b9('0x16')])));}})});router[_0xc7b9('0x17')](_0xc7b9('0x20'),upload[_0xc7b9('0x18')](_0xc7b9('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0xc7b9('0x1f')]({'destination':function(_0x32c445,_0x5eb219,_0x1d2c87){_0x1d2c87(null,path['join'](config[_0xc7b9('0x13')],_0xc7b9('0x14')));},'filename':function(_0x1662b0,_0x3fc8df,_0x3034d6){_0x3034d6(null,util['format'](_0xc7b9('0x1b'),_0xc7b9('0x22'),path[_0xc7b9('0x1c')](_0x3fc8df[_0xc7b9('0x16')])));}})});router[_0xc7b9('0x17')](_0xc7b9('0x10'),upload[_0xc7b9('0x18')](_0xc7b9('0x21')),controller[_0xc7b9('0x23')]);router[_0xc7b9('0x24')]('/:id',auth[_0xc7b9('0x25')](),controller[_0xc7b9('0x26')]);module[_0xc7b9('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 2f03515..dfe7079 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 _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0xadb5,0xad));var _0x5adb=function(_0x114f2b,_0x5b01aa){_0x114f2b=_0x114f2b-0x0;var _0x2e1e59=_0xadb5[_0x114f2b];return _0x2e1e59;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x256734,_0x76b090){var _0x289a2c=function(_0x183b77){while(--_0x183b77){_0x256734['push'](_0x256734['shift']());}};_0x289a2c(++_0x76b090);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0x0b0e[_0x4452dc];return _0x52b892;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 931c282..044d62a 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 _0xdcd9=['default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','loginLogo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','default_logo.svg','ValidationError','getLogoLogin','getLicense','favicon','default_loginLogo.svg','custom','existsSync','Sequelize','\x20not\x20found','download','gdpr','addFavicon'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xdcd9,0xf5));var _0x9dcd=function(_0x2870cd,_0x856b58){_0x2870cd=_0x2870cd-0x0;var _0x245747=_0xdcd9[_0x2870cd];return _0x245747;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dcd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dcd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9dcd('0x2'));var Mustache=require(_0x9dcd('0x3'));var util=require(_0x9dcd('0x4'));var path=require(_0x9dcd('0x5'));var sox=require(_0x9dcd('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dcd('0x7'));var _=require(_0x9dcd('0x8'));var squel=require(_0x9dcd('0x9'));var crypto=require(_0x9dcd('0xa'));var jsforce=require(_0x9dcd('0xb'));var deskjs=require(_0x9dcd('0xc'));var toCsv=require(_0x9dcd('0xd'));var querystring=require(_0x9dcd('0xe'));var Papa=require(_0x9dcd('0xf'));var Redis=require(_0x9dcd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9dcd('0x11'));var as=require(_0x9dcd('0x12'));var hardwareService=require(_0x9dcd('0x13'));var logger=require(_0x9dcd('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9dcd('0x15'));var licenseUtil=require(_0x9dcd('0x16'));var db=require(_0x9dcd('0x17'))['db'];var jayson=require(_0x9dcd('0x18'));var client=jayson[_0x9dcd('0x19')][_0x9dcd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x31cb53,_0x31a764,_0xf0f83b,_0x5e7fa8){return new BPromise(function(_0x38a8e8,_0x22d809){var _0x2e9e61=_0x5e7fa8||client;return _0x2e9e61[_0x9dcd('0x1b')](_0x31cb53,_0xf0f83b)[_0x9dcd('0x1c')](function(_0x18e795){logger[_0x9dcd('0x1d')](_0x9dcd('0x1e'),_0x31a764,_0x9dcd('0x1f'));logger[_0x9dcd('0x20')](_0x9dcd('0x21'),_0x31a764,_0x9dcd('0x1f'),JSON['stringify'](_0x18e795));if(_0x18e795[_0x9dcd('0x22')]){if(_0x18e795[_0x9dcd('0x22')][_0x9dcd('0x23')]===0x1f4){logger[_0x9dcd('0x22')](_0x9dcd('0x1e'),_0x31a764,_0x18e795['error'][_0x9dcd('0x24')]);return _0x22d809(_0x18e795[_0x9dcd('0x22')][_0x9dcd('0x24')]);}logger[_0x9dcd('0x22')](_0x9dcd('0x1e'),_0x31a764,_0x18e795[_0x9dcd('0x22')][_0x9dcd('0x24')]);return _0x38a8e8(_0x18e795[_0x9dcd('0x22')][_0x9dcd('0x24')]);}else{logger[_0x9dcd('0x1d')]('Setting,\x20%s,\x20%s',_0x31a764,_0x9dcd('0x1f'));_0x38a8e8(_0x18e795['result'][_0x9dcd('0x24')]);}})[_0x9dcd('0x25')](function(_0x24e6c2){logger[_0x9dcd('0x22')]('Setting,\x20%s,\x20%s',_0x31a764,_0x24e6c2);_0x22d809(_0x24e6c2);});});}function respondWithStatusCode(_0x4c6866,_0x348f0d){_0x348f0d=_0x348f0d||0xcc;return function(_0xa1176b){if(_0xa1176b){return _0x4c6866['sendStatus'](_0x348f0d);}return _0x4c6866['status'](_0x348f0d)[_0x9dcd('0x26')]();};}function respondWithResult(_0x1535c5,_0x5ddd69){_0x5ddd69=_0x5ddd69||0xc8;return function(_0x10d07c){if(_0x10d07c){return _0x1535c5[_0x9dcd('0x27')](_0x5ddd69)[_0x9dcd('0x28')](_0x10d07c);}};}function respondWithFilteredResult(_0x3c4b99,_0x97d79d){return function(_0x3c98c2){if(_0x3c98c2){var _0x478751=typeof _0x97d79d[_0x9dcd('0x29')]===_0x9dcd('0x2a')&&typeof _0x97d79d['limit']===_0x9dcd('0x2a');var _0x3ebd92=_0x3c98c2['count'];var _0x5f4b26=_0x478751?0x0:_0x97d79d[_0x9dcd('0x29')];var _0x1d1caf=_0x478751?_0x3c98c2[_0x9dcd('0x2b')]:_0x97d79d[_0x9dcd('0x29')]+_0x97d79d[_0x9dcd('0x2c')];var _0x3b27da;if(_0x1d1caf>=_0x3ebd92){_0x1d1caf=_0x3ebd92;_0x3b27da=0xc8;}else{_0x3b27da=0xce;}_0x3c4b99[_0x9dcd('0x27')](_0x3b27da);return _0x3c4b99[_0x9dcd('0x2d')](_0x9dcd('0x2e'),_0x5f4b26+'-'+_0x1d1caf+'/'+_0x3ebd92)[_0x9dcd('0x28')](_0x3c98c2);}return null;};}function patchUpdates(_0x12a582){return function(_0xbfe0c5){try{jsonpatch[_0x9dcd('0x2f')](_0xbfe0c5,_0x12a582,!![]);}catch(_0x6e3771){return BPromise[_0x9dcd('0x30')](_0x6e3771);}return _0xbfe0c5[_0x9dcd('0x31')]();};}function saveUpdates(_0x245f25,_0x1adc41){return function(_0x39895f){if(_0x39895f){return _0x39895f[_0x9dcd('0x32')](_0x245f25)[_0x9dcd('0x1c')](function(_0x2271cd){return _0x2271cd;});}return null;};}function removeEntity(_0x35ac1f,_0x2c61d7){return function(_0x21c4af){if(_0x21c4af){return _0x21c4af[_0x9dcd('0x33')]()['then'](function(){_0x35ac1f[_0x9dcd('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbad301,_0x12f9ea){return function(_0x30d2e8){if(!_0x30d2e8){_0xbad301[_0x9dcd('0x34')](0x194);}return _0x30d2e8;};}function handleError(_0x13cd99,_0x4240b7){_0x4240b7=_0x4240b7||0x1f4;return function(_0xca3f1c){logger['error'](_0xca3f1c['stack']);if(_0xca3f1c[_0x9dcd('0x35')]){delete _0xca3f1c[_0x9dcd('0x35')];}_0x13cd99[_0x9dcd('0x27')](_0x4240b7)[_0x9dcd('0x36')](_0xca3f1c);};}exports[_0x9dcd('0x37')]=function(_0x74346c,_0x55df41){var _0x360dfa={},_0x51b3c2={},_0x3b3b4e={'count':0x0,'rows':[]};var _0x54d49b=_[_0x9dcd('0x38')](db[_0x9dcd('0x39')][_0x9dcd('0x3a')],function(_0x28a68d){return{'name':_0x28a68d[_0x9dcd('0x3b')],'type':_0x28a68d[_0x9dcd('0x3c')][_0x9dcd('0x3d')]};});_0x51b3c2[_0x9dcd('0x3e')]=_[_0x9dcd('0x38')](_0x54d49b,_0x9dcd('0x35'));_0x51b3c2['query']=_[_0x9dcd('0x3f')](_0x74346c[_0x9dcd('0x40')]);_0x51b3c2[_0x9dcd('0x41')]=_['intersection'](_0x51b3c2[_0x9dcd('0x3e')],_0x51b3c2[_0x9dcd('0x40')]);_0x360dfa[_0x9dcd('0x42')]=_[_0x9dcd('0x43')](_0x51b3c2[_0x9dcd('0x3e')],qs[_0x9dcd('0x44')](_0x74346c['query']['fields']));_0x360dfa[_0x9dcd('0x42')]=_0x360dfa[_0x9dcd('0x42')][_0x9dcd('0x45')]?_0x360dfa[_0x9dcd('0x42')]:_0x51b3c2[_0x9dcd('0x3e')];if(!_0x74346c[_0x9dcd('0x40')][_0x9dcd('0x46')]('nolimit')){_0x360dfa[_0x9dcd('0x2c')]=qs[_0x9dcd('0x2c')](_0x74346c['query'][_0x9dcd('0x2c')]);_0x360dfa[_0x9dcd('0x29')]=qs['offset'](_0x74346c['query'][_0x9dcd('0x29')]);}_0x360dfa['order']=qs[_0x9dcd('0x47')](_0x74346c[_0x9dcd('0x40')][_0x9dcd('0x47')]);_0x360dfa[_0x9dcd('0x48')]=qs[_0x9dcd('0x41')](_['pick'](_0x74346c[_0x9dcd('0x40')],_0x51b3c2[_0x9dcd('0x41')]),_0x54d49b);if(_0x74346c['query'][_0x9dcd('0x49')]){_0x360dfa[_0x9dcd('0x48')]=_[_0x9dcd('0x4a')](_0x360dfa[_0x9dcd('0x48')],{'$or':_[_0x9dcd('0x38')](_0x54d49b,function(_0x3e115a){if(_0x3e115a['type']!==_0x9dcd('0x4b')){var _0x2aa246={};_0x2aa246[_0x3e115a[_0x9dcd('0x35')]]={'$like':'%'+_0x74346c[_0x9dcd('0x40')][_0x9dcd('0x49')]+'%'};return _0x2aa246;}})});}_0x360dfa=_[_0x9dcd('0x4a')]({},_0x360dfa,_0x74346c[_0x9dcd('0x4c')]);var _0x371cb1={'where':_0x360dfa['where']};return db['Setting']['count'](_0x371cb1)[_0x9dcd('0x1c')](function(_0x2cf6c8){_0x3b3b4e[_0x9dcd('0x2b')]=_0x2cf6c8;if(_0x74346c[_0x9dcd('0x40')][_0x9dcd('0x4d')]){_0x360dfa[_0x9dcd('0x4e')]=[{'all':!![]}];}return db['Setting'][_0x9dcd('0x4f')](_0x360dfa);})['then'](function(_0x115916){_0x3b3b4e[_0x9dcd('0x50')]=_0x115916;return _0x3b3b4e;})[_0x9dcd('0x1c')](respondWithFilteredResult(_0x55df41,_0x360dfa))[_0x9dcd('0x25')](handleError(_0x55df41,null));};exports['show']=function(_0x41e3cf,_0x3a48c5){var _0xe18425={'raw':![],'where':{'id':_0x41e3cf[_0x9dcd('0x51')]['id']}},_0x4aa1af={};_0x4aa1af['model']=_[_0x9dcd('0x3f')](db[_0x9dcd('0x39')][_0x9dcd('0x3a')]);_0x4aa1af[_0x9dcd('0x40')]=_[_0x9dcd('0x3f')](_0x41e3cf['query']);_0x4aa1af[_0x9dcd('0x41')]=_[_0x9dcd('0x43')](_0x4aa1af[_0x9dcd('0x3e')],_0x4aa1af[_0x9dcd('0x40')]);_0xe18425[_0x9dcd('0x42')]=_[_0x9dcd('0x43')](_0x4aa1af['model'],qs['fields'](_0x41e3cf[_0x9dcd('0x40')][_0x9dcd('0x44')]));_0xe18425[_0x9dcd('0x42')]=_0xe18425[_0x9dcd('0x42')][_0x9dcd('0x45')]?_0xe18425[_0x9dcd('0x42')]:_0x4aa1af[_0x9dcd('0x3e')];if(_0x41e3cf['query'][_0x9dcd('0x4d')]){_0xe18425['include']=[{'all':!![]}];}_0xe18425=_[_0x9dcd('0x4a')]({},_0xe18425,_0x41e3cf[_0x9dcd('0x4c')]);return db['Setting'][_0x9dcd('0x52')](_0xe18425)[_0x9dcd('0x1c')](handleEntityNotFound(_0x3a48c5,null))[_0x9dcd('0x1c')](respondWithResult(_0x3a48c5,null))[_0x9dcd('0x25')](handleError(_0x3a48c5,null));};exports[_0x9dcd('0x32')]=function(_0x130ab0,_0x1d071b){if(_0x130ab0[_0x9dcd('0x53')]['id']){delete _0x130ab0[_0x9dcd('0x53')]['id'];}return db['Setting'][_0x9dcd('0x52')]({'where':{'id':_0x130ab0[_0x9dcd('0x51')]['id']}})[_0x9dcd('0x1c')](handleEntityNotFound(_0x1d071b,null))[_0x9dcd('0x1c')](saveUpdates(_0x130ab0[_0x9dcd('0x53')],null))[_0x9dcd('0x1c')](respondWithResult(_0x1d071b,null))['catch'](handleError(_0x1d071b,null));};exports[_0x9dcd('0x54')]=function(_0x5a987e,_0x15e441,_0x544822){if(_0x5a987e[_0x9dcd('0x55')]&&_0x5a987e[_0x9dcd('0x55')][_0x9dcd('0x56')]){_0x5a987e[_0x9dcd('0x53')][_0x9dcd('0x57')]=_0x5a987e[_0x9dcd('0x55')]['filename'];}return db[_0x9dcd('0x39')]['find']({'where':{'id':_0x5a987e[_0x9dcd('0x51')]['id']}})[_0x9dcd('0x1c')](handleEntityNotFound(_0x15e441,null))[_0x9dcd('0x1c')](saveUpdates(_0x5a987e[_0x9dcd('0x53')],null))[_0x9dcd('0x1c')](respondWithResult(_0x15e441,null))[_0x9dcd('0x25')](handleError(_0x15e441,null));};exports[_0x9dcd('0x58')]=function(_0x5db851,_0x6f0b3,_0x4c8ce9){if(_0x5db851['file']&&_0x5db851[_0x9dcd('0x55')][_0x9dcd('0x56')]){_0x5db851[_0x9dcd('0x53')]['loginLogo']=_0x5db851[_0x9dcd('0x55')][_0x9dcd('0x56')];}return db[_0x9dcd('0x39')][_0x9dcd('0x52')]({'where':{'id':_0x5db851[_0x9dcd('0x51')]['id']}})[_0x9dcd('0x1c')](handleEntityNotFound(_0x6f0b3,null))[_0x9dcd('0x1c')](saveUpdates(_0x5db851[_0x9dcd('0x53')],null))['then'](respondWithResult(_0x6f0b3,null))[_0x9dcd('0x25')](handleError(_0x6f0b3,null));};var utilLicense=require(_0x9dcd('0x16'));exports[_0x9dcd('0x59')]=function(_0x5dce09,_0x15e423,_0x4d2bcd){var _0x3ad642=_0x9dcd('0x5a');var _0x2622db={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x49092f){if(_0x49092f){_0x2622db=_0x49092f;}return db[_0x9dcd('0x39')]['find']({'where':{'id':_0x5dce09[_0x9dcd('0x51')]['id']},'attributes':['logo',_0x9dcd('0x5b'),_0x9dcd('0x5c'),'favicon',_0x9dcd('0x5d'),_0x9dcd('0x5e'),_0x9dcd('0x5f'),_0x9dcd('0x60')],'raw':!![]});})[_0x9dcd('0x1c')](handleEntityNotFound(_0x15e423,null))[_0x9dcd('0x1c')](function(_0x109152){if(_0x109152){var _0x22a319=_0x109152[_0x9dcd('0x57')]&&fs['existsSync'](path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x3ad642,_[_0x9dcd('0x63')](_0x109152[_0x9dcd('0x57')])))?path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x3ad642,_[_0x9dcd('0x63')](_0x109152[_0x9dcd('0x57')])):path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x3ad642,_['toLower']('default_logo.svg'));var _0x21dc2f=_0x9dcd('0x64')+_[_0x9dcd('0x65')](_0x9dcd('0x57'));if(_0x109152[_0x21dc2f]||!_0x2622db['custom']){_0x22a319=path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x3ad642,_[_0x9dcd('0x63')](_0x9dcd('0x66')));}if(!fs['existsSync'](_0x22a319)){throw new db['Sequelize'][(_0x9dcd('0x67'))](_[_0x9dcd('0x65')](_0x9dcd('0x57'))+'\x20not\x20found');}return _0x15e423['download'](_0x22a319);}})['catch'](handleError(_0x15e423,null));};var utilLicense=require(_0x9dcd('0x16'));exports[_0x9dcd('0x68')]=function(_0x2c18d0,_0x1f99c3,_0x658e89){var _0x2dbaf7=_0x9dcd('0x5a');var _0x46cf18={'custom':![]};return utilLicense[_0x9dcd('0x69')]()['then'](function(_0xe7bb2e){if(_0xe7bb2e){_0x46cf18=_0xe7bb2e;}return db[_0x9dcd('0x39')][_0x9dcd('0x52')]({'where':{'id':_0x2c18d0['params']['id']},'attributes':[_0x9dcd('0x57'),_0x9dcd('0x5b'),_0x9dcd('0x5c'),_0x9dcd('0x6a'),'defaultLogo',_0x9dcd('0x5e'),_0x9dcd('0x5f'),_0x9dcd('0x60')],'raw':!![]});})[_0x9dcd('0x1c')](handleEntityNotFound(_0x1f99c3,null))[_0x9dcd('0x1c')](function(_0xa1d142){if(_0xa1d142){var _0x4b7fd7=_0xa1d142[_0x9dcd('0x5b')]&&fs['existsSync'](path['join'](config[_0x9dcd('0x62')],_0x2dbaf7,_[_0x9dcd('0x63')](_0xa1d142['loginLogo'])))?path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x2dbaf7,_['toLower'](_0xa1d142['loginLogo'])):path[_0x9dcd('0x61')](config['root'],_0x2dbaf7,_[_0x9dcd('0x63')](_0x9dcd('0x6b')));var _0x8fc655=_0x9dcd('0x64')+_[_0x9dcd('0x65')](_0x9dcd('0x5b'));if(_0xa1d142[_0x8fc655]||!_0x46cf18[_0x9dcd('0x6c')]){_0x4b7fd7=path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x2dbaf7,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x9dcd('0x6d')](_0x4b7fd7)){throw new db[(_0x9dcd('0x6e'))][(_0x9dcd('0x67'))](_[_0x9dcd('0x65')]('loginLogo')+_0x9dcd('0x6f'));}return _0x1f99c3[_0x9dcd('0x70')](_0x4b7fd7);}})[_0x9dcd('0x25')](handleError(_0x1f99c3,null));};exports[_0x9dcd('0x71')]=function(_0x3338d3,_0x2e5a54){return db[_0x9dcd('0x39')][_0x9dcd('0x52')]({'where':{'id':_0x3338d3[_0x9dcd('0x51')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x2e5a54,null))[_0x9dcd('0x25')](handleError(_0x2e5a54,null));};exports['addPreferred']=function(_0x4e71e1,_0x294c64,_0x5798e5){if(_0x4e71e1[_0x9dcd('0x55')]&&_0x4e71e1[_0x9dcd('0x55')]['filename']){_0x4e71e1[_0x9dcd('0x53')][_0x9dcd('0x5c')]=_0x4e71e1[_0x9dcd('0x55')][_0x9dcd('0x56')];}return db['Setting'][_0x9dcd('0x52')]({'where':{'id':_0x4e71e1['params']['id']}})[_0x9dcd('0x1c')](handleEntityNotFound(_0x294c64,null))['then'](saveUpdates(_0x4e71e1[_0x9dcd('0x53')],null))[_0x9dcd('0x1c')](respondWithResult(_0x294c64,null))['catch'](handleError(_0x294c64,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x41821e,_0x4c15f4,_0x379740){var _0x45ff50=_0x9dcd('0x5a');var _0x429a92={'custom':![]};return utilLicense[_0x9dcd('0x69')]()[_0x9dcd('0x1c')](function(_0x32a026){if(_0x32a026){_0x429a92=_0x32a026;}return db[_0x9dcd('0x39')][_0x9dcd('0x52')]({'where':{'id':_0x41821e[_0x9dcd('0x51')]['id']},'attributes':['logo',_0x9dcd('0x5b'),_0x9dcd('0x5c'),_0x9dcd('0x6a'),_0x9dcd('0x5d'),_0x9dcd('0x5e'),'defaultPreferred',_0x9dcd('0x60')],'raw':!![]});})[_0x9dcd('0x1c')](handleEntityNotFound(_0x4c15f4,null))[_0x9dcd('0x1c')](function(_0x5ab34e){if(_0x5ab34e){var _0x241f3c=_0x5ab34e['preferred']&&fs['existsSync'](path['join'](config[_0x9dcd('0x62')],_0x45ff50,_[_0x9dcd('0x63')](_0x5ab34e[_0x9dcd('0x5c')])))?path[_0x9dcd('0x61')](config['root'],_0x45ff50,_[_0x9dcd('0x63')](_0x5ab34e['preferred'])):path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x45ff50,_[_0x9dcd('0x63')]('default_preferred.png'));var _0x1f6d5b=_0x9dcd('0x64')+_['upperFirst'](_0x9dcd('0x5c'));if(_0x5ab34e[_0x1f6d5b]||!_0x429a92[_0x9dcd('0x6c')]||!_0x429a92[_0x9dcd('0x5c')]){_0x241f3c=path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x45ff50,_['toLower']('default_preferred.png'));}if(!fs[_0x9dcd('0x6d')](_0x241f3c)){throw new db[(_0x9dcd('0x6e'))][(_0x9dcd('0x67'))](_[_0x9dcd('0x65')]('preferred')+_0x9dcd('0x6f'));}return _0x4c15f4[_0x9dcd('0x70')](_0x241f3c);}})['catch'](handleError(_0x4c15f4,null));};exports[_0x9dcd('0x72')]=function(_0x1b6c3c,_0x7c9ab2,_0xafb282){if(_0x1b6c3c[_0x9dcd('0x55')]&&_0x1b6c3c[_0x9dcd('0x55')][_0x9dcd('0x56')]){_0x1b6c3c['body'][_0x9dcd('0x6a')]=_0x1b6c3c['file']['filename'];}return db[_0x9dcd('0x39')][_0x9dcd('0x52')]({'where':{'id':_0x1b6c3c[_0x9dcd('0x51')]['id']}})[_0x9dcd('0x1c')](handleEntityNotFound(_0x7c9ab2,null))[_0x9dcd('0x1c')](saveUpdates(_0x1b6c3c[_0x9dcd('0x53')],null))[_0x9dcd('0x1c')](respondWithResult(_0x7c9ab2,null))[_0x9dcd('0x25')](handleError(_0x7c9ab2,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x5531d4,_0x1640e6,_0x191f89){var _0x4ca654=_0x9dcd('0x5a');var _0x2f2a1a={'custom':![]};return utilLicense[_0x9dcd('0x69')]()['then'](function(_0x35277a){if(_0x35277a){_0x2f2a1a=_0x35277a;}return db[_0x9dcd('0x39')]['find']({'where':{'id':_0x5531d4[_0x9dcd('0x51')]['id']},'attributes':[_0x9dcd('0x57'),_0x9dcd('0x5b'),_0x9dcd('0x5c'),_0x9dcd('0x6a'),_0x9dcd('0x5d'),_0x9dcd('0x5e'),_0x9dcd('0x5f'),_0x9dcd('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x1640e6,null))['then'](function(_0x29daca){if(_0x29daca){var _0x38f068=_0x29daca[_0x9dcd('0x6a')]&&fs[_0x9dcd('0x6d')](path[_0x9dcd('0x61')](config[_0x9dcd('0x62')],_0x4ca654,_[_0x9dcd('0x63')](_0x29daca[_0x9dcd('0x6a')])))?path['join'](config[_0x9dcd('0x62')],_0x4ca654,_[_0x9dcd('0x63')](_0x29daca[_0x9dcd('0x6a')])):path[_0x9dcd('0x61')](config['root'],_0x4ca654,_[_0x9dcd('0x63')](_0x9dcd('0x73')));var _0x467466=_0x9dcd('0x64')+_[_0x9dcd('0x65')]('favicon');if(_0x29daca[_0x467466]||!_0x2f2a1a[_0x9dcd('0x6c')]){_0x38f068=path['join'](config[_0x9dcd('0x62')],_0x4ca654,_[_0x9dcd('0x63')]('default_favicon.ico'));}if(!fs[_0x9dcd('0x6d')](_0x38f068)){throw new db[(_0x9dcd('0x6e'))][(_0x9dcd('0x67'))](_[_0x9dcd('0x65')](_0x9dcd('0x6a'))+'\x20not\x20found');}return _0x1640e6[_0x9dcd('0x70')](_0x38f068);}})[_0x9dcd('0x25')](handleError(_0x1640e6,null));};exports[_0x9dcd('0x74')]=function(_0x2fc876,_0x26e0a0){var _0x36c81a={'offset':moment()[_0x9dcd('0x75')]()};_0x36c81a['now']=moment()[_0x9dcd('0x75')](_0x36c81a[_0x9dcd('0x29')])[_0x9dcd('0x76')](_0x9dcd('0x77'));return _0x26e0a0[_0x9dcd('0x27')](0xc8)['send'](_0x36c81a);}; \ No newline at end of file +var _0x14a4=['http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','index','Setting','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','show','params','includeAll','find','body','addLogo','file','logo','filename','getLogo','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','join','toLower','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','server/files/images/logos','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14a4,0x147));var _0x414a=function(_0x20f4e0,_0x32713b){_0x20f4e0=_0x20f4e0-0x0;var _0x35ecfa=_0x14a4[_0x20f4e0];return _0x35ecfa;};'use strict';var emlformat=require(_0x414a('0x0'));var rimraf=require(_0x414a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x414a('0x2'));var BPromise=require(_0x414a('0x3'));var Mustache=require(_0x414a('0x4'));var util=require('util');var path=require(_0x414a('0x5'));var sox=require(_0x414a('0x6'));var csv=require(_0x414a('0x7'));var ejs=require(_0x414a('0x8'));var fs=require('fs');var fs_extra=require(_0x414a('0x9'));var _=require(_0x414a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x414a('0xb'));var toCsv=require(_0x414a('0x7'));var querystring=require(_0x414a('0xc'));var Papa=require(_0x414a('0xd'));var Redis=require(_0x414a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x414a('0xf'));var as=require(_0x414a('0x10'));var hardwareService=require(_0x414a('0x11'));var logger=require(_0x414a('0x12'))(_0x414a('0x13'));var utils=require(_0x414a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x414a('0x15'));var db=require(_0x414a('0x16'))['db'];var jayson=require(_0x414a('0x17'));var client=jayson['client'][_0x414a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5038fe,_0x25428b,_0x2dd455,_0x2b732f){return new BPromise(function(_0x8d5363,_0x443f5b){var _0x27ad82=_0x2b732f||client;return _0x27ad82[_0x414a('0x19')](_0x5038fe,_0x2dd455)['then'](function(_0x2b5fb9){logger[_0x414a('0x1a')](_0x414a('0x1b'),_0x25428b,_0x414a('0x1c'));logger[_0x414a('0x1d')](_0x414a('0x1e'),_0x25428b,'request\x20sent',JSON['stringify'](_0x2b5fb9));if(_0x2b5fb9['error']){if(_0x2b5fb9[_0x414a('0x1f')][_0x414a('0x20')]===0x1f4){logger['error'](_0x414a('0x1b'),_0x25428b,_0x2b5fb9[_0x414a('0x1f')][_0x414a('0x21')]);return _0x443f5b(_0x2b5fb9[_0x414a('0x1f')]['message']);}logger[_0x414a('0x1f')](_0x414a('0x1b'),_0x25428b,_0x2b5fb9[_0x414a('0x1f')][_0x414a('0x21')]);return _0x8d5363(_0x2b5fb9[_0x414a('0x1f')][_0x414a('0x21')]);}else{logger['info'](_0x414a('0x1b'),_0x25428b,'request\x20sent');_0x8d5363(_0x2b5fb9[_0x414a('0x22')][_0x414a('0x21')]);}})[_0x414a('0x23')](function(_0x30368d){logger[_0x414a('0x1f')](_0x414a('0x1b'),_0x25428b,_0x30368d);_0x443f5b(_0x30368d);});});}function respondWithStatusCode(_0x1fe031,_0x4b9296){_0x4b9296=_0x4b9296||0xcc;return function(_0xcb0e7b){if(_0xcb0e7b){return _0x1fe031[_0x414a('0x24')](_0x4b9296);}return _0x1fe031[_0x414a('0x25')](_0x4b9296)['end']();};}function respondWithResult(_0x286a00,_0x59420b){_0x59420b=_0x59420b||0xc8;return function(_0x50178c){if(_0x50178c){return _0x286a00['status'](_0x59420b)[_0x414a('0x26')](_0x50178c);}};}function respondWithFilteredResult(_0x38b992,_0x58e730){return function(_0x5b2818){if(_0x5b2818){var _0x135711=typeof _0x58e730['offset']===_0x414a('0x27')&&typeof _0x58e730['limit']===_0x414a('0x27');var _0x29b1da=_0x5b2818[_0x414a('0x28')];var _0x382570=_0x135711?0x0:_0x58e730['offset'];var _0x47e230=_0x135711?_0x5b2818['count']:_0x58e730[_0x414a('0x29')]+_0x58e730[_0x414a('0x2a')];var _0x2f243d;if(_0x47e230>=_0x29b1da){_0x47e230=_0x29b1da;_0x2f243d=0xc8;}else{_0x2f243d=0xce;}_0x38b992[_0x414a('0x25')](_0x2f243d);return _0x38b992[_0x414a('0x2b')](_0x414a('0x2c'),_0x382570+'-'+_0x47e230+'/'+_0x29b1da)[_0x414a('0x26')](_0x5b2818);}return null;};}function patchUpdates(_0x202c46){return function(_0x591ca1){try{jsonpatch['apply'](_0x591ca1,_0x202c46,!![]);}catch(_0x44011e){return BPromise[_0x414a('0x2d')](_0x44011e);}return _0x591ca1[_0x414a('0x2e')]();};}function saveUpdates(_0x5dd9a0,_0x3e1634){return function(_0x18f409){if(_0x18f409){return _0x18f409[_0x414a('0x2f')](_0x5dd9a0)[_0x414a('0x30')](function(_0x3b667c){return _0x3b667c;});}return null;};}function removeEntity(_0x1da0d2,_0x57aacc){return function(_0x443a35){if(_0x443a35){return _0x443a35['destroy']()['then'](function(){_0x1da0d2[_0x414a('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17ed74,_0x14b7fa){return function(_0x32d055){if(!_0x32d055){_0x17ed74[_0x414a('0x24')](0x194);}return _0x32d055;};}function handleError(_0x5be865,_0x57b82d){_0x57b82d=_0x57b82d||0x1f4;return function(_0xaa5412){logger['error'](_0xaa5412[_0x414a('0x31')]);if(_0xaa5412[_0x414a('0x32')]){delete _0xaa5412[_0x414a('0x32')];}_0x5be865[_0x414a('0x25')](_0x57b82d)['send'](_0xaa5412);};}exports[_0x414a('0x33')]=function(_0x3aca8d,_0x513c0b){var _0x416188={},_0x57e08d={},_0x4b0d86={'count':0x0,'rows':[]};var _0x45fc2c=_['map'](db[_0x414a('0x34')][_0x414a('0x35')],function(_0x4479b6){return{'name':_0x4479b6[_0x414a('0x36')],'type':_0x4479b6[_0x414a('0x37')][_0x414a('0x38')]};});_0x57e08d[_0x414a('0x39')]=_[_0x414a('0x3a')](_0x45fc2c,_0x414a('0x32'));_0x57e08d['query']=_[_0x414a('0x3b')](_0x3aca8d['query']);_0x57e08d[_0x414a('0x3c')]=_[_0x414a('0x3d')](_0x57e08d[_0x414a('0x39')],_0x57e08d['query']);_0x416188[_0x414a('0x3e')]=_[_0x414a('0x3d')](_0x57e08d[_0x414a('0x39')],qs[_0x414a('0x3f')](_0x3aca8d['query'][_0x414a('0x3f')]));_0x416188[_0x414a('0x3e')]=_0x416188[_0x414a('0x3e')][_0x414a('0x40')]?_0x416188[_0x414a('0x3e')]:_0x57e08d[_0x414a('0x39')];if(!_0x3aca8d[_0x414a('0x41')][_0x414a('0x42')]('nolimit')){_0x416188[_0x414a('0x2a')]=qs[_0x414a('0x2a')](_0x3aca8d[_0x414a('0x41')][_0x414a('0x2a')]);_0x416188[_0x414a('0x29')]=qs[_0x414a('0x29')](_0x3aca8d[_0x414a('0x41')][_0x414a('0x29')]);}_0x416188[_0x414a('0x43')]=qs[_0x414a('0x44')](_0x3aca8d[_0x414a('0x41')]['sort']);_0x416188[_0x414a('0x45')]=qs[_0x414a('0x3c')](_[_0x414a('0x46')](_0x3aca8d[_0x414a('0x41')],_0x57e08d['filters']),_0x45fc2c);if(_0x3aca8d[_0x414a('0x41')][_0x414a('0x47')]){_0x416188[_0x414a('0x45')]=_[_0x414a('0x48')](_0x416188[_0x414a('0x45')],{'$or':_[_0x414a('0x3a')](_0x45fc2c,function(_0x59886c){if(_0x59886c['type']!=='VIRTUAL'){var _0x30ef7a={};_0x30ef7a[_0x59886c[_0x414a('0x32')]]={'$like':'%'+_0x3aca8d[_0x414a('0x41')][_0x414a('0x47')]+'%'};return _0x30ef7a;}})});}_0x416188=_['merge']({},_0x416188,_0x3aca8d[_0x414a('0x49')]);var _0x3e3f3e={'where':_0x416188[_0x414a('0x45')]};return db[_0x414a('0x34')]['count'](_0x3e3f3e)[_0x414a('0x30')](function(_0x53a526){_0x4b0d86['count']=_0x53a526;if(_0x3aca8d[_0x414a('0x41')]['includeAll']){_0x416188[_0x414a('0x4a')]=[{'all':!![]}];}return db[_0x414a('0x34')]['findAll'](_0x416188);})[_0x414a('0x30')](function(_0x5d2309){_0x4b0d86['rows']=_0x5d2309;return _0x4b0d86;})[_0x414a('0x30')](respondWithFilteredResult(_0x513c0b,_0x416188))[_0x414a('0x23')](handleError(_0x513c0b,null));};exports[_0x414a('0x4b')]=function(_0x2d3508,_0x45cfac){var _0x148a55={'raw':![],'where':{'id':_0x2d3508[_0x414a('0x4c')]['id']}},_0x2e5938={};_0x2e5938[_0x414a('0x39')]=_[_0x414a('0x3b')](db['Setting']['rawAttributes']);_0x2e5938[_0x414a('0x41')]=_[_0x414a('0x3b')](_0x2d3508[_0x414a('0x41')]);_0x2e5938[_0x414a('0x3c')]=_[_0x414a('0x3d')](_0x2e5938[_0x414a('0x39')],_0x2e5938['query']);_0x148a55['attributes']=_[_0x414a('0x3d')](_0x2e5938['model'],qs[_0x414a('0x3f')](_0x2d3508[_0x414a('0x41')][_0x414a('0x3f')]));_0x148a55[_0x414a('0x3e')]=_0x148a55[_0x414a('0x3e')][_0x414a('0x40')]?_0x148a55[_0x414a('0x3e')]:_0x2e5938[_0x414a('0x39')];if(_0x2d3508[_0x414a('0x41')][_0x414a('0x4d')]){_0x148a55[_0x414a('0x4a')]=[{'all':!![]}];}_0x148a55=_['merge']({},_0x148a55,_0x2d3508[_0x414a('0x49')]);return db['Setting'][_0x414a('0x4e')](_0x148a55)[_0x414a('0x30')](handleEntityNotFound(_0x45cfac,null))[_0x414a('0x30')](respondWithResult(_0x45cfac,null))[_0x414a('0x23')](handleError(_0x45cfac,null));};exports[_0x414a('0x2f')]=function(_0x4ae43c,_0x1c5f8e){if(_0x4ae43c[_0x414a('0x4f')]['id']){delete _0x4ae43c['body']['id'];}return db['Setting'][_0x414a('0x4e')]({'where':{'id':_0x4ae43c[_0x414a('0x4c')]['id']}})[_0x414a('0x30')](handleEntityNotFound(_0x1c5f8e,null))['then'](saveUpdates(_0x4ae43c[_0x414a('0x4f')],null))[_0x414a('0x30')](respondWithResult(_0x1c5f8e,null))[_0x414a('0x23')](handleError(_0x1c5f8e,null));};exports[_0x414a('0x50')]=function(_0x2b769b,_0x1c473b,_0x23c799){if(_0x2b769b[_0x414a('0x51')]&&_0x2b769b[_0x414a('0x51')]['filename']){_0x2b769b['body'][_0x414a('0x52')]=_0x2b769b['file'][_0x414a('0x53')];}return db[_0x414a('0x34')]['find']({'where':{'id':_0x2b769b['params']['id']}})[_0x414a('0x30')](handleEntityNotFound(_0x1c473b,null))['then'](saveUpdates(_0x2b769b[_0x414a('0x4f')],null))[_0x414a('0x30')](respondWithResult(_0x1c473b,null))['catch'](handleError(_0x1c473b,null));};exports['addLogoLogin']=function(_0xfdf70d,_0x5e4f1,_0x149b6e){if(_0xfdf70d[_0x414a('0x51')]&&_0xfdf70d[_0x414a('0x51')][_0x414a('0x53')]){_0xfdf70d[_0x414a('0x4f')]['loginLogo']=_0xfdf70d[_0x414a('0x51')][_0x414a('0x53')];}return db['Setting']['find']({'where':{'id':_0xfdf70d[_0x414a('0x4c')]['id']}})[_0x414a('0x30')](handleEntityNotFound(_0x5e4f1,null))[_0x414a('0x30')](saveUpdates(_0xfdf70d[_0x414a('0x4f')],null))[_0x414a('0x30')](respondWithResult(_0x5e4f1,null))[_0x414a('0x23')](handleError(_0x5e4f1,null));};var utilLicense=require(_0x414a('0x15'));exports[_0x414a('0x54')]=function(_0x460eab,_0x55000a,_0x215f3c){var _0x59199e='server/files/images/logos';var _0x5b41c9={'custom':![]};return utilLicense[_0x414a('0x55')]()[_0x414a('0x30')](function(_0x3e7a14){if(_0x3e7a14){_0x5b41c9=_0x3e7a14;}return db['Setting'][_0x414a('0x4e')]({'where':{'id':_0x460eab['params']['id']},'attributes':['logo',_0x414a('0x56'),_0x414a('0x57'),_0x414a('0x58'),_0x414a('0x59'),'defaultLoginLogo',_0x414a('0x5a'),_0x414a('0x5b')],'raw':!![]});})[_0x414a('0x30')](handleEntityNotFound(_0x55000a,null))[_0x414a('0x30')](function(_0x112f0d){if(_0x112f0d){var _0x139529=_0x112f0d[_0x414a('0x52')]&&fs[_0x414a('0x5c')](path['join'](config[_0x414a('0x5d')],_0x59199e,_['toLower'](_0x112f0d[_0x414a('0x52')])))?path[_0x414a('0x5e')](config[_0x414a('0x5d')],_0x59199e,_[_0x414a('0x5f')](_0x112f0d[_0x414a('0x52')])):path['join'](config['root'],_0x59199e,_[_0x414a('0x5f')]('default_logo.svg'));var _0x336443=_0x414a('0x60')+_[_0x414a('0x61')](_0x414a('0x52'));if(_0x112f0d[_0x336443]||!_0x5b41c9[_0x414a('0x62')]){_0x139529=path[_0x414a('0x5e')](config[_0x414a('0x5d')],_0x59199e,_['toLower']('default_logo.svg'));}if(!fs[_0x414a('0x5c')](_0x139529)){throw new db[(_0x414a('0x63'))][(_0x414a('0x64'))](_[_0x414a('0x61')](_0x414a('0x52'))+'\x20not\x20found');}return _0x55000a[_0x414a('0x65')](_0x139529);}})[_0x414a('0x23')](handleError(_0x55000a,null));};var utilLicense=require('../../config/license/util');exports[_0x414a('0x66')]=function(_0x2dab91,_0xf00159,_0x30d424){var _0x1bd18e=_0x414a('0x67');var _0xcb0f00={'custom':![]};return utilLicense['getLicense']()[_0x414a('0x30')](function(_0x5c8a8b){if(_0x5c8a8b){_0xcb0f00=_0x5c8a8b;}return db[_0x414a('0x34')][_0x414a('0x4e')]({'where':{'id':_0x2dab91['params']['id']},'attributes':[_0x414a('0x52'),_0x414a('0x56'),'preferred','favicon',_0x414a('0x59'),_0x414a('0x68'),'defaultPreferred',_0x414a('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0xf00159,null))['then'](function(_0x12a63e){if(_0x12a63e){var _0x5d77ba=_0x12a63e[_0x414a('0x56')]&&fs['existsSync'](path[_0x414a('0x5e')](config['root'],_0x1bd18e,_['toLower'](_0x12a63e[_0x414a('0x56')])))?path['join'](config[_0x414a('0x5d')],_0x1bd18e,_[_0x414a('0x5f')](_0x12a63e[_0x414a('0x56')])):path['join'](config['root'],_0x1bd18e,_[_0x414a('0x5f')](_0x414a('0x69')));var _0x4071ff='default'+_[_0x414a('0x61')](_0x414a('0x56'));if(_0x12a63e[_0x4071ff]||!_0xcb0f00[_0x414a('0x62')]){_0x5d77ba=path[_0x414a('0x5e')](config[_0x414a('0x5d')],_0x1bd18e,_[_0x414a('0x5f')](_0x414a('0x69')));}if(!fs[_0x414a('0x5c')](_0x5d77ba)){throw new db[(_0x414a('0x63'))][(_0x414a('0x64'))](_['upperFirst'](_0x414a('0x56'))+_0x414a('0x6a'));}return _0xf00159[_0x414a('0x65')](_0x5d77ba);}})[_0x414a('0x23')](handleError(_0xf00159,null));};exports[_0x414a('0x6b')]=function(_0x53dbfd,_0x4c355c){return db[_0x414a('0x34')]['find']({'where':{'id':_0x53dbfd[_0x414a('0x4c')]['id']},'attributes':[_0x414a('0x6c')]})['then'](respondWithResult(_0x4c355c,null))[_0x414a('0x23')](handleError(_0x4c355c,null));};exports[_0x414a('0x6d')]=function(_0xb59f5d,_0x44ef90,_0x200cf8){if(_0xb59f5d[_0x414a('0x51')]&&_0xb59f5d['file'][_0x414a('0x53')]){_0xb59f5d[_0x414a('0x4f')][_0x414a('0x57')]=_0xb59f5d[_0x414a('0x51')][_0x414a('0x53')];}return db['Setting']['find']({'where':{'id':_0xb59f5d['params']['id']}})[_0x414a('0x30')](handleEntityNotFound(_0x44ef90,null))['then'](saveUpdates(_0xb59f5d[_0x414a('0x4f')],null))[_0x414a('0x30')](respondWithResult(_0x44ef90,null))['catch'](handleError(_0x44ef90,null));};var utilLicense=require(_0x414a('0x15'));exports['getPreferred']=function(_0x4c2e76,_0x5bf577,_0x4b0c7b){var _0x4711ad=_0x414a('0x67');var _0x4ff002={'custom':![]};return utilLicense[_0x414a('0x55')]()['then'](function(_0x3c297f){if(_0x3c297f){_0x4ff002=_0x3c297f;}return db[_0x414a('0x34')][_0x414a('0x4e')]({'where':{'id':_0x4c2e76['params']['id']},'attributes':[_0x414a('0x52'),_0x414a('0x56'),_0x414a('0x57'),_0x414a('0x58'),_0x414a('0x59'),_0x414a('0x68'),_0x414a('0x5a'),_0x414a('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x5bf577,null))[_0x414a('0x30')](function(_0x2c3e74){if(_0x2c3e74){var _0x3832a7=_0x2c3e74[_0x414a('0x57')]&&fs['existsSync'](path[_0x414a('0x5e')](config['root'],_0x4711ad,_[_0x414a('0x5f')](_0x2c3e74[_0x414a('0x57')])))?path[_0x414a('0x5e')](config['root'],_0x4711ad,_[_0x414a('0x5f')](_0x2c3e74['preferred'])):path['join'](config[_0x414a('0x5d')],_0x4711ad,_[_0x414a('0x5f')]('default_preferred.png'));var _0x132c7d=_0x414a('0x60')+_[_0x414a('0x61')](_0x414a('0x57'));if(_0x2c3e74[_0x132c7d]||!_0x4ff002[_0x414a('0x62')]||!_0x4ff002[_0x414a('0x57')]){_0x3832a7=path[_0x414a('0x5e')](config['root'],_0x4711ad,_[_0x414a('0x5f')](_0x414a('0x6e')));}if(!fs[_0x414a('0x5c')](_0x3832a7)){throw new db['Sequelize'][(_0x414a('0x64'))](_[_0x414a('0x61')](_0x414a('0x57'))+_0x414a('0x6a'));}return _0x5bf577[_0x414a('0x65')](_0x3832a7);}})[_0x414a('0x23')](handleError(_0x5bf577,null));};exports[_0x414a('0x6f')]=function(_0x57dc9f,_0x5d5d30,_0x2937bc){if(_0x57dc9f[_0x414a('0x51')]&&_0x57dc9f[_0x414a('0x51')]['filename']){_0x57dc9f['body'][_0x414a('0x58')]=_0x57dc9f['file'][_0x414a('0x53')];}return db[_0x414a('0x34')][_0x414a('0x4e')]({'where':{'id':_0x57dc9f['params']['id']}})[_0x414a('0x30')](handleEntityNotFound(_0x5d5d30,null))['then'](saveUpdates(_0x57dc9f['body'],null))[_0x414a('0x30')](respondWithResult(_0x5d5d30,null))[_0x414a('0x23')](handleError(_0x5d5d30,null));};var utilLicense=require(_0x414a('0x15'));exports['getFavicon']=function(_0x265d80,_0x1b1e9a,_0x4e6e29){var _0x36fbb2=_0x414a('0x67');var _0x3fba98={'custom':![]};return utilLicense[_0x414a('0x55')]()[_0x414a('0x30')](function(_0x54d5bc){if(_0x54d5bc){_0x3fba98=_0x54d5bc;}return db[_0x414a('0x34')][_0x414a('0x4e')]({'where':{'id':_0x265d80[_0x414a('0x4c')]['id']},'attributes':[_0x414a('0x52'),_0x414a('0x56'),'preferred',_0x414a('0x58'),'defaultLogo','defaultLoginLogo',_0x414a('0x5a'),'defaultFavicon'],'raw':!![]});})[_0x414a('0x30')](handleEntityNotFound(_0x1b1e9a,null))[_0x414a('0x30')](function(_0x3f90cb){if(_0x3f90cb){var _0x264ebf=_0x3f90cb[_0x414a('0x58')]&&fs[_0x414a('0x5c')](path['join'](config[_0x414a('0x5d')],_0x36fbb2,_[_0x414a('0x5f')](_0x3f90cb[_0x414a('0x58')])))?path['join'](config[_0x414a('0x5d')],_0x36fbb2,_['toLower'](_0x3f90cb[_0x414a('0x58')])):path[_0x414a('0x5e')](config['root'],_0x36fbb2,_[_0x414a('0x5f')]('default_favicon.ico'));var _0x114550=_0x414a('0x60')+_[_0x414a('0x61')](_0x414a('0x58'));if(_0x3f90cb[_0x114550]||!_0x3fba98['custom']){_0x264ebf=path[_0x414a('0x5e')](config[_0x414a('0x5d')],_0x36fbb2,_[_0x414a('0x5f')](_0x414a('0x70')));}if(!fs[_0x414a('0x5c')](_0x264ebf)){throw new db['Sequelize'][(_0x414a('0x64'))](_[_0x414a('0x61')](_0x414a('0x58'))+_0x414a('0x6a'));}return _0x1b1e9a[_0x414a('0x65')](_0x264ebf);}})[_0x414a('0x23')](handleError(_0x1b1e9a,null));};exports[_0x414a('0x71')]=function(_0x98c305,_0x5f0fac){var _0x2a469f={'offset':moment()['utcOffset']()};_0x2a469f[_0x414a('0x72')]=moment()['utcOffset'](_0x2a469f['offset'])['format'](_0x414a('0x73'));return _0x5f0fac[_0x414a('0x25')](0xc8)[_0x414a('0x74')](_0x2a469f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a59227b..60bdde5 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x46b0ba,_0x5a767c){var _0x2e53e0=function(_0x124fb2){while(--_0x124fb2){_0x46b0ba['push'](_0x46b0ba['shift']());}};_0x2e53e0(++_0x5a767c);}(_0x008c,0x188));var _0xc008=function(_0x5e9e5f,_0x19aeeb){_0x5e9e5f=_0x5e9e5f-0x0;var _0x4944f5=_0x008c[_0x5e9e5f];return _0x4944f5;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 38fc1b9..b3a8961 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 _0x2016=['map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','options','raw','where','attributes','include'];(function(_0x27e729,_0x5b9bab){var _0xe6a802=function(_0xdc719c){while(--_0xdc719c){_0x27e729['push'](_0x27e729['shift']());}};_0xe6a802(++_0x5b9bab);}(_0x2016,0x179));var _0x6201=function(_0x5ea0cf,_0x3639f0){_0x5ea0cf=_0x5ea0cf-0x0;var _0x17ab63=_0x2016[_0x5ea0cf];return _0x17ab63;};'use strict';var _=require(_0x6201('0x0'));var util=require(_0x6201('0x1'));var moment=require(_0x6201('0x2'));var BPromise=require('bluebird');var rs=require(_0x6201('0x3'));var fs=require('fs');var Redis=require(_0x6201('0x4'));var db=require(_0x6201('0x5'))['db'];var utils=require(_0x6201('0x6'));var logger=require(_0x6201('0x7'))(_0x6201('0x8'));var config=require(_0x6201('0x9'));var jayson=require(_0x6201('0xa'));var client=jayson[_0x6201('0xb')][_0x6201('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3581c2,_0x5562ac,_0x487044){return new BPromise(function(_0x5f041d,_0x3855aa){return client[_0x6201('0xd')](_0x3581c2,_0x487044)[_0x6201('0xe')](function(_0x11c9f1){logger[_0x6201('0xf')](_0x6201('0x10'),_0x5562ac,_0x6201('0x11'));logger['debug'](_0x6201('0x12'),_0x5562ac,'request\x20sent',JSON[_0x6201('0x13')](_0x11c9f1));if(_0x11c9f1[_0x6201('0x14')]){if(_0x11c9f1[_0x6201('0x14')][_0x6201('0x15')]===0x1f4){logger[_0x6201('0x14')](_0x6201('0x10'),_0x5562ac,_0x11c9f1[_0x6201('0x14')]['message']);return _0x3855aa(_0x11c9f1[_0x6201('0x14')][_0x6201('0x16')]);}logger['error'](_0x6201('0x10'),_0x5562ac,_0x11c9f1[_0x6201('0x14')][_0x6201('0x16')]);return _0x5f041d(_0x11c9f1[_0x6201('0x14')][_0x6201('0x16')]);}else{logger[_0x6201('0xf')]('Setting,\x20%s,\x20%s',_0x5562ac,_0x6201('0x11'));_0x5f041d(_0x11c9f1[_0x6201('0x17')][_0x6201('0x16')]);}})[_0x6201('0x18')](function(_0x1ab43b){logger[_0x6201('0x14')](_0x6201('0x10'),_0x5562ac,_0x1ab43b);_0x3855aa(_0x1ab43b);});});}exports[_0x6201('0x19')]=function(_0x41d66e){var _0x40b576=this;return new Promise(function(_0x476ad8,_0x3b8624){return db['Setting']['find']({'raw':_0x41d66e[_0x6201('0x1a')]?_0x41d66e[_0x6201('0x1a')][_0x6201('0x1b')]===undefined?!![]:![]:!![],'where':_0x41d66e['options']?_0x41d66e[_0x6201('0x1a')][_0x6201('0x1c')]||null:null,'attributes':_0x41d66e[_0x6201('0x1a')]?_0x41d66e['options'][_0x6201('0x1d')]||null:null,'include':_0x41d66e[_0x6201('0x1a')]?_0x41d66e[_0x6201('0x1a')][_0x6201('0x1e')]?_['map'](_0x41d66e[_0x6201('0x1a')]['include'],function(_0x325f25){return{'model':db[_0x325f25['model']],'as':_0x325f25['as'],'attributes':_0x325f25['attributes'],'include':_0x325f25[_0x6201('0x1e')]?_[_0x6201('0x1f')](_0x325f25[_0x6201('0x1e')],function(_0x422b5f){return{'model':db[_0x422b5f[_0x6201('0x20')]],'as':_0x422b5f['as'],'attributes':_0x422b5f[_0x6201('0x1d')],'include':_0x422b5f['include']?_[_0x6201('0x1f')](_0x422b5f[_0x6201('0x1e')],function(_0x10cb94){return{'model':db[_0x10cb94[_0x6201('0x20')]],'as':_0x10cb94['as'],'attributes':_0x10cb94[_0x6201('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22d93d){logger['info'](_0x6201('0x19'),_0x41d66e);logger[_0x6201('0x21')](_0x6201('0x19'),_0x41d66e,JSON[_0x6201('0x13')](_0x22d93d));_0x476ad8(_0x22d93d);})[_0x6201('0x18')](function(_0x1e0b09){logger['error'](_0x6201('0x19'),_0x1e0b09[_0x6201('0x16')],_0x41d66e);_0x3b8624(_0x40b576[_0x6201('0x14')](0x1f4,_0x1e0b09[_0x6201('0x16')]));});});}; \ No newline at end of file +var _0x9002=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','ShowSetting','Setting','find','options','where','attributes','include','map','model','stringify','lodash','util','moment'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9002,0xa5));var _0x2900=function(_0x5cce81,_0x418807){_0x5cce81=_0x5cce81-0x0;var _0x4d622e=_0x9002[_0x5cce81];return _0x4d622e;};'use strict';var _=require(_0x2900('0x0'));var util=require(_0x2900('0x1'));var moment=require(_0x2900('0x2'));var BPromise=require('bluebird');var rs=require(_0x2900('0x3'));var fs=require('fs');var Redis=require(_0x2900('0x4'));var db=require(_0x2900('0x5'))['db'];var utils=require(_0x2900('0x6'));var logger=require(_0x2900('0x7'))('rpc');var config=require(_0x2900('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x62f7c6,_0x4a395d,_0x3468ad){return new BPromise(function(_0x4cc27a,_0x5a58ae){return client[_0x2900('0x9')](_0x62f7c6,_0x3468ad)[_0x2900('0xa')](function(_0x252334){logger[_0x2900('0xb')](_0x2900('0xc'),_0x4a395d,_0x2900('0xd'));logger[_0x2900('0xe')](_0x2900('0xf'),_0x4a395d,_0x2900('0xd'),JSON['stringify'](_0x252334));if(_0x252334[_0x2900('0x10')]){if(_0x252334['error']['code']===0x1f4){logger[_0x2900('0x10')](_0x2900('0xc'),_0x4a395d,_0x252334[_0x2900('0x10')][_0x2900('0x11')]);return _0x5a58ae(_0x252334['error'][_0x2900('0x11')]);}logger[_0x2900('0x10')]('Setting,\x20%s,\x20%s',_0x4a395d,_0x252334[_0x2900('0x10')][_0x2900('0x11')]);return _0x4cc27a(_0x252334['error'][_0x2900('0x11')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4a395d,'request\x20sent');_0x4cc27a(_0x252334['result'][_0x2900('0x11')]);}})['catch'](function(_0x36c5b7){logger['error'](_0x2900('0xc'),_0x4a395d,_0x36c5b7);_0x5a58ae(_0x36c5b7);});});}exports[_0x2900('0x12')]=function(_0xa4981){var _0x45fee4=this;return new Promise(function(_0x27204d,_0x16e81c){return db[_0x2900('0x13')][_0x2900('0x14')]({'raw':_0xa4981[_0x2900('0x15')]?_0xa4981[_0x2900('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xa4981[_0x2900('0x15')]?_0xa4981['options'][_0x2900('0x16')]||null:null,'attributes':_0xa4981[_0x2900('0x15')]?_0xa4981[_0x2900('0x15')][_0x2900('0x17')]||null:null,'include':_0xa4981['options']?_0xa4981[_0x2900('0x15')][_0x2900('0x18')]?_[_0x2900('0x19')](_0xa4981[_0x2900('0x15')][_0x2900('0x18')],function(_0x463307){return{'model':db[_0x463307[_0x2900('0x1a')]],'as':_0x463307['as'],'attributes':_0x463307[_0x2900('0x17')],'include':_0x463307[_0x2900('0x18')]?_['map'](_0x463307[_0x2900('0x18')],function(_0x1abcfc){return{'model':db[_0x1abcfc['model']],'as':_0x1abcfc['as'],'attributes':_0x1abcfc['attributes'],'include':_0x1abcfc[_0x2900('0x18')]?_[_0x2900('0x19')](_0x1abcfc['include'],function(_0x171549){return{'model':db[_0x171549[_0x2900('0x1a')]],'as':_0x171549['as'],'attributes':_0x171549[_0x2900('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2900('0xa')](function(_0x5efec1){logger[_0x2900('0xb')]('ShowSetting',_0xa4981);logger[_0x2900('0xe')]('ShowSetting',_0xa4981,JSON[_0x2900('0x1b')](_0x5efec1));_0x27204d(_0x5efec1);})['catch'](function(_0x30be5a){logger[_0x2900('0x10')](_0x2900('0x12'),_0x30be5a[_0x2900('0x11')],_0xa4981);_0x16e81c(_0x45fee4[_0x2900('0x10')](0x1f4,_0x30be5a[_0x2900('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 3c6478e..6ff181d 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x27487a,_0x5923cb){var _0x5dbded=function(_0x54d13d){while(--_0x54d13d){_0x27487a['push'](_0x27487a['shift']());}};_0x5dbded(++_0x5923cb);}(_0x8ef6,0xf2));var _0x68ef=function(_0x176103,_0x342154){_0x176103=_0x176103-0x0;var _0x5180c2=_0x8ef6[_0x176103];return _0x5180c2;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x33ccef,_0x3ad9dc){var _0x46440c=function(_0x4f8cac){while(--_0x4f8cac){_0x33ccef['push'](_0x33ccef['shift']());}};_0x46440c(++_0x3ad9dc);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3b3295,_0x5d28d9){_0x3b3295=_0x3b3295-0x0;var _0x28f5e6=_0x7fbe[_0x3b3295];return _0x28f5e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index bb147e9..1f684ef 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 _0x30d3=['intelepeer','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip'];(function(_0x2e1b41,_0x17914a){var _0x163368=function(_0x1b2c7e){while(--_0x1b2c7e){_0x2e1b41['push'](_0x2e1b41['shift']());}};_0x163368(++_0x17914a);}(_0x30d3,0x1d7));var _0x330d=function(_0x25dad5,_0x2f9368){_0x25dad5=_0x25dad5-0x0;var _0x4cb559=_0x30d3[_0x25dad5];return _0x4cb559;};'use strict';var Sequelize=require(_0x330d('0x0'));var rs=require(_0x330d('0x1'));module[_0x330d('0x2')]={'name':{'type':Sequelize[_0x330d('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x330d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x330d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x330d('0x3')],'defaultValue':function(){return rs[_0x330d('0x4')]();}},'phone':{'type':Sequelize[_0x330d('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x330d('0x5'),_0x330d('0x6'),_0x330d('0x7'),_0x330d('0x8'),_0x330d('0x9'),_0x330d('0xa'),_0x330d('0xb'),_0x330d('0xc'),_0x330d('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x330d('0x3')]},'authToken':{'type':Sequelize[_0x330d('0x3')]},'smsMethod':{'type':Sequelize[_0x330d('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0x330d('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x330d('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x330d('0x3')]},'senderString':{'type':Sequelize[_0x330d('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x330d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x330d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x330d('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x330d('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x330d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x330d('0x11')],'comment':_0x330d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x330d('0x10')],'defaultValue':![],'comment':_0x330d('0x13'),'set':function(_0xad44e7){if(!_0xad44e7)this[_0x330d('0x14')](_0x330d('0x15'),null);this[_0x330d('0x14')]('mandatoryDisposition',_0xad44e7);}}}; \ No newline at end of file +var _0x65ca=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT'];(function(_0xb0bf37,_0x34c20b){var _0x3835c5=function(_0x2e1b84){while(--_0x2e1b84){_0xb0bf37['push'](_0xb0bf37['shift']());}};_0x3835c5(++_0x34c20b);}(_0x65ca,0xc6));var _0xa65c=function(_0x516510,_0x48f18a){_0x516510=_0x516510-0x0;var _0x5c5246=_0x65ca[_0x516510];return _0x5c5246;};'use strict';var Sequelize=require(_0xa65c('0x0'));var rs=require(_0xa65c('0x1'));module[_0xa65c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa65c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa65c('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xa65c('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xa65c('0x4')],'defaultValue':function(){return rs[_0xa65c('0x5')]();}},'phone':{'type':Sequelize[_0xa65c('0x4')]},'type':{'type':Sequelize['ENUM'](_0xa65c('0x6'),_0xa65c('0x7'),_0xa65c('0x8'),'clicksend',_0xa65c('0x9'),_0xa65c('0xa'),_0xa65c('0xb'),_0xa65c('0xc'),_0xa65c('0xd'),_0xa65c('0xe'))},'accountSid':{'type':Sequelize[_0xa65c('0x4')]},'authId':{'type':Sequelize[_0xa65c('0x4')]},'authToken':{'type':Sequelize[_0xa65c('0x4')]},'smsMethod':{'type':Sequelize[_0xa65c('0xf')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa65c('0x4')]},'apiKey':{'type':Sequelize[_0xa65c('0x4')]},'applicationId':{'type':Sequelize[_0xa65c('0x4')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xa65c('0x4')]},'deliveryReport':{'type':Sequelize[_0xa65c('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xa65c('0x4')]},'notificationTemplate':{'type':Sequelize[_0xa65c('0x11')],'defaultValue':function(){return _0xa65c('0x12');}},'notificationSound':{'type':Sequelize[_0xa65c('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa65c('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa65c('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa65c('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa65c('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa65c('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa65c('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa65c('0x13')],'comment':_0xa65c('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa65c('0x15'),'set':function(_0x18a378){if(!_0x18a378)this[_0xa65c('0x16')]('mandatoryDispositionPauseId',null);this[_0xa65c('0x16')](_0xa65c('0x17'),_0x18a378);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ca0d7c1..b2520ec 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 _0xd774=['update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','account','orderBy','priority','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','Body','MessageSid','skebby','text','connectel','clicksend','messageId','plivo','From','Text','MessageUUID','infobip','results','segmentedMessage','fromNumber','replyMessageId','bandwidth','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','DESC','omit','Contacts','SmsInteraction','spread','interaction','autoclose','applications','push','unmanaged','*,*,*,*','created','SmsMessage','ContactId','UserId','unshift','agent','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','findOne','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','internal','Tag','Tags','color','tag','CmList','List','out','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','message_id','groupName','DELIVERED','clickatell','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','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','limit','undefined','count','set','Content-Range','reject','save'];(function(_0xb4bed2,_0x1ba3db){var _0x17a2a5=function(_0x3957c1){while(--_0x3957c1){_0xb4bed2['push'](_0xb4bed2['shift']());}};_0x17a2a5(++_0x1ba3db);}(_0xd774,0xa8));var _0x4d77=function(_0x2f9160,_0x4e0325){_0x2f9160=_0x2f9160-0x0;var _0xe0be91=_0xd774[_0x2f9160];return _0xe0be91;};'use strict';var emlformat=require(_0x4d77('0x0'));var rimraf=require(_0x4d77('0x1'));var zipdir=require(_0x4d77('0x2'));var jsonpatch=require(_0x4d77('0x3'));var rp=require(_0x4d77('0x4'));var moment=require(_0x4d77('0x5'));var BPromise=require(_0x4d77('0x6'));var Mustache=require(_0x4d77('0x7'));var util=require(_0x4d77('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x4d77('0x9'));var ejs=require(_0x4d77('0xa'));var fs=require('fs');var fs_extra=require(_0x4d77('0xb'));var _=require('lodash');var squel=require(_0x4d77('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d77('0xd'));var deskjs=require(_0x4d77('0xe'));var toCsv=require(_0x4d77('0x9'));var querystring=require('querystring');var Papa=require(_0x4d77('0xf'));var Redis=require(_0x4d77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4d77('0x11'));var as=require(_0x4d77('0x12'));var hardwareService=require(_0x4d77('0x13'));var logger=require(_0x4d77('0x14'))(_0x4d77('0x15'));var utils=require(_0x4d77('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4d77('0x17'))['db'];config['redis']=_[_0x4d77('0x18')](config[_0x4d77('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d77('0x1a'))(new Redis(config[_0x4d77('0x19')]));require(_0x4d77('0x1b'))['register'](socket);var jayson=require(_0x4d77('0x1c'));var client=jayson[_0x4d77('0x1d')][_0x4d77('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x1f7cb2,_0x38d62c,_0x192b36,_0x242c1b){return new BPromise(function(_0x218db1,_0x47ecf7){var _0x21215a=_0x242c1b||client;return _0x21215a[_0x4d77('0x1f')](_0x1f7cb2,_0x192b36)['then'](function(_0x2c1b52){logger[_0x4d77('0x20')](_0x4d77('0x21'),_0x38d62c,_0x4d77('0x22'));logger[_0x4d77('0x23')](_0x4d77('0x24'),_0x38d62c,'request\x20sent',JSON[_0x4d77('0x25')](_0x2c1b52));if(_0x2c1b52[_0x4d77('0x26')]){if(_0x2c1b52[_0x4d77('0x26')][_0x4d77('0x27')]===0x1f4){logger[_0x4d77('0x26')]('SmsAccount,\x20%s,\x20%s',_0x38d62c,_0x2c1b52['error']['message']);return _0x47ecf7(_0x2c1b52[_0x4d77('0x26')]['message']);}logger[_0x4d77('0x26')](_0x4d77('0x21'),_0x38d62c,_0x2c1b52[_0x4d77('0x26')][_0x4d77('0x28')]);return _0x218db1(_0x2c1b52['error'][_0x4d77('0x28')]);}else{logger[_0x4d77('0x20')](_0x4d77('0x21'),_0x38d62c,'request\x20sent');_0x218db1(_0x2c1b52[_0x4d77('0x29')][_0x4d77('0x28')]);}})[_0x4d77('0x2a')](function(_0x4b79a6){logger[_0x4d77('0x26')](_0x4d77('0x21'),_0x38d62c,_0x4b79a6);_0x47ecf7(_0x4b79a6);});});}function respondWithStatusCode(_0x30c31b,_0x56851b){_0x56851b=_0x56851b||0xcc;return function(_0x158dcc){if(_0x158dcc){return _0x30c31b[_0x4d77('0x2b')](_0x56851b);}return _0x30c31b[_0x4d77('0x2c')](_0x56851b)[_0x4d77('0x2d')]();};}function respondWithResult(_0x3e5787,_0x2fdb77){_0x2fdb77=_0x2fdb77||0xc8;return function(_0x44c10a){if(_0x44c10a){return _0x3e5787[_0x4d77('0x2c')](_0x2fdb77)[_0x4d77('0x2e')](_0x44c10a);}};}function respondWithFilteredResult(_0x3bdc0e,_0x24e692){return function(_0x5e50b2){if(_0x5e50b2){var _0x4f83ea=typeof _0x24e692[_0x4d77('0x2f')]==='undefined'&&typeof _0x24e692[_0x4d77('0x30')]===_0x4d77('0x31');var _0x10a3f7=_0x5e50b2['count'];var _0x288ad2=_0x4f83ea?0x0:_0x24e692[_0x4d77('0x2f')];var _0x362500=_0x4f83ea?_0x5e50b2[_0x4d77('0x32')]:_0x24e692[_0x4d77('0x2f')]+_0x24e692[_0x4d77('0x30')];var _0x23f680;if(_0x362500>=_0x10a3f7){_0x362500=_0x10a3f7;_0x23f680=0xc8;}else{_0x23f680=0xce;}_0x3bdc0e['status'](_0x23f680);return _0x3bdc0e[_0x4d77('0x33')](_0x4d77('0x34'),_0x288ad2+'-'+_0x362500+'/'+_0x10a3f7)['json'](_0x5e50b2);}return null;};}function patchUpdates(_0xeffb0b){return function(_0x4d7106){try{jsonpatch['apply'](_0x4d7106,_0xeffb0b,!![]);}catch(_0x2214e1){return BPromise[_0x4d77('0x35')](_0x2214e1);}return _0x4d7106[_0x4d77('0x36')]();};}function saveUpdates(_0x503546,_0x353665){return function(_0x4ba5c9){if(_0x4ba5c9){return _0x4ba5c9[_0x4d77('0x37')](_0x503546)[_0x4d77('0x38')](function(_0x235173){return _0x235173;});}return null;};}function removeEntity(_0x4f0079,_0x527fa3){return function(_0x273f99){if(_0x273f99){return _0x273f99[_0x4d77('0x39')]()[_0x4d77('0x38')](function(){var _0x44dd34=_0x273f99[_0x4d77('0x3a')]({'plain':!![]});var _0x1c3d75=_0x4d77('0x3b');return db[_0x4d77('0x3c')][_0x4d77('0x39')]({'where':{'type':_0x1c3d75,'resourceId':_0x44dd34['id']}})[_0x4d77('0x38')](function(){return _0x273f99;});})[_0x4d77('0x38')](function(){_0x4f0079[_0x4d77('0x2c')](0xcc)[_0x4d77('0x2d')]();});}};}function handleEntityNotFound(_0x557ca8,_0x32b40a){return function(_0x1e653b){if(!_0x1e653b){_0x557ca8[_0x4d77('0x2b')](0x194);}return _0x1e653b;};}function handleError(_0x3e3b78,_0x3b6180){_0x3b6180=_0x3b6180||0x1f4;return function(_0x40fc5e){logger[_0x4d77('0x26')](_0x40fc5e[_0x4d77('0x3d')]);if(_0x40fc5e[_0x4d77('0x3e')]){delete _0x40fc5e[_0x4d77('0x3e')];}_0x3e3b78[_0x4d77('0x2c')](_0x3b6180)[_0x4d77('0x3f')](_0x40fc5e);};}exports[_0x4d77('0x40')]=function(_0x52a5d5,_0x583b89){var _0x47bad7={'include':[{'model':db[_0x4d77('0x41')],'as':_0x4d77('0x42')}]},_0x3e3fca={},_0x4bb385={'count':0x0,'rows':[]};var _0xde7d77=_[_0x4d77('0x43')](db[_0x4d77('0x44')]['rawAttributes'],function(_0xf8af8c){return{'name':_0xf8af8c[_0x4d77('0x45')],'type':_0xf8af8c[_0x4d77('0x46')][_0x4d77('0x47')]};});_0x3e3fca['model']=_[_0x4d77('0x43')](_0xde7d77,_0x4d77('0x3e'));_0x3e3fca[_0x4d77('0x48')]=_['keys'](_0x52a5d5[_0x4d77('0x48')]);_0x3e3fca[_0x4d77('0x49')]=_[_0x4d77('0x4a')](_0x3e3fca[_0x4d77('0x4b')],_0x3e3fca[_0x4d77('0x48')]);_0x47bad7[_0x4d77('0x4c')]=_[_0x4d77('0x4a')](_0x3e3fca[_0x4d77('0x4b')],qs['fields'](_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x4d')]));_0x47bad7[_0x4d77('0x4c')]=_0x47bad7[_0x4d77('0x4c')][_0x4d77('0x4e')]?_0x47bad7['attributes']:_0x3e3fca[_0x4d77('0x4b')];if(!_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x4f')](_0x4d77('0x50'))){_0x47bad7[_0x4d77('0x30')]=qs['limit'](_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x30')]);_0x47bad7['offset']=qs[_0x4d77('0x2f')](_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x2f')]);}_0x47bad7[_0x4d77('0x51')]=qs[_0x4d77('0x52')](_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x52')]);_0x47bad7[_0x4d77('0x53')]=qs[_0x4d77('0x49')](_[_0x4d77('0x54')](_0x52a5d5['query'],_0x3e3fca[_0x4d77('0x49')]),_0xde7d77);if(_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x55')]){_0x47bad7[_0x4d77('0x53')]=_[_0x4d77('0x56')](_0x47bad7[_0x4d77('0x53')],{'$or':_[_0x4d77('0x43')](_0xde7d77,function(_0x3567c5){if(_0x3567c5['type']!==_0x4d77('0x57')){var _0xab2f8c={};_0xab2f8c[_0x3567c5['name']]={'$like':'%'+_0x52a5d5[_0x4d77('0x48')][_0x4d77('0x55')]+'%'};return _0xab2f8c;}})});}_0x47bad7=_[_0x4d77('0x56')]({},_0x47bad7,_0x52a5d5['options']);var _0x58d0ec={'where':_0x47bad7[_0x4d77('0x53')]};return db[_0x4d77('0x44')][_0x4d77('0x32')](_0x58d0ec)[_0x4d77('0x38')](function(_0x33ef11){_0x4bb385[_0x4d77('0x32')]=_0x33ef11;if(_0x52a5d5['query'][_0x4d77('0x58')]){_0x47bad7[_0x4d77('0x59')]=[{'all':!![]}];}return db[_0x4d77('0x44')][_0x4d77('0x5a')](_0x47bad7);})['then'](function(_0x51011f){_0x4bb385[_0x4d77('0x5b')]=_0x51011f;return _0x4bb385;})[_0x4d77('0x38')](respondWithFilteredResult(_0x583b89,_0x47bad7))['catch'](handleError(_0x583b89,null));};exports[_0x4d77('0x5c')]=function(_0x227271,_0x15b15a){var _0x29bd76={'raw':![],'where':{'id':_0x227271[_0x4d77('0x5d')]['id']},'include':[{'model':db[_0x4d77('0x41')],'as':_0x4d77('0x42')}]},_0x2912ea={};_0x2912ea[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db['SmsAccount'][_0x4d77('0x5f')]);_0x2912ea[_0x4d77('0x48')]=_[_0x4d77('0x5e')](_0x227271[_0x4d77('0x48')]);_0x2912ea['filters']=_[_0x4d77('0x4a')](_0x2912ea[_0x4d77('0x4b')],_0x2912ea[_0x4d77('0x48')]);_0x29bd76['attributes']=_[_0x4d77('0x4a')](_0x2912ea[_0x4d77('0x4b')],qs[_0x4d77('0x4d')](_0x227271[_0x4d77('0x48')][_0x4d77('0x4d')]));_0x29bd76[_0x4d77('0x4c')]=_0x29bd76['attributes'][_0x4d77('0x4e')]?_0x29bd76[_0x4d77('0x4c')]:_0x2912ea['model'];if(_0x227271[_0x4d77('0x48')]['includeAll']){_0x29bd76['include']=[{'all':!![]}];}_0x29bd76=_[_0x4d77('0x56')]({},_0x29bd76,_0x227271[_0x4d77('0x60')]);return db[_0x4d77('0x44')][_0x4d77('0x61')](_0x29bd76)[_0x4d77('0x38')](handleEntityNotFound(_0x15b15a,null))[_0x4d77('0x38')](respondWithResult(_0x15b15a,null))[_0x4d77('0x2a')](handleError(_0x15b15a,null));};exports[_0x4d77('0x62')]=function(_0x17788d,_0x9ea944){return db['SmsAccount'][_0x4d77('0x62')](_0x17788d[_0x4d77('0x63')],{})[_0x4d77('0x38')](function(_0x379445){var _0x5111fd=_0x17788d[_0x4d77('0x64')][_0x4d77('0x3a')]({'plain':!![]});if(!_0x5111fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5111fd[_0x4d77('0x65')]===_0x4d77('0x64')){var _0x25c99e=_0x379445[_0x4d77('0x3a')]({'plain':!![]});var _0x5596a1=_0x4d77('0x3b');return db[_0x4d77('0x66')][_0x4d77('0x61')]({'where':{'name':_0x5596a1,'userProfileId':_0x5111fd[_0x4d77('0x67')]},'raw':!![]})['then'](function(_0x327afb){if(_0x327afb&&_0x327afb['autoAssociation']===0x0){return db[_0x4d77('0x3c')]['create']({'name':_0x25c99e[_0x4d77('0x3e')],'resourceId':_0x25c99e['id'],'type':_0x327afb['name'],'sectionId':_0x327afb['id']},{})[_0x4d77('0x38')](function(){return _0x379445;});}else{return _0x379445;}})[_0x4d77('0x2a')](function(_0x383f3f){logger['error'](_0x4d77('0x68'),_0x383f3f);throw _0x383f3f;});}return _0x379445;})[_0x4d77('0x38')](respondWithResult(_0x9ea944,0xc9))['catch'](handleError(_0x9ea944,null));};exports['update']=function(_0x5abe3a,_0x25a196){if(_0x5abe3a['body']['id']){delete _0x5abe3a[_0x4d77('0x63')]['id'];}return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x5abe3a[_0x4d77('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x4d77('0x42')}]})[_0x4d77('0x38')](handleEntityNotFound(_0x25a196,null))['then'](saveUpdates(_0x5abe3a[_0x4d77('0x63')],null))[_0x4d77('0x38')](respondWithResult(_0x25a196,null))['catch'](handleError(_0x25a196,null));};exports[_0x4d77('0x39')]=function(_0x3655d6,_0x32e2ca){return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x3655d6['params']['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x32e2ca,null))['then'](removeEntity(_0x32e2ca,null))[_0x4d77('0x2a')](handleError(_0x32e2ca,null));};exports[_0x4d77('0x69')]=function(_0x36e6b0,_0x3ce559){return db[_0x4d77('0x44')]['describe']()[_0x4d77('0x38')](respondWithResult(_0x3ce559,null))[_0x4d77('0x2a')](handleError(_0x3ce559,null));};exports[_0x4d77('0x6a')]=function(_0xba0d1e,_0x4ab9cf,_0x284e29){if(_0xba0d1e[_0x4d77('0x63')]['id']){delete _0xba0d1e[_0x4d77('0x63')]['id'];}return db[_0x4d77('0x44')]['find']({'where':{'id':_0xba0d1e[_0x4d77('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4ab9cf,null))['then'](function(_0x32554c){if(_0x32554c){_0xba0d1e[_0x4d77('0x63')][_0x4d77('0x6b')]=_0x32554c['id'];return db[_0x4d77('0x6c')]['create'](_0xba0d1e['body']);}})[_0x4d77('0x38')](respondWithResult(_0x4ab9cf,null))[_0x4d77('0x2a')](handleError(_0x4ab9cf,null));};exports[_0x4d77('0x6d')]=function(_0x348e99,_0x53611a,_0x262d82){var _0x704bb9={'raw':![],'where':{}};var _0x8f7053={};var _0x59e317={'count':0x0,'rows':[]};return db[_0x4d77('0x44')]['findOne']({'where':{'id':_0x348e99[_0x4d77('0x5d')]['id']}})['then'](handleEntityNotFound(_0x53611a,null))[_0x4d77('0x38')](function(_0x438be7){if(_0x438be7){_0x8f7053[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db[_0x4d77('0x6c')][_0x4d77('0x5f')]);_0x8f7053[_0x4d77('0x48')]=_[_0x4d77('0x5e')](_0x348e99[_0x4d77('0x48')]);_0x8f7053[_0x4d77('0x49')]=_[_0x4d77('0x4a')](_0x8f7053['model'],_0x8f7053['query']);_0x704bb9['attributes']=_['intersection'](_0x8f7053[_0x4d77('0x4b')],qs[_0x4d77('0x4d')](_0x348e99['query'][_0x4d77('0x4d')]));_0x704bb9[_0x4d77('0x4c')]=_0x704bb9['attributes'][_0x4d77('0x4e')]?_0x704bb9[_0x4d77('0x4c')]:_0x8f7053[_0x4d77('0x4b')];if(!_0x348e99[_0x4d77('0x48')][_0x4d77('0x4f')]('nolimit')){_0x704bb9['limit']=qs[_0x4d77('0x30')](_0x348e99['query'][_0x4d77('0x30')]);_0x704bb9[_0x4d77('0x2f')]=qs[_0x4d77('0x2f')](_0x348e99[_0x4d77('0x48')][_0x4d77('0x2f')]);}_0x704bb9[_0x4d77('0x51')]=qs[_0x4d77('0x52')](_0x348e99[_0x4d77('0x48')]['sort']);_0x704bb9['where']=qs[_0x4d77('0x49')](_[_0x4d77('0x54')](_0x348e99[_0x4d77('0x48')],_0x8f7053[_0x4d77('0x49')]));_0x704bb9['where'][_0x4d77('0x6b')]=_0x438be7['id'];if(_0x348e99[_0x4d77('0x48')][_0x4d77('0x55')]){_0x704bb9['where']=_[_0x4d77('0x56')](_0x704bb9['where'],{'$or':_[_0x4d77('0x43')](_0x704bb9[_0x4d77('0x4c')],function(_0x5de030){var _0x261e1f={};_0x261e1f[_0x5de030]={'$like':'%'+_0x348e99[_0x4d77('0x48')][_0x4d77('0x55')]+'%'};return _0x261e1f;})});}_0x704bb9=_[_0x4d77('0x56')]({},_0x704bb9,_0x348e99['options']);return db[_0x4d77('0x6c')]['count']({'where':_0x704bb9['where']})[_0x4d77('0x38')](function(_0x16fc17){_0x59e317[_0x4d77('0x32')]=_0x16fc17;if(_0x348e99[_0x4d77('0x48')][_0x4d77('0x58')]){_0x704bb9[_0x4d77('0x59')]=[{'all':!![]}];}return db[_0x4d77('0x6c')]['findAll'](_0x704bb9);})[_0x4d77('0x38')](function(_0x30e5d8){_0x59e317[_0x4d77('0x5b')]=_0x30e5d8;return _0x59e317;});}})[_0x4d77('0x38')](respondWithFilteredResult(_0x53611a,_0x704bb9))[_0x4d77('0x2a')](handleError(_0x53611a,null));};exports[_0x4d77('0x6e')]=function(_0x22cc54,_0x1b580a,_0x899ee9){return db[_0x4d77('0x44')]['find']({'where':{'id':_0x22cc54[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x1b580a,null))['then'](function(_0x1f6e6c){if(_0x1f6e6c){return _0x1f6e6c['removeDispositions'](_0x22cc54[_0x4d77('0x48')][_0x4d77('0x6f')]);}})[_0x4d77('0x38')](respondWithStatusCode(_0x1b580a,null))[_0x4d77('0x2a')](handleError(_0x1b580a,null));};exports[_0x4d77('0x70')]=function(_0x3e5100,_0x17d119,_0x59d63e){if(_0x3e5100[_0x4d77('0x63')]['id']){delete _0x3e5100[_0x4d77('0x63')]['id'];}return db[_0x4d77('0x44')]['find']({'where':{'id':_0x3e5100[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x17d119,null))[_0x4d77('0x38')](function(_0xb3eca6){if(_0xb3eca6){_0x3e5100[_0x4d77('0x63')][_0x4d77('0x6b')]=_0xb3eca6['id'];return db[_0x4d77('0x71')]['create'](_0x3e5100[_0x4d77('0x63')]);}})[_0x4d77('0x38')](respondWithResult(_0x17d119,null))[_0x4d77('0x2a')](handleError(_0x17d119,null));};exports[_0x4d77('0x72')]=function(_0xd5a08d,_0x4486f1,_0x58769b){var _0x5f3cf2={'raw':![],'where':{}};var _0x329a8a={};var _0x2e332b={'count':0x0,'rows':[]};return db[_0x4d77('0x44')]['findOne']({'where':{'id':_0xd5a08d['params']['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x4486f1,null))['then'](function(_0x4c7c3f){if(_0x4c7c3f){_0x329a8a[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db['CannedAnswer'][_0x4d77('0x5f')]);_0x329a8a[_0x4d77('0x48')]=_[_0x4d77('0x5e')](_0xd5a08d[_0x4d77('0x48')]);_0x329a8a[_0x4d77('0x49')]=_[_0x4d77('0x4a')](_0x329a8a[_0x4d77('0x4b')],_0x329a8a[_0x4d77('0x48')]);_0x5f3cf2[_0x4d77('0x4c')]=_[_0x4d77('0x4a')](_0x329a8a[_0x4d77('0x4b')],qs[_0x4d77('0x4d')](_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x4d')]));_0x5f3cf2[_0x4d77('0x4c')]=_0x5f3cf2[_0x4d77('0x4c')]['length']?_0x5f3cf2[_0x4d77('0x4c')]:_0x329a8a[_0x4d77('0x4b')];if(!_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x4f')](_0x4d77('0x50'))){_0x5f3cf2[_0x4d77('0x30')]=qs[_0x4d77('0x30')](_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x30')]);_0x5f3cf2['offset']=qs[_0x4d77('0x2f')](_0xd5a08d['query'][_0x4d77('0x2f')]);}_0x5f3cf2[_0x4d77('0x51')]=qs[_0x4d77('0x52')](_0xd5a08d['query']['sort']);_0x5f3cf2[_0x4d77('0x53')]=qs[_0x4d77('0x49')](_[_0x4d77('0x54')](_0xd5a08d['query'],_0x329a8a['filters']));_0x5f3cf2[_0x4d77('0x53')]['SmsAccountId']=_0x4c7c3f['id'];if(_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x55')]){_0x5f3cf2['where']=_['merge'](_0x5f3cf2[_0x4d77('0x53')],{'$or':_[_0x4d77('0x43')](_0x5f3cf2['attributes'],function(_0x5a8b53){var _0x38220c={};_0x38220c[_0x5a8b53]={'$like':'%'+_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x55')]+'%'};return _0x38220c;})});}_0x5f3cf2=_[_0x4d77('0x56')]({},_0x5f3cf2,_0xd5a08d[_0x4d77('0x60')]);return db[_0x4d77('0x71')][_0x4d77('0x32')]({'where':_0x5f3cf2[_0x4d77('0x53')]})[_0x4d77('0x38')](function(_0x55fc02){_0x2e332b['count']=_0x55fc02;if(_0xd5a08d[_0x4d77('0x48')][_0x4d77('0x58')]){_0x5f3cf2[_0x4d77('0x59')]=[{'all':!![]}];}return db[_0x4d77('0x71')][_0x4d77('0x5a')](_0x5f3cf2);})[_0x4d77('0x38')](function(_0x36bd0f){_0x2e332b[_0x4d77('0x5b')]=_0x36bd0f;return _0x2e332b;});}})[_0x4d77('0x38')](respondWithFilteredResult(_0x4486f1,_0x5f3cf2))[_0x4d77('0x2a')](handleError(_0x4486f1,null));};exports['removeAnswers']=function(_0x171bc3,_0x1f5bf4,_0x375a4e){return db['SmsAccount']['find']({'where':{'id':_0x171bc3[_0x4d77('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1f5bf4,null))[_0x4d77('0x38')](function(_0x398ade){if(_0x398ade){return _0x398ade[_0x4d77('0x73')](_0x171bc3[_0x4d77('0x48')][_0x4d77('0x6f')]);}})['then'](respondWithStatusCode(_0x1f5bf4,null))['catch'](handleError(_0x1f5bf4,null));};exports[_0x4d77('0x74')]=function(_0x3b416f,_0x10e286,_0x27638d){var _0x3e75ab={'channel':'sms'};var _0x2696a1=[];var _0xbd97ab=[];var _0x25adf4={};return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x3b416f[_0x4d77('0x5d')]['id']},'include':[{'model':db[_0x4d77('0x75')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x10e286,null))[_0x4d77('0x38')](function(_0x5ec138){_0x3e75ab[_0x4d77('0x76')]=_0x5ec138;_0x3e75ab['applications']=_[_0x4d77('0x77')](_0x5ec138['Applications'],[_0x4d77('0x78')],[_0x4d77('0x79')]);if(_0x3e75ab['account'][_0x4d77('0x7a')]){delete _0x3e75ab['account'][_0x4d77('0x7a')];}return db[_0x4d77('0x7b')][_0x4d77('0x69')]();})['then'](function(_0x32464a){if(!_0x32464a){throw new db[(_0x4d77('0x7c'))][(_0x4d77('0x7d'))](_0x4d77('0x7e'));}_0x2696a1=_['difference'](_[_0x4d77('0x5e')](_0x32464a),[_0x4d77('0x7f'),_0x4d77('0x80')]);_0xbd97ab=_[_0x4d77('0x81')](_[_0x4d77('0x5e')](_0x32464a),[_0x4d77('0x7f'),'updatedAt',_0x4d77('0x82'),_0x4d77('0x83')]);_0x3e75ab[_0x4d77('0x63')]={'mapKey':'mobile'};if(_0x3e75ab[_0x4d77('0x76')][_0x4d77('0x46')]){switch(_0x3e75ab['account'][_0x4d77('0x46')]){case'twilio':_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')]=_0x3b416f[_0x4d77('0x63')]['From'];_0x3e75ab['body']['body']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x85')];_0x3e75ab[_0x4d77('0x63')]['messageId']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x86')];break;case _0x4d77('0x87'):_0x3e75ab[_0x4d77('0x63')]['from']='+'+_0x3b416f[_0x4d77('0x63')]['sender'];_0x3e75ab[_0x4d77('0x63')]['body']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x88')];break;case _0x4d77('0x89'):_0x3e75ab['body'][_0x4d77('0x84')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x84')];_0x3e75ab[_0x4d77('0x63')]['body']=_0x3b416f[_0x4d77('0x63')]['message'];break;case _0x4d77('0x8a'):_0x3e75ab[_0x4d77('0x63')]['from']=_0x3b416f[_0x4d77('0x63')]['from'];_0x3e75ab[_0x4d77('0x63')]['body']=_0x3b416f['body'][_0x4d77('0x63')];_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x8b')]=_0x3b416f[_0x4d77('0x63')]['message_id'];break;case _0x4d77('0x8c'):_0x3e75ab['body'][_0x4d77('0x84')]=_0x3b416f['body'][_0x4d77('0x8d')];_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x63')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x8e')];_0x3e75ab[_0x4d77('0x63')]['messageId']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x8f')];break;case _0x4d77('0x90'):_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')]='+'+_0x3b416f[_0x4d77('0x63')]['results'][0x0][_0x4d77('0x84')];_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x63')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x91')][0x0][_0x4d77('0x88')];_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x8b')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x91')][0x0][_0x4d77('0x8b')];break;case'csc':_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')]=_0x3b416f['body']['originatingAddress'];_0x3e75ab['body'][_0x4d77('0x63')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x92')][_0x4d77('0x28')];break;case'clickatell':_0x3e75ab[_0x4d77('0x63')]['from']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x93')];_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x63')]=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x88')];_0x3e75ab['body']['messageId']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x94')];break;case _0x4d77('0x95'):_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x8b')]=_0x3b416f[_0x4d77('0x63')][0x0]['message']['id'];_0x3e75ab[_0x4d77('0x63')]['from']=_0x3b416f[_0x4d77('0x63')][0x0][_0x4d77('0x28')][_0x4d77('0x84')];_0x3e75ab['body'][_0x4d77('0x63')]=_0x3b416f[_0x4d77('0x63')][0x0][_0x4d77('0x28')][_0x4d77('0x88')];break;case'intelepeer':_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')]=_0x3b416f['body'][_0x4d77('0x84')];_0x3e75ab[_0x4d77('0x63')]['body']=_0x3b416f[_0x4d77('0x63')][_0x4d77('0x28')];_0x3e75ab['body'][_0x4d77('0x8b')]=_0x3b416f[_0x4d77('0x63')]['refid'];break;}}if(_0x3e75ab[_0x4d77('0x63')]['id']){delete _0x3e75ab[_0x4d77('0x63')]['id'];}if(_[_0x4d77('0x96')](_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')])){throw new db[(_0x4d77('0x7c'))][(_0x4d77('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x4d77('0x96')](_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x63')])||_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x63')]===''){throw new db[(_0x4d77('0x7c'))][(_0x4d77('0x7d'))](_0x4d77('0x97'));}if(_[_0x4d77('0x96')](_0x3e75ab['body'][_0x4d77('0x98')])){throw new db['Sequelize']['ValidationError'](_0x4d77('0x99')+_0xbd97ab);}if(!_[_0x4d77('0x9a')](_0xbd97ab,_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x98')])){throw new db[(_0x4d77('0x7c'))][(_0x4d77('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbd97ab);}_0x25adf4[_0x3e75ab[_0x4d77('0x63')]['mapKey']]=_0x3e75ab['body'][_0x4d77('0x84')];return db['CmList'][_0x4d77('0x61')]({'where':{'id':_0x3e75ab[_0x4d77('0x76')][_0x4d77('0x83')]},'include':[{'model':db[_0x4d77('0x7b')],'as':'Contacts','where':_0x25adf4,'limit':0x1,'order':[['updatedAt',_0x4d77('0x9b')]]}]});})[_0x4d77('0x38')](handleEntityNotFound(_0x10e286,null))[_0x4d77('0x38')](function(_0xcd2aa2){if(_0xcd2aa2){_0x3e75ab['list']=_[_0x4d77('0x9c')](_0xcd2aa2,['Contacts']);if(_0xcd2aa2[_0x4d77('0x9d')][_0x4d77('0x4e')]){return _0xcd2aa2['Contacts'][0x0];}var _0xd20cb4=_['defaults'](_0x3e75ab['body'],{'firstName':_0x3e75ab[_0x4d77('0x63')]['from'],'ListId':_0xcd2aa2['id']});_0xd20cb4[_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x98')]]=_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')];return db[_0x4d77('0x7b')][_0x4d77('0x62')](_0xd20cb4,{'fields':_0x2696a1,'raw':!![]});}})['then'](handleEntityNotFound(_0x10e286,null))[_0x4d77('0x38')](function(_0x210ae4){if(_0x210ae4){_0x3e75ab['contact']=_0x210ae4;var _0x440c79={'ContactId':_0x210ae4['id'],'phone':_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')],'SmsAccountId':_0x3b416f[_0x4d77('0x5d')]['id']};var _0x448ff4={'ContactId':_0x210ae4['id'],'SmsAccountId':_0x3b416f[_0x4d77('0x5d')]['id'],'closed':![]};return db[_0x4d77('0x9e')][_0x4d77('0x61')]({'where':_0x448ff4})[_0x4d77('0x38')](function(_0x2e7e01){if(_0x2e7e01){return[_0x2e7e01,![]];}return db[_0x4d77('0x9e')][_0x4d77('0x62')](_0x440c79)[_0x4d77('0x38')](function(_0x32ff38){return[_0x32ff38,!![]];});});}})[_0x4d77('0x9f')](function(_0x2fe8f3,_0x3f0b6a){_0x3e75ab['interaction']=_0x2fe8f3[_0x4d77('0x3a')]({'plain':!![]});_0x3e75ab[_0x4d77('0xa0')]['created']=![];if(_0x3f0b6a){if(_0x3e75ab[_0x4d77('0x76')][_0x4d77('0xa1')]){_0x3e75ab[_0x4d77('0xa2')][_0x4d77('0xa3')]({'id':0x0,'priority':_0x3e75ab['applications'][_0x4d77('0x4e')]+0x1,'app':'close','appdata':_0x4d77('0xa4'),'interval':_0x4d77('0xa5')});}_0x3e75ab['interaction'][_0x4d77('0xa6')]=!![];}return db[_0x4d77('0xa7')]['create']({'phone':_0x3e75ab[_0x4d77('0x63')][_0x4d77('0x84')],'messageId':_0x3e75ab['body']['messageId'],'body':_0x3e75ab['body'][_0x4d77('0x63')],'SmsAccountId':_0x3b416f['params']['id'],'SmsInteractionId':_0x2fe8f3['id'],'direction':'in','ContactId':_0x2fe8f3[_0x4d77('0xa8')],'AttachmentId':_0x3e75ab[_0x4d77('0x63')]['AttachmentId']});})[_0x4d77('0x38')](function(_0x43aee5){_0x3e75ab[_0x4d77('0x28')]=_0x43aee5;if(_0x3e75ab[_0x4d77('0xa0')][_0x4d77('0xa9')]){return db['User'][_0x4d77('0x61')]({'attributes':['id',_0x4d77('0x3e')],'where':{'id':_0x3e75ab[_0x4d77('0xa0')][_0x4d77('0xa9')]}})['then'](function(_0x2364a5){if(_0x2364a5){_0x3e75ab[_0x4d77('0xa2')][_0x4d77('0xaa')]({'id':0x0,'priority':0x0,'app':_0x4d77('0xab'),'appdata':_0x2364a5[_0x4d77('0x3e')]+','+(_0x3e75ab[_0x4d77('0x76')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x3e75ab);});}return respondWithRpcPromise(_0x4d77('0xac'),'startRouting',_0x3e75ab);})[_0x4d77('0x38')](function(_0x153f58){if(_0x153f58){var _0x53c15b=0xc8;var _0x288bd6=_0x4d77('0xad');logger[_0x4d77('0x20')](_0x4d77('0x24'),_0x288bd6,_0x53c15b,_0x4d77('0xae'));logger['debug'](_0x4d77('0xaf'),_0x288bd6,_0x53c15b,_0x4d77('0xae'),JSON[_0x4d77('0x25')](_0x153f58));if(_0x3e75ab['account'][_0x4d77('0x46')]===_0x4d77('0xb0')){return _0x10e286[_0x4d77('0x2c')](_0x53c15b)[_0x4d77('0x33')]('Content-Type',_0x4d77('0xb1'))[_0x4d77('0x3f')](_0x4d77('0xb2'));}else{return _0x10e286[_0x4d77('0x2c')](_0x53c15b)[_0x4d77('0x2e')](_0x153f58);}}})[_0x4d77('0x2a')](handleError(_0x10e286,null));};exports['addApplications']=function(_0x5a5ffb,_0x347879,_0x2fd1d4){return db['SmsAccount'][_0x4d77('0xb3')]({'where':{'id':_0x5a5ffb['params']['id']}})['then'](handleEntityNotFound(_0x347879,null))['then'](function(_0x52535b){if(_0x52535b){return db[_0x4d77('0xb4')][_0x4d77('0xb5')](function(_0x1cdf85){return db[_0x4d77('0x75')][_0x4d77('0x39')]({'where':{'SmsAccountId':_0x5a5ffb[_0x4d77('0x5d')]['id']},'transaction':_0x1cdf85})[_0x4d77('0x38')](function(_0x2ad498){var _0x375cf2=_[_0x4d77('0x43')](_0x5a5ffb[_0x4d77('0x63')],function(_0x274344){_0x274344[_0x4d77('0x6b')]=_0x5a5ffb[_0x4d77('0x5d')]['id'];return _0x274344;});return db[_0x4d77('0x75')][_0x4d77('0xb6')](_0x375cf2,{'transaction':_0x1cdf85});});})[_0x4d77('0x38')](function(){return db[_0x4d77('0x75')][_0x4d77('0xb7')]({'where':{'SmsAccountId':_0x5a5ffb[_0x4d77('0x5d')]['id']},'order':_0x4d77('0x78')});});}})[_0x4d77('0x38')](respondWithResult(_0x347879,null))[_0x4d77('0x2a')](handleError(_0x347879,null));};exports[_0x4d77('0xb8')]=function(_0x1395e1,_0x272548,_0xc519cd){var _0xc5c738={};var _0xf0da72={};var _0x214497;var _0x193382;return db['SmsAccount'][_0x4d77('0xb3')]({'where':{'id':_0x1395e1[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x272548,null))['then'](function(_0x141eeb){if(_0x141eeb){_0x214497=_0x141eeb;_0xf0da72[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db[_0x4d77('0x75')]['rawAttributes']);_0xf0da72[_0x4d77('0x48')]=_[_0x4d77('0x5e')](_0x1395e1[_0x4d77('0x48')]);_0xf0da72[_0x4d77('0x49')]=_['intersection'](_0xf0da72[_0x4d77('0x4b')],_0xf0da72[_0x4d77('0x48')]);_0xc5c738[_0x4d77('0x4c')]=_[_0x4d77('0x4a')](_0xf0da72[_0x4d77('0x4b')],qs[_0x4d77('0x4d')](_0x1395e1[_0x4d77('0x48')][_0x4d77('0x4d')]));_0xc5c738[_0x4d77('0x4c')]=_0xc5c738[_0x4d77('0x4c')][_0x4d77('0x4e')]?_0xc5c738[_0x4d77('0x4c')]:_0xf0da72['model'];_0xc5c738['order']=qs[_0x4d77('0x52')](_0x1395e1[_0x4d77('0x48')][_0x4d77('0x52')]);_0xc5c738['where']=qs[_0x4d77('0x49')](_[_0x4d77('0x54')](_0x1395e1['query'],_0xf0da72[_0x4d77('0x49')]));if(_0x1395e1[_0x4d77('0x48')][_0x4d77('0x55')]){_0xc5c738['where']=_['merge'](_0xc5c738[_0x4d77('0x53')],{'$or':_[_0x4d77('0x43')](_0xc5c738[_0x4d77('0x4c')],function(_0x2d8a3e){var _0x3c8547={};_0x3c8547[_0x2d8a3e]={'$like':'%'+_0x1395e1['query'][_0x4d77('0x55')]+'%'};return _0x3c8547;})});}_0xc5c738=_[_0x4d77('0x56')]({},_0xc5c738,_0x1395e1[_0x4d77('0x60')]);return _0x214497[_0x4d77('0xb8')](_0xc5c738);}})[_0x4d77('0x38')](function(_0x2ce063){if(_0x2ce063){_0x193382=_0x2ce063['length'];if(!_0x1395e1[_0x4d77('0x48')][_0x4d77('0x4f')](_0x4d77('0x50'))){_0xc5c738[_0x4d77('0x30')]=qs[_0x4d77('0x30')](_0x1395e1['query']['limit']);_0xc5c738[_0x4d77('0x2f')]=qs[_0x4d77('0x2f')](_0x1395e1['query'][_0x4d77('0x2f')]);}return _0x214497[_0x4d77('0xb8')](_0xc5c738);}})[_0x4d77('0x38')](function(_0x4daece){if(_0x4daece){return _0x4daece?{'count':_0x193382,'rows':_0x4daece}:null;}})[_0x4d77('0x38')](respondWithResult(_0x272548,null))['catch'](handleError(_0x272548,null));};exports['getInteractions']=function(_0x28ad34,_0x812d44,_0x53f78a){var _0x2c683f={'raw':![],'where':{}};var _0x134f05={};var _0x570595={'count':0x0,'rows':[]};return db[_0x4d77('0x44')]['findOne']({'where':{'id':_0x28ad34[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x812d44,null))[_0x4d77('0x38')](function(_0x5665e7){if(_0x5665e7){_0x134f05[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db['SmsInteraction'][_0x4d77('0x5f')]);_0x134f05[_0x4d77('0x48')]=_['keys'](_0x28ad34[_0x4d77('0x48')]);_0x134f05[_0x4d77('0x49')]=_[_0x4d77('0x4a')](_0x134f05[_0x4d77('0x4b')],_0x134f05['query']);_0x2c683f['attributes']=_[_0x4d77('0x4a')](_0x134f05[_0x4d77('0x4b')],qs[_0x4d77('0x4d')](_0x28ad34[_0x4d77('0x48')][_0x4d77('0x4d')]));_0x2c683f[_0x4d77('0x4c')]=_0x2c683f[_0x4d77('0x4c')]['length']?_0x2c683f['attributes']:_0x134f05[_0x4d77('0x4b')];if(!_0x28ad34[_0x4d77('0x48')][_0x4d77('0x4f')](_0x4d77('0x50'))){_0x2c683f[_0x4d77('0x30')]=qs[_0x4d77('0x30')](_0x28ad34[_0x4d77('0x48')][_0x4d77('0x30')]);_0x2c683f['offset']=qs[_0x4d77('0x2f')](_0x28ad34[_0x4d77('0x48')][_0x4d77('0x2f')]);}_0x2c683f[_0x4d77('0x51')]=qs['sort'](_0x28ad34[_0x4d77('0x48')][_0x4d77('0x52')]);_0x2c683f[_0x4d77('0x53')]=qs[_0x4d77('0x49')](_[_0x4d77('0x54')](_0x28ad34['query'],_0x134f05[_0x4d77('0x49')]));_0x2c683f['where'][_0x4d77('0x6b')]=_0x5665e7['id'];if(_0x28ad34[_0x4d77('0x48')][_0x4d77('0x55')]){_0x2c683f['where']=_[_0x4d77('0x56')](_0x2c683f[_0x4d77('0x53')],{'$or':_[_0x4d77('0x43')](_0x2c683f[_0x4d77('0x4c')],function(_0x498a1c){var _0x139e12={};_0x139e12[_0x498a1c]={'$like':'%'+_0x28ad34[_0x4d77('0x48')][_0x4d77('0x55')]+'%'};return _0x139e12;})});}_0x2c683f=_[_0x4d77('0x56')]({},_0x2c683f,_0x28ad34[_0x4d77('0x60')]);return db['SmsInteraction'][_0x4d77('0x32')]({'where':_0x2c683f[_0x4d77('0x53')]})['then'](function(_0xfa9de0){_0x570595['count']=_0xfa9de0;if(_0x28ad34[_0x4d77('0x48')][_0x4d77('0x58')]){_0x2c683f[_0x4d77('0x59')]=[{'model':db['CmContact'],'as':_0x4d77('0xb9'),'required':![]},{'model':db[_0x4d77('0xba')],'as':_0x4d77('0xbb'),'attributes':[_0x4d77('0x3e'),'fullname',_0x4d77('0xbc')],'required':![]},{'model':db[_0x4d77('0xbd')],'as':_0x4d77('0xbe'),'attributes':['id','name',_0x4d77('0xbf')],'where':_0x28ad34[_0x4d77('0x48')][_0x4d77('0xc0')]?{'id':_0x28ad34[_0x4d77('0x48')][_0x4d77('0xc0')]}:undefined,'required':_0x28ad34[_0x4d77('0x48')]['tag']?!![]:![]}];}return db[_0x4d77('0x9e')][_0x4d77('0x5a')](_0x2c683f);})['then'](function(_0x4bf532){_0x570595[_0x4d77('0x5b')]=_0x4bf532;return _0x570595;});}})[_0x4d77('0x38')](respondWithFilteredResult(_0x812d44,_0x2c683f))[_0x4d77('0x2a')](handleError(_0x812d44,null));};exports['send']=function(_0x547697,_0x402010,_0x42c70a){var _0x758a72,_0xcb13a2,_0x34d94a;if(_[_0x4d77('0x96')](_0x547697[_0x4d77('0x63')]['body'])||_0x547697['body']['body']===''){throw new db[(_0x4d77('0x7c'))][(_0x4d77('0x7d'))](_0x4d77('0x97'));}if(_[_0x4d77('0x96')](_0x547697['body']['to'])){throw new db['Sequelize'][(_0x4d77('0x7d'))]('to\x20is\x20mandatory');}_0x758a72=_0x547697[_0x4d77('0x63')]['to'];return db['SmsAccount'][_0x4d77('0x61')]({'where':{'id':_0x547697[_0x4d77('0x5d')]['id']},'include':[{'model':db[_0x4d77('0xc1')],'as':'List','include':[{'model':db[_0x4d77('0x7b')],'as':_0x4d77('0x9d'),'where':{'mobile':_0x758a72},'limit':0x1,'order':[[_0x4d77('0x80'),_0x4d77('0x9b')]]}]}]})[_0x4d77('0x38')](handleEntityNotFound(_0x402010,null))['then'](function(_0x2d762b){if(_0x2d762b&&_0x2d762b['List']){_0xcb13a2=_0x2d762b['get']({'plain':!![]});if(_0xcb13a2['List']&&_0xcb13a2[_0x4d77('0xc2')][_0x4d77('0x9d')]['length']){return _0xcb13a2[_0x4d77('0xc2')][_0x4d77('0x9d')][0x0];}return db[_0x4d77('0x7b')][_0x4d77('0x62')](_[_0x4d77('0x18')](_0x547697['body'],{'firstName':_0x758a72,'mobile':_0x758a72,'phone':_0x758a72,'ListId':_0xcb13a2[_0x4d77('0x83')]}));}})[_0x4d77('0x38')](handleEntityNotFound(_0x402010,null))['then'](function(_0x1cb0d1){if(_0x1cb0d1){_0x34d94a=_0x1cb0d1;return db[_0x4d77('0x9e')][_0x4d77('0x61')]({'where':{'ContactId':_0x34d94a['id'],'closed':![],'SmsAccountId':_0xcb13a2['id']}})[_0x4d77('0x38')](function(_0x106cb1){if(_0x106cb1){return[_0x106cb1,![]];}return db[_0x4d77('0x9e')][_0x4d77('0x62')]({'UserId':_0x547697[_0x4d77('0x64')]['id'],'ContactId':_0x34d94a['id'],'SmsAccountId':_0xcb13a2['id'],'phone':_0x758a72,'firstMsgDirection':_0x4d77('0xc3'),'Messages':[_['merge'](_0x547697['body'],{'read':![],'body':_0x547697['body'][_0x4d77('0x63')],'phone':_0x758a72,'SmsAccountId':_0xcb13a2['id'],'UserId':_0x547697[_0x4d77('0x64')]['id'],'ContactId':_0x34d94a['id']})]},{'include':[{'model':db[_0x4d77('0xa7')],'as':'Messages'}]})[_0x4d77('0x38')](function(_0x3d03b3){return[_0x3d03b3,!![]];});});}})[_0x4d77('0x9f')](function(_0x2e6265,_0x229dd4){if(_0x229dd4){return _0x2e6265;}return db['SmsMessage'][_0x4d77('0x62')](_[_0x4d77('0x56')](_0x547697[_0x4d77('0x63')],{'read':![],'body':_0x547697[_0x4d77('0x63')][_0x4d77('0x63')],'phone':_0x758a72,'SmsAccountId':_0xcb13a2['id'],'SmsInteractionId':_0x2e6265['id'],'UserId':_0x547697[_0x4d77('0x64')]['id'],'ContactId':_0x34d94a['id']}))[_0x4d77('0x38')](function(_0x3ae8a7){_0x2e6265[_0x4d77('0xc4')]['Messages']=[];_0x2e6265[_0x4d77('0xc4')]['Messages'][_0x4d77('0xa3')](_0x3ae8a7[_0x4d77('0xc4')]);return _0x2e6265;});})[_0x4d77('0x38')](respondWithResult(_0x402010,null))[_0x4d77('0x2a')](handleError(_0x402010,null));};exports[_0x4d77('0x2c')]=function(_0x2256d1,_0x593a6d,_0x5d4f87){if(_0x2256d1[_0x4d77('0x63')]['id']){delete _0x2256d1['body']['id'];}var _0x28e35d,_0x3faa9b,_0x1db700;return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x2256d1[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x593a6d,null))[_0x4d77('0x38')](function(_0xe3d22b){if(_0xe3d22b){_0x1db700=_0xe3d22b;logger[_0x4d77('0x23')](_0x4d77('0x24'),_0x4d77('0x2c'),'received\x20delivery\x20report\x20from',_0xe3d22b[_0x4d77('0x46')],util[_0x4d77('0xc5')](_0x2256d1[_0x4d77('0x63')],{'showHidden':![],'depth':null}));switch(_0xe3d22b[_0x4d77('0x46')]){case _0x4d77('0x87'):if(_0x2256d1[_0x4d77('0x63')][_0x4d77('0xc6')]&&_0x2256d1[_0x4d77('0x63')][_0x4d77('0x2c')]){_0x3faa9b=_0x2256d1[_0x4d77('0x63')]['status'];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1['body'][_0x4d77('0xc6')]}});}break;case'connectel':if(_0x2256d1[_0x4d77('0x63')][_0x4d77('0xc7')]&&_0x2256d1[_0x4d77('0x63')][_0x4d77('0xc8')]){_0x3faa9b=_0x2256d1[_0x4d77('0x63')][_0x4d77('0xc8')];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1['body'][_0x4d77('0xc7')]}});}break;case _0x4d77('0x8a'):if(_0x2256d1['body']['message_id']&&_0x2256d1['body'][_0x4d77('0xc9')]){_0x3faa9b=_0x2256d1['body'][_0x4d77('0xc9')];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1[_0x4d77('0x63')][_0x4d77('0xca')]}});}break;case _0x4d77('0x90'):var _0x54d7cf=_0x2256d1[_0x4d77('0x63')][_0x4d77('0x91')][0x0];if(_0x54d7cf['messageId']&&_0x54d7cf['status'][_0x4d77('0xcb')]===_0x4d77('0xcc')){_0x3faa9b=_0x54d7cf['status']['groupName'];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x54d7cf[_0x4d77('0x8b')]}});}break;case _0x4d77('0xcd'):if(_0x2256d1[_0x4d77('0x63')][_0x4d77('0x8b')]&&_0x2256d1[_0x4d77('0x63')]['status']){_0x3faa9b=_0x2256d1[_0x4d77('0x63')][_0x4d77('0x2c')];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1[_0x4d77('0x63')][_0x4d77('0x8b')]}});}break;case _0x4d77('0x95'):if(_0x2256d1[_0x4d77('0x63')][0x0][_0x4d77('0x28')]['id']){_0x3faa9b=_0x2256d1[_0x4d77('0x63')][0x0][_0x4d77('0x46')];return db['SmsMessage'][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1['body'][0x0]['message']['id']}});}break;case _0x4d77('0xce'):if(_0x2256d1[_0x4d77('0x63')][_0x4d77('0xcf')]&&_0x2256d1[_0x4d77('0x63')]['status']){_0x3faa9b=_0x2256d1[_0x4d77('0x63')][_0x4d77('0x2c')];return db[_0x4d77('0xa7')][_0x4d77('0x61')]({'where':{'messageId':_0x2256d1[_0x4d77('0x63')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x593a6d,null))[_0x4d77('0x38')](function(_0x43bfe0){if(_0x43bfe0){_0x28e35d=_0x43bfe0;switch(_0x1db700[_0x4d77('0x46')]){case'skebby':if(_0x3faa9b===_0x4d77('0xcc')){return _0x28e35d[_0x4d77('0x37')]({'read':!![]});}else{logger['error'](_0x4d77('0x24'),_0x4d77('0x2c'),'skebby',util['inspect'](_0x2256d1['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3faa9b==='1'){return _0x28e35d[_0x4d77('0x37')]({'read':!![]});}else{logger[_0x4d77('0x26')](_0x4d77('0x24'),_0x4d77('0x2c'),_0x4d77('0x87'),util[_0x4d77('0xc5')](_0x2256d1[_0x4d77('0x63')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2256d1[_0x4d77('0x63')][_0x4d77('0xd0')]&&_0x3faa9b>=0xc8&&_0x3faa9b<=0xce){return _0x28e35d[_0x4d77('0x37')]({'read':!![]});}else{logger[_0x4d77('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d77('0x2c'),_0x4d77('0x8a'),util[_0x4d77('0xc5')](_0x2256d1['body'],{'showHidden':![],'depth':null}));}break;case _0x4d77('0x90'):var _0x5c7f92=_0x2256d1['body'][_0x4d77('0x91')][0x0];if(_0x5c7f92['status']['groupName']===_0x4d77('0xcc')){return _0x28e35d['update']({'read':!![]});}else{logger['error'](_0x4d77('0x24'),'status',_0x4d77('0x90'),util['inspect'](_0x2256d1[_0x4d77('0x63')],{'showHidden':![],'depth':null}));}break;case _0x4d77('0xcd'):if(_0x3faa9b=='DELIVERED_TO_GATEWAY'||_0x3faa9b==_0x4d77('0xd1')){return _0x28e35d[_0x4d77('0x37')]({'read':!![]});}else{logger[_0x4d77('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d77('0x2c'),_0x4d77('0xcd'),util[_0x4d77('0xc5')](_0x2256d1['body'],{'showHidden':![],'depth':null}));}break;case _0x4d77('0x95'):if(_0x3faa9b=='message-delivered'){return _0x28e35d['update']({'read':!![]});}else{logger[_0x4d77('0x26')](_0x4d77('0x24'),_0x4d77('0x2c'),_0x4d77('0x95'),util[_0x4d77('0xc5')](_0x2256d1[_0x4d77('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3faa9b===_0x4d77('0xd2')||_0x3faa9b===_0x4d77('0xd3')){return _0x28e35d[_0x4d77('0x37')]({'read':!![]});}else{logger['error'](_0x4d77('0x24'),'status',_0x4d77('0xce'),util['inspect'](_0x2256d1[_0x4d77('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x28e35d;}})[_0x4d77('0x38')](respondWithResult(_0x593a6d,null))[_0x4d77('0x2a')](handleError(_0x593a6d,null));};exports[_0x4d77('0xd4')]=function(_0x2f9dec,_0x8682ab,_0x5de95c){var _0x326d97,_0x345d9f,_0x29318c;return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x2f9dec[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x8682ab,null))[_0x4d77('0x38')](function(_0x500dfd){if(_0x500dfd){_0x29318c=_0x500dfd;logger[_0x4d77('0x23')](_0x4d77('0x24'),'status',_0x4d77('0xd5'),_0x500dfd['type'],util[_0x4d77('0xc5')](_0x2f9dec[_0x4d77('0x48')],{'showHidden':![],'depth':null}));switch(_0x500dfd['type']){case _0x4d77('0xd6'):if(_0x2f9dec[_0x4d77('0x48')][_0x4d77('0xd7')]&&_0x2f9dec[_0x4d77('0x48')]['state']){_0x345d9f=_0x2f9dec[_0x4d77('0x48')][_0x4d77('0xd8')];return db['SmsMessage'][_0x4d77('0x61')]({'where':{'messageId':_0x2f9dec[_0x4d77('0x48')][_0x4d77('0xd7')]}});}break;}}})[_0x4d77('0x38')](handleEntityNotFound(_0x8682ab,null))['then'](function(_0xfbf18a){if(_0xfbf18a){_0x326d97=_0xfbf18a;switch(_0x29318c[_0x4d77('0x46')]){case'csc':if(_0x345d9f==='2'||_0x345d9f==='6'){return _0x326d97[_0x4d77('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d77('0x2c'),_0x4d77('0xd6'),util[_0x4d77('0xc5')](_0x2f9dec[_0x4d77('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x326d97;}})[_0x4d77('0x38')](respondWithResult(_0x8682ab,null))['catch'](handleError(_0x8682ab,null));};exports[_0x4d77('0xd9')]=function(_0x49f50c,_0x3bbdbe,_0x22f50c){return db[_0x4d77('0x44')]['find']({'where':{'id':_0x49f50c[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x3bbdbe,null))[_0x4d77('0x38')](function(_0x4585ff){if(_0x4585ff){return _0x4585ff['addAgents'](_0x49f50c['body'][_0x4d77('0x6f')],_[_0x4d77('0x9c')](_0x49f50c[_0x4d77('0x63')],['ids','id'])||{})[_0x4d77('0x9f')](function(_0x457244){for(var _0x49d256=0x0;_0x49d256<_0x49f50c['body'][_0x4d77('0x6f')]['length'];_0x49d256+=0x1){socket['emit'](_0x4d77('0xda'),{'UserId':Number(_0x49f50c[_0x4d77('0x63')][_0x4d77('0x6f')][_0x49d256]),'SmsAccountId':Number(_0x49f50c[_0x4d77('0x5d')]['id'])});}return _0x457244;});}})[_0x4d77('0x38')](respondWithResult(_0x3bbdbe,null))[_0x4d77('0x2a')](handleError(_0x3bbdbe,null));};exports['removeAgents']=function(_0x2b7265,_0x421c08,_0x25bd3a){return db[_0x4d77('0x44')][_0x4d77('0x61')]({'where':{'id':_0x2b7265[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x421c08,null))['then'](function(_0x3f588e){if(_0x3f588e){return _0x3f588e[_0x4d77('0xdb')](_0x2b7265['query'][_0x4d77('0x6f')])['then'](function(){if(_['isArray'](_0x2b7265[_0x4d77('0x48')]['ids'])){for(var _0x724050=0x0;_0x724050<_0x2b7265['query'][_0x4d77('0x6f')][_0x4d77('0x4e')];_0x724050+=0x1){socket[_0x4d77('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x2b7265[_0x4d77('0x48')]['ids'][_0x724050]),'SmsAccountId':Number(_0x2b7265[_0x4d77('0x5d')]['id'])});}}else{socket[_0x4d77('0xdc')](_0x4d77('0xdd'),{'UserId':Number(_0x2b7265[_0x4d77('0x48')][_0x4d77('0x6f')]),'SmsAccountId':Number(_0x2b7265[_0x4d77('0x5d')]['id'])});}});}})[_0x4d77('0x38')](respondWithStatusCode(_0x421c08,null))[_0x4d77('0x2a')](handleError(_0x421c08,null));};exports[_0x4d77('0xde')]=function(_0x4744ab,_0x15c0b7,_0xd147f8){var _0x21dcb1={};var _0xfbe488={};var _0x31396f;var _0x1d9852;return db['SmsAccount']['findOne']({'where':{'id':_0x4744ab[_0x4d77('0x5d')]['id']}})[_0x4d77('0x38')](handleEntityNotFound(_0x15c0b7,null))[_0x4d77('0x38')](function(_0x34c1d5){if(_0x34c1d5){_0x31396f=_0x34c1d5;_0xfbe488[_0x4d77('0x4b')]=_[_0x4d77('0x5e')](db[_0x4d77('0xba')][_0x4d77('0x5f')]);_0xfbe488[_0x4d77('0x48')]=_[_0x4d77('0x5e')](_0x4744ab[_0x4d77('0x48')]);_0xfbe488[_0x4d77('0x49')]=_['intersection'](_0xfbe488['model'],_0xfbe488[_0x4d77('0x48')]);_0x21dcb1[_0x4d77('0x4c')]=_[_0x4d77('0x4a')](_0xfbe488[_0x4d77('0x4b')],qs['fields'](_0x4744ab[_0x4d77('0x48')]['fields']));_0x21dcb1[_0x4d77('0x4c')]=_0x21dcb1['attributes']['length']?_0x21dcb1['attributes']:_0xfbe488['model'];_0x21dcb1[_0x4d77('0x51')]=qs[_0x4d77('0x52')](_0x4744ab[_0x4d77('0x48')][_0x4d77('0x52')]);_0x21dcb1[_0x4d77('0x53')]=qs['filters'](_[_0x4d77('0x54')](_0x4744ab[_0x4d77('0x48')],_0xfbe488['filters']));if(_0x4744ab[_0x4d77('0x48')][_0x4d77('0x55')]){_0x21dcb1[_0x4d77('0x53')]=_[_0x4d77('0x56')](_0x21dcb1['where'],{'$or':_[_0x4d77('0x43')](_0x21dcb1[_0x4d77('0x4c')],function(_0x5f814f){var _0x5f2254={};_0x5f2254[_0x5f814f]={'$like':'%'+_0x4744ab[_0x4d77('0x48')][_0x4d77('0x55')]+'%'};return _0x5f2254;})});}_0x21dcb1=_[_0x4d77('0x56')]({},_0x21dcb1,_0x4744ab['options']);return _0x31396f[_0x4d77('0xde')](_0x21dcb1);}})[_0x4d77('0x38')](function(_0x444da3){if(_0x444da3){_0x1d9852=_0x444da3[_0x4d77('0x4e')];if(!_0x4744ab[_0x4d77('0x48')][_0x4d77('0x4f')](_0x4d77('0x50'))){_0x21dcb1[_0x4d77('0x30')]=qs[_0x4d77('0x30')](_0x4744ab[_0x4d77('0x48')][_0x4d77('0x30')]);_0x21dcb1[_0x4d77('0x2f')]=qs[_0x4d77('0x2f')](_0x4744ab[_0x4d77('0x48')][_0x4d77('0x2f')]);}return _0x31396f['getAgents'](_0x21dcb1);}})[_0x4d77('0x38')](function(_0x5b4e02){if(_0x5b4e02){return _0x5b4e02?{'count':_0x1d9852,'rows':_0x5b4e02}:null;}})[_0x4d77('0x38')](respondWithResult(_0x15c0b7,null))['catch'](handleError(_0x15c0b7,null));}; \ No newline at end of file +var _0x43f7=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','SmsAccounts','UserProfileResource','destroy','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','SmsAccountId','getDispositions','findOne','Disposition','length','pick','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','notify','SmsApplication','Applications','orderBy','priority','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','get','created','applications','close','*,*,*,*','SmsMessage','ContactId','User','UserId','agent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','ListId','out','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','statusInt','requestid','DELIVERED','groupName','bandwidth','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xecbf91,_0x2d6777){var _0x470f1c=function(_0x264885){while(--_0x264885){_0xecbf91['push'](_0xecbf91['shift']());}};_0x470f1c(++_0x2d6777);}(_0x43f7,0xc6));var _0x743f=function(_0x103e1f,_0x4f7384){_0x103e1f=_0x103e1f-0x0;var _0x394f36=_0x43f7[_0x103e1f];return _0x394f36;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require(_0x743f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x743f('0x3'));var moment=require(_0x743f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x743f('0x5'));var path=require(_0x743f('0x6'));var sox=require(_0x743f('0x7'));var csv=require(_0x743f('0x8'));var ejs=require(_0x743f('0x9'));var fs=require('fs');var fs_extra=require(_0x743f('0xa'));var _=require(_0x743f('0xb'));var squel=require('squel');var crypto=require(_0x743f('0xc'));var jsforce=require(_0x743f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x743f('0x8'));var querystring=require(_0x743f('0xe'));var Papa=require(_0x743f('0xf'));var Redis=require(_0x743f('0x10'));var authService=require(_0x743f('0x11'));var qs=require(_0x743f('0x12'));var as=require(_0x743f('0x13'));var hardwareService=require(_0x743f('0x14'));var logger=require(_0x743f('0x15'))(_0x743f('0x16'));var utils=require(_0x743f('0x17'));var config=require(_0x743f('0x18'));var licenseUtil=require(_0x743f('0x19'));var db=require('../../mysqldb')['db'];config[_0x743f('0x1a')]=_[_0x743f('0x1b')](config['redis'],{'host':_0x743f('0x1c'),'port':0x18eb});var socket=require(_0x743f('0x1d'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x743f('0x1e')](socket);var jayson=require(_0x743f('0x1f'));var client=jayson[_0x743f('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x24eeef,_0x260588,_0x49b772,_0x4c2fc0){return new BPromise(function(_0x59035e,_0x1e051c){var _0x449887=_0x4c2fc0||client;return _0x449887['request'](_0x24eeef,_0x49b772)[_0x743f('0x21')](function(_0x1bc3fc){logger[_0x743f('0x22')](_0x743f('0x23'),_0x260588,'request\x20sent');logger[_0x743f('0x24')](_0x743f('0x25'),_0x260588,_0x743f('0x26'),JSON[_0x743f('0x27')](_0x1bc3fc));if(_0x1bc3fc[_0x743f('0x28')]){if(_0x1bc3fc[_0x743f('0x28')][_0x743f('0x29')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x260588,_0x1bc3fc[_0x743f('0x28')]['message']);return _0x1e051c(_0x1bc3fc[_0x743f('0x28')][_0x743f('0x2a')]);}logger['error'](_0x743f('0x23'),_0x260588,_0x1bc3fc[_0x743f('0x28')][_0x743f('0x2a')]);return _0x59035e(_0x1bc3fc['error']['message']);}else{logger[_0x743f('0x22')](_0x743f('0x23'),_0x260588,_0x743f('0x26'));_0x59035e(_0x1bc3fc[_0x743f('0x2b')][_0x743f('0x2a')]);}})[_0x743f('0x2c')](function(_0x48b3d4){logger[_0x743f('0x28')]('SmsAccount,\x20%s,\x20%s',_0x260588,_0x48b3d4);_0x1e051c(_0x48b3d4);});});}function respondWithStatusCode(_0xf6826c,_0x20c4a2){_0x20c4a2=_0x20c4a2||0xcc;return function(_0xcdfb9a){if(_0xcdfb9a){return _0xf6826c[_0x743f('0x2d')](_0x20c4a2);}return _0xf6826c[_0x743f('0x2e')](_0x20c4a2)[_0x743f('0x2f')]();};}function respondWithResult(_0x57982a,_0x4e9a51){_0x4e9a51=_0x4e9a51||0xc8;return function(_0x51ac95){if(_0x51ac95){return _0x57982a[_0x743f('0x2e')](_0x4e9a51)[_0x743f('0x30')](_0x51ac95);}};}function respondWithFilteredResult(_0x3d3c5c,_0x3bcc5b){return function(_0x2f6b88){if(_0x2f6b88){var _0x3448f0=typeof _0x3bcc5b[_0x743f('0x31')]==='undefined'&&typeof _0x3bcc5b[_0x743f('0x32')]==='undefined';var _0x292855=_0x2f6b88['count'];var _0x219c85=_0x3448f0?0x0:_0x3bcc5b[_0x743f('0x31')];var _0x57c006=_0x3448f0?_0x2f6b88[_0x743f('0x33')]:_0x3bcc5b[_0x743f('0x31')]+_0x3bcc5b['limit'];var _0x316cc1;if(_0x57c006>=_0x292855){_0x57c006=_0x292855;_0x316cc1=0xc8;}else{_0x316cc1=0xce;}_0x3d3c5c['status'](_0x316cc1);return _0x3d3c5c[_0x743f('0x34')](_0x743f('0x35'),_0x219c85+'-'+_0x57c006+'/'+_0x292855)[_0x743f('0x30')](_0x2f6b88);}return null;};}function patchUpdates(_0x4b79c1){return function(_0xbdae72){try{jsonpatch[_0x743f('0x36')](_0xbdae72,_0x4b79c1,!![]);}catch(_0x410ad5){return BPromise[_0x743f('0x37')](_0x410ad5);}return _0xbdae72[_0x743f('0x38')]();};}function saveUpdates(_0x6acea9,_0x398b4c){return function(_0x76c6af){if(_0x76c6af){return _0x76c6af[_0x743f('0x39')](_0x6acea9)[_0x743f('0x21')](function(_0xe9badb){return _0xe9badb;});}return null;};}function removeEntity(_0x4030f9,_0x7a0d72){return function(_0x403825){if(_0x403825){return _0x403825['destroy']()[_0x743f('0x21')](function(){var _0x4660ac=_0x403825['get']({'plain':!![]});var _0x1d84dd=_0x743f('0x3a');return db[_0x743f('0x3b')][_0x743f('0x3c')]({'where':{'type':_0x1d84dd,'resourceId':_0x4660ac['id']}})['then'](function(){return _0x403825;});})[_0x743f('0x21')](function(){_0x4030f9['status'](0xcc)[_0x743f('0x2f')]();});}};}function handleEntityNotFound(_0x12e295,_0x46a3ee){return function(_0x50b242){if(!_0x50b242){_0x12e295[_0x743f('0x2d')](0x194);}return _0x50b242;};}function handleError(_0x5e2a4d,_0xa21b69){_0xa21b69=_0xa21b69||0x1f4;return function(_0x3708b9){logger[_0x743f('0x28')](_0x3708b9['stack']);if(_0x3708b9[_0x743f('0x3d')]){delete _0x3708b9[_0x743f('0x3d')];}_0x5e2a4d[_0x743f('0x2e')](_0xa21b69)[_0x743f('0x3e')](_0x3708b9);};}exports['index']=function(_0x249542,_0x298893){var _0x4518c4={'include':[{'model':db[_0x743f('0x3f')],'as':_0x743f('0x40')}]},_0x4f087e={},_0x33cf98={'count':0x0,'rows':[]};var _0x4fa6c4=_['map'](db[_0x743f('0x41')][_0x743f('0x42')],function(_0x574e1c){return{'name':_0x574e1c[_0x743f('0x43')],'type':_0x574e1c[_0x743f('0x44')]['key']};});_0x4f087e[_0x743f('0x45')]=_['map'](_0x4fa6c4,_0x743f('0x3d'));_0x4f087e['query']=_['keys'](_0x249542['query']);_0x4f087e[_0x743f('0x46')]=_[_0x743f('0x47')](_0x4f087e[_0x743f('0x45')],_0x4f087e[_0x743f('0x48')]);_0x4518c4[_0x743f('0x49')]=_[_0x743f('0x47')](_0x4f087e[_0x743f('0x45')],qs[_0x743f('0x4a')](_0x249542['query'][_0x743f('0x4a')]));_0x4518c4[_0x743f('0x49')]=_0x4518c4[_0x743f('0x49')]['length']?_0x4518c4[_0x743f('0x49')]:_0x4f087e[_0x743f('0x45')];if(!_0x249542[_0x743f('0x48')][_0x743f('0x4b')](_0x743f('0x4c'))){_0x4518c4[_0x743f('0x32')]=qs['limit'](_0x249542[_0x743f('0x48')][_0x743f('0x32')]);_0x4518c4[_0x743f('0x31')]=qs['offset'](_0x249542[_0x743f('0x48')]['offset']);}_0x4518c4[_0x743f('0x4d')]=qs[_0x743f('0x4e')](_0x249542[_0x743f('0x48')]['sort']);_0x4518c4[_0x743f('0x4f')]=qs[_0x743f('0x46')](_['pick'](_0x249542[_0x743f('0x48')],_0x4f087e[_0x743f('0x46')]),_0x4fa6c4);if(_0x249542[_0x743f('0x48')][_0x743f('0x50')]){_0x4518c4['where']=_[_0x743f('0x51')](_0x4518c4[_0x743f('0x4f')],{'$or':_[_0x743f('0x52')](_0x4fa6c4,function(_0x1b1c66){if(_0x1b1c66[_0x743f('0x44')]!=='VIRTUAL'){var _0x3ac7e7={};_0x3ac7e7[_0x1b1c66[_0x743f('0x3d')]]={'$like':'%'+_0x249542[_0x743f('0x48')][_0x743f('0x50')]+'%'};return _0x3ac7e7;}})});}_0x4518c4=_[_0x743f('0x51')]({},_0x4518c4,_0x249542[_0x743f('0x53')]);var _0x1cae20={'where':_0x4518c4[_0x743f('0x4f')]};return db[_0x743f('0x41')][_0x743f('0x33')](_0x1cae20)[_0x743f('0x21')](function(_0x26b299){_0x33cf98[_0x743f('0x33')]=_0x26b299;if(_0x249542['query'][_0x743f('0x54')]){_0x4518c4[_0x743f('0x55')]=[{'all':!![]}];}return db[_0x743f('0x41')][_0x743f('0x56')](_0x4518c4);})[_0x743f('0x21')](function(_0x371d14){_0x33cf98['rows']=_0x371d14;return _0x33cf98;})[_0x743f('0x21')](respondWithFilteredResult(_0x298893,_0x4518c4))['catch'](handleError(_0x298893,null));};exports[_0x743f('0x57')]=function(_0xea3401,_0x4d988f){var _0x225741={'raw':![],'where':{'id':_0xea3401[_0x743f('0x58')]['id']},'include':[{'model':db[_0x743f('0x3f')],'as':'mandatoryDispositionPause'}]},_0x4a6118={};_0x4a6118[_0x743f('0x45')]=_[_0x743f('0x59')](db[_0x743f('0x41')][_0x743f('0x42')]);_0x4a6118['query']=_['keys'](_0xea3401[_0x743f('0x48')]);_0x4a6118['filters']=_[_0x743f('0x47')](_0x4a6118[_0x743f('0x45')],_0x4a6118[_0x743f('0x48')]);_0x225741[_0x743f('0x49')]=_[_0x743f('0x47')](_0x4a6118['model'],qs[_0x743f('0x4a')](_0xea3401['query']['fields']));_0x225741[_0x743f('0x49')]=_0x225741[_0x743f('0x49')]['length']?_0x225741['attributes']:_0x4a6118[_0x743f('0x45')];if(_0xea3401['query'][_0x743f('0x54')]){_0x225741['include']=[{'all':!![]}];}_0x225741=_[_0x743f('0x51')]({},_0x225741,_0xea3401['options']);return db['SmsAccount'][_0x743f('0x5a')](_0x225741)[_0x743f('0x21')](handleEntityNotFound(_0x4d988f,null))[_0x743f('0x21')](respondWithResult(_0x4d988f,null))[_0x743f('0x2c')](handleError(_0x4d988f,null));};exports[_0x743f('0x5b')]=function(_0x20e3e1,_0x1f4de9){return db[_0x743f('0x41')][_0x743f('0x5b')](_0x20e3e1[_0x743f('0x5c')],{})[_0x743f('0x21')](function(_0x377299){var _0x23b7a0=_0x20e3e1['user']['get']({'plain':!![]});if(!_0x23b7a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23b7a0['role']===_0x743f('0x5d')){var _0x510982=_0x377299['get']({'plain':!![]});var _0x54a3a2=_0x743f('0x3a');return db[_0x743f('0x5e')][_0x743f('0x5a')]({'where':{'name':_0x54a3a2,'userProfileId':_0x23b7a0[_0x743f('0x5f')]},'raw':!![]})['then'](function(_0x46975e){if(_0x46975e&&_0x46975e[_0x743f('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x510982[_0x743f('0x3d')],'resourceId':_0x510982['id'],'type':_0x46975e[_0x743f('0x3d')],'sectionId':_0x46975e['id']},{})['then'](function(){return _0x377299;});}else{return _0x377299;}})[_0x743f('0x2c')](function(_0x27fe76){logger[_0x743f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27fe76);throw _0x27fe76;});}return _0x377299;})[_0x743f('0x21')](respondWithResult(_0x1f4de9,0xc9))[_0x743f('0x2c')](handleError(_0x1f4de9,null));};exports[_0x743f('0x39')]=function(_0x294420,_0x591526){if(_0x294420[_0x743f('0x5c')]['id']){delete _0x294420['body']['id'];}return db[_0x743f('0x41')][_0x743f('0x5a')]({'where':{'id':_0x294420[_0x743f('0x58')]['id']},'include':[{'model':db[_0x743f('0x3f')],'as':_0x743f('0x40')}]})[_0x743f('0x21')](handleEntityNotFound(_0x591526,null))['then'](saveUpdates(_0x294420[_0x743f('0x5c')],null))[_0x743f('0x21')](respondWithResult(_0x591526,null))['catch'](handleError(_0x591526,null));};exports[_0x743f('0x3c')]=function(_0x3a7e2e,_0x304391){return db['SmsAccount'][_0x743f('0x5a')]({'where':{'id':_0x3a7e2e[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x304391,null))[_0x743f('0x21')](removeEntity(_0x304391,null))[_0x743f('0x2c')](handleError(_0x304391,null));};exports[_0x743f('0x61')]=function(_0x617f66,_0x1f98b0){return db['SmsAccount'][_0x743f('0x61')]()[_0x743f('0x21')](respondWithResult(_0x1f98b0,null))[_0x743f('0x2c')](handleError(_0x1f98b0,null));};exports['addDisposition']=function(_0xe0f30f,_0x55a9ad,_0x38e3e0){if(_0xe0f30f[_0x743f('0x5c')]['id']){delete _0xe0f30f[_0x743f('0x5c')]['id'];}return db[_0x743f('0x41')]['find']({'where':{'id':_0xe0f30f[_0x743f('0x58')]['id']}})['then'](handleEntityNotFound(_0x55a9ad,null))[_0x743f('0x21')](function(_0x35123a){if(_0x35123a){_0xe0f30f[_0x743f('0x5c')][_0x743f('0x62')]=_0x35123a['id'];return db['Disposition']['create'](_0xe0f30f[_0x743f('0x5c')]);}})[_0x743f('0x21')](respondWithResult(_0x55a9ad,null))['catch'](handleError(_0x55a9ad,null));};exports[_0x743f('0x63')]=function(_0x4bd6a6,_0x44b9d0,_0x477fdc){var _0xc4a865={'raw':![],'where':{}};var _0x27e11d={};var _0x5e5e73={'count':0x0,'rows':[]};return db['SmsAccount'][_0x743f('0x64')]({'where':{'id':_0x4bd6a6[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x44b9d0,null))[_0x743f('0x21')](function(_0x4f5d97){if(_0x4f5d97){_0x27e11d[_0x743f('0x45')]=_[_0x743f('0x59')](db[_0x743f('0x65')][_0x743f('0x42')]);_0x27e11d[_0x743f('0x48')]=_[_0x743f('0x59')](_0x4bd6a6[_0x743f('0x48')]);_0x27e11d[_0x743f('0x46')]=_[_0x743f('0x47')](_0x27e11d[_0x743f('0x45')],_0x27e11d[_0x743f('0x48')]);_0xc4a865[_0x743f('0x49')]=_[_0x743f('0x47')](_0x27e11d[_0x743f('0x45')],qs[_0x743f('0x4a')](_0x4bd6a6[_0x743f('0x48')][_0x743f('0x4a')]));_0xc4a865[_0x743f('0x49')]=_0xc4a865[_0x743f('0x49')][_0x743f('0x66')]?_0xc4a865['attributes']:_0x27e11d[_0x743f('0x45')];if(!_0x4bd6a6[_0x743f('0x48')][_0x743f('0x4b')](_0x743f('0x4c'))){_0xc4a865[_0x743f('0x32')]=qs[_0x743f('0x32')](_0x4bd6a6[_0x743f('0x48')][_0x743f('0x32')]);_0xc4a865[_0x743f('0x31')]=qs[_0x743f('0x31')](_0x4bd6a6['query'][_0x743f('0x31')]);}_0xc4a865[_0x743f('0x4d')]=qs[_0x743f('0x4e')](_0x4bd6a6[_0x743f('0x48')][_0x743f('0x4e')]);_0xc4a865[_0x743f('0x4f')]=qs[_0x743f('0x46')](_[_0x743f('0x67')](_0x4bd6a6[_0x743f('0x48')],_0x27e11d[_0x743f('0x46')]));_0xc4a865[_0x743f('0x4f')]['SmsAccountId']=_0x4f5d97['id'];if(_0x4bd6a6[_0x743f('0x48')][_0x743f('0x50')]){_0xc4a865[_0x743f('0x4f')]=_[_0x743f('0x51')](_0xc4a865[_0x743f('0x4f')],{'$or':_[_0x743f('0x52')](_0xc4a865[_0x743f('0x49')],function(_0x2f5670){var _0x1d55d1={};_0x1d55d1[_0x2f5670]={'$like':'%'+_0x4bd6a6[_0x743f('0x48')][_0x743f('0x50')]+'%'};return _0x1d55d1;})});}_0xc4a865=_[_0x743f('0x51')]({},_0xc4a865,_0x4bd6a6['options']);return db[_0x743f('0x65')]['count']({'where':_0xc4a865[_0x743f('0x4f')]})['then'](function(_0x4afe29){_0x5e5e73['count']=_0x4afe29;if(_0x4bd6a6[_0x743f('0x48')]['includeAll']){_0xc4a865[_0x743f('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xc4a865);})[_0x743f('0x21')](function(_0x3c3524){_0x5e5e73[_0x743f('0x68')]=_0x3c3524;return _0x5e5e73;});}})[_0x743f('0x21')](respondWithFilteredResult(_0x44b9d0,_0xc4a865))[_0x743f('0x2c')](handleError(_0x44b9d0,null));};exports[_0x743f('0x69')]=function(_0x5f07e1,_0x51ea0a,_0x21330e){return db[_0x743f('0x41')][_0x743f('0x5a')]({'where':{'id':_0x5f07e1[_0x743f('0x58')]['id']}})['then'](handleEntityNotFound(_0x51ea0a,null))[_0x743f('0x21')](function(_0x52ff34){if(_0x52ff34){return _0x52ff34[_0x743f('0x69')](_0x5f07e1[_0x743f('0x48')][_0x743f('0x6a')]);}})[_0x743f('0x21')](respondWithStatusCode(_0x51ea0a,null))[_0x743f('0x2c')](handleError(_0x51ea0a,null));};exports[_0x743f('0x6b')]=function(_0x3f0308,_0x46d680,_0x56358c){if(_0x3f0308[_0x743f('0x5c')]['id']){delete _0x3f0308['body']['id'];}return db[_0x743f('0x41')][_0x743f('0x5a')]({'where':{'id':_0x3f0308[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x46d680,null))[_0x743f('0x21')](function(_0x3e0385){if(_0x3e0385){_0x3f0308['body'][_0x743f('0x62')]=_0x3e0385['id'];return db['CannedAnswer']['create'](_0x3f0308[_0x743f('0x5c')]);}})['then'](respondWithResult(_0x46d680,null))[_0x743f('0x2c')](handleError(_0x46d680,null));};exports[_0x743f('0x6c')]=function(_0x3457ad,_0x4212a9,_0x21c5ca){var _0x571f4a={'raw':![],'where':{}};var _0x2c1c6f={};var _0x5dab6e={'count':0x0,'rows':[]};return db[_0x743f('0x41')][_0x743f('0x64')]({'where':{'id':_0x3457ad[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x4212a9,null))['then'](function(_0x32ee18){if(_0x32ee18){_0x2c1c6f[_0x743f('0x45')]=_[_0x743f('0x59')](db[_0x743f('0x6d')][_0x743f('0x42')]);_0x2c1c6f[_0x743f('0x48')]=_[_0x743f('0x59')](_0x3457ad['query']);_0x2c1c6f[_0x743f('0x46')]=_[_0x743f('0x47')](_0x2c1c6f[_0x743f('0x45')],_0x2c1c6f[_0x743f('0x48')]);_0x571f4a[_0x743f('0x49')]=_[_0x743f('0x47')](_0x2c1c6f[_0x743f('0x45')],qs[_0x743f('0x4a')](_0x3457ad[_0x743f('0x48')]['fields']));_0x571f4a[_0x743f('0x49')]=_0x571f4a[_0x743f('0x49')]['length']?_0x571f4a[_0x743f('0x49')]:_0x2c1c6f[_0x743f('0x45')];if(!_0x3457ad[_0x743f('0x48')][_0x743f('0x4b')](_0x743f('0x4c'))){_0x571f4a['limit']=qs[_0x743f('0x32')](_0x3457ad[_0x743f('0x48')][_0x743f('0x32')]);_0x571f4a[_0x743f('0x31')]=qs[_0x743f('0x31')](_0x3457ad[_0x743f('0x48')][_0x743f('0x31')]);}_0x571f4a['order']=qs[_0x743f('0x4e')](_0x3457ad[_0x743f('0x48')][_0x743f('0x4e')]);_0x571f4a['where']=qs[_0x743f('0x46')](_[_0x743f('0x67')](_0x3457ad[_0x743f('0x48')],_0x2c1c6f[_0x743f('0x46')]));_0x571f4a['where'][_0x743f('0x62')]=_0x32ee18['id'];if(_0x3457ad[_0x743f('0x48')][_0x743f('0x50')]){_0x571f4a['where']=_[_0x743f('0x51')](_0x571f4a['where'],{'$or':_[_0x743f('0x52')](_0x571f4a[_0x743f('0x49')],function(_0xa7c256){var _0x569783={};_0x569783[_0xa7c256]={'$like':'%'+_0x3457ad['query'][_0x743f('0x50')]+'%'};return _0x569783;})});}_0x571f4a=_[_0x743f('0x51')]({},_0x571f4a,_0x3457ad[_0x743f('0x53')]);return db[_0x743f('0x6d')][_0x743f('0x33')]({'where':_0x571f4a['where']})[_0x743f('0x21')](function(_0xdc82ec){_0x5dab6e['count']=_0xdc82ec;if(_0x3457ad[_0x743f('0x48')][_0x743f('0x54')]){_0x571f4a[_0x743f('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x743f('0x56')](_0x571f4a);})[_0x743f('0x21')](function(_0x1e5425){_0x5dab6e[_0x743f('0x68')]=_0x1e5425;return _0x5dab6e;});}})[_0x743f('0x21')](respondWithFilteredResult(_0x4212a9,_0x571f4a))[_0x743f('0x2c')](handleError(_0x4212a9,null));};exports['removeAnswers']=function(_0x4c34a9,_0x24b9b1,_0x10049c){return db['SmsAccount']['find']({'where':{'id':_0x4c34a9[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x24b9b1,null))[_0x743f('0x21')](function(_0x5449b5){if(_0x5449b5){return _0x5449b5['removeAnswers'](_0x4c34a9[_0x743f('0x48')][_0x743f('0x6a')]);}})['then'](respondWithStatusCode(_0x24b9b1,null))[_0x743f('0x2c')](handleError(_0x24b9b1,null));};exports[_0x743f('0x6e')]=function(_0x5b1d7f,_0x45a14f,_0x36a443){var _0x375734={'channel':'sms'};var _0x4149db=[];var _0xbf5380=[];var _0x36cd99={};return db[_0x743f('0x41')][_0x743f('0x5a')]({'where':{'id':_0x5b1d7f[_0x743f('0x58')]['id']},'include':[{'model':db[_0x743f('0x6f')],'as':_0x743f('0x70')}]})['then'](handleEntityNotFound(_0x45a14f,null))[_0x743f('0x21')](function(_0x5ee4c8){_0x375734['account']=_0x5ee4c8;_0x375734['applications']=_[_0x743f('0x71')](_0x5ee4c8[_0x743f('0x70')],[_0x743f('0x72')],['asc']);if(_0x375734[_0x743f('0x73')][_0x743f('0x70')]){delete _0x375734[_0x743f('0x73')][_0x743f('0x70')];}return db[_0x743f('0x74')][_0x743f('0x61')]();})[_0x743f('0x21')](function(_0x14c10b){if(!_0x14c10b){throw new db[(_0x743f('0x75'))][(_0x743f('0x76'))]('no\x20available\x20attributes');}_0x4149db=_[_0x743f('0x77')](_[_0x743f('0x59')](_0x14c10b),[_0x743f('0x78'),_0x743f('0x79')]);_0xbf5380=_[_0x743f('0x77')](_[_0x743f('0x59')](_0x14c10b),[_0x743f('0x78'),_0x743f('0x79'),'CompanyId','ListId']);_0x375734[_0x743f('0x5c')]={'mapKey':_0x743f('0x7a')};if(_0x375734[_0x743f('0x73')]['type']){switch(_0x375734[_0x743f('0x73')]['type']){case _0x743f('0x7b'):_0x375734[_0x743f('0x5c')]['from']=_0x5b1d7f['body'][_0x743f('0x7c')];_0x375734[_0x743f('0x5c')][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x7d')];_0x375734['body'][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x7f')];break;case _0x743f('0x80'):_0x375734['body'][_0x743f('0x81')]='+'+_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x82')];_0x375734[_0x743f('0x5c')][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x83')];break;case _0x743f('0x84'):_0x375734[_0x743f('0x5c')]['from']=_0x5b1d7f['body'][_0x743f('0x81')];_0x375734[_0x743f('0x5c')][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')]['message'];break;case _0x743f('0x85'):_0x375734[_0x743f('0x5c')][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x81')];_0x375734[_0x743f('0x5c')]['body']=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x5c')];_0x375734[_0x743f('0x5c')]['messageId']=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x86')];break;case _0x743f('0x87'):_0x375734[_0x743f('0x5c')][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')]['From'];_0x375734[_0x743f('0x5c')][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x88')];_0x375734[_0x743f('0x5c')][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x89')];break;case _0x743f('0x8a'):_0x375734['body'][_0x743f('0x81')]='+'+_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x8b')][0x0]['from'];_0x375734['body'][_0x743f('0x5c')]=_0x5b1d7f['body'][_0x743f('0x8b')][0x0]['text'];_0x375734[_0x743f('0x5c')][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x8b')][0x0][_0x743f('0x7e')];break;case _0x743f('0x8c'):_0x375734['body'][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x8d')];_0x375734['body'][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x8e')]['message'];break;case _0x743f('0x8f'):_0x375734['body'][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x90')];_0x375734['body']['body']=_0x5b1d7f['body'][_0x743f('0x83')];_0x375734[_0x743f('0x5c')][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')]['replyMessageId'];break;case'bandwidth':_0x375734[_0x743f('0x5c')][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')][0x0][_0x743f('0x2a')]['id'];_0x375734[_0x743f('0x5c')][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')][0x0][_0x743f('0x2a')][_0x743f('0x81')];_0x375734[_0x743f('0x5c')]['body']=_0x5b1d7f[_0x743f('0x5c')][0x0][_0x743f('0x2a')][_0x743f('0x83')];break;case _0x743f('0x91'):_0x375734[_0x743f('0x5c')][_0x743f('0x81')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x81')];_0x375734['body'][_0x743f('0x5c')]=_0x5b1d7f[_0x743f('0x5c')]['message'];_0x375734[_0x743f('0x5c')][_0x743f('0x7e')]=_0x5b1d7f[_0x743f('0x5c')][_0x743f('0x92')];break;}}if(_0x375734['body']['id']){delete _0x375734['body']['id'];}if(_[_0x743f('0x93')](_0x375734[_0x743f('0x5c')][_0x743f('0x81')])){throw new db[(_0x743f('0x75'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x743f('0x93')](_0x375734['body'][_0x743f('0x5c')])||_0x375734[_0x743f('0x5c')][_0x743f('0x5c')]===''){throw new db['Sequelize'][(_0x743f('0x76'))](_0x743f('0x94'));}if(_['isNil'](_0x375734[_0x743f('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x743f('0x76'))](_0x743f('0x95')+_0xbf5380);}if(!_[_0x743f('0x96')](_0xbf5380,_0x375734[_0x743f('0x5c')][_0x743f('0x97')])){throw new db[(_0x743f('0x75'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbf5380);}_0x36cd99[_0x375734['body'][_0x743f('0x97')]]=_0x375734[_0x743f('0x5c')][_0x743f('0x81')];return db[_0x743f('0x98')][_0x743f('0x5a')]({'where':{'id':_0x375734['account']['ListId']},'include':[{'model':db[_0x743f('0x74')],'as':_0x743f('0x99'),'where':_0x36cd99,'limit':0x1,'order':[[_0x743f('0x79'),_0x743f('0x9a')]]}]});})[_0x743f('0x21')](handleEntityNotFound(_0x45a14f,null))['then'](function(_0x344d14){if(_0x344d14){_0x375734[_0x743f('0x9b')]=_[_0x743f('0x9c')](_0x344d14,[_0x743f('0x99')]);if(_0x344d14[_0x743f('0x99')][_0x743f('0x66')]){return _0x344d14[_0x743f('0x99')][0x0];}var _0x1598cf=_[_0x743f('0x1b')](_0x375734[_0x743f('0x5c')],{'firstName':_0x375734[_0x743f('0x5c')]['from'],'ListId':_0x344d14['id']});_0x1598cf[_0x375734[_0x743f('0x5c')]['mapKey']]=_0x375734[_0x743f('0x5c')]['from'];return db['CmContact'][_0x743f('0x5b')](_0x1598cf,{'fields':_0x4149db,'raw':!![]});}})[_0x743f('0x21')](handleEntityNotFound(_0x45a14f,null))[_0x743f('0x21')](function(_0x24e06f){if(_0x24e06f){_0x375734[_0x743f('0x9d')]=_0x24e06f;var _0x48c63a={'ContactId':_0x24e06f['id'],'phone':_0x375734[_0x743f('0x5c')][_0x743f('0x81')],'SmsAccountId':_0x5b1d7f[_0x743f('0x58')]['id']};var _0x33bb62={'ContactId':_0x24e06f['id'],'SmsAccountId':_0x5b1d7f['params']['id'],'closed':![]};return db[_0x743f('0x9e')][_0x743f('0x5a')]({'where':_0x33bb62})['then'](function(_0x10e05f){if(_0x10e05f){return[_0x10e05f,![]];}return db[_0x743f('0x9e')][_0x743f('0x5b')](_0x48c63a)[_0x743f('0x21')](function(_0x454013){return[_0x454013,!![]];});});}})['spread'](function(_0x594d05,_0x548b3c){_0x375734[_0x743f('0x9f')]=_0x594d05[_0x743f('0xa0')]({'plain':!![]});_0x375734[_0x743f('0x9f')][_0x743f('0xa1')]=![];if(_0x548b3c){if(_0x375734[_0x743f('0x73')]['autoclose']){_0x375734['applications']['push']({'id':0x0,'priority':_0x375734[_0x743f('0xa2')]['length']+0x1,'app':_0x743f('0xa3'),'appdata':'unmanaged','interval':_0x743f('0xa4')});}_0x375734['interaction'][_0x743f('0xa1')]=!![];}return db[_0x743f('0xa5')][_0x743f('0x5b')]({'phone':_0x375734[_0x743f('0x5c')][_0x743f('0x81')],'messageId':_0x375734[_0x743f('0x5c')][_0x743f('0x7e')],'body':_0x375734[_0x743f('0x5c')][_0x743f('0x5c')],'SmsAccountId':_0x5b1d7f[_0x743f('0x58')]['id'],'SmsInteractionId':_0x594d05['id'],'direction':'in','ContactId':_0x594d05[_0x743f('0xa6')],'AttachmentId':_0x375734[_0x743f('0x5c')]['AttachmentId']});})[_0x743f('0x21')](function(_0x2fd8cf){_0x375734[_0x743f('0x2a')]=_0x2fd8cf;if(_0x375734['interaction']['UserId']){return db[_0x743f('0xa7')][_0x743f('0x5a')]({'attributes':['id','name'],'where':{'id':_0x375734[_0x743f('0x9f')][_0x743f('0xa8')]}})[_0x743f('0x21')](function(_0x4acf8f){if(_0x4acf8f){_0x375734['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x743f('0xa9'),'appdata':_0x4acf8f[_0x743f('0x3d')]+','+(_0x375734[_0x743f('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0x743f('0xa4')});}return respondWithRpcPromise('Start',_0x743f('0xaa'),_0x375734);});}return respondWithRpcPromise(_0x743f('0xab'),_0x743f('0xaa'),_0x375734);})['then'](function(_0x416e10){if(_0x416e10){var _0x1d4831=0xc8;var _0x97b168=_0x743f('0xac');logger[_0x743f('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x97b168,_0x1d4831,'entity\x20found');logger[_0x743f('0x24')](_0x743f('0xad'),_0x97b168,_0x1d4831,_0x743f('0xae'),JSON[_0x743f('0x27')](_0x416e10));if(_0x375734['account'][_0x743f('0x44')]===_0x743f('0x7b')){return _0x45a14f['status'](_0x1d4831)['set']('Content-Type',_0x743f('0xaf'))[_0x743f('0x3e')](_0x743f('0xb0'));}else{return _0x45a14f[_0x743f('0x2e')](_0x1d4831)[_0x743f('0x30')](_0x416e10);}}})[_0x743f('0x2c')](handleError(_0x45a14f,null));};exports[_0x743f('0xb1')]=function(_0x3a12a4,_0x56ee96,_0x5b4d92){return db[_0x743f('0x41')][_0x743f('0x64')]({'where':{'id':_0x3a12a4[_0x743f('0x58')]['id']}})['then'](handleEntityNotFound(_0x56ee96,null))[_0x743f('0x21')](function(_0x172472){if(_0x172472){return db[_0x743f('0xb2')]['transaction'](function(_0x53f1be){return db[_0x743f('0x6f')]['destroy']({'where':{'SmsAccountId':_0x3a12a4[_0x743f('0x58')]['id']},'transaction':_0x53f1be})[_0x743f('0x21')](function(_0xace6d5){var _0x1f0bc3=_[_0x743f('0x52')](_0x3a12a4['body'],function(_0x377c1e){_0x377c1e[_0x743f('0x62')]=_0x3a12a4[_0x743f('0x58')]['id'];return _0x377c1e;});return db[_0x743f('0x6f')][_0x743f('0xb3')](_0x1f0bc3,{'transaction':_0x53f1be});});})[_0x743f('0x21')](function(){return db[_0x743f('0x6f')][_0x743f('0xb4')]({'where':{'SmsAccountId':_0x3a12a4['params']['id']},'order':_0x743f('0x72')});});}})[_0x743f('0x21')](respondWithResult(_0x56ee96,null))[_0x743f('0x2c')](handleError(_0x56ee96,null));};exports[_0x743f('0xb5')]=function(_0x2d4bf5,_0x580dcd,_0x12e4e5){var _0x5c1306={};var _0x14e115={};var _0x41efe;var _0x588a46;return db[_0x743f('0x41')]['findOne']({'where':{'id':_0x2d4bf5[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x580dcd,null))[_0x743f('0x21')](function(_0x2277f2){if(_0x2277f2){_0x41efe=_0x2277f2;_0x14e115[_0x743f('0x45')]=_[_0x743f('0x59')](db[_0x743f('0x6f')][_0x743f('0x42')]);_0x14e115['query']=_[_0x743f('0x59')](_0x2d4bf5[_0x743f('0x48')]);_0x14e115['filters']=_[_0x743f('0x47')](_0x14e115[_0x743f('0x45')],_0x14e115[_0x743f('0x48')]);_0x5c1306[_0x743f('0x49')]=_[_0x743f('0x47')](_0x14e115['model'],qs[_0x743f('0x4a')](_0x2d4bf5[_0x743f('0x48')][_0x743f('0x4a')]));_0x5c1306['attributes']=_0x5c1306[_0x743f('0x49')][_0x743f('0x66')]?_0x5c1306[_0x743f('0x49')]:_0x14e115['model'];_0x5c1306[_0x743f('0x4d')]=qs[_0x743f('0x4e')](_0x2d4bf5[_0x743f('0x48')][_0x743f('0x4e')]);_0x5c1306[_0x743f('0x4f')]=qs['filters'](_['pick'](_0x2d4bf5[_0x743f('0x48')],_0x14e115['filters']));if(_0x2d4bf5[_0x743f('0x48')][_0x743f('0x50')]){_0x5c1306[_0x743f('0x4f')]=_[_0x743f('0x51')](_0x5c1306['where'],{'$or':_[_0x743f('0x52')](_0x5c1306['attributes'],function(_0xa53f03){var _0x2f93ac={};_0x2f93ac[_0xa53f03]={'$like':'%'+_0x2d4bf5[_0x743f('0x48')]['filter']+'%'};return _0x2f93ac;})});}_0x5c1306=_['merge']({},_0x5c1306,_0x2d4bf5[_0x743f('0x53')]);return _0x41efe['getApplications'](_0x5c1306);}})[_0x743f('0x21')](function(_0x1387a4){if(_0x1387a4){_0x588a46=_0x1387a4[_0x743f('0x66')];if(!_0x2d4bf5[_0x743f('0x48')][_0x743f('0x4b')]('nolimit')){_0x5c1306['limit']=qs['limit'](_0x2d4bf5['query'][_0x743f('0x32')]);_0x5c1306[_0x743f('0x31')]=qs[_0x743f('0x31')](_0x2d4bf5['query'][_0x743f('0x31')]);}return _0x41efe['getApplications'](_0x5c1306);}})['then'](function(_0x3b8fe0){if(_0x3b8fe0){return _0x3b8fe0?{'count':_0x588a46,'rows':_0x3b8fe0}:null;}})[_0x743f('0x21')](respondWithResult(_0x580dcd,null))['catch'](handleError(_0x580dcd,null));};exports[_0x743f('0xb6')]=function(_0x3011ed,_0x51b69c,_0x4e4cd3){var _0x5e12c2={'raw':![],'where':{}};var _0x1ae126={};var _0xef2b6b={'count':0x0,'rows':[]};return db[_0x743f('0x41')][_0x743f('0x64')]({'where':{'id':_0x3011ed['params']['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x51b69c,null))[_0x743f('0x21')](function(_0x3d690c){if(_0x3d690c){_0x1ae126[_0x743f('0x45')]=_['keys'](db[_0x743f('0x9e')]['rawAttributes']);_0x1ae126[_0x743f('0x48')]=_[_0x743f('0x59')](_0x3011ed[_0x743f('0x48')]);_0x1ae126[_0x743f('0x46')]=_[_0x743f('0x47')](_0x1ae126[_0x743f('0x45')],_0x1ae126[_0x743f('0x48')]);_0x5e12c2[_0x743f('0x49')]=_[_0x743f('0x47')](_0x1ae126[_0x743f('0x45')],qs[_0x743f('0x4a')](_0x3011ed[_0x743f('0x48')][_0x743f('0x4a')]));_0x5e12c2[_0x743f('0x49')]=_0x5e12c2[_0x743f('0x49')][_0x743f('0x66')]?_0x5e12c2['attributes']:_0x1ae126[_0x743f('0x45')];if(!_0x3011ed[_0x743f('0x48')][_0x743f('0x4b')](_0x743f('0x4c'))){_0x5e12c2[_0x743f('0x32')]=qs[_0x743f('0x32')](_0x3011ed[_0x743f('0x48')][_0x743f('0x32')]);_0x5e12c2[_0x743f('0x31')]=qs[_0x743f('0x31')](_0x3011ed['query']['offset']);}_0x5e12c2[_0x743f('0x4d')]=qs[_0x743f('0x4e')](_0x3011ed[_0x743f('0x48')]['sort']);_0x5e12c2[_0x743f('0x4f')]=qs['filters'](_[_0x743f('0x67')](_0x3011ed[_0x743f('0x48')],_0x1ae126[_0x743f('0x46')]));_0x5e12c2[_0x743f('0x4f')][_0x743f('0x62')]=_0x3d690c['id'];if(_0x3011ed[_0x743f('0x48')][_0x743f('0x50')]){_0x5e12c2[_0x743f('0x4f')]=_[_0x743f('0x51')](_0x5e12c2['where'],{'$or':_[_0x743f('0x52')](_0x5e12c2[_0x743f('0x49')],function(_0x174ce6){var _0x5a59d6={};_0x5a59d6[_0x174ce6]={'$like':'%'+_0x3011ed['query'][_0x743f('0x50')]+'%'};return _0x5a59d6;})});}_0x5e12c2=_[_0x743f('0x51')]({},_0x5e12c2,_0x3011ed[_0x743f('0x53')]);return db[_0x743f('0x9e')][_0x743f('0x33')]({'where':_0x5e12c2['where']})[_0x743f('0x21')](function(_0xa6001b){_0xef2b6b[_0x743f('0x33')]=_0xa6001b;if(_0x3011ed[_0x743f('0x48')][_0x743f('0x54')]){_0x5e12c2[_0x743f('0x55')]=[{'model':db['CmContact'],'as':_0x743f('0xb7'),'required':![]},{'model':db[_0x743f('0xa7')],'as':_0x743f('0xb8'),'attributes':['name','fullname',_0x743f('0xb9')],'required':![]},{'model':db[_0x743f('0xba')],'as':_0x743f('0xbb'),'attributes':['id',_0x743f('0x3d'),_0x743f('0xbc')],'where':_0x3011ed[_0x743f('0x48')][_0x743f('0xbd')]?{'id':_0x3011ed[_0x743f('0x48')]['tag']}:undefined,'required':_0x3011ed[_0x743f('0x48')][_0x743f('0xbd')]?!![]:![]}];}return db[_0x743f('0x9e')][_0x743f('0x56')](_0x5e12c2);})[_0x743f('0x21')](function(_0x185df2){_0xef2b6b[_0x743f('0x68')]=_0x185df2;return _0xef2b6b;});}})[_0x743f('0x21')](respondWithFilteredResult(_0x51b69c,_0x5e12c2))['catch'](handleError(_0x51b69c,null));};exports[_0x743f('0x3e')]=function(_0x1afe9f,_0x5abc6f,_0x36a7e6){var _0x20a57e,_0x45d88e,_0x2fde5e;if(_['isNil'](_0x1afe9f['body'][_0x743f('0x5c')])||_0x1afe9f[_0x743f('0x5c')]['body']===''){throw new db[(_0x743f('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x743f('0x93')](_0x1afe9f[_0x743f('0x5c')]['to'])){throw new db[(_0x743f('0x75'))][(_0x743f('0x76'))](_0x743f('0xbe'));}_0x20a57e=_0x1afe9f[_0x743f('0x5c')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x1afe9f['params']['id']},'include':[{'model':db[_0x743f('0x98')],'as':_0x743f('0xbf'),'include':[{'model':db[_0x743f('0x74')],'as':_0x743f('0x99'),'where':{'mobile':_0x20a57e},'limit':0x1,'order':[[_0x743f('0x79'),_0x743f('0x9a')]]}]}]})[_0x743f('0x21')](handleEntityNotFound(_0x5abc6f,null))[_0x743f('0x21')](function(_0x46fb07){if(_0x46fb07&&_0x46fb07[_0x743f('0xbf')]){_0x45d88e=_0x46fb07['get']({'plain':!![]});if(_0x45d88e[_0x743f('0xbf')]&&_0x45d88e[_0x743f('0xbf')][_0x743f('0x99')][_0x743f('0x66')]){return _0x45d88e[_0x743f('0xbf')][_0x743f('0x99')][0x0];}return db[_0x743f('0x74')][_0x743f('0x5b')](_[_0x743f('0x1b')](_0x1afe9f[_0x743f('0x5c')],{'firstName':_0x20a57e,'mobile':_0x20a57e,'phone':_0x20a57e,'ListId':_0x45d88e[_0x743f('0xc0')]}));}})[_0x743f('0x21')](handleEntityNotFound(_0x5abc6f,null))[_0x743f('0x21')](function(_0x128c1c){if(_0x128c1c){_0x2fde5e=_0x128c1c;return db[_0x743f('0x9e')][_0x743f('0x5a')]({'where':{'ContactId':_0x2fde5e['id'],'closed':![],'SmsAccountId':_0x45d88e['id']}})[_0x743f('0x21')](function(_0x50decf){if(_0x50decf){return[_0x50decf,![]];}return db[_0x743f('0x9e')][_0x743f('0x5b')]({'UserId':_0x1afe9f[_0x743f('0x5d')]['id'],'ContactId':_0x2fde5e['id'],'SmsAccountId':_0x45d88e['id'],'phone':_0x20a57e,'firstMsgDirection':_0x743f('0xc1'),'Messages':[_[_0x743f('0x51')](_0x1afe9f[_0x743f('0x5c')],{'read':![],'body':_0x1afe9f[_0x743f('0x5c')]['body'],'phone':_0x20a57e,'SmsAccountId':_0x45d88e['id'],'UserId':_0x1afe9f[_0x743f('0x5d')]['id'],'ContactId':_0x2fde5e['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x743f('0xc2')}]})[_0x743f('0x21')](function(_0x291d9f){return[_0x291d9f,!![]];});});}})[_0x743f('0xc3')](function(_0x43efad,_0x2c04d1){if(_0x2c04d1){return _0x43efad;}return db['SmsMessage'][_0x743f('0x5b')](_['merge'](_0x1afe9f[_0x743f('0x5c')],{'read':![],'body':_0x1afe9f['body'][_0x743f('0x5c')],'phone':_0x20a57e,'SmsAccountId':_0x45d88e['id'],'SmsInteractionId':_0x43efad['id'],'UserId':_0x1afe9f[_0x743f('0x5d')]['id'],'ContactId':_0x2fde5e['id']}))[_0x743f('0x21')](function(_0xc61c49){_0x43efad[_0x743f('0xc4')][_0x743f('0xc2')]=[];_0x43efad['dataValues'][_0x743f('0xc2')][_0x743f('0xc5')](_0xc61c49[_0x743f('0xc4')]);return _0x43efad;});})[_0x743f('0x21')](respondWithResult(_0x5abc6f,null))['catch'](handleError(_0x5abc6f,null));};exports[_0x743f('0x2e')]=function(_0x180202,_0x55e7b2,_0x2cd93f){if(_0x180202['body']['id']){delete _0x180202[_0x743f('0x5c')]['id'];}var _0x25bd42,_0x2d1e28,_0x4be4a6;return db[_0x743f('0x41')]['find']({'where':{'id':_0x180202['params']['id']}})['then'](handleEntityNotFound(_0x55e7b2,null))[_0x743f('0x21')](function(_0x3d675b){if(_0x3d675b){_0x4be4a6=_0x3d675b;logger[_0x743f('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x743f('0x2e'),_0x743f('0xc6'),_0x3d675b[_0x743f('0x44')],util['inspect'](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));switch(_0x3d675b[_0x743f('0x44')]){case _0x743f('0x80'):if(_0x180202['body']['skebby_dispatch_id']&&_0x180202[_0x743f('0x5c')][_0x743f('0x2e')]){_0x2d1e28=_0x180202['body'][_0x743f('0x2e')];return db[_0x743f('0xa5')][_0x743f('0x5a')]({'where':{'messageId':_0x180202[_0x743f('0x5c')]['skebby_dispatch_id']}});}break;case _0x743f('0x84'):if(_0x180202['body']['requestid']&&_0x180202[_0x743f('0x5c')][_0x743f('0xc7')]){_0x2d1e28=_0x180202[_0x743f('0x5c')][_0x743f('0xc7')];return db['SmsMessage']['find']({'where':{'messageId':_0x180202[_0x743f('0x5c')][_0x743f('0xc8')]}});}break;case'clicksend':if(_0x180202[_0x743f('0x5c')][_0x743f('0x86')]&&_0x180202[_0x743f('0x5c')]['status_code']){_0x2d1e28=_0x180202['body']['status_code'];return db[_0x743f('0xa5')][_0x743f('0x5a')]({'where':{'messageId':_0x180202[_0x743f('0x5c')][_0x743f('0x86')]}});}break;case'infobip':var _0x53f766=_0x180202[_0x743f('0x5c')][_0x743f('0x8b')][0x0];if(_0x53f766['messageId']&&_0x53f766[_0x743f('0x2e')]['groupName']===_0x743f('0xc9')){_0x2d1e28=_0x53f766[_0x743f('0x2e')][_0x743f('0xca')];return db[_0x743f('0xa5')][_0x743f('0x5a')]({'where':{'messageId':_0x53f766[_0x743f('0x7e')]}});}break;case'clickatell':if(_0x180202['body'][_0x743f('0x7e')]&&_0x180202['body'][_0x743f('0x2e')]){_0x2d1e28=_0x180202['body']['status'];return db['SmsMessage'][_0x743f('0x5a')]({'where':{'messageId':_0x180202[_0x743f('0x5c')][_0x743f('0x7e')]}});}break;case _0x743f('0xcb'):if(_0x180202['body'][0x0]['message']['id']){_0x2d1e28=_0x180202[_0x743f('0x5c')][0x0][_0x743f('0x44')];return db[_0x743f('0xa5')][_0x743f('0x5a')]({'where':{'messageId':_0x180202[_0x743f('0x5c')][0x0][_0x743f('0x2a')]['id']}});}break;case _0x743f('0x91'):if(_0x180202[_0x743f('0x5c')][_0x743f('0xcc')]&&_0x180202[_0x743f('0x5c')][_0x743f('0x2e')]){_0x2d1e28=_0x180202['body'][_0x743f('0x2e')];return db[_0x743f('0xa5')]['find']({'where':{'messageId':_0x180202[_0x743f('0x5c')]['redif']}});}break;}}})[_0x743f('0x21')](handleEntityNotFound(_0x55e7b2,null))['then'](function(_0x9267aa){if(_0x9267aa){_0x25bd42=_0x9267aa;switch(_0x4be4a6[_0x743f('0x44')]){case _0x743f('0x80'):if(_0x2d1e28===_0x743f('0xc9')){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')](_0x743f('0x25'),_0x743f('0x2e'),'skebby',util['inspect'](_0x180202['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2d1e28==='1'){return _0x25bd42['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x743f('0x80'),util[_0x743f('0xcd')](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x743f('0x85'):if(!_0x180202[_0x743f('0x5c')][_0x743f('0xce')]&&_0x2d1e28>=0xc8&&_0x2d1e28<=0xce){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')](_0x743f('0x25'),_0x743f('0x2e'),_0x743f('0x85'),util[_0x743f('0xcd')](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x743f('0x8a'):var _0x3f9121=_0x180202[_0x743f('0x5c')]['results'][0x0];if(_0x3f9121['status']['groupName']===_0x743f('0xc9')){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')](_0x743f('0x25'),_0x743f('0x2e'),_0x743f('0x8a'),util[_0x743f('0xcd')](_0x180202['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2d1e28==_0x743f('0xcf')||_0x2d1e28==_0x743f('0xd0')){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')](_0x743f('0x25'),_0x743f('0x2e'),_0x743f('0x8f'),util[_0x743f('0xcd')](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x743f('0xcb'):if(_0x2d1e28==_0x743f('0xd1')){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')](_0x743f('0x25'),'status',_0x743f('0xcb'),util['inspect'](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x743f('0x91'):if(_0x2d1e28===_0x743f('0xd2')||_0x2d1e28===_0x743f('0xd3')){return _0x25bd42[_0x743f('0x39')]({'read':!![]});}else{logger['error'](_0x743f('0x25'),_0x743f('0x2e'),_0x743f('0x91'),util[_0x743f('0xcd')](_0x180202[_0x743f('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x25bd42;}})['then'](respondWithResult(_0x55e7b2,null))['catch'](handleError(_0x55e7b2,null));};exports[_0x743f('0xd4')]=function(_0x3157ae,_0x522791,_0xee0b11){var _0x177cd4,_0x8c1bef,_0x4e1e70;return db[_0x743f('0x41')][_0x743f('0x5a')]({'where':{'id':_0x3157ae[_0x743f('0x58')]['id']}})['then'](handleEntityNotFound(_0x522791,null))['then'](function(_0x212ac7){if(_0x212ac7){_0x4e1e70=_0x212ac7;logger[_0x743f('0x24')](_0x743f('0x25'),_0x743f('0x2e'),_0x743f('0xc6'),_0x212ac7[_0x743f('0x44')],util['inspect'](_0x3157ae[_0x743f('0x48')],{'showHidden':![],'depth':null}));switch(_0x212ac7[_0x743f('0x44')]){case _0x743f('0x8c'):if(_0x3157ae[_0x743f('0x48')][_0x743f('0xd5')]&&_0x3157ae[_0x743f('0x48')]['state']){_0x8c1bef=_0x3157ae['query'][_0x743f('0xd6')];return db[_0x743f('0xa5')][_0x743f('0x5a')]({'where':{'messageId':_0x3157ae[_0x743f('0x48')][_0x743f('0xd5')]}});}break;}}})[_0x743f('0x21')](handleEntityNotFound(_0x522791,null))['then'](function(_0x166ef0){if(_0x166ef0){_0x177cd4=_0x166ef0;switch(_0x4e1e70['type']){case _0x743f('0x8c'):if(_0x8c1bef==='2'||_0x8c1bef==='6'){return _0x177cd4[_0x743f('0x39')]({'read':!![]});}else{logger[_0x743f('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x743f('0x2e'),'csc',util[_0x743f('0xcd')](_0x3157ae[_0x743f('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x177cd4;}})[_0x743f('0x21')](respondWithResult(_0x522791,null))['catch'](handleError(_0x522791,null));};exports['addAgents']=function(_0x1de4ce,_0x4dfa5b,_0x4b973e){return db['SmsAccount'][_0x743f('0x5a')]({'where':{'id':_0x1de4ce[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x4dfa5b,null))[_0x743f('0x21')](function(_0x1ef36e){if(_0x1ef36e){return _0x1ef36e[_0x743f('0xd7')](_0x1de4ce[_0x743f('0x5c')][_0x743f('0x6a')],_[_0x743f('0x9c')](_0x1de4ce[_0x743f('0x5c')],[_0x743f('0x6a'),'id'])||{})['spread'](function(_0x5f0d30){for(var _0x2da846=0x0;_0x2da846<_0x1de4ce[_0x743f('0x5c')][_0x743f('0x6a')]['length'];_0x2da846+=0x1){socket[_0x743f('0xd8')](_0x743f('0xd9'),{'UserId':Number(_0x1de4ce[_0x743f('0x5c')][_0x743f('0x6a')][_0x2da846]),'SmsAccountId':Number(_0x1de4ce['params']['id'])});}return _0x5f0d30;});}})['then'](respondWithResult(_0x4dfa5b,null))['catch'](handleError(_0x4dfa5b,null));};exports['removeAgents']=function(_0xd93e95,_0x56dab2,_0x3ef19b){return db[_0x743f('0x41')]['find']({'where':{'id':_0xd93e95[_0x743f('0x58')]['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x56dab2,null))['then'](function(_0xa38042){if(_0xa38042){return _0xa38042[_0x743f('0xda')](_0xd93e95[_0x743f('0x48')][_0x743f('0x6a')])[_0x743f('0x21')](function(){if(_[_0x743f('0xdb')](_0xd93e95['query'][_0x743f('0x6a')])){for(var _0x3c918e=0x0;_0x3c918e<_0xd93e95[_0x743f('0x48')]['ids'][_0x743f('0x66')];_0x3c918e+=0x1){socket['emit'](_0x743f('0xdc'),{'UserId':Number(_0xd93e95['query']['ids'][_0x3c918e]),'SmsAccountId':Number(_0xd93e95[_0x743f('0x58')]['id'])});}}else{socket[_0x743f('0xd8')](_0x743f('0xdc'),{'UserId':Number(_0xd93e95['query'][_0x743f('0x6a')]),'SmsAccountId':Number(_0xd93e95[_0x743f('0x58')]['id'])});}});}})[_0x743f('0x21')](respondWithStatusCode(_0x56dab2,null))[_0x743f('0x2c')](handleError(_0x56dab2,null));};exports['getAgents']=function(_0x2deec0,_0x58f3a0,_0x12b1d1){var _0x217f10={};var _0x4a871b={};var _0x7ce21b;var _0x125e6f;return db[_0x743f('0x41')]['findOne']({'where':{'id':_0x2deec0['params']['id']}})[_0x743f('0x21')](handleEntityNotFound(_0x58f3a0,null))[_0x743f('0x21')](function(_0x407c0f){if(_0x407c0f){_0x7ce21b=_0x407c0f;_0x4a871b[_0x743f('0x45')]=_['keys'](db[_0x743f('0xa7')][_0x743f('0x42')]);_0x4a871b[_0x743f('0x48')]=_[_0x743f('0x59')](_0x2deec0[_0x743f('0x48')]);_0x4a871b[_0x743f('0x46')]=_[_0x743f('0x47')](_0x4a871b['model'],_0x4a871b[_0x743f('0x48')]);_0x217f10[_0x743f('0x49')]=_['intersection'](_0x4a871b[_0x743f('0x45')],qs[_0x743f('0x4a')](_0x2deec0[_0x743f('0x48')][_0x743f('0x4a')]));_0x217f10['attributes']=_0x217f10[_0x743f('0x49')][_0x743f('0x66')]?_0x217f10[_0x743f('0x49')]:_0x4a871b[_0x743f('0x45')];_0x217f10[_0x743f('0x4d')]=qs['sort'](_0x2deec0['query'][_0x743f('0x4e')]);_0x217f10[_0x743f('0x4f')]=qs[_0x743f('0x46')](_[_0x743f('0x67')](_0x2deec0['query'],_0x4a871b[_0x743f('0x46')]));if(_0x2deec0[_0x743f('0x48')][_0x743f('0x50')]){_0x217f10[_0x743f('0x4f')]=_['merge'](_0x217f10[_0x743f('0x4f')],{'$or':_[_0x743f('0x52')](_0x217f10['attributes'],function(_0x4f91b0){var _0x2fc076={};_0x2fc076[_0x4f91b0]={'$like':'%'+_0x2deec0[_0x743f('0x48')][_0x743f('0x50')]+'%'};return _0x2fc076;})});}_0x217f10=_['merge']({},_0x217f10,_0x2deec0[_0x743f('0x53')]);return _0x7ce21b[_0x743f('0xdd')](_0x217f10);}})[_0x743f('0x21')](function(_0xed55cd){if(_0xed55cd){_0x125e6f=_0xed55cd[_0x743f('0x66')];if(!_0x2deec0[_0x743f('0x48')][_0x743f('0x4b')]('nolimit')){_0x217f10[_0x743f('0x32')]=qs[_0x743f('0x32')](_0x2deec0[_0x743f('0x48')]['limit']);_0x217f10['offset']=qs['offset'](_0x2deec0[_0x743f('0x48')][_0x743f('0x31')]);}return _0x7ce21b['getAgents'](_0x217f10);}})[_0x743f('0x21')](function(_0x33f847){if(_0x33f847){return _0x33f847?{'count':_0x125e6f,'rows':_0x33f847}:null;}})['then'](respondWithResult(_0x58f3a0,null))['catch'](handleError(_0x58f3a0,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index def7a4d..3a9bbeb 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 _0xd0fe=['SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x149c26,_0xf40f9){var _0x367ecd=function(_0x15ffa8){while(--_0x15ffa8){_0x149c26['push'](_0x149c26['shift']());}};_0x367ecd(++_0xf40f9);}(_0xd0fe,0x1f2));var _0xed0f=function(_0x4d951e,_0x127c93){_0x4d951e=_0x4d951e-0x0;var _0x46fb72=_0xd0fe[_0x4d951e];return _0x46fb72;};'use strict';var EventEmitter=require(_0xed0f('0x0'));var SmsAccount=require(_0xed0f('0x1'))['db'][_0xed0f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xed0f('0x3')](0x0);var events={'afterCreate':_0xed0f('0x4'),'afterUpdate':_0xed0f('0x5'),'afterDestroy':_0xed0f('0x6')};function emitEvent(_0x5217e6){return function(_0x145b52,_0x196e1b,_0x4fc79c){SmsAccountEvents[_0xed0f('0x7')](_0x5217e6+':'+_0x145b52['id'],_0x145b52);SmsAccountEvents['emit'](_0x5217e6,_0x145b52);_0x4fc79c(null);};}for(var e in events){if(events[_0xed0f('0x8')](e)){var event=events[e];SmsAccount[_0xed0f('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xa97b=['exports','events','../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','hook'];(function(_0x189a83,_0x52ad44){var _0x5b3f7c=function(_0x296788){while(--_0x296788){_0x189a83['push'](_0x189a83['shift']());}};_0x5b3f7c(++_0x52ad44);}(_0xa97b,0xbe));var _0xba97=function(_0x5c6fd2,_0x41e619){_0x5c6fd2=_0x5c6fd2-0x0;var _0x2938c1=_0xa97b[_0x5c6fd2];return _0x2938c1;};'use strict';var EventEmitter=require(_0xba97('0x0'));var SmsAccount=require(_0xba97('0x1'))['db'][_0xba97('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xba97('0x3'),'afterDestroy':_0xba97('0x4')};function emitEvent(_0xa579e7){return function(_0x3005ea,_0x56cb44,_0x25a5a3){SmsAccountEvents[_0xba97('0x5')](_0xa579e7+':'+_0x3005ea['id'],_0x3005ea);SmsAccountEvents[_0xba97('0x5')](_0xa579e7,_0x3005ea);_0x25a5a3(null);};}for(var e in events){if(events[_0xba97('0x6')](e)){var event=events[e];SmsAccount[_0xba97('0x7')](e,emitEvent(event));}}module[_0xba97('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 3f87829..4a236d6 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 _0xd635=['path','rimraf','./smsAccount.attributes','define','SmsAccount','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd635,0x18b));var _0x5d63=function(_0x2e3d56,_0x4fb6ed){_0x2e3d56=_0x2e3d56-0x0;var _0x1815c1=_0xd635[_0x2e3d56];return _0x1815c1;};'use strict';var _=require(_0x5d63('0x0'));var util=require(_0x5d63('0x1'));var logger=require(_0x5d63('0x2'))('api');var moment=require(_0x5d63('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d63('0x4'));var fs=require('fs');var path=require(_0x5d63('0x5'));var rimraf=require(_0x5d63('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d63('0x7'));module['exports']=function(_0x4eec7a,_0x3c7916){return _0x4eec7a[_0x5d63('0x8')](_0x5d63('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d4a=['lodash','util','../../config/logger','moment','request-promise','path','./smsAccount.attributes','define','SmsAccount','sms_accounts'];(function(_0x5121fb,_0x209106){var _0x36ed72=function(_0x5bc8e0){while(--_0x5bc8e0){_0x5121fb['push'](_0x5121fb['shift']());}};_0x36ed72(++_0x209106);}(_0x8d4a,0x1c2));var _0xa8d4=function(_0x568eb6,_0x5c98ab){_0x568eb6=_0x568eb6-0x0;var _0x3573c6=_0x8d4a[_0x568eb6];return _0x3573c6;};'use strict';var _=require(_0xa8d4('0x0'));var util=require(_0xa8d4('0x1'));var logger=require(_0xa8d4('0x2'))('api');var moment=require(_0xa8d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8d4('0x4'));var fs=require('fs');var path=require(_0xa8d4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8d4('0x6'));module['exports']=function(_0x5bd282,_0x18747e){return _0x5bd282[_0xa8d4('0x7')](_0xa8d4('0x8'),attributes,{'tableName':_0xa8d4('0x9'),'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 25eade4..f366062 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 _0xace8=['socket.io-emitter','./smsAccount.socket','then','info','request\x20sent','debug','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','model','map','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xace8,0x16b));var _0x8ace=function(_0x49cc6d,_0x49b7f4){_0x49cc6d=_0x49cc6d-0x0;var _0x2054d9=_0xace8[_0x49cc6d];return _0x2054d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ace('0x0'));var BPromise=require('bluebird');var rs=require(_0x8ace('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ace('0x2'))['db'];var utils=require(_0x8ace('0x3'));var logger=require(_0x8ace('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8ace('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x8ace('0x6')]=_[_0x8ace('0x7')](config[_0x8ace('0x6')],{'host':_0x8ace('0x8'),'port':0x18eb});var socket=require(_0x8ace('0x9'))(new Redis(config[_0x8ace('0x6')]));require(_0x8ace('0xa'))['register'](socket);function respondWithRpcPromise(_0x22c3a4,_0x1d548e,_0x4703db){return new BPromise(function(_0x290708,_0x598432){return client['request'](_0x22c3a4,_0x4703db)[_0x8ace('0xb')](function(_0x47dd64){logger[_0x8ace('0xc')]('SmsAccount,\x20%s,\x20%s',_0x1d548e,_0x8ace('0xd'));logger[_0x8ace('0xe')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d548e,'request\x20sent',JSON[_0x8ace('0xf')](_0x47dd64));if(_0x47dd64[_0x8ace('0x10')]){if(_0x47dd64[_0x8ace('0x10')][_0x8ace('0x11')]===0x1f4){logger[_0x8ace('0x10')]('SmsAccount,\x20%s,\x20%s',_0x1d548e,_0x47dd64[_0x8ace('0x10')][_0x8ace('0x12')]);return _0x598432(_0x47dd64[_0x8ace('0x10')]['message']);}logger[_0x8ace('0x10')](_0x8ace('0x13'),_0x1d548e,_0x47dd64[_0x8ace('0x10')][_0x8ace('0x12')]);return _0x290708(_0x47dd64['error'][_0x8ace('0x12')]);}else{logger[_0x8ace('0xc')]('SmsAccount,\x20%s,\x20%s',_0x1d548e,'request\x20sent');_0x290708(_0x47dd64[_0x8ace('0x14')]['message']);}})[_0x8ace('0x15')](function(_0x8c0c4f){logger[_0x8ace('0x10')](_0x8ace('0x13'),_0x1d548e,_0x8c0c4f);_0x598432(_0x8c0c4f);});});}exports[_0x8ace('0x16')]=function(_0x5da012){var _0x14c903=this;return new Promise(function(_0x36cd92,_0x437ebf){return db['SmsAccount'][_0x8ace('0x17')]({'raw':_0x5da012[_0x8ace('0x18')]?_0x5da012['options'][_0x8ace('0x19')]===undefined?!![]:![]:!![],'where':_0x5da012[_0x8ace('0x18')]?_0x5da012['options'][_0x8ace('0x1a')]||null:null,'attributes':_0x5da012[_0x8ace('0x18')]?_0x5da012[_0x8ace('0x18')][_0x8ace('0x1b')]||null:null,'include':_0x5da012[_0x8ace('0x18')]?_0x5da012[_0x8ace('0x18')]['include']?_['map'](_0x5da012[_0x8ace('0x18')][_0x8ace('0x1c')],function(_0x2acc01){return{'model':db[_0x2acc01[_0x8ace('0x1d')]],'as':_0x2acc01['as'],'attributes':_0x2acc01[_0x8ace('0x1b')],'include':_0x2acc01[_0x8ace('0x1c')]?_['map'](_0x2acc01[_0x8ace('0x1c')],function(_0x64d5e){return{'model':db[_0x64d5e[_0x8ace('0x1d')]],'as':_0x64d5e['as'],'attributes':_0x64d5e[_0x8ace('0x1b')],'include':_0x64d5e['include']?_[_0x8ace('0x1e')](_0x64d5e[_0x8ace('0x1c')],function(_0x17228a){return{'model':db[_0x17228a['model']],'as':_0x17228a['as'],'attributes':_0x17228a[_0x8ace('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8ace('0xb')](function(_0x4d164a){logger['info'](_0x8ace('0x16'),_0x5da012);logger[_0x8ace('0xe')](_0x8ace('0x16'),_0x5da012,JSON[_0x8ace('0xf')](_0x4d164a));_0x36cd92(_0x4d164a);})[_0x8ace('0x15')](function(_0x23444a){logger[_0x8ace('0x10')]('ShowSmsAccount',_0x23444a[_0x8ace('0x12')],_0x5da012);_0x437ebf(_0x14c903[_0x8ace('0x10')](0x1f4,_0x23444a[_0x8ace('0x12')]));});});}; \ No newline at end of file +var _0x57b1=['SmsAccount','options','attributes','include','map','model','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x1cc13d,_0x53631c){var _0x3ca024=function(_0x19672){while(--_0x19672){_0x1cc13d['push'](_0x1cc13d['shift']());}};_0x3ca024(++_0x53631c);}(_0x57b1,0x77));var _0x157b=function(_0x2e602e,_0xb323ec){_0x2e602e=_0x2e602e-0x0;var _0xad22e1=_0x57b1[_0x2e602e];return _0xad22e1;};'use strict';var _=require(_0x157b('0x0'));var util=require(_0x157b('0x1'));var moment=require(_0x157b('0x2'));var BPromise=require(_0x157b('0x3'));var rs=require(_0x157b('0x4'));var fs=require('fs');var Redis=require(_0x157b('0x5'));var db=require(_0x157b('0x6'))['db'];var utils=require(_0x157b('0x7'));var logger=require(_0x157b('0x8'))(_0x157b('0x9'));var config=require(_0x157b('0xa'));var jayson=require(_0x157b('0xb'));var client=jayson['client'][_0x157b('0xc')]({'port':0x232a});config['redis']=_[_0x157b('0xd')](config[_0x157b('0xe')],{'host':_0x157b('0xf'),'port':0x18eb});var socket=require(_0x157b('0x10'))(new Redis(config[_0x157b('0xe')]));require(_0x157b('0x11'))[_0x157b('0x12')](socket);function respondWithRpcPromise(_0x460f60,_0x332fd7,_0x384f24){return new BPromise(function(_0x2f3fe2,_0x25d448){return client[_0x157b('0x13')](_0x460f60,_0x384f24)[_0x157b('0x14')](function(_0x57df7b){logger['info'](_0x157b('0x15'),_0x332fd7,_0x157b('0x16'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x332fd7,'request\x20sent',JSON[_0x157b('0x17')](_0x57df7b));if(_0x57df7b[_0x157b('0x18')]){if(_0x57df7b[_0x157b('0x18')]['code']===0x1f4){logger[_0x157b('0x18')](_0x157b('0x15'),_0x332fd7,_0x57df7b[_0x157b('0x18')][_0x157b('0x19')]);return _0x25d448(_0x57df7b[_0x157b('0x18')][_0x157b('0x19')]);}logger[_0x157b('0x18')]('SmsAccount,\x20%s,\x20%s',_0x332fd7,_0x57df7b[_0x157b('0x18')][_0x157b('0x19')]);return _0x2f3fe2(_0x57df7b['error'][_0x157b('0x19')]);}else{logger[_0x157b('0x1a')](_0x157b('0x15'),_0x332fd7,_0x157b('0x16'));_0x2f3fe2(_0x57df7b[_0x157b('0x1b')][_0x157b('0x19')]);}})[_0x157b('0x1c')](function(_0x128cec){logger[_0x157b('0x18')]('SmsAccount,\x20%s,\x20%s',_0x332fd7,_0x128cec);_0x25d448(_0x128cec);});});}exports['ShowSmsAccount']=function(_0x454347){var _0x20be14=this;return new Promise(function(_0x3d595c,_0x3a6701){return db[_0x157b('0x1d')]['find']({'raw':_0x454347[_0x157b('0x1e')]?_0x454347['options']['raw']===undefined?!![]:![]:!![],'where':_0x454347[_0x157b('0x1e')]?_0x454347['options']['where']||null:null,'attributes':_0x454347['options']?_0x454347[_0x157b('0x1e')][_0x157b('0x1f')]||null:null,'include':_0x454347[_0x157b('0x1e')]?_0x454347['options'][_0x157b('0x20')]?_[_0x157b('0x21')](_0x454347[_0x157b('0x1e')][_0x157b('0x20')],function(_0x28e39c){return{'model':db[_0x28e39c[_0x157b('0x22')]],'as':_0x28e39c['as'],'attributes':_0x28e39c['attributes'],'include':_0x28e39c[_0x157b('0x20')]?_[_0x157b('0x21')](_0x28e39c[_0x157b('0x20')],function(_0x462e5f){return{'model':db[_0x462e5f[_0x157b('0x22')]],'as':_0x462e5f['as'],'attributes':_0x462e5f[_0x157b('0x1f')],'include':_0x462e5f[_0x157b('0x20')]?_[_0x157b('0x21')](_0x462e5f[_0x157b('0x20')],function(_0x289904){return{'model':db[_0x289904[_0x157b('0x22')]],'as':_0x289904['as'],'attributes':_0x289904['attributes']};}):[]};}):[]};}):[]:[]})[_0x157b('0x14')](function(_0x1ac1d0){logger[_0x157b('0x1a')](_0x157b('0x23'),_0x454347);logger[_0x157b('0x24')](_0x157b('0x23'),_0x454347,JSON[_0x157b('0x17')](_0x1ac1d0));_0x3d595c(_0x1ac1d0);})['catch'](function(_0xc3d4c8){logger[_0x157b('0x18')]('ShowSmsAccount',_0xc3d4c8[_0x157b('0x19')],_0x454347);_0x3a6701(_0x20be14['error'](0x1f4,_0xc3d4c8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 370a160..4343e88 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 6773b34..f6a09c5 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x71d4f3,_0x4662e1){var _0x330245=function(_0xf57e25){while(--_0xf57e25){_0x71d4f3['push'](_0x71d4f3['shift']());}};_0x330245(++_0x4662e1);}(_0x3e74,0x175));var _0x43e7=function(_0x424d04,_0x408518){_0x424d04=_0x424d04-0x0;var _0x26e743=_0x3e74[_0x424d04];return _0x26e743;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x420a96,_0xdacd11){var _0x520d2c=function(_0x510c67){while(--_0x510c67){_0x420a96['push'](_0x420a96['shift']());}};_0x520d2c(++_0xdacd11);}(_0xe14b,0x93));var _0xbe14=function(_0x58622a,_0x4ad356){_0x58622a=_0x58622a-0x0;var _0x2888db=_0xe14b[_0x58622a];return _0x2888db;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 94ebc18..70b6cc7 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 _0xbaca=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0xbaca,0xfc));var _0xabac=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbaca[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xabac('0x0'));module[_0xabac('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xabac('0x2')],'allowNull':![],'defaultValue':_0xabac('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xabac('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xabac('0x4')}}; \ No newline at end of file +var _0x2fca=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x2fca,0x1ba));var _0xa2fc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2fca[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xa2fc('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa2fc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa2fc('0x2')],'allowNull':![],'defaultValue':_0xa2fc('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa2fc('0x2')]},'interval':{'type':Sequelize[_0xa2fc('0x2')],'defaultValue':_0xa2fc('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 52e0d22..0fd2286 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 _0xd464=['fields','attributes','nolimit','sort','filters','pick','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','options','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','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','offset','undefined','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','fieldName','type','key','model','query','keys','intersection'];(function(_0x3f9f01,_0x565932){var _0x3d5ccc=function(_0x1477a0){while(--_0x1477a0){_0x3f9f01['push'](_0x3f9f01['shift']());}};_0x3d5ccc(++_0x565932);}(_0xd464,0x136));var _0x4d46=function(_0x3a6a8a,_0x377e84){_0x3a6a8a=_0x3a6a8a-0x0;var _0x56bf28=_0xd464[_0x3a6a8a];return _0x56bf28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d46('0x0'));var zipdir=require(_0x4d46('0x1'));var jsonpatch=require(_0x4d46('0x2'));var rp=require(_0x4d46('0x3'));var moment=require('moment');var BPromise=require(_0x4d46('0x4'));var Mustache=require(_0x4d46('0x5'));var util=require(_0x4d46('0x6'));var path=require(_0x4d46('0x7'));var sox=require(_0x4d46('0x8'));var csv=require(_0x4d46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d46('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4d46('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4d46('0xc'));var toCsv=require(_0x4d46('0x9'));var querystring=require(_0x4d46('0xd'));var Papa=require(_0x4d46('0xe'));var Redis=require(_0x4d46('0xf'));var authService=require(_0x4d46('0x10'));var qs=require(_0x4d46('0x11'));var as=require(_0x4d46('0x12'));var hardwareService=require(_0x4d46('0x13'));var logger=require('../../config/logger')(_0x4d46('0x14'));var utils=require(_0x4d46('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4d46('0x16'));var db=require(_0x4d46('0x17'))['db'];function respondWithStatusCode(_0x170fca,_0x443ec0){_0x443ec0=_0x443ec0||0xcc;return function(_0x137879){if(_0x137879){return _0x170fca[_0x4d46('0x18')](_0x443ec0);}return _0x170fca[_0x4d46('0x19')](_0x443ec0)['end']();};}function respondWithResult(_0x54255e,_0xaf11b6){_0xaf11b6=_0xaf11b6||0xc8;return function(_0x2edd9f){if(_0x2edd9f){return _0x54255e[_0x4d46('0x19')](_0xaf11b6)[_0x4d46('0x1a')](_0x2edd9f);}};}function respondWithFilteredResult(_0x51da0f,_0x38fb03){return function(_0x1a1475){if(_0x1a1475){var _0x4cedf9=typeof _0x38fb03[_0x4d46('0x1b')]===_0x4d46('0x1c')&&typeof _0x38fb03[_0x4d46('0x1d')]==='undefined';var _0x5eee5c=_0x1a1475['count'];var _0x384437=_0x4cedf9?0x0:_0x38fb03['offset'];var _0x4115d5=_0x4cedf9?_0x1a1475['count']:_0x38fb03[_0x4d46('0x1b')]+_0x38fb03[_0x4d46('0x1d')];var _0x1f4fdb;if(_0x4115d5>=_0x5eee5c){_0x4115d5=_0x5eee5c;_0x1f4fdb=0xc8;}else{_0x1f4fdb=0xce;}_0x51da0f[_0x4d46('0x19')](_0x1f4fdb);return _0x51da0f[_0x4d46('0x1e')]('Content-Range',_0x384437+'-'+_0x4115d5+'/'+_0x5eee5c)[_0x4d46('0x1a')](_0x1a1475);}return null;};}function patchUpdates(_0x472ffd){return function(_0x4dd8d9){try{jsonpatch['apply'](_0x4dd8d9,_0x472ffd,!![]);}catch(_0x27339d){return BPromise[_0x4d46('0x1f')](_0x27339d);}return _0x4dd8d9[_0x4d46('0x20')]();};}function saveUpdates(_0x1700a4,_0x7bd434){return function(_0x41c020){if(_0x41c020){return _0x41c020[_0x4d46('0x21')](_0x1700a4)[_0x4d46('0x22')](function(_0x5217ea){return _0x5217ea;});}return null;};}function removeEntity(_0x493fae,_0x3d1e31){return function(_0x41d1de){if(_0x41d1de){return _0x41d1de[_0x4d46('0x23')]()['then'](function(){_0x493fae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d066,_0x1a2ebc){return function(_0x3d97e5){if(!_0x3d97e5){_0x31d066[_0x4d46('0x18')](0x194);}return _0x3d97e5;};}function handleError(_0xf58c02,_0x5b9e92){_0x5b9e92=_0x5b9e92||0x1f4;return function(_0x40dc2f){logger[_0x4d46('0x24')](_0x40dc2f[_0x4d46('0x25')]);if(_0x40dc2f[_0x4d46('0x26')]){delete _0x40dc2f[_0x4d46('0x26')];}_0xf58c02[_0x4d46('0x19')](_0x5b9e92)[_0x4d46('0x27')](_0x40dc2f);};}exports[_0x4d46('0x28')]=function(_0x953834,_0x5af2a0){var _0x2d44fb={},_0x2dc211={},_0x1196bb={'count':0x0,'rows':[]};var _0x1298e5=_[_0x4d46('0x29')](db[_0x4d46('0x2a')]['rawAttributes'],function(_0x32a220){return{'name':_0x32a220[_0x4d46('0x2b')],'type':_0x32a220[_0x4d46('0x2c')][_0x4d46('0x2d')]};});_0x2dc211[_0x4d46('0x2e')]=_['map'](_0x1298e5,'name');_0x2dc211[_0x4d46('0x2f')]=_[_0x4d46('0x30')](_0x953834[_0x4d46('0x2f')]);_0x2dc211['filters']=_[_0x4d46('0x31')](_0x2dc211[_0x4d46('0x2e')],_0x2dc211[_0x4d46('0x2f')]);_0x2d44fb['attributes']=_[_0x4d46('0x31')](_0x2dc211['model'],qs[_0x4d46('0x32')](_0x953834[_0x4d46('0x2f')][_0x4d46('0x32')]));_0x2d44fb[_0x4d46('0x33')]=_0x2d44fb[_0x4d46('0x33')]['length']?_0x2d44fb[_0x4d46('0x33')]:_0x2dc211[_0x4d46('0x2e')];if(!_0x953834[_0x4d46('0x2f')]['hasOwnProperty'](_0x4d46('0x34'))){_0x2d44fb[_0x4d46('0x1d')]=qs[_0x4d46('0x1d')](_0x953834[_0x4d46('0x2f')][_0x4d46('0x1d')]);_0x2d44fb[_0x4d46('0x1b')]=qs[_0x4d46('0x1b')](_0x953834[_0x4d46('0x2f')][_0x4d46('0x1b')]);}_0x2d44fb['order']=qs[_0x4d46('0x35')](_0x953834['query'][_0x4d46('0x35')]);_0x2d44fb['where']=qs[_0x4d46('0x36')](_[_0x4d46('0x37')](_0x953834[_0x4d46('0x2f')],_0x2dc211[_0x4d46('0x36')]),_0x1298e5);if(_0x953834[_0x4d46('0x2f')]['filter']){_0x2d44fb[_0x4d46('0x38')]=_[_0x4d46('0x39')](_0x2d44fb[_0x4d46('0x38')],{'$or':_[_0x4d46('0x29')](_0x1298e5,function(_0x589b7a){if(_0x589b7a[_0x4d46('0x2c')]!==_0x4d46('0x3a')){var _0x15b638={};_0x15b638[_0x589b7a[_0x4d46('0x26')]]={'$like':'%'+_0x953834[_0x4d46('0x2f')]['filter']+'%'};return _0x15b638;}})});}_0x2d44fb=_[_0x4d46('0x39')]({},_0x2d44fb,_0x953834['options']);var _0x51c83b={'where':_0x2d44fb['where']};return db[_0x4d46('0x2a')][_0x4d46('0x3b')](_0x51c83b)[_0x4d46('0x22')](function(_0x5cc325){_0x1196bb[_0x4d46('0x3b')]=_0x5cc325;if(_0x953834[_0x4d46('0x2f')][_0x4d46('0x3c')]){_0x2d44fb[_0x4d46('0x3d')]=[{'all':!![]}];}return db[_0x4d46('0x2a')][_0x4d46('0x3e')](_0x2d44fb);})[_0x4d46('0x22')](function(_0x53e3a3){_0x1196bb[_0x4d46('0x3f')]=_0x53e3a3;return _0x1196bb;})['then'](respondWithFilteredResult(_0x5af2a0,_0x2d44fb))['catch'](handleError(_0x5af2a0,null));};exports[_0x4d46('0x40')]=function(_0x493576,_0x4a7250){var _0x215e7e={'raw':!![],'where':{'id':_0x493576[_0x4d46('0x41')]['id']}},_0xd8fa2b={};_0xd8fa2b[_0x4d46('0x2e')]=_[_0x4d46('0x30')](db['SmsApplication'][_0x4d46('0x42')]);_0xd8fa2b[_0x4d46('0x2f')]=_[_0x4d46('0x30')](_0x493576[_0x4d46('0x2f')]);_0xd8fa2b[_0x4d46('0x36')]=_[_0x4d46('0x31')](_0xd8fa2b[_0x4d46('0x2e')],_0xd8fa2b['query']);_0x215e7e[_0x4d46('0x33')]=_[_0x4d46('0x31')](_0xd8fa2b[_0x4d46('0x2e')],qs[_0x4d46('0x32')](_0x493576['query'][_0x4d46('0x32')]));_0x215e7e[_0x4d46('0x33')]=_0x215e7e['attributes'][_0x4d46('0x43')]?_0x215e7e['attributes']:_0xd8fa2b[_0x4d46('0x2e')];if(_0x493576[_0x4d46('0x2f')][_0x4d46('0x3c')]){_0x215e7e[_0x4d46('0x3d')]=[{'all':!![]}];}_0x215e7e=_[_0x4d46('0x39')]({},_0x215e7e,_0x493576[_0x4d46('0x44')]);return db['SmsApplication'][_0x4d46('0x45')](_0x215e7e)[_0x4d46('0x22')](handleEntityNotFound(_0x4a7250,null))[_0x4d46('0x22')](respondWithResult(_0x4a7250,null))[_0x4d46('0x46')](handleError(_0x4a7250,null));};exports['create']=function(_0x7a238c,_0x4af4c1){return db[_0x4d46('0x2a')]['create'](_0x7a238c['body'],{})[_0x4d46('0x22')](respondWithResult(_0x4af4c1,0xc9))[_0x4d46('0x46')](handleError(_0x4af4c1,null));};exports[_0x4d46('0x21')]=function(_0x54934b,_0xf4c64c){if(_0x54934b['body']['id']){delete _0x54934b['body']['id'];}return db[_0x4d46('0x2a')][_0x4d46('0x45')]({'where':{'id':_0x54934b[_0x4d46('0x41')]['id']}})['then'](handleEntityNotFound(_0xf4c64c,null))[_0x4d46('0x22')](saveUpdates(_0x54934b[_0x4d46('0x47')],null))[_0x4d46('0x22')](respondWithResult(_0xf4c64c,null))[_0x4d46('0x46')](handleError(_0xf4c64c,null));};exports[_0x4d46('0x23')]=function(_0x27c75c,_0x5be80b){return db[_0x4d46('0x2a')][_0x4d46('0x45')]({'where':{'id':_0x27c75c[_0x4d46('0x41')]['id']}})[_0x4d46('0x22')](handleEntityNotFound(_0x5be80b,null))['then'](removeEntity(_0x5be80b,null))[_0x4d46('0x46')](handleError(_0x5be80b,null));}; \ No newline at end of file +var _0x0db8=['sort','where','pick','filters','merge','VIRTUAL','name','filter','includeAll','include','findAll','rows','params','keys','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x0db8,0x18f));var _0x80db=function(_0x2ca713,_0x547d28){_0x2ca713=_0x2ca713-0x0;var _0x17feb4=_0x0db8[_0x2ca713];return _0x17feb4;};'use strict';var emlformat=require(_0x80db('0x0'));var rimraf=require(_0x80db('0x1'));var zipdir=require(_0x80db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x80db('0x4'));var util=require(_0x80db('0x5'));var path=require('path');var sox=require(_0x80db('0x6'));var csv=require(_0x80db('0x7'));var ejs=require(_0x80db('0x8'));var fs=require('fs');var fs_extra=require(_0x80db('0x9'));var _=require('lodash');var squel=require(_0x80db('0xa'));var crypto=require('crypto');var jsforce=require(_0x80db('0xb'));var deskjs=require(_0x80db('0xc'));var toCsv=require(_0x80db('0x7'));var querystring=require('querystring');var Papa=require(_0x80db('0xd'));var Redis=require(_0x80db('0xe'));var authService=require(_0x80db('0xf'));var qs=require(_0x80db('0x10'));var as=require(_0x80db('0x11'));var hardwareService=require(_0x80db('0x12'));var logger=require(_0x80db('0x13'))(_0x80db('0x14'));var utils=require(_0x80db('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x80db('0x16'));var db=require(_0x80db('0x17'))['db'];function respondWithStatusCode(_0x475aad,_0xac5ad){_0xac5ad=_0xac5ad||0xcc;return function(_0x34d6b2){if(_0x34d6b2){return _0x475aad[_0x80db('0x18')](_0xac5ad);}return _0x475aad['status'](_0xac5ad)['end']();};}function respondWithResult(_0x4e7b9c,_0x5a0117){_0x5a0117=_0x5a0117||0xc8;return function(_0x3ebd80){if(_0x3ebd80){return _0x4e7b9c['status'](_0x5a0117)['json'](_0x3ebd80);}};}function respondWithFilteredResult(_0x4f8479,_0x2c6dc5){return function(_0x2b4bec){if(_0x2b4bec){var _0x4044a0=typeof _0x2c6dc5[_0x80db('0x19')]===_0x80db('0x1a')&&typeof _0x2c6dc5[_0x80db('0x1b')]===_0x80db('0x1a');var _0xdad911=_0x2b4bec['count'];var _0x1e4934=_0x4044a0?0x0:_0x2c6dc5[_0x80db('0x19')];var _0x5660cd=_0x4044a0?_0x2b4bec[_0x80db('0x1c')]:_0x2c6dc5[_0x80db('0x19')]+_0x2c6dc5[_0x80db('0x1b')];var _0x2cbd17;if(_0x5660cd>=_0xdad911){_0x5660cd=_0xdad911;_0x2cbd17=0xc8;}else{_0x2cbd17=0xce;}_0x4f8479[_0x80db('0x1d')](_0x2cbd17);return _0x4f8479['set'](_0x80db('0x1e'),_0x1e4934+'-'+_0x5660cd+'/'+_0xdad911)[_0x80db('0x1f')](_0x2b4bec);}return null;};}function patchUpdates(_0x2e9775){return function(_0x47ffcc){try{jsonpatch[_0x80db('0x20')](_0x47ffcc,_0x2e9775,!![]);}catch(_0x5a5136){return BPromise[_0x80db('0x21')](_0x5a5136);}return _0x47ffcc[_0x80db('0x22')]();};}function saveUpdates(_0x225626,_0x3620c3){return function(_0x261e92){if(_0x261e92){return _0x261e92[_0x80db('0x23')](_0x225626)[_0x80db('0x24')](function(_0x5d3f68){return _0x5d3f68;});}return null;};}function removeEntity(_0x1daa83,_0x163d7e){return function(_0x59f559){if(_0x59f559){return _0x59f559[_0x80db('0x25')]()[_0x80db('0x24')](function(){_0x1daa83[_0x80db('0x1d')](0xcc)[_0x80db('0x26')]();});}};}function handleEntityNotFound(_0x427260,_0x4b14bd){return function(_0x39d38e){if(!_0x39d38e){_0x427260['sendStatus'](0x194);}return _0x39d38e;};}function handleError(_0x4b200d,_0x1a4dee){_0x1a4dee=_0x1a4dee||0x1f4;return function(_0x64ea12){logger[_0x80db('0x27')](_0x64ea12[_0x80db('0x28')]);if(_0x64ea12['name']){delete _0x64ea12['name'];}_0x4b200d[_0x80db('0x1d')](_0x1a4dee)[_0x80db('0x29')](_0x64ea12);};}exports[_0x80db('0x2a')]=function(_0x4a13f0,_0x2a6c9a){var _0x1fdd8f={},_0x2a761d={},_0x1f247d={'count':0x0,'rows':[]};var _0x5c92d7=_['map'](db[_0x80db('0x2b')][_0x80db('0x2c')],function(_0x973e3c){return{'name':_0x973e3c[_0x80db('0x2d')],'type':_0x973e3c[_0x80db('0x2e')][_0x80db('0x2f')]};});_0x2a761d[_0x80db('0x30')]=_[_0x80db('0x31')](_0x5c92d7,'name');_0x2a761d[_0x80db('0x32')]=_['keys'](_0x4a13f0['query']);_0x2a761d['filters']=_[_0x80db('0x33')](_0x2a761d[_0x80db('0x30')],_0x2a761d['query']);_0x1fdd8f[_0x80db('0x34')]=_[_0x80db('0x33')](_0x2a761d[_0x80db('0x30')],qs[_0x80db('0x35')](_0x4a13f0['query'][_0x80db('0x35')]));_0x1fdd8f[_0x80db('0x34')]=_0x1fdd8f[_0x80db('0x34')][_0x80db('0x36')]?_0x1fdd8f[_0x80db('0x34')]:_0x2a761d[_0x80db('0x30')];if(!_0x4a13f0['query']['hasOwnProperty'](_0x80db('0x37'))){_0x1fdd8f[_0x80db('0x1b')]=qs[_0x80db('0x1b')](_0x4a13f0[_0x80db('0x32')][_0x80db('0x1b')]);_0x1fdd8f[_0x80db('0x19')]=qs[_0x80db('0x19')](_0x4a13f0[_0x80db('0x32')][_0x80db('0x19')]);}_0x1fdd8f[_0x80db('0x38')]=qs[_0x80db('0x39')](_0x4a13f0['query']['sort']);_0x1fdd8f[_0x80db('0x3a')]=qs['filters'](_[_0x80db('0x3b')](_0x4a13f0['query'],_0x2a761d[_0x80db('0x3c')]),_0x5c92d7);if(_0x4a13f0['query']['filter']){_0x1fdd8f[_0x80db('0x3a')]=_[_0x80db('0x3d')](_0x1fdd8f['where'],{'$or':_['map'](_0x5c92d7,function(_0x2799a1){if(_0x2799a1[_0x80db('0x2e')]!==_0x80db('0x3e')){var _0x5785b3={};_0x5785b3[_0x2799a1[_0x80db('0x3f')]]={'$like':'%'+_0x4a13f0[_0x80db('0x32')][_0x80db('0x40')]+'%'};return _0x5785b3;}})});}_0x1fdd8f=_[_0x80db('0x3d')]({},_0x1fdd8f,_0x4a13f0['options']);var _0x5e36e7={'where':_0x1fdd8f[_0x80db('0x3a')]};return db[_0x80db('0x2b')][_0x80db('0x1c')](_0x5e36e7)[_0x80db('0x24')](function(_0x8a2d1e){_0x1f247d['count']=_0x8a2d1e;if(_0x4a13f0[_0x80db('0x32')][_0x80db('0x41')]){_0x1fdd8f[_0x80db('0x42')]=[{'all':!![]}];}return db[_0x80db('0x2b')][_0x80db('0x43')](_0x1fdd8f);})['then'](function(_0x27e7bb){_0x1f247d[_0x80db('0x44')]=_0x27e7bb;return _0x1f247d;})[_0x80db('0x24')](respondWithFilteredResult(_0x2a6c9a,_0x1fdd8f))['catch'](handleError(_0x2a6c9a,null));};exports['show']=function(_0x59754b,_0x3d8884){var _0x36a01f={'raw':!![],'where':{'id':_0x59754b[_0x80db('0x45')]['id']}},_0x47042d={};_0x47042d[_0x80db('0x30')]=_[_0x80db('0x46')](db['SmsApplication'][_0x80db('0x2c')]);_0x47042d['query']=_[_0x80db('0x46')](_0x59754b[_0x80db('0x32')]);_0x47042d['filters']=_[_0x80db('0x33')](_0x47042d[_0x80db('0x30')],_0x47042d[_0x80db('0x32')]);_0x36a01f[_0x80db('0x34')]=_['intersection'](_0x47042d[_0x80db('0x30')],qs[_0x80db('0x35')](_0x59754b[_0x80db('0x32')]['fields']));_0x36a01f['attributes']=_0x36a01f['attributes'][_0x80db('0x36')]?_0x36a01f[_0x80db('0x34')]:_0x47042d[_0x80db('0x30')];if(_0x59754b['query'][_0x80db('0x41')]){_0x36a01f['include']=[{'all':!![]}];}_0x36a01f=_[_0x80db('0x3d')]({},_0x36a01f,_0x59754b[_0x80db('0x47')]);return db[_0x80db('0x2b')][_0x80db('0x48')](_0x36a01f)['then'](handleEntityNotFound(_0x3d8884,null))[_0x80db('0x24')](respondWithResult(_0x3d8884,null))['catch'](handleError(_0x3d8884,null));};exports[_0x80db('0x49')]=function(_0x4fc40b,_0x5eb15d){return db[_0x80db('0x2b')]['create'](_0x4fc40b[_0x80db('0x4a')],{})[_0x80db('0x24')](respondWithResult(_0x5eb15d,0xc9))[_0x80db('0x4b')](handleError(_0x5eb15d,null));};exports[_0x80db('0x23')]=function(_0x485efb,_0x1d3563){if(_0x485efb['body']['id']){delete _0x485efb['body']['id'];}return db[_0x80db('0x2b')][_0x80db('0x48')]({'where':{'id':_0x485efb[_0x80db('0x45')]['id']}})[_0x80db('0x24')](handleEntityNotFound(_0x1d3563,null))[_0x80db('0x24')](saveUpdates(_0x485efb[_0x80db('0x4a')],null))[_0x80db('0x24')](respondWithResult(_0x1d3563,null))[_0x80db('0x4b')](handleError(_0x1d3563,null));};exports[_0x80db('0x25')]=function(_0x39fa68,_0x5cd5c6){return db['SmsApplication']['find']({'where':{'id':_0x39fa68[_0x80db('0x45')]['id']}})[_0x80db('0x24')](handleEntityNotFound(_0x5cd5c6,null))[_0x80db('0x24')](removeEntity(_0x5cd5c6,null))[_0x80db('0x4b')](handleError(_0x5cd5c6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index bcfce12..ef5f435 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 _0x6cb0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1d45a6,_0x3424cf){var _0x4d0386=function(_0x4fcbcf){while(--_0x4fcbcf){_0x1d45a6['push'](_0x1d45a6['shift']());}};_0x4d0386(++_0x3424cf);}(_0x6cb0,0x1bf));var _0x06cb=function(_0xb43d1b,_0x3935cf){_0xb43d1b=_0xb43d1b-0x0;var _0x4aafca=_0x6cb0[_0xb43d1b];return _0x4aafca;};'use strict';var _=require(_0x06cb('0x0'));var util=require('util');var logger=require(_0x06cb('0x1'))(_0x06cb('0x2'));var moment=require(_0x06cb('0x3'));var BPromise=require(_0x06cb('0x4'));var rp=require(_0x06cb('0x5'));var fs=require('fs');var path=require(_0x06cb('0x6'));var rimraf=require(_0x06cb('0x7'));var config=require(_0x06cb('0x8'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x23be93,_0x36eafa){return _0x23be93[_0x06cb('0x9')](_0x06cb('0xa'),attributes,{'tableName':_0x06cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06cb('0xc'),'collate':_0x06cb('0xd')});}; \ No newline at end of file +var _0x293a=['bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x15b30c,_0x2a89a5){var _0x1bf7e3=function(_0x24c1cc){while(--_0x24c1cc){_0x15b30c['push'](_0x15b30c['shift']());}};_0x1bf7e3(++_0x2a89a5);}(_0x293a,0xc0));var _0xa293=function(_0x3f4d55,_0x21aca6){_0x3f4d55=_0x3f4d55-0x0;var _0x3e9d17=_0x293a[_0x3f4d55];return _0x3e9d17;};'use strict';var _=require(_0xa293('0x0'));var util=require('util');var logger=require(_0xa293('0x1'))(_0xa293('0x2'));var moment=require(_0xa293('0x3'));var BPromise=require(_0xa293('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa293('0x5'));var rimraf=require(_0xa293('0x6'));var config=require(_0xa293('0x7'));var attributes=require(_0xa293('0x8'));module[_0xa293('0x9')]=function(_0x25811d,_0x5db3c7){return _0x25811d[_0xa293('0xa')](_0xa293('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa293('0xc'),'collate':_0xa293('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 32645a9..74fbd24 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 _0xcb22=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x32fa20,_0x7ed4ed){var _0xe524ab=function(_0x5f9dd9){while(--_0x5f9dd9){_0x32fa20['push'](_0x32fa20['shift']());}};_0xe524ab(++_0x7ed4ed);}(_0xcb22,0xc8));var _0x2cb2=function(_0x29bb51,_0x1fb819){_0x29bb51=_0x29bb51-0x0;var _0x2dbdb3=_0xcb22[_0x29bb51];return _0x2dbdb3;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var moment=require(_0x2cb2('0x2'));var BPromise=require(_0x2cb2('0x3'));var rs=require(_0x2cb2('0x4'));var fs=require('fs');var Redis=require(_0x2cb2('0x5'));var db=require(_0x2cb2('0x6'))['db'];var utils=require(_0x2cb2('0x7'));var logger=require(_0x2cb2('0x8'))(_0x2cb2('0x9'));var config=require(_0x2cb2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2cb2('0xb')][_0x2cb2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31bf9f,_0x16b1a1,_0x460984){return new BPromise(function(_0x587c3e,_0x46ec04){return client[_0x2cb2('0xd')](_0x31bf9f,_0x460984)['then'](function(_0x16b59d){logger[_0x2cb2('0xe')](_0x2cb2('0xf'),_0x16b1a1,_0x2cb2('0x10'));logger[_0x2cb2('0x11')](_0x2cb2('0x12'),_0x16b1a1,'request\x20sent',JSON['stringify'](_0x16b59d));if(_0x16b59d[_0x2cb2('0x13')]){if(_0x16b59d[_0x2cb2('0x13')]['code']===0x1f4){logger['error'](_0x2cb2('0xf'),_0x16b1a1,_0x16b59d['error'][_0x2cb2('0x14')]);return _0x46ec04(_0x16b59d['error'][_0x2cb2('0x14')]);}logger[_0x2cb2('0x13')]('SmsApplication,\x20%s,\x20%s',_0x16b1a1,_0x16b59d[_0x2cb2('0x13')][_0x2cb2('0x14')]);return _0x587c3e(_0x16b59d[_0x2cb2('0x13')]['message']);}else{logger[_0x2cb2('0xe')](_0x2cb2('0xf'),_0x16b1a1,'request\x20sent');_0x587c3e(_0x16b59d[_0x2cb2('0x15')]['message']);}})[_0x2cb2('0x16')](function(_0x26045d){logger[_0x2cb2('0x13')](_0x2cb2('0xf'),_0x16b1a1,_0x26045d);_0x46ec04(_0x26045d);});});} \ No newline at end of file +var _0x23db=['debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x23db,0x141));var _0xb23d=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x23db[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require(_0xb23d('0x3'));var rs=require(_0xb23d('0x4'));var fs=require('fs');var Redis=require(_0xb23d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb23d('0x6'))(_0xb23d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb23d('0x8'));var client=jayson[_0xb23d('0x9')][_0xb23d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056b6,_0x39799c,_0x38bed9){return new BPromise(function(_0x460fa0,_0x466785){return client[_0xb23d('0xb')](_0x2056b6,_0x38bed9)['then'](function(_0x2f91f0){logger[_0xb23d('0xc')](_0xb23d('0xd'),_0x39799c,_0xb23d('0xe'));logger[_0xb23d('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x39799c,'request\x20sent',JSON['stringify'](_0x2f91f0));if(_0x2f91f0[_0xb23d('0x10')]){if(_0x2f91f0['error'][_0xb23d('0x11')]===0x1f4){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x466785(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}logger['error'](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x460fa0(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}else{logger[_0xb23d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x39799c,'request\x20sent');_0x460fa0(_0x2f91f0[_0xb23d('0x13')][_0xb23d('0x12')]);}})[_0xb23d('0x14')](function(_0x9e5eb3){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x9e5eb3);_0x466785(_0x9e5eb3);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 182287b..728b7d0 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 _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5c00,0x17e));var _0x05c0=function(_0x30eb36,_0x4f7dab){_0x30eb36=_0x30eb36-0x0;var _0x1b33d1=_0x5c00[_0x30eb36];return _0x1b33d1;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file +var _0x96cc=['smsinteraction:destroy','delete','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update'];(function(_0x4465f9,_0x457095){var _0x5db985=function(_0x29bf87){while(--_0x29bf87){_0x4465f9['push'](_0x4465f9['shift']());}};_0x5db985(++_0x457095);}(_0x96cc,0x16c));var _0xc96c=function(_0x2b7d12,_0x32d47e){_0x2b7d12=_0x2b7d12-0x0;var _0x435fe8=_0x96cc[_0x2b7d12];return _0x435fe8;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['show']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getMessages']);router[_0xc96c('0x9')]('/:id/download',auth[_0xc96c('0xa')](),controller['download']);router[_0xc96c('0xf')]('/',auth[_0xc96c('0xa')](),controller[_0xc96c('0x10')]);router[_0xc96c('0xf')]('/:id/messages',auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0xf')](_0xc96c('0x12'),auth['isAuthenticated'](),interaction[_0xc96c('0x13')](_0xc96c('0x14'),_0xc96c('0x15')),controller[_0xc96c('0x16')]);router[_0xc96c('0x17')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),interaction[_0xc96c('0x13')](_0xc96c('0x14'),_0xc96c('0x18')),controller[_0xc96c('0x19')]);router['delete']('/:id',auth[_0xc96c('0xa')](),interaction[_0xc96c('0x13')](_0xc96c('0x14'),_0xc96c('0x1a')),controller['destroy']);router[_0xc96c('0x1b')](_0xc96c('0x12'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x1c')]);module[_0xc96c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b94c0cf..459fe76 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 _0xd8a7=['BOOLEAN','sequelize','DATE','STRING','out','ENUM'];(function(_0x176259,_0x30e46f){var _0x48dc40=function(_0x3aa524){while(--_0x3aa524){_0x176259['push'](_0x176259['shift']());}};_0x48dc40(++_0x30e46f);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x21f1a2,_0x1b9787){_0x21f1a2=_0x21f1a2-0x0;var _0xec888c=_0xd8a7[_0x21f1a2];return _0xec888c;};'use strict';var Sequelize=require(_0x7d8a('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7d8a('0x1')]},'disposition':{'type':Sequelize[_0x7d8a('0x2')]},'secondDisposition':{'type':Sequelize[_0x7d8a('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7d8a('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7d8a('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7d8a('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7d8a('0x4')]('in',_0x7d8a('0x3')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7d8a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x2d72=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2c06b4,_0x375099){var _0x58bd02=function(_0x203274){while(--_0x203274){_0x2c06b4['push'](_0x2c06b4['shift']());}};_0x58bd02(++_0x375099);}(_0x2d72,0xa8));var _0x22d7=function(_0x443fd3,_0x1f6386){_0x443fd3=_0x443fd3-0x0;var _0x5f13a9=_0x2d72[_0x443fd3];return _0x5f13a9;};'use strict';var Sequelize=require(_0x22d7('0x0'));var moment=require(_0x22d7('0x1'));module[_0x22d7('0x2')]={'closed':{'type':Sequelize[_0x22d7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x22d7('0x4')]},'disposition':{'type':Sequelize[_0x22d7('0x5')]},'secondDisposition':{'type':Sequelize[_0x22d7('0x5')]},'thirdDisposition':{'type':Sequelize[_0x22d7('0x5')]},'note':{'type':Sequelize[_0x22d7('0x5')]},'phone':{'type':Sequelize[_0x22d7('0x5')]},'read1stAt':{'type':Sequelize[_0x22d7('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x22d7('0x6')]('in',_0x22d7('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x22d7('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x22d7('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x22d7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f1e9b7b..481681a 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 _0x9820=['error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','c.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','format','transcript-%d-%s.zip','CmContact','lastName','Messages','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closedAt','disposition','direction','out','System','firstName','renderFile','views','downloadInteraction.ejs','.pdf','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x478efe,_0xcb6ce5){var _0x49924d=function(_0x3e4c88){while(--_0x3e4c88){_0x478efe['push'](_0x478efe['shift']());}};_0x49924d(++_0xcb6ce5);}(_0x9820,0xb6));var _0x0982=function(_0x53c815,_0x4659bb){_0x53c815=_0x53c815-0x0;var _0x57f866=_0x9820[_0x53c815];return _0x57f866;};'use strict';var emlformat=require(_0x0982('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0982('0x1'));var jsonpatch=require(_0x0982('0x2'));var rp=require(_0x0982('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0982('0x4'));var util=require(_0x0982('0x5'));var path=require(_0x0982('0x6'));var sox=require(_0x0982('0x7'));var csv=require(_0x0982('0x8'));var ejs=require(_0x0982('0x9'));var fs=require('fs');var fs_extra=require(_0x0982('0xa'));var _=require(_0x0982('0xb'));var squel=require(_0x0982('0xc'));var crypto=require(_0x0982('0xd'));var jsforce=require(_0x0982('0xe'));var deskjs=require(_0x0982('0xf'));var toCsv=require(_0x0982('0x8'));var querystring=require('querystring');var Papa=require(_0x0982('0x10'));var Redis=require(_0x0982('0x11'));var authService=require(_0x0982('0x12'));var qs=require(_0x0982('0x13'));var as=require(_0x0982('0x14'));var pdf=require(_0x0982('0x15'));var hardwareService=require(_0x0982('0x16'));var logger=require('../../config/logger')(_0x0982('0x17'));var utils=require('../../config/utils');var config=require(_0x0982('0x18'));var licenseUtil=require(_0x0982('0x19'));var db=require('../../mysqldb')['db'];config[_0x0982('0x1a')]=_[_0x0982('0x1b')](config[_0x0982('0x1a')],{'host':_0x0982('0x1c'),'port':0x18eb});var socket=require(_0x0982('0x1d'))(new Redis(config[_0x0982('0x1a')]));require(_0x0982('0x1e'))[_0x0982('0x1f')](socket);function respondWithStatusCode(_0x5fd9ee,_0x7ea69e){_0x7ea69e=_0x7ea69e||0xcc;return function(_0x5c0dba){if(_0x5c0dba){return _0x5fd9ee[_0x0982('0x20')](_0x7ea69e);}return _0x5fd9ee[_0x0982('0x21')](_0x7ea69e)['end']();};}function respondWithResult(_0x59aa56,_0x30c3dd){_0x30c3dd=_0x30c3dd||0xc8;return function(_0x2bbdfd){if(_0x2bbdfd){return _0x59aa56['status'](_0x30c3dd)[_0x0982('0x22')](_0x2bbdfd);}};}function respondWithFilteredResult(_0x25bdef,_0x51b4a4){return function(_0x3c5ce9){if(_0x3c5ce9){var _0x314a4c=typeof _0x51b4a4[_0x0982('0x23')]===_0x0982('0x24')&&typeof _0x51b4a4[_0x0982('0x25')]==='undefined';var _0x33e3df=_0x3c5ce9['count'];var _0x15b5bc=_0x314a4c?0x0:_0x51b4a4[_0x0982('0x23')];var _0x234795=_0x314a4c?_0x3c5ce9[_0x0982('0x26')]:_0x51b4a4[_0x0982('0x23')]+_0x51b4a4[_0x0982('0x25')];var _0xceb7c4;if(_0x234795>=_0x33e3df){_0x234795=_0x33e3df;_0xceb7c4=0xc8;}else{_0xceb7c4=0xce;}_0x25bdef[_0x0982('0x21')](_0xceb7c4);return _0x25bdef[_0x0982('0x27')](_0x0982('0x28'),_0x15b5bc+'-'+_0x234795+'/'+_0x33e3df)['json'](_0x3c5ce9);}return null;};}function patchUpdates(_0x11ec80){return function(_0x9a2c78){try{jsonpatch[_0x0982('0x29')](_0x9a2c78,_0x11ec80,!![]);}catch(_0x216259){return BPromise[_0x0982('0x2a')](_0x216259);}return _0x9a2c78[_0x0982('0x2b')]();};}function saveUpdates(_0x5624e4,_0xa0a428){return function(_0x25cfc3){if(_0x25cfc3){return _0x25cfc3[_0x0982('0x2c')](_0x5624e4)[_0x0982('0x2d')](function(_0x301ac2){return _0x301ac2;});}return null;};}function removeEntity(_0x52570c,_0xeea8b0){return function(_0x5f5462){if(_0x5f5462){return _0x5f5462[_0x0982('0x2e')]()['then'](function(){_0x52570c['status'](0xcc)[_0x0982('0x2f')]();});}};}function handleEntityNotFound(_0x24948c,_0x50d200){return function(_0x5beef3){if(!_0x5beef3){_0x24948c[_0x0982('0x20')](0x194);}return _0x5beef3;};}function handleError(_0x16a223,_0x1a5b28){_0x1a5b28=_0x1a5b28||0x1f4;return function(_0x1cabae){logger[_0x0982('0x30')](_0x1cabae[_0x0982('0x31')]);if(_0x1cabae[_0x0982('0x32')]){delete _0x1cabae[_0x0982('0x32')];}_0x16a223[_0x0982('0x21')](_0x1a5b28)[_0x0982('0x33')](_0x1cabae);};}function getInteractionUsers(_0x53bd7b,_0x1955f3){return new BPromise(function(_0x10fb31,_0x4122e1){try{if(_0x1955f3[_0x53bd7b['id']]){_0x53bd7b['Users']=_[_0x0982('0x34')](_0x1955f3[_0x53bd7b['id']],function(_0x3eb717){return{'id':_0x3eb717['id'],'fullname':_0x3eb717[_0x0982('0x35')]};});}}catch(_0x28a42b){_0x4122e1(_0x28a42b);}_0x10fb31(_0x53bd7b);});}function getInteractionTags(_0x3fb9b9,_0x264d54){return new BPromise(function(_0x165f7d,_0xd11074){try{if(_0x3fb9b9[_0x0982('0x36')]){_0x3fb9b9[_0x0982('0x37')]=[];_0x3fb9b9[_0x0982('0x36')][_0x0982('0x38')](',')[_0x0982('0x39')](function(_0x15c296){_0x3fb9b9[_0x0982('0x37')][_0x0982('0x3a')](_0x264d54[_0x15c296]);});}delete _0x3fb9b9[_0x0982('0x36')];}catch(_0x58eca8){_0xd11074(_0x58eca8);}_0x165f7d(_0x3fb9b9);});}function updateSmsInteraction(_0x3a3cdf,_0x420cbd,_0x2cc581){return new BPromise(function(_0x2c6697,_0x5d14d3){return getInteractionUsers(_0x3a3cdf,_0x2cc581)[_0x0982('0x2d')](function(_0xb679b7){return getInteractionTags(_0xb679b7,_0x420cbd);})[_0x0982('0x2d')](function(_0x905bbc){_0x2c6697(_0x905bbc);})[_0x0982('0x3b')](function(_0xcf1be0){_0x5d14d3(_0xcf1be0);});});}exports[_0x0982('0x3c')]=function(_0x141479,_0x1b760d){var _0x6431ea={},_0x47fa17={},_0x11816c={'count':0x0,'rows':[]};var _0x50cc57=_[_0x0982('0x34')](db[_0x0982('0x3d')]['rawAttributes'],function(_0x5f4602){return{'name':_0x5f4602[_0x0982('0x3e')],'type':_0x5f4602[_0x0982('0x3f')][_0x0982('0x40')]};});_0x47fa17[_0x0982('0x41')]=_[_0x0982('0x34')](_0x50cc57,_0x0982('0x32'));_0x47fa17[_0x0982('0x42')]=_[_0x0982('0x43')](_0x141479['query']);_0x47fa17[_0x0982('0x44')]=_[_0x0982('0x45')](_0x47fa17[_0x0982('0x41')],_0x47fa17[_0x0982('0x42')]);_0x6431ea[_0x0982('0x46')]=_[_0x0982('0x45')](_0x47fa17['model'],qs['fields'](_0x141479[_0x0982('0x42')][_0x0982('0x47')]));_0x6431ea['attributes']=_0x6431ea[_0x0982('0x46')]['length']?_0x6431ea[_0x0982('0x46')]:_0x47fa17[_0x0982('0x41')];if(!_0x141479['query'][_0x0982('0x48')](_0x0982('0x49'))){_0x6431ea[_0x0982('0x25')]=qs['limit'](_0x141479[_0x0982('0x42')][_0x0982('0x25')]);_0x6431ea[_0x0982('0x23')]=qs['offset'](_0x141479[_0x0982('0x42')][_0x0982('0x23')]);}_0x6431ea['order']=qs['sort'](_0x141479['query'][_0x0982('0x4a')]);_0x6431ea[_0x0982('0x4b')]=qs[_0x0982('0x44')](_[_0x0982('0x4c')](_0x141479[_0x0982('0x42')],_0x47fa17[_0x0982('0x44')]),_0x50cc57);var _0x2e36a7=[];var _0x28308c=squel[_0x0982('0x4d')]()[_0x0982('0x4e')]('id')['field'](_0x0982('0x32'))[_0x0982('0x4e')](_0x0982('0x4f'))[_0x0982('0x50')]('tools_tags');var _0x1af683=squel['select']()[_0x0982('0x4e')]('u.id')['field']('u.fullname')[_0x0982('0x4e')](_0x0982('0x51'))[_0x0982('0x50')](_0x0982('0x52'),'ui')[_0x0982('0x53')](_0x0982('0x54'),'u',_0x0982('0x55'));var _0x33a96a=squel[_0x0982('0x4d')]()[_0x0982('0x50')](_0x0982('0x56'),'i')[_0x0982('0x53')](_0x0982('0x57'),'c',_0x0982('0x58'))[_0x0982('0x53')]('users','o',_0x0982('0x59'))[_0x0982('0x53')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x0982('0x53')](_0x0982('0x5a'),'me',_0x0982('0x5b'))[_0x0982('0x53')](_0x0982('0x5c'),'it',_0x0982('0x5d'))[_0x0982('0x53')]('tools_tags','t',_0x0982('0x5e'));var _0xeff30d=squel['expr']();var _0x604a08=[];var _0x2f2e70=squel[_0x0982('0x5f')]();var _0x2db8d2;if(_0x141479[_0x0982('0x42')]['search']){_0x2db8d2=as['parseSearch'](_0x141479[_0x0982('0x42')]['search']);var _0x1825ed=_0x2db8d2[_0x0982('0x60')];for(var _0xcc4c02=0x0;_0xcc4c02<_0x2db8d2[_0x0982('0x61')][_0x0982('0x62')];_0xcc4c02++){var _0x3543e2=_0x2db8d2[_0x0982('0x61')][_0xcc4c02];var _0xa4adaa='i';var _0x6a99fd=_[_0x0982('0x63')](_0x50cc57,[_0x0982('0x32'),_0x3543e2['field']]);if(!_0x6a99fd){switch(_0x3543e2[_0x0982('0x4e')]){case'unreadMessages':if(_0x3543e2[_0x0982('0x64')]==0x1){_0x33a96a[_0x0982('0x65')]('`'+_0x3543e2['field']+_0x0982('0x66'));}else{_0x33a96a[_0x0982('0x65')]('`'+_0x3543e2[_0x0982('0x4e')]+_0x0982('0x67'));}break;case _0x0982('0x68'):if(_0x3543e2['operator']===_0x0982('0x69')){if(_0x3543e2[_0x0982('0x64')]['split']('\x20')[_0x0982('0x62')]>0x1){_0xeff30d[_0x1825ed](_0x0982('0x6a'),qs[_0x0982('0x6b')](_0x3543e2[_0x0982('0x64')]),null);}else{var _0x2a4f85='%'+_0x3543e2['value']+'%';_0xeff30d[_0x1825ed](_0x0982('0x6c'),_0x2a4f85,_0x2a4f85,_0x2a4f85);}}else{_0x6a99fd=_[_0x0982('0x63')](_0x50cc57,[_0x0982('0x32'),_0x0982('0x6d')]);_0x3543e2[_0x0982('0x4e')]=_0x0982('0x6d');_0x2719d5=as[_0x0982('0x6e')](_0xa4adaa,_0x6a99fd[_0x0982('0x3f')],_0x3543e2);_0xeff30d[_0x1825ed](_0x2719d5[_0x0982('0x6f')],_0x2719d5[_0x0982('0x64')][_0x0982('0x70')],_0x2719d5[_0x0982('0x64')][_0x0982('0x2f')]);}break;case _0x0982('0x71'):var _0x36ac75=_0x3543e2[_0x0982('0x64')][_0x0982('0x38')](',')['map'](function(_0x3d38bc){return Number(_0x3d38bc);});_0x36ac75[_0x0982('0x39')](function(_0x222e16){_0x2f2e70['or'](_0x0982('0x72'),'%,'+_0x222e16+',%');});_0x604a08=_[_0x0982('0x73')](_0x604a08,_0x36ac75);break;case _0x0982('0x74'):if(_0x3543e2[_0x0982('0x75')]==='$substring'){_0xeff30d[_0x1825ed](_0x0982('0x76'),'%'+_0x3543e2[_0x0982('0x64')]+'%',null);}else{_0x6a99fd=_[_0x0982('0x63')](_0x50cc57,[_0x0982('0x32'),_0x0982('0x77')]);_0x3543e2[_0x0982('0x4e')]='UserId';_0x2719d5=as[_0x0982('0x6e')](_0xa4adaa,_0x6a99fd[_0x0982('0x3f')],_0x3543e2);_0xeff30d[_0x1825ed](_0x2719d5['text'],_0x2719d5[_0x0982('0x64')][_0x0982('0x70')],_0x2719d5['value'][_0x0982('0x2f')]);}break;case _0x0982('0x78'):_0x2719d5=as[_0x0982('0x6e')]('me',null,_0x3543e2);_0xeff30d[_0x1825ed](_0x2719d5[_0x0982('0x6f')],_0x2719d5[_0x0982('0x64')][_0x0982('0x70')],_0x2719d5['value']['end']);break;}}else{var _0x2719d5=as['buildExpression'](_0xa4adaa,_0x6a99fd[_0x0982('0x3f')],_0x3543e2);_0xeff30d[_0x1825ed](_0x2719d5['text'],_0x2719d5[_0x0982('0x64')][_0x0982('0x70')],_0x2719d5[_0x0982('0x64')][_0x0982('0x2f')]);}}}else{var _0x12c6f8=_(_0x141479['query'])['keys']()[_0x0982('0x34')](function(_0x22eb06){return _[_0x0982('0x79')](_0x50cc57,['name',_0x22eb06])?_0x22eb06:undefined;})['compact']()['value']();if(!_[_0x0982('0x7a')](_0x12c6f8)){_0x12c6f8[_0x0982('0x39')](function(_0x32bfa4){if(_0x32bfa4===_0x0982('0x7b')){_0x33a96a[_0x0982('0x4b')](_0x0982('0x7c'),[][_0x0982('0x7d')](_0x141479['query'][_0x32bfa4]));}else if(_0x32bfa4===_0x0982('0x7e')){var _0x56835b=JSON['parse'](_0x141479[_0x0982('0x42')][_0x32bfa4])['$gte'];var _0x53337b=JSON[_0x0982('0x7f')](_0x141479[_0x0982('0x42')][_0x32bfa4])[_0x0982('0x80')];_0x33a96a[_0x0982('0x4b')](_0x0982('0x81'),_0x56835b,_0x53337b);}else{if(_0x141479[_0x0982('0x42')][_0x32bfa4]===_0x0982('0x82')){_0x33a96a[_0x0982('0x4b')]('i.'+_0x32bfa4+_0x0982('0x83'));}else{_0x33a96a[_0x0982('0x4b')]('i.'+_0x32bfa4+_0x0982('0x84'),_0x141479[_0x0982('0x42')][_0x32bfa4]);}}});}if(_0x141479['query']['read']){if(_0x141479[_0x0982('0x42')][_0x0982('0x85')]==0x1){_0x33a96a[_0x0982('0x65')]('`unreadMessages`\x20=\x200');}else{_0x33a96a[_0x0982('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x141479['query'][_0x0982('0x86')]){_0x604a08=_['isArray'](_0x141479[_0x0982('0x42')][_0x0982('0x86')])?_0x141479['query'][_0x0982('0x86')]:new Array(_0x141479['query'][_0x0982('0x86')]);_0x604a08[_0x0982('0x39')](function(_0x70a561){_0x2f2e70['or'](_0x0982('0x72'),'%,'+_0x70a561+',%');});}if(_0x141479[_0x0982('0x42')][_0x0982('0x87')]){var _0x3dbb56=_0x141479[_0x0982('0x42')]['filter'][_0x0982('0x88')]('\x5c','\x5c\x5c')[_0x0982('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3dbb56)){_0xeff30d['or']('i.id\x20LIKE\x20?',_0x3dbb56+'%')['or'](_0x0982('0x89'),_0x3dbb56+'%');}else{_0xeff30d['or'](_0x0982('0x8a'),qs[_0x0982('0x6b')](_0x3dbb56))['or'](_0x0982('0x8b'),_0x3dbb56+'%');}}}_0x33a96a[_0x0982('0x4b')](_0xeff30d);_0x33a96a[_0x0982('0x8c')](_0x0982('0x8d'));var _0x5365ff={'type':db[_0x0982('0x8e')][_0x0982('0x8f')]['SELECT'],'raw':!![]};var _0x37fcc2=_0x33a96a[_0x0982('0x90')]();_0x37fcc2[_0x0982('0x4e')](_0x0982('0x8d'));_0x37fcc2[_0x0982('0x4e')](_0x0982('0x91'),'unreadMessages');if(_0x6431ea[_0x0982('0x92')]){_0x6431ea[_0x0982('0x92')][_0x0982('0x39')](function(_0xfcb5a4){var _0x5c1899=_0xfcb5a4[0x0]===_0x0982('0x93')?_0xfcb5a4[0x0]:'i.'+_0xfcb5a4[0x0];_0x33a96a[_0x0982('0x92')](_0x5c1899,_0xfcb5a4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0982('0x7a')](_0x604a08)){_0x33a96a[_0x0982('0x65')](_0x2f2e70);_0x37fcc2[_0x0982('0x4b')]('t.id\x20IN\x20?',_0x604a08);}BPromise[_0x0982('0x94')]()['then'](function(){if(!_0x2db8d2){if(_0x141479['query'][_0x0982('0x7b')])return;_0x37fcc2[_0x0982('0x4b')](_0x0982('0x95'));_0x33a96a['where'](_0x0982('0x95'));return;}if(_0x141479[_0x0982('0x96')][_0x0982('0x97')]!==_0x0982('0x98'))return;return _0x141479['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x0982('0x2d')](function(_0x4c43e3){if(_[_0x0982('0x7a')](_0x4c43e3)){_0x37fcc2['where'](_0x0982('0x99'));_0x33a96a[_0x0982('0x4b')](_0x0982('0x99'));}else{_0x37fcc2[_0x0982('0x4b')](_0x0982('0x7c'),_[_0x0982('0x34')](_0x4c43e3,'id'));_0x33a96a['where']('i.SmsAccountId\x20IN\x20?',_['map'](_0x4c43e3,'id'));}});})[_0x0982('0x2d')](function(){if(_0x141479[_0x0982('0x96')]['role']==='agent'&&!_0x2db8d2&&!_0x141479[_0x0982('0x42')][_0x0982('0x7b')])return[];return db[_0x0982('0x9a')][_0x0982('0x42')](_0x37fcc2[_0x0982('0x9b')](),_0x5365ff);})[_0x0982('0x2d')](function(_0x2f778c){_0x11816c[_0x0982('0x26')]=_0x2f778c[_0x0982('0x62')];if(_0x11816c[_0x0982('0x26')]===0x0)return[];return db[_0x0982('0x9a')][_0x0982('0x42')](_0x28308c[_0x0982('0x9b')](),_0x5365ff)[_0x0982('0x2d')](function(_0x28265b){_0x2e36a7=_[_0x0982('0x9c')](_0x28265b,'id');_0x5365ff=_[_0x0982('0x9d')](_0x5365ff,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x141479[_0x0982('0x42')][_0x0982('0x47')]){_0x6431ea[_0x0982('0x46')][_0x0982('0x39')](function(_0x443305){_0x33a96a['field']('i.'+_0x443305);});}else{_0x33a96a['field'](_0x0982('0x91'),_0x0982('0x9e'));_0x33a96a[_0x0982('0x4e')](_0x0982('0x9f'),_0x0982('0xa0'));_0x33a96a[_0x0982('0x4e')]('a.mandatoryDisposition',_0x0982('0xa1'));_0x33a96a[_0x0982('0x4e')](_0x0982('0xa2'),_0x0982('0x93'));_0x33a96a[_0x0982('0x4e')](_0x0982('0xa3'));_0x33a96a[_0x0982('0x4e')](_0x0982('0xa4'),_0x0982('0xa5'));_0x33a96a[_0x0982('0x4e')]('c.lastName','Contact.lastName');_0x33a96a[_0x0982('0x4e')](_0x0982('0xa6'),'Contact.email');_0x33a96a[_0x0982('0x4e')](_0x0982('0xa7'),'Contact.phone');_0x33a96a[_0x0982('0x4e')]('c.mobile',_0x0982('0xa8'));_0x33a96a['field'](_0x0982('0xa9'),'Contact.fax');_0x33a96a[_0x0982('0x4e')]('o.fullname',_0x0982('0xaa'));_0x33a96a['field'](_0x0982('0xab'),'Owner.internal');_0x33a96a['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0982('0x36'));}if(_0x6431ea[_0x0982('0x25')])_0x33a96a[_0x0982('0x25')](_0x6431ea['limit']);if(_0x6431ea[_0x0982('0x23')])_0x33a96a[_0x0982('0x23')](_0x6431ea['offset']);return db[_0x0982('0x9a')]['query'](_0x33a96a[_0x0982('0x9b')](),_0x5365ff);})[_0x0982('0x2d')](function(_0x29f7cd){if(_0x29f7cd['length']>0x0)_0x1af683[_0x0982('0x4b')](_0x0982('0xac'),_[_0x0982('0x34')](_0x29f7cd,'id'));return db[_0x0982('0x9a')][_0x0982('0x42')](_0x1af683[_0x0982('0x9b')](),_0x5365ff)[_0x0982('0x2d')](function(_0x459b67){var _0x20a88b=_[_0x0982('0xad')](_0x459b67,_0x0982('0xae'));var _0x211322=[];_0x29f7cd['forEach'](function(_0x1e4966){_0x211322[_0x0982('0x3a')](updateSmsInteraction(_0x1e4966,_0x2e36a7,_0x20a88b));});return BPromise[_0x0982('0xaf')](_0x211322);});});})['then'](function(_0x4f64bd){_0x11816c['rows']=_0x4f64bd;return _0x11816c;})[_0x0982('0x2d')](respondWithFilteredResult(_0x1b760d,_0x6431ea))[_0x0982('0x3b')](handleError(_0x1b760d,null));};exports[_0x0982('0xb0')]=function(_0x4dfb85,_0x58439a){var _0x173af6={'raw':![],'where':{'id':_0x4dfb85[_0x0982('0xb1')]['id']}},_0x3f5bfd={};_0x3f5bfd[_0x0982('0x41')]=_[_0x0982('0x43')](db[_0x0982('0x3d')][_0x0982('0xb2')]);_0x3f5bfd[_0x0982('0x42')]=_[_0x0982('0x43')](_0x4dfb85['query']);_0x3f5bfd[_0x0982('0x44')]=_[_0x0982('0x45')](_0x3f5bfd[_0x0982('0x41')],_0x3f5bfd[_0x0982('0x42')]);_0x173af6[_0x0982('0x46')]=_[_0x0982('0x45')](_0x3f5bfd[_0x0982('0x41')],qs[_0x0982('0x47')](_0x4dfb85['query'][_0x0982('0x47')]));_0x173af6['attributes']=_0x173af6[_0x0982('0x46')][_0x0982('0x62')]?_0x173af6[_0x0982('0x46')]:_0x3f5bfd[_0x0982('0x41')];if(_0x4dfb85['query'][_0x0982('0xb3')]){_0x173af6[_0x0982('0xb4')]=[{'all':!![]}];}_0x173af6=_['merge']({},_0x173af6,_0x4dfb85[_0x0982('0xb5')]);return db[_0x0982('0x3d')]['find'](_0x173af6)['then'](handleEntityNotFound(_0x58439a,null))[_0x0982('0x2d')](respondWithResult(_0x58439a,null))[_0x0982('0x3b')](handleError(_0x58439a,null));};exports[_0x0982('0xb6')]=function(_0x53c178,_0x4716d3){return db[_0x0982('0x3d')][_0x0982('0xb6')](_0x53c178[_0x0982('0x78')],{})[_0x0982('0x2d')](respondWithResult(_0x4716d3,0xc9))[_0x0982('0x3b')](handleError(_0x4716d3,null));};exports[_0x0982('0x2c')]=function(_0x3ffe01,_0x5d0eb8){if(_0x3ffe01['body']['id']){delete _0x3ffe01[_0x0982('0x78')]['id'];}return db[_0x0982('0x3d')][_0x0982('0x63')]({'where':{'id':_0x3ffe01[_0x0982('0xb1')]['id']}})[_0x0982('0x2d')](handleEntityNotFound(_0x5d0eb8,null))['then'](saveUpdates(_0x3ffe01[_0x0982('0x78')],null))['then'](respondWithResult(_0x5d0eb8,null))[_0x0982('0x3b')](handleError(_0x5d0eb8,null));};exports['destroy']=function(_0x138dc2,_0x2f55c6){return db['SmsInteraction']['find']({'where':{'id':_0x138dc2[_0x0982('0xb1')]['id']}})[_0x0982('0x2d')](handleEntityNotFound(_0x2f55c6,null))[_0x0982('0x2d')](removeEntity(_0x2f55c6,null))[_0x0982('0x3b')](handleError(_0x2f55c6,null));};exports[_0x0982('0xb7')]=function(_0x4fe100,_0xb04113){return db['SmsInteraction'][_0x0982('0xb7')]()[_0x0982('0x2d')](respondWithResult(_0xb04113,null))[_0x0982('0x3b')](handleError(_0xb04113,null));};exports[_0x0982('0xb8')]=function(_0x865d98,_0x20c4a2,_0x25c4eb){return db[_0x0982('0xb9')][_0x0982('0x63')]({'where':{'id':_0x865d98[_0x0982('0xb1')]['id']}})[_0x0982('0x2d')](handleEntityNotFound(_0x20c4a2,null))[_0x0982('0x2d')](function(_0x49146a){if(_0x49146a){return _0x49146a[_0x0982('0xb8')](_0x865d98[_0x0982('0x78')]['ids'],_[_0x0982('0xba')](_0x865d98[_0x0982('0x78')],[_0x0982('0xbb'),'id'])||{});}})[_0x0982('0x2d')](respondWithResult(_0x20c4a2,null))[_0x0982('0x3b')](handleError(_0x20c4a2,null));};exports[_0x0982('0xbc')]=function(_0x110ae1,_0x250a45,_0x339f0f){var _0x502fca={'raw':![],'where':{}};var _0x390a1a={};var _0x5b2da7={'count':0x0,'rows':[]};return db[_0x0982('0x3d')][_0x0982('0xbd')]({'where':{'id':_0x110ae1[_0x0982('0xb1')]['id']}})['then'](handleEntityNotFound(_0x250a45,null))['then'](function(_0x58d017){if(_0x58d017){_0x390a1a[_0x0982('0x41')]=_[_0x0982('0x43')](db[_0x0982('0xb9')][_0x0982('0xb2')]);_0x390a1a[_0x0982('0x42')]=_[_0x0982('0x43')](_0x110ae1['query']);_0x390a1a['filters']=_[_0x0982('0x45')](_0x390a1a[_0x0982('0x41')],_0x390a1a[_0x0982('0x42')]);_0x502fca[_0x0982('0x46')]=_['intersection'](_0x390a1a[_0x0982('0x41')],qs[_0x0982('0x47')](_0x110ae1[_0x0982('0x42')]['fields']));_0x502fca[_0x0982('0x46')]=_0x502fca[_0x0982('0x46')][_0x0982('0x62')]?_0x502fca[_0x0982('0x46')]:_0x390a1a['model'];if(!_0x110ae1['query'][_0x0982('0x48')](_0x0982('0x49'))){_0x502fca['limit']=qs[_0x0982('0x25')](_0x110ae1[_0x0982('0x42')][_0x0982('0x25')]);_0x502fca[_0x0982('0x23')]=qs['offset'](_0x110ae1[_0x0982('0x42')][_0x0982('0x23')]);}_0x502fca[_0x0982('0x92')]=qs['sort'](_0x110ae1[_0x0982('0x42')]['sort']);_0x502fca[_0x0982('0x4b')]=qs[_0x0982('0x44')](_[_0x0982('0x4c')](_0x110ae1[_0x0982('0x42')],_0x390a1a[_0x0982('0x44')]));_0x502fca['where'][_0x0982('0xae')]=_0x58d017['id'];if(_0x110ae1['query'][_0x0982('0x87')]){_0x502fca[_0x0982('0x4b')]=_[_0x0982('0x9d')](_0x502fca[_0x0982('0x4b')],{'$or':_['map'](_0x502fca[_0x0982('0x46')],function(_0x501e02){var _0x308e3b={};_0x308e3b[_0x501e02]={'$like':'%'+_0x110ae1[_0x0982('0x42')][_0x0982('0x87')]+'%'};return _0x308e3b;})});}if(_0x110ae1[_0x0982('0x42')][_0x0982('0xbe')]){var _0x4bc106=_0x110ae1[_0x0982('0x42')][_0x0982('0xbe')][_0x0982('0x38')](',');var _0x376592={};_0x376592[_0x4bc106[0x0]]={'$gte':moment(_0x4bc106[0x1])['format'](_0x0982('0xbf'))};_0x502fca['where']=_[_0x0982('0x9d')](_0x502fca[_0x0982('0x4b')],_0x376592);}_0x502fca=_[_0x0982('0x9d')]({},_0x502fca,_0x110ae1[_0x0982('0xb5')]);return db[_0x0982('0xb9')][_0x0982('0x26')]({'where':_0x502fca['where']})[_0x0982('0x2d')](function(_0x5ac926){_0x5b2da7[_0x0982('0x26')]=_0x5ac926;if(_0x110ae1[_0x0982('0x42')][_0x0982('0xb3')]){_0x502fca[_0x0982('0xb4')]=[{'all':!![]}];}return db[_0x0982('0xb9')][_0x0982('0xc0')](_0x502fca);})[_0x0982('0x2d')](function(_0x48de0d){_0x5b2da7[_0x0982('0xc1')]=_0x48de0d;return _0x5b2da7;});}})[_0x0982('0x2d')](respondWithFilteredResult(_0x250a45,_0x502fca))[_0x0982('0x3b')](handleError(_0x250a45,null));};exports[_0x0982('0xc2')]=function(_0x3cedd0,_0x32ded5,_0x3c9041){return db[_0x0982('0x3d')]['find']({'where':{'id':_0x3cedd0[_0x0982('0xb1')]['id']}})['then'](handleEntityNotFound(_0x32ded5,null))['then'](function(_0x54597f){if(_0x54597f){return _0x54597f[_0x0982('0xc3')](_0x3cedd0[_0x0982('0x78')][_0x0982('0xbb')],_[_0x0982('0xba')](_0x3cedd0[_0x0982('0x78')],[_0x0982('0xbb'),'id'])||{})[_0x0982('0xc4')](function(){return db[_0x0982('0x71')][_0x0982('0xc0')]({'attributes':['id',_0x0982('0x32'),_0x0982('0x4f')],'where':{'id':_0x3cedd0['body'][_0x0982('0xbb')]}});})[_0x0982('0x2d')](function(_0x8969a7){socket[_0x0982('0xc5')](_0x0982('0xc6'),{'id':Number(_0x3cedd0['params']['id']),'tags':_0x8969a7||[]});return{'id':Number(_0x3cedd0[_0x0982('0xb1')]['id']),'tags':_0x8969a7||[]};});}})['then'](respondWithResult(_0x32ded5,null))[_0x0982('0x3b')](handleError(_0x32ded5,null));};exports[_0x0982('0xc7')]=function(_0xe3c251,_0x4bc707,_0x38a36c){return db[_0x0982('0x3d')][_0x0982('0x63')]({'where':{'id':_0xe3c251[_0x0982('0xb1')]['id']}})[_0x0982('0x2d')](handleEntityNotFound(_0x4bc707,null))['then'](function(_0x4d7eb9){if(_0x4d7eb9){return _0x4d7eb9[_0x0982('0xc7')](_0xe3c251[_0x0982('0x42')][_0x0982('0xbb')]);}})['then'](respondWithStatusCode(_0x4bc707,null))[_0x0982('0x3b')](handleError(_0x4bc707,null));};exports[_0x0982('0xc8')]=function(_0x31995a,_0x246403){var _0x1656b6=moment()[_0x0982('0xc9')]()[_0x0982('0x9b')]();var _0x4df1b5=path[_0x0982('0xca')](config['root'],_0x0982('0xcb'),_0x0982('0xcc'),_0x0982('0xcd'));var _0x435c6d=path[_0x0982('0xca')](config[_0x0982('0xce')],_0x0982('0xcb'),'files','attachments');var _0x5e3854=path[_0x0982('0xca')](_0x4df1b5,_0x1656b6);var _0x51f03f=util[_0x0982('0xcf')](_0x0982('0xd0'),_0x31995a[_0x0982('0xb1')]['id'],_0x1656b6);var _0x513b2d=path[_0x0982('0xca')](_0x4df1b5,_0x51f03f);var _0x8d72a1=[];_0x8d72a1['push']({'model':db['User'],'as':_0x0982('0x74'),'attributes':['id',_0x0982('0x35')],'raw':!![]});_0x8d72a1[_0x0982('0x3a')]({'model':db[_0x0982('0xd1')],'as':_0x0982('0x68'),'attributes':['id','firstName',_0x0982('0xd2')],'raw':!![]});var _0x509cb8=[{'model':db[_0x0982('0xb9')],'as':_0x0982('0xd3'),'attributes':['id','body','createdAt','direction',_0x0982('0xd4'),_0x0982('0x85')],'include':_0x8d72a1}];_0x509cb8[_0x0982('0x3a')]({'model':db[_0x0982('0xd5')],'as':_0x0982('0xd6'),'attributes':['id',_0x0982('0x32')]});_0x509cb8[_0x0982('0x3a')]({'model':db[_0x0982('0x74')],'as':_0x0982('0xd7'),'attributes':['id',_0x0982('0x35')]});return db[_0x0982('0x3d')][_0x0982('0x63')]({'where':{'id':_0x31995a[_0x0982('0xb1')]['id']},'include':_0x509cb8})[_0x0982('0x2d')](handleEntityNotFound(_0x246403,null))[_0x0982('0x2d')](function(_0xd34dee){if(_0xd34dee){var _0x2dad94=_0xd34dee['get']({'plain':!![]});fs[_0x0982('0xd8')](_0x5e3854);var _0x135954={'channel':_0x0982('0xd9'),'account':_0x2dad94[_0x0982('0xd6')]['name'],'agent':_0x2dad94[_0x0982('0xd7')]?_0x2dad94[_0x0982('0xd7')][_0x0982('0x35')]:_0x0982('0xda'),'createdAt':moment(_0x2dad94[_0x0982('0x7e')])['format'](_0x0982('0xbf'))['toString'](),'closedAt':_0x2dad94['closed']?moment(_0x2dad94[_0x0982('0xdb')])[_0x0982('0xcf')](_0x0982('0xbf'))[_0x0982('0x9b')]():'','disposition':_0x2dad94[_0x0982('0xdc')],'messages':_(_0x2dad94[_0x0982('0xd3')])['filter']({'secret':![]})[_0x0982('0x34')](function(_0x4236c2){return{'date':moment(_0x4236c2['createdAt'])[_0x0982('0xcf')](_0x0982('0xbf'))[_0x0982('0x9b')](),'sender':_0x4236c2[_0x0982('0xdd')]===_0x0982('0xde')?_0x4236c2[_0x0982('0x74')]?_0x4236c2['User'][_0x0982('0x35')]:_0x0982('0xdf'):_0x4236c2['Contact'][_0x0982('0xe0')]+(_0x4236c2[_0x0982('0x68')][_0x0982('0xd2')]?'\x20'+_0x4236c2[_0x0982('0x68')][_0x0982('0xd2')]:''),'body':_0x4236c2[_0x0982('0x78')],'direction':_0x4236c2[_0x0982('0xdd')]===_0x0982('0xde')?'A':'C','secret':_0x4236c2[_0x0982('0xd4')],'read':_0x4236c2[_0x0982('0x85')]};})[_0x0982('0x64')]()};return ejs[_0x0982('0xe1')](path[_0x0982('0xca')](config[_0x0982('0xce')],_0x0982('0xcb'),_0x0982('0xe2'),_0x0982('0xe3')),{'interaction':_0x135954})['then'](function(_0x3eb124){var _0x4d76b1=path[_0x0982('0xca')](_0x5e3854,'transcript-'+_0x2dad94['id']+'-'+_0x1656b6+_0x0982('0xe4'));var _0x428567={'path':_0x4d76b1,'channel':'Sms','interactionId':_0x2dad94['id']};return pdf['createPdfFromHTML'](_0x3eb124,_0x428567);})[_0x0982('0x2d')](function(){return new BPromise(function(_0x1abffd,_0x263cce){zipdir(_0x5e3854,{'saveTo':_0x513b2d},function(_0x3e2791,_0x5c9045){if(_0x3e2791)return _0x263cce(_0x3e2791);return _0x1abffd(_0x5c9045);});})[_0x0982('0x2d')](function(){return new BPromise(function(_0x544112,_0x53e06c){rimraf(_0x5e3854,function(_0x462f8a){if(_0x462f8a)_0x53e06c(_0x462f8a);return _0x544112();});});})[_0x0982('0x2d')](function(){return _0x246403[_0x0982('0xc8')](_0x513b2d,_0x51f03f,function(_0x38e705){if(_0x38e705){console['log']('err',_0x38e705);}else{fs[_0x0982('0xe5')](_0x513b2d);}});});});}else{return _0x246403['sendStatus'](0xc8);}})[_0x0982('0x3b')](handleError(_0x246403,null));}; \ No newline at end of file +var _0x4503=['create','params','describe','addMessage','SmsMessage','ids','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','color','emit','removeTags','download','unix','join','root','files','tmp','CmContact','firstName','direction','secret','Account','Owner','mkdirSync','Sms','N.A.','closed','closedAt','Messages','out','System','lastName','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','rawAttributes','fieldName','type','key','query','filters','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','UserId','body','keys','some','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','intersection','includeAll','include','merge','options'];(function(_0x184bf2,_0x4c94d4){var _0x5d64af=function(_0x14f375){while(--_0x14f375){_0x184bf2['push'](_0x184bf2['shift']());}};_0x5d64af(++_0x4c94d4);}(_0x4503,0x111));var _0x3450=function(_0xb7b6d8,_0x1048c5){_0xb7b6d8=_0xb7b6d8-0x0;var _0x5dbaa0=_0x4503[_0xb7b6d8];return _0x5dbaa0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3450('0x0'));var zipdir=require(_0x3450('0x1'));var jsonpatch=require(_0x3450('0x2'));var rp=require('request-promise');var moment=require(_0x3450('0x3'));var BPromise=require(_0x3450('0x4'));var Mustache=require(_0x3450('0x5'));var util=require('util');var path=require(_0x3450('0x6'));var sox=require(_0x3450('0x7'));var csv=require(_0x3450('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3450('0x9'));var _=require(_0x3450('0xa'));var squel=require(_0x3450('0xb'));var crypto=require(_0x3450('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3450('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3450('0xe'));var Papa=require(_0x3450('0xf'));var Redis=require('ioredis');var authService=require(_0x3450('0x10'));var qs=require(_0x3450('0x11'));var as=require(_0x3450('0x12'));var pdf=require(_0x3450('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3450('0x14'))(_0x3450('0x15'));var utils=require('../../config/utils');var config=require(_0x3450('0x16'));var licenseUtil=require(_0x3450('0x17'));var db=require(_0x3450('0x18'))['db'];config[_0x3450('0x19')]=_[_0x3450('0x1a')](config['redis'],{'host':_0x3450('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3450('0x19')]));require(_0x3450('0x1c'))[_0x3450('0x1d')](socket);function respondWithStatusCode(_0x6a2c26,_0x5e2b2a){_0x5e2b2a=_0x5e2b2a||0xcc;return function(_0x1d9918){if(_0x1d9918){return _0x6a2c26[_0x3450('0x1e')](_0x5e2b2a);}return _0x6a2c26[_0x3450('0x1f')](_0x5e2b2a)[_0x3450('0x20')]();};}function respondWithResult(_0x528414,_0x19ca3f){_0x19ca3f=_0x19ca3f||0xc8;return function(_0xb6a21f){if(_0xb6a21f){return _0x528414[_0x3450('0x1f')](_0x19ca3f)[_0x3450('0x21')](_0xb6a21f);}};}function respondWithFilteredResult(_0x2c60e2,_0xb400c7){return function(_0x4eb490){if(_0x4eb490){var _0x4cd449=typeof _0xb400c7[_0x3450('0x22')]==='undefined'&&typeof _0xb400c7[_0x3450('0x23')]===_0x3450('0x24');var _0x4ab678=_0x4eb490[_0x3450('0x25')];var _0x59ae7f=_0x4cd449?0x0:_0xb400c7[_0x3450('0x22')];var _0x483f04=_0x4cd449?_0x4eb490[_0x3450('0x25')]:_0xb400c7[_0x3450('0x22')]+_0xb400c7['limit'];var _0xeb12dd;if(_0x483f04>=_0x4ab678){_0x483f04=_0x4ab678;_0xeb12dd=0xc8;}else{_0xeb12dd=0xce;}_0x2c60e2[_0x3450('0x1f')](_0xeb12dd);return _0x2c60e2[_0x3450('0x26')]('Content-Range',_0x59ae7f+'-'+_0x483f04+'/'+_0x4ab678)[_0x3450('0x21')](_0x4eb490);}return null;};}function patchUpdates(_0x81aaa6){return function(_0x374b5e){try{jsonpatch[_0x3450('0x27')](_0x374b5e,_0x81aaa6,!![]);}catch(_0x345109){return BPromise[_0x3450('0x28')](_0x345109);}return _0x374b5e[_0x3450('0x29')]();};}function saveUpdates(_0x53f7c7,_0x37617d){return function(_0x4d363e){if(_0x4d363e){return _0x4d363e[_0x3450('0x2a')](_0x53f7c7)[_0x3450('0x2b')](function(_0x1e36ef){return _0x1e36ef;});}return null;};}function removeEntity(_0x446289,_0x427002){return function(_0x51ff61){if(_0x51ff61){return _0x51ff61[_0x3450('0x2c')]()[_0x3450('0x2b')](function(){_0x446289[_0x3450('0x1f')](0xcc)[_0x3450('0x20')]();});}};}function handleEntityNotFound(_0x4466ff,_0x2dc089){return function(_0x494cf5){if(!_0x494cf5){_0x4466ff[_0x3450('0x1e')](0x194);}return _0x494cf5;};}function handleError(_0x47fbf0,_0x26f6e2){_0x26f6e2=_0x26f6e2||0x1f4;return function(_0xd738a7){logger[_0x3450('0x2d')](_0xd738a7[_0x3450('0x2e')]);if(_0xd738a7[_0x3450('0x2f')]){delete _0xd738a7[_0x3450('0x2f')];}_0x47fbf0[_0x3450('0x1f')](_0x26f6e2)[_0x3450('0x30')](_0xd738a7);};}function getInteractionUsers(_0x29fe16,_0x4378a5){return new BPromise(function(_0x12a143,_0x1e4424){try{if(_0x4378a5[_0x29fe16['id']]){_0x29fe16[_0x3450('0x31')]=_[_0x3450('0x32')](_0x4378a5[_0x29fe16['id']],function(_0x5d7d19){return{'id':_0x5d7d19['id'],'fullname':_0x5d7d19[_0x3450('0x33')]};});}}catch(_0xbc8a4c){_0x1e4424(_0xbc8a4c);}_0x12a143(_0x29fe16);});}function getInteractionTags(_0x504a7d,_0x1a8bce){return new BPromise(function(_0x91f820,_0x3e3d20){try{if(_0x504a7d['TagIds']){_0x504a7d[_0x3450('0x34')]=[];_0x504a7d[_0x3450('0x35')]['split'](',')[_0x3450('0x36')](function(_0x772c21){_0x504a7d['Tags']['push'](_0x1a8bce[_0x772c21]);});}delete _0x504a7d[_0x3450('0x35')];}catch(_0x365c71){_0x3e3d20(_0x365c71);}_0x91f820(_0x504a7d);});}function updateSmsInteraction(_0x5a04f9,_0x195d66,_0x11dbe8){return new BPromise(function(_0x312889,_0x357dfd){return getInteractionUsers(_0x5a04f9,_0x11dbe8)[_0x3450('0x2b')](function(_0x6341ed){return getInteractionTags(_0x6341ed,_0x195d66);})[_0x3450('0x2b')](function(_0x1287e9){_0x312889(_0x1287e9);})['catch'](function(_0x3b22cc){_0x357dfd(_0x3b22cc);});});}exports['index']=function(_0x4ca329,_0x4f47dc){var _0x37afc1={},_0x8905ba={},_0x2961ee={'count':0x0,'rows':[]};var _0x29b3ff=_[_0x3450('0x32')](db['SmsInteraction'][_0x3450('0x37')],function(_0x1d026a){return{'name':_0x1d026a[_0x3450('0x38')],'type':_0x1d026a[_0x3450('0x39')][_0x3450('0x3a')]};});_0x8905ba['model']=_['map'](_0x29b3ff,_0x3450('0x2f'));_0x8905ba[_0x3450('0x3b')]=_['keys'](_0x4ca329[_0x3450('0x3b')]);_0x8905ba[_0x3450('0x3c')]=_['intersection'](_0x8905ba['model'],_0x8905ba[_0x3450('0x3b')]);_0x37afc1['attributes']=_['intersection'](_0x8905ba['model'],qs['fields'](_0x4ca329['query'][_0x3450('0x3d')]));_0x37afc1['attributes']=_0x37afc1[_0x3450('0x3e')]['length']?_0x37afc1['attributes']:_0x8905ba[_0x3450('0x3f')];if(!_0x4ca329[_0x3450('0x3b')][_0x3450('0x40')](_0x3450('0x41'))){_0x37afc1['limit']=qs[_0x3450('0x23')](_0x4ca329['query'][_0x3450('0x23')]);_0x37afc1[_0x3450('0x22')]=qs[_0x3450('0x22')](_0x4ca329[_0x3450('0x3b')][_0x3450('0x22')]);}_0x37afc1[_0x3450('0x42')]=qs[_0x3450('0x43')](_0x4ca329[_0x3450('0x3b')]['sort']);_0x37afc1[_0x3450('0x44')]=qs[_0x3450('0x3c')](_[_0x3450('0x45')](_0x4ca329[_0x3450('0x3b')],_0x8905ba[_0x3450('0x3c')]),_0x29b3ff);var _0x22dec0=[];var _0x48af83=squel[_0x3450('0x46')]()[_0x3450('0x47')]('id')['field'](_0x3450('0x2f'))[_0x3450('0x47')]('color')[_0x3450('0x48')](_0x3450('0x49'));var _0x1c0e21=squel[_0x3450('0x46')]()[_0x3450('0x47')]('u.id')[_0x3450('0x47')](_0x3450('0x4a'))[_0x3450('0x47')](_0x3450('0x4b'))[_0x3450('0x48')](_0x3450('0x4c'),'ui')[_0x3450('0x4d')]('users','u',_0x3450('0x4e'));var _0x49b21c=squel[_0x3450('0x46')]()[_0x3450('0x48')]('sms_interactions','i')[_0x3450('0x4d')](_0x3450('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3450('0x4d')](_0x3450('0x50'),'o',_0x3450('0x51'))[_0x3450('0x4d')](_0x3450('0x52'),'a',_0x3450('0x53'))[_0x3450('0x4d')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x3450('0x4d')]('sms_interaction_has_tags','it',_0x3450('0x54'))['left_join'](_0x3450('0x49'),'t',_0x3450('0x55'));var _0x57bcde=squel[_0x3450('0x56')]();var _0x4f3322=[];var _0x152cd8=squel[_0x3450('0x56')]();var _0x2a898d;if(_0x4ca329[_0x3450('0x3b')][_0x3450('0x57')]){_0x2a898d=as[_0x3450('0x58')](_0x4ca329[_0x3450('0x3b')]['search']);var _0x164a41=_0x2a898d[_0x3450('0x59')];for(var _0xc75a3f=0x0;_0xc75a3f<_0x2a898d['conditions'][_0x3450('0x5a')];_0xc75a3f++){var _0x3ef31b=_0x2a898d['conditions'][_0xc75a3f];var _0x374558='i';var _0x4fe175=_['find'](_0x29b3ff,[_0x3450('0x2f'),_0x3ef31b[_0x3450('0x47')]]);if(!_0x4fe175){switch(_0x3ef31b[_0x3450('0x47')]){case _0x3450('0x5b'):if(_0x3ef31b[_0x3450('0x5c')]==0x1){_0x49b21c['having']('`'+_0x3ef31b[_0x3450('0x47')]+_0x3450('0x5d'));}else{_0x49b21c[_0x3450('0x5e')]('`'+_0x3ef31b['field']+_0x3450('0x5f'));}break;case _0x3450('0x60'):if(_0x3ef31b[_0x3450('0x61')]===_0x3450('0x62')){if(_0x3ef31b[_0x3450('0x5c')][_0x3450('0x63')]('\x20')[_0x3450('0x5a')]>0x1){_0x57bcde[_0x164a41](_0x3450('0x64'),qs[_0x3450('0x65')](_0x3ef31b[_0x3450('0x5c')]),null);}else{var _0x331f9a='%'+_0x3ef31b[_0x3450('0x5c')]+'%';_0x57bcde[_0x164a41](_0x3450('0x66'),_0x331f9a,_0x331f9a,_0x331f9a);}}else{_0x4fe175=_['find'](_0x29b3ff,[_0x3450('0x2f'),_0x3450('0x67')]);_0x3ef31b[_0x3450('0x47')]='ContactId';_0x1f209d=as[_0x3450('0x68')](_0x374558,_0x4fe175[_0x3450('0x39')],_0x3ef31b);_0x57bcde[_0x164a41](_0x1f209d[_0x3450('0x69')],_0x1f209d[_0x3450('0x5c')][_0x3450('0x6a')],_0x1f209d[_0x3450('0x5c')][_0x3450('0x20')]);}break;case _0x3450('0x6b'):var _0x44e6c7=_0x3ef31b[_0x3450('0x5c')][_0x3450('0x63')](',')[_0x3450('0x32')](function(_0x2e4a98){return Number(_0x2e4a98);});_0x44e6c7[_0x3450('0x36')](function(_0x191da6){_0x152cd8['or'](_0x3450('0x6c'),'%,'+_0x191da6+',%');});_0x4f3322=_[_0x3450('0x6d')](_0x4f3322,_0x44e6c7);break;case _0x3450('0x6e'):if(_0x3ef31b[_0x3450('0x61')]===_0x3450('0x62')){_0x57bcde[_0x164a41]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3ef31b['value']+'%',null);}else{_0x4fe175=_[_0x3450('0x6f')](_0x29b3ff,[_0x3450('0x2f'),_0x3450('0x70')]);_0x3ef31b['field']='UserId';_0x1f209d=as[_0x3450('0x68')](_0x374558,_0x4fe175[_0x3450('0x39')],_0x3ef31b);_0x57bcde[_0x164a41](_0x1f209d[_0x3450('0x69')],_0x1f209d[_0x3450('0x5c')][_0x3450('0x6a')],_0x1f209d['value'][_0x3450('0x20')]);}break;case _0x3450('0x71'):_0x1f209d=as[_0x3450('0x68')]('me',null,_0x3ef31b);_0x57bcde[_0x164a41](_0x1f209d[_0x3450('0x69')],_0x1f209d[_0x3450('0x5c')][_0x3450('0x6a')],_0x1f209d[_0x3450('0x5c')][_0x3450('0x20')]);break;}}else{var _0x1f209d=as[_0x3450('0x68')](_0x374558,_0x4fe175['type'],_0x3ef31b);_0x57bcde[_0x164a41](_0x1f209d[_0x3450('0x69')],_0x1f209d['value'][_0x3450('0x6a')],_0x1f209d['value'][_0x3450('0x20')]);}}}else{var _0x185f91=_(_0x4ca329[_0x3450('0x3b')])[_0x3450('0x72')]()[_0x3450('0x32')](function(_0x41031b){return _[_0x3450('0x73')](_0x29b3ff,[_0x3450('0x2f'),_0x41031b])?_0x41031b:undefined;})['compact']()[_0x3450('0x5c')]();if(!_['isEmpty'](_0x185f91)){_0x185f91[_0x3450('0x36')](function(_0x1dc8de){if(_0x1dc8de===_0x3450('0x74')){_0x49b21c[_0x3450('0x44')](_0x3450('0x75'),[][_0x3450('0x76')](_0x4ca329[_0x3450('0x3b')][_0x1dc8de]));}else if(_0x1dc8de===_0x3450('0x77')){var _0x42ab5a=JSON[_0x3450('0x78')](_0x4ca329[_0x3450('0x3b')][_0x1dc8de])['$gte'];var _0x3b0714=JSON[_0x3450('0x78')](_0x4ca329[_0x3450('0x3b')][_0x1dc8de])['$lte'];_0x49b21c['where'](_0x3450('0x79'),_0x42ab5a,_0x3b0714);}else{if(_0x4ca329[_0x3450('0x3b')][_0x1dc8de]===_0x3450('0x7a')){_0x49b21c[_0x3450('0x44')]('i.'+_0x1dc8de+_0x3450('0x7b'));}else{_0x49b21c['where']('i.'+_0x1dc8de+'\x20=\x20?',_0x4ca329[_0x3450('0x3b')][_0x1dc8de]);}}});}if(_0x4ca329['query']['read']){if(_0x4ca329['query'][_0x3450('0x7c')]==0x1){_0x49b21c[_0x3450('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x49b21c['having'](_0x3450('0x7d'));}}if(_0x4ca329['query'][_0x3450('0x7e')]){_0x4f3322=_['isArray'](_0x4ca329['query'][_0x3450('0x7e')])?_0x4ca329[_0x3450('0x3b')][_0x3450('0x7e')]:new Array(_0x4ca329[_0x3450('0x3b')][_0x3450('0x7e')]);_0x4f3322[_0x3450('0x36')](function(_0x1d68d5){_0x152cd8['or'](_0x3450('0x6c'),'%,'+_0x1d68d5+',%');});}if(_0x4ca329['query']['filter']){var _0x1fe4e6=_0x4ca329[_0x3450('0x3b')][_0x3450('0x7f')][_0x3450('0x80')]('\x5c','\x5c\x5c')[_0x3450('0x80')](/'/g,'\x27\x27');if(qs[_0x3450('0x81')](_0x1fe4e6)){_0x57bcde['or'](_0x3450('0x82'),_0x1fe4e6+'%')['or'](_0x3450('0x83'),_0x1fe4e6+'%');}else{_0x57bcde['or'](_0x3450('0x84'),qs['getFullTextValue'](_0x1fe4e6))['or'](_0x3450('0x85'),_0x1fe4e6+'%');}}}_0x49b21c[_0x3450('0x44')](_0x57bcde);_0x49b21c[_0x3450('0x86')](_0x3450('0x87'));var _0x46ab7a={'type':db[_0x3450('0x88')][_0x3450('0x89')]['SELECT'],'raw':!![]};var _0x470c86=_0x49b21c[_0x3450('0x8a')]();_0x470c86['field']('i.id');_0x470c86[_0x3450('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3450('0x5b'));if(_0x37afc1['order']){_0x37afc1[_0x3450('0x42')][_0x3450('0x36')](function(_0x4e245f){var _0x2d50c5=_0x4e245f[0x0]==='contactName'?_0x4e245f[0x0]:'i.'+_0x4e245f[0x0];_0x49b21c[_0x3450('0x42')](_0x2d50c5,_0x4e245f[0x1]===_0x3450('0x8b')?![]:!![]);});}if(!_[_0x3450('0x8c')](_0x4f3322)){_0x49b21c[_0x3450('0x5e')](_0x152cd8);_0x470c86[_0x3450('0x44')](_0x3450('0x8d'),_0x4f3322);}BPromise[_0x3450('0x8e')]()[_0x3450('0x2b')](function(){if(!_0x2a898d){if(_0x4ca329['query'][_0x3450('0x74')])return;_0x470c86[_0x3450('0x44')](_0x3450('0x8f'));_0x49b21c['where'](_0x3450('0x8f'));return;}if(_0x4ca329[_0x3450('0x90')][_0x3450('0x91')]!==_0x3450('0x92'))return;return _0x4ca329['user'][_0x3450('0x93')]({'attributes':['id'],'raw':!![]})[_0x3450('0x2b')](function(_0x46be0c){if(_[_0x3450('0x8c')](_0x46be0c)){_0x470c86[_0x3450('0x44')](_0x3450('0x94'));_0x49b21c[_0x3450('0x44')](_0x3450('0x94'));}else{_0x470c86[_0x3450('0x44')](_0x3450('0x75'),_['map'](_0x46be0c,'id'));_0x49b21c[_0x3450('0x44')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x46be0c,'id'));}});})['then'](function(){if(_0x4ca329[_0x3450('0x90')][_0x3450('0x91')]===_0x3450('0x92')&&!_0x2a898d&&!_0x4ca329[_0x3450('0x3b')][_0x3450('0x74')])return[];return db['sequelize']['query'](_0x470c86['toString'](),_0x46ab7a);})['then'](function(_0x5b8c34){_0x2961ee['count']=_0x5b8c34[_0x3450('0x5a')];if(_0x2961ee['count']===0x0)return[];return db[_0x3450('0x95')]['query'](_0x48af83[_0x3450('0x96')](),_0x46ab7a)[_0x3450('0x2b')](function(_0x251b98){_0x22dec0=_[_0x3450('0x97')](_0x251b98,'id');_0x46ab7a=_['merge'](_0x46ab7a,{'model':db[_0x3450('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ca329['query']['fields']){_0x37afc1[_0x3450('0x3e')][_0x3450('0x36')](function(_0x1eb3b3){_0x49b21c[_0x3450('0x47')]('i.'+_0x1eb3b3);});}else{_0x49b21c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3450('0x5b'));_0x49b21c[_0x3450('0x47')](_0x3450('0x99'),_0x3450('0x9a'));_0x49b21c['field'](_0x3450('0x9b'),_0x3450('0x9c'));_0x49b21c['field'](_0x3450('0x9d'),'contactName');_0x49b21c[_0x3450('0x47')](_0x3450('0x9e'));_0x49b21c[_0x3450('0x47')](_0x3450('0x9f'),_0x3450('0xa0'));_0x49b21c['field'](_0x3450('0xa1'),_0x3450('0xa2'));_0x49b21c[_0x3450('0x47')]('c.email',_0x3450('0xa3'));_0x49b21c['field']('c.phone',_0x3450('0xa4'));_0x49b21c['field']('c.mobile',_0x3450('0xa5'));_0x49b21c[_0x3450('0x47')](_0x3450('0xa6'),_0x3450('0xa7'));_0x49b21c[_0x3450('0x47')](_0x3450('0xa8'),_0x3450('0xa9'));_0x49b21c[_0x3450('0x47')](_0x3450('0xaa'),_0x3450('0xab'));_0x49b21c['field'](_0x3450('0xac'),'TagIds');}if(_0x37afc1[_0x3450('0x23')])_0x49b21c['limit'](_0x37afc1[_0x3450('0x23')]);if(_0x37afc1['offset'])_0x49b21c['offset'](_0x37afc1[_0x3450('0x22')]);return db[_0x3450('0x95')]['query'](_0x49b21c[_0x3450('0x96')](),_0x46ab7a);})[_0x3450('0x2b')](function(_0xb0f5f){if(_0xb0f5f[_0x3450('0x5a')]>0x0)_0x1c0e21[_0x3450('0x44')](_0x3450('0xad'),_[_0x3450('0x32')](_0xb0f5f,'id'));return db[_0x3450('0x95')][_0x3450('0x3b')](_0x1c0e21[_0x3450('0x96')](),_0x46ab7a)[_0x3450('0x2b')](function(_0x1bfa8e){var _0x508d01=_[_0x3450('0xae')](_0x1bfa8e,'SmsInteractionId');var _0x58c13e=[];_0xb0f5f['forEach'](function(_0x22111f){_0x58c13e[_0x3450('0xaf')](updateSmsInteraction(_0x22111f,_0x22dec0,_0x508d01));});return BPromise[_0x3450('0xb0')](_0x58c13e);});});})[_0x3450('0x2b')](function(_0x4525db){_0x2961ee[_0x3450('0xb1')]=_0x4525db;return _0x2961ee;})[_0x3450('0x2b')](respondWithFilteredResult(_0x4f47dc,_0x37afc1))[_0x3450('0xb2')](handleError(_0x4f47dc,null));};exports[_0x3450('0xb3')]=function(_0xbc25b7,_0x5aca3c){var _0x2406e7={'raw':![],'where':{'id':_0xbc25b7['params']['id']}},_0x4da6f7={};_0x4da6f7[_0x3450('0x3f')]=_[_0x3450('0x72')](db[_0x3450('0x98')][_0x3450('0x37')]);_0x4da6f7[_0x3450('0x3b')]=_[_0x3450('0x72')](_0xbc25b7[_0x3450('0x3b')]);_0x4da6f7[_0x3450('0x3c')]=_[_0x3450('0xb4')](_0x4da6f7['model'],_0x4da6f7[_0x3450('0x3b')]);_0x2406e7['attributes']=_[_0x3450('0xb4')](_0x4da6f7['model'],qs[_0x3450('0x3d')](_0xbc25b7[_0x3450('0x3b')]['fields']));_0x2406e7['attributes']=_0x2406e7['attributes'][_0x3450('0x5a')]?_0x2406e7[_0x3450('0x3e')]:_0x4da6f7['model'];if(_0xbc25b7[_0x3450('0x3b')][_0x3450('0xb5')]){_0x2406e7[_0x3450('0xb6')]=[{'all':!![]}];}_0x2406e7=_[_0x3450('0xb7')]({},_0x2406e7,_0xbc25b7[_0x3450('0xb8')]);return db[_0x3450('0x98')][_0x3450('0x6f')](_0x2406e7)[_0x3450('0x2b')](handleEntityNotFound(_0x5aca3c,null))[_0x3450('0x2b')](respondWithResult(_0x5aca3c,null))[_0x3450('0xb2')](handleError(_0x5aca3c,null));};exports[_0x3450('0xb9')]=function(_0x1237f1,_0x3d3d5a){return db[_0x3450('0x98')][_0x3450('0xb9')](_0x1237f1[_0x3450('0x71')],{})['then'](respondWithResult(_0x3d3d5a,0xc9))[_0x3450('0xb2')](handleError(_0x3d3d5a,null));};exports['update']=function(_0x5167f,_0x4d7248){if(_0x5167f[_0x3450('0x71')]['id']){delete _0x5167f[_0x3450('0x71')]['id'];}return db[_0x3450('0x98')][_0x3450('0x6f')]({'where':{'id':_0x5167f[_0x3450('0xba')]['id']}})[_0x3450('0x2b')](handleEntityNotFound(_0x4d7248,null))['then'](saveUpdates(_0x5167f['body'],null))[_0x3450('0x2b')](respondWithResult(_0x4d7248,null))[_0x3450('0xb2')](handleError(_0x4d7248,null));};exports[_0x3450('0x2c')]=function(_0xef7d89,_0x50040c){return db['SmsInteraction']['find']({'where':{'id':_0xef7d89['params']['id']}})[_0x3450('0x2b')](handleEntityNotFound(_0x50040c,null))[_0x3450('0x2b')](removeEntity(_0x50040c,null))[_0x3450('0xb2')](handleError(_0x50040c,null));};exports[_0x3450('0xbb')]=function(_0x448c6a,_0x2a5737){return db[_0x3450('0x98')][_0x3450('0xbb')]()[_0x3450('0x2b')](respondWithResult(_0x2a5737,null))['catch'](handleError(_0x2a5737,null));};exports[_0x3450('0xbc')]=function(_0x1f1928,_0x2242cf,_0x1f9cd1){return db[_0x3450('0xbd')]['find']({'where':{'id':_0x1f1928[_0x3450('0xba')]['id']}})[_0x3450('0x2b')](handleEntityNotFound(_0x2242cf,null))['then'](function(_0x29805a){if(_0x29805a){return _0x29805a[_0x3450('0xbc')](_0x1f1928[_0x3450('0x71')][_0x3450('0xbe')],_['omit'](_0x1f1928['body'],['ids','id'])||{});}})[_0x3450('0x2b')](respondWithResult(_0x2242cf,null))[_0x3450('0xb2')](handleError(_0x2242cf,null));};exports['getMessages']=function(_0x40dc79,_0x37da3a,_0x1cfa3d){var _0x302a4f={'raw':![],'where':{}};var _0x148e0f={};var _0x2cf3c0={'count':0x0,'rows':[]};return db[_0x3450('0x98')]['findOne']({'where':{'id':_0x40dc79['params']['id']}})[_0x3450('0x2b')](handleEntityNotFound(_0x37da3a,null))[_0x3450('0x2b')](function(_0x4d6593){if(_0x4d6593){_0x148e0f[_0x3450('0x3f')]=_[_0x3450('0x72')](db[_0x3450('0xbd')][_0x3450('0x37')]);_0x148e0f[_0x3450('0x3b')]=_[_0x3450('0x72')](_0x40dc79[_0x3450('0x3b')]);_0x148e0f[_0x3450('0x3c')]=_[_0x3450('0xb4')](_0x148e0f[_0x3450('0x3f')],_0x148e0f[_0x3450('0x3b')]);_0x302a4f[_0x3450('0x3e')]=_['intersection'](_0x148e0f[_0x3450('0x3f')],qs['fields'](_0x40dc79[_0x3450('0x3b')][_0x3450('0x3d')]));_0x302a4f[_0x3450('0x3e')]=_0x302a4f['attributes'][_0x3450('0x5a')]?_0x302a4f[_0x3450('0x3e')]:_0x148e0f[_0x3450('0x3f')];if(!_0x40dc79[_0x3450('0x3b')]['hasOwnProperty'](_0x3450('0x41'))){_0x302a4f[_0x3450('0x23')]=qs['limit'](_0x40dc79[_0x3450('0x3b')][_0x3450('0x23')]);_0x302a4f[_0x3450('0x22')]=qs[_0x3450('0x22')](_0x40dc79[_0x3450('0x3b')][_0x3450('0x22')]);}_0x302a4f['order']=qs[_0x3450('0x43')](_0x40dc79[_0x3450('0x3b')][_0x3450('0x43')]);_0x302a4f[_0x3450('0x44')]=qs[_0x3450('0x3c')](_[_0x3450('0x45')](_0x40dc79['query'],_0x148e0f[_0x3450('0x3c')]));_0x302a4f[_0x3450('0x44')]['SmsInteractionId']=_0x4d6593['id'];if(_0x40dc79['query'][_0x3450('0x7f')]){_0x302a4f[_0x3450('0x44')]=_[_0x3450('0xb7')](_0x302a4f['where'],{'$or':_[_0x3450('0x32')](_0x302a4f[_0x3450('0x3e')],function(_0x3ecbc0){var _0x1cf9ce={};_0x1cf9ce[_0x3ecbc0]={'$like':'%'+_0x40dc79[_0x3450('0x3b')][_0x3450('0x7f')]+'%'};return _0x1cf9ce;})});}if(_0x40dc79[_0x3450('0x3b')][_0x3450('0xbf')]){var _0x3caa4f=_0x40dc79[_0x3450('0x3b')][_0x3450('0xbf')]['split'](',');var _0xb6f90a={};_0xb6f90a[_0x3caa4f[0x0]]={'$gte':moment(_0x3caa4f[0x1])[_0x3450('0xc0')](_0x3450('0xc1'))};_0x302a4f[_0x3450('0x44')]=_[_0x3450('0xb7')](_0x302a4f['where'],_0xb6f90a);}_0x302a4f=_[_0x3450('0xb7')]({},_0x302a4f,_0x40dc79['options']);return db[_0x3450('0xbd')][_0x3450('0x25')]({'where':_0x302a4f['where']})[_0x3450('0x2b')](function(_0x2ad75c){_0x2cf3c0[_0x3450('0x25')]=_0x2ad75c;if(_0x40dc79[_0x3450('0x3b')][_0x3450('0xb5')]){_0x302a4f[_0x3450('0xb6')]=[{'all':!![]}];}return db[_0x3450('0xbd')]['findAll'](_0x302a4f);})[_0x3450('0x2b')](function(_0x1d57d8){_0x2cf3c0[_0x3450('0xb1')]=_0x1d57d8;return _0x2cf3c0;});}})[_0x3450('0x2b')](respondWithFilteredResult(_0x37da3a,_0x302a4f))[_0x3450('0xb2')](handleError(_0x37da3a,null));};exports[_0x3450('0xc2')]=function(_0x2136a3,_0x4060c3,_0x4e5e84){return db[_0x3450('0x98')][_0x3450('0x6f')]({'where':{'id':_0x2136a3[_0x3450('0xba')]['id']}})['then'](handleEntityNotFound(_0x4060c3,null))[_0x3450('0x2b')](function(_0x5aa8a9){if(_0x5aa8a9){return _0x5aa8a9[_0x3450('0xc3')](_0x2136a3['body'][_0x3450('0xbe')],_['omit'](_0x2136a3[_0x3450('0x71')],[_0x3450('0xbe'),'id'])||{})[_0x3450('0xc4')](function(){return db[_0x3450('0x6b')][_0x3450('0xc5')]({'attributes':['id',_0x3450('0x2f'),_0x3450('0xc6')],'where':{'id':_0x2136a3[_0x3450('0x71')][_0x3450('0xbe')]}});})['then'](function(_0x586180){socket[_0x3450('0xc7')]('smsInteractionTags:save',{'id':Number(_0x2136a3[_0x3450('0xba')]['id']),'tags':_0x586180||[]});return{'id':Number(_0x2136a3[_0x3450('0xba')]['id']),'tags':_0x586180||[]};});}})[_0x3450('0x2b')](respondWithResult(_0x4060c3,null))[_0x3450('0xb2')](handleError(_0x4060c3,null));};exports['removeTags']=function(_0x2dd7f0,_0x43010f,_0x534882){return db[_0x3450('0x98')]['find']({'where':{'id':_0x2dd7f0['params']['id']}})['then'](handleEntityNotFound(_0x43010f,null))[_0x3450('0x2b')](function(_0x356715){if(_0x356715){return _0x356715[_0x3450('0xc8')](_0x2dd7f0[_0x3450('0x3b')][_0x3450('0xbe')]);}})[_0x3450('0x2b')](respondWithStatusCode(_0x43010f,null))['catch'](handleError(_0x43010f,null));};exports[_0x3450('0xc9')]=function(_0xf9af3a,_0x26a092){var _0x251177=moment()[_0x3450('0xca')]()[_0x3450('0x96')]();var _0x48ca79=path[_0x3450('0xcb')](config[_0x3450('0xcc')],'server',_0x3450('0xcd'),_0x3450('0xce'));var _0x3dba3d=path[_0x3450('0xcb')](config[_0x3450('0xcc')],'server',_0x3450('0xcd'),'attachments');var _0x1fedcb=path['join'](_0x48ca79,_0x251177);var _0x13e45d=util[_0x3450('0xc0')]('transcript-%d-%s.zip',_0xf9af3a[_0x3450('0xba')]['id'],_0x251177);var _0x27c0c2=path[_0x3450('0xcb')](_0x48ca79,_0x13e45d);var _0x46cbb1=[];_0x46cbb1[_0x3450('0xaf')]({'model':db[_0x3450('0x6e')],'as':'User','attributes':['id',_0x3450('0x33')],'raw':!![]});_0x46cbb1[_0x3450('0xaf')]({'model':db[_0x3450('0xcf')],'as':'Contact','attributes':['id',_0x3450('0xd0'),'lastName'],'raw':!![]});var _0x1120b6=[{'model':db[_0x3450('0xbd')],'as':'Messages','attributes':['id',_0x3450('0x71'),_0x3450('0x77'),_0x3450('0xd1'),_0x3450('0xd2'),_0x3450('0x7c')],'include':_0x46cbb1}];_0x1120b6[_0x3450('0xaf')]({'model':db['SmsAccount'],'as':_0x3450('0xd3'),'attributes':['id','name']});_0x1120b6['push']({'model':db[_0x3450('0x6e')],'as':_0x3450('0xd4'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x3450('0x6f')]({'where':{'id':_0xf9af3a[_0x3450('0xba')]['id']},'include':_0x1120b6})[_0x3450('0x2b')](handleEntityNotFound(_0x26a092,null))['then'](function(_0x1c14c8){if(_0x1c14c8){var _0x532897=_0x1c14c8['get']({'plain':!![]});fs[_0x3450('0xd5')](_0x1fedcb);var _0x29f721={'channel':_0x3450('0xd6'),'account':_0x532897[_0x3450('0xd3')][_0x3450('0x2f')],'agent':_0x532897[_0x3450('0xd4')]?_0x532897[_0x3450('0xd4')]['fullname']:_0x3450('0xd7'),'createdAt':moment(_0x532897[_0x3450('0x77')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3450('0x96')](),'closedAt':_0x532897[_0x3450('0xd8')]?moment(_0x532897[_0x3450('0xd9')])[_0x3450('0xc0')](_0x3450('0xc1'))[_0x3450('0x96')]():'','disposition':_0x532897['disposition'],'messages':_(_0x532897[_0x3450('0xda')])[_0x3450('0x7f')]({'secret':![]})['map'](function(_0x39b5f2){return{'date':moment(_0x39b5f2[_0x3450('0x77')])['format'](_0x3450('0xc1'))[_0x3450('0x96')](),'sender':_0x39b5f2['direction']===_0x3450('0xdb')?_0x39b5f2[_0x3450('0x6e')]?_0x39b5f2[_0x3450('0x6e')][_0x3450('0x33')]:_0x3450('0xdc'):_0x39b5f2[_0x3450('0x60')][_0x3450('0xd0')]+(_0x39b5f2['Contact'][_0x3450('0xdd')]?'\x20'+_0x39b5f2[_0x3450('0x60')][_0x3450('0xdd')]:''),'body':_0x39b5f2[_0x3450('0x71')],'direction':_0x39b5f2['direction']===_0x3450('0xdb')?'A':'C','secret':_0x39b5f2[_0x3450('0xd2')],'read':_0x39b5f2['read']};})[_0x3450('0x5c')]()};return ejs['renderFile'](path[_0x3450('0xcb')](config[_0x3450('0xcc')],_0x3450('0xde'),_0x3450('0xdf'),_0x3450('0xe0')),{'interaction':_0x29f721})[_0x3450('0x2b')](function(_0x586815){var _0x3072b2=path[_0x3450('0xcb')](_0x1fedcb,_0x3450('0xe1')+_0x532897['id']+'-'+_0x251177+_0x3450('0xe2'));var _0x19baca={'path':_0x3072b2,'channel':'Sms','interactionId':_0x532897['id']};return pdf[_0x3450('0xe3')](_0x586815,_0x19baca);})[_0x3450('0x2b')](function(){return new BPromise(function(_0x1eca2e,_0xd6fdaf){zipdir(_0x1fedcb,{'saveTo':_0x27c0c2},function(_0x17aa5d,_0x513567){if(_0x17aa5d)return _0xd6fdaf(_0x17aa5d);return _0x1eca2e(_0x513567);});})['then'](function(){return new BPromise(function(_0x2be717,_0x550555){rimraf(_0x1fedcb,function(_0x1f2af7){if(_0x1f2af7)_0x550555(_0x1f2af7);return _0x2be717();});});})[_0x3450('0x2b')](function(){return _0x26a092[_0x3450('0xc9')](_0x27c0c2,_0x13e45d,function(_0x15f3cb){if(_0x15f3cb){console['log']('err',_0x15f3cb);}else{fs[_0x3450('0xe4')](_0x27c0c2);}});});});}else{return _0x26a092[_0x3450('0x1e')](0xc8);}})['catch'](handleError(_0x26a092,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 075c453..1eefae7 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 _0x7708=['hook','exports','events','../../mysqldb','remove','getUsers','then','setDataValue','Users','map','length','emit','catch'];(function(_0x5cdcff,_0x3118f2){var _0x46b31a=function(_0x1b2224){while(--_0x1b2224){_0x5cdcff['push'](_0x5cdcff['shift']());}};_0x46b31a(++_0x3118f2);}(_0x7708,0x188));var _0x8770=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x7708[_0x26f1b2];return _0x1624a4;};'use strict';var EventEmitter=require(_0x8770('0x0'));var SmsInteraction=require(_0x8770('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8770('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8770('0x2')};function emitEvent(_0x1a796d){return function(_0x577b13,_0x40d401,_0x50bab7){_0x577b13[_0x8770('0x3')]({'attributes':['id'],'raw':!![]})[_0x8770('0x4')](function(_0x2b0295){_0x577b13[_0x8770('0x5')](_0x8770('0x6'),_0x2b0295[_0x8770('0x7')](function(_0x2d4a1d){return{'id':_0x2d4a1d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x577b13['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8770('0x4')](function(_0x2ca830){_0x577b13[_0x8770('0x5')]('unreadMessages',_0x2ca830[_0x8770('0x8')]);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d+':'+_0x577b13['id'],_0x577b13);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d,_0x577b13);_0x50bab7(null);})[_0x8770('0xa')](_0x50bab7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8770('0xb')](e,emitEvent(event));}}module[_0x8770('0xc')]=SmsInteractionEvents; \ No newline at end of file +var _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0xd3d738,_0x2c757e){var _0x106dbf=function(_0x42d096){while(--_0x42d096){_0xd3d738['push'](_0xd3d738['shift']());}};_0x106dbf(++_0x2c757e);}(_0x4888,0x198));var _0x8488=function(_0x21cf80,_0x1fb0a1){_0x21cf80=_0x21cf80-0x0;var _0x5c6bed=_0x4888[_0x21cf80];return _0x5c6bed;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4a31623..180d4a6 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 _0x3a5a=['request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','lodash','util','bluebird'];(function(_0x58718e,_0x27ede3){var _0x4ac755=function(_0x413d13){while(--_0x413d13){_0x58718e['push'](_0x58718e['shift']());}};_0x4ac755(++_0x27ede3);}(_0x3a5a,0x99));var _0xa3a5=function(_0x2e02ae,_0x4a4623){_0x2e02ae=_0x2e02ae-0x0;var _0x375a6b=_0x3a5a[_0x2e02ae];return _0x375a6b;};'use strict';var _=require(_0xa3a5('0x0'));var util=require(_0xa3a5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa3a5('0x2'));var rp=require(_0xa3a5('0x3'));var fs=require('fs');var path=require(_0xa3a5('0x4'));var rimraf=require(_0xa3a5('0x5'));var config=require('../../config/environment');var attributes=require(_0xa3a5('0x6'));module[_0xa3a5('0x7')]=function(_0x25bf49,_0x5f08d6){return _0x25bf49[_0xa3a5('0x8')](_0xa3a5('0x9'),attributes,{'tableName':_0xa3a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c4db3,_0x33be14,_0xb4382f){if(_0x5c4db3[_0xa3a5('0xb')]('closed')){_0x5c4db3[_0xa3a5('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xb4382f(null,_0x5c4db3);}}});}; \ No newline at end of file +var _0xae2e=['request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment'];(function(_0x1c241f,_0x1d46f8){var _0xfae7c8=function(_0xc9c163){while(--_0xc9c163){_0x1c241f['push'](_0x1c241f['shift']());}};_0xfae7c8(++_0x1d46f8);}(_0xae2e,0xfb));var _0xeae2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae2e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var logger=require(_0xeae2('0x2'))('api');var moment=require(_0xeae2('0x3'));var BPromise=require('bluebird');var rp=require(_0xeae2('0x4'));var fs=require('fs');var path=require(_0xeae2('0x5'));var rimraf=require(_0xeae2('0x6'));var config=require(_0xeae2('0x7'));var attributes=require(_0xeae2('0x8'));module[_0xeae2('0x9')]=function(_0x54cc1d,_0x3750cb){return _0x54cc1d[_0xeae2('0xa')](_0xeae2('0xb'),attributes,{'tableName':_0xeae2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x701b09,_0x4ff5c2,_0x27475b){if(_0x701b09[_0xeae2('0xd')]('closed')){_0x701b09[_0xeae2('0xe')]=moment()[_0xeae2('0xf')](_0xeae2('0x10'));}_0x27475b(null,_0x701b09);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index cae194f..44ea4a1 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 _0x7b06=['redis','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','options','raw','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','body','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','localhost'];(function(_0x3a48c1,_0x35e608){var _0x474eff=function(_0x515a4f){while(--_0x515a4f){_0x3a48c1['push'](_0x3a48c1['shift']());}};_0x474eff(++_0x35e608);}(_0x7b06,0x196));var _0x67b0=function(_0x29b974,_0x4d7e73){_0x29b974=_0x29b974-0x0;var _0x33e066=_0x7b06[_0x29b974];return _0x33e066;};'use strict';var _=require('lodash');var util=require(_0x67b0('0x0'));var moment=require(_0x67b0('0x1'));var BPromise=require(_0x67b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67b0('0x3'));var db=require(_0x67b0('0x4'))['db'];var utils=require(_0x67b0('0x5'));var logger=require(_0x67b0('0x6'))(_0x67b0('0x7'));var config=require(_0x67b0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x67b0('0x9')]({'port':0x232a});config['redis']=_[_0x67b0('0xa')](config['redis'],{'host':_0x67b0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67b0('0xc')]));require(_0x67b0('0xd'))[_0x67b0('0xe')](socket);function respondWithRpcPromise(_0x423ed6,_0x22c5de,_0x3e44f0){return new BPromise(function(_0x13fe1f,_0x20f2da){return client['request'](_0x423ed6,_0x3e44f0)[_0x67b0('0xf')](function(_0x2518ec){logger[_0x67b0('0x10')](_0x67b0('0x11'),_0x22c5de,_0x67b0('0x12'));logger[_0x67b0('0x13')](_0x67b0('0x14'),_0x22c5de,_0x67b0('0x12'),JSON[_0x67b0('0x15')](_0x2518ec));if(_0x2518ec['error']){if(_0x2518ec[_0x67b0('0x16')][_0x67b0('0x17')]===0x1f4){logger[_0x67b0('0x16')](_0x67b0('0x11'),_0x22c5de,_0x2518ec['error'][_0x67b0('0x18')]);return _0x20f2da(_0x2518ec[_0x67b0('0x16')][_0x67b0('0x18')]);}logger[_0x67b0('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x22c5de,_0x2518ec['error']['message']);return _0x13fe1f(_0x2518ec[_0x67b0('0x16')][_0x67b0('0x18')]);}else{logger[_0x67b0('0x10')](_0x67b0('0x11'),_0x22c5de,_0x67b0('0x12'));_0x13fe1f(_0x2518ec[_0x67b0('0x19')]['message']);}})[_0x67b0('0x1a')](function(_0x17756a){logger[_0x67b0('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x22c5de,_0x17756a);_0x20f2da(_0x17756a);});});}exports['UpdateSmsInteraction']=function(_0x3bf441){var _0x2ef4f8=this;return new Promise(function(_0x2d7eb6,_0x353cc9){return db[_0x67b0('0x1b')]['update'](_0x3bf441['body'],{'raw':_0x3bf441['options']?_0x3bf441[_0x67b0('0x1c')][_0x67b0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf441[_0x67b0('0x1c')]?_0x3bf441['options']['where']||null:null,'attributes':_0x3bf441[_0x67b0('0x1c')]?_0x3bf441['options'][_0x67b0('0x1e')]||null:null,'limit':_0x3bf441[_0x67b0('0x1c')]?_0x3bf441['options'][_0x67b0('0x1f')]||null:null})[_0x67b0('0xf')](function(_0x56beac){logger['info']('UpdateSmsInteraction',_0x3bf441);logger[_0x67b0('0x13')](_0x67b0('0x20'),_0x3bf441,JSON[_0x67b0('0x15')](_0x56beac));_0x2d7eb6(_0x56beac);})['catch'](function(_0x2b9c44){logger[_0x67b0('0x16')](_0x67b0('0x20'),_0x2b9c44[_0x67b0('0x18')],_0x3bf441);_0x353cc9(_0x2ef4f8[_0x67b0('0x16')](0x1f4,_0x2b9c44[_0x67b0('0x18')]));});});};exports[_0x67b0('0x21')]=function(_0x5df727){return new Promise(function(_0x51c9a3,_0x1b73aa){return db[_0x67b0('0x1b')]['find']({'where':_0x5df727[_0x67b0('0x1c')]?_0x5df727[_0x67b0('0x1c')]['where']||null:null})[_0x67b0('0xf')](function(_0x27aa5e){if(_0x27aa5e){return _0x27aa5e[_0x67b0('0x22')](_0x5df727[_0x67b0('0x23')]['ids'],_[_0x67b0('0x24')](_0x5df727[_0x67b0('0x23')],['ids','id'])||{});}})['spread'](function(_0x233afa){logger[_0x67b0('0x10')](_0x67b0('0x25'),_0x5df727);logger[_0x67b0('0x13')]('AddTags',_0x5df727,JSON[_0x67b0('0x15')](_0x233afa));_0x51c9a3(_0x233afa);})[_0x67b0('0x1a')](function(_0x324bd4){logger[_0x67b0('0x16')](_0x67b0('0x25'),_0x324bd4[_0x67b0('0x18')],_0x5df727);_0x1b73aa(_this['error'](0x1f4,_0x324bd4[_0x67b0('0x18')]));});});}; \ No newline at end of file +var _0x923f=['request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','then','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x923f,0x97));var _0xf923=function(_0x5d1c1d,_0x2bd5cf){_0x5d1c1d=_0x5d1c1d-0x0;var _0x2a46a3=_0x923f[_0x5d1c1d];return _0x2a46a3;};'use strict';var _=require(_0xf923('0x0'));var util=require(_0xf923('0x1'));var moment=require(_0xf923('0x2'));var BPromise=require(_0xf923('0x3'));var rs=require(_0xf923('0x4'));var fs=require('fs');var Redis=require(_0xf923('0x5'));var db=require(_0xf923('0x6'))['db'];var utils=require(_0xf923('0x7'));var logger=require(_0xf923('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf923('0x9'));var client=jayson[_0xf923('0xa')][_0xf923('0xb')]({'port':0x232a});config[_0xf923('0xc')]=_['defaults'](config['redis'],{'host':_0xf923('0xd'),'port':0x18eb});var socket=require(_0xf923('0xe'))(new Redis(config[_0xf923('0xc')]));require(_0xf923('0xf'))[_0xf923('0x10')](socket);function respondWithRpcPromise(_0x5f277e,_0x3843c1,_0x4b9d3e){return new BPromise(function(_0x3fb69c,_0x33510e){return client[_0xf923('0x11')](_0x5f277e,_0x4b9d3e)['then'](function(_0x4be74b){logger[_0xf923('0x12')](_0xf923('0x13'),_0x3843c1,_0xf923('0x14'));logger[_0xf923('0x15')](_0xf923('0x16'),_0x3843c1,'request\x20sent',JSON[_0xf923('0x17')](_0x4be74b));if(_0x4be74b[_0xf923('0x18')]){if(_0x4be74b['error'][_0xf923('0x19')]===0x1f4){logger[_0xf923('0x18')](_0xf923('0x13'),_0x3843c1,_0x4be74b[_0xf923('0x18')]['message']);return _0x33510e(_0x4be74b[_0xf923('0x18')]['message']);}logger[_0xf923('0x18')](_0xf923('0x13'),_0x3843c1,_0x4be74b[_0xf923('0x18')][_0xf923('0x1a')]);return _0x3fb69c(_0x4be74b[_0xf923('0x18')]['message']);}else{logger[_0xf923('0x12')](_0xf923('0x13'),_0x3843c1,'request\x20sent');_0x3fb69c(_0x4be74b[_0xf923('0x1b')][_0xf923('0x1a')]);}})[_0xf923('0x1c')](function(_0x1dfb58){logger[_0xf923('0x18')](_0xf923('0x13'),_0x3843c1,_0x1dfb58);_0x33510e(_0x1dfb58);});});}exports[_0xf923('0x1d')]=function(_0x4d028d){var _0x35e95e=this;return new Promise(function(_0x2791e3,_0x479770){return db[_0xf923('0x1e')]['update'](_0x4d028d[_0xf923('0x1f')],{'raw':_0x4d028d[_0xf923('0x20')]?_0x4d028d[_0xf923('0x20')][_0xf923('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d028d[_0xf923('0x20')]?_0x4d028d[_0xf923('0x20')][_0xf923('0x22')]||null:null,'attributes':_0x4d028d[_0xf923('0x20')]?_0x4d028d[_0xf923('0x20')][_0xf923('0x23')]||null:null,'limit':_0x4d028d['options']?_0x4d028d['options'][_0xf923('0x24')]||null:null})[_0xf923('0x25')](function(_0x2e8290){logger[_0xf923('0x12')]('UpdateSmsInteraction',_0x4d028d);logger['debug'](_0xf923('0x1d'),_0x4d028d,JSON[_0xf923('0x17')](_0x2e8290));_0x2791e3(_0x2e8290);})['catch'](function(_0x1b8cda){logger['error'](_0xf923('0x1d'),_0x1b8cda[_0xf923('0x1a')],_0x4d028d);_0x479770(_0x35e95e['error'](0x1f4,_0x1b8cda[_0xf923('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x52ee7b){return new Promise(function(_0x5c7044,_0x42fba6){return db[_0xf923('0x1e')]['find']({'where':_0x52ee7b[_0xf923('0x20')]?_0x52ee7b['options'][_0xf923('0x22')]||null:null})[_0xf923('0x25')](function(_0x3b7051){if(_0x3b7051){return _0x3b7051[_0xf923('0x26')](_0x52ee7b[_0xf923('0x1f')][_0xf923('0x27')],_[_0xf923('0x28')](_0x52ee7b['body'],[_0xf923('0x27'),'id'])||{});}})['spread'](function(_0x5b2cf6){logger['info'](_0xf923('0x29'),_0x52ee7b);logger[_0xf923('0x15')]('AddTags',_0x52ee7b,JSON[_0xf923('0x17')](_0x5b2cf6));_0x5c7044(_0x5b2cf6);})[_0xf923('0x1c')](function(_0x11286d){logger[_0xf923('0x18')](_0xf923('0x29'),_0x11286d[_0xf923('0x1a')],_0x52ee7b);_0x42fba6(_this[_0xf923('0x18')](0x1f4,_0x11286d[_0xf923('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 291bfc4..657ba7c 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 _0x2bd6=['length','smsInteraction:','./smsInteraction.events','save','update','register'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0x2bd6,0x116));var _0x62bd=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x2bd6[_0x4ca333];return _0x13b2e1;};'use strict';var SmsInteractionEvents=require(_0x62bd('0x0'));var events=[_0x62bd('0x1'),'remove',_0x62bd('0x2')];function createListener(_0x4c3796,_0x40b5a0){return function(_0x34bec2){_0x40b5a0['emit'](_0x4c3796,_0x34bec2);};}function removeListener(_0x2cb784,_0x3aebd2){return function(){SmsInteractionEvents['removeListener'](_0x2cb784,_0x3aebd2);};}exports[_0x62bd('0x3')]=function(_0xe3f45b){for(var _0x27c66b=0x0,_0x3abe7b=events[_0x62bd('0x4')];_0x27c66b<_0x3abe7b;_0x27c66b++){var _0x2191e2=events[_0x27c66b];var _0x57ea39=createListener(_0x62bd('0x5')+_0x2191e2,_0xe3f45b);SmsInteractionEvents['on'](_0x2191e2,_0x57ea39);}}; \ No newline at end of file +var _0xb318=['emit','removeListener','length','remove','update'];(function(_0x4d27f4,_0x2ed972){var _0x146a9a=function(_0x2e1398){while(--_0x2e1398){_0x4d27f4['push'](_0x4d27f4['shift']());}};_0x146a9a(++_0x2ed972);}(_0xb318,0x1c0));var _0x8b31=function(_0x31541c,_0x199013){_0x31541c=_0x31541c-0x0;var _0x4f19a7=_0xb318[_0x31541c];return _0x4f19a7;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0x8b31('0x0'),_0x8b31('0x1')];function createListener(_0x15ba4e,_0x103a99){return function(_0xee94d){_0x103a99[_0x8b31('0x2')](_0x15ba4e,_0xee94d);};}function removeListener(_0x5d4b97,_0xecf64f){return function(){SmsInteractionEvents[_0x8b31('0x3')](_0x5d4b97,_0xecf64f);};}exports['register']=function(_0x3e4d4b){for(var _0x49f6ec=0x0,_0x522bbd=events[_0x8b31('0x4')];_0x49f6ec<_0x522bbd;_0x49f6ec++){var _0x5980db=events[_0x49f6ec];var _0x30f433=createListener('smsInteraction:'+_0x5980db,_0x3e4d4b);SmsInteractionEvents['on'](_0x5980db,_0x30f433);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 61b7b98..f127fde 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 _0x2ebe=['tracked','sms','smsmessage:create','create','status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x34a223,_0x5b0fe9){var _0x4a9a0e=function(_0x2f109a){while(--_0x2f109a){_0x34a223['push'](_0x34a223['shift']());}};_0x4a9a0e(++_0x5b0fe9);}(_0x2ebe,0x125));var _0xe2eb=function(_0x1b897e,_0x5aae5b){_0x1b897e=_0x1b897e-0x0;var _0x51b676=_0x2ebe[_0x1b897e];return _0x51b676;};'use strict';var multer=require(_0xe2eb('0x0'));var util=require(_0xe2eb('0x1'));var path=require(_0xe2eb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2eb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe2eb('0x4'));var interaction=require(_0xe2eb('0x5'));var config=require(_0xe2eb('0x6'));var controller=require(_0xe2eb('0x7'));router[_0xe2eb('0x8')]('/',auth[_0xe2eb('0x9')](),controller[_0xe2eb('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe2eb('0xb')]);router[_0xe2eb('0x8')](_0xe2eb('0xc'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0xd')]);router[_0xe2eb('0xe')]('/',auth[_0xe2eb('0x9')](),interaction[_0xe2eb('0xf')](_0xe2eb('0x10'),_0xe2eb('0x11')),controller[_0xe2eb('0x12')]);router[_0xe2eb('0xe')]('/:id/status',controller[_0xe2eb('0x13')]);router['put'](_0xe2eb('0xc'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x14')]);router['put'](_0xe2eb('0x15'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x16')]);router[_0xe2eb('0x17')](_0xe2eb('0x18'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x19')]);router[_0xe2eb('0x1a')]('/:id',auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x51f9=['fs-extra','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','describe','post','create','put','/:id','/:id/accept','accept','reject','exports','multer','connect-timeout'];(function(_0x1b2bde,_0x32ea63){var _0x1743b9=function(_0x1202ca){while(--_0x1202ca){_0x1b2bde['push'](_0x1b2bde['shift']());}};_0x1743b9(++_0x32ea63);}(_0x51f9,0x1eb));var _0x951f=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x51f9[_0x673722];return _0x21249c;};'use strict';var multer=require(_0x951f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x951f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x951f('0x2'));var auth=require(_0x951f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x951f('0x4'));router[_0x951f('0x5')]('/',auth[_0x951f('0x6')](),controller[_0x951f('0x7')]);router[_0x951f('0x5')]('/describe',auth[_0x951f('0x6')](),controller[_0x951f('0x8')]);router[_0x951f('0x5')]('/:id',auth[_0x951f('0x6')](),controller['show']);router[_0x951f('0x9')]('/',auth[_0x951f('0x6')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x951f('0xa')]);router['post']('/:id/status',controller['status']);router[_0x951f('0xb')](_0x951f('0xc'),auth[_0x951f('0x6')](),controller['update']);router['put'](_0x951f('0xd'),auth['isAuthenticated'](),controller[_0x951f('0xe')]);router[_0x951f('0xb')]('/:id/reject',auth[_0x951f('0x6')](),controller[_0x951f('0xf')]);router['delete'](_0x951f('0xc'),auth[_0x951f('0x6')](),controller['destroy']);module[_0x951f('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 9ac4ebf..9c2bd12 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 _0xaa9c=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa9c,0x1f4));var _0xcaa9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xaa9c[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xcaa9('0x0'));module[_0xcaa9('0x1')]={'body':{'type':Sequelize[_0xcaa9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcaa9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcaa9('0x4')]('in',_0xcaa9('0x5')),'defaultValue':_0xcaa9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcaa9('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xcaa9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcaa9('0x6')]},'providerResponse':{'type':Sequelize[_0xcaa9('0x2')]}}; \ No newline at end of file +var _0x010a=['STRING','DATE','TEXT','exports','medium','BOOLEAN','out'];(function(_0x29b4c9,_0x21ad34){var _0x2cc744=function(_0x23749f){while(--_0x23749f){_0x29b4c9['push'](_0x29b4c9['shift']());}};_0x2cc744(++_0x21ad34);}(_0x010a,0x1f4));var _0xa010=function(_0xc18be1,_0x3cbbfe){_0xc18be1=_0xc18be1-0x0;var _0x98b887=_0x010a[_0xc18be1];return _0x98b887;};'use strict';var Sequelize=require('sequelize');module[_0xa010('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa010('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa010('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa010('0x3')),'defaultValue':_0xa010('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa010('0x4')](0xbe)},'phone':{'type':Sequelize[_0xa010('0x4')]},'readAt':{'type':Sequelize[_0xa010('0x5')]},'secret':{'type':Sequelize[_0xa010('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa010('0x4')]},'providerResponse':{'type':Sequelize[_0xa010('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index edcc9bb..ba7a594 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 _0x8277=['body','find','params','destroy','describe','sms-interactions','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','internal','motionChannel','SmsAccount','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','infobip','results','groupName','DELIVERED','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','send','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','create'];(function(_0x18ce30,_0x437d06){var _0x4471a3=function(_0x403a4a){while(--_0x403a4a){_0x18ce30['push'](_0x18ce30['shift']());}};_0x4471a3(++_0x437d06);}(_0x8277,0xcf));var _0x7827=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0x8277[_0xfc0976];return _0x23579f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7827('0x0'));var zipdir=require(_0x7827('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7827('0x2'));var moment=require(_0x7827('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7827('0x4'));var util=require(_0x7827('0x5'));var path=require('path');var sox=require(_0x7827('0x6'));var csv=require(_0x7827('0x7'));var ejs=require(_0x7827('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7827('0x9'));var squel=require(_0x7827('0xa'));var crypto=require(_0x7827('0xb'));var jsforce=require(_0x7827('0xc'));var deskjs=require(_0x7827('0xd'));var toCsv=require(_0x7827('0x7'));var querystring=require(_0x7827('0xe'));var Papa=require(_0x7827('0xf'));var Redis=require(_0x7827('0x10'));var authService=require(_0x7827('0x11'));var qs=require(_0x7827('0x12'));var as=require(_0x7827('0x13'));var hardwareService=require(_0x7827('0x14'));var logger=require(_0x7827('0x15'))('api');var utils=require(_0x7827('0x16'));var config=require(_0x7827('0x17'));var licenseUtil=require(_0x7827('0x18'));var db=require(_0x7827('0x19'))['db'];config['redis']=_[_0x7827('0x1a')](config[_0x7827('0x1b')],{'host':_0x7827('0x1c'),'port':0x18eb});var socket=require(_0x7827('0x1d'))(new Redis(config[_0x7827('0x1b')]));require(_0x7827('0x1e'))[_0x7827('0x1f')](socket);var jayson=require(_0x7827('0x20'));var client=jayson[_0x7827('0x21')][_0x7827('0x22')]({'port':0x232c});var client9002=jayson[_0x7827('0x21')][_0x7827('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2fe484,_0x85c389,_0x2055f6,_0x5143e4){return new BPromise(function(_0x3767f0,_0x1e7ca4){var _0x19be26=_0x5143e4||client;return _0x19be26[_0x7827('0x23')](_0x2fe484,_0x2055f6)[_0x7827('0x24')](function(_0x2e001d){logger[_0x7827('0x25')](_0x7827('0x26'),_0x85c389,'request\x20sent');logger[_0x7827('0x27')](_0x7827('0x28'),_0x85c389,_0x7827('0x29'),JSON[_0x7827('0x2a')](_0x2e001d));if(_0x2e001d[_0x7827('0x2b')]){if(_0x2e001d[_0x7827('0x2b')][_0x7827('0x2c')]===0x1f4){logger['error'](_0x7827('0x26'),_0x85c389,_0x2e001d['error'][_0x7827('0x2d')]);return _0x1e7ca4(_0x2e001d[_0x7827('0x2b')][_0x7827('0x2d')]);}logger[_0x7827('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x85c389,_0x2e001d[_0x7827('0x2b')][_0x7827('0x2d')]);return _0x3767f0(_0x2e001d[_0x7827('0x2b')]['message']);}else{logger[_0x7827('0x25')]('SmsMessage,\x20%s,\x20%s',_0x85c389,_0x7827('0x29'));_0x3767f0(_0x2e001d['result'][_0x7827('0x2d')]);}})[_0x7827('0x2e')](function(_0x2745e4){logger[_0x7827('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x85c389,_0x2745e4);_0x1e7ca4(_0x2745e4);});});}function respondWithStatusCode(_0x26ba79,_0x4b2a0d){_0x4b2a0d=_0x4b2a0d||0xcc;return function(_0x3ec12e){if(_0x3ec12e){return _0x26ba79[_0x7827('0x2f')](_0x4b2a0d);}return _0x26ba79[_0x7827('0x30')](_0x4b2a0d)[_0x7827('0x31')]();};}function respondWithResult(_0x3b3f8a,_0x1dd67f){_0x1dd67f=_0x1dd67f||0xc8;return function(_0x32ba3c){if(_0x32ba3c){return _0x3b3f8a[_0x7827('0x30')](_0x1dd67f)[_0x7827('0x32')](_0x32ba3c);}};}function respondWithFilteredResult(_0x4b25ba,_0x21b502){return function(_0x301b31){if(_0x301b31){var _0x25415b=typeof _0x21b502[_0x7827('0x33')]===_0x7827('0x34')&&typeof _0x21b502[_0x7827('0x35')]===_0x7827('0x34');var _0x4549f8=_0x301b31[_0x7827('0x36')];var _0x49cc2a=_0x25415b?0x0:_0x21b502['offset'];var _0xd88452=_0x25415b?_0x301b31['count']:_0x21b502[_0x7827('0x33')]+_0x21b502[_0x7827('0x35')];var _0x524609;if(_0xd88452>=_0x4549f8){_0xd88452=_0x4549f8;_0x524609=0xc8;}else{_0x524609=0xce;}_0x4b25ba[_0x7827('0x30')](_0x524609);return _0x4b25ba[_0x7827('0x37')](_0x7827('0x38'),_0x49cc2a+'-'+_0xd88452+'/'+_0x4549f8)['json'](_0x301b31);}return null;};}function patchUpdates(_0x2d9849){return function(_0x5257b0){try{jsonpatch[_0x7827('0x39')](_0x5257b0,_0x2d9849,!![]);}catch(_0x1b075f){return BPromise['reject'](_0x1b075f);}return _0x5257b0[_0x7827('0x3a')]();};}function saveUpdates(_0x567b0b,_0x10f3b8){return function(_0x4cb66a){if(_0x4cb66a){return _0x4cb66a[_0x7827('0x3b')](_0x567b0b)[_0x7827('0x24')](function(_0x2fb8a6){return _0x2fb8a6;});}return null;};}function removeEntity(_0x2ce05e,_0x1f1d02){return function(_0x4ce5c0){if(_0x4ce5c0){return _0x4ce5c0['destroy']()[_0x7827('0x24')](function(){_0x2ce05e['status'](0xcc)[_0x7827('0x31')]();});}};}function handleEntityNotFound(_0x536ea2,_0x30e16b){return function(_0x259879){if(!_0x259879){_0x536ea2['sendStatus'](0x194);}return _0x259879;};}function handleError(_0x454113,_0x9a9adf){_0x9a9adf=_0x9a9adf||0x1f4;return function(_0xe029e1){logger['error'](_0xe029e1[_0x7827('0x3c')]);if(_0xe029e1[_0x7827('0x3d')]){delete _0xe029e1[_0x7827('0x3d')];}_0x454113[_0x7827('0x30')](_0x9a9adf)[_0x7827('0x3e')](_0xe029e1);};}exports['index']=function(_0x95fcb,_0x4ff709){var _0x844332={},_0xf5dd31={},_0x2c78ce={'count':0x0,'rows':[]};var _0x54e35c=_[_0x7827('0x3f')](db[_0x7827('0x40')][_0x7827('0x41')],function(_0x4624af){return{'name':_0x4624af['fieldName'],'type':_0x4624af[_0x7827('0x42')][_0x7827('0x43')]};});_0xf5dd31[_0x7827('0x44')]=_['map'](_0x54e35c,'name');_0xf5dd31[_0x7827('0x45')]=_[_0x7827('0x46')](_0x95fcb['query']);_0xf5dd31[_0x7827('0x47')]=_['intersection'](_0xf5dd31['model'],_0xf5dd31[_0x7827('0x45')]);_0x844332[_0x7827('0x48')]=_[_0x7827('0x49')](_0xf5dd31[_0x7827('0x44')],qs['fields'](_0x95fcb[_0x7827('0x45')][_0x7827('0x4a')]));_0x844332[_0x7827('0x48')]=_0x844332[_0x7827('0x48')][_0x7827('0x4b')]?_0x844332[_0x7827('0x48')]:_0xf5dd31[_0x7827('0x44')];if(!_0x95fcb[_0x7827('0x45')]['hasOwnProperty'](_0x7827('0x4c'))){_0x844332['limit']=qs[_0x7827('0x35')](_0x95fcb[_0x7827('0x45')][_0x7827('0x35')]);_0x844332[_0x7827('0x33')]=qs[_0x7827('0x33')](_0x95fcb[_0x7827('0x45')][_0x7827('0x33')]);}_0x844332[_0x7827('0x4d')]=qs[_0x7827('0x4e')](_0x95fcb[_0x7827('0x45')][_0x7827('0x4e')]);_0x844332[_0x7827('0x4f')]=qs[_0x7827('0x47')](_[_0x7827('0x50')](_0x95fcb[_0x7827('0x45')],_0xf5dd31[_0x7827('0x47')]),_0x54e35c);if(_0x95fcb[_0x7827('0x45')][_0x7827('0x51')]){_0x844332[_0x7827('0x4f')]=_['merge'](_0x844332['where'],{'$or':_[_0x7827('0x3f')](_0x54e35c,function(_0x538949){if(_0x538949[_0x7827('0x42')]!==_0x7827('0x52')){var _0x2ad872={};_0x2ad872[_0x538949['name']]={'$like':'%'+_0x95fcb[_0x7827('0x45')][_0x7827('0x51')]+'%'};return _0x2ad872;}})});}_0x844332=_[_0x7827('0x53')]({},_0x844332,_0x95fcb[_0x7827('0x54')]);var _0x2e0e8f={'where':_0x844332[_0x7827('0x4f')]};return db[_0x7827('0x40')][_0x7827('0x36')](_0x2e0e8f)[_0x7827('0x24')](function(_0x4f7f1e){_0x2c78ce[_0x7827('0x36')]=_0x4f7f1e;if(_0x95fcb[_0x7827('0x45')][_0x7827('0x55')]){_0x844332[_0x7827('0x56')]=[{'all':!![]}];}return db[_0x7827('0x40')][_0x7827('0x57')](_0x844332);})[_0x7827('0x24')](function(_0x4afa51){_0x2c78ce[_0x7827('0x58')]=_0x4afa51;return _0x2c78ce;})[_0x7827('0x24')](respondWithFilteredResult(_0x4ff709,_0x844332))[_0x7827('0x2e')](handleError(_0x4ff709,null));};exports[_0x7827('0x59')]=function(_0x137029,_0x1e1542){var _0x777c87={'raw':!![],'where':{'id':_0x137029['params']['id']}},_0x48ef30={};_0x48ef30['model']=_[_0x7827('0x46')](db[_0x7827('0x40')]['rawAttributes']);_0x48ef30[_0x7827('0x45')]=_['keys'](_0x137029['query']);_0x48ef30[_0x7827('0x47')]=_['intersection'](_0x48ef30[_0x7827('0x44')],_0x48ef30[_0x7827('0x45')]);_0x777c87[_0x7827('0x48')]=_[_0x7827('0x49')](_0x48ef30['model'],qs[_0x7827('0x4a')](_0x137029[_0x7827('0x45')][_0x7827('0x4a')]));_0x777c87[_0x7827('0x48')]=_0x777c87[_0x7827('0x48')][_0x7827('0x4b')]?_0x777c87[_0x7827('0x48')]:_0x48ef30[_0x7827('0x44')];if(_0x137029[_0x7827('0x45')]['includeAll']){_0x777c87[_0x7827('0x56')]=[{'all':!![]}];}_0x777c87=_['merge']({},_0x777c87,_0x137029[_0x7827('0x54')]);return db[_0x7827('0x40')]['find'](_0x777c87)['then'](handleEntityNotFound(_0x1e1542,null))['then'](respondWithResult(_0x1e1542,null))['catch'](handleError(_0x1e1542,null));};exports[_0x7827('0x5a')]=function(_0x3bfa07,_0x14ff5a){return db[_0x7827('0x40')][_0x7827('0x5a')](_0x3bfa07[_0x7827('0x5b')],{})[_0x7827('0x24')](respondWithResult(_0x14ff5a,0xc9))[_0x7827('0x2e')](handleError(_0x14ff5a,null));};exports[_0x7827('0x3b')]=function(_0x20882b,_0xc1bbc9){if(_0x20882b[_0x7827('0x5b')]['id']){delete _0x20882b[_0x7827('0x5b')]['id'];}return db[_0x7827('0x40')][_0x7827('0x5c')]({'where':{'id':_0x20882b[_0x7827('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc1bbc9,null))[_0x7827('0x24')](saveUpdates(_0x20882b[_0x7827('0x5b')],null))[_0x7827('0x24')](respondWithResult(_0xc1bbc9,null))[_0x7827('0x2e')](handleError(_0xc1bbc9,null));};exports[_0x7827('0x5e')]=function(_0x6800f1,_0x259cb0){return db['SmsMessage']['find']({'where':{'id':_0x6800f1[_0x7827('0x5d')]['id']}})[_0x7827('0x24')](handleEntityNotFound(_0x259cb0,null))['then'](removeEntity(_0x259cb0,null))[_0x7827('0x2e')](handleError(_0x259cb0,null));};exports[_0x7827('0x5f')]=function(_0x2f4425,_0x736142){return db[_0x7827('0x40')][_0x7827('0x5f')]()['then'](respondWithResult(_0x736142,null))['catch'](handleError(_0x736142,null));};var interaction_log=require('../../config/logger')(_0x7827('0x60'));exports['accept']=function(_0x5f4e7e,_0x420f7e,_0x1394f9){var _0x37835c={'agent':{},'channel':'sms'};if(_0x5f4e7e[_0x7827('0x5b')]['id']){delete _0x5f4e7e['body']['id'];}_0x5f4e7e[_0x7827('0x5b')]['read']=!![];_0x5f4e7e[_0x7827('0x5b')]['readAt']=moment()[_0x7827('0x61')](_0x7827('0x62'));_0x5f4e7e[_0x7827('0x5b')][_0x7827('0x63')]=_0x5f4e7e[_0x7827('0x5b')][_0x7827('0x63')]||_0x5f4e7e[_0x7827('0x64')]['id'];_0x37835c[_0x7827('0x65')]['id']=_0x5f4e7e[_0x7827('0x5b')]['UserId'];return db['SmsMessage'][_0x7827('0x5c')]({'where':{'id':_0x5f4e7e[_0x7827('0x5d')]['id'],'UserId':null}})[_0x7827('0x24')](handleEntityNotFound(_0x420f7e,null))[_0x7827('0x24')](saveUpdates(_0x5f4e7e[_0x7827('0x5b')],null))[_0x7827('0x24')](function(_0x155998){if(_0x155998){_0x37835c[_0x7827('0x2d')]=_0x155998[_0x7827('0x66')]({'plain':!![]});return db[_0x7827('0x67')][_0x7827('0x5c')]({'where':{'id':_0x155998[_0x7827('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x420f7e,null))[_0x7827('0x24')](function(_0x17f449){if(_0x17f449){return _0x17f449[_0x7827('0x3b')]({'UserId':_0x5f4e7e[_0x7827('0x5b')][_0x7827('0x63')],'read1stAt':_[_0x7827('0x69')](_0x17f449['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7827('0x24')](function(_0x4b409a){if(_0x4b409a){_0x37835c[_0x7827('0x6a')]=_0x4b409a['get']({'plain':!![]});interaction_log['info'](_0x7827('0x6b'),_0x5f4e7e[_0x7827('0x64')]['id'],_0x5f4e7e['user']['name'],_0x5f4e7e[_0x7827('0x64')][_0x7827('0x6c')],_0x37835c['interaction']['id'],_0x5f4e7e[_0x7827('0x5b')]?JSON[_0x7827('0x2a')](_0x5f4e7e[_0x7827('0x5b')]):_0x7827('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x7827('0x6e'),_0x37835c);}return null;})['then'](function(_0x1c42eb){var _0x3cef3c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c42eb[_0x7827('0x2d')]['ContactId'];return db[_0x7827('0x6f')][_0x7827('0x45')](_0x3cef3c,{'type':db[_0x7827('0x70')]['QueryTypes'][_0x7827('0x71')],'raw':!![]})[_0x7827('0x24')](function(_0x3072fd){return _0x3072fd;});})[_0x7827('0x24')](function(_0x511680){if(_0x511680){_0x37835c[_0x7827('0x2d')][_0x7827('0x72')]=_0x511680[0x0];if(!_0x5f4e7e['body'][_0x7827('0x63')])return;return db[_0x7827('0x73')][_0x7827('0x5c')]({'where':{'id':_0x5f4e7e[_0x7827('0x5b')][_0x7827('0x63')],'role':'agent'},'attributes':['id',_0x7827('0x3d'),_0x7827('0x74'),_0x7827('0x75'),'internal'],'raw':!![]});}return null;})[_0x7827('0x24')](function(_0x59abf1){if(!_0x59abf1)return null;_0x37835c['message']['agent']=_0x59abf1;return _0x37835c;})[_0x7827('0x24')](function(_0x30e106){if(_0x30e106){if(_0x5f4e7e[_0x7827('0x5b')][_0x7827('0x76')]){_0x37835c[_0x7827('0x2d')][_0x7827('0x77')]=util['format'](_0x7827('0x78'),_0x5f4e7e[_0x7827('0x64')][_0x7827('0x3d')]);_0x37835c[_0x7827('0x2d')][_0x7827('0x79')]=_0x37835c[_0x7827('0x79')];_0x37835c[_0x7827('0x2d')]['motionChannel']=_0x37835c[_0x7827('0x79')];_0x37835c[_0x7827('0x2d')]['event']='accept';return respondWithRpcPromise(_0x7827('0x7a'),_0x7827('0x7a'),{'event':_0x7827('0x7b'),'message':_0x37835c[_0x7827('0x2d')]},client9002)[_0x7827('0x24')](function(){return _0x37835c;});}return _0x37835c;}return null;})[_0x7827('0x24')](respondWithResult(_0x420f7e,null))['catch'](handleError(_0x420f7e,null));};var interaction_log=require(_0x7827('0x15'))(_0x7827('0x60'));exports[_0x7827('0x7c')]=function(_0x215f41,_0xbcc9b1,_0xf99b5){var _0x3f8d89={'agent':{},'channel':_0x7827('0x7d')};if(_0x215f41[_0x7827('0x5b')]['id']){delete _0x215f41['body']['id'];}_0x215f41[_0x7827('0x5b')]['UserId']=_0x215f41[_0x7827('0x5b')][_0x7827('0x63')]||_0x215f41['user']['id'];_0x3f8d89[_0x7827('0x65')]['id']=_0x215f41['body'][_0x7827('0x63')];return db['SmsMessage'][_0x7827('0x5c')]({'where':{'id':_0x215f41['params']['id'],'UserId':null}})[_0x7827('0x24')](handleEntityNotFound(_0xbcc9b1,null))[_0x7827('0x24')](function(_0x1c0b1f){if(_0x1c0b1f){_0x3f8d89['message']=_0x1c0b1f[_0x7827('0x66')]({'plain':!![]});return db[_0x7827('0x67')][_0x7827('0x5c')]({'where':{'id':_0x1c0b1f[_0x7827('0x68')]}});}return null;})[_0x7827('0x24')](handleEntityNotFound(_0xbcc9b1,null))[_0x7827('0x24')](function(_0x2197d3){if(_0x2197d3){_0x3f8d89[_0x7827('0x6a')]=_0x2197d3['get']({'plain':!![]});interaction_log[_0x7827('0x25')](_0x7827('0x7e'),_0x215f41[_0x7827('0x64')]['id'],_0x215f41[_0x7827('0x64')][_0x7827('0x3d')],_0x215f41[_0x7827('0x64')][_0x7827('0x6c')],_0x3f8d89['interaction']['id'],_0x215f41[_0x7827('0x5b')]?JSON[_0x7827('0x2a')](_0x215f41[_0x7827('0x5b')]):_0x7827('0x6d'));return respondWithRpcPromise(_0x7827('0x7f'),_0x7827('0x80'),_0x3f8d89);}return null;})['then'](function(_0x643f90){var _0x1c1307=_0x7827('0x81')+_0x643f90[_0x7827('0x2d')][_0x7827('0x82')];return db[_0x7827('0x6f')][_0x7827('0x45')](_0x1c1307,{'type':db[_0x7827('0x70')][_0x7827('0x83')][_0x7827('0x71')],'raw':!![]})[_0x7827('0x24')](function(_0xbb51a5){return _0xbb51a5;});})['then'](function(_0x61054e){if(_0x61054e){_0x3f8d89[_0x7827('0x2d')][_0x7827('0x72')]=_0x61054e[0x0];if(!_0x215f41[_0x7827('0x5b')]['UserId'])return;return db[_0x7827('0x73')][_0x7827('0x5c')]({'where':{'id':_0x215f41['body'][_0x7827('0x63')],'role':_0x7827('0x65')},'attributes':['id',_0x7827('0x3d'),_0x7827('0x74'),'email',_0x7827('0x84')],'raw':!![]});}return null;})[_0x7827('0x24')](function(_0x599c3f){if(!_0x599c3f)return null;_0x3f8d89[_0x7827('0x2d')][_0x7827('0x65')]=_0x599c3f;return _0x3f8d89;})['then'](function(_0x209103){if(_0x209103){_0x209103[_0x7827('0x2d')][_0x7827('0x77')]=util[_0x7827('0x61')](_0x7827('0x78'),_0x215f41[_0x7827('0x64')]['name']);_0x209103['message'][_0x7827('0x79')]=_0x3f8d89[_0x7827('0x79')];_0x209103[_0x7827('0x2d')][_0x7827('0x85')]=_0x3f8d89[_0x7827('0x79')];_0x209103[_0x7827('0x2d')]['event']=_0x7827('0x7c');respondWithRpcPromise(_0x7827('0x7a'),_0x7827('0x7a'),{'event':'rejectmessage','message':_0x209103[_0x7827('0x2d')]},client9002);return _0x3f8d89;}return null;})[_0x7827('0x24')](respondWithResult(_0xbcc9b1,null))[_0x7827('0x2e')](handleError(_0xbcc9b1,null));};exports[_0x7827('0x30')]=function(_0x253fbf,_0xc143,_0x10bb44){if(_0x253fbf['body']['id']){delete _0x253fbf['body']['id'];}var _0x3fb405;return db[_0x7827('0x40')][_0x7827('0x5c')]({'where':{'id':_0x253fbf[_0x7827('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc143,null))['then'](function(_0x17fc62){if(_0x17fc62){_0x3fb405=_0x17fc62;return db[_0x7827('0x86')][_0x7827('0x5c')]({'where':{'id':_0x17fc62['SmsAccountId']}});}})[_0x7827('0x24')](handleEntityNotFound(_0xc143,null))['then'](function(_0x56d740){if(_0x56d740){logger['debug'](_0x7827('0x28'),_0x7827('0x30'),'received\x20delivery\x20report\x20from',_0x56d740[_0x7827('0x42')],util['inspect'](_0x253fbf[_0x7827('0x5b')],{'showHidden':![],'depth':null}));switch(_0x56d740['type']){case _0x7827('0x87'):if(_0x253fbf[_0x7827('0x5b')][_0x7827('0x88')]&&_0x253fbf['body'][_0x7827('0x88')]===_0x3fb405[_0x7827('0x89')]){return _0x3fb405[_0x7827('0x3b')]({'read':!![]});}else{logger[_0x7827('0x2b')](_0x7827('0x8a'),_0x7827('0x30'),'twilio',util[_0x7827('0x8b')](_0x253fbf['body'],{'showHidden':![],'depth':null}));}break;case _0x7827('0x8c'):if(_0x253fbf[_0x7827('0x5b')]['MessageUUID']&&_0x253fbf[_0x7827('0x5b')][_0x7827('0x8d')]===_0x3fb405[_0x7827('0x89')]&&_['indexOf']([_0x7827('0x8e'),_0x7827('0x8f')],_0x253fbf[_0x7827('0x5b')][_0x7827('0x90')])>=0x0){return _0x3fb405[_0x7827('0x3b')]({'read':!![]});}else{logger[_0x7827('0x2b')](_0x7827('0x8a'),_0x7827('0x30'),'plivio',util[_0x7827('0x8b')](_0x253fbf['body'],{'showHidden':![],'depth':null}));}break;case _0x7827('0x91'):var _0x5ced48=_0x253fbf[_0x7827('0x5b')][_0x7827('0x92')][0x0];if(_0x5ced48['status'][_0x7827('0x93')]===_0x7827('0x94')){return _0x3fb405['update']({'read':!![]});}else{logger[_0x7827('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7827('0x91'),util[_0x7827('0x8b')](_0x253fbf[_0x7827('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3fb405;}})['then'](respondWithResult(_0xc143,null))[_0x7827('0x2e')](handleError(_0xc143,null));}; \ No newline at end of file +var _0x7a2f=['indexOf','delivered','plivio','inspect','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','map','rawAttributes','fieldName','model','keys','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','type','VIRTUAL','SmsMessage','includeAll','include','rows','show','params','options','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','event','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7a2f,0x99));var _0xf7a2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a2f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf7a2('0x0'));var rimraf=require(_0xf7a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a2('0x2'));var rp=require(_0xf7a2('0x3'));var moment=require(_0xf7a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7a2('0x5'));var util=require(_0xf7a2('0x6'));var path=require(_0xf7a2('0x7'));var sox=require(_0xf7a2('0x8'));var csv=require(_0xf7a2('0x9'));var ejs=require(_0xf7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf7a2('0x9'));var querystring=require(_0xf7a2('0xf'));var Papa=require(_0xf7a2('0x10'));var Redis=require(_0xf7a2('0x11'));var authService=require(_0xf7a2('0x12'));var qs=require(_0xf7a2('0x13'));var as=require(_0xf7a2('0x14'));var hardwareService=require(_0xf7a2('0x15'));var logger=require('../../config/logger')(_0xf7a2('0x16'));var utils=require(_0xf7a2('0x17'));var config=require(_0xf7a2('0x18'));var licenseUtil=require(_0xf7a2('0x19'));var db=require(_0xf7a2('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf7a2('0x1b'),'port':0x18eb});var socket=require(_0xf7a2('0x1c'))(new Redis(config[_0xf7a2('0x1d')]));require(_0xf7a2('0x1e'))[_0xf7a2('0x1f')](socket);var jayson=require(_0xf7a2('0x20'));var client=jayson[_0xf7a2('0x21')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16b0dc,_0x5ef0aa,_0x51999f,_0x29d384){return new BPromise(function(_0x193501,_0x2f054f){var _0x3147b2=_0x29d384||client;return _0x3147b2[_0xf7a2('0x22')](_0x16b0dc,_0x51999f)['then'](function(_0x58c534){logger['info'](_0xf7a2('0x23'),_0x5ef0aa,_0xf7a2('0x24'));logger[_0xf7a2('0x25')](_0xf7a2('0x26'),_0x5ef0aa,_0xf7a2('0x24'),JSON['stringify'](_0x58c534));if(_0x58c534[_0xf7a2('0x27')]){if(_0x58c534['error'][_0xf7a2('0x28')]===0x1f4){logger[_0xf7a2('0x27')](_0xf7a2('0x23'),_0x5ef0aa,_0x58c534[_0xf7a2('0x27')][_0xf7a2('0x29')]);return _0x2f054f(_0x58c534[_0xf7a2('0x27')][_0xf7a2('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x5ef0aa,_0x58c534[_0xf7a2('0x27')][_0xf7a2('0x29')]);return _0x193501(_0x58c534['error'][_0xf7a2('0x29')]);}else{logger[_0xf7a2('0x2a')](_0xf7a2('0x23'),_0x5ef0aa,_0xf7a2('0x24'));_0x193501(_0x58c534[_0xf7a2('0x2b')]['message']);}})[_0xf7a2('0x2c')](function(_0x484874){logger[_0xf7a2('0x27')](_0xf7a2('0x23'),_0x5ef0aa,_0x484874);_0x2f054f(_0x484874);});});}function respondWithStatusCode(_0xfe27bc,_0x48a4d8){_0x48a4d8=_0x48a4d8||0xcc;return function(_0x34af9b){if(_0x34af9b){return _0xfe27bc['sendStatus'](_0x48a4d8);}return _0xfe27bc[_0xf7a2('0x2d')](_0x48a4d8)['end']();};}function respondWithResult(_0x1f1a79,_0x20b702){_0x20b702=_0x20b702||0xc8;return function(_0x2a9c48){if(_0x2a9c48){return _0x1f1a79[_0xf7a2('0x2d')](_0x20b702)[_0xf7a2('0x2e')](_0x2a9c48);}};}function respondWithFilteredResult(_0x234359,_0xe7d318){return function(_0x5d64d1){if(_0x5d64d1){var _0x1c764b=typeof _0xe7d318[_0xf7a2('0x2f')]==='undefined'&&typeof _0xe7d318['limit']==='undefined';var _0x2a48da=_0x5d64d1[_0xf7a2('0x30')];var _0x20ccc0=_0x1c764b?0x0:_0xe7d318[_0xf7a2('0x2f')];var _0x1a6ae9=_0x1c764b?_0x5d64d1['count']:_0xe7d318[_0xf7a2('0x2f')]+_0xe7d318[_0xf7a2('0x31')];var _0x54b1b2;if(_0x1a6ae9>=_0x2a48da){_0x1a6ae9=_0x2a48da;_0x54b1b2=0xc8;}else{_0x54b1b2=0xce;}_0x234359['status'](_0x54b1b2);return _0x234359[_0xf7a2('0x32')](_0xf7a2('0x33'),_0x20ccc0+'-'+_0x1a6ae9+'/'+_0x2a48da)[_0xf7a2('0x2e')](_0x5d64d1);}return null;};}function patchUpdates(_0x583b03){return function(_0x243944){try{jsonpatch[_0xf7a2('0x34')](_0x243944,_0x583b03,!![]);}catch(_0x4223eb){return BPromise[_0xf7a2('0x35')](_0x4223eb);}return _0x243944[_0xf7a2('0x36')]();};}function saveUpdates(_0x124b06,_0x44daa7){return function(_0x2f3aab){if(_0x2f3aab){return _0x2f3aab[_0xf7a2('0x37')](_0x124b06)[_0xf7a2('0x38')](function(_0x1fb301){return _0x1fb301;});}return null;};}function removeEntity(_0x22d2ae,_0x3d245b){return function(_0x354b7d){if(_0x354b7d){return _0x354b7d[_0xf7a2('0x39')]()[_0xf7a2('0x38')](function(){_0x22d2ae[_0xf7a2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x487dcc,_0x35582c){return function(_0x2345f3){if(!_0x2345f3){_0x487dcc[_0xf7a2('0x3a')](0x194);}return _0x2345f3;};}function handleError(_0x23b07c,_0x4ae1fd){_0x4ae1fd=_0x4ae1fd||0x1f4;return function(_0xd9707c){logger[_0xf7a2('0x27')](_0xd9707c[_0xf7a2('0x3b')]);if(_0xd9707c['name']){delete _0xd9707c[_0xf7a2('0x3c')];}_0x23b07c[_0xf7a2('0x2d')](_0x4ae1fd)['send'](_0xd9707c);};}exports['index']=function(_0x2a59ec,_0x4c3d49){var _0x14013f={},_0x44a155={},_0x54bab6={'count':0x0,'rows':[]};var _0x52e852=_[_0xf7a2('0x3d')](db['SmsMessage'][_0xf7a2('0x3e')],function(_0x211f29){return{'name':_0x211f29[_0xf7a2('0x3f')],'type':_0x211f29['type']['key']};});_0x44a155[_0xf7a2('0x40')]=_[_0xf7a2('0x3d')](_0x52e852,_0xf7a2('0x3c'));_0x44a155['query']=_[_0xf7a2('0x41')](_0x2a59ec['query']);_0x44a155['filters']=_['intersection'](_0x44a155[_0xf7a2('0x40')],_0x44a155['query']);_0x14013f[_0xf7a2('0x42')]=_[_0xf7a2('0x43')](_0x44a155[_0xf7a2('0x40')],qs[_0xf7a2('0x44')](_0x2a59ec[_0xf7a2('0x45')][_0xf7a2('0x44')]));_0x14013f[_0xf7a2('0x42')]=_0x14013f[_0xf7a2('0x42')][_0xf7a2('0x46')]?_0x14013f['attributes']:_0x44a155['model'];if(!_0x2a59ec[_0xf7a2('0x45')][_0xf7a2('0x47')](_0xf7a2('0x48'))){_0x14013f[_0xf7a2('0x31')]=qs['limit'](_0x2a59ec['query']['limit']);_0x14013f['offset']=qs['offset'](_0x2a59ec['query'][_0xf7a2('0x2f')]);}_0x14013f[_0xf7a2('0x49')]=qs[_0xf7a2('0x4a')](_0x2a59ec[_0xf7a2('0x45')][_0xf7a2('0x4a')]);_0x14013f['where']=qs[_0xf7a2('0x4b')](_['pick'](_0x2a59ec[_0xf7a2('0x45')],_0x44a155[_0xf7a2('0x4b')]),_0x52e852);if(_0x2a59ec[_0xf7a2('0x45')][_0xf7a2('0x4c')]){_0x14013f['where']=_[_0xf7a2('0x4d')](_0x14013f[_0xf7a2('0x4e')],{'$or':_[_0xf7a2('0x3d')](_0x52e852,function(_0xc97bb6){if(_0xc97bb6[_0xf7a2('0x4f')]!==_0xf7a2('0x50')){var _0xeea11b={};_0xeea11b[_0xc97bb6[_0xf7a2('0x3c')]]={'$like':'%'+_0x2a59ec[_0xf7a2('0x45')]['filter']+'%'};return _0xeea11b;}})});}_0x14013f=_['merge']({},_0x14013f,_0x2a59ec['options']);var _0x2fb1d7={'where':_0x14013f[_0xf7a2('0x4e')]};return db[_0xf7a2('0x51')][_0xf7a2('0x30')](_0x2fb1d7)[_0xf7a2('0x38')](function(_0x55ba23){_0x54bab6[_0xf7a2('0x30')]=_0x55ba23;if(_0x2a59ec['query'][_0xf7a2('0x52')]){_0x14013f[_0xf7a2('0x53')]=[{'all':!![]}];}return db[_0xf7a2('0x51')]['findAll'](_0x14013f);})['then'](function(_0x2092c1){_0x54bab6[_0xf7a2('0x54')]=_0x2092c1;return _0x54bab6;})[_0xf7a2('0x38')](respondWithFilteredResult(_0x4c3d49,_0x14013f))[_0xf7a2('0x2c')](handleError(_0x4c3d49,null));};exports[_0xf7a2('0x55')]=function(_0x1fabc1,_0x2c30d6){var _0x34cf74={'raw':!![],'where':{'id':_0x1fabc1[_0xf7a2('0x56')]['id']}},_0x459dd1={};_0x459dd1['model']=_[_0xf7a2('0x41')](db['SmsMessage'][_0xf7a2('0x3e')]);_0x459dd1[_0xf7a2('0x45')]=_[_0xf7a2('0x41')](_0x1fabc1[_0xf7a2('0x45')]);_0x459dd1[_0xf7a2('0x4b')]=_[_0xf7a2('0x43')](_0x459dd1['model'],_0x459dd1['query']);_0x34cf74[_0xf7a2('0x42')]=_[_0xf7a2('0x43')](_0x459dd1[_0xf7a2('0x40')],qs[_0xf7a2('0x44')](_0x1fabc1['query'][_0xf7a2('0x44')]));_0x34cf74[_0xf7a2('0x42')]=_0x34cf74[_0xf7a2('0x42')]['length']?_0x34cf74[_0xf7a2('0x42')]:_0x459dd1['model'];if(_0x1fabc1[_0xf7a2('0x45')][_0xf7a2('0x52')]){_0x34cf74[_0xf7a2('0x53')]=[{'all':!![]}];}_0x34cf74=_[_0xf7a2('0x4d')]({},_0x34cf74,_0x1fabc1[_0xf7a2('0x57')]);return db[_0xf7a2('0x51')][_0xf7a2('0x58')](_0x34cf74)[_0xf7a2('0x38')](handleEntityNotFound(_0x2c30d6,null))[_0xf7a2('0x38')](respondWithResult(_0x2c30d6,null))[_0xf7a2('0x2c')](handleError(_0x2c30d6,null));};exports[_0xf7a2('0x59')]=function(_0x5bde15,_0x13f9e4){return db[_0xf7a2('0x51')][_0xf7a2('0x59')](_0x5bde15[_0xf7a2('0x5a')],{})[_0xf7a2('0x38')](respondWithResult(_0x13f9e4,0xc9))[_0xf7a2('0x2c')](handleError(_0x13f9e4,null));};exports[_0xf7a2('0x37')]=function(_0x3f44ce,_0xb6ab43){if(_0x3f44ce['body']['id']){delete _0x3f44ce[_0xf7a2('0x5a')]['id'];}return db[_0xf7a2('0x51')][_0xf7a2('0x58')]({'where':{'id':_0x3f44ce[_0xf7a2('0x56')]['id']}})['then'](handleEntityNotFound(_0xb6ab43,null))['then'](saveUpdates(_0x3f44ce[_0xf7a2('0x5a')],null))[_0xf7a2('0x38')](respondWithResult(_0xb6ab43,null))[_0xf7a2('0x2c')](handleError(_0xb6ab43,null));};exports[_0xf7a2('0x39')]=function(_0x2a9f8d,_0x5bf1d3){return db[_0xf7a2('0x51')]['find']({'where':{'id':_0x2a9f8d[_0xf7a2('0x56')]['id']}})[_0xf7a2('0x38')](handleEntityNotFound(_0x5bf1d3,null))[_0xf7a2('0x38')](removeEntity(_0x5bf1d3,null))[_0xf7a2('0x2c')](handleError(_0x5bf1d3,null));};exports[_0xf7a2('0x5b')]=function(_0x33dbe9,_0x5e6bd8){return db[_0xf7a2('0x51')][_0xf7a2('0x5b')]()[_0xf7a2('0x38')](respondWithResult(_0x5e6bd8,null))[_0xf7a2('0x2c')](handleError(_0x5e6bd8,null));};var interaction_log=require(_0xf7a2('0x5c'))(_0xf7a2('0x5d'));exports[_0xf7a2('0x5e')]=function(_0x51999c,_0x5a26b3,_0x5b58a2){var _0x53c149={'agent':{},'channel':_0xf7a2('0x5f')};if(_0x51999c[_0xf7a2('0x5a')]['id']){delete _0x51999c['body']['id'];}_0x51999c[_0xf7a2('0x5a')][_0xf7a2('0x60')]=!![];_0x51999c['body']['readAt']=moment()[_0xf7a2('0x61')](_0xf7a2('0x62'));_0x51999c[_0xf7a2('0x5a')]['UserId']=_0x51999c[_0xf7a2('0x5a')][_0xf7a2('0x63')]||_0x51999c[_0xf7a2('0x64')]['id'];_0x53c149[_0xf7a2('0x65')]['id']=_0x51999c[_0xf7a2('0x5a')]['UserId'];return db[_0xf7a2('0x51')]['find']({'where':{'id':_0x51999c[_0xf7a2('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a26b3,null))['then'](saveUpdates(_0x51999c[_0xf7a2('0x5a')],null))[_0xf7a2('0x38')](function(_0x97e265){if(_0x97e265){_0x53c149['message']=_0x97e265[_0xf7a2('0x66')]({'plain':!![]});return db['SmsInteraction'][_0xf7a2('0x58')]({'where':{'id':_0x97e265[_0xf7a2('0x67')]}});}return null;})[_0xf7a2('0x38')](handleEntityNotFound(_0x5a26b3,null))[_0xf7a2('0x38')](function(_0x5b1246){if(_0x5b1246){return _0x5b1246['update']({'UserId':_0x51999c['body']['UserId'],'read1stAt':_[_0xf7a2('0x68')](_0x5b1246[_0xf7a2('0x69')])?moment()[_0xf7a2('0x61')](_0xf7a2('0x62')):undefined});}return null;})[_0xf7a2('0x38')](function(_0x52b88e){if(_0x52b88e){_0x53c149[_0xf7a2('0x6a')]=_0x52b88e['get']({'plain':!![]});interaction_log['info'](_0xf7a2('0x6b'),_0x51999c['user']['id'],_0x51999c[_0xf7a2('0x64')][_0xf7a2('0x3c')],_0x51999c[_0xf7a2('0x64')][_0xf7a2('0x6c')],_0x53c149[_0xf7a2('0x6a')]['id'],_0x51999c['body']?JSON[_0xf7a2('0x6d')](_0x51999c['body']):'null');return respondWithRpcPromise(_0xf7a2('0x6e'),_0xf7a2('0x6f'),_0x53c149);}return null;})[_0xf7a2('0x38')](function(_0x2b1214){var _0x5e6d20='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b1214[_0xf7a2('0x29')][_0xf7a2('0x70')];return db[_0xf7a2('0x71')][_0xf7a2('0x45')](_0x5e6d20,{'type':db['Sequelize'][_0xf7a2('0x72')][_0xf7a2('0x73')],'raw':!![]})[_0xf7a2('0x38')](function(_0x39c7c8){return _0x39c7c8;});})[_0xf7a2('0x38')](function(_0x324991){if(_0x324991){_0x53c149[_0xf7a2('0x29')][_0xf7a2('0x74')]=_0x324991[0x0];if(!_0x51999c['body'][_0xf7a2('0x63')])return;return db[_0xf7a2('0x75')][_0xf7a2('0x58')]({'where':{'id':_0x51999c[_0xf7a2('0x5a')][_0xf7a2('0x63')],'role':_0xf7a2('0x65')},'attributes':['id',_0xf7a2('0x3c'),_0xf7a2('0x76'),_0xf7a2('0x77'),_0xf7a2('0x78')],'raw':!![]});}return null;})[_0xf7a2('0x38')](function(_0x54f9e5){if(!_0x54f9e5)return null;_0x53c149[_0xf7a2('0x29')][_0xf7a2('0x65')]=_0x54f9e5;return _0x53c149;})[_0xf7a2('0x38')](function(_0x42324b){if(_0x42324b){if(_0x51999c[_0xf7a2('0x5a')][_0xf7a2('0x79')]){_0x53c149[_0xf7a2('0x29')]['interface']=util[_0xf7a2('0x61')](_0xf7a2('0x7a'),_0x51999c[_0xf7a2('0x64')][_0xf7a2('0x3c')]);_0x53c149[_0xf7a2('0x29')][_0xf7a2('0x7b')]=_0x53c149[_0xf7a2('0x7b')];_0x53c149[_0xf7a2('0x29')]['motionChannel']=_0x53c149['channel'];_0x53c149[_0xf7a2('0x29')]['event']='accept';return respondWithRpcPromise('EventManager',_0xf7a2('0x7c'),{'event':_0xf7a2('0x7d'),'message':_0x53c149[_0xf7a2('0x29')]},client9002)['then'](function(){return _0x53c149;});}return _0x53c149;}return null;})[_0xf7a2('0x38')](respondWithResult(_0x5a26b3,null))[_0xf7a2('0x2c')](handleError(_0x5a26b3,null));};var interaction_log=require(_0xf7a2('0x5c'))(_0xf7a2('0x5d'));exports['reject']=function(_0x481d66,_0x4d5142,_0x380955){var _0x592351={'agent':{},'channel':'sms'};if(_0x481d66[_0xf7a2('0x5a')]['id']){delete _0x481d66[_0xf7a2('0x5a')]['id'];}_0x481d66[_0xf7a2('0x5a')][_0xf7a2('0x63')]=_0x481d66[_0xf7a2('0x5a')]['UserId']||_0x481d66['user']['id'];_0x592351['agent']['id']=_0x481d66[_0xf7a2('0x5a')][_0xf7a2('0x63')];return db[_0xf7a2('0x51')][_0xf7a2('0x58')]({'where':{'id':_0x481d66[_0xf7a2('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d5142,null))[_0xf7a2('0x38')](function(_0x2f319c){if(_0x2f319c){_0x592351[_0xf7a2('0x29')]=_0x2f319c[_0xf7a2('0x66')]({'plain':!![]});return db['SmsInteraction'][_0xf7a2('0x58')]({'where':{'id':_0x2f319c[_0xf7a2('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x4d5142,null))[_0xf7a2('0x38')](function(_0x2b0541){if(_0x2b0541){_0x592351[_0xf7a2('0x6a')]=_0x2b0541[_0xf7a2('0x66')]({'plain':!![]});interaction_log[_0xf7a2('0x2a')](_0xf7a2('0x7e'),_0x481d66[_0xf7a2('0x64')]['id'],_0x481d66[_0xf7a2('0x64')]['name'],_0x481d66[_0xf7a2('0x64')][_0xf7a2('0x6c')],_0x592351[_0xf7a2('0x6a')]['id'],_0x481d66['body']?JSON[_0xf7a2('0x6d')](_0x481d66[_0xf7a2('0x5a')]):_0xf7a2('0x7f'));return respondWithRpcPromise(_0xf7a2('0x80'),_0xf7a2('0x81'),_0x592351);}return null;})[_0xf7a2('0x38')](function(_0x184ce9){var _0x3ecad3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x184ce9[_0xf7a2('0x29')][_0xf7a2('0x70')];return db['sequelize'][_0xf7a2('0x45')](_0x3ecad3,{'type':db['Sequelize'][_0xf7a2('0x72')]['SELECT'],'raw':!![]})[_0xf7a2('0x38')](function(_0x144f0b){return _0x144f0b;});})[_0xf7a2('0x38')](function(_0x25ce12){if(_0x25ce12){_0x592351[_0xf7a2('0x29')][_0xf7a2('0x74')]=_0x25ce12[0x0];if(!_0x481d66['body'][_0xf7a2('0x63')])return;return db[_0xf7a2('0x75')][_0xf7a2('0x58')]({'where':{'id':_0x481d66['body']['UserId'],'role':'agent'},'attributes':['id',_0xf7a2('0x3c'),_0xf7a2('0x76'),_0xf7a2('0x77'),_0xf7a2('0x78')],'raw':!![]});}return null;})['then'](function(_0x2f6080){if(!_0x2f6080)return null;_0x592351['message']['agent']=_0x2f6080;return _0x592351;})['then'](function(_0x2537b0){if(_0x2537b0){_0x2537b0['message']['interface']=util['format'](_0xf7a2('0x7a'),_0x481d66[_0xf7a2('0x64')][_0xf7a2('0x3c')]);_0x2537b0[_0xf7a2('0x29')][_0xf7a2('0x7b')]=_0x592351[_0xf7a2('0x7b')];_0x2537b0['message'][_0xf7a2('0x82')]=_0x592351['channel'];_0x2537b0['message'][_0xf7a2('0x83')]=_0xf7a2('0x35');respondWithRpcPromise(_0xf7a2('0x7c'),'EventManager',{'event':'rejectmessage','message':_0x2537b0[_0xf7a2('0x29')]},client9002);return _0x592351;}return null;})['then'](respondWithResult(_0x4d5142,null))[_0xf7a2('0x2c')](handleError(_0x4d5142,null));};exports[_0xf7a2('0x2d')]=function(_0x509a07,_0x261826,_0x56f52b){if(_0x509a07['body']['id']){delete _0x509a07[_0xf7a2('0x5a')]['id'];}var _0x48faa9;return db[_0xf7a2('0x51')]['find']({'where':{'id':_0x509a07['params']['id']}})[_0xf7a2('0x38')](handleEntityNotFound(_0x261826,null))[_0xf7a2('0x38')](function(_0x3f0b19){if(_0x3f0b19){_0x48faa9=_0x3f0b19;return db['SmsAccount'][_0xf7a2('0x58')]({'where':{'id':_0x3f0b19[_0xf7a2('0x84')]}});}})[_0xf7a2('0x38')](handleEntityNotFound(_0x261826,null))['then'](function(_0x2ab226){if(_0x2ab226){logger[_0xf7a2('0x25')](_0xf7a2('0x26'),_0xf7a2('0x2d'),_0xf7a2('0x85'),_0x2ab226['type'],util['inspect'](_0x509a07['body'],{'showHidden':![],'depth':null}));switch(_0x2ab226[_0xf7a2('0x4f')]){case'twilio':if(_0x509a07[_0xf7a2('0x5a')][_0xf7a2('0x86')]&&_0x509a07[_0xf7a2('0x5a')][_0xf7a2('0x86')]===_0x48faa9['messageId']){return _0x48faa9[_0xf7a2('0x37')]({'read':!![]});}else{logger[_0xf7a2('0x27')](_0xf7a2('0x87'),'status',_0xf7a2('0x88'),util['inspect'](_0x509a07['body'],{'showHidden':![],'depth':null}));}break;case _0xf7a2('0x89'):if(_0x509a07['body']['MessageUUID']&&_0x509a07['body'][_0xf7a2('0x8a')]===_0x48faa9['messageId']&&_[_0xf7a2('0x8b')](['sent',_0xf7a2('0x8c')],_0x509a07[_0xf7a2('0x5a')]['Status'])>=0x0){return _0x48faa9[_0xf7a2('0x37')]({'read':!![]});}else{logger[_0xf7a2('0x27')](_0xf7a2('0x87'),'status',_0xf7a2('0x8d'),util[_0xf7a2('0x8e')](_0x509a07[_0xf7a2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf7a2('0x8f'):var _0x118e7e=_0x509a07[_0xf7a2('0x5a')][_0xf7a2('0x90')][0x0];if(_0x118e7e['status']['groupName']===_0xf7a2('0x91')){return _0x48faa9[_0xf7a2('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf7a2('0x8f'),util[_0xf7a2('0x8e')](_0x509a07[_0xf7a2('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x48faa9;}})[_0xf7a2('0x38')](respondWithResult(_0x261826,null))['catch'](handleError(_0x261826,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b771335..1093490 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 _0x7da7=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7da7,0x192));var _0x77da=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x7da7[_0x43c8b8];return _0x413be3;};'use strict';var EventEmitter=require(_0x77da('0x0'));var SmsMessage=require(_0x77da('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x77da('0x2')](0x0);var events={'afterCreate':_0x77da('0x3'),'afterUpdate':_0x77da('0x4'),'afterDestroy':_0x77da('0x5')};function emitEvent(_0x39310e){return function(_0x1a235e,_0x532e40,_0x1d0e92){SmsMessageEvents['emit'](_0x39310e+':'+_0x1a235e['id'],_0x1a235e);SmsMessageEvents[_0x77da('0x6')](_0x39310e,_0x1a235e);_0x1d0e92(null);};}for(var e in events){if(events[_0x77da('0x7')](e)){var event=events[e];SmsMessage[_0x77da('0x8')](e,emitEvent(event));}}module[_0x77da('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x9f32=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x9f32,0x129));var _0x29f3=function(_0x4961ef,_0x182301){_0x4961ef=_0x4961ef-0x0;var _0x2d4c11=_0x9f32[_0x4961ef];return _0x2d4c11;};'use strict';var EventEmitter=require(_0x29f3('0x0'));var SmsMessage=require(_0x29f3('0x1'))['db'][_0x29f3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x29f3('0x3')](0x0);var events={'afterCreate':_0x29f3('0x4'),'afterUpdate':_0x29f3('0x5'),'afterDestroy':_0x29f3('0x6')};function emitEvent(_0x2aaf14){return function(_0x14c26f,_0x3915c8,_0xbea63f){SmsMessageEvents[_0x29f3('0x7')](_0x2aaf14+':'+_0x14c26f['id'],_0x14c26f);SmsMessageEvents[_0x29f3('0x7')](_0x2aaf14,_0x14c26f);_0xbea63f(null);};}for(var e in events){if(events[_0x29f3('0x8')](e)){var event=events[e];SmsMessage[_0x29f3('0x9')](e,emitEvent(event));}}module[_0x29f3('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 30a7622..79044ec 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 _0x201f=['deliveryReport','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','base64','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','get','toLowerCase','direction','out','secret','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','find','type','twilio','authToken','phone','accountSid','messages','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','afterCreate','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid'];(function(_0x44dafa,_0x4dbc5b){var _0x1d166b=function(_0xe3e5b4){while(--_0xe3e5b4){_0x44dafa['push'](_0x44dafa['shift']());}};_0x1d166b(++_0x4dbc5b);}(_0x201f,0x130));var _0xf201=function(_0x275210,_0x26f095){_0x275210=_0x275210-0x0;var _0x184247=_0x201f[_0x275210];return _0x184247;};'use strict';var _=require(_0xf201('0x0'));var util=require('util');var logger=require(_0xf201('0x1'))(_0xf201('0x2'));var moment=require(_0xf201('0x3'));var BPromise=require(_0xf201('0x4'));var rp=require(_0xf201('0x5'));var fs=require('fs');var path=require(_0xf201('0x6'));var rimraf=require(_0xf201('0x7'));var config=require(_0xf201('0x8'));var attributes=require(_0xf201('0x9'));module[_0xf201('0xa')]=function(_0xeb268e,_0x5cfd71){return _0xeb268e[_0xf201('0xb')]('SmsMessage',attributes,{'tableName':_0xf201('0xc'),'paranoid':![],'indexes':[{'name':_0xf201('0xd'),'fields':['messageId']},{'name':_0xf201('0xe'),'fields':[_0xf201('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e69c4,_0x400a3b,_0x273e4d){var _0x17f158=_0xeb268e['models'];var _0x14ac58=_0x1e69c4[_0xf201('0x10')]({'plain':!![]});if(_0x14ac58['direction'][_0xf201('0x11')]()==='in'||_0x14ac58[_0xf201('0x12')][_0xf201('0x11')]()===_0xf201('0x13')&&!_0x14ac58[_0xf201('0x14')]&&!_[_0xf201('0x15')](_0x14ac58['UserId'])&&!_[_0xf201('0x15')](_0x14ac58[_0xf201('0x16')])){_0x17f158[_0xf201('0x17')]['findOne']({'where':{'id':_0x14ac58[_0xf201('0x16')]}})[_0xf201('0x18')](function(_0x3b8766){if(_0x3b8766){_0x3b8766[_0xf201('0x19')]({'lastMsgAt':_0x14ac58[_0xf201('0x1a')],'lastMsgDirection':_0x14ac58['direction'][_0xf201('0x11')]()});}})[_0xf201('0x1b')](function(_0x45ff0f){console[_0xf201('0x1c')](_0x45ff0f);});}if(_0x14ac58[_0xf201('0x12')]==='out'&&!_0x14ac58[_0xf201('0x14')]){var _0x37859e;_0x17f158['SmsAccount'][_0xf201('0x1d')]({'where':{'id':_0x14ac58['SmsAccountId']},'raw':!![]})[_0xf201('0x18')](function(_0x3633b1){_0x37859e=_0x3633b1;if(_0x37859e&&_0x37859e[_0xf201('0x1e')]){switch(_0x37859e[_0xf201('0x1e')]){case _0xf201('0x1f'):var _0x7b4536=require(_0xf201('0x1f'));if(_0x37859e['accountSid']&&_0x37859e[_0xf201('0x20')]&&_0x37859e[_0xf201('0x21')]){var _0x4f30bf=new _0x7b4536(_0x37859e[_0xf201('0x22')],_0x37859e[_0xf201('0x20')]);_0x4f30bf[_0xf201('0x23')]['create']({'body':_0x14ac58[_0xf201('0xf')],'to':_0x14ac58[_0xf201('0x21')],'from':_0x37859e[_0xf201('0x21')],'statusCallback':_0x37859e[_0xf201('0x24')]+_0xf201('0x25')+_0x14ac58['id']+_0xf201('0x26')+_0x37859e[_0xf201('0x27')]})[_0xf201('0x18')](function(_0x476c59){if(_0x476c59['sid']){return _0x1e69c4[_0xf201('0x19')]({'messageId':_0x476c59[_0xf201('0x28')]});}})[_0xf201('0x1b')](function(_0x35a7f7){logger[_0xf201('0x1c')](_0xf201('0x29'),'afterCreate',_0xf201('0x1f'),util['inspect'](_0x35a7f7,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')](_0xf201('0x29'),'afterCreate',_0xf201('0x1f'),_0xf201('0x2a'));}break;case _0xf201('0x2b'):var _0xddebcd=_0xf201('0x2c');if(_0x37859e[_0xf201('0x2d')]&&_0x37859e['password']){var _0x4255b8={'recipient':[_0x14ac58[_0xf201('0x21')]],'message':_0x14ac58[_0xf201('0xf')],'message_type':_0x37859e[_0xf201('0x2e')]};if(_0x37859e[_0xf201('0x2e')]&&_0x37859e[_0xf201('0x2e')]!=='SI'){_0x4255b8[_0xf201('0x2f')]=_0x37859e[_0xf201('0x21')];}var _0x2aeae0={'url':_0xddebcd+_0xf201('0x30')+_0x37859e[_0xf201('0x2d')]+_0xf201('0x31')+_0x37859e[_0xf201('0x32')],'method':'GET'};rp(_0x2aeae0)[_0xf201('0x18')](function(_0x11b1e3){var _0x448685=_0x11b1e3[_0xf201('0x33')](';');var _0x214396={'user_key':_0x448685[0x0],'session_key':_0x448685[0x1]};_0x2aeae0={'url':_0xddebcd+_0xf201('0x34'),'method':_0xf201('0x35'),'headers':{'user_key':_0x214396[_0xf201('0x36')],'Session_key':_0x214396[_0xf201('0x37')]},'json':!![],'body':_0x4255b8};return rp(_0x2aeae0);})[_0xf201('0x18')](function(_0x8d9a5e){if(_0x8d9a5e[_0xf201('0x38')]>=0x1){var _0x59f2a1={'messageId':_0x8d9a5e[_0xf201('0x39')]};if(_0x37859e[_0xf201('0x2e')]!=='GP'||!_0x37859e['deliveryReport']){_0x59f2a1[_0xf201('0x3a')]=!![];}return _0x1e69c4[_0xf201('0x19')](_0x59f2a1);}else{return logger['error'](_0xf201('0x29'),_0xf201('0x3b'),'skebby',util[_0xf201('0x3c')](_0x8d9a5e,{'showHidden':![],'depth':null}));}})[_0xf201('0x1b')](function(_0x1e9678){return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x2b'),util[_0xf201('0x3c')](_0x1e9678,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')](_0xf201('0x29'),'afterCreate',_0xf201('0x2b'),_0xf201('0x3d'));}break;case _0xf201('0x3e'):if(_0x37859e['authToken']){var _0xc4cf93={'recipient':_0x14ac58[_0xf201('0x21')],'message':_0x14ac58[_0xf201('0xf')],'sender':_0x37859e[_0xf201('0x3f')]||_0x37859e[_0xf201('0x21')],'authorization':_0x37859e[_0xf201('0x20')]};var _0x400a3b={'method':_0xf201('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xc4cf93,'json':!![]};rp(_0x400a3b)[_0xf201('0x18')](function(_0x5344b7){var _0x329c3e={'messageId':_0x5344b7[_0xf201('0x40')]};if(!_0x37859e[_0xf201('0x41')]){_0x329c3e[_0xf201('0x3a')]=!![];}return _0x1e69c4[_0xf201('0x19')](_0x329c3e);})[_0xf201('0x1b')](function(_0x4ca3dc){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf201('0x3e'),util[_0xf201('0x3c')](_0x4ca3dc,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf201('0x3b'),_0xf201('0x3e'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x37859e[_0xf201('0x2d')]&&_0x37859e[_0xf201('0x32')]){var _0xc4cf93={'messages':[{'source':_0xf201('0x42'),'to':_0x14ac58[_0xf201('0x21')],'body':_0x14ac58[_0xf201('0xf')],'from':_0x37859e[_0xf201('0x3f')]||_0x37859e[_0xf201('0x21')]}]};var _0x4b7485=util[_0xf201('0x43')](_0xf201('0x44'),_0x37859e[_0xf201('0x2d')],_0x37859e[_0xf201('0x32')]);var _0x400a3b={'method':_0xf201('0x35'),'uri':_0xf201('0x45'),'body':_0xc4cf93,'headers':{'Authorization':util[_0xf201('0x43')](_0xf201('0x46'),new Buffer(_0x4b7485)[_0xf201('0x47')]('base64'))},'json':!![]};rp(_0x400a3b)[_0xf201('0x18')](function(_0x17fc7b){if(_0x17fc7b['http_code']>=0xc8&&_0x17fc7b[_0xf201('0x48')]<=0xce){if(_0x17fc7b[_0xf201('0x49')]&&_0x17fc7b[_0xf201('0x49')][_0xf201('0x4a')]>0x0){var _0xc53aeb=_[_0xf201('0x4b')](_0x17fc7b['data'][_0xf201('0x23')]);var _0x4ff249={'messageId':_0xc53aeb[_0xf201('0x4c')]};if(!_0x37859e[_0xf201('0x41')]){_0x4ff249[_0xf201('0x3a')]=!![];}return _0x1e69c4[_0xf201('0x19')](_0x4ff249);}else{logger[_0xf201('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf201('0x3b'),'clickSend',util['inspect'](_0x17fc7b,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xf201('0x29'),_0xf201('0x3b'),'clickSend',util[_0xf201('0x3c')](_0x17fc7b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x311209){logger[_0xf201('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf201('0x3b'),_0xf201('0x4d'),util[_0xf201('0x3c')](_0x311209,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x4d'),_0xf201('0x3d'));}break;case _0xf201('0x4e'):if(_0x37859e[_0xf201('0x4f')]&&_0x37859e[_0xf201('0x20')]){var _0xc4cf93={'dst':_0x14ac58[_0xf201('0x21')],'text':_0x14ac58['body'],'src':_0x37859e[_0xf201('0x3f')]||_0x37859e[_0xf201('0x21')],'url':_0x37859e['remote']+_0xf201('0x25')+_0x14ac58['id']+_0xf201('0x26')+_0x37859e[_0xf201('0x27')]};var _0x4b7485=util[_0xf201('0x43')](_0xf201('0x44'),_0x37859e[_0xf201('0x4f')],_0x37859e[_0xf201('0x20')]);var _0x400a3b={'method':_0xf201('0x35'),'uri':util[_0xf201('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x37859e['authId']),'body':_0xc4cf93,'headers':{'Authorization':util[_0xf201('0x43')]('Basic\x20%s',new Buffer(_0x4b7485)['toString'](_0xf201('0x50')))},'json':!![]};rp(_0x400a3b)[_0xf201('0x18')](function(_0x5cd633){var _0x143ebd={'messageId':_0x5cd633[_0xf201('0x51')][0x0]};return _0x1e69c4[_0xf201('0x19')](_0x143ebd);})['catch'](function(_0x74a69f){logger['error'](_0xf201('0x29'),'afterCreate',_0xf201('0x4e'),util['inspect'](_0x74a69f,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x37859e['username']&&_0x37859e['password']){if(_0x37859e[_0xf201('0x52')]){var _0x338f56={'method':_0xf201('0x35'),'uri':_0x37859e[_0xf201('0x52')]+_0xf201('0x53'),'body':{'username':_0x37859e['username'],'password':_0x37859e['password']},'json':!![]};return rp(_0x338f56)[_0xf201('0x18')](function(_0x51375e){var _0x963838={'method':_0xf201('0x35'),'uri':_0x37859e['baseUrl']+_0xf201('0x54'),'body':{'messages':[{'from':_0x37859e[_0xf201('0x21')],'destinations':[{'to':_0x14ac58[_0xf201('0x21')]}],'text':_0x14ac58[_0xf201('0xf')],'notifyUrl':_0x37859e[_0xf201('0x24')]+'/api/sms/messages/'+_0x14ac58['id']+_0xf201('0x26')+_0x37859e[_0xf201('0x27')],'notifyContentType':_0xf201('0x55'),'callbackData':_0x37859e[_0xf201('0x21')]+';'+_0x14ac58[_0xf201('0xf')]}]},'headers':{'Authorization':_0xf201('0x56')+_0x51375e[_0xf201('0x27')]},'json':!![]};return rp(_0x963838)[_0xf201('0x18')](function(_0x43e7a3){if(_0x43e7a3[_0xf201('0x23')]){var _0x9693ad={'messageId':_0x43e7a3['messages'][0x0][_0xf201('0xd')]};if(!_0x37859e[_0xf201('0x41')]){_0x9693ad[_0xf201('0x3a')]=!![];}return _0x1e69c4['update'](_0x9693ad);}else{return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x57'),util[_0xf201('0x3c')](_0x43e7a3,{'showHidden':![],'depth':null}));}});})[_0xf201('0x1b')](function(_0x36d24f){return logger['error'](_0xf201('0x29'),'afterCreate',_0xf201('0x57'),util[_0xf201('0x3c')](_0x36d24f,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x57'),_0xf201('0x58'));}}else{logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x57'),_0xf201('0x3d'));}break;case _0xf201('0x59'):var _0x2f431b=require(_0xf201('0x5a'));if(_0x37859e[_0xf201('0x5b')]){var _0x2c813b={};_0x2c813b[_0xf201('0x5c')]=_0x37859e[_0xf201('0x2d')];_0x2c813b[_0xf201('0x21')]=_0x14ac58[_0xf201('0x21')];_0x2c813b[_0xf201('0x2f')]=_0x37859e[_0xf201('0x21')];_0x2c813b[_0xf201('0x5d')]=_0x14ac58[_0xf201('0xf')];_0x2c813b[_0xf201('0x5e')]=+new Date();var _0x338356='';var _0x2e7aa2='';var _0x115501=Object['keys'](_0x2c813b);_0x115501[_0xf201('0x5f')]();for(var _0x57d670=0x0;_0x57d670<_0x115501[_0xf201('0x60')];_0x57d670++){if(_0x338356!=''){_0x338356+='&';}_0x338356+=_0x115501[_0x57d670]+'='+encodeURIComponent(_0x2c813b[_0x115501[_0x57d670]]);_0x2e7aa2+=_0x2c813b[_0x115501[_0x57d670]];}_0x2e7aa2+=_0x37859e[_0xf201('0x5b')];_0x2e7aa2=_0x2f431b[_0xf201('0x61')]('md5')[_0xf201('0x19')](_0x2e7aa2)[_0xf201('0x62')](_0xf201('0x63'));if(_0x338356!==''){_0x338356+='&';}_0x338356+=_0xf201('0x64')+_0x2e7aa2;var _0x2aeae0={'method':'GET','uri':_0x37859e[_0xf201('0x52')]+_0xf201('0x65')+_0x338356,'json':!![]};return rp(_0x2aeae0)[_0xf201('0x18')](function(_0x1f54f7){var _0x56f35d=Object['keys'](_0x1f54f7);if(_0x1f54f7[_0x56f35d[0x0]][_0xf201('0x1c')]&&parseInt(_0x1f54f7[_0x56f35d[0x0]][_0xf201('0x1c')])===0x0){var _0x38d7f2={'messageId':_0x1f54f7[_0x56f35d[0x0]][_0xf201('0x66')]};if(!_0x37859e[_0xf201('0x41')]){_0x38d7f2[_0xf201('0x3a')]=!![];}return _0x1e69c4['update'](_0x38d7f2);}else{return logger[_0xf201('0x1c')](_0xf201('0x29'),'afterCreate',_0xf201('0x59'),util[_0xf201('0x3c')](_0x1f54f7[_0xf201('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x345afb){return logger['error'](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x59'),util['inspect'](_0x345afb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x59'),_0xf201('0x67'));}break;case _0xf201('0x68'):if(_0x37859e['apiKey']){var _0x318591={'method':_0xf201('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x37859e[_0xf201('0x5b')]},'body':{'content':_0x14ac58[_0xf201('0xf')],'to':[_0x14ac58[_0xf201('0x21')]],'from':_0x37859e['phone'],'binary':![],'clientMessageId':_0xf201('0x69'),'charset':_0xf201('0x6a')},'json':!![]};rp(_0x318591)[_0xf201('0x18')](function(_0x31c548){if(!_0x31c548[_0xf201('0x1c')]){var _0x3f738f={'messageId':_0x31c548[_0xf201('0x23')][0x0][_0xf201('0x6b')]};if(!_0x37859e[_0xf201('0x41')]){_0x3f738f[_0xf201('0x3a')]=!![];}return _0x1e69c4['update'](_0x3f738f);}else{return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x68'),util['inspect'](_0x31c548[_0xf201('0x1c')],{'showHidden':![],'depth':null}));}})[_0xf201('0x1b')](function(_0x3a536b){return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x68'),util[_0xf201('0x3c')](_0x3a536b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x68'),_0xf201('0x67'));}break;case _0xf201('0x6c'):if(_0x37859e[_0xf201('0x2d')]&&_0x37859e[_0xf201('0x32')]){var _0x4b7485=util[_0xf201('0x43')](_0xf201('0x44'),_0x37859e[_0xf201('0x2d')],_0x37859e[_0xf201('0x32')]);var _0x400a3b={'method':_0xf201('0x35'),'uri':_0xf201('0x6d')+_0x37859e[_0xf201('0x6e')]+_0xf201('0x6f'),'body':{'to':[_0x14ac58['phone']],'text':_0x14ac58[_0xf201('0xf')],'from':_0x37859e[_0xf201('0x21')],'applicationId':_0x37859e[_0xf201('0x70')]},'headers':{'Authorization':util[_0xf201('0x43')](_0xf201('0x46'),new Buffer(_0x4b7485)[_0xf201('0x47')](_0xf201('0x50')))},'json':!![]};rp(_0x400a3b)[_0xf201('0x18')](function(_0x19f76b){if(_0x19f76b['id']){var _0x56b9c5={'messageId':_0x19f76b['id']};return _0x1e69c4[_0xf201('0x19')](_0x56b9c5);}else{logger['error'](_0xf201('0x29'),'afterCreate','bandwidth',util[_0xf201('0x3c')](_0x19f76b,{'showHidden':![],'depth':null}));}})[_0xf201('0x1b')](function(_0x2f2b95){logger[_0xf201('0x1c')](_0xf201('0x29'),'afterCreate',_0xf201('0x6c'),util[_0xf201('0x3c')](_0x2f2b95,{'showHidden':![],'depth':null}));});}else{logger[_0xf201('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf201('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf201('0x71'):if(_0x37859e[_0xf201('0x5b')]){var _0x451f18={};var _0x2aeae0={'method':_0xf201('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xf201('0x72')+_0x37859e[_0xf201('0x5b')],'Content-Type':_0xf201('0x55')},'body':{'from':_0x37859e[_0xf201('0x21')],'to':_0x14ac58[_0xf201('0x21')],'text':_0x14ac58[_0xf201('0xf')]},'json':!![]};return rp(_0x2aeae0)[_0xf201('0x18')](function(_0x845df6){if(_0x845df6[_0xf201('0x73')]==0xca){_0x451f18[_0xf201('0x74')]=_0x845df6;var _0x45c285={'method':_0xf201('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xf201('0x72')+_0x37859e[_0xf201('0x5b')],'Content-Type':_0xf201('0x55')},'body':{'refid':_0x451f18['message']['refid']},'json':!![]};return rp(_0x45c285)[_0xf201('0x18')](function(_0x1f4cdf){_0x451f18[_0xf201('0x75')]=_0x1f4cdf;var _0x512e0f={'messageId':_0x451f18[_0xf201('0x74')][_0xf201('0x76')],'read':!![]};return _0x1e69c4[_0xf201('0x19')](_0x512e0f);});}else{return logger[_0xf201('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf201('0x3b'),'intelepeer',util[_0xf201('0x3c')](_0x845df6,{'showHidden':![],'depth':null}));}})[_0xf201('0x1b')](function(_0x26a293){return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x71'),util['inspect'](_0x26a293,{'showHidden':![],'depth':null}));});}else{return logger[_0xf201('0x1c')](_0xf201('0x29'),_0xf201('0x3b'),_0xf201('0x71'),_0xf201('0x77'));}break;}}})[_0xf201('0x78')](function(){_0x273e4d();});}else{_0x273e4d();}}},'charset':_0xf201('0x79'),'collate':_0xf201('0x7a')});}; \ No newline at end of file +var _0x615b=['queued_count','head','message_id','clickSend','plivo','authId','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data'];(function(_0x2b9ccf,_0x1a7010){var _0x3da75f=function(_0xae5ad5){while(--_0xae5ad5){_0x2b9ccf['push'](_0x2b9ccf['shift']());}};_0x3da75f(++_0x1a7010);}(_0x615b,0x124));var _0xb615=function(_0x724b9a,_0x5a5fca){_0x724b9a=_0x724b9a-0x0;var _0x4c1413=_0x615b[_0x724b9a];return _0x4c1413;};'use strict';var _=require(_0xb615('0x0'));var util=require(_0xb615('0x1'));var logger=require(_0xb615('0x2'))('api');var moment=require(_0xb615('0x3'));var BPromise=require(_0xb615('0x4'));var rp=require(_0xb615('0x5'));var fs=require('fs');var path=require(_0xb615('0x6'));var rimraf=require(_0xb615('0x7'));var config=require(_0xb615('0x8'));var attributes=require(_0xb615('0x9'));module[_0xb615('0xa')]=function(_0x113061,_0x289ba8){return _0x113061[_0xb615('0xb')](_0xb615('0xc'),attributes,{'tableName':_0xb615('0xd'),'paranoid':![],'indexes':[{'name':_0xb615('0xe'),'fields':[_0xb615('0xe')]},{'name':_0xb615('0xf'),'fields':[_0xb615('0x10')],'type':_0xb615('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eef59,_0xafa66d,_0x18820e){var _0x82cb38=_0x113061['models'];var _0x42c182=_0x3eef59['get']({'plain':!![]});if(_0x42c182[_0xb615('0x12')][_0xb615('0x13')]()==='in'||_0x42c182[_0xb615('0x12')][_0xb615('0x13')]()===_0xb615('0x14')&&!_0x42c182[_0xb615('0x15')]&&!_[_0xb615('0x16')](_0x42c182[_0xb615('0x17')])&&!_[_0xb615('0x16')](_0x42c182['SmsInteractionId'])){_0x82cb38[_0xb615('0x18')]['findOne']({'where':{'id':_0x42c182[_0xb615('0x19')]}})[_0xb615('0x1a')](function(_0x203f54){if(_0x203f54){_0x203f54[_0xb615('0x1b')]({'lastMsgAt':_0x42c182[_0xb615('0x1c')],'lastMsgDirection':_0x42c182['direction'][_0xb615('0x13')]()});}})[_0xb615('0x1d')](function(_0x498a2b){console['error'](_0x498a2b);});}if(_0x42c182[_0xb615('0x12')]===_0xb615('0x14')&&!_0x42c182[_0xb615('0x15')]){var _0x185a67;_0x82cb38[_0xb615('0x1e')][_0xb615('0x1f')]({'where':{'id':_0x42c182['SmsAccountId']},'raw':!![]})[_0xb615('0x1a')](function(_0x46adaa){_0x185a67=_0x46adaa;if(_0x185a67&&_0x185a67[_0xb615('0x20')]){switch(_0x185a67['type']){case _0xb615('0x21'):var _0x519717=require(_0xb615('0x21'));if(_0x185a67[_0xb615('0x22')]&&_0x185a67['authToken']&&_0x185a67[_0xb615('0x23')]){var _0x28dbc5=new _0x519717(_0x185a67[_0xb615('0x22')],_0x185a67[_0xb615('0x24')]);_0x28dbc5[_0xb615('0x25')][_0xb615('0x26')]({'body':_0x42c182[_0xb615('0x10')],'to':_0x42c182[_0xb615('0x23')],'from':_0x185a67['phone'],'statusCallback':_0x185a67[_0xb615('0x27')]+_0xb615('0x28')+_0x42c182['id']+_0xb615('0x29')+_0x185a67[_0xb615('0x2a')]})[_0xb615('0x1a')](function(_0x53a473){if(_0x53a473['sid']){return _0x3eef59[_0xb615('0x1b')]({'messageId':_0x53a473['sid']});}})[_0xb615('0x1d')](function(_0x40f01c){logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),'twilio',util[_0xb615('0x2e')](_0x40f01c,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate','twilio',_0xb615('0x2f'));}break;case _0xb615('0x30'):var _0x49172b=_0xb615('0x31');if(_0x185a67['username']&&_0x185a67[_0xb615('0x32')]){var _0x3dac57={'recipient':[_0x42c182['phone']],'message':_0x42c182[_0xb615('0x10')],'message_type':_0x185a67[_0xb615('0x33')]};if(_0x185a67[_0xb615('0x33')]&&_0x185a67['smsMethod']!=='SI'){_0x3dac57[_0xb615('0x34')]=_0x185a67[_0xb615('0x23')];}var _0x93c6a4={'url':_0x49172b+_0xb615('0x35')+_0x185a67[_0xb615('0x36')]+_0xb615('0x37')+_0x185a67['password'],'method':'GET'};rp(_0x93c6a4)[_0xb615('0x1a')](function(_0x25f531){var _0x3bf853=_0x25f531['split'](';');var _0x3ea79f={'user_key':_0x3bf853[0x0],'session_key':_0x3bf853[0x1]};_0x93c6a4={'url':_0x49172b+_0xb615('0x38'),'method':_0xb615('0x39'),'headers':{'user_key':_0x3ea79f[_0xb615('0x3a')],'Session_key':_0x3ea79f['session_key']},'json':!![],'body':_0x3dac57};return rp(_0x93c6a4);})[_0xb615('0x1a')](function(_0x161b35){if(_0x161b35[_0xb615('0x3b')]>=0x1){var _0x2a259f={'messageId':_0x161b35[_0xb615('0x3c')]};if(_0x185a67[_0xb615('0x33')]!=='GP'||!_0x185a67[_0xb615('0x3d')]){_0x2a259f[_0xb615('0x3e')]=!![];}return _0x3eef59[_0xb615('0x1b')](_0x2a259f);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),_0xb615('0x30'),util[_0xb615('0x2e')](_0x161b35,{'showHidden':![],'depth':null}));}})['catch'](function(_0x22caa8){return logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),'skebby',util[_0xb615('0x2e')](_0x22caa8,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate','skebby',_0xb615('0x3f'));}break;case _0xb615('0x40'):if(_0x185a67[_0xb615('0x24')]){var _0x19a250={'recipient':_0x42c182[_0xb615('0x23')],'message':_0x42c182[_0xb615('0x10')],'sender':_0x185a67[_0xb615('0x41')]||_0x185a67[_0xb615('0x23')],'authorization':_0x185a67[_0xb615('0x24')]};var _0xafa66d={'method':_0xb615('0x39'),'uri':_0xb615('0x42'),'body':_0x19a250,'json':!![]};rp(_0xafa66d)['then'](function(_0x2a6787){var _0x18e677={'messageId':_0x2a6787[_0xb615('0x43')]};if(!_0x185a67['deliveryReport']){_0x18e677['read']=!![];}return _0x3eef59[_0xb615('0x1b')](_0x18e677);})['catch'](function(_0x440d3f){logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x40'),util[_0xb615('0x2e')](_0x440d3f,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate',_0xb615('0x40'),_0xb615('0x44'));}break;case'clicksend':if(_0x185a67['username']&&_0x185a67['password']){var _0x19a250={'messages':[{'source':_0xb615('0x45'),'to':_0x42c182['phone'],'body':_0x42c182[_0xb615('0x10')],'from':_0x185a67['senderString']||_0x185a67['phone']}]};var _0x143be7=util[_0xb615('0x46')]('%s:%s',_0x185a67[_0xb615('0x36')],_0x185a67[_0xb615('0x32')]);var _0xafa66d={'method':_0xb615('0x39'),'uri':_0xb615('0x47'),'body':_0x19a250,'headers':{'Authorization':util[_0xb615('0x46')](_0xb615('0x48'),new Buffer(_0x143be7)[_0xb615('0x49')](_0xb615('0x4a')))},'json':!![]};rp(_0xafa66d)[_0xb615('0x1a')](function(_0x1dd054){if(_0x1dd054[_0xb615('0x4b')]>=0xc8&&_0x1dd054[_0xb615('0x4b')]<=0xce){if(_0x1dd054[_0xb615('0x4c')]&&_0x1dd054[_0xb615('0x4c')][_0xb615('0x4d')]>0x0){var _0x4aff8b=_[_0xb615('0x4e')](_0x1dd054['data']['messages']);var _0x3d04a8={'messageId':_0x4aff8b[_0xb615('0x4f')]};if(!_0x185a67[_0xb615('0x3d')]){_0x3d04a8['read']=!![];}return _0x3eef59['update'](_0x3d04a8);}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x50'),util[_0xb615('0x2e')](_0x1dd054,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb615('0x2c'),_0xb615('0x2d'),'clickSend',util[_0xb615('0x2e')](_0x1dd054,{'showHidden':![],'depth':null}));}})[_0xb615('0x1d')](function(_0x571608){logger['error'](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x50'),util['inspect'](_0x571608,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),_0xb615('0x50'),_0xb615('0x3f'));}break;case _0xb615('0x51'):if(_0x185a67['authId']&&_0x185a67[_0xb615('0x24')]){var _0x19a250={'dst':_0x42c182[_0xb615('0x23')],'text':_0x42c182[_0xb615('0x10')],'src':_0x185a67['senderString']||_0x185a67[_0xb615('0x23')],'url':_0x185a67['remote']+_0xb615('0x28')+_0x42c182['id']+_0xb615('0x29')+_0x185a67['token']};var _0x143be7=util[_0xb615('0x46')]('%s:%s',_0x185a67[_0xb615('0x52')],_0x185a67[_0xb615('0x24')]);var _0xafa66d={'method':_0xb615('0x39'),'uri':util[_0xb615('0x46')]('https://api.plivo.com/v1/Account/%s/Message/',_0x185a67[_0xb615('0x52')]),'body':_0x19a250,'headers':{'Authorization':util[_0xb615('0x46')]('Basic\x20%s',new Buffer(_0x143be7)[_0xb615('0x49')](_0xb615('0x4a')))},'json':!![]};rp(_0xafa66d)[_0xb615('0x1a')](function(_0x92acab){var _0x305237={'messageId':_0x92acab['message_uuid'][0x0]};return _0x3eef59[_0xb615('0x1b')](_0x305237);})[_0xb615('0x1d')](function(_0xfc87dd){logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate',_0xb615('0x51'),util[_0xb615('0x2e')](_0xfc87dd,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x51'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb615('0x53'):if(_0x185a67['username']&&_0x185a67[_0xb615('0x32')]){if(_0x185a67[_0xb615('0x54')]){var _0x52039f={'method':_0xb615('0x39'),'uri':_0x185a67[_0xb615('0x54')]+_0xb615('0x55'),'body':{'username':_0x185a67[_0xb615('0x36')],'password':_0x185a67['password']},'json':!![]};return rp(_0x52039f)[_0xb615('0x1a')](function(_0x24ceb9){var _0x91aac0={'method':_0xb615('0x39'),'uri':_0x185a67[_0xb615('0x54')]+_0xb615('0x56'),'body':{'messages':[{'from':_0x185a67[_0xb615('0x23')],'destinations':[{'to':_0x42c182[_0xb615('0x23')]}],'text':_0x42c182[_0xb615('0x10')],'notifyUrl':_0x185a67[_0xb615('0x27')]+_0xb615('0x28')+_0x42c182['id']+_0xb615('0x29')+_0x185a67[_0xb615('0x2a')],'notifyContentType':_0xb615('0x57'),'callbackData':_0x185a67['phone']+';'+_0x42c182['body']}]},'headers':{'Authorization':_0xb615('0x58')+_0x24ceb9['token']},'json':!![]};return rp(_0x91aac0)[_0xb615('0x1a')](function(_0x40941f){if(_0x40941f[_0xb615('0x25')]){var _0xed6820={'messageId':_0x40941f[_0xb615('0x25')][0x0][_0xb615('0xe')]};if(!_0x185a67[_0xb615('0x3d')]){_0xed6820[_0xb615('0x3e')]=!![];}return _0x3eef59[_0xb615('0x1b')](_0xed6820);}else{return logger[_0xb615('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb615('0x53'),util[_0xb615('0x2e')](_0x40941f,{'showHidden':![],'depth':null}));}});})[_0xb615('0x1d')](function(_0x1093a0){return logger['error'](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x53'),util[_0xb615('0x2e')](_0x1093a0,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x53'),_0xb615('0x3f'));}break;case _0xb615('0x59'):var _0x489e50=require(_0xb615('0x5a'));if(_0x185a67[_0xb615('0x5b')]){var _0x4e18bc={};_0x4e18bc[_0xb615('0x5c')]=_0x185a67[_0xb615('0x36')];_0x4e18bc[_0xb615('0x23')]=_0x42c182[_0xb615('0x23')];_0x4e18bc[_0xb615('0x34')]=_0x185a67[_0xb615('0x23')];_0x4e18bc[_0xb615('0x5d')]=_0x42c182[_0xb615('0x10')];_0x4e18bc['timestamp']=+new Date();var _0x4b44cc='';var _0x5b2abc='';var _0x25999c=Object['keys'](_0x4e18bc);_0x25999c['sort']();for(var _0xcd549=0x0;_0xcd549<_0x25999c[_0xb615('0x5e')];_0xcd549++){if(_0x4b44cc!=''){_0x4b44cc+='&';}_0x4b44cc+=_0x25999c[_0xcd549]+'='+encodeURIComponent(_0x4e18bc[_0x25999c[_0xcd549]]);_0x5b2abc+=_0x4e18bc[_0x25999c[_0xcd549]];}_0x5b2abc+=_0x185a67[_0xb615('0x5b')];_0x5b2abc=_0x489e50[_0xb615('0x5f')](_0xb615('0x60'))[_0xb615('0x1b')](_0x5b2abc)[_0xb615('0x61')](_0xb615('0x62'));if(_0x4b44cc!==''){_0x4b44cc+='&';}_0x4b44cc+=_0xb615('0x63')+_0x5b2abc;var _0x93c6a4={'method':_0xb615('0x64'),'uri':_0x185a67['baseUrl']+_0xb615('0x65')+_0x4b44cc,'json':!![]};return rp(_0x93c6a4)[_0xb615('0x1a')](function(_0x47257f){var _0xe658f3=Object['keys'](_0x47257f);if(_0x47257f[_0xe658f3[0x0]][_0xb615('0x2b')]&&parseInt(_0x47257f[_0xe658f3[0x0]][_0xb615('0x2b')])===0x0){var _0x3bdfa7={'messageId':_0x47257f[_0xe658f3[0x0]][_0xb615('0x66')]};if(!_0x185a67[_0xb615('0x3d')]){_0x3bdfa7[_0xb615('0x3e')]=!![];}return _0x3eef59[_0xb615('0x1b')](_0x3bdfa7);}else{return logger[_0xb615('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),_0xb615('0x59'),util[_0xb615('0x2e')](_0x47257f['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b48b6){return logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x59'),util[_0xb615('0x2e')](_0x1b48b6,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),'afterCreate','csc',_0xb615('0x67'));}break;case _0xb615('0x68'):if(_0x185a67[_0xb615('0x5b')]){var _0x5716c2={'method':_0xb615('0x39'),'uri':_0xb615('0x69'),'headers':{'Authorization':_0x185a67[_0xb615('0x5b')]},'body':{'content':_0x42c182[_0xb615('0x10')],'to':[_0x42c182[_0xb615('0x23')]],'from':_0x185a67[_0xb615('0x23')],'binary':![],'clientMessageId':_0xb615('0x6a'),'charset':_0xb615('0x6b')},'json':!![]};rp(_0x5716c2)[_0xb615('0x1a')](function(_0x2b423e){if(!_0x2b423e[_0xb615('0x2b')]){var _0x2169ac={'messageId':_0x2b423e['messages'][0x0][_0xb615('0x6c')]};if(!_0x185a67[_0xb615('0x3d')]){_0x2169ac[_0xb615('0x3e')]=!![];}return _0x3eef59['update'](_0x2169ac);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),'clickatell',util[_0xb615('0x2e')](_0x2b423e[_0xb615('0x2b')],{'showHidden':![],'depth':null}));}})[_0xb615('0x1d')](function(_0x5e69fb){return logger['error'](_0xb615('0x2c'),'afterCreate',_0xb615('0x68'),util[_0xb615('0x2e')](_0x5e69fb,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),_0xb615('0x68'),_0xb615('0x67'));}break;case _0xb615('0x6d'):if(_0x185a67[_0xb615('0x36')]&&_0x185a67[_0xb615('0x32')]){var _0x143be7=util[_0xb615('0x46')](_0xb615('0x6e'),_0x185a67['username'],_0x185a67[_0xb615('0x32')]);var _0xafa66d={'method':_0xb615('0x39'),'uri':_0xb615('0x6f')+_0x185a67[_0xb615('0x70')]+_0xb615('0x71'),'body':{'to':[_0x42c182[_0xb615('0x23')]],'text':_0x42c182[_0xb615('0x10')],'from':_0x185a67[_0xb615('0x23')],'applicationId':_0x185a67[_0xb615('0x72')]},'headers':{'Authorization':util[_0xb615('0x46')]('Basic\x20%s',new Buffer(_0x143be7)[_0xb615('0x49')](_0xb615('0x4a')))},'json':!![]};rp(_0xafa66d)['then'](function(_0x1cc58c){if(_0x1cc58c['id']){var _0x52f70d={'messageId':_0x1cc58c['id']};return _0x3eef59[_0xb615('0x1b')](_0x52f70d);}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),'bandwidth',util[_0xb615('0x2e')](_0x1cc58c,{'showHidden':![],'depth':null}));}})[_0xb615('0x1d')](function(_0x4cec1f){logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x6d'),util[_0xb615('0x2e')](_0x4cec1f,{'showHidden':![],'depth':null}));});}else{logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x185a67[_0xb615('0x5b')]){var _0x57a909={};var _0x93c6a4={'method':_0xb615('0x39'),'uri':_0xb615('0x73'),'headers':{'Authorization':_0xb615('0x74')+_0x185a67[_0xb615('0x5b')],'Content-Type':_0xb615('0x57')},'body':{'from':_0x185a67[_0xb615('0x23')],'to':_0x42c182[_0xb615('0x23')],'text':_0x42c182['body']},'json':!![]};return rp(_0x93c6a4)[_0xb615('0x1a')](function(_0x2b092c){if(_0x2b092c[_0xb615('0x75')]==0xca){_0x57a909[_0xb615('0x76')]=_0x2b092c;var _0x57bb89={'method':_0xb615('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xb615('0x74')+_0x185a67[_0xb615('0x5b')],'Content-Type':'application/json'},'body':{'refid':_0x57a909[_0xb615('0x76')][_0xb615('0x77')]},'json':!![]};return rp(_0x57bb89)[_0xb615('0x1a')](function(_0x583225){_0x57a909[_0xb615('0x78')]=_0x583225;var _0x4f9e97={'messageId':_0x57a909[_0xb615('0x76')][_0xb615('0x77')],'read':!![]};return _0x3eef59[_0xb615('0x1b')](_0x4f9e97);});}else{return logger['error'](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x79'),util[_0xb615('0x2e')](_0x2b092c,{'showHidden':![],'depth':null}));}})[_0xb615('0x1d')](function(_0x346f8c){return logger[_0xb615('0x2b')](_0xb615('0x2c'),_0xb615('0x2d'),_0xb615('0x79'),util['inspect'](_0x346f8c,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb615('0x2d'),_0xb615('0x79'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x18820e();});}else{_0x18820e();}}},'charset':_0xb615('0x7a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6d70d2c..ba489b0 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 _0xf7b6=['then','info','request\x20sent','debug','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./smsMessage.socket','request'];(function(_0x1155d2,_0x5e8b69){var _0x313ffb=function(_0x1a52f5){while(--_0x1a52f5){_0x1155d2['push'](_0x1155d2['shift']());}};_0x313ffb(++_0x5e8b69);}(_0xf7b6,0x1b4));var _0x6f7b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf7b6[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x6f7b('0x0'));var moment=require(_0x6f7b('0x1'));var BPromise=require(_0x6f7b('0x2'));var rs=require(_0x6f7b('0x3'));var fs=require('fs');var Redis=require(_0x6f7b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f7b('0x5'))('rpc');var config=require(_0x6f7b('0x6'));var jayson=require(_0x6f7b('0x7'));var client=jayson[_0x6f7b('0x8')][_0x6f7b('0x9')]({'port':0x232a});config[_0x6f7b('0xa')]=_['defaults'](config[_0x6f7b('0xa')],{'host':_0x6f7b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f7b('0xa')]));require(_0x6f7b('0xc'))['register'](socket);function respondWithRpcPromise(_0x26c757,_0x513945,_0x4fbdd7){return new BPromise(function(_0x372645,_0x362bfd){return client[_0x6f7b('0xd')](_0x26c757,_0x4fbdd7)[_0x6f7b('0xe')](function(_0x570283){logger[_0x6f7b('0xf')]('SmsMessage,\x20%s,\x20%s',_0x513945,_0x6f7b('0x10'));logger[_0x6f7b('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x513945,'request\x20sent',JSON['stringify'](_0x570283));if(_0x570283[_0x6f7b('0x12')]){if(_0x570283[_0x6f7b('0x12')]['code']===0x1f4){logger[_0x6f7b('0x12')](_0x6f7b('0x13'),_0x513945,_0x570283[_0x6f7b('0x12')][_0x6f7b('0x14')]);return _0x362bfd(_0x570283[_0x6f7b('0x12')]['message']);}logger['error'](_0x6f7b('0x13'),_0x513945,_0x570283['error'][_0x6f7b('0x14')]);return _0x372645(_0x570283[_0x6f7b('0x12')][_0x6f7b('0x14')]);}else{logger[_0x6f7b('0xf')]('SmsMessage,\x20%s,\x20%s',_0x513945,_0x6f7b('0x10'));_0x372645(_0x570283[_0x6f7b('0x15')]['message']);}})[_0x6f7b('0x16')](function(_0x51370f){logger['error'](_0x6f7b('0x13'),_0x513945,_0x51370f);_0x362bfd(_0x51370f);});});}exports[_0x6f7b('0x17')]=function(_0x20ec10){var _0x554b21=this;return new Promise(function(_0x46d8e3,_0x1f78a0){return db[_0x6f7b('0x18')][_0x6f7b('0x19')](_0x20ec10[_0x6f7b('0x1a')],{'raw':_0x20ec10[_0x6f7b('0x1b')]?_0x20ec10[_0x6f7b('0x1b')][_0x6f7b('0x1c')]===undefined?!![]:![]:!![]})[_0x6f7b('0xe')](function(_0x40f0e0){logger[_0x6f7b('0xf')](_0x6f7b('0x17'),_0x20ec10);logger['debug'](_0x6f7b('0x17'),_0x20ec10,JSON[_0x6f7b('0x1d')](_0x40f0e0));_0x46d8e3(_0x40f0e0);})[_0x6f7b('0x16')](function(_0x6229e5){logger['error']('CreateSmsMessage',_0x6229e5[_0x6f7b('0x14')],_0x20ec10);_0x1f78a0(_0x554b21[_0x6f7b('0x12')](0x1f4,_0x6229e5[_0x6f7b('0x14')]));});});}; \ No newline at end of file +var _0xd6ca=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','options','raw','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2ddad6,_0x220728){var _0x3a196e=function(_0x42386c){while(--_0x42386c){_0x2ddad6['push'](_0x2ddad6['shift']());}};_0x3a196e(++_0x220728);}(_0xd6ca,0xed));var _0xad6c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6ca[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xad6c('0x0'));var moment=require(_0xad6c('0x1'));var BPromise=require(_0xad6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad6c('0x3'));var db=require(_0xad6c('0x4'))['db'];var utils=require(_0xad6c('0x5'));var logger=require(_0xad6c('0x6'))('rpc');var config=require(_0xad6c('0x7'));var jayson=require(_0xad6c('0x8'));var client=jayson['client'][_0xad6c('0x9')]({'port':0x232a});config[_0xad6c('0xa')]=_[_0xad6c('0xb')](config[_0xad6c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xad6c('0xc'))(new Redis(config[_0xad6c('0xa')]));require(_0xad6c('0xd'))[_0xad6c('0xe')](socket);function respondWithRpcPromise(_0x24e004,_0xc0731c,_0x383ba2){return new BPromise(function(_0x2f4d58,_0x387031){return client[_0xad6c('0xf')](_0x24e004,_0x383ba2)['then'](function(_0x2e604f){logger[_0xad6c('0x10')](_0xad6c('0x11'),_0xc0731c,_0xad6c('0x12'));logger[_0xad6c('0x13')](_0xad6c('0x14'),_0xc0731c,'request\x20sent',JSON[_0xad6c('0x15')](_0x2e604f));if(_0x2e604f[_0xad6c('0x16')]){if(_0x2e604f[_0xad6c('0x16')][_0xad6c('0x17')]===0x1f4){logger[_0xad6c('0x16')](_0xad6c('0x11'),_0xc0731c,_0x2e604f[_0xad6c('0x16')][_0xad6c('0x18')]);return _0x387031(_0x2e604f[_0xad6c('0x16')][_0xad6c('0x18')]);}logger[_0xad6c('0x16')](_0xad6c('0x11'),_0xc0731c,_0x2e604f['error']['message']);return _0x2f4d58(_0x2e604f['error'][_0xad6c('0x18')]);}else{logger[_0xad6c('0x10')](_0xad6c('0x11'),_0xc0731c,_0xad6c('0x12'));_0x2f4d58(_0x2e604f[_0xad6c('0x19')][_0xad6c('0x18')]);}})[_0xad6c('0x1a')](function(_0x55dfc1){logger[_0xad6c('0x16')](_0xad6c('0x11'),_0xc0731c,_0x55dfc1);_0x387031(_0x55dfc1);});});}exports[_0xad6c('0x1b')]=function(_0x1d9b7c){var _0xa71550=this;return new Promise(function(_0x2b9148,_0x2d032c){return db[_0xad6c('0x1c')]['create'](_0x1d9b7c['body'],{'raw':_0x1d9b7c[_0xad6c('0x1d')]?_0x1d9b7c[_0xad6c('0x1d')][_0xad6c('0x1e')]===undefined?!![]:![]:!![]})[_0xad6c('0x1f')](function(_0x23bb71){logger[_0xad6c('0x10')]('CreateSmsMessage',_0x1d9b7c);logger[_0xad6c('0x13')](_0xad6c('0x1b'),_0x1d9b7c,JSON[_0xad6c('0x15')](_0x23bb71));_0x2b9148(_0x23bb71);})[_0xad6c('0x1a')](function(_0x154126){logger['error'](_0xad6c('0x1b'),_0x154126[_0xad6c('0x18')],_0x1d9b7c);_0x2d032c(_0xa71550[_0xad6c('0x16')](0x1f4,_0x154126[_0xad6c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6dcd3e6..4f1c296 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 _0x39fc=['./smsMessage.events','save','remove','update','register','length'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x39fc,0x156));var _0xc39f=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0x39fc[_0x3b56c0];return _0x377efe;};'use strict';var SmsMessageEvents=require(_0xc39f('0x0'));var events=[_0xc39f('0x1'),_0xc39f('0x2'),_0xc39f('0x3')];function createListener(_0x30938e,_0x4edf6a){return function(_0x2292d0){_0x4edf6a['emit'](_0x30938e,_0x2292d0);};}function removeListener(_0x15cdbe,_0x3a067c){return function(){SmsMessageEvents['removeListener'](_0x15cdbe,_0x3a067c);};}exports[_0xc39f('0x4')]=function(_0x51d456){for(var _0x4037f3=0x0,_0xceef68=events[_0xc39f('0x5')];_0x4037f3<_0xceef68;_0x4037f3++){var _0x4d1772=events[_0x4037f3];var _0x341ea6=createListener('smsMessage:'+_0x4d1772,_0x51d456);SmsMessageEvents['on'](_0x4d1772,_0x341ea6);}}; \ No newline at end of file +var _0x3922=['smsMessage:','save','update','emit','register','length'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3922,0x127));var _0x2392=function(_0x4fb58c,_0x3a737c){_0x4fb58c=_0x4fb58c-0x0;var _0x1d8e77=_0x3922[_0x4fb58c];return _0x1d8e77;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2392('0x0'),'remove',_0x2392('0x1')];function createListener(_0x26fee4,_0x1171a4){return function(_0x4588ef){_0x1171a4[_0x2392('0x2')](_0x26fee4,_0x4588ef);};}function removeListener(_0x58db74,_0x2d65e5){return function(){SmsMessageEvents['removeListener'](_0x58db74,_0x2d65e5);};}exports[_0x2392('0x3')]=function(_0x340b9c){for(var _0x3b9583=0x0,_0x5bc85b=events[_0x2392('0x4')];_0x3b9583<_0x5bc85b;_0x3b9583++){var _0xacee4d=events[_0x3b9583];var _0x49df1b=createListener(_0x2392('0x5')+_0xacee4d,_0x340b9c);SmsMessageEvents['on'](_0xacee4d,_0x49df1b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c094015..7b60ad5 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 _0x0265=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members'];(function(_0x49263e,_0x800591){var _0x349ab6=function(_0x16c568){while(--_0x16c568){_0x49263e['push'](_0x49263e['shift']());}};_0x349ab6(++_0x800591);}(_0x0265,0xe2));var _0x5026=function(_0x4e96ad,_0x2aa8ab){_0x4e96ad=_0x4e96ad-0x0;var _0x34aff8=_0x0265[_0x4e96ad];return _0x34aff8;};'use strict';var multer=require(_0x5026('0x0'));var util=require(_0x5026('0x1'));var path=require(_0x5026('0x2'));var timeout=require(_0x5026('0x3'));var express=require(_0x5026('0x4'));var router=express[_0x5026('0x5')]();var fs_extra=require(_0x5026('0x6'));var auth=require(_0x5026('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5026('0x8'));var controller=require(_0x5026('0x9'));router[_0x5026('0xa')]('/',auth[_0x5026('0xb')](),controller[_0x5026('0xc')]);router[_0x5026('0xa')](_0x5026('0xd'),auth[_0x5026('0xb')](),controller['describe']);router[_0x5026('0xa')](_0x5026('0xe'),auth[_0x5026('0xb')](),controller[_0x5026('0xf')]);router['get'](_0x5026('0x10'),auth[_0x5026('0xb')](),controller[_0x5026('0x11')]);router['get'](_0x5026('0x12'),auth[_0x5026('0xb')](),controller[_0x5026('0x13')]);router[_0x5026('0xa')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller[_0x5026('0x15')]);router[_0x5026('0x16')]('/',auth[_0x5026('0xb')](),controller['create']);router['post'](_0x5026('0x12'),auth[_0x5026('0xb')](),controller['addTeams']);router[_0x5026('0x16')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller[_0x5026('0x17')]);router[_0x5026('0x18')]('/:id',auth[_0x5026('0xb')](),controller[_0x5026('0x19')]);router[_0x5026('0x1a')]('/:id',auth[_0x5026('0xb')](),controller['destroy']);router[_0x5026('0x1a')](_0x5026('0x12'),auth[_0x5026('0xb')](),controller['removeTeams']);router[_0x5026('0x1a')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x4fd8=['create','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post'];(function(_0x25a78d,_0x2b0f45){var _0xd54de8=function(_0x54ab41){while(--_0x54ab41){_0x25a78d['push'](_0x25a78d['shift']());}};_0xd54de8(++_0x2b0f45);}(_0x4fd8,0x168));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x84fd('0x0'));var util=require('util');var path=require(_0x84fd('0x1'));var timeout=require(_0x84fd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x84fd('0x3'));var auth=require(_0x84fd('0x4'));var interaction=require(_0x84fd('0x5'));var config=require(_0x84fd('0x6'));var controller=require('./smsQueue.controller');router[_0x84fd('0x7')]('/',auth[_0x84fd('0x8')](),controller[_0x84fd('0x9')]);router[_0x84fd('0x7')](_0x84fd('0xa'),auth[_0x84fd('0x8')](),controller['describe']);router[_0x84fd('0x7')](_0x84fd('0xb'),auth[_0x84fd('0x8')](),controller[_0x84fd('0xc')]);router[_0x84fd('0x7')](_0x84fd('0xd'),auth['isAuthenticated'](),controller[_0x84fd('0xe')]);router[_0x84fd('0x7')]('/:id/teams',auth[_0x84fd('0x8')](),controller['getTeams']);router[_0x84fd('0x7')](_0x84fd('0xf'),auth[_0x84fd('0x8')](),controller[_0x84fd('0x10')]);router[_0x84fd('0x11')]('/',auth[_0x84fd('0x8')](),controller[_0x84fd('0x12')]);router['post']('/:id/teams',auth[_0x84fd('0x8')](),controller[_0x84fd('0x13')]);router[_0x84fd('0x11')]('/:id/users',auth[_0x84fd('0x8')](),controller[_0x84fd('0x14')]);router[_0x84fd('0x15')]('/:id',auth[_0x84fd('0x8')](),controller[_0x84fd('0x16')]);router[_0x84fd('0x17')](_0x84fd('0xb'),auth['isAuthenticated'](),controller[_0x84fd('0x18')]);router[_0x84fd('0x17')](_0x84fd('0x19'),auth[_0x84fd('0x8')](),controller[_0x84fd('0x1a')]);router[_0x84fd('0x17')](_0x84fd('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5530840..900d42e 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 _0xdc66=['sequelize','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdc66,0x78));var _0x6dc6=function(_0xac2821,_0x136c33){_0xac2821=_0xac2821-0x0;var _0x1f4d3f=_0xdc66[_0xac2821];return _0x1f4d3f;};'use strict';var Sequelize=require(_0x6dc6('0x0'));module['exports']={'name':{'type':Sequelize[_0x6dc6('0x1')],'unique':_0x6dc6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6dc6('0x1')]},'timeout':{'type':Sequelize[_0x6dc6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6dc6('0x4')]('rrmemory','beepall',_0x6dc6('0x5'))}}; \ No newline at end of file +var _0x0ab0=['rrmemory','sequelize','exports','name','INTEGER'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0ab0,0xd8));var _0x00ab=function(_0x3b1133,_0x345852){_0x3b1133=_0x3b1133-0x0;var _0x447d69=_0x0ab0[_0x3b1133];return _0x447d69;};'use strict';var Sequelize=require(_0x00ab('0x0'));module[_0x00ab('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x00ab('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x00ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x00ab('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 03da6a5..a19c2f1 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 _0xf10f=['userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','SmsQueueId','filter','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','rows','%s/%s','SIP','getTeams','Team','addTeams','voicePause','interface','Agents','transaction','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userSmsQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','end','error','name','send','index','map','rawAttributes','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','options','SmsQueue','includeAll','include','findAll','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find'];(function(_0x18b548,_0x43b771){var _0x2141b6=function(_0x1ba849){while(--_0x1ba849){_0x18b548['push'](_0x18b548['shift']());}};_0x2141b6(++_0x43b771);}(_0xf10f,0x15a));var _0xff10=function(_0x35670c,_0x2fbf8a){_0x35670c=_0x35670c-0x0;var _0x56c211=_0xf10f[_0x35670c];return _0x56c211;};'use strict';var emlformat=require(_0xff10('0x0'));var rimraf=require(_0xff10('0x1'));var zipdir=require(_0xff10('0x2'));var jsonpatch=require(_0xff10('0x3'));var rp=require('request-promise');var moment=require(_0xff10('0x4'));var BPromise=require(_0xff10('0x5'));var Mustache=require(_0xff10('0x6'));var util=require('util');var path=require(_0xff10('0x7'));var sox=require(_0xff10('0x8'));var csv=require(_0xff10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff10('0xa'));var _=require(_0xff10('0xb'));var squel=require(_0xff10('0xc'));var crypto=require(_0xff10('0xd'));var jsforce=require(_0xff10('0xe'));var deskjs=require(_0xff10('0xf'));var toCsv=require('to-csv');var querystring=require(_0xff10('0x10'));var Papa=require('papaparse');var Redis=require(_0xff10('0x11'));var authService=require(_0xff10('0x12'));var qs=require(_0xff10('0x13'));var as=require(_0xff10('0x14'));var hardwareService=require(_0xff10('0x15'));var logger=require('../../config/logger')(_0xff10('0x16'));var utils=require(_0xff10('0x17'));var config=require(_0xff10('0x18'));var licenseUtil=require(_0xff10('0x19'));var db=require(_0xff10('0x1a'))['db'];config[_0xff10('0x1b')]=_[_0xff10('0x1c')](config[_0xff10('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xff10('0x1d'))(new Redis(config['redis']));require(_0xff10('0x1e'))[_0xff10('0x1f')](socket);function respondWithStatusCode(_0x2c73aa,_0x13d0d1){_0x13d0d1=_0x13d0d1||0xcc;return function(_0x85b141){if(_0x85b141){return _0x2c73aa[_0xff10('0x20')](_0x13d0d1);}return _0x2c73aa[_0xff10('0x21')](_0x13d0d1)['end']();};}function respondWithResult(_0xcc6a3e,_0x2bab21){_0x2bab21=_0x2bab21||0xc8;return function(_0x5936dc){if(_0x5936dc){return _0xcc6a3e[_0xff10('0x21')](_0x2bab21)[_0xff10('0x22')](_0x5936dc);}};}function respondWithFilteredResult(_0x527f81,_0x6b5177){return function(_0x83e7ea){if(_0x83e7ea){var _0x302d15=typeof _0x6b5177[_0xff10('0x23')]===_0xff10('0x24')&&typeof _0x6b5177[_0xff10('0x25')]==='undefined';var _0x3d9f3d=_0x83e7ea[_0xff10('0x26')];var _0x53023f=_0x302d15?0x0:_0x6b5177[_0xff10('0x23')];var _0x7a9386=_0x302d15?_0x83e7ea[_0xff10('0x26')]:_0x6b5177[_0xff10('0x23')]+_0x6b5177[_0xff10('0x25')];var _0x3e47fe;if(_0x7a9386>=_0x3d9f3d){_0x7a9386=_0x3d9f3d;_0x3e47fe=0xc8;}else{_0x3e47fe=0xce;}_0x527f81['status'](_0x3e47fe);return _0x527f81[_0xff10('0x27')](_0xff10('0x28'),_0x53023f+'-'+_0x7a9386+'/'+_0x3d9f3d)[_0xff10('0x22')](_0x83e7ea);}return null;};}function patchUpdates(_0x1d71d2){return function(_0x3e4ce9){try{jsonpatch[_0xff10('0x29')](_0x3e4ce9,_0x1d71d2,!![]);}catch(_0x5ad9e1){return BPromise[_0xff10('0x2a')](_0x5ad9e1);}return _0x3e4ce9[_0xff10('0x2b')]();};}function saveUpdates(_0x107dcb,_0x5945c4){return function(_0x8255a1){if(_0x8255a1){return _0x8255a1[_0xff10('0x2c')](_0x107dcb)['then'](function(_0x396331){return _0x396331;});}return null;};}function removeEntity(_0x1d0bcf,_0x1a5a25){return function(_0x20eb04){if(_0x20eb04){return _0x20eb04[_0xff10('0x2d')]()[_0xff10('0x2e')](function(){var _0x27232e=_0x20eb04[_0xff10('0x2f')]({'plain':!![]});var _0x24d4b2=_0xff10('0x30');return db['UserProfileResource'][_0xff10('0x2d')]({'where':{'type':_0x24d4b2,'resourceId':_0x27232e['id']}})[_0xff10('0x2e')](function(){return _0x20eb04;});})['then'](function(){_0x1d0bcf['status'](0xcc)[_0xff10('0x31')]();});}};}function handleEntityNotFound(_0x25c656,_0x22214c){return function(_0x4ae9f5){if(!_0x4ae9f5){_0x25c656['sendStatus'](0x194);}return _0x4ae9f5;};}function handleError(_0x249c8e,_0x1d0b41){_0x1d0b41=_0x1d0b41||0x1f4;return function(_0x285757){logger[_0xff10('0x32')](_0x285757['stack']);if(_0x285757[_0xff10('0x33')]){delete _0x285757[_0xff10('0x33')];}_0x249c8e['status'](_0x1d0b41)[_0xff10('0x34')](_0x285757);};}exports[_0xff10('0x35')]=function(_0xfaef74,_0x44fd1e){var _0x167498={},_0x280574={},_0x462b3c={'count':0x0,'rows':[]};var _0xa0ea6d=_[_0xff10('0x36')](db['SmsQueue'][_0xff10('0x37')],function(_0x23d0b6){return{'name':_0x23d0b6['fieldName'],'type':_0x23d0b6['type'][_0xff10('0x38')]};});_0x280574[_0xff10('0x39')]=_[_0xff10('0x36')](_0xa0ea6d,_0xff10('0x33'));_0x280574[_0xff10('0x3a')]=_['keys'](_0xfaef74['query']);_0x280574['filters']=_[_0xff10('0x3b')](_0x280574[_0xff10('0x39')],_0x280574[_0xff10('0x3a')]);_0x167498['attributes']=_[_0xff10('0x3b')](_0x280574[_0xff10('0x39')],qs[_0xff10('0x3c')](_0xfaef74['query']['fields']));_0x167498[_0xff10('0x3d')]=_0x167498['attributes'][_0xff10('0x3e')]?_0x167498['attributes']:_0x280574[_0xff10('0x39')];if(!_0xfaef74[_0xff10('0x3a')][_0xff10('0x3f')](_0xff10('0x40'))){_0x167498[_0xff10('0x25')]=qs['limit'](_0xfaef74[_0xff10('0x3a')][_0xff10('0x25')]);_0x167498[_0xff10('0x23')]=qs[_0xff10('0x23')](_0xfaef74[_0xff10('0x3a')]['offset']);}_0x167498[_0xff10('0x41')]=qs['sort'](_0xfaef74[_0xff10('0x3a')][_0xff10('0x42')]);_0x167498[_0xff10('0x43')]=qs['filters'](_[_0xff10('0x44')](_0xfaef74['query'],_0x280574[_0xff10('0x45')]),_0xa0ea6d);if(_0xfaef74[_0xff10('0x3a')]['filter']){_0x167498[_0xff10('0x43')]=_[_0xff10('0x46')](_0x167498[_0xff10('0x43')],{'$or':_[_0xff10('0x36')](_0xa0ea6d,function(_0x2ca546){if(_0x2ca546[_0xff10('0x47')]!==_0xff10('0x48')){var _0x4ddf83={};_0x4ddf83[_0x2ca546[_0xff10('0x33')]]={'$like':'%'+_0xfaef74[_0xff10('0x3a')]['filter']+'%'};return _0x4ddf83;}})});}_0x167498=_[_0xff10('0x46')]({},_0x167498,_0xfaef74[_0xff10('0x49')]);var _0x2b2c66={'where':_0x167498[_0xff10('0x43')]};return db[_0xff10('0x4a')][_0xff10('0x26')](_0x2b2c66)[_0xff10('0x2e')](function(_0x33a9f7){_0x462b3c[_0xff10('0x26')]=_0x33a9f7;if(_0xfaef74['query'][_0xff10('0x4b')]){_0x167498[_0xff10('0x4c')]=[{'all':!![]}];}return db[_0xff10('0x4a')][_0xff10('0x4d')](_0x167498);})[_0xff10('0x2e')](function(_0xc39fbf){_0x462b3c['rows']=_0xc39fbf;return _0x462b3c;})['then'](respondWithFilteredResult(_0x44fd1e,_0x167498))['catch'](handleError(_0x44fd1e,null));};exports[_0xff10('0x4e')]=function(_0x4b5d37,_0xe88bd4){var _0x324935={'raw':!![],'where':{'id':_0x4b5d37[_0xff10('0x4f')]['id']}},_0x378003={};_0x378003[_0xff10('0x39')]=_[_0xff10('0x50')](db[_0xff10('0x4a')]['rawAttributes']);_0x378003['query']=_['keys'](_0x4b5d37[_0xff10('0x3a')]);_0x378003[_0xff10('0x45')]=_['intersection'](_0x378003[_0xff10('0x39')],_0x378003['query']);_0x324935['attributes']=_['intersection'](_0x378003[_0xff10('0x39')],qs[_0xff10('0x3c')](_0x4b5d37[_0xff10('0x3a')][_0xff10('0x3c')]));_0x324935[_0xff10('0x3d')]=_0x324935[_0xff10('0x3d')][_0xff10('0x3e')]?_0x324935['attributes']:_0x378003[_0xff10('0x39')];if(_0x4b5d37[_0xff10('0x3a')][_0xff10('0x4b')]){_0x324935['include']=[{'all':!![]}];}_0x324935=_[_0xff10('0x46')]({},_0x324935,_0x4b5d37[_0xff10('0x49')]);return db[_0xff10('0x4a')]['find'](_0x324935)[_0xff10('0x2e')](handleEntityNotFound(_0xe88bd4,null))[_0xff10('0x2e')](respondWithResult(_0xe88bd4,null))[_0xff10('0x51')](handleError(_0xe88bd4,null));};exports[_0xff10('0x52')]=function(_0x3fdbb4,_0x2a062f){return db[_0xff10('0x4a')][_0xff10('0x52')](_0x3fdbb4[_0xff10('0x53')],{})['then'](function(_0x4327f5){var _0xb55172=_0x3fdbb4[_0xff10('0x54')]['get']({'plain':!![]});if(!_0xb55172)throw new Error(_0xff10('0x55'));if(_0xb55172[_0xff10('0x56')]===_0xff10('0x54')){var _0x190ff7=_0x4327f5[_0xff10('0x2f')]({'plain':!![]});var _0x2cc5ed=_0xff10('0x30');return db[_0xff10('0x57')][_0xff10('0x58')]({'where':{'name':_0x2cc5ed,'userProfileId':_0xb55172[_0xff10('0x59')]},'raw':!![]})[_0xff10('0x2e')](function(_0x36c995){if(_0x36c995&&_0x36c995['autoAssociation']===0x0){return db[_0xff10('0x5a')][_0xff10('0x52')]({'name':_0x190ff7[_0xff10('0x33')],'resourceId':_0x190ff7['id'],'type':_0x36c995['name'],'sectionId':_0x36c995['id']},{})['then'](function(){return _0x4327f5;});}else{return _0x4327f5;}})[_0xff10('0x51')](function(_0x24e201){logger[_0xff10('0x32')](_0xff10('0x5b'),_0x24e201);throw _0x24e201;});}return _0x4327f5;})[_0xff10('0x2e')](respondWithResult(_0x2a062f,0xc9))[_0xff10('0x51')](handleError(_0x2a062f,null));};exports[_0xff10('0x2c')]=function(_0x51cccf,_0x5498cf){if(_0x51cccf[_0xff10('0x53')]['id']){delete _0x51cccf['body']['id'];}return db[_0xff10('0x4a')][_0xff10('0x58')]({'where':{'id':_0x51cccf[_0xff10('0x4f')]['id']}})[_0xff10('0x2e')](handleEntityNotFound(_0x5498cf,null))['then'](saveUpdates(_0x51cccf['body'],null))[_0xff10('0x2e')](respondWithResult(_0x5498cf,null))[_0xff10('0x51')](handleError(_0x5498cf,null));};exports[_0xff10('0x2d')]=function(_0x2a0a01,_0x166d09){return db[_0xff10('0x4a')][_0xff10('0x58')]({'where':{'id':_0x2a0a01[_0xff10('0x4f')]['id']}})['then'](handleEntityNotFound(_0x166d09,null))['then'](removeEntity(_0x166d09,null))['catch'](handleError(_0x166d09,null));};exports[_0xff10('0x5c')]=function(_0x120a0e,_0x3ade33){return db[_0xff10('0x4a')][_0xff10('0x5c')]()[_0xff10('0x2e')](respondWithResult(_0x3ade33,null))['catch'](handleError(_0x3ade33,null));};exports['getMembers']=function(_0x864486,_0x3ad0ea,_0x1706ad){var _0x5d1e1a={'raw':!![],'where':{}},_0x3a08cf={},_0x144724;return db[_0xff10('0x4a')][_0xff10('0x5d')]({'where':{'id':_0x864486['params']['id']}})[_0xff10('0x2e')](handleEntityNotFound(_0x3ad0ea,null))[_0xff10('0x2e')](function(_0x1e85f1){if(_0x1e85f1){_0x144724=_0x1e85f1[_0xff10('0x2f')]({'plain':!![]});_0x3a08cf[_0xff10('0x39')]=_['keys'](db['UserSmsQueue'][_0xff10('0x37')]);_0x3a08cf[_0xff10('0x3a')]=_[_0xff10('0x50')](_0x864486[_0xff10('0x3a')]);_0x3a08cf[_0xff10('0x45')]=_['intersection'](_0x3a08cf[_0xff10('0x39')],_0x3a08cf[_0xff10('0x3a')]);_0x5d1e1a[_0xff10('0x3d')]=_[_0xff10('0x3b')](_0x3a08cf[_0xff10('0x39')],qs[_0xff10('0x3c')](_0x864486[_0xff10('0x3a')][_0xff10('0x3c')]));_0x5d1e1a[_0xff10('0x3d')]=_0x5d1e1a[_0xff10('0x3d')][_0xff10('0x3e')]?_0x5d1e1a[_0xff10('0x3d')]:_0x3a08cf[_0xff10('0x39')];if(!_0x864486['query'][_0xff10('0x3f')](_0xff10('0x40'))){_0x5d1e1a[_0xff10('0x25')]=qs['limit'](_0x864486['query'][_0xff10('0x25')]);_0x5d1e1a[_0xff10('0x23')]=qs[_0xff10('0x23')](_0x864486[_0xff10('0x3a')][_0xff10('0x23')]);}_0x5d1e1a[_0xff10('0x41')]=qs[_0xff10('0x42')](_0x864486[_0xff10('0x3a')][_0xff10('0x42')]);_0x5d1e1a[_0xff10('0x43')]=qs['filters'](_[_0xff10('0x44')](_0x864486[_0xff10('0x3a')],_0x3a08cf[_0xff10('0x45')]));_0x5d1e1a[_0xff10('0x43')][_0xff10('0x5e')]=_0x1e85f1['id'];if(_0x864486[_0xff10('0x3a')]['filter']){_0x5d1e1a[_0xff10('0x43')]=_[_0xff10('0x46')](_0x5d1e1a['where'],{'$or':_['map'](_0x5d1e1a['attributes'],function(_0xd5addf){var _0x25a3eb={};_0x25a3eb[_0xd5addf]={'$like':'%'+_0x864486[_0xff10('0x3a')][_0xff10('0x5f')]+'%'};return _0x25a3eb;})});}_0x5d1e1a=_['merge']({},_0x5d1e1a,_0x864486[_0xff10('0x49')]);return db[_0xff10('0x60')][_0xff10('0x4d')](_0x5d1e1a);}})[_0xff10('0x2e')](function(_0x21af6f){if(_0x21af6f){return db[_0xff10('0x61')][_0xff10('0x62')]({'where':{'id':_[_0xff10('0x36')](_0x21af6f,_0xff10('0x63')),'role':_0xff10('0x64')},'attributes':['id',_0xff10('0x33'),_0xff10('0x65'),_0xff10('0x66'),'createdAt']});}})[_0xff10('0x2e')](function(_0x1ef050){if(_0x1ef050){return{'count':_0x1ef050[_0xff10('0x26')],'rows':_[_0xff10('0x36')](_0x1ef050[_0xff10('0x67')],function(_0x1ff3de){return{'membername':_0x1ff3de[_0xff10('0x33')],'UserId':_0x1ff3de['id'],'queue_name':_0x144724[_0xff10('0x33')],'SmsQueueId':_0x144724['id'],'interface':util['format'](_0xff10('0x68'),_0xff10('0x69'),_0x1ff3de[_0xff10('0x33')]),'penalty':0x0,'paused':_0x1ff3de['smsPause'],'createdAt':_0x1ff3de['createdAt'],'updatedAt':_0x1ff3de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xff10('0x2e')](respondWithFilteredResult(_0x3ad0ea,_0x5d1e1a))[_0xff10('0x51')](handleError(_0x3ad0ea,null));};exports[_0xff10('0x6a')]=function(_0xa2a934,_0x35ba0f,_0x1badd3){var _0x58b65e={};var _0xd54dec={};var _0x3f5d6b;var _0xabf541;return db[_0xff10('0x4a')][_0xff10('0x5d')]({'where':{'id':_0xa2a934[_0xff10('0x4f')]['id']}})['then'](handleEntityNotFound(_0x35ba0f,null))[_0xff10('0x2e')](function(_0x2c9471){if(_0x2c9471){_0x3f5d6b=_0x2c9471;_0xd54dec[_0xff10('0x39')]=_[_0xff10('0x50')](db[_0xff10('0x6b')]['rawAttributes']);_0xd54dec['query']=_['keys'](_0xa2a934['query']);_0xd54dec[_0xff10('0x45')]=_['intersection'](_0xd54dec['model'],_0xd54dec[_0xff10('0x3a')]);_0x58b65e[_0xff10('0x3d')]=_[_0xff10('0x3b')](_0xd54dec[_0xff10('0x39')],qs[_0xff10('0x3c')](_0xa2a934[_0xff10('0x3a')][_0xff10('0x3c')]));_0x58b65e[_0xff10('0x3d')]=_0x58b65e[_0xff10('0x3d')][_0xff10('0x3e')]?_0x58b65e[_0xff10('0x3d')]:_0xd54dec[_0xff10('0x39')];_0x58b65e[_0xff10('0x41')]=qs[_0xff10('0x42')](_0xa2a934[_0xff10('0x3a')][_0xff10('0x42')]);_0x58b65e['where']=qs[_0xff10('0x45')](_[_0xff10('0x44')](_0xa2a934['query'],_0xd54dec[_0xff10('0x45')]));if(_0xa2a934[_0xff10('0x3a')][_0xff10('0x5f')]){_0x58b65e[_0xff10('0x43')]=_[_0xff10('0x46')](_0x58b65e[_0xff10('0x43')],{'$or':_[_0xff10('0x36')](_0x58b65e[_0xff10('0x3d')],function(_0x1af1c9){var _0x32a3fa={};_0x32a3fa[_0x1af1c9]={'$like':'%'+_0xa2a934[_0xff10('0x3a')][_0xff10('0x5f')]+'%'};return _0x32a3fa;})});}_0x58b65e=_[_0xff10('0x46')]({},_0x58b65e,_0xa2a934[_0xff10('0x49')]);return _0x3f5d6b[_0xff10('0x6a')](_0x58b65e);}})[_0xff10('0x2e')](function(_0x4c30fe){if(_0x4c30fe){_0xabf541=_0x4c30fe[_0xff10('0x3e')];if(!_0xa2a934[_0xff10('0x3a')][_0xff10('0x3f')](_0xff10('0x40'))){_0x58b65e[_0xff10('0x25')]=qs[_0xff10('0x25')](_0xa2a934[_0xff10('0x3a')]['limit']);_0x58b65e['offset']=qs[_0xff10('0x23')](_0xa2a934[_0xff10('0x3a')]['offset']);}return _0x3f5d6b[_0xff10('0x6a')](_0x58b65e);}})[_0xff10('0x2e')](function(_0x461176){if(_0x461176){return _0x461176?{'count':_0xabf541,'rows':_0x461176}:null;}})[_0xff10('0x2e')](respondWithResult(_0x35ba0f,null))[_0xff10('0x51')](handleError(_0x35ba0f,null));};exports[_0xff10('0x6c')]=function(_0x498f09,_0x44e0e0,_0x4c9cca){var _0x1370d1=_0x498f09[_0xff10('0x53')]['ids'];return db[_0xff10('0x6b')][_0xff10('0x4d')]({'where':{'id':_0x1370d1},'attributes':['id'],'include':[{'model':db[_0xff10('0x61')],'as':'Agents','attributes':['id',_0xff10('0x33'),'online',_0xff10('0x6d'),_0xff10('0x6e')],'raw':!![]}]})[_0xff10('0x2e')](function(_0x165717){if(_0x165717){var _0x53c8ca=_['flatMap'](_0x165717,function(_0x425fb8){var _0x37b0c2=_0x425fb8[_0xff10('0x2f')]({'plain':!![]});return _0x37b0c2[_0xff10('0x6f')];});return db[_0xff10('0x4a')][_0xff10('0x58')]({'where':{'id':_0x498f09['params']['id']}})[_0xff10('0x2e')](function(_0x5c95c9){return db['sequelize'][_0xff10('0x70')](function(_0xed4c20){return _0x5c95c9[_0xff10('0x6c')](_0x1370d1,{'transaction':_0xed4c20})[_0xff10('0x2e')](function(){return BPromise['each'](_0x53c8ca,function(_0x338f04){return db[_0xff10('0x60')][_0xff10('0x71')]({'where':{'UserId':_0x338f04['id'],'SmsQueueId':_0x498f09[_0xff10('0x4f')]['id']},'transaction':_0xed4c20});});})[_0xff10('0x2e')](function(){_0x53c8ca[_0xff10('0x72')](function(_0x278e61){socket[_0xff10('0x73')](_0xff10('0x74'),{'UserId':_0x278e61['id'],'SmsQueueId':_0x5c95c9['id']});});});});});}})[_0xff10('0x2e')](respondWithStatusCode(_0x44e0e0,null))[_0xff10('0x51')](handleError(_0x44e0e0,null));};exports['removeTeams']=function(_0x382812,_0x424a40,_0x176274){return db[_0xff10('0x6b')]['findAll']({'where':{'id':_0x382812[_0xff10('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xff10('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x424a40,null))[_0xff10('0x2e')](function(_0x24356a){var _0x5e485a=_[_0xff10('0x36')](_0x24356a,'id');var _0x2feb9a=[];var _0x59f618=[];var _0x41ff54=squel[_0xff10('0x75')]();_0x41ff54[_0xff10('0x76')](_0xff10('0x77'))[_0xff10('0x78')]('team_has_sms_queues','tq')[_0xff10('0x79')](_0xff10('0x7a'),'ut',_0xff10('0x7b'))[_0xff10('0x43')](_0xff10('0x7c'),_0x382812['params']['id']);for(var _0x5f47c0=0x0;_0x5f47c0<_0x24356a[_0xff10('0x3e')];_0x5f47c0+=0x1){let _0x10d461=_0x24356a[_0x5f47c0];for(var _0x43371e=0x0;_0x43371e<_0x10d461['Agents'][_0xff10('0x3e')];_0x43371e+=0x1){let _0x32e509=_0x10d461[_0xff10('0x6f')][_0x43371e];var _0x186c16=_0x41ff54[_0xff10('0x7d')]();_0x186c16[_0xff10('0x43')]('ut.UserId\x20=\x20?',_0x32e509['id']);_0x59f618[_0xff10('0x7e')](db['sequelize'][_0xff10('0x3a')](_0x186c16[_0xff10('0x7f')](),{'type':db[_0xff10('0x80')][_0xff10('0x81')][_0xff10('0x82')]})[_0xff10('0x2e')](function(_0x5a9c2a){if(_0x5a9c2a[_0xff10('0x3e')]===0x1){return _0x32e509['id'];}else{var _0x1f15fe=_[_0xff10('0x83')](_['map'](_0x5a9c2a,_0xff10('0x84')),function(_0x3ad390){return _['includes'](_0x5e485a,_0x3ad390);});if(_0x1f15fe){return _0x32e509['id'];}}}));}}return BPromise['all'](_0x59f618)[_0xff10('0x2e')](function(_0x26eb65){_0x2feb9a=_(_0x2feb9a)[_0xff10('0x85')](_0x26eb65)[_0xff10('0x86')]()[_0xff10('0x87')]();return db[_0xff10('0x4a')]['find']({'where':{'id':_0x382812[_0xff10('0x4f')]['id']}})[_0xff10('0x2e')](function(_0x4f3be1){return db[_0xff10('0x80')][_0xff10('0x70')](function(_0x3a22bf){return _0x4f3be1[_0xff10('0x88')](_0x382812[_0xff10('0x3a')][_0xff10('0x89')],{'transaction':_0x3a22bf})[_0xff10('0x2e')](function(){if(!_[_0xff10('0x8a')](_0x2feb9a)){return _0x4f3be1[_0xff10('0x8b')](_0x2feb9a,{'transaction':_0x3a22bf});}})[_0xff10('0x2e')](function(){_0x2feb9a['forEach'](function(_0x526bff){socket['emit'](_0xff10('0x8c'),{'UserId':_0x526bff,'SmsQueueId':_0x4f3be1['id']});});});});});});})[_0xff10('0x2e')](respondWithStatusCode(_0x424a40,null))[_0xff10('0x51')](handleError(_0x424a40,null));};exports['addAgents']=function(_0x105012,_0x59af7f,_0xcc4ba4){return db[_0xff10('0x4a')]['find']({'where':{'id':_0x105012[_0xff10('0x4f')]['id']}})[_0xff10('0x2e')](handleEntityNotFound(_0x59af7f,null))[_0xff10('0x2e')](function(_0x1f72ed){if(_0x1f72ed){return _0x1f72ed['addAgents'](_0x105012[_0xff10('0x53')]['ids'],_[_0xff10('0x8d')](_0x105012['body'],['ids','id'])||{})[_0xff10('0x8e')](function(_0x5766ac){for(var _0x4f2407=0x0;_0x4f2407<_0x105012[_0xff10('0x53')][_0xff10('0x89')]['length'];_0x4f2407+=0x1){socket['emit'](_0xff10('0x74'),{'UserId':Number(_0x105012['body'][_0xff10('0x89')][_0x4f2407]),'SmsQueueId':Number(_0x105012['params']['id'])});}return _0x5766ac;});}})[_0xff10('0x2e')](respondWithResult(_0x59af7f,null))[_0xff10('0x51')](handleError(_0x59af7f,null));};exports[_0xff10('0x8b')]=function(_0x584352,_0x4936eb,_0x151e85){return db[_0xff10('0x4a')][_0xff10('0x58')]({'where':{'id':_0x584352['params']['id']}})[_0xff10('0x2e')](handleEntityNotFound(_0x4936eb,null))[_0xff10('0x2e')](function(_0x12e9fc){if(_0x12e9fc){return _0x12e9fc['removeAgents'](_0x584352[_0xff10('0x3a')][_0xff10('0x89')])[_0xff10('0x2e')](function(){if(_[_0xff10('0x8f')](_0x584352['query']['ids'])){for(var _0x121c42=0x0;_0x121c42<_0x584352['query'][_0xff10('0x89')][_0xff10('0x3e')];_0x121c42+=0x1){socket[_0xff10('0x73')](_0xff10('0x8c'),{'UserId':Number(_0x584352['query']['ids'][_0x121c42]),'SmsQueueId':Number(_0x584352[_0xff10('0x4f')]['id'])});}}else{socket[_0xff10('0x73')](_0xff10('0x8c'),{'UserId':Number(_0x584352[_0xff10('0x3a')][_0xff10('0x89')]),'SmsQueueId':Number(_0x584352[_0xff10('0x4f')]['id'])});}});}})[_0xff10('0x2e')](respondWithStatusCode(_0x4936eb,null))[_0xff10('0x51')](handleError(_0x4936eb,null));};exports[_0xff10('0x90')]=function(_0x152954,_0x4acece,_0x4d9e62){var _0x4b4939={};var _0x5f3390={};var _0x1b51a3;var _0x42ff9e;return db['SmsQueue'][_0xff10('0x5d')]({'where':{'id':_0x152954[_0xff10('0x4f')]['id']}})[_0xff10('0x2e')](handleEntityNotFound(_0x4acece,null))['then'](function(_0x4f6d27){if(_0x4f6d27){_0x1b51a3=_0x4f6d27;_0x5f3390['model']=_['keys'](db[_0xff10('0x61')][_0xff10('0x37')]);_0x5f3390['query']=_[_0xff10('0x50')](_0x152954['query']);_0x5f3390[_0xff10('0x45')]=_[_0xff10('0x3b')](_0x5f3390[_0xff10('0x39')],_0x5f3390['query']);_0x4b4939['attributes']=_[_0xff10('0x3b')](_0x5f3390[_0xff10('0x39')],qs[_0xff10('0x3c')](_0x152954[_0xff10('0x3a')]['fields']));_0x4b4939[_0xff10('0x3d')]=_0x4b4939[_0xff10('0x3d')][_0xff10('0x3e')]?_0x4b4939[_0xff10('0x3d')]:_0x5f3390[_0xff10('0x39')];_0x4b4939['order']=qs[_0xff10('0x42')](_0x152954[_0xff10('0x3a')][_0xff10('0x42')]);_0x4b4939[_0xff10('0x43')]=qs[_0xff10('0x45')](_[_0xff10('0x44')](_0x152954[_0xff10('0x3a')],_0x5f3390[_0xff10('0x45')]));if(_0x152954['query'][_0xff10('0x5f')]){_0x4b4939['where']=_[_0xff10('0x46')](_0x4b4939[_0xff10('0x43')],{'$or':_[_0xff10('0x36')](_0x4b4939[_0xff10('0x3d')],function(_0x33c894){var _0x422949={};_0x422949[_0x33c894]={'$like':'%'+_0x152954[_0xff10('0x3a')][_0xff10('0x5f')]+'%'};return _0x422949;})});}_0x4b4939=_[_0xff10('0x46')]({},_0x4b4939,_0x152954[_0xff10('0x49')]);return _0x1b51a3[_0xff10('0x90')](_0x4b4939);}})[_0xff10('0x2e')](function(_0xe66342){if(_0xe66342){_0x42ff9e=_0xe66342[_0xff10('0x3e')];if(!_0x152954[_0xff10('0x3a')]['hasOwnProperty'](_0xff10('0x40'))){_0x4b4939['limit']=qs[_0xff10('0x25')](_0x152954[_0xff10('0x3a')][_0xff10('0x25')]);_0x4b4939[_0xff10('0x23')]=qs[_0xff10('0x23')](_0x152954['query'][_0xff10('0x23')]);}return _0x1b51a3[_0xff10('0x90')](_0x4b4939);}})[_0xff10('0x2e')](function(_0x237305){if(_0x237305){return _0x237305?{'count':_0x42ff9e,'rows':_0x237305}:null;}})[_0xff10('0x2e')](respondWithResult(_0x4acece,null))[_0xff10('0x51')](handleError(_0x4acece,null));}; \ No newline at end of file +var _0x4910=['format','%s/%s','smsPause','getTeams','addTeams','ids','Team','User','online','voicePause','interface','Agents','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','get','SmsQueues','UserProfileResource','then','error','stack','name','send','SmsQueue','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','keys','rawAttributes','include','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','rows'];(function(_0x4abe9e,_0x58820f){var _0x28788d=function(_0x15773b){while(--_0x15773b){_0x4abe9e['push'](_0x4abe9e['shift']());}};_0x28788d(++_0x58820f);}(_0x4910,0x1d9));var _0x0491=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4910[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x0491('0x0'));var rimraf=require(_0x0491('0x1'));var zipdir=require(_0x0491('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0491('0x3'));var moment=require(_0x0491('0x4'));var BPromise=require(_0x0491('0x5'));var Mustache=require(_0x0491('0x6'));var util=require(_0x0491('0x7'));var path=require('path');var sox=require(_0x0491('0x8'));var csv=require(_0x0491('0x9'));var ejs=require(_0x0491('0xa'));var fs=require('fs');var fs_extra=require(_0x0491('0xb'));var _=require(_0x0491('0xc'));var squel=require('squel');var crypto=require(_0x0491('0xd'));var jsforce=require(_0x0491('0xe'));var deskjs=require(_0x0491('0xf'));var toCsv=require(_0x0491('0x9'));var querystring=require(_0x0491('0x10'));var Papa=require('papaparse');var Redis=require(_0x0491('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0491('0x12'));var as=require(_0x0491('0x13'));var hardwareService=require(_0x0491('0x14'));var logger=require(_0x0491('0x15'))(_0x0491('0x16'));var utils=require(_0x0491('0x17'));var config=require(_0x0491('0x18'));var licenseUtil=require(_0x0491('0x19'));var db=require(_0x0491('0x1a'))['db'];config[_0x0491('0x1b')]=_['defaults'](config[_0x0491('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0491('0x1c'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x0491('0x1d')](socket);function respondWithStatusCode(_0x7ba36,_0x439f5c){_0x439f5c=_0x439f5c||0xcc;return function(_0x2f1a37){if(_0x2f1a37){return _0x7ba36[_0x0491('0x1e')](_0x439f5c);}return _0x7ba36[_0x0491('0x1f')](_0x439f5c)[_0x0491('0x20')]();};}function respondWithResult(_0xbd94bd,_0xf12423){_0xf12423=_0xf12423||0xc8;return function(_0x1411a6){if(_0x1411a6){return _0xbd94bd['status'](_0xf12423)[_0x0491('0x21')](_0x1411a6);}};}function respondWithFilteredResult(_0x1cf288,_0x12990a){return function(_0x31bc2c){if(_0x31bc2c){var _0x3b536e=typeof _0x12990a[_0x0491('0x22')]==='undefined'&&typeof _0x12990a[_0x0491('0x23')]===_0x0491('0x24');var _0x4e94f8=_0x31bc2c['count'];var _0x1ba594=_0x3b536e?0x0:_0x12990a['offset'];var _0x6f8139=_0x3b536e?_0x31bc2c[_0x0491('0x25')]:_0x12990a['offset']+_0x12990a[_0x0491('0x23')];var _0x22776d;if(_0x6f8139>=_0x4e94f8){_0x6f8139=_0x4e94f8;_0x22776d=0xc8;}else{_0x22776d=0xce;}_0x1cf288[_0x0491('0x1f')](_0x22776d);return _0x1cf288[_0x0491('0x26')]('Content-Range',_0x1ba594+'-'+_0x6f8139+'/'+_0x4e94f8)[_0x0491('0x21')](_0x31bc2c);}return null;};}function patchUpdates(_0x358117){return function(_0x1fb8a5){try{jsonpatch['apply'](_0x1fb8a5,_0x358117,!![]);}catch(_0x1498c2){return BPromise[_0x0491('0x27')](_0x1498c2);}return _0x1fb8a5[_0x0491('0x28')]();};}function saveUpdates(_0x1934a0,_0x30ad41){return function(_0xdda718){if(_0xdda718){return _0xdda718[_0x0491('0x29')](_0x1934a0)['then'](function(_0x7c03ef){return _0x7c03ef;});}return null;};}function removeEntity(_0x4a39f0,_0xc0c021){return function(_0x93bc14){if(_0x93bc14){return _0x93bc14[_0x0491('0x2a')]()['then'](function(){var _0x12ebdb=_0x93bc14[_0x0491('0x2b')]({'plain':!![]});var _0x59beec=_0x0491('0x2c');return db[_0x0491('0x2d')][_0x0491('0x2a')]({'where':{'type':_0x59beec,'resourceId':_0x12ebdb['id']}})[_0x0491('0x2e')](function(){return _0x93bc14;});})[_0x0491('0x2e')](function(){_0x4a39f0[_0x0491('0x1f')](0xcc)[_0x0491('0x20')]();});}};}function handleEntityNotFound(_0x5c9ee2,_0x4fbeb8){return function(_0x5daa56){if(!_0x5daa56){_0x5c9ee2['sendStatus'](0x194);}return _0x5daa56;};}function handleError(_0xaf7a98,_0x53f923){_0x53f923=_0x53f923||0x1f4;return function(_0x46d432){logger[_0x0491('0x2f')](_0x46d432[_0x0491('0x30')]);if(_0x46d432[_0x0491('0x31')]){delete _0x46d432[_0x0491('0x31')];}_0xaf7a98[_0x0491('0x1f')](_0x53f923)[_0x0491('0x32')](_0x46d432);};}exports['index']=function(_0x712f33,_0x133d37){var _0x9b11c2={},_0x5cb278={},_0x4c2a8e={'count':0x0,'rows':[]};var _0x57103a=_['map'](db[_0x0491('0x33')]['rawAttributes'],function(_0x2ad8b2){return{'name':_0x2ad8b2[_0x0491('0x34')],'type':_0x2ad8b2[_0x0491('0x35')][_0x0491('0x36')]};});_0x5cb278[_0x0491('0x37')]=_[_0x0491('0x38')](_0x57103a,_0x0491('0x31'));_0x5cb278[_0x0491('0x39')]=_['keys'](_0x712f33[_0x0491('0x39')]);_0x5cb278['filters']=_[_0x0491('0x3a')](_0x5cb278[_0x0491('0x37')],_0x5cb278['query']);_0x9b11c2[_0x0491('0x3b')]=_['intersection'](_0x5cb278[_0x0491('0x37')],qs[_0x0491('0x3c')](_0x712f33[_0x0491('0x39')][_0x0491('0x3c')]));_0x9b11c2['attributes']=_0x9b11c2['attributes'][_0x0491('0x3d')]?_0x9b11c2[_0x0491('0x3b')]:_0x5cb278[_0x0491('0x37')];if(!_0x712f33['query'][_0x0491('0x3e')]('nolimit')){_0x9b11c2[_0x0491('0x23')]=qs['limit'](_0x712f33[_0x0491('0x39')][_0x0491('0x23')]);_0x9b11c2[_0x0491('0x22')]=qs['offset'](_0x712f33['query'][_0x0491('0x22')]);}_0x9b11c2[_0x0491('0x3f')]=qs[_0x0491('0x40')](_0x712f33['query']['sort']);_0x9b11c2[_0x0491('0x41')]=qs[_0x0491('0x42')](_[_0x0491('0x43')](_0x712f33[_0x0491('0x39')],_0x5cb278[_0x0491('0x42')]),_0x57103a);if(_0x712f33[_0x0491('0x39')][_0x0491('0x44')]){_0x9b11c2['where']=_[_0x0491('0x45')](_0x9b11c2[_0x0491('0x41')],{'$or':_['map'](_0x57103a,function(_0x27f2e6){if(_0x27f2e6[_0x0491('0x35')]!==_0x0491('0x46')){var _0x28cfbb={};_0x28cfbb[_0x27f2e6[_0x0491('0x31')]]={'$like':'%'+_0x712f33['query'][_0x0491('0x44')]+'%'};return _0x28cfbb;}})});}_0x9b11c2=_[_0x0491('0x45')]({},_0x9b11c2,_0x712f33[_0x0491('0x47')]);var _0x42ec0e={'where':_0x9b11c2[_0x0491('0x41')]};return db[_0x0491('0x33')][_0x0491('0x25')](_0x42ec0e)[_0x0491('0x2e')](function(_0x20ead0){_0x4c2a8e[_0x0491('0x25')]=_0x20ead0;if(_0x712f33[_0x0491('0x39')][_0x0491('0x48')]){_0x9b11c2['include']=[{'all':!![]}];}return db['SmsQueue'][_0x0491('0x49')](_0x9b11c2);})['then'](function(_0x5dc807){_0x4c2a8e['rows']=_0x5dc807;return _0x4c2a8e;})['then'](respondWithFilteredResult(_0x133d37,_0x9b11c2))[_0x0491('0x4a')](handleError(_0x133d37,null));};exports['show']=function(_0x2ea4da,_0x1ee25f){var _0x6c89e4={'raw':!![],'where':{'id':_0x2ea4da[_0x0491('0x4b')]['id']}},_0x4e06e1={};_0x4e06e1['model']=_[_0x0491('0x4c')](db['SmsQueue'][_0x0491('0x4d')]);_0x4e06e1[_0x0491('0x39')]=_[_0x0491('0x4c')](_0x2ea4da[_0x0491('0x39')]);_0x4e06e1[_0x0491('0x42')]=_[_0x0491('0x3a')](_0x4e06e1[_0x0491('0x37')],_0x4e06e1[_0x0491('0x39')]);_0x6c89e4[_0x0491('0x3b')]=_[_0x0491('0x3a')](_0x4e06e1[_0x0491('0x37')],qs[_0x0491('0x3c')](_0x2ea4da[_0x0491('0x39')]['fields']));_0x6c89e4[_0x0491('0x3b')]=_0x6c89e4[_0x0491('0x3b')][_0x0491('0x3d')]?_0x6c89e4[_0x0491('0x3b')]:_0x4e06e1[_0x0491('0x37')];if(_0x2ea4da[_0x0491('0x39')]['includeAll']){_0x6c89e4[_0x0491('0x4e')]=[{'all':!![]}];}_0x6c89e4=_[_0x0491('0x45')]({},_0x6c89e4,_0x2ea4da[_0x0491('0x47')]);return db[_0x0491('0x33')]['find'](_0x6c89e4)['then'](handleEntityNotFound(_0x1ee25f,null))[_0x0491('0x2e')](respondWithResult(_0x1ee25f,null))[_0x0491('0x4a')](handleError(_0x1ee25f,null));};exports[_0x0491('0x4f')]=function(_0x563c4f,_0x6dd643){return db['SmsQueue'][_0x0491('0x4f')](_0x563c4f['body'],{})[_0x0491('0x2e')](function(_0x3bf967){var _0x24a850=_0x563c4f[_0x0491('0x50')][_0x0491('0x2b')]({'plain':!![]});if(!_0x24a850)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24a850[_0x0491('0x51')]==='user'){var _0x4d0ca7=_0x3bf967[_0x0491('0x2b')]({'plain':!![]});var _0x294cce=_0x0491('0x2c');return db[_0x0491('0x52')][_0x0491('0x53')]({'where':{'name':_0x294cce,'userProfileId':_0x24a850[_0x0491('0x54')]},'raw':!![]})[_0x0491('0x2e')](function(_0x3add97){if(_0x3add97&&_0x3add97['autoAssociation']===0x0){return db[_0x0491('0x2d')][_0x0491('0x4f')]({'name':_0x4d0ca7[_0x0491('0x31')],'resourceId':_0x4d0ca7['id'],'type':_0x3add97[_0x0491('0x31')],'sectionId':_0x3add97['id']},{})[_0x0491('0x2e')](function(){return _0x3bf967;});}else{return _0x3bf967;}})['catch'](function(_0x9a980e){logger[_0x0491('0x2f')](_0x0491('0x55'),_0x9a980e);throw _0x9a980e;});}return _0x3bf967;})[_0x0491('0x2e')](respondWithResult(_0x6dd643,0xc9))[_0x0491('0x4a')](handleError(_0x6dd643,null));};exports[_0x0491('0x29')]=function(_0x1669da,_0x221278){if(_0x1669da['body']['id']){delete _0x1669da[_0x0491('0x56')]['id'];}return db[_0x0491('0x33')][_0x0491('0x53')]({'where':{'id':_0x1669da[_0x0491('0x4b')]['id']}})[_0x0491('0x2e')](handleEntityNotFound(_0x221278,null))[_0x0491('0x2e')](saveUpdates(_0x1669da[_0x0491('0x56')],null))[_0x0491('0x2e')](respondWithResult(_0x221278,null))[_0x0491('0x4a')](handleError(_0x221278,null));};exports['destroy']=function(_0x395561,_0x1a7145){return db[_0x0491('0x33')][_0x0491('0x53')]({'where':{'id':_0x395561['params']['id']}})['then'](handleEntityNotFound(_0x1a7145,null))['then'](removeEntity(_0x1a7145,null))[_0x0491('0x4a')](handleError(_0x1a7145,null));};exports[_0x0491('0x57')]=function(_0x55f888,_0x472b68){return db[_0x0491('0x33')]['describe']()[_0x0491('0x2e')](respondWithResult(_0x472b68,null))[_0x0491('0x4a')](handleError(_0x472b68,null));};exports[_0x0491('0x58')]=function(_0x12dc2c,_0x1af724,_0x5186fb){var _0x45f606={'raw':!![],'where':{}},_0x4b3df8={},_0x4ea662;return db[_0x0491('0x33')][_0x0491('0x59')]({'where':{'id':_0x12dc2c[_0x0491('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1af724,null))[_0x0491('0x2e')](function(_0x185a20){if(_0x185a20){_0x4ea662=_0x185a20['get']({'plain':!![]});_0x4b3df8[_0x0491('0x37')]=_[_0x0491('0x4c')](db[_0x0491('0x5a')][_0x0491('0x4d')]);_0x4b3df8[_0x0491('0x39')]=_[_0x0491('0x4c')](_0x12dc2c[_0x0491('0x39')]);_0x4b3df8['filters']=_['intersection'](_0x4b3df8[_0x0491('0x37')],_0x4b3df8[_0x0491('0x39')]);_0x45f606['attributes']=_[_0x0491('0x3a')](_0x4b3df8[_0x0491('0x37')],qs[_0x0491('0x3c')](_0x12dc2c[_0x0491('0x39')][_0x0491('0x3c')]));_0x45f606[_0x0491('0x3b')]=_0x45f606['attributes'][_0x0491('0x3d')]?_0x45f606[_0x0491('0x3b')]:_0x4b3df8[_0x0491('0x37')];if(!_0x12dc2c[_0x0491('0x39')]['hasOwnProperty'](_0x0491('0x5b'))){_0x45f606[_0x0491('0x23')]=qs[_0x0491('0x23')](_0x12dc2c[_0x0491('0x39')]['limit']);_0x45f606[_0x0491('0x22')]=qs[_0x0491('0x22')](_0x12dc2c[_0x0491('0x39')][_0x0491('0x22')]);}_0x45f606[_0x0491('0x3f')]=qs['sort'](_0x12dc2c['query']['sort']);_0x45f606[_0x0491('0x41')]=qs[_0x0491('0x42')](_[_0x0491('0x43')](_0x12dc2c[_0x0491('0x39')],_0x4b3df8[_0x0491('0x42')]));_0x45f606[_0x0491('0x41')][_0x0491('0x5c')]=_0x185a20['id'];if(_0x12dc2c['query'][_0x0491('0x44')]){_0x45f606['where']=_[_0x0491('0x45')](_0x45f606[_0x0491('0x41')],{'$or':_[_0x0491('0x38')](_0x45f606[_0x0491('0x3b')],function(_0x35d4c0){var _0x537256={};_0x537256[_0x35d4c0]={'$like':'%'+_0x12dc2c[_0x0491('0x39')][_0x0491('0x44')]+'%'};return _0x537256;})});}_0x45f606=_['merge']({},_0x45f606,_0x12dc2c['options']);return db[_0x0491('0x5a')][_0x0491('0x49')](_0x45f606);}})['then'](function(_0x1cf948){if(_0x1cf948){return db['User'][_0x0491('0x5d')]({'where':{'id':_[_0x0491('0x38')](_0x1cf948,_0x0491('0x5e')),'role':_0x0491('0x5f')},'attributes':['id',_0x0491('0x31'),'smsPause',_0x0491('0x60'),_0x0491('0x61')]});}})[_0x0491('0x2e')](function(_0x454ec2){if(_0x454ec2){return{'count':_0x454ec2[_0x0491('0x25')],'rows':_[_0x0491('0x38')](_0x454ec2[_0x0491('0x62')],function(_0x477ef4){return{'membername':_0x477ef4[_0x0491('0x31')],'UserId':_0x477ef4['id'],'queue_name':_0x4ea662[_0x0491('0x31')],'SmsQueueId':_0x4ea662['id'],'interface':util[_0x0491('0x63')](_0x0491('0x64'),'SIP',_0x477ef4[_0x0491('0x31')]),'penalty':0x0,'paused':_0x477ef4[_0x0491('0x65')],'createdAt':_0x477ef4[_0x0491('0x61')],'updatedAt':_0x477ef4[_0x0491('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0491('0x2e')](respondWithFilteredResult(_0x1af724,_0x45f606))[_0x0491('0x4a')](handleError(_0x1af724,null));};exports[_0x0491('0x66')]=function(_0x2aa4b3,_0x1a0536,_0x56f608){var _0x361252={};var _0x24899e={};var _0x1aca3c;var _0x227d7c;return db[_0x0491('0x33')][_0x0491('0x59')]({'where':{'id':_0x2aa4b3[_0x0491('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a0536,null))[_0x0491('0x2e')](function(_0x4351c4){if(_0x4351c4){_0x1aca3c=_0x4351c4;_0x24899e[_0x0491('0x37')]=_[_0x0491('0x4c')](db['Team'][_0x0491('0x4d')]);_0x24899e[_0x0491('0x39')]=_[_0x0491('0x4c')](_0x2aa4b3['query']);_0x24899e[_0x0491('0x42')]=_['intersection'](_0x24899e[_0x0491('0x37')],_0x24899e[_0x0491('0x39')]);_0x361252[_0x0491('0x3b')]=_[_0x0491('0x3a')](_0x24899e[_0x0491('0x37')],qs['fields'](_0x2aa4b3['query']['fields']));_0x361252['attributes']=_0x361252[_0x0491('0x3b')]['length']?_0x361252[_0x0491('0x3b')]:_0x24899e['model'];_0x361252[_0x0491('0x3f')]=qs['sort'](_0x2aa4b3[_0x0491('0x39')]['sort']);_0x361252[_0x0491('0x41')]=qs[_0x0491('0x42')](_[_0x0491('0x43')](_0x2aa4b3[_0x0491('0x39')],_0x24899e['filters']));if(_0x2aa4b3[_0x0491('0x39')][_0x0491('0x44')]){_0x361252[_0x0491('0x41')]=_['merge'](_0x361252[_0x0491('0x41')],{'$or':_[_0x0491('0x38')](_0x361252[_0x0491('0x3b')],function(_0x18bd6a){var _0x14038d={};_0x14038d[_0x18bd6a]={'$like':'%'+_0x2aa4b3['query'][_0x0491('0x44')]+'%'};return _0x14038d;})});}_0x361252=_['merge']({},_0x361252,_0x2aa4b3[_0x0491('0x47')]);return _0x1aca3c[_0x0491('0x66')](_0x361252);}})[_0x0491('0x2e')](function(_0x5df267){if(_0x5df267){_0x227d7c=_0x5df267[_0x0491('0x3d')];if(!_0x2aa4b3[_0x0491('0x39')][_0x0491('0x3e')](_0x0491('0x5b'))){_0x361252[_0x0491('0x23')]=qs[_0x0491('0x23')](_0x2aa4b3[_0x0491('0x39')][_0x0491('0x23')]);_0x361252['offset']=qs[_0x0491('0x22')](_0x2aa4b3[_0x0491('0x39')]['offset']);}return _0x1aca3c[_0x0491('0x66')](_0x361252);}})['then'](function(_0x4e3252){if(_0x4e3252){return _0x4e3252?{'count':_0x227d7c,'rows':_0x4e3252}:null;}})['then'](respondWithResult(_0x1a0536,null))[_0x0491('0x4a')](handleError(_0x1a0536,null));};exports[_0x0491('0x67')]=function(_0x3b07c2,_0x3bc888,_0x58545c){var _0x50e2de=_0x3b07c2[_0x0491('0x56')][_0x0491('0x68')];return db[_0x0491('0x69')][_0x0491('0x49')]({'where':{'id':_0x50e2de},'attributes':['id'],'include':[{'model':db[_0x0491('0x6a')],'as':'Agents','attributes':['id',_0x0491('0x31'),_0x0491('0x6b'),_0x0491('0x6c'),_0x0491('0x6d')],'raw':!![]}]})[_0x0491('0x2e')](function(_0x421d2a){if(_0x421d2a){var _0x54d46a=_['flatMap'](_0x421d2a,function(_0x543699){var _0x52772b=_0x543699['get']({'plain':!![]});return _0x52772b[_0x0491('0x6e')];});return db[_0x0491('0x33')][_0x0491('0x53')]({'where':{'id':_0x3b07c2['params']['id']}})[_0x0491('0x2e')](function(_0xfc37e0){return db[_0x0491('0x6f')][_0x0491('0x70')](function(_0x2fd2c1){return _0xfc37e0['addTeams'](_0x50e2de,{'transaction':_0x2fd2c1})['then'](function(){return BPromise['each'](_0x54d46a,function(_0x458796){return db['UserSmsQueue'][_0x0491('0x71')]({'where':{'UserId':_0x458796['id'],'SmsQueueId':_0x3b07c2['params']['id']},'transaction':_0x2fd2c1});});})['then'](function(){_0x54d46a[_0x0491('0x72')](function(_0x534752){socket[_0x0491('0x73')](_0x0491('0x74'),{'UserId':_0x534752['id'],'SmsQueueId':_0xfc37e0['id']});});});});});}})['then'](respondWithStatusCode(_0x3bc888,null))['catch'](handleError(_0x3bc888,null));};exports[_0x0491('0x75')]=function(_0x2891c9,_0x4b80e0,_0x874976){return db['Team']['findAll']({'where':{'id':_0x2891c9[_0x0491('0x39')][_0x0491('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0491('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b80e0,null))[_0x0491('0x2e')](function(_0x5a3682){var _0x213820=_[_0x0491('0x38')](_0x5a3682,'id');var _0x35fd25=[];var _0x276896=[];var _0x46320a=squel[_0x0491('0x76')]();_0x46320a[_0x0491('0x77')]('tq.TeamId')[_0x0491('0x78')](_0x0491('0x79'),'tq')[_0x0491('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0491('0x41')](_0x0491('0x7b'),_0x2891c9['params']['id']);for(var _0x4e0007=0x0;_0x4e0007<_0x5a3682[_0x0491('0x3d')];_0x4e0007+=0x1){let _0x573d00=_0x5a3682[_0x4e0007];for(var _0x57795b=0x0;_0x57795b<_0x573d00[_0x0491('0x6e')]['length'];_0x57795b+=0x1){let _0x2c4dc3=_0x573d00[_0x0491('0x6e')][_0x57795b];var _0x3ae15f=_0x46320a[_0x0491('0x7c')]();_0x3ae15f[_0x0491('0x41')](_0x0491('0x7d'),_0x2c4dc3['id']);_0x276896['push'](db[_0x0491('0x6f')][_0x0491('0x39')](_0x3ae15f[_0x0491('0x7e')](),{'type':db[_0x0491('0x6f')][_0x0491('0x7f')]['SELECT']})[_0x0491('0x2e')](function(_0x4bbed5){if(_0x4bbed5[_0x0491('0x3d')]===0x1){return _0x2c4dc3['id'];}else{var _0x1a1f74=_[_0x0491('0x80')](_[_0x0491('0x38')](_0x4bbed5,_0x0491('0x81')),function(_0x44dbcf){return _[_0x0491('0x82')](_0x213820,_0x44dbcf);});if(_0x1a1f74){return _0x2c4dc3['id'];}}}));}}return BPromise[_0x0491('0x83')](_0x276896)[_0x0491('0x2e')](function(_0x41761c){_0x35fd25=_(_0x35fd25)[_0x0491('0x84')](_0x41761c)[_0x0491('0x85')]()[_0x0491('0x86')]();return db['SmsQueue'][_0x0491('0x53')]({'where':{'id':_0x2891c9['params']['id']}})[_0x0491('0x2e')](function(_0x4d3265){return db['sequelize'][_0x0491('0x70')](function(_0x29b28b){return _0x4d3265[_0x0491('0x75')](_0x2891c9[_0x0491('0x39')]['ids'],{'transaction':_0x29b28b})['then'](function(){if(!_[_0x0491('0x87')](_0x35fd25)){return _0x4d3265[_0x0491('0x88')](_0x35fd25,{'transaction':_0x29b28b});}})[_0x0491('0x2e')](function(){_0x35fd25[_0x0491('0x72')](function(_0xc15227){socket[_0x0491('0x73')](_0x0491('0x89'),{'UserId':_0xc15227,'SmsQueueId':_0x4d3265['id']});});});});});});})[_0x0491('0x2e')](respondWithStatusCode(_0x4b80e0,null))['catch'](handleError(_0x4b80e0,null));};exports[_0x0491('0x8a')]=function(_0x474fe8,_0x90213a,_0x441da8){return db[_0x0491('0x33')][_0x0491('0x53')]({'where':{'id':_0x474fe8[_0x0491('0x4b')]['id']}})['then'](handleEntityNotFound(_0x90213a,null))[_0x0491('0x2e')](function(_0x582f7b){if(_0x582f7b){return _0x582f7b[_0x0491('0x8a')](_0x474fe8['body'][_0x0491('0x68')],_[_0x0491('0x8b')](_0x474fe8[_0x0491('0x56')],[_0x0491('0x68'),'id'])||{})[_0x0491('0x8c')](function(_0x7af3ee){for(var _0x461b26=0x0;_0x461b26<_0x474fe8[_0x0491('0x56')][_0x0491('0x68')][_0x0491('0x3d')];_0x461b26+=0x1){socket['emit'](_0x0491('0x74'),{'UserId':Number(_0x474fe8[_0x0491('0x56')][_0x0491('0x68')][_0x461b26]),'SmsQueueId':Number(_0x474fe8[_0x0491('0x4b')]['id'])});}return _0x7af3ee;});}})[_0x0491('0x2e')](respondWithResult(_0x90213a,null))[_0x0491('0x4a')](handleError(_0x90213a,null));};exports[_0x0491('0x88')]=function(_0x907268,_0x3700e1,_0x3d0fa0){return db['SmsQueue']['find']({'where':{'id':_0x907268[_0x0491('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3700e1,null))[_0x0491('0x2e')](function(_0x453057){if(_0x453057){return _0x453057['removeAgents'](_0x907268[_0x0491('0x39')][_0x0491('0x68')])['then'](function(){if(_[_0x0491('0x8d')](_0x907268[_0x0491('0x39')][_0x0491('0x68')])){for(var _0x1021f=0x0;_0x1021f<_0x907268[_0x0491('0x39')]['ids'][_0x0491('0x3d')];_0x1021f+=0x1){socket[_0x0491('0x73')](_0x0491('0x89'),{'UserId':Number(_0x907268[_0x0491('0x39')]['ids'][_0x1021f]),'SmsQueueId':Number(_0x907268[_0x0491('0x4b')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x907268[_0x0491('0x39')]['ids']),'SmsQueueId':Number(_0x907268[_0x0491('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3700e1,null))[_0x0491('0x4a')](handleError(_0x3700e1,null));};exports[_0x0491('0x8e')]=function(_0x5c6f51,_0x3400e3,_0x544771){var _0x24bb69={};var _0x5bc6a3={};var _0x476986;var _0x47d365;return db[_0x0491('0x33')][_0x0491('0x59')]({'where':{'id':_0x5c6f51[_0x0491('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3400e3,null))[_0x0491('0x2e')](function(_0x46b7d3){if(_0x46b7d3){_0x476986=_0x46b7d3;_0x5bc6a3[_0x0491('0x37')]=_['keys'](db['User'][_0x0491('0x4d')]);_0x5bc6a3['query']=_[_0x0491('0x4c')](_0x5c6f51[_0x0491('0x39')]);_0x5bc6a3[_0x0491('0x42')]=_[_0x0491('0x3a')](_0x5bc6a3[_0x0491('0x37')],_0x5bc6a3['query']);_0x24bb69[_0x0491('0x3b')]=_['intersection'](_0x5bc6a3['model'],qs[_0x0491('0x3c')](_0x5c6f51[_0x0491('0x39')][_0x0491('0x3c')]));_0x24bb69[_0x0491('0x3b')]=_0x24bb69[_0x0491('0x3b')][_0x0491('0x3d')]?_0x24bb69[_0x0491('0x3b')]:_0x5bc6a3[_0x0491('0x37')];_0x24bb69['order']=qs['sort'](_0x5c6f51[_0x0491('0x39')]['sort']);_0x24bb69[_0x0491('0x41')]=qs['filters'](_[_0x0491('0x43')](_0x5c6f51['query'],_0x5bc6a3[_0x0491('0x42')]));if(_0x5c6f51[_0x0491('0x39')][_0x0491('0x44')]){_0x24bb69['where']=_[_0x0491('0x45')](_0x24bb69[_0x0491('0x41')],{'$or':_[_0x0491('0x38')](_0x24bb69['attributes'],function(_0x15e868){var _0x49d549={};_0x49d549[_0x15e868]={'$like':'%'+_0x5c6f51[_0x0491('0x39')][_0x0491('0x44')]+'%'};return _0x49d549;})});}_0x24bb69=_['merge']({},_0x24bb69,_0x5c6f51[_0x0491('0x47')]);return _0x476986[_0x0491('0x8e')](_0x24bb69);}})[_0x0491('0x2e')](function(_0x2f7c04){if(_0x2f7c04){_0x47d365=_0x2f7c04[_0x0491('0x3d')];if(!_0x5c6f51['query']['hasOwnProperty'](_0x0491('0x5b'))){_0x24bb69[_0x0491('0x23')]=qs['limit'](_0x5c6f51[_0x0491('0x39')][_0x0491('0x23')]);_0x24bb69['offset']=qs['offset'](_0x5c6f51[_0x0491('0x39')][_0x0491('0x22')]);}return _0x476986[_0x0491('0x8e')](_0x24bb69);}})[_0x0491('0x2e')](function(_0x3386d9){if(_0x3386d9){return _0x3386d9?{'count':_0x47d365,'rows':_0x3386d9}:null;}})['then'](respondWithResult(_0x3400e3,null))['catch'](handleError(_0x3400e3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 45e1c76..5941fde 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 _0xf02f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue'];(function(_0x51f3df,_0x4738f7){var _0x1ed740=function(_0x2fd7ab){while(--_0x2fd7ab){_0x51f3df['push'](_0x51f3df['shift']());}};_0x1ed740(++_0x4738f7);}(_0xf02f,0x152));var _0xff02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf02f[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xff02('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xff02('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xff02('0x2')](0x0);var events={'afterCreate':_0xff02('0x3'),'afterUpdate':_0xff02('0x4'),'afterDestroy':_0xff02('0x5')};function emitEvent(_0x1b1780){return function(_0x12019d,_0x4e2b8c,_0x134cce){SmsQueueEvents[_0xff02('0x6')](_0x1b1780+':'+_0x12019d['id'],_0x12019d);SmsQueueEvents[_0xff02('0x6')](_0x1b1780,_0x12019d);_0x134cce(null);};}for(var e in events){if(events[_0xff02('0x7')](e)){var event=events[e];SmsQueue[_0xff02('0x8')](e,emitEvent(event));}}module[_0xff02('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xcb00=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','save'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xcb00,0xcc));var _0x0cb0=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xcb00[_0x22eb96];return _0x5e1adf;};'use strict';var EventEmitter=require(_0x0cb0('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x0cb0('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0cb0('0x2'),'afterUpdate':_0x0cb0('0x3'),'afterDestroy':_0x0cb0('0x4')};function emitEvent(_0x5b3d55){return function(_0x5d1182,_0x5a6595,_0x4c3b8f){SmsQueueEvents[_0x0cb0('0x5')](_0x5b3d55+':'+_0x5d1182['id'],_0x5d1182);SmsQueueEvents[_0x0cb0('0x5')](_0x5b3d55,_0x5d1182);_0x4c3b8f(null);};}for(var e in events){if(events[_0x0cb0('0x6')](e)){var event=events[e];SmsQueue[_0x0cb0('0x7')](e,emitEvent(event));}}module[_0x0cb0('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index abff6ab..06a784c 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 _0x4bec=['util','api','moment','bluebird','request-promise','./smsQueue.attributes','sms_queues','lodash'];(function(_0x356977,_0x2980e8){var _0x504a6b=function(_0x3b763c){while(--_0x3b763c){_0x356977['push'](_0x356977['shift']());}};_0x504a6b(++_0x2980e8);}(_0x4bec,0x177));var _0xc4be=function(_0x1bc07d,_0x1766bb){_0x1bc07d=_0x1bc07d-0x0;var _0x2ffd82=_0x4bec[_0x1bc07d];return _0x2ffd82;};'use strict';var _=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var logger=require('../../config/logger')(_0xc4be('0x2'));var moment=require(_0xc4be('0x3'));var BPromise=require(_0xc4be('0x4'));var rp=require(_0xc4be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4be('0x6'));module['exports']=function(_0x43104f,_0x587958){return _0x43104f['define']('SmsQueue',attributes,{'tableName':_0xc4be('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ee6=['SmsQueue','lodash','util','api','bluebird','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x3c9a89,_0x378778){var _0x1eb47b=function(_0x57998a){while(--_0x57998a){_0x3c9a89['push'](_0x3c9a89['shift']());}};_0x1eb47b(++_0x378778);}(_0x9ee6,0xd3));var _0x69ee=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x9ee6[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x69ee('0x0'));var util=require(_0x69ee('0x1'));var logger=require('../../config/logger')(_0x69ee('0x2'));var moment=require('moment');var BPromise=require(_0x69ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x69ee('0x4'));var config=require(_0x69ee('0x5'));var attributes=require(_0x69ee('0x6'));module[_0x69ee('0x7')]=function(_0x239014,_0x377f89){return _0x239014[_0x69ee('0x8')](_0x69ee('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 1a43038..998204d 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 _0x46c5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map','ShowSmsQueue','raw','info','lodash','util','moment','bluebird','ioredis'];(function(_0x2f5943,_0xba490b){var _0x465b7b=function(_0x4d234d){while(--_0x4d234d){_0x2f5943['push'](_0x2f5943['shift']());}};_0x465b7b(++_0xba490b);}(_0x46c5,0xf7));var _0x546c=function(_0x43c40d,_0x16102c){_0x43c40d=_0x43c40d-0x0;var _0x374cd7=_0x46c5[_0x43c40d];return _0x374cd7;};'use strict';var _=require(_0x546c('0x0'));var util=require(_0x546c('0x1'));var moment=require(_0x546c('0x2'));var BPromise=require(_0x546c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x546c('0x4'));var db=require(_0x546c('0x5'))['db'];var utils=require(_0x546c('0x6'));var logger=require(_0x546c('0x7'))(_0x546c('0x8'));var config=require(_0x546c('0x9'));var jayson=require(_0x546c('0xa'));var client=jayson[_0x546c('0xb')]['http']({'port':0x232a});config[_0x546c('0xc')]=_[_0x546c('0xd')](config[_0x546c('0xc')],{'host':_0x546c('0xe'),'port':0x18eb});var socket=require(_0x546c('0xf'))(new Redis(config[_0x546c('0xc')]));require(_0x546c('0x10'))['register'](socket);function respondWithRpcPromise(_0x26496b,_0xe82c2e,_0x270214){return new BPromise(function(_0xec9233,_0x3b3c63){return client[_0x546c('0x11')](_0x26496b,_0x270214)[_0x546c('0x12')](function(_0x1406de){logger['info'](_0x546c('0x13'),_0xe82c2e,_0x546c('0x14'));logger[_0x546c('0x15')](_0x546c('0x16'),_0xe82c2e,_0x546c('0x14'),JSON[_0x546c('0x17')](_0x1406de));if(_0x1406de[_0x546c('0x18')]){if(_0x1406de[_0x546c('0x18')][_0x546c('0x19')]===0x1f4){logger[_0x546c('0x18')]('SmsQueue,\x20%s,\x20%s',_0xe82c2e,_0x1406de['error'][_0x546c('0x1a')]);return _0x3b3c63(_0x1406de[_0x546c('0x18')][_0x546c('0x1a')]);}logger['error'](_0x546c('0x13'),_0xe82c2e,_0x1406de[_0x546c('0x18')][_0x546c('0x1a')]);return _0xec9233(_0x1406de[_0x546c('0x18')][_0x546c('0x1a')]);}else{logger['info'](_0x546c('0x13'),_0xe82c2e,'request\x20sent');_0xec9233(_0x1406de[_0x546c('0x1b')][_0x546c('0x1a')]);}})[_0x546c('0x1c')](function(_0xb5bdac){logger['error'](_0x546c('0x13'),_0xe82c2e,_0xb5bdac);_0x3b3c63(_0xb5bdac);});});}exports[_0x546c('0x1d')]=function(_0x317273){var _0x27b646=this;return new Promise(function(_0x59e1af,_0x530459){return db[_0x546c('0x1e')][_0x546c('0x1f')]({'raw':_0x317273[_0x546c('0x20')]?_0x317273['options']['raw']===undefined?!![]:![]:!![],'where':_0x317273['options']?_0x317273[_0x546c('0x20')][_0x546c('0x21')]||null:null,'attributes':_0x317273[_0x546c('0x20')]?_0x317273[_0x546c('0x20')][_0x546c('0x22')]||null:null,'limit':_0x317273['options']?_0x317273[_0x546c('0x20')][_0x546c('0x23')]||null:null,'include':_0x317273['options']?_0x317273[_0x546c('0x20')]['include']?_['map'](_0x317273[_0x546c('0x20')][_0x546c('0x24')],function(_0x680b2b){return{'model':db[_0x680b2b[_0x546c('0x25')]],'as':_0x680b2b['as'],'attributes':_0x680b2b[_0x546c('0x22')],'include':_0x680b2b[_0x546c('0x24')]?_[_0x546c('0x26')](_0x680b2b[_0x546c('0x24')],function(_0x39b44a){return{'model':db[_0x39b44a['model']],'as':_0x39b44a['as'],'attributes':_0x39b44a['attributes'],'include':_0x39b44a[_0x546c('0x24')]?_[_0x546c('0x26')](_0x39b44a[_0x546c('0x24')],function(_0xe52bc7){return{'model':db[_0xe52bc7[_0x546c('0x25')]],'as':_0xe52bc7['as'],'attributes':_0xe52bc7[_0x546c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bb9d2){logger['info'](_0x546c('0x1d'),_0x317273);logger[_0x546c('0x15')]('GetSmsQueue',_0x317273,JSON[_0x546c('0x17')](_0x5bb9d2));_0x59e1af(_0x5bb9d2);})[_0x546c('0x1c')](function(_0x38a98d){logger['error'](_0x546c('0x1d'),_0x38a98d[_0x546c('0x1a')],_0x317273);_0x530459(_0x27b646[_0x546c('0x18')](0x1f4,_0x38a98d[_0x546c('0x1a')]));});});};exports[_0x546c('0x27')]=function(_0x4c5d5c){var _0x33c23f=this;return new Promise(function(_0x1690b7,_0x7f41ef){return db['SmsQueue']['find']({'raw':_0x4c5d5c[_0x546c('0x20')]?_0x4c5d5c[_0x546c('0x20')][_0x546c('0x28')]===undefined?!![]:![]:!![],'where':_0x4c5d5c['options']?_0x4c5d5c[_0x546c('0x20')][_0x546c('0x21')]||null:null,'attributes':_0x4c5d5c['options']?_0x4c5d5c['options'][_0x546c('0x22')]||null:null,'include':_0x4c5d5c[_0x546c('0x20')]?_0x4c5d5c[_0x546c('0x20')][_0x546c('0x24')]?_[_0x546c('0x26')](_0x4c5d5c[_0x546c('0x20')]['include'],function(_0x580ecb){return{'model':db[_0x580ecb[_0x546c('0x25')]],'as':_0x580ecb['as'],'attributes':_0x580ecb[_0x546c('0x22')],'include':_0x580ecb[_0x546c('0x24')]?_[_0x546c('0x26')](_0x580ecb['include'],function(_0x57fd13){return{'model':db[_0x57fd13[_0x546c('0x25')]],'as':_0x57fd13['as'],'attributes':_0x57fd13[_0x546c('0x22')],'include':_0x57fd13[_0x546c('0x24')]?_['map'](_0x57fd13[_0x546c('0x24')],function(_0xd6522a){return{'model':db[_0xd6522a[_0x546c('0x25')]],'as':_0xd6522a['as'],'attributes':_0xd6522a[_0x546c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452d02){logger[_0x546c('0x29')](_0x546c('0x27'),_0x4c5d5c);logger[_0x546c('0x15')](_0x546c('0x27'),_0x4c5d5c,JSON[_0x546c('0x17')](_0x452d02));_0x1690b7(_0x452d02);})['catch'](function(_0x4cb1c2){logger[_0x546c('0x18')](_0x546c('0x27'),_0x4cb1c2[_0x546c('0x1a')],_0x4c5d5c);_0x7f41ef(_0x33c23f[_0x546c('0x18')](0x1f4,_0x4cb1c2[_0x546c('0x1a')]));});});}; \ No newline at end of file +var _0x207d=['GetSmsQueue','SmsQueue','options','where','attributes','limit','include','map','model','then','info','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./smsQueue.socket','register','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch'];(function(_0x2304d8,_0x5eea69){var _0x4c1bb8=function(_0x27fd47){while(--_0x27fd47){_0x2304d8['push'](_0x2304d8['shift']());}};_0x4c1bb8(++_0x5eea69);}(_0x207d,0xa6));var _0xd207=function(_0x5dd01c,_0x191ef4){_0x5dd01c=_0x5dd01c-0x0;var _0x2934ba=_0x207d[_0x5dd01c];return _0x2934ba;};'use strict';var _=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var moment=require(_0xd207('0x2'));var BPromise=require(_0xd207('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd207('0x4'));var db=require(_0xd207('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd207('0x6'))(_0xd207('0x7'));var config=require(_0xd207('0x8'));var jayson=require(_0xd207('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd207('0xa')]=_[_0xd207('0xb')](config[_0xd207('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd207('0xc'))(new Redis(config['redis']));require(_0xd207('0xd'))[_0xd207('0xe')](socket);function respondWithRpcPromise(_0x284699,_0x5ee5b9,_0x307a83){return new BPromise(function(_0x49fbd5,_0x410153){return client['request'](_0x284699,_0x307a83)['then'](function(_0x29b468){logger['info']('SmsQueue,\x20%s,\x20%s',_0x5ee5b9,'request\x20sent');logger[_0xd207('0xf')](_0xd207('0x10'),_0x5ee5b9,_0xd207('0x11'),JSON['stringify'](_0x29b468));if(_0x29b468[_0xd207('0x12')]){if(_0x29b468[_0xd207('0x12')][_0xd207('0x13')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x5ee5b9,_0x29b468[_0xd207('0x12')]['message']);return _0x410153(_0x29b468[_0xd207('0x12')][_0xd207('0x14')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x5ee5b9,_0x29b468['error'][_0xd207('0x14')]);return _0x49fbd5(_0x29b468['error']['message']);}else{logger['info'](_0xd207('0x15'),_0x5ee5b9,_0xd207('0x11'));_0x49fbd5(_0x29b468[_0xd207('0x16')][_0xd207('0x14')]);}})[_0xd207('0x17')](function(_0x23197c){logger[_0xd207('0x12')](_0xd207('0x15'),_0x5ee5b9,_0x23197c);_0x410153(_0x23197c);});});}exports[_0xd207('0x18')]=function(_0x40b340){var _0x8d7c2b=this;return new Promise(function(_0x48dd7b,_0x8c8de7){return db[_0xd207('0x19')]['findAll']({'raw':_0x40b340[_0xd207('0x1a')]?_0x40b340['options']['raw']===undefined?!![]:![]:!![],'where':_0x40b340[_0xd207('0x1a')]?_0x40b340[_0xd207('0x1a')][_0xd207('0x1b')]||null:null,'attributes':_0x40b340[_0xd207('0x1a')]?_0x40b340[_0xd207('0x1a')][_0xd207('0x1c')]||null:null,'limit':_0x40b340[_0xd207('0x1a')]?_0x40b340[_0xd207('0x1a')][_0xd207('0x1d')]||null:null,'include':_0x40b340[_0xd207('0x1a')]?_0x40b340[_0xd207('0x1a')][_0xd207('0x1e')]?_[_0xd207('0x1f')](_0x40b340[_0xd207('0x1a')][_0xd207('0x1e')],function(_0x49e04a){return{'model':db[_0x49e04a[_0xd207('0x20')]],'as':_0x49e04a['as'],'attributes':_0x49e04a[_0xd207('0x1c')],'include':_0x49e04a[_0xd207('0x1e')]?_['map'](_0x49e04a['include'],function(_0x523d3e){return{'model':db[_0x523d3e['model']],'as':_0x523d3e['as'],'attributes':_0x523d3e[_0xd207('0x1c')],'include':_0x523d3e[_0xd207('0x1e')]?_[_0xd207('0x1f')](_0x523d3e[_0xd207('0x1e')],function(_0x49f228){return{'model':db[_0x49f228[_0xd207('0x20')]],'as':_0x49f228['as'],'attributes':_0x49f228[_0xd207('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd207('0x21')](function(_0x37c703){logger[_0xd207('0x22')](_0xd207('0x18'),_0x40b340);logger[_0xd207('0xf')](_0xd207('0x18'),_0x40b340,JSON['stringify'](_0x37c703));_0x48dd7b(_0x37c703);})['catch'](function(_0x5caaa5){logger[_0xd207('0x12')](_0xd207('0x18'),_0x5caaa5['message'],_0x40b340);_0x8c8de7(_0x8d7c2b['error'](0x1f4,_0x5caaa5[_0xd207('0x14')]));});});};exports[_0xd207('0x23')]=function(_0x1367dd){var _0x14f930=this;return new Promise(function(_0x44e198,_0x42ab92){return db[_0xd207('0x19')][_0xd207('0x24')]({'raw':_0x1367dd['options']?_0x1367dd[_0xd207('0x1a')][_0xd207('0x25')]===undefined?!![]:![]:!![],'where':_0x1367dd['options']?_0x1367dd[_0xd207('0x1a')]['where']||null:null,'attributes':_0x1367dd['options']?_0x1367dd['options']['attributes']||null:null,'include':_0x1367dd[_0xd207('0x1a')]?_0x1367dd['options'][_0xd207('0x1e')]?_[_0xd207('0x1f')](_0x1367dd[_0xd207('0x1a')]['include'],function(_0x29d31a){return{'model':db[_0x29d31a[_0xd207('0x20')]],'as':_0x29d31a['as'],'attributes':_0x29d31a['attributes'],'include':_0x29d31a[_0xd207('0x1e')]?_[_0xd207('0x1f')](_0x29d31a[_0xd207('0x1e')],function(_0x3f8a7a){return{'model':db[_0x3f8a7a[_0xd207('0x20')]],'as':_0x3f8a7a['as'],'attributes':_0x3f8a7a['attributes'],'include':_0x3f8a7a[_0xd207('0x1e')]?_[_0xd207('0x1f')](_0x3f8a7a[_0xd207('0x1e')],function(_0x280bd1){return{'model':db[_0x280bd1[_0xd207('0x20')]],'as':_0x280bd1['as'],'attributes':_0x280bd1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd207('0x21')](function(_0x57bd7c){logger['info']('ShowSmsQueue',_0x1367dd);logger[_0xd207('0xf')](_0xd207('0x23'),_0x1367dd,JSON['stringify'](_0x57bd7c));_0x44e198(_0x57bd7c);})[_0xd207('0x17')](function(_0x1888ee){logger[_0xd207('0x12')]('ShowSmsQueue',_0x1888ee['message'],_0x1367dd);_0x42ab92(_0x14f930['error'](0x1f4,_0x1888ee['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index aaad53d..45c9436 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 _0xce9b=['remove','update','emit','removeListener','register','length','smsQueue:','save'];(function(_0x3285bb,_0x421249){var _0x418a97=function(_0x5178fd){while(--_0x5178fd){_0x3285bb['push'](_0x3285bb['shift']());}};_0x418a97(++_0x421249);}(_0xce9b,0x8f));var _0xbce9=function(_0x2f969a,_0x914ee0){_0x2f969a=_0x2f969a-0x0;var _0x155edf=_0xce9b[_0x2f969a];return _0x155edf;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xbce9('0x0'),_0xbce9('0x1'),_0xbce9('0x2')];function createListener(_0x17bc20,_0x4be950){return function(_0x55a280){_0x4be950[_0xbce9('0x3')](_0x17bc20,_0x55a280);};}function removeListener(_0x50f794,_0x273dac){return function(){SmsQueueEvents[_0xbce9('0x4')](_0x50f794,_0x273dac);};}exports[_0xbce9('0x5')]=function(_0x439b51){for(var _0x38adcd=0x0,_0x1b3bfd=events[_0xbce9('0x6')];_0x38adcd<_0x1b3bfd;_0x38adcd++){var _0x52ae23=events[_0x38adcd];var _0x411784=createListener(_0xbce9('0x7')+_0x52ae23,_0x439b51);SmsQueueEvents['on'](_0x52ae23,_0x411784);}}; \ No newline at end of file +var _0x56c7=['remove','removeListener','length','./smsQueue.events'];(function(_0xee23b5,_0x2f45b4){var _0x2150bb=function(_0x341630){while(--_0x341630){_0xee23b5['push'](_0xee23b5['shift']());}};_0x2150bb(++_0x2f45b4);}(_0x56c7,0x12b));var _0x756c=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x56c7[_0x2b8347];return _0x15e93e;};'use strict';var SmsQueueEvents=require(_0x756c('0x0'));var events=['save',_0x756c('0x1'),'update'];function createListener(_0x10bdca,_0x497960){return function(_0x1bd862){_0x497960['emit'](_0x10bdca,_0x1bd862);};}function removeListener(_0x3bcd2c,_0x277ff4){return function(){SmsQueueEvents[_0x756c('0x2')](_0x3bcd2c,_0x277ff4);};}exports['register']=function(_0x1099d5){for(var _0x34ec83=0x0,_0x2e8a0c=events[_0x756c('0x3')];_0x34ec83<_0x2e8a0c;_0x34ec83++){var _0x3f1b75=events[_0x34ec83];var _0x24af89=createListener('smsQueue:'+_0x3f1b75,_0x1099d5);SmsQueueEvents['on'](_0x3f1b75,_0x24af89);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 267a2d8..81a8319 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 _0x584f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x28ddff,_0xad2582){var _0x7efc36=function(_0x47b688){while(--_0x47b688){_0x28ddff['push'](_0x28ddff['shift']());}};_0x7efc36(++_0xad2582);}(_0x584f,0x108));var _0xf584=function(_0xeb76d0,_0x36a3b0){_0xeb76d0=_0xeb76d0-0x0;var _0x22f589=_0x584f[_0xeb76d0];return _0x22f589;};'use strict';var multer=require(_0xf584('0x0'));var util=require(_0xf584('0x1'));var path=require('path');var timeout=require(_0xf584('0x2'));var express=require(_0xf584('0x3'));var router=express[_0xf584('0x4')]();var fs_extra=require(_0xf584('0x5'));var auth=require(_0xf584('0x6'));var interaction=require(_0xf584('0x7'));var config=require(_0xf584('0x8'));var controller=require('./smsQueueReport.controller');router[_0xf584('0x9')]('/',auth[_0xf584('0xa')](),controller[_0xf584('0xb')]);router[_0xf584('0x9')](_0xf584('0xc'),auth[_0xf584('0xa')](),controller[_0xf584('0xd')]);router[_0xf584('0x9')](_0xf584('0xe'),auth[_0xf584('0xa')](),controller[_0xf584('0xf')]);router[_0xf584('0x10')]('/',auth['isAuthenticated'](),controller[_0xf584('0x11')]);router[_0xf584('0x12')](_0xf584('0xe'),auth[_0xf584('0xa')](),controller[_0xf584('0x13')]);router[_0xf584('0x14')](_0xf584('0xe'),auth[_0xf584('0xa')](),controller['destroy']);module[_0xf584('0x15')]=router; \ No newline at end of file +var _0x1856=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x262ca9,_0x27f4c3){var _0x2fccd9=function(_0x29470d){while(--_0x29470d){_0x262ca9['push'](_0x262ca9['shift']());}};_0x2fccd9(++_0x27f4c3);}(_0x1856,0x121));var _0x6185=function(_0x5e37a8,_0x3499ee){_0x5e37a8=_0x5e37a8-0x0;var _0x140fc4=_0x1856[_0x5e37a8];return _0x140fc4;};'use strict';var multer=require(_0x6185('0x0'));var util=require(_0x6185('0x1'));var path=require(_0x6185('0x2'));var timeout=require('connect-timeout');var express=require(_0x6185('0x3'));var router=express[_0x6185('0x4')]();var fs_extra=require(_0x6185('0x5'));var auth=require(_0x6185('0x6'));var interaction=require(_0x6185('0x7'));var config=require(_0x6185('0x8'));var controller=require(_0x6185('0x9'));router[_0x6185('0xa')]('/',auth[_0x6185('0xb')](),controller['index']);router[_0x6185('0xa')](_0x6185('0xc'),auth[_0x6185('0xb')](),controller[_0x6185('0xd')]);router['get'](_0x6185('0xe'),auth[_0x6185('0xb')](),controller[_0x6185('0xf')]);router[_0x6185('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6185('0x11')](_0x6185('0xe'),auth[_0x6185('0xb')](),controller[_0x6185('0x12')]);router[_0x6185('0x13')](_0x6185('0xe'),auth[_0x6185('0xb')](),controller[_0x6185('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6e1b600..aa0dcaa 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 _0x63cb=['sequelize','exports','STRING','DATE','moment'];(function(_0x5331a9,_0x4cdbd8){var _0x3c8423=function(_0x1539c1){while(--_0x1539c1){_0x5331a9['push'](_0x5331a9['shift']());}};_0x3c8423(++_0x4cdbd8);}(_0x63cb,0x158));var _0xb63c=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x63cb[_0xc67528];return _0x38e26d;};'use strict';var moment=require(_0xb63c('0x0'));var Sequelize=require(_0xb63c('0x1'));module[_0xb63c('0x2')]={'uniqueid':{'type':Sequelize[_0xb63c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb63c('0x3')]},'joinAt':{'type':Sequelize[_0xb63c('0x4')]},'leaveAt':{'type':Sequelize[_0xb63c('0x4')]},'acceptAt':{'type':Sequelize[_0xb63c('0x4')]},'exitAt':{'type':Sequelize[_0xb63c('0x4')]},'reason':{'type':Sequelize[_0xb63c('0x3')]}}; \ No newline at end of file +var _0x3e38=['moment','sequelize','exports','STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e38,0x78));var _0x83e3=function(_0x11073e,_0x137bf2){_0x11073e=_0x11073e-0x0;var _0x1e0b8e=_0x3e38[_0x11073e];return _0x1e0b8e;};'use strict';var moment=require(_0x83e3('0x0'));var Sequelize=require(_0x83e3('0x1'));module[_0x83e3('0x2')]={'uniqueid':{'type':Sequelize[_0x83e3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x83e3('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x83e3('0x4')]},'acceptAt':{'type':Sequelize[_0x83e3('0x4')]},'exitAt':{'type':Sequelize[_0x83e3('0x4')]},'reason':{'type':Sequelize[_0x83e3('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 138e34c..c5b221c 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 _0xbdd3=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x4d9bbd,_0x32d443){var _0x46e611=function(_0x5d38cb){while(--_0x5d38cb){_0x4d9bbd['push'](_0x4d9bbd['shift']());}};_0x46e611(++_0x32d443);}(_0xbdd3,0x1bd));var _0x3bdd=function(_0x4417ba,_0x45c1e2){_0x4417ba=_0x4417ba-0x0;var _0x88b88d=_0xbdd3[_0x4417ba];return _0x88b88d;};'use strict';var emlformat=require(_0x3bdd('0x0'));var rimraf=require(_0x3bdd('0x1'));var zipdir=require(_0x3bdd('0x2'));var jsonpatch=require(_0x3bdd('0x3'));var rp=require(_0x3bdd('0x4'));var moment=require(_0x3bdd('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3bdd('0x6'));var path=require(_0x3bdd('0x7'));var sox=require(_0x3bdd('0x8'));var csv=require(_0x3bdd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bdd('0xa'));var _=require(_0x3bdd('0xb'));var squel=require(_0x3bdd('0xc'));var crypto=require(_0x3bdd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3bdd('0xe'));var toCsv=require(_0x3bdd('0x9'));var querystring=require(_0x3bdd('0xf'));var Papa=require(_0x3bdd('0x10'));var Redis=require('ioredis');var authService=require(_0x3bdd('0x11'));var qs=require(_0x3bdd('0x12'));var as=require(_0x3bdd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bdd('0x14'))('api');var utils=require(_0x3bdd('0x15'));var config=require(_0x3bdd('0x16'));var licenseUtil=require(_0x3bdd('0x17'));var db=require(_0x3bdd('0x18'))['db'];function respondWithStatusCode(_0x202b4a,_0x2b30cf){_0x2b30cf=_0x2b30cf||0xcc;return function(_0x135462){if(_0x135462){return _0x202b4a[_0x3bdd('0x19')](_0x2b30cf);}return _0x202b4a['status'](_0x2b30cf)['end']();};}function respondWithResult(_0x29c218,_0x569098){_0x569098=_0x569098||0xc8;return function(_0x3ec803){if(_0x3ec803){return _0x29c218[_0x3bdd('0x1a')](_0x569098)[_0x3bdd('0x1b')](_0x3ec803);}};}function respondWithFilteredResult(_0x203fac,_0x2b19fe){return function(_0xa4733e){if(_0xa4733e){var _0x2b2781=typeof _0x2b19fe[_0x3bdd('0x1c')]===_0x3bdd('0x1d')&&typeof _0x2b19fe[_0x3bdd('0x1e')]===_0x3bdd('0x1d');var _0x11663b=_0xa4733e[_0x3bdd('0x1f')];var _0x2fffbc=_0x2b2781?0x0:_0x2b19fe['offset'];var _0x56592e=_0x2b2781?_0xa4733e[_0x3bdd('0x1f')]:_0x2b19fe[_0x3bdd('0x1c')]+_0x2b19fe[_0x3bdd('0x1e')];var _0x4a332e;if(_0x56592e>=_0x11663b){_0x56592e=_0x11663b;_0x4a332e=0xc8;}else{_0x4a332e=0xce;}_0x203fac[_0x3bdd('0x1a')](_0x4a332e);return _0x203fac[_0x3bdd('0x20')](_0x3bdd('0x21'),_0x2fffbc+'-'+_0x56592e+'/'+_0x11663b)['json'](_0xa4733e);}return null;};}function patchUpdates(_0x330912){return function(_0x451698){try{jsonpatch[_0x3bdd('0x22')](_0x451698,_0x330912,!![]);}catch(_0x294057){return BPromise[_0x3bdd('0x23')](_0x294057);}return _0x451698[_0x3bdd('0x24')]();};}function saveUpdates(_0x41c8ce,_0x276075){return function(_0x4585c0){if(_0x4585c0){return _0x4585c0[_0x3bdd('0x25')](_0x41c8ce)[_0x3bdd('0x26')](function(_0x5488be){return _0x5488be;});}return null;};}function removeEntity(_0x1415a3,_0x53fba5){return function(_0x7dbebd){if(_0x7dbebd){return _0x7dbebd[_0x3bdd('0x27')]()[_0x3bdd('0x26')](function(){_0x1415a3[_0x3bdd('0x1a')](0xcc)[_0x3bdd('0x28')]();});}};}function handleEntityNotFound(_0x1dc43c,_0x1a6b74){return function(_0xd4f101){if(!_0xd4f101){_0x1dc43c[_0x3bdd('0x19')](0x194);}return _0xd4f101;};}function handleError(_0x292ec0,_0x23f6c8){_0x23f6c8=_0x23f6c8||0x1f4;return function(_0x5c50eb){logger[_0x3bdd('0x29')](_0x5c50eb['stack']);if(_0x5c50eb[_0x3bdd('0x2a')]){delete _0x5c50eb[_0x3bdd('0x2a')];}_0x292ec0[_0x3bdd('0x1a')](_0x23f6c8)['send'](_0x5c50eb);};}exports[_0x3bdd('0x2b')]=function(_0x5d0ac6,_0x1865b8){var _0x4a9baf={},_0x450aac={},_0x4075d0={'count':0x0,'rows':[]};var _0x1d2e42=_[_0x3bdd('0x2c')](db[_0x3bdd('0x2d')][_0x3bdd('0x2e')],function(_0x17d153){return{'name':_0x17d153[_0x3bdd('0x2f')],'type':_0x17d153[_0x3bdd('0x30')][_0x3bdd('0x31')]};});_0x450aac[_0x3bdd('0x32')]=_[_0x3bdd('0x2c')](_0x1d2e42,'name');_0x450aac[_0x3bdd('0x33')]=_[_0x3bdd('0x34')](_0x5d0ac6['query']);_0x450aac[_0x3bdd('0x35')]=_['intersection'](_0x450aac[_0x3bdd('0x32')],_0x450aac[_0x3bdd('0x33')]);_0x4a9baf[_0x3bdd('0x36')]=_['intersection'](_0x450aac['model'],qs[_0x3bdd('0x37')](_0x5d0ac6[_0x3bdd('0x33')][_0x3bdd('0x37')]));_0x4a9baf['attributes']=_0x4a9baf[_0x3bdd('0x36')][_0x3bdd('0x38')]?_0x4a9baf[_0x3bdd('0x36')]:_0x450aac[_0x3bdd('0x32')];if(!_0x5d0ac6[_0x3bdd('0x33')][_0x3bdd('0x39')](_0x3bdd('0x3a'))){_0x4a9baf[_0x3bdd('0x1e')]=qs[_0x3bdd('0x1e')](_0x5d0ac6['query'][_0x3bdd('0x1e')]);_0x4a9baf['offset']=qs['offset'](_0x5d0ac6[_0x3bdd('0x33')][_0x3bdd('0x1c')]);}_0x4a9baf['order']=qs[_0x3bdd('0x3b')](_0x5d0ac6['query'][_0x3bdd('0x3b')]);_0x4a9baf['where']=qs[_0x3bdd('0x35')](_[_0x3bdd('0x3c')](_0x5d0ac6['query'],_0x450aac[_0x3bdd('0x35')]),_0x1d2e42);if(_0x5d0ac6['query'][_0x3bdd('0x3d')]){_0x4a9baf['where']=_[_0x3bdd('0x3e')](_0x4a9baf[_0x3bdd('0x3f')],{'$or':_[_0x3bdd('0x2c')](_0x1d2e42,function(_0x1e5273){if(_0x1e5273[_0x3bdd('0x30')]!==_0x3bdd('0x40')){var _0x322195={};_0x322195[_0x1e5273[_0x3bdd('0x2a')]]={'$like':'%'+_0x5d0ac6[_0x3bdd('0x33')]['filter']+'%'};return _0x322195;}})});}_0x4a9baf=_['merge']({},_0x4a9baf,_0x5d0ac6[_0x3bdd('0x41')]);var _0x4e6b67={'where':_0x4a9baf[_0x3bdd('0x3f')]};return db[_0x3bdd('0x2d')][_0x3bdd('0x1f')](_0x4e6b67)[_0x3bdd('0x26')](function(_0x2bc99c){_0x4075d0[_0x3bdd('0x1f')]=_0x2bc99c;if(_0x5d0ac6[_0x3bdd('0x33')][_0x3bdd('0x42')]){_0x4a9baf[_0x3bdd('0x43')]=[{'all':!![]}];}return db[_0x3bdd('0x2d')][_0x3bdd('0x44')](_0x4a9baf);})['then'](function(_0x1dd148){_0x4075d0[_0x3bdd('0x45')]=_0x1dd148;return _0x4075d0;})[_0x3bdd('0x26')](respondWithFilteredResult(_0x1865b8,_0x4a9baf))[_0x3bdd('0x46')](handleError(_0x1865b8,null));};exports[_0x3bdd('0x47')]=function(_0x141ecf,_0x484d9a){var _0x118baf={'raw':!![],'where':{'id':_0x141ecf[_0x3bdd('0x48')]['id']}},_0xbf9891={};_0xbf9891[_0x3bdd('0x32')]=_['keys'](db[_0x3bdd('0x2d')][_0x3bdd('0x2e')]);_0xbf9891['query']=_[_0x3bdd('0x34')](_0x141ecf[_0x3bdd('0x33')]);_0xbf9891['filters']=_[_0x3bdd('0x49')](_0xbf9891[_0x3bdd('0x32')],_0xbf9891[_0x3bdd('0x33')]);_0x118baf['attributes']=_['intersection'](_0xbf9891[_0x3bdd('0x32')],qs[_0x3bdd('0x37')](_0x141ecf[_0x3bdd('0x33')][_0x3bdd('0x37')]));_0x118baf[_0x3bdd('0x36')]=_0x118baf['attributes'][_0x3bdd('0x38')]?_0x118baf[_0x3bdd('0x36')]:_0xbf9891[_0x3bdd('0x32')];if(_0x141ecf[_0x3bdd('0x33')][_0x3bdd('0x42')]){_0x118baf['include']=[{'all':!![]}];}_0x118baf=_[_0x3bdd('0x3e')]({},_0x118baf,_0x141ecf[_0x3bdd('0x41')]);return db[_0x3bdd('0x2d')][_0x3bdd('0x4a')](_0x118baf)[_0x3bdd('0x26')](handleEntityNotFound(_0x484d9a,null))['then'](respondWithResult(_0x484d9a,null))[_0x3bdd('0x46')](handleError(_0x484d9a,null));};exports[_0x3bdd('0x4b')]=function(_0x4ab44e,_0x13912){return db[_0x3bdd('0x2d')]['create'](_0x4ab44e['body'],{})[_0x3bdd('0x26')](respondWithResult(_0x13912,0xc9))[_0x3bdd('0x46')](handleError(_0x13912,null));};exports['update']=function(_0x15b214,_0x88673){if(_0x15b214[_0x3bdd('0x4c')]['id']){delete _0x15b214[_0x3bdd('0x4c')]['id'];}return db['SmsQueueReport'][_0x3bdd('0x4a')]({'where':{'id':_0x15b214['params']['id']}})[_0x3bdd('0x26')](handleEntityNotFound(_0x88673,null))[_0x3bdd('0x26')](saveUpdates(_0x15b214[_0x3bdd('0x4c')],null))[_0x3bdd('0x26')](respondWithResult(_0x88673,null))[_0x3bdd('0x46')](handleError(_0x88673,null));};exports[_0x3bdd('0x27')]=function(_0x17dc6e,_0x5c4bc4){return db['SmsQueueReport'][_0x3bdd('0x4a')]({'where':{'id':_0x17dc6e['params']['id']}})[_0x3bdd('0x26')](handleEntityNotFound(_0x5c4bc4,null))[_0x3bdd('0x26')](removeEntity(_0x5c4bc4,null))[_0x3bdd('0x46')](handleError(_0x5c4bc4,null));};exports['describe']=function(_0x517c2b,_0x1cda02){return db[_0x3bdd('0x2d')][_0x3bdd('0x4d')]()[_0x3bdd('0x26')](respondWithResult(_0x1cda02,null))[_0x3bdd('0x46')](handleError(_0x1cda02,null));}; \ No newline at end of file +var _0x4d29=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','then','destroy','end','stack','send','index','map','SmsQueueReport','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4d29,0x86));var _0x94d2=function(_0x19ff81,_0x51d764){_0x19ff81=_0x19ff81-0x0;var _0x356670=_0x4d29[_0x19ff81];return _0x356670;};'use strict';var emlformat=require(_0x94d2('0x0'));var rimraf=require(_0x94d2('0x1'));var zipdir=require(_0x94d2('0x2'));var jsonpatch=require(_0x94d2('0x3'));var rp=require(_0x94d2('0x4'));var moment=require(_0x94d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x94d2('0x6'));var util=require(_0x94d2('0x7'));var path=require(_0x94d2('0x8'));var sox=require('sox');var csv=require(_0x94d2('0x9'));var ejs=require(_0x94d2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94d2('0xb'));var squel=require(_0x94d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x94d2('0xd'));var deskjs=require(_0x94d2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x94d2('0xf'));var Papa=require(_0x94d2('0x10'));var Redis=require(_0x94d2('0x11'));var authService=require(_0x94d2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94d2('0x13'));var logger=require(_0x94d2('0x14'))(_0x94d2('0x15'));var utils=require(_0x94d2('0x16'));var config=require(_0x94d2('0x17'));var licenseUtil=require(_0x94d2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2da33c,_0x93359a){_0x93359a=_0x93359a||0xcc;return function(_0x342591){if(_0x342591){return _0x2da33c[_0x94d2('0x19')](_0x93359a);}return _0x2da33c[_0x94d2('0x1a')](_0x93359a)['end']();};}function respondWithResult(_0x540e52,_0x5bdd03){_0x5bdd03=_0x5bdd03||0xc8;return function(_0x40b568){if(_0x40b568){return _0x540e52[_0x94d2('0x1a')](_0x5bdd03)['json'](_0x40b568);}};}function respondWithFilteredResult(_0x5f4b46,_0x57cf6a){return function(_0x323cad){if(_0x323cad){var _0x6cd19a=typeof _0x57cf6a[_0x94d2('0x1b')]===_0x94d2('0x1c')&&typeof _0x57cf6a[_0x94d2('0x1d')]===_0x94d2('0x1c');var _0x5b2d4d=_0x323cad['count'];var _0x473247=_0x6cd19a?0x0:_0x57cf6a[_0x94d2('0x1b')];var _0x6d3074=_0x6cd19a?_0x323cad['count']:_0x57cf6a['offset']+_0x57cf6a['limit'];var _0x397c28;if(_0x6d3074>=_0x5b2d4d){_0x6d3074=_0x5b2d4d;_0x397c28=0xc8;}else{_0x397c28=0xce;}_0x5f4b46['status'](_0x397c28);return _0x5f4b46[_0x94d2('0x1e')]('Content-Range',_0x473247+'-'+_0x6d3074+'/'+_0x5b2d4d)[_0x94d2('0x1f')](_0x323cad);}return null;};}function patchUpdates(_0x37d38a){return function(_0x267239){try{jsonpatch[_0x94d2('0x20')](_0x267239,_0x37d38a,!![]);}catch(_0x5dbab9){return BPromise[_0x94d2('0x21')](_0x5dbab9);}return _0x267239[_0x94d2('0x22')]();};}function saveUpdates(_0x107017,_0x389e6d){return function(_0x59e73a){if(_0x59e73a){return _0x59e73a['update'](_0x107017)[_0x94d2('0x23')](function(_0x26f3d8){return _0x26f3d8;});}return null;};}function removeEntity(_0x2b6b07,_0x1ea8ae){return function(_0x3cd6e2){if(_0x3cd6e2){return _0x3cd6e2[_0x94d2('0x24')]()[_0x94d2('0x23')](function(){_0x2b6b07[_0x94d2('0x1a')](0xcc)[_0x94d2('0x25')]();});}};}function handleEntityNotFound(_0x159c46,_0x14bc16){return function(_0x1d24e9){if(!_0x1d24e9){_0x159c46[_0x94d2('0x19')](0x194);}return _0x1d24e9;};}function handleError(_0x2bddb9,_0x4ca849){_0x4ca849=_0x4ca849||0x1f4;return function(_0x3c4c0c){logger['error'](_0x3c4c0c[_0x94d2('0x26')]);if(_0x3c4c0c['name']){delete _0x3c4c0c['name'];}_0x2bddb9['status'](_0x4ca849)[_0x94d2('0x27')](_0x3c4c0c);};}exports[_0x94d2('0x28')]=function(_0x107d56,_0x541b02){var _0xb18407={},_0x300e5b={},_0xe885aa={'count':0x0,'rows':[]};var _0x377444=_[_0x94d2('0x29')](db[_0x94d2('0x2a')]['rawAttributes'],function(_0x3f0600){return{'name':_0x3f0600['fieldName'],'type':_0x3f0600[_0x94d2('0x2b')][_0x94d2('0x2c')]};});_0x300e5b[_0x94d2('0x2d')]=_[_0x94d2('0x29')](_0x377444,_0x94d2('0x2e'));_0x300e5b[_0x94d2('0x2f')]=_[_0x94d2('0x30')](_0x107d56[_0x94d2('0x2f')]);_0x300e5b[_0x94d2('0x31')]=_[_0x94d2('0x32')](_0x300e5b[_0x94d2('0x2d')],_0x300e5b['query']);_0xb18407[_0x94d2('0x33')]=_[_0x94d2('0x32')](_0x300e5b[_0x94d2('0x2d')],qs[_0x94d2('0x34')](_0x107d56[_0x94d2('0x2f')][_0x94d2('0x34')]));_0xb18407[_0x94d2('0x33')]=_0xb18407['attributes'][_0x94d2('0x35')]?_0xb18407[_0x94d2('0x33')]:_0x300e5b[_0x94d2('0x2d')];if(!_0x107d56['query'][_0x94d2('0x36')](_0x94d2('0x37'))){_0xb18407[_0x94d2('0x1d')]=qs[_0x94d2('0x1d')](_0x107d56[_0x94d2('0x2f')][_0x94d2('0x1d')]);_0xb18407['offset']=qs['offset'](_0x107d56['query']['offset']);}_0xb18407[_0x94d2('0x38')]=qs[_0x94d2('0x39')](_0x107d56[_0x94d2('0x2f')][_0x94d2('0x39')]);_0xb18407[_0x94d2('0x3a')]=qs[_0x94d2('0x31')](_[_0x94d2('0x3b')](_0x107d56[_0x94d2('0x2f')],_0x300e5b[_0x94d2('0x31')]),_0x377444);if(_0x107d56[_0x94d2('0x2f')]['filter']){_0xb18407[_0x94d2('0x3a')]=_[_0x94d2('0x3c')](_0xb18407['where'],{'$or':_[_0x94d2('0x29')](_0x377444,function(_0x18855d){if(_0x18855d['type']!==_0x94d2('0x3d')){var _0x545371={};_0x545371[_0x18855d['name']]={'$like':'%'+_0x107d56[_0x94d2('0x2f')][_0x94d2('0x3e')]+'%'};return _0x545371;}})});}_0xb18407=_[_0x94d2('0x3c')]({},_0xb18407,_0x107d56[_0x94d2('0x3f')]);var _0x222d1c={'where':_0xb18407[_0x94d2('0x3a')]};return db['SmsQueueReport'][_0x94d2('0x40')](_0x222d1c)[_0x94d2('0x23')](function(_0x2c296f){_0xe885aa[_0x94d2('0x40')]=_0x2c296f;if(_0x107d56[_0x94d2('0x2f')][_0x94d2('0x41')]){_0xb18407[_0x94d2('0x42')]=[{'all':!![]}];}return db[_0x94d2('0x2a')][_0x94d2('0x43')](_0xb18407);})[_0x94d2('0x23')](function(_0x384a0f){_0xe885aa[_0x94d2('0x44')]=_0x384a0f;return _0xe885aa;})['then'](respondWithFilteredResult(_0x541b02,_0xb18407))[_0x94d2('0x45')](handleError(_0x541b02,null));};exports[_0x94d2('0x46')]=function(_0x53d0dc,_0x279d08){var _0x4cde87={'raw':!![],'where':{'id':_0x53d0dc['params']['id']}},_0x39093b={};_0x39093b[_0x94d2('0x2d')]=_[_0x94d2('0x30')](db[_0x94d2('0x2a')][_0x94d2('0x47')]);_0x39093b['query']=_[_0x94d2('0x30')](_0x53d0dc[_0x94d2('0x2f')]);_0x39093b[_0x94d2('0x31')]=_[_0x94d2('0x32')](_0x39093b[_0x94d2('0x2d')],_0x39093b[_0x94d2('0x2f')]);_0x4cde87['attributes']=_['intersection'](_0x39093b[_0x94d2('0x2d')],qs['fields'](_0x53d0dc[_0x94d2('0x2f')][_0x94d2('0x34')]));_0x4cde87[_0x94d2('0x33')]=_0x4cde87[_0x94d2('0x33')][_0x94d2('0x35')]?_0x4cde87[_0x94d2('0x33')]:_0x39093b[_0x94d2('0x2d')];if(_0x53d0dc[_0x94d2('0x2f')][_0x94d2('0x41')]){_0x4cde87['include']=[{'all':!![]}];}_0x4cde87=_['merge']({},_0x4cde87,_0x53d0dc[_0x94d2('0x3f')]);return db[_0x94d2('0x2a')][_0x94d2('0x48')](_0x4cde87)[_0x94d2('0x23')](handleEntityNotFound(_0x279d08,null))['then'](respondWithResult(_0x279d08,null))[_0x94d2('0x45')](handleError(_0x279d08,null));};exports[_0x94d2('0x49')]=function(_0x913664,_0x21f192){return db[_0x94d2('0x2a')]['create'](_0x913664[_0x94d2('0x4a')],{})[_0x94d2('0x23')](respondWithResult(_0x21f192,0xc9))[_0x94d2('0x45')](handleError(_0x21f192,null));};exports[_0x94d2('0x4b')]=function(_0x5d0aa0,_0x3e0399){if(_0x5d0aa0['body']['id']){delete _0x5d0aa0[_0x94d2('0x4a')]['id'];}return db['SmsQueueReport'][_0x94d2('0x48')]({'where':{'id':_0x5d0aa0[_0x94d2('0x4c')]['id']}})[_0x94d2('0x23')](handleEntityNotFound(_0x3e0399,null))[_0x94d2('0x23')](saveUpdates(_0x5d0aa0[_0x94d2('0x4a')],null))['then'](respondWithResult(_0x3e0399,null))['catch'](handleError(_0x3e0399,null));};exports[_0x94d2('0x24')]=function(_0x2ad91a,_0x1a24b1){return db[_0x94d2('0x2a')][_0x94d2('0x48')]({'where':{'id':_0x2ad91a[_0x94d2('0x4c')]['id']}})[_0x94d2('0x23')](handleEntityNotFound(_0x1a24b1,null))[_0x94d2('0x23')](removeEntity(_0x1a24b1,null))['catch'](handleError(_0x1a24b1,null));};exports[_0x94d2('0x4d')]=function(_0x203800,_0x27905e){return db[_0x94d2('0x2a')][_0x94d2('0x4d')]()[_0x94d2('0x23')](respondWithResult(_0x27905e,null))[_0x94d2('0x45')](handleError(_0x27905e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 2a9f903..ef74976 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x56d1f1,_0x3f545f){var _0x261553=function(_0x2915da){while(--_0x2915da){_0x56d1f1['push'](_0x56d1f1['shift']());}};_0x261553(++_0x3f545f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2de4bf,_0x4c01a9){var _0x271abd=function(_0x561ded){while(--_0x561ded){_0x2de4bf['push'](_0x2de4bf['shift']());}};_0x271abd(++_0x4c01a9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 239535a..a962f45 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 _0x2b39=['SmsQueueReport','body','options','then','update','attributes','limit','UpdateSmsQueueReport','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateSmsQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2b39,0xc4));var _0x92b3=function(_0x193dad,_0x38d83d){_0x193dad=_0x193dad-0x0;var _0x5eafa4=_0x2b39[_0x193dad];return _0x5eafa4;};'use strict';var _=require(_0x92b3('0x0'));var util=require(_0x92b3('0x1'));var moment=require(_0x92b3('0x2'));var BPromise=require(_0x92b3('0x3'));var rs=require(_0x92b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b3('0x5'))['db'];var utils=require(_0x92b3('0x6'));var logger=require(_0x92b3('0x7'))(_0x92b3('0x8'));var config=require(_0x92b3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x92b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x248ec9,_0x5bf862,_0x5cfc19){return new BPromise(function(_0x3ada64,_0x59f65e){return client[_0x92b3('0xb')](_0x248ec9,_0x5cfc19)['then'](function(_0x37e38b){logger['info'](_0x92b3('0xc'),_0x5bf862,_0x92b3('0xd'));logger['debug'](_0x92b3('0xe'),_0x5bf862,_0x92b3('0xd'),JSON[_0x92b3('0xf')](_0x37e38b));if(_0x37e38b['error']){if(_0x37e38b['error']['code']===0x1f4){logger[_0x92b3('0x10')](_0x92b3('0xc'),_0x5bf862,_0x37e38b['error'][_0x92b3('0x11')]);return _0x59f65e(_0x37e38b[_0x92b3('0x10')]['message']);}logger['error'](_0x92b3('0xc'),_0x5bf862,_0x37e38b[_0x92b3('0x10')][_0x92b3('0x11')]);return _0x3ada64(_0x37e38b[_0x92b3('0x10')][_0x92b3('0x11')]);}else{logger[_0x92b3('0x12')](_0x92b3('0xc'),_0x5bf862,_0x92b3('0xd'));_0x3ada64(_0x37e38b[_0x92b3('0x13')][_0x92b3('0x11')]);}})['catch'](function(_0x7124d){logger[_0x92b3('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5bf862,_0x7124d);_0x59f65e(_0x7124d);});});}exports[_0x92b3('0x14')]=function(_0x5d27c1){var _0x2b43b1=this;return new Promise(function(_0x312bd6,_0x4b5c1b){return db[_0x92b3('0x15')]['create'](_0x5d27c1[_0x92b3('0x16')],{'raw':_0x5d27c1['options']?_0x5d27c1[_0x92b3('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x92b3('0x18')](function(_0x3a7810){logger[_0x92b3('0x12')](_0x92b3('0x14'),_0x5d27c1);logger['debug'](_0x92b3('0x14'),_0x5d27c1,JSON[_0x92b3('0xf')](_0x3a7810));_0x312bd6(_0x3a7810);})['catch'](function(_0xed52ca){logger[_0x92b3('0x10')](_0x92b3('0x14'),_0xed52ca['message'],_0x5d27c1);_0x4b5c1b(_0x2b43b1[_0x92b3('0x10')](0x1f4,_0xed52ca[_0x92b3('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x2feaea){var _0x5e1f8b=this;return new Promise(function(_0x54594a,_0x2c0a05){return db[_0x92b3('0x15')][_0x92b3('0x19')](_0x2feaea[_0x92b3('0x16')],{'raw':_0x2feaea[_0x92b3('0x17')]?_0x2feaea[_0x92b3('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2feaea[_0x92b3('0x17')]?_0x2feaea['options']['where']||null:null,'attributes':_0x2feaea['options']?_0x2feaea[_0x92b3('0x17')][_0x92b3('0x1a')]||null:null,'limit':_0x2feaea[_0x92b3('0x17')]?_0x2feaea[_0x92b3('0x17')][_0x92b3('0x1b')]||null:null})[_0x92b3('0x18')](function(_0x1291db){logger[_0x92b3('0x12')](_0x92b3('0x1c'),_0x2feaea);logger[_0x92b3('0x1d')](_0x92b3('0x1c'),_0x2feaea,JSON[_0x92b3('0xf')](_0x1291db));_0x54594a(_0x1291db);})[_0x92b3('0x1e')](function(_0x1ad9a5){logger[_0x92b3('0x10')]('UpdateSmsQueueReport',_0x1ad9a5['message'],_0x2feaea);_0x2c0a05(_0x5e1f8b[_0x92b3('0x10')](0x1f4,_0x1ad9a5['message']));});});}; \ No newline at end of file +var _0x60c5=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','debug','UpdateSmsQueueReport','body','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2916fa,_0x4766fd){var _0x12d3c1=function(_0x32f855){while(--_0x32f855){_0x2916fa['push'](_0x2916fa['shift']());}};_0x12d3c1(++_0x4766fd);}(_0x60c5,0x165));var _0x560c=function(_0x38115b,_0x4ae500){_0x38115b=_0x38115b-0x0;var _0xa07825=_0x60c5[_0x38115b];return _0xa07825;};'use strict';var _=require(_0x560c('0x0'));var util=require('util');var moment=require(_0x560c('0x1'));var BPromise=require(_0x560c('0x2'));var rs=require(_0x560c('0x3'));var fs=require('fs');var Redis=require(_0x560c('0x4'));var db=require(_0x560c('0x5'))['db'];var utils=require(_0x560c('0x6'));var logger=require(_0x560c('0x7'))(_0x560c('0x8'));var config=require(_0x560c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x560c('0xa')][_0x560c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x322bc9,_0x1a07d4,_0x29f81c){return new BPromise(function(_0x35503e,_0x1c1dd5){return client[_0x560c('0xc')](_0x322bc9,_0x29f81c)[_0x560c('0xd')](function(_0x10e617){logger[_0x560c('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x1a07d4,_0x560c('0xf'));logger['debug'](_0x560c('0x10'),_0x1a07d4,'request\x20sent',JSON[_0x560c('0x11')](_0x10e617));if(_0x10e617[_0x560c('0x12')]){if(_0x10e617[_0x560c('0x12')][_0x560c('0x13')]===0x1f4){logger[_0x560c('0x12')](_0x560c('0x14'),_0x1a07d4,_0x10e617[_0x560c('0x12')][_0x560c('0x15')]);return _0x1c1dd5(_0x10e617[_0x560c('0x12')]['message']);}logger['error'](_0x560c('0x14'),_0x1a07d4,_0x10e617[_0x560c('0x12')][_0x560c('0x15')]);return _0x35503e(_0x10e617[_0x560c('0x12')][_0x560c('0x15')]);}else{logger[_0x560c('0xe')](_0x560c('0x14'),_0x1a07d4,_0x560c('0xf'));_0x35503e(_0x10e617['result'][_0x560c('0x15')]);}})[_0x560c('0x16')](function(_0x4e4cf4){logger[_0x560c('0x12')](_0x560c('0x14'),_0x1a07d4,_0x4e4cf4);_0x1c1dd5(_0x4e4cf4);});});}exports[_0x560c('0x17')]=function(_0x4a36dc){var _0x51bd24=this;return new Promise(function(_0x1143f9,_0x23bbcc){return db[_0x560c('0x18')][_0x560c('0x19')](_0x4a36dc['body'],{'raw':_0x4a36dc[_0x560c('0x1a')]?_0x4a36dc[_0x560c('0x1a')][_0x560c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x56cafa){logger[_0x560c('0xe')](_0x560c('0x17'),_0x4a36dc);logger[_0x560c('0x1c')]('CreateSmsQueueReport',_0x4a36dc,JSON[_0x560c('0x11')](_0x56cafa));_0x1143f9(_0x56cafa);})['catch'](function(_0x93814e){logger['error']('CreateSmsQueueReport',_0x93814e[_0x560c('0x15')],_0x4a36dc);_0x23bbcc(_0x51bd24[_0x560c('0x12')](0x1f4,_0x93814e['message']));});});};exports[_0x560c('0x1d')]=function(_0x5d05dc){var _0x228fc8=this;return new Promise(function(_0x3d1fbd,_0x108627){return db['SmsQueueReport']['update'](_0x5d05dc[_0x560c('0x1e')],{'raw':_0x5d05dc[_0x560c('0x1a')]?_0x5d05dc[_0x560c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d05dc['options']?_0x5d05dc[_0x560c('0x1a')][_0x560c('0x1f')]||null:null,'attributes':_0x5d05dc['options']?_0x5d05dc['options']['attributes']||null:null,'limit':_0x5d05dc['options']?_0x5d05dc['options'][_0x560c('0x20')]||null:null})['then'](function(_0x56b332){logger[_0x560c('0xe')]('UpdateSmsQueueReport',_0x5d05dc);logger[_0x560c('0x1c')]('UpdateSmsQueueReport',_0x5d05dc,JSON[_0x560c('0x11')](_0x56b332));_0x3d1fbd(_0x56b332);})[_0x560c('0x16')](function(_0x5276ca){logger[_0x560c('0x12')](_0x560c('0x1d'),_0x5276ca['message'],_0x5d05dc);_0x108627(_0x228fc8['error'](0x1f4,_0x5276ca[_0x560c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ec54f18..64ed25c 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 _0xa630=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x17ea94,_0x5cc3ce){var _0xb20e3f=function(_0x98e597){while(--_0x98e597){_0x17ea94['push'](_0x17ea94['shift']());}};_0xb20e3f(++_0x5cc3ce);}(_0xa630,0xbe));var _0x0a63=function(_0x5d47a5,_0x333491){_0x5d47a5=_0x5d47a5-0x0;var _0x467c9f=_0xa630[_0x5d47a5];return _0x467c9f;};'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')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')]('/',auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),controller[_0x0a63('0x10')]);router[_0x0a63('0x11')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0x12')]);module[_0x0a63('0x13')]=router; \ No newline at end of file +var _0xac9d=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xac9d,0x14d));var _0xdac9=function(_0x1fb6e2,_0x3a22ce){_0x1fb6e2=_0x1fb6e2-0x0;var _0x354690=_0xac9d[_0x1fb6e2];return _0x354690;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./smsTransferReport.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),auth[_0xdac9('0xa')](),controller['describe']);router[_0xdac9('0x9')]('/:id',auth[_0xdac9('0xa')](),controller[_0xdac9('0xd')]);router[_0xdac9('0xe')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x12')]);router['delete'](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller['destroy']);module[_0xdac9('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c4adcf7..651de68 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x109fd7,_0x4a347f){var _0x357a8e=function(_0x48cf80){while(--_0x48cf80){_0x109fd7['push'](_0x109fd7['shift']());}};_0x357a8e(++_0x4a347f);}(_0xedd9,0xfc));var _0x9edd=function(_0x543980,_0x41df6c){_0x543980=_0x543980-0x0;var _0xf6761c=_0xedd9[_0x543980];return _0xf6761c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x39092c,_0x167f0c){var _0x7e47a=function(_0x17f710){while(--_0x17f710){_0x39092c['push'](_0x39092c['shift']());}};_0x7e47a(++_0x167f0c);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6b6d7d5..803a3f0 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 _0xef83=['update','then','error','stack','name','SmsTransferReport','rawAttributes','fieldName','type','model','query','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','offset','undefined','limit','count','set','Content-Range','json','save'];(function(_0x193f9a,_0x2e4c00){var _0x9015c0=function(_0x149c46){while(--_0x149c46){_0x193f9a['push'](_0x193f9a['shift']());}};_0x9015c0(++_0x2e4c00);}(_0xef83,0x107));var _0x3ef8=function(_0x9664b9,_0x51d10e){_0x9664b9=_0x9664b9-0x0;var _0x420c36=_0xef83[_0x9664b9];return _0x420c36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ef8('0x0'));var zipdir=require(_0x3ef8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ef8('0x2'));var moment=require(_0x3ef8('0x3'));var BPromise=require(_0x3ef8('0x4'));var Mustache=require(_0x3ef8('0x5'));var util=require(_0x3ef8('0x6'));var path=require(_0x3ef8('0x7'));var sox=require(_0x3ef8('0x8'));var csv=require(_0x3ef8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ef8('0xa'));var _=require(_0x3ef8('0xb'));var squel=require(_0x3ef8('0xc'));var crypto=require(_0x3ef8('0xd'));var jsforce=require(_0x3ef8('0xe'));var deskjs=require(_0x3ef8('0xf'));var toCsv=require(_0x3ef8('0x9'));var querystring=require('querystring');var Papa=require(_0x3ef8('0x10'));var Redis=require(_0x3ef8('0x11'));var authService=require(_0x3ef8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ef8('0x13'));var hardwareService=require(_0x3ef8('0x14'));var logger=require(_0x3ef8('0x15'))(_0x3ef8('0x16'));var utils=require(_0x3ef8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ef8('0x18'));var db=require(_0x3ef8('0x19'))['db'];function respondWithStatusCode(_0xd17e11,_0x33d1cf){_0x33d1cf=_0x33d1cf||0xcc;return function(_0x3f8ea0){if(_0x3f8ea0){return _0xd17e11[_0x3ef8('0x1a')](_0x33d1cf);}return _0xd17e11[_0x3ef8('0x1b')](_0x33d1cf)[_0x3ef8('0x1c')]();};}function respondWithResult(_0x4fd1d6,_0x39b429){_0x39b429=_0x39b429||0xc8;return function(_0x174f35){if(_0x174f35){return _0x4fd1d6['status'](_0x39b429)['json'](_0x174f35);}};}function respondWithFilteredResult(_0xb952fb,_0x479ba8){return function(_0x3c1f47){if(_0x3c1f47){var _0x32fa74=typeof _0x479ba8[_0x3ef8('0x1d')]===_0x3ef8('0x1e')&&typeof _0x479ba8[_0x3ef8('0x1f')]===_0x3ef8('0x1e');var _0x300a56=_0x3c1f47[_0x3ef8('0x20')];var _0x1ea3fb=_0x32fa74?0x0:_0x479ba8['offset'];var _0x514171=_0x32fa74?_0x3c1f47[_0x3ef8('0x20')]:_0x479ba8[_0x3ef8('0x1d')]+_0x479ba8[_0x3ef8('0x1f')];var _0x1d2da1;if(_0x514171>=_0x300a56){_0x514171=_0x300a56;_0x1d2da1=0xc8;}else{_0x1d2da1=0xce;}_0xb952fb[_0x3ef8('0x1b')](_0x1d2da1);return _0xb952fb[_0x3ef8('0x21')](_0x3ef8('0x22'),_0x1ea3fb+'-'+_0x514171+'/'+_0x300a56)[_0x3ef8('0x23')](_0x3c1f47);}return null;};}function patchUpdates(_0x23237e){return function(_0x1666d1){try{jsonpatch['apply'](_0x1666d1,_0x23237e,!![]);}catch(_0x33f26b){return BPromise['reject'](_0x33f26b);}return _0x1666d1[_0x3ef8('0x24')]();};}function saveUpdates(_0x545934,_0x29bb46){return function(_0x54b1b1){if(_0x54b1b1){return _0x54b1b1[_0x3ef8('0x25')](_0x545934)[_0x3ef8('0x26')](function(_0x450896){return _0x450896;});}return null;};}function removeEntity(_0x3a5cd5,_0x1fde2d){return function(_0x2838b0){if(_0x2838b0){return _0x2838b0['destroy']()[_0x3ef8('0x26')](function(){_0x3a5cd5[_0x3ef8('0x1b')](0xcc)[_0x3ef8('0x1c')]();});}};}function handleEntityNotFound(_0x18475b,_0x4f36e1){return function(_0x4f6293){if(!_0x4f6293){_0x18475b[_0x3ef8('0x1a')](0x194);}return _0x4f6293;};}function handleError(_0x544676,_0x5293d1){_0x5293d1=_0x5293d1||0x1f4;return function(_0x22bc1a){logger[_0x3ef8('0x27')](_0x22bc1a[_0x3ef8('0x28')]);if(_0x22bc1a[_0x3ef8('0x29')]){delete _0x22bc1a[_0x3ef8('0x29')];}_0x544676[_0x3ef8('0x1b')](_0x5293d1)['send'](_0x22bc1a);};}exports['index']=function(_0x5c0535,_0x554347){var _0x265c8f={},_0x4f51ac={},_0x255919={'count':0x0,'rows':[]};var _0x2f2e62=_['map'](db[_0x3ef8('0x2a')][_0x3ef8('0x2b')],function(_0x4a6566){return{'name':_0x4a6566[_0x3ef8('0x2c')],'type':_0x4a6566[_0x3ef8('0x2d')]['key']};});_0x4f51ac[_0x3ef8('0x2e')]=_['map'](_0x2f2e62,_0x3ef8('0x29'));_0x4f51ac[_0x3ef8('0x2f')]=_['keys'](_0x5c0535['query']);_0x4f51ac['filters']=_[_0x3ef8('0x30')](_0x4f51ac['model'],_0x4f51ac[_0x3ef8('0x2f')]);_0x265c8f['attributes']=_[_0x3ef8('0x30')](_0x4f51ac[_0x3ef8('0x2e')],qs['fields'](_0x5c0535[_0x3ef8('0x2f')]['fields']));_0x265c8f['attributes']=_0x265c8f['attributes'][_0x3ef8('0x31')]?_0x265c8f[_0x3ef8('0x32')]:_0x4f51ac[_0x3ef8('0x2e')];if(!_0x5c0535[_0x3ef8('0x2f')][_0x3ef8('0x33')](_0x3ef8('0x34'))){_0x265c8f['limit']=qs[_0x3ef8('0x1f')](_0x5c0535[_0x3ef8('0x2f')][_0x3ef8('0x1f')]);_0x265c8f[_0x3ef8('0x1d')]=qs['offset'](_0x5c0535[_0x3ef8('0x2f')][_0x3ef8('0x1d')]);}_0x265c8f[_0x3ef8('0x35')]=qs[_0x3ef8('0x36')](_0x5c0535[_0x3ef8('0x2f')][_0x3ef8('0x36')]);_0x265c8f[_0x3ef8('0x37')]=qs[_0x3ef8('0x38')](_[_0x3ef8('0x39')](_0x5c0535[_0x3ef8('0x2f')],_0x4f51ac[_0x3ef8('0x38')]),_0x2f2e62);if(_0x5c0535[_0x3ef8('0x2f')]['filter']){_0x265c8f[_0x3ef8('0x37')]=_[_0x3ef8('0x3a')](_0x265c8f[_0x3ef8('0x37')],{'$or':_[_0x3ef8('0x3b')](_0x2f2e62,function(_0x1ab118){if(_0x1ab118[_0x3ef8('0x2d')]!=='VIRTUAL'){var _0x585dd6={};_0x585dd6[_0x1ab118[_0x3ef8('0x29')]]={'$like':'%'+_0x5c0535['query']['filter']+'%'};return _0x585dd6;}})});}_0x265c8f=_['merge']({},_0x265c8f,_0x5c0535[_0x3ef8('0x3c')]);var _0x136625={'where':_0x265c8f['where']};return db['SmsTransferReport']['count'](_0x136625)['then'](function(_0x12f539){_0x255919['count']=_0x12f539;if(_0x5c0535[_0x3ef8('0x2f')][_0x3ef8('0x3d')]){_0x265c8f[_0x3ef8('0x3e')]=[{'all':!![]}];}return db[_0x3ef8('0x2a')][_0x3ef8('0x3f')](_0x265c8f);})[_0x3ef8('0x26')](function(_0x4c4fae){_0x255919[_0x3ef8('0x40')]=_0x4c4fae;return _0x255919;})[_0x3ef8('0x26')](respondWithFilteredResult(_0x554347,_0x265c8f))[_0x3ef8('0x41')](handleError(_0x554347,null));};exports[_0x3ef8('0x42')]=function(_0x489a1d,_0x72526){var _0x3c95b8={'raw':!![],'where':{'id':_0x489a1d[_0x3ef8('0x43')]['id']}},_0xd367a2={};_0xd367a2[_0x3ef8('0x2e')]=_['keys'](db[_0x3ef8('0x2a')][_0x3ef8('0x2b')]);_0xd367a2[_0x3ef8('0x2f')]=_[_0x3ef8('0x44')](_0x489a1d['query']);_0xd367a2[_0x3ef8('0x38')]=_['intersection'](_0xd367a2[_0x3ef8('0x2e')],_0xd367a2[_0x3ef8('0x2f')]);_0x3c95b8['attributes']=_[_0x3ef8('0x30')](_0xd367a2[_0x3ef8('0x2e')],qs[_0x3ef8('0x45')](_0x489a1d['query'][_0x3ef8('0x45')]));_0x3c95b8[_0x3ef8('0x32')]=_0x3c95b8[_0x3ef8('0x32')][_0x3ef8('0x31')]?_0x3c95b8['attributes']:_0xd367a2[_0x3ef8('0x2e')];if(_0x489a1d[_0x3ef8('0x2f')][_0x3ef8('0x3d')]){_0x3c95b8['include']=[{'all':!![]}];}_0x3c95b8=_[_0x3ef8('0x3a')]({},_0x3c95b8,_0x489a1d[_0x3ef8('0x3c')]);return db[_0x3ef8('0x2a')][_0x3ef8('0x46')](_0x3c95b8)[_0x3ef8('0x26')](handleEntityNotFound(_0x72526,null))[_0x3ef8('0x26')](respondWithResult(_0x72526,null))['catch'](handleError(_0x72526,null));};exports[_0x3ef8('0x47')]=function(_0xbcdff1,_0x36c58b){return db[_0x3ef8('0x2a')][_0x3ef8('0x47')](_0xbcdff1[_0x3ef8('0x48')],{})[_0x3ef8('0x26')](respondWithResult(_0x36c58b,0xc9))[_0x3ef8('0x41')](handleError(_0x36c58b,null));};exports[_0x3ef8('0x25')]=function(_0x44e9a4,_0x39bf69){if(_0x44e9a4[_0x3ef8('0x48')]['id']){delete _0x44e9a4[_0x3ef8('0x48')]['id'];}return db[_0x3ef8('0x2a')]['find']({'where':{'id':_0x44e9a4[_0x3ef8('0x43')]['id']}})[_0x3ef8('0x26')](handleEntityNotFound(_0x39bf69,null))['then'](saveUpdates(_0x44e9a4[_0x3ef8('0x48')],null))[_0x3ef8('0x26')](respondWithResult(_0x39bf69,null))[_0x3ef8('0x41')](handleError(_0x39bf69,null));};exports[_0x3ef8('0x49')]=function(_0x41db18,_0x2e1b6b){return db[_0x3ef8('0x2a')][_0x3ef8('0x46')]({'where':{'id':_0x41db18[_0x3ef8('0x43')]['id']}})[_0x3ef8('0x26')](handleEntityNotFound(_0x2e1b6b,null))[_0x3ef8('0x26')](removeEntity(_0x2e1b6b,null))[_0x3ef8('0x41')](handleError(_0x2e1b6b,null));};exports[_0x3ef8('0x4a')]=function(_0x5be082,_0xb65ad){return db[_0x3ef8('0x2a')]['describe']()[_0x3ef8('0x26')](respondWithResult(_0xb65ad,null))[_0x3ef8('0x41')](handleError(_0xb65ad,null));}; \ No newline at end of file +var _0x23d2=['stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','status','error'];(function(_0x79f1a,_0x5a1a9d){var _0x156b10=function(_0x2947bc){while(--_0x2947bc){_0x79f1a['push'](_0x79f1a['shift']());}};_0x156b10(++_0x5a1a9d);}(_0x23d2,0x74));var _0x223d=function(_0xfbafac,_0x5ba78b){_0xfbafac=_0xfbafac-0x0;var _0x2e173c=_0x23d2[_0xfbafac];return _0x2e173c;};'use strict';var emlformat=require(_0x223d('0x0'));var rimraf=require(_0x223d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x223d('0x2'));var rp=require(_0x223d('0x3'));var moment=require(_0x223d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x223d('0x5'));var util=require(_0x223d('0x6'));var path=require('path');var sox=require(_0x223d('0x7'));var csv=require(_0x223d('0x8'));var ejs=require(_0x223d('0x9'));var fs=require('fs');var fs_extra=require(_0x223d('0xa'));var _=require(_0x223d('0xb'));var squel=require(_0x223d('0xc'));var crypto=require(_0x223d('0xd'));var jsforce=require(_0x223d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x223d('0x8'));var querystring=require(_0x223d('0xf'));var Papa=require('papaparse');var Redis=require(_0x223d('0x10'));var authService=require(_0x223d('0x11'));var qs=require(_0x223d('0x12'));var as=require(_0x223d('0x13'));var hardwareService=require(_0x223d('0x14'));var logger=require(_0x223d('0x15'))(_0x223d('0x16'));var utils=require(_0x223d('0x17'));var config=require(_0x223d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x223d('0x19'))['db'];function respondWithStatusCode(_0x42410b,_0x4938f5){_0x4938f5=_0x4938f5||0xcc;return function(_0xd9579d){if(_0xd9579d){return _0x42410b[_0x223d('0x1a')](_0x4938f5);}return _0x42410b['status'](_0x4938f5)[_0x223d('0x1b')]();};}function respondWithResult(_0x118dfb,_0x10ac3f){_0x10ac3f=_0x10ac3f||0xc8;return function(_0x40234f){if(_0x40234f){return _0x118dfb['status'](_0x10ac3f)[_0x223d('0x1c')](_0x40234f);}};}function respondWithFilteredResult(_0x51e46a,_0x5da2a6){return function(_0x539846){if(_0x539846){var _0x5ca0c9=typeof _0x5da2a6[_0x223d('0x1d')]===_0x223d('0x1e')&&typeof _0x5da2a6[_0x223d('0x1f')]==='undefined';var _0x1ba6c8=_0x539846[_0x223d('0x20')];var _0xef03b=_0x5ca0c9?0x0:_0x5da2a6['offset'];var _0x229a06=_0x5ca0c9?_0x539846[_0x223d('0x20')]:_0x5da2a6[_0x223d('0x1d')]+_0x5da2a6[_0x223d('0x1f')];var _0x4b84ab;if(_0x229a06>=_0x1ba6c8){_0x229a06=_0x1ba6c8;_0x4b84ab=0xc8;}else{_0x4b84ab=0xce;}_0x51e46a['status'](_0x4b84ab);return _0x51e46a[_0x223d('0x21')](_0x223d('0x22'),_0xef03b+'-'+_0x229a06+'/'+_0x1ba6c8)[_0x223d('0x1c')](_0x539846);}return null;};}function patchUpdates(_0x1e6495){return function(_0x13706b){try{jsonpatch[_0x223d('0x23')](_0x13706b,_0x1e6495,!![]);}catch(_0x338683){return BPromise[_0x223d('0x24')](_0x338683);}return _0x13706b['save']();};}function saveUpdates(_0x1b6dd6,_0x3e1585){return function(_0x2908f1){if(_0x2908f1){return _0x2908f1[_0x223d('0x25')](_0x1b6dd6)[_0x223d('0x26')](function(_0x2a7884){return _0x2a7884;});}return null;};}function removeEntity(_0x5ce455,_0x50fad5){return function(_0x2407b8){if(_0x2407b8){return _0x2407b8[_0x223d('0x27')]()[_0x223d('0x26')](function(){_0x5ce455[_0x223d('0x28')](0xcc)[_0x223d('0x1b')]();});}};}function handleEntityNotFound(_0x35210f,_0x3296d4){return function(_0x2cc079){if(!_0x2cc079){_0x35210f[_0x223d('0x1a')](0x194);}return _0x2cc079;};}function handleError(_0x4e0e71,_0x141b55){_0x141b55=_0x141b55||0x1f4;return function(_0x286c19){logger[_0x223d('0x29')](_0x286c19[_0x223d('0x2a')]);if(_0x286c19['name']){delete _0x286c19[_0x223d('0x2b')];}_0x4e0e71['status'](_0x141b55)[_0x223d('0x2c')](_0x286c19);};}exports[_0x223d('0x2d')]=function(_0x60e6f0,_0x4e4553){var _0x23493e={},_0x50ec47={},_0xbe423d={'count':0x0,'rows':[]};var _0x3229c8=_[_0x223d('0x2e')](db[_0x223d('0x2f')][_0x223d('0x30')],function(_0x4c6aa7){return{'name':_0x4c6aa7[_0x223d('0x31')],'type':_0x4c6aa7['type'][_0x223d('0x32')]};});_0x50ec47['model']=_[_0x223d('0x2e')](_0x3229c8,_0x223d('0x2b'));_0x50ec47[_0x223d('0x33')]=_['keys'](_0x60e6f0[_0x223d('0x33')]);_0x50ec47[_0x223d('0x34')]=_['intersection'](_0x50ec47[_0x223d('0x35')],_0x50ec47['query']);_0x23493e[_0x223d('0x36')]=_[_0x223d('0x37')](_0x50ec47['model'],qs['fields'](_0x60e6f0[_0x223d('0x33')][_0x223d('0x38')]));_0x23493e[_0x223d('0x36')]=_0x23493e['attributes'][_0x223d('0x39')]?_0x23493e[_0x223d('0x36')]:_0x50ec47[_0x223d('0x35')];if(!_0x60e6f0[_0x223d('0x33')]['hasOwnProperty'](_0x223d('0x3a'))){_0x23493e[_0x223d('0x1f')]=qs[_0x223d('0x1f')](_0x60e6f0['query'][_0x223d('0x1f')]);_0x23493e[_0x223d('0x1d')]=qs[_0x223d('0x1d')](_0x60e6f0[_0x223d('0x33')][_0x223d('0x1d')]);}_0x23493e[_0x223d('0x3b')]=qs[_0x223d('0x3c')](_0x60e6f0[_0x223d('0x33')][_0x223d('0x3c')]);_0x23493e['where']=qs[_0x223d('0x34')](_[_0x223d('0x3d')](_0x60e6f0['query'],_0x50ec47[_0x223d('0x34')]),_0x3229c8);if(_0x60e6f0['query']['filter']){_0x23493e[_0x223d('0x3e')]=_[_0x223d('0x3f')](_0x23493e[_0x223d('0x3e')],{'$or':_[_0x223d('0x2e')](_0x3229c8,function(_0x24f233){if(_0x24f233[_0x223d('0x40')]!==_0x223d('0x41')){var _0x296db3={};_0x296db3[_0x24f233[_0x223d('0x2b')]]={'$like':'%'+_0x60e6f0['query']['filter']+'%'};return _0x296db3;}})});}_0x23493e=_['merge']({},_0x23493e,_0x60e6f0['options']);var _0x41f2b0={'where':_0x23493e[_0x223d('0x3e')]};return db[_0x223d('0x2f')][_0x223d('0x20')](_0x41f2b0)[_0x223d('0x26')](function(_0x1672ee){_0xbe423d[_0x223d('0x20')]=_0x1672ee;if(_0x60e6f0[_0x223d('0x33')][_0x223d('0x42')]){_0x23493e[_0x223d('0x43')]=[{'all':!![]}];}return db[_0x223d('0x2f')][_0x223d('0x44')](_0x23493e);})[_0x223d('0x26')](function(_0x33cf99){_0xbe423d[_0x223d('0x45')]=_0x33cf99;return _0xbe423d;})[_0x223d('0x26')](respondWithFilteredResult(_0x4e4553,_0x23493e))[_0x223d('0x46')](handleError(_0x4e4553,null));};exports[_0x223d('0x47')]=function(_0x5cb94c,_0x13376d){var _0x52b067={'raw':!![],'where':{'id':_0x5cb94c[_0x223d('0x48')]['id']}},_0x5b48a6={};_0x5b48a6[_0x223d('0x35')]=_[_0x223d('0x49')](db[_0x223d('0x2f')][_0x223d('0x30')]);_0x5b48a6[_0x223d('0x33')]=_[_0x223d('0x49')](_0x5cb94c[_0x223d('0x33')]);_0x5b48a6[_0x223d('0x34')]=_[_0x223d('0x37')](_0x5b48a6[_0x223d('0x35')],_0x5b48a6[_0x223d('0x33')]);_0x52b067['attributes']=_[_0x223d('0x37')](_0x5b48a6[_0x223d('0x35')],qs[_0x223d('0x38')](_0x5cb94c[_0x223d('0x33')][_0x223d('0x38')]));_0x52b067[_0x223d('0x36')]=_0x52b067[_0x223d('0x36')][_0x223d('0x39')]?_0x52b067[_0x223d('0x36')]:_0x5b48a6[_0x223d('0x35')];if(_0x5cb94c[_0x223d('0x33')][_0x223d('0x42')]){_0x52b067[_0x223d('0x43')]=[{'all':!![]}];}_0x52b067=_[_0x223d('0x3f')]({},_0x52b067,_0x5cb94c[_0x223d('0x4a')]);return db['SmsTransferReport']['find'](_0x52b067)[_0x223d('0x26')](handleEntityNotFound(_0x13376d,null))['then'](respondWithResult(_0x13376d,null))[_0x223d('0x46')](handleError(_0x13376d,null));};exports[_0x223d('0x4b')]=function(_0x419b07,_0x258c8a){return db['SmsTransferReport'][_0x223d('0x4b')](_0x419b07[_0x223d('0x4c')],{})[_0x223d('0x26')](respondWithResult(_0x258c8a,0xc9))['catch'](handleError(_0x258c8a,null));};exports[_0x223d('0x25')]=function(_0xf67253,_0x41e144){if(_0xf67253[_0x223d('0x4c')]['id']){delete _0xf67253['body']['id'];}return db[_0x223d('0x2f')][_0x223d('0x4d')]({'where':{'id':_0xf67253['params']['id']}})[_0x223d('0x26')](handleEntityNotFound(_0x41e144,null))[_0x223d('0x26')](saveUpdates(_0xf67253['body'],null))[_0x223d('0x26')](respondWithResult(_0x41e144,null))[_0x223d('0x46')](handleError(_0x41e144,null));};exports[_0x223d('0x27')]=function(_0x19692c,_0x543e09){return db['SmsTransferReport'][_0x223d('0x4d')]({'where':{'id':_0x19692c[_0x223d('0x48')]['id']}})['then'](handleEntityNotFound(_0x543e09,null))['then'](removeEntity(_0x543e09,null))['catch'](handleError(_0x543e09,null));};exports['describe']=function(_0x3bc4f9,_0x181a67){return db[_0x223d('0x2f')][_0x223d('0x4e')]()['then'](respondWithResult(_0x181a67,null))['catch'](handleError(_0x181a67,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e04b48b..6fafeb7 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d9e=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_sms_transfer'];(function(_0x4d39c4,_0x4fe227){var _0x31b318=function(_0x14617b){while(--_0x14617b){_0x4d39c4['push'](_0x4d39c4['shift']());}};_0x31b318(++_0x4fe227);}(_0x3d9e,0x181));var _0xe3d9=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x3d9e[_0x2f3848];return _0x102668;};'use strict';var _=require('lodash');var util=require(_0xe3d9('0x0'));var logger=require(_0xe3d9('0x1'))(_0xe3d9('0x2'));var moment=require(_0xe3d9('0x3'));var BPromise=require(_0xe3d9('0x4'));var rp=require(_0xe3d9('0x5'));var fs=require('fs');var path=require(_0xe3d9('0x6'));var rimraf=require(_0xe3d9('0x7'));var config=require(_0xe3d9('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0xe3d9('0x9')]=function(_0xfa896e,_0x178be9){return _0xfa896e['define']('SmsTransferReport',attributes,{'tableName':_0xe3d9('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d9('0xb'),'fields':[_0xe3d9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x40df=['request-promise','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0x40df,0xaf));var _0xf40d=function(_0x294f0c,_0x26f7a2){_0x294f0c=_0x294f0c-0x0;var _0x538870=_0x40df[_0x294f0c];return _0x538870;};'use strict';var _=require(_0xf40d('0x0'));var util=require(_0xf40d('0x1'));var logger=require('../../config/logger')(_0xf40d('0x2'));var moment=require(_0xf40d('0x3'));var BPromise=require(_0xf40d('0x4'));var rp=require(_0xf40d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf40d('0x6'));var config=require(_0xf40d('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xf40d('0x8')]=function(_0x416b46,_0x17b800){return _0x416b46[_0xf40d('0x9')]('SmsTransferReport',attributes,{'tableName':_0xf40d('0xa'),'paranoid':![],'indexes':[{'name':_0xf40d('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 61ff71e..6d1ee23 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 _0xf2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','util','moment'];(function(_0x5bf372,_0x100981){var _0x255b42=function(_0x55d2b7){while(--_0x55d2b7){_0x5bf372['push'](_0x5bf372['shift']());}};_0x255b42(++_0x100981);}(_0xf2cf,0xf5));var _0xff2c=function(_0x54ced1,_0x2d2638){_0x54ced1=_0x54ced1-0x0;var _0x431832=_0xf2cf[_0x54ced1];return _0x431832;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var moment=require(_0xff2c('0x1'));var BPromise=require(_0xff2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff2c('0x3'));var db=require(_0xff2c('0x4'))['db'];var utils=require(_0xff2c('0x5'));var logger=require(_0xff2c('0x6'))(_0xff2c('0x7'));var config=require(_0xff2c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xff2c('0x9')][_0xff2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ba3d,_0x21c5a5,_0x223a86){return new BPromise(function(_0x105f4d,_0x7ba107){return client[_0xff2c('0xb')](_0x57ba3d,_0x223a86)[_0xff2c('0xc')](function(_0x133ee9){logger['info'](_0xff2c('0xd'),_0x21c5a5,_0xff2c('0xe'));logger[_0xff2c('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x21c5a5,_0xff2c('0xe'),JSON[_0xff2c('0x10')](_0x133ee9));if(_0x133ee9[_0xff2c('0x11')]){if(_0x133ee9['error']['code']===0x1f4){logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x133ee9['error'][_0xff2c('0x12')]);return _0x7ba107(_0x133ee9['error']['message']);}logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x133ee9[_0xff2c('0x11')][_0xff2c('0x12')]);return _0x105f4d(_0x133ee9['error'][_0xff2c('0x12')]);}else{logger['info'](_0xff2c('0xd'),_0x21c5a5,_0xff2c('0xe'));_0x105f4d(_0x133ee9['result']['message']);}})['catch'](function(_0x31cec8){logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x31cec8);_0x7ba107(_0x31cec8);});});} \ No newline at end of file +var _0x8585=['lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','http','request','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x8585,0x64));var _0x5858=function(_0x26b4ba,_0x469d3d){_0x26b4ba=_0x26b4ba-0x0;var _0x577e09=_0x8585[_0x26b4ba];return _0x577e09;};'use strict';var _=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var moment=require(_0x5858('0x2'));var BPromise=require('bluebird');var rs=require(_0x5858('0x3'));var fs=require('fs');var Redis=require(_0x5858('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5858('0x5'));var config=require(_0x5858('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d26d1,_0x3fd63f,_0x5c8e94){return new BPromise(function(_0x4d5efe,_0x46f019){return client[_0x5858('0x8')](_0x1d26d1,_0x5c8e94)['then'](function(_0x490bce){logger[_0x5858('0x9')](_0x5858('0xa'),_0x3fd63f,'request\x20sent');logger[_0x5858('0xb')](_0x5858('0xc'),_0x3fd63f,_0x5858('0xd'),JSON[_0x5858('0xe')](_0x490bce));if(_0x490bce[_0x5858('0xf')]){if(_0x490bce[_0x5858('0xf')][_0x5858('0x10')]===0x1f4){logger[_0x5858('0xf')](_0x5858('0xa'),_0x3fd63f,_0x490bce['error'][_0x5858('0x11')]);return _0x46f019(_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);}logger['error'](_0x5858('0xa'),_0x3fd63f,_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);return _0x4d5efe(_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);}else{logger[_0x5858('0x9')](_0x5858('0xa'),_0x3fd63f,_0x5858('0xd'));_0x4d5efe(_0x490bce[_0x5858('0x12')][_0x5858('0x11')]);}})[_0x5858('0x13')](function(_0x310e4c){logger[_0x5858('0xf')](_0x5858('0xa'),_0x3fd63f,_0x310e4c);_0x46f019(_0x310e4c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1f3171f..8d7e0bd 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 _0x3b73=['get','isAuthenticated','/:id/download','download','diskStorage','join','root','originalname','replace','basename','now','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x3b73,0x7d));var _0x33b7=function(_0xd256a1,_0x2aae80){_0xd256a1=_0xd256a1-0x0;var _0x2a11a4=_0x3b73[_0xd256a1];return _0x2a11a4;};'use strict';var multer=require(_0x33b7('0x0'));var util=require(_0x33b7('0x1'));var path=require(_0x33b7('0x2'));var timeout=require(_0x33b7('0x3'));var express=require(_0x33b7('0x4'));var router=express[_0x33b7('0x5')]();var fs_extra=require(_0x33b7('0x6'));var auth=require(_0x33b7('0x7'));var interaction=require(_0x33b7('0x8'));var config=require(_0x33b7('0x9'));var controller=require('./sound.controller');router[_0x33b7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x33b7('0xb')](),controller['show']);router[_0x33b7('0xa')](_0x33b7('0xc'),auth[_0x33b7('0xb')](),controller[_0x33b7('0xd')]);var upload=multer({'storage':multer[_0x33b7('0xe')]({'destination':function(_0x247024,_0x5e0874,_0x3ca814){_0x3ca814(null,path[_0x33b7('0xf')](config[_0x33b7('0x10')],'server/files/sounds/original/'));},'filename':function(_0x106a4a,_0xd2e1de,_0x5a6f9a){_0xd2e1de[_0x33b7('0x11')]=_0xd2e1de['originalname'][_0x33b7('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a6f9a(null,util['format']('%s-%s%s',path[_0x33b7('0x13')](_0xd2e1de['originalname'],path['extname'](_0xd2e1de[_0x33b7('0x11')])),Date[_0x33b7('0x14')](),path['extname'](_0xd2e1de['originalname'])));}})});router[_0x33b7('0x15')]('/',upload['single']('file'),controller[_0x33b7('0x16')]);router[_0x33b7('0x17')]('/:id',auth[_0x33b7('0xb')](),controller[_0x33b7('0x18')]);router[_0x33b7('0x19')]('/:id',auth[_0x33b7('0xb')](),controller['delete']);module[_0x33b7('0x1a')]=router; \ No newline at end of file +var _0xaeab=['originalname','replace','format','%s-%s%s','basename','now','extname','post','single','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xaeab,0x91));var _0xbaea=function(_0x53344e,_0x273e9a){_0x53344e=_0x53344e-0x0;var _0xe8907a=_0xaeab[_0x53344e];return _0xe8907a;};'use strict';var multer=require(_0xbaea('0x0'));var util=require('util');var path=require(_0xbaea('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaea('0x2'));var router=express[_0xbaea('0x3')]();var fs_extra=require(_0xbaea('0x4'));var auth=require(_0xbaea('0x5'));var interaction=require(_0xbaea('0x6'));var config=require(_0xbaea('0x7'));var controller=require(_0xbaea('0x8'));router[_0xbaea('0x9')]('/',auth[_0xbaea('0xa')](),controller[_0xbaea('0xb')]);router['get'](_0xbaea('0xc'),auth[_0xbaea('0xa')](),controller[_0xbaea('0xd')]);router[_0xbaea('0x9')](_0xbaea('0xe'),auth[_0xbaea('0xa')](),controller[_0xbaea('0xf')]);var upload=multer({'storage':multer[_0xbaea('0x10')]({'destination':function(_0x57f8c1,_0x1a7cde,_0x1ee82b){_0x1ee82b(null,path[_0xbaea('0x11')](config[_0xbaea('0x12')],_0xbaea('0x13')));},'filename':function(_0x58a1e7,_0x75a1e5,_0x264a7e){_0x75a1e5['originalname']=_0x75a1e5[_0xbaea('0x14')][_0xbaea('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x264a7e(null,util[_0xbaea('0x16')](_0xbaea('0x17'),path[_0xbaea('0x18')](_0x75a1e5[_0xbaea('0x14')],path['extname'](_0x75a1e5['originalname'])),Date[_0xbaea('0x19')](),path[_0xbaea('0x1a')](_0x75a1e5[_0xbaea('0x14')])));}})});router[_0xbaea('0x1b')]('/',upload[_0xbaea('0x1c')]('file'),controller['create']);router[_0xbaea('0x1d')](_0xbaea('0xc'),auth['isAuthenticated'](),controller[_0xbaea('0x1e')]);router[_0xbaea('0x1f')](_0xbaea('0xc'),auth[_0xbaea('0xa')](),controller[_0xbaea('0x1f')]);module[_0xbaea('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5a2a77f..d3c8e47 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 _0x47c1=['BIGINT','INTEGER','sequelize','exports','name','STRING','FLOAT'];(function(_0x1460ab,_0x74d06e){var _0x1eeb5c=function(_0x28de38){while(--_0x28de38){_0x1460ab['push'](_0x1460ab['shift']());}};_0x1eeb5c(++_0x74d06e);}(_0x47c1,0x1bb));var _0x147c=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x47c1[_0x3cb09b];return _0x242048;};'use strict';var Sequelize=require(_0x147c('0x0'));module[_0x147c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x147c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x147c('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x147c('0x4')]},'original_sampleCount':{'type':Sequelize[_0x147c('0x5')]},'original_channelCount':{'type':Sequelize[_0x147c('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x147c('0x6')]},'converted_format':{'type':Sequelize[_0x147c('0x3')]},'converted_duration':{'type':Sequelize[_0x147c('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x147c('0x5')]},'converted_channelCount':{'type':Sequelize[_0x147c('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x147c('0x6')]}}; \ No newline at end of file +var _0x5d9f=['FLOAT','BIGINT','INTEGER','exports','STRING','name'];(function(_0x3aff12,_0x4c27ed){var _0x351b84=function(_0x35b8b5){while(--_0x35b8b5){_0x3aff12['push'](_0x3aff12['shift']());}};_0x351b84(++_0x4c27ed);}(_0x5d9f,0x1d7));var _0xf5d9=function(_0x26f692,_0x14b015){_0x26f692=_0x26f692-0x0;var _0x5d76fc=_0x5d9f[_0x26f692];return _0x5d76fc;};'use strict';var Sequelize=require('sequelize');module[_0xf5d9('0x0')]={'name':{'type':Sequelize[_0xf5d9('0x1')],'unique':_0xf5d9('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf5d9('0x1')]},'display_name':{'type':Sequelize[_0xf5d9('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xf5d9('0x3')]},'original_sampleCount':{'type':Sequelize[_0xf5d9('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xf5d9('0x4')]},'original_sampleRate':{'type':Sequelize[_0xf5d9('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xf5d9('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xf5d9('0x4')]},'converted_channelCount':{'type':Sequelize[_0xf5d9('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf5d9('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 690706a..d0309e1 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 _0x011d=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','start','description','delete','original_format','unlinkSync','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','destroy','then','Sounds','error','name','send','map','Sound','fieldName','type'];(function(_0x41f3ff,_0x2eefde){var _0xeede54=function(_0x259a33){while(--_0x259a33){_0x41f3ff['push'](_0x41f3ff['shift']());}};_0xeede54(++_0x2eefde);}(_0x011d,0x13e));var _0xd011=function(_0x313532,_0x33e75f){_0x313532=_0x313532-0x0;var _0x44bc16=_0x011d[_0x313532];return _0x44bc16;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd011('0x0'));var jsonpatch=require(_0xd011('0x1'));var rp=require('request-promise');var moment=require(_0xd011('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd011('0x3'));var util=require(_0xd011('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xd011('0x5'));var ejs=require(_0xd011('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd011('0x7'));var squel=require('squel');var crypto=require(_0xd011('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd011('0x9'));var toCsv=require(_0xd011('0x5'));var querystring=require(_0xd011('0xa'));var Papa=require(_0xd011('0xb'));var Redis=require(_0xd011('0xc'));var authService=require(_0xd011('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd011('0xe'));var hardwareService=require(_0xd011('0xf'));var logger=require(_0xd011('0x10'))(_0xd011('0x11'));var utils=require(_0xd011('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd011('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bbd1e,_0x206b60){_0x206b60=_0x206b60||0xcc;return function(_0x1c0669){if(_0x1c0669){return _0x3bbd1e[_0xd011('0x14')](_0x206b60);}return _0x3bbd1e['status'](_0x206b60)[_0xd011('0x15')]();};}function respondWithResult(_0x4007ff,_0x2663f6){_0x2663f6=_0x2663f6||0xc8;return function(_0x2b22ee){if(_0x2b22ee){return _0x4007ff['status'](_0x2663f6)[_0xd011('0x16')](_0x2b22ee);}};}function respondWithFilteredResult(_0x1b7d64,_0x1e2d51){return function(_0x1f2d25){if(_0x1f2d25){var _0x55e1a6=typeof _0x1e2d51[_0xd011('0x17')]===_0xd011('0x18')&&typeof _0x1e2d51['limit']===_0xd011('0x18');var _0x3e4bd1=_0x1f2d25[_0xd011('0x19')];var _0x1220a1=_0x55e1a6?0x0:_0x1e2d51['offset'];var _0x15e2a8=_0x55e1a6?_0x1f2d25['count']:_0x1e2d51[_0xd011('0x17')]+_0x1e2d51[_0xd011('0x1a')];var _0x54cfee;if(_0x15e2a8>=_0x3e4bd1){_0x15e2a8=_0x3e4bd1;_0x54cfee=0xc8;}else{_0x54cfee=0xce;}_0x1b7d64[_0xd011('0x1b')](_0x54cfee);return _0x1b7d64[_0xd011('0x1c')](_0xd011('0x1d'),_0x1220a1+'-'+_0x15e2a8+'/'+_0x3e4bd1)[_0xd011('0x16')](_0x1f2d25);}return null;};}function patchUpdates(_0x399cab){return function(_0x3a7a39){try{jsonpatch[_0xd011('0x1e')](_0x3a7a39,_0x399cab,!![]);}catch(_0x40a21b){return BPromise['reject'](_0x40a21b);}return _0x3a7a39['save']();};}function saveUpdates(_0x36da36,_0x304552){return function(_0x5b11b7){if(_0x5b11b7){return _0x5b11b7[_0xd011('0x1f')](_0x36da36)['then'](function(_0x52f087){return _0x52f087;});}return null;};}function removeEntity(_0x36af8a,_0x2f7a4d){return function(_0x577efe){if(_0x577efe){return _0x577efe[_0xd011('0x20')]()[_0xd011('0x21')](function(){var _0x3344a6=_0x577efe['get']({'plain':!![]});var _0x2853ba=_0xd011('0x22');return db['UserProfileResource'][_0xd011('0x20')]({'where':{'type':_0x2853ba,'resourceId':_0x3344a6['id']}})[_0xd011('0x21')](function(){return _0x577efe;});})['then'](function(){_0x36af8a[_0xd011('0x1b')](0xcc)[_0xd011('0x15')]();});}};}function handleEntityNotFound(_0x1e735b,_0x306dd7){return function(_0x17ec1f){if(!_0x17ec1f){_0x1e735b[_0xd011('0x14')](0x194);}return _0x17ec1f;};}function handleError(_0x4edaab,_0x4adcda){_0x4adcda=_0x4adcda||0x1f4;return function(_0x124616){logger[_0xd011('0x23')](_0x124616['stack']);if(_0x124616[_0xd011('0x24')]){delete _0x124616[_0xd011('0x24')];}_0x4edaab[_0xd011('0x1b')](_0x4adcda)[_0xd011('0x25')](_0x124616);};}exports['index']=function(_0x49f8b8,_0x265abb){var _0x3812d1={},_0x164bc1={},_0x38b2a3={'count':0x0,'rows':[]};var _0x1446df=_[_0xd011('0x26')](db[_0xd011('0x27')]['rawAttributes'],function(_0x2b99be){return{'name':_0x2b99be[_0xd011('0x28')],'type':_0x2b99be[_0xd011('0x29')]['key']};});_0x164bc1[_0xd011('0x2a')]=_[_0xd011('0x26')](_0x1446df,_0xd011('0x24'));_0x164bc1[_0xd011('0x2b')]=_[_0xd011('0x2c')](_0x49f8b8[_0xd011('0x2b')]);_0x164bc1[_0xd011('0x2d')]=_[_0xd011('0x2e')](_0x164bc1[_0xd011('0x2a')],_0x164bc1[_0xd011('0x2b')]);_0x3812d1['attributes']=_[_0xd011('0x2e')](_0x164bc1[_0xd011('0x2a')],qs[_0xd011('0x2f')](_0x49f8b8['query']['fields']));_0x3812d1[_0xd011('0x30')]=_0x3812d1[_0xd011('0x30')][_0xd011('0x31')]?_0x3812d1[_0xd011('0x30')]:_0x164bc1[_0xd011('0x2a')];if(!_0x49f8b8[_0xd011('0x2b')][_0xd011('0x32')](_0xd011('0x33'))){_0x3812d1[_0xd011('0x1a')]=qs[_0xd011('0x1a')](_0x49f8b8['query'][_0xd011('0x1a')]);_0x3812d1[_0xd011('0x17')]=qs[_0xd011('0x17')](_0x49f8b8[_0xd011('0x2b')][_0xd011('0x17')]);}_0x3812d1[_0xd011('0x34')]=qs['sort'](_0x49f8b8[_0xd011('0x2b')]['sort']);_0x3812d1[_0xd011('0x35')]=qs[_0xd011('0x2d')](_[_0xd011('0x36')](_0x49f8b8[_0xd011('0x2b')],_0x164bc1[_0xd011('0x2d')]),_0x1446df);if(_0x49f8b8['query'][_0xd011('0x37')]){_0x3812d1[_0xd011('0x35')]=_[_0xd011('0x38')](_0x3812d1[_0xd011('0x35')],{'$or':_[_0xd011('0x26')](_0x1446df,function(_0x1de71f){if(_0x1de71f['type']!=='VIRTUAL'){var _0x5e5be9={};_0x5e5be9[_0x1de71f[_0xd011('0x24')]]={'$like':'%'+_0x49f8b8['query']['filter']+'%'};return _0x5e5be9;}})});}_0x3812d1=_[_0xd011('0x38')]({},_0x3812d1,_0x49f8b8[_0xd011('0x39')]);var _0x2c2d3a={'where':_0x3812d1[_0xd011('0x35')]};return db[_0xd011('0x27')]['count'](_0x2c2d3a)[_0xd011('0x21')](function(_0x1775ea){_0x38b2a3[_0xd011('0x19')]=_0x1775ea;if(_0x49f8b8[_0xd011('0x2b')]['includeAll']){_0x3812d1[_0xd011('0x3a')]=[{'all':!![]}];}return db[_0xd011('0x27')][_0xd011('0x3b')](_0x3812d1);})[_0xd011('0x21')](function(_0x349390){_0x38b2a3[_0xd011('0x3c')]=_0x349390;return _0x38b2a3;})[_0xd011('0x21')](respondWithFilteredResult(_0x265abb,_0x3812d1))[_0xd011('0x3d')](handleError(_0x265abb,null));};exports[_0xd011('0x3e')]=function(_0x1d83b0,_0x186bba){var _0x2f4302={'raw':!![],'where':{'id':_0x1d83b0[_0xd011('0x3f')]['id']}},_0x1a55af={};_0x1a55af[_0xd011('0x2a')]=_[_0xd011('0x2c')](db[_0xd011('0x27')][_0xd011('0x40')]);_0x1a55af[_0xd011('0x2b')]=_[_0xd011('0x2c')](_0x1d83b0[_0xd011('0x2b')]);_0x1a55af[_0xd011('0x2d')]=_[_0xd011('0x2e')](_0x1a55af['model'],_0x1a55af[_0xd011('0x2b')]);_0x2f4302[_0xd011('0x30')]=_[_0xd011('0x2e')](_0x1a55af[_0xd011('0x2a')],qs[_0xd011('0x2f')](_0x1d83b0[_0xd011('0x2b')][_0xd011('0x2f')]));_0x2f4302['attributes']=_0x2f4302[_0xd011('0x30')]['length']?_0x2f4302['attributes']:_0x1a55af[_0xd011('0x2a')];if(_0x1d83b0[_0xd011('0x2b')][_0xd011('0x41')]){_0x2f4302[_0xd011('0x3a')]=[{'all':!![]}];}_0x2f4302=_['merge']({},_0x2f4302,_0x1d83b0['options']);return db[_0xd011('0x27')][_0xd011('0x42')](_0x2f4302)['then'](handleEntityNotFound(_0x186bba,null))[_0xd011('0x21')](respondWithResult(_0x186bba,null))['catch'](handleError(_0x186bba,null));};exports[_0xd011('0x43')]=function(_0x37e4af,_0x56f165,_0x2f044e){return db[_0xd011('0x27')][_0xd011('0x42')]({'where':{'id':_0x37e4af[_0xd011('0x3f')]['id']},'attributes':['name',_0xd011('0x44'),_0xd011('0x45')],'raw':!![]})[_0xd011('0x21')](handleEntityNotFound(_0x56f165,null))[_0xd011('0x21')](function(_0x4416c3){if(_0x4416c3){if(!fs[_0xd011('0x46')](path['join'](config[_0xd011('0x47')],_0xd011('0x48'),_0x4416c3['save_name']+'.'+_0x4416c3['converted_format']))){throw new db[(_0xd011('0x49'))][(_0xd011('0x4a'))](_0xd011('0x4b'));}return _0x56f165[_0xd011('0x43')](path[_0xd011('0x4c')](config[_0xd011('0x47')],_0xd011('0x48'),util[_0xd011('0x4d')]('%s.%s',_0x4416c3[_0xd011('0x44')],_0x4416c3['converted_format'])),util[_0xd011('0x4d')](_0xd011('0x4e'),_0x4416c3['name'],_0x4416c3[_0xd011('0x45')]));}return null;})[_0xd011('0x3d')](handleError(_0x56f165,null));};exports[_0xd011('0x4f')]=function(_0xedbbe6,_0x2cea3f,_0x15f6a4){var _0x3cee9a={'name':path[_0xd011('0x50')](_0xedbbe6[_0xd011('0x51')][_0xd011('0x52')],path[_0xd011('0x53')](_0xedbbe6[_0xd011('0x51')]['originalname'])),'save_name':path['basename'](_0xedbbe6[_0xd011('0x51')][_0xd011('0x54')],path[_0xd011('0x53')](_0xedbbe6[_0xd011('0x51')][_0xd011('0x54')])),'original_format':path['extname'](_0xedbbe6[_0xd011('0x51')][_0xd011('0x52')])[_0xd011('0x55')](0x1),'converted_format':_0xd011('0x56')};var _0x33e9c6=path['join'](config[_0xd011('0x47')],_0xd011('0x57'),_0xedbbe6[_0xd011('0x51')][_0xd011('0x54')]);var _0x509285=path[_0xd011('0x4c')](config[_0xd011('0x47')],_0xd011('0x48'),util[_0xd011('0x4d')](_0xd011('0x4e'),path[_0xd011('0x50')](_0xedbbe6['file'][_0xd011('0x54')],path[_0xd011('0x53')](_0xedbbe6[_0xd011('0x51')]['filename'])),_0x3cee9a[_0xd011('0x45')]));logger['info'](_0xd011('0x58'),_0x33e9c6);logger['info'](_0xd011('0x59'),_0x509285);try{fs['chmodSync'](_0x33e9c6,parseInt(_0xd011('0x5a'),0x8));var _0x3ef939=sox[_0xd011('0x5b')](_0x33e9c6,_0x509285,{'sampleRate':0x1f40,'format':_0xd011('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ef939['on']('error',function(_0x4c9f4c){fs['unlinkSync'](_0x33e9c6);_0x2cea3f[_0xd011('0x1b')](0x1f4)[_0xd011('0x25')](_0x4c9f4c);});_0x3ef939['on'](_0xd011('0x5c'),function(_0x4cebdc){_0x3cee9a[_0xd011('0x5d')]=isNaN(_0x4cebdc[_0xd011('0x5e')])?null:_0x4cebdc[_0xd011('0x5e')]*0x3e8;_0x3cee9a[_0xd011('0x5f')]=isNaN(_0x4cebdc[_0xd011('0x60')])?null:_0x4cebdc[_0xd011('0x60')];_0x3cee9a[_0xd011('0x61')]=isNaN(_0x4cebdc[_0xd011('0x62')])?null:_0x4cebdc[_0xd011('0x62')];_0x3cee9a[_0xd011('0x63')]=isNaN(_0x4cebdc['bitRate'])?null:_0x4cebdc[_0xd011('0x64')];_0x3cee9a['original_sampleRate']=isNaN(_0x4cebdc[_0xd011('0x65')])?null:_0x4cebdc[_0xd011('0x65')];});_0x3ef939['on'](_0xd011('0x66'),function(_0x307935){_0x3cee9a[_0xd011('0x67')]=isNaN(_0x307935[_0xd011('0x5e')])?null:_0x307935[_0xd011('0x5e')]*0x3e8;_0x3cee9a[_0xd011('0x68')]=isNaN(_0x307935[_0xd011('0x60')])?null:_0x307935['sampleCount'];_0x3cee9a[_0xd011('0x69')]=isNaN(_0x307935[_0xd011('0x62')])?null:_0x307935[_0xd011('0x62')];_0x3cee9a[_0xd011('0x6a')]=isNaN(_0x307935['bitRate'])?null:_0x307935[_0xd011('0x64')];_0x3cee9a['converted_sampleRate']=isNaN(_0x307935[_0xd011('0x65')])?null:_0x307935[_0xd011('0x65')];});_0x3ef939['on'](_0xd011('0x15'),function(){fs[_0xd011('0x6b')](_0x509285,parseInt(_0xd011('0x5a'),0x8));return db[_0xd011('0x27')]['create'](_0x3cee9a)['then'](function(_0x27cfb9){var _0x1f696a={'role':_0xedbbe6[_0xd011('0x6c')]['role'],'userProfileId':_0xedbbe6[_0xd011('0x6c')]['userProfileId']};if(!_0x1f696a)throw new Error(_0xd011('0x6d'));if(_0x1f696a[_0xd011('0x6e')]==='user'){var _0x590907=_0x27cfb9['get']({'plain':!![]});return db[_0xd011('0x6f')][_0xd011('0x42')]({'where':{'name':'Sounds','userProfileId':_0x1f696a[_0xd011('0x70')]},'raw':!![]})['then'](function(_0x5bdae8){if(_0x5bdae8&&_0x5bdae8[_0xd011('0x71')]===0x0){return db[_0xd011('0x72')][_0xd011('0x4f')]({'name':_0x590907['name'],'resourceId':_0x590907['id'],'type':_0x5bdae8[_0xd011('0x24')],'sectionId':_0x5bdae8['id']},{})[_0xd011('0x21')](function(){return _0x27cfb9;});}else{return _0x27cfb9;}})[_0xd011('0x3d')](function(_0x36de31){logger[_0xd011('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36de31);throw _0x36de31;});}return _0x27cfb9;})[_0xd011('0x21')](respondWithResult(_0x2cea3f,null))[_0xd011('0x3d')](handleError(_0x2cea3f,null));});_0x3ef939[_0xd011('0x73')]();}catch(_0x266ad7){_0x2cea3f[_0xd011('0x1b')](0x1f4)[_0xd011('0x25')](_0x266ad7);}};exports[_0xd011('0x1f')]=function(_0xd94faf,_0x587fa6,_0x626d0a){return db[_0xd011('0x27')]['find']({'where':{'id':_0xd94faf[_0xd011('0x3f')]['id']}})[_0xd011('0x21')](handleEntityNotFound(_0x587fa6,null))[_0xd011('0x21')](saveUpdates(_['pick'](_0xd94faf[_0xd011('0x6c')],[_0xd011('0x24'),_0xd011('0x74')]),null))[_0xd011('0x21')](respondWithResult(_0x587fa6,null))[_0xd011('0x3d')](handleError(_0x587fa6,null));};exports[_0xd011('0x75')]=function(_0x1a05be,_0x5963c4,_0x2d92a0){return db['Sound'][_0xd011('0x42')]({'where':{'id':_0x1a05be['params']['id']}})[_0xd011('0x21')](function(_0x2f5d83){if(_0x2f5d83){return _0x2f5d83['destroy']();}})['then'](function(_0x290f47){var _0x587ba4=path[_0xd011('0x4c')](config[_0xd011('0x47')],_0xd011('0x57'),util[_0xd011('0x4d')](_0xd011('0x4e'),_0x290f47['save_name'],_0x290f47[_0xd011('0x76')]));var _0x175661=path[_0xd011('0x4c')](config[_0xd011('0x47')],_0xd011('0x48'),util[_0xd011('0x4d')](_0xd011('0x4e'),_0x290f47['save_name'],_0x290f47[_0xd011('0x45')]));fs[_0xd011('0x77')](_0x587ba4);fs['unlinkSync'](_0x175661);return _0x290f47;})[_0xd011('0x21')](function(_0x3c1f24){if(_0x3c1f24){return _0x5963c4[_0xd011('0x1b')](0xcc)['end']();}})[_0xd011('0x21')](handleEntityNotFound(_0x5963c4,null))[_0xd011('0x3d')](handleError(_0x5963c4,null));}; \ No newline at end of file +var _0x73c9=['src','duration','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','channelCount','converted_sampleRate','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','download','save_name','converted_format','existsSync','join','root','Sequelize','server/files/sounds/converted','format','%s.%s','file','originalname','basename','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','unlinkSync'];(function(_0x5562ce,_0x27c3ca){var _0x127f20=function(_0x5d83f6){while(--_0x5d83f6){_0x5562ce['push'](_0x5562ce['shift']());}};_0x127f20(++_0x27c3ca);}(_0x73c9,0x10f));var _0x973c=function(_0x22f71b,_0x2df5bf){_0x22f71b=_0x22f71b-0x0;var _0x5c4cad=_0x73c9[_0x22f71b];return _0x5c4cad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x973c('0x0'));var zipdir=require(_0x973c('0x1'));var jsonpatch=require(_0x973c('0x2'));var rp=require(_0x973c('0x3'));var moment=require(_0x973c('0x4'));var BPromise=require(_0x973c('0x5'));var Mustache=require(_0x973c('0x6'));var util=require(_0x973c('0x7'));var path=require(_0x973c('0x8'));var sox=require(_0x973c('0x9'));var csv=require(_0x973c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x973c('0xb'));var _=require(_0x973c('0xc'));var squel=require(_0x973c('0xd'));var crypto=require(_0x973c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x973c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x973c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x973c('0x11'));var as=require(_0x973c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x973c('0x13'))('api');var utils=require(_0x973c('0x14'));var config=require(_0x973c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x973c('0x16'))['db'];function respondWithStatusCode(_0x2d8745,_0x115a95){_0x115a95=_0x115a95||0xcc;return function(_0x5e513e){if(_0x5e513e){return _0x2d8745[_0x973c('0x17')](_0x115a95);}return _0x2d8745[_0x973c('0x18')](_0x115a95)['end']();};}function respondWithResult(_0x232497,_0x1f1ddc){_0x1f1ddc=_0x1f1ddc||0xc8;return function(_0x3b5ad3){if(_0x3b5ad3){return _0x232497[_0x973c('0x18')](_0x1f1ddc)[_0x973c('0x19')](_0x3b5ad3);}};}function respondWithFilteredResult(_0x481f36,_0x1662be){return function(_0x346cb6){if(_0x346cb6){var _0x378161=typeof _0x1662be[_0x973c('0x1a')]===_0x973c('0x1b')&&typeof _0x1662be['limit']===_0x973c('0x1b');var _0x5d6a20=_0x346cb6[_0x973c('0x1c')];var _0x1c26c6=_0x378161?0x0:_0x1662be[_0x973c('0x1a')];var _0x2b4366=_0x378161?_0x346cb6[_0x973c('0x1c')]:_0x1662be['offset']+_0x1662be['limit'];var _0x29f5e0;if(_0x2b4366>=_0x5d6a20){_0x2b4366=_0x5d6a20;_0x29f5e0=0xc8;}else{_0x29f5e0=0xce;}_0x481f36[_0x973c('0x18')](_0x29f5e0);return _0x481f36['set'](_0x973c('0x1d'),_0x1c26c6+'-'+_0x2b4366+'/'+_0x5d6a20)[_0x973c('0x19')](_0x346cb6);}return null;};}function patchUpdates(_0x23fb9f){return function(_0x23f158){try{jsonpatch[_0x973c('0x1e')](_0x23f158,_0x23fb9f,!![]);}catch(_0x745726){return BPromise[_0x973c('0x1f')](_0x745726);}return _0x23f158['save']();};}function saveUpdates(_0x5d70a6,_0x431bdf){return function(_0x122110){if(_0x122110){return _0x122110[_0x973c('0x20')](_0x5d70a6)[_0x973c('0x21')](function(_0x39f022){return _0x39f022;});}return null;};}function removeEntity(_0x42bb6c,_0x5e1b10){return function(_0xaf715){if(_0xaf715){return _0xaf715[_0x973c('0x22')]()[_0x973c('0x21')](function(){var _0x471695=_0xaf715[_0x973c('0x23')]({'plain':!![]});var _0x8313c5=_0x973c('0x24');return db[_0x973c('0x25')][_0x973c('0x22')]({'where':{'type':_0x8313c5,'resourceId':_0x471695['id']}})[_0x973c('0x21')](function(){return _0xaf715;});})[_0x973c('0x21')](function(){_0x42bb6c['status'](0xcc)[_0x973c('0x26')]();});}};}function handleEntityNotFound(_0x32b3c6,_0x165b95){return function(_0x2c0234){if(!_0x2c0234){_0x32b3c6[_0x973c('0x17')](0x194);}return _0x2c0234;};}function handleError(_0x2d723e,_0x117348){_0x117348=_0x117348||0x1f4;return function(_0x5852f3){logger[_0x973c('0x27')](_0x5852f3[_0x973c('0x28')]);if(_0x5852f3[_0x973c('0x29')]){delete _0x5852f3[_0x973c('0x29')];}_0x2d723e['status'](_0x117348)[_0x973c('0x2a')](_0x5852f3);};}exports[_0x973c('0x2b')]=function(_0x484fc2,_0x3cd9a5){var _0x4a739d={},_0x5df6a6={},_0x5afe51={'count':0x0,'rows':[]};var _0x19bd64=_['map'](db[_0x973c('0x2c')][_0x973c('0x2d')],function(_0x7e15a7){return{'name':_0x7e15a7[_0x973c('0x2e')],'type':_0x7e15a7[_0x973c('0x2f')][_0x973c('0x30')]};});_0x5df6a6[_0x973c('0x31')]=_[_0x973c('0x32')](_0x19bd64,_0x973c('0x29'));_0x5df6a6[_0x973c('0x33')]=_[_0x973c('0x34')](_0x484fc2[_0x973c('0x33')]);_0x5df6a6[_0x973c('0x35')]=_['intersection'](_0x5df6a6[_0x973c('0x31')],_0x5df6a6[_0x973c('0x33')]);_0x4a739d[_0x973c('0x36')]=_[_0x973c('0x37')](_0x5df6a6[_0x973c('0x31')],qs[_0x973c('0x38')](_0x484fc2[_0x973c('0x33')][_0x973c('0x38')]));_0x4a739d['attributes']=_0x4a739d[_0x973c('0x36')][_0x973c('0x39')]?_0x4a739d[_0x973c('0x36')]:_0x5df6a6[_0x973c('0x31')];if(!_0x484fc2[_0x973c('0x33')][_0x973c('0x3a')]('nolimit')){_0x4a739d['limit']=qs[_0x973c('0x3b')](_0x484fc2[_0x973c('0x33')]['limit']);_0x4a739d[_0x973c('0x1a')]=qs[_0x973c('0x1a')](_0x484fc2[_0x973c('0x33')]['offset']);}_0x4a739d['order']=qs[_0x973c('0x3c')](_0x484fc2[_0x973c('0x33')][_0x973c('0x3c')]);_0x4a739d[_0x973c('0x3d')]=qs[_0x973c('0x35')](_[_0x973c('0x3e')](_0x484fc2[_0x973c('0x33')],_0x5df6a6[_0x973c('0x35')]),_0x19bd64);if(_0x484fc2[_0x973c('0x33')][_0x973c('0x3f')]){_0x4a739d[_0x973c('0x3d')]=_[_0x973c('0x40')](_0x4a739d[_0x973c('0x3d')],{'$or':_[_0x973c('0x32')](_0x19bd64,function(_0xf4b530){if(_0xf4b530['type']!=='VIRTUAL'){var _0x2fdfaf={};_0x2fdfaf[_0xf4b530[_0x973c('0x29')]]={'$like':'%'+_0x484fc2['query'][_0x973c('0x3f')]+'%'};return _0x2fdfaf;}})});}_0x4a739d=_[_0x973c('0x40')]({},_0x4a739d,_0x484fc2['options']);var _0x4443e4={'where':_0x4a739d[_0x973c('0x3d')]};return db['Sound'][_0x973c('0x1c')](_0x4443e4)[_0x973c('0x21')](function(_0x168336){_0x5afe51[_0x973c('0x1c')]=_0x168336;if(_0x484fc2[_0x973c('0x33')][_0x973c('0x41')]){_0x4a739d[_0x973c('0x42')]=[{'all':!![]}];}return db[_0x973c('0x2c')][_0x973c('0x43')](_0x4a739d);})['then'](function(_0x4ff584){_0x5afe51[_0x973c('0x44')]=_0x4ff584;return _0x5afe51;})['then'](respondWithFilteredResult(_0x3cd9a5,_0x4a739d))['catch'](handleError(_0x3cd9a5,null));};exports[_0x973c('0x45')]=function(_0x1b6ecc,_0x1298a1){var _0x401c75={'raw':!![],'where':{'id':_0x1b6ecc[_0x973c('0x46')]['id']}},_0x28e8cf={};_0x28e8cf['model']=_[_0x973c('0x34')](db[_0x973c('0x2c')][_0x973c('0x2d')]);_0x28e8cf[_0x973c('0x33')]=_['keys'](_0x1b6ecc[_0x973c('0x33')]);_0x28e8cf[_0x973c('0x35')]=_['intersection'](_0x28e8cf['model'],_0x28e8cf[_0x973c('0x33')]);_0x401c75[_0x973c('0x36')]=_[_0x973c('0x37')](_0x28e8cf[_0x973c('0x31')],qs[_0x973c('0x38')](_0x1b6ecc[_0x973c('0x33')]['fields']));_0x401c75['attributes']=_0x401c75[_0x973c('0x36')][_0x973c('0x39')]?_0x401c75[_0x973c('0x36')]:_0x28e8cf[_0x973c('0x31')];if(_0x1b6ecc[_0x973c('0x33')][_0x973c('0x41')]){_0x401c75[_0x973c('0x42')]=[{'all':!![]}];}_0x401c75=_[_0x973c('0x40')]({},_0x401c75,_0x1b6ecc[_0x973c('0x47')]);return db[_0x973c('0x2c')][_0x973c('0x48')](_0x401c75)[_0x973c('0x21')](handleEntityNotFound(_0x1298a1,null))[_0x973c('0x21')](respondWithResult(_0x1298a1,null))[_0x973c('0x49')](handleError(_0x1298a1,null));};exports[_0x973c('0x4a')]=function(_0x4ca309,_0x1f00ab,_0x308b28){return db[_0x973c('0x2c')]['find']({'where':{'id':_0x4ca309[_0x973c('0x46')]['id']},'attributes':[_0x973c('0x29'),_0x973c('0x4b'),_0x973c('0x4c')],'raw':!![]})[_0x973c('0x21')](handleEntityNotFound(_0x1f00ab,null))[_0x973c('0x21')](function(_0x28957c){if(_0x28957c){if(!fs[_0x973c('0x4d')](path[_0x973c('0x4e')](config[_0x973c('0x4f')],'server/files/sounds/converted',_0x28957c[_0x973c('0x4b')]+'.'+_0x28957c[_0x973c('0x4c')]))){throw new db[(_0x973c('0x50'))]['ValidationError']('Sound\x20not\x20found');}return _0x1f00ab[_0x973c('0x4a')](path[_0x973c('0x4e')](config[_0x973c('0x4f')],_0x973c('0x51'),util[_0x973c('0x52')](_0x973c('0x53'),_0x28957c[_0x973c('0x4b')],_0x28957c['converted_format'])),util['format'](_0x973c('0x53'),_0x28957c[_0x973c('0x29')],_0x28957c[_0x973c('0x4c')]));}return null;})['catch'](handleError(_0x1f00ab,null));};exports['create']=function(_0x301f4e,_0x3cd2cc,_0x44f78e){var _0x3fb003={'name':path['basename'](_0x301f4e[_0x973c('0x54')][_0x973c('0x55')],path['extname'](_0x301f4e['file'][_0x973c('0x55')])),'save_name':path[_0x973c('0x56')](_0x301f4e['file']['filename'],path[_0x973c('0x57')](_0x301f4e[_0x973c('0x54')][_0x973c('0x58')])),'original_format':path['extname'](_0x301f4e[_0x973c('0x54')][_0x973c('0x55')])[_0x973c('0x59')](0x1),'converted_format':'wav'};var _0x1c92a6=path[_0x973c('0x4e')](config['root'],_0x973c('0x5a'),_0x301f4e[_0x973c('0x54')][_0x973c('0x58')]);var _0x47839d=path[_0x973c('0x4e')](config[_0x973c('0x4f')],'server/files/sounds/converted',util[_0x973c('0x52')](_0x973c('0x53'),path[_0x973c('0x56')](_0x301f4e[_0x973c('0x54')]['filename'],path[_0x973c('0x57')](_0x301f4e[_0x973c('0x54')]['filename'])),_0x3fb003['converted_format']));logger[_0x973c('0x5b')](_0x973c('0x5c'),_0x1c92a6);logger['info'](_0x973c('0x5d'),_0x47839d);try{fs[_0x973c('0x5e')](_0x1c92a6,parseInt('0777',0x8));var _0xe99a01=sox[_0x973c('0x5f')](_0x1c92a6,_0x47839d,{'sampleRate':0x1f40,'format':_0x973c('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xe99a01['on'](_0x973c('0x27'),function(_0x14b56f){fs[_0x973c('0x61')](_0x1c92a6);_0x3cd2cc['status'](0x1f4)[_0x973c('0x2a')](_0x14b56f);});_0xe99a01['on'](_0x973c('0x62'),function(_0x38c50b){_0x3fb003['original_duration']=isNaN(_0x38c50b[_0x973c('0x63')])?null:_0x38c50b[_0x973c('0x63')]*0x3e8;_0x3fb003['original_sampleCount']=isNaN(_0x38c50b['sampleCount'])?null:_0x38c50b[_0x973c('0x64')];_0x3fb003[_0x973c('0x65')]=isNaN(_0x38c50b['channelCount'])?null:_0x38c50b['channelCount'];_0x3fb003[_0x973c('0x66')]=isNaN(_0x38c50b[_0x973c('0x67')])?null:_0x38c50b[_0x973c('0x67')];_0x3fb003[_0x973c('0x68')]=isNaN(_0x38c50b['sampleRate'])?null:_0x38c50b[_0x973c('0x69')];});_0xe99a01['on'](_0x973c('0x6a'),function(_0x5d3e39){_0x3fb003['converted_duration']=isNaN(_0x5d3e39[_0x973c('0x63')])?null:_0x5d3e39[_0x973c('0x63')]*0x3e8;_0x3fb003[_0x973c('0x6b')]=isNaN(_0x5d3e39[_0x973c('0x64')])?null:_0x5d3e39[_0x973c('0x64')];_0x3fb003[_0x973c('0x6c')]=isNaN(_0x5d3e39[_0x973c('0x6d')])?null:_0x5d3e39[_0x973c('0x6d')];_0x3fb003['converted_bitRate']=isNaN(_0x5d3e39[_0x973c('0x67')])?null:_0x5d3e39[_0x973c('0x67')];_0x3fb003[_0x973c('0x6e')]=isNaN(_0x5d3e39[_0x973c('0x69')])?null:_0x5d3e39[_0x973c('0x69')];});_0xe99a01['on']('end',function(){fs[_0x973c('0x5e')](_0x47839d,parseInt(_0x973c('0x6f'),0x8));return db[_0x973c('0x2c')][_0x973c('0x70')](_0x3fb003)[_0x973c('0x21')](function(_0x17415e){var _0x172d00={'role':_0x301f4e[_0x973c('0x71')][_0x973c('0x72')],'userProfileId':_0x301f4e['body'][_0x973c('0x73')]};if(!_0x172d00)throw new Error(_0x973c('0x74'));if(_0x172d00[_0x973c('0x72')]===_0x973c('0x75')){var _0x4b80f9=_0x17415e['get']({'plain':!![]});return db['UserProfileSection'][_0x973c('0x48')]({'where':{'name':_0x973c('0x24'),'userProfileId':_0x172d00[_0x973c('0x73')]},'raw':!![]})[_0x973c('0x21')](function(_0x1e3c36){if(_0x1e3c36&&_0x1e3c36[_0x973c('0x76')]===0x0){return db['UserProfileResource'][_0x973c('0x70')]({'name':_0x4b80f9[_0x973c('0x29')],'resourceId':_0x4b80f9['id'],'type':_0x1e3c36[_0x973c('0x29')],'sectionId':_0x1e3c36['id']},{})['then'](function(){return _0x17415e;});}else{return _0x17415e;}})['catch'](function(_0x57fb2b){logger[_0x973c('0x27')](_0x973c('0x77'),_0x57fb2b);throw _0x57fb2b;});}return _0x17415e;})[_0x973c('0x21')](respondWithResult(_0x3cd2cc,null))[_0x973c('0x49')](handleError(_0x3cd2cc,null));});_0xe99a01[_0x973c('0x78')]();}catch(_0x171e61){_0x3cd2cc[_0x973c('0x18')](0x1f4)['send'](_0x171e61);}};exports['update']=function(_0x1811a2,_0x5bbd41,_0x4c8286){return db[_0x973c('0x2c')][_0x973c('0x48')]({'where':{'id':_0x1811a2[_0x973c('0x46')]['id']}})[_0x973c('0x21')](handleEntityNotFound(_0x5bbd41,null))['then'](saveUpdates(_[_0x973c('0x3e')](_0x1811a2[_0x973c('0x71')],['name','description']),null))['then'](respondWithResult(_0x5bbd41,null))['catch'](handleError(_0x5bbd41,null));};exports[_0x973c('0x79')]=function(_0x324b21,_0x1a9c95,_0x3164b2){return db[_0x973c('0x2c')][_0x973c('0x48')]({'where':{'id':_0x324b21['params']['id']}})['then'](function(_0x37c6c5){if(_0x37c6c5){return _0x37c6c5[_0x973c('0x22')]();}})[_0x973c('0x21')](function(_0x15af6f){var _0xf66cd1=path[_0x973c('0x4e')](config[_0x973c('0x4f')],'server/files/sounds/original',util[_0x973c('0x52')](_0x973c('0x53'),_0x15af6f[_0x973c('0x4b')],_0x15af6f[_0x973c('0x7a')]));var _0x1f8324=path['join'](config[_0x973c('0x4f')],'server/files/sounds/converted',util[_0x973c('0x52')]('%s.%s',_0x15af6f['save_name'],_0x15af6f['converted_format']));fs[_0x973c('0x61')](_0xf66cd1);fs[_0x973c('0x61')](_0x1f8324);return _0x15af6f;})[_0x973c('0x21')](function(_0xb26224){if(_0xb26224){return _0x1a9c95[_0x973c('0x18')](0xcc)[_0x973c('0x26')]();}})[_0x973c('0x21')](handleEntityNotFound(_0x1a9c95,null))[_0x973c('0x49')](handleError(_0x1a9c95,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f2857ec..c75df90 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 _0x2104=['moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0x2104,0x1eb));var _0x4210=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x2104[_0x119d25];return _0x39cf30;};'use strict';var _=require('lodash');var util=require(_0x4210('0x0'));var logger=require(_0x4210('0x1'))(_0x4210('0x2'));var moment=require(_0x4210('0x3'));var BPromise=require(_0x4210('0x4'));var rp=require(_0x4210('0x5'));var fs=require('fs');var path=require(_0x4210('0x6'));var rimraf=require(_0x4210('0x7'));var config=require('../../config/environment');var attributes=require(_0x4210('0x8'));module[_0x4210('0x9')]=function(_0x7aa93f,_0x4340f5){return _0x7aa93f[_0x4210('0xa')](_0x4210('0xb'),attributes,{'tableName':_0x4210('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2ac=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x104c38,_0xc83cf3){var _0x541728=function(_0x73ff1a){while(--_0x73ff1a){_0x104c38['push'](_0x104c38['shift']());}};_0x541728(++_0xc83cf3);}(_0xa2ac,0x172));var _0xca2a=function(_0x28487c,_0x163e6a){_0x28487c=_0x28487c-0x0;var _0x4ef998=_0xa2ac[_0x28487c];return _0x4ef998;};'use strict';var _=require(_0xca2a('0x0'));var util=require('util');var logger=require(_0xca2a('0x1'))(_0xca2a('0x2'));var moment=require(_0xca2a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca2a('0x4'));var rimraf=require(_0xca2a('0x5'));var config=require(_0xca2a('0x6'));var attributes=require(_0xca2a('0x7'));module[_0xca2a('0x8')]=function(_0x215a02,_0x4c12a1){return _0x215a02[_0xca2a('0x9')]('Sound',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 6ce8a3c..6b41eca 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 _0x200b=['model','then','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSound','find','options','where','attributes','include','map'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x200b,0x197));var _0xb200=function(_0x344bcc,_0x2c2d51){_0x344bcc=_0x344bcc-0x0;var _0x289790=_0x200b[_0x344bcc];return _0x289790;};'use strict';var _=require(_0xb200('0x0'));var util=require(_0xb200('0x1'));var moment=require(_0xb200('0x2'));var BPromise=require(_0xb200('0x3'));var rs=require(_0xb200('0x4'));var fs=require('fs');var Redis=require(_0xb200('0x5'));var db=require(_0xb200('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb200('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb200('0x8'));var client=jayson[_0xb200('0x9')][_0xb200('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x178d4d,_0x5e7067,_0x2bd341){return new BPromise(function(_0x3c77bb,_0x562204){return client[_0xb200('0xb')](_0x178d4d,_0x2bd341)['then'](function(_0x52ac68){logger[_0xb200('0xc')](_0xb200('0xd'),_0x5e7067,_0xb200('0xe'));logger['debug'](_0xb200('0xf'),_0x5e7067,'request\x20sent',JSON['stringify'](_0x52ac68));if(_0x52ac68[_0xb200('0x10')]){if(_0x52ac68[_0xb200('0x10')]['code']===0x1f4){logger['error'](_0xb200('0xd'),_0x5e7067,_0x52ac68['error']['message']);return _0x562204(_0x52ac68[_0xb200('0x10')][_0xb200('0x11')]);}logger['error']('Sound,\x20%s,\x20%s',_0x5e7067,_0x52ac68[_0xb200('0x10')][_0xb200('0x11')]);return _0x3c77bb(_0x52ac68[_0xb200('0x10')][_0xb200('0x11')]);}else{logger[_0xb200('0xc')](_0xb200('0xd'),_0x5e7067,_0xb200('0xe'));_0x3c77bb(_0x52ac68[_0xb200('0x12')][_0xb200('0x11')]);}})[_0xb200('0x13')](function(_0x150f90){logger[_0xb200('0x10')](_0xb200('0xd'),_0x5e7067,_0x150f90);_0x562204(_0x150f90);});});}exports[_0xb200('0x14')]=function(_0x582df6){var _0x22dccd=this;return new Promise(function(_0x52dfbc,_0x3ea404){return db['Sound'][_0xb200('0x15')]({'raw':_0x582df6[_0xb200('0x16')]?_0x582df6[_0xb200('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x582df6[_0xb200('0x16')]?_0x582df6[_0xb200('0x16')][_0xb200('0x17')]||null:null,'attributes':_0x582df6['options']?_0x582df6[_0xb200('0x16')][_0xb200('0x18')]||null:null,'include':_0x582df6[_0xb200('0x16')]?_0x582df6[_0xb200('0x16')][_0xb200('0x19')]?_[_0xb200('0x1a')](_0x582df6[_0xb200('0x16')]['include'],function(_0x4035f1){return{'model':db[_0x4035f1[_0xb200('0x1b')]],'as':_0x4035f1['as'],'attributes':_0x4035f1[_0xb200('0x18')],'include':_0x4035f1['include']?_[_0xb200('0x1a')](_0x4035f1[_0xb200('0x19')],function(_0x3978c0){return{'model':db[_0x3978c0[_0xb200('0x1b')]],'as':_0x3978c0['as'],'attributes':_0x3978c0['attributes'],'include':_0x3978c0['include']?_['map'](_0x3978c0[_0xb200('0x19')],function(_0x3d81bc){return{'model':db[_0x3d81bc[_0xb200('0x1b')]],'as':_0x3d81bc['as'],'attributes':_0x3d81bc[_0xb200('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb200('0x1c')](function(_0x3c83a4){logger[_0xb200('0xc')](_0xb200('0x14'),_0x582df6);logger[_0xb200('0x1d')](_0xb200('0x14'),_0x582df6,JSON[_0xb200('0x1e')](_0x3c83a4));_0x52dfbc(_0x3c83a4);})[_0xb200('0x13')](function(_0x43a895){logger[_0xb200('0x10')](_0xb200('0x14'),_0x43a895['message'],_0x582df6);_0x3ea404(_0x22dccd[_0xb200('0x10')](0x1f4,_0x43a895[_0xb200('0x11')]));});});}; \ No newline at end of file +var _0xdfc9=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','find','options','include','model','attributes','map','then','ShowSound','catch','lodash'];(function(_0x3f23f8,_0x2aadcd){var _0x22edc3=function(_0x37e358){while(--_0x37e358){_0x3f23f8['push'](_0x3f23f8['shift']());}};_0x22edc3(++_0x2aadcd);}(_0xdfc9,0xf7));var _0x9dfc=function(_0xed6f46,_0x1c9006){_0xed6f46=_0xed6f46-0x0;var _0x5b267c=_0xdfc9[_0xed6f46];return _0x5b267c;};'use strict';var _=require(_0x9dfc('0x0'));var util=require(_0x9dfc('0x1'));var moment=require(_0x9dfc('0x2'));var BPromise=require(_0x9dfc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dfc('0x4'));var db=require(_0x9dfc('0x5'))['db'];var utils=require(_0x9dfc('0x6'));var logger=require('../../config/logger')(_0x9dfc('0x7'));var config=require(_0x9dfc('0x8'));var jayson=require(_0x9dfc('0x9'));var client=jayson[_0x9dfc('0xa')][_0x9dfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b8d6,_0x3dc6fe,_0x44c97e){return new BPromise(function(_0x27a57e,_0x321ee4){return client['request'](_0x52b8d6,_0x44c97e)['then'](function(_0xfad8bd){logger[_0x9dfc('0xc')](_0x9dfc('0xd'),_0x3dc6fe,'request\x20sent');logger[_0x9dfc('0xe')](_0x9dfc('0xf'),_0x3dc6fe,_0x9dfc('0x10'),JSON[_0x9dfc('0x11')](_0xfad8bd));if(_0xfad8bd[_0x9dfc('0x12')]){if(_0xfad8bd[_0x9dfc('0x12')][_0x9dfc('0x13')]===0x1f4){logger[_0x9dfc('0x12')](_0x9dfc('0xd'),_0x3dc6fe,_0xfad8bd[_0x9dfc('0x12')][_0x9dfc('0x14')]);return _0x321ee4(_0xfad8bd[_0x9dfc('0x12')]['message']);}logger[_0x9dfc('0x12')]('Sound,\x20%s,\x20%s',_0x3dc6fe,_0xfad8bd[_0x9dfc('0x12')][_0x9dfc('0x14')]);return _0x27a57e(_0xfad8bd[_0x9dfc('0x12')]['message']);}else{logger[_0x9dfc('0xc')](_0x9dfc('0xd'),_0x3dc6fe,_0x9dfc('0x10'));_0x27a57e(_0xfad8bd[_0x9dfc('0x15')][_0x9dfc('0x14')]);}})['catch'](function(_0x494047){logger['error'](_0x9dfc('0xd'),_0x3dc6fe,_0x494047);_0x321ee4(_0x494047);});});}exports['ShowSound']=function(_0x5cd5e9){var _0x429767=this;return new Promise(function(_0x45d1aa,_0x5a35ec){return db['Sound'][_0x9dfc('0x16')]({'raw':_0x5cd5e9[_0x9dfc('0x17')]?_0x5cd5e9[_0x9dfc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5cd5e9[_0x9dfc('0x17')]?_0x5cd5e9['options']['where']||null:null,'attributes':_0x5cd5e9[_0x9dfc('0x17')]?_0x5cd5e9[_0x9dfc('0x17')]['attributes']||null:null,'include':_0x5cd5e9[_0x9dfc('0x17')]?_0x5cd5e9[_0x9dfc('0x17')][_0x9dfc('0x18')]?_['map'](_0x5cd5e9[_0x9dfc('0x17')][_0x9dfc('0x18')],function(_0xf09707){return{'model':db[_0xf09707[_0x9dfc('0x19')]],'as':_0xf09707['as'],'attributes':_0xf09707[_0x9dfc('0x1a')],'include':_0xf09707['include']?_['map'](_0xf09707['include'],function(_0x3eebdc){return{'model':db[_0x3eebdc[_0x9dfc('0x19')]],'as':_0x3eebdc['as'],'attributes':_0x3eebdc[_0x9dfc('0x1a')],'include':_0x3eebdc[_0x9dfc('0x18')]?_[_0x9dfc('0x1b')](_0x3eebdc['include'],function(_0x49c813){return{'model':db[_0x49c813[_0x9dfc('0x19')]],'as':_0x49c813['as'],'attributes':_0x49c813[_0x9dfc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9dfc('0x1c')](function(_0x3d683c){logger[_0x9dfc('0xc')](_0x9dfc('0x1d'),_0x5cd5e9);logger[_0x9dfc('0xe')](_0x9dfc('0x1d'),_0x5cd5e9,JSON[_0x9dfc('0x11')](_0x3d683c));_0x45d1aa(_0x3d683c);})[_0x9dfc('0x1e')](function(_0x7ec19a){logger[_0x9dfc('0x12')]('ShowSound',_0x7ec19a[_0x9dfc('0x14')],_0x5cd5e9);_0x5a35ec(_0x429767[_0x9dfc('0x12')](0x1f4,_0x7ec19a[_0x9dfc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 899bf36..c01c394 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x260636,_0x27a833){var _0x2ed63f=function(_0x547e87){while(--_0x547e87){_0x260636['push'](_0x260636['shift']());}};_0x2ed63f(++_0x27a833);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xb7e7[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x57fcc0,_0x585004){var _0x5270df=function(_0x5f2db0){while(--_0x5f2db0){_0x57fcc0['push'](_0x57fcc0['shift']());}};_0x5270df(++_0x585004);}(_0x8603,0x190));var _0x3860=function(_0x4d398e,_0x49f5f5){_0x4d398e=_0x4d398e-0x0;var _0x1e0715=_0x8603[_0x4d398e];return _0x1e0715;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ad293ec..94a989c 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 _0x2e06=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x5b959e,_0x28debf){var _0x11df5a=function(_0x1bcd63){while(--_0x1bcd63){_0x5b959e['push'](_0x5b959e['shift']());}};_0x11df5a(++_0x28debf);}(_0x2e06,0xcb));var _0x62e0=function(_0x458043,_0x23b1ea){_0x458043=_0x458043-0x0;var _0x1a1635=_0x2e06[_0x458043];return _0x1a1635;};'use strict';var Sequelize=require(_0x62e0('0x0'));module[_0x62e0('0x1')]={'uniqueid':{'type':Sequelize[_0x62e0('0x2')]},'body':{'type':Sequelize[_0x62e0('0x3')](_0x62e0('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x62e0('0x5')]('in','out'),'defaultValue':_0x62e0('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x62e0('0x2')]},'providerResponse':{'type':Sequelize[_0x62e0('0x3')]}}; \ No newline at end of file +var _0xb756=['ENUM','out','sequelize','STRING','TEXT'];(function(_0x9283be,_0x587568){var _0x267ee0=function(_0x256a5c){while(--_0x256a5c){_0x9283be['push'](_0x9283be['shift']());}};_0x267ee0(++_0x587568);}(_0xb756,0x188));var _0x6b75=function(_0x13cdcb,_0x5cf059){_0x13cdcb=_0x13cdcb-0x0;var _0x28fff4=_0xb756[_0x13cdcb];return _0x28fff4;};'use strict';var Sequelize=require(_0x6b75('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x6b75('0x1')]},'body':{'type':Sequelize[_0x6b75('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x6b75('0x3')]('in',_0x6b75('0x4')),'defaultValue':_0x6b75('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6b75('0x1')]},'providerResponse':{'type':Sequelize[_0x6b75('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 55f11c2..0caba7e 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 _0xdb89=['path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','sendStatus','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x3f7ba5,_0x402666){var _0xa7d981=function(_0xc156f1){while(--_0xc156f1){_0x3f7ba5['push'](_0x3f7ba5['shift']());}};_0xa7d981(++_0x402666);}(_0xdb89,0xda));var _0x9db8=function(_0x55e25d,_0x357aa7){_0x55e25d=_0x55e25d-0x0;var _0x1f59c1=_0xdb89[_0x55e25d];return _0x1f59c1;};'use strict';var emlformat=require(_0x9db8('0x0'));var rimraf=require(_0x9db8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9db8('0x2'));var moment=require(_0x9db8('0x3'));var BPromise=require(_0x9db8('0x4'));var Mustache=require(_0x9db8('0x5'));var util=require(_0x9db8('0x6'));var path=require(_0x9db8('0x7'));var sox=require(_0x9db8('0x8'));var csv=require(_0x9db8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9db8('0xa'));var _=require(_0x9db8('0xb'));var squel=require(_0x9db8('0xc'));var crypto=require(_0x9db8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9db8('0xe'));var toCsv=require(_0x9db8('0x9'));var querystring=require(_0x9db8('0xf'));var Papa=require(_0x9db8('0x10'));var Redis=require('ioredis');var authService=require(_0x9db8('0x11'));var qs=require(_0x9db8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9db8('0x13'))(_0x9db8('0x14'));var utils=require(_0x9db8('0x15'));var config=require(_0x9db8('0x16'));var licenseUtil=require(_0x9db8('0x17'));var db=require(_0x9db8('0x18'))['db'];function respondWithStatusCode(_0x59142a,_0x1d98a8){_0x1d98a8=_0x1d98a8||0xcc;return function(_0x1409cb){if(_0x1409cb){return _0x59142a['sendStatus'](_0x1d98a8);}return _0x59142a['status'](_0x1d98a8)[_0x9db8('0x19')]();};}function respondWithResult(_0x1c689e,_0x6c54eb){_0x6c54eb=_0x6c54eb||0xc8;return function(_0x422b6d){if(_0x422b6d){return _0x1c689e[_0x9db8('0x1a')](_0x6c54eb)[_0x9db8('0x1b')](_0x422b6d);}};}function respondWithFilteredResult(_0x5760fd,_0x5f26b5){return function(_0x2880d7){if(_0x2880d7){var _0x58cf9f=typeof _0x5f26b5[_0x9db8('0x1c')]==='undefined'&&typeof _0x5f26b5[_0x9db8('0x1d')]===_0x9db8('0x1e');var _0x269591=_0x2880d7[_0x9db8('0x1f')];var _0x5632c3=_0x58cf9f?0x0:_0x5f26b5['offset'];var _0x136621=_0x58cf9f?_0x2880d7[_0x9db8('0x1f')]:_0x5f26b5[_0x9db8('0x1c')]+_0x5f26b5[_0x9db8('0x1d')];var _0x48924b;if(_0x136621>=_0x269591){_0x136621=_0x269591;_0x48924b=0xc8;}else{_0x48924b=0xce;}_0x5760fd[_0x9db8('0x1a')](_0x48924b);return _0x5760fd[_0x9db8('0x20')](_0x9db8('0x21'),_0x5632c3+'-'+_0x136621+'/'+_0x269591)[_0x9db8('0x1b')](_0x2880d7);}return null;};}function patchUpdates(_0xa94a2c){return function(_0x31ab32){try{jsonpatch['apply'](_0x31ab32,_0xa94a2c,!![]);}catch(_0x353a70){return BPromise[_0x9db8('0x22')](_0x353a70);}return _0x31ab32[_0x9db8('0x23')]();};}function saveUpdates(_0x182326,_0x4fadbd){return function(_0x5495f9){if(_0x5495f9){return _0x5495f9[_0x9db8('0x24')](_0x182326)[_0x9db8('0x25')](function(_0x3a423f){return _0x3a423f;});}return null;};}function removeEntity(_0xaf2628,_0x24df5e){return function(_0x35149f){if(_0x35149f){return _0x35149f['destroy']()[_0x9db8('0x25')](function(){_0xaf2628[_0x9db8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541844,_0x389484){return function(_0x47d47b){if(!_0x47d47b){_0x541844[_0x9db8('0x26')](0x194);}return _0x47d47b;};}function handleError(_0x856faf,_0xdfe698){_0xdfe698=_0xdfe698||0x1f4;return function(_0x51047a){logger[_0x9db8('0x27')](_0x51047a['stack']);if(_0x51047a[_0x9db8('0x28')]){delete _0x51047a[_0x9db8('0x28')];}_0x856faf['status'](_0xdfe698)[_0x9db8('0x29')](_0x51047a);};}exports[_0x9db8('0x2a')]=function(_0x4a5e54,_0x434e5a){var _0x4948fb={},_0x1d395b={},_0x5e8f10={'count':0x0,'rows':[]};var _0xd0c994=_[_0x9db8('0x2b')](db[_0x9db8('0x2c')][_0x9db8('0x2d')],function(_0x20f9c9){return{'name':_0x20f9c9[_0x9db8('0x2e')],'type':_0x20f9c9[_0x9db8('0x2f')][_0x9db8('0x30')]};});_0x1d395b[_0x9db8('0x31')]=_[_0x9db8('0x2b')](_0xd0c994,_0x9db8('0x28'));_0x1d395b[_0x9db8('0x32')]=_[_0x9db8('0x33')](_0x4a5e54[_0x9db8('0x32')]);_0x1d395b[_0x9db8('0x34')]=_['intersection'](_0x1d395b[_0x9db8('0x31')],_0x1d395b[_0x9db8('0x32')]);_0x4948fb['attributes']=_[_0x9db8('0x35')](_0x1d395b[_0x9db8('0x31')],qs[_0x9db8('0x36')](_0x4a5e54[_0x9db8('0x32')]['fields']));_0x4948fb[_0x9db8('0x37')]=_0x4948fb[_0x9db8('0x37')]['length']?_0x4948fb[_0x9db8('0x37')]:_0x1d395b[_0x9db8('0x31')];if(!_0x4a5e54[_0x9db8('0x32')][_0x9db8('0x38')]('nolimit')){_0x4948fb[_0x9db8('0x1d')]=qs[_0x9db8('0x1d')](_0x4a5e54['query'][_0x9db8('0x1d')]);_0x4948fb[_0x9db8('0x1c')]=qs['offset'](_0x4a5e54[_0x9db8('0x32')]['offset']);}_0x4948fb[_0x9db8('0x39')]=qs[_0x9db8('0x3a')](_0x4a5e54[_0x9db8('0x32')]['sort']);_0x4948fb[_0x9db8('0x3b')]=qs['filters'](_[_0x9db8('0x3c')](_0x4a5e54[_0x9db8('0x32')],_0x1d395b[_0x9db8('0x34')]),_0xd0c994);if(_0x4a5e54['query']['filter']){_0x4948fb['where']=_[_0x9db8('0x3d')](_0x4948fb['where'],{'$or':_[_0x9db8('0x2b')](_0xd0c994,function(_0x37260c){if(_0x37260c[_0x9db8('0x2f')]!==_0x9db8('0x3e')){var _0x13236d={};_0x13236d[_0x37260c['name']]={'$like':'%'+_0x4a5e54[_0x9db8('0x32')]['filter']+'%'};return _0x13236d;}})});}_0x4948fb=_['merge']({},_0x4948fb,_0x4a5e54[_0x9db8('0x3f')]);var _0x1cdef2={'where':_0x4948fb[_0x9db8('0x3b')]};return db[_0x9db8('0x2c')][_0x9db8('0x1f')](_0x1cdef2)[_0x9db8('0x25')](function(_0x2ec2b3){_0x5e8f10['count']=_0x2ec2b3;if(_0x4a5e54[_0x9db8('0x32')][_0x9db8('0x40')]){_0x4948fb[_0x9db8('0x41')]=[{'all':!![]}];}return db[_0x9db8('0x2c')][_0x9db8('0x42')](_0x4948fb);})[_0x9db8('0x25')](function(_0x372de6){_0x5e8f10[_0x9db8('0x43')]=_0x372de6;return _0x5e8f10;})['then'](respondWithFilteredResult(_0x434e5a,_0x4948fb))[_0x9db8('0x44')](handleError(_0x434e5a,null));};exports[_0x9db8('0x45')]=function(_0x452374,_0x499fcf){var _0x28c4d5={'raw':!![],'where':{'id':_0x452374[_0x9db8('0x46')]['id']}},_0x566fac={};_0x566fac[_0x9db8('0x31')]=_['keys'](db[_0x9db8('0x2c')]['rawAttributes']);_0x566fac[_0x9db8('0x32')]=_['keys'](_0x452374['query']);_0x566fac[_0x9db8('0x34')]=_[_0x9db8('0x35')](_0x566fac[_0x9db8('0x31')],_0x566fac[_0x9db8('0x32')]);_0x28c4d5[_0x9db8('0x37')]=_[_0x9db8('0x35')](_0x566fac['model'],qs['fields'](_0x452374['query']['fields']));_0x28c4d5['attributes']=_0x28c4d5['attributes'][_0x9db8('0x47')]?_0x28c4d5[_0x9db8('0x37')]:_0x566fac[_0x9db8('0x31')];if(_0x452374[_0x9db8('0x32')][_0x9db8('0x40')]){_0x28c4d5[_0x9db8('0x41')]=[{'all':!![]}];}_0x28c4d5=_['merge']({},_0x28c4d5,_0x452374['options']);return db[_0x9db8('0x2c')]['find'](_0x28c4d5)[_0x9db8('0x25')](handleEntityNotFound(_0x499fcf,null))[_0x9db8('0x25')](respondWithResult(_0x499fcf,null))[_0x9db8('0x44')](handleError(_0x499fcf,null));};exports[_0x9db8('0x48')]=function(_0x30e520,_0x3c2144){return db[_0x9db8('0x2c')][_0x9db8('0x48')](_0x30e520['body'],{})[_0x9db8('0x25')](respondWithResult(_0x3c2144,0xc9))['catch'](handleError(_0x3c2144,null));};exports['update']=function(_0x320ec7,_0x5e5c19){if(_0x320ec7[_0x9db8('0x49')]['id']){delete _0x320ec7[_0x9db8('0x49')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x320ec7['params']['id']}})[_0x9db8('0x25')](handleEntityNotFound(_0x5e5c19,null))[_0x9db8('0x25')](saveUpdates(_0x320ec7[_0x9db8('0x49')],null))[_0x9db8('0x25')](respondWithResult(_0x5e5c19,null))['catch'](handleError(_0x5e5c19,null));};exports['destroy']=function(_0x38d2be,_0x42cf87){return db[_0x9db8('0x2c')][_0x9db8('0x4a')]({'where':{'id':_0x38d2be['params']['id']}})[_0x9db8('0x25')](handleEntityNotFound(_0x42cf87,null))[_0x9db8('0x25')](removeEntity(_0x42cf87,null))[_0x9db8('0x44')](handleError(_0x42cf87,null));}; \ No newline at end of file +var _0x57fc=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash'];(function(_0x18b7ab,_0x29beb7){var _0x209e12=function(_0x5aea02){while(--_0x5aea02){_0x18b7ab['push'](_0x18b7ab['shift']());}};_0x209e12(++_0x29beb7);}(_0x57fc,0x1c9));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc57f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc57f('0x1'));var jsonpatch=require(_0xc57f('0x2'));var rp=require(_0xc57f('0x3'));var moment=require(_0xc57f('0x4'));var BPromise=require(_0xc57f('0x5'));var Mustache=require(_0xc57f('0x6'));var util=require(_0xc57f('0x7'));var path=require('path');var sox=require(_0xc57f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc57f('0x9'));var _=require(_0xc57f('0xa'));var squel=require(_0xc57f('0xb'));var crypto=require(_0xc57f('0xc'));var jsforce=require(_0xc57f('0xd'));var deskjs=require(_0xc57f('0xe'));var toCsv=require(_0xc57f('0xf'));var querystring=require(_0xc57f('0x10'));var Papa=require(_0xc57f('0x11'));var Redis=require(_0xc57f('0x12'));var authService=require(_0xc57f('0x13'));var qs=require(_0xc57f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc57f('0x15'))(_0xc57f('0x16'));var utils=require('../../config/utils');var config=require(_0xc57f('0x17'));var licenseUtil=require(_0xc57f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e40ad,_0x1912b9){_0x1912b9=_0x1912b9||0xcc;return function(_0x456ed9){if(_0x456ed9){return _0x4e40ad[_0xc57f('0x19')](_0x1912b9);}return _0x4e40ad[_0xc57f('0x1a')](_0x1912b9)['end']();};}function respondWithResult(_0x22709a,_0x1e3398){_0x1e3398=_0x1e3398||0xc8;return function(_0x26e069){if(_0x26e069){return _0x22709a[_0xc57f('0x1a')](_0x1e3398)[_0xc57f('0x1b')](_0x26e069);}};}function respondWithFilteredResult(_0x463833,_0x3490e6){return function(_0x55bbae){if(_0x55bbae){var _0x2cdee8=typeof _0x3490e6[_0xc57f('0x1c')]==='undefined'&&typeof _0x3490e6[_0xc57f('0x1d')]===_0xc57f('0x1e');var _0x5be5f5=_0x55bbae['count'];var _0x1b004d=_0x2cdee8?0x0:_0x3490e6[_0xc57f('0x1c')];var _0x11970a=_0x2cdee8?_0x55bbae[_0xc57f('0x1f')]:_0x3490e6[_0xc57f('0x1c')]+_0x3490e6['limit'];var _0x38110c;if(_0x11970a>=_0x5be5f5){_0x11970a=_0x5be5f5;_0x38110c=0xc8;}else{_0x38110c=0xce;}_0x463833[_0xc57f('0x1a')](_0x38110c);return _0x463833[_0xc57f('0x20')](_0xc57f('0x21'),_0x1b004d+'-'+_0x11970a+'/'+_0x5be5f5)[_0xc57f('0x1b')](_0x55bbae);}return null;};}function patchUpdates(_0x1c275d){return function(_0x1943b0){try{jsonpatch[_0xc57f('0x22')](_0x1943b0,_0x1c275d,!![]);}catch(_0x2b982a){return BPromise[_0xc57f('0x23')](_0x2b982a);}return _0x1943b0[_0xc57f('0x24')]();};}function saveUpdates(_0x17c2df,_0x318c67){return function(_0x2308d0){if(_0x2308d0){return _0x2308d0[_0xc57f('0x25')](_0x17c2df)[_0xc57f('0x26')](function(_0x258d5c){return _0x258d5c;});}return null;};}function removeEntity(_0x55f554,_0x34a75e){return function(_0x2dff0b){if(_0x2dff0b){return _0x2dff0b[_0xc57f('0x27')]()[_0xc57f('0x26')](function(){_0x55f554[_0xc57f('0x1a')](0xcc)[_0xc57f('0x28')]();});}};}function handleEntityNotFound(_0x554027,_0x21d5ae){return function(_0x40df90){if(!_0x40df90){_0x554027['sendStatus'](0x194);}return _0x40df90;};}function handleError(_0x5022ec,_0x2e10b5){_0x2e10b5=_0x2e10b5||0x1f4;return function(_0x3442dc){logger[_0xc57f('0x29')](_0x3442dc['stack']);if(_0x3442dc[_0xc57f('0x2a')]){delete _0x3442dc[_0xc57f('0x2a')];}_0x5022ec['status'](_0x2e10b5)[_0xc57f('0x2b')](_0x3442dc);};}exports[_0xc57f('0x2c')]=function(_0x473554,_0x3e92e4){var _0x319166={},_0x40e1ea={},_0x2b99f0={'count':0x0,'rows':[]};var _0x186ed8=_[_0xc57f('0x2d')](db[_0xc57f('0x2e')][_0xc57f('0x2f')],function(_0x5da89d){return{'name':_0x5da89d[_0xc57f('0x30')],'type':_0x5da89d['type'][_0xc57f('0x31')]};});_0x40e1ea[_0xc57f('0x32')]=_[_0xc57f('0x2d')](_0x186ed8,_0xc57f('0x2a'));_0x40e1ea['query']=_['keys'](_0x473554[_0xc57f('0x33')]);_0x40e1ea['filters']=_['intersection'](_0x40e1ea['model'],_0x40e1ea[_0xc57f('0x33')]);_0x319166[_0xc57f('0x34')]=_[_0xc57f('0x35')](_0x40e1ea[_0xc57f('0x32')],qs[_0xc57f('0x36')](_0x473554[_0xc57f('0x33')]['fields']));_0x319166['attributes']=_0x319166['attributes'][_0xc57f('0x37')]?_0x319166['attributes']:_0x40e1ea[_0xc57f('0x32')];if(!_0x473554['query'][_0xc57f('0x38')](_0xc57f('0x39'))){_0x319166[_0xc57f('0x1d')]=qs[_0xc57f('0x1d')](_0x473554[_0xc57f('0x33')][_0xc57f('0x1d')]);_0x319166[_0xc57f('0x1c')]=qs[_0xc57f('0x1c')](_0x473554[_0xc57f('0x33')]['offset']);}_0x319166[_0xc57f('0x3a')]=qs[_0xc57f('0x3b')](_0x473554[_0xc57f('0x33')][_0xc57f('0x3b')]);_0x319166['where']=qs[_0xc57f('0x3c')](_[_0xc57f('0x3d')](_0x473554[_0xc57f('0x33')],_0x40e1ea['filters']),_0x186ed8);if(_0x473554[_0xc57f('0x33')][_0xc57f('0x3e')]){_0x319166['where']=_[_0xc57f('0x3f')](_0x319166[_0xc57f('0x40')],{'$or':_[_0xc57f('0x2d')](_0x186ed8,function(_0x5b0634){if(_0x5b0634[_0xc57f('0x41')]!==_0xc57f('0x42')){var _0x453672={};_0x453672[_0x5b0634[_0xc57f('0x2a')]]={'$like':'%'+_0x473554[_0xc57f('0x33')][_0xc57f('0x3e')]+'%'};return _0x453672;}})});}_0x319166=_[_0xc57f('0x3f')]({},_0x319166,_0x473554[_0xc57f('0x43')]);var _0x173c7d={'where':_0x319166[_0xc57f('0x40')]};return db[_0xc57f('0x2e')][_0xc57f('0x1f')](_0x173c7d)['then'](function(_0x212b5f){_0x2b99f0[_0xc57f('0x1f')]=_0x212b5f;if(_0x473554[_0xc57f('0x33')][_0xc57f('0x44')]){_0x319166[_0xc57f('0x45')]=[{'all':!![]}];}return db[_0xc57f('0x2e')][_0xc57f('0x46')](_0x319166);})[_0xc57f('0x26')](function(_0x19b48b){_0x2b99f0[_0xc57f('0x47')]=_0x19b48b;return _0x2b99f0;})[_0xc57f('0x26')](respondWithFilteredResult(_0x3e92e4,_0x319166))['catch'](handleError(_0x3e92e4,null));};exports[_0xc57f('0x48')]=function(_0xd46e6c,_0x7b3d7d){var _0x30c7df={'raw':!![],'where':{'id':_0xd46e6c[_0xc57f('0x49')]['id']}},_0x207692={};_0x207692[_0xc57f('0x32')]=_['keys'](db[_0xc57f('0x2e')][_0xc57f('0x2f')]);_0x207692[_0xc57f('0x33')]=_['keys'](_0xd46e6c['query']);_0x207692[_0xc57f('0x3c')]=_[_0xc57f('0x35')](_0x207692[_0xc57f('0x32')],_0x207692[_0xc57f('0x33')]);_0x30c7df[_0xc57f('0x34')]=_[_0xc57f('0x35')](_0x207692['model'],qs[_0xc57f('0x36')](_0xd46e6c[_0xc57f('0x33')]['fields']));_0x30c7df[_0xc57f('0x34')]=_0x30c7df[_0xc57f('0x34')][_0xc57f('0x37')]?_0x30c7df[_0xc57f('0x34')]:_0x207692[_0xc57f('0x32')];if(_0xd46e6c[_0xc57f('0x33')][_0xc57f('0x44')]){_0x30c7df[_0xc57f('0x45')]=[{'all':!![]}];}_0x30c7df=_['merge']({},_0x30c7df,_0xd46e6c['options']);return db[_0xc57f('0x2e')][_0xc57f('0x4a')](_0x30c7df)[_0xc57f('0x26')](handleEntityNotFound(_0x7b3d7d,null))['then'](respondWithResult(_0x7b3d7d,null))['catch'](handleError(_0x7b3d7d,null));};exports[_0xc57f('0x4b')]=function(_0x3c175f,_0x1f53e2){return db[_0xc57f('0x2e')][_0xc57f('0x4b')](_0x3c175f[_0xc57f('0x4c')],{})[_0xc57f('0x26')](respondWithResult(_0x1f53e2,0xc9))['catch'](handleError(_0x1f53e2,null));};exports[_0xc57f('0x25')]=function(_0x34d4ea,_0x3ee6aa){if(_0x34d4ea[_0xc57f('0x4c')]['id']){delete _0x34d4ea[_0xc57f('0x4c')]['id'];}return db[_0xc57f('0x2e')][_0xc57f('0x4a')]({'where':{'id':_0x34d4ea[_0xc57f('0x49')]['id']}})[_0xc57f('0x26')](handleEntityNotFound(_0x3ee6aa,null))[_0xc57f('0x26')](saveUpdates(_0x34d4ea[_0xc57f('0x4c')],null))['then'](respondWithResult(_0x3ee6aa,null))['catch'](handleError(_0x3ee6aa,null));};exports[_0xc57f('0x27')]=function(_0x3bf842,_0x4b7c23){return db[_0xc57f('0x2e')][_0xc57f('0x4a')]({'where':{'id':_0x3bf842[_0xc57f('0x49')]['id']}})[_0xc57f('0x26')](handleEntityNotFound(_0x4b7c23,null))[_0xc57f('0x26')](removeEntity(_0x4b7c23,null))[_0xc57f('0x4d')](handleError(_0x4b7c23,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ddcaa20..e868d48 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 _0x0c4b=['lodash','api','moment','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x0c4b,0x96));var _0xb0c4=function(_0x490014,_0x519ad6){_0x490014=_0x490014-0x0;var _0x289bee=_0x0c4b[_0x490014];return _0x289bee;};'use strict';var _=require(_0xb0c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0c4('0x1'));var moment=require(_0xb0c4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0c4('0x3'));var rimraf=require(_0xb0c4('0x4'));var config=require(_0xb0c4('0x5'));var attributes=require('./squareMessage.attributes');module[_0xb0c4('0x6')]=function(_0x23adb7,_0x340f60){return _0x23adb7[_0xb0c4('0x7')](_0xb0c4('0x8'),attributes,{'tableName':_0xb0c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38cf=['bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util','../../config/logger','moment'];(function(_0x51b50a,_0x42f109){var _0xfff6c2=function(_0x130196){while(--_0x130196){_0x51b50a['push'](_0x51b50a['shift']());}};_0xfff6c2(++_0x42f109);}(_0x38cf,0x14e));var _0xf38c=function(_0x44d6f5,_0x53becb){_0x44d6f5=_0x44d6f5-0x0;var _0x486c28=_0x38cf[_0x44d6f5];return _0x486c28;};'use strict';var _=require(_0xf38c('0x0'));var util=require(_0xf38c('0x1'));var logger=require(_0xf38c('0x2'))('api');var moment=require(_0xf38c('0x3'));var BPromise=require(_0xf38c('0x4'));var rp=require(_0xf38c('0x5'));var fs=require('fs');var path=require(_0xf38c('0x6'));var rimraf=require(_0xf38c('0x7'));var config=require(_0xf38c('0x8'));var attributes=require(_0xf38c('0x9'));module[_0xf38c('0xa')]=function(_0x481ed4,_0x53d6c6){return _0x481ed4['define'](_0xf38c('0xb'),attributes,{'tableName':_0xf38c('0xc'),'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 98b341e..be212a3 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 _0x3592=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareMessage','create','body','raw','CreateSquareMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x340092,_0x556475){var _0x1724a6=function(_0x45ecdb){while(--_0x45ecdb){_0x340092['push'](_0x340092['shift']());}};_0x1724a6(++_0x556475);}(_0x3592,0x1bf));var _0x2359=function(_0x1a8892,_0x48d157){_0x1a8892=_0x1a8892-0x0;var _0x2444a2=_0x3592[_0x1a8892];return _0x2444a2;};'use strict';var _=require('lodash');var util=require(_0x2359('0x0'));var moment=require(_0x2359('0x1'));var BPromise=require(_0x2359('0x2'));var rs=require(_0x2359('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2359('0x4'))['db'];var utils=require(_0x2359('0x5'));var logger=require(_0x2359('0x6'))('rpc');var config=require(_0x2359('0x7'));var jayson=require(_0x2359('0x8'));var client=jayson[_0x2359('0x9')][_0x2359('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ce00,_0x17fa31,_0x56510a){return new BPromise(function(_0x38b7b6,_0x3bc32f){return client['request'](_0x32ce00,_0x56510a)[_0x2359('0xb')](function(_0x8f8eee){logger[_0x2359('0xc')](_0x2359('0xd'),_0x17fa31,_0x2359('0xe'));logger[_0x2359('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x17fa31,'request\x20sent',JSON[_0x2359('0x10')](_0x8f8eee));if(_0x8f8eee[_0x2359('0x11')]){if(_0x8f8eee['error'][_0x2359('0x12')]===0x1f4){logger[_0x2359('0x11')](_0x2359('0xd'),_0x17fa31,_0x8f8eee[_0x2359('0x11')]['message']);return _0x3bc32f(_0x8f8eee[_0x2359('0x11')][_0x2359('0x13')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x17fa31,_0x8f8eee[_0x2359('0x11')][_0x2359('0x13')]);return _0x38b7b6(_0x8f8eee[_0x2359('0x11')][_0x2359('0x13')]);}else{logger[_0x2359('0xc')](_0x2359('0xd'),_0x17fa31,'request\x20sent');_0x38b7b6(_0x8f8eee[_0x2359('0x14')][_0x2359('0x13')]);}})[_0x2359('0x15')](function(_0x38acb2){logger[_0x2359('0x11')](_0x2359('0xd'),_0x17fa31,_0x38acb2);_0x3bc32f(_0x38acb2);});});}exports['CreateSquareMessage']=function(_0x21b2be){var _0x18f34f=this;return new Promise(function(_0x45a1cd,_0x436ab0){return db[_0x2359('0x16')][_0x2359('0x17')](_0x21b2be[_0x2359('0x18')],{'raw':_0x21b2be['options']?_0x21b2be['options'][_0x2359('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x56762a){logger[_0x2359('0xc')](_0x2359('0x1a'),_0x21b2be);logger['debug']('CreateSquareMessage',_0x21b2be,JSON[_0x2359('0x10')](_0x56762a));_0x45a1cd(_0x56762a);})[_0x2359('0x15')](function(_0x47edc5){logger[_0x2359('0x11')](_0x2359('0x1a'),_0x47edc5[_0x2359('0x13')],_0x21b2be);_0x436ab0(_0x18f34f['error'](0x1f4,_0x47edc5['message']));});});}; \ No newline at end of file +var _0xf941=['options','info','CreateSquareMessage','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','create','body'];(function(_0x10af96,_0x1c9d47){var _0x1d37eb=function(_0x245f0b){while(--_0x245f0b){_0x10af96['push'](_0x10af96['shift']());}};_0x1d37eb(++_0x1c9d47);}(_0xf941,0x1e3));var _0x1f94=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf941[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f94('0x0'));var BPromise=require('bluebird');var rs=require(_0x1f94('0x1'));var fs=require('fs');var Redis=require(_0x1f94('0x2'));var db=require(_0x1f94('0x3'))['db'];var utils=require(_0x1f94('0x4'));var logger=require('../../config/logger')(_0x1f94('0x5'));var config=require(_0x1f94('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f94('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5050bb,_0xf9088c,_0x42694f){return new BPromise(function(_0x3c1ca8,_0x513471){return client[_0x1f94('0x8')](_0x5050bb,_0x42694f)['then'](function(_0x2e5730){logger['info'](_0x1f94('0x9'),_0xf9088c,_0x1f94('0xa'));logger[_0x1f94('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0xf9088c,_0x1f94('0xa'),JSON[_0x1f94('0xc')](_0x2e5730));if(_0x2e5730[_0x1f94('0xd')]){if(_0x2e5730[_0x1f94('0xd')]['code']===0x1f4){logger[_0x1f94('0xd')](_0x1f94('0x9'),_0xf9088c,_0x2e5730['error']['message']);return _0x513471(_0x2e5730['error']['message']);}logger[_0x1f94('0xd')](_0x1f94('0x9'),_0xf9088c,_0x2e5730[_0x1f94('0xd')][_0x1f94('0xe')]);return _0x3c1ca8(_0x2e5730['error'][_0x1f94('0xe')]);}else{logger['info'](_0x1f94('0x9'),_0xf9088c,_0x1f94('0xa'));_0x3c1ca8(_0x2e5730['result'][_0x1f94('0xe')]);}})['catch'](function(_0x38d651){logger[_0x1f94('0xd')](_0x1f94('0x9'),_0xf9088c,_0x38d651);_0x513471(_0x38d651);});});}exports['CreateSquareMessage']=function(_0x3b9de6){var _0x69267=this;return new Promise(function(_0x2fb1d3,_0x41c83a){return db['SquareMessage'][_0x1f94('0xf')](_0x3b9de6[_0x1f94('0x10')],{'raw':_0x3b9de6['options']?_0x3b9de6[_0x1f94('0x11')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23a7bc){logger[_0x1f94('0x12')](_0x1f94('0x13'),_0x3b9de6);logger[_0x1f94('0xb')](_0x1f94('0x13'),_0x3b9de6,JSON['stringify'](_0x23a7bc));_0x2fb1d3(_0x23a7bc);})['catch'](function(_0x78ba96){logger[_0x1f94('0xd')](_0x1f94('0x13'),_0x78ba96[_0x1f94('0xe')],_0x3b9de6);_0x41c83a(_0x69267['error'](0x1f4,_0x78ba96['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ecf9fb3..e8f4882 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 _0xc491=['isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xc491,0x7b));var _0x1c49=function(_0x387583,_0x127b08){_0x387583=_0x387583-0x0;var _0x45d2f9=_0xc491[_0x387583];return _0x45d2f9;};'use strict';var multer=require(_0x1c49('0x0'));var util=require('util');var path=require(_0x1c49('0x1'));var timeout=require(_0x1c49('0x2'));var express=require(_0x1c49('0x3'));var router=express[_0x1c49('0x4')]();var fs_extra=require(_0x1c49('0x5'));var auth=require(_0x1c49('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1c49('0x7'));var controller=require('./squareOdbc.controller');router[_0x1c49('0x8')]('/',auth[_0x1c49('0x9')](),controller[_0x1c49('0xa')]);router[_0x1c49('0x8')](_0x1c49('0xb'),auth[_0x1c49('0x9')](),controller[_0x1c49('0xc')]);router[_0x1c49('0x8')](_0x1c49('0xd'),auth[_0x1c49('0x9')](),timeout(_0x1c49('0xe')),controller[_0x1c49('0xf')]);router[_0x1c49('0x10')]('/',auth[_0x1c49('0x9')](),controller[_0x1c49('0x11')]);router['put']('/:id',auth[_0x1c49('0x9')](),controller[_0x1c49('0x12')]);router[_0x1c49('0x13')](_0x1c49('0xb'),auth[_0x1c49('0x9')](),controller[_0x1c49('0x14')]);module[_0x1c49('0x15')]=router; \ No newline at end of file +var _0x8630=['index','show','get','/:id/test','post','create','put','/:id','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8630,0x118));var _0x0863=function(_0x57f7ed,_0x4480e6){_0x57f7ed=_0x57f7ed-0x0;var _0x1ca4e3=_0x8630[_0x57f7ed];return _0x1ca4e3;};'use strict';var multer=require('multer');var util=require(_0x0863('0x0'));var path=require('path');var timeout=require(_0x0863('0x1'));var express=require(_0x0863('0x2'));var router=express[_0x0863('0x3')]();var fs_extra=require(_0x0863('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0863('0x5'));var config=require('../../config/environment');var controller=require(_0x0863('0x6'));router['get']('/',auth[_0x0863('0x7')](),controller[_0x0863('0x8')]);router['get']('/:id',auth[_0x0863('0x7')](),controller[_0x0863('0x9')]);router[_0x0863('0xa')](_0x0863('0xb'),auth[_0x0863('0x7')](),timeout('15s'),controller['test']);router[_0x0863('0xc')]('/',auth[_0x0863('0x7')](),controller[_0x0863('0xd')]);router[_0x0863('0xe')](_0x0863('0xf'),auth[_0x0863('0x7')](),controller[_0x0863('0x10')]);router['delete']('/:id',auth[_0x0863('0x7')](),controller['destroy']);module[_0x0863('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index cfcd0cb..3b5b441 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 _0x3b46=['STRING','name','sequelize'];(function(_0xfd885e,_0x436051){var _0xd8bfac=function(_0x5992b4){while(--_0x5992b4){_0xfd885e['push'](_0xfd885e['shift']());}};_0xd8bfac(++_0x436051);}(_0x3b46,0x1e8));var _0x63b4=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0x3b46[_0x2181b1];return _0x530548;};'use strict';var Sequelize=require(_0x63b4('0x0'));module['exports']={'name':{'type':Sequelize[_0x63b4('0x1')],'unique':_0x63b4('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x63b4('0x1')]}}; \ No newline at end of file +var _0x4ac2=['sequelize','exports','STRING'];(function(_0x3be38f,_0x18f6dc){var _0x4244f8=function(_0x4abb60){while(--_0x4abb60){_0x3be38f['push'](_0x3be38f['shift']());}};_0x4244f8(++_0x18f6dc);}(_0x4ac2,0x17a));var _0x24ac=function(_0x295455,_0x32e2e8){_0x295455=_0x295455-0x0;var _0x4150ae=_0x4ac2[_0x295455];return _0x4150ae;};'use strict';var Sequelize=require(_0x24ac('0x0'));module[_0x24ac('0x1')]={'name':{'type':Sequelize[_0x24ac('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x24ac('0x2')]},'description':{'type':Sequelize[_0x24ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 7737821..ad73b78 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 _0x8b28=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','SquareOdbc','rows','catch','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x237fea,_0x1ff78a){var _0x2a04f1=function(_0x4518c3){while(--_0x4518c3){_0x237fea['push'](_0x237fea['shift']());}};_0x2a04f1(++_0x1ff78a);}(_0x8b28,0x194));var _0x88b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b28[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x88b2('0x0'));var rimraf=require(_0x88b2('0x1'));var zipdir=require(_0x88b2('0x2'));var jsonpatch=require(_0x88b2('0x3'));var rp=require(_0x88b2('0x4'));var moment=require(_0x88b2('0x5'));var BPromise=require(_0x88b2('0x6'));var Mustache=require(_0x88b2('0x7'));var util=require('util');var path=require(_0x88b2('0x8'));var sox=require('sox');var csv=require(_0x88b2('0x9'));var ejs=require(_0x88b2('0xa'));var fs=require('fs');var fs_extra=require(_0x88b2('0xb'));var _=require(_0x88b2('0xc'));var squel=require(_0x88b2('0xd'));var crypto=require(_0x88b2('0xe'));var jsforce=require(_0x88b2('0xf'));var deskjs=require(_0x88b2('0x10'));var toCsv=require(_0x88b2('0x9'));var querystring=require(_0x88b2('0x11'));var Papa=require(_0x88b2('0x12'));var Redis=require(_0x88b2('0x13'));var authService=require(_0x88b2('0x14'));var qs=require(_0x88b2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88b2('0x16'));var logger=require(_0x88b2('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x88b2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x88b2('0x19'))['db'];function respondWithStatusCode(_0x3bbf73,_0x1467f3){_0x1467f3=_0x1467f3||0xcc;return function(_0x2227c3){if(_0x2227c3){return _0x3bbf73[_0x88b2('0x1a')](_0x1467f3);}return _0x3bbf73[_0x88b2('0x1b')](_0x1467f3)['end']();};}function respondWithResult(_0x1535d0,_0x5da595){_0x5da595=_0x5da595||0xc8;return function(_0x56e6f3){if(_0x56e6f3){return _0x1535d0[_0x88b2('0x1b')](_0x5da595)[_0x88b2('0x1c')](_0x56e6f3);}};}function respondWithFilteredResult(_0xa68909,_0x3f1fb6){return function(_0x290978){if(_0x290978){var _0x7b0c6c=typeof _0x3f1fb6['offset']===_0x88b2('0x1d')&&typeof _0x3f1fb6[_0x88b2('0x1e')]===_0x88b2('0x1d');var _0x206755=_0x290978[_0x88b2('0x1f')];var _0x3126fc=_0x7b0c6c?0x0:_0x3f1fb6[_0x88b2('0x20')];var _0x4c1a18=_0x7b0c6c?_0x290978[_0x88b2('0x1f')]:_0x3f1fb6[_0x88b2('0x20')]+_0x3f1fb6[_0x88b2('0x1e')];var _0x681df8;if(_0x4c1a18>=_0x206755){_0x4c1a18=_0x206755;_0x681df8=0xc8;}else{_0x681df8=0xce;}_0xa68909[_0x88b2('0x1b')](_0x681df8);return _0xa68909[_0x88b2('0x21')](_0x88b2('0x22'),_0x3126fc+'-'+_0x4c1a18+'/'+_0x206755)[_0x88b2('0x1c')](_0x290978);}return null;};}function patchUpdates(_0x53bf25){return function(_0x43cba3){try{jsonpatch[_0x88b2('0x23')](_0x43cba3,_0x53bf25,!![]);}catch(_0x2237ed){return BPromise[_0x88b2('0x24')](_0x2237ed);}return _0x43cba3[_0x88b2('0x25')]();};}function saveUpdates(_0x3175a6,_0x5628a3){return function(_0x407fd8){if(_0x407fd8){return _0x407fd8['update'](_0x3175a6)[_0x88b2('0x26')](function(_0x128ebe){return _0x128ebe;});}return null;};}function removeEntity(_0x9ffb2,_0x5cd07a){return function(_0x3e801b){if(_0x3e801b){return _0x3e801b[_0x88b2('0x27')]()[_0x88b2('0x26')](function(){var _0x2d467e=_0x3e801b[_0x88b2('0x28')]({'plain':!![]});var _0x342c3f=_0x88b2('0x29');return db[_0x88b2('0x2a')][_0x88b2('0x27')]({'where':{'type':_0x342c3f,'resourceId':_0x2d467e['id']}})['then'](function(){return _0x3e801b;});})['then'](function(){_0x9ffb2[_0x88b2('0x1b')](0xcc)[_0x88b2('0x2b')]();});}};}function handleEntityNotFound(_0xcc1ea0,_0x29dd24){return function(_0x5ee644){if(!_0x5ee644){_0xcc1ea0[_0x88b2('0x1a')](0x194);}return _0x5ee644;};}function handleError(_0x55b569,_0x5cd09a){_0x5cd09a=_0x5cd09a||0x1f4;return function(_0x3c3d6a){logger[_0x88b2('0x2c')](_0x3c3d6a[_0x88b2('0x2d')]);if(_0x3c3d6a[_0x88b2('0x2e')]){delete _0x3c3d6a['name'];}_0x55b569['status'](_0x5cd09a)[_0x88b2('0x2f')](_0x3c3d6a);};}exports[_0x88b2('0x30')]=function(_0x15a696,_0x5646da){var _0x17fc63={},_0x4788bd={},_0x2ffaa6={'count':0x0,'rows':[]};var _0xe764ed=_[_0x88b2('0x31')](db['SquareOdbc'][_0x88b2('0x32')],function(_0x45c4b8){return{'name':_0x45c4b8['fieldName'],'type':_0x45c4b8['type']['key']};});_0x4788bd['model']=_[_0x88b2('0x31')](_0xe764ed,_0x88b2('0x2e'));_0x4788bd[_0x88b2('0x33')]=_['keys'](_0x15a696[_0x88b2('0x33')]);_0x4788bd[_0x88b2('0x34')]=_[_0x88b2('0x35')](_0x4788bd[_0x88b2('0x36')],_0x4788bd[_0x88b2('0x33')]);_0x17fc63[_0x88b2('0x37')]=_[_0x88b2('0x35')](_0x4788bd[_0x88b2('0x36')],qs[_0x88b2('0x38')](_0x15a696[_0x88b2('0x33')][_0x88b2('0x38')]));_0x17fc63[_0x88b2('0x37')]=_0x17fc63['attributes']['length']?_0x17fc63[_0x88b2('0x37')]:_0x4788bd['model'];if(!_0x15a696[_0x88b2('0x33')][_0x88b2('0x39')]('nolimit')){_0x17fc63[_0x88b2('0x1e')]=qs[_0x88b2('0x1e')](_0x15a696[_0x88b2('0x33')][_0x88b2('0x1e')]);_0x17fc63['offset']=qs[_0x88b2('0x20')](_0x15a696[_0x88b2('0x33')][_0x88b2('0x20')]);}_0x17fc63[_0x88b2('0x3a')]=qs['sort'](_0x15a696['query'][_0x88b2('0x3b')]);_0x17fc63[_0x88b2('0x3c')]=qs[_0x88b2('0x34')](_[_0x88b2('0x3d')](_0x15a696[_0x88b2('0x33')],_0x4788bd['filters']),_0xe764ed);if(_0x15a696[_0x88b2('0x33')][_0x88b2('0x3e')]){_0x17fc63[_0x88b2('0x3c')]=_[_0x88b2('0x3f')](_0x17fc63[_0x88b2('0x3c')],{'$or':_['map'](_0xe764ed,function(_0x275ef4){if(_0x275ef4[_0x88b2('0x40')]!==_0x88b2('0x41')){var _0x3f8f54={};_0x3f8f54[_0x275ef4['name']]={'$like':'%'+_0x15a696[_0x88b2('0x33')][_0x88b2('0x3e')]+'%'};return _0x3f8f54;}})});}_0x17fc63=_['merge']({},_0x17fc63,_0x15a696[_0x88b2('0x42')]);var _0x173f5d={'where':_0x17fc63[_0x88b2('0x3c')]};return db['SquareOdbc'][_0x88b2('0x1f')](_0x173f5d)['then'](function(_0x324e97){_0x2ffaa6[_0x88b2('0x1f')]=_0x324e97;if(_0x15a696[_0x88b2('0x33')][_0x88b2('0x43')]){_0x17fc63['include']=[{'all':!![]}];}return db[_0x88b2('0x44')]['findAll'](_0x17fc63);})[_0x88b2('0x26')](function(_0x2eb7f1){_0x2ffaa6[_0x88b2('0x45')]=_0x2eb7f1;return _0x2ffaa6;})[_0x88b2('0x26')](respondWithFilteredResult(_0x5646da,_0x17fc63))[_0x88b2('0x46')](handleError(_0x5646da,null));};exports['show']=function(_0x385999,_0x1bf5a8){var _0x243bed={'raw':!![],'where':{'id':_0x385999[_0x88b2('0x47')]['id']}},_0x2a96ce={};_0x2a96ce['model']=_['keys'](db[_0x88b2('0x44')]['rawAttributes']);_0x2a96ce[_0x88b2('0x33')]=_['keys'](_0x385999[_0x88b2('0x33')]);_0x2a96ce['filters']=_[_0x88b2('0x35')](_0x2a96ce[_0x88b2('0x36')],_0x2a96ce[_0x88b2('0x33')]);_0x243bed[_0x88b2('0x37')]=_[_0x88b2('0x35')](_0x2a96ce[_0x88b2('0x36')],qs[_0x88b2('0x38')](_0x385999[_0x88b2('0x33')][_0x88b2('0x38')]));_0x243bed['attributes']=_0x243bed[_0x88b2('0x37')]['length']?_0x243bed[_0x88b2('0x37')]:_0x2a96ce[_0x88b2('0x36')];if(_0x385999[_0x88b2('0x33')][_0x88b2('0x43')]){_0x243bed[_0x88b2('0x48')]=[{'all':!![]}];}_0x243bed=_[_0x88b2('0x3f')]({},_0x243bed,_0x385999[_0x88b2('0x42')]);return db['SquareOdbc'][_0x88b2('0x49')](_0x243bed)[_0x88b2('0x26')](handleEntityNotFound(_0x1bf5a8,null))['then'](respondWithResult(_0x1bf5a8,null))[_0x88b2('0x46')](handleError(_0x1bf5a8,null));};exports[_0x88b2('0x4a')]=function(_0x246c0e,_0x346880){return db[_0x88b2('0x44')][_0x88b2('0x4a')](_0x246c0e[_0x88b2('0x4b')],{})[_0x88b2('0x26')](function(_0x4bb7f1){var _0x213766=_0x246c0e['user'][_0x88b2('0x28')]({'plain':!![]});if(!_0x213766)throw new Error(_0x88b2('0x4c'));if(_0x213766['role']==='user'){var _0x3a49b3=_0x4bb7f1[_0x88b2('0x28')]({'plain':!![]});var _0x4d40f9=_0x88b2('0x29');return db['UserProfileSection'][_0x88b2('0x49')]({'where':{'name':_0x4d40f9,'userProfileId':_0x213766['userProfileId']},'raw':!![]})[_0x88b2('0x26')](function(_0x26ad60){if(_0x26ad60&&_0x26ad60[_0x88b2('0x4d')]===0x0){return db['UserProfileResource'][_0x88b2('0x4a')]({'name':_0x3a49b3[_0x88b2('0x2e')],'resourceId':_0x3a49b3['id'],'type':_0x26ad60[_0x88b2('0x2e')],'sectionId':_0x26ad60['id']},{})[_0x88b2('0x26')](function(){return _0x4bb7f1;});}else{return _0x4bb7f1;}})[_0x88b2('0x46')](function(_0x3acd9d){logger['error'](_0x88b2('0x4e'),_0x3acd9d);throw _0x3acd9d;});}return _0x4bb7f1;})[_0x88b2('0x26')](respondWithResult(_0x346880,0xc9))[_0x88b2('0x46')](handleError(_0x346880,null));};exports[_0x88b2('0x4f')]=function(_0x11c23b,_0x5c0e40){if(_0x11c23b[_0x88b2('0x4b')]['id']){delete _0x11c23b[_0x88b2('0x4b')]['id'];}return db[_0x88b2('0x44')][_0x88b2('0x49')]({'where':{'id':_0x11c23b['params']['id']}})[_0x88b2('0x26')](handleEntityNotFound(_0x5c0e40,null))[_0x88b2('0x26')](saveUpdates(_0x11c23b['body'],null))[_0x88b2('0x26')](respondWithResult(_0x5c0e40,null))['catch'](handleError(_0x5c0e40,null));};exports[_0x88b2('0x27')]=function(_0x5ba348,_0x3a969b){return db[_0x88b2('0x44')][_0x88b2('0x49')]({'where':{'id':_0x5ba348[_0x88b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a969b,null))[_0x88b2('0x26')](removeEntity(_0x3a969b,null))[_0x88b2('0x46')](handleError(_0x3a969b,null));};exports['test']=function(_0x5ed8a9,_0x2ec657,_0x56d1a3){var _0x13ddc3;return db[_0x88b2('0x44')][_0x88b2('0x49')]({'where':{'id':_0x5ed8a9[_0x88b2('0x47')]['id']},'attributes':['id',_0x88b2('0x50')]})['then'](handleEntityNotFound(_0x2ec657,null))[_0x88b2('0x26')](function(_0x459f24){if(_0x459f24){var _0x1e4e61=require(_0x88b2('0x51'))();_0x1e4e61[_0x88b2('0x52')](_0x459f24['dsn']);_0x1e4e61[_0x88b2('0x53')]();return _0x459f24;}})[_0x88b2('0x26')](respondWithResult(_0x2ec657,null))[_0x88b2('0x46')](handleError(_0x2ec657,null));}; \ No newline at end of file +var _0x3a03=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','SquareOdbc','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1f39fe,_0x5763fa){var _0x1792d8=function(_0x1145f7){while(--_0x1145f7){_0x1f39fe['push'](_0x1f39fe['shift']());}};_0x1792d8(++_0x5763fa);}(_0x3a03,0x1b6));var _0x33a0=function(_0x2102f0,_0x268d83){_0x2102f0=_0x2102f0-0x0;var _0x456a38=_0x3a03[_0x2102f0];return _0x456a38;};'use strict';var emlformat=require(_0x33a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33a0('0x1'));var jsonpatch=require(_0x33a0('0x2'));var rp=require(_0x33a0('0x3'));var moment=require(_0x33a0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x33a0('0x5'));var util=require(_0x33a0('0x6'));var path=require('path');var sox=require(_0x33a0('0x7'));var csv=require(_0x33a0('0x8'));var ejs=require(_0x33a0('0x9'));var fs=require('fs');var fs_extra=require(_0x33a0('0xa'));var _=require(_0x33a0('0xb'));var squel=require(_0x33a0('0xc'));var crypto=require(_0x33a0('0xd'));var jsforce=require(_0x33a0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x33a0('0x8'));var querystring=require(_0x33a0('0xf'));var Papa=require(_0x33a0('0x10'));var Redis=require(_0x33a0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x33a0('0x12'));var as=require(_0x33a0('0x13'));var hardwareService=require(_0x33a0('0x14'));var logger=require('../../config/logger')(_0x33a0('0x15'));var utils=require(_0x33a0('0x16'));var config=require(_0x33a0('0x17'));var licenseUtil=require(_0x33a0('0x18'));var db=require(_0x33a0('0x19'))['db'];function respondWithStatusCode(_0x3abf6b,_0x46879f){_0x46879f=_0x46879f||0xcc;return function(_0x17ff7c){if(_0x17ff7c){return _0x3abf6b[_0x33a0('0x1a')](_0x46879f);}return _0x3abf6b[_0x33a0('0x1b')](_0x46879f)[_0x33a0('0x1c')]();};}function respondWithResult(_0x21c4e2,_0x2668d1){_0x2668d1=_0x2668d1||0xc8;return function(_0x54299c){if(_0x54299c){return _0x21c4e2[_0x33a0('0x1b')](_0x2668d1)[_0x33a0('0x1d')](_0x54299c);}};}function respondWithFilteredResult(_0x4a3c2c,_0x587e7b){return function(_0x3ef5dc){if(_0x3ef5dc){var _0x38642c=typeof _0x587e7b[_0x33a0('0x1e')]===_0x33a0('0x1f')&&typeof _0x587e7b[_0x33a0('0x20')]===_0x33a0('0x1f');var _0x41eb61=_0x3ef5dc[_0x33a0('0x21')];var _0x2acc1e=_0x38642c?0x0:_0x587e7b['offset'];var _0x277ba9=_0x38642c?_0x3ef5dc[_0x33a0('0x21')]:_0x587e7b[_0x33a0('0x1e')]+_0x587e7b[_0x33a0('0x20')];var _0x3bebe5;if(_0x277ba9>=_0x41eb61){_0x277ba9=_0x41eb61;_0x3bebe5=0xc8;}else{_0x3bebe5=0xce;}_0x4a3c2c['status'](_0x3bebe5);return _0x4a3c2c[_0x33a0('0x22')](_0x33a0('0x23'),_0x2acc1e+'-'+_0x277ba9+'/'+_0x41eb61)['json'](_0x3ef5dc);}return null;};}function patchUpdates(_0xe200d){return function(_0x14e0c6){try{jsonpatch[_0x33a0('0x24')](_0x14e0c6,_0xe200d,!![]);}catch(_0x1889f3){return BPromise['reject'](_0x1889f3);}return _0x14e0c6['save']();};}function saveUpdates(_0xa218b9,_0x1e3372){return function(_0xd6ff27){if(_0xd6ff27){return _0xd6ff27[_0x33a0('0x25')](_0xa218b9)[_0x33a0('0x26')](function(_0x1b1dca){return _0x1b1dca;});}return null;};}function removeEntity(_0x17f7a9,_0x59a0b3){return function(_0x345520){if(_0x345520){return _0x345520[_0x33a0('0x27')]()['then'](function(){var _0x30dce1=_0x345520[_0x33a0('0x28')]({'plain':!![]});var _0x533a0d=_0x33a0('0x29');return db[_0x33a0('0x2a')][_0x33a0('0x27')]({'where':{'type':_0x533a0d,'resourceId':_0x30dce1['id']}})[_0x33a0('0x26')](function(){return _0x345520;});})['then'](function(){_0x17f7a9[_0x33a0('0x1b')](0xcc)[_0x33a0('0x1c')]();});}};}function handleEntityNotFound(_0x3275e2,_0x3c3e18){return function(_0x4c5ca3){if(!_0x4c5ca3){_0x3275e2['sendStatus'](0x194);}return _0x4c5ca3;};}function handleError(_0x5ea7b6,_0x49c4c2){_0x49c4c2=_0x49c4c2||0x1f4;return function(_0x874112){logger[_0x33a0('0x2b')](_0x874112[_0x33a0('0x2c')]);if(_0x874112[_0x33a0('0x2d')]){delete _0x874112['name'];}_0x5ea7b6[_0x33a0('0x1b')](_0x49c4c2)[_0x33a0('0x2e')](_0x874112);};}exports['index']=function(_0xa8608f,_0x211e38){var _0x59a05c={},_0x42d737={},_0x1a1f6f={'count':0x0,'rows':[]};var _0x48530=_[_0x33a0('0x2f')](db['SquareOdbc'][_0x33a0('0x30')],function(_0x4dcd73){return{'name':_0x4dcd73[_0x33a0('0x31')],'type':_0x4dcd73[_0x33a0('0x32')][_0x33a0('0x33')]};});_0x42d737[_0x33a0('0x34')]=_[_0x33a0('0x2f')](_0x48530,_0x33a0('0x2d'));_0x42d737['query']=_[_0x33a0('0x35')](_0xa8608f[_0x33a0('0x36')]);_0x42d737[_0x33a0('0x37')]=_[_0x33a0('0x38')](_0x42d737['model'],_0x42d737['query']);_0x59a05c[_0x33a0('0x39')]=_[_0x33a0('0x38')](_0x42d737[_0x33a0('0x34')],qs['fields'](_0xa8608f[_0x33a0('0x36')][_0x33a0('0x3a')]));_0x59a05c[_0x33a0('0x39')]=_0x59a05c[_0x33a0('0x39')][_0x33a0('0x3b')]?_0x59a05c[_0x33a0('0x39')]:_0x42d737[_0x33a0('0x34')];if(!_0xa8608f['query'][_0x33a0('0x3c')](_0x33a0('0x3d'))){_0x59a05c[_0x33a0('0x20')]=qs['limit'](_0xa8608f['query'][_0x33a0('0x20')]);_0x59a05c[_0x33a0('0x1e')]=qs['offset'](_0xa8608f[_0x33a0('0x36')][_0x33a0('0x1e')]);}_0x59a05c[_0x33a0('0x3e')]=qs['sort'](_0xa8608f[_0x33a0('0x36')][_0x33a0('0x3f')]);_0x59a05c[_0x33a0('0x40')]=qs['filters'](_[_0x33a0('0x41')](_0xa8608f[_0x33a0('0x36')],_0x42d737[_0x33a0('0x37')]),_0x48530);if(_0xa8608f[_0x33a0('0x36')][_0x33a0('0x42')]){_0x59a05c[_0x33a0('0x40')]=_[_0x33a0('0x43')](_0x59a05c[_0x33a0('0x40')],{'$or':_[_0x33a0('0x2f')](_0x48530,function(_0x190c35){if(_0x190c35['type']!=='VIRTUAL'){var _0x1d39e7={};_0x1d39e7[_0x190c35[_0x33a0('0x2d')]]={'$like':'%'+_0xa8608f[_0x33a0('0x36')]['filter']+'%'};return _0x1d39e7;}})});}_0x59a05c=_['merge']({},_0x59a05c,_0xa8608f[_0x33a0('0x44')]);var _0x48db1e={'where':_0x59a05c[_0x33a0('0x40')]};return db['SquareOdbc'][_0x33a0('0x21')](_0x48db1e)[_0x33a0('0x26')](function(_0x355353){_0x1a1f6f[_0x33a0('0x21')]=_0x355353;if(_0xa8608f[_0x33a0('0x36')][_0x33a0('0x45')]){_0x59a05c[_0x33a0('0x46')]=[{'all':!![]}];}return db[_0x33a0('0x47')][_0x33a0('0x48')](_0x59a05c);})[_0x33a0('0x26')](function(_0xdda207){_0x1a1f6f[_0x33a0('0x49')]=_0xdda207;return _0x1a1f6f;})[_0x33a0('0x26')](respondWithFilteredResult(_0x211e38,_0x59a05c))['catch'](handleError(_0x211e38,null));};exports[_0x33a0('0x4a')]=function(_0x16fd7a,_0x45b565){var _0x3e78dd={'raw':!![],'where':{'id':_0x16fd7a[_0x33a0('0x4b')]['id']}},_0x2bf672={};_0x2bf672[_0x33a0('0x34')]=_[_0x33a0('0x35')](db[_0x33a0('0x47')]['rawAttributes']);_0x2bf672[_0x33a0('0x36')]=_[_0x33a0('0x35')](_0x16fd7a['query']);_0x2bf672[_0x33a0('0x37')]=_[_0x33a0('0x38')](_0x2bf672[_0x33a0('0x34')],_0x2bf672[_0x33a0('0x36')]);_0x3e78dd[_0x33a0('0x39')]=_[_0x33a0('0x38')](_0x2bf672[_0x33a0('0x34')],qs[_0x33a0('0x3a')](_0x16fd7a[_0x33a0('0x36')][_0x33a0('0x3a')]));_0x3e78dd[_0x33a0('0x39')]=_0x3e78dd[_0x33a0('0x39')]['length']?_0x3e78dd[_0x33a0('0x39')]:_0x2bf672[_0x33a0('0x34')];if(_0x16fd7a[_0x33a0('0x36')][_0x33a0('0x45')]){_0x3e78dd[_0x33a0('0x46')]=[{'all':!![]}];}_0x3e78dd=_['merge']({},_0x3e78dd,_0x16fd7a['options']);return db[_0x33a0('0x47')]['find'](_0x3e78dd)['then'](handleEntityNotFound(_0x45b565,null))['then'](respondWithResult(_0x45b565,null))[_0x33a0('0x4c')](handleError(_0x45b565,null));};exports[_0x33a0('0x4d')]=function(_0xa06d64,_0x4fbb57){return db[_0x33a0('0x47')][_0x33a0('0x4d')](_0xa06d64[_0x33a0('0x4e')],{})['then'](function(_0xed46fa){var _0x391bf2=_0xa06d64[_0x33a0('0x4f')][_0x33a0('0x28')]({'plain':!![]});if(!_0x391bf2)throw new Error(_0x33a0('0x50'));if(_0x391bf2[_0x33a0('0x51')]===_0x33a0('0x4f')){var _0x5a79ab=_0xed46fa[_0x33a0('0x28')]({'plain':!![]});var _0xcf0b99=_0x33a0('0x29');return db[_0x33a0('0x52')][_0x33a0('0x53')]({'where':{'name':_0xcf0b99,'userProfileId':_0x391bf2[_0x33a0('0x54')]},'raw':!![]})['then'](function(_0x3b5125){if(_0x3b5125&&_0x3b5125[_0x33a0('0x55')]===0x0){return db[_0x33a0('0x2a')]['create']({'name':_0x5a79ab[_0x33a0('0x2d')],'resourceId':_0x5a79ab['id'],'type':_0x3b5125[_0x33a0('0x2d')],'sectionId':_0x3b5125['id']},{})[_0x33a0('0x26')](function(){return _0xed46fa;});}else{return _0xed46fa;}})[_0x33a0('0x4c')](function(_0x5f4618){logger['error'](_0x33a0('0x56'),_0x5f4618);throw _0x5f4618;});}return _0xed46fa;})[_0x33a0('0x26')](respondWithResult(_0x4fbb57,0xc9))[_0x33a0('0x4c')](handleError(_0x4fbb57,null));};exports[_0x33a0('0x25')]=function(_0x2d38ed,_0x525ef6){if(_0x2d38ed[_0x33a0('0x4e')]['id']){delete _0x2d38ed[_0x33a0('0x4e')]['id'];}return db[_0x33a0('0x47')][_0x33a0('0x53')]({'where':{'id':_0x2d38ed[_0x33a0('0x4b')]['id']}})[_0x33a0('0x26')](handleEntityNotFound(_0x525ef6,null))[_0x33a0('0x26')](saveUpdates(_0x2d38ed[_0x33a0('0x4e')],null))[_0x33a0('0x26')](respondWithResult(_0x525ef6,null))[_0x33a0('0x4c')](handleError(_0x525ef6,null));};exports['destroy']=function(_0x443e45,_0x16a6d2){return db[_0x33a0('0x47')][_0x33a0('0x53')]({'where':{'id':_0x443e45[_0x33a0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16a6d2,null))[_0x33a0('0x26')](removeEntity(_0x16a6d2,null))[_0x33a0('0x4c')](handleError(_0x16a6d2,null));};exports[_0x33a0('0x57')]=function(_0x13e149,_0x5f0d5e,_0x379179){var _0x5227c3;return db[_0x33a0('0x47')]['find']({'where':{'id':_0x13e149['params']['id']},'attributes':['id',_0x33a0('0x58')]})[_0x33a0('0x26')](handleEntityNotFound(_0x5f0d5e,null))[_0x33a0('0x26')](function(_0x29b90d){if(_0x29b90d){var _0x2c7d18=require('odbc')();_0x2c7d18[_0x33a0('0x59')](_0x29b90d['dsn']);_0x2c7d18['closeSync']();return _0x29b90d;}})['then'](respondWithResult(_0x5f0d5e,null))[_0x33a0('0x4c')](handleError(_0x5f0d5e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 27d039d..49faa50 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 _0x7d8f=['request-promise','rimraf','exports','define','square_odbc','lodash','util','api','moment','bluebird'];(function(_0x52591a,_0x1c4f04){var _0x59548d=function(_0x2d7973){while(--_0x2d7973){_0x52591a['push'](_0x52591a['shift']());}};_0x59548d(++_0x1c4f04);}(_0x7d8f,0xcd));var _0xf7d8=function(_0x75b66c,_0x4d69b4){_0x75b66c=_0x75b66c-0x0;var _0x4f0a44=_0x7d8f[_0x75b66c];return _0x4f0a44;};'use strict';var _=require(_0xf7d8('0x0'));var util=require(_0xf7d8('0x1'));var logger=require('../../config/logger')(_0xf7d8('0x2'));var moment=require(_0xf7d8('0x3'));var BPromise=require(_0xf7d8('0x4'));var rp=require(_0xf7d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7d8('0x6'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0xf7d8('0x7')]=function(_0x4850c9,_0x2f0318){return _0x4850c9[_0xf7d8('0x8')]('SquareOdbc',attributes,{'tableName':_0xf7d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e05=['util','../../config/logger','api','moment','path','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x52f91e,_0x4491a7){var _0x553032=function(_0x9fddbf){while(--_0x9fddbf){_0x52f91e['push'](_0x52f91e['shift']());}};_0x553032(++_0x4491a7);}(_0x5e05,0x1b7));var _0x55e0=function(_0x4f385f,_0x52d090){_0x4f385f=_0x4f385f-0x0;var _0x521bfd=_0x5e05[_0x4f385f];return _0x521bfd;};'use strict';var _=require(_0x55e0('0x0'));var util=require(_0x55e0('0x1'));var logger=require(_0x55e0('0x2'))(_0x55e0('0x3'));var moment=require(_0x55e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x55e0('0x5'));var rimraf=require('rimraf');var config=require(_0x55e0('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x55e0('0x7')]=function(_0x1828f3,_0x2d9b53){return _0x1828f3[_0x55e0('0x8')](_0x55e0('0x9'),attributes,{'tableName':_0x55e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b77f11d..36006ff 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 _0x15e2=['model','attributes','map','debug','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include'];(function(_0x282b7d,_0x46e0da){var _0x122d87=function(_0x3cabcf){while(--_0x3cabcf){_0x282b7d['push'](_0x282b7d['shift']());}};_0x122d87(++_0x46e0da);}(_0x15e2,0x112));var _0x215e=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x15e2[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x215e('0x0'));var moment=require('moment');var BPromise=require(_0x215e('0x1'));var rs=require(_0x215e('0x2'));var fs=require('fs');var Redis=require(_0x215e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x215e('0x4'));var logger=require('../../config/logger')(_0x215e('0x5'));var config=require('../../config/environment');var jayson=require(_0x215e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4feb5a,_0x138b08,_0x10b1b6){return new BPromise(function(_0x24c1f4,_0x542ffa){return client[_0x215e('0x7')](_0x4feb5a,_0x10b1b6)[_0x215e('0x8')](function(_0x251c85){logger['info'](_0x215e('0x9'),_0x138b08,_0x215e('0xa'));logger['debug'](_0x215e('0xb'),_0x138b08,'request\x20sent',JSON[_0x215e('0xc')](_0x251c85));if(_0x251c85[_0x215e('0xd')]){if(_0x251c85[_0x215e('0xd')][_0x215e('0xe')]===0x1f4){logger[_0x215e('0xd')](_0x215e('0x9'),_0x138b08,_0x251c85[_0x215e('0xd')]['message']);return _0x542ffa(_0x251c85['error']['message']);}logger['error'](_0x215e('0x9'),_0x138b08,_0x251c85[_0x215e('0xd')]['message']);return _0x24c1f4(_0x251c85[_0x215e('0xd')][_0x215e('0xf')]);}else{logger[_0x215e('0x10')](_0x215e('0x9'),_0x138b08,_0x215e('0xa'));_0x24c1f4(_0x251c85[_0x215e('0x11')][_0x215e('0xf')]);}})[_0x215e('0x12')](function(_0x41dfc0){logger[_0x215e('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x138b08,_0x41dfc0);_0x542ffa(_0x41dfc0);});});}exports[_0x215e('0x13')]=function(_0x3ca762){var _0x3907bb=this;return new Promise(function(_0x490c26,_0x45dc05){return db[_0x215e('0x14')][_0x215e('0x15')]({'raw':_0x3ca762[_0x215e('0x16')]?_0x3ca762['options'][_0x215e('0x17')]===undefined?!![]:![]:!![],'where':_0x3ca762[_0x215e('0x16')]?_0x3ca762['options'][_0x215e('0x18')]||null:null,'attributes':_0x3ca762[_0x215e('0x16')]?_0x3ca762[_0x215e('0x16')]['attributes']||null:null,'include':_0x3ca762[_0x215e('0x16')]?_0x3ca762[_0x215e('0x16')][_0x215e('0x19')]?_['map'](_0x3ca762[_0x215e('0x16')][_0x215e('0x19')],function(_0x288d8a){return{'model':db[_0x288d8a[_0x215e('0x1a')]],'as':_0x288d8a['as'],'attributes':_0x288d8a[_0x215e('0x1b')],'include':_0x288d8a[_0x215e('0x19')]?_[_0x215e('0x1c')](_0x288d8a[_0x215e('0x19')],function(_0x257144){return{'model':db[_0x257144[_0x215e('0x1a')]],'as':_0x257144['as'],'attributes':_0x257144[_0x215e('0x1b')],'include':_0x257144[_0x215e('0x19')]?_[_0x215e('0x1c')](_0x257144[_0x215e('0x19')],function(_0x351828){return{'model':db[_0x351828['model']],'as':_0x351828['as'],'attributes':_0x351828[_0x215e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x215e('0x8')](function(_0x4bc3ec){logger['info'](_0x215e('0x13'),_0x3ca762);logger[_0x215e('0x1d')](_0x215e('0x13'),_0x3ca762,JSON[_0x215e('0xc')](_0x4bc3ec));_0x490c26(_0x4bc3ec);})[_0x215e('0x12')](function(_0x45d82a){logger[_0x215e('0xd')](_0x215e('0x13'),_0x45d82a[_0x215e('0xf')],_0x3ca762);_0x45dc05(_0x3907bb[_0x215e('0xd')](0x1f4,_0x45d82a[_0x215e('0xf')]));});});}; \ No newline at end of file +var _0x5b68=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','debug','lodash','util','moment','randomstring'];(function(_0x162de5,_0x28584c){var _0xbb5ba0=function(_0x59e871){while(--_0x59e871){_0x162de5['push'](_0x162de5['shift']());}};_0xbb5ba0(++_0x28584c);}(_0x5b68,0x9c));var _0x85b6=function(_0xd60025,_0x1bb508){_0xd60025=_0xd60025-0x0;var _0x49d6b6=_0x5b68[_0xd60025];return _0x49d6b6;};'use strict';var _=require(_0x85b6('0x0'));var util=require(_0x85b6('0x1'));var moment=require(_0x85b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x85b6('0x3'));var fs=require('fs');var Redis=require(_0x85b6('0x4'));var db=require(_0x85b6('0x5'))['db'];var utils=require(_0x85b6('0x6'));var logger=require('../../config/logger')(_0x85b6('0x7'));var config=require(_0x85b6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x85b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x63ed7b,_0x42382d,_0x22e79e){return new BPromise(function(_0x47a967,_0x55c962){return client[_0x85b6('0xa')](_0x63ed7b,_0x22e79e)[_0x85b6('0xb')](function(_0x495e02){logger[_0x85b6('0xc')](_0x85b6('0xd'),_0x42382d,_0x85b6('0xe'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x42382d,_0x85b6('0xe'),JSON[_0x85b6('0xf')](_0x495e02));if(_0x495e02[_0x85b6('0x10')]){if(_0x495e02[_0x85b6('0x10')][_0x85b6('0x11')]===0x1f4){logger[_0x85b6('0x10')](_0x85b6('0xd'),_0x42382d,_0x495e02[_0x85b6('0x10')][_0x85b6('0x12')]);return _0x55c962(_0x495e02[_0x85b6('0x10')]['message']);}logger[_0x85b6('0x10')](_0x85b6('0xd'),_0x42382d,_0x495e02[_0x85b6('0x10')]['message']);return _0x47a967(_0x495e02[_0x85b6('0x10')][_0x85b6('0x12')]);}else{logger[_0x85b6('0xc')](_0x85b6('0xd'),_0x42382d,_0x85b6('0xe'));_0x47a967(_0x495e02[_0x85b6('0x13')][_0x85b6('0x12')]);}})[_0x85b6('0x14')](function(_0x6bba69){logger[_0x85b6('0x10')](_0x85b6('0xd'),_0x42382d,_0x6bba69);_0x55c962(_0x6bba69);});});}exports['ShowSquareOdbc']=function(_0x255563){var _0x5d0aa3=this;return new Promise(function(_0x34e1ae,_0x1c69e9){return db[_0x85b6('0x15')][_0x85b6('0x16')]({'raw':_0x255563[_0x85b6('0x17')]?_0x255563[_0x85b6('0x17')][_0x85b6('0x18')]===undefined?!![]:![]:!![],'where':_0x255563[_0x85b6('0x17')]?_0x255563[_0x85b6('0x17')][_0x85b6('0x19')]||null:null,'attributes':_0x255563[_0x85b6('0x17')]?_0x255563[_0x85b6('0x17')][_0x85b6('0x1a')]||null:null,'include':_0x255563['options']?_0x255563[_0x85b6('0x17')][_0x85b6('0x1b')]?_[_0x85b6('0x1c')](_0x255563[_0x85b6('0x17')]['include'],function(_0x5bd11c){return{'model':db[_0x5bd11c[_0x85b6('0x1d')]],'as':_0x5bd11c['as'],'attributes':_0x5bd11c[_0x85b6('0x1a')],'include':_0x5bd11c[_0x85b6('0x1b')]?_[_0x85b6('0x1c')](_0x5bd11c['include'],function(_0x5dc57b){return{'model':db[_0x5dc57b[_0x85b6('0x1d')]],'as':_0x5dc57b['as'],'attributes':_0x5dc57b[_0x85b6('0x1a')],'include':_0x5dc57b[_0x85b6('0x1b')]?_[_0x85b6('0x1c')](_0x5dc57b[_0x85b6('0x1b')],function(_0x2442ed){return{'model':db[_0x2442ed[_0x85b6('0x1d')]],'as':_0x2442ed['as'],'attributes':_0x2442ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x85b6('0xb')](function(_0x6911db){logger[_0x85b6('0xc')](_0x85b6('0x1e'),_0x255563);logger[_0x85b6('0x1f')](_0x85b6('0x1e'),_0x255563,JSON['stringify'](_0x6911db));_0x34e1ae(_0x6911db);})[_0x85b6('0x14')](function(_0x80a3c8){logger[_0x85b6('0x10')](_0x85b6('0x1e'),_0x80a3c8['message'],_0x255563);_0x1c69e9(_0x5d0aa3['error'](0x1f4,_0x80a3c8[_0x85b6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 577b6f9..76d0576 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 _0x01f0=['update','delete','exports','multer','path','Router','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','/:id/users','create','post','addUsers'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x01f0,0x93));var _0x001f=function(_0x5457f6,_0xcf7c59){_0x5457f6=_0x5457f6-0x0;var _0x4fe2af=_0x01f0[_0x5457f6];return _0x4fe2af;};'use strict';var multer=require(_0x001f('0x0'));var util=require('util');var path=require(_0x001f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x001f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x001f('0x3'));var config=require(_0x001f('0x4'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x001f('0x5')](),controller['index']);router['get'](_0x001f('0x6'),auth[_0x001f('0x5')](),controller[_0x001f('0x7')]);router[_0x001f('0x8')](_0x001f('0x9'),auth['isAuthenticated'](),controller['getUsers']);router['post']('/',auth[_0x001f('0x5')](),controller[_0x001f('0xa')]);router[_0x001f('0xb')](_0x001f('0x9'),auth[_0x001f('0x5')](),controller[_0x001f('0xc')]);router['put'](_0x001f('0x6'),auth[_0x001f('0x5')](),controller[_0x001f('0xd')]);router[_0x001f('0xe')](_0x001f('0x6'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/users',auth[_0x001f('0x5')](),controller['removeUsers']);module[_0x001f('0xf')]=router; \ No newline at end of file +var _0x3f9b=['../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','getUsers','/:id/users','addUsers','put','delete','destroy','removeUsers','path','express','Router'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x43c8c0,_0x2d49b0){_0x43c8c0=_0x43c8c0-0x0;var _0x51db12=_0x3f9b[_0x43c8c0];return _0x51db12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3f9('0x0'));var timeout=require('connect-timeout');var express=require(_0xb3f9('0x1'));var router=express[_0xb3f9('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3f9('0x3'));var controller=require(_0xb3f9('0x4'));router[_0xb3f9('0x5')]('/',auth['isAuthenticated'](),controller[_0xb3f9('0x6')]);router[_0xb3f9('0x5')](_0xb3f9('0x7'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x9')]);router['get']('/:id/users',auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xa')]);router['post']('/',auth[_0xb3f9('0x8')](),controller['create']);router['post'](_0xb3f9('0xb'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xc')]);router[_0xb3f9('0xd')](_0xb3f9('0x7'),auth[_0xb3f9('0x8')](),controller['update']);router[_0xb3f9('0xe')](_0xb3f9('0x7'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xf')]);router[_0xb3f9('0xe')](_0xb3f9('0xb'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x10')]);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 e1c0882..082704a 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 _0xaa38=['preproduction','toString','utf8','BLOB','production','DATE','STRING','name','TEXT','long','getDataValue'];(function(_0x3a97d7,_0x457427){var _0x30d6d3=function(_0xee8ddf){while(--_0xee8ddf){_0x3a97d7['push'](_0x3a97d7['shift']());}};_0x30d6d3(++_0x457427);}(_0xaa38,0x150));var _0x8aa3=function(_0x4ec06f,_0x265772){_0x4ec06f=_0x4ec06f-0x0;var _0x4a8b2f=_0xaa38[_0x4ec06f];return _0x4a8b2f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8aa3('0x0')],'unique':_0x8aa3('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x8aa3('0x0')]},'notes':{'type':Sequelize[_0x8aa3('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x8aa3('0x3')),'get':function(){if(this[_0x8aa3('0x4')](_0x8aa3('0x5'))){return this[_0x8aa3('0x4')]('preproduction')[_0x8aa3('0x6')](_0x8aa3('0x7'));}}},'production':{'type':Sequelize[_0x8aa3('0x8')](_0x8aa3('0x3')),'get':function(){if(this[_0x8aa3('0x4')](_0x8aa3('0x9'))){return this[_0x8aa3('0x4')](_0x8aa3('0x9'))[_0x8aa3('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8aa3('0xa')]},'publishedAt':{'type':Sequelize[_0x8aa3('0xa')]}}; \ No newline at end of file +var _0x081e=['utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x081e,0x9f));var _0xe081=function(_0x102470,_0x199a01){_0x102470=_0x102470-0x0;var _0x558eaa=_0x081e[_0x102470];return _0x558eaa;};'use strict';var Sequelize=require(_0xe081('0x0'));module[_0xe081('0x1')]={'name':{'type':Sequelize[_0xe081('0x2')],'unique':_0xe081('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe081('0x2')]},'notes':{'type':Sequelize[_0xe081('0x4')]},'preproduction':{'type':Sequelize[_0xe081('0x5')](_0xe081('0x6')),'get':function(){if(this[_0xe081('0x7')]('preproduction')){return this[_0xe081('0x7')](_0xe081('0x8'))[_0xe081('0x9')](_0xe081('0xa'));}}},'production':{'type':Sequelize[_0xe081('0x5')](_0xe081('0x6')),'get':function(){if(this[_0xe081('0x7')](_0xe081('0xb'))){return this[_0xe081('0x7')](_0xe081('0xb'))[_0xe081('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0xe081('0xc')]},'publishedAt':{'type':Sequelize[_0xe081('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 868c1f0..8fa1304 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 _0x8755=['sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','findAll','show','keys','fields','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','destroy','addUsers','params','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','rawAttributes','filter','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','SquareProjects','error','stack','name','send','index','map','SquareProject','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x8755,0x87));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5875('0x0'));var rimraf=require(_0x5875('0x1'));var zipdir=require(_0x5875('0x2'));var jsonpatch=require(_0x5875('0x3'));var rp=require('request-promise');var moment=require(_0x5875('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5875('0x5'));var util=require(_0x5875('0x6'));var path=require(_0x5875('0x7'));var sox=require(_0x5875('0x8'));var csv=require(_0x5875('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5875('0xa'));var crypto=require(_0x5875('0xb'));var jsforce=require(_0x5875('0xc'));var deskjs=require(_0x5875('0xd'));var toCsv=require(_0x5875('0x9'));var querystring=require(_0x5875('0xe'));var Papa=require(_0x5875('0xf'));var Redis=require(_0x5875('0x10'));var authService=require(_0x5875('0x11'));var qs=require(_0x5875('0x12'));var as=require(_0x5875('0x13'));var hardwareService=require(_0x5875('0x14'));var logger=require('../../config/logger')(_0x5875('0x15'));var utils=require(_0x5875('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5875('0x17'));var db=require(_0x5875('0x18'))['db'];config[_0x5875('0x19')]=_[_0x5875('0x1a')](config[_0x5875('0x19')],{'host':_0x5875('0x1b'),'port':0x18eb});var socket=require(_0x5875('0x1c'))(new Redis(config['redis']));require(_0x5875('0x1d'))[_0x5875('0x1e')](socket);function respondWithStatusCode(_0x215eef,_0x476d53){_0x476d53=_0x476d53||0xcc;return function(_0x400a32){if(_0x400a32){return _0x215eef[_0x5875('0x1f')](_0x476d53);}return _0x215eef[_0x5875('0x20')](_0x476d53)[_0x5875('0x21')]();};}function respondWithResult(_0x1a43a2,_0x114da6){_0x114da6=_0x114da6||0xc8;return function(_0x3991d9){if(_0x3991d9){return _0x1a43a2[_0x5875('0x20')](_0x114da6)[_0x5875('0x22')](_0x3991d9);}};}function respondWithFilteredResult(_0x379f8b,_0x5ab703){return function(_0x1b937a){if(_0x1b937a){var _0x3df094=typeof _0x5ab703[_0x5875('0x23')]===_0x5875('0x24')&&typeof _0x5ab703[_0x5875('0x25')]==='undefined';var _0x39717d=_0x1b937a[_0x5875('0x26')];var _0x2a8f39=_0x3df094?0x0:_0x5ab703[_0x5875('0x23')];var _0x521d96=_0x3df094?_0x1b937a['count']:_0x5ab703['offset']+_0x5ab703['limit'];var _0x5ce807;if(_0x521d96>=_0x39717d){_0x521d96=_0x39717d;_0x5ce807=0xc8;}else{_0x5ce807=0xce;}_0x379f8b[_0x5875('0x20')](_0x5ce807);return _0x379f8b[_0x5875('0x27')](_0x5875('0x28'),_0x2a8f39+'-'+_0x521d96+'/'+_0x39717d)[_0x5875('0x22')](_0x1b937a);}return null;};}function patchUpdates(_0x23cc69){return function(_0x236c38){try{jsonpatch[_0x5875('0x29')](_0x236c38,_0x23cc69,!![]);}catch(_0x3f03c4){return BPromise[_0x5875('0x2a')](_0x3f03c4);}return _0x236c38['save']();};}function saveUpdates(_0x1d89a9,_0x5de962){return function(_0x590df3){if(_0x590df3){return _0x590df3[_0x5875('0x2b')](_0x1d89a9)[_0x5875('0x2c')](function(_0x19fdfc){return _0x19fdfc;});}return null;};}function removeEntity(_0x4b48b0,_0x29d096){return function(_0xe74a39){if(_0xe74a39){return _0xe74a39['destroy']()['then'](function(){var _0x42b7b3=_0xe74a39['get']({'plain':!![]});var _0x54778f=_0x5875('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x54778f,'resourceId':_0x42b7b3['id']}})[_0x5875('0x2c')](function(){return _0xe74a39;});})['then'](function(){_0x4b48b0[_0x5875('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40fb54,_0x3d04d3){return function(_0x3e3e6e){if(!_0x3e3e6e){_0x40fb54['sendStatus'](0x194);}return _0x3e3e6e;};}function handleError(_0x31d98b,_0x4d21a0){_0x4d21a0=_0x4d21a0||0x1f4;return function(_0x16d99e){logger[_0x5875('0x2e')](_0x16d99e[_0x5875('0x2f')]);if(_0x16d99e[_0x5875('0x30')]){delete _0x16d99e['name'];}_0x31d98b[_0x5875('0x20')](_0x4d21a0)[_0x5875('0x31')](_0x16d99e);};}exports[_0x5875('0x32')]=function(_0x4bc2c4,_0x2ecf7f){var _0xf1022f={},_0x314e02={},_0x536957={'count':0x0,'rows':[]};var _0x20b198=_[_0x5875('0x33')](db[_0x5875('0x34')]['rawAttributes'],function(_0x6ebd87){return{'name':_0x6ebd87['fieldName'],'type':_0x6ebd87['type']['key']};});_0x314e02[_0x5875('0x35')]=_[_0x5875('0x33')](_0x20b198,'name');_0x314e02['query']=_['keys'](_0x4bc2c4[_0x5875('0x36')]);_0x314e02['filters']=_[_0x5875('0x37')](_0x314e02[_0x5875('0x35')],_0x314e02['query']);_0xf1022f[_0x5875('0x38')]=_[_0x5875('0x37')](_0x314e02['model'],qs['fields'](_0x4bc2c4[_0x5875('0x36')]['fields']));_0xf1022f[_0x5875('0x38')]=_0xf1022f[_0x5875('0x38')][_0x5875('0x39')]?_0xf1022f[_0x5875('0x38')]:_0x314e02[_0x5875('0x35')];if(!_0x4bc2c4[_0x5875('0x36')][_0x5875('0x3a')](_0x5875('0x3b'))){_0xf1022f['limit']=qs['limit'](_0x4bc2c4['query'][_0x5875('0x25')]);_0xf1022f[_0x5875('0x23')]=qs[_0x5875('0x23')](_0x4bc2c4[_0x5875('0x36')][_0x5875('0x23')]);}_0xf1022f[_0x5875('0x3c')]=qs['sort'](_0x4bc2c4[_0x5875('0x36')][_0x5875('0x3d')]);_0xf1022f[_0x5875('0x3e')]=qs[_0x5875('0x3f')](_[_0x5875('0x40')](_0x4bc2c4[_0x5875('0x36')],_0x314e02[_0x5875('0x3f')]),_0x20b198);if(_0x4bc2c4[_0x5875('0x36')]['filter']){_0xf1022f[_0x5875('0x3e')]=_[_0x5875('0x41')](_0xf1022f[_0x5875('0x3e')],{'$or':_['map'](_0x20b198,function(_0xe7a9ef){if(_0xe7a9ef[_0x5875('0x42')]!==_0x5875('0x43')){var _0x13759e={};_0x13759e[_0xe7a9ef[_0x5875('0x30')]]={'$like':'%'+_0x4bc2c4[_0x5875('0x36')]['filter']+'%'};return _0x13759e;}})});}_0xf1022f=_[_0x5875('0x41')]({},_0xf1022f,_0x4bc2c4[_0x5875('0x44')]);var _0x18832f={'where':_0xf1022f['where']};return db[_0x5875('0x34')][_0x5875('0x26')](_0x18832f)[_0x5875('0x2c')](function(_0x27858e){_0x536957['count']=_0x27858e;if(_0x4bc2c4[_0x5875('0x36')][_0x5875('0x45')]){_0xf1022f['include']=[{'all':!![]}];}return db[_0x5875('0x34')][_0x5875('0x46')](_0xf1022f);})[_0x5875('0x2c')](function(_0x16f562){_0x536957['rows']=_0x16f562;return _0x536957;})['then'](respondWithFilteredResult(_0x2ecf7f,_0xf1022f))['catch'](handleError(_0x2ecf7f,null));};exports[_0x5875('0x47')]=function(_0xc23b44,_0x509ed7){var _0x557864={'raw':![],'where':{'id':_0xc23b44['params']['id']}},_0x2be3f0={};_0x2be3f0[_0x5875('0x35')]=_[_0x5875('0x48')](db[_0x5875('0x34')]['rawAttributes']);_0x2be3f0[_0x5875('0x36')]=_[_0x5875('0x48')](_0xc23b44['query']);_0x2be3f0[_0x5875('0x3f')]=_['intersection'](_0x2be3f0['model'],_0x2be3f0[_0x5875('0x36')]);_0x557864['attributes']=_[_0x5875('0x37')](_0x2be3f0['model'],qs[_0x5875('0x49')](_0xc23b44[_0x5875('0x36')][_0x5875('0x49')]));_0x557864['attributes']=_0x557864['attributes']['length']?_0x557864[_0x5875('0x38')]:_0x2be3f0[_0x5875('0x35')];if(_0xc23b44['query'][_0x5875('0x45')]){_0x557864[_0x5875('0x4a')]=[{'all':!![]}];}_0x557864=_[_0x5875('0x41')]({},_0x557864,_0xc23b44[_0x5875('0x44')]);return db[_0x5875('0x34')][_0x5875('0x4b')](_0x557864)[_0x5875('0x2c')](handleEntityNotFound(_0x509ed7,null))[_0x5875('0x2c')](respondWithResult(_0x509ed7,null))[_0x5875('0x4c')](handleError(_0x509ed7,null));};exports['create']=function(_0x599423,_0x388b19){return db[_0x5875('0x34')][_0x5875('0x4d')](_0x599423[_0x5875('0x4e')],{})[_0x5875('0x2c')](function(_0x34c6f5){var _0x44d06f=_0x599423['user'][_0x5875('0x4f')]({'plain':!![]});if(!_0x44d06f)throw new Error(_0x5875('0x50'));if(_0x44d06f[_0x5875('0x51')]===_0x5875('0x52')){var _0x358e84=_0x34c6f5[_0x5875('0x4f')]({'plain':!![]});var _0x55ab99=_0x5875('0x2d');return db['UserProfileSection'][_0x5875('0x4b')]({'where':{'name':_0x55ab99,'userProfileId':_0x44d06f[_0x5875('0x53')]},'raw':!![]})[_0x5875('0x2c')](function(_0x5de9a6){if(_0x5de9a6&&_0x5de9a6[_0x5875('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x358e84['name'],'resourceId':_0x358e84['id'],'type':_0x5de9a6['name'],'sectionId':_0x5de9a6['id']},{})[_0x5875('0x2c')](function(){return _0x34c6f5;});}else{return _0x34c6f5;}})[_0x5875('0x4c')](function(_0x3bbe1f){logger[_0x5875('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bbe1f);throw _0x3bbe1f;});}return _0x34c6f5;})[_0x5875('0x2c')](respondWithResult(_0x388b19,0xc9))[_0x5875('0x4c')](handleError(_0x388b19,null));};exports[_0x5875('0x2b')]=function(_0x4af19d,_0x1c05c7){if(_0x4af19d['body']['id']){delete _0x4af19d['body']['id'];}return db[_0x5875('0x34')]['find']({'where':{'id':_0x4af19d['params']['id']}})[_0x5875('0x2c')](handleEntityNotFound(_0x1c05c7,null))[_0x5875('0x2c')](saveUpdates(_0x4af19d[_0x5875('0x4e')],null))[_0x5875('0x2c')](respondWithResult(_0x1c05c7,null))[_0x5875('0x4c')](handleError(_0x1c05c7,null));};exports[_0x5875('0x55')]=function(_0x2d6a1e,_0x28cf4e){return db[_0x5875('0x34')][_0x5875('0x4b')]({'where':{'id':_0x2d6a1e['params']['id']}})[_0x5875('0x2c')](handleEntityNotFound(_0x28cf4e,null))[_0x5875('0x2c')](removeEntity(_0x28cf4e,null))['catch'](handleError(_0x28cf4e,null));};exports[_0x5875('0x56')]=function(_0x2c4c8f,_0x2c5115,_0x530efc){return db['SquareProject'][_0x5875('0x4b')]({'where':{'id':_0x2c4c8f[_0x5875('0x57')]['id']}})[_0x5875('0x2c')](handleEntityNotFound(_0x2c5115,null))[_0x5875('0x2c')](function(_0x27ce3d){if(_0x27ce3d){return _0x27ce3d[_0x5875('0x56')](_0x2c4c8f[_0x5875('0x4e')][_0x5875('0x58')],_['omit'](_0x2c4c8f['body'],['ids','id'])||{});}})[_0x5875('0x2c')](respondWithResult(_0x2c5115,null))[_0x5875('0x4c')](handleError(_0x2c5115,null));};exports[_0x5875('0x59')]=function(_0x1b2720,_0x3fff85,_0x9816d6){return db['SquareProject']['find']({'where':{'id':_0x1b2720[_0x5875('0x57')]['id']}})['then'](handleEntityNotFound(_0x3fff85,null))[_0x5875('0x2c')](function(_0x3c3800){if(_0x3c3800){return _0x3c3800[_0x5875('0x59')](_0x1b2720[_0x5875('0x36')][_0x5875('0x58')])[_0x5875('0x2c')](function(){if(_[_0x5875('0x5a')](_0x1b2720[_0x5875('0x36')]['ids'])){for(var _0x5db236=0x0;_0x5db236<_0x1b2720['query'][_0x5875('0x58')]['length'];_0x5db236+=0x1){socket[_0x5875('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x1b2720['query'][_0x5875('0x58')][_0x5db236]),'SquareProjectId':Number(_0x1b2720[_0x5875('0x57')]['id'])});}}else{socket[_0x5875('0x5b')](_0x5875('0x5c'),{'UserId':Number(_0x1b2720[_0x5875('0x36')][_0x5875('0x58')]),'SquareProjectId':Number(_0x1b2720[_0x5875('0x57')]['id'])});}});}})[_0x5875('0x2c')](respondWithStatusCode(_0x3fff85,null))[_0x5875('0x4c')](handleError(_0x3fff85,null));};exports[_0x5875('0x5d')]=function(_0x520e64,_0x534407,_0x2d5871){var _0x3ace58={};var _0xb41908={};var _0x9f8c3c;var _0x5a4e30;return db[_0x5875('0x34')][_0x5875('0x5e')]({'where':{'id':_0x520e64[_0x5875('0x57')]['id']}})[_0x5875('0x2c')](handleEntityNotFound(_0x534407,null))['then'](function(_0xfdc0f6){if(_0xfdc0f6){_0x9f8c3c=_0xfdc0f6;_0xb41908['model']=_[_0x5875('0x48')](db[_0x5875('0x5f')][_0x5875('0x60')]);_0xb41908['query']=_[_0x5875('0x48')](_0x520e64['query']);_0xb41908['filters']=_[_0x5875('0x37')](_0xb41908[_0x5875('0x35')],_0xb41908[_0x5875('0x36')]);_0x3ace58[_0x5875('0x38')]=_[_0x5875('0x37')](_0xb41908[_0x5875('0x35')],qs[_0x5875('0x49')](_0x520e64[_0x5875('0x36')][_0x5875('0x49')]));_0x3ace58[_0x5875('0x38')]=_0x3ace58[_0x5875('0x38')][_0x5875('0x39')]?_0x3ace58['attributes']:_0xb41908[_0x5875('0x35')];_0x3ace58[_0x5875('0x3c')]=qs[_0x5875('0x3d')](_0x520e64['query'][_0x5875('0x3d')]);_0x3ace58[_0x5875('0x3e')]=qs[_0x5875('0x3f')](_[_0x5875('0x40')](_0x520e64[_0x5875('0x36')],_0xb41908[_0x5875('0x3f')]));if(_0x520e64[_0x5875('0x36')][_0x5875('0x61')]){_0x3ace58['where']=_[_0x5875('0x41')](_0x3ace58['where'],{'$or':_[_0x5875('0x33')](_0x3ace58[_0x5875('0x38')],function(_0x5a333d){var _0x288ba2={};_0x288ba2[_0x5a333d]={'$like':'%'+_0x520e64[_0x5875('0x36')][_0x5875('0x61')]+'%'};return _0x288ba2;})});}_0x3ace58=_['merge']({},_0x3ace58,_0x520e64[_0x5875('0x44')]);return _0x9f8c3c[_0x5875('0x5d')](_0x3ace58);}})[_0x5875('0x2c')](function(_0x158920){if(_0x158920){_0x5a4e30=_0x158920[_0x5875('0x39')];if(!_0x520e64['query'][_0x5875('0x3a')](_0x5875('0x3b'))){_0x3ace58[_0x5875('0x25')]=qs[_0x5875('0x25')](_0x520e64[_0x5875('0x36')]['limit']);_0x3ace58[_0x5875('0x23')]=qs[_0x5875('0x23')](_0x520e64[_0x5875('0x36')][_0x5875('0x23')]);}return _0x9f8c3c[_0x5875('0x5d')](_0x3ace58);}})[_0x5875('0x2c')](function(_0x3875fc){if(_0x3875fc){return _0x3875fc?{'count':_0x5a4e30,'rows':_0x3875fc}:null;}})[_0x5875('0x2c')](respondWithResult(_0x534407,null))['catch'](handleError(_0x534407,null));}; \ No newline at end of file +var _0xebb6=['request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x55c591,_0x4f66d5){var _0x1a3fad=function(_0x402fb1){while(--_0x402fb1){_0x55c591['push'](_0x55c591['shift']());}};_0x1a3fad(++_0x4f66d5);}(_0xebb6,0x128));var _0x6ebb=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xebb6[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0x6ebb('0x0'));var rimraf=require(_0x6ebb('0x1'));var zipdir=require(_0x6ebb('0x2'));var jsonpatch=require(_0x6ebb('0x3'));var rp=require(_0x6ebb('0x4'));var moment=require(_0x6ebb('0x5'));var BPromise=require(_0x6ebb('0x6'));var Mustache=require(_0x6ebb('0x7'));var util=require('util');var path=require(_0x6ebb('0x8'));var sox=require(_0x6ebb('0x9'));var csv=require(_0x6ebb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ebb('0xb'));var _=require(_0x6ebb('0xc'));var squel=require(_0x6ebb('0xd'));var crypto=require('crypto');var jsforce=require(_0x6ebb('0xe'));var deskjs=require(_0x6ebb('0xf'));var toCsv=require(_0x6ebb('0xa'));var querystring=require(_0x6ebb('0x10'));var Papa=require(_0x6ebb('0x11'));var Redis=require(_0x6ebb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ebb('0x13'));var logger=require(_0x6ebb('0x14'))(_0x6ebb('0x15'));var utils=require(_0x6ebb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6ebb('0x17'));var db=require(_0x6ebb('0x18'))['db'];config[_0x6ebb('0x19')]=_[_0x6ebb('0x1a')](config[_0x6ebb('0x19')],{'host':_0x6ebb('0x1b'),'port':0x18eb});var socket=require(_0x6ebb('0x1c'))(new Redis(config[_0x6ebb('0x19')]));require(_0x6ebb('0x1d'))['register'](socket);function respondWithStatusCode(_0x3a4b85,_0x50f5f6){_0x50f5f6=_0x50f5f6||0xcc;return function(_0x4ae3b4){if(_0x4ae3b4){return _0x3a4b85[_0x6ebb('0x1e')](_0x50f5f6);}return _0x3a4b85[_0x6ebb('0x1f')](_0x50f5f6)[_0x6ebb('0x20')]();};}function respondWithResult(_0x3f4ab8,_0x2f29b6){_0x2f29b6=_0x2f29b6||0xc8;return function(_0x3b9c1b){if(_0x3b9c1b){return _0x3f4ab8[_0x6ebb('0x1f')](_0x2f29b6)[_0x6ebb('0x21')](_0x3b9c1b);}};}function respondWithFilteredResult(_0x5a0718,_0x229692){return function(_0xffd7d6){if(_0xffd7d6){var _0x5d2b5c=typeof _0x229692['offset']==='undefined'&&typeof _0x229692[_0x6ebb('0x22')]===_0x6ebb('0x23');var _0xc75aee=_0xffd7d6[_0x6ebb('0x24')];var _0x920095=_0x5d2b5c?0x0:_0x229692['offset'];var _0x582494=_0x5d2b5c?_0xffd7d6[_0x6ebb('0x24')]:_0x229692[_0x6ebb('0x25')]+_0x229692[_0x6ebb('0x22')];var _0x22f1e7;if(_0x582494>=_0xc75aee){_0x582494=_0xc75aee;_0x22f1e7=0xc8;}else{_0x22f1e7=0xce;}_0x5a0718[_0x6ebb('0x1f')](_0x22f1e7);return _0x5a0718['set'](_0x6ebb('0x26'),_0x920095+'-'+_0x582494+'/'+_0xc75aee)['json'](_0xffd7d6);}return null;};}function patchUpdates(_0x18b212){return function(_0x436761){try{jsonpatch[_0x6ebb('0x27')](_0x436761,_0x18b212,!![]);}catch(_0x2cd0ee){return BPromise[_0x6ebb('0x28')](_0x2cd0ee);}return _0x436761[_0x6ebb('0x29')]();};}function saveUpdates(_0x5e566a,_0x413f41){return function(_0x44c5e6){if(_0x44c5e6){return _0x44c5e6[_0x6ebb('0x2a')](_0x5e566a)[_0x6ebb('0x2b')](function(_0x54d5b9){return _0x54d5b9;});}return null;};}function removeEntity(_0x195668,_0x5ef0ce){return function(_0x4a4336){if(_0x4a4336){return _0x4a4336['destroy']()[_0x6ebb('0x2b')](function(){var _0x1b6e1c=_0x4a4336[_0x6ebb('0x2c')]({'plain':!![]});var _0x4db0c3=_0x6ebb('0x2d');return db[_0x6ebb('0x2e')][_0x6ebb('0x2f')]({'where':{'type':_0x4db0c3,'resourceId':_0x1b6e1c['id']}})[_0x6ebb('0x2b')](function(){return _0x4a4336;});})['then'](function(){_0x195668[_0x6ebb('0x1f')](0xcc)[_0x6ebb('0x20')]();});}};}function handleEntityNotFound(_0x1de0d1,_0x363f24){return function(_0x22b484){if(!_0x22b484){_0x1de0d1['sendStatus'](0x194);}return _0x22b484;};}function handleError(_0x3a54ef,_0x3c7791){_0x3c7791=_0x3c7791||0x1f4;return function(_0x3460b4){logger['error'](_0x3460b4['stack']);if(_0x3460b4['name']){delete _0x3460b4[_0x6ebb('0x30')];}_0x3a54ef[_0x6ebb('0x1f')](_0x3c7791)[_0x6ebb('0x31')](_0x3460b4);};}exports[_0x6ebb('0x32')]=function(_0x2d9f92,_0x4f2921){var _0x5dffc3={},_0x59d6f0={},_0x453cb7={'count':0x0,'rows':[]};var _0x215efe=_[_0x6ebb('0x33')](db[_0x6ebb('0x34')][_0x6ebb('0x35')],function(_0x9a36fd){return{'name':_0x9a36fd[_0x6ebb('0x36')],'type':_0x9a36fd['type'][_0x6ebb('0x37')]};});_0x59d6f0[_0x6ebb('0x38')]=_[_0x6ebb('0x33')](_0x215efe,'name');_0x59d6f0[_0x6ebb('0x39')]=_['keys'](_0x2d9f92[_0x6ebb('0x39')]);_0x59d6f0[_0x6ebb('0x3a')]=_[_0x6ebb('0x3b')](_0x59d6f0['model'],_0x59d6f0[_0x6ebb('0x39')]);_0x5dffc3[_0x6ebb('0x3c')]=_[_0x6ebb('0x3b')](_0x59d6f0[_0x6ebb('0x38')],qs[_0x6ebb('0x3d')](_0x2d9f92['query']['fields']));_0x5dffc3[_0x6ebb('0x3c')]=_0x5dffc3[_0x6ebb('0x3c')][_0x6ebb('0x3e')]?_0x5dffc3['attributes']:_0x59d6f0[_0x6ebb('0x38')];if(!_0x2d9f92['query']['hasOwnProperty']('nolimit')){_0x5dffc3[_0x6ebb('0x22')]=qs[_0x6ebb('0x22')](_0x2d9f92['query'][_0x6ebb('0x22')]);_0x5dffc3['offset']=qs[_0x6ebb('0x25')](_0x2d9f92[_0x6ebb('0x39')][_0x6ebb('0x25')]);}_0x5dffc3['order']=qs['sort'](_0x2d9f92[_0x6ebb('0x39')][_0x6ebb('0x3f')]);_0x5dffc3[_0x6ebb('0x40')]=qs[_0x6ebb('0x3a')](_[_0x6ebb('0x41')](_0x2d9f92['query'],_0x59d6f0[_0x6ebb('0x3a')]),_0x215efe);if(_0x2d9f92['query'][_0x6ebb('0x42')]){_0x5dffc3['where']=_['merge'](_0x5dffc3[_0x6ebb('0x40')],{'$or':_[_0x6ebb('0x33')](_0x215efe,function(_0x2d6e4a){if(_0x2d6e4a[_0x6ebb('0x43')]!==_0x6ebb('0x44')){var _0x3515d2={};_0x3515d2[_0x2d6e4a[_0x6ebb('0x30')]]={'$like':'%'+_0x2d9f92[_0x6ebb('0x39')]['filter']+'%'};return _0x3515d2;}})});}_0x5dffc3=_[_0x6ebb('0x45')]({},_0x5dffc3,_0x2d9f92[_0x6ebb('0x46')]);var _0x481e9a={'where':_0x5dffc3[_0x6ebb('0x40')]};return db[_0x6ebb('0x34')]['count'](_0x481e9a)['then'](function(_0x175dec){_0x453cb7[_0x6ebb('0x24')]=_0x175dec;if(_0x2d9f92['query'][_0x6ebb('0x47')]){_0x5dffc3[_0x6ebb('0x48')]=[{'all':!![]}];}return db[_0x6ebb('0x34')]['findAll'](_0x5dffc3);})['then'](function(_0x59ae58){_0x453cb7[_0x6ebb('0x49')]=_0x59ae58;return _0x453cb7;})[_0x6ebb('0x2b')](respondWithFilteredResult(_0x4f2921,_0x5dffc3))[_0x6ebb('0x4a')](handleError(_0x4f2921,null));};exports[_0x6ebb('0x4b')]=function(_0x53857f,_0x220745){var _0xb32b37={'raw':![],'where':{'id':_0x53857f['params']['id']}},_0x2f7bf5={};_0x2f7bf5[_0x6ebb('0x38')]=_[_0x6ebb('0x4c')](db[_0x6ebb('0x34')]['rawAttributes']);_0x2f7bf5[_0x6ebb('0x39')]=_[_0x6ebb('0x4c')](_0x53857f['query']);_0x2f7bf5[_0x6ebb('0x3a')]=_[_0x6ebb('0x3b')](_0x2f7bf5[_0x6ebb('0x38')],_0x2f7bf5['query']);_0xb32b37[_0x6ebb('0x3c')]=_['intersection'](_0x2f7bf5['model'],qs[_0x6ebb('0x3d')](_0x53857f[_0x6ebb('0x39')][_0x6ebb('0x3d')]));_0xb32b37[_0x6ebb('0x3c')]=_0xb32b37[_0x6ebb('0x3c')][_0x6ebb('0x3e')]?_0xb32b37[_0x6ebb('0x3c')]:_0x2f7bf5[_0x6ebb('0x38')];if(_0x53857f[_0x6ebb('0x39')]['includeAll']){_0xb32b37[_0x6ebb('0x48')]=[{'all':!![]}];}_0xb32b37=_['merge']({},_0xb32b37,_0x53857f['options']);return db['SquareProject']['find'](_0xb32b37)[_0x6ebb('0x2b')](handleEntityNotFound(_0x220745,null))[_0x6ebb('0x2b')](respondWithResult(_0x220745,null))[_0x6ebb('0x4a')](handleError(_0x220745,null));};exports[_0x6ebb('0x4d')]=function(_0x588855,_0x3e9e00){return db[_0x6ebb('0x34')][_0x6ebb('0x4d')](_0x588855[_0x6ebb('0x4e')],{})['then'](function(_0x24933f){var _0x164369=_0x588855[_0x6ebb('0x4f')][_0x6ebb('0x2c')]({'plain':!![]});if(!_0x164369)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164369[_0x6ebb('0x50')]===_0x6ebb('0x4f')){var _0x20d8e3=_0x24933f[_0x6ebb('0x2c')]({'plain':!![]});var _0x4d3953=_0x6ebb('0x2d');return db[_0x6ebb('0x51')]['find']({'where':{'name':_0x4d3953,'userProfileId':_0x164369[_0x6ebb('0x52')]},'raw':!![]})[_0x6ebb('0x2b')](function(_0x5d1017){if(_0x5d1017&&_0x5d1017[_0x6ebb('0x53')]===0x0){return db[_0x6ebb('0x2e')][_0x6ebb('0x4d')]({'name':_0x20d8e3['name'],'resourceId':_0x20d8e3['id'],'type':_0x5d1017[_0x6ebb('0x30')],'sectionId':_0x5d1017['id']},{})[_0x6ebb('0x2b')](function(){return _0x24933f;});}else{return _0x24933f;}})[_0x6ebb('0x4a')](function(_0x27dc93){logger[_0x6ebb('0x54')](_0x6ebb('0x55'),_0x27dc93);throw _0x27dc93;});}return _0x24933f;})[_0x6ebb('0x2b')](respondWithResult(_0x3e9e00,0xc9))['catch'](handleError(_0x3e9e00,null));};exports['update']=function(_0x3c7c45,_0x55d44f){if(_0x3c7c45[_0x6ebb('0x4e')]['id']){delete _0x3c7c45['body']['id'];}return db[_0x6ebb('0x34')][_0x6ebb('0x56')]({'where':{'id':_0x3c7c45['params']['id']}})[_0x6ebb('0x2b')](handleEntityNotFound(_0x55d44f,null))[_0x6ebb('0x2b')](saveUpdates(_0x3c7c45['body'],null))[_0x6ebb('0x2b')](respondWithResult(_0x55d44f,null))[_0x6ebb('0x4a')](handleError(_0x55d44f,null));};exports[_0x6ebb('0x2f')]=function(_0x52ecf7,_0x1b9438){return db['SquareProject']['find']({'where':{'id':_0x52ecf7[_0x6ebb('0x57')]['id']}})[_0x6ebb('0x2b')](handleEntityNotFound(_0x1b9438,null))[_0x6ebb('0x2b')](removeEntity(_0x1b9438,null))[_0x6ebb('0x4a')](handleError(_0x1b9438,null));};exports[_0x6ebb('0x58')]=function(_0x394c9d,_0x5e55b3,_0x20bee0){return db[_0x6ebb('0x34')][_0x6ebb('0x56')]({'where':{'id':_0x394c9d[_0x6ebb('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e55b3,null))[_0x6ebb('0x2b')](function(_0x269577){if(_0x269577){return _0x269577['addUsers'](_0x394c9d['body'][_0x6ebb('0x59')],_[_0x6ebb('0x5a')](_0x394c9d[_0x6ebb('0x4e')],[_0x6ebb('0x59'),'id'])||{});}})[_0x6ebb('0x2b')](respondWithResult(_0x5e55b3,null))[_0x6ebb('0x4a')](handleError(_0x5e55b3,null));};exports['removeUsers']=function(_0x8804ca,_0x4caa0d,_0xa75b07){return db[_0x6ebb('0x34')][_0x6ebb('0x56')]({'where':{'id':_0x8804ca[_0x6ebb('0x57')]['id']}})[_0x6ebb('0x2b')](handleEntityNotFound(_0x4caa0d,null))[_0x6ebb('0x2b')](function(_0x1eee2e){if(_0x1eee2e){return _0x1eee2e[_0x6ebb('0x5b')](_0x8804ca['query'][_0x6ebb('0x59')])[_0x6ebb('0x2b')](function(){if(_[_0x6ebb('0x5c')](_0x8804ca[_0x6ebb('0x39')]['ids'])){for(var _0x247199=0x0;_0x247199<_0x8804ca[_0x6ebb('0x39')]['ids'][_0x6ebb('0x3e')];_0x247199+=0x1){socket[_0x6ebb('0x5d')](_0x6ebb('0x5e'),{'UserId':Number(_0x8804ca[_0x6ebb('0x39')][_0x6ebb('0x59')][_0x247199]),'SquareProjectId':Number(_0x8804ca['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x8804ca[_0x6ebb('0x39')][_0x6ebb('0x59')]),'SquareProjectId':Number(_0x8804ca[_0x6ebb('0x57')]['id'])});}});}})[_0x6ebb('0x2b')](respondWithStatusCode(_0x4caa0d,null))[_0x6ebb('0x4a')](handleError(_0x4caa0d,null));};exports[_0x6ebb('0x5f')]=function(_0x47d650,_0x4d5942,_0x55c443){var _0x122a24={};var _0x304755={};var _0x26d8e3;var _0x22f999;return db['SquareProject'][_0x6ebb('0x60')]({'where':{'id':_0x47d650[_0x6ebb('0x57')]['id']}})[_0x6ebb('0x2b')](handleEntityNotFound(_0x4d5942,null))[_0x6ebb('0x2b')](function(_0x55d76a){if(_0x55d76a){_0x26d8e3=_0x55d76a;_0x304755['model']=_['keys'](db[_0x6ebb('0x61')]['rawAttributes']);_0x304755[_0x6ebb('0x39')]=_[_0x6ebb('0x4c')](_0x47d650[_0x6ebb('0x39')]);_0x304755[_0x6ebb('0x3a')]=_[_0x6ebb('0x3b')](_0x304755[_0x6ebb('0x38')],_0x304755[_0x6ebb('0x39')]);_0x122a24[_0x6ebb('0x3c')]=_[_0x6ebb('0x3b')](_0x304755[_0x6ebb('0x38')],qs[_0x6ebb('0x3d')](_0x47d650[_0x6ebb('0x39')]['fields']));_0x122a24[_0x6ebb('0x3c')]=_0x122a24['attributes'][_0x6ebb('0x3e')]?_0x122a24[_0x6ebb('0x3c')]:_0x304755['model'];_0x122a24['order']=qs[_0x6ebb('0x3f')](_0x47d650[_0x6ebb('0x39')][_0x6ebb('0x3f')]);_0x122a24['where']=qs[_0x6ebb('0x3a')](_[_0x6ebb('0x41')](_0x47d650['query'],_0x304755[_0x6ebb('0x3a')]));if(_0x47d650[_0x6ebb('0x39')][_0x6ebb('0x42')]){_0x122a24[_0x6ebb('0x40')]=_[_0x6ebb('0x45')](_0x122a24[_0x6ebb('0x40')],{'$or':_[_0x6ebb('0x33')](_0x122a24['attributes'],function(_0x508cb7){var _0x110eae={};_0x110eae[_0x508cb7]={'$like':'%'+_0x47d650[_0x6ebb('0x39')][_0x6ebb('0x42')]+'%'};return _0x110eae;})});}_0x122a24=_[_0x6ebb('0x45')]({},_0x122a24,_0x47d650[_0x6ebb('0x46')]);return _0x26d8e3[_0x6ebb('0x5f')](_0x122a24);}})[_0x6ebb('0x2b')](function(_0x423a12){if(_0x423a12){_0x22f999=_0x423a12[_0x6ebb('0x3e')];if(!_0x47d650['query'][_0x6ebb('0x62')](_0x6ebb('0x63'))){_0x122a24[_0x6ebb('0x22')]=qs[_0x6ebb('0x22')](_0x47d650[_0x6ebb('0x39')][_0x6ebb('0x22')]);_0x122a24[_0x6ebb('0x25')]=qs['offset'](_0x47d650[_0x6ebb('0x39')][_0x6ebb('0x25')]);}return _0x26d8e3['getUsers'](_0x122a24);}})[_0x6ebb('0x2b')](function(_0x184adb){if(_0x184adb){return _0x184adb?{'count':_0x22f999,'rows':_0x184adb}:null;}})[_0x6ebb('0x2b')](respondWithResult(_0x4d5942,null))['catch'](handleError(_0x4d5942,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 34b8349..3326ca5 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 _0x758d=['events','SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x758d,0x120));var _0xd758=function(_0x1007f2,_0x29f317){_0x1007f2=_0x1007f2-0x0;var _0x14c14d=_0x758d[_0x1007f2];return _0x14c14d;};'use strict';var EventEmitter=require(_0xd758('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xd758('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd758('0x2')](0x0);var events={'afterCreate':_0xd758('0x3'),'afterUpdate':'update','afterDestroy':_0xd758('0x4')};function emitEvent(_0x262afb){return function(_0x1c398d,_0x2263f6,_0x34e520){SquareProjectEvents[_0xd758('0x5')](_0x262afb+':'+_0x1c398d['id'],_0x1c398d);SquareProjectEvents[_0xd758('0x5')](_0x262afb,_0x1c398d);_0x34e520(null);};}for(var e in events){if(events[_0xd758('0x6')](e)){var event=events[e];SquareProject[_0xd758('0x7')](e,emitEvent(event));}}module[_0xd758('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xa68d=['hasOwnProperty','exports','events','SquareProject','update','emit'];(function(_0x360fb1,_0x3c3ca2){var _0x413488=function(_0x13dad6){while(--_0x13dad6){_0x360fb1['push'](_0x360fb1['shift']());}};_0x413488(++_0x3c3ca2);}(_0xa68d,0x1e2));var _0xda68=function(_0x30e1a0,_0x17e625){_0x30e1a0=_0x30e1a0-0x0;var _0x10cbeb=_0xa68d[_0x30e1a0];return _0x10cbeb;};'use strict';var EventEmitter=require(_0xda68('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xda68('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xda68('0x2'),'afterDestroy':'remove'};function emitEvent(_0x37ae99){return function(_0x2bfc0d,_0x1e1bdf,_0x7b6209){SquareProjectEvents[_0xda68('0x3')](_0x37ae99+':'+_0x2bfc0d['id'],_0x2bfc0d);SquareProjectEvents['emit'](_0x37ae99,_0x2bfc0d);_0x7b6209(null);};}for(var e in events){if(events[_0xda68('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xda68('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e25b454..a94e90a 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 _0x9e00=['moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','util','../../config/logger','api'];(function(_0x193be2,_0x287a48){var _0x52cbe8=function(_0x1e8bcc){while(--_0x1e8bcc){_0x193be2['push'](_0x193be2['shift']());}};_0x52cbe8(++_0x287a48);}(_0x9e00,0xb1));var _0x09e0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9e00[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x09e0('0x0'));var logger=require(_0x09e0('0x1'))(_0x09e0('0x2'));var moment=require(_0x09e0('0x3'));var BPromise=require(_0x09e0('0x4'));var rp=require(_0x09e0('0x5'));var fs=require('fs');var path=require(_0x09e0('0x6'));var rimraf=require('rimraf');var config=require(_0x09e0('0x7'));var attributes=require(_0x09e0('0x8'));module[_0x09e0('0x9')]=function(_0xdeea05,_0xddbc58){return _0xdeea05[_0x09e0('0xa')](_0x09e0('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c240c,_0x1a30e4,_0x2a1b12){if(_0x3c240c[_0x09e0('0xc')](_0x09e0('0xd'))){_0x3c240c[_0x09e0('0xe')]=moment()[_0x09e0('0xf')](_0x09e0('0x10'));}if(_0x3c240c['changed'](_0x09e0('0x11'))){_0x3c240c['publishedAt']=moment()[_0x09e0('0xf')](_0x09e0('0x10'));}_0x2a1b12(null,_0x3c240c);}}});}; \ No newline at end of file +var _0x19e2=['savedAt','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','changed','preproduction'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0x19e2,0xbe));var _0x219e=function(_0x4764e3,_0x43eb19){_0x4764e3=_0x4764e3-0x0;var _0xf2c2ab=_0x19e2[_0x4764e3];return _0xf2c2ab;};'use strict';var _=require(_0x219e('0x0'));var util=require(_0x219e('0x1'));var logger=require(_0x219e('0x2'))('api');var moment=require(_0x219e('0x3'));var BPromise=require(_0x219e('0x4'));var rp=require(_0x219e('0x5'));var fs=require('fs');var path=require(_0x219e('0x6'));var rimraf=require(_0x219e('0x7'));var config=require(_0x219e('0x8'));var attributes=require(_0x219e('0x9'));module[_0x219e('0xa')]=function(_0x3326d1,_0x473523){return _0x3326d1[_0x219e('0xb')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1cf4bb,_0x10bbbb,_0x259186){if(_0x1cf4bb[_0x219e('0xc')](_0x219e('0xd'))){_0x1cf4bb[_0x219e('0xe')]=moment()['format'](_0x219e('0xf'));}if(_0x1cf4bb[_0x219e('0xc')](_0x219e('0x10'))){_0x1cf4bb['publishedAt']=moment()['format'](_0x219e('0xf'));}_0x259186(null,_0x1cf4bb);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c6528c4..ae29760 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 _0x06d9=['http','redis','defaults','localhost','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSquareProject','SquareProject','find','options','raw','include','model','map','attributes','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x12eb01,_0x4f5361){var _0x5c872a=function(_0x59baba){while(--_0x59baba){_0x12eb01['push'](_0x12eb01['shift']());}};_0x5c872a(++_0x4f5361);}(_0x06d9,0x80));var _0x906d=function(_0xe59e7b,_0x169c3a){_0xe59e7b=_0xe59e7b-0x0;var _0x4b4ffd=_0x06d9[_0xe59e7b];return _0x4b4ffd;};'use strict';var _=require(_0x906d('0x0'));var util=require(_0x906d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x906d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x906d('0x3'))(_0x906d('0x4'));var config=require(_0x906d('0x5'));var jayson=require(_0x906d('0x6'));var client=jayson[_0x906d('0x7')][_0x906d('0x8')]({'port':0x232a});config[_0x906d('0x9')]=_[_0x906d('0xa')](config[_0x906d('0x9')],{'host':_0x906d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x906d('0x9')]));require('./squareProject.socket')[_0x906d('0xc')](socket);function respondWithRpcPromise(_0x531f44,_0x2ce94e,_0x3feb0e){return new BPromise(function(_0x33c725,_0x5c518e){return client[_0x906d('0xd')](_0x531f44,_0x3feb0e)[_0x906d('0xe')](function(_0x4c253c){logger['info'](_0x906d('0xf'),_0x2ce94e,_0x906d('0x10'));logger[_0x906d('0x11')](_0x906d('0x12'),_0x2ce94e,_0x906d('0x10'),JSON['stringify'](_0x4c253c));if(_0x4c253c[_0x906d('0x13')]){if(_0x4c253c[_0x906d('0x13')][_0x906d('0x14')]===0x1f4){logger[_0x906d('0x13')](_0x906d('0xf'),_0x2ce94e,_0x4c253c[_0x906d('0x13')][_0x906d('0x15')]);return _0x5c518e(_0x4c253c[_0x906d('0x13')][_0x906d('0x15')]);}logger[_0x906d('0x13')](_0x906d('0xf'),_0x2ce94e,_0x4c253c[_0x906d('0x13')][_0x906d('0x15')]);return _0x33c725(_0x4c253c['error']['message']);}else{logger[_0x906d('0x16')](_0x906d('0xf'),_0x2ce94e,_0x906d('0x10'));_0x33c725(_0x4c253c[_0x906d('0x17')][_0x906d('0x15')]);}})[_0x906d('0x18')](function(_0x368cf7){logger['error'](_0x906d('0xf'),_0x2ce94e,_0x368cf7);_0x5c518e(_0x368cf7);});});}exports[_0x906d('0x19')]=function(_0x1315f4){var _0x29276e=this;return new Promise(function(_0x2bdc1f,_0x171ab3){return db[_0x906d('0x1a')][_0x906d('0x1b')]({'raw':_0x1315f4[_0x906d('0x1c')]?_0x1315f4[_0x906d('0x1c')][_0x906d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1315f4['options']?_0x1315f4[_0x906d('0x1c')]['where']||null:null,'attributes':_0x1315f4[_0x906d('0x1c')]?_0x1315f4[_0x906d('0x1c')]['attributes']||null:null,'include':_0x1315f4[_0x906d('0x1c')]?_0x1315f4['options'][_0x906d('0x1e')]?_['map'](_0x1315f4[_0x906d('0x1c')][_0x906d('0x1e')],function(_0x420a5b){return{'model':db[_0x420a5b[_0x906d('0x1f')]],'as':_0x420a5b['as'],'attributes':_0x420a5b['attributes'],'include':_0x420a5b['include']?_[_0x906d('0x20')](_0x420a5b[_0x906d('0x1e')],function(_0x50a340){return{'model':db[_0x50a340[_0x906d('0x1f')]],'as':_0x50a340['as'],'attributes':_0x50a340[_0x906d('0x21')],'include':_0x50a340['include']?_['map'](_0x50a340[_0x906d('0x1e')],function(_0xe9404a){return{'model':db[_0xe9404a[_0x906d('0x1f')]],'as':_0xe9404a['as'],'attributes':_0xe9404a[_0x906d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x906d('0xe')](function(_0x80cf93){logger['info'](_0x906d('0x19'),_0x1315f4);logger[_0x906d('0x11')]('ShowSquareProject',_0x1315f4,JSON['stringify'](_0x80cf93));_0x2bdc1f(_0x80cf93);})[_0x906d('0x18')](function(_0x53f1c8){logger[_0x906d('0x13')](_0x906d('0x19'),_0x53f1c8['message'],_0x1315f4);_0x171ab3(_0x29276e[_0x906d('0x13')](0x1f4,_0x53f1c8[_0x906d('0x15')]));});});}; \ No newline at end of file +var _0xe6c5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','SquareProject,\x20%s,\x20%s','message','ShowSquareProject','SquareProject','find','options','raw','include','map','model','attributes','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x462d0f,_0x476f0b){var _0x3c3669=function(_0x38aa1c){while(--_0x38aa1c){_0x462d0f['push'](_0x462d0f['shift']());}};_0x3c3669(++_0x476f0b);}(_0xe6c5,0x67));var _0x5e6c=function(_0xe25727,_0xb008b7){_0xe25727=_0xe25727-0x0;var _0x2d4b40=_0xe6c5[_0xe25727];return _0x2d4b40;};'use strict';var _=require(_0x5e6c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e6c('0x1'));var rs=require(_0x5e6c('0x2'));var fs=require('fs');var Redis=require(_0x5e6c('0x3'));var db=require(_0x5e6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e6c('0x5'))(_0x5e6c('0x6'));var config=require(_0x5e6c('0x7'));var jayson=require(_0x5e6c('0x8'));var client=jayson['client'][_0x5e6c('0x9')]({'port':0x232a});config[_0x5e6c('0xa')]=_[_0x5e6c('0xb')](config['redis'],{'host':_0x5e6c('0xc'),'port':0x18eb});var socket=require(_0x5e6c('0xd'))(new Redis(config[_0x5e6c('0xa')]));require(_0x5e6c('0xe'))[_0x5e6c('0xf')](socket);function respondWithRpcPromise(_0x54381e,_0x9fc264,_0x444a5d){return new BPromise(function(_0x300a9a,_0x44f18c){return client[_0x5e6c('0x10')](_0x54381e,_0x444a5d)[_0x5e6c('0x11')](function(_0x3842cd){logger[_0x5e6c('0x12')]('SquareProject,\x20%s,\x20%s',_0x9fc264,_0x5e6c('0x13'));logger[_0x5e6c('0x14')](_0x5e6c('0x15'),_0x9fc264,'request\x20sent',JSON['stringify'](_0x3842cd));if(_0x3842cd['error']){if(_0x3842cd[_0x5e6c('0x16')][_0x5e6c('0x17')]===0x1f4){logger[_0x5e6c('0x16')](_0x5e6c('0x18'),_0x9fc264,_0x3842cd[_0x5e6c('0x16')][_0x5e6c('0x19')]);return _0x44f18c(_0x3842cd[_0x5e6c('0x16')]['message']);}logger[_0x5e6c('0x16')](_0x5e6c('0x18'),_0x9fc264,_0x3842cd[_0x5e6c('0x16')][_0x5e6c('0x19')]);return _0x300a9a(_0x3842cd[_0x5e6c('0x16')][_0x5e6c('0x19')]);}else{logger[_0x5e6c('0x12')](_0x5e6c('0x18'),_0x9fc264,_0x5e6c('0x13'));_0x300a9a(_0x3842cd['result']['message']);}})['catch'](function(_0x303b29){logger['error']('SquareProject,\x20%s,\x20%s',_0x9fc264,_0x303b29);_0x44f18c(_0x303b29);});});}exports[_0x5e6c('0x1a')]=function(_0x38a440){var _0x1dea13=this;return new Promise(function(_0x38fafb,_0x5a3029){return db[_0x5e6c('0x1b')][_0x5e6c('0x1c')]({'raw':_0x38a440[_0x5e6c('0x1d')]?_0x38a440['options'][_0x5e6c('0x1e')]===undefined?!![]:![]:!![],'where':_0x38a440[_0x5e6c('0x1d')]?_0x38a440['options']['where']||null:null,'attributes':_0x38a440['options']?_0x38a440[_0x5e6c('0x1d')]['attributes']||null:null,'include':_0x38a440[_0x5e6c('0x1d')]?_0x38a440[_0x5e6c('0x1d')][_0x5e6c('0x1f')]?_[_0x5e6c('0x20')](_0x38a440['options'][_0x5e6c('0x1f')],function(_0x5ad710){return{'model':db[_0x5ad710[_0x5e6c('0x21')]],'as':_0x5ad710['as'],'attributes':_0x5ad710[_0x5e6c('0x22')],'include':_0x5ad710[_0x5e6c('0x1f')]?_[_0x5e6c('0x20')](_0x5ad710[_0x5e6c('0x1f')],function(_0x53c21b){return{'model':db[_0x53c21b[_0x5e6c('0x21')]],'as':_0x53c21b['as'],'attributes':_0x53c21b[_0x5e6c('0x22')],'include':_0x53c21b[_0x5e6c('0x1f')]?_[_0x5e6c('0x20')](_0x53c21b[_0x5e6c('0x1f')],function(_0x3e59d8){return{'model':db[_0x3e59d8[_0x5e6c('0x21')]],'as':_0x3e59d8['as'],'attributes':_0x3e59d8[_0x5e6c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5e6c('0x11')](function(_0x2d6908){logger[_0x5e6c('0x12')]('ShowSquareProject',_0x38a440);logger['debug']('ShowSquareProject',_0x38a440,JSON[_0x5e6c('0x23')](_0x2d6908));_0x38fafb(_0x2d6908);})['catch'](function(_0x36cae1){logger[_0x5e6c('0x16')](_0x5e6c('0x1a'),_0x36cae1[_0x5e6c('0x19')],_0x38a440);_0x5a3029(_0x1dea13[_0x5e6c('0x16')](0x1f4,_0x36cae1[_0x5e6c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 58a9e87..9944f06 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 _0x99c1=['register','length','squareProject:','./squareProject.events','remove','update','emit','removeListener'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x99c1,0xf3));var _0x199c=function(_0x490876,_0x4893cd){_0x490876=_0x490876-0x0;var _0x181a85=_0x99c1[_0x490876];return _0x181a85;};'use strict';var SquareProjectEvents=require(_0x199c('0x0'));var events=['save',_0x199c('0x1'),_0x199c('0x2')];function createListener(_0x2b0e45,_0x57bb18){return function(_0x2dee8c){_0x57bb18[_0x199c('0x3')](_0x2b0e45,_0x2dee8c);};}function removeListener(_0x415f0b,_0x45a914){return function(){SquareProjectEvents[_0x199c('0x4')](_0x415f0b,_0x45a914);};}exports[_0x199c('0x5')]=function(_0x5597b9){for(var _0x390989=0x0,_0x5a0825=events[_0x199c('0x6')];_0x390989<_0x5a0825;_0x390989++){var _0xee6c9f=events[_0x390989];var _0x5cac6a=createListener(_0x199c('0x7')+_0xee6c9f,_0x5597b9);SquareProjectEvents['on'](_0xee6c9f,_0x5cac6a);}}; \ No newline at end of file +var _0x4d2f=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x5a35a2,_0x3e05e4){var _0x1a4db8=function(_0x386661){while(--_0x386661){_0x5a35a2['push'](_0x5a35a2['shift']());}};_0x1a4db8(++_0x3e05e4);}(_0x4d2f,0xe7));var _0xf4d2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4d2f[_0x167cc1];return _0x10bc4b;};'use strict';var SquareProjectEvents=require(_0xf4d2('0x0'));var events=[_0xf4d2('0x1'),_0xf4d2('0x2'),_0xf4d2('0x3')];function createListener(_0x332da4,_0x70c3be){return function(_0x8f7cec){_0x70c3be[_0xf4d2('0x4')](_0x332da4,_0x8f7cec);};}function removeListener(_0x4dd76f,_0x467005){return function(){SquareProjectEvents[_0xf4d2('0x5')](_0x4dd76f,_0x467005);};}exports[_0xf4d2('0x6')]=function(_0x3b6cb1){for(var _0x3ac470=0x0,_0x25be5d=events[_0xf4d2('0x7')];_0x3ac470<_0x25be5d;_0x3ac470++){var _0x11211b=events[_0x3ac470];var _0x444fce=createListener(_0xf4d2('0x8')+_0x11211b,_0x3b6cb1);SquareProjectEvents['on'](_0x11211b,_0x444fce);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 83cece0..ae8a6c9 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x38b9ed,_0x1cdee4){var _0x41c75a=function(_0x428b20){while(--_0x428b20){_0x38b9ed['push'](_0x38b9ed['shift']());}};_0x41c75a(++_0x1cdee4);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x58a872,_0x50d43a){_0x58a872=_0x58a872-0x0;var _0x3e1577=_0x7fbe[_0x58a872];return _0x3e1577;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x22f617,_0x4e07ce){var _0x50fb32=function(_0x9a83b){while(--_0x9a83b){_0x22f617['push'](_0x22f617['shift']());}};_0x50fb32(++_0x4e07ce);}(_0xe14b,0x93));var _0xbe14=function(_0x2e96ca,_0x378e0a){_0x2e96ca=_0x2e96ca-0x0;var _0x4ed1bf=_0xe14b[_0x2e96ca];return _0x4ed1bf;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c49c459..3fc6afb 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 _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x1dba00,_0x320b9e){var _0x6b3cd9=function(_0x3d59b5){while(--_0x3d59b5){_0x1dba00['push'](_0x1dba00['shift']());}};_0x6b3cd9(++_0x320b9e);}(_0xa41a,0x6b));var _0xaa41=function(_0x451ccb,_0x5bda1c){_0x451ccb=_0x451ccb-0x0;var _0x5ed22f=_0xa41a[_0x451ccb];return _0x5ed22f;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x572156,_0xb11cdf){var _0x4c0640=function(_0x410e99){while(--_0x410e99){_0x572156['push'](_0x572156['shift']());}};_0x4c0640(++_0xb11cdf);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd46e('0x2')]},'saveName':{'type':Sequelize[_0xd46e('0x2')]},'filename':{'type':Sequelize[_0xd46e('0x2')]},'savePath':{'type':Sequelize[_0xd46e('0x2')]},'format':{'type':Sequelize[_0xd46e('0x3')],'get':function(){var _0x855f24='';var _0x437ea0=this[_0xd46e('0x4')](_0xd46e('0x5'));if(_0x437ea0){_0x855f24=_0x437ea0[_0xd46e('0x6')](_0x437ea0[_0xd46e('0x7')]('.'));}return _0x855f24;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 931ed1e..2214e61 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 _0xcab8=['unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','catch','show','params','find','create','body','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','download','extname'];(function(_0x2bbd23,_0x43c40f){var _0x4dc031=function(_0x1db25b){while(--_0x1db25b){_0x2bbd23['push'](_0x2bbd23['shift']());}};_0x4dc031(++_0x43c40f);}(_0xcab8,0x1a3));var _0x8cab=function(_0x58cd15,_0x5a745c){_0x58cd15=_0x58cd15-0x0;var _0x34ac9a=_0xcab8[_0x58cd15];return _0x34ac9a;};'use strict';var emlformat=require(_0x8cab('0x0'));var rimraf=require(_0x8cab('0x1'));var zipdir=require(_0x8cab('0x2'));var jsonpatch=require(_0x8cab('0x3'));var rp=require(_0x8cab('0x4'));var moment=require(_0x8cab('0x5'));var BPromise=require(_0x8cab('0x6'));var Mustache=require(_0x8cab('0x7'));var util=require(_0x8cab('0x8'));var path=require(_0x8cab('0x9'));var sox=require('sox');var csv=require(_0x8cab('0xa'));var ejs=require(_0x8cab('0xb'));var fs=require('fs');var fs_extra=require(_0x8cab('0xc'));var _=require(_0x8cab('0xd'));var squel=require(_0x8cab('0xe'));var crypto=require(_0x8cab('0xf'));var jsforce=require(_0x8cab('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8cab('0xa'));var querystring=require(_0x8cab('0x11'));var Papa=require(_0x8cab('0x12'));var Redis=require(_0x8cab('0x13'));var authService=require(_0x8cab('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8cab('0x15'));var hardwareService=require(_0x8cab('0x16'));var logger=require(_0x8cab('0x17'))(_0x8cab('0x18'));var utils=require(_0x8cab('0x19'));var config=require(_0x8cab('0x1a'));var licenseUtil=require(_0x8cab('0x1b'));var db=require(_0x8cab('0x1c'))['db'];function respondWithStatusCode(_0x1b06c6,_0x4e640d){_0x4e640d=_0x4e640d||0xcc;return function(_0x55b558){if(_0x55b558){return _0x1b06c6[_0x8cab('0x1d')](_0x4e640d);}return _0x1b06c6[_0x8cab('0x1e')](_0x4e640d)[_0x8cab('0x1f')]();};}function respondWithResult(_0x87123,_0x217ed0){_0x217ed0=_0x217ed0||0xc8;return function(_0x22bf99){if(_0x22bf99){return _0x87123[_0x8cab('0x1e')](_0x217ed0)[_0x8cab('0x20')](_0x22bf99);}};}function respondWithFilteredResult(_0x34b99a,_0x4cf8d5){return function(_0x18b5a7){if(_0x18b5a7){var _0x6fa6fc=typeof _0x4cf8d5[_0x8cab('0x21')]===_0x8cab('0x22')&&typeof _0x4cf8d5[_0x8cab('0x23')]===_0x8cab('0x22');var _0x376440=_0x18b5a7['count'];var _0x57b45f=_0x6fa6fc?0x0:_0x4cf8d5[_0x8cab('0x21')];var _0x3e2ec5=_0x6fa6fc?_0x18b5a7['count']:_0x4cf8d5[_0x8cab('0x21')]+_0x4cf8d5['limit'];var _0x5d8917;if(_0x3e2ec5>=_0x376440){_0x3e2ec5=_0x376440;_0x5d8917=0xc8;}else{_0x5d8917=0xce;}_0x34b99a[_0x8cab('0x1e')](_0x5d8917);return _0x34b99a[_0x8cab('0x24')](_0x8cab('0x25'),_0x57b45f+'-'+_0x3e2ec5+'/'+_0x376440)[_0x8cab('0x20')](_0x18b5a7);}return null;};}function patchUpdates(_0xbe3625){return function(_0x22aae6){try{jsonpatch[_0x8cab('0x26')](_0x22aae6,_0xbe3625,!![]);}catch(_0x11a502){return BPromise[_0x8cab('0x27')](_0x11a502);}return _0x22aae6[_0x8cab('0x28')]();};}function saveUpdates(_0x119c1a,_0x37bc19){return function(_0x2405af){if(_0x2405af){return _0x2405af[_0x8cab('0x29')](_0x119c1a)['then'](function(_0x46b8c5){return _0x46b8c5;});}return null;};}function removeEntity(_0x1aadab,_0x1c368e){return function(_0x21355e){if(_0x21355e){return _0x21355e[_0x8cab('0x2a')]()[_0x8cab('0x2b')](function(){_0x1aadab[_0x8cab('0x1e')](0xcc)[_0x8cab('0x1f')]();});}};}function handleEntityNotFound(_0x1597f5,_0x4e5eda){return function(_0x3cecf6){if(!_0x3cecf6){_0x1597f5[_0x8cab('0x1d')](0x194);}return _0x3cecf6;};}function handleError(_0x2353fb,_0xdefc34){_0xdefc34=_0xdefc34||0x1f4;return function(_0x41ddc7){logger[_0x8cab('0x2c')](_0x41ddc7[_0x8cab('0x2d')]);if(_0x41ddc7['name']){delete _0x41ddc7[_0x8cab('0x2e')];}_0x2353fb[_0x8cab('0x1e')](_0xdefc34)[_0x8cab('0x2f')](_0x41ddc7);};}exports['index']=function(_0x45afbe,_0x10cc96){var _0xf47e2a={},_0x590488={},_0x1c68d3={'count':0x0,'rows':[]};var _0x43038f=_['map'](db[_0x8cab('0x30')][_0x8cab('0x31')],function(_0x19bf05){return{'name':_0x19bf05['fieldName'],'type':_0x19bf05[_0x8cab('0x32')][_0x8cab('0x33')]};});_0x590488[_0x8cab('0x34')]=_['map'](_0x43038f,'name');_0x590488[_0x8cab('0x35')]=_[_0x8cab('0x36')](_0x45afbe[_0x8cab('0x35')]);_0x590488[_0x8cab('0x37')]=_[_0x8cab('0x38')](_0x590488[_0x8cab('0x34')],_0x590488[_0x8cab('0x35')]);_0xf47e2a[_0x8cab('0x39')]=_[_0x8cab('0x38')](_0x590488['model'],qs['fields'](_0x45afbe[_0x8cab('0x35')][_0x8cab('0x3a')]));_0xf47e2a['attributes']=_0xf47e2a[_0x8cab('0x39')][_0x8cab('0x3b')]?_0xf47e2a[_0x8cab('0x39')]:_0x590488[_0x8cab('0x34')];if(!_0x45afbe[_0x8cab('0x35')][_0x8cab('0x3c')](_0x8cab('0x3d'))){_0xf47e2a['limit']=qs[_0x8cab('0x23')](_0x45afbe['query'][_0x8cab('0x23')]);_0xf47e2a[_0x8cab('0x21')]=qs[_0x8cab('0x21')](_0x45afbe[_0x8cab('0x35')]['offset']);}_0xf47e2a[_0x8cab('0x3e')]=qs[_0x8cab('0x3f')](_0x45afbe['query']['sort']);_0xf47e2a['where']=qs[_0x8cab('0x37')](_[_0x8cab('0x40')](_0x45afbe[_0x8cab('0x35')],_0x590488['filters']),_0x43038f);if(_0x45afbe['query'][_0x8cab('0x41')]){_0xf47e2a[_0x8cab('0x42')]=_[_0x8cab('0x43')](_0xf47e2a[_0x8cab('0x42')],{'$or':_[_0x8cab('0x44')](_0x43038f,function(_0x34664a){if(_0x34664a[_0x8cab('0x32')]!=='VIRTUAL'){var _0x99b7f={};_0x99b7f[_0x34664a[_0x8cab('0x2e')]]={'$like':'%'+_0x45afbe[_0x8cab('0x35')][_0x8cab('0x41')]+'%'};return _0x99b7f;}})});}_0xf47e2a=_['merge']({},_0xf47e2a,_0x45afbe[_0x8cab('0x45')]);var _0x29737c={'where':_0xf47e2a[_0x8cab('0x42')]};return db[_0x8cab('0x30')]['count'](_0x29737c)[_0x8cab('0x2b')](function(_0x1cb43c){_0x1c68d3['count']=_0x1cb43c;if(_0x45afbe[_0x8cab('0x35')][_0x8cab('0x46')]){_0xf47e2a[_0x8cab('0x47')]=[{'all':!![]}];}return db[_0x8cab('0x30')][_0x8cab('0x48')](_0xf47e2a);})[_0x8cab('0x2b')](function(_0x505686){_0x1c68d3['rows']=_0x505686;return _0x1c68d3;})[_0x8cab('0x2b')](respondWithFilteredResult(_0x10cc96,_0xf47e2a))[_0x8cab('0x49')](handleError(_0x10cc96,null));};exports[_0x8cab('0x4a')]=function(_0x156b3b,_0x29409b){var _0x4d46a5={'raw':!![],'where':{'id':_0x156b3b[_0x8cab('0x4b')]['id']}},_0x48bec2={};_0x48bec2[_0x8cab('0x34')]=_[_0x8cab('0x36')](db[_0x8cab('0x30')][_0x8cab('0x31')]);_0x48bec2[_0x8cab('0x35')]=_[_0x8cab('0x36')](_0x156b3b[_0x8cab('0x35')]);_0x48bec2['filters']=_['intersection'](_0x48bec2[_0x8cab('0x34')],_0x48bec2[_0x8cab('0x35')]);_0x4d46a5[_0x8cab('0x39')]=_[_0x8cab('0x38')](_0x48bec2[_0x8cab('0x34')],qs[_0x8cab('0x3a')](_0x156b3b[_0x8cab('0x35')][_0x8cab('0x3a')]));_0x4d46a5[_0x8cab('0x39')]=_0x4d46a5[_0x8cab('0x39')][_0x8cab('0x3b')]?_0x4d46a5[_0x8cab('0x39')]:_0x48bec2[_0x8cab('0x34')];if(_0x156b3b[_0x8cab('0x35')][_0x8cab('0x46')]){_0x4d46a5[_0x8cab('0x47')]=[{'all':!![]}];}_0x4d46a5=_['merge']({},_0x4d46a5,_0x156b3b['options']);return db[_0x8cab('0x30')][_0x8cab('0x4c')](_0x4d46a5)['then'](handleEntityNotFound(_0x29409b,null))[_0x8cab('0x2b')](respondWithResult(_0x29409b,null))['catch'](handleError(_0x29409b,null));};exports[_0x8cab('0x4d')]=function(_0x2e3c60,_0x1aeeb0){return db[_0x8cab('0x30')][_0x8cab('0x4d')](_0x2e3c60[_0x8cab('0x4e')],{})[_0x8cab('0x2b')](respondWithResult(_0x1aeeb0,0xc9))[_0x8cab('0x49')](handleError(_0x1aeeb0,null));};exports[_0x8cab('0x29')]=function(_0x345a35,_0x27ae42){if(_0x345a35[_0x8cab('0x4e')]['id']){delete _0x345a35[_0x8cab('0x4e')]['id'];}return db[_0x8cab('0x30')][_0x8cab('0x4c')]({'where':{'id':_0x345a35['params']['id']}})[_0x8cab('0x2b')](handleEntityNotFound(_0x27ae42,null))[_0x8cab('0x2b')](saveUpdates(_0x345a35[_0x8cab('0x4e')],null))['then'](respondWithResult(_0x27ae42,null))[_0x8cab('0x49')](handleError(_0x27ae42,null));};exports['download']=function(_0x5e3b32,_0x315732,_0x40c022){var _0x2b762f=require('../../components/encryptor');var _0x415579=![];var _0x29891c={};if(_0x5e3b32[_0x8cab('0x35')][_0x8cab('0x32')]&&_0x5e3b32['query'][_0x8cab('0x32')]===_0x8cab('0x4f')){_0x29891c[_0x8cab('0x4f')]=_0x5e3b32[_0x8cab('0x4b')]['id'];}else{_0x29891c['id']=_0x5e3b32[_0x8cab('0x4b')]['id'];}return db['SquareRecording'][_0x8cab('0x4c')]({'where':_0x29891c,'attributes':['id',_0x8cab('0x50'),_0x8cab('0x51')],'raw':!![]})[_0x8cab('0x2b')](handleEntityNotFound(_0x315732,null))['then'](function(_0x51486e){if(_0x51486e){var _0x4a008f=_0x51486e[_0x8cab('0x50')];var _0x4cde8a=util[_0x8cab('0x52')](_0x8cab('0x53'),_0x4a008f);if(fs[_0x8cab('0x54')](_0x4cde8a)){_0x415579=!![];return _0x2b762f[_0x8cab('0x55')](_0x4cde8a,_0x4a008f,config[_0x8cab('0x56')][_0x8cab('0x57')])[_0x8cab('0x2b')](function(){return _0x51486e;});}return _0x51486e;}})[_0x8cab('0x2b')](function(_0x7d5c94){if(_0x7d5c94){var _0x2492ec=_0x7d5c94[_0x8cab('0x50')];if(!fs[_0x8cab('0x54')](_0x2492ec)){throw new db['Sequelize'][(_0x8cab('0x58'))]('SquareRecording\x20not\x20found');}if(_0x7d5c94[_0x8cab('0x51')]){return _0x315732[_0x8cab('0x59')](_0x2492ec,_0x7d5c94[_0x8cab('0x51')]+path[_0x8cab('0x5a')](_0x2492ec),function(){if(_0x415579){fs[_0x8cab('0x5b')](_0x2492ec);}});}else{return _0x315732[_0x8cab('0x59')](_0x2492ec,function(_0x2d340b){if(_0x415579){fs['unlink'](_0x2492ec);}});}}})[_0x8cab('0x49')](function(_0x4de478){if(_0x4de478[_0x8cab('0x5c')]==='SquareRecording\x20not\x20found'){_0x315732[_0x8cab('0x1e')](0x194)[_0x8cab('0x2f')](_0x8cab('0x5d'));}else{return handleError(_0x315732,null);}});};exports[_0x8cab('0x2a')]=function(_0x21ad75,_0x5bc1fd){return db[_0x8cab('0x30')][_0x8cab('0x4c')]({'where':{'id':_0x21ad75['params']['id']}})[_0x8cab('0x2b')](function(_0x5f2626){if(_[_0x8cab('0x5e')](_0x5f2626)){throw new ReferenceError(_0x8cab('0x5f'));}return _0x5f2626;})['then'](function(_0x18a956){var _0x2ff0a0=_0x18a956[_0x8cab('0x50')];logger[_0x8cab('0x60')](_0x8cab('0x61'),_0x2ff0a0);if(!_['isNil'](_0x18a956['savePath'])&&fs[_0x8cab('0x54')](_0x2ff0a0)){logger[_0x8cab('0x60')]('File:\x20\x22'+_0x2ff0a0+_0x8cab('0x62'));fs[_0x8cab('0x63')](_0x2ff0a0);}_0x2ff0a0=_0x2ff0a0+_0x8cab('0x64');if(!_[_0x8cab('0x5e')](_0x18a956[_0x8cab('0x50')])&&fs[_0x8cab('0x54')](_0x2ff0a0)){logger[_0x8cab('0x60')](_0x8cab('0x65')+_0x2ff0a0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8cab('0x63')](_0x2ff0a0);}return _0x18a956;})[_0x8cab('0x2b')](function(_0x2fbe56){if(!_0x2fbe56)throw new InternalError();return _0x2fbe56[_0x8cab('0x2a')]();})[_0x8cab('0x2b')](function(){_0x5bc1fd[_0x8cab('0x1e')](0xcc)[_0x8cab('0x1f')]();})['catch'](handleError(_0x5bc1fd,null));}; \ No newline at end of file +var _0xf921=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','keys','find','create','update','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','fast-json-patch','request-promise'];(function(_0x557fe3,_0x1fdff7){var _0x203c68=function(_0xc3e68c){while(--_0xc3e68c){_0x557fe3['push'](_0x557fe3['shift']());}};_0x203c68(++_0x1fdff7);}(_0xf921,0x123));var _0x1f92=function(_0xe4034a,_0x3459b2){_0xe4034a=_0xe4034a-0x0;var _0x189750=_0xf921[_0xe4034a];return _0x189750;};'use strict';var emlformat=require(_0x1f92('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1f92('0x1'));var rp=require(_0x1f92('0x2'));var moment=require(_0x1f92('0x3'));var BPromise=require(_0x1f92('0x4'));var Mustache=require(_0x1f92('0x5'));var util=require(_0x1f92('0x6'));var path=require(_0x1f92('0x7'));var sox=require(_0x1f92('0x8'));var csv=require(_0x1f92('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f92('0xa'));var _=require(_0x1f92('0xb'));var squel=require(_0x1f92('0xc'));var crypto=require(_0x1f92('0xd'));var jsforce=require(_0x1f92('0xe'));var deskjs=require(_0x1f92('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1f92('0x10'));var Redis=require(_0x1f92('0x11'));var authService=require(_0x1f92('0x12'));var qs=require(_0x1f92('0x13'));var as=require(_0x1f92('0x14'));var hardwareService=require(_0x1f92('0x15'));var logger=require(_0x1f92('0x16'))(_0x1f92('0x17'));var utils=require(_0x1f92('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1f92('0x19'));var db=require(_0x1f92('0x1a'))['db'];function respondWithStatusCode(_0x594cb3,_0x204a68){_0x204a68=_0x204a68||0xcc;return function(_0x12905b){if(_0x12905b){return _0x594cb3[_0x1f92('0x1b')](_0x204a68);}return _0x594cb3[_0x1f92('0x1c')](_0x204a68)[_0x1f92('0x1d')]();};}function respondWithResult(_0x39799c,_0x18f819){_0x18f819=_0x18f819||0xc8;return function(_0x53ecce){if(_0x53ecce){return _0x39799c[_0x1f92('0x1c')](_0x18f819)[_0x1f92('0x1e')](_0x53ecce);}};}function respondWithFilteredResult(_0x3f095b,_0xf6cae8){return function(_0x483f38){if(_0x483f38){var _0x46740b=typeof _0xf6cae8[_0x1f92('0x1f')]==='undefined'&&typeof _0xf6cae8[_0x1f92('0x20')]===_0x1f92('0x21');var _0x239348=_0x483f38[_0x1f92('0x22')];var _0xe0e2b=_0x46740b?0x0:_0xf6cae8['offset'];var _0x5a90d0=_0x46740b?_0x483f38[_0x1f92('0x22')]:_0xf6cae8[_0x1f92('0x1f')]+_0xf6cae8[_0x1f92('0x20')];var _0x249a7b;if(_0x5a90d0>=_0x239348){_0x5a90d0=_0x239348;_0x249a7b=0xc8;}else{_0x249a7b=0xce;}_0x3f095b[_0x1f92('0x1c')](_0x249a7b);return _0x3f095b[_0x1f92('0x23')](_0x1f92('0x24'),_0xe0e2b+'-'+_0x5a90d0+'/'+_0x239348)[_0x1f92('0x1e')](_0x483f38);}return null;};}function patchUpdates(_0x2db76e){return function(_0x2dd5f0){try{jsonpatch[_0x1f92('0x25')](_0x2dd5f0,_0x2db76e,!![]);}catch(_0x880eef){return BPromise['reject'](_0x880eef);}return _0x2dd5f0[_0x1f92('0x26')]();};}function saveUpdates(_0x854efe,_0x442c27){return function(_0x4e5af8){if(_0x4e5af8){return _0x4e5af8['update'](_0x854efe)['then'](function(_0x37cfa4){return _0x37cfa4;});}return null;};}function removeEntity(_0x2f2caf,_0x196b6e){return function(_0x1e4fd2){if(_0x1e4fd2){return _0x1e4fd2[_0x1f92('0x27')]()[_0x1f92('0x28')](function(){_0x2f2caf['status'](0xcc)[_0x1f92('0x1d')]();});}};}function handleEntityNotFound(_0x162d60,_0x1dc33a){return function(_0x35af59){if(!_0x35af59){_0x162d60[_0x1f92('0x1b')](0x194);}return _0x35af59;};}function handleError(_0x1e501b,_0x2bfb30){_0x2bfb30=_0x2bfb30||0x1f4;return function(_0x19456c){logger[_0x1f92('0x29')](_0x19456c[_0x1f92('0x2a')]);if(_0x19456c[_0x1f92('0x2b')]){delete _0x19456c[_0x1f92('0x2b')];}_0x1e501b[_0x1f92('0x1c')](_0x2bfb30)['send'](_0x19456c);};}exports['index']=function(_0xb3f42f,_0xf21e43){var _0x426c6c={},_0x49cf77={},_0x380962={'count':0x0,'rows':[]};var _0x47a08c=_['map'](db['SquareRecording']['rawAttributes'],function(_0x409b57){return{'name':_0x409b57['fieldName'],'type':_0x409b57[_0x1f92('0x2c')][_0x1f92('0x2d')]};});_0x49cf77['model']=_['map'](_0x47a08c,'name');_0x49cf77[_0x1f92('0x2e')]=_['keys'](_0xb3f42f[_0x1f92('0x2e')]);_0x49cf77[_0x1f92('0x2f')]=_[_0x1f92('0x30')](_0x49cf77[_0x1f92('0x31')],_0x49cf77['query']);_0x426c6c[_0x1f92('0x32')]=_[_0x1f92('0x30')](_0x49cf77[_0x1f92('0x31')],qs['fields'](_0xb3f42f[_0x1f92('0x2e')][_0x1f92('0x33')]));_0x426c6c[_0x1f92('0x32')]=_0x426c6c['attributes'][_0x1f92('0x34')]?_0x426c6c['attributes']:_0x49cf77['model'];if(!_0xb3f42f[_0x1f92('0x2e')][_0x1f92('0x35')](_0x1f92('0x36'))){_0x426c6c[_0x1f92('0x20')]=qs[_0x1f92('0x20')](_0xb3f42f[_0x1f92('0x2e')]['limit']);_0x426c6c['offset']=qs[_0x1f92('0x1f')](_0xb3f42f['query'][_0x1f92('0x1f')]);}_0x426c6c['order']=qs[_0x1f92('0x37')](_0xb3f42f[_0x1f92('0x2e')][_0x1f92('0x37')]);_0x426c6c['where']=qs[_0x1f92('0x2f')](_[_0x1f92('0x38')](_0xb3f42f[_0x1f92('0x2e')],_0x49cf77[_0x1f92('0x2f')]),_0x47a08c);if(_0xb3f42f[_0x1f92('0x2e')][_0x1f92('0x39')]){_0x426c6c[_0x1f92('0x3a')]=_[_0x1f92('0x3b')](_0x426c6c[_0x1f92('0x3a')],{'$or':_['map'](_0x47a08c,function(_0xb333fd){if(_0xb333fd[_0x1f92('0x2c')]!=='VIRTUAL'){var _0xfcc37c={};_0xfcc37c[_0xb333fd[_0x1f92('0x2b')]]={'$like':'%'+_0xb3f42f[_0x1f92('0x2e')][_0x1f92('0x39')]+'%'};return _0xfcc37c;}})});}_0x426c6c=_[_0x1f92('0x3b')]({},_0x426c6c,_0xb3f42f[_0x1f92('0x3c')]);var _0x3f083f={'where':_0x426c6c['where']};return db[_0x1f92('0x3d')][_0x1f92('0x22')](_0x3f083f)[_0x1f92('0x28')](function(_0x143f2b){_0x380962[_0x1f92('0x22')]=_0x143f2b;if(_0xb3f42f['query'][_0x1f92('0x3e')]){_0x426c6c[_0x1f92('0x3f')]=[{'all':!![]}];}return db[_0x1f92('0x3d')][_0x1f92('0x40')](_0x426c6c);})['then'](function(_0x5ceb49){_0x380962[_0x1f92('0x41')]=_0x5ceb49;return _0x380962;})[_0x1f92('0x28')](respondWithFilteredResult(_0xf21e43,_0x426c6c))[_0x1f92('0x42')](handleError(_0xf21e43,null));};exports['show']=function(_0x1d4c0f,_0x578a9a){var _0x4ed536={'raw':!![],'where':{'id':_0x1d4c0f['params']['id']}},_0x363b72={};_0x363b72[_0x1f92('0x31')]=_[_0x1f92('0x43')](db['SquareRecording']['rawAttributes']);_0x363b72[_0x1f92('0x2e')]=_[_0x1f92('0x43')](_0x1d4c0f['query']);_0x363b72['filters']=_[_0x1f92('0x30')](_0x363b72[_0x1f92('0x31')],_0x363b72['query']);_0x4ed536[_0x1f92('0x32')]=_[_0x1f92('0x30')](_0x363b72[_0x1f92('0x31')],qs[_0x1f92('0x33')](_0x1d4c0f[_0x1f92('0x2e')][_0x1f92('0x33')]));_0x4ed536['attributes']=_0x4ed536[_0x1f92('0x32')][_0x1f92('0x34')]?_0x4ed536[_0x1f92('0x32')]:_0x363b72[_0x1f92('0x31')];if(_0x1d4c0f['query'][_0x1f92('0x3e')]){_0x4ed536[_0x1f92('0x3f')]=[{'all':!![]}];}_0x4ed536=_[_0x1f92('0x3b')]({},_0x4ed536,_0x1d4c0f['options']);return db[_0x1f92('0x3d')][_0x1f92('0x44')](_0x4ed536)['then'](handleEntityNotFound(_0x578a9a,null))[_0x1f92('0x28')](respondWithResult(_0x578a9a,null))[_0x1f92('0x42')](handleError(_0x578a9a,null));};exports[_0x1f92('0x45')]=function(_0x51b372,_0x2346b2){return db['SquareRecording'][_0x1f92('0x45')](_0x51b372['body'],{})['then'](respondWithResult(_0x2346b2,0xc9))['catch'](handleError(_0x2346b2,null));};exports[_0x1f92('0x46')]=function(_0x135b17,_0xb3421b){if(_0x135b17['body']['id']){delete _0x135b17[_0x1f92('0x47')]['id'];}return db[_0x1f92('0x3d')][_0x1f92('0x44')]({'where':{'id':_0x135b17[_0x1f92('0x48')]['id']}})['then'](handleEntityNotFound(_0xb3421b,null))['then'](saveUpdates(_0x135b17[_0x1f92('0x47')],null))['then'](respondWithResult(_0xb3421b,null))[_0x1f92('0x42')](handleError(_0xb3421b,null));};exports[_0x1f92('0x49')]=function(_0xd7757,_0x339dfc,_0x5a2cb8){var _0x1e063d=require(_0x1f92('0x4a'));var _0x28e502=![];var _0x25c4c5={};if(_0xd7757[_0x1f92('0x2e')][_0x1f92('0x2c')]&&_0xd7757[_0x1f92('0x2e')]['type']==='uniqueid'){_0x25c4c5[_0x1f92('0x4b')]=_0xd7757[_0x1f92('0x48')]['id'];}else{_0x25c4c5['id']=_0xd7757['params']['id'];}return db[_0x1f92('0x3d')][_0x1f92('0x44')]({'where':_0x25c4c5,'attributes':['id',_0x1f92('0x4c'),_0x1f92('0x4d')],'raw':!![]})[_0x1f92('0x28')](handleEntityNotFound(_0x339dfc,null))['then'](function(_0x25e57a){if(_0x25e57a){var _0x1a4e94=_0x25e57a[_0x1f92('0x4c')];var _0x219c85=util[_0x1f92('0x4e')](_0x1f92('0x4f'),_0x1a4e94);if(fs[_0x1f92('0x50')](_0x219c85)){_0x28e502=!![];return _0x1e063d[_0x1f92('0x51')](_0x219c85,_0x1a4e94,config[_0x1f92('0x52')][_0x1f92('0x53')])[_0x1f92('0x28')](function(){return _0x25e57a;});}return _0x25e57a;}})['then'](function(_0x56b6a3){if(_0x56b6a3){var _0xfeaa21=_0x56b6a3['savePath'];if(!fs[_0x1f92('0x50')](_0xfeaa21)){throw new db[(_0x1f92('0x54'))]['ValidationError'](_0x1f92('0x55'));}if(_0x56b6a3[_0x1f92('0x4d')]){return _0x339dfc['download'](_0xfeaa21,_0x56b6a3[_0x1f92('0x4d')]+path[_0x1f92('0x56')](_0xfeaa21),function(){if(_0x28e502){fs[_0x1f92('0x57')](_0xfeaa21);}});}else{return _0x339dfc['download'](_0xfeaa21,function(_0xe7af1e){if(_0x28e502){fs['unlink'](_0xfeaa21);}});}}})[_0x1f92('0x42')](function(_0xfe8f5b){if(_0xfe8f5b[_0x1f92('0x58')]===_0x1f92('0x55')){_0x339dfc['status'](0x194)[_0x1f92('0x59')](_0x1f92('0x5a'));}else{return handleError(_0x339dfc,null);}});};exports['destroy']=function(_0x212c32,_0x4eac4b){return db[_0x1f92('0x3d')]['find']({'where':{'id':_0x212c32[_0x1f92('0x48')]['id']}})[_0x1f92('0x28')](function(_0x27ecb0){if(_[_0x1f92('0x5b')](_0x27ecb0)){throw new ReferenceError('Entity\x20not\x20found');}return _0x27ecb0;})[_0x1f92('0x28')](function(_0x258f62){var _0x5a1455=_0x258f62[_0x1f92('0x4c')];logger[_0x1f92('0x5c')](_0x1f92('0x5d'),_0x5a1455);if(!_['isNil'](_0x258f62['savePath'])&&fs[_0x1f92('0x50')](_0x5a1455)){logger[_0x1f92('0x5c')](_0x1f92('0x5e')+_0x5a1455+_0x1f92('0x5f'));fs[_0x1f92('0x60')](_0x5a1455);}_0x5a1455=_0x5a1455+_0x1f92('0x61');if(!_['isNil'](_0x258f62[_0x1f92('0x4c')])&&fs['existsSync'](_0x5a1455)){logger['info'](_0x1f92('0x5e')+_0x5a1455+_0x1f92('0x5f'));fs[_0x1f92('0x60')](_0x5a1455);}return _0x258f62;})[_0x1f92('0x28')](function(_0x302117){if(!_0x302117)throw new InternalError();return _0x302117[_0x1f92('0x27')]();})[_0x1f92('0x28')](function(){_0x4eac4b[_0x1f92('0x1c')](0xcc)[_0x1f92('0x1d')]();})[_0x1f92('0x42')](handleError(_0x4eac4b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d7192f6..d2eafb8 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 _0x078f=['exports','define','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes'];(function(_0x186bcb,_0xd1a15f){var _0x5b8ad7=function(_0x1e0a40){while(--_0x1e0a40){_0x186bcb['push'](_0x186bcb['shift']());}};_0x5b8ad7(++_0xd1a15f);}(_0x078f,0x1b4));var _0xf078=function(_0x33d0e9,_0x104dda){_0x33d0e9=_0x33d0e9-0x0;var _0x32dbf9=_0x078f[_0x33d0e9];return _0x32dbf9;};'use strict';var _=require('lodash');var util=require(_0xf078('0x0'));var logger=require(_0xf078('0x1'))('api');var moment=require(_0xf078('0x2'));var BPromise=require(_0xf078('0x3'));var rp=require(_0xf078('0x4'));var fs=require('fs');var path=require(_0xf078('0x5'));var rimraf=require('rimraf');var config=require(_0xf078('0x6'));var attributes=require(_0xf078('0x7'));module[_0xf078('0x8')]=function(_0x44b961,_0x1fb253){return _0x44b961[_0xf078('0x9')](_0xf078('0xa'),attributes,{'tableName':_0xf078('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x672a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x672a,0x122));var _0xa672=function(_0x4160e6,_0x46a685){_0x4160e6=_0x4160e6-0x0;var _0x27d906=_0x672a[_0x4160e6];return _0x27d906;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var logger=require(_0xa672('0x2'))(_0xa672('0x3'));var moment=require(_0xa672('0x4'));var BPromise=require(_0xa672('0x5'));var rp=require(_0xa672('0x6'));var fs=require('fs');var path=require(_0xa672('0x7'));var rimraf=require(_0xa672('0x8'));var config=require(_0xa672('0x9'));var attributes=require(_0xa672('0xa'));module['exports']=function(_0x272de8,_0x3f37f0){return _0x272de8[_0xa672('0xb')](_0xa672('0xc'),attributes,{'tableName':_0xa672('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 324ba05..55281af 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 _0x2d89=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x37e9d6,_0x4b7539){var _0x34744e=function(_0xd94516){while(--_0xd94516){_0x37e9d6['push'](_0x37e9d6['shift']());}};_0x34744e(++_0x4b7539);}(_0x2d89,0x10e));var _0x92d8=function(_0x2c5805,_0x462c52){_0x2c5805=_0x2c5805-0x0;var _0x1e5216=_0x2d89[_0x2c5805];return _0x1e5216;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x92d8('0x0'));var BPromise=require(_0x92d8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92d8('0x2'));var db=require(_0x92d8('0x3'))['db'];var utils=require(_0x92d8('0x4'));var logger=require(_0x92d8('0x5'))(_0x92d8('0x6'));var config=require(_0x92d8('0x7'));var jayson=require(_0x92d8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4f5f,_0x5c5a0c,_0x264535){return new BPromise(function(_0x42d1b7,_0x2a959d){return client[_0x92d8('0x9')](_0x3b4f5f,_0x264535)[_0x92d8('0xa')](function(_0x2c9f6a){logger[_0x92d8('0xb')](_0x92d8('0xc'),_0x5c5a0c,_0x92d8('0xd'));logger[_0x92d8('0xe')](_0x92d8('0xf'),_0x5c5a0c,'request\x20sent',JSON[_0x92d8('0x10')](_0x2c9f6a));if(_0x2c9f6a['error']){if(_0x2c9f6a[_0x92d8('0x11')][_0x92d8('0x12')]===0x1f4){logger[_0x92d8('0x11')](_0x92d8('0xc'),_0x5c5a0c,_0x2c9f6a[_0x92d8('0x11')][_0x92d8('0x13')]);return _0x2a959d(_0x2c9f6a[_0x92d8('0x11')][_0x92d8('0x13')]);}logger[_0x92d8('0x11')](_0x92d8('0xc'),_0x5c5a0c,_0x2c9f6a[_0x92d8('0x11')]['message']);return _0x42d1b7(_0x2c9f6a[_0x92d8('0x11')][_0x92d8('0x13')]);}else{logger['info'](_0x92d8('0xc'),_0x5c5a0c,_0x92d8('0xd'));_0x42d1b7(_0x2c9f6a[_0x92d8('0x14')][_0x92d8('0x13')]);}})['catch'](function(_0x14ea44){logger[_0x92d8('0x11')](_0x92d8('0xc'),_0x5c5a0c,_0x14ea44);_0x2a959d(_0x14ea44);});});}exports[_0x92d8('0x15')]=function(_0x4869e4){var _0x3b4192=this;return new Promise(function(_0xd3604a,_0x6b357d){return db[_0x92d8('0x16')][_0x92d8('0x17')](_0x4869e4[_0x92d8('0x18')],{'raw':_0x4869e4['options']?_0x4869e4[_0x92d8('0x19')][_0x92d8('0x1a')]===undefined?!![]:![]:!![]})[_0x92d8('0xa')](function(_0x3ec573){logger[_0x92d8('0xb')](_0x92d8('0x15'),_0x4869e4);logger[_0x92d8('0xe')](_0x92d8('0x15'),_0x4869e4,JSON[_0x92d8('0x10')](_0x3ec573));_0xd3604a(_0x3ec573);})[_0x92d8('0x1b')](function(_0x1a0250){logger[_0x92d8('0x11')](_0x92d8('0x15'),_0x1a0250[_0x92d8('0x13')],_0x4869e4);_0x6b357d(_0x3b4192[_0x92d8('0x11')](0x1f4,_0x1a0250[_0x92d8('0x13')]));});});}; \ No newline at end of file +var _0xad86=['debug','code','error','SquareRecording,\x20%s,\x20%s','message','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad86,0xd8));var _0x6ad8=function(_0x82c7aa,_0x195a32){_0x82c7aa=_0x82c7aa-0x0;var _0x4d943e=_0xad86[_0x82c7aa];return _0x4d943e;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var moment=require('moment');var BPromise=require(_0x6ad8('0x2'));var rs=require(_0x6ad8('0x3'));var fs=require('fs');var Redis=require(_0x6ad8('0x4'));var db=require(_0x6ad8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ad8('0x6'))(_0x6ad8('0x7'));var config=require(_0x6ad8('0x8'));var jayson=require(_0x6ad8('0x9'));var client=jayson[_0x6ad8('0xa')][_0x6ad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173e77,_0x281927,_0x326642){return new BPromise(function(_0x4ec7f4,_0x259581){return client[_0x6ad8('0xc')](_0x173e77,_0x326642)[_0x6ad8('0xd')](function(_0x725f45){logger[_0x6ad8('0xe')]('SquareRecording,\x20%s,\x20%s',_0x281927,_0x6ad8('0xf'));logger[_0x6ad8('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x281927,_0x6ad8('0xf'),JSON['stringify'](_0x725f45));if(_0x725f45['error']){if(_0x725f45['error'][_0x6ad8('0x11')]===0x1f4){logger[_0x6ad8('0x12')](_0x6ad8('0x13'),_0x281927,_0x725f45[_0x6ad8('0x12')]['message']);return _0x259581(_0x725f45[_0x6ad8('0x12')][_0x6ad8('0x14')]);}logger[_0x6ad8('0x12')](_0x6ad8('0x13'),_0x281927,_0x725f45[_0x6ad8('0x12')][_0x6ad8('0x14')]);return _0x4ec7f4(_0x725f45[_0x6ad8('0x12')][_0x6ad8('0x14')]);}else{logger[_0x6ad8('0xe')](_0x6ad8('0x13'),_0x281927,_0x6ad8('0xf'));_0x4ec7f4(_0x725f45['result'][_0x6ad8('0x14')]);}})[_0x6ad8('0x15')](function(_0x5398bb){logger[_0x6ad8('0x12')]('SquareRecording,\x20%s,\x20%s',_0x281927,_0x5398bb);_0x259581(_0x5398bb);});});}exports['CreateSquareRecording']=function(_0x3f1196){var _0x4b251a=this;return new Promise(function(_0x2302df,_0x50592f){return db[_0x6ad8('0x16')][_0x6ad8('0x17')](_0x3f1196[_0x6ad8('0x18')],{'raw':_0x3f1196['options']?_0x3f1196[_0x6ad8('0x19')][_0x6ad8('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x247106){logger[_0x6ad8('0xe')]('CreateSquareRecording',_0x3f1196);logger[_0x6ad8('0x10')](_0x6ad8('0x1b'),_0x3f1196,JSON[_0x6ad8('0x1c')](_0x247106));_0x2302df(_0x247106);})[_0x6ad8('0x15')](function(_0x38831a){logger[_0x6ad8('0x12')]('CreateSquareRecording',_0x38831a[_0x6ad8('0x14')],_0x3f1196);_0x50592f(_0x4b251a[_0x6ad8('0x12')](0x1f4,_0x38831a[_0x6ad8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index a68e825..b8e8d8b 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xa97175,_0x32ce03){var _0x214c65=function(_0x18c163){while(--_0x18c163){_0xa97175['push'](_0xa97175['shift']());}};_0x214c65(++_0x32ce03);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index fe10b9c..5bca5eb 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 _0xed82=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x246b99,_0x54566d){var _0x327e35=function(_0x507166){while(--_0x507166){_0x246b99['push'](_0x246b99['shift']());}};_0x327e35(++_0x54566d);}(_0xed82,0x1af));var _0x2ed8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xed82[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x2ed8('0x0'));module[_0x2ed8('0x1')]={'network':{'type':Sequelize[_0x2ed8('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x2ed8('0x2')]},'channel':{'type':Sequelize[_0x2ed8('0x2')]},'language':{'type':Sequelize[_0x2ed8('0x2')]},'type':{'type':Sequelize[_0x2ed8('0x2')]},'uniqueid':{'type':Sequelize[_0x2ed8('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2ed8('0x2')]},'callingpres':{'type':Sequelize[_0x2ed8('0x2')]},'callingani2':{'type':Sequelize[_0x2ed8('0x2')]},'callington':{'type':Sequelize[_0x2ed8('0x2')]},'callingtns':{'type':Sequelize[_0x2ed8('0x2')]},'dnid':{'type':Sequelize[_0x2ed8('0x2')]},'rdnis':{'type':Sequelize[_0x2ed8('0x2')]},'context':{'type':Sequelize[_0x2ed8('0x2')]},'extension':{'type':Sequelize[_0x2ed8('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x2ed8('0x2')]},'accountcode':{'type':Sequelize[_0x2ed8('0x2')]},'threadid':{'type':Sequelize[_0x2ed8('0x2')]},'project_name':{'type':Sequelize[_0x2ed8('0x2')]},'joinAt':{'type':Sequelize[_0x2ed8('0x3')]},'leaveAt':{'type':Sequelize[_0x2ed8('0x3')]},'bot':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9b2f=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x43a0bb,_0x11c9a4){var _0x125462=function(_0x56cd77){while(--_0x56cd77){_0x43a0bb['push'](_0x43a0bb['shift']());}};_0x125462(++_0x11c9a4);}(_0x9b2f,0x73));var _0xf9b2=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x9b2f[_0x2ca616];return _0x53155f;};'use strict';var Sequelize=require(_0xf9b2('0x0'));module[_0xf9b2('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf9b2('0x2')]},'request':{'type':Sequelize[_0xf9b2('0x2')]},'channel':{'type':Sequelize[_0xf9b2('0x2')]},'language':{'type':Sequelize[_0xf9b2('0x2')]},'type':{'type':Sequelize[_0xf9b2('0x2')]},'uniqueid':{'type':Sequelize[_0xf9b2('0x2')]},'version':{'type':Sequelize[_0xf9b2('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf9b2('0x2')]},'callingpres':{'type':Sequelize[_0xf9b2('0x2')]},'callingani2':{'type':Sequelize[_0xf9b2('0x2')]},'callington':{'type':Sequelize[_0xf9b2('0x2')]},'callingtns':{'type':Sequelize[_0xf9b2('0x2')]},'dnid':{'type':Sequelize[_0xf9b2('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf9b2('0x2')]},'extension':{'type':Sequelize[_0xf9b2('0x2')]},'priority':{'type':Sequelize[_0xf9b2('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xf9b2('0x2')]},'project_name':{'type':Sequelize[_0xf9b2('0x2')]},'joinAt':{'type':Sequelize[_0xf9b2('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xf9b2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index a764f5a..0c2aad9 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 _0x19c4=['type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','options','find','create','catch','body','params','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes'];(function(_0x1c42cb,_0x4db886){var _0x3d65de=function(_0x5a4b69){while(--_0x5a4b69){_0x1c42cb['push'](_0x1c42cb['shift']());}};_0x3d65de(++_0x4db886);}(_0x19c4,0xf4));var _0x419c=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x19c4[_0x1d04b5];return _0x161342;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x419c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x419c('0x1'));var rp=require('request-promise');var moment=require(_0x419c('0x2'));var BPromise=require(_0x419c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x419c('0x4'));var sox=require(_0x419c('0x5'));var csv=require('to-csv');var ejs=require(_0x419c('0x6'));var fs=require('fs');var fs_extra=require(_0x419c('0x7'));var _=require(_0x419c('0x8'));var squel=require(_0x419c('0x9'));var crypto=require(_0x419c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x419c('0xb'));var toCsv=require(_0x419c('0xc'));var querystring=require(_0x419c('0xd'));var Papa=require(_0x419c('0xe'));var Redis=require('ioredis');var authService=require(_0x419c('0xf'));var qs=require(_0x419c('0x10'));var as=require(_0x419c('0x11'));var hardwareService=require(_0x419c('0x12'));var logger=require(_0x419c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x419c('0x14'));var licenseUtil=require(_0x419c('0x15'));var db=require(_0x419c('0x16'))['db'];function respondWithStatusCode(_0x193101,_0x4fb81b){_0x4fb81b=_0x4fb81b||0xcc;return function(_0x3e83b3){if(_0x3e83b3){return _0x193101[_0x419c('0x17')](_0x4fb81b);}return _0x193101[_0x419c('0x18')](_0x4fb81b)[_0x419c('0x19')]();};}function respondWithResult(_0x3908ef,_0x3fc8c8){_0x3fc8c8=_0x3fc8c8||0xc8;return function(_0x5e22b7){if(_0x5e22b7){return _0x3908ef['status'](_0x3fc8c8)['json'](_0x5e22b7);}};}function respondWithFilteredResult(_0x2a312a,_0x56ffd1){return function(_0x319cdd){if(_0x319cdd){var _0x40327e=typeof _0x56ffd1[_0x419c('0x1a')]==='undefined'&&typeof _0x56ffd1[_0x419c('0x1b')]===_0x419c('0x1c');var _0x28f083=_0x319cdd['count'];var _0x6f49a9=_0x40327e?0x0:_0x56ffd1[_0x419c('0x1a')];var _0x5af7e1=_0x40327e?_0x319cdd[_0x419c('0x1d')]:_0x56ffd1[_0x419c('0x1a')]+_0x56ffd1[_0x419c('0x1b')];var _0x1c00a0;if(_0x5af7e1>=_0x28f083){_0x5af7e1=_0x28f083;_0x1c00a0=0xc8;}else{_0x1c00a0=0xce;}_0x2a312a[_0x419c('0x18')](_0x1c00a0);return _0x2a312a[_0x419c('0x1e')](_0x419c('0x1f'),_0x6f49a9+'-'+_0x5af7e1+'/'+_0x28f083)[_0x419c('0x20')](_0x319cdd);}return null;};}function patchUpdates(_0x1f9ef6){return function(_0x42ccf5){try{jsonpatch[_0x419c('0x21')](_0x42ccf5,_0x1f9ef6,!![]);}catch(_0x39750f){return BPromise['reject'](_0x39750f);}return _0x42ccf5['save']();};}function saveUpdates(_0x5d7c1b,_0x86dea3){return function(_0x3a5db8){if(_0x3a5db8){return _0x3a5db8[_0x419c('0x22')](_0x5d7c1b)[_0x419c('0x23')](function(_0x313afe){return _0x313afe;});}return null;};}function removeEntity(_0x1777df,_0x21138b){return function(_0x4b0025){if(_0x4b0025){return _0x4b0025[_0x419c('0x24')]()[_0x419c('0x23')](function(){_0x1777df[_0x419c('0x18')](0xcc)[_0x419c('0x19')]();});}};}function handleEntityNotFound(_0x59ed84,_0x342faf){return function(_0x1bac4b){if(!_0x1bac4b){_0x59ed84[_0x419c('0x17')](0x194);}return _0x1bac4b;};}function handleError(_0x38f188,_0x2270e4){_0x2270e4=_0x2270e4||0x1f4;return function(_0xa26f48){logger[_0x419c('0x25')](_0xa26f48[_0x419c('0x26')]);if(_0xa26f48[_0x419c('0x27')]){delete _0xa26f48[_0x419c('0x27')];}_0x38f188[_0x419c('0x18')](_0x2270e4)[_0x419c('0x28')](_0xa26f48);};}exports[_0x419c('0x29')]=function(_0x2ee8ca,_0x37e78f){var _0x33aeac={},_0x58e930={},_0x584643={'count':0x0,'rows':[]};var _0x2aa685=_['map'](db[_0x419c('0x2a')][_0x419c('0x2b')],function(_0xbf1ba0){return{'name':_0xbf1ba0['fieldName'],'type':_0xbf1ba0[_0x419c('0x2c')][_0x419c('0x2d')]};});_0x58e930[_0x419c('0x2e')]=_[_0x419c('0x2f')](_0x2aa685,_0x419c('0x27'));_0x58e930[_0x419c('0x30')]=_[_0x419c('0x31')](_0x2ee8ca[_0x419c('0x30')]);_0x58e930[_0x419c('0x32')]=_[_0x419c('0x33')](_0x58e930[_0x419c('0x2e')],_0x58e930[_0x419c('0x30')]);_0x33aeac['attributes']=_[_0x419c('0x33')](_0x58e930[_0x419c('0x2e')],qs[_0x419c('0x34')](_0x2ee8ca[_0x419c('0x30')][_0x419c('0x34')]));_0x33aeac[_0x419c('0x35')]=_0x33aeac[_0x419c('0x35')][_0x419c('0x36')]?_0x33aeac[_0x419c('0x35')]:_0x58e930[_0x419c('0x2e')];if(!_0x2ee8ca[_0x419c('0x30')][_0x419c('0x37')]('nolimit')){_0x33aeac['limit']=qs['limit'](_0x2ee8ca[_0x419c('0x30')]['limit']);_0x33aeac['offset']=qs[_0x419c('0x1a')](_0x2ee8ca[_0x419c('0x30')]['offset']);}_0x33aeac['order']=qs[_0x419c('0x38')](_0x2ee8ca[_0x419c('0x30')]['sort']);_0x33aeac[_0x419c('0x39')]=qs[_0x419c('0x32')](_[_0x419c('0x3a')](_0x2ee8ca[_0x419c('0x30')],_0x58e930[_0x419c('0x32')]),_0x2aa685);if(_0x2ee8ca[_0x419c('0x30')][_0x419c('0x3b')]){_0x33aeac[_0x419c('0x39')]=_['merge'](_0x33aeac[_0x419c('0x39')],{'$or':_[_0x419c('0x2f')](_0x2aa685,function(_0x4e6640){if(_0x4e6640[_0x419c('0x2c')]!=='VIRTUAL'){var _0x5c7a3c={};_0x5c7a3c[_0x4e6640[_0x419c('0x27')]]={'$like':'%'+_0x2ee8ca[_0x419c('0x30')][_0x419c('0x3b')]+'%'};return _0x5c7a3c;}})});}_0x33aeac=_[_0x419c('0x3c')]({},_0x33aeac,_0x2ee8ca['options']);var _0x568e39={'where':_0x33aeac['where']};return db[_0x419c('0x2a')][_0x419c('0x1d')](_0x568e39)[_0x419c('0x23')](function(_0x1a8e95){_0x584643[_0x419c('0x1d')]=_0x1a8e95;if(_0x2ee8ca[_0x419c('0x30')][_0x419c('0x3d')]){_0x33aeac[_0x419c('0x3e')]=[{'all':!![]}];}return db[_0x419c('0x2a')][_0x419c('0x3f')](_0x33aeac);})[_0x419c('0x23')](function(_0x155912){_0x584643[_0x419c('0x40')]=_0x155912;return _0x584643;})[_0x419c('0x23')](respondWithFilteredResult(_0x37e78f,_0x33aeac))['catch'](handleError(_0x37e78f,null));};exports[_0x419c('0x41')]=function(_0x49c239,_0x492c0c){var _0x295af2={'raw':!![],'where':{'id':_0x49c239['params']['id']}},_0x5e46dd={};_0x5e46dd['model']=_[_0x419c('0x31')](db[_0x419c('0x2a')][_0x419c('0x2b')]);_0x5e46dd['query']=_['keys'](_0x49c239[_0x419c('0x30')]);_0x5e46dd[_0x419c('0x32')]=_['intersection'](_0x5e46dd['model'],_0x5e46dd[_0x419c('0x30')]);_0x295af2[_0x419c('0x35')]=_[_0x419c('0x33')](_0x5e46dd[_0x419c('0x2e')],qs['fields'](_0x49c239['query'][_0x419c('0x34')]));_0x295af2[_0x419c('0x35')]=_0x295af2['attributes']['length']?_0x295af2[_0x419c('0x35')]:_0x5e46dd[_0x419c('0x2e')];if(_0x49c239['query'][_0x419c('0x3d')]){_0x295af2[_0x419c('0x3e')]=[{'all':!![]}];}_0x295af2=_[_0x419c('0x3c')]({},_0x295af2,_0x49c239[_0x419c('0x42')]);return db[_0x419c('0x2a')][_0x419c('0x43')](_0x295af2)[_0x419c('0x23')](handleEntityNotFound(_0x492c0c,null))[_0x419c('0x23')](respondWithResult(_0x492c0c,null))['catch'](handleError(_0x492c0c,null));};exports[_0x419c('0x44')]=function(_0x3ea3fe,_0x5ece91){return db[_0x419c('0x2a')][_0x419c('0x44')](_0x3ea3fe['body'],{})[_0x419c('0x23')](respondWithResult(_0x5ece91,0xc9))[_0x419c('0x45')](handleError(_0x5ece91,null));};exports[_0x419c('0x22')]=function(_0x36a68b,_0x5195a3){if(_0x36a68b[_0x419c('0x46')]['id']){delete _0x36a68b[_0x419c('0x46')]['id'];}return db[_0x419c('0x2a')][_0x419c('0x43')]({'where':{'id':_0x36a68b[_0x419c('0x47')]['id']}})[_0x419c('0x23')](handleEntityNotFound(_0x5195a3,null))[_0x419c('0x23')](saveUpdates(_0x36a68b[_0x419c('0x46')],null))[_0x419c('0x23')](respondWithResult(_0x5195a3,null))['catch'](handleError(_0x5195a3,null));};exports['destroy']=function(_0x7e517d,_0x24cb59){return db['SquareReport'][_0x419c('0x43')]({'where':{'id':_0x7e517d[_0x419c('0x47')]['id']}})[_0x419c('0x23')](handleEntityNotFound(_0x24cb59,null))[_0x419c('0x23')](removeEntity(_0x24cb59,null))[_0x419c('0x45')](handleError(_0x24cb59,null));};exports['describe']=function(_0x1b3d69,_0x15830e){return db[_0x419c('0x2a')]['describe']()['then'](respondWithResult(_0x15830e,null))[_0x419c('0x45')](handleError(_0x15830e,null));}; \ No newline at end of file +var _0xb38d=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','end','sendStatus','error','send','SquareReport','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb38d,0x1be));var _0xdb38=function(_0x51ece4,_0x39165c){_0x51ece4=_0x51ece4-0x0;var _0x2b7e27=_0xb38d[_0x51ece4];return _0x2b7e27;};'use strict';var emlformat=require(_0xdb38('0x0'));var rimraf=require(_0xdb38('0x1'));var zipdir=require(_0xdb38('0x2'));var jsonpatch=require(_0xdb38('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb38('0x4'));var Mustache=require(_0xdb38('0x5'));var util=require(_0xdb38('0x6'));var path=require('path');var sox=require(_0xdb38('0x7'));var csv=require(_0xdb38('0x8'));var ejs=require(_0xdb38('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb38('0xa'));var squel=require(_0xdb38('0xb'));var crypto=require(_0xdb38('0xc'));var jsforce=require(_0xdb38('0xd'));var deskjs=require(_0xdb38('0xe'));var toCsv=require(_0xdb38('0x8'));var querystring=require(_0xdb38('0xf'));var Papa=require(_0xdb38('0x10'));var Redis=require(_0xdb38('0x11'));var authService=require(_0xdb38('0x12'));var qs=require(_0xdb38('0x13'));var as=require(_0xdb38('0x14'));var hardwareService=require(_0xdb38('0x15'));var logger=require('../../config/logger')(_0xdb38('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdb38('0x17'));var db=require(_0xdb38('0x18'))['db'];function respondWithStatusCode(_0x3c205a,_0x291e71){_0x291e71=_0x291e71||0xcc;return function(_0x31e776){if(_0x31e776){return _0x3c205a['sendStatus'](_0x291e71);}return _0x3c205a[_0xdb38('0x19')](_0x291e71)['end']();};}function respondWithResult(_0x251596,_0x117ae1){_0x117ae1=_0x117ae1||0xc8;return function(_0x17d92d){if(_0x17d92d){return _0x251596[_0xdb38('0x19')](_0x117ae1)[_0xdb38('0x1a')](_0x17d92d);}};}function respondWithFilteredResult(_0x26598e,_0x39ade8){return function(_0x1b1215){if(_0x1b1215){var _0x383cbd=typeof _0x39ade8[_0xdb38('0x1b')]==='undefined'&&typeof _0x39ade8[_0xdb38('0x1c')]==='undefined';var _0x3a169e=_0x1b1215[_0xdb38('0x1d')];var _0x5a8930=_0x383cbd?0x0:_0x39ade8['offset'];var _0x23c825=_0x383cbd?_0x1b1215[_0xdb38('0x1d')]:_0x39ade8[_0xdb38('0x1b')]+_0x39ade8[_0xdb38('0x1c')];var _0x3cd214;if(_0x23c825>=_0x3a169e){_0x23c825=_0x3a169e;_0x3cd214=0xc8;}else{_0x3cd214=0xce;}_0x26598e['status'](_0x3cd214);return _0x26598e[_0xdb38('0x1e')](_0xdb38('0x1f'),_0x5a8930+'-'+_0x23c825+'/'+_0x3a169e)[_0xdb38('0x1a')](_0x1b1215);}return null;};}function patchUpdates(_0x1ac7ed){return function(_0x135a38){try{jsonpatch[_0xdb38('0x20')](_0x135a38,_0x1ac7ed,!![]);}catch(_0x468081){return BPromise['reject'](_0x468081);}return _0x135a38['save']();};}function saveUpdates(_0x3542fb,_0x17079b){return function(_0x1188f1){if(_0x1188f1){return _0x1188f1[_0xdb38('0x21')](_0x3542fb)[_0xdb38('0x22')](function(_0x5960a9){return _0x5960a9;});}return null;};}function removeEntity(_0x5c6bd3,_0x517df9){return function(_0x784fbc){if(_0x784fbc){return _0x784fbc[_0xdb38('0x23')]()[_0xdb38('0x22')](function(){_0x5c6bd3[_0xdb38('0x19')](0xcc)[_0xdb38('0x24')]();});}};}function handleEntityNotFound(_0x556781,_0x4555c3){return function(_0x8c4dc8){if(!_0x8c4dc8){_0x556781[_0xdb38('0x25')](0x194);}return _0x8c4dc8;};}function handleError(_0x36f12b,_0x448fba){_0x448fba=_0x448fba||0x1f4;return function(_0x5f4848){logger[_0xdb38('0x26')](_0x5f4848['stack']);if(_0x5f4848['name']){delete _0x5f4848['name'];}_0x36f12b['status'](_0x448fba)[_0xdb38('0x27')](_0x5f4848);};}exports['index']=function(_0x5b5aad,_0x1f8cb6){var _0x4bcae9={},_0x37d59b={},_0x2560e1={'count':0x0,'rows':[]};var _0xe721a4=_['map'](db[_0xdb38('0x28')][_0xdb38('0x29')],function(_0x18c70d){return{'name':_0x18c70d[_0xdb38('0x2a')],'type':_0x18c70d['type'][_0xdb38('0x2b')]};});_0x37d59b[_0xdb38('0x2c')]=_[_0xdb38('0x2d')](_0xe721a4,_0xdb38('0x2e'));_0x37d59b[_0xdb38('0x2f')]=_[_0xdb38('0x30')](_0x5b5aad['query']);_0x37d59b[_0xdb38('0x31')]=_[_0xdb38('0x32')](_0x37d59b['model'],_0x37d59b['query']);_0x4bcae9[_0xdb38('0x33')]=_[_0xdb38('0x32')](_0x37d59b[_0xdb38('0x2c')],qs[_0xdb38('0x34')](_0x5b5aad['query']['fields']));_0x4bcae9[_0xdb38('0x33')]=_0x4bcae9[_0xdb38('0x33')][_0xdb38('0x35')]?_0x4bcae9[_0xdb38('0x33')]:_0x37d59b[_0xdb38('0x2c')];if(!_0x5b5aad['query'][_0xdb38('0x36')](_0xdb38('0x37'))){_0x4bcae9[_0xdb38('0x1c')]=qs[_0xdb38('0x1c')](_0x5b5aad[_0xdb38('0x2f')][_0xdb38('0x1c')]);_0x4bcae9[_0xdb38('0x1b')]=qs[_0xdb38('0x1b')](_0x5b5aad[_0xdb38('0x2f')]['offset']);}_0x4bcae9[_0xdb38('0x38')]=qs[_0xdb38('0x39')](_0x5b5aad['query']['sort']);_0x4bcae9['where']=qs['filters'](_[_0xdb38('0x3a')](_0x5b5aad['query'],_0x37d59b[_0xdb38('0x31')]),_0xe721a4);if(_0x5b5aad['query'][_0xdb38('0x3b')]){_0x4bcae9['where']=_[_0xdb38('0x3c')](_0x4bcae9['where'],{'$or':_[_0xdb38('0x2d')](_0xe721a4,function(_0x6bd067){if(_0x6bd067[_0xdb38('0x3d')]!==_0xdb38('0x3e')){var _0x2fa1bd={};_0x2fa1bd[_0x6bd067[_0xdb38('0x2e')]]={'$like':'%'+_0x5b5aad[_0xdb38('0x2f')][_0xdb38('0x3b')]+'%'};return _0x2fa1bd;}})});}_0x4bcae9=_[_0xdb38('0x3c')]({},_0x4bcae9,_0x5b5aad[_0xdb38('0x3f')]);var _0x4ed9ed={'where':_0x4bcae9[_0xdb38('0x40')]};return db[_0xdb38('0x28')]['count'](_0x4ed9ed)[_0xdb38('0x22')](function(_0x3dc8f3){_0x2560e1[_0xdb38('0x1d')]=_0x3dc8f3;if(_0x5b5aad[_0xdb38('0x2f')]['includeAll']){_0x4bcae9[_0xdb38('0x41')]=[{'all':!![]}];}return db[_0xdb38('0x28')]['findAll'](_0x4bcae9);})[_0xdb38('0x22')](function(_0x8009ed){_0x2560e1[_0xdb38('0x42')]=_0x8009ed;return _0x2560e1;})[_0xdb38('0x22')](respondWithFilteredResult(_0x1f8cb6,_0x4bcae9))[_0xdb38('0x43')](handleError(_0x1f8cb6,null));};exports[_0xdb38('0x44')]=function(_0x58cfed,_0x3cefd9){var _0x1fe2fa={'raw':!![],'where':{'id':_0x58cfed[_0xdb38('0x45')]['id']}},_0x10cd8a={};_0x10cd8a[_0xdb38('0x2c')]=_['keys'](db[_0xdb38('0x28')]['rawAttributes']);_0x10cd8a[_0xdb38('0x2f')]=_[_0xdb38('0x30')](_0x58cfed[_0xdb38('0x2f')]);_0x10cd8a['filters']=_['intersection'](_0x10cd8a[_0xdb38('0x2c')],_0x10cd8a[_0xdb38('0x2f')]);_0x1fe2fa[_0xdb38('0x33')]=_[_0xdb38('0x32')](_0x10cd8a[_0xdb38('0x2c')],qs[_0xdb38('0x34')](_0x58cfed['query'][_0xdb38('0x34')]));_0x1fe2fa['attributes']=_0x1fe2fa[_0xdb38('0x33')]['length']?_0x1fe2fa[_0xdb38('0x33')]:_0x10cd8a[_0xdb38('0x2c')];if(_0x58cfed[_0xdb38('0x2f')][_0xdb38('0x46')]){_0x1fe2fa['include']=[{'all':!![]}];}_0x1fe2fa=_['merge']({},_0x1fe2fa,_0x58cfed[_0xdb38('0x3f')]);return db[_0xdb38('0x28')][_0xdb38('0x47')](_0x1fe2fa)[_0xdb38('0x22')](handleEntityNotFound(_0x3cefd9,null))[_0xdb38('0x22')](respondWithResult(_0x3cefd9,null))['catch'](handleError(_0x3cefd9,null));};exports[_0xdb38('0x48')]=function(_0x2696cd,_0x255648){return db['SquareReport'][_0xdb38('0x48')](_0x2696cd[_0xdb38('0x49')],{})[_0xdb38('0x22')](respondWithResult(_0x255648,0xc9))[_0xdb38('0x43')](handleError(_0x255648,null));};exports[_0xdb38('0x21')]=function(_0x53f925,_0x2871d5){if(_0x53f925[_0xdb38('0x49')]['id']){delete _0x53f925[_0xdb38('0x49')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x53f925[_0xdb38('0x45')]['id']}})[_0xdb38('0x22')](handleEntityNotFound(_0x2871d5,null))[_0xdb38('0x22')](saveUpdates(_0x53f925['body'],null))['then'](respondWithResult(_0x2871d5,null))[_0xdb38('0x43')](handleError(_0x2871d5,null));};exports['destroy']=function(_0x4b7ecc,_0x44050e){return db['SquareReport'][_0xdb38('0x47')]({'where':{'id':_0x4b7ecc['params']['id']}})[_0xdb38('0x22')](handleEntityNotFound(_0x44050e,null))[_0xdb38('0x22')](removeEntity(_0x44050e,null))[_0xdb38('0x43')](handleError(_0x44050e,null));};exports[_0xdb38('0x4a')]=function(_0x50975c,_0x5acbe2){return db[_0xdb38('0x28')][_0xdb38('0x4a')]()[_0xdb38('0x22')](respondWithResult(_0x5acbe2,null))[_0xdb38('0x43')](handleError(_0x5acbe2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5478b0d..d56dd38 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 _0x1120=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square'];(function(_0x550f80,_0x2d7260){var _0x2159d9=function(_0x3416e3){while(--_0x3416e3){_0x550f80['push'](_0x550f80['shift']());}};_0x2159d9(++_0x2d7260);}(_0x1120,0x1e0));var _0x0112=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1120[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x0112('0x0'));var util=require(_0x0112('0x1'));var logger=require(_0x0112('0x2'))(_0x0112('0x3'));var moment=require(_0x0112('0x4'));var BPromise=require(_0x0112('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0112('0x6'));var rimraf=require(_0x0112('0x7'));var config=require(_0x0112('0x8'));var attributes=require(_0x0112('0x9'));module[_0x0112('0xa')]=function(_0x26927a,_0x59796c){return _0x26927a['define'](_0x0112('0xb'),attributes,{'tableName':_0x0112('0xc'),'paranoid':![],'indexes':[{'name':_0x0112('0xd'),'fields':[_0x0112('0xe'),_0x0112('0xf')]},{'name':_0x0112('0x10'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe99b=['define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./squareReport.attributes','exports'];(function(_0x4fb549,_0x28d3c6){var _0x594e92=function(_0x22e6d4){while(--_0x22e6d4){_0x4fb549['push'](_0x4fb549['shift']());}};_0x594e92(++_0x28d3c6);}(_0xe99b,0x150));var _0xbe99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe99b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe99('0x0'));var util=require(_0xbe99('0x1'));var logger=require(_0xbe99('0x2'))(_0xbe99('0x3'));var moment=require('moment');var BPromise=require(_0xbe99('0x4'));var rp=require(_0xbe99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe99('0x6'));var config=require('../../config/environment');var attributes=require(_0xbe99('0x7'));module[_0xbe99('0x8')]=function(_0x5b1621,_0x577cbf){return _0x5b1621[_0xbe99('0x9')](_0xbe99('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xbe99('0xb'),'fields':[_0xbe99('0xc'),_0xbe99('0xd')]},{'name':_0xbe99('0xe'),'fields':[_0xbe99('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 3fd7101..e997698 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 _0x5fcc=['raw','debug','update','attributes','UpdateSquareReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','stringify','error','SquareReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareReport','SquareReport','body','options'];(function(_0x3d82b1,_0x3501bb){var _0x26abd7=function(_0x164199){while(--_0x164199){_0x3d82b1['push'](_0x3d82b1['shift']());}};_0x26abd7(++_0x3501bb);}(_0x5fcc,0x1f2));var _0xc5fc=function(_0x4a3b67,_0x2e0c40){_0x4a3b67=_0x4a3b67-0x0;var _0x273be6=_0x5fcc[_0x4a3b67];return _0x273be6;};'use strict';var _=require(_0xc5fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc5fc('0x1'));var rs=require(_0xc5fc('0x2'));var fs=require('fs');var Redis=require(_0xc5fc('0x3'));var db=require(_0xc5fc('0x4'))['db'];var utils=require(_0xc5fc('0x5'));var logger=require(_0xc5fc('0x6'))(_0xc5fc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5fc('0x8')][_0xc5fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x334f0d,_0x4536fe,_0x5b9b97){return new BPromise(function(_0x31559b,_0x30acdb){return client[_0xc5fc('0xa')](_0x334f0d,_0x5b9b97)[_0xc5fc('0xb')](function(_0x5760ef){logger['info']('SquareReport,\x20%s,\x20%s',_0x4536fe,_0xc5fc('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x4536fe,_0xc5fc('0xc'),JSON[_0xc5fc('0xd')](_0x5760ef));if(_0x5760ef[_0xc5fc('0xe')]){if(_0x5760ef[_0xc5fc('0xe')]['code']===0x1f4){logger[_0xc5fc('0xe')](_0xc5fc('0xf'),_0x4536fe,_0x5760ef[_0xc5fc('0xe')]['message']);return _0x30acdb(_0x5760ef[_0xc5fc('0xe')][_0xc5fc('0x10')]);}logger[_0xc5fc('0xe')](_0xc5fc('0xf'),_0x4536fe,_0x5760ef[_0xc5fc('0xe')][_0xc5fc('0x10')]);return _0x31559b(_0x5760ef[_0xc5fc('0xe')][_0xc5fc('0x10')]);}else{logger[_0xc5fc('0x11')]('SquareReport,\x20%s,\x20%s',_0x4536fe,_0xc5fc('0xc'));_0x31559b(_0x5760ef[_0xc5fc('0x12')][_0xc5fc('0x10')]);}})[_0xc5fc('0x13')](function(_0x3b80dd){logger[_0xc5fc('0xe')](_0xc5fc('0xf'),_0x4536fe,_0x3b80dd);_0x30acdb(_0x3b80dd);});});}exports[_0xc5fc('0x14')]=function(_0x4f9fc8){var _0xcf6c7e=this;return new Promise(function(_0x5d57fa,_0x39309b){return db[_0xc5fc('0x15')]['create'](_0x4f9fc8[_0xc5fc('0x16')],{'raw':_0x4f9fc8[_0xc5fc('0x17')]?_0x4f9fc8[_0xc5fc('0x17')][_0xc5fc('0x18')]===undefined?!![]:![]:!![]})[_0xc5fc('0xb')](function(_0x3871ba){logger[_0xc5fc('0x11')]('CreateSquareReport',_0x4f9fc8);logger[_0xc5fc('0x19')](_0xc5fc('0x14'),_0x4f9fc8,JSON['stringify'](_0x3871ba));_0x5d57fa(_0x3871ba);})[_0xc5fc('0x13')](function(_0x5ee193){logger['error'](_0xc5fc('0x14'),_0x5ee193[_0xc5fc('0x10')],_0x4f9fc8);_0x39309b(_0xcf6c7e[_0xc5fc('0xe')](0x1f4,_0x5ee193[_0xc5fc('0x10')]));});});};exports['UpdateSquareReport']=function(_0x80c716){var _0x32a9c7=this;return new Promise(function(_0x186d2c,_0x3266b8){return db['SquareReport'][_0xc5fc('0x1a')](_0x80c716[_0xc5fc('0x16')],{'raw':_0x80c716[_0xc5fc('0x17')]?_0x80c716['options'][_0xc5fc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80c716[_0xc5fc('0x17')]?_0x80c716['options']['where']||null:null,'attributes':_0x80c716['options']?_0x80c716[_0xc5fc('0x17')][_0xc5fc('0x1b')]||null:null,'limit':_0x80c716[_0xc5fc('0x17')]?_0x80c716[_0xc5fc('0x17')]['limit']||null:null})[_0xc5fc('0xb')](function(_0x51229e){logger[_0xc5fc('0x11')]('UpdateSquareReport',_0x80c716);logger[_0xc5fc('0x19')]('UpdateSquareReport',_0x80c716,JSON[_0xc5fc('0xd')](_0x51229e));_0x186d2c(_0x51229e);})[_0xc5fc('0x13')](function(_0x571c78){logger[_0xc5fc('0xe')](_0xc5fc('0x1c'),_0x571c78[_0xc5fc('0x10')],_0x80c716);_0x3266b8(_0x32a9c7[_0xc5fc('0xe')](0x1f4,_0x571c78['message']));});});}; \ No newline at end of file +var _0xeb5d=['attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateSquareReport','create','raw','stringify','UpdateSquareReport','SquareReport','update','body','options','where'];(function(_0x301df1,_0x3088ad){var _0x12e408=function(_0xcd96e9){while(--_0xcd96e9){_0x301df1['push'](_0x301df1['shift']());}};_0x12e408(++_0x3088ad);}(_0xeb5d,0x1bc));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xdeb5('0x0'));var util=require('util');var moment=require(_0xdeb5('0x1'));var BPromise=require(_0xdeb5('0x2'));var rs=require(_0xdeb5('0x3'));var fs=require('fs');var Redis=require(_0xdeb5('0x4'));var db=require(_0xdeb5('0x5'))['db'];var utils=require(_0xdeb5('0x6'));var logger=require('../../config/logger')(_0xdeb5('0x7'));var config=require(_0xdeb5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdeb5('0x9')][_0xdeb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46be4b,_0x5efa94,_0x551ecd){return new BPromise(function(_0x3cce4c,_0x44322c){return client[_0xdeb5('0xb')](_0x46be4b,_0x551ecd)[_0xdeb5('0xc')](function(_0x8b3c70){logger['info'](_0xdeb5('0xd'),_0x5efa94,'request\x20sent');logger[_0xdeb5('0xe')](_0xdeb5('0xf'),_0x5efa94,_0xdeb5('0x10'),JSON['stringify'](_0x8b3c70));if(_0x8b3c70['error']){if(_0x8b3c70['error']['code']===0x1f4){logger[_0xdeb5('0x11')](_0xdeb5('0xd'),_0x5efa94,_0x8b3c70[_0xdeb5('0x11')][_0xdeb5('0x12')]);return _0x44322c(_0x8b3c70[_0xdeb5('0x11')][_0xdeb5('0x12')]);}logger[_0xdeb5('0x11')](_0xdeb5('0xd'),_0x5efa94,_0x8b3c70[_0xdeb5('0x11')][_0xdeb5('0x12')]);return _0x3cce4c(_0x8b3c70[_0xdeb5('0x11')]['message']);}else{logger[_0xdeb5('0x13')](_0xdeb5('0xd'),_0x5efa94,_0xdeb5('0x10'));_0x3cce4c(_0x8b3c70[_0xdeb5('0x14')][_0xdeb5('0x12')]);}})[_0xdeb5('0x15')](function(_0x10eca8){logger[_0xdeb5('0x11')]('SquareReport,\x20%s,\x20%s',_0x5efa94,_0x10eca8);_0x44322c(_0x10eca8);});});}exports[_0xdeb5('0x16')]=function(_0x347f46){var _0x1a5798=this;return new Promise(function(_0x5ccac7,_0x2ce51d){return db['SquareReport'][_0xdeb5('0x17')](_0x347f46['body'],{'raw':_0x347f46['options']?_0x347f46['options'][_0xdeb5('0x18')]===undefined?!![]:![]:!![]})[_0xdeb5('0xc')](function(_0x368e86){logger[_0xdeb5('0x13')](_0xdeb5('0x16'),_0x347f46);logger[_0xdeb5('0xe')](_0xdeb5('0x16'),_0x347f46,JSON[_0xdeb5('0x19')](_0x368e86));_0x5ccac7(_0x368e86);})[_0xdeb5('0x15')](function(_0x22b392){logger['error'](_0xdeb5('0x16'),_0x22b392[_0xdeb5('0x12')],_0x347f46);_0x2ce51d(_0x1a5798[_0xdeb5('0x11')](0x1f4,_0x22b392[_0xdeb5('0x12')]));});});};exports[_0xdeb5('0x1a')]=function(_0x18f28c){var _0xce2af0=this;return new Promise(function(_0x3de9c6,_0x4a5c3b){return db[_0xdeb5('0x1b')][_0xdeb5('0x1c')](_0x18f28c[_0xdeb5('0x1d')],{'raw':_0x18f28c[_0xdeb5('0x1e')]?_0x18f28c[_0xdeb5('0x1e')][_0xdeb5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f28c[_0xdeb5('0x1e')]?_0x18f28c[_0xdeb5('0x1e')][_0xdeb5('0x1f')]||null:null,'attributes':_0x18f28c[_0xdeb5('0x1e')]?_0x18f28c[_0xdeb5('0x1e')][_0xdeb5('0x20')]||null:null,'limit':_0x18f28c[_0xdeb5('0x1e')]?_0x18f28c['options'][_0xdeb5('0x21')]||null:null})['then'](function(_0x320344){logger[_0xdeb5('0x13')](_0xdeb5('0x1a'),_0x18f28c);logger[_0xdeb5('0xe')]('UpdateSquareReport',_0x18f28c,JSON[_0xdeb5('0x19')](_0x320344));_0x3de9c6(_0x320344);})[_0xdeb5('0x15')](function(_0x39736e){logger[_0xdeb5('0x11')](_0xdeb5('0x1a'),_0x39736e[_0xdeb5('0x12')],_0x18f28c);_0x4a5c3b(_0xce2af0[_0xdeb5('0x11')](0x1f4,_0x39736e[_0xdeb5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9cade06..f743d96 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 _0x4454=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','put','/:id','update','delete'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4454,0x18d));var _0x4445=function(_0xbb3103,_0x14302c){_0xbb3103=_0xbb3103-0x0;var _0x1d031f=_0x4454[_0xbb3103];return _0x1d031f;};'use strict';var multer=require(_0x4445('0x0'));var util=require(_0x4445('0x1'));var path=require(_0x4445('0x2'));var timeout=require('connect-timeout');var express=require(_0x4445('0x3'));var router=express[_0x4445('0x4')]();var fs_extra=require(_0x4445('0x5'));var auth=require(_0x4445('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4445('0x7'));var controller=require('./squareReportDetail.controller');router[_0x4445('0x8')]('/',auth[_0x4445('0x9')](),controller['index']);router[_0x4445('0x8')](_0x4445('0xa'),auth[_0x4445('0x9')](),controller[_0x4445('0xb')]);router[_0x4445('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4445('0xc')]);router['post']('/',auth[_0x4445('0x9')](),controller['create']);router[_0x4445('0xd')](_0x4445('0xe'),auth[_0x4445('0x9')](),controller[_0x4445('0xf')]);router[_0x4445('0x10')](_0x4445('0xe'),auth[_0x4445('0x9')](),controller[_0x4445('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8226=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer'];(function(_0x461467,_0x81d0dd){var _0x5c47da=function(_0x5a10a8){while(--_0x5a10a8){_0x461467['push'](_0x461467['shift']());}};_0x5c47da(++_0x81d0dd);}(_0x8226,0xbd));var _0x6822=function(_0x418305,_0xcf9d75){_0x418305=_0x418305-0x0;var _0x39a433=_0x8226[_0x418305];return _0x39a433;};'use strict';var multer=require(_0x6822('0x0'));var util=require(_0x6822('0x1'));var path=require(_0x6822('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6822('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6822('0x4'));var interaction=require(_0x6822('0x5'));var config=require(_0x6822('0x6'));var controller=require(_0x6822('0x7'));router[_0x6822('0x8')]('/',auth[_0x6822('0x9')](),controller[_0x6822('0xa')]);router[_0x6822('0x8')](_0x6822('0xb'),auth['isAuthenticated'](),controller[_0x6822('0xc')]);router[_0x6822('0x8')](_0x6822('0xd'),auth['isAuthenticated'](),controller[_0x6822('0xe')]);router[_0x6822('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6822('0x10')]('/:id',auth[_0x6822('0x9')](),controller['update']);router[_0x6822('0x11')](_0x6822('0xd'),auth['isAuthenticated'](),controller[_0x6822('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5916d76..5205a71 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 _0x8ae0=['STRING','sequelize','exports'];(function(_0x2b7e66,_0x4e7b3d){var _0x1c49e6=function(_0x391e6f){while(--_0x391e6f){_0x2b7e66['push'](_0x2b7e66['shift']());}};_0x1c49e6(++_0x4e7b3d);}(_0x8ae0,0x115));var _0x08ae=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8ae0[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x08ae('0x0'));module[_0x08ae('0x1')]={'uniqueid':{'type':Sequelize[_0x08ae('0x2')]},'node':{'type':Sequelize[_0x08ae('0x2')]},'application':{'type':Sequelize[_0x08ae('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x08ae('0x2')]},'callerid':{'type':Sequelize[_0x08ae('0x2')]}}; \ No newline at end of file +var _0x2ce5=['STRING','exports'];(function(_0x5b8bd4,_0x47fd25){var _0x17ece5=function(_0x4f1d3b){while(--_0x4f1d3b){_0x5b8bd4['push'](_0x5b8bd4['shift']());}};_0x17ece5(++_0x47fd25);}(_0x2ce5,0x1c3));var _0x52ce=function(_0x58c8c0,_0x2e87c5){_0x58c8c0=_0x58c8c0-0x0;var _0x15dc3b=_0x2ce5[_0x58c8c0];return _0x15dc3b;};'use strict';var Sequelize=require('sequelize');module[_0x52ce('0x0')]={'uniqueid':{'type':Sequelize[_0x52ce('0x1')]},'node':{'type':Sequelize[_0x52ce('0x1')]},'application':{'type':Sequelize[_0x52ce('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x52ce('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9f7d25a..2dd42b6 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 _0xe2fc=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','intersection','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','attributes'];(function(_0xd67c47,_0x573be0){var _0x4030d5=function(_0x579b38){while(--_0x579b38){_0xd67c47['push'](_0xd67c47['shift']());}};_0x4030d5(++_0x573be0);}(_0xe2fc,0x1ce));var _0xce2f=function(_0x234e86,_0x349928){_0x234e86=_0x234e86-0x0;var _0x4f9891=_0xe2fc[_0x234e86];return _0x4f9891;};'use strict';var emlformat=require(_0xce2f('0x0'));var rimraf=require(_0xce2f('0x1'));var zipdir=require(_0xce2f('0x2'));var jsonpatch=require(_0xce2f('0x3'));var rp=require('request-promise');var moment=require(_0xce2f('0x4'));var BPromise=require(_0xce2f('0x5'));var Mustache=require('mustache');var util=require(_0xce2f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xce2f('0x7'));var ejs=require(_0xce2f('0x8'));var fs=require('fs');var fs_extra=require(_0xce2f('0x9'));var _=require(_0xce2f('0xa'));var squel=require('squel');var crypto=require(_0xce2f('0xb'));var jsforce=require(_0xce2f('0xc'));var deskjs=require(_0xce2f('0xd'));var toCsv=require(_0xce2f('0x7'));var querystring=require('querystring');var Papa=require(_0xce2f('0xe'));var Redis=require('ioredis');var authService=require(_0xce2f('0xf'));var qs=require(_0xce2f('0x10'));var as=require(_0xce2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce2f('0x12'))(_0xce2f('0x13'));var utils=require('../../config/utils');var config=require(_0xce2f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c3c20,_0x2f5793){_0x2f5793=_0x2f5793||0xcc;return function(_0x3a379b){if(_0x3a379b){return _0x5c3c20[_0xce2f('0x15')](_0x2f5793);}return _0x5c3c20[_0xce2f('0x16')](_0x2f5793)[_0xce2f('0x17')]();};}function respondWithResult(_0x2b3d61,_0x31faa2){_0x31faa2=_0x31faa2||0xc8;return function(_0x138cbb){if(_0x138cbb){return _0x2b3d61['status'](_0x31faa2)[_0xce2f('0x18')](_0x138cbb);}};}function respondWithFilteredResult(_0x53c4c2,_0x4e6d25){return function(_0x10dd13){if(_0x10dd13){var _0xc12027=typeof _0x4e6d25[_0xce2f('0x19')]===_0xce2f('0x1a')&&typeof _0x4e6d25[_0xce2f('0x1b')]==='undefined';var _0x6a9fe6=_0x10dd13['count'];var _0x2ae29b=_0xc12027?0x0:_0x4e6d25[_0xce2f('0x19')];var _0x229be4=_0xc12027?_0x10dd13['count']:_0x4e6d25[_0xce2f('0x19')]+_0x4e6d25['limit'];var _0x3116f6;if(_0x229be4>=_0x6a9fe6){_0x229be4=_0x6a9fe6;_0x3116f6=0xc8;}else{_0x3116f6=0xce;}_0x53c4c2[_0xce2f('0x16')](_0x3116f6);return _0x53c4c2[_0xce2f('0x1c')](_0xce2f('0x1d'),_0x2ae29b+'-'+_0x229be4+'/'+_0x6a9fe6)['json'](_0x10dd13);}return null;};}function patchUpdates(_0x4426dd){return function(_0x2cd213){try{jsonpatch[_0xce2f('0x1e')](_0x2cd213,_0x4426dd,!![]);}catch(_0x228a6f){return BPromise[_0xce2f('0x1f')](_0x228a6f);}return _0x2cd213[_0xce2f('0x20')]();};}function saveUpdates(_0x251e7c,_0x1d5dab){return function(_0xe9a085){if(_0xe9a085){return _0xe9a085[_0xce2f('0x21')](_0x251e7c)['then'](function(_0x4bffc3){return _0x4bffc3;});}return null;};}function removeEntity(_0x3c7573,_0x292892){return function(_0x109106){if(_0x109106){return _0x109106[_0xce2f('0x22')]()[_0xce2f('0x23')](function(){_0x3c7573['status'](0xcc)[_0xce2f('0x17')]();});}};}function handleEntityNotFound(_0x539947,_0x5f27d2){return function(_0x132e5f){if(!_0x132e5f){_0x539947[_0xce2f('0x15')](0x194);}return _0x132e5f;};}function handleError(_0x4f4a61,_0x44684b){_0x44684b=_0x44684b||0x1f4;return function(_0x42c7a8){logger[_0xce2f('0x24')](_0x42c7a8[_0xce2f('0x25')]);if(_0x42c7a8[_0xce2f('0x26')]){delete _0x42c7a8[_0xce2f('0x26')];}_0x4f4a61[_0xce2f('0x16')](_0x44684b)['send'](_0x42c7a8);};}exports[_0xce2f('0x27')]=function(_0x13e309,_0x10a6dc){var _0x3c9339={},_0x3ae862={},_0x1d6c11={'count':0x0,'rows':[]};var _0xbd6f87=_[_0xce2f('0x28')](db[_0xce2f('0x29')][_0xce2f('0x2a')],function(_0x4a2764){return{'name':_0x4a2764['fieldName'],'type':_0x4a2764[_0xce2f('0x2b')]['key']};});_0x3ae862[_0xce2f('0x2c')]=_[_0xce2f('0x28')](_0xbd6f87,_0xce2f('0x26'));_0x3ae862[_0xce2f('0x2d')]=_[_0xce2f('0x2e')](_0x13e309[_0xce2f('0x2d')]);_0x3ae862[_0xce2f('0x2f')]=_['intersection'](_0x3ae862[_0xce2f('0x2c')],_0x3ae862[_0xce2f('0x2d')]);_0x3c9339[_0xce2f('0x30')]=_['intersection'](_0x3ae862['model'],qs[_0xce2f('0x31')](_0x13e309['query'][_0xce2f('0x31')]));_0x3c9339[_0xce2f('0x30')]=_0x3c9339['attributes'][_0xce2f('0x32')]?_0x3c9339['attributes']:_0x3ae862[_0xce2f('0x2c')];if(!_0x13e309[_0xce2f('0x2d')][_0xce2f('0x33')](_0xce2f('0x34'))){_0x3c9339[_0xce2f('0x1b')]=qs['limit'](_0x13e309[_0xce2f('0x2d')][_0xce2f('0x1b')]);_0x3c9339[_0xce2f('0x19')]=qs[_0xce2f('0x19')](_0x13e309[_0xce2f('0x2d')][_0xce2f('0x19')]);}_0x3c9339[_0xce2f('0x35')]=qs['sort'](_0x13e309[_0xce2f('0x2d')][_0xce2f('0x36')]);_0x3c9339[_0xce2f('0x37')]=qs[_0xce2f('0x2f')](_[_0xce2f('0x38')](_0x13e309[_0xce2f('0x2d')],_0x3ae862[_0xce2f('0x2f')]),_0xbd6f87);if(_0x13e309[_0xce2f('0x2d')][_0xce2f('0x39')]){_0x3c9339['where']=_[_0xce2f('0x3a')](_0x3c9339[_0xce2f('0x37')],{'$or':_['map'](_0xbd6f87,function(_0x356b06){if(_0x356b06[_0xce2f('0x2b')]!==_0xce2f('0x3b')){var _0x4b02c8={};_0x4b02c8[_0x356b06[_0xce2f('0x26')]]={'$like':'%'+_0x13e309[_0xce2f('0x2d')][_0xce2f('0x39')]+'%'};return _0x4b02c8;}})});}_0x3c9339=_['merge']({},_0x3c9339,_0x13e309[_0xce2f('0x3c')]);var _0x2f2651={'where':_0x3c9339[_0xce2f('0x37')]};return db[_0xce2f('0x29')][_0xce2f('0x3d')](_0x2f2651)[_0xce2f('0x23')](function(_0x219e25){_0x1d6c11['count']=_0x219e25;if(_0x13e309[_0xce2f('0x2d')][_0xce2f('0x3e')]){_0x3c9339['include']=[{'all':!![]}];}return db[_0xce2f('0x29')][_0xce2f('0x3f')](_0x3c9339);})[_0xce2f('0x23')](function(_0x59e55a){_0x1d6c11[_0xce2f('0x40')]=_0x59e55a;return _0x1d6c11;})['then'](respondWithFilteredResult(_0x10a6dc,_0x3c9339))[_0xce2f('0x41')](handleError(_0x10a6dc,null));};exports[_0xce2f('0x42')]=function(_0x149043,_0x635afc){var _0x198f4a={'raw':!![],'where':{'id':_0x149043[_0xce2f('0x43')]['id']}},_0x4f5ca8={};_0x4f5ca8[_0xce2f('0x2c')]=_[_0xce2f('0x2e')](db[_0xce2f('0x29')][_0xce2f('0x2a')]);_0x4f5ca8[_0xce2f('0x2d')]=_['keys'](_0x149043['query']);_0x4f5ca8[_0xce2f('0x2f')]=_[_0xce2f('0x44')](_0x4f5ca8['model'],_0x4f5ca8[_0xce2f('0x2d')]);_0x198f4a[_0xce2f('0x30')]=_[_0xce2f('0x44')](_0x4f5ca8[_0xce2f('0x2c')],qs[_0xce2f('0x31')](_0x149043[_0xce2f('0x2d')]['fields']));_0x198f4a[_0xce2f('0x30')]=_0x198f4a[_0xce2f('0x30')][_0xce2f('0x32')]?_0x198f4a[_0xce2f('0x30')]:_0x4f5ca8[_0xce2f('0x2c')];if(_0x149043[_0xce2f('0x2d')]['includeAll']){_0x198f4a[_0xce2f('0x45')]=[{'all':!![]}];}_0x198f4a=_[_0xce2f('0x3a')]({},_0x198f4a,_0x149043[_0xce2f('0x3c')]);return db[_0xce2f('0x29')][_0xce2f('0x46')](_0x198f4a)['then'](handleEntityNotFound(_0x635afc,null))[_0xce2f('0x23')](respondWithResult(_0x635afc,null))[_0xce2f('0x41')](handleError(_0x635afc,null));};exports['create']=function(_0x152241,_0x6c9a6e){return db[_0xce2f('0x29')]['create'](_0x152241[_0xce2f('0x47')],{})[_0xce2f('0x23')](respondWithResult(_0x6c9a6e,0xc9))[_0xce2f('0x41')](handleError(_0x6c9a6e,null));};exports[_0xce2f('0x21')]=function(_0x2bd21f,_0x6edb91){if(_0x2bd21f[_0xce2f('0x47')]['id']){delete _0x2bd21f[_0xce2f('0x47')]['id'];}return db[_0xce2f('0x29')][_0xce2f('0x46')]({'where':{'id':_0x2bd21f[_0xce2f('0x43')]['id']}})[_0xce2f('0x23')](handleEntityNotFound(_0x6edb91,null))['then'](saveUpdates(_0x2bd21f['body'],null))['then'](respondWithResult(_0x6edb91,null))[_0xce2f('0x41')](handleError(_0x6edb91,null));};exports[_0xce2f('0x22')]=function(_0x1d37f7,_0x422376){return db[_0xce2f('0x29')]['find']({'where':{'id':_0x1d37f7[_0xce2f('0x43')]['id']}})[_0xce2f('0x23')](handleEntityNotFound(_0x422376,null))['then'](removeEntity(_0x422376,null))[_0xce2f('0x41')](handleError(_0x422376,null));};exports[_0xce2f('0x48')]=function(_0x1fcfe4,_0x27c283){return db['SquareDetailsReport'][_0xce2f('0x48')]()[_0xce2f('0x23')](respondWithResult(_0x27c283,null))[_0xce2f('0x41')](handleError(_0x27c283,null));}; \ No newline at end of file +var _0x90d1=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','show','params','keys','includeAll','options','create','body','find','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xf42145,_0x5384d1){var _0x5e716d=function(_0x3ce58b){while(--_0x3ce58b){_0xf42145['push'](_0xf42145['shift']());}};_0x5e716d(++_0x5384d1);}(_0x90d1,0x121));var _0x190d=function(_0x9e9ead,_0x1a7ff3){_0x9e9ead=_0x9e9ead-0x0;var _0x31ff57=_0x90d1[_0x9e9ead];return _0x31ff57;};'use strict';var emlformat=require(_0x190d('0x0'));var rimraf=require(_0x190d('0x1'));var zipdir=require(_0x190d('0x2'));var jsonpatch=require(_0x190d('0x3'));var rp=require('request-promise');var moment=require(_0x190d('0x4'));var BPromise=require(_0x190d('0x5'));var Mustache=require(_0x190d('0x6'));var util=require(_0x190d('0x7'));var path=require(_0x190d('0x8'));var sox=require(_0x190d('0x9'));var csv=require(_0x190d('0xa'));var ejs=require(_0x190d('0xb'));var fs=require('fs');var fs_extra=require(_0x190d('0xc'));var _=require(_0x190d('0xd'));var squel=require(_0x190d('0xe'));var crypto=require(_0x190d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x190d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x190d('0x11'));var Papa=require(_0x190d('0x12'));var Redis=require(_0x190d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x190d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x190d('0x15'))(_0x190d('0x16'));var utils=require(_0x190d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab228,_0x58719e){_0x58719e=_0x58719e||0xcc;return function(_0x5132fb){if(_0x5132fb){return _0x5ab228[_0x190d('0x18')](_0x58719e);}return _0x5ab228['status'](_0x58719e)[_0x190d('0x19')]();};}function respondWithResult(_0x343bf5,_0x55e769){_0x55e769=_0x55e769||0xc8;return function(_0x542546){if(_0x542546){return _0x343bf5[_0x190d('0x1a')](_0x55e769)[_0x190d('0x1b')](_0x542546);}};}function respondWithFilteredResult(_0xe2be0d,_0x471f31){return function(_0x3936bc){if(_0x3936bc){var _0x3cb7bb=typeof _0x471f31[_0x190d('0x1c')]===_0x190d('0x1d')&&typeof _0x471f31[_0x190d('0x1e')]===_0x190d('0x1d');var _0xbedca=_0x3936bc[_0x190d('0x1f')];var _0x49b3db=_0x3cb7bb?0x0:_0x471f31['offset'];var _0xae46f9=_0x3cb7bb?_0x3936bc['count']:_0x471f31['offset']+_0x471f31[_0x190d('0x1e')];var _0x2242fc;if(_0xae46f9>=_0xbedca){_0xae46f9=_0xbedca;_0x2242fc=0xc8;}else{_0x2242fc=0xce;}_0xe2be0d['status'](_0x2242fc);return _0xe2be0d['set'](_0x190d('0x20'),_0x49b3db+'-'+_0xae46f9+'/'+_0xbedca)['json'](_0x3936bc);}return null;};}function patchUpdates(_0x44751d){return function(_0x65537a){try{jsonpatch[_0x190d('0x21')](_0x65537a,_0x44751d,!![]);}catch(_0x55f203){return BPromise['reject'](_0x55f203);}return _0x65537a[_0x190d('0x22')]();};}function saveUpdates(_0xa26548,_0x1433f1){return function(_0x468bab){if(_0x468bab){return _0x468bab[_0x190d('0x23')](_0xa26548)['then'](function(_0x52646c){return _0x52646c;});}return null;};}function removeEntity(_0xe85145,_0x4d3b52){return function(_0x70680b){if(_0x70680b){return _0x70680b[_0x190d('0x24')]()[_0x190d('0x25')](function(){_0xe85145[_0x190d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5277e1,_0x5d0183){return function(_0x12c77e){if(!_0x12c77e){_0x5277e1['sendStatus'](0x194);}return _0x12c77e;};}function handleError(_0xf279af,_0x2ffe7c){_0x2ffe7c=_0x2ffe7c||0x1f4;return function(_0x3dfcc2){logger[_0x190d('0x26')](_0x3dfcc2['stack']);if(_0x3dfcc2['name']){delete _0x3dfcc2[_0x190d('0x27')];}_0xf279af[_0x190d('0x1a')](_0x2ffe7c)[_0x190d('0x28')](_0x3dfcc2);};}exports[_0x190d('0x29')]=function(_0x3bb40b,_0x5966f2){var _0x42673f={},_0x41ef1f={},_0x560be9={'count':0x0,'rows':[]};var _0x5c2e07=_['map'](db[_0x190d('0x2a')][_0x190d('0x2b')],function(_0x24a444){return{'name':_0x24a444[_0x190d('0x2c')],'type':_0x24a444[_0x190d('0x2d')][_0x190d('0x2e')]};});_0x41ef1f[_0x190d('0x2f')]=_[_0x190d('0x30')](_0x5c2e07,'name');_0x41ef1f[_0x190d('0x31')]=_['keys'](_0x3bb40b['query']);_0x41ef1f[_0x190d('0x32')]=_['intersection'](_0x41ef1f[_0x190d('0x2f')],_0x41ef1f[_0x190d('0x31')]);_0x42673f[_0x190d('0x33')]=_[_0x190d('0x34')](_0x41ef1f[_0x190d('0x2f')],qs[_0x190d('0x35')](_0x3bb40b['query'][_0x190d('0x35')]));_0x42673f[_0x190d('0x33')]=_0x42673f[_0x190d('0x33')][_0x190d('0x36')]?_0x42673f[_0x190d('0x33')]:_0x41ef1f[_0x190d('0x2f')];if(!_0x3bb40b['query'][_0x190d('0x37')](_0x190d('0x38'))){_0x42673f[_0x190d('0x1e')]=qs['limit'](_0x3bb40b[_0x190d('0x31')]['limit']);_0x42673f['offset']=qs['offset'](_0x3bb40b[_0x190d('0x31')]['offset']);}_0x42673f['order']=qs[_0x190d('0x39')](_0x3bb40b['query'][_0x190d('0x39')]);_0x42673f[_0x190d('0x3a')]=qs['filters'](_[_0x190d('0x3b')](_0x3bb40b[_0x190d('0x31')],_0x41ef1f[_0x190d('0x32')]),_0x5c2e07);if(_0x3bb40b['query'][_0x190d('0x3c')]){_0x42673f[_0x190d('0x3a')]=_[_0x190d('0x3d')](_0x42673f['where'],{'$or':_[_0x190d('0x30')](_0x5c2e07,function(_0x529c5f){if(_0x529c5f['type']!=='VIRTUAL'){var _0xfdf7af={};_0xfdf7af[_0x529c5f[_0x190d('0x27')]]={'$like':'%'+_0x3bb40b[_0x190d('0x31')][_0x190d('0x3c')]+'%'};return _0xfdf7af;}})});}_0x42673f=_[_0x190d('0x3d')]({},_0x42673f,_0x3bb40b['options']);var _0x43fd54={'where':_0x42673f['where']};return db['SquareDetailsReport'][_0x190d('0x1f')](_0x43fd54)['then'](function(_0x26d3e0){_0x560be9[_0x190d('0x1f')]=_0x26d3e0;if(_0x3bb40b[_0x190d('0x31')]['includeAll']){_0x42673f[_0x190d('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x190d('0x3f')](_0x42673f);})[_0x190d('0x25')](function(_0x2c4e0d){_0x560be9[_0x190d('0x40')]=_0x2c4e0d;return _0x560be9;})[_0x190d('0x25')](respondWithFilteredResult(_0x5966f2,_0x42673f))['catch'](handleError(_0x5966f2,null));};exports[_0x190d('0x41')]=function(_0x583330,_0x22e282){var _0xdb1f5c={'raw':!![],'where':{'id':_0x583330[_0x190d('0x42')]['id']}},_0x3c4b44={};_0x3c4b44[_0x190d('0x2f')]=_[_0x190d('0x43')](db[_0x190d('0x2a')][_0x190d('0x2b')]);_0x3c4b44[_0x190d('0x31')]=_[_0x190d('0x43')](_0x583330[_0x190d('0x31')]);_0x3c4b44[_0x190d('0x32')]=_['intersection'](_0x3c4b44[_0x190d('0x2f')],_0x3c4b44[_0x190d('0x31')]);_0xdb1f5c['attributes']=_['intersection'](_0x3c4b44[_0x190d('0x2f')],qs[_0x190d('0x35')](_0x583330[_0x190d('0x31')][_0x190d('0x35')]));_0xdb1f5c[_0x190d('0x33')]=_0xdb1f5c['attributes'][_0x190d('0x36')]?_0xdb1f5c[_0x190d('0x33')]:_0x3c4b44[_0x190d('0x2f')];if(_0x583330[_0x190d('0x31')][_0x190d('0x44')]){_0xdb1f5c[_0x190d('0x3e')]=[{'all':!![]}];}_0xdb1f5c=_['merge']({},_0xdb1f5c,_0x583330[_0x190d('0x45')]);return db[_0x190d('0x2a')]['find'](_0xdb1f5c)['then'](handleEntityNotFound(_0x22e282,null))[_0x190d('0x25')](respondWithResult(_0x22e282,null))['catch'](handleError(_0x22e282,null));};exports['create']=function(_0x20935f,_0x38078f){return db[_0x190d('0x2a')][_0x190d('0x46')](_0x20935f['body'],{})[_0x190d('0x25')](respondWithResult(_0x38078f,0xc9))['catch'](handleError(_0x38078f,null));};exports['update']=function(_0x1a799b,_0x38c2db){if(_0x1a799b[_0x190d('0x47')]['id']){delete _0x1a799b['body']['id'];}return db['SquareDetailsReport'][_0x190d('0x48')]({'where':{'id':_0x1a799b[_0x190d('0x42')]['id']}})[_0x190d('0x25')](handleEntityNotFound(_0x38c2db,null))[_0x190d('0x25')](saveUpdates(_0x1a799b[_0x190d('0x47')],null))[_0x190d('0x25')](respondWithResult(_0x38c2db,null))['catch'](handleError(_0x38c2db,null));};exports['destroy']=function(_0x47e601,_0x3bb06b){return db[_0x190d('0x2a')][_0x190d('0x48')]({'where':{'id':_0x47e601[_0x190d('0x42')]['id']}})[_0x190d('0x25')](handleEntityNotFound(_0x3bb06b,null))[_0x190d('0x25')](removeEntity(_0x3bb06b,null))[_0x190d('0x49')](handleError(_0x3bb06b,null));};exports[_0x190d('0x4a')]=function(_0x266283,_0x41ff4c){return db[_0x190d('0x2a')][_0x190d('0x4a')]()[_0x190d('0x25')](respondWithResult(_0x41ff4c,null))['catch'](handleError(_0x41ff4c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c808f94..aa8b578 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 _0x32f9=['rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xa3694b,_0x5e536c){var _0x32f337=function(_0x415698){while(--_0x415698){_0xa3694b['push'](_0xa3694b['shift']());}};_0x32f337(++_0x5e536c);}(_0x32f9,0x15a));var _0x932f=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x32f9[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x932f('0x0'));var util=require(_0x932f('0x1'));var logger=require(_0x932f('0x2'))('api');var moment=require(_0x932f('0x3'));var BPromise=require(_0x932f('0x4'));var rp=require(_0x932f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x932f('0x6'));var config=require('../../config/environment');var attributes=require(_0x932f('0x7'));module[_0x932f('0x8')]=function(_0x57ebd0,_0x137384){return _0x57ebd0[_0x932f('0x9')](_0x932f('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c94=['./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x38be71,_0x28b382){var _0x544d60=function(_0x3ad831){while(--_0x3ad831){_0x38be71['push'](_0x38be71['shift']());}};_0x544d60(++_0x28b382);}(_0x4c94,0xf6));var _0x44c9=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x4c94[_0x2fc012];return _0x2891f9;};'use strict';var _=require('lodash');var util=require(_0x44c9('0x0'));var logger=require('../../config/logger')(_0x44c9('0x1'));var moment=require(_0x44c9('0x2'));var BPromise=require(_0x44c9('0x3'));var rp=require(_0x44c9('0x4'));var fs=require('fs');var path=require(_0x44c9('0x5'));var rimraf=require('rimraf');var config=require(_0x44c9('0x6'));var attributes=require(_0x44c9('0x7'));module[_0x44c9('0x8')]=function(_0x27f63e,_0x495a50){return _0x27f63e['define'](_0x44c9('0x9'),attributes,{'tableName':_0x44c9('0xa'),'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 e6fb324..8594601 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 _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash'];(function(_0x106840,_0x4ace2c){var _0x428086=function(_0x34b144){while(--_0x34b144){_0x106840['push'](_0x106840['shift']());}};_0x428086(++_0x4ace2c);}(_0x5204,0xdf));var _0x4520=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x5204[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateSquareDetailsReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});}; \ No newline at end of file +var _0x7e27=['create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0x7e27,0xdd));var _0x77e2=function(_0x4c721d,_0x1d820a){_0x4c721d=_0x4c721d-0x0;var _0x287f03=_0x7e27[_0x4c721d];return _0x287f03;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101e56,_0x137a61,_0x502153){return new BPromise(function(_0x3c2b3f,_0x2cdfa3){return client[_0x77e2('0xa')](_0x101e56,_0x502153)[_0x77e2('0xb')](function(_0x3802ce){logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');logger['debug'](_0x77e2('0xe'),_0x137a61,'request\x20sent',JSON[_0x77e2('0xf')](_0x3802ce));if(_0x3802ce[_0x77e2('0x10')]){if(_0x3802ce['error']['code']===0x1f4){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce['error'][_0x77e2('0x11')]);return _0x2cdfa3(_0x3802ce['error']['message']);}logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce[_0x77e2('0x10')][_0x77e2('0x11')]);return _0x3c2b3f(_0x3802ce[_0x77e2('0x10')]['message']);}else{logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');_0x3c2b3f(_0x3802ce[_0x77e2('0x12')][_0x77e2('0x11')]);}})[_0x77e2('0x13')](function(_0x1352c1){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x1352c1);_0x2cdfa3(_0x1352c1);});});}exports[_0x77e2('0x14')]=function(_0x36b995){var _0x42459a=this;return new Promise(function(_0x1bcf8d,_0x47ae9a){return db[_0x77e2('0x15')][_0x77e2('0x16')](_0x36b995[_0x77e2('0x17')],{'raw':_0x36b995[_0x77e2('0x18')]?_0x36b995[_0x77e2('0x18')][_0x77e2('0x19')]===undefined?!![]:![]:!![]})[_0x77e2('0xb')](function(_0x1e5273){logger[_0x77e2('0xc')](_0x77e2('0x14'),_0x36b995);logger[_0x77e2('0x1a')]('CreateSquareDetailsReport',_0x36b995,JSON[_0x77e2('0xf')](_0x1e5273));_0x1bcf8d(_0x1e5273);})[_0x77e2('0x13')](function(_0x4c0d0a){logger[_0x77e2('0x10')]('CreateSquareDetailsReport',_0x4c0d0a['message'],_0x36b995);_0x47ae9a(_0x42459a[_0x77e2('0x10')](0x1f4,_0x4c0d0a['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c3261d9..49f701e 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 _0xe221=['exports','../../components/auth/service','isAuthenticated','index','get'];(function(_0x31c7d8,_0x10762b){var _0x36c7ab=function(_0x3d3191){while(--_0x3d3191){_0x31c7d8['push'](_0x31c7d8['shift']());}};_0x36c7ab(++_0x10762b);}(_0xe221,0x173));var _0x1e22=function(_0x2d320a,_0x525a16){_0x2d320a=_0x2d320a-0x0;var _0x3b73a3=_0xe221[_0x2d320a];return _0x3b73a3;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1e22('0x0'));var controller=require('./system.controller');router['get']('/',auth[_0x1e22('0x1')](),controller[_0x1e22('0x2')]);router[_0x1e22('0x3')]('/process/:pid/kill',auth[_0x1e22('0x1')](),controller['killProcess']);module[_0x1e22('0x4')]=router; \ No newline at end of file +var _0xf7cb=['isAuthenticated','index','get','/process/:pid/kill','express','Router'];(function(_0x4b1434,_0x1fa900){var _0x9870da=function(_0x1e9432){while(--_0x1e9432){_0x4b1434['push'](_0x4b1434['shift']());}};_0x9870da(++_0x1fa900);}(_0xf7cb,0x1d2));var _0xbf7c=function(_0x3ec723,_0x1a30b3){_0x3ec723=_0x3ec723-0x0;var _0x1c5c8e=_0xf7cb[_0x3ec723];return _0x1c5c8e;};'use strict';var express=require(_0xbf7c('0x0'));var router=express[_0xbf7c('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0xbf7c('0x2')](),controller[_0xbf7c('0x3')]);router[_0xbf7c('0x4')](_0xbf7c('0x5'),auth[_0xbf7c('0x2')](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a4901a9..0453068 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 _0x5e87=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','systeminformation','exec','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split'];(function(_0x209e33,_0x377d9d){var _0x584b89=function(_0x2cd439){while(--_0x2cd439){_0x209e33['push'](_0x209e33['shift']());}};_0x584b89(++_0x377d9d);}(_0x5e87,0x119));var _0x75e8=function(_0xfb3127,_0x5380f0){_0xfb3127=_0xfb3127-0x0;var _0x6f5fad=_0x5e87[_0xfb3127];return _0x6f5fad;};'use strict';var info=require(_0x75e8('0x0'));var exec=require('child_process')[_0x75e8('0x1')];var logger=require('../../config/logger')('api');var util=require(_0x75e8('0x2'));var BPromise=require(_0x75e8('0x3'));var _=require(_0x75e8('0x4'));function handleError(_0x2dd5b8,_0x55601b,_0x3b9fb9){_0x55601b=_0x55601b||0x1f4;return function(_0x1f044d){logger['error'](_0x75e8('0x5'),_0x3b9fb9,_0x55601b,util[_0x75e8('0x6')](_0x1f044d,{'showHidden':![],'depth':null}));delete _0x1f044d['name'];_0x2dd5b8['status'](_0x55601b)[_0x75e8('0x7')](_0x1f044d);};}exports['index']=function(_0x433237,_0x93b000){return info['getAllData']()[_0x75e8('0x8')](function(_0x1db3c0){return _0x93b000[_0x75e8('0x9')](0xc8)[_0x75e8('0xa')](_0x1db3c0);})[_0x75e8('0xb')](function(_0x57f084){return _0x93b000[_0x75e8('0x9')](0x1f4)[_0x75e8('0xa')](_0x57f084);});};exports[_0x75e8('0xc')]=function(_0x31956b,_0x4fcae3){var _0x52a510=[_0x75e8('0xd')];return new BPromise(function(_0x7d3698,_0x567cad){return exec(util[_0x75e8('0xe')](_0x75e8('0xf'),_0x31956b['params'][_0x75e8('0x10')]),function(_0x1112db,_0x9a87,_0x12327b){if(_0x1112db){return _0x567cad(_0x1112db);}return _0x7d3698(_0x9a87);});})['then'](function(_0x19df3c){var _0x3f01d9=![];var _0x2dd973=_0x19df3c[_0x75e8('0x11')](/\n/);for(var _0x1c3a05=0x0,_0x161a82=_0x52a510[_0x75e8('0x12')];_0x1c3a05<_0x161a82,_0x3f01d9===![];_0x1c3a05+=0x1){if(_0x19df3c[_0x75e8('0x13')](_0x52a510[_0x1c3a05])>=0x0){_0x3f01d9=!![];}}if(!_0x3f01d9){throw new Error(util['format'](_0x75e8('0x14'),_0x31956b[_0x75e8('0x15')][_0x75e8('0x10')]));}process[_0x75e8('0x16')](_0x31956b['params'][_0x75e8('0x10')],'SIGINT');return _0x4fcae3[_0x75e8('0x9')](0xc8)[_0x75e8('0xa')]({'message':util[_0x75e8('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x31956b[_0x75e8('0x15')][_0x75e8('0x10')])});})[_0x75e8('0xb')](handleError(_0x4fcae3,null,_0x75e8('0xc')));}; \ No newline at end of file +var _0x6ad7=['send','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x260985,_0x29a341){var _0x1e2648=function(_0x48785e){while(--_0x48785e){_0x260985['push'](_0x260985['shift']());}};_0x1e2648(++_0x29a341);}(_0x6ad7,0x115));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0x76ad('0x0'));var exec=require(_0x76ad('0x1'))[_0x76ad('0x2')];var logger=require(_0x76ad('0x3'))(_0x76ad('0x4'));var util=require(_0x76ad('0x5'));var BPromise=require(_0x76ad('0x6'));var _=require(_0x76ad('0x7'));function handleError(_0x1799bb,_0x5a0658,_0x4bb8e5){_0x5a0658=_0x5a0658||0x1f4;return function(_0x93beb0){logger[_0x76ad('0x8')](_0x76ad('0x9'),_0x4bb8e5,_0x5a0658,util[_0x76ad('0xa')](_0x93beb0,{'showHidden':![],'depth':null}));delete _0x93beb0[_0x76ad('0xb')];_0x1799bb[_0x76ad('0xc')](_0x5a0658)[_0x76ad('0xd')](_0x93beb0);};}exports[_0x76ad('0xe')]=function(_0x1e5acd,_0x5e738e){return info[_0x76ad('0xf')]()[_0x76ad('0x10')](function(_0x304ec6){return _0x5e738e[_0x76ad('0xc')](0xc8)['json'](_0x304ec6);})[_0x76ad('0x11')](function(_0x3e6940){return _0x5e738e['status'](0x1f4)['json'](_0x3e6940);});};exports[_0x76ad('0x12')]=function(_0xdfd20a,_0x4c6c94){var _0x1e3f24=[_0x76ad('0x13')];return new BPromise(function(_0xfabf86,_0x1965f8){return exec(util[_0x76ad('0x14')](_0x76ad('0x15'),_0xdfd20a[_0x76ad('0x16')][_0x76ad('0x17')]),function(_0x429b6c,_0xa2b847,_0xfc7a4a){if(_0x429b6c){return _0x1965f8(_0x429b6c);}return _0xfabf86(_0xa2b847);});})['then'](function(_0x3fc61c){var _0x5c4e66=![];var _0x4ee4b0=_0x3fc61c['split'](/\n/);for(var _0x8bff2f=0x0,_0x4cd922=_0x1e3f24[_0x76ad('0x18')];_0x8bff2f<_0x4cd922,_0x5c4e66===![];_0x8bff2f+=0x1){if(_0x3fc61c[_0x76ad('0x19')](_0x1e3f24[_0x8bff2f])>=0x0){_0x5c4e66=!![];}}if(!_0x5c4e66){throw new Error(util[_0x76ad('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xdfd20a['params']['pid']));}process[_0x76ad('0x1a')](_0xdfd20a[_0x76ad('0x16')][_0x76ad('0x17')],_0x76ad('0x1b'));return _0x4c6c94[_0x76ad('0xc')](0xc8)['json']({'message':util[_0x76ad('0x14')](_0x76ad('0x1c'),_0xdfd20a[_0x76ad('0x16')][_0x76ad('0x17')])});})[_0x76ad('0x11')](handleError(_0x4c6c94,null,_0x76ad('0x12')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 0fc90b5..ca18bb1 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 _0x9c90=['../../config/environment','./tag.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x198965,_0x1a4925){var _0x44673d=function(_0x228e0c){while(--_0x228e0c){_0x198965['push'](_0x198965['shift']());}};_0x44673d(++_0x1a4925);}(_0x9c90,0xd1));var _0x09c9=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0x9c90[_0x5db313];return _0x36d503;};'use strict';var multer=require('multer');var util=require(_0x09c9('0x0'));var path=require('path');var timeout=require(_0x09c9('0x1'));var express=require(_0x09c9('0x2'));var router=express[_0x09c9('0x3')]();var fs_extra=require(_0x09c9('0x4'));var auth=require(_0x09c9('0x5'));var interaction=require(_0x09c9('0x6'));var config=require(_0x09c9('0x7'));var controller=require(_0x09c9('0x8'));router[_0x09c9('0x9')]('/',auth[_0x09c9('0xa')](),controller[_0x09c9('0xb')]);router[_0x09c9('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x09c9('0xa')](),controller[_0x09c9('0xc')]);router[_0x09c9('0xd')](_0x09c9('0xe'),auth['isAuthenticated'](),controller[_0x09c9('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x09c9('0x10')]);module[_0x09c9('0x11')]=router; \ No newline at end of file +var _0xe9ab=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe9ab,0xc3));var _0xbe9a=function(_0x561ed5,_0x3405b0){_0x561ed5=_0x561ed5-0x0;var _0xd05846=_0xe9ab[_0x561ed5];return _0xd05846;};'use strict';var multer=require(_0xbe9a('0x0'));var util=require('util');var path=require(_0xbe9a('0x1'));var timeout=require(_0xbe9a('0x2'));var express=require(_0xbe9a('0x3'));var router=express[_0xbe9a('0x4')]();var fs_extra=require(_0xbe9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe9a('0x6'));var config=require(_0xbe9a('0x7'));var controller=require('./tag.controller');router[_0xbe9a('0x8')]('/',auth[_0xbe9a('0x9')](),controller[_0xbe9a('0xa')]);router[_0xbe9a('0x8')](_0xbe9a('0xb'),auth[_0xbe9a('0x9')](),controller[_0xbe9a('0xc')]);router[_0xbe9a('0xd')]('/',auth[_0xbe9a('0x9')](),controller['create']);router[_0xbe9a('0xe')](_0xbe9a('0xb'),auth[_0xbe9a('0x9')](),controller[_0xbe9a('0xf')]);router[_0xbe9a('0x10')](_0xbe9a('0xb'),auth[_0xbe9a('0x9')](),controller['destroy']);module[_0xbe9a('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6ccf0cb..ae5c68a 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 _0x689b=['#0091EA','sequelize','STRING'];(function(_0x3b70c9,_0x214dbd){var _0x18d99e=function(_0x2f953d){while(--_0x2f953d){_0x3b70c9['push'](_0x3b70c9['shift']());}};_0x18d99e(++_0x214dbd);}(_0x689b,0x142));var _0xb689=function(_0x48be25,_0x1b9e37){_0x48be25=_0x48be25-0x0;var _0x28c7c7=_0x689b[_0x48be25];return _0x28c7c7;};'use strict';var Sequelize=require(_0xb689('0x0'));module['exports']={'name':{'type':Sequelize[_0xb689('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xb689('0x2')},'description':{'type':Sequelize[_0xb689('0x1')]}}; \ No newline at end of file +var _0x0e0f=['#0091EA','sequelize','name','STRING'];(function(_0x385510,_0x4dbfc7){var _0x341be1=function(_0x3763ec){while(--_0x3763ec){_0x385510['push'](_0x385510['shift']());}};_0x341be1(++_0x4dbfc7);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x455c4c,_0x1e1c19){_0x455c4c=_0x455c4c-0x0;var _0x2b1a64=_0x0e0f[_0x455c4c];return _0x2b1a64;};'use strict';var Sequelize=require(_0xf0e0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf0e0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf0e0('0x2')],'defaultValue':_0xf0e0('0x3')},'description':{'type':Sequelize[_0xf0e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 84e3e6c..0c57b9c 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 _0x593e=['UserProfileResource','error','name','send','index','map','Tag','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','Tags'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x593e,0xcb));var _0xe593=function(_0x3e7c71,_0x48887a){_0x3e7c71=_0x3e7c71-0x0;var _0x5109e8=_0x593e[_0x3e7c71];return _0x5109e8;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];function respondWithStatusCode(_0x8ee313,_0x31dad0){_0x31dad0=_0x31dad0||0xcc;return function(_0x24c9fd){if(_0x24c9fd){return _0x8ee313[_0xe593('0x1c')](_0x31dad0);}return _0x8ee313[_0xe593('0x1d')](_0x31dad0)[_0xe593('0x1e')]();};}function respondWithResult(_0x499819,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1de391){if(_0x1de391){return _0x499819['status'](_0x2907e4)[_0xe593('0x1f')](_0x1de391);}};}function respondWithFilteredResult(_0x44837b,_0x5d4c6a){return function(_0x2ae9b6){if(_0x2ae9b6){var _0x40416c=typeof _0x5d4c6a[_0xe593('0x20')]===_0xe593('0x21')&&typeof _0x5d4c6a[_0xe593('0x22')]===_0xe593('0x21');var _0x48f3b4=_0x2ae9b6[_0xe593('0x23')];var _0x470d07=_0x40416c?0x0:_0x5d4c6a['offset'];var _0xd1020e=_0x40416c?_0x2ae9b6[_0xe593('0x23')]:_0x5d4c6a['offset']+_0x5d4c6a[_0xe593('0x22')];var _0x3dba1b;if(_0xd1020e>=_0x48f3b4){_0xd1020e=_0x48f3b4;_0x3dba1b=0xc8;}else{_0x3dba1b=0xce;}_0x44837b[_0xe593('0x1d')](_0x3dba1b);return _0x44837b[_0xe593('0x24')](_0xe593('0x25'),_0x470d07+'-'+_0xd1020e+'/'+_0x48f3b4)[_0xe593('0x1f')](_0x2ae9b6);}return null;};}function patchUpdates(_0x3d2a51){return function(_0x4ea53f){try{jsonpatch['apply'](_0x4ea53f,_0x3d2a51,!![]);}catch(_0x1634d4){return BPromise['reject'](_0x1634d4);}return _0x4ea53f['save']();};}function saveUpdates(_0x1bb8e8,_0x3c65b5){return function(_0x57379d){if(_0x57379d){return _0x57379d[_0xe593('0x26')](_0x1bb8e8)['then'](function(_0x1672bf){return _0x1672bf;});}return null;};}function removeEntity(_0x2c191f,_0x185cea){return function(_0x44d997){if(_0x44d997){return _0x44d997[_0xe593('0x27')]()[_0xe593('0x28')](function(){var _0x20a098=_0x44d997[_0xe593('0x29')]({'plain':!![]});var _0x4fc483=_0xe593('0x2a');return db[_0xe593('0x2b')]['destroy']({'where':{'type':_0x4fc483,'resourceId':_0x20a098['id']}})['then'](function(){return _0x44d997;});})[_0xe593('0x28')](function(){_0x2c191f[_0xe593('0x1d')](0xcc)[_0xe593('0x1e')]();});}};}function handleEntityNotFound(_0x43699d,_0x3b66bc){return function(_0x27a3d2){if(!_0x27a3d2){_0x43699d['sendStatus'](0x194);}return _0x27a3d2;};}function handleError(_0x350e2b,_0x54e5e2){_0x54e5e2=_0x54e5e2||0x1f4;return function(_0x1dacf6){logger[_0xe593('0x2c')](_0x1dacf6['stack']);if(_0x1dacf6[_0xe593('0x2d')]){delete _0x1dacf6['name'];}_0x350e2b[_0xe593('0x1d')](_0x54e5e2)[_0xe593('0x2e')](_0x1dacf6);};}exports[_0xe593('0x2f')]=function(_0x501e54,_0x1ae8d9){var _0x13f44={},_0x3066ed={},_0x338222={'count':0x0,'rows':[]};var _0x2588be=_[_0xe593('0x30')](db[_0xe593('0x31')]['rawAttributes'],function(_0x4098a9){return{'name':_0x4098a9[_0xe593('0x32')],'type':_0x4098a9['type'][_0xe593('0x33')]};});_0x3066ed['model']=_[_0xe593('0x30')](_0x2588be,_0xe593('0x2d'));_0x3066ed[_0xe593('0x34')]=_[_0xe593('0x35')](_0x501e54[_0xe593('0x34')]);_0x3066ed[_0xe593('0x36')]=_[_0xe593('0x37')](_0x3066ed[_0xe593('0x38')],_0x3066ed[_0xe593('0x34')]);_0x13f44[_0xe593('0x39')]=_['intersection'](_0x3066ed[_0xe593('0x38')],qs[_0xe593('0x3a')](_0x501e54[_0xe593('0x34')]['fields']));_0x13f44['attributes']=_0x13f44[_0xe593('0x39')]['length']?_0x13f44[_0xe593('0x39')]:_0x3066ed[_0xe593('0x38')];if(!_0x501e54[_0xe593('0x34')][_0xe593('0x3b')](_0xe593('0x3c'))){_0x13f44[_0xe593('0x22')]=qs[_0xe593('0x22')](_0x501e54['query']['limit']);_0x13f44[_0xe593('0x20')]=qs['offset'](_0x501e54[_0xe593('0x34')]['offset']);}_0x13f44[_0xe593('0x3d')]=qs['sort'](_0x501e54['query'][_0xe593('0x3e')]);_0x13f44[_0xe593('0x3f')]=qs[_0xe593('0x36')](_['pick'](_0x501e54['query'],_0x3066ed['filters']),_0x2588be);if(_0x501e54[_0xe593('0x34')]['filter']){_0x13f44[_0xe593('0x3f')]=_[_0xe593('0x40')](_0x13f44[_0xe593('0x3f')],{'$or':_[_0xe593('0x30')](_0x2588be,function(_0x50249e){if(_0x50249e[_0xe593('0x41')]!=='VIRTUAL'){var _0x36c08e={};_0x36c08e[_0x50249e['name']]={'$like':'%'+_0x501e54['query']['filter']+'%'};return _0x36c08e;}})});}_0x13f44=_[_0xe593('0x40')]({},_0x13f44,_0x501e54['options']);var _0x3addf0={'where':_0x13f44[_0xe593('0x3f')]};return db[_0xe593('0x31')]['count'](_0x3addf0)[_0xe593('0x28')](function(_0x3f9784){_0x338222[_0xe593('0x23')]=_0x3f9784;if(_0x501e54[_0xe593('0x34')][_0xe593('0x42')]){_0x13f44[_0xe593('0x43')]=[{'all':!![]}];}return db[_0xe593('0x31')][_0xe593('0x44')](_0x13f44);})['then'](function(_0x211065){_0x338222[_0xe593('0x45')]=_0x211065;return _0x338222;})[_0xe593('0x28')](respondWithFilteredResult(_0x1ae8d9,_0x13f44))[_0xe593('0x46')](handleError(_0x1ae8d9,null));};exports[_0xe593('0x47')]=function(_0x4d3018,_0x4a9a5f){var _0x3fd874={'raw':!![],'where':{'id':_0x4d3018[_0xe593('0x48')]['id']}},_0x380429={};_0x380429['model']=_[_0xe593('0x35')](db[_0xe593('0x31')]['rawAttributes']);_0x380429['query']=_[_0xe593('0x35')](_0x4d3018[_0xe593('0x34')]);_0x380429[_0xe593('0x36')]=_['intersection'](_0x380429[_0xe593('0x38')],_0x380429[_0xe593('0x34')]);_0x3fd874[_0xe593('0x39')]=_[_0xe593('0x37')](_0x380429['model'],qs['fields'](_0x4d3018['query']['fields']));_0x3fd874[_0xe593('0x39')]=_0x3fd874['attributes'][_0xe593('0x49')]?_0x3fd874[_0xe593('0x39')]:_0x380429[_0xe593('0x38')];if(_0x4d3018[_0xe593('0x34')][_0xe593('0x42')]){_0x3fd874[_0xe593('0x43')]=[{'all':!![]}];}_0x3fd874=_[_0xe593('0x40')]({},_0x3fd874,_0x4d3018[_0xe593('0x4a')]);return db['Tag'][_0xe593('0x4b')](_0x3fd874)[_0xe593('0x28')](handleEntityNotFound(_0x4a9a5f,null))[_0xe593('0x28')](respondWithResult(_0x4a9a5f,null))['catch'](handleError(_0x4a9a5f,null));};exports[_0xe593('0x4c')]=function(_0x5dfdb1,_0x39ec9e){return db[_0xe593('0x31')][_0xe593('0x4c')](_0x5dfdb1['body'],{})['then'](function(_0x7431a3){var _0x45beb1=_0x5dfdb1['user']['get']({'plain':!![]});if(!_0x45beb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45beb1['role']==='user'){var _0x383645=_0x7431a3[_0xe593('0x29')]({'plain':!![]});var _0x1ed8b5=_0xe593('0x2a');return db[_0xe593('0x4d')][_0xe593('0x4b')]({'where':{'name':_0x1ed8b5,'userProfileId':_0x45beb1[_0xe593('0x4e')]},'raw':!![]})[_0xe593('0x28')](function(_0x355ad8){if(_0x355ad8&&_0x355ad8[_0xe593('0x4f')]===0x0){return db[_0xe593('0x2b')][_0xe593('0x4c')]({'name':_0x383645[_0xe593('0x2d')],'resourceId':_0x383645['id'],'type':_0x355ad8[_0xe593('0x2d')],'sectionId':_0x355ad8['id']},{})[_0xe593('0x28')](function(){return _0x7431a3;});}else{return _0x7431a3;}})[_0xe593('0x46')](function(_0x5d60c3){logger[_0xe593('0x2c')](_0xe593('0x50'),_0x5d60c3);throw _0x5d60c3;});}return _0x7431a3;})[_0xe593('0x28')](respondWithResult(_0x39ec9e,0xc9))[_0xe593('0x46')](handleError(_0x39ec9e,null));};exports[_0xe593('0x26')]=function(_0x8130b2,_0x363643){if(_0x8130b2[_0xe593('0x51')]['id']){delete _0x8130b2[_0xe593('0x51')]['id'];}return db[_0xe593('0x31')][_0xe593('0x4b')]({'where':{'id':_0x8130b2[_0xe593('0x48')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x363643,null))[_0xe593('0x28')](saveUpdates(_0x8130b2[_0xe593('0x51')],null))['then'](respondWithResult(_0x363643,null))[_0xe593('0x46')](handleError(_0x363643,null));};exports[_0xe593('0x27')]=function(_0x142d0f,_0x24d061){return db[_0xe593('0x31')]['find']({'where':{'id':_0x142d0f['params']['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x24d061,null))[_0xe593('0x28')](removeEntity(_0x24d061,null))[_0xe593('0x46')](handleError(_0x24d061,null));}; \ No newline at end of file +var _0xb07f=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','Tag','findAll','rows','catch','show','params','keys','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb07f,0x109));var _0xfb07=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0xb07f[_0x187399];return _0x40fa92;};'use strict';var emlformat=require(_0xfb07('0x0'));var rimraf=require(_0xfb07('0x1'));var zipdir=require(_0xfb07('0x2'));var jsonpatch=require(_0xfb07('0x3'));var rp=require(_0xfb07('0x4'));var moment=require(_0xfb07('0x5'));var BPromise=require(_0xfb07('0x6'));var Mustache=require(_0xfb07('0x7'));var util=require(_0xfb07('0x8'));var path=require(_0xfb07('0x9'));var sox=require(_0xfb07('0xa'));var csv=require('to-csv');var ejs=require(_0xfb07('0xb'));var fs=require('fs');var fs_extra=require(_0xfb07('0xc'));var _=require(_0xfb07('0xd'));var squel=require(_0xfb07('0xe'));var crypto=require(_0xfb07('0xf'));var jsforce=require(_0xfb07('0x10'));var deskjs=require(_0xfb07('0x11'));var toCsv=require(_0xfb07('0x12'));var querystring=require(_0xfb07('0x13'));var Papa=require(_0xfb07('0x14'));var Redis=require(_0xfb07('0x15'));var authService=require(_0xfb07('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb07('0x17'))(_0xfb07('0x18'));var utils=require('../../config/utils');var config=require(_0xfb07('0x19'));var licenseUtil=require(_0xfb07('0x1a'));var db=require(_0xfb07('0x1b'))['db'];function respondWithStatusCode(_0x13275d,_0x2ad2cf){_0x2ad2cf=_0x2ad2cf||0xcc;return function(_0x35fd11){if(_0x35fd11){return _0x13275d[_0xfb07('0x1c')](_0x2ad2cf);}return _0x13275d['status'](_0x2ad2cf)[_0xfb07('0x1d')]();};}function respondWithResult(_0x40bf71,_0x3c69db){_0x3c69db=_0x3c69db||0xc8;return function(_0x2c35e4){if(_0x2c35e4){return _0x40bf71[_0xfb07('0x1e')](_0x3c69db)[_0xfb07('0x1f')](_0x2c35e4);}};}function respondWithFilteredResult(_0x29cbae,_0x228e2a){return function(_0x2363d6){if(_0x2363d6){var _0x6a14e0=typeof _0x228e2a[_0xfb07('0x20')]===_0xfb07('0x21')&&typeof _0x228e2a[_0xfb07('0x22')]===_0xfb07('0x21');var _0x4ebcc3=_0x2363d6['count'];var _0x3e747e=_0x6a14e0?0x0:_0x228e2a[_0xfb07('0x20')];var _0x197f12=_0x6a14e0?_0x2363d6['count']:_0x228e2a[_0xfb07('0x20')]+_0x228e2a[_0xfb07('0x22')];var _0x527c4e;if(_0x197f12>=_0x4ebcc3){_0x197f12=_0x4ebcc3;_0x527c4e=0xc8;}else{_0x527c4e=0xce;}_0x29cbae['status'](_0x527c4e);return _0x29cbae[_0xfb07('0x23')](_0xfb07('0x24'),_0x3e747e+'-'+_0x197f12+'/'+_0x4ebcc3)[_0xfb07('0x1f')](_0x2363d6);}return null;};}function patchUpdates(_0x2c6c44){return function(_0x388995){try{jsonpatch[_0xfb07('0x25')](_0x388995,_0x2c6c44,!![]);}catch(_0x15e153){return BPromise[_0xfb07('0x26')](_0x15e153);}return _0x388995[_0xfb07('0x27')]();};}function saveUpdates(_0x578bb2,_0x45806a){return function(_0x56d0c4){if(_0x56d0c4){return _0x56d0c4[_0xfb07('0x28')](_0x578bb2)[_0xfb07('0x29')](function(_0x428c85){return _0x428c85;});}return null;};}function removeEntity(_0x301c1a,_0xb2063a){return function(_0x508d3b){if(_0x508d3b){return _0x508d3b[_0xfb07('0x2a')]()[_0xfb07('0x29')](function(){var _0x10835a=_0x508d3b[_0xfb07('0x2b')]({'plain':!![]});var _0x3b14fa=_0xfb07('0x2c');return db['UserProfileResource'][_0xfb07('0x2a')]({'where':{'type':_0x3b14fa,'resourceId':_0x10835a['id']}})[_0xfb07('0x29')](function(){return _0x508d3b;});})['then'](function(){_0x301c1a[_0xfb07('0x1e')](0xcc)[_0xfb07('0x1d')]();});}};}function handleEntityNotFound(_0xe813a7,_0x149ac0){return function(_0x46927a){if(!_0x46927a){_0xe813a7[_0xfb07('0x1c')](0x194);}return _0x46927a;};}function handleError(_0x20f01a,_0x24ff99){_0x24ff99=_0x24ff99||0x1f4;return function(_0x95f1d){logger[_0xfb07('0x2d')](_0x95f1d[_0xfb07('0x2e')]);if(_0x95f1d['name']){delete _0x95f1d[_0xfb07('0x2f')];}_0x20f01a[_0xfb07('0x1e')](_0x24ff99)[_0xfb07('0x30')](_0x95f1d);};}exports[_0xfb07('0x31')]=function(_0x5dd4c9,_0x46d57e){var _0xd5290c={},_0x4ce9a4={},_0x36da2a={'count':0x0,'rows':[]};var _0x5dc353=_[_0xfb07('0x32')](db['Tag'][_0xfb07('0x33')],function(_0x4a8d4c){return{'name':_0x4a8d4c[_0xfb07('0x34')],'type':_0x4a8d4c[_0xfb07('0x35')][_0xfb07('0x36')]};});_0x4ce9a4[_0xfb07('0x37')]=_[_0xfb07('0x32')](_0x5dc353,_0xfb07('0x2f'));_0x4ce9a4['query']=_['keys'](_0x5dd4c9[_0xfb07('0x38')]);_0x4ce9a4[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],_0x4ce9a4['query']);_0xd5290c['attributes']=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3b')]));_0xd5290c[_0xfb07('0x3c')]=_0xd5290c['attributes']['length']?_0xd5290c['attributes']:_0x4ce9a4[_0xfb07('0x37')];if(!_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3d')](_0xfb07('0x3e'))){_0xd5290c['limit']=qs['limit'](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x22')]);_0xd5290c['offset']=qs['offset'](_0x5dd4c9['query'][_0xfb07('0x20')]);}_0xd5290c[_0xfb07('0x3f')]=qs['sort'](_0x5dd4c9['query'][_0xfb07('0x40')]);_0xd5290c[_0xfb07('0x41')]=qs[_0xfb07('0x39')](_[_0xfb07('0x42')](_0x5dd4c9[_0xfb07('0x38')],_0x4ce9a4['filters']),_0x5dc353);if(_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]){_0xd5290c[_0xfb07('0x41')]=_[_0xfb07('0x44')](_0xd5290c['where'],{'$or':_['map'](_0x5dc353,function(_0x2d40cb){if(_0x2d40cb[_0xfb07('0x35')]!==_0xfb07('0x45')){var _0xc5df59={};_0xc5df59[_0x2d40cb[_0xfb07('0x2f')]]={'$like':'%'+_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]+'%'};return _0xc5df59;}})});}_0xd5290c=_['merge']({},_0xd5290c,_0x5dd4c9['options']);var _0x44dafb={'where':_0xd5290c[_0xfb07('0x41')]};return db['Tag']['count'](_0x44dafb)[_0xfb07('0x29')](function(_0x20d682){_0x36da2a[_0xfb07('0x46')]=_0x20d682;if(_0x5dd4c9['query']['includeAll']){_0xd5290c[_0xfb07('0x47')]=[{'all':!![]}];}return db[_0xfb07('0x48')][_0xfb07('0x49')](_0xd5290c);})[_0xfb07('0x29')](function(_0xb87b68){_0x36da2a[_0xfb07('0x4a')]=_0xb87b68;return _0x36da2a;})[_0xfb07('0x29')](respondWithFilteredResult(_0x46d57e,_0xd5290c))[_0xfb07('0x4b')](handleError(_0x46d57e,null));};exports[_0xfb07('0x4c')]=function(_0x492f1b,_0x41df3f){var _0x12c588={'raw':!![],'where':{'id':_0x492f1b[_0xfb07('0x4d')]['id']}},_0x3d6372={};_0x3d6372[_0xfb07('0x37')]=_[_0xfb07('0x4e')](db[_0xfb07('0x48')][_0xfb07('0x33')]);_0x3d6372[_0xfb07('0x38')]=_[_0xfb07('0x4e')](_0x492f1b['query']);_0x3d6372['filters']=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],_0x3d6372['query']);_0x12c588[_0xfb07('0x3c')]=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x492f1b[_0xfb07('0x38')]['fields']));_0x12c588['attributes']=_0x12c588[_0xfb07('0x3c')][_0xfb07('0x4f')]?_0x12c588[_0xfb07('0x3c')]:_0x3d6372[_0xfb07('0x37')];if(_0x492f1b[_0xfb07('0x38')][_0xfb07('0x50')]){_0x12c588[_0xfb07('0x47')]=[{'all':!![]}];}_0x12c588=_[_0xfb07('0x44')]({},_0x12c588,_0x492f1b[_0xfb07('0x51')]);return db[_0xfb07('0x48')]['find'](_0x12c588)['then'](handleEntityNotFound(_0x41df3f,null))['then'](respondWithResult(_0x41df3f,null))[_0xfb07('0x4b')](handleError(_0x41df3f,null));};exports['create']=function(_0x2397f8,_0x31cca8){return db[_0xfb07('0x48')][_0xfb07('0x52')](_0x2397f8[_0xfb07('0x53')],{})[_0xfb07('0x29')](function(_0x4d464e){var _0x3b2cce=_0x2397f8[_0xfb07('0x54')][_0xfb07('0x2b')]({'plain':!![]});if(!_0x3b2cce)throw new Error(_0xfb07('0x55'));if(_0x3b2cce[_0xfb07('0x56')]==='user'){var _0x3cfb89=_0x4d464e[_0xfb07('0x2b')]({'plain':!![]});var _0x40fa4a=_0xfb07('0x2c');return db[_0xfb07('0x57')]['find']({'where':{'name':_0x40fa4a,'userProfileId':_0x3b2cce[_0xfb07('0x58')]},'raw':!![]})[_0xfb07('0x29')](function(_0x38b30e){if(_0x38b30e&&_0x38b30e[_0xfb07('0x59')]===0x0){return db[_0xfb07('0x5a')]['create']({'name':_0x3cfb89[_0xfb07('0x2f')],'resourceId':_0x3cfb89['id'],'type':_0x38b30e[_0xfb07('0x2f')],'sectionId':_0x38b30e['id']},{})[_0xfb07('0x29')](function(){return _0x4d464e;});}else{return _0x4d464e;}})[_0xfb07('0x4b')](function(_0x4e597d){logger[_0xfb07('0x2d')](_0xfb07('0x5b'),_0x4e597d);throw _0x4e597d;});}return _0x4d464e;})[_0xfb07('0x29')](respondWithResult(_0x31cca8,0xc9))[_0xfb07('0x4b')](handleError(_0x31cca8,null));};exports[_0xfb07('0x28')]=function(_0x165628,_0x353b33){if(_0x165628[_0xfb07('0x53')]['id']){delete _0x165628[_0xfb07('0x53')]['id'];}return db[_0xfb07('0x48')]['find']({'where':{'id':_0x165628[_0xfb07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x353b33,null))[_0xfb07('0x29')](saveUpdates(_0x165628[_0xfb07('0x53')],null))[_0xfb07('0x29')](respondWithResult(_0x353b33,null))[_0xfb07('0x4b')](handleError(_0x353b33,null));};exports[_0xfb07('0x2a')]=function(_0x7746bb,_0x1c76af){return db['Tag']['find']({'where':{'id':_0x7746bb['params']['id']}})[_0xfb07('0x29')](handleEntityNotFound(_0x1c76af,null))[_0xfb07('0x29')](removeEntity(_0x1c76af,null))[_0xfb07('0x4b')](handleError(_0x1c76af,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9750dbc..44fe830 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 _0x163f=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','lodash','util'];(function(_0x27e811,_0x1fad22){var _0x1bfe61=function(_0x2d8d02){while(--_0x2d8d02){_0x27e811['push'](_0x27e811['shift']());}};_0x1bfe61(++_0x1fad22);}(_0x163f,0x6a));var _0xf163=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x163f[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var logger=require(_0xf163('0x2'))(_0xf163('0x3'));var moment=require('moment');var BPromise=require(_0xf163('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf163('0x5'));var rimraf=require(_0xf163('0x6'));var config=require(_0xf163('0x7'));var attributes=require(_0xf163('0x8'));module[_0xf163('0x9')]=function(_0x134a28,_0x30e36f){return _0x134a28[_0xf163('0xa')](_0xf163('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e96=['Tag','tools_tags','lodash','util','api','path','../../config/environment','./tag.attributes','exports','define'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9e96,0xde));var _0x69e9=function(_0x45113b,_0x555445){_0x45113b=_0x45113b-0x0;var _0x131934=_0x9e96[_0x45113b];return _0x131934;};'use strict';var _=require(_0x69e9('0x0'));var util=require(_0x69e9('0x1'));var logger=require('../../config/logger')(_0x69e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x69e9('0x3'));var rimraf=require('rimraf');var config=require(_0x69e9('0x4'));var attributes=require(_0x69e9('0x5'));module[_0x69e9('0x6')]=function(_0x6bcd6c,_0x18dd2b){return _0x6bcd6c[_0x69e9('0x7')](_0x69e9('0x8'),attributes,{'tableName':_0x69e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 9d6bacc..058c7f5 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 _0x8a28=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2d7355,_0x57ae2d){var _0x56cbba=function(_0x5cfa27){while(--_0x5cfa27){_0x2d7355['push'](_0x2d7355['shift']());}};_0x56cbba(++_0x57ae2d);}(_0x8a28,0xfd));var _0x88a2=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x8a28[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb591,_0x1629ea,_0x5406ed){return new BPromise(function(_0x1cdf6b,_0x2a8576){return client[_0x88a2('0xd')](_0x5cb591,_0x5406ed)[_0x88a2('0xe')](function(_0x2db7dd){logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));logger[_0x88a2('0x12')]('Tag,\x20%s,\x20%s,\x20%s',_0x1629ea,'request\x20sent',JSON[_0x88a2('0x13')](_0x2db7dd));if(_0x2db7dd[_0x88a2('0x14')]){if(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x15')]===0x1f4){logger[_0x88a2('0x14')]('Tag,\x20%s,\x20%s',_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x2a8576(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);}logger['error'](_0x88a2('0x10'),_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x1cdf6b(_0x2db7dd['error'][_0x88a2('0x16')]);}else{logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));_0x1cdf6b(_0x2db7dd[_0x88a2('0x17')][_0x88a2('0x16')]);}})[_0x88a2('0x18')](function(_0x2f5220){logger[_0x88a2('0x14')](_0x88a2('0x10'),_0x1629ea,_0x2f5220);_0x2a8576(_0x2f5220);});});} \ No newline at end of file +var _0xd13e=['Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55cd99,_0x45b2f9){var _0x566201=function(_0x1fa6ae){while(--_0x1fa6ae){_0x55cd99['push'](_0x55cd99['shift']());}};_0x566201(++_0x45b2f9);}(_0xd13e,0x193));var _0xed13=function(_0x29547b,_0x55f8f7){_0x29547b=_0x29547b-0x0;var _0x4ececa=_0xd13e[_0x29547b];return _0x4ececa;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('Tag,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a7ca8c7..cd477c1 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 30ac5ad..68288e1 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b901a0c..262eb5d 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 _0xea32=['UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','getQueues','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','findAll','online','interface','upsert','isNil','SIP/%s','voicePause','all','spread','removeAgents','Sms','Queue:remove','UserVoiceQueueRt','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','./team.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0xea32,0x1f2));var _0x2ea3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xea32[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x2ea3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ea3('0x1'));var jsonpatch=require(_0x2ea3('0x2'));var rp=require('request-promise');var moment=require(_0x2ea3('0x3'));var BPromise=require(_0x2ea3('0x4'));var Mustache=require('mustache');var util=require(_0x2ea3('0x5'));var path=require(_0x2ea3('0x6'));var sox=require('sox');var csv=require(_0x2ea3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ea3('0x8'));var squel=require('squel');var crypto=require(_0x2ea3('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2ea3('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ea3('0xb'));var qs=require(_0x2ea3('0xc'));var as=require(_0x2ea3('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ea3('0xe'))(_0x2ea3('0xf'));var utils=require(_0x2ea3('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2ea3('0x11')]=_[_0x2ea3('0x12')](config['redis'],{'host':_0x2ea3('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ea3('0x11')]));require(_0x2ea3('0x14'))['register'](socket);function respondWithStatusCode(_0x565f6a,_0x394bc5){_0x394bc5=_0x394bc5||0xcc;return function(_0x55cf17){if(_0x55cf17){return _0x565f6a[_0x2ea3('0x15')](_0x394bc5);}return _0x565f6a[_0x2ea3('0x16')](_0x394bc5)[_0x2ea3('0x17')]();};}function respondWithResult(_0x3ca508,_0x518e7f){_0x518e7f=_0x518e7f||0xc8;return function(_0x574700){if(_0x574700){return _0x3ca508[_0x2ea3('0x16')](_0x518e7f)['json'](_0x574700);}};}function respondWithFilteredResult(_0x53b6eb,_0x28491e){return function(_0x143e86){if(_0x143e86){var _0x756a00=typeof _0x28491e[_0x2ea3('0x18')]==='undefined'&&typeof _0x28491e[_0x2ea3('0x19')]===_0x2ea3('0x1a');var _0x516e7a=_0x143e86[_0x2ea3('0x1b')];var _0x433507=_0x756a00?0x0:_0x28491e['offset'];var _0xbfb566=_0x756a00?_0x143e86[_0x2ea3('0x1b')]:_0x28491e[_0x2ea3('0x18')]+_0x28491e[_0x2ea3('0x19')];var _0x24796d;if(_0xbfb566>=_0x516e7a){_0xbfb566=_0x516e7a;_0x24796d=0xc8;}else{_0x24796d=0xce;}_0x53b6eb[_0x2ea3('0x16')](_0x24796d);return _0x53b6eb[_0x2ea3('0x1c')](_0x2ea3('0x1d'),_0x433507+'-'+_0xbfb566+'/'+_0x516e7a)[_0x2ea3('0x1e')](_0x143e86);}return null;};}function patchUpdates(_0x177004){return function(_0x998792){try{jsonpatch[_0x2ea3('0x1f')](_0x998792,_0x177004,!![]);}catch(_0x304cd8){return BPromise[_0x2ea3('0x20')](_0x304cd8);}return _0x998792[_0x2ea3('0x21')]();};}function saveUpdates(_0x3b9d2c,_0x5ab662){return function(_0x1c0e33){if(_0x1c0e33){return _0x1c0e33[_0x2ea3('0x22')](_0x3b9d2c)[_0x2ea3('0x23')](function(_0x38dd47){return _0x38dd47;});}return null;};}function handleEntityNotFound(_0x171d69,_0x36bf38){return function(_0x535542){if(!_0x535542){_0x171d69[_0x2ea3('0x15')](0x194);}return _0x535542;};}function handleError(_0x14c0b7,_0x313c98){_0x313c98=_0x313c98||0x1f4;return function(_0x5658d6){logger[_0x2ea3('0x24')](_0x5658d6[_0x2ea3('0x25')]);if(_0x5658d6[_0x2ea3('0x26')]){delete _0x5658d6['name'];}_0x14c0b7[_0x2ea3('0x16')](_0x313c98)[_0x2ea3('0x27')](_0x5658d6);};}exports[_0x2ea3('0x28')]=function(_0x2fc1dd,_0x2beea4){var _0x4fbf1d={},_0xf651de={},_0x15382d={'count':0x0,'rows':[]};var _0x5f520a=_['map'](db[_0x2ea3('0x29')][_0x2ea3('0x2a')],function(_0x507436){return{'name':_0x507436[_0x2ea3('0x2b')],'type':_0x507436[_0x2ea3('0x2c')][_0x2ea3('0x2d')]};});_0xf651de[_0x2ea3('0x2e')]=_[_0x2ea3('0x2f')](_0x5f520a,_0x2ea3('0x26'));_0xf651de[_0x2ea3('0x30')]=_[_0x2ea3('0x31')](_0x2fc1dd[_0x2ea3('0x30')]);_0xf651de[_0x2ea3('0x32')]=_['intersection'](_0xf651de[_0x2ea3('0x2e')],_0xf651de[_0x2ea3('0x30')]);_0x4fbf1d[_0x2ea3('0x33')]=_[_0x2ea3('0x34')](_0xf651de[_0x2ea3('0x2e')],qs[_0x2ea3('0x35')](_0x2fc1dd[_0x2ea3('0x30')]['fields']));_0x4fbf1d['attributes']=_0x4fbf1d['attributes'][_0x2ea3('0x36')]?_0x4fbf1d[_0x2ea3('0x33')]:_0xf651de[_0x2ea3('0x2e')];if(!_0x2fc1dd[_0x2ea3('0x30')]['hasOwnProperty']('nolimit')){_0x4fbf1d['limit']=qs[_0x2ea3('0x19')](_0x2fc1dd['query'][_0x2ea3('0x19')]);_0x4fbf1d['offset']=qs[_0x2ea3('0x18')](_0x2fc1dd[_0x2ea3('0x30')]['offset']);}_0x4fbf1d[_0x2ea3('0x37')]=qs[_0x2ea3('0x38')](_0x2fc1dd[_0x2ea3('0x30')]['sort']);_0x4fbf1d['where']=qs[_0x2ea3('0x32')](_[_0x2ea3('0x39')](_0x2fc1dd[_0x2ea3('0x30')],_0xf651de[_0x2ea3('0x32')]),_0x5f520a);if(_0x2fc1dd[_0x2ea3('0x30')][_0x2ea3('0x3a')]){_0x4fbf1d['where']=_[_0x2ea3('0x3b')](_0x4fbf1d[_0x2ea3('0x3c')],{'$or':_['map'](_0x5f520a,function(_0x2ca419){if(_0x2ca419[_0x2ea3('0x2c')]!==_0x2ea3('0x3d')){var _0x1f30f4={};_0x1f30f4[_0x2ca419[_0x2ea3('0x26')]]={'$like':'%'+_0x2fc1dd['query'][_0x2ea3('0x3a')]+'%'};return _0x1f30f4;}})});}_0x4fbf1d=_[_0x2ea3('0x3b')]({},_0x4fbf1d,_0x2fc1dd[_0x2ea3('0x3e')]);var _0x4213e5={'where':_0x4fbf1d[_0x2ea3('0x3c')]};return db[_0x2ea3('0x29')][_0x2ea3('0x1b')](_0x4213e5)[_0x2ea3('0x23')](function(_0x55c33c){_0x15382d[_0x2ea3('0x1b')]=_0x55c33c;if(_0x2fc1dd[_0x2ea3('0x30')][_0x2ea3('0x3f')]){_0x4fbf1d[_0x2ea3('0x40')]=[{'all':!![]}];}return db[_0x2ea3('0x29')]['findAll'](_0x4fbf1d);})[_0x2ea3('0x23')](function(_0x5d77d){_0x15382d['rows']=_0x5d77d;return _0x15382d;})['then'](respondWithFilteredResult(_0x2beea4,_0x4fbf1d))[_0x2ea3('0x41')](handleError(_0x2beea4,null));};exports['show']=function(_0x493afe,_0x451791){var _0x1949f3={'raw':![],'where':{'id':_0x493afe[_0x2ea3('0x42')]['id']}},_0x2634a2={};_0x2634a2[_0x2ea3('0x2e')]=_[_0x2ea3('0x31')](db[_0x2ea3('0x29')][_0x2ea3('0x2a')]);_0x2634a2[_0x2ea3('0x30')]=_[_0x2ea3('0x31')](_0x493afe[_0x2ea3('0x30')]);_0x2634a2[_0x2ea3('0x32')]=_[_0x2ea3('0x34')](_0x2634a2[_0x2ea3('0x2e')],_0x2634a2[_0x2ea3('0x30')]);_0x1949f3['attributes']=_['intersection'](_0x2634a2['model'],qs['fields'](_0x493afe['query'][_0x2ea3('0x35')]));_0x1949f3[_0x2ea3('0x33')]=_0x1949f3[_0x2ea3('0x33')][_0x2ea3('0x36')]?_0x1949f3[_0x2ea3('0x33')]:_0x2634a2[_0x2ea3('0x2e')];if(_0x493afe[_0x2ea3('0x30')][_0x2ea3('0x3f')]){_0x1949f3[_0x2ea3('0x40')]=[{'all':!![]}];}_0x1949f3=_[_0x2ea3('0x3b')]({},_0x1949f3,_0x493afe[_0x2ea3('0x3e')]);return db[_0x2ea3('0x29')][_0x2ea3('0x43')](_0x1949f3)[_0x2ea3('0x23')](handleEntityNotFound(_0x451791,null))[_0x2ea3('0x23')](respondWithResult(_0x451791,null))[_0x2ea3('0x41')](handleError(_0x451791,null));};exports[_0x2ea3('0x44')]=function(_0x5152a4,_0xa3f392){return db['Team'][_0x2ea3('0x44')](_0x5152a4['body'],{})[_0x2ea3('0x23')](function(_0xe73baa){var _0xb95830=_0x5152a4['user']['get']({'plain':!![]});if(!_0xb95830)throw new Error(_0x2ea3('0x45'));if(_0xb95830[_0x2ea3('0x46')]===_0x2ea3('0x47')){var _0x10a6ba=_0xe73baa[_0x2ea3('0x48')]({'plain':!![]});var _0x477e93='Teams';return db[_0x2ea3('0x49')]['find']({'where':{'name':_0x477e93,'userProfileId':_0xb95830[_0x2ea3('0x4a')]},'raw':!![]})[_0x2ea3('0x23')](function(_0x3f6e3e){if(_0x3f6e3e&&_0x3f6e3e[_0x2ea3('0x4b')]===0x0){return db[_0x2ea3('0x4c')][_0x2ea3('0x44')]({'name':_0x10a6ba[_0x2ea3('0x26')],'resourceId':_0x10a6ba['id'],'type':_0x3f6e3e['name'],'sectionId':_0x3f6e3e['id']},{})['then'](function(){return _0xe73baa;});}else{return _0xe73baa;}})[_0x2ea3('0x41')](function(_0x1b7a03){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7a03);throw _0x1b7a03;});}return _0xe73baa;})[_0x2ea3('0x23')](respondWithResult(_0xa3f392,0xc9))[_0x2ea3('0x41')](handleError(_0xa3f392,null));};exports['update']=function(_0x37496f,_0xf0f191){if(_0x37496f[_0x2ea3('0x4d')]['id']){delete _0x37496f[_0x2ea3('0x4d')]['id'];}return db['Team'][_0x2ea3('0x43')]({'where':{'id':_0x37496f[_0x2ea3('0x42')]['id']}})[_0x2ea3('0x23')](handleEntityNotFound(_0xf0f191,null))['then'](saveUpdates(_0x37496f[_0x2ea3('0x4d')],null))[_0x2ea3('0x23')](respondWithResult(_0xf0f191,null))[_0x2ea3('0x41')](handleError(_0xf0f191,null));};exports['destroy']=function(_0x3ee238,_0x4fb642){var _0x10f40d=_0x3ee238[_0x2ea3('0x42')]['id'];var _0x2ebc02=[];return db['sequelize'][_0x2ea3('0x4e')](function(_0x1cb91b){var _0x4d5255=_0x2ea3('0x4f')+_0x10f40d;return db[_0x2ea3('0x50')]['query'](_0x4d5255,{'type':db[_0x2ea3('0x51')][_0x2ea3('0x52')][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b})[_0x2ea3('0x23')](function(_0x43e2bb){_0x2ebc02=_[_0x2ea3('0x2f')](_0x43e2bb,function(_0x326cfb){return Number(_0x326cfb[_0x2ea3('0x54')]);});})[_0x2ea3('0x23')](function(){var _0x161f84='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x10f40d;return db[_0x2ea3('0x50')][_0x2ea3('0x30')](_0x161f84,{'type':db[_0x2ea3('0x51')]['QueryTypes'][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x4fd8b6){var _0x3cb471=_[_0x2ea3('0x2f')](_0x4fd8b6,function(_0x34f084){return Number(_0x34f084[_0x2ea3('0x55')]);});return db[_0x2ea3('0x56')][_0x2ea3('0x57')]({'where':{'UserId':{'$in':_0x2ebc02},'VoiceQueueId':{'$in':_0x3cb471}},'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(){var _0x5b38ac=_0x2ea3('0x58')+_0x10f40d;return db[_0x2ea3('0x50')][_0x2ea3('0x30')](_0x5b38ac,{'type':db[_0x2ea3('0x51')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x4fd8ee){var _0x8b7c75=_[_0x2ea3('0x2f')](_0x4fd8ee,function(_0x2738fa){return Number(_0x2738fa[_0x2ea3('0x59')]);});return db[_0x2ea3('0x5a')][_0x2ea3('0x57')]({'where':{'UserId':{'$in':_0x2ebc02},'MailQueueId':{'$in':_0x8b7c75}},'transaction':_0x1cb91b});})['then'](function(){var _0x1e1892=_0x2ea3('0x5b')+_0x10f40d;return db[_0x2ea3('0x50')]['query'](_0x1e1892,{'type':db[_0x2ea3('0x51')][_0x2ea3('0x52')][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x1e4ffe){var _0x2ee396=_[_0x2ea3('0x2f')](_0x1e4ffe,function(_0x51a25c){return Number(_0x51a25c['SmsQueueId']);});return db['UserSmsQueue'][_0x2ea3('0x57')]({'where':{'UserId':{'$in':_0x2ebc02},'SmsQueueId':{'$in':_0x2ee396}},'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(){var _0x181978='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x10f40d;return db[_0x2ea3('0x50')]['query'](_0x181978,{'type':db[_0x2ea3('0x51')]['QueryTypes'][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x62ad3d){var _0x59ec01=_['map'](_0x62ad3d,function(_0x89c765){return Number(_0x89c765[_0x2ea3('0x5c')]);});return db[_0x2ea3('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x2ebc02},'ChatQueueId':{'$in':_0x59ec01}},'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(){var _0xa3ee77=_0x2ea3('0x5e')+_0x10f40d;return db[_0x2ea3('0x50')][_0x2ea3('0x30')](_0xa3ee77,{'type':db['Sequelize']['QueryTypes'][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x39188a){var _0x49d012=_['map'](_0x39188a,function(_0x3fdb37){return Number(_0x3fdb37[_0x2ea3('0x5f')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x2ebc02},'FaxQueueId':{'$in':_0x49d012}},'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(){var _0x2072bd='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x10f40d;return db[_0x2ea3('0x50')]['query'](_0x2072bd,{'type':db['Sequelize'][_0x2ea3('0x52')][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x2f6420){var _0x16c8ee=_[_0x2ea3('0x2f')](_0x2f6420,function(_0x30148c){return Number(_0x30148c['OpenchannelQueueId']);});return db[_0x2ea3('0x60')][_0x2ea3('0x57')]({'where':{'UserId':{'$in':_0x2ebc02},'OpenchannelQueueId':{'$in':_0x16c8ee}},'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(){var _0x46c78e=_0x2ea3('0x61')+_0x10f40d;return db[_0x2ea3('0x50')][_0x2ea3('0x30')](_0x46c78e,{'type':db[_0x2ea3('0x51')][_0x2ea3('0x52')][_0x2ea3('0x53')],'raw':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x28afad){var _0x95e91a=_['map'](_0x28afad,function(_0xcc065f){return Number(_0xcc065f['WhatsappQueueId']);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x2ebc02},'WhatsappQueueId':{'$in':_0x95e91a}},'transaction':_0x1cb91b});})['then'](function(){return db[_0x2ea3('0x62')][_0x2ea3('0x43')]({'where':{'TeamId':_0x10f40d}});})[_0x2ea3('0x23')](function(_0xd60b4d){if(_0xd60b4d===null){return;}return db[_0x2ea3('0x63')][_0x2ea3('0x57')]({'where':{'UserId':{'$in':_0x2ebc02},'VoicePrefixId':_0xd60b4d[_0x2ea3('0x64')]},'transaction':_0x1cb91b});})['then'](function(){return db[_0x2ea3('0x29')][_0x2ea3('0x57')]({'where':{'id':_0x10f40d},'cascade':!![],'transaction':_0x1cb91b});})[_0x2ea3('0x23')](function(_0x1fb5f0){if(_0x1fb5f0===0x0){_0x4fb642[_0x2ea3('0x15')](0x194);}else{return db['UserProfileResource'][_0x2ea3('0x57')]({'where':{'type':_0x2ea3('0x65'),'resourceId':_0x10f40d},'cascade':!![],'transaction':_0x1cb91b})['then'](function(){_0x4fb642[_0x2ea3('0x16')](0xcc)['end']();});}})['catch'](function(_0x109321){_0x4fb642['status'](0x1f4)[_0x2ea3('0x27')](_0x109321);});});};exports[_0x2ea3('0x66')]=function(_0x26169a,_0x5f4db1,_0x5cb33e){return db['Team']['findOne']({'where':{'id':_0x26169a['params']['id']}})[_0x2ea3('0x23')](handleEntityNotFound(_0x5f4db1,null))[_0x2ea3('0x23')](function(_0x55fe98){if(!_0x26169a[_0x2ea3('0x30')]['channel']||!utils[_0x2ea3('0x67')](_0x26169a['query'][_0x2ea3('0x68')])){throw new db[(_0x2ea3('0x51'))][(_0x2ea3('0x69'))](_0x2ea3('0x6a'));}var _0x19aedc={};var _0x3b66d0={};_0x3b66d0['model']=_[_0x2ea3('0x31')](db[_[_0x2ea3('0x6b')](_0x26169a['query'][_0x2ea3('0x68')][_0x2ea3('0x6c')]())+_0x2ea3('0x6d')][_0x2ea3('0x2a')]);_0x3b66d0[_0x2ea3('0x30')]=_[_0x2ea3('0x31')](_0x26169a['query']);_0x3b66d0[_0x2ea3('0x32')]=_['intersection'](_0x3b66d0[_0x2ea3('0x2e')],_0x3b66d0['query']);_0x19aedc['attributes']=_[_0x2ea3('0x34')](_0x3b66d0[_0x2ea3('0x2e')],qs[_0x2ea3('0x35')](_0x26169a['query'][_0x2ea3('0x35')]));_0x19aedc[_0x2ea3('0x33')]=_0x19aedc['attributes']['length']?_0x19aedc[_0x2ea3('0x33')]:_0x3b66d0[_0x2ea3('0x2e')];_0x19aedc[_0x2ea3('0x19')]=qs['limit'](_0x26169a[_0x2ea3('0x30')][_0x2ea3('0x19')]);_0x19aedc[_0x2ea3('0x18')]=qs['offset'](_0x26169a['query'][_0x2ea3('0x18')]);_0x19aedc[_0x2ea3('0x37')]=qs[_0x2ea3('0x38')](_0x26169a[_0x2ea3('0x30')][_0x2ea3('0x38')]);_0x19aedc[_0x2ea3('0x3c')]=qs['filters'](_[_0x2ea3('0x39')](_0x26169a[_0x2ea3('0x30')],_0x3b66d0[_0x2ea3('0x32')]));_0x19aedc=_[_0x2ea3('0x3b')]({},_0x19aedc,_0x26169a['options']);return _0x55fe98[_0x2ea3('0x48')+_[_0x2ea3('0x6b')](_0x26169a['query']['channel'][_0x2ea3('0x6c')]())+_0x2ea3('0x6e')](_0x19aedc);})[_0x2ea3('0x23')](respondWithResult(_0x5f4db1,null))[_0x2ea3('0x41')](handleError(_0x5f4db1,null));};exports[_0x2ea3('0x6f')]=function(_0x19fc59,_0x4bb0d9,_0x15caf5){return db[_0x2ea3('0x29')][_0x2ea3('0x70')]({'where':{'id':_0x19fc59['params']['id']}})[_0x2ea3('0x23')](function(_0x1c195d){if(_0x1c195d){if(!_0x19fc59['body'][_0x2ea3('0x68')]||!utils['isValidChannel'](_0x19fc59[_0x2ea3('0x4d')][_0x2ea3('0x68')])){throw new db[(_0x2ea3('0x51'))]['ValidationError'](_0x2ea3('0x6a'));}return _0x1c195d[_0x2ea3('0x71')+_[_0x2ea3('0x6b')](_0x19fc59['body'][_0x2ea3('0x68')][_0x2ea3('0x6c')]())+_0x2ea3('0x6e')](_0x19fc59[_0x2ea3('0x4d')][_0x2ea3('0x72')]);}return null;})[_0x2ea3('0x23')](handleEntityNotFound(_0x4bb0d9,null))[_0x2ea3('0x23')](respondWithStatusCode(_0x4bb0d9,null))['catch'](handleError(_0x4bb0d9,null));};exports[_0x2ea3('0x73')]=function(_0x402b07,_0x481c70,_0x1e2e22){return db[_0x2ea3('0x29')][_0x2ea3('0x70')]({'where':{'id':_0x402b07['params']['id']}})[_0x2ea3('0x23')](function(_0x4f0ca0){if(_0x4f0ca0){if(!_0x402b07[_0x2ea3('0x30')][_0x2ea3('0x68')]||!utils['isValidChannel'](_0x402b07['query'][_0x2ea3('0x68')])){throw new db['Sequelize'][(_0x2ea3('0x69'))](_0x2ea3('0x6a'));}return _0x4f0ca0[_0x2ea3('0x74')+_[_0x2ea3('0x6b')](_0x402b07[_0x2ea3('0x30')]['channel'][_0x2ea3('0x6c')]())+_0x2ea3('0x6e')](_0x402b07['query'][_0x2ea3('0x72')]);}return null;})[_0x2ea3('0x23')](handleEntityNotFound(_0x481c70,null))[_0x2ea3('0x23')](respondWithStatusCode(_0x481c70,null))[_0x2ea3('0x41')](handleError(_0x481c70,null));};exports[_0x2ea3('0x75')]=function(_0x59a668,_0x5216f3){var _0x2dbade=_[_0x2ea3('0x76')](_0x59a668[_0x2ea3('0x4d')][_0x2ea3('0x72')])?_0x59a668[_0x2ea3('0x4d')][_0x2ea3('0x72')]:[_0x59a668[_0x2ea3('0x4d')][_0x2ea3('0x72')]];var _0x3d327a=_0x59a668['params']['id'];return db[_0x2ea3('0x29')][_0x2ea3('0x43')]({'where':{'id':_0x3d327a}})[_0x2ea3('0x23')](handleEntityNotFound(_0x5216f3,null))[_0x2ea3('0x23')](function(_0x483206){if(_0x483206){var _0x48465c=[_0x2ea3('0x77'),_0x2ea3('0x78'),_0x2ea3('0x79'),'Sms',_0x2ea3('0x7a'),_0x2ea3('0x7b'),_0x2ea3('0x7c')];return db['sequelize'][_0x2ea3('0x4e')](function(_0x56cf7b){var _0x393307=_[_0x2ea3('0x2f')](_0x48465c,function(_0x529677){var _0x3e62d5={'attributes':['id',_0x2ea3('0x26')]};if(_0x529677===_0x2ea3('0x77')){_0x3e62d5[_0x2ea3('0x7d')]={'attributes':['penalty']};}return _0x483206[_0x2ea3('0x48')+_0x529677+_0x2ea3('0x6e')](_0x3e62d5)[_0x2ea3('0x23')](function(_0x2f439a){var _0x750950=_[_0x2ea3('0x2f')](_0x2f439a,function(_0x519d42){var _0x3c64a2=_[_0x2ea3('0x2f')](_0x2dbade,function(_0x3beb04){var _0x212a04={'where':{'UserId':_0x3beb04,[_0x529677+'QueueId']:_0x519d42['id']},'transaction':_0x56cf7b};if(_0x529677==='Voice'){_0x212a04['defaults']={'penalty':_0x519d42[_0x2ea3('0x7e')][_0x2ea3('0x7f')]};}return db[_0x2ea3('0x80')+_0x529677+_0x2ea3('0x6d')][_0x2ea3('0x81')](_0x212a04)['then'](function(){socket[_0x2ea3('0x82')](_0x2ea3('0x47')+_0x529677+_0x2ea3('0x83'),{'UserId':_0x3beb04,[_0x529677+'QueueId']:_0x519d42['id']});if(_0x529677!=='Voice'){return;}return db[_0x2ea3('0x80')][_0x2ea3('0x84')]({'where':{'id':_0x2dbade,'online':0x1},'attributes':['id',_0x2ea3('0x26'),_0x2ea3('0x85'),'voicePause',_0x2ea3('0x86')],'raw':!![]})[_0x2ea3('0x23')](function(_0x42545c){var _0x3f8418=_[_0x2ea3('0x2f')](_0x42545c,function(_0x34b0f8){return db['UserVoiceQueueRt'][_0x2ea3('0x87')]({'membername':_0x34b0f8[_0x2ea3('0x26')],'UserId':_0x34b0f8['id'],'queue_name':_0x519d42['name'],'VoiceQueueId':_0x519d42['id'],'interface':_[_0x2ea3('0x88')](_0x34b0f8[_0x2ea3('0x86')])?util['format'](_0x2ea3('0x89'),_0x34b0f8['name']):_0x34b0f8[_0x2ea3('0x86')],'paused':_0x34b0f8[_0x2ea3('0x8a')]||![],'penalty':_0x519d42[_0x2ea3('0x7e')][_0x2ea3('0x7f')]},{'transaction':_0x56cf7b});});return Promise[_0x2ea3('0x8b')](_0x3f8418);});});});return Promise['all'](_0x3c64a2);});return Promise[_0x2ea3('0x8b')](_0x750950);})[_0x2ea3('0x23')](function(){return db['TeamVoicePrefix'][_0x2ea3('0x70')]({'where':{'teamId':_0x3d327a}})['then'](function(_0x12f396){if(_0x12f396){var _0x3f975c=_[_0x2ea3('0x2f')](_0x2dbade,function(_0x541378){db[_0x2ea3('0x63')][_0x2ea3('0x87')]({'UserId':_0x541378,'VoicePrefixId':_0x12f396[_0x2ea3('0x64')]});});return Promise[_0x2ea3('0x8b')](_0x3f975c);}});});});return Promise['all'](_0x393307)['then'](function(){return _0x483206[_0x2ea3('0x75')](_0x2dbade,{'transaction':_0x56cf7b})[_0x2ea3('0x8c')](function(_0x400aaa){return _0x400aaa;});});});}})['then'](respondWithResult(_0x5216f3,null))[_0x2ea3('0x41')](handleError(_0x5216f3,null));};exports[_0x2ea3('0x8d')]=function(_0x3ffbba,_0x436af2){var _0x3226c3=_['isArray'](_0x3ffbba[_0x2ea3('0x30')]['ids'])?_0x3ffbba[_0x2ea3('0x30')][_0x2ea3('0x72')]:[_0x3ffbba[_0x2ea3('0x30')]['ids']];var _0x3b66d4=_0x3ffbba['params']['id'];return db[_0x2ea3('0x29')][_0x2ea3('0x43')]({'where':{'id':_0x3b66d4}})[_0x2ea3('0x23')](handleEntityNotFound(_0x436af2,null))[_0x2ea3('0x23')](function(_0x21fbf4){if(_0x21fbf4){var _0x4c98a2=[_0x2ea3('0x77'),_0x2ea3('0x78'),_0x2ea3('0x79'),_0x2ea3('0x8e'),_0x2ea3('0x7a'),_0x2ea3('0x7b'),_0x2ea3('0x7c')];return db[_0x2ea3('0x50')]['transaction'](function(_0x476e1a){var _0x216171=_['map'](_0x4c98a2,function(_0x37b0a3){var _0x6ae151={'attributes':['id',_0x2ea3('0x26')]};return _0x21fbf4[_0x2ea3('0x48')+_0x37b0a3+'Queues'](_0x6ae151)[_0x2ea3('0x23')](function(_0x1558ce){var _0x2eef19=_[_0x2ea3('0x2f')](_0x1558ce,function(_0x56f2d2){return _0x56f2d2[_0x2ea3('0x8d')](_0x3226c3,{'transaction':_0x476e1a})[_0x2ea3('0x23')](function(){var _0x470a3b=_[_0x2ea3('0x2f')](_0x3226c3,function(_0x4365a3){socket[_0x2ea3('0x82')](_0x2ea3('0x47')+_0x37b0a3+_0x2ea3('0x8f'),{'UserId':Number(_0x4365a3),[_0x37b0a3+'QueueId']:_0x56f2d2['id']});if(_0x37b0a3!==_0x2ea3('0x77')){return;}return db[_0x2ea3('0x90')][_0x2ea3('0x57')]({'where':{'VoiceQueueId':_0x56f2d2['id'],'UserId':_0x4365a3},'transaction':_0x476e1a});});return Promise[_0x2ea3('0x8b')](_0x470a3b);});});return Promise[_0x2ea3('0x8b')](_0x2eef19);});});return Promise[_0x2ea3('0x8b')](_0x216171)['then'](function(){return _0x21fbf4[_0x2ea3('0x8d')](_0x3226c3,{'transaction':_0x476e1a});})[_0x2ea3('0x23')](function(){return db[_0x2ea3('0x62')][_0x2ea3('0x70')]({'where':{'teamId':_0x3b66d4}})[_0x2ea3('0x23')](function(_0x4b7419){if(_0x4b7419){var _0x5e76f4=_[_0x2ea3('0x2f')](_0x3226c3,function(_0x15d6d6){db['UserVoicePrefix'][_0x2ea3('0x57')]({'where':{'UserId':_0x15d6d6,'VoicePrefixId':_0x4b7419['VoicePrefixId']}});});return Promise[_0x2ea3('0x8b')](_0x5e76f4);}});});});}})[_0x2ea3('0x23')](respondWithStatusCode(_0x436af2,null))[_0x2ea3('0x41')](handleError(_0x436af2,null));};exports[_0x2ea3('0x91')]=function(_0x40fe40,_0x1fad0d,_0x1f8aac){var _0x21feec={};var _0x2df81e={};var _0x2e7c4e;var _0x31bda7;return db[_0x2ea3('0x29')]['findOne']({'where':{'id':_0x40fe40[_0x2ea3('0x42')]['id']}})[_0x2ea3('0x23')](handleEntityNotFound(_0x1fad0d,null))[_0x2ea3('0x23')](function(_0xe578b3){if(_0xe578b3){_0x2e7c4e=_0xe578b3;_0x2df81e[_0x2ea3('0x2e')]=_[_0x2ea3('0x31')](db[_0x2ea3('0x80')][_0x2ea3('0x2a')]);_0x2df81e[_0x2ea3('0x30')]=_[_0x2ea3('0x31')](_0x40fe40['query']);_0x2df81e[_0x2ea3('0x32')]=_[_0x2ea3('0x34')](_0x2df81e[_0x2ea3('0x2e')],_0x2df81e[_0x2ea3('0x30')]);_0x21feec[_0x2ea3('0x33')]=_[_0x2ea3('0x34')](_0x2df81e[_0x2ea3('0x2e')],qs[_0x2ea3('0x35')](_0x40fe40[_0x2ea3('0x30')][_0x2ea3('0x35')]));_0x21feec[_0x2ea3('0x33')]=_0x21feec[_0x2ea3('0x33')][_0x2ea3('0x36')]?_0x21feec[_0x2ea3('0x33')]:_0x2df81e['model'];_0x21feec['order']=qs['sort'](_0x40fe40[_0x2ea3('0x30')][_0x2ea3('0x38')]);_0x21feec[_0x2ea3('0x3c')]=qs[_0x2ea3('0x32')](_[_0x2ea3('0x39')](_0x40fe40[_0x2ea3('0x30')],_0x2df81e[_0x2ea3('0x32')]));if(_0x40fe40[_0x2ea3('0x30')]['filter']){_0x21feec[_0x2ea3('0x3c')]=_[_0x2ea3('0x3b')](_0x21feec['where'],{'$or':_[_0x2ea3('0x2f')](_0x21feec[_0x2ea3('0x33')],function(_0x3bb4fb){var _0xe8855b={};_0xe8855b[_0x3bb4fb]={'$like':'%'+_0x40fe40[_0x2ea3('0x30')][_0x2ea3('0x3a')]+'%'};return _0xe8855b;})});}_0x21feec=_[_0x2ea3('0x3b')]({},_0x21feec,_0x40fe40[_0x2ea3('0x3e')]);return _0x2e7c4e['getAgents'](_0x21feec);}})[_0x2ea3('0x23')](function(_0x985340){if(_0x985340){_0x31bda7=_0x985340[_0x2ea3('0x36')];if(!_0x40fe40[_0x2ea3('0x30')][_0x2ea3('0x92')]('nolimit')){_0x21feec[_0x2ea3('0x19')]=qs[_0x2ea3('0x19')](_0x40fe40['query'][_0x2ea3('0x19')]);_0x21feec['offset']=qs[_0x2ea3('0x18')](_0x40fe40[_0x2ea3('0x30')][_0x2ea3('0x18')]);}return _0x2e7c4e[_0x2ea3('0x91')](_0x21feec);}})[_0x2ea3('0x23')](function(_0x44415d){if(_0x44415d){return _0x44415d?{'count':_0x31bda7,'rows':_0x44415d}:null;}})[_0x2ea3('0x23')](respondWithResult(_0x1fad0d,null))['catch'](handleError(_0x1fad0d,null));}; \ No newline at end of file +var _0x2780=['send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','order','Queues','addQueues','add','ids','removeQueues','remove','capitalize','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','upsert','spread','removeAgents','Whatsapp','Queue:remove','getAgents','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','then','error','stack','name'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x2780,0x71));var _0x0278=function(_0x108591,_0x2230ef){_0x108591=_0x108591-0x0;var _0x5dbabd=_0x2780[_0x108591];return _0x5dbabd;};'use strict';var emlformat=require(_0x0278('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0278('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0278('0x2'));var moment=require(_0x0278('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0278('0x4'));var path=require('path');var sox=require(_0x0278('0x5'));var csv=require(_0x0278('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0278('0x7'));var _=require(_0x0278('0x8'));var squel=require(_0x0278('0x9'));var crypto=require(_0x0278('0xa'));var jsforce=require(_0x0278('0xb'));var deskjs=require(_0x0278('0xc'));var toCsv=require(_0x0278('0x6'));var querystring=require(_0x0278('0xd'));var Papa=require(_0x0278('0xe'));var Redis=require(_0x0278('0xf'));var authService=require(_0x0278('0x10'));var qs=require(_0x0278('0x11'));var as=require(_0x0278('0x12'));var hardwareService=require(_0x0278('0x13'));var logger=require('../../config/logger')(_0x0278('0x14'));var utils=require(_0x0278('0x15'));var config=require(_0x0278('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0278('0x17'))['db'];config[_0x0278('0x18')]=_[_0x0278('0x19')](config[_0x0278('0x18')],{'host':_0x0278('0x1a'),'port':0x18eb});var socket=require(_0x0278('0x1b'))(new Redis(config['redis']));require(_0x0278('0x1c'))['register'](socket);function respondWithStatusCode(_0x2f509c,_0x30f800){_0x30f800=_0x30f800||0xcc;return function(_0x2db058){if(_0x2db058){return _0x2f509c[_0x0278('0x1d')](_0x30f800);}return _0x2f509c[_0x0278('0x1e')](_0x30f800)[_0x0278('0x1f')]();};}function respondWithResult(_0x4c94cc,_0x5dea6b){_0x5dea6b=_0x5dea6b||0xc8;return function(_0x6389c4){if(_0x6389c4){return _0x4c94cc[_0x0278('0x1e')](_0x5dea6b)[_0x0278('0x20')](_0x6389c4);}};}function respondWithFilteredResult(_0x1dce89,_0x36a2d1){return function(_0xd3e867){if(_0xd3e867){var _0x4945ce=typeof _0x36a2d1[_0x0278('0x21')]==='undefined'&&typeof _0x36a2d1[_0x0278('0x22')]===_0x0278('0x23');var _0x31a90a=_0xd3e867[_0x0278('0x24')];var _0x3a4dce=_0x4945ce?0x0:_0x36a2d1[_0x0278('0x21')];var _0x1be50f=_0x4945ce?_0xd3e867[_0x0278('0x24')]:_0x36a2d1[_0x0278('0x21')]+_0x36a2d1[_0x0278('0x22')];var _0x460192;if(_0x1be50f>=_0x31a90a){_0x1be50f=_0x31a90a;_0x460192=0xc8;}else{_0x460192=0xce;}_0x1dce89[_0x0278('0x1e')](_0x460192);return _0x1dce89[_0x0278('0x25')]('Content-Range',_0x3a4dce+'-'+_0x1be50f+'/'+_0x31a90a)[_0x0278('0x20')](_0xd3e867);}return null;};}function patchUpdates(_0x5f7d89){return function(_0x11b0c7){try{jsonpatch[_0x0278('0x26')](_0x11b0c7,_0x5f7d89,!![]);}catch(_0x24cd12){return BPromise['reject'](_0x24cd12);}return _0x11b0c7[_0x0278('0x27')]();};}function saveUpdates(_0x26921e,_0x54431e){return function(_0x3364f7){if(_0x3364f7){return _0x3364f7['update'](_0x26921e)[_0x0278('0x28')](function(_0x411bc1){return _0x411bc1;});}return null;};}function handleEntityNotFound(_0x4a1b77,_0x2399c5){return function(_0x14fb7c){if(!_0x14fb7c){_0x4a1b77[_0x0278('0x1d')](0x194);}return _0x14fb7c;};}function handleError(_0x6ed609,_0x26825d){_0x26825d=_0x26825d||0x1f4;return function(_0x377256){logger[_0x0278('0x29')](_0x377256[_0x0278('0x2a')]);if(_0x377256['name']){delete _0x377256[_0x0278('0x2b')];}_0x6ed609[_0x0278('0x1e')](_0x26825d)[_0x0278('0x2c')](_0x377256);};}exports[_0x0278('0x2d')]=function(_0x4d6740,_0x2761e0){var _0x25d449={},_0x11d31c={},_0x3ee014={'count':0x0,'rows':[]};var _0x5ddb50=_[_0x0278('0x2e')](db[_0x0278('0x2f')][_0x0278('0x30')],function(_0x4b53c8){return{'name':_0x4b53c8[_0x0278('0x31')],'type':_0x4b53c8[_0x0278('0x32')][_0x0278('0x33')]};});_0x11d31c[_0x0278('0x34')]=_['map'](_0x5ddb50,'name');_0x11d31c[_0x0278('0x35')]=_[_0x0278('0x36')](_0x4d6740[_0x0278('0x35')]);_0x11d31c[_0x0278('0x37')]=_[_0x0278('0x38')](_0x11d31c[_0x0278('0x34')],_0x11d31c['query']);_0x25d449[_0x0278('0x39')]=_[_0x0278('0x38')](_0x11d31c[_0x0278('0x34')],qs['fields'](_0x4d6740[_0x0278('0x35')][_0x0278('0x3a')]));_0x25d449[_0x0278('0x39')]=_0x25d449[_0x0278('0x39')][_0x0278('0x3b')]?_0x25d449[_0x0278('0x39')]:_0x11d31c[_0x0278('0x34')];if(!_0x4d6740['query'][_0x0278('0x3c')]('nolimit')){_0x25d449['limit']=qs['limit'](_0x4d6740[_0x0278('0x35')][_0x0278('0x22')]);_0x25d449[_0x0278('0x21')]=qs[_0x0278('0x21')](_0x4d6740[_0x0278('0x35')]['offset']);}_0x25d449['order']=qs[_0x0278('0x3d')](_0x4d6740[_0x0278('0x35')][_0x0278('0x3d')]);_0x25d449['where']=qs[_0x0278('0x37')](_[_0x0278('0x3e')](_0x4d6740[_0x0278('0x35')],_0x11d31c[_0x0278('0x37')]),_0x5ddb50);if(_0x4d6740[_0x0278('0x35')][_0x0278('0x3f')]){_0x25d449['where']=_[_0x0278('0x40')](_0x25d449[_0x0278('0x41')],{'$or':_[_0x0278('0x2e')](_0x5ddb50,function(_0x49d250){if(_0x49d250[_0x0278('0x32')]!=='VIRTUAL'){var _0xca06d5={};_0xca06d5[_0x49d250['name']]={'$like':'%'+_0x4d6740[_0x0278('0x35')][_0x0278('0x3f')]+'%'};return _0xca06d5;}})});}_0x25d449=_[_0x0278('0x40')]({},_0x25d449,_0x4d6740[_0x0278('0x42')]);var _0x118c23={'where':_0x25d449[_0x0278('0x41')]};return db[_0x0278('0x2f')][_0x0278('0x24')](_0x118c23)['then'](function(_0x1bb95a){_0x3ee014[_0x0278('0x24')]=_0x1bb95a;if(_0x4d6740['query'][_0x0278('0x43')]){_0x25d449[_0x0278('0x44')]=[{'all':!![]}];}return db['Team'][_0x0278('0x45')](_0x25d449);})['then'](function(_0x47ff02){_0x3ee014[_0x0278('0x46')]=_0x47ff02;return _0x3ee014;})[_0x0278('0x28')](respondWithFilteredResult(_0x2761e0,_0x25d449))['catch'](handleError(_0x2761e0,null));};exports[_0x0278('0x47')]=function(_0x3fdda4,_0xb55357){var _0xea64a3={'raw':![],'where':{'id':_0x3fdda4[_0x0278('0x48')]['id']}},_0x465b1b={};_0x465b1b[_0x0278('0x34')]=_[_0x0278('0x36')](db['Team'][_0x0278('0x30')]);_0x465b1b['query']=_['keys'](_0x3fdda4[_0x0278('0x35')]);_0x465b1b[_0x0278('0x37')]=_[_0x0278('0x38')](_0x465b1b[_0x0278('0x34')],_0x465b1b[_0x0278('0x35')]);_0xea64a3[_0x0278('0x39')]=_['intersection'](_0x465b1b[_0x0278('0x34')],qs[_0x0278('0x3a')](_0x3fdda4[_0x0278('0x35')]['fields']));_0xea64a3[_0x0278('0x39')]=_0xea64a3['attributes'][_0x0278('0x3b')]?_0xea64a3[_0x0278('0x39')]:_0x465b1b[_0x0278('0x34')];if(_0x3fdda4['query'][_0x0278('0x43')]){_0xea64a3['include']=[{'all':!![]}];}_0xea64a3=_['merge']({},_0xea64a3,_0x3fdda4[_0x0278('0x42')]);return db[_0x0278('0x2f')][_0x0278('0x49')](_0xea64a3)['then'](handleEntityNotFound(_0xb55357,null))['then'](respondWithResult(_0xb55357,null))[_0x0278('0x4a')](handleError(_0xb55357,null));};exports[_0x0278('0x4b')]=function(_0x5941b0,_0x5ed69a){return db['Team'][_0x0278('0x4b')](_0x5941b0[_0x0278('0x4c')],{})[_0x0278('0x28')](function(_0x31e3bf){var _0x1323b7=_0x5941b0[_0x0278('0x4d')][_0x0278('0x4e')]({'plain':!![]});if(!_0x1323b7)throw new Error(_0x0278('0x4f'));if(_0x1323b7[_0x0278('0x50')]==='user'){var _0x192670=_0x31e3bf[_0x0278('0x4e')]({'plain':!![]});var _0x531571=_0x0278('0x51');return db[_0x0278('0x52')][_0x0278('0x49')]({'where':{'name':_0x531571,'userProfileId':_0x1323b7['userProfileId']},'raw':!![]})[_0x0278('0x28')](function(_0x459e63){if(_0x459e63&&_0x459e63['autoAssociation']===0x0){return db[_0x0278('0x53')][_0x0278('0x4b')]({'name':_0x192670[_0x0278('0x2b')],'resourceId':_0x192670['id'],'type':_0x459e63[_0x0278('0x2b')],'sectionId':_0x459e63['id']},{})['then'](function(){return _0x31e3bf;});}else{return _0x31e3bf;}})[_0x0278('0x4a')](function(_0x133dcf){logger[_0x0278('0x29')](_0x0278('0x54'),_0x133dcf);throw _0x133dcf;});}return _0x31e3bf;})['then'](respondWithResult(_0x5ed69a,0xc9))['catch'](handleError(_0x5ed69a,null));};exports[_0x0278('0x55')]=function(_0x3f6eaa,_0xb7fa58){if(_0x3f6eaa[_0x0278('0x4c')]['id']){delete _0x3f6eaa[_0x0278('0x4c')]['id'];}return db[_0x0278('0x2f')][_0x0278('0x49')]({'where':{'id':_0x3f6eaa[_0x0278('0x48')]['id']}})['then'](handleEntityNotFound(_0xb7fa58,null))['then'](saveUpdates(_0x3f6eaa['body'],null))[_0x0278('0x28')](respondWithResult(_0xb7fa58,null))[_0x0278('0x4a')](handleError(_0xb7fa58,null));};exports[_0x0278('0x56')]=function(_0x1fbef8,_0x4b2ab1){var _0xd89fed=_0x1fbef8[_0x0278('0x48')]['id'];var _0x479654=[];return db[_0x0278('0x57')][_0x0278('0x58')](function(_0x505dc2){var _0x535cad=_0x0278('0x59')+_0xd89fed;return db[_0x0278('0x57')][_0x0278('0x35')](_0x535cad,{'type':db[_0x0278('0x5a')]['QueryTypes'][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2})[_0x0278('0x28')](function(_0xb42cf1){_0x479654=_[_0x0278('0x2e')](_0xb42cf1,function(_0x3ef150){return Number(_0x3ef150[_0x0278('0x5c')]);});})[_0x0278('0x28')](function(){var _0x10c3a5=_0x0278('0x5d')+_0xd89fed;return db[_0x0278('0x57')][_0x0278('0x35')](_0x10c3a5,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})['then'](function(_0x1d6ba5){var _0x15a007=_[_0x0278('0x2e')](_0x1d6ba5,function(_0x8c8bcd){return Number(_0x8c8bcd[_0x0278('0x5f')]);});return db['UserVoiceQueue'][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'VoiceQueueId':{'$in':_0x15a007}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0x1d7c35=_0x0278('0x60')+_0xd89fed;return db[_0x0278('0x57')][_0x0278('0x35')](_0x1d7c35,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')]['SELECT'],'raw':!![],'transaction':_0x505dc2});})['then'](function(_0x26b16d){var _0x25f1d3=_[_0x0278('0x2e')](_0x26b16d,function(_0x143ec9){return Number(_0x143ec9[_0x0278('0x61')]);});return db[_0x0278('0x62')][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'MailQueueId':{'$in':_0x25f1d3}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0x47106f=_0x0278('0x63')+_0xd89fed;return db['sequelize']['query'](_0x47106f,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})[_0x0278('0x28')](function(_0x2cbcf8){var _0x272607=_[_0x0278('0x2e')](_0x2cbcf8,function(_0x28f295){return Number(_0x28f295['SmsQueueId']);});return db[_0x0278('0x64')]['destroy']({'where':{'UserId':{'$in':_0x479654},'SmsQueueId':{'$in':_0x272607}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0xe78ec5=_0x0278('0x65')+_0xd89fed;return db[_0x0278('0x57')][_0x0278('0x35')](_0xe78ec5,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})[_0x0278('0x28')](function(_0x1eaead){var _0xb2821d=_[_0x0278('0x2e')](_0x1eaead,function(_0x7e3219){return Number(_0x7e3219[_0x0278('0x66')]);});return db[_0x0278('0x67')][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'ChatQueueId':{'$in':_0xb2821d}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0x286f1c='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0xd89fed;return db['sequelize'][_0x0278('0x35')](_0x286f1c,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})['then'](function(_0x2f49d1){var _0x3fcef2=_[_0x0278('0x2e')](_0x2f49d1,function(_0x22b865){return Number(_0x22b865[_0x0278('0x68')]);});return db['UserFaxQueue'][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'FaxQueueId':{'$in':_0x3fcef2}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0x15179d=_0x0278('0x69')+_0xd89fed;return db['sequelize'][_0x0278('0x35')](_0x15179d,{'type':db[_0x0278('0x5a')][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})[_0x0278('0x28')](function(_0x4cc76a){var _0xe629d1=_[_0x0278('0x2e')](_0x4cc76a,function(_0x22a567){return Number(_0x22a567[_0x0278('0x6a')]);});return db[_0x0278('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x479654},'OpenchannelQueueId':{'$in':_0xe629d1}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){var _0x44d14c=_0x0278('0x6c')+_0xd89fed;return db[_0x0278('0x57')][_0x0278('0x35')](_0x44d14c,{'type':db['Sequelize'][_0x0278('0x5e')][_0x0278('0x5b')],'raw':!![],'transaction':_0x505dc2});})[_0x0278('0x28')](function(_0x243d80){var _0xb50ec=_['map'](_0x243d80,function(_0x3122a3){return Number(_0x3122a3[_0x0278('0x6d')]);});return db[_0x0278('0x6e')][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'WhatsappQueueId':{'$in':_0xb50ec}},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){return db[_0x0278('0x6f')][_0x0278('0x49')]({'where':{'TeamId':_0xd89fed}});})[_0x0278('0x28')](function(_0x503f7d){if(_0x503f7d===null){return;}return db[_0x0278('0x70')][_0x0278('0x56')]({'where':{'UserId':{'$in':_0x479654},'VoicePrefixId':_0x503f7d[_0x0278('0x71')]},'transaction':_0x505dc2});})[_0x0278('0x28')](function(){return db[_0x0278('0x2f')][_0x0278('0x56')]({'where':{'id':_0xd89fed},'cascade':!![],'transaction':_0x505dc2});})[_0x0278('0x28')](function(_0x5348c3){if(_0x5348c3===0x0){_0x4b2ab1[_0x0278('0x1d')](0x194);}else{return db[_0x0278('0x53')][_0x0278('0x56')]({'where':{'type':_0x0278('0x51'),'resourceId':_0xd89fed},'cascade':!![],'transaction':_0x505dc2})['then'](function(){_0x4b2ab1[_0x0278('0x1e')](0xcc)[_0x0278('0x1f')]();});}})[_0x0278('0x4a')](function(_0x2311e3){_0x4b2ab1[_0x0278('0x1e')](0x1f4)[_0x0278('0x2c')](_0x2311e3);});});};exports[_0x0278('0x72')]=function(_0x32b758,_0x200c85,_0x2b9c0a){return db['Team'][_0x0278('0x73')]({'where':{'id':_0x32b758[_0x0278('0x48')]['id']}})[_0x0278('0x28')](handleEntityNotFound(_0x200c85,null))['then'](function(_0x4697f3){if(!_0x32b758[_0x0278('0x35')]['channel']||!utils[_0x0278('0x74')](_0x32b758[_0x0278('0x35')][_0x0278('0x75')])){throw new db[(_0x0278('0x5a'))][(_0x0278('0x76'))](_0x0278('0x77'));}var _0x37741d={};var _0x39a93e={};_0x39a93e[_0x0278('0x34')]=_[_0x0278('0x36')](db[_['capitalize'](_0x32b758['query']['channel'][_0x0278('0x78')]())+_0x0278('0x79')][_0x0278('0x30')]);_0x39a93e['query']=_[_0x0278('0x36')](_0x32b758[_0x0278('0x35')]);_0x39a93e[_0x0278('0x37')]=_['intersection'](_0x39a93e[_0x0278('0x34')],_0x39a93e[_0x0278('0x35')]);_0x37741d[_0x0278('0x39')]=_['intersection'](_0x39a93e[_0x0278('0x34')],qs[_0x0278('0x3a')](_0x32b758[_0x0278('0x35')]['fields']));_0x37741d[_0x0278('0x39')]=_0x37741d[_0x0278('0x39')][_0x0278('0x3b')]?_0x37741d[_0x0278('0x39')]:_0x39a93e[_0x0278('0x34')];_0x37741d['limit']=qs[_0x0278('0x22')](_0x32b758[_0x0278('0x35')][_0x0278('0x22')]);_0x37741d[_0x0278('0x21')]=qs[_0x0278('0x21')](_0x32b758[_0x0278('0x35')][_0x0278('0x21')]);_0x37741d[_0x0278('0x7a')]=qs[_0x0278('0x3d')](_0x32b758[_0x0278('0x35')][_0x0278('0x3d')]);_0x37741d[_0x0278('0x41')]=qs[_0x0278('0x37')](_[_0x0278('0x3e')](_0x32b758[_0x0278('0x35')],_0x39a93e[_0x0278('0x37')]));_0x37741d=_[_0x0278('0x40')]({},_0x37741d,_0x32b758['options']);return _0x4697f3[_0x0278('0x4e')+_['capitalize'](_0x32b758[_0x0278('0x35')]['channel'][_0x0278('0x78')]())+_0x0278('0x7b')](_0x37741d);})['then'](respondWithResult(_0x200c85,null))[_0x0278('0x4a')](handleError(_0x200c85,null));};exports[_0x0278('0x7c')]=function(_0x4a8cdf,_0x585457,_0x5b47ab){return db[_0x0278('0x2f')][_0x0278('0x73')]({'where':{'id':_0x4a8cdf[_0x0278('0x48')]['id']}})[_0x0278('0x28')](function(_0x1eb441){if(_0x1eb441){if(!_0x4a8cdf[_0x0278('0x4c')]['channel']||!utils[_0x0278('0x74')](_0x4a8cdf[_0x0278('0x4c')][_0x0278('0x75')])){throw new db['Sequelize']['ValidationError'](_0x0278('0x77'));}return _0x1eb441[_0x0278('0x7d')+_['capitalize'](_0x4a8cdf[_0x0278('0x4c')][_0x0278('0x75')][_0x0278('0x78')]())+_0x0278('0x7b')](_0x4a8cdf['body'][_0x0278('0x7e')]);}return null;})[_0x0278('0x28')](handleEntityNotFound(_0x585457,null))[_0x0278('0x28')](respondWithStatusCode(_0x585457,null))[_0x0278('0x4a')](handleError(_0x585457,null));};exports[_0x0278('0x7f')]=function(_0x4ce8aa,_0x5db028,_0x5ed8fd){return db[_0x0278('0x2f')][_0x0278('0x73')]({'where':{'id':_0x4ce8aa[_0x0278('0x48')]['id']}})[_0x0278('0x28')](function(_0x10b228){if(_0x10b228){if(!_0x4ce8aa[_0x0278('0x35')][_0x0278('0x75')]||!utils[_0x0278('0x74')](_0x4ce8aa[_0x0278('0x35')][_0x0278('0x75')])){throw new db['Sequelize'][(_0x0278('0x76'))](_0x0278('0x77'));}return _0x10b228[_0x0278('0x80')+_[_0x0278('0x81')](_0x4ce8aa['query'][_0x0278('0x75')][_0x0278('0x78')]())+_0x0278('0x7b')](_0x4ce8aa['query'][_0x0278('0x7e')]);}return null;})[_0x0278('0x28')](handleEntityNotFound(_0x5db028,null))[_0x0278('0x28')](respondWithStatusCode(_0x5db028,null))[_0x0278('0x4a')](handleError(_0x5db028,null));};exports[_0x0278('0x82')]=function(_0x9c01e9,_0x4e0fec){var _0x34a6c3=_[_0x0278('0x83')](_0x9c01e9['body'][_0x0278('0x7e')])?_0x9c01e9[_0x0278('0x4c')][_0x0278('0x7e')]:[_0x9c01e9[_0x0278('0x4c')][_0x0278('0x7e')]];var _0x5038c7=_0x9c01e9['params']['id'];return db['Team'][_0x0278('0x49')]({'where':{'id':_0x5038c7}})[_0x0278('0x28')](handleEntityNotFound(_0x4e0fec,null))[_0x0278('0x28')](function(_0x8018c8){if(_0x8018c8){var _0x2ae036=[_0x0278('0x84'),_0x0278('0x85'),_0x0278('0x86'),_0x0278('0x87'),'Fax',_0x0278('0x88'),'Whatsapp'];return db[_0x0278('0x57')]['transaction'](function(_0x38995b){var _0x172dd4=_[_0x0278('0x2e')](_0x2ae036,function(_0x113831){var _0x521993={'attributes':['id',_0x0278('0x2b')]};if(_0x113831===_0x0278('0x84')){_0x521993[_0x0278('0x89')]={'attributes':[_0x0278('0x8a')]};}return _0x8018c8[_0x0278('0x4e')+_0x113831+_0x0278('0x7b')](_0x521993)['then'](function(_0x39b3a7){var _0x1fe7ef=_['map'](_0x39b3a7,function(_0xb95fb0){var _0x139bf0=_[_0x0278('0x2e')](_0x34a6c3,function(_0x227981){var _0x534d16={'where':{'UserId':_0x227981,[_0x113831+_0x0278('0x8b')]:_0xb95fb0['id']},'transaction':_0x38995b};if(_0x113831===_0x0278('0x84')){_0x534d16[_0x0278('0x19')]={'penalty':_0xb95fb0[_0x0278('0x8c')]['penalty']};}return db[_0x0278('0x8d')+_0x113831+_0x0278('0x79')]['findOrCreate'](_0x534d16)[_0x0278('0x28')](function(){socket[_0x0278('0x8e')]('user'+_0x113831+_0x0278('0x8f'),{'UserId':_0x227981,[_0x113831+_0x0278('0x8b')]:_0xb95fb0['id']});if(_0x113831!=='Voice'){return;}return db[_0x0278('0x8d')][_0x0278('0x45')]({'where':{'id':_0x34a6c3,'online':0x1},'attributes':['id','name','online',_0x0278('0x90'),_0x0278('0x91')],'raw':!![]})['then'](function(_0x5ab345){var _0x1a95d6=_[_0x0278('0x2e')](_0x5ab345,function(_0xe2cc9d){return db[_0x0278('0x92')]['upsert']({'membername':_0xe2cc9d['name'],'UserId':_0xe2cc9d['id'],'queue_name':_0xb95fb0['name'],'VoiceQueueId':_0xb95fb0['id'],'interface':_[_0x0278('0x93')](_0xe2cc9d['interface'])?util[_0x0278('0x94')](_0x0278('0x95'),_0xe2cc9d[_0x0278('0x2b')]):_0xe2cc9d['interface'],'paused':_0xe2cc9d[_0x0278('0x90')]||![],'penalty':_0xb95fb0[_0x0278('0x8c')]['penalty']},{'transaction':_0x38995b});});return Promise[_0x0278('0x96')](_0x1a95d6);});});});return Promise[_0x0278('0x96')](_0x139bf0);});return Promise[_0x0278('0x96')](_0x1fe7ef);})['then'](function(){return db[_0x0278('0x6f')][_0x0278('0x73')]({'where':{'teamId':_0x5038c7}})[_0x0278('0x28')](function(_0x3667d2){if(_0x3667d2){var _0x22cd20=_['map'](_0x34a6c3,function(_0x1893a4){db[_0x0278('0x70')][_0x0278('0x97')]({'UserId':_0x1893a4,'VoicePrefixId':_0x3667d2[_0x0278('0x71')]});});return Promise[_0x0278('0x96')](_0x22cd20);}});});});return Promise['all'](_0x172dd4)[_0x0278('0x28')](function(){return _0x8018c8[_0x0278('0x82')](_0x34a6c3,{'transaction':_0x38995b})[_0x0278('0x98')](function(_0x36a9c4){return _0x36a9c4;});});});}})['then'](respondWithResult(_0x4e0fec,null))['catch'](handleError(_0x4e0fec,null));};exports[_0x0278('0x99')]=function(_0x57f326,_0x4d470b){var _0x5c56a9=_[_0x0278('0x83')](_0x57f326[_0x0278('0x35')][_0x0278('0x7e')])?_0x57f326[_0x0278('0x35')][_0x0278('0x7e')]:[_0x57f326[_0x0278('0x35')]['ids']];var _0x10087d=_0x57f326['params']['id'];return db[_0x0278('0x2f')][_0x0278('0x49')]({'where':{'id':_0x10087d}})[_0x0278('0x28')](handleEntityNotFound(_0x4d470b,null))[_0x0278('0x28')](function(_0x2fcf94){if(_0x2fcf94){var _0x3da40e=['Voice',_0x0278('0x85'),_0x0278('0x86'),_0x0278('0x87'),'Fax',_0x0278('0x88'),_0x0278('0x9a')];return db[_0x0278('0x57')]['transaction'](function(_0x54b432){var _0x551bc3=_[_0x0278('0x2e')](_0x3da40e,function(_0x41347c){var _0x1ff9bf={'attributes':['id',_0x0278('0x2b')]};return _0x2fcf94[_0x0278('0x4e')+_0x41347c+'Queues'](_0x1ff9bf)[_0x0278('0x28')](function(_0x40b59b){var _0x18f382=_['map'](_0x40b59b,function(_0x2ee40a){return _0x2ee40a[_0x0278('0x99')](_0x5c56a9,{'transaction':_0x54b432})[_0x0278('0x28')](function(){var _0x3ec631=_[_0x0278('0x2e')](_0x5c56a9,function(_0x59b78c){socket['emit'](_0x0278('0x4d')+_0x41347c+_0x0278('0x9b'),{'UserId':Number(_0x59b78c),[_0x41347c+'QueueId']:_0x2ee40a['id']});if(_0x41347c!==_0x0278('0x84')){return;}return db[_0x0278('0x92')]['destroy']({'where':{'VoiceQueueId':_0x2ee40a['id'],'UserId':_0x59b78c},'transaction':_0x54b432});});return Promise['all'](_0x3ec631);});});return Promise[_0x0278('0x96')](_0x18f382);});});return Promise['all'](_0x551bc3)[_0x0278('0x28')](function(){return _0x2fcf94['removeAgents'](_0x5c56a9,{'transaction':_0x54b432});})['then'](function(){return db[_0x0278('0x6f')]['findOne']({'where':{'teamId':_0x10087d}})[_0x0278('0x28')](function(_0x9e5ab4){if(_0x9e5ab4){var _0x1825db=_[_0x0278('0x2e')](_0x5c56a9,function(_0x3e27d2){db[_0x0278('0x70')][_0x0278('0x56')]({'where':{'UserId':_0x3e27d2,'VoicePrefixId':_0x9e5ab4[_0x0278('0x71')]}});});return Promise[_0x0278('0x96')](_0x1825db);}});});});}})[_0x0278('0x28')](respondWithStatusCode(_0x4d470b,null))[_0x0278('0x4a')](handleError(_0x4d470b,null));};exports['getAgents']=function(_0x2eb530,_0x348a9a,_0x5309d7){var _0x12d220={};var _0x3a8513={};var _0x3396bf;var _0x472f2e;return db[_0x0278('0x2f')][_0x0278('0x73')]({'where':{'id':_0x2eb530[_0x0278('0x48')]['id']}})['then'](handleEntityNotFound(_0x348a9a,null))[_0x0278('0x28')](function(_0x32a6c8){if(_0x32a6c8){_0x3396bf=_0x32a6c8;_0x3a8513[_0x0278('0x34')]=_[_0x0278('0x36')](db[_0x0278('0x8d')]['rawAttributes']);_0x3a8513[_0x0278('0x35')]=_[_0x0278('0x36')](_0x2eb530[_0x0278('0x35')]);_0x3a8513[_0x0278('0x37')]=_['intersection'](_0x3a8513[_0x0278('0x34')],_0x3a8513[_0x0278('0x35')]);_0x12d220[_0x0278('0x39')]=_['intersection'](_0x3a8513[_0x0278('0x34')],qs[_0x0278('0x3a')](_0x2eb530[_0x0278('0x35')]['fields']));_0x12d220[_0x0278('0x39')]=_0x12d220['attributes'][_0x0278('0x3b')]?_0x12d220[_0x0278('0x39')]:_0x3a8513['model'];_0x12d220[_0x0278('0x7a')]=qs['sort'](_0x2eb530[_0x0278('0x35')][_0x0278('0x3d')]);_0x12d220['where']=qs[_0x0278('0x37')](_[_0x0278('0x3e')](_0x2eb530[_0x0278('0x35')],_0x3a8513[_0x0278('0x37')]));if(_0x2eb530['query'][_0x0278('0x3f')]){_0x12d220['where']=_[_0x0278('0x40')](_0x12d220[_0x0278('0x41')],{'$or':_[_0x0278('0x2e')](_0x12d220['attributes'],function(_0x4db416){var _0x23db6c={};_0x23db6c[_0x4db416]={'$like':'%'+_0x2eb530[_0x0278('0x35')][_0x0278('0x3f')]+'%'};return _0x23db6c;})});}_0x12d220=_[_0x0278('0x40')]({},_0x12d220,_0x2eb530[_0x0278('0x42')]);return _0x3396bf[_0x0278('0x9c')](_0x12d220);}})[_0x0278('0x28')](function(_0x9ad94e){if(_0x9ad94e){_0x472f2e=_0x9ad94e['length'];if(!_0x2eb530[_0x0278('0x35')]['hasOwnProperty']('nolimit')){_0x12d220['limit']=qs['limit'](_0x2eb530[_0x0278('0x35')][_0x0278('0x22')]);_0x12d220[_0x0278('0x21')]=qs[_0x0278('0x21')](_0x2eb530['query']['offset']);}return _0x3396bf[_0x0278('0x9c')](_0x12d220);}})[_0x0278('0x28')](function(_0x2375c4){if(_0x2375c4){return _0x2375c4?{'count':_0x472f2e,'rows':_0x2375c4}:null;}})[_0x0278('0x28')](respondWithResult(_0x348a9a,null))[_0x0278('0x4a')](handleError(_0x348a9a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 3f58290..9e83386 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 _0x756a=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x37dc21,_0x2bae86){var _0x34dc9e=function(_0x351e38){while(--_0x351e38){_0x37dc21['push'](_0x37dc21['shift']());}};_0x34dc9e(++_0x2bae86);}(_0x756a,0x190));var _0xa756=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x756a[_0x50aa2e];return _0x5e07f0;};'use strict';var EventEmitter=require(_0xa756('0x0'));var Team=require(_0xa756('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xa756('0x2')](0x0);var events={'afterCreate':_0xa756('0x3'),'afterUpdate':_0xa756('0x4'),'afterDestroy':_0xa756('0x5')};function emitEvent(_0x3a24e2){return function(_0x3b2949,_0x5757b6,_0x438b0c){TeamEvents[_0xa756('0x6')](_0x3a24e2+':'+_0x3b2949['id'],_0x3b2949);TeamEvents[_0xa756('0x6')](_0x3a24e2,_0x3b2949);_0x438b0c(null);};}for(var e in events){if(events[_0xa756('0x7')](e)){var event=events[e];Team[_0xa756('0x8')](e,emitEvent(event));}}module[_0xa756('0x9')]=TeamEvents; \ No newline at end of file +var _0x1152=['remove','emit','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x56985a,_0x233dd8){var _0x5da75e=function(_0x5c4d47){while(--_0x5c4d47){_0x56985a['push'](_0x56985a['shift']());}};_0x5da75e(++_0x233dd8);}(_0x1152,0x182));var _0x2115=function(_0x5b4c5d,_0x10026d){_0x5b4c5d=_0x5b4c5d-0x0;var _0x194ef4=_0x1152[_0x5b4c5d];return _0x194ef4;};'use strict';var EventEmitter=require(_0x2115('0x0'));var Team=require(_0x2115('0x1'))['db'][_0x2115('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x2115('0x3')](0x0);var events={'afterCreate':_0x2115('0x4'),'afterUpdate':_0x2115('0x5'),'afterDestroy':_0x2115('0x6')};function emitEvent(_0x3b8dfa){return function(_0x4d0f31,_0x1e8a26,_0x5c17b3){TeamEvents[_0x2115('0x7')](_0x3b8dfa+':'+_0x4d0f31['id'],_0x4d0f31);TeamEvents[_0x2115('0x7')](_0x3b8dfa,_0x4d0f31);_0x5c17b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](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 0c08765..b59b677 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 _0x8cc8=['define','Team','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./team.attributes','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8cc8,0xab));var _0x88cc=function(_0x492063,_0xe743cd){_0x492063=_0x492063-0x0;var _0x5f2c12=_0x8cc8[_0x492063];return _0x5f2c12;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var logger=require(_0x88cc('0x2'))(_0x88cc('0x3'));var moment=require(_0x88cc('0x4'));var BPromise=require(_0x88cc('0x5'));var rp=require(_0x88cc('0x6'));var fs=require('fs');var path=require(_0x88cc('0x7'));var rimraf=require(_0x88cc('0x8'));var config=require('../../config/environment');var attributes=require(_0x88cc('0x9'));module[_0x88cc('0xa')]=function(_0x1e2731,_0x2d4bd4){return _0x1e2731[_0x88cc('0xb')](_0x88cc('0xc'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1a=['exports','define','Team','teams','lodash','../../config/logger','api','bluebird','path','rimraf','./team.attributes'];(function(_0x27ac0,_0x3167bd){var _0x2ec4e8=function(_0x7be48e){while(--_0x7be48e){_0x27ac0['push'](_0x27ac0['shift']());}};_0x2ec4e8(++_0x3167bd);}(_0xed1a,0x1d2));var _0xaed1=function(_0x1878a1,_0x1ead6c){_0x1878a1=_0x1878a1-0x0;var _0x563c42=_0xed1a[_0x1878a1];return _0x563c42;};'use strict';var _=require(_0xaed1('0x0'));var util=require('util');var logger=require(_0xaed1('0x1'))(_0xaed1('0x2'));var moment=require('moment');var BPromise=require(_0xaed1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaed1('0x4'));var rimraf=require(_0xaed1('0x5'));var config=require('../../config/environment');var attributes=require(_0xaed1('0x6'));module[_0xaed1('0x7')]=function(_0x5233ec,_0x54a294){return _0x5233ec[_0xaed1('0x8')](_0xaed1('0x9'),attributes,{'tableName':_0xaed1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 82d3a15..6820732 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 _0x285d=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','then','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x285d,0x92));var _0xd285=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x285d[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd285('0x0'));var util=require(_0xd285('0x1'));var moment=require(_0xd285('0x2'));var BPromise=require(_0xd285('0x3'));var rs=require(_0xd285('0x4'));var fs=require('fs');var Redis=require(_0xd285('0x5'));var db=require(_0xd285('0x6'))['db'];var utils=require(_0xd285('0x7'));var logger=require(_0xd285('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd285('0x9'));var client=jayson[_0xd285('0xa')]['http']({'port':0x232a});config['redis']=_[_0xd285('0xb')](config[_0xd285('0xc')],{'host':_0xd285('0xd'),'port':0x18eb});var socket=require(_0xd285('0xe'))(new Redis(config[_0xd285('0xc')]));require(_0xd285('0xf'))[_0xd285('0x10')](socket);function respondWithRpcPromise(_0x4e3101,_0x1f2705,_0x3ec23c){return new BPromise(function(_0x15570a,_0x5f5516){return client['request'](_0x4e3101,_0x3ec23c)[_0xd285('0x11')](function(_0x39c7ac){logger['info'](_0xd285('0x12'),_0x1f2705,'request\x20sent');logger[_0xd285('0x13')](_0xd285('0x14'),_0x1f2705,_0xd285('0x15'),JSON[_0xd285('0x16')](_0x39c7ac));if(_0x39c7ac['error']){if(_0x39c7ac[_0xd285('0x17')]['code']===0x1f4){logger[_0xd285('0x17')](_0xd285('0x12'),_0x1f2705,_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);return _0x5f5516(_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);}logger['error'](_0xd285('0x12'),_0x1f2705,_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);return _0x15570a(_0x39c7ac[_0xd285('0x17')][_0xd285('0x18')]);}else{logger[_0xd285('0x19')]('Team,\x20%s,\x20%s',_0x1f2705,_0xd285('0x15'));_0x15570a(_0x39c7ac[_0xd285('0x1a')]['message']);}})[_0xd285('0x1b')](function(_0x5a7820){logger[_0xd285('0x17')](_0xd285('0x12'),_0x1f2705,_0x5a7820);_0x5f5516(_0x5a7820);});});} \ No newline at end of file +var _0x5c02=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x589d19,_0x2680dc){var _0x256b32=function(_0x3ff235){while(--_0x3ff235){_0x589d19['push'](_0x589d19['shift']());}};_0x256b32(++_0x2680dc);}(_0x5c02,0x6b));var _0x25c0=function(_0x8ceeba,_0x27ef66){_0x8ceeba=_0x8ceeba-0x0;var _0x3c86d4=_0x5c02[_0x8ceeba];return _0x3c86d4;};'use strict';var _=require('lodash');var util=require(_0x25c0('0x0'));var moment=require(_0x25c0('0x1'));var BPromise=require(_0x25c0('0x2'));var rs=require(_0x25c0('0x3'));var fs=require('fs');var Redis=require(_0x25c0('0x4'));var db=require(_0x25c0('0x5'))['db'];var utils=require(_0x25c0('0x6'));var logger=require(_0x25c0('0x7'))(_0x25c0('0x8'));var config=require(_0x25c0('0x9'));var jayson=require(_0x25c0('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x25c0('0xb')]=_['defaults'](config[_0x25c0('0xb')],{'host':_0x25c0('0xc'),'port':0x18eb});var socket=require(_0x25c0('0xd'))(new Redis(config['redis']));require(_0x25c0('0xe'))[_0x25c0('0xf')](socket);function respondWithRpcPromise(_0x591fb2,_0x256d5d,_0x29ad4c){return new BPromise(function(_0x465121,_0x35cc3d){return client[_0x25c0('0x10')](_0x591fb2,_0x29ad4c)[_0x25c0('0x11')](function(_0x3ec3bf){logger['info'](_0x25c0('0x12'),_0x256d5d,_0x25c0('0x13'));logger[_0x25c0('0x14')](_0x25c0('0x15'),_0x256d5d,_0x25c0('0x13'),JSON[_0x25c0('0x16')](_0x3ec3bf));if(_0x3ec3bf['error']){if(_0x3ec3bf[_0x25c0('0x17')]['code']===0x1f4){logger['error'](_0x25c0('0x12'),_0x256d5d,_0x3ec3bf[_0x25c0('0x17')][_0x25c0('0x18')]);return _0x35cc3d(_0x3ec3bf[_0x25c0('0x17')]['message']);}logger[_0x25c0('0x17')](_0x25c0('0x12'),_0x256d5d,_0x3ec3bf['error'][_0x25c0('0x18')]);return _0x465121(_0x3ec3bf[_0x25c0('0x17')]['message']);}else{logger['info'](_0x25c0('0x12'),_0x256d5d,_0x25c0('0x13'));_0x465121(_0x3ec3bf['result']['message']);}})[_0x25c0('0x19')](function(_0x36ab7e){logger['error'](_0x25c0('0x12'),_0x256d5d,_0x36ab7e);_0x35cc3d(_0x36ab7e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 1c0482e..efb41d0 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 _0x6a73=['./team.events','save','emit','removeListener','length','team:'];(function(_0x146994,_0x559c73){var _0x131ddb=function(_0x30c7bf){while(--_0x30c7bf){_0x146994['push'](_0x146994['shift']());}};_0x131ddb(++_0x559c73);}(_0x6a73,0x174));var _0x36a7=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x6a73[_0x2543d6];return _0x55213c;};'use strict';var TeamEvents=require(_0x36a7('0x0'));var events=[_0x36a7('0x1'),'remove','update'];function createListener(_0x145264,_0x28bbb0){return function(_0x84ddc5){_0x28bbb0[_0x36a7('0x2')](_0x145264,_0x84ddc5);};}function removeListener(_0x8be28c,_0x21ec02){return function(){TeamEvents[_0x36a7('0x3')](_0x8be28c,_0x21ec02);};}exports['register']=function(_0x1f4a48){for(var _0x8561c1=0x0,_0x44816f=events[_0x36a7('0x4')];_0x8561c1<_0x44816f;_0x8561c1++){var _0xfb6903=events[_0x8561c1];var _0x5832ab=createListener(_0x36a7('0x5')+_0xfb6903,_0x1f4a48);TeamEvents['on'](_0xfb6903,_0x5832ab);}}; \ No newline at end of file +var _0x4e94=['save','update','emit','length','team:','./team.events'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x4e94,0x155));var _0x44e9=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0x4e94[_0x4ef734];return _0x33a7cb;};'use strict';var TeamEvents=require(_0x44e9('0x0'));var events=[_0x44e9('0x1'),'remove',_0x44e9('0x2')];function createListener(_0xd34fab,_0x4819b9){return function(_0x588834){_0x4819b9[_0x44e9('0x3')](_0xd34fab,_0x588834);};}function removeListener(_0x589ab3,_0x3a7f9b){return function(){TeamEvents['removeListener'](_0x589ab3,_0x3a7f9b);};}exports['register']=function(_0x4ae4f4){for(var _0x3c2680=0x0,_0x1b9c32=events[_0x44e9('0x4')];_0x3c2680<_0x1b9c32;_0x3c2680++){var _0x55b18a=events[_0x3c2680];var _0xdc9afd=createListener(_0x44e9('0x5')+_0x55b18a,_0x4ae4f4);TeamEvents['on'](_0x55b18a,_0xdc9afd);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 3e478af..569bfd5 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 _0xd57b=['sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd57b,0x1be));var _0xbd57=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xd57b[_0x15cdcb];return _0x37b069;};'use strict';var Sequelize=require(_0xbd57('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbaa8=['INTEGER','sequelize','exports'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbaa8,0x1d2));var _0x8baa=function(_0x17f4f3,_0x2c0af4){_0x17f4f3=_0x17f4f3-0x0;var _0x19b022=_0xbaa8[_0x17f4f3];return _0x19b022;};'use strict';var Sequelize=require(_0x8baa('0x0'));module[_0x8baa('0x1')]={'TeamId':{'type':Sequelize[_0x8baa('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x8baa('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 29a2629..5c1c427 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 _0xde1e=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x34caea,_0x52a020){var _0x11d044=function(_0x5a2df2){while(--_0x5a2df2){_0x34caea['push'](_0x34caea['shift']());}};_0x11d044(++_0x52a020);}(_0xde1e,0x9d));var _0xede1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde1e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var logger=require(_0xede1('0x2'))(_0xede1('0x3'));var moment=require(_0xede1('0x4'));var BPromise=require(_0xede1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xede1('0x6'));var rimraf=require(_0xede1('0x7'));var config=require(_0xede1('0x8'));var attributes=require(_0xede1('0x9'));module[_0xede1('0xa')]=function(_0x3b760f,_0x4e9527){return _0x3b760f[_0xede1('0xb')](_0xede1('0xc'),attributes,{'tableName':_0xede1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b63=['TeamVoicePrefix','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x6a5f9d,_0xd9d5c0){var _0x4e68dc=function(_0x2d2de9){while(--_0x2d2de9){_0x6a5f9d['push'](_0x6a5f9d['shift']());}};_0x4e68dc(++_0xd9d5c0);}(_0x0b63,0xe7));var _0x30b6=function(_0x5c818f,_0x42554b){_0x5c818f=_0x5c818f-0x0;var _0x445b6e=_0x0b63[_0x5c818f];return _0x445b6e;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30b6('0x1'));var moment=require(_0x30b6('0x2'));var BPromise=require(_0x30b6('0x3'));var rp=require(_0x30b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30b6('0x5'));var config=require(_0x30b6('0x6'));var attributes=require(_0x30b6('0x7'));module[_0x30b6('0x8')]=function(_0x2670c6,_0x2fddeb){return _0x2670c6['define'](_0x30b6('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index fc0615d..6ca8b52 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x372e31,_0xc8ab8d){var _0x2295e8=function(_0x27eca0){while(--_0x27eca0){_0x372e31['push'](_0x372e31['shift']());}};_0x2295e8(++_0xc8ab8d);}(_0x70e0,0x17b));var _0x070e=function(_0x2a4cde,_0x4e19ff){_0x2a4cde=_0x2a4cde-0x0;var _0x348ebe=_0x70e0[_0x2a4cde];return _0x348ebe;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5d1d9f,_0x1ef696){var _0x2faa8e=function(_0x13f5ae){while(--_0x13f5ae){_0x5d1d9f['push'](_0x5d1d9f['shift']());}};_0x2faa8e(++_0x1ef696);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a0be293..b7c0688 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 _0x4b28=['INTEGER','sequelize','exports'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x4b28,0x121));var _0x84b2=function(_0x599ef3,_0x2c708f){_0x599ef3=_0x599ef3-0x0;var _0x42867e=_0x4b28[_0x599ef3];return _0x42867e;};'use strict';var Sequelize=require(_0x84b2('0x0'));module[_0x84b2('0x1')]={'penalty':{'type':Sequelize[_0x84b2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xea03=['sequelize','INTEGER'];(function(_0x259063,_0x6274be){var _0x5ecefc=function(_0xb7dd66){while(--_0xb7dd66){_0x259063['push'](_0x259063['shift']());}};_0x5ecefc(++_0x6274be);}(_0xea03,0x1ba));var _0x3ea0=function(_0x1ca8dd,_0x2b2f46){_0x1ca8dd=_0x1ca8dd-0x0;var _0x26e5bf=_0xea03[_0x1ca8dd];return _0x26e5bf;};'use strict';var Sequelize=require(_0x3ea0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3ea0('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 73c251e..046dfd4 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 _0x5ad3=['team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x359ae6,_0x4869aa){var _0x3cb745=function(_0x3dde98){while(--_0x3dde98){_0x359ae6['push'](_0x359ae6['shift']());}};_0x3cb745(++_0x4869aa);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x5ad3[_0x4a8418];return _0x390174;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccdc=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird'];(function(_0x4a8723,_0x1d36e7){var _0x261070=function(_0x2843b7){while(--_0x2843b7){_0x4a8723['push'](_0x4a8723['shift']());}};_0x261070(++_0x1d36e7);}(_0xccdc,0x1c4));var _0xcccd=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xccdc[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0xcccd('0x0'));var util=require(_0xcccd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcccd('0x2'));var BPromise=require(_0xcccd('0x3'));var rp=require(_0xcccd('0x4'));var fs=require('fs');var path=require(_0xcccd('0x5'));var rimraf=require(_0xcccd('0x6'));var config=require(_0xcccd('0x7'));var attributes=require(_0xcccd('0x8'));module[_0xcccd('0x9')]=function(_0x2da46a,_0x18365a){return _0x2da46a['define'](_0xcccd('0xa'),attributes,{'tableName':_0xcccd('0xb'),'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 09d2bb8..e50dfed 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 _0xe81b=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x28b2ab,_0x372517){var _0x2332bf=function(_0x5e277e){while(--_0x5e277e){_0x28b2ab['push'](_0x28b2ab['shift']());}};_0x2332bf(++_0x372517);}(_0xe81b,0xde));var _0xbe81=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xe81b[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xbe81('0x0'));var util=require(_0xbe81('0x1'));var moment=require('moment');var BPromise=require(_0xbe81('0x2'));var rs=require(_0xbe81('0x3'));var fs=require('fs');var Redis=require(_0xbe81('0x4'));var db=require(_0xbe81('0x5'))['db'];var utils=require(_0xbe81('0x6'));var logger=require(_0xbe81('0x7'))(_0xbe81('0x8'));var config=require(_0xbe81('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbe81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29b368,_0x5191fb,_0x4a5662){return new BPromise(function(_0x37fdea,_0x581648){return client[_0xbe81('0xb')](_0x29b368,_0x4a5662)[_0xbe81('0xc')](function(_0xba1b4b){logger['info'](_0xbe81('0xd'),_0x5191fb,_0xbe81('0xe'));logger[_0xbe81('0xf')](_0xbe81('0x10'),_0x5191fb,_0xbe81('0xe'),JSON['stringify'](_0xba1b4b));if(_0xba1b4b['error']){if(_0xba1b4b[_0xbe81('0x11')]['code']===0x1f4){logger[_0xbe81('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5191fb,_0xba1b4b['error']['message']);return _0x581648(_0xba1b4b['error'][_0xbe81('0x12')]);}logger[_0xbe81('0x11')](_0xbe81('0xd'),_0x5191fb,_0xba1b4b['error'][_0xbe81('0x12')]);return _0x37fdea(_0xba1b4b[_0xbe81('0x11')][_0xbe81('0x12')]);}else{logger[_0xbe81('0x13')](_0xbe81('0xd'),_0x5191fb,_0xbe81('0xe'));_0x37fdea(_0xba1b4b[_0xbe81('0x14')][_0xbe81('0x12')]);}})[_0xbe81('0x15')](function(_0x31f879){logger['error'](_0xbe81('0xd'),_0x5191fb,_0x31f879);_0x581648(_0x31f879);});});} \ No newline at end of file +var _0x565c=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x384631,_0x26410b){var _0x5ae2d1=function(_0x2f76b8){while(--_0x2f76b8){_0x384631['push'](_0x384631['shift']());}};_0x5ae2d1(++_0x26410b);}(_0x565c,0x73));var _0xc565=function(_0x5d829b,_0x2b5309){_0x5d829b=_0x5d829b-0x0;var _0x10780b=_0x565c[_0x5d829b];return _0x10780b;};'use strict';var _=require(_0xc565('0x0'));var util=require(_0xc565('0x1'));var moment=require(_0xc565('0x2'));var BPromise=require(_0xc565('0x3'));var rs=require(_0xc565('0x4'));var fs=require('fs');var Redis=require(_0xc565('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc565('0x6'));var config=require(_0xc565('0x7'));var jayson=require(_0xc565('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x226477,_0x4959ff,_0x2d8278){return new BPromise(function(_0x228e36,_0x1c3147){return client[_0xc565('0x9')](_0x226477,_0x2d8278)[_0xc565('0xa')](function(_0x3841c7){logger['info'](_0xc565('0xb'),_0x4959ff,_0xc565('0xc'));logger['debug'](_0xc565('0xd'),_0x4959ff,_0xc565('0xc'),JSON[_0xc565('0xe')](_0x3841c7));if(_0x3841c7[_0xc565('0xf')]){if(_0x3841c7[_0xc565('0xf')][_0xc565('0x10')]===0x1f4){logger[_0xc565('0xf')](_0xc565('0xb'),_0x4959ff,_0x3841c7[_0xc565('0xf')]['message']);return _0x1c3147(_0x3841c7['error']['message']);}logger['error'](_0xc565('0xb'),_0x4959ff,_0x3841c7[_0xc565('0xf')]['message']);return _0x228e36(_0x3841c7[_0xc565('0xf')][_0xc565('0x11')]);}else{logger[_0xc565('0x12')](_0xc565('0xb'),_0x4959ff,_0xc565('0xc'));_0x228e36(_0x3841c7[_0xc565('0x13')][_0xc565('0x11')]);}})[_0xc565('0x14')](function(_0x2818bd){logger[_0xc565('0xf')](_0xc565('0xb'),_0x4959ff,_0x2818bd);_0x1c3147(_0x2818bd);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 35c1931..579f589 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 _0x3445=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./template.controller','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x5c4959,_0x55abe2){var _0x2a4d99=function(_0x16db95){while(--_0x16db95){_0x5c4959['push'](_0x5c4959['shift']());}};_0x2a4d99(++_0x55abe2);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var path=require(_0x5344('0x2'));var timeout=require(_0x5344('0x3'));var express=require(_0x5344('0x4'));var router=express[_0x5344('0x5')]();var fs_extra=require(_0x5344('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5344('0x7'));var controller=require(_0x5344('0x8'));router[_0x5344('0x9')]('/',auth[_0x5344('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5344('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5344('0xc')]);router[_0x5344('0xd')](_0x5344('0xe'),auth['isAuthenticated'](),controller[_0x5344('0xf')]);router[_0x5344('0x10')](_0x5344('0xe'),auth[_0x5344('0xa')](),controller[_0x5344('0x11')]);module[_0x5344('0x12')]=router; \ No newline at end of file +var _0x0447=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','multer'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0x0447,0x8b));var _0x7044=function(_0x8b0efc,_0x1c44fb){_0x8b0efc=_0x8b0efc-0x0;var _0x135945=_0x0447[_0x8b0efc];return _0x135945;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express['Router']();var fs_extra=require(_0x7044('0x5'));var auth=require(_0x7044('0x6'));var interaction=require(_0x7044('0x7'));var config=require(_0x7044('0x8'));var controller=require(_0x7044('0x9'));router[_0x7044('0xa')]('/',auth[_0x7044('0xb')](),controller[_0x7044('0xc')]);router[_0x7044('0xa')]('/:id',auth[_0x7044('0xb')](),controller[_0x7044('0xd')]);router[_0x7044('0xe')]('/',auth[_0x7044('0xb')](),controller['create']);router[_0x7044('0xf')](_0x7044('0x10'),auth['isAuthenticated'](),controller[_0x7044('0x11')]);router[_0x7044('0x12')](_0x7044('0x10'),auth[_0x7044('0xb')](),controller['destroy']);module[_0x7044('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 da6c6a2..a370acb 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 _0x1120=['STRING','TEXT','sequelize','exports'];(function(_0x1acaf5,_0x3ae694){var _0x3d0fd5=function(_0x301e5b){while(--_0x301e5b){_0x1acaf5['push'](_0x1acaf5['shift']());}};_0x3d0fd5(++_0x3ae694);}(_0x1120,0x82));var _0x0112=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1120[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0112('0x0'));module[_0x0112('0x1')]={'name':{'type':Sequelize[_0x0112('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0112('0x3')]}}; \ No newline at end of file +var _0x0f7e=['STRING','sequelize','exports'];(function(_0x1d599e,_0x39804a){var _0x27bdc8=function(_0x5100c7){while(--_0x5100c7){_0x1d599e['push'](_0x1d599e['shift']());}};_0x27bdc8(++_0x39804a);}(_0x0f7e,0xdc));var _0xe0f7=function(_0x59b5aa,_0x3f54d6){_0x59b5aa=_0x59b5aa-0x0;var _0x4395cd=_0x0f7e[_0x59b5aa];return _0x4395cd;};'use strict';var Sequelize=require(_0xe0f7('0x0'));module[_0xe0f7('0x1')]={'name':{'type':Sequelize[_0xe0f7('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 4c3286a..b8c1d00 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 _0xe008=['request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','UserProfileResource','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Template','includeAll','include','findAll','rows','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','userProfileId','autoAssociation','params','eml-format','rimraf','fast-json-patch'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xe008,0xf6));var _0x8e00=function(_0x337740,_0x565d3d){_0x337740=_0x337740-0x0;var _0x54c54c=_0xe008[_0x337740];return _0x54c54c;};'use strict';var emlformat=require(_0x8e00('0x0'));var rimraf=require(_0x8e00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e00('0x2'));var rp=require(_0x8e00('0x3'));var moment=require(_0x8e00('0x4'));var BPromise=require(_0x8e00('0x5'));var Mustache=require('mustache');var util=require(_0x8e00('0x6'));var path=require(_0x8e00('0x7'));var sox=require('sox');var csv=require(_0x8e00('0x8'));var ejs=require(_0x8e00('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e00('0xa'));var squel=require(_0x8e00('0xb'));var crypto=require(_0x8e00('0xc'));var jsforce=require(_0x8e00('0xd'));var deskjs=require(_0x8e00('0xe'));var toCsv=require(_0x8e00('0x8'));var querystring=require(_0x8e00('0xf'));var Papa=require(_0x8e00('0x10'));var Redis=require('ioredis');var authService=require(_0x8e00('0x11'));var qs=require(_0x8e00('0x12'));var as=require(_0x8e00('0x13'));var hardwareService=require(_0x8e00('0x14'));var logger=require('../../config/logger')(_0x8e00('0x15'));var utils=require(_0x8e00('0x16'));var config=require(_0x8e00('0x17'));var licenseUtil=require(_0x8e00('0x18'));var db=require(_0x8e00('0x19'))['db'];function respondWithStatusCode(_0x1d7559,_0x1f415f){_0x1f415f=_0x1f415f||0xcc;return function(_0xd5dd44){if(_0xd5dd44){return _0x1d7559['sendStatus'](_0x1f415f);}return _0x1d7559[_0x8e00('0x1a')](_0x1f415f)[_0x8e00('0x1b')]();};}function respondWithResult(_0x199bb3,_0x3399ba){_0x3399ba=_0x3399ba||0xc8;return function(_0x278c46){if(_0x278c46){return _0x199bb3[_0x8e00('0x1a')](_0x3399ba)[_0x8e00('0x1c')](_0x278c46);}};}function respondWithFilteredResult(_0x18f71c,_0x19cc57){return function(_0x1c358a){if(_0x1c358a){var _0x239cc8=typeof _0x19cc57[_0x8e00('0x1d')]==='undefined'&&typeof _0x19cc57[_0x8e00('0x1e')]===_0x8e00('0x1f');var _0x3c5f65=_0x1c358a[_0x8e00('0x20')];var _0x1a056c=_0x239cc8?0x0:_0x19cc57['offset'];var _0x4d61d3=_0x239cc8?_0x1c358a['count']:_0x19cc57[_0x8e00('0x1d')]+_0x19cc57[_0x8e00('0x1e')];var _0x4e34e1;if(_0x4d61d3>=_0x3c5f65){_0x4d61d3=_0x3c5f65;_0x4e34e1=0xc8;}else{_0x4e34e1=0xce;}_0x18f71c[_0x8e00('0x1a')](_0x4e34e1);return _0x18f71c[_0x8e00('0x21')](_0x8e00('0x22'),_0x1a056c+'-'+_0x4d61d3+'/'+_0x3c5f65)[_0x8e00('0x1c')](_0x1c358a);}return null;};}function patchUpdates(_0x1f2cb9){return function(_0x5d141a){try{jsonpatch[_0x8e00('0x23')](_0x5d141a,_0x1f2cb9,!![]);}catch(_0x4e3797){return BPromise['reject'](_0x4e3797);}return _0x5d141a[_0x8e00('0x24')]();};}function saveUpdates(_0x1a8246,_0x4747fd){return function(_0x251ee1){if(_0x251ee1){return _0x251ee1[_0x8e00('0x25')](_0x1a8246)['then'](function(_0x1dbc3c){return _0x1dbc3c;});}return null;};}function removeEntity(_0x258f04,_0x55cf6c){return function(_0x494305){if(_0x494305){return _0x494305[_0x8e00('0x26')]()['then'](function(){var _0x1a217a=_0x494305['get']({'plain':!![]});var _0x87684d='Templates';return db[_0x8e00('0x27')]['destroy']({'where':{'type':_0x87684d,'resourceId':_0x1a217a['id']}})['then'](function(){return _0x494305;});})[_0x8e00('0x28')](function(){_0x258f04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6e41e8,_0x28071a){return function(_0x48cebc){if(!_0x48cebc){_0x6e41e8[_0x8e00('0x29')](0x194);}return _0x48cebc;};}function handleError(_0x46465b,_0x514aa2){_0x514aa2=_0x514aa2||0x1f4;return function(_0xd6e993){logger[_0x8e00('0x2a')](_0xd6e993[_0x8e00('0x2b')]);if(_0xd6e993[_0x8e00('0x2c')]){delete _0xd6e993['name'];}_0x46465b[_0x8e00('0x1a')](_0x514aa2)['send'](_0xd6e993);};}exports[_0x8e00('0x2d')]=function(_0x648b30,_0x587560){var _0x8aa213={},_0x5de726={},_0x1c7aeb={'count':0x0,'rows':[]};var _0x2da4d5=_[_0x8e00('0x2e')](db['Template'][_0x8e00('0x2f')],function(_0xc731b7){return{'name':_0xc731b7['fieldName'],'type':_0xc731b7[_0x8e00('0x30')][_0x8e00('0x31')]};});_0x5de726[_0x8e00('0x32')]=_['map'](_0x2da4d5,'name');_0x5de726[_0x8e00('0x33')]=_[_0x8e00('0x34')](_0x648b30[_0x8e00('0x33')]);_0x5de726[_0x8e00('0x35')]=_[_0x8e00('0x36')](_0x5de726[_0x8e00('0x32')],_0x5de726[_0x8e00('0x33')]);_0x8aa213[_0x8e00('0x37')]=_[_0x8e00('0x36')](_0x5de726[_0x8e00('0x32')],qs['fields'](_0x648b30[_0x8e00('0x33')][_0x8e00('0x38')]));_0x8aa213[_0x8e00('0x37')]=_0x8aa213[_0x8e00('0x37')][_0x8e00('0x39')]?_0x8aa213[_0x8e00('0x37')]:_0x5de726['model'];if(!_0x648b30[_0x8e00('0x33')][_0x8e00('0x3a')](_0x8e00('0x3b'))){_0x8aa213[_0x8e00('0x1e')]=qs['limit'](_0x648b30[_0x8e00('0x33')][_0x8e00('0x1e')]);_0x8aa213[_0x8e00('0x1d')]=qs['offset'](_0x648b30[_0x8e00('0x33')]['offset']);}_0x8aa213['order']=qs[_0x8e00('0x3c')](_0x648b30[_0x8e00('0x33')][_0x8e00('0x3c')]);_0x8aa213[_0x8e00('0x3d')]=qs[_0x8e00('0x35')](_[_0x8e00('0x3e')](_0x648b30[_0x8e00('0x33')],_0x5de726[_0x8e00('0x35')]),_0x2da4d5);if(_0x648b30[_0x8e00('0x33')]['filter']){_0x8aa213[_0x8e00('0x3d')]=_[_0x8e00('0x3f')](_0x8aa213[_0x8e00('0x3d')],{'$or':_[_0x8e00('0x2e')](_0x2da4d5,function(_0x4d212a){if(_0x4d212a['type']!==_0x8e00('0x40')){var _0x1f33be={};_0x1f33be[_0x4d212a[_0x8e00('0x2c')]]={'$like':'%'+_0x648b30[_0x8e00('0x33')][_0x8e00('0x41')]+'%'};return _0x1f33be;}})});}_0x8aa213=_[_0x8e00('0x3f')]({},_0x8aa213,_0x648b30[_0x8e00('0x42')]);var _0x12f625={'where':_0x8aa213['where']};return db[_0x8e00('0x43')]['count'](_0x12f625)[_0x8e00('0x28')](function(_0x2c935c){_0x1c7aeb[_0x8e00('0x20')]=_0x2c935c;if(_0x648b30[_0x8e00('0x33')][_0x8e00('0x44')]){_0x8aa213[_0x8e00('0x45')]=[{'all':!![]}];}return db[_0x8e00('0x43')][_0x8e00('0x46')](_0x8aa213);})[_0x8e00('0x28')](function(_0x1f04f4){_0x1c7aeb[_0x8e00('0x47')]=_0x1f04f4;return _0x1c7aeb;})[_0x8e00('0x28')](respondWithFilteredResult(_0x587560,_0x8aa213))[_0x8e00('0x48')](handleError(_0x587560,null));};exports['show']=function(_0x2a8673,_0x1cdb38){var _0x118132={'raw':!![],'where':{'id':_0x2a8673['params']['id']}},_0x10fda4={};_0x10fda4[_0x8e00('0x32')]=_[_0x8e00('0x34')](db['Template'][_0x8e00('0x2f')]);_0x10fda4['query']=_[_0x8e00('0x34')](_0x2a8673['query']);_0x10fda4[_0x8e00('0x35')]=_[_0x8e00('0x36')](_0x10fda4[_0x8e00('0x32')],_0x10fda4[_0x8e00('0x33')]);_0x118132[_0x8e00('0x37')]=_['intersection'](_0x10fda4[_0x8e00('0x32')],qs[_0x8e00('0x38')](_0x2a8673[_0x8e00('0x33')][_0x8e00('0x38')]));_0x118132['attributes']=_0x118132[_0x8e00('0x37')][_0x8e00('0x39')]?_0x118132[_0x8e00('0x37')]:_0x10fda4[_0x8e00('0x32')];if(_0x2a8673['query'][_0x8e00('0x44')]){_0x118132[_0x8e00('0x45')]=[{'all':!![]}];}_0x118132=_[_0x8e00('0x3f')]({},_0x118132,_0x2a8673[_0x8e00('0x42')]);return db['Template']['find'](_0x118132)[_0x8e00('0x28')](handleEntityNotFound(_0x1cdb38,null))[_0x8e00('0x28')](respondWithResult(_0x1cdb38,null))[_0x8e00('0x48')](handleError(_0x1cdb38,null));};exports[_0x8e00('0x49')]=function(_0x198342,_0x554e1d){return db[_0x8e00('0x43')]['create'](_0x198342[_0x8e00('0x4a')],{})[_0x8e00('0x28')](function(_0x394245){var _0x3a901a=_0x198342[_0x8e00('0x4b')][_0x8e00('0x4c')]({'plain':!![]});if(!_0x3a901a)throw new Error(_0x8e00('0x4d'));if(_0x3a901a[_0x8e00('0x4e')]==='user'){var _0x30afd6=_0x394245[_0x8e00('0x4c')]({'plain':!![]});var _0x59001e=_0x8e00('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x59001e,'userProfileId':_0x3a901a[_0x8e00('0x50')]},'raw':!![]})[_0x8e00('0x28')](function(_0x57a137){if(_0x57a137&&_0x57a137[_0x8e00('0x51')]===0x0){return db['UserProfileResource'][_0x8e00('0x49')]({'name':_0x30afd6[_0x8e00('0x2c')],'resourceId':_0x30afd6['id'],'type':_0x57a137[_0x8e00('0x2c')],'sectionId':_0x57a137['id']},{})[_0x8e00('0x28')](function(){return _0x394245;});}else{return _0x394245;}})[_0x8e00('0x48')](function(_0x286990){logger[_0x8e00('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286990);throw _0x286990;});}return _0x394245;})[_0x8e00('0x28')](respondWithResult(_0x554e1d,0xc9))[_0x8e00('0x48')](handleError(_0x554e1d,null));};exports['update']=function(_0x2e2da0,_0x7b2a18){if(_0x2e2da0[_0x8e00('0x4a')]['id']){delete _0x2e2da0[_0x8e00('0x4a')]['id'];}return db[_0x8e00('0x43')]['find']({'where':{'id':_0x2e2da0[_0x8e00('0x52')]['id']}})['then'](handleEntityNotFound(_0x7b2a18,null))[_0x8e00('0x28')](saveUpdates(_0x2e2da0['body'],null))[_0x8e00('0x28')](respondWithResult(_0x7b2a18,null))[_0x8e00('0x48')](handleError(_0x7b2a18,null));};exports[_0x8e00('0x26')]=function(_0x491494,_0x26f5b3){return db[_0x8e00('0x43')]['find']({'where':{'id':_0x491494[_0x8e00('0x52')]['id']}})['then'](handleEntityNotFound(_0x26f5b3,null))[_0x8e00('0x28')](removeEntity(_0x26f5b3,null))['catch'](handleError(_0x26f5b3,null));}; \ No newline at end of file +var _0x9b5d=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','type','VIRTUAL','merge','options','Template','includeAll','findAll','rows','catch','keys','filters','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4f384e,_0x51dfee){var _0x1a095b=function(_0x30063e){while(--_0x30063e){_0x4f384e['push'](_0x4f384e['shift']());}};_0x1a095b(++_0x51dfee);}(_0x9b5d,0x125));var _0xd9b5=function(_0x46b87a,_0xaa609a){_0x46b87a=_0x46b87a-0x0;var _0x52d57d=_0x9b5d[_0x46b87a];return _0x52d57d;};'use strict';var emlformat=require(_0xd9b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd9b5('0x1'));var jsonpatch=require(_0xd9b5('0x2'));var rp=require(_0xd9b5('0x3'));var moment=require(_0xd9b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd9b5('0x5'));var util=require(_0xd9b5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd9b5('0x7'));var fs=require('fs');var fs_extra=require(_0xd9b5('0x8'));var _=require('lodash');var squel=require(_0xd9b5('0x9'));var crypto=require(_0xd9b5('0xa'));var jsforce=require(_0xd9b5('0xb'));var deskjs=require(_0xd9b5('0xc'));var toCsv=require(_0xd9b5('0xd'));var querystring=require('querystring');var Papa=require(_0xd9b5('0xe'));var Redis=require('ioredis');var authService=require(_0xd9b5('0xf'));var qs=require(_0xd9b5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b5('0x11'));var logger=require(_0xd9b5('0x12'))(_0xd9b5('0x13'));var utils=require('../../config/utils');var config=require(_0xd9b5('0x14'));var licenseUtil=require(_0xd9b5('0x15'));var db=require(_0xd9b5('0x16'))['db'];function respondWithStatusCode(_0x461804,_0x26b0cf){_0x26b0cf=_0x26b0cf||0xcc;return function(_0x1ba1aa){if(_0x1ba1aa){return _0x461804[_0xd9b5('0x17')](_0x26b0cf);}return _0x461804[_0xd9b5('0x18')](_0x26b0cf)[_0xd9b5('0x19')]();};}function respondWithResult(_0x34d587,_0xcf85af){_0xcf85af=_0xcf85af||0xc8;return function(_0x1fc782){if(_0x1fc782){return _0x34d587[_0xd9b5('0x18')](_0xcf85af)[_0xd9b5('0x1a')](_0x1fc782);}};}function respondWithFilteredResult(_0x2cc7eb,_0x2852ec){return function(_0x1b36d7){if(_0x1b36d7){var _0x42cb8c=typeof _0x2852ec[_0xd9b5('0x1b')]===_0xd9b5('0x1c')&&typeof _0x2852ec[_0xd9b5('0x1d')]===_0xd9b5('0x1c');var _0x98ed3b=_0x1b36d7[_0xd9b5('0x1e')];var _0x5382b4=_0x42cb8c?0x0:_0x2852ec[_0xd9b5('0x1b')];var _0x1f8560=_0x42cb8c?_0x1b36d7[_0xd9b5('0x1e')]:_0x2852ec[_0xd9b5('0x1b')]+_0x2852ec[_0xd9b5('0x1d')];var _0x177dfe;if(_0x1f8560>=_0x98ed3b){_0x1f8560=_0x98ed3b;_0x177dfe=0xc8;}else{_0x177dfe=0xce;}_0x2cc7eb[_0xd9b5('0x18')](_0x177dfe);return _0x2cc7eb['set'](_0xd9b5('0x1f'),_0x5382b4+'-'+_0x1f8560+'/'+_0x98ed3b)['json'](_0x1b36d7);}return null;};}function patchUpdates(_0x50bc40){return function(_0x4f309f){try{jsonpatch[_0xd9b5('0x20')](_0x4f309f,_0x50bc40,!![]);}catch(_0x3c55d5){return BPromise[_0xd9b5('0x21')](_0x3c55d5);}return _0x4f309f[_0xd9b5('0x22')]();};}function saveUpdates(_0x4b694b,_0x4dab29){return function(_0x5c5518){if(_0x5c5518){return _0x5c5518[_0xd9b5('0x23')](_0x4b694b)[_0xd9b5('0x24')](function(_0xc33665){return _0xc33665;});}return null;};}function removeEntity(_0x5d7d20,_0x4b2e0e){return function(_0x525a4c){if(_0x525a4c){return _0x525a4c[_0xd9b5('0x25')]()['then'](function(){var _0x3d2d12=_0x525a4c[_0xd9b5('0x26')]({'plain':!![]});var _0x52ace8=_0xd9b5('0x27');return db[_0xd9b5('0x28')]['destroy']({'where':{'type':_0x52ace8,'resourceId':_0x3d2d12['id']}})['then'](function(){return _0x525a4c;});})['then'](function(){_0x5d7d20[_0xd9b5('0x18')](0xcc)[_0xd9b5('0x19')]();});}};}function handleEntityNotFound(_0x5534d8,_0x3e2c17){return function(_0x5b4dea){if(!_0x5b4dea){_0x5534d8['sendStatus'](0x194);}return _0x5b4dea;};}function handleError(_0x304d6c,_0x39cdbc){_0x39cdbc=_0x39cdbc||0x1f4;return function(_0x4403e8){logger['error'](_0x4403e8[_0xd9b5('0x29')]);if(_0x4403e8[_0xd9b5('0x2a')]){delete _0x4403e8['name'];}_0x304d6c['status'](_0x39cdbc)[_0xd9b5('0x2b')](_0x4403e8);};}exports['index']=function(_0x1b9675,_0x12c59d){var _0x3a6cd9={},_0x13dab4={},_0x29c531={'count':0x0,'rows':[]};var _0x94ba=_[_0xd9b5('0x2c')](db['Template'][_0xd9b5('0x2d')],function(_0x2d083d){return{'name':_0x2d083d[_0xd9b5('0x2e')],'type':_0x2d083d['type'][_0xd9b5('0x2f')]};});_0x13dab4[_0xd9b5('0x30')]=_[_0xd9b5('0x2c')](_0x94ba,'name');_0x13dab4[_0xd9b5('0x31')]=_['keys'](_0x1b9675[_0xd9b5('0x31')]);_0x13dab4['filters']=_[_0xd9b5('0x32')](_0x13dab4[_0xd9b5('0x30')],_0x13dab4[_0xd9b5('0x31')]);_0x3a6cd9[_0xd9b5('0x33')]=_[_0xd9b5('0x32')](_0x13dab4['model'],qs[_0xd9b5('0x34')](_0x1b9675[_0xd9b5('0x31')]['fields']));_0x3a6cd9[_0xd9b5('0x33')]=_0x3a6cd9[_0xd9b5('0x33')][_0xd9b5('0x35')]?_0x3a6cd9['attributes']:_0x13dab4[_0xd9b5('0x30')];if(!_0x1b9675[_0xd9b5('0x31')]['hasOwnProperty'](_0xd9b5('0x36'))){_0x3a6cd9[_0xd9b5('0x1d')]=qs[_0xd9b5('0x1d')](_0x1b9675[_0xd9b5('0x31')][_0xd9b5('0x1d')]);_0x3a6cd9[_0xd9b5('0x1b')]=qs[_0xd9b5('0x1b')](_0x1b9675[_0xd9b5('0x31')][_0xd9b5('0x1b')]);}_0x3a6cd9[_0xd9b5('0x37')]=qs[_0xd9b5('0x38')](_0x1b9675['query'][_0xd9b5('0x38')]);_0x3a6cd9[_0xd9b5('0x39')]=qs['filters'](_['pick'](_0x1b9675[_0xd9b5('0x31')],_0x13dab4['filters']),_0x94ba);if(_0x1b9675[_0xd9b5('0x31')]['filter']){_0x3a6cd9[_0xd9b5('0x39')]=_['merge'](_0x3a6cd9[_0xd9b5('0x39')],{'$or':_['map'](_0x94ba,function(_0x178b5d){if(_0x178b5d[_0xd9b5('0x3a')]!==_0xd9b5('0x3b')){var _0x58419f={};_0x58419f[_0x178b5d[_0xd9b5('0x2a')]]={'$like':'%'+_0x1b9675[_0xd9b5('0x31')]['filter']+'%'};return _0x58419f;}})});}_0x3a6cd9=_[_0xd9b5('0x3c')]({},_0x3a6cd9,_0x1b9675[_0xd9b5('0x3d')]);var _0x153cd7={'where':_0x3a6cd9[_0xd9b5('0x39')]};return db[_0xd9b5('0x3e')][_0xd9b5('0x1e')](_0x153cd7)[_0xd9b5('0x24')](function(_0x5cdb1f){_0x29c531['count']=_0x5cdb1f;if(_0x1b9675[_0xd9b5('0x31')][_0xd9b5('0x3f')]){_0x3a6cd9['include']=[{'all':!![]}];}return db[_0xd9b5('0x3e')][_0xd9b5('0x40')](_0x3a6cd9);})[_0xd9b5('0x24')](function(_0x2d813f){_0x29c531[_0xd9b5('0x41')]=_0x2d813f;return _0x29c531;})[_0xd9b5('0x24')](respondWithFilteredResult(_0x12c59d,_0x3a6cd9))[_0xd9b5('0x42')](handleError(_0x12c59d,null));};exports['show']=function(_0x447d69,_0x258dde){var _0x2aed9f={'raw':!![],'where':{'id':_0x447d69['params']['id']}},_0xea6244={};_0xea6244[_0xd9b5('0x30')]=_[_0xd9b5('0x43')](db['Template'][_0xd9b5('0x2d')]);_0xea6244[_0xd9b5('0x31')]=_[_0xd9b5('0x43')](_0x447d69[_0xd9b5('0x31')]);_0xea6244[_0xd9b5('0x44')]=_[_0xd9b5('0x32')](_0xea6244[_0xd9b5('0x30')],_0xea6244[_0xd9b5('0x31')]);_0x2aed9f['attributes']=_[_0xd9b5('0x32')](_0xea6244[_0xd9b5('0x30')],qs['fields'](_0x447d69['query'][_0xd9b5('0x34')]));_0x2aed9f[_0xd9b5('0x33')]=_0x2aed9f['attributes'][_0xd9b5('0x35')]?_0x2aed9f[_0xd9b5('0x33')]:_0xea6244[_0xd9b5('0x30')];if(_0x447d69[_0xd9b5('0x31')][_0xd9b5('0x3f')]){_0x2aed9f[_0xd9b5('0x45')]=[{'all':!![]}];}_0x2aed9f=_['merge']({},_0x2aed9f,_0x447d69[_0xd9b5('0x3d')]);return db[_0xd9b5('0x3e')]['find'](_0x2aed9f)[_0xd9b5('0x24')](handleEntityNotFound(_0x258dde,null))[_0xd9b5('0x24')](respondWithResult(_0x258dde,null))[_0xd9b5('0x42')](handleError(_0x258dde,null));};exports[_0xd9b5('0x46')]=function(_0x3fccf9,_0x170785){return db[_0xd9b5('0x3e')][_0xd9b5('0x46')](_0x3fccf9[_0xd9b5('0x47')],{})[_0xd9b5('0x24')](function(_0x99f39d){var _0x5f4d9c=_0x3fccf9['user'][_0xd9b5('0x26')]({'plain':!![]});if(!_0x5f4d9c)throw new Error(_0xd9b5('0x48'));if(_0x5f4d9c[_0xd9b5('0x49')]===_0xd9b5('0x4a')){var _0x4543bd=_0x99f39d['get']({'plain':!![]});var _0x5402a8='Templates';return db[_0xd9b5('0x4b')][_0xd9b5('0x4c')]({'where':{'name':_0x5402a8,'userProfileId':_0x5f4d9c[_0xd9b5('0x4d')]},'raw':!![]})['then'](function(_0x319344){if(_0x319344&&_0x319344[_0xd9b5('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4543bd['name'],'resourceId':_0x4543bd['id'],'type':_0x319344[_0xd9b5('0x2a')],'sectionId':_0x319344['id']},{})[_0xd9b5('0x24')](function(){return _0x99f39d;});}else{return _0x99f39d;}})['catch'](function(_0x370a53){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x370a53);throw _0x370a53;});}return _0x99f39d;})['then'](respondWithResult(_0x170785,0xc9))['catch'](handleError(_0x170785,null));};exports['update']=function(_0x19b3a5,_0x51bb69){if(_0x19b3a5[_0xd9b5('0x47')]['id']){delete _0x19b3a5[_0xd9b5('0x47')]['id'];}return db[_0xd9b5('0x3e')][_0xd9b5('0x4c')]({'where':{'id':_0x19b3a5[_0xd9b5('0x4f')]['id']}})[_0xd9b5('0x24')](handleEntityNotFound(_0x51bb69,null))['then'](saveUpdates(_0x19b3a5[_0xd9b5('0x47')],null))['then'](respondWithResult(_0x51bb69,null))['catch'](handleError(_0x51bb69,null));};exports[_0xd9b5('0x25')]=function(_0x593f57,_0x1f40f7){return db['Template']['find']({'where':{'id':_0x593f57[_0xd9b5('0x4f')]['id']}})[_0xd9b5('0x24')](handleEntityNotFound(_0x1f40f7,null))['then'](removeEntity(_0x1f40f7,null))[_0xd9b5('0x42')](handleError(_0x1f40f7,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 01c4fa7..ec49e8f 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 _0x7623=['../../config/environment','./template.attributes','exports','tools_templates','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x7623,0x144));var _0x3762=function(_0x44bcb6,_0x16e9a3){_0x44bcb6=_0x44bcb6-0x0;var _0x49ac0f=_0x7623[_0x44bcb6];return _0x49ac0f;};'use strict';var _=require(_0x3762('0x0'));var util=require('util');var logger=require(_0x3762('0x1'))(_0x3762('0x2'));var moment=require(_0x3762('0x3'));var BPromise=require('bluebird');var rp=require(_0x3762('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3762('0x5'));var config=require(_0x3762('0x6'));var attributes=require(_0x3762('0x7'));module[_0x3762('0x8')]=function(_0x4e5ec6,_0x23a76e){return _0x4e5ec6['define']('Template',attributes,{'tableName':_0x3762('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfef4=['define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xfef4,0xe7));var _0x4fef=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xfef4[_0x3de4f8];return _0x3d81fc;};'use strict';var _=require(_0x4fef('0x0'));var util=require(_0x4fef('0x1'));var logger=require(_0x4fef('0x2'))(_0x4fef('0x3'));var moment=require(_0x4fef('0x4'));var BPromise=require(_0x4fef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fef('0x6'));var rimraf=require('rimraf');var config=require(_0x4fef('0x7'));var attributes=require('./template.attributes');module[_0x4fef('0x8')]=function(_0x2fa222,_0x321e8c){return _0x2fa222[_0x4fef('0x9')](_0x4fef('0xa'),attributes,{'tableName':_0x4fef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 7b00dda..4255100 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 _0x62db=['findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetTemplate','Template'];(function(_0x25ef10,_0x18d17e){var _0x42f748=function(_0x23f7f8){while(--_0x23f7f8){_0x25ef10['push'](_0x25ef10['shift']());}};_0x42f748(++_0x18d17e);}(_0x62db,0x1a2));var _0xb62d=function(_0x48d695,_0xecfd19){_0x48d695=_0x48d695-0x0;var _0x1fe2fd=_0x62db[_0x48d695];return _0x1fe2fd;};'use strict';var _=require(_0xb62d('0x0'));var util=require('util');var moment=require(_0xb62d('0x1'));var BPromise=require(_0xb62d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb62d('0x3'));var db=require(_0xb62d('0x4'))['db'];var utils=require(_0xb62d('0x5'));var logger=require('../../config/logger')(_0xb62d('0x6'));var config=require(_0xb62d('0x7'));var jayson=require(_0xb62d('0x8'));var client=jayson['client'][_0xb62d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b1e53,_0x22173b,_0x23b6d3){return new BPromise(function(_0x5cee9e,_0x3bb685){return client[_0xb62d('0xa')](_0x1b1e53,_0x23b6d3)[_0xb62d('0xb')](function(_0x56a42e){logger['info'](_0xb62d('0xc'),_0x22173b,_0xb62d('0xd'));logger[_0xb62d('0xe')](_0xb62d('0xf'),_0x22173b,_0xb62d('0xd'),JSON[_0xb62d('0x10')](_0x56a42e));if(_0x56a42e['error']){if(_0x56a42e['error'][_0xb62d('0x11')]===0x1f4){logger[_0xb62d('0x12')](_0xb62d('0xc'),_0x22173b,_0x56a42e['error'][_0xb62d('0x13')]);return _0x3bb685(_0x56a42e[_0xb62d('0x12')][_0xb62d('0x13')]);}logger['error'](_0xb62d('0xc'),_0x22173b,_0x56a42e['error'][_0xb62d('0x13')]);return _0x5cee9e(_0x56a42e['error'][_0xb62d('0x13')]);}else{logger[_0xb62d('0x14')](_0xb62d('0xc'),_0x22173b,'request\x20sent');_0x5cee9e(_0x56a42e[_0xb62d('0x15')][_0xb62d('0x13')]);}})['catch'](function(_0x39140e){logger[_0xb62d('0x12')]('Template,\x20%s,\x20%s',_0x22173b,_0x39140e);_0x3bb685(_0x39140e);});});}exports[_0xb62d('0x16')]=function(_0x1180db){var _0x984d9e=this;return new Promise(function(_0x227901,_0x50d5a3){return db[_0xb62d('0x17')][_0xb62d('0x18')]({'raw':_0x1180db[_0xb62d('0x19')]?_0x1180db[_0xb62d('0x19')][_0xb62d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1180db[_0xb62d('0x19')]?_0x1180db['options'][_0xb62d('0x1b')]||null:null,'attributes':_0x1180db['options']?_0x1180db[_0xb62d('0x19')][_0xb62d('0x1c')]||null:null,'limit':_0x1180db[_0xb62d('0x19')]?_0x1180db[_0xb62d('0x19')][_0xb62d('0x1d')]||null:null,'include':_0x1180db['options']?_0x1180db['options'][_0xb62d('0x1e')]?_[_0xb62d('0x1f')](_0x1180db[_0xb62d('0x19')][_0xb62d('0x1e')],function(_0x1b905d){return{'model':db[_0x1b905d[_0xb62d('0x20')]],'as':_0x1b905d['as'],'attributes':_0x1b905d[_0xb62d('0x1c')],'include':_0x1b905d['include']?_[_0xb62d('0x1f')](_0x1b905d['include'],function(_0x4f402d){return{'model':db[_0x4f402d['model']],'as':_0x4f402d['as'],'attributes':_0x4f402d['attributes'],'include':_0x4f402d[_0xb62d('0x1e')]?_[_0xb62d('0x1f')](_0x4f402d[_0xb62d('0x1e')],function(_0x1db6ed){return{'model':db[_0x1db6ed['model']],'as':_0x1db6ed['as'],'attributes':_0x1db6ed[_0xb62d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb62d('0xb')](function(_0x19c14d){logger['info']('GetTemplate',_0x1180db);logger[_0xb62d('0xe')]('GetTemplate',_0x1180db,JSON[_0xb62d('0x10')](_0x19c14d));_0x227901(_0x19c14d);})[_0xb62d('0x21')](function(_0x2e9405){logger['error'](_0xb62d('0x16'),_0x2e9405[_0xb62d('0x13')],_0x1180db);_0x50d5a3(_0x984d9e[_0xb62d('0x12')](0x1f4,_0x2e9405['message']));});});}; \ No newline at end of file +var _0xa095=['then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xa095,0x7c));var _0x5a09=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xa095[_0x1b3a5c];return _0x2ae8cb;};'use strict';var _=require(_0x5a09('0x0'));var util=require(_0x5a09('0x1'));var moment=require('moment');var BPromise=require(_0x5a09('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a09('0x3'));var db=require(_0x5a09('0x4'))['db'];var utils=require(_0x5a09('0x5'));var logger=require(_0x5a09('0x6'))('rpc');var config=require(_0x5a09('0x7'));var jayson=require(_0x5a09('0x8'));var client=jayson[_0x5a09('0x9')][_0x5a09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb5d8,_0x57be25,_0x55017e){return new BPromise(function(_0x570f6e,_0xdb1aad){return client[_0x5a09('0xb')](_0x1fb5d8,_0x55017e)[_0x5a09('0xc')](function(_0x305724){logger[_0x5a09('0xd')](_0x5a09('0xe'),_0x57be25,_0x5a09('0xf'));logger[_0x5a09('0x10')](_0x5a09('0x11'),_0x57be25,_0x5a09('0xf'),JSON[_0x5a09('0x12')](_0x305724));if(_0x305724[_0x5a09('0x13')]){if(_0x305724['error'][_0x5a09('0x14')]===0x1f4){logger[_0x5a09('0x13')](_0x5a09('0xe'),_0x57be25,_0x305724['error'][_0x5a09('0x15')]);return _0xdb1aad(_0x305724['error'][_0x5a09('0x15')]);}logger[_0x5a09('0x13')](_0x5a09('0xe'),_0x57be25,_0x305724[_0x5a09('0x13')][_0x5a09('0x15')]);return _0x570f6e(_0x305724['error'][_0x5a09('0x15')]);}else{logger[_0x5a09('0xd')](_0x5a09('0xe'),_0x57be25,_0x5a09('0xf'));_0x570f6e(_0x305724[_0x5a09('0x16')][_0x5a09('0x15')]);}})[_0x5a09('0x17')](function(_0x477977){logger[_0x5a09('0x13')]('Template,\x20%s,\x20%s',_0x57be25,_0x477977);_0xdb1aad(_0x477977);});});}exports[_0x5a09('0x18')]=function(_0x49bc76){var _0xa9e1f1=this;return new Promise(function(_0x13970c,_0x3ed9e4){return db[_0x5a09('0x19')][_0x5a09('0x1a')]({'raw':_0x49bc76[_0x5a09('0x1b')]?_0x49bc76[_0x5a09('0x1b')][_0x5a09('0x1c')]===undefined?!![]:![]:!![],'where':_0x49bc76[_0x5a09('0x1b')]?_0x49bc76['options']['where']||null:null,'attributes':_0x49bc76['options']?_0x49bc76['options'][_0x5a09('0x1d')]||null:null,'limit':_0x49bc76['options']?_0x49bc76['options'][_0x5a09('0x1e')]||null:null,'include':_0x49bc76['options']?_0x49bc76[_0x5a09('0x1b')][_0x5a09('0x1f')]?_[_0x5a09('0x20')](_0x49bc76[_0x5a09('0x1b')][_0x5a09('0x1f')],function(_0x116ef0){return{'model':db[_0x116ef0[_0x5a09('0x21')]],'as':_0x116ef0['as'],'attributes':_0x116ef0[_0x5a09('0x1d')],'include':_0x116ef0[_0x5a09('0x1f')]?_[_0x5a09('0x20')](_0x116ef0[_0x5a09('0x1f')],function(_0x542d97){return{'model':db[_0x542d97[_0x5a09('0x21')]],'as':_0x542d97['as'],'attributes':_0x542d97[_0x5a09('0x1d')],'include':_0x542d97[_0x5a09('0x1f')]?_['map'](_0x542d97[_0x5a09('0x1f')],function(_0x5a6e20){return{'model':db[_0x5a6e20[_0x5a09('0x21')]],'as':_0x5a6e20['as'],'attributes':_0x5a6e20[_0x5a09('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5a09('0xc')](function(_0x1269f1){logger[_0x5a09('0xd')](_0x5a09('0x18'),_0x49bc76);logger[_0x5a09('0x10')](_0x5a09('0x18'),_0x49bc76,JSON[_0x5a09('0x12')](_0x1269f1));_0x13970c(_0x1269f1);})[_0x5a09('0x17')](function(_0x55d773){logger[_0x5a09('0x13')](_0x5a09('0x18'),_0x55d773[_0x5a09('0x15')],_0x49bc76);_0x3ed9e4(_0xa9e1f1[_0x5a09('0x13')](0x1f4,_0x55d773[_0x5a09('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 22f54a5..bdbfe03 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 _0xca21=['post','addAllCondition','addAction','put','/:id','update','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions'];(function(_0x5d31ee,_0x183e43){var _0x21c2e6=function(_0x176343){while(--_0x176343){_0x5d31ee['push'](_0x5d31ee['shift']());}};_0x21c2e6(++_0x183e43);}(_0xca21,0xcf));var _0x1ca2=function(_0x2e8823,_0x494a1d){_0x2e8823=_0x2e8823-0x0;var _0x29b0d7=_0xca21[_0x2e8823];return _0x29b0d7;};'use strict';var multer=require(_0x1ca2('0x0'));var util=require(_0x1ca2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ca2('0x2'));var router=express[_0x1ca2('0x3')]();var fs_extra=require(_0x1ca2('0x4'));var auth=require(_0x1ca2('0x5'));var interaction=require(_0x1ca2('0x6'));var config=require(_0x1ca2('0x7'));var controller=require(_0x1ca2('0x8'));router[_0x1ca2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1ca2('0x9')]('/:id',auth[_0x1ca2('0xa')](),controller[_0x1ca2('0xb')]);router['get'](_0x1ca2('0xc'),auth['isAuthenticated'](),controller[_0x1ca2('0xd')]);router[_0x1ca2('0x9')](_0x1ca2('0xe'),auth[_0x1ca2('0xa')](),controller[_0x1ca2('0xf')]);router['get'](_0x1ca2('0x10'),auth['isAuthenticated'](),controller[_0x1ca2('0x11')]);router['post']('/',auth[_0x1ca2('0xa')](),controller['create']);router[_0x1ca2('0x12')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x1ca2('0x13')]);router[_0x1ca2('0x12')](_0x1ca2('0xe'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x1ca2('0x12')](_0x1ca2('0x10'),auth['isAuthenticated'](),controller[_0x1ca2('0x14')]);router[_0x1ca2('0x15')](_0x1ca2('0x16'),auth[_0x1ca2('0xa')](),controller[_0x1ca2('0x17')]);router['delete'](_0x1ca2('0x16'),auth['isAuthenticated'](),controller[_0x1ca2('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa095=['../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAnyCondition','addAction','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4d5256,_0x43fef3){var _0x41a18c=function(_0x5dcae7){while(--_0x5dcae7){_0x4d5256['push'](_0x4d5256['shift']());}};_0x41a18c(++_0x43fef3);}(_0xa095,0x7c));var _0x5a09=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0xa095[_0x49ca6b];return _0x1d957f;};'use strict';var multer=require(_0x5a09('0x0'));var util=require(_0x5a09('0x1'));var path=require('path');var timeout=require(_0x5a09('0x2'));var express=require('express');var router=express[_0x5a09('0x3')]();var fs_extra=require(_0x5a09('0x4'));var auth=require(_0x5a09('0x5'));var interaction=require(_0x5a09('0x6'));var config=require('../../config/environment');var controller=require(_0x5a09('0x7'));router[_0x5a09('0x8')]('/',auth[_0x5a09('0x9')](),controller[_0x5a09('0xa')]);router[_0x5a09('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5a09('0x8')](_0x5a09('0xb'),auth[_0x5a09('0x9')](),controller[_0x5a09('0xc')]);router[_0x5a09('0x8')](_0x5a09('0xd'),auth[_0x5a09('0x9')](),controller[_0x5a09('0xe')]);router[_0x5a09('0x8')](_0x5a09('0xf'),auth[_0x5a09('0x9')](),controller[_0x5a09('0x10')]);router['post']('/',auth[_0x5a09('0x9')](),controller[_0x5a09('0x11')]);router[_0x5a09('0x12')]('/:id/all_conditions',auth[_0x5a09('0x9')](),controller['addAllCondition']);router[_0x5a09('0x12')](_0x5a09('0xd'),auth[_0x5a09('0x9')](),controller[_0x5a09('0x13')]);router[_0x5a09('0x12')]('/:id/actions',auth[_0x5a09('0x9')](),controller[_0x5a09('0x14')]);router[_0x5a09('0x15')](_0x5a09('0x16'),auth[_0x5a09('0x9')](),controller[_0x5a09('0x17')]);router[_0x5a09('0x18')](_0x5a09('0x16'),auth[_0x5a09('0x9')](),controller['destroy']);module[_0x5a09('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 9f163cc..c211365 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 _0xe816=['STRING','BOOLEAN','sequelize','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe816,0x126));var _0x6e81=function(_0x3caa1d,_0x51acd2){_0x3caa1d=_0x3caa1d-0x0;var _0x597187=_0xe816[_0x3caa1d];return _0x597187;};'use strict';var Sequelize=require(_0x6e81('0x0'));module[_0x6e81('0x1')]={'name':{'type':Sequelize[_0x6e81('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e81('0x2')]},'status':{'type':Sequelize[_0x6e81('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe9d8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5050e2,_0x39a686){var _0x193709=function(_0x99492){while(--_0x99492){_0x5050e2['push'](_0x5050e2['shift']());}};_0x193709(++_0x39a686);}(_0xe9d8,0x175));var _0x8e9d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe9d8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x8e9d('0x0'));module[_0x8e9d('0x1')]={'name':{'type':Sequelize[_0x8e9d('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e9d('0x2')]},'status':{'type':Sequelize[_0x8e9d('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 4d1f30e..1c9c983 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 _0xe363=['error','params','addAllCondition','TriggerAllId','create','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','Triggers','UserProfileResource','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe363,0x13c));var _0x3e36=function(_0xbb0a3c,_0x28ae78){_0xbb0a3c=_0xbb0a3c-0x0;var _0x3c39ff=_0xe363[_0xbb0a3c];return _0x3c39ff;};'use strict';var emlformat=require(_0x3e36('0x0'));var rimraf=require(_0x3e36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3e36('0x2'));var moment=require(_0x3e36('0x3'));var BPromise=require(_0x3e36('0x4'));var Mustache=require(_0x3e36('0x5'));var util=require(_0x3e36('0x6'));var path=require(_0x3e36('0x7'));var sox=require(_0x3e36('0x8'));var csv=require(_0x3e36('0x9'));var ejs=require(_0x3e36('0xa'));var fs=require('fs');var fs_extra=require(_0x3e36('0xb'));var _=require(_0x3e36('0xc'));var squel=require(_0x3e36('0xd'));var crypto=require(_0x3e36('0xe'));var jsforce=require(_0x3e36('0xf'));var deskjs=require(_0x3e36('0x10'));var toCsv=require(_0x3e36('0x9'));var querystring=require(_0x3e36('0x11'));var Papa=require('papaparse');var Redis=require(_0x3e36('0x12'));var authService=require(_0x3e36('0x13'));var qs=require(_0x3e36('0x14'));var as=require(_0x3e36('0x15'));var hardwareService=require(_0x3e36('0x16'));var logger=require(_0x3e36('0x17'))(_0x3e36('0x18'));var utils=require(_0x3e36('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3e36('0x1a'));var db=require(_0x3e36('0x1b'))['db'];function respondWithStatusCode(_0x4161cf,_0x6cfb66){_0x6cfb66=_0x6cfb66||0xcc;return function(_0x5d8152){if(_0x5d8152){return _0x4161cf[_0x3e36('0x1c')](_0x6cfb66);}return _0x4161cf[_0x3e36('0x1d')](_0x6cfb66)[_0x3e36('0x1e')]();};}function respondWithResult(_0x3eafc3,_0x51c8e9){_0x51c8e9=_0x51c8e9||0xc8;return function(_0x35a88a){if(_0x35a88a){return _0x3eafc3[_0x3e36('0x1d')](_0x51c8e9)[_0x3e36('0x1f')](_0x35a88a);}};}function respondWithFilteredResult(_0x1f4be9,_0x186ec0){return function(_0x3993bf){if(_0x3993bf){var _0x654fb1=typeof _0x186ec0[_0x3e36('0x20')]===_0x3e36('0x21')&&typeof _0x186ec0[_0x3e36('0x22')]===_0x3e36('0x21');var _0xb58af1=_0x3993bf[_0x3e36('0x23')];var _0x230648=_0x654fb1?0x0:_0x186ec0[_0x3e36('0x20')];var _0x4a7e60=_0x654fb1?_0x3993bf['count']:_0x186ec0['offset']+_0x186ec0['limit'];var _0x1a7f7c;if(_0x4a7e60>=_0xb58af1){_0x4a7e60=_0xb58af1;_0x1a7f7c=0xc8;}else{_0x1a7f7c=0xce;}_0x1f4be9['status'](_0x1a7f7c);return _0x1f4be9[_0x3e36('0x24')]('Content-Range',_0x230648+'-'+_0x4a7e60+'/'+_0xb58af1)[_0x3e36('0x1f')](_0x3993bf);}return null;};}function patchUpdates(_0x461b04){return function(_0x2fa5b1){try{jsonpatch['apply'](_0x2fa5b1,_0x461b04,!![]);}catch(_0x5cda8e){return BPromise['reject'](_0x5cda8e);}return _0x2fa5b1[_0x3e36('0x25')]();};}function saveUpdates(_0x330085,_0x34f35c){return function(_0x523368){if(_0x523368){return _0x523368[_0x3e36('0x26')](_0x330085)[_0x3e36('0x27')](function(_0x138d97){return _0x138d97;});}return null;};}function removeEntity(_0x4b5037,_0x98a3fe){return function(_0xd8a17d){if(_0xd8a17d){return _0xd8a17d[_0x3e36('0x28')]()[_0x3e36('0x27')](function(){var _0x4ee6ef=_0xd8a17d[_0x3e36('0x29')]({'plain':!![]});var _0x18e5b1=_0x3e36('0x2a');return db[_0x3e36('0x2b')][_0x3e36('0x28')]({'where':{'type':_0x18e5b1,'resourceId':_0x4ee6ef['id']}})['then'](function(){return _0xd8a17d;});})[_0x3e36('0x27')](function(){_0x4b5037[_0x3e36('0x1d')](0xcc)[_0x3e36('0x1e')]();});}};}function handleEntityNotFound(_0x5456bd,_0x2dbe31){return function(_0x5b21dd){if(!_0x5b21dd){_0x5456bd[_0x3e36('0x1c')](0x194);}return _0x5b21dd;};}function handleError(_0x229c89,_0x293dd0){_0x293dd0=_0x293dd0||0x1f4;return function(_0x39eb51){logger['error'](_0x39eb51['stack']);if(_0x39eb51['name']){delete _0x39eb51[_0x3e36('0x2c')];}_0x229c89['status'](_0x293dd0)[_0x3e36('0x2d')](_0x39eb51);};}exports[_0x3e36('0x2e')]=function(_0x11d737,_0x31ad73){var _0x1aa372={},_0x3fd85f={},_0x323a08={'count':0x0,'rows':[]};var _0x203ed4=_[_0x3e36('0x2f')](db[_0x3e36('0x30')][_0x3e36('0x31')],function(_0x209b0f){return{'name':_0x209b0f[_0x3e36('0x32')],'type':_0x209b0f[_0x3e36('0x33')][_0x3e36('0x34')]};});_0x3fd85f[_0x3e36('0x35')]=_[_0x3e36('0x2f')](_0x203ed4,_0x3e36('0x2c'));_0x3fd85f[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x11d737[_0x3e36('0x36')]);_0x3fd85f['filters']=_[_0x3e36('0x38')](_0x3fd85f[_0x3e36('0x35')],_0x3fd85f[_0x3e36('0x36')]);_0x1aa372[_0x3e36('0x39')]=_['intersection'](_0x3fd85f[_0x3e36('0x35')],qs[_0x3e36('0x3a')](_0x11d737[_0x3e36('0x36')][_0x3e36('0x3a')]));_0x1aa372[_0x3e36('0x39')]=_0x1aa372[_0x3e36('0x39')][_0x3e36('0x3b')]?_0x1aa372[_0x3e36('0x39')]:_0x3fd85f['model'];if(!_0x11d737['query'][_0x3e36('0x3c')]('nolimit')){_0x1aa372['limit']=qs[_0x3e36('0x22')](_0x11d737['query']['limit']);_0x1aa372[_0x3e36('0x20')]=qs[_0x3e36('0x20')](_0x11d737[_0x3e36('0x36')][_0x3e36('0x20')]);}_0x1aa372[_0x3e36('0x3d')]=qs['sort'](_0x11d737[_0x3e36('0x36')][_0x3e36('0x3e')]);_0x1aa372[_0x3e36('0x3f')]=qs[_0x3e36('0x40')](_[_0x3e36('0x41')](_0x11d737[_0x3e36('0x36')],_0x3fd85f[_0x3e36('0x40')]),_0x203ed4);if(_0x11d737['query'][_0x3e36('0x42')]){_0x1aa372[_0x3e36('0x3f')]=_[_0x3e36('0x43')](_0x1aa372[_0x3e36('0x3f')],{'$or':_['map'](_0x203ed4,function(_0x50d248){if(_0x50d248[_0x3e36('0x33')]!==_0x3e36('0x44')){var _0x45c475={};_0x45c475[_0x50d248['name']]={'$like':'%'+_0x11d737['query'][_0x3e36('0x42')]+'%'};return _0x45c475;}})});}_0x1aa372=_[_0x3e36('0x43')]({},_0x1aa372,_0x11d737[_0x3e36('0x45')]);var _0x2416dc={'where':_0x1aa372[_0x3e36('0x3f')]};return db[_0x3e36('0x30')]['count'](_0x2416dc)[_0x3e36('0x27')](function(_0x1d77c0){_0x323a08[_0x3e36('0x23')]=_0x1d77c0;if(_0x11d737[_0x3e36('0x36')][_0x3e36('0x46')]){_0x1aa372[_0x3e36('0x47')]=[{'all':!![]}];}return db['Trigger'][_0x3e36('0x48')](_0x1aa372);})[_0x3e36('0x27')](function(_0x25a6f2){_0x323a08[_0x3e36('0x49')]=_0x25a6f2;return _0x323a08;})[_0x3e36('0x27')](respondWithFilteredResult(_0x31ad73,_0x1aa372))[_0x3e36('0x4a')](handleError(_0x31ad73,null));};exports[_0x3e36('0x4b')]=function(_0x221a5b,_0x22d422){var _0x33acc2={'raw':![],'where':{'id':_0x221a5b['params']['id']}},_0x38bf3f={};_0x38bf3f['model']=_[_0x3e36('0x37')](db['Trigger']['rawAttributes']);_0x38bf3f[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x221a5b['query']);_0x38bf3f['filters']=_[_0x3e36('0x38')](_0x38bf3f['model'],_0x38bf3f[_0x3e36('0x36')]);_0x33acc2[_0x3e36('0x39')]=_[_0x3e36('0x38')](_0x38bf3f[_0x3e36('0x35')],qs[_0x3e36('0x3a')](_0x221a5b['query'][_0x3e36('0x3a')]));_0x33acc2['attributes']=_0x33acc2[_0x3e36('0x39')][_0x3e36('0x3b')]?_0x33acc2[_0x3e36('0x39')]:_0x38bf3f[_0x3e36('0x35')];if(_0x221a5b[_0x3e36('0x36')]['includeAll']){_0x33acc2['include']=[{'all':!![]}];}_0x33acc2=_[_0x3e36('0x43')]({},_0x33acc2,_0x221a5b[_0x3e36('0x45')]);return db[_0x3e36('0x30')][_0x3e36('0x4c')](_0x33acc2)['then'](handleEntityNotFound(_0x22d422,null))[_0x3e36('0x27')](respondWithResult(_0x22d422,null))['catch'](handleError(_0x22d422,null));};exports['create']=function(_0x12dd0f,_0x25dfad){return db[_0x3e36('0x30')]['create'](_0x12dd0f[_0x3e36('0x4d')],{})[_0x3e36('0x27')](function(_0x57122d){var _0x1a6cce=_0x12dd0f['user'][_0x3e36('0x29')]({'plain':!![]});if(!_0x1a6cce)throw new Error(_0x3e36('0x4e'));if(_0x1a6cce[_0x3e36('0x4f')]===_0x3e36('0x50')){var _0x5b81ec=_0x57122d[_0x3e36('0x29')]({'plain':!![]});var _0x34d87b=_0x3e36('0x2a');return db[_0x3e36('0x51')]['find']({'where':{'name':_0x34d87b,'userProfileId':_0x1a6cce[_0x3e36('0x52')]},'raw':!![]})['then'](function(_0x1f905e){if(_0x1f905e&&_0x1f905e[_0x3e36('0x53')]===0x0){return db[_0x3e36('0x2b')]['create']({'name':_0x5b81ec['name'],'resourceId':_0x5b81ec['id'],'type':_0x1f905e['name'],'sectionId':_0x1f905e['id']},{})['then'](function(){return _0x57122d;});}else{return _0x57122d;}})[_0x3e36('0x4a')](function(_0x36509e){logger[_0x3e36('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36509e);throw _0x36509e;});}return _0x57122d;})[_0x3e36('0x27')](respondWithResult(_0x25dfad,0xc9))[_0x3e36('0x4a')](handleError(_0x25dfad,null));};exports['update']=function(_0x3f28b0,_0x6a6bb4){if(_0x3f28b0[_0x3e36('0x4d')]['id']){delete _0x3f28b0[_0x3e36('0x4d')]['id'];}return db[_0x3e36('0x30')][_0x3e36('0x4c')]({'where':{'id':_0x3f28b0[_0x3e36('0x55')]['id']}})['then'](handleEntityNotFound(_0x6a6bb4,null))[_0x3e36('0x27')](saveUpdates(_0x3f28b0[_0x3e36('0x4d')],null))['then'](respondWithResult(_0x6a6bb4,null))[_0x3e36('0x4a')](handleError(_0x6a6bb4,null));};exports['destroy']=function(_0x58ab78,_0x39c84e){return db['Trigger']['find']({'where':{'id':_0x58ab78['params']['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0x39c84e,null))[_0x3e36('0x27')](removeEntity(_0x39c84e,null))[_0x3e36('0x4a')](handleError(_0x39c84e,null));};exports[_0x3e36('0x56')]=function(_0x2a5584,_0x3007ab,_0x2fc00b){if(_0x2a5584[_0x3e36('0x4d')]['id']){delete _0x2a5584[_0x3e36('0x4d')]['id'];}return db['Trigger'][_0x3e36('0x4c')]({'where':{'id':_0x2a5584['params']['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0x3007ab,null))['then'](function(_0x485c56){if(_0x485c56){_0x2a5584[_0x3e36('0x4d')][_0x3e36('0x57')]=_0x485c56['id'];return db['Condition'][_0x3e36('0x58')](_0x2a5584[_0x3e36('0x4d')]);}})['then'](respondWithResult(_0x3007ab,null))[_0x3e36('0x4a')](handleError(_0x3007ab,null));};exports[_0x3e36('0x59')]=function(_0x388adc,_0x395308,_0x5d65a9){if(_0x388adc[_0x3e36('0x4d')]['id']){delete _0x388adc[_0x3e36('0x4d')]['id'];}return db['Trigger'][_0x3e36('0x4c')]({'where':{'id':_0x388adc[_0x3e36('0x55')]['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0x395308,null))['then'](function(_0x294de3){if(_0x294de3){_0x388adc[_0x3e36('0x4d')][_0x3e36('0x5a')]=_0x294de3['id'];return db[_0x3e36('0x5b')][_0x3e36('0x58')](_0x388adc[_0x3e36('0x4d')]);}})[_0x3e36('0x27')](respondWithResult(_0x395308,null))[_0x3e36('0x4a')](handleError(_0x395308,null));};exports[_0x3e36('0x5c')]=function(_0x498e06,_0x12bff3,_0x368c76){var _0x3af37e={};var _0x3c41e7={};var _0x1828a4;var _0xb189ed;return db[_0x3e36('0x30')][_0x3e36('0x5d')]({'where':{'id':_0x498e06[_0x3e36('0x55')]['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0x12bff3,null))[_0x3e36('0x27')](function(_0x899e88){if(_0x899e88){_0x1828a4=_0x899e88;_0x3c41e7['model']=_[_0x3e36('0x37')](db[_0x3e36('0x5b')][_0x3e36('0x31')]);_0x3c41e7[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x498e06[_0x3e36('0x36')]);_0x3c41e7[_0x3e36('0x40')]=_[_0x3e36('0x38')](_0x3c41e7[_0x3e36('0x35')],_0x3c41e7[_0x3e36('0x36')]);_0x3af37e[_0x3e36('0x39')]=_['intersection'](_0x3c41e7[_0x3e36('0x35')],qs[_0x3e36('0x3a')](_0x498e06['query']['fields']));_0x3af37e[_0x3e36('0x39')]=_0x3af37e[_0x3e36('0x39')]['length']?_0x3af37e[_0x3e36('0x39')]:_0x3c41e7[_0x3e36('0x35')];_0x3af37e[_0x3e36('0x3d')]=qs['sort'](_0x498e06[_0x3e36('0x36')]['sort']);_0x3af37e['where']=qs[_0x3e36('0x40')](_['pick'](_0x498e06[_0x3e36('0x36')],_0x3c41e7[_0x3e36('0x40')]));if(_0x498e06[_0x3e36('0x36')][_0x3e36('0x42')]){_0x3af37e[_0x3e36('0x3f')]=_[_0x3e36('0x43')](_0x3af37e[_0x3e36('0x3f')],{'$or':_[_0x3e36('0x2f')](_0x3af37e['attributes'],function(_0x5a184f){var _0x4b6483={};_0x4b6483[_0x5a184f]={'$like':'%'+_0x498e06['query']['filter']+'%'};return _0x4b6483;})});}_0x3af37e=_[_0x3e36('0x43')]({},_0x3af37e,_0x498e06[_0x3e36('0x45')]);return _0x1828a4['getAllConditions'](_0x3af37e);}})[_0x3e36('0x27')](function(_0x10568c){if(_0x10568c){_0xb189ed=_0x10568c[_0x3e36('0x3b')];if(!_0x498e06['query'][_0x3e36('0x3c')](_0x3e36('0x5e'))){_0x3af37e['limit']=qs[_0x3e36('0x22')](_0x498e06[_0x3e36('0x36')][_0x3e36('0x22')]);_0x3af37e['offset']=qs[_0x3e36('0x20')](_0x498e06[_0x3e36('0x36')]['offset']);}return _0x1828a4[_0x3e36('0x5c')](_0x3af37e);}})[_0x3e36('0x27')](function(_0x4e8548){if(_0x4e8548){return _0x4e8548?{'count':_0xb189ed,'rows':_0x4e8548}:null;}})[_0x3e36('0x27')](respondWithResult(_0x12bff3,null))['catch'](handleError(_0x12bff3,null));};exports['getAnyConditions']=function(_0x41ffda,_0xe30bb0,_0x2a3863){var _0x457824={};var _0x2696df={};var _0x46d304;var _0x45615a;return db[_0x3e36('0x30')][_0x3e36('0x5d')]({'where':{'id':_0x41ffda[_0x3e36('0x55')]['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0xe30bb0,null))[_0x3e36('0x27')](function(_0x5dcac4){if(_0x5dcac4){_0x46d304=_0x5dcac4;_0x2696df[_0x3e36('0x35')]=_[_0x3e36('0x37')](db[_0x3e36('0x5b')]['rawAttributes']);_0x2696df[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x41ffda['query']);_0x2696df[_0x3e36('0x40')]=_[_0x3e36('0x38')](_0x2696df[_0x3e36('0x35')],_0x2696df[_0x3e36('0x36')]);_0x457824[_0x3e36('0x39')]=_[_0x3e36('0x38')](_0x2696df['model'],qs['fields'](_0x41ffda[_0x3e36('0x36')]['fields']));_0x457824[_0x3e36('0x39')]=_0x457824[_0x3e36('0x39')]['length']?_0x457824[_0x3e36('0x39')]:_0x2696df[_0x3e36('0x35')];_0x457824['order']=qs[_0x3e36('0x3e')](_0x41ffda[_0x3e36('0x36')][_0x3e36('0x3e')]);_0x457824['where']=qs[_0x3e36('0x40')](_[_0x3e36('0x41')](_0x41ffda[_0x3e36('0x36')],_0x2696df['filters']));if(_0x41ffda['query'][_0x3e36('0x42')]){_0x457824[_0x3e36('0x3f')]=_[_0x3e36('0x43')](_0x457824[_0x3e36('0x3f')],{'$or':_['map'](_0x457824[_0x3e36('0x39')],function(_0x290192){var _0x2db027={};_0x2db027[_0x290192]={'$like':'%'+_0x41ffda[_0x3e36('0x36')][_0x3e36('0x42')]+'%'};return _0x2db027;})});}_0x457824=_[_0x3e36('0x43')]({},_0x457824,_0x41ffda[_0x3e36('0x45')]);return _0x46d304[_0x3e36('0x5f')](_0x457824);}})[_0x3e36('0x27')](function(_0xd6d6d9){if(_0xd6d6d9){_0x45615a=_0xd6d6d9[_0x3e36('0x3b')];if(!_0x41ffda[_0x3e36('0x36')][_0x3e36('0x3c')]('nolimit')){_0x457824['limit']=qs[_0x3e36('0x22')](_0x41ffda[_0x3e36('0x36')][_0x3e36('0x22')]);_0x457824[_0x3e36('0x20')]=qs[_0x3e36('0x20')](_0x41ffda[_0x3e36('0x36')][_0x3e36('0x20')]);}return _0x46d304[_0x3e36('0x5f')](_0x457824);}})['then'](function(_0xf60326){if(_0xf60326){return _0xf60326?{'count':_0x45615a,'rows':_0xf60326}:null;}})[_0x3e36('0x27')](respondWithResult(_0xe30bb0,null))[_0x3e36('0x4a')](handleError(_0xe30bb0,null));};exports[_0x3e36('0x60')]=function(_0x40ee33,_0x4003e2,_0x4894ea){if(_0x40ee33[_0x3e36('0x4d')]['id']){delete _0x40ee33[_0x3e36('0x4d')]['id'];}return db[_0x3e36('0x30')][_0x3e36('0x4c')]({'where':{'id':_0x40ee33[_0x3e36('0x55')]['id']}})['then'](handleEntityNotFound(_0x4003e2,null))[_0x3e36('0x27')](function(_0x5e2c1b){if(_0x5e2c1b){_0x40ee33[_0x3e36('0x4d')][_0x3e36('0x61')]=_0x5e2c1b['id'];return db[_0x3e36('0x62')][_0x3e36('0x58')](_0x40ee33[_0x3e36('0x4d')]);}})[_0x3e36('0x27')](respondWithResult(_0x4003e2,null))[_0x3e36('0x4a')](handleError(_0x4003e2,null));};exports[_0x3e36('0x63')]=function(_0x2f11f7,_0xdf81aa,_0x359739){var _0x4f374f={};var _0x47c3d2={};var _0x5b5332;var _0x5c438a;return db[_0x3e36('0x30')]['findOne']({'where':{'id':_0x2f11f7['params']['id']}})[_0x3e36('0x27')](handleEntityNotFound(_0xdf81aa,null))[_0x3e36('0x27')](function(_0x755710){if(_0x755710){_0x5b5332=_0x755710;_0x47c3d2['model']=_['keys'](db['Action']['rawAttributes']);_0x47c3d2[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x2f11f7[_0x3e36('0x36')]);_0x47c3d2[_0x3e36('0x40')]=_[_0x3e36('0x38')](_0x47c3d2['model'],_0x47c3d2['query']);_0x4f374f[_0x3e36('0x39')]=_[_0x3e36('0x38')](_0x47c3d2[_0x3e36('0x35')],qs[_0x3e36('0x3a')](_0x2f11f7['query']['fields']));_0x4f374f[_0x3e36('0x39')]=_0x4f374f[_0x3e36('0x39')][_0x3e36('0x3b')]?_0x4f374f['attributes']:_0x47c3d2[_0x3e36('0x35')];_0x4f374f[_0x3e36('0x3d')]=qs[_0x3e36('0x3e')](_0x2f11f7[_0x3e36('0x36')]['sort']);_0x4f374f[_0x3e36('0x3f')]=qs[_0x3e36('0x40')](_['pick'](_0x2f11f7['query'],_0x47c3d2[_0x3e36('0x40')]));if(_0x2f11f7[_0x3e36('0x36')][_0x3e36('0x42')]){_0x4f374f[_0x3e36('0x3f')]=_[_0x3e36('0x43')](_0x4f374f[_0x3e36('0x3f')],{'$or':_[_0x3e36('0x2f')](_0x4f374f[_0x3e36('0x39')],function(_0x301418){var _0x3c4a3b={};_0x3c4a3b[_0x301418]={'$like':'%'+_0x2f11f7[_0x3e36('0x36')]['filter']+'%'};return _0x3c4a3b;})});}_0x4f374f=_[_0x3e36('0x43')]({},_0x4f374f,_0x2f11f7['options']);return _0x5b5332['getActions'](_0x4f374f);}})[_0x3e36('0x27')](function(_0x198849){if(_0x198849){_0x5c438a=_0x198849[_0x3e36('0x3b')];if(!_0x2f11f7[_0x3e36('0x36')][_0x3e36('0x3c')](_0x3e36('0x5e'))){_0x4f374f[_0x3e36('0x22')]=qs[_0x3e36('0x22')](_0x2f11f7[_0x3e36('0x36')]['limit']);_0x4f374f[_0x3e36('0x20')]=qs['offset'](_0x2f11f7[_0x3e36('0x36')][_0x3e36('0x20')]);}return _0x5b5332['getActions'](_0x4f374f);}})[_0x3e36('0x27')](function(_0x55e43b){if(_0x55e43b){return _0x55e43b?{'count':_0x5c438a,'rows':_0x55e43b}:null;}})[_0x3e36('0x27')](respondWithResult(_0xdf81aa,null))['catch'](handleError(_0xdf81aa,null));}; \ No newline at end of file +var _0xabbb=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','nolimit','addAction','getActions','Action','eml-format'];(function(_0x1843f9,_0x5db77a){var _0x3a6df1=function(_0x35fcb5){while(--_0x35fcb5){_0x1843f9['push'](_0x1843f9['shift']());}};_0x3a6df1(++_0x5db77a);}(_0xabbb,0x12e));var _0xbabb=function(_0x492770,_0x58de34){_0x492770=_0x492770-0x0;var _0x358826=_0xabbb[_0x492770];return _0x358826;};'use strict';var emlformat=require(_0xbabb('0x0'));var rimraf=require(_0xbabb('0x1'));var zipdir=require(_0xbabb('0x2'));var jsonpatch=require(_0xbabb('0x3'));var rp=require(_0xbabb('0x4'));var moment=require(_0xbabb('0x5'));var BPromise=require(_0xbabb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbabb('0x7'));var sox=require(_0xbabb('0x8'));var csv=require(_0xbabb('0x9'));var ejs=require(_0xbabb('0xa'));var fs=require('fs');var fs_extra=require(_0xbabb('0xb'));var _=require(_0xbabb('0xc'));var squel=require(_0xbabb('0xd'));var crypto=require(_0xbabb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbabb('0xf'));var toCsv=require(_0xbabb('0x9'));var querystring=require(_0xbabb('0x10'));var Papa=require(_0xbabb('0x11'));var Redis=require(_0xbabb('0x12'));var authService=require(_0xbabb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbabb('0x14'));var hardwareService=require(_0xbabb('0x15'));var logger=require('../../config/logger')(_0xbabb('0x16'));var utils=require(_0xbabb('0x17'));var config=require(_0xbabb('0x18'));var licenseUtil=require(_0xbabb('0x19'));var db=require(_0xbabb('0x1a'))['db'];function respondWithStatusCode(_0x240ea4,_0x504f3c){_0x504f3c=_0x504f3c||0xcc;return function(_0x171a07){if(_0x171a07){return _0x240ea4[_0xbabb('0x1b')](_0x504f3c);}return _0x240ea4[_0xbabb('0x1c')](_0x504f3c)[_0xbabb('0x1d')]();};}function respondWithResult(_0x3adcef,_0x466a29){_0x466a29=_0x466a29||0xc8;return function(_0x755502){if(_0x755502){return _0x3adcef[_0xbabb('0x1c')](_0x466a29)[_0xbabb('0x1e')](_0x755502);}};}function respondWithFilteredResult(_0xa2c261,_0x38cd43){return function(_0x99aefa){if(_0x99aefa){var _0x266879=typeof _0x38cd43[_0xbabb('0x1f')]===_0xbabb('0x20')&&typeof _0x38cd43['limit']===_0xbabb('0x20');var _0x20d05d=_0x99aefa[_0xbabb('0x21')];var _0x21aaa5=_0x266879?0x0:_0x38cd43[_0xbabb('0x1f')];var _0x3fc52b=_0x266879?_0x99aefa['count']:_0x38cd43[_0xbabb('0x1f')]+_0x38cd43[_0xbabb('0x22')];var _0x57c3b9;if(_0x3fc52b>=_0x20d05d){_0x3fc52b=_0x20d05d;_0x57c3b9=0xc8;}else{_0x57c3b9=0xce;}_0xa2c261['status'](_0x57c3b9);return _0xa2c261[_0xbabb('0x23')](_0xbabb('0x24'),_0x21aaa5+'-'+_0x3fc52b+'/'+_0x20d05d)[_0xbabb('0x1e')](_0x99aefa);}return null;};}function patchUpdates(_0xa6b2f6){return function(_0x509912){try{jsonpatch[_0xbabb('0x25')](_0x509912,_0xa6b2f6,!![]);}catch(_0x4b1a7d){return BPromise[_0xbabb('0x26')](_0x4b1a7d);}return _0x509912[_0xbabb('0x27')]();};}function saveUpdates(_0xde628a,_0x281bec){return function(_0x4fb11e){if(_0x4fb11e){return _0x4fb11e['update'](_0xde628a)['then'](function(_0x3086a3){return _0x3086a3;});}return null;};}function removeEntity(_0x1fd5de,_0x594705){return function(_0x38aad9){if(_0x38aad9){return _0x38aad9[_0xbabb('0x28')]()[_0xbabb('0x29')](function(){var _0xbe60aa=_0x38aad9[_0xbabb('0x2a')]({'plain':!![]});var _0x57b380=_0xbabb('0x2b');return db[_0xbabb('0x2c')][_0xbabb('0x28')]({'where':{'type':_0x57b380,'resourceId':_0xbe60aa['id']}})[_0xbabb('0x29')](function(){return _0x38aad9;});})['then'](function(){_0x1fd5de[_0xbabb('0x1c')](0xcc)[_0xbabb('0x1d')]();});}};}function handleEntityNotFound(_0x2b35c5,_0x13d3af){return function(_0x59a711){if(!_0x59a711){_0x2b35c5[_0xbabb('0x1b')](0x194);}return _0x59a711;};}function handleError(_0x3f9450,_0xd0a5e5){_0xd0a5e5=_0xd0a5e5||0x1f4;return function(_0x1cdd10){logger[_0xbabb('0x2d')](_0x1cdd10[_0xbabb('0x2e')]);if(_0x1cdd10[_0xbabb('0x2f')]){delete _0x1cdd10[_0xbabb('0x2f')];}_0x3f9450[_0xbabb('0x1c')](_0xd0a5e5)[_0xbabb('0x30')](_0x1cdd10);};}exports['index']=function(_0x5f1e31,_0x2a3087){var _0x5c702f={},_0x2f5080={},_0x437011={'count':0x0,'rows':[]};var _0x33ecc6=_[_0xbabb('0x31')](db['Trigger'][_0xbabb('0x32')],function(_0x3d8943){return{'name':_0x3d8943[_0xbabb('0x33')],'type':_0x3d8943[_0xbabb('0x34')][_0xbabb('0x35')]};});_0x2f5080[_0xbabb('0x36')]=_[_0xbabb('0x31')](_0x33ecc6,_0xbabb('0x2f'));_0x2f5080['query']=_[_0xbabb('0x37')](_0x5f1e31[_0xbabb('0x38')]);_0x2f5080['filters']=_[_0xbabb('0x39')](_0x2f5080[_0xbabb('0x36')],_0x2f5080[_0xbabb('0x38')]);_0x5c702f['attributes']=_[_0xbabb('0x39')](_0x2f5080[_0xbabb('0x36')],qs[_0xbabb('0x3a')](_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x3a')]));_0x5c702f[_0xbabb('0x3b')]=_0x5c702f[_0xbabb('0x3b')][_0xbabb('0x3c')]?_0x5c702f[_0xbabb('0x3b')]:_0x2f5080[_0xbabb('0x36')];if(!_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x3d')]('nolimit')){_0x5c702f['limit']=qs[_0xbabb('0x22')](_0x5f1e31['query'][_0xbabb('0x22')]);_0x5c702f[_0xbabb('0x1f')]=qs[_0xbabb('0x1f')](_0x5f1e31['query'][_0xbabb('0x1f')]);}_0x5c702f[_0xbabb('0x3e')]=qs[_0xbabb('0x3f')](_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x3f')]);_0x5c702f['where']=qs[_0xbabb('0x40')](_[_0xbabb('0x41')](_0x5f1e31['query'],_0x2f5080[_0xbabb('0x40')]),_0x33ecc6);if(_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x42')]){_0x5c702f['where']=_[_0xbabb('0x43')](_0x5c702f[_0xbabb('0x44')],{'$or':_[_0xbabb('0x31')](_0x33ecc6,function(_0x4fef6a){if(_0x4fef6a[_0xbabb('0x34')]!==_0xbabb('0x45')){var _0x2395a3={};_0x2395a3[_0x4fef6a[_0xbabb('0x2f')]]={'$like':'%'+_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x42')]+'%'};return _0x2395a3;}})});}_0x5c702f=_['merge']({},_0x5c702f,_0x5f1e31[_0xbabb('0x46')]);var _0x4eef4b={'where':_0x5c702f['where']};return db[_0xbabb('0x47')][_0xbabb('0x21')](_0x4eef4b)[_0xbabb('0x29')](function(_0x2b8b13){_0x437011[_0xbabb('0x21')]=_0x2b8b13;if(_0x5f1e31[_0xbabb('0x38')][_0xbabb('0x48')]){_0x5c702f[_0xbabb('0x49')]=[{'all':!![]}];}return db[_0xbabb('0x47')][_0xbabb('0x4a')](_0x5c702f);})[_0xbabb('0x29')](function(_0x13d058){_0x437011[_0xbabb('0x4b')]=_0x13d058;return _0x437011;})['then'](respondWithFilteredResult(_0x2a3087,_0x5c702f))[_0xbabb('0x4c')](handleError(_0x2a3087,null));};exports[_0xbabb('0x4d')]=function(_0x25e093,_0x57a5ba){var _0x44cec8={'raw':![],'where':{'id':_0x25e093[_0xbabb('0x4e')]['id']}},_0x15cad6={};_0x15cad6[_0xbabb('0x36')]=_[_0xbabb('0x37')](db[_0xbabb('0x47')][_0xbabb('0x32')]);_0x15cad6[_0xbabb('0x38')]=_['keys'](_0x25e093[_0xbabb('0x38')]);_0x15cad6[_0xbabb('0x40')]=_[_0xbabb('0x39')](_0x15cad6['model'],_0x15cad6[_0xbabb('0x38')]);_0x44cec8[_0xbabb('0x3b')]=_[_0xbabb('0x39')](_0x15cad6['model'],qs[_0xbabb('0x3a')](_0x25e093[_0xbabb('0x38')][_0xbabb('0x3a')]));_0x44cec8[_0xbabb('0x3b')]=_0x44cec8[_0xbabb('0x3b')]['length']?_0x44cec8['attributes']:_0x15cad6['model'];if(_0x25e093[_0xbabb('0x38')][_0xbabb('0x48')]){_0x44cec8[_0xbabb('0x49')]=[{'all':!![]}];}_0x44cec8=_[_0xbabb('0x43')]({},_0x44cec8,_0x25e093[_0xbabb('0x46')]);return db[_0xbabb('0x47')][_0xbabb('0x4f')](_0x44cec8)[_0xbabb('0x29')](handleEntityNotFound(_0x57a5ba,null))['then'](respondWithResult(_0x57a5ba,null))[_0xbabb('0x4c')](handleError(_0x57a5ba,null));};exports[_0xbabb('0x50')]=function(_0x496f26,_0x5b6eaf){return db['Trigger'][_0xbabb('0x50')](_0x496f26[_0xbabb('0x51')],{})[_0xbabb('0x29')](function(_0x37a4cb){var _0x32ebfd=_0x496f26[_0xbabb('0x52')][_0xbabb('0x2a')]({'plain':!![]});if(!_0x32ebfd)throw new Error(_0xbabb('0x53'));if(_0x32ebfd[_0xbabb('0x54')]===_0xbabb('0x52')){var _0x1eb351=_0x37a4cb[_0xbabb('0x2a')]({'plain':!![]});var _0x260959='Triggers';return db[_0xbabb('0x55')]['find']({'where':{'name':_0x260959,'userProfileId':_0x32ebfd[_0xbabb('0x56')]},'raw':!![]})['then'](function(_0x41278d){if(_0x41278d&&_0x41278d[_0xbabb('0x57')]===0x0){return db[_0xbabb('0x2c')]['create']({'name':_0x1eb351[_0xbabb('0x2f')],'resourceId':_0x1eb351['id'],'type':_0x41278d[_0xbabb('0x2f')],'sectionId':_0x41278d['id']},{})[_0xbabb('0x29')](function(){return _0x37a4cb;});}else{return _0x37a4cb;}})[_0xbabb('0x4c')](function(_0x4b6f18){logger['error'](_0xbabb('0x58'),_0x4b6f18);throw _0x4b6f18;});}return _0x37a4cb;})[_0xbabb('0x29')](respondWithResult(_0x5b6eaf,0xc9))[_0xbabb('0x4c')](handleError(_0x5b6eaf,null));};exports[_0xbabb('0x59')]=function(_0x25f1dd,_0x3573a4){if(_0x25f1dd[_0xbabb('0x51')]['id']){delete _0x25f1dd[_0xbabb('0x51')]['id'];}return db['Trigger']['find']({'where':{'id':_0x25f1dd['params']['id']}})['then'](handleEntityNotFound(_0x3573a4,null))[_0xbabb('0x29')](saveUpdates(_0x25f1dd[_0xbabb('0x51')],null))[_0xbabb('0x29')](respondWithResult(_0x3573a4,null))[_0xbabb('0x4c')](handleError(_0x3573a4,null));};exports[_0xbabb('0x28')]=function(_0x128374,_0x114bee){return db[_0xbabb('0x47')][_0xbabb('0x4f')]({'where':{'id':_0x128374[_0xbabb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x114bee,null))[_0xbabb('0x29')](removeEntity(_0x114bee,null))['catch'](handleError(_0x114bee,null));};exports['addAllCondition']=function(_0x11536a,_0x3079cf,_0x5509f4){if(_0x11536a[_0xbabb('0x51')]['id']){delete _0x11536a['body']['id'];}return db[_0xbabb('0x47')][_0xbabb('0x4f')]({'where':{'id':_0x11536a[_0xbabb('0x4e')]['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x3079cf,null))[_0xbabb('0x29')](function(_0x4f009c){if(_0x4f009c){_0x11536a['body'][_0xbabb('0x5a')]=_0x4f009c['id'];return db[_0xbabb('0x5b')][_0xbabb('0x50')](_0x11536a[_0xbabb('0x51')]);}})['then'](respondWithResult(_0x3079cf,null))['catch'](handleError(_0x3079cf,null));};exports[_0xbabb('0x5c')]=function(_0x37614f,_0x40b07a,_0x10941c){if(_0x37614f[_0xbabb('0x51')]['id']){delete _0x37614f[_0xbabb('0x51')]['id'];}return db[_0xbabb('0x47')]['find']({'where':{'id':_0x37614f[_0xbabb('0x4e')]['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x40b07a,null))[_0xbabb('0x29')](function(_0x1850cb){if(_0x1850cb){_0x37614f[_0xbabb('0x51')][_0xbabb('0x5d')]=_0x1850cb['id'];return db[_0xbabb('0x5b')]['create'](_0x37614f[_0xbabb('0x51')]);}})['then'](respondWithResult(_0x40b07a,null))['catch'](handleError(_0x40b07a,null));};exports[_0xbabb('0x5e')]=function(_0x4a7857,_0x41ccb0,_0x4c3f4a){var _0x36e032={};var _0x22a459={};var _0x4803cb;var _0xe640f4;return db[_0xbabb('0x47')]['findOne']({'where':{'id':_0x4a7857['params']['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x41ccb0,null))['then'](function(_0x53cb9a){if(_0x53cb9a){_0x4803cb=_0x53cb9a;_0x22a459[_0xbabb('0x36')]=_[_0xbabb('0x37')](db['Condition'][_0xbabb('0x32')]);_0x22a459['query']=_[_0xbabb('0x37')](_0x4a7857[_0xbabb('0x38')]);_0x22a459['filters']=_[_0xbabb('0x39')](_0x22a459[_0xbabb('0x36')],_0x22a459[_0xbabb('0x38')]);_0x36e032[_0xbabb('0x3b')]=_['intersection'](_0x22a459[_0xbabb('0x36')],qs[_0xbabb('0x3a')](_0x4a7857[_0xbabb('0x38')][_0xbabb('0x3a')]));_0x36e032[_0xbabb('0x3b')]=_0x36e032[_0xbabb('0x3b')][_0xbabb('0x3c')]?_0x36e032[_0xbabb('0x3b')]:_0x22a459[_0xbabb('0x36')];_0x36e032[_0xbabb('0x3e')]=qs['sort'](_0x4a7857[_0xbabb('0x38')][_0xbabb('0x3f')]);_0x36e032[_0xbabb('0x44')]=qs[_0xbabb('0x40')](_[_0xbabb('0x41')](_0x4a7857['query'],_0x22a459[_0xbabb('0x40')]));if(_0x4a7857['query'][_0xbabb('0x42')]){_0x36e032[_0xbabb('0x44')]=_[_0xbabb('0x43')](_0x36e032[_0xbabb('0x44')],{'$or':_['map'](_0x36e032['attributes'],function(_0x52065b){var _0x554954={};_0x554954[_0x52065b]={'$like':'%'+_0x4a7857[_0xbabb('0x38')][_0xbabb('0x42')]+'%'};return _0x554954;})});}_0x36e032=_[_0xbabb('0x43')]({},_0x36e032,_0x4a7857['options']);return _0x4803cb[_0xbabb('0x5e')](_0x36e032);}})[_0xbabb('0x29')](function(_0x3214fb){if(_0x3214fb){_0xe640f4=_0x3214fb['length'];if(!_0x4a7857[_0xbabb('0x38')]['hasOwnProperty']('nolimit')){_0x36e032[_0xbabb('0x22')]=qs['limit'](_0x4a7857['query'][_0xbabb('0x22')]);_0x36e032[_0xbabb('0x1f')]=qs[_0xbabb('0x1f')](_0x4a7857[_0xbabb('0x38')][_0xbabb('0x1f')]);}return _0x4803cb[_0xbabb('0x5e')](_0x36e032);}})[_0xbabb('0x29')](function(_0x27371c){if(_0x27371c){return _0x27371c?{'count':_0xe640f4,'rows':_0x27371c}:null;}})[_0xbabb('0x29')](respondWithResult(_0x41ccb0,null))['catch'](handleError(_0x41ccb0,null));};exports[_0xbabb('0x5f')]=function(_0x22a35e,_0x1ab887,_0x41ee3a){var _0x2f420b={};var _0xfd31d9={};var _0x462386;var _0x4d386b;return db[_0xbabb('0x47')][_0xbabb('0x60')]({'where':{'id':_0x22a35e[_0xbabb('0x4e')]['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x1ab887,null))['then'](function(_0x7bc5bd){if(_0x7bc5bd){_0x462386=_0x7bc5bd;_0xfd31d9[_0xbabb('0x36')]=_['keys'](db[_0xbabb('0x5b')][_0xbabb('0x32')]);_0xfd31d9[_0xbabb('0x38')]=_[_0xbabb('0x37')](_0x22a35e[_0xbabb('0x38')]);_0xfd31d9['filters']=_[_0xbabb('0x39')](_0xfd31d9['model'],_0xfd31d9[_0xbabb('0x38')]);_0x2f420b['attributes']=_[_0xbabb('0x39')](_0xfd31d9[_0xbabb('0x36')],qs[_0xbabb('0x3a')](_0x22a35e[_0xbabb('0x38')]['fields']));_0x2f420b[_0xbabb('0x3b')]=_0x2f420b[_0xbabb('0x3b')][_0xbabb('0x3c')]?_0x2f420b['attributes']:_0xfd31d9['model'];_0x2f420b[_0xbabb('0x3e')]=qs[_0xbabb('0x3f')](_0x22a35e[_0xbabb('0x38')][_0xbabb('0x3f')]);_0x2f420b[_0xbabb('0x44')]=qs[_0xbabb('0x40')](_[_0xbabb('0x41')](_0x22a35e[_0xbabb('0x38')],_0xfd31d9[_0xbabb('0x40')]));if(_0x22a35e[_0xbabb('0x38')][_0xbabb('0x42')]){_0x2f420b[_0xbabb('0x44')]=_[_0xbabb('0x43')](_0x2f420b[_0xbabb('0x44')],{'$or':_['map'](_0x2f420b[_0xbabb('0x3b')],function(_0x4387b6){var _0x110a11={};_0x110a11[_0x4387b6]={'$like':'%'+_0x22a35e['query'][_0xbabb('0x42')]+'%'};return _0x110a11;})});}_0x2f420b=_[_0xbabb('0x43')]({},_0x2f420b,_0x22a35e['options']);return _0x462386[_0xbabb('0x5f')](_0x2f420b);}})[_0xbabb('0x29')](function(_0x5403a4){if(_0x5403a4){_0x4d386b=_0x5403a4[_0xbabb('0x3c')];if(!_0x22a35e[_0xbabb('0x38')][_0xbabb('0x3d')](_0xbabb('0x61'))){_0x2f420b['limit']=qs['limit'](_0x22a35e[_0xbabb('0x38')][_0xbabb('0x22')]);_0x2f420b[_0xbabb('0x1f')]=qs[_0xbabb('0x1f')](_0x22a35e[_0xbabb('0x38')][_0xbabb('0x1f')]);}return _0x462386['getAnyConditions'](_0x2f420b);}})['then'](function(_0x2912f6){if(_0x2912f6){return _0x2912f6?{'count':_0x4d386b,'rows':_0x2912f6}:null;}})['then'](respondWithResult(_0x1ab887,null))[_0xbabb('0x4c')](handleError(_0x1ab887,null));};exports[_0xbabb('0x62')]=function(_0x25e071,_0x1de440,_0x13f85b){if(_0x25e071['body']['id']){delete _0x25e071[_0xbabb('0x51')]['id'];}return db[_0xbabb('0x47')][_0xbabb('0x4f')]({'where':{'id':_0x25e071['params']['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x1de440,null))[_0xbabb('0x29')](function(_0x471f7a){if(_0x471f7a){_0x25e071[_0xbabb('0x51')]['TriggerId']=_0x471f7a['id'];return db['Action'][_0xbabb('0x50')](_0x25e071[_0xbabb('0x51')]);}})[_0xbabb('0x29')](respondWithResult(_0x1de440,null))['catch'](handleError(_0x1de440,null));};exports[_0xbabb('0x63')]=function(_0x3a403f,_0x174feb,_0x17a968){var _0x24bd6a={};var _0x455268={};var _0x22cd90;var _0x14fc23;return db[_0xbabb('0x47')][_0xbabb('0x60')]({'where':{'id':_0x3a403f[_0xbabb('0x4e')]['id']}})[_0xbabb('0x29')](handleEntityNotFound(_0x174feb,null))['then'](function(_0x167859){if(_0x167859){_0x22cd90=_0x167859;_0x455268['model']=_[_0xbabb('0x37')](db[_0xbabb('0x64')][_0xbabb('0x32')]);_0x455268[_0xbabb('0x38')]=_[_0xbabb('0x37')](_0x3a403f['query']);_0x455268[_0xbabb('0x40')]=_[_0xbabb('0x39')](_0x455268[_0xbabb('0x36')],_0x455268[_0xbabb('0x38')]);_0x24bd6a[_0xbabb('0x3b')]=_[_0xbabb('0x39')](_0x455268[_0xbabb('0x36')],qs[_0xbabb('0x3a')](_0x3a403f[_0xbabb('0x38')][_0xbabb('0x3a')]));_0x24bd6a[_0xbabb('0x3b')]=_0x24bd6a[_0xbabb('0x3b')][_0xbabb('0x3c')]?_0x24bd6a['attributes']:_0x455268['model'];_0x24bd6a[_0xbabb('0x3e')]=qs['sort'](_0x3a403f[_0xbabb('0x38')]['sort']);_0x24bd6a[_0xbabb('0x44')]=qs[_0xbabb('0x40')](_['pick'](_0x3a403f[_0xbabb('0x38')],_0x455268['filters']));if(_0x3a403f[_0xbabb('0x38')][_0xbabb('0x42')]){_0x24bd6a[_0xbabb('0x44')]=_[_0xbabb('0x43')](_0x24bd6a[_0xbabb('0x44')],{'$or':_[_0xbabb('0x31')](_0x24bd6a[_0xbabb('0x3b')],function(_0x41b266){var _0x45566d={};_0x45566d[_0x41b266]={'$like':'%'+_0x3a403f[_0xbabb('0x38')][_0xbabb('0x42')]+'%'};return _0x45566d;})});}_0x24bd6a=_[_0xbabb('0x43')]({},_0x24bd6a,_0x3a403f[_0xbabb('0x46')]);return _0x22cd90[_0xbabb('0x63')](_0x24bd6a);}})[_0xbabb('0x29')](function(_0x1f0fcd){if(_0x1f0fcd){_0x14fc23=_0x1f0fcd[_0xbabb('0x3c')];if(!_0x3a403f['query'][_0xbabb('0x3d')](_0xbabb('0x61'))){_0x24bd6a[_0xbabb('0x22')]=qs['limit'](_0x3a403f[_0xbabb('0x38')][_0xbabb('0x22')]);_0x24bd6a[_0xbabb('0x1f')]=qs[_0xbabb('0x1f')](_0x3a403f[_0xbabb('0x38')][_0xbabb('0x1f')]);}return _0x22cd90[_0xbabb('0x63')](_0x24bd6a);}})['then'](function(_0xfefbab){if(_0xfefbab){return _0xfefbab?{'count':_0x14fc23,'rows':_0xfefbab}:null;}})[_0xbabb('0x29')](respondWithResult(_0x174feb,null))[_0xbabb('0x4c')](handleError(_0x174feb,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a2db415..7422424 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 _0xed1f=['tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger'];(function(_0x2a8bbd,_0x2d998b){var _0x276e9c=function(_0x5ef6db){while(--_0x5ef6db){_0x2a8bbd['push'](_0x2a8bbd['shift']());}};_0x276e9c(++_0x2d998b);}(_0xed1f,0x6a));var _0xfed1=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xed1f[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0434=['api','moment','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x0434,0x1ad));var _0x4043=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x0434[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var logger=require(_0x4043('0x2'))(_0x4043('0x3'));var moment=require(_0x4043('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4043('0x5'));var rimraf=require(_0x4043('0x6'));var config=require(_0x4043('0x7'));var attributes=require(_0x4043('0x8'));module[_0x4043('0x9')]=function(_0x1dba57,_0x58fca7){return _0x1dba57[_0x4043('0xa')](_0x4043('0xb'),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 a64373c..963a966 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 _0x5085=['GetTrigger','options','raw','where','attributes','limit','map','include','model','ShowTrigger','Trigger','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x55d850,_0x3f896f){var _0x3ed61b=function(_0x45d366){while(--_0x45d366){_0x55d850['push'](_0x55d850['shift']());}};_0x3ed61b(++_0x3f896f);}(_0x5085,0x114));var _0x5508=function(_0x57b2b8,_0x5adf41){_0x57b2b8=_0x57b2b8-0x0;var _0x26b8e9=_0x5085[_0x57b2b8];return _0x26b8e9;};'use strict';var _=require(_0x5508('0x0'));var util=require(_0x5508('0x1'));var moment=require(_0x5508('0x2'));var BPromise=require('bluebird');var rs=require(_0x5508('0x3'));var fs=require('fs');var Redis=require(_0x5508('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5508('0x5'));var logger=require(_0x5508('0x6'))('rpc');var config=require(_0x5508('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5508('0x8')][_0x5508('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52efe5,_0x20fe4c,_0x155d41){return new BPromise(function(_0x2b18d5,_0x321155){return client['request'](_0x52efe5,_0x155d41)[_0x5508('0xa')](function(_0x1dbb3c){logger[_0x5508('0xb')](_0x5508('0xc'),_0x20fe4c,_0x5508('0xd'));logger[_0x5508('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x20fe4c,_0x5508('0xd'),JSON[_0x5508('0xf')](_0x1dbb3c));if(_0x1dbb3c['error']){if(_0x1dbb3c[_0x5508('0x10')][_0x5508('0x11')]===0x1f4){logger[_0x5508('0x10')]('Trigger,\x20%s,\x20%s',_0x20fe4c,_0x1dbb3c[_0x5508('0x10')]['message']);return _0x321155(_0x1dbb3c['error'][_0x5508('0x12')]);}logger[_0x5508('0x10')]('Trigger,\x20%s,\x20%s',_0x20fe4c,_0x1dbb3c[_0x5508('0x10')]['message']);return _0x2b18d5(_0x1dbb3c[_0x5508('0x10')][_0x5508('0x12')]);}else{logger['info'](_0x5508('0xc'),_0x20fe4c,_0x5508('0xd'));_0x2b18d5(_0x1dbb3c[_0x5508('0x13')][_0x5508('0x12')]);}})[_0x5508('0x14')](function(_0x5dedf4){logger[_0x5508('0x10')](_0x5508('0xc'),_0x20fe4c,_0x5dedf4);_0x321155(_0x5dedf4);});});}exports[_0x5508('0x15')]=function(_0x1fb2ae){var _0x5b7283=this;return new Promise(function(_0x1c129a,_0x1275f5){return db['Trigger']['findAll']({'raw':_0x1fb2ae[_0x5508('0x16')]?_0x1fb2ae[_0x5508('0x16')][_0x5508('0x17')]===undefined?!![]:![]:!![],'where':_0x1fb2ae[_0x5508('0x16')]?_0x1fb2ae['options'][_0x5508('0x18')]||null:null,'attributes':_0x1fb2ae[_0x5508('0x16')]?_0x1fb2ae[_0x5508('0x16')][_0x5508('0x19')]||null:null,'limit':_0x1fb2ae[_0x5508('0x16')]?_0x1fb2ae[_0x5508('0x16')][_0x5508('0x1a')]||null:null,'include':_0x1fb2ae[_0x5508('0x16')]?_0x1fb2ae[_0x5508('0x16')]['include']?_[_0x5508('0x1b')](_0x1fb2ae['options'][_0x5508('0x1c')],function(_0x66e18a){return{'model':db[_0x66e18a['model']],'as':_0x66e18a['as'],'attributes':_0x66e18a['attributes'],'include':_0x66e18a[_0x5508('0x1c')]?_[_0x5508('0x1b')](_0x66e18a[_0x5508('0x1c')],function(_0x211b14){return{'model':db[_0x211b14['model']],'as':_0x211b14['as'],'attributes':_0x211b14[_0x5508('0x19')],'include':_0x211b14[_0x5508('0x1c')]?_[_0x5508('0x1b')](_0x211b14['include'],function(_0x39ce09){return{'model':db[_0x39ce09[_0x5508('0x1d')]],'as':_0x39ce09['as'],'attributes':_0x39ce09[_0x5508('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5508('0xa')](function(_0x3d6297){logger[_0x5508('0xb')](_0x5508('0x15'),_0x1fb2ae);logger[_0x5508('0xe')]('GetTrigger',_0x1fb2ae,JSON[_0x5508('0xf')](_0x3d6297));_0x1c129a(_0x3d6297);})[_0x5508('0x14')](function(_0x5ab4f3){logger['error'](_0x5508('0x15'),_0x5ab4f3[_0x5508('0x12')],_0x1fb2ae);_0x1275f5(_0x5b7283[_0x5508('0x10')](0x1f4,_0x5ab4f3['message']));});});};exports[_0x5508('0x1e')]=function(_0x5c74aa){var _0x1ea296=this;return new Promise(function(_0x59de50,_0xa52ea7){return db[_0x5508('0x1f')][_0x5508('0x20')]({'raw':_0x5c74aa['options']?_0x5c74aa[_0x5508('0x16')][_0x5508('0x17')]===undefined?!![]:![]:!![],'where':_0x5c74aa[_0x5508('0x16')]?_0x5c74aa['options'][_0x5508('0x18')]||null:null,'attributes':_0x5c74aa[_0x5508('0x16')]?_0x5c74aa[_0x5508('0x16')][_0x5508('0x19')]||null:null,'include':_0x5c74aa[_0x5508('0x16')]?_0x5c74aa[_0x5508('0x16')][_0x5508('0x1c')]?_[_0x5508('0x1b')](_0x5c74aa['options'][_0x5508('0x1c')],function(_0x545fc5){return{'model':db[_0x545fc5[_0x5508('0x1d')]],'as':_0x545fc5['as'],'attributes':_0x545fc5[_0x5508('0x19')],'include':_0x545fc5[_0x5508('0x1c')]?_[_0x5508('0x1b')](_0x545fc5[_0x5508('0x1c')],function(_0x7b7b40){return{'model':db[_0x7b7b40[_0x5508('0x1d')]],'as':_0x7b7b40['as'],'attributes':_0x7b7b40[_0x5508('0x19')],'include':_0x7b7b40[_0x5508('0x1c')]?_[_0x5508('0x1b')](_0x7b7b40[_0x5508('0x1c')],function(_0x2953f0){return{'model':db[_0x2953f0[_0x5508('0x1d')]],'as':_0x2953f0['as'],'attributes':_0x2953f0[_0x5508('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5508('0xa')](function(_0x20e849){logger[_0x5508('0xb')](_0x5508('0x1e'),_0x5c74aa);logger[_0x5508('0xe')]('ShowTrigger',_0x5c74aa,JSON[_0x5508('0xf')](_0x20e849));_0x59de50(_0x20e849);})[_0x5508('0x14')](function(_0x5df8a1){logger[_0x5508('0x10')](_0x5508('0x1e'),_0x5df8a1['message'],_0x5c74aa);_0xa52ea7(_0x1ea296[_0x5508('0x10')](0x1f4,_0x5df8a1['message']));});});}; \ No newline at end of file +var _0x339f=['options','raw','where','attributes','limit','map','model','include','GetTrigger','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','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(_0x5989c6,_0x53e957){var _0x5c1fe3=function(_0x3e2eef){while(--_0x3e2eef){_0x5989c6['push'](_0x5989c6['shift']());}};_0x5c1fe3(++_0x53e957);}(_0x339f,0x115));var _0xf339=function(_0x4fc527,_0x5b3573){_0x4fc527=_0x4fc527-0x0;var _0x4b9b9a=_0x339f[_0x4fc527];return _0x4b9b9a;};'use strict';var _=require(_0xf339('0x0'));var util=require(_0xf339('0x1'));var moment=require(_0xf339('0x2'));var BPromise=require(_0xf339('0x3'));var rs=require(_0xf339('0x4'));var fs=require('fs');var Redis=require(_0xf339('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf339('0x6'));var logger=require(_0xf339('0x7'))(_0xf339('0x8'));var config=require(_0xf339('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf339('0xa')][_0xf339('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x135049,_0x240977,_0x5641d0){return new BPromise(function(_0x3f9721,_0x2340e7){return client[_0xf339('0xc')](_0x135049,_0x5641d0)[_0xf339('0xd')](function(_0x1c4ebc){logger[_0xf339('0xe')](_0xf339('0xf'),_0x240977,_0xf339('0x10'));logger[_0xf339('0x11')](_0xf339('0x12'),_0x240977,_0xf339('0x10'),JSON[_0xf339('0x13')](_0x1c4ebc));if(_0x1c4ebc[_0xf339('0x14')]){if(_0x1c4ebc[_0xf339('0x14')][_0xf339('0x15')]===0x1f4){logger['error'](_0xf339('0xf'),_0x240977,_0x1c4ebc[_0xf339('0x14')][_0xf339('0x16')]);return _0x2340e7(_0x1c4ebc[_0xf339('0x14')][_0xf339('0x16')]);}logger['error'](_0xf339('0xf'),_0x240977,_0x1c4ebc[_0xf339('0x14')][_0xf339('0x16')]);return _0x3f9721(_0x1c4ebc[_0xf339('0x14')][_0xf339('0x16')]);}else{logger['info'](_0xf339('0xf'),_0x240977,'request\x20sent');_0x3f9721(_0x1c4ebc[_0xf339('0x17')]['message']);}})[_0xf339('0x18')](function(_0x422bfa){logger[_0xf339('0x14')](_0xf339('0xf'),_0x240977,_0x422bfa);_0x2340e7(_0x422bfa);});});}exports['GetTrigger']=function(_0x5ef9fe){var _0xfb5906=this;return new Promise(function(_0x63aa85,_0x274ab0){return db[_0xf339('0x19')][_0xf339('0x1a')]({'raw':_0x5ef9fe[_0xf339('0x1b')]?_0x5ef9fe[_0xf339('0x1b')][_0xf339('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ef9fe[_0xf339('0x1b')]?_0x5ef9fe['options'][_0xf339('0x1d')]||null:null,'attributes':_0x5ef9fe[_0xf339('0x1b')]?_0x5ef9fe[_0xf339('0x1b')][_0xf339('0x1e')]||null:null,'limit':_0x5ef9fe[_0xf339('0x1b')]?_0x5ef9fe[_0xf339('0x1b')][_0xf339('0x1f')]||null:null,'include':_0x5ef9fe[_0xf339('0x1b')]?_0x5ef9fe[_0xf339('0x1b')]['include']?_[_0xf339('0x20')](_0x5ef9fe[_0xf339('0x1b')]['include'],function(_0x37a681){return{'model':db[_0x37a681[_0xf339('0x21')]],'as':_0x37a681['as'],'attributes':_0x37a681['attributes'],'include':_0x37a681['include']?_['map'](_0x37a681[_0xf339('0x22')],function(_0x51f0e3){return{'model':db[_0x51f0e3[_0xf339('0x21')]],'as':_0x51f0e3['as'],'attributes':_0x51f0e3['attributes'],'include':_0x51f0e3[_0xf339('0x22')]?_['map'](_0x51f0e3[_0xf339('0x22')],function(_0x4dc48c){return{'model':db[_0x4dc48c[_0xf339('0x21')]],'as':_0x4dc48c['as'],'attributes':_0x4dc48c[_0xf339('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf339('0xd')](function(_0x92d907){logger[_0xf339('0xe')]('GetTrigger',_0x5ef9fe);logger[_0xf339('0x11')](_0xf339('0x23'),_0x5ef9fe,JSON[_0xf339('0x13')](_0x92d907));_0x63aa85(_0x92d907);})[_0xf339('0x18')](function(_0x23e0ff){logger[_0xf339('0x14')](_0xf339('0x23'),_0x23e0ff[_0xf339('0x16')],_0x5ef9fe);_0x274ab0(_0xfb5906[_0xf339('0x14')](0x1f4,_0x23e0ff[_0xf339('0x16')]));});});};exports[_0xf339('0x24')]=function(_0xeae8af){var _0x815332=this;return new Promise(function(_0x1d8e2a,_0x31065d){return db[_0xf339('0x19')][_0xf339('0x25')]({'raw':_0xeae8af[_0xf339('0x1b')]?_0xeae8af['options'][_0xf339('0x1c')]===undefined?!![]:![]:!![],'where':_0xeae8af[_0xf339('0x1b')]?_0xeae8af[_0xf339('0x1b')][_0xf339('0x1d')]||null:null,'attributes':_0xeae8af[_0xf339('0x1b')]?_0xeae8af[_0xf339('0x1b')][_0xf339('0x1e')]||null:null,'include':_0xeae8af[_0xf339('0x1b')]?_0xeae8af['options']['include']?_['map'](_0xeae8af[_0xf339('0x1b')][_0xf339('0x22')],function(_0x1d4be2){return{'model':db[_0x1d4be2['model']],'as':_0x1d4be2['as'],'attributes':_0x1d4be2['attributes'],'include':_0x1d4be2['include']?_['map'](_0x1d4be2['include'],function(_0x399d95){return{'model':db[_0x399d95['model']],'as':_0x399d95['as'],'attributes':_0x399d95[_0xf339('0x1e')],'include':_0x399d95[_0xf339('0x22')]?_[_0xf339('0x20')](_0x399d95[_0xf339('0x22')],function(_0x2d6e43){return{'model':db[_0x2d6e43[_0xf339('0x21')]],'as':_0x2d6e43['as'],'attributes':_0x2d6e43[_0xf339('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf820c1){logger[_0xf339('0xe')](_0xf339('0x24'),_0xeae8af);logger[_0xf339('0x11')]('ShowTrigger',_0xeae8af,JSON[_0xf339('0x13')](_0xf820c1));_0x1d8e2a(_0xf820c1);})[_0xf339('0x18')](function(_0x5c9b42){logger[_0xf339('0x14')](_0xf339('0x24'),_0x5c9b42[_0xf339('0x16')],_0xeae8af);_0x31065d(_0x815332[_0xf339('0x14')](0x1f4,_0x5c9b42['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 72d0b5d..42493c2 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 _0xc94b=['exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','destroy'];(function(_0x256250,_0x35b654){var _0x42b426=function(_0x4773d0){while(--_0x4773d0){_0x256250['push'](_0x256250['shift']());}};_0x42b426(++_0x35b654);}(_0xc94b,0x177));var _0xbc94=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc94b[_0x1b6c6d];return _0x290d9d;};'use strict';var multer=require(_0xbc94('0x0'));var util=require('util');var path=require(_0xbc94('0x1'));var timeout=require(_0xbc94('0x2'));var express=require('express');var router=express[_0xbc94('0x3')]();var fs_extra=require(_0xbc94('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc94('0x5'));var controller=require(_0xbc94('0x6'));router[_0xbc94('0x7')]('/',auth[_0xbc94('0x8')](),controller[_0xbc94('0x9')]);router[_0xbc94('0x7')](_0xbc94('0xa'),auth[_0xbc94('0x8')](),controller[_0xbc94('0xb')]);router[_0xbc94('0xc')](_0xbc94('0xd'),auth[_0xbc94('0x8')](),controller[_0xbc94('0xe')]);router[_0xbc94('0xc')]('/',auth[_0xbc94('0x8')](),controller['create']);router['put'](_0xbc94('0xa'),auth[_0xbc94('0x8')](),controller['update']);router['delete'](_0xbc94('0xa'),auth[_0xbc94('0x8')](),controller[_0xbc94('0xf')]);module[_0xbc94('0x10')]=router; \ No newline at end of file +var _0x8b75=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','post','/:id/clone','clone','create','put','/:id','delete','destroy','path'];(function(_0x2c30e2,_0x2f0f27){var _0x30b1c1=function(_0x18608d){while(--_0x18608d){_0x2c30e2['push'](_0x2c30e2['shift']());}};_0x30b1c1(++_0x2f0f27);}(_0x8b75,0x7f));var _0x58b7=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x8b75[_0x5783f4];return _0x28e380;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x58b7('0x0'));var timeout=require(_0x58b7('0x1'));var express=require(_0x58b7('0x2'));var router=express['Router']();var fs_extra=require(_0x58b7('0x3'));var auth=require(_0x58b7('0x4'));var interaction=require(_0x58b7('0x5'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x58b7('0x6')]('/',auth[_0x58b7('0x7')](),controller['index']);router['get']('/:id',auth[_0x58b7('0x7')](),controller['show']);router[_0x58b7('0x8')](_0x58b7('0x9'),auth[_0x58b7('0x7')](),controller[_0x58b7('0xa')]);router[_0x58b7('0x8')]('/',auth[_0x58b7('0x7')](),controller[_0x58b7('0xb')]);router[_0x58b7('0xc')](_0x58b7('0xd'),auth[_0x58b7('0x7')](),controller['update']);router[_0x58b7('0xe')](_0x58b7('0xd'),auth[_0x58b7('0x7')](),controller[_0x58b7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4790303..2d6c8d3 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 _0x3dcb=['actpass','dynamic','update,nonat','BOOLEAN','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active'];(function(_0x229532,_0x1c0e67){var _0x598c8a=function(_0x3e25ac){while(--_0x3e25ac){_0x229532['push'](_0x229532['shift']());}};_0x598c8a(++_0x1c0e67);}(_0x3dcb,0xa3));var _0xb3dc=function(_0x19aaab,_0x4539e8){_0x19aaab=_0x19aaab-0x0;var _0x29a830=_0x3dcb[_0x19aaab];return _0x29a830;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb3dc('0x0')],'allowNull':![],'unique':_0xb3dc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x3'),_0xb3dc('0x4'),'peer'),'allowNull':![],'defaultValue':_0xb3dc('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb3dc('0x5')},'callingpres':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x6'),_0xb3dc('0x7'),_0xb3dc('0x8'),_0xb3dc('0x9'),_0xb3dc('0xa'),_0xb3dc('0xb'),_0xb3dc('0xc'),_0xb3dc('0xd'))},'deny':{'type':Sequelize[_0xb3dc('0x0')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xb3dc('0x0')]},'md5secret':{'type':Sequelize[_0xb3dc('0x0')]},'remotesecret':{'type':Sequelize[_0xb3dc('0x0')]},'transport':{'type':Sequelize[_0xb3dc('0x0')],'defaultValue':_0xb3dc('0xe'),'set':function(_0x5f095c){this['setDataValue'](_0xb3dc('0xf'),_0x5f095c?_0x5f095c[_0xb3dc('0x10')](','):null);},'get':function(){return this[_0xb3dc('0x11')]('transport')?this['getDataValue'](_0xb3dc('0xf'))['split'](','):null;},'comment':_0xb3dc('0x12')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xb3dc('0x13'),_0xb3dc('0x14'),_0xb3dc('0x15'),_0xb3dc('0x16')),'defaultValue':_0xb3dc('0x17')},'directmedia':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no',_0xb3dc('0x19'),'update',_0xb3dc('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xb3dc('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xb3dc('0x0')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xb3dc('0x1b'),'set':function(_0x1f39e0){this['setDataValue'](_0xb3dc('0x1c'),_0x1f39e0?_0x1f39e0['join'](','):null);},'get':function(){return this[_0xb3dc('0x11')]('nat')?this['getDataValue'](_0xb3dc('0x1c'))['split'](','):null;},'comment':_0xb3dc('0x1d')},'callgroup':{'type':Sequelize[_0xb3dc('0x0')]},'namedcallgroup':{'type':Sequelize[_0xb3dc('0x0')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xb3dc('0x0')]},'language':{'type':Sequelize[_0xb3dc('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb3dc('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb3dc('0x0')],'defaultValue':_0xb3dc('0x1e')},'allow':{'type':Sequelize[_0xb3dc('0x0')],'allowNull':![],'defaultValue':_0xb3dc('0x1f'),'set':function(_0xe44a2c){this[_0xb3dc('0x20')]('allow',_0xe44a2c?_0xe44a2c[_0xb3dc('0x10')](';'):_0xb3dc('0x1f'));},'get':function(){return this[_0xb3dc('0x11')]('allow')?this[_0xb3dc('0x11')](_0xb3dc('0x21'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'insecure':{'type':Sequelize[_0xb3dc('0x0')],'defaultValue':_0xb3dc('0x22'),'set':function(_0x32bc7a){this['setDataValue']('insecure',_0x32bc7a?_0x32bc7a[_0xb3dc('0x10')](','):null);},'get':function(){return this[_0xb3dc('0x11')](_0xb3dc('0x23'))?this[_0xb3dc('0x11')](_0xb3dc('0x23'))['split'](','):null;},'comment':_0xb3dc('0x24')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xb3dc('0x25'))},'promiscredir':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'accountcode':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xb3dc('0x27')},'amaflags':{'type':Sequelize[_0xb3dc('0x0')]},'callcounter':{'type':Sequelize['ENUM'](_0xb3dc('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xb3dc('0x0')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no',_0xb3dc('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'mailbox':{'type':Sequelize[_0xb3dc('0x0')]},'session_timers':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x29'),_0xb3dc('0x2a'),'originate')},'session_expires':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x2b'),'uas'),'defaultValue':_0xb3dc('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xb3dc('0x0')]},'fromdomain':{'type':Sequelize[_0xb3dc('0x0')]},'fromuser':{'type':Sequelize[_0xb3dc('0x0')]},'port':{'type':Sequelize[_0xb3dc('0x26')](0x5)},'qualify':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no'),'defaultValue':_0xb3dc('0x18')},'keepalive':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'defaultip':{'type':Sequelize[_0xb3dc('0x0')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no',_0xb3dc('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb3dc('0x0')]},'callbackextension':{'type':Sequelize[_0xb3dc('0x0')]},'timert1':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'timerb':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xb3dc('0x0')]},'contactdeny':{'type':Sequelize[_0xb3dc('0x0')]},'contactacl':{'type':Sequelize[_0xb3dc('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0xb3dc('0x0')]},'use_q850_reason':{'type':Sequelize[_0xb3dc('0x0')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'force_avp':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'icesupport':{'type':Sequelize[_0xb3dc('0x2')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no',_0xb3dc('0x2e'),_0xb3dc('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xb3dc('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb3dc('0x0')]},'dtlsprivatekey':{'type':Sequelize[_0xb3dc('0x0')]},'dtlscipher':{'type':Sequelize[_0xb3dc('0x0')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xb3dc('0x0')]},'dtlssetup':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x30'),'passive',_0xb3dc('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb3dc('0x0')]},'usereqphone':{'type':Sequelize['ENUM'](_0xb3dc('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no')},'vmexten':{'type':Sequelize[_0xb3dc('0x0')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xb3dc('0x0')]},'parkinglot':{'type':Sequelize[_0xb3dc('0x0')]},'description':{'type':Sequelize[_0xb3dc('0x0')]},'host':{'type':Sequelize[_0xb3dc('0x0')],'defaultValue':_0xb3dc('0x32')},'canreinvite':{'type':Sequelize[_0xb3dc('0x2')](_0xb3dc('0x18'),'no',_0xb3dc('0x19'),'update',_0xb3dc('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb3dc('0x0')]},'otherFields':{'type':Sequelize[_0xb3dc('0x0')]},'active':{'type':Sequelize[_0xb3dc('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x22be=['shortinfo','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\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','fingerprint','certificate','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x22be,0x156));var _0xe22b=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x22be[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require(_0xe22b('0x0'));module[_0xe22b('0x1')]={'name':{'type':Sequelize[_0xe22b('0x2')],'allowNull':![],'unique':_0xe22b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x5'),_0xe22b('0x6'),'peer'),'allowNull':![],'defaultValue':_0xe22b('0x5')},'context':{'type':Sequelize[_0xe22b('0x2')],'allowNull':![],'defaultValue':_0xe22b('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0xe22b('0x8'),_0xe22b('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xe22b('0xa'),_0xe22b('0xb'),'PROHIB_FAILED_SCREEN',_0xe22b('0xc'))},'deny':{'type':Sequelize[_0xe22b('0x2')]},'permit':{'type':Sequelize[_0xe22b('0x2')]},'secret':{'type':Sequelize[_0xe22b('0x2')]},'md5secret':{'type':Sequelize[_0xe22b('0x2')]},'remotesecret':{'type':Sequelize[_0xe22b('0x2')]},'transport':{'type':Sequelize[_0xe22b('0x2')],'defaultValue':_0xe22b('0xd'),'set':function(_0x537d72){this[_0xe22b('0xe')](_0xe22b('0xf'),_0x537d72?_0x537d72[_0xe22b('0x10')](','):null);},'get':function(){return this[_0xe22b('0x11')](_0xe22b('0xf'))?this[_0xe22b('0x11')]('transport')[_0xe22b('0x12')](','):null;},'comment':_0xe22b('0x13')},'dtmfmode':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x14'),_0xe22b('0x15'),_0xe22b('0x16'),'inband','auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no',_0xe22b('0x18'),_0xe22b('0x19'),_0xe22b('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe22b('0x2')]},'directmediadeny':{'type':Sequelize[_0xe22b('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xe22b('0x1b'),'set':function(_0x3a454f){this['setDataValue']('nat',_0x3a454f?_0x3a454f['join'](','):null);},'get':function(){return this[_0xe22b('0x11')](_0xe22b('0x1c'))?this[_0xe22b('0x11')](_0xe22b('0x1c'))['split'](','):null;},'comment':_0xe22b('0x1d')},'callgroup':{'type':Sequelize[_0xe22b('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe22b('0x2')]},'pickupgroup':{'type':Sequelize[_0xe22b('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe22b('0x2')]},'language':{'type':Sequelize[_0xe22b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe22b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xe22b('0x1e')},'allow':{'type':Sequelize[_0xe22b('0x2')],'allowNull':![],'defaultValue':_0xe22b('0x1f'),'set':function(_0x449531){this[_0xe22b('0xe')](_0xe22b('0x20'),_0x449531?_0x449531['join'](';'):_0xe22b('0x1f'));},'get':function(){return this[_0xe22b('0x11')]('allow')?this[_0xe22b('0x11')]('allow')['split'](';'):null;},'comment':_0xe22b('0x21')},'autoframing':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'insecure':{'type':Sequelize[_0xe22b('0x2')],'defaultValue':_0xe22b('0x22'),'set':function(_0x117153){this[_0xe22b('0xe')]('insecure',_0x117153?_0x117153[_0xe22b('0x10')](','):null);},'get':function(){return this[_0xe22b('0x11')](_0xe22b('0x23'))?this[_0xe22b('0x11')](_0xe22b('0x23'))[_0xe22b('0x12')](','):null;},'comment':_0xe22b('0x24')},'trustrpid':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe22b('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no',_0xe22b('0x25'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe22b('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'accountcode':{'type':Sequelize[_0xe22b('0x26')](0xb)},'setvar':{'type':Sequelize[_0xe22b('0x2')]},'callerid':{'type':Sequelize[_0xe22b('0x2')],'defaultValue':_0xe22b('0x27')},'amaflags':{'type':Sequelize[_0xe22b('0x2')]},'callcounter':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no'),'defaultValue':_0xe22b('0x17')},'busylevel':{'type':Sequelize[_0xe22b('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xe22b('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xe22b('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xe22b('0x2')]},'template':{'type':Sequelize[_0xe22b('0x2')]},'videosupport':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe22b('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'mailbox':{'type':Sequelize[_0xe22b('0x2')]},'session_timers':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x28'),_0xe22b('0x29'),_0xe22b('0x2a'))},'session_expires':{'type':Sequelize[_0xe22b('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xe22b('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x2b'),_0xe22b('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xe22b('0x2')]},'regexten':{'type':Sequelize[_0xe22b('0x2')]},'fromdomain':{'type':Sequelize[_0xe22b('0x2')]},'fromuser':{'type':Sequelize[_0xe22b('0x2')]},'port':{'type':Sequelize[_0xe22b('0x26')](0x5)},'qualify':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no'),'defaultValue':_0xe22b('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xe22b('0x2')]},'defaultuser':{'type':Sequelize[_0xe22b('0x2')]},'rtptimeout':{'type':Sequelize[_0xe22b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe22b('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe22b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xe22b('0x4')]('yes','no',_0xe22b('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe22b('0x2')]},'callbackextension':{'type':Sequelize[_0xe22b('0x2')]},'timert1':{'type':Sequelize[_0xe22b('0x26')](0xb)},'timerb':{'type':Sequelize[_0xe22b('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe22b('0x26')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe22b('0x2')]},'contactacl':{'type':Sequelize[_0xe22b('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xe22b('0x2')]},'use_q850_reason':{'type':Sequelize[_0xe22b('0x2')]},'maxforwards':{'type':Sequelize[_0xe22b('0x26')](0xb)},'encryption':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xe22b('0x17'),'no')},'force_avp':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'icesupport':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xe22b('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no',_0xe22b('0x2e'),_0xe22b('0x2f'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe22b('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xe22b('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe22b('0x2')]},'dtlscapath':{'type':Sequelize[_0xe22b('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xe22b('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe22b('0x2')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe22b('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe22b('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no')},'vmexten':{'type':Sequelize[_0xe22b('0x2')]},'mohinterpret':{'type':Sequelize[_0xe22b('0x2')]},'mohsuggest':{'type':Sequelize[_0xe22b('0x2')]},'parkinglot':{'type':Sequelize[_0xe22b('0x2')]},'description':{'type':Sequelize[_0xe22b('0x2')]},'host':{'type':Sequelize[_0xe22b('0x2')],'defaultValue':_0xe22b('0x31')},'canreinvite':{'type':Sequelize[_0xe22b('0x4')](_0xe22b('0x17'),'no',_0xe22b('0x18'),_0xe22b('0x19'),_0xe22b('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe22b('0x2')]},'otherFields':{'type':Sequelize[_0xe22b('0x2')]},'active':{'type':Sequelize[_0xe22b('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe22b('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 791eec3..07bb47d 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 _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x3ae509,_0x216239){var _0x33c559=function(_0x45ba97){while(--_0x45ba97){_0x3ae509['push'](_0x3ae509['shift']());}};_0x33c559(++_0x216239);}(_0x425d,0x1e0));var _0xd425=function(_0x5b012e,_0x5cb94c){_0x5b012e=_0x5b012e-0x0;var _0xd6daf0=_0x425d[_0x5b012e];return _0xd6daf0;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x100b36,_0x319e1f){var _0x415a81=function(_0x1be17f){while(--_0x1be17f){_0x100b36['push'](_0x100b36['shift']());}};_0x415a81(++_0x319e1f);}(_0x98a8,0x12c));var _0x898a=function(_0x812e62,_0x4cffc2){_0x812e62=_0x812e62-0x0;var _0x178b97=_0x98a8[_0x812e62];return _0x178b97;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index fdbfc20..2f4eb16 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 _0x7ba8=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','bluebird','request-promise','path','rimraf'];(function(_0x33e0ad,_0x4bbb98){var _0x25b272=function(_0x1711a3){while(--_0x1711a3){_0x33e0ad['push'](_0x33e0ad['shift']());}};_0x25b272(++_0x4bbb98);}(_0x7ba8,0x1ea));var _0x87ba=function(_0x2b5809,_0x5e79a5){_0x2b5809=_0x2b5809-0x0;var _0x38d74b=_0x7ba8[_0x2b5809];return _0x38d74b;};'use strict';var _=require(_0x87ba('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x87ba('0x1'));var rp=require(_0x87ba('0x2'));var fs=require('fs');var path=require(_0x87ba('0x3'));var rimraf=require(_0x87ba('0x4'));var config=require(_0x87ba('0x5'));var attributes=require(_0x87ba('0x6'));module[_0x87ba('0x7')]=function(_0x400a8b,_0x425fa2){return _0x400a8b[_0x87ba('0x8')](_0x87ba('0x9'),attributes,{'tableName':_0x87ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8254=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','util','../../config/logger','api','moment','bluebird'];(function(_0x592a9d,_0x434abb){var _0x59d2b3=function(_0x4661dc){while(--_0x4661dc){_0x592a9d['push'](_0x592a9d['shift']());}};_0x59d2b3(++_0x434abb);}(_0x8254,0xbe));var _0x4825=function(_0x4a1008,_0x5d116b){_0x4a1008=_0x4a1008-0x0;var _0x3368c4=_0x8254[_0x4a1008];return _0x3368c4;};'use strict';var _=require('lodash');var util=require(_0x4825('0x0'));var logger=require(_0x4825('0x1'))(_0x4825('0x2'));var moment=require(_0x4825('0x3'));var BPromise=require(_0x4825('0x4'));var rp=require(_0x4825('0x5'));var fs=require('fs');var path=require(_0x4825('0x6'));var rimraf=require(_0x4825('0x7'));var config=require(_0x4825('0x8'));var attributes=require(_0x4825('0x9'));module[_0x4825('0xa')]=function(_0x59e2b6,_0x393fc7){return _0x59e2b6['define'](_0x4825('0xb'),attributes,{'tableName':_0x4825('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 93e52bb..84ba6b9 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 _0xf250=['ShowTrunk','Trunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xf250,0xce));var _0x0f25=function(_0x3a9083,_0x3c9f8d){_0x3a9083=_0x3a9083-0x0;var _0x160306=_0xf250[_0x3a9083];return _0x160306;};'use strict';var _=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var moment=require(_0x0f25('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f25('0x3'));var fs=require('fs');var Redis=require(_0x0f25('0x4'));var db=require(_0x0f25('0x5'))['db'];var utils=require(_0x0f25('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0f25('0x7'));var jayson=require(_0x0f25('0x8'));var client=jayson[_0x0f25('0x9')][_0x0f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1210cd,_0x526fa9,_0x157a41){return new BPromise(function(_0x5f1c43,_0x488850){return client['request'](_0x1210cd,_0x157a41)[_0x0f25('0xb')](function(_0x522ec9){logger[_0x0f25('0xc')](_0x0f25('0xd'),_0x526fa9,'request\x20sent');logger[_0x0f25('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x526fa9,_0x0f25('0xf'),JSON[_0x0f25('0x10')](_0x522ec9));if(_0x522ec9['error']){if(_0x522ec9[_0x0f25('0x11')][_0x0f25('0x12')]===0x1f4){logger[_0x0f25('0x11')](_0x0f25('0xd'),_0x526fa9,_0x522ec9[_0x0f25('0x11')][_0x0f25('0x13')]);return _0x488850(_0x522ec9[_0x0f25('0x11')][_0x0f25('0x13')]);}logger[_0x0f25('0x11')]('Trunk,\x20%s,\x20%s',_0x526fa9,_0x522ec9['error'][_0x0f25('0x13')]);return _0x5f1c43(_0x522ec9[_0x0f25('0x11')][_0x0f25('0x13')]);}else{logger[_0x0f25('0xc')](_0x0f25('0xd'),_0x526fa9,_0x0f25('0xf'));_0x5f1c43(_0x522ec9[_0x0f25('0x14')][_0x0f25('0x13')]);}})[_0x0f25('0x15')](function(_0x308ae0){logger[_0x0f25('0x11')]('Trunk,\x20%s,\x20%s',_0x526fa9,_0x308ae0);_0x488850(_0x308ae0);});});}exports[_0x0f25('0x16')]=function(_0x11ced3){var _0x2a0ca7=this;return new Promise(function(_0x1b5612,_0x497426){return db['Trunk'][_0x0f25('0x17')]({'raw':_0x11ced3[_0x0f25('0x18')]?_0x11ced3[_0x0f25('0x18')][_0x0f25('0x19')]===undefined?!![]:![]:!![],'where':_0x11ced3[_0x0f25('0x18')]?_0x11ced3['options'][_0x0f25('0x1a')]||null:null,'attributes':_0x11ced3[_0x0f25('0x18')]?_0x11ced3[_0x0f25('0x18')][_0x0f25('0x1b')]||null:null,'limit':_0x11ced3[_0x0f25('0x18')]?_0x11ced3[_0x0f25('0x18')][_0x0f25('0x1c')]||null:null,'include':_0x11ced3[_0x0f25('0x18')]?_0x11ced3[_0x0f25('0x18')][_0x0f25('0x1d')]?_[_0x0f25('0x1e')](_0x11ced3[_0x0f25('0x18')][_0x0f25('0x1d')],function(_0x4e3071){return{'model':db[_0x4e3071[_0x0f25('0x1f')]],'as':_0x4e3071['as'],'attributes':_0x4e3071[_0x0f25('0x1b')],'include':_0x4e3071[_0x0f25('0x1d')]?_[_0x0f25('0x1e')](_0x4e3071['include'],function(_0x38acde){return{'model':db[_0x38acde[_0x0f25('0x1f')]],'as':_0x38acde['as'],'attributes':_0x38acde['attributes'],'include':_0x38acde['include']?_[_0x0f25('0x1e')](_0x38acde['include'],function(_0x18a242){return{'model':db[_0x18a242['model']],'as':_0x18a242['as'],'attributes':_0x18a242[_0x0f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f25('0xb')](function(_0x5b4fdd){logger[_0x0f25('0xc')](_0x0f25('0x16'),_0x11ced3);logger[_0x0f25('0xe')](_0x0f25('0x16'),_0x11ced3,JSON['stringify'](_0x5b4fdd));_0x1b5612(_0x5b4fdd);})[_0x0f25('0x15')](function(_0x370e26){logger[_0x0f25('0x11')]('GetTrunk',_0x370e26['message'],_0x11ced3);_0x497426(_0x2a0ca7['error'](0x1f4,_0x370e26[_0x0f25('0x13')]));});});};exports[_0x0f25('0x20')]=function(_0x2c284c){var _0x138d8c=this;return new Promise(function(_0x39eb3a,_0x16c7e2){return db[_0x0f25('0x21')]['find']({'raw':_0x2c284c[_0x0f25('0x18')]?_0x2c284c['options'][_0x0f25('0x19')]===undefined?!![]:![]:!![],'where':_0x2c284c[_0x0f25('0x18')]?_0x2c284c[_0x0f25('0x18')]['where']||null:null,'attributes':_0x2c284c[_0x0f25('0x18')]?_0x2c284c['options'][_0x0f25('0x1b')]||null:null,'include':_0x2c284c['options']?_0x2c284c['options'][_0x0f25('0x1d')]?_[_0x0f25('0x1e')](_0x2c284c[_0x0f25('0x18')][_0x0f25('0x1d')],function(_0x104326){return{'model':db[_0x104326['model']],'as':_0x104326['as'],'attributes':_0x104326[_0x0f25('0x1b')],'include':_0x104326['include']?_[_0x0f25('0x1e')](_0x104326[_0x0f25('0x1d')],function(_0x4fc781){return{'model':db[_0x4fc781[_0x0f25('0x1f')]],'as':_0x4fc781['as'],'attributes':_0x4fc781['attributes'],'include':_0x4fc781[_0x0f25('0x1d')]?_[_0x0f25('0x1e')](_0x4fc781[_0x0f25('0x1d')],function(_0x4bdf93){return{'model':db[_0x4bdf93[_0x0f25('0x1f')]],'as':_0x4bdf93['as'],'attributes':_0x4bdf93[_0x0f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f25('0xb')](function(_0x3722cd){logger[_0x0f25('0xc')](_0x0f25('0x20'),_0x2c284c);logger['debug'](_0x0f25('0x20'),_0x2c284c,JSON[_0x0f25('0x10')](_0x3722cd));_0x39eb3a(_0x3722cd);})['catch'](function(_0x427b4f){logger[_0x0f25('0x11')](_0x0f25('0x20'),_0x427b4f['message'],_0x2c284c);_0x16c7e2(_0x138d8c[_0x0f25('0x11')](0x1f4,_0x427b4f[_0x0f25('0x13')]));});});}; \ No newline at end of file +var _0x4e2d=['http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','then','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3d022e,_0xbcafaa){var _0x527e83=function(_0x386aa3){while(--_0x386aa3){_0x3d022e['push'](_0x3d022e['shift']());}};_0x527e83(++_0xbcafaa);}(_0x4e2d,0x15e));var _0xd4e2=function(_0x7660a0,_0x2f292f){_0x7660a0=_0x7660a0-0x0;var _0x18f8ef=_0x4e2d[_0x7660a0];return _0x18f8ef;};'use strict';var _=require(_0xd4e2('0x0'));var util=require(_0xd4e2('0x1'));var moment=require(_0xd4e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4e2('0x3'));var fs=require('fs');var Redis=require(_0xd4e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4e2('0x5'));var logger=require(_0xd4e2('0x6'))(_0xd4e2('0x7'));var config=require(_0xd4e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd4e2('0x9')][_0xd4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21f6c2,_0xca8aa,_0x2f55cc){return new BPromise(function(_0x40a6a5,_0x555d0e){return client[_0xd4e2('0xb')](_0x21f6c2,_0x2f55cc)['then'](function(_0x365507){logger[_0xd4e2('0xc')](_0xd4e2('0xd'),_0xca8aa,_0xd4e2('0xe'));logger[_0xd4e2('0xf')](_0xd4e2('0x10'),_0xca8aa,_0xd4e2('0xe'),JSON[_0xd4e2('0x11')](_0x365507));if(_0x365507[_0xd4e2('0x12')]){if(_0x365507[_0xd4e2('0x12')][_0xd4e2('0x13')]===0x1f4){logger[_0xd4e2('0x12')](_0xd4e2('0xd'),_0xca8aa,_0x365507['error'][_0xd4e2('0x14')]);return _0x555d0e(_0x365507['error'][_0xd4e2('0x14')]);}logger[_0xd4e2('0x12')]('Trunk,\x20%s,\x20%s',_0xca8aa,_0x365507['error'][_0xd4e2('0x14')]);return _0x40a6a5(_0x365507[_0xd4e2('0x12')]['message']);}else{logger[_0xd4e2('0xc')](_0xd4e2('0xd'),_0xca8aa,_0xd4e2('0xe'));_0x40a6a5(_0x365507[_0xd4e2('0x15')][_0xd4e2('0x14')]);}})[_0xd4e2('0x16')](function(_0x3c5331){logger['error']('Trunk,\x20%s,\x20%s',_0xca8aa,_0x3c5331);_0x555d0e(_0x3c5331);});});}exports[_0xd4e2('0x17')]=function(_0x345c3f){var _0x596da0=this;return new Promise(function(_0x35f176,_0x21a6e9){return db[_0xd4e2('0x18')][_0xd4e2('0x19')]({'raw':_0x345c3f['options']?_0x345c3f[_0xd4e2('0x1a')][_0xd4e2('0x1b')]===undefined?!![]:![]:!![],'where':_0x345c3f[_0xd4e2('0x1a')]?_0x345c3f[_0xd4e2('0x1a')][_0xd4e2('0x1c')]||null:null,'attributes':_0x345c3f[_0xd4e2('0x1a')]?_0x345c3f[_0xd4e2('0x1a')][_0xd4e2('0x1d')]||null:null,'limit':_0x345c3f['options']?_0x345c3f['options'][_0xd4e2('0x1e')]||null:null,'include':_0x345c3f['options']?_0x345c3f[_0xd4e2('0x1a')][_0xd4e2('0x1f')]?_[_0xd4e2('0x20')](_0x345c3f[_0xd4e2('0x1a')][_0xd4e2('0x1f')],function(_0x39967e){return{'model':db[_0x39967e[_0xd4e2('0x21')]],'as':_0x39967e['as'],'attributes':_0x39967e['attributes'],'include':_0x39967e[_0xd4e2('0x1f')]?_[_0xd4e2('0x20')](_0x39967e[_0xd4e2('0x1f')],function(_0x531f81){return{'model':db[_0x531f81[_0xd4e2('0x21')]],'as':_0x531f81['as'],'attributes':_0x531f81[_0xd4e2('0x1d')],'include':_0x531f81['include']?_[_0xd4e2('0x20')](_0x531f81[_0xd4e2('0x1f')],function(_0x361409){return{'model':db[_0x361409[_0xd4e2('0x21')]],'as':_0x361409['as'],'attributes':_0x361409[_0xd4e2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x436a06){logger['info'](_0xd4e2('0x17'),_0x345c3f);logger['debug'](_0xd4e2('0x17'),_0x345c3f,JSON['stringify'](_0x436a06));_0x35f176(_0x436a06);})[_0xd4e2('0x16')](function(_0x54356a){logger[_0xd4e2('0x12')](_0xd4e2('0x17'),_0x54356a[_0xd4e2('0x14')],_0x345c3f);_0x21a6e9(_0x596da0[_0xd4e2('0x12')](0x1f4,_0x54356a[_0xd4e2('0x14')]));});});};exports[_0xd4e2('0x22')]=function(_0x16d32f){var _0x167b6e=this;return new Promise(function(_0x2a2855,_0x4350ef){return db[_0xd4e2('0x18')]['find']({'raw':_0x16d32f['options']?_0x16d32f[_0xd4e2('0x1a')][_0xd4e2('0x1b')]===undefined?!![]:![]:!![],'where':_0x16d32f['options']?_0x16d32f[_0xd4e2('0x1a')]['where']||null:null,'attributes':_0x16d32f[_0xd4e2('0x1a')]?_0x16d32f[_0xd4e2('0x1a')][_0xd4e2('0x1d')]||null:null,'include':_0x16d32f[_0xd4e2('0x1a')]?_0x16d32f[_0xd4e2('0x1a')][_0xd4e2('0x1f')]?_[_0xd4e2('0x20')](_0x16d32f[_0xd4e2('0x1a')][_0xd4e2('0x1f')],function(_0x5c09cd){return{'model':db[_0x5c09cd[_0xd4e2('0x21')]],'as':_0x5c09cd['as'],'attributes':_0x5c09cd[_0xd4e2('0x1d')],'include':_0x5c09cd[_0xd4e2('0x1f')]?_[_0xd4e2('0x20')](_0x5c09cd[_0xd4e2('0x1f')],function(_0x2473bd){return{'model':db[_0x2473bd['model']],'as':_0x2473bd['as'],'attributes':_0x2473bd[_0xd4e2('0x1d')],'include':_0x2473bd[_0xd4e2('0x1f')]?_[_0xd4e2('0x20')](_0x2473bd[_0xd4e2('0x1f')],function(_0x10141c){return{'model':db[_0x10141c[_0xd4e2('0x21')]],'as':_0x10141c['as'],'attributes':_0x10141c[_0xd4e2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd4e2('0x23')](function(_0x59a247){logger['info'](_0xd4e2('0x22'),_0x16d32f);logger[_0xd4e2('0xf')](_0xd4e2('0x22'),_0x16d32f,JSON[_0xd4e2('0x11')](_0x59a247));_0x2a2855(_0x59a247);})[_0xd4e2('0x16')](function(_0x3ea68f){logger[_0xd4e2('0x12')](_0xd4e2('0x22'),_0x3ea68f[_0xd4e2('0x14')],_0x16d32f);_0x4350ef(_0x167b6e[_0xd4e2('0x12')](0x1f4,_0x3ea68f[_0xd4e2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e10f4fc..02978d5 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 _0xafbf=['fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','util','connect-timeout','express'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xafbf,0x1dd));var _0xfafb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xafbf[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xfafb('0x0'));var path=require('path');var timeout=require(_0xfafb('0x1'));var express=require(_0xfafb('0x2'));var router=express['Router']();var fs_extra=require(_0xfafb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfafb('0x4'));var config=require(_0xfafb('0x5'));var controller=require(_0xfafb('0x6'));router[_0xfafb('0x7')]('/',auth[_0xfafb('0x8')](),controller['index']);router['get'](_0xfafb('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/whoami',auth[_0xfafb('0x8')](),controller[_0xfafb('0xa')]);router[_0xfafb('0x7')](_0xfafb('0xb'),auth['isAuthenticated'](),controller[_0xfafb('0xc')]);router[_0xfafb('0x7')](_0xfafb('0xd'),auth['isAuthenticated'](),controller[_0xfafb('0xe')]);router[_0xfafb('0x7')](_0xfafb('0xf'),controller[_0xfafb('0x10')]);router[_0xfafb('0x7')](_0xfafb('0x11'),auth[_0xfafb('0x8')](),controller['getOpenTabs']);router[_0xfafb('0x7')](_0xfafb('0x12'),auth['isAuthenticated'](),controller[_0xfafb('0x13')]);router['get'](_0xfafb('0x14'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x15')]);router[_0xfafb('0x7')]('/:id/queues_rt',auth[_0xfafb('0x8')](),controller[_0xfafb('0x16')]);router['get'](_0xfafb('0x17'),auth['isAuthenticated'](),controller[_0xfafb('0x18')]);router[_0xfafb('0x7')](_0xfafb('0x19'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x1a')]);router[_0xfafb('0x7')](_0xfafb('0x1b'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x1c')]);router[_0xfafb('0x7')](_0xfafb('0x1d'),auth[_0xfafb('0x8')](),controller['getChatInteractions']);router[_0xfafb('0x7')](_0xfafb('0x1e'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x1f')]);router[_0xfafb('0x7')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0xfafb('0x20')]);router['get'](_0xfafb('0x21'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x22')]);router[_0xfafb('0x7')](_0xfafb('0x23'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x24')]);router[_0xfafb('0x7')](_0xfafb('0x25'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x26')]);router[_0xfafb('0x7')](_0xfafb('0x27'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x28')]);router['get'](_0xfafb('0x29'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x2a')]);router[_0xfafb('0x7')](_0xfafb('0x2b'),auth['isAuthenticated'](),controller[_0xfafb('0x2c')]);router[_0xfafb('0x7')](_0xfafb('0x2d'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x2e')]);router[_0xfafb('0x7')](_0xfafb('0x2f'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x30')]);router[_0xfafb('0x7')](_0xfafb('0x31'),auth['isAuthenticated'](),controller[_0xfafb('0x32')]);router[_0xfafb('0x7')](_0xfafb('0x33'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x34')]);router[_0xfafb('0x7')]('/:id/sms_accounts',auth[_0xfafb('0x8')](),controller[_0xfafb('0x35')]);router[_0xfafb('0x7')](_0xfafb('0x36'),auth[_0xfafb('0x8')](),controller['getChatWebsites']);router[_0xfafb('0x7')](_0xfafb('0x37'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x38')]);router[_0xfafb('0x7')](_0xfafb('0x39'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x3a')]);router['get'](_0xfafb('0x3b'),auth[_0xfafb('0x8')](),controller['getScheduledCalls']);router[_0xfafb('0x7')](_0xfafb('0x3c'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x3d')]);router['post']('/:id/contacts',auth[_0xfafb('0x8')](),controller[_0xfafb('0x3e')]);router[_0xfafb('0x3f')]('/',auth[_0xfafb('0x8')](),controller[_0xfafb('0x40')]);router[_0xfafb('0x3f')]('/create_many',auth[_0xfafb('0x8')](),controller[_0xfafb('0x41')]);router[_0xfafb('0x3f')](_0xfafb('0x14'),auth['isAuthenticated'](),controller[_0xfafb('0x42')]);var upload=multer({'storage':multer[_0xfafb('0x43')]({'destination':function(_0x102f02,_0x165b7f,_0xd402c2){_0xd402c2(null,path[_0xfafb('0x44')](config[_0xfafb('0x45')],_0xfafb('0x46')));},'filename':function(_0x1a4429,_0xcbdd2c,_0x5d63bb){_0x5d63bb(null,util[_0xfafb('0x47')](_0xfafb('0x48'),Date[_0xfafb('0x49')](),_0xcbdd2c[_0xfafb('0x4a')]));}})});router[_0xfafb('0x3f')]('/:id/avatar',upload[_0xfafb('0x4b')](_0xfafb('0x4c')),controller[_0xfafb('0x4d')]);router[_0xfafb('0x3f')]('/:id/login',auth[_0xfafb('0x8')](),controller[_0xfafb('0x4e')]);router[_0xfafb('0x3f')](_0xfafb('0x4f'),auth[_0xfafb('0x8')](),controller['logout']);router[_0xfafb('0x3f')](_0xfafb('0x50'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x51')]);router[_0xfafb('0x3f')](_0xfafb('0x52'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x53')]);router['post']('/:id/teams',auth[_0xfafb('0x8')](),controller[_0xfafb('0x54')]);router['post'](_0xfafb('0x55'),auth['isAuthenticated'](),controller[_0xfafb('0x56')]);router[_0xfafb('0x3f')]('/:id/mail_interactions',auth[_0xfafb('0x8')](),controller[_0xfafb('0x57')]);router[_0xfafb('0x3f')]('/:id/fax_interactions',auth[_0xfafb('0x8')](),controller[_0xfafb('0x58')]);router[_0xfafb('0x3f')]('/:id/sms_interactions',auth[_0xfafb('0x8')](),controller['addSmsInteractions']);router['post'](_0xfafb('0x59'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x5a')]);router['post'](_0xfafb('0x5b'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x5c')]);router[_0xfafb('0x3f')]('/:id/fax_accounts',auth[_0xfafb('0x8')](),controller[_0xfafb('0x5d')]);router[_0xfafb('0x3f')](_0xfafb('0x31'),auth[_0xfafb('0x8')](),controller['addMailAccounts']);router[_0xfafb('0x3f')](_0xfafb('0x33'),auth['isAuthenticated'](),controller[_0xfafb('0x5e')]);router[_0xfafb('0x3f')](_0xfafb('0x5f'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x60')]);router[_0xfafb('0x3f')](_0xfafb('0x36'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x61')]);router[_0xfafb('0x3f')](_0xfafb('0x37'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x62')]);router['post'](_0xfafb('0x39'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x63')]);router['post']('/:id/api_key',auth[_0xfafb('0x8')](),controller[_0xfafb('0x64')]);router['put'](_0xfafb('0xd'),auth[_0xfafb('0x8')](),controller['update']);router[_0xfafb('0x65')](_0xfafb('0x66'),auth[_0xfafb('0x8')](),controller['changePassword']);router[_0xfafb('0x67')](_0xfafb('0x14'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x68')]);router[_0xfafb('0x67')]('/:id/teams',auth[_0xfafb('0x8')](),controller[_0xfafb('0x69')]);router[_0xfafb('0x67')](_0xfafb('0xd'),auth['isAuthenticated'](),controller[_0xfafb('0x6a')]);router[_0xfafb('0x67')](_0xfafb('0x55'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x6b')]);router[_0xfafb('0x67')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xfafb('0x6c')]);router['delete'](_0xfafb('0x6d'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x6e')]);router['delete'](_0xfafb('0x6f'),auth['isAuthenticated'](),controller[_0xfafb('0x70')]);router[_0xfafb('0x67')](_0xfafb('0x59'),auth['isAuthenticated'](),controller[_0xfafb('0x71')]);router[_0xfafb('0x67')](_0xfafb('0x5b'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x72')]);router['delete'](_0xfafb('0x2f'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x73')]);router[_0xfafb('0x67')](_0xfafb('0x31'),auth[_0xfafb('0x8')](),controller['removeMailAccounts']);router[_0xfafb('0x67')](_0xfafb('0x33'),auth[_0xfafb('0x8')](),controller['removeOpenchannelAccounts']);router[_0xfafb('0x67')](_0xfafb('0x5f'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xfafb('0x67')]('/:id/chat_websites',auth[_0xfafb('0x8')](),controller[_0xfafb('0x74')]);router[_0xfafb('0x67')](_0xfafb('0x37'),auth[_0xfafb('0x8')](),controller['removeWhatsappAccounts']);router[_0xfafb('0x67')]('/:id/square_projects',auth[_0xfafb('0x8')](),controller[_0xfafb('0x75')]);router[_0xfafb('0x67')](_0xfafb('0x3c'),auth[_0xfafb('0x8')](),controller[_0xfafb('0x76')]);module[_0xfafb('0x77')]=router; \ No newline at end of file +var _0x1efb=['addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/square_projects','removeApiKey','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x1efb,0x88));var _0xb1ef=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1efb[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xb1ef('0x0'));var util=require('util');var path=require(_0xb1ef('0x1'));var timeout=require('connect-timeout');var express=require(_0xb1ef('0x2'));var router=express[_0xb1ef('0x3')]();var fs_extra=require(_0xb1ef('0x4'));var auth=require(_0xb1ef('0x5'));var interaction=require(_0xb1ef('0x6'));var config=require('../../config/environment');var controller=require(_0xb1ef('0x7'));router[_0xb1ef('0x8')]('/',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0xa')]);router[_0xb1ef('0x8')](_0xb1ef('0xb'),auth['isAuthenticated'](),controller[_0xb1ef('0xc')]);router['get']('/whoami',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0xd')]);router['get'](_0xb1ef('0xe'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0xf')]);router['get'](_0xb1ef('0x10'),auth['isAuthenticated'](),controller[_0xb1ef('0x11')]);router[_0xb1ef('0x8')](_0xb1ef('0x12'),controller[_0xb1ef('0x13')]);router[_0xb1ef('0x8')](_0xb1ef('0x14'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x15')]);router['get'](_0xb1ef('0x16'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x17')]);router[_0xb1ef('0x8')](_0xb1ef('0x18'),auth[_0xb1ef('0x9')](),controller['getQueues']);router['get']('/:id/queues_rt',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x19')]);router[_0xb1ef('0x8')](_0xb1ef('0x1a'),auth['isAuthenticated'](),controller[_0xb1ef('0x1b')]);router['get'](_0xb1ef('0x1c'),auth[_0xb1ef('0x9')](),controller['getRecordings']);router[_0xb1ef('0x8')](_0xb1ef('0x1d'),auth[_0xb1ef('0x9')](),controller['getScreenRecordings']);router[_0xb1ef('0x8')](_0xb1ef('0x1e'),auth[_0xb1ef('0x9')](),controller['getChatInteractions']);router[_0xb1ef('0x8')]('/:id/openchannel/interactions',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x1f')]);router['get'](_0xb1ef('0x20'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x21')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xb1ef('0x22')]);router['get']('/:id/fax/interactions',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x23')]);router[_0xb1ef('0x8')](_0xb1ef('0x24'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get'](_0xb1ef('0x25'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x26')]);router[_0xb1ef('0x8')](_0xb1ef('0x27'),auth['isAuthenticated'](),controller[_0xb1ef('0x28')]);router['get'](_0xb1ef('0x29'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x2a')]);router['get'](_0xb1ef('0x2b'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x2c')]);router[_0xb1ef('0x8')](_0xb1ef('0x2d'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x2e')]);router[_0xb1ef('0x8')](_0xb1ef('0x2f'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x30')]);router[_0xb1ef('0x8')](_0xb1ef('0x31'),auth[_0xb1ef('0x9')](),controller['getOpenchannelAccounts']);router['get'](_0xb1ef('0x32'),auth['isAuthenticated'](),controller[_0xb1ef('0x33')]);router[_0xb1ef('0x8')]('/:id/chat_websites',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x34')]);router[_0xb1ef('0x8')](_0xb1ef('0x35'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x36')]);router[_0xb1ef('0x8')]('/:id/square_projects',auth[_0xb1ef('0x9')](),controller['getSquareProjects']);router[_0xb1ef('0x8')](_0xb1ef('0x37'),auth[_0xb1ef('0x9')](),controller['getScheduledCalls']);router[_0xb1ef('0x8')](_0xb1ef('0x38'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x39')]);router[_0xb1ef('0x3a')](_0xb1ef('0x16'),auth[_0xb1ef('0x9')](),controller['addContacts']);router[_0xb1ef('0x3a')]('/',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x3b')]);router[_0xb1ef('0x3a')](_0xb1ef('0x3c'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xb1ef('0x3a')]('/:id/queues',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x3d')]);var upload=multer({'storage':multer[_0xb1ef('0x3e')]({'destination':function(_0x350ad9,_0x2b231b,_0x2b82fa){_0x2b82fa(null,path[_0xb1ef('0x3f')](config[_0xb1ef('0x40')],_0xb1ef('0x41')));},'filename':function(_0x280baf,_0x4ba7e3,_0x534529){_0x534529(null,util[_0xb1ef('0x42')](_0xb1ef('0x43'),Date[_0xb1ef('0x44')](),_0x4ba7e3['originalname']));}})});router[_0xb1ef('0x3a')]('/:id/avatar',upload['single']('file'),controller[_0xb1ef('0x45')]);router['post'](_0xb1ef('0x46'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x47')]);router[_0xb1ef('0x3a')]('/:id/logout',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x48')]);router[_0xb1ef('0x3a')](_0xb1ef('0x49'),auth['isAuthenticated'](),controller[_0xb1ef('0x4a')]);router[_0xb1ef('0x3a')](_0xb1ef('0x4b'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x4c')]);router['post'](_0xb1ef('0x25'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x4d')]);router[_0xb1ef('0x3a')](_0xb1ef('0x4e'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x4f')]);router[_0xb1ef('0x3a')](_0xb1ef('0x50'),auth['isAuthenticated'](),controller[_0xb1ef('0x51')]);router[_0xb1ef('0x3a')](_0xb1ef('0x52'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x53')]);router[_0xb1ef('0x3a')](_0xb1ef('0x54'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x55')]);router[_0xb1ef('0x3a')](_0xb1ef('0x56'),auth[_0xb1ef('0x9')](),controller['addOpenchannelInteractions']);router['post'](_0xb1ef('0x57'),auth[_0xb1ef('0x9')](),controller['addWhatsappInteractions']);router['post'](_0xb1ef('0x2d'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x58')]);router[_0xb1ef('0x3a')](_0xb1ef('0x2f'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x59')]);router[_0xb1ef('0x3a')](_0xb1ef('0x31'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x5a')]);router[_0xb1ef('0x3a')](_0xb1ef('0x32'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x5b')]);router[_0xb1ef('0x3a')](_0xb1ef('0x5c'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x5d')]);router[_0xb1ef('0x3a')](_0xb1ef('0x35'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x5e')]);router[_0xb1ef('0x3a')]('/:id/square_projects',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x5f')]);router['post'](_0xb1ef('0x38'),auth[_0xb1ef('0x9')](),controller['createApiKey']);router[_0xb1ef('0x60')](_0xb1ef('0x10'),auth[_0xb1ef('0x9')](),controller['update']);router['put']('/:id/password',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x61')]);router[_0xb1ef('0x62')](_0xb1ef('0x18'),auth[_0xb1ef('0x9')](),controller['removeQueues']);router[_0xb1ef('0x62')](_0xb1ef('0x25'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x63')]);router[_0xb1ef('0x62')](_0xb1ef('0x10'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x64')]);router[_0xb1ef('0x62')](_0xb1ef('0x4e'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x65')]);router[_0xb1ef('0x62')](_0xb1ef('0x50'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x66')]);router[_0xb1ef('0x62')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xb1ef('0x62')](_0xb1ef('0x54'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x67')]);router[_0xb1ef('0x62')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete'](_0xb1ef('0x57'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x68')]);router['delete'](_0xb1ef('0x2d'),auth['isAuthenticated'](),controller[_0xb1ef('0x69')]);router[_0xb1ef('0x62')](_0xb1ef('0x2f'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x6a')]);router['delete'](_0xb1ef('0x31'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x6b')]);router['delete'](_0xb1ef('0x32'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0xb1ef('0x5c'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x6c')]);router['delete']('/:id/whatsapp_accounts',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x6d')]);router[_0xb1ef('0x62')](_0xb1ef('0x6e'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0xb1ef('0x62')](_0xb1ef('0x38'),auth[_0xb1ef('0x9')](),controller[_0xb1ef('0x6f')]);module[_0xb1ef('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 5c89afc..7392fe7 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 _0x9b67=['PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','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]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','actpass','update','update,nonat','TEXT','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9b67,0xf6));var _0x79b6=function(_0x29961f,_0x1cca0d){_0x29961f=_0x29961f-0x0;var _0x237270=_0x9b67[_0x29961f];return _0x237270;};'use strict';var Sequelize=require(_0x79b6('0x0'));var moment=require(_0x79b6('0x1'));var util=require(_0x79b6('0x2'));var _=require(_0x79b6('0x3'));module[_0x79b6('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x79b6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1aeb24){this['setDataValue']('name',_0x1aeb24);this[_0x79b6('0x6')](_0x79b6('0x7'),_0x1aeb24);},'comment':_0x79b6('0x8')},'fullname':{'type':Sequelize[_0x79b6('0x9')],'allowNull':![],'set':function(_0xfa6a05){this[_0x79b6('0x6')](_0x79b6('0xa'),_0xfa6a05);this['setDataValue'](_0x79b6('0xb'),util[_0x79b6('0xc')](_0x79b6('0xd'),_0xfa6a05,this[_0x79b6('0xe')](_0x79b6('0xf'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x79b6('0x9')],'allowNull':![],'unique':_0x79b6('0x10'),'validate':{'isEmail':!![]},'set':function(_0x3f3b44){if(_0x3f3b44){this[_0x79b6('0x6')]('email',_0x3f3b44['toLowerCase']());}}},'role':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x12'),_0x79b6('0x13'),'agent',_0x79b6('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x79b6('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x79b6('0x9')],'defaultValue':_0x79b6('0x15')},'internal':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':![],'unique':_0x79b6('0xf'),'set':function(_0x19d5b2){this[_0x79b6('0x6')](_0x79b6('0xf'),_0x19d5b2);this[_0x79b6('0x6')](_0x79b6('0x17'),_0x19d5b2);this[_0x79b6('0x6')](_0x79b6('0xb'),util['format'](_0x79b6('0xd'),this[_0x79b6('0xe')](_0x79b6('0xa')),_0x19d5b2));}},'salt':{'type':Sequelize[_0x79b6('0x9')]},'phone':{'type':Sequelize[_0x79b6('0x9')]},'mobile':{'type':Sequelize[_0x79b6('0x9')]},'address':{'type':Sequelize[_0x79b6('0x9')]},'zipcode':{'type':Sequelize[_0x79b6('0x9')]},'userpic':{'type':Sequelize[_0x79b6('0x9')]},'city':{'type':Sequelize[_0x79b6('0x9')]},'country':{'type':Sequelize[_0x79b6('0x9')]},'online':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x79b6('0x19')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x79b6('0x9')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x79b6('0x19')]},'chatCapacity':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x79b6('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![],'defaultValue':_0x79b6('0x1a')},'ipaddr':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x79b6('0x11')]('friend',_0x79b6('0x13'),_0x79b6('0x1b')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![],'defaultValue':_0x79b6('0x1c')},'callingpres':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x1d'),_0x79b6('0x1e'),_0x79b6('0x1f'),'ALLOWED',_0x79b6('0x20'),_0x79b6('0x21'),_0x79b6('0x22'),_0x79b6('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![],'defaultValue':'udp','set':function(_0x533a43){this[_0x79b6('0x6')](_0x79b6('0x24'),_0x533a43?_0x533a43[_0x79b6('0x25')](','):null);},'get':function(){return this[_0x79b6('0xe')](_0x79b6('0x24'))?this[_0x79b6('0xe')]('transport')['split'](','):null;},'comment':_0x79b6('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x79b6('0x27'),'info',_0x79b6('0x28'),_0x79b6('0x29'),'auto'),'allowNull':!![],'defaultValue':_0x79b6('0x27')},'directmedia':{'type':Sequelize[_0x79b6('0x11')]('yes','no',_0x79b6('0x2a'),'update',_0x79b6('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![],'defaultValue':_0x79b6('0x2d'),'set':function(_0x276eb5){this[_0x79b6('0x6')](_0x79b6('0x2e'),_0x276eb5?_0x276eb5['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x79b6('0xe')](_0x79b6('0x2e'))['split'](','):null;},'comment':_0x79b6('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x79b6('0x9')]},'pickupgroup':{'type':Sequelize[_0x79b6('0x9')]},'namedpickupgroup':{'type':Sequelize[_0x79b6('0x9')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x79b6('0x9')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x79b6('0x30')},'allow':{'type':Sequelize[_0x79b6('0x9')],'allowNull':![],'defaultValue':_0x79b6('0x31'),'set':function(_0x2feeeb){this[_0x79b6('0x6')]('allow',_0x2feeeb?_0x2feeeb['join'](';'):_0x79b6('0x31'));},'get':function(){return this['getDataValue'](_0x79b6('0x32'))?this[_0x79b6('0xe')](_0x79b6('0x32'))[_0x79b6('0x33')](';'):null;},'comment':_0x79b6('0x34')},'autoframing':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x109514){this[_0x79b6('0x6')](_0x79b6('0x35'),_0x109514?_0x109514[_0x79b6('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x79b6('0x35'))?this['getDataValue']('insecure')[_0x79b6('0x33')](','):null;},'comment':_0x79b6('0x36')},'trustrpid':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x79b6('0x11')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x79b6('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![],'defaultValue':_0x79b6('0x37')},'amaflags':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x79b6('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x79b6('0x11')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no',_0x79b6('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x39'),_0x79b6('0x3a'),_0x79b6('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x3c'),_0x79b6('0x3d')),'allowNull':!![],'defaultValue':_0x79b6('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x79b6('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no',_0x79b6('0x3e'),_0x79b6('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x79b6('0x11')]('active','passive',_0x79b6('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x79b6('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x79b6('0x11')](_0x79b6('0x2c'),'no',_0x79b6('0x2a'),_0x79b6('0x41'),_0x79b6('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x79b6('0x19')]},'passwordResetAt':{'type':Sequelize[_0x79b6('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x79b6('0x43')]},'showWebBar':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0,'set':function(_0xa01f94){this[_0x79b6('0x6')]('showWebBar',_0xa01f94);var _0x3a4765=this[_0x79b6('0x44')]({'plain':!![]});switch(_0xa01f94){case 0x0:case 0x1:var _0x81d4c0=_0x3a4765[_0x79b6('0x24')]?_[_0x79b6('0x45')](_0x3a4765[_0x79b6('0x24')])?_0x3a4765[_0x79b6('0x24')][_0x79b6('0x25')]():_0x3a4765['transport']:_0x79b6('0x46');if(_0x81d4c0===_0x79b6('0x47')){_0x81d4c0=_0x79b6('0x46');}this[_0x79b6('0x6')]('transport',_0x81d4c0);this[_0x79b6('0x6')](_0x79b6('0x48'),'no');this['setDataValue'](_0x79b6('0x49'),null);this['setDataValue']('force_avp',null);this[_0x79b6('0x6')](_0x79b6('0x4a'),null);this[_0x79b6('0x6')](_0x79b6('0x4b'),null);this[_0x79b6('0x6')](_0x79b6('0x4c'),null);this['setDataValue'](_0x79b6('0x4d'),null);this['setDataValue'](_0x79b6('0x4e'),null);this['setDataValue'](_0x79b6('0x4f'),null);this[_0x79b6('0x6')](_0x79b6('0x50'),'no');break;case 0x2:this[_0x79b6('0x6')](_0x79b6('0x24'),_0x79b6('0x47'));this['setDataValue']('encryption',_0x79b6('0x2c'));this[_0x79b6('0x6')](_0x79b6('0x49'),_0x79b6('0x2c'));this[_0x79b6('0x6')](_0x79b6('0x51'),'yes');this[_0x79b6('0x6')]('icesupport',_0x79b6('0x2c'));this['setDataValue'](_0x79b6('0x4b'),'yes');this[_0x79b6('0x6')](_0x79b6('0x4c'),'no');this[_0x79b6('0x6')]('dtlssetup',_0x79b6('0x40'));this[_0x79b6('0x6')](_0x79b6('0x4e'),_0x3a4765[_0x79b6('0x4e')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x79b6('0x4f'),_0x3a4765[_0x79b6('0x4f')]||_0x79b6('0x52'));this[_0x79b6('0x6')](_0x79b6('0x50'),_0x79b6('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x79b6('0x43')],'set':function(_0x3f9595){this[_0x79b6('0x6')]('permissions',_0x3f9595?_0x3f9595['join'](','):[]);},'get':function(){return this[_0x79b6('0xe')](_0x79b6('0x53'))?_[_0x79b6('0x54')](this[_0x79b6('0xe')](_0x79b6('0x53'))[_0x79b6('0x33')](','),function(_0x4adb22){return parseInt(_0x4adb22,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x79b6('0x9')]},'phoneBarBusyNumber':{'type':Sequelize[_0x79b6('0x9')]},'phoneBarUnconditional':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x79b6('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x79b6('0x9')]},'phoneBarEnableJaws':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x79b6('0x55')],'get':function(){return this[_0x79b6('0xe')]('phoneBarEnableScreenRecordingByAgent')?this[_0x79b6('0xe')](_0x79b6('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x79b6('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![],'set':function(_0x51d7f3){if(typeof _0x51d7f3==='string'){var _0x197f87=_0x51d7f3==='1'?!![]:_0x51d7f3==='0'?![]:_0x51d7f3===_0x79b6('0x57')?!![]:_0x51d7f3===_0x79b6('0x58')?![]:![];this['setDataValue'](_0x79b6('0x59'),_0x197f87);}else{this[_0x79b6('0x6')](_0x79b6('0x59'),_0x51d7f3);}}},'blocked':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![],'set':function(_0x4333bf){this[_0x79b6('0x6')](_0x79b6('0x5a'),_0x4333bf);if(_0x4333bf===!![]){this[_0x79b6('0x6')](_0x79b6('0x5b'),moment());this[_0x79b6('0x6')](_0x79b6('0x5c'),0x0);}else{this[_0x79b6('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x79b6('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x79b6('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x79b6('0x16')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x79b6('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0x455d=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','TEXT','showWebBar','wss','encryption','avpf','force_avp','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','loginAttempts','blockedAt','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','local','accountcode','callerid','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x455d,0x190));var _0xd455=function(_0x4ef3d9,_0x2578f5){_0x4ef3d9=_0x4ef3d9-0x0;var _0x4d74da=_0x455d[_0x4ef3d9];return _0x4d74da;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0xd455('0x0'));var _=require(_0xd455('0x1'));module[_0xd455('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd455('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x365b39){this[_0xd455('0x4')](_0xd455('0x3'),_0x365b39);this[_0xd455('0x4')](_0xd455('0x5'),_0x365b39);},'comment':_0xd455('0x6')},'fullname':{'type':Sequelize[_0xd455('0x7')],'allowNull':![],'set':function(_0x3b373c){this['setDataValue'](_0xd455('0x8'),_0x3b373c);this[_0xd455('0x4')]('callerid',util[_0xd455('0x9')](_0xd455('0xa'),_0x3b373c,this[_0xd455('0xb')](_0xd455('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd455('0x7')],'allowNull':![],'unique':_0xd455('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5a4f0f){if(_0x5a4f0f){this[_0xd455('0x4')](_0xd455('0xd'),_0x5a4f0f[_0xd455('0xe')]());}}},'role':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x10'),_0xd455('0x11'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xd455('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd455('0x7')],'defaultValue':_0xd455('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd455('0xc'),'set':function(_0x39fa8b){this[_0xd455('0x4')](_0xd455('0xc'),_0x39fa8b);this[_0xd455('0x4')](_0xd455('0x13'),_0x39fa8b);this[_0xd455('0x4')](_0xd455('0x14'),util[_0xd455('0x9')]('\x22%s\x22\x20<%s>',this[_0xd455('0xb')](_0xd455('0x8')),_0x39fa8b));}},'salt':{'type':Sequelize[_0xd455('0x7')]},'phone':{'type':Sequelize[_0xd455('0x7')]},'mobile':{'type':Sequelize[_0xd455('0x7')]},'address':{'type':Sequelize[_0xd455('0x7')]},'zipcode':{'type':Sequelize[_0xd455('0x7')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xd455('0x7')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd455('0x16')]},'voicePause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd455('0x7')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xd455('0x16')]},'chatCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd455('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![],'defaultValue':_0xd455('0x18')},'ipaddr':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0xd455('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x19'),_0xd455('0x11'),_0xd455('0x1a')),'allowNull':!![],'defaultValue':_0xd455('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd455('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xd455('0x1c'),'ALLOWED_PASSED_SCREEN',_0xd455('0x1d'),_0xd455('0x1e'),_0xd455('0x1f'),'PROHIB_PASSED_SCREEN',_0xd455('0x20'),_0xd455('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd455('0x22'),'set':function(_0x229c94){this[_0xd455('0x4')](_0xd455('0x23'),_0x229c94?_0x229c94[_0xd455('0x24')](','):null);},'get':function(){return this[_0xd455('0xb')](_0xd455('0x23'))?this[_0xd455('0xb')](_0xd455('0x23'))[_0xd455('0x25')](','):null;},'comment':_0xd455('0x26')},'dtmfmode':{'type':Sequelize[_0xd455('0xf')]('rfc2833',_0xd455('0x27'),_0xd455('0x28'),_0xd455('0x29'),_0xd455('0x2a')),'allowNull':!![],'defaultValue':_0xd455('0x2b')},'directmedia':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no',_0xd455('0x2d'),_0xd455('0x2e'),_0xd455('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![],'defaultValue':_0xd455('0x30'),'set':function(_0x2a4fbe){this[_0xd455('0x4')](_0xd455('0x31'),_0x2a4fbe?_0x2a4fbe[_0xd455('0x24')](','):null);},'get':function(){return this[_0xd455('0xb')](_0xd455('0x31'))?this[_0xd455('0xb')](_0xd455('0x31'))[_0xd455('0x25')](','):null;},'comment':_0xd455('0x32')},'callgroup':{'type':Sequelize[_0xd455('0x7')]},'namedcallgroup':{'type':Sequelize[_0xd455('0x7')]},'pickupgroup':{'type':Sequelize[_0xd455('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xd455('0x7')]},'language':{'type':Sequelize[_0xd455('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd455('0x7')]},'disallow':{'type':Sequelize[_0xd455('0x7')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1a37e1){this[_0xd455('0x4')]('allow',_0x1a37e1?_0x1a37e1[_0xd455('0x24')](';'):_0xd455('0x33'));},'get':function(){return this[_0xd455('0xb')](_0xd455('0x34'))?this[_0xd455('0xb')](_0xd455('0x34'))['split'](';'):null;},'comment':_0xd455('0x35')},'autoframing':{'type':Sequelize['ENUM'](_0xd455('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![],'set':function(_0x591753){this[_0xd455('0x4')](_0xd455('0x36'),_0x591753?_0x591753['join'](','):null);},'get':function(){return this[_0xd455('0xb')](_0xd455('0x36'))?this[_0xd455('0xb')](_0xd455('0x36'))[_0xd455('0x25')](','):null;},'comment':_0xd455('0x37')},'trustrpid':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![],'defaultValue':_0xd455('0x38')},'amaflags':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd455('0xf')]('yes','no',_0xd455('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xd455('0x3a'),_0xd455('0x3b'),_0xd455('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xd455('0x3d'),_0xd455('0x3e')),'allowNull':!![],'defaultValue':_0xd455('0x3e')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0xd455('0x2c')},'keepalive':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd455('0xf')]('yes','no','fingerprint',_0xd455('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd455('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x40'),_0xd455('0x41'),_0xd455('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xd455('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd455('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no',_0xd455('0x2d'),_0xd455('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd455('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xd455('0x16')]},'passwordResetAt':{'type':Sequelize[_0xd455('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd455('0x43')]},'showWebBar':{'type':Sequelize[_0xd455('0x17')],'defaultValue':0x0,'set':function(_0x198ca9){this['setDataValue'](_0xd455('0x44'),_0x198ca9);var _0x1cd2df=this['get']({'plain':!![]});switch(_0x198ca9){case 0x0:case 0x1:var _0x3d49ab=_0x1cd2df[_0xd455('0x23')]?_['isArray'](_0x1cd2df['transport'])?_0x1cd2df['transport'][_0xd455('0x24')]():_0x1cd2df[_0xd455('0x23')]:_0xd455('0x22');if(_0x3d49ab===_0xd455('0x45')){_0x3d49ab=_0xd455('0x22');}this[_0xd455('0x4')](_0xd455('0x23'),_0x3d49ab);this['setDataValue'](_0xd455('0x46'),'no');this['setDataValue'](_0xd455('0x47'),null);this['setDataValue'](_0xd455('0x48'),null);this[_0xd455('0x4')]('icesupport',null);this[_0xd455('0x4')](_0xd455('0x49'),null);this['setDataValue']('dtlsverify',null);this[_0xd455('0x4')](_0xd455('0x4a'),null);this[_0xd455('0x4')](_0xd455('0x4b'),null);this[_0xd455('0x4')](_0xd455('0x4c'),null);this[_0xd455('0x4')](_0xd455('0x4d'),'no');break;case 0x2:this[_0xd455('0x4')]('transport',_0xd455('0x45'));this[_0xd455('0x4')](_0xd455('0x46'),_0xd455('0x2c'));this['setDataValue'](_0xd455('0x47'),_0xd455('0x2c'));this[_0xd455('0x4')](_0xd455('0x48'),_0xd455('0x2c'));this[_0xd455('0x4')](_0xd455('0x4e'),_0xd455('0x2c'));this[_0xd455('0x4')]('dtlsenable',_0xd455('0x2c'));this[_0xd455('0x4')]('dtlsverify','no');this[_0xd455('0x4')]('dtlssetup','actpass');this[_0xd455('0x4')](_0xd455('0x4b'),_0x1cd2df[_0xd455('0x4b')]||_0xd455('0x4f'));this[_0xd455('0x4')]('dtlsprivatekey',_0x1cd2df['dtlsprivatekey']||_0xd455('0x50'));this[_0xd455('0x4')](_0xd455('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xd455('0x43')],'set':function(_0x1afc20){this[_0xd455('0x4')]('permissions',_0x1afc20?_0x1afc20[_0xd455('0x24')](','):[]);},'get':function(){return this[_0xd455('0xb')](_0xd455('0x51'))?_[_0xd455('0x52')](this[_0xd455('0xb')]('permissions')[_0xd455('0x25')](','),function(_0x2856eb){return parseInt(_0x2856eb,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd455('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd455('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd455('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd455('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd455('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd455('0xf')](_0xd455('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd455('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd455('0x53')],'get':function(){return this[_0xd455('0xb')](_0xd455('0x54'))?this[_0xd455('0xb')](_0xd455('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd455('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x451c4c){if(typeof _0x451c4c===_0xd455('0x55')){var _0x4f040b=_0x451c4c==='1'?!![]:_0x451c4c==='0'?![]:_0x451c4c===_0xd455('0x56')?!![]:_0x451c4c==='false'?![]:![];this[_0xd455('0x4')](_0xd455('0x57'),_0x4f040b);}else{this['setDataValue']('screenrecording',_0x451c4c);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x436cb7){this[_0xd455('0x4')](_0xd455('0x58'),_0x436cb7);if(_0x436cb7===!![]){this[_0xd455('0x4')]('blockedAt',moment());this['setDataValue'](_0xd455('0x59'),0x0);}else{this[_0xd455('0x4')](_0xd455('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd455('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd455('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xd455('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 482f3b9..f079d2a 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 _0xfcf0=['SELECT','from','mailbox','VoiceMail','fullname','email','permissions','102','113','104','105','106','107','108','100','111','114','115','create','user','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','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','isValidChannel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','VoiceQueue','interface','SIP/%s','UserVoiceQueueRt','upsert','channel','Unknown\x20channel','remove','Queues','isArray','Queue:remove','voice','addAvatar','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','download','join','root','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','sort','where','pick','options','hasOwnProperty','CmList','Tag','color','tag','nolimit','getQueues','order','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','each','forEach','update','YYYY-MM-DD\x20HH:mm:ss','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','concat','isMiddleware','resolve','logout','pause','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','Pause','QueuePause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','UserVoicePrefix','removeTeams','getMailQueues','Mail','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','getAgents','values','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','lower','toString','asc','desc','substring','orderBy','result','client','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket','register','defaults','localhost','http','request','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','get','role','admin','Users','Agents','agent','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','then','index','User','rawAttributes','fieldName','key','salt','getOptions','includeAll','include','attributes','findAll','rows','openTabs','true','chat','dataValues','push','sms','fax','mail','openchannel','all','catch','show','params','model','differenceBy','keys','password','query','filters','intersection','fields','length','merge','whatsapp','body','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize'];(function(_0x1722bf,_0x2fa7f4){var _0x58c607=function(_0x4b13f5){while(--_0x4b13f5){_0x1722bf['push'](_0x1722bf['shift']());}};_0x58c607(++_0x2fa7f4);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0xfcf0[_0x5517c0];return _0x33803b;};'use strict';var moment=require(_0x0fcf('0x0'));var BPromise=require(_0x0fcf('0x1'));var util=require('util');var path=require(_0x0fcf('0x2'));var fs=require('fs');var _=require(_0x0fcf('0x3'));var squel=require(_0x0fcf('0x4'));var jayson=require(_0x0fcf('0x5'));var Redis=require('ioredis');var authService=require(_0x0fcf('0x6'));var qs=require(_0x0fcf('0x7'));var logger=require(_0x0fcf('0x8'))(_0x0fcf('0x9'));var utils=require(_0x0fcf('0xa'));var config=require(_0x0fcf('0xb'));var licenseUtil=require(_0x0fcf('0xc'));var db=require(_0x0fcf('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0fcf('0xe')]));require(_0x0fcf('0xf'))[_0x0fcf('0x10')](socket);config['redis']=_[_0x0fcf('0x11')](config[_0x0fcf('0xe')],{'host':_0x0fcf('0x12'),'port':0x18eb});var client=jayson['client'][_0x0fcf('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5c29ed,_0x1be284,_0x2317cf,_0x201a58){return new BPromise(function(_0x48619c,_0x5f40fb){var _0x29336a=_0x201a58||client;return _0x29336a[_0x0fcf('0x14')](_0x5c29ed,_0x2317cf)['then'](function(_0x20153d){logger[_0x0fcf('0x15')](_0x0fcf('0x16'),_0x1be284,_0x0fcf('0x17'));logger[_0x0fcf('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x1be284,_0x0fcf('0x17'),JSON[_0x0fcf('0x19')](_0x20153d));if(_0x20153d[_0x0fcf('0x1a')]){if(_0x20153d['error'][_0x0fcf('0x1b')]===0x1f4){logger[_0x0fcf('0x1a')](_0x0fcf('0x16'),_0x1be284,_0x20153d[_0x0fcf('0x1a')]['message']);return _0x5f40fb(_0x20153d[_0x0fcf('0x1a')][_0x0fcf('0x1c')]);}logger[_0x0fcf('0x1a')](_0x0fcf('0x16'),_0x1be284,_0x20153d[_0x0fcf('0x1a')]['message']);return _0x48619c(_0x20153d[_0x0fcf('0x1a')][_0x0fcf('0x1c')]);}else{logger['info'](_0x0fcf('0x16'),_0x1be284,_0x0fcf('0x17'));_0x48619c(_0x20153d['result'][_0x0fcf('0x1c')]);}})['catch'](function(_0x3fc9e6){logger[_0x0fcf('0x1a')]('User,\x20%s,\x20%s',_0x1be284,_0x3fc9e6);_0x5f40fb(_0x3fc9e6);});});}function respondWithStatusCode(_0x457880,_0x3f28d0){_0x3f28d0=_0x3f28d0||0xcc;return function(_0x29dbdf){if(_0x29dbdf){return _0x457880['sendStatus'](_0x3f28d0);}return _0x457880[_0x0fcf('0x1d')](_0x3f28d0)[_0x0fcf('0x1e')]();};}function respondWithResult(_0x196d30,_0x41b20b){_0x41b20b=_0x41b20b||0xc8;return function(_0x18af5c){if(_0x18af5c){return _0x196d30[_0x0fcf('0x1d')](_0x41b20b)['json'](_0x18af5c);}};}function respondWithFilteredResult(_0x2eef74,_0x253641){return function(_0x6021b4){if(_0x6021b4){var _0xd6f8b5=typeof _0x253641[_0x0fcf('0x1f')]===_0x0fcf('0x20')&&typeof _0x253641[_0x0fcf('0x21')]===_0x0fcf('0x20');var _0x117510=_0x6021b4['count'];var _0x18965e=_0xd6f8b5?0x0:_0x253641[_0x0fcf('0x1f')];var _0x41b7a2=_0xd6f8b5?_0x6021b4[_0x0fcf('0x22')]:_0x253641[_0x0fcf('0x1f')]+_0x253641[_0x0fcf('0x21')];var _0x2730b0;if(_0x41b7a2>=_0x117510){_0x41b7a2=_0x117510;_0x2730b0=0xc8;}else{_0x2730b0=0xce;}_0x2eef74['status'](_0x2730b0);return _0x2eef74[_0x0fcf('0x23')](_0x0fcf('0x24'),_0x18965e+'-'+_0x41b7a2+'/'+_0x117510)[_0x0fcf('0x25')](_0x6021b4);}return null;};}function saveUpdates(_0x35180d){return function(_0x49fd0e){if(_0x49fd0e){return _0x49fd0e['update'](_0x35180d)['then'](function(_0x428194){return _0x428194;});}return null;};}function removeEntity(_0x50b7df){return function(_0x26c3bc){if(_0x26c3bc){return _0x26c3bc[_0x0fcf('0x26')]()['then'](function(){var _0xdfd3ec=_0x26c3bc[_0x0fcf('0x27')]({'plain':!![]});if(_0xdfd3ec[_0x0fcf('0x28')]===_0x0fcf('0x29'))return;var _0xc58b86=[{'name':_0x0fcf('0x2a'),'value':'user','ignore':!![]},{'name':_0x0fcf('0x2b'),'value':_0x0fcf('0x2c'),'ignore':![]},{'name':_0x0fcf('0x2d'),'value':_0x0fcf('0x2e'),'ignore':![]}];var _0x19488a=_(_0xc58b86)[_0x0fcf('0x2f')]('ignore')[_0x0fcf('0x30')](_0x0fcf('0x31'))[_0x0fcf('0x31')]();if(_[_0x0fcf('0x32')](_0x19488a,_0xdfd3ec[_0x0fcf('0x28')])){return;}var _0x477c71=_[_0x0fcf('0x33')](_0xc58b86,[_0x0fcf('0x31'),_0xdfd3ec[_0x0fcf('0x28')]])[_0x0fcf('0x34')];return db[_0x0fcf('0x35')][_0x0fcf('0x26')]({'where':{'type':_0x477c71,'resourceId':_0xdfd3ec['id']}})[_0x0fcf('0x36')](function(){return _0x26c3bc;});})[_0x0fcf('0x36')](function(){_0x50b7df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40101a){return function(_0x4ccbdf){if(!_0x4ccbdf){_0x40101a['sendStatus'](0x194);}return _0x4ccbdf;};}function handleError(_0x1a1e07,_0x254d6a){_0x254d6a=_0x254d6a||0x1f4;return function(_0x3721ab){logger['error'](_0x3721ab['stack']);if(_0x3721ab[_0x0fcf('0x34')]){delete _0x3721ab[_0x0fcf('0x34')];}_0x1a1e07[_0x0fcf('0x1d')](_0x254d6a)['send'](_0x3721ab);};}exports[_0x0fcf('0x37')]=function(_0x1d2f3b,_0x29067e){var _0x4e139d={},_0x4c75e6={'count':0x0,'rows':[]};var _0x536d21=_(db[_0x0fcf('0x38')][_0x0fcf('0x39')])[_0x0fcf('0x30')](function(_0x3ae8fa){return{'name':_0x3ae8fa[_0x0fcf('0x3a')],'type':_0x3ae8fa['type'][_0x0fcf('0x3b')]};})[_0x0fcf('0x2f')](function(_0xb4087){return!_['includes'](['password',_0x0fcf('0x3c')],_0xb4087[_0x0fcf('0x34')]);})[_0x0fcf('0x31')]();_0x4e139d=qs[_0x0fcf('0x3d')](_0x536d21,_0x1d2f3b);var _0x43e0f9={'where':_0x4e139d['where']};return db[_0x0fcf('0x38')][_0x0fcf('0x22')](_0x43e0f9)[_0x0fcf('0x36')](function(_0x11134c){_0x4c75e6['count']=_0x11134c;if(_0x1d2f3b['query'][_0x0fcf('0x3e')]){_0x4e139d[_0x0fcf('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x4e139d[_0x0fcf('0x40')],'id')){_0x4e139d[_0x0fcf('0x40')]['push']('id');}return db[_0x0fcf('0x38')][_0x0fcf('0x41')](_0x4e139d);})[_0x0fcf('0x36')](function(_0x1f322b){_0x4c75e6[_0x0fcf('0x42')]=_0x1f322b;if(_0x1d2f3b['query'][_0x0fcf('0x43')]===_0x0fcf('0x44')){var _0x5994af=[];for(var _0x48b3f1=0x0;_0x48b3f1<_0x4c75e6[_0x0fcf('0x42')]['length'];_0x48b3f1++){_0x5994af['push'](get_open_tabs(_0x0fcf('0x45'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x49'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1]['dataValues']));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x4a'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1]['dataValues']));_0x5994af['push'](get_open_tabs(_0x0fcf('0x4b'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs('whatsapp',_0x4c75e6['rows'][_0x48b3f1][_0x0fcf('0x46')]));}return BPromise[_0x0fcf('0x4c')](_0x5994af)[_0x0fcf('0x36')](function(_0x1fb83d){return _0x4c75e6;});}else{return _0x4c75e6;}})[_0x0fcf('0x36')](respondWithFilteredResult(_0x29067e,_0x4e139d))[_0x0fcf('0x4d')](handleError(_0x29067e,null));};exports[_0x0fcf('0x4e')]=function(_0xc7ae,_0x4c4f56){var _0x5a0ced={'raw':![],'where':{'id':_0xc7ae[_0x0fcf('0x4f')]['id']}},_0x259c91={};_0x259c91[_0x0fcf('0x50')]=_[_0x0fcf('0x51')](_[_0x0fcf('0x52')](db[_0x0fcf('0x38')]['rawAttributes']),[_0x0fcf('0x53'),_0x0fcf('0x3c')]);_0x259c91['query']=_[_0x0fcf('0x52')](_0xc7ae[_0x0fcf('0x54')]);_0x259c91[_0x0fcf('0x55')]=_[_0x0fcf('0x56')](_0x259c91['model'],_0x259c91[_0x0fcf('0x54')]);_0x5a0ced[_0x0fcf('0x40')]=_[_0x0fcf('0x56')](_0x259c91[_0x0fcf('0x50')],qs[_0x0fcf('0x57')](_0xc7ae[_0x0fcf('0x54')][_0x0fcf('0x57')]));_0x5a0ced[_0x0fcf('0x40')]=_0x5a0ced[_0x0fcf('0x40')][_0x0fcf('0x58')]?_0x5a0ced[_0x0fcf('0x40')]:_0x259c91[_0x0fcf('0x50')];if(_0xc7ae[_0x0fcf('0x54')][_0x0fcf('0x3e')]){_0x5a0ced['include']=[{'all':!![]}];}_0x5a0ced=_[_0x0fcf('0x59')]({},_0x5a0ced,_0xc7ae['options']);if(!_[_0x0fcf('0x32')](_0x5a0ced[_0x0fcf('0x40')],'id')){_0x5a0ced[_0x0fcf('0x40')][_0x0fcf('0x47')]('id');}return db[_0x0fcf('0x38')]['find'](_0x5a0ced)[_0x0fcf('0x36')](handleEntityNotFound(_0x4c4f56,null))['then'](function(_0x48b60a){var _0x2de3ef=[];values=_0x48b60a;if(_0xc7ae['query'][_0x0fcf('0x43')]===_0x0fcf('0x44')){_0x2de3ef['push'](get_open_tabs(_0x0fcf('0x45'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs('openchannel',_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs(_0x0fcf('0x5a'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs('fax',_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x4a'),_0x48b60a['dataValues']));return BPromise[_0x0fcf('0x4c')](_0x2de3ef);}else{return values;}})['then'](function(_0x2ed8d8){return values;})[_0x0fcf('0x36')](respondWithResult(_0x4c4f56,null))[_0x0fcf('0x4d')](handleError(_0x4c4f56,null));};exports['update']=function(_0x1362d7,_0x29c0b8){if(_0x1362d7[_0x0fcf('0x5b')]['id']){delete _0x1362d7[_0x0fcf('0x5b')]['id'];}delete _0x1362d7[_0x0fcf('0x5b')][_0x0fcf('0x28')];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x1362d7[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x29c0b8,null))[_0x0fcf('0x36')](saveUpdates(_0x1362d7['body'],null))[_0x0fcf('0x36')](respondWithResult(_0x29c0b8,null))[_0x0fcf('0x4d')](handleError(_0x29c0b8,null));};exports[_0x0fcf('0x5c')]=function(_0x13b5c5,_0xa42e82){return db[_0x0fcf('0x38')][_0x0fcf('0x5c')]()['then'](respondWithResult(_0xa42e82,null))['catch'](handleError(_0xa42e82,null));};exports[_0x0fcf('0x5d')]=function(_0x38c2e0,_0x58607c){return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x38c2e0[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x58607c,null))['then'](function(_0x540859){if(_0x540859){return _0x540859[_0x0fcf('0x5d')](_0x38c2e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')],_[_0x0fcf('0x5f')](_0x38c2e0[_0x0fcf('0x5b')],['ids','id'])||{});}})[_0x0fcf('0x36')](respondWithResult(_0x58607c,null))[_0x0fcf('0x4d')](handleError(_0x58607c,null));};function validateUser(_0xa634f3){return new BPromise(function(_0x3f3ad8,_0x1974e2){if(_0xa634f3['internal'])return _0x3f3ad8(_0xa634f3);return db['Setting'][_0x0fcf('0x60')](0x1)[_0x0fcf('0x36')](function(_0x8c2777){if(_0x8c2777[_0x0fcf('0x61')])authService[_0x0fcf('0x62')](_0xa634f3[_0x0fcf('0x53')]);db[_0x0fcf('0x38')][_0x0fcf('0x63')](_0x0fcf('0x64'))[_0x0fcf('0x36')](function(_0x5d54f0){if(_[_0x0fcf('0x65')](_0x5d54f0)){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777[_0x0fcf('0x66')]||0x1;return;}if(_[_0x0fcf('0x65')](_0x8c2777[_0x0fcf('0x66')])||_0x8c2777[_0x0fcf('0x66')]===_0x5d54f0){_0xa634f3[_0x0fcf('0x64')]=_0x5d54f0+0x1;return;}if(_0x8c2777[_0x0fcf('0x66')]>_0x5d54f0){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777['min_internal'];return;}return db['sequelize']['query']('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[_0x0fcf('0x67')]['QueryTypes'][_0x0fcf('0x68')]})[_0x0fcf('0x36')](function(_0x3da414){if(_0x3da414&&_0x3da414['length']){for(var _0x5ab5c6=0x0,_0x44eaac=_0x3da414[_0x0fcf('0x58')];_0x5ab5c6<_0x44eaac&&_['isNil'](_0xa634f3[_0x0fcf('0x64')]);_0x5ab5c6++){if(_0x8c2777[_0x0fcf('0x66')]<=_0x3da414[_0x5ab5c6]['from']){_0xa634f3[_0x0fcf('0x64')]=_0x3da414[_0x5ab5c6][_0x0fcf('0x69')];}else if(_0x8c2777[_0x0fcf('0x66')]>_0x3da414[_0x5ab5c6][_0x0fcf('0x69')]&&_0x8c2777[_0x0fcf('0x66')]<=_0x3da414[_0x5ab5c6]['to']){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777[_0x0fcf('0x66')];}}}if(_['isNil'](_0xa634f3[_0x0fcf('0x64')])){_0xa634f3[_0x0fcf('0x64')]=_0x5d54f0+0x1;}return _0x3f3ad8(_0xa634f3);});});})[_0x0fcf('0x4d')](function(_0x41fcac){_0x1974e2(_0x41fcac);});});}function updateUser(_0x294504){return new BPromise(function(_0x31f658,_0x498d14){try{if(_0x294504['voicemail']){_0x294504[_0x0fcf('0x6a')]=_0x294504[_0x0fcf('0x64')];_0x294504[_0x0fcf('0x6b')]={'mailbox':_0x294504[_0x0fcf('0x64')],'password':_0x294504['password'],'fullname':_0x294504[_0x0fcf('0x6c')],'email':_0x294504[_0x0fcf('0x6d')]};}if(_0x294504[_0x0fcf('0x28')]===_0x0fcf('0x2c')){if(!_0x294504[_0x0fcf('0x6e')])_0x294504['permissions']=['101',_0x0fcf('0x6f'),'103',_0x0fcf('0x70'),'110',_0x0fcf('0x71'),_0x0fcf('0x72'),_0x0fcf('0x73'),_0x0fcf('0x74'),_0x0fcf('0x75'),'109',_0x0fcf('0x76'),_0x0fcf('0x77'),_0x0fcf('0x78'),_0x0fcf('0x79')];}_0x31f658(_0x294504);}catch(_0x4c7555){_0x498d14(_0x4c7555);}});}exports[_0x0fcf('0x7a')]=function(_0x5ba384,_0x2a6084){if(_0x5ba384['user'][_0x0fcf('0x28')]===_0x0fcf('0x2c'))throw new Error('Unauthorized');if(_0x5ba384[_0x0fcf('0x5b')][_0x0fcf('0x28')]===_0x0fcf('0x7b')&&_0x5ba384['user']['role']!=='admin'){throw new Error(_0x0fcf('0x7c'));}if(_0x5ba384['body'][_0x0fcf('0x28')]===_0x0fcf('0x29')&&_0x5ba384[_0x0fcf('0x7b')][_0x0fcf('0x28')]!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x7d'));}return licenseUtil[_0x0fcf('0x7e')]([_0x5ba384[_0x0fcf('0x5b')]])[_0x0fcf('0x36')](function(){return validateUser(_0x5ba384['body']);})[_0x0fcf('0x36')](function(_0x231563){return updateUser(_0x231563)[_0x0fcf('0x36')](function(_0x20cd3f){if(_0x20cd3f[_0x0fcf('0x28')]===_0x0fcf('0x29')){_0x20cd3f[_0x0fcf('0x7f')]=_0x5ba384[_0x0fcf('0x7b')]['settingsEnabled'];delete _0x20cd3f[_0x0fcf('0x80')];}return _0x20cd3f;});})[_0x0fcf('0x36')](function(_0x1da8dd){return db[_0x0fcf('0x38')][_0x0fcf('0x7a')](_0x1da8dd,{'include':[{'model':db[_0x0fcf('0x6b')],'as':_0x0fcf('0x6b')}]});})['then'](function(_0x2d9214){if(_0x5ba384['body'][_0x0fcf('0x28')]===_0x0fcf('0x7b'))return _0x2d9214;if(_0x5ba384[_0x0fcf('0x7b')]['role']!=='user')return _0x2d9214;return db['UserProfileSection']['find']({'where':{'name':_0x2d9214[_0x0fcf('0x28')]===_0x0fcf('0x2c')?_0x0fcf('0x2b'):_0x0fcf('0x2d'),'userProfileId':_0x5ba384[_0x0fcf('0x7b')][_0x0fcf('0x80')]},'raw':!![]})[_0x0fcf('0x36')](function(_0x3490eb){if(!_0x3490eb||_0x3490eb[_0x0fcf('0x81')]!=0x0)return _0x2d9214;return db[_0x0fcf('0x35')][_0x0fcf('0x7a')]({'name':_0x2d9214['name'],'resourceId':_0x2d9214['id'],'type':_0x3490eb[_0x0fcf('0x34')],'sectionId':_0x3490eb['id']},{})[_0x0fcf('0x36')](function(){return _0x2d9214;});})['catch'](function(_0x2af8de){logger['error'](_0x0fcf('0x82'),_0x2af8de);throw _0x2af8de;});})[_0x0fcf('0x36')](respondWithResult(_0x2a6084,0xc9))['catch'](handleError(_0x2a6084,null));};exports['bulkCreate']=function(_0x36d4e5,_0x3785b4){var _0x4a6adc=_0x36d4e5[_0x0fcf('0x5b')];var _0x3cf7b7=[];if(_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x28')]===_0x0fcf('0x2c'))throw new Error(_0x0fcf('0x83'));if(_[_0x0fcf('0x84')](_0x4a6adc,[_0x0fcf('0x28'),'user'])&&_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x28')]!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x7c'));}if(_['some'](_0x4a6adc,[_0x0fcf('0x28'),'admin'])&&_0x36d4e5['user']['role']!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x85'));}return licenseUtil[_0x0fcf('0x7e')](_0x4a6adc)[_0x0fcf('0x36')](function(){return validateUser(_0x4a6adc[0x0]);})[_0x0fcf('0x36')](function(){for(var _0x777b71=0x1;_0x777b71<_0x4a6adc[_0x0fcf('0x58')];_0x777b71++){var _0x31b008=_0x4a6adc[_0x777b71-0x1][_0x0fcf('0x64')];if(!_0x4a6adc[_0x777b71]['internal'])_0x4a6adc[_0x777b71][_0x0fcf('0x64')]=_0x31b008+0x1;_0x3cf7b7[_0x0fcf('0x47')](validateUser(_0x4a6adc[_0x777b71]));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);})[_0x0fcf('0x36')](function(){_0x3cf7b7=[];for(var _0x1d83bb=0x0;_0x1d83bb<_0x4a6adc[_0x0fcf('0x58')];_0x1d83bb++){_0x3cf7b7[_0x0fcf('0x47')](updateUser(_0x4a6adc[_0x1d83bb]));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);})[_0x0fcf('0x36')](function(){return BPromise['each'](_0x4a6adc,function(_0x56e098){return db['User'][_0x0fcf('0x7a')](_0x56e098,{'include':[{'model':db[_0x0fcf('0x6b')],'as':_0x0fcf('0x6b')}]})[_0x0fcf('0x36')](function(_0x52e2e6){_0x56e098['id']=_0x52e2e6['id'];return _0x56e098;});});})['then'](function(_0x5c7fd7){if(_0x36d4e5[_0x0fcf('0x5b')]['role']===_0x0fcf('0x7b'))return _0x5c7fd7;if(_0x36d4e5['user'][_0x0fcf('0x28')]!=='user')return _0x5c7fd7;var _0x30edd0=_['some'](_0x5c7fd7,function(_0x4f729f){return _0x4f729f[_0x0fcf('0x28')]==='agent'||_0x4f729f[_0x0fcf('0x28')]===_0x0fcf('0x2e');});if(!_0x30edd0)return _0x5c7fd7;return db[_0x0fcf('0x86')][_0x0fcf('0x41')]({'where':{'name':{'$or':[_0x0fcf('0x2b'),_0x0fcf('0x2d')]},'userProfileId':_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x80')]},'raw':!![]})[_0x0fcf('0x36')](function(_0x1ad06d){if(_[_0x0fcf('0x87')](_0x1ad06d)||!_[_0x0fcf('0x84')](_0x1ad06d,[_0x0fcf('0x81'),0x0]))return _0x5c7fd7;_0x3cf7b7=[];var _0x57a1c0=_(_0x1ad06d)[_0x0fcf('0x30')](function(_0x3bc4a5){if(_0x3bc4a5[_0x0fcf('0x81')]===0x1)return;return _0x3bc4a5[_0x0fcf('0x34')]===_0x0fcf('0x2b')?_0x0fcf('0x2c'):_0x0fcf('0x2e');})[_0x0fcf('0x88')]()[_0x0fcf('0x31')]();for(var _0x50a5bb=0x0;_0x50a5bb<_0x5c7fd7[_0x0fcf('0x58')];_0x50a5bb++){if(!_[_0x0fcf('0x32')](_0x57a1c0,_0x5c7fd7[_0x50a5bb][_0x0fcf('0x28')]))return;var _0x319770=_0x5c7fd7[_0x50a5bb][_0x0fcf('0x28')]===_0x0fcf('0x2c')?_0x0fcf('0x2b'):_0x0fcf('0x2d');_0x3cf7b7[_0x0fcf('0x47')](db[_0x0fcf('0x35')][_0x0fcf('0x7a')]({'name':_0x5c7fd7[_0x50a5bb][_0x0fcf('0x34')],'resourceId':_0x5c7fd7[_0x50a5bb]['id'],'type':_0x319770,'sectionId':_[_0x0fcf('0x33')](_0x1ad06d,['name',_0x319770])['id']},{}));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);});})[_0x0fcf('0x36')](respondWithResult(_0x3785b4,0xc9))['catch'](handleError(_0x3785b4,null));};exports[_0x0fcf('0x89')]=function(_0x39b86f,_0x2b087b){if(_0x39b86f[_0x0fcf('0x5b')]['id']){delete _0x39b86f[_0x0fcf('0x5b')]['id'];}return db['User']['find']({'where':{'id':_0x39b86f['params']['id']}})[_0x0fcf('0x36')](function(_0x4b0216){if(!_0x4b0216)return null;if(_0x4b0216['id']===_0x39b86f[_0x0fcf('0x7b')]['id']){if(!_0x39b86f[_0x0fcf('0x5b')]['oldPassword']||!_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x8d'));}if(!_0x4b0216[_0x0fcf('0x8e')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8f')])){throw new db[(_0x0fcf('0x8b'))]['ValidationError'](_0x0fcf('0x90'));}if(_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8f')]===_0x39b86f['body'][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x91'));}}else if(_0x39b86f[_0x0fcf('0x7b')][_0x0fcf('0x28')]===_0x0fcf('0x29')){if(!_0x39b86f['body'][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x92'));}}else if(_0x39b86f['user'][_0x0fcf('0x28')]==='user'){if(!_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x0fcf('0x92'));}if(_0x4b0216[_0x0fcf('0x28')]!==_0x0fcf('0x2c')){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x83'));}}else{throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x83'));}return _0x4b0216;})[_0x0fcf('0x36')](handleEntityNotFound(_0x2b087b,null))['then'](function(_0x144354){return db['Setting']['findOne']({'attributes':['id',_0x0fcf('0x61'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x22c9d9){if(_0x22c9d9[_0x0fcf('0x61')])authService[_0x0fcf('0x62')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]);if(!_0x22c9d9[_0x0fcf('0x93')]||!_0x144354[_0x0fcf('0x94')])return _0x144354;authService[_0x0fcf('0x95')](_0x39b86f[_0x0fcf('0x5b')]['newPassword'],_0x144354[_0x0fcf('0x94')],_0x22c9d9[_0x0fcf('0x96')]);return _0x144354;})[_0x0fcf('0x36')](saveUpdates({'password':_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')],'passwordResetAt':_0x39b86f[_0x0fcf('0x7b')]['id']==_0x39b86f['params']['id']?moment():null,'previousPasswords':authService[_0x0fcf('0x97')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')],_0x144354[_0x0fcf('0x94')])},null));})[_0x0fcf('0x36')](respondWithResult(_0x2b087b,null))['catch'](handleError(_0x2b087b,null));};exports[_0x0fcf('0x98')]=function(_0x2476e0,_0x1e259b){var _0x3465ee=_0x2476e0[_0x0fcf('0x5b')]['channel'];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x2476e0[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0x34'),'role',_0x0fcf('0x99'),_0x0fcf('0x9a'),_0x0fcf('0x9b'),'interface']})['then'](handleEntityNotFound(_0x1e259b,null))[_0x0fcf('0x36')](function(_0x16afe3){if(_0x16afe3){if(!utils[_0x0fcf('0x9c')](_0x3465ee)){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))]('Unknown\x20channel');}return _0x16afe3[_0x0fcf('0x9d')+_[_0x0fcf('0x9e')](_0x3465ee[_0x0fcf('0x9f')]())+'Queues'](_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')],{'penalty':_0x2476e0['body'][_0x0fcf('0xa0')]||0x0})[_0x0fcf('0xa1')](function(_0x40562e){for(var _0x449f55=0x0;_0x449f55<_0x2476e0[_0x0fcf('0x5b')]['ids'][_0x0fcf('0x58')];_0x449f55+=0x1){var _0x492839={'UserId':Number(_0x2476e0[_0x0fcf('0x4f')]['id'])};_0x492839[_['capitalize'](_0x3465ee['toLowerCase']())+_0x0fcf('0xa2')]=Number(_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')][_0x449f55]);socket[_0x0fcf('0xa3')](_0x0fcf('0x7b')+_[_0x0fcf('0x9e')](_0x3465ee[_0x0fcf('0x9f')]())+_0x0fcf('0xa4'),_0x492839);}return _0x40562e;})[_0x0fcf('0x36')](function(){if(_0x3465ee==='voice'){return db[_0x0fcf('0xa5')][_0x0fcf('0x41')]({'where':{'id':_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')]||[]},'raw':!![],'attributes':['id',_0x0fcf('0x34')]});}})[_0x0fcf('0x36')](function(_0x210aaf){var _0x4c62dd=_0x16afe3[_0x0fcf('0x27')]({'plain':!![]});var _0x12df1c=[];if(_0x3465ee==='voice'&&_0x4c62dd[_0x0fcf('0x28')]==='agent'&&_0x4c62dd[_0x0fcf('0x99')]){for(var _0x5947c5=0x0;_0x5947c5<_0x210aaf[_0x0fcf('0x58')];_0x5947c5+=0x1){_0x12df1c[_0x0fcf('0x47')]({'membername':_0x4c62dd[_0x0fcf('0x34')],'UserId':_0x4c62dd['id'],'queue_name':_0x210aaf[_0x5947c5][_0x0fcf('0x34')],'VoiceQueueId':_0x210aaf[_0x5947c5]['id'],'interface':_[_0x0fcf('0x65')](_0x4c62dd[_0x0fcf('0xa6')])?util['format'](_0x0fcf('0xa7'),_0x4c62dd[_0x0fcf('0x34')]):_0x4c62dd[_0x0fcf('0xa6')],'paused':_0x4c62dd[_0x0fcf('0x9b')]||![],'penalty':_0x2476e0[_0x0fcf('0x5b')]['penalty']||0x0});}return BPromise['each'](_0x12df1c,function(_0x3211be){return db[_0x0fcf('0xa8')][_0x0fcf('0xa9')](_0x3211be);});}return _0x16afe3;});}})[_0x0fcf('0x36')](respondWithStatusCode(_0x1e259b,null))[_0x0fcf('0x4d')](handleError(_0x1e259b,null));};exports['removeQueues']=function(_0x2d6360,_0x4297af){var _0x4919d4;return db['User'][_0x0fcf('0x33')]({'where':{'id':_0x2d6360[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0x34'),_0x0fcf('0x28')]})[_0x0fcf('0x36')](handleEntityNotFound(_0x4297af,null))[_0x0fcf('0x36')](function(_0x38aba9){if(_0x38aba9){_0x4919d4=_0x38aba9;if(!_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')]||!utils[_0x0fcf('0x9c')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')])){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0xab'));}return _0x38aba9[_0x0fcf('0xac')+_['capitalize'](_0x2d6360['query'][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xad')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]);}})[_0x0fcf('0x36')](function(_0x518070){if(_[_0x0fcf('0xae')](_0x2d6360['query'][_0x0fcf('0x5e')])){for(var _0x5f4613=0x0;_0x5f4613<_0x2d6360['query'][_0x0fcf('0x5e')][_0x0fcf('0x58')];_0x5f4613+=0x1){var _0xe72ed8={'UserId':Number(_0x2d6360['params']['id'])};_0xe72ed8[_['capitalize'](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xa2')]=Number(_0x2d6360[_0x0fcf('0x54')]['ids'][_0x5f4613]);socket[_0x0fcf('0xa3')](_0x0fcf('0x7b')+_[_0x0fcf('0x9e')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xaf'),_0xe72ed8);}}else{var _0xe72ed8={'UserId':Number(_0x2d6360[_0x0fcf('0x4f')]['id'])};_0xe72ed8[_[_0x0fcf('0x9e')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xa2')]=Number(_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]);socket['emit']('user'+_['capitalize'](_0x2d6360[_0x0fcf('0x54')]['channel'][_0x0fcf('0x9f')]())+_0x0fcf('0xaf'),_0xe72ed8);}return _0x518070;})['then'](function(){if(_0x2d6360[_0x0fcf('0x54')]['channel']===_0x0fcf('0xb0')){return db['UserVoiceQueueRt'][_0x0fcf('0x26')]({'where':{'UserId':_0x2d6360[_0x0fcf('0x4f')]['id'],'VoiceQueueId':_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]},'individualHooks':!![]})[_0x0fcf('0x36')](function(){return _0x4919d4;});}return _0x4919d4;})[_0x0fcf('0x36')](respondWithStatusCode(_0x4297af,null))['catch'](handleError(_0x4297af,null));};exports[_0x0fcf('0xb1')]=function(_0x337d09,_0x5ab604){_0x337d09[_0x0fcf('0x5b')]['userpic']=_0x337d09['file'][_0x0fcf('0xb2')];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x337d09[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x5ab604,null))[_0x0fcf('0x36')](saveUpdates(_0x337d09[_0x0fcf('0x5b')],null))[_0x0fcf('0x36')](respondWithResult(_0x5ab604,null))['catch'](handleError(_0x5ab604,null));};exports[_0x0fcf('0xb3')]=function(_0x35e2b0,_0x233a76){var _0x300647=path['join'](config['root'],_0x0fcf('0xb4'));return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x35e2b0[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0xb5')],'raw':!![]})['then'](handleEntityNotFound(_0x233a76,null))['then'](function(_0x310652){if(_0x310652){if(_[_0x0fcf('0x65')](_0x310652[_0x0fcf('0xb5')])){return _0x233a76[_0x0fcf('0xb6')](_0x300647);}else{if(!fs['existsSync'](path[_0x0fcf('0xb7')](config[_0x0fcf('0xb8')],'server/files/images/',_0x310652[_0x0fcf('0xb5')]))){return _0x233a76[_0x0fcf('0xb6')](_0x300647);}return _0x233a76['download'](path[_0x0fcf('0xb7')](config[_0x0fcf('0xb8')],_0x0fcf('0xb9'),_0x310652[_0x0fcf('0xb5')]));}}})[_0x0fcf('0x4d')](handleError(_0x233a76,null));};exports[_0x0fcf('0xba')]=function(_0x3f7a64,_0x5efa26){return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x3f7a64[_0x0fcf('0x4f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5efa26,null))[_0x0fcf('0x36')](function(_0x22c391){var _0x41e1b5=[];values=_0x22c391[_0x0fcf('0x46')];_0x41e1b5[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x45'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs('openchannel',_0x22c391[_0x0fcf('0x46')]));_0x41e1b5['push'](get_open_tabs(_0x0fcf('0x5a'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs('fax',_0x22c391[_0x0fcf('0x46')]));_0x41e1b5['push'](get_open_tabs(_0x0fcf('0x4a'),_0x22c391['dataValues']));return BPromise[_0x0fcf('0x4c')](_0x41e1b5);})[_0x0fcf('0x36')](function(_0x56bbcd){var _0x2003a6=[];if(_0x56bbcd){for(var _0x300d2a=0x0;_0x300d2a=_0x107fbd){_0x515519=_0x107fbd;_0x35b5c7=0xc8;}else{_0x35b5c7=0xce;}_0x2847b4[_0x71a3('0x21')](_0x35b5c7);return _0x2847b4[_0x71a3('0x27')](_0x71a3('0x28'),_0x4c1a3d+'-'+_0x515519+'/'+_0x107fbd)[_0x71a3('0x22')](_0x26e6e7);}return null;};}function saveUpdates(_0x305eb1){return function(_0x3fc578){if(_0x3fc578){return _0x3fc578[_0x71a3('0x29')](_0x305eb1)[_0x71a3('0x15')](function(_0x51cde3){return _0x51cde3;});}return null;};}function removeEntity(_0x26fd9f){return function(_0x1719e6){if(_0x1719e6){return _0x1719e6[_0x71a3('0x2a')]()[_0x71a3('0x15')](function(){var _0x4a750c=_0x1719e6[_0x71a3('0x2b')]({'plain':!![]});if(_0x4a750c[_0x71a3('0x2c')]===_0x71a3('0x2d'))return;var _0x114032=[{'name':_0x71a3('0x2e'),'value':_0x71a3('0x2f'),'ignore':!![]},{'name':_0x71a3('0x30'),'value':'agent','ignore':![]},{'name':_0x71a3('0x31'),'value':_0x71a3('0x32'),'ignore':![]}];var _0x3aaf63=_(_0x114032)[_0x71a3('0x33')](_0x71a3('0x34'))[_0x71a3('0x35')](_0x71a3('0x36'))[_0x71a3('0x36')]();if(_[_0x71a3('0x37')](_0x3aaf63,_0x4a750c[_0x71a3('0x2c')])){return;}var _0x2376e5=_[_0x71a3('0x38')](_0x114032,[_0x71a3('0x36'),_0x4a750c['role']])['name'];return db[_0x71a3('0x39')][_0x71a3('0x2a')]({'where':{'type':_0x2376e5,'resourceId':_0x4a750c['id']}})['then'](function(){return _0x1719e6;});})[_0x71a3('0x15')](function(){_0x26fd9f[_0x71a3('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3650){return function(_0x1a7bb7){if(!_0x1a7bb7){_0x2f3650[_0x71a3('0x3a')](0x194);}return _0x1a7bb7;};}function handleError(_0x250572,_0x354147){_0x354147=_0x354147||0x1f4;return function(_0x255098){logger[_0x71a3('0x1c')](_0x255098['stack']);if(_0x255098[_0x71a3('0x3b')]){delete _0x255098[_0x71a3('0x3b')];}_0x250572[_0x71a3('0x21')](_0x354147)['send'](_0x255098);};}exports[_0x71a3('0x3c')]=function(_0x2937cf,_0x3dc1de){var _0x171902={},_0x6cea55={'count':0x0,'rows':[]};var _0x54d03b=_(db['User'][_0x71a3('0x3d')])[_0x71a3('0x35')](function(_0xbec9ad){return{'name':_0xbec9ad[_0x71a3('0x3e')],'type':_0xbec9ad[_0x71a3('0x3f')]['key']};})[_0x71a3('0x33')](function(_0x16d23c){return!_[_0x71a3('0x37')](['password',_0x71a3('0x40')],_0x16d23c['name']);})[_0x71a3('0x36')]();_0x171902=qs[_0x71a3('0x41')](_0x54d03b,_0x2937cf);var _0x46e6ce={'where':_0x171902[_0x71a3('0x42')]};return db[_0x71a3('0x43')][_0x71a3('0x26')](_0x46e6ce)[_0x71a3('0x15')](function(_0x40a18f){_0x6cea55[_0x71a3('0x26')]=_0x40a18f;if(_0x2937cf[_0x71a3('0x44')]['includeAll']){_0x171902[_0x71a3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x171902[_0x71a3('0x46')],'id')){_0x171902[_0x71a3('0x46')][_0x71a3('0x47')]('id');}return db[_0x71a3('0x43')]['findAll'](_0x171902);})[_0x71a3('0x15')](function(_0x4b4fde){_0x6cea55['rows']=_0x4b4fde;if(_0x2937cf[_0x71a3('0x44')][_0x71a3('0x48')]===_0x71a3('0x49')){var _0x1dc34b=[];for(var _0x519242=0x0;_0x519242<_0x6cea55[_0x71a3('0x4a')][_0x71a3('0x4b')];_0x519242++){_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4e'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4f'),_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x6cea55['rows'][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs('openchannel',_0x6cea55[_0x71a3('0x4a')][_0x519242][_0x71a3('0x4d')]));_0x1dc34b[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x6cea55[_0x71a3('0x4a')][_0x519242]['dataValues']));}return BPromise['all'](_0x1dc34b)[_0x71a3('0x15')](function(_0x4305ee){return _0x6cea55;});}else{return _0x6cea55;}})['then'](respondWithFilteredResult(_0x3dc1de,_0x171902))[_0x71a3('0x20')](handleError(_0x3dc1de,null));};exports[_0x71a3('0x52')]=function(_0xd1d09c,_0x28378a){var _0x250e56={'raw':![],'where':{'id':_0xd1d09c['params']['id']}},_0xb0d710={};_0xb0d710[_0x71a3('0x53')]=_['differenceBy'](_[_0x71a3('0x54')](db[_0x71a3('0x43')][_0x71a3('0x3d')]),[_0x71a3('0x55'),_0x71a3('0x40')]);_0xb0d710['query']=_[_0x71a3('0x54')](_0xd1d09c[_0x71a3('0x44')]);_0xb0d710[_0x71a3('0x56')]=_['intersection'](_0xb0d710[_0x71a3('0x53')],_0xb0d710['query']);_0x250e56[_0x71a3('0x46')]=_[_0x71a3('0x57')](_0xb0d710['model'],qs[_0x71a3('0x58')](_0xd1d09c[_0x71a3('0x44')][_0x71a3('0x58')]));_0x250e56[_0x71a3('0x46')]=_0x250e56[_0x71a3('0x46')][_0x71a3('0x4b')]?_0x250e56[_0x71a3('0x46')]:_0xb0d710['model'];if(_0xd1d09c[_0x71a3('0x44')]['includeAll']){_0x250e56[_0x71a3('0x45')]=[{'all':!![]}];}_0x250e56=_['merge']({},_0x250e56,_0xd1d09c[_0x71a3('0x59')]);if(!_[_0x71a3('0x37')](_0x250e56[_0x71a3('0x46')],'id')){_0x250e56[_0x71a3('0x46')]['push']('id');}return db['User'][_0x71a3('0x38')](_0x250e56)[_0x71a3('0x15')](handleEntityNotFound(_0x28378a,null))[_0x71a3('0x15')](function(_0x29410d){var _0x4d9181=[];values=_0x29410d;if(_0xd1d09c['query'][_0x71a3('0x48')]===_0x71a3('0x49')){_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4e'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181['push'](get_open_tabs(_0x71a3('0x4f'),_0x29410d[_0x71a3('0x4d')]));_0x4d9181[_0x71a3('0x47')](get_open_tabs('mail',_0x29410d[_0x71a3('0x4d')]));return BPromise[_0x71a3('0x5b')](_0x4d9181);}else{return values;}})[_0x71a3('0x15')](function(_0x23988d){return values;})[_0x71a3('0x15')](respondWithResult(_0x28378a,null))[_0x71a3('0x20')](handleError(_0x28378a,null));};exports[_0x71a3('0x29')]=function(_0x302dab,_0x3ebf59){if(_0x302dab[_0x71a3('0x5c')]['id']){delete _0x302dab['body']['id'];}delete _0x302dab[_0x71a3('0x5c')][_0x71a3('0x2c')];return db['User'][_0x71a3('0x38')]({'where':{'id':_0x302dab['params']['id']}})['then'](handleEntityNotFound(_0x3ebf59,null))[_0x71a3('0x15')](saveUpdates(_0x302dab[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x3ebf59,null))[_0x71a3('0x20')](handleError(_0x3ebf59,null));};exports[_0x71a3('0x5d')]=function(_0x5cffd2,_0x121b2d){return db[_0x71a3('0x43')]['describe']()[_0x71a3('0x15')](respondWithResult(_0x121b2d,null))['catch'](handleError(_0x121b2d,null));};exports[_0x71a3('0x5e')]=function(_0x1619d3,_0x523e13){return db['User'][_0x71a3('0x38')]({'where':{'id':_0x1619d3[_0x71a3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x523e13,null))[_0x71a3('0x15')](function(_0x97ed1b){if(_0x97ed1b){return _0x97ed1b[_0x71a3('0x5e')](_0x1619d3['body'][_0x71a3('0x60')],_[_0x71a3('0x61')](_0x1619d3[_0x71a3('0x5c')],[_0x71a3('0x60'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0x523e13,null))[_0x71a3('0x20')](handleError(_0x523e13,null));};function validateUser(_0x1ee283){return new BPromise(function(_0x30fc7a,_0xe03bb5){if(_0x1ee283['internal'])return _0x30fc7a(_0x1ee283);return db[_0x71a3('0x62')][_0x71a3('0x63')](0x1)[_0x71a3('0x15')](function(_0x509bf7){if(_0x509bf7[_0x71a3('0x64')])authService[_0x71a3('0x65')](_0x1ee283[_0x71a3('0x55')]);db[_0x71a3('0x43')][_0x71a3('0x66')](_0x71a3('0x67'))[_0x71a3('0x15')](function(_0xea64e6){if(_[_0x71a3('0x68')](_0xea64e6)){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')]||0x1;return;}if(_['isNil'](_0x509bf7[_0x71a3('0x69')])||_0x509bf7['min_internal']===_0xea64e6){_0x1ee283['internal']=_0xea64e6+0x1;return;}if(_0x509bf7[_0x71a3('0x69')]>_0xea64e6){_0x1ee283['internal']=_0x509bf7[_0x71a3('0x69')];return;}return db[_0x71a3('0x6a')][_0x71a3('0x44')]('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[_0x71a3('0x6a')][_0x71a3('0x6b')]['SELECT']})[_0x71a3('0x15')](function(_0x189320){if(_0x189320&&_0x189320[_0x71a3('0x4b')]){for(var _0x1450cc=0x0,_0x4430f2=_0x189320[_0x71a3('0x4b')];_0x1450cc<_0x4430f2&&_[_0x71a3('0x68')](_0x1ee283[_0x71a3('0x67')]);_0x1450cc++){if(_0x509bf7['min_internal']<=_0x189320[_0x1450cc]['from']){_0x1ee283[_0x71a3('0x67')]=_0x189320[_0x1450cc][_0x71a3('0x6c')];}else if(_0x509bf7[_0x71a3('0x69')]>_0x189320[_0x1450cc]['from']&&_0x509bf7[_0x71a3('0x69')]<=_0x189320[_0x1450cc]['to']){_0x1ee283[_0x71a3('0x67')]=_0x509bf7['min_internal'];}}}if(_[_0x71a3('0x68')](_0x1ee283['internal'])){_0x1ee283[_0x71a3('0x67')]=_0xea64e6+0x1;}return _0x30fc7a(_0x1ee283);});});})[_0x71a3('0x20')](function(_0x765b9c){_0xe03bb5(_0x765b9c);});});}function updateUser(_0x184389){return new BPromise(function(_0x528c4b,_0x7c9e78){try{if(_0x184389[_0x71a3('0x6d')]){_0x184389['mailbox']=_0x184389[_0x71a3('0x67')];_0x184389[_0x71a3('0x6e')]={'mailbox':_0x184389[_0x71a3('0x67')],'password':_0x184389[_0x71a3('0x55')],'fullname':_0x184389[_0x71a3('0x6f')],'email':_0x184389[_0x71a3('0x70')]};}if(_0x184389[_0x71a3('0x2c')]===_0x71a3('0x71')){if(!_0x184389[_0x71a3('0x72')])_0x184389[_0x71a3('0x72')]=[_0x71a3('0x73'),_0x71a3('0x74'),'103',_0x71a3('0x75'),'110',_0x71a3('0x76'),_0x71a3('0x77'),_0x71a3('0x78'),_0x71a3('0x79'),_0x71a3('0x7a'),_0x71a3('0x7b'),_0x71a3('0x7c'),_0x71a3('0x7d'),_0x71a3('0x7e'),_0x71a3('0x7f')];}_0x528c4b(_0x184389);}catch(_0x365f5a){_0x7c9e78(_0x365f5a);}});}exports[_0x71a3('0x80')]=function(_0x316641,_0x18a3ae){if(_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_0x316641[_0x71a3('0x5c')]['role']===_0x71a3('0x2f')&&_0x316641[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error(_0x71a3('0x82'));}if(_0x316641[_0x71a3('0x5c')][_0x71a3('0x2c')]==='admin'&&_0x316641[_0x71a3('0x2f')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x316641['body']])['then'](function(){return validateUser(_0x316641[_0x71a3('0x5c')]);})[_0x71a3('0x15')](function(_0x133994){return updateUser(_0x133994)[_0x71a3('0x15')](function(_0x17e205){if(_0x17e205[_0x71a3('0x2c')]===_0x71a3('0x2d')){_0x17e205[_0x71a3('0x83')]=_0x316641[_0x71a3('0x2f')][_0x71a3('0x83')];delete _0x17e205[_0x71a3('0x84')];}return _0x17e205;});})[_0x71a3('0x15')](function(_0x26fa56){return db['User'][_0x71a3('0x80')](_0x26fa56,{'include':[{'model':db[_0x71a3('0x6e')],'as':_0x71a3('0x6e')}]});})[_0x71a3('0x15')](function(_0x38f928){if(_0x316641[_0x71a3('0x5c')]['role']==='user')return _0x38f928;if(_0x316641['user'][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x38f928;return db[_0x71a3('0x85')]['find']({'where':{'name':_0x38f928[_0x71a3('0x2c')]===_0x71a3('0x71')?_0x71a3('0x30'):_0x71a3('0x31'),'userProfileId':_0x316641[_0x71a3('0x2f')][_0x71a3('0x84')]},'raw':!![]})[_0x71a3('0x15')](function(_0x28c184){if(!_0x28c184||_0x28c184[_0x71a3('0x86')]!=0x0)return _0x38f928;return db['UserProfileResource'][_0x71a3('0x80')]({'name':_0x38f928[_0x71a3('0x3b')],'resourceId':_0x38f928['id'],'type':_0x28c184['name'],'sectionId':_0x28c184['id']},{})[_0x71a3('0x15')](function(){return _0x38f928;});})['catch'](function(_0x2d3b17){logger[_0x71a3('0x1c')](_0x71a3('0x87'),_0x2d3b17);throw _0x2d3b17;});})[_0x71a3('0x15')](respondWithResult(_0x18a3ae,0xc9))[_0x71a3('0x20')](handleError(_0x18a3ae,null));};exports['bulkCreate']=function(_0x471c80,_0x1bca59){var _0x51a48f=_0x471c80[_0x71a3('0x5c')];var _0x358853=[];if(_0x471c80[_0x71a3('0x2f')]['role']===_0x71a3('0x71'))throw new Error(_0x71a3('0x81'));if(_[_0x71a3('0x88')](_0x51a48f,['role','user'])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x71a3('0x88')](_0x51a48f,['role',_0x71a3('0x2d')])&&_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!=='admin'){throw new Error(_0x71a3('0x89'));}return licenseUtil['checkUserLimits'](_0x51a48f)[_0x71a3('0x15')](function(){return validateUser(_0x51a48f[0x0]);})[_0x71a3('0x15')](function(){for(var _0x333ab6=0x1;_0x333ab6<_0x51a48f[_0x71a3('0x4b')];_0x333ab6++){var _0x4713a3=_0x51a48f[_0x333ab6-0x1]['internal'];if(!_0x51a48f[_0x333ab6][_0x71a3('0x67')])_0x51a48f[_0x333ab6][_0x71a3('0x67')]=_0x4713a3+0x1;_0x358853['push'](validateUser(_0x51a48f[_0x333ab6]));}return BPromise['all'](_0x358853);})[_0x71a3('0x15')](function(){_0x358853=[];for(var _0xbd5fcc=0x0;_0xbd5fcc<_0x51a48f[_0x71a3('0x4b')];_0xbd5fcc++){_0x358853['push'](updateUser(_0x51a48f[_0xbd5fcc]));}return BPromise[_0x71a3('0x5b')](_0x358853);})[_0x71a3('0x15')](function(){return BPromise[_0x71a3('0x8a')](_0x51a48f,function(_0x2fab3e){return db[_0x71a3('0x43')][_0x71a3('0x80')](_0x2fab3e,{'include':[{'model':db[_0x71a3('0x6e')],'as':'VoiceMail'}]})[_0x71a3('0x15')](function(_0xd87f34){_0x2fab3e['id']=_0xd87f34['id'];return _0x2fab3e;});});})[_0x71a3('0x15')](function(_0x2fc088){if(_0x471c80['body'][_0x71a3('0x2c')]===_0x71a3('0x2f'))return _0x2fc088;if(_0x471c80[_0x71a3('0x2f')][_0x71a3('0x2c')]!==_0x71a3('0x2f'))return _0x2fc088;var _0x220299=_[_0x71a3('0x88')](_0x2fc088,function(_0xd79454){return _0xd79454['role']===_0x71a3('0x71')||_0xd79454['role']===_0x71a3('0x32');});if(!_0x220299)return _0x2fc088;return db[_0x71a3('0x85')][_0x71a3('0x8b')]({'where':{'name':{'$or':[_0x71a3('0x30'),'Telephones']},'userProfileId':_0x471c80['user']['userProfileId']},'raw':!![]})[_0x71a3('0x15')](function(_0x38d740){if(_[_0x71a3('0x8c')](_0x38d740)||!_[_0x71a3('0x88')](_0x38d740,[_0x71a3('0x86'),0x0]))return _0x2fc088;_0x358853=[];var _0x11014c=_(_0x38d740)[_0x71a3('0x35')](function(_0x14919d){if(_0x14919d[_0x71a3('0x86')]===0x1)return;return _0x14919d[_0x71a3('0x3b')]==='Agents'?_0x71a3('0x71'):_0x71a3('0x32');})[_0x71a3('0x8d')]()[_0x71a3('0x36')]();for(var _0x43aab6=0x0;_0x43aab6<_0x2fc088[_0x71a3('0x4b')];_0x43aab6++){if(!_['includes'](_0x11014c,_0x2fc088[_0x43aab6][_0x71a3('0x2c')]))return;var _0x5ee509=_0x2fc088[_0x43aab6][_0x71a3('0x2c')]==='agent'?_0x71a3('0x30'):_0x71a3('0x31');_0x358853['push'](db[_0x71a3('0x39')]['create']({'name':_0x2fc088[_0x43aab6][_0x71a3('0x3b')],'resourceId':_0x2fc088[_0x43aab6]['id'],'type':_0x5ee509,'sectionId':_['find'](_0x38d740,[_0x71a3('0x3b'),_0x5ee509])['id']},{}));}return BPromise[_0x71a3('0x5b')](_0x358853);});})['then'](respondWithResult(_0x1bca59,0xc9))[_0x71a3('0x20')](handleError(_0x1bca59,null));};exports[_0x71a3('0x8e')]=function(_0x31bbd9,_0xf0bded){if(_0x31bbd9[_0x71a3('0x5c')]['id']){delete _0x31bbd9[_0x71a3('0x5c')]['id'];}return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x31bbd9['params']['id']}})[_0x71a3('0x15')](function(_0x1435f8){if(!_0x1435f8)return null;if(_0x1435f8['id']===_0x31bbd9[_0x71a3('0x2f')]['id']){if(!_0x31bbd9['body'][_0x71a3('0x8f')]||!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db['Sequelize']['ValidationError'](_0x71a3('0x91'));}if(!_0x1435f8[_0x71a3('0x92')](_0x31bbd9['body'][_0x71a3('0x8f')])){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x95'));}if(_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x8f')]===_0x31bbd9[_0x71a3('0x5c')]['newPassword']){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2d')){if(!_0x31bbd9['body'][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x31bbd9['user'][_0x71a3('0x2c')]===_0x71a3('0x2f')){if(!_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')]){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x96'));}if(_0x1435f8[_0x71a3('0x2c')]!==_0x71a3('0x71')){throw new db['Sequelize'][(_0x71a3('0x94'))]('Unauthorized');}}else{throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0x81'));}return _0x1435f8;})[_0x71a3('0x15')](handleEntityNotFound(_0xf0bded,null))['then'](function(_0x500bd9){return db[_0x71a3('0x62')][_0x71a3('0x97')]({'attributes':['id',_0x71a3('0x64'),_0x71a3('0x98'),'passwordHistoryLimit']})[_0x71a3('0x15')](function(_0x609352){if(_0x609352['securePassword'])authService[_0x71a3('0x65')](_0x31bbd9['body'][_0x71a3('0x90')]);if(!_0x609352[_0x71a3('0x98')]||!_0x500bd9[_0x71a3('0x99')])return _0x500bd9;authService[_0x71a3('0x9a')](_0x31bbd9[_0x71a3('0x5c')]['newPassword'],_0x500bd9[_0x71a3('0x99')],_0x609352['passwordHistoryLimit']);return _0x500bd9;})[_0x71a3('0x15')](saveUpdates({'password':_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],'passwordResetAt':_0x31bbd9[_0x71a3('0x2f')]['id']==_0x31bbd9[_0x71a3('0x5f')]['id']?moment():null,'previousPasswords':authService[_0x71a3('0x9b')](_0x31bbd9[_0x71a3('0x5c')][_0x71a3('0x90')],_0x500bd9[_0x71a3('0x99')])},null));})[_0x71a3('0x15')](respondWithResult(_0xf0bded,null))[_0x71a3('0x20')](handleError(_0xf0bded,null));};exports[_0x71a3('0x9c')]=function(_0x3d1710,_0x17951c){var _0x5ea267=_0x3d1710['body']['channel'];return db[_0x71a3('0x43')]['find']({'where':{'id':_0x3d1710[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c'),_0x71a3('0x9d'),'loginInPause',_0x71a3('0x9e'),_0x71a3('0x9f')]})[_0x71a3('0x15')](handleEntityNotFound(_0x17951c,null))[_0x71a3('0x15')](function(_0x29e932){if(_0x29e932){if(!utils[_0x71a3('0xa0')](_0x5ea267)){throw new db[(_0x71a3('0x93'))][(_0x71a3('0x94'))](_0x71a3('0xa1'));}return _0x29e932['add'+_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'Queues'](_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')],{'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0})[_0x71a3('0xa4')](function(_0x125bd4){for(var _0x57edb2=0x0;_0x57edb2<_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x57edb2+=0x1){var _0x47167a={'UserId':Number(_0x3d1710[_0x71a3('0x5f')]['id'])};_0x47167a[_[_0x71a3('0xa2')](_0x5ea267['toLowerCase']())+'QueueId']=Number(_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')][_0x57edb2]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0x5ea267[_0x71a3('0xa6')]())+_0x71a3('0xa7'),_0x47167a);}return _0x125bd4;})['then'](function(){if(_0x5ea267==='voice'){return db[_0x71a3('0xa8')][_0x71a3('0x8b')]({'where':{'id':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0x60')]||[]},'raw':!![],'attributes':['id',_0x71a3('0x3b')]});}})[_0x71a3('0x15')](function(_0xa539cc){var _0x47cd2f=_0x29e932[_0x71a3('0x2b')]({'plain':!![]});var _0x34582b=[];if(_0x5ea267===_0x71a3('0xa9')&&_0x47cd2f[_0x71a3('0x2c')]===_0x71a3('0x71')&&_0x47cd2f[_0x71a3('0x9d')]){for(var _0x3a66f8=0x0;_0x3a66f8<_0xa539cc[_0x71a3('0x4b')];_0x3a66f8+=0x1){_0x34582b[_0x71a3('0x47')]({'membername':_0x47cd2f[_0x71a3('0x3b')],'UserId':_0x47cd2f['id'],'queue_name':_0xa539cc[_0x3a66f8][_0x71a3('0x3b')],'VoiceQueueId':_0xa539cc[_0x3a66f8]['id'],'interface':_[_0x71a3('0x68')](_0x47cd2f[_0x71a3('0x9f')])?util[_0x71a3('0xaa')](_0x71a3('0xab'),_0x47cd2f['name']):_0x47cd2f[_0x71a3('0x9f')],'paused':_0x47cd2f[_0x71a3('0x9e')]||![],'penalty':_0x3d1710[_0x71a3('0x5c')][_0x71a3('0xa3')]||0x0});}return BPromise[_0x71a3('0x8a')](_0x34582b,function(_0x35a51f){return db[_0x71a3('0xac')][_0x71a3('0xad')](_0x35a51f);});}return _0x29e932;});}})[_0x71a3('0x15')](respondWithStatusCode(_0x17951c,null))[_0x71a3('0x20')](handleError(_0x17951c,null));};exports[_0x71a3('0xae')]=function(_0xbe2360,_0x1b6c9b){var _0x22873;return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0xbe2360['params']['id']},'attributes':['id',_0x71a3('0x3b'),_0x71a3('0x2c')]})[_0x71a3('0x15')](handleEntityNotFound(_0x1b6c9b,null))[_0x71a3('0x15')](function(_0x56a85a){if(_0x56a85a){_0x22873=_0x56a85a;if(!_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]||!utils[_0x71a3('0xa0')](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')])){throw new db[(_0x71a3('0x93'))]['ValidationError']('Unknown\x20channel');}return _0x56a85a[_0x71a3('0xb0')+_['capitalize'](_0xbe2360['query'][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb1')](_0xbe2360[_0x71a3('0x44')]['ids']);}})[_0x71a3('0x15')](function(_0x169408){if(_['isArray'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')])){for(var _0x3965d1=0x0;_0x3965d1<_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x71a3('0x4b')];_0x3965d1+=0x1){var _0x410c41={'UserId':Number(_0xbe2360[_0x71a3('0x5f')]['id'])};_0x410c41[_[_0x71a3('0xa2')](_0xbe2360[_0x71a3('0x44')]['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')][_0x3965d1]);socket[_0x71a3('0xa5')]('user'+_[_0x71a3('0xa2')](_0xbe2360['query']['channel'][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}}else{var _0x410c41={'UserId':Number(_0xbe2360['params']['id'])};_0x410c41[_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb2')]=Number(_0xbe2360[_0x71a3('0x44')][_0x71a3('0x60')]);socket[_0x71a3('0xa5')](_0x71a3('0x2f')+_['capitalize'](_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')][_0x71a3('0xa6')]())+_0x71a3('0xb3'),_0x410c41);}return _0x169408;})['then'](function(){if(_0xbe2360[_0x71a3('0x44')][_0x71a3('0xaf')]==='voice'){return db[_0x71a3('0xac')][_0x71a3('0x2a')]({'where':{'UserId':_0xbe2360[_0x71a3('0x5f')]['id'],'VoiceQueueId':_0xbe2360['query'][_0x71a3('0x60')]},'individualHooks':!![]})[_0x71a3('0x15')](function(){return _0x22873;});}return _0x22873;})['then'](respondWithStatusCode(_0x1b6c9b,null))[_0x71a3('0x20')](handleError(_0x1b6c9b,null));};exports[_0x71a3('0xb4')]=function(_0x39965e,_0x13b1f7){_0x39965e[_0x71a3('0x5c')][_0x71a3('0xb5')]=_0x39965e[_0x71a3('0xb6')][_0x71a3('0xb7')];return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x39965e[_0x71a3('0x5f')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x13b1f7,null))[_0x71a3('0x15')](saveUpdates(_0x39965e[_0x71a3('0x5c')],null))[_0x71a3('0x15')](respondWithResult(_0x13b1f7,null))[_0x71a3('0x20')](handleError(_0x13b1f7,null));};exports['getAvatar']=function(_0x3a3f78,_0x39939d){var _0x13741a=path['join'](config[_0x71a3('0xb8')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x3a3f78[_0x71a3('0x5f')]['id']},'attributes':['id',_0x71a3('0xb5')],'raw':!![]})[_0x71a3('0x15')](handleEntityNotFound(_0x39939d,null))[_0x71a3('0x15')](function(_0x3eb84f){if(_0x3eb84f){if(_[_0x71a3('0x68')](_0x3eb84f[_0x71a3('0xb5')])){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}else{if(!fs[_0x71a3('0xba')](path[_0x71a3('0xbb')](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]))){return _0x39939d[_0x71a3('0xb9')](_0x13741a);}return _0x39939d[_0x71a3('0xb9')](path['join'](config[_0x71a3('0xb8')],_0x71a3('0xbc'),_0x3eb84f[_0x71a3('0xb5')]));}}})[_0x71a3('0x20')](handleError(_0x39939d,null));};exports['getOpenTabs']=function(_0x379c00,_0x18a69d){return db[_0x71a3('0x43')][_0x71a3('0x38')]({'where':{'id':_0x379c00[_0x71a3('0x5f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x18a69d,null))[_0x71a3('0x15')](function(_0x37a598){var _0x44bb40=[];values=_0x37a598[_0x71a3('0x4d')];_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x4c'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4e'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x5a'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x51'),_0x37a598['dataValues']));_0x44bb40['push'](get_open_tabs(_0x71a3('0x4f'),_0x37a598[_0x71a3('0x4d')]));_0x44bb40[_0x71a3('0x47')](get_open_tabs(_0x71a3('0x50'),_0x37a598[_0x71a3('0x4d')]));return BPromise['all'](_0x44bb40);})['then'](function(_0x3aebc8){var _0x40395d=[];if(_0x3aebc8){for(var _0x38594a=0x0;_0x38594a=_0x92bbdc[_0x925f('0x53')]){throw new Error(_0x925f('0x54'));}})[_0x925f('0x10')](function(){if(_0x210a7e){return db['UserVoiceQueueRt'][_0x925f('0x4b')]({'where':{'membername':_0x210a7e['name']},'individualHooks':!![]});}})[_0x925f('0x10')](function(){if(_0x210a7e){return _0x210a7e['getVoiceQueues']({'raw':!![]});}})[_0x925f('0x10')](function(_0x21a82c){if(_0x210a7e){if(_0x21a82c){var _0x2a696b=[];_0x4e36f7=_0x21a82c;if(_0x4e36f7[_0x925f('0x2e')]){for(var _0xda26de=0x0;_0xda26de<_0x4e36f7[_0x925f('0x2e')];_0xda26de++){_0x2a696b[_0x925f('0x32')](db[_0x925f('0x2a')][_0x925f('0x55')]({'membername':_0x210a7e[_0x925f('0x27')],'UserId':_0x210a7e['id'],'queue_name':_0x4e36f7[_0xda26de][_0x925f('0x27')],'VoiceQueueId':_0x4e36f7[_0xda26de]['id'],'interface':_0x23b325,'paused':_0x210a7e['loginInPause']||![],'penalty':_0x4e36f7[_0xda26de][_0x925f('0x56')]||0x0}));}return BPromise[_0x925f('0x49')](_0x2a696b);}}}})[_0x925f('0x10')](function(){if(_0x210a7e){return db[_0x925f('0x2c')][_0x925f('0x1b')]({'where':{'membername':_0x210a7e[_0x925f('0x27')],'exitAt':null}});}})['then'](function(_0xad2c6c){if(_0x210a7e){if(_0xad2c6c&&_0xad2c6c[_0x925f('0x2e')]){var _0xb458bd=[];_0xad2c6c['forEach'](function(_0x14d668){_0xb458bd[_0x925f('0x32')](_0x14d668[_0x925f('0x2b')]({'exitAt':moment()['format'](_0x925f('0x2d'))}));});return BPromise[_0x925f('0x49')](_0xb458bd);}}})[_0x925f('0x10')](function(_0x370a47){if(_0x210a7e){var _0x2ce961=[];var _0x4d0588=[];var _0xf35f28=utils[_0x925f('0x30')]();var _0x506759={'membername':_0x210a7e[_0x925f('0x27')],'interface':_0x23b325,'enterAt':moment()[_0x925f('0x35')](_0x925f('0x2d')),'role':_0x210a7e['role'],'internal':_0x210a7e[_0x925f('0x29')]};_0xf35f28[_0x925f('0x31')](function(_0x1c9c1b){_0x2ce961['push'](_['merge']({'channel':_0x1c9c1b,'type':_0x925f('0x57'),'data1':'callysquare','data2':_0x23b325},_0x506759));if(_0x210a7e[_0x925f('0x4f')]){_0x4d0588[_0x925f('0x32')](_[_0x925f('0x58')]({'channel':_0x1c9c1b,'type':_0x925f('0x36'),'data1':_0x925f('0x59')},_0x506759));}});return db[_0x925f('0x2c')]['bulkCreate'](_0x2ce961[_0x925f('0x5a')](_0x4d0588),{'individualHooks':!![]});}})[_0x925f('0x10')](function(){if(_0x210a7e){return _0x210a7e[_0x925f('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x925f('0x35')](_0x925f('0x2d')),'voicePause':_0x210a7e[_0x925f('0x4f')]||![],'mailPause':_0x210a7e[_0x925f('0x4f')]||![],'chatPause':_0x210a7e[_0x925f('0x4f')]||![],'faxPause':_0x210a7e[_0x925f('0x4f')]||![],'smsPause':_0x210a7e['loginInPause']||![],'openchannelPause':_0x210a7e[_0x925f('0x4f')]||![],'pauseType':_0x210a7e['loginInPause']?_0x925f('0x59'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x23b325});}})[_0x925f('0x10')](function(_0x15305c){_0x4da0e5(_0x15305c);})[_0x925f('0x19')](function(_0x463a1e){_0x229949(_0x4d7f8c[_0x925f('0x15')](0x1f4,_0x463a1e[_0x925f('0x17')]));});});}; \ No newline at end of file +var _0x85ab=['getVoiceQueues','UserVoiceQueue.penalty','callysquare','LOGININPAUSE','loginInPause','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./user.socket','register','request','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowUser','PauseUser','role','interface','UserVoiceQueueRt','update','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','name','isNil','SIP/%s','PAUSE','DEFAULT\x20PAUSE','internal','body','uniqueid','bulkCreate','type','findOne','channel','voice','system','mail','fax','sms','openchannel','set','%s%s','Pause','all','destroy','LoginUser','mobile','phone','count','agent','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x48f382,_0x5527f5){var _0x42fdbd=function(_0x23d828){while(--_0x23d828){_0x48f382['push'](_0x48f382['shift']());}};_0x42fdbd(++_0x5527f5);}(_0x85ab,0xb7));var _0xb85a=function(_0x505684,_0x2c1dc9){_0x505684=_0x505684-0x0;var _0x4389b0=_0x85ab[_0x505684];return _0x4389b0;};'use strict';var _=require(_0xb85a('0x0'));var util=require(_0xb85a('0x1'));var moment=require(_0xb85a('0x2'));var BPromise=require(_0xb85a('0x3'));var rs=require(_0xb85a('0x4'));var fs=require('fs');var Redis=require(_0xb85a('0x5'));var db=require(_0xb85a('0x6'))['db'];var utils=require(_0xb85a('0x7'));var logger=require(_0xb85a('0x8'))(_0xb85a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb85a('0xa')]['http']({'port':0x232a});config[_0xb85a('0xb')]=_[_0xb85a('0xc')](config['redis'],{'host':_0xb85a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb85a('0xb')]));require(_0xb85a('0xe'))[_0xb85a('0xf')](socket);function respondWithRpcPromise(_0x15e6e2,_0x5cfbbb,_0x594080){return new BPromise(function(_0x5cf47f,_0x4db56a){return client[_0xb85a('0x10')](_0x15e6e2,_0x594080)[_0xb85a('0x11')](function(_0x420738){logger[_0xb85a('0x12')]('User,\x20%s,\x20%s',_0x5cfbbb,_0xb85a('0x13'));logger['debug'](_0xb85a('0x14'),_0x5cfbbb,_0xb85a('0x13'),JSON[_0xb85a('0x15')](_0x420738));if(_0x420738[_0xb85a('0x16')]){if(_0x420738['error'][_0xb85a('0x17')]===0x1f4){logger[_0xb85a('0x16')](_0xb85a('0x18'),_0x5cfbbb,_0x420738['error'][_0xb85a('0x19')]);return _0x4db56a(_0x420738['error'][_0xb85a('0x19')]);}logger[_0xb85a('0x16')](_0xb85a('0x18'),_0x5cfbbb,_0x420738[_0xb85a('0x16')][_0xb85a('0x19')]);return _0x5cf47f(_0x420738[_0xb85a('0x16')][_0xb85a('0x19')]);}else{logger[_0xb85a('0x12')](_0xb85a('0x18'),_0x5cfbbb,_0xb85a('0x13'));_0x5cf47f(_0x420738[_0xb85a('0x1a')][_0xb85a('0x19')]);}})[_0xb85a('0x1b')](function(_0x161c25){logger[_0xb85a('0x16')]('User,\x20%s,\x20%s',_0x5cfbbb,_0x161c25);_0x4db56a(_0x161c25);});});}exports[_0xb85a('0x1c')]=function(_0x54289a){var _0x2256a7=this;return new Promise(function(_0x4245c2,_0x23d816){return db[_0xb85a('0x1d')][_0xb85a('0x1e')]({'raw':_0x54289a[_0xb85a('0x1f')]?_0x54289a[_0xb85a('0x1f')][_0xb85a('0x20')]===undefined?!![]:![]:!![],'where':_0x54289a['options']?_0x54289a[_0xb85a('0x1f')][_0xb85a('0x21')]||null:null,'attributes':_0x54289a[_0xb85a('0x1f')]?_0x54289a[_0xb85a('0x1f')][_0xb85a('0x22')]||null:null,'limit':_0x54289a['options']?_0x54289a['options'][_0xb85a('0x23')]||null:null,'include':_0x54289a[_0xb85a('0x1f')]?_0x54289a[_0xb85a('0x1f')][_0xb85a('0x24')]?_[_0xb85a('0x25')](_0x54289a[_0xb85a('0x1f')][_0xb85a('0x24')],function(_0x44ea50){return{'model':db[_0x44ea50['model']],'as':_0x44ea50['as'],'attributes':_0x44ea50['attributes'],'include':_0x44ea50[_0xb85a('0x24')]?_['map'](_0x44ea50[_0xb85a('0x24')],function(_0x121792){return{'model':db[_0x121792[_0xb85a('0x26')]],'as':_0x121792['as'],'attributes':_0x121792['attributes'],'include':_0x121792[_0xb85a('0x24')]?_['map'](_0x121792['include'],function(_0x3add6b){return{'model':db[_0x3add6b['model']],'as':_0x3add6b['as'],'attributes':_0x3add6b[_0xb85a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb85a('0x11')](function(_0x36364c){logger[_0xb85a('0x12')](_0xb85a('0x1c'),_0x54289a);logger[_0xb85a('0x27')]('GetUser',_0x54289a,JSON['stringify'](_0x36364c));_0x4245c2(_0x36364c);})['catch'](function(_0x1bfea2){logger['error']('GetUser',_0x1bfea2[_0xb85a('0x19')],_0x54289a);_0x23d816(_0x2256a7[_0xb85a('0x16')](0x1f4,_0x1bfea2[_0xb85a('0x19')]));});});};exports['ShowUser']=function(_0x2cf992){var _0x343941=this;return new Promise(function(_0x42ff35,_0x5fd5cb){return db[_0xb85a('0x1d')][_0xb85a('0x28')]({'raw':_0x2cf992[_0xb85a('0x1f')]?_0x2cf992[_0xb85a('0x1f')][_0xb85a('0x20')]===undefined?!![]:![]:!![],'where':_0x2cf992[_0xb85a('0x1f')]?_0x2cf992[_0xb85a('0x1f')][_0xb85a('0x21')]||null:null,'attributes':_0x2cf992[_0xb85a('0x1f')]?_0x2cf992['options'][_0xb85a('0x22')]||null:null,'include':_0x2cf992['options']?_0x2cf992[_0xb85a('0x1f')][_0xb85a('0x24')]?_[_0xb85a('0x25')](_0x2cf992['options'][_0xb85a('0x24')],function(_0x14845d){return{'model':db[_0x14845d[_0xb85a('0x26')]],'as':_0x14845d['as'],'attributes':_0x14845d[_0xb85a('0x22')],'include':_0x14845d['include']?_[_0xb85a('0x25')](_0x14845d[_0xb85a('0x24')],function(_0xa0573f){return{'model':db[_0xa0573f['model']],'as':_0xa0573f['as'],'attributes':_0xa0573f[_0xb85a('0x22')],'include':_0xa0573f['include']?_[_0xb85a('0x25')](_0xa0573f[_0xb85a('0x24')],function(_0x1f44b5){return{'model':db[_0x1f44b5[_0xb85a('0x26')]],'as':_0x1f44b5['as'],'attributes':_0x1f44b5[_0xb85a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbdb392){logger[_0xb85a('0x12')](_0xb85a('0x29'),_0x2cf992);logger[_0xb85a('0x27')](_0xb85a('0x29'),_0x2cf992,JSON[_0xb85a('0x15')](_0xbdb392));_0x42ff35(_0xbdb392);})[_0xb85a('0x1b')](function(_0x3d8152){logger[_0xb85a('0x16')](_0xb85a('0x29'),_0x3d8152[_0xb85a('0x19')],_0x2cf992);_0x5fd5cb(_0x343941['error'](0x1f4,_0x3d8152[_0xb85a('0x19')]));});});};exports[_0xb85a('0x2a')]=function(_0x2a634c){var _0x42a6a0=this;return new Promise(function(_0x1d1dd5,_0x3a3cb0){var _0x14c719;return db[_0xb85a('0x1d')][_0xb85a('0x28')]({'where':_0x2a634c['options'][_0xb85a('0x21')]||{},'attributes':['id','name',_0xb85a('0x2b'),'internal',_0xb85a('0x2c')]})[_0xb85a('0x11')](function(_0x424ce9){if(_0x424ce9){_0x14c719=_0x424ce9;return db[_0xb85a('0x2d')][_0xb85a('0x2e')]({'paused':0x1},{'where':{'UserId':_0x14c719['id']},'individualHooks':!![]});}})[_0xb85a('0x11')](function(){if(_0x14c719){return db[_0xb85a('0x2f')][_0xb85a('0x1e')]({'where':{'membername':_0x14c719['name'],'type':'PAUSE','exitAt':null}});}})[_0xb85a('0x11')](function(_0x293fbc){if(_0x14c719){if(_0x293fbc&&_0x293fbc['length']){var _0x4d6e9e=moment()[_0xb85a('0x30')](_0xb85a('0x31'));for(var _0x296c77=0x0,_0x34cf92=_0x293fbc[_0xb85a('0x32')];_0x296c77<_0x34cf92;_0x296c77++){_0x293fbc[_0x296c77][_0xb85a('0x33')]({'exitAt':_0x4d6e9e});}}}})['then'](function(){if(_0x14c719){var _0x29b719=[];var _0xb4f609=utils['getChannels']();_0xb4f609[_0xb85a('0x34')](function(_0x11fadf){_0x29b719[_0xb85a('0x35')]({'channel':_0x11fadf,'membername':_0x14c719[_0xb85a('0x36')],'interface':_[_0xb85a('0x37')](_0x14c719[_0xb85a('0x2c')])?util[_0xb85a('0x30')](_0xb85a('0x38'),_0x14c719[_0xb85a('0x36')]):_0x14c719[_0xb85a('0x2c')],'type':_0xb85a('0x39'),'enterAt':moment()[_0xb85a('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2a634c['body']['type']||_0xb85a('0x3a'),'role':_0x14c719[_0xb85a('0x2b')],'internal':_0x14c719[_0xb85a('0x3b')],'uniqueid':_0x2a634c[_0xb85a('0x3c')][_0xb85a('0x3d')]||null});});return db['MemberReport'][_0xb85a('0x3e')](_0x29b719,{'individualHooks':!![]});}})[_0xb85a('0x11')](function(){if(_0x14c719){return _0x14c719[_0xb85a('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2a634c[_0xb85a('0x3c')][_0xb85a('0x3f')]||_0xb85a('0x3a'),'lastPauseAt':moment()['format'](_0xb85a('0x31'))});}})[_0xb85a('0x11')](function(_0x183813){_0x1d1dd5(_0x183813);})['catch'](function(_0x581a71){_0x3a3cb0(_0x42a6a0['error'](0x1f4,_0x581a71[_0xb85a('0x19')]));});});};exports['UnpauseUser']=function(_0x522e23){var _0x255c85=this;return new Promise(function(_0x13f303,_0x497b10){var _0x474b6b;return db[_0xb85a('0x1d')][_0xb85a('0x40')]({'where':_0x522e23[_0xb85a('0x1f')][_0xb85a('0x21')]||{},'attributes':['id','name']})['then'](function(_0x15b4e4){if(_0x15b4e4){_0x474b6b=_0x15b4e4;if(_0x522e23[_0xb85a('0x3c')]['channel']&&!utils['isValidChannel'](_0x522e23[_0xb85a('0x3c')][_0xb85a('0x41')])){throw new Error('Unknown\x20channel');}switch(_0x522e23[_0xb85a('0x3c')][_0xb85a('0x41')]){case _0xb85a('0x42'):return db[_0xb85a('0x2d')][_0xb85a('0x2e')]({'paused':0x0},{'where':{'UserId':_0x474b6b['id']}})['then'](function(){return db[_0xb85a('0x2f')][_0xb85a('0x28')]({'where':{'channel':_0x522e23[_0xb85a('0x3c')][_0xb85a('0x41')],'membername':_0x474b6b[_0xb85a('0x36')],'type':_0xb85a('0x39'),'exitAt':null}});})[_0xb85a('0x11')](function(_0x44ba1){if(_0x44ba1){return _0x44ba1['update']({'exitAt':moment()[_0xb85a('0x30')](_0xb85a('0x31')),'data2':_0xb85a('0x43')},{'individualHooks':!![]});}return null;})[_0xb85a('0x11')](function(){return _0x474b6b['update']({'voicePause':![]});});case _0xb85a('0x44'):case'chat':case _0xb85a('0x45'):case _0xb85a('0x46'):case _0xb85a('0x47'):case'whatsapp':return db['MemberReport'][_0xb85a('0x28')]({'where':{'channel':_0x522e23[_0xb85a('0x3c')][_0xb85a('0x41')],'membername':_0x474b6b[_0xb85a('0x36')],'type':'PAUSE','exitAt':null}})[_0xb85a('0x11')](function(_0x22176a){return _0x22176a[_0xb85a('0x2e')]({'exitAt':moment()[_0xb85a('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb85a('0x43')},{'individualHooks':!![]});})[_0xb85a('0x11')](function(){var _0x296b2b={};_[_0xb85a('0x48')](_0x296b2b,util[_0xb85a('0x30')](_0xb85a('0x49'),_0x522e23[_0xb85a('0x3c')][_0xb85a('0x41')],_0xb85a('0x4a')),![]);return _0x474b6b['update'](_0x296b2b);});default:return db[_0xb85a('0x2d')][_0xb85a('0x2e')]({'paused':0x0},{'where':{'UserId':_0x474b6b['id']}})[_0xb85a('0x11')](function(){return db[_0xb85a('0x2f')][_0xb85a('0x1e')]({'where':{'membername':_0x474b6b[_0xb85a('0x36')],'type':'PAUSE','exitAt':null}});})[_0xb85a('0x11')](function(_0x2ad7ca){var _0x4a8467=[];_0x2ad7ca[_0xb85a('0x34')](function(_0x4d6d94){_0x4a8467[_0xb85a('0x35')](_0x4d6d94['update']({'exitAt':moment()[_0xb85a('0x30')](_0xb85a('0x31')),'data2':_0xb85a('0x43')}));});return BPromise[_0xb85a('0x4b')](_0x4a8467);})[_0xb85a('0x11')](function(){return _0x474b6b['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xb85a('0x11')](function(_0x4fb124){_0x13f303(_0x4fb124);})[_0xb85a('0x1b')](function(_0xdd5054){_0x497b10(_0x255c85[_0xb85a('0x16')](0x1f4,_0xdd5054[_0xb85a('0x19')]));});});};exports['LogoutUser']=function(_0x193558){var _0xc8ab41=this;return new Promise(function(_0x1463f6,_0x54c384){var _0x1febc2;return db[_0xb85a('0x1d')][_0xb85a('0x40')]({'where':_0x193558[_0xb85a('0x1f')]['where']||{},'attributes':['id','name']})[_0xb85a('0x11')](function(_0x4acf65){if(_0x4acf65){_0x1febc2=_0x4acf65;return db[_0xb85a('0x2d')][_0xb85a('0x4c')]({'where':{'membername':_0x1febc2['name']},'individualHooks':!![]});}})[_0xb85a('0x11')](function(){if(_0x1febc2){return db[_0xb85a('0x2f')]['findAll']({'where':{'membername':_0x1febc2[_0xb85a('0x36')],'exitAt':null}});}})[_0xb85a('0x11')](function(_0x27fccc){if(_0x1febc2){if(_0x27fccc&&_0x27fccc['length']){var _0x14a181=[];_0x27fccc['forEach'](function(_0x2589cb){_0x14a181[_0xb85a('0x35')](_0x2589cb[_0xb85a('0x2e')]({'exitAt':moment()['format'](_0xb85a('0x31'))}));});return BPromise['all'](_0x14a181);}}})['then'](function(){if(_0x1febc2){return _0x1febc2['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb85a('0x11')](function(_0x5d0e23){_0x1463f6(_0x5d0e23);})['catch'](function(_0x1c85d4){_0x54c384(_0xc8ab41[_0xb85a('0x16')](0x1f4,_0x1c85d4[_0xb85a('0x19')]));});});};exports[_0xb85a('0x4d')]=function(_0x273712){var _0x48f6b5=this;return new Promise(function(_0x148290,_0x3d9aee){var _0x177976;var _0x51a633;var _0x3028c3;var _0xef1c2e;return db[_0xb85a('0x1d')][_0xb85a('0x40')]({'where':_0x273712[_0xb85a('0x1f')]['where']||{},'attributes':['id',_0xb85a('0x36'),'role',_0xb85a('0x4e'),_0xb85a('0x4f'),_0xb85a('0x3b'),'loginInPause',_0xb85a('0x2c')]})[_0xb85a('0x11')](function(_0x3092c5){if(_0x3092c5){_0x177976=_0x3092c5;_0xef1c2e=_0x273712[_0xb85a('0x3c')][_0xb85a('0x2c')]?_0x273712[_0xb85a('0x3c')]['interface']:util[_0xb85a('0x30')]('SIP/%s',_0x177976[_0xb85a('0x36')]);return db[_0xb85a('0x1d')][_0xb85a('0x50')]({'where':{'role':_0xb85a('0x51'),'online':!![],'id':{'$ne':_0x177976['id']}}});}})[_0xb85a('0x11')](function(_0x47b148){if(_0x47b148){_0x3028c3=_0x47b148;return require('../../config/license/util')['getLicense']();}})[_0xb85a('0x11')](function(_0x1dfd51){if(_0x1dfd51&&_0x1dfd51['agents']&&_0x3028c3>=_0x1dfd51[_0xb85a('0x52')]){throw new Error(_0xb85a('0x53'));}})[_0xb85a('0x11')](function(){if(_0x177976){return db[_0xb85a('0x2d')]['destroy']({'where':{'membername':_0x177976['name']},'individualHooks':!![]});}})[_0xb85a('0x11')](function(){if(_0x177976){return _0x177976[_0xb85a('0x54')]({'raw':!![]});}})[_0xb85a('0x11')](function(_0x5518e5){if(_0x177976){if(_0x5518e5){var _0x1f4386=[];_0x51a633=_0x5518e5;if(_0x51a633[_0xb85a('0x32')]){for(var _0x3d1c20=0x0;_0x3d1c20<_0x51a633[_0xb85a('0x32')];_0x3d1c20++){_0x1f4386[_0xb85a('0x35')](db['UserVoiceQueueRt']['upsert']({'membername':_0x177976['name'],'UserId':_0x177976['id'],'queue_name':_0x51a633[_0x3d1c20][_0xb85a('0x36')],'VoiceQueueId':_0x51a633[_0x3d1c20]['id'],'interface':_0xef1c2e,'paused':_0x177976['loginInPause']||![],'penalty':_0x51a633[_0x3d1c20][_0xb85a('0x55')]||0x0}));}return BPromise[_0xb85a('0x4b')](_0x1f4386);}}}})[_0xb85a('0x11')](function(){if(_0x177976){return db['MemberReport'][_0xb85a('0x1e')]({'where':{'membername':_0x177976[_0xb85a('0x36')],'exitAt':null}});}})['then'](function(_0x18d6ed){if(_0x177976){if(_0x18d6ed&&_0x18d6ed['length']){var _0xf88cfd=[];_0x18d6ed[_0xb85a('0x34')](function(_0xca6d65){_0xf88cfd[_0xb85a('0x35')](_0xca6d65['update']({'exitAt':moment()[_0xb85a('0x30')](_0xb85a('0x31'))}));});return BPromise[_0xb85a('0x4b')](_0xf88cfd);}}})['then'](function(_0x265466){if(_0x177976){var _0x1d6e00=[];var _0x484508=[];var _0x43817d=utils['getChannels']();var _0x434c58={'membername':_0x177976[_0xb85a('0x36')],'interface':_0xef1c2e,'enterAt':moment()['format'](_0xb85a('0x31')),'role':_0x177976['role'],'internal':_0x177976['internal']};_0x43817d[_0xb85a('0x34')](function(_0x342ba3){_0x1d6e00[_0xb85a('0x35')](_['merge']({'channel':_0x342ba3,'type':'LOGIN','data1':_0xb85a('0x56'),'data2':_0xef1c2e},_0x434c58));if(_0x177976['loginInPause']){_0x484508[_0xb85a('0x35')](_['merge']({'channel':_0x342ba3,'type':_0xb85a('0x39'),'data1':_0xb85a('0x57')},_0x434c58));}});return db[_0xb85a('0x2f')][_0xb85a('0x3e')](_0x1d6e00['concat'](_0x484508),{'individualHooks':!![]});}})[_0xb85a('0x11')](function(){if(_0x177976){return _0x177976['update']({'online':!![],'lastLoginAt':moment()['format'](_0xb85a('0x31')),'voicePause':_0x177976['loginInPause']||![],'mailPause':_0x177976[_0xb85a('0x58')]||![],'chatPause':_0x177976['loginInPause']||![],'faxPause':_0x177976[_0xb85a('0x58')]||![],'smsPause':_0x177976[_0xb85a('0x58')]||![],'openchannelPause':_0x177976[_0xb85a('0x58')]||![],'pauseType':_0x177976[_0xb85a('0x58')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xb85a('0x30')](_0xb85a('0x31')),'interface':_0xef1c2e});}})[_0xb85a('0x11')](function(_0x518fbd){_0x148290(_0x518fbd);})[_0xb85a('0x1b')](function(_0xd134a3){_0x3d9aee(_0x48f6b5[_0xb85a('0x16')](0x1f4,_0xd134a3[_0xb85a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f60a897..90a6762 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 _0x17b2=['remove','update','emit','removeListener','user:','save'];(function(_0x5d2ada,_0x32f631){var _0x44769d=function(_0xe784c3){while(--_0xe784c3){_0x5d2ada['push'](_0x5d2ada['shift']());}};_0x44769d(++_0x32f631);}(_0x17b2,0x89));var _0x217b=function(_0x57a608,_0xcd52c){_0x57a608=_0x57a608-0x0;var _0x58e88e=_0x17b2[_0x57a608];return _0x58e88e;};'use strict';var UserEvents=require('./user.events');var events=[_0x217b('0x0'),_0x217b('0x1'),_0x217b('0x2')];function createListener(_0x523073,_0x526051){return function(_0x476089){_0x526051[_0x217b('0x3')](_0x523073,_0x476089);};}function removeListener(_0x5e58b4,_0xa1850b){return function(){UserEvents[_0x217b('0x4')](_0x5e58b4,_0xa1850b);};}exports['register']=function(_0x5ae451){for(var _0x2b14a0=0x0,_0x817638=events['length'];_0x2b14a0<_0x817638;_0x2b14a0++){var _0x58cfe1=events[_0x2b14a0];var _0x1bf8aa=createListener(_0x217b('0x5')+_0x58cfe1,_0x5ae451);UserEvents['on'](_0x58cfe1,_0x1bf8aa);}}; \ No newline at end of file +var _0xd21c=['save','remove','update','removeListener','user:','./user.events'];(function(_0x5f49f3,_0xb27aeb){var _0x22ebe3=function(_0x578085){while(--_0x578085){_0x5f49f3['push'](_0x5f49f3['shift']());}};_0x22ebe3(++_0xb27aeb);}(_0xd21c,0x161));var _0xcd21=function(_0x447a04,_0xf69663){_0x447a04=_0x447a04-0x0;var _0x42483b=_0xd21c[_0x447a04];return _0x42483b;};'use strict';var UserEvents=require(_0xcd21('0x0'));var events=[_0xcd21('0x1'),_0xcd21('0x2'),_0xcd21('0x3')];function createListener(_0x430616,_0x3e9638){return function(_0x4851fd){_0x3e9638['emit'](_0x430616,_0x4851fd);};}function removeListener(_0x3e99f3,_0x24e7cc){return function(){UserEvents[_0xcd21('0x4')](_0x3e99f3,_0x24e7cc);};}exports['register']=function(_0x13bc3f){for(var _0x313f2c=0x0,_0x214252=events['length'];_0x313f2c<_0x214252;_0x313f2c++){var _0x1e4be8=events[_0x313f2c];var _0x43b46b=createListener(_0xcd21('0x5')+_0x1e4be8,_0x13bc3f);UserEvents['on'](_0x1e4be8,_0x43b46b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f87735b..07e9b13 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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(_0xf6071d,_0x37edbb){var _0x430e85=function(_0x52671f){while(--_0x52671f){_0xf6071d['push'](_0xf6071d['shift']());}};_0x430e85(++_0x37edbb);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f4f5e75..eebfdfb 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 _0x4c9c=['INTEGER'];(function(_0x163f53,_0xc088a6){var _0x10befb=function(_0xf38ff9){while(--_0xf38ff9){_0x163f53['push'](_0x163f53['shift']());}};_0x10befb(++_0xc088a6);}(_0x4c9c,0x180));var _0xc4c9=function(_0xdb357c,_0x3786b6){_0xdb357c=_0xdb357c-0x0;var _0x5c8735=_0x4c9c[_0xdb357c];return _0x5c8735;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc4c9('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xad7a=['INTEGER','sequelize','exports'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xad7a,0x1b1));var _0xaad7=function(_0x1fcfd2,_0x54e9f8){_0x1fcfd2=_0x1fcfd2-0x0;var _0x1df641=_0xad7a[_0x1fcfd2];return _0x1df641;};'use strict';var Sequelize=require(_0xaad7('0x0'));module[_0xaad7('0x1')]={'penalty':{'type':Sequelize[_0xaad7('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 430c74a..1f464cc 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 _0x4e57=['path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x16c553,_0x5b9385){var _0x15cda5=function(_0x345227){while(--_0x345227){_0x16c553['push'](_0x16c553['shift']());}};_0x15cda5(++_0x5b9385);}(_0x4e57,0x19f));var _0x74e5=function(_0x12fd04,_0x1cac8f){_0x12fd04=_0x12fd04-0x0;var _0x187fef=_0x4e57[_0x12fd04];return _0x187fef;};'use strict';var _=require('lodash');var util=require(_0x74e5('0x0'));var logger=require(_0x74e5('0x1'))(_0x74e5('0x2'));var moment=require(_0x74e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x74e5('0x4'));var fs=require('fs');var path=require(_0x74e5('0x5'));var rimraf=require('rimraf');var config=require(_0x74e5('0x6'));var attributes=require(_0x74e5('0x7'));module[_0x74e5('0x8')]=function(_0x2c4aac,_0x37c533){return _0x2c4aac[_0x74e5('0x9')](_0x74e5('0xa'),attributes,{'tableName':_0x74e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b04=['request-promise','path','./userChatQueue.attributes','exports','define','user_has_chat_queues','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b04,0xd8));var _0x44b0=function(_0x3638fa,_0x4bae8f){_0x3638fa=_0x3638fa-0x0;var _0xc818a7=_0x4b04[_0x3638fa];return _0xc818a7;};'use strict';var _=require('lodash');var util=require(_0x44b0('0x0'));var logger=require(_0x44b0('0x1'))(_0x44b0('0x2'));var moment=require(_0x44b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x44b0('0x4'));var fs=require('fs');var path=require(_0x44b0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44b0('0x6'));module[_0x44b0('0x7')]=function(_0x1c012a,_0x394e42){return _0x1c012a[_0x44b0('0x8')]('UserChatQueue',attributes,{'tableName':_0x44b0('0x9'),'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 26a7b79..3bbf2f2 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 _0x240d=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserChatQueue,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x240d,0x1b9));var _0xd240=function(_0x4ec12d,_0x436b6d){_0x4ec12d=_0x4ec12d-0x0;var _0x37dc32=_0x240d[_0x4ec12d];return _0x37dc32;};'use strict';var _=require(_0xd240('0x0'));var util=require(_0xd240('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd240('0x2'));var fs=require('fs');var Redis=require(_0xd240('0x3'));var db=require(_0xd240('0x4'))['db'];var utils=require(_0xd240('0x5'));var logger=require(_0xd240('0x6'))(_0xd240('0x7'));var config=require(_0xd240('0x8'));var jayson=require(_0xd240('0x9'));var client=jayson[_0xd240('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x259319,_0x53fcec,_0x475fcf){return new BPromise(function(_0x52537d,_0x3b6ae7){return client[_0xd240('0xb')](_0x259319,_0x475fcf)[_0xd240('0xc')](function(_0x580b09){logger[_0xd240('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x53fcec,_0xd240('0xe'));logger[_0xd240('0xf')](_0xd240('0x10'),_0x53fcec,_0xd240('0xe'),JSON[_0xd240('0x11')](_0x580b09));if(_0x580b09[_0xd240('0x12')]){if(_0x580b09[_0xd240('0x12')][_0xd240('0x13')]===0x1f4){logger[_0xd240('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x53fcec,_0x580b09[_0xd240('0x12')][_0xd240('0x14')]);return _0x3b6ae7(_0x580b09['error'][_0xd240('0x14')]);}logger['error'](_0xd240('0x15'),_0x53fcec,_0x580b09['error'][_0xd240('0x14')]);return _0x52537d(_0x580b09[_0xd240('0x12')][_0xd240('0x14')]);}else{logger[_0xd240('0xd')](_0xd240('0x15'),_0x53fcec,_0xd240('0xe'));_0x52537d(_0x580b09[_0xd240('0x16')][_0xd240('0x14')]);}})[_0xd240('0x17')](function(_0x5e57aa){logger[_0xd240('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x53fcec,_0x5e57aa);_0x3b6ae7(_0x5e57aa);});});} \ No newline at end of file +var _0x2f5d=['UserChatQueue,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2f5d,0x1df));var _0xd2f5=function(_0x158184,_0x13d68a){_0x158184=_0x158184-0x0;var _0x497742=_0x2f5d[_0x158184];return _0x497742;};'use strict';var _=require('lodash');var util=require(_0xd2f5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd2f5('0x1'));var fs=require('fs');var Redis=require(_0xd2f5('0x2'));var db=require(_0xd2f5('0x3'))['db'];var utils=require(_0xd2f5('0x4'));var logger=require('../../config/logger')(_0xd2f5('0x5'));var config=require('../../config/environment');var jayson=require(_0xd2f5('0x6'));var client=jayson['client'][_0xd2f5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x102fca,_0x39b513,_0x513a6e){return new BPromise(function(_0x39927a,_0xdae02d){return client[_0xd2f5('0x8')](_0x102fca,_0x513a6e)['then'](function(_0x28c8e3){logger[_0xd2f5('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x39b513,_0xd2f5('0xa'));logger[_0xd2f5('0xb')](_0xd2f5('0xc'),_0x39b513,_0xd2f5('0xa'),JSON['stringify'](_0x28c8e3));if(_0x28c8e3['error']){if(_0x28c8e3[_0xd2f5('0xd')][_0xd2f5('0xe')]===0x1f4){logger[_0xd2f5('0xd')](_0xd2f5('0xf'),_0x39b513,_0x28c8e3['error'][_0xd2f5('0x10')]);return _0xdae02d(_0x28c8e3[_0xd2f5('0xd')][_0xd2f5('0x10')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x39b513,_0x28c8e3[_0xd2f5('0xd')][_0xd2f5('0x10')]);return _0x39927a(_0x28c8e3['error'][_0xd2f5('0x10')]);}else{logger[_0xd2f5('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x39b513,_0xd2f5('0xa'));_0x39927a(_0x28c8e3[_0xd2f5('0x11')][_0xd2f5('0x10')]);}})[_0xd2f5('0x12')](function(_0x5e3fb9){logger['error'](_0xd2f5('0xf'),_0x39b513,_0x5e3fb9);_0xdae02d(_0x5e3fb9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 45767c6..0c69e05 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x294d1e,_0x48eeb3){var _0xa684d1=function(_0x47f94e){while(--_0x47f94e){_0x294d1e['push'](_0x294d1e['shift']());}};_0xa684d1(++_0x48eeb3);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d932c,_0x22541f){_0x2d932c=_0x2d932c-0x0;var _0x57fa94=_0xedd9[_0x2d932c];return _0x57fa94;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e1f5932..a1af0cb 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 _0x03d9=['INTEGER','STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x03d9,0x86));var _0x903d=function(_0x501914,_0x3b18af){_0x501914=_0x501914-0x0;var _0x423ce7=_0x03d9[_0x501914];return _0x423ce7;};'use strict';var Sequelize=require(_0x903d('0x0'));module[_0x903d('0x1')]={'penalty':{'type':Sequelize[_0x903d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x903d('0x3')]}}; \ No newline at end of file +var _0xb4fe=['STRING','exports','INTEGER'];(function(_0x2f92d3,_0x1dcf0f){var _0x1554e6=function(_0x1f81c0){while(--_0x1f81c0){_0x2f92d3['push'](_0x2f92d3['shift']());}};_0x1554e6(++_0x1dcf0f);}(_0xb4fe,0xd9));var _0xeb4f=function(_0x17f8c5,_0x468ef5){_0x17f8c5=_0x17f8c5-0x0;var _0xc8c8b=_0xb4fe[_0x17f8c5];return _0xc8c8b;};'use strict';var Sequelize=require('sequelize');module[_0xeb4f('0x0')]={'penalty':{'type':Sequelize[_0xeb4f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeb4f('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeb4f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9e97614..9d1aade 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 _0xf378=['bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment'];(function(_0x249dfe,_0x21f85c){var _0xc7c7be=function(_0x3d0837){while(--_0x3d0837){_0x249dfe['push'](_0x249dfe['shift']());}};_0xc7c7be(++_0x21f85c);}(_0xf378,0xbc));var _0x8f37=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf378[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x8f37('0x0'));var util=require(_0x8f37('0x1'));var logger=require('../../config/logger')(_0x8f37('0x2'));var moment=require(_0x8f37('0x3'));var BPromise=require(_0x8f37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f37('0x5'));var rimraf=require(_0x8f37('0x6'));var config=require(_0x8f37('0x7'));var attributes=require(_0x8f37('0x8'));module[_0x8f37('0x9')]=function(_0x594fbf,_0x3805a7){return _0x594fbf['define'](_0x8f37('0xa'),attributes,{'tableName':_0x8f37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x957d=['./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x957d,0x16c));var _0xd957=function(_0x2ba40f,_0x46f905){_0x2ba40f=_0x2ba40f-0x0;var _0x404fd2=_0x957d[_0x2ba40f];return _0x404fd2;};'use strict';var _=require('lodash');var util=require(_0xd957('0x0'));var logger=require(_0xd957('0x1'))(_0xd957('0x2'));var moment=require(_0xd957('0x3'));var BPromise=require(_0xd957('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd957('0x5'));var attributes=require(_0xd957('0x6'));module['exports']=function(_0x159310,_0x1c3170){return _0x159310[_0xd957('0x7')](_0xd957('0x8'),attributes,{'tableName':_0xd957('0x9'),'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 ba2331a..c41a676 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 _0x6fbd=['stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x136533,_0x41cef9){var _0x2cc80c=function(_0x1169b2){while(--_0x1169b2){_0x136533['push'](_0x136533['shift']());}};_0x2cc80c(++_0x41cef9);}(_0x6fbd,0x156));var _0xd6fb=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x6fbd[_0x382a62];return _0x490a25;};'use strict';var _=require(_0xd6fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd6fb('0x1'));var rs=require(_0xd6fb('0x2'));var fs=require('fs');var Redis=require(_0xd6fb('0x3'));var db=require(_0xd6fb('0x4'))['db'];var utils=require(_0xd6fb('0x5'));var logger=require(_0xd6fb('0x6'))('rpc');var config=require(_0xd6fb('0x7'));var jayson=require(_0xd6fb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x349ea6,_0x19508c,_0x60c05f){return new BPromise(function(_0x5245a3,_0x2ad886){return client[_0xd6fb('0x9')](_0x349ea6,_0x60c05f)[_0xd6fb('0xa')](function(_0x556b23){logger[_0xd6fb('0xb')](_0xd6fb('0xc'),_0x19508c,_0xd6fb('0xd'));logger[_0xd6fb('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x19508c,_0xd6fb('0xd'),JSON[_0xd6fb('0xf')](_0x556b23));if(_0x556b23[_0xd6fb('0x10')]){if(_0x556b23[_0xd6fb('0x10')][_0xd6fb('0x11')]===0x1f4){logger['error'](_0xd6fb('0xc'),_0x19508c,_0x556b23[_0xd6fb('0x10')][_0xd6fb('0x12')]);return _0x2ad886(_0x556b23['error'][_0xd6fb('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x19508c,_0x556b23[_0xd6fb('0x10')][_0xd6fb('0x12')]);return _0x5245a3(_0x556b23[_0xd6fb('0x10')][_0xd6fb('0x12')]);}else{logger[_0xd6fb('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x19508c,_0xd6fb('0xd'));_0x5245a3(_0x556b23[_0xd6fb('0x13')][_0xd6fb('0x12')]);}})[_0xd6fb('0x14')](function(_0x423097){logger['error'](_0xd6fb('0xc'),_0x19508c,_0x423097);_0x2ad886(_0x423097);});});} \ No newline at end of file +var _0xa808=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','UserFaxQueue,\x20%s,\x20%s'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xa808,0xb4));var _0x8a80=function(_0xac97f,_0x12513d){_0xac97f=_0xac97f-0x0;var _0x55a9c8=_0xa808[_0xac97f];return _0x55a9c8;};'use strict';var _=require('lodash');var util=require(_0x8a80('0x0'));var moment=require(_0x8a80('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a80('0x3'))['db'];var utils=require(_0x8a80('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a80('0x5'));var jayson=require(_0x8a80('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54ee15,_0x30d60d,_0x4d7b07){return new BPromise(function(_0x54b93b,_0x21859c){return client[_0x8a80('0x7')](_0x54ee15,_0x4d7b07)[_0x8a80('0x8')](function(_0x1107d5){logger['info'](_0x8a80('0x9'),_0x30d60d,'request\x20sent');logger[_0x8a80('0xa')](_0x8a80('0xb'),_0x30d60d,'request\x20sent',JSON[_0x8a80('0xc')](_0x1107d5));if(_0x1107d5[_0x8a80('0xd')]){if(_0x1107d5['error']['code']===0x1f4){logger[_0x8a80('0xd')](_0x8a80('0x9'),_0x30d60d,_0x1107d5[_0x8a80('0xd')][_0x8a80('0xe')]);return _0x21859c(_0x1107d5[_0x8a80('0xd')]['message']);}logger[_0x8a80('0xd')](_0x8a80('0x9'),_0x30d60d,_0x1107d5[_0x8a80('0xd')][_0x8a80('0xe')]);return _0x54b93b(_0x1107d5[_0x8a80('0xd')][_0x8a80('0xe')]);}else{logger[_0x8a80('0xf')](_0x8a80('0x9'),_0x30d60d,_0x8a80('0x10'));_0x54b93b(_0x1107d5[_0x8a80('0x11')]['message']);}})[_0x8a80('0x12')](function(_0x4726b8){logger[_0x8a80('0xd')](_0x8a80('0x9'),_0x30d60d,_0x4726b8);_0x21859c(_0x4726b8);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e7b3c84..1b957a4 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x413e98,_0x474a51){var _0x4034f5=function(_0x2045ac){while(--_0x2045ac){_0x413e98['push'](_0x413e98['shift']());}};_0x4034f5(++_0x474a51);}(_0x70e0,0x17b));var _0x070e=function(_0x2bd0d6,_0x455ba9){_0x2bd0d6=_0x2bd0d6-0x0;var _0x4fa310=_0x70e0[_0x2bd0d6];return _0x4fa310;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x251597,_0x3ffa57){var _0x4c8d25=function(_0x2bc575){while(--_0x2bc575){_0x251597['push'](_0x251597['shift']());}};_0x4c8d25(++_0x3ffa57);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 0ba3cb4..e35f0ac 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 _0x44cb=['exports','INTEGER'];(function(_0x9d8759,_0x209745){var _0x1b0979=function(_0x7254e0){while(--_0x7254e0){_0x9d8759['push'](_0x9d8759['shift']());}};_0x1b0979(++_0x209745);}(_0x44cb,0xbe));var _0xb44c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44cb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xb44c('0x0')]={'penalty':{'type':Sequelize[_0xb44c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x49ae=['sequelize','exports'];(function(_0x284008,_0x15961d){var _0x456f3e=function(_0x294066){while(--_0x294066){_0x284008['push'](_0x284008['shift']());}};_0x456f3e(++_0x15961d);}(_0x49ae,0x140));var _0xe49a=function(_0x1dd2cb,_0x412547){_0x1dd2cb=_0x1dd2cb-0x0;var _0x426caf=_0x49ae[_0x1dd2cb];return _0x426caf;};'use strict';var Sequelize=require(_0xe49a('0x0'));module[_0xe49a('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 3a55131..ccc44df 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 _0x4573=['api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x4573,0x15d));var _0x3457=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3457('0x0'));var util=require('util');var logger=require(_0x3457('0x1'))(_0x3457('0x2'));var moment=require(_0x3457('0x3'));var BPromise=require(_0x3457('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3457('0x5'));var rimraf=require(_0x3457('0x6'));var config=require(_0x3457('0x7'));var attributes=require(_0x3457('0x8'));module[_0x3457('0x9')]=function(_0x156049,_0x391d4c){return _0x156049[_0x3457('0xa')](_0x3457('0xb'),attributes,{'tableName':_0x3457('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d94=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x239904,_0x4b11e2){var _0x259609=function(_0x41d52a){while(--_0x41d52a){_0x239904['push'](_0x239904['shift']());}};_0x259609(++_0x4b11e2);}(_0x2d94,0x12a));var _0x42d9=function(_0x3664d0,_0x311298){_0x3664d0=_0x3664d0-0x0;var _0x11da8f=_0x2d94[_0x3664d0];return _0x11da8f;};'use strict';var _=require(_0x42d9('0x0'));var util=require(_0x42d9('0x1'));var logger=require(_0x42d9('0x2'))(_0x42d9('0x3'));var moment=require(_0x42d9('0x4'));var BPromise=require(_0x42d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42d9('0x6'));var rimraf=require('rimraf');var config=require(_0x42d9('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x42d9('0x8')]=function(_0x12ba1f,_0x42d9de){return _0x12ba1f[_0x42d9('0x9')](_0x42d9('0xa'),attributes,{'tableName':_0x42d9('0xb'),'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 05d505f..769e1e1 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x2392ff,_0x3e6cdc){var _0x1eba2e=function(_0x5a9ae2){while(--_0x5a9ae2){_0x2392ff['push'](_0x2392ff['shift']());}};_0x1eba2e(++_0x3e6cdc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0xf3cd[_0x37ef22];return _0x49eeb3;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x008c,0x188));var _0xc008=function(_0x4a055e,_0x59b80a){_0x4a055e=_0x4a055e-0x0;var _0x328a29=_0x008c[_0x4a055e];return _0x328a29;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 0712267..b83b74f 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 _0xe4ca=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x333f43,_0x4d0507){var _0x21a1a7=function(_0xa350d7){while(--_0xa350d7){_0x333f43['push'](_0x333f43['shift']());}};_0x21a1a7(++_0x4d0507);}(_0xe4ca,0x103));var _0xae4c=function(_0x3bc965,_0x52c306){_0x3bc965=_0x3bc965-0x0;var _0xf6fc28=_0xe4ca[_0x3bc965];return _0xf6fc28;};'use strict';var multer=require(_0xae4c('0x0'));var util=require(_0xae4c('0x1'));var path=require(_0xae4c('0x2'));var timeout=require(_0xae4c('0x3'));var express=require('express');var router=express[_0xae4c('0x4')]();var fs_extra=require(_0xae4c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xae4c('0x6'));var config=require(_0xae4c('0x7'));var controller=require(_0xae4c('0x8'));router[_0xae4c('0x9')]('/',auth[_0xae4c('0xa')](),controller[_0xae4c('0xb')]);module[_0xae4c('0xc')]=router; \ No newline at end of file +var _0x395b=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0x395b,0xcb));var _0xb395=function(_0x435c89,_0x2b6da8){_0x435c89=_0x435c89-0x0;var _0x183449=_0x395b[_0x435c89];return _0x183449;};'use strict';var multer=require(_0xb395('0x0'));var util=require(_0xb395('0x1'));var path=require(_0xb395('0x2'));var timeout=require('connect-timeout');var express=require(_0xb395('0x3'));var router=express[_0xb395('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb395('0x5'));var interaction=require(_0xb395('0x6'));var config=require(_0xb395('0x7'));var controller=require(_0xb395('0x8'));router[_0xb395('0x9')]('/',auth[_0xb395('0xa')](),controller['sendUserNotification']);module[_0xb395('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index b6ea2ab..577bfbc 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 _0x5fea=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fea,0x81));var _0xa5fe=function(_0x59e7e0,_0x3ec148){_0x59e7e0=_0x59e7e0-0x0;var _0x26b058=_0x5fea[_0x59e7e0];return _0x26b058;};'use strict';var Sequelize=require(_0xa5fe('0x0'));module[_0xa5fe('0x1')]={'body':{'type':Sequelize[_0xa5fe('0x2')]},'senderName':{'type':Sequelize[_0xa5fe('0x3')]},'recipientsId':{'type':Sequelize[_0xa5fe('0x2')]},'recipientsDescription':{'type':Sequelize[_0xa5fe('0x3')]},'beep':{'type':Sequelize[_0xa5fe('0x4')]}}; \ No newline at end of file +var _0xc665=['BOOLEAN','sequelize','exports','STRING'];(function(_0x245055,_0x17bd81){var _0x550d0b=function(_0x4321e6){while(--_0x4321e6){_0x245055['push'](_0x245055['shift']());}};_0x550d0b(++_0x17bd81);}(_0xc665,0xc9));var _0x5c66=function(_0x51968e,_0xbbc71c){_0x51968e=_0x51968e-0x0;var _0x5791bb=_0xc665[_0x51968e];return _0x5791bb;};'use strict';var Sequelize=require(_0x5c66('0x0'));module[_0x5c66('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x5c66('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x5c66('0x2')]},'beep':{'type':Sequelize[_0x5c66('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e3e64dc..4b2d732 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 _0xb029=['union','includes','queue','replace','Queue','ids','push','all','flatten','catch','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','sendUserNotification','text','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','voicequeue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User'];(function(_0x496689,_0x1e92ad){var _0x3badef=function(_0x2ba90c){while(--_0x2ba90c){_0x496689['push'](_0x496689['shift']());}};_0x3badef(++_0x1e92ad);}(_0xb029,0x13e));var _0x9b02=function(_0x48b6ef,_0x55bc21){_0x48b6ef=_0x48b6ef-0x0;var _0x4838cd=_0xb029[_0x48b6ef];return _0x4838cd;};'use strict';var emlformat=require(_0x9b02('0x0'));var rimraf=require(_0x9b02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b02('0x2'));var rp=require(_0x9b02('0x3'));var moment=require(_0x9b02('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b02('0x5'));var util=require('util');var path=require(_0x9b02('0x6'));var sox=require('sox');var csv=require(_0x9b02('0x7'));var ejs=require(_0x9b02('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b02('0x9'));var squel=require(_0x9b02('0xa'));var crypto=require(_0x9b02('0xb'));var jsforce=require(_0x9b02('0xc'));var deskjs=require(_0x9b02('0xd'));var toCsv=require(_0x9b02('0x7'));var querystring=require(_0x9b02('0xe'));var Papa=require(_0x9b02('0xf'));var Redis=require(_0x9b02('0x10'));var authService=require(_0x9b02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b02('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b02('0x13'))('api');var utils=require(_0x9b02('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9b02('0x15'));var db=require(_0x9b02('0x16'))['db'];config[_0x9b02('0x17')]=_[_0x9b02('0x18')](config['redis'],{'host':_0x9b02('0x19'),'port':0x18eb});var socket=require(_0x9b02('0x1a'))(new Redis(config['redis']));require('./userNotification.socket')[_0x9b02('0x1b')](socket);function respondWithStatusCode(_0x1ca48a,_0x2d54b4){_0x2d54b4=_0x2d54b4||0xcc;return function(_0x46029e){if(_0x46029e){return _0x1ca48a[_0x9b02('0x1c')](_0x2d54b4);}return _0x1ca48a[_0x9b02('0x1d')](_0x2d54b4)[_0x9b02('0x1e')]();};}function respondWithResult(_0x4dd664,_0x25f53c){_0x25f53c=_0x25f53c||0xc8;return function(_0x3a9826){if(_0x3a9826){return _0x4dd664['status'](_0x25f53c)[_0x9b02('0x1f')](_0x3a9826);}};}function respondWithFilteredResult(_0x173bc5,_0x48027){return function(_0x2ebe4d){if(_0x2ebe4d){var _0x276654=typeof _0x48027[_0x9b02('0x20')]===_0x9b02('0x21')&&typeof _0x48027[_0x9b02('0x22')]===_0x9b02('0x21');var _0x470697=_0x2ebe4d['count'];var _0x2aeaa1=_0x276654?0x0:_0x48027[_0x9b02('0x20')];var _0x4d4570=_0x276654?_0x2ebe4d[_0x9b02('0x23')]:_0x48027[_0x9b02('0x20')]+_0x48027['limit'];var _0x4893f7;if(_0x4d4570>=_0x470697){_0x4d4570=_0x470697;_0x4893f7=0xc8;}else{_0x4893f7=0xce;}_0x173bc5[_0x9b02('0x1d')](_0x4893f7);return _0x173bc5[_0x9b02('0x24')]('Content-Range',_0x2aeaa1+'-'+_0x4d4570+'/'+_0x470697)[_0x9b02('0x1f')](_0x2ebe4d);}return null;};}function patchUpdates(_0x2c7be2){return function(_0x152586){try{jsonpatch[_0x9b02('0x25')](_0x152586,_0x2c7be2,!![]);}catch(_0x390067){return BPromise['reject'](_0x390067);}return _0x152586['save']();};}function saveUpdates(_0x293cb1,_0xada5fb){return function(_0x1bf6ce){if(_0x1bf6ce){return _0x1bf6ce[_0x9b02('0x26')](_0x293cb1)[_0x9b02('0x27')](function(_0x46a380){return _0x46a380;});}return null;};}function removeEntity(_0x49e3de,_0xfa06ac){return function(_0x2db152){if(_0x2db152){return _0x2db152[_0x9b02('0x28')]()[_0x9b02('0x27')](function(){_0x49e3de[_0x9b02('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1245ae,_0x143ead){return function(_0x342452){if(!_0x342452){_0x1245ae[_0x9b02('0x1c')](0x194);}return _0x342452;};}function handleError(_0x4e1271,_0x246cbd){_0x246cbd=_0x246cbd||0x1f4;return function(_0x2f0416){logger[_0x9b02('0x29')](_0x2f0416[_0x9b02('0x2a')]);if(_0x2f0416[_0x9b02('0x2b')]){delete _0x2f0416[_0x9b02('0x2b')];}_0x4e1271[_0x9b02('0x1d')](_0x246cbd)[_0x9b02('0x2c')](_0x2f0416);};}exports[_0x9b02('0x2d')]=function(_0xcc35d0,_0xa88e4f,_0x36088f){if(!_0xcc35d0['body']['hasOwnProperty'](_0x9b02('0x2e'))&&!_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x30')]('TemplateId')){throw new db[(_0x9b02('0x31'))][(_0x9b02('0x32'))](_0x9b02('0x33'));}else{if(_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x30')](_0x9b02('0x34'))&&!_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x30')](_0x9b02('0x35'))){throw new db[(_0x9b02('0x31'))][(_0x9b02('0x32'))](_0x9b02('0x36'));}if(!_0xcc35d0['body']['hasOwnProperty'](_0x9b02('0x37'))){throw new db[(_0x9b02('0x31'))]['ValidationError'](_0x9b02('0x38'));}else{try{var _0x552274=JSON[_0x9b02('0x39')](_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x37')]);}catch(_0x409ae3){logger[_0x9b02('0x29')](_0x409ae3);throw new db[(_0x9b02('0x31'))][(_0x9b02('0x32'))](_0x9b02('0x3a'));}var _0x2c01af=[_0x9b02('0x3b'),'faxqueue','mailqueue',_0x9b02('0x3c'),'smsqueue',_0x9b02('0x3d'),_0x9b02('0x3e'),'team',_0x9b02('0x3f')];if(_[_0x9b02('0x40')](_0x552274,function(_0x2ed75e){return!_['includes'](_0x2c01af,_0x2ed75e[_0x9b02('0x41')][_0x9b02('0x42')]());})){throw new db[(_0x9b02('0x31'))][(_0x9b02('0x32'))](_0x9b02('0x43'));}}}var _0x27e71d={};_0x27e71d[_0x9b02('0x44')]=_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x30')](_0x9b02('0x44'))?_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x44')]:_0xcc35d0[_0x9b02('0x3f')][_0x9b02('0x45')];_0x27e71d[_0x9b02('0x46')]=_[_0x9b02('0x47')](_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x46')])?null:_0xcc35d0['body'][_0x9b02('0x46')];_0x27e71d['beep']=_0xcc35d0[_0x9b02('0x2f')][_0x9b02('0x48')]||![];_0x27e71d[_0x9b02('0x49')]=_0xcc35d0[_0x9b02('0x3f')]['id'];return getContent(_0xcc35d0[_0x9b02('0x2f')])[_0x9b02('0x27')](function(_0x1ef56f){_0x27e71d[_0x9b02('0x2f')]=_0x1ef56f;return getRecipients(_0x552274);})[_0x9b02('0x27')](function(_0xd3ca31){_0x27e71d[_0x9b02('0x4a')]=_[_0x9b02('0x4b')](_0xd3ca31)[_0x9b02('0x4c')](',');return db[_0x9b02('0x4d')][_0x9b02('0x4e')](function(_0x4425b1){return db[_0x9b02('0x4f')][_0x9b02('0x50')](_0x27e71d,{'raw':!![],'transaction':_0x4425b1})[_0x9b02('0x27')](function(_0x16341d){var _0x1d23be={'sender':_0x27e71d[_0x9b02('0x44')],'description':_0x27e71d[_0x9b02('0x46')],'content':_0x27e71d[_0x9b02('0x2f')],'beep':_0x27e71d[_0x9b02('0x48')]};_0xd3ca31[_0x9b02('0x51')](function(_0x19936d){_0x1d23be[_0x9b02('0x52')]=_0x19936d;socket['emit'](_0x9b02('0x53'),_0x1d23be);});return _0x16341d;});});})[_0x9b02('0x27')](respondWithResult(_0xa88e4f,0xc9))['catch'](handleError(_0xa88e4f,null));};function getContent(_0x3d9608){return new BPromise(function(_0x2b9f79,_0x4c8e27){if(_0x3d9608[_0x9b02('0x2e')]){_0x2b9f79(_0x3d9608[_0x9b02('0x2e')]);return;}return db[_0x9b02('0x54')][_0x9b02('0x55')]({'attributes':[_0x9b02('0x56')],'where':{'id':_0x3d9608[_0x9b02('0x34')]},'raw':!![]})['then'](function(_0x343320){if(!_0x343320)throw new db[(_0x9b02('0x31'))][(_0x9b02('0x32'))](_0x9b02('0x57'));var _0x5c0f50=Mustache[_0x9b02('0x58')](_0x343320[_0x9b02('0x56')],_0x3d9608[_0x9b02('0x35')]);_0x2b9f79(_0x5c0f50);})['catch'](function(_0x403da2){_0x4c8e27(_0x403da2);});});}function getRecipients(_0x51433b){return new BPromise(function(_0x1ff049,_0x428da1){var _0x25a29c=[];var _0x167a0a=[];_0x51433b[_0x9b02('0x51')](function(_0xc92ef7){var _0x39040a=_['startCase'](_0xc92ef7[_0x9b02('0x41')][_0x9b02('0x42')]());if(_0x39040a===_0x9b02('0x59')){_0x25a29c=_[_0x9b02('0x5a')](_0x25a29c,_0xc92ef7['ids']);}else{if(_[_0x9b02('0x5b')](_0x39040a,_0x9b02('0x5c')))_0x39040a=_0x39040a[_0x9b02('0x5d')]('queue',_0x9b02('0x5e'));_0xc92ef7[_0x9b02('0x5f')][_0x9b02('0x51')](function(_0x4ab5bb){_0x167a0a[_0x9b02('0x60')](getAgents(_0x39040a,_0x4ab5bb));});}});return BPromise[_0x9b02('0x61')](_0x167a0a)[_0x9b02('0x27')](function(_0x32ece4){_0x25a29c=_[_0x9b02('0x5a')](_0x25a29c,_[_0x9b02('0x62')](_0x32ece4));_0x1ff049(_0x25a29c);})[_0x9b02('0x63')](function(_0x4b4af1){_0x428da1(_0x4b4af1);});});}function getAgents(_0x13fcee,_0x48b8e1){return new BPromise(function(_0x4b66a8,_0x2c875a){return db[_0x13fcee][_0x9b02('0x55')]({'where':{'id':_0x48b8e1}})[_0x9b02('0x27')](function(_0x3d7cba){return _0x3d7cba[_0x9b02('0x64')]({'attributes':['id'],'raw':!![]})[_0x9b02('0x27')](function(_0x41c936){var _0x47a748=_[_0x9b02('0x65')](_0x41c936,'id');_0x4b66a8(_0x47a748);});})[_0x9b02('0x63')](function(_0x319520){_0x2c875a(_0x319520);});});} \ No newline at end of file +var _0xb316=['then','destroy','error','send','sendUserNotification','body','text','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','parse','recipients','Invalid\x20\x27recipients\x27\x20object','voicequeue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','model','User','union','ids','queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update'];(function(_0x21a932,_0x459d54){var _0x524fab=function(_0x26a621){while(--_0x26a621){_0x21a932['push'](_0x21a932['shift']());}};_0x524fab(++_0x459d54);}(_0xb316,0x153));var _0x6b31=function(_0x2540a2,_0x302b50){_0x2540a2=_0x2540a2-0x0;var _0x4e2145=_0xb316[_0x2540a2];return _0x4e2145;};'use strict';var emlformat=require(_0x6b31('0x0'));var rimraf=require(_0x6b31('0x1'));var zipdir=require(_0x6b31('0x2'));var jsonpatch=require(_0x6b31('0x3'));var rp=require(_0x6b31('0x4'));var moment=require(_0x6b31('0x5'));var BPromise=require(_0x6b31('0x6'));var Mustache=require('mustache');var util=require(_0x6b31('0x7'));var path=require('path');var sox=require(_0x6b31('0x8'));var csv=require(_0x6b31('0x9'));var ejs=require(_0x6b31('0xa'));var fs=require('fs');var fs_extra=require(_0x6b31('0xb'));var _=require(_0x6b31('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b31('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6b31('0x9'));var querystring=require(_0x6b31('0xe'));var Papa=require(_0x6b31('0xf'));var Redis=require(_0x6b31('0x10'));var authService=require(_0x6b31('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6b31('0x12'));var hardwareService=require(_0x6b31('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6b31('0x14'));var config=require(_0x6b31('0x15'));var licenseUtil=require(_0x6b31('0x16'));var db=require(_0x6b31('0x17'))['db'];config['redis']=_[_0x6b31('0x18')](config[_0x6b31('0x19')],{'host':_0x6b31('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b31('0x19')]));require(_0x6b31('0x1b'))[_0x6b31('0x1c')](socket);function respondWithStatusCode(_0x82b37a,_0x4aeb05){_0x4aeb05=_0x4aeb05||0xcc;return function(_0x32033e){if(_0x32033e){return _0x82b37a[_0x6b31('0x1d')](_0x4aeb05);}return _0x82b37a[_0x6b31('0x1e')](_0x4aeb05)[_0x6b31('0x1f')]();};}function respondWithResult(_0x2dffe2,_0x1708c4){_0x1708c4=_0x1708c4||0xc8;return function(_0x17024c){if(_0x17024c){return _0x2dffe2[_0x6b31('0x1e')](_0x1708c4)[_0x6b31('0x20')](_0x17024c);}};}function respondWithFilteredResult(_0xf59e1f,_0x200cf1){return function(_0x5dab54){if(_0x5dab54){var _0x432f3d=typeof _0x200cf1[_0x6b31('0x21')]===_0x6b31('0x22')&&typeof _0x200cf1[_0x6b31('0x23')]===_0x6b31('0x22');var _0x3cd374=_0x5dab54[_0x6b31('0x24')];var _0x5d16b6=_0x432f3d?0x0:_0x200cf1[_0x6b31('0x21')];var _0x33c3d5=_0x432f3d?_0x5dab54[_0x6b31('0x24')]:_0x200cf1['offset']+_0x200cf1['limit'];var _0x47d4f7;if(_0x33c3d5>=_0x3cd374){_0x33c3d5=_0x3cd374;_0x47d4f7=0xc8;}else{_0x47d4f7=0xce;}_0xf59e1f['status'](_0x47d4f7);return _0xf59e1f['set'](_0x6b31('0x25'),_0x5d16b6+'-'+_0x33c3d5+'/'+_0x3cd374)['json'](_0x5dab54);}return null;};}function patchUpdates(_0x40d5f2){return function(_0x43e949){try{jsonpatch['apply'](_0x43e949,_0x40d5f2,!![]);}catch(_0x3d52df){return BPromise[_0x6b31('0x26')](_0x3d52df);}return _0x43e949[_0x6b31('0x27')]();};}function saveUpdates(_0x2fe3a0,_0x2a8a8c){return function(_0x26b9f6){if(_0x26b9f6){return _0x26b9f6[_0x6b31('0x28')](_0x2fe3a0)[_0x6b31('0x29')](function(_0x471dff){return _0x471dff;});}return null;};}function removeEntity(_0x58f076,_0x298dcc){return function(_0x262187){if(_0x262187){return _0x262187[_0x6b31('0x2a')]()[_0x6b31('0x29')](function(){_0x58f076['status'](0xcc)[_0x6b31('0x1f')]();});}};}function handleEntityNotFound(_0x2cf5f6,_0x33e33a){return function(_0x4f84a4){if(!_0x4f84a4){_0x2cf5f6[_0x6b31('0x1d')](0x194);}return _0x4f84a4;};}function handleError(_0x517b00,_0x316120){_0x316120=_0x316120||0x1f4;return function(_0x1b490f){logger[_0x6b31('0x2b')](_0x1b490f['stack']);if(_0x1b490f['name']){delete _0x1b490f['name'];}_0x517b00[_0x6b31('0x1e')](_0x316120)[_0x6b31('0x2c')](_0x1b490f);};}exports[_0x6b31('0x2d')]=function(_0x52960c,_0x1b4974,_0x5816a2){if(!_0x52960c[_0x6b31('0x2e')]['hasOwnProperty'](_0x6b31('0x2f'))&&!_0x52960c['body'][_0x6b31('0x30')]('TemplateId')){throw new db[(_0x6b31('0x31'))][(_0x6b31('0x32'))](_0x6b31('0x33'));}else{if(_0x52960c[_0x6b31('0x2e')][_0x6b31('0x30')](_0x6b31('0x34'))&&!_0x52960c[_0x6b31('0x2e')][_0x6b31('0x30')](_0x6b31('0x35'))){throw new db[(_0x6b31('0x31'))][(_0x6b31('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x52960c[_0x6b31('0x2e')][_0x6b31('0x30')]('recipients')){throw new db['Sequelize']['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x32fa53=JSON[_0x6b31('0x36')](_0x52960c[_0x6b31('0x2e')][_0x6b31('0x37')]);}catch(_0xa6e142){logger[_0x6b31('0x2b')](_0xa6e142);throw new db[(_0x6b31('0x31'))][(_0x6b31('0x32'))](_0x6b31('0x38'));}var _0x351edd=['chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue',_0x6b31('0x39'),_0x6b31('0x3a'),'team',_0x6b31('0x3b')];if(_[_0x6b31('0x3c')](_0x32fa53,function(_0x5951b4){return!_[_0x6b31('0x3d')](_0x351edd,_0x5951b4['model'][_0x6b31('0x3e')]());})){throw new db[(_0x6b31('0x31'))][(_0x6b31('0x32'))](_0x6b31('0x3f'));}}}var _0x5a79ba={};_0x5a79ba[_0x6b31('0x40')]=_0x52960c[_0x6b31('0x2e')][_0x6b31('0x30')]('senderName')?_0x52960c[_0x6b31('0x2e')][_0x6b31('0x40')]:_0x52960c[_0x6b31('0x3b')][_0x6b31('0x41')];_0x5a79ba['recipientsDescription']=_[_0x6b31('0x42')](_0x52960c[_0x6b31('0x2e')][_0x6b31('0x43')])?null:_0x52960c[_0x6b31('0x2e')][_0x6b31('0x43')];_0x5a79ba['beep']=_0x52960c[_0x6b31('0x2e')][_0x6b31('0x44')]||![];_0x5a79ba[_0x6b31('0x45')]=_0x52960c['user']['id'];return getContent(_0x52960c[_0x6b31('0x2e')])[_0x6b31('0x29')](function(_0x1f7497){_0x5a79ba[_0x6b31('0x2e')]=_0x1f7497;return getRecipients(_0x32fa53);})[_0x6b31('0x29')](function(_0x5069ad){_0x5a79ba[_0x6b31('0x46')]=_[_0x6b31('0x47')](_0x5069ad)['join'](',');return db[_0x6b31('0x48')][_0x6b31('0x49')](function(_0x5bdffa){return db[_0x6b31('0x4a')][_0x6b31('0x4b')](_0x5a79ba,{'raw':!![],'transaction':_0x5bdffa})[_0x6b31('0x29')](function(_0x297270){var _0x155c75={'sender':_0x5a79ba[_0x6b31('0x40')],'description':_0x5a79ba[_0x6b31('0x43')],'content':_0x5a79ba[_0x6b31('0x2e')],'beep':_0x5a79ba[_0x6b31('0x44')]};_0x5069ad[_0x6b31('0x4c')](function(_0x18bdd5){_0x155c75[_0x6b31('0x4d')]=_0x18bdd5;socket[_0x6b31('0x4e')]('userNotification:send',_0x155c75);});return _0x297270;});});})[_0x6b31('0x29')](respondWithResult(_0x1b4974,0xc9))['catch'](handleError(_0x1b4974,null));};function getContent(_0x44d53d){return new BPromise(function(_0x17da47,_0x55201b){if(_0x44d53d[_0x6b31('0x2f')]){_0x17da47(_0x44d53d[_0x6b31('0x2f')]);return;}return db[_0x6b31('0x4f')][_0x6b31('0x50')]({'attributes':['html'],'where':{'id':_0x44d53d[_0x6b31('0x34')]},'raw':!![]})['then'](function(_0x58ace4){if(!_0x58ace4)throw new db[(_0x6b31('0x31'))][(_0x6b31('0x32'))](_0x6b31('0x51'));var _0x120d80=Mustache[_0x6b31('0x52')](_0x58ace4[_0x6b31('0x53')],_0x44d53d[_0x6b31('0x35')]);_0x17da47(_0x120d80);})[_0x6b31('0x54')](function(_0x35213c){_0x55201b(_0x35213c);});});}function getRecipients(_0x42687d){return new BPromise(function(_0x25dfa5,_0x567a79){var _0x919332=[];var _0x39a343=[];_0x42687d['forEach'](function(_0x39ac70){var _0x1ceb35=_['startCase'](_0x39ac70[_0x6b31('0x55')][_0x6b31('0x3e')]());if(_0x1ceb35===_0x6b31('0x56')){_0x919332=_[_0x6b31('0x57')](_0x919332,_0x39ac70[_0x6b31('0x58')]);}else{if(_['includes'](_0x1ceb35,_0x6b31('0x59')))_0x1ceb35=_0x1ceb35['replace'](_0x6b31('0x59'),'Queue');_0x39ac70[_0x6b31('0x58')][_0x6b31('0x4c')](function(_0x2aa452){_0x39a343[_0x6b31('0x5a')](getAgents(_0x1ceb35,_0x2aa452));});}});return BPromise[_0x6b31('0x5b')](_0x39a343)[_0x6b31('0x29')](function(_0x4c3ad2){_0x919332=_['union'](_0x919332,_[_0x6b31('0x5c')](_0x4c3ad2));_0x25dfa5(_0x919332);})[_0x6b31('0x54')](function(_0x525979){_0x567a79(_0x525979);});});}function getAgents(_0x4762a2,_0x423a36){return new BPromise(function(_0x52a600,_0x23c970){return db[_0x4762a2][_0x6b31('0x50')]({'where':{'id':_0x423a36}})[_0x6b31('0x29')](function(_0x42b35d){return _0x42b35d[_0x6b31('0x5d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x283772){var _0x3ad7f0=_[_0x6b31('0x5e')](_0x283772,'id');_0x52a600(_0x3ad7f0);});})['catch'](function(_0x34993a){_0x23c970(_0x34993a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 30c9ec3..156bff6 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 _0x3f65=['hasOwnProperty','hook','events','UserNotification','save','update','remove','emit'];(function(_0x2e57e6,_0x1ff615){var _0x280360=function(_0x3a1fd2){while(--_0x3a1fd2){_0x2e57e6['push'](_0x2e57e6['shift']());}};_0x280360(++_0x1ff615);}(_0x3f65,0x1d2));var _0x53f6=function(_0x55ca56,_0x3c72fd){_0x55ca56=_0x55ca56-0x0;var _0x3d684e=_0x3f65[_0x55ca56];return _0x3d684e;};'use strict';var EventEmitter=require(_0x53f6('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x53f6('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53f6('0x2'),'afterUpdate':_0x53f6('0x3'),'afterDestroy':_0x53f6('0x4')};function emitEvent(_0xa49e9d){return function(_0x42a049,_0x23bab5,_0x2abffb){UserNotificationEvents[_0x53f6('0x5')](_0xa49e9d+':'+_0x42a049['id'],_0x42a049);UserNotificationEvents['emit'](_0xa49e9d,_0x42a049);_0x2abffb(null);};}for(var e in events){if(events[_0x53f6('0x6')](e)){var event=events[e];UserNotification[_0x53f6('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x62db=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification'];(function(_0xbed774,_0x2fa714){var _0x541f72=function(_0x2ff81e){while(--_0x2ff81e){_0xbed774['push'](_0xbed774['shift']());}};_0x541f72(++_0x2fa714);}(_0x62db,0x1a5));var _0xb62d=function(_0x28d980,_0xaa1715){_0x28d980=_0x28d980-0x0;var _0x359db1=_0x62db[_0x28d980];return _0x359db1;};'use strict';var EventEmitter=require(_0xb62d('0x0'));var UserNotification=require(_0xb62d('0x1'))['db'][_0xb62d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb62d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb62d('0x4')};function emitEvent(_0x464316){return function(_0x3e350f,_0x294d9a,_0xa0906c){UserNotificationEvents[_0xb62d('0x5')](_0x464316+':'+_0x3e350f['id'],_0x3e350f);UserNotificationEvents[_0xb62d('0x5')](_0x464316,_0x3e350f);_0xa0906c(null);};}for(var e in events){if(events[_0xb62d('0x6')](e)){var event=events[e];UserNotification[_0xb62d('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 28e2452..0d6618b 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 _0x0ade=['define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./userNotification.attributes','exports'];(function(_0x9a0215,_0x59f457){var _0x436a17=function(_0x2555d3){while(--_0x2555d3){_0x9a0215['push'](_0x9a0215['shift']());}};_0x436a17(++_0x59f457);}(_0x0ade,0x1dc));var _0xe0ad=function(_0x2d8911,_0x3049f2){_0x2d8911=_0x2d8911-0x0;var _0x37f127=_0x0ade[_0x2d8911];return _0x37f127;};'use strict';var _=require(_0xe0ad('0x0'));var util=require('util');var logger=require(_0xe0ad('0x1'))(_0xe0ad('0x2'));var moment=require('moment');var BPromise=require(_0xe0ad('0x3'));var rp=require(_0xe0ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0ad('0x5'));var config=require('../../config/environment');var attributes=require(_0xe0ad('0x6'));module[_0xe0ad('0x7')]=function(_0x28ee64,_0x4a4d29){return _0x28ee64[_0xe0ad('0x8')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe0ad('0x9'),'collate':_0xe0ad('0xa')});}; \ No newline at end of file +var _0xbecc=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0xbecc,0x158));var _0xcbec=function(_0x69d335,_0x58d328){_0x69d335=_0x69d335-0x0;var _0x163e5f=_0xbecc[_0x69d335];return _0x163e5f;};'use strict';var _=require(_0xcbec('0x0'));var util=require(_0xcbec('0x1'));var logger=require(_0xcbec('0x2'))(_0xcbec('0x3'));var moment=require('moment');var BPromise=require(_0xcbec('0x4'));var rp=require(_0xcbec('0x5'));var fs=require('fs');var path=require(_0xcbec('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0xcbec('0x7')]=function(_0x4c259e,_0x5b7336){return _0x4c259e[_0xcbec('0x8')](_0xcbec('0x9'),attributes,{'tableName':_0xcbec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbec('0xb'),'collate':_0xcbec('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b39630d..1defc1e 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 _0x519a=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./userNotification.socket','register','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','UserNotification,\x20%s,\x20%s','catch','lodash','moment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x519a,0xda));var _0xa519=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x519a[_0x25c326];return _0x762452;};'use strict';var _=require(_0xa519('0x0'));var util=require('util');var moment=require(_0xa519('0x1'));var BPromise=require(_0xa519('0x2'));var rs=require(_0xa519('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa519('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa519('0x5'))('rpc');var config=require(_0xa519('0x6'));var jayson=require(_0xa519('0x7'));var client=jayson[_0xa519('0x8')]['http']({'port':0x232a});config[_0xa519('0x9')]=_['defaults'](config['redis'],{'host':_0xa519('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa519('0x9')]));require(_0xa519('0xb'))[_0xa519('0xc')](socket);function respondWithRpcPromise(_0x15937c,_0x36e89f,_0x26a4ec){return new BPromise(function(_0x20fe4d,_0x441357){return client['request'](_0x15937c,_0x26a4ec)[_0xa519('0xd')](function(_0x172f00){logger[_0xa519('0xe')]('UserNotification,\x20%s,\x20%s',_0x36e89f,_0xa519('0xf'));logger['debug'](_0xa519('0x10'),_0x36e89f,_0xa519('0xf'),JSON['stringify'](_0x172f00));if(_0x172f00['error']){if(_0x172f00[_0xa519('0x11')][_0xa519('0x12')]===0x1f4){logger[_0xa519('0x11')]('UserNotification,\x20%s,\x20%s',_0x36e89f,_0x172f00[_0xa519('0x11')][_0xa519('0x13')]);return _0x441357(_0x172f00[_0xa519('0x11')][_0xa519('0x13')]);}logger[_0xa519('0x11')]('UserNotification,\x20%s,\x20%s',_0x36e89f,_0x172f00[_0xa519('0x11')][_0xa519('0x13')]);return _0x20fe4d(_0x172f00[_0xa519('0x11')]['message']);}else{logger[_0xa519('0xe')](_0xa519('0x14'),_0x36e89f,'request\x20sent');_0x20fe4d(_0x172f00['result']['message']);}})[_0xa519('0x15')](function(_0x520f1c){logger[_0xa519('0x11')](_0xa519('0x14'),_0x36e89f,_0x520f1c);_0x441357(_0x520f1c);});});} \ No newline at end of file +var _0xc55c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x46372c,_0x40c38c){var _0x81ed20=function(_0x55c73a){while(--_0x55c73a){_0x46372c['push'](_0x46372c['shift']());}};_0x81ed20(++_0x40c38c);}(_0xc55c,0xc0));var _0xcc55=function(_0x5c05e2,_0xdd34b2){_0x5c05e2=_0x5c05e2-0x0;var _0x36d6c7=_0xc55c[_0x5c05e2];return _0x36d6c7;};'use strict';var _=require(_0xcc55('0x0'));var util=require('util');var moment=require(_0xcc55('0x1'));var BPromise=require(_0xcc55('0x2'));var rs=require(_0xcc55('0x3'));var fs=require('fs');var Redis=require(_0xcc55('0x4'));var db=require(_0xcc55('0x5'))['db'];var utils=require(_0xcc55('0x6'));var logger=require(_0xcc55('0x7'))(_0xcc55('0x8'));var config=require('../../config/environment');var jayson=require(_0xcc55('0x9'));var client=jayson[_0xcc55('0xa')]['http']({'port':0x232a});config[_0xcc55('0xb')]=_['defaults'](config[_0xcc55('0xb')],{'host':_0xcc55('0xc'),'port':0x18eb});var socket=require(_0xcc55('0xd'))(new Redis(config[_0xcc55('0xb')]));require(_0xcc55('0xe'))[_0xcc55('0xf')](socket);function respondWithRpcPromise(_0x6adcff,_0x9c59bd,_0x260f92){return new BPromise(function(_0x125d02,_0x38cf23){return client[_0xcc55('0x10')](_0x6adcff,_0x260f92)[_0xcc55('0x11')](function(_0x49c4e){logger[_0xcc55('0x12')]('UserNotification,\x20%s,\x20%s',_0x9c59bd,_0xcc55('0x13'));logger[_0xcc55('0x14')](_0xcc55('0x15'),_0x9c59bd,_0xcc55('0x13'),JSON[_0xcc55('0x16')](_0x49c4e));if(_0x49c4e[_0xcc55('0x17')]){if(_0x49c4e['error']['code']===0x1f4){logger[_0xcc55('0x17')]('UserNotification,\x20%s,\x20%s',_0x9c59bd,_0x49c4e[_0xcc55('0x17')][_0xcc55('0x18')]);return _0x38cf23(_0x49c4e[_0xcc55('0x17')][_0xcc55('0x18')]);}logger[_0xcc55('0x17')](_0xcc55('0x19'),_0x9c59bd,_0x49c4e[_0xcc55('0x17')][_0xcc55('0x18')]);return _0x125d02(_0x49c4e['error'][_0xcc55('0x18')]);}else{logger[_0xcc55('0x12')](_0xcc55('0x19'),_0x9c59bd,_0xcc55('0x13'));_0x125d02(_0x49c4e[_0xcc55('0x1a')]['message']);}})[_0xcc55('0x1b')](function(_0x1094db){logger[_0xcc55('0x17')](_0xcc55('0x19'),_0x9c59bd,_0x1094db);_0x38cf23(_0x1094db);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 0c16709..68aa316 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 _0xa319=['update','emit','length','userNotification:','./userNotification.events','remove'];(function(_0x1abea2,_0x2d56bb){var _0x558b0d=function(_0x34f283){while(--_0x34f283){_0x1abea2['push'](_0x1abea2['shift']());}};_0x558b0d(++_0x2d56bb);}(_0xa319,0x1c0));var _0x9a31=function(_0x15da88,_0x3ef3f3){_0x15da88=_0x15da88-0x0;var _0x48ef1d=_0xa319[_0x15da88];return _0x48ef1d;};'use strict';var UserNotificationEvents=require(_0x9a31('0x0'));var events=['save',_0x9a31('0x1'),_0x9a31('0x2')];function createListener(_0x3a9d59,_0x10b210){return function(_0x341f54){_0x10b210[_0x9a31('0x3')](_0x3a9d59,_0x341f54);};}function removeListener(_0x49c642,_0x5bd574){return function(){UserNotificationEvents['removeListener'](_0x49c642,_0x5bd574);};}exports['register']=function(_0x592d1a){for(var _0x564be0=0x0,_0x2e7402=events[_0x9a31('0x4')];_0x564be0<_0x2e7402;_0x564be0++){var _0x1acb1c=events[_0x564be0];var _0x51cd2d=createListener(_0x9a31('0x5')+_0x1acb1c,_0x592d1a);UserNotificationEvents['on'](_0x1acb1c,_0x51cd2d);}}; \ No newline at end of file +var _0x4c12=['update','emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x1154cd,_0x9fc394){var _0x38722d=function(_0x5f97b2){while(--_0x5f97b2){_0x1154cd['push'](_0x1154cd['shift']());}};_0x38722d(++_0x9fc394);}(_0x4c12,0x165));var _0x24c1=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x4c12[_0x4551f6];return _0x581dc2;};'use strict';var UserNotificationEvents=require(_0x24c1('0x0'));var events=[_0x24c1('0x1'),_0x24c1('0x2'),_0x24c1('0x3')];function createListener(_0x2c12cf,_0x51b754){return function(_0x1a6876){_0x51b754[_0x24c1('0x4')](_0x2c12cf,_0x1a6876);};}function removeListener(_0x58b5f3,_0x268ba9){return function(){UserNotificationEvents[_0x24c1('0x5')](_0x58b5f3,_0x268ba9);};}exports[_0x24c1('0x6')]=function(_0x5255fa){for(var _0xf446f2=0x0,_0xc5ac86=events[_0x24c1('0x7')];_0xf446f2<_0xc5ac86;_0xf446f2++){var _0x3e3b67=events[_0xf446f2];var _0x12c6ee=createListener(_0x24c1('0x8')+_0x3e3b67,_0x5255fa);UserNotificationEvents['on'](_0x3e3b67,_0x12c6ee);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 9c66d88..76f9077 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3bd961,_0x26f947){var _0xbeeb8e=function(_0x3c2a17){while(--_0x3c2a17){_0x3bd961['push'](_0x3bd961['shift']());}};_0xbeeb8e(++_0x26f947);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x21041c,_0x13e2c4){var _0x9d6245=function(_0x1eed9e){while(--_0x1eed9e){_0x21041c['push'](_0x21041c['shift']());}};_0x9d6245(++_0x13e2c4);}(_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 03e904e..d199202 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 _0xd7ad=['sequelize','exports'];(function(_0x59fa8d,_0x26c14f){var _0x5d89e6=function(_0x4102e5){while(--_0x4102e5){_0x59fa8d['push'](_0x59fa8d['shift']());}};_0x5d89e6(++_0x26c14f);}(_0xd7ad,0x15c));var _0xdd7a=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xd7ad[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0xdd7a('0x0'));module[_0xdd7a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x460c=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x460c,0xe8));var _0xc460=function(_0x3a95e8,_0x1e2bcb){_0x3a95e8=_0x3a95e8-0x0;var _0x594643=_0x460c[_0x3a95e8];return _0x594643;};'use strict';var Sequelize=require('sequelize');module[_0xc460('0x0')]={'penalty':{'type':Sequelize[_0xc460('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index ebaf27f..ec23cfc 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 _0xf62e=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf62e,0x13c));var _0xef62=function(_0x2689ec,_0x5de592){_0x2689ec=_0x2689ec-0x0;var _0x1e58bf=_0xf62e[_0x2689ec];return _0x1e58bf;};'use strict';var _=require(_0xef62('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xef62('0x1'));var BPromise=require(_0xef62('0x2'));var rp=require(_0xef62('0x3'));var fs=require('fs');var path=require(_0xef62('0x4'));var rimraf=require(_0xef62('0x5'));var config=require(_0xef62('0x6'));var attributes=require(_0xef62('0x7'));module[_0xef62('0x8')]=function(_0xb90caa,_0x3cdf16){return _0xb90caa[_0xef62('0x9')](_0xef62('0xa'),attributes,{'tableName':_0xef62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16b3=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x16b3,0x68));var _0x316b=function(_0xe8fb23,_0x25a276){_0xe8fb23=_0xe8fb23-0x0;var _0x1ba3d4=_0x16b3[_0xe8fb23];return _0x1ba3d4;};'use strict';var _=require(_0x316b('0x0'));var util=require(_0x316b('0x1'));var logger=require(_0x316b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x316b('0x3'));var rp=require(_0x316b('0x4'));var fs=require('fs');var path=require(_0x316b('0x5'));var rimraf=require(_0x316b('0x6'));var config=require(_0x316b('0x7'));var attributes=require(_0x316b('0x8'));module['exports']=function(_0x5f111e,_0x17161b){return _0x5f111e['define'](_0x316b('0x9'),attributes,{'tableName':_0x316b('0xa'),'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 ac74fc5..d86e296 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 _0xf2c3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0x5f028d,_0x58e47f){var _0x48381b=function(_0x2c97e8){while(--_0x2c97e8){_0x5f028d['push'](_0x5f028d['shift']());}};_0x48381b(++_0x58e47f);}(_0xf2c3,0x75));var _0x3f2c=function(_0x51f8ee,_0x1c1501){_0x51f8ee=_0x51f8ee-0x0;var _0x3b9072=_0xf2c3[_0x51f8ee];return _0x3b9072;};'use strict';var _=require('lodash');var util=require(_0x3f2c('0x0'));var moment=require(_0x3f2c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3f2c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f2c('0x3'))['db'];var utils=require(_0x3f2c('0x4'));var logger=require(_0x3f2c('0x5'))(_0x3f2c('0x6'));var config=require(_0x3f2c('0x7'));var jayson=require(_0x3f2c('0x8'));var client=jayson[_0x3f2c('0x9')][_0x3f2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41de63,_0x13b180,_0x3259ac){return new BPromise(function(_0x244603,_0x1d93bb){return client[_0x3f2c('0xb')](_0x41de63,_0x3259ac)[_0x3f2c('0xc')](function(_0x3cef93){logger[_0x3f2c('0xd')](_0x3f2c('0xe'),_0x13b180,_0x3f2c('0xf'));logger[_0x3f2c('0x10')](_0x3f2c('0x11'),_0x13b180,'request\x20sent',JSON[_0x3f2c('0x12')](_0x3cef93));if(_0x3cef93[_0x3f2c('0x13')]){if(_0x3cef93[_0x3f2c('0x13')][_0x3f2c('0x14')]===0x1f4){logger[_0x3f2c('0x13')](_0x3f2c('0xe'),_0x13b180,_0x3cef93[_0x3f2c('0x13')][_0x3f2c('0x15')]);return _0x1d93bb(_0x3cef93[_0x3f2c('0x13')][_0x3f2c('0x15')]);}logger[_0x3f2c('0x13')](_0x3f2c('0xe'),_0x13b180,_0x3cef93[_0x3f2c('0x13')]['message']);return _0x244603(_0x3cef93[_0x3f2c('0x13')]['message']);}else{logger[_0x3f2c('0xd')](_0x3f2c('0xe'),_0x13b180,_0x3f2c('0xf'));_0x244603(_0x3cef93[_0x3f2c('0x16')]['message']);}})[_0x3f2c('0x17')](function(_0x5c9370){logger[_0x3f2c('0x13')](_0x3f2c('0xe'),_0x13b180,_0x5c9370);_0x1d93bb(_0x5c9370);});});} \ No newline at end of file +var _0x2f35=['jayson/promise','client','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x2f35,0x19d));var _0x52f3=function(_0x4e5af1,_0x1dfc1f){_0x4e5af1=_0x4e5af1-0x0;var _0x357f9d=_0x2f35[_0x4e5af1];return _0x357f9d;};'use strict';var _=require(_0x52f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x52f3('0x1'));var fs=require('fs');var Redis=require(_0x52f3('0x2'));var db=require(_0x52f3('0x3'))['db'];var utils=require(_0x52f3('0x4'));var logger=require(_0x52f3('0x5'))('rpc');var config=require(_0x52f3('0x6'));var jayson=require(_0x52f3('0x7'));var client=jayson[_0x52f3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x221a33,_0x45060c,_0x5c1fa5){return new BPromise(function(_0x18bb45,_0x4c2d42){return client[_0x52f3('0x9')](_0x221a33,_0x5c1fa5)[_0x52f3('0xa')](function(_0x449911){logger['info'](_0x52f3('0xb'),_0x45060c,_0x52f3('0xc'));logger[_0x52f3('0xd')](_0x52f3('0xe'),_0x45060c,_0x52f3('0xc'),JSON[_0x52f3('0xf')](_0x449911));if(_0x449911[_0x52f3('0x10')]){if(_0x449911[_0x52f3('0x10')]['code']===0x1f4){logger[_0x52f3('0x10')](_0x52f3('0xb'),_0x45060c,_0x449911[_0x52f3('0x10')]['message']);return _0x4c2d42(_0x449911[_0x52f3('0x10')][_0x52f3('0x11')]);}logger[_0x52f3('0x10')](_0x52f3('0xb'),_0x45060c,_0x449911[_0x52f3('0x10')]['message']);return _0x18bb45(_0x449911[_0x52f3('0x10')][_0x52f3('0x11')]);}else{logger[_0x52f3('0x12')](_0x52f3('0xb'),_0x45060c,_0x52f3('0xc'));_0x18bb45(_0x449911[_0x52f3('0x13')][_0x52f3('0x11')]);}})['catch'](function(_0x4dcef8){logger[_0x52f3('0x10')](_0x52f3('0xb'),_0x45060c,_0x4dcef8);_0x4c2d42(_0x4dcef8);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b2cf0f8..d13bb01 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 _0x8a6c=['/:id','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update','destroy','removeResources','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a6c,0x1bf));var _0xc8a6=function(_0x4a2fa6,_0x89d91){_0x4a2fa6=_0x4a2fa6-0x0;var _0x58419c=_0x8a6c[_0x4a2fa6];return _0x58419c;};'use strict';var multer=require('multer');var util=require(_0xc8a6('0x0'));var path=require(_0xc8a6('0x1'));var timeout=require(_0xc8a6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc8a6('0x3'));var interaction=require(_0xc8a6('0x4'));var config=require('../../config/environment');var controller=require(_0xc8a6('0x5'));router[_0xc8a6('0x6')]('/',auth[_0xc8a6('0x7')](),controller['index']);router[_0xc8a6('0x6')]('/describe',auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x8')]);router[_0xc8a6('0x6')](_0xc8a6('0x9'),auth[_0xc8a6('0x7')](),controller['show']);router[_0xc8a6('0x6')](_0xc8a6('0xa'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0xb')]);router[_0xc8a6('0x6')](_0xc8a6('0xc'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0xd')]);router['post']('/',auth[_0xc8a6('0x7')](),controller[_0xc8a6('0xe')]);router[_0xc8a6('0xf')](_0xc8a6('0x10'),auth['isAuthenticated'](),controller[_0xc8a6('0x11')]);router[_0xc8a6('0xf')](_0xc8a6('0xa'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x12')]);router[_0xc8a6('0xf')](_0xc8a6('0xc'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x13')]);router[_0xc8a6('0x14')](_0xc8a6('0x9'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x15')]);router['delete'](_0xc8a6('0x9'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x16')]);router['delete']('/:id/sections',auth[_0xc8a6('0x7')](),controller['removeSections']);router['delete'](_0xc8a6('0xc'),auth[_0xc8a6('0x7')](),controller[_0xc8a6('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd114=['get','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0xd114,0xd7));var _0x4d11=function(_0x1992a5,_0x56bb9a){_0x1992a5=_0x1992a5-0x0;var _0x4aef9f=_0xd114[_0x1992a5];return _0x4aef9f;};'use strict';var multer=require(_0x4d11('0x0'));var util=require(_0x4d11('0x1'));var path=require(_0x4d11('0x2'));var timeout=require(_0x4d11('0x3'));var express=require(_0x4d11('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d11('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d11('0x6'));var controller=require(_0x4d11('0x7'));router['get']('/',auth[_0x4d11('0x8')](),controller['index']);router[_0x4d11('0x9')](_0x4d11('0xa'),auth[_0x4d11('0x8')](),controller[_0x4d11('0xb')]);router['get'](_0x4d11('0xc'),auth[_0x4d11('0x8')](),controller['show']);router[_0x4d11('0x9')](_0x4d11('0xd'),auth['isAuthenticated'](),controller[_0x4d11('0xe')]);router['get'](_0x4d11('0xf'),auth['isAuthenticated'](),controller[_0x4d11('0x10')]);router[_0x4d11('0x11')]('/',auth[_0x4d11('0x8')](),controller[_0x4d11('0x12')]);router[_0x4d11('0x11')]('/:id/clone',auth[_0x4d11('0x8')](),controller[_0x4d11('0x13')]);router[_0x4d11('0x11')](_0x4d11('0xd'),auth[_0x4d11('0x8')](),controller[_0x4d11('0x14')]);router[_0x4d11('0x11')](_0x4d11('0xf'),auth['isAuthenticated'](),controller['addResources']);router[_0x4d11('0x15')]('/:id',auth[_0x4d11('0x8')](),controller[_0x4d11('0x16')]);router[_0x4d11('0x17')]('/:id',auth[_0x4d11('0x8')](),controller[_0x4d11('0x18')]);router[_0x4d11('0x17')]('/:id/sections',auth[_0x4d11('0x8')](),controller[_0x4d11('0x19')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller[_0x4d11('0x1a')]);module[_0x4d11('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index b220227..9d559e6 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 _0x7031=['crudPermissions','getDataValue','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x3504e2,_0x4ab9be){var _0x589d87=function(_0x5965af){while(--_0x5965af){_0x3504e2['push'](_0x3504e2['shift']());}};_0x589d87(++_0x4ab9be);}(_0x7031,0x1c3));var _0x1703=function(_0x5a54f2,_0x774ad6){_0x5a54f2=_0x5a54f2-0x0;var _0x1fffe9=_0x7031[_0x5a54f2];return _0x1fffe9;};'use strict';var Sequelize=require(_0x1703('0x0'));module[_0x1703('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x1703('0x2')],'set':function(_0x35f362){this[_0x1703('0x3')](_0x1703('0x4'),_0x35f362?_0x35f362['join'](''):[]);},'get':function(){return this[_0x1703('0x5')](_0x1703('0x4'))?this[_0x1703('0x5')](_0x1703('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x1703('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1703('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1703('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1a1f=['getDataValue','crudPermissions','BOOLEAN','sequelize','name','STRING','join'];(function(_0x2d9f8b,_0x1eca48){var _0x251209=function(_0x15205f){while(--_0x15205f){_0x2d9f8b['push'](_0x2d9f8b['shift']());}};_0x251209(++_0x1eca48);}(_0x1a1f,0x176));var _0xf1a1=function(_0x6c9f21,_0x5288c5){_0x6c9f21=_0x6c9f21-0x0;var _0x512164=_0x1a1f[_0x6c9f21];return _0x512164;};'use strict';var Sequelize=require(_0xf1a1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf1a1('0x1')},'crudPermissions':{'type':Sequelize[_0xf1a1('0x2')],'set':function(_0x31f907){this['setDataValue']('crudPermissions',_0x31f907?_0x31f907[_0xf1a1('0x3')](''):[]);},'get':function(){return this[_0xf1a1('0x4')](_0xf1a1('0x5'))?this[_0xf1a1('0x4')](_0xf1a1('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf1a1('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1a1('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index f0a1b4a..b10b4d2 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 _0x5276=['Resources','describe','transaction','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','UserProfile','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','find','body','get','createdAt','updatedAt','crudPermissions','sequelize','create','UserProfileSection','autoAssociation','UserProfileResource','omit','sectionId','userProfileId'];(function(_0xe44dfa,_0x37961b){var _0x7626a5=function(_0x26e25b){while(--_0x26e25b){_0xe44dfa['push'](_0xe44dfa['shift']());}};_0x7626a5(++_0x37961b);}(_0x5276,0x163));var _0x6527=function(_0x5d757a,_0x1885fa){_0x5d757a=_0x5d757a-0x0;var _0x535ada=_0x5276[_0x5d757a];return _0x535ada;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6527('0x0'));var jsonpatch=require(_0x6527('0x1'));var rp=require(_0x6527('0x2'));var moment=require(_0x6527('0x3'));var BPromise=require(_0x6527('0x4'));var Mustache=require(_0x6527('0x5'));var util=require(_0x6527('0x6'));var path=require(_0x6527('0x7'));var sox=require(_0x6527('0x8'));var csv=require(_0x6527('0x9'));var ejs=require(_0x6527('0xa'));var fs=require('fs');var fs_extra=require(_0x6527('0xb'));var _=require(_0x6527('0xc'));var squel=require('squel');var crypto=require(_0x6527('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6527('0xe'));var toCsv=require(_0x6527('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6527('0xf'));var as=require(_0x6527('0x10'));var hardwareService=require(_0x6527('0x11'));var logger=require(_0x6527('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6527('0x13'));var licenseUtil=require(_0x6527('0x14'));var db=require(_0x6527('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6527('0x16'),'port':0x18eb});var socket=require(_0x6527('0x17'))(new Redis(config['redis']));require(_0x6527('0x18'))['register'](socket);function respondWithStatusCode(_0x3b56ee,_0x2bd94d){_0x2bd94d=_0x2bd94d||0xcc;return function(_0x27e464){if(_0x27e464){return _0x3b56ee[_0x6527('0x19')](_0x2bd94d);}return _0x3b56ee[_0x6527('0x1a')](_0x2bd94d)[_0x6527('0x1b')]();};}function respondWithResult(_0x495c14,_0x3dd2cd){_0x3dd2cd=_0x3dd2cd||0xc8;return function(_0x52a5d3){if(_0x52a5d3){return _0x495c14[_0x6527('0x1a')](_0x3dd2cd)[_0x6527('0x1c')](_0x52a5d3);}};}function respondWithFilteredResult(_0x2cb6e9,_0x12c489){return function(_0x508f67){if(_0x508f67){var _0x1dd222=typeof _0x12c489[_0x6527('0x1d')]===_0x6527('0x1e')&&typeof _0x12c489[_0x6527('0x1f')]===_0x6527('0x1e');var _0x5014b2=_0x508f67['count'];var _0x1e0a28=_0x1dd222?0x0:_0x12c489[_0x6527('0x1d')];var _0x7af757=_0x1dd222?_0x508f67[_0x6527('0x20')]:_0x12c489[_0x6527('0x1d')]+_0x12c489[_0x6527('0x1f')];var _0x3ba0e0;if(_0x7af757>=_0x5014b2){_0x7af757=_0x5014b2;_0x3ba0e0=0xc8;}else{_0x3ba0e0=0xce;}_0x2cb6e9[_0x6527('0x1a')](_0x3ba0e0);return _0x2cb6e9[_0x6527('0x21')](_0x6527('0x22'),_0x1e0a28+'-'+_0x7af757+'/'+_0x5014b2)[_0x6527('0x1c')](_0x508f67);}return null;};}function patchUpdates(_0x2e7450){return function(_0x53ebf6){try{jsonpatch[_0x6527('0x23')](_0x53ebf6,_0x2e7450,!![]);}catch(_0x7ce319){return BPromise['reject'](_0x7ce319);}return _0x53ebf6[_0x6527('0x24')]();};}function saveUpdates(_0x188c3a,_0x5986ac){return function(_0x623d35){if(_0x623d35){return _0x623d35[_0x6527('0x25')](_0x188c3a)[_0x6527('0x26')](function(_0x8341b){return _0x8341b;});}return null;};}function removeEntity(_0x2a3383,_0x553537){return function(_0x1375d7){if(_0x1375d7){return _0x1375d7[_0x6527('0x27')]()[_0x6527('0x26')](function(){_0x2a3383[_0x6527('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcc7305,_0x4b2cde){return function(_0x5c69d4){if(!_0x5c69d4){_0xcc7305[_0x6527('0x19')](0x194);}return _0x5c69d4;};}function handleError(_0x38b8be,_0x3130e6){_0x3130e6=_0x3130e6||0x1f4;return function(_0x4e3616){logger[_0x6527('0x28')](_0x4e3616[_0x6527('0x29')]);if(_0x4e3616[_0x6527('0x2a')]){delete _0x4e3616[_0x6527('0x2a')];}_0x38b8be[_0x6527('0x1a')](_0x3130e6)[_0x6527('0x2b')](_0x4e3616);};}exports['index']=function(_0x25b08b,_0x19f894){var _0x1ad33c={},_0x22e2dd={},_0x99997a={'count':0x0,'rows':[]};var _0x54ec7d=_[_0x6527('0x2c')](db[_0x6527('0x2d')]['rawAttributes'],function(_0x41016f){return{'name':_0x41016f[_0x6527('0x2e')],'type':_0x41016f[_0x6527('0x2f')][_0x6527('0x30')]};});_0x22e2dd[_0x6527('0x31')]=_[_0x6527('0x2c')](_0x54ec7d,_0x6527('0x2a'));_0x22e2dd[_0x6527('0x32')]=_[_0x6527('0x33')](_0x25b08b['query']);_0x22e2dd[_0x6527('0x34')]=_[_0x6527('0x35')](_0x22e2dd[_0x6527('0x31')],_0x22e2dd[_0x6527('0x32')]);_0x1ad33c['attributes']=_['intersection'](_0x22e2dd[_0x6527('0x31')],qs['fields'](_0x25b08b[_0x6527('0x32')]['fields']));_0x1ad33c['attributes']=_0x1ad33c[_0x6527('0x36')][_0x6527('0x37')]?_0x1ad33c['attributes']:_0x22e2dd[_0x6527('0x31')];if(!_0x25b08b[_0x6527('0x32')][_0x6527('0x38')](_0x6527('0x39'))){_0x1ad33c[_0x6527('0x1f')]=qs[_0x6527('0x1f')](_0x25b08b[_0x6527('0x32')][_0x6527('0x1f')]);_0x1ad33c[_0x6527('0x1d')]=qs[_0x6527('0x1d')](_0x25b08b['query'][_0x6527('0x1d')]);}_0x1ad33c[_0x6527('0x3a')]=qs['sort'](_0x25b08b[_0x6527('0x32')][_0x6527('0x3b')]);_0x1ad33c[_0x6527('0x3c')]=qs['filters'](_[_0x6527('0x3d')](_0x25b08b[_0x6527('0x32')],_0x22e2dd[_0x6527('0x34')]),_0x54ec7d);if(_0x25b08b[_0x6527('0x32')]['filter']){_0x1ad33c['where']=_['merge'](_0x1ad33c[_0x6527('0x3c')],{'$or':_[_0x6527('0x2c')](_0x54ec7d,function(_0x49f82f){if(_0x49f82f[_0x6527('0x2f')]!==_0x6527('0x3e')){var _0xfe3517={};_0xfe3517[_0x49f82f[_0x6527('0x2a')]]={'$like':'%'+_0x25b08b['query'][_0x6527('0x3f')]+'%'};return _0xfe3517;}})});}_0x1ad33c=_['merge']({},_0x1ad33c,_0x25b08b[_0x6527('0x40')]);var _0x1e0e7c={'where':_0x1ad33c[_0x6527('0x3c')]};return db[_0x6527('0x2d')][_0x6527('0x20')](_0x1e0e7c)[_0x6527('0x26')](function(_0x280dde){_0x99997a[_0x6527('0x20')]=_0x280dde;if(_0x25b08b[_0x6527('0x32')][_0x6527('0x41')]){_0x1ad33c[_0x6527('0x42')]=[{'all':!![]}];}return db[_0x6527('0x2d')][_0x6527('0x43')](_0x1ad33c);})[_0x6527('0x26')](function(_0xa904a0){_0x99997a[_0x6527('0x44')]=_0xa904a0;return _0x99997a;})[_0x6527('0x26')](respondWithFilteredResult(_0x19f894,_0x1ad33c))[_0x6527('0x45')](handleError(_0x19f894,null));};exports[_0x6527('0x46')]=function(_0xacffe3,_0x53b432){var _0x3af50f={'raw':![],'where':{'id':_0xacffe3[_0x6527('0x47')]['id']}},_0x11b103={};_0x11b103[_0x6527('0x31')]=_[_0x6527('0x33')](db[_0x6527('0x2d')][_0x6527('0x48')]);_0x11b103[_0x6527('0x32')]=_[_0x6527('0x33')](_0xacffe3[_0x6527('0x32')]);_0x11b103[_0x6527('0x34')]=_[_0x6527('0x35')](_0x11b103[_0x6527('0x31')],_0x11b103[_0x6527('0x32')]);_0x3af50f['attributes']=_['intersection'](_0x11b103[_0x6527('0x31')],qs[_0x6527('0x49')](_0xacffe3[_0x6527('0x32')][_0x6527('0x49')]));_0x3af50f['attributes']=_0x3af50f[_0x6527('0x36')]['length']?_0x3af50f[_0x6527('0x36')]:_0x11b103[_0x6527('0x31')];if(_0xacffe3[_0x6527('0x32')]['includeAll']){_0x3af50f['include']=[{'all':!![]}];}_0x3af50f=_[_0x6527('0x4a')]({},_0x3af50f,_0xacffe3[_0x6527('0x40')]);return db[_0x6527('0x2d')][_0x6527('0x4b')](_0x3af50f)[_0x6527('0x26')](handleEntityNotFound(_0x53b432,null))['then'](respondWithResult(_0x53b432,null))['catch'](handleError(_0x53b432,null));};exports['create']=function(_0x51a105,_0x42752e){return db['UserProfile']['create'](_0x51a105[_0x6527('0x4c')],{})[_0x6527('0x26')](respondWithResult(_0x42752e,0xc9))['catch'](handleError(_0x42752e,null));};exports['clone']=function(_0x2f1eb1,_0x5dfc93){var _0x4260a3={'where':{'id':_0x2f1eb1[_0x6527('0x47')]['id']}},_0x3a33a3={};_0x3a33a3[_0x6527('0x31')]=_[_0x6527('0x33')](db[_0x6527('0x2d')][_0x6527('0x48')]);_0x4260a3[_0x6527('0x36')]=_[_0x6527('0x35')](_0x3a33a3[_0x6527('0x31')],qs['fields'](_0x2f1eb1[_0x6527('0x32')][_0x6527('0x49')]));_0x4260a3[_0x6527('0x36')]=_0x4260a3['attributes'][_0x6527('0x37')]?_0x4260a3[_0x6527('0x36')]:_0x3a33a3[_0x6527('0x31')];if(_0x2f1eb1[_0x6527('0x32')][_0x6527('0x41')]){_0x4260a3['include']=[{'all':!![]}];}_0x4260a3=_[_0x6527('0x4a')]({},_0x4260a3,_0x2f1eb1[_0x6527('0x40')]);return db['UserProfile']['find'](_0x4260a3)['then'](handleEntityNotFound(_0x5dfc93,null))[_0x6527('0x26')](function(_0x4859c6){if(_0x4859c6){var _0x303a4b=_0x4859c6[_0x6527('0x4d')]({'plain':!![]});_0x303a4b=qs['omit'](_0x303a4b,['id',_0x6527('0x4e'),_0x6527('0x4f'),_0x6527('0x50')]);_0x2f1eb1['body']=_['omit'](_0x2f1eb1[_0x6527('0x4c')],['id',_0x6527('0x4e'),_0x6527('0x4f')]);return db[_0x6527('0x51')]['transaction'](function(_0x4be945){return db[_0x6527('0x2d')][_0x6527('0x52')](_[_0x6527('0x4a')](_0x303a4b,_0x2f1eb1[_0x6527('0x4c')]),{'include':_0x2f1eb1[_0x6527('0x32')][_0x6527('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x4be945})[_0x6527('0x26')](function(_0x49dcb0){var _0x281ec8=_0x49dcb0[_0x6527('0x4d')]({'plain':!![]});return db[_0x6527('0x53')][_0x6527('0x43')]({'where':{'userProfileId':_0x2f1eb1['params']['id']},'raw':!![]})[_0x6527('0x26')](function(_0x280254){if(_0x280254){return BPromise['each'](_0x280254,function(_0x37226d){return new BPromise(function(_0x296410,_0x426fdc){if(_0x37226d[_0x6527('0x54')]===null||_0x37226d[_0x6527('0x54')]===0x1)_0x296410(null);return db[_0x6527('0x55')][_0x6527('0x43')]({'where':{'sectionId':_0x37226d['id']},'raw':!![]})[_0x6527('0x26')](function(_0x1e87c3){var _0x52c150=_[_0x6527('0x2c')](_0x1e87c3,function(_0x202cc1){return qs[_0x6527('0x56')](_0x202cc1,['id',_0x6527('0x4e'),_0x6527('0x4f'),_0x6527('0x57')]);});_0x296410(_0x52c150);})['catch'](function(_0x19b83d){_0x426fdc(_0x19b83d);});})[_0x6527('0x26')](function(_0x14963e){var _0x2f06cb=qs[_0x6527('0x56')](_0x37226d,['id',_0x6527('0x4e'),'updatedAt']);_0x2f06cb[_0x6527('0x58')]=_0x281ec8['id'];if(_0x14963e)_0x2f06cb[_0x6527('0x59')]=_0x14963e;return _0x2f06cb;})['then'](function(_0x1e9196){return db[_0x6527('0x53')][_0x6527('0x52')](_0x1e9196,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4be945});});})[_0x6527('0x26')](function(){return _0x281ec8;});}});});});}})['then'](respondWithResult(_0x5dfc93,0xc9))[_0x6527('0x45')](handleError(_0x5dfc93,null));};exports[_0x6527('0x25')]=function(_0x5814e1,_0x4c6272){if(_0x5814e1[_0x6527('0x4c')]['id']){delete _0x5814e1[_0x6527('0x4c')]['id'];}return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x5814e1['params']['id']}})['then'](handleEntityNotFound(_0x4c6272,null))[_0x6527('0x26')](saveUpdates(_0x5814e1[_0x6527('0x4c')],null))[_0x6527('0x26')](respondWithResult(_0x4c6272,null))['catch'](handleError(_0x4c6272,null));};exports[_0x6527('0x27')]=function(_0x376ad9,_0x4cfb3c){return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x376ad9[_0x6527('0x47')]['id']}})[_0x6527('0x26')](handleEntityNotFound(_0x4cfb3c,null))[_0x6527('0x26')](removeEntity(_0x4cfb3c,null))[_0x6527('0x45')](handleError(_0x4cfb3c,null));};exports['describe']=function(_0x431949,_0x1b4589){return db[_0x6527('0x2d')][_0x6527('0x5a')]()[_0x6527('0x26')](respondWithResult(_0x1b4589,null))['catch'](handleError(_0x1b4589,null));};exports['addSections']=function(_0x367b08,_0x1f1f1e){var _0x5e7bc5=_0x367b08[_0x6527('0x4c')];return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x367b08[_0x6527('0x47')]['id']}})[_0x6527('0x26')](handleEntityNotFound(_0x1f1f1e,null))[_0x6527('0x26')](function(_0xd5cb7d){if(_0xd5cb7d){return db[_0x6527('0x51')][_0x6527('0x5b')](function(_0x119aaa){return db[_0x6527('0x53')]['destroy']({'where':{'userProfileId':_0x367b08['params']['id'],'sectionId':_['map'](_0x5e7bc5,function(_0x5681a7){return _0x5681a7[_0x6527('0x57')];})},'transaction':_0x119aaa})[_0x6527('0x26')](function(){var _0x482796=_[_0x6527('0x2c')](_0x5e7bc5,function(_0x5aeb8){_0x5aeb8[_0x6527('0x58')]=_0x367b08[_0x6527('0x47')]['id'];return _0x5aeb8;});var _0x19b8b5=[];return BPromise[_0x6527('0x5c')](_0x482796,function(_0x2a7afa){return db[_0x6527('0x53')][_0x6527('0x52')](_0x2a7afa,{'include':[{'model':db[_0x6527('0x55')],'as':_0x6527('0x59')}],'raw':!![],'transaction':_0x119aaa})[_0x6527('0x26')](function(_0x6a9fc0){_0x19b8b5[_0x6527('0x5d')](_0x6a9fc0['get']({'plain':!![]}));});})[_0x6527('0x26')](function(){return _0x19b8b5;});});});}})[_0x6527('0x26')](function(_0x2622ce){return _0x2622ce;})[_0x6527('0x26')](respondWithResult(_0x1f1f1e,null))[_0x6527('0x45')](handleError(_0x1f1f1e,null));};exports[_0x6527('0x5e')]=function(_0x5a146b,_0x3a0aca){var _0x56e162;return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x5a146b['params']['id']},'attributes':['id',_0x6527('0x2a')]})[_0x6527('0x26')](handleEntityNotFound(_0x3a0aca,null))[_0x6527('0x26')](function(_0x2d0ea1){if(_0x2d0ea1){_0x56e162=_0x2d0ea1;return db[_0x6527('0x53')][_0x6527('0x27')]({'where':{'userProfileId':_0x5a146b[_0x6527('0x47')]['id'],'sectionId':_0x5a146b[_0x6527('0x32')][_0x6527('0x5f')]}});}})[_0x6527('0x26')](function(){return _0x56e162;})[_0x6527('0x26')](respondWithStatusCode(_0x3a0aca,null))[_0x6527('0x45')](handleError(_0x3a0aca,null));};exports[_0x6527('0x60')]=function(_0x402cb4,_0x4dee11){var _0x5458c9=[];var _0x17de3c=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x402cb4['params']['id']},'raw':!![]})[_0x6527('0x26')](function(_0x3b2f17){_0x5458c9=_[_0x6527('0x3f')](_0x3b2f17,function(_0x296051){return _0x296051[_0x6527('0x61')]===0x1||_[_0x6527('0x62')]([0x3eb,0x709],_0x296051['sectionId']);});if(!_[_0x6527('0x63')](_0x5458c9)){return _[_0x6527('0x2c')](_0x5458c9,function(_0x3c2495){return _0x3c2495[_0x6527('0x57')];});}else{return;}})[_0x6527('0x26')](function(_0x5178d2){if(_0x5178d2)_0x17de3c=_0x5178d2;if(_['includes'](_0x17de3c,0x64)){var _0x1a9ad2=_['find'](_0x5458c9,{'sectionId':0x64});return hasDefaultDashboard(_0x1a9ad2)[_0x6527('0x26')](function(_0x445e30){return _[_0x6527('0x2c')](_0x5458c9,function(_0x5c0387){if(_0x5c0387[_0x6527('0x57')]===0x64){_0x5c0387[_0x6527('0x64')]=_0x445e30;}return _0x5c0387;});});}else{return;}})[_0x6527('0x26')](function(_0x511800){if(_0x511800)_0x5458c9=_0x511800;if(_[_0x6527('0x62')](_0x17de3c,0x3eb)){var _0x36cef6=_[_0x6527('0x4b')](_0x5458c9,{'sectionId':0x3eb});return getCustomDashboards(_0x36cef6)[_0x6527('0x26')](function(_0x2ce6dd){return _['map'](_0x5458c9,function(_0x3d13d8){if(_0x36cef6[_0x6527('0x61')]){if(_0x3d13d8[_0x6527('0x57')]===0x3eb){_0x3d13d8[_0x6527('0x64')]=_0x2ce6dd;}}else{if(_0x3d13d8[_0x6527('0x57')]===0x64){_0x3d13d8[_0x6527('0x64')]=_0x2ce6dd;}}return _0x3d13d8;});});}else{return;}})[_0x6527('0x26')](function(_0x5210bb){if(_0x5210bb)_0x5458c9=_0x5210bb;if(_[_0x6527('0x62')](_0x17de3c,0x709)){var _0x566124=_[_0x6527('0x4b')](_0x5458c9,{'sectionId':0x709});return getPlugins(_0x566124)[_0x6527('0x26')](function(_0x2523af){if(_0x566124['enabled']){return _[_0x6527('0x2c')](_0x5458c9,function(_0x128392){if(_0x128392[_0x6527('0x57')]===0x709){_0x128392[_0x6527('0x64')]=_0x2523af;}return _0x128392;});}else{var _0x4612b0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2523af};var _0x336d8c=_[_0x6527('0x2c')](_0x5458c9);_0x336d8c[_0x6527('0x5d')](_0x4612b0);return _0x336d8c;}});}else{return;}})[_0x6527('0x26')](function(_0x2e4fbc){if(_0x2e4fbc)_0x5458c9=_0x2e4fbc;return _[_0x6527('0x3f')](_0x5458c9,[_0x6527('0x61'),0x1]);})[_0x6527('0x26')](respondWithResult(_0x4dee11,null))[_0x6527('0x45')](handleError(_0x4dee11,null));};function hasDefaultDashboard(_0x349d97){var _0x1e0272=[0x65];return new BPromise(function(_0x4b5606,_0x57a192){try{if(_0x349d97[_0x6527('0x54')]){_0x4b5606(_0x1e0272);}else{return db[_0x6527('0x55')][_0x6527('0x65')]({'where':{'sectionId':_0x349d97['id']},'raw':!![]})[_0x6527('0x26')](function(_0x4f4ce8){_0x4f4ce8?_0x4b5606(_0x1e0272):_0x4b5606();});}}catch(_0x1c9f2b){_0x57a192(_0x1c9f2b);}});}function getCustomDashboards(_0x3b28c3){var _0x309140=[];return new BPromise(function(_0x4766d8,_0x58d325){try{if(_0x3b28c3[_0x6527('0x54')]){return db['Dashboard'][_0x6527('0x43')]({'raw':!![]})[_0x6527('0x26')](function(_0x2b1f30){_0x2b1f30[_0x6527('0x66')](function(_0x4bd25b){_0x309140[_0x6527('0x5d')](_0x4bd25b['id']+0x1869f);});_0x4766d8(_0x309140);});}else{return db[_0x6527('0x55')][_0x6527('0x43')]({'where':{'sectionId':_0x3b28c3['id']},'raw':!![]})['then'](function(_0x4ce989){_0x4ce989['forEach'](function(_0x467b63){_0x309140['push'](_0x467b63[_0x6527('0x67')]+0x1869f);});_0x4766d8(_0x309140);});}}catch(_0x589281){_0x58d325(_0x589281);}});}function getPlugins(_0x9f3d37){var _0x575cb2=[];return new BPromise(function(_0x4548d7,_0x5ccd33){try{if(_0x9f3d37[_0x6527('0x54')]){return db['Plugin'][_0x6527('0x43')]({'raw':!![]})[_0x6527('0x26')](function(_0x125cc9){_0x125cc9[_0x6527('0x66')](function(_0x13572b){_0x575cb2[_0x6527('0x5d')](_0x13572b['id']+0x15b38);});_0x4548d7(_0x575cb2);});}else{return db['UserProfileResource'][_0x6527('0x43')]({'where':{'sectionId':_0x9f3d37['id']},'raw':!![]})[_0x6527('0x26')](function(_0x5b0f4f){_0x5b0f4f['forEach'](function(_0x45a745){_0x575cb2['push'](_0x45a745[_0x6527('0x67')]+0x15b38);});_0x4548d7(_0x575cb2);});}}catch(_0xfb8663){_0x5ccd33(_0xfb8663);}});}exports[_0x6527('0x68')]=function(_0x8d10f2,_0x3d145e){return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x8d10f2[_0x6527('0x47')]['id']}})[_0x6527('0x26')](handleEntityNotFound(_0x3d145e,null))[_0x6527('0x26')](function(_0x4f228c){if(_0x4f228c){return db[_0x6527('0x51')][_0x6527('0x5b')](function(_0x304a89){return db[_0x6527('0x53')][_0x6527('0x43')]({'where':{'userProfileId':_0x8d10f2[_0x6527('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x6527('0x26')](function(_0x47268a){if(_0x47268a){return db[_0x6527('0x53')]['destroy']({'where':{'userProfileId':_0x8d10f2[_0x6527('0x47')]['id'],'id':_[_0x6527('0x2c')](_0x47268a,function(_0x93e64c){return _0x93e64c['id'];})},'transaction':_0x304a89});}})[_0x6527('0x26')](function(_0x5cb20b){var _0x5377b4=_['map'](_0x8d10f2[_0x6527('0x4c')],function(_0x1d8703){_0x1d8703[_0x6527('0x58')]=_0x8d10f2[_0x6527('0x47')]['id'];return _0x1d8703;});return db[_0x6527('0x53')][_0x6527('0x69')](_0x5377b4,{'raw':!![],'transaction':_0x304a89});})[_0x6527('0x26')](function(_0x29c8ac){var _0x136111=_[_0x6527('0x3f')](_[_0x6527('0x2c')](_0x29c8ac,function(_0x4be29){return _0x4be29['get']({'plain':!![]});}),{'includeAll':![]});if(_0x136111){return db[_0x6527('0x53')][_0x6527('0x43')]({'where':{'userProfileId':_0x8d10f2['params']['id'],'sectionId':_[_0x6527('0x2c')](_0x136111,function(_0x4cb70c){return _0x4cb70c[_0x6527('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x6527('0x26')](function(_0x4bdf65){var _0x1dfdd7=_['map'](_0x8d10f2['body'],function(_0x2a08a1){_0x2a08a1[_0x6527('0x58')]=_0x8d10f2[_0x6527('0x47')]['id'];return _0x2a08a1;});return db[_0x6527('0x55')]['bulkCreate'](_0x1dfdd7,{'raw':!![],'transaction':_0x304a89});});}})[_0x6527('0x45')](handleError(_0x3d145e,null));});}})[_0x6527('0x26')](function(_0x491714){var _0x40a73c=_[_0x6527('0x2c')](_0x491714,function(_0x4ed4c7){return _0x4ed4c7['get']({'plain':!![]});});})['then'](respondWithResult(_0x3d145e,null))['catch'](handleError(_0x3d145e,null));};exports[_0x6527('0x6a')]=function(_0x4553b1,_0x344d3a,_0x580375){return db[_0x6527('0x2d')][_0x6527('0x4b')]({'where':{'id':_0x4553b1['params']['id']}})[_0x6527('0x26')](handleEntityNotFound(_0x344d3a,null))[_0x6527('0x26')](function(_0x5a87d){if(_0x5a87d){return _0x5a87d[_0x6527('0x6a')](_0x4553b1[_0x6527('0x32')]['ids']);}})[_0x6527('0x26')](respondWithStatusCode(_0x344d3a,null))[_0x6527('0x45')](handleError(_0x344d3a,null));};exports[_0x6527('0x6b')]=function(_0x342ada,_0x2c48e6){var _0x386fb8={};if(!_0x342ada[_0x6527('0x32')][_0x6527('0x6c')])throw new Error(_0x6527('0x6d'));if(!_0x342ada[_0x6527('0x32')]['hasOwnProperty'](_0x6527('0x39'))){_0x386fb8['limit']=qs[_0x6527('0x1f')](_0x342ada[_0x6527('0x32')][_0x6527('0x1f')]);_0x386fb8[_0x6527('0x1d')]=qs[_0x6527('0x1d')](_0x342ada[_0x6527('0x32')][_0x6527('0x1d')]);}return db[_0x6527('0x2d')]['find']({'where':{'id':_0x342ada[_0x6527('0x47')]['id']}})[_0x6527('0x26')](function(_0x23ac31){if(!_0x23ac31)throw new Error(_0x6527('0x6e')+_0x342ada[_0x6527('0x47')]['id']);return db['UserProfile'][_0x6527('0x6b')](_0x342ada);})[_0x6527('0x26')](respondWithFilteredResult(_0x2c48e6,_0x386fb8))[_0x6527('0x45')](handleError(_0x2c48e6,null));}; \ No newline at end of file +var _0x1d21=['isEmpty','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','keys','query','filters','intersection','fields','length','limit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','params','attributes','find','catch','create','options','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','describe','sectionId','Resources','push','ids','getSections','filter','enabled','includes'];(function(_0x48949f,_0x525f19){var _0xfbe2ec=function(_0x59ecdb){while(--_0x59ecdb){_0x48949f['push'](_0x48949f['shift']());}};_0xfbe2ec(++_0x525f19);}(_0x1d21,0x158));var _0x11d2=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x1d21[_0x580d0e];return _0xb51111;};'use strict';var emlformat=require(_0x11d2('0x0'));var rimraf=require(_0x11d2('0x1'));var zipdir=require(_0x11d2('0x2'));var jsonpatch=require(_0x11d2('0x3'));var rp=require('request-promise');var moment=require(_0x11d2('0x4'));var BPromise=require(_0x11d2('0x5'));var Mustache=require(_0x11d2('0x6'));var util=require(_0x11d2('0x7'));var path=require('path');var sox=require(_0x11d2('0x8'));var csv=require(_0x11d2('0x9'));var ejs=require(_0x11d2('0xa'));var fs=require('fs');var fs_extra=require(_0x11d2('0xb'));var _=require(_0x11d2('0xc'));var squel=require(_0x11d2('0xd'));var crypto=require(_0x11d2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x11d2('0xf'));var toCsv=require(_0x11d2('0x9'));var querystring=require('querystring');var Papa=require(_0x11d2('0x10'));var Redis=require('ioredis');var authService=require(_0x11d2('0x11'));var qs=require(_0x11d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11d2('0x13'));var logger=require(_0x11d2('0x14'))(_0x11d2('0x15'));var utils=require(_0x11d2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x11d2('0x17'))['db'];config[_0x11d2('0x18')]=_[_0x11d2('0x19')](config['redis'],{'host':_0x11d2('0x1a'),'port':0x18eb});var socket=require(_0x11d2('0x1b'))(new Redis(config[_0x11d2('0x18')]));require(_0x11d2('0x1c'))['register'](socket);function respondWithStatusCode(_0xf78df5,_0x44cf2c){_0x44cf2c=_0x44cf2c||0xcc;return function(_0x5ea3ec){if(_0x5ea3ec){return _0xf78df5[_0x11d2('0x1d')](_0x44cf2c);}return _0xf78df5[_0x11d2('0x1e')](_0x44cf2c)[_0x11d2('0x1f')]();};}function respondWithResult(_0x364e3e,_0x313a9f){_0x313a9f=_0x313a9f||0xc8;return function(_0x11e40f){if(_0x11e40f){return _0x364e3e[_0x11d2('0x1e')](_0x313a9f)[_0x11d2('0x20')](_0x11e40f);}};}function respondWithFilteredResult(_0x233ecb,_0x45296a){return function(_0x255b1e){if(_0x255b1e){var _0x3db3f9=typeof _0x45296a[_0x11d2('0x21')]==='undefined'&&typeof _0x45296a['limit']===_0x11d2('0x22');var _0x40e203=_0x255b1e['count'];var _0x3ec9f0=_0x3db3f9?0x0:_0x45296a[_0x11d2('0x21')];var _0xdac2d=_0x3db3f9?_0x255b1e[_0x11d2('0x23')]:_0x45296a[_0x11d2('0x21')]+_0x45296a['limit'];var _0x29e5a6;if(_0xdac2d>=_0x40e203){_0xdac2d=_0x40e203;_0x29e5a6=0xc8;}else{_0x29e5a6=0xce;}_0x233ecb[_0x11d2('0x1e')](_0x29e5a6);return _0x233ecb['set'](_0x11d2('0x24'),_0x3ec9f0+'-'+_0xdac2d+'/'+_0x40e203)[_0x11d2('0x20')](_0x255b1e);}return null;};}function patchUpdates(_0x2e6ecc){return function(_0x3c873b){try{jsonpatch['apply'](_0x3c873b,_0x2e6ecc,!![]);}catch(_0xd611df){return BPromise[_0x11d2('0x25')](_0xd611df);}return _0x3c873b[_0x11d2('0x26')]();};}function saveUpdates(_0x203a5a,_0xf8c803){return function(_0x3fde4c){if(_0x3fde4c){return _0x3fde4c[_0x11d2('0x27')](_0x203a5a)[_0x11d2('0x28')](function(_0x5dd42a){return _0x5dd42a;});}return null;};}function removeEntity(_0x203ec4,_0xfecd81){return function(_0x51f474){if(_0x51f474){return _0x51f474[_0x11d2('0x29')]()['then'](function(){_0x203ec4['status'](0xcc)[_0x11d2('0x1f')]();});}};}function handleEntityNotFound(_0x4cb6d4,_0x9a635a){return function(_0x39aac9){if(!_0x39aac9){_0x4cb6d4[_0x11d2('0x1d')](0x194);}return _0x39aac9;};}function handleError(_0x426523,_0x1eeca4){_0x1eeca4=_0x1eeca4||0x1f4;return function(_0x215c54){logger[_0x11d2('0x2a')](_0x215c54[_0x11d2('0x2b')]);if(_0x215c54['name']){delete _0x215c54[_0x11d2('0x2c')];}_0x426523[_0x11d2('0x1e')](_0x1eeca4)[_0x11d2('0x2d')](_0x215c54);};}exports[_0x11d2('0x2e')]=function(_0x3bbe1a,_0x28f56b){var _0x22c14e={},_0xaff9ef={},_0x3d86f2={'count':0x0,'rows':[]};var _0xeb3eca=_[_0x11d2('0x2f')](db[_0x11d2('0x30')][_0x11d2('0x31')],function(_0xd6acea){return{'name':_0xd6acea['fieldName'],'type':_0xd6acea[_0x11d2('0x32')][_0x11d2('0x33')]};});_0xaff9ef[_0x11d2('0x34')]=_[_0x11d2('0x2f')](_0xeb3eca,_0x11d2('0x2c'));_0xaff9ef['query']=_[_0x11d2('0x35')](_0x3bbe1a[_0x11d2('0x36')]);_0xaff9ef[_0x11d2('0x37')]=_[_0x11d2('0x38')](_0xaff9ef[_0x11d2('0x34')],_0xaff9ef['query']);_0x22c14e['attributes']=_[_0x11d2('0x38')](_0xaff9ef[_0x11d2('0x34')],qs[_0x11d2('0x39')](_0x3bbe1a[_0x11d2('0x36')][_0x11d2('0x39')]));_0x22c14e['attributes']=_0x22c14e['attributes'][_0x11d2('0x3a')]?_0x22c14e['attributes']:_0xaff9ef[_0x11d2('0x34')];if(!_0x3bbe1a[_0x11d2('0x36')]['hasOwnProperty']('nolimit')){_0x22c14e[_0x11d2('0x3b')]=qs[_0x11d2('0x3b')](_0x3bbe1a[_0x11d2('0x36')][_0x11d2('0x3b')]);_0x22c14e['offset']=qs[_0x11d2('0x21')](_0x3bbe1a[_0x11d2('0x36')]['offset']);}_0x22c14e['order']=qs[_0x11d2('0x3c')](_0x3bbe1a[_0x11d2('0x36')][_0x11d2('0x3c')]);_0x22c14e[_0x11d2('0x3d')]=qs[_0x11d2('0x37')](_[_0x11d2('0x3e')](_0x3bbe1a[_0x11d2('0x36')],_0xaff9ef[_0x11d2('0x37')]),_0xeb3eca);if(_0x3bbe1a[_0x11d2('0x36')]['filter']){_0x22c14e[_0x11d2('0x3d')]=_[_0x11d2('0x3f')](_0x22c14e[_0x11d2('0x3d')],{'$or':_[_0x11d2('0x2f')](_0xeb3eca,function(_0x4e9d0d){if(_0x4e9d0d[_0x11d2('0x32')]!==_0x11d2('0x40')){var _0x165c37={};_0x165c37[_0x4e9d0d[_0x11d2('0x2c')]]={'$like':'%'+_0x3bbe1a[_0x11d2('0x36')]['filter']+'%'};return _0x165c37;}})});}_0x22c14e=_['merge']({},_0x22c14e,_0x3bbe1a['options']);var _0x5d3c64={'where':_0x22c14e[_0x11d2('0x3d')]};return db[_0x11d2('0x30')][_0x11d2('0x23')](_0x5d3c64)[_0x11d2('0x28')](function(_0x3bf84d){_0x3d86f2[_0x11d2('0x23')]=_0x3bf84d;if(_0x3bbe1a[_0x11d2('0x36')][_0x11d2('0x41')]){_0x22c14e[_0x11d2('0x42')]=[{'all':!![]}];}return db[_0x11d2('0x30')][_0x11d2('0x43')](_0x22c14e);})[_0x11d2('0x28')](function(_0x3690a1){_0x3d86f2['rows']=_0x3690a1;return _0x3d86f2;})[_0x11d2('0x28')](respondWithFilteredResult(_0x28f56b,_0x22c14e))['catch'](handleError(_0x28f56b,null));};exports['show']=function(_0x178a86,_0x439a5a){var _0x2789a4={'raw':![],'where':{'id':_0x178a86[_0x11d2('0x44')]['id']}},_0x38703a={};_0x38703a[_0x11d2('0x34')]=_[_0x11d2('0x35')](db[_0x11d2('0x30')][_0x11d2('0x31')]);_0x38703a[_0x11d2('0x36')]=_[_0x11d2('0x35')](_0x178a86[_0x11d2('0x36')]);_0x38703a[_0x11d2('0x37')]=_[_0x11d2('0x38')](_0x38703a['model'],_0x38703a[_0x11d2('0x36')]);_0x2789a4[_0x11d2('0x45')]=_[_0x11d2('0x38')](_0x38703a[_0x11d2('0x34')],qs[_0x11d2('0x39')](_0x178a86['query'][_0x11d2('0x39')]));_0x2789a4['attributes']=_0x2789a4['attributes'][_0x11d2('0x3a')]?_0x2789a4[_0x11d2('0x45')]:_0x38703a[_0x11d2('0x34')];if(_0x178a86[_0x11d2('0x36')][_0x11d2('0x41')]){_0x2789a4[_0x11d2('0x42')]=[{'all':!![]}];}_0x2789a4=_[_0x11d2('0x3f')]({},_0x2789a4,_0x178a86['options']);return db['UserProfile'][_0x11d2('0x46')](_0x2789a4)['then'](handleEntityNotFound(_0x439a5a,null))[_0x11d2('0x28')](respondWithResult(_0x439a5a,null))[_0x11d2('0x47')](handleError(_0x439a5a,null));};exports[_0x11d2('0x48')]=function(_0x42039f,_0x4a44cb){return db['UserProfile'][_0x11d2('0x48')](_0x42039f['body'],{})[_0x11d2('0x28')](respondWithResult(_0x4a44cb,0xc9))[_0x11d2('0x47')](handleError(_0x4a44cb,null));};exports['clone']=function(_0x1e9f65,_0x2a1c65){var _0x4552b3={'where':{'id':_0x1e9f65[_0x11d2('0x44')]['id']}},_0x485e8c={};_0x485e8c['model']=_['keys'](db[_0x11d2('0x30')]['rawAttributes']);_0x4552b3['attributes']=_[_0x11d2('0x38')](_0x485e8c[_0x11d2('0x34')],qs[_0x11d2('0x39')](_0x1e9f65[_0x11d2('0x36')]['fields']));_0x4552b3['attributes']=_0x4552b3[_0x11d2('0x45')][_0x11d2('0x3a')]?_0x4552b3[_0x11d2('0x45')]:_0x485e8c[_0x11d2('0x34')];if(_0x1e9f65[_0x11d2('0x36')][_0x11d2('0x41')]){_0x4552b3['include']=[{'all':!![]}];}_0x4552b3=_[_0x11d2('0x3f')]({},_0x4552b3,_0x1e9f65[_0x11d2('0x49')]);return db[_0x11d2('0x30')][_0x11d2('0x46')](_0x4552b3)['then'](handleEntityNotFound(_0x2a1c65,null))[_0x11d2('0x28')](function(_0x1a7f02){if(_0x1a7f02){var _0x50fd07=_0x1a7f02[_0x11d2('0x4a')]({'plain':!![]});_0x50fd07=qs[_0x11d2('0x4b')](_0x50fd07,['id',_0x11d2('0x4c'),_0x11d2('0x4d'),_0x11d2('0x4e')]);_0x1e9f65[_0x11d2('0x4f')]=_[_0x11d2('0x4b')](_0x1e9f65[_0x11d2('0x4f')],['id',_0x11d2('0x4c'),_0x11d2('0x4d')]);return db[_0x11d2('0x50')][_0x11d2('0x51')](function(_0xdbe399){return db[_0x11d2('0x30')][_0x11d2('0x48')](_[_0x11d2('0x3f')](_0x50fd07,_0x1e9f65[_0x11d2('0x4f')]),{'include':_0x1e9f65[_0x11d2('0x36')][_0x11d2('0x41')]?[{'all':!![]}]:undefined,'transaction':_0xdbe399})[_0x11d2('0x28')](function(_0x56c93b){var _0x9390e2=_0x56c93b[_0x11d2('0x4a')]({'plain':!![]});return db[_0x11d2('0x52')][_0x11d2('0x43')]({'where':{'userProfileId':_0x1e9f65[_0x11d2('0x44')]['id']},'raw':!![]})[_0x11d2('0x28')](function(_0x429215){if(_0x429215){return BPromise[_0x11d2('0x53')](_0x429215,function(_0x1b0f2f){return new BPromise(function(_0x2204ec,_0x3492df){if(_0x1b0f2f[_0x11d2('0x54')]===null||_0x1b0f2f[_0x11d2('0x54')]===0x1)_0x2204ec(null);return db[_0x11d2('0x55')][_0x11d2('0x43')]({'where':{'sectionId':_0x1b0f2f['id']},'raw':!![]})[_0x11d2('0x28')](function(_0x34a6fb){var _0x3616a1=_[_0x11d2('0x2f')](_0x34a6fb,function(_0x1fbaa1){return qs[_0x11d2('0x4b')](_0x1fbaa1,['id','createdAt',_0x11d2('0x4d'),'sectionId']);});_0x2204ec(_0x3616a1);})[_0x11d2('0x47')](function(_0x362fa9){_0x3492df(_0x362fa9);});})['then'](function(_0x3e0235){var _0x570dcb=qs['omit'](_0x1b0f2f,['id',_0x11d2('0x4c'),'updatedAt']);_0x570dcb[_0x11d2('0x56')]=_0x9390e2['id'];if(_0x3e0235)_0x570dcb['Resources']=_0x3e0235;return _0x570dcb;})['then'](function(_0x4688fc){return db[_0x11d2('0x52')]['create'](_0x4688fc,{'include':[{'model':db[_0x11d2('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0xdbe399});});})[_0x11d2('0x28')](function(){return _0x9390e2;});}});});});}})['then'](respondWithResult(_0x2a1c65,0xc9))[_0x11d2('0x47')](handleError(_0x2a1c65,null));};exports[_0x11d2('0x27')]=function(_0x41468f,_0x484cf7){if(_0x41468f[_0x11d2('0x4f')]['id']){delete _0x41468f[_0x11d2('0x4f')]['id'];}return db[_0x11d2('0x30')][_0x11d2('0x46')]({'where':{'id':_0x41468f[_0x11d2('0x44')]['id']}})[_0x11d2('0x28')](handleEntityNotFound(_0x484cf7,null))[_0x11d2('0x28')](saveUpdates(_0x41468f['body'],null))[_0x11d2('0x28')](respondWithResult(_0x484cf7,null))[_0x11d2('0x47')](handleError(_0x484cf7,null));};exports[_0x11d2('0x29')]=function(_0xe4ba6a,_0x39bb22){return db[_0x11d2('0x30')][_0x11d2('0x46')]({'where':{'id':_0xe4ba6a[_0x11d2('0x44')]['id']}})['then'](handleEntityNotFound(_0x39bb22,null))[_0x11d2('0x28')](removeEntity(_0x39bb22,null))[_0x11d2('0x47')](handleError(_0x39bb22,null));};exports['describe']=function(_0x44f35f,_0x2d5680){return db[_0x11d2('0x30')][_0x11d2('0x57')]()[_0x11d2('0x28')](respondWithResult(_0x2d5680,null))[_0x11d2('0x47')](handleError(_0x2d5680,null));};exports['addSections']=function(_0x313f20,_0x136d3e){var _0xd3d117=_0x313f20['body'];return db['UserProfile'][_0x11d2('0x46')]({'where':{'id':_0x313f20[_0x11d2('0x44')]['id']}})[_0x11d2('0x28')](handleEntityNotFound(_0x136d3e,null))['then'](function(_0x372cce){if(_0x372cce){return db[_0x11d2('0x50')][_0x11d2('0x51')](function(_0x357bab){return db[_0x11d2('0x52')][_0x11d2('0x29')]({'where':{'userProfileId':_0x313f20[_0x11d2('0x44')]['id'],'sectionId':_['map'](_0xd3d117,function(_0x5650a5){return _0x5650a5[_0x11d2('0x58')];})},'transaction':_0x357bab})['then'](function(){var _0x4ca479=_['map'](_0xd3d117,function(_0x4df2b8){_0x4df2b8[_0x11d2('0x56')]=_0x313f20[_0x11d2('0x44')]['id'];return _0x4df2b8;});var _0x19c3cb=[];return BPromise[_0x11d2('0x53')](_0x4ca479,function(_0x388692){return db[_0x11d2('0x52')][_0x11d2('0x48')](_0x388692,{'include':[{'model':db[_0x11d2('0x55')],'as':_0x11d2('0x59')}],'raw':!![],'transaction':_0x357bab})[_0x11d2('0x28')](function(_0x1a385a){_0x19c3cb[_0x11d2('0x5a')](_0x1a385a[_0x11d2('0x4a')]({'plain':!![]}));});})[_0x11d2('0x28')](function(){return _0x19c3cb;});});});}})['then'](function(_0x3ff7a5){return _0x3ff7a5;})[_0x11d2('0x28')](respondWithResult(_0x136d3e,null))['catch'](handleError(_0x136d3e,null));};exports['removeSections']=function(_0x43aed0,_0xe7a2e7){var _0x2fc6c5;return db[_0x11d2('0x30')]['find']({'where':{'id':_0x43aed0['params']['id']},'attributes':['id',_0x11d2('0x2c')]})[_0x11d2('0x28')](handleEntityNotFound(_0xe7a2e7,null))[_0x11d2('0x28')](function(_0x2260e1){if(_0x2260e1){_0x2fc6c5=_0x2260e1;return db[_0x11d2('0x52')][_0x11d2('0x29')]({'where':{'userProfileId':_0x43aed0['params']['id'],'sectionId':_0x43aed0['query'][_0x11d2('0x5b')]}});}})[_0x11d2('0x28')](function(){return _0x2fc6c5;})['then'](respondWithStatusCode(_0xe7a2e7,null))[_0x11d2('0x47')](handleError(_0xe7a2e7,null));};exports[_0x11d2('0x5c')]=function(_0x560a70,_0x1285a1){var _0xd681dd=[];var _0x7df091=[];return db[_0x11d2('0x52')][_0x11d2('0x43')]({'where':{'userProfileId':_0x560a70['params']['id']},'raw':!![]})['then'](function(_0x42b239){_0xd681dd=_[_0x11d2('0x5d')](_0x42b239,function(_0x55ac5e){return _0x55ac5e[_0x11d2('0x5e')]===0x1||_[_0x11d2('0x5f')]([0x3eb,0x709],_0x55ac5e[_0x11d2('0x58')]);});if(!_[_0x11d2('0x60')](_0xd681dd)){return _['map'](_0xd681dd,function(_0x3a1fe5){return _0x3a1fe5['sectionId'];});}else{return;}})['then'](function(_0x5c16d4){if(_0x5c16d4)_0x7df091=_0x5c16d4;if(_[_0x11d2('0x5f')](_0x7df091,0x64)){var _0x5b6965=_['find'](_0xd681dd,{'sectionId':0x64});return hasDefaultDashboard(_0x5b6965)[_0x11d2('0x28')](function(_0x3bcbfb){return _[_0x11d2('0x2f')](_0xd681dd,function(_0x41b6e8){if(_0x41b6e8[_0x11d2('0x58')]===0x64){_0x41b6e8[_0x11d2('0x61')]=_0x3bcbfb;}return _0x41b6e8;});});}else{return;}})[_0x11d2('0x28')](function(_0x10bee5){if(_0x10bee5)_0xd681dd=_0x10bee5;if(_['includes'](_0x7df091,0x3eb)){var _0x3629e2=_[_0x11d2('0x46')](_0xd681dd,{'sectionId':0x3eb});return getCustomDashboards(_0x3629e2)[_0x11d2('0x28')](function(_0x4a7926){return _[_0x11d2('0x2f')](_0xd681dd,function(_0x22f416){if(_0x3629e2[_0x11d2('0x5e')]){if(_0x22f416[_0x11d2('0x58')]===0x3eb){_0x22f416[_0x11d2('0x61')]=_0x4a7926;}}else{if(_0x22f416[_0x11d2('0x58')]===0x64){_0x22f416[_0x11d2('0x61')]=_0x4a7926;}}return _0x22f416;});});}else{return;}})[_0x11d2('0x28')](function(_0x4ce1c1){if(_0x4ce1c1)_0xd681dd=_0x4ce1c1;if(_[_0x11d2('0x5f')](_0x7df091,0x709)){var _0x15cb31=_[_0x11d2('0x46')](_0xd681dd,{'sectionId':0x709});return getPlugins(_0x15cb31)[_0x11d2('0x28')](function(_0x32a3af){if(_0x15cb31[_0x11d2('0x5e')]){return _[_0x11d2('0x2f')](_0xd681dd,function(_0x2fe6ba){if(_0x2fe6ba['sectionId']===0x709){_0x2fe6ba[_0x11d2('0x61')]=_0x32a3af;}return _0x2fe6ba;});}else{var _0x3112bf={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32a3af};var _0x4db7ac=_[_0x11d2('0x2f')](_0xd681dd);_0x4db7ac[_0x11d2('0x5a')](_0x3112bf);return _0x4db7ac;}});}else{return;}})['then'](function(_0x32693f){if(_0x32693f)_0xd681dd=_0x32693f;return _['filter'](_0xd681dd,[_0x11d2('0x5e'),0x1]);})['then'](respondWithResult(_0x1285a1,null))[_0x11d2('0x47')](handleError(_0x1285a1,null));};function hasDefaultDashboard(_0x2403cc){var _0x2cd3fe=[0x65];return new BPromise(function(_0x5ae35a,_0x3b8716){try{if(_0x2403cc[_0x11d2('0x54')]){_0x5ae35a(_0x2cd3fe);}else{return db[_0x11d2('0x55')][_0x11d2('0x62')]({'where':{'sectionId':_0x2403cc['id']},'raw':!![]})[_0x11d2('0x28')](function(_0x2c4750){_0x2c4750?_0x5ae35a(_0x2cd3fe):_0x5ae35a();});}}catch(_0x429c24){_0x3b8716(_0x429c24);}});}function getCustomDashboards(_0x374994){var _0x4e3165=[];return new BPromise(function(_0x5eeff0,_0x1d8357){try{if(_0x374994[_0x11d2('0x54')]){return db['Dashboard'][_0x11d2('0x43')]({'raw':!![]})[_0x11d2('0x28')](function(_0xb84675){_0xb84675[_0x11d2('0x63')](function(_0x1833b6){_0x4e3165[_0x11d2('0x5a')](_0x1833b6['id']+0x1869f);});_0x5eeff0(_0x4e3165);});}else{return db[_0x11d2('0x55')]['findAll']({'where':{'sectionId':_0x374994['id']},'raw':!![]})[_0x11d2('0x28')](function(_0x29fc66){_0x29fc66[_0x11d2('0x63')](function(_0x49f12b){_0x4e3165['push'](_0x49f12b[_0x11d2('0x64')]+0x1869f);});_0x5eeff0(_0x4e3165);});}}catch(_0x1a4284){_0x1d8357(_0x1a4284);}});}function getPlugins(_0x3bc504){var _0x4ee9d2=[];return new BPromise(function(_0xfa5a4c,_0x3bb00b){try{if(_0x3bc504[_0x11d2('0x54')]){return db[_0x11d2('0x65')][_0x11d2('0x43')]({'raw':!![]})[_0x11d2('0x28')](function(_0x163198){_0x163198['forEach'](function(_0x1643fd){_0x4ee9d2[_0x11d2('0x5a')](_0x1643fd['id']+0x15b38);});_0xfa5a4c(_0x4ee9d2);});}else{return db[_0x11d2('0x55')]['findAll']({'where':{'sectionId':_0x3bc504['id']},'raw':!![]})[_0x11d2('0x28')](function(_0x4378b6){_0x4378b6['forEach'](function(_0x2c3441){_0x4ee9d2[_0x11d2('0x5a')](_0x2c3441[_0x11d2('0x64')]+0x15b38);});_0xfa5a4c(_0x4ee9d2);});}}catch(_0x15d0db){_0x3bb00b(_0x15d0db);}});}exports[_0x11d2('0x66')]=function(_0x2ce81f,_0x2797e4){return db[_0x11d2('0x30')][_0x11d2('0x46')]({'where':{'id':_0x2ce81f[_0x11d2('0x44')]['id']}})[_0x11d2('0x28')](handleEntityNotFound(_0x2797e4,null))['then'](function(_0x2ab7b9){if(_0x2ab7b9){return db[_0x11d2('0x50')][_0x11d2('0x51')](function(_0x245cdc){return db['UserProfileSection'][_0x11d2('0x43')]({'where':{'userProfileId':_0x2ce81f[_0x11d2('0x44')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x994839){if(_0x994839){return db[_0x11d2('0x52')][_0x11d2('0x29')]({'where':{'userProfileId':_0x2ce81f[_0x11d2('0x44')]['id'],'id':_[_0x11d2('0x2f')](_0x994839,function(_0x56c328){return _0x56c328['id'];})},'transaction':_0x245cdc});}})[_0x11d2('0x28')](function(_0x3da662){var _0xc227d5=_[_0x11d2('0x2f')](_0x2ce81f[_0x11d2('0x4f')],function(_0x55b050){_0x55b050[_0x11d2('0x56')]=_0x2ce81f[_0x11d2('0x44')]['id'];return _0x55b050;});return db[_0x11d2('0x52')][_0x11d2('0x67')](_0xc227d5,{'raw':!![],'transaction':_0x245cdc});})['then'](function(_0x169785){var _0x52bbc5=_[_0x11d2('0x5d')](_[_0x11d2('0x2f')](_0x169785,function(_0x107c98){return _0x107c98['get']({'plain':!![]});}),{'includeAll':![]});if(_0x52bbc5){return db['UserProfileSection'][_0x11d2('0x43')]({'where':{'userProfileId':_0x2ce81f[_0x11d2('0x44')]['id'],'sectionId':_[_0x11d2('0x2f')](_0x52bbc5,function(_0x21d71a){return _0x21d71a[_0x11d2('0x58')];})},'attributes':['id',_0x11d2('0x58')],'raw':!![]})[_0x11d2('0x28')](function(_0x3861ce){var _0x61b18d=_[_0x11d2('0x2f')](_0x2ce81f[_0x11d2('0x4f')],function(_0x1ce641){_0x1ce641[_0x11d2('0x56')]=_0x2ce81f['params']['id'];return _0x1ce641;});return db['UserProfileResource'][_0x11d2('0x67')](_0x61b18d,{'raw':!![],'transaction':_0x245cdc});});}})[_0x11d2('0x47')](handleError(_0x2797e4,null));});}})['then'](function(_0x4fc4b4){var _0x119fc4=_[_0x11d2('0x2f')](_0x4fc4b4,function(_0x3f9838){return _0x3f9838[_0x11d2('0x4a')]({'plain':!![]});});})[_0x11d2('0x28')](respondWithResult(_0x2797e4,null))[_0x11d2('0x47')](handleError(_0x2797e4,null));};exports[_0x11d2('0x68')]=function(_0x51dda5,_0x4b9cf2,_0x3d6482){return db[_0x11d2('0x30')][_0x11d2('0x46')]({'where':{'id':_0x51dda5[_0x11d2('0x44')]['id']}})[_0x11d2('0x28')](handleEntityNotFound(_0x4b9cf2,null))[_0x11d2('0x28')](function(_0x368ff2){if(_0x368ff2){return _0x368ff2['removeResources'](_0x51dda5[_0x11d2('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x4b9cf2,null))[_0x11d2('0x47')](handleError(_0x4b9cf2,null));};exports[_0x11d2('0x69')]=function(_0x2fdb6e,_0x587cca){var _0x51e39a={};if(!_0x2fdb6e[_0x11d2('0x36')][_0x11d2('0x6a')])throw new Error('Missing\x20section\x20parameter');if(!_0x2fdb6e['query'][_0x11d2('0x6b')](_0x11d2('0x6c'))){_0x51e39a['limit']=qs[_0x11d2('0x3b')](_0x2fdb6e[_0x11d2('0x36')]['limit']);_0x51e39a[_0x11d2('0x21')]=qs[_0x11d2('0x21')](_0x2fdb6e[_0x11d2('0x36')]['offset']);}return db[_0x11d2('0x30')][_0x11d2('0x46')]({'where':{'id':_0x2fdb6e[_0x11d2('0x44')]['id']}})[_0x11d2('0x28')](function(_0x358450){if(!_0x358450)throw new Error(_0x11d2('0x6d')+_0x2fdb6e[_0x11d2('0x44')]['id']);return db[_0x11d2('0x30')][_0x11d2('0x69')](_0x2fdb6e);})[_0x11d2('0x28')](respondWithFilteredResult(_0x587cca,_0x51e39a))[_0x11d2('0x47')](handleError(_0x587cca,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b33f497..57bdc5d 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 _0xf06c=['../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hook','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf06c,0xc7));var _0xcf06=function(_0x877986,_0x40243f){_0x877986=_0x877986-0x0;var _0x37a7ce=_0xf06c[_0x877986];return _0x37a7ce;};'use strict';var EventEmitter=require(_0xcf06('0x0'));var UserProfile=require(_0xcf06('0x1'))['db'][_0xcf06('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcf06('0x3')](0x0);var events={'afterCreate':_0xcf06('0x4'),'afterUpdate':'update','afterDestroy':_0xcf06('0x5')};function emitEvent(_0x2b98f4){return function(_0x1d0c26,_0x49218b,_0x171d05){UserProfileEvents[_0xcf06('0x6')](_0x2b98f4+':'+_0x1d0c26['id'],_0x1d0c26);UserProfileEvents[_0xcf06('0x6')](_0x2b98f4,_0x1d0c26);_0x171d05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xcf06('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x6b1b=['exports','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2d3160,_0xec23d7){var _0x73e127=function(_0x1dba61){while(--_0x1dba61){_0x2d3160['push'](_0x2d3160['shift']());}};_0x73e127(++_0xec23d7);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x6b1b[_0xea8947];return _0x2455e9;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xb6b1('0x0'))['db'][_0xb6b1('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb6b1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6b1('0x3'),'afterDestroy':_0xb6b1('0x4')};function emitEvent(_0x28daf9){return function(_0xaaa201,_0x1f218b,_0x345886){UserProfileEvents[_0xb6b1('0x5')](_0x28daf9+':'+_0xaaa201['id'],_0xaaa201);UserProfileEvents[_0xb6b1('0x5')](_0x28daf9,_0xaaa201);_0x345886(null);};}for(var e in events){if(events[_0xb6b1('0x6')](e)){var event=events[e];UserProfile[_0xb6b1('0x7')](e,emitEvent(event));}}module[_0xb6b1('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index dea0bbe..f591f16 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 _0xfdbd=['OpenTabs','UserProfile','user_profiles','section','length','push','find','params','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','merge','foreignKey','forEach','options','includeAll','include','default','reportId','DefaultReports','custom','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','associatedResources','map','catch','field','model','findAll','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','VoiceQueues','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query'];(function(_0x455633,_0x3e63ef){var _0x3daa1b=function(_0x14d6d8){while(--_0x14d6d8){_0x455633['push'](_0x455633['shift']());}};_0x3daa1b(++_0x3e63ef);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x34af74,_0x59ab9d){_0x34af74=_0x34af74-0x0;var _0x12d74b=_0xfdbd[_0x34af74];return _0x12d74b;};'use strict';var _=require(_0xdfdb('0x0'));var attributes=require(_0xdfdb('0x1'));var qs=require(_0xdfdb('0x2'));var squel=require(_0xdfdb('0x3'));module[_0xdfdb('0x4')]=function(_0x3078f0){var _0x11218a=_0x3078f0[_0xdfdb('0x5')];function _0x330ad3(_0x5945e0,_0x3f5b2d){return new Promise(function(_0x4a4a3f,_0x453ef6){if(!_0x3f5b2d)return _0x4a4a3f(null);var _0x41bd5e=_0x3f5b2d['filter']?{[_0x3f5b2d['filter']['field']]:_0x3f5b2d[_0xdfdb('0x6')][_0xdfdb('0x7')]}:undefined;return _0x11218a[_0x5945e0]['findAll']({'where':_0x41bd5e,'raw':!![]})[_0xdfdb('0x8')](function(_0x444c19){_0x3f5b2d[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x444c19,'id');_0x4a4a3f(_0x3f5b2d);})[_0xdfdb('0xb')](function(_0x1ace28){_0x453ef6(_0x1ace28);});});}function _0x2bb8d4(_0x47dccc,_0x28a9f3){return new Promise(function(_0x1972db,_0x527c05){var _0x293714=_0x47dccc[_0xdfdb('0x6')]?{[_0x47dccc[_0xdfdb('0x6')][_0xdfdb('0xc')]]:_0x47dccc[_0xdfdb('0x6')][_0xdfdb('0x7')]}:undefined;return _0x11218a[_0x47dccc[_0xdfdb('0xd')]][_0xdfdb('0xe')]({'where':_0x293714,'raw':!![]})['then'](function(_0x48a66a){_0x28a9f3[_0xdfdb('0x9')]=_['map'](_0x48a66a,function(_0x471ddc){return _0x471ddc[_0xdfdb('0xf')];});_0x1972db(_0x28a9f3);})[_0xdfdb('0xb')](function(_0x40bc8a){_0x527c05(_0x40bc8a);});});}function _0x3bfd81(_0x1cdb8b,_0x54ff23,_0x4fd3d5){if(!_0x54ff23)return Promise[_0xdfdb('0x10')](null);return new Promise(function(_0x8b9193,_0x2c1070){return _0x11218a['UserProfileResource'][_0xdfdb('0xe')]({'where':{'sectionId':_0x54ff23['id']},'raw':!![]})[_0xdfdb('0x8')](function(_0x467653){if(_0x1cdb8b[_0xdfdb('0xc')]&&_0x1cdb8b[_0xdfdb('0xc')]!=='id'){_0x54ff23[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x467653,function(_0x29a639){return _0x29a639[_0x1cdb8b['field']];});}else{if(_0x4fd3d5===_0xdfdb('0x11')){_0x54ff23[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x467653,function(_0x5cc70b){return{'id':_0x5cc70b[_0xdfdb('0x12')],'type':_0x5cc70b[_0xdfdb('0x13')]};});}else{_0x54ff23[_0xdfdb('0x9')]=_['map'](_0x467653,function(_0x280e53){return _0x280e53[_0xdfdb('0x12')];});}}_0x8b9193(_0x54ff23);})[_0xdfdb('0xb')](function(_0x489fd4){_0x2c1070(_0x489fd4);});});}function _0x2a80c1(_0x526057,_0x2db1c1){var _0x145350={'parentSections':[]};switch(_0x526057[_0xdfdb('0x14')]()){case _0xdfdb('0x15'):_0x145350['childModel']=_0xdfdb('0x16');break;case _0xdfdb('0x17'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x19');break;case _0xdfdb('0x1a'):_0x145350[_0xdfdb('0x18')]='SquareRecording';_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x1c'),'field':_0xdfdb('0xf'),'foreignKey':'projectName'}];break;case _0xdfdb('0x1d'):_0x145350['childModel']=_0xdfdb('0x1e');break;case _0xdfdb('0x1f'):_0x145350[_0xdfdb('0x18')]='CmContact';_0x145350['parentSections']=[{'name':_0xdfdb('0x20'),'field':'id','foreignKey':_0xdfdb('0x21')}];break;case _0xdfdb('0x22'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x23');break;case _0xdfdb('0x24'):_0x145350['childModel']=_0xdfdb('0x25');break;case _0xdfdb('0x26'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x27');break;case _0xdfdb('0x28'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x29');break;case _0xdfdb('0x2a'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x2b');break;case _0xdfdb('0x2c'):_0x145350['childModel']='FaxQueue';break;case _0xdfdb('0x2d'):_0x145350['childModel']=_0xdfdb('0x2e');break;case _0xdfdb('0x2f'):case _0xdfdb('0x30'):case _0xdfdb('0x31'):_0x145350['childModel']=_0xdfdb('0x32');break;case'contexts':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x33');break;case _0xdfdb('0x34'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x35');break;case _0xdfdb('0x36'):_0x145350['childModel']=_0xdfdb('0x37');_0x145350[_0xdfdb('0x1b')]=[{'name':'Agents','field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x38'),'model':_0xdfdb('0x39'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x3b')]}},{'name':_0xdfdb('0x3c'),'field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x38'),'model':_0xdfdb('0x39'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x3d')]}},{'name':'VoiceQueues','field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x3e'),'model':_0xdfdb('0x3f'),'filter':{'field':_0xdfdb('0x13'),'value':[_0xdfdb('0x40')]}},{'name':_0xdfdb('0x41'),'field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xdfdb('0x42')]}}];break;case _0xdfdb('0x43'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x44');break;case _0xdfdb('0x45'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x46');break;case _0xdfdb('0x47'):_0x145350[_0xdfdb('0x18')]='VoicePrefix';break;case _0xdfdb('0x48'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x49');break;case _0xdfdb('0x4a'):_0x145350[_0xdfdb('0x18')]='MailQueue';break;case _0xdfdb('0x4b'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x4c');break;case _0xdfdb('0x4d'):_0x145350[_0xdfdb('0x18')]='MailSubstatus';break;case _0xdfdb('0x4e'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x4f');break;case'openchannelaccounts':_0x145350[_0xdfdb('0x18')]='OpenchannelAccount';break;case _0xdfdb('0x50'):_0x145350['childModel']=_0xdfdb('0x51');break;case _0xdfdb('0x52'):_0x145350['childModel']=_0xdfdb('0x53');break;case'whatsappqueues':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x54');break;case _0xdfdb('0x55'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x56');break;case'teams':_0x145350['childModel']=_0xdfdb('0x57');break;case _0xdfdb('0x58'):case'queuecampaigns':_0x145350[_0xdfdb('0x18')]='VoiceQueue';if(_0x2db1c1){_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x59')},{'name':_0xdfdb('0x41')}];}break;case _0xdfdb('0x5a'):case _0xdfdb('0x5b'):case _0xdfdb('0x5c'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x39');if(_0x2db1c1){_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x5d'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x5e'),_0xdfdb('0x5f')]},'ignore':!![]},{'name':_0xdfdb('0x60')},{'name':_0xdfdb('0x3c')}];}break;case _0xdfdb('0x61'):_0x145350['childModel']='ZendeskAccount';break;case _0xdfdb('0x62'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x63');break;case'freshdeskaccounts':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x64');break;case _0xdfdb('0x65'):_0x145350[_0xdfdb('0x18')]='SugarcrmAccount';break;case _0xdfdb('0x66'):_0x145350[_0xdfdb('0x18')]='DeskAccount';break;case _0xdfdb('0x67'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x68');break;case _0xdfdb('0x69'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x39');break;case _0xdfdb('0x6a'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6b');break;case'dispositions':_0x145350[_0xdfdb('0x18')]='Disposition';break;case _0xdfdb('0x6c'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6d');break;case _0xdfdb('0x6e'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6f');break;case _0xdfdb('0x70'):_0x145350['childModel']=_0xdfdb('0x71');break;case _0xdfdb('0x72'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x73');break;case _0xdfdb('0x74'):_0x145350['childModel']=_0xdfdb('0x75');break;case'tags':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x76');break;case _0xdfdb('0x77'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x78');break;case'triggers':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x79');break;case'trunks':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x7a');break;case _0xdfdb('0x7b'):_0x145350['childModel']=_0xdfdb('0x7c');break;case _0xdfdb('0x7d'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x7e');break;case _0xdfdb('0x7f'):_0x145350[_0xdfdb('0x18')]='AnalyticExtractedReport';_0x145350['parentSections']=[{'name':_0xdfdb('0x80'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x145350['childModel']=_0xdfdb('0x81');break;}return _0x145350;}function _0x273afa(_0x1a9541,_0x1b5f17){var _0x8bd5c0=_0x1a9541[_0xdfdb('0x82')](0x0)[_0xdfdb('0x83')]()+_0x1a9541[_0xdfdb('0x84')](0x1);var _0xb43af={'type':_0x11218a['Sequelize']['QueryTypes'][_0xdfdb('0x85')],'raw':!![]};return new Promise(function(_0x4a9654,_0x3e9f7e){var _0x10fd62=squel[_0xdfdb('0x86')]()['field'](_0xdfdb('0x87')+_0x8bd5c0+_0xdfdb('0x88'),'id')[_0xdfdb('0xc')](_0xdfdb('0x89'))[_0xdfdb('0x8a')](_0xdfdb('0x8b')+_0x1a9541+_0xdfdb('0x8c'),'ui')[_0xdfdb('0x8d')]('ui.UserId\x20=\x20?',_0x1b5f17['id']);return _0x11218a[_0xdfdb('0x8e')][_0xdfdb('0x8f')](_0x10fd62['toString'](),_0xb43af)[_0xdfdb('0x8')](function(_0x425307){_0x1b5f17[_0x8bd5c0+_0xdfdb('0x90')]=_0x425307;_0x4a9654(_0x425307);})[_0xdfdb('0xb')](function(_0x4ca57b){_0x3e9f7e(_0x4ca57b);});});}return _0x3078f0['define'](_0xdfdb('0x91'),attributes,{'tableName':_0xdfdb('0x92'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4cd890){var _0x1dea5d={'raw':![],'where':{}};var _0x2b8776={};var _0x1cb63d={'count':0x0,'rows':[]};var _0x5ef75a=_0x4cd890['query'][_0xdfdb('0x93')];var _0x4f29b9=_0x4cd890['query']['mergeResources']||![];var _0x1339a9=_0x2a80c1(_0x5ef75a,_0x4f29b9);if(!_0x1339a9['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x5ef75a+'\x27');var _0x90d435=[{'name':_0x5ef75a}];if(!_['isEmpty'](_0x1339a9[_0xdfdb('0x1b')]))_0x90d435=_0x1339a9[_0xdfdb('0x1b')];var _0x59498e=[];for(var _0x4816bc=0x0;_0x4816bc<_0x90d435[_0xdfdb('0x94')];_0x4816bc++){_0x59498e[_0xdfdb('0x95')](_0x11218a['UserProfileSection'][_0xdfdb('0x96')]({'where':{'userProfileId':_0x4cd890[_0xdfdb('0x97')]['id'],'name':_0x90d435[_0x4816bc][_0xdfdb('0xf')]},'raw':!![]}));}return Promise[_0xdfdb('0x98')](_0x59498e)[_0xdfdb('0x8')](function(_0x5f2942){var _0x5eba53=_[_0xdfdb('0x6')](_0x5f2942,function(_0x2d6be9){return _0x2d6be9?_0x2d6be9:undefined;});var _0x25fd98=_[_0xdfdb('0x6')](_0x90d435,[_0xdfdb('0x99'),!![]]);var _0xe1461f=_['isEmpty'](_0x5eba53)&&_[_0xdfdb('0x9a')](_0x25fd98)?null:_[_0xdfdb('0x9b')](_0x25fd98,_0x5eba53);if(!_0xe1461f)return null;var _0x2662bf=[];for(var _0x30054b=0x0;_0x30054b<_0xe1461f[_0xdfdb('0x94')];_0x30054b++){var _0x1bcfdd=_[_0xdfdb('0x96')](_0x90d435,function(_0x4cdcdc){return _0xe1461f[_0x30054b]?_0x4cdcdc[_0xdfdb('0xf')]===_0xe1461f[_0x30054b][_0xdfdb('0xf')]:null;});if(_0x1bcfdd){if(_0xe1461f[_0x30054b]['ignore']){_0x2662bf[_0xdfdb('0x95')](_0x330ad3(_0x1339a9[_0xdfdb('0x18')],_0xe1461f[_0x30054b]));}else{if(!_0xe1461f[_0x30054b][_0xdfdb('0x9c')]){_0x2662bf[_0xdfdb('0x95')](_0x3bfd81(_0x1bcfdd,_0xe1461f[_0x30054b],_0x1339a9[_0xdfdb('0x18')]));}else{if(_0x1bcfdd['model']){_0x2662bf[_0xdfdb('0x95')](_0x2bb8d4(_0x1bcfdd,_0xe1461f[_0x30054b]));}}}}}return Promise[_0xdfdb('0x98')](_0x2662bf);})[_0xdfdb('0x8')](function(_0x1a31b9){var _0x4999c4=_0x1a31b9;var _0x4769b4=null;if(_0x4999c4){_0x4769b4=_0x4999c4[_0xdfdb('0x94')]===0x1?_0x4999c4[0x0]:null;}if(!_0x4769b4&&!_0x4999c4)return _0x1cb63d;var _0x2b4c29=_0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0x9d')];_0x2b8776[_0xdfdb('0xd')]=_[_0xdfdb('0x9e')](_0x2b4c29);_0x2b8776[_0xdfdb('0x8f')]=_[_0xdfdb('0x9e')](_0x4cd890[_0xdfdb('0x8f')]);_0x2b8776[_0xdfdb('0x9f')]=_['intersection'](_0x2b8776[_0xdfdb('0xd')],_0x2b8776[_0xdfdb('0x8f')]);_0x1dea5d['attributes']=_[_0xdfdb('0xa0')](_0x2b8776[_0xdfdb('0xd')],qs[_0xdfdb('0xa1')](_0x4cd890['query']['fields']));_0x1dea5d['attributes']=_0x1dea5d[_0xdfdb('0xa2')][_0xdfdb('0x94')]?_0x1dea5d[_0xdfdb('0xa2')]:_0x2b8776[_0xdfdb('0xd')];if(!_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa3')](_0xdfdb('0xa4'))){_0x1dea5d['limit']=qs[_0xdfdb('0xa5')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa5')]);_0x1dea5d[_0xdfdb('0xa6')]=qs[_0xdfdb('0xa6')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa6')]);}_0x1dea5d['order']=qs[_0xdfdb('0xa7')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa7')]);_0x1dea5d[_0xdfdb('0x8d')]=qs[_0xdfdb('0x9f')](_['pick'](_0x4cd890[_0xdfdb('0x8f')],_0x2b8776['filters']));if(_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0x6')]){_0x1dea5d[_0xdfdb('0x8d')]=_[_0xdfdb('0xa8')](_0x1dea5d[_0xdfdb('0x8d')],{'$or':_['map'](_0x2b4c29,function(_0x3361b1){if(_0x3361b1[_0xdfdb('0x13')]['key']!=='VIRTUAL'){var _0x284439={};_0x284439[_0x3361b1['field']]={'$like':'%'+_0x4cd890['query'][_0xdfdb('0x6')]+'%'};return _0x284439;}})});}var _0x36d46e=[];var _0x17e4d2=null;var _0x278bff={};if(_0x4769b4){_0x17e4d2=_[_0xdfdb('0x96')](_0x90d435,[_0xdfdb('0xf'),_0x4769b4[_0xdfdb('0xf')]]);if(_0x17e4d2[_0xdfdb('0xc')]){_0x278bff={};if(_0x1339a9['childModel']===_0xdfdb('0x11')){_0x278bff[_0x17e4d2['foreignKey']]=_[_0xdfdb('0xa')](_0x4769b4[_0xdfdb('0x9')],'id');}else{_0x278bff[_0x17e4d2[_0xdfdb('0xa9')]]=_0x4769b4[_0xdfdb('0x9')];}_0x36d46e[_0xdfdb('0x95')](_0x278bff);}else{_0x1dea5d['where']['id']=_0x4769b4[_0xdfdb('0x9')];}}else{for(var _0x64639f=0x0;_0x64639f<_0x4999c4[_0xdfdb('0x94')];_0x64639f++){_0x17e4d2=_[_0xdfdb('0x96')](_0x90d435,[_0xdfdb('0xf'),_0x4999c4[_0x64639f]['name']]);if(_0x17e4d2['field']){_0x278bff={};_0x278bff[_0x17e4d2[_0xdfdb('0xa9')]]=_0x4999c4[_0x64639f][_0xdfdb('0x9')];_0x36d46e['push'](_0x278bff);}else{if(!_0x1dea5d[_0xdfdb('0x8d')]['id'])_0x1dea5d['where']['id']=[];_0x4999c4[_0x64639f][_0xdfdb('0x9')][_0xdfdb('0xaa')](function(_0xeadf25){_0x1dea5d['where']['id'][_0xdfdb('0x95')](_0xeadf25);});}}}if(!_['isEmpty'](_0x36d46e)){_0x1dea5d['where']=_[_0xdfdb('0xa8')](_0x1dea5d['where'],{'$and':{'$or':_0x36d46e}});}_0x1dea5d=_[_0xdfdb('0xa8')]({},_0x1dea5d,_0x4cd890[_0xdfdb('0xab')]);if(_0x4769b4&&!_0x4769b4[_0xdfdb('0x9c')]&&_0x1339a9[_0xdfdb('0x18')]===_0xdfdb('0x11')){if(_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xac')]){_0x1dea5d[_0xdfdb('0xad')]=[{'all':!![]}];}return _0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0xe')](_0x1dea5d)['then'](function(_0x5d2dc1){var _0xb48246=[];_0x5d2dc1['forEach'](function(_0x58e7ba){var _0x5542da;switch(_0x58e7ba['reportType']){case _0xdfdb('0xae'):_0x5542da=_[_0xdfdb('0x96')](_0x4769b4[_0xdfdb('0x9')],function(_0x3fe730){return _0x3fe730['id']===_0x58e7ba[_0xdfdb('0xaf')]&&_0x3fe730[_0xdfdb('0x13')]===_0xdfdb('0xb0');});break;case _0xdfdb('0xb1'):_0x5542da=_[_0xdfdb('0x96')](_0x4769b4[_0xdfdb('0x9')],function(_0x396b3a){return _0x396b3a['id']===_0x58e7ba[_0xdfdb('0xaf')]&&_0x396b3a[_0xdfdb('0x13')]==='CustomReports';});break;}if(_0x5542da)_0xb48246['push'](_0x58e7ba);});_0x1cb63d[_0xdfdb('0xb2')]=_0xb48246[_0xdfdb('0x94')];_0x1cb63d[_0xdfdb('0xb3')]=_0xb48246;return _0x1cb63d;});}else{return _0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0xb2')]({'where':_0x1dea5d[_0xdfdb('0x8d')]})[_0xdfdb('0x8')](function(_0x421578){_0x1cb63d[_0xdfdb('0xb2')]=_0x421578;if(_0x4cd890['query'][_0xdfdb('0xac')]){if(_0x1339a9[_0xdfdb('0x18')]===_0xdfdb('0xb4')){_0x1dea5d[_0xdfdb('0xad')]=[{'model':_0x11218a[_0xdfdb('0x76')],'as':_0xdfdb('0xb5'),'attributes':['id','name',_0xdfdb('0xb6')],'required':_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb7')]?!![]:![]},{'model':_0x11218a[_0xdfdb('0x76')],'as':_0xdfdb('0xb8'),'attributes':['id',_0xdfdb('0xf'),'color'],'through':_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb7')]?{'attributes':[],'where':{'TagId':_0x4cd890[_0xdfdb('0x8f')]['tag']||undefined}}:{},'required':_0x4cd890['query'][_0xdfdb('0xb7')]?!![]:![]}];}else{_0x1dea5d['include']=[{'all':!![]}];}}return _0x11218a[_0x1339a9['childModel']][_0xdfdb('0xe')](_0x1dea5d);})[_0xdfdb('0x8')](function(_0x57d5e3){_0x1cb63d['rows']=_0x57d5e3;if(_0x5ef75a===_0xdfdb('0x60')&&_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb9')]===_0xdfdb('0xba')){var _0x36b01e=[];for(var _0x5b883b=0x0;_0x5b883b<_0x1cb63d['rows'][_0xdfdb('0x94')];_0x5b883b++){_0x36b01e['push'](_0x273afa(_0xdfdb('0xbb'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e['push'](_0x273afa(_0xdfdb('0xbd'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e[_0xdfdb('0x95')](_0x273afa('fax',_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e[_0xdfdb('0x95')](_0x273afa(_0xdfdb('0xbe'),_0x1cb63d['rows'][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e['push'](_0x273afa('openchannel',_0x1cb63d['rows'][_0x5b883b]['dataValues']));_0x36b01e['push'](_0x273afa(_0xdfdb('0xbf'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));}return Promise[_0xdfdb('0x98')](_0x36b01e)[_0xdfdb('0x8')](function(){return _0x1cb63d;});}return _0x1cb63d;});}});}}});}; \ No newline at end of file +var _0x7ee1=['User','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','Interval','Pause','scheduler','Schedule','sounds','tags','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','include','default','reportId','DefaultReports','custom','rows','count','includeAll','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','openchannel','whatsapp','lodash','exports','filter','field','value','findAll','then','catch','model','associatedResources','map','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','CmContact','ListId','lists','CmList','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','role','agent'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3ce3dd,_0x56a2cb){_0x3ce3dd=_0x3ce3dd-0x0;var _0x208200=_0x7ee1[_0x3ce3dd];return _0x208200;};'use strict';var _=require(_0x17ee('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x17ee('0x1')]=function(_0x31a2fe){var _0x1790ff=_0x31a2fe['models'];function _0x1602fd(_0x1811e4,_0x10f7a8){return new Promise(function(_0x2f9ebc,_0x5c0617){if(!_0x10f7a8)return _0x2f9ebc(null);var _0x52b1db=_0x10f7a8[_0x17ee('0x2')]?{[_0x10f7a8['filter'][_0x17ee('0x3')]]:_0x10f7a8['filter'][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x1811e4][_0x17ee('0x5')]({'where':_0x52b1db,'raw':!![]})[_0x17ee('0x6')](function(_0x4af369){_0x10f7a8['associatedResources']=_['map'](_0x4af369,'id');_0x2f9ebc(_0x10f7a8);})[_0x17ee('0x7')](function(_0x4ee1e0){_0x5c0617(_0x4ee1e0);});});}function _0x155964(_0x378a78,_0x3068b2){return new Promise(function(_0x3d4f0f,_0x57fae0){var _0x1acde5=_0x378a78['filter']?{[_0x378a78[_0x17ee('0x2')][_0x17ee('0x3')]]:_0x378a78[_0x17ee('0x2')][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x378a78[_0x17ee('0x8')]][_0x17ee('0x5')]({'where':_0x1acde5,'raw':!![]})[_0x17ee('0x6')](function(_0x54434e){_0x3068b2[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x54434e,function(_0x329af2){return _0x329af2['name'];});_0x3d4f0f(_0x3068b2);})['catch'](function(_0x551c5f){_0x57fae0(_0x551c5f);});});}function _0x4d4593(_0x2fe0ac,_0x2382ce,_0x1b87c3){if(!_0x2382ce)return Promise[_0x17ee('0xb')](null);return new Promise(function(_0x443f81,_0x236d18){return _0x1790ff[_0x17ee('0xc')]['findAll']({'where':{'sectionId':_0x2382ce['id']},'raw':!![]})[_0x17ee('0x6')](function(_0x1118a3){if(_0x2fe0ac[_0x17ee('0x3')]&&_0x2fe0ac[_0x17ee('0x3')]!=='id'){_0x2382ce[_0x17ee('0x9')]=_['map'](_0x1118a3,function(_0x393720){return _0x393720[_0x2fe0ac['field']];});}else{if(_0x1b87c3===_0x17ee('0xd')){_0x2382ce['associatedResources']=_[_0x17ee('0xa')](_0x1118a3,function(_0x343f1b){return{'id':_0x343f1b[_0x17ee('0xe')],'type':_0x343f1b[_0x17ee('0xf')]};});}else{_0x2382ce[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x1118a3,function(_0x44548f){return _0x44548f[_0x17ee('0xe')];});}}_0x443f81(_0x2382ce);})[_0x17ee('0x7')](function(_0x1f3d6d){_0x236d18(_0x1f3d6d);});});}function _0x37fe4e(_0x4d2d91,_0x4b7bfe){var _0x2118a6={'parentSections':[]};switch(_0x4d2d91[_0x17ee('0x10')]()){case _0x17ee('0x11'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x13');break;case _0x17ee('0x14'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x15');break;case _0x17ee('0x16'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x17');_0x2118a6[_0x17ee('0x18')]=[{'name':'SquareProjects','field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x1a')}];break;case _0x17ee('0x1b'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1c');break;case'contacts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1d');_0x2118a6[_0x17ee('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x17ee('0x1e')}];break;case _0x17ee('0x1f'):_0x2118a6['childModel']=_0x17ee('0x20');break;case'companies':_0x2118a6[_0x17ee('0x12')]='CmCompany';break;case _0x17ee('0x21'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x22');break;case'chatqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x23');break;case'chatwebsites':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x24');break;case _0x17ee('0x25'):_0x2118a6['childModel']='FaxQueue';break;case _0x17ee('0x26'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x27');break;case _0x17ee('0x28'):case'internalroutes':case'outboundroutes':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x29');break;case _0x17ee('0x2a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x2b');break;case _0x17ee('0x2c'):_0x2118a6[_0x17ee('0x12')]='VoiceMail';break;case'voicerecordings':_0x2118a6['childModel']=_0x17ee('0x2d');_0x2118a6['parentSections']=[{'name':_0x17ee('0x2e'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x2f'),'model':'User','filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x31')]}},{'name':'Telephones','field':'name','foreignKey':_0x17ee('0x2f'),'model':_0x17ee('0x32'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x33')]}},{'name':_0x17ee('0x34'),'field':'name','foreignKey':'queue','model':_0x17ee('0x35'),'filter':{'field':_0x17ee('0xf'),'value':[_0x17ee('0x36')]}},{'name':_0x17ee('0x37'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x17ee('0x39')]}}];break;case _0x17ee('0x3a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3b');break;case _0x17ee('0x3c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3d');break;case _0x17ee('0x3e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3f');break;case'ivrcampaigns':_0x2118a6['childModel']='Campaign';break;case _0x17ee('0x40'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x41');break;case _0x17ee('0x42'):_0x2118a6['childModel']=_0x17ee('0x43');break;case _0x17ee('0x44'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x45');break;case'openchannelqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x46');break;case _0x17ee('0x47'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x48');break;case _0x17ee('0x49'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4a');break;case'smsaccounts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4b');break;case _0x17ee('0x4c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4d');break;case _0x17ee('0x4e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4f');break;case _0x17ee('0x50'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x51');break;case _0x17ee('0x52'):case'queuecampaigns':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x35');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x17ee('0x53'):case _0x17ee('0x54'):case _0x17ee('0x55'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':_0x17ee('0x56'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x57'),_0x17ee('0x58')]},'ignore':!![]},{'name':_0x17ee('0x2e')},{'name':_0x17ee('0x59')}];}break;case _0x17ee('0x5a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5b');break;case _0x17ee('0x5c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5d');break;case'freshdeskaccounts':_0x2118a6['childModel']=_0x17ee('0x5e');break;case _0x17ee('0x5f'):_0x2118a6['childModel']='SugarcrmAccount';break;case _0x17ee('0x60'):_0x2118a6['childModel']=_0x17ee('0x61');break;case _0x17ee('0x62'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x63');break;case _0x17ee('0x64'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');break;case _0x17ee('0x65'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x66');break;case _0x17ee('0x67'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x68');break;case'customdashboards':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x69');break;case'intervals':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6a');break;case'pauses':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6b');break;case _0x17ee('0x6c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6d');break;case _0x17ee('0x6e'):_0x2118a6[_0x17ee('0x12')]='Sound';break;case _0x17ee('0x6f'):_0x2118a6['childModel']='Tag';break;case _0x17ee('0x70'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x71');break;case'triggers':_0x2118a6['childModel']=_0x17ee('0x72');break;case _0x17ee('0x73'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x74');break;case _0x17ee('0x75'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x76');break;case _0x17ee('0x77'):_0x2118a6['childModel']=_0x17ee('0x78');break;case _0x17ee('0x79'):_0x2118a6['childModel']='AnalyticExtractedReport';_0x2118a6[_0x17ee('0x18')]=[{'name':_0x17ee('0x7a'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x2118a6['childModel']=_0x17ee('0x7b');break;}return _0x2118a6;}function _0x1f860d(_0x1fbaec,_0x4a00db){var _0x3b5284=_0x1fbaec[_0x17ee('0x7c')](0x0)[_0x17ee('0x7d')]()+_0x1fbaec[_0x17ee('0x7e')](0x1);var _0x499e21={'type':_0x1790ff[_0x17ee('0x7f')][_0x17ee('0x80')]['SELECT'],'raw':!![]};return new Promise(function(_0x431b6a,_0x13e9e3){var _0x280036=squel[_0x17ee('0x81')]()[_0x17ee('0x3')](_0x17ee('0x82')+_0x3b5284+_0x17ee('0x83'),'id')[_0x17ee('0x3')](_0x17ee('0x84'))[_0x17ee('0x85')](_0x17ee('0x86')+_0x1fbaec+'_interactions','ui')[_0x17ee('0x87')](_0x17ee('0x88'),_0x4a00db['id']);return _0x1790ff['sequelize'][_0x17ee('0x89')](_0x280036[_0x17ee('0x8a')](),_0x499e21)[_0x17ee('0x6')](function(_0x5c2658){_0x4a00db[_0x3b5284+_0x17ee('0x8b')]=_0x5c2658;_0x431b6a(_0x5c2658);})[_0x17ee('0x7')](function(_0x2d72c2){_0x13e9e3(_0x2d72c2);});});}return _0x31a2fe[_0x17ee('0x8c')]('UserProfile',attributes,{'tableName':_0x17ee('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42a6b4){var _0x59d907={'raw':![],'where':{}};var _0xc0a30f={};var _0x135c29={'count':0x0,'rows':[]};var _0x16cd1b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8e')];var _0x13d99b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8f')]||![];var _0x38087a=_0x37fe4e(_0x16cd1b,_0x13d99b);if(!_0x38087a[_0x17ee('0x12')])throw new Error(_0x17ee('0x90')+_0x16cd1b+'\x27');var _0x5f35b6=[{'name':_0x16cd1b}];if(!_[_0x17ee('0x91')](_0x38087a['parentSections']))_0x5f35b6=_0x38087a[_0x17ee('0x18')];var _0x38fd73=[];for(var _0x97b640=0x0;_0x97b640<_0x5f35b6['length'];_0x97b640++){_0x38fd73['push'](_0x1790ff[_0x17ee('0x92')][_0x17ee('0x93')]({'where':{'userProfileId':_0x42a6b4[_0x17ee('0x94')]['id'],'name':_0x5f35b6[_0x97b640][_0x17ee('0x19')]},'raw':!![]}));}return Promise['all'](_0x38fd73)[_0x17ee('0x6')](function(_0x597697){var _0x5b2baa=_[_0x17ee('0x2')](_0x597697,function(_0x3f3b42){return _0x3f3b42?_0x3f3b42:undefined;});var _0x49cc91=_['filter'](_0x5f35b6,[_0x17ee('0x95'),!![]]);var _0x32ac7a=_['isEmpty'](_0x5b2baa)&&_[_0x17ee('0x91')](_0x49cc91)?null:_[_0x17ee('0x96')](_0x49cc91,_0x5b2baa);if(!_0x32ac7a)return null;var _0x1477ef=[];for(var _0x442d0f=0x0;_0x442d0f<_0x32ac7a[_0x17ee('0x97')];_0x442d0f++){var _0x57e7e7=_[_0x17ee('0x93')](_0x5f35b6,function(_0x504467){return _0x32ac7a[_0x442d0f]?_0x504467[_0x17ee('0x19')]===_0x32ac7a[_0x442d0f][_0x17ee('0x19')]:null;});if(_0x57e7e7){if(_0x32ac7a[_0x442d0f][_0x17ee('0x95')]){_0x1477ef[_0x17ee('0x98')](_0x1602fd(_0x38087a[_0x17ee('0x12')],_0x32ac7a[_0x442d0f]));}else{if(!_0x32ac7a[_0x442d0f][_0x17ee('0x99')]){_0x1477ef[_0x17ee('0x98')](_0x4d4593(_0x57e7e7,_0x32ac7a[_0x442d0f],_0x38087a[_0x17ee('0x12')]));}else{if(_0x57e7e7[_0x17ee('0x8')]){_0x1477ef[_0x17ee('0x98')](_0x155964(_0x57e7e7,_0x32ac7a[_0x442d0f]));}}}}}return Promise[_0x17ee('0x9a')](_0x1477ef);})['then'](function(_0x457d01){var _0x402e70=_0x457d01;var _0x1600c7=null;if(_0x402e70){_0x1600c7=_0x402e70[_0x17ee('0x97')]===0x1?_0x402e70[0x0]:null;}if(!_0x1600c7&&!_0x402e70)return _0x135c29;var _0x24ce05=_0x1790ff[_0x38087a[_0x17ee('0x12')]]['rawAttributes'];_0xc0a30f[_0x17ee('0x8')]=_[_0x17ee('0x9b')](_0x24ce05);_0xc0a30f['query']=_[_0x17ee('0x9b')](_0x42a6b4[_0x17ee('0x89')]);_0xc0a30f[_0x17ee('0x9c')]=_[_0x17ee('0x9d')](_0xc0a30f[_0x17ee('0x8')],_0xc0a30f[_0x17ee('0x89')]);_0x59d907['attributes']=_['intersection'](_0xc0a30f[_0x17ee('0x8')],qs['fields'](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x9e')]));_0x59d907['attributes']=_0x59d907['attributes'][_0x17ee('0x97')]?_0x59d907[_0x17ee('0x9f')]:_0xc0a30f[_0x17ee('0x8')];if(!_0x42a6b4['query'][_0x17ee('0xa0')](_0x17ee('0xa1'))){_0x59d907[_0x17ee('0xa2')]=qs[_0x17ee('0xa2')](_0x42a6b4['query'][_0x17ee('0xa2')]);_0x59d907[_0x17ee('0xa3')]=qs[_0x17ee('0xa3')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa3')]);}_0x59d907[_0x17ee('0xa4')]=qs[_0x17ee('0xa5')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa5')]);_0x59d907[_0x17ee('0x87')]=qs[_0x17ee('0x9c')](_['pick'](_0x42a6b4[_0x17ee('0x89')],_0xc0a30f[_0x17ee('0x9c')]));if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x2')]){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$or':_['map'](_0x24ce05,function(_0x1bfe00){if(_0x1bfe00[_0x17ee('0xf')][_0x17ee('0xa7')]!==_0x17ee('0xa8')){var _0x212fdf={};_0x212fdf[_0x1bfe00[_0x17ee('0x3')]]={'$like':'%'+_0x42a6b4['query'][_0x17ee('0x2')]+'%'};return _0x212fdf;}})});}var _0x3c6536=[];var _0x40f002=null;var _0x1acd22={};if(_0x1600c7){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x1600c7['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_[_0x17ee('0xa')](_0x1600c7[_0x17ee('0x9')],'id');}else{_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x1600c7[_0x17ee('0x9')];}_0x3c6536[_0x17ee('0x98')](_0x1acd22);}else{_0x59d907[_0x17ee('0x87')]['id']=_0x1600c7[_0x17ee('0x9')];}}else{for(var _0xedd714=0x0;_0xedd714<_0x402e70['length'];_0xedd714++){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x402e70[_0xedd714]['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x402e70[_0xedd714][_0x17ee('0x9')];_0x3c6536['push'](_0x1acd22);}else{if(!_0x59d907[_0x17ee('0x87')]['id'])_0x59d907[_0x17ee('0x87')]['id']=[];_0x402e70[_0xedd714][_0x17ee('0x9')][_0x17ee('0xaa')](function(_0x1012b6){_0x59d907[_0x17ee('0x87')]['id'][_0x17ee('0x98')](_0x1012b6);});}}}if(!_['isEmpty'](_0x3c6536)){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$and':{'$or':_0x3c6536}});}_0x59d907=_['merge']({},_0x59d907,_0x42a6b4[_0x17ee('0xab')]);if(_0x1600c7&&!_0x1600c7[_0x17ee('0x99')]&&_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){if(_0x42a6b4[_0x17ee('0x89')]['includeAll']){_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}return _0x1790ff[_0x38087a['childModel']][_0x17ee('0x5')](_0x59d907)[_0x17ee('0x6')](function(_0x3571a8){var _0x17e2f3=[];_0x3571a8[_0x17ee('0xaa')](function(_0x26d5ba){var _0x26ef1f;switch(_0x26d5ba['reportType']){case _0x17ee('0xad'):_0x26ef1f=_[_0x17ee('0x93')](_0x1600c7[_0x17ee('0x9')],function(_0x14a66f){return _0x14a66f['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x14a66f['type']===_0x17ee('0xaf');});break;case _0x17ee('0xb0'):_0x26ef1f=_['find'](_0x1600c7[_0x17ee('0x9')],function(_0x25a4b9){return _0x25a4b9['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x25a4b9[_0x17ee('0xf')]==='CustomReports';});break;}if(_0x26ef1f)_0x17e2f3[_0x17ee('0x98')](_0x26d5ba);});_0x135c29['count']=_0x17e2f3[_0x17ee('0x97')];_0x135c29[_0x17ee('0xb1')]=_0x17e2f3;return _0x135c29;});}else{return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0xb2')]({'where':_0x59d907[_0x17ee('0x87')]})[_0x17ee('0x6')](function(_0x4e89ee){_0x135c29[_0x17ee('0xb2')]=_0x4e89ee;if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb3')]){if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0x1d')){_0x59d907[_0x17ee('0xac')]=[{'model':_0x1790ff[_0x17ee('0xb4')],'as':_0x17ee('0xb5'),'attributes':['id',_0x17ee('0x19'),_0x17ee('0xb6')],'required':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?!![]:![]},{'model':_0x1790ff[_0x17ee('0xb4')],'as':'ThroughTags','attributes':['id','name',_0x17ee('0xb6')],'through':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?{'attributes':[],'where':{'TagId':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]||undefined}}:{},'required':_0x42a6b4['query'][_0x17ee('0xb7')]?!![]:![]}];}else{_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}}return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0x5')](_0x59d907);})[_0x17ee('0x6')](function(_0x2bdf47){_0x135c29[_0x17ee('0xb1')]=_0x2bdf47;if(_0x16cd1b===_0x17ee('0x2e')&&_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb8')]===_0x17ee('0xb9')){var _0x50daad=[];for(var _0x3801b6=0x0;_0x3801b6<_0x135c29[_0x17ee('0xb1')]['length'];_0x3801b6++){_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xba'),_0x135c29['rows'][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbc'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('fax',_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('mail',_0x135c29[_0x17ee('0xb1')][_0x3801b6]['dataValues']));_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xbd'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbe'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));}return Promise[_0x17ee('0x9a')](_0x50daad)[_0x17ee('0x6')](function(){return _0x135c29;});}return _0x135c29;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 3cdfe2d..3b34023 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 _0x5464=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment'];(function(_0x401269,_0xfc8b27){var _0x7389b6=function(_0x501f36){while(--_0x501f36){_0x401269['push'](_0x401269['shift']());}};_0x7389b6(++_0xfc8b27);}(_0x5464,0x15d));var _0x4546=function(_0x4ac032,_0x47d235){_0x4ac032=_0x4ac032-0x0;var _0xc22a4b=_0x5464[_0x4ac032];return _0xc22a4b;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4546('0x9')](config[_0x4546('0xa')],{'host':_0x4546('0xb'),'port':0x18eb});var socket=require(_0x4546('0xc'))(new Redis(config[_0x4546('0xa')]));require(_0x4546('0xd'))[_0x4546('0xe')](socket);function respondWithRpcPromise(_0x430b2e,_0x383bf2,_0x4ac723){return new BPromise(function(_0x1dd3f5,_0x8a15e2){return client[_0x4546('0xf')](_0x430b2e,_0x4ac723)['then'](function(_0x1f82c9){logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,_0x4546('0x12'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x383bf2,_0x4546('0x12'),JSON['stringify'](_0x1f82c9));if(_0x1f82c9['error']){if(_0x1f82c9['error']['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')]['message']);return _0x8a15e2(_0x1f82c9[_0x4546('0x13')]['message']);}logger[_0x4546('0x13')]('UserProfile,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);return _0x1dd3f5(_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);}else{logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,'request\x20sent');_0x1dd3f5(_0x1f82c9['result']['message']);}})[_0x4546('0x15')](function(_0x39f552){logger[_0x4546('0x13')](_0x4546('0x11'),_0x383bf2,_0x39f552);_0x8a15e2(_0x39f552);});});} \ No newline at end of file +var _0xb7de=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb7de,0xc7));var _0xeb7d=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xb7de[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var moment=require(_0xeb7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb7d('0x3'));var fs=require('fs');var Redis=require(_0xeb7d('0x4'));var db=require(_0xeb7d('0x5'))['db'];var utils=require(_0xeb7d('0x6'));var logger=require(_0xeb7d('0x7'))('rpc');var config=require(_0xeb7d('0x8'));var jayson=require(_0xeb7d('0x9'));var client=jayson[_0xeb7d('0xa')][_0xeb7d('0xb')]({'port':0x232a});config[_0xeb7d('0xc')]=_['defaults'](config['redis'],{'host':_0xeb7d('0xd'),'port':0x18eb});var socket=require(_0xeb7d('0xe'))(new Redis(config[_0xeb7d('0xc')]));require(_0xeb7d('0xf'))['register'](socket);function respondWithRpcPromise(_0x38cf68,_0x185f3b,_0x65e85a){return new BPromise(function(_0x568d8c,_0x492804){return client[_0xeb7d('0x10')](_0x38cf68,_0x65e85a)['then'](function(_0x1aa13a){logger[_0xeb7d('0x11')](_0xeb7d('0x12'),_0x185f3b,_0xeb7d('0x13'));logger[_0xeb7d('0x14')](_0xeb7d('0x15'),_0x185f3b,'request\x20sent',JSON[_0xeb7d('0x16')](_0x1aa13a));if(_0x1aa13a[_0xeb7d('0x17')]){if(_0x1aa13a[_0xeb7d('0x17')][_0xeb7d('0x18')]===0x1f4){logger[_0xeb7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x185f3b,_0x1aa13a[_0xeb7d('0x17')]['message']);return _0x492804(_0x1aa13a[_0xeb7d('0x17')][_0xeb7d('0x19')]);}logger[_0xeb7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x185f3b,_0x1aa13a['error'][_0xeb7d('0x19')]);return _0x568d8c(_0x1aa13a[_0xeb7d('0x17')]['message']);}else{logger['info'](_0xeb7d('0x12'),_0x185f3b,_0xeb7d('0x13'));_0x568d8c(_0x1aa13a['result'][_0xeb7d('0x19')]);}})[_0xeb7d('0x1a')](function(_0x32fb0b){logger[_0xeb7d('0x17')](_0xeb7d('0x12'),_0x185f3b,_0x32fb0b);_0x492804(_0x32fb0b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 991d22f..4670e23 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 _0x3585=['remove','emit','removeListener','length','userProfile:','./userProfile.events','save'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x3585,0x186));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x5358('0x0'));var events=[_0x5358('0x1'),_0x5358('0x2'),'update'];function createListener(_0x52ac40,_0x1f7e1c){return function(_0x44c6e5){_0x1f7e1c[_0x5358('0x3')](_0x52ac40,_0x44c6e5);};}function removeListener(_0x441796,_0x50e103){return function(){UserProfileEvents[_0x5358('0x4')](_0x441796,_0x50e103);};}exports['register']=function(_0x5b22d8){for(var _0x5f0c2b=0x0,_0x24091f=events[_0x5358('0x5')];_0x5f0c2b<_0x24091f;_0x5f0c2b++){var _0xa50702=events[_0x5f0c2b];var _0x4c0135=createListener(_0x5358('0x6')+_0xa50702,_0x5b22d8);UserProfileEvents['on'](_0xa50702,_0x4c0135);}}; \ No newline at end of file +var _0x63b2=['register','length','userProfile:','save','remove','update','removeListener'];(function(_0x596030,_0x584234){var _0x411607=function(_0x428435){while(--_0x428435){_0x596030['push'](_0x596030['shift']());}};_0x411607(++_0x584234);}(_0x63b2,0x17d));var _0x263b=function(_0x2f11c1,_0x22ef22){_0x2f11c1=_0x2f11c1-0x0;var _0x28c277=_0x63b2[_0x2f11c1];return _0x28c277;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x263b('0x0'),_0x263b('0x1'),_0x263b('0x2')];function createListener(_0x524752,_0x57b7b8){return function(_0x44f815){_0x57b7b8['emit'](_0x524752,_0x44f815);};}function removeListener(_0x5a62b3,_0x462161){return function(){UserProfileEvents[_0x263b('0x3')](_0x5a62b3,_0x462161);};}exports[_0x263b('0x4')]=function(_0x20fd2e){for(var _0x4f11ec=0x0,_0xfadc8c=events[_0x263b('0x5')];_0x4f11ec<_0xfadc8c;_0x4f11ec++){var _0x44c281=events[_0x4f11ec];var _0x2f50e8=createListener(_0x263b('0x6')+_0x44c281,_0x20fd2e);UserProfileEvents['on'](_0x44c281,_0x2f50e8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d2a3d68..c4f6222 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 _0xb49b=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','post','update'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xb49b,0x81));var _0xbb49=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb49b[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xbb49('0x0'));var util=require(_0xbb49('0x1'));var path=require(_0xbb49('0x2'));var timeout=require(_0xbb49('0x3'));var express=require(_0xbb49('0x4'));var router=express['Router']();var fs_extra=require(_0xbb49('0x5'));var auth=require(_0xbb49('0x6'));var interaction=require(_0xbb49('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xbb49('0x8')]('/',auth[_0xbb49('0x9')](),controller['index']);router[_0xbb49('0x8')](_0xbb49('0xa'),auth[_0xbb49('0x9')](),controller['describe']);router[_0xbb49('0x8')](_0xbb49('0xb'),auth['isAuthenticated'](),controller[_0xbb49('0xc')]);router[_0xbb49('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbb49('0xb'),auth[_0xbb49('0x9')](),controller[_0xbb49('0xe')]);router[_0xbb49('0xf')](_0xbb49('0xb'),auth['isAuthenticated'](),controller[_0xbb49('0x10')]);module[_0xbb49('0x11')]=router; \ No newline at end of file +var _0x4d90=['describe','/:id','post','create','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe'];(function(_0x28a62e,_0x2f5b1f){var _0x846bd3=function(_0x43777c){while(--_0x43777c){_0x28a62e['push'](_0x28a62e['shift']());}};_0x846bd3(++_0x2f5b1f);}(_0x4d90,0x79));var _0x04d9=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x4d90[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x04d9('0x0'));var util=require('util');var path=require(_0x04d9('0x1'));var timeout=require(_0x04d9('0x2'));var express=require('express');var router=express[_0x04d9('0x3')]();var fs_extra=require(_0x04d9('0x4'));var auth=require(_0x04d9('0x5'));var interaction=require(_0x04d9('0x6'));var config=require(_0x04d9('0x7'));var controller=require(_0x04d9('0x8'));router[_0x04d9('0x9')]('/',auth[_0x04d9('0xa')](),controller['index']);router[_0x04d9('0x9')](_0x04d9('0xb'),auth[_0x04d9('0xa')](),controller[_0x04d9('0xc')]);router[_0x04d9('0x9')](_0x04d9('0xd'),auth[_0x04d9('0xa')](),controller['show']);router[_0x04d9('0xe')]('/',auth[_0x04d9('0xa')](),controller[_0x04d9('0xf')]);router[_0x04d9('0x10')]('/:id',auth[_0x04d9('0xa')](),controller[_0x04d9('0x11')]);router['delete']('/:id',auth[_0x04d9('0xa')](),controller['destroy']);module[_0x04d9('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 1810740..1793b28 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 _0xfec5=['exports','INTEGER','STRING','sequelize'];(function(_0x3a4b6c,_0x3b8490){var _0x59b956=function(_0x4c2d88){while(--_0x4c2d88){_0x3a4b6c['push'](_0x3a4b6c['shift']());}};_0x59b956(++_0x3b8490);}(_0xfec5,0x77));var _0x5fec=function(_0x56ea50,_0x268152){_0x56ea50=_0x56ea50-0x0;var _0x1da47f=_0xfec5[_0x56ea50];return _0x1da47f;};'use strict';var Sequelize=require(_0x5fec('0x0'));module[_0x5fec('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5fec('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5fec('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x2833=['sequelize','exports','STRING','INTEGER'];(function(_0x14a7d3,_0x142851){var _0x50835a=function(_0x554a03){while(--_0x554a03){_0x14a7d3['push'](_0x14a7d3['shift']());}};_0x50835a(++_0x142851);}(_0x2833,0x98));var _0x3283=function(_0x14a12a,_0x2e1a03){_0x14a12a=_0x14a12a-0x0;var _0x526ebb=_0x2833[_0x14a12a];return _0x526ebb;};'use strict';var Sequelize=require(_0x3283('0x0'));module[_0x3283('0x1')]={'name':{'type':Sequelize[_0x3283('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3283('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3283('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index a5a25a4..a0b1418 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2697d9,_0x26806a){var _0x25e6ae=function(_0x4ff250){while(--_0x4ff250){_0x2697d9['push'](_0x2697d9['shift']());}};_0x25e6ae(++_0x26806a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file +var _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xba34,0x119));var _0x4ba3=function(_0x4b59de,_0x385d06){_0x4b59de=_0x4b59de-0x0;var _0x2c99bc=_0xba34[_0x4b59de];return _0x2c99bc;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 364cbd5..1529df1 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 _0x558c=['UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x47d74e,_0x551ade){var _0x320904=function(_0x5ac5bf){while(--_0x5ac5bf){_0x47d74e['push'](_0x47d74e['shift']());}};_0x320904(++_0x551ade);}(_0x558c,0x1c6));var _0xc558=function(_0x5ab16c,_0x38fe88){_0x5ab16c=_0x5ab16c-0x0;var _0x1e0384=_0x558c[_0x5ab16c];return _0x1e0384;};'use strict';var _=require(_0xc558('0x0'));var util=require(_0xc558('0x1'));var logger=require(_0xc558('0x2'))(_0xc558('0x3'));var moment=require(_0xc558('0x4'));var BPromise=require(_0xc558('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc558('0x6'));var rimraf=require(_0xc558('0x7'));var config=require(_0xc558('0x8'));var attributes=require(_0xc558('0x9'));module[_0xc558('0xa')]=function(_0x3eacfa,_0x496eba){return _0x3eacfa['define'](_0xc558('0xb'),attributes,{'tableName':_0xc558('0xc'),'paranoid':![],'indexes':[{'name':_0xc558('0xd'),'fields':[_0xc558('0xe'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf995=['resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfileResource.attributes','compositeIndex'];(function(_0x5edf7d,_0x12499a){var _0x294457=function(_0x140dc1){while(--_0x140dc1){_0x5edf7d['push'](_0x5edf7d['shift']());}};_0x294457(++_0x12499a);}(_0xf995,0x1a4));var _0x5f99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf995[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x5f99('0x0'));var logger=require(_0x5f99('0x1'))(_0x5f99('0x2'));var moment=require(_0x5f99('0x3'));var BPromise=require(_0x5f99('0x4'));var rp=require(_0x5f99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f99('0x6'));var attributes=require(_0x5f99('0x7'));module['exports']=function(_0x4f71f0,_0x583008){return _0x4f71f0['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x5f99('0x8'),'fields':[_0x5f99('0x9'),_0x5f99('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index a290503..5973baf 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 _0x4646=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4646,0xd1));var _0x6464=function(_0x547cdf,_0x1cf71a){_0x547cdf=_0x547cdf-0x0;var _0x5a15d6=_0x4646[_0x547cdf];return _0x5a15d6;};'use strict';var _=require(_0x6464('0x0'));var util=require(_0x6464('0x1'));var moment=require('moment');var BPromise=require(_0x6464('0x2'));var rs=require(_0x6464('0x3'));var fs=require('fs');var Redis=require(_0x6464('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6464('0x5'));var logger=require(_0x6464('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6464('0x7'));var client=jayson[_0x6464('0x8')][_0x6464('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x323e3c,_0x3d36c2,_0x1c0751){return new BPromise(function(_0x43887c,_0x497c84){return client[_0x6464('0xa')](_0x323e3c,_0x1c0751)[_0x6464('0xb')](function(_0x26ded0){logger['info'](_0x6464('0xc'),_0x3d36c2,_0x6464('0xd'));logger[_0x6464('0xe')](_0x6464('0xf'),_0x3d36c2,_0x6464('0xd'),JSON[_0x6464('0x10')](_0x26ded0));if(_0x26ded0[_0x6464('0x11')]){if(_0x26ded0[_0x6464('0x11')][_0x6464('0x12')]===0x1f4){logger[_0x6464('0x11')](_0x6464('0xc'),_0x3d36c2,_0x26ded0[_0x6464('0x11')][_0x6464('0x13')]);return _0x497c84(_0x26ded0[_0x6464('0x11')][_0x6464('0x13')]);}logger[_0x6464('0x11')](_0x6464('0xc'),_0x3d36c2,_0x26ded0[_0x6464('0x11')][_0x6464('0x13')]);return _0x43887c(_0x26ded0['error']['message']);}else{logger[_0x6464('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x3d36c2,_0x6464('0xd'));_0x43887c(_0x26ded0['result'][_0x6464('0x13')]);}})[_0x6464('0x15')](function(_0x59f5e7){logger['error'](_0x6464('0xc'),_0x3d36c2,_0x59f5e7);_0x497c84(_0x59f5e7);});});} \ No newline at end of file +var _0x5e9d=['then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5e9d,0xb4));var _0xd5e9=function(_0x3684a2,_0x2d891c){_0x3684a2=_0x3684a2-0x0;var _0x5c823e=_0x5e9d[_0x3684a2];return _0x5c823e;};'use strict';var _=require(_0xd5e9('0x0'));var util=require(_0xd5e9('0x1'));var moment=require(_0xd5e9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5e9('0x3'));var fs=require('fs');var Redis=require(_0xd5e9('0x4'));var db=require(_0xd5e9('0x5'))['db'];var utils=require(_0xd5e9('0x6'));var logger=require('../../config/logger')(_0xd5e9('0x7'));var config=require(_0xd5e9('0x8'));var jayson=require(_0xd5e9('0x9'));var client=jayson['client'][_0xd5e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11b7bc,_0x19dca1,_0x3818af){return new BPromise(function(_0xd91cae,_0xd846e7){return client[_0xd5e9('0xb')](_0x11b7bc,_0x3818af)[_0xd5e9('0xc')](function(_0x5dd691){logger[_0xd5e9('0xd')](_0xd5e9('0xe'),_0x19dca1,'request\x20sent');logger[_0xd5e9('0xf')](_0xd5e9('0x10'),_0x19dca1,'request\x20sent',JSON[_0xd5e9('0x11')](_0x5dd691));if(_0x5dd691[_0xd5e9('0x12')]){if(_0x5dd691['error'][_0xd5e9('0x13')]===0x1f4){logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);return _0xd846e7(_0x5dd691[_0xd5e9('0x12')]['message']);}logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);return _0xd91cae(_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);}else{logger[_0xd5e9('0xd')](_0xd5e9('0xe'),_0x19dca1,_0xd5e9('0x15'));_0xd91cae(_0x5dd691[_0xd5e9('0x16')]['message']);}})[_0xd5e9('0x17')](function(_0x2a4d2a){logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x2a4d2a);_0xd846e7(_0x2a4d2a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ee1b91e..547b722 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 _0xee60=['delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x54aae5,_0x1779e6){var _0x431b3c=function(_0x58ab7d){while(--_0x58ab7d){_0x54aae5['push'](_0x54aae5['shift']());}};_0x431b3c(++_0x1779e6);}(_0xee60,0x120));var _0x0ee6=function(_0x144d6a,_0x1b8913){_0x144d6a=_0x144d6a-0x0;var _0x1c1b03=_0xee60[_0x144d6a];return _0x1c1b03;};'use strict';var multer=require(_0x0ee6('0x0'));var util=require(_0x0ee6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ee6('0x2'));var router=express['Router']();var fs_extra=require(_0x0ee6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0ee6('0x4'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x0ee6('0x5')]('/',auth['isAuthenticated'](),controller[_0x0ee6('0x6')]);router[_0x0ee6('0x5')](_0x0ee6('0x7'),auth[_0x0ee6('0x8')](),controller[_0x0ee6('0x9')]);router[_0x0ee6('0x5')](_0x0ee6('0xa'),auth[_0x0ee6('0x8')](),controller[_0x0ee6('0xb')]);router[_0x0ee6('0xc')]('/',auth['isAuthenticated'](),controller[_0x0ee6('0xd')]);router[_0x0ee6('0xe')](_0x0ee6('0xa'),auth[_0x0ee6('0x8')](),controller[_0x0ee6('0xf')]);router[_0x0ee6('0x10')](_0x0ee6('0xa'),auth[_0x0ee6('0x8')](),controller[_0x0ee6('0x11')]);module[_0x0ee6('0x12')]=router; \ No newline at end of file +var _0x6f46=['post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x1509b5,_0x23ad8a){var _0x13c395=function(_0x5978db){while(--_0x5978db){_0x1509b5['push'](_0x1509b5['shift']());}};_0x13c395(++_0x23ad8a);}(_0x6f46,0x149));var _0x66f4=function(_0x44c8cb,_0x2e28c7){_0x44c8cb=_0x44c8cb-0x0;var _0x3bf406=_0x6f46[_0x44c8cb];return _0x3bf406;};'use strict';var multer=require(_0x66f4('0x0'));var util=require(_0x66f4('0x1'));var path=require('path');var timeout=require(_0x66f4('0x2'));var express=require(_0x66f4('0x3'));var router=express[_0x66f4('0x4')]();var fs_extra=require(_0x66f4('0x5'));var auth=require(_0x66f4('0x6'));var interaction=require(_0x66f4('0x7'));var config=require(_0x66f4('0x8'));var controller=require('./userProfileSection.controller');router[_0x66f4('0x9')]('/',auth[_0x66f4('0xa')](),controller[_0x66f4('0xb')]);router[_0x66f4('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x66f4('0x9')]('/:id',auth[_0x66f4('0xa')](),controller[_0x66f4('0xc')]);router[_0x66f4('0xd')]('/',auth[_0x66f4('0xa')](),controller[_0x66f4('0xe')]);router[_0x66f4('0xf')](_0x66f4('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x66f4('0x10'),auth[_0x66f4('0xa')](),controller[_0x66f4('0x11')]);module[_0x66f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index c93eea6..6716648 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 _0xed3c=['join','getDataValue','sequelize','exports','STRING','BOOLEAN','crudPermissions'];(function(_0x1743f4,_0x5e3d77){var _0x520515=function(_0x56d8b4){while(--_0x56d8b4){_0x1743f4['push'](_0x1743f4['shift']());}};_0x520515(++_0x5e3d77);}(_0xed3c,0x1a6));var _0xced3=function(_0x4f66ef,_0x3d47ef){_0x4f66ef=_0x4f66ef-0x0;var _0x34c6ec=_0xed3c[_0x4f66ef];return _0x34c6ec;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'name':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xced3('0x2')],'set':function(_0x5f03e0){this['setDataValue'](_0xced3('0x4'),_0x5f03e0?_0x5f03e0[_0xced3('0x5')](''):[]);},'get':function(){return this[_0xced3('0x6')](_0xced3('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x2547=['BOOLEAN','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x47bd2f,_0x3e42ac){var _0x582e65=function(_0x46ac3f){while(--_0x46ac3f){_0x47bd2f['push'](_0x47bd2f['shift']());}};_0x582e65(++_0x3e42ac);}(_0x2547,0x1cd));var _0x7254=function(_0x4bde8f,_0x32894d){_0x4bde8f=_0x4bde8f-0x0;var _0x56e7bb=_0x2547[_0x4bde8f];return _0x56e7bb;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7254('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7254('0x1')],'set':function(_0x265ebf){this['setDataValue'](_0x7254('0x4'),_0x265ebf?_0x265ebf[_0x7254('0x5')](''):[]);},'get':function(){return this[_0x7254('0x6')](_0x7254('0x4'))?this['getDataValue'](_0x7254('0x4'))[_0x7254('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index f2a7467..f413537 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 _0xbe6a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x3ae639,_0x2b1305){var _0x21945e=function(_0x1dcde5){while(--_0x1dcde5){_0x3ae639['push'](_0x3ae639['shift']());}};_0x21945e(++_0x2b1305);}(_0xbe6a,0x85));var _0xabe6=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xbe6a[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xabe6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabe6('0x1'));var jsonpatch=require(_0xabe6('0x2'));var rp=require('request-promise');var moment=require(_0xabe6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xabe6('0x4'));var util=require('util');var path=require(_0xabe6('0x5'));var sox=require(_0xabe6('0x6'));var csv=require('to-csv');var ejs=require(_0xabe6('0x7'));var fs=require('fs');var fs_extra=require(_0xabe6('0x8'));var _=require('lodash');var squel=require(_0xabe6('0x9'));var crypto=require(_0xabe6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xabe6('0xb'));var toCsv=require(_0xabe6('0xc'));var querystring=require(_0xabe6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xabe6('0xe'));var qs=require(_0xabe6('0xf'));var as=require(_0xabe6('0x10'));var hardwareService=require(_0xabe6('0x11'));var logger=require(_0xabe6('0x12'))(_0xabe6('0x13'));var utils=require('../../config/utils');var config=require(_0xabe6('0x14'));var licenseUtil=require(_0xabe6('0x15'));var db=require(_0xabe6('0x16'))['db'];function respondWithStatusCode(_0x57f7d5,_0x324d29){_0x324d29=_0x324d29||0xcc;return function(_0x42b012){if(_0x42b012){return _0x57f7d5['sendStatus'](_0x324d29);}return _0x57f7d5[_0xabe6('0x17')](_0x324d29)[_0xabe6('0x18')]();};}function respondWithResult(_0x53f5aa,_0x14f2e6){_0x14f2e6=_0x14f2e6||0xc8;return function(_0x4ed480){if(_0x4ed480){return _0x53f5aa[_0xabe6('0x17')](_0x14f2e6)['json'](_0x4ed480);}};}function respondWithFilteredResult(_0x599498,_0x317900){return function(_0x282d32){if(_0x282d32){var _0x135265=typeof _0x317900[_0xabe6('0x19')]===_0xabe6('0x1a')&&typeof _0x317900[_0xabe6('0x1b')]===_0xabe6('0x1a');var _0x107f4e=_0x282d32[_0xabe6('0x1c')];var _0x1dd5c7=_0x135265?0x0:_0x317900['offset'];var _0x5297e7=_0x135265?_0x282d32[_0xabe6('0x1c')]:_0x317900[_0xabe6('0x19')]+_0x317900['limit'];var _0x1212a9;if(_0x5297e7>=_0x107f4e){_0x5297e7=_0x107f4e;_0x1212a9=0xc8;}else{_0x1212a9=0xce;}_0x599498[_0xabe6('0x17')](_0x1212a9);return _0x599498[_0xabe6('0x1d')]('Content-Range',_0x1dd5c7+'-'+_0x5297e7+'/'+_0x107f4e)[_0xabe6('0x1e')](_0x282d32);}return null;};}function patchUpdates(_0x4422cb){return function(_0xe5dd70){try{jsonpatch[_0xabe6('0x1f')](_0xe5dd70,_0x4422cb,!![]);}catch(_0x5d82b1){return BPromise[_0xabe6('0x20')](_0x5d82b1);}return _0xe5dd70[_0xabe6('0x21')]();};}function saveUpdates(_0x47f377,_0x211fd9){return function(_0x3f3652){if(_0x3f3652){return _0x3f3652[_0xabe6('0x22')](_0x47f377)['then'](function(_0x3ac444){return _0x3ac444;});}return null;};}function removeEntity(_0x5935ec,_0x2e3ab9){return function(_0x337f89){if(_0x337f89){return _0x337f89[_0xabe6('0x23')]()[_0xabe6('0x24')](function(){_0x5935ec['status'](0xcc)[_0xabe6('0x18')]();});}};}function handleEntityNotFound(_0x1a6034,_0x525149){return function(_0x4d7c7d){if(!_0x4d7c7d){_0x1a6034[_0xabe6('0x25')](0x194);}return _0x4d7c7d;};}function handleError(_0x2b10bf,_0x4a4949){_0x4a4949=_0x4a4949||0x1f4;return function(_0x2046a9){logger['error'](_0x2046a9[_0xabe6('0x26')]);if(_0x2046a9[_0xabe6('0x27')]){delete _0x2046a9[_0xabe6('0x27')];}_0x2b10bf[_0xabe6('0x17')](_0x4a4949)[_0xabe6('0x28')](_0x2046a9);};}exports[_0xabe6('0x29')]=function(_0x7f1719,_0x109335){var _0x37fbf8={},_0x476765={},_0x45f0c8={'count':0x0,'rows':[]};var _0x351f38=_[_0xabe6('0x2a')](db[_0xabe6('0x2b')][_0xabe6('0x2c')],function(_0x476284){return{'name':_0x476284['fieldName'],'type':_0x476284[_0xabe6('0x2d')][_0xabe6('0x2e')]};});_0x476765['model']=_[_0xabe6('0x2a')](_0x351f38,_0xabe6('0x27'));_0x476765[_0xabe6('0x2f')]=_[_0xabe6('0x30')](_0x7f1719[_0xabe6('0x2f')]);_0x476765[_0xabe6('0x31')]=_[_0xabe6('0x32')](_0x476765[_0xabe6('0x33')],_0x476765[_0xabe6('0x2f')]);_0x37fbf8['attributes']=_[_0xabe6('0x32')](_0x476765['model'],qs[_0xabe6('0x34')](_0x7f1719[_0xabe6('0x2f')]['fields']));_0x37fbf8[_0xabe6('0x35')]=_0x37fbf8[_0xabe6('0x35')][_0xabe6('0x36')]?_0x37fbf8[_0xabe6('0x35')]:_0x476765[_0xabe6('0x33')];if(!_0x7f1719[_0xabe6('0x2f')][_0xabe6('0x37')](_0xabe6('0x38'))){_0x37fbf8[_0xabe6('0x1b')]=qs[_0xabe6('0x1b')](_0x7f1719[_0xabe6('0x2f')]['limit']);_0x37fbf8[_0xabe6('0x19')]=qs[_0xabe6('0x19')](_0x7f1719[_0xabe6('0x2f')][_0xabe6('0x19')]);}_0x37fbf8[_0xabe6('0x39')]=qs[_0xabe6('0x3a')](_0x7f1719[_0xabe6('0x2f')]['sort']);_0x37fbf8['where']=qs['filters'](_[_0xabe6('0x3b')](_0x7f1719[_0xabe6('0x2f')],_0x476765[_0xabe6('0x31')]),_0x351f38);if(_0x7f1719[_0xabe6('0x2f')][_0xabe6('0x3c')]){_0x37fbf8[_0xabe6('0x3d')]=_[_0xabe6('0x3e')](_0x37fbf8[_0xabe6('0x3d')],{'$or':_[_0xabe6('0x2a')](_0x351f38,function(_0x3ecbd1){if(_0x3ecbd1['type']!=='VIRTUAL'){var _0xcb859b={};_0xcb859b[_0x3ecbd1[_0xabe6('0x27')]]={'$like':'%'+_0x7f1719[_0xabe6('0x2f')][_0xabe6('0x3c')]+'%'};return _0xcb859b;}})});}_0x37fbf8=_['merge']({},_0x37fbf8,_0x7f1719[_0xabe6('0x3f')]);var _0x19dbde={'where':_0x37fbf8[_0xabe6('0x3d')]};return db['UserProfileSection']['count'](_0x19dbde)[_0xabe6('0x24')](function(_0x3e95af){_0x45f0c8['count']=_0x3e95af;if(_0x7f1719['query'][_0xabe6('0x40')]){_0x37fbf8[_0xabe6('0x41')]=[{'all':!![]}];}return db[_0xabe6('0x2b')][_0xabe6('0x42')](_0x37fbf8);})[_0xabe6('0x24')](function(_0x9fd873){_0x45f0c8[_0xabe6('0x43')]=_0x9fd873;return _0x45f0c8;})[_0xabe6('0x24')](respondWithFilteredResult(_0x109335,_0x37fbf8))[_0xabe6('0x44')](handleError(_0x109335,null));};exports['show']=function(_0x160784,_0x46e6eb){var _0x4ba66b={'raw':![],'where':{'id':_0x160784[_0xabe6('0x45')]['id']}},_0x141fbe={};_0x141fbe[_0xabe6('0x33')]=_[_0xabe6('0x30')](db[_0xabe6('0x2b')][_0xabe6('0x2c')]);_0x141fbe[_0xabe6('0x2f')]=_[_0xabe6('0x30')](_0x160784[_0xabe6('0x2f')]);_0x141fbe[_0xabe6('0x31')]=_['intersection'](_0x141fbe[_0xabe6('0x33')],_0x141fbe[_0xabe6('0x2f')]);_0x4ba66b[_0xabe6('0x35')]=_[_0xabe6('0x32')](_0x141fbe[_0xabe6('0x33')],qs[_0xabe6('0x34')](_0x160784['query'][_0xabe6('0x34')]));_0x4ba66b[_0xabe6('0x35')]=_0x4ba66b['attributes'][_0xabe6('0x36')]?_0x4ba66b[_0xabe6('0x35')]:_0x141fbe[_0xabe6('0x33')];if(_0x160784[_0xabe6('0x2f')]['includeAll']){_0x4ba66b[_0xabe6('0x41')]=[{'all':!![]}];}_0x4ba66b=_[_0xabe6('0x3e')]({},_0x4ba66b,_0x160784['options']);return db['UserProfileSection'][_0xabe6('0x46')](_0x4ba66b)[_0xabe6('0x24')](handleEntityNotFound(_0x46e6eb,null))[_0xabe6('0x24')](respondWithResult(_0x46e6eb,null))[_0xabe6('0x44')](handleError(_0x46e6eb,null));};exports[_0xabe6('0x47')]=function(_0x4735b8,_0x4a469a){return db[_0xabe6('0x2b')][_0xabe6('0x47')](_0x4735b8[_0xabe6('0x48')],{})[_0xabe6('0x24')](respondWithResult(_0x4a469a,0xc9))['catch'](handleError(_0x4a469a,null));};exports['update']=function(_0x5c1d12,_0x3cc7f3){if(_0x5c1d12[_0xabe6('0x48')]['id']){delete _0x5c1d12[_0xabe6('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x5c1d12[_0xabe6('0x45')]['id']}})[_0xabe6('0x24')](handleEntityNotFound(_0x3cc7f3,null))[_0xabe6('0x24')](saveUpdates(_0x5c1d12[_0xabe6('0x48')],null))[_0xabe6('0x24')](respondWithResult(_0x3cc7f3,null))[_0xabe6('0x44')](handleError(_0x3cc7f3,null));};exports[_0xabe6('0x23')]=function(_0x4d08b4,_0x539626){return db[_0xabe6('0x2b')][_0xabe6('0x46')]({'where':{'id':_0x4d08b4[_0xabe6('0x45')]['id']}})[_0xabe6('0x24')](handleEntityNotFound(_0x539626,null))[_0xabe6('0x24')](removeEntity(_0x539626,null))['catch'](handleError(_0x539626,null));};exports[_0xabe6('0x49')]=function(_0x5182aa,_0x3ab899){return db[_0xabe6('0x2b')][_0xabe6('0x49')]()['then'](respondWithResult(_0x3ab899,null))[_0xabe6('0x44')](handleError(_0x3ab899,null));}; \ No newline at end of file +var _0x75ea=['name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','catch','update','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','apply','reject','save','then','destroy','error','stack'];(function(_0x958912,_0x27cfe0){var _0x1344f4=function(_0x5a2827){while(--_0x5a2827){_0x958912['push'](_0x958912['shift']());}};_0x1344f4(++_0x27cfe0);}(_0x75ea,0x72));var _0xa75e=function(_0x55397d,_0x54e6ca){_0x55397d=_0x55397d-0x0;var _0x168248=_0x75ea[_0x55397d];return _0x168248;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa75e('0x0'));var jsonpatch=require(_0xa75e('0x1'));var rp=require(_0xa75e('0x2'));var moment=require('moment');var BPromise=require(_0xa75e('0x3'));var Mustache=require(_0xa75e('0x4'));var util=require(_0xa75e('0x5'));var path=require(_0xa75e('0x6'));var sox=require('sox');var csv=require(_0xa75e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa75e('0x8'));var _=require(_0xa75e('0x9'));var squel=require(_0xa75e('0xa'));var crypto=require(_0xa75e('0xb'));var jsforce=require(_0xa75e('0xc'));var deskjs=require(_0xa75e('0xd'));var toCsv=require(_0xa75e('0x7'));var querystring=require(_0xa75e('0xe'));var Papa=require(_0xa75e('0xf'));var Redis=require(_0xa75e('0x10'));var authService=require(_0xa75e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa75e('0x12'));var hardwareService=require(_0xa75e('0x13'));var logger=require('../../config/logger')(_0xa75e('0x14'));var utils=require('../../config/utils');var config=require(_0xa75e('0x15'));var licenseUtil=require(_0xa75e('0x16'));var db=require(_0xa75e('0x17'))['db'];function respondWithStatusCode(_0x5950e1,_0x2e7434){_0x2e7434=_0x2e7434||0xcc;return function(_0x28e83f){if(_0x28e83f){return _0x5950e1[_0xa75e('0x18')](_0x2e7434);}return _0x5950e1[_0xa75e('0x19')](_0x2e7434)[_0xa75e('0x1a')]();};}function respondWithResult(_0x4c849e,_0xa06d1f){_0xa06d1f=_0xa06d1f||0xc8;return function(_0x3b50bb){if(_0x3b50bb){return _0x4c849e[_0xa75e('0x19')](_0xa06d1f)[_0xa75e('0x1b')](_0x3b50bb);}};}function respondWithFilteredResult(_0x4d6099,_0x205aa6){return function(_0x5afa06){if(_0x5afa06){var _0x4c6a59=typeof _0x205aa6[_0xa75e('0x1c')]===_0xa75e('0x1d')&&typeof _0x205aa6[_0xa75e('0x1e')]==='undefined';var _0x47a52f=_0x5afa06[_0xa75e('0x1f')];var _0x97a205=_0x4c6a59?0x0:_0x205aa6[_0xa75e('0x1c')];var _0x5120fd=_0x4c6a59?_0x5afa06[_0xa75e('0x1f')]:_0x205aa6[_0xa75e('0x1c')]+_0x205aa6[_0xa75e('0x1e')];var _0x51c05e;if(_0x5120fd>=_0x47a52f){_0x5120fd=_0x47a52f;_0x51c05e=0xc8;}else{_0x51c05e=0xce;}_0x4d6099[_0xa75e('0x19')](_0x51c05e);return _0x4d6099[_0xa75e('0x20')]('Content-Range',_0x97a205+'-'+_0x5120fd+'/'+_0x47a52f)[_0xa75e('0x1b')](_0x5afa06);}return null;};}function patchUpdates(_0xe643e){return function(_0x2fce62){try{jsonpatch[_0xa75e('0x21')](_0x2fce62,_0xe643e,!![]);}catch(_0xbdfb69){return BPromise[_0xa75e('0x22')](_0xbdfb69);}return _0x2fce62[_0xa75e('0x23')]();};}function saveUpdates(_0xc217ab,_0x199eb5){return function(_0x5a272d){if(_0x5a272d){return _0x5a272d['update'](_0xc217ab)[_0xa75e('0x24')](function(_0x4fa1f2){return _0x4fa1f2;});}return null;};}function removeEntity(_0x125116,_0x26d67e){return function(_0x3162b8){if(_0x3162b8){return _0x3162b8[_0xa75e('0x25')]()[_0xa75e('0x24')](function(){_0x125116[_0xa75e('0x19')](0xcc)[_0xa75e('0x1a')]();});}};}function handleEntityNotFound(_0x108cb1,_0x4f2731){return function(_0x3904c0){if(!_0x3904c0){_0x108cb1[_0xa75e('0x18')](0x194);}return _0x3904c0;};}function handleError(_0x1fce3b,_0x1fc38e){_0x1fc38e=_0x1fc38e||0x1f4;return function(_0x27b6f2){logger[_0xa75e('0x26')](_0x27b6f2[_0xa75e('0x27')]);if(_0x27b6f2[_0xa75e('0x28')]){delete _0x27b6f2[_0xa75e('0x28')];}_0x1fce3b[_0xa75e('0x19')](_0x1fc38e)[_0xa75e('0x29')](_0x27b6f2);};}exports[_0xa75e('0x2a')]=function(_0x1a2ebf,_0x2500fa){var _0x4d3579={},_0x1fc79b={},_0x3a74d2={'count':0x0,'rows':[]};var _0x19a15d=_[_0xa75e('0x2b')](db[_0xa75e('0x2c')][_0xa75e('0x2d')],function(_0x153eb0){return{'name':_0x153eb0[_0xa75e('0x2e')],'type':_0x153eb0['type'][_0xa75e('0x2f')]};});_0x1fc79b[_0xa75e('0x30')]=_[_0xa75e('0x2b')](_0x19a15d,_0xa75e('0x28'));_0x1fc79b[_0xa75e('0x31')]=_[_0xa75e('0x32')](_0x1a2ebf['query']);_0x1fc79b[_0xa75e('0x33')]=_[_0xa75e('0x34')](_0x1fc79b['model'],_0x1fc79b[_0xa75e('0x31')]);_0x4d3579['attributes']=_[_0xa75e('0x34')](_0x1fc79b[_0xa75e('0x30')],qs[_0xa75e('0x35')](_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x35')]));_0x4d3579[_0xa75e('0x36')]=_0x4d3579[_0xa75e('0x36')][_0xa75e('0x37')]?_0x4d3579[_0xa75e('0x36')]:_0x1fc79b['model'];if(!_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x38')](_0xa75e('0x39'))){_0x4d3579[_0xa75e('0x1e')]=qs[_0xa75e('0x1e')](_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x1e')]);_0x4d3579[_0xa75e('0x1c')]=qs[_0xa75e('0x1c')](_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x1c')]);}_0x4d3579[_0xa75e('0x3a')]=qs[_0xa75e('0x3b')](_0x1a2ebf['query'][_0xa75e('0x3b')]);_0x4d3579[_0xa75e('0x3c')]=qs[_0xa75e('0x33')](_['pick'](_0x1a2ebf[_0xa75e('0x31')],_0x1fc79b[_0xa75e('0x33')]),_0x19a15d);if(_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x3d')]){_0x4d3579[_0xa75e('0x3c')]=_[_0xa75e('0x3e')](_0x4d3579['where'],{'$or':_[_0xa75e('0x2b')](_0x19a15d,function(_0x2ccdbb){if(_0x2ccdbb[_0xa75e('0x3f')]!==_0xa75e('0x40')){var _0x328403={};_0x328403[_0x2ccdbb[_0xa75e('0x28')]]={'$like':'%'+_0x1a2ebf[_0xa75e('0x31')][_0xa75e('0x3d')]+'%'};return _0x328403;}})});}_0x4d3579=_[_0xa75e('0x3e')]({},_0x4d3579,_0x1a2ebf['options']);var _0x21d14b={'where':_0x4d3579[_0xa75e('0x3c')]};return db[_0xa75e('0x2c')][_0xa75e('0x1f')](_0x21d14b)[_0xa75e('0x24')](function(_0x504819){_0x3a74d2['count']=_0x504819;if(_0x1a2ebf['query'][_0xa75e('0x41')]){_0x4d3579[_0xa75e('0x42')]=[{'all':!![]}];}return db['UserProfileSection'][_0xa75e('0x43')](_0x4d3579);})[_0xa75e('0x24')](function(_0x4cae38){_0x3a74d2[_0xa75e('0x44')]=_0x4cae38;return _0x3a74d2;})['then'](respondWithFilteredResult(_0x2500fa,_0x4d3579))['catch'](handleError(_0x2500fa,null));};exports[_0xa75e('0x45')]=function(_0x33c889,_0x43a681){var _0x232e00={'raw':![],'where':{'id':_0x33c889[_0xa75e('0x46')]['id']}},_0x2ca5d={};_0x2ca5d[_0xa75e('0x30')]=_[_0xa75e('0x32')](db[_0xa75e('0x2c')][_0xa75e('0x2d')]);_0x2ca5d['query']=_[_0xa75e('0x32')](_0x33c889[_0xa75e('0x31')]);_0x2ca5d['filters']=_[_0xa75e('0x34')](_0x2ca5d[_0xa75e('0x30')],_0x2ca5d[_0xa75e('0x31')]);_0x232e00[_0xa75e('0x36')]=_[_0xa75e('0x34')](_0x2ca5d[_0xa75e('0x30')],qs['fields'](_0x33c889[_0xa75e('0x31')][_0xa75e('0x35')]));_0x232e00[_0xa75e('0x36')]=_0x232e00[_0xa75e('0x36')][_0xa75e('0x37')]?_0x232e00[_0xa75e('0x36')]:_0x2ca5d[_0xa75e('0x30')];if(_0x33c889[_0xa75e('0x31')]['includeAll']){_0x232e00[_0xa75e('0x42')]=[{'all':!![]}];}_0x232e00=_['merge']({},_0x232e00,_0x33c889['options']);return db['UserProfileSection'][_0xa75e('0x47')](_0x232e00)[_0xa75e('0x24')](handleEntityNotFound(_0x43a681,null))['then'](respondWithResult(_0x43a681,null))['catch'](handleError(_0x43a681,null));};exports[_0xa75e('0x48')]=function(_0xb50efe,_0x51c25d){return db['UserProfileSection']['create'](_0xb50efe[_0xa75e('0x49')],{})[_0xa75e('0x24')](respondWithResult(_0x51c25d,0xc9))[_0xa75e('0x4a')](handleError(_0x51c25d,null));};exports[_0xa75e('0x4b')]=function(_0x59df4a,_0x3adbad){if(_0x59df4a['body']['id']){delete _0x59df4a[_0xa75e('0x49')]['id'];}return db[_0xa75e('0x2c')][_0xa75e('0x47')]({'where':{'id':_0x59df4a[_0xa75e('0x46')]['id']}})['then'](handleEntityNotFound(_0x3adbad,null))[_0xa75e('0x24')](saveUpdates(_0x59df4a[_0xa75e('0x49')],null))[_0xa75e('0x24')](respondWithResult(_0x3adbad,null))[_0xa75e('0x4a')](handleError(_0x3adbad,null));};exports[_0xa75e('0x25')]=function(_0x3905c0,_0x2cb659){return db['UserProfileSection'][_0xa75e('0x47')]({'where':{'id':_0x3905c0[_0xa75e('0x46')]['id']}})[_0xa75e('0x24')](handleEntityNotFound(_0x2cb659,null))['then'](removeEntity(_0x2cb659,null))[_0xa75e('0x4a')](handleError(_0x2cb659,null));};exports[_0xa75e('0x4c')]=function(_0x1fc5ed,_0x3e8250){return db[_0xa75e('0x2c')][_0xa75e('0x4c')]()['then'](respondWithResult(_0x3e8250,null))[_0xa75e('0x4a')](handleError(_0x3e8250,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 055327b..884591f 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 _0x2504=['user_profile_has_sections','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','UserProfileSection'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x2504,0x16c));var _0x4250=function(_0x34aa87,_0x5c6103){_0x34aa87=_0x34aa87-0x0;var _0xdba1df=_0x2504[_0x34aa87];return _0xdba1df;};'use strict';var _=require('lodash');var util=require(_0x4250('0x0'));var logger=require(_0x4250('0x1'))('api');var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var fs=require('fs');var path=require(_0x4250('0x5'));var rimraf=require(_0x4250('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x4250('0x7')]=function(_0x400c5c,_0x4cbeaf){return _0x400c5c[_0x4250('0x8')](_0x4250('0x9'),attributes,{'tableName':_0x4250('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6caf=['request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','moment','bluebird'];(function(_0x4349fc,_0x41cd58){var _0x26c8f0=function(_0x131325){while(--_0x131325){_0x4349fc['push'](_0x4349fc['shift']());}};_0x26c8f0(++_0x41cd58);}(_0x6caf,0x142));var _0xf6ca=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0x6caf[_0xae01dd];return _0x8c26df;};'use strict';var _=require(_0xf6ca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf6ca('0x1'));var BPromise=require(_0xf6ca('0x2'));var rp=require(_0xf6ca('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6ca('0x4'));var config=require(_0xf6ca('0x5'));var attributes=require(_0xf6ca('0x6'));module[_0xf6ca('0x7')]=function(_0x3a009c,_0x4973ae){return _0x3a009c[_0xf6ca('0x8')](_0xf6ca('0x9'),attributes,{'tableName':_0xf6ca('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf6ca('0xb'),_0xf6ca('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 8d37fb7..c2c0966 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 _0xa12b=['util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4766f2,_0x38b8a1){var _0xe746c2=function(_0x27ad6d){while(--_0x27ad6d){_0x4766f2['push'](_0x4766f2['shift']());}};_0xe746c2(++_0x38b8a1);}(_0xa12b,0x175));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba12('0x0'));var util=require(_0xba12('0x1'));var moment=require('moment');var BPromise=require(_0xba12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba12('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba12('0x4'));var logger=require('../../config/logger')(_0xba12('0x5'));var config=require(_0xba12('0x6'));var jayson=require(_0xba12('0x7'));var client=jayson[_0xba12('0x8')][_0xba12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1956bf,_0x18dfe6,_0x3732c9){return new BPromise(function(_0x50442a,_0x547c13){return client[_0xba12('0xa')](_0x1956bf,_0x3732c9)[_0xba12('0xb')](function(_0x16a59f){logger[_0xba12('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x18dfe6,_0xba12('0xd'));logger['debug'](_0xba12('0xe'),_0x18dfe6,_0xba12('0xd'),JSON[_0xba12('0xf')](_0x16a59f));if(_0x16a59f['error']){if(_0x16a59f[_0xba12('0x10')][_0xba12('0x11')]===0x1f4){logger[_0xba12('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x18dfe6,_0x16a59f[_0xba12('0x10')]['message']);return _0x547c13(_0x16a59f[_0xba12('0x10')]['message']);}logger['error'](_0xba12('0x12'),_0x18dfe6,_0x16a59f[_0xba12('0x10')][_0xba12('0x13')]);return _0x50442a(_0x16a59f['error'][_0xba12('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x18dfe6,_0xba12('0xd'));_0x50442a(_0x16a59f[_0xba12('0x14')]['message']);}})[_0xba12('0x15')](function(_0x59448b){logger[_0xba12('0x10')](_0xba12('0x12'),_0x18dfe6,_0x59448b);_0x547c13(_0x59448b);});});} \ No newline at end of file +var _0xce2a=['request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0xce2a,0xd3));var _0xace2=function(_0x4337fe,_0x116365){_0x4337fe=_0x4337fe-0x0;var _0xa3b734=_0xce2a[_0x4337fe];return _0xa3b734;};'use strict';var _=require('lodash');var util=require(_0xace2('0x0'));var moment=require(_0xace2('0x1'));var BPromise=require(_0xace2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xace2('0x3'));var db=require(_0xace2('0x4'))['db'];var utils=require(_0xace2('0x5'));var logger=require('../../config/logger')(_0xace2('0x6'));var config=require('../../config/environment');var jayson=require(_0xace2('0x7'));var client=jayson[_0xace2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5295a0,_0x298f9c,_0x1e6111){return new BPromise(function(_0x3f6540,_0x144669){return client[_0xace2('0x9')](_0x5295a0,_0x1e6111)['then'](function(_0x14e69e){logger[_0xace2('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x298f9c,_0xace2('0xb'));logger[_0xace2('0xc')](_0xace2('0xd'),_0x298f9c,_0xace2('0xb'),JSON[_0xace2('0xe')](_0x14e69e));if(_0x14e69e[_0xace2('0xf')]){if(_0x14e69e[_0xace2('0xf')][_0xace2('0x10')]===0x1f4){logger[_0xace2('0xf')](_0xace2('0x11'),_0x298f9c,_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);return _0x144669(_0x14e69e[_0xace2('0xf')]['message']);}logger['error'](_0xace2('0x11'),_0x298f9c,_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);return _0x3f6540(_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);}else{logger['info'](_0xace2('0x11'),_0x298f9c,_0xace2('0xb'));_0x3f6540(_0x14e69e[_0xace2('0x13')][_0xace2('0x12')]);}})['catch'](function(_0xc9d38e){logger[_0xace2('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x298f9c,_0xc9d38e);_0x144669(_0xc9d38e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d3340e1..6c5d767 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x154ad2,_0x3e510d){var _0x402c2e=function(_0x4c174e){while(--_0x4c174e){_0x154ad2['push'](_0x154ad2['shift']());}};_0x402c2e(++_0x3e510d);}(_0x70e0,0x17b));var _0x070e=function(_0x3dc587,_0x1f9539){_0x3dc587=_0x3dc587-0x0;var _0x4ef88d=_0x70e0[_0x3dc587];return _0x4ef88d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5cf2e7,_0x530ea2){var _0x3b8c76=function(_0x371772){while(--_0x371772){_0x5cf2e7['push'](_0x5cf2e7['shift']());}};_0x3b8c76(++_0x530ea2);}(_0xe706,0xa3));var _0x6e70=function(_0x56a616,_0x5a3c7c){_0x56a616=_0x56a616-0x0;var _0xe94844=_0xe706[_0x56a616];return _0xe94844;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 0920aa7..20f330b 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 _0xfc60=['exports','sequelize'];(function(_0x6a6cc7,_0x5599d9){var _0x2b3556=function(_0xcaec3e){while(--_0xcaec3e){_0x6a6cc7['push'](_0x6a6cc7['shift']());}};_0x2b3556(++_0x5599d9);}(_0xfc60,0xb3));var _0x0fc6=function(_0x16eb19,_0x58cea4){_0x16eb19=_0x16eb19-0x0;var _0x312a25=_0xfc60[_0x16eb19];return _0x312a25;};'use strict';var Sequelize=require(_0x0fc6('0x0'));module[_0x0fc6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf596=['sequelize','exports','INTEGER'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xf596,0xa2));var _0x6f59=function(_0x4f476a,_0x33cc04){_0x4f476a=_0x4f476a-0x0;var _0x4350c8=_0xf596[_0x4f476a];return _0x4350c8;};'use strict';var Sequelize=require(_0x6f59('0x0'));module[_0x6f59('0x1')]={'penalty':{'type':Sequelize[_0x6f59('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 9e7730d..8929f55 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 _0x9536=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x4282a7,_0x351556){var _0x5b7916=function(_0x216bac){while(--_0x216bac){_0x4282a7['push'](_0x4282a7['shift']());}};_0x5b7916(++_0x351556);}(_0x9536,0x179));var _0x6953=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x9536[_0x21b36c];return _0x236627;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes'];(function(_0x2ee4ba,_0xb7db3){var _0xf62d13=function(_0x3e895b){while(--_0x3e895b){_0x2ee4ba['push'](_0x2ee4ba['shift']());}};_0xf62d13(++_0xb7db3);}(_0x187d,0x93));var _0xd187=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x187d[_0x934425];return _0x31d596;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 757852d..e17ef73 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 _0xa340=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa340,0x17f));var _0x0a34=function(_0x408d95,_0x43248e){_0x408d95=_0x408d95-0x0;var _0x552bf9=_0xa340[_0x408d95];return _0x552bf9;};'use strict';var _=require(_0x0a34('0x0'));var util=require('util');var moment=require(_0x0a34('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a34('0x2'));var fs=require('fs');var Redis=require(_0x0a34('0x3'));var db=require(_0x0a34('0x4'))['db'];var utils=require(_0x0a34('0x5'));var logger=require('../../config/logger')(_0x0a34('0x6'));var config=require(_0x0a34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0a34('0x8')][_0x0a34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ac96e,_0x2a6c05,_0x264ff1){return new BPromise(function(_0x4aa1a7,_0x4c63bb){return client[_0x0a34('0xa')](_0x1ac96e,_0x264ff1)['then'](function(_0x2d2977){logger[_0x0a34('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x2a6c05,_0x0a34('0xc'));logger[_0x0a34('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2a6c05,_0x0a34('0xc'),JSON['stringify'](_0x2d2977));if(_0x2d2977[_0x0a34('0xe')]){if(_0x2d2977['error'][_0x0a34('0xf')]===0x1f4){logger['error'](_0x0a34('0x10'),_0x2a6c05,_0x2d2977[_0x0a34('0xe')][_0x0a34('0x11')]);return _0x4c63bb(_0x2d2977['error'][_0x0a34('0x11')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2a6c05,_0x2d2977[_0x0a34('0xe')][_0x0a34('0x11')]);return _0x4aa1a7(_0x2d2977[_0x0a34('0xe')]['message']);}else{logger[_0x0a34('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x2a6c05,'request\x20sent');_0x4aa1a7(_0x2d2977[_0x0a34('0x12')][_0x0a34('0x11')]);}})[_0x0a34('0x13')](function(_0x3e2c12){logger[_0x0a34('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x2a6c05,_0x3e2c12);_0x4c63bb(_0x3e2c12);});});} \ No newline at end of file +var _0x3dbe=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util'];(function(_0x368a9f,_0x538034){var _0x58b06e=function(_0x390995){while(--_0x390995){_0x368a9f['push'](_0x368a9f['shift']());}};_0x58b06e(++_0x538034);}(_0x3dbe,0x107));var _0xe3db=function(_0x5d03e2,_0x5c6a4f){_0x5d03e2=_0x5d03e2-0x0;var _0x47fe5c=_0x3dbe[_0x5d03e2];return _0x47fe5c;};'use strict';var _=require('lodash');var util=require(_0xe3db('0x0'));var moment=require('moment');var BPromise=require(_0xe3db('0x1'));var rs=require(_0xe3db('0x2'));var fs=require('fs');var Redis=require(_0xe3db('0x3'));var db=require(_0xe3db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3db('0x5'))(_0xe3db('0x6'));var config=require(_0xe3db('0x7'));var jayson=require(_0xe3db('0x8'));var client=jayson[_0xe3db('0x9')][_0xe3db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a88bd,_0x2260d7,_0x5a0bc2){return new BPromise(function(_0x8e48ef,_0x46a622){return client[_0xe3db('0xb')](_0x2a88bd,_0x5a0bc2)['then'](function(_0x7aae2e){logger['info'](_0xe3db('0xc'),_0x2260d7,_0xe3db('0xd'));logger[_0xe3db('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2260d7,_0xe3db('0xd'),JSON[_0xe3db('0xf')](_0x7aae2e));if(_0x7aae2e['error']){if(_0x7aae2e[_0xe3db('0x10')][_0xe3db('0x11')]===0x1f4){logger['error'](_0xe3db('0xc'),_0x2260d7,_0x7aae2e[_0xe3db('0x10')][_0xe3db('0x12')]);return _0x46a622(_0x7aae2e[_0xe3db('0x10')][_0xe3db('0x12')]);}logger[_0xe3db('0x10')](_0xe3db('0xc'),_0x2260d7,_0x7aae2e[_0xe3db('0x10')]['message']);return _0x8e48ef(_0x7aae2e[_0xe3db('0x10')][_0xe3db('0x12')]);}else{logger[_0xe3db('0x13')](_0xe3db('0xc'),_0x2260d7,_0xe3db('0xd'));_0x8e48ef(_0x7aae2e[_0xe3db('0x14')][_0xe3db('0x12')]);}})[_0xe3db('0x15')](function(_0x33def8){logger[_0xe3db('0x10')](_0xe3db('0xc'),_0x2260d7,_0x33def8);_0x46a622(_0x33def8);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 1474ee7..6932b6f 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 _0x2c98=['INTEGER','sequelize','exports'];(function(_0x5227f2,_0x4d3d1b){var _0xd5165a=function(_0x1a111e){while(--_0x1a111e){_0x5227f2['push'](_0x5227f2['shift']());}};_0xd5165a(++_0x4d3d1b);}(_0x2c98,0xca));var _0x82c9=function(_0x556ef3,_0x2bc229){_0x556ef3=_0x556ef3-0x0;var _0x211e3c=_0x2c98[_0x556ef3];return _0x211e3c;};'use strict';var Sequelize=require(_0x82c9('0x0'));module[_0x82c9('0x1')]={'UserId':{'type':Sequelize[_0x82c9('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x82c9('0x2')]}}; \ No newline at end of file +var _0x8c4d=['INTEGER','sequelize','exports'];(function(_0x5a8f50,_0x20f617){var _0x1433be=function(_0x5e38ec){while(--_0x5e38ec){_0x5a8f50['push'](_0x5a8f50['shift']());}};_0x1433be(++_0x20f617);}(_0x8c4d,0x1a2));var _0xd8c4=function(_0xd62e7a,_0xac4f19){_0xd62e7a=_0xd62e7a-0x0;var _0x1bf0c8=_0x8c4d[_0xd62e7a];return _0x1bf0c8;};'use strict';var Sequelize=require(_0xd8c4('0x0'));module[_0xd8c4('0x1')]={'UserId':{'type':Sequelize[_0xd8c4('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd8c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 4f3e6e5..387558e 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(_0x2d2115,_0x5c3cd3){var _0x26f630=function(_0x373e6e){while(--_0x373e6e){_0x2d2115['push'](_0x2d2115['shift']());}};_0x26f630(++_0x5c3cd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x22e7bf,_0x5331f7){var _0x26d2c5=function(_0x4b4cba){while(--_0x4b4cba){_0x22e7bf['push'](_0x22e7bf['shift']());}};_0x26d2c5(++_0x5331f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 b87b2bd..b64b0cb 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x13bbfd,_0x2a93d2){var _0x232a7d=function(_0x4a4c47){while(--_0x4a4c47){_0x13bbfd['push'](_0x13bbfd['shift']());}};_0x232a7d(++_0x2a93d2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xcb91[_0x28f1de];return _0x5b5dad;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x59eb1f,_0x43b605){var _0x98346c=function(_0x5743bf){while(--_0x5743bf){_0x59eb1f['push'](_0x59eb1f['shift']());}};_0x98346c(++_0x43b605);}(_0x70e0,0x17b));var _0x070e=function(_0x6c225b,_0x4de56c){_0x6c225b=_0x6c225b-0x0;var _0x268839=_0x70e0[_0x6c225b];return _0x268839;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 82e4afe..766799a 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 _0xca2a=['INTEGER','sequelize','exports'];(function(_0x494ea1,_0x1c9b3c){var _0x21a73c=function(_0x1ed0c1){while(--_0x1ed0c1){_0x494ea1['push'](_0x494ea1['shift']());}};_0x21a73c(++_0x1c9b3c);}(_0xca2a,0x8e));var _0xaca2=function(_0x297af0,_0x3f72a7){_0x297af0=_0x297af0-0x0;var _0xed8dc6=_0xca2a[_0x297af0];return _0xed8dc6;};'use strict';var Sequelize=require(_0xaca2('0x0'));module[_0xaca2('0x1')]={'penalty':{'type':Sequelize[_0xaca2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4a5e=['exports','INTEGER','sequelize'];(function(_0x8c1b2d,_0x34ee32){var _0x4f8271=function(_0x3aa15a){while(--_0x3aa15a){_0x8c1b2d['push'](_0x8c1b2d['shift']());}};_0x4f8271(++_0x34ee32);}(_0x4a5e,0x158));var _0xe4a5=function(_0x16c50c,_0x1256df){_0x16c50c=_0x16c50c-0x0;var _0x50575f=_0x4a5e[_0x16c50c];return _0x50575f;};'use strict';var Sequelize=require(_0xe4a5('0x0'));module[_0xe4a5('0x1')]={'penalty':{'type':Sequelize[_0xe4a5('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 cef4ae0..000ee48 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 _0xf99c=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues'];(function(_0x3a9d1c,_0x40805f){var _0x20ab05=function(_0x40a831){while(--_0x40a831){_0x3a9d1c['push'](_0x3a9d1c['shift']());}};_0x20ab05(++_0x40805f);}(_0xf99c,0x1f4));var _0xcf99=function(_0x108ddf,_0x439241){_0x108ddf=_0x108ddf-0x0;var _0x25109e=_0xf99c[_0x108ddf];return _0x25109e;};'use strict';var _=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var logger=require('../../config/logger')(_0xcf99('0x2'));var moment=require(_0xcf99('0x3'));var BPromise=require(_0xcf99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf99('0x5'));var config=require(_0xcf99('0x6'));var attributes=require(_0xcf99('0x7'));module[_0xcf99('0x8')]=function(_0x1f6103,_0x22c350){return _0x1f6103['define']('UserVoiceQueue',attributes,{'tableName':_0xcf99('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2da2=['define','user_has_voice_queues','lodash','../../config/logger','moment','rimraf','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x28078e,_0x3fd568){var _0xdcd1d1=function(_0x8c9471){while(--_0x8c9471){_0x28078e['push'](_0x28078e['shift']());}};_0xdcd1d1(++_0x3fd568);}(_0x2da2,0x17c));var _0x22da=function(_0x56c0eb,_0x122850){_0x56c0eb=_0x56c0eb-0x0;var _0x35028f=_0x2da2[_0x56c0eb];return _0x35028f;};'use strict';var _=require(_0x22da('0x0'));var util=require('util');var logger=require(_0x22da('0x1'))('api');var moment=require(_0x22da('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x22da('0x3'));var config=require(_0x22da('0x4'));var attributes=require(_0x22da('0x5'));module[_0x22da('0x6')]=function(_0x23b858,_0x43fc49){return _0x23b858[_0x22da('0x7')]('UserVoiceQueue',attributes,{'tableName':_0x22da('0x8'),'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 1e28a44..89caa77 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 _0xef6b=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','../../config/logger','rpc','client','http','then','info'];(function(_0x400d28,_0x368388){var _0x44808a=function(_0x52b747){while(--_0x52b747){_0x400d28['push'](_0x400d28['shift']());}};_0x44808a(++_0x368388);}(_0xef6b,0x117));var _0xbef6=function(_0x1934a9,_0x3a13e1){_0x1934a9=_0x1934a9-0x0;var _0x3d1dac=_0xef6b[_0x1934a9];return _0x3d1dac;};'use strict';var _=require('lodash');var util=require(_0xbef6('0x0'));var moment=require(_0xbef6('0x1'));var BPromise=require(_0xbef6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbef6('0x3'))(_0xbef6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbef6('0x5')][_0xbef6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x153cb5,_0x4cf30c,_0xf10b1a){return new BPromise(function(_0x4ced17,_0x3d4a1c){return client['request'](_0x153cb5,_0xf10b1a)[_0xbef6('0x7')](function(_0x523f46){logger[_0xbef6('0x8')](_0xbef6('0x9'),_0x4cf30c,_0xbef6('0xa'));logger[_0xbef6('0xb')](_0xbef6('0xc'),_0x4cf30c,_0xbef6('0xa'),JSON[_0xbef6('0xd')](_0x523f46));if(_0x523f46[_0xbef6('0xe')]){if(_0x523f46['error'][_0xbef6('0xf')]===0x1f4){logger[_0xbef6('0xe')](_0xbef6('0x9'),_0x4cf30c,_0x523f46[_0xbef6('0xe')][_0xbef6('0x10')]);return _0x3d4a1c(_0x523f46[_0xbef6('0xe')][_0xbef6('0x10')]);}logger[_0xbef6('0xe')](_0xbef6('0x9'),_0x4cf30c,_0x523f46[_0xbef6('0xe')][_0xbef6('0x10')]);return _0x4ced17(_0x523f46[_0xbef6('0xe')]['message']);}else{logger[_0xbef6('0x8')](_0xbef6('0x9'),_0x4cf30c,_0xbef6('0xa'));_0x4ced17(_0x523f46['result'][_0xbef6('0x10')]);}})[_0xbef6('0x11')](function(_0x159b64){logger['error'](_0xbef6('0x9'),_0x4cf30c,_0x159b64);_0x3d4a1c(_0x159b64);});});} \ No newline at end of file +var _0xa3ac=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa3ac,0xfb));var _0xca3a=function(_0x4def4c,_0x2d9625){_0x4def4c=_0x4def4c-0x0;var _0x50002f=_0xa3ac[_0x4def4c];return _0x50002f;};'use strict';var _=require(_0xca3a('0x0'));var util=require(_0xca3a('0x1'));var moment=require(_0xca3a('0x2'));var BPromise=require('bluebird');var rs=require(_0xca3a('0x3'));var fs=require('fs');var Redis=require(_0xca3a('0x4'));var db=require(_0xca3a('0x5'))['db'];var utils=require(_0xca3a('0x6'));var logger=require(_0xca3a('0x7'))(_0xca3a('0x8'));var config=require(_0xca3a('0x9'));var jayson=require(_0xca3a('0xa'));var client=jayson[_0xca3a('0xb')][_0xca3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26f576,_0x51993a,_0x26ad01){return new BPromise(function(_0x3b062b,_0x26a198){return client['request'](_0x26f576,_0x26ad01)[_0xca3a('0xd')](function(_0x15784d){logger[_0xca3a('0xe')](_0xca3a('0xf'),_0x51993a,'request\x20sent');logger[_0xca3a('0x10')](_0xca3a('0x11'),_0x51993a,_0xca3a('0x12'),JSON[_0xca3a('0x13')](_0x15784d));if(_0x15784d[_0xca3a('0x14')]){if(_0x15784d[_0xca3a('0x14')][_0xca3a('0x15')]===0x1f4){logger['error'](_0xca3a('0xf'),_0x51993a,_0x15784d['error'][_0xca3a('0x16')]);return _0x26a198(_0x15784d[_0xca3a('0x14')][_0xca3a('0x16')]);}logger[_0xca3a('0x14')](_0xca3a('0xf'),_0x51993a,_0x15784d[_0xca3a('0x14')][_0xca3a('0x16')]);return _0x3b062b(_0x15784d[_0xca3a('0x14')][_0xca3a('0x16')]);}else{logger[_0xca3a('0xe')](_0xca3a('0xf'),_0x51993a,_0xca3a('0x12'));_0x3b062b(_0x15784d[_0xca3a('0x17')]['message']);}})[_0xca3a('0x18')](function(_0x1c1c5c){logger[_0xca3a('0x14')](_0xca3a('0xf'),_0x51993a,_0x1c1c5c);_0x26a198(_0x1c1c5c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c5cf29f..0a422a8 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3201c8,_0x50c2c9){var _0x2ecf11=function(_0x54dd8a){while(--_0x54dd8a){_0x3201c8['push'](_0x3201c8['shift']());}};_0x2ecf11(++_0x50c2c9);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f8596,_0xb68f35){var _0x408915=function(_0x25d7c2){while(--_0x25d7c2){_0x4f8596['push'](_0x4f8596['shift']());}};_0x408915(++_0xb68f35);}(_0xe706,0xa3));var _0x6e70=function(_0x100f8e,_0x1efaa3){_0x100f8e=_0x100f8e-0x0;var _0x5587df=_0xe706[_0x100f8e];return _0x5587df;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index bb14c18..b1abf59 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 _0x2350=['queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0x2350,0xf1));var _0x0235=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0x2350[_0x7b484];return _0x2ae1cf;};'use strict';var Sequelize=require(_0x0235('0x0'));module[_0x0235('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0235('0x2')},'membername':{'type':Sequelize[_0x0235('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x0235('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0235('0x3')],'allowNull':![],'unique':_0x0235('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x0235('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0235('0x5'),'comment':_0x0235('0x2')},'penalty':{'type':Sequelize[_0x0235('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x0235('0x4')](0xb),'defaultValue':0x0,'comment':_0x0235('0x2')}}; \ No newline at end of file +var _0x7089=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x7089,0xd8));var _0x9708=function(_0xfb2c9a,_0x28f386){_0xfb2c9a=_0xfb2c9a-0x0;var _0x553ac6=_0x7089[_0xfb2c9a];return _0x553ac6;};'use strict';var Sequelize=require(_0x9708('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9708('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9708('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x9708('0x2')},'UserId':{'type':Sequelize[_0x9708('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9708('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x9708('0x2')},'VoiceQueueId':{'type':Sequelize[_0x9708('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9708('0x4'),'comment':_0x9708('0x2')},'penalty':{'type':Sequelize[_0x9708('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x9708('0x1')](0xb),'defaultValue':0x0,'comment':_0x9708('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6d080fd..e1561c7 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 _0xfdd2=['events','../../mysqldb','UserVoiceQueueRt','update','emit','hook'];(function(_0x33d7e9,_0x500ef5){var _0x269ff1=function(_0x3c664d){while(--_0x3c664d){_0x33d7e9['push'](_0x33d7e9['shift']());}};_0x269ff1(++_0x500ef5);}(_0xfdd2,0x18c));var _0x2fdd=function(_0xd50b7f,_0x53c16c){_0xd50b7f=_0xd50b7f-0x0;var _0x380972=_0xfdd2[_0xd50b7f];return _0x380972;};'use strict';var EventEmitter=require(_0x2fdd('0x0'));var UserVoiceQueueRt=require(_0x2fdd('0x1'))['db'][_0x2fdd('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2fdd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4130a8){return function(_0x59f6b5,_0x21344f,_0x3a4581){UserVoiceQueueRtEvents[_0x2fdd('0x4')](_0x4130a8+':'+_0x59f6b5['id'],_0x59f6b5);UserVoiceQueueRtEvents[_0x2fdd('0x4')](_0x4130a8,_0x59f6b5);_0x3a4581(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x2fdd('0x5')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0ed4=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','UserVoiceQueueRt'];(function(_0x14c00f,_0x11b192){var _0x19fbda=function(_0xf9caa4){while(--_0xf9caa4){_0x14c00f['push'](_0x14c00f['shift']());}};_0x19fbda(++_0x11b192);}(_0x0ed4,0x92));var _0x40ed=function(_0x464461,_0x2f7d85){_0x464461=_0x464461-0x0;var _0x5c595a=_0x0ed4[_0x464461];return _0x5c595a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x40ed('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x40ed('0x1')](0x0);var events={'afterCreate':_0x40ed('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x380eb1){return function(_0x2a0f6e,_0x3db5ba,_0x4a26ad){UserVoiceQueueRtEvents[_0x40ed('0x3')](_0x380eb1+':'+_0x2a0f6e['id'],_0x2a0f6e);UserVoiceQueueRtEvents[_0x40ed('0x3')](_0x380eb1,_0x2a0f6e);_0x4a26ad(null);};}for(var e in events){if(events[_0x40ed('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x40ed('0x5')](e,emitEvent(event));}}module[_0x40ed('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 301b5e4..88edd69 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 _0xeaaa=['moment','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xeaaa,0x1a9));var _0xaeaa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xeaaa[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xaeaa('0x0'));var util=require(_0xaeaa('0x1'));var logger=require(_0xaeaa('0x2'))(_0xaeaa('0x3'));var moment=require(_0xaeaa('0x4'));var BPromise=require('bluebird');var rp=require(_0xaeaa('0x5'));var fs=require('fs');var path=require(_0xaeaa('0x6'));var rimraf=require(_0xaeaa('0x7'));var config=require('../../config/environment');var attributes=require(_0xaeaa('0x8'));module[_0xaeaa('0x9')]=function(_0x4bf03d,_0xc04afe){return _0x4bf03d[_0xaeaa('0xa')](_0xaeaa('0xb'),attributes,{'tableName':_0xaeaa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8732=['moment','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x8732,0x1cb));var _0x2873=function(_0x83d48e,_0x507328){_0x83d48e=_0x83d48e-0x0;var _0x26f1d1=_0x8732[_0x83d48e];return _0x26f1d1;};'use strict';var _=require(_0x2873('0x0'));var util=require(_0x2873('0x1'));var logger=require(_0x2873('0x2'))('api');var moment=require(_0x2873('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2873('0x4'));var config=require(_0x2873('0x5'));var attributes=require(_0x2873('0x6'));module[_0x2873('0x7')]=function(_0x4283e7,_0x531d20){return _0x4283e7[_0x2873('0x8')](_0x2873('0x9'),attributes,{'tableName':_0x2873('0xa'),'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 07ffac1..314deb6 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 _0x5fb4=['sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetVoiceQueueRtPauses','options','raw','where'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x5fb4,0xbe));var _0x45fb=function(_0x4c9ed7,_0x3e1f68){_0x4c9ed7=_0x4c9ed7-0x0;var _0x2072c8=_0x5fb4[_0x4c9ed7];return _0x2072c8;};'use strict';var _=require(_0x45fb('0x0'));var util=require(_0x45fb('0x1'));var moment=require(_0x45fb('0x2'));var BPromise=require(_0x45fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45fb('0x4'));var db=require(_0x45fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x45fb('0x6'));var config=require(_0x45fb('0x7'));var jayson=require(_0x45fb('0x8'));var client=jayson[_0x45fb('0x9')][_0x45fb('0xa')]({'port':0x232a});config[_0x45fb('0xb')]=_['defaults'](config[_0x45fb('0xb')],{'host':_0x45fb('0xc'),'port':0x18eb});var socket=require(_0x45fb('0xd'))(new Redis(config[_0x45fb('0xb')]));require('./userVoiceQueueRt.socket')[_0x45fb('0xe')](socket);function respondWithRpcPromise(_0xa527b0,_0x335206,_0x4aaad5){return new BPromise(function(_0x53667d,_0x5b7252){return client[_0x45fb('0xf')](_0xa527b0,_0x4aaad5)[_0x45fb('0x10')](function(_0x15f062){logger['info'](_0x45fb('0x11'),_0x335206,'request\x20sent');logger[_0x45fb('0x12')](_0x45fb('0x13'),_0x335206,'request\x20sent',JSON[_0x45fb('0x14')](_0x15f062));if(_0x15f062['error']){if(_0x15f062[_0x45fb('0x15')][_0x45fb('0x16')]===0x1f4){logger[_0x45fb('0x15')](_0x45fb('0x11'),_0x335206,_0x15f062[_0x45fb('0x15')][_0x45fb('0x17')]);return _0x5b7252(_0x15f062['error']['message']);}logger[_0x45fb('0x15')](_0x45fb('0x11'),_0x335206,_0x15f062[_0x45fb('0x15')]['message']);return _0x53667d(_0x15f062[_0x45fb('0x15')]['message']);}else{logger[_0x45fb('0x18')](_0x45fb('0x11'),_0x335206,_0x45fb('0x19'));_0x53667d(_0x15f062[_0x45fb('0x1a')]['message']);}})[_0x45fb('0x1b')](function(_0x2ecabb){logger[_0x45fb('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x335206,_0x2ecabb);_0x5b7252(_0x2ecabb);});});}exports[_0x45fb('0x1c')]=function(_0x56e61f){var _0x32b3b1=this;return new Promise(function(_0x223f5e,_0x27e752){return db['UserVoiceQueueRt']['findAll']({'raw':_0x56e61f['options']?_0x56e61f[_0x45fb('0x1d')][_0x45fb('0x1e')]===undefined?!![]:![]:!![],'where':_0x56e61f[_0x45fb('0x1d')]?_0x56e61f[_0x45fb('0x1d')][_0x45fb('0x1f')]||null:null,'attributes':[[db[_0x45fb('0x20')]['fn'](_0x45fb('0x21'),db['sequelize']['fn']('IF',db[_0x45fb('0x20')][_0x45fb('0x22')](_0x45fb('0x23')))),_0x45fb('0x24')]]})[_0x45fb('0x10')](function(_0x5318a5){logger[_0x45fb('0x18')](_0x45fb('0x1c'),_0x56e61f);logger[_0x45fb('0x12')](_0x45fb('0x1c'),_0x56e61f,JSON[_0x45fb('0x14')](_0x5318a5));_0x223f5e(_0x5318a5);})[_0x45fb('0x1b')](function(_0x40c336){logger[_0x45fb('0x15')](_0x45fb('0x1c'),_0x40c336['message'],_0x56e61f);_0x27e752(_0x32b3b1[_0x45fb('0x15')](0x1f4,_0x40c336[_0x45fb('0x17')]));});});}; \ No newline at end of file +var _0xf887=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','raw','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug'];(function(_0x520085,_0x3f2d6c){var _0x1e3859=function(_0x16073a){while(--_0x16073a){_0x520085['push'](_0x520085['shift']());}};_0x1e3859(++_0x3f2d6c);}(_0xf887,0x13b));var _0x7f88=function(_0x538230,_0x2ace9d){_0x538230=_0x538230-0x0;var _0x5e69b9=_0xf887[_0x538230];return _0x5e69b9;};'use strict';var _=require('lodash');var util=require(_0x7f88('0x0'));var moment=require('moment');var BPromise=require(_0x7f88('0x1'));var rs=require(_0x7f88('0x2'));var fs=require('fs');var Redis=require(_0x7f88('0x3'));var db=require(_0x7f88('0x4'))['db'];var utils=require(_0x7f88('0x5'));var logger=require(_0x7f88('0x6'))(_0x7f88('0x7'));var config=require(_0x7f88('0x8'));var jayson=require(_0x7f88('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x7f88('0xa')]=_['defaults'](config[_0x7f88('0xa')],{'host':_0x7f88('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f88('0xa')]));require(_0x7f88('0xc'))[_0x7f88('0xd')](socket);function respondWithRpcPromise(_0x298560,_0x5a53b5,_0xcff7b8){return new BPromise(function(_0x1f40d2,_0x3a5a7e){return client['request'](_0x298560,_0xcff7b8)[_0x7f88('0xe')](function(_0x427349){logger[_0x7f88('0xf')](_0x7f88('0x10'),_0x5a53b5,_0x7f88('0x11'));logger['debug'](_0x7f88('0x12'),_0x5a53b5,_0x7f88('0x11'),JSON[_0x7f88('0x13')](_0x427349));if(_0x427349[_0x7f88('0x14')]){if(_0x427349['error']['code']===0x1f4){logger[_0x7f88('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5a53b5,_0x427349['error'][_0x7f88('0x15')]);return _0x3a5a7e(_0x427349[_0x7f88('0x14')]['message']);}logger[_0x7f88('0x14')](_0x7f88('0x10'),_0x5a53b5,_0x427349['error'][_0x7f88('0x15')]);return _0x1f40d2(_0x427349[_0x7f88('0x14')][_0x7f88('0x15')]);}else{logger[_0x7f88('0xf')](_0x7f88('0x10'),_0x5a53b5,'request\x20sent');_0x1f40d2(_0x427349[_0x7f88('0x16')][_0x7f88('0x15')]);}})[_0x7f88('0x17')](function(_0x1a9be8){logger[_0x7f88('0x14')](_0x7f88('0x10'),_0x5a53b5,_0x1a9be8);_0x3a5a7e(_0x1a9be8);});});}exports[_0x7f88('0x18')]=function(_0x309e1c){var _0x5ff223=this;return new Promise(function(_0x2b44f3,_0x5c7ee8){return db[_0x7f88('0x19')]['findAll']({'raw':_0x309e1c['options']?_0x309e1c['options'][_0x7f88('0x1a')]===undefined?!![]:![]:!![],'where':_0x309e1c[_0x7f88('0x1b')]?_0x309e1c[_0x7f88('0x1b')][_0x7f88('0x1c')]||null:null,'attributes':[[db[_0x7f88('0x1d')]['fn'](_0x7f88('0x1e'),db[_0x7f88('0x1d')]['fn']('IF',db[_0x7f88('0x1d')][_0x7f88('0x1f')](_0x7f88('0x20')))),_0x7f88('0x21')]]})[_0x7f88('0xe')](function(_0x396ca4){logger[_0x7f88('0xf')](_0x7f88('0x18'),_0x309e1c);logger[_0x7f88('0x22')](_0x7f88('0x18'),_0x309e1c,JSON[_0x7f88('0x13')](_0x396ca4));_0x2b44f3(_0x396ca4);})[_0x7f88('0x17')](function(_0x5236c5){logger[_0x7f88('0x14')]('GetVoiceQueueRtPauses',_0x5236c5[_0x7f88('0x15')],_0x309e1c);_0x5c7ee8(_0x5ff223[_0x7f88('0x14')](0x1f4,_0x5236c5[_0x7f88('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 159afb0..00bb3c3 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 _0xaa37=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x25b60d,_0x3b3a69){var _0x529af1=function(_0x55564c){while(--_0x55564c){_0x25b60d['push'](_0x25b60d['shift']());}};_0x529af1(++_0x3b3a69);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xaa37[_0x1035c1];return _0x308d67;};'use strict';var UserVoiceQueueRtEvents=require(_0x7aa3('0x0'));var events=[_0x7aa3('0x1'),_0x7aa3('0x2'),_0x7aa3('0x3')];function createListener(_0x4dcf7a,_0xa0e7e9){return function(_0x27adcf){_0xa0e7e9[_0x7aa3('0x4')](_0x4dcf7a,_0x27adcf);};}function removeListener(_0x11e64c,_0x334919){return function(){UserVoiceQueueRtEvents[_0x7aa3('0x5')](_0x11e64c,_0x334919);};}exports[_0x7aa3('0x6')]=function(_0x5b738a){for(var _0x437b90=0x0,_0xbbcc8a=events['length'];_0x437b90<_0xbbcc8a;_0x437b90++){var _0x100894=events[_0x437b90];var _0x390c82=createListener(_0x7aa3('0x7')+_0x100894,_0x5b738a);UserVoiceQueueRtEvents['on'](_0x100894,_0x390c82);}}; \ No newline at end of file +var _0x600f=['remove','emit','removeListener','register','length','./userVoiceQueueRt.events','save'];(function(_0x1ff6d1,_0x52f903){var _0x1554cd=function(_0x233f9d){while(--_0x233f9d){_0x1ff6d1['push'](_0x1ff6d1['shift']());}};_0x1554cd(++_0x52f903);}(_0x600f,0xb4));var _0xf600=function(_0x111692,_0x19f8a9){_0x111692=_0x111692-0x0;var _0x11836f=_0x600f[_0x111692];return _0x11836f;};'use strict';var UserVoiceQueueRtEvents=require(_0xf600('0x0'));var events=[_0xf600('0x1'),_0xf600('0x2'),'update'];function createListener(_0x248cfa,_0x52544a){return function(_0x6a56f5){_0x52544a[_0xf600('0x3')](_0x248cfa,_0x6a56f5);};}function removeListener(_0x1b8de0,_0x181497){return function(){UserVoiceQueueRtEvents[_0xf600('0x4')](_0x1b8de0,_0x181497);};}exports[_0xf600('0x5')]=function(_0x304fdf){for(var _0xba580a=0x0,_0x5a6457=events[_0xf600('0x6')];_0xba580a<_0x5a6457;_0xba580a++){var _0x56f333=events[_0xba580a];var _0x489c42=createListener('userVoiceQueueRt:'+_0x56f333,_0x304fdf);UserVoiceQueueRtEvents['on'](_0x56f333,_0x489c42);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f427c49..337a0f7 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x128377,_0x1fd9d1){var _0x22a1a7=function(_0x5d633b){while(--_0x5d633b){_0x128377['push'](_0x128377['shift']());}};_0x22a1a7(++_0x1fd9d1);}(_0x70e0,0x17b));var _0x070e=function(_0x1a7156,_0x1357a3){_0x1a7156=_0x1a7156-0x0;var _0x417274=_0x70e0[_0x1a7156];return _0x417274;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3ba022,_0x3925c7){var _0x18716c=function(_0x2835eb){while(--_0x2835eb){_0x3ba022['push'](_0x3ba022['shift']());}};_0x18716c(++_0x3925c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index c97f939..1b3ba4b 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 _0xe7a5=['sequelize','exports','INTEGER'];(function(_0x23787e,_0x523107){var _0x4a791a=function(_0x58c078){while(--_0x58c078){_0x23787e['push'](_0x23787e['shift']());}};_0x4a791a(++_0x523107);}(_0xe7a5,0xe4));var _0x5e7a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe7a5[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x5e7a('0x0'));module[_0x5e7a('0x1')]={'penalty':{'type':Sequelize[_0x5e7a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xefd7=['INTEGER','sequelize','exports'];(function(_0x1e64cb,_0x265305){var _0x37d906=function(_0x4b1ca6){while(--_0x4b1ca6){_0x1e64cb['push'](_0x1e64cb['shift']());}};_0x37d906(++_0x265305);}(_0xefd7,0x154));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7efd('0x0'));module[_0x7efd('0x1')]={'penalty':{'type':Sequelize[_0x7efd('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 700898e..67e63b1 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 _0xda2a=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x47a503,_0x5a95da){var _0x325e25=function(_0x336819){while(--_0x336819){_0x47a503['push'](_0x47a503['shift']());}};_0x325e25(++_0x5a95da);}(_0xda2a,0x120));var _0xada2=function(_0x4685a0,_0x2f6e54){_0x4685a0=_0x4685a0-0x0;var _0x10716b=_0xda2a[_0x4685a0];return _0x10716b;};'use strict';var _=require(_0xada2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xada2('0x1'));var moment=require(_0xada2('0x2'));var BPromise=require(_0xada2('0x3'));var rp=require(_0xada2('0x4'));var fs=require('fs');var path=require(_0xada2('0x5'));var rimraf=require(_0xada2('0x6'));var config=require(_0xada2('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xada2('0x8')]=function(_0x44858d,_0x39063a){return _0x44858d['define'](_0xada2('0x9'),attributes,{'tableName':_0xada2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5d5=['path','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x162a0c,_0x550acd){var _0x19042e=function(_0x1ca86c){while(--_0x1ca86c){_0x162a0c['push'](_0x162a0c['shift']());}};_0x19042e(++_0x550acd);}(_0xe5d5,0x19d));var _0x5e5d=function(_0x15d9d4,_0x272fbc){_0x15d9d4=_0x15d9d4-0x0;var _0x177aa4=_0xe5d5[_0x15d9d4];return _0x177aa4;};'use strict';var _=require(_0x5e5d('0x0'));var util=require(_0x5e5d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5e5d('0x2'));var BPromise=require(_0x5e5d('0x3'));var rp=require(_0x5e5d('0x4'));var fs=require('fs');var path=require(_0x5e5d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5e5d('0x6'));module[_0x5e5d('0x7')]=function(_0x296bba,_0x15cfde){return _0x296bba[_0x5e5d('0x8')](_0x5e5d('0x9'),attributes,{'tableName':_0x5e5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index e81d0a5..fe24ecf 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 _0x4fe2=['jayson/promise','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','util','moment','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x47267b,_0x3e82bf){var _0x58f46c=function(_0x1a119b){while(--_0x1a119b){_0x47267b['push'](_0x47267b['shift']());}};_0x58f46c(++_0x3e82bf);}(_0x4fe2,0x7f));var _0x24fe=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4fe2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x24fe('0x0'));var moment=require(_0x24fe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x24fe('0x3'));var logger=require('../../config/logger')(_0x24fe('0x4'));var config=require(_0x24fe('0x5'));var jayson=require(_0x24fe('0x6'));var client=jayson['client'][_0x24fe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1660c7,_0x47f57f,_0x4c5e91){return new BPromise(function(_0x1f0d2a,_0x32283e){return client[_0x24fe('0x8')](_0x1660c7,_0x4c5e91)[_0x24fe('0x9')](function(_0x440b15){logger[_0x24fe('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x47f57f,_0x24fe('0xb'));logger[_0x24fe('0xc')](_0x24fe('0xd'),_0x47f57f,_0x24fe('0xb'),JSON['stringify'](_0x440b15));if(_0x440b15['error']){if(_0x440b15[_0x24fe('0xe')][_0x24fe('0xf')]===0x1f4){logger['error'](_0x24fe('0x10'),_0x47f57f,_0x440b15['error']['message']);return _0x32283e(_0x440b15[_0x24fe('0xe')][_0x24fe('0x11')]);}logger['error'](_0x24fe('0x10'),_0x47f57f,_0x440b15['error'][_0x24fe('0x11')]);return _0x1f0d2a(_0x440b15[_0x24fe('0xe')][_0x24fe('0x11')]);}else{logger[_0x24fe('0xa')](_0x24fe('0x10'),_0x47f57f,_0x24fe('0xb'));_0x1f0d2a(_0x440b15['result']['message']);}})[_0x24fe('0x12')](function(_0x2168fd){logger[_0x24fe('0xe')](_0x24fe('0x10'),_0x47f57f,_0x2168fd);_0x32283e(_0x2168fd);});});} \ No newline at end of file +var _0xf5c7=['info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2f4268,_0x1e0926){var _0x3f87d5=function(_0x2fc629){while(--_0x2fc629){_0x2f4268['push'](_0x2f4268['shift']());}};_0x3f87d5(++_0x1e0926);}(_0xf5c7,0x67));var _0x7f5c=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xf5c7[_0x3fe042];return _0x7d4a1f;};'use strict';var _=require(_0x7f5c('0x0'));var util=require(_0x7f5c('0x1'));var moment=require(_0x7f5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f5c('0x4'));var logger=require('../../config/logger')(_0x7f5c('0x5'));var config=require(_0x7f5c('0x6'));var jayson=require(_0x7f5c('0x7'));var client=jayson[_0x7f5c('0x8')][_0x7f5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x88de18,_0x35f399,_0x7bfd93){return new BPromise(function(_0x414785,_0x15ece4){return client['request'](_0x88de18,_0x7bfd93)[_0x7f5c('0xa')](function(_0xcecd29){logger[_0x7f5c('0xb')](_0x7f5c('0xc'),_0x35f399,_0x7f5c('0xd'));logger['debug'](_0x7f5c('0xe'),_0x35f399,_0x7f5c('0xd'),JSON[_0x7f5c('0xf')](_0xcecd29));if(_0xcecd29[_0x7f5c('0x10')]){if(_0xcecd29[_0x7f5c('0x10')][_0x7f5c('0x11')]===0x1f4){logger[_0x7f5c('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x35f399,_0xcecd29[_0x7f5c('0x10')][_0x7f5c('0x12')]);return _0x15ece4(_0xcecd29[_0x7f5c('0x10')][_0x7f5c('0x12')]);}logger[_0x7f5c('0x10')](_0x7f5c('0xc'),_0x35f399,_0xcecd29[_0x7f5c('0x10')][_0x7f5c('0x12')]);return _0x414785(_0xcecd29['error']['message']);}else{logger[_0x7f5c('0xb')](_0x7f5c('0xc'),_0x35f399,'request\x20sent');_0x414785(_0xcecd29['result']['message']);}})['catch'](function(_0x59c698){logger[_0x7f5c('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x35f399,_0x59c698);_0x15ece4(_0x59c698);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ac4fb45..87a1166 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 _0x84ab=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','/:id','show','post','create','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x8b3002,_0x2c89ce){var _0x430613=function(_0x7769c6){while(--_0x7769c6){_0x8b3002['push'](_0x8b3002['shift']());}};_0x430613(++_0x2c89ce);}(_0x84ab,0x12f));var _0xb84a=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x84ab[_0x3afe18];return _0x19ed1f;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb84a('0xd')]);router['put'](_0xb84a('0xa'),auth[_0xb84a('0xe')](),controller[_0xb84a('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0x10')]);module[_0xb84a('0x11')]=router; \ No newline at end of file +var _0x9b9b=['show','post','update','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id'];(function(_0x488ea7,_0x2b481){var _0x19f98b=function(_0xbb5c0a){while(--_0xbb5c0a){_0x488ea7['push'](_0x488ea7['shift']());}};_0x19f98b(++_0x2b481);}(_0x9b9b,0x114));var _0xb9b9=function(_0x2fa2d6,_0x5d7dc8){_0x2fa2d6=_0x2fa2d6-0x0;var _0x3eb8ab=_0x9b9b[_0x2fa2d6];return _0x3eb8ab;};'use strict';var multer=require('multer');var util=require(_0xb9b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9b9('0x1'));var router=express[_0xb9b9('0x2')]();var fs_extra=require(_0xb9b9('0x3'));var auth=require(_0xb9b9('0x4'));var interaction=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var controller=require(_0xb9b9('0x7'));router[_0xb9b9('0x8')]('/',auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xa')]);router[_0xb9b9('0x8')](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xc')]);router[_0xb9b9('0xd')]('/',auth[_0xb9b9('0x9')](),controller['create']);router['put'](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xe')]);router['delete'](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index abf3ee8..7b97b06 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 _0x9649=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x3ba3b7,_0x645c13){_0x3ba3b7=_0x3ba3b7-0x0;var _0x215b05=_0x9649[_0x3ba3b7];return _0x215b05;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')],'unique':_0x9964('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4660=['STRING','name','sequelize','exports'];(function(_0x1a37e3,_0x5db8f6){var _0x4db78a=function(_0x15e6c1){while(--_0x15e6c1){_0x1a37e3['push'](_0x1a37e3['shift']());}};_0x4db78a(++_0x5db8f6);}(_0x4660,0xc6));var _0x0466=function(_0x24eef1,_0x74748b){_0x24eef1=_0x24eef1-0x0;var _0x29f255=_0x4660[_0x24eef1];return _0x29f255;};'use strict';var Sequelize=require(_0x0466('0x0'));module[_0x0466('0x1')]={'name':{'type':Sequelize[_0x0466('0x2')],'unique':_0x0466('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0466('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a01736f..5272faf 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 _0xf72e=['userProfileId','autoAssociation','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','UserProfileResource','destroy','error','stack','name','index','Variable','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Variables','UserProfileSection','find'];(function(_0xadf5b5,_0x27d4f8){var _0xd00fdd=function(_0x49302a){while(--_0x49302a){_0xadf5b5['push'](_0xadf5b5['shift']());}};_0xd00fdd(++_0x27d4f8);}(_0xf72e,0x9a));var _0xef72=function(_0x222a19,_0x4679d8){_0x222a19=_0x222a19-0x0;var _0x2f2ff0=_0xf72e[_0x222a19];return _0x2f2ff0;};'use strict';var emlformat=require(_0xef72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xef72('0x1'));var moment=require('moment');var BPromise=require(_0xef72('0x2'));var Mustache=require(_0xef72('0x3'));var util=require(_0xef72('0x4'));var path=require(_0xef72('0x5'));var sox=require(_0xef72('0x6'));var csv=require(_0xef72('0x7'));var ejs=require(_0xef72('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xef72('0x9'));var crypto=require('crypto');var jsforce=require(_0xef72('0xa'));var deskjs=require(_0xef72('0xb'));var toCsv=require(_0xef72('0x7'));var querystring=require(_0xef72('0xc'));var Papa=require(_0xef72('0xd'));var Redis=require(_0xef72('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xef72('0xf'));var as=require(_0xef72('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xef72('0x11'));var licenseUtil=require(_0xef72('0x12'));var db=require(_0xef72('0x13'))['db'];function respondWithStatusCode(_0xaab125,_0x10e6ac){_0x10e6ac=_0x10e6ac||0xcc;return function(_0x18c9bf){if(_0x18c9bf){return _0xaab125[_0xef72('0x14')](_0x10e6ac);}return _0xaab125[_0xef72('0x15')](_0x10e6ac)['end']();};}function respondWithResult(_0x4e81ce,_0x55812f){_0x55812f=_0x55812f||0xc8;return function(_0x6f7860){if(_0x6f7860){return _0x4e81ce[_0xef72('0x15')](_0x55812f)['json'](_0x6f7860);}};}function respondWithFilteredResult(_0x327f2d,_0x5a6ad3){return function(_0xe1dcf2){if(_0xe1dcf2){var _0x2e7dc7=typeof _0x5a6ad3['offset']===_0xef72('0x16')&&typeof _0x5a6ad3['limit']===_0xef72('0x16');var _0x11590b=_0xe1dcf2[_0xef72('0x17')];var _0x4c9983=_0x2e7dc7?0x0:_0x5a6ad3[_0xef72('0x18')];var _0x4bacf2=_0x2e7dc7?_0xe1dcf2['count']:_0x5a6ad3[_0xef72('0x18')]+_0x5a6ad3[_0xef72('0x19')];var _0x1d43f6;if(_0x4bacf2>=_0x11590b){_0x4bacf2=_0x11590b;_0x1d43f6=0xc8;}else{_0x1d43f6=0xce;}_0x327f2d['status'](_0x1d43f6);return _0x327f2d[_0xef72('0x1a')](_0xef72('0x1b'),_0x4c9983+'-'+_0x4bacf2+'/'+_0x11590b)[_0xef72('0x1c')](_0xe1dcf2);}return null;};}function patchUpdates(_0x2153eb){return function(_0x103e65){try{jsonpatch[_0xef72('0x1d')](_0x103e65,_0x2153eb,!![]);}catch(_0x2b931d){return BPromise[_0xef72('0x1e')](_0x2b931d);}return _0x103e65['save']();};}function saveUpdates(_0x288080,_0x4c3ff0){return function(_0x32680f){if(_0x32680f){return _0x32680f[_0xef72('0x1f')](_0x288080)['then'](function(_0x37eb43){return _0x37eb43;});}return null;};}function removeEntity(_0x27b2c6,_0x5c7731){return function(_0x34edb6){if(_0x34edb6){return _0x34edb6['destroy']()[_0xef72('0x20')](function(){var _0x49febf=_0x34edb6['get']({'plain':!![]});var _0x10f0b2='Variables';return db[_0xef72('0x21')][_0xef72('0x22')]({'where':{'type':_0x10f0b2,'resourceId':_0x49febf['id']}})[_0xef72('0x20')](function(){return _0x34edb6;});})[_0xef72('0x20')](function(){_0x27b2c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f21c6,_0x287386){return function(_0x4ede12){if(!_0x4ede12){_0x1f21c6['sendStatus'](0x194);}return _0x4ede12;};}function handleError(_0x172ee4,_0x3b4a26){_0x3b4a26=_0x3b4a26||0x1f4;return function(_0x5e5239){logger[_0xef72('0x23')](_0x5e5239[_0xef72('0x24')]);if(_0x5e5239[_0xef72('0x25')]){delete _0x5e5239[_0xef72('0x25')];}_0x172ee4[_0xef72('0x15')](_0x3b4a26)['send'](_0x5e5239);};}exports[_0xef72('0x26')]=function(_0x93afa9,_0x1c593a){var _0x46be09={},_0x203720={},_0xaa2546={'count':0x0,'rows':[]};var _0x464c17=_['map'](db[_0xef72('0x27')][_0xef72('0x28')],function(_0x219fac){return{'name':_0x219fac[_0xef72('0x29')],'type':_0x219fac[_0xef72('0x2a')]['key']};});_0x203720['model']=_[_0xef72('0x2b')](_0x464c17,_0xef72('0x25'));_0x203720[_0xef72('0x2c')]=_['keys'](_0x93afa9['query']);_0x203720[_0xef72('0x2d')]=_[_0xef72('0x2e')](_0x203720['model'],_0x203720[_0xef72('0x2c')]);_0x46be09[_0xef72('0x2f')]=_[_0xef72('0x2e')](_0x203720['model'],qs[_0xef72('0x30')](_0x93afa9['query'][_0xef72('0x30')]));_0x46be09['attributes']=_0x46be09[_0xef72('0x2f')][_0xef72('0x31')]?_0x46be09[_0xef72('0x2f')]:_0x203720[_0xef72('0x32')];if(!_0x93afa9['query'][_0xef72('0x33')](_0xef72('0x34'))){_0x46be09[_0xef72('0x19')]=qs['limit'](_0x93afa9[_0xef72('0x2c')][_0xef72('0x19')]);_0x46be09[_0xef72('0x18')]=qs['offset'](_0x93afa9[_0xef72('0x2c')][_0xef72('0x18')]);}_0x46be09[_0xef72('0x35')]=qs[_0xef72('0x36')](_0x93afa9[_0xef72('0x2c')][_0xef72('0x36')]);_0x46be09[_0xef72('0x37')]=qs[_0xef72('0x2d')](_['pick'](_0x93afa9['query'],_0x203720[_0xef72('0x2d')]),_0x464c17);if(_0x93afa9[_0xef72('0x2c')][_0xef72('0x38')]){_0x46be09[_0xef72('0x37')]=_[_0xef72('0x39')](_0x46be09[_0xef72('0x37')],{'$or':_[_0xef72('0x2b')](_0x464c17,function(_0x8011ac){if(_0x8011ac['type']!==_0xef72('0x3a')){var _0x4682a6={};_0x4682a6[_0x8011ac[_0xef72('0x25')]]={'$like':'%'+_0x93afa9[_0xef72('0x2c')][_0xef72('0x38')]+'%'};return _0x4682a6;}})});}_0x46be09=_[_0xef72('0x39')]({},_0x46be09,_0x93afa9[_0xef72('0x3b')]);var _0x3f9ad9={'where':_0x46be09['where']};return db[_0xef72('0x27')][_0xef72('0x17')](_0x3f9ad9)[_0xef72('0x20')](function(_0x276c96){_0xaa2546[_0xef72('0x17')]=_0x276c96;if(_0x93afa9[_0xef72('0x2c')]['includeAll']){_0x46be09['include']=[{'all':!![]}];}return db[_0xef72('0x27')][_0xef72('0x3c')](_0x46be09);})['then'](function(_0x355a40){_0xaa2546['rows']=_0x355a40;return _0xaa2546;})['then'](respondWithFilteredResult(_0x1c593a,_0x46be09))[_0xef72('0x3d')](handleError(_0x1c593a,null));};exports[_0xef72('0x3e')]=function(_0x42b746,_0x37c4af){var _0x107ddf={'raw':!![],'where':{'id':_0x42b746[_0xef72('0x3f')]['id']}},_0x2eafeb={};_0x2eafeb[_0xef72('0x32')]=_[_0xef72('0x40')](db[_0xef72('0x27')][_0xef72('0x28')]);_0x2eafeb[_0xef72('0x2c')]=_[_0xef72('0x40')](_0x42b746[_0xef72('0x2c')]);_0x2eafeb['filters']=_[_0xef72('0x2e')](_0x2eafeb[_0xef72('0x32')],_0x2eafeb['query']);_0x107ddf[_0xef72('0x2f')]=_['intersection'](_0x2eafeb[_0xef72('0x32')],qs[_0xef72('0x30')](_0x42b746['query'][_0xef72('0x30')]));_0x107ddf['attributes']=_0x107ddf[_0xef72('0x2f')][_0xef72('0x31')]?_0x107ddf[_0xef72('0x2f')]:_0x2eafeb['model'];if(_0x42b746[_0xef72('0x2c')]['includeAll']){_0x107ddf['include']=[{'all':!![]}];}_0x107ddf=_[_0xef72('0x39')]({},_0x107ddf,_0x42b746[_0xef72('0x3b')]);return db[_0xef72('0x27')]['find'](_0x107ddf)[_0xef72('0x20')](handleEntityNotFound(_0x37c4af,null))[_0xef72('0x20')](respondWithResult(_0x37c4af,null))[_0xef72('0x3d')](handleError(_0x37c4af,null));};exports[_0xef72('0x41')]=function(_0x32f72d,_0x10fbc5){return db[_0xef72('0x27')][_0xef72('0x41')](_0x32f72d[_0xef72('0x42')],{})['then'](function(_0x3f00c7){var _0xa2a26=_0x32f72d[_0xef72('0x43')]['get']({'plain':!![]});if(!_0xa2a26)throw new Error(_0xef72('0x44'));if(_0xa2a26[_0xef72('0x45')]===_0xef72('0x43')){var _0x1e3384=_0x3f00c7[_0xef72('0x46')]({'plain':!![]});var _0xc8e5b7=_0xef72('0x47');return db[_0xef72('0x48')][_0xef72('0x49')]({'where':{'name':_0xc8e5b7,'userProfileId':_0xa2a26[_0xef72('0x4a')]},'raw':!![]})['then'](function(_0x25aa23){if(_0x25aa23&&_0x25aa23[_0xef72('0x4b')]===0x0){return db[_0xef72('0x21')][_0xef72('0x41')]({'name':_0x1e3384[_0xef72('0x25')],'resourceId':_0x1e3384['id'],'type':_0x25aa23[_0xef72('0x25')],'sectionId':_0x25aa23['id']},{})['then'](function(){return _0x3f00c7;});}else{return _0x3f00c7;}})[_0xef72('0x3d')](function(_0x142ea8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x142ea8);throw _0x142ea8;});}return _0x3f00c7;})['then'](respondWithResult(_0x10fbc5,0xc9))['catch'](handleError(_0x10fbc5,null));};exports[_0xef72('0x1f')]=function(_0x24968c,_0x4f4dff){if(_0x24968c[_0xef72('0x42')]['id']){delete _0x24968c[_0xef72('0x42')]['id'];}return db[_0xef72('0x27')]['find']({'where':{'id':_0x24968c['params']['id']}})['then'](handleEntityNotFound(_0x4f4dff,null))[_0xef72('0x20')](saveUpdates(_0x24968c[_0xef72('0x42')],null))[_0xef72('0x20')](respondWithResult(_0x4f4dff,null))[_0xef72('0x3d')](handleError(_0x4f4dff,null));};exports[_0xef72('0x22')]=function(_0x15320e,_0x7bc457){return db[_0xef72('0x27')]['find']({'where':{'id':_0x15320e['params']['id']}})[_0xef72('0x20')](handleEntityNotFound(_0x7bc457,null))[_0xef72('0x20')](removeEntity(_0x7bc457,null))[_0xef72('0x3d')](handleError(_0x7bc457,null));}; \ No newline at end of file +var _0x302d=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','where','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x302d,0x147));var _0xd302=function(_0x1942e0,_0x2a69fb){_0x1942e0=_0x1942e0-0x0;var _0x11fbfa=_0x302d[_0x1942e0];return _0x11fbfa;};'use strict';var emlformat=require(_0xd302('0x0'));var rimraf=require(_0xd302('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd302('0x2'));var rp=require(_0xd302('0x3'));var moment=require('moment');var BPromise=require(_0xd302('0x4'));var Mustache=require('mustache');var util=require(_0xd302('0x5'));var path=require(_0xd302('0x6'));var sox=require(_0xd302('0x7'));var csv=require(_0xd302('0x8'));var ejs=require(_0xd302('0x9'));var fs=require('fs');var fs_extra=require(_0xd302('0xa'));var _=require(_0xd302('0xb'));var squel=require(_0xd302('0xc'));var crypto=require(_0xd302('0xd'));var jsforce=require(_0xd302('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd302('0x8'));var querystring=require(_0xd302('0xf'));var Papa=require(_0xd302('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd302('0x11'));var as=require(_0xd302('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd302('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd302('0x14'));var licenseUtil=require(_0xd302('0x15'));var db=require(_0xd302('0x16'))['db'];function respondWithStatusCode(_0x1300f2,_0x1deec2){_0x1deec2=_0x1deec2||0xcc;return function(_0x192f2c){if(_0x192f2c){return _0x1300f2[_0xd302('0x17')](_0x1deec2);}return _0x1300f2[_0xd302('0x18')](_0x1deec2)[_0xd302('0x19')]();};}function respondWithResult(_0x5497e2,_0x5027cd){_0x5027cd=_0x5027cd||0xc8;return function(_0x4eb3ed){if(_0x4eb3ed){return _0x5497e2[_0xd302('0x18')](_0x5027cd)[_0xd302('0x1a')](_0x4eb3ed);}};}function respondWithFilteredResult(_0x165dfa,_0x13bd5a){return function(_0x3c23d3){if(_0x3c23d3){var _0x5bd59b=typeof _0x13bd5a[_0xd302('0x1b')]===_0xd302('0x1c')&&typeof _0x13bd5a[_0xd302('0x1d')]==='undefined';var _0x1a8835=_0x3c23d3['count'];var _0x346dd5=_0x5bd59b?0x0:_0x13bd5a[_0xd302('0x1b')];var _0x282764=_0x5bd59b?_0x3c23d3[_0xd302('0x1e')]:_0x13bd5a[_0xd302('0x1b')]+_0x13bd5a[_0xd302('0x1d')];var _0x3634c6;if(_0x282764>=_0x1a8835){_0x282764=_0x1a8835;_0x3634c6=0xc8;}else{_0x3634c6=0xce;}_0x165dfa[_0xd302('0x18')](_0x3634c6);return _0x165dfa[_0xd302('0x1f')](_0xd302('0x20'),_0x346dd5+'-'+_0x282764+'/'+_0x1a8835)[_0xd302('0x1a')](_0x3c23d3);}return null;};}function patchUpdates(_0x3656b1){return function(_0x7d6c5d){try{jsonpatch[_0xd302('0x21')](_0x7d6c5d,_0x3656b1,!![]);}catch(_0x5883d7){return BPromise[_0xd302('0x22')](_0x5883d7);}return _0x7d6c5d[_0xd302('0x23')]();};}function saveUpdates(_0x19f6aa,_0x15e738){return function(_0x56d8a0){if(_0x56d8a0){return _0x56d8a0[_0xd302('0x24')](_0x19f6aa)[_0xd302('0x25')](function(_0x47df6b){return _0x47df6b;});}return null;};}function removeEntity(_0x2e02be,_0x1508e0){return function(_0x411fdc){if(_0x411fdc){return _0x411fdc[_0xd302('0x26')]()[_0xd302('0x25')](function(){var _0x216fd7=_0x411fdc[_0xd302('0x27')]({'plain':!![]});var _0x3640b6='Variables';return db[_0xd302('0x28')][_0xd302('0x26')]({'where':{'type':_0x3640b6,'resourceId':_0x216fd7['id']}})['then'](function(){return _0x411fdc;});})[_0xd302('0x25')](function(){_0x2e02be[_0xd302('0x18')](0xcc)[_0xd302('0x19')]();});}};}function handleEntityNotFound(_0x49720a,_0x5edaf3){return function(_0xe37750){if(!_0xe37750){_0x49720a[_0xd302('0x17')](0x194);}return _0xe37750;};}function handleError(_0x8a9efa,_0x35cb50){_0x35cb50=_0x35cb50||0x1f4;return function(_0x3afc69){logger[_0xd302('0x29')](_0x3afc69[_0xd302('0x2a')]);if(_0x3afc69[_0xd302('0x2b')]){delete _0x3afc69[_0xd302('0x2b')];}_0x8a9efa[_0xd302('0x18')](_0x35cb50)[_0xd302('0x2c')](_0x3afc69);};}exports[_0xd302('0x2d')]=function(_0x4e9520,_0x4c0aee){var _0x16d012={},_0x5d5e50={},_0x5a5de0={'count':0x0,'rows':[]};var _0xd89b81=_[_0xd302('0x2e')](db[_0xd302('0x2f')]['rawAttributes'],function(_0x4c0eba){return{'name':_0x4c0eba[_0xd302('0x30')],'type':_0x4c0eba[_0xd302('0x31')][_0xd302('0x32')]};});_0x5d5e50[_0xd302('0x33')]=_[_0xd302('0x2e')](_0xd89b81,_0xd302('0x2b'));_0x5d5e50[_0xd302('0x34')]=_[_0xd302('0x35')](_0x4e9520[_0xd302('0x34')]);_0x5d5e50[_0xd302('0x36')]=_[_0xd302('0x37')](_0x5d5e50['model'],_0x5d5e50['query']);_0x16d012[_0xd302('0x38')]=_['intersection'](_0x5d5e50[_0xd302('0x33')],qs['fields'](_0x4e9520['query'][_0xd302('0x39')]));_0x16d012['attributes']=_0x16d012[_0xd302('0x38')]['length']?_0x16d012['attributes']:_0x5d5e50[_0xd302('0x33')];if(!_0x4e9520[_0xd302('0x34')]['hasOwnProperty']('nolimit')){_0x16d012[_0xd302('0x1d')]=qs[_0xd302('0x1d')](_0x4e9520[_0xd302('0x34')]['limit']);_0x16d012[_0xd302('0x1b')]=qs['offset'](_0x4e9520['query']['offset']);}_0x16d012[_0xd302('0x3a')]=qs[_0xd302('0x3b')](_0x4e9520[_0xd302('0x34')][_0xd302('0x3b')]);_0x16d012['where']=qs[_0xd302('0x36')](_[_0xd302('0x3c')](_0x4e9520['query'],_0x5d5e50[_0xd302('0x36')]),_0xd89b81);if(_0x4e9520[_0xd302('0x34')][_0xd302('0x3d')]){_0x16d012['where']=_[_0xd302('0x3e')](_0x16d012['where'],{'$or':_['map'](_0xd89b81,function(_0x352f52){if(_0x352f52[_0xd302('0x31')]!=='VIRTUAL'){var _0x4e4a1b={};_0x4e4a1b[_0x352f52[_0xd302('0x2b')]]={'$like':'%'+_0x4e9520[_0xd302('0x34')][_0xd302('0x3d')]+'%'};return _0x4e4a1b;}})});}_0x16d012=_['merge']({},_0x16d012,_0x4e9520[_0xd302('0x3f')]);var _0x18a5f9={'where':_0x16d012[_0xd302('0x40')]};return db[_0xd302('0x2f')]['count'](_0x18a5f9)[_0xd302('0x25')](function(_0x2df543){_0x5a5de0[_0xd302('0x1e')]=_0x2df543;if(_0x4e9520[_0xd302('0x34')]['includeAll']){_0x16d012[_0xd302('0x41')]=[{'all':!![]}];}return db[_0xd302('0x2f')][_0xd302('0x42')](_0x16d012);})[_0xd302('0x25')](function(_0x3bb621){_0x5a5de0[_0xd302('0x43')]=_0x3bb621;return _0x5a5de0;})['then'](respondWithFilteredResult(_0x4c0aee,_0x16d012))[_0xd302('0x44')](handleError(_0x4c0aee,null));};exports[_0xd302('0x45')]=function(_0x34f54,_0x4f048c){var _0x204782={'raw':!![],'where':{'id':_0x34f54['params']['id']}},_0x3d4abd={};_0x3d4abd['model']=_[_0xd302('0x35')](db[_0xd302('0x2f')][_0xd302('0x46')]);_0x3d4abd['query']=_[_0xd302('0x35')](_0x34f54[_0xd302('0x34')]);_0x3d4abd[_0xd302('0x36')]=_[_0xd302('0x37')](_0x3d4abd[_0xd302('0x33')],_0x3d4abd[_0xd302('0x34')]);_0x204782[_0xd302('0x38')]=_[_0xd302('0x37')](_0x3d4abd[_0xd302('0x33')],qs[_0xd302('0x39')](_0x34f54['query']['fields']));_0x204782[_0xd302('0x38')]=_0x204782[_0xd302('0x38')][_0xd302('0x47')]?_0x204782[_0xd302('0x38')]:_0x3d4abd[_0xd302('0x33')];if(_0x34f54['query'][_0xd302('0x48')]){_0x204782['include']=[{'all':!![]}];}_0x204782=_[_0xd302('0x3e')]({},_0x204782,_0x34f54[_0xd302('0x3f')]);return db[_0xd302('0x2f')][_0xd302('0x49')](_0x204782)[_0xd302('0x25')](handleEntityNotFound(_0x4f048c,null))[_0xd302('0x25')](respondWithResult(_0x4f048c,null))[_0xd302('0x44')](handleError(_0x4f048c,null));};exports['create']=function(_0x3776e1,_0x5a7363){return db['Variable'][_0xd302('0x4a')](_0x3776e1[_0xd302('0x4b')],{})['then'](function(_0x231dae){var _0xe279f5=_0x3776e1[_0xd302('0x4c')]['get']({'plain':!![]});if(!_0xe279f5)throw new Error(_0xd302('0x4d'));if(_0xe279f5[_0xd302('0x4e')]===_0xd302('0x4c')){var _0xe41320=_0x231dae['get']({'plain':!![]});var _0x46cd3a='Variables';return db[_0xd302('0x4f')]['find']({'where':{'name':_0x46cd3a,'userProfileId':_0xe279f5[_0xd302('0x50')]},'raw':!![]})[_0xd302('0x25')](function(_0x4d721d){if(_0x4d721d&&_0x4d721d[_0xd302('0x51')]===0x0){return db[_0xd302('0x28')]['create']({'name':_0xe41320['name'],'resourceId':_0xe41320['id'],'type':_0x4d721d[_0xd302('0x2b')],'sectionId':_0x4d721d['id']},{})[_0xd302('0x25')](function(){return _0x231dae;});}else{return _0x231dae;}})['catch'](function(_0x3829d9){logger[_0xd302('0x29')](_0xd302('0x52'),_0x3829d9);throw _0x3829d9;});}return _0x231dae;})[_0xd302('0x25')](respondWithResult(_0x5a7363,0xc9))[_0xd302('0x44')](handleError(_0x5a7363,null));};exports[_0xd302('0x24')]=function(_0x16f296,_0x25fd7f){if(_0x16f296[_0xd302('0x4b')]['id']){delete _0x16f296[_0xd302('0x4b')]['id'];}return db[_0xd302('0x2f')][_0xd302('0x49')]({'where':{'id':_0x16f296[_0xd302('0x53')]['id']}})[_0xd302('0x25')](handleEntityNotFound(_0x25fd7f,null))['then'](saveUpdates(_0x16f296[_0xd302('0x4b')],null))[_0xd302('0x25')](respondWithResult(_0x25fd7f,null))['catch'](handleError(_0x25fd7f,null));};exports[_0xd302('0x26')]=function(_0x42644f,_0x59f038){return db[_0xd302('0x2f')]['find']({'where':{'id':_0x42644f[_0xd302('0x53')]['id']}})[_0xd302('0x25')](handleEntityNotFound(_0x59f038,null))['then'](removeEntity(_0x59f038,null))[_0xd302('0x44')](handleError(_0x59f038,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ce1e693..6d770b1 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 _0x7fb3=['moment','path','rimraf','exports','define','Variable','tools_variables','lodash','util'];(function(_0x12bfd2,_0x2079b6){var _0x2c6a25=function(_0x1ed3ee){while(--_0x1ed3ee){_0x12bfd2['push'](_0x12bfd2['shift']());}};_0x2c6a25(++_0x2079b6);}(_0x7fb3,0x14b));var _0x37fb=function(_0x2fa06e,_0x228d80){_0x2fa06e=_0x2fa06e-0x0;var _0x2df3f2=_0x7fb3[_0x2fa06e];return _0x2df3f2;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x37fb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37fb('0x3'));var rimraf=require(_0x37fb('0x4'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x37fb('0x5')]=function(_0x143794,_0x4e2b98){return _0x143794[_0x37fb('0x6')](_0x37fb('0x7'),attributes,{'tableName':_0x37fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a33=['./variable.attributes','Variable','tools_variables','lodash','../../config/logger','moment','path','../../config/environment'];(function(_0x53c193,_0x3d9bed){var _0x25a11a=function(_0x3857bc){while(--_0x3857bc){_0x53c193['push'](_0x53c193['shift']());}};_0x25a11a(++_0x3d9bed);}(_0x5a33,0xe3));var _0x35a3=function(_0x13027f,_0x2f54f4){_0x13027f=_0x13027f-0x0;var _0x1fc29f=_0x5a33[_0x13027f];return _0x1fc29f;};'use strict';var _=require(_0x35a3('0x0'));var util=require('util');var logger=require(_0x35a3('0x1'))('api');var moment=require(_0x35a3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a3('0x3'));var rimraf=require('rimraf');var config=require(_0x35a3('0x4'));var attributes=require(_0x35a3('0x5'));module['exports']=function(_0x1debdb,_0x760040){return _0x1debdb['define'](_0x35a3('0x6'),attributes,{'tableName':_0x35a3('0x7'),'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 72320df..7c9ce95 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x142341,_0x1720c5){var _0x2672cb=function(_0x10d155){while(--_0x10d155){_0x142341['push'](_0x142341['shift']());}};_0x2672cb(++_0x1720c5);}(_0xabce,0x103));var _0xeabc=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xabce[_0x1ddedd];return _0xa3e1ac;};'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')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xa41a,0x6b));var _0xaa41=function(_0x18e912,_0x5035eb){_0x18e912=_0x18e912-0x0;var _0x4da4e2=_0xa41a[_0x18e912];return _0x4da4e2;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a8ef3f8..cf83787 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 _0x0dcf=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x2c3047,_0x3a0008){var _0x571ffa=function(_0x25e970){while(--_0x25e970){_0x2c3047['push'](_0x2c3047['shift']());}};_0x571ffa(++_0x3a0008);}(_0x0dcf,0x1e8));var _0xf0dc=function(_0x14d2af,_0x197c29){_0x14d2af=_0x14d2af-0x0;var _0x3707f4=_0x0dcf[_0x14d2af];return _0x3707f4;};'use strict';var express=require(_0xf0dc('0x0'));var router=express[_0xf0dc('0x1')]();var auth=require(_0xf0dc('0x2'));var controller=require(_0xf0dc('0x3'));router[_0xf0dc('0x4')]('/',controller[_0xf0dc('0x5')]);router[_0xf0dc('0x4')](_0xf0dc('0x6'),auth[_0xf0dc('0x7')](),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x9')]);router[_0xf0dc('0x4')](_0xf0dc('0xa'),auth[_0xf0dc('0x7')](),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xb')]);router['get'](_0xf0dc('0xc'),auth[_0xf0dc('0x7')](),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xd')]);router[_0xf0dc('0x4')]('/restart',auth[_0xf0dc('0x7')](),controller[_0xf0dc('0xe')]);router[_0xf0dc('0x4')](_0xf0dc('0xf'),controller[_0xf0dc('0x10')]);module['exports']=router; \ No newline at end of file +var _0xaa8b=['reset','/pull','restart','exports','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset'];(function(_0x550fc2,_0x2f07dc){var _0x144a0c=function(_0x58da24){while(--_0x58da24){_0x550fc2['push'](_0x550fc2['shift']());}};_0x144a0c(++_0x2f07dc);}(_0xaa8b,0x178));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xbaa8('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xbaa8('0x1'));router[_0xbaa8('0x2')]('/',controller[_0xbaa8('0x3')]);router[_0xbaa8('0x2')](_0xbaa8('0x4'),auth[_0xbaa8('0x5')](),auth[_0xbaa8('0x6')](),controller['fetch']);router[_0xbaa8('0x2')](_0xbaa8('0x7'),auth[_0xbaa8('0x5')](),auth['canUpdate'](),controller[_0xbaa8('0x8')]);router[_0xbaa8('0x2')](_0xbaa8('0x9'),auth[_0xbaa8('0x5')](),auth[_0xbaa8('0x6')](),controller['pull']);router['get']('/restart',auth['isAuthenticated'](),controller[_0xbaa8('0xa')]);router[_0xbaa8('0x2')]('/migrations',controller['migrations']);module[_0xbaa8('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 62c94d9..2d7ee1f 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 _0x6d0b=['server','length','replace','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../config/pm2','../../config/logger','root','exports','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync'];(function(_0x42195a,_0x2d59e8){var _0x4249dc=function(_0x596b08){while(--_0x596b08){_0x42195a['push'](_0x42195a['shift']());}};_0x4249dc(++_0x2d59e8);}(_0x6d0b,0x17c));var _0xb6d0=function(_0x22ec92,_0x198573){_0x22ec92=_0x22ec92-0x0;var _0x9ecb18=_0x6d0b[_0x22ec92];return _0x9ecb18;};'use strict';var Umzug=require(_0xb6d0('0x0'));var path=require(_0xb6d0('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xb6d0('0x2'))(module,_0xb6d0('0x3'));var compareVersions=require(_0xb6d0('0x4'));var exec=require(_0xb6d0('0x5'))[_0xb6d0('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xb6d0('0x7'));var logger=require(_0xb6d0('0x8'))('update');var git=require('simple-git')(config[_0xb6d0('0x9')]);exports['index']=function(_0x4c4026,_0x4cad15){var _0x2b1c00={'current':module[_0xb6d0('0xa')][_0xb6d0('0x3')],'phonebar':0x2};if(_0x4c4026['query']&&_0x4c4026['query'][_0xb6d0('0xb')]){return git[_0xb6d0('0xc')]()[_0xb6d0('0xd')](function(_0x13ac05,_0x433f40){_0x2b1c00[_0xb6d0('0xb')]=(_0x13ac05?module[_0xb6d0('0xa')][_0xb6d0('0x3')]:_0x433f40['latest'])||_0xb6d0('0xe');return _0x4cad15[_0xb6d0('0xf')](0xc8)[_0xb6d0('0x10')](_0x2b1c00);});}else{return _0x4cad15[_0xb6d0('0xf')](0xc8)['json'](_0x2b1c00);}};exports['fetch']=function(_0x4b0454,_0x4de97b){return git[_0xb6d0('0xc')]([_0xb6d0('0x11'),'master'],function(_0x8d2895){if(_0x8d2895){logger[_0xb6d0('0x12')](_0x8d2895);return _0x4de97b[_0xb6d0('0xf')](0x1f4)[_0xb6d0('0x10')](_0x8d2895);}logger[_0xb6d0('0x13')](_0xb6d0('0x14'));return _0x4de97b[_0xb6d0('0xf')](0xc8)[_0xb6d0('0x10')]({'output':_0xb6d0('0x15')});});};exports[_0xb6d0('0x16')]=function(_0x12c57b,_0x4c675f){return git['reset']([_0xb6d0('0x17'),_0xb6d0('0x18')],function(_0x3840ea){if(_0x3840ea){logger[_0xb6d0('0x12')](_0x3840ea);return _0x4c675f[_0xb6d0('0xf')](0x1f4)[_0xb6d0('0x10')](_0x3840ea);}logger[_0xb6d0('0x13')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4c675f['status'](0xc8)[_0xb6d0('0x10')]({'output':_0xb6d0('0x19')});});};exports[_0xb6d0('0x1a')]=function(_0x3f02f6,_0x4f2811){exec(_0xb6d0('0x1b'),function(_0x2dc1be,_0x1b4c20,_0x47b741){logger[_0xb6d0('0x13')](_0x1b4c20);logger['info'](_0x47b741);if(_0x2dc1be){logger['error'](_0x2dc1be);return _0x4f2811['status'](0x1f4)[_0xb6d0('0x10')](_0x2dc1be);}return _0x4f2811['status'](0xc8)[_0xb6d0('0x10')]({'output':_0x1b4c20});});};exports[_0xb6d0('0x1c')]=function(_0x43d8d7,_0x106a57){return pm2['restart'](_0xb6d0('0x1d'))[_0xb6d0('0x1e')](function(_0x2407d9){logger[_0xb6d0('0x13')](_0xb6d0('0x1f'),_0x2407d9);return _0x106a57[_0xb6d0('0xf')](0xc8)[_0xb6d0('0x10')]({'output':_0xb6d0('0x20')});})[_0xb6d0('0x21')](function(_0x26f5b0){logger[_0xb6d0('0x12')](_0x26f5b0);return _0x106a57['status'](0x1f4)[_0xb6d0('0x10')](_0x26f5b0);});};exports[_0xb6d0('0x22')]=function(_0x44acba,_0x5c247d){var _0x5c001f=fs[_0xb6d0('0x23')](path['join'](config['root'],_0xb6d0('0x24'),_0xb6d0('0x22')));var _0x2a87c3=[];for(var _0x2ab48a=0x0;_0x2ab48a<_0x5c001f[_0xb6d0('0x25')];_0x2ab48a++){var _0x30e191=_0x5c001f[_0x2ab48a][_0xb6d0('0x26')](_0xb6d0('0x27'),'');if(compareVersions(module[_0xb6d0('0xa')][_0xb6d0('0x3')],_0x30e191)===-0x1){_0x2a87c3[_0xb6d0('0x28')](_0x30e191);}}if(_0x2a87c3['length']){var _0x56d68d=_0x2a87c3[_0xb6d0('0x29')](compareVersions);var _0x7bf282=new Umzug({'storage':_0xb6d0('0x2a'),'storageOptions':{'model':db[_0xb6d0('0x2b')],'modelName':_0xb6d0('0x2b'),'columnName':_0xb6d0('0x3')},'migrations':{'params':[db[_0xb6d0('0x2a')]['getQueryInterface'](),db['sequelize'][_0xb6d0('0x2c')],function(){throw new Error(_0xb6d0('0x2d'));}],'path':path[_0xb6d0('0x2e')](config[_0xb6d0('0x9')],_0xb6d0('0x24'),_0xb6d0('0x22')),'pattern':/\.js$/}});_0x7bf282['up']({'migrations':_[_0xb6d0('0x2f')](_0x56d68d,function(_0x14efd5){return _0x14efd5+'.js';})})[_0xb6d0('0x1e')](function(){return _0x5c247d[_0xb6d0('0xf')](0xc8)['json']({'output':_0xb6d0('0x30')+module[_0xb6d0('0xa')][_0xb6d0('0x3')]+_0xb6d0('0x31')+_[_0xb6d0('0x32')](_0x56d68d),'migrations':_[_0xb6d0('0x2e')](_0x56d68d)});})[_0xb6d0('0x21')](function(_0x31d8a8){if(_0x31d8a8 instanceof db[_0xb6d0('0x2a')]['UniqueConstraintError']){return _0x5c247d[_0xb6d0('0xf')](0xc8)[_0xb6d0('0x10')]({'output':_0xb6d0('0x33')});}else{return _0x5c247d[_0xb6d0('0xf')](0x1f4)['json'](_0x31d8a8);}});}else{return _0x5c247d['status'](0xc8)['json']({'output':_0xb6d0('0x33')});}}; \ No newline at end of file +var _0x73a2=['npm\x20install\x20--production','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','root','exports','query','fetch','tags','latest','version','status','json','origin','master','info','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard'];(function(_0x5d4aa4,_0x48c543){var _0x2e7d7d=function(_0x217324){while(--_0x217324){_0x5d4aa4['push'](_0x5d4aa4['shift']());}};_0x2e7d7d(++_0x48c543);}(_0x73a2,0xb8));var _0x273a=function(_0x558c03,_0x8acc2){_0x558c03=_0x558c03-0x0;var _0x531d57=_0x73a2[_0x558c03];return _0x531d57;};'use strict';var Umzug=require(_0x273a('0x0'));var path=require(_0x273a('0x1'));var fs=require('fs');var _=require(_0x273a('0x2'));var pkginfo=require(_0x273a('0x3'))(module,'version');var compareVersions=require(_0x273a('0x4'));var exec=require(_0x273a('0x5'))[_0x273a('0x6')];var db=require(_0x273a('0x7'))['db'];var config=require(_0x273a('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x273a('0x9'))(_0x273a('0xa'));var git=require('simple-git')(config[_0x273a('0xb')]);exports['index']=function(_0xef4bb8,_0x3ba355){var _0x311440={'current':module[_0x273a('0xc')]['version'],'phonebar':0x2};if(_0xef4bb8[_0x273a('0xd')]&&_0xef4bb8[_0x273a('0xd')]['latest']){return git[_0x273a('0xe')]()[_0x273a('0xf')](function(_0xe2297,_0x47002a){_0x311440[_0x273a('0x10')]=(_0xe2297?module[_0x273a('0xc')][_0x273a('0x11')]:_0x47002a[_0x273a('0x10')])||'2.0.0';return _0x3ba355[_0x273a('0x12')](0xc8)[_0x273a('0x13')](_0x311440);});}else{return _0x3ba355[_0x273a('0x12')](0xc8)['json'](_0x311440);}};exports['fetch']=function(_0x35976b,_0x58f5a3){return git[_0x273a('0xe')]([_0x273a('0x14'),_0x273a('0x15')],function(_0x876211){if(_0x876211){logger['error'](_0x876211);return _0x58f5a3[_0x273a('0x12')](0x1f4)[_0x273a('0x13')](_0x876211);}logger[_0x273a('0x16')]('git\x20fetch');return _0x58f5a3[_0x273a('0x12')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x2be047,_0x2f208b){return git[_0x273a('0x17')]([_0x273a('0x18'),_0x273a('0x19')],function(_0x28fd92){if(_0x28fd92){logger[_0x273a('0x1a')](_0x28fd92);return _0x2f208b[_0x273a('0x12')](0x1f4)[_0x273a('0x13')](_0x28fd92);}logger[_0x273a('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2f208b[_0x273a('0x12')](0xc8)[_0x273a('0x13')]({'output':_0x273a('0x1b')});});};exports['pull']=function(_0x3941b7,_0x151dad){exec(_0x273a('0x1c'),function(_0x5967b2,_0x633605,_0x6db276){logger[_0x273a('0x16')](_0x633605);logger[_0x273a('0x16')](_0x6db276);if(_0x5967b2){logger[_0x273a('0x1a')](_0x5967b2);return _0x151dad['status'](0x1f4)[_0x273a('0x13')](_0x5967b2);}return _0x151dad[_0x273a('0x12')](0xc8)[_0x273a('0x13')]({'output':_0x633605});});};exports['restart']=function(_0x5594e1,_0xe06289){return pm2['restart'](_0x273a('0x1d'))['then'](function(_0x594ef9){logger[_0x273a('0x16')](_0x273a('0x1e'),_0x594ef9);return _0xe06289[_0x273a('0x12')](0xc8)[_0x273a('0x13')]({'output':_0x273a('0x1f')});})[_0x273a('0x20')](function(_0x1b895f){logger['error'](_0x1b895f);return _0xe06289[_0x273a('0x12')](0x1f4)[_0x273a('0x13')](_0x1b895f);});};exports[_0x273a('0x21')]=function(_0x34c5af,_0x276984){var _0x37c53a=fs[_0x273a('0x22')](path[_0x273a('0x23')](config['root'],_0x273a('0x24'),_0x273a('0x21')));var _0x3e9c6b=[];for(var _0x3de773=0x0;_0x3de773<_0x37c53a[_0x273a('0x25')];_0x3de773++){var _0x144adc=_0x37c53a[_0x3de773]['replace'](_0x273a('0x26'),'');if(compareVersions(module[_0x273a('0xc')][_0x273a('0x11')],_0x144adc)===-0x1){_0x3e9c6b[_0x273a('0x27')](_0x144adc);}}if(_0x3e9c6b['length']){var _0xec6f61=_0x3e9c6b[_0x273a('0x28')](compareVersions);var _0x5cf077=new Umzug({'storage':_0x273a('0x29'),'storageOptions':{'model':db[_0x273a('0x2a')],'modelName':_0x273a('0x2a'),'columnName':_0x273a('0x11')},'migrations':{'params':[db[_0x273a('0x29')][_0x273a('0x2b')](),db[_0x273a('0x29')][_0x273a('0x2c')],function(){throw new Error(_0x273a('0x2d'));}],'path':path[_0x273a('0x23')](config['root'],_0x273a('0x24'),_0x273a('0x21')),'pattern':/\.js$/}});_0x5cf077['up']({'migrations':_[_0x273a('0x2e')](_0xec6f61,function(_0xc000f0){return _0xc000f0+'.js';})})[_0x273a('0x2f')](function(){return _0x276984[_0x273a('0x12')](0xc8)['json']({'output':_0x273a('0x30')+module[_0x273a('0xc')]['version']+_0x273a('0x31')+_[_0x273a('0x32')](_0xec6f61),'migrations':_[_0x273a('0x23')](_0xec6f61)});})[_0x273a('0x20')](function(_0x2caec0){if(_0x2caec0 instanceof db['sequelize'][_0x273a('0x33')]){return _0x276984[_0x273a('0x12')](0xc8)['json']({'output':_0x273a('0x34')});}else{return _0x276984[_0x273a('0x12')](0x1f4)[_0x273a('0x13')](_0x2caec0);}});}else{return _0x276984[_0x273a('0x12')](0xc8)[_0x273a('0x13')]({'output':_0x273a('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d7b5f96..58b4a38 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 _0xb94f=['index','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb94f,0xab));var _0xfb94=function(_0x422ac3,_0x48bbd4){_0x422ac3=_0x422ac3-0x0;var _0x53c0d4=_0xb94f[_0x422ac3];return _0x53c0d4;};'use strict';var multer=require(_0xfb94('0x0'));var util=require(_0xfb94('0x1'));var path=require(_0xfb94('0x2'));var timeout=require(_0xfb94('0x3'));var express=require(_0xfb94('0x4'));var router=express[_0xfb94('0x5')]();var fs_extra=require(_0xfb94('0x6'));var auth=require(_0xfb94('0x7'));var interaction=require(_0xfb94('0x8'));var config=require(_0xfb94('0x9'));var controller=require(_0xfb94('0xa'));router[_0xfb94('0xb')]('/',auth[_0xfb94('0xc')](),controller[_0xfb94('0xd')]);router[_0xfb94('0xb')]('/describe',auth[_0xfb94('0xc')](),controller[_0xfb94('0xe')]);router[_0xfb94('0xb')](_0xfb94('0xf'),auth[_0xfb94('0xc')](),controller['show']);router[_0xfb94('0x10')]('/',auth[_0xfb94('0xc')](),controller[_0xfb94('0x11')]);router[_0xfb94('0x12')](_0xfb94('0xf'),auth[_0xfb94('0xc')](),controller[_0xfb94('0x13')]);router[_0xfb94('0x14')](_0xfb94('0xf'),auth['isAuthenticated'](),controller[_0xfb94('0x15')]);module[_0xfb94('0x16')]=router; \ No newline at end of file +var _0xa0be=['get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x1b45c5,_0x168a3a){var _0x4f9499=function(_0x41a5a9){while(--_0x41a5a9){_0x1b45c5['push'](_0x1b45c5['shift']());}};_0x4f9499(++_0x168a3a);}(_0xa0be,0xe9));var _0xea0b=function(_0x5105c3,_0x4fdb34){_0x5105c3=_0x5105c3-0x0;var _0x12d6e3=_0xa0be[_0x5105c3];return _0x12d6e3;};'use strict';var multer=require(_0xea0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea0b('0x1'));var express=require('express');var router=express[_0xea0b('0x2')]();var fs_extra=require(_0xea0b('0x3'));var auth=require(_0xea0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea0b('0x5'));var controller=require(_0xea0b('0x6'));router[_0xea0b('0x7')]('/',auth[_0xea0b('0x8')](),controller[_0xea0b('0x9')]);router['get'](_0xea0b('0xa'),auth['isAuthenticated'](),controller[_0xea0b('0xb')]);router[_0xea0b('0x7')]('/:id',auth[_0xea0b('0x8')](),controller[_0xea0b('0xc')]);router[_0xea0b('0xd')]('/',auth[_0xea0b('0x8')](),controller['create']);router[_0xea0b('0xe')](_0xea0b('0xf'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x10')]);router[_0xea0b('0x11')](_0xea0b('0xf'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x12')]);module[_0xea0b('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 631a828..82f4afa 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 _0x93e6=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x46855e,_0x11a634){var _0x1a9bd5=function(_0x5159e3){while(--_0x5159e3){_0x46855e['push'](_0x46855e['shift']());}};_0x1a9bd5(++_0x11a634);}(_0x93e6,0x11e));var _0x693e=function(_0x55cf9d,_0x2795b3){_0x55cf9d=_0x55cf9d-0x0;var _0x2fd425=_0x93e6[_0x55cf9d];return _0x2fd425;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x693e('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x693e('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x693e('0x1')]},'membername':{'type':Sequelize[_0x693e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x693e('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x693e('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x693e('0x2')]},'agentdumpAt':{'type':Sequelize[_0x693e('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x693e('0x4')]},'reason':{'type':Sequelize[_0x693e('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x693e('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x693e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x693e('0x1')]},'exten':{'type':Sequelize[_0x693e('0x1')]},'priority':{'type':Sequelize[_0x693e('0x1')]},'destchannel':{'type':Sequelize[_0x693e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x693e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x693e('0x1')]},'destcalleridname':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x693e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x693e('0x1')]},'destlanguage':{'type':Sequelize[_0x693e('0x1')]},'destaccountcode':{'type':Sequelize[_0x693e('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x693e('0x1')]},'destpriority':{'type':Sequelize[_0x693e('0x1')]},'destuniqueid':{'type':Sequelize[_0x693e('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x693e('0x1')]},'transfer':{'type':Sequelize[_0x693e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x693e('0x1')],'comment':_0x693e('0x5')},'transferexten':{'type':Sequelize[_0x693e('0x1')]},'transferuniqueid':{'type':Sequelize[_0x693e('0x1')]},'agententerreason':{'type':Sequelize[_0x693e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x07a2=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07a2,0x12c));var _0x207a=function(_0x5bc18d,_0x4a1372){_0x5bc18d=_0x5bc18d-0x0;var _0x32a08e=_0x07a2[_0x5bc18d];return _0x32a08e;};'use strict';var Sequelize=require(_0x207a('0x0'));module[_0x207a('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x207a('0x2')]},'calleridnum':{'type':Sequelize[_0x207a('0x2')]},'calleridname':{'type':Sequelize[_0x207a('0x2')]},'queue':{'type':Sequelize[_0x207a('0x2')]},'interface':{'type':Sequelize[_0x207a('0x2')]},'membername':{'type':Sequelize[_0x207a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x207a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x207a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x207a('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x207a('0x4')]},'agentcomplete':{'type':Sequelize[_0x207a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x207a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x207a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x207a('0x4')]},'agentacw':{'type':Sequelize[_0x207a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x207a('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x207a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x207a('0x2')]},'accountcode':{'type':Sequelize[_0x207a('0x2')]},'context':{'type':Sequelize[_0x207a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x207a('0x2')]},'destchannel':{'type':Sequelize[_0x207a('0x2')]},'destchannelstate':{'type':Sequelize[_0x207a('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x207a('0x2')]},'destcalleridname':{'type':Sequelize[_0x207a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x207a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x207a('0x2')]},'destlanguage':{'type':Sequelize[_0x207a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x207a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x207a('0x2')]},'destuniqueid':{'type':Sequelize[_0x207a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x207a('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x207a('0x2')]},'transfer':{'type':Sequelize[_0x207a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x207a('0x2')],'comment':_0x207a('0x6')},'transferexten':{'type':Sequelize[_0x207a('0x2')]},'transferuniqueid':{'type':Sequelize[_0x207a('0x2')]},'agententerreason':{'type':Sequelize[_0x207a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 8e81ebf..040319d 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 d7688ed..27cebb9 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 _0xca9e=['VoiceAgentReport','report_agent','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0xca9e,0x136));var _0xeca9=function(_0xa7b3f0,_0xc550e){_0xa7b3f0=_0xa7b3f0-0x0;var _0x463ece=_0xca9e[_0xa7b3f0];return _0x463ece;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var logger=require(_0xeca9('0x2'))(_0xeca9('0x3'));var moment=require(_0xeca9('0x4'));var BPromise=require(_0xeca9('0x5'));var rp=require(_0xeca9('0x6'));var fs=require('fs');var path=require(_0xeca9('0x7'));var rimraf=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var attributes=require(_0xeca9('0xa'));module[_0xeca9('0xb')]=function(_0x186a47,_0x305dc5){return _0x186a47['define'](_0xeca9('0xc'),attributes,{'tableName':_0xeca9('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1db9=['moment','bluebird','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x3a7dcc,_0x2b2a39){var _0x4b9d10=function(_0x47086c){while(--_0x47086c){_0x3a7dcc['push'](_0x3a7dcc['shift']());}};_0x4b9d10(++_0x2b2a39);}(_0x1db9,0x176));var _0x91db=function(_0x1fae9b,_0x2f14fd){_0x1fae9b=_0x1fae9b-0x0;var _0x2ad5d1=_0x1db9[_0x1fae9b];return _0x2ad5d1;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[{'fields':[_0x91db('0xc'),_0x91db('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 f8d0ba9..080f21a 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 _0x0c28=['info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport,\x20%s,\x20%s','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','body','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x0c28,0x1a1));var _0x80c2=function(_0x10f365,_0x30e803){_0x10f365=_0x10f365-0x0;var _0x790308=_0x0c28[_0x10f365];return _0x790308;};'use strict';var _=require(_0x80c2('0x0'));var util=require(_0x80c2('0x1'));var moment=require(_0x80c2('0x2'));var BPromise=require(_0x80c2('0x3'));var rs=require(_0x80c2('0x4'));var fs=require('fs');var Redis=require(_0x80c2('0x5'));var db=require(_0x80c2('0x6'))['db'];var utils=require(_0x80c2('0x7'));var logger=require(_0x80c2('0x8'))(_0x80c2('0x9'));var config=require('../../config/environment');var jayson=require(_0x80c2('0xa'));var client=jayson[_0x80c2('0xb')][_0x80c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x250c33,_0x4fac7e,_0x117dc2){return new BPromise(function(_0x5eb54f,_0x4742bb){return client[_0x80c2('0xd')](_0x250c33,_0x117dc2)[_0x80c2('0xe')](function(_0x37d0fd){logger[_0x80c2('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4fac7e,_0x80c2('0x10'));logger[_0x80c2('0x11')](_0x80c2('0x12'),_0x4fac7e,'request\x20sent',JSON[_0x80c2('0x13')](_0x37d0fd));if(_0x37d0fd['error']){if(_0x37d0fd[_0x80c2('0x14')][_0x80c2('0x15')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4fac7e,_0x37d0fd[_0x80c2('0x14')][_0x80c2('0x16')]);return _0x4742bb(_0x37d0fd[_0x80c2('0x14')][_0x80c2('0x16')]);}logger[_0x80c2('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x4fac7e,_0x37d0fd[_0x80c2('0x14')][_0x80c2('0x16')]);return _0x5eb54f(_0x37d0fd[_0x80c2('0x14')][_0x80c2('0x16')]);}else{logger[_0x80c2('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4fac7e,'request\x20sent');_0x5eb54f(_0x37d0fd[_0x80c2('0x17')][_0x80c2('0x16')]);}})[_0x80c2('0x18')](function(_0xa27468){logger[_0x80c2('0x14')](_0x80c2('0x19'),_0x4fac7e,_0xa27468);_0x4742bb(_0xa27468);});});}exports[_0x80c2('0x1a')]=function(_0x125010){var _0x3edbc0=this;return new Promise(function(_0x12348b,_0x4ed9bd){return db[_0x80c2('0x1b')][_0x80c2('0x1c')](_0x125010['body'],{'raw':_0x125010[_0x80c2('0x1d')]?_0x125010[_0x80c2('0x1d')][_0x80c2('0x1e')]===undefined?!![]:![]:!![]})[_0x80c2('0xe')](function(_0x5ecae1){logger[_0x80c2('0xf')]('CreateVoiceAgentReport',_0x125010);logger[_0x80c2('0x11')](_0x80c2('0x1a'),_0x125010,JSON[_0x80c2('0x13')](_0x5ecae1));_0x12348b(_0x5ecae1);})[_0x80c2('0x18')](function(_0x18789e){logger['error'](_0x80c2('0x1a'),_0x18789e[_0x80c2('0x16')],_0x125010);_0x4ed9bd(_0x3edbc0[_0x80c2('0x14')](0x1f4,_0x18789e[_0x80c2('0x16')]));});});};exports[_0x80c2('0x1f')]=function(_0x1294a8){var _0x3e3013=this;return new Promise(function(_0x13633e,_0x1e9d7f){return db[_0x80c2('0x1b')][_0x80c2('0x20')](_0x1294a8[_0x80c2('0x21')],{'raw':_0x1294a8[_0x80c2('0x1d')]?_0x1294a8[_0x80c2('0x1d')][_0x80c2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1294a8[_0x80c2('0x1d')]?_0x1294a8['options'][_0x80c2('0x22')]||null:null,'attributes':_0x1294a8[_0x80c2('0x1d')]?_0x1294a8[_0x80c2('0x1d')][_0x80c2('0x23')]||null:null,'limit':_0x1294a8[_0x80c2('0x1d')]?_0x1294a8[_0x80c2('0x1d')]['limit']||null:null})[_0x80c2('0xe')](function(_0x9afe72){logger['info'](_0x80c2('0x1f'),_0x1294a8);logger[_0x80c2('0x11')](_0x80c2('0x1f'),_0x1294a8,JSON['stringify'](_0x9afe72));_0x13633e(_0x9afe72);})[_0x80c2('0x18')](function(_0x5eb645){logger[_0x80c2('0x14')](_0x80c2('0x1f'),_0x5eb645['message'],_0x1294a8);_0x1e9d7f(_0x3e3013[_0x80c2('0x14')](0x1f4,_0x5eb645[_0x80c2('0x16')]));});});}; \ No newline at end of file +var _0x4e67=['options','info','debug','stringify','UpdateVoiceAgentReport','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','VoiceAgentReport','body'];(function(_0x2675be,_0x1d02d9){var _0x56db1a=function(_0x2787b6){while(--_0x2787b6){_0x2675be['push'](_0x2675be['shift']());}};_0x56db1a(++_0x1d02d9);}(_0x4e67,0xb4));var _0x74e6=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0x4e67[_0xf89c3];return _0x274fc8;};'use strict';var _=require(_0x74e6('0x0'));var util=require(_0x74e6('0x1'));var moment=require(_0x74e6('0x2'));var BPromise=require(_0x74e6('0x3'));var rs=require(_0x74e6('0x4'));var fs=require('fs');var Redis=require(_0x74e6('0x5'));var db=require(_0x74e6('0x6'))['db'];var utils=require(_0x74e6('0x7'));var logger=require(_0x74e6('0x8'))(_0x74e6('0x9'));var config=require('../../config/environment');var jayson=require(_0x74e6('0xa'));var client=jayson[_0x74e6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1804f7,_0x515176,_0x30445d){return new BPromise(function(_0x3bb4ac,_0x3f654d){return client[_0x74e6('0xc')](_0x1804f7,_0x30445d)[_0x74e6('0xd')](function(_0x13c64a){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x515176,_0x74e6('0xe'));logger['debug'](_0x74e6('0xf'),_0x515176,_0x74e6('0xe'),JSON['stringify'](_0x13c64a));if(_0x13c64a[_0x74e6('0x10')]){if(_0x13c64a['error'][_0x74e6('0x11')]===0x1f4){logger[_0x74e6('0x10')](_0x74e6('0x12'),_0x515176,_0x13c64a['error'][_0x74e6('0x13')]);return _0x3f654d(_0x13c64a[_0x74e6('0x10')][_0x74e6('0x13')]);}logger[_0x74e6('0x10')](_0x74e6('0x12'),_0x515176,_0x13c64a[_0x74e6('0x10')]['message']);return _0x3bb4ac(_0x13c64a['error'][_0x74e6('0x13')]);}else{logger['info'](_0x74e6('0x12'),_0x515176,'request\x20sent');_0x3bb4ac(_0x13c64a[_0x74e6('0x14')][_0x74e6('0x13')]);}})['catch'](function(_0x48ae51){logger[_0x74e6('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x515176,_0x48ae51);_0x3f654d(_0x48ae51);});});}exports[_0x74e6('0x15')]=function(_0x1acef9){var _0x51c4c5=this;return new Promise(function(_0x52560e,_0x5ceb57){return db[_0x74e6('0x16')]['create'](_0x1acef9[_0x74e6('0x17')],{'raw':_0x1acef9[_0x74e6('0x18')]?_0x1acef9[_0x74e6('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x74e6('0xd')](function(_0x462cba){logger[_0x74e6('0x19')]('CreateVoiceAgentReport',_0x1acef9);logger[_0x74e6('0x1a')]('CreateVoiceAgentReport',_0x1acef9,JSON[_0x74e6('0x1b')](_0x462cba));_0x52560e(_0x462cba);})['catch'](function(_0x30e272){logger[_0x74e6('0x10')]('CreateVoiceAgentReport',_0x30e272[_0x74e6('0x13')],_0x1acef9);_0x5ceb57(_0x51c4c5[_0x74e6('0x10')](0x1f4,_0x30e272[_0x74e6('0x13')]));});});};exports[_0x74e6('0x1c')]=function(_0x2717b5){var _0x3f2acf=this;return new Promise(function(_0x24523d,_0x5bcc94){return db[_0x74e6('0x16')]['update'](_0x2717b5['body'],{'raw':_0x2717b5[_0x74e6('0x18')]?_0x2717b5[_0x74e6('0x18')][_0x74e6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2717b5[_0x74e6('0x18')]?_0x2717b5['options'][_0x74e6('0x1e')]||null:null,'attributes':_0x2717b5[_0x74e6('0x18')]?_0x2717b5[_0x74e6('0x18')][_0x74e6('0x1f')]||null:null,'limit':_0x2717b5['options']?_0x2717b5['options'][_0x74e6('0x20')]||null:null})[_0x74e6('0xd')](function(_0x26f8d9){logger[_0x74e6('0x19')](_0x74e6('0x1c'),_0x2717b5);logger[_0x74e6('0x1a')](_0x74e6('0x1c'),_0x2717b5,JSON['stringify'](_0x26f8d9));_0x24523d(_0x26f8d9);})[_0x74e6('0x21')](function(_0x3b12bd){logger[_0x74e6('0x10')](_0x74e6('0x1c'),_0x3b12bd['message'],_0x2717b5);_0x5bcc94(_0x3f2acf['error'](0x1f4,_0x3b12bd[_0x74e6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 702a414..b5a3a84 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 _0x885a=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe'];(function(_0x3e2040,_0x660381){var _0x38e3ec=function(_0x2e61bd){while(--_0x2e61bd){_0x3e2040['push'](_0x3e2040['shift']());}};_0x38e3ec(++_0x660381);}(_0x885a,0x180));var _0xa885=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x885a[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0xf')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x12')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller['update']);router[_0xa885('0x13')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller[_0xa885('0x14')]);module[_0xa885('0x15')]=router; \ No newline at end of file +var _0x57d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x57d4,0x78));var _0x457d=function(_0x3eb7f6,_0x2cd3db){_0x3eb7f6=_0x3eb7f6-0x0;var _0x1a66a9=_0x57d4[_0x3eb7f6];return _0x1a66a9;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),auth[_0x457d('0xb')](),controller['describe']);router['get'](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x457d('0x10')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x11')]);router[_0x457d('0x12')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x13')]);module[_0x457d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a1ef187..74fcf94 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 _0xf482=['STRING','ENUM','inbound','internal','outbound','outbound-fax','dialer','DATE','INTEGER','sequelize','exports'];(function(_0x262737,_0x24f7f5){var _0x352b40=function(_0x48386a){while(--_0x48386a){_0x262737['push'](_0x262737['shift']());}};_0x352b40(++_0x24f7f5);}(_0xf482,0xf0));var _0x2f48=function(_0x522258,_0x168487){_0x522258=_0x522258-0x0;var _0x484b4b=_0xf482[_0x522258];return _0x484b4b;};'use strict';var Sequelize=require(_0x2f48('0x0'));module[_0x2f48('0x1')]={'uniqueid':{'type':Sequelize[_0x2f48('0x2')]},'type':{'type':Sequelize[_0x2f48('0x3')](_0x2f48('0x4'),_0x2f48('0x5'),_0x2f48('0x6'),'inbound-fax',_0x2f48('0x7'),_0x2f48('0x8'))},'tag':{'type':Sequelize[_0x2f48('0x2')]},'accountcode':{'type':Sequelize[_0x2f48('0x2')]},'source':{'type':Sequelize[_0x2f48('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x2f48('0x2')]},'callerid':{'type':Sequelize[_0x2f48('0x2')]},'channel':{'type':Sequelize[_0x2f48('0x2')]},'destinationchannel':{'type':Sequelize[_0x2f48('0x2')]},'lastapplication':{'type':Sequelize[_0x2f48('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x2f48('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2f48('0x9')]},'duration':{'type':Sequelize[_0x2f48('0xa')]},'billableseconds':{'type':Sequelize[_0x2f48('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2f48('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2f48('0x2')]},'userDisposition':{'type':Sequelize[_0x2f48('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x2f48('0x2')]},'note':{'type':Sequelize[_0x2f48('0x2')]},'prefix':{'type':Sequelize[_0x2f48('0x2')]},'routeid':{'type':Sequelize[_0x2f48('0xa')]},'sipcallid':{'type':Sequelize[_0x2f48('0x2')]}}; \ No newline at end of file +var _0x6069=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0x6069,0x1c1));var _0x9606=function(_0x167ec4,_0x1352e4){_0x167ec4=_0x167ec4-0x0;var _0x2a0ec8=_0x6069[_0x167ec4];return _0x2a0ec8;};'use strict';var Sequelize=require(_0x9606('0x0'));module[_0x9606('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9606('0x2')](_0x9606('0x3'),_0x9606('0x4'),'outbound',_0x9606('0x5'),_0x9606('0x6'),_0x9606('0x7'))},'tag':{'type':Sequelize[_0x9606('0x8')]},'accountcode':{'type':Sequelize[_0x9606('0x8')]},'source':{'type':Sequelize[_0x9606('0x8')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9606('0x8')]},'channel':{'type':Sequelize[_0x9606('0x8')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x9606('0x9')]},'starttime':{'type':Sequelize[_0x9606('0xa')]},'systemanswertime':{'type':Sequelize[_0x9606('0xa')]},'answertime':{'type':Sequelize[_0x9606('0xa')]},'endtime':{'type':Sequelize[_0x9606('0xa')]},'duration':{'type':Sequelize[_0x9606('0xb')]},'billableseconds':{'type':Sequelize[_0x9606('0xb')]},'mohtime':{'type':Sequelize[_0x9606('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9606('0x8')]},'amaflags':{'type':Sequelize[_0x9606('0x8')]},'userfield':{'type':Sequelize[_0x9606('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x9606('0x8')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x9606('0x8')]},'routeid':{'type':Sequelize[_0x9606('0xb')]},'sipcallid':{'type':Sequelize[_0x9606('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 13f44f6..f464b5f 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x5592f1,_0x43e135){var _0x50d95a=function(_0x1f3870){while(--_0x1f3870){_0x5592f1['push'](_0x5592f1['shift']());}};_0x50d95a(++_0x43e135);}(_0xdb28,0x106));var _0x8db2=function(_0xd04f76,_0x263a27){_0xd04f76=_0xd04f76-0x0;var _0x46ea61=_0xdb28[_0xd04f76];return _0x46ea61;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x1a898e,_0x2fb731){var _0x4f5989=function(_0x2b1dcd){while(--_0x2b1dcd){_0x1a898e['push'](_0x1a898e['shift']());}};_0x4f5989(++_0x2fb731);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x0b0e[_0x4551f6];return _0x581dc2;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 286d1dd..9e55c74 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 _0xabae=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','uniqueid','../../config/logger','api','moment'];(function(_0x3ffdfa,_0x5799e6){var _0x498d2f=function(_0x1ae395){while(--_0x1ae395){_0x3ffdfa['push'](_0x3ffdfa['shift']());}};_0x498d2f(++_0x5799e6);}(_0xabae,0x1a1));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeaba('0x0'))(_0xeaba('0x1'));var moment=require(_0xeaba('0x2'));var BPromise=require(_0xeaba('0x3'));var rp=require(_0xeaba('0x4'));var fs=require('fs');var path=require(_0xeaba('0x5'));var rimraf=require(_0xeaba('0x6'));var config=require(_0xeaba('0x7'));var attributes=require(_0xeaba('0x8'));module[_0xeaba('0x9')]=function(_0xe39f39,_0x37903a){return _0xe39f39['define'](_0xeaba('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xeaba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a9a=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x4a9a,0x164));var _0xa4a9=function(_0x3ff92c,_0x4e227f){_0x3ff92c=_0x3ff92c-0x0;var _0x16b79e=_0x4a9a[_0x3ff92c];return _0x16b79e;};'use strict';var _=require(_0xa4a9('0x0'));var util=require(_0xa4a9('0x1'));var logger=require(_0xa4a9('0x2'))(_0xa4a9('0x3'));var moment=require(_0xa4a9('0x4'));var BPromise=require(_0xa4a9('0x5'));var rp=require(_0xa4a9('0x6'));var fs=require('fs');var path=require(_0xa4a9('0x7'));var rimraf=require(_0xa4a9('0x8'));var config=require(_0xa4a9('0x9'));var attributes=require(_0xa4a9('0xa'));module[_0xa4a9('0xb')]=function(_0xf851b1,_0x1592c0){return _0xf851b1[_0xa4a9('0xc')](_0xa4a9('0xd'),attributes,{'tableName':_0xa4a9('0xe'),'paranoid':![],'indexes':[{'fields':[_0xa4a9('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 4597980..04de0b7 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 _0x2944=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','map','include','attributes','model','debug','CreateVoiceCallReport','create','body','update','where','UpdateVoiceCallReport'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x2944,0xbe));var _0x4294=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2944[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x4294('0x0'));var util=require(_0x4294('0x1'));var moment=require(_0x4294('0x2'));var BPromise=require(_0x4294('0x3'));var rs=require(_0x4294('0x4'));var fs=require('fs');var Redis=require(_0x4294('0x5'));var db=require(_0x4294('0x6'))['db'];var utils=require(_0x4294('0x7'));var logger=require(_0x4294('0x8'))('rpc');var config=require(_0x4294('0x9'));var jayson=require(_0x4294('0xa'));var client=jayson['client'][_0x4294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3464b0,_0x5bdee2,_0x432f09){return new BPromise(function(_0x322f8e,_0x3acd86){return client['request'](_0x3464b0,_0x432f09)[_0x4294('0xc')](function(_0x50c06f){logger['info'](_0x4294('0xd'),_0x5bdee2,_0x4294('0xe'));logger['debug'](_0x4294('0xf'),_0x5bdee2,_0x4294('0xe'),JSON[_0x4294('0x10')](_0x50c06f));if(_0x50c06f[_0x4294('0x11')]){if(_0x50c06f[_0x4294('0x11')][_0x4294('0x12')]===0x1f4){logger[_0x4294('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5bdee2,_0x50c06f[_0x4294('0x11')]['message']);return _0x3acd86(_0x50c06f['error'][_0x4294('0x13')]);}logger[_0x4294('0x11')](_0x4294('0xd'),_0x5bdee2,_0x50c06f[_0x4294('0x11')][_0x4294('0x13')]);return _0x322f8e(_0x50c06f[_0x4294('0x11')][_0x4294('0x13')]);}else{logger[_0x4294('0x14')](_0x4294('0xd'),_0x5bdee2,_0x4294('0xe'));_0x322f8e(_0x50c06f['result'][_0x4294('0x13')]);}})[_0x4294('0x15')](function(_0x478257){logger[_0x4294('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5bdee2,_0x478257);_0x3acd86(_0x478257);});});}exports[_0x4294('0x16')]=function(_0x58e38f){var _0x3c2cd5=this;return new Promise(function(_0x5b15cc,_0x36451c){return db[_0x4294('0x17')][_0x4294('0x18')]({'raw':_0x58e38f[_0x4294('0x19')]?_0x58e38f[_0x4294('0x19')][_0x4294('0x1a')]===undefined?!![]:![]:!![],'where':_0x58e38f[_0x4294('0x19')]?_0x58e38f[_0x4294('0x19')]['where']||null:null,'attributes':_0x58e38f[_0x4294('0x19')]?_0x58e38f['options']['attributes']||null:null,'limit':_0x58e38f[_0x4294('0x19')]?_0x58e38f[_0x4294('0x19')]['limit']||null:null,'include':_0x58e38f[_0x4294('0x19')]?_0x58e38f[_0x4294('0x19')]['include']?_[_0x4294('0x1b')](_0x58e38f['options'][_0x4294('0x1c')],function(_0x5372cf){return{'model':db[_0x5372cf['model']],'as':_0x5372cf['as'],'attributes':_0x5372cf[_0x4294('0x1d')],'include':_0x5372cf['include']?_[_0x4294('0x1b')](_0x5372cf[_0x4294('0x1c')],function(_0x2e055){return{'model':db[_0x2e055[_0x4294('0x1e')]],'as':_0x2e055['as'],'attributes':_0x2e055[_0x4294('0x1d')],'include':_0x2e055['include']?_[_0x4294('0x1b')](_0x2e055['include'],function(_0x21e2e6){return{'model':db[_0x21e2e6['model']],'as':_0x21e2e6['as'],'attributes':_0x21e2e6[_0x4294('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4294('0xc')](function(_0x448061){logger[_0x4294('0x14')](_0x4294('0x16'),_0x58e38f);logger[_0x4294('0x1f')]('GetVoiceCallReport',_0x58e38f,JSON[_0x4294('0x10')](_0x448061));_0x5b15cc(_0x448061);})[_0x4294('0x15')](function(_0xdd5861){logger[_0x4294('0x11')](_0x4294('0x16'),_0xdd5861[_0x4294('0x13')],_0x58e38f);_0x36451c(_0x3c2cd5['error'](0x1f4,_0xdd5861[_0x4294('0x13')]));});});};exports[_0x4294('0x20')]=function(_0x2a597b){var _0x484137=this;return new Promise(function(_0x83f319,_0x1a4904){return db[_0x4294('0x17')][_0x4294('0x21')](_0x2a597b[_0x4294('0x22')],{'raw':_0x2a597b[_0x4294('0x19')]?_0x2a597b[_0x4294('0x19')][_0x4294('0x1a')]===undefined?!![]:![]:!![]})[_0x4294('0xc')](function(_0x2ef556){logger[_0x4294('0x14')](_0x4294('0x20'),_0x2a597b);logger[_0x4294('0x1f')]('CreateVoiceCallReport',_0x2a597b,JSON[_0x4294('0x10')](_0x2ef556));_0x83f319(_0x2ef556);})[_0x4294('0x15')](function(_0x35454a){logger[_0x4294('0x11')](_0x4294('0x20'),_0x35454a[_0x4294('0x13')],_0x2a597b);_0x1a4904(_0x484137[_0x4294('0x11')](0x1f4,_0x35454a[_0x4294('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0xd93caa){var _0x2768f4=this;return new Promise(function(_0x1ef72f,_0x3e1ebb){return db[_0x4294('0x17')][_0x4294('0x23')](_0xd93caa[_0x4294('0x22')],{'raw':_0xd93caa[_0x4294('0x19')]?_0xd93caa[_0x4294('0x19')][_0x4294('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd93caa['options']?_0xd93caa[_0x4294('0x19')][_0x4294('0x24')]||null:null,'attributes':_0xd93caa['options']?_0xd93caa['options'][_0x4294('0x1d')]||null:null,'limit':_0xd93caa[_0x4294('0x19')]?_0xd93caa[_0x4294('0x19')]['limit']||null:null})[_0x4294('0xc')](function(_0x10f593){logger[_0x4294('0x14')]('UpdateVoiceCallReport',_0xd93caa);logger[_0x4294('0x1f')](_0x4294('0x25'),_0xd93caa,JSON[_0x4294('0x10')](_0x10f593));_0x1ef72f(_0x10f593);})[_0x4294('0x15')](function(_0x2730b3){logger[_0x4294('0x11')](_0x4294('0x25'),_0x2730b3[_0x4294('0x13')],_0xd93caa);_0x3e1ebb(_0x2768f4[_0x4294('0x11')](0x1f4,_0x2730b3[_0x4294('0x13')]));});});}; \ No newline at end of file +var _0xbb07=['UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceCallReport','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body'];(function(_0x1cf7b5,_0x490952){var _0xe187a0=function(_0xf89448){while(--_0xf89448){_0x1cf7b5['push'](_0x1cf7b5['shift']());}};_0xe187a0(++_0x490952);}(_0xbb07,0xf0));var _0x7bb0=function(_0x44bd3a,_0x2d3b79){_0x44bd3a=_0x44bd3a-0x0;var _0x1ed9d6=_0xbb07[_0x44bd3a];return _0x1ed9d6;};'use strict';var _=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var moment=require(_0x7bb0('0x2'));var BPromise=require(_0x7bb0('0x3'));var rs=require(_0x7bb0('0x4'));var fs=require('fs');var Redis=require(_0x7bb0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bb0('0x6'));var logger=require('../../config/logger')(_0x7bb0('0x7'));var config=require(_0x7bb0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29bda7,_0x2c6a6a,_0x24328b){return new BPromise(function(_0x4a43b5,_0x12b09f){return client['request'](_0x29bda7,_0x24328b)[_0x7bb0('0xa')](function(_0x4dd7a4){logger[_0x7bb0('0xb')](_0x7bb0('0xc'),_0x2c6a6a,_0x7bb0('0xd'));logger[_0x7bb0('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2c6a6a,_0x7bb0('0xd'),JSON[_0x7bb0('0xf')](_0x4dd7a4));if(_0x4dd7a4[_0x7bb0('0x10')]){if(_0x4dd7a4[_0x7bb0('0x10')]['code']===0x1f4){logger[_0x7bb0('0x10')](_0x7bb0('0xc'),_0x2c6a6a,_0x4dd7a4[_0x7bb0('0x10')][_0x7bb0('0x11')]);return _0x12b09f(_0x4dd7a4[_0x7bb0('0x10')][_0x7bb0('0x11')]);}logger[_0x7bb0('0x10')](_0x7bb0('0xc'),_0x2c6a6a,_0x4dd7a4['error']['message']);return _0x4a43b5(_0x4dd7a4['error'][_0x7bb0('0x11')]);}else{logger[_0x7bb0('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x2c6a6a,_0x7bb0('0xd'));_0x4a43b5(_0x4dd7a4[_0x7bb0('0x12')][_0x7bb0('0x11')]);}})[_0x7bb0('0x13')](function(_0x615fb3){logger[_0x7bb0('0x10')](_0x7bb0('0xc'),_0x2c6a6a,_0x615fb3);_0x12b09f(_0x615fb3);});});}exports['GetVoiceCallReport']=function(_0x1eff21){var _0x1b2d97=this;return new Promise(function(_0xf32c0a,_0x4c1fe1){return db[_0x7bb0('0x14')]['findAll']({'raw':_0x1eff21[_0x7bb0('0x15')]?_0x1eff21['options'][_0x7bb0('0x16')]===undefined?!![]:![]:!![],'where':_0x1eff21[_0x7bb0('0x15')]?_0x1eff21['options']['where']||null:null,'attributes':_0x1eff21['options']?_0x1eff21['options'][_0x7bb0('0x17')]||null:null,'limit':_0x1eff21[_0x7bb0('0x15')]?_0x1eff21[_0x7bb0('0x15')][_0x7bb0('0x18')]||null:null,'include':_0x1eff21[_0x7bb0('0x15')]?_0x1eff21[_0x7bb0('0x15')][_0x7bb0('0x19')]?_[_0x7bb0('0x1a')](_0x1eff21[_0x7bb0('0x15')][_0x7bb0('0x19')],function(_0x2236b8){return{'model':db[_0x2236b8['model']],'as':_0x2236b8['as'],'attributes':_0x2236b8['attributes'],'include':_0x2236b8[_0x7bb0('0x19')]?_[_0x7bb0('0x1a')](_0x2236b8[_0x7bb0('0x19')],function(_0x2da65d){return{'model':db[_0x2da65d[_0x7bb0('0x1b')]],'as':_0x2da65d['as'],'attributes':_0x2da65d[_0x7bb0('0x17')],'include':_0x2da65d[_0x7bb0('0x19')]?_['map'](_0x2da65d['include'],function(_0x165b92){return{'model':db[_0x165b92[_0x7bb0('0x1b')]],'as':_0x165b92['as'],'attributes':_0x165b92[_0x7bb0('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32f3af){logger[_0x7bb0('0xb')](_0x7bb0('0x1c'),_0x1eff21);logger['debug'](_0x7bb0('0x1c'),_0x1eff21,JSON[_0x7bb0('0xf')](_0x32f3af));_0xf32c0a(_0x32f3af);})['catch'](function(_0x1757de){logger[_0x7bb0('0x10')](_0x7bb0('0x1c'),_0x1757de[_0x7bb0('0x11')],_0x1eff21);_0x4c1fe1(_0x1b2d97[_0x7bb0('0x10')](0x1f4,_0x1757de[_0x7bb0('0x11')]));});});};exports[_0x7bb0('0x1d')]=function(_0xd0c544){var _0x47ba37=this;return new Promise(function(_0x38be34,_0x2d7253){return db[_0x7bb0('0x14')][_0x7bb0('0x1e')](_0xd0c544[_0x7bb0('0x1f')],{'raw':_0xd0c544['options']?_0xd0c544[_0x7bb0('0x15')][_0x7bb0('0x16')]===undefined?!![]:![]:!![]})[_0x7bb0('0xa')](function(_0x1dd741){logger[_0x7bb0('0xb')]('CreateVoiceCallReport',_0xd0c544);logger[_0x7bb0('0xe')]('CreateVoiceCallReport',_0xd0c544,JSON['stringify'](_0x1dd741));_0x38be34(_0x1dd741);})[_0x7bb0('0x13')](function(_0x3a0a38){logger['error'](_0x7bb0('0x1d'),_0x3a0a38[_0x7bb0('0x11')],_0xd0c544);_0x2d7253(_0x47ba37[_0x7bb0('0x10')](0x1f4,_0x3a0a38[_0x7bb0('0x11')]));});});};exports[_0x7bb0('0x20')]=function(_0x25e3ad){var _0x46af4c=this;return new Promise(function(_0x2b5a99,_0x4ebf64){return db[_0x7bb0('0x14')][_0x7bb0('0x21')](_0x25e3ad[_0x7bb0('0x1f')],{'raw':_0x25e3ad[_0x7bb0('0x15')]?_0x25e3ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e3ad[_0x7bb0('0x15')]?_0x25e3ad[_0x7bb0('0x15')]['where']||null:null,'attributes':_0x25e3ad[_0x7bb0('0x15')]?_0x25e3ad['options'][_0x7bb0('0x17')]||null:null,'limit':_0x25e3ad[_0x7bb0('0x15')]?_0x25e3ad['options'][_0x7bb0('0x18')]||null:null})[_0x7bb0('0xa')](function(_0x267410){logger['info'](_0x7bb0('0x20'),_0x25e3ad);logger['debug'](_0x7bb0('0x20'),_0x25e3ad,JSON[_0x7bb0('0xf')](_0x267410));_0x2b5a99(_0x267410);})[_0x7bb0('0x13')](function(_0x46057d){logger['error'](_0x7bb0('0x20'),_0x46057d[_0x7bb0('0x11')],_0x25e3ad);_0x4ebf64(_0x46af4c[_0x7bb0('0x10')](0x1f4,_0x46057d[_0x7bb0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index bba8700..8d60fb0 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 _0x5fba=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./voiceChanSpy.controller','get','index'];(function(_0x6e3eb3,_0x3f9c9d){var _0x2f9944=function(_0x1b39e2){while(--_0x1b39e2){_0x6e3eb3['push'](_0x6e3eb3['shift']());}};_0x2f9944(++_0x3f9c9d);}(_0x5fba,0x99));var _0xa5fb=function(_0xdc28d7,_0x40b27a){_0xdc28d7=_0xdc28d7-0x0;var _0x1d125c=_0x5fba[_0xdc28d7];return _0x1d125c;};'use strict';var multer=require(_0xa5fb('0x0'));var util=require(_0xa5fb('0x1'));var path=require('path');var timeout=require(_0xa5fb('0x2'));var express=require(_0xa5fb('0x3'));var router=express[_0xa5fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa5fb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa5fb('0x6'));router[_0xa5fb('0x7')]('/',auth['isAuthenticated'](),controller[_0xa5fb('0x8')]);router[_0xa5fb('0x7')](_0xa5fb('0x9'),auth[_0xa5fb('0xa')](),controller[_0xa5fb('0xb')]);router[_0xa5fb('0xc')]('/',auth['isAuthenticated'](),controller[_0xa5fb('0xd')]);router['put'](_0xa5fb('0x9'),auth[_0xa5fb('0xa')](),controller[_0xa5fb('0xe')]);router[_0xa5fb('0xf')](_0xa5fb('0x9'),auth['isAuthenticated'](),controller[_0xa5fb('0x10')]);module[_0xa5fb('0x11')]=router; \ No newline at end of file +var _0x6e09=['create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post'];(function(_0xb77909,_0x3f62e3){var _0x46a4aa=function(_0x532a60){while(--_0x532a60){_0xb77909['push'](_0xb77909['shift']());}};_0x46a4aa(++_0x3f62e3);}(_0x6e09,0x122));var _0x96e0=function(_0x1a3ca2,_0xe144e7){_0x1a3ca2=_0x1a3ca2-0x0;var _0x30ea08=_0x6e09[_0x1a3ca2];return _0x30ea08;};'use strict';var multer=require(_0x96e0('0x0'));var util=require(_0x96e0('0x1'));var path=require(_0x96e0('0x2'));var timeout=require(_0x96e0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96e0('0x4'));var auth=require(_0x96e0('0x5'));var interaction=require(_0x96e0('0x6'));var config=require(_0x96e0('0x7'));var controller=require(_0x96e0('0x8'));router[_0x96e0('0x9')]('/',auth[_0x96e0('0xa')](),controller['index']);router[_0x96e0('0x9')](_0x96e0('0xb'),auth[_0x96e0('0xa')](),controller[_0x96e0('0xc')]);router[_0x96e0('0xd')]('/',auth[_0x96e0('0xa')](),controller[_0x96e0('0xe')]);router[_0x96e0('0xf')](_0x96e0('0xb'),auth[_0x96e0('0xa')](),controller[_0x96e0('0x10')]);router[_0x96e0('0x11')](_0x96e0('0xb'),auth['isAuthenticated'](),controller[_0x96e0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6461b6e..18a2587 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 _0x92af=['join','getDataValue','split','BOOLEAN','sequelize','exports','name','STRING','options'];(function(_0x45d290,_0x3fbc9b){var _0x501e8d=function(_0xc16b31){while(--_0xc16b31){_0x45d290['push'](_0x45d290['shift']());}};_0x501e8d(++_0x3fbc9b);}(_0x92af,0x151));var _0xf92a=function(_0x13595d,_0x3629f2){_0x13595d=_0x13595d-0x0;var _0x5b8311=_0x92af[_0x13595d];return _0x5b8311;};'use strict';var Sequelize=require(_0xf92a('0x0'));module[_0xf92a('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xf92a('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xf92a('0x3')],'set':function(_0x3af074){this['setDataValue'](_0xf92a('0x4'),_0x3af074?_0x3af074[_0xf92a('0x5')](''):[]);},'get':function(){return this[_0xf92a('0x6')](_0xf92a('0x4'))?this[_0xf92a('0x6')](_0xf92a('0x4'))[_0xf92a('0x7')](''):[];}},'auth':{'type':Sequelize[_0xf92a('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xf92a('0x3')]},'record':{'type':Sequelize[_0xf92a('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf92a('0x3')]},'description':{'type':Sequelize[_0xf92a('0x3')]}}; \ No newline at end of file +var _0xc9c0=['setDataValue','options','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x11ddbf,_0x243526){var _0x437cc9=function(_0x5b239b){while(--_0x5b239b){_0x11ddbf['push'](_0x11ddbf['shift']());}};_0x437cc9(++_0x243526);}(_0xc9c0,0xbd));var _0x0c9c=function(_0x1e1d89,_0x2dff5f){_0x1e1d89=_0x1e1d89-0x0;var _0x36ca66=_0xc9c0[_0x1e1d89];return _0x36ca66;};'use strict';var Sequelize=require('sequelize');module[_0x0c9c('0x0')]={'name':{'type':Sequelize[_0x0c9c('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x0c9c('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x495848){this[_0x0c9c('0x3')](_0x0c9c('0x4'),_0x495848?_0x495848['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x0c9c('0x5')](_0x0c9c('0x4'))[_0x0c9c('0x6')](''):[];}},'auth':{'type':Sequelize[_0x0c9c('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0c9c('0x1')]},'record':{'type':Sequelize[_0x0c9c('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0c9c('0x1')]},'description':{'type':Sequelize[_0x0c9c('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 05df1da..dd6e024 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 _0x3451=['ChanSpies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','VoiceChanSpy','include','findAll','catch','show','params','rawAttributes','length','includeAll','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x3afc1a,_0x4b9156){var _0x5ae510=function(_0x30008b){while(--_0x30008b){_0x3afc1a['push'](_0x3afc1a['shift']());}};_0x5ae510(++_0x4b9156);}(_0x3451,0x19a));var _0x1345=function(_0x31ef31,_0x195c49){_0x31ef31=_0x31ef31-0x0;var _0x876cc4=_0x3451[_0x31ef31];return _0x876cc4;};'use strict';var emlformat=require(_0x1345('0x0'));var rimraf=require(_0x1345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1345('0x2'));var rp=require(_0x1345('0x3'));var moment=require(_0x1345('0x4'));var BPromise=require(_0x1345('0x5'));var Mustache=require(_0x1345('0x6'));var util=require(_0x1345('0x7'));var path=require(_0x1345('0x8'));var sox=require(_0x1345('0x9'));var csv=require(_0x1345('0xa'));var ejs=require(_0x1345('0xb'));var fs=require('fs');var fs_extra=require(_0x1345('0xc'));var _=require(_0x1345('0xd'));var squel=require('squel');var crypto=require(_0x1345('0xe'));var jsforce=require(_0x1345('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1345('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1345('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1345('0x11'));var as=require(_0x1345('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1345('0x13'));var utils=require('../../config/utils');var config=require(_0x1345('0x14'));var licenseUtil=require(_0x1345('0x15'));var db=require(_0x1345('0x16'))['db'];function respondWithStatusCode(_0x3e1362,_0x528692){_0x528692=_0x528692||0xcc;return function(_0x3fdff0){if(_0x3fdff0){return _0x3e1362[_0x1345('0x17')](_0x528692);}return _0x3e1362[_0x1345('0x18')](_0x528692)[_0x1345('0x19')]();};}function respondWithResult(_0x4ea08a,_0x181a2b){_0x181a2b=_0x181a2b||0xc8;return function(_0x426e00){if(_0x426e00){return _0x4ea08a[_0x1345('0x18')](_0x181a2b)[_0x1345('0x1a')](_0x426e00);}};}function respondWithFilteredResult(_0x347591,_0x959544){return function(_0x3cd49e){if(_0x3cd49e){var _0x520e6c=typeof _0x959544[_0x1345('0x1b')]===_0x1345('0x1c')&&typeof _0x959544[_0x1345('0x1d')]==='undefined';var _0x5b4d04=_0x3cd49e[_0x1345('0x1e')];var _0x1afc89=_0x520e6c?0x0:_0x959544[_0x1345('0x1b')];var _0x1db636=_0x520e6c?_0x3cd49e['count']:_0x959544[_0x1345('0x1b')]+_0x959544[_0x1345('0x1d')];var _0x1f3746;if(_0x1db636>=_0x5b4d04){_0x1db636=_0x5b4d04;_0x1f3746=0xc8;}else{_0x1f3746=0xce;}_0x347591[_0x1345('0x18')](_0x1f3746);return _0x347591[_0x1345('0x1f')](_0x1345('0x20'),_0x1afc89+'-'+_0x1db636+'/'+_0x5b4d04)[_0x1345('0x1a')](_0x3cd49e);}return null;};}function patchUpdates(_0x43d209){return function(_0x3bc681){try{jsonpatch[_0x1345('0x21')](_0x3bc681,_0x43d209,!![]);}catch(_0x265ea8){return BPromise['reject'](_0x265ea8);}return _0x3bc681[_0x1345('0x22')]();};}function saveUpdates(_0x4855d7,_0xaf6ecc){return function(_0x217712){if(_0x217712){return _0x217712[_0x1345('0x23')](_0x4855d7)[_0x1345('0x24')](function(_0x422dd9){return _0x422dd9;});}return null;};}function removeEntity(_0x2fd7ca,_0x26c2a6){return function(_0x339ea9){if(_0x339ea9){return _0x339ea9[_0x1345('0x25')]()[_0x1345('0x24')](function(){var _0x39a950=_0x339ea9['get']({'plain':!![]});var _0x346054='ChanSpies';return db[_0x1345('0x26')][_0x1345('0x25')]({'where':{'type':_0x346054,'resourceId':_0x39a950['id']}})[_0x1345('0x24')](function(){return _0x339ea9;});})[_0x1345('0x24')](function(){_0x2fd7ca[_0x1345('0x18')](0xcc)[_0x1345('0x19')]();});}};}function handleEntityNotFound(_0x3b891c,_0x25b564){return function(_0x3dcf6c){if(!_0x3dcf6c){_0x3b891c[_0x1345('0x17')](0x194);}return _0x3dcf6c;};}function handleError(_0x3d06b5,_0x2817f0){_0x2817f0=_0x2817f0||0x1f4;return function(_0x483e75){logger[_0x1345('0x27')](_0x483e75['stack']);if(_0x483e75['name']){delete _0x483e75[_0x1345('0x28')];}_0x3d06b5[_0x1345('0x18')](_0x2817f0)[_0x1345('0x29')](_0x483e75);};}exports[_0x1345('0x2a')]=function(_0x44bbba,_0x51425d){var _0x389e94={},_0x2b2be4={},_0x96c944={'count':0x0,'rows':[]};var _0x49d8e8=_[_0x1345('0x2b')](db['VoiceChanSpy']['rawAttributes'],function(_0xee1b74){return{'name':_0xee1b74[_0x1345('0x2c')],'type':_0xee1b74[_0x1345('0x2d')][_0x1345('0x2e')]};});_0x2b2be4['model']=_[_0x1345('0x2b')](_0x49d8e8,_0x1345('0x28'));_0x2b2be4[_0x1345('0x2f')]=_[_0x1345('0x30')](_0x44bbba[_0x1345('0x2f')]);_0x2b2be4[_0x1345('0x31')]=_[_0x1345('0x32')](_0x2b2be4[_0x1345('0x33')],_0x2b2be4[_0x1345('0x2f')]);_0x389e94[_0x1345('0x34')]=_[_0x1345('0x32')](_0x2b2be4['model'],qs[_0x1345('0x35')](_0x44bbba[_0x1345('0x2f')][_0x1345('0x35')]));_0x389e94[_0x1345('0x34')]=_0x389e94[_0x1345('0x34')]['length']?_0x389e94[_0x1345('0x34')]:_0x2b2be4['model'];if(!_0x44bbba['query'][_0x1345('0x36')](_0x1345('0x37'))){_0x389e94[_0x1345('0x1d')]=qs['limit'](_0x44bbba[_0x1345('0x2f')][_0x1345('0x1d')]);_0x389e94[_0x1345('0x1b')]=qs[_0x1345('0x1b')](_0x44bbba[_0x1345('0x2f')][_0x1345('0x1b')]);}_0x389e94[_0x1345('0x38')]=qs['sort'](_0x44bbba['query']['sort']);_0x389e94['where']=qs['filters'](_[_0x1345('0x39')](_0x44bbba[_0x1345('0x2f')],_0x2b2be4[_0x1345('0x31')]),_0x49d8e8);if(_0x44bbba[_0x1345('0x2f')][_0x1345('0x3a')]){_0x389e94['where']=_['merge'](_0x389e94[_0x1345('0x3b')],{'$or':_[_0x1345('0x2b')](_0x49d8e8,function(_0x14ee7c){if(_0x14ee7c[_0x1345('0x2d')]!==_0x1345('0x3c')){var _0x1eae93={};_0x1eae93[_0x14ee7c['name']]={'$like':'%'+_0x44bbba[_0x1345('0x2f')][_0x1345('0x3a')]+'%'};return _0x1eae93;}})});}_0x389e94=_[_0x1345('0x3d')]({},_0x389e94,_0x44bbba[_0x1345('0x3e')]);var _0x521cdf={'where':_0x389e94[_0x1345('0x3b')]};return db[_0x1345('0x3f')][_0x1345('0x1e')](_0x521cdf)['then'](function(_0x10f67b){_0x96c944[_0x1345('0x1e')]=_0x10f67b;if(_0x44bbba[_0x1345('0x2f')]['includeAll']){_0x389e94[_0x1345('0x40')]=[{'all':!![]}];}return db[_0x1345('0x3f')][_0x1345('0x41')](_0x389e94);})[_0x1345('0x24')](function(_0x3bbc86){_0x96c944['rows']=_0x3bbc86;return _0x96c944;})[_0x1345('0x24')](respondWithFilteredResult(_0x51425d,_0x389e94))[_0x1345('0x42')](handleError(_0x51425d,null));};exports[_0x1345('0x43')]=function(_0x1c23df,_0x4f2d65){var _0x183132={'raw':![],'where':{'id':_0x1c23df[_0x1345('0x44')]['id']}},_0x2f128c={};_0x2f128c[_0x1345('0x33')]=_[_0x1345('0x30')](db[_0x1345('0x3f')][_0x1345('0x45')]);_0x2f128c[_0x1345('0x2f')]=_[_0x1345('0x30')](_0x1c23df[_0x1345('0x2f')]);_0x2f128c[_0x1345('0x31')]=_[_0x1345('0x32')](_0x2f128c[_0x1345('0x33')],_0x2f128c[_0x1345('0x2f')]);_0x183132[_0x1345('0x34')]=_[_0x1345('0x32')](_0x2f128c['model'],qs[_0x1345('0x35')](_0x1c23df[_0x1345('0x2f')][_0x1345('0x35')]));_0x183132[_0x1345('0x34')]=_0x183132[_0x1345('0x34')][_0x1345('0x46')]?_0x183132[_0x1345('0x34')]:_0x2f128c[_0x1345('0x33')];if(_0x1c23df[_0x1345('0x2f')][_0x1345('0x47')]){_0x183132[_0x1345('0x40')]=[{'all':!![]}];}_0x183132=_[_0x1345('0x3d')]({},_0x183132,_0x1c23df[_0x1345('0x3e')]);return db['VoiceChanSpy'][_0x1345('0x48')](_0x183132)['then'](handleEntityNotFound(_0x4f2d65,null))[_0x1345('0x24')](respondWithResult(_0x4f2d65,null))[_0x1345('0x42')](handleError(_0x4f2d65,null));};exports['create']=function(_0x49b8fc,_0x27fc27){return db[_0x1345('0x3f')]['create'](_0x49b8fc['body'],{})['then'](function(_0x379a98){var _0x3f336e=_0x49b8fc['user'][_0x1345('0x49')]({'plain':!![]});if(!_0x3f336e)throw new Error(_0x1345('0x4a'));if(_0x3f336e['role']===_0x1345('0x4b')){var _0x4ce41d=_0x379a98[_0x1345('0x49')]({'plain':!![]});var _0x5aab90=_0x1345('0x4c');return db[_0x1345('0x4d')]['find']({'where':{'name':_0x5aab90,'userProfileId':_0x3f336e[_0x1345('0x4e')]},'raw':!![]})[_0x1345('0x24')](function(_0x49fda2){if(_0x49fda2&&_0x49fda2['autoAssociation']===0x0){return db[_0x1345('0x26')]['create']({'name':_0x4ce41d[_0x1345('0x28')],'resourceId':_0x4ce41d['id'],'type':_0x49fda2[_0x1345('0x28')],'sectionId':_0x49fda2['id']},{})[_0x1345('0x24')](function(){return _0x379a98;});}else{return _0x379a98;}})['catch'](function(_0x5d6526){logger['error'](_0x1345('0x4f'),_0x5d6526);throw _0x5d6526;});}return _0x379a98;})[_0x1345('0x24')](respondWithResult(_0x27fc27,0xc9))[_0x1345('0x42')](handleError(_0x27fc27,null));};exports[_0x1345('0x23')]=function(_0x52db68,_0x257009){if(_0x52db68['body']['id']){delete _0x52db68[_0x1345('0x50')]['id'];}return db[_0x1345('0x3f')][_0x1345('0x48')]({'where':{'id':_0x52db68[_0x1345('0x44')]['id']}})[_0x1345('0x24')](handleEntityNotFound(_0x257009,null))[_0x1345('0x24')](saveUpdates(_0x52db68[_0x1345('0x50')],null))[_0x1345('0x24')](respondWithResult(_0x257009,null))[_0x1345('0x42')](handleError(_0x257009,null));};exports[_0x1345('0x25')]=function(_0x5e7b35,_0x37201e){return db[_0x1345('0x3f')][_0x1345('0x48')]({'where':{'id':_0x5e7b35[_0x1345('0x44')]['id']}})[_0x1345('0x24')](handleEntityNotFound(_0x37201e,null))[_0x1345('0x24')](removeEntity(_0x37201e,null))[_0x1345('0x42')](handleError(_0x37201e,null));}; \ No newline at end of file +var _0xf72b=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','end','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf72b,0x1d9));var _0xbf72=function(_0x5af6d1,_0x82b775){_0x5af6d1=_0x5af6d1-0x0;var _0x37910d=_0xf72b[_0x5af6d1];return _0x37910d;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){var _0x4f4dc0=_0x428361[_0xbf72('0x27')]({'plain':!![]});var _0x392a8c=_0xbf72('0x28');return db['UserProfileResource'][_0xbf72('0x26')]({'where':{'type':_0x392a8c,'resourceId':_0x4f4dc0['id']}})[_0xbf72('0x25')](function(){return _0x428361;});})[_0xbf72('0x25')](function(){_0x4c7f3d[_0xbf72('0x1a')](0xcc)[_0xbf72('0x29')]();});}};}function handleEntityNotFound(_0x2b1ff1,_0x182154){return function(_0x25ecdf){if(!_0x25ecdf){_0x2b1ff1[_0xbf72('0x19')](0x194);}return _0x25ecdf;};}function handleError(_0x92307f,_0x280d7a){_0x280d7a=_0x280d7a||0x1f4;return function(_0x20e747){logger[_0xbf72('0x2a')](_0x20e747[_0xbf72('0x2b')]);if(_0x20e747[_0xbf72('0x2c')]){delete _0x20e747['name'];}_0x92307f[_0xbf72('0x1a')](_0x280d7a)[_0xbf72('0x2d')](_0x20e747);};}exports[_0xbf72('0x2e')]=function(_0x28850d,_0xb1ee4e){var _0x82c0f0={},_0x35ecdc={},_0x209b2b={'count':0x0,'rows':[]};var _0x1be26a=_[_0xbf72('0x2f')](db[_0xbf72('0x30')][_0xbf72('0x31')],function(_0x423c61){return{'name':_0x423c61[_0xbf72('0x32')],'type':_0x423c61['type'][_0xbf72('0x33')]};});_0x35ecdc[_0xbf72('0x34')]=_[_0xbf72('0x2f')](_0x1be26a,'name');_0x35ecdc['query']=_['keys'](_0x28850d[_0xbf72('0x35')]);_0x35ecdc[_0xbf72('0x36')]=_[_0xbf72('0x37')](_0x35ecdc['model'],_0x35ecdc[_0xbf72('0x35')]);_0x82c0f0[_0xbf72('0x38')]=_['intersection'](_0x35ecdc[_0xbf72('0x34')],qs['fields'](_0x28850d[_0xbf72('0x35')][_0xbf72('0x39')]));_0x82c0f0['attributes']=_0x82c0f0['attributes'][_0xbf72('0x3a')]?_0x82c0f0[_0xbf72('0x38')]:_0x35ecdc[_0xbf72('0x34')];if(!_0x28850d[_0xbf72('0x35')][_0xbf72('0x3b')](_0xbf72('0x3c'))){_0x82c0f0[_0xbf72('0x1d')]=qs[_0xbf72('0x1d')](_0x28850d[_0xbf72('0x35')]['limit']);_0x82c0f0[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x28850d[_0xbf72('0x35')][_0xbf72('0x1c')]);}_0x82c0f0['order']=qs[_0xbf72('0x3d')](_0x28850d[_0xbf72('0x35')]['sort']);_0x82c0f0[_0xbf72('0x3e')]=qs['filters'](_['pick'](_0x28850d['query'],_0x35ecdc['filters']),_0x1be26a);if(_0x28850d[_0xbf72('0x35')]['filter']){_0x82c0f0['where']=_[_0xbf72('0x3f')](_0x82c0f0['where'],{'$or':_[_0xbf72('0x2f')](_0x1be26a,function(_0xde4ed9){if(_0xde4ed9['type']!==_0xbf72('0x40')){var _0x4aee64={};_0x4aee64[_0xde4ed9['name']]={'$like':'%'+_0x28850d[_0xbf72('0x35')][_0xbf72('0x41')]+'%'};return _0x4aee64;}})});}_0x82c0f0=_[_0xbf72('0x3f')]({},_0x82c0f0,_0x28850d[_0xbf72('0x42')]);var _0xffb333={'where':_0x82c0f0[_0xbf72('0x3e')]};return db[_0xbf72('0x30')][_0xbf72('0x1f')](_0xffb333)['then'](function(_0x311a0c){_0x209b2b[_0xbf72('0x1f')]=_0x311a0c;if(_0x28850d['query'][_0xbf72('0x43')]){_0x82c0f0['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xbf72('0x44')](_0x82c0f0);})[_0xbf72('0x25')](function(_0x3992fd){_0x209b2b[_0xbf72('0x45')]=_0x3992fd;return _0x209b2b;})[_0xbf72('0x25')](respondWithFilteredResult(_0xb1ee4e,_0x82c0f0))['catch'](handleError(_0xb1ee4e,null));};exports['show']=function(_0x4b8f31,_0x359c2b){var _0x3a7828={'raw':![],'where':{'id':_0x4b8f31[_0xbf72('0x46')]['id']}},_0x3871d0={};_0x3871d0['model']=_['keys'](db[_0xbf72('0x30')]['rawAttributes']);_0x3871d0[_0xbf72('0x35')]=_[_0xbf72('0x47')](_0x4b8f31[_0xbf72('0x35')]);_0x3871d0[_0xbf72('0x36')]=_['intersection'](_0x3871d0[_0xbf72('0x34')],_0x3871d0[_0xbf72('0x35')]);_0x3a7828[_0xbf72('0x38')]=_[_0xbf72('0x37')](_0x3871d0['model'],qs[_0xbf72('0x39')](_0x4b8f31[_0xbf72('0x35')]['fields']));_0x3a7828[_0xbf72('0x38')]=_0x3a7828[_0xbf72('0x38')][_0xbf72('0x3a')]?_0x3a7828[_0xbf72('0x38')]:_0x3871d0[_0xbf72('0x34')];if(_0x4b8f31[_0xbf72('0x35')][_0xbf72('0x43')]){_0x3a7828['include']=[{'all':!![]}];}_0x3a7828=_['merge']({},_0x3a7828,_0x4b8f31['options']);return db[_0xbf72('0x30')]['find'](_0x3a7828)[_0xbf72('0x25')](handleEntityNotFound(_0x359c2b,null))['then'](respondWithResult(_0x359c2b,null))['catch'](handleError(_0x359c2b,null));};exports['create']=function(_0x9f94ea,_0x15a271){return db[_0xbf72('0x30')][_0xbf72('0x48')](_0x9f94ea[_0xbf72('0x49')],{})[_0xbf72('0x25')](function(_0x530663){var _0x3ffa72=_0x9f94ea['user'][_0xbf72('0x27')]({'plain':!![]});if(!_0x3ffa72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ffa72[_0xbf72('0x4a')]===_0xbf72('0x4b')){var _0x45e4d5=_0x530663[_0xbf72('0x27')]({'plain':!![]});var _0x26ce94=_0xbf72('0x28');return db[_0xbf72('0x4c')][_0xbf72('0x4d')]({'where':{'name':_0x26ce94,'userProfileId':_0x3ffa72[_0xbf72('0x4e')]},'raw':!![]})['then'](function(_0x1fb168){if(_0x1fb168&&_0x1fb168[_0xbf72('0x4f')]===0x0){return db[_0xbf72('0x50')]['create']({'name':_0x45e4d5[_0xbf72('0x2c')],'resourceId':_0x45e4d5['id'],'type':_0x1fb168[_0xbf72('0x2c')],'sectionId':_0x1fb168['id']},{})[_0xbf72('0x25')](function(){return _0x530663;});}else{return _0x530663;}})[_0xbf72('0x51')](function(_0x824918){logger['error'](_0xbf72('0x52'),_0x824918);throw _0x824918;});}return _0x530663;})[_0xbf72('0x25')](respondWithResult(_0x15a271,0xc9))['catch'](handleError(_0x15a271,null));};exports[_0xbf72('0x24')]=function(_0x5e2dcd,_0x58080b){if(_0x5e2dcd[_0xbf72('0x49')]['id']){delete _0x5e2dcd[_0xbf72('0x49')]['id'];}return db[_0xbf72('0x30')][_0xbf72('0x4d')]({'where':{'id':_0x5e2dcd[_0xbf72('0x46')]['id']}})['then'](handleEntityNotFound(_0x58080b,null))['then'](saveUpdates(_0x5e2dcd['body'],null))[_0xbf72('0x25')](respondWithResult(_0x58080b,null))[_0xbf72('0x51')](handleError(_0x58080b,null));};exports[_0xbf72('0x26')]=function(_0x1648d0,_0x5cfbc4){return db['VoiceChanSpy'][_0xbf72('0x4d')]({'where':{'id':_0x1648d0[_0xbf72('0x46')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x5cfbc4,null))['then'](removeEntity(_0x5cfbc4,null))[_0xbf72('0x51')](handleError(_0x5cfbc4,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 4ab56b8..b400dac 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 _0xca59=['VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','concat','findAll','internal','agent','then','catch','exports','models','define','length'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0xca59,0x69));var _0x9ca5=function(_0xa91d4f,_0x199257){_0xa91d4f=_0xa91d4f-0x0;var _0x2e4bec=_0xca59[_0xa91d4f];return _0x2e4bec;};'use strict';var _=require('lodash');var util=require(_0x9ca5('0x0'));var BPromise=require(_0x9ca5('0x1'));var attributes=require(_0x9ca5('0x2'));var getUserApplications=function(_0x5e3c85,_0x8d5abb,_0x4e36e2){var _0x31b767=0x1;var _0x4121fe=[];var _0x49b957={'context':_0x8d5abb['context']||_0x9ca5('0x3'),'exten':util[_0x9ca5('0x4')](_0x9ca5('0x5'),_0x5e3c85[_0x9ca5('0x6')],_0x4e36e2),'type':_0x9ca5('0x7'),'isApp':![],'ChanSpyId':_0x5e3c85['id'],'UserId':_0x8d5abb['id']};_0x4121fe[_0x9ca5('0x8')](_[_0x9ca5('0x9')]({'app':'Set','appdata':util['format'](_0x9ca5('0xa'),_0x9ca5('0xb')),'priority':_0x31b767++},_0x49b957));if(_0x5e3c85['record']){_0x4121fe[_0x9ca5('0x8')](_[_0x9ca5('0x9')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x5e3c85['recordingFormat']),'priority':_0x31b767++},_0x49b957));}if(_0x5e3c85[_0x9ca5('0xc')]){_0x4121fe[_0x9ca5('0x8')](_['merge']({'app':_0x9ca5('0xd'),'appdata':_0x5e3c85['password'],'priority':_0x31b767++},_0x49b957));}_0x4121fe['push'](_['merge']({'app':_0x9ca5('0xe'),'appdata':util['format'](_0x9ca5('0xf'),_0x8d5abb[_0x9ca5('0x10')],_0x5e3c85['options']?_0x5e3c85[_0x9ca5('0x11')][_0x9ca5('0x12')](''):''),'priority':_0x31b767++},_0x49b957));if(_0x5e3c85[_0x9ca5('0x13')]){_0x4121fe[_0x9ca5('0x8')](_[_0x9ca5('0x9')]({'app':_0x9ca5('0x14'),'priority':_0x31b767++},_0x49b957));}return _0x4121fe;};var getChanSpyApplications=function(_0x2bf1d9,_0x3611b0){var _0x1b82ba=[];for(var _0x26e218=0x0,_0x2b1acf=0x1;_0x26e218<_0x3611b0['length'];_0x26e218++,_0x2b1acf=0x1){_0x1b82ba=_0x1b82ba[_0x9ca5('0x15')](getUserApplications(_0x2bf1d9,_0x3611b0[_0x26e218],_0x3611b0[_0x26e218]['internal']));if(_0x3611b0[_0x26e218]['internal']!=_0x3611b0[_0x26e218]['name']){_0x1b82ba=_0x1b82ba[_0x9ca5('0x15')](getUserApplications(_0x2bf1d9,_0x3611b0[_0x26e218],_0x3611b0[_0x26e218][_0x9ca5('0x10')]));}}return _0x1b82ba;};var getChanSpyPromise=function(_0x1ab45a,_0x797fe6){return new BPromise(function(_0x1f522d,_0x9b563e){return _0x1ab45a['User'][_0x9ca5('0x16')]({'attributes':['id','name',_0x9ca5('0x17')],'where':{'role':_0x9ca5('0x18'),'chanspy':!![]},'raw':!![]})[_0x9ca5('0x19')](function(_0x100962){if(_0x100962){return _0x1f522d(getChanSpyApplications(_0x797fe6,_0x100962));}return _0x1f522d([]);})[_0x9ca5('0x1a')](function(_0x482de3){_0x9b563e(_0x482de3);});});};module[_0x9ca5('0x1b')]=function(_0x2a9979,_0x5c4537){var _0x143ed8=_0x2a9979[_0x9ca5('0x1c')];return _0x2a9979[_0x9ca5('0x1d')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x556748,_0x2877b8,_0x300de3){return getChanSpyPromise(_0x143ed8,_0x556748)['then'](function(_0x582507){if(_0x582507&&_0x582507[_0x9ca5('0x1e')]){return _0x143ed8[_0x9ca5('0x1f')][_0x9ca5('0x20')](_0x582507);}})['then'](function(){_0x300de3();})['catch'](function(_0x261318){_0x300de3(_0x261318);});},'afterUpdate':function(_0x343a60,_0x588dbc,_0x47bc0f){return _0x143ed8[_0x9ca5('0x1f')][_0x9ca5('0x21')]({'where':{'ChanSpyId':_0x343a60['id']}})[_0x9ca5('0x19')](function(){return getChanSpyPromise(_0x143ed8,_0x343a60);})[_0x9ca5('0x19')](function(_0x72d335){if(_0x72d335&&_0x72d335[_0x9ca5('0x1e')]){return _0x143ed8[_0x9ca5('0x1f')][_0x9ca5('0x20')](_0x72d335);}})[_0x9ca5('0x19')](function(){_0x47bc0f();})[_0x9ca5('0x1a')](function(_0x1eec22){_0x47bc0f(_0x1eec22);});},'afterDestroy':function(_0x45e05d,_0x17e2d0,_0x161e78){return _0x143ed8['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x45e05d['id']}})[_0x9ca5('0x19')](function(){_0x161e78();})[_0x9ca5('0x1a')](function(_0x69f6f7){_0x161e78(_0x69f6f7);});}}});}; \ No newline at end of file +var _0x5151=['format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','Authenticate','ChanSpy','name','options','join','length','concat','internal','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip'];(function(_0x8c67c0,_0xf612ec){var _0x23069e=function(_0xe90af2){while(--_0xe90af2){_0x8c67c0['push'](_0x8c67c0['shift']());}};_0x23069e(++_0xf612ec);}(_0x5151,0x1cf));var _0x1515=function(_0x391c94,_0x3176f1){_0x391c94=_0x391c94-0x0;var _0x45636d=_0x5151[_0x391c94];return _0x45636d;};'use strict';var _=require(_0x1515('0x0'));var util=require(_0x1515('0x1'));var BPromise=require(_0x1515('0x2'));var attributes=require(_0x1515('0x3'));var getUserApplications=function(_0x30bf36,_0x48e217,_0x1c4c8c){var _0x58cc13=0x1;var _0x5e060c=[];var _0x12f82c={'context':_0x48e217['context']||_0x1515('0x4'),'exten':util[_0x1515('0x5')]('%s%s',_0x30bf36[_0x1515('0x6')],_0x1c4c8c),'type':_0x1515('0x7'),'isApp':![],'ChanSpyId':_0x30bf36['id'],'UserId':_0x48e217['id']};_0x5e060c[_0x1515('0x8')](_[_0x1515('0x9')]({'app':_0x1515('0xa'),'appdata':util[_0x1515('0x5')](_0x1515('0xb'),_0x1515('0xc')),'priority':_0x58cc13++},_0x12f82c));if(_0x30bf36[_0x1515('0xd')]){_0x5e060c[_0x1515('0x8')](_[_0x1515('0x9')]({'app':'MixMonitor','appdata':util[_0x1515('0x5')](_0x1515('0xe'),_0x30bf36['recordingFormat']),'priority':_0x58cc13++},_0x12f82c));}if(_0x30bf36[_0x1515('0xf')]){_0x5e060c[_0x1515('0x8')](_[_0x1515('0x9')]({'app':_0x1515('0x10'),'appdata':_0x30bf36['password'],'priority':_0x58cc13++},_0x12f82c));}_0x5e060c['push'](_[_0x1515('0x9')]({'app':_0x1515('0x11'),'appdata':util['format']('SIP/%s,%s',_0x48e217[_0x1515('0x12')],_0x30bf36[_0x1515('0x13')]?_0x30bf36['options'][_0x1515('0x14')](''):''),'priority':_0x58cc13++},_0x12f82c));if(_0x30bf36['record']){_0x5e060c[_0x1515('0x8')](_[_0x1515('0x9')]({'app':'StopMixMonitor','priority':_0x58cc13++},_0x12f82c));}return _0x5e060c;};var getChanSpyApplications=function(_0xebe53f,_0x2a83d7){var _0xbee9fb=[];for(var _0x3c64d5=0x0,_0x442845=0x1;_0x3c64d5<_0x2a83d7[_0x1515('0x15')];_0x3c64d5++,_0x442845=0x1){_0xbee9fb=_0xbee9fb[_0x1515('0x16')](getUserApplications(_0xebe53f,_0x2a83d7[_0x3c64d5],_0x2a83d7[_0x3c64d5][_0x1515('0x17')]));if(_0x2a83d7[_0x3c64d5][_0x1515('0x17')]!=_0x2a83d7[_0x3c64d5]['name']){_0xbee9fb=_0xbee9fb[_0x1515('0x16')](getUserApplications(_0xebe53f,_0x2a83d7[_0x3c64d5],_0x2a83d7[_0x3c64d5][_0x1515('0x12')]));}}return _0xbee9fb;};var getChanSpyPromise=function(_0x3ed5d6,_0x54e429){return new BPromise(function(_0x4d591d,_0xe68427){return _0x3ed5d6[_0x1515('0x18')][_0x1515('0x19')]({'attributes':['id',_0x1515('0x12'),_0x1515('0x17')],'where':{'role':_0x1515('0x1a'),'chanspy':!![]},'raw':!![]})[_0x1515('0x1b')](function(_0x21d08e){if(_0x21d08e){return _0x4d591d(getChanSpyApplications(_0x54e429,_0x21d08e));}return _0x4d591d([]);})[_0x1515('0x1c')](function(_0x356c05){_0xe68427(_0x356c05);});});};module[_0x1515('0x1d')]=function(_0x1c496e,_0x49e144){var _0x2a0aca=_0x1c496e['models'];return _0x1c496e[_0x1515('0x1e')](_0x1515('0x1f'),attributes,{'tableName':_0x1515('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x135caa,_0x384800,_0x16cc58){return getChanSpyPromise(_0x2a0aca,_0x135caa)['then'](function(_0x3c0259){if(_0x3c0259&&_0x3c0259[_0x1515('0x15')]){return _0x2a0aca[_0x1515('0x21')]['bulkCreate'](_0x3c0259);}})[_0x1515('0x1b')](function(){_0x16cc58();})[_0x1515('0x1c')](function(_0x5ac74c){_0x16cc58(_0x5ac74c);});},'afterUpdate':function(_0x28f6f0,_0x35f6b2,_0x18d709){return _0x2a0aca[_0x1515('0x21')][_0x1515('0x22')]({'where':{'ChanSpyId':_0x28f6f0['id']}})['then'](function(){return getChanSpyPromise(_0x2a0aca,_0x28f6f0);})[_0x1515('0x1b')](function(_0x245740){if(_0x245740&&_0x245740[_0x1515('0x15')]){return _0x2a0aca[_0x1515('0x21')][_0x1515('0x23')](_0x245740);}})['then'](function(){_0x18d709();})[_0x1515('0x1c')](function(_0x18a046){_0x18d709(_0x18a046);});},'afterDestroy':function(_0x451004,_0x17afd5,_0x5e0234){return _0x2a0aca[_0x1515('0x21')][_0x1515('0x22')]({'where':{'ChanSpyId':_0x451004['id']}})[_0x1515('0x1b')](function(){_0x5e0234();})[_0x1515('0x1c')](function(_0x21a6d5){_0x5e0234(_0x21a6d5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 8410e9c..e0fc0a9 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 _0x44a3=['http','request','then','info','request\x20sent','debug','error','code','message','VoiceChanSpy,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e347b,_0x59ef61){var _0x427134=function(_0x4bf78c){while(--_0x4bf78c){_0x5e347b['push'](_0x5e347b['shift']());}};_0x427134(++_0x59ef61);}(_0x44a3,0x1a9));var _0x344a=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0x44a3[_0x2e0d2a];return _0x4014f0;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});} \ No newline at end of file +var _0x6a24=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x12fd15,_0x59601a){var _0x43d2aa=function(_0x35492c){while(--_0x35492c){_0x12fd15['push'](_0x12fd15['shift']());}};_0x43d2aa(++_0x59601a);}(_0x6a24,0xd1));var _0x46a2=function(_0x45c219,_0x2fcc2d){_0x45c219=_0x45c219-0x0;var _0x58aa6d=_0x6a24[_0x45c219];return _0x58aa6d;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ef093a1..f3b38b7 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 _0xa7a0=['/:id','show','post','create','update','multer','util','path','fs-extra','../../config/environment','./voiceContext.controller','get','isAuthenticated','index'];(function(_0x9f1aad,_0x5cdd45){var _0x5223ca=function(_0x313e14){while(--_0x313e14){_0x9f1aad['push'](_0x9f1aad['shift']());}};_0x5223ca(++_0x5cdd45);}(_0xa7a0,0xbb));var _0x0a7a=function(_0x42930c,_0x3a9d3b){_0x42930c=_0x42930c-0x0;var _0x25eec4=_0xa7a0[_0x42930c];return _0x25eec4;};'use strict';var multer=require(_0x0a7a('0x0'));var util=require(_0x0a7a('0x1'));var path=require(_0x0a7a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0a7a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a7a('0x4'));var controller=require(_0x0a7a('0x5'));router[_0x0a7a('0x6')]('/',auth[_0x0a7a('0x7')](),controller[_0x0a7a('0x8')]);router[_0x0a7a('0x6')](_0x0a7a('0x9'),auth[_0x0a7a('0x7')](),controller[_0x0a7a('0xa')]);router[_0x0a7a('0xb')]('/',auth[_0x0a7a('0x7')](),controller[_0x0a7a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a7a('0xd')]);router['delete'](_0x0a7a('0x9'),auth[_0x0a7a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xed1e=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1c4cf4,_0x5dd363){var _0x13a8e9=function(_0x417fb2){while(--_0x417fb2){_0x1c4cf4['push'](_0x1c4cf4['shift']());}};_0x13a8e9(++_0x5dd363);}(_0xed1e,0xc6));var _0xeed1=function(_0x424329,_0x1a3e61){_0x424329=_0x424329-0x0;var _0x324625=_0xed1e[_0x424329];return _0x324625;};'use strict';var multer=require(_0xeed1('0x0'));var util=require(_0xeed1('0x1'));var path=require(_0xeed1('0x2'));var timeout=require(_0xeed1('0x3'));var express=require(_0xeed1('0x4'));var router=express['Router']();var fs_extra=require(_0xeed1('0x5'));var auth=require(_0xeed1('0x6'));var interaction=require(_0xeed1('0x7'));var config=require(_0xeed1('0x8'));var controller=require(_0xeed1('0x9'));router[_0xeed1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeed1('0xa')](_0xeed1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xeed1('0xc')]('/',auth[_0xeed1('0xd')](),controller[_0xeed1('0xe')]);router[_0xeed1('0xf')](_0xeed1('0xb'),auth[_0xeed1('0xd')](),controller[_0xeed1('0x10')]);router[_0xeed1('0x11')]('/:id',auth[_0xeed1('0xd')](),controller[_0xeed1('0x12')]);module[_0xeed1('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 08645cb..eaec7b5 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 _0xc82b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xc82b,0x1ef));var _0xbc82=function(_0x33eb89,_0x24aa10){_0x33eb89=_0x33eb89-0x0;var _0x137913=_0xc82b[_0x33eb89];return _0x137913;};'use strict';var Sequelize=require(_0xbc82('0x0'));module[_0xbc82('0x1')]={'name':{'type':Sequelize[_0xbc82('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbc82('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x41f3=['name','STRING','exports'];(function(_0x36a093,_0x46d862){var _0x2069fb=function(_0x3b9905){while(--_0x3b9905){_0x36a093['push'](_0x36a093['shift']());}};_0x2069fb(++_0x46d862);}(_0x41f3,0x17c));var _0x341f=function(_0x5951cb,_0x1bef17){_0x5951cb=_0x5951cb-0x0;var _0x4fb6a5=_0x41f3[_0x5951cb];return _0x4fb6a5;};'use strict';var Sequelize=require('sequelize');module[_0x341f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x341f('0x1')},'description':{'type':Sequelize[_0x341f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 9443f78..4c18d6e 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 _0x44e8=['filter','VoiceContext','includeAll','rows','params','keys','include','options','find','catch','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource','end','name','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge'];(function(_0x335201,_0x314d57){var _0x39b053=function(_0x22d774){while(--_0x22d774){_0x335201['push'](_0x335201['shift']());}};_0x39b053(++_0x314d57);}(_0x44e8,0x86));var _0x844e=function(_0x1ebdda,_0x404420){_0x1ebdda=_0x1ebdda-0x0;var _0x594bdf=_0x44e8[_0x1ebdda];return _0x594bdf;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require(_0x844e('0x1'));var zipdir=require(_0x844e('0x2'));var jsonpatch=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var moment=require(_0x844e('0x5'));var BPromise=require(_0x844e('0x6'));var Mustache=require(_0x844e('0x7'));var util=require(_0x844e('0x8'));var path=require(_0x844e('0x9'));var sox=require(_0x844e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x844e('0xc'));var jsforce=require(_0x844e('0xd'));var deskjs=require(_0x844e('0xe'));var toCsv=require(_0x844e('0xf'));var querystring=require(_0x844e('0x10'));var Papa=require(_0x844e('0x11'));var Redis=require('ioredis');var authService=require(_0x844e('0x12'));var qs=require(_0x844e('0x13'));var as=require(_0x844e('0x14'));var hardwareService=require(_0x844e('0x15'));var logger=require(_0x844e('0x16'))('api');var utils=require(_0x844e('0x17'));var config=require(_0x844e('0x18'));var licenseUtil=require(_0x844e('0x19'));var db=require(_0x844e('0x1a'))['db'];var jayson=require(_0x844e('0x1b'));var client=jayson['client'][_0x844e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5be80b,_0x48448a,_0x3d2d41,_0x4257d4){return new BPromise(function(_0x1c4241,_0x36461e){var _0x347e39=_0x4257d4||client;return _0x347e39[_0x844e('0x1d')](_0x5be80b,_0x3d2d41)[_0x844e('0x1e')](function(_0x4c2139){logger[_0x844e('0x1f')](_0x844e('0x20'),_0x48448a,_0x844e('0x21'));logger['debug'](_0x844e('0x22'),_0x48448a,'request\x20sent',JSON[_0x844e('0x23')](_0x4c2139));if(_0x4c2139[_0x844e('0x24')]){if(_0x4c2139[_0x844e('0x24')][_0x844e('0x25')]===0x1f4){logger[_0x844e('0x24')]('VoiceContext,\x20%s,\x20%s',_0x48448a,_0x4c2139[_0x844e('0x24')][_0x844e('0x26')]);return _0x36461e(_0x4c2139[_0x844e('0x24')][_0x844e('0x26')]);}logger[_0x844e('0x24')](_0x844e('0x20'),_0x48448a,_0x4c2139[_0x844e('0x24')][_0x844e('0x26')]);return _0x1c4241(_0x4c2139['error'][_0x844e('0x26')]);}else{logger[_0x844e('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x48448a,'request\x20sent');_0x1c4241(_0x4c2139[_0x844e('0x27')][_0x844e('0x26')]);}})['catch'](function(_0x500968){logger['error'](_0x844e('0x20'),_0x48448a,_0x500968);_0x36461e(_0x500968);});});}function respondWithStatusCode(_0x1868f4,_0x251669){_0x251669=_0x251669||0xcc;return function(_0x32456){if(_0x32456){return _0x1868f4[_0x844e('0x28')](_0x251669);}return _0x1868f4['status'](_0x251669)['end']();};}function respondWithResult(_0x47e31e,_0x3f685a){_0x3f685a=_0x3f685a||0xc8;return function(_0x1ec84f){if(_0x1ec84f){return _0x47e31e[_0x844e('0x29')](_0x3f685a)[_0x844e('0x2a')](_0x1ec84f);}};}function respondWithFilteredResult(_0xd3cfa8,_0xd1ba84){return function(_0x5c2fdf){if(_0x5c2fdf){var _0xc35ec9=typeof _0xd1ba84[_0x844e('0x2b')]==='undefined'&&typeof _0xd1ba84[_0x844e('0x2c')]===_0x844e('0x2d');var _0x5cfd46=_0x5c2fdf['count'];var _0x2845eb=_0xc35ec9?0x0:_0xd1ba84[_0x844e('0x2b')];var _0x24da61=_0xc35ec9?_0x5c2fdf[_0x844e('0x2e')]:_0xd1ba84[_0x844e('0x2b')]+_0xd1ba84[_0x844e('0x2c')];var _0x417264;if(_0x24da61>=_0x5cfd46){_0x24da61=_0x5cfd46;_0x417264=0xc8;}else{_0x417264=0xce;}_0xd3cfa8['status'](_0x417264);return _0xd3cfa8['set'](_0x844e('0x2f'),_0x2845eb+'-'+_0x24da61+'/'+_0x5cfd46)[_0x844e('0x2a')](_0x5c2fdf);}return null;};}function patchUpdates(_0x777d77){return function(_0xacd962){try{jsonpatch[_0x844e('0x30')](_0xacd962,_0x777d77,!![]);}catch(_0x29882c){return BPromise[_0x844e('0x31')](_0x29882c);}return _0xacd962[_0x844e('0x32')]();};}function saveUpdates(_0x19ecfb,_0x232d1a){return function(_0x253f17){if(_0x253f17){return _0x253f17[_0x844e('0x33')](_0x19ecfb)[_0x844e('0x1e')](function(_0x1fe93c){return _0x1fe93c;});}return null;};}function removeEntity(_0x5632db,_0x16fec0){return function(_0x439f74){if(_0x439f74){return _0x439f74[_0x844e('0x34')]()['then'](function(){var _0x5dee19=_0x439f74['get']({'plain':!![]});var _0x373dab=_0x844e('0x35');return db[_0x844e('0x36')][_0x844e('0x34')]({'where':{'type':_0x373dab,'resourceId':_0x5dee19['id']}})[_0x844e('0x1e')](function(){return _0x439f74;});})[_0x844e('0x1e')](function(){_0x5632db[_0x844e('0x29')](0xcc)[_0x844e('0x37')]();});}};}function handleEntityNotFound(_0x18e182,_0x56263a){return function(_0x286aa5){if(!_0x286aa5){_0x18e182['sendStatus'](0x194);}return _0x286aa5;};}function handleError(_0x5704ae,_0x19b6fa){_0x19b6fa=_0x19b6fa||0x1f4;return function(_0x5277ee){logger[_0x844e('0x24')](_0x5277ee['stack']);if(_0x5277ee[_0x844e('0x38')]){delete _0x5277ee[_0x844e('0x38')];}_0x5704ae[_0x844e('0x29')](_0x19b6fa)['send'](_0x5277ee);};}exports['index']=function(_0x25d5e5,_0x2a97b6){var _0x2077bd={},_0x4b4271={},_0x5a57b1={'count':0x0,'rows':[]};var _0x453d6d=_[_0x844e('0x39')](db['VoiceContext'][_0x844e('0x3a')],function(_0x3df710){return{'name':_0x3df710[_0x844e('0x3b')],'type':_0x3df710[_0x844e('0x3c')]['key']};});_0x4b4271['model']=_[_0x844e('0x39')](_0x453d6d,_0x844e('0x38'));_0x4b4271[_0x844e('0x3d')]=_['keys'](_0x25d5e5[_0x844e('0x3d')]);_0x4b4271['filters']=_[_0x844e('0x3e')](_0x4b4271[_0x844e('0x3f')],_0x4b4271[_0x844e('0x3d')]);_0x2077bd[_0x844e('0x40')]=_[_0x844e('0x3e')](_0x4b4271[_0x844e('0x3f')],qs[_0x844e('0x41')](_0x25d5e5['query'][_0x844e('0x41')]));_0x2077bd['attributes']=_0x2077bd[_0x844e('0x40')][_0x844e('0x42')]?_0x2077bd['attributes']:_0x4b4271[_0x844e('0x3f')];if(!_0x25d5e5[_0x844e('0x3d')]['hasOwnProperty'](_0x844e('0x43'))){_0x2077bd[_0x844e('0x2c')]=qs['limit'](_0x25d5e5[_0x844e('0x3d')]['limit']);_0x2077bd[_0x844e('0x2b')]=qs[_0x844e('0x2b')](_0x25d5e5[_0x844e('0x3d')][_0x844e('0x2b')]);}_0x2077bd[_0x844e('0x44')]=qs[_0x844e('0x45')](_0x25d5e5[_0x844e('0x3d')][_0x844e('0x45')]);_0x2077bd[_0x844e('0x46')]=qs[_0x844e('0x47')](_[_0x844e('0x48')](_0x25d5e5[_0x844e('0x3d')],_0x4b4271[_0x844e('0x47')]),_0x453d6d);if(_0x25d5e5[_0x844e('0x3d')]['filter']){_0x2077bd[_0x844e('0x46')]=_[_0x844e('0x49')](_0x2077bd[_0x844e('0x46')],{'$or':_['map'](_0x453d6d,function(_0xb8652e){if(_0xb8652e[_0x844e('0x3c')]!=='VIRTUAL'){var _0x93fc8b={};_0x93fc8b[_0xb8652e[_0x844e('0x38')]]={'$like':'%'+_0x25d5e5[_0x844e('0x3d')][_0x844e('0x4a')]+'%'};return _0x93fc8b;}})});}_0x2077bd=_[_0x844e('0x49')]({},_0x2077bd,_0x25d5e5['options']);var _0x5537c1={'where':_0x2077bd['where']};return db[_0x844e('0x4b')][_0x844e('0x2e')](_0x5537c1)[_0x844e('0x1e')](function(_0x2f4bc7){_0x5a57b1[_0x844e('0x2e')]=_0x2f4bc7;if(_0x25d5e5[_0x844e('0x3d')][_0x844e('0x4c')]){_0x2077bd['include']=[{'all':!![]}];}return db[_0x844e('0x4b')]['findAll'](_0x2077bd);})[_0x844e('0x1e')](function(_0x13d9e9){_0x5a57b1[_0x844e('0x4d')]=_0x13d9e9;return _0x5a57b1;})[_0x844e('0x1e')](respondWithFilteredResult(_0x2a97b6,_0x2077bd))['catch'](handleError(_0x2a97b6,null));};exports['show']=function(_0x5081c1,_0x866a04){var _0x230146={'raw':![],'where':{'id':_0x5081c1[_0x844e('0x4e')]['id']}},_0x42b66a={};_0x42b66a[_0x844e('0x3f')]=_['keys'](db[_0x844e('0x4b')]['rawAttributes']);_0x42b66a[_0x844e('0x3d')]=_[_0x844e('0x4f')](_0x5081c1['query']);_0x42b66a[_0x844e('0x47')]=_[_0x844e('0x3e')](_0x42b66a[_0x844e('0x3f')],_0x42b66a['query']);_0x230146[_0x844e('0x40')]=_[_0x844e('0x3e')](_0x42b66a[_0x844e('0x3f')],qs[_0x844e('0x41')](_0x5081c1[_0x844e('0x3d')][_0x844e('0x41')]));_0x230146[_0x844e('0x40')]=_0x230146[_0x844e('0x40')][_0x844e('0x42')]?_0x230146[_0x844e('0x40')]:_0x42b66a['model'];if(_0x5081c1['query'][_0x844e('0x4c')]){_0x230146[_0x844e('0x50')]=[{'all':!![]}];}_0x230146=_[_0x844e('0x49')]({},_0x230146,_0x5081c1[_0x844e('0x51')]);return db[_0x844e('0x4b')][_0x844e('0x52')](_0x230146)[_0x844e('0x1e')](handleEntityNotFound(_0x866a04,null))[_0x844e('0x1e')](respondWithResult(_0x866a04,null))[_0x844e('0x53')](handleError(_0x866a04,null));};exports[_0x844e('0x54')]=function(_0x3f845a,_0x5b9832,_0x56c8b7){var _0x9588f3;return db[_0x844e('0x4b')][_0x844e('0x54')](_0x3f845a[_0x844e('0x55')],{'raw':!![]})[_0x844e('0x1e')](function(_0x363ae8){_0x9588f3=_0x363ae8;return db[_0x844e('0x4b')]['findAll']({'raw':!![]});})[_0x844e('0x1e')](function(_0x1a353b){var _0x3a3270=fs[_0x844e('0x56')](path[_0x844e('0x57')](config[_0x844e('0x58')],_0x844e('0x59')),_0x844e('0x5a'));var _0x317f8d=ejs[_0x844e('0x5b')](_0x3a3270,{'contexts':_0x1a353b||[]});fs[_0x844e('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x317f8d);})[_0x844e('0x1e')](function(){return respondWithRpcPromise(_0x844e('0x5d'),'create',{'module':_0x844e('0x5e')});})[_0x844e('0x1e')](function(){var _0x445a7e=_0x3f845a[_0x844e('0x5f')]['get']({'plain':!![]});if(!_0x445a7e)throw new Error(_0x844e('0x60'));if(_0x445a7e[_0x844e('0x61')]===_0x844e('0x5f')){var _0x2e5205=_0x9588f3[_0x844e('0x62')]({'plain':!![]});return db['UserProfileSection'][_0x844e('0x52')]({'where':{'name':_0x844e('0x35'),'userProfileId':_0x445a7e[_0x844e('0x63')]},'raw':!![]})[_0x844e('0x1e')](function(_0x1168ad){if(_0x1168ad&&_0x1168ad[_0x844e('0x64')]===0x0){return db['UserProfileResource'][_0x844e('0x54')]({'name':_0x2e5205[_0x844e('0x38')],'resourceId':_0x2e5205['id'],'type':_0x1168ad[_0x844e('0x38')],'sectionId':_0x1168ad['id']},{})[_0x844e('0x1e')](function(){return _0x9588f3;});}else{return _0x9588f3;}})[_0x844e('0x53')](function(_0x49f885){logger[_0x844e('0x24')](_0x844e('0x65'),_0x49f885);throw _0x49f885;});}return _0x9588f3;})[_0x844e('0x1e')](respondWithResult(_0x5b9832,0xc9))['catch'](handleError(_0x5b9832,null));};exports[_0x844e('0x33')]=function(_0x48df5e,_0x1ea8fa,_0x1dd937){var _0x554a62;return db['VoiceContext'][_0x844e('0x52')]({'where':{'id':_0x48df5e['params']['id']}})[_0x844e('0x1e')](handleEntityNotFound(_0x1ea8fa,null))[_0x844e('0x1e')](saveUpdates(_0x48df5e[_0x844e('0x55')],null))['then'](function(_0x4dcad0){if(_0x4dcad0){_0x554a62=_0x4dcad0;return db[_0x844e('0x4b')][_0x844e('0x66')]({'raw':!![]});}})['then'](function(_0x40fb72){var _0x2a7bd=fs[_0x844e('0x56')](path[_0x844e('0x57')](config[_0x844e('0x58')],_0x844e('0x59')),_0x844e('0x5a'));var _0x31fc14=ejs[_0x844e('0x5b')](_0x2a7bd,{'contexts':_0x40fb72||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x31fc14);})[_0x844e('0x1e')](function(){return respondWithRpcPromise('Reload',_0x844e('0x33'),{'module':_0x844e('0x5e')});})['then'](function(){return _0x554a62;})['then'](respondWithResult(_0x1ea8fa,null))[_0x844e('0x53')](handleError(_0x1ea8fa,null));};exports[_0x844e('0x34')]=function(_0x28c412,_0x22d25e,_0x3bc655){var _0x3bc675;return db[_0x844e('0x4b')]['find']({'where':{'id':_0x28c412[_0x844e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x22d25e,null))['then'](removeEntity(_0x22d25e,null))[_0x844e('0x1e')](function(){return db[_0x844e('0x4b')][_0x844e('0x66')]({'raw':!![]});})[_0x844e('0x1e')](function(_0x286bcc){var _0x9c3fa8=fs[_0x844e('0x56')](path['join'](config[_0x844e('0x58')],_0x844e('0x59')),'utf8');var _0x3e1d48=ejs[_0x844e('0x5b')](_0x9c3fa8,{'contexts':_0x286bcc});fs[_0x844e('0x5c')](_0x844e('0x67'),_0x3e1d48);return respondWithRpcPromise(_0x844e('0x5d'),_0x844e('0x34'),{'module':_0x844e('0x5e')});})[_0x844e('0x53')](handleError(_0x22d25e,null));}; \ No newline at end of file +var _0x6e0b=['../../mysqldb','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','show','params','intersection','includeAll','find','create','body','readFileSync','root','utf8','render','writeFileSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x6e0b,0x19a));var _0xb6e0=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x6e0b[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xb6e0('0x0'));var rimraf=require(_0xb6e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6e0('0x2'));var moment=require(_0xb6e0('0x3'));var BPromise=require(_0xb6e0('0x4'));var Mustache=require(_0xb6e0('0x5'));var util=require('util');var path=require(_0xb6e0('0x6'));var sox=require(_0xb6e0('0x7'));var csv=require(_0xb6e0('0x8'));var ejs=require(_0xb6e0('0x9'));var fs=require('fs');var fs_extra=require(_0xb6e0('0xa'));var _=require(_0xb6e0('0xb'));var squel=require(_0xb6e0('0xc'));var crypto=require('crypto');var jsforce=require(_0xb6e0('0xd'));var deskjs=require(_0xb6e0('0xe'));var toCsv=require(_0xb6e0('0x8'));var querystring=require(_0xb6e0('0xf'));var Papa=require(_0xb6e0('0x10'));var Redis=require(_0xb6e0('0x11'));var authService=require(_0xb6e0('0x12'));var qs=require(_0xb6e0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6e0('0x14'));var logger=require(_0xb6e0('0x15'))(_0xb6e0('0x16'));var utils=require(_0xb6e0('0x17'));var config=require(_0xb6e0('0x18'));var licenseUtil=require(_0xb6e0('0x19'));var db=require(_0xb6e0('0x1a'))['db'];var jayson=require(_0xb6e0('0x1b'));var client=jayson[_0xb6e0('0x1c')][_0xb6e0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2bee14,_0x2845e5,_0x56c7bb,_0x29c501){return new BPromise(function(_0x2f350c,_0x11142d){var _0x4946f3=_0x29c501||client;return _0x4946f3[_0xb6e0('0x1e')](_0x2bee14,_0x56c7bb)['then'](function(_0x5c31fa){logger['info'](_0xb6e0('0x1f'),_0x2845e5,'request\x20sent');logger[_0xb6e0('0x20')](_0xb6e0('0x21'),_0x2845e5,_0xb6e0('0x22'),JSON[_0xb6e0('0x23')](_0x5c31fa));if(_0x5c31fa[_0xb6e0('0x24')]){if(_0x5c31fa[_0xb6e0('0x24')][_0xb6e0('0x25')]===0x1f4){logger[_0xb6e0('0x24')](_0xb6e0('0x1f'),_0x2845e5,_0x5c31fa[_0xb6e0('0x24')][_0xb6e0('0x26')]);return _0x11142d(_0x5c31fa[_0xb6e0('0x24')][_0xb6e0('0x26')]);}logger[_0xb6e0('0x24')](_0xb6e0('0x1f'),_0x2845e5,_0x5c31fa['error'][_0xb6e0('0x26')]);return _0x2f350c(_0x5c31fa[_0xb6e0('0x24')]['message']);}else{logger['info'](_0xb6e0('0x1f'),_0x2845e5,_0xb6e0('0x22'));_0x2f350c(_0x5c31fa[_0xb6e0('0x27')][_0xb6e0('0x26')]);}})[_0xb6e0('0x28')](function(_0x3d89dd){logger[_0xb6e0('0x24')]('VoiceContext,\x20%s,\x20%s',_0x2845e5,_0x3d89dd);_0x11142d(_0x3d89dd);});});}function respondWithStatusCode(_0x8b92ac,_0x17a39){_0x17a39=_0x17a39||0xcc;return function(_0x5f0374){if(_0x5f0374){return _0x8b92ac[_0xb6e0('0x29')](_0x17a39);}return _0x8b92ac[_0xb6e0('0x2a')](_0x17a39)[_0xb6e0('0x2b')]();};}function respondWithResult(_0x49497a,_0x15486a){_0x15486a=_0x15486a||0xc8;return function(_0x9eb631){if(_0x9eb631){return _0x49497a[_0xb6e0('0x2a')](_0x15486a)['json'](_0x9eb631);}};}function respondWithFilteredResult(_0xc3b706,_0x159e9c){return function(_0x55b3c6){if(_0x55b3c6){var _0x3e26c=typeof _0x159e9c[_0xb6e0('0x2c')]===_0xb6e0('0x2d')&&typeof _0x159e9c['limit']===_0xb6e0('0x2d');var _0x2f0df9=_0x55b3c6[_0xb6e0('0x2e')];var _0x2fd1b9=_0x3e26c?0x0:_0x159e9c[_0xb6e0('0x2c')];var _0x4b70b0=_0x3e26c?_0x55b3c6['count']:_0x159e9c[_0xb6e0('0x2c')]+_0x159e9c[_0xb6e0('0x2f')];var _0x395e96;if(_0x4b70b0>=_0x2f0df9){_0x4b70b0=_0x2f0df9;_0x395e96=0xc8;}else{_0x395e96=0xce;}_0xc3b706['status'](_0x395e96);return _0xc3b706[_0xb6e0('0x30')](_0xb6e0('0x31'),_0x2fd1b9+'-'+_0x4b70b0+'/'+_0x2f0df9)[_0xb6e0('0x32')](_0x55b3c6);}return null;};}function patchUpdates(_0x4b843e){return function(_0xfe9a3d){try{jsonpatch[_0xb6e0('0x33')](_0xfe9a3d,_0x4b843e,!![]);}catch(_0x267148){return BPromise[_0xb6e0('0x34')](_0x267148);}return _0xfe9a3d[_0xb6e0('0x35')]();};}function saveUpdates(_0xc143aa,_0x804174){return function(_0x2ef0bb){if(_0x2ef0bb){return _0x2ef0bb['update'](_0xc143aa)[_0xb6e0('0x36')](function(_0x3e08c6){return _0x3e08c6;});}return null;};}function removeEntity(_0x559deb,_0x5331c4){return function(_0x4d888e){if(_0x4d888e){return _0x4d888e[_0xb6e0('0x37')]()[_0xb6e0('0x36')](function(){var _0x50be30=_0x4d888e[_0xb6e0('0x38')]({'plain':!![]});var _0xe1b2b9='Contexts';return db['UserProfileResource'][_0xb6e0('0x37')]({'where':{'type':_0xe1b2b9,'resourceId':_0x50be30['id']}})[_0xb6e0('0x36')](function(){return _0x4d888e;});})[_0xb6e0('0x36')](function(){_0x559deb['status'](0xcc)[_0xb6e0('0x2b')]();});}};}function handleEntityNotFound(_0x5e4254,_0x5ccc81){return function(_0x410d98){if(!_0x410d98){_0x5e4254[_0xb6e0('0x29')](0x194);}return _0x410d98;};}function handleError(_0x2fa268,_0x4e2309){_0x4e2309=_0x4e2309||0x1f4;return function(_0xc2104){logger[_0xb6e0('0x24')](_0xc2104[_0xb6e0('0x39')]);if(_0xc2104[_0xb6e0('0x3a')]){delete _0xc2104[_0xb6e0('0x3a')];}_0x2fa268[_0xb6e0('0x2a')](_0x4e2309)['send'](_0xc2104);};}exports[_0xb6e0('0x3b')]=function(_0x153ccb,_0x2e6501){var _0x4fbc44={},_0x11df2a={},_0x104a32={'count':0x0,'rows':[]};var _0x3de094=_[_0xb6e0('0x3c')](db[_0xb6e0('0x3d')][_0xb6e0('0x3e')],function(_0x5e2c4e){return{'name':_0x5e2c4e[_0xb6e0('0x3f')],'type':_0x5e2c4e[_0xb6e0('0x40')][_0xb6e0('0x41')]};});_0x11df2a[_0xb6e0('0x42')]=_[_0xb6e0('0x3c')](_0x3de094,_0xb6e0('0x3a'));_0x11df2a[_0xb6e0('0x43')]=_[_0xb6e0('0x44')](_0x153ccb[_0xb6e0('0x43')]);_0x11df2a[_0xb6e0('0x45')]=_['intersection'](_0x11df2a[_0xb6e0('0x42')],_0x11df2a['query']);_0x4fbc44['attributes']=_['intersection'](_0x11df2a['model'],qs[_0xb6e0('0x46')](_0x153ccb[_0xb6e0('0x43')][_0xb6e0('0x46')]));_0x4fbc44[_0xb6e0('0x47')]=_0x4fbc44[_0xb6e0('0x47')][_0xb6e0('0x48')]?_0x4fbc44['attributes']:_0x11df2a[_0xb6e0('0x42')];if(!_0x153ccb['query'][_0xb6e0('0x49')](_0xb6e0('0x4a'))){_0x4fbc44[_0xb6e0('0x2f')]=qs[_0xb6e0('0x2f')](_0x153ccb[_0xb6e0('0x43')]['limit']);_0x4fbc44['offset']=qs[_0xb6e0('0x2c')](_0x153ccb[_0xb6e0('0x43')][_0xb6e0('0x2c')]);}_0x4fbc44['order']=qs[_0xb6e0('0x4b')](_0x153ccb[_0xb6e0('0x43')][_0xb6e0('0x4b')]);_0x4fbc44[_0xb6e0('0x4c')]=qs['filters'](_[_0xb6e0('0x4d')](_0x153ccb[_0xb6e0('0x43')],_0x11df2a['filters']),_0x3de094);if(_0x153ccb['query'][_0xb6e0('0x4e')]){_0x4fbc44[_0xb6e0('0x4c')]=_[_0xb6e0('0x4f')](_0x4fbc44[_0xb6e0('0x4c')],{'$or':_['map'](_0x3de094,function(_0x40aa3b){if(_0x40aa3b[_0xb6e0('0x40')]!=='VIRTUAL'){var _0x15610a={};_0x15610a[_0x40aa3b[_0xb6e0('0x3a')]]={'$like':'%'+_0x153ccb['query'][_0xb6e0('0x4e')]+'%'};return _0x15610a;}})});}_0x4fbc44=_['merge']({},_0x4fbc44,_0x153ccb[_0xb6e0('0x50')]);var _0x41319b={'where':_0x4fbc44[_0xb6e0('0x4c')]};return db[_0xb6e0('0x3d')][_0xb6e0('0x2e')](_0x41319b)[_0xb6e0('0x36')](function(_0x429867){_0x104a32[_0xb6e0('0x2e')]=_0x429867;if(_0x153ccb[_0xb6e0('0x43')]['includeAll']){_0x4fbc44[_0xb6e0('0x51')]=[{'all':!![]}];}return db[_0xb6e0('0x3d')][_0xb6e0('0x52')](_0x4fbc44);})[_0xb6e0('0x36')](function(_0x1e3c46){_0x104a32['rows']=_0x1e3c46;return _0x104a32;})['then'](respondWithFilteredResult(_0x2e6501,_0x4fbc44))[_0xb6e0('0x28')](handleError(_0x2e6501,null));};exports[_0xb6e0('0x53')]=function(_0x5171aa,_0xa254e9){var _0xc4fc49={'raw':![],'where':{'id':_0x5171aa[_0xb6e0('0x54')]['id']}},_0x4f1564={};_0x4f1564['model']=_[_0xb6e0('0x44')](db['VoiceContext'][_0xb6e0('0x3e')]);_0x4f1564[_0xb6e0('0x43')]=_[_0xb6e0('0x44')](_0x5171aa[_0xb6e0('0x43')]);_0x4f1564['filters']=_[_0xb6e0('0x55')](_0x4f1564[_0xb6e0('0x42')],_0x4f1564[_0xb6e0('0x43')]);_0xc4fc49[_0xb6e0('0x47')]=_[_0xb6e0('0x55')](_0x4f1564[_0xb6e0('0x42')],qs[_0xb6e0('0x46')](_0x5171aa[_0xb6e0('0x43')]['fields']));_0xc4fc49[_0xb6e0('0x47')]=_0xc4fc49['attributes']['length']?_0xc4fc49[_0xb6e0('0x47')]:_0x4f1564[_0xb6e0('0x42')];if(_0x5171aa[_0xb6e0('0x43')][_0xb6e0('0x56')]){_0xc4fc49['include']=[{'all':!![]}];}_0xc4fc49=_[_0xb6e0('0x4f')]({},_0xc4fc49,_0x5171aa['options']);return db[_0xb6e0('0x3d')][_0xb6e0('0x57')](_0xc4fc49)[_0xb6e0('0x36')](handleEntityNotFound(_0xa254e9,null))[_0xb6e0('0x36')](respondWithResult(_0xa254e9,null))[_0xb6e0('0x28')](handleError(_0xa254e9,null));};exports[_0xb6e0('0x58')]=function(_0x58ba83,_0x83a153,_0xc9a86f){var _0x57dabd;return db[_0xb6e0('0x3d')][_0xb6e0('0x58')](_0x58ba83[_0xb6e0('0x59')],{'raw':!![]})[_0xb6e0('0x36')](function(_0x125256){_0x57dabd=_0x125256;return db['VoiceContext'][_0xb6e0('0x52')]({'raw':!![]});})[_0xb6e0('0x36')](function(_0x209fdd){var _0x5c3321=fs[_0xb6e0('0x5a')](path['join'](config[_0xb6e0('0x5b')],'server/files/templates/context.ejs'),_0xb6e0('0x5c'));var _0x367fe0=ejs[_0xb6e0('0x5d')](_0x5c3321,{'contexts':_0x209fdd||[]});fs[_0xb6e0('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x367fe0);})[_0xb6e0('0x36')](function(){return respondWithRpcPromise('Reload',_0xb6e0('0x58'),{'module':'chan_sip.so'});})[_0xb6e0('0x36')](function(){var _0x3dd749=_0x58ba83[_0xb6e0('0x5f')][_0xb6e0('0x38')]({'plain':!![]});if(!_0x3dd749)throw new Error(_0xb6e0('0x60'));if(_0x3dd749[_0xb6e0('0x61')]==='user'){var _0x2b25cc=_0x57dabd[_0xb6e0('0x38')]({'plain':!![]});return db[_0xb6e0('0x62')]['find']({'where':{'name':_0xb6e0('0x63'),'userProfileId':_0x3dd749[_0xb6e0('0x64')]},'raw':!![]})[_0xb6e0('0x36')](function(_0x58ba32){if(_0x58ba32&&_0x58ba32['autoAssociation']===0x0){return db[_0xb6e0('0x65')][_0xb6e0('0x58')]({'name':_0x2b25cc[_0xb6e0('0x3a')],'resourceId':_0x2b25cc['id'],'type':_0x58ba32[_0xb6e0('0x3a')],'sectionId':_0x58ba32['id']},{})[_0xb6e0('0x36')](function(){return _0x57dabd;});}else{return _0x57dabd;}})[_0xb6e0('0x28')](function(_0x450268){logger[_0xb6e0('0x24')](_0xb6e0('0x66'),_0x450268);throw _0x450268;});}return _0x57dabd;})[_0xb6e0('0x36')](respondWithResult(_0x83a153,0xc9))['catch'](handleError(_0x83a153,null));};exports[_0xb6e0('0x67')]=function(_0x58f84f,_0x5dbcc5,_0xbcbf51){var _0x1dc026;return db['VoiceContext'][_0xb6e0('0x57')]({'where':{'id':_0x58f84f['params']['id']}})[_0xb6e0('0x36')](handleEntityNotFound(_0x5dbcc5,null))[_0xb6e0('0x36')](saveUpdates(_0x58f84f['body'],null))[_0xb6e0('0x36')](function(_0x4b862a){if(_0x4b862a){_0x1dc026=_0x4b862a;return db[_0xb6e0('0x3d')][_0xb6e0('0x52')]({'raw':!![]});}})['then'](function(_0x1283bc){var _0x38eac2=fs[_0xb6e0('0x5a')](path[_0xb6e0('0x68')](config[_0xb6e0('0x5b')],_0xb6e0('0x69')),'utf8');var _0x3b3946=ejs[_0xb6e0('0x5d')](_0x38eac2,{'contexts':_0x1283bc||[]});fs[_0xb6e0('0x5e')](_0xb6e0('0x6a'),_0x3b3946);})['then'](function(){return respondWithRpcPromise(_0xb6e0('0x6b'),_0xb6e0('0x67'),{'module':'chan_sip.so'});})['then'](function(){return _0x1dc026;})[_0xb6e0('0x36')](respondWithResult(_0x5dbcc5,null))[_0xb6e0('0x28')](handleError(_0x5dbcc5,null));};exports[_0xb6e0('0x37')]=function(_0x468625,_0x505367,_0x4130ee){var _0x4ad7bb;return db[_0xb6e0('0x3d')][_0xb6e0('0x57')]({'where':{'id':_0x468625[_0xb6e0('0x54')]['id']}})[_0xb6e0('0x36')](handleEntityNotFound(_0x505367,null))['then'](removeEntity(_0x505367,null))['then'](function(){return db[_0xb6e0('0x3d')][_0xb6e0('0x52')]({'raw':!![]});})[_0xb6e0('0x36')](function(_0x552f7a){var _0x44e77e=fs[_0xb6e0('0x5a')](path[_0xb6e0('0x68')](config[_0xb6e0('0x5b')],_0xb6e0('0x69')),_0xb6e0('0x5c'));var _0x3085f4=ejs[_0xb6e0('0x5d')](_0x44e77e,{'contexts':_0x552f7a});fs[_0xb6e0('0x5e')](_0xb6e0('0x6a'),_0x3085f4);return respondWithRpcPromise(_0xb6e0('0x6b'),_0xb6e0('0x37'),{'module':_0xb6e0('0x6c')});})[_0xb6e0('0x28')](handleError(_0x505367,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4c9b39e..f2c32a6 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 _0x6730=['api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0xe68a4c,_0x1cfead){var _0x492b36=function(_0x501185){while(--_0x501185){_0xe68a4c['push'](_0xe68a4c['shift']());}};_0x492b36(++_0x1cfead);}(_0x6730,0x1ab));var _0x0673=function(_0x2f202e,_0x5ed293){_0x2f202e=_0x2f202e-0x0;var _0x398ac6=_0x6730[_0x2f202e];return _0x398ac6;};'use strict';var _=require('lodash');var util=require(_0x0673('0x0'));var logger=require(_0x0673('0x1'))(_0x0673('0x2'));var moment=require('moment');var BPromise=require(_0x0673('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0673('0x4'));var rimraf=require(_0x0673('0x5'));var config=require(_0x0673('0x6'));var attributes=require(_0x0673('0x7'));module[_0x0673('0x8')]=function(_0x3029aa,_0x301b5c){return _0x3029aa['define'](_0x0673('0x9'),attributes,{'tableName':_0x0673('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bd1=['moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','../../config/logger','api'];(function(_0x2f9ebe,_0x861cce){var _0x36cb47=function(_0x3fe8a8){while(--_0x3fe8a8){_0x2f9ebe['push'](_0x2f9ebe['shift']());}};_0x36cb47(++_0x861cce);}(_0x3bd1,0x111));var _0x13bd=function(_0x5321ec,_0x45e00e){_0x5321ec=_0x5321ec-0x0;var _0x392687=_0x3bd1[_0x5321ec];return _0x392687;};'use strict';var _=require(_0x13bd('0x0'));var util=require('util');var logger=require(_0x13bd('0x1'))(_0x13bd('0x2'));var moment=require(_0x13bd('0x3'));var BPromise=require(_0x13bd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13bd('0x5'));var rimraf=require(_0x13bd('0x6'));var config=require(_0x13bd('0x7'));var attributes=require(_0x13bd('0x8'));module['exports']=function(_0x234ac0,_0xbd0ca7){return _0x234ac0[_0x13bd('0x9')](_0x13bd('0xa'),attributes,{'tableName':_0x13bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index ec7ceb4..5751c4a 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 _0x53eb=['message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x53eb,0x115));var _0xb53e=function(_0x2d4a49,_0x372662){_0x2d4a49=_0x2d4a49-0x0;var _0x301bf7=_0x53eb[_0x2d4a49];return _0x301bf7;};'use strict';var _=require(_0xb53e('0x0'));var util=require(_0xb53e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb53e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb53e('0x3'))['db'];var utils=require(_0xb53e('0x4'));var logger=require('../../config/logger')(_0xb53e('0x5'));var config=require(_0xb53e('0x6'));var jayson=require(_0xb53e('0x7'));var client=jayson['client'][_0xb53e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a116b,_0x23f47c,_0x26633f){return new BPromise(function(_0x3aa191,_0x409bcc){return client['request'](_0x3a116b,_0x26633f)[_0xb53e('0x9')](function(_0x4858b6){logger['info'](_0xb53e('0xa'),_0x23f47c,_0xb53e('0xb'));logger[_0xb53e('0xc')](_0xb53e('0xd'),_0x23f47c,_0xb53e('0xb'),JSON[_0xb53e('0xe')](_0x4858b6));if(_0x4858b6[_0xb53e('0xf')]){if(_0x4858b6[_0xb53e('0xf')][_0xb53e('0x10')]===0x1f4){logger[_0xb53e('0xf')](_0xb53e('0xa'),_0x23f47c,_0x4858b6['error'][_0xb53e('0x11')]);return _0x409bcc(_0x4858b6[_0xb53e('0xf')][_0xb53e('0x11')]);}logger['error'](_0xb53e('0xa'),_0x23f47c,_0x4858b6['error'][_0xb53e('0x11')]);return _0x3aa191(_0x4858b6[_0xb53e('0xf')]['message']);}else{logger[_0xb53e('0x12')](_0xb53e('0xa'),_0x23f47c,_0xb53e('0xb'));_0x3aa191(_0x4858b6[_0xb53e('0x13')][_0xb53e('0x11')]);}})[_0xb53e('0x14')](function(_0x34441d){logger[_0xb53e('0xf')](_0xb53e('0xa'),_0x23f47c,_0x34441d);_0x409bcc(_0x34441d);});});} \ No newline at end of file +var _0x71d3=['VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x71d3,0x67));var _0x371d=function(_0x13b2cb,_0x401ef9){_0x13b2cb=_0x13b2cb-0x0;var _0x118a4e=_0x71d3[_0x13b2cb];return _0x118a4e;};'use strict';var _=require(_0x371d('0x0'));var util=require(_0x371d('0x1'));var moment=require(_0x371d('0x2'));var BPromise=require('bluebird');var rs=require(_0x371d('0x3'));var fs=require('fs');var Redis=require(_0x371d('0x4'));var db=require(_0x371d('0x5'))['db'];var utils=require(_0x371d('0x6'));var logger=require(_0x371d('0x7'))(_0x371d('0x8'));var config=require(_0x371d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x371d('0xa')][_0x371d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x578e1d,_0x497f85,_0x18140f){return new BPromise(function(_0x1709e6,_0x6787ef){return client[_0x371d('0xc')](_0x578e1d,_0x18140f)[_0x371d('0xd')](function(_0x314abb){logger[_0x371d('0xe')]('VoiceContext,\x20%s,\x20%s',_0x497f85,_0x371d('0xf'));logger[_0x371d('0x10')](_0x371d('0x11'),_0x497f85,_0x371d('0xf'),JSON[_0x371d('0x12')](_0x314abb));if(_0x314abb['error']){if(_0x314abb[_0x371d('0x13')][_0x371d('0x14')]===0x1f4){logger[_0x371d('0x13')]('VoiceContext,\x20%s,\x20%s',_0x497f85,_0x314abb['error'][_0x371d('0x15')]);return _0x6787ef(_0x314abb[_0x371d('0x13')]['message']);}logger[_0x371d('0x13')](_0x371d('0x16'),_0x497f85,_0x314abb['error'][_0x371d('0x15')]);return _0x1709e6(_0x314abb[_0x371d('0x13')][_0x371d('0x15')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x497f85,_0x371d('0xf'));_0x1709e6(_0x314abb[_0x371d('0x17')]['message']);}})[_0x371d('0x18')](function(_0x139f38){logger[_0x371d('0x13')]('VoiceContext,\x20%s,\x20%s',_0x497f85,_0x139f38);_0x6787ef(_0x139f38);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 52e706f..56f0825 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 _0x8b48=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','post','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x8b48,0x95));var _0x88b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b48[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x88b4('0x0'));var util=require(_0x88b4('0x1'));var path=require(_0x88b4('0x2'));var timeout=require(_0x88b4('0x3'));var express=require('express');var router=express[_0x88b4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x88b4('0x5'));var interaction=require(_0x88b4('0x6'));var config=require(_0x88b4('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x88b4('0x8')](),controller[_0x88b4('0x9')]);router[_0x88b4('0xa')]('/describe',auth[_0x88b4('0x8')](),controller[_0x88b4('0xb')]);router[_0x88b4('0xa')]('/:id',auth[_0x88b4('0x8')](),controller[_0x88b4('0xc')]);router[_0x88b4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x88b4('0xe')](_0x88b4('0xf'),auth[_0x88b4('0x8')](),controller['update']);router[_0x88b4('0x10')](_0x88b4('0xf'),auth[_0x88b4('0x8')](),controller[_0x88b4('0x11')]);module[_0x88b4('0x12')]=router; \ No newline at end of file +var _0x3097=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3449c4,_0x1431f4){var _0x1f4f0e=function(_0x9828a6){while(--_0x9828a6){_0x3449c4['push'](_0x3449c4['shift']());}};_0x1f4f0e(++_0x1431f4);}(_0x3097,0x1b1));var _0x7309=function(_0x65eb73,_0x1cc017){_0x65eb73=_0x65eb73-0x0;var _0x4e0f06=_0x3097[_0x65eb73];return _0x4e0f06;};'use strict';var multer=require(_0x7309('0x0'));var util=require(_0x7309('0x1'));var path=require(_0x7309('0x2'));var timeout=require(_0x7309('0x3'));var express=require('express');var router=express[_0x7309('0x4')]();var fs_extra=require(_0x7309('0x5'));var auth=require(_0x7309('0x6'));var interaction=require(_0x7309('0x7'));var config=require(_0x7309('0x8'));var controller=require('./voiceDialReport.controller');router[_0x7309('0x9')]('/',auth[_0x7309('0xa')](),controller[_0x7309('0xb')]);router[_0x7309('0x9')](_0x7309('0xc'),auth[_0x7309('0xa')](),controller[_0x7309('0xd')]);router[_0x7309('0x9')](_0x7309('0xe'),auth[_0x7309('0xa')](),controller[_0x7309('0xf')]);router[_0x7309('0x10')]('/',auth[_0x7309('0xa')](),controller[_0x7309('0x11')]);router[_0x7309('0x12')]('/:id',auth[_0x7309('0xa')](),controller['update']);router[_0x7309('0x13')](_0x7309('0xe'),auth[_0x7309('0xa')](),controller[_0x7309('0x14')]);module[_0x7309('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c97a033..54ef2db 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 _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xe14d,0x1ee));var _0xde14=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe14d[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 3e68975..144b9c5 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 _0xc83b=['index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xc83b,0x164));var _0xbc83=function(_0x29c4ed,_0x2d0586){_0x29c4ed=_0x29c4ed-0x0;var _0x4fcf0c=_0xc83b[_0x29c4ed];return _0x4fcf0c;};'use strict';var emlformat=require(_0xbc83('0x0'));var rimraf=require(_0xbc83('0x1'));var zipdir=require(_0xbc83('0x2'));var jsonpatch=require(_0xbc83('0x3'));var rp=require(_0xbc83('0x4'));var moment=require(_0xbc83('0x5'));var BPromise=require(_0xbc83('0x6'));var Mustache=require(_0xbc83('0x7'));var util=require('util');var path=require(_0xbc83('0x8'));var sox=require(_0xbc83('0x9'));var csv=require(_0xbc83('0xa'));var ejs=require(_0xbc83('0xb'));var fs=require('fs');var fs_extra=require(_0xbc83('0xc'));var _=require(_0xbc83('0xd'));var squel=require('squel');var crypto=require(_0xbc83('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbc83('0xf'));var toCsv=require(_0xbc83('0xa'));var querystring=require(_0xbc83('0x10'));var Papa=require(_0xbc83('0x11'));var Redis=require(_0xbc83('0x12'));var authService=require(_0xbc83('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbc83('0x14'));var hardwareService=require(_0xbc83('0x15'));var logger=require(_0xbc83('0x16'))('api');var utils=require(_0xbc83('0x17'));var config=require(_0xbc83('0x18'));var licenseUtil=require(_0xbc83('0x19'));var db=require(_0xbc83('0x1a'))['db'];function respondWithStatusCode(_0x22380d,_0x4fb666){_0x4fb666=_0x4fb666||0xcc;return function(_0x46aacb){if(_0x46aacb){return _0x22380d[_0xbc83('0x1b')](_0x4fb666);}return _0x22380d['status'](_0x4fb666)[_0xbc83('0x1c')]();};}function respondWithResult(_0x529134,_0x141a6c){_0x141a6c=_0x141a6c||0xc8;return function(_0x1bfec2){if(_0x1bfec2){return _0x529134[_0xbc83('0x1d')](_0x141a6c)[_0xbc83('0x1e')](_0x1bfec2);}};}function respondWithFilteredResult(_0x3068fb,_0x2556d9){return function(_0x49406c){if(_0x49406c){var _0x1d6e4a=typeof _0x2556d9['offset']==='undefined'&&typeof _0x2556d9['limit']==='undefined';var _0x15745e=_0x49406c[_0xbc83('0x1f')];var _0x34833f=_0x1d6e4a?0x0:_0x2556d9[_0xbc83('0x20')];var _0x305f78=_0x1d6e4a?_0x49406c['count']:_0x2556d9[_0xbc83('0x20')]+_0x2556d9[_0xbc83('0x21')];var _0x4743f6;if(_0x305f78>=_0x15745e){_0x305f78=_0x15745e;_0x4743f6=0xc8;}else{_0x4743f6=0xce;}_0x3068fb['status'](_0x4743f6);return _0x3068fb[_0xbc83('0x22')](_0xbc83('0x23'),_0x34833f+'-'+_0x305f78+'/'+_0x15745e)[_0xbc83('0x1e')](_0x49406c);}return null;};}function patchUpdates(_0x248464){return function(_0x4f7e88){try{jsonpatch[_0xbc83('0x24')](_0x4f7e88,_0x248464,!![]);}catch(_0x2403cd){return BPromise['reject'](_0x2403cd);}return _0x4f7e88[_0xbc83('0x25')]();};}function saveUpdates(_0x3bc52d,_0x8be75){return function(_0x3d8020){if(_0x3d8020){return _0x3d8020[_0xbc83('0x26')](_0x3bc52d)[_0xbc83('0x27')](function(_0x37168a){return _0x37168a;});}return null;};}function removeEntity(_0x2e456d,_0x39486e){return function(_0xfbdd9f){if(_0xfbdd9f){return _0xfbdd9f[_0xbc83('0x28')]()[_0xbc83('0x27')](function(){_0x2e456d[_0xbc83('0x1d')](0xcc)[_0xbc83('0x1c')]();});}};}function handleEntityNotFound(_0x1ef150,_0x3c2f75){return function(_0x396922){if(!_0x396922){_0x1ef150[_0xbc83('0x1b')](0x194);}return _0x396922;};}function handleError(_0x2d7331,_0x2a1b61){_0x2a1b61=_0x2a1b61||0x1f4;return function(_0x5cb54f){logger[_0xbc83('0x29')](_0x5cb54f[_0xbc83('0x2a')]);if(_0x5cb54f[_0xbc83('0x2b')]){delete _0x5cb54f[_0xbc83('0x2b')];}_0x2d7331[_0xbc83('0x1d')](_0x2a1b61)['send'](_0x5cb54f);};}exports[_0xbc83('0x2c')]=function(_0x2ecf9b,_0x2ea85a){var _0x489111={},_0x3433b2={},_0x4928e6={'count':0x0,'rows':[]};var _0x3e3b0a=_[_0xbc83('0x2d')](db[_0xbc83('0x2e')][_0xbc83('0x2f')],function(_0x1b59fd){return{'name':_0x1b59fd[_0xbc83('0x30')],'type':_0x1b59fd[_0xbc83('0x31')][_0xbc83('0x32')]};});_0x3433b2[_0xbc83('0x33')]=_[_0xbc83('0x2d')](_0x3e3b0a,_0xbc83('0x2b'));_0x3433b2[_0xbc83('0x34')]=_['keys'](_0x2ecf9b[_0xbc83('0x34')]);_0x3433b2[_0xbc83('0x35')]=_[_0xbc83('0x36')](_0x3433b2[_0xbc83('0x33')],_0x3433b2[_0xbc83('0x34')]);_0x489111['attributes']=_[_0xbc83('0x36')](_0x3433b2[_0xbc83('0x33')],qs[_0xbc83('0x37')](_0x2ecf9b[_0xbc83('0x34')][_0xbc83('0x37')]));_0x489111[_0xbc83('0x38')]=_0x489111[_0xbc83('0x38')]['length']?_0x489111[_0xbc83('0x38')]:_0x3433b2[_0xbc83('0x33')];if(!_0x2ecf9b[_0xbc83('0x34')][_0xbc83('0x39')](_0xbc83('0x3a'))){_0x489111['limit']=qs[_0xbc83('0x21')](_0x2ecf9b[_0xbc83('0x34')][_0xbc83('0x21')]);_0x489111[_0xbc83('0x20')]=qs['offset'](_0x2ecf9b['query']['offset']);}_0x489111[_0xbc83('0x3b')]=qs[_0xbc83('0x3c')](_0x2ecf9b[_0xbc83('0x34')]['sort']);_0x489111[_0xbc83('0x3d')]=qs['filters'](_[_0xbc83('0x3e')](_0x2ecf9b[_0xbc83('0x34')],_0x3433b2['filters']),_0x3e3b0a);if(_0x2ecf9b[_0xbc83('0x34')]['filter']){_0x489111[_0xbc83('0x3d')]=_[_0xbc83('0x3f')](_0x489111[_0xbc83('0x3d')],{'$or':_['map'](_0x3e3b0a,function(_0x5da3ca){if(_0x5da3ca[_0xbc83('0x31')]!==_0xbc83('0x40')){var _0x3e3367={};_0x3e3367[_0x5da3ca[_0xbc83('0x2b')]]={'$like':'%'+_0x2ecf9b[_0xbc83('0x34')][_0xbc83('0x41')]+'%'};return _0x3e3367;}})});}_0x489111=_['merge']({},_0x489111,_0x2ecf9b[_0xbc83('0x42')]);var _0x4fe96c={'where':_0x489111['where']};return db[_0xbc83('0x2e')][_0xbc83('0x1f')](_0x4fe96c)[_0xbc83('0x27')](function(_0x4de433){_0x4928e6[_0xbc83('0x1f')]=_0x4de433;if(_0x2ecf9b[_0xbc83('0x34')][_0xbc83('0x43')]){_0x489111[_0xbc83('0x44')]=[{'all':!![]}];}return db[_0xbc83('0x2e')][_0xbc83('0x45')](_0x489111);})[_0xbc83('0x27')](function(_0x5acb06){_0x4928e6[_0xbc83('0x46')]=_0x5acb06;return _0x4928e6;})[_0xbc83('0x27')](respondWithFilteredResult(_0x2ea85a,_0x489111))[_0xbc83('0x47')](handleError(_0x2ea85a,null));};exports[_0xbc83('0x48')]=function(_0x38e59a,_0x49560d){var _0x260e4d={'raw':!![],'where':{'id':_0x38e59a['params']['id']}},_0x4dd06d={};_0x4dd06d[_0xbc83('0x33')]=_['keys'](db[_0xbc83('0x2e')]['rawAttributes']);_0x4dd06d[_0xbc83('0x34')]=_[_0xbc83('0x49')](_0x38e59a[_0xbc83('0x34')]);_0x4dd06d['filters']=_[_0xbc83('0x36')](_0x4dd06d[_0xbc83('0x33')],_0x4dd06d[_0xbc83('0x34')]);_0x260e4d[_0xbc83('0x38')]=_[_0xbc83('0x36')](_0x4dd06d['model'],qs['fields'](_0x38e59a['query'][_0xbc83('0x37')]));_0x260e4d['attributes']=_0x260e4d[_0xbc83('0x38')][_0xbc83('0x4a')]?_0x260e4d[_0xbc83('0x38')]:_0x4dd06d[_0xbc83('0x33')];if(_0x38e59a[_0xbc83('0x34')][_0xbc83('0x43')]){_0x260e4d[_0xbc83('0x44')]=[{'all':!![]}];}_0x260e4d=_[_0xbc83('0x3f')]({},_0x260e4d,_0x38e59a[_0xbc83('0x42')]);return db[_0xbc83('0x2e')][_0xbc83('0x4b')](_0x260e4d)[_0xbc83('0x27')](handleEntityNotFound(_0x49560d,null))[_0xbc83('0x27')](respondWithResult(_0x49560d,null))['catch'](handleError(_0x49560d,null));};exports['create']=function(_0x219cd4,_0x2a937a){return db[_0xbc83('0x2e')][_0xbc83('0x4c')](_0x219cd4[_0xbc83('0x4d')],{})['then'](respondWithResult(_0x2a937a,0xc9))[_0xbc83('0x47')](handleError(_0x2a937a,null));};exports[_0xbc83('0x26')]=function(_0x1f83ea,_0x1f911e){if(_0x1f83ea['body']['id']){delete _0x1f83ea[_0xbc83('0x4d')]['id'];}return db[_0xbc83('0x2e')][_0xbc83('0x4b')]({'where':{'id':_0x1f83ea['params']['id']}})[_0xbc83('0x27')](handleEntityNotFound(_0x1f911e,null))[_0xbc83('0x27')](saveUpdates(_0x1f83ea[_0xbc83('0x4d')],null))[_0xbc83('0x27')](respondWithResult(_0x1f911e,null))[_0xbc83('0x47')](handleError(_0x1f911e,null));};exports[_0xbc83('0x28')]=function(_0x643f02,_0x4387ef){return db[_0xbc83('0x2e')][_0xbc83('0x4b')]({'where':{'id':_0x643f02[_0xbc83('0x4e')]['id']}})[_0xbc83('0x27')](handleEntityNotFound(_0x4387ef,null))[_0xbc83('0x27')](removeEntity(_0x4387ef,null))[_0xbc83('0x47')](handleError(_0x4387ef,null));};exports[_0xbc83('0x4f')]=function(_0x5f1c0c,_0x5e8638){return db[_0xbc83('0x2e')][_0xbc83('0x4f')]()[_0xbc83('0x27')](respondWithResult(_0x5e8638,null))[_0xbc83('0x47')](handleError(_0x5e8638,null));}; \ No newline at end of file +var _0x913b=['map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','create','body','find','describe','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','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x139392,_0x24cd15){var _0x5e751c=function(_0x2de2b7){while(--_0x2de2b7){_0x139392['push'](_0x139392['shift']());}};_0x5e751c(++_0x24cd15);}(_0x913b,0x19f));var _0xb913=function(_0x383440,_0x19bb4c){_0x383440=_0x383440-0x0;var _0x4ffc43=_0x913b[_0x383440];return _0x4ffc43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb913('0x0'));var zipdir=require(_0xb913('0x1'));var jsonpatch=require(_0xb913('0x2'));var rp=require(_0xb913('0x3'));var moment=require(_0xb913('0x4'));var BPromise=require(_0xb913('0x5'));var Mustache=require(_0xb913('0x6'));var util=require(_0xb913('0x7'));var path=require(_0xb913('0x8'));var sox=require(_0xb913('0x9'));var csv=require(_0xb913('0xa'));var ejs=require(_0xb913('0xb'));var fs=require('fs');var fs_extra=require(_0xb913('0xc'));var _=require(_0xb913('0xd'));var squel=require(_0xb913('0xe'));var crypto=require(_0xb913('0xf'));var jsforce=require(_0xb913('0x10'));var deskjs=require(_0xb913('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb913('0x12'));var Papa=require(_0xb913('0x13'));var Redis=require('ioredis');var authService=require(_0xb913('0x14'));var qs=require(_0xb913('0x15'));var as=require(_0xb913('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb913('0x17'));var utils=require('../../config/utils');var config=require(_0xb913('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb913('0x19'))['db'];function respondWithStatusCode(_0x400c02,_0x31b2ec){_0x31b2ec=_0x31b2ec||0xcc;return function(_0x2afcfc){if(_0x2afcfc){return _0x400c02[_0xb913('0x1a')](_0x31b2ec);}return _0x400c02['status'](_0x31b2ec)[_0xb913('0x1b')]();};}function respondWithResult(_0x2436b8,_0x21186d){_0x21186d=_0x21186d||0xc8;return function(_0x52443f){if(_0x52443f){return _0x2436b8['status'](_0x21186d)['json'](_0x52443f);}};}function respondWithFilteredResult(_0x522d75,_0x226f2b){return function(_0x1dcc1f){if(_0x1dcc1f){var _0xc8f459=typeof _0x226f2b[_0xb913('0x1c')]==='undefined'&&typeof _0x226f2b[_0xb913('0x1d')]===_0xb913('0x1e');var _0x395cba=_0x1dcc1f[_0xb913('0x1f')];var _0x493197=_0xc8f459?0x0:_0x226f2b['offset'];var _0x52c418=_0xc8f459?_0x1dcc1f['count']:_0x226f2b[_0xb913('0x1c')]+_0x226f2b[_0xb913('0x1d')];var _0x5b3076;if(_0x52c418>=_0x395cba){_0x52c418=_0x395cba;_0x5b3076=0xc8;}else{_0x5b3076=0xce;}_0x522d75[_0xb913('0x20')](_0x5b3076);return _0x522d75[_0xb913('0x21')](_0xb913('0x22'),_0x493197+'-'+_0x52c418+'/'+_0x395cba)[_0xb913('0x23')](_0x1dcc1f);}return null;};}function patchUpdates(_0x7098ca){return function(_0x2f0654){try{jsonpatch[_0xb913('0x24')](_0x2f0654,_0x7098ca,!![]);}catch(_0x58832c){return BPromise[_0xb913('0x25')](_0x58832c);}return _0x2f0654[_0xb913('0x26')]();};}function saveUpdates(_0x4addb8,_0x52abd1){return function(_0x129806){if(_0x129806){return _0x129806[_0xb913('0x27')](_0x4addb8)[_0xb913('0x28')](function(_0x1d5093){return _0x1d5093;});}return null;};}function removeEntity(_0x1a1d90,_0x15dc1f){return function(_0x227fce){if(_0x227fce){return _0x227fce[_0xb913('0x29')]()[_0xb913('0x28')](function(){_0x1a1d90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0049,_0x535dba){return function(_0x138942){if(!_0x138942){_0x5d0049['sendStatus'](0x194);}return _0x138942;};}function handleError(_0x5d5642,_0x38568){_0x38568=_0x38568||0x1f4;return function(_0x16e696){logger[_0xb913('0x2a')](_0x16e696[_0xb913('0x2b')]);if(_0x16e696[_0xb913('0x2c')]){delete _0x16e696[_0xb913('0x2c')];}_0x5d5642[_0xb913('0x20')](_0x38568)[_0xb913('0x2d')](_0x16e696);};}exports[_0xb913('0x2e')]=function(_0x378ab0,_0x527a5d){var _0x207395={},_0x52a2a2={},_0x3c929d={'count':0x0,'rows':[]};var _0x56aa9a=_[_0xb913('0x2f')](db[_0xb913('0x30')][_0xb913('0x31')],function(_0x39f3dd){return{'name':_0x39f3dd[_0xb913('0x32')],'type':_0x39f3dd[_0xb913('0x33')]['key']};});_0x52a2a2[_0xb913('0x34')]=_[_0xb913('0x2f')](_0x56aa9a,_0xb913('0x2c'));_0x52a2a2[_0xb913('0x35')]=_[_0xb913('0x36')](_0x378ab0[_0xb913('0x35')]);_0x52a2a2[_0xb913('0x37')]=_[_0xb913('0x38')](_0x52a2a2[_0xb913('0x34')],_0x52a2a2[_0xb913('0x35')]);_0x207395[_0xb913('0x39')]=_[_0xb913('0x38')](_0x52a2a2['model'],qs[_0xb913('0x3a')](_0x378ab0[_0xb913('0x35')][_0xb913('0x3a')]));_0x207395['attributes']=_0x207395[_0xb913('0x39')][_0xb913('0x3b')]?_0x207395[_0xb913('0x39')]:_0x52a2a2[_0xb913('0x34')];if(!_0x378ab0[_0xb913('0x35')][_0xb913('0x3c')](_0xb913('0x3d'))){_0x207395[_0xb913('0x1d')]=qs[_0xb913('0x1d')](_0x378ab0[_0xb913('0x35')]['limit']);_0x207395[_0xb913('0x1c')]=qs[_0xb913('0x1c')](_0x378ab0[_0xb913('0x35')][_0xb913('0x1c')]);}_0x207395['order']=qs[_0xb913('0x3e')](_0x378ab0[_0xb913('0x35')][_0xb913('0x3e')]);_0x207395['where']=qs[_0xb913('0x37')](_[_0xb913('0x3f')](_0x378ab0[_0xb913('0x35')],_0x52a2a2[_0xb913('0x37')]),_0x56aa9a);if(_0x378ab0['query'][_0xb913('0x40')]){_0x207395[_0xb913('0x41')]=_[_0xb913('0x42')](_0x207395[_0xb913('0x41')],{'$or':_[_0xb913('0x2f')](_0x56aa9a,function(_0x3b91a0){if(_0x3b91a0['type']!=='VIRTUAL'){var _0x2bb975={};_0x2bb975[_0x3b91a0[_0xb913('0x2c')]]={'$like':'%'+_0x378ab0[_0xb913('0x35')][_0xb913('0x40')]+'%'};return _0x2bb975;}})});}_0x207395=_[_0xb913('0x42')]({},_0x207395,_0x378ab0['options']);var _0xb10e70={'where':_0x207395[_0xb913('0x41')]};return db['VoiceDialReport'][_0xb913('0x1f')](_0xb10e70)[_0xb913('0x28')](function(_0x5d31e7){_0x3c929d['count']=_0x5d31e7;if(_0x378ab0['query'][_0xb913('0x43')]){_0x207395['include']=[{'all':!![]}];}return db[_0xb913('0x30')][_0xb913('0x44')](_0x207395);})[_0xb913('0x28')](function(_0x1ee989){_0x3c929d[_0xb913('0x45')]=_0x1ee989;return _0x3c929d;})[_0xb913('0x28')](respondWithFilteredResult(_0x527a5d,_0x207395))[_0xb913('0x46')](handleError(_0x527a5d,null));};exports[_0xb913('0x47')]=function(_0xc0f7eb,_0x4058d5){var _0x46649e={'raw':!![],'where':{'id':_0xc0f7eb[_0xb913('0x48')]['id']}},_0x281792={};_0x281792[_0xb913('0x34')]=_[_0xb913('0x36')](db[_0xb913('0x30')][_0xb913('0x31')]);_0x281792['query']=_[_0xb913('0x36')](_0xc0f7eb[_0xb913('0x35')]);_0x281792[_0xb913('0x37')]=_[_0xb913('0x38')](_0x281792[_0xb913('0x34')],_0x281792[_0xb913('0x35')]);_0x46649e[_0xb913('0x39')]=_[_0xb913('0x38')](_0x281792[_0xb913('0x34')],qs[_0xb913('0x3a')](_0xc0f7eb['query']['fields']));_0x46649e[_0xb913('0x39')]=_0x46649e['attributes']['length']?_0x46649e[_0xb913('0x39')]:_0x281792[_0xb913('0x34')];if(_0xc0f7eb[_0xb913('0x35')][_0xb913('0x43')]){_0x46649e['include']=[{'all':!![]}];}_0x46649e=_[_0xb913('0x42')]({},_0x46649e,_0xc0f7eb['options']);return db[_0xb913('0x30')]['find'](_0x46649e)[_0xb913('0x28')](handleEntityNotFound(_0x4058d5,null))[_0xb913('0x28')](respondWithResult(_0x4058d5,null))[_0xb913('0x46')](handleError(_0x4058d5,null));};exports[_0xb913('0x49')]=function(_0x54ea7f,_0xb59b88){return db['VoiceDialReport'][_0xb913('0x49')](_0x54ea7f[_0xb913('0x4a')],{})[_0xb913('0x28')](respondWithResult(_0xb59b88,0xc9))[_0xb913('0x46')](handleError(_0xb59b88,null));};exports['update']=function(_0x28920e,_0x3c2abb){if(_0x28920e[_0xb913('0x4a')]['id']){delete _0x28920e[_0xb913('0x4a')]['id'];}return db[_0xb913('0x30')]['find']({'where':{'id':_0x28920e['params']['id']}})[_0xb913('0x28')](handleEntityNotFound(_0x3c2abb,null))[_0xb913('0x28')](saveUpdates(_0x28920e[_0xb913('0x4a')],null))[_0xb913('0x28')](respondWithResult(_0x3c2abb,null))[_0xb913('0x46')](handleError(_0x3c2abb,null));};exports[_0xb913('0x29')]=function(_0x26c9c4,_0x4f3c79){return db[_0xb913('0x30')][_0xb913('0x4b')]({'where':{'id':_0x26c9c4[_0xb913('0x48')]['id']}})[_0xb913('0x28')](handleEntityNotFound(_0x4f3c79,null))[_0xb913('0x28')](removeEntity(_0x4f3c79,null))[_0xb913('0x46')](handleError(_0x4f3c79,null));};exports['describe']=function(_0x3604a9,_0x2f5bb7){return db[_0xb913('0x30')][_0xb913('0x4c')]()[_0xb913('0x28')](respondWithResult(_0x2f5bb7,null))[_0xb913('0x46')](handleError(_0x2f5bb7,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c1e64f4..b4ffdad 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 _0x4971=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_dial','lodash'];(function(_0x12b6ba,_0xda3834){var _0x21c1ce=function(_0x367255){while(--_0x367255){_0x12b6ba['push'](_0x12b6ba['shift']());}};_0x21c1ce(++_0xda3834);}(_0x4971,0xa4));var _0x1497=function(_0x9489f0,_0x23eb38){_0x9489f0=_0x9489f0-0x0;var _0x845027=_0x4971[_0x9489f0];return _0x845027;};'use strict';var _=require(_0x1497('0x0'));var util=require('util');var logger=require(_0x1497('0x1'))(_0x1497('0x2'));var moment=require(_0x1497('0x3'));var BPromise=require(_0x1497('0x4'));var rp=require(_0x1497('0x5'));var fs=require('fs');var path=require(_0x1497('0x6'));var rimraf=require(_0x1497('0x7'));var config=require(_0x1497('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x57b934,_0x53edf1){return _0x57b934[_0x1497('0x9')]('VoiceDialReport',attributes,{'tableName':_0x1497('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6921=['VoiceDialReport','report_dial','uniqueid','util','api','bluebird','request-promise','rimraf','./voiceDialReport.attributes','exports','define'];(function(_0x432f05,_0x1ad3f2){var _0x45799a=function(_0x4c280c){while(--_0x4c280c){_0x432f05['push'](_0x432f05['shift']());}};_0x45799a(++_0x1ad3f2);}(_0x6921,0x1d1));var _0x1692=function(_0x35ffd3,_0x295cec){_0x35ffd3=_0x35ffd3-0x0;var _0x2397e7=_0x6921[_0x35ffd3];return _0x2397e7;};'use strict';var _=require('lodash');var util=require(_0x1692('0x0'));var logger=require('../../config/logger')(_0x1692('0x1'));var moment=require('moment');var BPromise=require(_0x1692('0x2'));var rp=require(_0x1692('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1692('0x4'));var config=require('../../config/environment');var attributes=require(_0x1692('0x5'));module[_0x1692('0x6')]=function(_0x15f20e,_0x14fbfe){return _0x15f20e[_0x1692('0x7')](_0x1692('0x8'),attributes,{'tableName':_0x1692('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1692('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8bf863e..6953ddd 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 _0x6b36=['VoiceDialReport','create','options','catch','CreateVoiceDialReport','UpdateVoiceDialReport','update','body','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2b1df3,_0x26a5e3){var _0x513430=function(_0x1df55f){while(--_0x1df55f){_0x2b1df3['push'](_0x2b1df3['shift']());}};_0x513430(++_0x26a5e3);}(_0x6b36,0x6e));var _0x66b3=function(_0x3a2da9,_0x453dcc){_0x3a2da9=_0x3a2da9-0x0;var _0x3d275e=_0x6b36[_0x3a2da9];return _0x3d275e;};'use strict';var _=require('lodash');var util=require(_0x66b3('0x0'));var moment=require(_0x66b3('0x1'));var BPromise=require(_0x66b3('0x2'));var rs=require(_0x66b3('0x3'));var fs=require('fs');var Redis=require(_0x66b3('0x4'));var db=require(_0x66b3('0x5'))['db'];var utils=require(_0x66b3('0x6'));var logger=require('../../config/logger')(_0x66b3('0x7'));var config=require('../../config/environment');var jayson=require(_0x66b3('0x8'));var client=jayson['client'][_0x66b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1521a9,_0x5d52ee,_0x3ff77c){return new BPromise(function(_0x551688,_0x4b76f6){return client[_0x66b3('0xa')](_0x1521a9,_0x3ff77c)[_0x66b3('0xb')](function(_0xe05d2c){logger[_0x66b3('0xc')](_0x66b3('0xd'),_0x5d52ee,'request\x20sent');logger[_0x66b3('0xe')](_0x66b3('0xf'),_0x5d52ee,_0x66b3('0x10'),JSON[_0x66b3('0x11')](_0xe05d2c));if(_0xe05d2c[_0x66b3('0x12')]){if(_0xe05d2c[_0x66b3('0x12')][_0x66b3('0x13')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5d52ee,_0xe05d2c['error'][_0x66b3('0x14')]);return _0x4b76f6(_0xe05d2c[_0x66b3('0x12')][_0x66b3('0x14')]);}logger['error'](_0x66b3('0xd'),_0x5d52ee,_0xe05d2c[_0x66b3('0x12')]['message']);return _0x551688(_0xe05d2c['error'][_0x66b3('0x14')]);}else{logger['info'](_0x66b3('0xd'),_0x5d52ee,_0x66b3('0x10'));_0x551688(_0xe05d2c[_0x66b3('0x15')][_0x66b3('0x14')]);}})['catch'](function(_0x191924){logger[_0x66b3('0x12')](_0x66b3('0xd'),_0x5d52ee,_0x191924);_0x4b76f6(_0x191924);});});}exports['CreateVoiceDialReport']=function(_0x100ded){var _0x3a1c13=this;return new Promise(function(_0x27cb25,_0x36465a){return db[_0x66b3('0x16')][_0x66b3('0x17')](_0x100ded['body'],{'raw':_0x100ded[_0x66b3('0x18')]?_0x100ded[_0x66b3('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x66b3('0xb')](function(_0x3890ff){logger[_0x66b3('0xc')]('CreateVoiceDialReport',_0x100ded);logger[_0x66b3('0xe')]('CreateVoiceDialReport',_0x100ded,JSON['stringify'](_0x3890ff));_0x27cb25(_0x3890ff);})[_0x66b3('0x19')](function(_0x19d81c){logger['error'](_0x66b3('0x1a'),_0x19d81c[_0x66b3('0x14')],_0x100ded);_0x36465a(_0x3a1c13[_0x66b3('0x12')](0x1f4,_0x19d81c['message']));});});};exports[_0x66b3('0x1b')]=function(_0x23a435){var _0x35a3ce=this;return new Promise(function(_0x2a842c,_0x41824d){return db['VoiceDialReport'][_0x66b3('0x1c')](_0x23a435[_0x66b3('0x1d')],{'raw':_0x23a435[_0x66b3('0x18')]?_0x23a435[_0x66b3('0x18')][_0x66b3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23a435[_0x66b3('0x18')]?_0x23a435['options']['where']||null:null,'attributes':_0x23a435['options']?_0x23a435[_0x66b3('0x18')][_0x66b3('0x1f')]||null:null,'limit':_0x23a435[_0x66b3('0x18')]?_0x23a435[_0x66b3('0x18')][_0x66b3('0x20')]||null:null})[_0x66b3('0xb')](function(_0x298a3e){logger['info'](_0x66b3('0x1b'),_0x23a435);logger[_0x66b3('0xe')]('UpdateVoiceDialReport',_0x23a435,JSON[_0x66b3('0x11')](_0x298a3e));_0x2a842c(_0x298a3e);})[_0x66b3('0x19')](function(_0x3547ca){logger[_0x66b3('0x12')](_0x66b3('0x1b'),_0x3547ca['message'],_0x23a435);_0x41824d(_0x35a3ce[_0x66b3('0x12')](0x1f4,_0x3547ca[_0x66b3('0x14')]));});});}; \ No newline at end of file +var _0xbb29=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','where','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird'];(function(_0x3dbb6a,_0x2b86aa){var _0x675991=function(_0x5cb711){while(--_0x5cb711){_0x3dbb6a['push'](_0x3dbb6a['shift']());}};_0x675991(++_0x2b86aa);}(_0xbb29,0x80));var _0x9bb2=function(_0x35d74f,_0x5b4b0d){_0x35d74f=_0x35d74f-0x0;var _0x58cc22=_0xbb29[_0x35d74f];return _0x58cc22;};'use strict';var _=require(_0x9bb2('0x0'));var util=require(_0x9bb2('0x1'));var moment=require(_0x9bb2('0x2'));var BPromise=require(_0x9bb2('0x3'));var rs=require(_0x9bb2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bb2('0x5'))['db'];var utils=require(_0x9bb2('0x6'));var logger=require(_0x9bb2('0x7'))('rpc');var config=require(_0x9bb2('0x8'));var jayson=require(_0x9bb2('0x9'));var client=jayson[_0x9bb2('0xa')][_0x9bb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x309d3c,_0xd9607d,_0x3587c1){return new BPromise(function(_0x5872c5,_0x14314c){return client['request'](_0x309d3c,_0x3587c1)[_0x9bb2('0xc')](function(_0xc00a04){logger['info'](_0x9bb2('0xd'),_0xd9607d,_0x9bb2('0xe'));logger['debug'](_0x9bb2('0xf'),_0xd9607d,_0x9bb2('0xe'),JSON[_0x9bb2('0x10')](_0xc00a04));if(_0xc00a04[_0x9bb2('0x11')]){if(_0xc00a04['error'][_0x9bb2('0x12')]===0x1f4){logger['error'](_0x9bb2('0xd'),_0xd9607d,_0xc00a04[_0x9bb2('0x11')]['message']);return _0x14314c(_0xc00a04[_0x9bb2('0x11')]['message']);}logger['error'](_0x9bb2('0xd'),_0xd9607d,_0xc00a04[_0x9bb2('0x11')][_0x9bb2('0x13')]);return _0x5872c5(_0xc00a04[_0x9bb2('0x11')][_0x9bb2('0x13')]);}else{logger[_0x9bb2('0x14')](_0x9bb2('0xd'),_0xd9607d,'request\x20sent');_0x5872c5(_0xc00a04[_0x9bb2('0x15')][_0x9bb2('0x13')]);}})[_0x9bb2('0x16')](function(_0x471382){logger[_0x9bb2('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0xd9607d,_0x471382);_0x14314c(_0x471382);});});}exports[_0x9bb2('0x17')]=function(_0x5b4f29){var _0x49ddf5=this;return new Promise(function(_0x42dff8,_0x2eea69){return db[_0x9bb2('0x18')][_0x9bb2('0x19')](_0x5b4f29[_0x9bb2('0x1a')],{'raw':_0x5b4f29['options']?_0x5b4f29[_0x9bb2('0x1b')][_0x9bb2('0x1c')]===undefined?!![]:![]:!![]})[_0x9bb2('0xc')](function(_0xbaca9f){logger[_0x9bb2('0x14')]('CreateVoiceDialReport',_0x5b4f29);logger[_0x9bb2('0x1d')]('CreateVoiceDialReport',_0x5b4f29,JSON[_0x9bb2('0x10')](_0xbaca9f));_0x42dff8(_0xbaca9f);})[_0x9bb2('0x16')](function(_0x40e42b){logger[_0x9bb2('0x11')](_0x9bb2('0x17'),_0x40e42b[_0x9bb2('0x13')],_0x5b4f29);_0x2eea69(_0x49ddf5[_0x9bb2('0x11')](0x1f4,_0x40e42b[_0x9bb2('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x554eaa){var _0x30b322=this;return new Promise(function(_0x1065a0,_0x32eb40){return db[_0x9bb2('0x18')]['update'](_0x554eaa['body'],{'raw':_0x554eaa[_0x9bb2('0x1b')]?_0x554eaa[_0x9bb2('0x1b')][_0x9bb2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x554eaa[_0x9bb2('0x1b')]?_0x554eaa[_0x9bb2('0x1b')][_0x9bb2('0x1e')]||null:null,'attributes':_0x554eaa[_0x9bb2('0x1b')]?_0x554eaa[_0x9bb2('0x1b')]['attributes']||null:null,'limit':_0x554eaa[_0x9bb2('0x1b')]?_0x554eaa['options'][_0x9bb2('0x1f')]||null:null})[_0x9bb2('0xc')](function(_0x4b33f0){logger[_0x9bb2('0x14')]('UpdateVoiceDialReport',_0x554eaa);logger['debug'](_0x9bb2('0x20'),_0x554eaa,JSON['stringify'](_0x4b33f0));_0x1065a0(_0x4b33f0);})[_0x9bb2('0x16')](function(_0x179410){logger[_0x9bb2('0x11')](_0x9bb2('0x20'),_0x179410[_0x9bb2('0x13')],_0x554eaa);_0x32eb40(_0x30b322[_0x9bb2('0x11')](0x1f4,_0x179410[_0x9bb2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 037941e..86a606a 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 _0x61a2=['delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put'];(function(_0x5a76f2,_0x19b1a8){var _0x5a3485=function(_0x2f3f19){while(--_0x2f3f19){_0x5a76f2['push'](_0x5a76f2['shift']());}};_0x5a3485(++_0x19b1a8);}(_0x61a2,0x10c));var _0x261a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x61a2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x261a('0x0'));var util=require(_0x261a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x261a('0x2'));var router=express[_0x261a('0x3')]();var fs_extra=require(_0x261a('0x4'));var auth=require(_0x261a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x261a('0x6'));var controller=require(_0x261a('0x7'));router[_0x261a('0x8')]('/',auth[_0x261a('0x9')](),controller['index']);router['get'](_0x261a('0xa'),auth[_0x261a('0x9')](),controller[_0x261a('0xb')]);router[_0x261a('0xc')]('/',auth['isAuthenticated'](),controller[_0x261a('0xd')]);router[_0x261a('0xc')](_0x261a('0xe'),auth[_0x261a('0x9')](),controller[_0x261a('0xf')]);router[_0x261a('0x10')](_0x261a('0xa'),auth[_0x261a('0x9')](),controller['update']);router[_0x261a('0x11')](_0x261a('0xa'),auth[_0x261a('0x9')](),controller[_0x261a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8509=['update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','post','create','addApplications','put','/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8509,0xa6));var _0x9850=function(_0x214fe8,_0x3eea5e){_0x214fe8=_0x214fe8-0x0;var _0x405a51=_0x8509[_0x214fe8];return _0x405a51;};'use strict';var multer=require(_0x9850('0x0'));var util=require(_0x9850('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9850('0x2'));var router=express[_0x9850('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9850('0x4'));var interaction=require(_0x9850('0x5'));var config=require('../../config/environment');var controller=require(_0x9850('0x6'));router['get']('/',auth[_0x9850('0x7')](),controller[_0x9850('0x8')]);router['get']('/:id',auth[_0x9850('0x7')](),controller['show']);router[_0x9850('0x9')]('/',auth[_0x9850('0x7')](),controller[_0x9850('0xa')]);router[_0x9850('0x9')]('/:id/applications',auth[_0x9850('0x7')](),controller[_0x9850('0xb')]);router[_0x9850('0xc')](_0x9850('0xd'),auth[_0x9850('0x7')](),controller[_0x9850('0xe')]);router[_0x9850('0xf')](_0x9850('0xd'),auth[_0x9850('0x7')](),controller[_0x9850('0x10')]);module[_0x9850('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3153ed6..02158a5 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 _0x43d3=['inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x103f63,_0xa7544c){var _0x21b175=function(_0x24c702){while(--_0x24c702){_0x103f63['push'](_0x103f63['shift']());}};_0x21b175(++_0xa7544c);}(_0x43d3,0xee));var _0x343d=function(_0x4d3c2a,_0x57474c){_0x4d3c2a=_0x4d3c2a-0x0;var _0x962a46=_0x43d3[_0x4d3c2a];return _0x962a46;};'use strict';var Sequelize=require(_0x343d('0x0'));module[_0x343d('0x1')]={'context':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'unique':_0x343d('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'unique':_0x343d('0x3')},'priority':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x343d('0x3')},'tag':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'defaultValue':_0x343d('0x4')},'appdata':{'type':Sequelize[_0x343d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x343d('0x5')](_0x343d('0x6'),_0x343d('0x7'),_0x343d('0x8'),_0x343d('0x9'),_0x343d('0xa'),'system',_0x343d('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x343d('0x2')]},'interval':{'type':Sequelize[_0x343d('0x2')],'allowNull':![],'defaultValue':_0x343d('0xc')},'IntervalId':{'type':Sequelize[_0x343d('0xd')]},'isApp':{'type':Sequelize[_0x343d('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x343d('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x343d('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x343d('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x343d('0xd')]},'recordingFormat':{'type':Sequelize[_0x343d('0x2')],'defaultValue':_0x343d('0xf')},'answer':{'type':Sequelize[_0x343d('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x343d('0x10')],'get':function(_0x17c95f){return this[_0x343d('0x11')](_0x343d('0x12'));}},'alias':{'type':Sequelize[_0x343d('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xfaef=['compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','exten','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfaef,0xde));var _0xffae=function(_0x5f5b95,_0x4c5897){_0x5f5b95=_0x5f5b95-0x0;var _0x2085a0=_0xfaef[_0x5f5b95];return _0x2085a0;};'use strict';var Sequelize=require(_0xffae('0x0'));module[_0xffae('0x1')]={'context':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'unique':_0xffae('0x3')},'priority':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xffae('0x3')},'tag':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'defaultValue':_0xffae('0x4')},'appdata':{'type':Sequelize[_0xffae('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xffae('0x5')](_0xffae('0x6'),_0xffae('0x7'),_0xffae('0x8'),'inbound-fax',_0xffae('0x9'),'system',_0xffae('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xffae('0x2')]},'interval':{'type':Sequelize[_0xffae('0x2')],'allowNull':![],'defaultValue':_0xffae('0xb')},'IntervalId':{'type':Sequelize[_0xffae('0xc')]},'isApp':{'type':Sequelize[_0xffae('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xffae('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xffae('0xc')]},'recordingFormat':{'type':Sequelize[_0xffae('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xffae('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x36ce9d){return this['getDataValue'](_0xffae('0xe'));}},'alias':{'type':Sequelize[_0xffae('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 21b8e77..7222d4e 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 _0x0b6f=['findAll','rows','catch','find','params','create','outbound','body','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','map','value','type','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x2a4bf0,_0xa0f106){var _0x3ea9f5=function(_0x540de5){while(--_0x540de5){_0x2a4bf0['push'](_0x2a4bf0['shift']());}};_0x3ea9f5(++_0xa0f106);}(_0x0b6f,0x134));var _0xf0b6=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x0b6f[_0x333714];return _0x4c211e;};'use strict';var _=require(_0xf0b6('0x0'));var Redis=require(_0xf0b6('0x1'));var qs=require(_0xf0b6('0x2'));var logger=require(_0xf0b6('0x3'))(_0xf0b6('0x4'));var config=require(_0xf0b6('0x5'));var db=require(_0xf0b6('0x6'))['db'];config[_0xf0b6('0x7')]=_[_0xf0b6('0x8')](config[_0xf0b6('0x7')],{'host':_0xf0b6('0x9'),'port':0x18eb});var socket=require(_0xf0b6('0xa'))(new Redis(config[_0xf0b6('0x7')]));require(_0xf0b6('0xb'))['register'](socket);function respondWithStatusCode(_0x1fd6f0,_0x303333){_0x303333=_0x303333||0xcc;return function(_0x107647){if(_0x107647){return _0x1fd6f0[_0xf0b6('0xc')](_0x303333);}return _0x1fd6f0[_0xf0b6('0xd')](_0x303333)[_0xf0b6('0xe')]();};}function respondWithResult(_0x5f1976,_0x4a0da4){_0x4a0da4=_0x4a0da4||0xc8;return function(_0x9e2e1c){if(_0x9e2e1c){return _0x5f1976[_0xf0b6('0xd')](_0x4a0da4)[_0xf0b6('0xf')](_0x9e2e1c);}};}function respondWithFilteredResult(_0x110ccf,_0x461061){return function(_0xaf935c){if(_0xaf935c){var _0x359690=typeof _0x461061[_0xf0b6('0x10')]==='undefined'&&typeof _0x461061[_0xf0b6('0x11')]===_0xf0b6('0x12');var _0x12a702=_0xaf935c['count'];var _0x2d177d=_0x359690?0x0:_0x461061[_0xf0b6('0x10')];var _0x3ee732=_0x359690?_0xaf935c[_0xf0b6('0x13')]:_0x461061[_0xf0b6('0x10')]+_0x461061['limit'];var _0x1b3892;if(_0x3ee732>=_0x12a702){_0x3ee732=_0x12a702;_0x1b3892=0xc8;}else{_0x1b3892=0xce;}_0x110ccf[_0xf0b6('0xd')](_0x1b3892);return _0x110ccf[_0xf0b6('0x14')](_0xf0b6('0x15'),_0x2d177d+'-'+_0x3ee732+'/'+_0x12a702)[_0xf0b6('0xf')](_0xaf935c);}return null;};}function removeEntity(_0x335b29){return function(_0x2be350){if(_0x2be350){return _0x2be350[_0xf0b6('0x16')]()[_0xf0b6('0x17')](function(){var _0x266251=_0x2be350[_0xf0b6('0x18')]({'plain':!![]});var _0x41bb81=[{'name':_0xf0b6('0x19'),'value':_0xf0b6('0x1a'),'ignore':![]},{'name':_0xf0b6('0x1b'),'value':'outbound','ignore':![]},{'name':_0xf0b6('0x1c'),'value':_0xf0b6('0x1d'),'ignore':![]}];var _0x45b78f=_(_0x41bb81)['filter']('ignore')[_0xf0b6('0x1e')](_0xf0b6('0x1f'))[_0xf0b6('0x1f')]();if(_['includes'](_0x45b78f,_0x266251[_0xf0b6('0x20')])){return;}var _0xa7b51f=_['find'](_0x41bb81,[_0xf0b6('0x1f'),_0x266251[_0xf0b6('0x20')]])[_0xf0b6('0x21')];return db[_0xf0b6('0x22')][_0xf0b6('0x16')]({'where':{'type':_0xa7b51f,'resourceId':_0x266251['id']}})[_0xf0b6('0x17')](function(){return _0x2be350;});})[_0xf0b6('0x17')](function(){_0x335b29[_0xf0b6('0xd')](0xcc)[_0xf0b6('0xe')]();});}};}function handleEntityNotFound(_0x6a6d8a){return function(_0xda9ebd){if(!_0xda9ebd){_0x6a6d8a[_0xf0b6('0xc')](0x194);}return _0xda9ebd;};}function handleError(_0x1d78d9,_0x3cac1c){_0x3cac1c=_0x3cac1c||0x1f4;return function(_0x254946){logger['error'](_0x254946[_0xf0b6('0x23')]);if(_0x254946['name']){delete _0x254946['name'];}_0x1d78d9[_0xf0b6('0xd')](_0x3cac1c)[_0xf0b6('0x24')](_0x254946);};}exports[_0xf0b6('0x25')]=function(_0x40b369,_0x355d66){var _0xcb3452={},_0x2e80cf={},_0xb8d36a={'count':0x0,'rows':[]};var _0xac0dc1=_[_0xf0b6('0x1e')](db[_0xf0b6('0x26')][_0xf0b6('0x27')],function(_0x181a6b){return{'name':_0x181a6b[_0xf0b6('0x28')],'type':_0x181a6b['type'][_0xf0b6('0x29')]};});_0x2e80cf[_0xf0b6('0x2a')]=_[_0xf0b6('0x1e')](_0xac0dc1,_0xf0b6('0x21'));_0x2e80cf[_0xf0b6('0x2b')]=_[_0xf0b6('0x2c')](_0x40b369[_0xf0b6('0x2b')]);_0x2e80cf[_0xf0b6('0x2d')]=_[_0xf0b6('0x2e')](_0x2e80cf[_0xf0b6('0x2a')],_0x2e80cf[_0xf0b6('0x2b')]);_0xcb3452['attributes']=_['intersection'](_0x2e80cf[_0xf0b6('0x2a')],qs[_0xf0b6('0x2f')](_0x40b369[_0xf0b6('0x2b')][_0xf0b6('0x2f')]));_0xcb3452['attributes']=_0xcb3452[_0xf0b6('0x30')][_0xf0b6('0x31')]?_0xcb3452['attributes']:_0x2e80cf[_0xf0b6('0x2a')];if(!_0x40b369['query'][_0xf0b6('0x32')]('nolimit')){_0xcb3452[_0xf0b6('0x11')]=qs[_0xf0b6('0x11')](_0x40b369[_0xf0b6('0x2b')][_0xf0b6('0x11')]);_0xcb3452[_0xf0b6('0x10')]=qs[_0xf0b6('0x10')](_0x40b369['query']['offset']);}_0xcb3452[_0xf0b6('0x33')]=qs[_0xf0b6('0x34')](_0x40b369[_0xf0b6('0x2b')][_0xf0b6('0x34')]);_0xcb3452[_0xf0b6('0x35')]=qs[_0xf0b6('0x2d')](_['pick'](_0x40b369[_0xf0b6('0x2b')],_0x2e80cf[_0xf0b6('0x2d')]),_0xac0dc1);if(_0x40b369['query'][_0xf0b6('0x36')]){_0xcb3452[_0xf0b6('0x35')]=_[_0xf0b6('0x37')](_0xcb3452[_0xf0b6('0x35')],{'$or':_[_0xf0b6('0x1e')](_0xac0dc1,function(_0x1f04a6){if(_0x1f04a6[_0xf0b6('0x20')]!==_0xf0b6('0x38')){var _0x16663b={};_0x16663b[_0x1f04a6[_0xf0b6('0x21')]]={'$like':'%'+_0x40b369['query'][_0xf0b6('0x36')]+'%'};return _0x16663b;}})});}_0xcb3452=_[_0xf0b6('0x37')]({},_0xcb3452,_0x40b369[_0xf0b6('0x39')]);var _0x1f4b2a={'where':_0xcb3452[_0xf0b6('0x35')]};return db['VoiceExtension']['count'](_0x1f4b2a)[_0xf0b6('0x17')](function(_0x98d64e){_0xb8d36a[_0xf0b6('0x13')]=_0x98d64e;if(_0x40b369['query'][_0xf0b6('0x3a')]){_0xcb3452[_0xf0b6('0x3b')]=[{'all':!![]}];}return db[_0xf0b6('0x26')][_0xf0b6('0x3c')](_0xcb3452);})['then'](function(_0x21e7d8){_0xb8d36a[_0xf0b6('0x3d')]=_0x21e7d8;return _0xb8d36a;})[_0xf0b6('0x17')](respondWithFilteredResult(_0x355d66,_0xcb3452))['catch'](handleError(_0x355d66,null));};exports['show']=function(_0x5c4b3f,_0x1334f6){var _0x42ea8c={'raw':![],'where':{'id':_0x5c4b3f['params']['id']}},_0x5e3495={};_0x5e3495[_0xf0b6('0x2a')]=_[_0xf0b6('0x2c')](db['VoiceExtension']['rawAttributes']);_0x5e3495['query']=_[_0xf0b6('0x2c')](_0x5c4b3f[_0xf0b6('0x2b')]);_0x5e3495['filters']=_['intersection'](_0x5e3495[_0xf0b6('0x2a')],_0x5e3495[_0xf0b6('0x2b')]);_0x42ea8c[_0xf0b6('0x30')]=_['intersection'](_0x5e3495[_0xf0b6('0x2a')],qs[_0xf0b6('0x2f')](_0x5c4b3f[_0xf0b6('0x2b')][_0xf0b6('0x2f')]));_0x42ea8c[_0xf0b6('0x30')]=_0x42ea8c[_0xf0b6('0x30')][_0xf0b6('0x31')]?_0x42ea8c[_0xf0b6('0x30')]:_0x5e3495[_0xf0b6('0x2a')];if(_0x5c4b3f['query']['includeAll']){_0x42ea8c[_0xf0b6('0x3b')]=[{'all':!![]}];}_0x42ea8c=_['merge']({},_0x42ea8c,_0x5c4b3f[_0xf0b6('0x39')]);return db['VoiceExtension']['find'](_0x42ea8c)[_0xf0b6('0x17')](handleEntityNotFound(_0x1334f6,null))[_0xf0b6('0x17')](respondWithResult(_0x1334f6,null))[_0xf0b6('0x3e')](handleError(_0x1334f6,null));};exports['destroy']=function(_0x53ccab,_0x4c1b04){return db[_0xf0b6('0x26')][_0xf0b6('0x3f')]({'where':{'id':_0x53ccab[_0xf0b6('0x40')]['id']}})[_0xf0b6('0x17')](handleEntityNotFound(_0x4c1b04,null))[_0xf0b6('0x17')](removeEntity(_0x4c1b04,null))['catch'](handleError(_0x4c1b04,null));};exports[_0xf0b6('0x41')]=function(_0x16d489,_0x500a2d){if(_0x16d489['body'][_0xf0b6('0x20')]===_0xf0b6('0x42')&&!_['startsWith'](_0x16d489[_0xf0b6('0x43')][_0xf0b6('0x44')],'_')){_0x16d489['body'][_0xf0b6('0x44')]='_'['concat'](_0x16d489[_0xf0b6('0x43')][_0xf0b6('0x44')]);}return db[_0xf0b6('0x26')][_0xf0b6('0x41')](_0x16d489[_0xf0b6('0x43')],{'raw':![]})[_0xf0b6('0x17')](function(_0x270785){var _0x1172d4=_0x16d489['user']['get']({'plain':!![]});if(!_0x1172d4)throw new Error(_0xf0b6('0x45'));if(_0x1172d4['role']===_0xf0b6('0x46')){var _0x335e57=_0x270785[_0xf0b6('0x18')]({'plain':!![]});var _0x4c5195=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xf0b6('0x1b'),'value':_0xf0b6('0x42')},{'name':_0xf0b6('0x1c'),'value':'internal'}];var _0x3fb601=_[_0xf0b6('0x3f')](_0x4c5195,['value',_0x335e57[_0xf0b6('0x20')]])[_0xf0b6('0x21')];return db['UserProfileSection'][_0xf0b6('0x3f')]({'where':{'name':_0x3fb601,'userProfileId':_0x1172d4[_0xf0b6('0x47')]},'raw':!![]})['then'](function(_0x351e21){if(_0x351e21&&_0x351e21[_0xf0b6('0x48')]===0x0){return db[_0xf0b6('0x22')][_0xf0b6('0x41')]({'name':_0x335e57[_0xf0b6('0x21')],'resourceId':_0x335e57['id'],'type':_0x351e21['name'],'sectionId':_0x351e21['id']},{})[_0xf0b6('0x17')](function(){return _0x270785;});}else{return _0x270785;}})['catch'](function(_0x3f5edc){logger[_0xf0b6('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f5edc);throw _0x3f5edc;});}return _0x270785;})['then'](respondWithResult(_0x500a2d,0xc9))['catch'](handleError(_0x500a2d,null));};exports[_0xf0b6('0x4a')]=function(_0x24b1da,_0x5c726f){if(_0x24b1da[_0xf0b6('0x43')]['id']){delete _0x24b1da[_0xf0b6('0x43')]['id'];}return db[_0xf0b6('0x26')]['find']({'where':{'id':_0x24b1da[_0xf0b6('0x40')]['id']}})[_0xf0b6('0x17')](handleEntityNotFound(_0x5c726f,null))[_0xf0b6('0x17')](function(_0xf8f20e){if(_0xf8f20e){return db[_0xf0b6('0x26')][_0xf0b6('0x4a')](_[_0xf0b6('0x4b')](_0x24b1da[_0xf0b6('0x43')],['exten','context',_0xf0b6('0x4c'),_0xf0b6('0x4d'),_0xf0b6('0x4e'),_0xf0b6('0x4f'),_0xf0b6('0x50')]),{'where':{'context':_0xf8f20e[_0xf0b6('0x51')],'exten':_0xf8f20e[_0xf0b6('0x44')]},'individualHooks':!![]})[_0xf0b6('0x17')](function(_0x3703c4){return _0x3703c4;});}return null;})[_0xf0b6('0x17')](respondWithStatusCode(_0x5c726f,null))[_0xf0b6('0x3e')](handleError(_0x5c726f,null));};exports[_0xf0b6('0x52')]=function(_0x382976,_0x1708cd){return db[_0xf0b6('0x26')][_0xf0b6('0x53')]({'where':{'id':_0x382976['params']['id']}})['then'](function(_0x3658aa){if(_0x3658aa){return db[_0xf0b6('0x54')][_0xf0b6('0x55')](function(_0x511294){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x382976[_0xf0b6('0x40')]['id']},'transaction':_0x511294})[_0xf0b6('0x17')](function(){var _0x2e46ae=_[_0xf0b6('0x1e')](_0x382976[_0xf0b6('0x43')],function(_0x44b51f){_0x44b51f[_0xf0b6('0x56')]=_0x382976[_0xf0b6('0x40')]['id'];_0x44b51f[_0xf0b6('0x57')]=!![];return _0x44b51f;});return _0x3658aa[_0xf0b6('0x58')](_0x2e46ae);})[_0xf0b6('0x17')](function(_0x56ea52){console[_0xf0b6('0x59')](_0xf0b6('0x5a'),_0x56ea52);return db['VoiceExtension'][_0xf0b6('0x5b')](_0x56ea52,{'transaction':_0x511294});});})[_0xf0b6('0x17')](function(){return db[_0xf0b6('0x26')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x382976[_0xf0b6('0x40')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xf0b6('0x17')](respondWithResult(_0x1708cd,null))[_0xf0b6('0x3e')](handleError(_0x1708cd,null));}; \ No newline at end of file +var _0xb574=['undefined','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','sendStatus','status','end','json','limit'];(function(_0x463e3f,_0x495d08){var _0x51038b=function(_0x424559){while(--_0x424559){_0x463e3f['push'](_0x463e3f['shift']());}};_0x51038b(++_0x495d08);}(_0xb574,0x106));var _0x4b57=function(_0x2a1eff,_0x3750a8){_0x2a1eff=_0x2a1eff-0x0;var _0x2bd9d5=_0xb574[_0x2a1eff];return _0x2bd9d5;};'use strict';var _=require(_0x4b57('0x0'));var Redis=require(_0x4b57('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x4b57('0x2'))(_0x4b57('0x3'));var config=require('../../config/environment');var db=require(_0x4b57('0x4'))['db'];config[_0x4b57('0x5')]=_[_0x4b57('0x6')](config[_0x4b57('0x5')],{'host':_0x4b57('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4b57('0x8'))['register'](socket);function respondWithStatusCode(_0x585d86,_0x4b2d65){_0x4b2d65=_0x4b2d65||0xcc;return function(_0x548ee8){if(_0x548ee8){return _0x585d86[_0x4b57('0x9')](_0x4b2d65);}return _0x585d86[_0x4b57('0xa')](_0x4b2d65)[_0x4b57('0xb')]();};}function respondWithResult(_0x3b112d,_0xce47ad){_0xce47ad=_0xce47ad||0xc8;return function(_0x116958){if(_0x116958){return _0x3b112d[_0x4b57('0xa')](_0xce47ad)[_0x4b57('0xc')](_0x116958);}};}function respondWithFilteredResult(_0x5593b8,_0x31c086){return function(_0x1062c5){if(_0x1062c5){var _0x274912=typeof _0x31c086['offset']==='undefined'&&typeof _0x31c086[_0x4b57('0xd')]===_0x4b57('0xe');var _0x43d066=_0x1062c5[_0x4b57('0xf')];var _0x607276=_0x274912?0x0:_0x31c086[_0x4b57('0x10')];var _0x30f685=_0x274912?_0x1062c5[_0x4b57('0xf')]:_0x31c086[_0x4b57('0x10')]+_0x31c086['limit'];var _0x4a58dc;if(_0x30f685>=_0x43d066){_0x30f685=_0x43d066;_0x4a58dc=0xc8;}else{_0x4a58dc=0xce;}_0x5593b8[_0x4b57('0xa')](_0x4a58dc);return _0x5593b8[_0x4b57('0x11')](_0x4b57('0x12'),_0x607276+'-'+_0x30f685+'/'+_0x43d066)['json'](_0x1062c5);}return null;};}function removeEntity(_0x284640){return function(_0x48bd13){if(_0x48bd13){return _0x48bd13[_0x4b57('0x13')]()[_0x4b57('0x14')](function(){var _0x1b018c=_0x48bd13[_0x4b57('0x15')]({'plain':!![]});var _0x20cf5e=[{'name':_0x4b57('0x16'),'value':'inbound','ignore':![]},{'name':_0x4b57('0x17'),'value':_0x4b57('0x18'),'ignore':![]},{'name':_0x4b57('0x19'),'value':_0x4b57('0x1a'),'ignore':![]}];var _0x4baaeb=_(_0x20cf5e)[_0x4b57('0x1b')](_0x4b57('0x1c'))[_0x4b57('0x1d')](_0x4b57('0x1e'))[_0x4b57('0x1e')]();if(_[_0x4b57('0x1f')](_0x4baaeb,_0x1b018c['type'])){return;}var _0x4b504b=_[_0x4b57('0x20')](_0x20cf5e,[_0x4b57('0x1e'),_0x1b018c['type']])[_0x4b57('0x21')];return db[_0x4b57('0x22')][_0x4b57('0x13')]({'where':{'type':_0x4b504b,'resourceId':_0x1b018c['id']}})[_0x4b57('0x14')](function(){return _0x48bd13;});})['then'](function(){_0x284640[_0x4b57('0xa')](0xcc)[_0x4b57('0xb')]();});}};}function handleEntityNotFound(_0x4d07c9){return function(_0x3e7b96){if(!_0x3e7b96){_0x4d07c9[_0x4b57('0x9')](0x194);}return _0x3e7b96;};}function handleError(_0x25d190,_0x36197e){_0x36197e=_0x36197e||0x1f4;return function(_0x540eff){logger[_0x4b57('0x23')](_0x540eff['stack']);if(_0x540eff[_0x4b57('0x21')]){delete _0x540eff['name'];}_0x25d190[_0x4b57('0xa')](_0x36197e)[_0x4b57('0x24')](_0x540eff);};}exports[_0x4b57('0x25')]=function(_0x6584c4,_0x104f52){var _0x392e37={},_0x4ffee1={},_0x5c3c7a={'count':0x0,'rows':[]};var _0x16d196=_['map'](db[_0x4b57('0x26')][_0x4b57('0x27')],function(_0x874cf7){return{'name':_0x874cf7[_0x4b57('0x28')],'type':_0x874cf7[_0x4b57('0x29')][_0x4b57('0x2a')]};});_0x4ffee1['model']=_[_0x4b57('0x1d')](_0x16d196,_0x4b57('0x21'));_0x4ffee1[_0x4b57('0x2b')]=_[_0x4b57('0x2c')](_0x6584c4['query']);_0x4ffee1[_0x4b57('0x2d')]=_[_0x4b57('0x2e')](_0x4ffee1['model'],_0x4ffee1[_0x4b57('0x2b')]);_0x392e37[_0x4b57('0x2f')]=_[_0x4b57('0x2e')](_0x4ffee1[_0x4b57('0x30')],qs['fields'](_0x6584c4['query']['fields']));_0x392e37[_0x4b57('0x2f')]=_0x392e37[_0x4b57('0x2f')][_0x4b57('0x31')]?_0x392e37[_0x4b57('0x2f')]:_0x4ffee1[_0x4b57('0x30')];if(!_0x6584c4['query'][_0x4b57('0x32')](_0x4b57('0x33'))){_0x392e37[_0x4b57('0xd')]=qs['limit'](_0x6584c4[_0x4b57('0x2b')][_0x4b57('0xd')]);_0x392e37[_0x4b57('0x10')]=qs['offset'](_0x6584c4[_0x4b57('0x2b')][_0x4b57('0x10')]);}_0x392e37['order']=qs[_0x4b57('0x34')](_0x6584c4[_0x4b57('0x2b')][_0x4b57('0x34')]);_0x392e37[_0x4b57('0x35')]=qs[_0x4b57('0x2d')](_[_0x4b57('0x36')](_0x6584c4['query'],_0x4ffee1[_0x4b57('0x2d')]),_0x16d196);if(_0x6584c4[_0x4b57('0x2b')][_0x4b57('0x1b')]){_0x392e37[_0x4b57('0x35')]=_[_0x4b57('0x37')](_0x392e37[_0x4b57('0x35')],{'$or':_[_0x4b57('0x1d')](_0x16d196,function(_0x4c5b82){if(_0x4c5b82['type']!==_0x4b57('0x38')){var _0x41204e={};_0x41204e[_0x4c5b82[_0x4b57('0x21')]]={'$like':'%'+_0x6584c4['query'][_0x4b57('0x1b')]+'%'};return _0x41204e;}})});}_0x392e37=_[_0x4b57('0x37')]({},_0x392e37,_0x6584c4[_0x4b57('0x39')]);var _0x3c086e={'where':_0x392e37['where']};return db[_0x4b57('0x26')][_0x4b57('0xf')](_0x3c086e)[_0x4b57('0x14')](function(_0x2d24ab){_0x5c3c7a['count']=_0x2d24ab;if(_0x6584c4['query']['includeAll']){_0x392e37[_0x4b57('0x3a')]=[{'all':!![]}];}return db[_0x4b57('0x26')][_0x4b57('0x3b')](_0x392e37);})[_0x4b57('0x14')](function(_0x5f4971){_0x5c3c7a[_0x4b57('0x3c')]=_0x5f4971;return _0x5c3c7a;})[_0x4b57('0x14')](respondWithFilteredResult(_0x104f52,_0x392e37))[_0x4b57('0x3d')](handleError(_0x104f52,null));};exports[_0x4b57('0x3e')]=function(_0x2820ce,_0x453129){var _0x2d5a0c={'raw':![],'where':{'id':_0x2820ce[_0x4b57('0x3f')]['id']}},_0x55952f={};_0x55952f['model']=_[_0x4b57('0x2c')](db[_0x4b57('0x26')][_0x4b57('0x27')]);_0x55952f['query']=_[_0x4b57('0x2c')](_0x2820ce['query']);_0x55952f[_0x4b57('0x2d')]=_[_0x4b57('0x2e')](_0x55952f[_0x4b57('0x30')],_0x55952f[_0x4b57('0x2b')]);_0x2d5a0c[_0x4b57('0x2f')]=_[_0x4b57('0x2e')](_0x55952f[_0x4b57('0x30')],qs[_0x4b57('0x40')](_0x2820ce[_0x4b57('0x2b')][_0x4b57('0x40')]));_0x2d5a0c[_0x4b57('0x2f')]=_0x2d5a0c[_0x4b57('0x2f')][_0x4b57('0x31')]?_0x2d5a0c['attributes']:_0x55952f['model'];if(_0x2820ce[_0x4b57('0x2b')][_0x4b57('0x41')]){_0x2d5a0c[_0x4b57('0x3a')]=[{'all':!![]}];}_0x2d5a0c=_[_0x4b57('0x37')]({},_0x2d5a0c,_0x2820ce['options']);return db[_0x4b57('0x26')][_0x4b57('0x20')](_0x2d5a0c)['then'](handleEntityNotFound(_0x453129,null))[_0x4b57('0x14')](respondWithResult(_0x453129,null))['catch'](handleError(_0x453129,null));};exports[_0x4b57('0x13')]=function(_0x4cf94e,_0x5b8ea5){return db[_0x4b57('0x26')][_0x4b57('0x20')]({'where':{'id':_0x4cf94e['params']['id']}})[_0x4b57('0x14')](handleEntityNotFound(_0x5b8ea5,null))[_0x4b57('0x14')](removeEntity(_0x5b8ea5,null))[_0x4b57('0x3d')](handleError(_0x5b8ea5,null));};exports[_0x4b57('0x42')]=function(_0x66e7a6,_0x26bfdf){if(_0x66e7a6['body'][_0x4b57('0x29')]===_0x4b57('0x18')&&!_['startsWith'](_0x66e7a6[_0x4b57('0x43')][_0x4b57('0x44')],'_')){_0x66e7a6[_0x4b57('0x43')]['exten']='_'[_0x4b57('0x45')](_0x66e7a6['body'][_0x4b57('0x44')]);}return db[_0x4b57('0x26')][_0x4b57('0x42')](_0x66e7a6[_0x4b57('0x43')],{'raw':![]})[_0x4b57('0x14')](function(_0x1b36b6){var _0x3d1ecd=_0x66e7a6[_0x4b57('0x46')]['get']({'plain':!![]});if(!_0x3d1ecd)throw new Error(_0x4b57('0x47'));if(_0x3d1ecd[_0x4b57('0x48')]===_0x4b57('0x46')){var _0x5ac5e8=_0x1b36b6[_0x4b57('0x15')]({'plain':!![]});var _0xcf72b6=[{'name':_0x4b57('0x16'),'value':'inbound'},{'name':_0x4b57('0x17'),'value':_0x4b57('0x18')},{'name':_0x4b57('0x19'),'value':_0x4b57('0x1a')}];var _0x44494f=_[_0x4b57('0x20')](_0xcf72b6,[_0x4b57('0x1e'),_0x5ac5e8['type']])['name'];return db[_0x4b57('0x49')][_0x4b57('0x20')]({'where':{'name':_0x44494f,'userProfileId':_0x3d1ecd[_0x4b57('0x4a')]},'raw':!![]})[_0x4b57('0x14')](function(_0x568cfc){if(_0x568cfc&&_0x568cfc[_0x4b57('0x4b')]===0x0){return db[_0x4b57('0x22')][_0x4b57('0x42')]({'name':_0x5ac5e8[_0x4b57('0x21')],'resourceId':_0x5ac5e8['id'],'type':_0x568cfc['name'],'sectionId':_0x568cfc['id']},{})['then'](function(){return _0x1b36b6;});}else{return _0x1b36b6;}})[_0x4b57('0x3d')](function(_0x1b64b6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b64b6);throw _0x1b64b6;});}return _0x1b36b6;})[_0x4b57('0x14')](respondWithResult(_0x26bfdf,0xc9))['catch'](handleError(_0x26bfdf,null));};exports[_0x4b57('0x4c')]=function(_0x3392ea,_0x16f83a){if(_0x3392ea[_0x4b57('0x43')]['id']){delete _0x3392ea[_0x4b57('0x43')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x3392ea['params']['id']}})['then'](handleEntityNotFound(_0x16f83a,null))[_0x4b57('0x14')](function(_0x470cd5){if(_0x470cd5){return db['VoiceExtension'][_0x4b57('0x4c')](_[_0x4b57('0x36')](_0x3392ea[_0x4b57('0x43')],[_0x4b57('0x44'),_0x4b57('0x4d'),_0x4b57('0x4e'),_0x4b57('0x4f'),_0x4b57('0x50'),_0x4b57('0x51'),'alias']),{'where':{'context':_0x470cd5[_0x4b57('0x4d')],'exten':_0x470cd5['exten']},'individualHooks':!![]})[_0x4b57('0x14')](function(_0x2f684b){return _0x2f684b;});}return null;})['then'](respondWithStatusCode(_0x16f83a,null))[_0x4b57('0x3d')](handleError(_0x16f83a,null));};exports[_0x4b57('0x52')]=function(_0x21411f,_0x916add){return db[_0x4b57('0x26')][_0x4b57('0x53')]({'where':{'id':_0x21411f[_0x4b57('0x3f')]['id']}})[_0x4b57('0x14')](function(_0x3ed705){if(_0x3ed705){return db[_0x4b57('0x54')][_0x4b57('0x55')](function(_0x9d83fe){return db['VoiceExtension'][_0x4b57('0x13')]({'where':{'VoiceExtensionId':_0x21411f[_0x4b57('0x3f')]['id']},'transaction':_0x9d83fe})['then'](function(){var _0x22c800=_['map'](_0x21411f['body'],function(_0x55262c){_0x55262c[_0x4b57('0x56')]=_0x21411f['params']['id'];_0x55262c[_0x4b57('0x57')]=!![];return _0x55262c;});return _0x3ed705[_0x4b57('0x58')](_0x22c800);})['then'](function(_0x4cc278){console[_0x4b57('0x59')](_0x4b57('0x5a'),_0x4cc278);return db[_0x4b57('0x26')]['bulkCreate'](_0x4cc278,{'transaction':_0x9d83fe});});})[_0x4b57('0x14')](function(){return db[_0x4b57('0x26')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x21411f[_0x4b57('0x3f')]['id']},'order':_0x4b57('0x5b')});});}})['then'](respondWithResult(_0x916add,null))[_0x4b57('0x3d')](handleError(_0x916add,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 14575fb..4232167 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 _0x3809=['exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xda8d0b,_0x1fe50e){var _0x5d5d42=function(_0x3530b9){while(--_0x3530b9){_0xda8d0b['push'](_0xda8d0b['shift']());}};_0x5d5d42(++_0x1fe50e);}(_0x3809,0x1ba));var _0x9380=function(_0x8ffd03,_0x45180e){_0x8ffd03=_0x8ffd03-0x0;var _0x4ca4e9=_0x3809[_0x8ffd03];return _0x4ca4e9;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9380('0x0'))['db'][_0x9380('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9380('0x2')](0x0);var events={'afterCreate':_0x9380('0x3'),'afterUpdate':_0x9380('0x4'),'afterDestroy':_0x9380('0x5')};function emitEvent(_0x2854be){return function(_0x39fda2,_0x5ffd2a,_0x1feadc){VoiceExtensionEvents[_0x9380('0x6')](_0x2854be+':'+_0x39fda2['id'],_0x39fda2);VoiceExtensionEvents[_0x9380('0x6')](_0x2854be,_0x39fda2);_0x1feadc(null);};}for(var e in events){if(events[_0x9380('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x9380('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x25c4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x1c7597,_0x323a35){var _0x4f9187=function(_0x40fc12){while(--_0x40fc12){_0x1c7597['push'](_0x1c7597['shift']());}};_0x4f9187(++_0x323a35);}(_0x25c4,0x165));var _0x425c=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x25c4[_0xd0cd0b];return _0x59cced;};'use strict';var EventEmitter=require(_0x425c('0x0'));var VoiceExtension=require(_0x425c('0x1'))['db'][_0x425c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x425c('0x3')](0x0);var events={'afterCreate':_0x425c('0x4'),'afterUpdate':_0x425c('0x5'),'afterDestroy':_0x425c('0x6')};function emitEvent(_0xc4fe29){return function(_0x516f9c,_0x41b24c,_0x1ad32f){VoiceExtensionEvents['emit'](_0xc4fe29+':'+_0x516f9c['id'],_0x516f9c);VoiceExtensionEvents[_0x425c('0x7')](_0xc4fe29,_0x516f9c);_0x1ad32f(null);};}for(var e in events){if(events[_0x425c('0x8')](e)){var event=events[e];VoiceExtension[_0x425c('0x9')](e,emitEvent(event));}}module[_0x425c('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 7f5abc3..e83d870 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 _0x0c9c=['ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','intervals','map','filter','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','appdata','last','priority','concat','catch','define','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)='];(function(_0x4abcc1,_0x4c536f){var _0x30eb0b=function(_0x243e6c){while(--_0x243e6c){_0x4abcc1['push'](_0x4abcc1['shift']());}};_0x30eb0b(++_0x4c536f);}(_0x0c9c,0x188));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc0c9('0x0'));var attributes=require(_0xc0c9('0x1'));module[_0xc0c9('0x2')]=function(_0x3cc26b){var _0x4abb6c=_0x3cc26b[_0xc0c9('0x3')];function _0x5bc767(_0x10d090){var _0x7f8ea1=0x2;var _0x40f245=[{'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x6')+_0x10d090[_0xc0c9('0x4')],'context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':_0x10d090[_0xc0c9('0x9')]?'Set':_0xc0c9('0xa'),'appdata':_0x10d090[_0xc0c9('0x9')]?_0xc0c9('0xb')+_0x10d090[_0xc0c9('0x9')]:'No\x20alias\x20set','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']}];if(_0x10d090['type']===_0xc0c9('0xc')){_0x40f245['push']({'type':_0xc0c9('0xc'),'app':_0xc0c9('0x5'),'appdata':'CDR(routeid)='+_0x10d090['id'],'context':_0x10d090['context'],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']});}_0x40f245[_0xc0c9('0xd')]({'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0xe'),'context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']});return _0x40f245;}function _0x9786eb(_0x3eb983){var _0x49045f=0x2;var _0x198c90=[{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x10'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0x3eb983[_0xc0c9('0x9')]?_0xc0c9('0x5'):_0xc0c9('0xa'),'appdata':_0x3eb983[_0xc0c9('0x9')]?'CDR(routeAlias)='+_0x3eb983[_0xc0c9('0x9')]:_0xc0c9('0x11'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x12')+(_0x3eb983[_0xc0c9('0x13')]?_0xc0c9('0x14')+_0x3eb983[_0xc0c9('0x13')]+'}':_0xc0c9('0x15')),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':'Set','appdata':_0xc0c9('0x16')+_0x3eb983['id'],'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':'outbound','app':_0xc0c9('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x49045f+0x2)+'):Goto('+(_0x49045f+0x1)+')','context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0x3eb983[_0xc0c9('0x13')]?_0xc0c9('0x18')+_0x3eb983['cutdigits']+'}':_0xc0c9('0x19'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3eb983['context'],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1a'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1b')+_0x3eb983['id'],'context':_0x3eb983['context'],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']}];if(_0x3eb983[_0xc0c9('0x1c')](_0xc0c9('0x1d'))&&_0x3eb983['recordingFormat']!=='none'){_0x198c90[_0xc0c9('0xd')]({'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1e'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1f')+_0x3eb983['recordingFormat']||_0xc0c9('0x20'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']});}return _0x198c90;}function _0x2fda41(_0x4e4905,_0x1f14bb){var _0x53cb90=[{'name':'trunk','param':0x0},{'name':_0xc0c9('0x21'),'param':0x1},{'name':_0xc0c9('0x22'),'param':0x2},{'name':_0xc0c9('0x23'),'param':0x3}];var _0x240768={};var _0x1d114f=_0x1f14bb[_0xc0c9('0x24')](',');var _0x14184d=[];for(var _0x2942ec=0x0;_0x2942ec<_0x53cb90[_0xc0c9('0x25')];_0x2942ec++){switch(_0x53cb90[_0x2942ec][_0xc0c9('0x26')]){case _0xc0c9('0x27'):_0x240768[_0xc0c9('0x27')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]][_0xc0c9('0x24')]('/')[0x1];_0x240768[_0xc0c9('0x29')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]][_0xc0c9('0x24')]('/')[0x2];_0x240768[_0xc0c9('0x2a')]=_0x240768['phone']?_0x240768[_0xc0c9('0x29')][_0xc0c9('0x24')]('$')[0x0]:undefined;_0x240768[_0xc0c9('0x29')]=_0x4e4905[_0xc0c9('0x13')]?(_0x240768['prefix']||'')+_0xc0c9('0x14')+_0x4e4905['cutdigits']+'}':(_0x240768[_0xc0c9('0x2a')]||'')+_0xc0c9('0x15');_0x14184d[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]]=['SIP',_0x240768['trunk'],_0x240768[_0xc0c9('0x29')]][_0xc0c9('0x2b')]('/');break;case _0xc0c9('0x22'):_0x240768[_0xc0c9('0x22')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]];if(_0x4e4905[_0xc0c9('0x1d')]!==_0xc0c9('0x2c')){if(_0x240768[_0xc0c9('0x22')][_0xc0c9('0x2d')](_0xc0c9('0x2e'))<0x0){_0x240768[_0xc0c9('0x22')]+=_0xc0c9('0x2e');}}else{_0x240768[_0xc0c9('0x22')]=_0x240768['options'][_0xc0c9('0x2f')](_0xc0c9('0x2e'),'');}_0x14184d[_0x53cb90[_0x2942ec]['param']]=_0x240768['options'];break;default:_0x14184d[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]];}}return _0x14184d[_0xc0c9('0x2b')](',');}function _0xf6bbf0(_0x1c9565,_0x4a4818,_0x1de39d){return new Promise(function(_0x52b5e6,_0x4ba503){var _0x3696ba=[];if(_[_0xc0c9('0x30')](_0x4a4818))return _0x52b5e6(_0x3696ba);_0x4abb6c['Interval'][_0xc0c9('0x31')]({'attributes':['id',_0xc0c9('0x32'),_0xc0c9('0x33')],'raw':!![]})['then'](function(_0x53c702){for(var _0x17ff60=0x0,_0x311622=0x0;_0x17ff60<_0x4a4818[_0xc0c9('0x25')];_0x17ff60++,_0x311622=0x0){var _0x411711=_0x4a4818[_0x17ff60];var _0x392a51=[];var _0x300754=[];delete _0x411711['id'];if(_0x411711[_0xc0c9('0x32')]!=='*,*,*,*'){_0x411711[_0xc0c9('0x34')]=[_0x411711[_0xc0c9('0x32')]];}else{_0x411711[_0xc0c9('0x34')]=_0x411711['IntervalId']?_[_0xc0c9('0x35')](_[_0xc0c9('0x36')](_0x53c702,{'IntervalId':_0x411711[_0xc0c9('0x33')]}),_0xc0c9('0x32')):[];}_0x411711[_0xc0c9('0x7')]=_0x1c9565[_0xc0c9('0x7')];_0x411711[_0xc0c9('0x8')]=_0x1c9565[_0xc0c9('0x8')];if(_0x411711[_0xc0c9('0x4')])_0x411711[_0xc0c9('0x4')]=_0x411711['type']['toLowerCase']();if(_0x1c9565['type']===_0xc0c9('0xf')){if(_0x411711[_0xc0c9('0x1c')](_0xc0c9('0x37'))&&_0x411711[_0xc0c9('0x37')]&&_0x411711['tag']!=='--'){_0x392a51[_0xc0c9('0xd')]({'type':_0x411711['type'][_0xc0c9('0x38')](),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x39')+_0x411711[_0xc0c9('0x37')],'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}_0x392a51['push']({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':_0xc0c9('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x411711[_0xc0c9('0x3a')]?_0xc0c9('0x3b')+_0x411711[_0xc0c9('0x3a')]+')':_0xc0c9('0x3c')),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565['exten'],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}else{if(_0x411711[_0xc0c9('0x1c')]('answer')){if([_0xc0c9('0x3d'),_0xc0c9('0x3e')]['includes'](_0x411711[_0xc0c9('0x3f')][_0xc0c9('0x38')]())&&_0x411711['appType']!==_0xc0c9('0x40')){if(_0x411711[_0xc0c9('0x41')]){_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':_0xc0c9('0x17'),'appdata':_0xc0c9('0x42'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711['intervals'][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});_0x392a51['push']({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':'Set','appdata':_0xc0c9('0x43'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}else{_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')]['toLowerCase'](),'app':_0xc0c9('0x17'),'appdata':_0xc0c9('0x44'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')]['toLowerCase'](),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x45'),'context':_0x1c9565['context'],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}}}}for(var _0x1acac3=0x0;_0x1acac3<_0x411711['intervals'][_0xc0c9('0x25')];_0x1acac3++){var _0x2993d2=_0x1de39d+_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')];var _0x44a0e4=_0x1acac3===_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]-0x1?_0x1de39d+_0x392a51['length']+_0x300754[_0xc0c9('0x25')]+0x2:_0x1de39d+_0x1acac3+0x1;_0x392a51['splice'](_0x1acac3,0x0,{'type':_0x1c9565[_0xc0c9('0x4')],'app':_0xc0c9('0x46'),'appdata':_0x411711[_0xc0c9('0x34')][_0x1acac3]+'?'+_0x1c9565[_0xc0c9('0x7')]+_0xc0c9('0x47')+_0x2993d2+':'+_0x1c9565[_0xc0c9('0x7')]+_0xc0c9('0x47')+_0x44a0e4,'exten':_0x1c9565[_0xc0c9('0x8')],'context':_0x1c9565['context'],'priority':_0x1de39d+_0x1acac3,'VoiceExtensionId':_0x1c9565['id']});}if(_0x411711[_0xc0c9('0x48')]==='outboundDial')_0x411711[_0xc0c9('0x49')]=_0x2fda41(_0x1c9565,_0x411711['appdata']);_0x411711['priority']=_0x392a51[_0xc0c9('0x25')]?_[_0xc0c9('0x4a')](_0x392a51)[_0xc0c9('0x4b')]+0x1:_0x1de39d;_0x3696ba=_[_0xc0c9('0x4c')](_0x3696ba,_0x392a51,[_0x411711],_0x300754);_0x1de39d=_[_0xc0c9('0x4a')](_0x3696ba)[_0xc0c9('0x4b')]+0x1;}return _0x52b5e6(_0x3696ba);})[_0xc0c9('0x4d')](function(_0x128017){_0x4ba503(_0x128017);});});}return _0x3cc26b[_0xc0c9('0x4e')]('VoiceExtension',attributes,{'tableName':_0xc0c9('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x17da94){var _0x255803=this[_0xc0c9('0x50')]({'plain':!![]});var _0x2ebd29=_0x255803['type']===_0xc0c9('0xf')?_0x9786eb(_0x255803):_0x5bc767(_0x255803);return _0xf6bbf0(_0x255803,_0x17da94,_[_0xc0c9('0x4a')](_0x2ebd29)['priority']+0x1)[_0xc0c9('0x51')](function(_0x3264ce){var _0x1edf4c=_[_0xc0c9('0x4c')](_0x2ebd29,_0x3264ce);_0x1edf4c['push']({'type':_0x255803['type'],'app':_0xc0c9('0x52'),'exten':_0x255803[_0xc0c9('0x8')],'context':_0x255803['context'],'priority':_[_0xc0c9('0x4a')](_0x1edf4c)[_0xc0c9('0x4b')]+0x1,'VoiceExtensionId':_0x255803['id']});return _0x1edf4c;});}}});}; \ No newline at end of file +var _0xe4d4=['outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','split','length','name','trunk','param','prefix','phone','${EXTEN:','${EXTEN}','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','MONITOR_OPTIONS=ab'];(function(_0x24dd6a,_0x14134c){var _0x2dda2b=function(_0x1a05ef){while(--_0x1a05ef){_0x24dd6a['push'](_0x24dd6a['shift']());}};_0x2dda2b(++_0x14134c);}(_0xe4d4,0x184));var _0x4e4d=function(_0x2042d7,_0x313b47){_0x2042d7=_0x2042d7-0x0;var _0x1df24d=_0xe4d4[_0x2042d7];return _0x1df24d;};'use strict';var _=require(_0x4e4d('0x0'));var attributes=require(_0x4e4d('0x1'));module[_0x4e4d('0x2')]=function(_0x1a402a){var _0x47f8c5=_0x1a402a[_0x4e4d('0x3')];function _0x3a4139(_0x16564e){var _0x258c24=0x2;var _0x4221cb=[{'type':_0x16564e[_0x4e4d('0x4')],'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x6')+_0x16564e[_0x4e4d('0x4')],'context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e[_0x4e4d('0x8')],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']},{'type':_0x16564e[_0x4e4d('0x4')],'app':_0x16564e['alias']?_0x4e4d('0x5'):_0x4e4d('0x9'),'appdata':_0x16564e[_0x4e4d('0xa')]?_0x4e4d('0xb')+_0x16564e['alias']:_0x4e4d('0xc'),'context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e[_0x4e4d('0x8')],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']}];if(_0x16564e['type']==='inbound'){_0x4221cb[_0x4e4d('0xd')]({'type':_0x4e4d('0xe'),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0xf')+_0x16564e['id'],'context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e['exten'],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']});}_0x4221cb[_0x4e4d('0xd')]({'type':_0x16564e[_0x4e4d('0x4')],'app':_0x4e4d('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e['exten'],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']},{'type':_0x16564e[_0x4e4d('0x4')],'app':_0x4e4d('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e['exten'],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']},{'type':_0x16564e['type'],'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x10'),'context':_0x16564e[_0x4e4d('0x7')],'exten':_0x16564e[_0x4e4d('0x8')],'priority':_0x258c24++,'VoiceExtensionId':_0x16564e['id']});return _0x4221cb;}function _0x4412a9(_0x567aed){var _0x4488f2=0x2;var _0x55e0f2=[{'type':_0x4e4d('0x11'),'app':'Set','appdata':_0x4e4d('0x12'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x567aed[_0x4e4d('0xa')]?_0x4e4d('0x5'):_0x4e4d('0x9'),'appdata':_0x567aed[_0x4e4d('0xa')]?'CDR(routeAlias)='+_0x567aed[_0x4e4d('0xa')]:_0x4e4d('0xc'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x13')+(_0x567aed[_0x4e4d('0x14')]?'${EXTEN:'+_0x567aed[_0x4e4d('0x14')]+'}':'${EXTEN}'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':'Set','appdata':_0x4e4d('0xf')+_0x567aed['id'],'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':'outbound','app':_0x4e4d('0x15'),'appdata':_0x4e4d('0x16')+(_0x4488f2+0x2)+'):Goto('+(_0x4488f2+0x1)+')','context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x4e4d('0x5'),'appdata':_0x567aed[_0x4e4d('0x14')]?_0x4e4d('0x17')+_0x567aed['cutdigits']+'}':_0x4e4d('0x18'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x4e4d('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x567aed['context'],'exten':_0x567aed['exten'],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':'outbound','app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x19'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x10'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x1a')+_0x567aed['id'],'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']}];if(_0x567aed[_0x4e4d('0x1b')]('recordingFormat')&&_0x567aed[_0x4e4d('0x1c')]!==_0x4e4d('0x1d')){_0x55e0f2[_0x4e4d('0xd')]({'type':'outbound','app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x1e'),'context':_0x567aed['context'],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']},{'type':_0x4e4d('0x11'),'app':'Set','appdata':_0x4e4d('0x1f')+_0x567aed['recordingFormat']||_0x4e4d('0x20'),'context':_0x567aed[_0x4e4d('0x7')],'exten':_0x567aed[_0x4e4d('0x8')],'priority':_0x4488f2++,'VoiceExtensionId':_0x567aed['id']});}return _0x55e0f2;}function _0x48c96d(_0x294bad,_0x229e73){var _0x3aa300=[{'name':'trunk','param':0x0},{'name':_0x4e4d('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x4e4d('0x22'),'param':0x3}];var _0x41d12a={};var _0x47ad00=_0x229e73[_0x4e4d('0x23')](',');var _0x2c59c3=[];for(var _0x17301b=0x0;_0x17301b<_0x3aa300[_0x4e4d('0x24')];_0x17301b++){switch(_0x3aa300[_0x17301b][_0x4e4d('0x25')]){case _0x4e4d('0x26'):_0x41d12a['trunk']=_0x47ad00[_0x3aa300[_0x17301b][_0x4e4d('0x27')]][_0x4e4d('0x23')]('/')[0x1];_0x41d12a['phone']=_0x47ad00[_0x3aa300[_0x17301b][_0x4e4d('0x27')]][_0x4e4d('0x23')]('/')[0x2];_0x41d12a[_0x4e4d('0x28')]=_0x41d12a[_0x4e4d('0x29')]?_0x41d12a['phone']['split']('$')[0x0]:undefined;_0x41d12a[_0x4e4d('0x29')]=_0x294bad[_0x4e4d('0x14')]?(_0x41d12a[_0x4e4d('0x28')]||'')+_0x4e4d('0x2a')+_0x294bad['cutdigits']+'}':(_0x41d12a['prefix']||'')+_0x4e4d('0x2b');_0x2c59c3[_0x3aa300[_0x17301b][_0x4e4d('0x27')]]=['SIP',_0x41d12a[_0x4e4d('0x26')],_0x41d12a[_0x4e4d('0x29')]][_0x4e4d('0x2c')]('/');break;case _0x4e4d('0x2d'):_0x41d12a[_0x4e4d('0x2d')]=_0x47ad00[_0x3aa300[_0x17301b]['param']];if(_0x294bad[_0x4e4d('0x1c')]!==_0x4e4d('0x1d')){if(_0x41d12a[_0x4e4d('0x2d')]['indexOf'](_0x4e4d('0x2e'))<0x0){_0x41d12a[_0x4e4d('0x2d')]+='U(xcally-mixmonitor-context)';}}else{_0x41d12a['options']=_0x41d12a[_0x4e4d('0x2d')][_0x4e4d('0x2f')](_0x4e4d('0x2e'),'');}_0x2c59c3[_0x3aa300[_0x17301b][_0x4e4d('0x27')]]=_0x41d12a[_0x4e4d('0x2d')];break;default:_0x2c59c3[_0x3aa300[_0x17301b][_0x4e4d('0x27')]]=_0x47ad00[_0x3aa300[_0x17301b][_0x4e4d('0x27')]];}}return _0x2c59c3[_0x4e4d('0x2c')](',');}function _0x134736(_0x33d0bc,_0x15bc2d,_0x48a74b){return new Promise(function(_0x138756,_0x260113){var _0xb08f4f=[];if(_[_0x4e4d('0x30')](_0x15bc2d))return _0x138756(_0xb08f4f);_0x47f8c5[_0x4e4d('0x31')][_0x4e4d('0x32')]({'attributes':['id',_0x4e4d('0x33'),'IntervalId'],'raw':!![]})[_0x4e4d('0x34')](function(_0x2353ab){for(var _0x45b4eb=0x0,_0x3677dd=0x0;_0x45b4eb<_0x15bc2d[_0x4e4d('0x24')];_0x45b4eb++,_0x3677dd=0x0){var _0x5180a7=_0x15bc2d[_0x45b4eb];var _0x36e56a=[];var _0x4a3e99=[];delete _0x5180a7['id'];if(_0x5180a7[_0x4e4d('0x33')]!==_0x4e4d('0x35')){_0x5180a7[_0x4e4d('0x36')]=[_0x5180a7['interval']];}else{_0x5180a7['intervals']=_0x5180a7[_0x4e4d('0x37')]?_[_0x4e4d('0x38')](_[_0x4e4d('0x39')](_0x2353ab,{'IntervalId':_0x5180a7[_0x4e4d('0x37')]}),_0x4e4d('0x33')):[];}_0x5180a7[_0x4e4d('0x7')]=_0x33d0bc[_0x4e4d('0x7')];_0x5180a7['exten']=_0x33d0bc[_0x4e4d('0x8')];if(_0x5180a7['type'])_0x5180a7['type']=_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')]();if(_0x33d0bc[_0x4e4d('0x4')]===_0x4e4d('0x11')){if(_0x5180a7[_0x4e4d('0x1b')](_0x4e4d('0x3b'))&&_0x5180a7[_0x4e4d('0x3b')]&&_0x5180a7['tag']!=='--'){_0x36e56a[_0x4e4d('0xd')]({'type':_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')](),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x3c')+_0x5180a7[_0x4e4d('0x3b')],'context':_0x33d0bc[_0x4e4d('0x7')],'exten':_0x33d0bc[_0x4e4d('0x8')],'priority':_0x5180a7[_0x4e4d('0x36')]['length']+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});}_0x36e56a[_0x4e4d('0xd')]({'type':_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')](),'app':_0x4e4d('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x5180a7[_0x4e4d('0x3d')]?'Set(CALLERID(all)='+_0x5180a7['callerID']+')':_0x4e4d('0x3e')),'context':_0x33d0bc[_0x4e4d('0x7')],'exten':_0x33d0bc[_0x4e4d('0x8')],'priority':_0x5180a7['intervals'][_0x4e4d('0x24')]+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});}else{if(_0x5180a7[_0x4e4d('0x1b')]('answer')){if([_0x4e4d('0x3f'),_0x4e4d('0x40')]['includes'](_0x5180a7[_0x4e4d('0x41')][_0x4e4d('0x3a')]())&&_0x5180a7[_0x4e4d('0x42')]!==_0x4e4d('0x43')){if(_0x5180a7['answer']){_0x36e56a['push']({'type':_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')](),'app':_0x4e4d('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x33d0bc[_0x4e4d('0x7')],'exten':_0x33d0bc['exten'],'priority':_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')]+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});_0x36e56a[_0x4e4d('0xd')]({'type':_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')](),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x44'),'context':_0x33d0bc[_0x4e4d('0x7')],'exten':_0x33d0bc[_0x4e4d('0x8')],'priority':_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')]+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});}else{_0x36e56a['push']({'type':_0x5180a7['type'][_0x4e4d('0x3a')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x33d0bc['context'],'exten':_0x33d0bc['exten'],'priority':_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')]+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});_0x36e56a[_0x4e4d('0xd')]({'type':_0x5180a7[_0x4e4d('0x4')][_0x4e4d('0x3a')](),'app':_0x4e4d('0x5'),'appdata':_0x4e4d('0x45'),'context':_0x33d0bc[_0x4e4d('0x7')],'exten':_0x33d0bc[_0x4e4d('0x8')],'priority':_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')]+_0x48a74b+_0x3677dd++,'VoiceExtensionId':_0x33d0bc['id']});}}}}for(var _0x462146=0x0;_0x462146<_0x5180a7[_0x4e4d('0x36')]['length'];_0x462146++){var _0x4e4174=_0x48a74b+_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')];var _0x33370e=_0x462146===_0x5180a7[_0x4e4d('0x36')][_0x4e4d('0x24')]-0x1?_0x48a74b+_0x36e56a['length']+_0x4a3e99[_0x4e4d('0x24')]+0x2:_0x48a74b+_0x462146+0x1;_0x36e56a[_0x4e4d('0x46')](_0x462146,0x0,{'type':_0x33d0bc[_0x4e4d('0x4')],'app':_0x4e4d('0x47'),'appdata':_0x5180a7[_0x4e4d('0x36')][_0x462146]+'?'+_0x33d0bc[_0x4e4d('0x7')]+_0x4e4d('0x48')+_0x4e4174+':'+_0x33d0bc[_0x4e4d('0x7')]+_0x4e4d('0x48')+_0x33370e,'exten':_0x33d0bc[_0x4e4d('0x8')],'context':_0x33d0bc[_0x4e4d('0x7')],'priority':_0x48a74b+_0x462146,'VoiceExtensionId':_0x33d0bc['id']});}if(_0x5180a7[_0x4e4d('0x42')]===_0x4e4d('0x49'))_0x5180a7[_0x4e4d('0x4a')]=_0x48c96d(_0x33d0bc,_0x5180a7[_0x4e4d('0x4a')]);_0x5180a7[_0x4e4d('0x4b')]=_0x36e56a[_0x4e4d('0x24')]?_[_0x4e4d('0x4c')](_0x36e56a)['priority']+0x1:_0x48a74b;_0xb08f4f=_[_0x4e4d('0x4d')](_0xb08f4f,_0x36e56a,[_0x5180a7],_0x4a3e99);_0x48a74b=_[_0x4e4d('0x4c')](_0xb08f4f)[_0x4e4d('0x4b')]+0x1;}return _0x138756(_0xb08f4f);})['catch'](function(_0x5837d9){_0x260113(_0x5837d9);});});}return _0x1a402a[_0x4e4d('0x4e')](_0x4e4d('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x186303){var _0x53571d=this['get']({'plain':!![]});var _0xec79e0=_0x53571d[_0x4e4d('0x4')]===_0x4e4d('0x11')?_0x4412a9(_0x53571d):_0x3a4139(_0x53571d);return _0x134736(_0x53571d,_0x186303,_[_0x4e4d('0x4c')](_0xec79e0)[_0x4e4d('0x4b')]+0x1)[_0x4e4d('0x34')](function(_0x46fabd){var _0x47e71c=_[_0x4e4d('0x4d')](_0xec79e0,_0x46fabd);_0x47e71c[_0x4e4d('0xd')]({'type':_0x53571d[_0x4e4d('0x4')],'app':_0x4e4d('0x50'),'exten':_0x53571d[_0x4e4d('0x8')],'context':_0x53571d[_0x4e4d('0x7')],'priority':_['last'](_0x47e71c)[_0x4e4d('0x4b')]+0x1,'VoiceExtensionId':_0x53571d['id']});return _0x47e71c;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b5f984a..2aab6ae 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 _0x4312=['defaults','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceExtension','findAll','options','where','limit','map','include','model','attributes','GetVoiceExtension','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x4312,0xaf));var _0x2431=function(_0x3c7f77,_0x50b2a2){_0x3c7f77=_0x3c7f77-0x0;var _0x7f4d0=_0x4312[_0x3c7f77];return _0x7f4d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2431('0x0'));var BPromise=require(_0x2431('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2431('0x2'));var db=require(_0x2431('0x3'))['db'];var utils=require(_0x2431('0x4'));var logger=require(_0x2431('0x5'))(_0x2431('0x6'));var config=require(_0x2431('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2431('0x8')]['http']({'port':0x232a});config[_0x2431('0x9')]=_[_0x2431('0xa')](config['redis'],{'host':_0x2431('0xb'),'port':0x18eb});var socket=require(_0x2431('0xc'))(new Redis(config[_0x2431('0x9')]));require('./voiceExtension.socket')[_0x2431('0xd')](socket);function respondWithRpcPromise(_0x26b223,_0xb751e,_0x568a96){return new BPromise(function(_0x12615b,_0x4a71f2){return client[_0x2431('0xe')](_0x26b223,_0x568a96)[_0x2431('0xf')](function(_0x384711){logger['info'](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));logger[_0x2431('0x12')](_0x2431('0x13'),_0xb751e,'request\x20sent',JSON[_0x2431('0x14')](_0x384711));if(_0x384711[_0x2431('0x15')]){if(_0x384711[_0x2431('0x15')][_0x2431('0x16')]===0x1f4){logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x4a71f2(_0x384711[_0x2431('0x15')]['message']);}logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x12615b(_0x384711[_0x2431('0x15')][_0x2431('0x17')]);}else{logger[_0x2431('0x18')](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));_0x12615b(_0x384711[_0x2431('0x19')][_0x2431('0x17')]);}})[_0x2431('0x1a')](function(_0x3b1776){logger[_0x2431('0x15')]('VoiceExtension,\x20%s,\x20%s',_0xb751e,_0x3b1776);_0x4a71f2(_0x3b1776);});});}exports['GetVoiceExtension']=function(_0x3b4fa0){var _0x41b5df=this;return new Promise(function(_0x2e6b2b,_0x51d1ef){return db[_0x2431('0x1b')][_0x2431('0x1c')]({'raw':_0x3b4fa0['options']?_0x3b4fa0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b4fa0['options']?_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x1e')]||null:null,'attributes':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0[_0x2431('0x1d')]['attributes']||null:null,'limit':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0['options'][_0x2431('0x1f')]||null:null,'include':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0[_0x2431('0x1d')]['include']?_[_0x2431('0x20')](_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x21')],function(_0x55914b){return{'model':db[_0x55914b['model']],'as':_0x55914b['as'],'attributes':_0x55914b['attributes'],'include':_0x55914b[_0x2431('0x21')]?_['map'](_0x55914b[_0x2431('0x21')],function(_0xf7afb5){return{'model':db[_0xf7afb5[_0x2431('0x22')]],'as':_0xf7afb5['as'],'attributes':_0xf7afb5[_0x2431('0x23')],'include':_0xf7afb5['include']?_['map'](_0xf7afb5[_0x2431('0x21')],function(_0x3954cc){return{'model':db[_0x3954cc['model']],'as':_0x3954cc['as'],'attributes':_0x3954cc[_0x2431('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2431('0xf')](function(_0x5842fb){logger[_0x2431('0x18')](_0x2431('0x24'),_0x3b4fa0);logger['debug'](_0x2431('0x24'),_0x3b4fa0,JSON[_0x2431('0x14')](_0x5842fb));_0x2e6b2b(_0x5842fb);})[_0x2431('0x1a')](function(_0x141478){logger[_0x2431('0x15')](_0x2431('0x24'),_0x141478[_0x2431('0x17')],_0x3b4fa0);_0x51d1ef(_0x41b5df[_0x2431('0x15')](0x1f4,_0x141478[_0x2431('0x17')]));});});}; \ No newline at end of file +var _0xe647=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','debug','lodash','util','bluebird','randomstring','ioredis'];(function(_0x7ef1bb,_0x45a8c0){var _0x3b12e7=function(_0x413a6a){while(--_0x413a6a){_0x7ef1bb['push'](_0x7ef1bb['shift']());}};_0x3b12e7(++_0x45a8c0);}(_0xe647,0x16d));var _0x7e64=function(_0x4907aa,_0x351bc8){_0x4907aa=_0x4907aa-0x0;var _0x1dd355=_0xe647[_0x4907aa];return _0x1dd355;};'use strict';var _=require(_0x7e64('0x0'));var util=require(_0x7e64('0x1'));var moment=require('moment');var BPromise=require(_0x7e64('0x2'));var rs=require(_0x7e64('0x3'));var fs=require('fs');var Redis=require(_0x7e64('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e64('0x5'))(_0x7e64('0x6'));var config=require(_0x7e64('0x7'));var jayson=require(_0x7e64('0x8'));var client=jayson[_0x7e64('0x9')]['http']({'port':0x232a});config[_0x7e64('0xa')]=_[_0x7e64('0xb')](config[_0x7e64('0xa')],{'host':_0x7e64('0xc'),'port':0x18eb});var socket=require(_0x7e64('0xd'))(new Redis(config[_0x7e64('0xa')]));require(_0x7e64('0xe'))[_0x7e64('0xf')](socket);function respondWithRpcPromise(_0x41866f,_0x414041,_0x55b588){return new BPromise(function(_0x56d2d4,_0x4ff322){return client[_0x7e64('0x10')](_0x41866f,_0x55b588)[_0x7e64('0x11')](function(_0x3457d7){logger['info'](_0x7e64('0x12'),_0x414041,_0x7e64('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x414041,_0x7e64('0x13'),JSON[_0x7e64('0x14')](_0x3457d7));if(_0x3457d7[_0x7e64('0x15')]){if(_0x3457d7[_0x7e64('0x15')]['code']===0x1f4){logger[_0x7e64('0x15')](_0x7e64('0x12'),_0x414041,_0x3457d7[_0x7e64('0x15')][_0x7e64('0x16')]);return _0x4ff322(_0x3457d7[_0x7e64('0x15')][_0x7e64('0x16')]);}logger[_0x7e64('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x414041,_0x3457d7[_0x7e64('0x15')]['message']);return _0x56d2d4(_0x3457d7[_0x7e64('0x15')][_0x7e64('0x16')]);}else{logger[_0x7e64('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x414041,'request\x20sent');_0x56d2d4(_0x3457d7[_0x7e64('0x18')][_0x7e64('0x16')]);}})[_0x7e64('0x19')](function(_0x24a7f0){logger['error'](_0x7e64('0x12'),_0x414041,_0x24a7f0);_0x4ff322(_0x24a7f0);});});}exports['GetVoiceExtension']=function(_0xc4bbc2){var _0x3ab6e4=this;return new Promise(function(_0x3cd37a,_0x4618cd){return db[_0x7e64('0x1a')][_0x7e64('0x1b')]({'raw':_0xc4bbc2[_0x7e64('0x1c')]?_0xc4bbc2['options']['raw']===undefined?!![]:![]:!![],'where':_0xc4bbc2[_0x7e64('0x1c')]?_0xc4bbc2[_0x7e64('0x1c')][_0x7e64('0x1d')]||null:null,'attributes':_0xc4bbc2['options']?_0xc4bbc2[_0x7e64('0x1c')][_0x7e64('0x1e')]||null:null,'limit':_0xc4bbc2['options']?_0xc4bbc2['options'][_0x7e64('0x1f')]||null:null,'include':_0xc4bbc2['options']?_0xc4bbc2['options'][_0x7e64('0x20')]?_[_0x7e64('0x21')](_0xc4bbc2['options'][_0x7e64('0x20')],function(_0xabf947){return{'model':db[_0xabf947[_0x7e64('0x22')]],'as':_0xabf947['as'],'attributes':_0xabf947[_0x7e64('0x1e')],'include':_0xabf947[_0x7e64('0x20')]?_[_0x7e64('0x21')](_0xabf947[_0x7e64('0x20')],function(_0x5324e0){return{'model':db[_0x5324e0[_0x7e64('0x22')]],'as':_0x5324e0['as'],'attributes':_0x5324e0['attributes'],'include':_0x5324e0['include']?_[_0x7e64('0x21')](_0x5324e0[_0x7e64('0x20')],function(_0x44ec65){return{'model':db[_0x44ec65['model']],'as':_0x44ec65['as'],'attributes':_0x44ec65['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e64('0x11')](function(_0x1d0153){logger[_0x7e64('0x17')](_0x7e64('0x23'),_0xc4bbc2);logger[_0x7e64('0x24')](_0x7e64('0x23'),_0xc4bbc2,JSON[_0x7e64('0x14')](_0x1d0153));_0x3cd37a(_0x1d0153);})[_0x7e64('0x19')](function(_0x1521b7){logger['error']('GetVoiceExtension',_0x1521b7[_0x7e64('0x16')],_0xc4bbc2);_0x4618cd(_0x3ab6e4[_0x7e64('0x15')](0x1f4,_0x1521b7[_0x7e64('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 56d5836..fe4df7c 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x1e81ff,_0x17ee68){var _0x4a7c91=function(_0x47001d){while(--_0x47001d){_0x1e81ff['push'](_0x1e81ff['shift']());}};_0x4a7c91(++_0x17ee68);}(_0x4975,0x86));var _0x5497=function(_0x364266,_0x34da55){_0x364266=_0x364266-0x0;var _0x195ace=_0x4975[_0x364266];return _0x195ace;};'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 +var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x159461,_0x47d0ff){var _0x36a27d=function(_0x5abca5){while(--_0x5abca5){_0x159461['push'](_0x159461['shift']());}};_0x36a27d(++_0x47d0ff);}(_0x5fab,0x177));var _0xb5fa=function(_0x538406,_0x25c40b){_0x538406=_0x538406-0x0;var _0x18f8fd=_0x5fab[_0x538406];return _0x18f8fd;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 19613e1..80bf83a 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 _0xe3da=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy'];(function(_0x46b389,_0x1fc6af){var _0x3a7f6b=function(_0x110240){while(--_0x110240){_0x46b389['push'](_0x46b389['shift']());}};_0x3a7f6b(++_0x1fc6af);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0x11')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0x13')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0x14')]);router['delete'](_0xae3d('0xe'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);module[_0xae3d('0x16')]=router; \ No newline at end of file +var _0x3e24=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','create','destroy','exports','multer'];(function(_0x243481,_0x33ba56){var _0x3c7a5c=function(_0x4b07c1){while(--_0x4b07c1){_0x243481['push'](_0x243481['shift']());}};_0x3c7a5c(++_0x33ba56);}(_0x3e24,0x167));var _0x43e2=function(_0x3645cc,_0x25ba47){_0x3645cc=_0x3645cc-0x0;var _0x351979=_0x3e24[_0x3645cc];return _0x351979;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var fs_extra=require(_0x43e2('0x5'));var auth=require(_0x43e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43e2('0x7'));var controller=require(_0x43e2('0x8'));router[_0x43e2('0x9')]('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xb')]);router[_0x43e2('0x9')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x9')]('/:id/messages',auth[_0x43e2('0xa')](),controller[_0x43e2('0xe')]);router['post']('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xf')]);router['put'](_0x43e2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43e2('0xc'),auth[_0x43e2('0xa')](),controller[_0x43e2('0x10')]);module[_0x43e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 72673c5..e21748a 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 _0x0bb4=['yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x0bb4,0xdf));var _0x40bb=function(_0x2ddf90,_0x66e2b4){_0x2ddf90=_0x2ddf90-0x0;var _0x263d16=_0x0bb4[_0x2ddf90];return _0x263d16;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'customer_id':{'type':Sequelize[_0x40bb('0x2')]},'context':{'type':Sequelize[_0x40bb('0x2')],'defaultValue':_0x40bb('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x40bb('0x2')],'defaultValue':'','allowNull':![],'unique':_0x40bb('0x4')},'password':{'type':Sequelize[_0x40bb('0x2')]},'fullname':{'type':Sequelize[_0x40bb('0x2')]},'email':{'type':Sequelize[_0x40bb('0x2')],'validate':{'isEmail':!![]},'set':function(_0x43fc57){this[_0x40bb('0x5')](_0x40bb('0x6'),typeof _0x43fc57===_0x40bb('0x7')&&_0x43fc57[_0x40bb('0x8')]()?_0x43fc57[_0x40bb('0x8')]():null);}},'pager':{'type':Sequelize[_0x40bb('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x40bb('0x9')},'attach':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':_0x40bb('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':_0x40bb('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x40bb('0x2')]},'callback':{'type':Sequelize[_0x40bb('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x40bb('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x40bb('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x40bb('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x40bb('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x40bb('0xa')]('yes','no'),'defaultValue':_0x40bb('0xb'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x40bb('0xa')](_0x40bb('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x40bb('0xd')},'emailsubject':{'type':Sequelize[_0x40bb('0x2')]},'emailbody':{'type':Sequelize[_0x40bb('0x2')]},'maxsecs':{'type':Sequelize[_0x40bb('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x40bb('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x40bb('0xf')]('fullname')+_0x40bb('0x10')+this['getDataValue'](_0x40bb('0x11'));}}}; \ No newline at end of file +var _0xf28f=['string','trim','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xf28f,0xe9));var _0xff28=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xf28f[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0xff28('0x0'));module[_0xff28('0x1')]={'customer_id':{'type':Sequelize[_0xff28('0x2')]},'context':{'type':Sequelize[_0xff28('0x2')],'defaultValue':_0xff28('0x3'),'unique':_0xff28('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xff28('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xff28('0x2')]},'email':{'type':Sequelize[_0xff28('0x2')],'validate':{'isEmail':!![]},'set':function(_0xa3ca4a){this[_0xff28('0x5')](_0xff28('0x6'),typeof _0xa3ca4a===_0xff28('0x7')&&_0xa3ca4a[_0xff28('0x8')]()?_0xa3ca4a['trim']():null);}},'pager':{'type':Sequelize[_0xff28('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xff28('0x9')]('yes','no'),'defaultValue':_0xff28('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xff28('0x2')]},'callback':{'type':Sequelize[_0xff28('0x2')]},'review':{'type':Sequelize['ENUM'](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xff28('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':_0xff28('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xff28('0x9')](_0xff28('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xff28('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xff28('0x2')]},'emailbody':{'type':Sequelize[_0xff28('0x2')]},'maxsecs':{'type':Sequelize[_0xff28('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xff28('0xd')],'get':function(){return this[_0xff28('0xe')]('fullname')+_0xff28('0xf')+this[_0xff28('0xe')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 34ceafe..8b5a722 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 _0x13f6=['destroy','Voicemails','error','send','index','map','VoiceMail','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','UserProfileSection','userProfileId','UserProfileResource','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','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'];(function(_0x523507,_0x50f5b6){var _0x5eb36a=function(_0x1adfef){while(--_0x1adfef){_0x523507['push'](_0x523507['shift']());}};_0x5eb36a(++_0x50f5b6);}(_0x13f6,0x124));var _0x613f=function(_0x553ef6,_0x4db5e4){_0x553ef6=_0x553ef6-0x0;var _0x3d0e71=_0x13f6[_0x553ef6];return _0x3d0e71;};'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(){var _0x3013a1=_0x33e0c6['get']({'plain':!![]});var _0x30fb15=_0x613f('0x25');return db['UserProfileResource'][_0x613f('0x24')]({'where':{'type':_0x30fb15,'resourceId':_0x3013a1['id']}})[_0x613f('0x23')](function(){return _0x33e0c6;});})[_0x613f('0x23')](function(){_0x51f376['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4a8b,_0x379920){return function(_0x594c28){if(!_0x594c28){_0x5a4a8b[_0x613f('0x16')](0x194);}return _0x594c28;};}function handleError(_0x1767db,_0x4ca372){_0x4ca372=_0x4ca372||0x1f4;return function(_0x121241){logger[_0x613f('0x26')](_0x121241['stack']);if(_0x121241['name']){delete _0x121241['name'];}_0x1767db[_0x613f('0x17')](_0x4ca372)[_0x613f('0x27')](_0x121241);};}exports[_0x613f('0x28')]=function(_0x47f4af,_0x23eda8){var _0x439478={},_0xd335a6={},_0x19bb8f={'count':0x0,'rows':[]};var _0x4f8500=_[_0x613f('0x29')](db[_0x613f('0x2a')][_0x613f('0x2b')],function(_0x728f45){return{'name':_0x728f45[_0x613f('0x2c')],'type':_0x728f45[_0x613f('0x2d')]['key']};});_0xd335a6[_0x613f('0x2e')]=_[_0x613f('0x29')](_0x4f8500,_0x613f('0x2f'));_0xd335a6['query']=_[_0x613f('0x30')](_0x47f4af['query']);_0xd335a6[_0x613f('0x31')]=_[_0x613f('0x32')](_0xd335a6[_0x613f('0x2e')],_0xd335a6[_0x613f('0x33')]);_0x439478[_0x613f('0x34')]=_[_0x613f('0x32')](_0xd335a6['model'],qs[_0x613f('0x35')](_0x47f4af[_0x613f('0x33')][_0x613f('0x35')]));_0x439478[_0x613f('0x34')]=_0x439478[_0x613f('0x34')]['length']?_0x439478['attributes']:_0xd335a6['model'];if(!_0x47f4af[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x439478[_0x613f('0x1a')]=qs['limit'](_0x47f4af[_0x613f('0x33')][_0x613f('0x1a')]);_0x439478['offset']=qs[_0x613f('0x1d')](_0x47f4af['query'][_0x613f('0x1d')]);}_0x439478['order']=qs[_0x613f('0x38')](_0x47f4af['query'][_0x613f('0x38')]);_0x439478[_0x613f('0x39')]=qs[_0x613f('0x31')](_['pick'](_0x47f4af[_0x613f('0x33')],_0xd335a6[_0x613f('0x31')]),_0x4f8500);if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]){_0x439478[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x439478[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x4f8500,function(_0x1f71f3){if(_0x1f71f3[_0x613f('0x2d')]!=='VIRTUAL'){var _0x28b1bc={};_0x28b1bc[_0x1f71f3[_0x613f('0x2f')]]={'$like':'%'+_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x28b1bc;}})});}_0x439478=_[_0x613f('0x3b')]({},_0x439478,_0x47f4af[_0x613f('0x3c')]);var _0xa76fff={'where':_0x439478['where']};return db[_0x613f('0x2a')][_0x613f('0x1c')](_0xa76fff)[_0x613f('0x23')](function(_0x3d2d7b){_0x19bb8f[_0x613f('0x1c')]=_0x3d2d7b;if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3d')]){_0x439478['include']=[{'all':!![]}];}return db[_0x613f('0x2a')][_0x613f('0x3e')](_0x439478);})[_0x613f('0x23')](function(_0x2f584e){_0x19bb8f[_0x613f('0x3f')]=_0x2f584e;return _0x19bb8f;})[_0x613f('0x23')](respondWithFilteredResult(_0x23eda8,_0x439478))[_0x613f('0x40')](handleError(_0x23eda8,null));};exports[_0x613f('0x41')]=function(_0x403feb,_0x2d2574){var _0x12647a={'raw':!![],'where':{'id':_0x403feb[_0x613f('0x42')]['id']}},_0x258a71={};_0x258a71['model']=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x258a71[_0x613f('0x33')]=_['keys'](_0x403feb[_0x613f('0x33')]);_0x258a71[_0x613f('0x31')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],_0x258a71[_0x613f('0x33')]);_0x12647a[_0x613f('0x34')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x403feb[_0x613f('0x33')]['fields']));_0x12647a['attributes']=_0x12647a[_0x613f('0x34')][_0x613f('0x43')]?_0x12647a['attributes']:_0x258a71[_0x613f('0x2e')];if(_0x403feb[_0x613f('0x33')][_0x613f('0x3d')]){_0x12647a[_0x613f('0x44')]=[{'all':!![]}];}_0x12647a=_[_0x613f('0x3b')]({},_0x12647a,_0x403feb[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x12647a)[_0x613f('0x23')](handleEntityNotFound(_0x2d2574,null))[_0x613f('0x23')](respondWithResult(_0x2d2574,null))[_0x613f('0x40')](handleError(_0x2d2574,null));};exports[_0x613f('0x46')]=function(_0x174e22,_0x17f8e5){return db[_0x613f('0x2a')][_0x613f('0x46')](_0x174e22[_0x613f('0x47')],{})[_0x613f('0x23')](function(_0x5a4079){var _0x47c84b=_0x174e22[_0x613f('0x48')][_0x613f('0x49')]({'plain':!![]});if(!_0x47c84b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c84b['role']===_0x613f('0x48')){var _0x51729a=_0x5a4079['get']({'plain':!![]});var _0x6e006b=_0x613f('0x25');return db[_0x613f('0x4a')]['find']({'where':{'name':_0x6e006b,'userProfileId':_0x47c84b[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x4f59b6){if(_0x4f59b6&&_0x4f59b6['autoAssociation']===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x51729a[_0x613f('0x2f')],'resourceId':_0x51729a['id'],'type':_0x4f59b6[_0x613f('0x2f')],'sectionId':_0x4f59b6['id']},{})[_0x613f('0x23')](function(){return _0x5a4079;});}else{return _0x5a4079;}})[_0x613f('0x40')](function(_0x24d162){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d162);throw _0x24d162;});}return _0x5a4079;})[_0x613f('0x23')](respondWithResult(_0x17f8e5,0xc9))['catch'](handleError(_0x17f8e5,null));};exports['update']=function(_0x387913,_0x52c2a6){if(_0x387913[_0x613f('0x47')]['id']){delete _0x387913['body']['id'];}return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x387913[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x52c2a6,null))[_0x613f('0x23')](saveUpdates(_0x387913[_0x613f('0x47')],null))[_0x613f('0x23')](respondWithResult(_0x52c2a6,null))['catch'](handleError(_0x52c2a6,null));};exports[_0x613f('0x24')]=function(_0x4ff3ad,_0x3ce3dd){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x4ff3ad[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x3ce3dd,null))[_0x613f('0x23')](removeEntity(_0x3ce3dd,null))[_0x613f('0x40')](handleError(_0x3ce3dd,null));};exports[_0x613f('0x4d')]=function(_0x214d01,_0x49637d,_0x2ebce1){return db[_0x613f('0x2a')][_0x613f('0x4e')]({'where':{'id':_0x214d01['params']['id']}})['then'](handleEntityNotFound(_0x49637d,null))[_0x613f('0x23')](function(_0x4b6eb3){var _0xcb1c9d;var _0x3c3cd7={},_0x42a72b={};_0x42a72b[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x4f')][_0x613f('0x2b')]);_0x42a72b[_0x613f('0x33')]=_[_0x613f('0x30')](_0x214d01[_0x613f('0x33')]);_0x42a72b[_0x613f('0x31')]=_['intersection'](_0x42a72b[_0x613f('0x2e')],_0x42a72b[_0x613f('0x33')]);_0x3c3cd7[_0x613f('0x34')]=_[_0x613f('0x32')](_0x42a72b['model'],qs[_0x613f('0x35')](_0x214d01[_0x613f('0x33')]['fields']));_0x3c3cd7['attributes']=_0x3c3cd7[_0x613f('0x34')]['length']?_0x3c3cd7['attributes']:_0x42a72b['model'];if(!_0x214d01[_0x613f('0x33')]['hasOwnProperty']('nolimit')){_0x3c3cd7['limit']=qs[_0x613f('0x1a')](_0x214d01[_0x613f('0x33')]['limit']);_0x3c3cd7[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x214d01[_0x613f('0x33')][_0x613f('0x1d')]);}_0x3c3cd7['order']=qs[_0x613f('0x38')](_0x214d01[_0x613f('0x33')]['sort']);_0x3c3cd7[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x50')](_0x214d01[_0x613f('0x33')],_0x42a72b[_0x613f('0x31')]));if(_0x214d01[_0x613f('0x33')][_0x613f('0x3a')]){_0x3c3cd7[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x3c3cd7[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x3c3cd7[_0x613f('0x34')],function(_0x50d7ca){var _0x1c4e48={};_0x1c4e48[_0x50d7ca]={'$like':'%'+_0x214d01[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x1c4e48;})});}_0x3c3cd7[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x3c3cd7[_0x613f('0x39')],{'mailboxuser':_0x4b6eb3['mailbox']});_0x3c3cd7=_[_0x613f('0x3b')]({},_0x3c3cd7,_0x214d01[_0x613f('0x3c')]);return db[_0x613f('0x4f')][_0x613f('0x51')](_0x3c3cd7)[_0x613f('0x23')](respondWithFilteredResult(_0x49637d,_0x3c3cd7));})[_0x613f('0x40')](handleError(_0x49637d,null));}; \ No newline at end of file +var _0x97c1=['error','stack','name','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getMessages','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','sendStatus'];(function(_0x480a80,_0x133666){var _0x194da5=function(_0x192007){while(--_0x192007){_0x480a80['push'](_0x480a80['shift']());}};_0x194da5(++_0x133666);}(_0x97c1,0xdf));var _0x197c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){var _0x5f4a02=_0x2a1310[_0x197c('0x26')]({'plain':!![]});var _0x2911dd=_0x197c('0x27');return db['UserProfileResource'][_0x197c('0x25')]({'where':{'type':_0x2911dd,'resourceId':_0x5f4a02['id']}})[_0x197c('0x24')](function(){return _0x2a1310;});})['then'](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x48f759,_0xfbca7a){return function(_0x14b0aa){if(!_0x14b0aa){_0x48f759[_0x197c('0x28')](0x194);}return _0x14b0aa;};}function handleError(_0x16e026,_0x2f031c){_0x2f031c=_0x2f031c||0x1f4;return function(_0x3cdcd8){logger[_0x197c('0x29')](_0x3cdcd8[_0x197c('0x2a')]);if(_0x3cdcd8[_0x197c('0x2b')]){delete _0x3cdcd8['name'];}_0x16e026['status'](_0x2f031c)['send'](_0x3cdcd8);};}exports['index']=function(_0x5f7425,_0x4c9256){var _0x252cde={},_0x35dbf3={},_0x58bc60={'count':0x0,'rows':[]};var _0x422ac6=_['map'](db[_0x197c('0x2c')][_0x197c('0x2d')],function(_0x2ace33){return{'name':_0x2ace33[_0x197c('0x2e')],'type':_0x2ace33[_0x197c('0x2f')][_0x197c('0x30')]};});_0x35dbf3[_0x197c('0x31')]=_[_0x197c('0x32')](_0x422ac6,_0x197c('0x2b'));_0x35dbf3['query']=_['keys'](_0x5f7425[_0x197c('0x33')]);_0x35dbf3[_0x197c('0x34')]=_[_0x197c('0x35')](_0x35dbf3[_0x197c('0x31')],_0x35dbf3[_0x197c('0x33')]);_0x252cde[_0x197c('0x36')]=_[_0x197c('0x35')](_0x35dbf3['model'],qs['fields'](_0x5f7425[_0x197c('0x33')][_0x197c('0x37')]));_0x252cde['attributes']=_0x252cde['attributes'][_0x197c('0x38')]?_0x252cde[_0x197c('0x36')]:_0x35dbf3[_0x197c('0x31')];if(!_0x5f7425[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x252cde[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x5f7425[_0x197c('0x33')]['limit']);_0x252cde[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x5f7425[_0x197c('0x33')][_0x197c('0x19')]);}_0x252cde[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x5f7425['query'][_0x197c('0x3c')]);_0x252cde[_0x197c('0x3d')]=qs[_0x197c('0x34')](_['pick'](_0x5f7425[_0x197c('0x33')],_0x35dbf3[_0x197c('0x34')]),_0x422ac6);if(_0x5f7425[_0x197c('0x33')][_0x197c('0x3e')]){_0x252cde[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x252cde[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x422ac6,function(_0x323a14){if(_0x323a14[_0x197c('0x2f')]!=='VIRTUAL'){var _0x2705f5={};_0x2705f5[_0x323a14[_0x197c('0x2b')]]={'$like':'%'+_0x5f7425['query']['filter']+'%'};return _0x2705f5;}})});}_0x252cde=_[_0x197c('0x3f')]({},_0x252cde,_0x5f7425[_0x197c('0x40')]);var _0x3517a6={'where':_0x252cde[_0x197c('0x3d')]};return db[_0x197c('0x2c')]['count'](_0x3517a6)[_0x197c('0x24')](function(_0x3efae){_0x58bc60[_0x197c('0x1c')]=_0x3efae;if(_0x5f7425[_0x197c('0x33')][_0x197c('0x41')]){_0x252cde['include']=[{'all':!![]}];}return db[_0x197c('0x2c')][_0x197c('0x42')](_0x252cde);})[_0x197c('0x24')](function(_0x197b27){_0x58bc60[_0x197c('0x43')]=_0x197b27;return _0x58bc60;})['then'](respondWithFilteredResult(_0x4c9256,_0x252cde))[_0x197c('0x44')](handleError(_0x4c9256,null));};exports[_0x197c('0x45')]=function(_0x3b7fc1,_0x35f36d){var _0x3e6d6e={'raw':!![],'where':{'id':_0x3b7fc1[_0x197c('0x46')]['id']}},_0x41eb51={};_0x41eb51[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')][_0x197c('0x2d')]);_0x41eb51['query']=_['keys'](_0x3b7fc1['query']);_0x41eb51['filters']=_[_0x197c('0x35')](_0x41eb51[_0x197c('0x31')],_0x41eb51['query']);_0x3e6d6e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x41eb51['model'],qs[_0x197c('0x37')](_0x3b7fc1[_0x197c('0x33')]['fields']));_0x3e6d6e[_0x197c('0x36')]=_0x3e6d6e[_0x197c('0x36')]['length']?_0x3e6d6e[_0x197c('0x36')]:_0x41eb51[_0x197c('0x31')];if(_0x3b7fc1[_0x197c('0x33')]['includeAll']){_0x3e6d6e[_0x197c('0x48')]=[{'all':!![]}];}_0x3e6d6e=_[_0x197c('0x3f')]({},_0x3e6d6e,_0x3b7fc1[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x3e6d6e)[_0x197c('0x24')](handleEntityNotFound(_0x35f36d,null))[_0x197c('0x24')](respondWithResult(_0x35f36d,null))[_0x197c('0x44')](handleError(_0x35f36d,null));};exports['create']=function(_0x5994bf,_0x3a5089){return db[_0x197c('0x2c')][_0x197c('0x49')](_0x5994bf[_0x197c('0x4a')],{})[_0x197c('0x24')](function(_0x28fac4){var _0x4c82d5=_0x5994bf[_0x197c('0x4b')]['get']({'plain':!![]});if(!_0x4c82d5)throw new Error(_0x197c('0x4c'));if(_0x4c82d5[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x9e8c6a=_0x28fac4[_0x197c('0x26')]({'plain':!![]});var _0x2ab21f=_0x197c('0x27');return db[_0x197c('0x4e')]['find']({'where':{'name':_0x2ab21f,'userProfileId':_0x4c82d5[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x43e9b7){if(_0x43e9b7&&_0x43e9b7['autoAssociation']===0x0){return db[_0x197c('0x50')]['create']({'name':_0x9e8c6a[_0x197c('0x2b')],'resourceId':_0x9e8c6a['id'],'type':_0x43e9b7[_0x197c('0x2b')],'sectionId':_0x43e9b7['id']},{})[_0x197c('0x24')](function(){return _0x28fac4;});}else{return _0x28fac4;}})[_0x197c('0x44')](function(_0x1d7cdd){logger[_0x197c('0x29')](_0x197c('0x51'),_0x1d7cdd);throw _0x1d7cdd;});}return _0x28fac4;})[_0x197c('0x24')](respondWithResult(_0x3a5089,0xc9))['catch'](handleError(_0x3a5089,null));};exports[_0x197c('0x23')]=function(_0x3a9261,_0x275294){if(_0x3a9261['body']['id']){delete _0x3a9261[_0x197c('0x4a')]['id'];}return db[_0x197c('0x2c')][_0x197c('0x52')]({'where':{'id':_0x3a9261[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x275294,null))['then'](saveUpdates(_0x3a9261['body'],null))[_0x197c('0x24')](respondWithResult(_0x275294,null))[_0x197c('0x44')](handleError(_0x275294,null));};exports[_0x197c('0x25')]=function(_0x42a13f,_0x15e50f){return db['VoiceMail']['find']({'where':{'id':_0x42a13f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x15e50f,null))['then'](removeEntity(_0x15e50f,null))[_0x197c('0x44')](handleError(_0x15e50f,null));};exports[_0x197c('0x53')]=function(_0x1a607c,_0x40867c,_0xc10419){return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x1a607c[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x40867c,null))['then'](function(_0x480cab){var _0x1b71cf;var _0x5a70dd={},_0xfc9461={};_0xfc9461[_0x197c('0x31')]=_[_0x197c('0x47')](db['VoiceMailMessage'][_0x197c('0x2d')]);_0xfc9461[_0x197c('0x33')]=_['keys'](_0x1a607c[_0x197c('0x33')]);_0xfc9461[_0x197c('0x34')]=_[_0x197c('0x35')](_0xfc9461['model'],_0xfc9461[_0x197c('0x33')]);_0x5a70dd[_0x197c('0x36')]=_['intersection'](_0xfc9461['model'],qs[_0x197c('0x37')](_0x1a607c[_0x197c('0x33')][_0x197c('0x37')]));_0x5a70dd['attributes']=_0x5a70dd[_0x197c('0x36')][_0x197c('0x38')]?_0x5a70dd[_0x197c('0x36')]:_0xfc9461['model'];if(!_0x1a607c[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x5a70dd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x1a607c[_0x197c('0x33')][_0x197c('0x1b')]);_0x5a70dd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x1a607c[_0x197c('0x33')]['offset']);}_0x5a70dd[_0x197c('0x3b')]=qs['sort'](_0x1a607c['query']['sort']);_0x5a70dd['where']=qs[_0x197c('0x34')](_[_0x197c('0x54')](_0x1a607c[_0x197c('0x33')],_0xfc9461[_0x197c('0x34')]));if(_0x1a607c['query'][_0x197c('0x3e')]){_0x5a70dd['where']=_[_0x197c('0x3f')](_0x5a70dd['where'],{'$or':_[_0x197c('0x32')](_0x5a70dd['attributes'],function(_0x12d31a){var _0x1f6c6f={};_0x1f6c6f[_0x12d31a]={'$like':'%'+_0x1a607c[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x1f6c6f;})});}_0x5a70dd['where']=_[_0x197c('0x3f')](_0x5a70dd[_0x197c('0x3d')],{'mailboxuser':_0x480cab[_0x197c('0x55')]});_0x5a70dd=_['merge']({},_0x5a70dd,_0x1a607c[_0x197c('0x40')]);return db[_0x197c('0x56')][_0x197c('0x57')](_0x5a70dd)[_0x197c('0x24')](respondWithFilteredResult(_0x40867c,_0x5a70dd));})[_0x197c('0x44')](handleError(_0x40867c,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index d62b87f..19b1760 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 _0xa334=['mailbox_context','mailbox','context','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail'];(function(_0x704a9,_0x63c62e){var _0x38c9eb=function(_0x5ce012){while(--_0x5ce012){_0x704a9['push'](_0x704a9['shift']());}};_0x38c9eb(++_0x63c62e);}(_0xa334,0x1cb));var _0x4a33=function(_0x2ce890,_0x5e04d2){_0x2ce890=_0x2ce890-0x0;var _0x48dee7=_0xa334[_0x2ce890];return _0x48dee7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4a33('0x0'))(_0x4a33('0x1'));var moment=require(_0x4a33('0x2'));var BPromise=require(_0x4a33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a33('0x4'));var rimraf=require('rimraf');var config=require(_0x4a33('0x5'));var attributes=require(_0x4a33('0x6'));module[_0x4a33('0x7')]=function(_0x56263f,_0x395545){return _0x56263f['define'](_0x4a33('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4a33('0x9'),'fields':[_0x4a33('0xa'),_0x4a33('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabc6=['rimraf','define','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x579d09,_0x1ac221){var _0x4df6bb=function(_0x3efe77){while(--_0x3efe77){_0x579d09['push'](_0x579d09['shift']());}};_0x4df6bb(++_0x1ac221);}(_0xabc6,0xf5));var _0x6abc=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xabc6[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x6abc('0x0'));var util=require(_0x6abc('0x1'));var logger=require(_0x6abc('0x2'))(_0x6abc('0x3'));var moment=require(_0x6abc('0x4'));var BPromise=require('bluebird');var rp=require(_0x6abc('0x5'));var fs=require('fs');var path=require(_0x6abc('0x6'));var rimraf=require(_0x6abc('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x5e97f7,_0x511b3e){return _0x5e97f7[_0x6abc('0x8')]('VoiceMail',attributes,{'tableName':_0x6abc('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x6abc('0xa'),_0x6abc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index fde4b5a..14e51a0 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 _0xd4f8=['jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xd4f8,0x12c));var _0x8d4f=function(_0x5930c6,_0x5dd4d5){_0x5930c6=_0x5930c6-0x0;var _0x43304a=_0xd4f8[_0x5930c6];return _0x43304a;};'use strict';var _=require(_0x8d4f('0x0'));var util=require('util');var moment=require(_0x8d4f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d4f('0x2'));var db=require(_0x8d4f('0x3'))['db'];var utils=require(_0x8d4f('0x4'));var logger=require(_0x8d4f('0x5'))(_0x8d4f('0x6'));var config=require(_0x8d4f('0x7'));var jayson=require(_0x8d4f('0x8'));var client=jayson[_0x8d4f('0x9')][_0x8d4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574128,_0x487f35,_0x1f296c){return new BPromise(function(_0xcaf4ee,_0x3693b3){return client['request'](_0x574128,_0x1f296c)[_0x8d4f('0xb')](function(_0x4ea0b8){logger[_0x8d4f('0xc')](_0x8d4f('0xd'),_0x487f35,_0x8d4f('0xe'));logger[_0x8d4f('0xf')](_0x8d4f('0x10'),_0x487f35,'request\x20sent',JSON[_0x8d4f('0x11')](_0x4ea0b8));if(_0x4ea0b8[_0x8d4f('0x12')]){if(_0x4ea0b8[_0x8d4f('0x12')][_0x8d4f('0x13')]===0x1f4){logger[_0x8d4f('0x12')](_0x8d4f('0xd'),_0x487f35,_0x4ea0b8[_0x8d4f('0x12')][_0x8d4f('0x14')]);return _0x3693b3(_0x4ea0b8[_0x8d4f('0x12')][_0x8d4f('0x14')]);}logger[_0x8d4f('0x12')](_0x8d4f('0xd'),_0x487f35,_0x4ea0b8[_0x8d4f('0x12')]['message']);return _0xcaf4ee(_0x4ea0b8[_0x8d4f('0x12')][_0x8d4f('0x14')]);}else{logger[_0x8d4f('0xc')](_0x8d4f('0xd'),_0x487f35,'request\x20sent');_0xcaf4ee(_0x4ea0b8['result'][_0x8d4f('0x14')]);}})[_0x8d4f('0x15')](function(_0x557a1f){logger[_0x8d4f('0x12')]('VoiceMail,\x20%s,\x20%s',_0x487f35,_0x557a1f);_0x3693b3(_0x557a1f);});});} \ No newline at end of file +var _0x15f4=['code','message','VoiceMail,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2c52d9,_0x5c1c30){var _0x12de8e=function(_0x2a38eb){while(--_0x2a38eb){_0x2c52d9['push'](_0x2c52d9['shift']());}};_0x12de8e(++_0x5c1c30);}(_0x15f4,0x14e));var _0x415f=function(_0x1d0b07,_0x2c5574){_0x1d0b07=_0x1d0b07-0x0;var _0x1eb1d0=_0x15f4[_0x1d0b07];return _0x1eb1d0;};'use strict';var _=require(_0x415f('0x0'));var util=require(_0x415f('0x1'));var moment=require('moment');var BPromise=require(_0x415f('0x2'));var rs=require(_0x415f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x415f('0x4'))['db'];var utils=require(_0x415f('0x5'));var logger=require(_0x415f('0x6'))(_0x415f('0x7'));var config=require('../../config/environment');var jayson=require(_0x415f('0x8'));var client=jayson['client'][_0x415f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcbe157,_0x25895a,_0x5a2b79){return new BPromise(function(_0x508d50,_0x16dbee){return client[_0x415f('0xa')](_0xcbe157,_0x5a2b79)[_0x415f('0xb')](function(_0x4ccfbb){logger[_0x415f('0xc')]('VoiceMail,\x20%s,\x20%s',_0x25895a,'request\x20sent');logger[_0x415f('0xd')](_0x415f('0xe'),_0x25895a,_0x415f('0xf'),JSON[_0x415f('0x10')](_0x4ccfbb));if(_0x4ccfbb[_0x415f('0x11')]){if(_0x4ccfbb[_0x415f('0x11')][_0x415f('0x12')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x25895a,_0x4ccfbb[_0x415f('0x11')][_0x415f('0x13')]);return _0x16dbee(_0x4ccfbb[_0x415f('0x11')][_0x415f('0x13')]);}logger['error'](_0x415f('0x14'),_0x25895a,_0x4ccfbb[_0x415f('0x11')][_0x415f('0x13')]);return _0x508d50(_0x4ccfbb[_0x415f('0x11')][_0x415f('0x13')]);}else{logger['info'](_0x415f('0x14'),_0x25895a,_0x415f('0xf'));_0x508d50(_0x4ccfbb[_0x415f('0x15')][_0x415f('0x13')]);}})['catch'](function(_0x5bcc62){logger[_0x415f('0x11')](_0x415f('0x14'),_0x25895a,_0x5bcc62);_0x16dbee(_0x5bcc62);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 67b43e1..c7c6509 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 _0x46d5=['./voiceMailMessage.controller','get','isAuthenticated','/:id','show','download','post','create','put','update','delete','destroy','exports','path','express','../../components/auth/service','../../config/environment'];(function(_0x67f30a,_0x2e62de){var _0x59b41e=function(_0x1716a5){while(--_0x1716a5){_0x67f30a['push'](_0x67f30a['shift']());}};_0x59b41e(++_0x2e62de);}(_0x46d5,0xb7));var _0x546d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46d5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x546d('0x0'));var timeout=require('connect-timeout');var express=require(_0x546d('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x546d('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x546d('0x3'));var controller=require(_0x546d('0x4'));router[_0x546d('0x5')]('/',auth[_0x546d('0x6')](),controller['index']);router['get'](_0x546d('0x7'),auth[_0x546d('0x6')](),controller[_0x546d('0x8')]);router[_0x546d('0x5')]('/:id/download',auth[_0x546d('0x6')](),controller[_0x546d('0x9')]);router[_0x546d('0xa')]('/',auth[_0x546d('0x6')](),controller[_0x546d('0xb')]);router[_0x546d('0xc')]('/:id',auth[_0x546d('0x6')](),controller[_0x546d('0xd')]);router[_0x546d('0xe')](_0x546d('0x7'),auth[_0x546d('0x6')](),controller[_0x546d('0xf')]);module[_0x546d('0x10')]=router; \ No newline at end of file +var _0xdba6=['/:id','isAuthenticated','show','/:id/download','download','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceMailMessage.controller','get','index'];(function(_0x3c9b72,_0x25ed4b){var _0x2bc343=function(_0x11af53){while(--_0x11af53){_0x3c9b72['push'](_0x3c9b72['shift']());}};_0x2bc343(++_0x25ed4b);}(_0xdba6,0x19a));var _0x6dba=function(_0x11446d,_0x2ec950){_0x11446d=_0x11446d-0x0;var _0x2b4c49=_0xdba6[_0x11446d];return _0x2b4c49;};'use strict';var multer=require(_0x6dba('0x0'));var util=require(_0x6dba('0x1'));var path=require(_0x6dba('0x2'));var timeout=require(_0x6dba('0x3'));var express=require('express');var router=express[_0x6dba('0x4')]();var fs_extra=require(_0x6dba('0x5'));var auth=require(_0x6dba('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6dba('0x7'));router[_0x6dba('0x8')]('/',auth['isAuthenticated'](),controller[_0x6dba('0x9')]);router[_0x6dba('0x8')](_0x6dba('0xa'),auth[_0x6dba('0xb')](),controller[_0x6dba('0xc')]);router[_0x6dba('0x8')](_0x6dba('0xd'),auth[_0x6dba('0xb')](),controller[_0x6dba('0xe')]);router[_0x6dba('0xf')]('/',auth['isAuthenticated'](),controller[_0x6dba('0x10')]);router['put'](_0x6dba('0xa'),auth['isAuthenticated'](),controller[_0x6dba('0x11')]);router[_0x6dba('0x12')](_0x6dba('0xa'),auth[_0x6dba('0xb')](),controller[_0x6dba('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d3046f6..a54926c 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 _0xbe10=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x18c6e6,_0x137fa9){var _0x24519c=function(_0x4a7ab6){while(--_0x4a7ab6){_0x18c6e6['push'](_0x18c6e6['shift']());}};_0x24519c(++_0x137fa9);}(_0xbe10,0x1d8));var _0x0be1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xbe10[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x0be1('0x0'));module[_0x0be1('0x1')]={'name':{'type':Sequelize[_0x0be1('0x2')],'get':function(_0x43ebb1){return this[_0x0be1('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x0be1('0x5')](_0x0be1('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x0be1('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x0be1('0x7'),'defaultValue':Sequelize[_0x0be1('0x8')](_0x0be1('0x9'))}}; \ No newline at end of file +var _0x0e05=['INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x0e05,0x1d1));var _0x50e0=function(_0x3c6ca4,_0xc681ef){_0x3c6ca4=_0x3c6ca4-0x0;var _0x2f3637=_0x0e05[_0x3c6ca4];return _0x2f3637;};'use strict';var Sequelize=require(_0x50e0('0x0'));module[_0x50e0('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e761d){return this[_0x50e0('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x50e0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x50e0('0x5')](_0x50e0('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x50e0('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x50e0('0x7')](_0x50e0('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index eb64246..96ca8ac 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 _0xbd17=['json','undefined','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','error','stack','name','index','map','VoiceMailMessage','fieldName','type','differenceBy','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','rows','catch','show','rawAttributes','create','body','find','params','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xbd17,0x187));var _0x7bd1=function(_0x2df8f0,_0x566393){_0x2df8f0=_0x2df8f0-0x0;var _0x318ec5=_0xbd17[_0x2df8f0];return _0x318ec5;};'use strict';var emlformat=require(_0x7bd1('0x0'));var rimraf=require(_0x7bd1('0x1'));var zipdir=require(_0x7bd1('0x2'));var jsonpatch=require(_0x7bd1('0x3'));var rp=require('request-promise');var moment=require(_0x7bd1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7bd1('0x5'));var path=require(_0x7bd1('0x6'));var sox=require(_0x7bd1('0x7'));var csv=require(_0x7bd1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bd1('0x9'));var squel=require('squel');var crypto=require(_0x7bd1('0xa'));var jsforce=require(_0x7bd1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7bd1('0x8'));var querystring=require('querystring');var Papa=require(_0x7bd1('0xc'));var Redis=require(_0x7bd1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7bd1('0xe'));var as=require(_0x7bd1('0xf'));var hardwareService=require(_0x7bd1('0x10'));var logger=require('../../config/logger')(_0x7bd1('0x11'));var utils=require(_0x7bd1('0x12'));var config=require(_0x7bd1('0x13'));var licenseUtil=require(_0x7bd1('0x14'));var db=require(_0x7bd1('0x15'))['db'];function respondWithStatusCode(_0x5c0ddd,_0x561398){_0x561398=_0x561398||0xcc;return function(_0x59170f){if(_0x59170f){return _0x5c0ddd['sendStatus'](_0x561398);}return _0x5c0ddd['status'](_0x561398)[_0x7bd1('0x16')]();};}function respondWithResult(_0x68279e,_0x63597c){_0x63597c=_0x63597c||0xc8;return function(_0x4a93f7){if(_0x4a93f7){return _0x68279e[_0x7bd1('0x17')](_0x63597c)[_0x7bd1('0x18')](_0x4a93f7);}};}function respondWithFilteredResult(_0x2ac0f0,_0x55d807){return function(_0x5bf9cb){if(_0x5bf9cb){var _0x3256ac=typeof _0x55d807['offset']===_0x7bd1('0x19')&&typeof _0x55d807['limit']==='undefined';var _0xc09390=_0x5bf9cb[_0x7bd1('0x1a')];var _0x3e5392=_0x3256ac?0x0:_0x55d807[_0x7bd1('0x1b')];var _0x4f3e04=_0x3256ac?_0x5bf9cb[_0x7bd1('0x1a')]:_0x55d807[_0x7bd1('0x1b')]+_0x55d807[_0x7bd1('0x1c')];var _0x381e5a;if(_0x4f3e04>=_0xc09390){_0x4f3e04=_0xc09390;_0x381e5a=0xc8;}else{_0x381e5a=0xce;}_0x2ac0f0[_0x7bd1('0x17')](_0x381e5a);return _0x2ac0f0[_0x7bd1('0x1d')](_0x7bd1('0x1e'),_0x3e5392+'-'+_0x4f3e04+'/'+_0xc09390)[_0x7bd1('0x18')](_0x5bf9cb);}return null;};}function patchUpdates(_0x5a8c8a){return function(_0x57f27a){try{jsonpatch[_0x7bd1('0x1f')](_0x57f27a,_0x5a8c8a,!![]);}catch(_0x385d33){return BPromise['reject'](_0x385d33);}return _0x57f27a[_0x7bd1('0x20')]();};}function saveUpdates(_0x7233b1,_0x50653c){return function(_0x2180b3){if(_0x2180b3){return _0x2180b3[_0x7bd1('0x21')](_0x7233b1)['then'](function(_0x348cd4){return _0x348cd4;});}return null;};}function removeEntity(_0x39c7d2,_0x5afc91){return function(_0x77988c){if(_0x77988c){return _0x77988c['destroy']()['then'](function(){_0x39c7d2[_0x7bd1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dad1d,_0x7e8ef5){return function(_0x777d85){if(!_0x777d85){_0x5dad1d[_0x7bd1('0x22')](0x194);}return _0x777d85;};}function handleError(_0x368848,_0x418615){_0x418615=_0x418615||0x1f4;return function(_0x466eec){logger[_0x7bd1('0x23')](_0x466eec[_0x7bd1('0x24')]);if(_0x466eec[_0x7bd1('0x25')]){delete _0x466eec[_0x7bd1('0x25')];}_0x368848[_0x7bd1('0x17')](_0x418615)['send'](_0x466eec);};}exports[_0x7bd1('0x26')]=function(_0x2d809a,_0x14897b){var _0x3c63e9={},_0x3fee13={},_0x36d414={'count':0x0,'rows':[]};var _0x4a6680=_[_0x7bd1('0x27')](db[_0x7bd1('0x28')]['rawAttributes'],function(_0x221ed6){return{'name':_0x221ed6[_0x7bd1('0x29')],'type':_0x221ed6[_0x7bd1('0x2a')]['key']};});_0x3fee13['model']=_[_0x7bd1('0x2b')](_['map'](_0x4a6680,_0x7bd1('0x25')),[_0x7bd1('0x25')]);_0x3fee13['query']=_[_0x7bd1('0x2c')](_0x2d809a[_0x7bd1('0x2d')]);_0x3fee13[_0x7bd1('0x2e')]=_[_0x7bd1('0x2f')](_0x3fee13[_0x7bd1('0x30')],_0x3fee13[_0x7bd1('0x2d')]);_0x3c63e9['attributes']=_[_0x7bd1('0x2f')](_0x3fee13[_0x7bd1('0x30')],qs[_0x7bd1('0x31')](_0x2d809a[_0x7bd1('0x2d')][_0x7bd1('0x31')]));_0x3c63e9['attributes']=_0x3c63e9['attributes'][_0x7bd1('0x32')]?_0x3c63e9[_0x7bd1('0x33')]:_0x3fee13[_0x7bd1('0x30')];if(!_0x2d809a['query'][_0x7bd1('0x34')]('nolimit')){_0x3c63e9[_0x7bd1('0x1c')]=qs[_0x7bd1('0x1c')](_0x2d809a[_0x7bd1('0x2d')]['limit']);_0x3c63e9[_0x7bd1('0x1b')]=qs[_0x7bd1('0x1b')](_0x2d809a[_0x7bd1('0x2d')][_0x7bd1('0x1b')]);}_0x3c63e9[_0x7bd1('0x35')]=qs['sort'](_0x2d809a[_0x7bd1('0x2d')][_0x7bd1('0x36')]);_0x3c63e9[_0x7bd1('0x37')]=qs['filters'](_[_0x7bd1('0x38')](_0x2d809a[_0x7bd1('0x2d')],_0x3fee13['filters']),_0x4a6680);if(_0x2d809a[_0x7bd1('0x2d')][_0x7bd1('0x39')]){_0x3c63e9['where']=_['merge'](_0x3c63e9[_0x7bd1('0x37')],{'$or':_['map'](_0x4a6680,function(_0x4dc54d){if(_0x4dc54d[_0x7bd1('0x2a')]!==_0x7bd1('0x3a')){var _0x2ce72e={};_0x2ce72e[_0x4dc54d[_0x7bd1('0x25')]]={'$like':'%'+_0x2d809a[_0x7bd1('0x2d')]['filter']+'%'};return _0x2ce72e;}})});}_0x3c63e9=_[_0x7bd1('0x3b')]({},_0x3c63e9,_0x2d809a[_0x7bd1('0x3c')]);var _0x2cdec8={'where':_0x3c63e9[_0x7bd1('0x37')]};return db[_0x7bd1('0x28')][_0x7bd1('0x1a')](_0x2cdec8)[_0x7bd1('0x3d')](function(_0x209fd4){_0x36d414[_0x7bd1('0x1a')]=_0x209fd4;if(_0x2d809a[_0x7bd1('0x2d')][_0x7bd1('0x3e')]){_0x3c63e9[_0x7bd1('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x3c63e9);})[_0x7bd1('0x3d')](function(_0x236cd3){_0x36d414[_0x7bd1('0x40')]=_0x236cd3;return _0x36d414;})[_0x7bd1('0x3d')](respondWithFilteredResult(_0x14897b,_0x3c63e9))[_0x7bd1('0x41')](handleError(_0x14897b,null));};exports[_0x7bd1('0x42')]=function(_0x65526b,_0x45b839){var _0x3dfb81={'raw':!![],'where':{'id':_0x65526b['params']['id']}},_0x57f3d0={};_0x57f3d0[_0x7bd1('0x30')]=_['keys'](db[_0x7bd1('0x28')][_0x7bd1('0x43')]);_0x57f3d0[_0x7bd1('0x2d')]=_[_0x7bd1('0x2c')](_0x65526b['query']);_0x57f3d0[_0x7bd1('0x2e')]=_['intersection'](_0x57f3d0[_0x7bd1('0x30')],_0x57f3d0['query']);_0x3dfb81[_0x7bd1('0x33')]=_[_0x7bd1('0x2f')](_0x57f3d0[_0x7bd1('0x30')],qs[_0x7bd1('0x31')](_0x65526b['query']['fields']));_0x3dfb81[_0x7bd1('0x33')]=_0x3dfb81['attributes'][_0x7bd1('0x32')]?_0x3dfb81[_0x7bd1('0x33')]:_0x57f3d0[_0x7bd1('0x30')];if(_0x65526b[_0x7bd1('0x2d')][_0x7bd1('0x3e')]){_0x3dfb81[_0x7bd1('0x3f')]=[{'all':!![]}];}_0x3dfb81=_[_0x7bd1('0x3b')]({},_0x3dfb81,_0x65526b['options']);return db[_0x7bd1('0x28')]['find'](_0x3dfb81)[_0x7bd1('0x3d')](handleEntityNotFound(_0x45b839,null))[_0x7bd1('0x3d')](respondWithResult(_0x45b839,null))[_0x7bd1('0x41')](handleError(_0x45b839,null));};exports[_0x7bd1('0x44')]=function(_0x4811a,_0x51a966){return db[_0x7bd1('0x28')]['create'](_0x4811a[_0x7bd1('0x45')],{})['then'](respondWithResult(_0x51a966,0xc9))[_0x7bd1('0x41')](handleError(_0x51a966,null));};exports[_0x7bd1('0x21')]=function(_0x33a463,_0x1a5414){if(_0x33a463[_0x7bd1('0x45')]['id']){delete _0x33a463[_0x7bd1('0x45')]['id'];}return db[_0x7bd1('0x28')][_0x7bd1('0x46')]({'where':{'id':_0x33a463[_0x7bd1('0x47')]['id']}})[_0x7bd1('0x3d')](handleEntityNotFound(_0x1a5414,null))['then'](saveUpdates(_0x33a463['body'],null))[_0x7bd1('0x3d')](respondWithResult(_0x1a5414,null))[_0x7bd1('0x41')](handleError(_0x1a5414,null));};exports[_0x7bd1('0x48')]=function(_0x25f3fc,_0x16bf7c){return db[_0x7bd1('0x28')][_0x7bd1('0x46')]({'where':{'id':_0x25f3fc[_0x7bd1('0x47')]['id']}})[_0x7bd1('0x3d')](handleEntityNotFound(_0x16bf7c,null))[_0x7bd1('0x3d')](removeEntity(_0x16bf7c,null))[_0x7bd1('0x41')](handleError(_0x16bf7c,null));};exports[_0x7bd1('0x49')]=function(_0x2a9e49,_0x3bb8fd,_0x25ca9c){return db[_0x7bd1('0x28')][_0x7bd1('0x46')]({'where':{'id':_0x2a9e49[_0x7bd1('0x47')]['id']},'attributes':['id',_0x7bd1('0x4a'),_0x7bd1('0x4b')]})[_0x7bd1('0x3d')](handleEntityNotFound(_0x3bb8fd,null))['then'](function(_0xddebfd){if(_0xddebfd){if(!_0xddebfd[_0x7bd1('0x4a')]){throw new db[(_0x7bd1('0x4c'))]['ValidationError'](_0x7bd1('0x4d'));}var _0x2f6b3f={'Content-Type':_0x7bd1('0x4e'),'Content-Disposition':'attachment'};if(_0xddebfd['msg_id']){_0x2f6b3f[_0x7bd1('0x4f')]=_0x7bd1('0x50')+_0xddebfd['msg_id']+_0x7bd1('0x51');}_0x3bb8fd['set'](_0x2f6b3f);return _0x3bb8fd[_0x7bd1('0x52')](new Buffer(_0xddebfd[_0x7bd1('0x4a')]));}})[_0x7bd1('0x41')](handleError(_0x3bb8fd,null));}; \ No newline at end of file +var _0x411c=['apply','reject','update','then','stack','name','send','index','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','map','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include','catch','show','params','keys','find','create','body','destroy','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0x411c,0x80));var _0xc411=function(_0xc50086,_0x4ab3ba){_0xc50086=_0xc50086-0x0;var _0x32513c=_0x411c[_0xc50086];return _0x32513c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc411('0x0'));var zipdir=require(_0xc411('0x1'));var jsonpatch=require(_0xc411('0x2'));var rp=require(_0xc411('0x3'));var moment=require(_0xc411('0x4'));var BPromise=require(_0xc411('0x5'));var Mustache=require(_0xc411('0x6'));var util=require(_0xc411('0x7'));var path=require(_0xc411('0x8'));var sox=require(_0xc411('0x9'));var csv=require(_0xc411('0xa'));var ejs=require(_0xc411('0xb'));var fs=require('fs');var fs_extra=require(_0xc411('0xc'));var _=require(_0xc411('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc411('0xe'));var deskjs=require(_0xc411('0xf'));var toCsv=require(_0xc411('0xa'));var querystring=require(_0xc411('0x10'));var Papa=require('papaparse');var Redis=require(_0xc411('0x11'));var authService=require(_0xc411('0x12'));var qs=require(_0xc411('0x13'));var as=require(_0xc411('0x14'));var hardwareService=require(_0xc411('0x15'));var logger=require(_0xc411('0x16'))(_0xc411('0x17'));var utils=require('../../config/utils');var config=require(_0xc411('0x18'));var licenseUtil=require(_0xc411('0x19'));var db=require(_0xc411('0x1a'))['db'];function respondWithStatusCode(_0x48c1ca,_0x3e755f){_0x3e755f=_0x3e755f||0xcc;return function(_0x1600c6){if(_0x1600c6){return _0x48c1ca[_0xc411('0x1b')](_0x3e755f);}return _0x48c1ca[_0xc411('0x1c')](_0x3e755f)[_0xc411('0x1d')]();};}function respondWithResult(_0x55421e,_0x4a55a6){_0x4a55a6=_0x4a55a6||0xc8;return function(_0x4ec27f){if(_0x4ec27f){return _0x55421e[_0xc411('0x1c')](_0x4a55a6)[_0xc411('0x1e')](_0x4ec27f);}};}function respondWithFilteredResult(_0x21e98b,_0x2a0b5c){return function(_0x4f74e4){if(_0x4f74e4){var _0x5e637a=typeof _0x2a0b5c['offset']===_0xc411('0x1f')&&typeof _0x2a0b5c[_0xc411('0x20')]===_0xc411('0x1f');var _0x5130b0=_0x4f74e4[_0xc411('0x21')];var _0x5dc3c3=_0x5e637a?0x0:_0x2a0b5c['offset'];var _0x53f6a2=_0x5e637a?_0x4f74e4['count']:_0x2a0b5c['offset']+_0x2a0b5c[_0xc411('0x20')];var _0x4a815f;if(_0x53f6a2>=_0x5130b0){_0x53f6a2=_0x5130b0;_0x4a815f=0xc8;}else{_0x4a815f=0xce;}_0x21e98b[_0xc411('0x1c')](_0x4a815f);return _0x21e98b[_0xc411('0x22')](_0xc411('0x23'),_0x5dc3c3+'-'+_0x53f6a2+'/'+_0x5130b0)[_0xc411('0x1e')](_0x4f74e4);}return null;};}function patchUpdates(_0x46f2cd){return function(_0x28f86c){try{jsonpatch[_0xc411('0x24')](_0x28f86c,_0x46f2cd,!![]);}catch(_0x4a97f7){return BPromise[_0xc411('0x25')](_0x4a97f7);}return _0x28f86c['save']();};}function saveUpdates(_0x2a653f,_0x28e863){return function(_0x441610){if(_0x441610){return _0x441610[_0xc411('0x26')](_0x2a653f)[_0xc411('0x27')](function(_0x37dc4d){return _0x37dc4d;});}return null;};}function removeEntity(_0x52b906,_0x973924){return function(_0x32dd92){if(_0x32dd92){return _0x32dd92['destroy']()['then'](function(){_0x52b906['status'](0xcc)[_0xc411('0x1d')]();});}};}function handleEntityNotFound(_0x16e318,_0x480a6c){return function(_0x23b93){if(!_0x23b93){_0x16e318['sendStatus'](0x194);}return _0x23b93;};}function handleError(_0x1231df,_0x5baa29){_0x5baa29=_0x5baa29||0x1f4;return function(_0x1e96bf){logger['error'](_0x1e96bf[_0xc411('0x28')]);if(_0x1e96bf[_0xc411('0x29')]){delete _0x1e96bf['name'];}_0x1231df[_0xc411('0x1c')](_0x5baa29)[_0xc411('0x2a')](_0x1e96bf);};}exports[_0xc411('0x2b')]=function(_0x5a454f,_0xa3152d){var _0x526ca8={},_0x3b7c15={},_0x1a3b0f={'count':0x0,'rows':[]};var _0x111aae=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x4ca9c5){return{'name':_0x4ca9c5['fieldName'],'type':_0x4ca9c5[_0xc411('0x2c')][_0xc411('0x2d')]};});_0x3b7c15[_0xc411('0x2e')]=_[_0xc411('0x2f')](_['map'](_0x111aae,_0xc411('0x29')),[_0xc411('0x29')]);_0x3b7c15[_0xc411('0x30')]=_['keys'](_0x5a454f['query']);_0x3b7c15[_0xc411('0x31')]=_[_0xc411('0x32')](_0x3b7c15[_0xc411('0x2e')],_0x3b7c15[_0xc411('0x30')]);_0x526ca8[_0xc411('0x33')]=_[_0xc411('0x32')](_0x3b7c15['model'],qs[_0xc411('0x34')](_0x5a454f['query'][_0xc411('0x34')]));_0x526ca8[_0xc411('0x33')]=_0x526ca8['attributes'][_0xc411('0x35')]?_0x526ca8[_0xc411('0x33')]:_0x3b7c15[_0xc411('0x2e')];if(!_0x5a454f[_0xc411('0x30')]['hasOwnProperty'](_0xc411('0x36'))){_0x526ca8[_0xc411('0x20')]=qs[_0xc411('0x20')](_0x5a454f[_0xc411('0x30')][_0xc411('0x20')]);_0x526ca8[_0xc411('0x37')]=qs[_0xc411('0x37')](_0x5a454f[_0xc411('0x30')][_0xc411('0x37')]);}_0x526ca8['order']=qs[_0xc411('0x38')](_0x5a454f[_0xc411('0x30')]['sort']);_0x526ca8[_0xc411('0x39')]=qs[_0xc411('0x31')](_[_0xc411('0x3a')](_0x5a454f['query'],_0x3b7c15[_0xc411('0x31')]),_0x111aae);if(_0x5a454f[_0xc411('0x30')]['filter']){_0x526ca8[_0xc411('0x39')]=_['merge'](_0x526ca8[_0xc411('0x39')],{'$or':_[_0xc411('0x3b')](_0x111aae,function(_0x2be1b5){if(_0x2be1b5[_0xc411('0x2c')]!==_0xc411('0x3c')){var _0xcfd5b0={};_0xcfd5b0[_0x2be1b5['name']]={'$like':'%'+_0x5a454f[_0xc411('0x30')]['filter']+'%'};return _0xcfd5b0;}})});}_0x526ca8=_[_0xc411('0x3d')]({},_0x526ca8,_0x5a454f[_0xc411('0x3e')]);var _0x98be1e={'where':_0x526ca8[_0xc411('0x39')]};return db[_0xc411('0x3f')]['count'](_0x98be1e)['then'](function(_0x58f672){_0x1a3b0f[_0xc411('0x21')]=_0x58f672;if(_0x5a454f[_0xc411('0x30')][_0xc411('0x40')]){_0x526ca8[_0xc411('0x41')]=[{'all':!![]}];}return db[_0xc411('0x3f')]['findAll'](_0x526ca8);})[_0xc411('0x27')](function(_0x565a17){_0x1a3b0f['rows']=_0x565a17;return _0x1a3b0f;})[_0xc411('0x27')](respondWithFilteredResult(_0xa3152d,_0x526ca8))[_0xc411('0x42')](handleError(_0xa3152d,null));};exports[_0xc411('0x43')]=function(_0xea349d,_0x182bc0){var _0x4a3c5a={'raw':!![],'where':{'id':_0xea349d[_0xc411('0x44')]['id']}},_0x1cccd3={};_0x1cccd3[_0xc411('0x2e')]=_[_0xc411('0x45')](db[_0xc411('0x3f')]['rawAttributes']);_0x1cccd3[_0xc411('0x30')]=_['keys'](_0xea349d[_0xc411('0x30')]);_0x1cccd3['filters']=_[_0xc411('0x32')](_0x1cccd3[_0xc411('0x2e')],_0x1cccd3[_0xc411('0x30')]);_0x4a3c5a[_0xc411('0x33')]=_[_0xc411('0x32')](_0x1cccd3[_0xc411('0x2e')],qs[_0xc411('0x34')](_0xea349d[_0xc411('0x30')][_0xc411('0x34')]));_0x4a3c5a[_0xc411('0x33')]=_0x4a3c5a[_0xc411('0x33')]['length']?_0x4a3c5a[_0xc411('0x33')]:_0x1cccd3[_0xc411('0x2e')];if(_0xea349d[_0xc411('0x30')]['includeAll']){_0x4a3c5a[_0xc411('0x41')]=[{'all':!![]}];}_0x4a3c5a=_[_0xc411('0x3d')]({},_0x4a3c5a,_0xea349d[_0xc411('0x3e')]);return db[_0xc411('0x3f')][_0xc411('0x46')](_0x4a3c5a)[_0xc411('0x27')](handleEntityNotFound(_0x182bc0,null))[_0xc411('0x27')](respondWithResult(_0x182bc0,null))['catch'](handleError(_0x182bc0,null));};exports[_0xc411('0x47')]=function(_0x513a6b,_0x3a725f){return db[_0xc411('0x3f')][_0xc411('0x47')](_0x513a6b[_0xc411('0x48')],{})[_0xc411('0x27')](respondWithResult(_0x3a725f,0xc9))['catch'](handleError(_0x3a725f,null));};exports[_0xc411('0x26')]=function(_0x34b434,_0x287962){if(_0x34b434[_0xc411('0x48')]['id']){delete _0x34b434['body']['id'];}return db[_0xc411('0x3f')][_0xc411('0x46')]({'where':{'id':_0x34b434['params']['id']}})[_0xc411('0x27')](handleEntityNotFound(_0x287962,null))[_0xc411('0x27')](saveUpdates(_0x34b434[_0xc411('0x48')],null))[_0xc411('0x27')](respondWithResult(_0x287962,null))[_0xc411('0x42')](handleError(_0x287962,null));};exports[_0xc411('0x49')]=function(_0x45959b,_0xa93ff7){return db[_0xc411('0x3f')]['find']({'where':{'id':_0x45959b[_0xc411('0x44')]['id']}})['then'](handleEntityNotFound(_0xa93ff7,null))['then'](removeEntity(_0xa93ff7,null))[_0xc411('0x42')](handleError(_0xa93ff7,null));};exports['download']=function(_0x1d9685,_0x1b6201,_0xb754f4){return db[_0xc411('0x3f')][_0xc411('0x46')]({'where':{'id':_0x1d9685[_0xc411('0x44')]['id']},'attributes':['id',_0xc411('0x4a'),_0xc411('0x4b')]})['then'](handleEntityNotFound(_0x1b6201,null))[_0xc411('0x27')](function(_0x38dff9){if(_0x38dff9){if(!_0x38dff9[_0xc411('0x4a')]){throw new db[(_0xc411('0x4c'))][(_0xc411('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x4733d0={'Content-Type':_0xc411('0x4e'),'Content-Disposition':_0xc411('0x4f')};if(_0x38dff9['msg_id']){_0x4733d0['Content-Disposition']=_0xc411('0x50')+_0x38dff9[_0xc411('0x4b')]+_0xc411('0x51');}_0x1b6201[_0xc411('0x22')](_0x4733d0);return _0x1b6201[_0xc411('0x2a')](new Buffer(_0x38dff9[_0xc411('0x4a')]));}})[_0xc411('0x42')](handleError(_0x1b6201,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 7db48e7..759f03e 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 _0x442e=['dir','lodash','../../config/logger','api','moment','bluebird','path','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x1cc92b,_0x306fbf){var _0x5871cc=function(_0x90f579){while(--_0x90f579){_0x1cc92b['push'](_0x1cc92b['shift']());}};_0x5871cc(++_0x306fbf);}(_0x442e,0x65));var _0xe442=function(_0x5c2438,_0x27b5c2){_0x5c2438=_0x5c2438-0x0;var _0xccc3cd=_0x442e[_0x5c2438];return _0xccc3cd;};'use strict';var _=require(_0xe442('0x0'));var util=require('util');var logger=require(_0xe442('0x1'))(_0xe442('0x2'));var moment=require(_0xe442('0x3'));var BPromise=require(_0xe442('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe442('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe442('0x6'));module['exports']=function(_0x1e79f7,_0x4f8857){return _0x1e79f7[_0xe442('0x7')](_0xe442('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xe442('0x9'),'fields':[_0xe442('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8981=['dir','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0xcfc685,_0x2b3257){var _0x7d10a8=function(_0x4615a6){while(--_0x4615a6){_0xcfc685['push'](_0xcfc685['shift']());}};_0x7d10a8(++_0x2b3257);}(_0x8981,0x105));var _0x1898=function(_0x1e1646,_0x1ae945){_0x1e1646=_0x1e1646-0x0;var _0x377576=_0x8981[_0x1e1646];return _0x377576;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1898('0x0'))(_0x1898('0x1'));var moment=require(_0x1898('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1898('0x3'));var rimraf=require(_0x1898('0x4'));var config=require(_0x1898('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0x1898('0x6')]=function(_0x4feb0f,_0x22d97b){return _0x4feb0f['define'](_0x1898('0x7'),attributes,{'tableName':_0x1898('0x8'),'paranoid':![],'indexes':[{'name':_0x1898('0x9'),'fields':[_0x1898('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 693df82..e3a7b49 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 _0x36ac=['info','request\x20sent','debug','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x3ce6d2,_0x90364d){var _0x4c1dd4=function(_0x3b2e50){while(--_0x3b2e50){_0x3ce6d2['push'](_0x3ce6d2['shift']());}};_0x4c1dd4(++_0x90364d);}(_0x36ac,0xdc));var _0xc36a=function(_0x5d91b5,_0x585067){_0x5d91b5=_0x5d91b5-0x0;var _0x4d784b=_0x36ac[_0x5d91b5];return _0x4d784b;};'use strict';var _=require('lodash');var util=require(_0xc36a('0x0'));var moment=require(_0xc36a('0x1'));var BPromise=require(_0xc36a('0x2'));var rs=require(_0xc36a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc36a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc36a('0x5'))(_0xc36a('0x6'));var config=require('../../config/environment');var jayson=require(_0xc36a('0x7'));var client=jayson['client'][_0xc36a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x422488,_0x5af0bc,_0x212a5f){return new BPromise(function(_0x1456e5,_0x5cc560){return client[_0xc36a('0x9')](_0x422488,_0x212a5f)[_0xc36a('0xa')](function(_0x13070a){logger[_0xc36a('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x5af0bc,_0xc36a('0xc'));logger[_0xc36a('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5af0bc,_0xc36a('0xc'),JSON[_0xc36a('0xe')](_0x13070a));if(_0x13070a[_0xc36a('0xf')]){if(_0x13070a['error'][_0xc36a('0x10')]===0x1f4){logger[_0xc36a('0xf')](_0xc36a('0x11'),_0x5af0bc,_0x13070a[_0xc36a('0xf')]['message']);return _0x5cc560(_0x13070a[_0xc36a('0xf')][_0xc36a('0x12')]);}logger[_0xc36a('0xf')](_0xc36a('0x11'),_0x5af0bc,_0x13070a[_0xc36a('0xf')][_0xc36a('0x12')]);return _0x1456e5(_0x13070a[_0xc36a('0xf')]['message']);}else{logger[_0xc36a('0xb')](_0xc36a('0x11'),_0x5af0bc,'request\x20sent');_0x1456e5(_0x13070a[_0xc36a('0x13')][_0xc36a('0x12')]);}})[_0xc36a('0x14')](function(_0x4216a1){logger[_0xc36a('0xf')](_0xc36a('0x11'),_0x5af0bc,_0x4216a1);_0x5cc560(_0x4216a1);});});} \ No newline at end of file +var _0xf793=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48e3cd,_0x24bbd1){var _0x44f78b=function(_0x5e2a14){while(--_0x5e2a14){_0x48e3cd['push'](_0x48e3cd['shift']());}};_0x44f78b(++_0x24bbd1);}(_0xf793,0xc0));var _0x3f79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf793[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f79('0x0'));var util=require('util');var moment=require(_0x3f79('0x1'));var BPromise=require(_0x3f79('0x2'));var rs=require(_0x3f79('0x3'));var fs=require('fs');var Redis=require(_0x3f79('0x4'));var db=require(_0x3f79('0x5'))['db'];var utils=require(_0x3f79('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f79('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3f79('0x8')][_0x3f79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b3708,_0x1e179f,_0x4aa5e2){return new BPromise(function(_0x419aa7,_0x42cd04){return client[_0x3f79('0xa')](_0x4b3708,_0x4aa5e2)[_0x3f79('0xb')](function(_0x3f7b78){logger['info'](_0x3f79('0xc'),_0x1e179f,_0x3f79('0xd'));logger['debug'](_0x3f79('0xe'),_0x1e179f,'request\x20sent',JSON[_0x3f79('0xf')](_0x3f7b78));if(_0x3f7b78[_0x3f79('0x10')]){if(_0x3f7b78[_0x3f79('0x10')][_0x3f79('0x11')]===0x1f4){logger[_0x3f79('0x10')](_0x3f79('0xc'),_0x1e179f,_0x3f7b78[_0x3f79('0x10')][_0x3f79('0x12')]);return _0x42cd04(_0x3f7b78[_0x3f79('0x10')][_0x3f79('0x12')]);}logger[_0x3f79('0x10')](_0x3f79('0xc'),_0x1e179f,_0x3f7b78[_0x3f79('0x10')][_0x3f79('0x12')]);return _0x419aa7(_0x3f7b78[_0x3f79('0x10')][_0x3f79('0x12')]);}else{logger['info'](_0x3f79('0xc'),_0x1e179f,_0x3f79('0xd'));_0x419aa7(_0x3f7b78[_0x3f79('0x13')]['message']);}})[_0x3f79('0x14')](function(_0x4fd564){logger[_0x3f79('0x10')](_0x3f79('0xc'),_0x1e179f,_0x4fd564);_0x42cd04(_0x4fd564);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a67f3fe..38d76d5 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 _0xcbee=['isAuthenticated','index','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1a58ac,_0x2a3cc2){var _0xeac505=function(_0x5be42d){while(--_0x5be42d){_0x1a58ac['push'](_0x1a58ac['shift']());}};_0xeac505(++_0x2a3cc2);}(_0xcbee,0x101));var _0xecbe=function(_0xd55b08,_0x4411b6){_0xd55b08=_0xd55b08-0x0;var _0x1d3093=_0xcbee[_0xd55b08];return _0x1d3093;};'use strict';var multer=require('multer');var util=require(_0xecbe('0x0'));var path=require(_0xecbe('0x1'));var timeout=require('connect-timeout');var express=require(_0xecbe('0x2'));var router=express[_0xecbe('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xecbe('0x4'));var interaction=require(_0xecbe('0x5'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xecbe('0x6')]('/',auth[_0xecbe('0x7')](),controller[_0xecbe('0x8')]);router[_0xecbe('0x6')]('/:id',auth[_0xecbe('0x7')](),controller['show']);router['get'](_0xecbe('0x9'),auth['isAuthenticated'](),controller[_0xecbe('0xa')]);router[_0xecbe('0xb')]('/',auth[_0xecbe('0x7')](),controller[_0xecbe('0xc')]);router[_0xecbe('0xb')](_0xecbe('0x9'),auth[_0xecbe('0x7')](),controller[_0xecbe('0xd')]);router[_0xecbe('0xe')](_0xecbe('0xf'),auth['isAuthenticated'](),controller[_0xecbe('0x10')]);router[_0xecbe('0x11')](_0xecbe('0xf'),auth[_0xecbe('0x7')](),controller[_0xecbe('0x12')]);router[_0xecbe('0x11')](_0xecbe('0x13'),auth[_0xecbe('0x7')](),controller[_0xecbe('0x14')]);module[_0xecbe('0x15')]=router; \ No newline at end of file +var _0x2cf8=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','/:id/sounds','getSounds','post','addSound','delete','destroy','/:id/sounds/:id2','removeSound','exports','util'];(function(_0xab55d,_0x3af3b3){var _0x276d67=function(_0x56c56f){while(--_0x56c56f){_0xab55d['push'](_0xab55d['shift']());}};_0x276d67(++_0x3af3b3);}(_0x2cf8,0xc7));var _0x82cf=function(_0x5811e5,_0x946ee2){_0x5811e5=_0x5811e5-0x0;var _0x1642da=_0x2cf8[_0x5811e5];return _0x1642da;};'use strict';var multer=require('multer');var util=require(_0x82cf('0x0'));var path=require(_0x82cf('0x1'));var timeout=require(_0x82cf('0x2'));var express=require(_0x82cf('0x3'));var router=express[_0x82cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x82cf('0x5'));var interaction=require(_0x82cf('0x6'));var config=require('../../config/environment');var controller=require(_0x82cf('0x7'));router[_0x82cf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x82cf('0x8')](_0x82cf('0x9'),auth[_0x82cf('0xa')](),controller['show']);router[_0x82cf('0x8')](_0x82cf('0xb'),auth[_0x82cf('0xa')](),controller[_0x82cf('0xc')]);router[_0x82cf('0xd')]('/',auth[_0x82cf('0xa')](),controller['create']);router[_0x82cf('0xd')](_0x82cf('0xb'),auth[_0x82cf('0xa')](),controller[_0x82cf('0xe')]);router['put']('/:id',auth[_0x82cf('0xa')](),controller['update']);router[_0x82cf('0xf')](_0x82cf('0x9'),auth[_0x82cf('0xa')](),controller[_0x82cf('0x10')]);router[_0x82cf('0xf')](_0x82cf('0x11'),auth[_0x82cf('0xa')](),controller[_0x82cf('0x12')]);module[_0x82cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a9b6f4c..4665643 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 _0xc77f=['name','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0xa7b046,_0x4e06e4){var _0x16d6fe=function(_0xfc707a){while(--_0xfc707a){_0xa7b046['push'](_0xa7b046['shift']());}};_0x16d6fe(++_0x4e06e4);}(_0xc77f,0xe7));var _0xfc77=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xc77f[_0x26b80e];return _0x84a8a8;};'use strict';var Sequelize=require(_0xfc77('0x0'));module[_0xfc77('0x1')]={'name':{'type':Sequelize[_0xfc77('0x2')],'allowNull':![],'unique':_0xfc77('0x3')},'mode':{'type':Sequelize['ENUM'](_0xfc77('0x4'),_0xfc77('0x5'),_0xfc77('0x6'),_0xfc77('0x7'),_0xfc77('0x8'),_0xfc77('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xfc77('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xfc77('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xfc77('0x2')],'allowNull':!![],'defaultValue':_0xfc77('0xa')},'format':{'type':Sequelize[_0xfc77('0x2')],'allowNull':!![]},'stamp':{'type':_0xfc77('0xb')},'defaultEntry':{'type':Sequelize[_0xfc77('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x66b2=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x3b57b7,_0x17c7ea){var _0x39273f=function(_0x5b995e){while(--_0x5b995e){_0x3b57b7['push'](_0x3b57b7['shift']());}};_0x39273f(++_0x17c7ea);}(_0x66b2,0x1a1));var _0x266b=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x66b2[_0x375492];return _0x18ba5b;};'use strict';var Sequelize=require(_0x266b('0x0'));module[_0x266b('0x1')]={'name':{'type':Sequelize[_0x266b('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x266b('0x3'),_0x266b('0x4'),_0x266b('0x5'),_0x266b('0x6'),_0x266b('0x7'),_0x266b('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x266b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x266b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x266b('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x266b('0x2')],'allowNull':!![],'defaultValue':_0x266b('0x9')},'format':{'type':Sequelize[_0x266b('0x2')],'allowNull':!![]},'stamp':{'type':_0x266b('0xa')},'defaultEntry':{'type':Sequelize[_0x266b('0xb')],'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 30458b7..d933d64 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 _0xa208=['rows','catch','show','includeAll','options','body','find','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','message','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa208,0x1d6));var _0x8a20=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xa208[_0x424a9a];return _0xa7831c;};'use strict';var emlformat=require(_0x8a20('0x0'));var rimraf=require(_0x8a20('0x1'));var zipdir=require(_0x8a20('0x2'));var jsonpatch=require(_0x8a20('0x3'));var rp=require(_0x8a20('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a20('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8a20('0x6'));var ejs=require(_0x8a20('0x7'));var fs=require('fs');var fs_extra=require(_0x8a20('0x8'));var _=require(_0x8a20('0x9'));var squel=require(_0x8a20('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a20('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8a20('0x6'));var querystring=require(_0x8a20('0xc'));var Papa=require(_0x8a20('0xd'));var Redis=require(_0x8a20('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a20('0xf'));var hardwareService=require(_0x8a20('0x10'));var logger=require(_0x8a20('0x11'))('api');var utils=require(_0x8a20('0x12'));var config=require(_0x8a20('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f15cf,_0xddc49b){_0xddc49b=_0xddc49b||0xcc;return function(_0x33e73b){if(_0x33e73b){return _0x1f15cf[_0x8a20('0x14')](_0xddc49b);}return _0x1f15cf[_0x8a20('0x15')](_0xddc49b)[_0x8a20('0x16')]();};}function respondWithResult(_0x3d39db,_0x2d6487){_0x2d6487=_0x2d6487||0xc8;return function(_0x1b909f){if(_0x1b909f){return _0x3d39db[_0x8a20('0x15')](_0x2d6487)['json'](_0x1b909f);}};}function respondWithFilteredResult(_0x3924d8,_0x3987b5){return function(_0x2b496a){if(_0x2b496a){var _0x5a49d3=typeof _0x3987b5['offset']===_0x8a20('0x17')&&typeof _0x3987b5['limit']===_0x8a20('0x17');var _0x4fc83b=_0x2b496a[_0x8a20('0x18')];var _0xe789fa=_0x5a49d3?0x0:_0x3987b5[_0x8a20('0x19')];var _0x364e69=_0x5a49d3?_0x2b496a[_0x8a20('0x18')]:_0x3987b5[_0x8a20('0x19')]+_0x3987b5[_0x8a20('0x1a')];var _0x349723;if(_0x364e69>=_0x4fc83b){_0x364e69=_0x4fc83b;_0x349723=0xc8;}else{_0x349723=0xce;}_0x3924d8[_0x8a20('0x15')](_0x349723);return _0x3924d8['set']('Content-Range',_0xe789fa+'-'+_0x364e69+'/'+_0x4fc83b)[_0x8a20('0x1b')](_0x2b496a);}return null;};}function patchUpdates(_0x1b8cd6){return function(_0x5d35ad){try{jsonpatch[_0x8a20('0x1c')](_0x5d35ad,_0x1b8cd6,!![]);}catch(_0x1f5268){return BPromise[_0x8a20('0x1d')](_0x1f5268);}return _0x5d35ad[_0x8a20('0x1e')]();};}function saveUpdates(_0x4f3de0,_0x15e161){return function(_0x22a999){if(_0x22a999){return _0x22a999[_0x8a20('0x1f')](_0x4f3de0)[_0x8a20('0x20')](function(_0x3275b4){return _0x3275b4;});}return null;};}function removeEntity(_0x7f7e12,_0x108cd8){return function(_0x273dbc){if(_0x273dbc){return _0x273dbc[_0x8a20('0x21')]()[_0x8a20('0x20')](function(){var _0x29b334=_0x273dbc[_0x8a20('0x22')]({'plain':!![]});var _0xdd9f1b=_0x8a20('0x23');return db[_0x8a20('0x24')]['destroy']({'where':{'type':_0xdd9f1b,'resourceId':_0x29b334['id']}})[_0x8a20('0x20')](function(){return _0x273dbc;});})[_0x8a20('0x20')](function(){_0x7f7e12[_0x8a20('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4ab2,_0x265169){return function(_0x5ad1de){if(!_0x5ad1de){_0x3c4ab2['sendStatus'](0x194);}return _0x5ad1de;};}function handleError(_0x329bbd,_0x4f2f70){_0x4f2f70=_0x4f2f70||0x1f4;return function(_0x2afcd7){logger['error'](_0x2afcd7[_0x8a20('0x25')]);if(_0x2afcd7['name']){delete _0x2afcd7[_0x8a20('0x26')];}_0x329bbd[_0x8a20('0x15')](_0x4f2f70)[_0x8a20('0x27')](_0x2afcd7);};}exports['index']=function(_0x5b94fa,_0x3f4fce){var _0x167b0c={},_0x4f8c18={},_0x1caf72={'count':0x0,'rows':[]};var _0x3d5626=_['map'](db[_0x8a20('0x28')][_0x8a20('0x29')],function(_0x30710d){return{'name':_0x30710d[_0x8a20('0x2a')],'type':_0x30710d[_0x8a20('0x2b')][_0x8a20('0x2c')]};});_0x4f8c18[_0x8a20('0x2d')]=_['map'](_0x3d5626,_0x8a20('0x26'));_0x4f8c18[_0x8a20('0x2e')]=_[_0x8a20('0x2f')](_0x5b94fa[_0x8a20('0x2e')]);_0x4f8c18[_0x8a20('0x30')]=_[_0x8a20('0x31')](_0x4f8c18[_0x8a20('0x2d')],_0x4f8c18[_0x8a20('0x2e')]);_0x167b0c[_0x8a20('0x32')]=_[_0x8a20('0x31')](_0x4f8c18[_0x8a20('0x2d')],qs[_0x8a20('0x33')](_0x5b94fa[_0x8a20('0x2e')]['fields']));_0x167b0c[_0x8a20('0x32')]=_0x167b0c['attributes'][_0x8a20('0x34')]?_0x167b0c['attributes']:_0x4f8c18[_0x8a20('0x2d')];if(!_0x5b94fa[_0x8a20('0x2e')][_0x8a20('0x35')](_0x8a20('0x36'))){_0x167b0c[_0x8a20('0x1a')]=qs[_0x8a20('0x1a')](_0x5b94fa[_0x8a20('0x2e')][_0x8a20('0x1a')]);_0x167b0c[_0x8a20('0x19')]=qs['offset'](_0x5b94fa[_0x8a20('0x2e')]['offset']);}_0x167b0c[_0x8a20('0x37')]=qs[_0x8a20('0x38')](_0x5b94fa['query'][_0x8a20('0x38')]);delete _0x5b94fa['query'][_0x8a20('0x38')];_0x167b0c[_0x8a20('0x39')]=qs[_0x8a20('0x30')](_[_0x8a20('0x3a')](_0x5b94fa[_0x8a20('0x2e')],_0x4f8c18[_0x8a20('0x30')]),_0x3d5626);if(_0x5b94fa[_0x8a20('0x2e')][_0x8a20('0x3b')]){_0x167b0c[_0x8a20('0x39')]=_[_0x8a20('0x3c')](_0x167b0c['where'],{'$or':_[_0x8a20('0x3d')](_0x3d5626,function(_0x37c1c7){if(_0x37c1c7[_0x8a20('0x2b')]!==_0x8a20('0x3e')){var _0x46b919={};_0x46b919[_0x37c1c7[_0x8a20('0x26')]]={'$like':'%'+_0x5b94fa['query'][_0x8a20('0x3b')]+'%'};return _0x46b919;}})});}_0x167b0c=_[_0x8a20('0x3c')]({},_0x167b0c,_0x5b94fa['options']);var _0x337ccf={'where':_0x167b0c[_0x8a20('0x39')]};return db[_0x8a20('0x28')][_0x8a20('0x18')](_0x337ccf)[_0x8a20('0x20')](function(_0x345efc){_0x1caf72[_0x8a20('0x18')]=_0x345efc;if(_0x5b94fa[_0x8a20('0x2e')]['includeAll']){_0x167b0c[_0x8a20('0x3f')]=[{'all':!![]}];}return db[_0x8a20('0x28')][_0x8a20('0x40')](_0x167b0c);})[_0x8a20('0x20')](function(_0x50b3f5){_0x1caf72[_0x8a20('0x41')]=_0x50b3f5;return _0x1caf72;})['then'](respondWithFilteredResult(_0x3f4fce,_0x167b0c))[_0x8a20('0x42')](handleError(_0x3f4fce,null));};exports[_0x8a20('0x43')]=function(_0x5598df,_0x33a5df){var _0x1ff5cc={'raw':![],'where':{'id':_0x5598df['params']['id']}},_0x3deb2b={};_0x3deb2b[_0x8a20('0x2d')]=_['keys'](db[_0x8a20('0x28')][_0x8a20('0x29')]);_0x3deb2b[_0x8a20('0x2e')]=_[_0x8a20('0x2f')](_0x5598df[_0x8a20('0x2e')]);_0x3deb2b[_0x8a20('0x30')]=_[_0x8a20('0x31')](_0x3deb2b[_0x8a20('0x2d')],_0x3deb2b[_0x8a20('0x2e')]);_0x1ff5cc[_0x8a20('0x32')]=_[_0x8a20('0x31')](_0x3deb2b[_0x8a20('0x2d')],qs[_0x8a20('0x33')](_0x5598df[_0x8a20('0x2e')][_0x8a20('0x33')]));_0x1ff5cc[_0x8a20('0x32')]=_0x1ff5cc[_0x8a20('0x32')]['length']?_0x1ff5cc[_0x8a20('0x32')]:_0x3deb2b[_0x8a20('0x2d')];if(_0x5598df[_0x8a20('0x2e')][_0x8a20('0x44')]){_0x1ff5cc[_0x8a20('0x3f')]=[{'all':!![]}];}_0x1ff5cc=_[_0x8a20('0x3c')]({},_0x1ff5cc,_0x5598df[_0x8a20('0x45')]);return db[_0x8a20('0x28')]['find'](_0x1ff5cc)[_0x8a20('0x20')](handleEntityNotFound(_0x33a5df,null))[_0x8a20('0x20')](respondWithResult(_0x33a5df,null))['catch'](handleError(_0x33a5df,null));};exports[_0x8a20('0x1f')]=function(_0x4a500a,_0x141956){if(_0x4a500a['body']['id']){delete _0x4a500a[_0x8a20('0x46')]['id'];}return db['VoiceMusicOnHold'][_0x8a20('0x47')]({'where':{'id':_0x4a500a['params']['id']}})[_0x8a20('0x20')](handleEntityNotFound(_0x141956,null))[_0x8a20('0x20')](saveUpdates(_0x4a500a['body'],null))['then'](respondWithResult(_0x141956,null))[_0x8a20('0x42')](handleError(_0x141956,null));};exports[_0x8a20('0x48')]=function(_0x3b059b,_0x3699d6,_0x3fa9bc){return db[_0x8a20('0x49')][_0x8a20('0x4a')](function(_0x487a35){if(_0x3b059b[_0x8a20('0x46')][_0x8a20('0x4b')]==='files'){_0x3b059b[_0x8a20('0x46')][_0x8a20('0x4c')]=path[_0x8a20('0x4d')](config[_0x8a20('0x4e')],_0x8a20('0x4f'),_0x3b059b[_0x8a20('0x46')][_0x8a20('0x26')]);}return db[_0x8a20('0x28')]['create'](_0x3b059b[_0x8a20('0x46')],{'transaction':_0x487a35})['then'](function(_0x3ef03c){if(_0x3b059b[_0x8a20('0x46')][_0x8a20('0x4b')]===_0x8a20('0x50')){fs[_0x8a20('0x51')](_0x3ef03c['directory'],parseInt(_0x8a20('0x52'),0x8));}var _0xef66da=_0x3b059b['user'][_0x8a20('0x22')]({'plain':!![]});if(!_0xef66da)throw new Error(_0x8a20('0x53'));if(_0xef66da['role']==='user'){var _0x418b0b=_0x3ef03c['get']({'plain':!![]});return db['UserProfileSection'][_0x8a20('0x47')]({'where':{'name':_0x8a20('0x23'),'userProfileId':_0xef66da['userProfileId']},'raw':!![]})['then'](function(_0x5da5aa){if(_0x5da5aa&&_0x5da5aa[_0x8a20('0x54')]===0x0){return db['UserProfileResource'][_0x8a20('0x48')]({'name':_0x418b0b[_0x8a20('0x26')],'resourceId':_0x418b0b['id'],'type':_0x5da5aa[_0x8a20('0x26')],'sectionId':_0x5da5aa['id']},{})[_0x8a20('0x20')](function(){return _0x3ef03c;});}else{return _0x3ef03c;}})[_0x8a20('0x42')](function(_0x22971a){logger[_0x8a20('0x55')](_0x8a20('0x56'),_0x22971a);});}return _0x3ef03c;});})[_0x8a20('0x20')](respondWithResult(_0x3699d6,0xc9))[_0x8a20('0x42')](handleError(_0x3699d6,null));};exports[_0x8a20('0x21')]=function(_0x438ccf,_0x1f2a67,_0x48ea12){var _0x1cea9b;return db[_0x8a20('0x28')][_0x8a20('0x47')]({'where':{'id':_0x438ccf[_0x8a20('0x57')]['id']}})[_0x8a20('0x20')](function(_0x1e06d0){if(_0x1e06d0){return db[_0x8a20('0x49')][_0x8a20('0x4a')](function(_0x450496){return _0x1e06d0['destroy']({'transaction':_0x450496,'raw':!![]})[_0x8a20('0x20')](function(_0x46da94){if(_0x46da94[_0x8a20('0x4c')]){fs[_0x8a20('0x58')](_0x46da94[_0x8a20('0x4c')])['forEach'](function(_0x3dab23){fs['unlinkSync'](path[_0x8a20('0x4d')](_0x46da94[_0x8a20('0x4c')],_0x3dab23));});fs['rmdirSync'](_0x46da94['directory']);}return _0x46da94;});})[_0x8a20('0x42')](function(_0x3a46d3){throw new db[(_0x8a20('0x59'))][(_0x8a20('0x5a'))](_0x3a46d3['message']);});}})['then'](handleEntityNotFound(_0x1f2a67,null))['then'](removeEntity(_0x1f2a67,null))[_0x8a20('0x42')](handleError(_0x1f2a67,null));};exports[_0x8a20('0x5b')]=function(_0x1ce47e,_0x2edb7b,_0xdaf333){return db[_0x8a20('0x49')]['transaction'](function(_0x213d57){var _0xd39d6d;return db[_0x8a20('0x28')][_0x8a20('0x47')]({'where':{'id':_0x1ce47e[_0x8a20('0x57')]['id']}})['then'](function(_0x1b8e43){if(_0x1b8e43){_0xd39d6d=_0x1b8e43;return _0x1b8e43[_0x8a20('0x5b')](_0x1ce47e[_0x8a20('0x46')]['id'],{'transaction':_0x213d57});}})[_0x8a20('0x20')](function(_0x2a9953){if(_0x2a9953){return db[_0x8a20('0x5c')][_0x8a20('0x5d')]({'where':{'id':_0x1ce47e[_0x8a20('0x46')]['id']},'attributes':['id',_0x8a20('0x26'),_0x8a20('0x5e'),'converted_format',_0x8a20('0x5f')],'raw':!![]});}})[_0x8a20('0x20')](function(_0x23df34){if(_0x23df34){var _0x1cfb12=path[_0x8a20('0x4d')](config[_0x8a20('0x4e')],_0x8a20('0x60'),util[_0x8a20('0x61')](_0x8a20('0x62'),path[_0x8a20('0x63')](_0x23df34[_0x8a20('0x5e')],path[_0x8a20('0x64')](_0x23df34['save_name'])),_0x23df34[_0x8a20('0x65')]));var _0x56827c=path[_0x8a20('0x4d')](config[_0x8a20('0x4e')],_0x8a20('0x4f'),_0xd39d6d[_0x8a20('0x26')],util[_0x8a20('0x61')]('%s.%s',_0x23df34[_0x8a20('0x26')],_0x23df34[_0x8a20('0x65')]));fs['symlinkSync'](_0x1cfb12,_0x56827c);return _0x23df34;}})[_0x8a20('0x42')](function(_0x56b803){throw new db[(_0x8a20('0x59'))][(_0x8a20('0x5a'))](_0x56b803[_0x8a20('0x66')]);});})['then'](handleEntityNotFound(_0x2edb7b,null))['then'](respondWithResult(_0x2edb7b,0xc9))[_0x8a20('0x42')](handleError(_0x2edb7b,null));};exports[_0x8a20('0x67')]=function(_0x35f3ce,_0x1d207c,_0xed9756){return db['sequelize'][_0x8a20('0x4a')](function(_0x3d8ff1){var _0x8e1c68;return db[_0x8a20('0x28')][_0x8a20('0x5d')]({'where':{'id':_0x35f3ce['params']['id']}})[_0x8a20('0x20')](handleEntityNotFound(_0x1d207c,null))[_0x8a20('0x20')](function(_0x148da8){if(_0x148da8){_0x8e1c68=_0x148da8;return _0x148da8[_0x8a20('0x67')](_0x35f3ce[_0x8a20('0x57')][_0x8a20('0x68')]);}})[_0x8a20('0x20')](function(_0x58a691){if(_0x58a691){return db[_0x8a20('0x5c')]['findOne']({'where':{'id':_0x35f3ce['params'][_0x8a20('0x68')]},'attributes':['id',_0x8a20('0x26'),_0x8a20('0x5e'),_0x8a20('0x65'),_0x8a20('0x5f')],'raw':!![]});}})[_0x8a20('0x20')](function(_0xf702fb){if(_0xf702fb){fs[_0x8a20('0x69')](path[_0x8a20('0x4d')](_0x8e1c68['directory'],util[_0x8a20('0x61')](_0x8a20('0x62'),_0xf702fb[_0x8a20('0x26')],_0xf702fb[_0x8a20('0x65')])));return _0xf702fb;}})[_0x8a20('0x42')](function(_0xfd8ae0){throw new db[(_0x8a20('0x59'))][(_0x8a20('0x5a'))](_0xfd8ae0[_0x8a20('0x66')]);});})[_0x8a20('0x20')](handleEntityNotFound(_0x1d207c,null))['then'](respondWithStatusCode(_0x1d207c,0xcc))[_0x8a20('0x42')](handleError(_0x1d207c,null));};exports[_0x8a20('0x6a')]=function(_0x2df934,_0x4635c9,_0x34a7e0){var _0x1c37c7={};var _0x2b41e8={};var _0x16c60c;var _0x1c99c1;return db[_0x8a20('0x28')][_0x8a20('0x5d')]({'where':{'id':_0x2df934[_0x8a20('0x57')]['id']}})['then'](handleEntityNotFound(_0x4635c9,null))['then'](function(_0x2a34fc){if(_0x2a34fc){_0x16c60c=_0x2a34fc;_0x2b41e8[_0x8a20('0x2d')]=_[_0x8a20('0x2f')](db[_0x8a20('0x5c')][_0x8a20('0x29')]);_0x2b41e8['query']=_[_0x8a20('0x2f')](_0x2df934['query']);_0x2b41e8[_0x8a20('0x30')]=_[_0x8a20('0x31')](_0x2b41e8[_0x8a20('0x2d')],_0x2b41e8[_0x8a20('0x2e')]);_0x1c37c7[_0x8a20('0x32')]=_[_0x8a20('0x31')](_0x2b41e8['model'],qs[_0x8a20('0x33')](_0x2df934['query'][_0x8a20('0x33')]));_0x1c37c7[_0x8a20('0x32')]=_0x1c37c7[_0x8a20('0x32')][_0x8a20('0x34')]?_0x1c37c7[_0x8a20('0x32')]:_0x2b41e8[_0x8a20('0x2d')];_0x1c37c7[_0x8a20('0x37')]=qs[_0x8a20('0x38')](_0x2df934['query'][_0x8a20('0x38')]);_0x1c37c7[_0x8a20('0x39')]=qs['filters'](_[_0x8a20('0x3a')](_0x2df934[_0x8a20('0x2e')],_0x2b41e8[_0x8a20('0x30')]));if(_0x2df934[_0x8a20('0x2e')]['filter']){_0x1c37c7[_0x8a20('0x39')]=_[_0x8a20('0x3c')](_0x1c37c7[_0x8a20('0x39')],{'$or':_['map'](_0x1c37c7[_0x8a20('0x32')],function(_0x53e842){var _0x350322={};_0x350322[_0x53e842]={'$like':'%'+_0x2df934['query'][_0x8a20('0x3b')]+'%'};return _0x350322;})});}_0x1c37c7=_['merge']({},_0x1c37c7,_0x2df934[_0x8a20('0x45')]);return _0x16c60c[_0x8a20('0x6a')](_0x1c37c7);}})[_0x8a20('0x20')](function(_0x1af4a8){if(_0x1af4a8){_0x1c99c1=_0x1af4a8[_0x8a20('0x34')];if(!_0x2df934[_0x8a20('0x2e')][_0x8a20('0x35')](_0x8a20('0x36'))){_0x1c37c7[_0x8a20('0x1a')]=qs[_0x8a20('0x1a')](_0x2df934['query'][_0x8a20('0x1a')]);_0x1c37c7['offset']=qs['offset'](_0x2df934[_0x8a20('0x2e')][_0x8a20('0x19')]);}return _0x16c60c[_0x8a20('0x6a')](_0x1c37c7);}})[_0x8a20('0x20')](function(_0xb9f816){if(_0xb9f816){return _0xb9f816?{'count':_0x1c99c1,'rows':_0xb9f816}:null;}})['then'](respondWithResult(_0x4635c9,null))['catch'](handleError(_0x4635c9,null));}; \ No newline at end of file +var _0xf058=['0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','readdirSync','forEach','unlinkSync','join','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','basename','%s.%s','symlinkSync','removeSound','id2','createdAt','getSounds','pick','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','update','body','sequelize','transaction','files','directory','root','server/files/moh','create','mode','mkdirSync'];(function(_0x10619c,_0x34fe90){var _0x33f8ed=function(_0x18838b){while(--_0x18838b){_0x10619c['push'](_0x10619c['shift']());}};_0x33f8ed(++_0x34fe90);}(_0xf058,0x102));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8f05('0x0'));var rimraf=require(_0x8f05('0x1'));var zipdir=require(_0x8f05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f05('0x3'));var moment=require('moment');var BPromise=require(_0x8f05('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f05('0x5'));var sox=require('sox');var csv=require(_0x8f05('0x6'));var ejs=require(_0x8f05('0x7'));var fs=require('fs');var fs_extra=require(_0x8f05('0x8'));var _=require(_0x8f05('0x9'));var squel=require('squel');var crypto=require(_0x8f05('0xa'));var jsforce=require(_0x8f05('0xb'));var deskjs=require(_0x8f05('0xc'));var toCsv=require(_0x8f05('0x6'));var querystring=require(_0x8f05('0xd'));var Papa=require(_0x8f05('0xe'));var Redis=require('ioredis');var authService=require(_0x8f05('0xf'));var qs=require(_0x8f05('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f05('0x11'));var logger=require('../../config/logger')(_0x8f05('0x12'));var utils=require('../../config/utils');var config=require(_0x8f05('0x13'));var licenseUtil=require(_0x8f05('0x14'));var db=require(_0x8f05('0x15'))['db'];function respondWithStatusCode(_0x4d6273,_0x574ef9){_0x574ef9=_0x574ef9||0xcc;return function(_0x5cffe5){if(_0x5cffe5){return _0x4d6273[_0x8f05('0x16')](_0x574ef9);}return _0x4d6273[_0x8f05('0x17')](_0x574ef9)[_0x8f05('0x18')]();};}function respondWithResult(_0xddc2de,_0x52f2c1){_0x52f2c1=_0x52f2c1||0xc8;return function(_0x156ffa){if(_0x156ffa){return _0xddc2de[_0x8f05('0x17')](_0x52f2c1)[_0x8f05('0x19')](_0x156ffa);}};}function respondWithFilteredResult(_0x462f5c,_0x44be42){return function(_0x39a6c9){if(_0x39a6c9){var _0x49a3cf=typeof _0x44be42[_0x8f05('0x1a')]===_0x8f05('0x1b')&&typeof _0x44be42['limit']===_0x8f05('0x1b');var _0x1b3c66=_0x39a6c9[_0x8f05('0x1c')];var _0xc2fdfc=_0x49a3cf?0x0:_0x44be42[_0x8f05('0x1a')];var _0xd06d95=_0x49a3cf?_0x39a6c9['count']:_0x44be42[_0x8f05('0x1a')]+_0x44be42[_0x8f05('0x1d')];var _0x39de3c;if(_0xd06d95>=_0x1b3c66){_0xd06d95=_0x1b3c66;_0x39de3c=0xc8;}else{_0x39de3c=0xce;}_0x462f5c[_0x8f05('0x17')](_0x39de3c);return _0x462f5c[_0x8f05('0x1e')]('Content-Range',_0xc2fdfc+'-'+_0xd06d95+'/'+_0x1b3c66)['json'](_0x39a6c9);}return null;};}function patchUpdates(_0x5e3821){return function(_0x2fc409){try{jsonpatch[_0x8f05('0x1f')](_0x2fc409,_0x5e3821,!![]);}catch(_0x32b8fd){return BPromise[_0x8f05('0x20')](_0x32b8fd);}return _0x2fc409[_0x8f05('0x21')]();};}function saveUpdates(_0x2c0987,_0x3d460d){return function(_0x5f2031){if(_0x5f2031){return _0x5f2031['update'](_0x2c0987)['then'](function(_0x2b2178){return _0x2b2178;});}return null;};}function removeEntity(_0x4fb9a1,_0x58d2bc){return function(_0x1e6dd2){if(_0x1e6dd2){return _0x1e6dd2['destroy']()[_0x8f05('0x22')](function(){var _0x530ef5=_0x1e6dd2[_0x8f05('0x23')]({'plain':!![]});var _0xe89426=_0x8f05('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xe89426,'resourceId':_0x530ef5['id']}})[_0x8f05('0x22')](function(){return _0x1e6dd2;});})[_0x8f05('0x22')](function(){_0x4fb9a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e175,_0x385402){return function(_0x5948e0){if(!_0x5948e0){_0x52e175['sendStatus'](0x194);}return _0x5948e0;};}function handleError(_0x1a32d4,_0x5da08d){_0x5da08d=_0x5da08d||0x1f4;return function(_0x15199c){logger[_0x8f05('0x25')](_0x15199c[_0x8f05('0x26')]);if(_0x15199c['name']){delete _0x15199c[_0x8f05('0x27')];}_0x1a32d4[_0x8f05('0x17')](_0x5da08d)[_0x8f05('0x28')](_0x15199c);};}exports[_0x8f05('0x29')]=function(_0x24af4a,_0x3aaada){var _0x20e320={},_0x16ccdd={},_0x2babfd={'count':0x0,'rows':[]};var _0x4dd9ac=_[_0x8f05('0x2a')](db[_0x8f05('0x2b')]['rawAttributes'],function(_0x651b03){return{'name':_0x651b03[_0x8f05('0x2c')],'type':_0x651b03['type'][_0x8f05('0x2d')]};});_0x16ccdd['model']=_[_0x8f05('0x2a')](_0x4dd9ac,_0x8f05('0x27'));_0x16ccdd['query']=_[_0x8f05('0x2e')](_0x24af4a[_0x8f05('0x2f')]);_0x16ccdd[_0x8f05('0x30')]=_[_0x8f05('0x31')](_0x16ccdd[_0x8f05('0x32')],_0x16ccdd['query']);_0x20e320[_0x8f05('0x33')]=_[_0x8f05('0x31')](_0x16ccdd['model'],qs[_0x8f05('0x34')](_0x24af4a[_0x8f05('0x2f')]['fields']));_0x20e320['attributes']=_0x20e320[_0x8f05('0x33')][_0x8f05('0x35')]?_0x20e320[_0x8f05('0x33')]:_0x16ccdd[_0x8f05('0x32')];if(!_0x24af4a[_0x8f05('0x2f')][_0x8f05('0x36')]('nolimit')){_0x20e320['limit']=qs[_0x8f05('0x1d')](_0x24af4a[_0x8f05('0x2f')][_0x8f05('0x1d')]);_0x20e320[_0x8f05('0x1a')]=qs[_0x8f05('0x1a')](_0x24af4a['query'][_0x8f05('0x1a')]);}_0x20e320['order']=qs[_0x8f05('0x37')](_0x24af4a[_0x8f05('0x2f')][_0x8f05('0x37')]);delete _0x24af4a[_0x8f05('0x2f')][_0x8f05('0x37')];_0x20e320['where']=qs[_0x8f05('0x30')](_['pick'](_0x24af4a[_0x8f05('0x2f')],_0x16ccdd[_0x8f05('0x30')]),_0x4dd9ac);if(_0x24af4a[_0x8f05('0x2f')]['filter']){_0x20e320[_0x8f05('0x38')]=_[_0x8f05('0x39')](_0x20e320[_0x8f05('0x38')],{'$or':_[_0x8f05('0x2a')](_0x4dd9ac,function(_0x28fa74){if(_0x28fa74[_0x8f05('0x3a')]!==_0x8f05('0x3b')){var _0xae026c={};_0xae026c[_0x28fa74['name']]={'$like':'%'+_0x24af4a[_0x8f05('0x2f')][_0x8f05('0x3c')]+'%'};return _0xae026c;}})});}_0x20e320=_[_0x8f05('0x39')]({},_0x20e320,_0x24af4a[_0x8f05('0x3d')]);var _0x345182={'where':_0x20e320[_0x8f05('0x38')]};return db[_0x8f05('0x2b')]['count'](_0x345182)[_0x8f05('0x22')](function(_0x123f89){_0x2babfd[_0x8f05('0x1c')]=_0x123f89;if(_0x24af4a['query'][_0x8f05('0x3e')]){_0x20e320[_0x8f05('0x3f')]=[{'all':!![]}];}return db[_0x8f05('0x2b')][_0x8f05('0x40')](_0x20e320);})[_0x8f05('0x22')](function(_0x5702e9){_0x2babfd[_0x8f05('0x41')]=_0x5702e9;return _0x2babfd;})['then'](respondWithFilteredResult(_0x3aaada,_0x20e320))[_0x8f05('0x42')](handleError(_0x3aaada,null));};exports['show']=function(_0x2cd53f,_0x534d01){var _0x2edee1={'raw':![],'where':{'id':_0x2cd53f[_0x8f05('0x43')]['id']}},_0x3f06e3={};_0x3f06e3[_0x8f05('0x32')]=_['keys'](db[_0x8f05('0x2b')][_0x8f05('0x44')]);_0x3f06e3[_0x8f05('0x2f')]=_[_0x8f05('0x2e')](_0x2cd53f['query']);_0x3f06e3[_0x8f05('0x30')]=_[_0x8f05('0x31')](_0x3f06e3['model'],_0x3f06e3[_0x8f05('0x2f')]);_0x2edee1[_0x8f05('0x33')]=_[_0x8f05('0x31')](_0x3f06e3[_0x8f05('0x32')],qs[_0x8f05('0x34')](_0x2cd53f[_0x8f05('0x2f')]['fields']));_0x2edee1[_0x8f05('0x33')]=_0x2edee1['attributes'][_0x8f05('0x35')]?_0x2edee1[_0x8f05('0x33')]:_0x3f06e3[_0x8f05('0x32')];if(_0x2cd53f['query']['includeAll']){_0x2edee1[_0x8f05('0x3f')]=[{'all':!![]}];}_0x2edee1=_['merge']({},_0x2edee1,_0x2cd53f[_0x8f05('0x3d')]);return db['VoiceMusicOnHold'][_0x8f05('0x45')](_0x2edee1)[_0x8f05('0x22')](handleEntityNotFound(_0x534d01,null))[_0x8f05('0x22')](respondWithResult(_0x534d01,null))[_0x8f05('0x42')](handleError(_0x534d01,null));};exports[_0x8f05('0x46')]=function(_0x47ab62,_0x1959c8){if(_0x47ab62['body']['id']){delete _0x47ab62['body']['id'];}return db[_0x8f05('0x2b')][_0x8f05('0x45')]({'where':{'id':_0x47ab62[_0x8f05('0x43')]['id']}})[_0x8f05('0x22')](handleEntityNotFound(_0x1959c8,null))[_0x8f05('0x22')](saveUpdates(_0x47ab62[_0x8f05('0x47')],null))[_0x8f05('0x22')](respondWithResult(_0x1959c8,null))[_0x8f05('0x42')](handleError(_0x1959c8,null));};exports['create']=function(_0x1ce6b9,_0x832a95,_0x5c920b){return db[_0x8f05('0x48')][_0x8f05('0x49')](function(_0x5e89d4){if(_0x1ce6b9[_0x8f05('0x47')]['mode']===_0x8f05('0x4a')){_0x1ce6b9[_0x8f05('0x47')][_0x8f05('0x4b')]=path['join'](config[_0x8f05('0x4c')],_0x8f05('0x4d'),_0x1ce6b9[_0x8f05('0x47')][_0x8f05('0x27')]);}return db[_0x8f05('0x2b')][_0x8f05('0x4e')](_0x1ce6b9[_0x8f05('0x47')],{'transaction':_0x5e89d4})['then'](function(_0xcabc13){if(_0x1ce6b9[_0x8f05('0x47')][_0x8f05('0x4f')]===_0x8f05('0x4a')){fs[_0x8f05('0x50')](_0xcabc13[_0x8f05('0x4b')],parseInt(_0x8f05('0x51'),0x8));}var _0x2910b6=_0x1ce6b9[_0x8f05('0x52')]['get']({'plain':!![]});if(!_0x2910b6)throw new Error(_0x8f05('0x53'));if(_0x2910b6[_0x8f05('0x54')]===_0x8f05('0x52')){var _0x523279=_0xcabc13[_0x8f05('0x23')]({'plain':!![]});return db[_0x8f05('0x55')][_0x8f05('0x45')]({'where':{'name':_0x8f05('0x24'),'userProfileId':_0x2910b6[_0x8f05('0x56')]},'raw':!![]})['then'](function(_0x1ceca6){if(_0x1ceca6&&_0x1ceca6[_0x8f05('0x57')]===0x0){return db[_0x8f05('0x58')][_0x8f05('0x4e')]({'name':_0x523279[_0x8f05('0x27')],'resourceId':_0x523279['id'],'type':_0x1ceca6[_0x8f05('0x27')],'sectionId':_0x1ceca6['id']},{})[_0x8f05('0x22')](function(){return _0xcabc13;});}else{return _0xcabc13;}})[_0x8f05('0x42')](function(_0x28b1a4){logger[_0x8f05('0x25')](_0x8f05('0x59'),_0x28b1a4);});}return _0xcabc13;});})[_0x8f05('0x22')](respondWithResult(_0x832a95,0xc9))['catch'](handleError(_0x832a95,null));};exports[_0x8f05('0x5a')]=function(_0x14034c,_0x266229,_0x3d70e4){var _0x504278;return db[_0x8f05('0x2b')]['find']({'where':{'id':_0x14034c[_0x8f05('0x43')]['id']}})['then'](function(_0x461bcb){if(_0x461bcb){return db[_0x8f05('0x48')][_0x8f05('0x49')](function(_0x5b3d1b){return _0x461bcb['destroy']({'transaction':_0x5b3d1b,'raw':!![]})['then'](function(_0x425369){if(_0x425369[_0x8f05('0x4b')]){fs[_0x8f05('0x5b')](_0x425369['directory'])[_0x8f05('0x5c')](function(_0xb60e03){fs[_0x8f05('0x5d')](path[_0x8f05('0x5e')](_0x425369['directory'],_0xb60e03));});fs['rmdirSync'](_0x425369[_0x8f05('0x4b')]);}return _0x425369;});})[_0x8f05('0x42')](function(_0x250d8c){throw new db[(_0x8f05('0x5f'))][(_0x8f05('0x60'))](_0x250d8c[_0x8f05('0x61')]);});}})[_0x8f05('0x22')](handleEntityNotFound(_0x266229,null))[_0x8f05('0x22')](removeEntity(_0x266229,null))[_0x8f05('0x42')](handleError(_0x266229,null));};exports[_0x8f05('0x62')]=function(_0x434a24,_0x31ee0d,_0x5c3635){return db['sequelize'][_0x8f05('0x49')](function(_0x165980){var _0x16af0e;return db[_0x8f05('0x2b')][_0x8f05('0x45')]({'where':{'id':_0x434a24[_0x8f05('0x43')]['id']}})[_0x8f05('0x22')](function(_0x320cc0){if(_0x320cc0){_0x16af0e=_0x320cc0;return _0x320cc0[_0x8f05('0x62')](_0x434a24[_0x8f05('0x47')]['id'],{'transaction':_0x165980});}})[_0x8f05('0x22')](function(_0x415760){if(_0x415760){return db[_0x8f05('0x63')][_0x8f05('0x64')]({'where':{'id':_0x434a24[_0x8f05('0x47')]['id']},'attributes':['id',_0x8f05('0x27'),_0x8f05('0x65'),_0x8f05('0x66'),'createdAt'],'raw':!![]});}})['then'](function(_0x2df738){if(_0x2df738){var _0x21ae13=path[_0x8f05('0x5e')](config['root'],_0x8f05('0x67'),util[_0x8f05('0x68')]('%s.%s',path[_0x8f05('0x69')](_0x2df738[_0x8f05('0x65')],path['extname'](_0x2df738[_0x8f05('0x65')])),_0x2df738[_0x8f05('0x66')]));var _0x510cb5=path[_0x8f05('0x5e')](config[_0x8f05('0x4c')],_0x8f05('0x4d'),_0x16af0e['name'],util[_0x8f05('0x68')](_0x8f05('0x6a'),_0x2df738[_0x8f05('0x27')],_0x2df738[_0x8f05('0x66')]));fs[_0x8f05('0x6b')](_0x21ae13,_0x510cb5);return _0x2df738;}})['catch'](function(_0x2e2d93){throw new db[(_0x8f05('0x5f'))][(_0x8f05('0x60'))](_0x2e2d93[_0x8f05('0x61')]);});})[_0x8f05('0x22')](handleEntityNotFound(_0x31ee0d,null))[_0x8f05('0x22')](respondWithResult(_0x31ee0d,0xc9))[_0x8f05('0x42')](handleError(_0x31ee0d,null));};exports['removeSound']=function(_0xe06325,_0x5ded81,_0xb6e97a){return db[_0x8f05('0x48')][_0x8f05('0x49')](function(_0x41e323){var _0x277770;return db[_0x8f05('0x2b')][_0x8f05('0x64')]({'where':{'id':_0xe06325[_0x8f05('0x43')]['id']}})[_0x8f05('0x22')](handleEntityNotFound(_0x5ded81,null))[_0x8f05('0x22')](function(_0x279926){if(_0x279926){_0x277770=_0x279926;return _0x279926[_0x8f05('0x6c')](_0xe06325[_0x8f05('0x43')][_0x8f05('0x6d')]);}})[_0x8f05('0x22')](function(_0x3fbe6c){if(_0x3fbe6c){return db[_0x8f05('0x63')][_0x8f05('0x64')]({'where':{'id':_0xe06325[_0x8f05('0x43')][_0x8f05('0x6d')]},'attributes':['id',_0x8f05('0x27'),'save_name',_0x8f05('0x66'),_0x8f05('0x6e')],'raw':!![]});}})[_0x8f05('0x22')](function(_0x11b641){if(_0x11b641){fs[_0x8f05('0x5d')](path[_0x8f05('0x5e')](_0x277770['directory'],util['format'](_0x8f05('0x6a'),_0x11b641[_0x8f05('0x27')],_0x11b641[_0x8f05('0x66')])));return _0x11b641;}})[_0x8f05('0x42')](function(_0x1430cf){throw new db['Sequelize'][(_0x8f05('0x60'))](_0x1430cf[_0x8f05('0x61')]);});})['then'](handleEntityNotFound(_0x5ded81,null))[_0x8f05('0x22')](respondWithStatusCode(_0x5ded81,0xcc))[_0x8f05('0x42')](handleError(_0x5ded81,null));};exports[_0x8f05('0x6f')]=function(_0x7dae4a,_0x2317a0,_0x422d48){var _0x5bd94d={};var _0x6b0064={};var _0x5ea4e0;var _0x11d36a;return db[_0x8f05('0x2b')][_0x8f05('0x64')]({'where':{'id':_0x7dae4a[_0x8f05('0x43')]['id']}})[_0x8f05('0x22')](handleEntityNotFound(_0x2317a0,null))[_0x8f05('0x22')](function(_0x290329){if(_0x290329){_0x5ea4e0=_0x290329;_0x6b0064['model']=_[_0x8f05('0x2e')](db['Sound']['rawAttributes']);_0x6b0064[_0x8f05('0x2f')]=_[_0x8f05('0x2e')](_0x7dae4a[_0x8f05('0x2f')]);_0x6b0064['filters']=_[_0x8f05('0x31')](_0x6b0064['model'],_0x6b0064[_0x8f05('0x2f')]);_0x5bd94d[_0x8f05('0x33')]=_['intersection'](_0x6b0064[_0x8f05('0x32')],qs['fields'](_0x7dae4a[_0x8f05('0x2f')][_0x8f05('0x34')]));_0x5bd94d['attributes']=_0x5bd94d[_0x8f05('0x33')][_0x8f05('0x35')]?_0x5bd94d[_0x8f05('0x33')]:_0x6b0064[_0x8f05('0x32')];_0x5bd94d['order']=qs['sort'](_0x7dae4a[_0x8f05('0x2f')][_0x8f05('0x37')]);_0x5bd94d[_0x8f05('0x38')]=qs['filters'](_[_0x8f05('0x70')](_0x7dae4a[_0x8f05('0x2f')],_0x6b0064[_0x8f05('0x30')]));if(_0x7dae4a['query'][_0x8f05('0x3c')]){_0x5bd94d[_0x8f05('0x38')]=_[_0x8f05('0x39')](_0x5bd94d[_0x8f05('0x38')],{'$or':_[_0x8f05('0x2a')](_0x5bd94d[_0x8f05('0x33')],function(_0x38b69c){var _0x4d7248={};_0x4d7248[_0x38b69c]={'$like':'%'+_0x7dae4a[_0x8f05('0x2f')][_0x8f05('0x3c')]+'%'};return _0x4d7248;})});}_0x5bd94d=_[_0x8f05('0x39')]({},_0x5bd94d,_0x7dae4a[_0x8f05('0x3d')]);return _0x5ea4e0[_0x8f05('0x6f')](_0x5bd94d);}})[_0x8f05('0x22')](function(_0x44d80d){if(_0x44d80d){_0x11d36a=_0x44d80d['length'];if(!_0x7dae4a[_0x8f05('0x2f')][_0x8f05('0x36')]('nolimit')){_0x5bd94d[_0x8f05('0x1d')]=qs[_0x8f05('0x1d')](_0x7dae4a[_0x8f05('0x2f')][_0x8f05('0x1d')]);_0x5bd94d[_0x8f05('0x1a')]=qs[_0x8f05('0x1a')](_0x7dae4a['query'][_0x8f05('0x1a')]);}return _0x5ea4e0[_0x8f05('0x6f')](_0x5bd94d);}})[_0x8f05('0x22')](function(_0xed90d7){if(_0xed90d7){return _0xed90d7?{'count':_0x11d36a,'rows':_0xed90d7}:null;}})['then'](respondWithResult(_0x2317a0,null))[_0x8f05('0x42')](handleError(_0x2317a0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 24b8b5e..61bd30c 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 _0x914b=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger'];(function(_0xc1af5b,_0x396ee0){var _0x2a5d00=function(_0x52db0f){while(--_0x52db0f){_0xc1af5b['push'](_0xc1af5b['shift']());}};_0x2a5d00(++_0x396ee0);}(_0x914b,0x14d));var _0xb914=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x914b[_0x3b2c6f];return _0x22e219;};'use strict';var _=require(_0xb914('0x0'));var util=require(_0xb914('0x1'));var logger=require(_0xb914('0x2'))(_0xb914('0x3'));var moment=require(_0xb914('0x4'));var BPromise=require(_0xb914('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb914('0x6'));var rimraf=require(_0xb914('0x7'));var config=require(_0xb914('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xb914('0x9')]=function(_0x3382ef,_0x2fa711){return _0x3382ef[_0xb914('0xa')](_0xb914('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b78=['bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','moment'];(function(_0xf7f3ef,_0x43f150){var _0xfe7627=function(_0xc7c7ae){while(--_0xc7c7ae){_0xf7f3ef['push'](_0xf7f3ef['shift']());}};_0xfe7627(++_0x43f150);}(_0x3b78,0x1cb));var _0x83b7=function(_0x2aba17,_0x128a30){_0x2aba17=_0x2aba17-0x0;var _0x5a9599=_0x3b78[_0x2aba17];return _0x5a9599;};'use strict';var _=require(_0x83b7('0x0'));var util=require(_0x83b7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x83b7('0x2'));var BPromise=require(_0x83b7('0x3'));var rp=require(_0x83b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83b7('0x5'));var config=require(_0x83b7('0x6'));var attributes=require(_0x83b7('0x7'));module[_0x83b7('0x8')]=function(_0x200f6a,_0x2a03e7){return _0x200f6a[_0x83b7('0x9')](_0x83b7('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 827d965..53c9a96 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x408970,_0x25ffc9){var _0x30bbfd=function(_0x103597){while(--_0x103597){_0x408970['push'](_0x408970['shift']());}};_0x30bbfd(++_0x25ffc9);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x54e3c8,_0x41d6c4){var _0x59c914=function(_0x453e8f){while(--_0x453e8f){_0x54e3c8['push'](_0x54e3c8['shift']());}};_0x59c914(++_0x41d6c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index de02b7d..36c9a1b 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 _0x331c=['/:id/teams','getTeams','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','multer','path','Router','../../components/interaction/service','./voicePrefix.controller','get','index','isAuthenticated','describe','/:id','show','/:id/users','getAgents'];(function(_0xe9c036,_0x176387){var _0x44c82d=function(_0x4ac883){while(--_0x4ac883){_0xe9c036['push'](_0xe9c036['shift']());}};_0x44c82d(++_0x176387);}(_0x331c,0xf0));var _0xc331=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x331c[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xc331('0x0'));var util=require('util');var path=require(_0xc331('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc331('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc331('0x3'));var config=require('../../config/environment');var controller=require(_0xc331('0x4'));router[_0xc331('0x5')]('/',auth['isAuthenticated'](),controller[_0xc331('0x6')]);router[_0xc331('0x5')]('/describe',auth[_0xc331('0x7')](),controller[_0xc331('0x8')]);router[_0xc331('0x5')](_0xc331('0x9'),auth['isAuthenticated'](),controller[_0xc331('0xa')]);router['get'](_0xc331('0xb'),auth[_0xc331('0x7')](),controller[_0xc331('0xc')]);router[_0xc331('0x5')](_0xc331('0xd'),auth[_0xc331('0x7')](),controller[_0xc331('0xe')]);router[_0xc331('0xf')]('/',auth[_0xc331('0x7')](),controller['create']);router[_0xc331('0xf')](_0xc331('0xb'),auth[_0xc331('0x7')](),controller[_0xc331('0x10')]);router[_0xc331('0xf')](_0xc331('0xd'),auth['isAuthenticated'](),controller[_0xc331('0x11')]);router[_0xc331('0x12')]('/:id',auth[_0xc331('0x7')](),controller[_0xc331('0x13')]);router[_0xc331('0x14')](_0xc331('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0xc331('0x14')](_0xc331('0xb'),auth['isAuthenticated'](),controller[_0xc331('0x15')]);router[_0xc331('0x14')]('/:id/teams',auth[_0xc331('0x7')](),controller[_0xc331('0x16')]);module['exports']=router; \ No newline at end of file +var _0x871b=['get','index','isAuthenticated','getAgents','/:id/teams','post','create','/:id/users','addAgents','put','update','delete','/:id','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x34b935,_0x1b0e16){var _0x4acb3c=function(_0x111735){while(--_0x111735){_0x34b935['push'](_0x34b935['shift']());}};_0x4acb3c(++_0x1b0e16);}(_0x871b,0xe7));var _0xb871=function(_0x3452a4,_0x36064f){_0x3452a4=_0x3452a4-0x0;var _0x30a362=_0x871b[_0x3452a4];return _0x30a362;};'use strict';var multer=require(_0xb871('0x0'));var util=require(_0xb871('0x1'));var path=require(_0xb871('0x2'));var timeout=require(_0xb871('0x3'));var express=require('express');var router=express[_0xb871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb871('0x5'));var interaction=require(_0xb871('0x6'));var config=require(_0xb871('0x7'));var controller=require(_0xb871('0x8'));router[_0xb871('0x9')]('/',auth['isAuthenticated'](),controller[_0xb871('0xa')]);router[_0xb871('0x9')]('/describe',auth[_0xb871('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb871('0x9')]('/:id/users',auth[_0xb871('0xb')](),controller[_0xb871('0xc')]);router[_0xb871('0x9')](_0xb871('0xd'),auth[_0xb871('0xb')](),controller['getTeams']);router[_0xb871('0xe')]('/',auth[_0xb871('0xb')](),controller[_0xb871('0xf')]);router[_0xb871('0xe')](_0xb871('0x10'),auth[_0xb871('0xb')](),controller[_0xb871('0x11')]);router[_0xb871('0xe')](_0xb871('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0xb871('0x12')]('/:id',auth[_0xb871('0xb')](),controller[_0xb871('0x13')]);router[_0xb871('0x14')](_0xb871('0x15'),auth[_0xb871('0xb')](),controller['destroy']);router['delete'](_0xb871('0x10'),auth[_0xb871('0xb')](),controller['removeAgents']);router[_0xb871('0x14')](_0xb871('0xd'),auth[_0xb871('0xb')](),controller[_0xb871('0x16')]);module[_0xb871('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 40a96bf..2cd03f8 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 _0x08b2=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x335599,_0x3de6cf){var _0x3dc7ea=function(_0x689f51){while(--_0x689f51){_0x335599['push'](_0x335599['shift']());}};_0x3dc7ea(++_0x3de6cf);}(_0x08b2,0x16e));var _0x208b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x08b2[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x208b('0x0'));module[_0x208b('0x1')]={'name':{'type':Sequelize[_0x208b('0x2')],'allowNull':![],'unique':_0x208b('0x3')},'prefix':{'type':Sequelize[_0x208b('0x4')],'get':function(_0x4fb99a){return _0x208b('0x5')+this[_0x208b('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x208b('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x208b('0x7')]}}; \ No newline at end of file +var _0xea9b=['STRING','name','getDataValue','INTEGER','sequelize','exports'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0xea9b,0x12a));var _0xbea9=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0xea9b[_0x45dd0e];return _0x50e5ca;};'use strict';var Sequelize=require(_0xbea9('0x0'));module[_0xbea9('0x1')]={'name':{'type':Sequelize[_0xbea9('0x2')],'allowNull':![],'unique':_0xbea9('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x69da47){return'system-'+this[_0xbea9('0x4')](_0xbea9('0x3'))+'-';}},'description':{'type':Sequelize[_0xbea9('0x2')]},'callerIdAll':{'type':Sequelize[_0xbea9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xbea9('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index eadbf8f..fdd85aa 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8603,0x190));var _0x3860=function(_0x28edd1,_0x3660e0){_0x28edd1=_0x28edd1-0x0;var _0x4c0f8e=_0x8603[_0x28edd1];return _0x4c0f8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0x3266,0x6a));var _0x6326=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3266[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4afb904..5eea053 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 _0xa9f8=['remove','emit','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xa9f8,0x19b));var _0x8a9f=function(_0x19e599,_0x5c0e43){_0x19e599=_0x19e599-0x0;var _0x2ea044=_0xa9f8[_0x19e599];return _0x2ea044;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x8a9f('0x0'))['db'][_0x8a9f('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8a9f('0x2')](0x0);var events={'afterCreate':_0x8a9f('0x3'),'afterUpdate':_0x8a9f('0x4'),'afterDestroy':_0x8a9f('0x5')};function emitEvent(_0x15e2ba){return function(_0x1c8f0f,_0x20b4d1,_0x9c0466){VoicePrefixEvents[_0x8a9f('0x6')](_0x15e2ba+':'+_0x1c8f0f['id'],_0x1c8f0f);VoicePrefixEvents['emit'](_0x15e2ba,_0x1c8f0f);_0x9c0466(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8a9f('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xc4d0=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x5dc103,_0x58bf94){var _0x240d0e=function(_0x3e6b01){while(--_0x3e6b01){_0x5dc103['push'](_0x5dc103['shift']());}};_0x240d0e(++_0x58bf94);}(_0xc4d0,0xb5));var _0x0c4d=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0xc4d0[_0x1d5ba8];return _0x1022a2;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x0c4d('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0c4d('0x1')](0x0);var events={'afterCreate':_0x0c4d('0x2'),'afterUpdate':'update','afterDestroy':_0x0c4d('0x3')};function emitEvent(_0x2bc505){return function(_0x2b9627,_0x57c325,_0x271100){VoicePrefixEvents[_0x0c4d('0x4')](_0x2bc505+':'+_0x2b9627['id'],_0x2b9627);VoicePrefixEvents[_0x0c4d('0x4')](_0x2bc505,_0x2b9627);_0x271100(null);};}for(var e in events){if(events[_0x0c4d('0x5')](e)){var event=events[e];VoicePrefix[_0x0c4d('0x6')](e,emitEvent(event));}}module[_0x0c4d('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index abbd418..6c0ba00 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 _0xaeb7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaeb7,0x74));var _0x7aeb=function(_0xf2f2ed,_0x58daf0){_0xf2f2ed=_0xf2f2ed-0x0;var _0x1ac71d=_0xaeb7[_0xf2f2ed];return _0x1ac71d;};'use strict';var _=require(_0x7aeb('0x0'));var util=require('util');var logger=require(_0x7aeb('0x1'))(_0x7aeb('0x2'));var moment=require(_0x7aeb('0x3'));var BPromise=require(_0x7aeb('0x4'));var rp=require(_0x7aeb('0x5'));var fs=require('fs');var path=require(_0x7aeb('0x6'));var rimraf=require(_0x7aeb('0x7'));var config=require(_0x7aeb('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x7aeb('0x9')]=function(_0x2fd629,_0x1780e7){return _0x2fd629['define'](_0x7aeb('0xa'),attributes,{'tableName':_0x7aeb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe170=['VoicePrefix','util','moment','request-promise','rimraf','../../config/environment'];(function(_0x33d164,_0x5db6ca){var _0x4e6ee1=function(_0x322ae1){while(--_0x322ae1){_0x33d164['push'](_0x33d164['shift']());}};_0x4e6ee1(++_0x5db6ca);}(_0xe170,0x1b1));var _0x0e17=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0xe170[_0x1a5946];return _0x25e9d5;};'use strict';var _=require('lodash');var util=require(_0x0e17('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0e17('0x1'));var BPromise=require('bluebird');var rp=require(_0x0e17('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e17('0x3'));var config=require(_0x0e17('0x4'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0xbaba21,_0x1f656c){return _0xbaba21['define'](_0x0e17('0x5'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index bd625d0..db0a28b 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 _0xd301=['defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xd301,0x145));var _0x1d30=function(_0x1d6d2a,_0x24362e){_0x1d6d2a=_0x1d6d2a-0x0;var _0x399eb7=_0xd301[_0x1d6d2a];return _0x399eb7;};'use strict';var _=require(_0x1d30('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d30('0x1'));var fs=require('fs');var Redis=require(_0x1d30('0x2'));var db=require(_0x1d30('0x3'))['db'];var utils=require(_0x1d30('0x4'));var logger=require(_0x1d30('0x5'))(_0x1d30('0x6'));var config=require(_0x1d30('0x7'));var jayson=require(_0x1d30('0x8'));var client=jayson[_0x1d30('0x9')]['http']({'port':0x232a});config[_0x1d30('0xa')]=_[_0x1d30('0xb')](config[_0x1d30('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d30('0xc'))(new Redis(config[_0x1d30('0xa')]));require(_0x1d30('0xd'))[_0x1d30('0xe')](socket);function respondWithRpcPromise(_0x2a526e,_0xbad263,_0x2bcc44){return new BPromise(function(_0x5ced3a,_0x3b65ed){return client[_0x1d30('0xf')](_0x2a526e,_0x2bcc44)[_0x1d30('0x10')](function(_0x521497){logger[_0x1d30('0x11')](_0x1d30('0x12'),_0xbad263,_0x1d30('0x13'));logger[_0x1d30('0x14')](_0x1d30('0x15'),_0xbad263,_0x1d30('0x13'),JSON[_0x1d30('0x16')](_0x521497));if(_0x521497[_0x1d30('0x17')]){if(_0x521497[_0x1d30('0x17')][_0x1d30('0x18')]===0x1f4){logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x521497[_0x1d30('0x17')][_0x1d30('0x19')]);return _0x3b65ed(_0x521497[_0x1d30('0x17')]['message']);}logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x521497[_0x1d30('0x17')][_0x1d30('0x19')]);return _0x5ced3a(_0x521497[_0x1d30('0x17')]['message']);}else{logger['info'](_0x1d30('0x12'),_0xbad263,_0x1d30('0x13'));_0x5ced3a(_0x521497[_0x1d30('0x1a')][_0x1d30('0x19')]);}})[_0x1d30('0x1b')](function(_0x458b97){logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x458b97);_0x3b65ed(_0x458b97);});});} \ No newline at end of file +var _0x0c3a=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error'];(function(_0x2e0da6,_0x4a4adf){var _0x9503b3=function(_0x1d83cf){while(--_0x1d83cf){_0x2e0da6['push'](_0x2e0da6['shift']());}};_0x9503b3(++_0x4a4adf);}(_0x0c3a,0x171));var _0xa0c3=function(_0x59f468,_0x67a096){_0x59f468=_0x59f468-0x0;var _0x296f40=_0x0c3a[_0x59f468];return _0x296f40;};'use strict';var _=require(_0xa0c3('0x0'));var util=require(_0xa0c3('0x1'));var moment=require(_0xa0c3('0x2'));var BPromise=require(_0xa0c3('0x3'));var rs=require(_0xa0c3('0x4'));var fs=require('fs');var Redis=require(_0xa0c3('0x5'));var db=require(_0xa0c3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0c3('0x7'))(_0xa0c3('0x8'));var config=require('../../config/environment');var jayson=require(_0xa0c3('0x9'));var client=jayson[_0xa0c3('0xa')]['http']({'port':0x232a});config[_0xa0c3('0xb')]=_['defaults'](config['redis'],{'host':_0xa0c3('0xc'),'port':0x18eb});var socket=require(_0xa0c3('0xd'))(new Redis(config[_0xa0c3('0xb')]));require(_0xa0c3('0xe'))['register'](socket);function respondWithRpcPromise(_0x4122b7,_0x2c0801,_0x58078b){return new BPromise(function(_0x47fa6f,_0x187dcc){return client[_0xa0c3('0xf')](_0x4122b7,_0x58078b)['then'](function(_0x30522f){logger[_0xa0c3('0x10')](_0xa0c3('0x11'),_0x2c0801,'request\x20sent');logger[_0xa0c3('0x12')](_0xa0c3('0x13'),_0x2c0801,'request\x20sent',JSON['stringify'](_0x30522f));if(_0x30522f[_0xa0c3('0x14')]){if(_0x30522f[_0xa0c3('0x14')][_0xa0c3('0x15')]===0x1f4){logger[_0xa0c3('0x14')](_0xa0c3('0x11'),_0x2c0801,_0x30522f['error'][_0xa0c3('0x16')]);return _0x187dcc(_0x30522f['error'][_0xa0c3('0x16')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x2c0801,_0x30522f['error'][_0xa0c3('0x16')]);return _0x47fa6f(_0x30522f[_0xa0c3('0x14')][_0xa0c3('0x16')]);}else{logger['info'](_0xa0c3('0x11'),_0x2c0801,_0xa0c3('0x17'));_0x47fa6f(_0x30522f[_0xa0c3('0x18')][_0xa0c3('0x16')]);}})[_0xa0c3('0x19')](function(_0x42b62d){logger[_0xa0c3('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2c0801,_0x42b62d);_0x187dcc(_0x42b62d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 75c6cfe..3d5d850 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 _0xe3db=['./voicePrefix.events','save','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x4fce58,_0x45ebcd){var _0x27a0a6=function(_0x575e32){while(--_0x575e32){_0x4fce58['push'](_0x4fce58['shift']());}};_0x27a0a6(++_0x45ebcd);}(_0xe3db,0xc8));var _0xbe3d=function(_0x2f300d,_0x39f9de){_0x2f300d=_0x2f300d-0x0;var _0x5c1f61=_0xe3db[_0x2f300d];return _0x5c1f61;};'use strict';var VoicePrefixEvents=require(_0xbe3d('0x0'));var events=[_0xbe3d('0x1'),'remove',_0xbe3d('0x2')];function createListener(_0x17c43e,_0x37fcba){return function(_0x411429){_0x37fcba[_0xbe3d('0x3')](_0x17c43e,_0x411429);};}function removeListener(_0x192368,_0x30163d){return function(){VoicePrefixEvents[_0xbe3d('0x4')](_0x192368,_0x30163d);};}exports[_0xbe3d('0x5')]=function(_0xd5a81){for(var _0x2b4c19=0x0,_0x4c255b=events[_0xbe3d('0x6')];_0x2b4c19<_0x4c255b;_0x2b4c19++){var _0x90d1ab=events[_0x2b4c19];var _0x24136a=createListener(_0xbe3d('0x7')+_0x90d1ab,_0xd5a81);VoicePrefixEvents['on'](_0x90d1ab,_0x24136a);}}; \ No newline at end of file +var _0xfb30=['register','length','voicePrefix:','./voicePrefix.events','save','emit','removeListener'];(function(_0xb46ba,_0x2e2cc1){var _0x3b76a8=function(_0x3d1199){while(--_0x3d1199){_0xb46ba['push'](_0xb46ba['shift']());}};_0x3b76a8(++_0x2e2cc1);}(_0xfb30,0x88));var _0x0fb3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfb30[_0x502c7d];return _0x30b7ed;};'use strict';var VoicePrefixEvents=require(_0x0fb3('0x0'));var events=[_0x0fb3('0x1'),'remove','update'];function createListener(_0x310142,_0x501788){return function(_0x3ef43c){_0x501788[_0x0fb3('0x2')](_0x310142,_0x3ef43c);};}function removeListener(_0x1068cf,_0x309947){return function(){VoicePrefixEvents[_0x0fb3('0x3')](_0x1068cf,_0x309947);};}exports[_0x0fb3('0x4')]=function(_0x2f2a96){for(var _0x2570a8=0x0,_0x14a017=events[_0x0fb3('0x5')];_0x2570a8<_0x14a017;_0x2570a8++){var _0x1c1d89=events[_0x2570a8];var _0x5f3264=createListener(_0x0fb3('0x6')+_0x1c1d89,_0x2f2a96);VoicePrefixEvents['on'](_0x1c1d89,_0x5f3264);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d2b82d9..c74fa0d 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(_0x4d759f,_0x90bd42){var _0x28c804=function(_0x36d867){while(--_0x36d867){_0x4d759f['push'](_0x4d759f['shift']());}};_0x28c804(++_0x90bd42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 _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(_0x542b03,_0x28dcc6){var _0x1c6ccc=function(_0x5cbbe3){while(--_0x5cbbe3){_0x542b03['push'](_0x542b03['shift']());}};_0x1c6ccc(++_0x28dcc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 91d81b4..88c3abb 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 _0xcc44=['Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','once','setDataValue','split','joinempty','join','leavewhenempty','acw','wrapuptime','Dial\x20Method.','UNSIGNED'];(function(_0x455c1b,_0x21b689){var _0x101805=function(_0x371c23){while(--_0x371c23){_0x455c1b['push'](_0x455c1b['shift']());}};_0x101805(++_0x21b689);}(_0xcc44,0x11d));var _0x4cc4=function(_0x205725,_0x582a1b){_0x205725=_0x205725-0x0;var _0x4c86ed=_0xcc44[_0x205725];return _0x4c86ed;};'use strict';var Sequelize=require(_0x4cc4('0x0'));module[_0x4cc4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4cc4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x4'),_0x4cc4('0x5')),'allowNull':![],'defaultValue':_0x4cc4('0x4')},'musiconhold':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':_0x4cc4('0x7')},'announce':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4cc4('0x8'),_0x4cc4('0x9'),_0x4cc4('0xa'),_0x4cc4('0xb'),_0x4cc4('0xc'),'linear',_0x4cc4('0xd'),_0x4cc4('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0x4f447f){this['setDataValue'](_0x4cc4('0xf'),_0x4f447f?_0x4f447f:_0x4cc4('0xc'));},'get':function(){var _0x2768d2=this[_0x4cc4('0x10')](_0x4cc4('0x11'));var _0x239982=this[_0x4cc4('0x10')](_0x4cc4('0x12'));var _0x117416=this[_0x4cc4('0x10')](_0x4cc4('0xf'));if(_0x2768d2===_0x4cc4('0x4')){return _0x117416;}if(_0x239982===_0x4cc4('0x13')&&_0x117416===_0x4cc4('0xc')||_0x239982==='booked'&&_0x117416===_0x4cc4('0x14')){return _0x117416;}if(_0x239982===_0x4cc4('0x15')||_0x239982==='predictive'||_0x239982===_0x4cc4('0x16')){return _0x117416;}return null;}},'servicelevel':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4cc4('0x6')]},'weight':{'type':Sequelize[_0x4cc4('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x4cc4('0x18'),'no'),'defaultValue':_0x4cc4('0x18')},'autopause':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4cc4('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4cc4('0x3')]('yes','no'),'defaultValue':_0x4cc4('0x18')},'announce_holdtime':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no',_0x4cc4('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x4cc4('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4cc4('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4cc4('0x6')]},'queue_youarenext':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4cc4('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x4cc4('0x6')]},'queue_less_than':{'type':Sequelize[_0x4cc4('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x430687){this[_0x4cc4('0x1a')]('periodic_announce',_0x430687?_0x430687['join'](','):[]);},'get':function(){return this[_0x4cc4('0x10')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0x4cc4('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':_0x4cc4('0x18'),'set':function(_0x1727dd){this['setDataValue'](_0x4cc4('0x1c'),_0x1727dd?_0x1727dd[_0x4cc4('0x1d')](','):undefined);},'get':function(){return this[_0x4cc4('0x10')]('joinempty')?this[_0x4cc4('0x10')](_0x4cc4('0x1c'))[_0x4cc4('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':'no','set':function(_0x5976b2){this[_0x4cc4('0x1a')](_0x4cc4('0x1e'),_0x5976b2?_0x5976b2[_0x4cc4('0x1d')](','):undefined);},'get':function(){return this[_0x4cc4('0x10')](_0x4cc4('0x1e'))?this['getDataValue']('leavewhenempty')[_0x4cc4('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4cc4('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4cc4('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x56e416){this[_0x4cc4('0x1a')](_0x4cc4('0x1f'),_0x56e416);if(_0x56e416){if(this[_0x4cc4('0x10')](_0x4cc4('0x20'))<0x2){this[_0x4cc4('0x1a')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4cc4('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x4cc4('0x15'),_0x4cc4('0x16'),'predictive',_0x4cc4('0x13')),'defaultValue':_0x4cc4('0x15'),'comment':_0x4cc4('0x21')},'dialLimitChannel':{'type':Sequelize[_0x4cc4('0x17')](0x4)[_0x4cc4('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x4cc4('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4cc4('0x23')},'dialPowerLevel':{'type':Sequelize[_0x4cc4('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4cc4('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x4cc4('0x3')]('agentBusyFactor','dropRate'),'defaultValue':_0x4cc4('0x26'),'comment':_0x4cc4('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4cc4('0x24')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4cc4('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x4cc4('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4cc4('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4cc4('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4cc4('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x4cc4('0x2b')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x2c')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4cc4('0x17')](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'comment':_0x4cc4('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':_0x4cc4('0x31')},'dialPrefix':{'type':Sequelize[_0x4cc4('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x32'),_0x4cc4('0x33'),'onlyIfOpen'),'defaultValue':_0x4cc4('0x32')},'dialAMDActive':{'type':Sequelize[_0x4cc4('0x34')],'defaultValue':0x0,'comment':_0x4cc4('0x35')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4cc4('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x4cc4('0x17')](0x9)[_0x4cc4('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4cc4('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4cc4('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4cc4('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4cc4('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4cc4('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x4cc4('0x17')](0x9)[_0x4cc4('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4cc4('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4cc4('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4cc4('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4cc4('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x4cc4('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4cc4('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4cc4('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4cc4('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x4cc4('0x17')](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x4cc4('0x34')],'defaultValue':0x0,'comment':_0x4cc4('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4cc4('0x3')](_0x4cc4('0x40'),_0x4cc4('0x41')),'defaultValue':_0x4cc4('0x40')},'dialQueueProject2':{'type':Sequelize[_0x4cc4('0x6')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4cc4('0x34')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4cc4('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4cc4('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x4cc4('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4cc4('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4cc4('0x17')](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4cc4('0x17')](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cc4('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4cc4('0x17')](0x5)[_0x4cc4('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cc4('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4cc4('0x17')],'allowNull':!![],'comment':_0x4cc4('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x4cc4('0x34')],'defaultValue':![],'comment':_0x4cc4('0x4d'),'set':function(_0x32cbb0){if(!_0x32cbb0)this[_0x4cc4('0x1a')](_0x4cc4('0x4e'),null);this['setDataValue'](_0x4cc4('0x4f'),_0x32cbb0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4cc4('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4cc4('0x17')](0x3)[_0x4cc4('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4cc4('0x34')],'defaultValue':!![]}}; \ No newline at end of file +var _0x088d=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2b3e29,_0x4aaabb){var _0x3fd749=function(_0x1c042b){while(--_0x1c042b){_0x2b3e29['push'](_0x2b3e29['shift']());}};_0x3fd749(++_0x4aaabb);}(_0x088d,0xa9));var _0xd088=function(_0x1ad1a8,_0x3aa47d){_0x1ad1a8=_0x1ad1a8-0x0;var _0x32339b=_0x088d[_0x1ad1a8];return _0x32339b;};'use strict';var Sequelize=require(_0xd088('0x0'));module[_0xd088('0x1')]={'name':{'type':Sequelize[_0xd088('0x2')],'allowNull':![],'unique':_0xd088('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x5'),'outbound'),'allowNull':![],'defaultValue':_0xd088('0x5')},'musiconhold':{'type':Sequelize[_0xd088('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xd088('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xd088('0x6'),_0xd088('0x7'),_0xd088('0x8'),'random','rrmemory',_0xd088('0x9'),_0xd088('0xa'),_0xd088('0xb')),'allowNull':![],'defaultValue':_0xd088('0x6'),'set':function(_0x46d72f){this[_0xd088('0xc')](_0xd088('0xd'),_0x46d72f?_0x46d72f:_0xd088('0xe'));},'get':function(){var _0x275e54=this[_0xd088('0xf')](_0xd088('0x10'));var _0x1ce967=this[_0xd088('0xf')]('dialMethod');var _0x273fc9=this[_0xd088('0xf')](_0xd088('0xd'));if(_0x275e54==='inbound'){return _0x273fc9;}if(_0x1ce967===_0xd088('0x11')&&_0x273fc9===_0xd088('0xe')||_0x1ce967==='booked'&&_0x273fc9===_0xd088('0x12')){return _0x273fc9;}if(_0x1ce967===_0xd088('0x13')||_0x1ce967==='predictive'||_0x1ce967===_0xd088('0x14')){return _0x273fc9;}return null;}},'servicelevel':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd088('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xd088('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xd088('0x16'),'no'),'defaultValue':_0xd088('0x16')},'autopause':{'type':Sequelize['ENUM'](_0xd088('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd088('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xd088('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xd088('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd088('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd088('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd088('0x16')},'announce_holdtime':{'type':Sequelize[_0xd088('0x4')]('yes','no',_0xd088('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd088('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xd088('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd088('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd088('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd088('0x2')]},'queue_youarenext':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd088('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xd088('0x2')]},'queue_quantity2':{'type':Sequelize[_0xd088('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xd088('0x18')],'set':function(_0x5da73d){this[_0xd088('0xc')](_0xd088('0x19'),_0x5da73d?_0x5da73d[_0xd088('0x1a')](','):[]);},'get':function(){return this[_0xd088('0xf')](_0xd088('0x19'))?this[_0xd088('0xf')](_0xd088('0x19'))[_0xd088('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xd088('0x16'),'set':function(_0x3f4814){this[_0xd088('0xc')](_0xd088('0x1c'),_0x3f4814?_0x3f4814[_0xd088('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xd088('0x1c'))?this[_0xd088('0xf')]('joinempty')[_0xd088('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd088('0x2')],'defaultValue':'no','set':function(_0x45585d){this[_0xd088('0xc')](_0xd088('0x1d'),_0x45585d?_0x45585d[_0xd088('0x1a')](','):undefined);},'get':function(){return this[_0xd088('0xf')](_0xd088('0x1d'))?this['getDataValue'](_0xd088('0x1d'))[_0xd088('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd088('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd088('0x2')]},'description':{'type':Sequelize[_0xd088('0x2')]},'acw':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':0x0,'set':function(_0x53a5f5){this[_0xd088('0xc')](_0xd088('0x1f'),_0x53a5f5);if(_0x53a5f5){if(this[_0xd088('0xf')](_0xd088('0x20'))<0x2){this['setDataValue'](_0xd088('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd088('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':0x0,'comment':_0xd088('0x21')},'dialMethod':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x22'),_0xd088('0x13'),'power',_0xd088('0x23'),_0xd088('0x11')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xd088('0x15')](0x4)[_0xd088('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd088('0x25')},'dialLimitQueue':{'type':Sequelize[_0xd088('0x15')](0x4)[_0xd088('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd088('0x26')},'dialPowerLevel':{'type':Sequelize[_0xd088('0x27')](0x2)[_0xd088('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd088('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x29'),'dropRate'),'defaultValue':_0xd088('0x2a'),'comment':_0xd088('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd088('0x27')](0x2)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd088('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd088('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd088('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xd088('0x2')],'defaultValue':'tTxX','comment':_0xd088('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x30')},'dialQueueProject':{'type':Sequelize[_0xd088('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x3,'comment':_0xd088('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd088('0x35')},'dialTimezone':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd088('0x36')},'dialPrefix':{'type':Sequelize[_0xd088('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd088('0x4')](_0xd088('0x37'),_0xd088('0x38'),_0xd088('0x39')),'defaultValue':_0xd088('0x37')},'dialAMDActive':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd088('0x15')](0x9)[_0xd088('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd088('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xd088('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd088('0x15')](0x9)[_0xd088('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd088('0x15')](0x9)[_0xd088('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd088('0x3b')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd088('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd088('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd088('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd088('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd088('0x15')](0x9)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd088('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd088('0x15')](0x9)[_0xd088('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd088('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0xd088('0x15')](0x5)[_0xd088('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd088('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':0x0,'comment':_0xd088('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd088('0x4')]('DESC',_0xd088('0x42')),'defaultValue':_0xd088('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xd088('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd088('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd088('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd088('0x15')](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd088('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0xd088('0x15')](0x3)[_0xd088('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd088('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd088('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd088('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd088('0x15')],'allowNull':!![],'comment':_0xd088('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':![],'comment':_0xd088('0x4e'),'set':function(_0x1403c7){if(!_0x1403c7)this['setDataValue'](_0xd088('0x4f'),null);this[_0xd088('0xc')](_0xd088('0x50'),_0x1403c7);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xd088('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd088('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd088('0x1e')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index b22425d..c97a5a6 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 _0x0615=['SELECT','every','includes','all','compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','isNil','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','scheduledAt','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','QueueCampaigns','outbound','filter','ignore','map','type','find','name','destroy','error','stack','index','VoiceQueue','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','omit','createdAt','updatedAt','merge','value','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','addTeams','Team','online','voicePause','flatMap','Agents','forEach','sequelize','each','TeamVoiceQueue','penalty','UserVoiceQueue','upsert','format','interface','emit','removeTeams','ids','User','field','from','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes'];(function(_0x5c3bdd,_0x8444f9){var _0xaee41e=function(_0x50c621){while(--_0x50c621){_0x5c3bdd['push'](_0x5c3bdd['shift']());}};_0xaee41e(++_0x8444f9);}(_0x0615,0x19e));var _0x5061=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0615[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5061('0x0'));var rimraf=require(_0x5061('0x1'));var zipdir=require(_0x5061('0x2'));var jsonpatch=require(_0x5061('0x3'));var rp=require(_0x5061('0x4'));var moment=require('moment');var BPromise=require(_0x5061('0x5'));var Mustache=require(_0x5061('0x6'));var util=require(_0x5061('0x7'));var path=require(_0x5061('0x8'));var sox=require(_0x5061('0x9'));var csv=require(_0x5061('0xa'));var ejs=require(_0x5061('0xb'));var fs=require('fs');var fs_extra=require(_0x5061('0xc'));var _=require(_0x5061('0xd'));var squel=require(_0x5061('0xe'));var crypto=require(_0x5061('0xf'));var jsforce=require(_0x5061('0x10'));var deskjs=require(_0x5061('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5061('0x12'));var Papa=require(_0x5061('0x13'));var Redis=require(_0x5061('0x14'));var authService=require(_0x5061('0x15'));var qs=require(_0x5061('0x16'));var as=require(_0x5061('0x17'));var hardwareService=require(_0x5061('0x18'));var logger=require(_0x5061('0x19'))(_0x5061('0x1a'));var utils=require(_0x5061('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x5061('0x1c'));var db=require(_0x5061('0x1d'))['db'];config[_0x5061('0x1e')]=_['defaults'](config[_0x5061('0x1e')],{'host':_0x5061('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5061('0x20'))['register'](socket);function respondWithStatusCode(_0x45df5c,_0x3be70c){_0x3be70c=_0x3be70c||0xcc;return function(_0x583b2f){if(_0x583b2f){return _0x45df5c[_0x5061('0x21')](_0x3be70c);}return _0x45df5c[_0x5061('0x22')](_0x3be70c)[_0x5061('0x23')]();};}function respondWithResult(_0x2703d9,_0x4bcda4){_0x4bcda4=_0x4bcda4||0xc8;return function(_0x3532cf){if(_0x3532cf){return _0x2703d9[_0x5061('0x22')](_0x4bcda4)['json'](_0x3532cf);}};}function respondWithFilteredResult(_0x299dcb,_0x5a55e7){return function(_0x265a8f){if(_0x265a8f){var _0x43d590=typeof _0x5a55e7[_0x5061('0x24')]===_0x5061('0x25')&&typeof _0x5a55e7[_0x5061('0x26')]===_0x5061('0x25');var _0x38e217=_0x265a8f['count'];var _0x4551c3=_0x43d590?0x0:_0x5a55e7[_0x5061('0x24')];var _0x40d0b5=_0x43d590?_0x265a8f[_0x5061('0x27')]:_0x5a55e7[_0x5061('0x24')]+_0x5a55e7['limit'];var _0x13d6ed;if(_0x40d0b5>=_0x38e217){_0x40d0b5=_0x38e217;_0x13d6ed=0xc8;}else{_0x13d6ed=0xce;}_0x299dcb['status'](_0x13d6ed);return _0x299dcb[_0x5061('0x28')]('Content-Range',_0x4551c3+'-'+_0x40d0b5+'/'+_0x38e217)[_0x5061('0x29')](_0x265a8f);}return null;};}function patchUpdates(_0xecfb82){return function(_0x5e4ddc){try{jsonpatch[_0x5061('0x2a')](_0x5e4ddc,_0xecfb82,!![]);}catch(_0x5a759b){return BPromise[_0x5061('0x2b')](_0x5a759b);}return _0x5e4ddc['save']();};}function saveUpdates(_0x260999,_0x43dbf8){return function(_0x2eed05){if(_0x2eed05){return _0x2eed05[_0x5061('0x2c')](_0x260999)[_0x5061('0x2d')](function(_0x4f79d9){return _0x4f79d9;});}return null;};}function removeEntity(_0x33c50b,_0x30ccf4){return function(_0x208c4f){if(_0x208c4f){return _0x208c4f['destroy']()[_0x5061('0x2d')](function(){var _0x27a9ca=_0x208c4f['get']({'plain':!![]});var _0x2d57ea=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x5061('0x2e'),'value':_0x5061('0x2f'),'ignore':![]}];var _0x101c2b=_(_0x2d57ea)[_0x5061('0x30')](_0x5061('0x31'))[_0x5061('0x32')]('value')['value']();if(_['includes'](_0x101c2b,_0x27a9ca[_0x5061('0x33')])){return;}var _0x3b633d=_[_0x5061('0x34')](_0x2d57ea,['value',_0x27a9ca[_0x5061('0x33')]])[_0x5061('0x35')];return db['UserProfileResource'][_0x5061('0x36')]({'where':{'type':_0x3b633d,'resourceId':_0x27a9ca['id']}})[_0x5061('0x2d')](function(){return _0x208c4f;});})[_0x5061('0x2d')](function(){_0x33c50b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b746,_0x5c4e98){return function(_0x38d749){if(!_0x38d749){_0x46b746[_0x5061('0x21')](0x194);}return _0x38d749;};}function handleError(_0xe80e08,_0x3e692a){_0x3e692a=_0x3e692a||0x1f4;return function(_0x23c331){logger[_0x5061('0x37')](_0x23c331[_0x5061('0x38')]);if(_0x23c331['name']){delete _0x23c331[_0x5061('0x35')];}_0xe80e08[_0x5061('0x22')](_0x3e692a)['send'](_0x23c331);};}exports[_0x5061('0x39')]=function(_0x3a826a,_0x138b14){var _0x322d1d={},_0x4ffc13={},_0x2d1c9b={'count':0x0,'rows':[]};var _0x2a2b6e=_[_0x5061('0x32')](db[_0x5061('0x3a')]['rawAttributes'],function(_0x418b88){return{'name':_0x418b88['fieldName'],'type':_0x418b88[_0x5061('0x33')]['key']};});_0x4ffc13[_0x5061('0x3b')]=_[_0x5061('0x32')](_0x2a2b6e,_0x5061('0x35'));_0x4ffc13[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x3a826a['query']);_0x4ffc13[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x4ffc13[_0x5061('0x3b')],_0x4ffc13[_0x5061('0x3c')]);_0x322d1d[_0x5061('0x40')]=_['intersection'](_0x4ffc13['model'],qs[_0x5061('0x41')](_0x3a826a[_0x5061('0x3c')][_0x5061('0x41')]));_0x322d1d[_0x5061('0x40')]=_0x322d1d[_0x5061('0x40')][_0x5061('0x42')]?_0x322d1d['attributes']:_0x4ffc13[_0x5061('0x3b')];if(!_0x3a826a[_0x5061('0x3c')][_0x5061('0x43')](_0x5061('0x44'))){_0x322d1d[_0x5061('0x26')]=qs['limit'](_0x3a826a['query'][_0x5061('0x26')]);_0x322d1d['offset']=qs[_0x5061('0x24')](_0x3a826a[_0x5061('0x3c')]['offset']);}_0x322d1d[_0x5061('0x45')]=qs[_0x5061('0x46')](_0x3a826a['query'][_0x5061('0x46')]);_0x322d1d[_0x5061('0x47')]=qs[_0x5061('0x3e')](_[_0x5061('0x48')](_0x3a826a[_0x5061('0x3c')],_0x4ffc13[_0x5061('0x3e')]),_0x2a2b6e);if(_0x3a826a[_0x5061('0x3c')][_0x5061('0x30')]){_0x322d1d[_0x5061('0x47')]=_['merge'](_0x322d1d[_0x5061('0x47')],{'$or':_['map'](_0x2a2b6e,function(_0x426f51){if(_0x426f51[_0x5061('0x33')]!==_0x5061('0x49')){var _0x13954a={};_0x13954a[_0x426f51[_0x5061('0x35')]]={'$like':'%'+_0x3a826a[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x13954a;}})});}_0x322d1d=_['merge']({},_0x322d1d,_0x3a826a[_0x5061('0x4a')]);var _0x2e13a6={'where':_0x322d1d['where']};return db[_0x5061('0x3a')]['count'](_0x2e13a6)[_0x5061('0x2d')](function(_0x4c0e1e){_0x2d1c9b[_0x5061('0x27')]=_0x4c0e1e;if(_0x3a826a[_0x5061('0x3c')][_0x5061('0x4b')]){_0x322d1d[_0x5061('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0x5061('0x4d')](_0x322d1d);})[_0x5061('0x2d')](function(_0x187d1b){_0x2d1c9b[_0x5061('0x4e')]=_0x187d1b;return _0x2d1c9b;})['then'](respondWithFilteredResult(_0x138b14,_0x322d1d))[_0x5061('0x4f')](handleError(_0x138b14,null));};exports[_0x5061('0x50')]=function(_0x39a849,_0x485c19){var _0x1785b4={'raw':![],'where':{'id':_0x39a849[_0x5061('0x51')]['id']}},_0x51ae2a={};_0x51ae2a['model']=_[_0x5061('0x3d')](db[_0x5061('0x3a')][_0x5061('0x52')]);_0x51ae2a['query']=_['keys'](_0x39a849[_0x5061('0x3c')]);_0x51ae2a['filters']=_['intersection'](_0x51ae2a[_0x5061('0x3b')],_0x51ae2a[_0x5061('0x3c')]);_0x1785b4[_0x5061('0x40')]=_['intersection'](_0x51ae2a[_0x5061('0x3b')],qs['fields'](_0x39a849['query'][_0x5061('0x41')]));_0x1785b4[_0x5061('0x40')]=_0x1785b4[_0x5061('0x40')][_0x5061('0x42')]?_0x1785b4[_0x5061('0x40')]:_0x51ae2a['model'];if(_0x39a849[_0x5061('0x3c')][_0x5061('0x4b')]){_0x1785b4[_0x5061('0x4c')]=[{'all':!![]}];}_0x1785b4=_['merge']({},_0x1785b4,_0x39a849['options']);return db[_0x5061('0x3a')][_0x5061('0x34')](_0x1785b4)[_0x5061('0x2d')](handleEntityNotFound(_0x485c19,null))[_0x5061('0x2d')](respondWithResult(_0x485c19,null))[_0x5061('0x4f')](handleError(_0x485c19,null));};exports[_0x5061('0x53')]=function(_0x343453,_0x1f9e0d){return db['VoiceQueue'][_0x5061('0x53')](_0x343453[_0x5061('0x54')],{})[_0x5061('0x2d')](function(_0x870866){var _0x31ba6b=_0x343453[_0x5061('0x55')][_0x5061('0x56')]({'plain':!![]});if(!_0x31ba6b)throw new Error(_0x5061('0x57'));if(_0x31ba6b[_0x5061('0x58')]==='user'){var _0x257888=_0x870866[_0x5061('0x56')]({'plain':!![]});var _0x16a917=[{'name':_0x5061('0x59'),'value':_0x5061('0x5a')},{'name':_0x5061('0x2e'),'value':'outbound'}];var _0x1ce97d=_[_0x5061('0x34')](_0x16a917,['value',_0x257888[_0x5061('0x33')]])['name'];return db[_0x5061('0x5b')][_0x5061('0x34')]({'where':{'name':_0x1ce97d,'userProfileId':_0x31ba6b[_0x5061('0x5c')]},'raw':!![]})[_0x5061('0x2d')](function(_0x42aa58){if(_0x42aa58&&_0x42aa58[_0x5061('0x5d')]===0x0){return db[_0x5061('0x5e')][_0x5061('0x53')]({'name':_0x257888[_0x5061('0x35')],'resourceId':_0x257888['id'],'type':_0x42aa58[_0x5061('0x35')],'sectionId':_0x42aa58['id']},{})['then'](function(){return _0x870866;});}else{return _0x870866;}})[_0x5061('0x4f')](function(_0x1f0f84){logger[_0x5061('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0f84);throw _0x1f0f84;});}return _0x870866;})[_0x5061('0x2d')](respondWithResult(_0x1f9e0d,0xc9))[_0x5061('0x4f')](handleError(_0x1f9e0d,null));};exports['clone']=function(_0x182173,_0x597006){var _0x3f3500={'where':{'id':_0x182173[_0x5061('0x51')]['id']}},_0x513c37={};_0x513c37[_0x5061('0x3b')]=_[_0x5061('0x3d')](db[_0x5061('0x3a')]['rawAttributes']);_0x3f3500[_0x5061('0x40')]=_['intersection'](_0x513c37[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x182173[_0x5061('0x3c')]['fields']));_0x3f3500['attributes']=_0x3f3500[_0x5061('0x40')]['length']?_0x3f3500[_0x5061('0x40')]:_0x513c37['model'];if(_0x182173[_0x5061('0x3c')][_0x5061('0x4b')]){_0x3f3500[_0x5061('0x4c')]=[{'all':!![]}];}_0x3f3500=_['merge']({},_0x3f3500,_0x182173[_0x5061('0x4a')]);return db[_0x5061('0x3a')][_0x5061('0x34')](_0x3f3500)[_0x5061('0x2d')](handleEntityNotFound(_0x597006,null))[_0x5061('0x2d')](function(_0x7a3013){if(_0x7a3013){var _0x4bddce=_0x7a3013[_0x5061('0x56')]({'plain':!![]});_0x4bddce=qs[_0x5061('0x5f')](_0x4bddce,['id',_0x5061('0x60'),_0x5061('0x61')]);_0x182173[_0x5061('0x54')]=_[_0x5061('0x5f')](_0x182173[_0x5061('0x54')],['id',_0x5061('0x60'),_0x5061('0x61')]);return db[_0x5061('0x3a')]['create'](_[_0x5061('0x62')](_0x4bddce,_0x182173[_0x5061('0x54')]),{'include':_0x182173[_0x5061('0x3c')][_0x5061('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x451482){var _0x18352e=_0x182173[_0x5061('0x55')][_0x5061('0x56')]({'plain':!![]});if(!_0x18352e)throw new Error(_0x5061('0x57'));if(_0x18352e['role']==='user'){var _0x54cc5e=_0x451482['get']({'plain':!![]});var _0x56fb1c=[{'name':_0x5061('0x59'),'value':_0x5061('0x5a')},{'name':_0x5061('0x2e'),'value':_0x5061('0x2f')}];var _0x4b3869=_[_0x5061('0x34')](_0x56fb1c,[_0x5061('0x63'),_0x54cc5e[_0x5061('0x33')]])[_0x5061('0x35')];return db[_0x5061('0x5b')]['find']({'where':{'name':_0x4b3869,'userProfileId':_0x18352e[_0x5061('0x5c')]},'raw':!![]})[_0x5061('0x2d')](function(_0x2e9c0a){if(_0x2e9c0a&&_0x2e9c0a[_0x5061('0x5d')]===0x0){return db['UserProfileResource'][_0x5061('0x53')]({'name':_0x54cc5e[_0x5061('0x35')],'resourceId':_0x54cc5e['id'],'type':_0x2e9c0a[_0x5061('0x35')],'sectionId':_0x2e9c0a['id']},{})[_0x5061('0x2d')](function(){return _0x451482;});}else{return _0x451482;}})[_0x5061('0x4f')](function(_0x2ea43f){logger[_0x5061('0x37')](_0x5061('0x64'),_0x2ea43f);throw _0x2ea43f;});}return _0x451482;});}})['then'](respondWithResult(_0x597006,0xc9))['catch'](handleError(_0x597006,null));};exports[_0x5061('0x2c')]=function(_0x38e088,_0x2f31f6){if(_0x38e088['body']['id']){delete _0x38e088[_0x5061('0x54')]['id'];}return db[_0x5061('0x3a')][_0x5061('0x34')]({'where':{'id':_0x38e088['params']['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x2f31f6,null))[_0x5061('0x2d')](saveUpdates(_0x38e088['body'],null))[_0x5061('0x2d')](respondWithResult(_0x2f31f6,null))[_0x5061('0x4f')](handleError(_0x2f31f6,null));};exports[_0x5061('0x36')]=function(_0x14a3e7,_0x503e1d){return db[_0x5061('0x3a')]['find']({'where':{'id':_0x14a3e7[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x503e1d,null))[_0x5061('0x2d')](removeEntity(_0x503e1d,null))[_0x5061('0x4f')](handleError(_0x503e1d,null));};exports[_0x5061('0x65')]=function(_0x216551,_0xcf07d9,_0x2da166){var _0x1724a1={'raw':![],'where':{}};var _0x14ce4c={};var _0x50c9a7={'count':0x0,'rows':[]};return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x216551[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0xcf07d9,null))['then'](function(_0x1ff243){if(_0x1ff243){_0x14ce4c[_0x5061('0x3b')]=_[_0x5061('0x3d')](db[_0x5061('0x67')][_0x5061('0x52')]);_0x14ce4c[_0x5061('0x3c')]=_['keys'](_0x216551['query']);_0x14ce4c[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x14ce4c[_0x5061('0x3b')],_0x14ce4c[_0x5061('0x3c')]);_0x1724a1[_0x5061('0x40')]=_[_0x5061('0x3f')](_0x14ce4c['model'],qs['fields'](_0x216551[_0x5061('0x3c')][_0x5061('0x41')]));_0x1724a1[_0x5061('0x40')]=_0x1724a1[_0x5061('0x40')][_0x5061('0x42')]?_0x1724a1[_0x5061('0x40')]:_0x14ce4c[_0x5061('0x3b')];if(!_0x216551[_0x5061('0x3c')][_0x5061('0x43')](_0x5061('0x44'))){_0x1724a1[_0x5061('0x26')]=qs['limit'](_0x216551[_0x5061('0x3c')][_0x5061('0x26')]);_0x1724a1[_0x5061('0x24')]=qs[_0x5061('0x24')](_0x216551[_0x5061('0x3c')]['offset']);}_0x1724a1['order']=qs['sort'](_0x216551[_0x5061('0x3c')][_0x5061('0x46')]);_0x1724a1[_0x5061('0x47')]=qs['filters'](_[_0x5061('0x48')](_0x216551[_0x5061('0x3c')],_0x14ce4c['filters']));_0x1724a1[_0x5061('0x47')][_0x5061('0x68')]=_0x1ff243['id'];if(_0x216551[_0x5061('0x3c')][_0x5061('0x30')]){_0x1724a1[_0x5061('0x47')]=_[_0x5061('0x62')](_0x1724a1['where'],{'$or':_[_0x5061('0x32')](_0x1724a1[_0x5061('0x40')],function(_0x43ab16){var _0x191c60={};_0x191c60[_0x43ab16]={'$like':'%'+_0x216551[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x191c60;})});}_0x1724a1=_[_0x5061('0x62')]({},_0x1724a1,_0x216551[_0x5061('0x4a')]);return db[_0x5061('0x67')][_0x5061('0x27')]({'where':_0x1724a1[_0x5061('0x47')]})[_0x5061('0x2d')](function(_0x528283){_0x50c9a7[_0x5061('0x27')]=_0x528283;if(_0x216551[_0x5061('0x3c')][_0x5061('0x4b')]){_0x1724a1[_0x5061('0x4c')]=[{'all':!![]}];}return db[_0x5061('0x67')]['findAll'](_0x1724a1);})[_0x5061('0x2d')](function(_0x49e71a){_0x50c9a7[_0x5061('0x4e')]=_0x49e71a;return _0x50c9a7;});}})[_0x5061('0x2d')](respondWithFilteredResult(_0xcf07d9,_0x1724a1))[_0x5061('0x4f')](handleError(_0xcf07d9,null));};exports[_0x5061('0x69')]=function(_0x1b7c4f,_0x31d0d7,_0x45429c){var _0x14744c={'raw':!![],'where':{}};var _0x12da19={};var _0x544d55={'count':0x0,'rows':[]};return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x1b7c4f[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x31d0d7,null))[_0x5061('0x2d')](function(_0x948149){if(_0x948149){_0x12da19[_0x5061('0x3b')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x12da19['query']=_[_0x5061('0x3d')](_0x1b7c4f[_0x5061('0x3c')]);_0x12da19[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x12da19[_0x5061('0x3b')],_0x12da19[_0x5061('0x3c')]);_0x14744c['attributes']=_[_0x5061('0x3f')](_0x12da19[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x1b7c4f['query']['fields']));_0x14744c[_0x5061('0x40')]=_0x14744c[_0x5061('0x40')][_0x5061('0x42')]?_0x14744c[_0x5061('0x40')]:_0x12da19[_0x5061('0x3b')];if(!_0x1b7c4f[_0x5061('0x3c')]['hasOwnProperty'](_0x5061('0x44'))){_0x14744c[_0x5061('0x26')]=qs[_0x5061('0x26')](_0x1b7c4f['query'][_0x5061('0x26')]);_0x14744c[_0x5061('0x24')]=qs[_0x5061('0x24')](_0x1b7c4f[_0x5061('0x3c')][_0x5061('0x24')]);}_0x14744c['order']=qs['sort'](_0x1b7c4f[_0x5061('0x3c')][_0x5061('0x46')]);_0x14744c[_0x5061('0x47')]=qs[_0x5061('0x3e')](_[_0x5061('0x48')](_0x1b7c4f['query'],_0x12da19[_0x5061('0x3e')]));_0x14744c['where']['VoiceQueueId']=_0x948149['id'];if(_0x1b7c4f[_0x5061('0x3c')][_0x5061('0x30')]){_0x14744c[_0x5061('0x47')]=_[_0x5061('0x62')](_0x14744c[_0x5061('0x47')],{'$or':_[_0x5061('0x32')](_0x14744c[_0x5061('0x40')],function(_0x2045a1){var _0x137a97={};_0x137a97[_0x2045a1]={'$like':'%'+_0x1b7c4f['query']['filter']+'%'};return _0x137a97;})});}_0x14744c=_[_0x5061('0x62')]({},_0x14744c,_0x1b7c4f['options']);return db[_0x5061('0x6a')][_0x5061('0x27')]({'where':_0x14744c[_0x5061('0x47')]})[_0x5061('0x2d')](function(_0x3733ba){_0x544d55['count']=_0x3733ba;if(_0x1b7c4f[_0x5061('0x3c')][_0x5061('0x4b')]){_0x14744c[_0x5061('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x14744c);})[_0x5061('0x2d')](function(_0x1249ad){_0x544d55[_0x5061('0x4e')]=_0x1249ad;return _0x544d55;});}})[_0x5061('0x2d')](respondWithFilteredResult(_0x31d0d7,_0x14744c))[_0x5061('0x4f')](handleError(_0x31d0d7,null));};exports['getHopperFinals']=function(_0x2d3023,_0x4f8257,_0x500c42){var _0x196dd9={'raw':!![],'where':{}};var _0x5a9f98={};var _0x184928={'count':0x0,'rows':[]};return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x2d3023[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x4f8257,null))[_0x5061('0x2d')](function(_0x4f4bf2){if(_0x4f4bf2){_0x5a9f98['model']=_[_0x5061('0x3d')](db[_0x5061('0x6b')][_0x5061('0x52')]);_0x5a9f98[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x2d3023[_0x5061('0x3c')]);_0x5a9f98['filters']=_['intersection'](_0x5a9f98[_0x5061('0x3b')],_0x5a9f98[_0x5061('0x3c')]);_0x196dd9[_0x5061('0x40')]=_[_0x5061('0x3f')](_0x5a9f98[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x2d3023[_0x5061('0x3c')]['fields']));_0x196dd9[_0x5061('0x40')]=_0x196dd9[_0x5061('0x40')][_0x5061('0x42')]?_0x196dd9['attributes']:_0x5a9f98['model'];if(!_0x2d3023[_0x5061('0x3c')][_0x5061('0x43')]('nolimit')){_0x196dd9[_0x5061('0x26')]=qs[_0x5061('0x26')](_0x2d3023['query'][_0x5061('0x26')]);_0x196dd9['offset']=qs[_0x5061('0x24')](_0x2d3023[_0x5061('0x3c')]['offset']);}_0x196dd9[_0x5061('0x45')]=qs['sort'](_0x2d3023[_0x5061('0x3c')]['sort']);_0x196dd9[_0x5061('0x47')]=qs[_0x5061('0x3e')](_['pick'](_0x2d3023[_0x5061('0x3c')],_0x5a9f98[_0x5061('0x3e')]));_0x196dd9[_0x5061('0x47')]['VoiceQueueId']=_0x4f4bf2['id'];if(_0x2d3023[_0x5061('0x3c')][_0x5061('0x30')]){_0x196dd9[_0x5061('0x47')]=_[_0x5061('0x62')](_0x196dd9[_0x5061('0x47')],{'$or':_[_0x5061('0x32')](_0x196dd9[_0x5061('0x40')],function(_0x1df70d){var _0xd2e2e6={};_0xd2e2e6[_0x1df70d]={'$like':'%'+_0x2d3023[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0xd2e2e6;})});}_0x196dd9=_[_0x5061('0x62')]({},_0x196dd9,_0x2d3023[_0x5061('0x4a')]);return db[_0x5061('0x6b')][_0x5061('0x27')]({'where':_0x196dd9[_0x5061('0x47')]})[_0x5061('0x2d')](function(_0x28729f){_0x184928[_0x5061('0x27')]=_0x28729f;if(_0x2d3023[_0x5061('0x3c')]['includeAll']){_0x196dd9['include']=[{'all':!![]}];}return db[_0x5061('0x6b')][_0x5061('0x4d')](_0x196dd9);})[_0x5061('0x2d')](function(_0x42a077){_0x184928[_0x5061('0x4e')]=_0x42a077;return _0x184928;});}})['then'](respondWithFilteredResult(_0x4f8257,_0x196dd9))[_0x5061('0x4f')](handleError(_0x4f8257,null));};exports['getHopperBlacks']=function(_0x13b9ef,_0x44302c,_0x25f5f5){var _0x53f275={'raw':!![],'where':{}};var _0x4cc993={};var _0x5d1a47={'count':0x0,'rows':[]};return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x13b9ef[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x44302c,null))['then'](function(_0x29d468){if(_0x29d468){_0x4cc993[_0x5061('0x3b')]=_[_0x5061('0x3d')](db[_0x5061('0x6c')][_0x5061('0x52')]);_0x4cc993[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x13b9ef[_0x5061('0x3c')]);_0x4cc993[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x4cc993['model'],_0x4cc993[_0x5061('0x3c')]);_0x53f275['attributes']=_[_0x5061('0x3f')](_0x4cc993[_0x5061('0x3b')],qs['fields'](_0x13b9ef[_0x5061('0x3c')][_0x5061('0x41')]));_0x53f275[_0x5061('0x40')]=_0x53f275[_0x5061('0x40')][_0x5061('0x42')]?_0x53f275['attributes']:_0x4cc993[_0x5061('0x3b')];if(!_0x13b9ef[_0x5061('0x3c')][_0x5061('0x43')](_0x5061('0x44'))){_0x53f275[_0x5061('0x26')]=qs[_0x5061('0x26')](_0x13b9ef['query']['limit']);_0x53f275['offset']=qs[_0x5061('0x24')](_0x13b9ef[_0x5061('0x3c')]['offset']);}_0x53f275[_0x5061('0x45')]=qs[_0x5061('0x46')](_0x13b9ef[_0x5061('0x3c')][_0x5061('0x46')]);_0x53f275[_0x5061('0x47')]=qs[_0x5061('0x3e')](_[_0x5061('0x48')](_0x13b9ef[_0x5061('0x3c')],_0x4cc993['filters']));_0x53f275[_0x5061('0x47')][_0x5061('0x68')]=_0x29d468['id'];if(_0x13b9ef[_0x5061('0x3c')]['filter']){_0x53f275[_0x5061('0x47')]=_[_0x5061('0x62')](_0x53f275['where'],{'$or':_[_0x5061('0x32')](_0x53f275[_0x5061('0x40')],function(_0x19fba3){var _0x2cda32={};_0x2cda32[_0x19fba3]={'$like':'%'+_0x13b9ef[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x2cda32;})});}_0x53f275=_[_0x5061('0x62')]({},_0x53f275,_0x13b9ef[_0x5061('0x4a')]);return db['CmHopperBlack'][_0x5061('0x27')]({'where':_0x53f275[_0x5061('0x47')]})[_0x5061('0x2d')](function(_0x378322){_0x5d1a47[_0x5061('0x27')]=_0x378322;if(_0x13b9ef[_0x5061('0x3c')][_0x5061('0x4b')]){_0x53f275[_0x5061('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5061('0x4d')](_0x53f275);})[_0x5061('0x2d')](function(_0x2abf5e){_0x5d1a47[_0x5061('0x4e')]=_0x2abf5e;return _0x5d1a47;});}})[_0x5061('0x2d')](respondWithFilteredResult(_0x44302c,_0x53f275))[_0x5061('0x4f')](handleError(_0x44302c,null));};exports[_0x5061('0x6d')]=function(_0x49bef5,_0x2cee45,_0x52837b){var _0x26ab43={};var _0x41e111={};var _0x58b1a7;var _0x2e610e;return db[_0x5061('0x3a')]['findOne']({'where':{'id':_0x49bef5[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x2cee45,null))[_0x5061('0x2d')](function(_0x393b51){if(_0x393b51){_0x58b1a7=_0x393b51;_0x41e111['model']=_[_0x5061('0x3d')](db['Team'][_0x5061('0x52')]);_0x41e111[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x49bef5[_0x5061('0x3c')]);_0x41e111[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x41e111[_0x5061('0x3b')],_0x41e111[_0x5061('0x3c')]);_0x26ab43[_0x5061('0x40')]=_[_0x5061('0x3f')](_0x41e111[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x49bef5[_0x5061('0x3c')]['fields']));_0x26ab43[_0x5061('0x40')]=_0x26ab43[_0x5061('0x40')]['length']?_0x26ab43[_0x5061('0x40')]:_0x41e111[_0x5061('0x3b')];_0x26ab43[_0x5061('0x45')]=qs[_0x5061('0x46')](_0x49bef5[_0x5061('0x3c')][_0x5061('0x46')]);_0x26ab43[_0x5061('0x47')]=qs[_0x5061('0x3e')](_[_0x5061('0x48')](_0x49bef5['query'],_0x41e111['filters']));if(_0x49bef5[_0x5061('0x3c')]['filter']){_0x26ab43['where']=_[_0x5061('0x62')](_0x26ab43[_0x5061('0x47')],{'$or':_[_0x5061('0x32')](_0x26ab43[_0x5061('0x40')],function(_0x4ffc2b){var _0x4023b1={};_0x4023b1[_0x4ffc2b]={'$like':'%'+_0x49bef5[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x4023b1;})});}_0x26ab43=_['merge']({},_0x26ab43,_0x49bef5[_0x5061('0x4a')]);return _0x58b1a7['getTeams'](_0x26ab43);}})[_0x5061('0x2d')](function(_0x2e50b7){if(_0x2e50b7){_0x2e610e=_0x2e50b7['length'];if(!_0x49bef5[_0x5061('0x3c')]['hasOwnProperty'](_0x5061('0x44'))){_0x26ab43[_0x5061('0x26')]=qs['limit'](_0x49bef5[_0x5061('0x3c')][_0x5061('0x26')]);_0x26ab43[_0x5061('0x24')]=qs[_0x5061('0x24')](_0x49bef5[_0x5061('0x3c')][_0x5061('0x24')]);}return _0x58b1a7['getTeams'](_0x26ab43);}})['then'](function(_0x395608){if(_0x395608){return _0x395608?{'count':_0x2e610e,'rows':_0x395608}:null;}})['then'](respondWithResult(_0x2cee45,null))[_0x5061('0x4f')](handleError(_0x2cee45,null));};exports[_0x5061('0x6e')]=function(_0x38fd86,_0x28b5b6,_0x5bbd02){var _0x2da9bc=_0x38fd86[_0x5061('0x54')]['teams'];var _0x48c202=_[_0x5061('0x32')](_0x2da9bc,'id');return db[_0x5061('0x6f')][_0x5061('0x4d')]({'where':{'id':_0x48c202},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5061('0x35'),_0x5061('0x70'),_0x5061('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x41f5e0){if(_0x41f5e0){var _0x5538f2=_[_0x5061('0x72')](_0x41f5e0,function(_0x29e7d9){var _0x4d95f1=_0x29e7d9[_0x5061('0x56')]({'plain':!![]});_0x4d95f1[_0x5061('0x73')][_0x5061('0x74')](function(_0x3e2ac5){_0x3e2ac5['penalty']=_[_0x5061('0x34')](_0x2da9bc,{'id':_0x4d95f1['id']})['penalty'];});return _0x4d95f1[_0x5061('0x73')];});return db['VoiceQueue'][_0x5061('0x34')]({'where':{'id':_0x38fd86[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](function(_0x3694c9){return db[_0x5061('0x75')]['transaction'](function(_0x1901da){return _0x3694c9['addTeams'](_0x48c202,{'transaction':_0x1901da})['then'](function(){return BPromise[_0x5061('0x76')](_0x2da9bc,function(_0xc6ca0b){return db[_0x5061('0x77')]['upsert']({'TeamId':_0xc6ca0b['id'],'VoiceQueueId':_0x38fd86['params']['id'],'penalty':_0xc6ca0b[_0x5061('0x78')]},{'transaction':_0x1901da});});})[_0x5061('0x2d')](function(){return BPromise[_0x5061('0x76')](_0x5538f2,function(_0x45ae40){return db[_0x5061('0x79')]['findOrCreate']({'where':{'UserId':_0x45ae40['id'],'VoiceQueueId':_0x38fd86[_0x5061('0x51')]['id']},'defaults':{'penalty':_0x45ae40[_0x5061('0x78')]},'transaction':_0x1901da});});})[_0x5061('0x2d')](function(){return BPromise['each'](_[_0x5061('0x30')](_0x5538f2,{'online':!![]}),function(_0x42ac53){return db['UserVoiceQueueRt'][_0x5061('0x7a')]({'membername':_0x42ac53['name'],'UserId':_0x42ac53['id'],'queue_name':_0x3694c9['name'],'VoiceQueueId':_0x3694c9['id'],'interface':_['isNil'](_0x42ac53['interface'])?util[_0x5061('0x7b')]('SIP/%s',_0x42ac53[_0x5061('0x35')]):_0x42ac53[_0x5061('0x7c')],'paused':_0x42ac53[_0x5061('0x71')]||![],'penalty':_0x42ac53['penalty']},{'transaction':_0x1901da});});})[_0x5061('0x2d')](function(){_0x5538f2[_0x5061('0x74')](function(_0x3a05b2){socket[_0x5061('0x7d')]('userVoiceQueue:save',{'UserId':_0x3a05b2['id'],'VoiceQueueId':_0x3694c9['id']});});});});});}})[_0x5061('0x2d')](respondWithStatusCode(_0x28b5b6,null))[_0x5061('0x4f')](handleError(_0x28b5b6,null));};exports[_0x5061('0x7e')]=function(_0x1aa914,_0x3b7bf3,_0x43e469){return db['Team'][_0x5061('0x4d')]({'where':{'id':_0x1aa914[_0x5061('0x3c')][_0x5061('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x5061('0x80')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5061('0x2d')](handleEntityNotFound(_0x3b7bf3,null))[_0x5061('0x2d')](function(_0x1f0b47){var _0x510d64=_[_0x5061('0x32')](_0x1f0b47,'id');var _0x34c421=[];var _0x54cc3b=[];var _0x1f22e8=squel['select']();_0x1f22e8[_0x5061('0x81')]('tq.TeamId')[_0x5061('0x82')]('team_has_voice_queues','tq')[_0x5061('0x83')]('user_has_teams','ut',_0x5061('0x84'))[_0x5061('0x47')](_0x5061('0x85'),_0x1aa914[_0x5061('0x51')]['id']);for(var _0x5216c7=0x0;_0x5216c7<_0x1f0b47[_0x5061('0x42')];_0x5216c7+=0x1){let _0x41eb92=_0x1f0b47[_0x5216c7];for(var _0x30bc8d=0x0;_0x30bc8d<_0x41eb92[_0x5061('0x73')][_0x5061('0x42')];_0x30bc8d+=0x1){let _0x6306ca=_0x41eb92[_0x5061('0x73')][_0x30bc8d];var _0x29e68e=_0x1f22e8[_0x5061('0x86')]();_0x29e68e[_0x5061('0x47')](_0x5061('0x87'),_0x6306ca['id']);_0x54cc3b[_0x5061('0x88')](db[_0x5061('0x75')][_0x5061('0x3c')](_0x29e68e['toString'](),{'type':db[_0x5061('0x75')][_0x5061('0x89')][_0x5061('0x8a')]})[_0x5061('0x2d')](function(_0x3f1e89){if(_0x3f1e89['length']===0x1){return _0x6306ca['id'];}else{var _0x2bc174=_[_0x5061('0x8b')](_['map'](_0x3f1e89,'TeamId'),function(_0x56b6a9){return _[_0x5061('0x8c')](_0x510d64,_0x56b6a9);});if(_0x2bc174){return _0x6306ca['id'];}}}));}}return BPromise[_0x5061('0x8d')](_0x54cc3b)[_0x5061('0x2d')](function(_0x11d349){_0x34c421=_(_0x34c421)['union'](_0x11d349)[_0x5061('0x8e')]()[_0x5061('0x63')]();return db[_0x5061('0x3a')][_0x5061('0x34')]({'where':{'id':_0x1aa914['params']['id']}})[_0x5061('0x2d')](function(_0x182d0e){return db['sequelize'][_0x5061('0x8f')](function(_0x219714){return _0x182d0e['removeTeams'](_0x1aa914[_0x5061('0x3c')][_0x5061('0x7f')],{'transaction':_0x219714})['then'](function(){if(!_[_0x5061('0x90')](_0x34c421)){return _0x182d0e[_0x5061('0x91')](_0x34c421,{'transaction':_0x219714})[_0x5061('0x2d')](function(){return db[_0x5061('0x92')]['destroy']({'where':{'VoiceQueueId':_0x1aa914[_0x5061('0x51')]['id'],'UserId':_0x34c421},'transaction':_0x219714});});}})[_0x5061('0x2d')](function(){_0x34c421[_0x5061('0x74')](function(_0x1a7e3d){socket[_0x5061('0x7d')]('userVoiceQueue:remove',{'UserId':_0x1a7e3d,'VoiceQueueId':_0x182d0e['id']});});});});});});})['then'](respondWithStatusCode(_0x3b7bf3,null))[_0x5061('0x4f')](handleError(_0x3b7bf3,null));};exports[_0x5061('0x93')]=function(_0x4e58fc,_0x1b57eb,_0x340bf7){var _0x3092d3,_0xec940d;return db['VoiceQueue'][_0x5061('0x34')]({'where':{'id':_0x4e58fc['params']['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x1b57eb,null))[_0x5061('0x2d')](function(_0x1b40be){if(_0x1b40be){_0xec940d=_0x1b40be;return _0x1b40be[_0x5061('0x93')](_0x4e58fc['body']['ids'],_[_0x5061('0x5f')](_0x4e58fc[_0x5061('0x54')],[_0x5061('0x7f'),'id'])||{})[_0x5061('0x94')](function(_0x254eef){for(var _0x419e56=0x0;_0x419e56<_0x4e58fc[_0x5061('0x54')]['ids'][_0x5061('0x42')];_0x419e56+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x4e58fc[_0x5061('0x54')]['ids'][_0x419e56]),'VoiceQueueId':Number(_0x4e58fc[_0x5061('0x51')]['id'])});}return _0x254eef;});}})[_0x5061('0x2d')](function(_0x242035){_0x3092d3=_0x242035||[];if(_0xec940d){return db[_0x5061('0x80')]['findAll']({'where':{'id':_0x4e58fc[_0x5061('0x54')][_0x5061('0x7f')]},'attributes':['id',_0x5061('0x35'),_0x5061('0x70'),_0x5061('0x71'),_0x5061('0x7c')],'raw':!![]});}})['then'](function(_0x2a14ce){if(!_[_0x5061('0x90')](_0x2a14ce)){var _0x166e95=[];for(var _0x62a9=0x0;_0x62a9<_0x2a14ce[_0x5061('0x42')];_0x62a9++){if(_0x2a14ce[_0x62a9][_0x5061('0x70')]){_0x166e95['push'](db[_0x5061('0x92')]['upsert']({'membername':_0x2a14ce[_0x62a9][_0x5061('0x35')],'UserId':_0x2a14ce[_0x62a9]['id'],'queue_name':_0xec940d[_0x5061('0x35')],'VoiceQueueId':_0xec940d['id'],'interface':_[_0x5061('0x95')](_0x2a14ce[_0x62a9][_0x5061('0x7c')])?util[_0x5061('0x7b')](_0x5061('0x96'),_0x2a14ce[_0x62a9][_0x5061('0x35')]):_0x2a14ce[_0x62a9][_0x5061('0x7c')],'paused':_0x2a14ce[_0x62a9][_0x5061('0x71')]||![],'penalty':_0x4e58fc['body'][_0x5061('0x78')]||0x0}));}}return BPromise[_0x5061('0x8d')](_0x166e95);}})['then'](function(){return _0x3092d3;})[_0x5061('0x2d')](respondWithResult(_0x1b57eb,null))[_0x5061('0x4f')](handleError(_0x1b57eb,null));};exports[_0x5061('0x91')]=function(_0x35f519,_0x31ed92,_0x37d0ec){return db['VoiceQueue'][_0x5061('0x34')]({'where':{'id':_0x35f519['params']['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x31ed92,null))['then'](function(_0x4d3d57){if(_0x4d3d57){return _0x4d3d57[_0x5061('0x91')](_0x35f519['query'][_0x5061('0x7f')])[_0x5061('0x2d')](function(){if(_[_0x5061('0x97')](_0x35f519[_0x5061('0x3c')][_0x5061('0x7f')])){for(var _0x235271=0x0;_0x235271<_0x35f519[_0x5061('0x3c')]['ids'][_0x5061('0x42')];_0x235271+=0x1){socket[_0x5061('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x35f519['query'][_0x5061('0x7f')][_0x235271]),'VoiceQueueId':Number(_0x35f519[_0x5061('0x51')]['id'])});}}else{socket[_0x5061('0x7d')](_0x5061('0x98'),{'UserId':Number(_0x35f519['query'][_0x5061('0x7f')]),'VoiceQueueId':Number(_0x35f519[_0x5061('0x51')]['id'])});}});}})[_0x5061('0x2d')](function(_0x1e602f){return db[_0x5061('0x92')][_0x5061('0x36')]({'where':{'VoiceQueueId':_0x35f519['params']['id'],'UserId':_0x35f519[_0x5061('0x3c')][_0x5061('0x7f')]}})[_0x5061('0x2d')](function(){return _0x1e602f;});})[_0x5061('0x2d')](respondWithStatusCode(_0x31ed92,null))[_0x5061('0x4f')](handleError(_0x31ed92,null));};exports[_0x5061('0x99')]=function(_0x3802af,_0x5540bf,_0x3cb130){var _0x2bc273={};var _0x107527={};var _0x2a656b;var _0x58a7cd;return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x3802af['params']['id']}})['then'](handleEntityNotFound(_0x5540bf,null))['then'](function(_0x1f986f){if(_0x1f986f){_0x2a656b=_0x1f986f;_0x107527['model']=_[_0x5061('0x3d')](db[_0x5061('0x80')]['rawAttributes']);_0x107527[_0x5061('0x3c')]=_['keys'](_0x3802af['query']);_0x107527['filters']=_['intersection'](_0x107527[_0x5061('0x3b')],_0x107527[_0x5061('0x3c')]);_0x2bc273['attributes']=_['intersection'](_0x107527['model'],qs[_0x5061('0x41')](_0x3802af[_0x5061('0x3c')][_0x5061('0x41')]));_0x2bc273['attributes']=_0x2bc273[_0x5061('0x40')][_0x5061('0x42')]?_0x2bc273[_0x5061('0x40')]:_0x107527[_0x5061('0x3b')];_0x2bc273[_0x5061('0x45')]=qs['sort'](_0x3802af[_0x5061('0x3c')][_0x5061('0x46')]);_0x2bc273['where']=qs['filters'](_[_0x5061('0x48')](_0x3802af['query'],_0x107527[_0x5061('0x3e')]));if(_0x3802af[_0x5061('0x3c')][_0x5061('0x30')]){_0x2bc273[_0x5061('0x47')]=_[_0x5061('0x62')](_0x2bc273[_0x5061('0x47')],{'$or':_['map'](_0x2bc273[_0x5061('0x40')],function(_0x5ce3fe){var _0x9bf418={};_0x9bf418[_0x5ce3fe]={'$like':'%'+_0x3802af[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x9bf418;})});}_0x2bc273=_[_0x5061('0x62')]({},_0x2bc273,_0x3802af[_0x5061('0x4a')]);return _0x2a656b[_0x5061('0x99')](_0x2bc273);}})['then'](function(_0x3e6f6e){if(_0x3e6f6e){_0x58a7cd=_0x3e6f6e[_0x5061('0x42')];if(!_0x3802af[_0x5061('0x3c')]['hasOwnProperty']('nolimit')){_0x2bc273[_0x5061('0x26')]=qs[_0x5061('0x26')](_0x3802af[_0x5061('0x3c')][_0x5061('0x26')]);_0x2bc273[_0x5061('0x24')]=qs['offset'](_0x3802af['query'][_0x5061('0x24')]);}return _0x2a656b[_0x5061('0x99')](_0x2bc273);}})[_0x5061('0x2d')](function(_0x494107){if(_0x494107){return _0x494107?{'count':_0x58a7cd,'rows':_0x494107}:null;}})[_0x5061('0x2d')](respondWithResult(_0x5540bf,null))[_0x5061('0x4f')](handleError(_0x5540bf,null));};exports[_0x5061('0x9a')]=function(_0x1f7bf5,_0x4730b1,_0x32acf1){var _0x4c777e={};var _0x5654af={};var _0x2d949c;var _0x3942cc;return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x1f7bf5[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x4730b1,null))[_0x5061('0x2d')](function(_0x3e05fc){if(_0x3e05fc){_0x2d949c=_0x3e05fc;_0x5654af[_0x5061('0x3b')]=_[_0x5061('0x3d')](db[_0x5061('0x92')]['rawAttributes']);_0x5654af[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x1f7bf5['query']);_0x5654af[_0x5061('0x3e')]=_[_0x5061('0x3f')](_0x5654af[_0x5061('0x3b')],_0x5654af['query']);_0x4c777e[_0x5061('0x40')]=_[_0x5061('0x3f')](_0x5654af[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x1f7bf5[_0x5061('0x3c')][_0x5061('0x41')]));_0x4c777e['attributes']=_0x4c777e[_0x5061('0x40')][_0x5061('0x42')]?_0x4c777e[_0x5061('0x40')]:_0x5654af[_0x5061('0x3b')];_0x4c777e['order']=qs['sort'](_0x1f7bf5[_0x5061('0x3c')]['sort']);_0x4c777e[_0x5061('0x47')]=qs['filters'](_[_0x5061('0x48')](_0x1f7bf5[_0x5061('0x3c')],_0x5654af[_0x5061('0x3e')]));if(_0x1f7bf5[_0x5061('0x3c')]['filter']){_0x4c777e[_0x5061('0x47')]=_['merge'](_0x4c777e[_0x5061('0x47')],{'$or':_[_0x5061('0x32')](_0x4c777e['attributes'],function(_0x3de017){var _0x3c9c31={};_0x3c9c31[_0x3de017]={'$like':'%'+_0x1f7bf5[_0x5061('0x3c')][_0x5061('0x30')]+'%'};return _0x3c9c31;})});}_0x4c777e=_[_0x5061('0x62')]({},_0x4c777e,_0x1f7bf5[_0x5061('0x4a')]);return _0x2d949c[_0x5061('0x9a')](_0x4c777e);}})[_0x5061('0x2d')](function(_0x1bbab4){if(_0x1bbab4){_0x3942cc=_0x1bbab4['length'];if(!_0x1f7bf5[_0x5061('0x3c')]['hasOwnProperty']('nolimit')){_0x4c777e[_0x5061('0x26')]=qs[_0x5061('0x26')](_0x1f7bf5['query']['limit']);_0x4c777e[_0x5061('0x24')]=qs[_0x5061('0x24')](_0x1f7bf5[_0x5061('0x3c')][_0x5061('0x24')]);}return _0x2d949c['getMembers'](_0x4c777e);}})[_0x5061('0x2d')](function(_0x5465ca){return _0x5465ca?{'count':_0x3942cc,'rows':_0x5465ca}:null;})[_0x5061('0x2d')](respondWithResult(_0x4730b1,null))['catch'](handleError(_0x4730b1,null));};exports[_0x5061('0x9b')]=function(_0xc421c6,_0x3c807d,_0x5324a9){var _0x3bf15c={};var _0x144c5d={};var _0x4cddb2;var _0x49e3c2;return db['VoiceQueue']['findOne']({'where':{'id':_0xc421c6['params']['id']}})['then'](handleEntityNotFound(_0x3c807d,null))[_0x5061('0x2d')](function(_0x478935){if(_0x478935){_0x4cddb2=_0x478935;_0x144c5d[_0x5061('0x3b')]=_[_0x5061('0x3d')](db[_0x5061('0x9c')]['rawAttributes']);_0x144c5d['query']=_['keys'](_0xc421c6['query']);_0x144c5d[_0x5061('0x3e')]=_['intersection'](_0x144c5d[_0x5061('0x3b')],_0x144c5d[_0x5061('0x3c')]);_0x3bf15c['attributes']=_[_0x5061('0x3f')](_0x144c5d[_0x5061('0x3b')],qs['fields'](_0xc421c6[_0x5061('0x3c')][_0x5061('0x41')]));_0x3bf15c[_0x5061('0x40')]=_0x3bf15c[_0x5061('0x40')][_0x5061('0x42')]?_0x3bf15c[_0x5061('0x40')]:_0x144c5d[_0x5061('0x3b')];_0x3bf15c[_0x5061('0x45')]=qs[_0x5061('0x46')](_0xc421c6[_0x5061('0x3c')]['sort']);_0x3bf15c['where']=qs[_0x5061('0x3e')](_[_0x5061('0x48')](_0xc421c6[_0x5061('0x3c')],_0x144c5d[_0x5061('0x3e')]));if(_0xc421c6[_0x5061('0x3c')][_0x5061('0x30')]){_0x3bf15c['where']=_['merge'](_0x3bf15c[_0x5061('0x47')],{'$or':_['map'](_0x3bf15c[_0x5061('0x40')],function(_0x2bfc32){var _0x56f201={};_0x56f201[_0x2bfc32]={'$like':'%'+_0xc421c6['query'][_0x5061('0x30')]+'%'};return _0x56f201;})});}_0x3bf15c=_[_0x5061('0x62')]({},_0x3bf15c,_0xc421c6['options']);return _0x4cddb2[_0x5061('0x9b')](_0x3bf15c);}})['then'](function(_0x449e97){if(_0x449e97){_0x49e3c2=_0x449e97['length'];if(!_0xc421c6[_0x5061('0x3c')][_0x5061('0x43')](_0x5061('0x44'))){_0x3bf15c[_0x5061('0x26')]=qs['limit'](_0xc421c6[_0x5061('0x3c')]['limit']);_0x3bf15c[_0x5061('0x24')]=qs[_0x5061('0x24')](_0xc421c6['query'][_0x5061('0x24')]);}return _0x4cddb2[_0x5061('0x9b')](_0x3bf15c);}})[_0x5061('0x2d')](function(_0x3edbea){if(_0x3edbea){return _0x3edbea?{'count':_0x49e3c2,'rows':_0x3edbea}:null;}})[_0x5061('0x2d')](respondWithResult(_0x3c807d,null))[_0x5061('0x4f')](handleError(_0x3c807d,null));};exports['addLists']=function(_0x2496d8,_0x3e5464,_0x119319){var _0x1fc63f,_0x24c32e;return db['VoiceQueue'][_0x5061('0x34')]({'where':{'id':_0x2496d8[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x3e5464,null))[_0x5061('0x2d')](function(_0x3da4ab){if(_0x3da4ab){_0x24c32e=_0x3da4ab;return _0x3da4ab[_0x5061('0x9d')](_0x2496d8[_0x5061('0x54')]['ids'],_[_0x5061('0x5f')](_0x2496d8[_0x5061('0x54')],['ids','id'])||{});}return null;})[_0x5061('0x94')](function(_0xcd4b7d){var _0x4f9eaf;_0x1fc63f=_0xcd4b7d||[];var _0x841260=[];if(_0xcd4b7d){for(var _0x53edeb=0x0;_0x53edeb<_0xcd4b7d[_0x5061('0x42')];_0x53edeb+=0x1){var _0x2fb229=_0xcd4b7d[_0x53edeb][_0x5061('0x56')]({'plain':!![]});_0x24c32e[_0x5061('0x9e')]=_0x2496d8['body']['dialCheckDuplicateType']?_0x2496d8[_0x5061('0x54')][_0x5061('0x9e')]:_0x24c32e[_0x5061('0x9e')];switch(_0x24c32e[_0x5061('0x9e')]){case _0x5061('0x9f'):_0x4f9eaf=squel[_0x5061('0xa0')]()[_0x5061('0xa1')](_0x5061('0xa2'))[_0x5061('0xa3')](['phone','scheduledAt',_0x5061('0xa4'),_0x5061('0xa5'),'VoiceQueueId',_0x5061('0x60'),_0x5061('0x61')],squel[_0x5061('0xa6')]()[_0x5061('0x81')](_0x5061('0xa7'),_0x5061('0xa7'))[_0x5061('0x81')](_0x5061('0xa8'),'scheduledAt')['field']('id',_0x5061('0xa4'))[_0x5061('0x81')](_0x2fb229[_0x5061('0xa9')][_0x5061('0xaa')](),_0x5061('0xa5'))['field'](_0x2496d8['params']['id'][_0x5061('0xaa')](),_0x5061('0x68'))[_0x5061('0x81')]('NOW()',_0x5061('0x60'))[_0x5061('0x81')](_0x5061('0xa8'),_0x5061('0x61'))[_0x5061('0x82')](_0x5061('0xab'))[_0x5061('0x47')](_0x5061('0xac'))[_0x5061('0x47')](_0x5061('0xad'),_0x2fb229[_0x5061('0xa9')][_0x5061('0xaa')]())[_0x5061('0x47')](_0x5061('0xae'))[_0x5061('0x47')](_0x5061('0xaf'),squel['select']()[_0x5061('0x81')](_0x5061('0xb0'))['from'](_0x5061('0xb1'))['where'](_0x5061('0x85'),_0x2496d8[_0x5061('0x51')]['id'][_0x5061('0xaa')]()))[_0x5061('0x47')](_0x5061('0xaf'),squel['select']()[_0x5061('0x81')](_0x5061('0xb2'))['from'](_0x5061('0xa2'))['where'](_0x5061('0x85'),_0x2496d8[_0x5061('0x51')]['id'][_0x5061('0xaa')]())))[_0x5061('0xaa')]();break;case'onlyIfOpen':_0x4f9eaf=squel['insert']()[_0x5061('0xa1')]('cm_hopper')['fromQuery']([_0x5061('0xa7'),_0x5061('0xb3'),_0x5061('0xa4'),_0x5061('0xa5'),'VoiceQueueId',_0x5061('0x60'),_0x5061('0x61')],squel['select']()[_0x5061('0x81')](_0x5061('0xa7'),_0x5061('0xa7'))[_0x5061('0x81')](_0x5061('0xa8'),_0x5061('0xb3'))[_0x5061('0x81')]('id',_0x5061('0xa4'))[_0x5061('0x81')](_0x2fb229[_0x5061('0xa9')][_0x5061('0xaa')](),_0x5061('0xa5'))[_0x5061('0x81')](_0x2496d8['params']['id'][_0x5061('0xaa')](),_0x5061('0x68'))[_0x5061('0x81')]('NOW()',_0x5061('0x60'))[_0x5061('0x81')](_0x5061('0xa8'),_0x5061('0x61'))['from'](_0x5061('0xab'))[_0x5061('0x47')]('deletedAt\x20IS\x20NULL')[_0x5061('0x47')]('ListId\x20=\x20?',_0x2fb229[_0x5061('0xa9')][_0x5061('0xaa')]())[_0x5061('0x47')](_0x5061('0xae'))[_0x5061('0x47')](_0x5061('0xaf'),squel[_0x5061('0xa6')]()['field'](_0x5061('0xb2'))[_0x5061('0x82')](_0x5061('0xa2'))['where'](_0x5061('0x85'),_0x2496d8[_0x5061('0x51')]['id']['toString']())))[_0x5061('0xaa')]();break;default:_0x4f9eaf=squel['insert']()[_0x5061('0xa1')]('cm_hopper')[_0x5061('0xa3')]([_0x5061('0xa7'),_0x5061('0xb3'),_0x5061('0xa4'),_0x5061('0xa5'),_0x5061('0x68'),'createdAt',_0x5061('0x61')],squel[_0x5061('0xa6')]()[_0x5061('0x81')](_0x5061('0xa7'),_0x5061('0xa7'))[_0x5061('0x81')](_0x5061('0xa8'),_0x5061('0xb3'))[_0x5061('0x81')]('id',_0x5061('0xa4'))[_0x5061('0x81')](_0x2fb229['CmListId'][_0x5061('0xaa')](),_0x5061('0xa5'))[_0x5061('0x81')](_0x2496d8[_0x5061('0x51')]['id'][_0x5061('0xaa')](),'VoiceQueueId')['field'](_0x5061('0xa8'),_0x5061('0x60'))['field']('NOW()',_0x5061('0x61'))[_0x5061('0x82')](_0x5061('0xab'))[_0x5061('0x47')](_0x5061('0xac'))[_0x5061('0x47')](_0x5061('0xad'),_0x2fb229[_0x5061('0xa9')][_0x5061('0xaa')]())[_0x5061('0x47')](_0x5061('0xae')))[_0x5061('0xaa')]();}_0x841260[_0x5061('0x88')](db[_0x5061('0x75')]['query'](_0x4f9eaf));}return BPromise['all'](_0x841260);}})[_0x5061('0x2d')](function(){return _0x1fc63f;})[_0x5061('0x2d')](respondWithResult(_0x3e5464,null))['catch'](handleError(_0x3e5464,null));};exports[_0x5061('0xb4')]=function(_0x335f7b,_0x2ecaf8,_0x32c055){return db[_0x5061('0x3a')][_0x5061('0x34')]({'where':{'id':_0x335f7b[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x2ecaf8,null))[_0x5061('0x2d')](function(_0x17ef37){if(_0x17ef37){return _0x17ef37[_0x5061('0xb4')](_0x335f7b[_0x5061('0x3c')][_0x5061('0x7f')]);}})['then'](function(_0x583d19){if(_0x583d19){return db[_0x5061('0x67')]['destroy']({'where':{'ListId':_0x335f7b[_0x5061('0x3c')][_0x5061('0x7f')],'VoiceQueueId':_0x335f7b[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](function(){return _0x583d19;});}})[_0x5061('0x2d')](respondWithStatusCode(_0x2ecaf8,null))[_0x5061('0x4f')](handleError(_0x2ecaf8,null));};exports['getBlackLists']=function(_0x8d4dea,_0x51634e,_0x42783d){var _0x178697={};var _0x4a9631={};var _0x167f5f;var _0x96ed93;return db[_0x5061('0x3a')][_0x5061('0x66')]({'where':{'id':_0x8d4dea[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x51634e,null))[_0x5061('0x2d')](function(_0x217051){if(_0x217051){_0x167f5f=_0x217051;_0x4a9631[_0x5061('0x3b')]=_['keys'](db[_0x5061('0x9c')]['rawAttributes']);_0x4a9631[_0x5061('0x3c')]=_[_0x5061('0x3d')](_0x8d4dea[_0x5061('0x3c')]);_0x4a9631['filters']=_['intersection'](_0x4a9631[_0x5061('0x3b')],_0x4a9631[_0x5061('0x3c')]);_0x178697['attributes']=_[_0x5061('0x3f')](_0x4a9631[_0x5061('0x3b')],qs[_0x5061('0x41')](_0x8d4dea[_0x5061('0x3c')][_0x5061('0x41')]));_0x178697[_0x5061('0x40')]=_0x178697[_0x5061('0x40')]['length']?_0x178697[_0x5061('0x40')]:_0x4a9631['model'];_0x178697[_0x5061('0x45')]=qs[_0x5061('0x46')](_0x8d4dea['query'][_0x5061('0x46')]);_0x178697['where']=qs[_0x5061('0x3e')](_['pick'](_0x8d4dea[_0x5061('0x3c')],_0x4a9631[_0x5061('0x3e')]));if(_0x8d4dea[_0x5061('0x3c')]['filter']){_0x178697[_0x5061('0x47')]=_[_0x5061('0x62')](_0x178697[_0x5061('0x47')],{'$or':_[_0x5061('0x32')](_0x178697[_0x5061('0x40')],function(_0x374950){var _0x41f7ae={};_0x41f7ae[_0x374950]={'$like':'%'+_0x8d4dea['query'][_0x5061('0x30')]+'%'};return _0x41f7ae;})});}_0x178697=_[_0x5061('0x62')]({},_0x178697,_0x8d4dea[_0x5061('0x4a')]);return _0x167f5f[_0x5061('0xb5')](_0x178697);}})['then'](function(_0x3a2641){if(_0x3a2641){_0x96ed93=_0x3a2641[_0x5061('0x42')];if(!_0x8d4dea[_0x5061('0x3c')][_0x5061('0x43')](_0x5061('0x44'))){_0x178697[_0x5061('0x26')]=qs['limit'](_0x8d4dea[_0x5061('0x3c')][_0x5061('0x26')]);_0x178697['offset']=qs[_0x5061('0x24')](_0x8d4dea[_0x5061('0x3c')][_0x5061('0x24')]);}return _0x167f5f[_0x5061('0xb5')](_0x178697);}})[_0x5061('0x2d')](function(_0x3e3c0e){if(_0x3e3c0e){return _0x3e3c0e?{'count':_0x96ed93,'rows':_0x3e3c0e}:null;}})[_0x5061('0x2d')](respondWithResult(_0x51634e,null))[_0x5061('0x4f')](handleError(_0x51634e,null));};exports[_0x5061('0xb6')]=function(_0x50990d,_0x4b36e6,_0x149d97){var _0x421570,_0x1ff260;return db[_0x5061('0x3a')][_0x5061('0x34')]({'where':{'id':_0x50990d[_0x5061('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b36e6,null))[_0x5061('0x2d')](function(_0x210382){if(_0x210382){_0x1ff260=_0x210382;return _0x210382['addBlackLists'](_0x50990d[_0x5061('0x54')]['ids'],_['omit'](_0x50990d[_0x5061('0x54')],[_0x5061('0x7f'),'id'])||{});}return null;})[_0x5061('0x94')](function(_0x5972c0){var _0x284344;_0x421570=_0x5972c0||[];var _0x6f5920=[];if(_0x5972c0){for(var _0x32ad16=0x0;_0x32ad16<_0x5972c0[_0x5061('0x42')];_0x32ad16+=0x1){var _0x10b2a7=_0x5972c0[_0x32ad16][_0x5061('0x56')]({'plain':!![]});_0x284344=squel['insert']()[_0x5061('0xa1')]('cm_hopper_black')[_0x5061('0xa3')](['phone',_0x5061('0xa4'),'ListId',_0x5061('0x68'),_0x5061('0x60'),_0x5061('0x61')],squel['select']()['field']('phone',_0x5061('0xa7'))[_0x5061('0x81')]('id',_0x5061('0xa4'))[_0x5061('0x81')](_0x10b2a7[_0x5061('0xa9')]['toString'](),'ListId')[_0x5061('0x81')](_0x50990d['params']['id'][_0x5061('0xaa')](),'VoiceQueueId')['field'](_0x5061('0xa8'),'createdAt')[_0x5061('0x81')]('NOW()','updatedAt')['from']('cm_contacts')[_0x5061('0x47')](_0x5061('0xac'))[_0x5061('0x47')]('ListId\x20=\x20?',_0x10b2a7['CmListId']['toString']())[_0x5061('0x47')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x6f5920[_0x5061('0x88')](db[_0x5061('0x75')][_0x5061('0x3c')](_0x284344));}return BPromise[_0x5061('0x8d')](_0x6f5920);}})[_0x5061('0x2d')](function(){return _0x421570;})[_0x5061('0x2d')](respondWithResult(_0x4b36e6,null))[_0x5061('0x4f')](handleError(_0x4b36e6,null));};exports[_0x5061('0xb7')]=function(_0x37bdd6,_0x57556d,_0x126a46){return db[_0x5061('0x3a')][_0x5061('0x34')]({'where':{'id':_0x37bdd6['params']['id']}})[_0x5061('0x2d')](handleEntityNotFound(_0x57556d,null))[_0x5061('0x2d')](function(_0x195219){if(_0x195219){return _0x195219[_0x5061('0xb7')](_0x37bdd6[_0x5061('0x3c')][_0x5061('0x7f')]);}})[_0x5061('0x2d')](function(_0x27312c){if(_0x27312c){return db[_0x5061('0x6c')][_0x5061('0x36')]({'where':{'ListId':_0x37bdd6[_0x5061('0x3c')][_0x5061('0x7f')],'VoiceQueueId':_0x37bdd6[_0x5061('0x51')]['id']}})[_0x5061('0x2d')](function(){return _0x27312c;});}})['then'](respondWithStatusCode(_0x57556d,null))[_0x5061('0x4f')](handleError(_0x57556d,null));}; \ No newline at end of file +var _0xa99e=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceQueue','key','model','keys','intersection','query','attributes','fields','length','order','sort','pick','where','merge','options','includeAll','include','then','rows','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','QueueCampaigns','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','filters','findAll','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','forEach','sequelize','transaction','each','TeamVoiceQueue','upsert','penalty','UserVoiceQueue','UserVoiceQueueRt','isNil','interface','format','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','User','push','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x3e0eee,_0x5ea422){var _0xaf9897=function(_0x59a0c7){while(--_0x59a0c7){_0x3e0eee['push'](_0x3e0eee['shift']());}};_0xaf9897(++_0x5ea422);}(_0xa99e,0xb3));var _0xea99=function(_0x4004b1,_0x12e883){_0x4004b1=_0x4004b1-0x0;var _0x45ad29=_0xa99e[_0x4004b1];return _0x45ad29;};'use strict';var emlformat=require(_0xea99('0x0'));var rimraf=require(_0xea99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea99('0x2'));var rp=require('request-promise');var moment=require(_0xea99('0x3'));var BPromise=require(_0xea99('0x4'));var Mustache=require(_0xea99('0x5'));var util=require('util');var path=require(_0xea99('0x6'));var sox=require(_0xea99('0x7'));var csv=require(_0xea99('0x8'));var ejs=require(_0xea99('0x9'));var fs=require('fs');var fs_extra=require(_0xea99('0xa'));var _=require(_0xea99('0xb'));var squel=require('squel');var crypto=require(_0xea99('0xc'));var jsforce=require(_0xea99('0xd'));var deskjs=require(_0xea99('0xe'));var toCsv=require(_0xea99('0x8'));var querystring=require(_0xea99('0xf'));var Papa=require(_0xea99('0x10'));var Redis=require(_0xea99('0x11'));var authService=require(_0xea99('0x12'));var qs=require(_0xea99('0x13'));var as=require(_0xea99('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea99('0x15'))('api');var utils=require(_0xea99('0x16'));var config=require(_0xea99('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xea99('0x18')](config['redis'],{'host':_0xea99('0x19'),'port':0x18eb});var socket=require(_0xea99('0x1a'))(new Redis(config[_0xea99('0x1b')]));require(_0xea99('0x1c'))[_0xea99('0x1d')](socket);function respondWithStatusCode(_0x20c78a,_0x124556){_0x124556=_0x124556||0xcc;return function(_0xb1ea69){if(_0xb1ea69){return _0x20c78a[_0xea99('0x1e')](_0x124556);}return _0x20c78a[_0xea99('0x1f')](_0x124556)[_0xea99('0x20')]();};}function respondWithResult(_0x4ae20d,_0xccb880){_0xccb880=_0xccb880||0xc8;return function(_0x1a263c){if(_0x1a263c){return _0x4ae20d[_0xea99('0x1f')](_0xccb880)[_0xea99('0x21')](_0x1a263c);}};}function respondWithFilteredResult(_0x46a2a8,_0x40855a){return function(_0x48491c){if(_0x48491c){var _0x250044=typeof _0x40855a[_0xea99('0x22')]===_0xea99('0x23')&&typeof _0x40855a[_0xea99('0x24')]===_0xea99('0x23');var _0x5daa13=_0x48491c['count'];var _0x5071a4=_0x250044?0x0:_0x40855a[_0xea99('0x22')];var _0x1e0de5=_0x250044?_0x48491c[_0xea99('0x25')]:_0x40855a[_0xea99('0x22')]+_0x40855a[_0xea99('0x24')];var _0x2279f8;if(_0x1e0de5>=_0x5daa13){_0x1e0de5=_0x5daa13;_0x2279f8=0xc8;}else{_0x2279f8=0xce;}_0x46a2a8[_0xea99('0x1f')](_0x2279f8);return _0x46a2a8[_0xea99('0x26')]('Content-Range',_0x5071a4+'-'+_0x1e0de5+'/'+_0x5daa13)[_0xea99('0x21')](_0x48491c);}return null;};}function patchUpdates(_0x2aae08){return function(_0x1005f3){try{jsonpatch[_0xea99('0x27')](_0x1005f3,_0x2aae08,!![]);}catch(_0x45877d){return BPromise[_0xea99('0x28')](_0x45877d);}return _0x1005f3[_0xea99('0x29')]();};}function saveUpdates(_0x35380c,_0x28c431){return function(_0x1a447b){if(_0x1a447b){return _0x1a447b[_0xea99('0x2a')](_0x35380c)['then'](function(_0x30452b){return _0x30452b;});}return null;};}function removeEntity(_0x37b47c,_0x22f048){return function(_0x3092cb){if(_0x3092cb){return _0x3092cb[_0xea99('0x2b')]()['then'](function(){var _0x38d53a=_0x3092cb[_0xea99('0x2c')]({'plain':!![]});var _0x4c8d07=[{'name':_0xea99('0x2d'),'value':_0xea99('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0xea99('0x2f'),'ignore':![]}];var _0x236dfd=_(_0x4c8d07)[_0xea99('0x30')](_0xea99('0x31'))[_0xea99('0x32')](_0xea99('0x33'))[_0xea99('0x33')]();if(_[_0xea99('0x34')](_0x236dfd,_0x38d53a[_0xea99('0x35')])){return;}var _0x396f8f=_[_0xea99('0x36')](_0x4c8d07,['value',_0x38d53a[_0xea99('0x35')]])[_0xea99('0x37')];return db[_0xea99('0x38')]['destroy']({'where':{'type':_0x396f8f,'resourceId':_0x38d53a['id']}})['then'](function(){return _0x3092cb;});})['then'](function(){_0x37b47c[_0xea99('0x1f')](0xcc)[_0xea99('0x20')]();});}};}function handleEntityNotFound(_0x7895dd,_0x5ad983){return function(_0x2af626){if(!_0x2af626){_0x7895dd[_0xea99('0x1e')](0x194);}return _0x2af626;};}function handleError(_0x43df81,_0x4d75d3){_0x4d75d3=_0x4d75d3||0x1f4;return function(_0x22203e){logger[_0xea99('0x39')](_0x22203e['stack']);if(_0x22203e['name']){delete _0x22203e['name'];}_0x43df81[_0xea99('0x1f')](_0x4d75d3)[_0xea99('0x3a')](_0x22203e);};}exports[_0xea99('0x3b')]=function(_0x15f102,_0x46964a){var _0x1975ec={},_0x18f10c={},_0x5e5ea7={'count':0x0,'rows':[]};var _0x22d2be=_[_0xea99('0x32')](db[_0xea99('0x3c')]['rawAttributes'],function(_0x551a4e){return{'name':_0x551a4e['fieldName'],'type':_0x551a4e[_0xea99('0x35')][_0xea99('0x3d')]};});_0x18f10c[_0xea99('0x3e')]=_[_0xea99('0x32')](_0x22d2be,_0xea99('0x37'));_0x18f10c['query']=_[_0xea99('0x3f')](_0x15f102['query']);_0x18f10c['filters']=_[_0xea99('0x40')](_0x18f10c[_0xea99('0x3e')],_0x18f10c[_0xea99('0x41')]);_0x1975ec[_0xea99('0x42')]=_[_0xea99('0x40')](_0x18f10c[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x15f102[_0xea99('0x41')][_0xea99('0x43')]));_0x1975ec[_0xea99('0x42')]=_0x1975ec[_0xea99('0x42')][_0xea99('0x44')]?_0x1975ec['attributes']:_0x18f10c[_0xea99('0x3e')];if(!_0x15f102['query']['hasOwnProperty']('nolimit')){_0x1975ec[_0xea99('0x24')]=qs['limit'](_0x15f102[_0xea99('0x41')][_0xea99('0x24')]);_0x1975ec['offset']=qs[_0xea99('0x22')](_0x15f102[_0xea99('0x41')][_0xea99('0x22')]);}_0x1975ec[_0xea99('0x45')]=qs[_0xea99('0x46')](_0x15f102['query'][_0xea99('0x46')]);_0x1975ec['where']=qs['filters'](_[_0xea99('0x47')](_0x15f102['query'],_0x18f10c['filters']),_0x22d2be);if(_0x15f102[_0xea99('0x41')][_0xea99('0x30')]){_0x1975ec[_0xea99('0x48')]=_['merge'](_0x1975ec[_0xea99('0x48')],{'$or':_['map'](_0x22d2be,function(_0x95cd31){if(_0x95cd31[_0xea99('0x35')]!=='VIRTUAL'){var _0xa87b0d={};_0xa87b0d[_0x95cd31['name']]={'$like':'%'+_0x15f102['query'][_0xea99('0x30')]+'%'};return _0xa87b0d;}})});}_0x1975ec=_[_0xea99('0x49')]({},_0x1975ec,_0x15f102[_0xea99('0x4a')]);var _0x30ceac={'where':_0x1975ec['where']};return db[_0xea99('0x3c')]['count'](_0x30ceac)['then'](function(_0xabcc39){_0x5e5ea7[_0xea99('0x25')]=_0xabcc39;if(_0x15f102[_0xea99('0x41')][_0xea99('0x4b')]){_0x1975ec[_0xea99('0x4c')]=[{'all':!![]}];}return db[_0xea99('0x3c')]['findAll'](_0x1975ec);})[_0xea99('0x4d')](function(_0xffc970){_0x5e5ea7[_0xea99('0x4e')]=_0xffc970;return _0x5e5ea7;})[_0xea99('0x4d')](respondWithFilteredResult(_0x46964a,_0x1975ec))[_0xea99('0x4f')](handleError(_0x46964a,null));};exports['show']=function(_0x47f4a8,_0x49af5e){var _0x41ea32={'raw':![],'where':{'id':_0x47f4a8['params']['id']}},_0x46f870={};_0x46f870['model']=_[_0xea99('0x3f')](db[_0xea99('0x3c')][_0xea99('0x50')]);_0x46f870[_0xea99('0x41')]=_[_0xea99('0x3f')](_0x47f4a8['query']);_0x46f870['filters']=_[_0xea99('0x40')](_0x46f870[_0xea99('0x3e')],_0x46f870[_0xea99('0x41')]);_0x41ea32[_0xea99('0x42')]=_['intersection'](_0x46f870[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x47f4a8[_0xea99('0x41')]['fields']));_0x41ea32[_0xea99('0x42')]=_0x41ea32['attributes'][_0xea99('0x44')]?_0x41ea32[_0xea99('0x42')]:_0x46f870[_0xea99('0x3e')];if(_0x47f4a8[_0xea99('0x41')][_0xea99('0x4b')]){_0x41ea32[_0xea99('0x4c')]=[{'all':!![]}];}_0x41ea32=_['merge']({},_0x41ea32,_0x47f4a8['options']);return db[_0xea99('0x3c')][_0xea99('0x36')](_0x41ea32)[_0xea99('0x4d')](handleEntityNotFound(_0x49af5e,null))[_0xea99('0x4d')](respondWithResult(_0x49af5e,null))['catch'](handleError(_0x49af5e,null));};exports[_0xea99('0x51')]=function(_0x39febd,_0x4b46a2){return db[_0xea99('0x3c')][_0xea99('0x51')](_0x39febd[_0xea99('0x52')],{})[_0xea99('0x4d')](function(_0x27c35b){var _0x4a8092=_0x39febd[_0xea99('0x53')][_0xea99('0x2c')]({'plain':!![]});if(!_0x4a8092)throw new Error(_0xea99('0x54'));if(_0x4a8092[_0xea99('0x55')]===_0xea99('0x53')){var _0x43a47e=_0x27c35b[_0xea99('0x2c')]({'plain':!![]});var _0x1a7122=[{'name':_0xea99('0x2d'),'value':_0xea99('0x2e')},{'name':'QueueCampaigns','value':_0xea99('0x2f')}];var _0x1eea19=_['find'](_0x1a7122,[_0xea99('0x33'),_0x43a47e[_0xea99('0x35')]])['name'];return db[_0xea99('0x56')][_0xea99('0x36')]({'where':{'name':_0x1eea19,'userProfileId':_0x4a8092[_0xea99('0x57')]},'raw':!![]})['then'](function(_0x320825){if(_0x320825&&_0x320825[_0xea99('0x58')]===0x0){return db[_0xea99('0x38')][_0xea99('0x51')]({'name':_0x43a47e[_0xea99('0x37')],'resourceId':_0x43a47e['id'],'type':_0x320825[_0xea99('0x37')],'sectionId':_0x320825['id']},{})[_0xea99('0x4d')](function(){return _0x27c35b;});}else{return _0x27c35b;}})[_0xea99('0x4f')](function(_0xc086f0){logger['error'](_0xea99('0x59'),_0xc086f0);throw _0xc086f0;});}return _0x27c35b;})[_0xea99('0x4d')](respondWithResult(_0x4b46a2,0xc9))['catch'](handleError(_0x4b46a2,null));};exports[_0xea99('0x5a')]=function(_0x34c262,_0x38bbe5){var _0x234897={'where':{'id':_0x34c262[_0xea99('0x5b')]['id']}},_0x49df98={};_0x49df98[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x3c')][_0xea99('0x50')]);_0x234897[_0xea99('0x42')]=_[_0xea99('0x40')](_0x49df98['model'],qs[_0xea99('0x43')](_0x34c262[_0xea99('0x41')]['fields']));_0x234897[_0xea99('0x42')]=_0x234897['attributes'][_0xea99('0x44')]?_0x234897[_0xea99('0x42')]:_0x49df98[_0xea99('0x3e')];if(_0x34c262['query'][_0xea99('0x4b')]){_0x234897[_0xea99('0x4c')]=[{'all':!![]}];}_0x234897=_[_0xea99('0x49')]({},_0x234897,_0x34c262[_0xea99('0x4a')]);return db[_0xea99('0x3c')][_0xea99('0x36')](_0x234897)[_0xea99('0x4d')](handleEntityNotFound(_0x38bbe5,null))[_0xea99('0x4d')](function(_0x1c2329){if(_0x1c2329){var _0x5bc314=_0x1c2329['get']({'plain':!![]});_0x5bc314=qs[_0xea99('0x5c')](_0x5bc314,['id',_0xea99('0x5d'),_0xea99('0x5e')]);_0x34c262[_0xea99('0x52')]=_['omit'](_0x34c262[_0xea99('0x52')],['id','createdAt',_0xea99('0x5e')]);return db[_0xea99('0x3c')]['create'](_[_0xea99('0x49')](_0x5bc314,_0x34c262[_0xea99('0x52')]),{'include':_0x34c262['query'][_0xea99('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x2bbfd9){var _0x8d0c6b=_0x34c262[_0xea99('0x53')][_0xea99('0x2c')]({'plain':!![]});if(!_0x8d0c6b)throw new Error(_0xea99('0x54'));if(_0x8d0c6b[_0xea99('0x55')]==='user'){var _0xf159c3=_0x2bbfd9['get']({'plain':!![]});var _0x869250=[{'name':_0xea99('0x2d'),'value':'inbound'},{'name':_0xea99('0x5f'),'value':_0xea99('0x2f')}];var _0x243eba=_[_0xea99('0x36')](_0x869250,[_0xea99('0x33'),_0xf159c3[_0xea99('0x35')]])[_0xea99('0x37')];return db[_0xea99('0x56')][_0xea99('0x36')]({'where':{'name':_0x243eba,'userProfileId':_0x8d0c6b[_0xea99('0x57')]},'raw':!![]})[_0xea99('0x4d')](function(_0x529556){if(_0x529556&&_0x529556[_0xea99('0x58')]===0x0){return db[_0xea99('0x38')][_0xea99('0x51')]({'name':_0xf159c3['name'],'resourceId':_0xf159c3['id'],'type':_0x529556[_0xea99('0x37')],'sectionId':_0x529556['id']},{})[_0xea99('0x4d')](function(){return _0x2bbfd9;});}else{return _0x2bbfd9;}})['catch'](function(_0x2f0d7e){logger[_0xea99('0x39')](_0xea99('0x59'),_0x2f0d7e);throw _0x2f0d7e;});}return _0x2bbfd9;});}})['then'](respondWithResult(_0x38bbe5,0xc9))[_0xea99('0x4f')](handleError(_0x38bbe5,null));};exports['update']=function(_0x309ef3,_0xb2fc3){if(_0x309ef3[_0xea99('0x52')]['id']){delete _0x309ef3[_0xea99('0x52')]['id'];}return db[_0xea99('0x3c')][_0xea99('0x36')]({'where':{'id':_0x309ef3['params']['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0xb2fc3,null))[_0xea99('0x4d')](saveUpdates(_0x309ef3[_0xea99('0x52')],null))['then'](respondWithResult(_0xb2fc3,null))[_0xea99('0x4f')](handleError(_0xb2fc3,null));};exports[_0xea99('0x2b')]=function(_0x15a518,_0x17e913){return db[_0xea99('0x3c')][_0xea99('0x36')]({'where':{'id':_0x15a518[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x17e913,null))['then'](removeEntity(_0x17e913,null))[_0xea99('0x4f')](handleError(_0x17e913,null));};exports[_0xea99('0x60')]=function(_0x5443c8,_0x149419,_0x2745ec){var _0x130ef9={'raw':![],'where':{}};var _0x244f4c={};var _0x568a32={'count':0x0,'rows':[]};return db[_0xea99('0x3c')][_0xea99('0x61')]({'where':{'id':_0x5443c8[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x149419,null))[_0xea99('0x4d')](function(_0x1eeaa5){if(_0x1eeaa5){_0x244f4c[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x62')][_0xea99('0x50')]);_0x244f4c[_0xea99('0x41')]=_[_0xea99('0x3f')](_0x5443c8['query']);_0x244f4c['filters']=_[_0xea99('0x40')](_0x244f4c['model'],_0x244f4c[_0xea99('0x41')]);_0x130ef9[_0xea99('0x42')]=_[_0xea99('0x40')](_0x244f4c[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x5443c8[_0xea99('0x41')]['fields']));_0x130ef9[_0xea99('0x42')]=_0x130ef9[_0xea99('0x42')][_0xea99('0x44')]?_0x130ef9[_0xea99('0x42')]:_0x244f4c[_0xea99('0x3e')];if(!_0x5443c8[_0xea99('0x41')][_0xea99('0x63')](_0xea99('0x64'))){_0x130ef9['limit']=qs['limit'](_0x5443c8['query']['limit']);_0x130ef9[_0xea99('0x22')]=qs[_0xea99('0x22')](_0x5443c8[_0xea99('0x41')][_0xea99('0x22')]);}_0x130ef9[_0xea99('0x45')]=qs['sort'](_0x5443c8[_0xea99('0x41')][_0xea99('0x46')]);_0x130ef9[_0xea99('0x48')]=qs[_0xea99('0x65')](_[_0xea99('0x47')](_0x5443c8[_0xea99('0x41')],_0x244f4c[_0xea99('0x65')]));_0x130ef9[_0xea99('0x48')]['VoiceQueueId']=_0x1eeaa5['id'];if(_0x5443c8['query'][_0xea99('0x30')]){_0x130ef9['where']=_[_0xea99('0x49')](_0x130ef9['where'],{'$or':_[_0xea99('0x32')](_0x130ef9[_0xea99('0x42')],function(_0x419a98){var _0x3522a3={};_0x3522a3[_0x419a98]={'$like':'%'+_0x5443c8[_0xea99('0x41')][_0xea99('0x30')]+'%'};return _0x3522a3;})});}_0x130ef9=_[_0xea99('0x49')]({},_0x130ef9,_0x5443c8['options']);return db[_0xea99('0x62')][_0xea99('0x25')]({'where':_0x130ef9['where']})[_0xea99('0x4d')](function(_0x5066ec){_0x568a32['count']=_0x5066ec;if(_0x5443c8[_0xea99('0x41')]['includeAll']){_0x130ef9[_0xea99('0x4c')]=[{'all':!![]}];}return db[_0xea99('0x62')][_0xea99('0x66')](_0x130ef9);})[_0xea99('0x4d')](function(_0x31da01){_0x568a32[_0xea99('0x4e')]=_0x31da01;return _0x568a32;});}})['then'](respondWithFilteredResult(_0x149419,_0x130ef9))[_0xea99('0x4f')](handleError(_0x149419,null));};exports[_0xea99('0x67')]=function(_0x3f3aec,_0x5db90f,_0x3dd80b){var _0x5666af={'raw':!![],'where':{}};var _0x4eb523={};var _0x28e9da={'count':0x0,'rows':[]};return db[_0xea99('0x3c')]['findOne']({'where':{'id':_0x3f3aec[_0xea99('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5db90f,null))[_0xea99('0x4d')](function(_0x38613a){if(_0x38613a){_0x4eb523[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x68')][_0xea99('0x50')]);_0x4eb523['query']=_['keys'](_0x3f3aec['query']);_0x4eb523[_0xea99('0x65')]=_['intersection'](_0x4eb523['model'],_0x4eb523[_0xea99('0x41')]);_0x5666af[_0xea99('0x42')]=_[_0xea99('0x40')](_0x4eb523[_0xea99('0x3e')],qs['fields'](_0x3f3aec['query'][_0xea99('0x43')]));_0x5666af[_0xea99('0x42')]=_0x5666af[_0xea99('0x42')]['length']?_0x5666af[_0xea99('0x42')]:_0x4eb523[_0xea99('0x3e')];if(!_0x3f3aec[_0xea99('0x41')][_0xea99('0x63')](_0xea99('0x64'))){_0x5666af[_0xea99('0x24')]=qs[_0xea99('0x24')](_0x3f3aec[_0xea99('0x41')][_0xea99('0x24')]);_0x5666af['offset']=qs['offset'](_0x3f3aec[_0xea99('0x41')][_0xea99('0x22')]);}_0x5666af[_0xea99('0x45')]=qs[_0xea99('0x46')](_0x3f3aec['query'][_0xea99('0x46')]);_0x5666af[_0xea99('0x48')]=qs['filters'](_[_0xea99('0x47')](_0x3f3aec['query'],_0x4eb523[_0xea99('0x65')]));_0x5666af[_0xea99('0x48')][_0xea99('0x69')]=_0x38613a['id'];if(_0x3f3aec['query']['filter']){_0x5666af[_0xea99('0x48')]=_['merge'](_0x5666af[_0xea99('0x48')],{'$or':_[_0xea99('0x32')](_0x5666af[_0xea99('0x42')],function(_0x2d0eb6){var _0x4481a2={};_0x4481a2[_0x2d0eb6]={'$like':'%'+_0x3f3aec[_0xea99('0x41')]['filter']+'%'};return _0x4481a2;})});}_0x5666af=_['merge']({},_0x5666af,_0x3f3aec[_0xea99('0x4a')]);return db['CmHopperHistory'][_0xea99('0x25')]({'where':_0x5666af[_0xea99('0x48')]})[_0xea99('0x4d')](function(_0x429cd1){_0x28e9da[_0xea99('0x25')]=_0x429cd1;if(_0x3f3aec[_0xea99('0x41')]['includeAll']){_0x5666af[_0xea99('0x4c')]=[{'all':!![]}];}return db[_0xea99('0x68')][_0xea99('0x66')](_0x5666af);})[_0xea99('0x4d')](function(_0x51996a){_0x28e9da['rows']=_0x51996a;return _0x28e9da;});}})[_0xea99('0x4d')](respondWithFilteredResult(_0x5db90f,_0x5666af))[_0xea99('0x4f')](handleError(_0x5db90f,null));};exports[_0xea99('0x6a')]=function(_0x9d1c81,_0x8a832c,_0x175087){var _0x529beb={'raw':!![],'where':{}};var _0x4bafb0={};var _0xb7cc0d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xea99('0x61')]({'where':{'id':_0x9d1c81[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x8a832c,null))[_0xea99('0x4d')](function(_0x36651c){if(_0x36651c){_0x4bafb0['model']=_[_0xea99('0x3f')](db['CmHopperFinal']['rawAttributes']);_0x4bafb0['query']=_[_0xea99('0x3f')](_0x9d1c81['query']);_0x4bafb0[_0xea99('0x65')]=_[_0xea99('0x40')](_0x4bafb0['model'],_0x4bafb0[_0xea99('0x41')]);_0x529beb['attributes']=_['intersection'](_0x4bafb0[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x9d1c81[_0xea99('0x41')][_0xea99('0x43')]));_0x529beb[_0xea99('0x42')]=_0x529beb[_0xea99('0x42')][_0xea99('0x44')]?_0x529beb[_0xea99('0x42')]:_0x4bafb0[_0xea99('0x3e')];if(!_0x9d1c81[_0xea99('0x41')][_0xea99('0x63')]('nolimit')){_0x529beb[_0xea99('0x24')]=qs[_0xea99('0x24')](_0x9d1c81[_0xea99('0x41')][_0xea99('0x24')]);_0x529beb[_0xea99('0x22')]=qs[_0xea99('0x22')](_0x9d1c81[_0xea99('0x41')][_0xea99('0x22')]);}_0x529beb['order']=qs[_0xea99('0x46')](_0x9d1c81[_0xea99('0x41')][_0xea99('0x46')]);_0x529beb[_0xea99('0x48')]=qs['filters'](_[_0xea99('0x47')](_0x9d1c81['query'],_0x4bafb0[_0xea99('0x65')]));_0x529beb[_0xea99('0x48')]['VoiceQueueId']=_0x36651c['id'];if(_0x9d1c81[_0xea99('0x41')]['filter']){_0x529beb['where']=_[_0xea99('0x49')](_0x529beb[_0xea99('0x48')],{'$or':_[_0xea99('0x32')](_0x529beb[_0xea99('0x42')],function(_0x5554f0){var _0xfb6c68={};_0xfb6c68[_0x5554f0]={'$like':'%'+_0x9d1c81[_0xea99('0x41')][_0xea99('0x30')]+'%'};return _0xfb6c68;})});}_0x529beb=_[_0xea99('0x49')]({},_0x529beb,_0x9d1c81[_0xea99('0x4a')]);return db[_0xea99('0x6b')][_0xea99('0x25')]({'where':_0x529beb[_0xea99('0x48')]})[_0xea99('0x4d')](function(_0x4f9736){_0xb7cc0d['count']=_0x4f9736;if(_0x9d1c81['query']['includeAll']){_0x529beb[_0xea99('0x4c')]=[{'all':!![]}];}return db[_0xea99('0x6b')][_0xea99('0x66')](_0x529beb);})[_0xea99('0x4d')](function(_0x1ec60e){_0xb7cc0d[_0xea99('0x4e')]=_0x1ec60e;return _0xb7cc0d;});}})['then'](respondWithFilteredResult(_0x8a832c,_0x529beb))[_0xea99('0x4f')](handleError(_0x8a832c,null));};exports[_0xea99('0x6c')]=function(_0x3f3ba1,_0x5917b2,_0x366ef3){var _0x39acf1={'raw':!![],'where':{}};var _0x21f7fe={};var _0x1b3368={'count':0x0,'rows':[]};return db[_0xea99('0x3c')][_0xea99('0x61')]({'where':{'id':_0x3f3ba1[_0xea99('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5917b2,null))[_0xea99('0x4d')](function(_0x3de9b){if(_0x3de9b){_0x21f7fe[_0xea99('0x3e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x21f7fe[_0xea99('0x41')]=_[_0xea99('0x3f')](_0x3f3ba1[_0xea99('0x41')]);_0x21f7fe[_0xea99('0x65')]=_[_0xea99('0x40')](_0x21f7fe[_0xea99('0x3e')],_0x21f7fe[_0xea99('0x41')]);_0x39acf1[_0xea99('0x42')]=_[_0xea99('0x40')](_0x21f7fe[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x3f3ba1[_0xea99('0x41')][_0xea99('0x43')]));_0x39acf1[_0xea99('0x42')]=_0x39acf1[_0xea99('0x42')][_0xea99('0x44')]?_0x39acf1[_0xea99('0x42')]:_0x21f7fe[_0xea99('0x3e')];if(!_0x3f3ba1[_0xea99('0x41')][_0xea99('0x63')](_0xea99('0x64'))){_0x39acf1[_0xea99('0x24')]=qs['limit'](_0x3f3ba1[_0xea99('0x41')]['limit']);_0x39acf1[_0xea99('0x22')]=qs[_0xea99('0x22')](_0x3f3ba1[_0xea99('0x41')]['offset']);}_0x39acf1[_0xea99('0x45')]=qs['sort'](_0x3f3ba1[_0xea99('0x41')][_0xea99('0x46')]);_0x39acf1['where']=qs[_0xea99('0x65')](_['pick'](_0x3f3ba1[_0xea99('0x41')],_0x21f7fe[_0xea99('0x65')]));_0x39acf1[_0xea99('0x48')]['VoiceQueueId']=_0x3de9b['id'];if(_0x3f3ba1['query'][_0xea99('0x30')]){_0x39acf1[_0xea99('0x48')]=_[_0xea99('0x49')](_0x39acf1[_0xea99('0x48')],{'$or':_[_0xea99('0x32')](_0x39acf1[_0xea99('0x42')],function(_0x511420){var _0xa88f09={};_0xa88f09[_0x511420]={'$like':'%'+_0x3f3ba1['query'][_0xea99('0x30')]+'%'};return _0xa88f09;})});}_0x39acf1=_[_0xea99('0x49')]({},_0x39acf1,_0x3f3ba1['options']);return db[_0xea99('0x6d')][_0xea99('0x25')]({'where':_0x39acf1[_0xea99('0x48')]})[_0xea99('0x4d')](function(_0x3ba882){_0x1b3368[_0xea99('0x25')]=_0x3ba882;if(_0x3f3ba1[_0xea99('0x41')]['includeAll']){_0x39acf1['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xea99('0x66')](_0x39acf1);})[_0xea99('0x4d')](function(_0x2c8ed5){_0x1b3368[_0xea99('0x4e')]=_0x2c8ed5;return _0x1b3368;});}})[_0xea99('0x4d')](respondWithFilteredResult(_0x5917b2,_0x39acf1))[_0xea99('0x4f')](handleError(_0x5917b2,null));};exports[_0xea99('0x6e')]=function(_0x58f95c,_0x304b36,_0x48355d){var _0x22bbf1={};var _0x31f043={};var _0x9b5550;var _0x22aee9;return db[_0xea99('0x3c')]['findOne']({'where':{'id':_0x58f95c[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x304b36,null))['then'](function(_0x544970){if(_0x544970){_0x9b5550=_0x544970;_0x31f043[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x6f')][_0xea99('0x50')]);_0x31f043[_0xea99('0x41')]=_['keys'](_0x58f95c['query']);_0x31f043[_0xea99('0x65')]=_['intersection'](_0x31f043[_0xea99('0x3e')],_0x31f043['query']);_0x22bbf1[_0xea99('0x42')]=_[_0xea99('0x40')](_0x31f043[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x58f95c[_0xea99('0x41')][_0xea99('0x43')]));_0x22bbf1[_0xea99('0x42')]=_0x22bbf1[_0xea99('0x42')][_0xea99('0x44')]?_0x22bbf1['attributes']:_0x31f043[_0xea99('0x3e')];_0x22bbf1[_0xea99('0x45')]=qs[_0xea99('0x46')](_0x58f95c[_0xea99('0x41')][_0xea99('0x46')]);_0x22bbf1['where']=qs[_0xea99('0x65')](_['pick'](_0x58f95c[_0xea99('0x41')],_0x31f043[_0xea99('0x65')]));if(_0x58f95c['query'][_0xea99('0x30')]){_0x22bbf1[_0xea99('0x48')]=_[_0xea99('0x49')](_0x22bbf1['where'],{'$or':_[_0xea99('0x32')](_0x22bbf1[_0xea99('0x42')],function(_0x397b74){var _0x3efe7d={};_0x3efe7d[_0x397b74]={'$like':'%'+_0x58f95c[_0xea99('0x41')][_0xea99('0x30')]+'%'};return _0x3efe7d;})});}_0x22bbf1=_['merge']({},_0x22bbf1,_0x58f95c[_0xea99('0x4a')]);return _0x9b5550[_0xea99('0x6e')](_0x22bbf1);}})[_0xea99('0x4d')](function(_0x486d90){if(_0x486d90){_0x22aee9=_0x486d90[_0xea99('0x44')];if(!_0x58f95c['query'][_0xea99('0x63')](_0xea99('0x64'))){_0x22bbf1['limit']=qs[_0xea99('0x24')](_0x58f95c[_0xea99('0x41')][_0xea99('0x24')]);_0x22bbf1[_0xea99('0x22')]=qs['offset'](_0x58f95c['query'][_0xea99('0x22')]);}return _0x9b5550[_0xea99('0x6e')](_0x22bbf1);}})[_0xea99('0x4d')](function(_0x272d51){if(_0x272d51){return _0x272d51?{'count':_0x22aee9,'rows':_0x272d51}:null;}})[_0xea99('0x4d')](respondWithResult(_0x304b36,null))[_0xea99('0x4f')](handleError(_0x304b36,null));};exports[_0xea99('0x70')]=function(_0x28539b,_0x161ad0,_0x5e6825){var _0x2507d5=_0x28539b[_0xea99('0x52')][_0xea99('0x71')];var _0x142979=_['map'](_0x2507d5,'id');return db[_0xea99('0x6f')][_0xea99('0x66')]({'where':{'id':_0x142979},'attributes':['id'],'include':[{'model':db['User'],'as':_0xea99('0x72'),'attributes':['id',_0xea99('0x37'),_0xea99('0x73'),_0xea99('0x74'),'interface'],'raw':!![]}]})[_0xea99('0x4d')](function(_0x176bfe){if(_0x176bfe){var _0x95aeb=_['flatMap'](_0x176bfe,function(_0x44d4b6){var _0x53fe46=_0x44d4b6['get']({'plain':!![]});_0x53fe46[_0xea99('0x72')][_0xea99('0x75')](function(_0x6f6c1f){_0x6f6c1f['penalty']=_[_0xea99('0x36')](_0x2507d5,{'id':_0x53fe46['id']})['penalty'];});return _0x53fe46[_0xea99('0x72')];});return db[_0xea99('0x3c')]['find']({'where':{'id':_0x28539b[_0xea99('0x5b')]['id']}})['then'](function(_0x19c771){return db[_0xea99('0x76')][_0xea99('0x77')](function(_0x3b3d0e){return _0x19c771[_0xea99('0x70')](_0x142979,{'transaction':_0x3b3d0e})[_0xea99('0x4d')](function(){return BPromise[_0xea99('0x78')](_0x2507d5,function(_0x151dae){return db[_0xea99('0x79')][_0xea99('0x7a')]({'TeamId':_0x151dae['id'],'VoiceQueueId':_0x28539b[_0xea99('0x5b')]['id'],'penalty':_0x151dae[_0xea99('0x7b')]},{'transaction':_0x3b3d0e});});})[_0xea99('0x4d')](function(){return BPromise[_0xea99('0x78')](_0x95aeb,function(_0x508a5f){return db[_0xea99('0x7c')]['findOrCreate']({'where':{'UserId':_0x508a5f['id'],'VoiceQueueId':_0x28539b[_0xea99('0x5b')]['id']},'defaults':{'penalty':_0x508a5f['penalty']},'transaction':_0x3b3d0e});});})[_0xea99('0x4d')](function(){return BPromise[_0xea99('0x78')](_[_0xea99('0x30')](_0x95aeb,{'online':!![]}),function(_0x36be7f){return db[_0xea99('0x7d')][_0xea99('0x7a')]({'membername':_0x36be7f[_0xea99('0x37')],'UserId':_0x36be7f['id'],'queue_name':_0x19c771[_0xea99('0x37')],'VoiceQueueId':_0x19c771['id'],'interface':_[_0xea99('0x7e')](_0x36be7f[_0xea99('0x7f')])?util[_0xea99('0x80')]('SIP/%s',_0x36be7f[_0xea99('0x37')]):_0x36be7f['interface'],'paused':_0x36be7f[_0xea99('0x74')]||![],'penalty':_0x36be7f['penalty']},{'transaction':_0x3b3d0e});});})[_0xea99('0x4d')](function(){_0x95aeb['forEach'](function(_0x4d2fdc){socket['emit'](_0xea99('0x81'),{'UserId':_0x4d2fdc['id'],'VoiceQueueId':_0x19c771['id']});});});});});}})[_0xea99('0x4d')](respondWithStatusCode(_0x161ad0,null))[_0xea99('0x4f')](handleError(_0x161ad0,null));};exports['removeTeams']=function(_0x2559ca,_0x5b92af,_0x57a6f2){return db[_0xea99('0x6f')][_0xea99('0x66')]({'where':{'id':_0x2559ca[_0xea99('0x41')][_0xea99('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xea99('0x72'),'attributes':['id'],'raw':!![]}]})[_0xea99('0x4d')](handleEntityNotFound(_0x5b92af,null))[_0xea99('0x4d')](function(_0x1a5e4f){var _0x35db26=_[_0xea99('0x32')](_0x1a5e4f,'id');var _0x43fc41=[];var _0x3541ab=[];var _0x558937=squel[_0xea99('0x83')]();_0x558937[_0xea99('0x84')](_0xea99('0x85'))[_0xea99('0x86')](_0xea99('0x87'),'tq')[_0xea99('0x88')](_0xea99('0x89'),'ut',_0xea99('0x8a'))[_0xea99('0x48')](_0xea99('0x8b'),_0x2559ca['params']['id']);for(var _0x2ecbf1=0x0;_0x2ecbf1<_0x1a5e4f['length'];_0x2ecbf1+=0x1){let _0x3d4458=_0x1a5e4f[_0x2ecbf1];for(var _0x4b2cd1=0x0;_0x4b2cd1<_0x3d4458[_0xea99('0x72')][_0xea99('0x44')];_0x4b2cd1+=0x1){let _0x4746b5=_0x3d4458[_0xea99('0x72')][_0x4b2cd1];var _0xf1f118=_0x558937[_0xea99('0x5a')]();_0xf1f118['where'](_0xea99('0x8c'),_0x4746b5['id']);_0x3541ab['push'](db[_0xea99('0x76')][_0xea99('0x41')](_0xf1f118[_0xea99('0x8d')](),{'type':db[_0xea99('0x76')][_0xea99('0x8e')]['SELECT']})['then'](function(_0x14da74){if(_0x14da74['length']===0x1){return _0x4746b5['id'];}else{var _0x310fcc=_[_0xea99('0x8f')](_[_0xea99('0x32')](_0x14da74,_0xea99('0x90')),function(_0x34707){return _[_0xea99('0x34')](_0x35db26,_0x34707);});if(_0x310fcc){return _0x4746b5['id'];}}}));}}return BPromise[_0xea99('0x91')](_0x3541ab)[_0xea99('0x4d')](function(_0xb4077d){_0x43fc41=_(_0x43fc41)[_0xea99('0x92')](_0xb4077d)[_0xea99('0x93')]()[_0xea99('0x33')]();return db[_0xea99('0x3c')]['find']({'where':{'id':_0x2559ca[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](function(_0xbc505e){return db[_0xea99('0x76')][_0xea99('0x77')](function(_0x55953c){return _0xbc505e[_0xea99('0x94')](_0x2559ca[_0xea99('0x41')]['ids'],{'transaction':_0x55953c})[_0xea99('0x4d')](function(){if(!_[_0xea99('0x95')](_0x43fc41)){return _0xbc505e[_0xea99('0x96')](_0x43fc41,{'transaction':_0x55953c})[_0xea99('0x4d')](function(){return db[_0xea99('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x2559ca['params']['id'],'UserId':_0x43fc41},'transaction':_0x55953c});});}})[_0xea99('0x4d')](function(){_0x43fc41[_0xea99('0x75')](function(_0x56397b){socket[_0xea99('0x97')](_0xea99('0x98'),{'UserId':_0x56397b,'VoiceQueueId':_0xbc505e['id']});});});});});});})[_0xea99('0x4d')](respondWithStatusCode(_0x5b92af,null))[_0xea99('0x4f')](handleError(_0x5b92af,null));};exports[_0xea99('0x99')]=function(_0x47d3a0,_0x492e2a,_0x3da688){var _0x2bbd0c,_0x1737fe;return db[_0xea99('0x3c')]['find']({'where':{'id':_0x47d3a0[_0xea99('0x5b')]['id']}})['then'](handleEntityNotFound(_0x492e2a,null))[_0xea99('0x4d')](function(_0x542f5c){if(_0x542f5c){_0x1737fe=_0x542f5c;return _0x542f5c['addAgents'](_0x47d3a0['body'][_0xea99('0x82')],_[_0xea99('0x5c')](_0x47d3a0['body'],[_0xea99('0x82'),'id'])||{})[_0xea99('0x9a')](function(_0x1b8b8b){for(var _0x5f1fc6=0x0;_0x5f1fc6<_0x47d3a0['body'][_0xea99('0x82')]['length'];_0x5f1fc6+=0x1){socket[_0xea99('0x97')](_0xea99('0x81'),{'UserId':Number(_0x47d3a0[_0xea99('0x52')][_0xea99('0x82')][_0x5f1fc6]),'VoiceQueueId':Number(_0x47d3a0[_0xea99('0x5b')]['id'])});}return _0x1b8b8b;});}})['then'](function(_0x29f5f2){_0x2bbd0c=_0x29f5f2||[];if(_0x1737fe){return db[_0xea99('0x9b')][_0xea99('0x66')]({'where':{'id':_0x47d3a0[_0xea99('0x52')][_0xea99('0x82')]},'attributes':['id','name',_0xea99('0x73'),_0xea99('0x74'),_0xea99('0x7f')],'raw':!![]});}})[_0xea99('0x4d')](function(_0x538fd7){if(!_[_0xea99('0x95')](_0x538fd7)){var _0x1c85b7=[];for(var _0x573e46=0x0;_0x573e46<_0x538fd7[_0xea99('0x44')];_0x573e46++){if(_0x538fd7[_0x573e46][_0xea99('0x73')]){_0x1c85b7[_0xea99('0x9c')](db[_0xea99('0x7d')][_0xea99('0x7a')]({'membername':_0x538fd7[_0x573e46][_0xea99('0x37')],'UserId':_0x538fd7[_0x573e46]['id'],'queue_name':_0x1737fe[_0xea99('0x37')],'VoiceQueueId':_0x1737fe['id'],'interface':_[_0xea99('0x7e')](_0x538fd7[_0x573e46][_0xea99('0x7f')])?util['format'](_0xea99('0x9d'),_0x538fd7[_0x573e46][_0xea99('0x37')]):_0x538fd7[_0x573e46]['interface'],'paused':_0x538fd7[_0x573e46][_0xea99('0x74')]||![],'penalty':_0x47d3a0[_0xea99('0x52')][_0xea99('0x7b')]||0x0}));}}return BPromise[_0xea99('0x91')](_0x1c85b7);}})[_0xea99('0x4d')](function(){return _0x2bbd0c;})[_0xea99('0x4d')](respondWithResult(_0x492e2a,null))[_0xea99('0x4f')](handleError(_0x492e2a,null));};exports[_0xea99('0x96')]=function(_0x54bfaf,_0x2c294b,_0x57ae9f){return db[_0xea99('0x3c')][_0xea99('0x36')]({'where':{'id':_0x54bfaf[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x2c294b,null))[_0xea99('0x4d')](function(_0x4e73b1){if(_0x4e73b1){return _0x4e73b1[_0xea99('0x96')](_0x54bfaf[_0xea99('0x41')][_0xea99('0x82')])[_0xea99('0x4d')](function(){if(_[_0xea99('0x9e')](_0x54bfaf[_0xea99('0x41')]['ids'])){for(var _0xecbcb8=0x0;_0xecbcb8<_0x54bfaf[_0xea99('0x41')]['ids']['length'];_0xecbcb8+=0x1){socket[_0xea99('0x97')](_0xea99('0x98'),{'UserId':Number(_0x54bfaf['query'][_0xea99('0x82')][_0xecbcb8]),'VoiceQueueId':Number(_0x54bfaf[_0xea99('0x5b')]['id'])});}}else{socket[_0xea99('0x97')](_0xea99('0x98'),{'UserId':Number(_0x54bfaf[_0xea99('0x41')][_0xea99('0x82')]),'VoiceQueueId':Number(_0x54bfaf[_0xea99('0x5b')]['id'])});}});}})[_0xea99('0x4d')](function(_0x34b1ce){return db['UserVoiceQueueRt'][_0xea99('0x2b')]({'where':{'VoiceQueueId':_0x54bfaf[_0xea99('0x5b')]['id'],'UserId':_0x54bfaf['query'][_0xea99('0x82')]}})[_0xea99('0x4d')](function(){return _0x34b1ce;});})[_0xea99('0x4d')](respondWithStatusCode(_0x2c294b,null))['catch'](handleError(_0x2c294b,null));};exports['getAgents']=function(_0x150e76,_0xd5c860,_0x2a9600){var _0x1b0006={};var _0x1fd4c8={};var _0x2b0655;var _0x494d98;return db[_0xea99('0x3c')][_0xea99('0x61')]({'where':{'id':_0x150e76[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0xd5c860,null))[_0xea99('0x4d')](function(_0x3bc4bc){if(_0x3bc4bc){_0x2b0655=_0x3bc4bc;_0x1fd4c8[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x9b')][_0xea99('0x50')]);_0x1fd4c8['query']=_['keys'](_0x150e76[_0xea99('0x41')]);_0x1fd4c8['filters']=_[_0xea99('0x40')](_0x1fd4c8[_0xea99('0x3e')],_0x1fd4c8[_0xea99('0x41')]);_0x1b0006[_0xea99('0x42')]=_[_0xea99('0x40')](_0x1fd4c8[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x150e76[_0xea99('0x41')][_0xea99('0x43')]));_0x1b0006[_0xea99('0x42')]=_0x1b0006['attributes'][_0xea99('0x44')]?_0x1b0006[_0xea99('0x42')]:_0x1fd4c8[_0xea99('0x3e')];_0x1b0006[_0xea99('0x45')]=qs[_0xea99('0x46')](_0x150e76[_0xea99('0x41')][_0xea99('0x46')]);_0x1b0006['where']=qs[_0xea99('0x65')](_['pick'](_0x150e76[_0xea99('0x41')],_0x1fd4c8['filters']));if(_0x150e76['query'][_0xea99('0x30')]){_0x1b0006[_0xea99('0x48')]=_[_0xea99('0x49')](_0x1b0006[_0xea99('0x48')],{'$or':_[_0xea99('0x32')](_0x1b0006[_0xea99('0x42')],function(_0x29dd86){var _0x467fdc={};_0x467fdc[_0x29dd86]={'$like':'%'+_0x150e76[_0xea99('0x41')][_0xea99('0x30')]+'%'};return _0x467fdc;})});}_0x1b0006=_['merge']({},_0x1b0006,_0x150e76[_0xea99('0x4a')]);return _0x2b0655[_0xea99('0x9f')](_0x1b0006);}})[_0xea99('0x4d')](function(_0x30e856){if(_0x30e856){_0x494d98=_0x30e856[_0xea99('0x44')];if(!_0x150e76[_0xea99('0x41')]['hasOwnProperty'](_0xea99('0x64'))){_0x1b0006[_0xea99('0x24')]=qs[_0xea99('0x24')](_0x150e76[_0xea99('0x41')][_0xea99('0x24')]);_0x1b0006['offset']=qs[_0xea99('0x22')](_0x150e76[_0xea99('0x41')][_0xea99('0x22')]);}return _0x2b0655[_0xea99('0x9f')](_0x1b0006);}})[_0xea99('0x4d')](function(_0xe4ccce){if(_0xe4ccce){return _0xe4ccce?{'count':_0x494d98,'rows':_0xe4ccce}:null;}})[_0xea99('0x4d')](respondWithResult(_0xd5c860,null))['catch'](handleError(_0xd5c860,null));};exports[_0xea99('0xa0')]=function(_0x2214df,_0x407736,_0x14b4f9){var _0x32c1ea={};var _0x42c9df={};var _0xdcd84c;var _0x13a6c9;return db[_0xea99('0x3c')][_0xea99('0x61')]({'where':{'id':_0x2214df[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x407736,null))['then'](function(_0x1e8bff){if(_0x1e8bff){_0xdcd84c=_0x1e8bff;_0x42c9df[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0x7d')][_0xea99('0x50')]);_0x42c9df[_0xea99('0x41')]=_[_0xea99('0x3f')](_0x2214df[_0xea99('0x41')]);_0x42c9df[_0xea99('0x65')]=_[_0xea99('0x40')](_0x42c9df[_0xea99('0x3e')],_0x42c9df[_0xea99('0x41')]);_0x32c1ea[_0xea99('0x42')]=_['intersection'](_0x42c9df[_0xea99('0x3e')],qs['fields'](_0x2214df['query'][_0xea99('0x43')]));_0x32c1ea[_0xea99('0x42')]=_0x32c1ea['attributes'][_0xea99('0x44')]?_0x32c1ea[_0xea99('0x42')]:_0x42c9df['model'];_0x32c1ea[_0xea99('0x45')]=qs['sort'](_0x2214df[_0xea99('0x41')]['sort']);_0x32c1ea[_0xea99('0x48')]=qs[_0xea99('0x65')](_[_0xea99('0x47')](_0x2214df[_0xea99('0x41')],_0x42c9df[_0xea99('0x65')]));if(_0x2214df['query'][_0xea99('0x30')]){_0x32c1ea[_0xea99('0x48')]=_[_0xea99('0x49')](_0x32c1ea[_0xea99('0x48')],{'$or':_[_0xea99('0x32')](_0x32c1ea[_0xea99('0x42')],function(_0x481708){var _0x1cdd97={};_0x1cdd97[_0x481708]={'$like':'%'+_0x2214df[_0xea99('0x41')][_0xea99('0x30')]+'%'};return _0x1cdd97;})});}_0x32c1ea=_[_0xea99('0x49')]({},_0x32c1ea,_0x2214df[_0xea99('0x4a')]);return _0xdcd84c[_0xea99('0xa0')](_0x32c1ea);}})[_0xea99('0x4d')](function(_0x3994fd){if(_0x3994fd){_0x13a6c9=_0x3994fd['length'];if(!_0x2214df['query'][_0xea99('0x63')](_0xea99('0x64'))){_0x32c1ea[_0xea99('0x24')]=qs['limit'](_0x2214df[_0xea99('0x41')][_0xea99('0x24')]);_0x32c1ea[_0xea99('0x22')]=qs[_0xea99('0x22')](_0x2214df[_0xea99('0x41')][_0xea99('0x22')]);}return _0xdcd84c[_0xea99('0xa0')](_0x32c1ea);}})[_0xea99('0x4d')](function(_0x403996){return _0x403996?{'count':_0x13a6c9,'rows':_0x403996}:null;})[_0xea99('0x4d')](respondWithResult(_0x407736,null))[_0xea99('0x4f')](handleError(_0x407736,null));};exports[_0xea99('0xa1')]=function(_0x241171,_0x4799ee,_0x32e269){var _0x51da47={};var _0xca46a={};var _0x1197e1;var _0x132ccf;return db[_0xea99('0x3c')][_0xea99('0x61')]({'where':{'id':_0x241171[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x4799ee,null))[_0xea99('0x4d')](function(_0x18b31d){if(_0x18b31d){_0x1197e1=_0x18b31d;_0xca46a[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0xa2')][_0xea99('0x50')]);_0xca46a['query']=_[_0xea99('0x3f')](_0x241171[_0xea99('0x41')]);_0xca46a['filters']=_[_0xea99('0x40')](_0xca46a['model'],_0xca46a[_0xea99('0x41')]);_0x51da47[_0xea99('0x42')]=_[_0xea99('0x40')](_0xca46a[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x241171[_0xea99('0x41')][_0xea99('0x43')]));_0x51da47[_0xea99('0x42')]=_0x51da47[_0xea99('0x42')][_0xea99('0x44')]?_0x51da47['attributes']:_0xca46a[_0xea99('0x3e')];_0x51da47['order']=qs[_0xea99('0x46')](_0x241171['query'][_0xea99('0x46')]);_0x51da47[_0xea99('0x48')]=qs[_0xea99('0x65')](_[_0xea99('0x47')](_0x241171[_0xea99('0x41')],_0xca46a[_0xea99('0x65')]));if(_0x241171['query'][_0xea99('0x30')]){_0x51da47[_0xea99('0x48')]=_[_0xea99('0x49')](_0x51da47['where'],{'$or':_[_0xea99('0x32')](_0x51da47[_0xea99('0x42')],function(_0x135efe){var _0x491f6a={};_0x491f6a[_0x135efe]={'$like':'%'+_0x241171[_0xea99('0x41')]['filter']+'%'};return _0x491f6a;})});}_0x51da47=_['merge']({},_0x51da47,_0x241171[_0xea99('0x4a')]);return _0x1197e1[_0xea99('0xa1')](_0x51da47);}})[_0xea99('0x4d')](function(_0x36d22d){if(_0x36d22d){_0x132ccf=_0x36d22d['length'];if(!_0x241171[_0xea99('0x41')][_0xea99('0x63')]('nolimit')){_0x51da47[_0xea99('0x24')]=qs['limit'](_0x241171[_0xea99('0x41')][_0xea99('0x24')]);_0x51da47[_0xea99('0x22')]=qs[_0xea99('0x22')](_0x241171[_0xea99('0x41')][_0xea99('0x22')]);}return _0x1197e1[_0xea99('0xa1')](_0x51da47);}})[_0xea99('0x4d')](function(_0x1d8480){if(_0x1d8480){return _0x1d8480?{'count':_0x132ccf,'rows':_0x1d8480}:null;}})['then'](respondWithResult(_0x4799ee,null))['catch'](handleError(_0x4799ee,null));};exports[_0xea99('0xa3')]=function(_0x307aa4,_0x22c25d,_0x351e79){var _0x28f8b8,_0x58c9a7;return db['VoiceQueue'][_0xea99('0x36')]({'where':{'id':_0x307aa4[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x22c25d,null))[_0xea99('0x4d')](function(_0x3d7717){if(_0x3d7717){_0x58c9a7=_0x3d7717;return _0x3d7717[_0xea99('0xa3')](_0x307aa4[_0xea99('0x52')][_0xea99('0x82')],_['omit'](_0x307aa4['body'],[_0xea99('0x82'),'id'])||{});}return null;})[_0xea99('0x9a')](function(_0x2ba0ad){var _0x3655ab;_0x28f8b8=_0x2ba0ad||[];var _0x241943=[];if(_0x2ba0ad){for(var _0x875c47=0x0;_0x875c47<_0x2ba0ad['length'];_0x875c47+=0x1){var _0x34591e=_0x2ba0ad[_0x875c47]['get']({'plain':!![]});_0x58c9a7[_0xea99('0xa4')]=_0x307aa4[_0xea99('0x52')]['dialCheckDuplicateType']?_0x307aa4[_0xea99('0x52')]['dialCheckDuplicateType']:_0x58c9a7[_0xea99('0xa4')];switch(_0x58c9a7[_0xea99('0xa4')]){case _0xea99('0xa5'):_0x3655ab=squel[_0xea99('0xa6')]()['into']('cm_hopper')[_0xea99('0xa7')]([_0xea99('0xa8'),_0xea99('0xa9'),_0xea99('0xaa'),_0xea99('0xab'),_0xea99('0x69'),_0xea99('0x5d'),_0xea99('0x5e')],squel[_0xea99('0x83')]()[_0xea99('0x84')](_0xea99('0xa8'),_0xea99('0xa8'))['field'](_0xea99('0xac'),_0xea99('0xa9'))['field']('id',_0xea99('0xaa'))[_0xea99('0x84')](_0x34591e[_0xea99('0xad')][_0xea99('0x8d')](),_0xea99('0xab'))['field'](_0x307aa4['params']['id'][_0xea99('0x8d')](),'VoiceQueueId')['field'](_0xea99('0xac'),_0xea99('0x5d'))['field'](_0xea99('0xac'),_0xea99('0x5e'))[_0xea99('0x86')](_0xea99('0xae'))[_0xea99('0x48')](_0xea99('0xaf'))[_0xea99('0x48')]('ListId\x20=\x20?',_0x34591e[_0xea99('0xad')][_0xea99('0x8d')]())[_0xea99('0x48')](_0xea99('0xb0'))[_0xea99('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xea99('0x83')]()['field'](_0xea99('0xb1'))[_0xea99('0x86')](_0xea99('0xb2'))[_0xea99('0x48')]('VoiceQueueId\x20=\x20?',_0x307aa4['params']['id']['toString']()))[_0xea99('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xea99('0x83')]()['field'](_0xea99('0xb3'))['from'](_0xea99('0xb4'))['where'](_0xea99('0x8b'),_0x307aa4[_0xea99('0x5b')]['id'][_0xea99('0x8d')]())))[_0xea99('0x8d')]();break;case _0xea99('0xb5'):_0x3655ab=squel['insert']()[_0xea99('0xb6')]('cm_hopper')['fromQuery'](['phone',_0xea99('0xa9'),_0xea99('0xaa'),'ListId',_0xea99('0x69'),_0xea99('0x5d'),_0xea99('0x5e')],squel[_0xea99('0x83')]()[_0xea99('0x84')](_0xea99('0xa8'),_0xea99('0xa8'))['field'](_0xea99('0xac'),_0xea99('0xa9'))['field']('id',_0xea99('0xaa'))[_0xea99('0x84')](_0x34591e['CmListId'][_0xea99('0x8d')](),_0xea99('0xab'))[_0xea99('0x84')](_0x307aa4[_0xea99('0x5b')]['id'][_0xea99('0x8d')](),'VoiceQueueId')[_0xea99('0x84')](_0xea99('0xac'),'createdAt')[_0xea99('0x84')](_0xea99('0xac'),'updatedAt')[_0xea99('0x86')]('cm_contacts')[_0xea99('0x48')](_0xea99('0xaf'))['where'](_0xea99('0xb7'),_0x34591e['CmListId']['toString']())[_0xea99('0x48')](_0xea99('0xb0'))[_0xea99('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xea99('0x83')]()[_0xea99('0x84')](_0xea99('0xb3'))[_0xea99('0x86')](_0xea99('0xb4'))[_0xea99('0x48')](_0xea99('0x8b'),_0x307aa4[_0xea99('0x5b')]['id'][_0xea99('0x8d')]())))['toString']();break;default:_0x3655ab=squel[_0xea99('0xa6')]()[_0xea99('0xb6')]('cm_hopper')['fromQuery']([_0xea99('0xa8'),_0xea99('0xa9'),'ContactId',_0xea99('0xab'),'VoiceQueueId',_0xea99('0x5d'),_0xea99('0x5e')],squel['select']()[_0xea99('0x84')]('phone','phone')[_0xea99('0x84')](_0xea99('0xac'),_0xea99('0xa9'))[_0xea99('0x84')]('id',_0xea99('0xaa'))[_0xea99('0x84')](_0x34591e[_0xea99('0xad')][_0xea99('0x8d')](),_0xea99('0xab'))[_0xea99('0x84')](_0x307aa4['params']['id'][_0xea99('0x8d')](),'VoiceQueueId')[_0xea99('0x84')](_0xea99('0xac'),_0xea99('0x5d'))[_0xea99('0x84')](_0xea99('0xac'),'updatedAt')['from'](_0xea99('0xae'))[_0xea99('0x48')](_0xea99('0xaf'))[_0xea99('0x48')](_0xea99('0xb7'),_0x34591e[_0xea99('0xad')][_0xea99('0x8d')]())[_0xea99('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0xea99('0x8d')]();}_0x241943['push'](db[_0xea99('0x76')][_0xea99('0x41')](_0x3655ab));}return BPromise[_0xea99('0x91')](_0x241943);}})[_0xea99('0x4d')](function(){return _0x28f8b8;})[_0xea99('0x4d')](respondWithResult(_0x22c25d,null))[_0xea99('0x4f')](handleError(_0x22c25d,null));};exports['removeLists']=function(_0x519bfe,_0x3b64e9,_0x504260){return db['VoiceQueue'][_0xea99('0x36')]({'where':{'id':_0x519bfe[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x3b64e9,null))['then'](function(_0x29c6a2){if(_0x29c6a2){return _0x29c6a2[_0xea99('0xb8')](_0x519bfe[_0xea99('0x41')][_0xea99('0x82')]);}})[_0xea99('0x4d')](function(_0x39b404){if(_0x39b404){return db[_0xea99('0x62')][_0xea99('0x2b')]({'where':{'ListId':_0x519bfe['query']['ids'],'VoiceQueueId':_0x519bfe[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](function(){return _0x39b404;});}})[_0xea99('0x4d')](respondWithStatusCode(_0x3b64e9,null))['catch'](handleError(_0x3b64e9,null));};exports[_0xea99('0xb9')]=function(_0x25a5cf,_0x126855,_0x2dc97a){var _0x24b9d5={};var _0xf940b9={};var _0x5afe49;var _0xa6cb63;return db['VoiceQueue']['findOne']({'where':{'id':_0x25a5cf[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x126855,null))[_0xea99('0x4d')](function(_0x4a7431){if(_0x4a7431){_0x5afe49=_0x4a7431;_0xf940b9[_0xea99('0x3e')]=_[_0xea99('0x3f')](db[_0xea99('0xa2')][_0xea99('0x50')]);_0xf940b9[_0xea99('0x41')]=_[_0xea99('0x3f')](_0x25a5cf['query']);_0xf940b9['filters']=_['intersection'](_0xf940b9['model'],_0xf940b9[_0xea99('0x41')]);_0x24b9d5[_0xea99('0x42')]=_[_0xea99('0x40')](_0xf940b9[_0xea99('0x3e')],qs[_0xea99('0x43')](_0x25a5cf[_0xea99('0x41')][_0xea99('0x43')]));_0x24b9d5['attributes']=_0x24b9d5[_0xea99('0x42')][_0xea99('0x44')]?_0x24b9d5[_0xea99('0x42')]:_0xf940b9[_0xea99('0x3e')];_0x24b9d5[_0xea99('0x45')]=qs[_0xea99('0x46')](_0x25a5cf[_0xea99('0x41')]['sort']);_0x24b9d5['where']=qs[_0xea99('0x65')](_[_0xea99('0x47')](_0x25a5cf[_0xea99('0x41')],_0xf940b9[_0xea99('0x65')]));if(_0x25a5cf[_0xea99('0x41')][_0xea99('0x30')]){_0x24b9d5[_0xea99('0x48')]=_[_0xea99('0x49')](_0x24b9d5[_0xea99('0x48')],{'$or':_['map'](_0x24b9d5[_0xea99('0x42')],function(_0x2e280c){var _0x282bd8={};_0x282bd8[_0x2e280c]={'$like':'%'+_0x25a5cf[_0xea99('0x41')]['filter']+'%'};return _0x282bd8;})});}_0x24b9d5=_[_0xea99('0x49')]({},_0x24b9d5,_0x25a5cf['options']);return _0x5afe49[_0xea99('0xb9')](_0x24b9d5);}})['then'](function(_0x1d35ad){if(_0x1d35ad){_0xa6cb63=_0x1d35ad['length'];if(!_0x25a5cf[_0xea99('0x41')][_0xea99('0x63')](_0xea99('0x64'))){_0x24b9d5['limit']=qs[_0xea99('0x24')](_0x25a5cf[_0xea99('0x41')]['limit']);_0x24b9d5['offset']=qs[_0xea99('0x22')](_0x25a5cf[_0xea99('0x41')][_0xea99('0x22')]);}return _0x5afe49[_0xea99('0xb9')](_0x24b9d5);}})[_0xea99('0x4d')](function(_0x875fb2){if(_0x875fb2){return _0x875fb2?{'count':_0xa6cb63,'rows':_0x875fb2}:null;}})[_0xea99('0x4d')](respondWithResult(_0x126855,null))[_0xea99('0x4f')](handleError(_0x126855,null));};exports['addBlackLists']=function(_0x4628d0,_0xe609dd,_0x9110c6){var _0x2305e2,_0x19ac6d;return db[_0xea99('0x3c')]['find']({'where':{'id':_0x4628d0['params']['id']}})['then'](handleEntityNotFound(_0xe609dd,null))[_0xea99('0x4d')](function(_0x350e90){if(_0x350e90){_0x19ac6d=_0x350e90;return _0x350e90[_0xea99('0xba')](_0x4628d0[_0xea99('0x52')][_0xea99('0x82')],_[_0xea99('0x5c')](_0x4628d0[_0xea99('0x52')],[_0xea99('0x82'),'id'])||{});}return null;})[_0xea99('0x9a')](function(_0x1f455e){var _0x26316e;_0x2305e2=_0x1f455e||[];var _0x12d801=[];if(_0x1f455e){for(var _0x1598f4=0x0;_0x1598f4<_0x1f455e['length'];_0x1598f4+=0x1){var _0x1643a6=_0x1f455e[_0x1598f4]['get']({'plain':!![]});_0x26316e=squel[_0xea99('0xa6')]()['into'](_0xea99('0xbb'))['fromQuery']([_0xea99('0xa8'),_0xea99('0xaa'),'ListId',_0xea99('0x69'),_0xea99('0x5d'),_0xea99('0x5e')],squel[_0xea99('0x83')]()[_0xea99('0x84')](_0xea99('0xa8'),_0xea99('0xa8'))['field']('id','ContactId')['field'](_0x1643a6[_0xea99('0xad')]['toString'](),_0xea99('0xab'))[_0xea99('0x84')](_0x4628d0[_0xea99('0x5b')]['id'][_0xea99('0x8d')](),_0xea99('0x69'))['field']('NOW()',_0xea99('0x5d'))['field'](_0xea99('0xac'),_0xea99('0x5e'))[_0xea99('0x86')](_0xea99('0xae'))[_0xea99('0x48')](_0xea99('0xaf'))[_0xea99('0x48')](_0xea99('0xb7'),_0x1643a6['CmListId']['toString']())['where'](_0xea99('0xb0')))[_0xea99('0x8d')]();_0x12d801['push'](db[_0xea99('0x76')]['query'](_0x26316e));}return BPromise[_0xea99('0x91')](_0x12d801);}})[_0xea99('0x4d')](function(){return _0x2305e2;})[_0xea99('0x4d')](respondWithResult(_0xe609dd,null))[_0xea99('0x4f')](handleError(_0xe609dd,null));};exports['removeBlackLists']=function(_0x329d63,_0x4c862d,_0x1a6fa7){return db['VoiceQueue'][_0xea99('0x36')]({'where':{'id':_0x329d63[_0xea99('0x5b')]['id']}})[_0xea99('0x4d')](handleEntityNotFound(_0x4c862d,null))[_0xea99('0x4d')](function(_0x58fac2){if(_0x58fac2){return _0x58fac2[_0xea99('0xbc')](_0x329d63[_0xea99('0x41')]['ids']);}})[_0xea99('0x4d')](function(_0x372645){if(_0x372645){return db['CmHopperBlack'][_0xea99('0x2b')]({'where':{'ListId':_0x329d63['query'][_0xea99('0x82')],'VoiceQueueId':_0x329d63[_0xea99('0x5b')]['id']}})['then'](function(){return _0x372645;});}})[_0xea99('0x4d')](respondWithStatusCode(_0x4c862d,null))[_0xea99('0x4f')](handleError(_0x4c862d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3ddbff6..b6151b1 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 _0x7d85=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x413051,_0x25a3df){var _0x87ad1d=function(_0xf540de){while(--_0xf540de){_0x413051['push'](_0x413051['shift']());}};_0x87ad1d(++_0x25a3df);}(_0x7d85,0xf9));var _0x57d8=function(_0x50f1a6,_0x39c1e7){_0x50f1a6=_0x50f1a6-0x0;var _0x2018ad=_0x7d85[_0x50f1a6];return _0x2018ad;};'use strict';var EventEmitter=require(_0x57d8('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x57d8('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x57d8('0x2')](0x0);var events={'afterCreate':_0x57d8('0x3'),'afterUpdate':_0x57d8('0x4'),'afterDestroy':_0x57d8('0x5')};function emitEvent(_0x18530c){return function(_0x34b73f,_0x399333,_0x4255aa){VoiceQueueEvents[_0x57d8('0x6')](_0x18530c+':'+_0x34b73f['id'],_0x34b73f);VoiceQueueEvents[_0x57d8('0x6')](_0x18530c,_0x34b73f);_0x4255aa(null);};}for(var e in events){if(events[_0x57d8('0x7')](e)){var event=events[e];VoiceQueue[_0x57d8('0x8')](e,emitEvent(event));}}module[_0x57d8('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xe16d=['remove','emit','exports','../../mysqldb','setMaxListeners','update'];(function(_0x36c96d,_0x2111e2){var _0x458a40=function(_0x43d524){while(--_0x43d524){_0x36c96d['push'](_0x36c96d['shift']());}};_0x458a40(++_0x2111e2);}(_0xe16d,0x1e9));var _0xde16=function(_0x50cc54,_0x3785e1){_0x50cc54=_0x50cc54-0x0;var _0x536f3f=_0xe16d[_0x50cc54];return _0x536f3f;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xde16('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xde16('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde16('0x2'),'afterDestroy':_0xde16('0x3')};function emitEvent(_0x23cc19){return function(_0x13248,_0x404c6c,_0x3188c5){VoiceQueueEvents['emit'](_0x23cc19+':'+_0x13248['id'],_0x13248);VoiceQueueEvents[_0xde16('0x4')](_0x23cc19,_0x13248);_0x3188c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xde16('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 68ea157..9050d21 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x42d808,_0x47b4da){var _0x474874=function(_0x117c69){while(--_0x117c69){_0x42d808['push'](_0x42d808['shift']());}};_0x474874(++_0x47b4da);}(_0x34e8,0x12c));var _0x834e=function(_0x49c047,_0x59f0ea){_0x49c047=_0x49c047-0x0;var _0x31968a=_0x34e8[_0x49c047];return _0x31968a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x419560,_0x16a92c){var _0x52a0a9=function(_0x1cdc67){while(--_0x1cdc67){_0x419560['push'](_0x419560['shift']());}};_0x52a0a9(++_0x16a92c);}(_0x3e74,0x175));var _0x43e7=function(_0x3c402e,_0x4aff27){_0x3c402e=_0x3c402e-0x0;var _0x3558b2=_0x3e74[_0x3c402e];return _0x3558b2;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 5110291..a0260f9 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 _0x876b=['stringify','code','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2f8c63,_0x44d3e1){var _0xa88def=function(_0x6cd96d){while(--_0x6cd96d){_0x2f8c63['push'](_0x2f8c63['shift']());}};_0xa88def(++_0x44d3e1);}(_0x876b,0x115));var _0xb876=function(_0x280686,_0x5d5281){_0x280686=_0x280686-0x0;var _0x14ea13=_0x876b[_0x280686];return _0x14ea13;};'use strict';var _=require(_0xb876('0x0'));var util=require(_0xb876('0x1'));var moment=require(_0xb876('0x2'));var BPromise=require(_0xb876('0x3'));var rs=require(_0xb876('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb876('0x5'))['db'];var utils=require(_0xb876('0x6'));var logger=require('../../config/logger')(_0xb876('0x7'));var config=require(_0xb876('0x8'));var jayson=require(_0xb876('0x9'));var client=jayson[_0xb876('0xa')][_0xb876('0xb')]({'port':0x232a});config['redis']=_[_0xb876('0xc')](config[_0xb876('0xd')],{'host':_0xb876('0xe'),'port':0x18eb});var socket=require(_0xb876('0xf'))(new Redis(config[_0xb876('0xd')]));require(_0xb876('0x10'))[_0xb876('0x11')](socket);function respondWithRpcPromise(_0x1f2be1,_0x53df84,_0x2d4740){return new BPromise(function(_0x463f90,_0x32452d){return client['request'](_0x1f2be1,_0x2d4740)[_0xb876('0x12')](function(_0x59e82f){logger[_0xb876('0x13')](_0xb876('0x14'),_0x53df84,_0xb876('0x15'));logger[_0xb876('0x16')](_0xb876('0x17'),_0x53df84,_0xb876('0x15'),JSON[_0xb876('0x18')](_0x59e82f));if(_0x59e82f['error']){if(_0x59e82f['error'][_0xb876('0x19')]===0x1f4){logger[_0xb876('0x1a')](_0xb876('0x14'),_0x53df84,_0x59e82f[_0xb876('0x1a')][_0xb876('0x1b')]);return _0x32452d(_0x59e82f[_0xb876('0x1a')][_0xb876('0x1b')]);}logger[_0xb876('0x1a')](_0xb876('0x14'),_0x53df84,_0x59e82f[_0xb876('0x1a')][_0xb876('0x1b')]);return _0x463f90(_0x59e82f[_0xb876('0x1a')]['message']);}else{logger['info'](_0xb876('0x14'),_0x53df84,_0xb876('0x15'));_0x463f90(_0x59e82f[_0xb876('0x1c')][_0xb876('0x1b')]);}})[_0xb876('0x1d')](function(_0x74736e){logger['error'](_0xb876('0x14'),_0x53df84,_0x74736e);_0x32452d(_0x74736e);});});}exports['GetVoiceQueue']=function(_0x3cac3c){var _0x50e8ed=this;return new Promise(function(_0x4b525a,_0x3fb00f){return db['VoiceQueue'][_0xb876('0x1e')]({'raw':_0x3cac3c[_0xb876('0x1f')]?_0x3cac3c[_0xb876('0x1f')][_0xb876('0x20')]===undefined?!![]:![]:!![],'where':_0x3cac3c[_0xb876('0x1f')]?_0x3cac3c[_0xb876('0x1f')][_0xb876('0x21')]||null:null,'attributes':_0x3cac3c['options']?_0x3cac3c[_0xb876('0x1f')][_0xb876('0x22')]||null:null,'limit':_0x3cac3c['options']?_0x3cac3c[_0xb876('0x1f')][_0xb876('0x23')]||null:null,'include':_0x3cac3c[_0xb876('0x1f')]?_0x3cac3c[_0xb876('0x1f')][_0xb876('0x24')]?_[_0xb876('0x25')](_0x3cac3c[_0xb876('0x1f')][_0xb876('0x24')],function(_0x5516d6){return{'model':db[_0x5516d6[_0xb876('0x26')]],'as':_0x5516d6['as'],'attributes':_0x5516d6['attributes'],'include':_0x5516d6['include']?_['map'](_0x5516d6[_0xb876('0x24')],function(_0x3b457d){return{'model':db[_0x3b457d[_0xb876('0x26')]],'as':_0x3b457d['as'],'attributes':_0x3b457d['attributes'],'include':_0x3b457d['include']?_[_0xb876('0x25')](_0x3b457d[_0xb876('0x24')],function(_0x5dab3f){return{'model':db[_0x5dab3f[_0xb876('0x26')]],'as':_0x5dab3f['as'],'attributes':_0x5dab3f[_0xb876('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb876('0x12')](function(_0x5a4f52){logger[_0xb876('0x13')](_0xb876('0x27'),_0x3cac3c);logger[_0xb876('0x16')]('GetVoiceQueue',_0x3cac3c,JSON[_0xb876('0x18')](_0x5a4f52));_0x4b525a(_0x5a4f52);})[_0xb876('0x1d')](function(_0x5547df){logger[_0xb876('0x1a')]('GetVoiceQueue',_0x5547df[_0xb876('0x1b')],_0x3cac3c);_0x3fb00f(_0x50e8ed[_0xb876('0x1a')](0x1f4,_0x5547df[_0xb876('0x1b')]));});});};exports[_0xb876('0x28')]=function(_0x2be2c2){var _0x3f58b0=this;return new Promise(function(_0x108e53,_0x329299){return db[_0xb876('0x29')][_0xb876('0x2a')]({'raw':_0x2be2c2[_0xb876('0x1f')]?_0x2be2c2[_0xb876('0x1f')][_0xb876('0x20')]===undefined?!![]:![]:!![],'where':_0x2be2c2[_0xb876('0x1f')]?_0x2be2c2['options'][_0xb876('0x21')]||null:null,'attributes':_0x2be2c2[_0xb876('0x1f')]?_0x2be2c2[_0xb876('0x1f')][_0xb876('0x22')]||null:null,'include':_0x2be2c2[_0xb876('0x1f')]?_0x2be2c2[_0xb876('0x1f')][_0xb876('0x24')]?_['map'](_0x2be2c2[_0xb876('0x1f')][_0xb876('0x24')],function(_0x412a85){return{'model':db[_0x412a85[_0xb876('0x26')]],'as':_0x412a85['as'],'attributes':_0x412a85[_0xb876('0x22')],'include':_0x412a85['include']?_[_0xb876('0x25')](_0x412a85[_0xb876('0x24')],function(_0x31a9a5){return{'model':db[_0x31a9a5[_0xb876('0x26')]],'as':_0x31a9a5['as'],'attributes':_0x31a9a5[_0xb876('0x22')],'include':_0x31a9a5[_0xb876('0x24')]?_[_0xb876('0x25')](_0x31a9a5['include'],function(_0x415826){return{'model':db[_0x415826[_0xb876('0x26')]],'as':_0x415826['as'],'attributes':_0x415826[_0xb876('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb876('0x12')](function(_0x3f14fd){logger[_0xb876('0x13')]('ShowVoiceQueue',_0x2be2c2);logger['debug'](_0xb876('0x28'),_0x2be2c2,JSON['stringify'](_0x3f14fd));_0x108e53(_0x3f14fd);})[_0xb876('0x1d')](function(_0x1094cc){logger[_0xb876('0x1a')]('ShowVoiceQueue',_0x1094cc[_0xb876('0x1b')],_0x2be2c2);_0x329299(_0x3f58b0[_0xb876('0x1a')](0x1f4,_0x1094cc[_0xb876('0x1b')]));});});}; \ No newline at end of file +var _0x5534=['raw','where','limit','map','include','model','attributes','find','debug','ShowVoiceQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceQueue','options'];(function(_0x33ae6b,_0x504857){var _0x4e1e44=function(_0x308792){while(--_0x308792){_0x33ae6b['push'](_0x33ae6b['shift']());}};_0x4e1e44(++_0x504857);}(_0x5534,0x122));var _0x4553=function(_0x274683,_0x579095){_0x274683=_0x274683-0x0;var _0x5e6b32=_0x5534[_0x274683];return _0x5e6b32;};'use strict';var _=require(_0x4553('0x0'));var util=require('util');var moment=require(_0x4553('0x1'));var BPromise=require(_0x4553('0x2'));var rs=require(_0x4553('0x3'));var fs=require('fs');var Redis=require(_0x4553('0x4'));var db=require(_0x4553('0x5'))['db'];var utils=require(_0x4553('0x6'));var logger=require(_0x4553('0x7'))(_0x4553('0x8'));var config=require(_0x4553('0x9'));var jayson=require(_0x4553('0xa'));var client=jayson[_0x4553('0xb')][_0x4553('0xc')]({'port':0x232a});config[_0x4553('0xd')]=_[_0x4553('0xe')](config[_0x4553('0xd')],{'host':_0x4553('0xf'),'port':0x18eb});var socket=require(_0x4553('0x10'))(new Redis(config[_0x4553('0xd')]));require(_0x4553('0x11'))['register'](socket);function respondWithRpcPromise(_0x29f243,_0x3e92aa,_0x55a2e4){return new BPromise(function(_0x149c29,_0x47560a){return client[_0x4553('0x12')](_0x29f243,_0x55a2e4)[_0x4553('0x13')](function(_0x23110b){logger[_0x4553('0x14')](_0x4553('0x15'),_0x3e92aa,'request\x20sent');logger['debug'](_0x4553('0x16'),_0x3e92aa,_0x4553('0x17'),JSON[_0x4553('0x18')](_0x23110b));if(_0x23110b[_0x4553('0x19')]){if(_0x23110b[_0x4553('0x19')]['code']===0x1f4){logger[_0x4553('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3e92aa,_0x23110b['error'][_0x4553('0x1a')]);return _0x47560a(_0x23110b[_0x4553('0x19')][_0x4553('0x1a')]);}logger['error'](_0x4553('0x15'),_0x3e92aa,_0x23110b[_0x4553('0x19')]['message']);return _0x149c29(_0x23110b[_0x4553('0x19')][_0x4553('0x1a')]);}else{logger['info'](_0x4553('0x15'),_0x3e92aa,'request\x20sent');_0x149c29(_0x23110b['result'][_0x4553('0x1a')]);}})[_0x4553('0x1b')](function(_0x2d7e98){logger[_0x4553('0x19')](_0x4553('0x15'),_0x3e92aa,_0x2d7e98);_0x47560a(_0x2d7e98);});});}exports[_0x4553('0x1c')]=function(_0x533d07){var _0x762bd5=this;return new Promise(function(_0x2cc16e,_0x106fa1){return db['VoiceQueue']['findAll']({'raw':_0x533d07[_0x4553('0x1d')]?_0x533d07[_0x4553('0x1d')][_0x4553('0x1e')]===undefined?!![]:![]:!![],'where':_0x533d07[_0x4553('0x1d')]?_0x533d07[_0x4553('0x1d')][_0x4553('0x1f')]||null:null,'attributes':_0x533d07['options']?_0x533d07[_0x4553('0x1d')]['attributes']||null:null,'limit':_0x533d07[_0x4553('0x1d')]?_0x533d07['options'][_0x4553('0x20')]||null:null,'include':_0x533d07[_0x4553('0x1d')]?_0x533d07[_0x4553('0x1d')]['include']?_[_0x4553('0x21')](_0x533d07['options'][_0x4553('0x22')],function(_0x1ad517){return{'model':db[_0x1ad517[_0x4553('0x23')]],'as':_0x1ad517['as'],'attributes':_0x1ad517[_0x4553('0x24')],'include':_0x1ad517[_0x4553('0x22')]?_['map'](_0x1ad517[_0x4553('0x22')],function(_0x32c57a){return{'model':db[_0x32c57a[_0x4553('0x23')]],'as':_0x32c57a['as'],'attributes':_0x32c57a[_0x4553('0x24')],'include':_0x32c57a[_0x4553('0x22')]?_[_0x4553('0x21')](_0x32c57a['include'],function(_0x5b30f8){return{'model':db[_0x5b30f8[_0x4553('0x23')]],'as':_0x5b30f8['as'],'attributes':_0x5b30f8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4553('0x13')](function(_0x2f4961){logger[_0x4553('0x14')](_0x4553('0x1c'),_0x533d07);logger['debug'](_0x4553('0x1c'),_0x533d07,JSON[_0x4553('0x18')](_0x2f4961));_0x2cc16e(_0x2f4961);})[_0x4553('0x1b')](function(_0x5cdb7c){logger[_0x4553('0x19')]('GetVoiceQueue',_0x5cdb7c[_0x4553('0x1a')],_0x533d07);_0x106fa1(_0x762bd5[_0x4553('0x19')](0x1f4,_0x5cdb7c[_0x4553('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x539010){var _0x155564=this;return new Promise(function(_0x56614e,_0x495c34){return db['VoiceQueue'][_0x4553('0x25')]({'raw':_0x539010['options']?_0x539010[_0x4553('0x1d')][_0x4553('0x1e')]===undefined?!![]:![]:!![],'where':_0x539010['options']?_0x539010[_0x4553('0x1d')][_0x4553('0x1f')]||null:null,'attributes':_0x539010[_0x4553('0x1d')]?_0x539010[_0x4553('0x1d')][_0x4553('0x24')]||null:null,'include':_0x539010[_0x4553('0x1d')]?_0x539010['options'][_0x4553('0x22')]?_['map'](_0x539010[_0x4553('0x1d')]['include'],function(_0x1c866d){return{'model':db[_0x1c866d[_0x4553('0x23')]],'as':_0x1c866d['as'],'attributes':_0x1c866d['attributes'],'include':_0x1c866d[_0x4553('0x22')]?_['map'](_0x1c866d['include'],function(_0x423617){return{'model':db[_0x423617['model']],'as':_0x423617['as'],'attributes':_0x423617['attributes'],'include':_0x423617[_0x4553('0x22')]?_['map'](_0x423617[_0x4553('0x22')],function(_0x565f0b){return{'model':db[_0x565f0b['model']],'as':_0x565f0b['as'],'attributes':_0x565f0b[_0x4553('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x306cea){logger['info']('ShowVoiceQueue',_0x539010);logger[_0x4553('0x26')]('ShowVoiceQueue',_0x539010,JSON[_0x4553('0x18')](_0x306cea));_0x56614e(_0x306cea);})[_0x4553('0x1b')](function(_0x1560a4){logger[_0x4553('0x19')](_0x4553('0x27'),_0x1560a4[_0x4553('0x1a')],_0x539010);_0x495c34(_0x155564[_0x4553('0x19')](0x1f4,_0x1560a4[_0x4553('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index b2c3b5f..7eebc7d 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 _0x9d31=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x4fdb95,_0x217e84){var _0x22a379=function(_0x131363){while(--_0x131363){_0x4fdb95['push'](_0x4fdb95['shift']());}};_0x22a379(++_0x217e84);}(_0x9d31,0x108));var _0x19d3=function(_0xc9c2b9,_0x570606){_0xc9c2b9=_0xc9c2b9-0x0;var _0x12f9c2=_0x9d31[_0xc9c2b9];return _0x12f9c2;};'use strict';var VoiceQueueEvents=require(_0x19d3('0x0'));var events=[_0x19d3('0x1'),_0x19d3('0x2'),_0x19d3('0x3')];function createListener(_0x19d236,_0x30e760){return function(_0x79b6bb){_0x30e760[_0x19d3('0x4')](_0x19d236,_0x79b6bb);};}function removeListener(_0x28c05f,_0x3e452d){return function(){VoiceQueueEvents[_0x19d3('0x5')](_0x28c05f,_0x3e452d);};}exports[_0x19d3('0x6')]=function(_0xe5e2d6){for(var _0x2fae3b=0x0,_0x30a249=events[_0x19d3('0x7')];_0x2fae3b<_0x30a249;_0x2fae3b++){var _0x5c85e6=events[_0x2fae3b];var _0x2b6c07=createListener(_0x19d3('0x8')+_0x5c85e6,_0xe5e2d6);VoiceQueueEvents['on'](_0x5c85e6,_0x2b6c07);}}; \ No newline at end of file +var _0xe7f4=['voiceQueue:','save','update','emit','register'];(function(_0x41e2b7,_0x4d44d0){var _0x2068c4=function(_0x1b7df9){while(--_0x1b7df9){_0x41e2b7['push'](_0x41e2b7['shift']());}};_0x2068c4(++_0x4d44d0);}(_0xe7f4,0x137));var _0x4e7f=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0xe7f4[_0x425716];return _0x2d39af;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x4e7f('0x0'),'remove',_0x4e7f('0x1')];function createListener(_0x4a4736,_0x3a94cf){return function(_0x336b7d){_0x3a94cf[_0x4e7f('0x2')](_0x4a4736,_0x336b7d);};}function removeListener(_0x34633d,_0x3c9cb7){return function(){VoiceQueueEvents['removeListener'](_0x34633d,_0x3c9cb7);};}exports[_0x4e7f('0x3')]=function(_0xcdd686){for(var _0x25aa6a=0x0,_0xfad1be=events['length'];_0x25aa6a<_0xfad1be;_0x25aa6a++){var _0x50e3a5=events[_0x25aa6a];var _0x3a1d2d=createListener(_0x4e7f('0x4')+_0x50e3a5,_0xcdd686);VoiceQueueEvents['on'](_0x50e3a5,_0x3a1d2d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 122a860..c3efd32 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 _0xcd6e=['show','post','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd6e,0x1d2));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xecd6('0x0'));var util=require(_0xecd6('0x1'));var path=require(_0xecd6('0x2'));var timeout=require('connect-timeout');var express=require(_0xecd6('0x3'));var router=express[_0xecd6('0x4')]();var fs_extra=require(_0xecd6('0x5'));var auth=require(_0xecd6('0x6'));var interaction=require(_0xecd6('0x7'));var config=require(_0xecd6('0x8'));var controller=require(_0xecd6('0x9'));router[_0xecd6('0xa')]('/',auth[_0xecd6('0xb')](),controller[_0xecd6('0xc')]);router[_0xecd6('0xa')]('/describe',auth[_0xecd6('0xb')](),controller[_0xecd6('0xd')]);router[_0xecd6('0xa')](_0xecd6('0xe'),auth['isAuthenticated'](),controller[_0xecd6('0xf')]);router[_0xecd6('0xa')](_0xecd6('0x10'),auth[_0xecd6('0xb')](),controller[_0xecd6('0x11')]);router[_0xecd6('0x12')]('/',auth[_0xecd6('0xb')](),controller['create']);router['put'](_0xecd6('0x10'),auth[_0xecd6('0xb')](),controller[_0xecd6('0x13')]);router[_0xecd6('0x14')](_0xecd6('0x10'),auth[_0xecd6('0xb')](),controller[_0xecd6('0x15')]);module[_0xecd6('0x16')]=router; \ No newline at end of file +var _0x4536=['post','create','put','/:id','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','getVoiceQueuesReport','show'];(function(_0xe6c8f5,_0x251df6){var _0x4a6b84=function(_0x325ca9){while(--_0x325ca9){_0xe6c8f5['push'](_0xe6c8f5['shift']());}};_0x4a6b84(++_0x251df6);}(_0x4536,0x1db));var _0x6453=function(_0x77d76e,_0x106ed2){_0x77d76e=_0x77d76e-0x0;var _0x5620c8=_0x4536[_0x77d76e];return _0x5620c8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6453('0x0'));var router=express[_0x6453('0x1')]();var fs_extra=require(_0x6453('0x2'));var auth=require(_0x6453('0x3'));var interaction=require(_0x6453('0x4'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x6453('0x5')]('/',auth[_0x6453('0x6')](),controller[_0x6453('0x7')]);router['get'](_0x6453('0x8'),auth[_0x6453('0x6')](),controller['describe']);router[_0x6453('0x5')]('/index',auth['isAuthenticated'](),controller[_0x6453('0x9')]);router[_0x6453('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x6453('0xa')]);router[_0x6453('0xb')]('/',auth[_0x6453('0x6')](),controller[_0x6453('0xc')]);router[_0x6453('0xd')](_0x6453('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6453('0xf')](_0x6453('0xe'),auth['isAuthenticated'](),controller[_0x6453('0x10')]);module[_0x6453('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 83e93f0..7922a23 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 _0x245e=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x2578ef,_0x471939){var _0x5c1150=function(_0x432673){while(--_0x432673){_0x2578ef['push'](_0x2578ef['shift']());}};_0x5c1150(++_0x471939);}(_0x245e,0x17d));var _0xe245=function(_0x114950,_0x2c8a0c){_0x114950=_0x114950-0x0;var _0x4ce31c=_0x245e[_0x114950];return _0x4ce31c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe245('0x0'));module[_0xe245('0x1')]={'type':{'type':Sequelize[_0xe245('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe245('0x2')]},'calleridname':{'type':Sequelize[_0xe245('0x2')]},'queue':{'type':Sequelize[_0xe245('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe245('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xe245('0x3')],'set':function(_0x26094d){var _0x19c652=moment(_0x26094d);var _0x2e3bfe=moment(this[_0xe245('0x4')](_0xe245('0x5')))[_0xe245('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x49d4bf=_0x19c652['diff'](_0x2e3bfe,'seconds');this[_0xe245('0x7')](_0xe245('0x8'),_0x26094d);this[_0xe245('0x7')](_0xe245('0x9'),_0x49d4bf||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xe245('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe245('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xe245('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe245('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe245('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xe245('0xc')},'originalposition':{'type':Sequelize[_0xe245('0xa')]},'channel':{'type':Sequelize[_0xe245('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe245('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xe245('0xa')]},'mohtime':{'type':Sequelize[_0xe245('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe245('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe245('0x2')]},'transfer':{'type':Sequelize[_0xe245('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe245('0x2')],'comment':_0xe245('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xe245('0x2')]},'disposition':{'type':Sequelize[_0xe245('0x2')]},'secondDisposition':{'type':Sequelize[_0xe245('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ccd=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4ccd,0x194));var _0xd4cc=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x4ccd[_0x870b62];return _0x2dcb39;};'use strict';var Sequelize=require(_0xd4cc('0x0'));var moment=require(_0xd4cc('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd4cc('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd4cc('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xd4cc('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xd4cc('0x3')],'set':function(_0x3e4af3){var _0x564836=moment(_0x3e4af3);var _0x174afa=moment(this['getDataValue'](_0xd4cc('0x4')))[_0xd4cc('0x5')](_0xd4cc('0x6'));var _0x2383d4=_0x564836[_0xd4cc('0x7')](_0x174afa,_0xd4cc('0x8'));this[_0xd4cc('0x9')](_0xd4cc('0xa'),_0x3e4af3);this[_0xd4cc('0x9')](_0xd4cc('0xb'),_0x2383d4||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xd4cc('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xd4cc('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd4cc('0x3')]},'queuecallerexit':{'type':Sequelize[_0xd4cc('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xd4cc('0xd')},'originalposition':{'type':Sequelize[_0xd4cc('0xe')]},'channel':{'type':Sequelize[_0xd4cc('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd4cc('0x2')]},'connectedlinename':{'type':Sequelize[_0xd4cc('0x2')]},'accountcode':{'type':Sequelize[_0xd4cc('0x2')]},'context':{'type':Sequelize[_0xd4cc('0x2')]},'exten':{'type':Sequelize[_0xd4cc('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xd4cc('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd4cc('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd4cc('0x2')]},'transfer':{'type':Sequelize[_0xd4cc('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd4cc('0x2')],'comment':_0xd4cc('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xd4cc('0x2')]},'disposition':{'type':Sequelize[_0xd4cc('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xd4cc('0xe')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 5127337..da0b395 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 _0x2bec=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','getVoiceQueuesReport','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x588940,_0x231c54){var _0x5deea4=function(_0xd82335){while(--_0xd82335){_0x588940['push'](_0x588940['shift']());}};_0x5deea4(++_0x231c54);}(_0x2bec,0x19a));var _0xc2be=function(_0x4c3c08,_0x9918d8){_0x4c3c08=_0x4c3c08-0x0;var _0x38b931=_0x2bec[_0x4c3c08];return _0x38b931;};'use strict';var emlformat=require(_0xc2be('0x0'));var rimraf=require(_0xc2be('0x1'));var zipdir=require(_0xc2be('0x2'));var jsonpatch=require(_0xc2be('0x3'));var rp=require(_0xc2be('0x4'));var moment=require(_0xc2be('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2be('0x6'));var util=require(_0xc2be('0x7'));var path=require(_0xc2be('0x8'));var sox=require(_0xc2be('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc2be('0xa'));var _=require(_0xc2be('0xb'));var squel=require(_0xc2be('0xc'));var crypto=require(_0xc2be('0xd'));var jsforce=require(_0xc2be('0xe'));var deskjs=require(_0xc2be('0xf'));var toCsv=require(_0xc2be('0x10'));var querystring=require('querystring');var Papa=require(_0xc2be('0x11'));var Redis=require(_0xc2be('0x12'));var authService=require(_0xc2be('0x13'));var qs=require(_0xc2be('0x14'));var as=require(_0xc2be('0x15'));var hardwareService=require(_0xc2be('0x16'));var logger=require(_0xc2be('0x17'))('api');var utils=require(_0xc2be('0x18'));var config=require(_0xc2be('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc2be('0x1a')]=_[_0xc2be('0x1b')](config[_0xc2be('0x1a')],{'host':_0xc2be('0x1c'),'port':0x18eb});var socket=require(_0xc2be('0x1d'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc2be('0x1e')](socket);function respondWithStatusCode(_0x4bb205,_0xc5c9bc){_0xc5c9bc=_0xc5c9bc||0xcc;return function(_0x487251){if(_0x487251){return _0x4bb205[_0xc2be('0x1f')](_0xc5c9bc);}return _0x4bb205[_0xc2be('0x20')](_0xc5c9bc)[_0xc2be('0x21')]();};}function respondWithResult(_0x25f6a8,_0x288621){_0x288621=_0x288621||0xc8;return function(_0x1b4aa3){if(_0x1b4aa3){return _0x25f6a8[_0xc2be('0x20')](_0x288621)[_0xc2be('0x22')](_0x1b4aa3);}};}function respondWithFilteredResult(_0x432fef,_0x362787){return function(_0xe5a2a3){if(_0xe5a2a3){var _0x308e0d=typeof _0x362787['offset']===_0xc2be('0x23')&&typeof _0x362787[_0xc2be('0x24')]===_0xc2be('0x23');var _0x1d4dd4=_0xe5a2a3[_0xc2be('0x25')];var _0x30650c=_0x308e0d?0x0:_0x362787[_0xc2be('0x26')];var _0x26a47b=_0x308e0d?_0xe5a2a3['count']:_0x362787['offset']+_0x362787[_0xc2be('0x24')];var _0x482b86;if(_0x26a47b>=_0x1d4dd4){_0x26a47b=_0x1d4dd4;_0x482b86=0xc8;}else{_0x482b86=0xce;}_0x432fef[_0xc2be('0x20')](_0x482b86);return _0x432fef[_0xc2be('0x27')](_0xc2be('0x28'),_0x30650c+'-'+_0x26a47b+'/'+_0x1d4dd4)[_0xc2be('0x22')](_0xe5a2a3);}return null;};}function patchUpdates(_0x5066f2){return function(_0x8a2d6d){try{jsonpatch[_0xc2be('0x29')](_0x8a2d6d,_0x5066f2,!![]);}catch(_0x4c5dbe){return BPromise[_0xc2be('0x2a')](_0x4c5dbe);}return _0x8a2d6d[_0xc2be('0x2b')]();};}function saveUpdates(_0x1f6e18,_0x1791ed){return function(_0x2f98a7){if(_0x2f98a7){return _0x2f98a7[_0xc2be('0x2c')](_0x1f6e18)[_0xc2be('0x2d')](function(_0x108b36){return _0x108b36;});}return null;};}function removeEntity(_0x2d6ab4,_0x353e93){return function(_0x85cde){if(_0x85cde){return _0x85cde[_0xc2be('0x2e')]()[_0xc2be('0x2d')](function(){_0x2d6ab4[_0xc2be('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf22713,_0xf49440){return function(_0x4ca411){if(!_0x4ca411){_0xf22713[_0xc2be('0x1f')](0x194);}return _0x4ca411;};}function handleError(_0x1c437b,_0x3695d5){_0x3695d5=_0x3695d5||0x1f4;return function(_0x3ecf08){logger[_0xc2be('0x2f')](_0x3ecf08['stack']);if(_0x3ecf08[_0xc2be('0x30')]){delete _0x3ecf08[_0xc2be('0x30')];}_0x1c437b[_0xc2be('0x20')](_0x3695d5)[_0xc2be('0x31')](_0x3ecf08);};}exports['index']=function(_0x159ef8,_0x51b77b){var _0x3895c8={},_0xd71d28={},_0x515397={'count':0x0,'rows':[]};var _0x2cd8e6=_[_0xc2be('0x32')](db[_0xc2be('0x33')][_0xc2be('0x34')],function(_0x4bcbe7){return{'name':_0x4bcbe7[_0xc2be('0x35')],'type':_0x4bcbe7[_0xc2be('0x36')][_0xc2be('0x37')]};});_0xd71d28[_0xc2be('0x38')]=_[_0xc2be('0x32')](_0x2cd8e6,_0xc2be('0x30'));_0xd71d28[_0xc2be('0x39')]=_[_0xc2be('0x3a')](_0x159ef8['query']);_0xd71d28[_0xc2be('0x3b')]=_['intersection'](_0xd71d28[_0xc2be('0x38')],_0xd71d28[_0xc2be('0x39')]);_0x3895c8[_0xc2be('0x3c')]=_[_0xc2be('0x3d')](_0xd71d28[_0xc2be('0x38')],qs[_0xc2be('0x3e')](_0x159ef8[_0xc2be('0x39')][_0xc2be('0x3e')]));_0x3895c8[_0xc2be('0x3c')]=_0x3895c8[_0xc2be('0x3c')][_0xc2be('0x3f')]?_0x3895c8['attributes']:_0xd71d28['model'];if(!_0x159ef8['query']['hasOwnProperty'](_0xc2be('0x40'))){_0x3895c8[_0xc2be('0x24')]=qs[_0xc2be('0x24')](_0x159ef8[_0xc2be('0x39')]['limit']);_0x3895c8[_0xc2be('0x26')]=qs[_0xc2be('0x26')](_0x159ef8[_0xc2be('0x39')][_0xc2be('0x26')]);}_0x3895c8[_0xc2be('0x41')]=qs[_0xc2be('0x42')](_0x159ef8['query'][_0xc2be('0x42')]);_0x3895c8[_0xc2be('0x43')]=qs[_0xc2be('0x3b')](_[_0xc2be('0x44')](_0x159ef8[_0xc2be('0x39')],_0xd71d28[_0xc2be('0x3b')]),_0x2cd8e6);if(_0x159ef8[_0xc2be('0x39')]['filter']){_0x3895c8[_0xc2be('0x43')]=_['merge'](_0x3895c8['where'],{'$or':_[_0xc2be('0x32')](_0x2cd8e6,function(_0x503931){if(_0x503931[_0xc2be('0x36')]!==_0xc2be('0x45')){var _0xa55ae9={};_0xa55ae9[_0x503931[_0xc2be('0x30')]]={'$like':'%'+_0x159ef8[_0xc2be('0x39')]['filter']+'%'};return _0xa55ae9;}})});}_0x3895c8=_[_0xc2be('0x46')]({},_0x3895c8,_0x159ef8[_0xc2be('0x47')]);var _0x4d3fa5={'where':_0x3895c8[_0xc2be('0x43')]};return db[_0xc2be('0x33')][_0xc2be('0x25')](_0x4d3fa5)[_0xc2be('0x2d')](function(_0x130700){_0x515397[_0xc2be('0x25')]=_0x130700;if(_0x159ef8[_0xc2be('0x39')][_0xc2be('0x48')]){_0x3895c8['include']=[{'all':!![]}];}return db[_0xc2be('0x33')][_0xc2be('0x49')](_0x3895c8);})['then'](function(_0xd77fce){_0x515397[_0xc2be('0x4a')]=_0xd77fce;return _0x515397;})['then'](respondWithFilteredResult(_0x51b77b,_0x3895c8))[_0xc2be('0x4b')](handleError(_0x51b77b,null));};exports[_0xc2be('0x4c')]=function(_0x7d50a,_0x438595){var _0x46ea60={'raw':![],'where':{'id':_0x7d50a[_0xc2be('0x4d')]['id']}},_0x15f179={};_0x15f179[_0xc2be('0x38')]=_[_0xc2be('0x3a')](db['VoiceQueueReport'][_0xc2be('0x34')]);_0x15f179[_0xc2be('0x39')]=_[_0xc2be('0x3a')](_0x7d50a[_0xc2be('0x39')]);_0x15f179[_0xc2be('0x3b')]=_[_0xc2be('0x3d')](_0x15f179[_0xc2be('0x38')],_0x15f179['query']);_0x46ea60['attributes']=_[_0xc2be('0x3d')](_0x15f179['model'],qs[_0xc2be('0x3e')](_0x7d50a['query'][_0xc2be('0x3e')]));_0x46ea60['attributes']=_0x46ea60[_0xc2be('0x3c')][_0xc2be('0x3f')]?_0x46ea60['attributes']:_0x15f179[_0xc2be('0x38')];if(_0x7d50a['query'][_0xc2be('0x48')]){_0x46ea60[_0xc2be('0x4e')]=[{'all':!![]}];}_0x46ea60=_['merge']({},_0x46ea60,_0x7d50a[_0xc2be('0x47')]);return db['VoiceQueueReport']['find'](_0x46ea60)['then'](handleEntityNotFound(_0x438595,null))[_0xc2be('0x2d')](respondWithResult(_0x438595,null))['catch'](handleError(_0x438595,null));};exports[_0xc2be('0x4f')]=function(_0x291107,_0x3e5e44){return db[_0xc2be('0x33')][_0xc2be('0x4f')](_0x291107[_0xc2be('0x50')],{})['then'](respondWithResult(_0x3e5e44,0xc9))[_0xc2be('0x4b')](handleError(_0x3e5e44,null));};exports['update']=function(_0x2d6946,_0x46080a){if(_0x2d6946[_0xc2be('0x50')]['id']){delete _0x2d6946[_0xc2be('0x50')]['id'];}return db[_0xc2be('0x33')][_0xc2be('0x51')]({'where':{'id':_0x2d6946['params']['id']}})[_0xc2be('0x2d')](handleEntityNotFound(_0x46080a,null))[_0xc2be('0x2d')](saveUpdates(_0x2d6946[_0xc2be('0x50')],null))[_0xc2be('0x2d')](respondWithResult(_0x46080a,null))[_0xc2be('0x4b')](handleError(_0x46080a,null));};exports[_0xc2be('0x2e')]=function(_0x21852a,_0x21aa0f){return db['VoiceQueueReport']['find']({'where':{'id':_0x21852a['params']['id']}})['then'](handleEntityNotFound(_0x21aa0f,null))[_0xc2be('0x2d')](removeEntity(_0x21aa0f,null))[_0xc2be('0x4b')](handleError(_0x21aa0f,null));};exports['describe']=function(_0xf050c,_0x21fc31){return db[_0xc2be('0x33')][_0xc2be('0x52')]()['then'](respondWithResult(_0x21fc31,null))[_0xc2be('0x4b')](handleError(_0x21fc31,null));};exports[_0xc2be('0x53')]=function(_0x56d32,_0x4e3f3c){var _0x48e8fb={},_0x7315b6={},_0x1687ab={'count':0x0,'rows':[]};_0x7315b6[_0xc2be('0x38')]=_[_0xc2be('0x3a')](db[_0xc2be('0x33')][_0xc2be('0x34')]);_0x7315b6[_0xc2be('0x39')]=_[_0xc2be('0x3a')](_0x56d32[_0xc2be('0x39')]);_0x7315b6[_0xc2be('0x3b')]=_['intersection'](_0x7315b6[_0xc2be('0x38')],_0x7315b6['query']);_0x48e8fb[_0xc2be('0x3c')]=_[_0xc2be('0x3d')](_0x7315b6[_0xc2be('0x38')],qs[_0xc2be('0x3e')](_0x56d32[_0xc2be('0x39')][_0xc2be('0x3e')]));_0x48e8fb[_0xc2be('0x3c')]=_0x48e8fb['attributes'][_0xc2be('0x3f')]?_0x48e8fb['attributes']:_0x7315b6['model'];if(!_0x56d32[_0xc2be('0x39')]['hasOwnProperty'](_0xc2be('0x40'))){_0x48e8fb[_0xc2be('0x24')]=qs['limit'](_0x56d32[_0xc2be('0x39')][_0xc2be('0x24')]);_0x48e8fb['offset']=qs['offset'](_0x56d32[_0xc2be('0x39')][_0xc2be('0x26')]);}_0x48e8fb[_0xc2be('0x41')]=qs['sort'](_0x56d32[_0xc2be('0x39')]['sort']);_0x48e8fb[_0xc2be('0x43')]=qs[_0xc2be('0x3b')](_[_0xc2be('0x44')](_0x56d32['query'],_0x7315b6[_0xc2be('0x3b')]));if(_0x56d32['query'][_0xc2be('0x54')]){_0x48e8fb[_0xc2be('0x43')]=_[_0xc2be('0x46')](_0x48e8fb[_0xc2be('0x43')],{'$or':_[_0xc2be('0x32')](_0x48e8fb[_0xc2be('0x3c')],function(_0x56cce4){var _0x52ad84={};_0x52ad84[_0x56cce4]={'$like':'%'+_0x56d32[_0xc2be('0x39')]['filter']+'%'};return _0x52ad84;})});}_0x48e8fb=_['merge']({},_0x48e8fb,_0x56d32[_0xc2be('0x47')]);var _0x4feaf8={'where':_0x48e8fb[_0xc2be('0x43')]};return db['VoiceQueueReport'][_0xc2be('0x25')](_0x4feaf8)[_0xc2be('0x2d')](function(_0x4ebbc2){_0x1687ab[_0xc2be('0x25')]=_0x4ebbc2;if(_0x56d32[_0xc2be('0x39')][_0xc2be('0x48')]){_0x48e8fb[_0xc2be('0x4e')]=[{'all':!![]}];}return db[_0xc2be('0x33')]['findAll'](_0x48e8fb);})[_0xc2be('0x2d')](function(_0x29b1b2){_0x1687ab['rows']=_0x29b1b2;return _0x1687ab;})[_0xc2be('0x2d')](respondWithFilteredResult(_0x4e3f3c,_0x48e8fb,'getVoiceQueuesReport'))[_0xc2be('0x4b')](handleError(_0x4e3f3c,null,_0xc2be('0x53')));}; \ No newline at end of file +var _0x38a6=['sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','getVoiceQueuesReport','nolimit','options','findAll','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x536399,_0x170460){var _0x5f408e=function(_0x2b5452){while(--_0x2b5452){_0x536399['push'](_0x536399['shift']());}};_0x5f408e(++_0x170460);}(_0x38a6,0x18b));var _0x638a=function(_0x383784,_0x1b41ff){_0x383784=_0x383784-0x0;var _0x3ac75d=_0x38a6[_0x383784];return _0x3ac75d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x638a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x638a('0x1'));var rp=require(_0x638a('0x2'));var moment=require(_0x638a('0x3'));var BPromise=require(_0x638a('0x4'));var Mustache=require(_0x638a('0x5'));var util=require(_0x638a('0x6'));var path=require(_0x638a('0x7'));var sox=require(_0x638a('0x8'));var csv=require(_0x638a('0x9'));var ejs=require(_0x638a('0xa'));var fs=require('fs');var fs_extra=require(_0x638a('0xb'));var _=require(_0x638a('0xc'));var squel=require(_0x638a('0xd'));var crypto=require(_0x638a('0xe'));var jsforce=require(_0x638a('0xf'));var deskjs=require(_0x638a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x638a('0x11'));var Papa=require(_0x638a('0x12'));var Redis=require(_0x638a('0x13'));var authService=require(_0x638a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x638a('0x15'));var hardwareService=require(_0x638a('0x16'));var logger=require('../../config/logger')(_0x638a('0x17'));var utils=require(_0x638a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x638a('0x19'));var db=require('../../mysqldb')['db'];config[_0x638a('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x638a('0x1b'))(new Redis(config[_0x638a('0x1a')]));require(_0x638a('0x1c'))[_0x638a('0x1d')](socket);function respondWithStatusCode(_0xf181b5,_0x4238d5){_0x4238d5=_0x4238d5||0xcc;return function(_0x407a47){if(_0x407a47){return _0xf181b5[_0x638a('0x1e')](_0x4238d5);}return _0xf181b5[_0x638a('0x1f')](_0x4238d5)['end']();};}function respondWithResult(_0x1918b1,_0x906b93){_0x906b93=_0x906b93||0xc8;return function(_0x1cff21){if(_0x1cff21){return _0x1918b1[_0x638a('0x1f')](_0x906b93)[_0x638a('0x20')](_0x1cff21);}};}function respondWithFilteredResult(_0xa228f,_0x50f03b){return function(_0x1c536f){if(_0x1c536f){var _0x12f961=typeof _0x50f03b[_0x638a('0x21')]==='undefined'&&typeof _0x50f03b['limit']===_0x638a('0x22');var _0x2c9e57=_0x1c536f[_0x638a('0x23')];var _0x374d56=_0x12f961?0x0:_0x50f03b[_0x638a('0x21')];var _0xc5e758=_0x12f961?_0x1c536f[_0x638a('0x23')]:_0x50f03b[_0x638a('0x21')]+_0x50f03b[_0x638a('0x24')];var _0x2bb8db;if(_0xc5e758>=_0x2c9e57){_0xc5e758=_0x2c9e57;_0x2bb8db=0xc8;}else{_0x2bb8db=0xce;}_0xa228f[_0x638a('0x1f')](_0x2bb8db);return _0xa228f[_0x638a('0x25')](_0x638a('0x26'),_0x374d56+'-'+_0xc5e758+'/'+_0x2c9e57)['json'](_0x1c536f);}return null;};}function patchUpdates(_0x239406){return function(_0x88f0d8){try{jsonpatch['apply'](_0x88f0d8,_0x239406,!![]);}catch(_0x416a0b){return BPromise[_0x638a('0x27')](_0x416a0b);}return _0x88f0d8[_0x638a('0x28')]();};}function saveUpdates(_0x350946,_0x118814){return function(_0x46f92e){if(_0x46f92e){return _0x46f92e[_0x638a('0x29')](_0x350946)[_0x638a('0x2a')](function(_0x13cdc7){return _0x13cdc7;});}return null;};}function removeEntity(_0x3e3b95,_0x3b46e5){return function(_0x3b4c7f){if(_0x3b4c7f){return _0x3b4c7f[_0x638a('0x2b')]()[_0x638a('0x2a')](function(){_0x3e3b95[_0x638a('0x1f')](0xcc)[_0x638a('0x2c')]();});}};}function handleEntityNotFound(_0xa5de65,_0xc26983){return function(_0x1e71dd){if(!_0x1e71dd){_0xa5de65['sendStatus'](0x194);}return _0x1e71dd;};}function handleError(_0x19c7e7,_0x229672){_0x229672=_0x229672||0x1f4;return function(_0x33dd90){logger[_0x638a('0x2d')](_0x33dd90['stack']);if(_0x33dd90[_0x638a('0x2e')]){delete _0x33dd90[_0x638a('0x2e')];}_0x19c7e7['status'](_0x229672)[_0x638a('0x2f')](_0x33dd90);};}exports[_0x638a('0x30')]=function(_0x3e5cf6,_0x587845){var _0x23c1b0={},_0x2525ed={},_0x59a2ae={'count':0x0,'rows':[]};var _0x47521f=_[_0x638a('0x31')](db[_0x638a('0x32')][_0x638a('0x33')],function(_0x502f3d){return{'name':_0x502f3d[_0x638a('0x34')],'type':_0x502f3d[_0x638a('0x35')][_0x638a('0x36')]};});_0x2525ed[_0x638a('0x37')]=_[_0x638a('0x31')](_0x47521f,_0x638a('0x2e'));_0x2525ed[_0x638a('0x38')]=_[_0x638a('0x39')](_0x3e5cf6['query']);_0x2525ed[_0x638a('0x3a')]=_['intersection'](_0x2525ed[_0x638a('0x37')],_0x2525ed[_0x638a('0x38')]);_0x23c1b0['attributes']=_['intersection'](_0x2525ed[_0x638a('0x37')],qs['fields'](_0x3e5cf6[_0x638a('0x38')][_0x638a('0x3b')]));_0x23c1b0[_0x638a('0x3c')]=_0x23c1b0[_0x638a('0x3c')][_0x638a('0x3d')]?_0x23c1b0[_0x638a('0x3c')]:_0x2525ed[_0x638a('0x37')];if(!_0x3e5cf6[_0x638a('0x38')][_0x638a('0x3e')]('nolimit')){_0x23c1b0[_0x638a('0x24')]=qs[_0x638a('0x24')](_0x3e5cf6[_0x638a('0x38')][_0x638a('0x24')]);_0x23c1b0['offset']=qs[_0x638a('0x21')](_0x3e5cf6[_0x638a('0x38')][_0x638a('0x21')]);}_0x23c1b0[_0x638a('0x3f')]=qs[_0x638a('0x40')](_0x3e5cf6[_0x638a('0x38')][_0x638a('0x40')]);_0x23c1b0[_0x638a('0x41')]=qs[_0x638a('0x3a')](_[_0x638a('0x42')](_0x3e5cf6[_0x638a('0x38')],_0x2525ed[_0x638a('0x3a')]),_0x47521f);if(_0x3e5cf6['query'][_0x638a('0x43')]){_0x23c1b0[_0x638a('0x41')]=_[_0x638a('0x44')](_0x23c1b0[_0x638a('0x41')],{'$or':_['map'](_0x47521f,function(_0x577cd8){if(_0x577cd8[_0x638a('0x35')]!==_0x638a('0x45')){var _0x19fb01={};_0x19fb01[_0x577cd8[_0x638a('0x2e')]]={'$like':'%'+_0x3e5cf6[_0x638a('0x38')][_0x638a('0x43')]+'%'};return _0x19fb01;}})});}_0x23c1b0=_[_0x638a('0x44')]({},_0x23c1b0,_0x3e5cf6['options']);var _0x1a57a2={'where':_0x23c1b0['where']};return db['VoiceQueueReport'][_0x638a('0x23')](_0x1a57a2)[_0x638a('0x2a')](function(_0x2b899e){_0x59a2ae[_0x638a('0x23')]=_0x2b899e;if(_0x3e5cf6[_0x638a('0x38')][_0x638a('0x46')]){_0x23c1b0[_0x638a('0x47')]=[{'all':!![]}];}return db[_0x638a('0x32')]['findAll'](_0x23c1b0);})[_0x638a('0x2a')](function(_0x526371){_0x59a2ae[_0x638a('0x48')]=_0x526371;return _0x59a2ae;})[_0x638a('0x2a')](respondWithFilteredResult(_0x587845,_0x23c1b0))[_0x638a('0x49')](handleError(_0x587845,null));};exports[_0x638a('0x4a')]=function(_0x8cfbc9,_0x30a5cf){var _0x2f9c86={'raw':![],'where':{'id':_0x8cfbc9[_0x638a('0x4b')]['id']}},_0x3606db={};_0x3606db[_0x638a('0x37')]=_[_0x638a('0x39')](db[_0x638a('0x32')]['rawAttributes']);_0x3606db[_0x638a('0x38')]=_['keys'](_0x8cfbc9[_0x638a('0x38')]);_0x3606db['filters']=_[_0x638a('0x4c')](_0x3606db[_0x638a('0x37')],_0x3606db[_0x638a('0x38')]);_0x2f9c86[_0x638a('0x3c')]=_[_0x638a('0x4c')](_0x3606db[_0x638a('0x37')],qs[_0x638a('0x3b')](_0x8cfbc9[_0x638a('0x38')]['fields']));_0x2f9c86[_0x638a('0x3c')]=_0x2f9c86['attributes']['length']?_0x2f9c86['attributes']:_0x3606db[_0x638a('0x37')];if(_0x8cfbc9['query'][_0x638a('0x46')]){_0x2f9c86['include']=[{'all':!![]}];}_0x2f9c86=_['merge']({},_0x2f9c86,_0x8cfbc9['options']);return db[_0x638a('0x32')]['find'](_0x2f9c86)[_0x638a('0x2a')](handleEntityNotFound(_0x30a5cf,null))[_0x638a('0x2a')](respondWithResult(_0x30a5cf,null))[_0x638a('0x49')](handleError(_0x30a5cf,null));};exports[_0x638a('0x4d')]=function(_0x34ede2,_0x48430d){return db[_0x638a('0x32')][_0x638a('0x4d')](_0x34ede2[_0x638a('0x4e')],{})[_0x638a('0x2a')](respondWithResult(_0x48430d,0xc9))[_0x638a('0x49')](handleError(_0x48430d,null));};exports[_0x638a('0x29')]=function(_0x2805d3,_0x43a860){if(_0x2805d3[_0x638a('0x4e')]['id']){delete _0x2805d3[_0x638a('0x4e')]['id'];}return db[_0x638a('0x32')]['find']({'where':{'id':_0x2805d3[_0x638a('0x4b')]['id']}})[_0x638a('0x2a')](handleEntityNotFound(_0x43a860,null))[_0x638a('0x2a')](saveUpdates(_0x2805d3[_0x638a('0x4e')],null))['then'](respondWithResult(_0x43a860,null))[_0x638a('0x49')](handleError(_0x43a860,null));};exports[_0x638a('0x2b')]=function(_0x211acf,_0x543533){return db[_0x638a('0x32')][_0x638a('0x4f')]({'where':{'id':_0x211acf[_0x638a('0x4b')]['id']}})[_0x638a('0x2a')](handleEntityNotFound(_0x543533,null))[_0x638a('0x2a')](removeEntity(_0x543533,null))['catch'](handleError(_0x543533,null));};exports['describe']=function(_0x5a452e,_0x22561b){return db['VoiceQueueReport'][_0x638a('0x50')]()['then'](respondWithResult(_0x22561b,null))['catch'](handleError(_0x22561b,null));};exports[_0x638a('0x51')]=function(_0x40418f,_0x427732){var _0x49acac={},_0x4b57bd={},_0x19e035={'count':0x0,'rows':[]};_0x4b57bd['model']=_[_0x638a('0x39')](db[_0x638a('0x32')][_0x638a('0x33')]);_0x4b57bd[_0x638a('0x38')]=_[_0x638a('0x39')](_0x40418f[_0x638a('0x38')]);_0x4b57bd[_0x638a('0x3a')]=_['intersection'](_0x4b57bd['model'],_0x4b57bd[_0x638a('0x38')]);_0x49acac[_0x638a('0x3c')]=_[_0x638a('0x4c')](_0x4b57bd['model'],qs[_0x638a('0x3b')](_0x40418f[_0x638a('0x38')]['fields']));_0x49acac[_0x638a('0x3c')]=_0x49acac['attributes']['length']?_0x49acac[_0x638a('0x3c')]:_0x4b57bd['model'];if(!_0x40418f[_0x638a('0x38')][_0x638a('0x3e')](_0x638a('0x52'))){_0x49acac['limit']=qs[_0x638a('0x24')](_0x40418f['query'][_0x638a('0x24')]);_0x49acac[_0x638a('0x21')]=qs['offset'](_0x40418f[_0x638a('0x38')][_0x638a('0x21')]);}_0x49acac['order']=qs[_0x638a('0x40')](_0x40418f[_0x638a('0x38')]['sort']);_0x49acac[_0x638a('0x41')]=qs[_0x638a('0x3a')](_[_0x638a('0x42')](_0x40418f[_0x638a('0x38')],_0x4b57bd['filters']));if(_0x40418f['query'][_0x638a('0x43')]){_0x49acac['where']=_['merge'](_0x49acac['where'],{'$or':_[_0x638a('0x31')](_0x49acac[_0x638a('0x3c')],function(_0x3c80af){var _0x2e5e75={};_0x2e5e75[_0x3c80af]={'$like':'%'+_0x40418f[_0x638a('0x38')][_0x638a('0x43')]+'%'};return _0x2e5e75;})});}_0x49acac=_['merge']({},_0x49acac,_0x40418f[_0x638a('0x53')]);var _0x228a0d={'where':_0x49acac[_0x638a('0x41')]};return db[_0x638a('0x32')][_0x638a('0x23')](_0x228a0d)['then'](function(_0x304bf2){_0x19e035['count']=_0x304bf2;if(_0x40418f[_0x638a('0x38')][_0x638a('0x46')]){_0x49acac[_0x638a('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x638a('0x54')](_0x49acac);})[_0x638a('0x2a')](function(_0x44010a){_0x19e035['rows']=_0x44010a;return _0x19e035;})[_0x638a('0x2a')](respondWithFilteredResult(_0x427732,_0x49acac,_0x638a('0x51')))[_0x638a('0x49')](handleError(_0x427732,null,_0x638a('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d5a5ca0..69456a3 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 _0xecac=['../../mysqldb','setMaxListeners','save','update','remove','emit','events'];(function(_0x25e616,_0x5bf1e1){var _0x146bfe=function(_0x5c6fe1){while(--_0x5c6fe1){_0x25e616['push'](_0x25e616['shift']());}};_0x146bfe(++_0x5bf1e1);}(_0xecac,0x1bf));var _0xceca=function(_0xece61a,_0x2781d9){_0xece61a=_0xece61a-0x0;var _0x338e68=_0xecac[_0xece61a];return _0x338e68;};'use strict';var EventEmitter=require(_0xceca('0x0'));var VoiceQueueReport=require(_0xceca('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xceca('0x2')](0x0);var events={'afterCreate':_0xceca('0x3'),'afterUpdate':_0xceca('0x4'),'afterDestroy':_0xceca('0x5')};function emitEvent(_0x238918){return function(_0x1a45c6,_0x3686b5,_0x532d55){VoiceQueueReportEvents['emit'](_0x238918+':'+_0x1a45c6['id'],_0x1a45c6);VoiceQueueReportEvents[_0xceca('0x6')](_0x238918,_0x1a45c6);_0x532d55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x08d9=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x31922e,_0x142c01){var _0x3687d5=function(_0x5872cc){while(--_0x5872cc){_0x31922e['push'](_0x31922e['shift']());}};_0x3687d5(++_0x142c01);}(_0x08d9,0xa9));var _0x908d=function(_0x3def54,_0x310e15){_0x3def54=_0x3def54-0x0;var _0x108e52=_0x08d9[_0x3def54];return _0x108e52;};'use strict';var EventEmitter=require(_0x908d('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x908d('0x1')](0x0);var events={'afterCreate':_0x908d('0x2'),'afterUpdate':_0x908d('0x3'),'afterDestroy':_0x908d('0x4')};function emitEvent(_0x3373cc){return function(_0x291c2f,_0x42b087,_0x372932){VoiceQueueReportEvents[_0x908d('0x5')](_0x3373cc+':'+_0x291c2f['id'],_0x291c2f);VoiceQueueReportEvents['emit'](_0x3373cc,_0x291c2f);_0x372932(null);};}for(var e in events){if(events[_0x908d('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x908d('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 39d5c90..1f05ff6 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 _0x2b31=['request-promise','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x538b96,_0x2040a8){var _0x528549=function(_0x5ef6aa){while(--_0x5ef6aa){_0x538b96['push'](_0x538b96['shift']());}};_0x528549(++_0x2040a8);}(_0x2b31,0xcd));var _0x12b3=function(_0x2926ac,_0x1f9e37){_0x2926ac=_0x2926ac-0x0;var _0x41edac=_0x2b31[_0x2926ac];return _0x41edac;};'use strict';var _=require(_0x12b3('0x0'));var util=require(_0x12b3('0x1'));var logger=require(_0x12b3('0x2'))(_0x12b3('0x3'));var moment=require(_0x12b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x12b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12b3('0x6'));var config=require('../../config/environment');var attributes=require(_0x12b3('0x7'));module[_0x12b3('0x8')]=function(_0x39ea83,_0x37a375){return _0x39ea83[_0x12b3('0x9')](_0x12b3('0xa'),attributes,{'tableName':_0x12b3('0xb'),'paranoid':![],'indexes':[{'fields':[_0x12b3('0xc')]},{'fields':[_0x12b3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69a5=['VoiceQueueReport','report_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x69a5,0x121));var _0x569a=function(_0x31a756,_0x5db6c8){_0x31a756=_0x31a756-0x0;var _0x45133a=_0x69a5[_0x31a756];return _0x45133a;};'use strict';var _=require(_0x569a('0x0'));var util=require('util');var logger=require(_0x569a('0x1'))(_0x569a('0x2'));var moment=require(_0x569a('0x3'));var BPromise=require(_0x569a('0x4'));var rp=require(_0x569a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x569a('0x6'));var config=require(_0x569a('0x7'));var attributes=require(_0x569a('0x8'));module[_0x569a('0x9')]=function(_0x14fe95,_0x2cf694){return _0x14fe95['define'](_0x569a('0xa'),attributes,{'tableName':_0x569a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x569a('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 96678b0..b42a527 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 _0x14d3=['error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c7134,_0x1eae0b){var _0x54da70=function(_0x5ebfa3){while(--_0x5ebfa3){_0x4c7134['push'](_0x4c7134['shift']());}};_0x54da70(++_0x1eae0b);}(_0x14d3,0x92));var _0x314d=function(_0x1aaef9,_0x25790e){_0x1aaef9=_0x1aaef9-0x0;var _0x2ce77f=_0x14d3[_0x1aaef9];return _0x2ce77f;};'use strict';var _=require(_0x314d('0x0'));var util=require(_0x314d('0x1'));var moment=require('moment');var BPromise=require(_0x314d('0x2'));var rs=require(_0x314d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x314d('0x4'))['db'];var utils=require(_0x314d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x314d('0x6'));var jayson=require(_0x314d('0x7'));var client=jayson[_0x314d('0x8')]['http']({'port':0x232a});config[_0x314d('0x9')]=_[_0x314d('0xa')](config['redis'],{'host':_0x314d('0xb'),'port':0x18eb});var socket=require(_0x314d('0xc'))(new Redis(config[_0x314d('0x9')]));require(_0x314d('0xd'))['register'](socket);function respondWithRpcPromise(_0x479d00,_0x1ac415,_0x556544){return new BPromise(function(_0x1c927a,_0xf332cf){return client[_0x314d('0xe')](_0x479d00,_0x556544)[_0x314d('0xf')](function(_0x4e92e3){logger[_0x314d('0x10')](_0x314d('0x11'),_0x1ac415,_0x314d('0x12'));logger[_0x314d('0x13')](_0x314d('0x14'),_0x1ac415,'request\x20sent',JSON[_0x314d('0x15')](_0x4e92e3));if(_0x4e92e3[_0x314d('0x16')]){if(_0x4e92e3[_0x314d('0x16')][_0x314d('0x17')]===0x1f4){logger[_0x314d('0x16')](_0x314d('0x11'),_0x1ac415,_0x4e92e3[_0x314d('0x16')][_0x314d('0x18')]);return _0xf332cf(_0x4e92e3['error']['message']);}logger[_0x314d('0x16')](_0x314d('0x11'),_0x1ac415,_0x4e92e3[_0x314d('0x16')]['message']);return _0x1c927a(_0x4e92e3[_0x314d('0x16')][_0x314d('0x18')]);}else{logger['info'](_0x314d('0x11'),_0x1ac415,'request\x20sent');_0x1c927a(_0x4e92e3[_0x314d('0x19')]['message']);}})[_0x314d('0x1a')](function(_0x442707){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1ac415,_0x442707);_0xf332cf(_0x442707);});});}exports['GetVoiceQueueReport']=function(_0x2f7a23){var _0x58fbc6=this;return new Promise(function(_0x2f55eb,_0x41f831){return db[_0x314d('0x1b')][_0x314d('0x1c')]({'raw':_0x2f7a23['options']?_0x2f7a23[_0x314d('0x1d')][_0x314d('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f7a23[_0x314d('0x1d')]?_0x2f7a23[_0x314d('0x1d')][_0x314d('0x1f')]||null:null,'attributes':_0x2f7a23['options']?_0x2f7a23[_0x314d('0x1d')][_0x314d('0x20')]||null:null,'limit':_0x2f7a23[_0x314d('0x1d')]?_0x2f7a23['options'][_0x314d('0x21')]||null:null,'include':_0x2f7a23['options']?_0x2f7a23[_0x314d('0x1d')][_0x314d('0x22')]?_[_0x314d('0x23')](_0x2f7a23[_0x314d('0x1d')][_0x314d('0x22')],function(_0x362201){return{'model':db[_0x362201[_0x314d('0x24')]],'as':_0x362201['as'],'attributes':_0x362201[_0x314d('0x20')],'include':_0x362201[_0x314d('0x22')]?_[_0x314d('0x23')](_0x362201[_0x314d('0x22')],function(_0x1a0352){return{'model':db[_0x1a0352[_0x314d('0x24')]],'as':_0x1a0352['as'],'attributes':_0x1a0352[_0x314d('0x20')],'include':_0x1a0352[_0x314d('0x22')]?_[_0x314d('0x23')](_0x1a0352[_0x314d('0x22')],function(_0x1ce9ec){return{'model':db[_0x1ce9ec[_0x314d('0x24')]],'as':_0x1ce9ec['as'],'attributes':_0x1ce9ec[_0x314d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34f3b3){logger['info']('GetVoiceQueueReport',_0x2f7a23);logger[_0x314d('0x13')](_0x314d('0x25'),_0x2f7a23,JSON[_0x314d('0x15')](_0x34f3b3));_0x2f55eb(_0x34f3b3);})[_0x314d('0x1a')](function(_0xf764a2){logger[_0x314d('0x16')](_0x314d('0x25'),_0xf764a2[_0x314d('0x18')],_0x2f7a23);_0x41f831(_0x58fbc6['error'](0x1f4,_0xf764a2[_0x314d('0x18')]));});});};exports[_0x314d('0x26')]=function(_0x3f09fe){var _0x38a378=this;return new Promise(function(_0x56e6e2,_0x3236cd){return db['VoiceQueueReport']['create'](_0x3f09fe[_0x314d('0x27')],{'raw':_0x3f09fe['options']?_0x3f09fe['options'][_0x314d('0x1e')]===undefined?!![]:![]:!![]})[_0x314d('0xf')](function(_0x1d8ff3){logger[_0x314d('0x10')]('CreateVoiceQueueReport',_0x3f09fe);logger[_0x314d('0x13')]('CreateVoiceQueueReport',_0x3f09fe,JSON['stringify'](_0x1d8ff3));_0x56e6e2(_0x1d8ff3);})['catch'](function(_0x2ae403){logger[_0x314d('0x16')](_0x314d('0x26'),_0x2ae403[_0x314d('0x18')],_0x3f09fe);_0x3236cd(_0x38a378[_0x314d('0x16')](0x1f4,_0x2ae403[_0x314d('0x18')]));});});};exports[_0x314d('0x28')]=function(_0x342fb6){var _0x184c43=this;return new Promise(function(_0xb28720,_0x1bd911){return db[_0x314d('0x1b')][_0x314d('0x29')](_0x342fb6['body'],{'raw':_0x342fb6['options']?_0x342fb6['options'][_0x314d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x342fb6[_0x314d('0x1d')]?_0x342fb6['options']['where']||null:null,'attributes':_0x342fb6[_0x314d('0x1d')]?_0x342fb6['options'][_0x314d('0x20')]||null:null,'limit':_0x342fb6['options']?_0x342fb6['options'][_0x314d('0x21')]||null:null})[_0x314d('0xf')](function(_0x4d5e3e){logger['info'](_0x314d('0x28'),_0x342fb6);logger[_0x314d('0x13')](_0x314d('0x28'),_0x342fb6,JSON[_0x314d('0x15')](_0x4d5e3e));_0xb28720(_0x4d5e3e);})[_0x314d('0x1a')](function(_0x3f27c8){logger['error'](_0x314d('0x28'),_0x3f27c8[_0x314d('0x18')],_0x342fb6);_0x1bd911(_0x184c43[_0x314d('0x16')](0x1f4,_0x3f27c8['message']));});});}; \ No newline at end of file +var _0x8df9=['request\x20sent','stringify','error','message','info','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x276399,_0x3f775f){var _0x5bc1dd=function(_0xa2f8ff){while(--_0xa2f8ff){_0x276399['push'](_0x276399['shift']());}};_0x5bc1dd(++_0x3f775f);}(_0x8df9,0x6c));var _0x98df=function(_0x2acff0,_0xeb280){_0x2acff0=_0x2acff0-0x0;var _0x28f38c=_0x8df9[_0x2acff0];return _0x28f38c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x98df('0x0'));var BPromise=require(_0x98df('0x1'));var rs=require(_0x98df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98df('0x3'))['db'];var utils=require(_0x98df('0x4'));var logger=require('../../config/logger')(_0x98df('0x5'));var config=require(_0x98df('0x6'));var jayson=require(_0x98df('0x7'));var client=jayson[_0x98df('0x8')][_0x98df('0x9')]({'port':0x232a});config['redis']=_[_0x98df('0xa')](config[_0x98df('0xb')],{'host':_0x98df('0xc'),'port':0x18eb});var socket=require(_0x98df('0xd'))(new Redis(config[_0x98df('0xb')]));require(_0x98df('0xe'))[_0x98df('0xf')](socket);function respondWithRpcPromise(_0x5000ab,_0x206c18,_0x4ca2eb){return new BPromise(function(_0xa4ca2e,_0x545105){return client[_0x98df('0x10')](_0x5000ab,_0x4ca2eb)[_0x98df('0x11')](function(_0x2cd806){logger['info'](_0x98df('0x12'),_0x206c18,'request\x20sent');logger[_0x98df('0x13')](_0x98df('0x14'),_0x206c18,_0x98df('0x15'),JSON[_0x98df('0x16')](_0x2cd806));if(_0x2cd806[_0x98df('0x17')]){if(_0x2cd806[_0x98df('0x17')]['code']===0x1f4){logger[_0x98df('0x17')](_0x98df('0x12'),_0x206c18,_0x2cd806['error'][_0x98df('0x18')]);return _0x545105(_0x2cd806[_0x98df('0x17')][_0x98df('0x18')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x206c18,_0x2cd806[_0x98df('0x17')]['message']);return _0xa4ca2e(_0x2cd806[_0x98df('0x17')]['message']);}else{logger[_0x98df('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x206c18,'request\x20sent');_0xa4ca2e(_0x2cd806['result'][_0x98df('0x18')]);}})[_0x98df('0x1a')](function(_0x317143){logger['error'](_0x98df('0x12'),_0x206c18,_0x317143);_0x545105(_0x317143);});});}exports['GetVoiceQueueReport']=function(_0x48a3d6){var _0x20cecb=this;return new Promise(function(_0x435237,_0x3512aa){return db[_0x98df('0x1b')][_0x98df('0x1c')]({'raw':_0x48a3d6[_0x98df('0x1d')]?_0x48a3d6[_0x98df('0x1d')][_0x98df('0x1e')]===undefined?!![]:![]:!![],'where':_0x48a3d6[_0x98df('0x1d')]?_0x48a3d6[_0x98df('0x1d')][_0x98df('0x1f')]||null:null,'attributes':_0x48a3d6[_0x98df('0x1d')]?_0x48a3d6[_0x98df('0x1d')][_0x98df('0x20')]||null:null,'limit':_0x48a3d6[_0x98df('0x1d')]?_0x48a3d6[_0x98df('0x1d')][_0x98df('0x21')]||null:null,'include':_0x48a3d6[_0x98df('0x1d')]?_0x48a3d6[_0x98df('0x1d')][_0x98df('0x22')]?_[_0x98df('0x23')](_0x48a3d6[_0x98df('0x1d')][_0x98df('0x22')],function(_0x5e0fe9){return{'model':db[_0x5e0fe9[_0x98df('0x24')]],'as':_0x5e0fe9['as'],'attributes':_0x5e0fe9['attributes'],'include':_0x5e0fe9[_0x98df('0x22')]?_[_0x98df('0x23')](_0x5e0fe9[_0x98df('0x22')],function(_0x2d8863){return{'model':db[_0x2d8863['model']],'as':_0x2d8863['as'],'attributes':_0x2d8863['attributes'],'include':_0x2d8863[_0x98df('0x22')]?_['map'](_0x2d8863[_0x98df('0x22')],function(_0x24bb89){return{'model':db[_0x24bb89[_0x98df('0x24')]],'as':_0x24bb89['as'],'attributes':_0x24bb89['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c2893){logger['info'](_0x98df('0x25'),_0x48a3d6);logger[_0x98df('0x13')](_0x98df('0x25'),_0x48a3d6,JSON['stringify'](_0x5c2893));_0x435237(_0x5c2893);})[_0x98df('0x1a')](function(_0x3029f7){logger[_0x98df('0x17')](_0x98df('0x25'),_0x3029f7['message'],_0x48a3d6);_0x3512aa(_0x20cecb[_0x98df('0x17')](0x1f4,_0x3029f7[_0x98df('0x18')]));});});};exports[_0x98df('0x26')]=function(_0x55a021){var _0x507eb0=this;return new Promise(function(_0x3da758,_0x16cbf1){return db[_0x98df('0x1b')][_0x98df('0x27')](_0x55a021[_0x98df('0x28')],{'raw':_0x55a021['options']?_0x55a021['options']['raw']===undefined?!![]:![]:!![]})[_0x98df('0x11')](function(_0x3ee2a6){logger[_0x98df('0x19')](_0x98df('0x26'),_0x55a021);logger[_0x98df('0x13')](_0x98df('0x26'),_0x55a021,JSON[_0x98df('0x16')](_0x3ee2a6));_0x3da758(_0x3ee2a6);})['catch'](function(_0x27b5fb){logger[_0x98df('0x17')](_0x98df('0x26'),_0x27b5fb[_0x98df('0x18')],_0x55a021);_0x16cbf1(_0x507eb0[_0x98df('0x17')](0x1f4,_0x27b5fb[_0x98df('0x18')]));});});};exports[_0x98df('0x29')]=function(_0x4c3775){var _0x182c85=this;return new Promise(function(_0x17a38a,_0x459d22){return db[_0x98df('0x1b')][_0x98df('0x2a')](_0x4c3775[_0x98df('0x28')],{'raw':_0x4c3775[_0x98df('0x1d')]?_0x4c3775['options'][_0x98df('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c3775[_0x98df('0x1d')]?_0x4c3775[_0x98df('0x1d')][_0x98df('0x1f')]||null:null,'attributes':_0x4c3775['options']?_0x4c3775[_0x98df('0x1d')][_0x98df('0x20')]||null:null,'limit':_0x4c3775['options']?_0x4c3775[_0x98df('0x1d')][_0x98df('0x21')]||null:null})['then'](function(_0x216b97){logger[_0x98df('0x19')](_0x98df('0x29'),_0x4c3775);logger['debug']('UpdateVoiceQueueReport',_0x4c3775,JSON[_0x98df('0x16')](_0x216b97));_0x17a38a(_0x216b97);})[_0x98df('0x1a')](function(_0x32238e){logger['error'](_0x98df('0x29'),_0x32238e[_0x98df('0x18')],_0x4c3775);_0x459d22(_0x182c85[_0x98df('0x17')](0x1f4,_0x32238e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 79e9b08..6d91e38 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 _0xaf40=['emit','removeListener','register','length','voiceQueueReport:','save','remove','update'];(function(_0x58c275,_0x519f61){var _0x30aa9e=function(_0x1612d0){while(--_0x1612d0){_0x58c275['push'](_0x58c275['shift']());}};_0x30aa9e(++_0x519f61);}(_0xaf40,0x75));var _0x0af4=function(_0x48b5a3,_0x3dd00f){_0x48b5a3=_0x48b5a3-0x0;var _0x53fa27=_0xaf40[_0x48b5a3];return _0x53fa27;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x0af4('0x0'),_0x0af4('0x1'),_0x0af4('0x2')];function createListener(_0x2221bd,_0x327a7b){return function(_0x2cf839){_0x327a7b[_0x0af4('0x3')](_0x2221bd,_0x2cf839);};}function removeListener(_0x35be09,_0x18ca82){return function(){VoiceQueueReportEvents[_0x0af4('0x4')](_0x35be09,_0x18ca82);};}exports[_0x0af4('0x5')]=function(_0x1aebbe){for(var _0x244b1b=0x0,_0x1cc59a=events[_0x0af4('0x6')];_0x244b1b<_0x1cc59a;_0x244b1b++){var _0x55570e=events[_0x244b1b];var _0x2ecd06=createListener(_0x0af4('0x7')+_0x55570e,_0x1aebbe);VoiceQueueReportEvents['on'](_0x55570e,_0x2ecd06);}}; \ No newline at end of file +var _0xefbf=['voiceQueueReport:','./voiceQueueReport.events','save','emit','removeListener','length'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xefbf,0xa3));var _0xfefb=function(_0x36c4b8,_0x2cdf51){_0x36c4b8=_0x36c4b8-0x0;var _0x511a61=_0xefbf[_0x36c4b8];return _0x511a61;};'use strict';var VoiceQueueReportEvents=require(_0xfefb('0x0'));var events=[_0xfefb('0x1'),'remove','update'];function createListener(_0x5f199d,_0x24d740){return function(_0x4589ac){_0x24d740[_0xfefb('0x2')](_0x5f199d,_0x4589ac);};}function removeListener(_0x36eb23,_0x79ca1d){return function(){VoiceQueueReportEvents[_0xfefb('0x3')](_0x36eb23,_0x79ca1d);};}exports['register']=function(_0xaac208){for(var _0x58c767=0x0,_0x7851d4=events[_0xfefb('0x4')];_0x58c767<_0x7851d4;_0x58c767++){var _0x5706f5=events[_0x58c767];var _0x18ffe2=createListener(_0xfefb('0x5')+_0x5706f5,_0xaac208);VoiceQueueReportEvents['on'](_0x5706f5,_0x18ffe2);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dca5613..f57438a 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 _0x8828=['show','create','put','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','/:id'];(function(_0x2829ea,_0x5f4281){var _0x2cacc0=function(_0x30addf){while(--_0x30addf){_0x2829ea['push'](_0x2829ea['shift']());}};_0x2cacc0(++_0x5f4281);}(_0x8828,0x1d1));var _0x8882=function(_0x5bf355,_0x56f4df){_0x5bf355=_0x5bf355-0x0;var _0x42973c=_0x8828[_0x5bf355];return _0x42973c;};'use strict';var multer=require(_0x8882('0x0'));var util=require(_0x8882('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8882('0x2'));var router=express[_0x8882('0x3')]();var fs_extra=require(_0x8882('0x4'));var auth=require(_0x8882('0x5'));var interaction=require(_0x8882('0x6'));var config=require('../../config/environment');var controller=require(_0x8882('0x7'));router[_0x8882('0x8')]('/',auth['isAuthenticated'](),controller[_0x8882('0x9')]);router['get'](_0x8882('0xa'),auth['isAuthenticated'](),controller[_0x8882('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8882('0xc')]);router[_0x8882('0xd')](_0x8882('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8882('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x54f3=['post','create','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','/:id','isAuthenticated','show'];(function(_0x4f2809,_0x242168){var _0x12f693=function(_0x3c4027){while(--_0x3c4027){_0x4f2809['push'](_0x4f2809['shift']());}};_0x12f693(++_0x242168);}(_0x54f3,0x120));var _0x354f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x54f3[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x354f('0x0'));var path=require(_0x354f('0x1'));var timeout=require(_0x354f('0x2'));var express=require(_0x354f('0x3'));var router=express[_0x354f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var controller=require(_0x354f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x354f('0x8')]);router['get'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller[_0x354f('0xb')]);router[_0x354f('0xc')]('/',auth['isAuthenticated'](),controller[_0x354f('0xd')]);router['put'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['update']);router['delete'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['destroy']);module[_0x354f('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7dc9a3a..22333fd 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 _0x8ee8=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0x3f872a,_0x3ec864){var _0x13e5fd=function(_0x1db5a6){while(--_0x1db5a6){_0x3f872a['push'](_0x3f872a['shift']());}};_0x13e5fd(++_0x3ec864);}(_0x8ee8,0x1dd));var _0x88ee=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x8ee8[_0x35007a];return _0x574f68;};'use strict';var Sequelize=require(_0x88ee('0x0'));var moment=require('moment');module[_0x88ee('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x88ee('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x88ee('0x3')],'allowNull':![],'defaultValue':moment()[_0x88ee('0x4')](_0x88ee('0x5'))}}; \ No newline at end of file +var _0xf6d2=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x338493,_0x455020){var _0x51cbc4=function(_0x52e0b6){while(--_0x52e0b6){_0x338493['push'](_0x338493['shift']());}};_0x51cbc4(++_0x455020);}(_0xf6d2,0x12b));var _0x2f6d=function(_0x45c618,_0x9294ea){_0x45c618=_0x45c618-0x0;var _0x3a071c=_0xf6d2[_0x45c618];return _0x3a071c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2f6d('0x0'));module['exports']={'time':{'type':Sequelize[_0x2f6d('0x1')]},'callid':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2f6d('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2f6d('0x2')],'allowNull':![],'defaultValue':moment()[_0x2f6d('0x3')](_0x2f6d('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 173de91..f668725 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 _0xcbd9=['VoiceQueuesLog','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','then','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','error','stack','name','index','map'];(function(_0x1f0024,_0x72cfd3){var _0x5a8eb5=function(_0x1b30cd){while(--_0x1b30cd){_0x1f0024['push'](_0x1f0024['shift']());}};_0x5a8eb5(++_0x72cfd3);}(_0xcbd9,0x149));var _0x9cbd=function(_0x1b2d81,_0x34bd5c){_0x1b2d81=_0x1b2d81-0x0;var _0x29a27b=_0xcbd9[_0x1b2d81];return _0x29a27b;};'use strict';var emlformat=require(_0x9cbd('0x0'));var rimraf=require(_0x9cbd('0x1'));var zipdir=require(_0x9cbd('0x2'));var jsonpatch=require(_0x9cbd('0x3'));var rp=require(_0x9cbd('0x4'));var moment=require(_0x9cbd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cbd('0x6'));var util=require(_0x9cbd('0x7'));var path=require(_0x9cbd('0x8'));var sox=require('sox');var csv=require(_0x9cbd('0x9'));var ejs=require(_0x9cbd('0xa'));var fs=require('fs');var fs_extra=require(_0x9cbd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9cbd('0xc'));var jsforce=require(_0x9cbd('0xd'));var deskjs=require(_0x9cbd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cbd('0xf'));var Redis=require('ioredis');var authService=require(_0x9cbd('0x10'));var qs=require(_0x9cbd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cbd('0x12'));var logger=require(_0x9cbd('0x13'))(_0x9cbd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9cbd('0x15'))['db'];function respondWithStatusCode(_0x225117,_0x1cb403){_0x1cb403=_0x1cb403||0xcc;return function(_0x309a56){if(_0x309a56){return _0x225117[_0x9cbd('0x16')](_0x1cb403);}return _0x225117['status'](_0x1cb403)[_0x9cbd('0x17')]();};}function respondWithResult(_0x53dc5e,_0x2ba2f3){_0x2ba2f3=_0x2ba2f3||0xc8;return function(_0x1ee73e){if(_0x1ee73e){return _0x53dc5e[_0x9cbd('0x18')](_0x2ba2f3)[_0x9cbd('0x19')](_0x1ee73e);}};}function respondWithFilteredResult(_0x4762e3,_0x5e0532){return function(_0x46e3e2){if(_0x46e3e2){var _0x26bbbb=typeof _0x5e0532['offset']===_0x9cbd('0x1a')&&typeof _0x5e0532[_0x9cbd('0x1b')]===_0x9cbd('0x1a');var _0x587b09=_0x46e3e2['count'];var _0x470707=_0x26bbbb?0x0:_0x5e0532[_0x9cbd('0x1c')];var _0x2b4615=_0x26bbbb?_0x46e3e2[_0x9cbd('0x1d')]:_0x5e0532[_0x9cbd('0x1c')]+_0x5e0532[_0x9cbd('0x1b')];var _0x58b7a4;if(_0x2b4615>=_0x587b09){_0x2b4615=_0x587b09;_0x58b7a4=0xc8;}else{_0x58b7a4=0xce;}_0x4762e3[_0x9cbd('0x18')](_0x58b7a4);return _0x4762e3[_0x9cbd('0x1e')](_0x9cbd('0x1f'),_0x470707+'-'+_0x2b4615+'/'+_0x587b09)[_0x9cbd('0x19')](_0x46e3e2);}return null;};}function patchUpdates(_0x4e0ac0){return function(_0x325de8){try{jsonpatch[_0x9cbd('0x20')](_0x325de8,_0x4e0ac0,!![]);}catch(_0x838935){return BPromise['reject'](_0x838935);}return _0x325de8[_0x9cbd('0x21')]();};}function saveUpdates(_0x146344,_0x5c87ff){return function(_0x2d238f){if(_0x2d238f){return _0x2d238f[_0x9cbd('0x22')](_0x146344)['then'](function(_0x37a0e6){return _0x37a0e6;});}return null;};}function removeEntity(_0x552512,_0x4508fe){return function(_0x925bb9){if(_0x925bb9){return _0x925bb9[_0x9cbd('0x23')]()['then'](function(){_0x552512[_0x9cbd('0x18')](0xcc)[_0x9cbd('0x17')]();});}};}function handleEntityNotFound(_0x576cbb,_0x52b0da){return function(_0x3c855f){if(!_0x3c855f){_0x576cbb['sendStatus'](0x194);}return _0x3c855f;};}function handleError(_0x170ed0,_0x54300b){_0x54300b=_0x54300b||0x1f4;return function(_0x369f67){logger[_0x9cbd('0x24')](_0x369f67[_0x9cbd('0x25')]);if(_0x369f67[_0x9cbd('0x26')]){delete _0x369f67[_0x9cbd('0x26')];}_0x170ed0[_0x9cbd('0x18')](_0x54300b)['send'](_0x369f67);};}exports[_0x9cbd('0x27')]=function(_0x3b16e1,_0x6add47){var _0x47881e={},_0x15a62e={},_0x11881c={'count':0x0,'rows':[]};var _0x46ba66=_[_0x9cbd('0x28')](db[_0x9cbd('0x29')][_0x9cbd('0x2a')],function(_0x3c19f7){return{'name':_0x3c19f7[_0x9cbd('0x2b')],'type':_0x3c19f7['type'][_0x9cbd('0x2c')]};});_0x15a62e[_0x9cbd('0x2d')]=_[_0x9cbd('0x28')](_0x46ba66,'name');_0x15a62e[_0x9cbd('0x2e')]=_[_0x9cbd('0x2f')](_0x3b16e1[_0x9cbd('0x2e')]);_0x15a62e[_0x9cbd('0x30')]=_['intersection'](_0x15a62e[_0x9cbd('0x2d')],_0x15a62e[_0x9cbd('0x2e')]);_0x47881e[_0x9cbd('0x31')]=_[_0x9cbd('0x32')](_0x15a62e[_0x9cbd('0x2d')],qs['fields'](_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x33')]));_0x47881e['attributes']=_0x47881e[_0x9cbd('0x31')][_0x9cbd('0x34')]?_0x47881e['attributes']:_0x15a62e[_0x9cbd('0x2d')];if(!_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x35')](_0x9cbd('0x36'))){_0x47881e[_0x9cbd('0x1b')]=qs[_0x9cbd('0x1b')](_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x1b')]);_0x47881e[_0x9cbd('0x1c')]=qs[_0x9cbd('0x1c')](_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x1c')]);}_0x47881e[_0x9cbd('0x37')]=qs[_0x9cbd('0x38')](_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x38')]);_0x47881e[_0x9cbd('0x39')]=qs[_0x9cbd('0x30')](_[_0x9cbd('0x3a')](_0x3b16e1['query'],_0x15a62e['filters']),_0x46ba66);if(_0x3b16e1['query']['filter']){_0x47881e[_0x9cbd('0x39')]=_[_0x9cbd('0x3b')](_0x47881e[_0x9cbd('0x39')],{'$or':_[_0x9cbd('0x28')](_0x46ba66,function(_0x4a2e21){if(_0x4a2e21[_0x9cbd('0x3c')]!==_0x9cbd('0x3d')){var _0x12e365={};_0x12e365[_0x4a2e21[_0x9cbd('0x26')]]={'$like':'%'+_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x3e')]+'%'};return _0x12e365;}})});}_0x47881e=_[_0x9cbd('0x3b')]({},_0x47881e,_0x3b16e1[_0x9cbd('0x3f')]);var _0x5a89d6={'where':_0x47881e['where']};return db[_0x9cbd('0x29')][_0x9cbd('0x1d')](_0x5a89d6)['then'](function(_0x474f09){_0x11881c[_0x9cbd('0x1d')]=_0x474f09;if(_0x3b16e1[_0x9cbd('0x2e')][_0x9cbd('0x40')]){_0x47881e[_0x9cbd('0x41')]=[{'all':!![]}];}return db[_0x9cbd('0x29')]['findAll'](_0x47881e);})[_0x9cbd('0x42')](function(_0xc54306){_0x11881c[_0x9cbd('0x43')]=_0xc54306;return _0x11881c;})[_0x9cbd('0x42')](respondWithFilteredResult(_0x6add47,_0x47881e))[_0x9cbd('0x44')](handleError(_0x6add47,null));};exports[_0x9cbd('0x45')]=function(_0x40d657,_0x14be17){var _0x2b52c7={'raw':!![],'where':{'id':_0x40d657[_0x9cbd('0x46')]['id']}},_0x33c2ab={};_0x33c2ab[_0x9cbd('0x2d')]=_[_0x9cbd('0x2f')](db[_0x9cbd('0x29')][_0x9cbd('0x2a')]);_0x33c2ab['query']=_['keys'](_0x40d657[_0x9cbd('0x2e')]);_0x33c2ab['filters']=_[_0x9cbd('0x32')](_0x33c2ab['model'],_0x33c2ab['query']);_0x2b52c7[_0x9cbd('0x31')]=_[_0x9cbd('0x32')](_0x33c2ab[_0x9cbd('0x2d')],qs[_0x9cbd('0x33')](_0x40d657[_0x9cbd('0x2e')]['fields']));_0x2b52c7['attributes']=_0x2b52c7[_0x9cbd('0x31')][_0x9cbd('0x34')]?_0x2b52c7[_0x9cbd('0x31')]:_0x33c2ab['model'];if(_0x40d657[_0x9cbd('0x2e')][_0x9cbd('0x40')]){_0x2b52c7['include']=[{'all':!![]}];}_0x2b52c7=_[_0x9cbd('0x3b')]({},_0x2b52c7,_0x40d657[_0x9cbd('0x3f')]);return db[_0x9cbd('0x29')][_0x9cbd('0x47')](_0x2b52c7)[_0x9cbd('0x42')](handleEntityNotFound(_0x14be17,null))[_0x9cbd('0x42')](respondWithResult(_0x14be17,null))['catch'](handleError(_0x14be17,null));};exports[_0x9cbd('0x48')]=function(_0x564fae,_0x3e3467){return db[_0x9cbd('0x29')][_0x9cbd('0x48')](_0x564fae[_0x9cbd('0x49')],{})[_0x9cbd('0x42')](respondWithResult(_0x3e3467,0xc9))[_0x9cbd('0x44')](handleError(_0x3e3467,null));};exports['update']=function(_0x37b4d2,_0x20b02c){if(_0x37b4d2['body']['id']){delete _0x37b4d2[_0x9cbd('0x49')]['id'];}return db['VoiceQueuesLog'][_0x9cbd('0x47')]({'where':{'id':_0x37b4d2[_0x9cbd('0x46')]['id']}})[_0x9cbd('0x42')](handleEntityNotFound(_0x20b02c,null))[_0x9cbd('0x42')](saveUpdates(_0x37b4d2[_0x9cbd('0x49')],null))['then'](respondWithResult(_0x20b02c,null))[_0x9cbd('0x44')](handleError(_0x20b02c,null));};exports[_0x9cbd('0x23')]=function(_0xca1dfc,_0x560761){return db['VoiceQueuesLog']['find']({'where':{'id':_0xca1dfc['params']['id']}})[_0x9cbd('0x42')](handleEntityNotFound(_0x560761,null))[_0x9cbd('0x42')](removeEntity(_0x560761,null))[_0x9cbd('0x44')](handleError(_0x560761,null));}; \ No newline at end of file +var _0x47f7=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceQueuesLog','includeAll','include','findAll','rows','params','intersection','catch','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x47f7,0x64));var _0x747f=function(_0x57acdc,_0x464cef){_0x57acdc=_0x57acdc-0x0;var _0x35e651=_0x47f7[_0x57acdc];return _0x35e651;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x747f('0x0'));var zipdir=require(_0x747f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x747f('0x2'));var moment=require(_0x747f('0x3'));var BPromise=require(_0x747f('0x4'));var Mustache=require(_0x747f('0x5'));var util=require(_0x747f('0x6'));var path=require(_0x747f('0x7'));var sox=require(_0x747f('0x8'));var csv=require(_0x747f('0x9'));var ejs=require(_0x747f('0xa'));var fs=require('fs');var fs_extra=require(_0x747f('0xb'));var _=require(_0x747f('0xc'));var squel=require(_0x747f('0xd'));var crypto=require(_0x747f('0xe'));var jsforce=require(_0x747f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x747f('0x9'));var querystring=require(_0x747f('0x10'));var Papa=require(_0x747f('0x11'));var Redis=require(_0x747f('0x12'));var authService=require(_0x747f('0x13'));var qs=require(_0x747f('0x14'));var as=require(_0x747f('0x15'));var hardwareService=require(_0x747f('0x16'));var logger=require(_0x747f('0x17'))(_0x747f('0x18'));var utils=require('../../config/utils');var config=require(_0x747f('0x19'));var licenseUtil=require(_0x747f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218988,_0x2e97d1){_0x2e97d1=_0x2e97d1||0xcc;return function(_0x554be5){if(_0x554be5){return _0x218988[_0x747f('0x1b')](_0x2e97d1);}return _0x218988[_0x747f('0x1c')](_0x2e97d1)[_0x747f('0x1d')]();};}function respondWithResult(_0x3ddc87,_0x33955a){_0x33955a=_0x33955a||0xc8;return function(_0x1d4c82){if(_0x1d4c82){return _0x3ddc87[_0x747f('0x1c')](_0x33955a)[_0x747f('0x1e')](_0x1d4c82);}};}function respondWithFilteredResult(_0x4a0fab,_0x4cc339){return function(_0x5541e8){if(_0x5541e8){var _0xf0e65e=typeof _0x4cc339[_0x747f('0x1f')]===_0x747f('0x20')&&typeof _0x4cc339['limit']===_0x747f('0x20');var _0x1da7dc=_0x5541e8[_0x747f('0x21')];var _0x25ead9=_0xf0e65e?0x0:_0x4cc339[_0x747f('0x1f')];var _0x1f760a=_0xf0e65e?_0x5541e8[_0x747f('0x21')]:_0x4cc339['offset']+_0x4cc339[_0x747f('0x22')];var _0x4aac42;if(_0x1f760a>=_0x1da7dc){_0x1f760a=_0x1da7dc;_0x4aac42=0xc8;}else{_0x4aac42=0xce;}_0x4a0fab[_0x747f('0x1c')](_0x4aac42);return _0x4a0fab[_0x747f('0x23')](_0x747f('0x24'),_0x25ead9+'-'+_0x1f760a+'/'+_0x1da7dc)[_0x747f('0x1e')](_0x5541e8);}return null;};}function patchUpdates(_0x314661){return function(_0x2b908c){try{jsonpatch[_0x747f('0x25')](_0x2b908c,_0x314661,!![]);}catch(_0x4e8218){return BPromise[_0x747f('0x26')](_0x4e8218);}return _0x2b908c[_0x747f('0x27')]();};}function saveUpdates(_0x214845,_0x11d77b){return function(_0x20922e){if(_0x20922e){return _0x20922e[_0x747f('0x28')](_0x214845)[_0x747f('0x29')](function(_0x3e8a6a){return _0x3e8a6a;});}return null;};}function removeEntity(_0x19b549,_0x4818e7){return function(_0x455d47){if(_0x455d47){return _0x455d47[_0x747f('0x2a')]()[_0x747f('0x29')](function(){_0x19b549['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2618eb,_0x71a748){return function(_0x36360b){if(!_0x36360b){_0x2618eb[_0x747f('0x1b')](0x194);}return _0x36360b;};}function handleError(_0x55edf5,_0x693d24){_0x693d24=_0x693d24||0x1f4;return function(_0x266d31){logger[_0x747f('0x2b')](_0x266d31[_0x747f('0x2c')]);if(_0x266d31[_0x747f('0x2d')]){delete _0x266d31[_0x747f('0x2d')];}_0x55edf5[_0x747f('0x1c')](_0x693d24)[_0x747f('0x2e')](_0x266d31);};}exports[_0x747f('0x2f')]=function(_0x1d76e0,_0x447c65){var _0x123a5f={},_0x3f72ce={},_0x444a89={'count':0x0,'rows':[]};var _0x402b93=_[_0x747f('0x30')](db['VoiceQueuesLog'][_0x747f('0x31')],function(_0x244b3a){return{'name':_0x244b3a[_0x747f('0x32')],'type':_0x244b3a[_0x747f('0x33')]['key']};});_0x3f72ce[_0x747f('0x34')]=_[_0x747f('0x30')](_0x402b93,'name');_0x3f72ce[_0x747f('0x35')]=_[_0x747f('0x36')](_0x1d76e0[_0x747f('0x35')]);_0x3f72ce[_0x747f('0x37')]=_['intersection'](_0x3f72ce[_0x747f('0x34')],_0x3f72ce[_0x747f('0x35')]);_0x123a5f[_0x747f('0x38')]=_['intersection'](_0x3f72ce[_0x747f('0x34')],qs['fields'](_0x1d76e0[_0x747f('0x35')][_0x747f('0x39')]));_0x123a5f[_0x747f('0x38')]=_0x123a5f[_0x747f('0x38')][_0x747f('0x3a')]?_0x123a5f['attributes']:_0x3f72ce[_0x747f('0x34')];if(!_0x1d76e0['query'][_0x747f('0x3b')](_0x747f('0x3c'))){_0x123a5f[_0x747f('0x22')]=qs[_0x747f('0x22')](_0x1d76e0[_0x747f('0x35')][_0x747f('0x22')]);_0x123a5f['offset']=qs[_0x747f('0x1f')](_0x1d76e0['query'][_0x747f('0x1f')]);}_0x123a5f[_0x747f('0x3d')]=qs['sort'](_0x1d76e0[_0x747f('0x35')][_0x747f('0x3e')]);_0x123a5f[_0x747f('0x3f')]=qs[_0x747f('0x37')](_['pick'](_0x1d76e0[_0x747f('0x35')],_0x3f72ce[_0x747f('0x37')]),_0x402b93);if(_0x1d76e0[_0x747f('0x35')][_0x747f('0x40')]){_0x123a5f[_0x747f('0x3f')]=_[_0x747f('0x41')](_0x123a5f[_0x747f('0x3f')],{'$or':_[_0x747f('0x30')](_0x402b93,function(_0x21b7f2){if(_0x21b7f2[_0x747f('0x33')]!==_0x747f('0x42')){var _0x2273ef={};_0x2273ef[_0x21b7f2[_0x747f('0x2d')]]={'$like':'%'+_0x1d76e0[_0x747f('0x35')]['filter']+'%'};return _0x2273ef;}})});}_0x123a5f=_[_0x747f('0x41')]({},_0x123a5f,_0x1d76e0['options']);var _0x209958={'where':_0x123a5f[_0x747f('0x3f')]};return db[_0x747f('0x43')][_0x747f('0x21')](_0x209958)['then'](function(_0x372a0f){_0x444a89['count']=_0x372a0f;if(_0x1d76e0[_0x747f('0x35')][_0x747f('0x44')]){_0x123a5f[_0x747f('0x45')]=[{'all':!![]}];}return db[_0x747f('0x43')][_0x747f('0x46')](_0x123a5f);})[_0x747f('0x29')](function(_0x319835){_0x444a89[_0x747f('0x47')]=_0x319835;return _0x444a89;})[_0x747f('0x29')](respondWithFilteredResult(_0x447c65,_0x123a5f))['catch'](handleError(_0x447c65,null));};exports['show']=function(_0x22142f,_0x421091){var _0x1b8e3d={'raw':!![],'where':{'id':_0x22142f[_0x747f('0x48')]['id']}},_0x2f1d3d={};_0x2f1d3d['model']=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x2f1d3d[_0x747f('0x35')]=_['keys'](_0x22142f[_0x747f('0x35')]);_0x2f1d3d[_0x747f('0x37')]=_[_0x747f('0x49')](_0x2f1d3d['model'],_0x2f1d3d[_0x747f('0x35')]);_0x1b8e3d[_0x747f('0x38')]=_[_0x747f('0x49')](_0x2f1d3d['model'],qs[_0x747f('0x39')](_0x22142f['query'][_0x747f('0x39')]));_0x1b8e3d[_0x747f('0x38')]=_0x1b8e3d[_0x747f('0x38')][_0x747f('0x3a')]?_0x1b8e3d['attributes']:_0x2f1d3d['model'];if(_0x22142f[_0x747f('0x35')]['includeAll']){_0x1b8e3d[_0x747f('0x45')]=[{'all':!![]}];}_0x1b8e3d=_[_0x747f('0x41')]({},_0x1b8e3d,_0x22142f['options']);return db[_0x747f('0x43')]['find'](_0x1b8e3d)[_0x747f('0x29')](handleEntityNotFound(_0x421091,null))['then'](respondWithResult(_0x421091,null))[_0x747f('0x4a')](handleError(_0x421091,null));};exports[_0x747f('0x4b')]=function(_0x1a45a0,_0x2386c6){return db['VoiceQueuesLog'][_0x747f('0x4b')](_0x1a45a0[_0x747f('0x4c')],{})[_0x747f('0x29')](respondWithResult(_0x2386c6,0xc9))[_0x747f('0x4a')](handleError(_0x2386c6,null));};exports['update']=function(_0x2fca53,_0x1bbe6c){if(_0x2fca53[_0x747f('0x4c')]['id']){delete _0x2fca53['body']['id'];}return db['VoiceQueuesLog'][_0x747f('0x4d')]({'where':{'id':_0x2fca53['params']['id']}})['then'](handleEntityNotFound(_0x1bbe6c,null))['then'](saveUpdates(_0x2fca53[_0x747f('0x4c')],null))['then'](respondWithResult(_0x1bbe6c,null))[_0x747f('0x4a')](handleError(_0x1bbe6c,null));};exports[_0x747f('0x2a')]=function(_0x5708a5,_0x41c6c8){return db['VoiceQueuesLog']['find']({'where':{'id':_0x5708a5[_0x747f('0x48')]['id']}})[_0x747f('0x29')](handleEntityNotFound(_0x41c6c8,null))[_0x747f('0x29')](removeEntity(_0x41c6c8,null))['catch'](handleError(_0x41c6c8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 324d66f..85d191a 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 _0x6822=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','moment'];(function(_0x239869,_0x4ec877){var _0x7577be=function(_0x47359a){while(--_0x47359a){_0x239869['push'](_0x239869['shift']());}};_0x7577be(++_0x4ec877);}(_0x6822,0x18c));var _0x2682=function(_0x53b5f9,_0x379962){_0x53b5f9=_0x53b5f9-0x0;var _0x180a6f=_0x6822[_0x53b5f9];return _0x180a6f;};'use strict';var _=require('lodash');var util=require(_0x2682('0x0'));var logger=require(_0x2682('0x1'))(_0x2682('0x2'));var moment=require(_0x2682('0x3'));var BPromise=require('bluebird');var rp=require(_0x2682('0x4'));var fs=require('fs');var path=require(_0x2682('0x5'));var rimraf=require(_0x2682('0x6'));var config=require(_0x2682('0x7'));var attributes=require(_0x2682('0x8'));module[_0x2682('0x9')]=function(_0x15040a,_0x24978b){return _0x15040a[_0x2682('0xa')](_0x2682('0xb'),attributes,{'tableName':_0x2682('0xc'),'paranoid':![],'indexes':[{'name':_0x2682('0xd'),'fields':[_0x2682('0xe'),_0x2682('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x31f0=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','api','bluebird'];(function(_0x3348fa,_0x34da83){var _0x337371=function(_0x2ac6bf){while(--_0x2ac6bf){_0x3348fa['push'](_0x3348fa['shift']());}};_0x337371(++_0x34da83);}(_0x31f0,0x1a0));var _0x031f=function(_0x2f9266,_0x313534){_0x2f9266=_0x2f9266-0x0;var _0x45eb50=_0x31f0[_0x2f9266];return _0x45eb50;};'use strict';var _=require(_0x031f('0x0'));var util=require(_0x031f('0x1'));var logger=require('../../config/logger')(_0x031f('0x2'));var moment=require('moment');var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require(_0x031f('0x6'));var config=require(_0x031f('0x7'));var attributes=require(_0x031f('0x8'));module[_0x031f('0x9')]=function(_0x55d868,_0xc1756a){return _0x55d868[_0x031f('0xa')](_0x031f('0xb'),attributes,{'tableName':_0x031f('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x031f('0xd'),_0x031f('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 1f0fed4..f0a3c5f 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 _0x1e1a=['rpc','../../config/environment','jayson/promise','http','request','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1372ae,_0x25e4d0){var _0x490f46=function(_0xe65f40){while(--_0xe65f40){_0x1372ae['push'](_0x1372ae['shift']());}};_0x490f46(++_0x25e4d0);}(_0x1e1a,0x175));var _0xa1e1=function(_0x18aca1,_0x27937d){_0x18aca1=_0x18aca1-0x0;var _0x571c90=_0x1e1a[_0x18aca1];return _0x571c90;};'use strict';var _=require('lodash');var util=require(_0xa1e1('0x0'));var moment=require(_0xa1e1('0x1'));var BPromise=require(_0xa1e1('0x2'));var rs=require(_0xa1e1('0x3'));var fs=require('fs');var Redis=require(_0xa1e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1e1('0x5'));var logger=require(_0xa1e1('0x6'))(_0xa1e1('0x7'));var config=require(_0xa1e1('0x8'));var jayson=require(_0xa1e1('0x9'));var client=jayson['client'][_0xa1e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc7f20,_0x144740,_0x546bbc){return new BPromise(function(_0x3f3b97,_0x220472){return client[_0xa1e1('0xb')](_0xc7f20,_0x546bbc)['then'](function(_0x1d5e11){logger['info'](_0xa1e1('0xc'),_0x144740,'request\x20sent');logger[_0xa1e1('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x144740,_0xa1e1('0xe'),JSON[_0xa1e1('0xf')](_0x1d5e11));if(_0x1d5e11[_0xa1e1('0x10')]){if(_0x1d5e11['error'][_0xa1e1('0x11')]===0x1f4){logger[_0xa1e1('0x10')](_0xa1e1('0xc'),_0x144740,_0x1d5e11['error'][_0xa1e1('0x12')]);return _0x220472(_0x1d5e11[_0xa1e1('0x10')][_0xa1e1('0x12')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x144740,_0x1d5e11[_0xa1e1('0x10')]['message']);return _0x3f3b97(_0x1d5e11[_0xa1e1('0x10')]['message']);}else{logger[_0xa1e1('0x13')](_0xa1e1('0xc'),_0x144740,'request\x20sent');_0x3f3b97(_0x1d5e11['result'][_0xa1e1('0x12')]);}})['catch'](function(_0x1cc832){logger['error'](_0xa1e1('0xc'),_0x144740,_0x1cc832);_0x220472(_0x1cc832);});});} \ No newline at end of file +var _0xd9b9=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0xd9b9,0x111));var _0x9d9b=function(_0x94780a,_0x3ae667){_0x94780a=_0x94780a-0x0;var _0x2eddb4=_0xd9b9[_0x94780a];return _0x2eddb4;};'use strict';var _=require('lodash');var util=require(_0x9d9b('0x0'));var moment=require(_0x9d9b('0x1'));var BPromise=require(_0x9d9b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d9b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d9b('0x4'))(_0x9d9b('0x5'));var config=require(_0x9d9b('0x6'));var jayson=require(_0x9d9b('0x7'));var client=jayson[_0x9d9b('0x8')][_0x9d9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32d1a6,_0x52e268,_0x538957){return new BPromise(function(_0x51c53f,_0x1d89a3){return client[_0x9d9b('0xa')](_0x32d1a6,_0x538957)[_0x9d9b('0xb')](function(_0xf2eab8){logger[_0x9d9b('0xc')](_0x9d9b('0xd'),_0x52e268,_0x9d9b('0xe'));logger['debug'](_0x9d9b('0xf'),_0x52e268,_0x9d9b('0xe'),JSON[_0x9d9b('0x10')](_0xf2eab8));if(_0xf2eab8[_0x9d9b('0x11')]){if(_0xf2eab8['error'][_0x9d9b('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x52e268,_0xf2eab8['error'][_0x9d9b('0x13')]);return _0x1d89a3(_0xf2eab8['error'][_0x9d9b('0x13')]);}logger[_0x9d9b('0x11')](_0x9d9b('0xd'),_0x52e268,_0xf2eab8['error'][_0x9d9b('0x13')]);return _0x51c53f(_0xf2eab8[_0x9d9b('0x11')][_0x9d9b('0x13')]);}else{logger[_0x9d9b('0xc')](_0x9d9b('0xd'),_0x52e268,_0x9d9b('0xe'));_0x51c53f(_0xf2eab8[_0x9d9b('0x14')]['message']);}})[_0x9d9b('0x15')](function(_0x424ad5){logger[_0x9d9b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x52e268,_0x424ad5);_0x1d89a3(_0x424ad5);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2964112..415080c 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 _0x1f36=['download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x74547d,_0x5ca07d){var _0x136571=function(_0x48cfb8){while(--_0x48cfb8){_0x74547d['push'](_0x74547d['shift']());}};_0x136571(++_0x5ca07d);}(_0x1f36,0x98));var _0x61f3=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0x1f36[_0x42d2af];return _0x1d6d63;};'use strict';var multer=require('multer');var util=require(_0x61f3('0x0'));var path=require(_0x61f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x61f3('0x2'));var router=express[_0x61f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x61f3('0x4'));var interaction=require(_0x61f3('0x5'));var config=require(_0x61f3('0x6'));var controller=require(_0x61f3('0x7'));router[_0x61f3('0x8')]('/',auth[_0x61f3('0x9')](),controller[_0x61f3('0xa')]);router[_0x61f3('0x8')](_0x61f3('0xb'),auth['isAuthenticated'](),controller[_0x61f3('0xc')]);router['get'](_0x61f3('0xd'),auth[_0x61f3('0x9')](),controller[_0x61f3('0xe')]);router[_0x61f3('0x8')](_0x61f3('0xf'),auth[_0x61f3('0x9')](),controller[_0x61f3('0x10')]);router[_0x61f3('0x8')](_0x61f3('0x11'),controller[_0x61f3('0x12')]);router[_0x61f3('0x8')](_0x61f3('0x13'),auth[_0x61f3('0x9')](),controller[_0x61f3('0x14')]);router['post']('/',auth[_0x61f3('0x9')](),controller[_0x61f3('0x15')]);router[_0x61f3('0x16')](_0x61f3('0x13'),auth[_0x61f3('0x9')](),controller[_0x61f3('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x61f3('0x18')]);router[_0x61f3('0x19')](_0x61f3('0xd'),auth['isAuthenticated'](),controller[_0x61f3('0x1a')]);module[_0x61f3('0x1b')]=router; \ No newline at end of file +var _0x6c95=['/:id/download','download','/:id/transcribe','downloadTranscribe','post','runTranscribe','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6c95,0x1d5));var _0x56c9=function(_0x5d7211,_0x3dd8e5){_0x5d7211=_0x5d7211-0x0;var _0x106a28=_0x6c95[_0x5d7211];return _0x106a28;};'use strict';var multer=require('multer');var util=require(_0x56c9('0x0'));var path=require('path');var timeout=require(_0x56c9('0x1'));var express=require(_0x56c9('0x2'));var router=express[_0x56c9('0x3')]();var fs_extra=require(_0x56c9('0x4'));var auth=require(_0x56c9('0x5'));var interaction=require(_0x56c9('0x6'));var config=require(_0x56c9('0x7'));var controller=require('./voiceRecording.controller');router[_0x56c9('0x8')]('/',auth[_0x56c9('0x9')](),controller[_0x56c9('0xa')]);router[_0x56c9('0x8')]('/describe',auth[_0x56c9('0x9')](),controller[_0x56c9('0xb')]);router[_0x56c9('0x8')](_0x56c9('0xc'),auth[_0x56c9('0x9')](),controller[_0x56c9('0xd')]);router['get'](_0x56c9('0xe'),auth[_0x56c9('0x9')](),controller[_0x56c9('0xf')]);router[_0x56c9('0x8')]('/:id/downloads',controller['downloads']);router[_0x56c9('0x8')](_0x56c9('0x10'),auth[_0x56c9('0x9')](),controller[_0x56c9('0x11')]);router[_0x56c9('0x12')]('/',auth[_0x56c9('0x9')](),controller['create']);router[_0x56c9('0x12')](_0x56c9('0x10'),auth[_0x56c9('0x9')](),controller[_0x56c9('0x13')]);router['put'](_0x56c9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x56c9('0x14')](_0x56c9('0xc'),auth[_0x56c9('0x9')](),controller[_0x56c9('0x15')]);module[_0x56c9('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ca567a6..551e14e 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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 6153a8e..4e6e26a 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 _0x96b9=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','VoiceRecording','include','findAll','rows','catch','show','find','create','body','params','describe','../../components/encryptor','uniqueid','value','existsSync','secrets','recording','Sequelize','filename','download','extname','unlink','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','col','$and','push','decryptFile','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','sentiment','sentimentAccountId','sentimentRegion','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','transcribeStatus','IN_PROGRESS','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','rimraf','request-promise','moment'];(function(_0x41b750,_0x3dc138){var _0x343a11=function(_0x512332){while(--_0x512332){_0x41b750['push'](_0x41b750['shift']());}};_0x343a11(++_0x3dc138);}(_0x96b9,0x123));var _0x996b=function(_0x160d00,_0x2be0fc){_0x160d00=_0x160d00-0x0;var _0xb736e7=_0x96b9[_0x160d00];return _0xb736e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x996b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x996b('0x1'));var moment=require(_0x996b('0x2'));var BPromise=require(_0x996b('0x3'));var Mustache=require('mustache');var util=require(_0x996b('0x4'));var path=require('path');var sox=require(_0x996b('0x5'));var csv=require(_0x996b('0x6'));var ejs=require(_0x996b('0x7'));var fs=require('fs');var fs_extra=require(_0x996b('0x8'));var _=require(_0x996b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x996b('0xa'));var deskjs=require(_0x996b('0xb'));var toCsv=require(_0x996b('0x6'));var querystring=require(_0x996b('0xc'));var Papa=require('papaparse');var AWS=require(_0x996b('0xd'));var uuidv4=require(_0x996b('0xe'));var Redis=require(_0x996b('0xf'));var authService=require(_0x996b('0x10'));var qs=require(_0x996b('0x11'));var as=require(_0x996b('0x12'));var hardwareService=require(_0x996b('0x13'));var logger=require(_0x996b('0x14'))(_0x996b('0x15'));var utils=require(_0x996b('0x16'));var config=require(_0x996b('0x17'));var licenseUtil=require(_0x996b('0x18'));var db=require(_0x996b('0x19'))['db'];function respondWithStatusCode(_0x2f53ab,_0x4f4e89){_0x4f4e89=_0x4f4e89||0xcc;return function(_0x12c7d3){if(_0x12c7d3){return _0x2f53ab[_0x996b('0x1a')](_0x4f4e89);}return _0x2f53ab['status'](_0x4f4e89)[_0x996b('0x1b')]();};}function respondWithResult(_0x2166f7,_0x1f91f7){_0x1f91f7=_0x1f91f7||0xc8;return function(_0x4234f1){if(_0x4234f1){return _0x2166f7[_0x996b('0x1c')](_0x1f91f7)['json'](_0x4234f1);}};}function respondWithFilteredResult(_0x1951c9,_0x264fa5){return function(_0x114db5){if(_0x114db5){var _0x57d8ea=typeof _0x264fa5[_0x996b('0x1d')]===_0x996b('0x1e')&&typeof _0x264fa5[_0x996b('0x1f')]==='undefined';var _0x31b00e=_0x114db5[_0x996b('0x20')];var _0x33e036=_0x57d8ea?0x0:_0x264fa5[_0x996b('0x1d')];var _0x453259=_0x57d8ea?_0x114db5[_0x996b('0x20')]:_0x264fa5[_0x996b('0x1d')]+_0x264fa5[_0x996b('0x1f')];var _0xc11650;if(_0x453259>=_0x31b00e){_0x453259=_0x31b00e;_0xc11650=0xc8;}else{_0xc11650=0xce;}_0x1951c9[_0x996b('0x1c')](_0xc11650);return _0x1951c9[_0x996b('0x21')]('Content-Range',_0x33e036+'-'+_0x453259+'/'+_0x31b00e)['json'](_0x114db5);}return null;};}function patchUpdates(_0x245b12){return function(_0x151607){try{jsonpatch[_0x996b('0x22')](_0x151607,_0x245b12,!![]);}catch(_0x2c0206){return BPromise[_0x996b('0x23')](_0x2c0206);}return _0x151607['save']();};}function saveUpdates(_0x365b9c,_0x26c3c5){return function(_0x14234e){if(_0x14234e){return _0x14234e[_0x996b('0x24')](_0x365b9c)['then'](function(_0x100f45){return _0x100f45;});}return null;};}function removeEntity(_0x415e84,_0x2d2955){return function(_0x54dc38){if(_0x54dc38){return _0x54dc38[_0x996b('0x25')]()[_0x996b('0x26')](function(){_0x415e84[_0x996b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a384,_0x558d02){return function(_0x2f51f1){if(!_0x2f51f1){_0x38a384[_0x996b('0x1a')](0x194);}return _0x2f51f1;};}function handleError(_0x1bacb7,_0x1e1118){_0x1e1118=_0x1e1118||0x1f4;return function(_0x114045){logger[_0x996b('0x27')](_0x114045[_0x996b('0x28')]);if(_0x114045[_0x996b('0x29')]){delete _0x114045[_0x996b('0x29')];}_0x1bacb7[_0x996b('0x1c')](_0x1e1118)[_0x996b('0x2a')](_0x114045);};}exports[_0x996b('0x2b')]=function(_0x41df40,_0x9ea4ba){var _0x57ab44={},_0x518fb0={},_0x3c9cdb={'count':0x0,'rows':[]};var _0x45aed3=_['map'](db['VoiceRecording'][_0x996b('0x2c')],function(_0x2bb5fc){return{'name':_0x2bb5fc[_0x996b('0x2d')],'type':_0x2bb5fc[_0x996b('0x2e')]['key']};});_0x518fb0[_0x996b('0x2f')]=_[_0x996b('0x30')](_['map'](_0x45aed3,'name'),[_0x996b('0x31')]);_0x518fb0[_0x996b('0x32')]=_[_0x996b('0x33')](_0x41df40['query']);_0x518fb0['filters']=_[_0x996b('0x34')](_0x518fb0['model'],_0x518fb0[_0x996b('0x32')]);_0x57ab44[_0x996b('0x35')]=_['intersection'](_0x518fb0['model'],qs[_0x996b('0x36')](_0x41df40['query'][_0x996b('0x36')]));_0x57ab44[_0x996b('0x35')]=_0x57ab44[_0x996b('0x35')][_0x996b('0x37')]?_0x57ab44[_0x996b('0x35')]:_0x518fb0[_0x996b('0x2f')];if(!_0x41df40['query'][_0x996b('0x38')](_0x996b('0x39'))){_0x57ab44[_0x996b('0x1f')]=qs['limit'](_0x41df40[_0x996b('0x32')][_0x996b('0x1f')]);_0x57ab44['offset']=qs[_0x996b('0x1d')](_0x41df40[_0x996b('0x32')][_0x996b('0x1d')]);}_0x57ab44[_0x996b('0x3a')]=qs[_0x996b('0x3b')](_0x41df40[_0x996b('0x32')][_0x996b('0x3b')]);_0x57ab44['where']=qs[_0x996b('0x3c')](_[_0x996b('0x3d')](_0x41df40[_0x996b('0x32')],_0x518fb0[_0x996b('0x3c')]),_0x45aed3);if(_0x41df40[_0x996b('0x32')][_0x996b('0x3e')]){_0x57ab44[_0x996b('0x3f')]=_[_0x996b('0x40')](_0x57ab44[_0x996b('0x3f')],{'$or':_['map'](_0x45aed3,function(_0x186c76){if(_0x186c76['type']!=='VIRTUAL'){var _0x1bd4c8={};_0x1bd4c8[_0x186c76[_0x996b('0x29')]]={'$like':'%'+_0x41df40[_0x996b('0x32')][_0x996b('0x3e')]+'%'};return _0x1bd4c8;}})});}_0x57ab44=_[_0x996b('0x40')]({},_0x57ab44,_0x41df40[_0x996b('0x41')]);var _0x358739={'where':_0x57ab44[_0x996b('0x3f')]};return db[_0x996b('0x42')][_0x996b('0x20')](_0x358739)[_0x996b('0x26')](function(_0x2c3837){_0x3c9cdb[_0x996b('0x20')]=_0x2c3837;if(_0x41df40[_0x996b('0x32')]['includeAll']){_0x57ab44[_0x996b('0x43')]=[{'all':!![]}];}return db[_0x996b('0x42')][_0x996b('0x44')](_0x57ab44);})[_0x996b('0x26')](function(_0x25d3f4){_0x3c9cdb[_0x996b('0x45')]=_0x25d3f4;return _0x3c9cdb;})['then'](respondWithFilteredResult(_0x9ea4ba,_0x57ab44))[_0x996b('0x46')](handleError(_0x9ea4ba,null));};exports[_0x996b('0x47')]=function(_0x2e965c,_0x30cf60){var _0xd174a2={'raw':![],'where':{'id':_0x2e965c['params']['id']}},_0x456994={};_0x456994[_0x996b('0x2f')]=_[_0x996b('0x33')](db[_0x996b('0x42')][_0x996b('0x2c')]);_0x456994[_0x996b('0x32')]=_['keys'](_0x2e965c[_0x996b('0x32')]);_0x456994[_0x996b('0x3c')]=_[_0x996b('0x34')](_0x456994[_0x996b('0x2f')],_0x456994[_0x996b('0x32')]);_0xd174a2[_0x996b('0x35')]=_['intersection'](_0x456994[_0x996b('0x2f')],qs['fields'](_0x2e965c[_0x996b('0x32')][_0x996b('0x36')]));_0xd174a2[_0x996b('0x35')]=_0xd174a2[_0x996b('0x35')][_0x996b('0x37')]?_0xd174a2[_0x996b('0x35')]:_0x456994['model'];if(_0x2e965c['query']['includeAll']){_0xd174a2[_0x996b('0x43')]=[{'all':!![]}];}_0xd174a2=_[_0x996b('0x40')]({},_0xd174a2,_0x2e965c[_0x996b('0x41')]);return db[_0x996b('0x42')][_0x996b('0x48')](_0xd174a2)['then'](handleEntityNotFound(_0x30cf60,null))[_0x996b('0x26')](respondWithResult(_0x30cf60,null))['catch'](handleError(_0x30cf60,null));};exports[_0x996b('0x49')]=function(_0x335065,_0x3a089c){return db[_0x996b('0x42')][_0x996b('0x49')](_0x335065['body'],{})[_0x996b('0x26')](respondWithResult(_0x3a089c,0xc9))['catch'](handleError(_0x3a089c,null));};exports[_0x996b('0x24')]=function(_0x5f31b5,_0x166527){if(_0x5f31b5[_0x996b('0x4a')]['id']){delete _0x5f31b5['body']['id'];}return db[_0x996b('0x42')][_0x996b('0x48')]({'where':{'id':_0x5f31b5[_0x996b('0x4b')]['id']}})[_0x996b('0x26')](handleEntityNotFound(_0x166527,null))[_0x996b('0x26')](saveUpdates(_0x5f31b5['body'],null))[_0x996b('0x26')](respondWithResult(_0x166527,null))['catch'](handleError(_0x166527,null));};exports[_0x996b('0x4c')]=function(_0x357168,_0x2e2859){return db['VoiceRecording'][_0x996b('0x4c')]()[_0x996b('0x26')](respondWithResult(_0x2e2859,null))[_0x996b('0x46')](handleError(_0x2e2859,null));};exports['download']=function(_0x288a73,_0x37e8e6,_0x28b417){var _0xd6c36=require(_0x996b('0x4d'));var _0xf36212=![];var _0x23bb3b={};if(_0x288a73[_0x996b('0x32')][_0x996b('0x2e')]&&_0x288a73[_0x996b('0x32')][_0x996b('0x2e')]===_0x996b('0x4e')){_0x23bb3b[_0x996b('0x4e')]=_0x288a73[_0x996b('0x4b')]['id'];}else{_0x23bb3b['id']=_0x288a73[_0x996b('0x4b')]['id'];}return db['VoiceRecording'][_0x996b('0x48')]({'where':_0x23bb3b,'attributes':['id',_0x996b('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x37e8e6,null))[_0x996b('0x26')](function(_0x534bf5){if(_0x534bf5){var _0x56ea53=_0x534bf5['value'];var _0x4804f7=util['format']('%s.cypher',_0x56ea53);if(fs[_0x996b('0x50')](_0x4804f7)){_0xf36212=!![];return _0xd6c36['decryptFile'](_0x4804f7,_0x56ea53,config[_0x996b('0x51')][_0x996b('0x52')])[_0x996b('0x26')](function(){return _0x534bf5;});}return _0x534bf5;}})[_0x996b('0x26')](function(_0x2f481c){if(_0x2f481c){var _0x578288=_0x2f481c[_0x996b('0x4f')];if(!fs[_0x996b('0x50')](_0x578288)){throw new db[(_0x996b('0x53'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x2f481c[_0x996b('0x54')]){return _0x37e8e6[_0x996b('0x55')](_0x578288,_0x2f481c[_0x996b('0x54')]+path[_0x996b('0x56')](_0x578288),function(){if(_0xf36212){fs[_0x996b('0x57')](_0x578288);}});}else{return _0x37e8e6[_0x996b('0x55')](_0x578288,function(_0x308f7b){if(_0xf36212){fs['unlink'](_0x578288);}});}}})[_0x996b('0x46')](function(_0x54d642){if(_0x54d642['message']===_0x996b('0x58')){_0x37e8e6[_0x996b('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x37e8e6,null);}});};exports[_0x996b('0x59')]=function(_0x171980,_0x290b2f,_0x47b60a){var _0x1f9669=require('../../components/encryptor');var _0x175b78=![];var _0x246ca4={'$and':[db[_0x996b('0x5a')][_0x996b('0x3f')](db[_0x996b('0x5a')]['fn'](_0x996b('0x5b'),db[_0x996b('0x5a')][_0x996b('0x5c')](_0x996b('0x4e'))),_0x171980[_0x996b('0x32')]['token'])]};if(_0x171980[_0x996b('0x32')]['type']&&_0x171980['query']['type']===_0x996b('0x4e')){_0x246ca4[_0x996b('0x5d')][_0x996b('0x5e')]({'uniqueid':_0x171980[_0x996b('0x4b')]['id']});}else{_0x246ca4['$and'][_0x996b('0x5e')]({'id':_0x171980[_0x996b('0x4b')]['id']});}return db['VoiceRecording'][_0x996b('0x48')]({'where':_0x246ca4,'attributes':['id','value'],'raw':!![]})[_0x996b('0x26')](handleEntityNotFound(_0x290b2f,null))[_0x996b('0x26')](function(_0x424d39){if(_0x424d39){var _0x288b34=util[_0x996b('0x31')]('%s.cypher',_0x424d39[_0x996b('0x4f')]);if(fs[_0x996b('0x50')](_0x288b34)){_0x175b78=!![];return _0x1f9669[_0x996b('0x5f')](_0x288b34,_0x424d39[_0x996b('0x4f')],config[_0x996b('0x51')]['recording'])['then'](function(){return _0x424d39;});}return _0x424d39;}})[_0x996b('0x26')](function(_0x4ebfec){if(_0x4ebfec){if(!fs[_0x996b('0x50')](_0x4ebfec['value'])){throw new db[(_0x996b('0x53'))][(_0x996b('0x60'))](_0x996b('0x58'));}if(_0x4ebfec[_0x996b('0x54')]){return _0x290b2f[_0x996b('0x55')](_0x4ebfec[_0x996b('0x4f')],_0x4ebfec['filename']+path[_0x996b('0x56')](_0x4ebfec[_0x996b('0x4f')]),function(){if(_0x175b78){fs[_0x996b('0x57')](_0x4ebfec['value']);}});}else{return _0x290b2f['download'](_0x4ebfec[_0x996b('0x4f')],function(_0x33fe62){if(_0x175b78){fs[_0x996b('0x57')](_0x4ebfec['value']);}});}}})[_0x996b('0x46')](handleError(_0x290b2f,null));};exports[_0x996b('0x25')]=function(_0x3c88f2,_0x34b87b){return db[_0x996b('0x42')][_0x996b('0x48')]({'where':{'id':_0x3c88f2[_0x996b('0x4b')]['id']}})['then'](function(_0x386963){if(_[_0x996b('0x61')](_0x386963)){throw new ReferenceError('Entity\x20not\x20found');}return _0x386963;})[_0x996b('0x26')](function(_0x20ffdc){var _0x2ccd0c=_0x20ffdc[_0x996b('0x4f')];logger[_0x996b('0x62')](_0x996b('0x63'),_0x2ccd0c);if(!_[_0x996b('0x61')](_0x20ffdc[_0x996b('0x4f')])&&fs[_0x996b('0x50')](_0x2ccd0c)){logger['info']('File:\x20\x22'+_0x2ccd0c+_0x996b('0x64'));fs[_0x996b('0x65')](_0x2ccd0c);}_0x2ccd0c=_0x2ccd0c+_0x996b('0x66');if(!_[_0x996b('0x61')](_0x20ffdc[_0x996b('0x4f')])&&fs[_0x996b('0x50')](_0x2ccd0c)){logger[_0x996b('0x62')](_0x996b('0x67')+_0x2ccd0c+_0x996b('0x64'));fs[_0x996b('0x65')](_0x2ccd0c);}return _0x20ffdc;})[_0x996b('0x26')](function(_0x18147a){if(!_0x18147a)throw new InternalError();return _0x18147a['destroy']();})[_0x996b('0x26')](function(){_0x34b87b[_0x996b('0x1c')](0xcc)['end']();})['catch'](handleError(_0x34b87b,null));};function getBucketslist(_0x5517b6,_0x4bc18d,_0x21ecf5){return new Promise(function(_0x4b071d,_0x163d51){var _0x295327=new AWS['S3']({'accessKeyId':_0x4bc18d,'secretAccessKey':_0x5517b6,'region':_0x21ecf5});_0x295327[_0x996b('0x68')]({},function(_0x1e0136,_0x4f4336){if(_0x1e0136){return _0x163d51(_0x1e0136);}else{return _0x4b071d(_0x4f4336);}});});}function createBucket(_0x45d25c,_0x319ea7,_0x49e038,_0x24ddcc){return new Promise(function(_0x5a87fe,_0x3bf6c8){var _0x3c1655=new AWS['S3']({'accessKeyId':_0x319ea7,'secretAccessKey':_0x45d25c,'region':_0x49e038});_0x3c1655[_0x996b('0x69')]({'Bucket':_0x24ddcc},function(_0x17f271,_0x298cbf){if(_0x17f271){return _0x3bf6c8(_0x17f271);}else{return _0x5a87fe(_0x298cbf);}});});}function uploadFile(_0x1c0e64,_0x2237c1,_0x574bd6,_0x17cb29,_0x5c543f,_0x5b03be){return new Promise(function(_0x336258,_0x36ad3f){var _0x4de3e2=new AWS['S3']({'accessKeyId':_0x2237c1,'secretAccessKey':_0x1c0e64,'region':_0x574bd6});_0x4de3e2[_0x996b('0x6a')]({'Bucket':_0x17cb29,'Key':_0x5c543f,'Body':_0x5b03be},function(_0x995f90,_0x180a2a){if(_0x995f90){return _0x36ad3f(_0x995f90);}else{return _0x336258(_0x180a2a);}});});}function startTranscribe(_0x259ba7,_0x3e91e0,_0x4eeb2b,_0xbe0f58,_0x4cb0a8,_0x55b90f){return new Promise(function(_0x2234a3,_0x525e66){var _0x10dcc6=new AWS['TranscribeService']({'accessKeyId':_0x3e91e0,'secretAccessKey':_0x259ba7,'region':_0x4eeb2b});_0x10dcc6['startTranscriptionJob']({'TranscriptionJobName':_0xbe0f58,'LanguageCode':_0x4cb0a8,'Media':{'MediaFileUri':_0x55b90f}},function(_0x847e4c,_0x315ea0){if(_0x847e4c){return _0x525e66(_0x847e4c);}else{return _0x2234a3(_0x315ea0);}});});}function transcribe(_0x41ac2a,_0x3040be,_0x50b0be,_0x125c80,_0x2f8254,_0x33826d,_0x29a524){return new Promise(function(_0x226cdc,_0x506c5d){var _0x24e3f3={};logger[_0x996b('0x62')](util['format'](_0x996b('0x6b'),_0x41ac2a,_0x2f8254));return uploadFile(_0x3040be,_0x50b0be,_0x125c80,_0x2f8254,path[_0x996b('0x6c')](_0x33826d),fs['readFileSync'](_0x33826d))[_0x996b('0x26')](function(_0x29aea7){logger[_0x996b('0x62')](util[_0x996b('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x41ac2a,_0x2f8254,_0x29aea7[_0x996b('0x6d')]));_0x24e3f3[_0x996b('0x6e')]=_0x29aea7['Bucket'];_0x24e3f3[_0x996b('0x6f')]=_0x29aea7[_0x996b('0x6d')];logger[_0x996b('0x62')](util[_0x996b('0x31')](_0x996b('0x70'),_0x41ac2a));return startTranscribe(_0x3040be,_0x50b0be,_0x125c80,uuidv4(),_0x29a524,_0x29aea7[_0x996b('0x6d')]);})['then'](function(_0x82b916){logger[_0x996b('0x62')](util[_0x996b('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x41ac2a,_0x82b916[_0x996b('0x71')][_0x996b('0x72')]));_0x24e3f3[_0x996b('0x73')]=_0x82b916[_0x996b('0x71')]['TranscriptionJobName'];_0x24e3f3['transcribeStatus']=_0x82b916['TranscriptionJob'][_0x996b('0x74')];return _0x226cdc(_0x24e3f3);})[_0x996b('0x46')](function(_0x4b36d2){return _0x506c5d(_0x4b36d2);});});}exports[_0x996b('0x75')]=function(_0x3e9969,_0x25d2ba,_0x20cd27){var _0x54f412;var _0x892791;var _0x25d04e;var _0x50e8fd=require('../../components/encryptor');return db['VoiceRecording'][_0x996b('0x76')]({'where':{'id':_0x3e9969[_0x996b('0x4b')]['id']}})[_0x996b('0x26')](function(_0x3d7c5a){if(_0x3d7c5a){var _0x405f54=util[_0x996b('0x31')]('%s.cypher',_0x3d7c5a['value']);if(fs[_0x996b('0x50')](_0x405f54)){cypher=!![];return _0x50e8fd[_0x996b('0x5f')](_0x405f54,_0x3d7c5a[_0x996b('0x4f')],config['secrets'][_0x996b('0x52')])['then'](function(){return _0x3d7c5a;});}return _0x3d7c5a;}})[_0x996b('0x26')](function(_0x4d84b2){if(!_0x4d84b2){throw new db[(_0x996b('0x53'))][(_0x996b('0x60'))](_0x996b('0x77'));}_0x892791=_0x4d84b2;return db['Setting'][_0x996b('0x76')]({'where':{'id':0x1}});})[_0x996b('0x26')](handleEntityNotFound(_0x25d2ba,null))[_0x996b('0x26')](function(_0x3e948){if(_0x3e948){_0x54f412=_0x3e948;if(!_0x54f412[_0x996b('0x78')]||!_0x54f412[_0x996b('0x79')]||!_0x54f412[_0x996b('0x7a')]||!_0x54f412[_0x996b('0x7b')]||!_0x54f412[_0x996b('0x6e')]){throw new db[(_0x996b('0x53'))][(_0x996b('0x60'))]('Transcribe\x20not\x20configured');}if(_0x3e9969[_0x996b('0x4a')]['runSentiment']&&(!_0x54f412[_0x996b('0x7c')]||!_0x54f412[_0x996b('0x7d')]||!_0x54f412[_0x996b('0x7e')]||!_0x54f412[_0x996b('0x7b')]||!_0x54f412[_0x996b('0x6e')])){throw new db[(_0x996b('0x53'))]['ValidationError'](_0x996b('0x7f'));}return db[_0x996b('0x80')][_0x996b('0x76')]({'where':{'id':_0x54f412['transcribeAccountId']}});}})['then'](function(_0x2531d8){if(!_0x2531d8){throw new db[(_0x996b('0x53'))][(_0x996b('0x60'))](_0x996b('0x81'));}if(!_0x2531d8[_0x996b('0x82')]||!_0x2531d8[_0x996b('0x83')]){throw new db[(_0x996b('0x53'))][(_0x996b('0x60'))](_0x996b('0x84'));}_0x25d04e=_0x2531d8;return getBucketslist(_0x25d04e[_0x996b('0x82')],_0x25d04e[_0x996b('0x83')],_0x54f412[_0x996b('0x7a')]);})[_0x996b('0x26')](function(_0x2557ce){if(_0x2557ce&&_0x2557ce[_0x996b('0x85')]){var _0x50b106=_['find'](_0x2557ce[_0x996b('0x85')],function(_0x41538c){return _0x41538c[_0x996b('0x86')]===_0x54f412[_0x996b('0x6e')];});if(!_0x50b106){logger[_0x996b('0x62')](util[_0x996b('0x31')](_0x996b('0x87'),_0x3e9969[_0x996b('0x4b')]['id'],_0x54f412[_0x996b('0x6e')]));return createBucket(_0x25d04e[_0x996b('0x82')],_0x25d04e['data2'],_0x54f412[_0x996b('0x7a')],_0x54f412[_0x996b('0x6e')]);}logger[_0x996b('0x62')](util[_0x996b('0x31')](_0x996b('0x88'),_0x3e9969[_0x996b('0x4b')]['id'],_0x54f412[_0x996b('0x6e')]));return;}})[_0x996b('0x26')](function(_0x1144ee){if(_0x892791[_0x996b('0x89')]==='NEW'){return transcribe(_0x3e9969[_0x996b('0x4b')]['id'],_0x25d04e[_0x996b('0x82')],_0x25d04e[_0x996b('0x83')],_0x54f412[_0x996b('0x7a')],_0x54f412[_0x996b('0x6e')],_0x892791[_0x996b('0x4f')],_0x54f412[_0x996b('0x7b')]);}else{logger[_0x996b('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3e9969[_0x996b('0x4b')]['id']));return{'transcribeStatus':_0x996b('0x8a')};}})[_0x996b('0x26')](function(_0x5daa46){if(_0x5daa46){_0x5daa46['tempSentiment']=_0x3e9969[_0x996b('0x4a')][_0x996b('0x8b')];return _0x892791[_0x996b('0x8c')](_0x5daa46);}})[_0x996b('0x26')](respondWithResult(_0x25d2ba,null))['catch'](handleError(_0x25d2ba,null));};function writeFile(_0x4de1da,_0x236708){return new Promise(function(_0x4982d9,_0x403340){fs[_0x996b('0x8d')](_0x236708,_0x4de1da,function(_0x117370,_0x1d7f3c){if(_0x117370){return _0x403340(_0x117370);}else{return _0x4982d9(_0x1d7f3c);}});});}exports[_0x996b('0x8e')]=function(_0x32af11,_0x575eb8,_0x117e83){return db[_0x996b('0x42')][_0x996b('0x76')]({'where':{'id':_0x32af11[_0x996b('0x4b')]['id']}})[_0x996b('0x26')](handleEntityNotFound(_0x575eb8))['then'](function(_0x2366c7){if(_0x2366c7&&_0x2366c7[_0x996b('0x8f')]){var _0x2c3846=_0x2366c7[_0x996b('0x8f')];var _0x30f43d=config[_0x996b('0x90')]+_0x996b('0x91')+_0x2366c7['id']+'.txt';if(fs['existsSync'](_0x30f43d)){return _0x30f43d;}return writeFile(_0x2c3846,_0x30f43d)['then'](function(){return _0x30f43d;});}else{throw new db[(_0x996b('0x53'))]['ValidationError'](_0x996b('0x92'));}})[_0x996b('0x26')](function(_0x246630){return _0x575eb8['download'](_0x246630);})['catch'](handleError(_0x575eb8));}; \ No newline at end of file +var _0x5d5c=['Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','VoiceRecording','type','key','model','differenceBy','query','keys','intersection','attributes','length','order','sort','pick','filters','where','merge','VIRTUAL','options','include','rows','catch','rawAttributes','fields','includeAll','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','MD5','col','token','$and','push','decryptFile','recording','Sequelize','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','startTranscriptionJob','info','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x5d5c,0x92));var _0xc5d5=function(_0x3de902,_0x3260e9){_0x3de902=_0x3de902-0x0;var _0x5aa2e4=_0x5d5c[_0x3de902];return _0x5aa2e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5d5('0x0'));var zipdir=require(_0xc5d5('0x1'));var jsonpatch=require(_0xc5d5('0x2'));var rp=require(_0xc5d5('0x3'));var moment=require('moment');var BPromise=require(_0xc5d5('0x4'));var Mustache=require('mustache');var util=require(_0xc5d5('0x5'));var path=require(_0xc5d5('0x6'));var sox=require(_0xc5d5('0x7'));var csv=require(_0xc5d5('0x8'));var ejs=require(_0xc5d5('0x9'));var fs=require('fs');var fs_extra=require(_0xc5d5('0xa'));var _=require(_0xc5d5('0xb'));var squel=require(_0xc5d5('0xc'));var crypto=require('crypto');var jsforce=require(_0xc5d5('0xd'));var deskjs=require(_0xc5d5('0xe'));var toCsv=require(_0xc5d5('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0xc5d5('0xf'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xc5d5('0x10'));var qs=require(_0xc5d5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5d5('0x12'));var logger=require('../../config/logger')(_0xc5d5('0x13'));var utils=require('../../config/utils');var config=require(_0xc5d5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5d5('0x15'))['db'];function respondWithStatusCode(_0x848784,_0x1db62e){_0x1db62e=_0x1db62e||0xcc;return function(_0x1f1d5b){if(_0x1f1d5b){return _0x848784['sendStatus'](_0x1db62e);}return _0x848784[_0xc5d5('0x16')](_0x1db62e)['end']();};}function respondWithResult(_0xb2aa31,_0xb6559c){_0xb6559c=_0xb6559c||0xc8;return function(_0x115f4e){if(_0x115f4e){return _0xb2aa31['status'](_0xb6559c)[_0xc5d5('0x17')](_0x115f4e);}};}function respondWithFilteredResult(_0x5a8bc5,_0x3a458f){return function(_0x2525e4){if(_0x2525e4){var _0xf56ab=typeof _0x3a458f['offset']==='undefined'&&typeof _0x3a458f[_0xc5d5('0x18')]===_0xc5d5('0x19');var _0x1fa034=_0x2525e4[_0xc5d5('0x1a')];var _0x1f4ed3=_0xf56ab?0x0:_0x3a458f[_0xc5d5('0x1b')];var _0x122fa7=_0xf56ab?_0x2525e4[_0xc5d5('0x1a')]:_0x3a458f['offset']+_0x3a458f[_0xc5d5('0x18')];var _0x3925c8;if(_0x122fa7>=_0x1fa034){_0x122fa7=_0x1fa034;_0x3925c8=0xc8;}else{_0x3925c8=0xce;}_0x5a8bc5[_0xc5d5('0x16')](_0x3925c8);return _0x5a8bc5[_0xc5d5('0x1c')](_0xc5d5('0x1d'),_0x1f4ed3+'-'+_0x122fa7+'/'+_0x1fa034)[_0xc5d5('0x17')](_0x2525e4);}return null;};}function patchUpdates(_0x5e3eb3){return function(_0xf48db1){try{jsonpatch[_0xc5d5('0x1e')](_0xf48db1,_0x5e3eb3,!![]);}catch(_0x1a13c4){return BPromise[_0xc5d5('0x1f')](_0x1a13c4);}return _0xf48db1[_0xc5d5('0x20')]();};}function saveUpdates(_0x427987,_0x108f57){return function(_0x159446){if(_0x159446){return _0x159446[_0xc5d5('0x21')](_0x427987)[_0xc5d5('0x22')](function(_0x365ab1){return _0x365ab1;});}return null;};}function removeEntity(_0x559773,_0x3e6628){return function(_0x23d59e){if(_0x23d59e){return _0x23d59e[_0xc5d5('0x23')]()[_0xc5d5('0x22')](function(){_0x559773[_0xc5d5('0x16')](0xcc)[_0xc5d5('0x24')]();});}};}function handleEntityNotFound(_0x43bba8,_0x8eb280){return function(_0x427f08){if(!_0x427f08){_0x43bba8[_0xc5d5('0x25')](0x194);}return _0x427f08;};}function handleError(_0x3a9979,_0x468068){_0x468068=_0x468068||0x1f4;return function(_0x4b0f5e){logger['error'](_0x4b0f5e[_0xc5d5('0x26')]);if(_0x4b0f5e[_0xc5d5('0x27')]){delete _0x4b0f5e[_0xc5d5('0x27')];}_0x3a9979[_0xc5d5('0x16')](_0x468068)[_0xc5d5('0x28')](_0x4b0f5e);};}exports[_0xc5d5('0x29')]=function(_0x2317d7,_0x41ccc2){var _0x591219={},_0x16f540={},_0x476cd7={'count':0x0,'rows':[]};var _0x5cb39d=_[_0xc5d5('0x2a')](db[_0xc5d5('0x2b')]['rawAttributes'],function(_0x559379){return{'name':_0x559379['fieldName'],'type':_0x559379[_0xc5d5('0x2c')][_0xc5d5('0x2d')]};});_0x16f540[_0xc5d5('0x2e')]=_[_0xc5d5('0x2f')](_[_0xc5d5('0x2a')](_0x5cb39d,_0xc5d5('0x27')),['format']);_0x16f540[_0xc5d5('0x30')]=_[_0xc5d5('0x31')](_0x2317d7['query']);_0x16f540['filters']=_[_0xc5d5('0x32')](_0x16f540[_0xc5d5('0x2e')],_0x16f540[_0xc5d5('0x30')]);_0x591219['attributes']=_[_0xc5d5('0x32')](_0x16f540['model'],qs['fields'](_0x2317d7[_0xc5d5('0x30')]['fields']));_0x591219[_0xc5d5('0x33')]=_0x591219[_0xc5d5('0x33')][_0xc5d5('0x34')]?_0x591219[_0xc5d5('0x33')]:_0x16f540[_0xc5d5('0x2e')];if(!_0x2317d7['query']['hasOwnProperty']('nolimit')){_0x591219[_0xc5d5('0x18')]=qs[_0xc5d5('0x18')](_0x2317d7[_0xc5d5('0x30')]['limit']);_0x591219[_0xc5d5('0x1b')]=qs['offset'](_0x2317d7[_0xc5d5('0x30')][_0xc5d5('0x1b')]);}_0x591219[_0xc5d5('0x35')]=qs[_0xc5d5('0x36')](_0x2317d7['query']['sort']);_0x591219['where']=qs['filters'](_[_0xc5d5('0x37')](_0x2317d7[_0xc5d5('0x30')],_0x16f540[_0xc5d5('0x38')]),_0x5cb39d);if(_0x2317d7[_0xc5d5('0x30')]['filter']){_0x591219[_0xc5d5('0x39')]=_[_0xc5d5('0x3a')](_0x591219[_0xc5d5('0x39')],{'$or':_[_0xc5d5('0x2a')](_0x5cb39d,function(_0x44447c){if(_0x44447c[_0xc5d5('0x2c')]!==_0xc5d5('0x3b')){var _0x1bbf41={};_0x1bbf41[_0x44447c[_0xc5d5('0x27')]]={'$like':'%'+_0x2317d7[_0xc5d5('0x30')]['filter']+'%'};return _0x1bbf41;}})});}_0x591219=_['merge']({},_0x591219,_0x2317d7[_0xc5d5('0x3c')]);var _0x9ed302={'where':_0x591219[_0xc5d5('0x39')]};return db[_0xc5d5('0x2b')][_0xc5d5('0x1a')](_0x9ed302)[_0xc5d5('0x22')](function(_0x1be512){_0x476cd7[_0xc5d5('0x1a')]=_0x1be512;if(_0x2317d7['query']['includeAll']){_0x591219[_0xc5d5('0x3d')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x591219);})['then'](function(_0x472097){_0x476cd7[_0xc5d5('0x3e')]=_0x472097;return _0x476cd7;})[_0xc5d5('0x22')](respondWithFilteredResult(_0x41ccc2,_0x591219))[_0xc5d5('0x3f')](handleError(_0x41ccc2,null));};exports['show']=function(_0x4b0d68,_0x4723c7){var _0xecaf25={'raw':![],'where':{'id':_0x4b0d68['params']['id']}},_0x183bba={};_0x183bba['model']=_['keys'](db[_0xc5d5('0x2b')][_0xc5d5('0x40')]);_0x183bba[_0xc5d5('0x30')]=_[_0xc5d5('0x31')](_0x4b0d68[_0xc5d5('0x30')]);_0x183bba['filters']=_[_0xc5d5('0x32')](_0x183bba['model'],_0x183bba['query']);_0xecaf25[_0xc5d5('0x33')]=_[_0xc5d5('0x32')](_0x183bba['model'],qs[_0xc5d5('0x41')](_0x4b0d68[_0xc5d5('0x30')]['fields']));_0xecaf25['attributes']=_0xecaf25['attributes'][_0xc5d5('0x34')]?_0xecaf25[_0xc5d5('0x33')]:_0x183bba[_0xc5d5('0x2e')];if(_0x4b0d68[_0xc5d5('0x30')][_0xc5d5('0x42')]){_0xecaf25[_0xc5d5('0x3d')]=[{'all':!![]}];}_0xecaf25=_['merge']({},_0xecaf25,_0x4b0d68[_0xc5d5('0x3c')]);return db[_0xc5d5('0x2b')]['find'](_0xecaf25)[_0xc5d5('0x22')](handleEntityNotFound(_0x4723c7,null))[_0xc5d5('0x22')](respondWithResult(_0x4723c7,null))[_0xc5d5('0x3f')](handleError(_0x4723c7,null));};exports[_0xc5d5('0x43')]=function(_0x3d52f7,_0x4183e0){return db['VoiceRecording'][_0xc5d5('0x43')](_0x3d52f7['body'],{})[_0xc5d5('0x22')](respondWithResult(_0x4183e0,0xc9))[_0xc5d5('0x3f')](handleError(_0x4183e0,null));};exports[_0xc5d5('0x21')]=function(_0x3c392f,_0x1fac11){if(_0x3c392f[_0xc5d5('0x44')]['id']){delete _0x3c392f[_0xc5d5('0x44')]['id'];}return db[_0xc5d5('0x2b')][_0xc5d5('0x45')]({'where':{'id':_0x3c392f[_0xc5d5('0x46')]['id']}})[_0xc5d5('0x22')](handleEntityNotFound(_0x1fac11,null))['then'](saveUpdates(_0x3c392f['body'],null))[_0xc5d5('0x22')](respondWithResult(_0x1fac11,null))['catch'](handleError(_0x1fac11,null));};exports[_0xc5d5('0x47')]=function(_0xf89a8,_0x59e368){return db[_0xc5d5('0x2b')][_0xc5d5('0x47')]()[_0xc5d5('0x22')](respondWithResult(_0x59e368,null))[_0xc5d5('0x3f')](handleError(_0x59e368,null));};exports[_0xc5d5('0x48')]=function(_0x4cfb24,_0x2e5805,_0x79ff1c){var _0x53cd42=require(_0xc5d5('0x49'));var _0x5bffd0=![];var _0x38be72={};if(_0x4cfb24[_0xc5d5('0x30')][_0xc5d5('0x2c')]&&_0x4cfb24[_0xc5d5('0x30')][_0xc5d5('0x2c')]===_0xc5d5('0x4a')){_0x38be72[_0xc5d5('0x4a')]=_0x4cfb24[_0xc5d5('0x46')]['id'];}else{_0x38be72['id']=_0x4cfb24[_0xc5d5('0x46')]['id'];}return db[_0xc5d5('0x2b')][_0xc5d5('0x45')]({'where':_0x38be72,'attributes':['id',_0xc5d5('0x4b')],'raw':!![]})[_0xc5d5('0x22')](handleEntityNotFound(_0x2e5805,null))['then'](function(_0x22c669){if(_0x22c669){var _0x138b44=_0x22c669[_0xc5d5('0x4b')];var _0x13cd1f=util[_0xc5d5('0x4c')](_0xc5d5('0x4d'),_0x138b44);if(fs[_0xc5d5('0x4e')](_0x13cd1f)){_0x5bffd0=!![];return _0x53cd42['decryptFile'](_0x13cd1f,_0x138b44,config[_0xc5d5('0x4f')]['recording'])[_0xc5d5('0x22')](function(){return _0x22c669;});}return _0x22c669;}})[_0xc5d5('0x22')](function(_0x48d3c5){if(_0x48d3c5){var _0x37b3cc=_0x48d3c5[_0xc5d5('0x4b')];if(!fs[_0xc5d5('0x4e')](_0x37b3cc)){throw new db['Sequelize'][(_0xc5d5('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x48d3c5[_0xc5d5('0x51')]){return _0x2e5805[_0xc5d5('0x48')](_0x37b3cc,_0x48d3c5[_0xc5d5('0x51')]+path[_0xc5d5('0x52')](_0x37b3cc),function(){if(_0x5bffd0){fs['unlink'](_0x37b3cc);}});}else{return _0x2e5805[_0xc5d5('0x48')](_0x37b3cc,function(_0x1e5768){if(_0x5bffd0){fs[_0xc5d5('0x53')](_0x37b3cc);}});}}})['catch'](function(_0x43e4dc){if(_0x43e4dc[_0xc5d5('0x54')]===_0xc5d5('0x55')){_0x2e5805[_0xc5d5('0x16')](0x194)[_0xc5d5('0x28')](_0xc5d5('0x56'));}else{return handleError(_0x2e5805,null);}});};exports['downloads']=function(_0x4d769e,_0x17423f,_0x21a366){var _0x5c7f84=require(_0xc5d5('0x49'));var _0x2f78e9=![];var _0x398292={'$and':[db[_0xc5d5('0x57')][_0xc5d5('0x39')](db['sequelize']['fn'](_0xc5d5('0x58'),db[_0xc5d5('0x57')][_0xc5d5('0x59')](_0xc5d5('0x4a'))),_0x4d769e['query'][_0xc5d5('0x5a')])]};if(_0x4d769e[_0xc5d5('0x30')][_0xc5d5('0x2c')]&&_0x4d769e[_0xc5d5('0x30')]['type']===_0xc5d5('0x4a')){_0x398292[_0xc5d5('0x5b')][_0xc5d5('0x5c')]({'uniqueid':_0x4d769e[_0xc5d5('0x46')]['id']});}else{_0x398292[_0xc5d5('0x5b')][_0xc5d5('0x5c')]({'id':_0x4d769e[_0xc5d5('0x46')]['id']});}return db[_0xc5d5('0x2b')]['find']({'where':_0x398292,'attributes':['id',_0xc5d5('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x17423f,null))[_0xc5d5('0x22')](function(_0x2c9df4){if(_0x2c9df4){var _0x13dfc9=util[_0xc5d5('0x4c')]('%s.cypher',_0x2c9df4[_0xc5d5('0x4b')]);if(fs['existsSync'](_0x13dfc9)){_0x2f78e9=!![];return _0x5c7f84[_0xc5d5('0x5d')](_0x13dfc9,_0x2c9df4['value'],config[_0xc5d5('0x4f')][_0xc5d5('0x5e')])['then'](function(){return _0x2c9df4;});}return _0x2c9df4;}})[_0xc5d5('0x22')](function(_0x526070){if(_0x526070){if(!fs['existsSync'](_0x526070[_0xc5d5('0x4b')])){throw new db[(_0xc5d5('0x5f'))][(_0xc5d5('0x50'))](_0xc5d5('0x55'));}if(_0x526070[_0xc5d5('0x51')]){return _0x17423f[_0xc5d5('0x48')](_0x526070[_0xc5d5('0x4b')],_0x526070[_0xc5d5('0x51')]+path[_0xc5d5('0x52')](_0x526070['value']),function(){if(_0x2f78e9){fs[_0xc5d5('0x53')](_0x526070['value']);}});}else{return _0x17423f[_0xc5d5('0x48')](_0x526070[_0xc5d5('0x4b')],function(_0x30dd1f){if(_0x2f78e9){fs[_0xc5d5('0x53')](_0x526070[_0xc5d5('0x4b')]);}});}}})[_0xc5d5('0x3f')](handleError(_0x17423f,null));};exports[_0xc5d5('0x23')]=function(_0x3bd269,_0x7ede15){return db['VoiceRecording'][_0xc5d5('0x45')]({'where':{'id':_0x3bd269[_0xc5d5('0x46')]['id']}})[_0xc5d5('0x22')](function(_0x29e7df){if(_['isNil'](_0x29e7df)){throw new ReferenceError('Entity\x20not\x20found');}return _0x29e7df;})[_0xc5d5('0x22')](function(_0x535b19){var _0x125fdc=_0x535b19[_0xc5d5('0x4b')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x125fdc);if(!_[_0xc5d5('0x60')](_0x535b19[_0xc5d5('0x4b')])&&fs['existsSync'](_0x125fdc)){logger['info'](_0xc5d5('0x61')+_0x125fdc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc5d5('0x62')](_0x125fdc);}_0x125fdc=_0x125fdc+'.cypher';if(!_[_0xc5d5('0x60')](_0x535b19['value'])&&fs[_0xc5d5('0x4e')](_0x125fdc)){logger['info']('File:\x20\x22'+_0x125fdc+_0xc5d5('0x63'));fs[_0xc5d5('0x62')](_0x125fdc);}return _0x535b19;})[_0xc5d5('0x22')](function(_0x2b010b){if(!_0x2b010b)throw new InternalError();return _0x2b010b[_0xc5d5('0x23')]();})['then'](function(){_0x7ede15[_0xc5d5('0x16')](0xcc)[_0xc5d5('0x24')]();})[_0xc5d5('0x3f')](handleError(_0x7ede15,null));};function getBucketslist(_0x5812bd,_0xc5b7be,_0x472e80){return new Promise(function(_0x1812dd,_0x401509){var _0x165d85=new AWS['S3']({'accessKeyId':_0xc5b7be,'secretAccessKey':_0x5812bd,'region':_0x472e80});_0x165d85[_0xc5d5('0x64')]({},function(_0x268b5d,_0x29c1d2){if(_0x268b5d){return _0x401509(_0x268b5d);}else{return _0x1812dd(_0x29c1d2);}});});}function createBucket(_0x3e35b1,_0x54cff4,_0x407af6,_0x5b281b){return new Promise(function(_0x218180,_0x387c55){var _0x455ae3=new AWS['S3']({'accessKeyId':_0x54cff4,'secretAccessKey':_0x3e35b1,'region':_0x407af6});_0x455ae3['createBucket']({'Bucket':_0x5b281b},function(_0x368739,_0x2534c4){if(_0x368739){return _0x387c55(_0x368739);}else{return _0x218180(_0x2534c4);}});});}function uploadFile(_0x5541dc,_0x563946,_0x993299,_0x31dcde,_0x405beb,_0x4f6e22){return new Promise(function(_0xf62d8d,_0x641b5a){var _0xe8f94=new AWS['S3']({'accessKeyId':_0x563946,'secretAccessKey':_0x5541dc,'region':_0x993299});_0xe8f94[_0xc5d5('0x65')]({'Bucket':_0x31dcde,'Key':_0x405beb,'Body':_0x4f6e22},function(_0x7944fa,_0x44cb6f){if(_0x7944fa){return _0x641b5a(_0x7944fa);}else{return _0xf62d8d(_0x44cb6f);}});});}function startTranscribe(_0x249f18,_0x35bba8,_0x23878f,_0x21468a,_0x4f24ee,_0x1b966b){return new Promise(function(_0xaecfdf,_0x3d87ff){var _0x3fdd64=new AWS['TranscribeService']({'accessKeyId':_0x35bba8,'secretAccessKey':_0x249f18,'region':_0x23878f});_0x3fdd64[_0xc5d5('0x66')]({'TranscriptionJobName':_0x21468a,'LanguageCode':_0x4f24ee,'Media':{'MediaFileUri':_0x1b966b}},function(_0x465dc5,_0x2536fa){if(_0x465dc5){return _0x3d87ff(_0x465dc5);}else{return _0xaecfdf(_0x2536fa);}});});}function transcribe(_0x15e6a9,_0x239a81,_0x149c25,_0x1e2d91,_0x1c94a1,_0x476d43,_0x15c46e){return new Promise(function(_0x4f57e8,_0x44ec09){var _0x4402a2={};logger[_0xc5d5('0x67')](util[_0xc5d5('0x4c')](_0xc5d5('0x68'),_0x15e6a9,_0x1c94a1));return uploadFile(_0x239a81,_0x149c25,_0x1e2d91,_0x1c94a1,path[_0xc5d5('0x69')](_0x476d43),fs[_0xc5d5('0x6a')](_0x476d43))[_0xc5d5('0x22')](function(_0x2bc330){logger[_0xc5d5('0x67')](util[_0xc5d5('0x4c')](_0xc5d5('0x6b'),_0x15e6a9,_0x1c94a1,_0x2bc330[_0xc5d5('0x6c')]));_0x4402a2[_0xc5d5('0x6d')]=_0x2bc330[_0xc5d5('0x6e')];_0x4402a2[_0xc5d5('0x6f')]=_0x2bc330[_0xc5d5('0x6c')];logger[_0xc5d5('0x67')](util[_0xc5d5('0x4c')](_0xc5d5('0x70'),_0x15e6a9));return startTranscribe(_0x239a81,_0x149c25,_0x1e2d91,uuidv4(),_0x15c46e,_0x2bc330[_0xc5d5('0x6c')]);})['then'](function(_0xeacf8f){logger[_0xc5d5('0x67')](util[_0xc5d5('0x4c')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x15e6a9,_0xeacf8f[_0xc5d5('0x71')][_0xc5d5('0x72')]));_0x4402a2[_0xc5d5('0x73')]=_0xeacf8f[_0xc5d5('0x71')][_0xc5d5('0x72')];_0x4402a2[_0xc5d5('0x74')]=_0xeacf8f[_0xc5d5('0x71')][_0xc5d5('0x75')];return _0x4f57e8(_0x4402a2);})['catch'](function(_0x282185){return _0x44ec09(_0x282185);});});}exports[_0xc5d5('0x76')]=function(_0x10905c,_0x89c665,_0x4651f4){var _0x2295a3;var _0x28d726;var _0x5c9a1c;var _0x46863d=require(_0xc5d5('0x49'));return db[_0xc5d5('0x2b')][_0xc5d5('0x77')]({'where':{'id':_0x10905c[_0xc5d5('0x46')]['id']}})[_0xc5d5('0x22')](function(_0x1580fe){if(_0x1580fe){var _0xd431e3=util[_0xc5d5('0x4c')](_0xc5d5('0x4d'),_0x1580fe[_0xc5d5('0x4b')]);if(fs[_0xc5d5('0x4e')](_0xd431e3)){cypher=!![];return _0x46863d[_0xc5d5('0x5d')](_0xd431e3,_0x1580fe[_0xc5d5('0x4b')],config['secrets'][_0xc5d5('0x5e')])[_0xc5d5('0x22')](function(){return _0x1580fe;});}return _0x1580fe;}})[_0xc5d5('0x22')](function(_0x3f0c5f){if(!_0x3f0c5f){throw new db[(_0xc5d5('0x5f'))][(_0xc5d5('0x50'))]('Voice\x20Recording\x20not\x20found');}_0x28d726=_0x3f0c5f;return db['Setting'][_0xc5d5('0x77')]({'where':{'id':0x1}});})[_0xc5d5('0x22')](handleEntityNotFound(_0x89c665,null))['then'](function(_0x3d0abd){if(_0x3d0abd){_0x2295a3=_0x3d0abd;if(!_0x2295a3['transcribe']||!_0x2295a3[_0xc5d5('0x78')]||!_0x2295a3[_0xc5d5('0x79')]||!_0x2295a3[_0xc5d5('0x7a')]||!_0x2295a3[_0xc5d5('0x6d')]){throw new db[(_0xc5d5('0x5f'))][(_0xc5d5('0x50'))](_0xc5d5('0x7b'));}if(_0x10905c[_0xc5d5('0x44')]['runSentiment']&&(!_0x2295a3[_0xc5d5('0x7c')]||!_0x2295a3[_0xc5d5('0x7d')]||!_0x2295a3[_0xc5d5('0x7e')]||!_0x2295a3[_0xc5d5('0x7a')]||!_0x2295a3[_0xc5d5('0x6d')])){throw new db[(_0xc5d5('0x5f'))][(_0xc5d5('0x50'))](_0xc5d5('0x7f'));}return db[_0xc5d5('0x80')]['findOne']({'where':{'id':_0x2295a3[_0xc5d5('0x78')]}});}})[_0xc5d5('0x22')](function(_0x26ffbf){if(!_0x26ffbf){throw new db[(_0xc5d5('0x5f'))]['ValidationError'](_0xc5d5('0x81'));}if(!_0x26ffbf[_0xc5d5('0x82')]||!_0x26ffbf['data2']){throw new db[(_0xc5d5('0x5f'))][(_0xc5d5('0x50'))](_0xc5d5('0x83'));}_0x5c9a1c=_0x26ffbf;return getBucketslist(_0x5c9a1c[_0xc5d5('0x82')],_0x5c9a1c[_0xc5d5('0x84')],_0x2295a3[_0xc5d5('0x79')]);})['then'](function(_0x3a6592){if(_0x3a6592&&_0x3a6592[_0xc5d5('0x85')]){var _0x4c1e21=_[_0xc5d5('0x45')](_0x3a6592[_0xc5d5('0x85')],function(_0x3832ed){return _0x3832ed[_0xc5d5('0x86')]===_0x2295a3[_0xc5d5('0x6d')];});if(!_0x4c1e21){logger[_0xc5d5('0x67')](util[_0xc5d5('0x4c')](_0xc5d5('0x87'),_0x10905c[_0xc5d5('0x46')]['id'],_0x2295a3[_0xc5d5('0x6d')]));return createBucket(_0x5c9a1c[_0xc5d5('0x82')],_0x5c9a1c[_0xc5d5('0x84')],_0x2295a3['transcribeRegion'],_0x2295a3[_0xc5d5('0x6d')]);}logger['info'](util[_0xc5d5('0x4c')](_0xc5d5('0x88'),_0x10905c[_0xc5d5('0x46')]['id'],_0x2295a3[_0xc5d5('0x6d')]));return;}})[_0xc5d5('0x22')](function(_0x1ed9fe){if(_0x28d726['transcribeStatus']==='NEW'){return transcribe(_0x10905c[_0xc5d5('0x46')]['id'],_0x5c9a1c[_0xc5d5('0x82')],_0x5c9a1c[_0xc5d5('0x84')],_0x2295a3[_0xc5d5('0x79')],_0x2295a3['bucket'],_0x28d726['value'],_0x2295a3[_0xc5d5('0x7a')]);}else{logger['info'](util[_0xc5d5('0x4c')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x10905c[_0xc5d5('0x46')]['id']));return{'transcribeStatus':_0xc5d5('0x89')};}})[_0xc5d5('0x22')](function(_0x314ad5){if(_0x314ad5){_0x314ad5[_0xc5d5('0x8a')]=_0x10905c[_0xc5d5('0x44')]['runSentiment'];return _0x28d726['updateAttributes'](_0x314ad5);}})['then'](respondWithResult(_0x89c665,null))['catch'](handleError(_0x89c665,null));};function writeFile(_0x39f0a1,_0x11dfb5){return new Promise(function(_0x3c382e,_0x3de9ed){fs[_0xc5d5('0x8b')](_0x11dfb5,_0x39f0a1,function(_0x502cb6,_0x21028b){if(_0x502cb6){return _0x3de9ed(_0x502cb6);}else{return _0x3c382e(_0x21028b);}});});}exports[_0xc5d5('0x8c')]=function(_0x39f2d7,_0x2f402a,_0x1abe91){return db[_0xc5d5('0x2b')][_0xc5d5('0x77')]({'where':{'id':_0x39f2d7[_0xc5d5('0x46')]['id']}})[_0xc5d5('0x22')](handleEntityNotFound(_0x2f402a))[_0xc5d5('0x22')](function(_0x13a75f){if(_0x13a75f&&_0x13a75f['fileText']){var _0x118dde=_0x13a75f[_0xc5d5('0x8d')];var _0x4da427=config['root']+_0xc5d5('0x8e')+_0x13a75f['id']+_0xc5d5('0x8f');if(fs[_0xc5d5('0x4e')](_0x4da427)){return _0x4da427;}return writeFile(_0x118dde,_0x4da427)[_0xc5d5('0x22')](function(){return _0x4da427;});}else{throw new db[(_0xc5d5('0x5f'))]['ValidationError'](_0xc5d5('0x90'));}})[_0xc5d5('0x22')](function(_0x4c64f4){return _0x2f402a[_0xc5d5('0x48')](_0x4c64f4);})[_0xc5d5('0x3f')](handleError(_0x2f402a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c4e596a..6e17ad8 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 _0x9e1a=['voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x496700,_0x1db257){var _0x1ef2fa=function(_0x24e109){while(--_0x24e109){_0x496700['push'](_0x496700['shift']());}};_0x1ef2fa(++_0x1db257);}(_0x9e1a,0x120));var _0xa9e1=function(_0x5af982,_0x941927){_0x5af982=_0x5af982-0x0;var _0x2738b4=_0x9e1a[_0x5af982];return _0x2738b4;};'use strict';var _=require(_0xa9e1('0x0'));var util=require(_0xa9e1('0x1'));var logger=require(_0xa9e1('0x2'))(_0xa9e1('0x3'));var moment=require(_0xa9e1('0x4'));var BPromise=require(_0xa9e1('0x5'));var rp=require(_0xa9e1('0x6'));var fs=require('fs');var path=require(_0xa9e1('0x7'));var rimraf=require('rimraf');var config=require(_0xa9e1('0x8'));var attributes=require('./voiceRecording.attributes');module[_0xa9e1('0x9')]=function(_0x1c49ca,_0x160a75){return _0x1c49ca[_0xa9e1('0xa')]('VoiceRecording',attributes,{'tableName':_0xa9e1('0xb'),'paranoid':![],'indexes':[{'name':_0xa9e1('0xc'),'fields':[_0xa9e1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15da=['voice_recordings','uniqueid','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0x15da,0x98));var _0xa15d=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x15da[_0x5e2cb4];return _0x282902;};'use strict';var _=require('lodash');var util=require(_0xa15d('0x0'));var logger=require(_0xa15d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa15d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa15d('0x3'));var config=require(_0xa15d('0x4'));var attributes=require(_0xa15d('0x5'));module[_0xa15d('0x6')]=function(_0x375c1a,_0x40dd5e){return _0x375c1a[_0xa15d('0x7')]('VoiceRecording',attributes,{'tableName':_0xa15d('0x8'),'paranoid':![],'indexes':[{'name':_0xa15d('0x9'),'fields':[_0xa15d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 96d0aa0..0769726 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 _0x8ace=['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','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','body','callRecordingEncryption','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x51bd64,_0x1c8850){_0x51bd64=_0x51bd64-0x0;var _0x2c7ee4=_0x8ace[_0x51bd64];return _0x2c7ee4;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')](_0x36759c['body'],{'raw':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]||null:null,'limit':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x20')](function(_0x3933d2){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger[_0xe8ac('0x12')](_0xe8ac('0x19'),_0x36759c,JSON[_0xe8ac('0x14')](_0x3933d2));_0x59df3d(_0x3933d2);})['catch'](function(_0x1c3ea4){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x1c3ea4[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x1c3ea4[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x21')]=function(_0x3e3fc2){var _0x44b07c=this;return new Promise(function(_0x562e44,_0x5a1b69){var _0x346dcb=require(_0xe8ac('0x22'));var _0x59512c;return db[_0xe8ac('0x23')][_0xe8ac('0x24')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f1e44){_0x59512c=_0x1f1e44;return db[_0xe8ac('0x1a')][_0xe8ac('0x25')](_0x3e3fc2[_0xe8ac('0x26')]);})[_0xe8ac('0x20')](function(_0x41ffe8){if(_0x59512c[_0xe8ac('0x27')]&&fs['existsSync'](_0x41ffe8[_0xe8ac('0x28')])){var _0x5459e5=util[_0xe8ac('0x29')]('%s.cypher',_0x41ffe8['value']);return _0x346dcb['encryptFile'](_0x41ffe8['value'],_0x5459e5,config[_0xe8ac('0x2a')][_0xe8ac('0x2b')])[_0xe8ac('0x20')](function(){fs[_0xe8ac('0x2c')](_0x41ffe8[_0xe8ac('0x28')]);logger[_0xe8ac('0xf')](_0xe8ac('0x2d'));return _0x41ffe8;});}return _0x41ffe8;})['then'](function(_0x1cacb0){logger['info']('CreateVoiceRecording',_0x3e3fc2);logger['debug'](_0xe8ac('0x21'),_0x3e3fc2,JSON[_0xe8ac('0x14')](_0x1cacb0));_0x562e44(_0x1cacb0);})[_0xe8ac('0x18')](function(_0x56feff){logger['error'](_0xe8ac('0x21'),_0x56feff[_0xe8ac('0x16')],_0x3e3fc2);_0x5a1b69(_0x44b07c[_0xe8ac('0x15')](0x1f4,_0x56feff[_0xe8ac('0x16')]));});});}; \ No newline at end of file +var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x7bd0,0x111));var _0x07bd=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x7bd0[_0x1a9e78];return _0x113e06;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e7ea60c..c8d26ec 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 _0xa01d=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','describe','/:id','show','put','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa01d,0xeb));var _0xda01=function(_0x52eb8c,_0x1f6124){_0x52eb8c=_0x52eb8c-0x0;var _0x29943b=_0xa01d[_0x52eb8c];return _0x29943b;};'use strict';var multer=require(_0xda01('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda01('0x1'));var express=require('express');var router=express[_0xda01('0x2')]();var fs_extra=require(_0xda01('0x3'));var auth=require(_0xda01('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xda01('0x5'));var controller=require(_0xda01('0x6'));router[_0xda01('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda01('0x7')]('/describe',auth[_0xda01('0x8')](),controller[_0xda01('0x9')]);router[_0xda01('0x7')](_0xda01('0xa'),auth[_0xda01('0x8')](),controller[_0xda01('0xb')]);router['post']('/',auth[_0xda01('0x8')](),controller['create']);router[_0xda01('0xc')]('/:id',auth[_0xda01('0x8')](),controller[_0xda01('0xd')]);router['delete'](_0xda01('0xa'),auth[_0xda01('0x8')](),controller[_0xda01('0xe')]);module[_0xda01('0xf')]=router; \ No newline at end of file +var _0xa5c2=['/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x37273e,_0x2b691a){var _0x3e78d0=function(_0x2cf93a){while(--_0x2cf93a){_0x37273e['push'](_0x37273e['shift']());}};_0x3e78d0(++_0x2b691a);}(_0xa5c2,0xaa));var _0x2a5c=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xa5c2[_0x4aa4e6];return _0x322588;};'use strict';var multer=require(_0x2a5c('0x0'));var util=require(_0x2a5c('0x1'));var path=require(_0x2a5c('0x2'));var timeout=require(_0x2a5c('0x3'));var express=require(_0x2a5c('0x4'));var router=express[_0x2a5c('0x5')]();var fs_extra=require(_0x2a5c('0x6'));var auth=require(_0x2a5c('0x7'));var interaction=require(_0x2a5c('0x8'));var config=require(_0x2a5c('0x9'));var controller=require(_0x2a5c('0xa'));router[_0x2a5c('0xb')]('/',auth[_0x2a5c('0xc')](),controller[_0x2a5c('0xd')]);router['get'](_0x2a5c('0xe'),auth[_0x2a5c('0xc')](),controller['describe']);router[_0x2a5c('0xb')](_0x2a5c('0xf'),auth[_0x2a5c('0xc')](),controller[_0x2a5c('0x10')]);router[_0x2a5c('0x11')]('/',auth['isAuthenticated'](),controller[_0x2a5c('0x12')]);router[_0x2a5c('0x13')](_0x2a5c('0xf'),auth[_0x2a5c('0xc')](),controller[_0x2a5c('0x14')]);router[_0x2a5c('0x15')]('/:id',auth[_0x2a5c('0xc')](),controller['destroy']);module[_0x2a5c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 9470f46..97fc8da 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 _0x8ce8=['moment','exports','blind','attended','STRING'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x8ce8,0x1c7));var _0x88ce=function(_0x51b52e,_0x3c2506){_0x51b52e=_0x51b52e-0x0;var _0x59a011=_0x8ce8[_0x51b52e];return _0x59a011;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x88ce('0x0'));module[_0x88ce('0x1')]={'type':{'type':Sequelize['ENUM'](_0x88ce('0x2'),_0x88ce('0x3'))},'result':{'type':Sequelize[_0x88ce('0x4')]},'transfererchannel':{'type':Sequelize[_0x88ce('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x88ce('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x88ce('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x88ce('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x88ce('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x88ce('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x88ce('0x4')]},'transfereechannel':{'type':Sequelize[_0x88ce('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x88ce('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x88ce('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x88ce('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x88ce('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x88ce('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x88ce('0x4')]},'extension':{'type':Sequelize[_0x88ce('0x4')]}}; \ No newline at end of file +var _0x381c=['STRING','sequelize','exports','ENUM','blind','attended'];(function(_0x53e7ce,_0x41be86){var _0x107ba2=function(_0x1a6327){while(--_0x1a6327){_0x53e7ce['push'](_0x53e7ce['shift']());}};_0x107ba2(++_0x41be86);}(_0x381c,0x187));var _0xc381=function(_0x39f5be,_0x52e1a1){_0x39f5be=_0x39f5be-0x0;var _0x431e58=_0x381c[_0x39f5be];return _0x431e58;};'use strict';var Sequelize=require(_0xc381('0x0'));var moment=require('moment');module[_0xc381('0x1')]={'type':{'type':Sequelize[_0xc381('0x2')](_0xc381('0x3'),_0xc381('0x4'))},'result':{'type':Sequelize[_0xc381('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xc381('0x5')]},'transferercalleridname':{'type':Sequelize[_0xc381('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc381('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xc381('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xc381('0x5')]},'transferercontext':{'type':Sequelize[_0xc381('0x5')]},'transfererexten':{'type':Sequelize[_0xc381('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xc381('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xc381('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xc381('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc381('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xc381('0x5')]},'transfereecontext':{'type':Sequelize[_0xc381('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xc381('0x5')]},'isexternal':{'type':Sequelize[_0xc381('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xc381('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3a76ab7..05ea78b 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 _0xb9f3=['crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','offset','Content-Range','save','update','then','destroy','error','name','send','map','VoiceTransferReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','count','includeAll','findAll','catch','show','params','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x41e87f,_0x20d6c0){var _0x2b68e2=function(_0x426164){while(--_0x426164){_0x41e87f['push'](_0x41e87f['shift']());}};_0x2b68e2(++_0x20d6c0);}(_0xb9f3,0x119));var _0x3b9f=function(_0x5cddb7,_0xb48393){_0x5cddb7=_0x5cddb7-0x0;var _0x35e40d=_0xb9f3[_0x5cddb7];return _0x35e40d;};'use strict';var emlformat=require(_0x3b9f('0x0'));var rimraf=require(_0x3b9f('0x1'));var zipdir=require(_0x3b9f('0x2'));var jsonpatch=require(_0x3b9f('0x3'));var rp=require(_0x3b9f('0x4'));var moment=require(_0x3b9f('0x5'));var BPromise=require(_0x3b9f('0x6'));var Mustache=require(_0x3b9f('0x7'));var util=require(_0x3b9f('0x8'));var path=require(_0x3b9f('0x9'));var sox=require('sox');var csv=require(_0x3b9f('0xa'));var ejs=require(_0x3b9f('0xb'));var fs=require('fs');var fs_extra=require(_0x3b9f('0xc'));var _=require(_0x3b9f('0xd'));var squel=require(_0x3b9f('0xe'));var crypto=require(_0x3b9f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3b9f('0x10'));var toCsv=require(_0x3b9f('0xa'));var querystring=require(_0x3b9f('0x11'));var Papa=require('papaparse');var Redis=require(_0x3b9f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3b9f('0x13'));var as=require(_0x3b9f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b9f('0x15'))(_0x3b9f('0x16'));var utils=require(_0x3b9f('0x17'));var config=require(_0x3b9f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d218e,_0x39e642){_0x39e642=_0x39e642||0xcc;return function(_0x2a36ff){if(_0x2a36ff){return _0x4d218e['sendStatus'](_0x39e642);}return _0x4d218e[_0x3b9f('0x19')](_0x39e642)[_0x3b9f('0x1a')]();};}function respondWithResult(_0x57036c,_0x408d07){_0x408d07=_0x408d07||0xc8;return function(_0x377d6e){if(_0x377d6e){return _0x57036c[_0x3b9f('0x19')](_0x408d07)[_0x3b9f('0x1b')](_0x377d6e);}};}function respondWithFilteredResult(_0x1c4b5e,_0x216ec0){return function(_0x1f159c){if(_0x1f159c){var _0x50eeeb=typeof _0x216ec0['offset']===_0x3b9f('0x1c')&&typeof _0x216ec0[_0x3b9f('0x1d')]===_0x3b9f('0x1c');var _0x198e2a=_0x1f159c['count'];var _0x6ae858=_0x50eeeb?0x0:_0x216ec0[_0x3b9f('0x1e')];var _0x62e11a=_0x50eeeb?_0x1f159c['count']:_0x216ec0['offset']+_0x216ec0[_0x3b9f('0x1d')];var _0x112a50;if(_0x62e11a>=_0x198e2a){_0x62e11a=_0x198e2a;_0x112a50=0xc8;}else{_0x112a50=0xce;}_0x1c4b5e['status'](_0x112a50);return _0x1c4b5e['set'](_0x3b9f('0x1f'),_0x6ae858+'-'+_0x62e11a+'/'+_0x198e2a)['json'](_0x1f159c);}return null;};}function patchUpdates(_0x3aadb1){return function(_0x4cde9c){try{jsonpatch['apply'](_0x4cde9c,_0x3aadb1,!![]);}catch(_0x3d8ef5){return BPromise['reject'](_0x3d8ef5);}return _0x4cde9c[_0x3b9f('0x20')]();};}function saveUpdates(_0x23bb23,_0x6b1d9){return function(_0xea255d){if(_0xea255d){return _0xea255d[_0x3b9f('0x21')](_0x23bb23)[_0x3b9f('0x22')](function(_0x1d0c3e){return _0x1d0c3e;});}return null;};}function removeEntity(_0xef46d6,_0x5d35ef){return function(_0x2a8937){if(_0x2a8937){return _0x2a8937[_0x3b9f('0x23')]()[_0x3b9f('0x22')](function(){_0xef46d6['status'](0xcc)[_0x3b9f('0x1a')]();});}};}function handleEntityNotFound(_0x33c501,_0x3a5109){return function(_0x40d0eb){if(!_0x40d0eb){_0x33c501['sendStatus'](0x194);}return _0x40d0eb;};}function handleError(_0x1267d1,_0x5c8a83){_0x5c8a83=_0x5c8a83||0x1f4;return function(_0x4ad500){logger[_0x3b9f('0x24')](_0x4ad500['stack']);if(_0x4ad500[_0x3b9f('0x25')]){delete _0x4ad500['name'];}_0x1267d1['status'](_0x5c8a83)[_0x3b9f('0x26')](_0x4ad500);};}exports['index']=function(_0xf6a470,_0xcdd8d8){var _0x6a3ec2={},_0xb4101e={},_0x3755b7={'count':0x0,'rows':[]};var _0x274aab=_[_0x3b9f('0x27')](db[_0x3b9f('0x28')]['rawAttributes'],function(_0x5aeab6){return{'name':_0x5aeab6[_0x3b9f('0x29')],'type':_0x5aeab6['type'][_0x3b9f('0x2a')]};});_0xb4101e[_0x3b9f('0x2b')]=_[_0x3b9f('0x27')](_0x274aab,_0x3b9f('0x25'));_0xb4101e['query']=_[_0x3b9f('0x2c')](_0xf6a470[_0x3b9f('0x2d')]);_0xb4101e[_0x3b9f('0x2e')]=_[_0x3b9f('0x2f')](_0xb4101e[_0x3b9f('0x2b')],_0xb4101e[_0x3b9f('0x2d')]);_0x6a3ec2[_0x3b9f('0x30')]=_['intersection'](_0xb4101e[_0x3b9f('0x2b')],qs[_0x3b9f('0x31')](_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x31')]));_0x6a3ec2['attributes']=_0x6a3ec2[_0x3b9f('0x30')]['length']?_0x6a3ec2[_0x3b9f('0x30')]:_0xb4101e[_0x3b9f('0x2b')];if(!_0xf6a470['query'][_0x3b9f('0x32')](_0x3b9f('0x33'))){_0x6a3ec2['limit']=qs['limit'](_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x1d')]);_0x6a3ec2['offset']=qs[_0x3b9f('0x1e')](_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x1e')]);}_0x6a3ec2[_0x3b9f('0x34')]=qs[_0x3b9f('0x35')](_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x35')]);_0x6a3ec2['where']=qs[_0x3b9f('0x2e')](_[_0x3b9f('0x36')](_0xf6a470[_0x3b9f('0x2d')],_0xb4101e[_0x3b9f('0x2e')]),_0x274aab);if(_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x37')]){_0x6a3ec2['where']=_[_0x3b9f('0x38')](_0x6a3ec2['where'],{'$or':_[_0x3b9f('0x27')](_0x274aab,function(_0x22e5bf){if(_0x22e5bf[_0x3b9f('0x39')]!==_0x3b9f('0x3a')){var _0x42314b={};_0x42314b[_0x22e5bf[_0x3b9f('0x25')]]={'$like':'%'+_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x37')]+'%'};return _0x42314b;}})});}_0x6a3ec2=_['merge']({},_0x6a3ec2,_0xf6a470[_0x3b9f('0x3b')]);var _0x405929={'where':_0x6a3ec2[_0x3b9f('0x3c')]};return db[_0x3b9f('0x28')][_0x3b9f('0x3d')](_0x405929)[_0x3b9f('0x22')](function(_0x27a0de){_0x3755b7[_0x3b9f('0x3d')]=_0x27a0de;if(_0xf6a470[_0x3b9f('0x2d')][_0x3b9f('0x3e')]){_0x6a3ec2['include']=[{'all':!![]}];}return db[_0x3b9f('0x28')][_0x3b9f('0x3f')](_0x6a3ec2);})[_0x3b9f('0x22')](function(_0x3e9483){_0x3755b7['rows']=_0x3e9483;return _0x3755b7;})['then'](respondWithFilteredResult(_0xcdd8d8,_0x6a3ec2))[_0x3b9f('0x40')](handleError(_0xcdd8d8,null));};exports[_0x3b9f('0x41')]=function(_0x3b716e,_0xf586){var _0x3e566e={'raw':!![],'where':{'id':_0x3b716e[_0x3b9f('0x42')]['id']}},_0x37da55={};_0x37da55['model']=_[_0x3b9f('0x2c')](db['VoiceTransferReport'][_0x3b9f('0x43')]);_0x37da55[_0x3b9f('0x2d')]=_[_0x3b9f('0x2c')](_0x3b716e['query']);_0x37da55[_0x3b9f('0x2e')]=_[_0x3b9f('0x2f')](_0x37da55['model'],_0x37da55[_0x3b9f('0x2d')]);_0x3e566e[_0x3b9f('0x30')]=_[_0x3b9f('0x2f')](_0x37da55['model'],qs['fields'](_0x3b716e[_0x3b9f('0x2d')][_0x3b9f('0x31')]));_0x3e566e[_0x3b9f('0x30')]=_0x3e566e[_0x3b9f('0x30')][_0x3b9f('0x44')]?_0x3e566e[_0x3b9f('0x30')]:_0x37da55['model'];if(_0x3b716e[_0x3b9f('0x2d')][_0x3b9f('0x3e')]){_0x3e566e[_0x3b9f('0x45')]=[{'all':!![]}];}_0x3e566e=_['merge']({},_0x3e566e,_0x3b716e[_0x3b9f('0x3b')]);return db[_0x3b9f('0x28')][_0x3b9f('0x46')](_0x3e566e)[_0x3b9f('0x22')](handleEntityNotFound(_0xf586,null))[_0x3b9f('0x22')](respondWithResult(_0xf586,null))['catch'](handleError(_0xf586,null));};exports[_0x3b9f('0x47')]=function(_0x3a15fb,_0x5586d2){return db[_0x3b9f('0x28')][_0x3b9f('0x47')](_0x3a15fb['body'],{})[_0x3b9f('0x22')](respondWithResult(_0x5586d2,0xc9))['catch'](handleError(_0x5586d2,null));};exports[_0x3b9f('0x21')]=function(_0x5e65d2,_0x387071){if(_0x5e65d2['body']['id']){delete _0x5e65d2[_0x3b9f('0x48')]['id'];}return db[_0x3b9f('0x28')][_0x3b9f('0x46')]({'where':{'id':_0x5e65d2[_0x3b9f('0x42')]['id']}})['then'](handleEntityNotFound(_0x387071,null))['then'](saveUpdates(_0x5e65d2[_0x3b9f('0x48')],null))['then'](respondWithResult(_0x387071,null))['catch'](handleError(_0x387071,null));};exports['destroy']=function(_0x232600,_0x4fbf0c){return db['VoiceTransferReport'][_0x3b9f('0x46')]({'where':{'id':_0x232600['params']['id']}})['then'](handleEntityNotFound(_0x4fbf0c,null))[_0x3b9f('0x22')](removeEntity(_0x4fbf0c,null))[_0x3b9f('0x40')](handleError(_0x4fbf0c,null));};exports[_0x3b9f('0x49')]=function(_0x4b10c7,_0x2cc39c){return db[_0x3b9f('0x28')][_0x3b9f('0x49')]()[_0x3b9f('0x22')](respondWithResult(_0x2cc39c,null))['catch'](handleError(_0x2cc39c,null));}; \ No newline at end of file +var _0x0373=['reject','save','update','then','error','stack','name','map','VoiceTransferReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range'];(function(_0x264b61,_0x4a5017){var _0x8fff4f=function(_0x25c21e){while(--_0x25c21e){_0x264b61['push'](_0x264b61['shift']());}};_0x8fff4f(++_0x4a5017);}(_0x0373,0x1e5));var _0x3037=function(_0xe2070e,_0x3a8903){_0xe2070e=_0xe2070e-0x0;var _0x377eee=_0x0373[_0xe2070e];return _0x377eee;};'use strict';var emlformat=require(_0x3037('0x0'));var rimraf=require(_0x3037('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3037('0x2'));var rp=require(_0x3037('0x3'));var moment=require(_0x3037('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3037('0x5'));var util=require(_0x3037('0x6'));var path=require(_0x3037('0x7'));var sox=require(_0x3037('0x8'));var csv=require(_0x3037('0x9'));var ejs=require(_0x3037('0xa'));var fs=require('fs');var fs_extra=require(_0x3037('0xb'));var _=require('lodash');var squel=require(_0x3037('0xc'));var crypto=require(_0x3037('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3037('0xe'));var toCsv=require(_0x3037('0x9'));var querystring=require(_0x3037('0xf'));var Papa=require(_0x3037('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3037('0x11'));var hardwareService=require(_0x3037('0x12'));var logger=require(_0x3037('0x13'))(_0x3037('0x14'));var utils=require(_0x3037('0x15'));var config=require(_0x3037('0x16'));var licenseUtil=require(_0x3037('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31c7c7,_0xd78259){_0xd78259=_0xd78259||0xcc;return function(_0x29ddd4){if(_0x29ddd4){return _0x31c7c7[_0x3037('0x18')](_0xd78259);}return _0x31c7c7['status'](_0xd78259)[_0x3037('0x19')]();};}function respondWithResult(_0x1ec483,_0xf50328){_0xf50328=_0xf50328||0xc8;return function(_0x4b0dbd){if(_0x4b0dbd){return _0x1ec483[_0x3037('0x1a')](_0xf50328)[_0x3037('0x1b')](_0x4b0dbd);}};}function respondWithFilteredResult(_0x4fbfac,_0xbb64db){return function(_0x2d113c){if(_0x2d113c){var _0x550656=typeof _0xbb64db[_0x3037('0x1c')]===_0x3037('0x1d')&&typeof _0xbb64db['limit']===_0x3037('0x1d');var _0x1e38d6=_0x2d113c[_0x3037('0x1e')];var _0x221fb4=_0x550656?0x0:_0xbb64db[_0x3037('0x1c')];var _0x586938=_0x550656?_0x2d113c[_0x3037('0x1e')]:_0xbb64db[_0x3037('0x1c')]+_0xbb64db['limit'];var _0x3d6047;if(_0x586938>=_0x1e38d6){_0x586938=_0x1e38d6;_0x3d6047=0xc8;}else{_0x3d6047=0xce;}_0x4fbfac[_0x3037('0x1a')](_0x3d6047);return _0x4fbfac[_0x3037('0x1f')](_0x3037('0x20'),_0x221fb4+'-'+_0x586938+'/'+_0x1e38d6)[_0x3037('0x1b')](_0x2d113c);}return null;};}function patchUpdates(_0x52270a){return function(_0x390857){try{jsonpatch['apply'](_0x390857,_0x52270a,!![]);}catch(_0xf44e6b){return BPromise[_0x3037('0x21')](_0xf44e6b);}return _0x390857[_0x3037('0x22')]();};}function saveUpdates(_0x4fb55b,_0x5ceed8){return function(_0x41eaf3){if(_0x41eaf3){return _0x41eaf3[_0x3037('0x23')](_0x4fb55b)['then'](function(_0x59f3a5){return _0x59f3a5;});}return null;};}function removeEntity(_0x3a8261,_0x5014a4){return function(_0x5aa2a9){if(_0x5aa2a9){return _0x5aa2a9['destroy']()[_0x3037('0x24')](function(){_0x3a8261['status'](0xcc)[_0x3037('0x19')]();});}};}function handleEntityNotFound(_0x553167,_0x34a660){return function(_0x2e3b9a){if(!_0x2e3b9a){_0x553167[_0x3037('0x18')](0x194);}return _0x2e3b9a;};}function handleError(_0x3a7f67,_0x4c816d){_0x4c816d=_0x4c816d||0x1f4;return function(_0x20bfa6){logger[_0x3037('0x25')](_0x20bfa6[_0x3037('0x26')]);if(_0x20bfa6[_0x3037('0x27')]){delete _0x20bfa6[_0x3037('0x27')];}_0x3a7f67[_0x3037('0x1a')](_0x4c816d)['send'](_0x20bfa6);};}exports['index']=function(_0x4651a5,_0x2ae4a7){var _0x1a06f8={},_0x59f31e={},_0x53260b={'count':0x0,'rows':[]};var _0x8a3784=_[_0x3037('0x28')](db[_0x3037('0x29')][_0x3037('0x2a')],function(_0x5b6b4f){return{'name':_0x5b6b4f[_0x3037('0x2b')],'type':_0x5b6b4f[_0x3037('0x2c')][_0x3037('0x2d')]};});_0x59f31e['model']=_['map'](_0x8a3784,_0x3037('0x27'));_0x59f31e['query']=_[_0x3037('0x2e')](_0x4651a5['query']);_0x59f31e[_0x3037('0x2f')]=_[_0x3037('0x30')](_0x59f31e[_0x3037('0x31')],_0x59f31e[_0x3037('0x32')]);_0x1a06f8[_0x3037('0x33')]=_[_0x3037('0x30')](_0x59f31e[_0x3037('0x31')],qs['fields'](_0x4651a5[_0x3037('0x32')][_0x3037('0x34')]));_0x1a06f8['attributes']=_0x1a06f8[_0x3037('0x33')]['length']?_0x1a06f8[_0x3037('0x33')]:_0x59f31e[_0x3037('0x31')];if(!_0x4651a5['query'][_0x3037('0x35')]('nolimit')){_0x1a06f8[_0x3037('0x36')]=qs[_0x3037('0x36')](_0x4651a5[_0x3037('0x32')]['limit']);_0x1a06f8[_0x3037('0x1c')]=qs[_0x3037('0x1c')](_0x4651a5['query'][_0x3037('0x1c')]);}_0x1a06f8[_0x3037('0x37')]=qs[_0x3037('0x38')](_0x4651a5[_0x3037('0x32')][_0x3037('0x38')]);_0x1a06f8[_0x3037('0x39')]=qs[_0x3037('0x2f')](_[_0x3037('0x3a')](_0x4651a5[_0x3037('0x32')],_0x59f31e['filters']),_0x8a3784);if(_0x4651a5[_0x3037('0x32')]['filter']){_0x1a06f8[_0x3037('0x39')]=_[_0x3037('0x3b')](_0x1a06f8['where'],{'$or':_[_0x3037('0x28')](_0x8a3784,function(_0x46aa62){if(_0x46aa62['type']!==_0x3037('0x3c')){var _0x2b1b6e={};_0x2b1b6e[_0x46aa62['name']]={'$like':'%'+_0x4651a5['query'][_0x3037('0x3d')]+'%'};return _0x2b1b6e;}})});}_0x1a06f8=_[_0x3037('0x3b')]({},_0x1a06f8,_0x4651a5[_0x3037('0x3e')]);var _0x4356f4={'where':_0x1a06f8[_0x3037('0x39')]};return db[_0x3037('0x29')][_0x3037('0x1e')](_0x4356f4)[_0x3037('0x24')](function(_0x28017e){_0x53260b[_0x3037('0x1e')]=_0x28017e;if(_0x4651a5['query'][_0x3037('0x3f')]){_0x1a06f8[_0x3037('0x40')]=[{'all':!![]}];}return db[_0x3037('0x29')][_0x3037('0x41')](_0x1a06f8);})[_0x3037('0x24')](function(_0x28d2d7){_0x53260b[_0x3037('0x42')]=_0x28d2d7;return _0x53260b;})['then'](respondWithFilteredResult(_0x2ae4a7,_0x1a06f8))[_0x3037('0x43')](handleError(_0x2ae4a7,null));};exports['show']=function(_0x180de8,_0x355525){var _0xa1d5d2={'raw':!![],'where':{'id':_0x180de8[_0x3037('0x44')]['id']}},_0x79931d={};_0x79931d[_0x3037('0x31')]=_[_0x3037('0x2e')](db[_0x3037('0x29')]['rawAttributes']);_0x79931d[_0x3037('0x32')]=_[_0x3037('0x2e')](_0x180de8[_0x3037('0x32')]);_0x79931d['filters']=_['intersection'](_0x79931d[_0x3037('0x31')],_0x79931d['query']);_0xa1d5d2[_0x3037('0x33')]=_[_0x3037('0x30')](_0x79931d[_0x3037('0x31')],qs[_0x3037('0x34')](_0x180de8[_0x3037('0x32')][_0x3037('0x34')]));_0xa1d5d2[_0x3037('0x33')]=_0xa1d5d2[_0x3037('0x33')][_0x3037('0x45')]?_0xa1d5d2[_0x3037('0x33')]:_0x79931d[_0x3037('0x31')];if(_0x180de8['query'][_0x3037('0x3f')]){_0xa1d5d2[_0x3037('0x40')]=[{'all':!![]}];}_0xa1d5d2=_[_0x3037('0x3b')]({},_0xa1d5d2,_0x180de8[_0x3037('0x3e')]);return db[_0x3037('0x29')][_0x3037('0x46')](_0xa1d5d2)[_0x3037('0x24')](handleEntityNotFound(_0x355525,null))[_0x3037('0x24')](respondWithResult(_0x355525,null))['catch'](handleError(_0x355525,null));};exports[_0x3037('0x47')]=function(_0xf6aa14,_0x3f4270){return db[_0x3037('0x29')]['create'](_0xf6aa14[_0x3037('0x48')],{})['then'](respondWithResult(_0x3f4270,0xc9))[_0x3037('0x43')](handleError(_0x3f4270,null));};exports['update']=function(_0x245166,_0x2af34b){if(_0x245166[_0x3037('0x48')]['id']){delete _0x245166['body']['id'];}return db[_0x3037('0x29')][_0x3037('0x46')]({'where':{'id':_0x245166[_0x3037('0x44')]['id']}})[_0x3037('0x24')](handleEntityNotFound(_0x2af34b,null))[_0x3037('0x24')](saveUpdates(_0x245166[_0x3037('0x48')],null))[_0x3037('0x24')](respondWithResult(_0x2af34b,null))[_0x3037('0x43')](handleError(_0x2af34b,null));};exports['destroy']=function(_0x20226e,_0x5558d8){return db[_0x3037('0x29')]['find']({'where':{'id':_0x20226e[_0x3037('0x44')]['id']}})[_0x3037('0x24')](handleEntityNotFound(_0x5558d8,null))['then'](removeEntity(_0x5558d8,null))[_0x3037('0x43')](handleError(_0x5558d8,null));};exports[_0x3037('0x49')]=function(_0x3811a1,_0x7e837c){return db[_0x3037('0x29')]['describe']()['then'](respondWithResult(_0x7e837c,null))['catch'](handleError(_0x7e837c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3487ba9..97f51a2 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 _0x3540=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','util','api','moment','bluebird'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x3540,0x1dc));var _0x0354=function(_0x451ba5,_0x2f3a05){_0x451ba5=_0x451ba5-0x0;var _0x4550fb=_0x3540[_0x451ba5];return _0x4550fb;};'use strict';var _=require('lodash');var util=require(_0x0354('0x0'));var logger=require('../../config/logger')(_0x0354('0x1'));var moment=require(_0x0354('0x2'));var BPromise=require(_0x0354('0x3'));var rp=require(_0x0354('0x4'));var fs=require('fs');var path=require(_0x0354('0x5'));var rimraf=require(_0x0354('0x6'));var config=require(_0x0354('0x7'));var attributes=require(_0x0354('0x8'));module['exports']=function(_0x4ec599,_0xe2d6f6){return _0x4ec599[_0x0354('0x9')](_0x0354('0xa'),attributes,{'tableName':_0x0354('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a51=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5bdbc6,_0x25ff55){var _0x432627=function(_0x276d4d){while(--_0x276d4d){_0x5bdbc6['push'](_0x5bdbc6['shift']());}};_0x432627(++_0x25ff55);}(_0x6a51,0x94));var _0x16a5=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x6a51[_0x5400a1];return _0x4006c7;};'use strict';var _=require(_0x16a5('0x0'));var util=require(_0x16a5('0x1'));var logger=require(_0x16a5('0x2'))(_0x16a5('0x3'));var moment=require(_0x16a5('0x4'));var BPromise=require(_0x16a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16a5('0x6'));var rimraf=require('rimraf');var config=require(_0x16a5('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x16a5('0x8')]=function(_0x533ea8,_0x521987){return _0x533ea8[_0x16a5('0x9')](_0x16a5('0xa'),attributes,{'tableName':_0x16a5('0xb'),'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 94ffee0..4bc4ee4 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 _0xbad9=['create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0x4986fa,_0xd4c780){var _0x2585c6=function(_0x5536b5){while(--_0x5536b5){_0x4986fa['push'](_0x4986fa['shift']());}};_0x2585c6(++_0xd4c780);}(_0xbad9,0x17d));var _0x9bad=function(_0xf49e53,_0x3e4172){_0xf49e53=_0xf49e53-0x0;var _0x2b4769=_0xbad9[_0xf49e53];return _0x2b4769;};'use strict';var _=require('lodash');var util=require(_0x9bad('0x0'));var moment=require(_0x9bad('0x1'));var BPromise=require(_0x9bad('0x2'));var rs=require(_0x9bad('0x3'));var fs=require('fs');var Redis=require(_0x9bad('0x4'));var db=require(_0x9bad('0x5'))['db'];var utils=require(_0x9bad('0x6'));var logger=require(_0x9bad('0x7'))(_0x9bad('0x8'));var config=require(_0x9bad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9bad('0xa')][_0x9bad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ed229,_0x4706ad,_0x2266a5){return new BPromise(function(_0x1ce00e,_0x449996){return client[_0x9bad('0xc')](_0x5ed229,_0x2266a5)[_0x9bad('0xd')](function(_0x1290a0){logger[_0x9bad('0xe')](_0x9bad('0xf'),_0x4706ad,_0x9bad('0x10'));logger[_0x9bad('0x11')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4706ad,'request\x20sent',JSON[_0x9bad('0x12')](_0x1290a0));if(_0x1290a0[_0x9bad('0x13')]){if(_0x1290a0['error']['code']===0x1f4){logger[_0x9bad('0x13')](_0x9bad('0xf'),_0x4706ad,_0x1290a0[_0x9bad('0x13')][_0x9bad('0x14')]);return _0x449996(_0x1290a0[_0x9bad('0x13')]['message']);}logger['error'](_0x9bad('0xf'),_0x4706ad,_0x1290a0[_0x9bad('0x13')][_0x9bad('0x14')]);return _0x1ce00e(_0x1290a0['error'][_0x9bad('0x14')]);}else{logger[_0x9bad('0xe')](_0x9bad('0xf'),_0x4706ad,_0x9bad('0x10'));_0x1ce00e(_0x1290a0[_0x9bad('0x15')]['message']);}})['catch'](function(_0x552056){logger[_0x9bad('0x13')](_0x9bad('0xf'),_0x4706ad,_0x552056);_0x449996(_0x552056);});});}exports[_0x9bad('0x16')]=function(_0x385dda){var _0x818915=this;return new Promise(function(_0x3e42ba,_0x1c8f8a){return db[_0x9bad('0x17')][_0x9bad('0x18')](_0x385dda['body'],{'raw':_0x385dda[_0x9bad('0x19')]?_0x385dda[_0x9bad('0x19')][_0x9bad('0x1a')]===undefined?!![]:![]:!![]})[_0x9bad('0xd')](function(_0x36c579){logger[_0x9bad('0xe')]('CreateVoiceTransferReport',_0x385dda);logger[_0x9bad('0x11')](_0x9bad('0x16'),_0x385dda,JSON[_0x9bad('0x12')](_0x36c579));_0x3e42ba(_0x36c579);})['catch'](function(_0x41312f){logger['error'](_0x9bad('0x16'),_0x41312f[_0x9bad('0x14')],_0x385dda);_0x1c8f8a(_0x818915[_0x9bad('0x13')](0x1f4,_0x41312f[_0x9bad('0x14')]));});});}; \ No newline at end of file +var _0x3c31=['catch','CreateVoiceTransferReport','create','options','then','debug','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x3c31,0x6a));var _0x13c3=function(_0x21a729,_0x290727){_0x21a729=_0x21a729-0x0;var _0x22a688=_0x3c31[_0x21a729];return _0x22a688;};'use strict';var _=require('lodash');var util=require(_0x13c3('0x0'));var moment=require(_0x13c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x13c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13c3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x13c3('0x4'))(_0x13c3('0x5'));var config=require(_0x13c3('0x6'));var jayson=require(_0x13c3('0x7'));var client=jayson[_0x13c3('0x8')][_0x13c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfedb13,_0x1e0bf8,_0x3975b5){return new BPromise(function(_0x5dbd63,_0x21dac1){return client[_0x13c3('0xa')](_0xfedb13,_0x3975b5)['then'](function(_0x29cfd9){logger['info'](_0x13c3('0xb'),_0x1e0bf8,_0x13c3('0xc'));logger['debug'](_0x13c3('0xd'),_0x1e0bf8,_0x13c3('0xc'),JSON['stringify'](_0x29cfd9));if(_0x29cfd9['error']){if(_0x29cfd9[_0x13c3('0xe')][_0x13c3('0xf')]===0x1f4){logger[_0x13c3('0xe')](_0x13c3('0xb'),_0x1e0bf8,_0x29cfd9['error'][_0x13c3('0x10')]);return _0x21dac1(_0x29cfd9['error']['message']);}logger[_0x13c3('0xe')](_0x13c3('0xb'),_0x1e0bf8,_0x29cfd9['error'][_0x13c3('0x10')]);return _0x5dbd63(_0x29cfd9[_0x13c3('0xe')][_0x13c3('0x10')]);}else{logger[_0x13c3('0x11')](_0x13c3('0xb'),_0x1e0bf8,_0x13c3('0xc'));_0x5dbd63(_0x29cfd9[_0x13c3('0x12')][_0x13c3('0x10')]);}})[_0x13c3('0x13')](function(_0x41dfac){logger['error'](_0x13c3('0xb'),_0x1e0bf8,_0x41dfac);_0x21dac1(_0x41dfac);});});}exports[_0x13c3('0x14')]=function(_0x45223b){var _0x34a5fe=this;return new Promise(function(_0x1d093d,_0x1d9e0b){return db['VoiceTransferReport'][_0x13c3('0x15')](_0x45223b['body'],{'raw':_0x45223b[_0x13c3('0x16')]?_0x45223b['options']['raw']===undefined?!![]:![]:!![]})[_0x13c3('0x17')](function(_0x35f695){logger[_0x13c3('0x11')](_0x13c3('0x14'),_0x45223b);logger[_0x13c3('0x18')]('CreateVoiceTransferReport',_0x45223b,JSON['stringify'](_0x35f695));_0x1d093d(_0x35f695);})['catch'](function(_0x4583f9){logger['error']('CreateVoiceTransferReport',_0x4583f9['message'],_0x45223b);_0x1d9e0b(_0x34a5fe[_0x13c3('0xe')](0x1f4,_0x4583f9[_0x13c3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8ee100b..acddea6 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 _0xaebf=['isAuthenticated','canUpdate','/hangup','answer','/hold','hold','unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x983648,_0x3e33b7){var _0x55c62e=function(_0x87d659){while(--_0x87d659){_0x983648['push'](_0x983648['shift']());}};_0x55c62e(++_0x3e33b7);}(_0xaebf,0xbe));var _0xfaeb=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xaebf[_0x25e7cb];return _0x375d92;};'use strict';var express=require(_0xfaeb('0x0'));var router=express['Router']();var auth=require(_0xfaeb('0x1'));var controller=require(_0xfaeb('0x2'));router[_0xfaeb('0x3')](_0xfaeb('0x4'),auth[_0xfaeb('0x5')](),auth[_0xfaeb('0x6')](),controller['originate']);router['post'](_0xfaeb('0x7'),auth[_0xfaeb('0x5')](),auth[_0xfaeb('0x6')](),controller['hangup']);router['post']('/answer',auth[_0xfaeb('0x5')](),auth[_0xfaeb('0x6')](),controller[_0xfaeb('0x8')]);router[_0xfaeb('0x3')](_0xfaeb('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfaeb('0xa')]);router[_0xfaeb('0x3')]('/unhold',auth[_0xfaeb('0x5')](),auth[_0xfaeb('0x6')](),controller[_0xfaeb('0xb')]);router[_0xfaeb('0x3')]('/calls',auth['isAuthenticated'](),auth[_0xfaeb('0x6')](),controller[_0xfaeb('0xc')]);router['post'](_0xfaeb('0xd'),auth[_0xfaeb('0x5')](),auth[_0xfaeb('0x6')](),controller['transfer']);module[_0xfaeb('0xe')]=router; \ No newline at end of file +var _0x8a7e=['/originate','isAuthenticated','/hangup','hangup','/answer','canUpdate','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x2829ba,_0x417715){var _0x10c673=function(_0x39fc62){while(--_0x39fc62){_0x2829ba['push'](_0x2829ba['shift']());}};_0x10c673(++_0x417715);}(_0x8a7e,0x1c3));var _0xe8a7=function(_0x42700b,_0x3eca5c){_0x42700b=_0x42700b-0x0;var _0x945721=_0x8a7e[_0x42700b];return _0x945721;};'use strict';var express=require(_0xe8a7('0x0'));var router=express[_0xe8a7('0x1')]();var auth=require(_0xe8a7('0x2'));var controller=require(_0xe8a7('0x3'));router[_0xe8a7('0x4')](_0xe8a7('0x5'),auth[_0xe8a7('0x6')](),auth['canUpdate'](),controller['originate']);router[_0xe8a7('0x4')](_0xe8a7('0x7'),auth[_0xe8a7('0x6')](),auth['canUpdate'](),controller[_0xe8a7('0x8')]);router['post'](_0xe8a7('0x9'),auth[_0xe8a7('0x6')](),auth[_0xe8a7('0xa')](),controller[_0xe8a7('0xb')]);router[_0xe8a7('0x4')](_0xe8a7('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller['hold']);router[_0xe8a7('0x4')](_0xe8a7('0xd'),auth[_0xe8a7('0x6')](),auth[_0xe8a7('0xa')](),controller[_0xe8a7('0xe')]);router[_0xe8a7('0x4')](_0xe8a7('0xf'),auth['isAuthenticated'](),auth[_0xe8a7('0xa')](),controller[_0xe8a7('0x10')]);router[_0xe8a7('0x4')](_0xe8a7('0x11'),auth[_0xe8a7('0x6')](),auth[_0xe8a7('0xa')](),controller[_0xe8a7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2006617..72f3089 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 _0x2dae=['format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','user:%s','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all','filter','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dae,0xc3));var _0xe2da=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x2dae[_0x1064bc];return _0x5edc45;};'use strict';var path=require(_0xe2da('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xe2da('0x1'))['db'];var config=require(_0xe2da('0x2'));var util=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var jayson=require(_0xe2da('0x5'));var amiClient=jayson['client'][_0xe2da('0x6')]({'port':0x232a});var logger=require(_0xe2da('0x7'))(_0xe2da('0x8'));var Redis=require(_0xe2da('0x9'));config['redis']=_[_0xe2da('0xa')](config[_0xe2da('0xb')],{'host':_0xe2da('0xc'),'port':0x18eb});var io=require(_0xe2da('0xd'))(new Redis(config[_0xe2da('0xb')]));var Schema=require(_0xe2da('0xe'));var originateValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],_0xe2da('0x10')]},'callNumber':{'type':_0xe2da('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xe2da('0x11')},'callbackUrl':{'type':_0xe2da('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],_0xe2da('0x10')]},'sessionId':{'type':_0xe2da('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],_0xe2da('0x10')]},'sessionId':{'type':_0xe2da('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe2da('0x10')]},'sessionId':{'type':'string','required':[!![],_0xe2da('0x12')]},'transferNumber':{'type':_0xe2da('0x11'),'required':[!![],_0xe2da('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],_0xe2da('0x10')]},'sessionId':{'type':_0xe2da('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe2da('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xe2da('0xf'),'required':[!![],_0xe2da('0x10')]}});function emit(_0x33f919,_0x4dc58b,_0x25d4fa){logger[_0xe2da('0x14')](_0x33f919,_0x4dc58b,JSON[_0xe2da('0x15')](_0x25d4fa));io['to'](_0x33f919)[_0xe2da('0x16')](_0x4dc58b,_0x25d4fa);}function handleError(_0x4e1623){return function(_0x45bb92){console[_0xe2da('0x17')](_0xe2da('0x18'),_0x45bb92,_0x45bb92 instanceof RangeError);logger[_0xe2da('0x19')](_0x45bb92[_0xe2da('0x1a')]);if(_0x45bb92 instanceof RangeError){if(_0x45bb92['name']){delete _0x45bb92[_0xe2da('0x1b')];}_0x4e1623[_0xe2da('0x1c')](0x194)['send'](_0x45bb92);}else{if(_0x45bb92[_0xe2da('0x1b')]){delete _0x45bb92[_0xe2da('0x1b')];}_0x4e1623[_0xe2da('0x1c')](0x1f4)[_0xe2da('0x1d')](_0x45bb92);}};}function checkError(){return function(_0x336415){if(!_0x336415){throw new RangeError(_0xe2da('0x1e'));}return _0x336415;};}function respondWithRpcPromise(_0x5a9ffe,_0x467cd6){return new BPromise(function(_0x53cc4e,_0x30efdc){var _0x191d38=amiClient;return _0x191d38[_0xe2da('0x1f')](_0x5a9ffe,_0x467cd6)[_0xe2da('0x20')](function(_0x30dea4){if(_0x30dea4[_0xe2da('0x19')]){if(_0x30dea4[_0xe2da('0x19')][_0xe2da('0x21')]===0x1f4){return _0x30efdc(_0x30dea4['error'][_0xe2da('0x22')]);}return _0x53cc4e(_0x30dea4[_0xe2da('0x19')][_0xe2da('0x22')]);}else{_0x53cc4e(_0x30dea4[_0xe2da('0x23')]);}})[_0xe2da('0x24')](function(_0x230fb8){_0x30efdc(_0x230fb8);});});}function getAgent(_0x124d93){return db['User'][_0xe2da('0x25')]({'where':{'id':_0x124d93,'role':_0xe2da('0x26')}})[_0xe2da('0x20')](checkError());}function getAgentCheckSession(_0x38ee5e,_0x36ca43){return new BPromise(function(_0x2b6c9e,_0x1b4aff){var _0x39f60e=respondWithRpcPromise('VoiceChannels');var _0x487a7c=getAgent(_0x38ee5e);Promise['all']([_0x39f60e,_0x487a7c])[_0xe2da('0x20')](function(_0x8c91db){var _0x4146ad=_0x8c91db[0x0];var _0x1ab91a=_0x8c91db[0x1];var _0x5de7fb=_['filter'](_0x4146ad[_0xe2da('0x27')],function(_0x1ec8ca){return _0x1ec8ca[_0xe2da('0x28')]==_0x1ab91a['id']&&_0x1ec8ca[_0xe2da('0x29')]==_0x36ca43;});if(_0x5de7fb[_0xe2da('0x2a')]==0x1){_0x2b6c9e(_0x1ab91a);}else{_0x1b4aff(new RangeError(_0xe2da('0x2b')+_0x36ca43+_0xe2da('0x2c')));}});});}exports[_0xe2da('0x2d')]=function(_0x461610,_0x499400){logger['info'](_0xe2da('0x2e'),_0x461610[_0xe2da('0x2f')]);var _0x2cb457=originateValidation[_0xe2da('0xe')](_0x461610[_0xe2da('0x2f')]);if(_0x2cb457[_0xe2da('0x2a')]>0x0){return _0x499400[_0xe2da('0x1c')](0x190)[_0xe2da('0x30')](_0x2cb457);}var _0x28e61a=_0x461610[_0xe2da('0x2f')][_0xe2da('0x31')];var _0x2386b8=_0x461610[_0xe2da('0x2f')][_0xe2da('0x32')];var _0x3649cd=_0x461610[_0xe2da('0x2f')][_0xe2da('0x33')];var _0x3a6f08=_0x461610['body'][_0xe2da('0x34')];return getAgent(_0x28e61a)[_0xe2da('0x20')](function(_0x39dae5){logger['info'](_0xe2da('0x35'),_0x39dae5[_0xe2da('0x1b')]);emit(util[_0xe2da('0x36')]('user:%s',_0x39dae5['name']),_0xe2da('0x37'),{'callNumber':_0x2386b8,'callerId':_0x3649cd,'callbackUrl':_0x3a6f08});return _0x499400[_0xe2da('0x1c')](0xc8)['json']({'error':![],'message':_0xe2da('0x38')});})[_0xe2da('0x24')](handleError(_0x499400));};exports[_0xe2da('0x39')]=function(_0x256a0c,_0x3a6ca3){logger['info'](_0xe2da('0x3a'),_0x256a0c['body']);var _0x59489e=hangupValidation[_0xe2da('0xe')](_0x256a0c['body']);if(_0x59489e[_0xe2da('0x2a')]>0x0){return _0x3a6ca3[_0xe2da('0x1c')](0x190)['json'](_0x59489e);}var _0x365968=_0x256a0c[_0xe2da('0x2f')]['userId'];var _0x4e14a6=_0x256a0c['body'][_0xe2da('0x29')];return getAgent(_0x365968)[_0xe2da('0x20')](function(_0x26ba99){logger[_0xe2da('0x14')](_0xe2da('0x35'),_0x26ba99[_0xe2da('0x1b')]);emit(util[_0xe2da('0x36')]('user:%s',_0x26ba99[_0xe2da('0x1b')]),_0xe2da('0x3b'),{'sessionId':_0x4e14a6});return _0x3a6ca3[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'error':![],'message':_0xe2da('0x3c')});})['catch'](handleError(_0x3a6ca3));};exports[_0xe2da('0x3d')]=function(_0x22d6c2,_0x3da65f){logger['info'](_0xe2da('0x3e'),_0x22d6c2[_0xe2da('0x2f')]);var _0x1529f4=answerValidation[_0xe2da('0xe')](_0x22d6c2[_0xe2da('0x2f')]);if(_0x1529f4[_0xe2da('0x2a')]>0x0){return _0x3da65f[_0xe2da('0x1c')](0x190)[_0xe2da('0x30')](_0x1529f4);}var _0x4aec15=_0x22d6c2[_0xe2da('0x2f')][_0xe2da('0x31')];var _0x2113e8=_0x22d6c2[_0xe2da('0x2f')][_0xe2da('0x29')];return getAgent(_0x4aec15)['then'](function(_0x46b7fc){logger[_0xe2da('0x14')](_0xe2da('0x35'),_0x46b7fc[_0xe2da('0x1b')]);emit(util[_0xe2da('0x36')](_0xe2da('0x3f'),_0x46b7fc[_0xe2da('0x1b')]),'webbar:answer',{'sessionId':_0x2113e8});return _0x3da65f[_0xe2da('0x1c')](0xc8)['json']({'error':![],'message':_0xe2da('0x40')});})[_0xe2da('0x24')](handleError(_0x3da65f));};exports[_0xe2da('0x41')]=function(_0x4b569e,_0x2dd7dc){logger[_0xe2da('0x14')]('hold\x20fired:',_0x4b569e[_0xe2da('0x2f')]);var _0x369dea=holdValidation[_0xe2da('0xe')](_0x4b569e['body']);if(_0x369dea[_0xe2da('0x2a')]>0x0){return _0x2dd7dc['status'](0x190)['json'](_0x369dea);}var _0x16a393=_0x4b569e['body'][_0xe2da('0x31')];var _0x422449=_0x4b569e['body'][_0xe2da('0x29')];return getAgent(_0x16a393)[_0xe2da('0x20')](function(_0x482547){logger['info'](_0xe2da('0x35'),_0x482547['name']);emit(util[_0xe2da('0x36')](_0xe2da('0x3f'),_0x482547[_0xe2da('0x1b')]),_0xe2da('0x42'),{'sessionId':_0x422449});return _0x2dd7dc[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'error':![],'message':_0xe2da('0x43')});})[_0xe2da('0x24')](handleError(_0x2dd7dc));};exports[_0xe2da('0x44')]=function(_0x515f9b,_0x3ce9a8){logger[_0xe2da('0x14')](_0xe2da('0x45'),_0x515f9b['body']);var _0x17b64f=unholdValidation[_0xe2da('0xe')](_0x515f9b[_0xe2da('0x2f')]);if(_0x17b64f[_0xe2da('0x2a')]>0x0){return _0x3ce9a8[_0xe2da('0x1c')](0x190)[_0xe2da('0x30')](_0x17b64f);}var _0x246384=_0x515f9b['body']['userId'];var _0x33bf4c=_0x515f9b[_0xe2da('0x2f')][_0xe2da('0x29')];return getAgent(_0x246384)['then'](function(_0x572690){logger[_0xe2da('0x14')]('entityFound:',_0x572690[_0xe2da('0x1b')]);emit(util[_0xe2da('0x36')](_0xe2da('0x3f'),_0x572690[_0xe2da('0x1b')]),_0xe2da('0x46'),{'sessionId':_0x33bf4c});return _0x3ce9a8[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'error':![],'message':_0xe2da('0x47')});})[_0xe2da('0x24')](handleError(_0x3ce9a8));};exports['calls']=function(_0x26a9f0,_0x2f763b){logger[_0xe2da('0x14')](_0xe2da('0x48'),_0x2f763b['body']);var _0x25b8a7=callsValidation[_0xe2da('0xe')](_0x26a9f0[_0xe2da('0x2f')]);if(_0x25b8a7['length']>0x0){return _0x2f763b[_0xe2da('0x1c')](0x190)[_0xe2da('0x30')](_0x25b8a7);}var _0x3e6e98=_0x26a9f0[_0xe2da('0x2f')][_0xe2da('0x31')];var _0x22a571=respondWithRpcPromise(_0xe2da('0x49'));var _0x377db9=getAgent(_0x3e6e98);return Promise[_0xe2da('0x4a')]([_0x22a571,_0x377db9])[_0xe2da('0x20')](function(_0x154877){var _0x3b4d10=_0x154877[0x0];var _0x505c24=_0x154877[0x1];var _0x2b50cb=_[_0xe2da('0x4b')](_0x3b4d10[_0xe2da('0x27')],function(_0x268052){return _0x268052[_0xe2da('0x28')]==_0x505c24['id'];});return _0x2f763b[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'count':_0x2b50cb['length'],'rows':_0x2b50cb});})[_0xe2da('0x24')](handleError(_0x2f763b));};exports['conference']=function(_0x3abde9,_0x18ff95){logger['info']('conference\x20fired:',_0x3abde9[_0xe2da('0x2f')]);var _0x5651f9=conferenceValidation[_0xe2da('0xe')](_0x3abde9['body']);if(_0x5651f9[_0xe2da('0x2a')]>0x0){return _0x18ff95[_0xe2da('0x1c')](0x190)[_0xe2da('0x30')](_0x5651f9);}var _0x4a2d10=_0x3abde9['body']['userId'];return getAgent(_0x4a2d10)[_0xe2da('0x20')](function(_0x1fa149){logger[_0xe2da('0x14')](_0xe2da('0x35'),_0x1fa149['name']);emit(util[_0xe2da('0x36')](_0xe2da('0x3f'),_0x1fa149[_0xe2da('0x1b')]),_0xe2da('0x4c'));return _0x18ff95[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'error':![],'message':_0xe2da('0x4d')});})['catch'](handleError(_0x18ff95));};exports[_0xe2da('0x4e')]=function(_0x4666b3,_0x3f0a4b){logger[_0xe2da('0x14')](_0xe2da('0x4f'),_0x4666b3['body']);var _0x841de3=transferValidation['validate'](_0x4666b3[_0xe2da('0x2f')]);if(_0x841de3['length']>0x0){return _0x3f0a4b[_0xe2da('0x1c')](0x190)['json'](_0x841de3);}var _0x58f9db=_0x4666b3[_0xe2da('0x2f')][_0xe2da('0x31')];var _0x2cff55=_0x4666b3[_0xe2da('0x2f')][_0xe2da('0x29')];var _0x44b96e=_0x4666b3[_0xe2da('0x2f')][_0xe2da('0x50')];return getAgent(_0x58f9db)[_0xe2da('0x20')](function(_0x17af45){logger['info'](_0xe2da('0x35'),_0x17af45[_0xe2da('0x1b')]);emit(util[_0xe2da('0x36')](_0xe2da('0x3f'),_0x17af45['name']),_0xe2da('0x51'),{'sessionId':_0x2cff55,'transferNumber':_0x44b96e});return _0x3f0a4b[_0xe2da('0x1c')](0xc8)[_0xe2da('0x30')]({'error':![],'message':_0xe2da('0x52')});})['catch'](handleError(_0x3f0a4b));}; \ No newline at end of file +var _0xedd9=['originate\x20executed!','hangup','hangup\x20fired:','status','webbar:hangup','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','stack','name','send','NotFound','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate'];(function(_0x12f1ab,_0x5a977f){var _0xce70cb=function(_0x290cd3){while(--_0x290cd3){_0x12f1ab['push'](_0x12f1ab['shift']());}};_0xce70cb(++_0x5a977f);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f3f18,_0x52da8e){_0x3f3f18=_0x3f3f18-0x0;var _0xf9916=_0xedd9[_0x3f3f18];return _0xf9916;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x9edd('0x0'));var db=require(_0x9edd('0x1'))['db'];var config=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var jayson=require(_0x9edd('0x5'));var amiClient=jayson[_0x9edd('0x6')][_0x9edd('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0x9edd('0x8'));var Redis=require(_0x9edd('0x9'));config[_0x9edd('0xa')]=_[_0x9edd('0xb')](config['redis'],{'host':_0x9edd('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0xa')]));var Schema=require(_0x9edd('0xd'));var originateValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'callNumber':{'type':'string','required':[!![],_0x9edd('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9edd('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'sessionId':{'type':_0x9edd('0x11'),'required':[!![],_0x9edd('0x12')]},'transferNumber':{'type':_0x9edd('0x11'),'required':[!![],_0x9edd('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]}});function emit(_0x4ea60f,_0x5f5bf4,_0x448996){logger[_0x9edd('0x14')](_0x4ea60f,_0x5f5bf4,JSON['stringify'](_0x448996));io['to'](_0x4ea60f)[_0x9edd('0x15')](_0x5f5bf4,_0x448996);}function handleError(_0x35f454){return function(_0x40ba32){console['log'](_0x9edd('0x16'),_0x40ba32,_0x40ba32 instanceof RangeError);logger['error'](_0x40ba32[_0x9edd('0x17')]);if(_0x40ba32 instanceof RangeError){if(_0x40ba32[_0x9edd('0x18')]){delete _0x40ba32['name'];}_0x35f454['status'](0x194)[_0x9edd('0x19')](_0x40ba32);}else{if(_0x40ba32['name']){delete _0x40ba32[_0x9edd('0x18')];}_0x35f454['status'](0x1f4)['send'](_0x40ba32);}};}function checkError(){return function(_0x356751){if(!_0x356751){throw new RangeError(_0x9edd('0x1a'));}return _0x356751;};}function respondWithRpcPromise(_0x4fb7bf,_0x5823bc){return new BPromise(function(_0x341d67,_0x186186){var _0x477878=amiClient;return _0x477878['request'](_0x4fb7bf,_0x5823bc)[_0x9edd('0x1b')](function(_0x1dca43){if(_0x1dca43[_0x9edd('0x1c')]){if(_0x1dca43[_0x9edd('0x1c')][_0x9edd('0x1d')]===0x1f4){return _0x186186(_0x1dca43['error'][_0x9edd('0x1e')]);}return _0x341d67(_0x1dca43[_0x9edd('0x1c')][_0x9edd('0x1e')]);}else{_0x341d67(_0x1dca43[_0x9edd('0x1f')]);}})[_0x9edd('0x20')](function(_0x4d507f){_0x186186(_0x4d507f);});});}function getAgent(_0x4b3d1b){return db[_0x9edd('0x21')][_0x9edd('0x22')]({'where':{'id':_0x4b3d1b,'role':_0x9edd('0x23')}})[_0x9edd('0x1b')](checkError());}function getAgentCheckSession(_0x3c2227,_0x4fe471){return new BPromise(function(_0x57a2cc,_0x214d0a){var _0x257a26=respondWithRpcPromise(_0x9edd('0x24'));var _0x52746a=getAgent(_0x3c2227);Promise[_0x9edd('0x25')]([_0x257a26,_0x52746a])[_0x9edd('0x1b')](function(_0x2ae8dd){var _0x41af53=_0x2ae8dd[0x0];var _0x5eccfb=_0x2ae8dd[0x1];var _0x2155a1=_[_0x9edd('0x26')](_0x41af53[_0x9edd('0x27')],function(_0x12c1bc){return _0x12c1bc[_0x9edd('0x28')]==_0x5eccfb['id']&&_0x12c1bc[_0x9edd('0x29')]==_0x4fe471;});if(_0x2155a1[_0x9edd('0x2a')]==0x1){_0x57a2cc(_0x5eccfb);}else{_0x214d0a(new RangeError(_0x9edd('0x2b')+_0x4fe471+_0x9edd('0x2c')));}});});}exports[_0x9edd('0x2d')]=function(_0x4fd03f,_0x138002){logger[_0x9edd('0x14')](_0x9edd('0x2e'),_0x4fd03f[_0x9edd('0x2f')]);var _0x5af178=originateValidation[_0x9edd('0xd')](_0x4fd03f[_0x9edd('0x2f')]);if(_0x5af178[_0x9edd('0x2a')]>0x0){return _0x138002['status'](0x190)[_0x9edd('0x30')](_0x5af178);}var _0x3990fb=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x21bc30=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x32')];var _0x438a5d=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x33')];var _0x29e789=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x34')];return getAgent(_0x3990fb)[_0x9edd('0x1b')](function(_0x5757fc){logger[_0x9edd('0x14')]('entityFound:',_0x5757fc[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x5757fc[_0x9edd('0x18')]),_0x9edd('0x37'),{'callNumber':_0x21bc30,'callerId':_0x438a5d,'callbackUrl':_0x29e789});return _0x138002['status'](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x38')});})[_0x9edd('0x20')](handleError(_0x138002));};exports[_0x9edd('0x39')]=function(_0x1be77f,_0x337e6c){logger[_0x9edd('0x14')](_0x9edd('0x3a'),_0x1be77f[_0x9edd('0x2f')]);var _0x35c16f=hangupValidation['validate'](_0x1be77f[_0x9edd('0x2f')]);if(_0x35c16f['length']>0x0){return _0x337e6c[_0x9edd('0x3b')](0x190)['json'](_0x35c16f);}var _0x30883e=_0x1be77f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x479661=_0x1be77f[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x30883e)[_0x9edd('0x1b')](function(_0x48958a){logger[_0x9edd('0x14')]('entityFound:',_0x48958a[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')]('user:%s',_0x48958a[_0x9edd('0x18')]),_0x9edd('0x3c'),{'sessionId':_0x479661});return _0x337e6c[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':'hangup\x20executed!'});})[_0x9edd('0x20')](handleError(_0x337e6c));};exports['answer']=function(_0x2bdb3f,_0xc1e657){logger['info'](_0x9edd('0x3d'),_0x2bdb3f['body']);var _0x548299=answerValidation[_0x9edd('0xd')](_0x2bdb3f[_0x9edd('0x2f')]);if(_0x548299[_0x9edd('0x2a')]>0x0){return _0xc1e657[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x548299);}var _0x4737ae=_0x2bdb3f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x18c149=_0x2bdb3f[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x4737ae)[_0x9edd('0x1b')](function(_0x3d5eba){logger[_0x9edd('0x14')](_0x9edd('0x3e'),_0x3d5eba['name']);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x3d5eba[_0x9edd('0x18')]),_0x9edd('0x3f'),{'sessionId':_0x18c149});return _0xc1e657[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x40')});})['catch'](handleError(_0xc1e657));};exports['hold']=function(_0x4bc7a1,_0x4a7dc9){logger['info'](_0x9edd('0x41'),_0x4bc7a1[_0x9edd('0x2f')]);var _0x2b06d3=holdValidation[_0x9edd('0xd')](_0x4bc7a1[_0x9edd('0x2f')]);if(_0x2b06d3['length']>0x0){return _0x4a7dc9[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x2b06d3);}var _0x40e33d=_0x4bc7a1['body'][_0x9edd('0x31')];var _0xfd7bd1=_0x4bc7a1[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x40e33d)[_0x9edd('0x1b')](function(_0x35bdec){logger['info'](_0x9edd('0x3e'),_0x35bdec[_0x9edd('0x18')]);emit(util['format'](_0x9edd('0x36'),_0x35bdec[_0x9edd('0x18')]),'webbar:hold',{'sessionId':_0xfd7bd1});return _0x4a7dc9[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x42')});})['catch'](handleError(_0x4a7dc9));};exports[_0x9edd('0x43')]=function(_0x151157,_0x317a60){logger[_0x9edd('0x14')]('unhold\x20fired:',_0x151157[_0x9edd('0x2f')]);var _0x527727=unholdValidation[_0x9edd('0xd')](_0x151157['body']);if(_0x527727[_0x9edd('0x2a')]>0x0){return _0x317a60[_0x9edd('0x3b')](0x190)['json'](_0x527727);}var _0x8e59bd=_0x151157['body'][_0x9edd('0x31')];var _0xe6b20c=_0x151157[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x8e59bd)[_0x9edd('0x1b')](function(_0x18548e){logger[_0x9edd('0x14')](_0x9edd('0x3e'),_0x18548e[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x18548e['name']),_0x9edd('0x44'),{'sessionId':_0xe6b20c});return _0x317a60[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x9edd('0x20')](handleError(_0x317a60));};exports['calls']=function(_0x54d83d,_0x54ecfa){logger[_0x9edd('0x14')](_0x9edd('0x45'),_0x54ecfa[_0x9edd('0x2f')]);var _0x35ddb3=callsValidation['validate'](_0x54d83d['body']);if(_0x35ddb3['length']>0x0){return _0x54ecfa[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x35ddb3);}var _0xd5090a=_0x54d83d[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x41ec97=respondWithRpcPromise(_0x9edd('0x24'));var _0x1e3087=getAgent(_0xd5090a);return Promise['all']([_0x41ec97,_0x1e3087])[_0x9edd('0x1b')](function(_0x49d0ce){var _0x421e82=_0x49d0ce[0x0];var _0x6a1cfc=_0x49d0ce[0x1];var _0x4b7e68=_[_0x9edd('0x26')](_0x421e82[_0x9edd('0x27')],function(_0x950e53){return _0x950e53['UserId']==_0x6a1cfc['id'];});return _0x54ecfa[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'count':_0x4b7e68[_0x9edd('0x2a')],'rows':_0x4b7e68});})[_0x9edd('0x20')](handleError(_0x54ecfa));};exports[_0x9edd('0x46')]=function(_0x2c3173,_0x53f55b){logger['info'](_0x9edd('0x47'),_0x2c3173['body']);var _0x173ec9=conferenceValidation[_0x9edd('0xd')](_0x2c3173[_0x9edd('0x2f')]);if(_0x173ec9[_0x9edd('0x2a')]>0x0){return _0x53f55b['status'](0x190)[_0x9edd('0x30')](_0x173ec9);}var _0x507cce=_0x2c3173[_0x9edd('0x2f')][_0x9edd('0x31')];return getAgent(_0x507cce)[_0x9edd('0x1b')](function(_0x5ca123){logger[_0x9edd('0x14')]('entityFound:',_0x5ca123[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')]('user:%s',_0x5ca123[_0x9edd('0x18')]),'webbar:conference');return _0x53f55b[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x48')});})['catch'](handleError(_0x53f55b));};exports[_0x9edd('0x49')]=function(_0x321485,_0x45c17d){logger[_0x9edd('0x14')](_0x9edd('0x4a'),_0x321485['body']);var _0x48f017=transferValidation[_0x9edd('0xd')](_0x321485[_0x9edd('0x2f')]);if(_0x48f017['length']>0x0){return _0x45c17d['status'](0x190)['json'](_0x48f017);}var _0x1bc89b=_0x321485['body']['userId'];var _0x3ef9c9=_0x321485[_0x9edd('0x2f')]['sessionId'];var _0xb9ebeb=_0x321485[_0x9edd('0x2f')][_0x9edd('0x4b')];return getAgent(_0x1bc89b)['then'](function(_0x34b229){logger['info'](_0x9edd('0x3e'),_0x34b229[_0x9edd('0x18')]);emit(util['format'](_0x9edd('0x36'),_0x34b229[_0x9edd('0x18')]),'webbar:transfer',{'sessionId':_0x3ef9c9,'transferNumber':_0xb9ebeb});return _0x45c17d[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x4c')});})[_0x9edd('0x20')](handleError(_0x45c17d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9154fb7..3a3eb94 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 _0x01d9=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x4f1e96,_0x3bd758){var _0x974e38=function(_0x470d29){while(--_0x470d29){_0x4f1e96['push'](_0x4f1e96['shift']());}};_0x974e38(++_0x3bd758);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0xa')](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['get'](_0x901d('0x13'),auth['isAuthenticated'](),controller[_0x901d('0x14')]);router[_0x901d('0xa')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x16')]);router['get'](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x18')]);router[_0x901d('0x19')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x1a')]);router['post'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x1b')]);router[_0x901d('0x19')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x1c')]);router[_0x901d('0x19')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x1d')]);router[_0x901d('0x19')](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x1e')]);router[_0x901d('0x19')](_0x901d('0x1f'),controller[_0x901d('0x20')]);router['post'](_0x901d('0x21'),auth[_0x901d('0xd')](),controller['send']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x901d('0x22')]);router[_0x901d('0x23')]('/:id',auth[_0x901d('0xd')](),controller[_0x901d('0x24')]);router['delete'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x25')]);router[_0x901d('0x23')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x26')]);router[_0x901d('0x23')]('/:id/users',auth[_0x901d('0xd')](),controller[_0x901d('0x27')]);module[_0x901d('0x28')]=router; \ No newline at end of file +var _0x2542=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x54fd14,_0xfb2180){var _0x24d2af=function(_0x372a2b){while(--_0x372a2b){_0x54fd14['push'](_0x54fd14['shift']());}};_0x24d2af(++_0xfb2180);}(_0x2542,0x169));var _0x2254=function(_0x303795,_0x10e26d){_0x303795=_0x303795-0x0;var _0x1dfa02=_0x2542[_0x303795];return _0x1dfa02;};'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('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getAnswers']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x9')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['getApplications']);router[_0x2254('0x16')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x16')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x16')](_0x2254('0x12'),auth['isAuthenticated'](),controller[_0x2254('0x18')]);router['post'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x19')]);router[_0x2254('0x16')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2254('0x1a')]);router[_0x2254('0x16')](_0x2254('0x1b'),auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);router[_0x2254('0x1d')]('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x1e')]);router[_0x2254('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2254('0x1f')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x20')]);module[_0x2254('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 4c38b27..990d56c 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 _0x4006=['randomstring','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x4e61dd,_0x1f5e66){var _0x11597d=function(_0x454de8){while(--_0x454de8){_0x4e61dd['push'](_0x4e61dd['shift']());}};_0x11597d(++_0x1f5e66);}(_0x4006,0x1c7));var _0x6400=function(_0xb3bf0f,_0x418c05){_0xb3bf0f=_0xb3bf0f-0x0;var _0x196b2a=_0x4006[_0xb3bf0f];return _0x196b2a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6400('0x0'));module[_0x6400('0x1')]={'name':{'type':Sequelize[_0x6400('0x2')],'unique':_0x6400('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6400('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x6400('0x2')]},'type':{'type':Sequelize['ENUM']('twilio')},'accountSid':{'type':Sequelize[_0x6400('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6400('0x4')],'defaultValue':function(){return _0x6400('0x5');}},'notificationSound':{'type':Sequelize[_0x6400('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6400('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6400('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6400('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6400('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6400('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6400('0x7')],'comment':_0x6400('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6400('0x6')],'defaultValue':![],'comment':_0x6400('0x9'),'set':function(_0x237e22){if(!_0x237e22){this[_0x6400('0xa')](_0x6400('0xb'),null);}this['setDataValue'](_0x6400('0xc'),_0x237e22);}},'description':{'type':Sequelize[_0x6400('0x2')]}}; \ No newline at end of file +var _0xf0fd=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x50a615,_0x269ef6){var _0x1a4369=function(_0x2d7d57){while(--_0x2d7d57){_0x50a615['push'](_0x50a615['shift']());}};_0x1a4369(++_0x269ef6);}(_0xf0fd,0x13d));var _0xdf0f=function(_0x322447,_0x42526a){_0x322447=_0x322447-0x0;var _0x5d47d8=_0xf0fd[_0x322447];return _0x5d47d8;};'use strict';var Sequelize=require(_0xdf0f('0x0'));var rs=require('randomstring');module[_0xdf0f('0x1')]={'name':{'type':Sequelize[_0xdf0f('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xdf0f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xdf0f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xdf0f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdf0f('0x3')]('twilio')},'accountSid':{'type':Sequelize[_0xdf0f('0x2')]},'authToken':{'type':Sequelize[_0xdf0f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xdf0f('0x4')],'defaultValue':function(){return _0xdf0f('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xdf0f('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdf0f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdf0f('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdf0f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdf0f('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf0f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf0f('0x7')],'comment':_0xdf0f('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xdf0f('0x6')],'defaultValue':![],'comment':_0xdf0f('0x9'),'set':function(_0x50388e){if(!_0x50388e){this[_0xdf0f('0xa')](_0xdf0f('0xb'),null);}this[_0xdf0f('0xa')](_0xdf0f('0xc'),_0x50388e);}},'description':{'type':Sequelize[_0xdf0f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 305746b..d0590d1 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 _0x12a4=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','applications','orderBy','asc','account','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','from','From','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','defaults','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','receiveMessage','entity\x20found','stringify','twilio','text/xml','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','fast-json-patch','moment','bluebird','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/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','json','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','map','WhatsappAccount','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','includeAll','find','create','body','user'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x12a4,0x1c3));var _0x412a=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x12a4[_0x2675da];return _0x5e6153;};'use strict';var emlformat=require(_0x412a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x412a('0x1'));var rp=require('request-promise');var moment=require(_0x412a('0x2'));var BPromise=require(_0x412a('0x3'));var Mustache=require('mustache');var util=require(_0x412a('0x4'));var path=require(_0x412a('0x5'));var sox=require(_0x412a('0x6'));var csv=require(_0x412a('0x7'));var ejs=require(_0x412a('0x8'));var fs=require('fs');var fs_extra=require(_0x412a('0x9'));var _=require(_0x412a('0xa'));var squel=require('squel');var crypto=require(_0x412a('0xb'));var jsforce=require(_0x412a('0xc'));var deskjs=require(_0x412a('0xd'));var toCsv=require(_0x412a('0x7'));var querystring=require(_0x412a('0xe'));var Papa=require(_0x412a('0xf'));var Redis=require(_0x412a('0x10'));var authService=require(_0x412a('0x11'));var qs=require(_0x412a('0x12'));var as=require(_0x412a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x412a('0x14'))('api');var utils=require(_0x412a('0x15'));var config=require(_0x412a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x412a('0x17')],{'host':_0x412a('0x18'),'port':0x18eb});var socket=require(_0x412a('0x19'))(new Redis(config[_0x412a('0x17')]));require(_0x412a('0x1a'))['register'](socket);var jayson=require(_0x412a('0x1b'));var client=jayson[_0x412a('0x1c')][_0x412a('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5ad44f,_0x8a0fc7,_0x5839e9,_0x3ecdb3){return new BPromise(function(_0x3651c9,_0x5cfcbe){var _0x4748f0=_0x3ecdb3||client;return _0x4748f0[_0x412a('0x1e')](_0x5ad44f,_0x5839e9)['then'](function(_0xa362c2){logger[_0x412a('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x8a0fc7,_0x412a('0x20'));logger['debug'](_0x412a('0x21'),_0x8a0fc7,_0x412a('0x20'),JSON['stringify'](_0xa362c2));if(_0xa362c2[_0x412a('0x22')]){if(_0xa362c2[_0x412a('0x22')][_0x412a('0x23')]===0x1f4){logger[_0x412a('0x22')](_0x412a('0x24'),_0x8a0fc7,_0xa362c2['error']['message']);return _0x5cfcbe(_0xa362c2[_0x412a('0x22')][_0x412a('0x25')]);}logger[_0x412a('0x22')](_0x412a('0x24'),_0x8a0fc7,_0xa362c2[_0x412a('0x22')][_0x412a('0x25')]);return _0x3651c9(_0xa362c2[_0x412a('0x22')][_0x412a('0x25')]);}else{logger[_0x412a('0x1f')](_0x412a('0x24'),_0x8a0fc7,_0x412a('0x20'));_0x3651c9(_0xa362c2[_0x412a('0x26')][_0x412a('0x25')]);}})[_0x412a('0x27')](function(_0x17096a){logger[_0x412a('0x22')](_0x412a('0x24'),_0x8a0fc7,_0x17096a);_0x5cfcbe(_0x17096a);});});}function respondWithStatusCode(_0x18d383,_0x19b69a){_0x19b69a=_0x19b69a||0xcc;return function(_0x5aa27e){if(_0x5aa27e){return _0x18d383['sendStatus'](_0x19b69a);}return _0x18d383[_0x412a('0x28')](_0x19b69a)[_0x412a('0x29')]();};}function respondWithResult(_0x2c9c2b,_0x534542){_0x534542=_0x534542||0xc8;return function(_0x37f049){if(_0x37f049){return _0x2c9c2b[_0x412a('0x28')](_0x534542)['json'](_0x37f049);}};}function respondWithFilteredResult(_0x3a1387,_0x15ca57){return function(_0x55c651){if(_0x55c651){var _0x1150ad=typeof _0x15ca57[_0x412a('0x2a')]===_0x412a('0x2b')&&typeof _0x15ca57[_0x412a('0x2c')]==='undefined';var _0x108a02=_0x55c651[_0x412a('0x2d')];var _0x40af15=_0x1150ad?0x0:_0x15ca57[_0x412a('0x2a')];var _0x342968=_0x1150ad?_0x55c651[_0x412a('0x2d')]:_0x15ca57[_0x412a('0x2a')]+_0x15ca57[_0x412a('0x2c')];var _0x397b85;if(_0x342968>=_0x108a02){_0x342968=_0x108a02;_0x397b85=0xc8;}else{_0x397b85=0xce;}_0x3a1387[_0x412a('0x28')](_0x397b85);return _0x3a1387[_0x412a('0x2e')]('Content-Range',_0x40af15+'-'+_0x342968+'/'+_0x108a02)[_0x412a('0x2f')](_0x55c651);}return null;};}function patchUpdates(_0x2374e4){return function(_0x351629){try{jsonpatch['apply'](_0x351629,_0x2374e4,!![]);}catch(_0x11a6bd){return BPromise['reject'](_0x11a6bd);}return _0x351629[_0x412a('0x30')]();};}function saveUpdates(_0x1ba88b,_0x36f5bd){return function(_0x5a4f11){if(_0x5a4f11){return _0x5a4f11[_0x412a('0x31')](_0x1ba88b)[_0x412a('0x32')](function(_0x1d01a8){return _0x1d01a8;});}return null;};}function removeEntity(_0x441b97,_0x58ade0){return function(_0x50e7ea){if(_0x50e7ea){return _0x50e7ea[_0x412a('0x33')]()[_0x412a('0x32')](function(){var _0x32616c=_0x50e7ea[_0x412a('0x34')]({'plain':!![]});var _0x466334=_0x412a('0x35');return db[_0x412a('0x36')]['destroy']({'where':{'type':_0x466334,'resourceId':_0x32616c['id']}})['then'](function(){return _0x50e7ea;});})['then'](function(){_0x441b97[_0x412a('0x28')](0xcc)[_0x412a('0x29')]();});}};}function handleEntityNotFound(_0x4491a2,_0x376bfa){return function(_0x448805){if(!_0x448805){_0x4491a2['sendStatus'](0x194);}return _0x448805;};}function handleError(_0x2796f4,_0x30e88a){_0x30e88a=_0x30e88a||0x1f4;return function(_0x4825d6){logger[_0x412a('0x22')](_0x4825d6[_0x412a('0x37')]);if(_0x4825d6[_0x412a('0x38')]){delete _0x4825d6[_0x412a('0x38')];}_0x2796f4[_0x412a('0x28')](_0x30e88a)[_0x412a('0x39')](_0x4825d6);};}exports[_0x412a('0x3a')]=function(_0x1d799b,_0x38934a){var _0x477ba0={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xc48100={},_0x35330a={'count':0x0,'rows':[]};var _0x2af545=_[_0x412a('0x3b')](db[_0x412a('0x3c')]['rawAttributes'],function(_0x41feac){return{'name':_0x41feac[_0x412a('0x3d')],'type':_0x41feac[_0x412a('0x3e')]['key']};});_0xc48100['model']=_['map'](_0x2af545,'name');_0xc48100[_0x412a('0x3f')]=_['keys'](_0x1d799b[_0x412a('0x3f')]);_0xc48100[_0x412a('0x40')]=_[_0x412a('0x41')](_0xc48100[_0x412a('0x42')],_0xc48100['query']);_0x477ba0[_0x412a('0x43')]=_['intersection'](_0xc48100[_0x412a('0x42')],qs[_0x412a('0x44')](_0x1d799b[_0x412a('0x3f')][_0x412a('0x44')]));_0x477ba0[_0x412a('0x43')]=_0x477ba0[_0x412a('0x43')][_0x412a('0x45')]?_0x477ba0[_0x412a('0x43')]:_0xc48100[_0x412a('0x42')];if(!_0x1d799b[_0x412a('0x3f')][_0x412a('0x46')](_0x412a('0x47'))){_0x477ba0['limit']=qs['limit'](_0x1d799b['query'][_0x412a('0x2c')]);_0x477ba0[_0x412a('0x2a')]=qs['offset'](_0x1d799b[_0x412a('0x3f')][_0x412a('0x2a')]);}_0x477ba0[_0x412a('0x48')]=qs['sort'](_0x1d799b[_0x412a('0x3f')][_0x412a('0x49')]);_0x477ba0[_0x412a('0x4a')]=qs[_0x412a('0x40')](_[_0x412a('0x4b')](_0x1d799b['query'],_0xc48100[_0x412a('0x40')]),_0x2af545);if(_0x1d799b['query'][_0x412a('0x4c')]){_0x477ba0[_0x412a('0x4a')]=_[_0x412a('0x4d')](_0x477ba0['where'],{'$or':_['map'](_0x2af545,function(_0x8d0167){if(_0x8d0167[_0x412a('0x3e')]!==_0x412a('0x4e')){var _0x5b6a63={};_0x5b6a63[_0x8d0167['name']]={'$like':'%'+_0x1d799b[_0x412a('0x3f')][_0x412a('0x4c')]+'%'};return _0x5b6a63;}})});}_0x477ba0=_[_0x412a('0x4d')]({},_0x477ba0,_0x1d799b[_0x412a('0x4f')]);var _0x5e6749={'where':_0x477ba0[_0x412a('0x4a')]};return db[_0x412a('0x3c')][_0x412a('0x2d')](_0x5e6749)[_0x412a('0x32')](function(_0x1692e5){_0x35330a[_0x412a('0x2d')]=_0x1692e5;if(_0x1d799b[_0x412a('0x3f')]['includeAll']){_0x477ba0[_0x412a('0x50')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x477ba0);})['then'](function(_0x44057a){_0x35330a[_0x412a('0x51')]=_0x44057a;return _0x35330a;})[_0x412a('0x32')](respondWithFilteredResult(_0x38934a,_0x477ba0))[_0x412a('0x27')](handleError(_0x38934a,null));};exports[_0x412a('0x52')]=function(_0x127335,_0x194854){var _0x45f00c={'raw':![],'where':{'id':_0x127335[_0x412a('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x412a('0x54')}]},_0x4ba323={};_0x4ba323[_0x412a('0x42')]=_[_0x412a('0x55')](db['WhatsappAccount'][_0x412a('0x56')]);_0x4ba323[_0x412a('0x3f')]=_['keys'](_0x127335[_0x412a('0x3f')]);_0x4ba323['filters']=_[_0x412a('0x41')](_0x4ba323[_0x412a('0x42')],_0x4ba323[_0x412a('0x3f')]);_0x45f00c[_0x412a('0x43')]=_[_0x412a('0x41')](_0x4ba323[_0x412a('0x42')],qs[_0x412a('0x44')](_0x127335['query']['fields']));_0x45f00c['attributes']=_0x45f00c[_0x412a('0x43')][_0x412a('0x45')]?_0x45f00c[_0x412a('0x43')]:_0x4ba323[_0x412a('0x42')];if(_0x127335[_0x412a('0x3f')][_0x412a('0x57')]){_0x45f00c['include']=[{'all':!![]}];}_0x45f00c=_[_0x412a('0x4d')]({},_0x45f00c,_0x127335[_0x412a('0x4f')]);return db[_0x412a('0x3c')][_0x412a('0x58')](_0x45f00c)[_0x412a('0x32')](handleEntityNotFound(_0x194854,null))[_0x412a('0x32')](respondWithResult(_0x194854,null))[_0x412a('0x27')](handleError(_0x194854,null));};exports[_0x412a('0x59')]=function(_0x36e485,_0xa721f8){return db[_0x412a('0x3c')][_0x412a('0x59')](_0x36e485[_0x412a('0x5a')],{})[_0x412a('0x32')](function(_0x5705c6){var _0xba121d=_0x36e485[_0x412a('0x5b')]['get']({'plain':!![]});if(!_0xba121d)throw new Error(_0x412a('0x5c'));if(_0xba121d['role']===_0x412a('0x5b')){var _0x3e10b0=_0x5705c6['get']({'plain':!![]});var _0x5942a1=_0x412a('0x35');return db[_0x412a('0x5d')]['find']({'where':{'name':_0x5942a1,'userProfileId':_0xba121d[_0x412a('0x5e')]},'raw':!![]})[_0x412a('0x32')](function(_0xa57506){if(_0xa57506&&_0xa57506[_0x412a('0x5f')]===0x0){return db[_0x412a('0x36')]['create']({'name':_0x3e10b0['name'],'resourceId':_0x3e10b0['id'],'type':_0xa57506['name'],'sectionId':_0xa57506['id']},{})[_0x412a('0x32')](function(){return _0x5705c6;});}else{return _0x5705c6;}})[_0x412a('0x27')](function(_0x35f311){logger['error'](_0x412a('0x60'),_0x35f311);throw _0x35f311;});}return _0x5705c6;})[_0x412a('0x32')](respondWithResult(_0xa721f8,0xc9))['catch'](handleError(_0xa721f8,null));};exports[_0x412a('0x31')]=function(_0x5defb7,_0x582874){if(_0x5defb7[_0x412a('0x5a')]['id']){delete _0x5defb7[_0x412a('0x5a')]['id'];}return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x5defb7[_0x412a('0x53')]['id']},'include':[{'model':db[_0x412a('0x61')],'as':_0x412a('0x54')}]})[_0x412a('0x32')](handleEntityNotFound(_0x582874,null))[_0x412a('0x32')](saveUpdates(_0x5defb7['body'],null))[_0x412a('0x32')](respondWithResult(_0x582874,null))[_0x412a('0x27')](handleError(_0x582874,null));};exports[_0x412a('0x33')]=function(_0x5b8003,_0x1424e4){return db['WhatsappAccount'][_0x412a('0x58')]({'where':{'id':_0x5b8003['params']['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x1424e4,null))[_0x412a('0x32')](removeEntity(_0x1424e4,null))[_0x412a('0x27')](handleError(_0x1424e4,null));};exports[_0x412a('0x62')]=function(_0x2dd37,_0x540a0c){return db[_0x412a('0x3c')]['describe']()['then'](respondWithResult(_0x540a0c,null))['catch'](handleError(_0x540a0c,null));};exports['addDisposition']=function(_0x2ac55f,_0x4e2040,_0x120b0a){if(_0x2ac55f[_0x412a('0x5a')]['id']){delete _0x2ac55f['body']['id'];}return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x2ac55f['params']['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x4e2040,null))[_0x412a('0x32')](function(_0x14077b){if(_0x14077b){_0x2ac55f[_0x412a('0x5a')][_0x412a('0x63')]=_0x14077b['id'];return db[_0x412a('0x64')][_0x412a('0x59')](_0x2ac55f[_0x412a('0x5a')]);}})[_0x412a('0x32')](respondWithResult(_0x4e2040,null))[_0x412a('0x27')](handleError(_0x4e2040,null));};exports[_0x412a('0x65')]=function(_0x39556d,_0x5c90cd,_0x323011){var _0x2018eb={'raw':![],'where':{}};var _0x3f2c05={};var _0x240468={'count':0x0,'rows':[]};return db[_0x412a('0x3c')][_0x412a('0x66')]({'where':{'id':_0x39556d[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x5c90cd,null))['then'](function(_0x42b181){if(_0x42b181){_0x3f2c05[_0x412a('0x42')]=_[_0x412a('0x55')](db[_0x412a('0x64')][_0x412a('0x56')]);_0x3f2c05[_0x412a('0x3f')]=_[_0x412a('0x55')](_0x39556d[_0x412a('0x3f')]);_0x3f2c05[_0x412a('0x40')]=_[_0x412a('0x41')](_0x3f2c05['model'],_0x3f2c05[_0x412a('0x3f')]);_0x2018eb[_0x412a('0x43')]=_[_0x412a('0x41')](_0x3f2c05[_0x412a('0x42')],qs[_0x412a('0x44')](_0x39556d[_0x412a('0x3f')][_0x412a('0x44')]));_0x2018eb[_0x412a('0x43')]=_0x2018eb[_0x412a('0x43')]['length']?_0x2018eb['attributes']:_0x3f2c05[_0x412a('0x42')];if(!_0x39556d['query'][_0x412a('0x46')](_0x412a('0x47'))){_0x2018eb[_0x412a('0x2c')]=qs['limit'](_0x39556d[_0x412a('0x3f')][_0x412a('0x2c')]);_0x2018eb[_0x412a('0x2a')]=qs[_0x412a('0x2a')](_0x39556d['query']['offset']);}_0x2018eb['order']=qs['sort'](_0x39556d[_0x412a('0x3f')][_0x412a('0x49')]);_0x2018eb[_0x412a('0x4a')]=qs[_0x412a('0x40')](_[_0x412a('0x4b')](_0x39556d['query'],_0x3f2c05[_0x412a('0x40')]));_0x2018eb[_0x412a('0x4a')]['WhatsappAccountId']=_0x42b181['id'];if(_0x39556d[_0x412a('0x3f')][_0x412a('0x4c')]){_0x2018eb[_0x412a('0x4a')]=_[_0x412a('0x4d')](_0x2018eb[_0x412a('0x4a')],{'$or':_[_0x412a('0x3b')](_0x2018eb['attributes'],function(_0x5623ec){var _0x341681={};_0x341681[_0x5623ec]={'$like':'%'+_0x39556d[_0x412a('0x3f')][_0x412a('0x4c')]+'%'};return _0x341681;})});}_0x2018eb=_['merge']({},_0x2018eb,_0x39556d[_0x412a('0x4f')]);return db['Disposition'][_0x412a('0x2d')]({'where':_0x2018eb[_0x412a('0x4a')]})[_0x412a('0x32')](function(_0x475fa9){_0x240468['count']=_0x475fa9;if(_0x39556d[_0x412a('0x3f')][_0x412a('0x57')]){_0x2018eb[_0x412a('0x50')]=[{'all':!![]}];}return db[_0x412a('0x64')][_0x412a('0x67')](_0x2018eb);})['then'](function(_0x9f60){_0x240468[_0x412a('0x51')]=_0x9f60;return _0x240468;});}})[_0x412a('0x32')](respondWithFilteredResult(_0x5c90cd,_0x2018eb))[_0x412a('0x27')](handleError(_0x5c90cd,null));};exports[_0x412a('0x68')]=function(_0x3b6361,_0x224543,_0x4848cb){return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x3b6361[_0x412a('0x53')]['id']}})['then'](handleEntityNotFound(_0x224543,null))[_0x412a('0x32')](function(_0x57f9f1){if(_0x57f9f1){return _0x57f9f1['removeDispositions'](_0x3b6361[_0x412a('0x3f')]['ids']);}})[_0x412a('0x32')](respondWithStatusCode(_0x224543,null))[_0x412a('0x27')](handleError(_0x224543,null));};exports[_0x412a('0x69')]=function(_0x28d0b3,_0xe10025,_0x319edd){if(_0x28d0b3[_0x412a('0x5a')]['id']){delete _0x28d0b3[_0x412a('0x5a')]['id'];}return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x28d0b3[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0xe10025,null))['then'](function(_0x3f8a3f){if(_0x3f8a3f){_0x28d0b3[_0x412a('0x5a')][_0x412a('0x63')]=_0x3f8a3f['id'];return db[_0x412a('0x6a')][_0x412a('0x59')](_0x28d0b3[_0x412a('0x5a')]);}})[_0x412a('0x32')](respondWithResult(_0xe10025,null))[_0x412a('0x27')](handleError(_0xe10025,null));};exports[_0x412a('0x6b')]=function(_0x165eac,_0x3f2d16,_0x140668){var _0x299702={'raw':![],'where':{}};var _0x197b2b={};var _0x787b9d={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x165eac[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x3f2d16,null))[_0x412a('0x32')](function(_0x4616eb){if(_0x4616eb){_0x197b2b[_0x412a('0x42')]=_[_0x412a('0x55')](db[_0x412a('0x6a')][_0x412a('0x56')]);_0x197b2b['query']=_['keys'](_0x165eac[_0x412a('0x3f')]);_0x197b2b[_0x412a('0x40')]=_[_0x412a('0x41')](_0x197b2b[_0x412a('0x42')],_0x197b2b[_0x412a('0x3f')]);_0x299702[_0x412a('0x43')]=_[_0x412a('0x41')](_0x197b2b[_0x412a('0x42')],qs['fields'](_0x165eac[_0x412a('0x3f')]['fields']));_0x299702[_0x412a('0x43')]=_0x299702[_0x412a('0x43')][_0x412a('0x45')]?_0x299702['attributes']:_0x197b2b[_0x412a('0x42')];if(!_0x165eac[_0x412a('0x3f')][_0x412a('0x46')](_0x412a('0x47'))){_0x299702[_0x412a('0x2c')]=qs['limit'](_0x165eac[_0x412a('0x3f')][_0x412a('0x2c')]);_0x299702[_0x412a('0x2a')]=qs[_0x412a('0x2a')](_0x165eac[_0x412a('0x3f')]['offset']);}_0x299702[_0x412a('0x48')]=qs[_0x412a('0x49')](_0x165eac['query'][_0x412a('0x49')]);_0x299702[_0x412a('0x4a')]=qs[_0x412a('0x40')](_['pick'](_0x165eac[_0x412a('0x3f')],_0x197b2b[_0x412a('0x40')]));_0x299702[_0x412a('0x4a')][_0x412a('0x63')]=_0x4616eb['id'];if(_0x165eac[_0x412a('0x3f')][_0x412a('0x4c')]){_0x299702['where']=_['merge'](_0x299702[_0x412a('0x4a')],{'$or':_[_0x412a('0x3b')](_0x299702['attributes'],function(_0x305a6f){var _0x236dfd={};_0x236dfd[_0x305a6f]={'$like':'%'+_0x165eac[_0x412a('0x3f')][_0x412a('0x4c')]+'%'};return _0x236dfd;})});}_0x299702=_[_0x412a('0x4d')]({},_0x299702,_0x165eac[_0x412a('0x4f')]);return db['CannedAnswer']['count']({'where':_0x299702['where']})[_0x412a('0x32')](function(_0x4dc16f){_0x787b9d[_0x412a('0x2d')]=_0x4dc16f;if(_0x165eac[_0x412a('0x3f')][_0x412a('0x57')]){_0x299702[_0x412a('0x50')]=[{'all':!![]}];}return db[_0x412a('0x6a')][_0x412a('0x67')](_0x299702);})[_0x412a('0x32')](function(_0x2c39e6){_0x787b9d[_0x412a('0x51')]=_0x2c39e6;return _0x787b9d;});}})['then'](respondWithFilteredResult(_0x3f2d16,_0x299702))['catch'](handleError(_0x3f2d16,null));};exports[_0x412a('0x6c')]=function(_0x1238fb,_0x52467c,_0xb54e0e){return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x1238fb[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x52467c,null))[_0x412a('0x32')](function(_0x2bdf9a){if(_0x2bdf9a){return _0x2bdf9a[_0x412a('0x6c')](_0x1238fb['query'][_0x412a('0x6d')]);}})['then'](respondWithStatusCode(_0x52467c,null))[_0x412a('0x27')](handleError(_0x52467c,null));};exports['addAgents']=function(_0x2c638f,_0x1a1fac,_0x53a41b){return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x2c638f[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x1a1fac,null))[_0x412a('0x32')](function(_0x7b8855){if(_0x7b8855){return _0x7b8855[_0x412a('0x6e')](_0x2c638f[_0x412a('0x5a')][_0x412a('0x6d')],_[_0x412a('0x6f')](_0x2c638f[_0x412a('0x5a')],[_0x412a('0x6d'),'id'])||{})[_0x412a('0x70')](function(_0x244e4a){for(var _0x183721=0x0;_0x183721<_0x2c638f[_0x412a('0x5a')]['ids'][_0x412a('0x45')];_0x183721+=0x1){socket[_0x412a('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x2c638f[_0x412a('0x5a')][_0x412a('0x6d')][_0x183721]),'WhatsappAccountId':Number(_0x2c638f[_0x412a('0x53')]['id'])});}return _0x244e4a;});}})[_0x412a('0x32')](respondWithResult(_0x1a1fac,null))[_0x412a('0x27')](handleError(_0x1a1fac,null));};exports[_0x412a('0x72')]=function(_0x350444,_0x30b031,_0x11b0cf){return db[_0x412a('0x3c')][_0x412a('0x58')]({'where':{'id':_0x350444['params']['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x30b031,null))[_0x412a('0x32')](function(_0x4aa6cd){if(_0x4aa6cd){return _0x4aa6cd['removeAgents'](_0x350444['query'][_0x412a('0x6d')])[_0x412a('0x32')](function(){if(_['isArray'](_0x350444['query'][_0x412a('0x6d')])){for(var _0x131ae5=0x0;_0x131ae5<_0x350444[_0x412a('0x3f')]['ids']['length'];_0x131ae5+=0x1){socket[_0x412a('0x71')](_0x412a('0x73'),{'UserId':Number(_0x350444[_0x412a('0x3f')][_0x412a('0x6d')][_0x131ae5]),'WhatsappAccountId':Number(_0x350444[_0x412a('0x53')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x350444[_0x412a('0x3f')]['ids']),'WhatsappAccountId':Number(_0x350444[_0x412a('0x53')]['id'])});}});}})[_0x412a('0x32')](respondWithStatusCode(_0x30b031,null))[_0x412a('0x27')](handleError(_0x30b031,null));};exports[_0x412a('0x74')]=function(_0x1c4e59,_0x2d4fe6,_0x213b06){var _0xb1747d={};var _0x23acd4={};var _0x564a24;var _0x27b8f4;return db['WhatsappAccount'][_0x412a('0x66')]({'where':{'id':_0x1c4e59[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x2d4fe6,null))[_0x412a('0x32')](function(_0x3affce){if(_0x3affce){_0x564a24=_0x3affce;_0x23acd4['model']=_['keys'](db['User'][_0x412a('0x56')]);_0x23acd4[_0x412a('0x3f')]=_[_0x412a('0x55')](_0x1c4e59[_0x412a('0x3f')]);_0x23acd4[_0x412a('0x40')]=_[_0x412a('0x41')](_0x23acd4[_0x412a('0x42')],_0x23acd4[_0x412a('0x3f')]);_0xb1747d['attributes']=_[_0x412a('0x41')](_0x23acd4[_0x412a('0x42')],qs['fields'](_0x1c4e59['query'][_0x412a('0x44')]));_0xb1747d['attributes']=_0xb1747d[_0x412a('0x43')][_0x412a('0x45')]?_0xb1747d[_0x412a('0x43')]:_0x23acd4[_0x412a('0x42')];_0xb1747d['order']=qs[_0x412a('0x49')](_0x1c4e59['query'][_0x412a('0x49')]);_0xb1747d['where']=qs[_0x412a('0x40')](_[_0x412a('0x4b')](_0x1c4e59[_0x412a('0x3f')],_0x23acd4[_0x412a('0x40')]));if(_0x1c4e59[_0x412a('0x3f')][_0x412a('0x4c')]){_0xb1747d[_0x412a('0x4a')]=_[_0x412a('0x4d')](_0xb1747d[_0x412a('0x4a')],{'$or':_[_0x412a('0x3b')](_0xb1747d[_0x412a('0x43')],function(_0x4e5491){var _0x1bb296={};_0x1bb296[_0x4e5491]={'$like':'%'+_0x1c4e59['query'][_0x412a('0x4c')]+'%'};return _0x1bb296;})});}_0xb1747d=_[_0x412a('0x4d')]({},_0xb1747d,_0x1c4e59[_0x412a('0x4f')]);return _0x564a24['getAgents'](_0xb1747d);}})[_0x412a('0x32')](function(_0x35b84e){if(_0x35b84e){_0x27b8f4=_0x35b84e[_0x412a('0x45')];if(!_0x1c4e59[_0x412a('0x3f')][_0x412a('0x46')](_0x412a('0x47'))){_0xb1747d[_0x412a('0x2c')]=qs[_0x412a('0x2c')](_0x1c4e59[_0x412a('0x3f')][_0x412a('0x2c')]);_0xb1747d[_0x412a('0x2a')]=qs['offset'](_0x1c4e59[_0x412a('0x3f')][_0x412a('0x2a')]);}return _0x564a24[_0x412a('0x74')](_0xb1747d);}})[_0x412a('0x32')](function(_0x3b7e65){if(_0x3b7e65){return _0x3b7e65?{'count':_0x27b8f4,'rows':_0x3b7e65}:null;}})[_0x412a('0x32')](respondWithResult(_0x2d4fe6,null))['catch'](handleError(_0x2d4fe6,null));};exports[_0x412a('0x75')]=function(_0x5bb857,_0x247d78,_0xda61fc){return db['WhatsappAccount'][_0x412a('0x66')]({'where':{'id':_0x5bb857[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x247d78,null))[_0x412a('0x32')](function(_0x1a2634){if(_0x1a2634){return db[_0x412a('0x76')][_0x412a('0x77')](function(_0x15b189){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x5bb857[_0x412a('0x53')]['id']},'transaction':_0x15b189})['then'](function(_0x54752b){var _0x129565=_[_0x412a('0x3b')](_0x5bb857[_0x412a('0x5a')],function(_0x21efe5){_0x21efe5[_0x412a('0x63')]=_0x5bb857[_0x412a('0x53')]['id'];return _0x21efe5;});return db[_0x412a('0x78')][_0x412a('0x79')](_0x129565,{'transaction':_0x15b189});});})[_0x412a('0x32')](function(){return db['WhatsappApplication'][_0x412a('0x7a')]({'where':{'WhatsappAccountId':_0x5bb857[_0x412a('0x53')]['id']},'order':_0x412a('0x7b')});});}})['then'](respondWithResult(_0x247d78,null))['catch'](handleError(_0x247d78,null));};exports[_0x412a('0x7c')]=function(_0x457e45,_0x9d1488,_0x30ef31){var _0xce02e0={};var _0x33de52={};var _0x23bc19;var _0x4c9686;return db[_0x412a('0x3c')][_0x412a('0x66')]({'where':{'id':_0x457e45[_0x412a('0x53')]['id']}})[_0x412a('0x32')](handleEntityNotFound(_0x9d1488,null))[_0x412a('0x32')](function(_0x3c85e2){if(_0x3c85e2){_0x23bc19=_0x3c85e2;_0x33de52['model']=_[_0x412a('0x55')](db[_0x412a('0x78')][_0x412a('0x56')]);_0x33de52[_0x412a('0x3f')]=_[_0x412a('0x55')](_0x457e45['query']);_0x33de52['filters']=_[_0x412a('0x41')](_0x33de52[_0x412a('0x42')],_0x33de52[_0x412a('0x3f')]);_0xce02e0[_0x412a('0x43')]=_[_0x412a('0x41')](_0x33de52[_0x412a('0x42')],qs[_0x412a('0x44')](_0x457e45[_0x412a('0x3f')][_0x412a('0x44')]));_0xce02e0[_0x412a('0x43')]=_0xce02e0[_0x412a('0x43')][_0x412a('0x45')]?_0xce02e0[_0x412a('0x43')]:_0x33de52[_0x412a('0x42')];_0xce02e0['order']=qs[_0x412a('0x49')](_0x457e45['query']['sort']);_0xce02e0['where']=qs[_0x412a('0x40')](_[_0x412a('0x4b')](_0x457e45[_0x412a('0x3f')],_0x33de52[_0x412a('0x40')]));if(_0x457e45[_0x412a('0x3f')]['filter']){_0xce02e0[_0x412a('0x4a')]=_[_0x412a('0x4d')](_0xce02e0[_0x412a('0x4a')],{'$or':_[_0x412a('0x3b')](_0xce02e0[_0x412a('0x43')],function(_0x2ab7ae){var _0x1ee726={};_0x1ee726[_0x2ab7ae]={'$like':'%'+_0x457e45[_0x412a('0x3f')][_0x412a('0x4c')]+'%'};return _0x1ee726;})});}_0xce02e0=_[_0x412a('0x4d')]({},_0xce02e0,_0x457e45['options']);return _0x23bc19[_0x412a('0x7c')](_0xce02e0);}})[_0x412a('0x32')](function(_0x115b44){if(_0x115b44){_0x4c9686=_0x115b44['length'];if(!_0x457e45[_0x412a('0x3f')][_0x412a('0x46')](_0x412a('0x47'))){_0xce02e0[_0x412a('0x2c')]=qs[_0x412a('0x2c')](_0x457e45[_0x412a('0x3f')][_0x412a('0x2c')]);_0xce02e0['offset']=qs['offset'](_0x457e45['query'][_0x412a('0x2a')]);}return _0x23bc19['getApplications'](_0xce02e0);}})[_0x412a('0x32')](function(_0x43f8ca){if(_0x43f8ca){return _0x43f8ca?{'count':_0x4c9686,'rows':_0x43f8ca}:null;}})[_0x412a('0x32')](respondWithResult(_0x9d1488,null))[_0x412a('0x27')](handleError(_0x9d1488,null));};exports['notify']=function(_0x1cca7b,_0x2abb96,_0x3f44f8){var _0x131d73={'channel':_0x412a('0x7d')};var _0x1630b2=[];var _0x3ea679=[];var _0x1f01c6={};return db['WhatsappAccount'][_0x412a('0x58')]({'where':{'id':_0x1cca7b['params']['id']},'include':[{'model':db[_0x412a('0x78')],'as':_0x412a('0x7e')}]})['then'](handleEntityNotFound(_0x2abb96,null))[_0x412a('0x32')](function(_0x5e59bd){_0x131d73['account']=_0x5e59bd;_0x131d73[_0x412a('0x7f')]=_[_0x412a('0x80')](_0x5e59bd[_0x412a('0x7e')],[_0x412a('0x7b')],[_0x412a('0x81')]);if(_0x131d73[_0x412a('0x82')][_0x412a('0x7e')]){delete _0x131d73[_0x412a('0x82')][_0x412a('0x7e')];}return db['CmContact'][_0x412a('0x62')]();})[_0x412a('0x32')](function(_0x45ed5f){if(!_0x45ed5f){throw new db[(_0x412a('0x83'))]['ValidationError'](_0x412a('0x84'));}_0x1630b2=_[_0x412a('0x85')](_[_0x412a('0x55')](_0x45ed5f),['createdAt',_0x412a('0x86')]);_0x3ea679=_[_0x412a('0x85')](_[_0x412a('0x55')](_0x45ed5f),[_0x412a('0x87'),_0x412a('0x86'),'CompanyId',_0x412a('0x88')]);_0x131d73[_0x412a('0x5a')]={'mapKey':_0x412a('0x89')};if(_0x131d73[_0x412a('0x82')]['type']&&_0x131d73[_0x412a('0x82')][_0x412a('0x3e')]==='twilio'){_0x131d73[_0x412a('0x5a')][_0x412a('0x8a')]=_0x1cca7b[_0x412a('0x5a')][_0x412a('0x8b')]['replace'](_0x412a('0x8c'),'');_0x131d73[_0x412a('0x5a')][_0x412a('0x5a')]=_0x1cca7b[_0x412a('0x5a')][_0x412a('0x8d')];_0x131d73['body'][_0x412a('0x8e')]=_0x1cca7b['body'][_0x412a('0x8f')];}if(_0x131d73[_0x412a('0x5a')]['id']){delete _0x131d73[_0x412a('0x5a')]['id'];}if(_[_0x412a('0x90')](_0x131d73[_0x412a('0x5a')][_0x412a('0x8a')])){throw new db[(_0x412a('0x83'))]['ValidationError'](_0x412a('0x91'));}if(_[_0x412a('0x90')](_0x131d73[_0x412a('0x5a')]['body'])||_0x131d73[_0x412a('0x5a')][_0x412a('0x5a')]===''){throw new db[(_0x412a('0x83'))][(_0x412a('0x92'))](_0x412a('0x93'));}if(_['isNil'](_0x131d73[_0x412a('0x5a')][_0x412a('0x94')])){throw new db[(_0x412a('0x83'))][(_0x412a('0x92'))](_0x412a('0x95')+_0x3ea679);}if(!_[_0x412a('0x96')](_0x3ea679,_0x131d73[_0x412a('0x5a')][_0x412a('0x94')])){throw new db[(_0x412a('0x83'))][(_0x412a('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ea679);}_0x1f01c6[_0x131d73['body'][_0x412a('0x94')]]=_0x131d73['body'][_0x412a('0x8a')];return db['CmList']['find']({'where':{'id':_0x131d73['account'][_0x412a('0x88')]},'include':[{'model':db[_0x412a('0x97')],'as':_0x412a('0x98'),'where':_0x1f01c6,'limit':0x1,'order':[[_0x412a('0x86'),_0x412a('0x99')]]}]});})['then'](handleEntityNotFound(_0x2abb96,null))[_0x412a('0x32')](function(_0x374638){if(_0x374638){_0x131d73['list']=_[_0x412a('0x6f')](_0x374638,[_0x412a('0x98')]);if(_0x374638[_0x412a('0x98')][_0x412a('0x45')]){return _0x374638['Contacts'][0x0];}var _0x4e1de0=_[_0x412a('0x9a')](_0x131d73[_0x412a('0x5a')],{'firstName':_0x131d73['body'][_0x412a('0x8a')],'ListId':_0x374638['id']});_0x4e1de0[_0x131d73[_0x412a('0x5a')][_0x412a('0x94')]]=_0x131d73[_0x412a('0x5a')][_0x412a('0x8a')];return db[_0x412a('0x97')][_0x412a('0x59')](_0x4e1de0,{'fields':_0x1630b2,'raw':!![]});}})[_0x412a('0x32')](handleEntityNotFound(_0x2abb96,null))['then'](function(_0x51b239){if(_0x51b239){_0x131d73[_0x412a('0x9b')]=_0x51b239;var _0x154d0e={'ContactId':_0x51b239['id'],'phone':_0x131d73[_0x412a('0x5a')][_0x412a('0x8a')],'WhatsappAccountId':_0x1cca7b[_0x412a('0x53')]['id']};var _0x490950={'ContactId':_0x51b239['id'],'WhatsappAccountId':_0x1cca7b[_0x412a('0x53')]['id'],'closed':![]};return db[_0x412a('0x9c')][_0x412a('0x58')]({'where':_0x490950})[_0x412a('0x32')](function(_0x3955aa){if(_0x3955aa){return[_0x3955aa,![]];}return db[_0x412a('0x9c')][_0x412a('0x59')](_0x154d0e)[_0x412a('0x32')](function(_0x492842){return[_0x492842,!![]];});});}})['spread'](function(_0x28f605,_0x47a551){_0x131d73[_0x412a('0x9d')]=_0x28f605[_0x412a('0x34')]({'plain':!![]});_0x131d73[_0x412a('0x9d')]['created']=![];if(_0x47a551){if(_0x131d73['account'][_0x412a('0x9e')]){_0x131d73[_0x412a('0x7f')][_0x412a('0x9f')]({'id':0x0,'priority':_0x131d73[_0x412a('0x7f')][_0x412a('0x45')]+0x1,'app':'close','appdata':_0x412a('0xa0'),'interval':_0x412a('0xa1')});}_0x131d73[_0x412a('0x9d')][_0x412a('0xa2')]=!![];}return db[_0x412a('0xa3')][_0x412a('0x59')]({'phone':_0x131d73[_0x412a('0x5a')][_0x412a('0x8a')],'messageId':_0x131d73[_0x412a('0x5a')][_0x412a('0x8e')],'body':_0x131d73[_0x412a('0x5a')][_0x412a('0x5a')],'WhatsappAccountId':_0x1cca7b[_0x412a('0x53')]['id'],'WhatsappInteractionId':_0x28f605['id'],'direction':'in','ContactId':_0x28f605[_0x412a('0xa4')],'AttachmentId':_0x131d73[_0x412a('0x5a')][_0x412a('0xa5')]});})[_0x412a('0x32')](function(_0xd99734){_0x131d73['message']=_0xd99734;if(_0x131d73['interaction'][_0x412a('0xa6')]){return db['User'][_0x412a('0x58')]({'attributes':['id',_0x412a('0x38')],'where':{'id':_0x131d73[_0x412a('0x9d')][_0x412a('0xa6')]}})[_0x412a('0x32')](function(_0x389331){if(_0x389331){_0x131d73[_0x412a('0x7f')][_0x412a('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x389331[_0x412a('0x38')]+','+(_0x131d73['account'][_0x412a('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x412a('0xa9'),'startRouting',_0x131d73);});}return respondWithRpcPromise('Start','startRouting',_0x131d73);})[_0x412a('0x32')](function(_0x502b17){if(_0x502b17){var _0x263b20=0xc8;var _0x1d488f=_0x412a('0xaa');logger[_0x412a('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d488f,_0x263b20,_0x412a('0xab'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1d488f,_0x263b20,_0x412a('0xab'),JSON[_0x412a('0xac')](_0x502b17));if(_0x131d73[_0x412a('0x82')][_0x412a('0x3e')]===_0x412a('0xad')){return _0x2abb96[_0x412a('0x28')](_0x263b20)[_0x412a('0x2e')]('Content-Type',_0x412a('0xae'))[_0x412a('0x39')]('\x0a');}else{return _0x2abb96[_0x412a('0x28')](_0x263b20)[_0x412a('0x2f')](_0x502b17);}}})[_0x412a('0x27')](handleError(_0x2abb96,null));};exports[_0x412a('0x39')]=function(_0x2e5329,_0x3b8ea8,_0x339778){var _0x1065b8,_0x113271,_0x570ea0;if(_[_0x412a('0x90')](_0x2e5329[_0x412a('0x5a')][_0x412a('0x5a')])||_0x2e5329[_0x412a('0x5a')][_0x412a('0x5a')]===''){throw new db[(_0x412a('0x83'))]['ValidationError'](_0x412a('0x93'));}if(_[_0x412a('0x90')](_0x2e5329[_0x412a('0x5a')]['to'])){throw new db['Sequelize'][(_0x412a('0x92'))](_0x412a('0xaf'));}_0x1065b8=_0x2e5329['body']['to'];return db[_0x412a('0x3c')]['find']({'where':{'id':_0x2e5329['params']['id']},'include':[{'model':db[_0x412a('0xb0')],'as':_0x412a('0xb1'),'include':[{'model':db[_0x412a('0x97')],'as':_0x412a('0x98'),'where':{'mobile':_0x1065b8},'limit':0x1,'order':[[_0x412a('0x86'),'DESC']]}]}]})[_0x412a('0x32')](handleEntityNotFound(_0x3b8ea8,null))['then'](function(_0x4ebe25){if(_0x4ebe25&&_0x4ebe25[_0x412a('0xb1')]){_0x113271=_0x4ebe25['get']({'plain':!![]});if(_0x113271['List']&&_0x113271[_0x412a('0xb1')][_0x412a('0x98')][_0x412a('0x45')]){return _0x113271['List']['Contacts'][0x0];}return db[_0x412a('0x97')][_0x412a('0x59')](_[_0x412a('0x9a')](_0x2e5329['body'],{'firstName':_0x1065b8,'mobile':_0x1065b8,'phone':_0x1065b8,'ListId':_0x113271[_0x412a('0x88')]}));}})[_0x412a('0x32')](handleEntityNotFound(_0x3b8ea8,null))[_0x412a('0x32')](function(_0x70d999){if(_0x70d999){_0x570ea0=_0x70d999;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x570ea0['id'],'closed':![],'WhatsappAccountId':_0x113271['id']}})[_0x412a('0x32')](function(_0x2ea116){if(_0x2ea116){return[_0x2ea116,![]];}return db[_0x412a('0x9c')]['create']({'UserId':_0x2e5329['user']['id'],'ContactId':_0x570ea0['id'],'WhatsappAccountId':_0x113271['id'],'phone':_0x1065b8,'firstMsgDirection':_0x412a('0xb2'),'Messages':[_['merge'](_0x2e5329[_0x412a('0x5a')],{'read':![],'body':_0x2e5329['body'][_0x412a('0x5a')],'phone':_0x1065b8,'WhatsappAccountId':_0x113271['id'],'UserId':_0x2e5329['user']['id'],'ContactId':_0x570ea0['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x412a('0xb3')}]})[_0x412a('0x32')](function(_0x2a474f){return[_0x2a474f,!![]];});});}})[_0x412a('0x70')](function(_0x262c09,_0x399b8a){if(_0x399b8a){return _0x262c09;}return db[_0x412a('0xa3')][_0x412a('0x59')](_[_0x412a('0x4d')](_0x2e5329[_0x412a('0x5a')],{'read':![],'body':_0x2e5329[_0x412a('0x5a')][_0x412a('0x5a')],'phone':_0x1065b8,'WhatsappAccountId':_0x113271['id'],'WhatsappInteractionId':_0x262c09['id'],'UserId':_0x2e5329[_0x412a('0x5b')]['id'],'ContactId':_0x570ea0['id']}))['then'](function(_0x237867){_0x262c09[_0x412a('0xb4')]['Messages']=[];_0x262c09[_0x412a('0xb4')][_0x412a('0xb3')][_0x412a('0x9f')](_0x237867[_0x412a('0xb4')]);return _0x262c09;});})['then'](respondWithResult(_0x3b8ea8,null))[_0x412a('0x27')](handleError(_0x3b8ea8,null));}; \ No newline at end of file +var _0x236c=['Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','messageId','MessageSid','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','WhatsappInteraction','spread','interaction','created','push','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','orderBy','priority','asc','CmContact'];(function(_0x303f8d,_0x1f7db9){var _0x1b30d7=function(_0xa57a8f){while(--_0xa57a8f){_0x303f8d['push'](_0x303f8d['shift']());}};_0x1b30d7(++_0x1f7db9);}(_0x236c,0xec));var _0xc236=function(_0x1fb151,_0x5924a4){_0x1fb151=_0x1fb151-0x0;var _0x148ad5=_0x236c[_0x1fb151];return _0x148ad5;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc236('0x1'));var rp=require(_0xc236('0x2'));var moment=require(_0xc236('0x3'));var BPromise=require(_0xc236('0x4'));var Mustache=require(_0xc236('0x5'));var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require(_0xc236('0xc'));var squel=require(_0xc236('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc236('0xe'));var toCsv=require(_0xc236('0x9'));var querystring=require('querystring');var Papa=require(_0xc236('0xf'));var Redis=require(_0xc236('0x10'));var authService=require(_0xc236('0x11'));var qs=require(_0xc236('0x12'));var as=require(_0xc236('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc236('0x14'))(_0xc236('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc236('0x16'))['db'];config['redis']=_[_0xc236('0x17')](config[_0xc236('0x18')],{'host':_0xc236('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xc236('0x1a')](socket);var jayson=require(_0xc236('0x1b'));var client=jayson['client'][_0xc236('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x249d58,_0x32c483,_0x531bde,_0xe59092){return new BPromise(function(_0xf66608,_0x443b22){var _0x373684=_0xe59092||client;return _0x373684['request'](_0x249d58,_0x531bde)[_0xc236('0x1d')](function(_0x512b56){logger[_0xc236('0x1e')](_0xc236('0x1f'),_0x32c483,_0xc236('0x20'));logger['debug'](_0xc236('0x21'),_0x32c483,_0xc236('0x20'),JSON[_0xc236('0x22')](_0x512b56));if(_0x512b56[_0xc236('0x23')]){if(_0x512b56['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x32c483,_0x512b56[_0xc236('0x23')]['message']);return _0x443b22(_0x512b56[_0xc236('0x23')][_0xc236('0x24')]);}logger[_0xc236('0x23')](_0xc236('0x1f'),_0x32c483,_0x512b56[_0xc236('0x23')][_0xc236('0x24')]);return _0xf66608(_0x512b56[_0xc236('0x23')]['message']);}else{logger[_0xc236('0x1e')](_0xc236('0x1f'),_0x32c483,_0xc236('0x20'));_0xf66608(_0x512b56[_0xc236('0x25')][_0xc236('0x24')]);}})[_0xc236('0x26')](function(_0x31f3d0){logger[_0xc236('0x23')](_0xc236('0x1f'),_0x32c483,_0x31f3d0);_0x443b22(_0x31f3d0);});});}function respondWithStatusCode(_0x4529df,_0x1e174d){_0x1e174d=_0x1e174d||0xcc;return function(_0xbf6db3){if(_0xbf6db3){return _0x4529df[_0xc236('0x27')](_0x1e174d);}return _0x4529df[_0xc236('0x28')](_0x1e174d)[_0xc236('0x29')]();};}function respondWithResult(_0x2584bb,_0xdd735f){_0xdd735f=_0xdd735f||0xc8;return function(_0x5dc232){if(_0x5dc232){return _0x2584bb[_0xc236('0x28')](_0xdd735f)[_0xc236('0x2a')](_0x5dc232);}};}function respondWithFilteredResult(_0x2defc8,_0x42b5a4){return function(_0x22a627){if(_0x22a627){var _0x59e783=typeof _0x42b5a4['offset']===_0xc236('0x2b')&&typeof _0x42b5a4[_0xc236('0x2c')]==='undefined';var _0x24229a=_0x22a627['count'];var _0x52dca6=_0x59e783?0x0:_0x42b5a4['offset'];var _0x1c7a76=_0x59e783?_0x22a627[_0xc236('0x2d')]:_0x42b5a4[_0xc236('0x2e')]+_0x42b5a4[_0xc236('0x2c')];var _0xefedaf;if(_0x1c7a76>=_0x24229a){_0x1c7a76=_0x24229a;_0xefedaf=0xc8;}else{_0xefedaf=0xce;}_0x2defc8[_0xc236('0x28')](_0xefedaf);return _0x2defc8[_0xc236('0x2f')](_0xc236('0x30'),_0x52dca6+'-'+_0x1c7a76+'/'+_0x24229a)['json'](_0x22a627);}return null;};}function patchUpdates(_0x1249c2){return function(_0x913c36){try{jsonpatch[_0xc236('0x31')](_0x913c36,_0x1249c2,!![]);}catch(_0x271237){return BPromise['reject'](_0x271237);}return _0x913c36['save']();};}function saveUpdates(_0x3be3a2,_0x4bf253){return function(_0x49bd63){if(_0x49bd63){return _0x49bd63[_0xc236('0x32')](_0x3be3a2)[_0xc236('0x1d')](function(_0x4708c9){return _0x4708c9;});}return null;};}function removeEntity(_0x393d1b,_0x49a9de){return function(_0xfa5bbc){if(_0xfa5bbc){return _0xfa5bbc[_0xc236('0x33')]()[_0xc236('0x1d')](function(){var _0x50a3fd=_0xfa5bbc[_0xc236('0x34')]({'plain':!![]});var _0x4aa121=_0xc236('0x35');return db[_0xc236('0x36')][_0xc236('0x33')]({'where':{'type':_0x4aa121,'resourceId':_0x50a3fd['id']}})[_0xc236('0x1d')](function(){return _0xfa5bbc;});})['then'](function(){_0x393d1b[_0xc236('0x28')](0xcc)[_0xc236('0x29')]();});}};}function handleEntityNotFound(_0xcd5687,_0x2c259d){return function(_0x273cfc){if(!_0x273cfc){_0xcd5687[_0xc236('0x27')](0x194);}return _0x273cfc;};}function handleError(_0x24639a,_0x59f3e1){_0x59f3e1=_0x59f3e1||0x1f4;return function(_0x4e2f1c){logger['error'](_0x4e2f1c[_0xc236('0x37')]);if(_0x4e2f1c[_0xc236('0x38')]){delete _0x4e2f1c[_0xc236('0x38')];}_0x24639a[_0xc236('0x28')](_0x59f3e1)[_0xc236('0x39')](_0x4e2f1c);};}exports[_0xc236('0x3a')]=function(_0x5bbc2a,_0x6ebb7d){var _0x495f50={'include':[{'model':db[_0xc236('0x3b')],'as':'mandatoryDispositionPause'}]},_0x335c5f={},_0x3e814a={'count':0x0,'rows':[]};var _0x586921=_[_0xc236('0x3c')](db[_0xc236('0x3d')][_0xc236('0x3e')],function(_0x51f2a1){return{'name':_0x51f2a1[_0xc236('0x3f')],'type':_0x51f2a1[_0xc236('0x40')][_0xc236('0x41')]};});_0x335c5f[_0xc236('0x42')]=_[_0xc236('0x3c')](_0x586921,_0xc236('0x38'));_0x335c5f[_0xc236('0x43')]=_['keys'](_0x5bbc2a['query']);_0x335c5f[_0xc236('0x44')]=_[_0xc236('0x45')](_0x335c5f[_0xc236('0x42')],_0x335c5f[_0xc236('0x43')]);_0x495f50[_0xc236('0x46')]=_['intersection'](_0x335c5f[_0xc236('0x42')],qs[_0xc236('0x47')](_0x5bbc2a[_0xc236('0x43')]['fields']));_0x495f50[_0xc236('0x46')]=_0x495f50[_0xc236('0x46')][_0xc236('0x48')]?_0x495f50[_0xc236('0x46')]:_0x335c5f[_0xc236('0x42')];if(!_0x5bbc2a[_0xc236('0x43')][_0xc236('0x49')](_0xc236('0x4a'))){_0x495f50['limit']=qs[_0xc236('0x2c')](_0x5bbc2a['query'][_0xc236('0x2c')]);_0x495f50['offset']=qs[_0xc236('0x2e')](_0x5bbc2a[_0xc236('0x43')][_0xc236('0x2e')]);}_0x495f50[_0xc236('0x4b')]=qs[_0xc236('0x4c')](_0x5bbc2a[_0xc236('0x43')]['sort']);_0x495f50[_0xc236('0x4d')]=qs[_0xc236('0x44')](_[_0xc236('0x4e')](_0x5bbc2a[_0xc236('0x43')],_0x335c5f[_0xc236('0x44')]),_0x586921);if(_0x5bbc2a[_0xc236('0x43')][_0xc236('0x4f')]){_0x495f50[_0xc236('0x4d')]=_[_0xc236('0x50')](_0x495f50[_0xc236('0x4d')],{'$or':_[_0xc236('0x3c')](_0x586921,function(_0x4f9d23){if(_0x4f9d23['type']!==_0xc236('0x51')){var _0x539408={};_0x539408[_0x4f9d23[_0xc236('0x38')]]={'$like':'%'+_0x5bbc2a[_0xc236('0x43')][_0xc236('0x4f')]+'%'};return _0x539408;}})});}_0x495f50=_['merge']({},_0x495f50,_0x5bbc2a[_0xc236('0x52')]);var _0x22559b={'where':_0x495f50[_0xc236('0x4d')]};return db[_0xc236('0x3d')][_0xc236('0x2d')](_0x22559b)[_0xc236('0x1d')](function(_0x445b92){_0x3e814a[_0xc236('0x2d')]=_0x445b92;if(_0x5bbc2a[_0xc236('0x43')][_0xc236('0x53')]){_0x495f50[_0xc236('0x54')]=[{'all':!![]}];}return db[_0xc236('0x3d')][_0xc236('0x55')](_0x495f50);})[_0xc236('0x1d')](function(_0x350482){_0x3e814a[_0xc236('0x56')]=_0x350482;return _0x3e814a;})[_0xc236('0x1d')](respondWithFilteredResult(_0x6ebb7d,_0x495f50))[_0xc236('0x26')](handleError(_0x6ebb7d,null));};exports[_0xc236('0x57')]=function(_0x217834,_0x484db0){var _0xc621da={'raw':![],'where':{'id':_0x217834[_0xc236('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xc236('0x59')}]},_0x51734f={};_0x51734f[_0xc236('0x42')]=_[_0xc236('0x5a')](db['WhatsappAccount']['rawAttributes']);_0x51734f[_0xc236('0x43')]=_[_0xc236('0x5a')](_0x217834['query']);_0x51734f['filters']=_[_0xc236('0x45')](_0x51734f[_0xc236('0x42')],_0x51734f[_0xc236('0x43')]);_0xc621da['attributes']=_[_0xc236('0x45')](_0x51734f[_0xc236('0x42')],qs[_0xc236('0x47')](_0x217834['query']['fields']));_0xc621da[_0xc236('0x46')]=_0xc621da['attributes'][_0xc236('0x48')]?_0xc621da['attributes']:_0x51734f[_0xc236('0x42')];if(_0x217834[_0xc236('0x43')][_0xc236('0x53')]){_0xc621da[_0xc236('0x54')]=[{'all':!![]}];}_0xc621da=_['merge']({},_0xc621da,_0x217834[_0xc236('0x52')]);return db[_0xc236('0x3d')][_0xc236('0x5b')](_0xc621da)[_0xc236('0x1d')](handleEntityNotFound(_0x484db0,null))[_0xc236('0x1d')](respondWithResult(_0x484db0,null))[_0xc236('0x26')](handleError(_0x484db0,null));};exports[_0xc236('0x5c')]=function(_0x1af911,_0x527081){return db[_0xc236('0x3d')]['create'](_0x1af911[_0xc236('0x5d')],{})[_0xc236('0x1d')](function(_0x2546be){var _0x188389=_0x1af911[_0xc236('0x5e')]['get']({'plain':!![]});if(!_0x188389)throw new Error(_0xc236('0x5f'));if(_0x188389[_0xc236('0x60')]===_0xc236('0x5e')){var _0x267b01=_0x2546be[_0xc236('0x34')]({'plain':!![]});var _0x163a55='WhatsappAccounts';return db[_0xc236('0x61')][_0xc236('0x5b')]({'where':{'name':_0x163a55,'userProfileId':_0x188389[_0xc236('0x62')]},'raw':!![]})[_0xc236('0x1d')](function(_0x26a4a2){if(_0x26a4a2&&_0x26a4a2[_0xc236('0x63')]===0x0){return db[_0xc236('0x36')]['create']({'name':_0x267b01[_0xc236('0x38')],'resourceId':_0x267b01['id'],'type':_0x26a4a2[_0xc236('0x38')],'sectionId':_0x26a4a2['id']},{})[_0xc236('0x1d')](function(){return _0x2546be;});}else{return _0x2546be;}})[_0xc236('0x26')](function(_0x4ffb2c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ffb2c);throw _0x4ffb2c;});}return _0x2546be;})[_0xc236('0x1d')](respondWithResult(_0x527081,0xc9))[_0xc236('0x26')](handleError(_0x527081,null));};exports[_0xc236('0x32')]=function(_0x3569a7,_0x84f7a5){if(_0x3569a7['body']['id']){delete _0x3569a7[_0xc236('0x5d')]['id'];}return db[_0xc236('0x3d')]['find']({'where':{'id':_0x3569a7[_0xc236('0x58')]['id']},'include':[{'model':db[_0xc236('0x3b')],'as':_0xc236('0x59')}]})[_0xc236('0x1d')](handleEntityNotFound(_0x84f7a5,null))[_0xc236('0x1d')](saveUpdates(_0x3569a7[_0xc236('0x5d')],null))[_0xc236('0x1d')](respondWithResult(_0x84f7a5,null))[_0xc236('0x26')](handleError(_0x84f7a5,null));};exports[_0xc236('0x33')]=function(_0x1f076c,_0x1c5ac2){return db['WhatsappAccount'][_0xc236('0x5b')]({'where':{'id':_0x1f076c['params']['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x1c5ac2,null))[_0xc236('0x1d')](removeEntity(_0x1c5ac2,null))[_0xc236('0x26')](handleError(_0x1c5ac2,null));};exports[_0xc236('0x64')]=function(_0x161523,_0x2e943e){return db[_0xc236('0x3d')][_0xc236('0x64')]()['then'](respondWithResult(_0x2e943e,null))[_0xc236('0x26')](handleError(_0x2e943e,null));};exports[_0xc236('0x65')]=function(_0x3a0e69,_0x31b4fa,_0xc38d6b){if(_0x3a0e69[_0xc236('0x5d')]['id']){delete _0x3a0e69['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3a0e69[_0xc236('0x58')]['id']}})['then'](handleEntityNotFound(_0x31b4fa,null))[_0xc236('0x1d')](function(_0x5094b6){if(_0x5094b6){_0x3a0e69[_0xc236('0x5d')][_0xc236('0x66')]=_0x5094b6['id'];return db[_0xc236('0x67')][_0xc236('0x5c')](_0x3a0e69[_0xc236('0x5d')]);}})[_0xc236('0x1d')](respondWithResult(_0x31b4fa,null))[_0xc236('0x26')](handleError(_0x31b4fa,null));};exports[_0xc236('0x68')]=function(_0x492b3d,_0x5bc577,_0xfc16b3){var _0x3dd456={'raw':![],'where':{}};var _0x499d12={};var _0x5e7e1d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc236('0x69')]({'where':{'id':_0x492b3d[_0xc236('0x58')]['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x5bc577,null))[_0xc236('0x1d')](function(_0x52d0d1){if(_0x52d0d1){_0x499d12[_0xc236('0x42')]=_[_0xc236('0x5a')](db[_0xc236('0x67')][_0xc236('0x3e')]);_0x499d12[_0xc236('0x43')]=_[_0xc236('0x5a')](_0x492b3d[_0xc236('0x43')]);_0x499d12[_0xc236('0x44')]=_['intersection'](_0x499d12['model'],_0x499d12['query']);_0x3dd456[_0xc236('0x46')]=_['intersection'](_0x499d12['model'],qs[_0xc236('0x47')](_0x492b3d[_0xc236('0x43')][_0xc236('0x47')]));_0x3dd456[_0xc236('0x46')]=_0x3dd456['attributes'][_0xc236('0x48')]?_0x3dd456[_0xc236('0x46')]:_0x499d12[_0xc236('0x42')];if(!_0x492b3d[_0xc236('0x43')][_0xc236('0x49')](_0xc236('0x4a'))){_0x3dd456[_0xc236('0x2c')]=qs[_0xc236('0x2c')](_0x492b3d['query'][_0xc236('0x2c')]);_0x3dd456[_0xc236('0x2e')]=qs[_0xc236('0x2e')](_0x492b3d['query'][_0xc236('0x2e')]);}_0x3dd456[_0xc236('0x4b')]=qs[_0xc236('0x4c')](_0x492b3d['query'][_0xc236('0x4c')]);_0x3dd456[_0xc236('0x4d')]=qs['filters'](_[_0xc236('0x4e')](_0x492b3d[_0xc236('0x43')],_0x499d12[_0xc236('0x44')]));_0x3dd456[_0xc236('0x4d')][_0xc236('0x66')]=_0x52d0d1['id'];if(_0x492b3d[_0xc236('0x43')][_0xc236('0x4f')]){_0x3dd456[_0xc236('0x4d')]=_[_0xc236('0x50')](_0x3dd456[_0xc236('0x4d')],{'$or':_[_0xc236('0x3c')](_0x3dd456['attributes'],function(_0x4cead2){var _0x343fdb={};_0x343fdb[_0x4cead2]={'$like':'%'+_0x492b3d[_0xc236('0x43')]['filter']+'%'};return _0x343fdb;})});}_0x3dd456=_[_0xc236('0x50')]({},_0x3dd456,_0x492b3d['options']);return db[_0xc236('0x67')][_0xc236('0x2d')]({'where':_0x3dd456['where']})[_0xc236('0x1d')](function(_0x96fc5){_0x5e7e1d[_0xc236('0x2d')]=_0x96fc5;if(_0x492b3d[_0xc236('0x43')][_0xc236('0x53')]){_0x3dd456[_0xc236('0x54')]=[{'all':!![]}];}return db[_0xc236('0x67')][_0xc236('0x55')](_0x3dd456);})[_0xc236('0x1d')](function(_0x45e33e){_0x5e7e1d[_0xc236('0x56')]=_0x45e33e;return _0x5e7e1d;});}})['then'](respondWithFilteredResult(_0x5bc577,_0x3dd456))[_0xc236('0x26')](handleError(_0x5bc577,null));};exports[_0xc236('0x6a')]=function(_0x14bb54,_0x2985ef,_0x128ed1){return db['WhatsappAccount'][_0xc236('0x5b')]({'where':{'id':_0x14bb54['params']['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x2985ef,null))[_0xc236('0x1d')](function(_0x839a5e){if(_0x839a5e){return _0x839a5e[_0xc236('0x6a')](_0x14bb54[_0xc236('0x43')][_0xc236('0x6b')]);}})[_0xc236('0x1d')](respondWithStatusCode(_0x2985ef,null))[_0xc236('0x26')](handleError(_0x2985ef,null));};exports[_0xc236('0x6c')]=function(_0x51433f,_0x9ec396,_0x4024e9){if(_0x51433f[_0xc236('0x5d')]['id']){delete _0x51433f[_0xc236('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x51433f[_0xc236('0x58')]['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x9ec396,null))[_0xc236('0x1d')](function(_0xcd0330){if(_0xcd0330){_0x51433f[_0xc236('0x5d')][_0xc236('0x66')]=_0xcd0330['id'];return db[_0xc236('0x6d')][_0xc236('0x5c')](_0x51433f[_0xc236('0x5d')]);}})[_0xc236('0x1d')](respondWithResult(_0x9ec396,null))[_0xc236('0x26')](handleError(_0x9ec396,null));};exports[_0xc236('0x6e')]=function(_0x21b8d0,_0xd2ab10,_0x11ab82){var _0x16078a={'raw':![],'where':{}};var _0x581c9b={};var _0x2b5a83={'count':0x0,'rows':[]};return db[_0xc236('0x3d')]['findOne']({'where':{'id':_0x21b8d0[_0xc236('0x58')]['id']}})['then'](handleEntityNotFound(_0xd2ab10,null))[_0xc236('0x1d')](function(_0x24c3b4){if(_0x24c3b4){_0x581c9b['model']=_['keys'](db['CannedAnswer'][_0xc236('0x3e')]);_0x581c9b['query']=_[_0xc236('0x5a')](_0x21b8d0[_0xc236('0x43')]);_0x581c9b[_0xc236('0x44')]=_[_0xc236('0x45')](_0x581c9b[_0xc236('0x42')],_0x581c9b[_0xc236('0x43')]);_0x16078a[_0xc236('0x46')]=_['intersection'](_0x581c9b[_0xc236('0x42')],qs[_0xc236('0x47')](_0x21b8d0['query'][_0xc236('0x47')]));_0x16078a[_0xc236('0x46')]=_0x16078a[_0xc236('0x46')][_0xc236('0x48')]?_0x16078a[_0xc236('0x46')]:_0x581c9b[_0xc236('0x42')];if(!_0x21b8d0[_0xc236('0x43')][_0xc236('0x49')](_0xc236('0x4a'))){_0x16078a[_0xc236('0x2c')]=qs[_0xc236('0x2c')](_0x21b8d0[_0xc236('0x43')][_0xc236('0x2c')]);_0x16078a[_0xc236('0x2e')]=qs[_0xc236('0x2e')](_0x21b8d0['query'][_0xc236('0x2e')]);}_0x16078a[_0xc236('0x4b')]=qs[_0xc236('0x4c')](_0x21b8d0[_0xc236('0x43')][_0xc236('0x4c')]);_0x16078a[_0xc236('0x4d')]=qs[_0xc236('0x44')](_[_0xc236('0x4e')](_0x21b8d0[_0xc236('0x43')],_0x581c9b[_0xc236('0x44')]));_0x16078a[_0xc236('0x4d')][_0xc236('0x66')]=_0x24c3b4['id'];if(_0x21b8d0['query'][_0xc236('0x4f')]){_0x16078a[_0xc236('0x4d')]=_['merge'](_0x16078a['where'],{'$or':_['map'](_0x16078a[_0xc236('0x46')],function(_0x92e0d4){var _0x1eb2f8={};_0x1eb2f8[_0x92e0d4]={'$like':'%'+_0x21b8d0[_0xc236('0x43')][_0xc236('0x4f')]+'%'};return _0x1eb2f8;})});}_0x16078a=_[_0xc236('0x50')]({},_0x16078a,_0x21b8d0[_0xc236('0x52')]);return db[_0xc236('0x6d')][_0xc236('0x2d')]({'where':_0x16078a[_0xc236('0x4d')]})['then'](function(_0x4b0036){_0x2b5a83['count']=_0x4b0036;if(_0x21b8d0[_0xc236('0x43')][_0xc236('0x53')]){_0x16078a[_0xc236('0x54')]=[{'all':!![]}];}return db[_0xc236('0x6d')]['findAll'](_0x16078a);})['then'](function(_0x41d357){_0x2b5a83[_0xc236('0x56')]=_0x41d357;return _0x2b5a83;});}})[_0xc236('0x1d')](respondWithFilteredResult(_0xd2ab10,_0x16078a))[_0xc236('0x26')](handleError(_0xd2ab10,null));};exports[_0xc236('0x6f')]=function(_0x3f4228,_0x4dd2a9,_0x26189a){return db['WhatsappAccount'][_0xc236('0x5b')]({'where':{'id':_0x3f4228[_0xc236('0x58')]['id']}})['then'](handleEntityNotFound(_0x4dd2a9,null))['then'](function(_0x3ff3b4){if(_0x3ff3b4){return _0x3ff3b4[_0xc236('0x6f')](_0x3f4228[_0xc236('0x43')][_0xc236('0x6b')]);}})[_0xc236('0x1d')](respondWithStatusCode(_0x4dd2a9,null))[_0xc236('0x26')](handleError(_0x4dd2a9,null));};exports[_0xc236('0x70')]=function(_0x87e7da,_0x2df3e0,_0x4213eb){return db['WhatsappAccount'][_0xc236('0x5b')]({'where':{'id':_0x87e7da[_0xc236('0x58')]['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x2df3e0,null))['then'](function(_0x3ec41b){if(_0x3ec41b){return _0x3ec41b[_0xc236('0x70')](_0x87e7da['body']['ids'],_[_0xc236('0x71')](_0x87e7da[_0xc236('0x5d')],[_0xc236('0x6b'),'id'])||{})['spread'](function(_0x20fdef){for(var _0x452ba2=0x0;_0x452ba2<_0x87e7da['body'][_0xc236('0x6b')]['length'];_0x452ba2+=0x1){socket[_0xc236('0x72')](_0xc236('0x73'),{'UserId':Number(_0x87e7da['body'][_0xc236('0x6b')][_0x452ba2]),'WhatsappAccountId':Number(_0x87e7da['params']['id'])});}return _0x20fdef;});}})[_0xc236('0x1d')](respondWithResult(_0x2df3e0,null))[_0xc236('0x26')](handleError(_0x2df3e0,null));};exports[_0xc236('0x74')]=function(_0x54decb,_0x386b1a,_0x36d6fb){return db[_0xc236('0x3d')]['find']({'where':{'id':_0x54decb['params']['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x386b1a,null))[_0xc236('0x1d')](function(_0x243622){if(_0x243622){return _0x243622['removeAgents'](_0x54decb['query'][_0xc236('0x6b')])[_0xc236('0x1d')](function(){if(_[_0xc236('0x75')](_0x54decb[_0xc236('0x43')]['ids'])){for(var _0x1ab303=0x0;_0x1ab303<_0x54decb['query']['ids'][_0xc236('0x48')];_0x1ab303+=0x1){socket[_0xc236('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x54decb['query'][_0xc236('0x6b')][_0x1ab303]),'WhatsappAccountId':Number(_0x54decb[_0xc236('0x58')]['id'])});}}else{socket[_0xc236('0x72')](_0xc236('0x76'),{'UserId':Number(_0x54decb[_0xc236('0x43')][_0xc236('0x6b')]),'WhatsappAccountId':Number(_0x54decb[_0xc236('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x386b1a,null))[_0xc236('0x26')](handleError(_0x386b1a,null));};exports[_0xc236('0x77')]=function(_0x44597e,_0x5b86b8,_0x52e8cb){var _0xecae55={};var _0x3922c4={};var _0x3db92c;var _0xe0b3c5;return db['WhatsappAccount']['findOne']({'where':{'id':_0x44597e[_0xc236('0x58')]['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x5b86b8,null))[_0xc236('0x1d')](function(_0x459f21){if(_0x459f21){_0x3db92c=_0x459f21;_0x3922c4[_0xc236('0x42')]=_[_0xc236('0x5a')](db[_0xc236('0x78')][_0xc236('0x3e')]);_0x3922c4['query']=_[_0xc236('0x5a')](_0x44597e[_0xc236('0x43')]);_0x3922c4[_0xc236('0x44')]=_[_0xc236('0x45')](_0x3922c4[_0xc236('0x42')],_0x3922c4[_0xc236('0x43')]);_0xecae55[_0xc236('0x46')]=_['intersection'](_0x3922c4[_0xc236('0x42')],qs[_0xc236('0x47')](_0x44597e[_0xc236('0x43')][_0xc236('0x47')]));_0xecae55[_0xc236('0x46')]=_0xecae55[_0xc236('0x46')][_0xc236('0x48')]?_0xecae55[_0xc236('0x46')]:_0x3922c4[_0xc236('0x42')];_0xecae55[_0xc236('0x4b')]=qs[_0xc236('0x4c')](_0x44597e[_0xc236('0x43')][_0xc236('0x4c')]);_0xecae55['where']=qs[_0xc236('0x44')](_[_0xc236('0x4e')](_0x44597e[_0xc236('0x43')],_0x3922c4[_0xc236('0x44')]));if(_0x44597e['query']['filter']){_0xecae55['where']=_[_0xc236('0x50')](_0xecae55[_0xc236('0x4d')],{'$or':_[_0xc236('0x3c')](_0xecae55[_0xc236('0x46')],function(_0x4aa1b0){var _0xabcdfd={};_0xabcdfd[_0x4aa1b0]={'$like':'%'+_0x44597e[_0xc236('0x43')][_0xc236('0x4f')]+'%'};return _0xabcdfd;})});}_0xecae55=_[_0xc236('0x50')]({},_0xecae55,_0x44597e[_0xc236('0x52')]);return _0x3db92c[_0xc236('0x77')](_0xecae55);}})[_0xc236('0x1d')](function(_0x19f057){if(_0x19f057){_0xe0b3c5=_0x19f057[_0xc236('0x48')];if(!_0x44597e[_0xc236('0x43')][_0xc236('0x49')](_0xc236('0x4a'))){_0xecae55[_0xc236('0x2c')]=qs['limit'](_0x44597e['query'][_0xc236('0x2c')]);_0xecae55[_0xc236('0x2e')]=qs[_0xc236('0x2e')](_0x44597e[_0xc236('0x43')]['offset']);}return _0x3db92c[_0xc236('0x77')](_0xecae55);}})['then'](function(_0x3ea133){if(_0x3ea133){return _0x3ea133?{'count':_0xe0b3c5,'rows':_0x3ea133}:null;}})['then'](respondWithResult(_0x5b86b8,null))['catch'](handleError(_0x5b86b8,null));};exports[_0xc236('0x79')]=function(_0x4de10c,_0x4f7f4e,_0x24bbd3){return db[_0xc236('0x3d')][_0xc236('0x69')]({'where':{'id':_0x4de10c[_0xc236('0x58')]['id']}})[_0xc236('0x1d')](handleEntityNotFound(_0x4f7f4e,null))[_0xc236('0x1d')](function(_0x8073b){if(_0x8073b){return db[_0xc236('0x7a')][_0xc236('0x7b')](function(_0x10c22a){return db[_0xc236('0x7c')][_0xc236('0x33')]({'where':{'WhatsappAccountId':_0x4de10c[_0xc236('0x58')]['id']},'transaction':_0x10c22a})['then'](function(_0x3b952d){var _0x3f0bc5=_['map'](_0x4de10c[_0xc236('0x5d')],function(_0x365818){_0x365818[_0xc236('0x66')]=_0x4de10c[_0xc236('0x58')]['id'];return _0x365818;});return db[_0xc236('0x7c')]['bulkCreate'](_0x3f0bc5,{'transaction':_0x10c22a});});})[_0xc236('0x1d')](function(){return db[_0xc236('0x7c')][_0xc236('0x7d')]({'where':{'WhatsappAccountId':_0x4de10c[_0xc236('0x58')]['id']},'order':'priority'});});}})[_0xc236('0x1d')](respondWithResult(_0x4f7f4e,null))[_0xc236('0x26')](handleError(_0x4f7f4e,null));};exports[_0xc236('0x7e')]=function(_0x3da198,_0x315b79,_0x2a74b4){var _0x2f9129={};var _0x569c62={};var _0x51b452;var _0x437da4;return db['WhatsappAccount'][_0xc236('0x69')]({'where':{'id':_0x3da198[_0xc236('0x58')]['id']}})['then'](handleEntityNotFound(_0x315b79,null))[_0xc236('0x1d')](function(_0x4c54f2){if(_0x4c54f2){_0x51b452=_0x4c54f2;_0x569c62['model']=_[_0xc236('0x5a')](db[_0xc236('0x7c')][_0xc236('0x3e')]);_0x569c62[_0xc236('0x43')]=_[_0xc236('0x5a')](_0x3da198[_0xc236('0x43')]);_0x569c62['filters']=_['intersection'](_0x569c62[_0xc236('0x42')],_0x569c62['query']);_0x2f9129[_0xc236('0x46')]=_[_0xc236('0x45')](_0x569c62['model'],qs[_0xc236('0x47')](_0x3da198['query']['fields']));_0x2f9129[_0xc236('0x46')]=_0x2f9129[_0xc236('0x46')]['length']?_0x2f9129[_0xc236('0x46')]:_0x569c62[_0xc236('0x42')];_0x2f9129[_0xc236('0x4b')]=qs[_0xc236('0x4c')](_0x3da198[_0xc236('0x43')]['sort']);_0x2f9129[_0xc236('0x4d')]=qs[_0xc236('0x44')](_['pick'](_0x3da198['query'],_0x569c62[_0xc236('0x44')]));if(_0x3da198['query']['filter']){_0x2f9129['where']=_[_0xc236('0x50')](_0x2f9129[_0xc236('0x4d')],{'$or':_['map'](_0x2f9129[_0xc236('0x46')],function(_0x2d4506){var _0x326840={};_0x326840[_0x2d4506]={'$like':'%'+_0x3da198[_0xc236('0x43')]['filter']+'%'};return _0x326840;})});}_0x2f9129=_[_0xc236('0x50')]({},_0x2f9129,_0x3da198[_0xc236('0x52')]);return _0x51b452[_0xc236('0x7e')](_0x2f9129);}})[_0xc236('0x1d')](function(_0x532bb4){if(_0x532bb4){_0x437da4=_0x532bb4['length'];if(!_0x3da198['query'][_0xc236('0x49')]('nolimit')){_0x2f9129[_0xc236('0x2c')]=qs[_0xc236('0x2c')](_0x3da198[_0xc236('0x43')][_0xc236('0x2c')]);_0x2f9129[_0xc236('0x2e')]=qs['offset'](_0x3da198[_0xc236('0x43')][_0xc236('0x2e')]);}return _0x51b452['getApplications'](_0x2f9129);}})[_0xc236('0x1d')](function(_0xcc94bb){if(_0xcc94bb){return _0xcc94bb?{'count':_0x437da4,'rows':_0xcc94bb}:null;}})[_0xc236('0x1d')](respondWithResult(_0x315b79,null))['catch'](handleError(_0x315b79,null));};exports[_0xc236('0x7f')]=function(_0x23a6c7,_0x2ed2cd,_0x5517eb){var _0x3808d9={'channel':_0xc236('0x80')};var _0x546ae5=[];var _0x1fdcfa=[];var _0x8d3614={};return db[_0xc236('0x3d')][_0xc236('0x5b')]({'where':{'id':_0x23a6c7[_0xc236('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xc236('0x81')}]})[_0xc236('0x1d')](handleEntityNotFound(_0x2ed2cd,null))[_0xc236('0x1d')](function(_0x49385c){_0x3808d9[_0xc236('0x82')]=_0x49385c;_0x3808d9[_0xc236('0x83')]=_[_0xc236('0x84')](_0x49385c['Applications'],[_0xc236('0x85')],[_0xc236('0x86')]);if(_0x3808d9[_0xc236('0x82')][_0xc236('0x81')]){delete _0x3808d9[_0xc236('0x82')][_0xc236('0x81')];}return db[_0xc236('0x87')][_0xc236('0x64')]();})[_0xc236('0x1d')](function(_0x1440ad){if(!_0x1440ad){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0x8a'));}_0x546ae5=_['difference'](_['keys'](_0x1440ad),[_0xc236('0x8b'),_0xc236('0x8c')]);_0x1fdcfa=_[_0xc236('0x8d')](_[_0xc236('0x5a')](_0x1440ad),['createdAt','updatedAt',_0xc236('0x8e'),_0xc236('0x8f')]);_0x3808d9[_0xc236('0x5d')]={'mapKey':_0xc236('0x90')};if(_0x3808d9[_0xc236('0x82')][_0xc236('0x40')]&&_0x3808d9[_0xc236('0x82')]['type']===_0xc236('0x91')){_0x3808d9[_0xc236('0x5d')]['from']=_0x23a6c7[_0xc236('0x5d')][_0xc236('0x92')][_0xc236('0x93')](_0xc236('0x94'),'');_0x3808d9[_0xc236('0x5d')][_0xc236('0x5d')]=_0x23a6c7['body']['Body'];_0x3808d9[_0xc236('0x5d')][_0xc236('0x95')]=_0x23a6c7[_0xc236('0x5d')][_0xc236('0x96')];}if(_0x3808d9[_0xc236('0x5d')]['id']){delete _0x3808d9[_0xc236('0x5d')]['id'];}if(_['isNil'](_0x3808d9[_0xc236('0x5d')][_0xc236('0x97')])){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0x98'));}if(_[_0xc236('0x99')](_0x3808d9[_0xc236('0x5d')]['body'])||_0x3808d9[_0xc236('0x5d')][_0xc236('0x5d')]===''){throw new db['Sequelize'][(_0xc236('0x89'))](_0xc236('0x9a'));}if(_[_0xc236('0x99')](_0x3808d9[_0xc236('0x5d')][_0xc236('0x9b')])){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0x9c')+_0x1fdcfa);}if(!_['includes'](_0x1fdcfa,_0x3808d9['body'][_0xc236('0x9b')])){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0x9d')+_0x1fdcfa);}_0x8d3614[_0x3808d9[_0xc236('0x5d')][_0xc236('0x9b')]]=_0x3808d9[_0xc236('0x5d')][_0xc236('0x97')];return db[_0xc236('0x9e')][_0xc236('0x5b')]({'where':{'id':_0x3808d9[_0xc236('0x82')]['ListId']},'include':[{'model':db[_0xc236('0x87')],'as':'Contacts','where':_0x8d3614,'limit':0x1,'order':[[_0xc236('0x8c'),_0xc236('0x9f')]]}]});})[_0xc236('0x1d')](handleEntityNotFound(_0x2ed2cd,null))[_0xc236('0x1d')](function(_0x29548d){if(_0x29548d){_0x3808d9[_0xc236('0xa0')]=_['omit'](_0x29548d,[_0xc236('0xa1')]);if(_0x29548d[_0xc236('0xa1')][_0xc236('0x48')]){return _0x29548d[_0xc236('0xa1')][0x0];}var _0x104301=_[_0xc236('0x17')](_0x3808d9['body'],{'firstName':_0x3808d9['body'][_0xc236('0x97')],'ListId':_0x29548d['id']});_0x104301[_0x3808d9[_0xc236('0x5d')][_0xc236('0x9b')]]=_0x3808d9[_0xc236('0x5d')]['from'];return db[_0xc236('0x87')][_0xc236('0x5c')](_0x104301,{'fields':_0x546ae5,'raw':!![]});}})[_0xc236('0x1d')](handleEntityNotFound(_0x2ed2cd,null))['then'](function(_0x4245d1){if(_0x4245d1){_0x3808d9['contact']=_0x4245d1;var _0x3be1fc={'ContactId':_0x4245d1['id'],'phone':_0x3808d9['body'][_0xc236('0x97')],'WhatsappAccountId':_0x23a6c7['params']['id']};var _0x323b8b={'ContactId':_0x4245d1['id'],'WhatsappAccountId':_0x23a6c7[_0xc236('0x58')]['id'],'closed':![]};return db[_0xc236('0xa2')]['find']({'where':_0x323b8b})[_0xc236('0x1d')](function(_0x125c0d){if(_0x125c0d){return[_0x125c0d,![]];}return db['WhatsappInteraction'][_0xc236('0x5c')](_0x3be1fc)[_0xc236('0x1d')](function(_0xe75715){return[_0xe75715,!![]];});});}})[_0xc236('0xa3')](function(_0x38d6d0,_0x3b7234){_0x3808d9[_0xc236('0xa4')]=_0x38d6d0[_0xc236('0x34')]({'plain':!![]});_0x3808d9[_0xc236('0xa4')][_0xc236('0xa5')]=![];if(_0x3b7234){if(_0x3808d9[_0xc236('0x82')]['autoclose']){_0x3808d9[_0xc236('0x83')][_0xc236('0xa6')]({'id':0x0,'priority':_0x3808d9[_0xc236('0x83')]['length']+0x1,'app':_0xc236('0xa7'),'appdata':_0xc236('0xa8'),'interval':'*,*,*,*'});}_0x3808d9[_0xc236('0xa4')]['created']=!![];}return db[_0xc236('0xa9')][_0xc236('0x5c')]({'phone':_0x3808d9[_0xc236('0x5d')][_0xc236('0x97')],'messageId':_0x3808d9[_0xc236('0x5d')][_0xc236('0x95')],'body':_0x3808d9[_0xc236('0x5d')][_0xc236('0x5d')],'WhatsappAccountId':_0x23a6c7[_0xc236('0x58')]['id'],'WhatsappInteractionId':_0x38d6d0['id'],'direction':'in','ContactId':_0x38d6d0[_0xc236('0xaa')],'AttachmentId':_0x3808d9['body'][_0xc236('0xab')]});})[_0xc236('0x1d')](function(_0x3dc256){_0x3808d9[_0xc236('0x24')]=_0x3dc256;if(_0x3808d9['interaction'][_0xc236('0xac')]){return db[_0xc236('0x78')]['find']({'attributes':['id',_0xc236('0x38')],'where':{'id':_0x3808d9['interaction']['UserId']}})['then'](function(_0x8541e4){if(_0x8541e4){_0x3808d9[_0xc236('0x83')][_0xc236('0xad')]({'id':0x0,'priority':0x0,'app':_0xc236('0xae'),'appdata':_0x8541e4[_0xc236('0x38')]+','+(_0x3808d9[_0xc236('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0xc236('0xaf')});}return respondWithRpcPromise(_0xc236('0xb0'),_0xc236('0xb1'),_0x3808d9);});}return respondWithRpcPromise(_0xc236('0xb0'),_0xc236('0xb1'),_0x3808d9);})['then'](function(_0x5417da){if(_0x5417da){var _0x212986=0xc8;var _0x17413a=_0xc236('0xb2');logger[_0xc236('0x1e')](_0xc236('0x21'),_0x17413a,_0x212986,_0xc236('0xb3'));logger['debug'](_0xc236('0xb4'),_0x17413a,_0x212986,_0xc236('0xb3'),JSON['stringify'](_0x5417da));if(_0x3808d9[_0xc236('0x82')]['type']===_0xc236('0x91')){return _0x2ed2cd[_0xc236('0x28')](_0x212986)[_0xc236('0x2f')]('Content-Type','text/xml')[_0xc236('0x39')]('\x0a');}else{return _0x2ed2cd[_0xc236('0x28')](_0x212986)['json'](_0x5417da);}}})['catch'](handleError(_0x2ed2cd,null));};exports[_0xc236('0x39')]=function(_0x501901,_0x4d450c,_0x523886){var _0x18eb20,_0x5d4fc1,_0x1d72b9;if(_[_0xc236('0x99')](_0x501901[_0xc236('0x5d')]['body'])||_0x501901[_0xc236('0x5d')]['body']===''){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0x9a'));}if(_[_0xc236('0x99')](_0x501901[_0xc236('0x5d')]['to'])){throw new db[(_0xc236('0x88'))][(_0xc236('0x89'))](_0xc236('0xb5'));}_0x18eb20=_0x501901[_0xc236('0x5d')]['to'];return db[_0xc236('0x3d')][_0xc236('0x5b')]({'where':{'id':_0x501901['params']['id']},'include':[{'model':db['CmList'],'as':_0xc236('0xb6'),'include':[{'model':db['CmContact'],'as':_0xc236('0xa1'),'where':{'mobile':_0x18eb20},'limit':0x1,'order':[[_0xc236('0x8c'),'DESC']]}]}]})[_0xc236('0x1d')](handleEntityNotFound(_0x4d450c,null))[_0xc236('0x1d')](function(_0x26f109){if(_0x26f109&&_0x26f109[_0xc236('0xb6')]){_0x5d4fc1=_0x26f109[_0xc236('0x34')]({'plain':!![]});if(_0x5d4fc1['List']&&_0x5d4fc1[_0xc236('0xb6')][_0xc236('0xa1')][_0xc236('0x48')]){return _0x5d4fc1[_0xc236('0xb6')][_0xc236('0xa1')][0x0];}return db['CmContact'][_0xc236('0x5c')](_[_0xc236('0x17')](_0x501901[_0xc236('0x5d')],{'firstName':_0x18eb20,'mobile':_0x18eb20,'phone':_0x18eb20,'ListId':_0x5d4fc1['ListId']}));}})[_0xc236('0x1d')](handleEntityNotFound(_0x4d450c,null))[_0xc236('0x1d')](function(_0x22460a){if(_0x22460a){_0x1d72b9=_0x22460a;return db[_0xc236('0xa2')][_0xc236('0x5b')]({'where':{'ContactId':_0x1d72b9['id'],'closed':![],'WhatsappAccountId':_0x5d4fc1['id']}})[_0xc236('0x1d')](function(_0x2e297f){if(_0x2e297f){return[_0x2e297f,![]];}return db['WhatsappInteraction'][_0xc236('0x5c')]({'UserId':_0x501901[_0xc236('0x5e')]['id'],'ContactId':_0x1d72b9['id'],'WhatsappAccountId':_0x5d4fc1['id'],'phone':_0x18eb20,'firstMsgDirection':_0xc236('0xb7'),'Messages':[_[_0xc236('0x50')](_0x501901[_0xc236('0x5d')],{'read':![],'body':_0x501901[_0xc236('0x5d')][_0xc236('0x5d')],'phone':_0x18eb20,'WhatsappAccountId':_0x5d4fc1['id'],'UserId':_0x501901['user']['id'],'ContactId':_0x1d72b9['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xc236('0xb8')}]})[_0xc236('0x1d')](function(_0x4eb519){return[_0x4eb519,!![]];});});}})[_0xc236('0xa3')](function(_0x17d016,_0x2407ba){if(_0x2407ba){return _0x17d016;}return db[_0xc236('0xa9')][_0xc236('0x5c')](_['merge'](_0x501901['body'],{'read':![],'body':_0x501901[_0xc236('0x5d')][_0xc236('0x5d')],'phone':_0x18eb20,'WhatsappAccountId':_0x5d4fc1['id'],'WhatsappInteractionId':_0x17d016['id'],'UserId':_0x501901[_0xc236('0x5e')]['id'],'ContactId':_0x1d72b9['id']}))[_0xc236('0x1d')](function(_0x53623c){_0x17d016[_0xc236('0xb9')][_0xc236('0xb8')]=[];_0x17d016[_0xc236('0xb9')][_0xc236('0xb8')][_0xc236('0xa6')](_0x53623c[_0xc236('0xb9')]);return _0x17d016;});})[_0xc236('0x1d')](respondWithResult(_0x4d450c,null))[_0xc236('0x26')](handleError(_0x4d450c,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6fbf861..a9b0972 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 _0x3bf6=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0x3bf6,0x15b));var _0x63bf=function(_0x5df860,_0x4c93e2){_0x5df860=_0x5df860-0x0;var _0x48cdb9=_0x3bf6[_0x5df860];return _0x48cdb9;};'use strict';var EventEmitter=require(_0x63bf('0x0'));var WhatsappAccount=require(_0x63bf('0x1'))['db'][_0x63bf('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x63bf('0x3')](0x0);var events={'afterCreate':_0x63bf('0x4'),'afterUpdate':'update','afterDestroy':_0x63bf('0x5')};function emitEvent(_0x1508b0){return function(_0x5c3876,_0x5cd11c,_0x166251){WhatsappAccountEvents[_0x63bf('0x6')](_0x1508b0+':'+_0x5c3876['id'],_0x5c3876);WhatsappAccountEvents[_0x63bf('0x6')](_0x1508b0,_0x5c3876);_0x166251(null);};}for(var e in events){if(events[_0x63bf('0x7')](e)){var event=events[e];WhatsappAccount[_0x63bf('0x8')](e,emitEvent(event));}}module[_0x63bf('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xda87=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x306b5c,_0x22439d){var _0x1d16c7=function(_0x48c438){while(--_0x48c438){_0x306b5c['push'](_0x306b5c['shift']());}};_0x1d16c7(++_0x22439d);}(_0xda87,0xba));var _0x7da8=function(_0x465845,_0x15007c){_0x465845=_0x465845-0x0;var _0x314825=_0xda87[_0x465845];return _0x314825;};'use strict';var EventEmitter=require(_0x7da8('0x0'));var WhatsappAccount=require(_0x7da8('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7da8('0x2'),'afterUpdate':_0x7da8('0x3'),'afterDestroy':_0x7da8('0x4')};function emitEvent(_0x415d79){return function(_0x99525a,_0x393d17,_0x538051){WhatsappAccountEvents[_0x7da8('0x5')](_0x415d79+':'+_0x99525a['id'],_0x99525a);WhatsappAccountEvents[_0x7da8('0x5')](_0x415d79,_0x99525a);_0x538051(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x7da8('0x6')](e,emitEvent(event));}}module[_0x7da8('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 716165c..67f032b 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 _0x859d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x859d,0x16b));var _0xd859=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x859d[_0xd299c3];return _0x376574;};'use strict';var _=require('lodash');var util=require(_0xd859('0x0'));var logger=require(_0xd859('0x1'))('api');var moment=require(_0xd859('0x2'));var BPromise=require(_0xd859('0x3'));var rp=require(_0xd859('0x4'));var fs=require('fs');var path=require(_0xd859('0x5'));var rimraf=require(_0xd859('0x6'));var config=require(_0xd859('0x7'));var attributes=require(_0xd859('0x8'));module['exports']=function(_0x9fde1b,_0x3a5a90){return _0x9fde1b[_0xd859('0x9')](_0xd859('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce2=['../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash','util','request-promise','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6ce2,0x124));var _0x26ce=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6ce2[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x26ce('0x0'));var util=require(_0x26ce('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x26ce('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26ce('0x3'));var config=require(_0x26ce('0x4'));var attributes=require('./whatsappAccount.attributes');module[_0x26ce('0x5')]=function(_0x572917,_0x16e8d7){return _0x572917['define'](_0x26ce('0x6'),attributes,{'tableName':_0x26ce('0x7'),'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 f7a6e99..eee75a3 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 _0xec33=['where','include','map','model','attributes','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappAccount','find','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec33,0x1f4));var _0x3ec3=function(_0x50c837,_0x1891fd){_0x50c837=_0x50c837-0x0;var _0x1c85e8=_0xec33[_0x50c837];return _0x1c85e8;};'use strict';var _=require(_0x3ec3('0x0'));var util=require(_0x3ec3('0x1'));var moment=require(_0x3ec3('0x2'));var BPromise=require(_0x3ec3('0x3'));var rs=require(_0x3ec3('0x4'));var fs=require('fs');var Redis=require(_0x3ec3('0x5'));var db=require(_0x3ec3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ec3('0x7'))(_0x3ec3('0x8'));var config=require(_0x3ec3('0x9'));var jayson=require(_0x3ec3('0xa'));var client=jayson['client'][_0x3ec3('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3ec3('0xc')],{'host':_0x3ec3('0xd'),'port':0x18eb});var socket=require(_0x3ec3('0xe'))(new Redis(config['redis']));require(_0x3ec3('0xf'))[_0x3ec3('0x10')](socket);function respondWithRpcPromise(_0x3be0e5,_0x4cacb1,_0x473d40){return new BPromise(function(_0x26f9e2,_0x46b024){return client[_0x3ec3('0x11')](_0x3be0e5,_0x473d40)[_0x3ec3('0x12')](function(_0xeeb4b2){logger['info'](_0x3ec3('0x13'),_0x4cacb1,_0x3ec3('0x14'));logger[_0x3ec3('0x15')](_0x3ec3('0x16'),_0x4cacb1,_0x3ec3('0x14'),JSON[_0x3ec3('0x17')](_0xeeb4b2));if(_0xeeb4b2[_0x3ec3('0x18')]){if(_0xeeb4b2[_0x3ec3('0x18')]['code']===0x1f4){logger[_0x3ec3('0x18')](_0x3ec3('0x13'),_0x4cacb1,_0xeeb4b2['error'][_0x3ec3('0x19')]);return _0x46b024(_0xeeb4b2['error'][_0x3ec3('0x19')]);}logger['error'](_0x3ec3('0x13'),_0x4cacb1,_0xeeb4b2[_0x3ec3('0x18')]['message']);return _0x26f9e2(_0xeeb4b2['error']['message']);}else{logger[_0x3ec3('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x4cacb1,_0x3ec3('0x14'));_0x26f9e2(_0xeeb4b2[_0x3ec3('0x1b')][_0x3ec3('0x19')]);}})[_0x3ec3('0x1c')](function(_0x8e9e9a){logger[_0x3ec3('0x18')](_0x3ec3('0x13'),_0x4cacb1,_0x8e9e9a);_0x46b024(_0x8e9e9a);});});}exports['ShowWhatsappAccount']=function(_0x662b47){var _0x151127=this;return new Promise(function(_0x35f881,_0x18a5dc){return db[_0x3ec3('0x1d')][_0x3ec3('0x1e')]({'raw':_0x662b47[_0x3ec3('0x1f')]?_0x662b47[_0x3ec3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x662b47[_0x3ec3('0x1f')]?_0x662b47['options'][_0x3ec3('0x20')]||null:null,'attributes':_0x662b47['options']?_0x662b47['options']['attributes']||null:null,'include':_0x662b47['options']?_0x662b47['options'][_0x3ec3('0x21')]?_[_0x3ec3('0x22')](_0x662b47['options'][_0x3ec3('0x21')],function(_0x37011b){return{'model':db[_0x37011b[_0x3ec3('0x23')]],'as':_0x37011b['as'],'attributes':_0x37011b[_0x3ec3('0x24')],'include':_0x37011b[_0x3ec3('0x21')]?_[_0x3ec3('0x22')](_0x37011b['include'],function(_0x4c79dd){return{'model':db[_0x4c79dd[_0x3ec3('0x23')]],'as':_0x4c79dd['as'],'attributes':_0x4c79dd['attributes'],'include':_0x4c79dd[_0x3ec3('0x21')]?_[_0x3ec3('0x22')](_0x4c79dd[_0x3ec3('0x21')],function(_0x225902){return{'model':db[_0x225902[_0x3ec3('0x23')]],'as':_0x225902['as'],'attributes':_0x225902[_0x3ec3('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ae302){logger['info'](_0x3ec3('0x25'),_0x662b47);logger[_0x3ec3('0x15')]('ShowWhatsappAccount',_0x662b47,JSON[_0x3ec3('0x17')](_0x1ae302));_0x35f881(_0x1ae302);})[_0x3ec3('0x1c')](function(_0x4c17ef){logger[_0x3ec3('0x18')](_0x3ec3('0x25'),_0x4c17ef[_0x3ec3('0x19')],_0x662b47);_0x18a5dc(_0x151127['error'](0x1f4,_0x4c17ef[_0x3ec3('0x19')]));});});}; \ No newline at end of file +var _0x37e0=['WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','attributes','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./whatsappAccount.socket','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b8d66,_0x1a619c){var _0x1fa840=function(_0x5f0cb8){while(--_0x5f0cb8){_0x5b8d66['push'](_0x5b8d66['shift']());}};_0x1fa840(++_0x1a619c);}(_0x37e0,0x13f));var _0x037e=function(_0x5bb2e8,_0x1f5781){_0x5bb2e8=_0x5bb2e8-0x0;var _0x52082d=_0x37e0[_0x5bb2e8];return _0x52082d;};'use strict';var _=require(_0x037e('0x0'));var util=require(_0x037e('0x1'));var moment=require(_0x037e('0x2'));var BPromise=require(_0x037e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x037e('0x4'))['db'];var utils=require(_0x037e('0x5'));var logger=require(_0x037e('0x6'))(_0x037e('0x7'));var config=require('../../config/environment');var jayson=require(_0x037e('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x037e('0x9')]=_[_0x037e('0xa')](config[_0x037e('0x9')],{'host':_0x037e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x037e('0x9')]));require(_0x037e('0xc'))['register'](socket);function respondWithRpcPromise(_0xdb1e1,_0x5ea4fd,_0x27f685){return new BPromise(function(_0x538b9c,_0x1eaad9){return client['request'](_0xdb1e1,_0x27f685)[_0x037e('0xd')](function(_0x135b65){logger[_0x037e('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x5ea4fd,_0x037e('0xf'));logger[_0x037e('0x10')](_0x037e('0x11'),_0x5ea4fd,_0x037e('0xf'),JSON[_0x037e('0x12')](_0x135b65));if(_0x135b65[_0x037e('0x13')]){if(_0x135b65[_0x037e('0x13')][_0x037e('0x14')]===0x1f4){logger['error'](_0x037e('0x15'),_0x5ea4fd,_0x135b65[_0x037e('0x13')][_0x037e('0x16')]);return _0x1eaad9(_0x135b65[_0x037e('0x13')][_0x037e('0x16')]);}logger[_0x037e('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x5ea4fd,_0x135b65[_0x037e('0x13')][_0x037e('0x16')]);return _0x538b9c(_0x135b65[_0x037e('0x13')]['message']);}else{logger['info'](_0x037e('0x15'),_0x5ea4fd,'request\x20sent');_0x538b9c(_0x135b65[_0x037e('0x17')]['message']);}})[_0x037e('0x18')](function(_0x13d6e6){logger[_0x037e('0x13')](_0x037e('0x15'),_0x5ea4fd,_0x13d6e6);_0x1eaad9(_0x13d6e6);});});}exports[_0x037e('0x19')]=function(_0x34bd05){var _0x443df5=this;return new Promise(function(_0xd9bffa,_0x2cc661){return db[_0x037e('0x1a')]['find']({'raw':_0x34bd05[_0x037e('0x1b')]?_0x34bd05['options'][_0x037e('0x1c')]===undefined?!![]:![]:!![],'where':_0x34bd05[_0x037e('0x1b')]?_0x34bd05[_0x037e('0x1b')][_0x037e('0x1d')]||null:null,'attributes':_0x34bd05[_0x037e('0x1b')]?_0x34bd05[_0x037e('0x1b')]['attributes']||null:null,'include':_0x34bd05[_0x037e('0x1b')]?_0x34bd05[_0x037e('0x1b')][_0x037e('0x1e')]?_['map'](_0x34bd05[_0x037e('0x1b')]['include'],function(_0x4eb12c){return{'model':db[_0x4eb12c['model']],'as':_0x4eb12c['as'],'attributes':_0x4eb12c[_0x037e('0x1f')],'include':_0x4eb12c['include']?_[_0x037e('0x20')](_0x4eb12c[_0x037e('0x1e')],function(_0x543e13){return{'model':db[_0x543e13[_0x037e('0x21')]],'as':_0x543e13['as'],'attributes':_0x543e13[_0x037e('0x1f')],'include':_0x543e13['include']?_[_0x037e('0x20')](_0x543e13[_0x037e('0x1e')],function(_0x51fb94){return{'model':db[_0x51fb94[_0x037e('0x21')]],'as':_0x51fb94['as'],'attributes':_0x51fb94['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xffc075){logger[_0x037e('0xe')](_0x037e('0x19'),_0x34bd05);logger[_0x037e('0x10')](_0x037e('0x19'),_0x34bd05,JSON[_0x037e('0x12')](_0xffc075));_0xd9bffa(_0xffc075);})[_0x037e('0x18')](function(_0x3e6bfb){logger['error'](_0x037e('0x19'),_0x3e6bfb['message'],_0x34bd05);_0x2cc661(_0x443df5[_0x037e('0x13')](0x1f4,_0x3e6bfb[_0x037e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 72ae30f..4adeed5 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 _0x3e6c=['emit','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x47fc17,_0x512985){var _0x4cc25d=function(_0x53a9c9){while(--_0x53a9c9){_0x47fc17['push'](_0x47fc17['shift']());}};_0x4cc25d(++_0x512985);}(_0x3e6c,0xa4));var _0xc3e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e6c[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0xc3e6('0x0'));var events=[_0xc3e6('0x1'),_0xc3e6('0x2'),_0xc3e6('0x3')];function createListener(_0x726683,_0x4deb48){return function(_0x276a99){_0x4deb48[_0xc3e6('0x4')](_0x726683,_0x276a99);};}function removeListener(_0x5f35aa,_0x19d146){return function(){WhatsappAccountEvents['removeListener'](_0x5f35aa,_0x19d146);};}exports['register']=function(_0x38c5bb){for(var _0x1f4622=0x0,_0x309a52=events[_0xc3e6('0x5')];_0x1f4622<_0x309a52;_0x1f4622++){var _0xa30f2f=events[_0x1f4622];var _0x16f1c9=createListener(_0xc3e6('0x6')+_0xa30f2f,_0x38c5bb);WhatsappAccountEvents['on'](_0xa30f2f,_0x16f1c9);}}; \ No newline at end of file +var _0xf293=['save','remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x3f901e,_0x281034){var _0x54af38=function(_0x5542f5){while(--_0x5542f5){_0x3f901e['push'](_0x3f901e['shift']());}};_0x54af38(++_0x281034);}(_0xf293,0x1bf));var _0x3f29=function(_0x5ddc29,_0x51fa80){_0x5ddc29=_0x5ddc29-0x0;var _0x3903a2=_0xf293[_0x5ddc29];return _0x3903a2;};'use strict';var WhatsappAccountEvents=require(_0x3f29('0x0'));var events=[_0x3f29('0x1'),_0x3f29('0x2'),_0x3f29('0x3')];function createListener(_0x4d4b0f,_0x41d141){return function(_0x882995){_0x41d141[_0x3f29('0x4')](_0x4d4b0f,_0x882995);};}function removeListener(_0x7a22e2,_0x53f6dd){return function(){WhatsappAccountEvents[_0x3f29('0x5')](_0x7a22e2,_0x53f6dd);};}exports['register']=function(_0x3939cf){for(var _0x52fb1e=0x0,_0x580a06=events[_0x3f29('0x6')];_0x52fb1e<_0x580a06;_0x52fb1e++){var _0x4cc732=events[_0x52fb1e];var _0x33531f=createListener(_0x3f29('0x7')+_0x4cc732,_0x3939cf);WhatsappAccountEvents['on'](_0x4cc732,_0x33531f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 98bd663..b99fa01 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 _0xe042=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','update'];(function(_0x48a1b2,_0x41e5f5){var _0x31cff9=function(_0x5338b9){while(--_0x5338b9){_0x48a1b2['push'](_0x48a1b2['shift']());}};_0x31cff9(++_0x41e5f5);}(_0xe042,0xd5));var _0x2e04=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xe042[_0x5ce8b9];return _0xe34be0;};'use strict';var multer=require(_0x2e04('0x0'));var util=require(_0x2e04('0x1'));var path=require(_0x2e04('0x2'));var timeout=require(_0x2e04('0x3'));var express=require(_0x2e04('0x4'));var router=express[_0x2e04('0x5')]();var fs_extra=require(_0x2e04('0x6'));var auth=require(_0x2e04('0x7'));var interaction=require(_0x2e04('0x8'));var config=require(_0x2e04('0x9'));var controller=require(_0x2e04('0xa'));router[_0x2e04('0xb')]('/',auth[_0x2e04('0xc')](),controller[_0x2e04('0xd')]);router[_0x2e04('0xb')](_0x2e04('0xe'),auth[_0x2e04('0xc')](),controller[_0x2e04('0xf')]);router[_0x2e04('0x10')]('/',auth[_0x2e04('0xc')](),controller['create']);router['put'](_0x2e04('0xe'),auth[_0x2e04('0xc')](),controller[_0x2e04('0x11')]);router[_0x2e04('0x12')](_0x2e04('0xe'),auth[_0x2e04('0xc')](),controller[_0x2e04('0x13')]);module[_0x2e04('0x14')]=router; \ No newline at end of file +var _0x9d7e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28e0c5,_0xae901c){var _0x154afc=function(_0x9a6c91){while(--_0x9a6c91){_0x28e0c5['push'](_0x28e0c5['shift']());}};_0x154afc(++_0xae901c);}(_0x9d7e,0x1af));var _0xe9d7=function(_0x42c8d8,_0x393a4d){_0x42c8d8=_0x42c8d8-0x0;var _0x3ca1c6=_0x9d7e[_0x42c8d8];return _0x3ca1c6;};'use strict';var multer=require('multer');var util=require(_0xe9d7('0x0'));var path=require(_0xe9d7('0x1'));var timeout=require(_0xe9d7('0x2'));var express=require(_0xe9d7('0x3'));var router=express[_0xe9d7('0x4')]();var fs_extra=require(_0xe9d7('0x5'));var auth=require(_0xe9d7('0x6'));var interaction=require(_0xe9d7('0x7'));var config=require(_0xe9d7('0x8'));var controller=require(_0xe9d7('0x9'));router['get']('/',auth[_0xe9d7('0xa')](),controller[_0xe9d7('0xb')]);router['get'](_0xe9d7('0xc'),auth[_0xe9d7('0xa')](),controller[_0xe9d7('0xd')]);router[_0xe9d7('0xe')]('/',auth[_0xe9d7('0xa')](),controller['create']);router[_0xe9d7('0xf')](_0xe9d7('0xc'),auth[_0xe9d7('0xa')](),controller[_0xe9d7('0x10')]);router[_0xe9d7('0x11')](_0xe9d7('0xc'),auth['isAuthenticated'](),controller[_0xe9d7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 05b69a2..7147f30 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 _0x3bfb=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x329293,_0x24e8d7){var _0x3a60fb=function(_0x1685be){while(--_0x1685be){_0x329293['push'](_0x329293['shift']());}};_0x3a60fb(++_0x24e8d7);}(_0x3bfb,0x8a));var _0xb3bf=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x3bfb[_0x33154d];return _0x3b2f03;};'use strict';var Sequelize=require(_0xb3bf('0x0'));module[_0xb3bf('0x1')]={'priority':{'type':Sequelize[_0xb3bf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb3bf('0x3')],'allowNull':![],'defaultValue':_0xb3bf('0x4')},'appdata':{'type':Sequelize[_0xb3bf('0x5')]()},'description':{'type':Sequelize[_0xb3bf('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb3bf('0x6')}}; \ No newline at end of file +var _0x7387=['TEXT','*,*,*,*','exports','INTEGER'];(function(_0x4d5afa,_0x44849a){var _0x19fe54=function(_0x2ade62){while(--_0x2ade62){_0x4d5afa['push'](_0x4d5afa['shift']());}};_0x19fe54(++_0x44849a);}(_0x7387,0xbe));var _0x7738=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7387[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x7738('0x0')]={'priority':{'type':Sequelize[_0x7738('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7738('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7738('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 49691ed..8c738aa 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 _0xe1c4=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5737f2,_0x33cce0){var _0x4ad3f9=function(_0x506e8f){while(--_0x506e8f){_0x5737f2['push'](_0x5737f2['shift']());}};_0x4ad3f9(++_0x33cce0);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x2b698c,_0x5bbdd5){_0x2b698c=_0x2b698c-0x0;var _0x535317=_0xe1c4[_0x2b698c];return _0x535317;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4e1c('0x4'));var util=require(_0x4e1c('0x5'));var path=require(_0x4e1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e1c('0x7'));var fs=require('fs');var fs_extra=require(_0x4e1c('0x8'));var _=require(_0x4e1c('0x9'));var squel=require(_0x4e1c('0xa'));var crypto=require(_0x4e1c('0xb'));var jsforce=require(_0x4e1c('0xc'));var deskjs=require(_0x4e1c('0xd'));var toCsv=require(_0x4e1c('0xe'));var querystring=require(_0x4e1c('0xf'));var Papa=require(_0x4e1c('0x10'));var Redis=require(_0x4e1c('0x11'));var authService=require(_0x4e1c('0x12'));var qs=require(_0x4e1c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e1c('0x14'));var logger=require(_0x4e1c('0x15'))('api');var utils=require(_0x4e1c('0x16'));var config=require(_0x4e1c('0x17'));var licenseUtil=require(_0x4e1c('0x18'));var db=require(_0x4e1c('0x19'))['db'];function respondWithStatusCode(_0x54b2d1,_0xb4a030){_0xb4a030=_0xb4a030||0xcc;return function(_0x12178d){if(_0x12178d){return _0x54b2d1[_0x4e1c('0x1a')](_0xb4a030);}return _0x54b2d1[_0x4e1c('0x1b')](_0xb4a030)['end']();};}function respondWithResult(_0x531159,_0x550f27){_0x550f27=_0x550f27||0xc8;return function(_0x12e7fe){if(_0x12e7fe){return _0x531159[_0x4e1c('0x1b')](_0x550f27)[_0x4e1c('0x1c')](_0x12e7fe);}};}function respondWithFilteredResult(_0x201779,_0x4d47ec){return function(_0x2cd5bc){if(_0x2cd5bc){var _0x374c78=typeof _0x4d47ec[_0x4e1c('0x1d')]===_0x4e1c('0x1e')&&typeof _0x4d47ec[_0x4e1c('0x1f')]===_0x4e1c('0x1e');var _0x58d9e3=_0x2cd5bc[_0x4e1c('0x20')];var _0x399bcc=_0x374c78?0x0:_0x4d47ec[_0x4e1c('0x1d')];var _0x46a887=_0x374c78?_0x2cd5bc[_0x4e1c('0x20')]:_0x4d47ec[_0x4e1c('0x1d')]+_0x4d47ec[_0x4e1c('0x1f')];var _0x544b08;if(_0x46a887>=_0x58d9e3){_0x46a887=_0x58d9e3;_0x544b08=0xc8;}else{_0x544b08=0xce;}_0x201779[_0x4e1c('0x1b')](_0x544b08);return _0x201779[_0x4e1c('0x21')](_0x4e1c('0x22'),_0x399bcc+'-'+_0x46a887+'/'+_0x58d9e3)[_0x4e1c('0x1c')](_0x2cd5bc);}return null;};}function patchUpdates(_0x33da37){return function(_0x427cc1){try{jsonpatch[_0x4e1c('0x23')](_0x427cc1,_0x33da37,!![]);}catch(_0x53a020){return BPromise[_0x4e1c('0x24')](_0x53a020);}return _0x427cc1[_0x4e1c('0x25')]();};}function saveUpdates(_0xc57bcc,_0x169b4e){return function(_0x3dde0d){if(_0x3dde0d){return _0x3dde0d[_0x4e1c('0x26')](_0xc57bcc)[_0x4e1c('0x27')](function(_0x19ed77){return _0x19ed77;});}return null;};}function removeEntity(_0x45c13e,_0x5ada14){return function(_0x46ad33){if(_0x46ad33){return _0x46ad33[_0x4e1c('0x28')]()[_0x4e1c('0x27')](function(){_0x45c13e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f5a5,_0x551d50){return function(_0x25cc93){if(!_0x25cc93){_0x17f5a5[_0x4e1c('0x1a')](0x194);}return _0x25cc93;};}function handleError(_0x2a2ccb,_0x564b30){_0x564b30=_0x564b30||0x1f4;return function(_0x12364d){logger[_0x4e1c('0x29')](_0x12364d['stack']);if(_0x12364d[_0x4e1c('0x2a')]){delete _0x12364d[_0x4e1c('0x2a')];}_0x2a2ccb[_0x4e1c('0x1b')](_0x564b30)[_0x4e1c('0x2b')](_0x12364d);};}exports[_0x4e1c('0x2c')]=function(_0x5ef2f7,_0xeccf79){var _0x8e3e14={},_0x1b5ba8={},_0x1c4c4a={'count':0x0,'rows':[]};var _0x504259=_[_0x4e1c('0x2d')](db[_0x4e1c('0x2e')]['rawAttributes'],function(_0x46d181){return{'name':_0x46d181['fieldName'],'type':_0x46d181[_0x4e1c('0x2f')][_0x4e1c('0x30')]};});_0x1b5ba8[_0x4e1c('0x31')]=_[_0x4e1c('0x2d')](_0x504259,'name');_0x1b5ba8[_0x4e1c('0x32')]=_['keys'](_0x5ef2f7[_0x4e1c('0x32')]);_0x1b5ba8['filters']=_[_0x4e1c('0x33')](_0x1b5ba8[_0x4e1c('0x31')],_0x1b5ba8['query']);_0x8e3e14[_0x4e1c('0x34')]=_['intersection'](_0x1b5ba8[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x35')]));_0x8e3e14[_0x4e1c('0x34')]=_0x8e3e14[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x8e3e14[_0x4e1c('0x34')]:_0x1b5ba8[_0x4e1c('0x31')];if(!_0x5ef2f7[_0x4e1c('0x32')]['hasOwnProperty'](_0x4e1c('0x37'))){_0x8e3e14[_0x4e1c('0x1f')]=qs[_0x4e1c('0x1f')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x1f')]);_0x8e3e14[_0x4e1c('0x1d')]=qs['offset'](_0x5ef2f7['query'][_0x4e1c('0x1d')]);}_0x8e3e14[_0x4e1c('0x38')]=qs[_0x4e1c('0x39')](_0x5ef2f7[_0x4e1c('0x32')]['sort']);_0x8e3e14[_0x4e1c('0x3a')]=qs[_0x4e1c('0x3b')](_['pick'](_0x5ef2f7[_0x4e1c('0x32')],_0x1b5ba8[_0x4e1c('0x3b')]),_0x504259);if(_0x5ef2f7[_0x4e1c('0x32')]['filter']){_0x8e3e14[_0x4e1c('0x3a')]=_[_0x4e1c('0x3c')](_0x8e3e14['where'],{'$or':_[_0x4e1c('0x2d')](_0x504259,function(_0x128ddd){if(_0x128ddd[_0x4e1c('0x2f')]!==_0x4e1c('0x3d')){var _0x1cb1a3={};_0x1cb1a3[_0x128ddd[_0x4e1c('0x2a')]]={'$like':'%'+_0x5ef2f7['query']['filter']+'%'};return _0x1cb1a3;}})});}_0x8e3e14=_[_0x4e1c('0x3c')]({},_0x8e3e14,_0x5ef2f7[_0x4e1c('0x3e')]);var _0x390d05={'where':_0x8e3e14[_0x4e1c('0x3a')]};return db[_0x4e1c('0x2e')][_0x4e1c('0x20')](_0x390d05)[_0x4e1c('0x27')](function(_0x6838bc){_0x1c4c4a[_0x4e1c('0x20')]=_0x6838bc;if(_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x3f')]){_0x8e3e14['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x4e1c('0x40')](_0x8e3e14);})[_0x4e1c('0x27')](function(_0xe26367){_0x1c4c4a[_0x4e1c('0x41')]=_0xe26367;return _0x1c4c4a;})[_0x4e1c('0x27')](respondWithFilteredResult(_0xeccf79,_0x8e3e14))[_0x4e1c('0x42')](handleError(_0xeccf79,null));};exports['show']=function(_0x18d021,_0x1da617){var _0x827f0a={'raw':!![],'where':{'id':_0x18d021[_0x4e1c('0x43')]['id']}},_0xdfb6d7={};_0xdfb6d7[_0x4e1c('0x31')]=_[_0x4e1c('0x44')](db[_0x4e1c('0x2e')][_0x4e1c('0x45')]);_0xdfb6d7[_0x4e1c('0x32')]=_[_0x4e1c('0x44')](_0x18d021['query']);_0xdfb6d7[_0x4e1c('0x3b')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],_0xdfb6d7[_0x4e1c('0x32')]);_0x827f0a[_0x4e1c('0x34')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x18d021['query'][_0x4e1c('0x35')]));_0x827f0a['attributes']=_0x827f0a[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x827f0a['attributes']:_0xdfb6d7[_0x4e1c('0x31')];if(_0x18d021[_0x4e1c('0x32')]['includeAll']){_0x827f0a['include']=[{'all':!![]}];}_0x827f0a=_[_0x4e1c('0x3c')]({},_0x827f0a,_0x18d021[_0x4e1c('0x3e')]);return db[_0x4e1c('0x2e')][_0x4e1c('0x46')](_0x827f0a)['then'](handleEntityNotFound(_0x1da617,null))[_0x4e1c('0x27')](respondWithResult(_0x1da617,null))[_0x4e1c('0x42')](handleError(_0x1da617,null));};exports[_0x4e1c('0x47')]=function(_0x6fae67,_0x488fe4){return db[_0x4e1c('0x2e')][_0x4e1c('0x47')](_0x6fae67[_0x4e1c('0x48')],{})[_0x4e1c('0x27')](respondWithResult(_0x488fe4,0xc9))[_0x4e1c('0x42')](handleError(_0x488fe4,null));};exports[_0x4e1c('0x26')]=function(_0x38aa72,_0x25ba45){if(_0x38aa72[_0x4e1c('0x48')]['id']){delete _0x38aa72['body']['id'];}return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x38aa72[_0x4e1c('0x43')]['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x25ba45,null))[_0x4e1c('0x27')](saveUpdates(_0x38aa72['body'],null))['then'](respondWithResult(_0x25ba45,null))[_0x4e1c('0x42')](handleError(_0x25ba45,null));};exports[_0x4e1c('0x28')]=function(_0x4b6910,_0x304b74){return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x4b6910['params']['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x304b74,null))['then'](removeEntity(_0x304b74,null))[_0x4e1c('0x42')](handleError(_0x304b74,null));}; \ No newline at end of file +var _0x15ef=['bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','save','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','WhatsappApplication','include','findAll','catch','show','params','length','includeAll','options','find','create','body','update','rimraf','zip-dir','request-promise','moment'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x15ef,0x80));var _0xf15e=function(_0x4346bc,_0x137746){_0x4346bc=_0x4346bc-0x0;var _0x3093ea=_0x15ef[_0x4346bc];return _0x3093ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf15e('0x0'));var zipdir=require(_0xf15e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf15e('0x2'));var moment=require(_0xf15e('0x3'));var BPromise=require(_0xf15e('0x4'));var Mustache=require(_0xf15e('0x5'));var util=require(_0xf15e('0x6'));var path=require('path');var sox=require(_0xf15e('0x7'));var csv=require(_0xf15e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf15e('0x9'));var squel=require(_0xf15e('0xa'));var crypto=require('crypto');var jsforce=require(_0xf15e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf15e('0x8'));var querystring=require(_0xf15e('0xc'));var Papa=require(_0xf15e('0xd'));var Redis=require(_0xf15e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15e('0xf'));var logger=require(_0xf15e('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf15e('0x11'));var db=require(_0xf15e('0x12'))['db'];function respondWithStatusCode(_0x8551e2,_0x5809f7){_0x5809f7=_0x5809f7||0xcc;return function(_0x442d51){if(_0x442d51){return _0x8551e2[_0xf15e('0x13')](_0x5809f7);}return _0x8551e2[_0xf15e('0x14')](_0x5809f7)['end']();};}function respondWithResult(_0x1ec4ad,_0x1d76e9){_0x1d76e9=_0x1d76e9||0xc8;return function(_0x3e1b34){if(_0x3e1b34){return _0x1ec4ad[_0xf15e('0x14')](_0x1d76e9)[_0xf15e('0x15')](_0x3e1b34);}};}function respondWithFilteredResult(_0x1cbcc3,_0x17c241){return function(_0x2d6bd7){if(_0x2d6bd7){var _0x54b94c=typeof _0x17c241[_0xf15e('0x16')]===_0xf15e('0x17')&&typeof _0x17c241['limit']===_0xf15e('0x17');var _0x4356ca=_0x2d6bd7[_0xf15e('0x18')];var _0x487018=_0x54b94c?0x0:_0x17c241['offset'];var _0x3ad067=_0x54b94c?_0x2d6bd7[_0xf15e('0x18')]:_0x17c241['offset']+_0x17c241[_0xf15e('0x19')];var _0x1f1f33;if(_0x3ad067>=_0x4356ca){_0x3ad067=_0x4356ca;_0x1f1f33=0xc8;}else{_0x1f1f33=0xce;}_0x1cbcc3[_0xf15e('0x14')](_0x1f1f33);return _0x1cbcc3['set']('Content-Range',_0x487018+'-'+_0x3ad067+'/'+_0x4356ca)[_0xf15e('0x15')](_0x2d6bd7);}return null;};}function patchUpdates(_0x3fa737){return function(_0x499658){try{jsonpatch[_0xf15e('0x1a')](_0x499658,_0x3fa737,!![]);}catch(_0x56e8c9){return BPromise['reject'](_0x56e8c9);}return _0x499658[_0xf15e('0x1b')]();};}function saveUpdates(_0x239d41,_0x389489){return function(_0x9ece34){if(_0x9ece34){return _0x9ece34['update'](_0x239d41)[_0xf15e('0x1c')](function(_0xa09c0c){return _0xa09c0c;});}return null;};}function removeEntity(_0x302b70,_0x51c06a){return function(_0x248c4b){if(_0x248c4b){return _0x248c4b[_0xf15e('0x1d')]()['then'](function(){_0x302b70['status'](0xcc)[_0xf15e('0x1e')]();});}};}function handleEntityNotFound(_0xb36af,_0x1fd237){return function(_0x471079){if(!_0x471079){_0xb36af[_0xf15e('0x13')](0x194);}return _0x471079;};}function handleError(_0x58877f,_0x48764e){_0x48764e=_0x48764e||0x1f4;return function(_0x3f9d64){logger[_0xf15e('0x1f')](_0x3f9d64['stack']);if(_0x3f9d64[_0xf15e('0x20')]){delete _0x3f9d64[_0xf15e('0x20')];}_0x58877f[_0xf15e('0x14')](_0x48764e)[_0xf15e('0x21')](_0x3f9d64);};}exports[_0xf15e('0x22')]=function(_0xff4c07,_0x1e6a63){var _0x40321a={},_0x5dd9cf={},_0x3567d5={'count':0x0,'rows':[]};var _0x17f112=_[_0xf15e('0x23')](db['WhatsappApplication'][_0xf15e('0x24')],function(_0x203711){return{'name':_0x203711['fieldName'],'type':_0x203711[_0xf15e('0x25')][_0xf15e('0x26')]};});_0x5dd9cf[_0xf15e('0x27')]=_['map'](_0x17f112,_0xf15e('0x20'));_0x5dd9cf[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0xff4c07[_0xf15e('0x28')]);_0x5dd9cf['filters']=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],_0x5dd9cf['query']);_0x40321a[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],qs['fields'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2c')]));_0x40321a['attributes']=_0x40321a[_0xf15e('0x2b')]['length']?_0x40321a[_0xf15e('0x2b')]:_0x5dd9cf[_0xf15e('0x27')];if(!_0xff4c07['query']['hasOwnProperty'](_0xf15e('0x2d'))){_0x40321a[_0xf15e('0x19')]=qs['limit'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x19')]);_0x40321a[_0xf15e('0x16')]=qs[_0xf15e('0x16')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x16')]);}_0x40321a['order']=qs[_0xf15e('0x2e')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2e')]);_0x40321a[_0xf15e('0x2f')]=qs[_0xf15e('0x30')](_[_0xf15e('0x31')](_0xff4c07[_0xf15e('0x28')],_0x5dd9cf[_0xf15e('0x30')]),_0x17f112);if(_0xff4c07['query'][_0xf15e('0x32')]){_0x40321a['where']=_[_0xf15e('0x33')](_0x40321a[_0xf15e('0x2f')],{'$or':_[_0xf15e('0x23')](_0x17f112,function(_0x40e707){if(_0x40e707[_0xf15e('0x25')]!==_0xf15e('0x34')){var _0x4d411f={};_0x4d411f[_0x40e707[_0xf15e('0x20')]]={'$like':'%'+_0xff4c07[_0xf15e('0x28')][_0xf15e('0x32')]+'%'};return _0x4d411f;}})});}_0x40321a=_[_0xf15e('0x33')]({},_0x40321a,_0xff4c07['options']);var _0x52ebab={'where':_0x40321a[_0xf15e('0x2f')]};return db[_0xf15e('0x35')][_0xf15e('0x18')](_0x52ebab)['then'](function(_0x514c68){_0x3567d5['count']=_0x514c68;if(_0xff4c07['query']['includeAll']){_0x40321a[_0xf15e('0x36')]=[{'all':!![]}];}return db[_0xf15e('0x35')][_0xf15e('0x37')](_0x40321a);})['then'](function(_0x3a56bd){_0x3567d5['rows']=_0x3a56bd;return _0x3567d5;})[_0xf15e('0x1c')](respondWithFilteredResult(_0x1e6a63,_0x40321a))[_0xf15e('0x38')](handleError(_0x1e6a63,null));};exports[_0xf15e('0x39')]=function(_0x180d7a,_0x52bbc4){var _0xf32fc5={'raw':!![],'where':{'id':_0x180d7a[_0xf15e('0x3a')]['id']}},_0x37f0a6={};_0x37f0a6[_0xf15e('0x27')]=_[_0xf15e('0x29')](db['WhatsappApplication'][_0xf15e('0x24')]);_0x37f0a6[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0x180d7a[_0xf15e('0x28')]);_0x37f0a6[_0xf15e('0x30')]=_[_0xf15e('0x2a')](_0x37f0a6[_0xf15e('0x27')],_0x37f0a6['query']);_0xf32fc5[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x37f0a6['model'],qs['fields'](_0x180d7a[_0xf15e('0x28')]['fields']));_0xf32fc5['attributes']=_0xf32fc5[_0xf15e('0x2b')][_0xf15e('0x3b')]?_0xf32fc5['attributes']:_0x37f0a6[_0xf15e('0x27')];if(_0x180d7a[_0xf15e('0x28')][_0xf15e('0x3c')]){_0xf32fc5[_0xf15e('0x36')]=[{'all':!![]}];}_0xf32fc5=_[_0xf15e('0x33')]({},_0xf32fc5,_0x180d7a[_0xf15e('0x3d')]);return db[_0xf15e('0x35')][_0xf15e('0x3e')](_0xf32fc5)[_0xf15e('0x1c')](handleEntityNotFound(_0x52bbc4,null))['then'](respondWithResult(_0x52bbc4,null))[_0xf15e('0x38')](handleError(_0x52bbc4,null));};exports[_0xf15e('0x3f')]=function(_0x3b79a8,_0x5b31c9){return db['WhatsappApplication'][_0xf15e('0x3f')](_0x3b79a8[_0xf15e('0x40')],{})[_0xf15e('0x1c')](respondWithResult(_0x5b31c9,0xc9))[_0xf15e('0x38')](handleError(_0x5b31c9,null));};exports[_0xf15e('0x41')]=function(_0xac7515,_0x3b5c7b){if(_0xac7515[_0xf15e('0x40')]['id']){delete _0xac7515['body']['id'];}return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0xac7515['params']['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3b5c7b,null))['then'](saveUpdates(_0xac7515[_0xf15e('0x40')],null))[_0xf15e('0x1c')](respondWithResult(_0x3b5c7b,null))[_0xf15e('0x38')](handleError(_0x3b5c7b,null));};exports['destroy']=function(_0x46e6e9,_0x3e2fd6){return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0x46e6e9[_0xf15e('0x3a')]['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3e2fd6,null))[_0xf15e('0x1c')](removeEntity(_0x3e2fd6,null))[_0xf15e('0x38')](handleError(_0x3e2fd6,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7989472..eb336ab 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 _0xd737=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xd737,0x85));var _0x7d73=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xd737[_0xf1af27];return _0x46b274;};'use strict';var _=require(_0x7d73('0x0'));var util=require('util');var logger=require(_0x7d73('0x1'))('api');var moment=require(_0x7d73('0x2'));var BPromise=require(_0x7d73('0x3'));var rp=require(_0x7d73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d73('0x5'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0xaa37cc,_0x20b8a9){return _0xaa37cc[_0x7d73('0x6')](_0x7d73('0x7'),attributes,{'tableName':_0x7d73('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d73('0x9'),'collate':_0x7d73('0xa')});}; \ No newline at end of file +var _0x535f=['bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x37c827,_0x31be31){var _0x173b26=function(_0x48f0f9){while(--_0x48f0f9){_0x37c827['push'](_0x37c827['shift']());}};_0x173b26(++_0x31be31);}(_0x535f,0x111));var _0xf535=function(_0x264d6f,_0x2bf363){_0x264d6f=_0x264d6f-0x0;var _0x26bb6f=_0x535f[_0x264d6f];return _0x26bb6f;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var logger=require(_0xf535('0x1'))('api');var moment=require(_0xf535('0x2'));var BPromise=require(_0xf535('0x3'));var rp=require(_0xf535('0x4'));var fs=require('fs');var path=require(_0xf535('0x5'));var rimraf=require('rimraf');var config=require(_0xf535('0x6'));var attributes=require(_0xf535('0x7'));module[_0xf535('0x8')]=function(_0x30936d,_0x41ca74){return _0x30936d[_0xf535('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf535('0xa'),'collate':_0xf535('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 8950425..bca1039 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result'];(function(_0xb065e3,_0x2d01cf){var _0x1db262=function(_0x7cc0ad){while(--_0x7cc0ad){_0xb065e3['push'](_0xb065e3['shift']());}};_0x1db262(++_0x2d01cf);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3422bf,_0x21b1da){_0x3422bf=_0x3422bf-0x0;var _0x4de668=_0xf3cd[_0x3422bf];return _0x4de668;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ 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(_0x148271,_0x1ba6b0){var _0x1b4dbf=function(_0x2db098){while(--_0x2db098){_0x148271['push'](_0x148271['shift']());}};_0x1b4dbf(++_0x1ba6b0);}(_0xda55,0x6d));var _0x5da5=function(_0x439a35,_0x568884){_0x439a35=_0x439a35-0x0;var _0x4e59e0=_0xda55[_0x439a35];return _0x4e59e0;};'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 c516ee5..3cb13b4 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 _0x5fab=['/:id/messages','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create'];(function(_0x1725fb,_0x1ab651){var _0x4e652e=function(_0x26bad5){while(--_0x26bad5){_0x1725fb['push'](_0x1725fb['shift']());}};_0x4e652e(++_0x1ab651);}(_0x5fab,0x177));var _0xb5fa=function(_0x39714b,_0x5e0b0e){_0x39714b=_0x39714b-0x0;var _0x45ed60=_0x5fab[_0x39714b];return _0x45ed60;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/messages',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')]('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);router['post'](_0xb5fa('0x15'),auth[_0xb5fa('0xb')](),controller['addMessage']);router[_0xb5fa('0x13')]('/:id/tags',auth[_0xb5fa('0xb')](),interaction[_0xb5fa('0x16')](_0xb5fa('0x17'),_0xb5fa('0x18')),controller[_0xb5fa('0x19')]);router['put']('/:id',auth[_0xb5fa('0xb')](),interaction[_0xb5fa('0x16')](_0xb5fa('0x17'),_0xb5fa('0x1a')),controller['update']);router['delete'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),interaction[_0xb5fa('0x16')](_0xb5fa('0x17'),_0xb5fa('0x1b')),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1d')](_0xb5fa('0x1e'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);module[_0xb5fa('0x20')]=router; \ No newline at end of file +var _0x6f47=['whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','addTags','put','tracked','whatsapp'];(function(_0x4c4766,_0xd5157b){var _0x2057c3=function(_0xdbf373){while(--_0xdbf373){_0x4c4766['push'](_0x4c4766['shift']());}};_0x2057c3(++_0xd5157b);}(_0x6f47,0xc7));var _0x76f4=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x6f47[_0x34bf97];return _0x292719;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['get']('/:id/messages',auth[_0x76f4('0xc')](),controller[_0x76f4('0xe')]);router['get']('/:id/download',auth[_0x76f4('0xc')](),controller[_0x76f4('0xf')]);router[_0x76f4('0x10')]('/',auth[_0x76f4('0xc')](),controller[_0x76f4('0x11')]);router[_0x76f4('0x10')](_0x76f4('0x12'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x13')]);router['post'](_0x76f4('0x14'),auth[_0x76f4('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller[_0x76f4('0x15')]);router[_0x76f4('0x16')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),interaction[_0x76f4('0x17')](_0x76f4('0x18'),_0x76f4('0x19')),controller[_0x76f4('0x1a')]);router[_0x76f4('0x1b')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),interaction[_0x76f4('0x17')](_0x76f4('0x18'),_0x76f4('0x1c')),controller[_0x76f4('0x1d')]);router[_0x76f4('0x1b')](_0x76f4('0x14'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x1e')]);module[_0x76f4('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index cdc7f09..47f3f19 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 _0xff2a=['moment','exports','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x50450d,_0x314c15){var _0x1c391b=function(_0x3d5c86){while(--_0x3d5c86){_0x50450d['push'](_0x50450d['shift']());}};_0x1c391b(++_0x314c15);}(_0xff2a,0x93));var _0xaff2=function(_0x1c2fd7,_0x595cf1){_0x1c2fd7=_0x1c2fd7-0x0;var _0x369e9d=_0xff2a[_0x1c2fd7];return _0x369e9d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaff2('0x0'));module[_0xaff2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaff2('0x2')]},'disposition':{'type':Sequelize[_0xaff2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaff2('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xaff2('0x3')]},'read1stAt':{'type':Sequelize[_0xaff2('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaff2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaff2('0x5')]('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaff2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x50d0=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x5ca410,_0x3e9355){var _0x1c9d4e=function(_0x41f578){while(--_0x41f578){_0x5ca410['push'](_0x5ca410['shift']());}};_0x1c9d4e(++_0x3e9355);}(_0x50d0,0x101));var _0x050d=function(_0x5bdd92,_0x223f70){_0x5bdd92=_0x5bdd92-0x0;var _0x2b757c=_0x50d0[_0x5bdd92];return _0x2b757c;};'use strict';var Sequelize=require(_0x050d('0x0'));var moment=require('moment');module[_0x050d('0x1')]={'closed':{'type':Sequelize[_0x050d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x050d('0x3')]},'disposition':{'type':Sequelize[_0x050d('0x4')]},'secondDisposition':{'type':Sequelize[_0x050d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x050d('0x4')]},'phone':{'type':Sequelize[_0x050d('0x4')]},'read1stAt':{'type':Sequelize[_0x050d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x050d('0x5')]('in',_0x050d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x050d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x050d('0x5')]('in',_0x050d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x050d('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 602359d..a2f92db 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 _0x6953=['`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','getWhatsappAccounts','role','sequelize','keyBy','merge','WhatsappInteraction','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','toString','groupBy','WhatsappInteractionId','all','rows','catch','show','params','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','disposition','basename','createReadStream','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','push','then','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0x6953,0x91));var _0x3695=function(_0x375c32,_0x40aa91){_0x375c32=_0x375c32-0x0;var _0x1fd9b6=_0x6953[_0x375c32];return _0x1fd9b6;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3695('0xe'));var hardwareService=require(_0x3695('0xf'));var logger=require(_0x3695('0x10'))(_0x3695('0x11'));var utils=require(_0x3695('0x12'));var config=require(_0x3695('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3695('0x14'))['db'];config[_0x3695('0x15')]=_[_0x3695('0x16')](config[_0x3695('0x15')],{'host':_0x3695('0x17'),'port':0x18eb});var socket=require(_0x3695('0x18'))(new Redis(config[_0x3695('0x15')]));require(_0x3695('0x19'))[_0x3695('0x1a')](socket);function respondWithStatusCode(_0xc5dc5,_0x1ffebd){_0x1ffebd=_0x1ffebd||0xcc;return function(_0x4ca317){if(_0x4ca317){return _0xc5dc5[_0x3695('0x1b')](_0x1ffebd);}return _0xc5dc5[_0x3695('0x1c')](_0x1ffebd)[_0x3695('0x1d')]();};}function respondWithResult(_0x3cb320,_0x367191){_0x367191=_0x367191||0xc8;return function(_0x1973ee){if(_0x1973ee){return _0x3cb320[_0x3695('0x1c')](_0x367191)['json'](_0x1973ee);}};}function respondWithFilteredResult(_0x717ee4,_0x5edf8d){return function(_0x1082db){if(_0x1082db){var _0xcc93bb=typeof _0x5edf8d[_0x3695('0x1e')]===_0x3695('0x1f')&&typeof _0x5edf8d[_0x3695('0x20')]==='undefined';var _0x1bb921=_0x1082db[_0x3695('0x21')];var _0x33901c=_0xcc93bb?0x0:_0x5edf8d[_0x3695('0x1e')];var _0xc076a9=_0xcc93bb?_0x1082db[_0x3695('0x21')]:_0x5edf8d[_0x3695('0x1e')]+_0x5edf8d[_0x3695('0x20')];var _0x1f267a;if(_0xc076a9>=_0x1bb921){_0xc076a9=_0x1bb921;_0x1f267a=0xc8;}else{_0x1f267a=0xce;}_0x717ee4[_0x3695('0x1c')](_0x1f267a);return _0x717ee4[_0x3695('0x22')](_0x3695('0x23'),_0x33901c+'-'+_0xc076a9+'/'+_0x1bb921)[_0x3695('0x24')](_0x1082db);}return null;};}function patchUpdates(_0x30d713){return function(_0x5340f2){try{jsonpatch[_0x3695('0x25')](_0x5340f2,_0x30d713,!![]);}catch(_0xdb0934){return BPromise['reject'](_0xdb0934);}return _0x5340f2['save']();};}function saveUpdates(_0x3ac6aa,_0x26d9fc){return function(_0x951370){if(_0x951370){return _0x951370[_0x3695('0x26')](_0x3ac6aa)['then'](function(_0x180f77){return _0x180f77;});}return null;};}function removeEntity(_0x48c2fd,_0xeddb06){return function(_0x5319f4){if(_0x5319f4){return _0x5319f4[_0x3695('0x27')]()['then'](function(){_0x48c2fd[_0x3695('0x1c')](0xcc)[_0x3695('0x1d')]();});}};}function handleEntityNotFound(_0x462ff0,_0x18a474){return function(_0x3d4442){if(!_0x3d4442){_0x462ff0[_0x3695('0x1b')](0x194);}return _0x3d4442;};}function handleError(_0x54b12e,_0x2be6ee){_0x2be6ee=_0x2be6ee||0x1f4;return function(_0x354ae0){logger['error'](_0x354ae0[_0x3695('0x28')]);if(_0x354ae0['name']){delete _0x354ae0[_0x3695('0x29')];}_0x54b12e[_0x3695('0x1c')](_0x2be6ee)[_0x3695('0x2a')](_0x354ae0);};}function getInteractionUsers(_0x23ac01,_0x30a5ba){return new BPromise(function(_0x21f379,_0x3a6e8e){try{if(_0x30a5ba[_0x23ac01['id']]){_0x23ac01[_0x3695('0x2b')]=_['map'](_0x30a5ba[_0x23ac01['id']],function(_0x35c67a){return{'id':_0x35c67a['id'],'fullname':_0x35c67a[_0x3695('0x2c')]};});}}catch(_0xe6455e){_0x3a6e8e(_0xe6455e);}_0x21f379(_0x23ac01);});}function getInteractionTags(_0x4c604f,_0x5d54ef){return new BPromise(function(_0xb3a62d,_0x49b42d){try{if(_0x4c604f[_0x3695('0x2d')]){_0x4c604f[_0x3695('0x2e')]=[];_0x4c604f['TagIds'][_0x3695('0x2f')](',')['forEach'](function(_0x2ad432){_0x4c604f[_0x3695('0x2e')][_0x3695('0x30')](_0x5d54ef[_0x2ad432]);});}delete _0x4c604f[_0x3695('0x2d')];}catch(_0x30eab2){_0x49b42d(_0x30eab2);}_0xb3a62d(_0x4c604f);});}function updateWhatsappInteraction(_0x3f6433,_0x47a18f,_0x3ab2a0){return new BPromise(function(_0x33043e,_0x4cd1ac){return getInteractionUsers(_0x3f6433,_0x3ab2a0)[_0x3695('0x31')](function(_0x40e356){return getInteractionTags(_0x40e356,_0x47a18f);})['then'](function(_0x507c57){_0x33043e(_0x507c57);})['catch'](function(_0x4d3b2c){_0x4cd1ac(_0x4d3b2c);});});}exports[_0x3695('0x32')]=function(_0x6e2804,_0x556ca4){var _0x415604={},_0x323e21={},_0x19d2b4={'count':0x0,'rows':[]};var _0x33d5c6=_['map'](db['WhatsappInteraction'][_0x3695('0x33')],function(_0x470907){return{'name':_0x470907['fieldName'],'type':_0x470907[_0x3695('0x34')][_0x3695('0x35')]};});_0x323e21[_0x3695('0x36')]=_[_0x3695('0x37')](_0x33d5c6,_0x3695('0x29'));_0x323e21[_0x3695('0x38')]=_[_0x3695('0x39')](_0x6e2804[_0x3695('0x38')]);_0x323e21[_0x3695('0x3a')]=_[_0x3695('0x3b')](_0x323e21[_0x3695('0x36')],_0x323e21[_0x3695('0x38')]);_0x415604[_0x3695('0x3c')]=_[_0x3695('0x3b')](_0x323e21[_0x3695('0x36')],qs[_0x3695('0x3d')](_0x6e2804['query'][_0x3695('0x3d')]));_0x415604[_0x3695('0x3c')]=_0x415604[_0x3695('0x3c')][_0x3695('0x3e')]?_0x415604[_0x3695('0x3c')]:_0x323e21[_0x3695('0x36')];if(!_0x6e2804[_0x3695('0x38')]['hasOwnProperty'](_0x3695('0x3f'))){_0x415604[_0x3695('0x20')]=qs[_0x3695('0x20')](_0x6e2804['query'][_0x3695('0x20')]);_0x415604[_0x3695('0x1e')]=qs[_0x3695('0x1e')](_0x6e2804[_0x3695('0x38')][_0x3695('0x1e')]);}_0x415604[_0x3695('0x40')]=qs[_0x3695('0x41')](_0x6e2804['query'][_0x3695('0x41')]);_0x415604['where']=qs['filters'](_[_0x3695('0x42')](_0x6e2804['query'],_0x323e21[_0x3695('0x3a')]),_0x33d5c6);var _0x30bff0=[];var _0x65f4b3=squel[_0x3695('0x43')]()['field']('id')[_0x3695('0x44')](_0x3695('0x29'))[_0x3695('0x44')]('color')[_0x3695('0x45')](_0x3695('0x46'));var _0x172855=squel[_0x3695('0x43')]()[_0x3695('0x44')](_0x3695('0x47'))[_0x3695('0x44')](_0x3695('0x48'))[_0x3695('0x44')]('ui.WhatsappInteractionId')['from'](_0x3695('0x49'),'ui')[_0x3695('0x4a')](_0x3695('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x1c8fc3=squel[_0x3695('0x43')]()[_0x3695('0x45')]('whatsapp_interactions','i')[_0x3695('0x4a')](_0x3695('0x4c'),'c',_0x3695('0x4d'))[_0x3695('0x4a')](_0x3695('0x4b'),'o','o.id\x20=\x20i.UserId')[_0x3695('0x4a')](_0x3695('0x4e'),'a',_0x3695('0x4f'))[_0x3695('0x4a')]('whatsapp_messages','me',_0x3695('0x50'))['left_join']('whatsapp_interaction_has_tags','it',_0x3695('0x51'))[_0x3695('0x4a')](_0x3695('0x46'),'t',_0x3695('0x52'));var _0xf34cc3=squel['expr']();var _0x57c0e4=[];var _0x527d89=squel[_0x3695('0x53')]();var _0x5eeaca;if(_0x6e2804['query']['search']){_0x5eeaca=as['parseSearch'](_0x6e2804[_0x3695('0x38')][_0x3695('0x54')]);var _0x5561a5=_0x5eeaca[_0x3695('0x55')];for(var _0x89c360=0x0;_0x89c360<_0x5eeaca['conditions']['length'];_0x89c360++){var _0x419ed6=_0x5eeaca[_0x3695('0x56')][_0x89c360];var _0x1a61d6='i';var _0x56f7df=_[_0x3695('0x57')](_0x33d5c6,[_0x3695('0x29'),_0x419ed6[_0x3695('0x44')]]);if(!_0x56f7df){switch(_0x419ed6[_0x3695('0x44')]){case _0x3695('0x58'):if(_0x419ed6[_0x3695('0x59')]==0x1){_0x1c8fc3[_0x3695('0x5a')]('`'+_0x419ed6[_0x3695('0x44')]+_0x3695('0x5b'));}else{_0x1c8fc3[_0x3695('0x5a')]('`'+_0x419ed6[_0x3695('0x44')]+_0x3695('0x5c'));}break;case _0x3695('0x5d'):if(_0x419ed6[_0x3695('0x5e')]===_0x3695('0x5f')){if(_0x419ed6[_0x3695('0x59')][_0x3695('0x2f')]('\x20')[_0x3695('0x3e')]>0x1){_0xf34cc3[_0x5561a5](_0x3695('0x60'),qs[_0x3695('0x61')](_0x419ed6[_0x3695('0x59')]),null);}else{var _0x4148ec='%'+_0x419ed6[_0x3695('0x59')]+'%';_0xf34cc3[_0x5561a5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4148ec,_0x4148ec,_0x4148ec);}}else{_0x56f7df=_['find'](_0x33d5c6,[_0x3695('0x29'),_0x3695('0x62')]);_0x419ed6['field']=_0x3695('0x62');_0x3f2985=as[_0x3695('0x63')](_0x1a61d6,_0x56f7df[_0x3695('0x34')],_0x419ed6);_0xf34cc3[_0x5561a5](_0x3f2985[_0x3695('0x64')],_0x3f2985[_0x3695('0x59')][_0x3695('0x65')],_0x3f2985[_0x3695('0x59')][_0x3695('0x1d')]);}break;case _0x3695('0x66'):var _0x29c8a3=_0x419ed6['value'][_0x3695('0x2f')](',')[_0x3695('0x37')](function(_0x1e101f){return Number(_0x1e101f);});_0x29c8a3[_0x3695('0x67')](function(_0x380ddc){_0x527d89['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x380ddc+',%');});_0x57c0e4=_[_0x3695('0x68')](_0x57c0e4,_0x29c8a3);break;case _0x3695('0x69'):if(_0x419ed6[_0x3695('0x5e')]==='$substring'){_0xf34cc3[_0x5561a5](_0x3695('0x6a'),'%'+_0x419ed6[_0x3695('0x59')]+'%',null);}else{_0x56f7df=_['find'](_0x33d5c6,['name',_0x3695('0x6b')]);_0x419ed6['field']='UserId';_0x3f2985=as[_0x3695('0x63')](_0x1a61d6,_0x56f7df[_0x3695('0x34')],_0x419ed6);_0xf34cc3[_0x5561a5](_0x3f2985[_0x3695('0x64')],_0x3f2985[_0x3695('0x59')][_0x3695('0x65')],_0x3f2985['value'][_0x3695('0x1d')]);}break;case _0x3695('0x6c'):_0x3f2985=as[_0x3695('0x63')]('me',null,_0x419ed6);_0xf34cc3[_0x5561a5](_0x3f2985['text'],_0x3f2985[_0x3695('0x59')][_0x3695('0x65')],_0x3f2985[_0x3695('0x59')][_0x3695('0x1d')]);break;}}else{var _0x3f2985=as[_0x3695('0x63')](_0x1a61d6,_0x56f7df['type'],_0x419ed6);_0xf34cc3[_0x5561a5](_0x3f2985[_0x3695('0x64')],_0x3f2985[_0x3695('0x59')][_0x3695('0x65')],_0x3f2985[_0x3695('0x59')][_0x3695('0x1d')]);}}}else{var _0x5147df=_(_0x6e2804[_0x3695('0x38')])[_0x3695('0x39')]()[_0x3695('0x37')](function(_0x188bdc){return _[_0x3695('0x6d')](_0x33d5c6,[_0x3695('0x29'),_0x188bdc])?_0x188bdc:undefined;})['compact']()[_0x3695('0x59')]();if(!_[_0x3695('0x6e')](_0x5147df)){_0x5147df['forEach'](function(_0x4e7d7a){if(_0x4e7d7a===_0x3695('0x6f')){_0x1c8fc3[_0x3695('0x70')](_0x3695('0x71'),[]['concat'](_0x6e2804[_0x3695('0x38')][_0x4e7d7a]));}else if(_0x4e7d7a===_0x3695('0x72')){var _0x1bd95d=JSON[_0x3695('0x73')](_0x6e2804[_0x3695('0x38')][_0x4e7d7a])['$gte'];var _0x41f968=JSON['parse'](_0x6e2804['query'][_0x4e7d7a])['$lte'];_0x1c8fc3[_0x3695('0x70')](_0x3695('0x74'),_0x1bd95d,_0x41f968);}else{if(_0x6e2804[_0x3695('0x38')][_0x4e7d7a]===_0x3695('0x75')){_0x1c8fc3[_0x3695('0x70')]('i.'+_0x4e7d7a+_0x3695('0x76'));}else{_0x1c8fc3[_0x3695('0x70')]('i.'+_0x4e7d7a+_0x3695('0x77'),_0x6e2804[_0x3695('0x38')][_0x4e7d7a]);}}});}if(_0x6e2804[_0x3695('0x38')][_0x3695('0x78')]){if(_0x6e2804[_0x3695('0x38')][_0x3695('0x78')]==0x1){_0x1c8fc3[_0x3695('0x5a')](_0x3695('0x79'));}else{_0x1c8fc3[_0x3695('0x5a')]('`unreadMessages`\x20>\x200');}}if(_0x6e2804[_0x3695('0x38')][_0x3695('0x7a')]){_0x57c0e4=_[_0x3695('0x7b')](_0x6e2804[_0x3695('0x38')][_0x3695('0x7a')])?_0x6e2804[_0x3695('0x38')]['tag']:new Array(_0x6e2804[_0x3695('0x38')][_0x3695('0x7a')]);_0x57c0e4['forEach'](function(_0x4ddb70){_0x527d89['or'](_0x3695('0x7c'),'%,'+_0x4ddb70+',%');});}if(_0x6e2804['query'][_0x3695('0x7d')]){var _0x4489c6=_0x6e2804[_0x3695('0x38')][_0x3695('0x7d')][_0x3695('0x7e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3695('0x7f')](_0x4489c6)){_0xf34cc3['or'](_0x3695('0x80'),_0x4489c6+'%')['or'](_0x3695('0x81'),_0x4489c6+'%');}else{_0xf34cc3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4489c6))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4489c6+'%');}}}_0x1c8fc3[_0x3695('0x70')](_0xf34cc3);_0x1c8fc3[_0x3695('0x82')]('i.id');var _0x3ae26f={'type':db[_0x3695('0x83')][_0x3695('0x84')][_0x3695('0x85')],'raw':!![]};var _0x167830=_0x1c8fc3[_0x3695('0x86')]();_0x167830[_0x3695('0x44')](_0x3695('0x87'));_0x167830['field'](_0x3695('0x88'),_0x3695('0x58'));if(_0x415604[_0x3695('0x40')]){_0x415604[_0x3695('0x40')][_0x3695('0x67')](function(_0x2895e5){var _0x2fae6e=_0x2895e5[0x0]===_0x3695('0x89')?_0x2895e5[0x0]:'i.'+_0x2895e5[0x0];_0x1c8fc3['order'](_0x2fae6e,_0x2895e5[0x1]===_0x3695('0x8a')?![]:!![]);});}if(!_[_0x3695('0x6e')](_0x57c0e4)){_0x1c8fc3[_0x3695('0x5a')](_0x527d89);_0x167830[_0x3695('0x70')](_0x3695('0x8b'),_0x57c0e4);}BPromise[_0x3695('0x8c')]()[_0x3695('0x31')](function(){if(!_0x5eeaca){if(_0x6e2804[_0x3695('0x38')][_0x3695('0x6f')])return;_0x167830[_0x3695('0x70')](_0x3695('0x8d'));_0x1c8fc3[_0x3695('0x70')](_0x3695('0x8d'));return;}if(_0x6e2804['user']['role']!==_0x3695('0x8e'))return;return _0x6e2804[_0x3695('0x8f')][_0x3695('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x407888){if(_[_0x3695('0x6e')](_0x407888)){_0x167830[_0x3695('0x70')]('i.WhatsappAccountId\x20IS\x20NULL');_0x1c8fc3[_0x3695('0x70')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x167830[_0x3695('0x70')](_0x3695('0x71'),_[_0x3695('0x37')](_0x407888,'id'));_0x1c8fc3[_0x3695('0x70')](_0x3695('0x71'),_['map'](_0x407888,'id'));}});})[_0x3695('0x31')](function(){if(_0x6e2804[_0x3695('0x8f')][_0x3695('0x91')]===_0x3695('0x8e')&&!_0x5eeaca&&!_0x6e2804[_0x3695('0x38')][_0x3695('0x6f')])return[];return db[_0x3695('0x92')][_0x3695('0x38')](_0x167830['toString'](),_0x3ae26f);})[_0x3695('0x31')](function(_0x5c2b14){_0x19d2b4['count']=_0x5c2b14['length'];if(_0x19d2b4[_0x3695('0x21')]===0x0)return[];return db[_0x3695('0x92')][_0x3695('0x38')](_0x65f4b3['toString'](),_0x3ae26f)[_0x3695('0x31')](function(_0x47b55e){_0x30bff0=_[_0x3695('0x93')](_0x47b55e,'id');_0x3ae26f=_[_0x3695('0x94')](_0x3ae26f,{'model':db[_0x3695('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6e2804['query'][_0x3695('0x3d')]){_0x415604[_0x3695('0x3c')]['forEach'](function(_0x49746d){_0x1c8fc3['field']('i.'+_0x49746d);});}else{_0x1c8fc3[_0x3695('0x44')](_0x3695('0x88'),_0x3695('0x58'));_0x1c8fc3['field']('a.key','Account.key');_0x1c8fc3['field']('a.mandatoryDisposition',_0x3695('0x96'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0x97'),_0x3695('0x89'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0x98'));_0x1c8fc3['field'](_0x3695('0x99'),_0x3695('0x9a'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0x9b'),_0x3695('0x9c'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0x9d'),_0x3695('0x9e'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0x9f'),_0x3695('0xa0'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0xa1'),_0x3695('0xa2'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0xa3'),_0x3695('0xa4'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0xa5'),_0x3695('0xa6'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0xa7'),_0x3695('0xa8'));_0x1c8fc3[_0x3695('0x44')](_0x3695('0xa9'),_0x3695('0x2d'));}if(_0x415604[_0x3695('0x20')])_0x1c8fc3['limit'](_0x415604[_0x3695('0x20')]);if(_0x415604[_0x3695('0x1e')])_0x1c8fc3['offset'](_0x415604[_0x3695('0x1e')]);return db['sequelize'][_0x3695('0x38')](_0x1c8fc3['toString'](),_0x3ae26f);})[_0x3695('0x31')](function(_0x27192c){if(_0x27192c[_0x3695('0x3e')]>0x0)_0x172855[_0x3695('0x70')](_0x3695('0xaa'),_[_0x3695('0x37')](_0x27192c,'id'));return db['sequelize'][_0x3695('0x38')](_0x172855[_0x3695('0xab')](),_0x3ae26f)[_0x3695('0x31')](function(_0x1a51ea){var _0x37f30b=_[_0x3695('0xac')](_0x1a51ea,_0x3695('0xad'));var _0x48c6b1=[];_0x27192c['forEach'](function(_0x3a210d){_0x48c6b1['push'](updateWhatsappInteraction(_0x3a210d,_0x30bff0,_0x37f30b));});return BPromise[_0x3695('0xae')](_0x48c6b1);});});})[_0x3695('0x31')](function(_0x309c16){_0x19d2b4[_0x3695('0xaf')]=_0x309c16;return _0x19d2b4;})['then'](respondWithFilteredResult(_0x556ca4,_0x415604))[_0x3695('0xb0')](handleError(_0x556ca4,null));};exports[_0x3695('0xb1')]=function(_0x54593b,_0x6365d7){var _0x58a23c={'raw':![],'where':{'id':_0x54593b[_0x3695('0xb2')]['id']}},_0x19fe96={};_0x19fe96[_0x3695('0x36')]=_[_0x3695('0x39')](db[_0x3695('0x95')][_0x3695('0x33')]);_0x19fe96[_0x3695('0x38')]=_['keys'](_0x54593b[_0x3695('0x38')]);_0x19fe96[_0x3695('0x3a')]=_[_0x3695('0x3b')](_0x19fe96[_0x3695('0x36')],_0x19fe96[_0x3695('0x38')]);_0x58a23c[_0x3695('0x3c')]=_['intersection'](_0x19fe96['model'],qs[_0x3695('0x3d')](_0x54593b['query']['fields']));_0x58a23c[_0x3695('0x3c')]=_0x58a23c['attributes'][_0x3695('0x3e')]?_0x58a23c['attributes']:_0x19fe96[_0x3695('0x36')];if(_0x54593b[_0x3695('0x38')]['includeAll']){_0x58a23c[_0x3695('0xb3')]=[{'all':!![]}];}_0x58a23c=_[_0x3695('0x94')]({},_0x58a23c,_0x54593b[_0x3695('0xb4')]);return db[_0x3695('0x95')]['find'](_0x58a23c)[_0x3695('0x31')](handleEntityNotFound(_0x6365d7,null))[_0x3695('0x31')](respondWithResult(_0x6365d7,null))[_0x3695('0xb0')](handleError(_0x6365d7,null));};exports[_0x3695('0xb5')]=function(_0x42fb6f,_0xe80187){return db['WhatsappInteraction'][_0x3695('0xb5')](_0x42fb6f[_0x3695('0x6c')],{})[_0x3695('0x31')](respondWithResult(_0xe80187,0xc9))[_0x3695('0xb0')](handleError(_0xe80187,null));};exports['update']=function(_0x5c0bec,_0x3fee26){if(_0x5c0bec['body']['id']){delete _0x5c0bec[_0x3695('0x6c')]['id'];}return db[_0x3695('0x95')][_0x3695('0x57')]({'where':{'id':_0x5c0bec[_0x3695('0xb2')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x3fee26,null))[_0x3695('0x31')](saveUpdates(_0x5c0bec[_0x3695('0x6c')],null))['then'](respondWithResult(_0x3fee26,null))[_0x3695('0xb0')](handleError(_0x3fee26,null));};exports['destroy']=function(_0x1ca8a2,_0x4e70e7){return db['WhatsappInteraction'][_0x3695('0x57')]({'where':{'id':_0x1ca8a2['params']['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x4e70e7,null))[_0x3695('0x31')](removeEntity(_0x4e70e7,null))['catch'](handleError(_0x4e70e7,null));};exports[_0x3695('0xb6')]=function(_0x17f351,_0x586c3d){return db['WhatsappInteraction'][_0x3695('0xb6')]()['then'](respondWithResult(_0x586c3d,null))[_0x3695('0xb0')](handleError(_0x586c3d,null));};exports[_0x3695('0xb7')]=function(_0x286c13,_0x334d9e,_0x51bc4b){return db[_0x3695('0xb8')][_0x3695('0x57')]({'where':{'id':_0x286c13[_0x3695('0xb2')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x334d9e,null))[_0x3695('0x31')](function(_0x1d5b35){if(_0x1d5b35){return _0x1d5b35[_0x3695('0xb7')](_0x286c13['body'][_0x3695('0xb9')],_[_0x3695('0xba')](_0x286c13[_0x3695('0x6c')],[_0x3695('0xb9'),'id'])||{});}})[_0x3695('0x31')](respondWithResult(_0x334d9e,null))[_0x3695('0xb0')](handleError(_0x334d9e,null));};exports[_0x3695('0xbb')]=function(_0x443def,_0x52ea6e,_0xfb32a2){var _0x5f3a26={'raw':![],'where':{}};var _0x2ebb55={};var _0x547433={'count':0x0,'rows':[]};return db[_0x3695('0x95')][_0x3695('0xbc')]({'where':{'id':_0x443def['params']['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x52ea6e,null))['then'](function(_0x1125d9){if(_0x1125d9){_0x2ebb55[_0x3695('0x36')]=_[_0x3695('0x39')](db[_0x3695('0xb8')][_0x3695('0x33')]);_0x2ebb55[_0x3695('0x38')]=_['keys'](_0x443def[_0x3695('0x38')]);_0x2ebb55[_0x3695('0x3a')]=_['intersection'](_0x2ebb55[_0x3695('0x36')],_0x2ebb55[_0x3695('0x38')]);_0x5f3a26[_0x3695('0x3c')]=_['intersection'](_0x2ebb55['model'],qs[_0x3695('0x3d')](_0x443def['query'][_0x3695('0x3d')]));_0x5f3a26['attributes']=_0x5f3a26[_0x3695('0x3c')]['length']?_0x5f3a26[_0x3695('0x3c')]:_0x2ebb55[_0x3695('0x36')];if(!_0x443def['query']['hasOwnProperty']('nolimit')){_0x5f3a26[_0x3695('0x20')]=qs[_0x3695('0x20')](_0x443def['query']['limit']);_0x5f3a26[_0x3695('0x1e')]=qs[_0x3695('0x1e')](_0x443def['query'][_0x3695('0x1e')]);}_0x5f3a26[_0x3695('0x40')]=qs[_0x3695('0x41')](_0x443def[_0x3695('0x38')][_0x3695('0x41')]);_0x5f3a26[_0x3695('0x70')]=qs[_0x3695('0x3a')](_[_0x3695('0x42')](_0x443def['query'],_0x2ebb55[_0x3695('0x3a')]));_0x5f3a26[_0x3695('0x70')]['WhatsappInteractionId']=_0x1125d9['id'];if(_0x443def[_0x3695('0x38')][_0x3695('0x7d')]){_0x5f3a26[_0x3695('0x70')]=_[_0x3695('0x94')](_0x5f3a26[_0x3695('0x70')],{'$or':_['map'](_0x5f3a26[_0x3695('0x3c')],function(_0x467223){var _0x1208d4={};_0x1208d4[_0x467223]={'$like':'%'+_0x443def[_0x3695('0x38')]['filter']+'%'};return _0x1208d4;})});}if(_0x443def[_0x3695('0x38')][_0x3695('0xbd')]){var _0x3a7be5=_0x443def[_0x3695('0x38')][_0x3695('0xbd')]['split'](',');var _0x332663={};_0x332663[_0x3a7be5[0x0]]={'$gte':moment(_0x3a7be5[0x1])[_0x3695('0xbe')](_0x3695('0xbf'))};_0x5f3a26[_0x3695('0x70')]=_[_0x3695('0x94')](_0x5f3a26[_0x3695('0x70')],_0x332663);}_0x5f3a26=_[_0x3695('0x94')]({},_0x5f3a26,_0x443def[_0x3695('0xb4')]);return db[_0x3695('0xb8')]['count']({'where':_0x5f3a26[_0x3695('0x70')]})[_0x3695('0x31')](function(_0x482906){_0x547433['count']=_0x482906;if(_0x443def[_0x3695('0x38')][_0x3695('0xc0')]){_0x5f3a26[_0x3695('0xb3')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x3695('0xc1')](_0x5f3a26);})[_0x3695('0x31')](function(_0x4ece50){_0x547433['rows']=_0x4ece50;return _0x547433;});}})[_0x3695('0x31')](respondWithFilteredResult(_0x52ea6e,_0x5f3a26))[_0x3695('0xb0')](handleError(_0x52ea6e,null));};exports[_0x3695('0xc2')]=function(_0x4c3b9d,_0x349e9e,_0x4827c5){return db[_0x3695('0x95')][_0x3695('0x57')]({'where':{'id':_0x4c3b9d['params']['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x349e9e,null))[_0x3695('0x31')](function(_0x43d648){if(_0x43d648){return _0x43d648[_0x3695('0xc3')](_0x4c3b9d['body']['ids'],_['omit'](_0x4c3b9d['body'],[_0x3695('0xb9'),'id'])||{})[_0x3695('0xc4')](function(){return db[_0x3695('0x66')]['findAll']({'attributes':['id','name',_0x3695('0xc5')],'where':{'id':_0x4c3b9d[_0x3695('0x6c')][_0x3695('0xb9')]}});})['then'](function(_0x12d5ff){socket[_0x3695('0xc6')](_0x3695('0xc7'),{'id':Number(_0x4c3b9d[_0x3695('0xb2')]['id']),'tags':_0x12d5ff||[]});return{'id':Number(_0x4c3b9d[_0x3695('0xb2')]['id']),'tags':_0x12d5ff||[]};});}})['then'](respondWithResult(_0x349e9e,null))['catch'](handleError(_0x349e9e,null));};exports['removeTags']=function(_0x1a38b1,_0x4fc1e2,_0x2b347e){return db[_0x3695('0x95')][_0x3695('0x57')]({'where':{'id':_0x1a38b1['params']['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x4fc1e2,null))['then'](function(_0x5227bc){if(_0x5227bc){return _0x5227bc['removeTags'](_0x1a38b1[_0x3695('0x38')][_0x3695('0xb9')]);}})[_0x3695('0x31')](respondWithStatusCode(_0x4fc1e2,null))['catch'](handleError(_0x4fc1e2,null));};exports['download']=function(_0x5ce01f,_0x3414a4){var _0x38bee4=moment()[_0x3695('0xc8')]()[_0x3695('0xab')]();var _0x409df6=path[_0x3695('0xc9')](config[_0x3695('0xca')],_0x3695('0xcb'),_0x3695('0xcc'),_0x3695('0xcd'));var _0x1f9572=path[_0x3695('0xc9')](config[_0x3695('0xca')],_0x3695('0xcb'),_0x3695('0xcc'),_0x3695('0xce'));var _0x364116=path['join'](_0x409df6,_0x38bee4);var _0x21054b=util[_0x3695('0xbe')](_0x3695('0xcf'),_0x5ce01f[_0x3695('0xb2')]['id'],_0x38bee4);var _0x569c57=path[_0x3695('0xc9')](_0x409df6,_0x21054b);var _0x241ef6=[];_0x241ef6[_0x3695('0x30')]({'model':db['User'],'as':_0x3695('0x69'),'attributes':['id',_0x3695('0x2c')],'raw':!![]});_0x241ef6[_0x3695('0x30')]({'model':db[_0x3695('0xd0')],'as':'Contact','attributes':['id',_0x3695('0xd1'),'lastName'],'raw':!![]});if(_0x5ce01f['query'][_0x3695('0xce')]){_0x241ef6[_0x3695('0x30')]({'model':db['Attachment'],'as':_0x3695('0xd2'),'raw':!![]});}var _0x41d3aa=[{'model':db['WhatsappMessage'],'as':_0x3695('0xd3'),'attributes':['id',_0x3695('0x6c'),_0x3695('0x72'),_0x3695('0xd4'),_0x3695('0xd5'),_0x3695('0x78')],'include':_0x241ef6}];_0x41d3aa[_0x3695('0x30')]({'model':db[_0x3695('0xd6')],'as':_0x3695('0xd7'),'attributes':['id',_0x3695('0x29')]});_0x41d3aa[_0x3695('0x30')]({'model':db[_0x3695('0x69')],'as':_0x3695('0xd8'),'attributes':['id',_0x3695('0x2c')]});return db['WhatsappInteraction'][_0x3695('0x57')]({'where':{'id':_0x5ce01f['params']['id']},'include':_0x41d3aa})[_0x3695('0x31')](handleEntityNotFound(_0x3414a4,null))[_0x3695('0x31')](function(_0x4b8ce8){if(_0x4b8ce8){var _0x53a5ee=_0x4b8ce8[_0x3695('0xd9')]({'plain':!![]});fs[_0x3695('0xda')](_0x364116);var _0x520cc1={'channel':_0x3695('0xdb'),'account':_0x53a5ee[_0x3695('0xd7')][_0x3695('0x29')],'agent':_0x53a5ee[_0x3695('0xd8')]?_0x53a5ee[_0x3695('0xd8')][_0x3695('0x2c')]:_0x3695('0xdc'),'createdAt':moment(_0x53a5ee[_0x3695('0x72')])[_0x3695('0xbe')](_0x3695('0xbf'))[_0x3695('0xab')](),'closedAt':_0x53a5ee[_0x3695('0xdd')]?moment(_0x53a5ee['closedAt'])[_0x3695('0xbe')](_0x3695('0xbf'))[_0x3695('0xab')]():'','disposition':_0x53a5ee[_0x3695('0xde')],'messages':_(_0x53a5ee[_0x3695('0xd3')])[_0x3695('0x7d')]({'secret':![]})[_0x3695('0x37')](function(_0x12535f){if(_0x12535f[_0x3695('0xd2')]){var _0x27e845=path[_0x3695('0xc9')](_0x1f9572,_0x12535f[_0x3695('0xd2')][_0x3695('0xdf')]);if(fs['existsSync'](_0x27e845)){fs[_0x3695('0xe0')](_0x27e845)['pipe'](fs[_0x3695('0xe1')](path[_0x3695('0xc9')](_0x364116,_0x12535f['Attachment']['basename'])));}}return{'date':moment(_0x12535f[_0x3695('0x72')])[_0x3695('0xbe')](_0x3695('0xbf'))[_0x3695('0xab')](),'sender':_0x12535f[_0x3695('0xd4')]===_0x3695('0xe2')?_0x12535f[_0x3695('0x69')]?_0x12535f['User']['fullname']:_0x3695('0xe3'):_0x12535f[_0x3695('0x5d')]['firstName']+(_0x12535f[_0x3695('0x5d')][_0x3695('0xe4')]?'\x20'+_0x12535f[_0x3695('0x5d')][_0x3695('0xe4')]:''),'body':_0x12535f[_0x3695('0xd2')]?_0x12535f['Attachment'][_0x3695('0xdf')]:_0x12535f[_0x3695('0x6c')],'direction':_0x12535f[_0x3695('0xd4')]===_0x3695('0xe2')?'A':'C','secret':_0x12535f[_0x3695('0xd5')],'read':_0x12535f[_0x3695('0x78')],'attachment':_0x12535f[_0x3695('0xd2')]};})[_0x3695('0x59')]()};return ejs[_0x3695('0xe5')](path[_0x3695('0xc9')](config[_0x3695('0xca')],_0x3695('0xcb'),_0x3695('0xe6'),_0x3695('0xe7')),{'interaction':_0x520cc1})[_0x3695('0x31')](function(_0x1a34d3){var _0x5d4959=path[_0x3695('0xc9')](_0x364116,_0x3695('0xe8')+_0x53a5ee['id']+'-'+_0x38bee4+_0x3695('0xe9'));var _0x3b9d8e={'path':_0x5d4959,'channel':_0x3695('0xdb'),'interactionId':_0x53a5ee['id']};return pdf[_0x3695('0xea')](_0x1a34d3,_0x3b9d8e);})['then'](function(){return new BPromise(function(_0x1a6289,_0x2e2499){zipdir(_0x364116,{'saveTo':_0x569c57},function(_0x2fd576,_0x504811){if(_0x2fd576)return _0x2e2499(_0x2fd576);return _0x1a6289(_0x504811);});})['then'](function(){return new BPromise(function(_0x38ba26,_0x5c598d){rimraf(_0x364116,function(_0x48dffa){if(_0x48dffa)_0x5c598d(_0x48dffa);return _0x38ba26();});});})[_0x3695('0x31')](function(){return _0x3414a4['download'](_0x569c57,_0x21054b,function(_0x1ffb98){if(_0x1ffb98){console['log'](_0x3695('0xeb'),_0x1ffb98);}else{fs['unlinkSync'](_0x569c57);}});});});}else{return _0x3414a4[_0x3695('0x1b')](0xc8);}})[_0x3695('0xb0')](handleError(_0x3414a4,null));}; \ No newline at end of file +var _0xe79a=['parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','options','create','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','WhatsappInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','tmp','root','attachments','CmContact','firstName','Attachment','createdAt','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','createWriteStream','System','lastName','views','transcript-','.pdf','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','field','color','from','u.id','u.fullname','user_has_whatsapp_interactions','left_join','select','whatsapp_interactions','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','conditions','unreadMessages','having','`\x20=\x200','Contact','operator','getFullTextValue','value','find','ContactId','text','start','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','type','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xe79a,0x70));var _0xae79=function(_0x1e3c2a,_0x33acf3){_0x1e3c2a=_0x1e3c2a-0x0;var _0x10fa0c=_0xe79a[_0x1e3c2a];return _0x10fa0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xae79('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae79('0x1'));var moment=require(_0xae79('0x2'));var BPromise=require(_0xae79('0x3'));var Mustache=require(_0xae79('0x4'));var util=require('util');var path=require(_0xae79('0x5'));var sox=require(_0xae79('0x6'));var csv=require(_0xae79('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae79('0x8'));var _=require(_0xae79('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xae79('0xa'));var deskjs=require(_0xae79('0xb'));var toCsv=require('to-csv');var querystring=require(_0xae79('0xc'));var Papa=require('papaparse');var Redis=require(_0xae79('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae79('0xe'));var pdf=require(_0xae79('0xf'));var hardwareService=require(_0xae79('0x10'));var logger=require('../../config/logger')(_0xae79('0x11'));var utils=require(_0xae79('0x12'));var config=require(_0xae79('0x13'));var licenseUtil=require(_0xae79('0x14'));var db=require(_0xae79('0x15'))['db'];config[_0xae79('0x16')]=_[_0xae79('0x17')](config[_0xae79('0x16')],{'host':_0xae79('0x18'),'port':0x18eb});var socket=require(_0xae79('0x19'))(new Redis(config['redis']));require(_0xae79('0x1a'))[_0xae79('0x1b')](socket);function respondWithStatusCode(_0x34fc00,_0x467c8b){_0x467c8b=_0x467c8b||0xcc;return function(_0x4c8f9a){if(_0x4c8f9a){return _0x34fc00['sendStatus'](_0x467c8b);}return _0x34fc00[_0xae79('0x1c')](_0x467c8b)[_0xae79('0x1d')]();};}function respondWithResult(_0x4c8a59,_0x10be5e){_0x10be5e=_0x10be5e||0xc8;return function(_0x5beb2d){if(_0x5beb2d){return _0x4c8a59[_0xae79('0x1c')](_0x10be5e)[_0xae79('0x1e')](_0x5beb2d);}};}function respondWithFilteredResult(_0x124745,_0x371944){return function(_0x3474a0){if(_0x3474a0){var _0x5cb7d5=typeof _0x371944[_0xae79('0x1f')]===_0xae79('0x20')&&typeof _0x371944[_0xae79('0x21')]===_0xae79('0x20');var _0x3f0cf8=_0x3474a0[_0xae79('0x22')];var _0x5aea70=_0x5cb7d5?0x0:_0x371944[_0xae79('0x1f')];var _0x1c4840=_0x5cb7d5?_0x3474a0[_0xae79('0x22')]:_0x371944['offset']+_0x371944[_0xae79('0x21')];var _0x158ea2;if(_0x1c4840>=_0x3f0cf8){_0x1c4840=_0x3f0cf8;_0x158ea2=0xc8;}else{_0x158ea2=0xce;}_0x124745['status'](_0x158ea2);return _0x124745[_0xae79('0x23')](_0xae79('0x24'),_0x5aea70+'-'+_0x1c4840+'/'+_0x3f0cf8)[_0xae79('0x1e')](_0x3474a0);}return null;};}function patchUpdates(_0x3f8409){return function(_0x544992){try{jsonpatch[_0xae79('0x25')](_0x544992,_0x3f8409,!![]);}catch(_0x33f0c5){return BPromise['reject'](_0x33f0c5);}return _0x544992[_0xae79('0x26')]();};}function saveUpdates(_0x1d882c,_0xe96cf){return function(_0x4a7ed1){if(_0x4a7ed1){return _0x4a7ed1[_0xae79('0x27')](_0x1d882c)[_0xae79('0x28')](function(_0x819255){return _0x819255;});}return null;};}function removeEntity(_0x1621e0,_0x5783e8){return function(_0x1e8618){if(_0x1e8618){return _0x1e8618[_0xae79('0x29')]()[_0xae79('0x28')](function(){_0x1621e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d306,_0x4efa59){return function(_0x333372){if(!_0x333372){_0x43d306[_0xae79('0x2a')](0x194);}return _0x333372;};}function handleError(_0x480e7a,_0x55731c){_0x55731c=_0x55731c||0x1f4;return function(_0x85caa7){logger[_0xae79('0x2b')](_0x85caa7[_0xae79('0x2c')]);if(_0x85caa7[_0xae79('0x2d')]){delete _0x85caa7[_0xae79('0x2d')];}_0x480e7a[_0xae79('0x1c')](_0x55731c)['send'](_0x85caa7);};}function getInteractionUsers(_0x5d4b1c,_0x36a0cf){return new BPromise(function(_0x592b0b,_0x4693be){try{if(_0x36a0cf[_0x5d4b1c['id']]){_0x5d4b1c[_0xae79('0x2e')]=_[_0xae79('0x2f')](_0x36a0cf[_0x5d4b1c['id']],function(_0x271a78){return{'id':_0x271a78['id'],'fullname':_0x271a78[_0xae79('0x30')]};});}}catch(_0x3eaca4){_0x4693be(_0x3eaca4);}_0x592b0b(_0x5d4b1c);});}function getInteractionTags(_0x49bd6c,_0xb91d40){return new BPromise(function(_0x34aacf,_0xb00ba3){try{if(_0x49bd6c['TagIds']){_0x49bd6c[_0xae79('0x31')]=[];_0x49bd6c[_0xae79('0x32')][_0xae79('0x33')](',')[_0xae79('0x34')](function(_0x394dda){_0x49bd6c['Tags'][_0xae79('0x35')](_0xb91d40[_0x394dda]);});}delete _0x49bd6c[_0xae79('0x32')];}catch(_0x71fabd){_0xb00ba3(_0x71fabd);}_0x34aacf(_0x49bd6c);});}function updateWhatsappInteraction(_0x59a276,_0x5bc86d,_0x3aca02){return new BPromise(function(_0x9b7026,_0x44c270){return getInteractionUsers(_0x59a276,_0x3aca02)['then'](function(_0x2951a9){return getInteractionTags(_0x2951a9,_0x5bc86d);})[_0xae79('0x28')](function(_0x514fa8){_0x9b7026(_0x514fa8);})[_0xae79('0x36')](function(_0x2f9f53){_0x44c270(_0x2f9f53);});});}exports[_0xae79('0x37')]=function(_0x5f07bd,_0x273396){var _0x2b5e69={},_0x17c3a5={},_0x388c5f={'count':0x0,'rows':[]};var _0x3e4db2=_['map'](db[_0xae79('0x38')][_0xae79('0x39')],function(_0x2de9f1){return{'name':_0x2de9f1[_0xae79('0x3a')],'type':_0x2de9f1['type'][_0xae79('0x3b')]};});_0x17c3a5[_0xae79('0x3c')]=_[_0xae79('0x2f')](_0x3e4db2,'name');_0x17c3a5[_0xae79('0x3d')]=_[_0xae79('0x3e')](_0x5f07bd[_0xae79('0x3d')]);_0x17c3a5['filters']=_[_0xae79('0x3f')](_0x17c3a5[_0xae79('0x3c')],_0x17c3a5['query']);_0x2b5e69[_0xae79('0x40')]=_[_0xae79('0x3f')](_0x17c3a5[_0xae79('0x3c')],qs['fields'](_0x5f07bd[_0xae79('0x3d')][_0xae79('0x41')]));_0x2b5e69[_0xae79('0x40')]=_0x2b5e69[_0xae79('0x40')][_0xae79('0x42')]?_0x2b5e69[_0xae79('0x40')]:_0x17c3a5[_0xae79('0x3c')];if(!_0x5f07bd[_0xae79('0x3d')]['hasOwnProperty'](_0xae79('0x43'))){_0x2b5e69['limit']=qs[_0xae79('0x21')](_0x5f07bd[_0xae79('0x3d')][_0xae79('0x21')]);_0x2b5e69[_0xae79('0x1f')]=qs[_0xae79('0x1f')](_0x5f07bd[_0xae79('0x3d')]['offset']);}_0x2b5e69[_0xae79('0x44')]=qs[_0xae79('0x45')](_0x5f07bd[_0xae79('0x3d')]['sort']);_0x2b5e69[_0xae79('0x46')]=qs['filters'](_[_0xae79('0x47')](_0x5f07bd[_0xae79('0x3d')],_0x17c3a5[_0xae79('0x48')]),_0x3e4db2);var _0x139cd8=[];var _0xb22d38=squel['select']()[_0xae79('0x49')]('id')[_0xae79('0x49')](_0xae79('0x2d'))[_0xae79('0x49')](_0xae79('0x4a'))[_0xae79('0x4b')]('tools_tags');var _0x2615fd=squel['select']()[_0xae79('0x49')](_0xae79('0x4c'))['field'](_0xae79('0x4d'))[_0xae79('0x49')]('ui.WhatsappInteractionId')['from'](_0xae79('0x4e'),'ui')[_0xae79('0x4f')]('users','u','u.id\x20=\x20ui.UserId');var _0x392158=squel[_0xae79('0x50')]()[_0xae79('0x4b')](_0xae79('0x51'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xae79('0x52'),'o',_0xae79('0x53'))[_0xae79('0x4f')](_0xae79('0x54'),'a',_0xae79('0x55'))[_0xae79('0x4f')](_0xae79('0x56'),'me',_0xae79('0x57'))['left_join'](_0xae79('0x58'),'it',_0xae79('0x59'))[_0xae79('0x4f')](_0xae79('0x5a'),'t',_0xae79('0x5b'));var _0x1f2dc3=squel['expr']();var _0x4556fb=[];var _0x18fc02=squel[_0xae79('0x5c')]();var _0x6865a8;if(_0x5f07bd['query']['search']){_0x6865a8=as[_0xae79('0x5d')](_0x5f07bd[_0xae79('0x3d')]['search']);var _0x1416a2=_0x6865a8['sqlOperator'];for(var _0x384f6a=0x0;_0x384f6a<_0x6865a8[_0xae79('0x5e')][_0xae79('0x42')];_0x384f6a++){var _0x2f27c5=_0x6865a8['conditions'][_0x384f6a];var _0x415705='i';var _0x1e4184=_['find'](_0x3e4db2,[_0xae79('0x2d'),_0x2f27c5[_0xae79('0x49')]]);if(!_0x1e4184){switch(_0x2f27c5[_0xae79('0x49')]){case _0xae79('0x5f'):if(_0x2f27c5['value']==0x1){_0x392158[_0xae79('0x60')]('`'+_0x2f27c5[_0xae79('0x49')]+_0xae79('0x61'));}else{_0x392158['having']('`'+_0x2f27c5[_0xae79('0x49')]+'`\x20>\x200');}break;case _0xae79('0x62'):if(_0x2f27c5[_0xae79('0x63')]==='$substring'){if(_0x2f27c5['value']['split']('\x20')[_0xae79('0x42')]>0x1){_0x1f2dc3[_0x1416a2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xae79('0x64')](_0x2f27c5[_0xae79('0x65')]),null);}else{var _0x35e691='%'+_0x2f27c5[_0xae79('0x65')]+'%';_0x1f2dc3[_0x1416a2]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x35e691,_0x35e691,_0x35e691);}}else{_0x1e4184=_[_0xae79('0x66')](_0x3e4db2,['name',_0xae79('0x67')]);_0x2f27c5['field']=_0xae79('0x67');_0x3eae63=as['buildExpression'](_0x415705,_0x1e4184['type'],_0x2f27c5);_0x1f2dc3[_0x1416a2](_0x3eae63[_0xae79('0x68')],_0x3eae63['value'][_0xae79('0x69')],_0x3eae63[_0xae79('0x65')]['end']);}break;case'Tag':var _0x3f86bf=_0x2f27c5['value'][_0xae79('0x33')](',')[_0xae79('0x2f')](function(_0x54f392){return Number(_0x54f392);});_0x3f86bf['forEach'](function(_0x432c9a){_0x18fc02['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x432c9a+',%');});_0x4556fb=_[_0xae79('0x6a')](_0x4556fb,_0x3f86bf);break;case _0xae79('0x6b'):if(_0x2f27c5[_0xae79('0x63')]===_0xae79('0x6c')){_0x1f2dc3[_0x1416a2](_0xae79('0x6d'),'%'+_0x2f27c5[_0xae79('0x65')]+'%',null);}else{_0x1e4184=_[_0xae79('0x66')](_0x3e4db2,[_0xae79('0x2d'),_0xae79('0x6e')]);_0x2f27c5[_0xae79('0x49')]='UserId';_0x3eae63=as['buildExpression'](_0x415705,_0x1e4184['type'],_0x2f27c5);_0x1f2dc3[_0x1416a2](_0x3eae63[_0xae79('0x68')],_0x3eae63[_0xae79('0x65')]['start'],_0x3eae63['value'][_0xae79('0x1d')]);}break;case _0xae79('0x6f'):_0x3eae63=as['buildExpression']('me',null,_0x2f27c5);_0x1f2dc3[_0x1416a2](_0x3eae63[_0xae79('0x68')],_0x3eae63[_0xae79('0x65')]['start'],_0x3eae63['value']['end']);break;}}else{var _0x3eae63=as[_0xae79('0x70')](_0x415705,_0x1e4184[_0xae79('0x71')],_0x2f27c5);_0x1f2dc3[_0x1416a2](_0x3eae63[_0xae79('0x68')],_0x3eae63[_0xae79('0x65')][_0xae79('0x69')],_0x3eae63[_0xae79('0x65')]['end']);}}}else{var _0x333a51=_(_0x5f07bd[_0xae79('0x3d')])[_0xae79('0x3e')]()[_0xae79('0x2f')](function(_0x47b289){return _[_0xae79('0x72')](_0x3e4db2,['name',_0x47b289])?_0x47b289:undefined;})[_0xae79('0x73')]()['value']();if(!_['isEmpty'](_0x333a51)){_0x333a51[_0xae79('0x34')](function(_0x449d99){if(_0x449d99===_0xae79('0x74')){_0x392158['where'](_0xae79('0x75'),[][_0xae79('0x76')](_0x5f07bd[_0xae79('0x3d')][_0x449d99]));}else if(_0x449d99==='createdAt'){var _0x27e086=JSON[_0xae79('0x77')](_0x5f07bd[_0xae79('0x3d')][_0x449d99])[_0xae79('0x78')];var _0x348ab9=JSON[_0xae79('0x77')](_0x5f07bd['query'][_0x449d99])['$lte'];_0x392158[_0xae79('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x27e086,_0x348ab9);}else{if(_0x5f07bd[_0xae79('0x3d')][_0x449d99]===_0xae79('0x79')){_0x392158[_0xae79('0x46')]('i.'+_0x449d99+_0xae79('0x7a'));}else{_0x392158['where']('i.'+_0x449d99+_0xae79('0x7b'),_0x5f07bd[_0xae79('0x3d')][_0x449d99]);}}});}if(_0x5f07bd['query'][_0xae79('0x7c')]){if(_0x5f07bd[_0xae79('0x3d')]['read']==0x1){_0x392158[_0xae79('0x60')](_0xae79('0x7d'));}else{_0x392158[_0xae79('0x60')]('`unreadMessages`\x20>\x200');}}if(_0x5f07bd['query'][_0xae79('0x7e')]){_0x4556fb=_[_0xae79('0x7f')](_0x5f07bd[_0xae79('0x3d')][_0xae79('0x7e')])?_0x5f07bd['query'][_0xae79('0x7e')]:new Array(_0x5f07bd['query'][_0xae79('0x7e')]);_0x4556fb[_0xae79('0x34')](function(_0x51e486){_0x18fc02['or'](_0xae79('0x80'),'%,'+_0x51e486+',%');});}if(_0x5f07bd[_0xae79('0x3d')]['filter']){var _0x2b99a3=_0x5f07bd[_0xae79('0x3d')][_0xae79('0x81')][_0xae79('0x82')]('\x5c','\x5c\x5c')[_0xae79('0x82')](/'/g,'\x27\x27');if(qs[_0xae79('0x83')](_0x2b99a3)){_0x1f2dc3['or'](_0xae79('0x84'),_0x2b99a3+'%')['or'](_0xae79('0x85'),_0x2b99a3+'%');}else{_0x1f2dc3['or'](_0xae79('0x86'),qs[_0xae79('0x64')](_0x2b99a3))['or'](_0xae79('0x87'),_0x2b99a3+'%');}}}_0x392158[_0xae79('0x46')](_0x1f2dc3);_0x392158['group']('i.id');var _0x22c65f={'type':db[_0xae79('0x88')][_0xae79('0x89')][_0xae79('0x8a')],'raw':!![]};var _0x138c2b=_0x392158[_0xae79('0x8b')]();_0x138c2b['field']('i.id');_0x138c2b[_0xae79('0x49')](_0xae79('0x8c'),_0xae79('0x5f'));if(_0x2b5e69[_0xae79('0x44')]){_0x2b5e69[_0xae79('0x44')][_0xae79('0x34')](function(_0x2cab0a){var _0x4bce42=_0x2cab0a[0x0]===_0xae79('0x8d')?_0x2cab0a[0x0]:'i.'+_0x2cab0a[0x0];_0x392158[_0xae79('0x44')](_0x4bce42,_0x2cab0a[0x1]===_0xae79('0x8e')?![]:!![]);});}if(!_[_0xae79('0x8f')](_0x4556fb)){_0x392158[_0xae79('0x60')](_0x18fc02);_0x138c2b[_0xae79('0x46')](_0xae79('0x90'),_0x4556fb);}BPromise['resolve']()[_0xae79('0x28')](function(){if(!_0x6865a8){if(_0x5f07bd['query'][_0xae79('0x74')])return;_0x138c2b[_0xae79('0x46')](_0xae79('0x91'));_0x392158[_0xae79('0x46')](_0xae79('0x91'));return;}if(_0x5f07bd[_0xae79('0x92')][_0xae79('0x93')]!==_0xae79('0x94'))return;return _0x5f07bd['user'][_0xae79('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1df275){if(_[_0xae79('0x8f')](_0x1df275)){_0x138c2b[_0xae79('0x46')](_0xae79('0x96'));_0x392158['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x138c2b[_0xae79('0x46')](_0xae79('0x75'),_[_0xae79('0x2f')](_0x1df275,'id'));_0x392158['where'](_0xae79('0x75'),_[_0xae79('0x2f')](_0x1df275,'id'));}});})[_0xae79('0x28')](function(){if(_0x5f07bd['user'][_0xae79('0x93')]===_0xae79('0x94')&&!_0x6865a8&&!_0x5f07bd[_0xae79('0x3d')][_0xae79('0x74')])return[];return db['sequelize'][_0xae79('0x3d')](_0x138c2b[_0xae79('0x97')](),_0x22c65f);})[_0xae79('0x28')](function(_0x126a17){_0x388c5f[_0xae79('0x22')]=_0x126a17[_0xae79('0x42')];if(_0x388c5f[_0xae79('0x22')]===0x0)return[];return db[_0xae79('0x98')][_0xae79('0x3d')](_0xb22d38[_0xae79('0x97')](),_0x22c65f)['then'](function(_0x306e71){_0x139cd8=_['keyBy'](_0x306e71,'id');_0x22c65f=_['merge'](_0x22c65f,{'model':db[_0xae79('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5f07bd['query']['fields']){_0x2b5e69[_0xae79('0x40')][_0xae79('0x34')](function(_0x26a535){_0x392158[_0xae79('0x49')]('i.'+_0x26a535);});}else{_0x392158['field'](_0xae79('0x8c'),_0xae79('0x5f'));_0x392158[_0xae79('0x49')]('a.key','Account.key');_0x392158[_0xae79('0x49')](_0xae79('0x99'),_0xae79('0x9a'));_0x392158['field'](_0xae79('0x9b'),_0xae79('0x8d'));_0x392158[_0xae79('0x49')]('i.*');_0x392158['field'](_0xae79('0x9c'),_0xae79('0x9d'));_0x392158[_0xae79('0x49')]('c.lastName',_0xae79('0x9e'));_0x392158[_0xae79('0x49')](_0xae79('0x9f'),_0xae79('0xa0'));_0x392158['field'](_0xae79('0xa1'),_0xae79('0xa2'));_0x392158['field'](_0xae79('0xa3'),_0xae79('0xa4'));_0x392158[_0xae79('0x49')]('c.fax',_0xae79('0xa5'));_0x392158[_0xae79('0x49')](_0xae79('0xa6'),_0xae79('0xa7'));_0x392158[_0xae79('0x49')](_0xae79('0xa8'),'Owner.internal');_0x392158[_0xae79('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xae79('0x32'));}if(_0x2b5e69[_0xae79('0x21')])_0x392158[_0xae79('0x21')](_0x2b5e69[_0xae79('0x21')]);if(_0x2b5e69[_0xae79('0x1f')])_0x392158[_0xae79('0x1f')](_0x2b5e69[_0xae79('0x1f')]);return db[_0xae79('0x98')][_0xae79('0x3d')](_0x392158[_0xae79('0x97')](),_0x22c65f);})[_0xae79('0x28')](function(_0x2b3b95){if(_0x2b3b95[_0xae79('0x42')]>0x0)_0x2615fd[_0xae79('0x46')](_0xae79('0xa9'),_['map'](_0x2b3b95,'id'));return db[_0xae79('0x98')]['query'](_0x2615fd[_0xae79('0x97')](),_0x22c65f)[_0xae79('0x28')](function(_0x5957f0){var _0x216f7e=_[_0xae79('0xaa')](_0x5957f0,'WhatsappInteractionId');var _0x1ebb19=[];_0x2b3b95[_0xae79('0x34')](function(_0x4732cf){_0x1ebb19[_0xae79('0x35')](updateWhatsappInteraction(_0x4732cf,_0x139cd8,_0x216f7e));});return BPromise[_0xae79('0xab')](_0x1ebb19);});});})[_0xae79('0x28')](function(_0x23550c){_0x388c5f[_0xae79('0xac')]=_0x23550c;return _0x388c5f;})[_0xae79('0x28')](respondWithFilteredResult(_0x273396,_0x2b5e69))[_0xae79('0x36')](handleError(_0x273396,null));};exports[_0xae79('0xad')]=function(_0x51d4a9,_0x4ddc47){var _0x4e988d={'raw':![],'where':{'id':_0x51d4a9[_0xae79('0xae')]['id']}},_0x2fed3d={};_0x2fed3d[_0xae79('0x3c')]=_[_0xae79('0x3e')](db[_0xae79('0x38')][_0xae79('0x39')]);_0x2fed3d[_0xae79('0x3d')]=_[_0xae79('0x3e')](_0x51d4a9[_0xae79('0x3d')]);_0x2fed3d[_0xae79('0x48')]=_['intersection'](_0x2fed3d[_0xae79('0x3c')],_0x2fed3d[_0xae79('0x3d')]);_0x4e988d[_0xae79('0x40')]=_[_0xae79('0x3f')](_0x2fed3d['model'],qs[_0xae79('0x41')](_0x51d4a9[_0xae79('0x3d')][_0xae79('0x41')]));_0x4e988d[_0xae79('0x40')]=_0x4e988d['attributes']['length']?_0x4e988d[_0xae79('0x40')]:_0x2fed3d[_0xae79('0x3c')];if(_0x51d4a9[_0xae79('0x3d')][_0xae79('0xaf')]){_0x4e988d['include']=[{'all':!![]}];}_0x4e988d=_['merge']({},_0x4e988d,_0x51d4a9[_0xae79('0xb0')]);return db[_0xae79('0x38')][_0xae79('0x66')](_0x4e988d)['then'](handleEntityNotFound(_0x4ddc47,null))[_0xae79('0x28')](respondWithResult(_0x4ddc47,null))['catch'](handleError(_0x4ddc47,null));};exports[_0xae79('0xb1')]=function(_0x9456bf,_0x357747){return db[_0xae79('0x38')][_0xae79('0xb1')](_0x9456bf[_0xae79('0x6f')],{})[_0xae79('0x28')](respondWithResult(_0x357747,0xc9))[_0xae79('0x36')](handleError(_0x357747,null));};exports[_0xae79('0x27')]=function(_0x27004b,_0xf5ac62){if(_0x27004b[_0xae79('0x6f')]['id']){delete _0x27004b[_0xae79('0x6f')]['id'];}return db[_0xae79('0x38')][_0xae79('0x66')]({'where':{'id':_0x27004b['params']['id']}})[_0xae79('0x28')](handleEntityNotFound(_0xf5ac62,null))[_0xae79('0x28')](saveUpdates(_0x27004b[_0xae79('0x6f')],null))[_0xae79('0x28')](respondWithResult(_0xf5ac62,null))['catch'](handleError(_0xf5ac62,null));};exports[_0xae79('0x29')]=function(_0x3320ca,_0x3bf602){return db[_0xae79('0x38')]['find']({'where':{'id':_0x3320ca[_0xae79('0xae')]['id']}})[_0xae79('0x28')](handleEntityNotFound(_0x3bf602,null))['then'](removeEntity(_0x3bf602,null))[_0xae79('0x36')](handleError(_0x3bf602,null));};exports['describe']=function(_0x441951,_0x5d5396){return db[_0xae79('0x38')][_0xae79('0xb2')]()[_0xae79('0x28')](respondWithResult(_0x5d5396,null))[_0xae79('0x36')](handleError(_0x5d5396,null));};exports[_0xae79('0xb3')]=function(_0x27e368,_0x11fd5c,_0x298a52){return db[_0xae79('0xb4')][_0xae79('0x66')]({'where':{'id':_0x27e368[_0xae79('0xae')]['id']}})[_0xae79('0x28')](handleEntityNotFound(_0x11fd5c,null))[_0xae79('0x28')](function(_0x208857){if(_0x208857){return _0x208857[_0xae79('0xb3')](_0x27e368['body'][_0xae79('0xb5')],_[_0xae79('0xb6')](_0x27e368[_0xae79('0x6f')],['ids','id'])||{});}})[_0xae79('0x28')](respondWithResult(_0x11fd5c,null))[_0xae79('0x36')](handleError(_0x11fd5c,null));};exports['getMessages']=function(_0x4e7f80,_0x1bb42a,_0x4229ce){var _0x4e3a86={'raw':![],'where':{}};var _0x5b0343={};var _0x270b88={'count':0x0,'rows':[]};return db[_0xae79('0x38')][_0xae79('0xb7')]({'where':{'id':_0x4e7f80[_0xae79('0xae')]['id']}})[_0xae79('0x28')](handleEntityNotFound(_0x1bb42a,null))[_0xae79('0x28')](function(_0x49ceaa){if(_0x49ceaa){_0x5b0343[_0xae79('0x3c')]=_[_0xae79('0x3e')](db[_0xae79('0xb4')][_0xae79('0x39')]);_0x5b0343['query']=_[_0xae79('0x3e')](_0x4e7f80[_0xae79('0x3d')]);_0x5b0343[_0xae79('0x48')]=_['intersection'](_0x5b0343[_0xae79('0x3c')],_0x5b0343[_0xae79('0x3d')]);_0x4e3a86['attributes']=_[_0xae79('0x3f')](_0x5b0343[_0xae79('0x3c')],qs[_0xae79('0x41')](_0x4e7f80['query'][_0xae79('0x41')]));_0x4e3a86['attributes']=_0x4e3a86[_0xae79('0x40')][_0xae79('0x42')]?_0x4e3a86[_0xae79('0x40')]:_0x5b0343['model'];if(!_0x4e7f80[_0xae79('0x3d')][_0xae79('0xb8')](_0xae79('0x43'))){_0x4e3a86['limit']=qs[_0xae79('0x21')](_0x4e7f80[_0xae79('0x3d')][_0xae79('0x21')]);_0x4e3a86['offset']=qs[_0xae79('0x1f')](_0x4e7f80['query']['offset']);}_0x4e3a86[_0xae79('0x44')]=qs[_0xae79('0x45')](_0x4e7f80[_0xae79('0x3d')]['sort']);_0x4e3a86[_0xae79('0x46')]=qs[_0xae79('0x48')](_[_0xae79('0x47')](_0x4e7f80[_0xae79('0x3d')],_0x5b0343[_0xae79('0x48')]));_0x4e3a86['where'][_0xae79('0xb9')]=_0x49ceaa['id'];if(_0x4e7f80['query'][_0xae79('0x81')]){_0x4e3a86[_0xae79('0x46')]=_[_0xae79('0xba')](_0x4e3a86['where'],{'$or':_['map'](_0x4e3a86[_0xae79('0x40')],function(_0x8272cd){var _0x331716={};_0x331716[_0x8272cd]={'$like':'%'+_0x4e7f80[_0xae79('0x3d')][_0xae79('0x81')]+'%'};return _0x331716;})});}if(_0x4e7f80['query'][_0xae79('0x78')]){var _0x429b58=_0x4e7f80[_0xae79('0x3d')][_0xae79('0x78')][_0xae79('0x33')](',');var _0x45f5b1={};_0x45f5b1[_0x429b58[0x0]]={'$gte':moment(_0x429b58[0x1])[_0xae79('0xbb')](_0xae79('0xbc'))};_0x4e3a86[_0xae79('0x46')]=_[_0xae79('0xba')](_0x4e3a86['where'],_0x45f5b1);}_0x4e3a86=_[_0xae79('0xba')]({},_0x4e3a86,_0x4e7f80['options']);return db[_0xae79('0xb4')]['count']({'where':_0x4e3a86[_0xae79('0x46')]})[_0xae79('0x28')](function(_0x28340e){_0x270b88[_0xae79('0x22')]=_0x28340e;if(_0x4e7f80[_0xae79('0x3d')][_0xae79('0xaf')]){_0x4e3a86[_0xae79('0xbd')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xae79('0xbe')](_0x4e3a86);})['then'](function(_0x42fdda){_0x270b88[_0xae79('0xac')]=_0x42fdda;return _0x270b88;});}})[_0xae79('0x28')](respondWithFilteredResult(_0x1bb42a,_0x4e3a86))[_0xae79('0x36')](handleError(_0x1bb42a,null));};exports[_0xae79('0xbf')]=function(_0x4b3609,_0x363762,_0xe14a62){return db[_0xae79('0x38')][_0xae79('0x66')]({'where':{'id':_0x4b3609[_0xae79('0xae')]['id']}})[_0xae79('0x28')](handleEntityNotFound(_0x363762,null))['then'](function(_0x5c6d28){if(_0x5c6d28){return _0x5c6d28[_0xae79('0xc0')](_0x4b3609[_0xae79('0x6f')][_0xae79('0xb5')],_[_0xae79('0xb6')](_0x4b3609['body'],['ids','id'])||{})['spread'](function(){return db[_0xae79('0xc1')][_0xae79('0xbe')]({'attributes':['id',_0xae79('0x2d'),_0xae79('0x4a')],'where':{'id':_0x4b3609[_0xae79('0x6f')]['ids']}});})['then'](function(_0x5f27ae){socket[_0xae79('0xc2')](_0xae79('0xc3'),{'id':Number(_0x4b3609['params']['id']),'tags':_0x5f27ae||[]});return{'id':Number(_0x4b3609['params']['id']),'tags':_0x5f27ae||[]};});}})[_0xae79('0x28')](respondWithResult(_0x363762,null))['catch'](handleError(_0x363762,null));};exports[_0xae79('0xc4')]=function(_0x541165,_0x593b28,_0x1c5889){return db[_0xae79('0x38')][_0xae79('0x66')]({'where':{'id':_0x541165['params']['id']}})[_0xae79('0x28')](handleEntityNotFound(_0x593b28,null))[_0xae79('0x28')](function(_0x1d5ac3){if(_0x1d5ac3){return _0x1d5ac3[_0xae79('0xc4')](_0x541165[_0xae79('0x3d')][_0xae79('0xb5')]);}})[_0xae79('0x28')](respondWithStatusCode(_0x593b28,null))[_0xae79('0x36')](handleError(_0x593b28,null));};exports[_0xae79('0xc5')]=function(_0x1063dc,_0x2746d5){var _0xba39ca=moment()[_0xae79('0xc6')]()[_0xae79('0x97')]();var _0x1e5fdf=path[_0xae79('0xc7')](config['root'],_0xae79('0xc8'),'files',_0xae79('0xc9'));var _0x2a6067=path['join'](config[_0xae79('0xca')],'server','files',_0xae79('0xcb'));var _0x395889=path[_0xae79('0xc7')](_0x1e5fdf,_0xba39ca);var _0x684921=util['format']('transcript-%d-%s.zip',_0x1063dc[_0xae79('0xae')]['id'],_0xba39ca);var _0x46cb00=path[_0xae79('0xc7')](_0x1e5fdf,_0x684921);var _0x120280=[];_0x120280[_0xae79('0x35')]({'model':db['User'],'as':_0xae79('0x6b'),'attributes':['id',_0xae79('0x30')],'raw':!![]});_0x120280[_0xae79('0x35')]({'model':db[_0xae79('0xcc')],'as':_0xae79('0x62'),'attributes':['id',_0xae79('0xcd'),'lastName'],'raw':!![]});if(_0x1063dc[_0xae79('0x3d')]['attachments']){_0x120280['push']({'model':db[_0xae79('0xce')],'as':_0xae79('0xce'),'raw':!![]});}var _0x492abb=[{'model':db[_0xae79('0xb4')],'as':'Messages','attributes':['id',_0xae79('0x6f'),_0xae79('0xcf'),_0xae79('0xd0'),_0xae79('0xd1'),_0xae79('0x7c')],'include':_0x120280}];_0x492abb['push']({'model':db[_0xae79('0xd2')],'as':_0xae79('0xd3'),'attributes':['id','name']});_0x492abb[_0xae79('0x35')]({'model':db['User'],'as':_0xae79('0xd4'),'attributes':['id',_0xae79('0x30')]});return db['WhatsappInteraction'][_0xae79('0x66')]({'where':{'id':_0x1063dc['params']['id']},'include':_0x492abb})[_0xae79('0x28')](handleEntityNotFound(_0x2746d5,null))[_0xae79('0x28')](function(_0x49e418){if(_0x49e418){var _0x3c4ade=_0x49e418['get']({'plain':!![]});fs[_0xae79('0xd5')](_0x395889);var _0x1ab9d2={'channel':_0xae79('0xd6'),'account':_0x3c4ade[_0xae79('0xd3')][_0xae79('0x2d')],'agent':_0x3c4ade[_0xae79('0xd4')]?_0x3c4ade[_0xae79('0xd4')][_0xae79('0x30')]:_0xae79('0xd7'),'createdAt':moment(_0x3c4ade[_0xae79('0xcf')])['format'](_0xae79('0xbc'))[_0xae79('0x97')](),'closedAt':_0x3c4ade[_0xae79('0xd8')]?moment(_0x3c4ade[_0xae79('0xd9')])[_0xae79('0xbb')](_0xae79('0xbc'))[_0xae79('0x97')]():'','disposition':_0x3c4ade[_0xae79('0xda')],'messages':_(_0x3c4ade[_0xae79('0xdb')])[_0xae79('0x81')]({'secret':![]})[_0xae79('0x2f')](function(_0x36ca05){if(_0x36ca05[_0xae79('0xce')]){var _0x4fcc2f=path[_0xae79('0xc7')](_0x2a6067,_0x36ca05[_0xae79('0xce')][_0xae79('0xdc')]);if(fs[_0xae79('0xdd')](_0x4fcc2f)){fs[_0xae79('0xde')](_0x4fcc2f)['pipe'](fs[_0xae79('0xdf')](path['join'](_0x395889,_0x36ca05[_0xae79('0xce')][_0xae79('0xdc')])));}}return{'date':moment(_0x36ca05[_0xae79('0xcf')])[_0xae79('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae79('0x97')](),'sender':_0x36ca05['direction']==='out'?_0x36ca05['User']?_0x36ca05[_0xae79('0x6b')][_0xae79('0x30')]:_0xae79('0xe0'):_0x36ca05[_0xae79('0x62')][_0xae79('0xcd')]+(_0x36ca05[_0xae79('0x62')][_0xae79('0xe1')]?'\x20'+_0x36ca05['Contact'][_0xae79('0xe1')]:''),'body':_0x36ca05['Attachment']?_0x36ca05[_0xae79('0xce')]['basename']:_0x36ca05[_0xae79('0x6f')],'direction':_0x36ca05['direction']==='out'?'A':'C','secret':_0x36ca05[_0xae79('0xd1')],'read':_0x36ca05[_0xae79('0x7c')],'attachment':_0x36ca05[_0xae79('0xce')]};})[_0xae79('0x65')]()};return ejs['renderFile'](path['join'](config[_0xae79('0xca')],_0xae79('0xc8'),_0xae79('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x1ab9d2})['then'](function(_0x5f4e90){var _0x229b27=path[_0xae79('0xc7')](_0x395889,_0xae79('0xe3')+_0x3c4ade['id']+'-'+_0xba39ca+_0xae79('0xe4'));var _0x42781d={'path':_0x229b27,'channel':_0xae79('0xd6'),'interactionId':_0x3c4ade['id']};return pdf['createPdfFromHTML'](_0x5f4e90,_0x42781d);})[_0xae79('0x28')](function(){return new BPromise(function(_0x3e06ff,_0x5a0b06){zipdir(_0x395889,{'saveTo':_0x46cb00},function(_0x444198,_0x1d967e){if(_0x444198)return _0x5a0b06(_0x444198);return _0x3e06ff(_0x1d967e);});})['then'](function(){return new BPromise(function(_0x167de8,_0x2723eb){rimraf(_0x395889,function(_0x2d41bb){if(_0x2d41bb)_0x2723eb(_0x2d41bb);return _0x167de8();});});})[_0xae79('0x28')](function(){return _0x2746d5[_0xae79('0xc5')](_0x46cb00,_0x684921,function(_0x421570){if(_0x421570){console['log'](_0xae79('0xe5'),_0x421570);}else{fs[_0xae79('0xe6')](_0x46cb00);}});});});}else{return _0x2746d5['sendStatus'](0xc8);}})[_0xae79('0x36')](handleError(_0x2746d5,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index aa6ee5d..fac2518 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 _0xc6d8=['unreadMessages','length','emit','catch','hook','events','WhatsappInteraction','WhatsappMessage','save','getUsers','then','Users','map','setDataValue'];(function(_0x242443,_0x1da832){var _0x3f8b58=function(_0x26abb1){while(--_0x26abb1){_0x242443['push'](_0x242443['shift']());}};_0x3f8b58(++_0x1da832);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x49748c,_0x3d2005){_0x49748c=_0x49748c-0x0;var _0xedf6b6=_0xc6d8[_0x49748c];return _0xedf6b6;};'use strict';var EventEmitter=require(_0x8c6d('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8c6d('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x8c6d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c6d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x352b8c){return function(_0xdff6f,_0x17781d,_0x4f5e8f){_0xdff6f[_0x8c6d('0x4')]({'attributes':['id'],'raw':!![]})[_0x8c6d('0x5')](function(_0x98cae4){_0xdff6f['setDataValue'](_0x8c6d('0x6'),_0x98cae4[_0x8c6d('0x7')](function(_0x16d4b2){return{'id':_0x16d4b2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xdff6f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8c6d('0x5')](function(_0x1ec65c){_0xdff6f[_0x8c6d('0x8')](_0x8c6d('0x9'),_0x1ec65c[_0x8c6d('0xa')]);WhatsappInteractionEvents[_0x8c6d('0xb')](_0x352b8c+':'+_0xdff6f['id'],_0xdff6f);WhatsappInteractionEvents[_0x8c6d('0xb')](_0x352b8c,_0xdff6f);_0x4f5e8f(null);})[_0x8c6d('0xc')](_0x4f5e8f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x8c6d('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x0884=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x2b192e,_0x28ec8a){var _0x3478b5=function(_0x1ec6b1){while(--_0x1ec6b1){_0x2b192e['push'](_0x2b192e['shift']());}};_0x3478b5(++_0x28ec8a);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4088('0x0'));var WhatsappInteraction=require(_0x4088('0x1'))['db'][_0x4088('0x2')];var WhatsappMessage=require(_0x4088('0x1'))['db'][_0x4088('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4088('0x4')](0x0);var events={'afterCreate':_0x4088('0x5'),'afterUpdate':'update','afterDestroy':_0x4088('0x6')};function emitEvent(_0x634f6f){return function(_0x19841,_0x426db2,_0x3b1d74){_0x19841['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x42b2c3){_0x19841['setDataValue'](_0x4088('0x7'),_0x42b2c3[_0x4088('0x8')](function(_0x38e9d9){return{'id':_0x38e9d9['id']};}));return WhatsappMessage[_0x4088('0x9')]({'where':{'WhatsappInteractionId':_0x19841['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4088('0xa')](function(_0x29c7ec){_0x19841[_0x4088('0xb')](_0x4088('0xc'),_0x29c7ec[_0x4088('0xd')]);WhatsappInteractionEvents['emit'](_0x634f6f+':'+_0x19841['id'],_0x19841);WhatsappInteractionEvents[_0x4088('0xe')](_0x634f6f,_0x19841);_0x3b1d74(null);})[_0x4088('0xf')](_0x3b1d74(null));};}for(var e in events){if(events[_0x4088('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x4088('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8598372..eed444e 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 _0x4f95=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./whatsappInteraction.attributes'];(function(_0x1b166e,_0x1bd8d5){var _0x114c40=function(_0x275037){while(--_0x275037){_0x1b166e['push'](_0x1b166e['shift']());}};_0x114c40(++_0x1bd8d5);}(_0x4f95,0x117));var _0x54f9=function(_0x590737,_0x31a509){_0x590737=_0x590737-0x0;var _0x35b57a=_0x4f95[_0x590737];return _0x35b57a;};'use strict';var _=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var logger=require(_0x54f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x54f9('0x3'));var rp=require(_0x54f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54f9('0x5'));var config=require('../../config/environment');var attributes=require(_0x54f9('0x6'));module['exports']=function(_0x4ac9,_0x271ba7){return _0x4ac9['define'](_0x54f9('0x7'),attributes,{'tableName':_0x54f9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc3e817,_0x5343ba,_0x1d1e50){if(_0xc3e817[_0x54f9('0x9')](_0x54f9('0xa'))){_0xc3e817[_0x54f9('0xb')]=moment()['format'](_0x54f9('0xc'));}_0x1d1e50(null,_0xc3e817);}}});}; \ No newline at end of file +var _0xccfe=['../../config/logger','api','moment','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closed','format','lodash','util'];(function(_0x5a7bde,_0xe244cb){var _0x47dfad=function(_0x5ae070){while(--_0x5ae070){_0x5a7bde['push'](_0x5a7bde['shift']());}};_0x47dfad(++_0xe244cb);}(_0xccfe,0x186));var _0xeccf=function(_0x117254,_0x5cd87a){_0x117254=_0x117254-0x0;var _0xbcd21d=_0xccfe[_0x117254];return _0xbcd21d;};'use strict';var _=require(_0xeccf('0x0'));var util=require(_0xeccf('0x1'));var logger=require(_0xeccf('0x2'))(_0xeccf('0x3'));var moment=require(_0xeccf('0x4'));var BPromise=require(_0xeccf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeccf('0x6'));var rimraf=require(_0xeccf('0x7'));var config=require('../../config/environment');var attributes=require(_0xeccf('0x8'));module[_0xeccf('0x9')]=function(_0x2db794,_0xb0df78){return _0x2db794[_0xeccf('0xa')]('WhatsappInteraction',attributes,{'tableName':_0xeccf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55ead3,_0x158f1f,_0x5267d6){if(_0x55ead3['changed'](_0xeccf('0xc'))){_0x55ead3['closedAt']=moment()[_0xeccf('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5267d6(null,_0x55ead3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 956c4fa..1840701 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 _0xbb9e=['where','info','catch','AddTagsToWhatsappInteraction','find','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw'];(function(_0x3e255a,_0x4c7f5b){var _0x187e67=function(_0x2eb6cc){while(--_0x2eb6cc){_0x3e255a['push'](_0x3e255a['shift']());}};_0x187e67(++_0x4c7f5b);}(_0xbb9e,0x18e));var _0xebb9=function(_0x14e51f,_0x330397){_0x14e51f=_0x14e51f-0x0;var _0x461921=_0xbb9e[_0x14e51f];return _0x461921;};'use strict';var _=require(_0xebb9('0x0'));var util=require(_0xebb9('0x1'));var moment=require(_0xebb9('0x2'));var BPromise=require('bluebird');var rs=require(_0xebb9('0x3'));var fs=require('fs');var Redis=require(_0xebb9('0x4'));var db=require(_0xebb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebb9('0x6'))(_0xebb9('0x7'));var config=require('../../config/environment');var jayson=require(_0xebb9('0x8'));var client=jayson[_0xebb9('0x9')][_0xebb9('0xa')]({'port':0x232a});config[_0xebb9('0xb')]=_['defaults'](config['redis'],{'host':_0xebb9('0xc'),'port':0x18eb});var socket=require(_0xebb9('0xd'))(new Redis(config[_0xebb9('0xb')]));require(_0xebb9('0xe'))[_0xebb9('0xf')](socket);function respondWithRpcPromise(_0x98ba46,_0xbf5303,_0x2d1f8e){return new BPromise(function(_0x40e1db,_0xaf8dba){return client[_0xebb9('0x10')](_0x98ba46,_0x2d1f8e)[_0xebb9('0x11')](function(_0x3d2cd9){logger['info'](_0xebb9('0x12'),_0xbf5303,_0xebb9('0x13'));logger[_0xebb9('0x14')](_0xebb9('0x15'),_0xbf5303,'request\x20sent',JSON[_0xebb9('0x16')](_0x3d2cd9));if(_0x3d2cd9['error']){if(_0x3d2cd9[_0xebb9('0x17')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xbf5303,_0x3d2cd9[_0xebb9('0x17')][_0xebb9('0x18')]);return _0xaf8dba(_0x3d2cd9[_0xebb9('0x17')][_0xebb9('0x18')]);}logger[_0xebb9('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0xbf5303,_0x3d2cd9[_0xebb9('0x17')]['message']);return _0x40e1db(_0x3d2cd9[_0xebb9('0x17')][_0xebb9('0x18')]);}else{logger['info'](_0xebb9('0x12'),_0xbf5303,_0xebb9('0x13'));_0x40e1db(_0x3d2cd9[_0xebb9('0x19')][_0xebb9('0x18')]);}})['catch'](function(_0x39d599){logger['error'](_0xebb9('0x12'),_0xbf5303,_0x39d599);_0xaf8dba(_0x39d599);});});}exports[_0xebb9('0x1a')]=function(_0x2a276a){var _0x5d66eb=this;return new Promise(function(_0x40fc93,_0x337e16){return db[_0xebb9('0x1b')]['update'](_0x2a276a[_0xebb9('0x1c')],{'raw':_0x2a276a[_0xebb9('0x1d')]?_0x2a276a['options'][_0xebb9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a276a['options']?_0x2a276a['options'][_0xebb9('0x1f')]||null:null,'attributes':_0x2a276a[_0xebb9('0x1d')]?_0x2a276a[_0xebb9('0x1d')]['attributes']||null:null,'limit':_0x2a276a[_0xebb9('0x1d')]?_0x2a276a[_0xebb9('0x1d')]['limit']||null:null})['then'](function(_0x19dd3c){logger[_0xebb9('0x20')](_0xebb9('0x1a'),_0x2a276a);logger[_0xebb9('0x14')](_0xebb9('0x1a'),_0x2a276a,JSON[_0xebb9('0x16')](_0x19dd3c));_0x40fc93(_0x19dd3c);})[_0xebb9('0x21')](function(_0xee7a4d){logger[_0xebb9('0x17')](_0xebb9('0x1a'),_0xee7a4d[_0xebb9('0x18')],_0x2a276a);_0x337e16(_0x5d66eb['error'](0x1f4,_0xee7a4d['message']));});});};exports[_0xebb9('0x22')]=function(_0x1f6518){return new Promise(function(_0x1aaef8,_0x4fd90b){return db[_0xebb9('0x1b')][_0xebb9('0x23')]({'where':_0x1f6518[_0xebb9('0x1d')]?_0x1f6518[_0xebb9('0x1d')]['where']||null:null})[_0xebb9('0x11')](function(_0x153bf7){if(_0x153bf7){return _0x153bf7['addTags'](_0x1f6518[_0xebb9('0x1c')][_0xebb9('0x24')],_[_0xebb9('0x25')](_0x1f6518[_0xebb9('0x1c')],[_0xebb9('0x24'),'id'])||{});}})['spread'](function(_0x2b1e53){logger[_0xebb9('0x20')](_0xebb9('0x26'),_0x1f6518);logger[_0xebb9('0x14')](_0xebb9('0x26'),_0x1f6518,JSON[_0xebb9('0x16')](_0x2b1e53));_0x1aaef8(_0x2b1e53);})[_0xebb9('0x21')](function(_0x2c6eda){logger[_0xebb9('0x17')]('AddTags',_0x2c6eda['message'],_0x1f6518);_0x4fd90b(_this[_0xebb9('0x17')](0x1f4,_0x2c6eda[_0xebb9('0x18')]));});});}; \ No newline at end of file +var _0x3fc9=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','attributes','limit','AddTagsToWhatsappInteraction','find','where','addTags','body','ids','omit','AddTags','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x493cd7,_0x539522){var _0x326fec=function(_0x50050a){while(--_0x50050a){_0x493cd7['push'](_0x493cd7['shift']());}};_0x326fec(++_0x539522);}(_0x3fc9,0xb0));var _0x93fc=function(_0xc18afe,_0x2e94a0){_0xc18afe=_0xc18afe-0x0;var _0x1b6c13=_0x3fc9[_0xc18afe];return _0x1b6c13;};'use strict';var _=require('lodash');var util=require(_0x93fc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93fc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93fc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x93fc('0x3'))('rpc');var config=require(_0x93fc('0x4'));var jayson=require(_0x93fc('0x5'));var client=jayson[_0x93fc('0x6')]['http']({'port':0x232a});config[_0x93fc('0x7')]=_[_0x93fc('0x8')](config[_0x93fc('0x7')],{'host':_0x93fc('0x9'),'port':0x18eb});var socket=require(_0x93fc('0xa'))(new Redis(config[_0x93fc('0x7')]));require(_0x93fc('0xb'))[_0x93fc('0xc')](socket);function respondWithRpcPromise(_0x189ccd,_0x172c7c,_0x4bc87a){return new BPromise(function(_0x1b2913,_0xa8ea5f){return client[_0x93fc('0xd')](_0x189ccd,_0x4bc87a)[_0x93fc('0xe')](function(_0xf30b78){logger[_0x93fc('0xf')](_0x93fc('0x10'),_0x172c7c,_0x93fc('0x11'));logger[_0x93fc('0x12')](_0x93fc('0x13'),_0x172c7c,_0x93fc('0x11'),JSON[_0x93fc('0x14')](_0xf30b78));if(_0xf30b78[_0x93fc('0x15')]){if(_0xf30b78[_0x93fc('0x15')][_0x93fc('0x16')]===0x1f4){logger['error'](_0x93fc('0x10'),_0x172c7c,_0xf30b78[_0x93fc('0x15')][_0x93fc('0x17')]);return _0xa8ea5f(_0xf30b78[_0x93fc('0x15')][_0x93fc('0x17')]);}logger[_0x93fc('0x15')](_0x93fc('0x10'),_0x172c7c,_0xf30b78[_0x93fc('0x15')][_0x93fc('0x17')]);return _0x1b2913(_0xf30b78[_0x93fc('0x15')][_0x93fc('0x17')]);}else{logger[_0x93fc('0xf')](_0x93fc('0x10'),_0x172c7c,_0x93fc('0x11'));_0x1b2913(_0xf30b78[_0x93fc('0x18')][_0x93fc('0x17')]);}})[_0x93fc('0x19')](function(_0x3da53e){logger[_0x93fc('0x15')](_0x93fc('0x10'),_0x172c7c,_0x3da53e);_0xa8ea5f(_0x3da53e);});});}exports[_0x93fc('0x1a')]=function(_0x4420f9){var _0x4f6e6e=this;return new Promise(function(_0x4baf7a,_0x32e590){return db[_0x93fc('0x1b')]['update'](_0x4420f9['body'],{'raw':_0x4420f9[_0x93fc('0x1c')]?_0x4420f9[_0x93fc('0x1c')][_0x93fc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4420f9['options']?_0x4420f9[_0x93fc('0x1c')]['where']||null:null,'attributes':_0x4420f9['options']?_0x4420f9[_0x93fc('0x1c')][_0x93fc('0x1e')]||null:null,'limit':_0x4420f9[_0x93fc('0x1c')]?_0x4420f9['options'][_0x93fc('0x1f')]||null:null})['then'](function(_0x3634df){logger[_0x93fc('0xf')](_0x93fc('0x1a'),_0x4420f9);logger[_0x93fc('0x12')](_0x93fc('0x1a'),_0x4420f9,JSON[_0x93fc('0x14')](_0x3634df));_0x4baf7a(_0x3634df);})[_0x93fc('0x19')](function(_0x1482e0){logger[_0x93fc('0x15')](_0x93fc('0x1a'),_0x1482e0['message'],_0x4420f9);_0x32e590(_0x4f6e6e[_0x93fc('0x15')](0x1f4,_0x1482e0['message']));});});};exports[_0x93fc('0x20')]=function(_0x60b5cf){return new Promise(function(_0x292145,_0x4f0ef2){return db['WhatsappInteraction'][_0x93fc('0x21')]({'where':_0x60b5cf[_0x93fc('0x1c')]?_0x60b5cf[_0x93fc('0x1c')][_0x93fc('0x22')]||null:null})['then'](function(_0x13a5d4){if(_0x13a5d4){return _0x13a5d4[_0x93fc('0x23')](_0x60b5cf[_0x93fc('0x24')][_0x93fc('0x25')],_[_0x93fc('0x26')](_0x60b5cf[_0x93fc('0x24')],[_0x93fc('0x25'),'id'])||{});}})['spread'](function(_0x4af65b){logger['info'](_0x93fc('0x27'),_0x60b5cf);logger[_0x93fc('0x12')](_0x93fc('0x27'),_0x60b5cf,JSON[_0x93fc('0x14')](_0x4af65b));_0x292145(_0x4af65b);})['catch'](function(_0x28b22a){logger['error'](_0x93fc('0x27'),_0x28b22a[_0x93fc('0x17')],_0x60b5cf);_0x4f0ef2(_this['error'](0x1f4,_0x28b22a[_0x93fc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4ee6389..786ec8d 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 _0xb0d0=['update','emit','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x2eb320,_0x17e9ce){var _0x4a1c47=function(_0x5b9a43){while(--_0x5b9a43){_0x2eb320['push'](_0x2eb320['shift']());}};_0x4a1c47(++_0x17e9ce);}(_0xb0d0,0x7b));var _0x0b0d=function(_0x21aae6,_0x55d0fc){_0x21aae6=_0x21aae6-0x0;var _0x5e4b7e=_0xb0d0[_0x21aae6];return _0x5e4b7e;};'use strict';var WhatsappInteractionEvents=require(_0x0b0d('0x0'));var events=['save',_0x0b0d('0x1'),_0x0b0d('0x2')];function createListener(_0xe0ad0f,_0x2489dc){return function(_0x5b8643){_0x2489dc[_0x0b0d('0x3')](_0xe0ad0f,_0x5b8643);};}function removeListener(_0x4dea2a,_0x459039){return function(){WhatsappInteractionEvents['removeListener'](_0x4dea2a,_0x459039);};}exports['register']=function(_0xc34194){for(var _0x580167=0x0,_0x50cee0=events['length'];_0x580167<_0x50cee0;_0x580167++){var _0x9d753a=events[_0x580167];var _0x1c3b1b=createListener(_0x0b0d('0x4')+_0x9d753a,_0xc34194);WhatsappInteractionEvents['on'](_0x9d753a,_0x1c3b1b);}}; \ No newline at end of file +var _0xc75f=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','update','emit','removeListener'];(function(_0x6d27cc,_0x575fb2){var _0x370cb7=function(_0xecf7ed){while(--_0xecf7ed){_0x6d27cc['push'](_0x6d27cc['shift']());}};_0x370cb7(++_0x575fb2);}(_0xc75f,0x123));var _0xfc75=function(_0x35c659,_0x129e8e){_0x35c659=_0x35c659-0x0;var _0xbd6e25=_0xc75f[_0x35c659];return _0xbd6e25;};'use strict';var WhatsappInteractionEvents=require(_0xfc75('0x0'));var events=[_0xfc75('0x1'),'remove',_0xfc75('0x2')];function createListener(_0x1e8780,_0x3372f9){return function(_0x32eb22){_0x3372f9[_0xfc75('0x3')](_0x1e8780,_0x32eb22);};}function removeListener(_0x3f49cf,_0x3561ce){return function(){WhatsappInteractionEvents[_0xfc75('0x4')](_0x3f49cf,_0x3561ce);};}exports[_0xfc75('0x5')]=function(_0x498f02){for(var _0x361de7=0x0,_0x1a2f96=events[_0xfc75('0x6')];_0x361de7<_0x1a2f96;_0x361de7++){var _0x5d0764=events[_0x361de7];var _0x3193f3=createListener(_0xfc75('0x7')+_0x5d0764,_0x498f02);WhatsappInteractionEvents['on'](_0x5d0764,_0x3193f3);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 80d56fd..34b6fe9 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 _0x43bf=['describe','/:id','show','post','tracked','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x470b39,_0xe3764){var _0x558412=function(_0xc5125){while(--_0xc5125){_0x470b39['push'](_0x470b39['shift']());}};_0x558412(++_0xe3764);}(_0x43bf,0x1ec));var _0xf43b=function(_0x192022,_0x23385c){_0x192022=_0x192022-0x0;var _0x161d8c=_0x43bf[_0x192022];return _0x161d8c;};'use strict';var multer=require(_0xf43b('0x0'));var util=require('util');var path=require(_0xf43b('0x1'));var timeout=require(_0xf43b('0x2'));var express=require('express');var router=express[_0xf43b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf43b('0x4'));var interaction=require(_0xf43b('0x5'));var config=require(_0xf43b('0x6'));var controller=require(_0xf43b('0x7'));router[_0xf43b('0x8')]('/',auth[_0xf43b('0x9')](),controller[_0xf43b('0xa')]);router['get'](_0xf43b('0xb'),auth[_0xf43b('0x9')](),controller[_0xf43b('0xc')]);router[_0xf43b('0x8')](_0xf43b('0xd'),auth[_0xf43b('0x9')](),controller[_0xf43b('0xe')]);router[_0xf43b('0xf')]('/',auth[_0xf43b('0x9')](),interaction[_0xf43b('0x10')]('whatsapp',_0xf43b('0x11')),controller[_0xf43b('0x12')]);router['post']('/:id/status',controller[_0xf43b('0x13')]);router[_0xf43b('0x14')](_0xf43b('0xd'),auth[_0xf43b('0x9')](),controller[_0xf43b('0x15')]);router['put'](_0xf43b('0x16'),auth['isAuthenticated'](),controller[_0xf43b('0x17')]);router['put'](_0xf43b('0x18'),auth[_0xf43b('0x9')](),controller[_0xf43b('0x19')]);router[_0xf43b('0x1a')]('/:id',auth[_0xf43b('0x9')](),controller['destroy']);module[_0xf43b('0x1b')]=router; \ No newline at end of file +var _0xfc72=['status','put','update','/:id/accept','accept','/:id/reject','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xfc72,0x159));var _0x2fc7=function(_0x3c6a2f,_0x398815){_0x3c6a2f=_0x3c6a2f-0x0;var _0x5a90e3=_0xfc72[_0x3c6a2f];return _0x5a90e3;};'use strict';var multer=require('multer');var util=require(_0x2fc7('0x0'));var path=require(_0x2fc7('0x1'));var timeout=require(_0x2fc7('0x2'));var express=require('express');var router=express[_0x2fc7('0x3')]();var fs_extra=require(_0x2fc7('0x4'));var auth=require(_0x2fc7('0x5'));var interaction=require(_0x2fc7('0x6'));var config=require(_0x2fc7('0x7'));var controller=require(_0x2fc7('0x8'));router[_0x2fc7('0x9')]('/',auth[_0x2fc7('0xa')](),controller[_0x2fc7('0xb')]);router[_0x2fc7('0x9')](_0x2fc7('0xc'),auth['isAuthenticated'](),controller[_0x2fc7('0xd')]);router[_0x2fc7('0x9')](_0x2fc7('0xe'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0xf')]);router[_0x2fc7('0x10')]('/',auth[_0x2fc7('0xa')](),interaction[_0x2fc7('0x11')](_0x2fc7('0x12'),'whatsappmessage:create'),controller['create']);router['post']('/:id/status',controller[_0x2fc7('0x13')]);router[_0x2fc7('0x14')](_0x2fc7('0xe'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0x15')]);router[_0x2fc7('0x14')](_0x2fc7('0x16'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0x17')]);router[_0x2fc7('0x14')](_0x2fc7('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0x2fc7('0x19')](_0x2fc7('0xe'),auth[_0x2fc7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f3b94b5..58c4c6d 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 _0x1ff2=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x13e4d6,_0x4d647f){var _0x395c06=function(_0x55ce7f){while(--_0x55ce7f){_0x13e4d6['push'](_0x13e4d6['shift']());}};_0x395c06(++_0x4d647f);}(_0x1ff2,0x141));var _0x21ff=function(_0x24f047,_0xd6513e){_0x24f047=_0x24f047-0x0;var _0x3a4d36=_0x1ff2[_0x24f047];return _0x3a4d36;};'use strict';var Sequelize=require(_0x21ff('0x0'));module[_0x21ff('0x1')]={'body':{'type':Sequelize[_0x21ff('0x2')](_0x21ff('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x21ff('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x21ff('0x5')]('in',_0x21ff('0x6')),'defaultValue':_0x21ff('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x21ff('0x7')](0xbe)},'phone':{'type':Sequelize[_0x21ff('0x7')]},'readAt':{'type':Sequelize[_0x21ff('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x21ff('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf6e4=['BOOLEAN','sequelize','exports','TEXT','ENUM','out','STRING','DATE'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xf6e4,0x129));var _0x4f6e=function(_0x34ae07,_0x427677){_0x34ae07=_0x34ae07-0x0;var _0x2f45bb=_0xf6e4[_0x34ae07];return _0x2f45bb;};'use strict';var Sequelize=require(_0x4f6e('0x0'));module[_0x4f6e('0x1')]={'body':{'type':Sequelize[_0x4f6e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f6e('0x3')]('in',_0x4f6e('0x4')),'defaultValue':_0x4f6e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4f6e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4f6e('0x5')]},'readAt':{'type':Sequelize[_0x4f6e('0x6')]},'secret':{'type':Sequelize[_0x4f6e('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4f6e('0x5')]},'providerResponse':{'type':Sequelize[_0x4f6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 6e9c343..e2bfb53 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 _0xed7f=['name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','options','include','show','params','includeAll','find','create','body','describe','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','WhatsappInteraction','WhatsappInteractionId','UserId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','whatsapp-interactions','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','contact','SIP/%s','event','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','stack'];(function(_0x28f1c7,_0x3daa90){var _0x173208=function(_0x143775){while(--_0x143775){_0x28f1c7['push'](_0x28f1c7['shift']());}};_0x173208(++_0x3daa90);}(_0xed7f,0xd8));var _0xfed7=function(_0x1c83c9,_0x2a0efc){_0x1c83c9=_0x1c83c9-0x0;var _0x49c840=_0xed7f[_0x1c83c9];return _0x49c840;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfed7('0x0'));var rp=require(_0xfed7('0x1'));var moment=require(_0xfed7('0x2'));var BPromise=require(_0xfed7('0x3'));var Mustache=require(_0xfed7('0x4'));var util=require(_0xfed7('0x5'));var path=require(_0xfed7('0x6'));var sox=require(_0xfed7('0x7'));var csv=require(_0xfed7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfed7('0x9'));var squel=require(_0xfed7('0xa'));var crypto=require('crypto');var jsforce=require(_0xfed7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfed7('0x8'));var querystring=require('querystring');var Papa=require(_0xfed7('0xc'));var Redis=require(_0xfed7('0xd'));var authService=require(_0xfed7('0xe'));var qs=require(_0xfed7('0xf'));var as=require(_0xfed7('0x10'));var hardwareService=require(_0xfed7('0x11'));var logger=require(_0xfed7('0x12'))(_0xfed7('0x13'));var utils=require(_0xfed7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfed7('0x15'));var db=require(_0xfed7('0x16'))['db'];config[_0xfed7('0x17')]=_[_0xfed7('0x18')](config[_0xfed7('0x17')],{'host':_0xfed7('0x19'),'port':0x18eb});var socket=require(_0xfed7('0x1a'))(new Redis(config[_0xfed7('0x17')]));require('./whatsappMessage.socket')[_0xfed7('0x1b')](socket);var jayson=require(_0xfed7('0x1c'));var client=jayson[_0xfed7('0x1d')][_0xfed7('0x1e')]({'port':0x232c});var client9002=jayson[_0xfed7('0x1d')][_0xfed7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3bb0c7,_0x15f165,_0x5c005f,_0x100124){return new BPromise(function(_0x4761b0,_0x23c88d){var _0x318b7f=_0x100124||client;return _0x318b7f[_0xfed7('0x1f')](_0x3bb0c7,_0x5c005f)['then'](function(_0x2fab75){logger[_0xfed7('0x20')](_0xfed7('0x21'),_0x15f165,_0xfed7('0x22'));logger[_0xfed7('0x23')](_0xfed7('0x24'),_0x15f165,_0xfed7('0x22'),JSON[_0xfed7('0x25')](_0x2fab75));if(_0x2fab75['error']){if(_0x2fab75[_0xfed7('0x26')][_0xfed7('0x27')]===0x1f4){logger[_0xfed7('0x26')](_0xfed7('0x21'),_0x15f165,_0x2fab75['error']['message']);return _0x23c88d(_0x2fab75[_0xfed7('0x26')][_0xfed7('0x28')]);}logger[_0xfed7('0x26')](_0xfed7('0x21'),_0x15f165,_0x2fab75[_0xfed7('0x26')]['message']);return _0x4761b0(_0x2fab75['error'][_0xfed7('0x28')]);}else{logger[_0xfed7('0x20')](_0xfed7('0x21'),_0x15f165,'request\x20sent');_0x4761b0(_0x2fab75[_0xfed7('0x29')][_0xfed7('0x28')]);}})[_0xfed7('0x2a')](function(_0x5bae21){logger[_0xfed7('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x15f165,_0x5bae21);_0x23c88d(_0x5bae21);});});}function respondWithStatusCode(_0x27db6b,_0x3adbe8){_0x3adbe8=_0x3adbe8||0xcc;return function(_0x3d66a1){if(_0x3d66a1){return _0x27db6b[_0xfed7('0x2b')](_0x3adbe8);}return _0x27db6b[_0xfed7('0x2c')](_0x3adbe8)['end']();};}function respondWithResult(_0x1f121b,_0x5a03a8){_0x5a03a8=_0x5a03a8||0xc8;return function(_0x570dcd){if(_0x570dcd){return _0x1f121b['status'](_0x5a03a8)[_0xfed7('0x2d')](_0x570dcd);}};}function respondWithFilteredResult(_0x1e4e77,_0x41d97c){return function(_0x1f42c3){if(_0x1f42c3){var _0x287e24=typeof _0x41d97c[_0xfed7('0x2e')]===_0xfed7('0x2f')&&typeof _0x41d97c['limit']===_0xfed7('0x2f');var _0x4c1021=_0x1f42c3[_0xfed7('0x30')];var _0x51ffa4=_0x287e24?0x0:_0x41d97c[_0xfed7('0x2e')];var _0x4132dd=_0x287e24?_0x1f42c3[_0xfed7('0x30')]:_0x41d97c[_0xfed7('0x2e')]+_0x41d97c[_0xfed7('0x31')];var _0x21377d;if(_0x4132dd>=_0x4c1021){_0x4132dd=_0x4c1021;_0x21377d=0xc8;}else{_0x21377d=0xce;}_0x1e4e77[_0xfed7('0x2c')](_0x21377d);return _0x1e4e77['set'](_0xfed7('0x32'),_0x51ffa4+'-'+_0x4132dd+'/'+_0x4c1021)[_0xfed7('0x2d')](_0x1f42c3);}return null;};}function patchUpdates(_0x5ff332){return function(_0x386274){try{jsonpatch[_0xfed7('0x33')](_0x386274,_0x5ff332,!![]);}catch(_0x5bb741){return BPromise['reject'](_0x5bb741);}return _0x386274[_0xfed7('0x34')]();};}function saveUpdates(_0x1435c6,_0x19b813){return function(_0x81acd0){if(_0x81acd0){return _0x81acd0[_0xfed7('0x35')](_0x1435c6)[_0xfed7('0x36')](function(_0x8ea1cb){return _0x8ea1cb;});}return null;};}function removeEntity(_0xc80594,_0x18ccf4){return function(_0x19d6e8){if(_0x19d6e8){return _0x19d6e8[_0xfed7('0x37')]()[_0xfed7('0x36')](function(){_0xc80594['status'](0xcc)[_0xfed7('0x38')]();});}};}function handleEntityNotFound(_0x4a97e8,_0x2a1ced){return function(_0x2d2371){if(!_0x2d2371){_0x4a97e8['sendStatus'](0x194);}return _0x2d2371;};}function handleError(_0x20cd86,_0x42c139){_0x42c139=_0x42c139||0x1f4;return function(_0x4f9d30){logger[_0xfed7('0x26')](_0x4f9d30[_0xfed7('0x39')]);if(_0x4f9d30['name']){delete _0x4f9d30[_0xfed7('0x3a')];}_0x20cd86[_0xfed7('0x2c')](_0x42c139)[_0xfed7('0x3b')](_0x4f9d30);};}exports[_0xfed7('0x3c')]=function(_0x2d8294,_0x427fb9){var _0x566dc0={},_0x21a11b={},_0x4867c1={'count':0x0,'rows':[]};var _0x2ed546=_[_0xfed7('0x3d')](db[_0xfed7('0x3e')][_0xfed7('0x3f')],function(_0x1df0a7){return{'name':_0x1df0a7['fieldName'],'type':_0x1df0a7[_0xfed7('0x40')][_0xfed7('0x41')]};});_0x21a11b[_0xfed7('0x42')]=_[_0xfed7('0x3d')](_0x2ed546,'name');_0x21a11b['query']=_[_0xfed7('0x43')](_0x2d8294[_0xfed7('0x44')]);_0x21a11b['filters']=_[_0xfed7('0x45')](_0x21a11b[_0xfed7('0x42')],_0x21a11b[_0xfed7('0x44')]);_0x566dc0[_0xfed7('0x46')]=_['intersection'](_0x21a11b[_0xfed7('0x42')],qs[_0xfed7('0x47')](_0x2d8294[_0xfed7('0x44')][_0xfed7('0x47')]));_0x566dc0[_0xfed7('0x46')]=_0x566dc0[_0xfed7('0x46')][_0xfed7('0x48')]?_0x566dc0[_0xfed7('0x46')]:_0x21a11b['model'];if(!_0x2d8294[_0xfed7('0x44')]['hasOwnProperty'](_0xfed7('0x49'))){_0x566dc0[_0xfed7('0x31')]=qs['limit'](_0x2d8294[_0xfed7('0x44')][_0xfed7('0x31')]);_0x566dc0[_0xfed7('0x2e')]=qs[_0xfed7('0x2e')](_0x2d8294[_0xfed7('0x44')][_0xfed7('0x2e')]);}_0x566dc0['order']=qs[_0xfed7('0x4a')](_0x2d8294[_0xfed7('0x44')][_0xfed7('0x4a')]);_0x566dc0[_0xfed7('0x4b')]=qs[_0xfed7('0x4c')](_[_0xfed7('0x4d')](_0x2d8294['query'],_0x21a11b[_0xfed7('0x4c')]),_0x2ed546);if(_0x2d8294[_0xfed7('0x44')]['filter']){_0x566dc0[_0xfed7('0x4b')]=_['merge'](_0x566dc0[_0xfed7('0x4b')],{'$or':_[_0xfed7('0x3d')](_0x2ed546,function(_0x1421f7){if(_0x1421f7[_0xfed7('0x40')]!=='VIRTUAL'){var _0x129208={};_0x129208[_0x1421f7[_0xfed7('0x3a')]]={'$like':'%'+_0x2d8294[_0xfed7('0x44')]['filter']+'%'};return _0x129208;}})});}_0x566dc0=_[_0xfed7('0x4e')]({},_0x566dc0,_0x2d8294[_0xfed7('0x4f')]);var _0x597f3f={'where':_0x566dc0[_0xfed7('0x4b')]};return db[_0xfed7('0x3e')]['count'](_0x597f3f)[_0xfed7('0x36')](function(_0x4eeaf4){_0x4867c1[_0xfed7('0x30')]=_0x4eeaf4;if(_0x2d8294['query']['includeAll']){_0x566dc0[_0xfed7('0x50')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x566dc0);})['then'](function(_0x877e83){_0x4867c1['rows']=_0x877e83;return _0x4867c1;})[_0xfed7('0x36')](respondWithFilteredResult(_0x427fb9,_0x566dc0))[_0xfed7('0x2a')](handleError(_0x427fb9,null));};exports[_0xfed7('0x51')]=function(_0x1eaf8f,_0x14b445){var _0x186142={'raw':!![],'where':{'id':_0x1eaf8f[_0xfed7('0x52')]['id']}},_0x47d303={};_0x47d303[_0xfed7('0x42')]=_[_0xfed7('0x43')](db[_0xfed7('0x3e')][_0xfed7('0x3f')]);_0x47d303['query']=_[_0xfed7('0x43')](_0x1eaf8f[_0xfed7('0x44')]);_0x47d303[_0xfed7('0x4c')]=_[_0xfed7('0x45')](_0x47d303[_0xfed7('0x42')],_0x47d303['query']);_0x186142[_0xfed7('0x46')]=_[_0xfed7('0x45')](_0x47d303[_0xfed7('0x42')],qs[_0xfed7('0x47')](_0x1eaf8f[_0xfed7('0x44')][_0xfed7('0x47')]));_0x186142[_0xfed7('0x46')]=_0x186142['attributes'][_0xfed7('0x48')]?_0x186142[_0xfed7('0x46')]:_0x47d303['model'];if(_0x1eaf8f[_0xfed7('0x44')][_0xfed7('0x53')]){_0x186142[_0xfed7('0x50')]=[{'all':!![]}];}_0x186142=_[_0xfed7('0x4e')]({},_0x186142,_0x1eaf8f[_0xfed7('0x4f')]);return db['WhatsappMessage'][_0xfed7('0x54')](_0x186142)[_0xfed7('0x36')](handleEntityNotFound(_0x14b445,null))[_0xfed7('0x36')](respondWithResult(_0x14b445,null))[_0xfed7('0x2a')](handleError(_0x14b445,null));};exports[_0xfed7('0x55')]=function(_0x1190e,_0x28638b){return db[_0xfed7('0x3e')][_0xfed7('0x55')](_0x1190e['body'],{})[_0xfed7('0x36')](respondWithResult(_0x28638b,0xc9))[_0xfed7('0x2a')](handleError(_0x28638b,null));};exports[_0xfed7('0x35')]=function(_0x591421,_0x214e20){if(_0x591421[_0xfed7('0x56')]['id']){delete _0x591421[_0xfed7('0x56')]['id'];}return db[_0xfed7('0x3e')][_0xfed7('0x54')]({'where':{'id':_0x591421[_0xfed7('0x52')]['id']}})[_0xfed7('0x36')](handleEntityNotFound(_0x214e20,null))[_0xfed7('0x36')](saveUpdates(_0x591421[_0xfed7('0x56')],null))[_0xfed7('0x36')](respondWithResult(_0x214e20,null))['catch'](handleError(_0x214e20,null));};exports[_0xfed7('0x37')]=function(_0x1c7b59,_0x2787a0){return db[_0xfed7('0x3e')][_0xfed7('0x54')]({'where':{'id':_0x1c7b59[_0xfed7('0x52')]['id']}})['then'](handleEntityNotFound(_0x2787a0,null))['then'](removeEntity(_0x2787a0,null))[_0xfed7('0x2a')](handleError(_0x2787a0,null));};exports['describe']=function(_0x991ad2,_0x9ed956){return db[_0xfed7('0x3e')][_0xfed7('0x57')]()[_0xfed7('0x36')](respondWithResult(_0x9ed956,null))[_0xfed7('0x2a')](handleError(_0x9ed956,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['accept']=function(_0x9693f5,_0x437c10,_0x1c3400){var _0x387c80={'agent':{},'channel':_0xfed7('0x58')};if(_0x9693f5[_0xfed7('0x56')]['id']){delete _0x9693f5['body']['id'];}_0x9693f5['body'][_0xfed7('0x59')]=!![];_0x9693f5['body'][_0xfed7('0x5a')]=moment()['format'](_0xfed7('0x5b'));_0x9693f5[_0xfed7('0x56')]['UserId']=_0x9693f5[_0xfed7('0x56')]['UserId']||_0x9693f5[_0xfed7('0x5c')]['id'];_0x387c80[_0xfed7('0x5d')]['id']=_0x9693f5[_0xfed7('0x56')]['UserId'];return db[_0xfed7('0x3e')]['find']({'where':{'id':_0x9693f5[_0xfed7('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x437c10,null))[_0xfed7('0x36')](saveUpdates(_0x9693f5[_0xfed7('0x56')],null))[_0xfed7('0x36')](function(_0x260cb5){if(_0x260cb5){_0x387c80[_0xfed7('0x28')]=_0x260cb5[_0xfed7('0x5e')]({'plain':!![]});return db[_0xfed7('0x5f')][_0xfed7('0x54')]({'where':{'id':_0x260cb5[_0xfed7('0x60')]}});}return null;})[_0xfed7('0x36')](handleEntityNotFound(_0x437c10,null))[_0xfed7('0x36')](function(_0x1cd69e){if(_0x1cd69e){return _0x1cd69e[_0xfed7('0x35')]({'UserId':_0x9693f5['body'][_0xfed7('0x61')],'read1stAt':_[_0xfed7('0x62')](_0x1cd69e[_0xfed7('0x63')])?moment()[_0xfed7('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x312409){if(_0x312409){_0x387c80['interaction']=_0x312409[_0xfed7('0x5e')]({'plain':!![]});interaction_log[_0xfed7('0x20')](_0xfed7('0x65'),_0x9693f5['user']['id'],_0x9693f5[_0xfed7('0x5c')][_0xfed7('0x3a')],_0x9693f5[_0xfed7('0x5c')]['role'],_0x387c80[_0xfed7('0x66')]['id'],_0x9693f5['body']?JSON[_0xfed7('0x25')](_0x9693f5[_0xfed7('0x56')]):'null');return respondWithRpcPromise(_0xfed7('0x67'),'acceptMessage',_0x387c80);}return null;})[_0xfed7('0x36')](function(_0x59a915){var _0x274b94=_0xfed7('0x68')+_0x59a915[_0xfed7('0x28')]['ContactId'];return db['sequelize']['query'](_0x274b94,{'type':db['Sequelize'][_0xfed7('0x69')][_0xfed7('0x6a')],'raw':!![]})[_0xfed7('0x36')](function(_0x2f27ce){return _0x2f27ce;});})[_0xfed7('0x36')](function(_0x278fbc){if(_0x278fbc){_0x387c80[_0xfed7('0x28')]['contact']=_0x278fbc[0x0];if(!_0x9693f5[_0xfed7('0x56')]['UserId'])return;return db[_0xfed7('0x6b')][_0xfed7('0x54')]({'where':{'id':_0x9693f5['body']['UserId'],'role':_0xfed7('0x5d')},'attributes':['id','name',_0xfed7('0x6c'),_0xfed7('0x6d'),_0xfed7('0x6e')],'raw':!![]});}return null;})[_0xfed7('0x36')](function(_0x52f23c){if(!_0x52f23c)return null;_0x387c80[_0xfed7('0x28')][_0xfed7('0x5d')]=_0x52f23c;return _0x387c80;})[_0xfed7('0x36')](function(_0x23b154){if(_0x23b154){if(_0x9693f5['body'][_0xfed7('0x6f')]){_0x387c80[_0xfed7('0x28')][_0xfed7('0x70')]=util[_0xfed7('0x64')]('SIP/%s',_0x9693f5[_0xfed7('0x5c')][_0xfed7('0x3a')]);_0x387c80[_0xfed7('0x28')][_0xfed7('0x71')]=_0x387c80['channel'];_0x387c80[_0xfed7('0x28')][_0xfed7('0x72')]=_0x387c80['channel'];_0x387c80['message']['event']='accept';return respondWithRpcPromise(_0xfed7('0x73'),_0xfed7('0x73'),{'event':_0xfed7('0x74'),'message':_0x387c80['message']},client9002)[_0xfed7('0x36')](function(){return _0x387c80;});}return _0x387c80;}return null;})[_0xfed7('0x36')](respondWithResult(_0x437c10,null))[_0xfed7('0x2a')](handleError(_0x437c10,null));};var interaction_log=require(_0xfed7('0x12'))(_0xfed7('0x75'));exports[_0xfed7('0x76')]=function(_0x3e9c93,_0x33c783,_0x44aa48){var _0x47146d={'agent':{},'channel':_0xfed7('0x58')};if(_0x3e9c93['body']['id']){delete _0x3e9c93[_0xfed7('0x56')]['id'];}_0x3e9c93[_0xfed7('0x56')][_0xfed7('0x61')]=_0x3e9c93['body'][_0xfed7('0x61')]||_0x3e9c93['user']['id'];_0x47146d[_0xfed7('0x5d')]['id']=_0x3e9c93[_0xfed7('0x56')]['UserId'];return db['WhatsappMessage'][_0xfed7('0x54')]({'where':{'id':_0x3e9c93['params']['id'],'UserId':null}})[_0xfed7('0x36')](handleEntityNotFound(_0x33c783,null))['then'](function(_0x13498d){if(_0x13498d){_0x47146d[_0xfed7('0x28')]=_0x13498d[_0xfed7('0x5e')]({'plain':!![]});return db[_0xfed7('0x5f')][_0xfed7('0x54')]({'where':{'id':_0x13498d[_0xfed7('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x33c783,null))[_0xfed7('0x36')](function(_0x4e5ac7){if(_0x4e5ac7){_0x47146d[_0xfed7('0x66')]=_0x4e5ac7[_0xfed7('0x5e')]({'plain':!![]});interaction_log[_0xfed7('0x20')](_0xfed7('0x77'),_0x3e9c93[_0xfed7('0x5c')]['id'],_0x3e9c93[_0xfed7('0x5c')]['name'],_0x3e9c93['user']['role'],_0x47146d['interaction']['id'],_0x3e9c93[_0xfed7('0x56')]?JSON[_0xfed7('0x25')](_0x3e9c93[_0xfed7('0x56')]):'null');return respondWithRpcPromise(_0xfed7('0x78'),_0xfed7('0x79'),_0x47146d);}return null;})[_0xfed7('0x36')](function(_0x321262){var _0x44f66a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x321262[_0xfed7('0x28')][_0xfed7('0x7a')];return db[_0xfed7('0x7b')]['query'](_0x44f66a,{'type':db[_0xfed7('0x7c')][_0xfed7('0x69')][_0xfed7('0x6a')],'raw':!![]})[_0xfed7('0x36')](function(_0xc7a716){return _0xc7a716;});})[_0xfed7('0x36')](function(_0xb2b3f2){if(_0xb2b3f2){_0x47146d[_0xfed7('0x28')][_0xfed7('0x7d')]=_0xb2b3f2[0x0];if(!_0x3e9c93[_0xfed7('0x56')][_0xfed7('0x61')])return;return db['User']['find']({'where':{'id':_0x3e9c93[_0xfed7('0x56')][_0xfed7('0x61')],'role':_0xfed7('0x5d')},'attributes':['id',_0xfed7('0x3a'),_0xfed7('0x6c'),'email',_0xfed7('0x6e')],'raw':!![]});}return null;})[_0xfed7('0x36')](function(_0x1fc747){if(!_0x1fc747)return null;_0x47146d[_0xfed7('0x28')]['agent']=_0x1fc747;return _0x47146d;})[_0xfed7('0x36')](function(_0x61d77e){if(_0x61d77e){_0x61d77e[_0xfed7('0x28')][_0xfed7('0x70')]=util['format'](_0xfed7('0x7e'),_0x3e9c93[_0xfed7('0x5c')][_0xfed7('0x3a')]);_0x61d77e[_0xfed7('0x28')][_0xfed7('0x71')]=_0x47146d[_0xfed7('0x71')];_0x61d77e[_0xfed7('0x28')][_0xfed7('0x72')]=_0x47146d[_0xfed7('0x71')];_0x61d77e[_0xfed7('0x28')][_0xfed7('0x7f')]=_0xfed7('0x76');respondWithRpcPromise('EventManager',_0xfed7('0x73'),{'event':_0xfed7('0x80'),'message':_0x61d77e[_0xfed7('0x28')]},client9002);return _0x47146d;}return null;})['then'](respondWithResult(_0x33c783,null))['catch'](handleError(_0x33c783,null));};exports[_0xfed7('0x2c')]=function(_0x2ab84f,_0xc4675,_0x271686){if(_0x2ab84f[_0xfed7('0x56')]['id']){delete _0x2ab84f['body']['id'];}var _0x3d6d2e;return db['WhatsappMessage'][_0xfed7('0x54')]({'where':{'id':_0x2ab84f[_0xfed7('0x52')]['id']}})[_0xfed7('0x36')](handleEntityNotFound(_0xc4675,null))[_0xfed7('0x36')](function(_0x2350d7){if(_0x2350d7){_0x3d6d2e=_0x2350d7;return db['WhatsappAccount'][_0xfed7('0x54')]({'where':{'id':_0x2350d7[_0xfed7('0x81')]}});}})['then'](handleEntityNotFound(_0xc4675,null))[_0xfed7('0x36')](function(_0x2e0467){if(_0x2e0467){logger['debug'](_0xfed7('0x82'),'status',_0xfed7('0x83'),_0x2e0467[_0xfed7('0x40')],util[_0xfed7('0x84')](_0x2ab84f[_0xfed7('0x56')],{'showHidden':![],'depth':null}));switch(_0x2e0467[_0xfed7('0x40')]){case _0xfed7('0x85'):if(_0x2ab84f[_0xfed7('0x56')][_0xfed7('0x86')]&&_0x2ab84f[_0xfed7('0x56')][_0xfed7('0x86')]===_0x3d6d2e['messageId']&&_0x2ab84f['body'][_0xfed7('0x87')]&&_0x2ab84f[_0xfed7('0x56')][_0xfed7('0x87')]===_0xfed7('0x59')){return _0x3d6d2e['update']({'read':!![]});}else{logger[_0xfed7('0x26')](_0xfed7('0x88'),'status',_0xfed7('0x85'),util['inspect'](_0x2ab84f[_0xfed7('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3d6d2e;}})['then'](respondWithResult(_0xc4675,null))[_0xfed7('0x2a')](handleError(_0xc4675,null));}; \ No newline at end of file +var _0xe152=['WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','map','WhatsappMessage','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','show','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','event','EventManager','acceptmessage','../../config/logger','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','channel','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read'];(function(_0x5898e1,_0x32e0f5){var _0x581609=function(_0x4ab4b6){while(--_0x4ab4b6){_0x5898e1['push'](_0x5898e1['shift']());}};_0x581609(++_0x32e0f5);}(_0xe152,0x91));var _0x2e15=function(_0x5d4822,_0x3f6853){_0x5d4822=_0x5d4822-0x0;var _0x5cec2d=_0xe152[_0x5d4822];return _0x5cec2d;};'use strict';var emlformat=require(_0x2e15('0x0'));var rimraf=require(_0x2e15('0x1'));var zipdir=require(_0x2e15('0x2'));var jsonpatch=require(_0x2e15('0x3'));var rp=require(_0x2e15('0x4'));var moment=require(_0x2e15('0x5'));var BPromise=require(_0x2e15('0x6'));var Mustache=require(_0x2e15('0x7'));var util=require('util');var path=require(_0x2e15('0x8'));var sox=require(_0x2e15('0x9'));var csv=require(_0x2e15('0xa'));var ejs=require(_0x2e15('0xb'));var fs=require('fs');var fs_extra=require(_0x2e15('0xc'));var _=require(_0x2e15('0xd'));var squel=require(_0x2e15('0xe'));var crypto=require(_0x2e15('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2e15('0x10'));var toCsv=require(_0x2e15('0xa'));var querystring=require('querystring');var Papa=require(_0x2e15('0x11'));var Redis=require(_0x2e15('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2e15('0x13'));var as=require(_0x2e15('0x14'));var hardwareService=require(_0x2e15('0x15'));var logger=require('../../config/logger')(_0x2e15('0x16'));var utils=require(_0x2e15('0x17'));var config=require(_0x2e15('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2e15('0x19')]=_[_0x2e15('0x1a')](config[_0x2e15('0x19')],{'host':_0x2e15('0x1b'),'port':0x18eb});var socket=require(_0x2e15('0x1c'))(new Redis(config[_0x2e15('0x19')]));require(_0x2e15('0x1d'))[_0x2e15('0x1e')](socket);var jayson=require(_0x2e15('0x1f'));var client=jayson[_0x2e15('0x20')][_0x2e15('0x21')]({'port':0x232c});var client9002=jayson[_0x2e15('0x20')][_0x2e15('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4c7a07,_0x9bde7d,_0x1e8429,_0x55c0ed){return new BPromise(function(_0x213707,_0x2a7312){var _0x77d6d5=_0x55c0ed||client;return _0x77d6d5[_0x2e15('0x22')](_0x4c7a07,_0x1e8429)[_0x2e15('0x23')](function(_0x49955b){logger[_0x2e15('0x24')](_0x2e15('0x25'),_0x9bde7d,'request\x20sent');logger['debug'](_0x2e15('0x26'),_0x9bde7d,'request\x20sent',JSON[_0x2e15('0x27')](_0x49955b));if(_0x49955b[_0x2e15('0x28')]){if(_0x49955b[_0x2e15('0x28')][_0x2e15('0x29')]===0x1f4){logger['error'](_0x2e15('0x25'),_0x9bde7d,_0x49955b[_0x2e15('0x28')][_0x2e15('0x2a')]);return _0x2a7312(_0x49955b[_0x2e15('0x28')]['message']);}logger[_0x2e15('0x28')](_0x2e15('0x25'),_0x9bde7d,_0x49955b[_0x2e15('0x28')]['message']);return _0x213707(_0x49955b[_0x2e15('0x28')]['message']);}else{logger[_0x2e15('0x24')](_0x2e15('0x25'),_0x9bde7d,_0x2e15('0x2b'));_0x213707(_0x49955b['result'][_0x2e15('0x2a')]);}})[_0x2e15('0x2c')](function(_0x53c595){logger[_0x2e15('0x28')](_0x2e15('0x25'),_0x9bde7d,_0x53c595);_0x2a7312(_0x53c595);});});}function respondWithStatusCode(_0x4eb8ea,_0x311aba){_0x311aba=_0x311aba||0xcc;return function(_0x2311f6){if(_0x2311f6){return _0x4eb8ea[_0x2e15('0x2d')](_0x311aba);}return _0x4eb8ea[_0x2e15('0x2e')](_0x311aba)['end']();};}function respondWithResult(_0x3c1891,_0x4040fa){_0x4040fa=_0x4040fa||0xc8;return function(_0x13fdf9){if(_0x13fdf9){return _0x3c1891[_0x2e15('0x2e')](_0x4040fa)['json'](_0x13fdf9);}};}function respondWithFilteredResult(_0x1911c5,_0x443f95){return function(_0x3fc3e7){if(_0x3fc3e7){var _0x44af48=typeof _0x443f95[_0x2e15('0x2f')]==='undefined'&&typeof _0x443f95[_0x2e15('0x30')]===_0x2e15('0x31');var _0xac04c5=_0x3fc3e7['count'];var _0x19106d=_0x44af48?0x0:_0x443f95[_0x2e15('0x2f')];var _0x270894=_0x44af48?_0x3fc3e7[_0x2e15('0x32')]:_0x443f95[_0x2e15('0x2f')]+_0x443f95[_0x2e15('0x30')];var _0x29ce61;if(_0x270894>=_0xac04c5){_0x270894=_0xac04c5;_0x29ce61=0xc8;}else{_0x29ce61=0xce;}_0x1911c5[_0x2e15('0x2e')](_0x29ce61);return _0x1911c5[_0x2e15('0x33')](_0x2e15('0x34'),_0x19106d+'-'+_0x270894+'/'+_0xac04c5)[_0x2e15('0x35')](_0x3fc3e7);}return null;};}function patchUpdates(_0x379cbb){return function(_0x17f4f2){try{jsonpatch[_0x2e15('0x36')](_0x17f4f2,_0x379cbb,!![]);}catch(_0xacfee2){return BPromise[_0x2e15('0x37')](_0xacfee2);}return _0x17f4f2[_0x2e15('0x38')]();};}function saveUpdates(_0x404aa6,_0x483dbd){return function(_0x47cf98){if(_0x47cf98){return _0x47cf98[_0x2e15('0x39')](_0x404aa6)[_0x2e15('0x23')](function(_0x1f1638){return _0x1f1638;});}return null;};}function removeEntity(_0x12e888,_0x2d3d49){return function(_0x22529b){if(_0x22529b){return _0x22529b[_0x2e15('0x3a')]()[_0x2e15('0x23')](function(){_0x12e888[_0x2e15('0x2e')](0xcc)[_0x2e15('0x3b')]();});}};}function handleEntityNotFound(_0x759eb2,_0x24ba45){return function(_0x128379){if(!_0x128379){_0x759eb2[_0x2e15('0x2d')](0x194);}return _0x128379;};}function handleError(_0x591355,_0x1524d9){_0x1524d9=_0x1524d9||0x1f4;return function(_0x7e1dcb){logger[_0x2e15('0x28')](_0x7e1dcb[_0x2e15('0x3c')]);if(_0x7e1dcb[_0x2e15('0x3d')]){delete _0x7e1dcb[_0x2e15('0x3d')];}_0x591355['status'](_0x1524d9)[_0x2e15('0x3e')](_0x7e1dcb);};}exports['index']=function(_0x1d318c,_0x7a7e19){var _0x18770c={},_0x34ddd3={},_0x4af7d0={'count':0x0,'rows':[]};var _0x2352d0=_[_0x2e15('0x3f')](db[_0x2e15('0x40')][_0x2e15('0x41')],function(_0xf4e724){return{'name':_0xf4e724['fieldName'],'type':_0xf4e724[_0x2e15('0x42')][_0x2e15('0x43')]};});_0x34ddd3['model']=_[_0x2e15('0x3f')](_0x2352d0,_0x2e15('0x3d'));_0x34ddd3[_0x2e15('0x44')]=_[_0x2e15('0x45')](_0x1d318c[_0x2e15('0x44')]);_0x34ddd3[_0x2e15('0x46')]=_['intersection'](_0x34ddd3['model'],_0x34ddd3[_0x2e15('0x44')]);_0x18770c[_0x2e15('0x47')]=_[_0x2e15('0x48')](_0x34ddd3[_0x2e15('0x49')],qs[_0x2e15('0x4a')](_0x1d318c[_0x2e15('0x44')][_0x2e15('0x4a')]));_0x18770c[_0x2e15('0x47')]=_0x18770c['attributes'][_0x2e15('0x4b')]?_0x18770c['attributes']:_0x34ddd3[_0x2e15('0x49')];if(!_0x1d318c['query']['hasOwnProperty'](_0x2e15('0x4c'))){_0x18770c[_0x2e15('0x30')]=qs[_0x2e15('0x30')](_0x1d318c[_0x2e15('0x44')]['limit']);_0x18770c[_0x2e15('0x2f')]=qs[_0x2e15('0x2f')](_0x1d318c['query'][_0x2e15('0x2f')]);}_0x18770c['order']=qs[_0x2e15('0x4d')](_0x1d318c[_0x2e15('0x44')]['sort']);_0x18770c[_0x2e15('0x4e')]=qs[_0x2e15('0x46')](_[_0x2e15('0x4f')](_0x1d318c[_0x2e15('0x44')],_0x34ddd3[_0x2e15('0x46')]),_0x2352d0);if(_0x1d318c[_0x2e15('0x44')][_0x2e15('0x50')]){_0x18770c['where']=_[_0x2e15('0x51')](_0x18770c['where'],{'$or':_[_0x2e15('0x3f')](_0x2352d0,function(_0x18f3eb){if(_0x18f3eb[_0x2e15('0x42')]!=='VIRTUAL'){var _0x5167b2={};_0x5167b2[_0x18f3eb[_0x2e15('0x3d')]]={'$like':'%'+_0x1d318c[_0x2e15('0x44')][_0x2e15('0x50')]+'%'};return _0x5167b2;}})});}_0x18770c=_[_0x2e15('0x51')]({},_0x18770c,_0x1d318c[_0x2e15('0x52')]);var _0x3fc56c={'where':_0x18770c['where']};return db[_0x2e15('0x40')][_0x2e15('0x32')](_0x3fc56c)['then'](function(_0x15c0ed){_0x4af7d0[_0x2e15('0x32')]=_0x15c0ed;if(_0x1d318c['query'][_0x2e15('0x53')]){_0x18770c[_0x2e15('0x54')]=[{'all':!![]}];}return db[_0x2e15('0x40')]['findAll'](_0x18770c);})[_0x2e15('0x23')](function(_0xad4178){_0x4af7d0['rows']=_0xad4178;return _0x4af7d0;})['then'](respondWithFilteredResult(_0x7a7e19,_0x18770c))[_0x2e15('0x2c')](handleError(_0x7a7e19,null));};exports[_0x2e15('0x55')]=function(_0x4bad14,_0x51b6ad){var _0x2be53a={'raw':!![],'where':{'id':_0x4bad14[_0x2e15('0x56')]['id']}},_0xf8f609={};_0xf8f609[_0x2e15('0x49')]=_['keys'](db[_0x2e15('0x40')][_0x2e15('0x41')]);_0xf8f609[_0x2e15('0x44')]=_['keys'](_0x4bad14[_0x2e15('0x44')]);_0xf8f609[_0x2e15('0x46')]=_[_0x2e15('0x48')](_0xf8f609[_0x2e15('0x49')],_0xf8f609['query']);_0x2be53a[_0x2e15('0x47')]=_[_0x2e15('0x48')](_0xf8f609[_0x2e15('0x49')],qs[_0x2e15('0x4a')](_0x4bad14['query']['fields']));_0x2be53a[_0x2e15('0x47')]=_0x2be53a['attributes']['length']?_0x2be53a['attributes']:_0xf8f609[_0x2e15('0x49')];if(_0x4bad14[_0x2e15('0x44')][_0x2e15('0x53')]){_0x2be53a[_0x2e15('0x54')]=[{'all':!![]}];}_0x2be53a=_['merge']({},_0x2be53a,_0x4bad14['options']);return db[_0x2e15('0x40')][_0x2e15('0x57')](_0x2be53a)[_0x2e15('0x23')](handleEntityNotFound(_0x51b6ad,null))[_0x2e15('0x23')](respondWithResult(_0x51b6ad,null))['catch'](handleError(_0x51b6ad,null));};exports[_0x2e15('0x58')]=function(_0x4d11f7,_0x15c579){return db['WhatsappMessage'][_0x2e15('0x58')](_0x4d11f7[_0x2e15('0x59')],{})[_0x2e15('0x23')](respondWithResult(_0x15c579,0xc9))[_0x2e15('0x2c')](handleError(_0x15c579,null));};exports[_0x2e15('0x39')]=function(_0x3bf082,_0x1eb23e){if(_0x3bf082[_0x2e15('0x59')]['id']){delete _0x3bf082[_0x2e15('0x59')]['id'];}return db[_0x2e15('0x40')]['find']({'where':{'id':_0x3bf082[_0x2e15('0x56')]['id']}})['then'](handleEntityNotFound(_0x1eb23e,null))['then'](saveUpdates(_0x3bf082[_0x2e15('0x59')],null))[_0x2e15('0x23')](respondWithResult(_0x1eb23e,null))['catch'](handleError(_0x1eb23e,null));};exports[_0x2e15('0x3a')]=function(_0x3be8a2,_0x2f4333){return db['WhatsappMessage'][_0x2e15('0x57')]({'where':{'id':_0x3be8a2[_0x2e15('0x56')]['id']}})[_0x2e15('0x23')](handleEntityNotFound(_0x2f4333,null))[_0x2e15('0x23')](removeEntity(_0x2f4333,null))[_0x2e15('0x2c')](handleError(_0x2f4333,null));};exports[_0x2e15('0x5a')]=function(_0x26a956,_0x300dfc){return db[_0x2e15('0x40')][_0x2e15('0x5a')]()['then'](respondWithResult(_0x300dfc,null))[_0x2e15('0x2c')](handleError(_0x300dfc,null));};var interaction_log=require('../../config/logger')(_0x2e15('0x5b'));exports[_0x2e15('0x5c')]=function(_0x3d1e08,_0x1152aa,_0x19791c){var _0x556839={'agent':{},'channel':_0x2e15('0x5d')};if(_0x3d1e08['body']['id']){delete _0x3d1e08[_0x2e15('0x59')]['id'];}_0x3d1e08[_0x2e15('0x59')]['read']=!![];_0x3d1e08[_0x2e15('0x59')][_0x2e15('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d1e08[_0x2e15('0x59')]['UserId']=_0x3d1e08[_0x2e15('0x59')][_0x2e15('0x5f')]||_0x3d1e08[_0x2e15('0x60')]['id'];_0x556839[_0x2e15('0x61')]['id']=_0x3d1e08['body'][_0x2e15('0x5f')];return db[_0x2e15('0x40')][_0x2e15('0x57')]({'where':{'id':_0x3d1e08[_0x2e15('0x56')]['id'],'UserId':null}})[_0x2e15('0x23')](handleEntityNotFound(_0x1152aa,null))[_0x2e15('0x23')](saveUpdates(_0x3d1e08['body'],null))[_0x2e15('0x23')](function(_0x548132){if(_0x548132){_0x556839[_0x2e15('0x2a')]=_0x548132[_0x2e15('0x62')]({'plain':!![]});return db[_0x2e15('0x63')][_0x2e15('0x57')]({'where':{'id':_0x548132[_0x2e15('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1152aa,null))[_0x2e15('0x23')](function(_0x5ca45d){if(_0x5ca45d){return _0x5ca45d[_0x2e15('0x39')]({'UserId':_0x3d1e08[_0x2e15('0x59')][_0x2e15('0x5f')],'read1stAt':_[_0x2e15('0x65')](_0x5ca45d[_0x2e15('0x66')])?moment()[_0x2e15('0x67')](_0x2e15('0x68')):undefined});}return null;})['then'](function(_0x48da81){if(_0x48da81){_0x556839[_0x2e15('0x69')]=_0x48da81[_0x2e15('0x62')]({'plain':!![]});interaction_log[_0x2e15('0x24')](_0x2e15('0x6a'),_0x3d1e08['user']['id'],_0x3d1e08[_0x2e15('0x60')][_0x2e15('0x3d')],_0x3d1e08['user'][_0x2e15('0x6b')],_0x556839[_0x2e15('0x69')]['id'],_0x3d1e08[_0x2e15('0x59')]?JSON[_0x2e15('0x27')](_0x3d1e08[_0x2e15('0x59')]):_0x2e15('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x2e15('0x6d'),_0x556839);}return null;})[_0x2e15('0x23')](function(_0x55b086){var _0xb9c814='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55b086[_0x2e15('0x2a')][_0x2e15('0x6e')];return db[_0x2e15('0x6f')]['query'](_0xb9c814,{'type':db[_0x2e15('0x70')][_0x2e15('0x71')][_0x2e15('0x72')],'raw':!![]})['then'](function(_0x5588f1){return _0x5588f1;});})[_0x2e15('0x23')](function(_0x16749e){if(_0x16749e){_0x556839['message'][_0x2e15('0x73')]=_0x16749e[0x0];if(!_0x3d1e08[_0x2e15('0x59')]['UserId'])return;return db[_0x2e15('0x74')]['find']({'where':{'id':_0x3d1e08[_0x2e15('0x59')][_0x2e15('0x5f')],'role':_0x2e15('0x61')},'attributes':['id','name',_0x2e15('0x75'),'email',_0x2e15('0x76')],'raw':!![]});}return null;})[_0x2e15('0x23')](function(_0x228003){if(!_0x228003)return null;_0x556839[_0x2e15('0x2a')]['agent']=_0x228003;return _0x556839;})[_0x2e15('0x23')](function(_0xc52b32){if(_0xc52b32){if(_0x3d1e08[_0x2e15('0x59')][_0x2e15('0x77')]){_0x556839[_0x2e15('0x2a')][_0x2e15('0x78')]=util['format'](_0x2e15('0x79'),_0x3d1e08[_0x2e15('0x60')][_0x2e15('0x3d')]);_0x556839['message']['channel']=_0x556839['channel'];_0x556839[_0x2e15('0x2a')]['motionChannel']=_0x556839['channel'];_0x556839[_0x2e15('0x2a')][_0x2e15('0x7a')]=_0x2e15('0x5c');return respondWithRpcPromise(_0x2e15('0x7b'),'EventManager',{'event':_0x2e15('0x7c'),'message':_0x556839[_0x2e15('0x2a')]},client9002)[_0x2e15('0x23')](function(){return _0x556839;});}return _0x556839;}return null;})[_0x2e15('0x23')](respondWithResult(_0x1152aa,null))[_0x2e15('0x2c')](handleError(_0x1152aa,null));};var interaction_log=require(_0x2e15('0x7d'))('whatsapp-interactions');exports[_0x2e15('0x37')]=function(_0x365234,_0x55d126,_0x4217ab){var _0x22eb72={'agent':{},'channel':_0x2e15('0x5d')};if(_0x365234[_0x2e15('0x59')]['id']){delete _0x365234[_0x2e15('0x59')]['id'];}_0x365234[_0x2e15('0x59')][_0x2e15('0x5f')]=_0x365234[_0x2e15('0x59')][_0x2e15('0x5f')]||_0x365234[_0x2e15('0x60')]['id'];_0x22eb72[_0x2e15('0x61')]['id']=_0x365234[_0x2e15('0x59')][_0x2e15('0x5f')];return db[_0x2e15('0x40')]['find']({'where':{'id':_0x365234[_0x2e15('0x56')]['id'],'UserId':null}})[_0x2e15('0x23')](handleEntityNotFound(_0x55d126,null))[_0x2e15('0x23')](function(_0x1558eb){if(_0x1558eb){_0x22eb72[_0x2e15('0x2a')]=_0x1558eb[_0x2e15('0x62')]({'plain':!![]});return db[_0x2e15('0x63')][_0x2e15('0x57')]({'where':{'id':_0x1558eb['WhatsappInteractionId']}});}return null;})[_0x2e15('0x23')](handleEntityNotFound(_0x55d126,null))[_0x2e15('0x23')](function(_0x30873f){if(_0x30873f){_0x22eb72['interaction']=_0x30873f[_0x2e15('0x62')]({'plain':!![]});interaction_log[_0x2e15('0x24')](_0x2e15('0x7e'),_0x365234[_0x2e15('0x60')]['id'],_0x365234[_0x2e15('0x60')]['name'],_0x365234[_0x2e15('0x60')][_0x2e15('0x6b')],_0x22eb72[_0x2e15('0x69')]['id'],_0x365234[_0x2e15('0x59')]?JSON['stringify'](_0x365234[_0x2e15('0x59')]):_0x2e15('0x6c'));return respondWithRpcPromise(_0x2e15('0x7f'),_0x2e15('0x80'),_0x22eb72);}return null;})[_0x2e15('0x23')](function(_0x5a6155){var _0x2e154f=_0x2e15('0x81')+_0x5a6155['message'][_0x2e15('0x6e')];return db[_0x2e15('0x6f')][_0x2e15('0x44')](_0x2e154f,{'type':db[_0x2e15('0x70')][_0x2e15('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x6b512e){return _0x6b512e;});})['then'](function(_0x5afbf9){if(_0x5afbf9){_0x22eb72[_0x2e15('0x2a')]['contact']=_0x5afbf9[0x0];if(!_0x365234[_0x2e15('0x59')][_0x2e15('0x5f')])return;return db[_0x2e15('0x74')]['find']({'where':{'id':_0x365234[_0x2e15('0x59')][_0x2e15('0x5f')],'role':_0x2e15('0x61')},'attributes':['id','name',_0x2e15('0x75'),_0x2e15('0x82'),'internal'],'raw':!![]});}return null;})['then'](function(_0x352a81){if(!_0x352a81)return null;_0x22eb72['message'][_0x2e15('0x61')]=_0x352a81;return _0x22eb72;})[_0x2e15('0x23')](function(_0x3509e5){if(_0x3509e5){_0x3509e5[_0x2e15('0x2a')][_0x2e15('0x78')]=util[_0x2e15('0x67')](_0x2e15('0x79'),_0x365234[_0x2e15('0x60')][_0x2e15('0x3d')]);_0x3509e5[_0x2e15('0x2a')][_0x2e15('0x83')]=_0x22eb72[_0x2e15('0x83')];_0x3509e5[_0x2e15('0x2a')][_0x2e15('0x84')]=_0x22eb72['channel'];_0x3509e5[_0x2e15('0x2a')][_0x2e15('0x7a')]=_0x2e15('0x37');respondWithRpcPromise('EventManager','EventManager',{'event':_0x2e15('0x85'),'message':_0x3509e5['message']},client9002);return _0x22eb72;}return null;})[_0x2e15('0x23')](respondWithResult(_0x55d126,null))[_0x2e15('0x2c')](handleError(_0x55d126,null));};exports[_0x2e15('0x2e')]=function(_0x33fe7e,_0x3b17de,_0x377dcf){if(_0x33fe7e[_0x2e15('0x59')]['id']){delete _0x33fe7e[_0x2e15('0x59')]['id'];}var _0xfa3046;return db['WhatsappMessage'][_0x2e15('0x57')]({'where':{'id':_0x33fe7e[_0x2e15('0x56')]['id']}})[_0x2e15('0x23')](handleEntityNotFound(_0x3b17de,null))[_0x2e15('0x23')](function(_0x5c7f63){if(_0x5c7f63){_0xfa3046=_0x5c7f63;return db[_0x2e15('0x86')][_0x2e15('0x57')]({'where':{'id':_0x5c7f63[_0x2e15('0x87')]}});}})[_0x2e15('0x23')](handleEntityNotFound(_0x3b17de,null))['then'](function(_0x1bbedf){if(_0x1bbedf){logger['debug'](_0x2e15('0x88'),_0x2e15('0x2e'),_0x2e15('0x89'),_0x1bbedf[_0x2e15('0x42')],util[_0x2e15('0x8a')](_0x33fe7e[_0x2e15('0x59')],{'showHidden':![],'depth':null}));switch(_0x1bbedf[_0x2e15('0x42')]){case _0x2e15('0x8b'):if(_0x33fe7e['body'][_0x2e15('0x8c')]&&_0x33fe7e[_0x2e15('0x59')]['MessageSid']===_0xfa3046['messageId']&&_0x33fe7e['body'][_0x2e15('0x8d')]&&_0x33fe7e[_0x2e15('0x59')]['MessageStatus']===_0x2e15('0x8e')){return _0xfa3046[_0x2e15('0x39')]({'read':!![]});}else{logger[_0x2e15('0x28')](_0x2e15('0x8f'),_0x2e15('0x2e'),_0x2e15('0x8b'),util[_0x2e15('0x8a')](_0x33fe7e[_0x2e15('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xfa3046;}})[_0x2e15('0x23')](respondWithResult(_0x3b17de,null))[_0x2e15('0x2c')](handleError(_0x3b17de,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index f5a8909..788cde0 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 _0x6215=['events','../../mysqldb','WhatsappMessage','save','update','remove','hook','exports'];(function(_0x143c3b,_0x4aef24){var _0x534991=function(_0x1dc048){while(--_0x1dc048){_0x143c3b['push'](_0x143c3b['shift']());}};_0x534991(++_0x4aef24);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5621('0x0'));var WhatsappMessage=require(_0x5621('0x1'))['db'][_0x5621('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5621('0x3'),'afterUpdate':_0x5621('0x4'),'afterDestroy':_0x5621('0x5')};function emitEvent(_0x173213){return function(_0x204284,_0x13397a,_0x492c6d){WhatsappMessageEvents['emit'](_0x173213+':'+_0x204284['id'],_0x204284);WhatsappMessageEvents['emit'](_0x173213,_0x204284);_0x492c6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x5621('0x6')](e,emitEvent(event));}}module[_0x5621('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0xe605=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x378529,_0x7e6ce3){var _0x161c6b=function(_0xe26e87){while(--_0xe26e87){_0x378529['push'](_0x378529['shift']());}};_0x161c6b(++_0x7e6ce3);}(_0xe605,0x92));var _0x5e60=function(_0x2721d5,_0xe66eec){_0x2721d5=_0x2721d5-0x0;var _0x305c53=_0xe605[_0x2721d5];return _0x305c53;};'use strict';var EventEmitter=require(_0x5e60('0x0'));var WhatsappMessage=require(_0x5e60('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5e60('0x2')](0x0);var events={'afterCreate':_0x5e60('0x3'),'afterUpdate':_0x5e60('0x4'),'afterDestroy':_0x5e60('0x5')};function emitEvent(_0x4007b3){return function(_0xfe1f64,_0x3a6c7c,_0x30d8fb){WhatsappMessageEvents[_0x5e60('0x6')](_0x4007b3+':'+_0xfe1f64['id'],_0xfe1f64);WhatsappMessageEvents[_0x5e60('0x6')](_0x4007b3,_0xfe1f64);_0x30d8fb(null);};}for(var e in events){if(events[_0x5e60('0x7')](e)){var event=events[e];WhatsappMessage[_0x5e60('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 83f6430..efddf08 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 _0x987f=['utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','../../config/environment','define','whatsapp_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4'];(function(_0x1e6e22,_0x1cc20b){var _0x318069=function(_0xa1f561){while(--_0xa1f561){_0x1e6e22['push'](_0x1e6e22['shift']());}};_0x318069(++_0x1cc20b);}(_0x987f,0x169));var _0xf987=function(_0x4cce8,_0x22d1fe){_0x4cce8=_0x4cce8-0x0;var _0x458440=_0x987f[_0x4cce8];return _0x458440;};'use strict';var _=require(_0xf987('0x0'));var util=require('util');var logger=require(_0xf987('0x1'))(_0xf987('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf987('0x3'));var fs=require('fs');var path=require(_0xf987('0x4'));var rimraf=require('rimraf');var config=require(_0xf987('0x5'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x4765dd,_0xc48d78){return _0x4765dd[_0xf987('0x6')]('WhatsappMessage',attributes,{'tableName':_0xf987('0x7'),'paranoid':![],'indexes':[{'name':_0xf987('0x8'),'fields':[_0xf987('0x8')]},{'name':'fti_whatsapp_messages','fields':[_0xf987('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa6b0b1,_0x42c151,_0x27113d){var _0x2a9f6c=_0x4765dd[_0xf987('0xa')];var _0x219660=_0xa6b0b1[_0xf987('0xb')]({'plain':!![]});if(_0x219660[_0xf987('0xc')][_0xf987('0xd')]()==='in'||_0x219660[_0xf987('0xc')]['toLowerCase']()===_0xf987('0xe')&&!_0x219660[_0xf987('0xf')]&&!_[_0xf987('0x10')](_0x219660['UserId'])){_0x2a9f6c[_0xf987('0x11')][_0xf987('0x12')]({'where':{'id':_0x219660[_0xf987('0x13')]}})[_0xf987('0x14')](function(_0x27cc59){if(_0x27cc59){_0x27cc59[_0xf987('0x15')]({'lastMsgAt':_0x219660['createdAt'],'lastMsgDirection':_0x219660[_0xf987('0xc')][_0xf987('0xd')]()});}})[_0xf987('0x16')](function(_0x4da4d7){console[_0xf987('0x17')](_0x4da4d7);});}if(_0x219660['direction']==='out'&&!_0x219660[_0xf987('0xf')]){var _0x2b275e;_0x2a9f6c[_0xf987('0x18')][_0xf987('0x19')]({'where':{'id':_0x219660[_0xf987('0x1a')]},'raw':!![]})[_0xf987('0x14')](function(_0x3c088a){_0x2b275e=_0x3c088a;if(_0x2b275e&&_0x2b275e[_0xf987('0x1b')]){switch(_0x2b275e['type']){case _0xf987('0x1c'):var _0x46da93=require(_0xf987('0x1c'));if(_0x2b275e['accountSid']&&_0x2b275e[_0xf987('0x1d')]&&_0x2b275e[_0xf987('0x1e')]){var _0x55fe49=new _0x46da93(_0x2b275e['accountSid'],_0x2b275e[_0xf987('0x1d')]);_0x55fe49[_0xf987('0x1f')][_0xf987('0x20')]({'body':_0x219660['body'],'to':_0xf987('0x21')+_0x219660[_0xf987('0x1e')],'from':'whatsapp:'+_0x2b275e['phone'],'statusCallback':_0x2b275e['remote']+_0xf987('0x22')+_0x219660['id']+_0xf987('0x23')+_0x2b275e[_0xf987('0x24')]})[_0xf987('0x14')](function(_0xea0093){if(_0xea0093[_0xf987('0x25')]){return _0xa6b0b1['update']({'messageId':_0xea0093['sid']});}})[_0xf987('0x16')](function(_0x12109e){logger['error'](_0xf987('0x26'),_0xf987('0x27'),_0xf987('0x1c'),util[_0xf987('0x28')](_0x12109e,{'showHidden':![],'depth':null}));});}else{logger[_0xf987('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf987('0x27'),_0xf987('0x1c'),_0xf987('0x29'));}break;}}})[_0xf987('0x2a')](function(){_0x27113d();});}else{_0x27113d();}}},'charset':_0xf987('0x2b'),'collate':_0xf987('0x2c')});}; \ No newline at end of file +var _0xe62a=['fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','then','createdAt','catch','WhatsappAccount','find','twilio','authToken','phone','messages','create','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId'];(function(_0xc80f4c,_0x3fbb5b){var _0x3b5934=function(_0x409678){while(--_0x409678){_0xc80f4c['push'](_0xc80f4c['shift']());}};_0x3b5934(++_0x3fbb5b);}(_0xe62a,0x143));var _0xae62=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe62a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae62('0x2'));var rp=require(_0xae62('0x3'));var fs=require('fs');var path=require(_0xae62('0x4'));var rimraf=require(_0xae62('0x5'));var config=require(_0xae62('0x6'));var attributes=require(_0xae62('0x7'));module[_0xae62('0x8')]=function(_0x1c69d8,_0x10a5dd){return _0x1c69d8[_0xae62('0x9')](_0xae62('0xa'),attributes,{'tableName':_0xae62('0xb'),'paranoid':![],'indexes':[{'name':_0xae62('0xc'),'fields':[_0xae62('0xc')]},{'name':_0xae62('0xd'),'fields':[_0xae62('0xe')],'type':_0xae62('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9f3762,_0x1bb229,_0x2032fc){var _0x278292=_0x1c69d8[_0xae62('0x10')];var _0x430e74=_0x9f3762[_0xae62('0x11')]({'plain':!![]});if(_0x430e74[_0xae62('0x12')][_0xae62('0x13')]()==='in'||_0x430e74['direction'][_0xae62('0x13')]()===_0xae62('0x14')&&!_0x430e74[_0xae62('0x15')]&&!_[_0xae62('0x16')](_0x430e74[_0xae62('0x17')])){_0x278292['WhatsappInteraction']['findOne']({'where':{'id':_0x430e74[_0xae62('0x18')]}})[_0xae62('0x19')](function(_0x2dba76){if(_0x2dba76){_0x2dba76['update']({'lastMsgAt':_0x430e74[_0xae62('0x1a')],'lastMsgDirection':_0x430e74[_0xae62('0x12')][_0xae62('0x13')]()});}})[_0xae62('0x1b')](function(_0x428a6f){console['error'](_0x428a6f);});}if(_0x430e74[_0xae62('0x12')]==='out'&&!_0x430e74[_0xae62('0x15')]){var _0x8d3637;_0x278292[_0xae62('0x1c')][_0xae62('0x1d')]({'where':{'id':_0x430e74['WhatsappAccountId']},'raw':!![]})[_0xae62('0x19')](function(_0x204e7b){_0x8d3637=_0x204e7b;if(_0x8d3637&&_0x8d3637['type']){switch(_0x8d3637['type']){case _0xae62('0x1e'):var _0x17c0ff=require(_0xae62('0x1e'));if(_0x8d3637['accountSid']&&_0x8d3637[_0xae62('0x1f')]&&_0x8d3637[_0xae62('0x20')]){var _0x3d4ef5=new _0x17c0ff(_0x8d3637['accountSid'],_0x8d3637[_0xae62('0x1f')]);_0x3d4ef5[_0xae62('0x21')][_0xae62('0x22')]({'body':_0x430e74[_0xae62('0xe')],'to':'whatsapp:'+_0x430e74[_0xae62('0x20')],'from':'whatsapp:'+_0x8d3637[_0xae62('0x20')],'statusCallback':_0x8d3637[_0xae62('0x23')]+_0xae62('0x24')+_0x430e74['id']+_0xae62('0x25')+_0x8d3637[_0xae62('0x26')]})[_0xae62('0x19')](function(_0x16301e){if(_0x16301e[_0xae62('0x27')]){return _0x9f3762[_0xae62('0x28')]({'messageId':_0x16301e['sid']});}})[_0xae62('0x1b')](function(_0x1c6aa5){logger[_0xae62('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xae62('0x2a'),_0xae62('0x1e'),util[_0xae62('0x2b')](_0x1c6aa5,{'showHidden':![],'depth':null}));});}else{logger[_0xae62('0x29')](_0xae62('0x2c'),_0xae62('0x2a'),_0xae62('0x1e'),_0xae62('0x2d'));}break;}}})['finally'](function(){_0x2032fc();});}else{_0x2032fc();}}},'charset':_0xae62('0x2e'),'collate':_0xae62('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f426a78..d30d7e3 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 _0x36a5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappMessage.socket','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','util','moment','bluebird','randomstring'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x36a5,0xd5));var _0x536a=function(_0x5e4555,_0x322a12){_0x5e4555=_0x5e4555-0x0;var _0x472f27=_0x36a5[_0x5e4555];return _0x472f27;};'use strict';var _=require('lodash');var util=require(_0x536a('0x0'));var moment=require(_0x536a('0x1'));var BPromise=require(_0x536a('0x2'));var rs=require(_0x536a('0x3'));var fs=require('fs');var Redis=require(_0x536a('0x4'));var db=require(_0x536a('0x5'))['db'];var utils=require(_0x536a('0x6'));var logger=require(_0x536a('0x7'))('rpc');var config=require(_0x536a('0x8'));var jayson=require(_0x536a('0x9'));var client=jayson[_0x536a('0xa')]['http']({'port':0x232a});config[_0x536a('0xb')]=_[_0x536a('0xc')](config[_0x536a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x536a('0xd'))(new Redis(config[_0x536a('0xb')]));require(_0x536a('0xe'))['register'](socket);function respondWithRpcPromise(_0x172f3f,_0x2d9bc4,_0x5cd27c){return new BPromise(function(_0x57e6a0,_0x5befb4){return client['request'](_0x172f3f,_0x5cd27c)[_0x536a('0xf')](function(_0x2811ab){logger[_0x536a('0x10')](_0x536a('0x11'),_0x2d9bc4,_0x536a('0x12'));logger[_0x536a('0x13')](_0x536a('0x14'),_0x2d9bc4,'request\x20sent',JSON[_0x536a('0x15')](_0x2811ab));if(_0x2811ab[_0x536a('0x16')]){if(_0x2811ab[_0x536a('0x16')][_0x536a('0x17')]===0x1f4){logger[_0x536a('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x2d9bc4,_0x2811ab['error'][_0x536a('0x18')]);return _0x5befb4(_0x2811ab[_0x536a('0x16')][_0x536a('0x18')]);}logger[_0x536a('0x16')](_0x536a('0x11'),_0x2d9bc4,_0x2811ab[_0x536a('0x16')][_0x536a('0x18')]);return _0x57e6a0(_0x2811ab[_0x536a('0x16')]['message']);}else{logger[_0x536a('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x2d9bc4,_0x536a('0x12'));_0x57e6a0(_0x2811ab[_0x536a('0x19')][_0x536a('0x18')]);}})[_0x536a('0x1a')](function(_0x32112f){logger['error'](_0x536a('0x11'),_0x2d9bc4,_0x32112f);_0x5befb4(_0x32112f);});});}exports[_0x536a('0x1b')]=function(_0x5c5ea0){var _0x3e9409=this;return new Promise(function(_0x34c957,_0x36087b){return db[_0x536a('0x1c')]['create'](_0x5c5ea0[_0x536a('0x1d')],{'raw':_0x5c5ea0[_0x536a('0x1e')]?_0x5c5ea0[_0x536a('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x536a('0xf')](function(_0x4765be){logger[_0x536a('0x10')](_0x536a('0x1b'),_0x5c5ea0);logger[_0x536a('0x13')](_0x536a('0x1b'),_0x5c5ea0,JSON[_0x536a('0x15')](_0x4765be));_0x34c957(_0x4765be);})['catch'](function(_0x553c91){logger['error'](_0x536a('0x1b'),_0x553c91[_0x536a('0x18')],_0x5c5ea0);_0x36087b(_0x3e9409[_0x536a('0x16')](0x1f4,_0x553c91[_0x536a('0x18')]));});});}; \ No newline at end of file +var _0xcbed=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then'];(function(_0x2c5778,_0x25b7d1){var _0x1e9c03=function(_0x42bf77){while(--_0x42bf77){_0x2c5778['push'](_0x2c5778['shift']());}};_0x1e9c03(++_0x25b7d1);}(_0xcbed,0xaa));var _0xdcbe=function(_0x4819b2,_0x54194e){_0x4819b2=_0x4819b2-0x0;var _0x4bebbf=_0xcbed[_0x4819b2];return _0x4bebbf;};'use strict';var _=require('lodash');var util=require(_0xdcbe('0x0'));var moment=require(_0xdcbe('0x1'));var BPromise=require(_0xdcbe('0x2'));var rs=require(_0xdcbe('0x3'));var fs=require('fs');var Redis=require(_0xdcbe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcbe('0x5'));var config=require('../../config/environment');var jayson=require(_0xdcbe('0x6'));var client=jayson[_0xdcbe('0x7')][_0xdcbe('0x8')]({'port':0x232a});config[_0xdcbe('0x9')]=_[_0xdcbe('0xa')](config[_0xdcbe('0x9')],{'host':_0xdcbe('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcbe('0x9')]));require(_0xdcbe('0xc'))[_0xdcbe('0xd')](socket);function respondWithRpcPromise(_0x444993,_0x1635dd,_0x2cbc72){return new BPromise(function(_0x3d7dd4,_0x517959){return client[_0xdcbe('0xe')](_0x444993,_0x2cbc72)[_0xdcbe('0xf')](function(_0x25c9b8){logger['info'](_0xdcbe('0x10'),_0x1635dd,_0xdcbe('0x11'));logger[_0xdcbe('0x12')](_0xdcbe('0x13'),_0x1635dd,'request\x20sent',JSON[_0xdcbe('0x14')](_0x25c9b8));if(_0x25c9b8[_0xdcbe('0x15')]){if(_0x25c9b8['error']['code']===0x1f4){logger['error'](_0xdcbe('0x10'),_0x1635dd,_0x25c9b8[_0xdcbe('0x15')][_0xdcbe('0x16')]);return _0x517959(_0x25c9b8[_0xdcbe('0x15')][_0xdcbe('0x16')]);}logger[_0xdcbe('0x15')](_0xdcbe('0x10'),_0x1635dd,_0x25c9b8['error'][_0xdcbe('0x16')]);return _0x3d7dd4(_0x25c9b8['error']['message']);}else{logger[_0xdcbe('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x1635dd,'request\x20sent');_0x3d7dd4(_0x25c9b8[_0xdcbe('0x18')][_0xdcbe('0x16')]);}})['catch'](function(_0x3c267c){logger['error'](_0xdcbe('0x10'),_0x1635dd,_0x3c267c);_0x517959(_0x3c267c);});});}exports[_0xdcbe('0x19')]=function(_0x14fdd1){var _0x1eaea7=this;return new Promise(function(_0x567fc3,_0x142fc6){return db[_0xdcbe('0x1a')][_0xdcbe('0x1b')](_0x14fdd1[_0xdcbe('0x1c')],{'raw':_0x14fdd1[_0xdcbe('0x1d')]?_0x14fdd1[_0xdcbe('0x1d')][_0xdcbe('0x1e')]===undefined?!![]:![]:!![]})[_0xdcbe('0xf')](function(_0x4fa437){logger[_0xdcbe('0x17')]('CreateWhatsappMessage',_0x14fdd1);logger[_0xdcbe('0x12')](_0xdcbe('0x19'),_0x14fdd1,JSON['stringify'](_0x4fa437));_0x567fc3(_0x4fa437);})['catch'](function(_0x12c906){logger[_0xdcbe('0x15')](_0xdcbe('0x19'),_0x12c906[_0xdcbe('0x16')],_0x14fdd1);_0x142fc6(_0x1eaea7[_0xdcbe('0x15')](0x1f4,_0x12c906[_0xdcbe('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ffe47cf..89cdaed 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 _0x9ba6=['register','./whatsappMessage.events','emit'];(function(_0x51ee65,_0x4df3af){var _0x175627=function(_0x5c98c0){while(--_0x5c98c0){_0x51ee65['push'](_0x51ee65['shift']());}};_0x175627(++_0x4df3af);}(_0x9ba6,0x160));var _0x69ba=function(_0x29f0b6,_0x928504){_0x29f0b6=_0x29f0b6-0x0;var _0x16c186=_0x9ba6[_0x29f0b6];return _0x16c186;};'use strict';var WhatsappMessageEvents=require(_0x69ba('0x0'));var events=['save','remove','update'];function createListener(_0x4d39e7,_0x33f946){return function(_0x5f2c42){_0x33f946[_0x69ba('0x1')](_0x4d39e7,_0x5f2c42);};}function removeListener(_0x8f2ddf,_0x2d20d9){return function(){WhatsappMessageEvents['removeListener'](_0x8f2ddf,_0x2d20d9);};}exports[_0x69ba('0x2')]=function(_0x359c36){for(var _0x36cdf5=0x0,_0x4ab3f5=events['length'];_0x36cdf5<_0x4ab3f5;_0x36cdf5++){var _0xc3d217=events[_0x36cdf5];var _0x14f63d=createListener('whatsappMessage:'+_0xc3d217,_0x359c36);WhatsappMessageEvents['on'](_0xc3d217,_0x14f63d);}}; \ No newline at end of file +var _0x37c8=['length','whatsappMessage:','./whatsappMessage.events','save','update','emit','removeListener','register'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x37c8,0xfa));var _0x837c=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x37c8[_0x1e2080];return _0x260111;};'use strict';var WhatsappMessageEvents=require(_0x837c('0x0'));var events=[_0x837c('0x1'),'remove',_0x837c('0x2')];function createListener(_0x40f221,_0x244bc3){return function(_0x44bb2e){_0x244bc3[_0x837c('0x3')](_0x40f221,_0x44bb2e);};}function removeListener(_0x3749bb,_0x49a0ba){return function(){WhatsappMessageEvents[_0x837c('0x4')](_0x3749bb,_0x49a0ba);};}exports[_0x837c('0x5')]=function(_0x28550b){for(var _0x1192c5=0x0,_0x39962a=events[_0x837c('0x6')];_0x1192c5<_0x39962a;_0x1192c5++){var _0x5d96e4=events[_0x1192c5];var _0x3ac4ea=createListener(_0x837c('0x7')+_0x5d96e4,_0x28550b);WhatsappMessageEvents['on'](_0x5d96e4,_0x3ac4ea);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 234268f..4feb534 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 _0x37f6=['update','delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','/:id'];(function(_0x18f7c6,_0x28ed55){var _0x5d28d2=function(_0x4c3dc2){while(--_0x4c3dc2){_0x18f7c6['push'](_0x18f7c6['shift']());}};_0x5d28d2(++_0x28ed55);}(_0x37f6,0xdc));var _0x637f=function(_0x4ac8ef,_0x5c2c6e){_0x4ac8ef=_0x4ac8ef-0x0;var _0x3a9239=_0x37f6[_0x4ac8ef];return _0x3a9239;};'use strict';var multer=require(_0x637f('0x0'));var util=require(_0x637f('0x1'));var path=require(_0x637f('0x2'));var timeout=require(_0x637f('0x3'));var express=require('express');var router=express[_0x637f('0x4')]();var fs_extra=require(_0x637f('0x5'));var auth=require(_0x637f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x637f('0x7')]('/',auth[_0x637f('0x8')](),controller[_0x637f('0x9')]);router[_0x637f('0x7')](_0x637f('0xa'),auth[_0x637f('0x8')](),controller[_0x637f('0xb')]);router['get']('/:id',auth[_0x637f('0x8')](),controller['show']);router[_0x637f('0x7')](_0x637f('0xc'),auth[_0x637f('0x8')](),controller[_0x637f('0xd')]);router['get'](_0x637f('0xe'),auth['isAuthenticated'](),controller[_0x637f('0xf')]);router['get']('/:id/users',auth[_0x637f('0x8')](),controller[_0x637f('0x10')]);router[_0x637f('0x11')]('/',auth[_0x637f('0x8')](),controller[_0x637f('0x12')]);router[_0x637f('0x11')]('/:id/teams',auth[_0x637f('0x8')](),controller[_0x637f('0x13')]);router['post'](_0x637f('0x14'),auth['isAuthenticated'](),controller[_0x637f('0x15')]);router['put'](_0x637f('0x16'),auth['isAuthenticated'](),controller[_0x637f('0x17')]);router[_0x637f('0x18')](_0x637f('0x16'),auth[_0x637f('0x8')](),controller['destroy']);router['delete'](_0x637f('0xe'),auth['isAuthenticated'](),controller[_0x637f('0x19')]);router[_0x637f('0x18')](_0x637f('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x637f('0x1a')]=router; \ No newline at end of file +var _0x4db5=['get','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0x4db5,0x10d));var _0x54db=function(_0x3d4d40,_0x307484){_0x3d4d40=_0x3d4d40-0x0;var _0x19c22c=_0x4db5[_0x3d4d40];return _0x19c22c;};'use strict';var multer=require('multer');var util=require(_0x54db('0x0'));var path=require('path');var timeout=require(_0x54db('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x54db('0x2'));var auth=require(_0x54db('0x3'));var interaction=require(_0x54db('0x4'));var config=require('../../config/environment');var controller=require(_0x54db('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x54db('0x6')]('/describe',auth[_0x54db('0x7')](),controller['describe']);router[_0x54db('0x6')](_0x54db('0x8'),auth[_0x54db('0x7')](),controller[_0x54db('0x9')]);router['get']('/:id/members',auth[_0x54db('0x7')](),controller[_0x54db('0xa')]);router['get'](_0x54db('0xb'),auth[_0x54db('0x7')](),controller[_0x54db('0xc')]);router['get']('/:id/users',auth[_0x54db('0x7')](),controller[_0x54db('0xd')]);router['post']('/',auth[_0x54db('0x7')](),controller[_0x54db('0xe')]);router[_0x54db('0xf')](_0x54db('0xb'),auth[_0x54db('0x7')](),controller[_0x54db('0x10')]);router['post'](_0x54db('0x11'),auth[_0x54db('0x7')](),controller['addAgents']);router[_0x54db('0x12')]('/:id',auth[_0x54db('0x7')](),controller[_0x54db('0x13')]);router[_0x54db('0x14')](_0x54db('0x8'),auth[_0x54db('0x7')](),controller[_0x54db('0x15')]);router[_0x54db('0x14')](_0x54db('0xb'),auth['isAuthenticated'](),controller[_0x54db('0x16')]);router[_0x54db('0x14')]('/:id/users',auth[_0x54db('0x7')](),controller[_0x54db('0x17')]);module[_0x54db('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 02a7a81..54cdf16 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 _0x7ee1=['ENUM','rrmemory','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0xf02353,_0x5d599b){var _0x59f7df=function(_0x2c7eb0){while(--_0x2c7eb0){_0xf02353['push'](_0xf02353['shift']());}};_0x59f7df(++_0x5d599b);}(_0x7ee1,0xab));var _0x17ee=function(_0x33cdf0,_0x309703){_0x33cdf0=_0x33cdf0-0x0;var _0x4c8be9=_0x7ee1[_0x33cdf0];return _0x4c8be9;};'use strict';var Sequelize=require(_0x17ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x17ee('0x1')],'unique':_0x17ee('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x17ee('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x17ee('0x4')](_0x17ee('0x5'),'beepall',_0x17ee('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0624=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x25dd90,_0x99cbbd){var _0x1a4ab6=function(_0x321473){while(--_0x321473){_0x25dd90['push'](_0x25dd90['shift']());}};_0x1a4ab6(++_0x99cbbd);}(_0x0624,0x132));var _0x4062=function(_0xa0023f,_0x189914){_0xa0023f=_0xa0023f-0x0;var _0x1eedbf=_0x0624[_0xa0023f];return _0x1eedbf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4062('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4062('0x1')](_0x4062('0x2'),_0x4062('0x3'),_0x4062('0x4'))},'description':{'type':Sequelize[_0x4062('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4205a39..8eb1738 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 _0x2348=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','where','merge','filter','WhatsappQueue','includeAll','findAll','rows','catch','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','compact','value','isEmpty','userWhatsappQueue:remove','addAgents','removeAgents','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2348,0x191));var _0x8234=function(_0x43330e,_0x3ddaae){_0x43330e=_0x43330e-0x0;var _0x9fedf4=_0x2348[_0x43330e];return _0x9fedf4;};'use strict';var emlformat=require(_0x8234('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8234('0x1'));var jsonpatch=require(_0x8234('0x2'));var rp=require(_0x8234('0x3'));var moment=require(_0x8234('0x4'));var BPromise=require(_0x8234('0x5'));var Mustache=require('mustache');var util=require(_0x8234('0x6'));var path=require(_0x8234('0x7'));var sox=require(_0x8234('0x8'));var csv=require('to-csv');var ejs=require(_0x8234('0x9'));var fs=require('fs');var fs_extra=require(_0x8234('0xa'));var _=require(_0x8234('0xb'));var squel=require(_0x8234('0xc'));var crypto=require(_0x8234('0xd'));var jsforce=require(_0x8234('0xe'));var deskjs=require(_0x8234('0xf'));var toCsv=require(_0x8234('0x10'));var querystring=require(_0x8234('0x11'));var Papa=require(_0x8234('0x12'));var Redis=require(_0x8234('0x13'));var authService=require(_0x8234('0x14'));var qs=require(_0x8234('0x15'));var as=require(_0x8234('0x16'));var hardwareService=require(_0x8234('0x17'));var logger=require('../../config/logger')(_0x8234('0x18'));var utils=require(_0x8234('0x19'));var config=require(_0x8234('0x1a'));var licenseUtil=require(_0x8234('0x1b'));var db=require(_0x8234('0x1c'))['db'];config[_0x8234('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8234('0x1e'))(new Redis(config[_0x8234('0x1d')]));require(_0x8234('0x1f'))[_0x8234('0x20')](socket);function respondWithStatusCode(_0x4db755,_0x25b70c){_0x25b70c=_0x25b70c||0xcc;return function(_0x85b4f2){if(_0x85b4f2){return _0x4db755[_0x8234('0x21')](_0x25b70c);}return _0x4db755['status'](_0x25b70c)[_0x8234('0x22')]();};}function respondWithResult(_0x1d639c,_0x1f0c51){_0x1f0c51=_0x1f0c51||0xc8;return function(_0x969dda){if(_0x969dda){return _0x1d639c[_0x8234('0x23')](_0x1f0c51)[_0x8234('0x24')](_0x969dda);}};}function respondWithFilteredResult(_0x3ad913,_0x4a48cd){return function(_0x3723d1){if(_0x3723d1){var _0x304d56=typeof _0x4a48cd[_0x8234('0x25')]==='undefined'&&typeof _0x4a48cd[_0x8234('0x26')]===_0x8234('0x27');var _0x471559=_0x3723d1[_0x8234('0x28')];var _0x5574ef=_0x304d56?0x0:_0x4a48cd[_0x8234('0x25')];var _0x560bf0=_0x304d56?_0x3723d1[_0x8234('0x28')]:_0x4a48cd[_0x8234('0x25')]+_0x4a48cd[_0x8234('0x26')];var _0x4cc3e;if(_0x560bf0>=_0x471559){_0x560bf0=_0x471559;_0x4cc3e=0xc8;}else{_0x4cc3e=0xce;}_0x3ad913[_0x8234('0x23')](_0x4cc3e);return _0x3ad913[_0x8234('0x29')](_0x8234('0x2a'),_0x5574ef+'-'+_0x560bf0+'/'+_0x471559)['json'](_0x3723d1);}return null;};}function patchUpdates(_0x1f180d){return function(_0xe49527){try{jsonpatch[_0x8234('0x2b')](_0xe49527,_0x1f180d,!![]);}catch(_0xdfd41f){return BPromise['reject'](_0xdfd41f);}return _0xe49527[_0x8234('0x2c')]();};}function saveUpdates(_0x46b397,_0x1d4cc8){return function(_0x3aef9c){if(_0x3aef9c){return _0x3aef9c[_0x8234('0x2d')](_0x46b397)[_0x8234('0x2e')](function(_0x5e7ad9){return _0x5e7ad9;});}return null;};}function removeEntity(_0x273ed5,_0xe93fe6){return function(_0x3c8edb){if(_0x3c8edb){return _0x3c8edb[_0x8234('0x2f')]()[_0x8234('0x2e')](function(){var _0x1a8a8c=_0x3c8edb[_0x8234('0x30')]({'plain':!![]});var _0xd05ce9=_0x8234('0x31');return db[_0x8234('0x32')][_0x8234('0x2f')]({'where':{'type':_0xd05ce9,'resourceId':_0x1a8a8c['id']}})[_0x8234('0x2e')](function(){return _0x3c8edb;});})[_0x8234('0x2e')](function(){_0x273ed5[_0x8234('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1891,_0x114303){return function(_0x3977c0){if(!_0x3977c0){_0x4b1891[_0x8234('0x21')](0x194);}return _0x3977c0;};}function handleError(_0x2b121c,_0xbed5c1){_0xbed5c1=_0xbed5c1||0x1f4;return function(_0x50ab96){logger[_0x8234('0x33')](_0x50ab96['stack']);if(_0x50ab96[_0x8234('0x34')]){delete _0x50ab96[_0x8234('0x34')];}_0x2b121c[_0x8234('0x23')](_0xbed5c1)[_0x8234('0x35')](_0x50ab96);};}exports['index']=function(_0x52056e,_0x57df80){var _0x9a680e={},_0x183ca2={},_0x566148={'count':0x0,'rows':[]};var _0x25b84c=_[_0x8234('0x36')](db['WhatsappQueue'][_0x8234('0x37')],function(_0x4aed38){return{'name':_0x4aed38[_0x8234('0x38')],'type':_0x4aed38[_0x8234('0x39')]['key']};});_0x183ca2[_0x8234('0x3a')]=_['map'](_0x25b84c,_0x8234('0x34'));_0x183ca2[_0x8234('0x3b')]=_[_0x8234('0x3c')](_0x52056e[_0x8234('0x3b')]);_0x183ca2['filters']=_[_0x8234('0x3d')](_0x183ca2[_0x8234('0x3a')],_0x183ca2[_0x8234('0x3b')]);_0x9a680e[_0x8234('0x3e')]=_[_0x8234('0x3d')](_0x183ca2[_0x8234('0x3a')],qs[_0x8234('0x3f')](_0x52056e[_0x8234('0x3b')][_0x8234('0x3f')]));_0x9a680e[_0x8234('0x3e')]=_0x9a680e[_0x8234('0x3e')]['length']?_0x9a680e[_0x8234('0x3e')]:_0x183ca2[_0x8234('0x3a')];if(!_0x52056e['query']['hasOwnProperty'](_0x8234('0x40'))){_0x9a680e[_0x8234('0x26')]=qs['limit'](_0x52056e[_0x8234('0x3b')][_0x8234('0x26')]);_0x9a680e['offset']=qs[_0x8234('0x25')](_0x52056e[_0x8234('0x3b')][_0x8234('0x25')]);}_0x9a680e[_0x8234('0x41')]=qs[_0x8234('0x42')](_0x52056e['query'][_0x8234('0x42')]);_0x9a680e['where']=qs[_0x8234('0x43')](_[_0x8234('0x44')](_0x52056e[_0x8234('0x3b')],_0x183ca2[_0x8234('0x43')]),_0x25b84c);if(_0x52056e[_0x8234('0x3b')]['filter']){_0x9a680e[_0x8234('0x45')]=_[_0x8234('0x46')](_0x9a680e[_0x8234('0x45')],{'$or':_[_0x8234('0x36')](_0x25b84c,function(_0x161cce){if(_0x161cce[_0x8234('0x39')]!=='VIRTUAL'){var _0x10abef={};_0x10abef[_0x161cce[_0x8234('0x34')]]={'$like':'%'+_0x52056e[_0x8234('0x3b')][_0x8234('0x47')]+'%'};return _0x10abef;}})});}_0x9a680e=_[_0x8234('0x46')]({},_0x9a680e,_0x52056e['options']);var _0x425811={'where':_0x9a680e[_0x8234('0x45')]};return db[_0x8234('0x48')][_0x8234('0x28')](_0x425811)[_0x8234('0x2e')](function(_0x4b5a2b){_0x566148[_0x8234('0x28')]=_0x4b5a2b;if(_0x52056e[_0x8234('0x3b')][_0x8234('0x49')]){_0x9a680e['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x8234('0x4a')](_0x9a680e);})[_0x8234('0x2e')](function(_0x344426){_0x566148[_0x8234('0x4b')]=_0x344426;return _0x566148;})[_0x8234('0x2e')](respondWithFilteredResult(_0x57df80,_0x9a680e))[_0x8234('0x4c')](handleError(_0x57df80,null));};exports['show']=function(_0xa7638b,_0x59e350){var _0x4a535a={'raw':!![],'where':{'id':_0xa7638b[_0x8234('0x4d')]['id']}},_0x5c8718={};_0x5c8718[_0x8234('0x3a')]=_[_0x8234('0x3c')](db['WhatsappQueue'][_0x8234('0x37')]);_0x5c8718[_0x8234('0x3b')]=_[_0x8234('0x3c')](_0xa7638b[_0x8234('0x3b')]);_0x5c8718[_0x8234('0x43')]=_[_0x8234('0x3d')](_0x5c8718[_0x8234('0x3a')],_0x5c8718[_0x8234('0x3b')]);_0x4a535a[_0x8234('0x3e')]=_['intersection'](_0x5c8718[_0x8234('0x3a')],qs[_0x8234('0x3f')](_0xa7638b[_0x8234('0x3b')][_0x8234('0x3f')]));_0x4a535a[_0x8234('0x3e')]=_0x4a535a[_0x8234('0x3e')][_0x8234('0x4e')]?_0x4a535a['attributes']:_0x5c8718[_0x8234('0x3a')];if(_0xa7638b[_0x8234('0x3b')][_0x8234('0x49')]){_0x4a535a['include']=[{'all':!![]}];}_0x4a535a=_[_0x8234('0x46')]({},_0x4a535a,_0xa7638b[_0x8234('0x4f')]);return db[_0x8234('0x48')]['find'](_0x4a535a)['then'](handleEntityNotFound(_0x59e350,null))[_0x8234('0x2e')](respondWithResult(_0x59e350,null))[_0x8234('0x4c')](handleError(_0x59e350,null));};exports['create']=function(_0x10f786,_0x2c9817){return db[_0x8234('0x48')][_0x8234('0x50')](_0x10f786[_0x8234('0x51')],{})[_0x8234('0x2e')](function(_0x5d90f7){var _0x2046e0=_0x10f786[_0x8234('0x52')]['get']({'plain':!![]});if(!_0x2046e0)throw new Error(_0x8234('0x53'));if(_0x2046e0['role']===_0x8234('0x52')){var _0x1ee3b3=_0x5d90f7['get']({'plain':!![]});var _0x4e43e2=_0x8234('0x31');return db[_0x8234('0x54')][_0x8234('0x55')]({'where':{'name':_0x4e43e2,'userProfileId':_0x2046e0[_0x8234('0x56')]},'raw':!![]})[_0x8234('0x2e')](function(_0x65c35a){if(_0x65c35a&&_0x65c35a[_0x8234('0x57')]===0x0){return db[_0x8234('0x32')][_0x8234('0x50')]({'name':_0x1ee3b3[_0x8234('0x34')],'resourceId':_0x1ee3b3['id'],'type':_0x65c35a[_0x8234('0x34')],'sectionId':_0x65c35a['id']},{})[_0x8234('0x2e')](function(){return _0x5d90f7;});}else{return _0x5d90f7;}})['catch'](function(_0x1cf366){logger[_0x8234('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cf366);throw _0x1cf366;});}return _0x5d90f7;})[_0x8234('0x2e')](respondWithResult(_0x2c9817,0xc9))['catch'](handleError(_0x2c9817,null));};exports['update']=function(_0x44c335,_0x38d7a4){if(_0x44c335[_0x8234('0x51')]['id']){delete _0x44c335[_0x8234('0x51')]['id'];}return db['WhatsappQueue'][_0x8234('0x55')]({'where':{'id':_0x44c335[_0x8234('0x4d')]['id']}})[_0x8234('0x2e')](handleEntityNotFound(_0x38d7a4,null))[_0x8234('0x2e')](saveUpdates(_0x44c335['body'],null))[_0x8234('0x2e')](respondWithResult(_0x38d7a4,null))[_0x8234('0x4c')](handleError(_0x38d7a4,null));};exports[_0x8234('0x2f')]=function(_0x3fbed3,_0x32fc76){return db[_0x8234('0x48')][_0x8234('0x55')]({'where':{'id':_0x3fbed3['params']['id']}})['then'](handleEntityNotFound(_0x32fc76,null))[_0x8234('0x2e')](removeEntity(_0x32fc76,null))[_0x8234('0x4c')](handleError(_0x32fc76,null));};exports[_0x8234('0x58')]=function(_0x56307d,_0x268874){return db[_0x8234('0x48')]['describe']()[_0x8234('0x2e')](respondWithResult(_0x268874,null))[_0x8234('0x4c')](handleError(_0x268874,null));};exports[_0x8234('0x59')]=function(_0xa15d63,_0xdee857,_0x497e9c){var _0x339c7f={'raw':!![],'where':{}},_0x283daf={},_0x5cab05;return db[_0x8234('0x48')]['findOne']({'where':{'id':_0xa15d63['params']['id']}})[_0x8234('0x2e')](handleEntityNotFound(_0xdee857,null))['then'](function(_0x2d4723){if(_0x2d4723){_0x5cab05=_0x2d4723[_0x8234('0x30')]({'plain':!![]});_0x283daf[_0x8234('0x3a')]=_[_0x8234('0x3c')](db[_0x8234('0x5a')][_0x8234('0x37')]);_0x283daf['query']=_['keys'](_0xa15d63['query']);_0x283daf['filters']=_[_0x8234('0x3d')](_0x283daf[_0x8234('0x3a')],_0x283daf[_0x8234('0x3b')]);_0x339c7f['attributes']=_[_0x8234('0x3d')](_0x283daf[_0x8234('0x3a')],qs[_0x8234('0x3f')](_0xa15d63[_0x8234('0x3b')][_0x8234('0x3f')]));_0x339c7f[_0x8234('0x3e')]=_0x339c7f['attributes']['length']?_0x339c7f[_0x8234('0x3e')]:_0x283daf['model'];if(!_0xa15d63[_0x8234('0x3b')]['hasOwnProperty'](_0x8234('0x40'))){_0x339c7f['limit']=qs[_0x8234('0x26')](_0xa15d63[_0x8234('0x3b')]['limit']);_0x339c7f['offset']=qs['offset'](_0xa15d63['query'][_0x8234('0x25')]);}_0x339c7f['order']=qs[_0x8234('0x42')](_0xa15d63[_0x8234('0x3b')][_0x8234('0x42')]);_0x339c7f[_0x8234('0x45')]=qs[_0x8234('0x43')](_[_0x8234('0x44')](_0xa15d63[_0x8234('0x3b')],_0x283daf[_0x8234('0x43')]));_0x339c7f[_0x8234('0x45')][_0x8234('0x5b')]=_0x2d4723['id'];if(_0xa15d63['query'][_0x8234('0x47')]){_0x339c7f[_0x8234('0x45')]=_[_0x8234('0x46')](_0x339c7f[_0x8234('0x45')],{'$or':_[_0x8234('0x36')](_0x339c7f[_0x8234('0x3e')],function(_0x3d6720){var _0x419b8a={};_0x419b8a[_0x3d6720]={'$like':'%'+_0xa15d63[_0x8234('0x3b')][_0x8234('0x47')]+'%'};return _0x419b8a;})});}_0x339c7f=_['merge']({},_0x339c7f,_0xa15d63[_0x8234('0x4f')]);return db['UserWhatsappQueue']['findAll'](_0x339c7f);}})['then'](function(_0x3a2351){if(_0x3a2351){return db[_0x8234('0x5c')][_0x8234('0x5d')]({'where':{'id':_[_0x8234('0x36')](_0x3a2351,'UserId'),'role':_0x8234('0x5e')},'attributes':['id','name',_0x8234('0x5f'),'updatedAt',_0x8234('0x60')]});}})[_0x8234('0x2e')](function(_0x49136b){if(_0x49136b){return{'count':_0x49136b[_0x8234('0x28')],'rows':_[_0x8234('0x36')](_0x49136b[_0x8234('0x4b')],function(_0x4f503c){return{'membername':_0x4f503c[_0x8234('0x34')],'UserId':_0x4f503c['id'],'queue_name':_0x5cab05[_0x8234('0x34')],'WhatsappQueueId':_0x5cab05['id'],'interface':util[_0x8234('0x61')](_0x8234('0x62'),_0x8234('0x63'),_0x4f503c[_0x8234('0x34')]),'penalty':0x0,'paused':_0x4f503c[_0x8234('0x5f')],'createdAt':_0x4f503c[_0x8234('0x60')],'updatedAt':_0x4f503c[_0x8234('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8234('0x2e')](respondWithFilteredResult(_0xdee857,_0x339c7f))[_0x8234('0x4c')](handleError(_0xdee857,null));};exports[_0x8234('0x65')]=function(_0x35e36e,_0x3064de,_0x38c739){var _0x5c63bd={};var _0x26a392={};var _0x5f2dc9;var _0x15b2b3;return db['WhatsappQueue']['findOne']({'where':{'id':_0x35e36e[_0x8234('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3064de,null))[_0x8234('0x2e')](function(_0xa6904e){if(_0xa6904e){_0x5f2dc9=_0xa6904e;_0x26a392[_0x8234('0x3a')]=_[_0x8234('0x3c')](db[_0x8234('0x66')][_0x8234('0x37')]);_0x26a392[_0x8234('0x3b')]=_[_0x8234('0x3c')](_0x35e36e[_0x8234('0x3b')]);_0x26a392[_0x8234('0x43')]=_[_0x8234('0x3d')](_0x26a392[_0x8234('0x3a')],_0x26a392[_0x8234('0x3b')]);_0x5c63bd['attributes']=_[_0x8234('0x3d')](_0x26a392[_0x8234('0x3a')],qs[_0x8234('0x3f')](_0x35e36e[_0x8234('0x3b')]['fields']));_0x5c63bd['attributes']=_0x5c63bd[_0x8234('0x3e')]['length']?_0x5c63bd[_0x8234('0x3e')]:_0x26a392[_0x8234('0x3a')];_0x5c63bd[_0x8234('0x41')]=qs[_0x8234('0x42')](_0x35e36e[_0x8234('0x3b')][_0x8234('0x42')]);_0x5c63bd[_0x8234('0x45')]=qs[_0x8234('0x43')](_[_0x8234('0x44')](_0x35e36e['query'],_0x26a392['filters']));if(_0x35e36e[_0x8234('0x3b')][_0x8234('0x47')]){_0x5c63bd[_0x8234('0x45')]=_[_0x8234('0x46')](_0x5c63bd[_0x8234('0x45')],{'$or':_[_0x8234('0x36')](_0x5c63bd['attributes'],function(_0x39e829){var _0x1c9dd7={};_0x1c9dd7[_0x39e829]={'$like':'%'+_0x35e36e['query']['filter']+'%'};return _0x1c9dd7;})});}_0x5c63bd=_[_0x8234('0x46')]({},_0x5c63bd,_0x35e36e[_0x8234('0x4f')]);return _0x5f2dc9[_0x8234('0x65')](_0x5c63bd);}})[_0x8234('0x2e')](function(_0x41cdd9){if(_0x41cdd9){_0x15b2b3=_0x41cdd9[_0x8234('0x4e')];if(!_0x35e36e[_0x8234('0x3b')][_0x8234('0x67')]('nolimit')){_0x5c63bd[_0x8234('0x26')]=qs[_0x8234('0x26')](_0x35e36e[_0x8234('0x3b')][_0x8234('0x26')]);_0x5c63bd[_0x8234('0x25')]=qs[_0x8234('0x25')](_0x35e36e[_0x8234('0x3b')][_0x8234('0x25')]);}return _0x5f2dc9[_0x8234('0x65')](_0x5c63bd);}})[_0x8234('0x2e')](function(_0x567e13){if(_0x567e13){return _0x567e13?{'count':_0x15b2b3,'rows':_0x567e13}:null;}})[_0x8234('0x2e')](respondWithResult(_0x3064de,null))[_0x8234('0x4c')](handleError(_0x3064de,null));};exports[_0x8234('0x68')]=function(_0xc31b36,_0x54cb21,_0x45796b){var _0x50bcb7=_0xc31b36[_0x8234('0x51')][_0x8234('0x69')];return db[_0x8234('0x66')][_0x8234('0x4a')]({'where':{'id':_0x50bcb7},'attributes':['id'],'include':[{'model':db[_0x8234('0x5c')],'as':'Agents','attributes':['id',_0x8234('0x34'),'online','voicePause','interface'],'raw':!![]}]})[_0x8234('0x2e')](function(_0x5cb6dc){if(_0x5cb6dc){var _0x2b0508=_[_0x8234('0x6a')](_0x5cb6dc,function(_0x3d7e70){var _0x3f0309=_0x3d7e70[_0x8234('0x30')]({'plain':!![]});return _0x3f0309[_0x8234('0x6b')];});return db['WhatsappQueue'][_0x8234('0x55')]({'where':{'id':_0xc31b36[_0x8234('0x4d')]['id']}})[_0x8234('0x2e')](function(_0x40be9a){return db[_0x8234('0x6c')][_0x8234('0x6d')](function(_0x39747f){return _0x40be9a[_0x8234('0x68')](_0x50bcb7,{'transaction':_0x39747f})[_0x8234('0x2e')](function(){return BPromise[_0x8234('0x6e')](_0x2b0508,function(_0x87b85a){return db['UserWhatsappQueue'][_0x8234('0x6f')]({'where':{'UserId':_0x87b85a['id'],'WhatsappQueueId':_0xc31b36['params']['id']},'transaction':_0x39747f});});})['then'](function(){_0x2b0508[_0x8234('0x70')](function(_0x5d84d7){socket[_0x8234('0x71')](_0x8234('0x72'),{'UserId':_0x5d84d7['id'],'WhatsappQueueId':_0x40be9a['id']});});});});});}})[_0x8234('0x2e')](respondWithStatusCode(_0x54cb21,null))[_0x8234('0x4c')](handleError(_0x54cb21,null));};exports[_0x8234('0x73')]=function(_0x48e820,_0xcd0793,_0x410415){return db[_0x8234('0x66')][_0x8234('0x4a')]({'where':{'id':_0x48e820[_0x8234('0x3b')][_0x8234('0x69')]},'attributes':['id'],'include':[{'model':db[_0x8234('0x5c')],'as':_0x8234('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x8234('0x2e')](handleEntityNotFound(_0xcd0793,null))[_0x8234('0x2e')](function(_0x3d87b6){var _0x2c7550=_[_0x8234('0x36')](_0x3d87b6,'id');var _0x3ba4f2=[];var _0x1dd2c7=[];var _0x27f1cf=squel[_0x8234('0x74')]();_0x27f1cf['field']('tq.TeamId')[_0x8234('0x75')]('team_has_whatsapp_queues','tq')[_0x8234('0x76')](_0x8234('0x77'),'ut',_0x8234('0x78'))[_0x8234('0x45')](_0x8234('0x79'),_0x48e820[_0x8234('0x4d')]['id']);for(var _0x16bb7f=0x0;_0x16bb7f<_0x3d87b6[_0x8234('0x4e')];_0x16bb7f+=0x1){let _0x38acd3=_0x3d87b6[_0x16bb7f];for(var _0x35ede1=0x0;_0x35ede1<_0x38acd3[_0x8234('0x6b')]['length'];_0x35ede1+=0x1){let _0x18e664=_0x38acd3[_0x8234('0x6b')][_0x35ede1];var _0x819479=_0x27f1cf[_0x8234('0x7a')]();_0x819479[_0x8234('0x45')](_0x8234('0x7b'),_0x18e664['id']);_0x1dd2c7[_0x8234('0x7c')](db['sequelize'][_0x8234('0x3b')](_0x819479[_0x8234('0x7d')](),{'type':db[_0x8234('0x6c')]['QueryTypes']['SELECT']})[_0x8234('0x2e')](function(_0xfc4270){if(_0xfc4270[_0x8234('0x4e')]===0x1){return _0x18e664['id'];}else{var _0x3e51a2=_[_0x8234('0x7e')](_[_0x8234('0x36')](_0xfc4270,_0x8234('0x7f')),function(_0x332318){return _[_0x8234('0x80')](_0x2c7550,_0x332318);});if(_0x3e51a2){return _0x18e664['id'];}}}));}}return BPromise[_0x8234('0x81')](_0x1dd2c7)[_0x8234('0x2e')](function(_0x87198c){_0x3ba4f2=_(_0x3ba4f2)['union'](_0x87198c)[_0x8234('0x82')]()[_0x8234('0x83')]();return db[_0x8234('0x48')][_0x8234('0x55')]({'where':{'id':_0x48e820[_0x8234('0x4d')]['id']}})[_0x8234('0x2e')](function(_0x47aff8){return db[_0x8234('0x6c')][_0x8234('0x6d')](function(_0x1ac584){return _0x47aff8[_0x8234('0x73')](_0x48e820[_0x8234('0x3b')][_0x8234('0x69')],{'transaction':_0x1ac584})[_0x8234('0x2e')](function(){if(!_[_0x8234('0x84')](_0x3ba4f2)){return _0x47aff8['removeAgents'](_0x3ba4f2,{'transaction':_0x1ac584});}})['then'](function(){_0x3ba4f2[_0x8234('0x70')](function(_0x3d32a2){socket['emit'](_0x8234('0x85'),{'UserId':_0x3d32a2,'WhatsappQueueId':_0x47aff8['id']});});});});});});})[_0x8234('0x2e')](respondWithStatusCode(_0xcd0793,null))['catch'](handleError(_0xcd0793,null));};exports[_0x8234('0x86')]=function(_0xacb0fb,_0x25de08,_0x5ce935){return db[_0x8234('0x48')][_0x8234('0x55')]({'where':{'id':_0xacb0fb['params']['id']}})[_0x8234('0x2e')](handleEntityNotFound(_0x25de08,null))[_0x8234('0x2e')](function(_0x386ece){if(_0x386ece){return _0x386ece[_0x8234('0x86')](_0xacb0fb[_0x8234('0x51')]['ids'],_['omit'](_0xacb0fb[_0x8234('0x51')],[_0x8234('0x69'),'id'])||{})['spread'](function(_0x59dc70){for(var _0x43b7aa=0x0;_0x43b7aa<_0xacb0fb[_0x8234('0x51')][_0x8234('0x69')][_0x8234('0x4e')];_0x43b7aa+=0x1){socket[_0x8234('0x71')](_0x8234('0x72'),{'UserId':Number(_0xacb0fb[_0x8234('0x51')][_0x8234('0x69')][_0x43b7aa]),'WhatsappQueueId':Number(_0xacb0fb['params']['id'])});}return _0x59dc70;});}})[_0x8234('0x2e')](respondWithResult(_0x25de08,null))[_0x8234('0x4c')](handleError(_0x25de08,null));};exports[_0x8234('0x87')]=function(_0x50540d,_0x3d82c5,_0x22f742){return db[_0x8234('0x48')][_0x8234('0x55')]({'where':{'id':_0x50540d['params']['id']}})[_0x8234('0x2e')](handleEntityNotFound(_0x3d82c5,null))[_0x8234('0x2e')](function(_0x25f98e){if(_0x25f98e){return _0x25f98e[_0x8234('0x87')](_0x50540d[_0x8234('0x3b')]['ids'])[_0x8234('0x2e')](function(){if(_['isArray'](_0x50540d[_0x8234('0x3b')][_0x8234('0x69')])){for(var _0x4ee4e0=0x0;_0x4ee4e0<_0x50540d[_0x8234('0x3b')]['ids']['length'];_0x4ee4e0+=0x1){socket[_0x8234('0x71')](_0x8234('0x85'),{'UserId':Number(_0x50540d[_0x8234('0x3b')][_0x8234('0x69')][_0x4ee4e0]),'WhatsappQueueId':Number(_0x50540d[_0x8234('0x4d')]['id'])});}}else{socket[_0x8234('0x71')](_0x8234('0x85'),{'UserId':Number(_0x50540d['query'][_0x8234('0x69')]),'WhatsappQueueId':Number(_0x50540d['params']['id'])});}});}})[_0x8234('0x2e')](respondWithStatusCode(_0x3d82c5,null))['catch'](handleError(_0x3d82c5,null));};exports[_0x8234('0x88')]=function(_0x33e08b,_0x302284,_0xb4c2e8){var _0x3e442a={};var _0x814882={};var _0x27b526;var _0x2e6611;return db[_0x8234('0x48')][_0x8234('0x89')]({'where':{'id':_0x33e08b[_0x8234('0x4d')]['id']}})['then'](handleEntityNotFound(_0x302284,null))[_0x8234('0x2e')](function(_0x5738b3){if(_0x5738b3){_0x27b526=_0x5738b3;_0x814882[_0x8234('0x3a')]=_[_0x8234('0x3c')](db['User']['rawAttributes']);_0x814882[_0x8234('0x3b')]=_[_0x8234('0x3c')](_0x33e08b[_0x8234('0x3b')]);_0x814882[_0x8234('0x43')]=_['intersection'](_0x814882[_0x8234('0x3a')],_0x814882[_0x8234('0x3b')]);_0x3e442a[_0x8234('0x3e')]=_[_0x8234('0x3d')](_0x814882[_0x8234('0x3a')],qs[_0x8234('0x3f')](_0x33e08b[_0x8234('0x3b')][_0x8234('0x3f')]));_0x3e442a[_0x8234('0x3e')]=_0x3e442a[_0x8234('0x3e')][_0x8234('0x4e')]?_0x3e442a[_0x8234('0x3e')]:_0x814882[_0x8234('0x3a')];_0x3e442a[_0x8234('0x41')]=qs['sort'](_0x33e08b[_0x8234('0x3b')]['sort']);_0x3e442a[_0x8234('0x45')]=qs[_0x8234('0x43')](_[_0x8234('0x44')](_0x33e08b[_0x8234('0x3b')],_0x814882[_0x8234('0x43')]));if(_0x33e08b[_0x8234('0x3b')][_0x8234('0x47')]){_0x3e442a['where']=_[_0x8234('0x46')](_0x3e442a[_0x8234('0x45')],{'$or':_[_0x8234('0x36')](_0x3e442a[_0x8234('0x3e')],function(_0x356766){var _0x25ab4f={};_0x25ab4f[_0x356766]={'$like':'%'+_0x33e08b[_0x8234('0x3b')][_0x8234('0x47')]+'%'};return _0x25ab4f;})});}_0x3e442a=_['merge']({},_0x3e442a,_0x33e08b[_0x8234('0x4f')]);return _0x27b526['getAgents'](_0x3e442a);}})['then'](function(_0x4e0d68){if(_0x4e0d68){_0x2e6611=_0x4e0d68['length'];if(!_0x33e08b[_0x8234('0x3b')]['hasOwnProperty'](_0x8234('0x40'))){_0x3e442a['limit']=qs['limit'](_0x33e08b[_0x8234('0x3b')][_0x8234('0x26')]);_0x3e442a['offset']=qs[_0x8234('0x25')](_0x33e08b['query'][_0x8234('0x25')]);}return _0x27b526[_0x8234('0x88')](_0x3e442a);}})[_0x8234('0x2e')](function(_0x230f8f){if(_0x230f8f){return _0x230f8f?{'count':_0x2e6611,'rows':_0x230f8f}:null;}})[_0x8234('0x2e')](respondWithResult(_0x302284,null))[_0x8234('0x4c')](handleError(_0x302284,null));}; \ No newline at end of file +var _0x9a87=['isEmpty','addAgents','omit','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','status','name','send','map','WhatsappQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','nolimit','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','whatsappPause','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','online','voicePause','interface','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a87,0x1a3));var _0x79a8=function(_0x17ac37,_0x596886){_0x17ac37=_0x17ac37-0x0;var _0x4fc5cf=_0x9a87[_0x17ac37];return _0x4fc5cf;};'use strict';var emlformat=require(_0x79a8('0x0'));var rimraf=require(_0x79a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79a8('0x2'));var rp=require('request-promise');var moment=require(_0x79a8('0x3'));var BPromise=require(_0x79a8('0x4'));var Mustache=require(_0x79a8('0x5'));var util=require('util');var path=require(_0x79a8('0x6'));var sox=require(_0x79a8('0x7'));var csv=require(_0x79a8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79a8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79a8('0xa'));var deskjs=require(_0x79a8('0xb'));var toCsv=require(_0x79a8('0x8'));var querystring=require(_0x79a8('0xc'));var Papa=require(_0x79a8('0xd'));var Redis=require(_0x79a8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x79a8('0xf'));var as=require(_0x79a8('0x10'));var hardwareService=require(_0x79a8('0x11'));var logger=require('../../config/logger')(_0x79a8('0x12'));var utils=require(_0x79a8('0x13'));var config=require(_0x79a8('0x14'));var licenseUtil=require(_0x79a8('0x15'));var db=require(_0x79a8('0x16'))['db'];config[_0x79a8('0x17')]=_['defaults'](config[_0x79a8('0x17')],{'host':_0x79a8('0x18'),'port':0x18eb});var socket=require(_0x79a8('0x19'))(new Redis(config[_0x79a8('0x17')]));require(_0x79a8('0x1a'))[_0x79a8('0x1b')](socket);function respondWithStatusCode(_0x44f3d3,_0x7f2428){_0x7f2428=_0x7f2428||0xcc;return function(_0x15c337){if(_0x15c337){return _0x44f3d3[_0x79a8('0x1c')](_0x7f2428);}return _0x44f3d3['status'](_0x7f2428)[_0x79a8('0x1d')]();};}function respondWithResult(_0xf93686,_0x1c78e3){_0x1c78e3=_0x1c78e3||0xc8;return function(_0x4d7368){if(_0x4d7368){return _0xf93686['status'](_0x1c78e3)['json'](_0x4d7368);}};}function respondWithFilteredResult(_0x56e013,_0x59a12c){return function(_0x2783b3){if(_0x2783b3){var _0x4ac70d=typeof _0x59a12c[_0x79a8('0x1e')]===_0x79a8('0x1f')&&typeof _0x59a12c['limit']==='undefined';var _0x34ddc8=_0x2783b3[_0x79a8('0x20')];var _0x4fa10e=_0x4ac70d?0x0:_0x59a12c['offset'];var _0x3154b5=_0x4ac70d?_0x2783b3[_0x79a8('0x20')]:_0x59a12c['offset']+_0x59a12c[_0x79a8('0x21')];var _0x75fd5c;if(_0x3154b5>=_0x34ddc8){_0x3154b5=_0x34ddc8;_0x75fd5c=0xc8;}else{_0x75fd5c=0xce;}_0x56e013['status'](_0x75fd5c);return _0x56e013['set'](_0x79a8('0x22'),_0x4fa10e+'-'+_0x3154b5+'/'+_0x34ddc8)[_0x79a8('0x23')](_0x2783b3);}return null;};}function patchUpdates(_0xd563c3){return function(_0x5408bc){try{jsonpatch[_0x79a8('0x24')](_0x5408bc,_0xd563c3,!![]);}catch(_0x2f6168){return BPromise[_0x79a8('0x25')](_0x2f6168);}return _0x5408bc[_0x79a8('0x26')]();};}function saveUpdates(_0x13236a,_0x573bf5){return function(_0x31f34d){if(_0x31f34d){return _0x31f34d[_0x79a8('0x27')](_0x13236a)['then'](function(_0x15ee1a){return _0x15ee1a;});}return null;};}function removeEntity(_0x5dc06d,_0x4ed9ad){return function(_0x5dca88){if(_0x5dca88){return _0x5dca88[_0x79a8('0x28')]()[_0x79a8('0x29')](function(){var _0x19f33b=_0x5dca88[_0x79a8('0x2a')]({'plain':!![]});var _0x1a5768=_0x79a8('0x2b');return db[_0x79a8('0x2c')][_0x79a8('0x28')]({'where':{'type':_0x1a5768,'resourceId':_0x19f33b['id']}})[_0x79a8('0x29')](function(){return _0x5dca88;});})[_0x79a8('0x29')](function(){_0x5dc06d[_0x79a8('0x2d')](0xcc)[_0x79a8('0x1d')]();});}};}function handleEntityNotFound(_0x1285a2,_0x295dd3){return function(_0x3546f){if(!_0x3546f){_0x1285a2['sendStatus'](0x194);}return _0x3546f;};}function handleError(_0x29d705,_0x29c8a9){_0x29c8a9=_0x29c8a9||0x1f4;return function(_0x552466){logger['error'](_0x552466['stack']);if(_0x552466[_0x79a8('0x2e')]){delete _0x552466[_0x79a8('0x2e')];}_0x29d705[_0x79a8('0x2d')](_0x29c8a9)[_0x79a8('0x2f')](_0x552466);};}exports['index']=function(_0x327646,_0x3954c1){var _0x73816d={},_0x3f6dcf={},_0x73aba8={'count':0x0,'rows':[]};var _0x190d73=_[_0x79a8('0x30')](db[_0x79a8('0x31')][_0x79a8('0x32')],function(_0x3ac701){return{'name':_0x3ac701['fieldName'],'type':_0x3ac701['type'][_0x79a8('0x33')]};});_0x3f6dcf['model']=_[_0x79a8('0x30')](_0x190d73,_0x79a8('0x2e'));_0x3f6dcf[_0x79a8('0x34')]=_[_0x79a8('0x35')](_0x327646['query']);_0x3f6dcf[_0x79a8('0x36')]=_[_0x79a8('0x37')](_0x3f6dcf[_0x79a8('0x38')],_0x3f6dcf[_0x79a8('0x34')]);_0x73816d[_0x79a8('0x39')]=_[_0x79a8('0x37')](_0x3f6dcf[_0x79a8('0x38')],qs['fields'](_0x327646[_0x79a8('0x34')][_0x79a8('0x3a')]));_0x73816d[_0x79a8('0x39')]=_0x73816d[_0x79a8('0x39')][_0x79a8('0x3b')]?_0x73816d['attributes']:_0x3f6dcf['model'];if(!_0x327646[_0x79a8('0x34')][_0x79a8('0x3c')]('nolimit')){_0x73816d[_0x79a8('0x21')]=qs[_0x79a8('0x21')](_0x327646[_0x79a8('0x34')][_0x79a8('0x21')]);_0x73816d[_0x79a8('0x1e')]=qs['offset'](_0x327646[_0x79a8('0x34')][_0x79a8('0x1e')]);}_0x73816d[_0x79a8('0x3d')]=qs[_0x79a8('0x3e')](_0x327646['query'][_0x79a8('0x3e')]);_0x73816d['where']=qs[_0x79a8('0x36')](_[_0x79a8('0x3f')](_0x327646[_0x79a8('0x34')],_0x3f6dcf[_0x79a8('0x36')]),_0x190d73);if(_0x327646[_0x79a8('0x34')][_0x79a8('0x40')]){_0x73816d[_0x79a8('0x41')]=_[_0x79a8('0x42')](_0x73816d['where'],{'$or':_[_0x79a8('0x30')](_0x190d73,function(_0x208205){if(_0x208205[_0x79a8('0x43')]!=='VIRTUAL'){var _0x5e2d45={};_0x5e2d45[_0x208205[_0x79a8('0x2e')]]={'$like':'%'+_0x327646[_0x79a8('0x34')][_0x79a8('0x40')]+'%'};return _0x5e2d45;}})});}_0x73816d=_[_0x79a8('0x42')]({},_0x73816d,_0x327646[_0x79a8('0x44')]);var _0x5ca75d={'where':_0x73816d[_0x79a8('0x41')]};return db['WhatsappQueue'][_0x79a8('0x20')](_0x5ca75d)[_0x79a8('0x29')](function(_0x2692fc){_0x73aba8[_0x79a8('0x20')]=_0x2692fc;if(_0x327646[_0x79a8('0x34')]['includeAll']){_0x73816d[_0x79a8('0x45')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x79a8('0x46')](_0x73816d);})[_0x79a8('0x29')](function(_0x35a8ad){_0x73aba8[_0x79a8('0x47')]=_0x35a8ad;return _0x73aba8;})['then'](respondWithFilteredResult(_0x3954c1,_0x73816d))[_0x79a8('0x48')](handleError(_0x3954c1,null));};exports[_0x79a8('0x49')]=function(_0x117015,_0x202416){var _0x2cc4a5={'raw':!![],'where':{'id':_0x117015[_0x79a8('0x4a')]['id']}},_0xb8b95b={};_0xb8b95b['model']=_[_0x79a8('0x35')](db[_0x79a8('0x31')]['rawAttributes']);_0xb8b95b[_0x79a8('0x34')]=_['keys'](_0x117015[_0x79a8('0x34')]);_0xb8b95b['filters']=_[_0x79a8('0x37')](_0xb8b95b[_0x79a8('0x38')],_0xb8b95b[_0x79a8('0x34')]);_0x2cc4a5[_0x79a8('0x39')]=_[_0x79a8('0x37')](_0xb8b95b[_0x79a8('0x38')],qs[_0x79a8('0x3a')](_0x117015[_0x79a8('0x34')][_0x79a8('0x3a')]));_0x2cc4a5[_0x79a8('0x39')]=_0x2cc4a5[_0x79a8('0x39')][_0x79a8('0x3b')]?_0x2cc4a5[_0x79a8('0x39')]:_0xb8b95b[_0x79a8('0x38')];if(_0x117015[_0x79a8('0x34')][_0x79a8('0x4b')]){_0x2cc4a5[_0x79a8('0x45')]=[{'all':!![]}];}_0x2cc4a5=_[_0x79a8('0x42')]({},_0x2cc4a5,_0x117015[_0x79a8('0x44')]);return db['WhatsappQueue'][_0x79a8('0x4c')](_0x2cc4a5)[_0x79a8('0x29')](handleEntityNotFound(_0x202416,null))[_0x79a8('0x29')](respondWithResult(_0x202416,null))[_0x79a8('0x48')](handleError(_0x202416,null));};exports[_0x79a8('0x4d')]=function(_0x5c1058,_0x4dd6ff){return db[_0x79a8('0x31')][_0x79a8('0x4d')](_0x5c1058[_0x79a8('0x4e')],{})[_0x79a8('0x29')](function(_0x52111f){var _0x5d4b7d=_0x5c1058[_0x79a8('0x4f')][_0x79a8('0x2a')]({'plain':!![]});if(!_0x5d4b7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d4b7d['role']===_0x79a8('0x4f')){var _0x84ce8=_0x52111f[_0x79a8('0x2a')]({'plain':!![]});var _0x16728d='WhatsappQueues';return db[_0x79a8('0x50')]['find']({'where':{'name':_0x16728d,'userProfileId':_0x5d4b7d[_0x79a8('0x51')]},'raw':!![]})[_0x79a8('0x29')](function(_0x3ef66d){if(_0x3ef66d&&_0x3ef66d[_0x79a8('0x52')]===0x0){return db[_0x79a8('0x2c')][_0x79a8('0x4d')]({'name':_0x84ce8[_0x79a8('0x2e')],'resourceId':_0x84ce8['id'],'type':_0x3ef66d[_0x79a8('0x2e')],'sectionId':_0x3ef66d['id']},{})[_0x79a8('0x29')](function(){return _0x52111f;});}else{return _0x52111f;}})['catch'](function(_0x592b39){logger['error'](_0x79a8('0x53'),_0x592b39);throw _0x592b39;});}return _0x52111f;})[_0x79a8('0x29')](respondWithResult(_0x4dd6ff,0xc9))['catch'](handleError(_0x4dd6ff,null));};exports[_0x79a8('0x27')]=function(_0x251597,_0x5e0840){if(_0x251597['body']['id']){delete _0x251597[_0x79a8('0x4e')]['id'];}return db[_0x79a8('0x31')]['find']({'where':{'id':_0x251597[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x5e0840,null))[_0x79a8('0x29')](saveUpdates(_0x251597[_0x79a8('0x4e')],null))[_0x79a8('0x29')](respondWithResult(_0x5e0840,null))[_0x79a8('0x48')](handleError(_0x5e0840,null));};exports[_0x79a8('0x28')]=function(_0x593607,_0x2aef34){return db[_0x79a8('0x31')]['find']({'where':{'id':_0x593607[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x2aef34,null))['then'](removeEntity(_0x2aef34,null))[_0x79a8('0x48')](handleError(_0x2aef34,null));};exports[_0x79a8('0x54')]=function(_0x459911,_0x593f4b){return db[_0x79a8('0x31')][_0x79a8('0x54')]()[_0x79a8('0x29')](respondWithResult(_0x593f4b,null))['catch'](handleError(_0x593f4b,null));};exports['getMembers']=function(_0xcae871,_0x170f34,_0x34d50c){var _0x5cec01={'raw':!![],'where':{}},_0x440d49={},_0x48927a;return db[_0x79a8('0x31')][_0x79a8('0x55')]({'where':{'id':_0xcae871[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x170f34,null))[_0x79a8('0x29')](function(_0x38171e){if(_0x38171e){_0x48927a=_0x38171e['get']({'plain':!![]});_0x440d49[_0x79a8('0x38')]=_[_0x79a8('0x35')](db['UserWhatsappQueue']['rawAttributes']);_0x440d49['query']=_[_0x79a8('0x35')](_0xcae871[_0x79a8('0x34')]);_0x440d49['filters']=_['intersection'](_0x440d49['model'],_0x440d49['query']);_0x5cec01[_0x79a8('0x39')]=_[_0x79a8('0x37')](_0x440d49['model'],qs[_0x79a8('0x3a')](_0xcae871[_0x79a8('0x34')]['fields']));_0x5cec01['attributes']=_0x5cec01[_0x79a8('0x39')][_0x79a8('0x3b')]?_0x5cec01[_0x79a8('0x39')]:_0x440d49[_0x79a8('0x38')];if(!_0xcae871[_0x79a8('0x34')]['hasOwnProperty'](_0x79a8('0x56'))){_0x5cec01[_0x79a8('0x21')]=qs[_0x79a8('0x21')](_0xcae871['query'][_0x79a8('0x21')]);_0x5cec01['offset']=qs[_0x79a8('0x1e')](_0xcae871[_0x79a8('0x34')][_0x79a8('0x1e')]);}_0x5cec01['order']=qs['sort'](_0xcae871[_0x79a8('0x34')][_0x79a8('0x3e')]);_0x5cec01[_0x79a8('0x41')]=qs['filters'](_['pick'](_0xcae871[_0x79a8('0x34')],_0x440d49[_0x79a8('0x36')]));_0x5cec01[_0x79a8('0x41')][_0x79a8('0x57')]=_0x38171e['id'];if(_0xcae871['query'][_0x79a8('0x40')]){_0x5cec01['where']=_[_0x79a8('0x42')](_0x5cec01['where'],{'$or':_[_0x79a8('0x30')](_0x5cec01[_0x79a8('0x39')],function(_0x11880d){var _0x44841d={};_0x44841d[_0x11880d]={'$like':'%'+_0xcae871['query']['filter']+'%'};return _0x44841d;})});}_0x5cec01=_[_0x79a8('0x42')]({},_0x5cec01,_0xcae871[_0x79a8('0x44')]);return db[_0x79a8('0x58')][_0x79a8('0x46')](_0x5cec01);}})[_0x79a8('0x29')](function(_0xfa62aa){if(_0xfa62aa){return db['User'][_0x79a8('0x59')]({'where':{'id':_['map'](_0xfa62aa,'UserId'),'role':'agent'},'attributes':['id',_0x79a8('0x2e'),_0x79a8('0x5a'),'updatedAt',_0x79a8('0x5b')]});}})[_0x79a8('0x29')](function(_0x5a0af2){if(_0x5a0af2){return{'count':_0x5a0af2['count'],'rows':_[_0x79a8('0x30')](_0x5a0af2['rows'],function(_0x436dca){return{'membername':_0x436dca[_0x79a8('0x2e')],'UserId':_0x436dca['id'],'queue_name':_0x48927a[_0x79a8('0x2e')],'WhatsappQueueId':_0x48927a['id'],'interface':util[_0x79a8('0x5c')](_0x79a8('0x5d'),_0x79a8('0x5e'),_0x436dca[_0x79a8('0x2e')]),'penalty':0x0,'paused':_0x436dca[_0x79a8('0x5a')],'createdAt':_0x436dca[_0x79a8('0x5b')],'updatedAt':_0x436dca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x79a8('0x29')](respondWithFilteredResult(_0x170f34,_0x5cec01))[_0x79a8('0x48')](handleError(_0x170f34,null));};exports[_0x79a8('0x5f')]=function(_0x220d12,_0x41c9b6,_0x21b430){var _0x3bb15d={};var _0x129847={};var _0x294024;var _0x4b7f27;return db[_0x79a8('0x31')][_0x79a8('0x55')]({'where':{'id':_0x220d12[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x41c9b6,null))[_0x79a8('0x29')](function(_0x459f67){if(_0x459f67){_0x294024=_0x459f67;_0x129847[_0x79a8('0x38')]=_[_0x79a8('0x35')](db[_0x79a8('0x60')][_0x79a8('0x32')]);_0x129847['query']=_[_0x79a8('0x35')](_0x220d12[_0x79a8('0x34')]);_0x129847[_0x79a8('0x36')]=_[_0x79a8('0x37')](_0x129847[_0x79a8('0x38')],_0x129847[_0x79a8('0x34')]);_0x3bb15d['attributes']=_[_0x79a8('0x37')](_0x129847[_0x79a8('0x38')],qs[_0x79a8('0x3a')](_0x220d12[_0x79a8('0x34')]['fields']));_0x3bb15d[_0x79a8('0x39')]=_0x3bb15d[_0x79a8('0x39')][_0x79a8('0x3b')]?_0x3bb15d[_0x79a8('0x39')]:_0x129847[_0x79a8('0x38')];_0x3bb15d[_0x79a8('0x3d')]=qs[_0x79a8('0x3e')](_0x220d12[_0x79a8('0x34')][_0x79a8('0x3e')]);_0x3bb15d[_0x79a8('0x41')]=qs['filters'](_[_0x79a8('0x3f')](_0x220d12[_0x79a8('0x34')],_0x129847['filters']));if(_0x220d12[_0x79a8('0x34')][_0x79a8('0x40')]){_0x3bb15d[_0x79a8('0x41')]=_[_0x79a8('0x42')](_0x3bb15d[_0x79a8('0x41')],{'$or':_[_0x79a8('0x30')](_0x3bb15d[_0x79a8('0x39')],function(_0x1730b8){var _0x33d5e9={};_0x33d5e9[_0x1730b8]={'$like':'%'+_0x220d12['query']['filter']+'%'};return _0x33d5e9;})});}_0x3bb15d=_[_0x79a8('0x42')]({},_0x3bb15d,_0x220d12[_0x79a8('0x44')]);return _0x294024[_0x79a8('0x5f')](_0x3bb15d);}})[_0x79a8('0x29')](function(_0x445e81){if(_0x445e81){_0x4b7f27=_0x445e81[_0x79a8('0x3b')];if(!_0x220d12[_0x79a8('0x34')]['hasOwnProperty'](_0x79a8('0x56'))){_0x3bb15d[_0x79a8('0x21')]=qs['limit'](_0x220d12['query'][_0x79a8('0x21')]);_0x3bb15d[_0x79a8('0x1e')]=qs[_0x79a8('0x1e')](_0x220d12[_0x79a8('0x34')][_0x79a8('0x1e')]);}return _0x294024[_0x79a8('0x5f')](_0x3bb15d);}})[_0x79a8('0x29')](function(_0xc50957){if(_0xc50957){return _0xc50957?{'count':_0x4b7f27,'rows':_0xc50957}:null;}})[_0x79a8('0x29')](respondWithResult(_0x41c9b6,null))[_0x79a8('0x48')](handleError(_0x41c9b6,null));};exports['addTeams']=function(_0x54e87e,_0xe1515e,_0x2dc882){var _0x2dc183=_0x54e87e[_0x79a8('0x4e')][_0x79a8('0x61')];return db['Team'][_0x79a8('0x46')]({'where':{'id':_0x2dc183},'attributes':['id'],'include':[{'model':db[_0x79a8('0x62')],'as':'Agents','attributes':['id',_0x79a8('0x2e'),_0x79a8('0x63'),_0x79a8('0x64'),_0x79a8('0x65')],'raw':!![]}]})[_0x79a8('0x29')](function(_0x449d23){if(_0x449d23){var _0x1dcee7=_['flatMap'](_0x449d23,function(_0x101f7b){var _0x4b10a8=_0x101f7b['get']({'plain':!![]});return _0x4b10a8[_0x79a8('0x66')];});return db[_0x79a8('0x31')]['find']({'where':{'id':_0x54e87e[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](function(_0x2e2944){return db[_0x79a8('0x67')][_0x79a8('0x68')](function(_0x106edd){return _0x2e2944[_0x79a8('0x69')](_0x2dc183,{'transaction':_0x106edd})[_0x79a8('0x29')](function(){return BPromise[_0x79a8('0x6a')](_0x1dcee7,function(_0x5252a9){return db[_0x79a8('0x58')][_0x79a8('0x6b')]({'where':{'UserId':_0x5252a9['id'],'WhatsappQueueId':_0x54e87e[_0x79a8('0x4a')]['id']},'transaction':_0x106edd});});})['then'](function(){_0x1dcee7[_0x79a8('0x6c')](function(_0x13aab5){socket[_0x79a8('0x6d')](_0x79a8('0x6e'),{'UserId':_0x13aab5['id'],'WhatsappQueueId':_0x2e2944['id']});});});});});}})['then'](respondWithStatusCode(_0xe1515e,null))['catch'](handleError(_0xe1515e,null));};exports[_0x79a8('0x6f')]=function(_0x2e73d3,_0xae1586,_0x58c656){return db[_0x79a8('0x60')][_0x79a8('0x46')]({'where':{'id':_0x2e73d3[_0x79a8('0x34')][_0x79a8('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79a8('0x66'),'attributes':['id'],'raw':!![]}]})[_0x79a8('0x29')](handleEntityNotFound(_0xae1586,null))[_0x79a8('0x29')](function(_0x3a522d){var _0x2200af=_[_0x79a8('0x30')](_0x3a522d,'id');var _0x4e1056=[];var _0x536423=[];var _0x2b3832=squel[_0x79a8('0x70')]();_0x2b3832[_0x79a8('0x71')]('tq.TeamId')[_0x79a8('0x72')](_0x79a8('0x73'),'tq')[_0x79a8('0x74')](_0x79a8('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x79a8('0x41')]('WhatsappQueueId\x20=\x20?',_0x2e73d3[_0x79a8('0x4a')]['id']);for(var _0x277110=0x0;_0x277110<_0x3a522d[_0x79a8('0x3b')];_0x277110+=0x1){let _0x1754fe=_0x3a522d[_0x277110];for(var _0x34cdf3=0x0;_0x34cdf3<_0x1754fe[_0x79a8('0x66')][_0x79a8('0x3b')];_0x34cdf3+=0x1){let _0x1dea4a=_0x1754fe[_0x79a8('0x66')][_0x34cdf3];var _0x3e1c1b=_0x2b3832[_0x79a8('0x76')]();_0x3e1c1b['where'](_0x79a8('0x77'),_0x1dea4a['id']);_0x536423[_0x79a8('0x78')](db['sequelize'][_0x79a8('0x34')](_0x3e1c1b[_0x79a8('0x79')](),{'type':db[_0x79a8('0x67')]['QueryTypes'][_0x79a8('0x7a')]})[_0x79a8('0x29')](function(_0x21ee10){if(_0x21ee10[_0x79a8('0x3b')]===0x1){return _0x1dea4a['id'];}else{var _0x5ca788=_['every'](_['map'](_0x21ee10,_0x79a8('0x7b')),function(_0x3124a2){return _[_0x79a8('0x7c')](_0x2200af,_0x3124a2);});if(_0x5ca788){return _0x1dea4a['id'];}}}));}}return BPromise[_0x79a8('0x7d')](_0x536423)[_0x79a8('0x29')](function(_0x35a2c3){_0x4e1056=_(_0x4e1056)[_0x79a8('0x7e')](_0x35a2c3)[_0x79a8('0x7f')]()[_0x79a8('0x80')]();return db[_0x79a8('0x31')]['find']({'where':{'id':_0x2e73d3[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](function(_0x5ee660){return db[_0x79a8('0x67')][_0x79a8('0x68')](function(_0x33a11e){return _0x5ee660['removeTeams'](_0x2e73d3[_0x79a8('0x34')][_0x79a8('0x61')],{'transaction':_0x33a11e})[_0x79a8('0x29')](function(){if(!_[_0x79a8('0x81')](_0x4e1056)){return _0x5ee660['removeAgents'](_0x4e1056,{'transaction':_0x33a11e});}})[_0x79a8('0x29')](function(){_0x4e1056['forEach'](function(_0x2b0e8d){socket[_0x79a8('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x2b0e8d,'WhatsappQueueId':_0x5ee660['id']});});});});});});})[_0x79a8('0x29')](respondWithStatusCode(_0xae1586,null))[_0x79a8('0x48')](handleError(_0xae1586,null));};exports[_0x79a8('0x82')]=function(_0x1377bd,_0xac8637,_0x1a215a){return db[_0x79a8('0x31')][_0x79a8('0x4c')]({'where':{'id':_0x1377bd[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0xac8637,null))[_0x79a8('0x29')](function(_0x5dbd25){if(_0x5dbd25){return _0x5dbd25[_0x79a8('0x82')](_0x1377bd[_0x79a8('0x4e')]['ids'],_[_0x79a8('0x83')](_0x1377bd[_0x79a8('0x4e')],[_0x79a8('0x61'),'id'])||{})[_0x79a8('0x84')](function(_0x2ba543){for(var _0x3b9ede=0x0;_0x3b9ede<_0x1377bd[_0x79a8('0x4e')][_0x79a8('0x61')][_0x79a8('0x3b')];_0x3b9ede+=0x1){socket[_0x79a8('0x6d')](_0x79a8('0x6e'),{'UserId':Number(_0x1377bd[_0x79a8('0x4e')][_0x79a8('0x61')][_0x3b9ede]),'WhatsappQueueId':Number(_0x1377bd[_0x79a8('0x4a')]['id'])});}return _0x2ba543;});}})[_0x79a8('0x29')](respondWithResult(_0xac8637,null))[_0x79a8('0x48')](handleError(_0xac8637,null));};exports['removeAgents']=function(_0x2d9ab8,_0x50f99c,_0x18554e){return db[_0x79a8('0x31')][_0x79a8('0x4c')]({'where':{'id':_0x2d9ab8[_0x79a8('0x4a')]['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x50f99c,null))[_0x79a8('0x29')](function(_0x35c4b9){if(_0x35c4b9){return _0x35c4b9[_0x79a8('0x85')](_0x2d9ab8[_0x79a8('0x34')][_0x79a8('0x61')])[_0x79a8('0x29')](function(){if(_[_0x79a8('0x86')](_0x2d9ab8['query']['ids'])){for(var _0x534f2f=0x0;_0x534f2f<_0x2d9ab8[_0x79a8('0x34')]['ids'][_0x79a8('0x3b')];_0x534f2f+=0x1){socket[_0x79a8('0x6d')](_0x79a8('0x87'),{'UserId':Number(_0x2d9ab8['query'][_0x79a8('0x61')][_0x534f2f]),'WhatsappQueueId':Number(_0x2d9ab8[_0x79a8('0x4a')]['id'])});}}else{socket[_0x79a8('0x6d')](_0x79a8('0x87'),{'UserId':Number(_0x2d9ab8['query']['ids']),'WhatsappQueueId':Number(_0x2d9ab8[_0x79a8('0x4a')]['id'])});}});}})[_0x79a8('0x29')](respondWithStatusCode(_0x50f99c,null))[_0x79a8('0x48')](handleError(_0x50f99c,null));};exports[_0x79a8('0x88')]=function(_0x391728,_0x25720a,_0xbb281a){var _0x18aca7={};var _0x59bcaa={};var _0x74e650;var _0x3f46c1;return db[_0x79a8('0x31')]['findOne']({'where':{'id':_0x391728['params']['id']}})[_0x79a8('0x29')](handleEntityNotFound(_0x25720a,null))[_0x79a8('0x29')](function(_0x49442e){if(_0x49442e){_0x74e650=_0x49442e;_0x59bcaa['model']=_['keys'](db[_0x79a8('0x62')][_0x79a8('0x32')]);_0x59bcaa[_0x79a8('0x34')]=_[_0x79a8('0x35')](_0x391728[_0x79a8('0x34')]);_0x59bcaa[_0x79a8('0x36')]=_[_0x79a8('0x37')](_0x59bcaa['model'],_0x59bcaa['query']);_0x18aca7[_0x79a8('0x39')]=_[_0x79a8('0x37')](_0x59bcaa['model'],qs[_0x79a8('0x3a')](_0x391728['query'][_0x79a8('0x3a')]));_0x18aca7[_0x79a8('0x39')]=_0x18aca7[_0x79a8('0x39')][_0x79a8('0x3b')]?_0x18aca7[_0x79a8('0x39')]:_0x59bcaa['model'];_0x18aca7[_0x79a8('0x3d')]=qs['sort'](_0x391728['query']['sort']);_0x18aca7[_0x79a8('0x41')]=qs['filters'](_['pick'](_0x391728[_0x79a8('0x34')],_0x59bcaa['filters']));if(_0x391728[_0x79a8('0x34')][_0x79a8('0x40')]){_0x18aca7[_0x79a8('0x41')]=_[_0x79a8('0x42')](_0x18aca7[_0x79a8('0x41')],{'$or':_[_0x79a8('0x30')](_0x18aca7['attributes'],function(_0x4c3a5d){var _0x3a9c37={};_0x3a9c37[_0x4c3a5d]={'$like':'%'+_0x391728[_0x79a8('0x34')]['filter']+'%'};return _0x3a9c37;})});}_0x18aca7=_[_0x79a8('0x42')]({},_0x18aca7,_0x391728[_0x79a8('0x44')]);return _0x74e650['getAgents'](_0x18aca7);}})['then'](function(_0x3786b8){if(_0x3786b8){_0x3f46c1=_0x3786b8[_0x79a8('0x3b')];if(!_0x391728[_0x79a8('0x34')][_0x79a8('0x3c')](_0x79a8('0x56'))){_0x18aca7[_0x79a8('0x21')]=qs[_0x79a8('0x21')](_0x391728['query']['limit']);_0x18aca7[_0x79a8('0x1e')]=qs['offset'](_0x391728[_0x79a8('0x34')][_0x79a8('0x1e')]);}return _0x74e650['getAgents'](_0x18aca7);}})[_0x79a8('0x29')](function(_0xc0fedd){if(_0xc0fedd){return _0xc0fedd?{'count':_0x3f46c1,'rows':_0xc0fedd}:null;}})[_0x79a8('0x29')](respondWithResult(_0x25720a,null))[_0x79a8('0x48')](handleError(_0x25720a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 420364c..12e55bd 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 _0xf782=['remove','exports','events','../../mysqldb','WhatsappQueue','save'];(function(_0x2aefb6,_0x1bd384){var _0x202772=function(_0x507d3f){while(--_0x507d3f){_0x2aefb6['push'](_0x2aefb6['shift']());}};_0x202772(++_0x1bd384);}(_0xf782,0x164));var _0x2f78=function(_0x924c29,_0x309120){_0x924c29=_0x924c29-0x0;var _0x24ddd6=_0xf782[_0x924c29];return _0x24ddd6;};'use strict';var EventEmitter=require(_0x2f78('0x0'));var WhatsappQueue=require(_0x2f78('0x1'))['db'][_0x2f78('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2f78('0x3'),'afterUpdate':'update','afterDestroy':_0x2f78('0x4')};function emitEvent(_0x64ec5f){return function(_0x1570cc,_0x4c2807,_0x50e35f){WhatsappQueueEvents['emit'](_0x64ec5f+':'+_0x1570cc['id'],_0x1570cc);WhatsappQueueEvents['emit'](_0x64ec5f,_0x1570cc);_0x50e35f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x2f78('0x5')]=WhatsappQueueEvents; \ No newline at end of file +var _0xea44=['save','remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xea44,0x1ed));var _0x4ea4=function(_0x1e4244,_0x440c7a){_0x1e4244=_0x1e4244-0x0;var _0x3d4d9f=_0xea44[_0x1e4244];return _0x3d4d9f;};'use strict';var EventEmitter=require(_0x4ea4('0x0'));var WhatsappQueue=require(_0x4ea4('0x1'))['db'][_0x4ea4('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ea4('0x3'),'afterUpdate':'update','afterDestroy':_0x4ea4('0x4')};function emitEvent(_0x338626){return function(_0x6247b8,_0x2909fd,_0x51823e){WhatsappQueueEvents[_0x4ea4('0x5')](_0x338626+':'+_0x6247b8['id'],_0x6247b8);WhatsappQueueEvents['emit'](_0x338626,_0x6247b8);_0x51823e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x4ea4('0x6')](e,emitEvent(event));}}module[_0x4ea4('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 5e0b667..721b748 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 _0x9db3=['request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','util','api','bluebird'];(function(_0x354175,_0x298ec9){var _0x1ff362=function(_0xca78b6){while(--_0xca78b6){_0x354175['push'](_0x354175['shift']());}};_0x1ff362(++_0x298ec9);}(_0x9db3,0x192));var _0x39db=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9db3[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x39db('0x0'));var logger=require('../../config/logger')(_0x39db('0x1'));var moment=require('moment');var BPromise=require(_0x39db('0x2'));var rp=require(_0x39db('0x3'));var fs=require('fs');var path=require(_0x39db('0x4'));var rimraf=require(_0x39db('0x5'));var config=require(_0x39db('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x447677,_0x3e87ed){return _0x447677[_0x39db('0x7')](_0x39db('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b2a=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x3625e4,_0x2efee3){var _0x5efcb3=function(_0x19b73a){while(--_0x19b73a){_0x3625e4['push'](_0x3625e4['shift']());}};_0x5efcb3(++_0x2efee3);}(_0x4b2a,0x8c));var _0xa4b2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4b2a[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var logger=require(_0xa4b2('0x2'))(_0xa4b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa4b2('0x4'));var fs=require('fs');var path=require(_0xa4b2('0x5'));var rimraf=require(_0xa4b2('0x6'));var config=require(_0xa4b2('0x7'));var attributes=require(_0xa4b2('0x8'));module[_0xa4b2('0x9')]=function(_0x1357ef,_0x283479){return _0x1357ef['define'](_0xa4b2('0xa'),attributes,{'tableName':_0xa4b2('0xb'),'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 e88e90d..0fa37c9 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 _0x06db=['attributes','limit','include','model','map','GetWhatsappQueue','debug','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','catch','findAll','options','raw','where'];(function(_0x359e92,_0x6e6b4f){var _0x25c1fb=function(_0x456793){while(--_0x456793){_0x359e92['push'](_0x359e92['shift']());}};_0x25c1fb(++_0x6e6b4f);}(_0x06db,0xb6));var _0xb06d=function(_0x32def5,_0x8b3792){_0x32def5=_0x32def5-0x0;var _0x4546b7=_0x06db[_0x32def5];return _0x4546b7;};'use strict';var _=require(_0xb06d('0x0'));var util=require(_0xb06d('0x1'));var moment=require(_0xb06d('0x2'));var BPromise=require(_0xb06d('0x3'));var rs=require(_0xb06d('0x4'));var fs=require('fs');var Redis=require(_0xb06d('0x5'));var db=require(_0xb06d('0x6'))['db'];var utils=require(_0xb06d('0x7'));var logger=require(_0xb06d('0x8'))(_0xb06d('0x9'));var config=require(_0xb06d('0xa'));var jayson=require(_0xb06d('0xb'));var client=jayson[_0xb06d('0xc')][_0xb06d('0xd')]({'port':0x232a});config[_0xb06d('0xe')]=_[_0xb06d('0xf')](config[_0xb06d('0xe')],{'host':_0xb06d('0x10'),'port':0x18eb});var socket=require(_0xb06d('0x11'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xb06d('0x12')](socket);function respondWithRpcPromise(_0x15c89d,_0x29789f,_0x1ed471){return new BPromise(function(_0xb8319e,_0x536ac5){return client[_0xb06d('0x13')](_0x15c89d,_0x1ed471)[_0xb06d('0x14')](function(_0x49f9c5){logger[_0xb06d('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x29789f,_0xb06d('0x16'));logger['debug'](_0xb06d('0x17'),_0x29789f,'request\x20sent',JSON[_0xb06d('0x18')](_0x49f9c5));if(_0x49f9c5[_0xb06d('0x19')]){if(_0x49f9c5[_0xb06d('0x19')]['code']===0x1f4){logger[_0xb06d('0x19')](_0xb06d('0x1a'),_0x29789f,_0x49f9c5[_0xb06d('0x19')]['message']);return _0x536ac5(_0x49f9c5[_0xb06d('0x19')][_0xb06d('0x1b')]);}logger[_0xb06d('0x19')](_0xb06d('0x1a'),_0x29789f,_0x49f9c5[_0xb06d('0x19')]['message']);return _0xb8319e(_0x49f9c5[_0xb06d('0x19')][_0xb06d('0x1b')]);}else{logger[_0xb06d('0x15')](_0xb06d('0x1a'),_0x29789f,_0xb06d('0x16'));_0xb8319e(_0x49f9c5['result'][_0xb06d('0x1b')]);}})[_0xb06d('0x1c')](function(_0x13605c){logger[_0xb06d('0x19')](_0xb06d('0x1a'),_0x29789f,_0x13605c);_0x536ac5(_0x13605c);});});}exports['GetWhatsappQueue']=function(_0x387de3){var _0x538e89=this;return new Promise(function(_0x428c3e,_0xec8200){return db['WhatsappQueue'][_0xb06d('0x1d')]({'raw':_0x387de3[_0xb06d('0x1e')]?_0x387de3[_0xb06d('0x1e')][_0xb06d('0x1f')]===undefined?!![]:![]:!![],'where':_0x387de3['options']?_0x387de3[_0xb06d('0x1e')][_0xb06d('0x20')]||null:null,'attributes':_0x387de3[_0xb06d('0x1e')]?_0x387de3[_0xb06d('0x1e')][_0xb06d('0x21')]||null:null,'limit':_0x387de3[_0xb06d('0x1e')]?_0x387de3[_0xb06d('0x1e')][_0xb06d('0x22')]||null:null,'include':_0x387de3[_0xb06d('0x1e')]?_0x387de3[_0xb06d('0x1e')][_0xb06d('0x23')]?_['map'](_0x387de3[_0xb06d('0x1e')]['include'],function(_0x31be58){return{'model':db[_0x31be58[_0xb06d('0x24')]],'as':_0x31be58['as'],'attributes':_0x31be58[_0xb06d('0x21')],'include':_0x31be58['include']?_[_0xb06d('0x25')](_0x31be58[_0xb06d('0x23')],function(_0x45cdc2){return{'model':db[_0x45cdc2['model']],'as':_0x45cdc2['as'],'attributes':_0x45cdc2[_0xb06d('0x21')],'include':_0x45cdc2['include']?_[_0xb06d('0x25')](_0x45cdc2[_0xb06d('0x23')],function(_0x32c2a8){return{'model':db[_0x32c2a8[_0xb06d('0x24')]],'as':_0x32c2a8['as'],'attributes':_0x32c2a8[_0xb06d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x290329){logger['info'](_0xb06d('0x26'),_0x387de3);logger[_0xb06d('0x27')](_0xb06d('0x26'),_0x387de3,JSON[_0xb06d('0x18')](_0x290329));_0x428c3e(_0x290329);})['catch'](function(_0x9f23c0){logger[_0xb06d('0x19')](_0xb06d('0x26'),_0x9f23c0[_0xb06d('0x1b')],_0x387de3);_0xec8200(_0x538e89['error'](0x1f4,_0x9f23c0['message']));});});};exports[_0xb06d('0x28')]=function(_0x29eb7f){var _0x558ba6=this;return new Promise(function(_0x4bfc70,_0x10671f){return db[_0xb06d('0x29')][_0xb06d('0x2a')]({'raw':_0x29eb7f[_0xb06d('0x1e')]?_0x29eb7f[_0xb06d('0x1e')][_0xb06d('0x1f')]===undefined?!![]:![]:!![],'where':_0x29eb7f[_0xb06d('0x1e')]?_0x29eb7f[_0xb06d('0x1e')]['where']||null:null,'attributes':_0x29eb7f[_0xb06d('0x1e')]?_0x29eb7f[_0xb06d('0x1e')][_0xb06d('0x21')]||null:null,'include':_0x29eb7f[_0xb06d('0x1e')]?_0x29eb7f['options'][_0xb06d('0x23')]?_[_0xb06d('0x25')](_0x29eb7f[_0xb06d('0x1e')][_0xb06d('0x23')],function(_0x1a632e){return{'model':db[_0x1a632e[_0xb06d('0x24')]],'as':_0x1a632e['as'],'attributes':_0x1a632e['attributes'],'include':_0x1a632e[_0xb06d('0x23')]?_[_0xb06d('0x25')](_0x1a632e['include'],function(_0x2b2c20){return{'model':db[_0x2b2c20['model']],'as':_0x2b2c20['as'],'attributes':_0x2b2c20[_0xb06d('0x21')],'include':_0x2b2c20['include']?_['map'](_0x2b2c20['include'],function(_0x28c3fa){return{'model':db[_0x28c3fa[_0xb06d('0x24')]],'as':_0x28c3fa['as'],'attributes':_0x28c3fa[_0xb06d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a98d9){logger[_0xb06d('0x15')]('ShowWhatsappQueue',_0x29eb7f);logger[_0xb06d('0x27')](_0xb06d('0x28'),_0x29eb7f,JSON[_0xb06d('0x18')](_0x2a98d9));_0x4bfc70(_0x2a98d9);})[_0xb06d('0x1c')](function(_0x3745f0){logger['error'](_0xb06d('0x28'),_0x3745f0['message'],_0x29eb7f);_0x10671f(_0x558ba6[_0xb06d('0x19')](0x1f4,_0x3745f0['message']));});});}; \ No newline at end of file +var _0x8665=['then','info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','WhatsappQueue','findAll','options','raw','attributes','map','model','include','GetWhatsappQueue','where','ShowWhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8665,0x69));var _0x5866=function(_0x2858e2,_0x279bc4){_0x2858e2=_0x2858e2-0x0;var _0x25cff4=_0x8665[_0x2858e2];return _0x25cff4;};'use strict';var _=require(_0x5866('0x0'));var util=require('util');var moment=require(_0x5866('0x1'));var BPromise=require(_0x5866('0x2'));var rs=require(_0x5866('0x3'));var fs=require('fs');var Redis=require(_0x5866('0x4'));var db=require(_0x5866('0x5'))['db'];var utils=require(_0x5866('0x6'));var logger=require(_0x5866('0x7'))(_0x5866('0x8'));var config=require(_0x5866('0x9'));var jayson=require(_0x5866('0xa'));var client=jayson[_0x5866('0xb')][_0x5866('0xc')]({'port':0x232a});config['redis']=_[_0x5866('0xd')](config[_0x5866('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5866('0xf'))(new Redis(config[_0x5866('0xe')]));require(_0x5866('0x10'))[_0x5866('0x11')](socket);function respondWithRpcPromise(_0x5cf739,_0x1b97ba,_0x12a508){return new BPromise(function(_0x42dd72,_0x275d4b){return client['request'](_0x5cf739,_0x12a508)[_0x5866('0x12')](function(_0x2d665a){logger[_0x5866('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x1b97ba,'request\x20sent');logger[_0x5866('0x14')](_0x5866('0x15'),_0x1b97ba,'request\x20sent',JSON[_0x5866('0x16')](_0x2d665a));if(_0x2d665a[_0x5866('0x17')]){if(_0x2d665a[_0x5866('0x17')][_0x5866('0x18')]===0x1f4){logger[_0x5866('0x17')](_0x5866('0x19'),_0x1b97ba,_0x2d665a[_0x5866('0x17')][_0x5866('0x1a')]);return _0x275d4b(_0x2d665a[_0x5866('0x17')][_0x5866('0x1a')]);}logger[_0x5866('0x17')](_0x5866('0x19'),_0x1b97ba,_0x2d665a[_0x5866('0x17')][_0x5866('0x1a')]);return _0x42dd72(_0x2d665a[_0x5866('0x17')][_0x5866('0x1a')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x1b97ba,_0x5866('0x1b'));_0x42dd72(_0x2d665a[_0x5866('0x1c')][_0x5866('0x1a')]);}})[_0x5866('0x1d')](function(_0xb7cb06){logger[_0x5866('0x17')](_0x5866('0x19'),_0x1b97ba,_0xb7cb06);_0x275d4b(_0xb7cb06);});});}exports['GetWhatsappQueue']=function(_0x100d0b){var _0x5e97c2=this;return new Promise(function(_0x319900,_0x12e951){return db[_0x5866('0x1e')][_0x5866('0x1f')]({'raw':_0x100d0b[_0x5866('0x20')]?_0x100d0b[_0x5866('0x20')][_0x5866('0x21')]===undefined?!![]:![]:!![],'where':_0x100d0b['options']?_0x100d0b[_0x5866('0x20')]['where']||null:null,'attributes':_0x100d0b[_0x5866('0x20')]?_0x100d0b[_0x5866('0x20')][_0x5866('0x22')]||null:null,'limit':_0x100d0b[_0x5866('0x20')]?_0x100d0b[_0x5866('0x20')]['limit']||null:null,'include':_0x100d0b[_0x5866('0x20')]?_0x100d0b[_0x5866('0x20')]['include']?_[_0x5866('0x23')](_0x100d0b['options']['include'],function(_0xc3d2e0){return{'model':db[_0xc3d2e0[_0x5866('0x24')]],'as':_0xc3d2e0['as'],'attributes':_0xc3d2e0[_0x5866('0x22')],'include':_0xc3d2e0['include']?_[_0x5866('0x23')](_0xc3d2e0[_0x5866('0x25')],function(_0x181c7f){return{'model':db[_0x181c7f[_0x5866('0x24')]],'as':_0x181c7f['as'],'attributes':_0x181c7f[_0x5866('0x22')],'include':_0x181c7f[_0x5866('0x25')]?_['map'](_0x181c7f[_0x5866('0x25')],function(_0x44f3a8){return{'model':db[_0x44f3a8['model']],'as':_0x44f3a8['as'],'attributes':_0x44f3a8[_0x5866('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5866('0x12')](function(_0x2b859f){logger[_0x5866('0x13')](_0x5866('0x26'),_0x100d0b);logger[_0x5866('0x14')](_0x5866('0x26'),_0x100d0b,JSON[_0x5866('0x16')](_0x2b859f));_0x319900(_0x2b859f);})['catch'](function(_0x4c4ffa){logger[_0x5866('0x17')]('GetWhatsappQueue',_0x4c4ffa[_0x5866('0x1a')],_0x100d0b);_0x12e951(_0x5e97c2[_0x5866('0x17')](0x1f4,_0x4c4ffa[_0x5866('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x1e80fc){var _0x53b8c0=this;return new Promise(function(_0x4aec87,_0x11a979){return db[_0x5866('0x1e')]['find']({'raw':_0x1e80fc[_0x5866('0x20')]?_0x1e80fc[_0x5866('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x1e80fc[_0x5866('0x20')]?_0x1e80fc[_0x5866('0x20')][_0x5866('0x27')]||null:null,'attributes':_0x1e80fc['options']?_0x1e80fc[_0x5866('0x20')][_0x5866('0x22')]||null:null,'include':_0x1e80fc[_0x5866('0x20')]?_0x1e80fc[_0x5866('0x20')]['include']?_[_0x5866('0x23')](_0x1e80fc[_0x5866('0x20')][_0x5866('0x25')],function(_0xb1e084){return{'model':db[_0xb1e084[_0x5866('0x24')]],'as':_0xb1e084['as'],'attributes':_0xb1e084[_0x5866('0x22')],'include':_0xb1e084[_0x5866('0x25')]?_[_0x5866('0x23')](_0xb1e084[_0x5866('0x25')],function(_0x536921){return{'model':db[_0x536921['model']],'as':_0x536921['as'],'attributes':_0x536921[_0x5866('0x22')],'include':_0x536921[_0x5866('0x25')]?_[_0x5866('0x23')](_0x536921['include'],function(_0x54ed57){return{'model':db[_0x54ed57['model']],'as':_0x54ed57['as'],'attributes':_0x54ed57[_0x5866('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5866('0x12')](function(_0x182542){logger[_0x5866('0x13')](_0x5866('0x28'),_0x1e80fc);logger[_0x5866('0x14')](_0x5866('0x28'),_0x1e80fc,JSON[_0x5866('0x16')](_0x182542));_0x4aec87(_0x182542);})[_0x5866('0x1d')](function(_0x5bb7b2){logger['error'](_0x5866('0x28'),_0x5bb7b2[_0x5866('0x1a')],_0x1e80fc);_0x11a979(_0x53b8c0[_0x5866('0x17')](0x1f4,_0x5bb7b2[_0x5866('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 96a49c6..35fd851 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 _0x759a=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x55036a,_0x1e43dc){var _0x2ebe00=function(_0x10c3ee){while(--_0x10c3ee){_0x55036a['push'](_0x55036a['shift']());}};_0x2ebe00(++_0x1e43dc);}(_0x759a,0x7b));var _0xa759=function(_0x18e10d,_0x13ddf9){_0x18e10d=_0x18e10d-0x0;var _0x4d2053=_0x759a[_0x18e10d];return _0x4d2053;};'use strict';var WhatsappQueueEvents=require(_0xa759('0x0'));var events=[_0xa759('0x1'),_0xa759('0x2'),_0xa759('0x3')];function createListener(_0x41a502,_0x71fa60){return function(_0x25df41){_0x71fa60[_0xa759('0x4')](_0x41a502,_0x25df41);};}function removeListener(_0x114d6b,_0x5e5a05){return function(){WhatsappQueueEvents[_0xa759('0x5')](_0x114d6b,_0x5e5a05);};}exports[_0xa759('0x6')]=function(_0xaf825b){for(var _0x221032=0x0,_0x419faa=events[_0xa759('0x7')];_0x221032<_0x419faa;_0x221032++){var _0x5b956d=events[_0x221032];var _0x24abd4=createListener(_0xa759('0x8')+_0x5b956d,_0xaf825b);WhatsappQueueEvents['on'](_0x5b956d,_0x24abd4);}}; \ No newline at end of file +var _0x006f=['whatsappQueue:','./whatsappQueue.events','emit','removeListener'];(function(_0x5c11db,_0x626a88){var _0x32cb92=function(_0x35afc8){while(--_0x35afc8){_0x5c11db['push'](_0x5c11db['shift']());}};_0x32cb92(++_0x626a88);}(_0x006f,0x1a1));var _0xf006=function(_0x2f5040,_0x36b043){_0x2f5040=_0x2f5040-0x0;var _0x5da0f6=_0x006f[_0x2f5040];return _0x5da0f6;};'use strict';var WhatsappQueueEvents=require(_0xf006('0x0'));var events=['save','remove','update'];function createListener(_0x19d3a5,_0x593068){return function(_0x314215){_0x593068[_0xf006('0x1')](_0x19d3a5,_0x314215);};}function removeListener(_0x5829f6,_0x6624be){return function(){WhatsappQueueEvents[_0xf006('0x2')](_0x5829f6,_0x6624be);};}exports['register']=function(_0x2294fb){for(var _0xfb4f1b=0x0,_0x1b1c5d=events['length'];_0xfb4f1b<_0x1b1c5d;_0xfb4f1b++){var _0x386eb4=events[_0xfb4f1b];var _0x4d4fd6=createListener(_0xf006('0x3')+_0x386eb4,_0x2294fb);WhatsappQueueEvents['on'](_0x386eb4,_0x4d4fd6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e4568c7..1c094c9 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 _0x0f40=['destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x1508a0,_0x301084){var _0x4eae01=function(_0x32cae1){while(--_0x32cae1){_0x1508a0['push'](_0x1508a0['shift']());}};_0x4eae01(++_0x301084);}(_0x0f40,0xdd));var _0x00f4=function(_0x5d27c3,_0x5ac158){_0x5d27c3=_0x5d27c3-0x0;var _0xed73f8=_0x0f40[_0x5d27c3];return _0xed73f8;};'use strict';var multer=require('multer');var util=require(_0x00f4('0x0'));var path=require('path');var timeout=require(_0x00f4('0x1'));var express=require(_0x00f4('0x2'));var router=express[_0x00f4('0x3')]();var fs_extra=require(_0x00f4('0x4'));var auth=require(_0x00f4('0x5'));var interaction=require(_0x00f4('0x6'));var config=require(_0x00f4('0x7'));var controller=require(_0x00f4('0x8'));router[_0x00f4('0x9')]('/',auth[_0x00f4('0xa')](),controller[_0x00f4('0xb')]);router['get'](_0x00f4('0xc'),auth[_0x00f4('0xa')](),controller['describe']);router['get'](_0x00f4('0xd'),auth[_0x00f4('0xa')](),controller[_0x00f4('0xe')]);router[_0x00f4('0xf')]('/',auth['isAuthenticated'](),controller[_0x00f4('0x10')]);router['put'](_0x00f4('0xd'),auth[_0x00f4('0xa')](),controller[_0x00f4('0x11')]);router[_0x00f4('0x12')](_0x00f4('0xd'),auth[_0x00f4('0xa')](),controller[_0x00f4('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf5ee=['/describe','post','put','update','/:id','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x188fe0,_0x41dede){var _0x3698f6=function(_0x1300ba){while(--_0x1300ba){_0x188fe0['push'](_0x188fe0['shift']());}};_0x3698f6(++_0x41dede);}(_0xf5ee,0x1db));var _0xef5e=function(_0x15214b,_0x3a7ebd){_0x15214b=_0x15214b-0x0;var _0xe42e19=_0xf5ee[_0x15214b];return _0xe42e19;};'use strict';var multer=require(_0xef5e('0x0'));var util=require(_0xef5e('0x1'));var path=require(_0xef5e('0x2'));var timeout=require('connect-timeout');var express=require(_0xef5e('0x3'));var router=express[_0xef5e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef5e('0x5'));var config=require(_0xef5e('0x6'));var controller=require(_0xef5e('0x7'));router[_0xef5e('0x8')]('/',auth[_0xef5e('0x9')](),controller[_0xef5e('0xa')]);router[_0xef5e('0x8')](_0xef5e('0xb'),auth[_0xef5e('0x9')](),controller['describe']);router[_0xef5e('0x8')]('/:id',auth[_0xef5e('0x9')](),controller['show']);router[_0xef5e('0xc')]('/',auth[_0xef5e('0x9')](),controller['create']);router[_0xef5e('0xd')]('/:id',auth[_0xef5e('0x9')](),controller[_0xef5e('0xe')]);router['delete'](_0xef5e('0xf'),auth[_0xef5e('0x9')](),controller[_0xef5e('0x10')]);module[_0xef5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 09311f0..785a9e5 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3e87d1,_0x19a441){var _0x3eed06=function(_0x15af05){while(--_0x15af05){_0x3e87d1['push'](_0x3e87d1['shift']());}};_0x3eed06(++_0x19a441);}(_0x7a54,0x106));var _0x47a5=function(_0x384aec,_0x3a3ddd){_0x384aec=_0x384aec-0x0;var _0x1408f0=_0x7a54[_0x384aec];return _0x1408f0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x504719,_0x1618a4){var _0x1bddfa=function(_0x45a90f){while(--_0x45a90f){_0x504719['push'](_0x504719['shift']());}};_0x1bddfa(++_0x1618a4);}(_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 0778609..bd30d27 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 _0xae60=['../../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','Content-Range','apply','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x583089,_0x129e8e){var _0x5a8c0d=function(_0x5e08cf){while(--_0x5e08cf){_0x583089['push'](_0x583089['shift']());}};_0x5a8c0d(++_0x129e8e);}(_0xae60,0x1c7));var _0x0ae6=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xae60[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['WhatsappQueueReport'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));};exports[_0x0ae6('0x4e')]=function(_0x327b55,_0x173acd){return db[_0x0ae6('0x2e')][_0x0ae6('0x4e')]()[_0x0ae6('0x29')](respondWithResult(_0x173acd,null))[_0x0ae6('0x48')](handleError(_0x173acd,null));}; \ No newline at end of file +var _0xd914=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x598041,_0x544317){var _0x32f600=function(_0x338a03){while(--_0x338a03){_0x598041['push'](_0x598041['shift']());}};_0x32f600(++_0x544317);}(_0xd914,0x17f));var _0x4d91=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd914[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){_0x9cb864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee6b3,_0x112923){return function(_0x3bed98){if(!_0x3bed98){_0x1ee6b3[_0x4d91('0x28')](0x194);}return _0x3bed98;};}function handleError(_0x472f3a,_0x2c7d7a){_0x2c7d7a=_0x2c7d7a||0x1f4;return function(_0x14bdb4){logger['error'](_0x14bdb4[_0x4d91('0x29')]);if(_0x14bdb4[_0x4d91('0x2a')]){delete _0x14bdb4[_0x4d91('0x2a')];}_0x472f3a['status'](_0x2c7d7a)['send'](_0x14bdb4);};}exports[_0x4d91('0x2b')]=function(_0x470079,_0x5ed948){var _0x50fe76={},_0x42d5a0={},_0x2d6981={'count':0x0,'rows':[]};var _0x43371e=_[_0x4d91('0x2c')](db['WhatsappQueueReport'][_0x4d91('0x2d')],function(_0x31bbf8){return{'name':_0x31bbf8[_0x4d91('0x2e')],'type':_0x31bbf8[_0x4d91('0x2f')][_0x4d91('0x30')]};});_0x42d5a0[_0x4d91('0x31')]=_[_0x4d91('0x2c')](_0x43371e,'name');_0x42d5a0[_0x4d91('0x32')]=_['keys'](_0x470079['query']);_0x42d5a0[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x42d5a0['model'],_0x42d5a0[_0x4d91('0x32')]);_0x50fe76[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x42d5a0[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x470079['query'][_0x4d91('0x36')]));_0x50fe76[_0x4d91('0x35')]=_0x50fe76[_0x4d91('0x35')][_0x4d91('0x37')]?_0x50fe76[_0x4d91('0x35')]:_0x42d5a0[_0x4d91('0x31')];if(!_0x470079['query'][_0x4d91('0x38')](_0x4d91('0x39'))){_0x50fe76['limit']=qs[_0x4d91('0x3a')](_0x470079[_0x4d91('0x32')][_0x4d91('0x3a')]);_0x50fe76['offset']=qs[_0x4d91('0x1e')](_0x470079[_0x4d91('0x32')][_0x4d91('0x1e')]);}_0x50fe76[_0x4d91('0x3b')]=qs['sort'](_0x470079[_0x4d91('0x32')][_0x4d91('0x3c')]);_0x50fe76[_0x4d91('0x3d')]=qs[_0x4d91('0x33')](_['pick'](_0x470079['query'],_0x42d5a0[_0x4d91('0x33')]),_0x43371e);if(_0x470079[_0x4d91('0x32')]['filter']){_0x50fe76[_0x4d91('0x3d')]=_[_0x4d91('0x3e')](_0x50fe76[_0x4d91('0x3d')],{'$or':_[_0x4d91('0x2c')](_0x43371e,function(_0x5d93c1){if(_0x5d93c1[_0x4d91('0x2f')]!==_0x4d91('0x3f')){var _0x571a0c={};_0x571a0c[_0x5d93c1[_0x4d91('0x2a')]]={'$like':'%'+_0x470079['query'][_0x4d91('0x40')]+'%'};return _0x571a0c;}})});}_0x50fe76=_['merge']({},_0x50fe76,_0x470079[_0x4d91('0x41')]);var _0x49742b={'where':_0x50fe76[_0x4d91('0x3d')]};return db[_0x4d91('0x42')][_0x4d91('0x20')](_0x49742b)[_0x4d91('0x26')](function(_0x4f6576){_0x2d6981['count']=_0x4f6576;if(_0x470079[_0x4d91('0x32')]['includeAll']){_0x50fe76[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x42')]['findAll'](_0x50fe76);})[_0x4d91('0x26')](function(_0x2ae356){_0x2d6981[_0x4d91('0x44')]=_0x2ae356;return _0x2d6981;})[_0x4d91('0x26')](respondWithFilteredResult(_0x5ed948,_0x50fe76))[_0x4d91('0x45')](handleError(_0x5ed948,null));};exports[_0x4d91('0x46')]=function(_0x23902f,_0x4f6254){var _0x1e4c6d={'raw':!![],'where':{'id':_0x23902f[_0x4d91('0x47')]['id']}},_0x4c70af={};_0x4c70af[_0x4d91('0x31')]=_[_0x4d91('0x48')](db[_0x4d91('0x42')][_0x4d91('0x2d')]);_0x4c70af[_0x4d91('0x32')]=_['keys'](_0x23902f['query']);_0x4c70af[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x4c70af['model'],_0x4c70af[_0x4d91('0x32')]);_0x1e4c6d[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x4c70af[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x23902f[_0x4d91('0x32')][_0x4d91('0x36')]));_0x1e4c6d[_0x4d91('0x35')]=_0x1e4c6d[_0x4d91('0x35')]['length']?_0x1e4c6d['attributes']:_0x4c70af[_0x4d91('0x31')];if(_0x23902f['query'][_0x4d91('0x49')]){_0x1e4c6d[_0x4d91('0x43')]=[{'all':!![]}];}_0x1e4c6d=_[_0x4d91('0x3e')]({},_0x1e4c6d,_0x23902f[_0x4d91('0x41')]);return db['WhatsappQueueReport'][_0x4d91('0x4a')](_0x1e4c6d)['then'](handleEntityNotFound(_0x4f6254,null))['then'](respondWithResult(_0x4f6254,null))[_0x4d91('0x45')](handleError(_0x4f6254,null));};exports[_0x4d91('0x4b')]=function(_0x18073d,_0xa03d75){return db[_0x4d91('0x42')][_0x4d91('0x4b')](_0x18073d['body'],{})[_0x4d91('0x26')](respondWithResult(_0xa03d75,0xc9))[_0x4d91('0x45')](handleError(_0xa03d75,null));};exports[_0x4d91('0x25')]=function(_0x449dd8,_0x106e5b){if(_0x449dd8[_0x4d91('0x4c')]['id']){delete _0x449dd8[_0x4d91('0x4c')]['id'];}return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x449dd8[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x106e5b,null))['then'](saveUpdates(_0x449dd8[_0x4d91('0x4c')],null))['then'](respondWithResult(_0x106e5b,null))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x27')]=function(_0x195e65,_0x386935){return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x195e65[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x386935,null))['then'](removeEntity(_0x386935,null))[_0x4d91('0x45')](handleError(_0x386935,null));};exports[_0x4d91('0x4d')]=function(_0x3fe9ee,_0x2bba43){return db[_0x4d91('0x42')][_0x4d91('0x4d')]()[_0x4d91('0x26')](respondWithResult(_0x2bba43,null))['catch'](handleError(_0x2bba43,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7557bed..4b1a48f 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 _0x38cd=['../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x38cd,0x156));var _0xd38c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x38cd[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xd38c('0x0'));var util=require(_0xd38c('0x1'));var logger=require(_0xd38c('0x2'))('api');var moment=require(_0xd38c('0x3'));var BPromise=require(_0xd38c('0x4'));var rp=require(_0xd38c('0x5'));var fs=require('fs');var path=require(_0xd38c('0x6'));var rimraf=require(_0xd38c('0x7'));var config=require(_0xd38c('0x8'));var attributes=require(_0xd38c('0x9'));module['exports']=function(_0x4cf27c,_0x112011){return _0x4cf27c[_0xd38c('0xa')](_0xd38c('0xb'),attributes,{'tableName':_0xd38c('0xc'),'paranoid':![],'indexes':[{'name':_0xd38c('0xd'),'fields':[_0xd38c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4395=['path','../../config/environment','define','uniqueid','lodash','util','moment','bluebird','request-promise'];(function(_0x2b80be,_0x483f26){var _0x11dc75=function(_0x11cdb6){while(--_0x11cdb6){_0x2b80be['push'](_0x2b80be['shift']());}};_0x11dc75(++_0x483f26);}(_0x4395,0x70));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5439('0x0'));var util=require(_0x5439('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5439('0x2'));var BPromise=require(_0x5439('0x3'));var rp=require(_0x5439('0x4'));var fs=require('fs');var path=require(_0x5439('0x5'));var rimraf=require('rimraf');var config=require(_0x5439('0x6'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x223a85,_0x10d003){return _0x223a85[_0x5439('0x7')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x5439('0x8'),'fields':[_0x5439('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index bb6fccb..0622f1f 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 _0xf14f=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','update','where','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2fbb95,_0x3a9af6){var _0x2b9ecb=function(_0x3f73d9){while(--_0x3f73d9){_0x2fbb95['push'](_0x2fbb95['shift']());}};_0x2b9ecb(++_0x3a9af6);}(_0xf14f,0x8a));var _0xff14=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0xf14f[_0x715d76];return _0x48fe88;};'use strict';var _=require(_0xff14('0x0'));var util=require(_0xff14('0x1'));var moment=require(_0xff14('0x2'));var BPromise=require(_0xff14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff14('0x4'));var db=require(_0xff14('0x5'))['db'];var utils=require(_0xff14('0x6'));var logger=require(_0xff14('0x7'))(_0xff14('0x8'));var config=require(_0xff14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff14('0xa')][_0xff14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b228d,_0x3d9047,_0x18e19a){return new BPromise(function(_0x323ee5,_0xa7090e){return client[_0xff14('0xc')](_0x5b228d,_0x18e19a)[_0xff14('0xd')](function(_0x1115e3){logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,_0xff14('0x10'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3d9047,_0xff14('0x10'),JSON[_0xff14('0x11')](_0x1115e3));if(_0x1115e3[_0xff14('0x12')]){if(_0x1115e3[_0xff14('0x12')][_0xff14('0x13')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0xa7090e(_0x1115e3['error'][_0xff14('0x14')]);}logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0x323ee5(_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);}else{logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,'request\x20sent');_0x323ee5(_0x1115e3[_0xff14('0x15')]['message']);}})[_0xff14('0x16')](function(_0x5a5845){logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x5a5845);_0xa7090e(_0x5a5845);});});}exports[_0xff14('0x17')]=function(_0xcf3f6a){var _0x38dce6=this;return new Promise(function(_0x4d861b,_0x203d6a){return db[_0xff14('0x18')]['create'](_0xcf3f6a[_0xff14('0x19')],{'raw':_0xcf3f6a[_0xff14('0x1a')]?_0xcf3f6a['options'][_0xff14('0x1b')]===undefined?!![]:![]:!![]})[_0xff14('0xd')](function(_0x19c1d6){logger[_0xff14('0xe')](_0xff14('0x17'),_0xcf3f6a);logger['debug'](_0xff14('0x17'),_0xcf3f6a,JSON[_0xff14('0x11')](_0x19c1d6));_0x4d861b(_0x19c1d6);})[_0xff14('0x16')](function(_0x5dcf6a){logger['error'](_0xff14('0x17'),_0x5dcf6a[_0xff14('0x14')],_0xcf3f6a);_0x203d6a(_0x38dce6[_0xff14('0x12')](0x1f4,_0x5dcf6a['message']));});});};exports[_0xff14('0x1c')]=function(_0x51b6b2){var _0x23982c=this;return new Promise(function(_0x47f2aa,_0x37cbad){return db['WhatsappQueueReport'][_0xff14('0x1d')](_0x51b6b2[_0xff14('0x19')],{'raw':_0x51b6b2[_0xff14('0x1a')]?_0x51b6b2[_0xff14('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51b6b2['options']?_0x51b6b2[_0xff14('0x1a')][_0xff14('0x1e')]||null:null,'attributes':_0x51b6b2[_0xff14('0x1a')]?_0x51b6b2[_0xff14('0x1a')]['attributes']||null:null,'limit':_0x51b6b2[_0xff14('0x1a')]?_0x51b6b2[_0xff14('0x1a')]['limit']||null:null})['then'](function(_0x356af1){logger[_0xff14('0xe')](_0xff14('0x1c'),_0x51b6b2);logger[_0xff14('0x1f')](_0xff14('0x1c'),_0x51b6b2,JSON[_0xff14('0x11')](_0x356af1));_0x47f2aa(_0x356af1);})[_0xff14('0x16')](function(_0x408cda){logger[_0xff14('0x12')](_0xff14('0x1c'),_0x408cda['message'],_0x51b6b2);_0x37cbad(_0x23982c[_0xff14('0x12')](0x1f4,_0x408cda[_0xff14('0x14')]));});});}; \ No newline at end of file +var _0x9e45=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','then','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e4294,_0x2b003f){var _0x103abd=function(_0x125136){while(--_0x125136){_0x2e4294['push'](_0x2e4294['shift']());}};_0x103abd(++_0x2b003f);}(_0x9e45,0x1ee));var _0x59e4=function(_0x4f96a3,_0xe68556){_0x4f96a3=_0x4f96a3-0x0;var _0x44529e=_0x9e45[_0x4f96a3];return _0x44529e;};'use strict';var _=require(_0x59e4('0x0'));var util=require(_0x59e4('0x1'));var moment=require(_0x59e4('0x2'));var BPromise=require('bluebird');var rs=require(_0x59e4('0x3'));var fs=require('fs');var Redis=require(_0x59e4('0x4'));var db=require(_0x59e4('0x5'))['db'];var utils=require(_0x59e4('0x6'));var logger=require(_0x59e4('0x7'))(_0x59e4('0x8'));var config=require(_0x59e4('0x9'));var jayson=require(_0x59e4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x266cf9,_0x26b551,_0x3d4414){return new BPromise(function(_0x514d76,_0x2308ea){return client[_0x59e4('0xb')](_0x266cf9,_0x3d4414)['then'](function(_0x5a36c2){logger[_0x59e4('0xc')](_0x59e4('0xd'),_0x26b551,_0x59e4('0xe'));logger[_0x59e4('0xf')](_0x59e4('0x10'),_0x26b551,_0x59e4('0xe'),JSON[_0x59e4('0x11')](_0x5a36c2));if(_0x5a36c2[_0x59e4('0x12')]){if(_0x5a36c2['error'][_0x59e4('0x13')]===0x1f4){logger['error'](_0x59e4('0xd'),_0x26b551,_0x5a36c2[_0x59e4('0x12')][_0x59e4('0x14')]);return _0x2308ea(_0x5a36c2[_0x59e4('0x12')][_0x59e4('0x14')]);}logger[_0x59e4('0x12')](_0x59e4('0xd'),_0x26b551,_0x5a36c2[_0x59e4('0x12')]['message']);return _0x514d76(_0x5a36c2[_0x59e4('0x12')]['message']);}else{logger[_0x59e4('0xc')](_0x59e4('0xd'),_0x26b551,_0x59e4('0xe'));_0x514d76(_0x5a36c2[_0x59e4('0x15')][_0x59e4('0x14')]);}})[_0x59e4('0x16')](function(_0x92f5e7){logger[_0x59e4('0x12')](_0x59e4('0xd'),_0x26b551,_0x92f5e7);_0x2308ea(_0x92f5e7);});});}exports[_0x59e4('0x17')]=function(_0x2de3e9){var _0x1492db=this;return new Promise(function(_0x3024fa,_0x5e6b6d){return db[_0x59e4('0x18')][_0x59e4('0x19')](_0x2de3e9[_0x59e4('0x1a')],{'raw':_0x2de3e9['options']?_0x2de3e9[_0x59e4('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x59e4('0x1c')](function(_0x87788d){logger[_0x59e4('0xc')](_0x59e4('0x17'),_0x2de3e9);logger['debug']('CreateWhatsappQueueReport',_0x2de3e9,JSON[_0x59e4('0x11')](_0x87788d));_0x3024fa(_0x87788d);})[_0x59e4('0x16')](function(_0x4268c1){logger[_0x59e4('0x12')](_0x59e4('0x17'),_0x4268c1[_0x59e4('0x14')],_0x2de3e9);_0x5e6b6d(_0x1492db[_0x59e4('0x12')](0x1f4,_0x4268c1[_0x59e4('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x23d79a){var _0xe13f2a=this;return new Promise(function(_0xdd5583,_0x2470c1){return db[_0x59e4('0x18')][_0x59e4('0x1d')](_0x23d79a[_0x59e4('0x1a')],{'raw':_0x23d79a[_0x59e4('0x1b')]?_0x23d79a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d79a[_0x59e4('0x1b')]?_0x23d79a[_0x59e4('0x1b')][_0x59e4('0x1e')]||null:null,'attributes':_0x23d79a['options']?_0x23d79a[_0x59e4('0x1b')][_0x59e4('0x1f')]||null:null,'limit':_0x23d79a[_0x59e4('0x1b')]?_0x23d79a[_0x59e4('0x1b')][_0x59e4('0x20')]||null:null})[_0x59e4('0x1c')](function(_0xaa2d2e){logger[_0x59e4('0xc')](_0x59e4('0x21'),_0x23d79a);logger[_0x59e4('0xf')]('UpdateWhatsappQueueReport',_0x23d79a,JSON[_0x59e4('0x11')](_0xaa2d2e));_0xdd5583(_0xaa2d2e);})[_0x59e4('0x16')](function(_0x6ce3ab){logger['error'](_0x59e4('0x21'),_0x6ce3ab[_0x59e4('0x14')],_0x23d79a);_0x2470c1(_0xe13f2a['error'](0x1f4,_0x6ce3ab[_0x59e4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 265d333..d28d9d9 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 _0x262d=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path'];(function(_0x525798,_0x77a707){var _0x57da9a=function(_0x20837b){while(--_0x20837b){_0x525798['push'](_0x525798['shift']());}};_0x57da9a(++_0x77a707);}(_0x262d,0xb2));var _0xd262=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x262d[_0x139a3c];return _0x2b375b;};'use strict';var multer=require('multer');var util=require(_0xd262('0x0'));var path=require(_0xd262('0x1'));var timeout=require(_0xd262('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd262('0x3'));var auth=require(_0xd262('0x4'));var interaction=require(_0xd262('0x5'));var config=require(_0xd262('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0xd262('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd262('0x7')](_0xd262('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xd262('0x7')](_0xd262('0x9'),auth[_0xd262('0xa')](),controller[_0xd262('0xb')]);router[_0xd262('0xc')]('/',auth['isAuthenticated'](),controller[_0xd262('0xd')]);router[_0xd262('0xe')]('/:id',auth[_0xd262('0xa')](),controller[_0xd262('0xf')]);router[_0xd262('0x10')](_0xd262('0x9'),auth[_0xd262('0xa')](),controller['destroy']);module[_0xd262('0x11')]=router; \ No newline at end of file +var _0x019f=['/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index'];(function(_0x48942f,_0x4d9839){var _0x208928=function(_0x5aa313){while(--_0x5aa313){_0x48942f['push'](_0x48942f['shift']());}};_0x208928(++_0x4d9839);}(_0x019f,0xe7));var _0xf019=function(_0xf244e0,_0x20556c){_0xf244e0=_0xf244e0-0x0;var _0xe94095=_0x019f[_0xf244e0];return _0xe94095;};'use strict';var multer=require(_0xf019('0x0'));var util=require('util');var path=require(_0xf019('0x1'));var timeout=require(_0xf019('0x2'));var express=require(_0xf019('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf019('0x4'));var interaction=require(_0xf019('0x5'));var config=require('../../config/environment');var controller=require(_0xf019('0x6'));router[_0xf019('0x7')]('/',auth['isAuthenticated'](),controller[_0xf019('0x8')]);router[_0xf019('0x7')](_0xf019('0x9'),auth[_0xf019('0xa')](),controller[_0xf019('0xb')]);router[_0xf019('0x7')](_0xf019('0xc'),auth[_0xf019('0xa')](),controller[_0xf019('0xd')]);router[_0xf019('0xe')]('/',auth[_0xf019('0xa')](),controller[_0xf019('0xf')]);router[_0xf019('0x10')]('/:id',auth[_0xf019('0xa')](),controller[_0xf019('0x11')]);router[_0xf019('0x12')](_0xf019('0xc'),auth[_0xf019('0xa')](),controller[_0xf019('0x13')]);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 387fe7a..9736357 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 _0x97e6=['account','queue','DATE','sequelize','STRING','ENUM'];(function(_0x342799,_0x3b5854){var _0x137810=function(_0x48e46f){while(--_0x48e46f){_0x342799['push'](_0x342799['shift']());}};_0x137810(++_0x3b5854);}(_0x97e6,0x159));var _0x697e=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0x97e6[_0x3a3d20];return _0x33bc94;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x697e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x697e('0x2')](_0x697e('0x3'),'agent',_0x697e('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x697e('0x5')]}}; \ No newline at end of file +var _0xb2af=['sequelize','exports','STRING','ENUM','agent','queue','DATE'];(function(_0x1c3268,_0x2aae68){var _0x50ef3b=function(_0x21798c){while(--_0x21798c){_0x1c3268['push'](_0x1c3268['shift']());}};_0x50ef3b(++_0x2aae68);}(_0xb2af,0xd2));var _0xfb2a=function(_0x1c9fe5,_0x44c0ff){_0x1c9fe5=_0x1c9fe5-0x0;var _0x4b3449=_0xb2af[_0x1c9fe5];return _0x4b3449;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'uniqueid':{'type':Sequelize[_0xfb2a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfb2a('0x3')]('account',_0xfb2a('0x4'),_0xfb2a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfb2a('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index be7ea4c..c1d289a 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 _0x93e9=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','WhatsappTransferReport','includeAll','include','findAll','catch','show','params','keys','fields','length','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1f368a,_0x1651eb){var _0x28331b=function(_0x563709){while(--_0x563709){_0x1f368a['push'](_0x1f368a['shift']());}};_0x28331b(++_0x1651eb);}(_0x93e9,0xcc));var _0x993e=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x93e9[_0x4605dc];return _0x5d3e81;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];function respondWithStatusCode(_0x5d5c0d,_0x4c2707){_0x4c2707=_0x4c2707||0xcc;return function(_0x31ece2){if(_0x31ece2){return _0x5d5c0d[_0x993e('0x19')](_0x4c2707);}return _0x5d5c0d[_0x993e('0x1a')](_0x4c2707)[_0x993e('0x1b')]();};}function respondWithResult(_0x3e082b,_0x397b42){_0x397b42=_0x397b42||0xc8;return function(_0x34ddda){if(_0x34ddda){return _0x3e082b[_0x993e('0x1a')](_0x397b42)[_0x993e('0x1c')](_0x34ddda);}};}function respondWithFilteredResult(_0xa43a4e,_0x1a7726){return function(_0x135771){if(_0x135771){var _0x3df0e7=typeof _0x1a7726[_0x993e('0x1d')]===_0x993e('0x1e')&&typeof _0x1a7726[_0x993e('0x1f')]===_0x993e('0x1e');var _0x526e06=_0x135771[_0x993e('0x20')];var _0x1acd21=_0x3df0e7?0x0:_0x1a7726[_0x993e('0x1d')];var _0x3d6109=_0x3df0e7?_0x135771[_0x993e('0x20')]:_0x1a7726[_0x993e('0x1d')]+_0x1a7726['limit'];var _0x11cd41;if(_0x3d6109>=_0x526e06){_0x3d6109=_0x526e06;_0x11cd41=0xc8;}else{_0x11cd41=0xce;}_0xa43a4e[_0x993e('0x1a')](_0x11cd41);return _0xa43a4e[_0x993e('0x21')](_0x993e('0x22'),_0x1acd21+'-'+_0x3d6109+'/'+_0x526e06)[_0x993e('0x1c')](_0x135771);}return null;};}function patchUpdates(_0x425ab4){return function(_0x29e48d){try{jsonpatch[_0x993e('0x23')](_0x29e48d,_0x425ab4,!![]);}catch(_0x4bbe9c){return BPromise[_0x993e('0x24')](_0x4bbe9c);}return _0x29e48d['save']();};}function saveUpdates(_0x11f6f4,_0x37ff57){return function(_0x32b09e){if(_0x32b09e){return _0x32b09e['update'](_0x11f6f4)[_0x993e('0x25')](function(_0x13db4e){return _0x13db4e;});}return null;};}function removeEntity(_0xfba00f,_0x1c52fd){return function(_0x3b45ef){if(_0x3b45ef){return _0x3b45ef[_0x993e('0x26')]()[_0x993e('0x25')](function(){_0xfba00f[_0x993e('0x1a')](0xcc)[_0x993e('0x1b')]();});}};}function handleEntityNotFound(_0x18f6ac,_0x3fe099){return function(_0x3603fa){if(!_0x3603fa){_0x18f6ac['sendStatus'](0x194);}return _0x3603fa;};}function handleError(_0x2756a7,_0x279bb8){_0x279bb8=_0x279bb8||0x1f4;return function(_0x52b727){logger[_0x993e('0x27')](_0x52b727['stack']);if(_0x52b727[_0x993e('0x28')]){delete _0x52b727[_0x993e('0x28')];}_0x2756a7[_0x993e('0x1a')](_0x279bb8)[_0x993e('0x29')](_0x52b727);};}exports['index']=function(_0x48d457,_0x32e332){var _0x466d63={},_0x4a4f00={},_0x223af0={'count':0x0,'rows':[]};var _0x46670a=_[_0x993e('0x2a')](db['WhatsappTransferReport'][_0x993e('0x2b')],function(_0x9e0309){return{'name':_0x9e0309[_0x993e('0x2c')],'type':_0x9e0309[_0x993e('0x2d')][_0x993e('0x2e')]};});_0x4a4f00['model']=_[_0x993e('0x2a')](_0x46670a,'name');_0x4a4f00[_0x993e('0x2f')]=_['keys'](_0x48d457[_0x993e('0x2f')]);_0x4a4f00['filters']=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],_0x4a4f00[_0x993e('0x2f')]);_0x466d63[_0x993e('0x32')]=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],qs['fields'](_0x48d457[_0x993e('0x2f')]['fields']));_0x466d63['attributes']=_0x466d63[_0x993e('0x32')]['length']?_0x466d63[_0x993e('0x32')]:_0x4a4f00[_0x993e('0x31')];if(!_0x48d457[_0x993e('0x2f')][_0x993e('0x33')](_0x993e('0x34'))){_0x466d63[_0x993e('0x1f')]=qs[_0x993e('0x1f')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1f')]);_0x466d63[_0x993e('0x1d')]=qs[_0x993e('0x1d')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1d')]);}_0x466d63[_0x993e('0x35')]=qs[_0x993e('0x36')](_0x48d457['query'][_0x993e('0x36')]);_0x466d63[_0x993e('0x37')]=qs[_0x993e('0x38')](_[_0x993e('0x39')](_0x48d457[_0x993e('0x2f')],_0x4a4f00[_0x993e('0x38')]),_0x46670a);if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]){_0x466d63[_0x993e('0x37')]=_['merge'](_0x466d63[_0x993e('0x37')],{'$or':_['map'](_0x46670a,function(_0xf79f29){if(_0xf79f29[_0x993e('0x2d')]!==_0x993e('0x3b')){var _0x406f14={};_0x406f14[_0xf79f29[_0x993e('0x28')]]={'$like':'%'+_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]+'%'};return _0x406f14;}})});}_0x466d63=_[_0x993e('0x3c')]({},_0x466d63,_0x48d457['options']);var _0x186d55={'where':_0x466d63['where']};return db[_0x993e('0x3d')]['count'](_0x186d55)[_0x993e('0x25')](function(_0xbd9983){_0x223af0[_0x993e('0x20')]=_0xbd9983;if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3e')]){_0x466d63[_0x993e('0x3f')]=[{'all':!![]}];}return db[_0x993e('0x3d')][_0x993e('0x40')](_0x466d63);})['then'](function(_0xe64c){_0x223af0['rows']=_0xe64c;return _0x223af0;})['then'](respondWithFilteredResult(_0x32e332,_0x466d63))[_0x993e('0x41')](handleError(_0x32e332,null));};exports[_0x993e('0x42')]=function(_0x1f058f,_0x5ed497){var _0x620b26={'raw':!![],'where':{'id':_0x1f058f[_0x993e('0x43')]['id']}},_0x40719d={};_0x40719d['model']=_['keys'](db['WhatsappTransferReport'][_0x993e('0x2b')]);_0x40719d[_0x993e('0x2f')]=_[_0x993e('0x44')](_0x1f058f['query']);_0x40719d[_0x993e('0x38')]=_[_0x993e('0x30')](_0x40719d['model'],_0x40719d[_0x993e('0x2f')]);_0x620b26[_0x993e('0x32')]=_['intersection'](_0x40719d[_0x993e('0x31')],qs[_0x993e('0x45')](_0x1f058f[_0x993e('0x2f')]['fields']));_0x620b26['attributes']=_0x620b26['attributes'][_0x993e('0x46')]?_0x620b26[_0x993e('0x32')]:_0x40719d[_0x993e('0x31')];if(_0x1f058f[_0x993e('0x2f')]['includeAll']){_0x620b26[_0x993e('0x3f')]=[{'all':!![]}];}_0x620b26=_[_0x993e('0x3c')]({},_0x620b26,_0x1f058f[_0x993e('0x47')]);return db[_0x993e('0x3d')][_0x993e('0x48')](_0x620b26)[_0x993e('0x25')](handleEntityNotFound(_0x5ed497,null))['then'](respondWithResult(_0x5ed497,null))['catch'](handleError(_0x5ed497,null));};exports[_0x993e('0x49')]=function(_0x416f9f,_0x4d560d){return db['WhatsappTransferReport'][_0x993e('0x49')](_0x416f9f[_0x993e('0x4a')],{})[_0x993e('0x25')](respondWithResult(_0x4d560d,0xc9))[_0x993e('0x41')](handleError(_0x4d560d,null));};exports[_0x993e('0x4b')]=function(_0x256ce3,_0x5b18e3){if(_0x256ce3[_0x993e('0x4a')]['id']){delete _0x256ce3['body']['id'];}return db[_0x993e('0x3d')][_0x993e('0x48')]({'where':{'id':_0x256ce3[_0x993e('0x43')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x5b18e3,null))[_0x993e('0x25')](saveUpdates(_0x256ce3[_0x993e('0x4a')],null))[_0x993e('0x25')](respondWithResult(_0x5b18e3,null))[_0x993e('0x41')](handleError(_0x5b18e3,null));};exports['destroy']=function(_0x23f09c,_0x66ee65){return db[_0x993e('0x3d')]['find']({'where':{'id':_0x23f09c[_0x993e('0x43')]['id']}})['then'](handleEntityNotFound(_0x66ee65,null))[_0x993e('0x25')](removeEntity(_0x66ee65,null))[_0x993e('0x41')](handleError(_0x66ee65,null));};exports['describe']=function(_0xb2508b,_0xef78a1){return db['WhatsappTransferReport'][_0x993e('0x4c')]()[_0x993e('0x25')](respondWithResult(_0xef78a1,null))[_0x993e('0x41')](handleError(_0xef78a1,null));}; \ No newline at end of file +var _0x38d1=['hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','WhatsappTransferReport','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x5b5222,_0x4d32e7){var _0x1cbd04=function(_0x5b7840){while(--_0x5b7840){_0x5b5222['push'](_0x5b5222['shift']());}};_0x1cbd04(++_0x4d32e7);}(_0x38d1,0xf2));var _0x138d=function(_0x13bd25,_0x1b060a){_0x13bd25=_0x13bd25-0x0;var _0x220c94=_0x38d1[_0x13bd25];return _0x220c94;};'use strict';var emlformat=require(_0x138d('0x0'));var rimraf=require(_0x138d('0x1'));var zipdir=require(_0x138d('0x2'));var jsonpatch=require(_0x138d('0x3'));var rp=require('request-promise');var moment=require(_0x138d('0x4'));var BPromise=require(_0x138d('0x5'));var Mustache=require('mustache');var util=require(_0x138d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x138d('0x7'));var _=require(_0x138d('0x8'));var squel=require(_0x138d('0x9'));var crypto=require(_0x138d('0xa'));var jsforce=require(_0x138d('0xb'));var deskjs=require(_0x138d('0xc'));var toCsv=require(_0x138d('0xd'));var querystring=require('querystring');var Papa=require(_0x138d('0xe'));var Redis=require('ioredis');var authService=require(_0x138d('0xf'));var qs=require(_0x138d('0x10'));var as=require(_0x138d('0x11'));var hardwareService=require(_0x138d('0x12'));var logger=require(_0x138d('0x13'))(_0x138d('0x14'));var utils=require(_0x138d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x138d('0x16'))['db'];function respondWithStatusCode(_0x1c0d9e,_0x47f8af){_0x47f8af=_0x47f8af||0xcc;return function(_0x5af189){if(_0x5af189){return _0x1c0d9e[_0x138d('0x17')](_0x47f8af);}return _0x1c0d9e[_0x138d('0x18')](_0x47f8af)[_0x138d('0x19')]();};}function respondWithResult(_0x1ab99f,_0x9734ad){_0x9734ad=_0x9734ad||0xc8;return function(_0x52c707){if(_0x52c707){return _0x1ab99f[_0x138d('0x18')](_0x9734ad)['json'](_0x52c707);}};}function respondWithFilteredResult(_0x2d6460,_0x5b1218){return function(_0xd398f7){if(_0xd398f7){var _0x267649=typeof _0x5b1218[_0x138d('0x1a')]===_0x138d('0x1b')&&typeof _0x5b1218[_0x138d('0x1c')]===_0x138d('0x1b');var _0x16df80=_0xd398f7[_0x138d('0x1d')];var _0x2510e6=_0x267649?0x0:_0x5b1218[_0x138d('0x1a')];var _0x22b3cf=_0x267649?_0xd398f7[_0x138d('0x1d')]:_0x5b1218[_0x138d('0x1a')]+_0x5b1218[_0x138d('0x1c')];var _0x420e10;if(_0x22b3cf>=_0x16df80){_0x22b3cf=_0x16df80;_0x420e10=0xc8;}else{_0x420e10=0xce;}_0x2d6460['status'](_0x420e10);return _0x2d6460[_0x138d('0x1e')](_0x138d('0x1f'),_0x2510e6+'-'+_0x22b3cf+'/'+_0x16df80)[_0x138d('0x20')](_0xd398f7);}return null;};}function patchUpdates(_0x188959){return function(_0x953aca){try{jsonpatch[_0x138d('0x21')](_0x953aca,_0x188959,!![]);}catch(_0x4598c6){return BPromise['reject'](_0x4598c6);}return _0x953aca['save']();};}function saveUpdates(_0x15b22f,_0x381e72){return function(_0x744f3){if(_0x744f3){return _0x744f3[_0x138d('0x22')](_0x15b22f)['then'](function(_0x588e57){return _0x588e57;});}return null;};}function removeEntity(_0x5b7906,_0xf5797c){return function(_0x1b27a9){if(_0x1b27a9){return _0x1b27a9[_0x138d('0x23')]()[_0x138d('0x24')](function(){_0x5b7906['status'](0xcc)[_0x138d('0x19')]();});}};}function handleEntityNotFound(_0x5b7346,_0x143ba1){return function(_0x1a2db2){if(!_0x1a2db2){_0x5b7346[_0x138d('0x17')](0x194);}return _0x1a2db2;};}function handleError(_0x5e6be7,_0x4ec0df){_0x4ec0df=_0x4ec0df||0x1f4;return function(_0x5714f3){logger[_0x138d('0x25')](_0x5714f3[_0x138d('0x26')]);if(_0x5714f3[_0x138d('0x27')]){delete _0x5714f3[_0x138d('0x27')];}_0x5e6be7[_0x138d('0x18')](_0x4ec0df)['send'](_0x5714f3);};}exports[_0x138d('0x28')]=function(_0x85f7b,_0x4fcd0c){var _0x2b0c8b={},_0x2668d8={},_0x421a0={'count':0x0,'rows':[]};var _0x28b120=_[_0x138d('0x29')](db['WhatsappTransferReport'][_0x138d('0x2a')],function(_0x87b99f){return{'name':_0x87b99f[_0x138d('0x2b')],'type':_0x87b99f[_0x138d('0x2c')][_0x138d('0x2d')]};});_0x2668d8[_0x138d('0x2e')]=_[_0x138d('0x29')](_0x28b120,'name');_0x2668d8[_0x138d('0x2f')]=_[_0x138d('0x30')](_0x85f7b[_0x138d('0x2f')]);_0x2668d8[_0x138d('0x31')]=_[_0x138d('0x32')](_0x2668d8[_0x138d('0x2e')],_0x2668d8[_0x138d('0x2f')]);_0x2b0c8b['attributes']=_['intersection'](_0x2668d8[_0x138d('0x2e')],qs[_0x138d('0x33')](_0x85f7b[_0x138d('0x2f')][_0x138d('0x33')]));_0x2b0c8b[_0x138d('0x34')]=_0x2b0c8b[_0x138d('0x34')][_0x138d('0x35')]?_0x2b0c8b[_0x138d('0x34')]:_0x2668d8[_0x138d('0x2e')];if(!_0x85f7b['query'][_0x138d('0x36')](_0x138d('0x37'))){_0x2b0c8b[_0x138d('0x1c')]=qs[_0x138d('0x1c')](_0x85f7b[_0x138d('0x2f')][_0x138d('0x1c')]);_0x2b0c8b['offset']=qs[_0x138d('0x1a')](_0x85f7b[_0x138d('0x2f')][_0x138d('0x1a')]);}_0x2b0c8b[_0x138d('0x38')]=qs['sort'](_0x85f7b[_0x138d('0x2f')][_0x138d('0x39')]);_0x2b0c8b[_0x138d('0x3a')]=qs[_0x138d('0x31')](_['pick'](_0x85f7b['query'],_0x2668d8[_0x138d('0x31')]),_0x28b120);if(_0x85f7b['query']['filter']){_0x2b0c8b['where']=_[_0x138d('0x3b')](_0x2b0c8b[_0x138d('0x3a')],{'$or':_['map'](_0x28b120,function(_0x46c6b9){if(_0x46c6b9['type']!==_0x138d('0x3c')){var _0x2c7db5={};_0x2c7db5[_0x46c6b9[_0x138d('0x27')]]={'$like':'%'+_0x85f7b[_0x138d('0x2f')][_0x138d('0x3d')]+'%'};return _0x2c7db5;}})});}_0x2b0c8b=_[_0x138d('0x3b')]({},_0x2b0c8b,_0x85f7b[_0x138d('0x3e')]);var _0x75ce4d={'where':_0x2b0c8b[_0x138d('0x3a')]};return db['WhatsappTransferReport'][_0x138d('0x1d')](_0x75ce4d)[_0x138d('0x24')](function(_0x161635){_0x421a0[_0x138d('0x1d')]=_0x161635;if(_0x85f7b[_0x138d('0x2f')][_0x138d('0x3f')]){_0x2b0c8b[_0x138d('0x40')]=[{'all':!![]}];}return db[_0x138d('0x41')][_0x138d('0x42')](_0x2b0c8b);})[_0x138d('0x24')](function(_0x3165db){_0x421a0[_0x138d('0x43')]=_0x3165db;return _0x421a0;})[_0x138d('0x24')](respondWithFilteredResult(_0x4fcd0c,_0x2b0c8b))['catch'](handleError(_0x4fcd0c,null));};exports['show']=function(_0x12898f,_0x37efe1){var _0x5c84c8={'raw':!![],'where':{'id':_0x12898f[_0x138d('0x44')]['id']}},_0x3d092b={};_0x3d092b['model']=_[_0x138d('0x30')](db[_0x138d('0x41')][_0x138d('0x2a')]);_0x3d092b[_0x138d('0x2f')]=_[_0x138d('0x30')](_0x12898f[_0x138d('0x2f')]);_0x3d092b[_0x138d('0x31')]=_['intersection'](_0x3d092b[_0x138d('0x2e')],_0x3d092b[_0x138d('0x2f')]);_0x5c84c8[_0x138d('0x34')]=_[_0x138d('0x32')](_0x3d092b[_0x138d('0x2e')],qs[_0x138d('0x33')](_0x12898f[_0x138d('0x2f')][_0x138d('0x33')]));_0x5c84c8[_0x138d('0x34')]=_0x5c84c8['attributes'][_0x138d('0x35')]?_0x5c84c8[_0x138d('0x34')]:_0x3d092b[_0x138d('0x2e')];if(_0x12898f[_0x138d('0x2f')][_0x138d('0x3f')]){_0x5c84c8[_0x138d('0x40')]=[{'all':!![]}];}_0x5c84c8=_['merge']({},_0x5c84c8,_0x12898f[_0x138d('0x3e')]);return db[_0x138d('0x41')][_0x138d('0x45')](_0x5c84c8)[_0x138d('0x24')](handleEntityNotFound(_0x37efe1,null))[_0x138d('0x24')](respondWithResult(_0x37efe1,null))[_0x138d('0x46')](handleError(_0x37efe1,null));};exports[_0x138d('0x47')]=function(_0x4e3c7d,_0x5d6544){return db[_0x138d('0x41')][_0x138d('0x47')](_0x4e3c7d[_0x138d('0x48')],{})['then'](respondWithResult(_0x5d6544,0xc9))[_0x138d('0x46')](handleError(_0x5d6544,null));};exports[_0x138d('0x22')]=function(_0x498cc7,_0x2d29ea){if(_0x498cc7['body']['id']){delete _0x498cc7[_0x138d('0x48')]['id'];}return db[_0x138d('0x41')][_0x138d('0x45')]({'where':{'id':_0x498cc7['params']['id']}})[_0x138d('0x24')](handleEntityNotFound(_0x2d29ea,null))[_0x138d('0x24')](saveUpdates(_0x498cc7[_0x138d('0x48')],null))[_0x138d('0x24')](respondWithResult(_0x2d29ea,null))[_0x138d('0x46')](handleError(_0x2d29ea,null));};exports['destroy']=function(_0x14ee8d,_0x293ba6){return db[_0x138d('0x41')][_0x138d('0x45')]({'where':{'id':_0x14ee8d[_0x138d('0x44')]['id']}})[_0x138d('0x24')](handleEntityNotFound(_0x293ba6,null))['then'](removeEntity(_0x293ba6,null))[_0x138d('0x46')](handleError(_0x293ba6,null));};exports['describe']=function(_0x23575e,_0x44f64f){return db[_0x138d('0x41')][_0x138d('0x49')]()[_0x138d('0x24')](respondWithResult(_0x44f64f,null))[_0x138d('0x46')](handleError(_0x44f64f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 32619ac..7f69ebb 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 _0x819d=['../../config/logger','bluebird','path','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x12a045,_0x557056){var _0x5b3a5e=function(_0x578299){while(--_0x578299){_0x12a045['push'](_0x12a045['shift']());}};_0x5b3a5e(++_0x557056);}(_0x819d,0xc5));var _0xd819=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x819d[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd819('0x0'));var util=require('util');var logger=require(_0xd819('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd819('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd819('0x3'));var rimraf=require('rimraf');var config=require(_0xd819('0x4'));var attributes=require(_0xd819('0x5'));module[_0xd819('0x6')]=function(_0x245630,_0x2cbe56){return _0x245630['define']('WhatsappTransferReport',attributes,{'tableName':_0xd819('0x7'),'paranoid':![],'indexes':[{'name':_0xd819('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xca7c=['api','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger'];(function(_0x32ba14,_0x1d6c10){var _0x557f35=function(_0x5199f7){while(--_0x5199f7){_0x32ba14['push'](_0x32ba14['shift']());}};_0x557f35(++_0x1d6c10);}(_0xca7c,0x111));var _0xcca7=function(_0x24295f,_0x29d5dd){_0x24295f=_0x24295f-0x0;var _0x4202ae=_0xca7c[_0x24295f];return _0x4202ae;};'use strict';var _=require(_0xcca7('0x0'));var util=require('util');var logger=require(_0xcca7('0x1'))(_0xcca7('0x2'));var moment=require('moment');var BPromise=require(_0xcca7('0x3'));var rp=require(_0xcca7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcca7('0x5'));var attributes=require(_0xcca7('0x6'));module[_0xcca7('0x7')]=function(_0x52ddd4,_0x203bd7){return _0x52ddd4['define'](_0xcca7('0x8'),attributes,{'tableName':_0xcca7('0x9'),'paranoid':![],'indexes':[{'name':_0xcca7('0xa'),'fields':[_0xcca7('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 c12ef8d..4203244 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 _0xc729=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xc782ea,_0x403582){var _0x16d7c2=function(_0x25d47c){while(--_0x25d47c){_0xc782ea['push'](_0xc782ea['shift']());}};_0x16d7c2(++_0x403582);}(_0xc729,0x1a5));var _0x9c72=function(_0x4c3267,_0xf2b77){_0x4c3267=_0x4c3267-0x0;var _0xfa5c9=_0xc729[_0x4c3267];return _0xfa5c9;};'use strict';var _=require(_0x9c72('0x0'));var util=require(_0x9c72('0x1'));var moment=require('moment');var BPromise=require(_0x9c72('0x2'));var rs=require(_0x9c72('0x3'));var fs=require('fs');var Redis=require(_0x9c72('0x4'));var db=require(_0x9c72('0x5'))['db'];var utils=require(_0x9c72('0x6'));var logger=require(_0x9c72('0x7'))(_0x9c72('0x8'));var config=require(_0x9c72('0x9'));var jayson=require(_0x9c72('0xa'));var client=jayson[_0x9c72('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x393093,_0xdb1a2f,_0x169070){return new BPromise(function(_0x2ff140,_0x6f98b4){return client['request'](_0x393093,_0x169070)[_0x9c72('0xc')](function(_0x3d3203){logger[_0x9c72('0xd')](_0x9c72('0xe'),_0xdb1a2f,_0x9c72('0xf'));logger[_0x9c72('0x10')](_0x9c72('0x11'),_0xdb1a2f,_0x9c72('0xf'),JSON[_0x9c72('0x12')](_0x3d3203));if(_0x3d3203[_0x9c72('0x13')]){if(_0x3d3203[_0x9c72('0x13')]['code']===0x1f4){logger[_0x9c72('0x13')](_0x9c72('0xe'),_0xdb1a2f,_0x3d3203[_0x9c72('0x13')][_0x9c72('0x14')]);return _0x6f98b4(_0x3d3203[_0x9c72('0x13')][_0x9c72('0x14')]);}logger[_0x9c72('0x13')](_0x9c72('0xe'),_0xdb1a2f,_0x3d3203[_0x9c72('0x13')][_0x9c72('0x14')]);return _0x2ff140(_0x3d3203[_0x9c72('0x13')]['message']);}else{logger['info'](_0x9c72('0xe'),_0xdb1a2f,_0x9c72('0xf'));_0x2ff140(_0x3d3203[_0x9c72('0x15')][_0x9c72('0x14')]);}})[_0x9c72('0x16')](function(_0x5e2bda){logger[_0x9c72('0x13')](_0x9c72('0xe'),_0xdb1a2f,_0x5e2bda);_0x6f98b4(_0x5e2bda);});});} \ No newline at end of file +var _0x46e2=['then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x50c4a6,_0x53186f){var _0x4832c2=function(_0x4fe943){while(--_0x4fe943){_0x50c4a6['push'](_0x50c4a6['shift']());}};_0x4832c2(++_0x53186f);}(_0x46e2,0x9b));var _0x246e=function(_0x2991e3,_0x18b578){_0x2991e3=_0x2991e3-0x0;var _0x533719=_0x46e2[_0x2991e3];return _0x533719;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require('moment');var BPromise=require(_0x246e('0x2'));var rs=require(_0x246e('0x3'));var fs=require('fs');var Redis=require(_0x246e('0x4'));var db=require(_0x246e('0x5'))['db'];var utils=require(_0x246e('0x6'));var logger=require(_0x246e('0x7'))(_0x246e('0x8'));var config=require('../../config/environment');var jayson=require(_0x246e('0x9'));var client=jayson[_0x246e('0xa')][_0x246e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45e01b,_0x43c79f,_0x4d4e5e){return new BPromise(function(_0x27cb11,_0x22a850){return client[_0x246e('0xc')](_0x45e01b,_0x4d4e5e)[_0x246e('0xd')](function(_0x8edd8e){logger[_0x246e('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x43c79f,'request\x20sent');logger[_0x246e('0xf')](_0x246e('0x10'),_0x43c79f,'request\x20sent',JSON[_0x246e('0x11')](_0x8edd8e));if(_0x8edd8e[_0x246e('0x12')]){if(_0x8edd8e[_0x246e('0x12')][_0x246e('0x13')]===0x1f4){logger[_0x246e('0x12')](_0x246e('0x14'),_0x43c79f,_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);return _0x22a850(_0x8edd8e[_0x246e('0x12')]['message']);}logger[_0x246e('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x43c79f,_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);return _0x27cb11(_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);}else{logger[_0x246e('0xe')](_0x246e('0x14'),_0x43c79f,_0x246e('0x16'));_0x27cb11(_0x8edd8e[_0x246e('0x17')][_0x246e('0x15')]);}})['catch'](function(_0x3b4553){logger['error'](_0x246e('0x14'),_0x43c79f,_0x3b4553);_0x22a850(_0x3b4553);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index eb61de6..7d98ded 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5508=['info','start','Online\x20apps:','online','name','join','map','filter','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen'];(function(_0x420a56,_0x45c974){var _0x19dc8d=function(_0x4027a5){while(--_0x4027a5){_0x420a56['push'](_0x420a56['shift']());}};_0x19dc8d(++_0x45c974);}(_0x5508,0xa6));var _0x8550=function(_0x122c87,_0x16bd54){_0x122c87=_0x122c87-0x0;var _0x1a6e8a=_0x5508[_0x122c87];return _0x1a6e8a;};'use strict';var _=require(_0x8550('0x0'));var mysqldb=require(_0x8550('0x1'));var rpc=require(_0x8550('0x2'));var config=require(_0x8550('0x3'));var logger=require(_0x8550('0x4'))(_0x8550('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x8550('0x6'));var schedule=require('./config/schedule');var chat=require(_0x8550('0x7'));var whatsapp=require(_0x8550('0x8'));var transcribe=require(_0x8550('0x9'));function main(){return mysqldb['db'][_0x8550('0xa')][_0x8550('0xb')]()[_0x8550('0xc')](function(){return rpc[_0x8550('0xd')]();})[_0x8550('0xc')](function(_0x256ee5){logger[_0x8550('0xe')](_0x256ee5);return chat[_0x8550('0xf')]();})[_0x8550('0xc')](function(){return whatsapp[_0x8550('0xf')]();})[_0x8550('0xc')](function(){return schedule['start']();})[_0x8550('0xc')](function(){return transcribe[_0x8550('0xf')]();})[_0x8550('0xc')](function(_0x1e823f){logger[_0x8550('0xe')](_0x1e823f);return pm2['start'](pm2Config);})[_0x8550('0xc')](function(_0x46569f){logger['info'](_0x8550('0x10'),_['map'](_['filter'](_0x46569f,{'status':_0x8550('0x11')}),_0x8550('0x12'))[_0x8550('0x13')]());logger[_0x8550('0xe')]('Offline\x20apps:',_[_0x8550('0x14')](_[_0x8550('0x15')](_0x46569f,function(_0x4d3a3e){return _0x4d3a3e[_0x8550('0x16')]!==_0x8550('0x11');}),_0x8550('0x12'))[_0x8550('0x13')]()||_0x8550('0x17'));config[_0x8550('0x18')]&&require(_0x8550('0x19'))[_0x8550('0x1a')]();require(_0x8550('0x1b'))[_0x8550('0x1a')]();})[_0x8550('0x1c')](function(_0x58c2f7){logger[_0x8550('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x58c2f7);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xae1a=['./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','name','Offline\x20apps:','online','join','./config/seedDB','default','./config/license','catch','error','exit','lodash','./mysqldb','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp'];(function(_0x3b298c,_0xecc0a){var _0xcead0d=function(_0x108c09){while(--_0x108c09){_0x3b298c['push'](_0x3b298c['shift']());}};_0xcead0d(++_0xecc0a);}(_0xae1a,0x166));var _0xaae1=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xae1a[_0x543084];return _0x306a57;};'use strict';var _=require(_0xaae1('0x0'));var mysqldb=require(_0xaae1('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require(_0xaae1('0x2'));var pm2Config=require(_0xaae1('0x3'));var schedule=require('./config/schedule');var chat=require(_0xaae1('0x4'));var whatsapp=require(_0xaae1('0x5'));var transcribe=require(_0xaae1('0x6'));function main(){return mysqldb['db'][_0xaae1('0x7')][_0xaae1('0x8')]()[_0xaae1('0x9')](function(){return rpc[_0xaae1('0xa')]();})[_0xaae1('0x9')](function(_0x59c7e2){logger[_0xaae1('0xb')](_0x59c7e2);return chat[_0xaae1('0xc')]();})['then'](function(){return whatsapp['start']();})[_0xaae1('0x9')](function(){return schedule[_0xaae1('0xc')]();})[_0xaae1('0x9')](function(){return transcribe[_0xaae1('0xc')]();})[_0xaae1('0x9')](function(_0x57201d){logger[_0xaae1('0xb')](_0x57201d);return pm2[_0xaae1('0xc')](pm2Config);})[_0xaae1('0x9')](function(_0x183832){logger[_0xaae1('0xb')](_0xaae1('0xd'),_[_0xaae1('0xe')](_[_0xaae1('0xf')](_0x183832,{'status':'online'}),_0xaae1('0x10'))['join']());logger['info'](_0xaae1('0x11'),_['map'](_[_0xaae1('0xf')](_0x183832,function(_0x4744e0){return _0x4744e0['status']!==_0xaae1('0x12');}),'name')[_0xaae1('0x13')]()||'None');config['seedDB']&&require(_0xaae1('0x14'))[_0xaae1('0x15')]();require(_0xaae1('0x16'))[_0xaae1('0x15')]();})[_0xaae1('0x17')](function(_0x50fd34){logger[_0xaae1('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x50fd34);process[_0xaae1('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e31b031..6cb0193 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 _0xc539=['phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','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.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','getUuid','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secrets','options','verify','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay'];(function(_0x453342,_0x4a8d76){var _0x397416=function(_0xf56776){while(--_0xf56776){_0x453342['push'](_0x453342['shift']());}};_0x397416(++_0x4a8d76);}(_0xc539,0xe8));var _0x9c53=function(_0x33beb4,_0xc125cb){_0x33beb4=_0x33beb4-0x0;var _0x4da4f2=_0xc539[_0x33beb4];return _0x4da4f2;};'use strict';var db=require(_0x9c53('0x0'))['db'];var config=require(_0x9c53('0x1'));var hardwareConf=require(_0x9c53('0x2'));var licenseUtil=require(_0x9c53('0x3'));var encryptor=require(_0x9c53('0x4'));var _=require(_0x9c53('0x5'));var jwt=require(_0x9c53('0x6'));var expressJwt=require('express-jwt');var compose=require(_0x9c53('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0x9c53('0x8'));var BPromise=require(_0x9c53('0x9'));var util=require(_0x9c53('0xa'));var moment=require(_0x9c53('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x9c53('0xc')]});var userAttributes=['id',_0x9c53('0xd'),_0x9c53('0xe'),_0x9c53('0xf'),_0x9c53('0x10'),_0x9c53('0x11'),_0x9c53('0x12'),_0x9c53('0x13'),_0x9c53('0x14'),'voicePause',_0x9c53('0x15'),'mailPause',_0x9c53('0x16'),'smsPause',_0x9c53('0x17'),_0x9c53('0x18'),'showWebBar',_0x9c53('0x19'),_0x9c53('0x1a'),_0x9c53('0x1b'),_0x9c53('0x1c'),_0x9c53('0x1d'),'alias',_0x9c53('0x1e'),_0x9c53('0x1f'),_0x9c53('0x20'),_0x9c53('0x21'),'phoneBarEnableDtmfTone',_0x9c53('0x22'),'phoneBarExpires',_0x9c53('0x23'),_0x9c53('0x24'),_0x9c53('0x25'),'hotdesk',_0x9c53('0x26'),_0x9c53('0x27'),_0x9c53('0x28'),_0x9c53('0x29'),'wssPort','downloadVoiceRecordings',_0x9c53('0x2a'),_0x9c53('0x2b'),_0x9c53('0x2c'),_0x9c53('0x2d')];exports[_0x9c53('0x2e')]=function(){return this['isAuthenticated'](!![])[_0x9c53('0x2f')](function(_0x413095,_0x347be5,_0x2adff2){if(_0x413095[_0x9c53('0x30')]){_0x2adff2();}else{return db[_0x9c53('0x31')][_0x9c53('0x32')]({'where':{'id':_0x413095[_0x9c53('0x33')]['id']},'attributes':['id',_0x9c53('0x34'),_0x9c53('0x35')],'raw':!![]})[_0x9c53('0x36')](function(_0x12173e){if(_0x12173e&&_0x12173e['closed']){return _0x347be5[_0x9c53('0x37')](_0x12173e[_0x9c53('0x35')]===_0x9c53('0x38')?0x195:0x193)[_0x9c53('0x39')]({'message':_0x12173e['disposition']==='unmanaged'?_0x9c53('0x3a'):_0x9c53('0x3b')});}else{_0x2adff2();}})['catch'](function(_0xd78b0){_0x2adff2(_0xd78b0);});}});};exports[_0x9c53('0x3c')]=function isAuthenticated(_0x5ac47a){return compose()[_0x9c53('0x2f')](function(_0x320691,_0x102039,_0xbb4a6d){var _0x33753d;if(_0x320691[_0x9c53('0x3d')][_0x9c53('0x3e')]){if(_[_0x9c53('0x3f')](_0x320691[_0x9c53('0x3d')][_0x9c53('0x3e')],_0x9c53('0x40'))){var _0x104170=basicAuth(_0x320691);db[_0x9c53('0x41')][_0x9c53('0x42')]({'where':{'name':_0x104170[_0x9c53('0xf')]}})[_0x9c53('0x36')](function(_0xcaf9fc){if(!_0xcaf9fc||!_0xcaf9fc[_0x9c53('0x43')](_0x104170[_0x9c53('0x44')])){return _0x102039[_0x9c53('0x37')](0x191)[_0x9c53('0x39')]({'message':_0x9c53('0x45')});}_0x320691[_0x9c53('0x30')]={'id':_0xcaf9fc['id']};_0xbb4a6d();})[_0x9c53('0x46')](function(_0x5f4d0b){_0xbb4a6d(_0x5f4d0b);});}else if(_[_0x9c53('0x3f')](_0x320691[_0x9c53('0x3d')][_0x9c53('0x3e')],'Bearer')){validateJwt(_0x320691,_0x102039,_0xbb4a6d);}else{if(_0x5ac47a){_0xbb4a6d();}else{return _0x102039['status'](0x193)['json']({'message':_0x9c53('0x47')});}}}else if(_0x320691[_0x9c53('0x48')][_0x9c53('0x49')]){try{var _0x3cc0ea={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x320691[_0x9c53('0x48')][_0x9c53('0x49')],_0x3cc0ea)[_0x9c53('0x36')](function(_0x3a50da){return db['User']['find']({'where':{'id':_0x3a50da[_0x9c53('0x4a')]}})[_0x9c53('0x36')](function(_0x25b3a4){_0x33753d=_0x25b3a4;return db[_0x9c53('0x4b')]['findOne']({'where':{'id':0x1},'attributes':[_0x9c53('0x4c'),_0x9c53('0x4d')],'raw':!![]});})['then'](function(_0x85c357){if(!_0x33753d||!_['isEqual'](_0x33753d[_0x9c53('0x4e')],_0x3a50da[_0x9c53('0x4f')])){return _0x102039[_0x9c53('0x37')](0x191)[_0x9c53('0x39')]({'message':_0x9c53('0x50')});}if(_0x33753d[_0x9c53('0x51')]){return _0x102039['status'](0x191)['json']({'message':_0x9c53('0x52')});}if(_0x33753d[_0x9c53('0x53')]){if(_0x85c357[_0x9c53('0x4d')]>0x0){if(moment(_0x33753d[_0x9c53('0x54')])[_0x9c53('0x55')](_0x85c357[_0x9c53('0x4d')],_0x9c53('0x56'))>moment()){return _0x102039['status'](0x191)[_0x9c53('0x39')]({'message':_0x9c53('0x52')});}}else{return _0x102039['status'](0x191)[_0x9c53('0x39')]({'message':_0x9c53('0x52')});}}_0x320691['user']={'id':_0x33753d['id']};_0xbb4a6d();});})[_0x9c53('0x46')](function(){return _0x102039[_0x9c53('0x37')](0x191)[_0x9c53('0x39')]({'message':_0x9c53('0x52')});});}catch(_0x30b507){_0xbb4a6d(_0x30b507);}}else if(_0x5ac47a){_0xbb4a6d();}else{return _0x102039['status'](0x193)[_0x9c53('0x39')]({'message':_0x9c53('0x47')});}})['use'](function(_0x485159,_0x5b12bd,_0x208588){if(_0x485159[_0x9c53('0x30')]){db[_0x9c53('0x41')][_0x9c53('0x42')]({'where':{'id':_0x485159[_0x9c53('0x30')]['id']},'attributes':userAttributes})[_0x9c53('0x36')](function(_0x28c223){if(!_0x28c223){return _0x5b12bd['status'](0x194)[_0x9c53('0x39')]({'message':_0x9c53('0x57')});}_0x485159[_0x9c53('0x30')]=_0x28c223;_0x208588();})[_0x9c53('0x46')](function(_0x33015d){_0x208588(_0x33015d);});}else if(_0x5ac47a){_0x208588();}else{return _0x5b12bd[_0x9c53('0x37')](0x194)[_0x9c53('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x9c53('0x2f')](function(_0x38c886,_0x3482bb,_0x3b378c){return licenseUtil[_0x9c53('0x58')]()[_0x9c53('0x36')](function(_0x4a6572){if(_0x4a6572[_0x9c53('0x59')]){_0x3b378c();}else{return _0x3482bb[_0x9c53('0x37')](0x193)[_0x9c53('0x39')]({'message':_0x9c53('0x5a')});}})[_0x9c53('0x46')](function(_0xd75146){_0x3b378c(_0xd75146);});});};exports[_0x9c53('0x5b')]=function(_0x5f2368,_0x48c397,_0x57e791){_0x5f2368[_0x9c53('0x5b')]=!![];return _0x57e791();};exports[_0x9c53('0x5c')]=function signToken(_0x4c1537){return signJwt(_0x4c1537);};exports[_0x9c53('0x5d')]=function(_0x40a76f,_0x151fd4){if(!_0x40a76f[_0x9c53('0x30')]){return _0x151fd4[_0x9c53('0x37')](0x194)[_0x9c53('0x39')]({'message':_0x9c53('0x5e')});}var _0x501900={'payload':{'id':_0x40a76f[_0x9c53('0x30')]['id'],'role':_0x40a76f[_0x9c53('0x30')][_0x9c53('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x501900)[_0x9c53('0x36')](function(_0x46a25f){_0x151fd4[_0x9c53('0x5f')](_0x9c53('0x60'),_0x46a25f);_0x151fd4[_0x9c53('0x61')](_0x9c53('0x62'));})[_0x9c53('0x46')](function(_0x289a15){return _0x151fd4[_0x9c53('0x37')](0x1f4)[_0x9c53('0x63')](_0x289a15);});};exports[_0x9c53('0x64')]=function(_0x11e54b){if(_['isNil'](_0x11e54b['apiKeyNonce'])||_[_0x9c53('0x65')](_0x11e54b['apiKeyIat'])){return null;}else{return createJwt(_0x11e54b);}};exports[_0x9c53('0x66')]=function(_0x5a87c6){_0x5a87c6['apiKeyNonce']=generateNonce();_0x5a87c6[_0x9c53('0x67')]=generateIssuedAt();return createJwt(_0x5a87c6);};exports[_0x9c53('0x68')]=function(_0x2f6c99,_0x1ffa57){var _0x4a5b6c=_0x2f6c99['query'][_0x9c53('0x49')];if(_0x4a5b6c){var _0x100809={'nonce':_0x1ffa57[_0x9c53('0x4e')],'iat':_0x1ffa57['apiKeyIat'],'audience':hardwareConf[_0x9c53('0x69')](),'issuer':hardwareConf[_0x9c53('0x69')]()};return verifyJwt(_0x4a5b6c,_0x100809)[_0x9c53('0x36')](function(){return generateApiKey(_0x1ffa57);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x9c53('0x6a')]=function(_0x5ce123){var _0x5404a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5404a9[_0x9c53('0x6b')](_0x5ce123))throw new db[(_0x9c53('0x6c'))][(_0x9c53('0x6d'))](_0x9c53('0x6e'));return;};exports[_0x9c53('0x6f')]=function(_0x10af16,_0x4c92a9,_0x1ceb6a){var _0x3eeafc=encryptor['decryptString'](_0x4c92a9)[_0x9c53('0x70')](',');for(var _0x31cf0e=0x0;_0x31cf0e<_0x1ceb6a;_0x31cf0e++){if(!_0x3eeafc[_0x31cf0e])break;if(_0x10af16[_0x9c53('0x71')]()===_0x3eeafc[_0x31cf0e][_0x9c53('0x71')]()){var _0x1a04c4=util[_0x9c53('0x72')](_0x9c53('0x73'),_0x1ceb6a);if(_0x1ceb6a===0x1){_0x1a04c4=_0x9c53('0x74');}throw new db[(_0x9c53('0x6c'))]['ValidationError'](_0x1a04c4);}}return;};exports[_0x9c53('0x75')]=function(_0x4b1722,_0x321f13){var _0xe32191=_0x321f13?encryptor['decryptString'](_0x321f13)[_0x9c53('0x70')](','):[];if(_0xe32191[_0x9c53('0x76')]===0x5){_0xe32191[_0x9c53('0x77')](-0x1,0x1);}_0xe32191[_0x9c53('0x78')](_0x4b1722);return encryptor[_0x9c53('0x79')](_0xe32191[_0x9c53('0x7a')](','));};function signJwt(_0xc9d8d0){var _0x1fd623=BPromise[_0x9c53('0x7b')](jwt['sign'],{'context':jwt});var _0x30f4c6=_0xc9d8d0['secret']||config[_0x9c53('0x7c')]['session'];return new BPromise(function(_0x30d3b8,_0x292452){_0x1fd623(_0xc9d8d0['payload'],_0x30f4c6,_0xc9d8d0[_0x9c53('0x7d')])[_0x9c53('0x36')](function(_0x3def81){_0x30d3b8(_0x3def81);})[_0x9c53('0x46')](function(_0x3dc05b){_0x292452(_0x3dc05b);});});}function verifyJwt(_0x861c43,_0x5de42a,_0x19dda9){var _0x3e7175=BPromise[_0x9c53('0x7b')](jwt[_0x9c53('0x7e')],{'context':jwt});var _0x1b1ddc=_0x19dda9||config[_0x9c53('0x7c')][_0x9c53('0xc')];return new BPromise(function(_0x208748,_0x5d4003){_0x3e7175(_0x861c43,_0x1b1ddc,_0x5de42a)['then'](function(_0x4a30f0){_0x208748(_0x4a30f0);})[_0x9c53('0x46')](function(_0x5ca940){_0x5d4003(_0x5ca940);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x9c53('0x7f'));}function generateIssuedAt(){return Math[_0x9c53('0x80')](Date[_0x9c53('0x81')]()/0x3e8)[_0x9c53('0x82')]();}function createJwt(_0x1a0b72){var _0xfda790={'payload':{'iat':_0x1a0b72[_0x9c53('0x67')],'nonce':_0x1a0b72[_0x9c53('0x4e')]},'options':{'algorithm':_0x9c53('0x83'),'subject':_0x1a0b72['id']['toString'](),'issuer':hardwareConf[_0x9c53('0x69')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xfda790)['then'](function(_0x21df4f){return{'iat':_0x1a0b72[_0x9c53('0x67')],'nonce':_0x1a0b72['apiKeyNonce'],'token':_0x21df4f};});} \ No newline at end of file +var _0x44ca=['toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','use','params','closed','status','disposition','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','name','then','authenticate','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','findOne','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockDuration','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','apiKeyNonce','apiKeyIat','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','promisify','sign','secret','options','randomBytes','floor','now'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x44ca,0x7b));var _0xa44c=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x44ca[_0x562faf];return _0x22c1f6;};'use strict';var db=require(_0xa44c('0x0'))['db'];var config=require(_0xa44c('0x1'));var hardwareConf=require(_0xa44c('0x2'));var licenseUtil=require(_0xa44c('0x3'));var encryptor=require(_0xa44c('0x4'));var _=require(_0xa44c('0x5'));var jwt=require(_0xa44c('0x6'));var expressJwt=require(_0xa44c('0x7'));var compose=require(_0xa44c('0x8'));var basicAuth=require(_0xa44c('0x9'));var crypto=require(_0xa44c('0xa'));var BPromise=require(_0xa44c('0xb'));var util=require('util');var moment=require(_0xa44c('0xc'));var validateJwt=expressJwt({'secret':config[_0xa44c('0xd')][_0xa44c('0xe')]});var userAttributes=['id','role','fullname','name',_0xa44c('0xf'),_0xa44c('0x10'),'userpic',_0xa44c('0x11'),_0xa44c('0x12'),_0xa44c('0x13'),_0xa44c('0x14'),'mailPause',_0xa44c('0x15'),_0xa44c('0x16'),_0xa44c('0x17'),_0xa44c('0x18'),_0xa44c('0x19'),_0xa44c('0x1a'),_0xa44c('0x1b'),'crudPermissions',_0xa44c('0x1c'),_0xa44c('0x1d'),_0xa44c('0x1e'),_0xa44c('0x1f'),'phoneBarAutoAnswerDelay',_0xa44c('0x20'),_0xa44c('0x21'),'phoneBarEnableDtmfTone',_0xa44c('0x22'),_0xa44c('0x23'),'phoneBarPrefixRequired',_0xa44c('0x24'),'phoneBarRemoteControlPort','hotdesk',_0xa44c('0x25'),_0xa44c('0x26'),'privacyEnabled',_0xa44c('0x27'),_0xa44c('0x28'),_0xa44c('0x29'),_0xa44c('0x2a'),_0xa44c('0x2b'),'ignorePauseForPreviewCalls',_0xa44c('0x2c')];exports[_0xa44c('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xa44c('0x2e')](function(_0x540789,_0x5184f0,_0x217095){if(_0x540789['user']){_0x217095();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x540789[_0xa44c('0x2f')]['id']},'attributes':['id',_0xa44c('0x30'),'disposition'],'raw':!![]})['then'](function(_0x4712d2){if(_0x4712d2&&_0x4712d2[_0xa44c('0x30')]){return _0x5184f0[_0xa44c('0x31')](_0x4712d2[_0xa44c('0x32')]==='unmanaged'?0x195:0x193)[_0xa44c('0x33')]({'message':_0x4712d2[_0xa44c('0x32')]==='unmanaged'?_0xa44c('0x34'):_0xa44c('0x35')});}else{_0x217095();}})[_0xa44c('0x36')](function(_0x203b69){_0x217095(_0x203b69);});}});};exports[_0xa44c('0x37')]=function isAuthenticated(_0x49535c){return compose()[_0xa44c('0x2e')](function(_0x47e994,_0x3c6dab,_0x698129){var _0x447ae6;if(_0x47e994[_0xa44c('0x38')][_0xa44c('0x39')]){if(_[_0xa44c('0x3a')](_0x47e994[_0xa44c('0x38')][_0xa44c('0x39')],_0xa44c('0x3b'))){var _0x48f053=basicAuth(_0x47e994);db['User'][_0xa44c('0x3c')]({'where':{'name':_0x48f053[_0xa44c('0x3d')]}})[_0xa44c('0x3e')](function(_0x4dae8b){if(!_0x4dae8b||!_0x4dae8b[_0xa44c('0x3f')](_0x48f053['pass'])){return _0x3c6dab[_0xa44c('0x31')](0x191)['json']({'message':_0xa44c('0x40')});}_0x47e994[_0xa44c('0x41')]={'id':_0x4dae8b['id']};_0x698129();})[_0xa44c('0x36')](function(_0xaa9b7a){_0x698129(_0xaa9b7a);});}else if(_[_0xa44c('0x3a')](_0x47e994[_0xa44c('0x38')][_0xa44c('0x39')],_0xa44c('0x42'))){validateJwt(_0x47e994,_0x3c6dab,_0x698129);}else{if(_0x49535c){_0x698129();}else{return _0x3c6dab[_0xa44c('0x31')](0x193)[_0xa44c('0x33')]({'message':_0xa44c('0x43')});}}}else if(_0x47e994[_0xa44c('0x44')][_0xa44c('0x45')]){try{var _0x5e1dc8={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xa44c('0x46')]()};verifyJwt(_0x47e994[_0xa44c('0x44')][_0xa44c('0x45')],_0x5e1dc8)[_0xa44c('0x3e')](function(_0x53a1fd){return db[_0xa44c('0x47')][_0xa44c('0x3c')]({'where':{'id':_0x53a1fd[_0xa44c('0x48')]}})[_0xa44c('0x3e')](function(_0x4f5426){_0x447ae6=_0x4f5426;return db[_0xa44c('0x49')][_0xa44c('0x4a')]({'where':{'id':0x1},'attributes':[_0xa44c('0x4b'),'blockDuration'],'raw':!![]});})['then'](function(_0x2f6d98){if(!_0x447ae6||!_[_0xa44c('0x4c')](_0x447ae6['apiKeyNonce'],_0x53a1fd['nonce'])){return _0x3c6dab[_0xa44c('0x31')](0x191)[_0xa44c('0x33')]({'message':_0xa44c('0x4d')});}if(_0x447ae6[_0xa44c('0x4e')]){return _0x3c6dab['status'](0x191)[_0xa44c('0x33')]({'message':_0xa44c('0x4f')});}if(_0x447ae6['blocked']){if(_0x2f6d98[_0xa44c('0x50')]>0x0){if(moment(_0x447ae6['blockedAt'])['add'](_0x2f6d98[_0xa44c('0x50')],'minutes')>moment()){return _0x3c6dab[_0xa44c('0x31')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3c6dab[_0xa44c('0x31')](0x191)[_0xa44c('0x33')]({'message':_0xa44c('0x4f')});}}_0x47e994['user']={'id':_0x447ae6['id']};_0x698129();});})[_0xa44c('0x36')](function(){return _0x3c6dab[_0xa44c('0x31')](0x191)[_0xa44c('0x33')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1522cc){_0x698129(_0x1522cc);}}else if(_0x49535c){_0x698129();}else{return _0x3c6dab[_0xa44c('0x31')](0x193)[_0xa44c('0x33')]({'message':'Unknown\x20authorization\x20format'});}})[_0xa44c('0x2e')](function(_0x4a7e34,_0x236f59,_0x577fcb){if(_0x4a7e34[_0xa44c('0x41')]){db['User'][_0xa44c('0x3c')]({'where':{'id':_0x4a7e34[_0xa44c('0x41')]['id']},'attributes':userAttributes})[_0xa44c('0x3e')](function(_0x1471c3){if(!_0x1471c3){return _0x236f59[_0xa44c('0x31')](0x194)[_0xa44c('0x33')]({'message':_0xa44c('0x51')});}_0x4a7e34[_0xa44c('0x41')]=_0x1471c3;_0x577fcb();})[_0xa44c('0x36')](function(_0x1d5f16){_0x577fcb(_0x1d5f16);});}else if(_0x49535c){_0x577fcb();}else{return _0x236f59[_0xa44c('0x31')](0x194)[_0xa44c('0x33')]({'message':_0xa44c('0x52')});}});};exports[_0xa44c('0x53')]=function canUpdate(){return compose()[_0xa44c('0x2e')](function(_0xe7021b,_0x94493d,_0x2a5380){return licenseUtil[_0xa44c('0x54')]()[_0xa44c('0x3e')](function(_0x48586b){if(_0x48586b[_0xa44c('0x55')]){_0x2a5380();}else{return _0x94493d[_0xa44c('0x31')](0x193)[_0xa44c('0x33')]({'message':'Forbidden'});}})[_0xa44c('0x36')](function(_0x4ef558){_0x2a5380(_0x4ef558);});});};exports[_0xa44c('0x56')]=function(_0x318116,_0x3f0968,_0x5408b6){_0x318116[_0xa44c('0x56')]=!![];return _0x5408b6();};exports[_0xa44c('0x57')]=function signToken(_0xa0e40a){return signJwt(_0xa0e40a);};exports[_0xa44c('0x58')]=function(_0x38c719,_0x12723d){if(!_0x38c719[_0xa44c('0x41')]){return _0x12723d[_0xa44c('0x31')](0x194)[_0xa44c('0x33')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x55de22={'payload':{'id':_0x38c719[_0xa44c('0x41')]['id'],'role':_0x38c719['user'][_0xa44c('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0x55de22)[_0xa44c('0x3e')](function(_0x572cf7){_0x12723d[_0xa44c('0x5a')](_0xa44c('0x5b'),_0x572cf7);_0x12723d[_0xa44c('0x5c')](_0xa44c('0x5d'));})[_0xa44c('0x36')](function(_0x149f4f){return _0x12723d[_0xa44c('0x31')](0x1f4)['send'](_0x149f4f);});};exports[_0xa44c('0x5e')]=function(_0x213253){if(_['isNil'](_0x213253[_0xa44c('0x5f')])||_['isNil'](_0x213253[_0xa44c('0x60')])){return null;}else{return createJwt(_0x213253);}};exports['generateApiKey']=function(_0x5c23cd){_0x5c23cd[_0xa44c('0x5f')]=generateNonce();_0x5c23cd[_0xa44c('0x60')]=generateIssuedAt();return createJwt(_0x5c23cd);};exports['regenerateApiKey']=function(_0xf00899,_0x44fc28){var _0x3ddd5e=_0xf00899['query']['apikey'];if(_0x3ddd5e){var _0x3b22a2={'nonce':_0x44fc28[_0xa44c('0x5f')],'iat':_0x44fc28[_0xa44c('0x60')],'audience':hardwareConf[_0xa44c('0x46')](),'issuer':hardwareConf[_0xa44c('0x46')]()};return verifyJwt(_0x3ddd5e,_0x3b22a2)[_0xa44c('0x3e')](function(){return generateApiKey(_0x44fc28);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa44c('0x61')]=function(_0x150bab){var _0x37de6c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x37de6c[_0xa44c('0x62')](_0x150bab))throw new db[(_0xa44c('0x63'))][(_0xa44c('0x64'))](_0xa44c('0x65'));return;};exports[_0xa44c('0x66')]=function(_0x1ce4c3,_0x2b0f50,_0x34a9bd){var _0x169b7a=encryptor[_0xa44c('0x67')](_0x2b0f50)[_0xa44c('0x68')](',');for(var _0x44ceb9=0x0;_0x44ceb9<_0x34a9bd;_0x44ceb9++){if(!_0x169b7a[_0x44ceb9])break;if(_0x1ce4c3[_0xa44c('0x69')]()===_0x169b7a[_0x44ceb9][_0xa44c('0x69')]()){var _0x36b81f=util[_0xa44c('0x6a')](_0xa44c('0x6b'),_0x34a9bd);if(_0x34a9bd===0x1){_0x36b81f=_0xa44c('0x6c');}throw new db[(_0xa44c('0x63'))][(_0xa44c('0x64'))](_0x36b81f);}}return;};exports[_0xa44c('0x6d')]=function(_0x30889c,_0x4b508e){var _0x291708=_0x4b508e?encryptor[_0xa44c('0x67')](_0x4b508e)[_0xa44c('0x68')](','):[];if(_0x291708[_0xa44c('0x6e')]===0x5){_0x291708[_0xa44c('0x6f')](-0x1,0x1);}_0x291708['unshift'](_0x30889c);return encryptor['encryptString'](_0x291708['join'](','));};function signJwt(_0x1f2867){var _0x26b108=BPromise[_0xa44c('0x70')](jwt[_0xa44c('0x71')],{'context':jwt});var _0x4381dd=_0x1f2867[_0xa44c('0x72')]||config[_0xa44c('0xd')]['session'];return new BPromise(function(_0x4ab77c,_0x16c465){_0x26b108(_0x1f2867['payload'],_0x4381dd,_0x1f2867[_0xa44c('0x73')])['then'](function(_0x1bf4a8){_0x4ab77c(_0x1bf4a8);})['catch'](function(_0x44b692){_0x16c465(_0x44b692);});});}function verifyJwt(_0x3a3a2c,_0x1b488d,_0x5e29a9){var _0x58f762=BPromise[_0xa44c('0x70')](jwt['verify'],{'context':jwt});var _0x5f883a=_0x5e29a9||config[_0xa44c('0xd')]['session'];return new BPromise(function(_0x19af66,_0x988f6f){_0x58f762(_0x3a3a2c,_0x5f883a,_0x1b488d)[_0xa44c('0x3e')](function(_0x2db08c){_0x19af66(_0x2db08c);})[_0xa44c('0x36')](function(_0x47215e){_0x988f6f(_0x47215e);});});}function generateNonce(){return crypto[_0xa44c('0x74')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xa44c('0x75')](Date[_0xa44c('0x76')]()/0x3e8)[_0xa44c('0x77')]();}function createJwt(_0x391b57){var _0xa16f8c={'payload':{'iat':_0x391b57[_0xa44c('0x60')],'nonce':_0x391b57[_0xa44c('0x5f')]},'options':{'algorithm':_0xa44c('0x78'),'subject':_0x391b57['id'][_0xa44c('0x77')](),'issuer':hardwareConf[_0xa44c('0x46')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xa16f8c)[_0xa44c('0x3e')](function(_0x23b4f8){return{'iat':_0x391b57[_0xa44c('0x60')],'nonce':_0x391b57[_0xa44c('0x5f')],'token':_0x23b4f8};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 22d3d99..7d1417e 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 _0xcf47=['createReadStream','data','binary','write','end','decryptFile','createWriteStream','update','close','unlink','createCipher','utf8','base64','decryptString','secret','final','crypto','lodash','../../config/environment','../../config/logger','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty'];(function(_0x56ee72,_0x4e5ebe){var _0x541cb9=function(_0x3006c8){while(--_0x3006c8){_0x56ee72['push'](_0x56ee72['shift']());}};_0x541cb9(++_0x4e5ebe);}(_0xcf47,0x190));var _0x7cf4=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0xcf47[_0x209581];return _0x2fed45;};'use strict';var crypto=require(_0x7cf4('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x7cf4('0x1'));var config=require(_0x7cf4('0x2'));var logger=require(_0x7cf4('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x7cf4('0x4')};const fileOptions={'algorithm':_0x7cf4('0x5')};if(config[_0x7cf4('0x6')]&&config['encrypt'][_0x7cf4('0x7')]){var isSupported=isAlgorithmSupported(config[_0x7cf4('0x6')][_0x7cf4('0x7')]);if(isSupported){fileOptions[_0x7cf4('0x7')]=config[_0x7cf4('0x6')][_0x7cf4('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7cf4('0x8')](',\x20');logger[_0x7cf4('0x9')](config[_0x7cf4('0x6')][_0x7cf4('0x7')],_0x7cf4('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x5c8952){return AES_SUPPORTED_RX[_0x7cf4('0xb')](_0x5c8952);}function getSupportedCiphers(){return crypto[_0x7cf4('0xc')]()[_0x7cf4('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x318996){return getSupportedCiphers()[_0x7cf4('0xe')](_0x318996)>-0x1;}function combineOptions(_0x4759cf){var _0x17b257={};for(var _0x5e7836 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5e7836)){_0x17b257[_0x5e7836]=fileOptions[_0x5e7836];}}if(_0x4759cf){for(var _0x275af4 in _0x4759cf){if(_0x4759cf[_0x7cf4('0xf')](_0x275af4)){_0x17b257[_0x275af4]=_0x4759cf[_0x275af4];}}}return _0x17b257;}exports['encryptFile']=function(_0x650056,_0x1c3c97,_0x87bd16,_0x438ef8){return new BPromise(function(_0x46f72f,_0x314b59){_0x438ef8=combineOptions(_0x438ef8);var _0x2861e9=new Buffer(_0x87bd16);var _0x26dd9f=fs[_0x7cf4('0x10')](_0x650056);var _0x18a4e9=fs['createWriteStream'](_0x1c3c97);var _0x4e9981=crypto['createCipher'](_0x438ef8[_0x7cf4('0x7')],_0x2861e9);_0x26dd9f['on'](_0x7cf4('0x11'),function(_0xcee185){var _0x363d4a=new Buffer(_0x4e9981['update'](_0xcee185),_0x7cf4('0x12'));_0x18a4e9[_0x7cf4('0x13')](_0x363d4a);});_0x26dd9f['on'](_0x7cf4('0x14'),function(){try{var _0x30701a=new Buffer(_0x4e9981['final'](_0x7cf4('0x12')),_0x7cf4('0x12'));_0x18a4e9[_0x7cf4('0x13')](_0x30701a);_0x18a4e9[_0x7cf4('0x14')]();_0x18a4e9['on']('close',function(){return _0x46f72f(_0x1c3c97);});}catch(_0x556a0d){fs['unlink'](_0x1c3c97);return _0x314b59(_0x556a0d);}});});};exports[_0x7cf4('0x15')]=function(_0x2fee92,_0x38b27d,_0x5f0fe1,_0x44e384){return new BPromise(function(_0x5eb8f7,_0x4f29f5){_0x44e384=combineOptions(_0x44e384);var _0x18a6d3=new Buffer(_0x5f0fe1);var _0x4013b9=fs[_0x7cf4('0x10')](_0x2fee92);var _0x4e2c59=fs[_0x7cf4('0x16')](_0x38b27d);var _0x5d0b3a=crypto['createDecipher'](_0x44e384[_0x7cf4('0x7')],_0x18a6d3);_0x4013b9['on'](_0x7cf4('0x11'),function(_0x15f9bd){var _0x1ef4b7=new Buffer(_0x5d0b3a[_0x7cf4('0x17')](_0x15f9bd),_0x7cf4('0x12'));_0x4e2c59[_0x7cf4('0x13')](_0x1ef4b7);});_0x4013b9['on'](_0x7cf4('0x14'),function(){try{var _0x48df8e=new Buffer(_0x5d0b3a['final'](_0x7cf4('0x12')),_0x7cf4('0x12'));_0x4e2c59['write'](_0x48df8e);_0x4e2c59[_0x7cf4('0x14')]();_0x4e2c59['on'](_0x7cf4('0x18'),function(){return _0x5eb8f7(_0x38b27d);});}catch(_0x1dd88b){fs[_0x7cf4('0x19')](_0x38b27d);return _0x4f29f5(_0x1dd88b);}});});};exports['encryptString']=function(_0x2be2b8,_0x3e3dd0,_0x26e758){var _0x3693a9=_0x26e758||stringOptions[_0x7cf4('0x7')];var _0x53c1e0=_0x3e3dd0||stringOptions['secret'];var _0x146004=crypto[_0x7cf4('0x1a')](_0x3693a9,_0x53c1e0);var _0x239cef=_0x146004[_0x7cf4('0x17')](_0x2be2b8,_0x7cf4('0x1b'),'base64');_0x239cef+=_0x146004['final'](_0x7cf4('0x1c'));return _0x239cef;};exports[_0x7cf4('0x1d')]=function(_0x595c9a,_0x506351,_0x58324f){var _0x449125=_0x58324f||stringOptions['algorithm'];var _0x3f6496=_0x506351||stringOptions[_0x7cf4('0x1e')];var _0x5ca6c0=crypto['createDecipher'](_0x449125,_0x3f6496);var _0xbe55f0=_0x5ca6c0[_0x7cf4('0x17')](_0x595c9a,_0x7cf4('0x1c'),_0x7cf4('0x1b'));_0xbe55f0+=_0x5ca6c0[_0x7cf4('0x1f')](_0x7cf4('0x1b'));return _0xbe55f0;}; \ No newline at end of file +var _0x3740=['error','test','getCiphers','hasOwnProperty','encryptFile','createWriteStream','createCipher','update','binary','write','end','final','unlink','decryptFile','data','close','secret','utf8','base64','decryptString','createDecipher','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','join'];(function(_0x3ecaff,_0x51198f){var _0x1b1993=function(_0x2c4323){while(--_0x2c4323){_0x3ecaff['push'](_0x3ecaff['shift']());}};_0x1b1993(++_0x51198f);}(_0x3740,0x1d7));var _0x0374=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x3740[_0x580d0e];return _0xb51111;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x0374('0x0'));var config=require(_0x0374('0x1'));var logger=require(_0x0374('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0374('0x3')][_0x0374('0x4')],'algorithm':_0x0374('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x0374('0x6')]&&config[_0x0374('0x6')][_0x0374('0x7')]){var isSupported=isAlgorithmSupported(config[_0x0374('0x6')][_0x0374('0x7')]);if(isSupported){fileOptions[_0x0374('0x7')]=config[_0x0374('0x6')][_0x0374('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0374('0x8')](',\x20');logger[_0x0374('0x9')](config[_0x0374('0x6')][_0x0374('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x16d75e){return AES_SUPPORTED_RX[_0x0374('0xa')](_0x16d75e);}function getSupportedCiphers(){return crypto[_0x0374('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x3860d4){return getSupportedCiphers()['indexOf'](_0x3860d4)>-0x1;}function combineOptions(_0x1e5622){var _0x415a5a={};for(var _0x1d9088 in fileOptions){if(fileOptions[_0x0374('0xc')](_0x1d9088)){_0x415a5a[_0x1d9088]=fileOptions[_0x1d9088];}}if(_0x1e5622){for(var _0x456fb4 in _0x1e5622){if(_0x1e5622[_0x0374('0xc')](_0x456fb4)){_0x415a5a[_0x456fb4]=_0x1e5622[_0x456fb4];}}}return _0x415a5a;}exports[_0x0374('0xd')]=function(_0x36eb44,_0x34b302,_0x1f8988,_0x339dbd){return new BPromise(function(_0x4bc691,_0x2f6069){_0x339dbd=combineOptions(_0x339dbd);var _0x110236=new Buffer(_0x1f8988);var _0x51bf19=fs['createReadStream'](_0x36eb44);var _0x4ddacf=fs[_0x0374('0xe')](_0x34b302);var _0x4ecea4=crypto[_0x0374('0xf')](_0x339dbd[_0x0374('0x7')],_0x110236);_0x51bf19['on']('data',function(_0x4db3f7){var _0x269086=new Buffer(_0x4ecea4[_0x0374('0x10')](_0x4db3f7),_0x0374('0x11'));_0x4ddacf[_0x0374('0x12')](_0x269086);});_0x51bf19['on'](_0x0374('0x13'),function(){try{var _0x48ad53=new Buffer(_0x4ecea4[_0x0374('0x14')](_0x0374('0x11')),_0x0374('0x11'));_0x4ddacf[_0x0374('0x12')](_0x48ad53);_0x4ddacf[_0x0374('0x13')]();_0x4ddacf['on']('close',function(){return _0x4bc691(_0x34b302);});}catch(_0x73cf37){fs[_0x0374('0x15')](_0x34b302);return _0x2f6069(_0x73cf37);}});});};exports[_0x0374('0x16')]=function(_0x5e7c76,_0x1f12c1,_0x5a5afb,_0x3e8c6b){return new BPromise(function(_0x8192a0,_0x13459b){_0x3e8c6b=combineOptions(_0x3e8c6b);var _0x2dcfe9=new Buffer(_0x5a5afb);var _0x41545c=fs['createReadStream'](_0x5e7c76);var _0x4ee9ee=fs[_0x0374('0xe')](_0x1f12c1);var _0x581da3=crypto['createDecipher'](_0x3e8c6b[_0x0374('0x7')],_0x2dcfe9);_0x41545c['on'](_0x0374('0x17'),function(_0x46a77a){var _0x394348=new Buffer(_0x581da3[_0x0374('0x10')](_0x46a77a),_0x0374('0x11'));_0x4ee9ee[_0x0374('0x12')](_0x394348);});_0x41545c['on'](_0x0374('0x13'),function(){try{var _0x5986d=new Buffer(_0x581da3[_0x0374('0x14')](_0x0374('0x11')),'binary');_0x4ee9ee['write'](_0x5986d);_0x4ee9ee[_0x0374('0x13')]();_0x4ee9ee['on'](_0x0374('0x18'),function(){return _0x8192a0(_0x1f12c1);});}catch(_0x1c8adf){fs['unlink'](_0x1f12c1);return _0x13459b(_0x1c8adf);}});});};exports['encryptString']=function(_0x400e87,_0x5ad6bf,_0x2e0428){var _0x4ffba9=_0x2e0428||stringOptions[_0x0374('0x7')];var _0x164751=_0x5ad6bf||stringOptions[_0x0374('0x19')];var _0x418330=crypto[_0x0374('0xf')](_0x4ffba9,_0x164751);var _0x148532=_0x418330[_0x0374('0x10')](_0x400e87,_0x0374('0x1a'),_0x0374('0x1b'));_0x148532+=_0x418330[_0x0374('0x14')](_0x0374('0x1b'));return _0x148532;};exports[_0x0374('0x1c')]=function(_0x1427d6,_0x3c868b,_0x5cf272){var _0xe0a205=_0x5cf272||stringOptions[_0x0374('0x7')];var _0x541d13=_0x3c868b||stringOptions[_0x0374('0x19')];var _0x288c6a=crypto[_0x0374('0x1d')](_0xe0a205,_0x541d13);var _0x48e571=_0x288c6a['update'](_0x1427d6,_0x0374('0x1b'),_0x0374('0x1a'));_0x48e571+=_0x288c6a[_0x0374('0x14')]('utf8');return _0x48e571;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 19b1abb..5b6b6d9 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 _0x360d=['%s.%s','csv','writeFileSync','zip','zip\x20finished','Completed','catch','inspect','finally','exit','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x360d,0xfa));var _0xd360=function(_0x11adbd,_0x5055f5){_0x11adbd=_0x11adbd-0x0;var _0x270029=_0x360d[_0x11adbd];return _0x270029;};'use strict';var util=require(_0xd360('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xd360('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xd360('0x2'));var rimraf=require(_0xd360('0x3'));var db=require(_0xd360('0x4'))['db'];var dbH=require(_0xd360('0x4'))[_0xd360('0x5')];var logger=require(_0xd360('0x6'))(_0xd360('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xd360('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd360('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xeb519f,_0x46c15b){var _0x542b1a={'status':_0xeb519f};var _0x4259fe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x46c15b){_0x542b1a['savename']=_0x46c15b;}return db[_0xd360('0x9')]['update'](_0x542b1a,_0x4259fe);}function main(){var _0x1d847d=0x1388;var _0x1a9344;logger[_0xd360('0xa')](util[_0xd360('0xb')](_0xd360('0xc'),EXTRACTED_REPORT_ID,_0xd360('0xd')));return db[_0xd360('0xe')][_0xd360('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd360('0x10'),'splitSizeCsv']})['then'](function(_0x135768){if(_0x135768){_0x1a9344=_0x135768;_0x1d847d=_0x1a9344[_0xd360('0x11')]||0x1388;}})[_0xd360('0x12')](function(){return dbH[_0xd360('0x13')][_0xd360('0x14')](util[_0xd360('0xb')](_0xd360('0x15'),QUERY),{'type':dbH['sequelize'][_0xd360('0x16')][_0xd360('0x17')]});})[_0xd360('0x12')](function(_0x4fe3a6){if(!_0x4fe3a6[0x0][_0xd360('0x18')]){return analyticExtractedReport(_0xd360('0x19'));}var _0x4759c9=[];var _0x387099=0x0;if(_0x1a9344[_0xd360('0x10')]){if(_0x4fe3a6&&_0x4fe3a6[_0xd360('0x1a')]){var _0x295cf8=_[_0xd360('0x1b')](_0x4fe3a6[0x0]['num']/_0x1d847d);var _0x484ac6=Number['isInteger'](_0x4fe3a6[0x0][_0xd360('0x18')]/_0x1d847d)?_0x4fe3a6[0x0][_0xd360('0x18')]%_0x1d847d:0x0;_0x295cf8[_0xd360('0x1c')](function(_0x36e86f){if(_0x36e86f>0x0){_0x387099+=_0x1d847d;}_0x4759c9[_0xd360('0x1d')](dbH[_0xd360('0x13')][_0xd360('0x14')](util[_0xd360('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1d847d,_0x387099),{'type':dbH[_0xd360('0x13')][_0xd360('0x16')][_0xd360('0x17')]}));});if(_0x484ac6>0x0){_0x387099+=_0x1d847d;_0x4759c9[_0xd360('0x1d')](dbH[_0xd360('0x13')][_0xd360('0x14')](util[_0xd360('0xb')](_0xd360('0x1e'),QUERY,_0x484ac6,_0x387099),{'type':dbH[_0xd360('0x13')]['QueryTypes'][_0xd360('0x17')]}));}}}else{_0x4759c9[_0xd360('0x1d')](dbH[_0xd360('0x13')][_0xd360('0x14')](QUERY,{'type':dbH[_0xd360('0x13')][_0xd360('0x16')]['SELECT']}));}var _0xcc1e56=path[_0xd360('0x1f')](PATH);var _0x124cfd=path[_0xd360('0x20')](PATH,'.csv');var _0x4ea6a1=_0x1a9344[_0xd360('0x10')]&&_0x4759c9[_0xd360('0x1a')]>0x1;var _0x48bd2c=[];if(!fs[_0xd360('0x21')](path[_0xd360('0x22')](_0xcc1e56,_0x124cfd))&&_0x4ea6a1){fs[_0xd360('0x23')](path[_0xd360('0x22')](_0xcc1e56,_0x124cfd));}return BPromise[_0xd360('0x24')](_0x4759c9,function(_0x447628){_0x48bd2c['push'](_0x447628);})[_0xd360('0x12')](function(){for(var _0x3f534d=0x0;_0x3f534d<_0x48bd2c[_0xd360('0x1a')];_0x3f534d+=0x1){var _0x499bc6;var _0x577df2=_0x48bd2c[_0x3f534d];if(_0x4ea6a1){_0x499bc6=path[_0xd360('0x22')](_0xcc1e56,_0x124cfd,util[_0xd360('0xb')](_0xd360('0x25'),_0x124cfd,_0x3f534d,'csv'));}else{_0x499bc6=path[_0xd360('0x22')](_0xcc1e56,util[_0xd360('0xb')](_0xd360('0x26'),_0x124cfd,_0xd360('0x27')));}fs[_0xd360('0x28')](_0x499bc6,csv(_0x577df2));}})[_0xd360('0x12')](function(){if(_0x4ea6a1){return new Promise(function(_0x3c5386){zipdir(path[_0xd360('0x22')](_0xcc1e56,_0x124cfd),{'saveTo':path['join'](_0xcc1e56,util[_0xd360('0xb')](_0xd360('0x26'),_0x124cfd,_0xd360('0x29')))},function(_0xe21d2d,_0x4aeb3e){rimraf(path[_0xd360('0x22')](_0xcc1e56,_0x124cfd),function(){});_0x3c5386(_0xd360('0x2a'));});});}})[_0xd360('0x12')](function(){logger['info'](util[_0xd360('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd360('0xd')));return analyticExtractedReport(_0xd360('0x2b'),_0x4ea6a1?util[_0xd360('0xb')](_0xd360('0x26'),_0x124cfd,_0x4ea6a1?'zip':'csv'):null);});})[_0xd360('0x2c')](function(_0x411d76){logger[_0xd360('0xa')](util[_0xd360('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd360('0xd')),util[_0xd360('0x2d')](_0x411d76,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xd360('0x2e')](function(){process[_0xd360('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0560=['range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','length'];(function(_0xd42273,_0x36641e){var _0x5444e8=function(_0x2b53b7){while(--_0x2b53b7){_0xd42273['push'](_0xd42273['shift']());}};_0x5444e8(++_0x36641e);}(_0x0560,0xd2));var _0x0056=function(_0x53da56,_0x5ae376){_0x53da56=_0x53da56-0x0;var _0x55f622=_0x0560[_0x53da56];return _0x55f622;};'use strict';var util=require(_0x0056('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x0056('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0x0056('0x2'));var db=require(_0x0056('0x3'))['db'];var dbH=require(_0x0056('0x3'))['dbH'];var logger=require(_0x0056('0x4'))(_0x0056('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x0056('0x6')][0x2]);var QUERY=process[_0x0056('0x6')][0x3];var PATH=process[_0x0056('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ea3a4,_0x4e5991){var _0x33b838={'status':_0x2ea3a4};var _0x599f7f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e5991){_0x33b838[_0x0056('0x7')]=_0x4e5991;}return db[_0x0056('0x8')][_0x0056('0x9')](_0x33b838,_0x599f7f);}function main(){var _0x54ecfc=0x1388;var _0x5dfe50;logger[_0x0056('0xa')](util[_0x0056('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0056('0xc')));return db[_0x0056('0xd')][_0x0056('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0056('0xf'),_0x0056('0x10')]})[_0x0056('0x11')](function(_0x5d69de){if(_0x5d69de){_0x5dfe50=_0x5d69de;_0x54ecfc=_0x5dfe50[_0x0056('0x10')]||0x1388;}})[_0x0056('0x11')](function(){return dbH['sequelize'][_0x0056('0x12')](util[_0x0056('0xb')](_0x0056('0x13'),QUERY),{'type':dbH[_0x0056('0x14')][_0x0056('0x15')]['SELECT']});})['then'](function(_0x3f9eae){if(!_0x3f9eae[0x0][_0x0056('0x16')]){return analyticExtractedReport(_0x0056('0x17'));}var _0xdd80c2=[];var _0x4ed1a8=0x0;if(_0x5dfe50['split']){if(_0x3f9eae&&_0x3f9eae[_0x0056('0x18')]){var _0x17fd49=_[_0x0056('0x19')](_0x3f9eae[0x0][_0x0056('0x16')]/_0x54ecfc);var _0x1f509f=Number['isInteger'](_0x3f9eae[0x0][_0x0056('0x16')]/_0x54ecfc)?_0x3f9eae[0x0][_0x0056('0x16')]%_0x54ecfc:0x0;_0x17fd49[_0x0056('0x1a')](function(_0x568647){if(_0x568647>0x0){_0x4ed1a8+=_0x54ecfc;}_0xdd80c2['push'](dbH[_0x0056('0x14')][_0x0056('0x12')](util[_0x0056('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x54ecfc,_0x4ed1a8),{'type':dbH['sequelize'][_0x0056('0x15')]['SELECT']}));});if(_0x1f509f>0x0){_0x4ed1a8+=_0x54ecfc;_0xdd80c2[_0x0056('0x1b')](dbH[_0x0056('0x14')][_0x0056('0x12')](util[_0x0056('0xb')](_0x0056('0x1c'),QUERY,_0x1f509f,_0x4ed1a8),{'type':dbH[_0x0056('0x14')][_0x0056('0x15')]['SELECT']}));}}}else{_0xdd80c2['push'](dbH[_0x0056('0x14')][_0x0056('0x12')](QUERY,{'type':dbH[_0x0056('0x14')][_0x0056('0x15')][_0x0056('0x1d')]}));}var _0x1c9c71=path['dirname'](PATH);var _0x5e09c4=path[_0x0056('0x1e')](PATH,_0x0056('0x1f'));var _0x52faf1=_0x5dfe50[_0x0056('0xf')]&&_0xdd80c2[_0x0056('0x18')]>0x1;var _0x4d9442=[];if(!fs[_0x0056('0x20')](path[_0x0056('0x21')](_0x1c9c71,_0x5e09c4))&&_0x52faf1){fs['mkdirSync'](path[_0x0056('0x21')](_0x1c9c71,_0x5e09c4));}return BPromise[_0x0056('0x22')](_0xdd80c2,function(_0x56672f){_0x4d9442[_0x0056('0x1b')](_0x56672f);})[_0x0056('0x11')](function(){for(var _0x2a6024=0x0;_0x2a6024<_0x4d9442[_0x0056('0x18')];_0x2a6024+=0x1){var _0x572bb2;var _0x348f0d=_0x4d9442[_0x2a6024];if(_0x52faf1){_0x572bb2=path[_0x0056('0x21')](_0x1c9c71,_0x5e09c4,util['format'](_0x0056('0x23'),_0x5e09c4,_0x2a6024,_0x0056('0x24')));}else{_0x572bb2=path[_0x0056('0x21')](_0x1c9c71,util['format'](_0x0056('0x25'),_0x5e09c4,_0x0056('0x24')));}fs[_0x0056('0x26')](_0x572bb2,csv(_0x348f0d));}})['then'](function(){if(_0x52faf1){return new Promise(function(_0x34feff){zipdir(path[_0x0056('0x21')](_0x1c9c71,_0x5e09c4),{'saveTo':path[_0x0056('0x21')](_0x1c9c71,util[_0x0056('0xb')]('%s.%s',_0x5e09c4,'zip'))},function(_0x47a0df,_0x480b9b){rimraf(path['join'](_0x1c9c71,_0x5e09c4),function(){});_0x34feff(_0x0056('0x27'));});});}})['then'](function(){logger[_0x0056('0xa')](util['format'](_0x0056('0x28'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x52faf1?util[_0x0056('0xb')]('%s.%s',_0x5e09c4,_0x52faf1?_0x0056('0x29'):'csv'):null);});})['catch'](function(_0x3790e0){logger[_0x0056('0xa')](util['format'](_0x0056('0x2a'),EXTRACTED_REPORT_ID,_0x0056('0xc')),util[_0x0056('0x2b')](_0x3790e0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0056('0x2c'));})[_0x0056('0x2d')](function(){process[_0x0056('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 688a905..604b51d 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 _0x0281=['createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','window','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','value','length','body','push','concat','chunk','keys','name','startDate','format','endDate','header','pageBreak','before','margin','landscape','footer','Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','existsSync','mkdirSync','join','flatten','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.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'];(function(_0xd4b1d5,_0x3ed95f){var _0x46a928=function(_0x2fed87){while(--_0x2fed87){_0xd4b1d5['push'](_0xd4b1d5['shift']());}};_0x46a928(++_0x3ed95f);}(_0x0281,0x11a));var _0x1028=function(_0x3361db,_0x4b4f9e){_0x3361db=_0x3361db-0x0;var _0x3f4a8b=_0x0281[_0x3361db];return _0x3f4a8b;};'use strict';var _=require(_0x1028('0x0'));var fs=require('fs');var util=require(_0x1028('0x1'));var path=require(_0x1028('0x2'));var moment=require(_0x1028('0x3'));var htmlToPdfmake=require(_0x1028('0x4'));var PdfPrinter=require(_0x1028('0x5'));var zipdir=require(_0x1028('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0x1028('0x7'))['JSDOM'];var window=new JSDOM('')[_0x1028('0x8')];var BPromise=require(_0x1028('0x9'));var db=require(_0x1028('0xa'))['db'];var dbH=require(_0x1028('0xa'))['dbH'];var logger=require(_0x1028('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x1028('0xc')][0x2]);var QUERY=process[_0x1028('0xc')][0x3];var PATH=process[_0x1028('0xc')][0x4];var NAME=process[_0x1028('0xc')][0x5];var FORMAT=_0x1028('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x29eff5,_0x34db8e){var _0x4e5e87={'status':_0x29eff5};var _0x1802d7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34db8e){_0x4e5e87[_0x1028('0xe')]=_0x34db8e;}return db['AnalyticExtractedReport'][_0x1028('0xf')](_0x4e5e87,_0x1802d7);}function getHeaders(_0x99a26c){return _[_0x1028('0x10')](_0x99a26c,function(_0xe4b22b){return{'text':_0xe4b22b,'style':_0x1028('0x11')};});}function getRows(_0xd86929,_0x5636b6){return _['map'](_0x5636b6,function(_0x362875){return _(_0x362875)['pick'](_0xd86929)[_0x1028('0x10')](function(_0x144e99){return _0x144e99?_[_0x1028('0x12')](_0x144e99):'';})[_0x1028('0x13')]();});}function createTable(_0x497aef,_0x10001f){var _0x36f00a={'widths':_['fill'](Array(_0x497aef[_0x1028('0x14')]),0x91),'heights':function(_0x4d4706){return _0x4d4706===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x575d73=getHeaders(_0x497aef);_0x36f00a[_0x1028('0x15')][_0x1028('0x16')](_0x575d73);var _0x14049d=getRows(_0x497aef,_0x10001f);_0x36f00a[_0x1028('0x15')]=_0x36f00a[_0x1028('0x15')][_0x1028('0x17')](_0x14049d);return _0x36f00a;}function createTables(_0x163702){var _0x36f089=[];var _0x473896=_[_0x1028('0x18')](Object[_0x1028('0x19')](_0x163702[0x0]),0x5);_0x473896['forEach'](function(_0x57a64d){_0x36f089[_0x1028('0x16')](createTable(_0x57a64d,_0x163702));});return _0x36f089;}function getPDFDocDefinition(_0x3d77ff){var _0x1e8036=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x1028('0x1a')],moment(EXTRACTED_REPORT[_0x1028('0x1b')])[_0x1028('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x1028('0x1d')])[_0x1028('0x1c')](FORMAT));var _0x398334=[];for(var _0x5dd07b=0x0;_0x5dd07b<_0x3d77ff[_0x1028('0x14')];_0x5dd07b++){var _0x115695=[];if(_0x5dd07b===0x0){_0x115695[_0x1028('0x16')]({'text':_0x1e8036,'style':_0x1028('0x1e')});}var _0x53f0f7={'table':_0x3d77ff[_0x5dd07b]};if(_0x5dd07b>0x0){_0x53f0f7[_0x1028('0x1f')]=_0x1028('0x20');_0x53f0f7[_0x1028('0x21')]=[0x0,0x46,0x0,0x0];}_0x115695['push'](_0x53f0f7);_0x398334[_0x1028('0x16')](_0x115695);}return{'pageSize':'A4','pageOrientation':_0x1028('0x22'),'content':_0x398334,'footer':function(_0x2ea8f6,_0xaa974b){return{'text':_0x2ea8f6['toString']()+'\x20/\x20'+_0xaa974b,'style':_0x1028('0x23')};},'defaultStyle':{'font':_0x1028('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1028('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3b6d7f){var _0x239d11=0x1388;var _0x63f9ce;if(!_0x3b6d7f[0x0][_0x1028('0x26')]){return analyticExtractedReport(_0x1028('0x27'));}return db[_0x1028('0x28')][_0x1028('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x2176f5){if(_0x2176f5){_0x63f9ce=_0x2176f5;_0x239d11=_0x63f9ce[_0x1028('0x2a')]||0x3e8;}})[_0x1028('0x2b')](function(){var _0x18698a=[];var _0x1b79c7=0x0;if(_0x63f9ce[_0x1028('0x2c')]){if(_0x3b6d7f&&_0x3b6d7f[_0x1028('0x14')]){var _0x5b7062=_[_0x1028('0x2d')](_0x3b6d7f[0x0][_0x1028('0x26')]/_0x239d11);var _0x2eea80=Number[_0x1028('0x2e')](_0x3b6d7f[0x0][_0x1028('0x26')]/_0x239d11)?_0x3b6d7f[0x0][_0x1028('0x26')]%_0x239d11:0x0;_0x5b7062[_0x1028('0x2f')](function(_0x289bb0){if(_0x289bb0>0x0){_0x1b79c7+=_0x239d11;}_0x18698a[_0x1028('0x16')](dbH[_0x1028('0x30')][_0x1028('0x31')](util[_0x1028('0x1c')](_0x1028('0x32'),QUERY,_0x239d11,_0x1b79c7),{'type':dbH[_0x1028('0x30')][_0x1028('0x33')][_0x1028('0x34')]}));});if(_0x2eea80>0x0){_0x1b79c7+=_0x239d11;_0x18698a[_0x1028('0x16')](dbH[_0x1028('0x30')][_0x1028('0x31')](util[_0x1028('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2eea80,_0x1b79c7),{'type':dbH[_0x1028('0x30')][_0x1028('0x33')]['SELECT']}));}}}else{_0x18698a['push'](dbH['sequelize'][_0x1028('0x31')](QUERY,{'type':dbH[_0x1028('0x30')][_0x1028('0x33')][_0x1028('0x34')]}));}var _0x188a1a=path[_0x1028('0x35')](PATH);var _0x40c9a2=path['basename'](PATH,'.pdf');var _0x51ae7f=_0x63f9ce[_0x1028('0x2c')]&&_0x18698a[_0x1028('0x14')]>0x1;var _0x35ee7e=[];if(!fs[_0x1028('0x36')](path['join'](_0x188a1a,_0x40c9a2))&&_0x51ae7f){fs[_0x1028('0x37')](path[_0x1028('0x38')](_0x188a1a,_0x40c9a2));}return BPromise['each'](_0x18698a,function(_0x386c78){_0x35ee7e[_0x1028('0x16')](_0x386c78);})[_0x1028('0x2b')](function(){var _0x5899c0=[];for(var _0x3500dc=0x0;_0x3500dc<_0x35ee7e[_0x1028('0x14')];_0x3500dc+=0x1){var _0x2a3d19=_0x35ee7e[_0x3500dc];var _0x8ba9c5=createTables(_[_0x1028('0x39')](_0x2a3d19));var _0x35bd56;var _0x2f78dc=getPDFDocDefinition(_0x8ba9c5);var _0x5428bb=getPDFPrinter();var _0x4e84ab=_0x5428bb['createPdfKitDocument'](_0x2f78dc);if(_0x51ae7f){_0x35bd56=path[_0x1028('0x38')](_0x188a1a,_0x40c9a2,util['format'](_0x1028('0x3a'),_0x40c9a2,_0x3500dc,'pdf'));}else{_0x35bd56=path['join'](_0x188a1a,util[_0x1028('0x1c')](_0x1028('0x3b'),_0x40c9a2,_0x1028('0x3c')));}_0x5899c0[_0x1028('0x16')](writePDFDocument(_0x4e84ab,_0x35bd56));}return Promise[_0x1028('0x3d')](_0x5899c0);})[_0x1028('0x2b')](function(){if(_0x51ae7f){return new Promise(function(_0x142d8b){zipdir(path['join'](_0x188a1a,_0x40c9a2),{'saveTo':path[_0x1028('0x38')](_0x188a1a,util[_0x1028('0x1c')](_0x1028('0x3b'),_0x40c9a2,_0x1028('0x3e')))},function(){rimraf(path[_0x1028('0x38')](_0x188a1a,_0x40c9a2),function(){});_0x142d8b(_0x1028('0x3f'));});});}})['then'](function(){if(!_0x51ae7f)return;rimraf(path[_0x1028('0x38')](_0x188a1a,_0x40c9a2),function(){});})[_0x1028('0x2b')](function(){logger['info'](util[_0x1028('0x1c')](_0x1028('0x40'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x1028('0x41'),_0x51ae7f?util[_0x1028('0x1c')](_0x1028('0x3b'),_0x40c9a2,_0x51ae7f?'zip':_0x1028('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1028('0x42')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x1028('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5abebc){EXTRACTED_REPORT=_0x5abebc;return dbH['sequelize'][_0x1028('0x31')](util[_0x1028('0x1c')](_0x1028('0x44'),QUERY),{'type':dbH[_0x1028('0x30')][_0x1028('0x33')][_0x1028('0x34')]});})[_0x1028('0x2b')](extractReport)[_0x1028('0x45')](function(_0x286e4){logger[_0x1028('0x42')](util[_0x1028('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1028('0x46')),util[_0x1028('0x47')](_0x286e4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1028('0x48'));})[_0x1028('0x49')](function(){process[_0x1028('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5ac4fc=new PdfPrinter({'Arial':{'normal':__dirname+_0x1028('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x1028('0x4c'),'bolditalics':__dirname+_0x1028('0x4d')}});return _0x5ac4fc;}function getPDFDocDefinitionFromHTML(_0x15e257,_0x1dbcd1){var _0x3ed5b7=util[_0x1028('0x1c')](_0x1028('0x4e'),_0x1dbcd1[_0x1028('0x4f')],_0x1dbcd1[_0x1028('0x50')]);var _0x4c0f05=moment()['format'](_0x1028('0x51'))['toString']();var _0x56f3f9=htmlToPdfmake(_0x15e257,{'window':window,'tableAutoSize':!![]});return{'content':[_0x56f3f9],'defaultStyle':{'font':_0x1028('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1028('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1028('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1028('0x52')}},'header':function(){return[{'text':_0x1028('0x53'),'style':_0x1028('0x1e')}];},'footer':function(_0x33f80d,_0x3727ca){return[{'text':util[_0x1028('0x1c')](_0x1028('0x54'),_0x3ed5b7,_0x33f80d,_0x3727ca,_0x4c0f05),'style':_0x1028('0x23')}];}};}function writePDFDocument(_0x588f34,_0x230962){return new Promise(function(_0x593e22,_0x4ef737){var _0x41b069=_0x588f34[_0x1028('0x55')](fs[_0x1028('0x56')](_0x230962));_0x41b069['on'](_0x1028('0x57'),function(){_0x593e22('finish');});_0x41b069['on'](_0x1028('0x58'),function(_0x6283b5){_0x4ef737(_0x6283b5);});_0x588f34[_0x1028('0x59')]();});}exports[_0x1028('0x5a')]=function(_0x346ee2,_0x50e2c3){var _0x1248c3=getPDFPrinter();var _0x1c73ae=getPDFDocDefinitionFromHTML(_0x346ee2,_0x50e2c3);var _0x3be123=_0x1248c3[_0x1028('0x5b')](_0x1c73ae);return writePDFDocument(_0x3be123,_0x50e2c3[_0x1028('0x2')])[_0x1028('0x45')](function(_0x5968f7){throw _0x5968f7;});}; \ No newline at end of file +var _0x7194=['Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-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','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','zip-dir','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','map','pick','value','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','toString','\x20/\x20','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','.pdf','existsSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x205725,_0x582a1b){var _0x4c86ed=function(_0x17abf8){while(--_0x17abf8){_0x205725['push'](_0x205725['shift']());}};_0x4c86ed(++_0x582a1b);}(_0x7194,0x1cc));var _0x4719=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7194[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4719('0x0'));var fs=require('fs');var util=require(_0x4719('0x1'));var path=require(_0x4719('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x4719('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x4719('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x4719('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x4719('0x6'));var db=require(_0x4719('0x7'))['db'];var dbH=require(_0x4719('0x7'))[_0x4719('0x8')];var logger=require(_0x4719('0x9'))(_0x4719('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x4719('0xb')][0x2]);var QUERY=process[_0x4719('0xb')][0x3];var PATH=process[_0x4719('0xb')][0x4];var NAME=process[_0x4719('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x30b4d4,_0x5cd198){var _0x31ca12={'status':_0x30b4d4};var _0x13f13e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5cd198){_0x31ca12[_0x4719('0xc')]=_0x5cd198;}return db[_0x4719('0xd')]['update'](_0x31ca12,_0x13f13e);}function getHeaders(_0x378641){return _[_0x4719('0xe')](_0x378641,function(_0x3b2441){return{'text':_0x3b2441,'style':'tableHeader'};});}function getRows(_0x3e15dd,_0xf568b6){return _['map'](_0xf568b6,function(_0x275af3){return _(_0x275af3)[_0x4719('0xf')](_0x3e15dd)[_0x4719('0xe')](function(_0x26af53){return _0x26af53?_['toString'](_0x26af53):'';})[_0x4719('0x10')]();});}function createTable(_0xb7e08b,_0x10db57){var _0x20e1f0={'widths':_['fill'](Array(_0xb7e08b[_0x4719('0x11')]),0x91),'heights':function(_0x21fabe){return _0x21fabe===0x0?_0x4719('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xf0b5ce=getHeaders(_0xb7e08b);_0x20e1f0[_0x4719('0x13')][_0x4719('0x14')](_0xf0b5ce);var _0x1aebe6=getRows(_0xb7e08b,_0x10db57);_0x20e1f0[_0x4719('0x13')]=_0x20e1f0['body']['concat'](_0x1aebe6);return _0x20e1f0;}function createTables(_0x3337dd){var _0x53f501=[];var _0x1d49cf=_[_0x4719('0x15')](Object[_0x4719('0x16')](_0x3337dd[0x0]),0x5);_0x1d49cf[_0x4719('0x17')](function(_0x2b5b4a){_0x53f501[_0x4719('0x14')](createTable(_0x2b5b4a,_0x3337dd));});return _0x53f501;}function getPDFDocDefinition(_0x58854a){var _0x22723d=util[_0x4719('0x18')](_0x4719('0x19'),NAME,EXTRACTED_REPORT[_0x4719('0x1a')],moment(EXTRACTED_REPORT[_0x4719('0x1b')])[_0x4719('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x4719('0x1c')])[_0x4719('0x18')](FORMAT));var _0x3ada10=[];for(var _0x556bfb=0x0;_0x556bfb<_0x58854a[_0x4719('0x11')];_0x556bfb++){var _0x1dd577=[];if(_0x556bfb===0x0){_0x1dd577[_0x4719('0x14')]({'text':_0x22723d,'style':'header'});}var _0x2c74f4={'table':_0x58854a[_0x556bfb]};if(_0x556bfb>0x0){_0x2c74f4['pageBreak']='before';_0x2c74f4['margin']=[0x0,0x46,0x0,0x0];}_0x1dd577[_0x4719('0x14')](_0x2c74f4);_0x3ada10['push'](_0x1dd577);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3ada10,'footer':function(_0x5596d3,_0x704bb7){return{'text':_0x5596d3[_0x4719('0x1d')]()+_0x4719('0x1e')+_0x704bb7,'style':'footer'};},'defaultStyle':{'font':_0x4719('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4719('0x20')},'footer':{'alignment':_0x4719('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a6eec){var _0xc310a9=0x1388;var _0xdbd74a;if(!_0x3a6eec[0x0][_0x4719('0x22')]){return analyticExtractedReport(_0x4719('0x23'));}return db[_0x4719('0x24')][_0x4719('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4719('0x26'),_0x4719('0x27')]})['then'](function(_0x427b42){if(_0x427b42){_0xdbd74a=_0x427b42;_0xc310a9=_0xdbd74a[_0x4719('0x27')]||0x3e8;}})[_0x4719('0x28')](function(){var _0xc85bc=[];var _0x1bcdb0=0x0;if(_0xdbd74a[_0x4719('0x26')]){if(_0x3a6eec&&_0x3a6eec['length']){var _0x1d4bf5=_[_0x4719('0x29')](_0x3a6eec[0x0][_0x4719('0x22')]/_0xc310a9);var _0x1bac67=Number[_0x4719('0x2a')](_0x3a6eec[0x0][_0x4719('0x22')]/_0xc310a9)?_0x3a6eec[0x0]['num']%_0xc310a9:0x0;_0x1d4bf5[_0x4719('0x17')](function(_0x4c54a6){if(_0x4c54a6>0x0){_0x1bcdb0+=_0xc310a9;}_0xc85bc[_0x4719('0x14')](dbH[_0x4719('0x2b')]['query'](util[_0x4719('0x18')](_0x4719('0x2c'),QUERY,_0xc310a9,_0x1bcdb0),{'type':dbH['sequelize'][_0x4719('0x2d')]['SELECT']}));});if(_0x1bac67>0x0){_0x1bcdb0+=_0xc310a9;_0xc85bc[_0x4719('0x14')](dbH[_0x4719('0x2b')]['query'](util[_0x4719('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1bac67,_0x1bcdb0),{'type':dbH[_0x4719('0x2b')][_0x4719('0x2d')][_0x4719('0x2e')]}));}}}else{_0xc85bc[_0x4719('0x14')](dbH[_0x4719('0x2b')][_0x4719('0x2f')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4719('0x2e')]}));}var _0x2b38ef=path[_0x4719('0x30')](PATH);var _0x363002=path['basename'](PATH,_0x4719('0x31'));var _0x128fec=_0xdbd74a[_0x4719('0x26')]&&_0xc85bc[_0x4719('0x11')]>0x1;var _0x49a7e2=[];if(!fs[_0x4719('0x32')](path[_0x4719('0x33')](_0x2b38ef,_0x363002))&&_0x128fec){fs['mkdirSync'](path[_0x4719('0x33')](_0x2b38ef,_0x363002));}return BPromise['each'](_0xc85bc,function(_0x37fbb8){_0x49a7e2['push'](_0x37fbb8);})[_0x4719('0x28')](function(){var _0x1719dc=[];for(var _0x3575e1=0x0;_0x3575e1<_0x49a7e2['length'];_0x3575e1+=0x1){var _0x4c36cb=_0x49a7e2[_0x3575e1];var _0xb089d1=createTables(_[_0x4719('0x34')](_0x4c36cb));var _0x543202;var _0x490f63=getPDFDocDefinition(_0xb089d1);var _0x5a31d0=getPDFPrinter();var _0x1fd0a8=_0x5a31d0[_0x4719('0x35')](_0x490f63);if(_0x128fec){_0x543202=path[_0x4719('0x33')](_0x2b38ef,_0x363002,util['format'](_0x4719('0x36'),_0x363002,_0x3575e1,_0x4719('0x37')));}else{_0x543202=path[_0x4719('0x33')](_0x2b38ef,util[_0x4719('0x18')](_0x4719('0x38'),_0x363002,_0x4719('0x37')));}_0x1719dc['push'](writePDFDocument(_0x1fd0a8,_0x543202));}return Promise[_0x4719('0x39')](_0x1719dc);})['then'](function(){if(_0x128fec){return new Promise(function(_0x1c1b28){zipdir(path[_0x4719('0x33')](_0x2b38ef,_0x363002),{'saveTo':path['join'](_0x2b38ef,util[_0x4719('0x18')]('%s.%s',_0x363002,_0x4719('0x3a')))},function(){rimraf(path['join'](_0x2b38ef,_0x363002),function(){});_0x1c1b28(_0x4719('0x3b'));});});}})['then'](function(){if(!_0x128fec)return;rimraf(path[_0x4719('0x33')](_0x2b38ef,_0x363002),function(){});})[_0x4719('0x28')](function(){logger[_0x4719('0x3c')](util[_0x4719('0x18')](_0x4719('0x3d'),EXTRACTED_REPORT_ID,_0x4719('0x3e')));return analyticExtractedReport('Completed',_0x128fec?util[_0x4719('0x18')](_0x4719('0x38'),_0x363002,_0x128fec?_0x4719('0x3a'):_0x4719('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x4719('0x3c')](util[_0x4719('0x18')](_0x4719('0x3f'),EXTRACTED_REPORT_ID,_0x4719('0x3e')));return db[_0x4719('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4719('0x28')](function(_0x24deb9){EXTRACTED_REPORT=_0x24deb9;return dbH[_0x4719('0x2b')][_0x4719('0x2f')](util['format'](_0x4719('0x40'),QUERY),{'type':dbH['sequelize'][_0x4719('0x2d')][_0x4719('0x2e')]});})[_0x4719('0x28')](extractReport)[_0x4719('0x41')](function(_0x4a15d5){logger['info'](util[_0x4719('0x18')](_0x4719('0x42'),EXTRACTED_REPORT_ID,_0x4719('0x3e')),util[_0x4719('0x43')](_0x4a15d5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4719('0x44'));})[_0x4719('0x45')](function(){process[_0x4719('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4eb347=new PdfPrinter({'Arial':{'normal':__dirname+_0x4719('0x47'),'bold':__dirname+_0x4719('0x48'),'italics':__dirname+_0x4719('0x49'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x4eb347;}function getPDFDocDefinitionFromHTML(_0x3e2cab,_0x24c797){var _0x4c5689=util[_0x4719('0x18')](_0x4719('0x4a'),_0x24c797[_0x4719('0x4b')],_0x24c797[_0x4719('0x4c')]);var _0x319e5f=moment()['format'](_0x4719('0x4d'))[_0x4719('0x1d')]();var _0xe4cd1=htmlToPdfmake(_0x3e2cab,{'window':window,'tableAutoSize':!![]});return{'content':[_0xe4cd1],'defaultStyle':{'font':_0x4719('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x4719('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x4719('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x4719('0x4e')}},'header':function(){return[{'text':_0x4719('0x4f'),'style':'header'}];},'footer':function(_0x30562d,_0x38e63e){return[{'text':util['format'](_0x4719('0x50'),_0x4c5689,_0x30562d,_0x38e63e,_0x319e5f),'style':_0x4719('0x51')}];}};}function writePDFDocument(_0x32b069,_0x3b5023){return new Promise(function(_0x1749b2,_0x4036a9){var _0x637efe=_0x32b069[_0x4719('0x52')](fs[_0x4719('0x53')](_0x3b5023));_0x637efe['on'](_0x4719('0x54'),function(){_0x1749b2('finish');});_0x637efe['on'](_0x4719('0x55'),function(_0x47db27){_0x4036a9(_0x47db27);});_0x32b069[_0x4719('0x56')]();});}exports[_0x4719('0x57')]=function(_0x121584,_0x5f101b){var _0x551cc8=getPDFPrinter();var _0x234158=getPDFDocDefinitionFromHTML(_0x121584,_0x5f101b);var _0x1fa77b=_0x551cc8[_0x4719('0x35')](_0x234158);return writePDFDocument(_0x1fa77b,_0x5f101b[_0x4719('0x2')])['catch'](function(_0x51b5df){throw _0x51b5df;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 3ddaa53..e77fbe5 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 _0xcade=['QueryTypes','SELECT','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','split','length','existsSync','mkdirSync','join','each','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','path','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xcade,0xab));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var path=require(_0xecad('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xecad('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xecad('0x2'));var db=require(_0xecad('0x3'))['db'];var dbH=require('../../mysqldb')[_0xecad('0x4')];var logger=require(_0xecad('0x5'))(_0xecad('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xecad('0x7')][0x2]);var QUERY=process[_0xecad('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a9c6d,_0x11c219){var _0x30a5c7={'status':_0x2a9c6d};var _0x24570e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x11c219){_0x30a5c7[_0xecad('0x8')]=_0x11c219;}return db[_0xecad('0x9')][_0xecad('0xa')](_0x30a5c7,_0x24570e);}function main(){var _0x3e4b4d=0x1388;var _0x40d27b;logger[_0xecad('0xb')](util[_0xecad('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xecad('0xd')));return db[_0xecad('0xe')][_0xecad('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xecad('0x10')]})[_0xecad('0x11')](function(_0x4d7f97){if(_0x4d7f97){_0x40d27b=_0x4d7f97;_0x3e4b4d=_0x40d27b[_0xecad('0x10')]||0x1388;}})[_0xecad('0x11')](function(){return dbH[_0xecad('0x12')][_0xecad('0x13')](util[_0xecad('0xc')](_0xecad('0x14'),QUERY),{'type':dbH['sequelize'][_0xecad('0x15')][_0xecad('0x16')]});})['then'](function(_0xf53301){if(!_0xf53301[0x0]['num']){return analyticExtractedReport('Empty');}var _0x37f66a=[];var _0x629ff2=0x0;if(_0x40d27b['split']){if(_0xf53301&&_0xf53301['length']){var _0x13e4fc=_[_0xecad('0x17')](_0xf53301[0x0][_0xecad('0x18')]/_0x3e4b4d);var _0x5cab86=Number[_0xecad('0x19')](_0xf53301[0x0][_0xecad('0x18')]/_0x3e4b4d)?_0xf53301[0x0][_0xecad('0x18')]%_0x3e4b4d:0x0;_0x13e4fc['forEach'](function(_0x4333bb){if(_0x4333bb>0x0){_0x629ff2+=_0x3e4b4d;}_0x37f66a[_0xecad('0x1a')](dbH[_0xecad('0x12')][_0xecad('0x13')](util[_0xecad('0xc')](_0xecad('0x1b'),QUERY,_0x3e4b4d,_0x629ff2),{'type':dbH['sequelize'][_0xecad('0x15')][_0xecad('0x16')]}));});if(_0x5cab86>0x0){_0x629ff2+=_0x3e4b4d;_0x37f66a[_0xecad('0x1a')](dbH['sequelize'][_0xecad('0x13')](util[_0xecad('0xc')](_0xecad('0x1b'),QUERY,_0x5cab86,_0x629ff2),{'type':dbH[_0xecad('0x12')][_0xecad('0x15')]['SELECT']}));}}}else{_0x37f66a[_0xecad('0x1a')](dbH[_0xecad('0x12')][_0xecad('0x13')](QUERY,{'type':dbH[_0xecad('0x12')][_0xecad('0x15')][_0xecad('0x16')]}));}var _0x411e86=path[_0xecad('0x1c')](PATH);var _0x45d306=path['basename'](PATH,_0xecad('0x1d'));var _0x5b1ff8=_0x40d27b[_0xecad('0x1e')]&&_0x37f66a[_0xecad('0x1f')]>0x1;var _0x5e1e93=[];if(!fs[_0xecad('0x20')](path['join'](_0x411e86,_0x45d306))&&_0x5b1ff8){fs[_0xecad('0x21')](path[_0xecad('0x22')](_0x411e86,_0x45d306));}return BPromise[_0xecad('0x23')](_0x37f66a,function(_0x1c7bd1){_0x5e1e93[_0xecad('0x1a')](_0x1c7bd1);})[_0xecad('0x11')](function(){for(var _0x16f3d5=0x0;_0x16f3d5<_0x5e1e93[_0xecad('0x1f')];_0x16f3d5+=0x1){var _0x58fab8;var _0x347bc5=_0x5e1e93[_0x16f3d5];if(_0x5b1ff8){_0x58fab8=path['join'](_0x411e86,_0x45d306,util['format']('%s%d.%s',_0x45d306,_0x16f3d5,_0xecad('0x24')));}else{_0x58fab8=path[_0xecad('0x22')](_0x411e86,util[_0xecad('0xc')](_0xecad('0x25'),_0x45d306,_0xecad('0x24')));}fs['writeFileSync'](_0x58fab8,json2xls(_0x347bc5),_0xecad('0x26'));}})['then'](function(){if(_0x5b1ff8){return new Promise(function(_0x4ec02){zipdir(path[_0xecad('0x22')](_0x411e86,_0x45d306),{'saveTo':path[_0xecad('0x22')](_0x411e86,util[_0xecad('0xc')](_0xecad('0x25'),_0x45d306,_0xecad('0x27')))},function(_0x8e8126,_0x2b27f7){rimraf(path[_0xecad('0x22')](_0x411e86,_0x45d306),function(){});_0x4ec02(_0xecad('0x28'));});});}})[_0xecad('0x11')](function(){logger[_0xecad('0xb')](util['format'](_0xecad('0x29'),EXTRACTED_REPORT_ID,_0xecad('0xd')));return analyticExtractedReport(_0xecad('0x2a'),_0x5b1ff8?util[_0xecad('0xc')](_0xecad('0x25'),_0x45d306,_0x5b1ff8?'zip':'xlsx'):null);});})[_0xecad('0x2b')](function(_0x385cb6){logger[_0xecad('0xb')](util[_0xecad('0xc')](_0xecad('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x385cb6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xecad('0x2d'));})[_0xecad('0x2e')](function(){process[_0xecad('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbc2d=['AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','length','range','num','isInteger','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','argv','savename'];(function(_0x2ad2a0,_0x9f047a){var _0x543879=function(_0x294439){while(--_0x294439){_0x2ad2a0['push'](_0x2ad2a0['shift']());}};_0x543879(++_0x9f047a);}(_0xbc2d,0x1c4));var _0xdbc2=function(_0x5d8f9a,_0x2f396d){_0x5d8f9a=_0x5d8f9a-0x0;var _0x33069e=_0xbc2d[_0x5d8f9a];return _0x33069e;};'use strict';var util=require('util');var path=require(_0xdbc2('0x0'));var _=require(_0xdbc2('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xdbc2('0x2'));var rimraf=require(_0xdbc2('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdbc2('0x4'))[_0xdbc2('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xdbc2('0x6')][0x2]);var QUERY=process[_0xdbc2('0x6')][0x3];var PATH=process[_0xdbc2('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3cf650,_0xd1c4b){var _0x188a81={'status':_0x3cf650};var _0x2e0be1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd1c4b){_0x188a81[_0xdbc2('0x7')]=_0xd1c4b;}return db[_0xdbc2('0x8')]['update'](_0x188a81,_0x2e0be1);}function main(){var _0x4dbf87=0x1388;var _0x4908fb;logger[_0xdbc2('0x9')](util[_0xdbc2('0xa')](_0xdbc2('0xb'),EXTRACTED_REPORT_ID,_0xdbc2('0xc')));return db[_0xdbc2('0xd')][_0xdbc2('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdbc2('0xf'),_0xdbc2('0x10')]})[_0xdbc2('0x11')](function(_0x189b08){if(_0x189b08){_0x4908fb=_0x189b08;_0x4dbf87=_0x4908fb[_0xdbc2('0x10')]||0x1388;}})[_0xdbc2('0x11')](function(){return dbH[_0xdbc2('0x12')][_0xdbc2('0x13')](util['format'](_0xdbc2('0x14'),QUERY),{'type':dbH[_0xdbc2('0x12')][_0xdbc2('0x15')]['SELECT']});})['then'](function(_0x4b1c36){if(!_0x4b1c36[0x0]['num']){return analyticExtractedReport('Empty');}var _0x35f327=[];var _0x4e8f26=0x0;if(_0x4908fb[_0xdbc2('0xf')]){if(_0x4b1c36&&_0x4b1c36[_0xdbc2('0x16')]){var _0x11ea47=_[_0xdbc2('0x17')](_0x4b1c36[0x0][_0xdbc2('0x18')]/_0x4dbf87);var _0x1f1409=Number[_0xdbc2('0x19')](_0x4b1c36[0x0]['num']/_0x4dbf87)?_0x4b1c36[0x0][_0xdbc2('0x18')]%_0x4dbf87:0x0;_0x11ea47['forEach'](function(_0xb1230c){if(_0xb1230c>0x0){_0x4e8f26+=_0x4dbf87;}_0x35f327[_0xdbc2('0x1a')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4dbf87,_0x4e8f26),{'type':dbH[_0xdbc2('0x12')][_0xdbc2('0x15')][_0xdbc2('0x1b')]}));});if(_0x1f1409>0x0){_0x4e8f26+=_0x4dbf87;_0x35f327['push'](dbH[_0xdbc2('0x12')][_0xdbc2('0x13')](util['format'](_0xdbc2('0x1c'),QUERY,_0x1f1409,_0x4e8f26),{'type':dbH['sequelize'][_0xdbc2('0x15')][_0xdbc2('0x1b')]}));}}}else{_0x35f327[_0xdbc2('0x1a')](dbH['sequelize'][_0xdbc2('0x13')](QUERY,{'type':dbH[_0xdbc2('0x12')][_0xdbc2('0x15')][_0xdbc2('0x1b')]}));}var _0x1f6833=path[_0xdbc2('0x1d')](PATH);var _0x518c83=path[_0xdbc2('0x1e')](PATH,'.xlsx');var _0x108224=_0x4908fb[_0xdbc2('0xf')]&&_0x35f327[_0xdbc2('0x16')]>0x1;var _0x3a0e7b=[];if(!fs['existsSync'](path[_0xdbc2('0x1f')](_0x1f6833,_0x518c83))&&_0x108224){fs[_0xdbc2('0x20')](path['join'](_0x1f6833,_0x518c83));}return BPromise['each'](_0x35f327,function(_0x304c76){_0x3a0e7b[_0xdbc2('0x1a')](_0x304c76);})[_0xdbc2('0x11')](function(){for(var _0x59ddfa=0x0;_0x59ddfa<_0x3a0e7b[_0xdbc2('0x16')];_0x59ddfa+=0x1){var _0x52fb80;var _0x3ab94c=_0x3a0e7b[_0x59ddfa];if(_0x108224){_0x52fb80=path[_0xdbc2('0x1f')](_0x1f6833,_0x518c83,util[_0xdbc2('0xa')](_0xdbc2('0x21'),_0x518c83,_0x59ddfa,_0xdbc2('0x22')));}else{_0x52fb80=path[_0xdbc2('0x1f')](_0x1f6833,util[_0xdbc2('0xa')](_0xdbc2('0x23'),_0x518c83,'xlsx'));}fs[_0xdbc2('0x24')](_0x52fb80,json2xls(_0x3ab94c),_0xdbc2('0x25'));}})['then'](function(){if(_0x108224){return new Promise(function(_0x554296){zipdir(path[_0xdbc2('0x1f')](_0x1f6833,_0x518c83),{'saveTo':path[_0xdbc2('0x1f')](_0x1f6833,util[_0xdbc2('0xa')](_0xdbc2('0x23'),_0x518c83,_0xdbc2('0x26')))},function(_0x30d2cf,_0x476b97){rimraf(path[_0xdbc2('0x1f')](_0x1f6833,_0x518c83),function(){});_0x554296(_0xdbc2('0x27'));});});}})['then'](function(){logger[_0xdbc2('0x9')](util[_0xdbc2('0xa')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xdbc2('0xc')));return analyticExtractedReport(_0xdbc2('0x28'),_0x108224?util['format']('%s.%s',_0x518c83,_0x108224?_0xdbc2('0x26'):_0xdbc2('0x22')):null);});})[_0xdbc2('0x29')](function(_0x5c0f99){logger[_0xdbc2('0x9')](util[_0xdbc2('0xa')](_0xdbc2('0x2a'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xdbc2('0x2b')](_0x5c0f99,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdbc2('0x2c'));})['finally'](function(){process[_0xdbc2('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4a8abe3..a991bc3 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 _0x82aa=['format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','extensions','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','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','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','then','VoiceExtension','findAll','IntervalId','uniq','map','filter','groupBy','queue','extension','find','exten','type','Set'];(function(_0x3fb740,_0x125ec0){var _0x2e0ee9=function(_0x4edfcb){while(--_0x4edfcb){_0x3fb740['push'](_0x3fb740['shift']());}};_0x2e0ee9(++_0x125ec0);}(_0x82aa,0x1ed));var _0xa82a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x82aa[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa82a('0x0'));var util=require(_0xa82a('0x1'));function rewrite(_0x3b7090,_0x15cc83){var _0x7b3fc1=this;return _0x3b7090[_0xa82a('0x2')][_0xa82a('0x3')]['findAll']({'raw':!![]})[_0xa82a('0x4')](function(_0x4f18ad){_0x7b3fc1['intervals']=_0x4f18ad;return _0x3b7090[_0xa82a('0x2')][_0xa82a('0x5')][_0xa82a('0x6')]({'where':{'IntervalId':_0x15cc83[_0xa82a('0x7')]},'raw':!![]});})[_0xa82a('0x4')](function(_0x2d491e){return _0x3b7090[_0xa82a('0x2')][_0xa82a('0x5')][_0xa82a('0x6')]({'where':{'exten':{'$in':_[_0xa82a('0x8')](_[_0xa82a('0x9')](_0x2d491e,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xa82a('0x4')](function(_0x5d4c95){var _0x3cb9a7=_[_0xa82a('0xa')](_0x5d4c95,{'priority':'1'});var _0x3217a2=_[_0xa82a('0xa')](_0x5d4c95,{'isApp':0x1});var _0x593a3c=_[_0xa82a('0xb')](_0x3217a2,'exten');var _0x4b3c48=[_0xa82a('0xc'),'playback'];var _0x8c56e8=[];var _0x23f93c=[];for(var _0x5e9f5d in _0x593a3c){if(_0x593a3c['hasOwnProperty'](_0x5e9f5d)){_0x7b3fc1['priority']=0x2;_0x7b3fc1['extensions']=[];_0x7b3fc1[_0xa82a('0xd')]=_[_0xa82a('0xe')](_0x3cb9a7,{'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')]});_0x7b3fc1['extensions']['push']({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':util[_0xa82a('0x12')](_0xa82a('0x13'),_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')]),'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});if(_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')]===_0xa82a('0x17')){_0x7b3fc1[_0xa82a('0x18')][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x1a')+_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')],'context':_0x593a3c[_0x5e9f5d][0x0]['context'],'exten':_0x593a3c[_0x5e9f5d][0x0]['exten'],'priority':_0x7b3fc1['priority']++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0]['VoiceExtensionId']});}else if(_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')]===_0xa82a('0x1b')){if(_0x7b3fc1[_0xa82a('0xd')]){_0x7b3fc1['extensions'][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x1c')+(_0x7b3fc1[_0xa82a('0xd')][_0xa82a('0x1d')]?_0xa82a('0x1e')+_0x7b3fc1[_0xa82a('0xd')]['cutdigits']+'}':_0xa82a('0x1f')),'context':_0x593a3c[_0x5e9f5d][0x0]['context'],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0]['VoiceExtensionId']});}_0x7b3fc1[_0xa82a('0x18')]['push']({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':'Set','appdata':_0xa82a('0x1a')+_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')],'context':_0x593a3c[_0x5e9f5d][0x0]['context'],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1['priority']++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});var _0x3874c6=_0x7b3fc1[_0xa82a('0x15')]++;_0x7b3fc1[_0xa82a('0x18')][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x20'),'appdata':_0xa82a('0x21')+(_0x3874c6+0x2)+_0xa82a('0x22')+(_0x3874c6+0x1)+')','context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x3874c6,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});if(_0x7b3fc1[_0xa82a('0xd')]){_0x7b3fc1[_0xa82a('0x18')]['push']({'type':_0x593a3c[_0x5e9f5d][0x0]['type'],'app':_0xa82a('0x11'),'appdata':_0x7b3fc1[_0xa82a('0xd')][_0xa82a('0x1d')]?_0xa82a('0x23')+_0x7b3fc1['extension'][_0xa82a('0x1d')]+'}':_0xa82a('0x24'),'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});}_0x7b3fc1[_0xa82a('0x18')]['push']({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x25')+_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')],'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0]['VoiceExtensionId']});if(_0x7b3fc1[_0xa82a('0xd')]&&_0x7b3fc1['extension'][_0xa82a('0x26')](_0xa82a('0x27'))&&_0x7b3fc1['extension'][_0xa82a('0x27')]!=='none'){_0x7b3fc1[_0xa82a('0x18')]['push']({'type':_0x593a3c[_0x5e9f5d][0x0]['type'],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x28'),'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0]['exten'],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});_0x7b3fc1[_0xa82a('0x18')]['push']({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x29')+_0x7b3fc1[_0xa82a('0xd')][_0xa82a('0x27')]||'wav','context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});}}_0x7b3fc1[_0xa82a('0x18')][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0]['type'],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x2a'),'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0]['exten'],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});_0x7b3fc1['extensions']['push']({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x2b'),'context':_0x593a3c[_0x5e9f5d][0x0]['context'],'exten':_0x593a3c[_0x5e9f5d][0x0]['exten'],'priority':_0x7b3fc1[_0xa82a('0x15')]++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});_0x7b3fc1['extensions'][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0]['type'],'app':_0xa82a('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'priority':_0x7b3fc1['priority']++,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});for(var _0xa628f8=0x0,_0x8c6ddf=0x0;_0xa628f8<_0x593a3c[_0x5e9f5d][_0xa82a('0x2c')];_0xa628f8+=0x1,_0x8c6ddf=0x0){var _0x45335d=_0x593a3c[_0x5e9f5d][_0xa628f8];if(_0x45335d[_0xa82a('0x10')]){_0x45335d['type']=_0x45335d[_0xa82a('0x10')]['toLowerCase']();}var _0x435d54=[];var _0x8bde6b=[];delete _0x45335d['id'];delete _0x45335d[_0xa82a('0x2d')];delete _0x45335d[_0xa82a('0x2e')];var _0x5b5c7f=_0x45335d[_0xa82a('0x2f')]!==_0xa82a('0x30')?[_0x45335d[_0xa82a('0x2f')]]:_0x45335d['IntervalId']?_[_0xa82a('0x9')](_[_0xa82a('0xa')](_0x7b3fc1[_0xa82a('0x31')],{'IntervalId':_0x45335d[_0xa82a('0x7')]}),_0xa82a('0x2f')):[];if(_0x45335d['hasOwnProperty'](_0xa82a('0x32'))){if(_0x45335d[_0xa82a('0x32')]&&_0x45335d['tag']!=='--'){_0x435d54[_0xa82a('0x19')]({'type':_0x45335d[_0xa82a('0x10')],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x33')+_0x45335d[_0xa82a('0x32')],'context':_0x45335d[_0xa82a('0x14')],'exten':_0x45335d['exten'],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d[_0xa82a('0x16')]});}}if(_0x45335d[_0xa82a('0x10')]===_0xa82a('0x1b')&&_0x45335d[_0xa82a('0x26')]('callerID')){if(_0x45335d[_0xa82a('0x34')]){_0x435d54[_0xa82a('0x19')]({'type':_0x45335d['type'],'app':_0xa82a('0x20'),'appdata':_0xa82a('0x35')+_0x45335d[_0xa82a('0x34')]+')','context':_0x45335d['context'],'exten':_0x45335d[_0xa82a('0xf')],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d[_0xa82a('0x16')]});}else{_0x435d54['push']({'type':_0x45335d[_0xa82a('0x10')],'app':_0xa82a('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x45335d[_0xa82a('0x14')],'exten':_0x45335d[_0xa82a('0xf')],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d[_0xa82a('0x16')]});}}if(_0x45335d[_0xa82a('0x26')](_0xa82a('0x36'))){if(_0x4b3c48[_0xa82a('0x37')](_0x45335d[_0xa82a('0x38')][_0xa82a('0x39')]())>=0x0&&_0x45335d[_0xa82a('0x3a')]!=='custom'){if(_0x45335d[_0xa82a('0x36')]){_0x435d54[_0xa82a('0x19')]({'type':_0x45335d['type'],'app':_0xa82a('0x20'),'appdata':_0xa82a('0x3b'),'context':_0x45335d['context'],'exten':_0x45335d['exten'],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d[_0xa82a('0x16')]});_0x435d54['push']({'type':_0x45335d[_0xa82a('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x45335d[_0xa82a('0x14')],'exten':_0x45335d[_0xa82a('0xf')],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d['VoiceExtensionId']});}else{_0x435d54[_0xa82a('0x19')]({'type':_0x45335d[_0xa82a('0x10')],'app':_0xa82a('0x20'),'appdata':_0xa82a('0x3c'),'context':_0x45335d['context'],'exten':_0x45335d[_0xa82a('0xf')],'priority':_0x5b5c7f['length']+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d['VoiceExtensionId']});_0x435d54[_0xa82a('0x19')]({'type':_0x45335d['type'],'app':_0xa82a('0x11'),'appdata':_0xa82a('0x3d'),'context':_0x45335d[_0xa82a('0x14')],'exten':_0x45335d[_0xa82a('0xf')],'priority':_0x5b5c7f[_0xa82a('0x2c')]+_0x7b3fc1[_0xa82a('0x15')]+_0x8c6ddf++,'VoiceExtensionId':_0x45335d[_0xa82a('0x16')]});}}}for(var _0x1c2161=0x0;_0x1c2161<_0x5b5c7f['length'];_0x1c2161+=0x1){var _0x468440=_0x7b3fc1[_0xa82a('0x15')]+_0x5b5c7f[_0xa82a('0x2c')];var _0x9afb7e=_0x1c2161===_0x5b5c7f[_0xa82a('0x2c')]-0x1?_0x7b3fc1[_0xa82a('0x15')]+_0x435d54[_0xa82a('0x2c')]+_0x8bde6b[_0xa82a('0x2c')]+0x2:_0x7b3fc1[_0xa82a('0x15')]+_0x1c2161+0x1;_0x435d54[_0xa82a('0x3e')](_0x1c2161,0x0,{'type':_0x45335d[_0xa82a('0x10')],'app':_0xa82a('0x3f'),'appdata':_0x5b5c7f[_0x1c2161]+'?'+_0x45335d['context']+',${EXTEN},'+_0x468440+':'+_0x45335d[_0xa82a('0x14')]+_0xa82a('0x40')+_0x9afb7e,'exten':_0x45335d[_0xa82a('0xf')],'context':_0x45335d[_0xa82a('0x14')],'priority':_0x7b3fc1[_0xa82a('0x15')]+_0x1c2161,'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});}_0x45335d[_0xa82a('0x15')]=_0x435d54['length']?_['last'](_0x435d54)[_0xa82a('0x15')]+0x1:_0x7b3fc1[_0xa82a('0x15')];_0x7b3fc1[_0xa82a('0x15')]=(_0x8bde6b[_0xa82a('0x2c')]?_[_0xa82a('0x41')](_0x8bde6b)['priority']:_0x45335d[_0xa82a('0x15')])+0x1;_0x7b3fc1[_0xa82a('0x18')]=_[_0xa82a('0x42')](_0x7b3fc1[_0xa82a('0x18')],_0x435d54,[_0x45335d],_0x8bde6b);}_0x7b3fc1[_0xa82a('0x18')][_0xa82a('0x19')]({'type':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x10')],'app':'Hangup','exten':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0xf')],'context':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x14')],'priority':_0x7b3fc1[_0xa82a('0x15')],'VoiceExtensionId':_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]});_0x8c56e8['push'](_0x593a3c[_0x5e9f5d][0x0][_0xa82a('0x16')]);_0x23f93c=_[_0xa82a('0x42')](_0x23f93c,_0x7b3fc1['extensions']);}}return _0x3b7090[_0xa82a('0x43')](function(_0x35e497){return _0x3b7090[_0xa82a('0x2')]['VoiceExtension'][_0xa82a('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x8c56e8}},'transaction':_0x35e497})[_0xa82a('0x4')](function(_0xd6baa9){return _0x3b7090[_0xa82a('0x2')]['VoiceExtension'][_0xa82a('0x45')](_[_0xa82a('0x46')](_0x23f93c,_0xa82a('0x15')),{'transaction':_0x35e497});});});})[_0xa82a('0x47')](function(_0x1644be){console['error'](_0x1644be);});}exports[_0xa82a('0x48')]=rewrite; \ No newline at end of file +var _0xbdcf=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','IntervalId','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','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','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','Interval','findAll','models','then','VoiceExtension','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','priority','find','extensions','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xbdcf,0x1c8));var _0xfbdc=function(_0x36d166,_0x1d678d){_0x36d166=_0x36d166-0x0;var _0x472525=_0xbdcf[_0x36d166];return _0x472525;};'use strict';var _=require('lodash');var util=require(_0xfbdc('0x0'));function rewrite(_0x5bfe96,_0x3f12f3){var _0x44924c=this;return _0x5bfe96['models'][_0xfbdc('0x1')][_0xfbdc('0x2')]({'raw':!![]})['then'](function(_0x4dbf52){_0x44924c['intervals']=_0x4dbf52;return _0x5bfe96[_0xfbdc('0x3')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x3f12f3['IntervalId']},'raw':!![]});})[_0xfbdc('0x4')](function(_0x1a9ed9){return _0x5bfe96[_0xfbdc('0x3')][_0xfbdc('0x5')][_0xfbdc('0x2')]({'where':{'exten':{'$in':_[_0xfbdc('0x6')](_[_0xfbdc('0x7')](_0x1a9ed9,_0xfbdc('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xfbdc('0x4')](function(_0x580d99){var _0x5cc51d=_[_0xfbdc('0x9')](_0x580d99,{'priority':'1'});var _0x4792c6=_['filter'](_0x580d99,{'isApp':0x1});var _0x1a0c65=_[_0xfbdc('0xa')](_0x4792c6,_0xfbdc('0x8'));var _0x14ee62=['queue',_0xfbdc('0xb')];var _0x29150a=[];var _0x1c1a04=[];for(var _0xe25974 in _0x1a0c65){if(_0x1a0c65[_0xfbdc('0xc')](_0xe25974)){_0x44924c[_0xfbdc('0xd')]=0x2;_0x44924c['extensions']=[];_0x44924c['extension']=_[_0xfbdc('0xe')](_0x5cc51d,{'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')]});_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0]['type'],'app':_0xfbdc('0x11'),'appdata':util[_0xfbdc('0x12')](_0xfbdc('0x13'),_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')]),'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});if(_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')]==='inbound'){_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0]['type'],'app':'Set','appdata':_0xfbdc('0x17')+_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')],'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});}else if(_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')]===_0xfbdc('0x18')){if(_0x44924c[_0xfbdc('0x19')]){_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0]['type'],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x1a')+(_0x44924c[_0xfbdc('0x19')][_0xfbdc('0x1b')]?_0xfbdc('0x1c')+_0x44924c[_0xfbdc('0x19')]['cutdigits']+'}':'${EXTEN}'),'context':_0x1a0c65[_0xe25974][0x0]['context'],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});}_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x17')+_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')],'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c['priority']++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});var _0x10df4f=_0x44924c[_0xfbdc('0xd')]++;_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x10df4f+0x2)+_0xfbdc('0x1e')+(_0x10df4f+0x1)+')','context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0]['exten'],'priority':_0x10df4f,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});if(_0x44924c['extension']){_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0x44924c['extension'][_0xfbdc('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x44924c[_0xfbdc('0x19')][_0xfbdc('0x1b')]+'}':_0xfbdc('0x1f'),'context':_0x1a0c65[_0xe25974][0x0]['context'],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});}_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x20')+_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')],'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0]['VoiceExtensionId']});if(_0x44924c['extension']&&_0x44924c['extension'][_0xfbdc('0xc')]('recordingFormat')&&_0x44924c[_0xfbdc('0x19')][_0xfbdc('0x21')]!==_0xfbdc('0x22')){_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x23'),'context':_0x1a0c65[_0xe25974][0x0]['context'],'exten':_0x1a0c65[_0xe25974][0x0]['exten'],'priority':_0x44924c['priority']++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0]['type'],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x24')+_0x44924c[_0xfbdc('0x19')]['recordingFormat']||'wav','context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0]['exten'],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0]['VoiceExtensionId']});}}_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c[_0xfbdc('0xd')]++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});_0x44924c['extensions'][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1a0c65[_0xe25974][0x0]['context'],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c['priority']++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});_0x44924c[_0xfbdc('0xf')][_0xfbdc('0x10')]({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x25'),'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'exten':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x8')],'priority':_0x44924c['priority']++,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});for(var _0x1154bc=0x0,_0x35f34c=0x0;_0x1154bc<_0x1a0c65[_0xe25974][_0xfbdc('0x26')];_0x1154bc+=0x1,_0x35f34c=0x0){var _0x353925=_0x1a0c65[_0xe25974][_0x1154bc];if(_0x353925['type']){_0x353925[_0xfbdc('0x14')]=_0x353925['type']['toLowerCase']();}var _0x51266b=[];var _0x311bb7=[];delete _0x353925['id'];delete _0x353925[_0xfbdc('0x27')];delete _0x353925[_0xfbdc('0x28')];var _0x1f8979=_0x353925[_0xfbdc('0x29')]!=='*,*,*,*'?[_0x353925['interval']]:_0x353925[_0xfbdc('0x2a')]?_[_0xfbdc('0x7')](_[_0xfbdc('0x9')](_0x44924c[_0xfbdc('0x2b')],{'IntervalId':_0x353925['IntervalId']}),_0xfbdc('0x29')):[];if(_0x353925[_0xfbdc('0xc')](_0xfbdc('0x2c'))){if(_0x353925[_0xfbdc('0x2c')]&&_0x353925[_0xfbdc('0x2c')]!=='--'){_0x51266b[_0xfbdc('0x10')]({'type':_0x353925[_0xfbdc('0x14')],'app':_0xfbdc('0x11'),'appdata':_0xfbdc('0x2d')+_0x353925[_0xfbdc('0x2c')],'context':_0x353925['context'],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c[_0xfbdc('0xd')]+_0x35f34c++,'VoiceExtensionId':_0x353925[_0xfbdc('0x16')]});}}if(_0x353925[_0xfbdc('0x14')]===_0xfbdc('0x18')&&_0x353925[_0xfbdc('0xc')]('callerID')){if(_0x353925[_0xfbdc('0x2e')]){_0x51266b[_0xfbdc('0x10')]({'type':_0x353925['type'],'app':_0xfbdc('0x1d'),'appdata':_0xfbdc('0x2f')+_0x353925[_0xfbdc('0x2e')]+')','context':_0x353925[_0xfbdc('0x15')],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c['priority']+_0x35f34c++,'VoiceExtensionId':_0x353925[_0xfbdc('0x16')]});}else{_0x51266b[_0xfbdc('0x10')]({'type':_0x353925[_0xfbdc('0x14')],'app':_0xfbdc('0x1d'),'appdata':_0xfbdc('0x30'),'context':_0x353925[_0xfbdc('0x15')],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c[_0xfbdc('0xd')]+_0x35f34c++,'VoiceExtensionId':_0x353925['VoiceExtensionId']});}}if(_0x353925['hasOwnProperty'](_0xfbdc('0x31'))){if(_0x14ee62[_0xfbdc('0x32')](_0x353925['app']['toLowerCase']())>=0x0&&_0x353925[_0xfbdc('0x33')]!==_0xfbdc('0x34')){if(_0x353925[_0xfbdc('0x31')]){_0x51266b['push']({'type':_0x353925['type'],'app':_0xfbdc('0x1d'),'appdata':_0xfbdc('0x35'),'context':_0x353925['context'],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c[_0xfbdc('0xd')]+_0x35f34c++,'VoiceExtensionId':_0x353925['VoiceExtensionId']});_0x51266b[_0xfbdc('0x10')]({'type':_0x353925[_0xfbdc('0x14')],'app':'Set','appdata':_0xfbdc('0x36'),'context':_0x353925[_0xfbdc('0x15')],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c[_0xfbdc('0xd')]+_0x35f34c++,'VoiceExtensionId':_0x353925[_0xfbdc('0x16')]});}else{_0x51266b[_0xfbdc('0x10')]({'type':_0x353925[_0xfbdc('0x14')],'app':_0xfbdc('0x1d'),'appdata':_0xfbdc('0x37'),'context':_0x353925['context'],'exten':_0x353925['exten'],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c['priority']+_0x35f34c++,'VoiceExtensionId':_0x353925[_0xfbdc('0x16')]});_0x51266b[_0xfbdc('0x10')]({'type':_0x353925[_0xfbdc('0x14')],'app':'Set','appdata':_0xfbdc('0x38'),'context':_0x353925[_0xfbdc('0x15')],'exten':_0x353925[_0xfbdc('0x8')],'priority':_0x1f8979[_0xfbdc('0x26')]+_0x44924c[_0xfbdc('0xd')]+_0x35f34c++,'VoiceExtensionId':_0x353925[_0xfbdc('0x16')]});}}}for(var _0x5405c0=0x0;_0x5405c0<_0x1f8979[_0xfbdc('0x26')];_0x5405c0+=0x1){var _0x4bc120=_0x44924c[_0xfbdc('0xd')]+_0x1f8979['length'];var _0x17dba5=_0x5405c0===_0x1f8979[_0xfbdc('0x26')]-0x1?_0x44924c[_0xfbdc('0xd')]+_0x51266b['length']+_0x311bb7[_0xfbdc('0x26')]+0x2:_0x44924c[_0xfbdc('0xd')]+_0x5405c0+0x1;_0x51266b[_0xfbdc('0x39')](_0x5405c0,0x0,{'type':_0x353925[_0xfbdc('0x14')],'app':_0xfbdc('0x3a'),'appdata':_0x1f8979[_0x5405c0]+'?'+_0x353925[_0xfbdc('0x15')]+_0xfbdc('0x3b')+_0x4bc120+':'+_0x353925['context']+_0xfbdc('0x3b')+_0x17dba5,'exten':_0x353925[_0xfbdc('0x8')],'context':_0x353925[_0xfbdc('0x15')],'priority':_0x44924c[_0xfbdc('0xd')]+_0x5405c0,'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});}_0x353925[_0xfbdc('0xd')]=_0x51266b[_0xfbdc('0x26')]?_[_0xfbdc('0x3c')](_0x51266b)[_0xfbdc('0xd')]+0x1:_0x44924c[_0xfbdc('0xd')];_0x44924c[_0xfbdc('0xd')]=(_0x311bb7['length']?_[_0xfbdc('0x3c')](_0x311bb7)['priority']:_0x353925['priority'])+0x1;_0x44924c[_0xfbdc('0xf')]=_[_0xfbdc('0x3d')](_0x44924c[_0xfbdc('0xf')],_0x51266b,[_0x353925],_0x311bb7);}_0x44924c[_0xfbdc('0xf')]['push']({'type':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x14')],'app':_0xfbdc('0x3e'),'exten':_0x1a0c65[_0xe25974][0x0]['exten'],'context':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x15')],'priority':_0x44924c[_0xfbdc('0xd')],'VoiceExtensionId':_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]});_0x29150a[_0xfbdc('0x10')](_0x1a0c65[_0xe25974][0x0][_0xfbdc('0x16')]);_0x1c1a04=_[_0xfbdc('0x3d')](_0x1c1a04,_0x44924c[_0xfbdc('0xf')]);}}return _0x5bfe96[_0xfbdc('0x3f')](function(_0x5da133){return _0x5bfe96[_0xfbdc('0x3')][_0xfbdc('0x5')][_0xfbdc('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x29150a}},'transaction':_0x5da133})[_0xfbdc('0x4')](function(_0x52a69b){return _0x5bfe96['models']['VoiceExtension'][_0xfbdc('0x41')](_[_0xfbdc('0x42')](_0x1c1a04,'priority'),{'transaction':_0x5da133});});});})[_0xfbdc('0x43')](function(_0x4ec8ac){console[_0xfbdc('0x44')](_0x4ec8ac);});}exports[_0xfbdc('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 51f8ad3..dc24f77 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 _0xbc4a=['Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','papaparse','ioredis','../../../config/environment','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','select','field','NOW()','toString','createdAt','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','scheduledAt','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','VoiceQueueId','catch','sequelize','query','all','BlackLists','Lists','CampaignId'];(function(_0x532a08,_0x1079ab){var _0xd9c5ee=function(_0x1ce50c){while(--_0x1ce50c){_0x532a08['push'](_0x532a08['shift']());}};_0xd9c5ee(++_0x1079ab);}(_0xbc4a,0x15b));var _0xabc4=function(_0x56a5a7,_0x4a34dc){_0x56a5a7=_0x56a5a7-0x0;var _0x3bba82=_0xbc4a[_0x56a5a7];return _0x3bba82;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xabc4('0x0'));var Redis=require(_0xabc4('0x1'));var db=require('../../../mysqldb')['db'];var config=require(_0xabc4('0x2'));var logger=require('../../../config/logger')(_0xabc4('0x3'));config['redis']=_[_0xabc4('0x4')](config[_0xabc4('0x5')],{'host':_0xabc4('0x6'),'port':0x18eb});var socket=require(_0xabc4('0x7'))(new Redis(config['redis']));require(_0xabc4('0x8'))[_0xabc4('0x9')](socket);try{if(!process[_0xabc4('0xa')][0x2]||process[_0xabc4('0xa')][0x2]===_0xabc4('0xb')||process[_0xabc4('0xa')][0x2]===_0xabc4('0xc')){throw new Error(_0xabc4('0xd'));}var FILEPATH=process[_0xabc4('0xa')][0x2];if(!process[_0xabc4('0xa')][0x3]||process[_0xabc4('0xa')][0x3]==='undefined'||process[_0xabc4('0xa')][0x3]===_0xabc4('0xc')||!process[_0xabc4('0xa')][0x4]||process[_0xabc4('0xa')][0x4]===_0xabc4('0xb')||process[_0xabc4('0xa')][0x4]===_0xabc4('0xc')){throw new Error(_0xabc4('0xe'));}var FIELDS=_['zipObject'](process[_0xabc4('0xa')][0x3][_0xabc4('0xf')](','),process[_0xabc4('0xa')][0x4][_0xabc4('0xf')](','));if(!process[_0xabc4('0xa')][0x5]||process[_0xabc4('0xa')][0x5]===_0xabc4('0xb')||process[_0xabc4('0xa')][0x5]===_0xabc4('0xc')){throw new Error(_0xabc4('0x10'));}var LISTID=process[_0xabc4('0xa')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xabc4('0xa')][0x6]!==_0xabc4('0xb')&&process[_0xabc4('0xa')][0x6]!=='null'?process[_0xabc4('0xa')][0x6]:null;var DUPLICATES=process[_0xabc4('0xa')][0x7]&&process[_0xabc4('0xa')][0x7]!==_0xabc4('0xb')&&process[_0xabc4('0xa')][0x7]!=='null'?process[_0xabc4('0xa')][0x7]:null;if(!process[_0xabc4('0xa')][0x8]||process[_0xabc4('0xa')][0x8]===_0xabc4('0xb')||process[_0xabc4('0xa')][0x8]===_0xabc4('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5d37bf){logger[_0xabc4('0x11')](_0x5d37bf);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(_0x471de1,_0x107095,_0x4475ed,_0x5cac84){var _0x4b4b52={'message':_0x107095};_0x4b4b52[_0x471de1]=!![];if(_0x4475ed){_0x4b4b52[_0xabc4('0x12')]=_0x4475ed;}if(_0x5cac84){_0x4b4b52[_0xabc4('0x13')]=_0x5cac84;}return _0x4b4b52;}function isEmail(_0x153b65){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))*$/[_0xabc4('0x14')](_0x153b65);}function checkRow(_0x4f3b32,_0x42dc5d,_0x4735e7){return new BPromise(function(_0x1d8561,_0x20568e){if(_[_0xabc4('0x15')](_0x4f3b32)){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),_0xabc4('0x16'),null,_0x4735e7));}if(_0x4f3b32[_0xabc4('0x17')]&&_0x4f3b32[_0xabc4('0x17')]['length']){var _0x476949=_[_0xabc4('0x18')](_0x4f3b32[_0xabc4('0x17')],_0xabc4('0x19'))[_0xabc4('0x1a')](';');return _0x20568e(handleCheckRowError('error',_0x476949,null,_0x4735e7));}var _0x121ade={};for(var _0x1aca6e in FIELDS){if(FIELDS['hasOwnProperty'](_0x1aca6e)&&FIELDS[_0x1aca6e]){_0x121ade[_0x1aca6e]=_0x4f3b32[_0xabc4('0x1b')][0x0][FIELDS[_0x1aca6e]]||_0x4f3b32[_0xabc4('0x1b')][0x0]['\ufeff'+FIELDS[_0x1aca6e]];}}if(!_0x121ade['firstName']){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),_0xabc4('0x1c'),null,_0x4735e7));}if(!_0x121ade[_0xabc4('0x1d')]){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),_0xabc4('0x1e'),null,_0x4735e7));}if(_0x121ade[_0xabc4('0x1f')]){var _0xeac58e=moment(_0x121ade[_0xabc4('0x1f')],'YYYY-MM-DD');if(!_0xeac58e['isValid']()){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4735e7));}}if(_0x121ade['email']){if(!isEmail(_0x121ade[_0xabc4('0x20')])){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),_0xabc4('0x21'),null,_0x4735e7));}}_0x121ade[_0xabc4('0x22')]=LISTID;_0x121ade[_0xabc4('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x42dc5d){var _0x365fd8={};for(var _0x52d525=0x0,_0x1b8f3b=DUPLICATES[_0xabc4('0x24')];_0x52d525<_0x1b8f3b;_0x52d525+=0x1){_0x365fd8[DUPLICATES[_0x52d525]]=_0x121ade[DUPLICATES[_0x52d525]];}var _0x4e2038=_[_0xabc4('0x25')](_0x42dc5d,_0x365fd8);if(_0x4e2038){return _0x20568e(handleCheckRowError(_0xabc4('0x26'),_0xabc4('0x27'),_0x4e2038,_0x4735e7));}}return db['CmContact'][_0xabc4('0x28')](_0x121ade,{'raw':!![],'hooks':![],'fields':_[_0xabc4('0x29')](_0x121ade)})[_0xabc4('0x2a')](function(_0xc9fb0b){if(DUPLICATES&&DUPLICATES[_0xabc4('0x24')]&&_0x42dc5d){_0x42dc5d[_0xabc4('0x2b')](_[_0xabc4('0x2c')](_0x121ade,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc9fb0b['id'];return _0x1d8561();})['catch'](function(_0x450db0){return _0x20568e(handleCheckRowError(_0xabc4('0x11'),_0xabc4('0x2d')+(_0x450db0[_0xabc4('0x19')]||JSON[_0xabc4('0x2e')](_0x450db0)),null,_0x4735e7));});});}function checkHopper(){function _0x854758(){return function(_0x347c5b){logger[_0xabc4('0x11')]('cmContact',_0xabc4('0x2f'),util[_0xabc4('0x30')](_0x347c5b,{'showHidden':![],'depth':null}));};}var _0x383be8=function(_0x85f1eb,_0x43e15e){var _0x1e9088=squel[_0xabc4('0x31')]()[_0xabc4('0x32')](_0xabc4('0x33'))[_0xabc4('0x34')]([_0xabc4('0x1d'),'scheduledAt',_0xabc4('0x35'),'ListId',_0x43e15e,'createdAt','updatedAt'],squel[_0xabc4('0x36')]()[_0xabc4('0x37')](_0xabc4('0x1d'),_0xabc4('0x1d'))[_0xabc4('0x37')](_0xabc4('0x38'),'scheduledAt')[_0xabc4('0x37')]('id',_0xabc4('0x35'))['field'](LISTID[_0xabc4('0x39')](),_0xabc4('0x22'))['field'](_0x85f1eb['id'][_0xabc4('0x39')](),_0x43e15e)['field'](_0xabc4('0x38'),_0xabc4('0x3a'))[_0xabc4('0x37')]('NOW()',_0xabc4('0x3b'))['from'](_0xabc4('0x3c'))[_0xabc4('0x3d')](_0xabc4('0x3e'))[_0xabc4('0x3d')](_0xabc4('0x3f'),LISTID[_0xabc4('0x39')]())[_0xabc4('0x3d')](_0xabc4('0x40'))['where'](_0xabc4('0x41'),squel['select']()[_0xabc4('0x37')](_0xabc4('0x1d'))[_0xabc4('0x42')]('cm_hopper')['where'](_0x43e15e+_0xabc4('0x43'),_0x85f1eb['id'][_0xabc4('0x39')]())))[_0xabc4('0x39')]();return _0x1e9088;};var _0x36a203=function(_0x3292ed,_0x4b047d){var _0x2d7b73=squel[_0xabc4('0x31')]()[_0xabc4('0x32')]('cm_hopper')['fromQuery']([_0xabc4('0x1d'),'scheduledAt',_0xabc4('0x35'),_0xabc4('0x22'),_0x4b047d,'createdAt',_0xabc4('0x3b')],squel[_0xabc4('0x36')]()[_0xabc4('0x37')](_0xabc4('0x1d'),_0xabc4('0x1d'))[_0xabc4('0x37')](_0xabc4('0x38'),_0xabc4('0x44'))['field']('id',_0xabc4('0x35'))[_0xabc4('0x37')](LISTID[_0xabc4('0x39')](),'ListId')[_0xabc4('0x37')](_0x3292ed['id'][_0xabc4('0x39')](),_0x4b047d)[_0xabc4('0x37')](_0xabc4('0x38'),_0xabc4('0x3a'))['field'](_0xabc4('0x38'),_0xabc4('0x3b'))['from'](_0xabc4('0x3c'))[_0xabc4('0x3d')](_0xabc4('0x3e'))['where']('ListId\x20=\x20?',LISTID[_0xabc4('0x39')]())['where']('id\x20IN\x20?',squel[_0xabc4('0x45')](hopperContacts))[_0xabc4('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xabc4('0x41'),squel[_0xabc4('0x36')]()[_0xabc4('0x37')](_0xabc4('0x46'))[_0xabc4('0x42')](_0xabc4('0x47'))[_0xabc4('0x3d')](_0x4b047d+_0xabc4('0x43'),_0x3292ed['id'][_0xabc4('0x39')]()))[_0xabc4('0x3d')](_0xabc4('0x41'),squel[_0xabc4('0x36')]()['field']('phone')[_0xabc4('0x42')]('cm_hopper')[_0xabc4('0x3d')](_0x4b047d+'\x20=\x20?',_0x3292ed['id'][_0xabc4('0x39')]())))['toString']();return _0x2d7b73;};function _0x1f04bb(_0x3bc9c2,_0x3128f9){var _0x4e9a32=squel[_0xabc4('0x31')]()['into']('cm_hopper')['fromQuery']([_0xabc4('0x1d'),_0xabc4('0x44'),_0xabc4('0x35'),_0xabc4('0x22'),_0x3128f9,_0xabc4('0x3a'),_0xabc4('0x3b')],squel[_0xabc4('0x36')]()[_0xabc4('0x37')](_0xabc4('0x1d'),'phone')[_0xabc4('0x37')]('NOW()',_0xabc4('0x44'))[_0xabc4('0x37')]('id',_0xabc4('0x35'))[_0xabc4('0x37')](LISTID[_0xabc4('0x39')](),_0xabc4('0x22'))[_0xabc4('0x37')](_0x3bc9c2['id'][_0xabc4('0x39')](),_0x3128f9)[_0xabc4('0x37')](_0xabc4('0x38'),_0xabc4('0x3a'))[_0xabc4('0x37')](_0xabc4('0x38'),_0xabc4('0x3b'))[_0xabc4('0x42')](_0xabc4('0x3c'))[_0xabc4('0x3d')](_0xabc4('0x3e'))['where'](_0xabc4('0x3f'),LISTID[_0xabc4('0x39')]())[_0xabc4('0x3d')](_0xabc4('0x48'),squel[_0xabc4('0x45')](hopperContacts))[_0xabc4('0x3d')](_0xabc4('0x40')))[_0xabc4('0x39')]();return _0x4e9a32;}function _0x115027(_0x1f749e,_0x162376){var _0x2025fe=squel['insert']()[_0xabc4('0x32')](_0xabc4('0x49'))[_0xabc4('0x34')]([_0xabc4('0x1d'),_0xabc4('0x35'),_0xabc4('0x22'),_0x162376,_0xabc4('0x3a'),_0xabc4('0x3b')],squel['select']()[_0xabc4('0x37')](_0xabc4('0x1d'),_0xabc4('0x1d'))[_0xabc4('0x37')]('id',_0xabc4('0x35'))['field'](LISTID[_0xabc4('0x39')](),_0xabc4('0x22'))['field'](_0x1f749e['id'][_0xabc4('0x39')](),_0x162376)[_0xabc4('0x37')](_0xabc4('0x38'),_0xabc4('0x3a'))['field'](_0xabc4('0x38'),_0xabc4('0x3b'))[_0xabc4('0x42')](_0xabc4('0x3c'))[_0xabc4('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0xabc4('0x39')]())[_0xabc4('0x3d')](_0xabc4('0x48'),squel[_0xabc4('0x45')](hopperContacts))[_0xabc4('0x3d')](_0xabc4('0x40')))['toString']();return _0x2025fe;}return db[_0xabc4('0x4a')][_0xabc4('0x4b')]({'where':{'type':_0xabc4('0x4c')},'attributes':['id',_0xabc4('0x4d')],'include':[{'model':db[_0xabc4('0x4e')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x35b5db){var _0x9980a9=[];if(_0x35b5db){var _0x34adb7;for(var _0x3579b5=0x0,_0x1b523f;_0x3579b5<_0x35b5db[_0xabc4('0x24')];_0x3579b5+=0x1){_0x1b523f=_0x35b5db[_0x3579b5][_0xabc4('0x4f')]({'plain':!![]});switch(_0x1b523f[_0xabc4('0x4d')]){case _0xabc4('0x50'):_0x9980a9['push'](db['sequelize']['query'](_0x36a203(_0x1b523f,_0xabc4('0x51')))[_0xabc4('0x2a')](function(){})[_0xabc4('0x52')](_0x854758()));break;case'onlyIfOpen':_0x9980a9[_0xabc4('0x2b')](db[_0xabc4('0x53')][_0xabc4('0x54')](_0x383be8(_0x1b523f,_0xabc4('0x51')))[_0xabc4('0x2a')](function(){})[_0xabc4('0x52')](_0x854758()));break;default:_0x9980a9[_0xabc4('0x2b')](db['sequelize'][_0xabc4('0x54')](_0x1f04bb(_0x1b523f,_0xabc4('0x51')))[_0xabc4('0x2a')](function(){})['catch'](_0x854758()));}}}return _0x9980a9;})[_0xabc4('0x55')]()['then'](function(){return db['VoiceQueue'][_0xabc4('0x4b')]({'where':{'type':_0xabc4('0x4c')},'attributes':['id'],'include':[{'model':db[_0xabc4('0x4e')],'as':_0xabc4('0x56'),'where':{'id':LISTID}}]})[_0xabc4('0x2a')](function(_0x2e90b2){var _0x36c448=[];if(_0x2e90b2){var _0x4d1050;for(var _0x5b1b14=0x0,_0x50ef75;_0x5b1b14<_0x2e90b2[_0xabc4('0x24')];_0x5b1b14+=0x1){_0x50ef75=_0x2e90b2[_0x5b1b14]['get']({'plain':!![]});_0x36c448[_0xabc4('0x2b')](db[_0xabc4('0x53')][_0xabc4('0x54')](_0x115027(_0x50ef75,_0xabc4('0x51')))[_0xabc4('0x2a')](function(){})['catch'](_0x854758()));}}return _0x36c448;})[_0xabc4('0x55')]();})[_0xabc4('0x2a')](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xabc4('0x4e')],'as':_0xabc4('0x57'),'where':{'id':LISTID}}]})[_0xabc4('0x2a')](function(_0x53397d){var _0x43eb65=[];if(_0x53397d){for(var _0x2c0942=0x0,_0x5ab6e7;_0x2c0942<_0x53397d['length'];_0x2c0942+=0x1){_0x5ab6e7=_0x53397d[_0x2c0942][_0xabc4('0x4f')]({'plain':!![]});switch(_0x5ab6e7[_0xabc4('0x4d')]){case _0xabc4('0x50'):_0x43eb65[_0xabc4('0x2b')](db[_0xabc4('0x53')][_0xabc4('0x54')](_0x36a203(_0x5ab6e7,_0xabc4('0x58')))[_0xabc4('0x2a')](function(){})[_0xabc4('0x52')](_0x854758()));break;case'onlyIfOpen':_0x43eb65['push'](db[_0xabc4('0x53')]['query'](_0x383be8(_0x5ab6e7,_0xabc4('0x58')))[_0xabc4('0x2a')](function(){})[_0xabc4('0x52')](_0x854758()));break;default:_0x43eb65[_0xabc4('0x2b')](db[_0xabc4('0x53')][_0xabc4('0x54')](_0x1f04bb(_0x5ab6e7,_0xabc4('0x58')))[_0xabc4('0x2a')](function(){})['catch'](_0x854758()));}}}return _0x43eb65;})[_0xabc4('0x55')]();})[_0xabc4('0x2a')](function(){return db[_0xabc4('0x59')][_0xabc4('0x4b')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xabc4('0x56'),'where':{'id':LISTID}}]})[_0xabc4('0x2a')](function(_0x587102){var _0x437fa7=[];if(_0x587102){for(var _0x13d2d9=0x0,_0x149bd8;_0x13d2d9<_0x587102[_0xabc4('0x24')];_0x13d2d9+=0x1){_0x149bd8=_0x587102[_0x13d2d9][_0xabc4('0x4f')]({'plain':!![]});_0x437fa7[_0xabc4('0x2b')](db[_0xabc4('0x53')][_0xabc4('0x54')](_0x115027(_0x149bd8,'CampaignId'))[_0xabc4('0x2a')](function(){})['catch'](_0x854758()));}}return _0x437fa7;})[_0xabc4('0x55')]();})[_0xabc4('0x52')](function(_0x1a7364){logger['error'](_0xabc4('0x5a'),_0xabc4('0x5b'),_0x1a7364['message']);});}var processPromises=function(_0xc19e73){return BPromise[_0xabc4('0x55')](promises)[_0xabc4('0x2a')](function(_0x2dccc1){})['catch'](function(_0x4807de){logger[_0xabc4('0x11')](_0xabc4('0x5c'),JSON['stringify'](_0x4807de));})[_0xabc4('0x5d')](function(){socket[_0xabc4('0x5e')](_0xabc4('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xc19e73){return _0xc19e73[_0xabc4('0x60')]();}});};var endCsv=function(){return BPromise[_0xabc4('0x61')]()[_0xabc4('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xabc4('0x2a')](function(){socket[_0xabc4('0x5e')](_0xabc4('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xabc4('0x62')](FILEPATH);}catch(_0x471db7){logger[_0xabc4('0x11')](_0xabc4('0x63'),JSON[_0xabc4('0x2e')](_0x471db7));}finally{process[_0xabc4('0x64')](0x0);}});};process['on'](_0xabc4('0x65'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xabc4('0x61')]()[_0xabc4('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xabc4('0xf')](',');return db[_0xabc4('0x66')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x42ee19){var _0x59849d=fs[_0xabc4('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xabc4('0x68')](_0x59849d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e8334,_0x5cdcad){total+=0x1;var _0x5fbdce=total;promises[_0xabc4('0x2b')](checkRow(_0x4e8334,_0x42ee19,_0x5fbdce)[_0xabc4('0x2a')](function(){success+=0x1;})['catch'](function(_0x3bed0f){if(_0x3bed0f[_0xabc4('0x11')]){errors+=0x1;delete _0x3bed0f[_0xabc4('0x11')];}else if(_0x3bed0f[_0xabc4('0x26')]){duplicates+=0x1;delete _0x3bed0f[_0xabc4('0x26')];}rows[_0xabc4('0x2b')](_0x3bed0f);}));if(total%0xc8===0x0){_0x5cdcad[_0xabc4('0x69')]();return processPromises(_0x5cdcad);}},'complete':function(){return processPromises()[_0xabc4('0x2a')](function(){logger[_0xabc4('0x6a')](_0xabc4('0x6b'));endCsv();});},'error':function(_0x42f49d,_0x3bddb1){logger['info'](_0xabc4('0x6c'),JSON['stringify'](_0x42f49d));endCsv();}});})[_0xabc4('0x52')](function(_0x5e8907){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xabc4('0x2e')](_0x5e8907));});}main(); \ No newline at end of file +var _0x774e=['ListId\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','ContactId','createdAt','updatedAt','field','NOW()','scheduledAt','toString','from','cm_contacts','where','phone\x20NOT\x20IN\x20(?)','select','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','fromQuery','deletedAt\x20IS\x20NULL'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x774e,0x16f));var _0xe774=function(_0x108608,_0x322e42){_0x108608=_0x108608-0x0;var _0x26c295=_0x774e[_0x108608];return _0x26c295;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xe774('0x0'));var Papa=require(_0xe774('0x1'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xe774('0x2'))(_0xe774('0x3'));config[_0xe774('0x4')]=_[_0xe774('0x5')](config[_0xe774('0x4')],{'host':_0xe774('0x6'),'port':0x18eb});var socket=require(_0xe774('0x7'))(new Redis(config['redis']));require(_0xe774('0x8'))[_0xe774('0x9')](socket);try{if(!process['argv'][0x2]||process[_0xe774('0xa')][0x2]===_0xe774('0xb')||process[_0xe774('0xa')][0x2]===_0xe774('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xe774('0xa')][0x2];if(!process[_0xe774('0xa')][0x3]||process[_0xe774('0xa')][0x3]==='undefined'||process[_0xe774('0xa')][0x3]===_0xe774('0xc')||!process[_0xe774('0xa')][0x4]||process[_0xe774('0xa')][0x4]===_0xe774('0xb')||process[_0xe774('0xa')][0x4]===_0xe774('0xc')){throw new Error(_0xe774('0xd'));}var FIELDS=_[_0xe774('0xe')](process[_0xe774('0xa')][0x3]['split'](','),process['argv'][0x4][_0xe774('0xf')](','));if(!process[_0xe774('0xa')][0x5]||process['argv'][0x5]===_0xe774('0xb')||process[_0xe774('0xa')][0x5]===_0xe774('0xc')){throw new Error(_0xe774('0x10'));}var LISTID=process[_0xe774('0xa')][0x5];var COMPANYID=process[_0xe774('0xa')][0x6]&&process[_0xe774('0xa')][0x6]!==_0xe774('0xb')&&process[_0xe774('0xa')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xe774('0xa')][0x7]&&process['argv'][0x7]!==_0xe774('0xb')&&process['argv'][0x7]!=='null'?process[_0xe774('0xa')][0x7]:null;if(!process[_0xe774('0xa')][0x8]||process[_0xe774('0xa')][0x8]===_0xe774('0xb')||process['argv'][0x8]===_0xe774('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xe774('0xa')][0x8];}catch(_0x5484f3){logger['error'](_0x5484f3);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(_0x14c439,_0x3903fd,_0x2f8a20,_0x20e7a9){var _0x486914={'message':_0x3903fd};_0x486914[_0x14c439]=!![];if(_0x2f8a20){_0x486914[_0xe774('0x11')]=_0x2f8a20;}if(_0x20e7a9){_0x486914[_0xe774('0x12')]=_0x20e7a9;}return _0x486914;}function isEmail(_0x58b4aa){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))*$/[_0xe774('0x13')](_0x58b4aa);}function checkRow(_0x977eaf,_0x524aac,_0x23c828){return new BPromise(function(_0x57aab9,_0x3f00eb){if(_['isNil'](_0x977eaf)){return _0x3f00eb(handleCheckRowError('error',_0xe774('0x14'),null,_0x23c828));}if(_0x977eaf['errors']&&_0x977eaf['errors'][_0xe774('0x15')]){var _0x4a5c10=_[_0xe774('0x16')](_0x977eaf['errors'],_0xe774('0x17'))[_0xe774('0x18')](';');return _0x3f00eb(handleCheckRowError(_0xe774('0x19'),_0x4a5c10,null,_0x23c828));}var _0x428fef={};for(var _0x25ae06 in FIELDS){if(FIELDS[_0xe774('0x1a')](_0x25ae06)&&FIELDS[_0x25ae06]){_0x428fef[_0x25ae06]=_0x977eaf['data'][0x0][FIELDS[_0x25ae06]]||_0x977eaf[_0xe774('0x1b')][0x0]['\ufeff'+FIELDS[_0x25ae06]];}}if(!_0x428fef[_0xe774('0x1c')]){return _0x3f00eb(handleCheckRowError(_0xe774('0x19'),_0xe774('0x1d'),null,_0x23c828));}if(!_0x428fef[_0xe774('0x1e')]){return _0x3f00eb(handleCheckRowError(_0xe774('0x19'),'phone\x20not\x20specified!',null,_0x23c828));}if(_0x428fef['birthDate']){var _0x505beb=moment(_0x428fef[_0xe774('0x1f')],_0xe774('0x20'));if(!_0x505beb[_0xe774('0x21')]()){return _0x3f00eb(handleCheckRowError(_0xe774('0x19'),_0xe774('0x22'),null,_0x23c828));}}if(_0x428fef['email']){if(!isEmail(_0x428fef[_0xe774('0x23')])){return _0x3f00eb(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x23c828));}}_0x428fef[_0xe774('0x24')]=LISTID;_0x428fef[_0xe774('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe774('0x15')]&&_0x524aac){var _0xa3556f={};for(var _0x572c8c=0x0,_0x3a9112=DUPLICATES[_0xe774('0x15')];_0x572c8c<_0x3a9112;_0x572c8c+=0x1){_0xa3556f[DUPLICATES[_0x572c8c]]=_0x428fef[DUPLICATES[_0x572c8c]];}var _0x16c67c=_['find'](_0x524aac,_0xa3556f);if(_0x16c67c){return _0x3f00eb(handleCheckRowError('duplicate',_0xe774('0x26'),_0x16c67c,_0x23c828));}}return db[_0xe774('0x27')][_0xe774('0x28')](_0x428fef,{'raw':!![],'hooks':![],'fields':_[_0xe774('0x29')](_0x428fef)})[_0xe774('0x2a')](function(_0x190b64){if(DUPLICATES&&DUPLICATES[_0xe774('0x15')]&&_0x524aac){_0x524aac[_0xe774('0x2b')](_[_0xe774('0x2c')](_0x428fef,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x190b64['id'];return _0x57aab9();})[_0xe774('0x2d')](function(_0x4a8c3a){return _0x3f00eb(handleCheckRowError(_0xe774('0x19'),_0xe774('0x2e')+(_0x4a8c3a[_0xe774('0x17')]||JSON['stringify'](_0x4a8c3a)),null,_0x23c828));});});}function checkHopper(){function _0x4c2adb(){return function(_0xfa523f){logger[_0xe774('0x19')](_0xe774('0x2f'),_0xe774('0x30'),util[_0xe774('0x31')](_0xfa523f,{'showHidden':![],'depth':null}));};}var _0x27dd94=function(_0x618ad6,_0x2a4f3d){var _0x164351=squel[_0xe774('0x32')]()[_0xe774('0x33')](_0xe774('0x34'))['fromQuery']([_0xe774('0x1e'),'scheduledAt',_0xe774('0x35'),_0xe774('0x24'),_0x2a4f3d,_0xe774('0x36'),_0xe774('0x37')],squel['select']()[_0xe774('0x38')](_0xe774('0x1e'),'phone')['field'](_0xe774('0x39'),_0xe774('0x3a'))['field']('id',_0xe774('0x35'))['field'](LISTID[_0xe774('0x3b')](),'ListId')[_0xe774('0x38')](_0x618ad6['id']['toString'](),_0x2a4f3d)[_0xe774('0x38')](_0xe774('0x39'),_0xe774('0x36'))[_0xe774('0x38')]('NOW()','updatedAt')[_0xe774('0x3c')](_0xe774('0x3d'))[_0xe774('0x3e')]('deletedAt\x20IS\x20NULL')[_0xe774('0x3e')]('ListId\x20=\x20?',LISTID[_0xe774('0x3b')]())[_0xe774('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xe774('0x3e')](_0xe774('0x3f'),squel[_0xe774('0x40')]()[_0xe774('0x38')](_0xe774('0x1e'))['from'](_0xe774('0x34'))[_0xe774('0x3e')](_0x2a4f3d+'\x20=\x20?',_0x618ad6['id'][_0xe774('0x3b')]())))[_0xe774('0x3b')]();return _0x164351;};var _0x2ed6b9=function(_0xab4613,_0x5e7c0c){var _0x5d02bc=squel[_0xe774('0x32')]()[_0xe774('0x33')](_0xe774('0x34'))['fromQuery'](['phone',_0xe774('0x3a'),_0xe774('0x35'),'ListId',_0x5e7c0c,'createdAt',_0xe774('0x37')],squel[_0xe774('0x40')]()['field'](_0xe774('0x1e'),_0xe774('0x1e'))[_0xe774('0x38')]('NOW()','scheduledAt')[_0xe774('0x38')]('id',_0xe774('0x35'))['field'](LISTID[_0xe774('0x3b')](),'ListId')[_0xe774('0x38')](_0xab4613['id'][_0xe774('0x3b')](),_0x5e7c0c)['field']('NOW()',_0xe774('0x36'))[_0xe774('0x38')](_0xe774('0x39'),_0xe774('0x37'))['from'](_0xe774('0x3d'))[_0xe774('0x3e')]('deletedAt\x20IS\x20NULL')[_0xe774('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0xe774('0x3e')](_0xe774('0x41'),squel[_0xe774('0x42')](hopperContacts))[_0xe774('0x3e')](_0xe774('0x43'))[_0xe774('0x3e')](_0xe774('0x3f'),squel[_0xe774('0x40')]()[_0xe774('0x38')](_0xe774('0x44'))[_0xe774('0x3c')](_0xe774('0x45'))[_0xe774('0x3e')](_0x5e7c0c+_0xe774('0x46'),_0xab4613['id'][_0xe774('0x3b')]()))[_0xe774('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe774('0x40')]()[_0xe774('0x38')]('phone')[_0xe774('0x3c')](_0xe774('0x34'))[_0xe774('0x3e')](_0x5e7c0c+_0xe774('0x46'),_0xab4613['id'][_0xe774('0x3b')]())))[_0xe774('0x3b')]();return _0x5d02bc;};function _0x513bbf(_0x3ff196,_0x1902c4){var _0x5d978c=squel[_0xe774('0x32')]()['into'](_0xe774('0x34'))[_0xe774('0x47')]([_0xe774('0x1e'),'scheduledAt','ContactId',_0xe774('0x24'),_0x1902c4,_0xe774('0x36'),_0xe774('0x37')],squel[_0xe774('0x40')]()[_0xe774('0x38')]('phone','phone')['field']('NOW()',_0xe774('0x3a'))[_0xe774('0x38')]('id',_0xe774('0x35'))[_0xe774('0x38')](LISTID[_0xe774('0x3b')](),_0xe774('0x24'))[_0xe774('0x38')](_0x3ff196['id']['toString'](),_0x1902c4)[_0xe774('0x38')](_0xe774('0x39'),_0xe774('0x36'))[_0xe774('0x38')](_0xe774('0x39'),_0xe774('0x37'))[_0xe774('0x3c')]('cm_contacts')['where'](_0xe774('0x48'))[_0xe774('0x3e')](_0xe774('0x49'),LISTID[_0xe774('0x3b')]())[_0xe774('0x3e')](_0xe774('0x41'),squel[_0xe774('0x42')](hopperContacts))[_0xe774('0x3e')](_0xe774('0x43')))[_0xe774('0x3b')]();return _0x5d978c;}function _0x2b119c(_0x3223cd,_0x2b05fd){var _0x42597e=squel[_0xe774('0x32')]()[_0xe774('0x33')](_0xe774('0x4a'))[_0xe774('0x47')]([_0xe774('0x1e'),'ContactId',_0xe774('0x24'),_0x2b05fd,_0xe774('0x36'),_0xe774('0x37')],squel[_0xe774('0x40')]()[_0xe774('0x38')](_0xe774('0x1e'),_0xe774('0x1e'))[_0xe774('0x38')]('id',_0xe774('0x35'))[_0xe774('0x38')](LISTID[_0xe774('0x3b')](),'ListId')[_0xe774('0x38')](_0x3223cd['id'][_0xe774('0x3b')](),_0x2b05fd)[_0xe774('0x38')](_0xe774('0x39'),_0xe774('0x36'))[_0xe774('0x38')](_0xe774('0x39'),'updatedAt')[_0xe774('0x3c')](_0xe774('0x3d'))['where'](_0xe774('0x48'))[_0xe774('0x3e')](_0xe774('0x49'),LISTID[_0xe774('0x3b')]())[_0xe774('0x3e')](_0xe774('0x41'),squel[_0xe774('0x42')](hopperContacts))['where'](_0xe774('0x43')))[_0xe774('0x3b')]();return _0x42597e;}return db[_0xe774('0x4b')][_0xe774('0x4c')]({'where':{'type':_0xe774('0x4d')},'attributes':['id',_0xe774('0x4e')],'include':[{'model':db[_0xe774('0x4f')],'as':_0xe774('0x50'),'where':{'id':LISTID}}]})[_0xe774('0x2a')](function(_0xb04610){var _0x4dbd7d=[];if(_0xb04610){var _0x20f6b9;for(var _0x55c9d6=0x0,_0x258ba1;_0x55c9d6<_0xb04610['length'];_0x55c9d6+=0x1){_0x258ba1=_0xb04610[_0x55c9d6][_0xe774('0x51')]({'plain':!![]});switch(_0x258ba1[_0xe774('0x4e')]){case _0xe774('0x52'):_0x4dbd7d['push'](db[_0xe774('0x53')][_0xe774('0x54')](_0x2ed6b9(_0x258ba1,'VoiceQueueId'))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));break;case _0xe774('0x55'):_0x4dbd7d['push'](db['sequelize'][_0xe774('0x54')](_0x27dd94(_0x258ba1,'VoiceQueueId'))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));break;default:_0x4dbd7d[_0xe774('0x2b')](db[_0xe774('0x53')][_0xe774('0x54')](_0x513bbf(_0x258ba1,_0xe774('0x56')))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));}}}return _0x4dbd7d;})[_0xe774('0x57')]()[_0xe774('0x2a')](function(){return db[_0xe774('0x4b')][_0xe774('0x4c')]({'where':{'type':_0xe774('0x4d')},'attributes':['id'],'include':[{'model':db[_0xe774('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x5312ce){var _0x113ffe=[];if(_0x5312ce){var _0x2d17e5;for(var _0x4261ca=0x0,_0x3ea901;_0x4261ca<_0x5312ce[_0xe774('0x15')];_0x4261ca+=0x1){_0x3ea901=_0x5312ce[_0x4261ca][_0xe774('0x51')]({'plain':!![]});_0x113ffe['push'](db['sequelize'][_0xe774('0x54')](_0x2b119c(_0x3ea901,_0xe774('0x56')))['then'](function(){})['catch'](_0x4c2adb()));}}return _0x113ffe;})[_0xe774('0x57')]();})[_0xe774('0x2a')](function(){return db[_0xe774('0x58')][_0xe774('0x4c')]({'attributes':['id',_0xe774('0x4e')],'include':[{'model':db[_0xe774('0x4f')],'as':_0xe774('0x50'),'where':{'id':LISTID}}]})[_0xe774('0x2a')](function(_0x27c35d){var _0x5ce456=[];if(_0x27c35d){for(var _0x2b9fd0=0x0,_0x135af2;_0x2b9fd0<_0x27c35d[_0xe774('0x15')];_0x2b9fd0+=0x1){_0x135af2=_0x27c35d[_0x2b9fd0][_0xe774('0x51')]({'plain':!![]});switch(_0x135af2[_0xe774('0x4e')]){case'always':_0x5ce456[_0xe774('0x2b')](db[_0xe774('0x53')][_0xe774('0x54')](_0x2ed6b9(_0x135af2,_0xe774('0x59')))[_0xe774('0x2a')](function(){})['catch'](_0x4c2adb()));break;case _0xe774('0x55'):_0x5ce456[_0xe774('0x2b')](db[_0xe774('0x53')]['query'](_0x27dd94(_0x135af2,'CampaignId'))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));break;default:_0x5ce456[_0xe774('0x2b')](db[_0xe774('0x53')][_0xe774('0x54')](_0x513bbf(_0x135af2,'CampaignId'))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));}}}return _0x5ce456;})[_0xe774('0x57')]();})[_0xe774('0x2a')](function(){return db[_0xe774('0x58')][_0xe774('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xe774('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x1da8f4){var _0x31d87f=[];if(_0x1da8f4){for(var _0x178a58=0x0,_0x9cd172;_0x178a58<_0x1da8f4[_0xe774('0x15')];_0x178a58+=0x1){_0x9cd172=_0x1da8f4[_0x178a58][_0xe774('0x51')]({'plain':!![]});_0x31d87f['push'](db['sequelize'][_0xe774('0x54')](_0x2b119c(_0x9cd172,'CampaignId'))[_0xe774('0x2a')](function(){})[_0xe774('0x2d')](_0x4c2adb()));}}return _0x31d87f;})[_0xe774('0x57')]();})[_0xe774('0x2d')](function(_0x4a7f69){logger[_0xe774('0x19')](_0xe774('0x5b'),_0xe774('0x5c'),_0x4a7f69[_0xe774('0x17')]);});}var processPromises=function(_0x3ae005){return BPromise['all'](promises)[_0xe774('0x2a')](function(_0x1c1375){})[_0xe774('0x2d')](function(_0x37d813){logger['error'](_0xe774('0x5d'),JSON[_0xe774('0x5e')](_0x37d813));})[_0xe774('0x5f')](function(){socket[_0xe774('0x60')](_0xe774('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3ae005){return _0x3ae005[_0xe774('0x62')]();}});};var endCsv=function(){return BPromise[_0xe774('0x63')]()[_0xe774('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xe774('0x2a')](function(){socket[_0xe774('0x60')](_0xe774('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe774('0x64')](FILEPATH);}catch(_0x5229d7){logger[_0xe774('0x19')](_0xe774('0x65'),JSON['stringify'](_0x5229d7));}finally{process[_0xe774('0x66')](0x0);}});};process['on']('SIGINT',function(){logger[_0xe774('0x67')](_0xe774('0x68'));endCsv();});function main(){return BPromise[_0xe774('0x63')]()[_0xe774('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe774('0xf')](',');return db[_0xe774('0x27')][_0xe774('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe774('0x2a')](function(_0x2dd511){var _0x17950a=fs[_0xe774('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe774('0x6a')](_0x17950a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x30288c,_0x961e98){total+=0x1;var _0x1f94e4=total;promises[_0xe774('0x2b')](checkRow(_0x30288c,_0x2dd511,_0x1f94e4)[_0xe774('0x2a')](function(){success+=0x1;})[_0xe774('0x2d')](function(_0x3f2ea1){if(_0x3f2ea1[_0xe774('0x19')]){errors+=0x1;delete _0x3f2ea1[_0xe774('0x19')];}else if(_0x3f2ea1['duplicate']){duplicates+=0x1;delete _0x3f2ea1['duplicate'];}rows[_0xe774('0x2b')](_0x3f2ea1);}));if(total%0xc8===0x0){_0x961e98[_0xe774('0x6b')]();return processPromises(_0x961e98);}},'complete':function(){return processPromises()[_0xe774('0x2a')](function(){logger[_0xe774('0x67')](_0xe774('0x6c'));endCsv();});},'error':function(_0x41c241,_0x4bfb7e){logger['info']('CSV\x20parse\x20error',JSON[_0xe774('0x5e')](_0x41c241));endCsv();}});})[_0xe774('0x2d')](function(_0x4f20f6){logger['error'](_0xe774('0x6d'),JSON[_0xe774('0x5e')](_0x4f20f6));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index bcf22e1..2bf91a6 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 _0x3648=['SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','emit','unlink','catch','complete','arguments\x20\x20\x20','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','cm_hopper','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','join','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.updatedAt','into','fromQuery','ContactId','cm_contacts','\x20=\x20?','concat','keys','CompanyId','createdAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','message','exit','code','sequelize','query','spread','push','error','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','errors','data','hasOwnProperty','trim','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','appendFileSync','contact:import:','Abort\x20parser','abort'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x3648,0x13e));var _0x8364=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3648[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x8364('0x0'));var _=require(_0x8364('0x1'));var Papa=require(_0x8364('0x2'));var util=require(_0x8364('0x3'));var BPromise=require(_0x8364('0x4'));var moment=require(_0x8364('0x5'));var squel=require(_0x8364('0x6'));var Redis=require('ioredis');var db=require(_0x8364('0x7'))['db'];var config=require(_0x8364('0x8'));var logger=require(_0x8364('0x9'))(_0x8364('0xa'));config[_0x8364('0xb')]=_[_0x8364('0xc')](config[_0x8364('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8364('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8364('0xe')](_0x8364('0xf'));function isEmail(_0x4e065d){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))*$/[_0x8364('0x10')](_0x4e065d);}function selectNotIn(_0x4533ba,_0x34b720,_0x261666,_0x40963b,_0x33c072){return squel[_0x8364('0x11')]()[_0x8364('0x12')](_0x8364('0x13'))[_0x8364('0x14')](_0x40963b)['join'](_0x34b720,null,_0x34b720+_0x8364('0x15')+_0x40963b+'.'+_0x261666)[_0x8364('0x16')](_0x40963b+'.'+_0x261666+_0x8364('0x17')+_0x4533ba+'.'+_0x261666)[_0x8364('0x16')](_0x34b720+_0x8364('0x18')+_0x33c072['join']()+')');}function insertCmHopper(_0x2e1db4,_0x43e079,_0x209593,_0x3b2f5d,_0x2da14a){var _0x564a18=[_0x8364('0x19'),_0x8364('0x1a'),_0x8364('0x1b'),_0x8364('0x1c'),_0x43e079+'.'+_0x3b2f5d,_0x8364('0x1d'),'cm_contacts.updatedAt','cm_contacts.priority',_0x8364('0x1e'),'\x22'+_0x2da14a+'\x22'];return squel[_0x8364('0x1f')]()['into'](_0x8364('0x20'))['fromQuery'](['phone','scheduledat','ContactId',_0x8364('0x21'),_0x3b2f5d,'createdAt',_0x8364('0x22'),_0x8364('0x23'),_0x8364('0x24'),_0x8364('0x25')],squel[_0x8364('0x11')]()[_0x8364('0x26')](_0x564a18)[_0x8364('0x14')](_0x43e079)['join']('cm_contacts',null,_0x8364('0x27')+_0x43e079+_0x8364('0x28'))[_0x8364('0x29')](_0x209593,null,_0x209593+_0x8364('0x15')+_0x43e079+'.'+_0x3b2f5d)[_0x8364('0x16')](_0x43e079+_0x8364('0x2a'),_0x2e1db4)[_0x8364('0x16')](_0x8364('0x2b'),NOW)[_0x8364('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43e079,_0x209593,_0x3b2f5d,_0x8364('0x20'),[_0x8364('0x2c'),_0x8364('0x2d')]))[_0x8364('0x16')](_0x8364('0x2e'),selectNotIn(_0x43e079,_0x209593,_0x3b2f5d,_0x8364('0x20'),[_0x8364('0x2c')])))[_0x8364('0x2f')]();}function insertCmHopperBlack(_0x235f7a,_0xfd5e4e,_0x581e36,_0x33dc03){var _0x1d0bfb=['cm_contacts.phone',_0x8364('0x1b'),_0x8364('0x1c'),_0xfd5e4e+'.'+_0x33dc03,_0x8364('0x1d'),_0x8364('0x30')];return squel['insert']()[_0x8364('0x31')]('cm_hopper_black')[_0x8364('0x32')]([_0x8364('0x13'),_0x8364('0x33'),_0x8364('0x21'),_0x33dc03,'createdAt',_0x8364('0x22')],squel[_0x8364('0x11')]()[_0x8364('0x26')](_0x1d0bfb)[_0x8364('0x14')](_0xfd5e4e)[_0x8364('0x29')](_0x8364('0x34'),null,_0x8364('0x27')+_0xfd5e4e+_0x8364('0x28'))[_0x8364('0x29')](_0x581e36,null,_0x581e36+'.id\x20=\x20'+_0xfd5e4e+'.'+_0x33dc03)[_0x8364('0x16')](_0xfd5e4e+'.CmListId\x20=\x20?',_0x235f7a)[_0x8364('0x16')](_0x8364('0x2b'),NOW)[_0x8364('0x16')](_0x8364('0x2e'),squel[_0x8364('0x11')]()[_0x8364('0x12')](_0x8364('0x13'))[_0x8364('0x14')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x235f7a)['where'](_0x33dc03+_0x8364('0x35'),_0xfd5e4e+'.'+_0x33dc03)))['toString']();}function insertCmContact(_0x19ccaa,_0x286dba,_0x50948a,_0x449b6a){var _0x39e018=_[_0x8364('0x36')](_[_0x8364('0x37')](_0x449b6a),[_0x8364('0x21'),_0x8364('0x38'),_0x8364('0x39'),_0x8364('0x22')]);return squel[_0x8364('0x1f')]()[_0x8364('0x31')](_0x8364('0x34'))[_0x8364('0x32')](_0x39e018,squel['select']()[_0x8364('0x26')](_0x39e018)[_0x8364('0x14')](_0x286dba)[_0x8364('0x16')]('('+_0x50948a[_0x8364('0x29')](',')+_0x8364('0x3a'),squel[_0x8364('0x11')]()['fields'](_0x50948a)['from'](_0x8364('0x34'))[_0x8364('0x16')](_0x8364('0x3b'),_0x19ccaa)[_0x8364('0x16')](_0x8364('0x3c')))['where'](_0x8364('0x3d'),squel[_0x8364('0x11')]()[_0x8364('0x12')](_0x8364('0x3e'),'min_id')[_0x8364('0x14')](_0x286dba)['group'](_0x50948a['join'](','))))[_0x8364('0x2f')]();}function handleStop(){logger[_0x8364('0x3f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3caae3){logger['error'](_0x3caae3[_0x8364('0x40')]);process[_0x8364('0x41')](0x1);}function handleError(_0x98cafa,_0x5b6628){stats['errors']['push']({'name':_0x5b6628[_0x8364('0x42')],'message':_0x5b6628[_0x8364('0x40')],'row':_0x98cafa});}function handleQuery(_0xadb5ce){logger[_0x8364('0x3f')](_0xadb5ce);return db[_0x8364('0x43')][_0x8364('0x44')](_0xadb5ce)[_0x8364('0x45')](function(_0x47ca1c){results[_0x8364('0x46')](_0x47ca1c);})['catch'](function(_0xfd5675){logger[_0x8364('0x47')](_0xfd5675['message']);});}function main(_0x2fb9ba,_0x33aded,_0x412fb4,_0x841460){logger[_0x8364('0x3f')](_0x8364('0x48'),_0x2fb9ba,JSON[_0x8364('0x49')](_0x33aded));process[_0x8364('0x4a')](_0x8364('0x4b'));var _0x140661=_0x33aded[_0x8364('0x4c')];var _0x4b20f8=_0x33aded[_0x8364('0x4d')];var _0x1b82f5=path[_0x8364('0x29')](config[_0x8364('0x4e')],_0x8364('0x4f'),_0x4b20f8+_0x8364('0x50'));var _0x55f410=_['keys'](_0x140661)[_0x8364('0x29')]();logger[_0x8364('0x3f')](_0x8364('0x51'),_0x55f410);fs[_0x8364('0x52')](_0x1b82f5,_0x55f410+'\x0a');Papa[_0x8364('0x53')](fs[_0x8364('0x54')](_0x2fb9ba),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3184c9,_0x1d6f3a){try{for(var _0x52b4f4=0x0,_0x1a7821=[];_0x52b4f4<_0x3184c9['data'][_0x8364('0x55')];_0x52b4f4++){stats[_0x8364('0x56')]+=0x1;if(_0x3184c9[_0x8364('0x57')][_0x52b4f4]){handleError(_0x3184c9[_0x8364('0x58')][_0x52b4f4],_0x3184c9[_0x8364('0x57')][_0x52b4f4]);}else{var _0x17db6b=[];for(var _0xa5d5d2 in _0x140661){if(_0x140661[_0x8364('0x59')](_0xa5d5d2)){if(_0x3184c9[_0x8364('0x58')][_0x52b4f4][_0x140661[_0xa5d5d2]]){var _0x4f0280=_[_0x8364('0x5a')](_0x3184c9[_0x8364('0x58')][_0x52b4f4][_0x140661[_0xa5d5d2]]['replace'](/"/g,'\x27'));switch(_0xa5d5d2){case _0x8364('0x5b'):var _0x47955f=moment(_0x4f0280,_0x8364('0xf'),!![]);if(_0x47955f[_0x8364('0x5c')]()){_0x1a7821[_0x8364('0x46')]('\x22'+_0x4f0280+'\x22');}else{_0x17db6b[_0x8364('0x46')](_0x8364('0x5d'));}break;case _0x8364('0x23'):var _0x3102fd=parseInt(_0x4f0280);_0x4f0280=_['isNaN'](_0x3102fd)||_0x3102fd<0x0||_0x3102fd>0x4?_0x841460?0x3:0x2:_0x3102fd;_0x1a7821['push']('\x22'+_0x4f0280+'\x22');break;case _0x8364('0x24'):var _0xd082d2=parseInt(_0x4f0280);if(_[_0x8364('0x5e')](_0xd082d2)&&_['includes'](_0x412fb4,_0xd082d2)){_0x1a7821[_0x8364('0x46')]('\x22'+_0xd082d2+'\x22');}else{_0x17db6b['push'](_0x8364('0x5f'));}break;case _0x8364('0x60'):if(isEmail(_0x4f0280)){_0x1a7821[_0x8364('0x46')]('\x22'+_0x4f0280+'\x22');}else{_0x17db6b['push'](_0x8364('0x61'));}break;case'dateOfBirth':var _0xac9820=moment(_0x4f0280,_0x8364('0x62'),!![]);if(_0xac9820[_0x8364('0x5c')]()){_0x1a7821[_0x8364('0x46')]('\x22'+_0x4f0280+'\x22');}else{_0x17db6b[_0x8364('0x46')](_0x8364('0x63'));}break;default:_0x1a7821[_0x8364('0x46')]('\x22'+_0x4f0280+'\x22');}}else{switch(_0xa5d5d2){case'firstName':case'phone':_0x17db6b[_0x8364('0x46')](_0xa5d5d2+_0x8364('0x64'));break;default:_0x1a7821[_0x8364('0x46')]('\x22\x22');}}}}if(_0x17db6b[_0x8364('0x55')]){handleError(_0x3184c9[_0x8364('0x58')][_0x52b4f4],{'code':'SystemRow','message':_0x17db6b[_0x8364('0x29')]()});}else{fs[_0x8364('0x65')](_0x1b82f5,_0x1a7821[_0x8364('0x29')]()+'\x0a');}_0x1a7821=[];}if(!(stats[_0x8364('0x56')]%0xc8)){socket['emit'](_0x8364('0x66')+_0x4b20f8,stats);stats['errors']=[];}}if(stopped){logger[_0x8364('0x3f')](_0x8364('0x67'));_0x1d6f3a[_0x8364('0x68')]();}}catch(_0x2a2bb5){handleError(_0x3184c9[_0x8364('0x58')][_0x52b4f4],{'code':_0x8364('0x69'),'message':_0x2a2bb5[_0x8364('0x40')]});logger[_0x8364('0x47')](_0x8364('0x6a'),_0x2a2bb5['message']);}},'complete':function(){try{var _0x3c2a5e=[];var _0x342a71=_0x8364('0x34');if(_0x33aded[_0x8364('0x6b')]&&_0x33aded[_0x8364('0x6b')][_0x8364('0x55')]){_0x342a71=_0x8364('0x6c')+_0x4b20f8;_0x3c2a5e['push'](_0x8364('0x6d')+_0x342a71+_0x8364('0x6e'));}var _0x4f0d71=util['format'](_0x8364('0x6f'),_0x1b82f5,_0x342a71,_0x55f410,_0x33aded['ListId'],_0x33aded[_0x8364('0x38')]||null,NOW,NOW);if(_[_0x8364('0x70')](_0x140661['scheduledat'])){_0x4f0d71+=_0x8364('0x71');}_0x3c2a5e[_0x8364('0x46')](_0x4f0d71);if(_0x33aded[_0x8364('0x6b')]&&_0x33aded[_0x8364('0x6b')][_0x8364('0x55')]){_0x3c2a5e['push'](insertCmContact(_0x33aded[_0x8364('0x21')],_0x342a71,_0x33aded[_0x8364('0x6b')],_0x140661));_0x3c2a5e[_0x8364('0x46')](_0x8364('0x72')+_0x342a71+';');}_0x3c2a5e[_0x8364('0x46')](insertCmHopper(_0x33aded[_0x8364('0x21')],'voice_queues_has_cm_lists',_0x8364('0x73'),_0x8364('0x74'),_0x841460));_0x3c2a5e[_0x8364('0x46')](insertCmHopperBlack(_0x33aded[_0x8364('0x21')],_0x8364('0x75'),_0x8364('0x73'),_0x8364('0x74')));_0x3c2a5e[_0x8364('0x46')](insertCmHopper(_0x33aded['ListId'],_0x8364('0x76'),'campaigns','CampaignId',_0x841460));_0x3c2a5e[_0x8364('0x46')](insertCmHopperBlack(_0x33aded['ListId'],_0x8364('0x77'),'campaigns',_0x8364('0x78')));BPromise[_0x8364('0x79')](_0x3c2a5e,handleQuery)[_0x8364('0x7a')](function(_0x3bf785){stats[_0x8364('0x7b')]=!![];stats['affectedRows']=_0x33aded['duplicates']&&_0x33aded['duplicates'][_0x8364('0x55')]?results[0x2]['affectedRows']:results[0x0][_0x8364('0x7c')];socket[_0x8364('0x7d')]('contact:import:'+_0x4b20f8,stats);fs[_0x8364('0x7e')](_0x2fb9ba);fs[_0x8364('0x7e')](_0x1b82f5);process[_0x8364('0x41')](0x0);})[_0x8364('0x7f')](function(_0x1f6795){logger[_0x8364('0x47')](_0x1f6795[_0x8364('0x40')]);process[_0x8364('0x41')](0x1);});}catch(_0x531118){logger[_0x8364('0x47')](_0x8364('0x80'),_0x531118[_0x8364('0x40')]);process[_0x8364('0x41')](0x1);}},'error':function(_0x327e5a,_0x2e36e5,_0x292939,_0x1ee59d){throw new Error(_0x1ee59d);}});}function validate(){if(process['argv']&&process['argv'][_0x8364('0x55')]<0x4){throw new Error(_0x8364('0x81'));}var _0x2fad34=path[_0x8364('0x29')](config[_0x8364('0x4e')],_0x8364('0x4f'),process[_0x8364('0x82')][0x2]);if(!fs['existsSync'](_0x2fad34)){throw new Error(_0x8364('0x83'));}var _0x5e795e={};try{_0x5e795e=JSON[_0x8364('0x53')](process[_0x8364('0x82')][0x3]);if(!_0x5e795e[_0x8364('0x4c')]){throw new Error(_0x8364('0x84'));}if(!_0x5e795e[_0x8364('0x4c')]['phone']){throw new Error(_0x8364('0x85'));}if(!_0x5e795e['binding'][_0x8364('0x86')]){throw new Error(_0x8364('0x87'));}var _0x251027=0x0;if(_0x5e795e[_0x8364('0x4c')]['UserId']){_0x251027=0x1;}if(!_0x5e795e[_0x8364('0x21')]){throw new Error(_0x8364('0x88'));}}catch(_0x1c88ed){throw new Error(_0x8364('0x89'));}var _0x49e85c=[];try{_0x49e85c=_['map'](JSON[_0x8364('0x53')](process[_0x8364('0x82')][0x4]),'id');}catch(_0x109a10){logger[_0x8364('0x3f')](_0x8364('0x8a'));}main(_0x2fad34,_0x5e795e,_0x49e85c,_0x251027);}validate();process['on'](_0x8364('0x8b'),handleStop);process['on'](_0x8364('0x8c'),handleUncaughtException); \ No newline at end of file +var _0x0fd9=['firstName\x20is\x20mandatory','body\x20id\x20mandatory','parse','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.UserId','insert','into','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','updatedAt','.CmListId','ListId\x20=\x20?','\x20=\x20?','concat',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','message','push','code','sequelize','query','spread','catch','error','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','keys','header','createReadStream','data','length','rows','errors','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','isValid','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists'];(function(_0x2fcdd5,_0x376ea3){var _0x2c9b5d=function(_0x2e9adc){while(--_0x2e9adc){_0x2fcdd5['push'](_0x2fcdd5['shift']());}};_0x2c9b5d(++_0x376ea3);}(_0x0fd9,0x104));var _0x90fd=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x0fd9[_0xcf4569];return _0x7fef;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x90fd('0x0'));var Papa=require(_0x90fd('0x1'));var util=require('util');var BPromise=require(_0x90fd('0x2'));var moment=require(_0x90fd('0x3'));var squel=require('squel');var Redis=require(_0x90fd('0x4'));var db=require(_0x90fd('0x5'))['db'];var config=require(_0x90fd('0x6'));var logger=require(_0x90fd('0x7'))(_0x90fd('0x8'));config[_0x90fd('0x9')]=_['defaults'](config[_0x90fd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x90fd('0xa'))(new Redis(config[_0x90fd('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x90fd('0xb')](_0x90fd('0xc'));function isEmail(_0x38a325){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'](_0x38a325);}function selectNotIn(_0x117c2b,_0xa09ebb,_0x28063c,_0x8bba56,_0xbbc71d){return squel[_0x90fd('0xd')]()[_0x90fd('0xe')]('phone')[_0x90fd('0xf')](_0x8bba56)[_0x90fd('0x10')](_0xa09ebb,null,_0xa09ebb+_0x90fd('0x11')+_0x8bba56+'.'+_0x28063c)['where'](_0x8bba56+'.'+_0x28063c+_0x90fd('0x12')+_0x117c2b+'.'+_0x28063c)[_0x90fd('0x13')](_0xa09ebb+'.dialCheckDuplicateType\x20IN\x20('+_0xbbc71d[_0x90fd('0x10')]()+')');}function insertCmHopper(_0x1ae75e,_0x4074a7,_0x326f5b,_0x247aed,_0x24fc95){var _0x4c6c6c=[_0x90fd('0x14'),_0x90fd('0x15'),_0x90fd('0x16'),'cm_contacts.ListId',_0x4074a7+'.'+_0x247aed,_0x90fd('0x17'),'cm_contacts.updatedAt','cm_contacts.priority',_0x90fd('0x18'),'\x22'+_0x24fc95+'\x22'];return squel[_0x90fd('0x19')]()[_0x90fd('0x1a')]('cm_hopper')[_0x90fd('0x1b')]([_0x90fd('0x1c'),_0x90fd('0x1d'),_0x90fd('0x1e'),_0x90fd('0x1f'),_0x247aed,_0x90fd('0x20'),'updatedAt',_0x90fd('0x21'),_0x90fd('0x22'),'recallme'],squel['select']()[_0x90fd('0x23')](_0x4c6c6c)[_0x90fd('0xf')](_0x4074a7)['join'](_0x90fd('0x24'),null,_0x90fd('0x25')+_0x4074a7+'.CmListId')['join'](_0x326f5b,null,_0x326f5b+_0x90fd('0x11')+_0x4074a7+'.'+_0x247aed)[_0x90fd('0x13')](_0x4074a7+_0x90fd('0x26'),_0x1ae75e)[_0x90fd('0x13')](_0x90fd('0x27'),NOW)['where'](_0x90fd('0x28'),selectNotIn(_0x4074a7,_0x326f5b,_0x247aed,_0x90fd('0x29'),[_0x90fd('0x2a'),_0x90fd('0x2b')]))[_0x90fd('0x13')](_0x90fd('0x28'),selectNotIn(_0x4074a7,_0x326f5b,_0x247aed,_0x90fd('0x29'),[_0x90fd('0x2a')])))[_0x90fd('0x2c')]();}function insertCmHopperBlack(_0x82f3e5,_0x565af3,_0x5f4c3d,_0x9169cc){var _0x489eab=[_0x90fd('0x14'),_0x90fd('0x16'),_0x90fd('0x2d'),_0x565af3+'.'+_0x9169cc,_0x90fd('0x17'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x90fd('0x2e'))[_0x90fd('0x1b')](['phone',_0x90fd('0x1e'),_0x90fd('0x1f'),_0x9169cc,_0x90fd('0x20'),_0x90fd('0x2f')],squel[_0x90fd('0xd')]()[_0x90fd('0x23')](_0x489eab)[_0x90fd('0xf')](_0x565af3)['join'](_0x90fd('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x565af3+_0x90fd('0x30'))[_0x90fd('0x10')](_0x5f4c3d,null,_0x5f4c3d+_0x90fd('0x11')+_0x565af3+'.'+_0x9169cc)[_0x90fd('0x13')](_0x565af3+_0x90fd('0x26'),_0x82f3e5)[_0x90fd('0x13')](_0x90fd('0x27'),NOW)[_0x90fd('0x13')](_0x90fd('0x28'),squel[_0x90fd('0xd')]()[_0x90fd('0xe')](_0x90fd('0x1c'))[_0x90fd('0xf')](_0x90fd('0x2e'))['where'](_0x90fd('0x31'),_0x82f3e5)[_0x90fd('0x13')](_0x9169cc+_0x90fd('0x32'),_0x565af3+'.'+_0x9169cc)))['toString']();}function insertCmContact(_0x32e758,_0x3a6d47,_0x48a219,_0x5ea064){var _0x2087a9=_[_0x90fd('0x33')](_['keys'](_0x5ea064),[_0x90fd('0x1f'),'CompanyId',_0x90fd('0x20'),_0x90fd('0x2f')]);return squel[_0x90fd('0x19')]()[_0x90fd('0x1a')](_0x90fd('0x24'))[_0x90fd('0x1b')](_0x2087a9,squel[_0x90fd('0xd')]()['fields'](_0x2087a9)['from'](_0x3a6d47)['where']('('+_0x48a219['join'](',')+_0x90fd('0x34'),squel[_0x90fd('0xd')]()['fields'](_0x48a219)[_0x90fd('0xf')]('cm_contacts')[_0x90fd('0x13')](_0x90fd('0x31'),_0x32e758)['where'](_0x90fd('0x35')))[_0x90fd('0x13')](_0x90fd('0x36'),squel[_0x90fd('0xd')]()['field'](_0x90fd('0x37'),'min_id')[_0x90fd('0xf')](_0x3a6d47)[_0x90fd('0x38')](_0x48a219[_0x90fd('0x10')](','))))[_0x90fd('0x2c')]();}function handleStop(){logger[_0x90fd('0x39')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x220880){logger['error'](_0x220880[_0x90fd('0x3a')]);process['exit'](0x1);}function handleError(_0x3ffbee,_0xc1262c){stats['errors'][_0x90fd('0x3b')]({'name':_0xc1262c[_0x90fd('0x3c')],'message':_0xc1262c[_0x90fd('0x3a')],'row':_0x3ffbee});}function handleQuery(_0x3d32d4){logger['info'](_0x3d32d4);return db[_0x90fd('0x3d')][_0x90fd('0x3e')](_0x3d32d4)[_0x90fd('0x3f')](function(_0x5cb923){results[_0x90fd('0x3b')](_0x5cb923);})[_0x90fd('0x40')](function(_0x12dd67){logger[_0x90fd('0x41')](_0x12dd67[_0x90fd('0x3a')]);});}function main(_0x1ff763,_0x551a3d,_0x254f38,_0x5920a6){logger[_0x90fd('0x39')](_0x90fd('0x42'),_0x1ff763,JSON[_0x90fd('0x43')](_0x551a3d));process['send'](_0x90fd('0x44'));var _0x38ba99=_0x551a3d[_0x90fd('0x45')];var _0x4a34cd=_0x551a3d[_0x90fd('0x46')];var _0x2137cf=path[_0x90fd('0x10')](config[_0x90fd('0x47')],_0x90fd('0x48'),_0x4a34cd+'.csv');var _0x4801b7=_[_0x90fd('0x49')](_0x38ba99)[_0x90fd('0x10')]();logger[_0x90fd('0x39')](_0x90fd('0x4a'),_0x4801b7);fs['writeFileSync'](_0x2137cf,_0x4801b7+'\x0a');Papa['parse'](fs[_0x90fd('0x4b')](_0x1ff763),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49e773,_0x43e1b7){try{for(var _0x2ebf96=0x0,_0x499d92=[];_0x2ebf96<_0x49e773[_0x90fd('0x4c')][_0x90fd('0x4d')];_0x2ebf96++){stats[_0x90fd('0x4e')]+=0x1;if(_0x49e773[_0x90fd('0x4f')][_0x2ebf96]){handleError(_0x49e773['data'][_0x2ebf96],_0x49e773[_0x90fd('0x4f')][_0x2ebf96]);}else{var _0x2289de=[];for(var _0x1c2c06 in _0x38ba99){if(_0x38ba99['hasOwnProperty'](_0x1c2c06)){if(_0x49e773[_0x90fd('0x4c')][_0x2ebf96][_0x38ba99[_0x1c2c06]]){var _0x2e177e=_['trim'](_0x49e773[_0x90fd('0x4c')][_0x2ebf96][_0x38ba99[_0x1c2c06]]['replace'](/"/g,'\x27'));switch(_0x1c2c06){case _0x90fd('0x1d'):var _0x46b79b=moment(_0x2e177e,_0x90fd('0xc'),!![]);if(_0x46b79b['isValid']()){_0x499d92[_0x90fd('0x3b')]('\x22'+_0x2e177e+'\x22');}else{_0x2289de[_0x90fd('0x3b')](_0x90fd('0x50'));}break;case _0x90fd('0x21'):var _0x1a574d=parseInt(_0x2e177e);_0x2e177e=_[_0x90fd('0x51')](_0x1a574d)||_0x1a574d<0x0||_0x1a574d>0x4?_0x5920a6?0x3:0x2:_0x1a574d;_0x499d92[_0x90fd('0x3b')]('\x22'+_0x2e177e+'\x22');break;case'UserId':var _0x3143b8=parseInt(_0x2e177e);if(_[_0x90fd('0x52')](_0x3143b8)&&_['includes'](_0x254f38,_0x3143b8)){_0x499d92[_0x90fd('0x3b')]('\x22'+_0x3143b8+'\x22');}else{_0x2289de[_0x90fd('0x3b')](_0x90fd('0x53'));}break;case _0x90fd('0x54'):if(isEmail(_0x2e177e)){_0x499d92[_0x90fd('0x3b')]('\x22'+_0x2e177e+'\x22');}else{_0x2289de['push']('email\x20wrong\x20format');}break;case _0x90fd('0x55'):var _0x402156=moment(_0x2e177e,'YYYY-MM-DD',!![]);if(_0x402156[_0x90fd('0x56')]()){_0x499d92['push']('\x22'+_0x2e177e+'\x22');}else{_0x2289de[_0x90fd('0x3b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x499d92['push']('\x22'+_0x2e177e+'\x22');}}else{switch(_0x1c2c06){case'firstName':case _0x90fd('0x1c'):_0x2289de['push'](_0x1c2c06+_0x90fd('0x57'));break;default:_0x499d92[_0x90fd('0x3b')]('\x22\x22');}}}}if(_0x2289de['length']){handleError(_0x49e773[_0x90fd('0x4c')][_0x2ebf96],{'code':_0x90fd('0x58'),'message':_0x2289de['join']()});}else{fs[_0x90fd('0x59')](_0x2137cf,_0x499d92['join']()+'\x0a');}_0x499d92=[];}if(!(stats[_0x90fd('0x4e')]%0xc8)){socket[_0x90fd('0x5a')]('contact:import:'+_0x4a34cd,stats);stats[_0x90fd('0x4f')]=[];}}if(stopped){logger[_0x90fd('0x39')](_0x90fd('0x5b'));_0x43e1b7[_0x90fd('0x5c')]();}}catch(_0x37eb84){handleError(_0x49e773['data'][_0x2ebf96],{'code':'SystemError','message':_0x37eb84[_0x90fd('0x3a')]});logger[_0x90fd('0x41')](_0x90fd('0x5d'),_0x37eb84[_0x90fd('0x3a')]);}},'complete':function(){try{var _0x1f150a=[];var _0x80a3cc=_0x90fd('0x24');if(_0x551a3d['duplicates']&&_0x551a3d[_0x90fd('0x5e')]['length']){_0x80a3cc=_0x90fd('0x5f')+_0x4a34cd;_0x1f150a[_0x90fd('0x3b')](_0x90fd('0x60')+_0x80a3cc+_0x90fd('0x61'));}var _0x221908=util[_0x90fd('0xb')](_0x90fd('0x62'),_0x2137cf,_0x80a3cc,_0x4801b7,_0x551a3d[_0x90fd('0x1f')],_0x551a3d['CompanyId']||null,NOW,NOW);if(_[_0x90fd('0x63')](_0x38ba99['scheduledat'])){_0x221908+=_0x90fd('0x64');}_0x1f150a[_0x90fd('0x3b')](_0x221908);if(_0x551a3d[_0x90fd('0x5e')]&&_0x551a3d['duplicates']['length']){_0x1f150a[_0x90fd('0x3b')](insertCmContact(_0x551a3d[_0x90fd('0x1f')],_0x80a3cc,_0x551a3d[_0x90fd('0x5e')],_0x38ba99));_0x1f150a['push'](_0x90fd('0x65')+_0x80a3cc+';');}_0x1f150a['push'](insertCmHopper(_0x551a3d[_0x90fd('0x1f')],_0x90fd('0x66'),_0x90fd('0x67'),_0x90fd('0x68'),_0x5920a6));_0x1f150a['push'](insertCmHopperBlack(_0x551a3d[_0x90fd('0x1f')],_0x90fd('0x69'),_0x90fd('0x67'),_0x90fd('0x68')));_0x1f150a[_0x90fd('0x3b')](insertCmHopper(_0x551a3d['ListId'],_0x90fd('0x6a'),_0x90fd('0x6b'),_0x90fd('0x6c'),_0x5920a6));_0x1f150a[_0x90fd('0x3b')](insertCmHopperBlack(_0x551a3d[_0x90fd('0x1f')],_0x90fd('0x6d'),_0x90fd('0x6b'),_0x90fd('0x6c')));BPromise['each'](_0x1f150a,handleQuery)[_0x90fd('0x6e')](function(_0x291167){stats[_0x90fd('0x6f')]=!![];stats[_0x90fd('0x70')]=_0x551a3d[_0x90fd('0x5e')]&&_0x551a3d['duplicates'][_0x90fd('0x4d')]?results[0x2][_0x90fd('0x70')]:results[0x0][_0x90fd('0x70')];socket[_0x90fd('0x5a')](_0x90fd('0x71')+_0x4a34cd,stats);fs[_0x90fd('0x72')](_0x1ff763);fs['unlink'](_0x2137cf);process[_0x90fd('0x73')](0x0);})['catch'](function(_0x5848b1){logger[_0x90fd('0x41')](_0x5848b1[_0x90fd('0x3a')]);process['exit'](0x1);});}catch(_0x85b1ca){logger[_0x90fd('0x41')](_0x90fd('0x74'),_0x85b1ca['message']);process[_0x90fd('0x73')](0x1);}},'error':function(_0x3f8537,_0x511a7f,_0x2263fc,_0xdeac61){throw new Error(_0xdeac61);}});}function validate(){if(process[_0x90fd('0x75')]&&process['argv']['length']<0x4){throw new Error(_0x90fd('0x76'));}var _0x8916d7=path['join'](config['root'],'server/files/tmp',process[_0x90fd('0x75')][0x2]);if(!fs['existsSync'](_0x8916d7)){throw new Error(_0x90fd('0x77'));}var _0x42c4ec={};try{_0x42c4ec=JSON['parse'](process[_0x90fd('0x75')][0x3]);if(!_0x42c4ec['binding']){throw new Error(_0x90fd('0x78'));}if(!_0x42c4ec[_0x90fd('0x45')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x42c4ec[_0x90fd('0x45')]['firstName']){throw new Error(_0x90fd('0x79'));}var _0x203843=0x0;if(_0x42c4ec[_0x90fd('0x45')][_0x90fd('0x22')]){_0x203843=0x1;}if(!_0x42c4ec[_0x90fd('0x1f')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2e5cbd){throw new Error(_0x90fd('0x7a'));}var _0x42deec=[];try{_0x42deec=_['map'](JSON[_0x90fd('0x7b')](process[_0x90fd('0x75')][0x4]),'id');}catch(_0x755101){logger[_0x90fd('0x39')](_0x90fd('0x7c'));}main(_0x8916d7,_0x42c4ec,_0x42deec,_0x203843);}validate();process['on'](_0x90fd('0x7d'),handleStop);process['on'](_0x90fd('0x7e'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e90cc40..cff04a5 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8f9=['Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','Date','Complete\x20Time','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','variable','calleridnum','string'];(function(_0x3389fe,_0x202e25){var _0x2fadb1=function(_0xb35272){while(--_0xb35272){_0x3389fe['push'](_0x3389fe['shift']());}};_0x2fadb1(++_0x202e25);}(_0xe8f9,0xd7));var _0x9e8f=function(_0xcbb462,_0x43670c){_0xcbb462=_0xcbb462-0x0;var _0x58bd63=_0xe8f9[_0xcbb462];return _0x58bd63;};'use strict';exports[_0x9e8f('0x0')]=function(_0x3d1649,_0x514445){var _0x2cab4a=[{'type':'string','content':_0x9e8f('0x1'),'variableName':null}];switch(_0x3d1649[_0x9e8f('0x2')]()){case _0x9e8f('0x3'):switch(_0x514445[_0x9e8f('0x2')]()){case _0x9e8f('0x4'):_0x2cab4a[_0x9e8f('0x5')]({'type':'variable','content':'','variableName':_0x9e8f('0x6')});_0x2cab4a[_0x9e8f('0x5')]({'type':_0x9e8f('0x7'),'content':'','variableName':_0x9e8f('0x8')});break;case'outbound':_0x2cab4a[_0x9e8f('0x5')]({'type':_0x9e8f('0x9'),'content':_0x9e8f('0xa'),'variableName':null});_0x2cab4a[_0x9e8f('0x5')]({'type':_0x9e8f('0x7'),'content':'','variableName':_0x9e8f('0xb')});break;}}return _0x2cab4a;};exports[_0x9e8f('0xc')]=function(_0x141dca,_0xb1b01b){var _0x2e8607=[];switch(_0x141dca['toLowerCase']()){case _0x9e8f('0x3'):switch(_0xb1b01b[_0x9e8f('0x2')]()){case _0x9e8f('0x4'):_0x2e8607=[{'type':'string','content':_0x9e8f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0xf'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x8')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x10'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x11')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x12'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x13')},{'type':'keyValue','content':'','key':_0x9e8f('0x14'),'keyType':_0x9e8f('0x7'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0x9e8f('0x15'),'keyType':'variable','variableName':_0x9e8f('0x16')},{'type':_0x9e8f('0xe'),'content':'','key':'Date','keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x17')},{'type':'string','content':_0x9e8f('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x19'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x1a')},{'type':'keyValue','content':'','key':_0x9e8f('0x1b'),'keyType':_0x9e8f('0x7'),'variableName':'destcalleridnum'},{'type':_0x9e8f('0x9'),'content':_0x9e8f('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x9e8f('0xe'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x9e8f('0x1d'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x1e')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x1f'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x20'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x21')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x22'),'keyType':_0x9e8f('0x7'),'variableName':_0x9e8f('0x23')}];break;case _0x9e8f('0x24'):_0x2e8607=[{'type':_0x9e8f('0x9'),'content':_0x9e8f('0xd'),'variableName':null},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x25'),'keyType':_0x9e8f('0x7'),'keyContent':'','variableName':_0x9e8f('0xb')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x26'),'keyType':_0x9e8f('0x7'),'keyContent':'','variableName':_0x9e8f('0x27')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x15'),'keyType':_0x9e8f('0x7'),'keyContent':'','variableName':_0x9e8f('0x16')},{'type':_0x9e8f('0xe'),'content':'','key':_0x9e8f('0x28'),'keyType':_0x9e8f('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0x9e8f('0x9'),'content':_0x9e8f('0x1c')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x9e8f('0x7'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x9e8f('0x29'),'keyType':_0x9e8f('0x7'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x9e8f('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x9e8f('0x2b')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x9e8f('0x2c')}];break;}}return _0x2e8607;}; \ No newline at end of file +var _0x3e09=['destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','destexten','Queue','UniqueId','Date','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','membername','uniqueid','starttime','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound'];(function(_0x126637,_0x48f84e){var _0x3a2a88=function(_0xa79f33){while(--_0xa79f33){_0x126637['push'](_0x126637['shift']());}};_0x3a2a88(++_0x48f84e);}(_0x3e09,0x6f));var _0x93e0=function(_0x54e631,_0x3b8396){_0x54e631=_0x54e631-0x0;var _0x3c6b6a=_0x3e09[_0x54e631];return _0x3c6b6a;};'use strict';exports['getSubjects']=function(_0x4c3900,_0x5447f4){var _0x3e850e=[{'type':_0x93e0('0x0'),'content':_0x93e0('0x1'),'variableName':null}];switch(_0x4c3900[_0x93e0('0x2')]()){case _0x93e0('0x3'):switch(_0x5447f4['toLowerCase']()){case _0x93e0('0x4'):_0x3e850e[_0x93e0('0x5')]({'type':_0x93e0('0x6'),'content':'','variableName':_0x93e0('0x7')});_0x3e850e['push']({'type':_0x93e0('0x6'),'content':'','variableName':'calleridnum'});break;case _0x93e0('0x8'):_0x3e850e[_0x93e0('0x5')]({'type':_0x93e0('0x0'),'content':'Outbound\x20Call','variableName':null});_0x3e850e[_0x93e0('0x5')]({'type':_0x93e0('0x6'),'content':'','variableName':_0x93e0('0x9')});break;}}return _0x3e850e;};exports[_0x93e0('0xa')]=function(_0x5c2041,_0x41ae7f){var _0x4d49ea=[];switch(_0x5c2041[_0x93e0('0x2')]()){case'voice':switch(_0x41ae7f[_0x93e0('0x2')]()){case'inbound':_0x4d49ea=[{'type':_0x93e0('0x0'),'content':_0x93e0('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0xd'),'keyType':_0x93e0('0x6'),'variableName':_0x93e0('0xe')},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0xf'),'keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x10')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x11')},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x12'),'keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x7')},{'type':'keyValue','content':'','key':_0x93e0('0x13'),'keyType':_0x93e0('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x93e0('0x14'),'keyType':_0x93e0('0x6'),'variableName':'agentcalledAt'},{'type':_0x93e0('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x93e0('0xc'),'content':'','key':'Agent\x20Name','keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x15')},{'type':'keyValue','content':'','key':_0x93e0('0x16'),'keyType':_0x93e0('0x6'),'variableName':'destcalleridnum'},{'type':_0x93e0('0x0'),'content':_0x93e0('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x93e0('0x18'),'keyType':_0x93e0('0x6'),'variableName':'agentcalledAt'},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x19'),'keyType':_0x93e0('0x6'),'variableName':'agentconnectAt'},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x1a'),'keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x1b')},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x1c'),'keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x1d')},{'type':_0x93e0('0xc'),'content':'','key':'Talk\x20Time','keyType':_0x93e0('0x6'),'variableName':_0x93e0('0x1e')}];break;case'outbound':_0x4d49ea=[{'type':_0x93e0('0x0'),'content':_0x93e0('0xb'),'variableName':null},{'type':_0x93e0('0xc'),'content':'','key':'Called\x20Number','keyType':_0x93e0('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x93e0('0x6'),'keyContent':'','variableName':_0x93e0('0x1f')},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x13'),'keyType':_0x93e0('0x6'),'keyContent':'','variableName':_0x93e0('0x20')},{'type':'keyValue','content':'','key':_0x93e0('0x14'),'keyType':'variable','keyContent':'','variableName':_0x93e0('0x21')},{'type':_0x93e0('0x0'),'content':_0x93e0('0x17')},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x22'),'keyType':_0x93e0('0x6'),'keyContent':'','variableName':_0x93e0('0x23')},{'type':_0x93e0('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x93e0('0x6'),'keyContent':'','variableName':_0x93e0('0x24')},{'type':'keyValue','content':'','key':_0x93e0('0x25'),'keyType':_0x93e0('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x93e0('0xc'),'content':'','key':_0x93e0('0x26'),'keyType':'variable','keyContent':'','variableName':_0x93e0('0x27')}];break;}}return _0x4d49ea;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 8d5a2d7..8b2ab05 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf636=['omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','then','info','catch','error','tracked','user','clone','body'];(function(_0x1579f0,_0x56eb06){var _0x1743ed=function(_0x5005ca){while(--_0x5005ca){_0x1579f0['push'](_0x1579f0['shift']());}};_0x1743ed(++_0x56eb06);}(_0xf636,0x19a));var _0x6f63=function(_0x108433,_0x380bcf){_0x108433=_0x108433-0x0;var _0x4e62c0=_0xf636[_0x108433];return _0x4e62c0;};'use strict';var _=require(_0x6f63('0x0'));var db=require(_0x6f63('0x1'))['db'];var loggers={'openchannel':require(_0x6f63('0x2'))(_0x6f63('0x3')),'mail':require(_0x6f63('0x2'))('mail-interactions'),'fax':require(_0x6f63('0x2'))(_0x6f63('0x4')),'sms':require('../../config/logger')(_0x6f63('0x5')),'chat':require(_0x6f63('0x2'))(_0x6f63('0x6')),'whatsapp':require(_0x6f63('0x2'))(_0x6f63('0x7'))};function getInteractionId(_0x39b5df,_0x2cc2b5,_0x4c9725){if(_0x39b5df&&_0x39b5df[_[_0x6f63('0x8')](_0x4c9725)+_0x6f63('0x9')]){return _0x39b5df[_[_0x6f63('0x8')](_0x4c9725)+'InteractionId'];}else if(_0x39b5df&&_0x39b5df['id']){return _0x39b5df['id'];}else if(_0x2cc2b5&&_0x2cc2b5['id']){return _0x2cc2b5['id'];}else{return _0x6f63('0xa');}}function log(_0x3d64b3,_0x1246cd,_0xa9fe11,_0x333c4f,_0x5d2132,_0x57a85d){loggers[_0x5d2132[_0x6f63('0xb')]()][_0x3d64b3](_0x6f63('0xc'),_0x57a85d[_0x6f63('0xd')](),_0x1246cd?_0x1246cd['id']:null,_0x1246cd?_0x1246cd[_0x6f63('0xe')]:null,_0x1246cd?_0x1246cd[_0x6f63('0xf')]:null,getInteractionId(_0xa9fe11,_0x333c4f,_0x5d2132),_0xa9fe11?JSON['stringify'](_0xa9fe11):_0x6f63('0x10'));}function updateUser(_0x47ec0a,_0x23cb36,_0x78b67,_0x512c1d,_0xd1fc7a){db[_[_0x6f63('0x8')](_0x512c1d)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x23cb36,_0x78b67,_0x512c1d)}})['then'](function(_0x2dda24){if(_0x2dda24){return _0x2dda24['update']({'UserId':_0x47ec0a?_0x47ec0a['id']:null});}})[_0x6f63('0x11')](function(_0x9be1c3){if(_0x9be1c3){log(_0x6f63('0x12'),_0x47ec0a,_0x23cb36,_0x78b67,_0x512c1d,_0xd1fc7a);}})[_0x6f63('0x13')](function(){log(_0x6f63('0x14'),_0x47ec0a,_0x23cb36,_0x78b67,_0x512c1d,_0xd1fc7a);});}exports[_0x6f63('0x15')]=function(_0x19c7fc,_0x4d0766){return function(_0xc8e315,_0x5ab745,_0x1664cf){var _0x30d147=_0xc8e315[_0x6f63('0x16')];var _0x472e20={};var _0x33f558=_0xc8e315['query'];if(_0x472e20){_0x472e20=_[_0x6f63('0x17')](_0xc8e315[_0x6f63('0x18')]);_0x472e20=_[_0x6f63('0x19')](_0x472e20,['body','html',_0x6f63('0x1a'),_0x6f63('0x1b'),_0x6f63('0x1c')]);}updateUser(_0x30d147,_0x472e20,_0x33f558,_0x19c7fc,_0x4d0766);_0x1664cf(null);};}; \ No newline at end of file +var _0x8cc0=['info','catch','error','tracked','user','query','body','omit','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','update'];(function(_0x46249f,_0x5abeab){var _0x44fdb9=function(_0x2b9c31){while(--_0x2b9c31){_0x46249f['push'](_0x46249f['shift']());}};_0x44fdb9(++_0x5abeab);}(_0x8cc0,0x149));var _0x08cc=function(_0x5ee5a1,_0x55ac78){_0x5ee5a1=_0x5ee5a1-0x0;var _0x20d117=_0x8cc0[_0x5ee5a1];return _0x20d117;};'use strict';var _=require(_0x08cc('0x0'));var db=require(_0x08cc('0x1'))['db'];var loggers={'openchannel':require(_0x08cc('0x2'))(_0x08cc('0x3')),'mail':require('../../config/logger')(_0x08cc('0x4')),'fax':require('../../config/logger')(_0x08cc('0x5')),'sms':require(_0x08cc('0x2'))(_0x08cc('0x6')),'chat':require(_0x08cc('0x2'))(_0x08cc('0x7')),'whatsapp':require(_0x08cc('0x2'))('whatsapp-interactions')};function getInteractionId(_0x5f192e,_0x28b747,_0x3fa69a){if(_0x5f192e&&_0x5f192e[_[_0x08cc('0x8')](_0x3fa69a)+_0x08cc('0x9')]){return _0x5f192e[_[_0x08cc('0x8')](_0x3fa69a)+_0x08cc('0x9')];}else if(_0x5f192e&&_0x5f192e['id']){return _0x5f192e['id'];}else if(_0x28b747&&_0x28b747['id']){return _0x28b747['id'];}else{return _0x08cc('0xa');}}function log(_0x531b84,_0x5a3e4d,_0x183b8e,_0x45c134,_0x3c0d63,_0x58ae11){loggers[_0x3c0d63[_0x08cc('0xb')]()][_0x531b84](_0x08cc('0xc'),_0x58ae11[_0x08cc('0xd')](),_0x5a3e4d?_0x5a3e4d['id']:null,_0x5a3e4d?_0x5a3e4d['name']:null,_0x5a3e4d?_0x5a3e4d[_0x08cc('0xe')]:null,getInteractionId(_0x183b8e,_0x45c134,_0x3c0d63),_0x183b8e?JSON[_0x08cc('0xf')](_0x183b8e):_0x08cc('0x10'));}function updateUser(_0xc53b3d,_0x520e11,_0x38226d,_0xc9e8db,_0x310d6d){db[_['upperFirst'](_0xc9e8db)+'Interaction'][_0x08cc('0x11')]({'where':{'id':getInteractionId(_0x520e11,_0x38226d,_0xc9e8db)}})['then'](function(_0x4e71d8){if(_0x4e71d8){return _0x4e71d8[_0x08cc('0x12')]({'UserId':_0xc53b3d?_0xc53b3d['id']:null});}})['then'](function(_0x443ae0){if(_0x443ae0){log(_0x08cc('0x13'),_0xc53b3d,_0x520e11,_0x38226d,_0xc9e8db,_0x310d6d);}})[_0x08cc('0x14')](function(){log(_0x08cc('0x15'),_0xc53b3d,_0x520e11,_0x38226d,_0xc9e8db,_0x310d6d);});}exports[_0x08cc('0x16')]=function(_0x70d0b0,_0x4ec915){return function(_0x500f05,_0x58c6a3,_0x3772aa){var _0x46196f=_0x500f05[_0x08cc('0x17')];var _0x5cb910={};var _0x3e8090=_0x500f05[_0x08cc('0x18')];if(_0x5cb910){_0x5cb910=_['clone'](_0x500f05[_0x08cc('0x19')]);_0x5cb910=_[_0x08cc('0x1a')](_0x5cb910,[_0x08cc('0x19'),'html','phone',_0x08cc('0x1b'),_0x08cc('0x1c')]);}updateUser(_0x46196f,_0x5cb910,_0x3e8090,_0x70d0b0,_0x4ec915);_0x3772aa(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 070a449..1d65330 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 _0x15c9=['createDecipher','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split'];(function(_0x4277b8,_0x30ba6d){var _0x410266=function(_0x3be20d){while(--_0x3be20d){_0x4277b8['push'](_0x4277b8['shift']());}};_0x410266(++_0x30ba6d);}(_0x15c9,0x158));var _0x915c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15c9[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var compose=require(_0x915c('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x915c('0x3'));function getValueFromLicense(_0x4b024b,_0x3388d1){if(_0x4b024b&&_0x3388d1){if(_0x3388d1[_0x915c('0x4')]&&_0x3388d1[_0x915c('0x5')]){var _0x53751e=_0x3388d1[_0x915c('0x4')];var _0x540290=_0x3388d1[_0x915c('0x5')];var _0x64b693=_0x53751e[_0x915c('0x6')]('-')[0x4];var _0x444b98=_0x53751e[_0x915c('0x6')]('-')[0x0];var _0x5a684b=crypto[_0x915c('0x7')](_0x915c('0x8'),util['format'](_0x915c('0x9'),_0x64b693,_0x53751e,_0x444b98));var _0x1fcdb5=_0x5a684b[_0x915c('0xa')](_0x540290,_0x915c('0xb'),'utf8');_0x1fcdb5+=_0x5a684b[_0x915c('0xc')](_0x915c('0xd'));var _0x463323=JSON[_0x915c('0xe')](_0x1fcdb5);return _0x463323['hasOwnProperty'](_0x4b024b)?_0x463323[_0x4b024b]:null;}}return null;}function isLimit(_0x3d7a3f,_0x2feed6,_0x28c74c,_0x3ed75d){var _0x1744dd=_0x2feed6;return compose()[_0x915c('0xf')](function(_0x184649,_0x576732,_0x269cf7){return db[_0x915c('0x10')][_0x915c('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x506e26){var _0x4a78a3=getValueFromLicense(_0x3d7a3f,_0x506e26);return _0x4a78a3?_0x4a78a3:_0x1744dd;})[_0x915c('0x12')](function(_0x50c213){_0x1744dd=_0x50c213;return _0x28c74c[_0x915c('0x13')](_0x3ed75d);})[_0x915c('0x12')](function(_0x1c7f1d){if(_0x1c7f1d>=_0x1744dd){return _0x576732[_0x915c('0x14')](0x193)[_0x915c('0x15')]({'message':util['format'](_0x915c('0x16'),_0x3d7a3f)});}_0x269cf7();})[_0x915c('0x17')](function(_0x38e08a){_0x269cf7(_0x38e08a);});});}function isUserLimit(){return isLimit(_0x915c('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x915c('0x19')}]}});}exports[_0x915c('0x1a')]=isUserLimit; \ No newline at end of file +var _0xf37b=['users','User','admin','user','isUserLimit','crypto','composable-middleware','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x2619a6,_0x3ec9d0){var _0x4f78f2=function(_0x36280e){while(--_0x36280e){_0x2619a6['push'](_0x2619a6['shift']());}};_0x4f78f2(++_0x3ec9d0);}(_0xf37b,0x1a9));var _0xbf37=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0xf37b[_0x596f6e];return _0x1e0803;};'use strict';var crypto=require(_0xbf37('0x0'));var util=require('util');var compose=require(_0xbf37('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xbf37('0x2'));function getValueFromLicense(_0x42186f,_0x283121){if(_0x42186f&&_0x283121){if(_0x283121['data1']&&_0x283121[_0xbf37('0x3')]){var _0x8f49c6=_0x283121[_0xbf37('0x4')];var _0x3c38da=_0x283121[_0xbf37('0x3')];var _0x4c5a2f=_0x8f49c6['split']('-')[0x4];var _0x36327a=_0x8f49c6[_0xbf37('0x5')]('-')[0x0];var _0x271dbc=crypto[_0xbf37('0x6')](_0xbf37('0x7'),util['format'](_0xbf37('0x8'),_0x4c5a2f,_0x8f49c6,_0x36327a));var _0x3e1685=_0x271dbc[_0xbf37('0x9')](_0x3c38da,_0xbf37('0xa'),_0xbf37('0xb'));_0x3e1685+=_0x271dbc['final']('utf8');var _0x101993=JSON[_0xbf37('0xc')](_0x3e1685);return _0x101993[_0xbf37('0xd')](_0x42186f)?_0x101993[_0x42186f]:null;}}return null;}function isLimit(_0x355af9,_0x2bf1e3,_0x7d924d,_0x478b31){var _0x5a17fa=_0x2bf1e3;return compose()[_0xbf37('0xe')](function(_0x3b1041,_0x53f8fc,_0x32e9ec){return db[_0xbf37('0xf')][_0xbf37('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xbf37('0x11')](function(_0x4321f8){var _0x1ab318=getValueFromLicense(_0x355af9,_0x4321f8);return _0x1ab318?_0x1ab318:_0x5a17fa;})['then'](function(_0x41bf10){_0x5a17fa=_0x41bf10;return _0x7d924d[_0xbf37('0x12')](_0x478b31);})[_0xbf37('0x11')](function(_0x8694c6){if(_0x8694c6>=_0x5a17fa){return _0x53f8fc[_0xbf37('0x13')](0x193)[_0xbf37('0x14')]({'message':util[_0xbf37('0x15')](_0xbf37('0x16'),_0x355af9)});}_0x32e9ec();})['catch'](function(_0x4266e3){_0x32e9ec(_0x4266e3);});});}function isUserLimit(){return isLimit(_0xbf37('0x17'),0x1,db[_0xbf37('0x18')],{'where':{'$or':[{'role':_0xbf37('0x19')},{'role':_0xbf37('0x1a')}]}});}exports[_0xbf37('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index c3a167f..db888b2 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 _0xd32e=['text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','start','$substring','$startsWith','utcOffset','minutes','moment','sqlOperator','startsWith','[$or]','and','replace','length','split','forEach','shift','match','filter','indexOf','push','DATE','$eq','operator','$between','value','includes','$lte','add','days','format'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xd32e,0x1e6));var _0xed32=function(_0x1bb5c3,_0x2d336f){_0x1bb5c3=_0x1bb5c3-0x0;var _0x4dccb2=_0xd32e[_0x1bb5c3];return _0x4dccb2;};'use strict';var _=require('lodash');var moment=require(_0xed32('0x0'));exports['parseSearch']=function(_0x352c39){var _0x30579f={'conditions':[]};_0x30579f[_0xed32('0x1')]=_[_0xed32('0x2')](_0x352c39,_0xed32('0x3'))?'or':_0xed32('0x4');var _0x4de016=_0x352c39[_0xed32('0x5')]('[$and]','')[_0xed32('0x5')](_0xed32('0x3'),'')['split']('||');for(var _0x2d15cf=0x0;_0x2d15cf<_0x4de016[_0xed32('0x6')];_0x2d15cf++){var _0x4f675c=_0x4de016[_0x2d15cf][_0xed32('0x7')](':=');var _0x492e89=_0x4f675c[0x0];var _0x2f0da5=_0x4f675c['slice'](0x1);_0x2f0da5[_0xed32('0x8')](function(_0x38b543){var _0x10a7fe=_0x38b543[_0xed32('0x7')]('[')[_0xed32('0x9')]();var _0x3f18bf=_0x38b543[_0xed32('0xa')](/\[(.*?)\]/g);_0x3f18bf['forEach'](function(_0x38cf19){var _0x1c2196=_0x38cf19[_0xed32('0x7')]('[')[_0xed32('0xb')](function(_0x21b95b){return _0x21b95b[_0xed32('0xc')](']')>-0x1;})['map'](function(_0x7a5dd5){return _0x7a5dd5['split'](']')[0x0];})[0x0];_0x30579f['conditions'][_0xed32('0xd')]({'field':_0x492e89,'operator':_0x10a7fe,'value':_0x1c2196});});});}return _0x30579f;};exports['buildExpression']=function(_0x66b225,_0x457a53,_0x4e34b1){var _0xc18644={};if(_0x457a53===_0xed32('0xe')){if(_0x4e34b1['operator']===_0xed32('0xf')){_0x4e34b1[_0xed32('0x10')]=_0xed32('0x11');_0x4e34b1['value']+=','+_0x4e34b1[_0xed32('0x12')];}else if(_[_0xed32('0x13')](['$gt',_0xed32('0x14')],_0x4e34b1[_0xed32('0x10')])){_0x4e34b1[_0xed32('0x12')]=moment(_0x4e34b1['value'])[_0xed32('0x15')](0x1,_0xed32('0x16'))[_0xed32('0x17')]('YYYY-MM-DD');}}if(_0x4e34b1['castTo']){_0x457a53=_0x4e34b1['castTo'];_0xc18644[_0xed32('0x18')]=_0xed32('0x19')+_0x66b225+'.'+_0x4e34b1[_0xed32('0x1a')]+_0xed32('0x1b')+_0x4e34b1[_0xed32('0x1c')]+')\x20'+parseOperator(_0x4e34b1[_0xed32('0x10')]);}else{_0xc18644[_0xed32('0x18')]=_0x66b225+'.'+_0x4e34b1[_0xed32('0x1a')]+'\x20'+parseOperator(_0x4e34b1[_0xed32('0x10')]);}if(_['includes']([_0xed32('0x1d'),_0xed32('0x1e')],_0x4e34b1[_0xed32('0x10')]))_0xc18644[_0xed32('0x18')]='('+_0xc18644[_0xed32('0x18')]+_0xed32('0x1f')+_0x66b225+'.'+_0x4e34b1[_0xed32('0x1a')]+_0xed32('0x20');_0xc18644[_0xed32('0x12')]=parseValue(_0x457a53,_0x4e34b1[_0xed32('0x10')],_0x4e34b1[_0xed32('0x12')]);return _0xc18644;};function parseOperator(_0x1e0a79){var _0x26037c;switch(_0x1e0a79){case _0xed32('0x21'):_0x26037c=_0xed32('0x22');break;case _0xed32('0x1e'):_0x26037c=_0xed32('0x23');break;case _0xed32('0xf'):_0x26037c='=\x20?';break;case _0xed32('0x1d'):_0x26037c=_0xed32('0x24');break;case'$substring':case'$startsWith':case _0xed32('0x25'):_0x26037c=_0xed32('0x26');break;case _0xed32('0x27'):_0x26037c=_0xed32('0x28');break;case _0xed32('0x29'):_0x26037c=_0xed32('0x2a');break;case _0xed32('0x14'):_0x26037c=_0xed32('0x2b');break;case _0xed32('0x2c'):_0x26037c=_0xed32('0x2d');break;case'$between':_0x26037c='BETWEEN\x20?\x20AND\x20?';break;}return _0x26037c;}function parseValue(_0x3cff1b,_0x402063,_0x11c7da){var _0x3b2a76={'start':undefined,'end':undefined};switch(_0x402063){case _0xed32('0x21'):case _0xed32('0x1e'):_0x3b2a76[_0xed32('0x2e')]=_0x11c7da[_0xed32('0x7')](',');break;case _0xed32('0x2f'):_0x3b2a76[_0xed32('0x2e')]='%'+_0x11c7da+'%';break;case _0xed32('0x30'):_0x3b2a76['start']=_0x11c7da+'%';break;case _0xed32('0x25'):_0x3b2a76[_0xed32('0x2e')]='%'+_0x11c7da;break;case _0xed32('0x11'):var _0x12b5b3=_0x11c7da[_0xed32('0x7')](',');var _0x11c7da=_0x12b5b3[_0xed32('0x9')]();var _0x26356b=_0x12b5b3['pop']();if(_0x3cff1b===_0xed32('0xe')){_0x11c7da=moment(_0x11c7da)[_0xed32('0x31')](0x0,!![])['format']();_0x26356b=moment(_0x26356b)['utcOffset'](0x0,!![])[_0xed32('0x15')](0x17,'hours')[_0xed32('0x15')](0x3b,_0xed32('0x32'))[_0xed32('0x15')](0x3b,'seconds')['format']();}_0x3b2a76={'start':_0x11c7da,'end':_0x26356b};break;default:_0x3b2a76['start']=_0x11c7da;break;}return _0x3b2a76;} \ No newline at end of file +var _0xb199=['and','replace','[$and]','split','length','slice','forEach','shift','filter','map','conditions','DATE','$eq','operator','value','includes','add','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$between','start','$startsWith','pop','utcOffset','hours','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]'];(function(_0x21ed10,_0x1c8de9){var _0x3bcdd7=function(_0x24eadd){while(--_0x24eadd){_0x21ed10['push'](_0x21ed10['shift']());}};_0x3bcdd7(++_0x1c8de9);}(_0xb199,0x1e4));var _0x9b19=function(_0x471d49,_0x1022f6){_0x471d49=_0x471d49-0x0;var _0x36b25d=_0xb199[_0x471d49];return _0x36b25d;};'use strict';var _=require(_0x9b19('0x0'));var moment=require(_0x9b19('0x1'));exports[_0x9b19('0x2')]=function(_0x3e126f){var _0x48c15d={'conditions':[]};_0x48c15d[_0x9b19('0x3')]=_[_0x9b19('0x4')](_0x3e126f,_0x9b19('0x5'))?'or':_0x9b19('0x6');var _0x3d05ff=_0x3e126f[_0x9b19('0x7')](_0x9b19('0x8'),'')[_0x9b19('0x7')](_0x9b19('0x5'),'')[_0x9b19('0x9')]('||');for(var _0x3aff99=0x0;_0x3aff99<_0x3d05ff[_0x9b19('0xa')];_0x3aff99++){var _0x15769c=_0x3d05ff[_0x3aff99]['split'](':=');var _0x2af549=_0x15769c[0x0];var _0x17b544=_0x15769c[_0x9b19('0xb')](0x1);_0x17b544[_0x9b19('0xc')](function(_0x47f458){var _0x9ce0cf=_0x47f458[_0x9b19('0x9')]('[')[_0x9b19('0xd')]();var _0x2ddb1f=_0x47f458['match'](/\[(.*?)\]/g);_0x2ddb1f[_0x9b19('0xc')](function(_0x413be4){var _0x2279e9=_0x413be4['split']('[')[_0x9b19('0xe')](function(_0x347c7f){return _0x347c7f['indexOf'](']')>-0x1;})[_0x9b19('0xf')](function(_0x1eedf5){return _0x1eedf5['split'](']')[0x0];})[0x0];_0x48c15d[_0x9b19('0x10')]['push']({'field':_0x2af549,'operator':_0x9ce0cf,'value':_0x2279e9});});});}return _0x48c15d;};exports['buildExpression']=function(_0x5e8318,_0x49c491,_0x226e1a){var _0x2f7a2c={};if(_0x49c491===_0x9b19('0x11')){if(_0x226e1a['operator']===_0x9b19('0x12')){_0x226e1a[_0x9b19('0x13')]='$between';_0x226e1a[_0x9b19('0x14')]+=','+_0x226e1a[_0x9b19('0x14')];}else if(_[_0x9b19('0x15')](['$gt','$lte'],_0x226e1a[_0x9b19('0x13')])){_0x226e1a[_0x9b19('0x14')]=moment(_0x226e1a[_0x9b19('0x14')])[_0x9b19('0x16')](0x1,'days')[_0x9b19('0x17')]('YYYY-MM-DD');}}if(_0x226e1a[_0x9b19('0x18')]){_0x49c491=_0x226e1a[_0x9b19('0x18')];_0x2f7a2c[_0x9b19('0x19')]=_0x9b19('0x1a')+_0x5e8318+'.'+_0x226e1a[_0x9b19('0x1b')]+_0x9b19('0x1c')+_0x226e1a[_0x9b19('0x18')]+')\x20'+parseOperator(_0x226e1a['operator']);}else{_0x2f7a2c[_0x9b19('0x19')]=_0x5e8318+'.'+_0x226e1a[_0x9b19('0x1b')]+'\x20'+parseOperator(_0x226e1a[_0x9b19('0x13')]);}if(_[_0x9b19('0x15')]([_0x9b19('0x1d'),_0x9b19('0x1e')],_0x226e1a['operator']))_0x2f7a2c[_0x9b19('0x19')]='('+_0x2f7a2c[_0x9b19('0x19')]+'\x20OR\x20'+_0x5e8318+'.'+_0x226e1a[_0x9b19('0x1b')]+_0x9b19('0x1f');_0x2f7a2c[_0x9b19('0x14')]=parseValue(_0x49c491,_0x226e1a['operator'],_0x226e1a['value']);return _0x2f7a2c;};function parseOperator(_0x31f122){var _0x334b79;switch(_0x31f122){case _0x9b19('0x20'):_0x334b79=_0x9b19('0x21');break;case'$notIn':_0x334b79=_0x9b19('0x22');break;case _0x9b19('0x12'):_0x334b79='=\x20?';break;case _0x9b19('0x1d'):_0x334b79=_0x9b19('0x23');break;case _0x9b19('0x24'):case'$startsWith':case _0x9b19('0x25'):_0x334b79=_0x9b19('0x26');break;case'$lt':_0x334b79=_0x9b19('0x27');break;case'$gt':_0x334b79=_0x9b19('0x28');break;case'$lte':_0x334b79=_0x9b19('0x29');break;case'$gte':_0x334b79='>=\x20?';break;case _0x9b19('0x2a'):_0x334b79='BETWEEN\x20?\x20AND\x20?';break;}return _0x334b79;}function parseValue(_0x343ba3,_0x16a662,_0x57e258){var _0x1f4587={'start':undefined,'end':undefined};switch(_0x16a662){case _0x9b19('0x20'):case _0x9b19('0x1e'):_0x1f4587[_0x9b19('0x2b')]=_0x57e258[_0x9b19('0x9')](',');break;case _0x9b19('0x24'):_0x1f4587[_0x9b19('0x2b')]='%'+_0x57e258+'%';break;case _0x9b19('0x2c'):_0x1f4587['start']=_0x57e258+'%';break;case'$endsWith':_0x1f4587[_0x9b19('0x2b')]='%'+_0x57e258;break;case _0x9b19('0x2a'):var _0x453130=_0x57e258[_0x9b19('0x9')](',');var _0x57e258=_0x453130[_0x9b19('0xd')]();var _0x1226b0=_0x453130[_0x9b19('0x2d')]();if(_0x343ba3===_0x9b19('0x11')){_0x57e258=moment(_0x57e258)[_0x9b19('0x2e')](0x0,!![])[_0x9b19('0x17')]();_0x1226b0=moment(_0x1226b0)[_0x9b19('0x2e')](0x0,!![])['add'](0x17,_0x9b19('0x2f'))['add'](0x3b,_0x9b19('0x30'))[_0x9b19('0x16')](0x3b,'seconds')[_0x9b19('0x17')]();}_0x1f4587={'start':_0x57e258,'end':_0x1226b0};break;default:_0x1f4587[_0x9b19('0x2b')]=_0x57e258;break;}return _0x1f4587;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ddf349a..a9cca78 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 _0xf8d1=['col','unsigned','substr','DESC','ASC','isEmpty','isString','length','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','getOptions','query','$id','model','name','attributes','intersection','order','where','pick','filter','merge','type','lower','lodash','moment','parse','includes','keys','fields','filters','forOwn','find','$gte','format','utc','YYYY-MM-DD','subtract','uniqueid','isArray','split','limit','offset','sort','map','indexOf','priority','cast'];(function(_0x354b5b,_0x2df4e1){var _0x456ea6=function(_0x3ea45f){while(--_0x3ea45f){_0x354b5b['push'](_0x354b5b['shift']());}};_0x456ea6(++_0x2df4e1);}(_0xf8d1,0xc4));var _0x1f8d=function(_0xe41f5a,_0x2962df){_0xe41f5a=_0xe41f5a-0x0;var _0x678310=_0xf8d1[_0xe41f5a];return _0x678310;};'use strict';var _=require(_0x1f8d('0x0'));var sequelize=require('sequelize');var moment=require(_0x1f8d('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x34927d){var _0x4e281e=['ne'];try{var _0xb404ca=JSON[_0x1f8d('0x2')](_0x34927d);var _0xfa1ad1=Object['keys'](_0xb404ca)[0x0];return _0x4e281e[_0x1f8d('0x3')](_0xfa1ad1);}catch(_0x560b44){return![];}}function getOperatorValue(_0x1181b5){var _0x26bc25=JSON['parse'](_0x1181b5);var _0x4ef517=Object[_0x1f8d('0x4')](_0x26bc25)[0x0];var _0x36915c=_0x26bc25[_0x4ef517];return{['$'+_0x4ef517]:_0x36915c};}exports[_0x1f8d('0x5')]=function(_0x3c32ac){var _0x127703=null;if(_0x3c32ac){_0x127703=_0x3c32ac['split'](',');}return _0x127703;};exports[_0x1f8d('0x6')]=function(_0x5ccf68,_0x4a3b8f){var _0x13fbdd={};if(!_['isEmpty'](_0x5ccf68)){_[_0x1f8d('0x7')](_0x5ccf68,function(_0x1136ed,_0x51fad2){try{if(_0x4a3b8f){var _0x448084=_[_0x1f8d('0x8')](_0x4a3b8f,{'name':_0x51fad2})||{};if(hasSequelizeOperator(_0x1136ed)){_0x13fbdd[_0x51fad2]=getOperatorValue(_0x1136ed);}else if(_0x448084['type']==='DATE'&&_['isPlainObject'](_0x1136ed)){var _0x2053c3=JSON[_0x1f8d('0x2')](_0x1136ed);var _0x2c7f33={'$gte':moment(moment(_0x2053c3[_0x1f8d('0x9')])[_0x1f8d('0xa')]('YYYY-MM-DD'))[_0x1f8d('0xb')]()[_0x1f8d('0xa')](),'$lte':moment(moment(_0x2053c3['$lte'])[_0x1f8d('0xa')](_0x1f8d('0xc')))[_0x1f8d('0xb')]()[_0x1f8d('0xd')](0x1,'s')[_0x1f8d('0xa')]()};_0x13fbdd[_0x51fad2]=_0x2c7f33;}else if(_0x448084['name']===_0x1f8d('0xe')){_0x13fbdd[_0x51fad2]=_0x1136ed;}else{_0x13fbdd[_0x51fad2]=_[_0x1f8d('0xf')](_0x1136ed)?_0x1136ed:JSON['parse'](_0x1136ed);}}else{_0x13fbdd[_0x51fad2]=_[_0x1f8d('0xf')](_0x1136ed)?_0x1136ed:JSON[_0x1f8d('0x2')](_0x1136ed);}}catch(_0x19f65e){_0x13fbdd[_0x51fad2]=_0x1136ed[_0x1f8d('0x10')](',');}});}return _0x13fbdd;};exports[_0x1f8d('0x11')]=function(_0x4b5703){_0x4b5703=parseInt(_0x4b5703,0xa);if(!_0x4b5703||_0x4b5703<0x0){_0x4b5703=LIMIT_VALUE;}return _0x4b5703;};exports[_0x1f8d('0x12')]=function(_0x32ccc5){_0x32ccc5=parseInt(_0x32ccc5,0xa);if(!_0x32ccc5||_0x32ccc5<0x0){_0x32ccc5=0x0;}return _0x32ccc5;};exports[_0x1f8d('0x13')]=function(_0x419924){var _0x1efb62,_0x2f25c9=null;if(_0x419924){_0x1efb62=_0x419924[_0x1f8d('0x10')](',');_0x2f25c9=_[_0x1f8d('0x14')](_0x1efb62,function(_0x23ec43){if(_0x23ec43[_0x1f8d('0x15')]('-')===0x0){return[_0x23ec43===_0x1f8d('0x16')?sequelize[_0x1f8d('0x17')](sequelize[_0x1f8d('0x18')](_0x1f8d('0x16')),_0x1f8d('0x19')):_0x23ec43[_0x1f8d('0x1a')](0x1),_0x1f8d('0x1b')];}else{return[_0x23ec43===_0x1f8d('0x16')?sequelize[_0x1f8d('0x17')](sequelize[_0x1f8d('0x18')](_0x1f8d('0x16')),_0x1f8d('0x19')):_0x23ec43,_0x1f8d('0x1c')];}});}return _0x2f25c9;};exports['omit']=function(_0x4416f2,_0x2adc34){if(_[_0x1f8d('0x1d')](_0x4416f2)){return _0x4416f2;}if(_[_0x1f8d('0xf')](_0x4416f2)){for(var _0x43adc9=0x0;_0x43adc9<_0x4416f2['length'];_0x43adc9+=0x1){_0x4416f2[_0x43adc9]=this['omit'](_0x4416f2[_0x43adc9],_0x2adc34);}return _0x4416f2;}if(!_['isObject'](_0x4416f2)){return _0x4416f2;}if(_[_0x1f8d('0x1e')](_0x2adc34)){_0x2adc34=[_0x2adc34];}if(!_['isArray'](_0x2adc34)){return _0x4416f2;}for(var _0x4e5f0c=0x0;_0x4e5f0c<_0x2adc34[_0x1f8d('0x1f')];_0x4e5f0c+=0x1){_[_0x1f8d('0x20')](_0x4416f2,_0x2adc34[_0x4e5f0c]);}for(var _0x2105f5 in _0x4416f2){if(_0x4416f2[_0x1f8d('0x21')](_0x2105f5)){_0x4416f2[_0x2105f5]=this[_0x1f8d('0x22')](_0x4416f2[_0x2105f5],_0x2adc34);}}return _0x4416f2;};exports[_0x1f8d('0x23')]=function(_0x479f8a){return _0x479f8a[_0x1f8d('0x24')](RegExp(_0x1f8d('0x25')))?!![]:![];};exports[_0x1f8d('0x26')]=function(_0x48711c){return _0x48711c[_0x1f8d('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x1f8d('0x27')]=function(_0x1437d4){var _0x55682d=[];_0x1437d4['split'](/[ ,]+/)[_0x1f8d('0x28')](function(_0x4bbfad){_0x4bbfad=_0x4bbfad['replace'](/([^:]")"+/g,'$1');_0x4bbfad='+'+_0x4bbfad+'*';if(_0x4bbfad[_0x1f8d('0x3')]('@'))_0x4bbfad='\x22'+_0x4bbfad+'\x22';_0x55682d['push'](_0x4bbfad);});return _0x55682d['join']('\x20');};exports[_0x1f8d('0x29')]=function(_0x11ca9a,_0x4c2d9a,_0x59a7a2){var _0x506617={},_0x673c2a={};if(_0x4c2d9a[_0x1f8d('0x2a')]['$id']){_0x4c2d9a[_0x1f8d('0x2a')]['id']=_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x2b')];delete _0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x2b')];}_0x506617[_0x1f8d('0x2c')]=_[_0x1f8d('0x14')](_0x11ca9a,_0x1f8d('0x2d'));_0x506617[_0x1f8d('0x2a')]=_[_0x1f8d('0x4')](_0x4c2d9a[_0x1f8d('0x2a')]);_0x506617['filters']=_['intersection'](_0x506617['model'],_0x506617[_0x1f8d('0x2a')]);_0x673c2a[_0x1f8d('0x2e')]=_[_0x1f8d('0x2f')](_0x506617[_0x1f8d('0x2c')],this[_0x1f8d('0x5')](_0x4c2d9a['query'][_0x1f8d('0x5')]));_0x673c2a['attributes']=_0x673c2a['attributes'][_0x1f8d('0x1f')]?_0x673c2a[_0x1f8d('0x2e')]:_0x506617[_0x1f8d('0x2c')];if(!_0x4c2d9a['query'][_0x1f8d('0x21')]('nolimit')){_0x673c2a[_0x1f8d('0x11')]=this['limit'](_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x11')]);_0x673c2a[_0x1f8d('0x12')]=this[_0x1f8d('0x12')](_0x4c2d9a['query']['offset']);}_0x673c2a[_0x1f8d('0x30')]=this[_0x1f8d('0x13')](_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x13')]);_0x673c2a[_0x1f8d('0x31')]=this['filters'](_[_0x1f8d('0x32')](_0x4c2d9a['query'],_0x506617[_0x1f8d('0x6')]),_0x11ca9a);if(_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x33')]){_0x673c2a['where']=_[_0x1f8d('0x34')](_0x673c2a[_0x1f8d('0x31')],{'$or':_[_0x1f8d('0x14')](_0x11ca9a,function(_0x57b44f){if(_0x57b44f[_0x1f8d('0x35')]!=='VIRTUAL'){if(_0x59a7a2){return sequelize['where'](sequelize['fn'](_0x1f8d('0x36'),sequelize[_0x1f8d('0x18')](_0x57b44f[_0x1f8d('0x2d')])),{'$like':sequelize['fn']('lower','%'+_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x33')]+'%')});}else{var _0xabd18={};_0xabd18[_0x57b44f[_0x1f8d('0x2d')]]={'$like':'%'+_0x4c2d9a[_0x1f8d('0x2a')][_0x1f8d('0x33')]+'%'};return _0xabd18;}}})});}_0x673c2a=_[_0x1f8d('0x34')]({},_0x673c2a,_0x4c2d9a['options']);return _0x673c2a;}; \ No newline at end of file +var _0xbfad=['keys','includes','parse','fields','split','isEmpty','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','priority','cast','unsigned','substr','DESC','col','ASC','length','omit','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','getOptions','query','$id','model','map','filters','intersection','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','options','lodash','sequelize'];(function(_0x1e09c9,_0x595587){var _0x3d6eb4=function(_0x3d01ba){while(--_0x3d01ba){_0x1e09c9['push'](_0x1e09c9['shift']());}};_0x3d6eb4(++_0x595587);}(_0xbfad,0xe6));var _0xdbfa=function(_0xfd7a47,_0x16c3b7){_0xfd7a47=_0xfd7a47-0x0;var _0x1b7ef0=_0xbfad[_0xfd7a47];return _0x1b7ef0;};'use strict';var _=require(_0xdbfa('0x0'));var sequelize=require(_0xdbfa('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x47f423){var _0x2dfa79=['ne'];try{var _0x370e55=JSON['parse'](_0x47f423);var _0x84722d=Object[_0xdbfa('0x2')](_0x370e55)[0x0];return _0x2dfa79[_0xdbfa('0x3')](_0x84722d);}catch(_0x2cb201){return![];}}function getOperatorValue(_0x584391){var _0xaa8dde=JSON[_0xdbfa('0x4')](_0x584391);var _0x5bb19d=Object['keys'](_0xaa8dde)[0x0];var _0xa3c2a6=_0xaa8dde[_0x5bb19d];return{['$'+_0x5bb19d]:_0xa3c2a6};}exports[_0xdbfa('0x5')]=function(_0x568d40){var _0x2142f4=null;if(_0x568d40){_0x2142f4=_0x568d40[_0xdbfa('0x6')](',');}return _0x2142f4;};exports['filters']=function(_0x42c17e,_0x4e8d00){var _0x1b4b72={};if(!_[_0xdbfa('0x7')](_0x42c17e)){_['forOwn'](_0x42c17e,function(_0x156e79,_0x2fcd68){try{if(_0x4e8d00){var _0x56efb9=_['find'](_0x4e8d00,{'name':_0x2fcd68})||{};if(hasSequelizeOperator(_0x156e79)){_0x1b4b72[_0x2fcd68]=getOperatorValue(_0x156e79);}else if(_0x56efb9[_0xdbfa('0x8')]===_0xdbfa('0x9')&&_[_0xdbfa('0xa')](_0x156e79)){var _0x58d031=JSON[_0xdbfa('0x4')](_0x156e79);var _0x292778={'$gte':moment(moment(_0x58d031['$gte'])[_0xdbfa('0xb')](_0xdbfa('0xc')))[_0xdbfa('0xd')]()[_0xdbfa('0xb')](),'$lte':moment(moment(_0x58d031[_0xdbfa('0xe')])[_0xdbfa('0xb')](_0xdbfa('0xc')))['utc']()[_0xdbfa('0xf')](0x1,'s')[_0xdbfa('0xb')]()};_0x1b4b72[_0x2fcd68]=_0x292778;}else if(_0x56efb9[_0xdbfa('0x10')]===_0xdbfa('0x11')){_0x1b4b72[_0x2fcd68]=_0x156e79;}else{_0x1b4b72[_0x2fcd68]=_['isArray'](_0x156e79)?_0x156e79:JSON[_0xdbfa('0x4')](_0x156e79);}}else{_0x1b4b72[_0x2fcd68]=_[_0xdbfa('0x12')](_0x156e79)?_0x156e79:JSON[_0xdbfa('0x4')](_0x156e79);}}catch(_0x1e3690){_0x1b4b72[_0x2fcd68]=_0x156e79[_0xdbfa('0x6')](',');}});}return _0x1b4b72;};exports[_0xdbfa('0x13')]=function(_0x57d586){_0x57d586=parseInt(_0x57d586,0xa);if(!_0x57d586||_0x57d586<0x0){_0x57d586=LIMIT_VALUE;}return _0x57d586;};exports[_0xdbfa('0x14')]=function(_0x103f66){_0x103f66=parseInt(_0x103f66,0xa);if(!_0x103f66||_0x103f66<0x0){_0x103f66=0x0;}return _0x103f66;};exports[_0xdbfa('0x15')]=function(_0x4a7353){var _0x5aefdb,_0x712404=null;if(_0x4a7353){_0x5aefdb=_0x4a7353[_0xdbfa('0x6')](',');_0x712404=_['map'](_0x5aefdb,function(_0x2a835e){if(_0x2a835e['indexOf']('-')===0x0){return[_0x2a835e===_0xdbfa('0x16')?sequelize[_0xdbfa('0x17')](sequelize['col'](_0xdbfa('0x16')),_0xdbfa('0x18')):_0x2a835e[_0xdbfa('0x19')](0x1),_0xdbfa('0x1a')];}else{return[_0x2a835e===_0xdbfa('0x16')?sequelize[_0xdbfa('0x17')](sequelize[_0xdbfa('0x1b')](_0xdbfa('0x16')),_0xdbfa('0x18')):_0x2a835e,_0xdbfa('0x1c')];}});}return _0x712404;};exports['omit']=function(_0x10dfe2,_0x574534){if(_[_0xdbfa('0x7')](_0x10dfe2)){return _0x10dfe2;}if(_[_0xdbfa('0x12')](_0x10dfe2)){for(var _0x151d58=0x0;_0x151d58<_0x10dfe2[_0xdbfa('0x1d')];_0x151d58+=0x1){_0x10dfe2[_0x151d58]=this[_0xdbfa('0x1e')](_0x10dfe2[_0x151d58],_0x574534);}return _0x10dfe2;}if(!_[_0xdbfa('0x1f')](_0x10dfe2)){return _0x10dfe2;}if(_['isString'](_0x574534)){_0x574534=[_0x574534];}if(!_[_0xdbfa('0x12')](_0x574534)){return _0x10dfe2;}for(var _0x2843bc=0x0;_0x2843bc<_0x574534[_0xdbfa('0x1d')];_0x2843bc+=0x1){_[_0xdbfa('0x20')](_0x10dfe2,_0x574534[_0x2843bc]);}for(var _0x589a6e in _0x10dfe2){if(_0x10dfe2[_0xdbfa('0x21')](_0x589a6e)){_0x10dfe2[_0x589a6e]=this[_0xdbfa('0x1e')](_0x10dfe2[_0x589a6e],_0x574534);}}return _0x10dfe2;};exports[_0xdbfa('0x22')]=function(_0x126a9d){return _0x126a9d[_0xdbfa('0x23')](RegExp(_0xdbfa('0x24')))?!![]:![];};exports[_0xdbfa('0x25')]=function(_0x18474b){return _0x18474b[_0xdbfa('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xdbfa('0x26')]=function(_0x49d497){var _0x391b74=[];_0x49d497[_0xdbfa('0x6')](/[ ,]+/)[_0xdbfa('0x27')](function(_0x7a0a39){_0x7a0a39=_0x7a0a39[_0xdbfa('0x28')](/([^:]")"+/g,'$1');_0x7a0a39='+'+_0x7a0a39+'*';if(_0x7a0a39[_0xdbfa('0x3')]('@'))_0x7a0a39='\x22'+_0x7a0a39+'\x22';_0x391b74['push'](_0x7a0a39);});return _0x391b74['join']('\x20');};exports[_0xdbfa('0x29')]=function(_0x5d80ae,_0x21a73f,_0x23b0a6){var _0x2062c3={},_0x2780d6={};if(_0x21a73f[_0xdbfa('0x2a')][_0xdbfa('0x2b')]){_0x21a73f[_0xdbfa('0x2a')]['id']=_0x21a73f[_0xdbfa('0x2a')]['$id'];delete _0x21a73f[_0xdbfa('0x2a')][_0xdbfa('0x2b')];}_0x2062c3[_0xdbfa('0x2c')]=_[_0xdbfa('0x2d')](_0x5d80ae,_0xdbfa('0x10'));_0x2062c3[_0xdbfa('0x2a')]=_[_0xdbfa('0x2')](_0x21a73f[_0xdbfa('0x2a')]);_0x2062c3[_0xdbfa('0x2e')]=_[_0xdbfa('0x2f')](_0x2062c3[_0xdbfa('0x2c')],_0x2062c3['query']);_0x2780d6[_0xdbfa('0x30')]=_['intersection'](_0x2062c3[_0xdbfa('0x2c')],this[_0xdbfa('0x5')](_0x21a73f[_0xdbfa('0x2a')]['fields']));_0x2780d6[_0xdbfa('0x30')]=_0x2780d6[_0xdbfa('0x30')][_0xdbfa('0x1d')]?_0x2780d6[_0xdbfa('0x30')]:_0x2062c3[_0xdbfa('0x2c')];if(!_0x21a73f[_0xdbfa('0x2a')][_0xdbfa('0x21')](_0xdbfa('0x31'))){_0x2780d6[_0xdbfa('0x13')]=this[_0xdbfa('0x13')](_0x21a73f[_0xdbfa('0x2a')]['limit']);_0x2780d6[_0xdbfa('0x14')]=this['offset'](_0x21a73f[_0xdbfa('0x2a')]['offset']);}_0x2780d6[_0xdbfa('0x32')]=this[_0xdbfa('0x15')](_0x21a73f[_0xdbfa('0x2a')][_0xdbfa('0x15')]);_0x2780d6[_0xdbfa('0x33')]=this[_0xdbfa('0x2e')](_[_0xdbfa('0x34')](_0x21a73f[_0xdbfa('0x2a')],_0x2062c3['filters']),_0x5d80ae);if(_0x21a73f['query'][_0xdbfa('0x35')]){_0x2780d6['where']=_[_0xdbfa('0x36')](_0x2780d6['where'],{'$or':_['map'](_0x5d80ae,function(_0x47f2e0){if(_0x47f2e0[_0xdbfa('0x8')]!==_0xdbfa('0x37')){if(_0x23b0a6){return sequelize['where'](sequelize['fn'](_0xdbfa('0x38'),sequelize[_0xdbfa('0x1b')](_0x47f2e0[_0xdbfa('0x10')])),{'$like':sequelize['fn'](_0xdbfa('0x38'),'%'+_0x21a73f['query'][_0xdbfa('0x35')]+'%')});}else{var _0x107844={};_0x107844[_0x47f2e0[_0xdbfa('0x10')]]={'$like':'%'+_0x21a73f[_0xdbfa('0x2a')][_0xdbfa('0x35')]+'%'};return _0x107844;}}})});}_0x2780d6=_[_0xdbfa('0x36')]({},_0x2780d6,_0x21a73f[_0xdbfa('0x39')]);return _0x2780d6;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 696e3a6..13308e4 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7fb=['../mysqldb','get','env','production','set','appPath','join','root','development','client','use','toISOString','static','views','/server/views','engine','html','renderFile','view\x20engine','urlencoded','json','50mb','initialize','express','body-parser','method-override','cookie-parser','errorhandler','passport'];(function(_0x1d3707,_0x20f724){var _0x3f8c7a=function(_0x509397){while(--_0x509397){_0x1d3707['push'](_0x1d3707['shift']());}};_0x3f8c7a(++_0x20f724);}(_0xd7fb,0x8b));var _0xbd7f=function(_0x1df05f,_0x17978c){_0x1df05f=_0x1df05f-0x0;var _0x350697=_0xd7fb[_0x1df05f];return _0x350697;};'use strict';var express=require(_0xbd7f('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xbd7f('0x1'));var methodOverride=require(_0xbd7f('0x2'));var cookieParser=require(_0xbd7f('0x3'));var errorHandler=require(_0xbd7f('0x4'));var path=require('path');var passport=require(_0xbd7f('0x5'));var cors=require('cors');var moment=require('moment');var config=require('./environment');var db=require(_0xbd7f('0x6'))['db'];exports['default']=function(_0x15317e){var _0x4bfd2b=_0x15317e[_0xbd7f('0x7')](_0xbd7f('0x8'));if(_0x4bfd2b===_0xbd7f('0x9')){_0x15317e[_0xbd7f('0xa')](_0xbd7f('0xb'),path[_0xbd7f('0xc')](config[_0xbd7f('0xd')],'public'));}if(_0x4bfd2b===_0xbd7f('0xe')||_0x4bfd2b==='test'){_0x15317e[_0xbd7f('0xa')](_0xbd7f('0xb'),path['join'](config[_0xbd7f('0xd')],_0xbd7f('0xf')));_0x15317e[_0xbd7f('0x10')](errorHandler());}_0x15317e[_0xbd7f('0xa')]('json\x20replacer',function(_0x5e2196,_0xdd8cba){if(this[_0x5e2196]instanceof Date){_0xdd8cba=this[_0x5e2196][_0xbd7f('0x11')]()['split']('.')[0x0]+'Z';}return _0xdd8cba;});_0x15317e[_0xbd7f('0x10')](express[_0xbd7f('0x12')](_0x15317e[_0xbd7f('0x7')]('appPath')));_0x15317e[_0xbd7f('0xa')](_0xbd7f('0x13'),config['root']+_0xbd7f('0x14'));_0x15317e[_0xbd7f('0x15')](_0xbd7f('0x16'),require('ejs')[_0xbd7f('0x17')]);_0x15317e[_0xbd7f('0xa')](_0xbd7f('0x18'),'html');_0x15317e[_0xbd7f('0x10')](bodyParser[_0xbd7f('0x19')]({'limit':'50mb','extended':!![]}));_0x15317e[_0xbd7f('0x10')](bodyParser[_0xbd7f('0x1a')]({'limit':_0xbd7f('0x1b')}));_0x15317e['use'](cors());_0x15317e['use'](methodOverride());_0x15317e[_0xbd7f('0x10')](cookieParser());_0x15317e['use'](passport[_0xbd7f('0x1c')]());}; \ No newline at end of file +var _0x096e=['split','static','get','views','/server/views','engine','html','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','set','appPath','join','public','development','test','root','client','use','toISOString'];(function(_0x246a39,_0x368baf){var _0x3eb6e9=function(_0x599ba8){while(--_0x599ba8){_0x246a39['push'](_0x246a39['shift']());}};_0x3eb6e9(++_0x368baf);}(_0x096e,0x13d));var _0xe096=function(_0x17fcde,_0x58faf8){_0x17fcde=_0x17fcde-0x0;var _0x31932a=_0x096e[_0x17fcde];return _0x31932a;};'use strict';var express=require(_0xe096('0x0'));var favicon=require(_0xe096('0x1'));var bodyParser=require(_0xe096('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0xe096('0x3'));var errorHandler=require(_0xe096('0x4'));var path=require(_0xe096('0x5'));var passport=require(_0xe096('0x6'));var cors=require(_0xe096('0x7'));var moment=require(_0xe096('0x8'));var config=require(_0xe096('0x9'));var db=require(_0xe096('0xa'))['db'];exports[_0xe096('0xb')]=function(_0xd909f6){var _0x2c0929=_0xd909f6['get'](_0xe096('0xc'));if(_0x2c0929==='production'){_0xd909f6[_0xe096('0xd')](_0xe096('0xe'),path[_0xe096('0xf')](config['root'],_0xe096('0x10')));}if(_0x2c0929===_0xe096('0x11')||_0x2c0929===_0xe096('0x12')){_0xd909f6[_0xe096('0xd')]('appPath',path[_0xe096('0xf')](config[_0xe096('0x13')],_0xe096('0x14')));_0xd909f6[_0xe096('0x15')](errorHandler());}_0xd909f6[_0xe096('0xd')]('json\x20replacer',function(_0x592333,_0x49ae17){if(this[_0x592333]instanceof Date){_0x49ae17=this[_0x592333][_0xe096('0x16')]()[_0xe096('0x17')]('.')[0x0]+'Z';}return _0x49ae17;});_0xd909f6[_0xe096('0x15')](express[_0xe096('0x18')](_0xd909f6[_0xe096('0x19')](_0xe096('0xe'))));_0xd909f6[_0xe096('0xd')](_0xe096('0x1a'),config['root']+_0xe096('0x1b'));_0xd909f6[_0xe096('0x1c')](_0xe096('0x1d'),require('ejs')['renderFile']);_0xd909f6[_0xe096('0xd')](_0xe096('0x1e'),_0xe096('0x1d'));_0xd909f6[_0xe096('0x15')](bodyParser['urlencoded']({'limit':_0xe096('0x1f'),'extended':!![]}));_0xd909f6[_0xe096('0x15')](bodyParser[_0xe096('0x20')]({'limit':_0xe096('0x1f')}));_0xd909f6['use'](cors());_0xd909f6['use'](methodOverride());_0xd909f6['use'](cookieParser());_0xd909f6['use'](passport[_0xe096('0x21')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index daa6035..68eede3 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 _0x180b=['substring','lodash','crypto','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','digest'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x180b,0x182));var _0xb180=function(_0x1c3708,_0x519cbf){_0x1c3708=_0x1c3708-0x0;var _0x224854=_0x180b[_0x1c3708];return _0x224854;};'use strict';var _=require(_0xb180('0x0'));var os=require('os');var crypto=require(_0xb180('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0xb180('0x2'));function getInterfaces(){var _0x5e8519=[];var _0x571805=os[_0xb180('0x3')]();var _0x4c296d=_[_0xb180('0x4')](_[_0xb180('0x5')](_0x571805));for(var _0xa874f1=0x0;_0xa874f1<_0x4c296d[_0xb180('0x6')];_0xa874f1++){var _0x42b7cc=_0x571805[_0x4c296d[_0xa874f1]][_0xb180('0x7')](function(_0x2d0c60){return _0x2d0c60[_0xb180('0x8')]===_0xb180('0x9')&&_0x2d0c60[_0xb180('0xa')]===![];});_0x5e8519=_0x5e8519['concat'](_0x42b7cc);}return _0x5e8519;}function getFirstInterface(){var _0x409434=_[_0xb180('0xb')](getInterfaces());return{'macAddress':_0x409434&&_0x409434[_0xb180('0xc')]?_0x409434[_0xb180('0xc')]:'00:00:00:00:00:00','ipAddress':_0x409434&&_0x409434[_0xb180('0xd')]?_0x409434[_0xb180('0xd')]:_0xb180('0xe')};}exports[_0xb180('0xf')]=getFirstInterface;function getCPUhash(){var _0x17495d=_[_0xb180('0x4')](os[_0xb180('0x10')]()[_0xb180('0x11')](function(_0x171f41){return _0x171f41[_0xb180('0x12')];}))[_0xb180('0x13')](':');return crypto[_0xb180('0x14')](_0xb180('0x15'))[_0xb180('0x16')](_0x17495d)['digest'](_0xb180('0x17'));}exports[_0xb180('0x18')]=function(){var _0x141761=os['platform']();var _0x145855=/[0-9a-f-]{36}/;if(config[_0xb180('0x19')]&&_0x145855[_0xb180('0x1a')](config[_0xb180('0x19')])){return config['licenseToken'];}else if(_0x141761===_0xb180('0x1b')){return exec(_0xb180('0x1c'),{'encoding':_0xb180('0x1d')})[_0xb180('0x1e')]('\x0d\x0a','');}else{var _0xcf1bd0=getFirstInterface();var _0x4280cb=getCPUhash();var _0x4746f3=_0x4280cb+'|'+os['hostname']()+'|'+_0xcf1bd0[_0xb180('0x1f')]+'|'+_0xcf1bd0[_0xb180('0x20')];var _0xf41af=crypto[_0xb180('0x14')](_0xb180('0x15'))[_0xb180('0x16')](_0x4746f3)[_0xb180('0x21')]('hex');return _0xf41af['substring'](0x0,0x8)+'-'+_0xf41af[_0xb180('0x22')](0x8,0xc)+'-'+_0xf41af[_0xb180('0x22')](0xc,0x10)+'-'+_0xf41af[_0xb180('0x22')](0x10,0x14)+'-'+_0xf41af['substring'](0x14);}}; \ No newline at end of file +var _0x8371=['child_process','orderBy','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','update','getUuid','platform','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','md5','digest','hex','substring','crypto','bimedia-machine-uuid'];(function(_0x35954d,_0x33ea57){var _0x21f2d1=function(_0x4d14c7){while(--_0x4d14c7){_0x35954d['push'](_0x35954d['shift']());}};_0x21f2d1(++_0x33ea57);}(_0x8371,0x174));var _0x1837=function(_0x29c9e1,_0x4283f2){_0x29c9e1=_0x29c9e1-0x0;var _0x133e07=_0x8371[_0x29c9e1];return _0x133e07;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x1837('0x0'));var machine=require(_0x1837('0x1'));var exec=require(_0x1837('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x5bd1dd=[];var _0x3a811e=os['networkInterfaces']();var _0x11958c=_[_0x1837('0x3')](_['keys'](_0x3a811e));for(var _0x2f488c=0x0;_0x2f488c<_0x11958c[_0x1837('0x4')];_0x2f488c++){var _0x1f02ad=_0x3a811e[_0x11958c[_0x2f488c]][_0x1837('0x5')](function(_0x2826f4){return _0x2826f4[_0x1837('0x6')]===_0x1837('0x7')&&_0x2826f4[_0x1837('0x8')]===![];});_0x5bd1dd=_0x5bd1dd[_0x1837('0x9')](_0x1f02ad);}return _0x5bd1dd;}function getFirstInterface(){var _0x593873=_[_0x1837('0xa')](getInterfaces());return{'macAddress':_0x593873&&_0x593873[_0x1837('0xb')]?_0x593873[_0x1837('0xb')]:_0x1837('0xc'),'ipAddress':_0x593873&&_0x593873['address']?_0x593873[_0x1837('0xd')]:_0x1837('0xe')};}exports[_0x1837('0xf')]=getFirstInterface;function getCPUhash(){var _0x4ee788=_[_0x1837('0x3')](os[_0x1837('0x10')]()[_0x1837('0x11')](function(_0x248f6a){return _0x248f6a['model'];}))[_0x1837('0x12')](':');return crypto[_0x1837('0x13')]('md5')[_0x1837('0x14')](_0x4ee788)['digest']('hex');}exports[_0x1837('0x15')]=function(){var _0x5239fd=os[_0x1837('0x16')]();var _0xa52370=/[0-9a-f-]{36}/;if(config[_0x1837('0x17')]&&_0xa52370[_0x1837('0x18')](config[_0x1837('0x17')])){return config[_0x1837('0x17')];}else if(_0x5239fd===_0x1837('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x1837('0x1a')]('\x0d\x0a','');}else{var _0x435bdd=getFirstInterface();var _0x301966=getCPUhash();var _0xdaf2d0=_0x301966+'|'+os[_0x1837('0x1b')]()+'|'+_0x435bdd[_0x1837('0x1c')]+'|'+_0x435bdd[_0x1837('0x1d')];var _0x493e5c=crypto[_0x1837('0x13')](_0x1837('0x1e'))[_0x1837('0x14')](_0xdaf2d0)[_0x1837('0x1f')](_0x1837('0x20'));return _0x493e5c[_0x1837('0x21')](0x0,0x8)+'-'+_0x493e5c[_0x1837('0x21')](0x8,0xc)+'-'+_0x493e5c['substring'](0xc,0x10)+'-'+_0x493e5c[_0x1837('0x21')](0x10,0x14)+'-'+_0x493e5c[_0x1837('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d81ef03..4ec4cf8 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 _0xbdf9=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','days','catch','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','bluebird','version','../../mysqldb','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x1e96f7,_0x59125d){var _0x13aee0=function(_0x95f89d){while(--_0x95f89d){_0x1e96f7['push'](_0x1e96f7['shift']());}};_0x13aee0(++_0x59125d);}(_0xbdf9,0xd9));var _0x9bdf=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xbdf9[_0x2f57b2];return _0x5ace77;};'use strict';var util=require(_0x9bdf('0x0'));var moment=require(_0x9bdf('0x1'));var rp=require(_0x9bdf('0x2'));var BPromise=require(_0x9bdf('0x3'));var pkginfo=require('pkginfo')(module,_0x9bdf('0x4'));var db=require(_0x9bdf('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require('../logger')(_0x9bdf('0x6'));var HOST=_0x9bdf('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x40b499){return new BPromise(function(_0x3b5198,_0xb71d6f){var _0x298972=util['format'](_0x9bdf('0x8'),HOST,_0x40b499,module['exports'][_0x9bdf('0x4')]);if(oldToken){_0x298972=util[_0x9bdf('0x9')](_0x9bdf('0xa'),HOST,_0x40b499,module['exports'][_0x9bdf('0x4')],oldToken);}var _0x266af4={'uri':_0x298972,'method':_0x9bdf('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x266af4)[_0x9bdf('0xc')](function(_0x5ee03d){_0x3b5198(_0x5ee03d);})['catch'](function(_0x52123b){_0xb71d6f(_0x52123b);});});}function manageLicense(_0x567131,_0x4a4134){var _0x5a6b5a=_0x4a4134[_0x9bdf('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x5a6b5a[_0x9bdf('0xe')]!==_0x567131&&!_0x5a6b5a['data2']){oldToken=_0x5a6b5a[_0x9bdf('0xe')];}httpRequest(_0x567131)['then'](function(_0x12cf28){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x12cf28['active']){isOldTokenSent=![];if(!_0x5a6b5a[_0x9bdf('0x6')]&&_0x5a6b5a[_0x9bdf('0x6')]!=_0x12cf28['license']||_0x5a6b5a[_0x9bdf('0x6')]&&_0x5a6b5a[_0x9bdf('0xf')]){logger[_0x9bdf('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5a6b5a[_0x9bdf('0x6')]&&!_0x5a6b5a[_0x9bdf('0xf')]&&_0x5a6b5a[_0x9bdf('0x6')]!=_0x12cf28['license']){logger['info'](_0x9bdf('0x11'));}if(_0x5a6b5a[_0x9bdf('0x6')]&&!_0x5a6b5a['data2']&&_0x5a6b5a[_0x9bdf('0x6')]==_0x12cf28[_0x9bdf('0x6')]){return _0x4a4134;}return _0x4a4134[_0x9bdf('0x12')]({'data1':_0x567131,'data2':null,'license':_0x12cf28[_0x9bdf('0x6')]});}else{if(_0x12cf28['license']||_0x5a6b5a[_0x9bdf('0x6')]){if(!_0x5a6b5a[_0x9bdf('0xf')]){if(_0x5a6b5a[_0x9bdf('0xe')]==_0x567131){GRAY_PERIOD_REASON=_0x9bdf('0x13');logger['info'](_0x9bdf('0x14'));}else{GRAY_PERIOD_REASON=_0x9bdf('0x15');logger[_0x9bdf('0x10')](_0x9bdf('0x16'),_0x5a6b5a[_0x9bdf('0xe')],_0x567131);}logger[_0x9bdf('0x10')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x9bdf('0x9')](_0x9bdf('0x17')));return _0x4a4134[_0x9bdf('0x12')]({'data2':encryptor['encryptString'](moment()['format'](_0x9bdf('0x17')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x5a6b5a[_0x9bdf('0xf')]),_0x9bdf('0x18'))>DAYS){logger[_0x9bdf('0x10')]('DEMO\x20START\x20AT\x20%s',moment()[_0x9bdf('0x9')](_0x9bdf('0x17')));isOldTokenSent=![];return _0x4a4134['update']({'data1':_0x567131,'data2':null,'license':null});}}}else{if(_0x5a6b5a[_0x9bdf('0xe')]!=_0x567131){logger[_0x9bdf('0x10')](_0x9bdf('0x16'),_0x5a6b5a['data1'],_0x567131);return _0x4a4134[_0x9bdf('0x12')]({'data1':_0x567131,'data2':null,'license':null});}}}return _0x4a4134;})['then'](function(_0x51f3f3){_0x4a4134=_0x51f3f3;})[_0x9bdf('0x19')](function(_0x1e5987){logger['error'](_0x1e5987[_0x9bdf('0x1a')]);})[_0x9bdf('0x1b')](function(){setTimeout(function(){manageLicense(hardware[_0x9bdf('0x1c')](),_0x4a4134);},TIME);});}function defaultLicense(){var _0x28ea5f=hardware[_0x9bdf('0x1c')]();if(_0x28ea5f){return db[_0x9bdf('0x1d')][_0x9bdf('0x1e')]({'where':{'id':0x1},'defaults':{'data1':_0x28ea5f}})[_0x9bdf('0x1f')](function(_0x42a7d8,_0x4e4a1d){logger[_0x9bdf('0x10')](_0x9bdf('0x20'),_0x28ea5f);manageLicense(_0x28ea5f,_0x42a7d8);})[_0x9bdf('0x19')](function(_0x5398cd){logger[_0x9bdf('0x21')](_0x5398cd[_0x9bdf('0x1a')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x3cf9=['../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','version','../../mysqldb'];(function(_0x535f23,_0x10024a){var _0x113aa4=function(_0x3dd048){while(--_0x3dd048){_0x535f23['push'](_0x535f23['shift']());}};_0x113aa4(++_0x10024a);}(_0x3cf9,0x15a));var _0x93cf=function(_0x568a6c,_0x5366c5){_0x568a6c=_0x568a6c-0x0;var _0x39e1f7=_0x3cf9[_0x568a6c];return _0x39e1f7;};'use strict';var util=require('util');var moment=require(_0x93cf('0x0'));var rp=require(_0x93cf('0x1'));var BPromise=require(_0x93cf('0x2'));var pkginfo=require('pkginfo')(module,_0x93cf('0x3'));var db=require(_0x93cf('0x4'))['db'];var encryptor=require(_0x93cf('0x5'));var hardware=require(_0x93cf('0x6'));var logger=require(_0x93cf('0x7'))('license');var HOST=_0x93cf('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1ccce2){return new BPromise(function(_0x11390c,_0x3b4ff5){var _0x32fa67=util[_0x93cf('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x1ccce2,module[_0x93cf('0xa')][_0x93cf('0x3')]);if(oldToken){_0x32fa67=util[_0x93cf('0x9')](_0x93cf('0xb'),HOST,_0x1ccce2,module[_0x93cf('0xa')][_0x93cf('0x3')],oldToken);}var _0x19d873={'uri':_0x32fa67,'method':_0x93cf('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x19d873)[_0x93cf('0xd')](function(_0x61b465){_0x11390c(_0x61b465);})[_0x93cf('0xe')](function(_0xfd47ea){_0x3b4ff5(_0xfd47ea);});});}function manageLicense(_0x26cb3c,_0x48795f){var _0xc11e9a=_0x48795f[_0x93cf('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0xc11e9a[_0x93cf('0x10')]!==_0x26cb3c&&!_0xc11e9a[_0x93cf('0x11')]){oldToken=_0xc11e9a[_0x93cf('0x10')];}httpRequest(_0x26cb3c)[_0x93cf('0xd')](function(_0x4d0201){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4d0201[_0x93cf('0x12')]){isOldTokenSent=![];if(!_0xc11e9a['license']&&_0xc11e9a[_0x93cf('0x13')]!=_0x4d0201[_0x93cf('0x13')]||_0xc11e9a['license']&&_0xc11e9a[_0x93cf('0x11')]){logger[_0x93cf('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xc11e9a['license']&&!_0xc11e9a['data2']&&_0xc11e9a['license']!=_0x4d0201[_0x93cf('0x13')]){logger[_0x93cf('0x14')](_0x93cf('0x15'));}if(_0xc11e9a[_0x93cf('0x13')]&&!_0xc11e9a[_0x93cf('0x11')]&&_0xc11e9a[_0x93cf('0x13')]==_0x4d0201[_0x93cf('0x13')]){return _0x48795f;}return _0x48795f[_0x93cf('0x16')]({'data1':_0x26cb3c,'data2':null,'license':_0x4d0201[_0x93cf('0x13')]});}else{if(_0x4d0201[_0x93cf('0x13')]||_0xc11e9a[_0x93cf('0x13')]){if(!_0xc11e9a['data2']){if(_0xc11e9a[_0x93cf('0x10')]==_0x26cb3c){GRAY_PERIOD_REASON=_0x93cf('0x17');logger[_0x93cf('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x93cf('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xc11e9a['data1'],_0x26cb3c);}logger[_0x93cf('0x14')](_0x93cf('0x19'),GRAY_PERIOD_REASON[_0x93cf('0x1a')](),moment()[_0x93cf('0x9')](_0x93cf('0x1b')));return _0x48795f['update']({'data2':encryptor[_0x93cf('0x1c')](moment()[_0x93cf('0x9')](_0x93cf('0x1b')))});}else{if(moment()[_0x93cf('0x1d')](encryptor['decryptString'](_0xc11e9a[_0x93cf('0x11')]),_0x93cf('0x1e'))>DAYS){logger[_0x93cf('0x14')]('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x48795f[_0x93cf('0x16')]({'data1':_0x26cb3c,'data2':null,'license':null});}}}else{if(_0xc11e9a[_0x93cf('0x10')]!=_0x26cb3c){logger[_0x93cf('0x14')](_0x93cf('0x1f'),_0xc11e9a['data1'],_0x26cb3c);return _0x48795f[_0x93cf('0x16')]({'data1':_0x26cb3c,'data2':null,'license':null});}}}return _0x48795f;})[_0x93cf('0xd')](function(_0x4e8f9d){_0x48795f=_0x4e8f9d;})['catch'](function(_0x294180){logger[_0x93cf('0x20')](_0x294180[_0x93cf('0x21')]);})[_0x93cf('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x93cf('0x23')](),_0x48795f);},TIME);});}function defaultLicense(){var _0x1dcf33=hardware[_0x93cf('0x23')]();if(_0x1dcf33){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1dcf33}})[_0x93cf('0x24')](function(_0xd3d930,_0x2128e5){logger[_0x93cf('0x14')](_0x93cf('0x25'),_0x1dcf33);manageLicense(_0x1dcf33,_0xd3d930);})[_0x93cf('0xe')](function(_0xb01d4){logger['error'](_0xb01d4['message']);});}}exports[_0x93cf('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 12774c9..a90c97c 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 _0x6466=['data1','split','decryptString','format','parse','demo','machineUuid','gray','deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','license','isEmpty','License\x20key\x20value\x20not\x20found'];(function(_0x1db651,_0x59a68e){var _0x3d547c=function(_0x9b4313){while(--_0x9b4313){_0x1db651['push'](_0x1db651['shift']());}};_0x3d547c(++_0x59a68e);}(_0x6466,0xad));var _0x6646=function(_0x5287df,_0x46c2b6){_0x5287df=_0x5287df-0x0;var _0x187792=_0x6466[_0x5287df];return _0x187792;};'use strict';var util=require(_0x6646('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x6646('0x1'));var encryptor=require(_0x6646('0x2'));var db=require(_0x6646('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6646('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x6646('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6646('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6646('0x6'),'machineUuid':hardware[_0x6646('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x449aad){return new BPromise(function(_0x324456,_0x11bb28){return db[_0x6646('0x7')][_0x6646('0x8')](_[_0x6646('0x9')](_0x449aad,{'raw':!![],'where':{'id':0x1}}))[_0x6646('0xa')](function(_0x23bd71){return checkLicense(_0x23bd71,null);})['then'](function(_0x72d6f3){_0x324456(_0x72d6f3);return;})[_0x6646('0xb')](function(_0x56af42){_0x11bb28(_0x56af42);});});}function checkLicense(_0x1cc0c1,_0x20a1a5){if(!_0x1cc0c1){demoLicense['uuid']=_0x1cc0c1['data1'];return demoLicense;}try{var _0x196659=_0x20a1a5||_0x1cc0c1[_0x6646('0xc')];if(_[_0x6646('0xd')](_0x196659)){throw new Error(_0x6646('0xe'));}var _0x28c106=_0x1cc0c1[_0x6646('0xf')];var _0x3a34c6=_0x1cc0c1['data2'];var _0x13654b=_0x28c106[_0x6646('0x10')]('-')[0x4];var _0x46831d=_0x28c106['split']('-')[0x0];var _0x2c563f=encryptor[_0x6646('0x11')](_0x196659,util[_0x6646('0x12')]('%s:%s:%s',_0x13654b,_0x28c106,_0x46831d));var _0x437bd1=JSON[_0x6646('0x13')](_0x2c563f);_0x437bd1[_0x6646('0x14')]=![];_0x437bd1['uuid']=_0x28c106;_0x437bd1[_0x6646('0x15')]=hardware[_0x6646('0x5')]();if(_0x3a34c6){var _0x1b1ad6=encryptor[_0x6646('0x11')](_0x3a34c6);_0x437bd1[_0x6646('0x16')]=_0x1b1ad6;_0x437bd1[_0x6646('0x17')]=moment(_0x1b1ad6)[_0x6646('0x18')](0x7,_0x6646('0x19'))[_0x6646('0x12')]();_0x437bd1[_0x6646('0x1a')]=_0x437bd1['uuid']!=_0x437bd1[_0x6646('0x15')]?'changed':_0x6646('0x1b');}return _0x437bd1;}catch(_0x8a491){breakingLicense['uuid']=_0x1cc0c1[_0x6646('0xf')];breakingLicense[_0x6646('0x1c')]=_0x8a491[_0x6646('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1c09d3,_0x59adad){getLicense()[_0x6646('0xa')](function(_0x3d1ac6){return db[_0x6646('0x1d')][_0x6646('0x1e')]({'attributes':[_0x6646('0x1f'),[db[_0x6646('0x20')]['fn'](_0x6646('0x21'),db[_0x6646('0x20')][_0x6646('0x22')](_0x6646('0x1f'))),_0x6646('0x23')]],'group':_0x6646('0x1f'),'where':{'role':{'$or':[_0x6646('0x24'),_0x6646('0x25'),'telephone']}},'raw':!![]})[_0x6646('0xa')](function(_0x5b1ffe){var _0x41d8dd={'user':_0x3d1ac6[_0x6646('0x26')]||0x0,'telephone':_0x3d1ac6[_0x6646('0x27')]||0x0};_0x5b1ffe[_0x6646('0x28')](function(_0x5c408e){var _0x2a6c87=_0x5c408e['role']===_0x6646('0x24')?_0x6646('0x25'):_0x5c408e[_0x6646('0x1f')];_0x41d8dd[_0x2a6c87]-=_0x5c408e['count'];if(_0x41d8dd[_0x2a6c87]<0x0)_0x41d8dd[_0x2a6c87]=0x0;});_0x1c09d3(_0x41d8dd);return;});})[_0x6646('0xb')](function(_0x978443){_0x59adad(_0x978443);});});}function checkUserLimits(_0x35903e){return new BPromise(function(_0x2801e2,_0x49645d){getLimits()[_0x6646('0xa')](function(_0x4a3d4a){var _0x4bf935=_[_0x6646('0x29')](_[_0x6646('0x2a')](_0x35903e,_0x6646('0x1f')),[_0x6646('0x24'),_0x6646('0x25'),_0x6646('0x2b')]);var _0x220275=(_0x4bf935[_0x6646('0x24')]||0x0)+(_0x4bf935[_0x6646('0x25')]||0x0);var _0x59fcc3=_0x4bf935['telephone']||0x0;if(_0x220275>_0x4a3d4a[_0x6646('0x25')])return _0x49645d(_0x6646('0x2c'));if(_0x59fcc3>_0x4a3d4a[_0x6646('0x2b')])return _0x49645d(_0x6646('0x2d'));return _0x2801e2();})['catch'](function(_0x34af90){_0x49645d(_0x34af90);});});}module[_0x6646('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xdc30=['admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','findAll','role','COUNT','sequelize','col','count'];(function(_0x1b5a15,_0x417e28){var _0x144517=function(_0x388d79){while(--_0x388d79){_0x1b5a15['push'](_0x1b5a15['shift']());}};_0x144517(++_0x417e28);}(_0xdc30,0x12a));var _0x0dc3=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0xdc30[_0x223c0d];return _0x207827;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0dc3('0x0'));var BPromise=require(_0x0dc3('0x1'));var hardware=require(_0x0dc3('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x0dc3('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x0dc3('0x4'),'machineUuid':hardware[_0x0dc3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0dc3('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x0dc3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x51cfb0){return new BPromise(function(_0x8b14b4,_0x5d575e){return db[_0x0dc3('0x7')][_0x0dc3('0x8')](_['defaults'](_0x51cfb0,{'raw':!![],'where':{'id':0x1}}))[_0x0dc3('0x9')](function(_0x5e33df){return checkLicense(_0x5e33df,null);})['then'](function(_0x11a42a){_0x8b14b4(_0x11a42a);return;})[_0x0dc3('0xa')](function(_0x40d50c){_0x5d575e(_0x40d50c);});});}function checkLicense(_0x4b1c95,_0x3a3719){if(!_0x4b1c95){demoLicense[_0x0dc3('0xb')]=_0x4b1c95[_0x0dc3('0xc')];return demoLicense;}try{var _0x45de40=_0x3a3719||_0x4b1c95[_0x0dc3('0xd')];if(_[_0x0dc3('0xe')](_0x45de40)){throw new Error(_0x0dc3('0xf'));}var _0x2b08f6=_0x4b1c95[_0x0dc3('0xc')];var _0x529cd5=_0x4b1c95[_0x0dc3('0x10')];var _0x3b0418=_0x2b08f6['split']('-')[0x4];var _0x41dbf3=_0x2b08f6[_0x0dc3('0x11')]('-')[0x0];var _0x2a76d8=encryptor[_0x0dc3('0x12')](_0x45de40,util[_0x0dc3('0x13')](_0x0dc3('0x14'),_0x3b0418,_0x2b08f6,_0x41dbf3));var _0xdbdafa=JSON[_0x0dc3('0x15')](_0x2a76d8);_0xdbdafa['demo']=![];_0xdbdafa[_0x0dc3('0xb')]=_0x2b08f6;_0xdbdafa['machineUuid']=hardware[_0x0dc3('0x5')]();if(_0x529cd5){var _0x195eb3=encryptor[_0x0dc3('0x12')](_0x529cd5);_0xdbdafa[_0x0dc3('0x16')]=_0x195eb3;_0xdbdafa[_0x0dc3('0x17')]=moment(_0x195eb3)[_0x0dc3('0x18')](0x7,_0x0dc3('0x19'))['format']();_0xdbdafa[_0x0dc3('0x1a')]=_0xdbdafa[_0x0dc3('0xb')]!=_0xdbdafa[_0x0dc3('0x1b')]?_0x0dc3('0x1c'):_0x0dc3('0x1d');}return _0xdbdafa;}catch(_0xc2a19c){breakingLicense['uuid']=_0x4b1c95['data1'];breakingLicense[_0x0dc3('0x1e')]=_0xc2a19c[_0x0dc3('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x57fe24,_0x18e8fb){getLicense()['then'](function(_0x293673){return db[_0x0dc3('0x1f')][_0x0dc3('0x20')]({'attributes':[_0x0dc3('0x21'),[db['sequelize']['fn'](_0x0dc3('0x22'),db[_0x0dc3('0x23')][_0x0dc3('0x24')](_0x0dc3('0x21'))),_0x0dc3('0x25')]],'group':_0x0dc3('0x21'),'where':{'role':{'$or':[_0x0dc3('0x26'),_0x0dc3('0x27'),_0x0dc3('0x28')]}},'raw':!![]})[_0x0dc3('0x9')](function(_0x186cbb){var _0x54db1a={'user':_0x293673[_0x0dc3('0x29')]||0x0,'telephone':_0x293673[_0x0dc3('0x2a')]||0x0};_0x186cbb[_0x0dc3('0x2b')](function(_0x45f3d9){var _0xa7bacb=_0x45f3d9['role']===_0x0dc3('0x26')?_0x0dc3('0x27'):_0x45f3d9[_0x0dc3('0x21')];_0x54db1a[_0xa7bacb]-=_0x45f3d9['count'];if(_0x54db1a[_0xa7bacb]<0x0)_0x54db1a[_0xa7bacb]=0x0;});_0x57fe24(_0x54db1a);return;});})[_0x0dc3('0xa')](function(_0x402e91){_0x18e8fb(_0x402e91);});});}function checkUserLimits(_0x10adc2){return new BPromise(function(_0x1268b3,_0x2aa4a3){getLimits()['then'](function(_0x3304ca){var _0x387f91=_[_0x0dc3('0x2c')](_[_0x0dc3('0x2d')](_0x10adc2,_0x0dc3('0x21')),[_0x0dc3('0x26'),_0x0dc3('0x27'),_0x0dc3('0x28')]);var _0x170145=(_0x387f91[_0x0dc3('0x26')]||0x0)+(_0x387f91[_0x0dc3('0x27')]||0x0);var _0x3eb215=_0x387f91['telephone']||0x0;if(_0x170145>_0x3304ca[_0x0dc3('0x27')])return _0x2aa4a3(_0x0dc3('0x2e'));if(_0x3eb215>_0x3304ca['telephone'])return _0x2aa4a3(_0x0dc3('0x2f'));return _0x1268b3();})[_0x0dc3('0xa')](function(_0x3a4516){_0x2aa4a3(_0x3a4516);});});}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 aeef79c..101b3c9 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 _0x5204=['http://localhost:9000','app-id','secret','exports'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x5204,0xdf));var _0x4520=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0x5204[_0x58fc2f];return _0x3a1312;};'use strict';module[_0x4520('0x0')]={'DOMAIN':_0x4520('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4520('0x2'),'GOOGLE_SECRET':_0x4520('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x0424=['myappanuglar-secret','app-id','secret'];(function(_0x370889,_0x20ee32){var _0xb55998=function(_0x42d3b4){while(--_0x42d3b4){_0x370889['push'](_0x370889['shift']());}};_0xb55998(++_0x20ee32);}(_0x0424,0x159));var _0x4042=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x0424[_0x11deef];return _0xe9ba85;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x4042('0x0'),'GOOGLE_ID':_0x4042('0x1'),'GOOGLE_SECRET':_0x4042('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c4f5ef2..c104a26 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf21=['info','Console','env','moment','util','path','INFO','join','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error'];(function(_0x539931,_0xa159f){var _0x20b75a=function(_0x3da683){while(--_0x3da683){_0x539931['push'](_0x539931['shift']());}};_0x20b75a(++_0xa159f);}(_0xaf21,0x12f));var _0x1af2=function(_0x291a95,_0x56569d){_0x291a95=_0x291a95-0x0;var _0x2221c6=_0xaf21[_0x291a95];return _0x2221c6;};'use strict';var moment=require(_0x1af2('0x0'));var winston=require('winston');var util=require(_0x1af2('0x1'));var path=require(_0x1af2('0x2'));var debugLevel=_0x1af2('0x3');function filename(_0x32bd1d,_0x15df5f){return path[_0x1af2('0x4')]('/var','log',_0x1af2('0x5'),util[_0x1af2('0x6')](_0x1af2('0x7'),_0x32bd1d,_0x15df5f));}function formatter(_0x3192d9,_0x26ba04){_0x26ba04[_0x1af2('0x8')]=_0x26ba04[_0x1af2('0x8')][_0x1af2('0x9')](/@@{/g,_0x1af2('0xa'))[_0x1af2('0x9')](/}@@/g,_0x1af2('0xb'))['replace'](/@{/g,'{{')[_0x1af2('0x9')](/}@/g,'}}');return util[_0x1af2('0x6')](_0x1af2('0xc'),moment()[_0x1af2('0x6')](_0x1af2('0xd')),_0x26ba04[_0x1af2('0xe')][_0x1af2('0xf')](),_0x3192d9,_0x26ba04[_0x1af2('0x8')]);}module[_0x1af2('0x10')]=function(_0x370475){return new winston[(_0x1af2('0x11'))]({'transports':[new winston[(_0x1af2('0x12'))][(_0x1af2('0x13'))]({'name':util[_0x1af2('0x6')](_0x1af2('0x14'),_0x370475,_0x1af2('0x15')),'filename':filename(_0x370475,_0x1af2('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d97db){return formatter(_0x370475,_0x5d97db);}}),new winston[(_0x1af2('0x12'))][(_0x1af2('0x13'))]({'name':util[_0x1af2('0x6')](_0x1af2('0x14'),_0x370475,'info'),'filename':filename(_0x370475,_0x1af2('0x16')),'level':_0x1af2('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x39016a){return formatter(_0x370475,_0x39016a);}}),new winston[(_0x1af2('0x12'))][(_0x1af2('0x17'))]({'level':process[_0x1af2('0x18')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x42e695){return formatter(_0x370475,_0x42e695);}})]});}; \ No newline at end of file +var _0x648a=['%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','%s-%s','error','info','Console','debugLevel','winston','util','path','join','/var','log'];(function(_0x378fd7,_0x1ecdb2){var _0x31c3a3=function(_0x580264){while(--_0x580264){_0x378fd7['push'](_0x378fd7['shift']());}};_0x31c3a3(++_0x1ecdb2);}(_0x648a,0x1c2));var _0xa648=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x648a[_0x29d915];return _0x160f86;};'use strict';var moment=require('moment');var winston=require(_0xa648('0x0'));var util=require(_0xa648('0x1'));var path=require(_0xa648('0x2'));var debugLevel='INFO';function filename(_0x5c2ac1,_0x49c4cb){return path[_0xa648('0x3')](_0xa648('0x4'),_0xa648('0x5'),'xcally',util['format'](_0xa648('0x6'),_0x5c2ac1,_0x49c4cb));}function formatter(_0x170f01,_0x21c12d){_0x21c12d['message']=_0x21c12d[_0xa648('0x7')][_0xa648('0x8')](/@@{/g,_0xa648('0x9'))['replace'](/}@@/g,_0xa648('0xa'))[_0xa648('0x8')](/@{/g,'{{')[_0xa648('0x8')](/}@/g,'}}');return util[_0xa648('0xb')](_0xa648('0xc'),moment()[_0xa648('0xb')](_0xa648('0xd')),_0x21c12d[_0xa648('0xe')][_0xa648('0xf')](),_0x170f01,_0x21c12d['message']);}module[_0xa648('0x10')]=function(_0x5184c8){return new winston['Logger']({'transports':[new winston[(_0xa648('0x11'))][(_0xa648('0x12'))]({'name':util[_0xa648('0xb')](_0xa648('0x13'),_0x5184c8,_0xa648('0x14')),'filename':filename(_0x5184c8,_0xa648('0x14')),'level':_0xa648('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b0a1d){return formatter(_0x5184c8,_0x1b0a1d);}}),new winston['transports'][(_0xa648('0x12'))]({'name':util['format'](_0xa648('0x13'),_0x5184c8,_0xa648('0x15')),'filename':filename(_0x5184c8,_0xa648('0x15')),'level':_0xa648('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2fe14e){return formatter(_0x5184c8,_0x2fe14e);}}),new winston[(_0xa648('0x11'))][(_0xa648('0x16'))]({'level':process['env'][_0xa648('0x17')]||debugLevel,'json':![],'formatter':function(_0x576fbd){return formatter(_0x5184c8,_0x576fbd);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4d4a493..9ca14c0 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 _0xc753=['path','express','join','../../services/express/index.js','ami','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x22ce72,_0x532c20){var _0xaf0fb5=function(_0x15f37d){while(--_0x15f37d){_0x22ce72['push'](_0x22ce72['shift']());}};_0xaf0fb5(++_0x532c20);}(_0xc753,0x1c7));var _0x3c75=function(_0x22729a,_0x33b777){_0x22729a=_0x22729a-0x0;var _0x593dc6=_0xc753[_0x22729a];return _0x593dc6;};'use strict';var path=require(_0x3c75('0x0'));var os=require('os');var config={'apps':[{'name':_0x3c75('0x1'),'script':path[_0x3c75('0x2')](__dirname,_0x3c75('0x3'))},{'name':_0x3c75('0x4'),'script':path[_0x3c75('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0x3c75('0x5'))},{'name':_0x3c75('0x6'),'script':path['join'](__dirname,_0x3c75('0x7'))},{'name':_0x3c75('0x8'),'script':path['join'](__dirname,_0x3c75('0x9'))},{'name':_0x3c75('0xa'),'script':path[_0x3c75('0x2')](__dirname,_0x3c75('0xb'))}]};module[_0x3c75('0xc')]=config; \ No newline at end of file +var _0x905a=['path','express','join','../../services/express/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports'];(function(_0x4e851a,_0x3949ba){var _0x134cfa=function(_0x5a1a91){while(--_0x5a1a91){_0x4e851a['push'](_0x4e851a['shift']());}};_0x134cfa(++_0x3949ba);}(_0x905a,0x84));var _0xa905=function(_0x42cccf,_0x1d6a27){_0x42cccf=_0x42cccf-0x0;var _0x78aee2=_0x905a[_0x42cccf];return _0x78aee2;};'use strict';var path=require(_0xa905('0x0'));var os=require('os');var config={'apps':[{'name':_0xa905('0x1'),'script':path[_0xa905('0x2')](__dirname,_0xa905('0x3'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0xa905('0x4'))},{'name':_0xa905('0x5'),'script':path[_0xa905('0x2')](__dirname,_0xa905('0x6'))},{'name':_0xa905('0x7'),'script':path['join'](__dirname,_0xa905('0x8'))},{'name':'xdr','script':path[_0xa905('0x2')](__dirname,_0xa905('0x9'))}]};module[_0xa905('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f6b016b..c2a2c9c 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 _0xc938=['start','disconnect','stop','then','restart','list','describe','delete','dump','pm2','connect'];(function(_0x147218,_0x26073c){var _0x49d74f=function(_0x19e6ce){while(--_0x19e6ce){_0x147218['push'](_0x147218['shift']());}};_0x49d74f(++_0x26073c);}(_0xc938,0xf0));var _0x8c93=function(_0x164284,_0x24cdc8){_0x164284=_0x164284-0x0;var _0x5b6496=_0xc938[_0x164284];return _0x5b6496;};'use strict';var pm2=require(_0x8c93('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x4ec049,_0x100f86){return pm2[_0x8c93('0x1')](function(_0x195bd9){if(_0x195bd9){return _0x100f86(_0x195bd9);}return _0x4ec049('connected');});});};exports['start']=function(_0x43fcc0){return connect()['then'](function(){return new BPromise(function(_0x1b1154,_0x3937ab){return pm2[_0x8c93('0x2')](_0x43fcc0,function(_0x8d48f,_0x2c8140){if(_0x8d48f){return _0x3937ab(_0x8d48f);}pm2[_0x8c93('0x3')]();return _0x1b1154(_0x2c8140);});});});};exports[_0x8c93('0x4')]=function(_0x2b79bd){return connect()[_0x8c93('0x5')](function(){return new BPromise(function(_0x3d69f7,_0xae517e){return pm2[_0x8c93('0x4')](_0x2b79bd,function(_0x42e363,_0x48f779){if(_0x42e363){return _0xae517e(_0x42e363);}pm2['disconnect']();return _0x3d69f7(_0x48f779);});});});};exports[_0x8c93('0x6')]=function(_0x312a03){return connect()[_0x8c93('0x5')](function(){return new BPromise(function(_0x42c4d4,_0x4a5897){return pm2[_0x8c93('0x6')](_0x312a03,function(_0x1206a1,_0x24fa28){if(_0x1206a1){return _0x4a5897(_0x1206a1);}pm2[_0x8c93('0x3')]();return _0x42c4d4(_0x24fa28);});});});};exports[_0x8c93('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x44c755,_0x19bd20){return pm2[_0x8c93('0x7')](function(_0x46ed20,_0x5d06c5){if(_0x46ed20){return _0x19bd20(_0x46ed20);}pm2[_0x8c93('0x3')]();return _0x44c755(_0x5d06c5);});});});};exports[_0x8c93('0x8')]=function(_0x5d30c6){return connect()[_0x8c93('0x5')](function(){return new BPromise(function(_0x808874,_0x39b643){return pm2['describe'](_0x5d30c6,function(_0x2dcfb6,_0x51a0c5){if(_0x2dcfb6){return _0x39b643(_0x2dcfb6);}pm2[_0x8c93('0x3')]();return _0x808874(_0x51a0c5);});});});};exports[_0x8c93('0x9')]=function(_0xbbbdb2){return connect()['then'](function(){return new BPromise(function(_0xff70ba,_0xe65002){return pm2[_0x8c93('0x9')](_0xbbbdb2,function(_0x5852c0,_0x1c77a2){if(_0x5852c0){return _0xe65002(_0x5852c0);}pm2[_0x8c93('0x3')]();return _0xff70ba(_0x1c77a2);});});});};exports['dump']=function(){return connect()[_0x8c93('0x5')](function(){return new BPromise(function(_0x58ed44,_0x2b5fd9){return pm2[_0x8c93('0xa')](function(_0x75457c){if(_0x75457c){return _0x2b5fd9(_0x75457c);}return _0x58ed44('saved');});});});}; \ No newline at end of file +var _0x3667=['start','disconnect','stop','then','restart','list','describe','delete','saved','pm2','bluebird','connect','connected'];(function(_0x263e44,_0x568add){var _0x107c14=function(_0x14cd98){while(--_0x14cd98){_0x263e44['push'](_0x263e44['shift']());}};_0x107c14(++_0x568add);}(_0x3667,0xb2));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0x7366('0x0'));var BPromise=require(_0x7366('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x55007f,_0x3d1405){return pm2[_0x7366('0x2')](function(_0x13b42f){if(_0x13b42f){return _0x3d1405(_0x13b42f);}return _0x55007f(_0x7366('0x3'));});});};exports[_0x7366('0x4')]=function(_0x5b2d0b){return connect()['then'](function(){return new BPromise(function(_0xb8438d,_0x5cc26a){return pm2[_0x7366('0x4')](_0x5b2d0b,function(_0x316546,_0x528170){if(_0x316546){return _0x5cc26a(_0x316546);}pm2[_0x7366('0x5')]();return _0xb8438d(_0x528170);});});});};exports[_0x7366('0x6')]=function(_0x27ef2d){return connect()[_0x7366('0x7')](function(){return new BPromise(function(_0x1a3c0a,_0x3f5c27){return pm2[_0x7366('0x6')](_0x27ef2d,function(_0x5a6cb1,_0x22c265){if(_0x5a6cb1){return _0x3f5c27(_0x5a6cb1);}pm2[_0x7366('0x5')]();return _0x1a3c0a(_0x22c265);});});});};exports[_0x7366('0x8')]=function(_0x1f023c){return connect()[_0x7366('0x7')](function(){return new BPromise(function(_0x4aa6bd,_0x36afb5){return pm2[_0x7366('0x8')](_0x1f023c,function(_0x1e9b28,_0x2302a0){if(_0x1e9b28){return _0x36afb5(_0x1e9b28);}pm2[_0x7366('0x5')]();return _0x4aa6bd(_0x2302a0);});});});};exports['list']=function(){return connect()[_0x7366('0x7')](function(){return new BPromise(function(_0x37b5ac,_0x5bc854){return pm2[_0x7366('0x9')](function(_0x122592,_0x43ffa6){if(_0x122592){return _0x5bc854(_0x122592);}pm2['disconnect']();return _0x37b5ac(_0x43ffa6);});});});};exports[_0x7366('0xa')]=function(_0x33c4d8){return connect()['then'](function(){return new BPromise(function(_0xc1a1b0,_0x436657){return pm2[_0x7366('0xa')](_0x33c4d8,function(_0x2f74f9,_0x12eeec){if(_0x2f74f9){return _0x436657(_0x2f74f9);}pm2['disconnect']();return _0xc1a1b0(_0x12eeec);});});});};exports[_0x7366('0xb')]=function(_0x45b3c5){return connect()[_0x7366('0x7')](function(){return new BPromise(function(_0x2224b7,_0x21124a){return pm2[_0x7366('0xb')](_0x45b3c5,function(_0x1786e5,_0x49b70f){if(_0x1786e5){return _0x21124a(_0x1786e5);}pm2[_0x7366('0x5')]();return _0x2224b7(_0x49b70f);});});});};exports['dump']=function(){return connect()[_0x7366('0x7')](function(){return new BPromise(function(_0x3504d2,_0x85f4af){return pm2['dump'](function(_0x4410ce){if(_0x4410ce){return _0x85f4af(_0x4410ce);}return _0x3504d2(_0x7366('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c121c00..4767596 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 _0xa0b7=['length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes'];(function(_0x1894cd,_0x460529){var _0x34636a=function(_0x10a85e){while(--_0x10a85e){_0x1894cd['push'](_0x1894cd['shift']());}};_0x34636a(++_0x460529);}(_0xa0b7,0x80));var _0x7a0b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa0b7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7a0b('0x0'));var moment=require(_0x7a0b('0x1'));var Redis=require(_0x7a0b('0x2'));var util=require(_0x7a0b('0x3'));var config=require(_0x7a0b('0x4'));var db=require(_0x7a0b('0x5'))['db'];var logger=require(_0x7a0b('0x6'))(_0x7a0b('0x7'));config[_0x7a0b('0x8')]=_[_0x7a0b('0x9')](config[_0x7a0b('0x8')],{'host':_0x7a0b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a0b('0x8')]));function closeInteractions(){var _0x263250=0x0;var _0x5bc12f=[];return db[_0x7a0b('0xb')][_0x7a0b('0xc')]({'raw':!![],'attributes':['id',_0x7a0b('0xd')],'where':{'id':0x1}})[_0x7a0b('0xe')](function(_0x342a16){_0x263250=_0x342a16[_0x7a0b('0xd')];if(_0x263250){return db[_0x7a0b('0xf')][_0x7a0b('0x10')]({'raw':!![],'attributes':['id',_0x7a0b('0x11')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7a0b('0x12')](_0x342a16[_0x7a0b('0xd')],_0x7a0b('0x13'))}}});}else{return[];}})['then'](function(_0x229fe3){if(_0x229fe3&&_0x229fe3[_0x7a0b('0x14')]){_0x5bc12f=_[_0x7a0b('0x15')](_0x229fe3||[],'id');logger[_0x7a0b('0x16')](_0x7a0b('0x17'),_0x5bc12f[_0x7a0b('0x18')]());return db[_0x7a0b('0xf')][_0x7a0b('0x19')]({'closeReason':_0x7a0b('0x1a'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7a0b('0x1b')](_0x7a0b('0x1c'))},{'where':{'id':_0x5bc12f}});}})[_0x7a0b('0xe')](function(){if(_0x5bc12f&&_0x5bc12f[_0x7a0b('0x14')]){logger[_0x7a0b('0x16')](_0x7a0b('0x1d'),_0x5bc12f[_0x7a0b('0x18')]());for(var _0x5ab49b=0x0;_0x5ab49b<_0x5bc12f[_0x7a0b('0x14')];_0x5ab49b++){io[_0x7a0b('0x1e')](_0x7a0b('0x1f'),{'id':_0x5bc12f[_0x5ab49b],'closed':!![]});}}})[_0x7a0b('0x20')](function(_0x488f23){logger[_0x7a0b('0x21')](_0x7a0b('0x22'),_0x488f23?util[_0x7a0b('0x23')](_0x488f23,{'showHidden':![],'depth':null}):'');});}exports[_0x7a0b('0x24')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5871=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','start','lodash','moment','ioredis','util','../../mysqldb','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0xaef431,_0x229c5d){var _0x862258=function(_0x154b24){while(--_0x154b24){_0xaef431['push'](_0xaef431['shift']());}};_0x862258(++_0x229c5d);}(_0x5871,0x1f4));var _0x1587=function(_0x319661,_0x1b68f7){_0x319661=_0x319661-0x0;var _0x7c3666=_0x5871[_0x319661];return _0x7c3666;};'use strict';var _=require(_0x1587('0x0'));var moment=require(_0x1587('0x1'));var Redis=require(_0x1587('0x2'));var util=require(_0x1587('0x3'));var config=require('../../config/environment');var db=require(_0x1587('0x4'))['db'];var logger=require('../logger')('schedule');config[_0x1587('0x5')]=_[_0x1587('0x6')](config['redis'],{'host':_0x1587('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1587('0x5')]));function closeInteractions(){var _0x5ae366=0x0;var _0x29fd14=[];return db[_0x1587('0x8')][_0x1587('0x9')]({'raw':!![],'attributes':['id',_0x1587('0xa')],'where':{'id':0x1}})[_0x1587('0xb')](function(_0x1f6ce3){_0x5ae366=_0x1f6ce3['chatTimeout'];if(_0x5ae366){return db[_0x1587('0xc')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1587('0xd')](_0x1f6ce3[_0x1587('0xa')],_0x1587('0xe'))}}});}else{return[];}})[_0x1587('0xb')](function(_0xb2b9b3){if(_0xb2b9b3&&_0xb2b9b3[_0x1587('0xf')]){_0x29fd14=_[_0x1587('0x10')](_0xb2b9b3||[],'id');logger[_0x1587('0x11')](_0x1587('0x12'),_0x29fd14[_0x1587('0x13')]());return db['ChatInteraction'][_0x1587('0x14')]({'closeReason':_0x1587('0x15'),'disposition':_0x1587('0x16'),'closed':!![],'closedAt':moment()[_0x1587('0x17')](_0x1587('0x18'))},{'where':{'id':_0x29fd14}});}})['then'](function(){if(_0x29fd14&&_0x29fd14[_0x1587('0xf')]){logger[_0x1587('0x11')](_0x1587('0x19'),_0x29fd14[_0x1587('0x13')]());for(var _0x498768=0x0;_0x498768<_0x29fd14[_0x1587('0xf')];_0x498768++){io[_0x1587('0x1a')](_0x1587('0x1b'),{'id':_0x29fd14[_0x498768],'closed':!![]});}}})['catch'](function(_0x4281d2){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x4281d2?util['inspect'](_0x4281d2,{'showHidden':![],'depth':null}):'');});}exports[_0x1587('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index b08215b..7065583 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 _0xbd20=['data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','difference','intersection','exists','stop','toRun','length','index','run\x20job','active','isBetween','endAt','add','cron','start','deleteJob','stop\x20cron','startAt','update','update\x20cron','path','lodash','cron-job-manager','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail'];(function(_0x2516c0,_0x54bc6a){var _0x2fadf4=function(_0x39a97d){while(--_0x39a97d){_0x2516c0['push'](_0x2516c0['shift']());}};_0x2fadf4(++_0x54bc6a);}(_0xbd20,0xce));var _0x0bd2=function(_0x5db1a4,_0x14aa78){_0x5db1a4=_0x5db1a4-0x0;var _0x21ac3f=_0xbd20[_0x5db1a4];return _0x21ac3f;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x0bd2('0x0'));var _=require(_0x0bd2('0x1'));var moment=require('moment');var CronJobManager=require(_0x0bd2('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x0bd2('0x3'));var logger=require('../logger')('schedule');var db=require(_0x0bd2('0x4'))['db'];var analyticCustomReportController=require(_0x0bd2('0x5'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x0bd2('0x6')][_0x0bd2('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4159fa,_0x216952){return function(){logger[_0x0bd2('0x8')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4159fa[_0x0bd2('0x9')]);var _0x45c395=!![];var _0x3ac683={'tls':{'rejectUnauthorized':![]}};if(_0x4159fa['MailAccount'][_0x0bd2('0xa')][_0x0bd2('0xb')]){_0x3ac683[_0x0bd2('0xb')]=_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')][_0x0bd2('0xb')];}else{_0x3ac683[_0x0bd2('0xd')]=_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')][_0x0bd2('0xd')];_0x3ac683[_0x0bd2('0xe')]=_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')][_0x0bd2('0xe')];_0x3ac683[_0x0bd2('0xf')]=_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')]['secure'];}if(_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')][_0x0bd2('0x10')]){_0x3ac683[_0x0bd2('0x11')]={'user':_0x4159fa['MailAccount'][_0x0bd2('0xa')][_0x0bd2('0x12')],'pass':_0x4159fa['MailAccount'][_0x0bd2('0xa')][_0x0bd2('0x13')]};}var _0xce68ac={'account':_0x3ac683,'message':{'from':util[_0x0bd2('0x14')](_0x0bd2('0x15'),_0x4159fa['MailAccount']['name'],_0x4159fa['MailAccount']['email']||_0x4159fa[_0x0bd2('0xc')][_0x0bd2('0xa')][_0x0bd2('0x12')]),'to':_0x4159fa[_0x0bd2('0x9')],'cc':_0x4159fa['cc'],'bcc':_0x4159fa[_0x0bd2('0x16')],'subject':util[_0x0bd2('0x14')]('Report\x20%s\x20last\x20%s\x20%s',_0x216952[_0x0bd2('0x17')],_0x4159fa[_0x0bd2('0x18')],_0x4159fa[_0x0bd2('0x19')])}};var _0x3b7026=path[_0x0bd2('0x1a')](__dirname,_0x0bd2('0x1b'));var _0x4dcdef=_0x216952['savename'];var _0x2d43bf=util['format'](_0x0bd2('0x1c'),path[_0x0bd2('0x1d')](_0x216952[_0x0bd2('0x1e')],path[_0x0bd2('0x1f')](_0x216952['savename'])),_0x0bd2('0x20'));var _0x58e5c4=path['join'](_0x3b7026,_0x4dcdef);var _0x1c1a0a=path[_0x0bd2('0x1a')](_0x3b7026,_0x2d43bf);if(fs[_0x0bd2('0x21')](_0x58e5c4)){_0x216952[_0x0bd2('0x22')]=_0x0bd2('0x23');_0xce68ac[_0x0bd2('0x24')]['attachments']=[{'filename':_0x4dcdef,'path':_0x58e5c4}];_0xce68ac['message'][_0x0bd2('0x25')]=util['format'](_0x0bd2('0x26'),JSON[_0x0bd2('0x27')](_0x216952,null,0x2));}else if(fs[_0x0bd2('0x21')](_0x1c1a0a)){_0x216952[_0x0bd2('0x22')]=_0x0bd2('0x23');_0xce68ac[_0x0bd2('0x24')][_0x0bd2('0x28')]=[{'filename':_0x2d43bf,'path':_0x1c1a0a}];}else{_0xce68ac[_0x0bd2('0x24')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4159fa['sendIfEmpty']){_0x45c395=![];logger[_0x0bd2('0x8')](_0x0bd2('0x29'));}}if(_0x45c395){return client[_0x0bd2('0x2a')](_0x0bd2('0x2b'),_0xce68ac)[_0x0bd2('0x2c')](function(_0x706847){if(_0x706847[_0x0bd2('0x2d')]){return logger['error']('error\x20mail',JSON[_0x0bd2('0x27')](_0x706847));}return logger[_0x0bd2('0x8')](_0x0bd2('0x2e'));})[_0x0bd2('0x2f')](function(_0x13dca9){return logger[_0x0bd2('0x2d')](_0x0bd2('0x30'),JSON['stringify'](_0x13dca9));});}};}function handleError(){return function(_0x22def0){return logger[_0x0bd2('0x2d')](JSON[_0x0bd2('0x27')](_0x22def0));};}function handleResult(_0x8e81){return function(_0x51ea81){logger[_0x0bd2('0x8')](_0x0bd2('0x31'),JSON[_0x0bd2('0x27')](_0x51ea81));if(_0x8e81[_0x0bd2('0xc')]&&_0x8e81['MailAccount']['Smtp']&&!_[_0x0bd2('0x32')](_0x8e81[_0x0bd2('0x9')])){setTimeout(handleSendEmail(_0x8e81,_0x51ea81),0x3c*0x3e8);}};}function handleJob(_0x5cc5e3){return function(){try{if(_['isNil'](_0x5cc5e3['subtractNumber'])){return logger[_0x0bd2('0x8')](_0x0bd2('0x33'));}if(_[_0x0bd2('0x32')](_0x5cc5e3[_0x0bd2('0x19')])){return logger[_0x0bd2('0x8')](_0x0bd2('0x34'));}var _0x40b783={'startDate':moment()[_0x0bd2('0x35')](_0x5cc5e3[_0x0bd2('0x18')],_0x5cc5e3[_0x0bd2('0x19')])['format'](_0x0bd2('0x36')),'endDate':moment()[_0x0bd2('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x0bd2('0x37'),'output':_0x5cc5e3['output'],'name':_0x5cc5e3[_0x0bd2('0x17')]};if(!_['isNil'](_0x5cc5e3[_0x0bd2('0x38')])){logger[_0x0bd2('0x8')]('exec\x20defaul\x20report\x20id:%s',_0x5cc5e3[_0x0bd2('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x5cc5e3['DefaultReportId']},_0x40b783)[_0x0bd2('0x2c')](handleResult(_0x5cc5e3))[_0x0bd2('0x2f')](handleError());}if(!_[_0x0bd2('0x32')](_0x5cc5e3[_0x0bd2('0x39')])){logger[_0x0bd2('0x8')]('exec\x20custom\x20report\x20id:%s',_0x5cc5e3[_0x0bd2('0x39')]);return analyticCustomReportController['runReport']({'id':_0x5cc5e3[_0x0bd2('0x39')]},_0x40b783)['then'](handleResult(_0x5cc5e3))[_0x0bd2('0x2f')](handleError());}}catch(_0x29d5dc){logger[_0x0bd2('0x2d')](JSON[_0x0bd2('0x27')](_0x29d5dc));}return logger[_0x0bd2('0x8')](_0x0bd2('0x3a'));};}function getJobs(_0x5c6cab){var _0x359206={};if(_0x5c6cab){_0x359206['id']=_0x5c6cab;}return db[_0x0bd2('0x3b')][_0x0bd2('0x3c')]({'where':_0x359206,'include':[{'model':db[_0x0bd2('0xc')],'attributes':['id',_0x0bd2('0x17'),_0x0bd2('0x9')],'include':[{'model':db[_0x0bd2('0x3d')],'as':_0x0bd2('0xa')}]}]})['then'](function(_0x308894){var _0x110556=_[_0x0bd2('0x3e')](manager[_0x0bd2('0x3f')]);var _0x1bcb6d=_[_0x0bd2('0x40')](_0x308894,function(_0x1b9364){return _0x1b9364['id'][_0x0bd2('0x41')]();});var _0xfb0c62=_['keyBy'](_0x308894,function(_0x41ae22){return _0x41ae22['id'][_0x0bd2('0x41')]();});var _0x37ed37=_0x5c6cab?_0x1bcb6d:_[_0x0bd2('0x42')](_0x1bcb6d,_0x110556);var _0x1f7a9b=_[_0x0bd2('0x43')](_0x1bcb6d,_0x110556);var _0x3d6ed5=_[_0x0bd2('0x42')](_0x110556,_0x1bcb6d);var _0x1b69d2;var _0x103b54;for(_0x1b69d2=0x0;_0x1b69d2<_0x3d6ed5['length']&&!_0x5c6cab;_0x1b69d2+=0x1){_0x103b54=_0x3d6ed5[_0x1b69d2][_0x0bd2('0x41')]();if(manager[_0x0bd2('0x44')](_0x103b54)){manager[_0x0bd2('0x45')](_0x103b54);manager['deleteJob'](_0x103b54);logger[_0x0bd2('0x8')]('delete\x20cron',_0x103b54);}}logger[_0x0bd2('0x8')](_0x0bd2('0x46'),JSON[_0x0bd2('0x27')](_0x37ed37));for(_0x1b69d2=0x0;_0x1b69d2<_0x37ed37[_0x0bd2('0x47')];_0x1b69d2+=0x1){_0x103b54=_0x37ed37[_0x1b69d2][_0x0bd2('0x41')]();logger[_0x0bd2('0x8')](_0x0bd2('0x48'),_0x103b54);if(_0x5c6cab){logger[_0x0bd2('0x8')]('my\x20id',_0x5c6cab);logger[_0x0bd2('0x8')](JSON['stringify'](_0xfb0c62[_0x103b54]));BPromise['resolve']()['then'](handleJob(_0xfb0c62[_0x103b54]));logger[_0x0bd2('0x8')](_0x0bd2('0x49'),_0xfb0c62[_0x103b54][_0x0bd2('0x17')],_0xfb0c62[_0x103b54]['cron']);}else if(_0xfb0c62[_0x103b54]['cron']&&_0xfb0c62[_0x103b54][_0x0bd2('0x4a')]&&moment()[_0x0bd2('0x4b')](_0xfb0c62[_0x103b54]['startAt'],_0xfb0c62[_0x103b54][_0x0bd2('0x4c')])){manager[_0x0bd2('0x4d')](_0x103b54,_0xfb0c62[_0x103b54][_0x0bd2('0x4e')],handleJob(_0xfb0c62[_0x103b54]));manager[_0x0bd2('0x4f')](_0x103b54);logger[_0x0bd2('0x8')]('add\x20cron',_0xfb0c62[_0x103b54][_0x0bd2('0x17')],_0xfb0c62[_0x103b54][_0x0bd2('0x4e')]);}else if(manager['exists'](_0x103b54)){manager[_0x0bd2('0x45')](_0x103b54);manager[_0x0bd2('0x50')](_0x103b54);logger['info'](_0x0bd2('0x51'),_0xfb0c62[_0x103b54]['name'],_0xfb0c62[_0x103b54][_0x0bd2('0x4e')]);}}for(_0x1b69d2=0x0,_0x103b54;_0x1b69d2<_0x1f7a9b[_0x0bd2('0x47')]&&!_0x5c6cab;_0x1b69d2+=0x1){_0x103b54=_0x1f7a9b[_0x1b69d2][_0x0bd2('0x41')]();if(manager[_0x0bd2('0x44')](_0x103b54)){if(_0xfb0c62[_0x103b54]['cron']&&_0xfb0c62[_0x103b54][_0x0bd2('0x4a')]&&moment()[_0x0bd2('0x4b')](_0xfb0c62[_0x103b54][_0x0bd2('0x52')],_0xfb0c62[_0x103b54]['endAt'])){manager[_0x0bd2('0x53')](_0x103b54,_0xfb0c62[_0x103b54][_0x0bd2('0x4e')],handleJob(_0xfb0c62[_0x103b54]));logger['info'](_0x0bd2('0x54'),_0xfb0c62[_0x103b54]['name'],_0xfb0c62[_0x103b54][_0x0bd2('0x4e')]);}else{manager[_0x0bd2('0x45')](_0x103b54);manager['deleteJob'](_0x103b54);logger[_0x0bd2('0x8')](_0x0bd2('0x51'),_0xfb0c62[_0x103b54][_0x0bd2('0x17')],_0xfb0c62[_0x103b54][_0x0bd2('0x4e')]);}}}})[_0x0bd2('0x2f')](function(_0x34d2dd){logger[_0x0bd2('0x2d')](JSON['stringify'](_0x34d2dd));});}exports['run']=function(_0x465b91){return getJobs(_0x465b91);};exports[_0x0bd2('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xbc35=['port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','status','Sent','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','jobs','map','toString','difference','intersection','length','exists','stop','index','my\x20id','cron','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','active','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host'];(function(_0x4a9fb7,_0x4cbfd7){var _0x40b90e=function(_0x59664c){while(--_0x59664c){_0x4a9fb7['push'](_0x4a9fb7['shift']());}};_0x40b90e(++_0x4cbfd7);}(_0xbc35,0x99));var _0x5bc3=function(_0xca70ef,_0x29f15d){_0xca70ef=_0xca70ef-0x0;var _0x3da0e4=_0xbc35[_0xca70ef];return _0x3da0e4;};'use strict';var fs=require('fs');var util=require(_0x5bc3('0x0'));var path=require(_0x5bc3('0x1'));var _=require(_0x5bc3('0x2'));var moment=require(_0x5bc3('0x3'));var CronJobManager=require(_0x5bc3('0x4'));var jayson=require(_0x5bc3('0x5'));var BPromise=require(_0x5bc3('0x6'));var logger=require('../logger')(_0x5bc3('0x7'));var db=require(_0x5bc3('0x8'))['db'];var analyticCustomReportController=require(_0x5bc3('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x5bc3('0xa')][_0x5bc3('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x306bb0,_0x5b3b49){return function(){logger[_0x5bc3('0xc')](_0x5bc3('0xd'),_0x306bb0[_0x5bc3('0xe')]);var _0x127e0e=!![];var _0x5a3c78={'tls':{'rejectUnauthorized':![]}};if(_0x306bb0[_0x5bc3('0xf')][_0x5bc3('0x10')]['service']){_0x5a3c78[_0x5bc3('0x11')]=_0x306bb0[_0x5bc3('0xf')][_0x5bc3('0x10')][_0x5bc3('0x11')];}else{_0x5a3c78[_0x5bc3('0x12')]=_0x306bb0['MailAccount'][_0x5bc3('0x10')][_0x5bc3('0x12')];_0x5a3c78['port']=_0x306bb0[_0x5bc3('0xf')][_0x5bc3('0x10')][_0x5bc3('0x13')];_0x5a3c78[_0x5bc3('0x14')]=_0x306bb0['MailAccount'][_0x5bc3('0x10')]['secure'];}if(_0x306bb0[_0x5bc3('0xf')]['Smtp']['authentication']){_0x5a3c78[_0x5bc3('0x15')]={'user':_0x306bb0[_0x5bc3('0xf')]['Smtp'][_0x5bc3('0x16')],'pass':_0x306bb0[_0x5bc3('0xf')][_0x5bc3('0x10')][_0x5bc3('0x17')]};}var _0x58c9b7={'account':_0x5a3c78,'message':{'from':util[_0x5bc3('0x18')](_0x5bc3('0x19'),_0x306bb0[_0x5bc3('0xf')][_0x5bc3('0x1a')],_0x306bb0['MailAccount'][_0x5bc3('0xe')]||_0x306bb0['MailAccount'][_0x5bc3('0x10')][_0x5bc3('0x16')]),'to':_0x306bb0['email'],'cc':_0x306bb0['cc'],'bcc':_0x306bb0[_0x5bc3('0x1b')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x5b3b49[_0x5bc3('0x1a')],_0x306bb0[_0x5bc3('0x1c')],_0x306bb0[_0x5bc3('0x1d')])}};var _0x2962b3=path[_0x5bc3('0x1e')](__dirname,'../../files/reports');var _0x10daac=_0x5b3b49[_0x5bc3('0x1f')];var _0x19aeaf=util[_0x5bc3('0x18')](_0x5bc3('0x20'),path[_0x5bc3('0x21')](_0x5b3b49[_0x5bc3('0x1f')],path[_0x5bc3('0x22')](_0x5b3b49[_0x5bc3('0x1f')])),'zip');var _0x28af9a=path[_0x5bc3('0x1e')](_0x2962b3,_0x10daac);var _0x3d9fca=path['join'](_0x2962b3,_0x19aeaf);if(fs['existsSync'](_0x28af9a)){_0x5b3b49[_0x5bc3('0x23')]=_0x5bc3('0x24');_0x58c9b7[_0x5bc3('0x25')]['attachments']=[{'filename':_0x10daac,'path':_0x28af9a}];_0x58c9b7[_0x5bc3('0x25')]['text']=util[_0x5bc3('0x18')](_0x5bc3('0x26'),JSON[_0x5bc3('0x27')](_0x5b3b49,null,0x2));}else if(fs[_0x5bc3('0x28')](_0x3d9fca)){_0x5b3b49['status']='Sent';_0x58c9b7[_0x5bc3('0x25')]['attachments']=[{'filename':_0x19aeaf,'path':_0x3d9fca}];}else{_0x58c9b7['message'][_0x5bc3('0x29')]=_0x5bc3('0x2a');if(!_0x306bb0[_0x5bc3('0x2b')]){_0x127e0e=![];logger[_0x5bc3('0xc')](_0x5bc3('0x2c'));}}if(_0x127e0e){return client[_0x5bc3('0x2d')](_0x5bc3('0x2e'),_0x58c9b7)['then'](function(_0x2ddc56){if(_0x2ddc56[_0x5bc3('0x2f')]){return logger['error']('error\x20mail',JSON[_0x5bc3('0x27')](_0x2ddc56));}return logger['info'](_0x5bc3('0x30'));})[_0x5bc3('0x31')](function(_0x46bc62){return logger['error'](_0x5bc3('0x32'),JSON[_0x5bc3('0x27')](_0x46bc62));});}};}function handleError(){return function(_0x252c20){return logger[_0x5bc3('0x2f')](JSON['stringify'](_0x252c20));};}function handleResult(_0x48771e){return function(_0x354106){logger[_0x5bc3('0xc')](_0x5bc3('0x33'),JSON[_0x5bc3('0x27')](_0x354106));if(_0x48771e[_0x5bc3('0xf')]&&_0x48771e[_0x5bc3('0xf')][_0x5bc3('0x10')]&&!_['isNil'](_0x48771e[_0x5bc3('0xe')])){setTimeout(handleSendEmail(_0x48771e,_0x354106),0x3c*0x3e8);}};}function handleJob(_0x4d38a2){return function(){try{if(_[_0x5bc3('0x34')](_0x4d38a2[_0x5bc3('0x1c')])){return logger[_0x5bc3('0xc')](_0x5bc3('0x35'));}if(_[_0x5bc3('0x34')](_0x4d38a2[_0x5bc3('0x1d')])){return logger[_0x5bc3('0xc')]('subtractUnit\x20null\x20or\x20undefined');}var _0x10a0cb={'startDate':moment()['subtract'](_0x4d38a2[_0x5bc3('0x1c')],_0x4d38a2[_0x5bc3('0x1d')])[_0x5bc3('0x18')](_0x5bc3('0x36')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5bc3('0x37'),'output':_0x4d38a2[_0x5bc3('0x38')],'name':_0x4d38a2[_0x5bc3('0x1a')]};if(!_[_0x5bc3('0x34')](_0x4d38a2[_0x5bc3('0x39')])){logger['info'](_0x5bc3('0x3a'),_0x4d38a2['DefaultReportId']);return analyticDefaultReportController[_0x5bc3('0x3b')]({'id':_0x4d38a2[_0x5bc3('0x39')]},_0x10a0cb)[_0x5bc3('0x3c')](handleResult(_0x4d38a2))[_0x5bc3('0x31')](handleError());}if(!_[_0x5bc3('0x34')](_0x4d38a2[_0x5bc3('0x3d')])){logger[_0x5bc3('0xc')](_0x5bc3('0x3e'),_0x4d38a2['CustomReportId']);return analyticCustomReportController[_0x5bc3('0x3b')]({'id':_0x4d38a2[_0x5bc3('0x3d')]},_0x10a0cb)['then'](handleResult(_0x4d38a2))['catch'](handleError());}}catch(_0xedd75e){logger[_0x5bc3('0x2f')](JSON['stringify'](_0xedd75e));}return logger['info'](_0x5bc3('0x3f'));};}function getJobs(_0x54c70d){var _0x2c4450={};if(_0x54c70d){_0x2c4450['id']=_0x54c70d;}return db['Schedule']['findAll']({'where':_0x2c4450,'include':[{'model':db['MailAccount'],'attributes':['id',_0x5bc3('0x1a'),_0x5bc3('0xe')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x5bc3('0x3c')](function(_0x221e7b){var _0x52066d=_['keys'](manager[_0x5bc3('0x40')]);var _0x199f09=_[_0x5bc3('0x41')](_0x221e7b,function(_0x8e4fd5){return _0x8e4fd5['id']['toString']();});var _0x3bd3f8=_['keyBy'](_0x221e7b,function(_0x84d179){return _0x84d179['id'][_0x5bc3('0x42')]();});var _0x53c0ac=_0x54c70d?_0x199f09:_[_0x5bc3('0x43')](_0x199f09,_0x52066d);var _0x54505d=_[_0x5bc3('0x44')](_0x199f09,_0x52066d);var _0x332b98=_[_0x5bc3('0x43')](_0x52066d,_0x199f09);var _0x56af6c;var _0x5d6d80;for(_0x56af6c=0x0;_0x56af6c<_0x332b98[_0x5bc3('0x45')]&&!_0x54c70d;_0x56af6c+=0x1){_0x5d6d80=_0x332b98[_0x56af6c][_0x5bc3('0x42')]();if(manager[_0x5bc3('0x46')](_0x5d6d80)){manager[_0x5bc3('0x47')](_0x5d6d80);manager['deleteJob'](_0x5d6d80);logger[_0x5bc3('0xc')]('delete\x20cron',_0x5d6d80);}}logger[_0x5bc3('0xc')]('toRun',JSON[_0x5bc3('0x27')](_0x53c0ac));for(_0x56af6c=0x0;_0x56af6c<_0x53c0ac['length'];_0x56af6c+=0x1){_0x5d6d80=_0x53c0ac[_0x56af6c]['toString']();logger['info'](_0x5bc3('0x48'),_0x5d6d80);if(_0x54c70d){logger['info'](_0x5bc3('0x49'),_0x54c70d);logger[_0x5bc3('0xc')](JSON[_0x5bc3('0x27')](_0x3bd3f8[_0x5d6d80]));BPromise['resolve']()[_0x5bc3('0x3c')](handleJob(_0x3bd3f8[_0x5d6d80]));logger['info']('run\x20job',_0x3bd3f8[_0x5d6d80][_0x5bc3('0x1a')],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4a')]);}else if(_0x3bd3f8[_0x5d6d80]['cron']&&_0x3bd3f8[_0x5d6d80]['active']&&moment()[_0x5bc3('0x4b')](_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4c')],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4d')])){manager[_0x5bc3('0x4e')](_0x5d6d80,_0x3bd3f8[_0x5d6d80]['cron'],handleJob(_0x3bd3f8[_0x5d6d80]));manager[_0x5bc3('0x4f')](_0x5d6d80);logger['info'](_0x5bc3('0x50'),_0x3bd3f8[_0x5d6d80]['name'],_0x3bd3f8[_0x5d6d80]['cron']);}else if(manager[_0x5bc3('0x46')](_0x5d6d80)){manager[_0x5bc3('0x47')](_0x5d6d80);manager[_0x5bc3('0x51')](_0x5d6d80);logger[_0x5bc3('0xc')](_0x5bc3('0x52'),_0x3bd3f8[_0x5d6d80]['name'],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4a')]);}}for(_0x56af6c=0x0,_0x5d6d80;_0x56af6c<_0x54505d[_0x5bc3('0x45')]&&!_0x54c70d;_0x56af6c+=0x1){_0x5d6d80=_0x54505d[_0x56af6c][_0x5bc3('0x42')]();if(manager[_0x5bc3('0x46')](_0x5d6d80)){if(_0x3bd3f8[_0x5d6d80]['cron']&&_0x3bd3f8[_0x5d6d80][_0x5bc3('0x53')]&&moment()[_0x5bc3('0x4b')](_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4c')],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4d')])){manager[_0x5bc3('0x54')](_0x5d6d80,_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4a')],handleJob(_0x3bd3f8[_0x5d6d80]));logger[_0x5bc3('0xc')]('update\x20cron',_0x3bd3f8[_0x5d6d80][_0x5bc3('0x1a')],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4a')]);}else{manager[_0x5bc3('0x47')](_0x5d6d80);manager[_0x5bc3('0x51')](_0x5d6d80);logger[_0x5bc3('0xc')](_0x5bc3('0x52'),_0x3bd3f8[_0x5d6d80]['name'],_0x3bd3f8[_0x5d6d80][_0x5bc3('0x4a')]);}}}})[_0x5bc3('0x31')](function(_0x5c1baa){logger[_0x5bc3('0x2f')](JSON[_0x5bc3('0x27')](_0x5c1baa));});}exports[_0x5bc3('0x55')]=function(_0x2acc57){return getJobs(_0x2acc57);};exports[_0x5bc3('0x4f')]=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 344121d..43f359d 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 _0x30d3=['inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','catch','start','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','Transcript','TranscriptFileUri','info','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','update','Sentiment','SentimentScore','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Negative','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x30d3,0x9f));var _0x330d=function(_0x3505f0,_0x581feb){_0x3505f0=_0x3505f0-0x0;var _0x58a92d=_0x30d3[_0x3505f0];return _0x58a92d;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x330d('0x0'));var util=require(_0x330d('0x1'));var BPromise=require(_0x330d('0x2'));var db=require(_0x330d('0x3'))['db'];var logger=require(_0x330d('0x4'))(_0x330d('0x5'));function getTranscriptionJob(_0x447dbb,_0x51cee8,_0x37fe02,_0x3b3165){return new Promise(function(_0xd8503,_0x2a330f){var _0x5ee451=new AWS['TranscribeService']({'accessKeyId':_0x51cee8,'secretAccessKey':_0x447dbb,'region':_0x37fe02});_0x5ee451[_0x330d('0x6')]({'TranscriptionJobName':_0x3b3165},function(_0x410a37,_0x1342e7){if(_0x410a37){return _0x2a330f(_0x410a37);}else{return _0xd8503(_0x1342e7);}});});}function sentiment(_0x432840,_0x53bc72,_0x5f137f,_0x22a8ba,_0x151f9a){return new Promise(function(_0x39d171,_0x340980){var _0x2eb0bc=new AWS[(_0x330d('0x7'))]({'accessKeyId':_0x53bc72,'secretAccessKey':_0x432840,'region':_0x5f137f});_0x2eb0bc[_0x330d('0x8')]({'Text':_0x22a8ba,'LanguageCode':_0x151f9a['substring'](0x0,0x2)},function(_0x3b8feb,_0x548353){if(_0x3b8feb){return _0x340980(_0x3b8feb);}else{return _0x39d171(_0x548353);}});});}function checkTranscribeJob(_0x1ad0ee,_0x55eb0e,_0x416b93){var _0xb093cd;return new BPromise(function(_0x3a0f89,_0x20c90f){logger['info'](util[_0x330d('0x9')](_0x330d('0xa'),_0x1ad0ee['id'],_0x1ad0ee['transcribeName']));return getTranscriptionJob(_0x416b93[_0x330d('0xb')],_0x416b93['data2'],_0x55eb0e[_0x330d('0xc')],_0x1ad0ee[_0x330d('0xd')])[_0x330d('0xe')](function(_0x5e5baf){logger['info'](util[_0x330d('0x9')](_0x330d('0xf'),_0x1ad0ee['id'],_0x1ad0ee[_0x330d('0xd')],_0x5e5baf['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x1ad0ee['fileText']){switch(_0x5e5baf[_0x330d('0x10')]['TranscriptionJobStatus']){case'COMPLETED':var _0x435083={'transcribeStatus':_0x5e5baf[_0x330d('0x10')]['TranscriptionJobStatus'],'fileUri':_0x5e5baf[_0x330d('0x10')][_0x330d('0x11')][_0x330d('0x12')]};logger[_0x330d('0x13')](util[_0x330d('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x1ad0ee['id']));return rp({'uri':_0x5e5baf['TranscriptionJob'][_0x330d('0x11')]['TranscriptFileUri'],'json':!![]})[_0x330d('0xe')](function(_0x2e876b){logger[_0x330d('0x13')](util['format'](_0x330d('0x14'),_0x1ad0ee['id']));if(_0x2e876b&&_0x2e876b[_0x330d('0x15')]&&_0x2e876b['results']['transcripts']&&_0x2e876b[_0x330d('0x15')][_0x330d('0x16')]['length']){_0x435083[_0x330d('0x17')]='';for(var _0x19c2f2=0x0;_0x19c2f2<_0x2e876b['results']['transcripts'][_0x330d('0x18')];_0x19c2f2++){_0x435083[_0x330d('0x17')]+=_0x2e876b[_0x330d('0x15')][_0x330d('0x16')][_0x19c2f2][_0x330d('0x19')]+'';}}return _0x1ad0ee['update'](_0x435083);})['then'](function(){logger[_0x330d('0x13')](util[_0x330d('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ad0ee['id']));if(!_0x1ad0ee[_0x330d('0x1a')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x1d'));}if(!_0x55eb0e[_0x330d('0x1e')]||!_0x55eb0e[_0x330d('0x1f')]||!_0x55eb0e['sentimentRegion']||!_0x55eb0e[_0x330d('0x20')]||!_0x55eb0e['bucket']){throw new db['Sequelize'][(_0x330d('0x1c'))](_0x330d('0x21'));}if(!_0x435083[_0x330d('0x17')]){throw new Error(_0x330d('0x22'));}if(_0x55eb0e[_0x330d('0x1f')]===_0x416b93['id']){return _0x416b93;}else{return db[_0x330d('0x23')][_0x330d('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x330d('0xe')](function(_0xe071ff){if(!_0xe071ff){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x25'));}if(!_0xe071ff[_0x330d('0xb')]||!_0xe071ff[_0x330d('0x26')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x27'));}_0xb093cd=_0xe071ff;logger[_0x330d('0x13')](util[_0x330d('0x9')](_0x330d('0x28'),_0x1ad0ee['id']));return sentiment(_0xb093cd['data1'],_0xb093cd['data2'],_0x55eb0e[_0x330d('0x29')],_0x435083[_0x330d('0x17')],_0x55eb0e[_0x330d('0x20')]);})[_0x330d('0xe')](function(_0x456431){logger[_0x330d('0x13')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1ad0ee['id']));return _0x1ad0ee[_0x330d('0x2a')]({'sentiment':_0x456431[_0x330d('0x2b')],'sPositive':_0x456431[_0x330d('0x2c')]['Positive'],'sNegative':_0x456431[_0x330d('0x2c')]['Negative'],'sMixed':_0x456431[_0x330d('0x2c')][_0x330d('0x2d')],'sNeutral':_0x456431[_0x330d('0x2c')][_0x330d('0x2e')]});})[_0x330d('0xe')](function(){logger[_0x330d('0x13')](util[_0x330d('0x9')](_0x330d('0x2f'),_0x1ad0ee['id']));_0x3a0f89();});case _0x330d('0x30'):return _0x1ad0ee[_0x330d('0x2a')]({'transcribeStatus':_0x330d('0x30'),'failureReason':_0x5e5baf[_0x330d('0x10')]['FailureReason']})['then'](function(){logger[_0x330d('0x13')](util[_0x330d('0x9')](_0x330d('0x2f'),_0x1ad0ee['id']));_0x3a0f89();});default:logger[_0x330d('0x13')](util[_0x330d('0x9')](_0x330d('0x31'),_0x1ad0ee['id']));break;}}else{return BPromise[_0x330d('0x32')]()[_0x330d('0xe')](function(){if(!_0x1ad0ee['tempSentiment']){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x55eb0e[_0x330d('0x1e')]||!_0x55eb0e[_0x330d('0x1f')]||!_0x55eb0e[_0x330d('0x29')]||!_0x55eb0e[_0x330d('0x20')]||!_0x55eb0e[_0x330d('0x33')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x21'));}if(!_0x1ad0ee[_0x330d('0x17')]){throw new Error(_0x330d('0x22'));}if(_0x55eb0e[_0x330d('0x1f')]===_0x416b93['id']){return _0x416b93;}else{return db[_0x330d('0x23')][_0x330d('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0xd0af59){if(!_0xd0af59){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x25'));}if(!_0xd0af59[_0x330d('0xb')]||!_0xd0af59[_0x330d('0x26')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x27'));}_0xb093cd=_0xd0af59;logger['info'](util['format'](_0x330d('0x28'),_0x1ad0ee['id']));return sentiment(_0xb093cd[_0x330d('0xb')],_0xb093cd[_0x330d('0x26')],_0x55eb0e[_0x330d('0x29')],_0x1ad0ee[_0x330d('0x17')],_0x55eb0e[_0x330d('0x20')]);})[_0x330d('0xe')](function(_0x5dab16){logger['info'](util[_0x330d('0x9')](_0x330d('0x34'),_0x1ad0ee['id']));return _0x1ad0ee['update']({'sentiment':_0x5dab16[_0x330d('0x2b')],'sPositive':_0x5dab16[_0x330d('0x2c')][_0x330d('0x35')],'sNegative':_0x5dab16[_0x330d('0x2c')][_0x330d('0x36')],'sMixed':_0x5dab16['SentimentScore'][_0x330d('0x2d')],'sNeutral':_0x5dab16[_0x330d('0x2c')][_0x330d('0x2e')],'transcribeStatus':_0x330d('0x37')});})[_0x330d('0xe')](function(){logger['info'](util[_0x330d('0x9')](_0x330d('0x2f'),_0x1ad0ee['id']));_0x3a0f89();});}})['catch'](function(_0x3264d0){if(_0x3264d0){if(!_0x3264d0['name']||_0x3264d0[_0x330d('0x38')]!==_0x330d('0x39')){logger[_0x330d('0x3a')](util[_0x330d('0x9')](_0x330d('0x3b'),_0x1ad0ee['id']),util[_0x330d('0x3c')](_0x3264d0,{'showHidden':![],'depth':null}));}}_0x3a0f89();});});}function checkTranscribe(){var _0xa802b7;var _0x36393b;var _0x460ec4;return db[_0x330d('0x3d')][_0x330d('0x3e')]({'where':{'transcribeStatus':_0x330d('0x3f')}})[_0x330d('0xe')](function(_0xadbd06){if(!_0xadbd06||!_0xadbd06[_0x330d('0x18')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x40'));}_0xa802b7=_0xadbd06;return db[_0x330d('0x41')][_0x330d('0x24')]({'where':{'id':0x1}});})[_0x330d('0xe')](function(_0x46de6d){if(!_0x46de6d){throw new db[(_0x330d('0x1b'))]['ValidationError']('Settings\x20not\x20available');}_0x36393b=_0x46de6d;if(!_0x36393b[_0x330d('0x5')]||!_0x36393b['transcribeAccountId']||!_0x36393b[_0x330d('0xc')]||!_0x36393b[_0x330d('0x20')]||!_0x36393b['bucket']){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x42'));}return db['CloudProvider'][_0x330d('0x24')]({'where':{'id':_0x36393b[_0x330d('0x43')]}});})[_0x330d('0xe')](function(_0x47dc86){if(!_0x47dc86){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x25'));}if(!_0x47dc86[_0x330d('0xb')]||!_0x47dc86[_0x330d('0x26')]){throw new db[(_0x330d('0x1b'))][(_0x330d('0x1c'))](_0x330d('0x27'));}_0x460ec4=_0x47dc86;var _0xc00ee8=[];_0xa802b7[_0x330d('0x44')](function(_0x438d23){_0xc00ee8[_0x330d('0x45')](checkTranscribeJob(_0x438d23,_0x36393b,_0x460ec4));});return BPromise[_0x330d('0x46')](_0xc00ee8);})[_0x330d('0x47')](function(_0x4e1998){if(_0x4e1998){if(!_0x4e1998['name']||_0x4e1998['name']!==_0x330d('0x39')){logger[_0x330d('0x3a')](util[_0x330d('0x3c')](_0x4e1998,{'showHidden':![],'depth':null}));}}});}exports[_0x330d('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xb11e=['data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','format','Transcript','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','language','catch','name','SequelizeValidationError','error','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeRegion','Transcribe\x20not\x20configured','transcribeAccountId','forEach','all','inspect','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','Comprehend','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1'];(function(_0x3bd352,_0x3dfa7f){var _0x3b1dc0=function(_0x10389f){while(--_0x10389f){_0x3bd352['push'](_0x3bd352['shift']());}};_0x3b1dc0(++_0x3dfa7f);}(_0xb11e,0x7d));var _0xeb11=function(_0x349b57,_0x17a6fa){_0x349b57=_0x349b57-0x0;var _0x1599a5=_0xb11e[_0x349b57];return _0x1599a5;};var _=require(_0xeb11('0x0'));var AWS=require(_0xeb11('0x1'));var rp=require(_0xeb11('0x2'));var util=require(_0xeb11('0x3'));var BPromise=require(_0xeb11('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xeb11('0x5'));function getTranscriptionJob(_0x12aded,_0x15f0d8,_0x3f5ff7,_0x59e5db){return new Promise(function(_0x252e4f,_0x5c54d8){var _0x53b7a1=new AWS[(_0xeb11('0x6'))]({'accessKeyId':_0x15f0d8,'secretAccessKey':_0x12aded,'region':_0x3f5ff7});_0x53b7a1['getTranscriptionJob']({'TranscriptionJobName':_0x59e5db},function(_0x5e5648,_0xfa9ff7){if(_0x5e5648){return _0x5c54d8(_0x5e5648);}else{return _0x252e4f(_0xfa9ff7);}});});}function sentiment(_0x216209,_0xb2b1c3,_0x4841d3,_0x35ce4c,_0x2e3052){return new Promise(function(_0x3f3dbd,_0x137756){var _0x45f272=new AWS[(_0xeb11('0x7'))]({'accessKeyId':_0xb2b1c3,'secretAccessKey':_0x216209,'region':_0x4841d3});_0x45f272[_0xeb11('0x8')]({'Text':_0x35ce4c,'LanguageCode':_0x2e3052[_0xeb11('0x9')](0x0,0x2)},function(_0x492308,_0x184373){if(_0x492308){return _0x137756(_0x492308);}else{return _0x3f3dbd(_0x184373);}});});}function checkTranscribeJob(_0x3f020f,_0x15b1e4,_0x517962){var _0x44b192;return new BPromise(function(_0x5d65d5,_0xccaa64){logger['info'](util['format'](_0xeb11('0xa'),_0x3f020f['id'],_0x3f020f[_0xeb11('0xb')]));return getTranscriptionJob(_0x517962[_0xeb11('0xc')],_0x517962[_0xeb11('0xd')],_0x15b1e4['transcribeRegion'],_0x3f020f['transcribeName'])[_0xeb11('0xe')](function(_0xd1a9bf){logger[_0xeb11('0xf')](util['format'](_0xeb11('0x10'),_0x3f020f['id'],_0x3f020f['transcribeName'],_0xd1a9bf[_0xeb11('0x11')][_0xeb11('0x12')]));if(!_0x3f020f[_0xeb11('0x13')]){switch(_0xd1a9bf['TranscriptionJob'][_0xeb11('0x12')]){case _0xeb11('0x14'):var _0x5bbfd8={'transcribeStatus':_0xd1a9bf['TranscriptionJob'][_0xeb11('0x12')],'fileUri':_0xd1a9bf[_0xeb11('0x11')]['Transcript']['TranscriptFileUri']};logger[_0xeb11('0xf')](util[_0xeb11('0x15')]('[RECORDING:%d]\x20Get\x20transcript',_0x3f020f['id']));return rp({'uri':_0xd1a9bf['TranscriptionJob'][_0xeb11('0x16')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x5779df){logger[_0xeb11('0xf')](util[_0xeb11('0x15')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3f020f['id']));if(_0x5779df&&_0x5779df[_0xeb11('0x17')]&&_0x5779df[_0xeb11('0x17')]['transcripts']&&_0x5779df[_0xeb11('0x17')][_0xeb11('0x18')][_0xeb11('0x19')]){_0x5bbfd8['fileText']='';for(var _0x640c79=0x0;_0x640c79<_0x5779df['results']['transcripts'][_0xeb11('0x19')];_0x640c79++){_0x5bbfd8[_0xeb11('0x13')]+=_0x5779df[_0xeb11('0x17')]['transcripts'][_0x640c79]['transcript']+'';}}return _0x3f020f[_0xeb11('0x1a')](_0x5bbfd8);})['then'](function(){logger[_0xeb11('0xf')](util[_0xeb11('0x15')](_0xeb11('0x1b'),_0x3f020f['id']));if(!_0x3f020f[_0xeb11('0x1c')]){throw new db[(_0xeb11('0x1d'))]['ValidationError'](_0xeb11('0x1e'));}if(!_0x15b1e4[_0xeb11('0x1f')]||!_0x15b1e4['sentimentAccountId']||!_0x15b1e4[_0xeb11('0x20')]||!_0x15b1e4['language']||!_0x15b1e4[_0xeb11('0x21')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x23'));}if(!_0x5bbfd8[_0xeb11('0x13')]){throw new Error(_0xeb11('0x24'));}if(_0x15b1e4[_0xeb11('0x25')]===_0x517962['id']){return _0x517962;}else{return db[_0xeb11('0x26')][_0xeb11('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xeb11('0xe')](function(_0x5c3194){if(!_0x5c3194){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x28'));}if(!_0x5c3194['data1']||!_0x5c3194['data2']){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x29'));}_0x44b192=_0x5c3194;logger[_0xeb11('0xf')](util['format'](_0xeb11('0x2a'),_0x3f020f['id']));return sentiment(_0x44b192[_0xeb11('0xc')],_0x44b192[_0xeb11('0xd')],_0x15b1e4['sentimentRegion'],_0x5bbfd8[_0xeb11('0x13')],_0x15b1e4['language']);})[_0xeb11('0xe')](function(_0x59b681){logger[_0xeb11('0xf')](util[_0xeb11('0x15')](_0xeb11('0x2b'),_0x3f020f['id']));return _0x3f020f[_0xeb11('0x1a')]({'sentiment':_0x59b681[_0xeb11('0x2c')],'sPositive':_0x59b681[_0xeb11('0x2d')][_0xeb11('0x2e')],'sNegative':_0x59b681['SentimentScore'][_0xeb11('0x2f')],'sMixed':_0x59b681['SentimentScore'][_0xeb11('0x30')],'sNeutral':_0x59b681['SentimentScore'][_0xeb11('0x31')]});})[_0xeb11('0xe')](function(){logger[_0xeb11('0xf')](util[_0xeb11('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3f020f['id']));_0x5d65d5();});case _0xeb11('0x32'):return _0x3f020f[_0xeb11('0x1a')]({'transcribeStatus':_0xeb11('0x32'),'failureReason':_0xd1a9bf[_0xeb11('0x11')][_0xeb11('0x33')]})[_0xeb11('0xe')](function(){logger[_0xeb11('0xf')](util[_0xeb11('0x15')](_0xeb11('0x1b'),_0x3f020f['id']));_0x5d65d5();});default:logger[_0xeb11('0xf')](util[_0xeb11('0x15')](_0xeb11('0x34'),_0x3f020f['id']));break;}}else{return BPromise[_0xeb11('0x35')]()[_0xeb11('0xe')](function(){if(!_0x3f020f[_0xeb11('0x1c')]){throw new db['Sequelize'][(_0xeb11('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x15b1e4[_0xeb11('0x1f')]||!_0x15b1e4[_0xeb11('0x25')]||!_0x15b1e4['sentimentRegion']||!_0x15b1e4['language']||!_0x15b1e4[_0xeb11('0x21')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x23'));}if(!_0x3f020f['fileText']){throw new Error(_0xeb11('0x24'));}if(_0x15b1e4[_0xeb11('0x25')]===_0x517962['id']){return _0x517962;}else{return db[_0xeb11('0x26')][_0xeb11('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3de35e){if(!_0x3de35e){throw new db['Sequelize'][(_0xeb11('0x22'))](_0xeb11('0x28'));}if(!_0x3de35e[_0xeb11('0xc')]||!_0x3de35e[_0xeb11('0xd')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x44b192=_0x3de35e;logger['info'](util[_0xeb11('0x15')](_0xeb11('0x2a'),_0x3f020f['id']));return sentiment(_0x44b192[_0xeb11('0xc')],_0x44b192['data2'],_0x15b1e4[_0xeb11('0x20')],_0x3f020f[_0xeb11('0x13')],_0x15b1e4[_0xeb11('0x36')]);})[_0xeb11('0xe')](function(_0x30e891){logger['info'](util['format'](_0xeb11('0x2b'),_0x3f020f['id']));return _0x3f020f['update']({'sentiment':_0x30e891[_0xeb11('0x2c')],'sPositive':_0x30e891[_0xeb11('0x2d')][_0xeb11('0x2e')],'sNegative':_0x30e891[_0xeb11('0x2d')][_0xeb11('0x2f')],'sMixed':_0x30e891[_0xeb11('0x2d')]['Mixed'],'sNeutral':_0x30e891[_0xeb11('0x2d')][_0xeb11('0x31')],'transcribeStatus':_0xeb11('0x14')});})[_0xeb11('0xe')](function(){logger[_0xeb11('0xf')](util['format'](_0xeb11('0x1b'),_0x3f020f['id']));_0x5d65d5();});}})[_0xeb11('0x37')](function(_0x54af0b){if(_0x54af0b){if(!_0x54af0b[_0xeb11('0x38')]||_0x54af0b[_0xeb11('0x38')]!==_0xeb11('0x39')){logger[_0xeb11('0x3a')](util[_0xeb11('0x15')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3f020f['id']),util['inspect'](_0x54af0b,{'showHidden':![],'depth':null}));}}_0x5d65d5();});});}function checkTranscribe(){var _0x1714ac;var _0x4893cd;var _0x355251;return db[_0xeb11('0x3b')][_0xeb11('0x3c')]({'where':{'transcribeStatus':_0xeb11('0x3d')}})['then'](function(_0x165b6e){if(!_0x165b6e||!_0x165b6e[_0xeb11('0x19')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x3e'));}_0x1714ac=_0x165b6e;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x315f87){if(!_0x315f87){throw new db[(_0xeb11('0x1d'))]['ValidationError']('Settings\x20not\x20available');}_0x4893cd=_0x315f87;if(!_0x4893cd[_0xeb11('0x5')]||!_0x4893cd['transcribeAccountId']||!_0x4893cd[_0xeb11('0x3f')]||!_0x4893cd[_0xeb11('0x36')]||!_0x4893cd[_0xeb11('0x21')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x40'));}return db[_0xeb11('0x26')][_0xeb11('0x27')]({'where':{'id':_0x4893cd[_0xeb11('0x41')]}});})[_0xeb11('0xe')](function(_0x3a4543){if(!_0x3a4543){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))](_0xeb11('0x28'));}if(!_0x3a4543[_0xeb11('0xc')]||!_0x3a4543[_0xeb11('0xd')]){throw new db[(_0xeb11('0x1d'))][(_0xeb11('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x355251=_0x3a4543;var _0x2da9cd=[];_0x1714ac[_0xeb11('0x42')](function(_0x23de67){_0x2da9cd['push'](checkTranscribeJob(_0x23de67,_0x4893cd,_0x355251));});return BPromise[_0xeb11('0x43')](_0x2da9cd);})[_0xeb11('0x37')](function(_0x17bd47){if(_0x17bd47){if(!_0x17bd47[_0xeb11('0x38')]||_0x17bd47['name']!==_0xeb11('0x39')){logger[_0xeb11('0x3a')](util[_0xeb11('0x44')](_0x17bd47,{'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 5ca40dd..ae234f4 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 _0xe108=['update','system','timeout','format','length','join','emit','whatsappInteraction:update','catch','error','start','moment','util','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','then','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0xe108,0x6b));var _0x8e10=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0xe108[_0x39d39d];return _0x577ac3;};'use strict';var _=require('lodash');var moment=require(_0x8e10('0x0'));var Redis=require('ioredis');var util=require(_0x8e10('0x1'));var config=require('../../config/environment');var db=require(_0x8e10('0x2'))['db'];var logger=require(_0x8e10('0x3'))(_0x8e10('0x4'));config['redis']=_[_0x8e10('0x5')](config[_0x8e10('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x8e10('0x7'))(new Redis(config[_0x8e10('0x6')]));function closeInteractions(){var _0x214416=[];return db[_0x8e10('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x8e10('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8e10('0xa')](0x18,'hours')}}})[_0x8e10('0xb')](function(_0x205779){if(_0x205779&&_0x205779['length']){_0x214416=_['map'](_0x205779||[],'id');logger['info'](_0x8e10('0xc'),_0x214416['join']());return db[_0x8e10('0x8')][_0x8e10('0xd')]({'closeReason':_0x8e10('0xe'),'disposition':_0x8e10('0xf'),'closed':!![],'closedAt':moment()[_0x8e10('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x214416}});}})[_0x8e10('0xb')](function(){if(_0x214416&&_0x214416[_0x8e10('0x11')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x214416[_0x8e10('0x12')]());for(var _0x57957d=0x0;_0x57957d<_0x214416['length'];_0x57957d++){io[_0x8e10('0x13')](_0x8e10('0x14'),{'id':_0x214416[_0x57957d],'closed':!![]});}}})[_0x8e10('0x15')](function(_0x197077){logger[_0x8e10('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x197077?util['inspect'](_0x197077,{'showHidden':![],'depth':null}):'');});}exports[_0x8e10('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1f88=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','findAll','lastMsgAt','subtract','then','length','map','info'];(function(_0x309cef,_0x48bcff){var _0x51f71d=function(_0x224597){while(--_0x224597){_0x309cef['push'](_0x309cef['shift']());}};_0x51f71d(++_0x48bcff);}(_0x1f88,0x1a2));var _0x81f8=function(_0x3b6780,_0xa8fbe4){_0x3b6780=_0x3b6780-0x0;var _0x4fe37b=_0x1f88[_0x3b6780];return _0x4fe37b;};'use strict';var _=require(_0x81f8('0x0'));var moment=require(_0x81f8('0x1'));var Redis=require('ioredis');var util=require(_0x81f8('0x2'));var config=require(_0x81f8('0x3'));var db=require(_0x81f8('0x4'))['db'];var logger=require(_0x81f8('0x5'))(_0x81f8('0x6'));config[_0x81f8('0x7')]=_[_0x81f8('0x8')](config[_0x81f8('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0xb61a1c=[];return db['WhatsappInteraction'][_0x81f8('0x9')]({'raw':!![],'attributes':['id',_0x81f8('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x81f8('0xb')](0x18,'hours')}}})[_0x81f8('0xc')](function(_0x5ef820){if(_0x5ef820&&_0x5ef820[_0x81f8('0xd')]){_0xb61a1c=_[_0x81f8('0xe')](_0x5ef820||[],'id');logger[_0x81f8('0xf')](_0x81f8('0x10'),_0xb61a1c[_0x81f8('0x11')]());return db[_0x81f8('0x12')][_0x81f8('0x13')]({'closeReason':_0x81f8('0x14'),'disposition':_0x81f8('0x15'),'closed':!![],'closedAt':moment()[_0x81f8('0x16')](_0x81f8('0x17'))},{'where':{'id':_0xb61a1c}});}})[_0x81f8('0xc')](function(){if(_0xb61a1c&&_0xb61a1c[_0x81f8('0xd')]){logger[_0x81f8('0xf')](_0x81f8('0x18'),_0xb61a1c[_0x81f8('0x11')]());for(var _0x4acf73=0x0;_0x4acf73<_0xb61a1c['length'];_0x4acf73++){io[_0x81f8('0x19')](_0x81f8('0x1a'),{'id':_0xb61a1c[_0x4acf73],'closed':!![]});}}})['catch'](function(_0x86be90){logger[_0x81f8('0x1b')](_0x81f8('0x1c'),_0x86be90?util[_0x81f8('0x1d')](_0x86be90,{'showHidden':![],'depth':null}):'');});}exports[_0x81f8('0x1e')]=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 a15a61f..9e7e166 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1ad=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1'];(function(_0x444812,_0x1d7924){var _0x4f9f24=function(_0x3a720c){while(--_0x3a720c){_0x444812['push'](_0x444812['shift']());}};_0x4f9f24(++_0x1d7924);}(_0xd1ad,0xb7));var _0xdd1a=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xd1ad[_0x2eac4f];return _0x58f73b;};'use strict';var util=require(_0xdd1a('0x0'));var db=require(_0xdd1a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xdd1a('0x2')]({'id':i,'firstName':_0xdd1a('0x3')+i,'lastName':_0xdd1a('0x4')+i,'phone':0xf879fb460+i,'email':_0xdd1a('0x5')+i+_0xdd1a('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xdd1a('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xdd1a('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xdd1a('0x2')]({'id':i,'firstName':_0xdd1a('0x3')+i,'lastName':_0xdd1a('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xdd1a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xdd1a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xdd1a('0x7')]()});}db[_0xdd1a('0x8')][_0xdd1a('0x9')]({'where':{}})[_0xdd1a('0xa')](function(){return db[_0xdd1a('0x8')][_0xdd1a('0xb')](contacts);})['then'](function(){console['log'](_0xdd1a('0xc'),_0xdd1a('0xd'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db[_0xdd1a('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0xdd1a('0xf')](_0xdd1a('0xc'),_0xdd1a('0x10'));return db[_0xdd1a('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0xdd1a('0xf')](_0xdd1a('0xc'),_0xdd1a('0x11'));return db[_0xdd1a('0xe')][_0xdd1a('0xb')](hopper2);})[_0xdd1a('0xa')](function(){console[_0xdd1a('0xf')](_0xdd1a('0xc'),_0xdd1a('0x12'));})[_0xdd1a('0x13')](function(_0x3301f9){console['log'](_0x3301f9);}); \ No newline at end of file +var _0x6b60=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','util','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6b60,0x181));var _0x06b6=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x6b60[_0x1e3671];return _0x48d5f5;};'use strict';var util=require(_0x06b6('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x06b6('0x1')]({'id':i,'firstName':_0x06b6('0x2')+i,'lastName':_0x06b6('0x3')+i,'phone':0xf879fb460+i,'email':_0x06b6('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x06b6('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x06b6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x06b6('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x06b6('0x1')]({'id':i,'firstName':_0x06b6('0x2')+i,'lastName':_0x06b6('0x3')+i,'phone':0xf879fb460+i,'email':_0x06b6('0x4')+i+_0x06b6('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x06b6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x06b6('0x5')]()});}db[_0x06b6('0x7')][_0x06b6('0x8')]({'where':{}})[_0x06b6('0x9')](function(){return db[_0x06b6('0x7')][_0x06b6('0xa')](contacts);})[_0x06b6('0x9')](function(){console[_0x06b6('0xb')](_0x06b6('0xc'),_0x06b6('0xd'));return db[_0x06b6('0xe')][_0x06b6('0x8')]({'where':{}});})['then'](function(){return db[_0x06b6('0xe')][_0x06b6('0xa')](hopper);})[_0x06b6('0x9')](function(){console[_0x06b6('0xb')](_0x06b6('0xc'),_0x06b6('0xf'));return db['CmContact'][_0x06b6('0xa')](contacts2);})[_0x06b6('0x9')](function(){console[_0x06b6('0xb')](_0x06b6('0xc'),_0x06b6('0x10'));return db[_0x06b6('0xe')]['bulkCreate'](hopper2);})[_0x06b6('0x9')](function(){console[_0x06b6('0xb')]('finished\x20populating',_0x06b6('0x11'));})['catch'](function(_0x47fa4f){console[_0x06b6('0xb')](_0x47fa4f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b74baa8..68c3526 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x110f=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push','agent','format','password','friend','wss','all','%s%s','yes','/etc/pki/tls/private/motion.key'];(function(_0x468943,_0x9529ad){var _0x4aaf7f=function(_0x294192){while(--_0x294192){_0x468943['push'](_0x468943['shift']());}};_0x4aaf7f(++_0x9529ad);}(_0x110f,0x15d));var _0xf110=function(_0x4e73c2,_0x54c707){_0x4e73c2=_0x4e73c2-0x0;var _0xee0c7a=_0x110f[_0x4e73c2];return _0xee0c7a;};'use strict';var util=require(_0xf110('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf110('0x1')]({'name':util['format']('%s%s',_0xf110('0x2'),i),'fullname':util[_0xf110('0x3')]('%s%s',_0xf110('0x2'),i),'email':util[_0xf110('0x3')]('%s%s@xcally.com',_0xf110('0x2'),i),'role':_0xf110('0x2'),'password':_0xf110('0x4'),'internal':0xfa0+i,'type':_0xf110('0x5'),'transport':['udp','ws',_0xf110('0x6')],'disallow':[_0xf110('0x7')],'allow':['ulaw'],'defaultuser':util[_0xf110('0x3')](_0xf110('0x8'),_0xf110('0x2'),i),'encryption':_0xf110('0x9'),'avpf':_0xf110('0x9'),'force_avp':_0xf110('0x9'),'icesupport':_0xf110('0x9'),'dtlsenable':_0xf110('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xf110('0xa'),'dtlssetup':'actpass','callerid':util['format'](_0xf110('0xb'),util[_0xf110('0x3')](_0xf110('0x8'),_0xf110('0x2'),i),0xfa0+i)});}db[_0xf110('0xc')][_0xf110('0xd')](users)[_0xf110('0xe')](function(){console[_0xf110('0xf')](_0xf110('0x10'));})[_0xf110('0x11')](function(_0x340f7e){console[_0xf110('0xf')](_0x340f7e);}); \ No newline at end of file +var _0xbc48=['log','../mysqldb','push','agent','format','%s%s','%s%s@xcally.com','password','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch'];(function(_0x4ac212,_0x3391ad){var _0x27e24f=function(_0x57f3e2){while(--_0x57f3e2){_0x4ac212['push'](_0x4ac212['shift']());}};_0x27e24f(++_0x3391ad);}(_0xbc48,0x1dc));var _0x8bc4=function(_0x1af046,_0x218baa){_0x1af046=_0x1af046-0x0;var _0x479abf=_0xbc48[_0x1af046];return _0x479abf;};'use strict';var util=require('util');var db=require(_0x8bc4('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8bc4('0x1')]({'name':util['format']('%s%s',_0x8bc4('0x2'),i),'fullname':util[_0x8bc4('0x3')](_0x8bc4('0x4'),_0x8bc4('0x2'),i),'email':util[_0x8bc4('0x3')](_0x8bc4('0x5'),_0x8bc4('0x2'),i),'role':'agent','password':_0x8bc4('0x6'),'internal':0xfa0+i,'type':_0x8bc4('0x7'),'transport':[_0x8bc4('0x8'),'ws','wss'],'disallow':[_0x8bc4('0x9')],'allow':['ulaw'],'defaultuser':util[_0x8bc4('0x3')](_0x8bc4('0x4'),'agent',i),'encryption':_0x8bc4('0xa'),'avpf':_0x8bc4('0xa'),'force_avp':_0x8bc4('0xa'),'icesupport':_0x8bc4('0xa'),'dtlsenable':_0x8bc4('0xa'),'dtlsverify':'no','dtlscertfile':_0x8bc4('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x8bc4('0xc'),'callerid':util[_0x8bc4('0x3')](_0x8bc4('0xd'),util[_0x8bc4('0x3')](_0x8bc4('0x4'),'agent',i),0xfa0+i)});}db[_0x8bc4('0xe')]['bulkCreate'](users)[_0x8bc4('0xf')](function(){console['log'](_0x8bc4('0x10'));})[_0x8bc4('0x11')](function(_0x5d8033){console[_0x8bc4('0x12')](_0x5d8033);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6981689..b750a70 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde3a=['fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','default','setMaxListeners','address','request','connection','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','where','Campaign','format','length','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','userProfileId','ChatQueues','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice'];(function(_0x2d81de,_0x2ed903){var _0xe91fc1=function(_0x4ae7d0){while(--_0x4ae7d0){_0x2d81de['push'](_0x2d81de['shift']());}};_0xe91fc1(++_0x2ed903);}(_0xde3a,0x140));var _0xade3=function(_0x22c21b,_0x14e93f){_0x22c21b=_0x22c21b-0x0;var _0x24bdc=_0xde3a[_0x22c21b];return _0x24bdc;};'use strict';var _=require(_0xade3('0x0'));var util=require(_0xade3('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xade3('0x2')],'include':[{'as':_0xade3('0x3'),'model':db[_0xade3('0x4')],'attributes':['id',_0xade3('0x2'),_0xade3('0x5')],'raw':!![],'where':{'role':_0xade3('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xade3('0x2')],'where':{'role':_0xade3('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xade3('0x2')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xade3('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xade3('0x2'),_0xade3('0x8')],'where':{'type':_0xade3('0x9')}};function getAssociatedResources(_0x11f798,_0x145618,_0xc08245){return db['UserProfileSection'][_0xade3('0xa')]({'where':{'name':_0x11f798,'userProfileId':_0x145618},'raw':!![]})[_0xade3('0xb')](function(_0x4b2a40){if(_0x4b2a40){if(_0x4b2a40[_0xade3('0xc')]){switch(_0x11f798){case _0xade3('0xd'):case'ChatQueues':case _0xade3('0xe'):case _0xade3('0xf'):case _0xade3('0x10'):case _0xade3('0x11'):case _0xade3('0x12'):return db[_0xc08245][_0xade3('0x13')](queryQueues);case _0xade3('0x14'):return db[_0xc08245][_0xade3('0x13')](queryTelephones);case'Trunks':return db[_0xc08245][_0xade3('0x13')](queryTrunks);case'IvrCampaigns':return db[_0xc08245][_0xade3('0x13')](queryCampaigns);}}else{return db[_0xade3('0x15')][_0xade3('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x4b2a40['id']},'raw':!![]})['then'](function(_0x1afb49){if(_0x1afb49){var _0x18ce55={'where':{'id':_['map'](_0x1afb49,_0xade3('0x16'))},'raw':!![]};switch(_0xc08245){case'User':_0x18ce55[_0xade3('0x17')][_0xade3('0x5')]='telephone';break;case _0xade3('0x18'):_0x18ce55[_0xade3('0x17')]['type']=_0xade3('0x9');break;}return db[_0xc08245]['findAll'](_0x18ce55);}else{return[];}});}}else{return[];}})['then'](function(_0x9caa18){return _0x9caa18;});}function joinOrLeaveQueues(_0x1d902b,_0x2e6791,_0x179b11,_0x2a4a7c){_0x1d902b[_0x2e6791](util[_0xade3('0x19')]('%s:queue:%s',_0x179b11,_0x2a4a7c[_0xade3('0x2')]));if(_0x2a4a7c[_0xade3('0x3')]){for(var _0x11222d=0x0;_0x11222d<_0x2a4a7c[_0xade3('0x3')][_0xade3('0x1a')];_0x11222d+=0x1){_0x1d902b[_0x2e6791](util[_0xade3('0x19')]('user:%s',_0x2a4a7c[_0xade3('0x3')][_0x11222d][_0xade3('0x2')]));}}}function joinOrLeave(_0xe4109b,_0x320860,_0x421cd2){var _0xb319ea;if(_0xe4109b[_0xade3('0x1b')][_0xade3('0x1c')]['id']){db[_0xade3('0x4')]['find']({'attributes':['id','name',_0xade3('0x5'),'userProfileId'],'where':{'id':_0xe4109b['handshake'][_0xade3('0x1c')]['id']},'include':[{'model':db[_0xade3('0x1d')],'as':_0xade3('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0xade3('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade3('0x20')],'as':_0xade3('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xade3('0x22')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xade3('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xade3('0x24')],'as':_0xade3('0x25'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x22a949){if(_0x22a949){_0xb319ea=_0x22a949;_0xe4109b[_0x320860](util[_0xade3('0x19')](_0xade3('0x26'),_0x22a949[_0xade3('0x2')]));var _0x5aa007=[];switch(_0x22a949[_0xade3('0x5')]){case _0xade3('0x27'):_0xe4109b[_0x320860]('voice:inbound');_0xe4109b[_0x320860](_0xade3('0x28'));if(queryQueues[_0xade3('0x29')]('include')){delete queryQueues[_0xade3('0x2a')];}_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x2c')][_0xade3('0x13')](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x2d')]['findAll'](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x2e')]['findAll'](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x2f')][_0xade3('0x13')](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x30')][_0xade3('0x13')](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x31')]['findAll'](queryQueues));_0x5aa007[_0xade3('0x2b')](db[_0xade3('0x32')][_0xade3('0x13')](queryQueues));_0x5aa007[_0xade3('0x2b')](db['User'][_0xade3('0x13')](queryTelephones));_0x5aa007[_0xade3('0x2b')](db['Trunk'][_0xade3('0x13')](queryTrunks));_0x5aa007[_0xade3('0x2b')](db['Campaign'][_0xade3('0x13')](queryCampaigns));_0x5aa007['push'](db['User'][_0xade3('0x13')](queryAgents));break;case _0xade3('0x33'):_0xe4109b[_0x320860](_0xade3('0x34'));_0xe4109b[_0x320860](_0xade3('0x28'));_0x5aa007[_0xade3('0x2b')](getAssociatedResources('VoiceQueues',_0x22a949[_0xade3('0x35')],_0xade3('0x2c')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0x36'),_0x22a949['userProfileId'],'ChatQueue'));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0xe'),_0x22a949['userProfileId'],_0xade3('0x2e')));_0x5aa007['push'](getAssociatedResources('SmsQueues',_0x22a949[_0xade3('0x35')],'SmsQueue'));_0x5aa007['push'](getAssociatedResources(_0xade3('0x10'),_0x22a949[_0xade3('0x35')],_0xade3('0x30')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0x11'),_0x22a949['userProfileId'],_0xade3('0x31')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0x12'),_0x22a949[_0xade3('0x35')],_0xade3('0x32')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0x14'),_0x22a949[_0xade3('0x35')],_0xade3('0x4')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources('Trunks',_0x22a949['userProfileId'],_0xade3('0x37')));_0x5aa007[_0xade3('0x2b')](getAssociatedResources(_0xade3('0x38'),_0x22a949[_0xade3('0x35')],'Campaign'));_0x5aa007[_0xade3('0x2b')](db['User'][_0xade3('0x13')](queryAgents));break;case _0xade3('0x6'):_0xe4109b[_0x320860](_0xade3('0x34'));_0xe4109b[_0x320860](_0xade3('0x28'));_0x5aa007[_0xade3('0x2b')](_0x22a949[_0xade3('0x39')]({'attributes':['id',_0xade3('0x2')]}));_0x5aa007['push'](_0x22a949[_0xade3('0x3a')]({'attributes':['id',_0xade3('0x2')]}));_0x5aa007['push'](_0x22a949['getFaxQueues']({'attributes':['id',_0xade3('0x2')]}));_0x5aa007[_0xade3('0x2b')](_0x22a949[_0xade3('0x3b')]({'attributes':['id','name']}));_0x5aa007[_0xade3('0x2b')](_0x22a949[_0xade3('0x3c')]({'attributes':['id',_0xade3('0x2')]}));_0x5aa007[_0xade3('0x2b')](_0x22a949['getOpenchannelQueues']({'attributes':['id',_0xade3('0x2')]}));_0x5aa007['push'](_0x22a949[_0xade3('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0xade3('0x3e')](_0x5aa007);}})[_0xade3('0xb')](function(_0x29fe61){if(_0x29fe61&&_0x29fe61['length']){for(var _0x3650c5=0x0;_0x3650c5<_0x29fe61['length'];_0x3650c5+=0x1){for(var _0x39fafb=0x0;_0x39fafb<_0x29fe61[_0x3650c5][_0xade3('0x1a')];_0x39fafb+=0x1){switch(_0x3650c5){case 0x0:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x3f'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x1:joinOrLeaveQueues(_0xe4109b,_0x320860,'chat',_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x2:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x40'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x3:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x41'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x4:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x42'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x5:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x43'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x6:joinOrLeaveQueues(_0xe4109b,_0x320860,_0xade3('0x44'),_0x29fe61[_0x3650c5][_0x39fafb]);break;case 0x7:if(_0xb319ea[_0xade3('0x5')]!==_0xade3('0x6'))_0xe4109b[_0x320860](util[_0xade3('0x19')](_0xade3('0x45'),_0x29fe61[_0x3650c5][_0x39fafb][_0xade3('0x2')]));break;case 0x8:if(_0xb319ea['role']!==_0xade3('0x6'))_0xe4109b[_0x320860](util[_0xade3('0x19')]('trunk:%s',_0x29fe61[_0x3650c5][_0x39fafb][_0xade3('0x2')]));break;case 0x9:if(_0xb319ea[_0xade3('0x5')]!=='agent')_0xe4109b[_0x320860](util[_0xade3('0x19')](_0xade3('0x46'),_0x29fe61[_0x3650c5][_0x39fafb][_0xade3('0x8')],_0x29fe61[_0x3650c5][_0x39fafb][_0xade3('0x2')]));break;case 0xa:_0xe4109b[_0x320860](util[_0xade3('0x19')](_0xade3('0x26'),_0x29fe61[_0x3650c5][_0x39fafb]['name']));break;}}}}})[_0xade3('0xb')](function(){if(_0x320860===_0xade3('0x47')){var _0x568663=_[_0xade3('0x48')](_0xb319ea['ChatInteractions'],'id');return _0xb319ea[_0xade3('0x49')](_0x568663)[_0xade3('0xb')](function(){for(var _0x152525=0x0;_0x152525<_0x568663[_0xade3('0x1a')];_0x152525+=0x1){_0x421cd2[_0xade3('0x4a')](_0xade3('0x4b'),{'ChatInteractionId':Number(_0x568663[_0x152525]),'UserId':Number(_0xb319ea['id'])});}});}})['then'](function(){if(_0x320860===_0xade3('0x47')){var _0x156260=_[_0xade3('0x48')](_0xb319ea[_0xade3('0x4c')],'id');return _0xb319ea['removeMailInteractions'](_0x156260)[_0xade3('0xb')](function(){for(var _0x4cb692=0x0;_0x4cb692<_0x156260['length'];_0x4cb692+=0x1){_0x421cd2[_0xade3('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x156260[_0x4cb692]),'UserId':Number(_0xb319ea['id'])});}});}})[_0xade3('0xb')](function(){if(_0x320860===_0xade3('0x47')){var _0x52d11b=_[_0xade3('0x48')](_0xb319ea['FaxInteractions'],'id');return _0xb319ea['removeFaxInteractions'](_0x52d11b)[_0xade3('0xb')](function(){for(var _0x20018e=0x0;_0x20018e<_0x52d11b[_0xade3('0x1a')];_0x20018e+=0x1){_0x421cd2[_0xade3('0x4a')](_0xade3('0x4d'),{'FaxInteractionId':Number(_0x52d11b[_0x20018e]),'UserId':Number(_0xb319ea['id'])});}});}})[_0xade3('0xb')](function(){if(_0x320860===_0xade3('0x47')){var _0x25fd9f=_[_0xade3('0x48')](_0xb319ea['SmsInteractions'],'id');return _0xb319ea[_0xade3('0x4e')](_0x25fd9f)[_0xade3('0xb')](function(){for(var _0x49e17f=0x0;_0x49e17f<_0x25fd9f[_0xade3('0x1a')];_0x49e17f+=0x1){_0x421cd2[_0xade3('0x4a')](_0xade3('0x4f'),{'SmsInteractionId':Number(_0x25fd9f[_0x49e17f]),'UserId':Number(_0xb319ea['id'])});}});}})['then'](function(){if(_0x320860===_0xade3('0x47')){var _0x5de0f8=_[_0xade3('0x48')](_0xb319ea[_0xade3('0x23')],'id');return _0xb319ea[_0xade3('0x50')](_0x5de0f8)[_0xade3('0xb')](function(){for(var _0x91b281=0x0;_0x91b281<_0x5de0f8['length'];_0x91b281+=0x1){_0x421cd2[_0xade3('0x4a')](_0xade3('0x51'),{'OpenchannelInteractionId':Number(_0x5de0f8[_0x91b281]),'UserId':Number(_0xb319ea['id'])});}});}})['then'](function(){if(_0x320860===_0xade3('0x47')){var _0xa19ea=_['map'](_0xb319ea[_0xade3('0x25')],'id');return _0xb319ea['removeWhatsappInteractions'](_0xa19ea)[_0xade3('0xb')](function(){for(var _0x7147ec=0x0;_0x7147ec<_0xa19ea[_0xade3('0x1a')];_0x7147ec+=0x1){_0x421cd2[_0xade3('0x4a')](_0xade3('0x52'),{'WhatsappInteractionId':Number(_0xa19ea[_0x7147ec]),'UserId':Number(_0xb319ea['id'])});}});}})[_0xade3('0x53')](function(_0x33151f){_0xe4109b['log'](_0x33151f);});}}function onDisconnect(_0x118859,_0x2b8bf5){joinOrLeave(_0x118859,'leave',_0x2b8bf5);}function onConnect(_0x15597f){joinOrLeave(_0x15597f,'join');}exports[_0xade3('0x54')]=function(_0xd655f0){_0xd655f0['on']('connection',function(_0x47e921){_0x47e921[_0xade3('0x55')](0x0);_0x47e921[_0xade3('0x56')]=_0x47e921[_0xade3('0x57')][_0xade3('0x58')]['remoteAddress']+':'+_0x47e921['request'][_0xade3('0x58')]['remotePort'];_0x47e921[_0xade3('0x59')]=new Date();_0x47e921['log']=function(_0x5b0c1){console[_0xade3('0x5a')](_0xade3('0x5b')+_0x47e921[_0xade3('0x5c')]['name']+'['+_0x47e921[_0xade3('0x56')]+']',_0x5b0c1);};_0x47e921['on'](_0xade3('0x5d'),function(){onDisconnect(_0x47e921,_0xd655f0);_0x47e921[_0xade3('0x5a')](_0xade3('0x5e'));});onConnect(_0x47e921);_0x47e921['log'](_0xade3('0x5f'));});}; \ No newline at end of file +var _0x5226=['DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','format','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect'];(function(_0xd5697c,_0x232457){var _0x162ee2=function(_0x2007b8){while(--_0x2007b8){_0xd5697c['push'](_0xd5697c['shift']());}};_0x162ee2(++_0x232457);}(_0x5226,0x137));var _0x6522=function(_0x1149b2,_0x33eebc){_0x1149b2=_0x1149b2-0x0;var _0x2b7ec0=_0x5226[_0x1149b2];return _0x2b7ec0;};'use strict';var _=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var BPromise=require(_0x6522('0x2'));var db=require(_0x6522('0x3'))['db'];var config=require(_0x6522('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x6522('0x5'),'model':db[_0x6522('0x6')],'attributes':['id',_0x6522('0x7'),'role'],'raw':!![],'where':{'role':_0x6522('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x6522('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x6522('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x6522('0x7')],'where':{'role':_0x6522('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6522('0x7'),_0x6522('0xa')],'where':{'type':_0x6522('0xb')}};function getAssociatedResources(_0x5907be,_0x54312b,_0x2ff0e0){return db[_0x6522('0xc')][_0x6522('0xd')]({'where':{'name':_0x5907be,'userProfileId':_0x54312b},'raw':!![]})[_0x6522('0xe')](function(_0x417604){if(_0x417604){if(_0x417604[_0x6522('0xf')]){switch(_0x5907be){case _0x6522('0x10'):case _0x6522('0x11'):case _0x6522('0x12'):case _0x6522('0x13'):case _0x6522('0x14'):case _0x6522('0x15'):case _0x6522('0x16'):return db[_0x2ff0e0]['findAll'](queryQueues);case _0x6522('0x17'):return db[_0x2ff0e0][_0x6522('0x18')](queryTelephones);case _0x6522('0x19'):return db[_0x2ff0e0][_0x6522('0x18')](queryTrunks);case _0x6522('0x1a'):return db[_0x2ff0e0]['findAll'](queryCampaigns);}}else{return db[_0x6522('0x1b')][_0x6522('0x18')]({'attributes':[_0x6522('0x1c')],'where':{'sectionId':_0x417604['id']},'raw':!![]})[_0x6522('0xe')](function(_0xc1470c){if(_0xc1470c){var _0x3e0369={'where':{'id':_[_0x6522('0x1d')](_0xc1470c,_0x6522('0x1c'))},'raw':!![]};switch(_0x2ff0e0){case _0x6522('0x6'):_0x3e0369[_0x6522('0x1e')][_0x6522('0x1f')]=_0x6522('0x9');break;case'Campaign':_0x3e0369[_0x6522('0x1e')][_0x6522('0xa')]=_0x6522('0xb');break;}return db[_0x2ff0e0][_0x6522('0x18')](_0x3e0369);}else{return[];}});}}else{return[];}})['then'](function(_0x27a89a){return _0x27a89a;});}function joinOrLeaveQueues(_0x9a5622,_0x58ad50,_0x38aae6,_0x5f102e){_0x9a5622[_0x58ad50](util[_0x6522('0x20')](_0x6522('0x21'),_0x38aae6,_0x5f102e[_0x6522('0x7')]));if(_0x5f102e[_0x6522('0x5')]){for(var _0x44bd23=0x0;_0x44bd23<_0x5f102e[_0x6522('0x5')]['length'];_0x44bd23+=0x1){_0x9a5622[_0x58ad50](util[_0x6522('0x20')](_0x6522('0x22'),_0x5f102e[_0x6522('0x5')][_0x44bd23][_0x6522('0x7')]));}}}function joinOrLeave(_0x125ca3,_0x16c3cf,_0x49c7ac){var _0x11ed35;if(_0x125ca3[_0x6522('0x23')][_0x6522('0x24')]['id']){db[_0x6522('0x6')]['find']({'attributes':['id','name',_0x6522('0x1f'),_0x6522('0x25')],'where':{'id':_0x125ca3[_0x6522('0x23')][_0x6522('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x6522('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x6522('0x27')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6522('0x28')],'as':_0x6522('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x6522('0x2a')],'as':_0x6522('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x6522('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x6522('0x2d')],'as':_0x6522('0x2e'),'attributes':['id'],'raw':!![]}]})[_0x6522('0xe')](function(_0x13a851){if(_0x13a851){_0x11ed35=_0x13a851;_0x125ca3[_0x16c3cf](util[_0x6522('0x20')](_0x6522('0x22'),_0x13a851[_0x6522('0x7')]));var _0xdec8cc=[];switch(_0x13a851[_0x6522('0x1f')]){case _0x6522('0x2f'):_0x125ca3[_0x16c3cf](_0x6522('0x30'));_0x125ca3[_0x16c3cf]('voice:outbound');if(queryQueues[_0x6522('0x31')](_0x6522('0x32'))){delete queryQueues[_0x6522('0x32')];}_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x34')][_0x6522('0x18')](queryQueues));_0xdec8cc['push'](db[_0x6522('0x35')][_0x6522('0x18')](queryQueues));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x36')][_0x6522('0x18')](queryQueues));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x37')][_0x6522('0x18')](queryQueues));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x38')][_0x6522('0x18')](queryQueues));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x39')]['findAll'](queryQueues));_0xdec8cc['push'](db['WhatsappQueue'][_0x6522('0x18')](queryQueues));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x6')][_0x6522('0x18')](queryTelephones));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x3a')]['findAll'](queryTrunks));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x3b')][_0x6522('0x18')](queryCampaigns));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x6')]['findAll'](queryAgents));break;case'user':_0x125ca3[_0x16c3cf]('voice:inbound');_0x125ca3[_0x16c3cf](_0x6522('0x3c'));_0xdec8cc[_0x6522('0x33')](getAssociatedResources('VoiceQueues',_0x13a851['userProfileId'],_0x6522('0x34')));_0xdec8cc['push'](getAssociatedResources('ChatQueues',_0x13a851[_0x6522('0x25')],_0x6522('0x35')));_0xdec8cc[_0x6522('0x33')](getAssociatedResources(_0x6522('0x12'),_0x13a851[_0x6522('0x25')],'FaxQueue'));_0xdec8cc[_0x6522('0x33')](getAssociatedResources(_0x6522('0x13'),_0x13a851[_0x6522('0x25')],_0x6522('0x37')));_0xdec8cc[_0x6522('0x33')](getAssociatedResources('MailQueues',_0x13a851[_0x6522('0x25')],_0x6522('0x38')));_0xdec8cc['push'](getAssociatedResources('OpenchannelQueues',_0x13a851[_0x6522('0x25')],_0x6522('0x39')));_0xdec8cc[_0x6522('0x33')](getAssociatedResources(_0x6522('0x16'),_0x13a851[_0x6522('0x25')],'WhatsappQueue'));_0xdec8cc[_0x6522('0x33')](getAssociatedResources(_0x6522('0x17'),_0x13a851[_0x6522('0x25')],_0x6522('0x6')));_0xdec8cc[_0x6522('0x33')](getAssociatedResources(_0x6522('0x19'),_0x13a851['userProfileId'],_0x6522('0x3a')));_0xdec8cc['push'](getAssociatedResources('IvrCampaigns',_0x13a851[_0x6522('0x25')],_0x6522('0x3b')));_0xdec8cc[_0x6522('0x33')](db[_0x6522('0x6')]['findAll'](queryAgents));break;case _0x6522('0x8'):_0x125ca3[_0x16c3cf](_0x6522('0x30'));_0x125ca3[_0x16c3cf](_0x6522('0x3c'));_0xdec8cc['push'](_0x13a851[_0x6522('0x3d')]({'attributes':['id','name']}));_0xdec8cc[_0x6522('0x33')](_0x13a851[_0x6522('0x3e')]({'attributes':['id',_0x6522('0x7')]}));_0xdec8cc['push'](_0x13a851[_0x6522('0x3f')]({'attributes':['id',_0x6522('0x7')]}));_0xdec8cc[_0x6522('0x33')](_0x13a851[_0x6522('0x40')]({'attributes':['id',_0x6522('0x7')]}));_0xdec8cc[_0x6522('0x33')](_0x13a851[_0x6522('0x41')]({'attributes':['id',_0x6522('0x7')]}));_0xdec8cc[_0x6522('0x33')](_0x13a851[_0x6522('0x42')]({'attributes':['id','name']}));_0xdec8cc[_0x6522('0x33')](_0x13a851[_0x6522('0x43')]({'attributes':['id',_0x6522('0x7')]}));break;}return BPromise[_0x6522('0x44')](_0xdec8cc);}})[_0x6522('0xe')](function(_0x44156d){if(_0x44156d&&_0x44156d[_0x6522('0x45')]){for(var _0xe7e589=0x0;_0xe7e589<_0x44156d[_0x6522('0x45')];_0xe7e589+=0x1){for(var _0xcd9226=0x0;_0xcd9226<_0x44156d[_0xe7e589]['length'];_0xcd9226+=0x1){switch(_0xe7e589){case 0x0:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,'voice',_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x1:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,_0x6522('0x46'),_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x2:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,_0x6522('0x47'),_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x3:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,'sms',_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x4:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,_0x6522('0x48'),_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x5:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,_0x6522('0x49'),_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x6:joinOrLeaveQueues(_0x125ca3,_0x16c3cf,'whatsapp',_0x44156d[_0xe7e589][_0xcd9226]);break;case 0x7:if(_0x11ed35['role']!=='agent')_0x125ca3[_0x16c3cf](util['format'](_0x6522('0x4a'),_0x44156d[_0xe7e589][_0xcd9226][_0x6522('0x7')]));break;case 0x8:if(_0x11ed35[_0x6522('0x1f')]!==_0x6522('0x8'))_0x125ca3[_0x16c3cf](util[_0x6522('0x20')](_0x6522('0x4b'),_0x44156d[_0xe7e589][_0xcd9226]['name']));break;case 0x9:if(_0x11ed35[_0x6522('0x1f')]!==_0x6522('0x8'))_0x125ca3[_0x16c3cf](util['format'](_0x6522('0x4c'),_0x44156d[_0xe7e589][_0xcd9226][_0x6522('0xa')],_0x44156d[_0xe7e589][_0xcd9226][_0x6522('0x7')]));break;case 0xa:_0x125ca3[_0x16c3cf](util[_0x6522('0x20')](_0x6522('0x22'),_0x44156d[_0xe7e589][_0xcd9226]['name']));break;}}}}})[_0x6522('0xe')](function(){if(_0x16c3cf===_0x6522('0x4d')){var _0x1bbd4d=_['map'](_0x11ed35[_0x6522('0x26')],'id');return _0x11ed35[_0x6522('0x4e')](_0x1bbd4d)[_0x6522('0xe')](function(){for(var _0x1cea1c=0x0;_0x1cea1c<_0x1bbd4d[_0x6522('0x45')];_0x1cea1c+=0x1){_0x49c7ac[_0x6522('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1bbd4d[_0x1cea1c]),'UserId':Number(_0x11ed35['id'])});}});}})[_0x6522('0xe')](function(){if(_0x16c3cf==='leave'){var _0x4db39c=_[_0x6522('0x1d')](_0x11ed35[_0x6522('0x50')],'id');return _0x11ed35['removeMailInteractions'](_0x4db39c)['then'](function(){for(var _0x3bdc82=0x0;_0x3bdc82<_0x4db39c['length'];_0x3bdc82+=0x1){_0x49c7ac['emit'](_0x6522('0x51'),{'MailInteractionId':Number(_0x4db39c[_0x3bdc82]),'UserId':Number(_0x11ed35['id'])});}});}})[_0x6522('0xe')](function(){if(_0x16c3cf===_0x6522('0x4d')){var _0x3d31a3=_[_0x6522('0x1d')](_0x11ed35[_0x6522('0x29')],'id');return _0x11ed35[_0x6522('0x52')](_0x3d31a3)['then'](function(){for(var _0x1dfc3e=0x0;_0x1dfc3e<_0x3d31a3[_0x6522('0x45')];_0x1dfc3e+=0x1){_0x49c7ac[_0x6522('0x4f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3d31a3[_0x1dfc3e]),'UserId':Number(_0x11ed35['id'])});}});}})[_0x6522('0xe')](function(){if(_0x16c3cf==='leave'){var _0x3c45a8=_[_0x6522('0x1d')](_0x11ed35[_0x6522('0x2b')],'id');return _0x11ed35[_0x6522('0x53')](_0x3c45a8)['then'](function(){for(var _0x2b2394=0x0;_0x2b2394<_0x3c45a8[_0x6522('0x45')];_0x2b2394+=0x1){_0x49c7ac[_0x6522('0x4f')](_0x6522('0x54'),{'SmsInteractionId':Number(_0x3c45a8[_0x2b2394]),'UserId':Number(_0x11ed35['id'])});}});}})[_0x6522('0xe')](function(){if(_0x16c3cf===_0x6522('0x4d')){var _0x166da5=_[_0x6522('0x1d')](_0x11ed35[_0x6522('0x2c')],'id');return _0x11ed35['removeOpenchannelInteractions'](_0x166da5)[_0x6522('0xe')](function(){for(var _0x5c08fa=0x0;_0x5c08fa<_0x166da5['length'];_0x5c08fa+=0x1){_0x49c7ac[_0x6522('0x4f')](_0x6522('0x55'),{'OpenchannelInteractionId':Number(_0x166da5[_0x5c08fa]),'UserId':Number(_0x11ed35['id'])});}});}})['then'](function(){if(_0x16c3cf===_0x6522('0x4d')){var _0x417740=_[_0x6522('0x1d')](_0x11ed35[_0x6522('0x2e')],'id');return _0x11ed35[_0x6522('0x56')](_0x417740)['then'](function(){for(var _0xaa302a=0x0;_0xaa302a<_0x417740[_0x6522('0x45')];_0xaa302a+=0x1){_0x49c7ac[_0x6522('0x4f')](_0x6522('0x57'),{'WhatsappInteractionId':Number(_0x417740[_0xaa302a]),'UserId':Number(_0x11ed35['id'])});}});}})[_0x6522('0x58')](function(_0x4a35a7){_0x125ca3[_0x6522('0x59')](_0x4a35a7);});}}function onDisconnect(_0x1a0faa,_0x4bb4eb){joinOrLeave(_0x1a0faa,'leave',_0x4bb4eb);}function onConnect(_0x2b9386){joinOrLeave(_0x2b9386,_0x6522('0x5a'));}exports[_0x6522('0x5b')]=function(_0x1a6a65){_0x1a6a65['on'](_0x6522('0x5c'),function(_0x44fcee){_0x44fcee[_0x6522('0x5d')](0x0);_0x44fcee[_0x6522('0x5e')]=_0x44fcee[_0x6522('0x5f')]['connection']['remoteAddress']+':'+_0x44fcee[_0x6522('0x5f')][_0x6522('0x5c')][_0x6522('0x60')];_0x44fcee[_0x6522('0x61')]=new Date();_0x44fcee[_0x6522('0x59')]=function(_0x323b35){console[_0x6522('0x59')](_0x6522('0x62')+_0x44fcee[_0x6522('0x63')][_0x6522('0x7')]+'['+_0x44fcee[_0x6522('0x5e')]+']',_0x323b35);};_0x44fcee['on'](_0x6522('0x64'),function(){onDisconnect(_0x44fcee,_0x1a6a65);_0x44fcee['log'](_0x6522('0x65'));});onConnect(_0x44fcee);_0x44fcee[_0x6522('0x59')](_0x6522('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 9b00b48..644630d 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 _0x3ca4=['internal','format','agent','AfterCreateMessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','changed','closed','substatus','interface','SIP/%s','name','AfterUpdate','default','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','Chat','newmessage','SmsInteraction','Sms','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','Trigger,\x20%s','error','catch','get','channel','motionChannel','event','direction','then','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','User','find','fullname','email'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x3ca4,0xeb));var _0x43ca=function(_0xe55b30,_0x5981e1){_0xe55b30=_0xe55b30-0x0;var _0xa1050f=_0x3ca4[_0xe55b30];return _0xa1050f;};'use strict';var util=require(_0x43ca('0x0'));var db=require(_0x43ca('0x1'))['db'];var jayson=require(_0x43ca('0x2'));var logger=require(_0x43ca('0x3'))(_0x43ca('0x4'));var client=jayson[_0x43ca('0x5')][_0x43ca('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x43ca('0x7'),'event':_0x43ca('0x8'),'condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0x43ca('0xa'),'condition':_0x43ca('0xb'),'callback':afterUpdate},{'channel':_0x43ca('0xc'),'model':'ChatMessage','event':'afterCreate','condition':_0x43ca('0xd'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x43ca('0xe'),'event':'afterCreate','condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':_0x43ca('0xf'),'model':_0x43ca('0xe'),'event':'afterUpdate','condition':_0x43ca('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0x43ca('0x10'),'event':_0x43ca('0x8'),'condition':_0x43ca('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x43ca('0x8'),'condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x43ca('0x11'),'event':'afterUpdate','condition':_0x43ca('0xb'),'callback':afterUpdate},{'channel':_0x43ca('0x12'),'model':_0x43ca('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x43ca('0x14'),'model':_0x43ca('0x15'),'event':_0x43ca('0x8'),'condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':_0x43ca('0x14'),'model':_0x43ca('0x15'),'event':_0x43ca('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x43ca('0x14'),'model':'FaxMessage','event':_0x43ca('0x8'),'condition':_0x43ca('0xd'),'callback':afterCreateMessage},{'channel':_0x43ca('0x16'),'model':_0x43ca('0x17'),'event':_0x43ca('0x8'),'condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x43ca('0x18'),'event':_0x43ca('0x8'),'condition':_0x43ca('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x43ca('0x8'),'condition':_0x43ca('0x9'),'callback':afterCreate},{'channel':_0x43ca('0x19'),'model':_0x43ca('0x1a'),'event':'afterUpdate','condition':_0x43ca('0xb'),'callback':afterUpdate},{'channel':_0x43ca('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x1254de){return client[_0x43ca('0x1b')](_0x43ca('0x1c'),_0x1254de)['then'](function(_0x1684b0){logger['info'](_0x43ca('0x1d'),'EventManager',_0x1684b0);if(_0x1684b0[_0x43ca('0x1e')]){if(_0x1684b0['error']['code']===0x1f4){logger['error'](_0x43ca('0x1d'),_0x43ca('0x1c'),_0x1684b0[_0x43ca('0x1e')]);}}})[_0x43ca('0x1f')](function(_0x23f8fa){logger[_0x43ca('0x1e')]('Trigger,\x20%s','EventManager',_0x23f8fa);});}function afterCreateMessage(_0x2ca082){return function(_0x967d0c){_0x967d0c=_0x967d0c[_0x43ca('0x20')]({'plain':!![]});_0x967d0c[_0x43ca('0x21')]=_0x2ca082;_0x967d0c[_0x43ca('0x22')]=_0x2ca082;_0x967d0c[_0x43ca('0x23')]=_0x967d0c[_0x43ca('0x24')];Promise['resolve']()[_0x43ca('0x25')](function(){if(typeof _0x967d0c[_0x43ca('0x26')]==='undefined')return null;var _0x3fd743='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x967d0c['ContactId'];return db[_0x43ca('0x27')]['query'](_0x3fd743,{'type':db[_0x43ca('0x28')][_0x43ca('0x29')][_0x43ca('0x2a')],'raw':!![]});})[_0x43ca('0x25')](function(_0x220299){if(_0x220299){_0x967d0c[_0x43ca('0x2b')]=_0x220299[0x0];}if(_0x967d0c[_0x43ca('0x2c')]){return db[_0x43ca('0x2d')][_0x43ca('0x2e')]({'where':{'id':_0x967d0c['UserId']},'attributes':['id','name',_0x43ca('0x2f'),_0x43ca('0x30'),_0x43ca('0x31')],'raw':!![]})[_0x43ca('0x25')](function(_0x50d86f){_0x967d0c['interface']=util[_0x43ca('0x32')]('SIP/%s',_0x50d86f['name']);_0x967d0c[_0x43ca('0x21')]=_0x2ca082;_0x967d0c[_0x43ca('0x33')]=_0x50d86f;return request({'event':'incomingmessage','message':_0x967d0c});})['catch'](function(_0x197c7d){logger[_0x43ca('0x1e')](_0x43ca('0x1d'),_0x43ca('0x34'),_0x197c7d);});}else{return request({'event':_0x43ca('0x35'),'message':_0x967d0c});}});};}function afterCreate(_0x4213ab,_0xeeec5a){return function(_0x4ccfe4){_0x4ccfe4=_0x4ccfe4[_0x43ca('0x20')]({'plain':!![]});_0x4ccfe4[_0x43ca('0x21')]=_0x4213ab;_0x4ccfe4[_0x43ca('0x22')]=_0x4213ab;_0x4ccfe4[_0x43ca('0x23')]=_0x43ca('0x36');var _0x25987b=_0x43ca('0x37')+_0x4ccfe4[_0x43ca('0x26')];return db[_0x43ca('0x27')][_0x43ca('0x38')](_0x25987b,{'type':db[_0x43ca('0x28')][_0x43ca('0x29')][_0x43ca('0x2a')],'raw':!![]})[_0x43ca('0x25')](function(_0x62306e){return _0x62306e;})['then'](function(_0x6a002d){if(_0x6a002d){_0x4ccfe4[_0x43ca('0x2b')]=_0x6a002d[0x0];}return request({'event':_0xeeec5a,'message':_0x4ccfe4});});};}function afterUpdate(_0x2457f7){return function(_0x1d1f69){var _0x492f4e=_0x1d1f69[_0x43ca('0x39')](_0x43ca('0x3a'))&&_0x1d1f69[_0x43ca('0x3a')];var _0x1885ba=_0x1d1f69['changed'](_0x43ca('0x3b'));if(_0x492f4e||_0x1885ba){var _0x3810c8=_0x492f4e?_0x43ca('0xb'):_0x43ca('0x3b');var _0x133bf1=_0x1d1f69[_0x43ca('0x20')]({'plain':!![]});_0x133bf1['channel']=_0x2457f7;_0x133bf1[_0x43ca('0x22')]=_0x2457f7;_0x133bf1['event']=_0x492f4e?_0x43ca('0x3a'):_0x43ca('0x3b');var _0x3942d5=_0x43ca('0x37')+_0x133bf1[_0x43ca('0x26')];return db[_0x43ca('0x27')][_0x43ca('0x38')](_0x3942d5,{'type':db[_0x43ca('0x28')][_0x43ca('0x29')]['SELECT'],'raw':!![]})['then'](function(_0x4c4ee5){if(_0x4c4ee5){_0x133bf1[_0x43ca('0x2b')]=_0x4c4ee5[0x0];}if(_0x133bf1[_0x43ca('0x2c')]){return db[_0x43ca('0x2d')][_0x43ca('0x2e')]({'where':{'id':_0x133bf1[_0x43ca('0x2c')]},'attributes':['id','name',_0x43ca('0x2f'),_0x43ca('0x30'),'internal'],'raw':!![]})[_0x43ca('0x25')](function(_0x181b34){_0x133bf1[_0x43ca('0x3c')]=util[_0x43ca('0x32')](_0x43ca('0x3d'),_0x181b34[_0x43ca('0x3e')]);_0x133bf1[_0x43ca('0x33')]=_0x181b34;return request({'event':_0x3810c8,'message':_0x133bf1});})[_0x43ca('0x1f')](function(_0x4a9366){logger['error'](_0x43ca('0x1d'),_0x43ca('0x3f'),_0x4a9366);});}else{return request({'event':_0x3810c8,'message':_0x133bf1});}});}};}exports[_0x43ca('0x40')]=function(){for(var _0x6e7a1e=0x0;_0x6e7a1e=_0x4aaaa1[_0x8073('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2ef508(_0x50b0c5);})['catch'](function(_0x2eb531){_0x24df44(_0x2eb531);});});}; \ No newline at end of file +var _0x9dae=['../mysqldb','./license/util','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','blockedAt','updateAttributes','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9dae,0xfa));var _0xe9da=function(_0x12843a,_0xc93162){_0x12843a=_0x12843a-0x0;var _0x9ae837=_0x9dae[_0x12843a];return _0x9ae837;};'use strict';var _=require(_0xe9da('0x0'));var BPromise=require(_0xe9da('0x1'));var db=require(_0xe9da('0x2'))['db'];var util=require(_0xe9da('0x3'));var channels=['voice','mail',_0xe9da('0x4'),_0xe9da('0x5'),_0xe9da('0x6'),_0xe9da('0x7'),_0xe9da('0x8')];exports[_0xe9da('0x9')]=function(){return channels;};exports[_0xe9da('0xa')]=function(_0x28004c){_0x28004c=_0x28004c[_0xe9da('0xb')]();return _['includes'](channels,_0x28004c);};exports['clearBlockUser']=function(_0x210d52,_0x3182bd,_0xdf2dcd,_0x4324eb){var _0x47096b={'loginAttempts':_0x3182bd,'blocked':_0xdf2dcd};if(!_['isUndefined'](_0x4324eb)){_0x47096b[_0xe9da('0xc')]=_0x4324eb;}return _0x210d52[_0xe9da('0xd')](_0x47096b);};exports['getLicense']=function(_0x499dfa){return new BPromise(function(_0xfd2899,_0x522294){var _0x5ee6c8=0x0;if(_0x499dfa['role']!==_0xe9da('0xe')){_0xfd2899(_0x499dfa);}db[_0xe9da('0xf')][_0xe9da('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x499dfa['id']}}})['then'](function(_0x46d33f){_0x5ee6c8=_0x46d33f;return util['getLicense']();})[_0xe9da('0x11')](function(_0x8fef6e){if(_0x8fef6e&&_0x8fef6e[_0xe9da('0x12')]&&_0x5ee6c8>=_0x8fef6e['agents']){throw Error(_0xe9da('0x13'));}_0xfd2899(_0x499dfa);})[_0xe9da('0x14')](function(_0x2c54e0){_0x522294(_0x2c54e0);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 80b775a..76c4ff4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1d5=['404','status','render','json','exports'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0xd1d5,0xa4));var _0x5d1d=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd1d5[_0x4243a3];return _0x1b2a33;};'use strict';module[_0x5d1d('0x0')][0x194]=function pageNotFound(_0x1ad842,_0x16f469){var _0x5081fb=_0x5d1d('0x1');var _0x89f769=0x194;var _0x20b0a1={'status':_0x89f769};_0x16f469[_0x5d1d('0x2')](_0x20b0a1[_0x5d1d('0x2')]);_0x16f469[_0x5d1d('0x3')](_0x5081fb,{},function(_0x1686bc,_0xb52ac1){if(_0x1686bc){return _0x16f469[_0x5d1d('0x2')](_0x20b0a1[_0x5d1d('0x2')])[_0x5d1d('0x4')](_0x20b0a1);}_0x16f469['send'](_0xb52ac1);});}; \ No newline at end of file +var _0xf81a=['status','render','send','exports','404'];(function(_0x11f6a5,_0x2748ee){var _0x1a7bed=function(_0x3788a5){while(--_0x3788a5){_0x11f6a5['push'](_0x11f6a5['shift']());}};_0x1a7bed(++_0x2748ee);}(_0xf81a,0x16b));var _0xaf81=function(_0x331732,_0x5b7529){_0x331732=_0x331732-0x0;var _0x104195=_0xf81a[_0x331732];return _0x104195;};'use strict';module[_0xaf81('0x0')][0x194]=function pageNotFound(_0x43d929,_0x1ecfb2){var _0x515bb5=_0xaf81('0x1');var _0x3692c7=0x194;var _0x285b5b={'status':_0x3692c7};_0x1ecfb2['status'](_0x285b5b[_0xaf81('0x2')]);_0x1ecfb2[_0xaf81('0x3')](_0x515bb5,{},function(_0x5c8d58,_0x102c05){if(_0x5c8d58){return _0x1ecfb2[_0xaf81('0x2')](_0x285b5b[_0xaf81('0x2')])['json'](_0x285b5b);}_0x1ecfb2[_0xaf81('0x4')](_0x102c05);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index bf98d5b..ff50d3c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','chat_group_has_users','belongsToMany','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','CmList','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperBlacks','JscriptySessions','belongsTo','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceMailMessage','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','Imap','hasOne','Smtp','Answers','Interactions','List','ListId','TemplateId','Agents','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','ChatOfflineMessageId','restrict','Interval','TagId','DashboardItem','FaxAccountId','Exntensions','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','ChatApplication','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','UserChatQueue','team_has_chat_queues','Website','CompanyId','CmHopper','Hoppers','HopperHistories','Company','cm_contact_has_tags','Campaign','OwnerId','CampaignId','OneAll','AutomationAllId','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','Schedule','DefaultReportId','CustomReportId','Mohs','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticFieldReport','Fields','AnalyticDefaultReport','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmAccount','DeskConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','ServicenowConfiguration','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','team_has_whatsapp_queues','WhatsappQueues','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromAccount','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAgent','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToAccount','CustomFields','Contacts','HopperHistory','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','utf8mb4','name','sequelizeHistory','xcall','127.0.0.1','mysql','utf8','utf8_general_ci','username','database','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../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/mailAccount/mailAccount.model','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Variable','../api/variable/variable.model','Integration','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport'];(function(_0x5ee0ef,_0x34f2b1){var _0x144aab=function(_0x39f698){while(--_0x39f698){_0x5ee0ef['push'](_0x5ee0ef['shift']());}};_0x144aab(++_0x34f2b1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x59f691,_0x1b656d){_0x59f691=_0x59f691-0x0;var _0x1f80bb=_0xbdb7[_0x59f691];return _0x1f80bb;};'use strict';var config=require(_0x7bdb('0x0'));var Sequelize=require(_0x7bdb('0x1'));var _=require(_0x7bdb('0x2'));var jstz=require(_0x7bdb('0x3'));var timezone=jstz[_0x7bdb('0x4')]();config[_0x7bdb('0x1')]=_[_0x7bdb('0x5')](config[_0x7bdb('0x1')],{'database':_0x7bdb('0x6'),'username':'xcall','password':_0x7bdb('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x7bdb('0x8')},'logging':![],'timezone':timezone[_0x7bdb('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x7bdb('0xa')]=_[_0x7bdb('0x5')](config['sequelizeHistory'],{'database':'motion2','username':_0x7bdb('0xb'),'password':_0x7bdb('0x7'),'options':{'host':_0x7bdb('0xc'),'port':0xcea,'dialect':_0x7bdb('0xd'),'dialectOptions':{'charset':_0x7bdb('0x8')},'logging':![],'timezone':timezone[_0x7bdb('0x9')](),'define':{'charset':_0x7bdb('0xe'),'collate':_0x7bdb('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0x7bdb('0x10')],config[_0x7bdb('0x1')]['password'],config[_0x7bdb('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x7bdb('0x11')],config[_0x7bdb('0xa')]['username'],config['sequelizeHistory']['password'],config[_0x7bdb('0xa')][_0x7bdb('0x12')])};db[_0x7bdb('0x13')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x15'));db[_0x7bdb('0x16')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x17'));db[_0x7bdb('0x18')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/voiceContext/voiceContext.model');db[_0x7bdb('0x19')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x1a'));db[_0x7bdb('0x1b')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x1c'));db['VoiceQueue']=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x1d'));db['VoiceRecording']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x1e'));db[_0x7bdb('0x1f')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x20'));db[_0x7bdb('0x21')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x7bdb('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x22'));db[_0x7bdb('0x23')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x24'));db['VoiceAgentReport']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x25'));db[_0x7bdb('0x26')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x27'));db[_0x7bdb('0x28')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x29'));db[_0x7bdb('0x2a')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x2b'));db[_0x7bdb('0x2c')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x7bdb('0x2d')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x2e'));db['UserVoiceQueue']=db['sequelize']['import'](_0x7bdb('0x2f'));db['UserChatQueue']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x30'));db[_0x7bdb('0x31')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x32'));db['UserFaxQueue']=db['sequelize'][_0x7bdb('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x7bdb('0x33')]=db['sequelize']['import'](_0x7bdb('0x34'));db[_0x7bdb('0x35')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x36'));db[_0x7bdb('0x37')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x38'));db[_0x7bdb('0x39')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x3a'));db[_0x7bdb('0x3b')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x3c'));db[_0x7bdb('0x3d')]=db[_0x7bdb('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0x7bdb('0x3e')]=db['sequelize'][_0x7bdb('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7bdb('0x3f')]=db['sequelize']['import'](_0x7bdb('0x40'));db[_0x7bdb('0x41')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x42'));db[_0x7bdb('0x43')]=db[_0x7bdb('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0x7bdb('0x44')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x45'));db[_0x7bdb('0x46')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x47'));db[_0x7bdb('0x48')]=db['sequelize'][_0x7bdb('0x14')]('../api/faxAccount/faxAccount.model');db[_0x7bdb('0x49')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x4a'));db[_0x7bdb('0x4b')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x4c'));db[_0x7bdb('0x4d')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x4e'));db['FaxQueue']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x4f'));db[_0x7bdb('0x50')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x51'));db['SmsAccount']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x52'));db[_0x7bdb('0x53')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x54'));db[_0x7bdb('0x55')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x56'));db[_0x7bdb('0x57')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x58'));db[_0x7bdb('0x59')]=db['sequelize'][_0x7bdb('0x14')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x7bdb('0x5a')]=db[_0x7bdb('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x5b'));db[_0x7bdb('0x5c')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x5d'));db[_0x7bdb('0x5e')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x7bdb('0x5f')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x60'));db[_0x7bdb('0x61')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x62'));db['ChatApplication']=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x63'));db['ChatInteraction']=db['sequelize']['import'](_0x7bdb('0x64'));db['ChatMessage']=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x65'));db[_0x7bdb('0x66')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x67'));db['ChatQueue']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x68'));db[_0x7bdb('0x69')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/chatGroup/chatGroup.model');db[_0x7bdb('0x6a')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x7bdb('0x6b')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x6c'));db['CmContact']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/cmHopper/cmHopper.model');db[_0x7bdb('0x6d')]=db['sequelize'][_0x7bdb('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x6e'));db[_0x7bdb('0x6f')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x70'));db[_0x7bdb('0x71')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x72'));db[_0x7bdb('0x73')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x74'));db['Action']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x75'));db[_0x7bdb('0x76')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x77'));db[_0x7bdb('0x78')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x79'));db[_0x7bdb('0x7a')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x7b'));db[_0x7bdb('0x7c')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x7d'));db['Interval']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x7e'));db[_0x7bdb('0x7f')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x80'));db[_0x7bdb('0x81')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x82'));db[_0x7bdb('0x83')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x84'));db['Schedule']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x85'));db['Sound']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/sound/sound.model');db[_0x7bdb('0x86')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x87'));db[_0x7bdb('0x88')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x89'));db['Trigger']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/trigger/trigger.model');db[_0x7bdb('0x8a')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x8b'));db[_0x7bdb('0x8c')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/integration/integration.model');db['IntegrationReport']=db['sequelize'][_0x7bdb('0x14')]('../api/integrationReport/integrationReport.model');db[_0x7bdb('0x8d')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x8e'));db[_0x7bdb('0x8f')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x90'));db[_0x7bdb('0x91')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x92'));db['AnalyticFieldReport']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x93'));db['AnalyticTreeReport']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x94'));db[_0x7bdb('0x95')]=db[_0x7bdb('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7bdb('0x96')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x97'));db[_0x7bdb('0x98')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0x99'));db['SugarcrmAccount']=db[_0x7bdb('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7bdb('0x9a')]=db[_0x7bdb('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x7bdb('0x9b')]=db['sequelize'][_0x7bdb('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x7bdb('0x9c')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0x9d'));db['DeskConfiguration']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x7bdb('0x9e')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0x9f'));db[_0x7bdb('0xa0')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x7bdb('0xa1')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xa2'));db[_0x7bdb('0xa3')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xa4'));db[_0x7bdb('0xa5')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xa6'));db[_0x7bdb('0xa7')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xa8'));db[_0x7bdb('0xa9')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xaa'));db[_0x7bdb('0xab')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xac'));db['FreshdeskConfiguration']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xad'));db[_0x7bdb('0xae')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xaf'));db[_0x7bdb('0xb0')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xb1'));db['VtigerConfiguration']=db['sequelize']['import'](_0x7bdb('0xb2'));db[_0x7bdb('0xb3')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xb4'));db['ServicenowAccount']=db['sequelize']['import'](_0x7bdb('0xb5'));db['ServicenowConfiguration']=db['sequelize']['import'](_0x7bdb('0xb6'));db[_0x7bdb('0xb7')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xb8'));db[_0x7bdb('0xb9')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x7bdb('0xba')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xbb'));db[_0x7bdb('0xbc')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xbd'));db[_0x7bdb('0xbe')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xbf'));db['FreshsalesConfiguration']=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x7bdb('0xc0')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xc1'));db[_0x7bdb('0x8c')]=db['sequelize'][_0x7bdb('0x14')]('../api/integration/integration.model');db[_0x7bdb('0xc2')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/network/network.model');db[_0x7bdb('0xc3')]=db['sequelize'][_0x7bdb('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x7bdb('0xc4')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xc5'));db[_0x7bdb('0xc6')]=db['sequelize']['import'](_0x7bdb('0xc7'));db[_0x7bdb('0xc8')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x7bdb('0xc9')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xca'));db[_0x7bdb('0xcb')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xcc'));db[_0x7bdb('0xcd')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xce'));db[_0x7bdb('0xcf')]=db[_0x7bdb('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x7bdb('0xd0')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xd1'));db[_0x7bdb('0xd2')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xd3'));db[_0x7bdb('0xd4')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0x7bdb('0xd5')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xd6'));db[_0x7bdb('0xd7')]=db[_0x7bdb('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x7bdb('0xd8')]=db['sequelize']['import'](_0x7bdb('0xd9'));db['Team']=db[_0x7bdb('0x1')]['import']('../api/team/team.model');db[_0x7bdb('0xda')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xdb'));db['Campaign']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xdc'));db[_0x7bdb('0xdd')]=db['sequelize'][_0x7bdb('0x14')]('../api/migration/migration.model');db[_0x7bdb('0xde')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xdf'));db['Plugin']=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xe0'));db[_0x7bdb('0xe1')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xe2'));db['ChatTransferReport']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xe3'));db[_0x7bdb('0xe4')]=db['sequelize'][_0x7bdb('0x14')](_0x7bdb('0xe5'));db[_0x7bdb('0xe6')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xe7'));db[_0x7bdb('0xe8')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xe9'));db['CmList']=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xea'));db[_0x7bdb('0xeb')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xec'));db[_0x7bdb('0xed')]=db['sequelize'][_0x7bdb('0x14')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xee'));db[_0x7bdb('0xef')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x7bdb('0xf0')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xf1'));db['WhatsappAccount']=db['sequelize'][_0x7bdb('0x14')]('../api/whatsappAccount/whatsappAccount.model');db[_0x7bdb('0xf2')]=db[_0x7bdb('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db[_0x7bdb('0xf3')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xf4'));db[_0x7bdb('0xf5')]=db[_0x7bdb('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x7bdb('0xf6')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xf7'));db['WhatsappTransferReport']=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xf8'));db['WhatsappQueue']=db['sequelize']['import'](_0x7bdb('0xf9'));db[_0x7bdb('0xfa')]=db[_0x7bdb('0x1')]['import'](_0x7bdb('0xfb'));db[_0x7bdb('0xfc')]=db[_0x7bdb('0x1')][_0x7bdb('0x14')](_0x7bdb('0xfd'));db[_0x7bdb('0xfe')]=db['sequelize']['import'](_0x7bdb('0xff'));db[_0x7bdb('0x100')]=db['sequelize']['import'](_0x7bdb('0x101'));db['User']['hasOne'](db[_0x7bdb('0x21')],{'as':_0x7bdb('0x21'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x103')});db['User'][_0x7bdb('0x104')](db[_0x7bdb('0x105')],{'as':_0x7bdb('0x106'),'foreignKey':'UserId'});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db[_0x7bdb('0x2d')],{'as':_0x7bdb('0x107'),'foreignKey':'UserId'});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db['VoiceExtension'],{'as':_0x7bdb('0x108'),'onDelete':'cascade','hooks':!![]});db['User'][_0x7bdb('0x104')](db[_0x7bdb('0x109')],{'as':_0x7bdb('0x10a'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x7bdb('0x103')});db['User'][_0x7bdb('0x104')](db[_0x7bdb('0x71')],{'as':_0x7bdb('0x71'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x7bdb('0x13')]['hasMany'](db[_0x7bdb('0x10b')],{'as':_0x7bdb('0x10c'),'foreignKey':_0x7bdb('0x103')});db['User'][_0x7bdb('0x104')](db[_0x7bdb('0x55')],{'as':_0x7bdb('0x10d'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db['FaxInteraction'],{'as':_0x7bdb('0x10e'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db[_0x7bdb('0x3f')],{'as':'MailInteractions','foreignKey':_0x7bdb('0x103')});db['User'][_0x7bdb('0x104')](db[_0x7bdb('0xf3')],{'as':_0x7bdb('0x10f'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x13')][_0x7bdb('0x104')](db[_0x7bdb('0xf0')],{'as':_0x7bdb('0x110'),'foreignKey':_0x7bdb('0x111')});db[_0x7bdb('0x13')]['belongsTo'](db[_0x7bdb('0xed')],{'as':_0x7bdb('0xed'),'foreignKey':_0x7bdb('0x112')});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x7bdb('0x113')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x115')],{'as':'Contacts','through':_0x7bdb('0x116')});db[_0x7bdb('0x13')]['belongsToMany'](db['CmList'],{'as':_0x7bdb('0x117'),'through':_0x7bdb('0x118')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x119')],{'through':_0x7bdb('0x11a')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db['MailInteraction'],{'as':_0x7bdb('0x11b'),'through':_0x7bdb('0x11c')});db[_0x7bdb('0x13')]['belongsToMany'](db[_0x7bdb('0x10b')],{'as':'ChatInteractions','through':_0x7bdb('0x11d')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x4b')],{'as':'FaxInteractions','through':_0x7bdb('0x11e')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x55')],{'as':'SmsInteractions','through':_0x7bdb('0x11f')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x120')],{'as':_0x7bdb('0x121'),'through':_0x7bdb('0x122')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db['WhatsappInteraction'],{'as':_0x7bdb('0x10f'),'through':_0x7bdb('0x123')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x124')],{'as':_0x7bdb('0x125'),'through':_0x7bdb('0x126'),'required':![]});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db['VoicePrefix'],{'as':_0x7bdb('0x127'),'through':'UserVoicePrefix','required':![]});db['User'][_0x7bdb('0x114')](db['MailQueue'],{'as':_0x7bdb('0x128'),'through':'UserMailQueue','required':![]});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x129')],{'as':_0x7bdb('0x12a'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x7bdb('0x114')](db[_0x7bdb('0x12b')],{'as':_0x7bdb('0x12c'),'through':_0x7bdb('0x12d'),'required':![]});db[_0x7bdb('0x13')]['belongsToMany'](db['SmsQueue'],{'as':_0x7bdb('0x12e'),'through':_0x7bdb('0x33'),'required':![]});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x5e')],{'as':_0x7bdb('0x12f'),'through':'UserOpenchannelQueue','required':![]});db[_0x7bdb('0x13')]['belongsToMany'](db[_0x7bdb('0x130')],{'as':'WhatsappQueues','through':_0x7bdb('0x37'),'required':![]});db[_0x7bdb('0x13')]['belongsToMany'](db[_0x7bdb('0x131')],{'through':_0x7bdb('0x118')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x5f')],{'as':_0x7bdb('0x132'),'through':_0x7bdb('0x133')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x48')],{'as':_0x7bdb('0x134'),'through':_0x7bdb('0x135')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x136')],{'as':_0x7bdb('0x137'),'through':_0x7bdb('0x138')});db[_0x7bdb('0x13')]['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x7bdb('0x139')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x13a')],{'as':_0x7bdb('0x13b'),'through':_0x7bdb('0x13c')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0x13d')],{'as':'WhatsappAccounts','through':_0x7bdb('0x13e')});db[_0x7bdb('0x13')][_0x7bdb('0x114')](db[_0x7bdb('0xd5')],{'as':'SquareProjects','through':_0x7bdb('0x13f')});db[_0x7bdb('0x16')]['hasMany'](db[_0x7bdb('0x19')],{'as':_0x7bdb('0x140'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x141')});db['VoiceContext'][_0x7bdb('0x104')](db[_0x7bdb('0x19')],{'onDelete':_0x7bdb('0x102')});db['VoiceExtension'][_0x7bdb('0x104')](db[_0x7bdb('0x19')],{'as':_0x7bdb('0x142'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x1b')]['belongsToMany'](db[_0x7bdb('0x143')],{'as':_0x7bdb('0x144'),'through':_0x7bdb('0x145')});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db[_0x7bdb('0x2d')],{'as':_0x7bdb('0x146'),'foreignKey':'VoiceQueueId'});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db[_0x7bdb('0x109')],{'as':_0x7bdb('0x10a'),'foreignKey':'VoiceQueueId'});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db[_0x7bdb('0x6f')],{'as':'HopperHistories','foreignKey':_0x7bdb('0x147')});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db[_0x7bdb('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x7bdb('0x147')});db[_0x7bdb('0x124')][_0x7bdb('0x104')](db['CmHopperBlack'],{'as':_0x7bdb('0x148'),'foreignKey':_0x7bdb('0x147')});db[_0x7bdb('0x124')]['hasMany'](db[_0x7bdb('0xc9')],{'as':_0x7bdb('0x149'),'foreignKey':_0x7bdb('0x147')});db[_0x7bdb('0x124')][_0x7bdb('0x14a')](db[_0x7bdb('0x2a')],{'as':_0x7bdb('0x2a'),'foreignKey':_0x7bdb('0x14b')});db[_0x7bdb('0x124')][_0x7bdb('0x14a')](db[_0x7bdb('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x7bdb('0x124')][_0x7bdb('0x14a')](db['Interval'],{'as':'Interval','foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x124')][_0x7bdb('0x14a')](db[_0x7bdb('0x7f')],{'as':_0x7bdb('0x14d'),'foreignKey':_0x7bdb('0x14e')});db['VoiceQueue'][_0x7bdb('0x114')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x117'),'through':'voice_queues_has_cm_lists'});db[_0x7bdb('0x124')][_0x7bdb('0x114')](db['User'],{'as':'Agents','through':_0x7bdb('0x126')});db[_0x7bdb('0x124')]['belongsToMany'](db[_0x7bdb('0x119')],{'as':_0x7bdb('0x14f'),'through':_0x7bdb('0xfc')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x7bdb('0x150'),'through':_0x7bdb('0x151')});db['VoiceRecording'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':'User','foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x1f')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x13'),'foreignKey':_0x7bdb('0x103')});db['VoiceMail'][_0x7bdb('0x104')](db['VoiceMailMessage'],{'as':_0x7bdb('0x152'),'onDelete':'cascade','foreignKey':_0x7bdb('0x153'),'sourceKey':_0x7bdb('0x154')});db[_0x7bdb('0x155')][_0x7bdb('0x14a')](db[_0x7bdb('0x21')],{'foreignKey':_0x7bdb('0x153'),'targetKey':_0x7bdb('0x154')});db[_0x7bdb('0x156')]['hasMany'](db[_0x7bdb('0x26')],{'as':_0x7bdb('0x157'),'foreignKey':_0x7bdb('0x158'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x7bdb('0x159')],{'as':_0x7bdb('0x15a'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x13'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x156')]['belongsTo'](db['CmContact'],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db['MailServerIn'][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{'as':_0x7bdb('0x136'),'foreignKey':_0x7bdb('0x15d')});db[_0x7bdb('0x3b')][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{'as':_0x7bdb('0x136'),'foreignKey':_0x7bdb('0x15d')});db[_0x7bdb('0x136')]['hasOne'](db[_0x7bdb('0x39')],{'as':_0x7bdb('0x15e'),'onDelete':'cascade'});db[_0x7bdb('0x136')][_0x7bdb('0x15f')](db[_0x7bdb('0x3b')],{'as':_0x7bdb('0x160'),'onDelete':_0x7bdb('0x102')});db['MailAccount'][_0x7bdb('0x104')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7bdb('0x15d'),'onDelete':'cascade'});db[_0x7bdb('0x136')]['hasMany'](db[_0x7bdb('0x78')],{'as':_0x7bdb('0x161'),'foreignKey':_0x7bdb('0x15d')});db[_0x7bdb('0x136')][_0x7bdb('0x104')](db[_0x7bdb('0x41')],{'as':_0x7bdb('0x152'),'foreignKey':_0x7bdb('0x15d')});db[_0x7bdb('0x136')][_0x7bdb('0x104')](db['MailInteraction'],{'as':_0x7bdb('0x162')});db[_0x7bdb('0x136')][_0x7bdb('0x104')](db[_0x7bdb('0x43')],{'as':_0x7bdb('0x142')});db[_0x7bdb('0x136')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db['MailAccount'][_0x7bdb('0x14a')](db[_0x7bdb('0x88')],{'as':_0x7bdb('0x88'),'foreignKey':_0x7bdb('0x165')});db[_0x7bdb('0x136')][_0x7bdb('0x14a')](db[_0x7bdb('0x7f')],{'as':_0x7bdb('0x14d'),'foreignKey':_0x7bdb('0x14e')});db[_0x7bdb('0x136')][_0x7bdb('0x114')](db['User'],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x138')});db[_0x7bdb('0x3d')][_0x7bdb('0x114')](db['User'],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x31')});db[_0x7bdb('0x3d')]['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':_0x7bdb('0x14f')});db[_0x7bdb('0x3f')]['hasMany'](db['MailMessage'],{'as':_0x7bdb('0x152'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x167')});db[_0x7bdb('0x3f')][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{'as':_0x7bdb('0x168'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x7bdb('0x14a')](db['CmContact'],{'as':_0x7bdb('0x15b'),'foreignKey':'ContactId'});db[_0x7bdb('0x3f')][_0x7bdb('0x14a')](db['User'],{'as':_0x7bdb('0x169'),'foreignKey':'UserId'});db[_0x7bdb('0x3f')]['belongsToMany'](db['Tag'],{'through':_0x7bdb('0x16a'),'as':_0x7bdb('0x16b')});db[_0x7bdb('0x3f')][_0x7bdb('0x114')](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x7bdb('0x3f')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':'user_has_mail_interactions','foreignKey':_0x7bdb('0x167')});db['MailMessage'][_0x7bdb('0x104')](db[_0x7bdb('0xde')],{'as':_0x7bdb('0x16d'),'onDelete':'cascade'});db[_0x7bdb('0x41')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':'User'});db[_0x7bdb('0x41')]['belongsTo'](db['CmContact'],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x15b')});db[_0x7bdb('0x41')][_0x7bdb('0x14a')](db[_0x7bdb('0x3f')],{'as':_0x7bdb('0x16e'),'foreignKey':'MailInteractionId'});db[_0x7bdb('0x41')]['belongsTo'](db[_0x7bdb('0x136')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x15d')});db[_0x7bdb('0x41')][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{'as':_0x7bdb('0x5f'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x7bdb('0x14a')](db['ChatOfflineMessage'],{'as':_0x7bdb('0x66'),'foreignKey':_0x7bdb('0x16f')});db[_0x7bdb('0x43')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x43')][_0x7bdb('0x14a')](db[_0x7bdb('0x3d')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x43')][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x43')][_0x7bdb('0x14a')](db[_0x7bdb('0x171')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x43')][_0x7bdb('0x14a')](db[_0x7bdb('0x86')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x172')});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db['MailAccount'],{});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':'ListId'});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db[_0x7bdb('0x3f')],{});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db[_0x7bdb('0x41')],{});db[_0x7bdb('0x44')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{});db[_0x7bdb('0x44')]['belongsTo'](db[_0x7bdb('0x3d')],{});db[_0x7bdb('0x46')][_0x7bdb('0x104')](db[_0x7bdb('0x173')],{'as':'Items','onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x48')]['hasMany'](db[_0x7bdb('0x7a')],{'as':'Dispositions','foreignKey':_0x7bdb('0x174'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x48')][_0x7bdb('0x104')](db['CannedAnswer'],{'as':_0x7bdb('0x161'),'foreignKey':_0x7bdb('0x174')});db['FaxAccount'][_0x7bdb('0x104')](db[_0x7bdb('0x4b')],{'as':_0x7bdb('0x162')});db[_0x7bdb('0x48')][_0x7bdb('0x104')](db[_0x7bdb('0x49')],{'as':'Applications'});db[_0x7bdb('0x48')][_0x7bdb('0x104')](db[_0x7bdb('0x19')],{'as':_0x7bdb('0x175'),'onDelete':_0x7bdb('0x102')});db['FaxAccount']['hasMany'](db[_0x7bdb('0x4d')],{'as':'Messages'});db['FaxAccount'][_0x7bdb('0x14a')](db['Trunk'],{'as':_0x7bdb('0x2a')});db[_0x7bdb('0x48')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x48')]['belongsTo'](db[_0x7bdb('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x7bdb('0x14e')});db[_0x7bdb('0x48')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x135')});db[_0x7bdb('0x49')]['belongsTo'](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x170')});db['FaxApplication'][_0x7bdb('0x14a')](db[_0x7bdb('0x12b')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x49')]['belongsTo'](db[_0x7bdb('0x48')],{'onDelete':'restrict'});db[_0x7bdb('0x49')]['belongsTo'](db[_0x7bdb('0x86')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x172')});db[_0x7bdb('0x4b')][_0x7bdb('0x104')](db[_0x7bdb('0x4d')],{'as':_0x7bdb('0x152'),'onDelete':_0x7bdb('0x102'),'foreignKey':'FaxInteractionId'});db[_0x7bdb('0x4b')][_0x7bdb('0x14a')](db[_0x7bdb('0x48')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x174')});db[_0x7bdb('0x4b')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x4b')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x169'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x4b')][_0x7bdb('0x114')](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x176'),'as':'Tags'});db[_0x7bdb('0x4b')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x7bdb('0x4b')]['belongsToMany'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':_0x7bdb('0x11e'),'foreignKey':_0x7bdb('0x177')});db[_0x7bdb('0x4d')]['belongsTo'](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x13')});db[_0x7bdb('0x4d')]['belongsTo'](db[_0x7bdb('0x4b')],{'as':_0x7bdb('0x16e'),'foreignKey':_0x7bdb('0x177')});db[_0x7bdb('0x4d')][_0x7bdb('0x14a')](db['CmContact'],{'onDelete':_0x7bdb('0x102'),'as':'Contact'});db['FaxMessage'][_0x7bdb('0x14a')](db[_0x7bdb('0xde')],{'as':_0x7bdb('0xde'),'foreignKey':_0x7bdb('0x178')});db[_0x7bdb('0x4d')][_0x7bdb('0x14a')](db['FaxAccount'],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x174')});db['FaxQueue'][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x12d')});db['FaxQueue'][_0x7bdb('0x114')](db['Team'],{'through':_0x7bdb('0x179'),'as':'Teams'});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db[_0x7bdb('0x48')],{});db['FaxQueueReport']['belongsTo'](db[_0x7bdb('0x131')],{'as':'List','foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db[_0x7bdb('0x4b')],{});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db[_0x7bdb('0x4d')],{});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{});db[_0x7bdb('0x50')][_0x7bdb('0x14a')](db['FaxQueue'],{});db[_0x7bdb('0x13a')][_0x7bdb('0x104')](db[_0x7bdb('0x7a')],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x17b'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x13a')][_0x7bdb('0x104')](db[_0x7bdb('0x78')],{'as':'Answers','foreignKey':_0x7bdb('0x17b')});db[_0x7bdb('0x13a')][_0x7bdb('0x104')](db[_0x7bdb('0x57')],{'as':_0x7bdb('0x152'),'foreignKey':'SmsAccountId'});db[_0x7bdb('0x13a')][_0x7bdb('0x104')](db['SmsInteraction'],{'as':_0x7bdb('0x162')});db[_0x7bdb('0x13a')][_0x7bdb('0x104')](db[_0x7bdb('0x53')],{'as':'Applications'});db['SmsAccount']['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x13a')][_0x7bdb('0x14a')](db[_0x7bdb('0x7f')],{'as':_0x7bdb('0x14d'),'foreignKey':_0x7bdb('0x14e')});db['SmsAccount'][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':'user_has_sms_accounts'});db[_0x7bdb('0x53')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x53')][_0x7bdb('0x14a')](db['SmsQueue'],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x53')]['belongsTo'](db[_0x7bdb('0x13a')],{'onDelete':'restrict'});db['SmsApplication'][_0x7bdb('0x14a')](db[_0x7bdb('0x171')],{'onDelete':_0x7bdb('0x170'),'foreignKey':'IntervalId'});db[_0x7bdb('0x53')][_0x7bdb('0x14a')](db[_0x7bdb('0x86')],{'onDelete':'restrict','foreignKey':_0x7bdb('0x172')});db['SmsInteraction'][_0x7bdb('0x104')](db[_0x7bdb('0x57')],{'as':_0x7bdb('0x152'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x17c')});db[_0x7bdb('0x55')][_0x7bdb('0x14a')](db[_0x7bdb('0x13a')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x17b')});db[_0x7bdb('0x55')]['belongsTo'](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x55')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x169'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x55')][_0x7bdb('0x114')](db[_0x7bdb('0x86')],{'through':'sms_interaction_has_tags','as':_0x7bdb('0x16b')});db[_0x7bdb('0x55')][_0x7bdb('0x114')](db['Tag'],{'through':_0x7bdb('0x17d'),'as':_0x7bdb('0x17e')});db['SmsInteraction'][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':_0x7bdb('0x11f'),'foreignKey':_0x7bdb('0x17c')});db[_0x7bdb('0x57')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x13')});db[_0x7bdb('0x57')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x15b')});db[_0x7bdb('0x57')][_0x7bdb('0x14a')](db[_0x7bdb('0x55')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x16e'),'foreignKey':_0x7bdb('0x17c')});db[_0x7bdb('0x57')][_0x7bdb('0x14a')](db['SmsAccount'],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x17b')});db[_0x7bdb('0x59')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':'Agents','through':_0x7bdb('0x33'),'foreignKey':_0x7bdb('0x17f')});db[_0x7bdb('0x59')][_0x7bdb('0x114')](db[_0x7bdb('0x119')],{'through':_0x7bdb('0x180'),'as':_0x7bdb('0x14f')});db[_0x7bdb('0x181')][_0x7bdb('0x104')](db[_0x7bdb('0x7a')],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x182'),'onDelete':_0x7bdb('0x102')});db['OpenchannelAccount']['hasMany'](db[_0x7bdb('0x78')],{'as':_0x7bdb('0x161'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x7bdb('0x104')](db[_0x7bdb('0x120')],{'as':_0x7bdb('0x162'),'foreignKey':_0x7bdb('0x182')});db[_0x7bdb('0x181')][_0x7bdb('0x104')](db['OpenchannelMessage'],{'as':_0x7bdb('0x152'),'foreignKey':_0x7bdb('0x182')});db['OpenchannelAccount'][_0x7bdb('0x104')](db[_0x7bdb('0x5a')],{'as':_0x7bdb('0x142'),'foreignKey':_0x7bdb('0x182')});db[_0x7bdb('0x181')]['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x181')][_0x7bdb('0x14a')](db[_0x7bdb('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x7bdb('0x14e')});db[_0x7bdb('0x181')]['belongsToMany'](db[_0x7bdb('0x13')],{'as':'Agents','through':_0x7bdb('0x139')});db[_0x7bdb('0x5a')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':'restrict'});db[_0x7bdb('0x5a')][_0x7bdb('0x14a')](db[_0x7bdb('0x5e')],{'onDelete':'restrict','foreignKey':_0x7bdb('0x183')});db[_0x7bdb('0x5a')][_0x7bdb('0x14a')](db[_0x7bdb('0x181')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x182')});db[_0x7bdb('0x5a')]['belongsTo'](db[_0x7bdb('0x171')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x5a')]['belongsTo'](db[_0x7bdb('0x86')],{'onDelete':_0x7bdb('0x170'),'foreignKey':'TagId'});db[_0x7bdb('0x120')]['hasMany'](db[_0x7bdb('0x5c')],{'as':_0x7bdb('0x152'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x184')});db['OpenchannelInteraction'][_0x7bdb('0x14a')](db[_0x7bdb('0x181')],{'as':_0x7bdb('0x168'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':'ContactId'});db[_0x7bdb('0x120')][_0x7bdb('0x14a')](db['User'],{'as':_0x7bdb('0x169'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0x120')][_0x7bdb('0x114')](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x185'),'as':'Tags'});db[_0x7bdb('0x120')][_0x7bdb('0x114')](db['Tag'],{'through':_0x7bdb('0x185'),'as':'ThroughTags'});db[_0x7bdb('0x120')]['belongsToMany'](db['User'],{'as':_0x7bdb('0x16c'),'through':_0x7bdb('0x122'),'foreignKey':_0x7bdb('0x184')});db['OpenchannelMessage'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x102'),'as':'User'});db[_0x7bdb('0x5c')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'onDelete':'cascade','as':_0x7bdb('0x15b')});db[_0x7bdb('0x5c')][_0x7bdb('0x14a')](db[_0x7bdb('0x120')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x16e'),'foreignKey':_0x7bdb('0x184')});db[_0x7bdb('0x5c')][_0x7bdb('0x14a')](db['Attachment'],{'as':_0x7bdb('0xde'),'foreignKey':'AttachmentId'});db[_0x7bdb('0x5c')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x7bdb('0x182')});db[_0x7bdb('0x5e')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x7bdb('0x183')});db[_0x7bdb('0x5e')]['belongsToMany'](db[_0x7bdb('0x119')],{'through':_0x7bdb('0x186'),'as':_0x7bdb('0x14f')});db[_0x7bdb('0x5f')][_0x7bdb('0x104')](db['Disposition'],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x187'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x5f')][_0x7bdb('0x104')](db[_0x7bdb('0x78')],{'as':_0x7bdb('0x161'),'foreignKey':_0x7bdb('0x187')});db[_0x7bdb('0x5f')]['hasMany'](db[_0x7bdb('0x6a')],{'as':_0x7bdb('0x188')});db['ChatWebsite'][_0x7bdb('0x104')](db['ChatInteraction'],{'as':_0x7bdb('0x162')});db['ChatWebsite']['hasMany'](db['ChatApplication'],{'as':_0x7bdb('0x142')});db[_0x7bdb('0x5f')][_0x7bdb('0x104')](db[_0x7bdb('0x189')],{'as':_0x7bdb('0x152')});db[_0x7bdb('0x5f')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x5f')][_0x7bdb('0x14a')](db['Interval'],{'as':'Interval','foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x5f')]['belongsTo'](db['MailAccount'],{'as':_0x7bdb('0x136'),'foreignKey':_0x7bdb('0x15d')});db['ChatWebsite']['belongsTo'](db[_0x7bdb('0x7f')],{'as':_0x7bdb('0x14d'),'foreignKey':_0x7bdb('0x14e')});db[_0x7bdb('0x5f')]['belongsToMany'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x181')],{});db[_0x7bdb('0x61')]['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x61')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x7bdb('0x120')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x7bdb('0x5c')],{});db[_0x7bdb('0x61')][_0x7bdb('0x14a')](db['User'],{});db[_0x7bdb('0x61')][_0x7bdb('0x14a')](db[_0x7bdb('0x5e')],{});db[_0x7bdb('0x18a')][_0x7bdb('0x14a')](db['User'],{'as':_0x7bdb('0x18b'),'foreignKey':'UserId','onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x18a')][_0x7bdb('0x14a')](db['ChatQueue'],{'as':_0x7bdb('0x18c'),'foreignKey':_0x7bdb('0x18d'),'onDelete':'restrict'});db[_0x7bdb('0x18a')][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{'as':'Website','foreignKey':_0x7bdb('0x187'),'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x18a')][_0x7bdb('0x14a')](db[_0x7bdb('0x86')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x172')});db[_0x7bdb('0x10b')][_0x7bdb('0x104')](db[_0x7bdb('0x189')],{'as':_0x7bdb('0x152'),'onDelete':_0x7bdb('0x102'),'foreignKey':'ChatInteractionId'});db['ChatInteraction']['belongsTo'](db[_0x7bdb('0x5f')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x187')});db['ChatInteraction'][_0x7bdb('0x14a')](db['CmContact'],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x10b')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x169'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0x7bdb('0x18e'),'as':'Tags'});db[_0x7bdb('0x10b')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x7bdb('0x17e')});db[_0x7bdb('0x10b')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':_0x7bdb('0x11d'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x13')});db[_0x7bdb('0x189')][_0x7bdb('0x14a')](db['CmContact'],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x15b'),'foreignKey':'ContactId'});db[_0x7bdb('0x189')][_0x7bdb('0x14a')](db[_0x7bdb('0x10b')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x16e'),'foreignKey':_0x7bdb('0x18f')});db[_0x7bdb('0x189')]['belongsTo'](db[_0x7bdb('0xde')],{'as':_0x7bdb('0xde'),'foreignKey':_0x7bdb('0x178')});db['ChatMessage'][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{'as':'Account','foreignKey':_0x7bdb('0x187')});db[_0x7bdb('0x66')][_0x7bdb('0x104')](db[_0x7bdb('0xde')],{'as':_0x7bdb('0x16d'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x7bdb('0x102'),'hooks':!![]});db['ChatOfflineMessage'][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x66')]['belongsTo'](db[_0x7bdb('0x5f')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x187')});db[_0x7bdb('0x129')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x190'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x7bdb('0x119')],{'through':_0x7bdb('0x191'),'as':'Teams'});db[_0x7bdb('0x69')]['hasMany'](db[_0x7bdb('0xc4')],{'as':_0x7bdb('0x152'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x7bdb('0x69')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x146'),'through':_0x7bdb('0x113')});db['ChatProactiveAction'][_0x7bdb('0x14a')](db['ChatWebsite'],{'as':_0x7bdb('0x192'),'foreignKey':_0x7bdb('0x187')});db[_0x7bdb('0x6b')][_0x7bdb('0x104')](db['CmContact'],{'as':'Contacts','foreignKey':_0x7bdb('0x193')});db['CmContact'][_0x7bdb('0x104')](db[_0x7bdb('0x194')],{'as':_0x7bdb('0x195'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0x109')],{'as':'HopperFinals','foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x115')]['hasMany'](db[_0x7bdb('0x6f')],{'as':_0x7bdb('0x196'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x115')]['hasMany'](db[_0x7bdb('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0xc9')],{'as':_0x7bdb('0x149'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0x120')],{'as':_0x7bdb('0x121'),'foreignKey':_0x7bdb('0x15c'),'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0x10b')],{'as':'ChatInteractions','foreignKey':_0x7bdb('0x15c'),'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0x55')],{'as':_0x7bdb('0x10d'),'foreignKey':'ContactId','onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x115')][_0x7bdb('0x104')](db[_0x7bdb('0x4b')],{'as':_0x7bdb('0x10e'),'foreignKey':_0x7bdb('0x15c'),'onDelete':_0x7bdb('0x170')});db['CmContact'][_0x7bdb('0x104')](db[_0x7bdb('0x3f')],{'as':_0x7bdb('0x11b'),'foreignKey':_0x7bdb('0x15c'),'onDelete':_0x7bdb('0x170')});db['CmContact'][_0x7bdb('0x14a')](db['CmCompany'],{'as':_0x7bdb('0x197'),'foreignKey':'CompanyId'});db[_0x7bdb('0x115')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x115')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':_0x7bdb('0x116')});db[_0x7bdb('0x115')][_0x7bdb('0x114')](db['Tag'],{'as':'Tags','through':_0x7bdb('0x198')});db['CmContact'][_0x7bdb('0x114')](db['Tag'],{'through':_0x7bdb('0x198'),'as':_0x7bdb('0x17e')});db[_0x7bdb('0x194')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x194')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':'List','foreignKey':_0x7bdb('0x164'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x194')]['belongsTo'](db[_0x7bdb('0x13')],{'as':'Agent','foreignKey':_0x7bdb('0x103')});db['CmHopper'][_0x7bdb('0x14a')](db[_0x7bdb('0x124')],{'as':'Queue','foreignKey':_0x7bdb('0x147'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x194')][_0x7bdb('0x14a')](db[_0x7bdb('0x199')],{'as':_0x7bdb('0x199'),'foreignKey':'CampaignId','onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x194')]['belongsTo'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x169'),'foreignKey':_0x7bdb('0x19a')});db['CmHopperBlack'][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c'),'onDelete':'cascade'});db[_0x7bdb('0x6d')]['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x6d')][_0x7bdb('0x14a')](db[_0x7bdb('0x124')],{'as':'Queue','foreignKey':_0x7bdb('0x147'),'onDelete':'cascade'});db['CmHopperBlack'][_0x7bdb('0x14a')](db[_0x7bdb('0x199')],{'as':_0x7bdb('0x199'),'foreignKey':_0x7bdb('0x19b'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x76')][_0x7bdb('0x104')](db[_0x7bdb('0x7c')],{'as':{'plural':'All','singular':_0x7bdb('0x19c')},'foreignKey':_0x7bdb('0x19d'),'onDelete':_0x7bdb('0x102'),'hooks':!![]});db[_0x7bdb('0x76')][_0x7bdb('0x104')](db[_0x7bdb('0x7c')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x7bdb('0x19e'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0x7bdb('0x19f')],{'as':_0x7bdb('0x1a0'),'foreignKey':_0x7bdb('0x1a1'),'onDelete':_0x7bdb('0x102'),'hooks':!![]});db[_0x7bdb('0x7a')][_0x7bdb('0x104')](db[_0x7bdb('0x7a')],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x1a2'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x171')][_0x7bdb('0x104')](db[_0x7bdb('0x171')],{'as':_0x7bdb('0x1a3'),'foreignKey':_0x7bdb('0x14c'),'onDelete':_0x7bdb('0x102'),'hooks':!![],'required':![]});db[_0x7bdb('0x171')]['hasMany'](db['VoiceExtension'],{'as':_0x7bdb('0x108'),'foreignKey':_0x7bdb('0x14c'),'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x171')][_0x7bdb('0x104')](db[_0x7bdb('0x43')],{'as':_0x7bdb('0x1a4'),'foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x171')]['hasMany'](db[_0x7bdb('0x18a')],{'as':_0x7bdb('0x1a5'),'foreignKey':'IntervalId'});db[_0x7bdb('0x171')][_0x7bdb('0x104')](db[_0x7bdb('0x49')],{'as':'FaxApplications','foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x171')][_0x7bdb('0x104')](db[_0x7bdb('0x53')],{'as':'SmsApplications','foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x1a6')][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{});db[_0x7bdb('0x1a6')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x7bdb('0x1a7')});db[_0x7bdb('0x1a6')][_0x7bdb('0x14a')](db[_0x7bdb('0x8d')],{'foreignKey':_0x7bdb('0x1a8')});db[_0x7bdb('0x143')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x7bdb('0x1a9'),'through':_0x7bdb('0x145'),'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0x86')][_0x7bdb('0x114')](db[_0x7bdb('0x115')],{'through':_0x7bdb('0x198')});db[_0x7bdb('0x86')][_0x7bdb('0x114')](db['ChatInteraction'],{'through':_0x7bdb('0x18e')});db[_0x7bdb('0x86')]['belongsToMany'](db[_0x7bdb('0x3f')],{'through':_0x7bdb('0x16a')});db[_0x7bdb('0x86')][_0x7bdb('0x114')](db[_0x7bdb('0x55')],{'through':_0x7bdb('0x17d')});db['Tag'][_0x7bdb('0x114')](db[_0x7bdb('0x4b')],{'through':_0x7bdb('0x176')});db[_0x7bdb('0x86')][_0x7bdb('0x114')](db[_0x7bdb('0x120')],{'through':_0x7bdb('0x185')});db[_0x7bdb('0x86')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x7bdb('0x1aa')][_0x7bdb('0x104')](db[_0x7bdb('0x7c')],{'as':{'plural':_0x7bdb('0x1ab'),'singular':_0x7bdb('0x1ac')},'foreignKey':_0x7bdb('0x1ad'),'onDelete':_0x7bdb('0x102'),'hooks':!![]});db[_0x7bdb('0x1aa')][_0x7bdb('0x104')](db[_0x7bdb('0x7c')],{'as':{'plural':_0x7bdb('0x1ae'),'singular':_0x7bdb('0x1af')},'foreignKey':_0x7bdb('0x1b0'),'onDelete':_0x7bdb('0x102'),'hooks':!![]});db[_0x7bdb('0x1aa')][_0x7bdb('0x104')](db['Action'],{'as':_0x7bdb('0x1a0'),'foreignKey':'TriggerId','onDelete':_0x7bdb('0x102'),'hooks':!![]});db[_0x7bdb('0x8d')]['hasMany'](db[_0x7bdb('0x1b1')],{'as':_0x7bdb('0x1b2'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1a8'),'hooks':!![]});db[_0x7bdb('0x1b3')][_0x7bdb('0x104')](db[_0x7bdb('0x1b1')],{'as':_0x7bdb('0x1b2'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1a7')});db[_0x7bdb('0x91')]['hasMany'](db[_0x7bdb('0x1b1')],{'as':_0x7bdb('0x1b2'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1b4')});db[_0x7bdb('0x1b1')]['belongsTo'](db[_0x7bdb('0x91')],{'foreignKey':_0x7bdb('0x1b4')});db[_0x7bdb('0x95')][_0x7bdb('0x104')](db[_0x7bdb('0x96')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x96')]['hasMany'](db[_0x7bdb('0x98')],{'as':_0x7bdb('0x1b7'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x96')][_0x7bdb('0x104')](db[_0x7bdb('0x98')],{'as':_0x7bdb('0x1b9'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0x96')]['hasMany'](db['SalesforceField'],{'as':_0x7bdb('0x1b2'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0x96')][_0x7bdb('0x14a')](db[_0x7bdb('0x95')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x98')][_0x7bdb('0x104')](db['SalesforceField'],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x98')][_0x7bdb('0x104')](db[_0x7bdb('0x98')],{'as':_0x7bdb('0x1bd'),'foreignKey':_0x7bdb('0x1ba')});db['SalesforceField'][_0x7bdb('0x104')](db['SalesforceField'],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0x98')]['belongsTo'](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0x1c0')][_0x7bdb('0x104')](db[_0x7bdb('0x9a')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db['SugarcrmConfiguration'][_0x7bdb('0x104')](db[_0x7bdb('0x9b')],{'as':_0x7bdb('0x1b7'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x9a')]['hasMany'](db[_0x7bdb('0x9b')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7bdb('0x9a')]['hasMany'](db[_0x7bdb('0x9b')],{'as':_0x7bdb('0x1b2'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1bb')});db['SugarcrmConfiguration']['belongsTo'](db[_0x7bdb('0x1c0')],{'as':'Account','foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x9b')][_0x7bdb('0x104')](db['SugarcrmField'],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db['SugarcrmField'][_0x7bdb('0x104')](db['SugarcrmField'],{'as':_0x7bdb('0x1bd'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0x9b')][_0x7bdb('0x104')](db[_0x7bdb('0x9b')],{'as':'Field','foreignKey':_0x7bdb('0x1bb')});db['SugarcrmField'][_0x7bdb('0x14a')](db['Variable'],{'as':'Variable','foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0x9c')][_0x7bdb('0x104')](db[_0x7bdb('0x1c1')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db['DeskConfiguration'][_0x7bdb('0x104')](db[_0x7bdb('0x9e')],{'as':_0x7bdb('0x1b7'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b8')});db['DeskConfiguration'][_0x7bdb('0x104')](db['DeskField'],{'as':_0x7bdb('0x1b9'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0x1c1')][_0x7bdb('0x104')](db[_0x7bdb('0x9e')],{'as':_0x7bdb('0x1b2'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0x1c1')][_0x7bdb('0x14a')](db[_0x7bdb('0x9c')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x1c1')][_0x7bdb('0x114')](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x1c2')});db[_0x7bdb('0x9e')][_0x7bdb('0x104')](db[_0x7bdb('0x9e')],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x9e')][_0x7bdb('0x104')](db['DeskField'],{'as':_0x7bdb('0x1bd'),'foreignKey':'DescriptionId'});db[_0x7bdb('0x9e')][_0x7bdb('0x104')](db[_0x7bdb('0x9e')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0x9e')][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':'VariableId'});db[_0x7bdb('0xa0')][_0x7bdb('0x104')](db[_0x7bdb('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0xa1')][_0x7bdb('0x104')](db[_0x7bdb('0xa3')],{'as':_0x7bdb('0x1b7'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xa1')][_0x7bdb('0x104')](db[_0x7bdb('0xa3')],{'as':'Descriptions','onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0xa1')]['hasMany'](db['ZohoField'],{'as':_0x7bdb('0x1b2'),'onDelete':_0x7bdb('0x102'),'foreignKey':'FieldId'});db[_0x7bdb('0xa1')]['belongsTo'](db[_0x7bdb('0xa0')],{'as':_0x7bdb('0x168'),'foreignKey':'AccountId'});db['ZohoField'][_0x7bdb('0x104')](db[_0x7bdb('0xa3')],{'as':_0x7bdb('0x1bc'),'foreignKey':'SubjectId'});db['ZohoField'][_0x7bdb('0x104')](db[_0x7bdb('0xa3')],{'as':_0x7bdb('0x1bd'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0xa3')][_0x7bdb('0x104')](db[_0x7bdb('0xa3')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db['ZohoField'][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0xa5')][_0x7bdb('0x104')](db[_0x7bdb('0xa7')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':'AccountId'});db[_0x7bdb('0xa7')][_0x7bdb('0x104')](db['ZendeskField'],{'as':_0x7bdb('0x1b7'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xa7')][_0x7bdb('0x104')](db[_0x7bdb('0xa9')],{'as':_0x7bdb('0x1b9'),'foreignKey':'DescriptionId'});db[_0x7bdb('0xa7')][_0x7bdb('0x104')](db[_0x7bdb('0xa9')],{'as':'Fields','foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xa7')][_0x7bdb('0x14a')](db[_0x7bdb('0xa5')],{'as':_0x7bdb('0x168'),'foreignKey':'AccountId'});db[_0x7bdb('0xa7')]['belongsToMany'](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x1c3')});db[_0x7bdb('0xa9')]['hasMany'](db['ZendeskField'],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xa9')][_0x7bdb('0x104')](db[_0x7bdb('0xa9')],{'as':_0x7bdb('0x1bd'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0xa9')][_0x7bdb('0x104')](db[_0x7bdb('0xa9')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xa9')][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':'VariableId'});db[_0x7bdb('0xab')][_0x7bdb('0x104')](db['FreshdeskConfiguration'],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x1c4')]['hasMany'](db[_0x7bdb('0xae')],{'as':'Subjects','onDelete':_0x7bdb('0x102'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x7bdb('0x104')](db[_0x7bdb('0xae')],{'as':'Descriptions','onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0x1c4')][_0x7bdb('0x104')](db[_0x7bdb('0xae')],{'as':_0x7bdb('0x1b2'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1bb')});db['FreshdeskConfiguration'][_0x7bdb('0x14a')](db[_0x7bdb('0xab')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1b6')});db['FreshdeskConfiguration'][_0x7bdb('0x114')](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x1c5')});db['FreshdeskField'][_0x7bdb('0x104')](db[_0x7bdb('0xae')],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xae')][_0x7bdb('0x104')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x7bdb('0x104')](db[_0x7bdb('0xae')],{'as':_0x7bdb('0x1be'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db[_0x7bdb('0x1c6')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x1c6')][_0x7bdb('0x104')](db[_0x7bdb('0xb3')],{'as':_0x7bdb('0x1b7'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x1c6')]['hasMany'](db[_0x7bdb('0xb3')],{'as':_0x7bdb('0x1b9'),'foreignKey':'DescriptionId'});db[_0x7bdb('0x1c6')][_0x7bdb('0x104')](db[_0x7bdb('0xb3')],{'as':'Fields','foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0x1c6')][_0x7bdb('0x14a')](db[_0x7bdb('0xb0')],{'as':'Account','foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0xb3')][_0x7bdb('0x104')](db[_0x7bdb('0xb3')],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xb3')]['hasMany'](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField'][_0x7bdb('0x104')](db[_0x7bdb('0xb3')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xb3')]['belongsTo'](db[_0x7bdb('0x8a')],{'as':'Variable','foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0x1c7')][_0x7bdb('0x104')](db[_0x7bdb('0x1c8')],{'as':'Configurations','onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x1c8')][_0x7bdb('0x104')](db[_0x7bdb('0xb7')],{'as':_0x7bdb('0x1b7'),'foreignKey':'SubjectId'});db[_0x7bdb('0x1c8')][_0x7bdb('0x104')](db[_0x7bdb('0xb7')],{'as':_0x7bdb('0x1b9'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x7bdb('0x1b2'),'foreignKey':'FieldId'});db[_0x7bdb('0x1c8')][_0x7bdb('0x14a')](db['ServicenowAccount'],{'as':_0x7bdb('0x168'),'foreignKey':'AccountId'});db[_0x7bdb('0xb7')][_0x7bdb('0x104')](db[_0x7bdb('0xb7')],{'as':_0x7bdb('0x1bc'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xb7')][_0x7bdb('0x104')](db[_0x7bdb('0xb7')],{'as':_0x7bdb('0x1bd'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x7bdb('0x104')](db[_0x7bdb('0xb7')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xb7')]['belongsTo'](db['Variable'],{'as':_0x7bdb('0x8a'),'foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0xb9')][_0x7bdb('0x104')](db[_0x7bdb('0xba')],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0x7bdb('0x104')](db[_0x7bdb('0xbc')],{'as':_0x7bdb('0x1b7'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xba')][_0x7bdb('0x104')](db[_0x7bdb('0xbc')],{'as':'Descriptions','onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1ba')});db['Dynamics365Configuration'][_0x7bdb('0x104')](db[_0x7bdb('0xbc')],{'as':_0x7bdb('0x1b2'),'onDelete':'cascade','foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xba')]['belongsTo'](db['Dynamics365Account'],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0xbc')][_0x7bdb('0x104')](db['Dynamics365Field'],{'as':_0x7bdb('0x1bc'),'foreignKey':'SubjectId'});db[_0x7bdb('0xbc')][_0x7bdb('0x104')](db[_0x7bdb('0xbc')],{'as':_0x7bdb('0x1bd'),'foreignKey':'DescriptionId'});db[_0x7bdb('0xbc')][_0x7bdb('0x104')](db[_0x7bdb('0xbc')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db['Dynamics365Field'][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':_0x7bdb('0x1bf')});db['FreshsalesAccount'][_0x7bdb('0x104')](db['FreshsalesConfiguration'],{'as':_0x7bdb('0x1b5'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0x1c9')][_0x7bdb('0x104')](db[_0x7bdb('0xc0')],{'as':_0x7bdb('0x1b7'),'foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0x1c9')][_0x7bdb('0x104')](db[_0x7bdb('0xc0')],{'as':_0x7bdb('0x1b9'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0x1c9')][_0x7bdb('0x104')](db[_0x7bdb('0xc0')],{'as':_0x7bdb('0x1b2'),'foreignKey':_0x7bdb('0x1bb')});db['FreshsalesConfiguration'][_0x7bdb('0x14a')](db['FreshsalesAccount'],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1b6')});db[_0x7bdb('0xc0')]['hasMany'](db['FreshsalesField'],{'as':'Subject','foreignKey':_0x7bdb('0x1b8')});db[_0x7bdb('0xc0')][_0x7bdb('0x104')](db[_0x7bdb('0xc0')],{'as':_0x7bdb('0x1bd'),'foreignKey':_0x7bdb('0x1ba')});db[_0x7bdb('0xc0')][_0x7bdb('0x104')](db[_0x7bdb('0xc0')],{'as':_0x7bdb('0x1be'),'foreignKey':_0x7bdb('0x1bb')});db[_0x7bdb('0xc0')][_0x7bdb('0x14a')](db[_0x7bdb('0x8a')],{'as':_0x7bdb('0x8a'),'foreignKey':_0x7bdb('0x1bf')});db[_0x7bdb('0xc3')][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{});db[_0x7bdb('0xc3')][_0x7bdb('0x14a')](db['CmList'],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0xc3')]['belongsTo'](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db['ChatQueueReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x10b')],{});db[_0x7bdb('0xc3')][_0x7bdb('0x14a')](db[_0x7bdb('0x189')],{});db[_0x7bdb('0xc3')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{});db[_0x7bdb('0xc3')][_0x7bdb('0x14a')](db['ChatQueue'],{});db['ChatInternalMessage']['belongsTo'](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1ca')});db[_0x7bdb('0xc4')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x1cb')});db[_0x7bdb('0xc9')][_0x7bdb('0x104')](db[_0x7bdb('0xc8')],{'foreignKey':'SessionId','onDelete':_0x7bdb('0x102')});db[_0x7bdb('0xc9')][_0x7bdb('0x104')](db['JscriptyAnswerReport'],{'foreignKey':_0x7bdb('0x1cc'),'onDelete':'cascade'});db[_0x7bdb('0xcb')][_0x7bdb('0x14a')](db[_0x7bdb('0x13a')],{});db['SmsQueueReport']['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db['SmsQueueReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db[_0x7bdb('0xcb')]['belongsTo'](db[_0x7bdb('0x55')],{});db[_0x7bdb('0xcb')]['belongsTo'](db[_0x7bdb('0x57')],{});db['SmsQueueReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{});db[_0x7bdb('0xcb')][_0x7bdb('0x14a')](db['SmsQueue'],{});db[_0x7bdb('0xd0')][_0x7bdb('0x104')](db[_0x7bdb('0xc9')],{'foreignKey':_0x7bdb('0x1cd')});db['JscriptyProject'][_0x7bdb('0x104')](db[_0x7bdb('0xc8')],{'foreignKey':_0x7bdb('0x1cd')});db['JscriptyProject'][_0x7bdb('0x104')](db[_0x7bdb('0xc6')],{'foreignKey':_0x7bdb('0x1cd')});db[_0x7bdb('0xd5')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':'user_has_square_projects'});db['Team'][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':'Agents','through':_0x7bdb('0x11a')});db[_0x7bdb('0x119')][_0x7bdb('0x114')](db[_0x7bdb('0x124')],{'through':_0x7bdb('0xfc'),'as':_0x7bdb('0x125')});db['Team'][_0x7bdb('0x114')](db[_0x7bdb('0x3d')],{'through':_0x7bdb('0x1ce'),'as':_0x7bdb('0x128')});db[_0x7bdb('0x119')]['belongsToMany'](db[_0x7bdb('0x129')],{'through':'team_has_chat_queues','as':_0x7bdb('0x12a')});db[_0x7bdb('0x119')][_0x7bdb('0x114')](db[_0x7bdb('0x12b')],{'through':_0x7bdb('0x179'),'as':'FaxQueues'});db[_0x7bdb('0x119')][_0x7bdb('0x114')](db[_0x7bdb('0x59')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team']['belongsToMany'](db[_0x7bdb('0x5e')],{'through':_0x7bdb('0x186'),'as':'OpenchannelQueues'});db[_0x7bdb('0x119')][_0x7bdb('0x114')](db['WhatsappQueue'],{'through':_0x7bdb('0x1cf'),'as':_0x7bdb('0x1d0')});db[_0x7bdb('0x119')][_0x7bdb('0x114')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db['Campaign'][_0x7bdb('0x104')](db[_0x7bdb('0x194')],{'as':_0x7bdb('0x195'),'foreignKey':_0x7bdb('0x19b')});db[_0x7bdb('0x199')][_0x7bdb('0x104')](db[_0x7bdb('0x109')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x7bdb('0x199')][_0x7bdb('0x104')](db[_0x7bdb('0x6f')],{'as':'HopperHistories','foreignKey':_0x7bdb('0x19b')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0x7bdb('0x148'),'foreignKey':'CampaignId'});db[_0x7bdb('0x199')][_0x7bdb('0x14a')](db[_0x7bdb('0x2a')],{'as':'Trunk','foreignKey':_0x7bdb('0x14b')});db[_0x7bdb('0x199')][_0x7bdb('0x14a')](db[_0x7bdb('0x2a')],{'as':'TrunkBackup','foreignKey':_0x7bdb('0x1d1')});db['Campaign'][_0x7bdb('0x14a')](db['Interval'],{'as':_0x7bdb('0x171'),'foreignKey':_0x7bdb('0x14c')});db[_0x7bdb('0x199')][_0x7bdb('0x14a')](db[_0x7bdb('0xd5')],{'as':_0x7bdb('0xd5'),'foreignKey':_0x7bdb('0x1d2')});db['Campaign'][_0x7bdb('0x114')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x117'),'through':'campaigns_has_cm_lists'});db[_0x7bdb('0x199')][_0x7bdb('0x114')](db['CmList'],{'as':'BlackLists','through':_0x7bdb('0x1d3')});db[_0x7bdb('0xde')][_0x7bdb('0x14a')](db[_0x7bdb('0x66')],{'as':_0x7bdb('0x66'),'foreignKey':_0x7bdb('0x16f')});db[_0x7bdb('0xe1')][_0x7bdb('0x14a')](db[_0x7bdb('0x41')],{});db[_0x7bdb('0xe1')][_0x7bdb('0x14a')](db['MailInteraction'],{});db[_0x7bdb('0xe1')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x7bdb('0x1d4'),'as':'FromAccount'});db[_0x7bdb('0xe1')][_0x7bdb('0x14a')](db['User'],{'foreignKey':_0x7bdb('0x1d5'),'as':_0x7bdb('0x1d6')});db['MailTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':'ToAgent'});db[_0x7bdb('0xe1')]['belongsTo'](db[_0x7bdb('0x3d')],{'foreignKey':_0x7bdb('0x1d8'),'as':'ToQueue'});db['MailTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x136')],{'foreignKey':_0x7bdb('0x1d9'),'as':'ToAccount'});db[_0x7bdb('0x1da')]['belongsTo'](db[_0x7bdb('0x189')],{});db[_0x7bdb('0x1da')][_0x7bdb('0x14a')](db['ChatInteraction'],{});db[_0x7bdb('0x1da')][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{'foreignKey':_0x7bdb('0x1db'),'as':_0x7bdb('0x1dc')});db[_0x7bdb('0x1da')][_0x7bdb('0x14a')](db['User'],{'foreignKey':_0x7bdb('0x1d5'),'as':_0x7bdb('0x1d6')});db[_0x7bdb('0x1da')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':'ToAgent'});db[_0x7bdb('0x1da')][_0x7bdb('0x14a')](db['ChatQueue'],{'foreignKey':_0x7bdb('0x1dd'),'as':_0x7bdb('0x1de')});db['ChatTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x5f')],{'foreignKey':_0x7bdb('0x1df'),'as':'ToAccount'});db[_0x7bdb('0xe4')][_0x7bdb('0x14a')](db[_0x7bdb('0x4d')],{});db[_0x7bdb('0xe4')][_0x7bdb('0x14a')](db['FaxInteraction'],{});db[_0x7bdb('0xe4')]['belongsTo'](db[_0x7bdb('0x48')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x7bdb('0xe4')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d5'),'as':'FromAgent'});db['FaxTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':_0x7bdb('0x1e0')});db[_0x7bdb('0xe4')][_0x7bdb('0x14a')](db[_0x7bdb('0x12b')],{'foreignKey':_0x7bdb('0x1e1'),'as':_0x7bdb('0x1de')});db[_0x7bdb('0xe4')][_0x7bdb('0x14a')](db['FaxAccount'],{'foreignKey':_0x7bdb('0x1e2'),'as':'ToAccount'});db[_0x7bdb('0xe6')][_0x7bdb('0x14a')](db[_0x7bdb('0x5c')],{});db[_0x7bdb('0xe6')][_0x7bdb('0x14a')](db[_0x7bdb('0x120')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x7bdb('0x181')],{'foreignKey':'FromOpenchannelAccountId','as':_0x7bdb('0x1dc')});db[_0x7bdb('0xe6')]['belongsTo'](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d5'),'as':_0x7bdb('0x1d6')});db[_0x7bdb('0xe6')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':_0x7bdb('0x1e0')});db[_0x7bdb('0xe6')][_0x7bdb('0x14a')](db[_0x7bdb('0x5e')],{'foreignKey':_0x7bdb('0x1e3'),'as':'ToQueue'});db[_0x7bdb('0xe6')][_0x7bdb('0x14a')](db[_0x7bdb('0x181')],{'foreignKey':_0x7bdb('0x1e4'),'as':'ToAccount'});db['SmsTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x57')],{});db[_0x7bdb('0xe8')][_0x7bdb('0x14a')](db['SmsInteraction'],{});db['SmsTransferReport']['belongsTo'](db[_0x7bdb('0x13a')],{'foreignKey':_0x7bdb('0x1e5'),'as':'FromAccount'});db['SmsTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d5'),'as':_0x7bdb('0x1d6')});db[_0x7bdb('0xe8')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':_0x7bdb('0x1e0')});db[_0x7bdb('0xe8')][_0x7bdb('0x14a')](db[_0x7bdb('0x59')],{'foreignKey':'ToSmsQueueId','as':_0x7bdb('0x1de')});db[_0x7bdb('0xe8')][_0x7bdb('0x14a')](db[_0x7bdb('0x13a')],{'foreignKey':'ToSmsAccountId','as':_0x7bdb('0x1e6')});db[_0x7bdb('0x131')]['hasMany'](db['Disposition'],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x164'),'onDelete':_0x7bdb('0x102')});db['CmList'][_0x7bdb('0x104')](db['CmCustomField'],{'as':_0x7bdb('0x1e7'),'foreignKey':'ListId'});db[_0x7bdb('0x131')][_0x7bdb('0x104')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x1e8'),'onDelete':_0x7bdb('0x102'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x131')][_0x7bdb('0x104')](db[_0x7bdb('0x109')],{'as':_0x7bdb('0x10a'),'foreignKey':_0x7bdb('0x164')});db['CmList']['hasMany'](db[_0x7bdb('0x6f')],{'as':_0x7bdb('0x1e9'),'foreignKey':'ListId'});db[_0x7bdb('0x131')][_0x7bdb('0x104')](db[_0x7bdb('0x71')],{'as':_0x7bdb('0x71'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0x131')][_0x7bdb('0x114')](db['VoiceQueue'],{'as':'Queues','through':_0x7bdb('0x1ea')});db[_0x7bdb('0x131')]['belongsToMany'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x118')});db[_0x7bdb('0xeb')][_0x7bdb('0x104')](db[_0x7bdb('0x19')],{'as':_0x7bdb('0x108'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0xeb')][_0x7bdb('0x114')](db['User'],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x100')});db[_0x7bdb('0xeb')]['belongsToMany'](db[_0x7bdb('0x119')],{'through':_0x7bdb('0xfe'),'as':_0x7bdb('0x14f')});db[_0x7bdb('0xed')]['hasMany'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'foreignKey':_0x7bdb('0x112')});db[_0x7bdb('0xed')][_0x7bdb('0x104')](db[_0x7bdb('0x1eb')],{'as':_0x7bdb('0x1ec'),'foreignKey':_0x7bdb('0x112'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x1eb')][_0x7bdb('0x104')](db[_0x7bdb('0xef')],{'as':_0x7bdb('0x1ed'),'foreignKey':_0x7bdb('0x1ee'),'onDelete':_0x7bdb('0x102')});db['WhatsappAccount']['hasMany'](db[_0x7bdb('0x7a')],{'as':_0x7bdb('0x17a'),'foreignKey':_0x7bdb('0x1ef'),'onDelete':_0x7bdb('0x102')});db[_0x7bdb('0x13d')]['hasMany'](db['CannedAnswer'],{'as':_0x7bdb('0x161'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db[_0x7bdb('0xf5')],{'as':_0x7bdb('0x152'),'foreignKey':_0x7bdb('0x1ef')});db['WhatsappAccount'][_0x7bdb('0x104')](db[_0x7bdb('0xf3')],{'as':_0x7bdb('0x162')});db['WhatsappAccount'][_0x7bdb('0x104')](db['WhatsappApplication'],{'as':'Applications'});db['WhatsappAccount']['belongsTo'](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':'ListId'});db[_0x7bdb('0x13d')]['belongsTo'](db[_0x7bdb('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x7bdb('0x14e')});db[_0x7bdb('0x13d')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':'Agents','through':_0x7bdb('0x13e')});db[_0x7bdb('0xf2')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0xf2')][_0x7bdb('0x14a')](db['WhatsappQueue'],{'onDelete':_0x7bdb('0x170')});db[_0x7bdb('0xf2')][_0x7bdb('0x14a')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x7bdb('0xf2')][_0x7bdb('0x14a')](db[_0x7bdb('0x171')],{'onDelete':_0x7bdb('0x170'),'foreignKey':'IntervalId'});db[_0x7bdb('0xf2')][_0x7bdb('0x14a')](db[_0x7bdb('0x86')],{'onDelete':_0x7bdb('0x170'),'foreignKey':_0x7bdb('0x172')});db[_0x7bdb('0xf3')][_0x7bdb('0x104')](db[_0x7bdb('0xf5')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7bdb('0x1f0')});db[_0x7bdb('0xf3')][_0x7bdb('0x14a')](db[_0x7bdb('0x13d')],{'as':_0x7bdb('0x168'),'foreignKey':_0x7bdb('0x1ef')});db['WhatsappInteraction'][_0x7bdb('0x14a')](db['CmContact'],{'as':_0x7bdb('0x15b'),'foreignKey':_0x7bdb('0x15c')});db['WhatsappInteraction'][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x169'),'foreignKey':_0x7bdb('0x103')});db[_0x7bdb('0xf3')]['belongsToMany'](db[_0x7bdb('0x86')],{'through':_0x7bdb('0x1f1'),'as':_0x7bdb('0x16b')});db[_0x7bdb('0xf3')][_0x7bdb('0x114')](db['Tag'],{'through':_0x7bdb('0x1f1'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x16c'),'through':'user_has_whatsapp_interactions','foreignKey':_0x7bdb('0x1f0')});db[_0x7bdb('0xf5')]['belongsTo'](db[_0x7bdb('0x13')],{'as':'User'});db[_0x7bdb('0xf5')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x15b')});db['WhatsappMessage'][_0x7bdb('0x14a')](db['WhatsappInteraction'],{'onDelete':_0x7bdb('0x102'),'as':_0x7bdb('0x16e'),'foreignKey':_0x7bdb('0x1f0')});db[_0x7bdb('0xf5')][_0x7bdb('0x14a')](db[_0x7bdb('0x13d')],{'as':'Account','foreignKey':_0x7bdb('0x1ef')});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0x13d')],{});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0x131')],{'as':_0x7bdb('0x163'),'foreignKey':_0x7bdb('0x164')});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0x115')],{'as':_0x7bdb('0x15b'),'foreignKey':'ContactId'});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0xf3')],{});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db['WhatsappQueue'],{});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0xf5')],{});db[_0x7bdb('0xf6')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{});db[_0x7bdb('0x1f2')][_0x7bdb('0x14a')](db[_0x7bdb('0xf5')],{});db['WhatsappTransferReport'][_0x7bdb('0x14a')](db[_0x7bdb('0xf3')],{});db[_0x7bdb('0x1f2')][_0x7bdb('0x14a')](db[_0x7bdb('0x13d')],{'foreignKey':_0x7bdb('0x1f3'),'as':'FromAccount'});db['WhatsappTransferReport']['belongsTo'](db[_0x7bdb('0x13d')],{'foreignKey':_0x7bdb('0x1f4'),'as':_0x7bdb('0x1e6')});db[_0x7bdb('0x1f2')][_0x7bdb('0x14a')](db[_0x7bdb('0x130')],{'foreignKey':_0x7bdb('0x1f5'),'as':_0x7bdb('0x1de')});db[_0x7bdb('0x1f2')][_0x7bdb('0x14a')](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d5'),'as':_0x7bdb('0x1d6')});db[_0x7bdb('0x1f2')]['belongsTo'](db[_0x7bdb('0x13')],{'foreignKey':_0x7bdb('0x1d7'),'as':_0x7bdb('0x1e0')});db[_0x7bdb('0x130')][_0x7bdb('0x114')](db[_0x7bdb('0x13')],{'as':_0x7bdb('0x166'),'through':_0x7bdb('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x7bdb('0x130')][_0x7bdb('0x114')](db[_0x7bdb('0x119')],{'through':_0x7bdb('0x1cf'),'as':_0x7bdb('0x14f')});module[_0x7bdb('0x1f6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xaa88=['ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','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','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','userProfileId','chat_group_has_users','CmContact','cm_user_has_contacts','belongsToMany','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserSmsQueue','OpenchannelQueues','user_has_chat_websites','MailAccount','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','VoiceAgentReport','uniqueid','Contact','MailServerIn','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','Applications','List','TemplateId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','FaxAccountId','FaxApplication','Exntensions','ListId','user_has_fax_accounts','FaxInteractionId','Tags','fax_interaction_has_tags','Interaction','AttachmentId','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroup','CmCompany','HopperHistories','Company','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticFieldReport','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','AccountId','Description','VariableId','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZendeskField','FreshdeskAccount','VtigerAccount','ServicenowConfiguration','FromId','ToId','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','user_has_square_projects','VoiceQueues','team_has_chat_queues','team_has_fax_queues','FaxQueues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefix','SquareProjectId','Lists','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','HopperHistory','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','mysql','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model'];(function(_0x3c75bd,_0x19d905){var _0x31b3e6=function(_0xc7247a){while(--_0xc7247a){_0x3c75bd['push'](_0x3c75bd['shift']());}};_0x31b3e6(++_0x19d905);}(_0xaa88,0x137));var _0x8aa8=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0xaa88[_0x58eec7];return _0x25c5d3;};'use strict';var config=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var jstz=require(_0x8aa8('0x3'));var timezone=jstz['determine']();config[_0x8aa8('0x1')]=_[_0x8aa8('0x4')](config[_0x8aa8('0x1')],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8aa8('0x9'),'collate':_0x8aa8('0xa')}}});config[_0x8aa8('0xb')]=_[_0x8aa8('0x4')](config['sequelizeHistory'],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8aa8('0xc'),'dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone[_0x8aa8('0xd')](),'define':{'charset':_0x8aa8('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0x1')][_0x8aa8('0xe')],config['sequelize'][_0x8aa8('0xf')],config[_0x8aa8('0x1')][_0x8aa8('0x10')],config['sequelize'][_0x8aa8('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0xb')][_0x8aa8('0xe')],config['sequelizeHistory'][_0x8aa8('0xf')],config['sequelizeHistory']['password'],config[_0x8aa8('0xb')][_0x8aa8('0x11')])};db[_0x8aa8('0x12')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x14'));db[_0x8aa8('0x15')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x8aa8('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0x8aa8('0x16')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x17'));db[_0x8aa8('0x18')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x19'));db[_0x8aa8('0x1a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x1b'));db[_0x8aa8('0x1c')]=db['sequelize'][_0x8aa8('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x8aa8('0x1d')]=db['sequelize'][_0x8aa8('0x13')]('../api/screenRecording/screenRecording.model');db[_0x8aa8('0x1e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMail/voiceMail.model');db[_0x8aa8('0x1f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x20'));db[_0x8aa8('0x21')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x22'));db['VoiceAgentReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x23'));db['VoiceQueueReport']=db['sequelize'][_0x8aa8('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8aa8('0x24')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x25'));db[_0x8aa8('0x26')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x27'));db['VoiceTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x28'));db['UserVoiceQueueRt']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x29'));db[_0x8aa8('0x2a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2b'));db[_0x8aa8('0x2c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2d'));db['UserMailQueue']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x2e'));db[_0x8aa8('0x2f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x30'));db['UserSmsQueue']=db['sequelize'][_0x8aa8('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x8aa8('0x31')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8aa8('0x32')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x8aa8('0x33')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x34'));db['MailAccount']=db['sequelize'][_0x8aa8('0x13')]('../api/mailAccount/mailAccount.model');db[_0x8aa8('0x35')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x36'));db['MailSubstatus']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x8aa8('0x37')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x38'));db[_0x8aa8('0x39')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3a'));db[_0x8aa8('0x3b')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3c'));db[_0x8aa8('0x3d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3e'));db[_0x8aa8('0x3f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/dashboard/dashboard.model');db[_0x8aa8('0x40')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db[_0x8aa8('0x41')]=db['sequelize']['import'](_0x8aa8('0x42'));db['FaxApplication']=db[_0x8aa8('0x1')]['import']('../api/faxApplication/faxApplication.model');db[_0x8aa8('0x43')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x44'));db[_0x8aa8('0x45')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/faxMessage/faxMessage.model');db[_0x8aa8('0x46')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x47'));db[_0x8aa8('0x48')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x49'));db['SmsAccount']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x4a'));db['SmsApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4b'));db['SmsInteraction']=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0x8aa8('0x4c')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x4d'));db[_0x8aa8('0x4e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4f'));db[_0x8aa8('0x50')]=db['sequelize']['import'](_0x8aa8('0x51'));db['OpenchannelApplication']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x52'));db[_0x8aa8('0x53')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x54'));db[_0x8aa8('0x55')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x56'));db[_0x8aa8('0x57')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8aa8('0x58')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db[_0x8aa8('0x59')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5a'));db[_0x8aa8('0x5b')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5c'));db[_0x8aa8('0x5d')]=db[_0x8aa8('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x8aa8('0x5e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x5f'));db['ChatOfflineMessage']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x60'));db[_0x8aa8('0x61')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x62'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db[_0x8aa8('0x63')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x64'));db['CmCompany']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x65'));db['CmContact']=db['sequelize']['import'](_0x8aa8('0x66'));db[_0x8aa8('0x67')]=db['sequelize']['import'](_0x8aa8('0x68'));db[_0x8aa8('0x69')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x6a'));db['CmHopperFinal']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6b'));db['CmHopperHistory']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x6c'));db[_0x8aa8('0x6d')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6e'));db[_0x8aa8('0x6f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x8aa8('0x70')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x71'));db[_0x8aa8('0x72')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x73'));db[_0x8aa8('0x74')]=db[_0x8aa8('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x75'));db[_0x8aa8('0x76')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x77'));db[_0x8aa8('0x78')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x79'));db[_0x8aa8('0x7a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7b'));db[_0x8aa8('0x7c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7d'));db['VoiceQueuesLog']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7e'));db[_0x8aa8('0x7f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x80'));db[_0x8aa8('0x81')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x82'));db[_0x8aa8('0x83')]=db['sequelize'][_0x8aa8('0x13')]('../api/tag/tag.model');db[_0x8aa8('0x84')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x85'));db[_0x8aa8('0x86')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x87'));db[_0x8aa8('0x88')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x89'));db[_0x8aa8('0x8a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8b'));db[_0x8aa8('0x8c')]=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8aa8('0x8d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8e'));db[_0x8aa8('0x8f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x90'));db[_0x8aa8('0x91')]=db['sequelize'][_0x8aa8('0x13')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x92'));db['AnalyticTreeReport']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x93'));db[_0x8aa8('0x94')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x95'));db['SalesforceConfiguration']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x96'));db[_0x8aa8('0x97')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x98'));db[_0x8aa8('0x99')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x9a'));db[_0x8aa8('0x9b')]=db['sequelize']['import'](_0x8aa8('0x9c'));db[_0x8aa8('0x9d')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x9e'));db[_0x8aa8('0x9f')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x8aa8('0xa0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa1'));db['DeskField']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa2'));db[_0x8aa8('0xa3')]=db['sequelize'][_0x8aa8('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa4'));db[_0x8aa8('0xa5')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa6'));db[_0x8aa8('0xa7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa8'));db[_0x8aa8('0xa9')]=db['sequelize']['import'](_0x8aa8('0xaa'));db['ZendeskField']=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xab'));db[_0x8aa8('0xac')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xad'));db[_0x8aa8('0xae')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xaf'));db[_0x8aa8('0xb0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb1'));db[_0x8aa8('0xb2')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb3'));db[_0x8aa8('0xb4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb5'));db['ServicenowConfiguration']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb6'));db[_0x8aa8('0xb7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xb8'));db[_0x8aa8('0xb9')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xba'));db[_0x8aa8('0xbb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbc'));db[_0x8aa8('0xbd')]=db['sequelize'][_0x8aa8('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8aa8('0xbe')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbf'));db[_0x8aa8('0xc0')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xc1'));db[_0x8aa8('0xc2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc3'));db[_0x8aa8('0x8a')]=db['sequelize']['import'](_0x8aa8('0xc4'));db[_0x8aa8('0xc5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc6'));db[_0x8aa8('0xc7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x8aa8('0xc8')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xc9'));db['JscriptyAnswerReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xca'));db[_0x8aa8('0xcb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x8aa8('0xcc')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xcd'));db[_0x8aa8('0xce')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xcf'));db[_0x8aa8('0xd0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd1'));db[_0x8aa8('0xd2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd3'));db['JscriptyProject']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xd4'));db[_0x8aa8('0xd5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd6'));db['SquareOdbc']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xd7'));db[_0x8aa8('0xd8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/squareProject/squareProject.model');db[_0x8aa8('0xd9')]=db[_0x8aa8('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x8aa8('0xda')]=db['sequelize']['import'](_0x8aa8('0xdb'));db[_0x8aa8('0xdc')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xdd'));db[_0x8aa8('0xde')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xdf'));db[_0x8aa8('0xe0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe1'));db[_0x8aa8('0xe2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe3'));db[_0x8aa8('0xe4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xe5'));db[_0x8aa8('0xe6')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xe7'));db[_0x8aa8('0xe8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x8aa8('0xe9')]=db[_0x8aa8('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x8aa8('0xea')]=db['sequelize'][_0x8aa8('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xeb'));db[_0x8aa8('0xec')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xed'));db[_0x8aa8('0xee')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xef'));db['VoicePrefix']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf0'));db[_0x8aa8('0xf1')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize']['import'](_0x8aa8('0xf2'));db[_0x8aa8('0xf3')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf4'));db[_0x8aa8('0xf5')]=db['sequelize']['import'](_0x8aa8('0xf6'));db[_0x8aa8('0xf7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xf8'));db['WhatsappApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x8aa8('0xf9')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfa'));db['WhatsappMessage']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xfb'));db[_0x8aa8('0xfc')]=db[_0x8aa8('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8aa8('0xfd')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfe'));db[_0x8aa8('0xff')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x100'));db[_0x8aa8('0x101')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x102'));db[_0x8aa8('0x103')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x104'));db[_0x8aa8('0x105')]=db['sequelize'][_0x8aa8('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x8aa8('0x106')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x107'));db[_0x8aa8('0x12')][_0x8aa8('0x108')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x1c')],{'as':'Recordings','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x10b')],{'as':_0x8aa8('0x10c'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'UserId'});db['User'][_0x8aa8('0x10a')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x8aa8('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'foreignKey':_0x8aa8('0x109')});db['User'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x109')});db['User']['hasMany'](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x116'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x117'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0xf5')],{'as':_0x8aa8('0x118'),'foreignKey':'SenderId'});db[_0x8aa8('0x12')]['belongsTo'](db[_0x8aa8('0xf1')],{'as':_0x8aa8('0xf1'),'foreignKey':_0x8aa8('0x119')});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x8aa8('0x11a')});db[_0x8aa8('0x12')]['belongsToMany'](db[_0x8aa8('0x11b')],{'as':'Contacts','through':_0x8aa8('0x11c')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x11e')});db['User'][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x11f')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x37')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'through':_0x8aa8('0x120')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'as':'FaxInteractions','through':_0x8aa8('0x121')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'through':_0x8aa8('0x122')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'through':_0x8aa8('0x123')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'as':'WhatsappInteractions','through':_0x8aa8('0x124')});db[_0x8aa8('0x12')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x8aa8('0x2a'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['VoicePrefix'],{'as':_0x8aa8('0x125'),'through':_0x8aa8('0x106'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'as':_0x8aa8('0x126'),'through':_0x8aa8('0x127'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x61')],{'as':_0x8aa8('0x128'),'through':_0x8aa8('0x2c'),'required':![],'hooks':!![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x46')],{'as':'FaxQueues','through':_0x8aa8('0x2f'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x4e')],{'as':'SmsQueues','through':_0x8aa8('0x129'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x57')],{'as':_0x8aa8('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'through':_0x8aa8('0x11e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x58')],{'as':'ChatWebsites','through':_0x8aa8('0x12b')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x41')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12d'),'through':'user_has_mail_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x50')],{'as':'OpenchannelAccounts','through':_0x8aa8('0x12e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x12f')],{'as':'SmsAccounts','through':_0x8aa8('0x130')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xf7')],{'as':'WhatsappAccounts','through':_0x8aa8('0x131')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['SquareProject'],{'as':_0x8aa8('0x132'),'through':'user_has_square_projects'});db[_0x8aa8('0x15')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x133'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x134')});db['VoiceContext'][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x16')]['hasMany'](db[_0x8aa8('0x16')],{'as':'Applications','onDelete':_0x8aa8('0x10e')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x8aa8('0x81')],{'as':_0x8aa8('0x135'),'through':_0x8aa8('0x136')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db['UserVoiceQueueRt'],{'as':_0x8aa8('0x137'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0x13a')],{'as':'HopperHistories','foreignKey':_0x8aa8('0x138')});db['VoiceQueue'][_0x8aa8('0x10a')](db[_0x8aa8('0x6d')],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':_0x8aa8('0x13b'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db['Trunk'],{'as':_0x8aa8('0x26'),'foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0x1a')]['belongsTo'](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x13f'),'foreignKey':_0x8aa8('0x140')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x78'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x1a')]['belongsToMany'](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x143')});db[_0x8aa8('0x1a')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2a')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xdc')],{'as':_0x8aa8('0x145'),'through':_0x8aa8('0x103')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'voice_queues_has_cm_blacklists'});db[_0x8aa8('0x1c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1e')][_0x8aa8('0x10a')](db[_0x8aa8('0x1f')],{'as':_0x8aa8('0x147'),'onDelete':'cascade','foreignKey':_0x8aa8('0x148'),'sourceKey':'mailbox'});db[_0x8aa8('0x1f')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x8aa8('0x148'),'targetKey':'mailbox'});db[_0x8aa8('0x149')][_0x8aa8('0x10a')](db[_0x8aa8('0x14a')],{'as':_0x8aa8('0x14b'),'foreignKey':'uniqueid','constraints':![]});db[_0x8aa8('0x149')]['hasMany'](db[_0x8aa8('0x14c')],{'as':'AgentReports','foreignKey':_0x8aa8('0x14d'),'constraints':![]});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':'UserId'});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x14f')]['belongsTo'](db['MailAccount'],{'as':_0x8aa8('0x12c'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x33')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasOne'](db[_0x8aa8('0x14f')],{'as':_0x8aa8('0x151'),'onDelete':'cascade'});db[_0x8aa8('0x12c')][_0x8aa8('0x108')](db[_0x8aa8('0x33')],{'as':_0x8aa8('0x152'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x150'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x39')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x157')});db['MailAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x84')],{'as':_0x8aa8('0x84'),'foreignKey':_0x8aa8('0x159')});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db['MailAccount'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x15b')});db[_0x8aa8('0x35')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x127')});db[_0x8aa8('0x35')]['belongsToMany'](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x145')});db[_0x8aa8('0x37')][_0x8aa8('0x10a')](db[_0x8aa8('0x39')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':'MailInteractionId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db['MailAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailInteraction']['belongsTo'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x37')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':'Tags'});db[_0x8aa8('0x37')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':_0x8aa8('0x161')});db['MailInteraction'][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x8aa8('0x39')][_0x8aa8('0x10a')](db[_0x8aa8('0xe4')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x8aa8('0x12')],{'as':'User'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db['MailMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x37')],{'as':'Interaction','foreignKey':_0x8aa8('0x163')});db[_0x8aa8('0x39')]['belongsTo'](db[_0x8aa8('0x12c')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x58'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':_0x8aa8('0x165')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x8aa8('0x12c')],{'onDelete':_0x8aa8('0x166')});db['MailApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':'restrict','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailInteraction'],{});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailMessage'],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0x12')],{});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{});db[_0x8aa8('0x3f')][_0x8aa8('0x10a')](db[_0x8aa8('0x40')],{'as':'Items','onDelete':'cascade'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x168'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':'Answers','foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxInteraction'],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'Applications'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x16a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxMessage'],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x26')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0x41')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x16c')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'restrict'});db[_0x8aa8('0x169')]['belongsTo'](db[_0x8aa8('0x46')],{'onDelete':_0x8aa8('0x166')});db['FaxApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x43')]['hasMany'](db[_0x8aa8('0x45')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x16d')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x43')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db['FaxInteraction']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'fax_interaction_has_tags','as':_0x8aa8('0x16e')});db[_0x8aa8('0x43')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x16f'),'as':_0x8aa8('0x161')});db['FaxInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x121'),'foreignKey':_0x8aa8('0x16d')});db['FaxMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'cascade','as':_0x8aa8('0x12')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x16d')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2f')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_fax_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['FaxQueueReport'][_0x8aa8('0x13d')](db['FaxInteraction'],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x45')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db['FaxQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':_0x8aa8('0x155'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x172')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x156')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x12f')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db['SmsAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x12f')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x173')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x113')]['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SmsInteractionId'});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x113')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x174'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':'user_has_sms_interactions','foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['User'],{'as':'User'});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x4c')]['belongsTo'](db[_0x8aa8('0x113')],{'onDelete':'cascade','as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x4e')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x176'),'as':_0x8aa8('0x145')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x177'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x50')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x156'),'foreignKey':_0x8aa8('0x177')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x178')],{'as':_0x8aa8('0x157'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x50')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x50')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x57')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x50')],{'onDelete':_0x8aa8('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':'IntervalId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x53')]['hasMany'](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x17a')});db['OpenchannelInteraction']['belongsTo'](db[_0x8aa8('0x50')],{'as':'Account','foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'UserId'});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x16e')});db['OpenchannelInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_openchannel_interactions','foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'as':'User'});db['OpenchannelMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':'Contact'});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db['OpenchannelAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x57')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x31'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x57')]['belongsToMany'](db['Team'],{'through':_0x8aa8('0x17c'),'as':_0x8aa8('0x145')});db['ChatWebsite']['hasMany'](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x17d')});db['ChatWebsite'][_0x8aa8('0x10a')](db[_0x8aa8('0x63')],{'as':'ProactiveActions'});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5b')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x58')]['hasMany'](db[_0x8aa8('0x5e')],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x58')]['belongsTo'](db[_0x8aa8('0x78')],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db['ChatWebsite'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x58')]['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x12b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{});db[_0x8aa8('0x59')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{});db[_0x8aa8('0x59')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0x59')]['belongsTo'](db[_0x8aa8('0x57')],{});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':_0x8aa8('0x109'),'onDelete':_0x8aa8('0x166')});db['ChatApplication'][_0x8aa8('0x13d')](db['ChatQueue'],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x180'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x181'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db['ChatInteraction'][_0x8aa8('0x10a')](db['ChatMessage'],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x182')});db['ChatInteraction']['belongsTo'](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x5d')]['belongsTo'](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x5d')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':'Tags'});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':_0x8aa8('0x161')});db['ChatInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x120'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x12')});db['ChatMessage']['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db['ChatMessage'][_0x8aa8('0x13d')](db['ChatInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x164')][_0x8aa8('0x10a')](db['Attachment'],{'as':_0x8aa8('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x2c'),'hooks':!![]});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_chat_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x185')][_0x8aa8('0x10a')](db[_0x8aa8('0xc8')],{'as':_0x8aa8('0x147'),'foreignKey':'ChatGroupId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x185')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0x8aa8('0x63')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':'Website','foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x186')][_0x8aa8('0x10a')](db[_0x8aa8('0x11b')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'ContactId'});db['CmContact'][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ChatInteraction'],{'as':_0x8aa8('0x112'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')]['hasMany'](db['FaxInteraction'],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db['CmContact'][_0x8aa8('0x10a')](db['MailInteraction'],{'as':_0x8aa8('0x116'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x13d')](db[_0x8aa8('0x186')],{'as':_0x8aa8('0x188'),'foreignKey':'CompanyId'});db[_0x8aa8('0x11b')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId','onDelete':_0x8aa8('0x10e')});db['CmContact']['belongsToMany'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x11c')});db['CmContact'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'as':'Tags','through':_0x8aa8('0x189')});db[_0x8aa8('0x11b')][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x189'),'as':_0x8aa8('0x161')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':'UserId'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0x1a')],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x138'),'onDelete':'cascade'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0xe0')],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'OwnerId'});db[_0x8aa8('0x69')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0x1a')],{'as':'Queue','foreignKey':_0x8aa8('0x138'),'onDelete':_0x8aa8('0x10e')});db['CmHopperBlack'][_0x8aa8('0x13d')](db['Campaign'],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18b'),'singular':_0x8aa8('0x18c')},'foreignKey':_0x8aa8('0x18d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18e'),'singular':_0x8aa8('0x18f')},'foreignKey':'AutomationAnyId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':_0x8aa8('0x190'),'foreignKey':'AutomationId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x153')][_0x8aa8('0x10a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8aa8('0x191'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x78')]['hasMany'](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x192'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x10e'),'hooks':!![],'required':![]});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x193'),'foreignKey':'IntervalId'});db['Interval'][_0x8aa8('0x10a')](db['ChatApplication'],{'as':_0x8aa8('0x194'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'FaxApplications','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x195'),'foreignKey':'IntervalId'});db['Schedule'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db['AnalyticDefaultReport'],{'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db[_0x8aa8('0x8c')],{'foreignKey':_0x8aa8('0x197')});db['Sound'][_0x8aa8('0x11d')](db[_0x8aa8('0x18')],{'as':_0x8aa8('0x198'),'through':_0x8aa8('0x136'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x11b')],{'through':_0x8aa8('0x189')});db[_0x8aa8('0x83')]['belongsToMany'](db[_0x8aa8('0x5d')],{'through':_0x8aa8('0x183')});db['Tag']['belongsToMany'](db[_0x8aa8('0x37')],{'through':_0x8aa8('0x160')});db['Tag'][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'through':_0x8aa8('0x174')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'through':_0x8aa8('0x16f')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'through':_0x8aa8('0x17b')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'through':_0x8aa8('0x199')});db['Trigger'][_0x8aa8('0x10a')](db['Condition'],{'as':{'plural':_0x8aa8('0x19a'),'singular':_0x8aa8('0x19b')},'foreignKey':_0x8aa8('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x19d'),'singular':_0x8aa8('0x19e')},'foreignKey':_0x8aa8('0x19f'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':'Actions','foreignKey':_0x8aa8('0x1a0'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x8c')][_0x8aa8('0x10a')](db['AnalyticFieldReport'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x197'),'hooks':!![]});db[_0x8aa8('0x8d')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x91')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a3')});db[_0x8aa8('0x1a2')][_0x8aa8('0x13d')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x8aa8('0x94')][_0x8aa8('0x10a')](db['SalesforceConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db['SalesforceConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1a5')][_0x8aa8('0x13d')](db[_0x8aa8('0x94')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db['SalesforceField'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x97')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db['SalesforceField']['hasMany'](db[_0x8aa8('0x97')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x97')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':'VariableId'});db[_0x8aa8('0x99')][_0x8aa8('0x10a')](db[_0x8aa8('0x9b')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9b')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['SugarcrmField'][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1ab'),'foreignKey':'SubjectId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9d')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x9f')][_0x8aa8('0x10a')](db[_0x8aa8('0xa0')],{'as':'Configurations','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa0')]['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db['DeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xa0')][_0x8aa8('0x13d')](db[_0x8aa8('0x9f')],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x1b0')});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1af')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8aa8('0xa3')][_0x8aa8('0x10a')](db['ZohoConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x1b2')]['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db['ZohoConfiguration']['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b2')][_0x8aa8('0x10a')](db['ZohoField'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b2')][_0x8aa8('0x13d')](db[_0x8aa8('0xa3')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xa5')][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xa5')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xa5')]['belongsTo'](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xa7')][_0x8aa8('0x10a')](db['ZendeskConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1ac')});db['ZendeskConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Descriptions','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db['ZendeskConfiguration']['belongsTo'](db[_0x8aa8('0xa7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa9')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8aa8('0x10a')](db['ZendeskField'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b3')][_0x8aa8('0x10a')](db['ZendeskField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b3')]['hasMany'](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b3')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b4')][_0x8aa8('0x10a')](db[_0x8aa8('0xac')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xac')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db['FreshdeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xac')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b4')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xae')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1b1'),'foreignKey':'FieldId'});db[_0x8aa8('0xae')][_0x8aa8('0x13d')](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b5')]['hasMany'](db[_0x8aa8('0xb0')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['VtigerConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xb0')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b5')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db[_0x8aa8('0xb2')]['hasMany'](db[_0x8aa8('0xb2')],{'as':'Subject','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xb2')][_0x8aa8('0x10a')](db['VtigerField'],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb2')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xb2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb4')]['hasMany'](db[_0x8aa8('0x1b6')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a6'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b6')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowConfiguration'][_0x8aa8('0x13d')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb9')][_0x8aa8('0x10a')](db['Dynamics365Configuration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xbb')]['hasMany'](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'FieldId'});db[_0x8aa8('0xbb')]['belongsTo'](db['Dynamics365Account'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xbd')]['hasMany'](db['Dynamics365Field'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['Dynamics365Field'][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xbe')][_0x8aa8('0x10a')](db['FreshsalesConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0xc0')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':'Subjects','foreignKey':_0x8aa8('0x1a7')});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a8'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc0')][_0x8aa8('0x13d')](db[_0x8aa8('0xbe')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshsalesField'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xc2')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xc2')]['hasMany'](db[_0x8aa8('0xc2')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xc7')]['belongsTo'](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x61')],{});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b7')});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b8')});db[_0x8aa8('0xcc')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1b9'),'onDelete':_0x8aa8('0x10e')});db['JscriptySessionReport'][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':'SessionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{});db[_0x8aa8('0xce')]['belongsTo'](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['SmsQueueReport'][_0x8aa8('0x13d')](db['SmsInteraction'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x4c')],{});db['SmsQueueReport'][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db['SmsQueue'],{});db[_0x8aa8('0x1bb')]['hasMany'](db[_0x8aa8('0xcc')],{'foreignKey':'ProjectId'});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0xd8')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Users','through':_0x8aa8('0x1bd')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11f')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1a')],{'through':_0x8aa8('0x103'),'as':_0x8aa8('0x1be')});db['Team'][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x126')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x61')],{'through':_0x8aa8('0x1bf'),'as':_0x8aa8('0x128')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x46')],{'through':_0x8aa8('0x1c0'),'as':_0x8aa8('0x1c1')});db['Team']['belongsToMany'](db[_0x8aa8('0x4e')],{'through':'team_has_sms_queues','as':_0x8aa8('0x1c2')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db['OpenchannelQueue'],{'through':_0x8aa8('0x17c'),'as':'OpenchannelQueues'});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0xff')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x1c4')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1c5')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':_0x8aa8('0x110'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':'CampaignId'});db['Campaign'][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':'Trunk','foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0xe0')]['belongsTo'](db[_0x8aa8('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x8aa8('0xe0')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0xd8')],{'as':_0x8aa8('0xd8'),'foreignKey':_0x8aa8('0x1c6')});db[_0x8aa8('0xe0')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x1c7'),'through':_0x8aa8('0x1c8')});db['Campaign'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'campaigns_has_cm_blacklists'});db[_0x8aa8('0xe4')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':'ChatOfflineMessageId'});db[_0x8aa8('0xe8')]['belongsTo'](db['MailMessage'],{});db[_0x8aa8('0xe8')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1c9'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xe8')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['User'],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['MailQueue'],{'foreignKey':_0x8aa8('0x1cd'),'as':_0x8aa8('0x1ce')});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1cf'),'as':_0x8aa8('0x1d0')});db['ChatTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xe9')]['belongsTo'](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d1'),'as':'FromAccount'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['User'],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x8aa8('0x1ce')});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d2'),'as':_0x8aa8('0x1d0')});db['FaxTransferReport']['belongsTo'](db[_0x8aa8('0x45')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x43')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'foreignKey':_0x8aa8('0x1d3'),'as':'FromAccount'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{'foreignKey':'ToFaxQueueId','as':_0x8aa8('0x1ce')});db['FaxTransferReport'][_0x8aa8('0x13d')](db['FaxAccount'],{'foreignKey':_0x8aa8('0x1d5'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x55')],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db['OpenchannelInteraction'],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{'foreignKey':_0x8aa8('0x1d7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':_0x8aa8('0x1d8')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x8aa8('0x57')],{'foreignKey':_0x8aa8('0x1d9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0x1d6')]['belongsTo'](db[_0x8aa8('0x50')],{'foreignKey':'ToOpenchannelAccountId','as':_0x8aa8('0x1d0')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db['SmsMessage'],{});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x113')],{});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1da'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db['SmsTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'foreignKey':_0x8aa8('0x1db'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1dc'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x6f')],{'as':_0x8aa8('0x1dd'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db['CmContact'],{'as':_0x8aa8('0x1de'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':_0x8aa8('0x16b')});db['CmList'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x1df'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x11d')](db['VoiceQueue'],{'as':'Queues','through':_0x8aa8('0x143')});db[_0x8aa8('0xee')]['belongsToMany'](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11e')});db[_0x8aa8('0x1c5')][_0x8aa8('0x10a')](db['VoiceExtension'],{'as':_0x8aa8('0x10d'),'onDelete':'cascade'});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x106')});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x105'),'as':'Teams'});db[_0x8aa8('0xf1')][_0x8aa8('0x10a')](db[_0x8aa8('0x12')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0x8aa8('0x1e0')],{'as':_0x8aa8('0x1e1'),'foreignKey':'userProfileId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x1e0')][_0x8aa8('0x10a')](db[_0x8aa8('0xf3')],{'as':_0x8aa8('0x1e2'),'foreignKey':'sectionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['Disposition'],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x1e3'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x1e3')});db['WhatsappAccount']['hasMany'](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e5')],{'as':_0x8aa8('0x157')});db['WhatsappAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xf7')][_0x8aa8('0x13d')](db['Pause'],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0xf7')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x131')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')]['belongsTo'](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0xf9')]['hasMany'](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':'Account','foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['WhatsappInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x16e')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x161')});db['WhatsappInteraction']['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x8aa8('0x1e6')});db['WhatsappMessage'][_0x8aa8('0x13d')](db['User'],{'as':_0x8aa8('0x12')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db['WhatsappInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':'Interaction','foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xff')],{});db['WhatsappQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xfd')]['belongsTo'](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e8'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'foreignKey':_0x8aa8('0x1e9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xff')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x32'),'foreignKey':_0x8aa8('0x1ea')});db['WhatsappQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x145')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3bb88ca..8d2da5d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90d2=['./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/webbar','/apidoc','join','/www','static','root','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','includes','lodash','path','express','express-winston','./errors','./config/logger','api','auth','safeTemplate','default','use','logger','isEmpty','body','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','other','agent_id','agent_name','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams'];(function(_0x1e9bf5,_0x2b8466){var _0x3e43a0=function(_0x4f74dd){while(--_0x4f74dd){_0x1e9bf5['push'](_0x1e9bf5['shift']());}};_0x3e43a0(++_0x2b8466);}(_0x90d2,0x64));var _0x290d=function(_0x39b4fc,_0x532cdd){_0x39b4fc=_0x39b4fc-0x0;var _0x4e57c1=_0x90d2[_0x39b4fc];return _0x4e57c1;};'use strict';var _=require(_0x290d('0x0'));var path=require(_0x290d('0x1'));var express=require(_0x290d('0x2'));var ewinston=require(_0x290d('0x3'));var util=require('util');var errors=require(_0x290d('0x4'));var config=require('./config/environment');var logger=require(_0x290d('0x5'))(_0x290d('0x6'));var authLogger=require(_0x290d('0x5'))(_0x290d('0x7'));var safeTemplate=require('./safe-template')[_0x290d('0x8')];exports[_0x290d('0x9')]=function(_0x588878){_0x588878[_0x290d('0xa')](ewinston[_0x290d('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2a2ba6,_0xc3da55){var _0x2fc6f4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x290d('0xc')](_0x2a2ba6['body'])){_0x2fc6f4+='\x20body=%s';var _0x271e88=_0x2a2ba6[_0x290d('0xd')];maskSensitiveData(_0x271e88);}return safeTemplate(util[_0x290d('0xe')](_0x2fc6f4,_0x2a2ba6['method'],_0x2a2ba6['headers'][_0x290d('0xf')]?_0x2a2ba6[_0x290d('0x10')][_0x290d('0xf')]:_0x2a2ba6[_0x290d('0x11')][_0x290d('0x12')]||_0x2a2ba6['ip'],_0x2a2ba6[_0x290d('0x13')],_0xc3da55[_0x290d('0x14')],_0xc3da55[_0x290d('0x15')],_0x2a2ba6['user']?_0x2a2ba6['user']['id']:null,_0x2a2ba6['user']?_0x2a2ba6[_0x290d('0x16')][_0x290d('0x17')]:null,_0x2a2ba6[_0x290d('0x16')]?_0x2a2ba6['user']['role']:null,_0x271e88?util[_0x290d('0x18')](_0x271e88,![],null):''));}}));_0x588878[_0x290d('0xa')](ewinston[_0x290d('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x375eef,_0xe00b3a){var _0x4b20bb=_0x290d('0x19');if(_0x375eef[_0x290d('0xd')]&&_0x375eef[_0x290d('0xd')][_0x290d('0x1a')]&&_0x375eef[_0x290d('0xd')]['agent_id']){_0x4b20bb=_0x290d('0x1b');}return util[_0x290d('0xe')](_0x4b20bb,_0x375eef[_0x290d('0x1c')],_0x375eef[_0x290d('0x10')][_0x290d('0xf')]?_0x375eef[_0x290d('0x10')][_0x290d('0xf')]:_0x375eef['connection'][_0x290d('0x12')]||_0x375eef['ip'],_0x375eef[_0x290d('0x13')],_0xe00b3a['statusCode'],_0xe00b3a[_0x290d('0x15')],_0x375eef[_0x290d('0x16')]?_0x375eef[_0x290d('0x16')]['id']:null,_0x375eef[_0x290d('0x16')]?_0x375eef[_0x290d('0x16')]['name']:null,_0x375eef[_0x290d('0x16')]?_0x375eef['user']['role']:null,_0x375eef[_0x290d('0xd')]&&_0x375eef['body']['device']?_0x375eef[_0x290d('0xd')][_0x290d('0x1a')]:_0x290d('0x1d'),_0x375eef['body']&&_0x375eef['body'][_0x290d('0x1e')]?_0x375eef[_0x290d('0xd')][_0x290d('0x1e')]:'',_0x375eef[_0x290d('0xd')]&&_0x375eef[_0x290d('0xd')][_0x290d('0x1f')]?_0x375eef[_0x290d('0xd')][_0x290d('0x1f')]:'');},'ignoreRoute':function(_0x25e5b7){var _0x3ac7ec=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3ac7ec['test'](_0x25e5b7[_0x290d('0x13')]);}}));_0x588878[_0x290d('0xa')](_0x290d('0x20'),require('./api/user'));_0x588878['use'](_0x290d('0x21'),require(_0x290d('0x22')));_0x588878['use'](_0x290d('0x23'),require(_0x290d('0x24')));_0x588878[_0x290d('0xa')](_0x290d('0x25'),require(_0x290d('0x26')));_0x588878[_0x290d('0xa')]('/api/voice/mohs',require(_0x290d('0x27')));_0x588878['use'](_0x290d('0x28'),require(_0x290d('0x29')));_0x588878[_0x290d('0xa')](_0x290d('0x2a'),require(_0x290d('0x2b')));_0x588878[_0x290d('0xa')](_0x290d('0x2c'),require(_0x290d('0x2d')));_0x588878['use'](_0x290d('0x2e'),require(_0x290d('0x2f')));_0x588878[_0x290d('0xa')](_0x290d('0x30'),require(_0x290d('0x31')));_0x588878[_0x290d('0xa')]('/api/voice/calls/reports',require(_0x290d('0x32')));_0x588878['use'](_0x290d('0x33'),require(_0x290d('0x34')));_0x588878['use']('/api/voice/agents/reports',require(_0x290d('0x35')));_0x588878['use']('/api/voice/queues/reports',require(_0x290d('0x36')));_0x588878[_0x290d('0xa')]('/api/members/reports',require(_0x290d('0x37')));_0x588878['use'](_0x290d('0x38'),require(_0x290d('0x39')));_0x588878[_0x290d('0xa')](_0x290d('0x3a'),require('./api/voiceTransferReport'));_0x588878[_0x290d('0xa')](_0x290d('0x3b'),require(_0x290d('0x3c')));_0x588878['use'](_0x290d('0x3d'),require('./api/mailAccount'));_0x588878[_0x290d('0xa')](_0x290d('0x3e'),require(_0x290d('0x3f')));_0x588878['use'](_0x290d('0x40'),require(_0x290d('0x41')));_0x588878[_0x290d('0xa')](_0x290d('0x42'),require('./api/mailInteraction'));_0x588878[_0x290d('0xa')]('/api/mail/messages',require(_0x290d('0x43')));_0x588878[_0x290d('0xa')](_0x290d('0x44'),require(_0x290d('0x45')));_0x588878['use'](_0x290d('0x46'),require(_0x290d('0x47')));_0x588878[_0x290d('0xa')](_0x290d('0x48'),require(_0x290d('0x49')));_0x588878[_0x290d('0xa')](_0x290d('0x4a'),require(_0x290d('0x4b')));_0x588878[_0x290d('0xa')](_0x290d('0x4c'),require(_0x290d('0x4d')));_0x588878[_0x290d('0xa')](_0x290d('0x4e'),require(_0x290d('0x4f')));_0x588878[_0x290d('0xa')](_0x290d('0x50'),require(_0x290d('0x51')));_0x588878['use'](_0x290d('0x52'),require(_0x290d('0x53')));_0x588878[_0x290d('0xa')](_0x290d('0x54'),require(_0x290d('0x55')));_0x588878[_0x290d('0xa')](_0x290d('0x56'),require(_0x290d('0x57')));_0x588878[_0x290d('0xa')](_0x290d('0x58'),require(_0x290d('0x59')));_0x588878[_0x290d('0xa')](_0x290d('0x5a'),require(_0x290d('0x5b')));_0x588878['use']('/api/sms/interactions',require('./api/smsInteraction'));_0x588878[_0x290d('0xa')]('/api/sms/messages',require(_0x290d('0x5c')));_0x588878['use'](_0x290d('0x5d'),require(_0x290d('0x5e')));_0x588878[_0x290d('0xa')](_0x290d('0x5f'),require(_0x290d('0x60')));_0x588878[_0x290d('0xa')](_0x290d('0x61'),require('./api/openchannelApplication'));_0x588878[_0x290d('0xa')](_0x290d('0x62'),require(_0x290d('0x63')));_0x588878['use'](_0x290d('0x64'),require(_0x290d('0x65')));_0x588878[_0x290d('0xa')]('/api/openchannel/queues',require(_0x290d('0x66')));_0x588878[_0x290d('0xa')](_0x290d('0x67'),require(_0x290d('0x68')));_0x588878[_0x290d('0xa')](_0x290d('0x69'),require(_0x290d('0x6a')));_0x588878['use'](_0x290d('0x6b'),require('./api/chatApplication'));_0x588878['use'](_0x290d('0x6c'),require(_0x290d('0x6d')));_0x588878[_0x290d('0xa')](_0x290d('0x6e'),require(_0x290d('0x6f')));_0x588878['use'](_0x290d('0x70'),require(_0x290d('0x71')));_0x588878[_0x290d('0xa')](_0x290d('0x72'),require('./api/chatQueue'));_0x588878['use'](_0x290d('0x73'),require(_0x290d('0x74')));_0x588878['use'](_0x290d('0x75'),require(_0x290d('0x76')));_0x588878[_0x290d('0xa')](_0x290d('0x77'),require(_0x290d('0x78')));_0x588878[_0x290d('0xa')](_0x290d('0x79'),require(_0x290d('0x7a')));_0x588878[_0x290d('0xa')](_0x290d('0x7b'),require(_0x290d('0x7c')));_0x588878[_0x290d('0xa')](_0x290d('0x7d'),require(_0x290d('0x7e')));_0x588878[_0x290d('0xa')](_0x290d('0x7f'),require(_0x290d('0x80')));_0x588878[_0x290d('0xa')](_0x290d('0x81'),require('./api/cmHopperHistory'));_0x588878[_0x290d('0xa')]('/api/cm/custom_fields',require(_0x290d('0x82')));_0x588878[_0x290d('0xa')](_0x290d('0x83'),require('./api/action'));_0x588878['use'](_0x290d('0x84'),require(_0x290d('0x85')));_0x588878[_0x290d('0xa')](_0x290d('0x86'),require(_0x290d('0x87')));_0x588878['use']('/api/dispositions',require(_0x290d('0x88')));_0x588878[_0x290d('0xa')](_0x290d('0x89'),require(_0x290d('0x8a')));_0x588878[_0x290d('0xa')](_0x290d('0x8b'),require('./api/interval'));_0x588878[_0x290d('0xa')](_0x290d('0x8c'),require(_0x290d('0x8d')));_0x588878[_0x290d('0xa')](_0x290d('0x8e'),require(_0x290d('0x8f')));_0x588878[_0x290d('0xa')]('/api/voiceQueuesLog',require(_0x290d('0x90')));_0x588878['use'](_0x290d('0x91'),require('./api/schedule'));_0x588878[_0x290d('0xa')](_0x290d('0x92'),require(_0x290d('0x93')));_0x588878[_0x290d('0xa')]('/api/tags',require(_0x290d('0x94')));_0x588878[_0x290d('0xa')](_0x290d('0x95'),require('./api/template'));_0x588878[_0x290d('0xa')](_0x290d('0x96'),require(_0x290d('0x97')));_0x588878[_0x290d('0xa')](_0x290d('0x98'),require(_0x290d('0x99')));_0x588878[_0x290d('0xa')](_0x290d('0x9a'),require(_0x290d('0x9b')));_0x588878[_0x290d('0xa')](_0x290d('0x9c'),require(_0x290d('0x9d')));_0x588878[_0x290d('0xa')]('/api/analytics/custom_reports',require(_0x290d('0x9e')));_0x588878[_0x290d('0xa')](_0x290d('0x9f'),require(_0x290d('0xa0')));_0x588878['use']('/api/analytics/extracted_reports',require(_0x290d('0xa1')));_0x588878['use'](_0x290d('0xa2'),require('./api/analyticMetric'));_0x588878[_0x290d('0xa')](_0x290d('0xa3'),require(_0x290d('0xa4')));_0x588878[_0x290d('0xa')](_0x290d('0xa5'),require('./api/analyticTreeReport'));_0x588878[_0x290d('0xa')](_0x290d('0xa6'),require(_0x290d('0xa7')));_0x588878[_0x290d('0xa')](_0x290d('0xa8'),require(_0x290d('0xa9')));_0x588878['use'](_0x290d('0xaa'),require(_0x290d('0xab')));_0x588878[_0x290d('0xa')](_0x290d('0xac'),require(_0x290d('0xad')));_0x588878['use'](_0x290d('0xae'),require(_0x290d('0xaf')));_0x588878[_0x290d('0xa')]('/api/integrations/sugarcrm/fields',require(_0x290d('0xb0')));_0x588878[_0x290d('0xa')]('/api/integrations/desk/accounts',require(_0x290d('0xb1')));_0x588878['use']('/api/integrations/desk/configurations',require(_0x290d('0xb2')));_0x588878[_0x290d('0xa')]('/api/integrations/desk/fields',require(_0x290d('0xb3')));_0x588878[_0x290d('0xa')](_0x290d('0xb4'),require(_0x290d('0xb5')));_0x588878['use']('/api/integrations/zoho/configurations',require(_0x290d('0xb6')));_0x588878['use']('/api/integrations/zoho/fields',require(_0x290d('0xb7')));_0x588878[_0x290d('0xa')](_0x290d('0xb8'),require('./api/intZendeskAccount'));_0x588878[_0x290d('0xa')]('/api/integrations/zendesk/configurations',require(_0x290d('0xb9')));_0x588878[_0x290d('0xa')](_0x290d('0xba'),require(_0x290d('0xbb')));_0x588878[_0x290d('0xa')](_0x290d('0xbc'),require(_0x290d('0xbd')));_0x588878[_0x290d('0xa')](_0x290d('0xbe'),require(_0x290d('0xbf')));_0x588878[_0x290d('0xa')](_0x290d('0xc0'),require(_0x290d('0xc1')));_0x588878[_0x290d('0xa')](_0x290d('0xc2'),require('./api/intVtigerAccount'));_0x588878[_0x290d('0xa')]('/api/integrations/vtiger/configurations',require(_0x290d('0xc3')));_0x588878[_0x290d('0xa')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x588878[_0x290d('0xa')](_0x290d('0xc4'),require(_0x290d('0xc5')));_0x588878[_0x290d('0xa')](_0x290d('0xc6'),require(_0x290d('0xc7')));_0x588878[_0x290d('0xa')](_0x290d('0xc8'),require(_0x290d('0xc9')));_0x588878[_0x290d('0xa')](_0x290d('0xca'),require(_0x290d('0xcb')));_0x588878[_0x290d('0xa')](_0x290d('0xcc'),require(_0x290d('0xcd')));_0x588878['use'](_0x290d('0xce'),require(_0x290d('0xcf')));_0x588878[_0x290d('0xa')](_0x290d('0xd0'),require(_0x290d('0xd1')));_0x588878['use'](_0x290d('0xd2'),require(_0x290d('0xd3')));_0x588878[_0x290d('0xa')](_0x290d('0xd4'),require('./api/intFreshsalesField'));_0x588878[_0x290d('0xa')](_0x290d('0xd5'),require('./api/network'));_0x588878[_0x290d('0xa')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x588878['use'](_0x290d('0xd6'),require(_0x290d('0xd7')));_0x588878[_0x290d('0xa')]('/api/jscripty/answers/reports',require(_0x290d('0xd8')));_0x588878[_0x290d('0xa')](_0x290d('0xd9'),require('./api/jscriptyQuestionReport'));_0x588878[_0x290d('0xa')]('/api/jscripty/sessions/reports',require(_0x290d('0xda')));_0x588878[_0x290d('0xa')](_0x290d('0xdb'),require(_0x290d('0xdc')));_0x588878[_0x290d('0xa')](_0x290d('0xdd'),require(_0x290d('0xde')));_0x588878[_0x290d('0xa')](_0x290d('0xdf'),require(_0x290d('0xe0')));_0x588878[_0x290d('0xa')](_0x290d('0xe1'),require(_0x290d('0xe2')));_0x588878['use'](_0x290d('0xe3'),require(_0x290d('0xe4')));_0x588878[_0x290d('0xa')](_0x290d('0xe5'),require(_0x290d('0xe6')));_0x588878[_0x290d('0xa')](_0x290d('0xe7'),require(_0x290d('0xe8')));_0x588878[_0x290d('0xa')](_0x290d('0xe9'),require(_0x290d('0xea')));_0x588878[_0x290d('0xa')]('/api/square/messages',require(_0x290d('0xeb')));_0x588878['use'](_0x290d('0xec'),require(_0x290d('0xed')));_0x588878[_0x290d('0xa')](_0x290d('0xee'),require(_0x290d('0xef')));_0x588878['use'](_0x290d('0xf0'),require('./api/campaign'));_0x588878[_0x290d('0xa')](_0x290d('0xf1'),require(_0x290d('0xf2')));_0x588878[_0x290d('0xa')](_0x290d('0xf3'),require('./api/attachment'));_0x588878[_0x290d('0xa')](_0x290d('0xf4'),require(_0x290d('0xf5')));_0x588878['use'](_0x290d('0xf6'),require(_0x290d('0xf7')));_0x588878[_0x290d('0xa')]('/api/chat/reports/transfer',require(_0x290d('0xf8')));_0x588878[_0x290d('0xa')](_0x290d('0xf9'),require(_0x290d('0xfa')));_0x588878[_0x290d('0xa')](_0x290d('0xfb'),require('./api/openchannelTransferReport'));_0x588878[_0x290d('0xa')](_0x290d('0xfc'),require(_0x290d('0xfd')));_0x588878[_0x290d('0xa')](_0x290d('0xfe'),require(_0x290d('0xff')));_0x588878['use']('/api/voice/prefixes',require(_0x290d('0x100')));_0x588878[_0x290d('0xa')](_0x290d('0x101'),require('./api/userProfile'));_0x588878[_0x290d('0xa')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x588878[_0x290d('0xa')](_0x290d('0x102'),require('./api/userProfileResource'));_0x588878[_0x290d('0xa')]('/api/userNotifications',require(_0x290d('0x103')));_0x588878[_0x290d('0xa')](_0x290d('0x104'),require(_0x290d('0x105')));_0x588878[_0x290d('0xa')]('/api/whatsapp/applications',require(_0x290d('0x106')));_0x588878[_0x290d('0xa')](_0x290d('0x107'),require(_0x290d('0x108')));_0x588878['use'](_0x290d('0x109'),require('./api/whatsappMessage'));_0x588878[_0x290d('0xa')](_0x290d('0x10a'),require('./api/whatsappQueueReport'));_0x588878['use'](_0x290d('0x10b'),require(_0x290d('0x10c')));_0x588878[_0x290d('0xa')](_0x290d('0x10d'),require(_0x290d('0x10e')));_0x588878[_0x290d('0xa')](_0x290d('0x10f'),require(_0x290d('0x110')));_0x588878[_0x290d('0xa')](_0x290d('0x111'),require(_0x290d('0x112')));_0x588878[_0x290d('0xa')]('/api/auth/local',require('./api/authLocal'));_0x588878[_0x290d('0xa')]('/api/auth/google',require('./api/authGoogle'));_0x588878[_0x290d('0xa')](_0x290d('0x113'),require(_0x290d('0x114')));_0x588878[_0x290d('0xa')](_0x290d('0x115'),require(_0x290d('0x116')));_0x588878['use']('/api/version',require(_0x290d('0x117')));_0x588878[_0x290d('0xa')](_0x290d('0x118'),require('./api/system'));_0x588878[_0x290d('0xa')]('/api/pm2',require('./api/pm2'));_0x588878['use']('/api/webbar',require(_0x290d('0x119')));_0x588878[_0x290d('0xa')](_0x290d('0x11a'),express['static'](path[_0x290d('0x11b')](config['root'],_0x290d('0x11a'))));_0x588878[_0x290d('0xa')](_0x290d('0x11c'),express[_0x290d('0x11d')](path[_0x290d('0x11b')](config[_0x290d('0x11e')],_0x290d('0x11c'))));_0x588878[_0x290d('0xa')]('/demo',express[_0x290d('0x11d')](path[_0x290d('0x11b')](config[_0x290d('0x11e')],'/demo')));_0x588878[_0x290d('0xa')]('/snippet',express[_0x290d('0x11d')](path[_0x290d('0x11b')](config[_0x290d('0x11e')],'snippet',_0x290d('0x11f'))));_0x588878[_0x290d('0xa')](_0x290d('0x120'),express[_0x290d('0x11d')](path[_0x290d('0x11b')](config['root'],_0x290d('0x121'))));_0x588878[_0x290d('0x122')](_0x290d('0x123'))[_0x290d('0x124')](errors[0x194]);_0x588878[_0x290d('0x122')]('/*')[_0x290d('0x124')](function(_0x794866,_0x219a67){_0x219a67[_0x290d('0x125')](path[_0x290d('0x126')](_0x588878[_0x290d('0x124')](_0x290d('0x127'))+_0x290d('0x128')));});};var sensitiveFields=[_0x290d('0x129'),_0x290d('0x12a'),_0x290d('0x12b'),'apiKey',_0x290d('0x12c'),_0x290d('0x12d'),_0x290d('0x12e'),_0x290d('0x12f'),_0x290d('0x130'),_0x290d('0x131'),_0x290d('0x132'),_0x290d('0x133'),_0x290d('0x134'),_0x290d('0x135'),_0x290d('0x136'),'accessKey',_0x290d('0x137'),_0x290d('0x138'),_0x290d('0x139'),_0x290d('0x13a'),_0x290d('0x13b'),'authToken',_0x290d('0x13c'),_0x290d('0x13d'),_0x290d('0x13e'),_0x290d('0x13f'),'calleridnum',_0x290d('0x140'),'vidaooApiKey',_0x290d('0x141'),'privateKey',_0x290d('0x142'),_0x290d('0x143'),_0x290d('0x144'),'user',_0x290d('0x145'),_0x290d('0x146'),_0x290d('0x147'),'dsn',_0x290d('0x148'),_0x290d('0x149'),_0x290d('0x14a')];function maskSensitiveData(_0xe19b32){var _0x562d50=/(?!^)[\s\S](?!$)/g;if(!_[_0x290d('0x14b')](_0xe19b32))return;for(var _0x406948 in _0xe19b32){if(_[_0x290d('0x14c')](_0xe19b32[_0x406948])){for(var _0x3fb464=0x0;_0x3fb464<_0xe19b32[_0x406948][_0x290d('0x14d')];_0x3fb464++){maskSensitiveData(_0xe19b32[_0x406948][_0x3fb464]);}}else if(_[_0x290d('0x14b')](_0xe19b32[_0x406948])){maskSensitiveData(_0xe19b32[_0x406948]);}else if(_[_0x290d('0x14e')](_0xe19b32[_0x406948])){_0xe19b32[_0x406948]=_0xe19b32[_0x406948]['replace'](/{{{/g,'@@{')[_0x290d('0x14f')](/}}}/g,'}@@')[_0x290d('0x14f')](/{{/g,'@{')[_0x290d('0x14f')](/}}/g,'}@');if(_[_0x290d('0x150')](sensitiveFields,_0x406948)){_0xe19b32[_0x406948]=_0xe19b32[_0x406948][_0x290d('0x14f')](_0x562d50,'*');}}}} \ No newline at end of file +var _0x612a=['/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/system','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','password','apiKey','lastName','street','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','oldPassword','isArray','length','replace','}@@','includes','path','express','express-winston','util','./config/environment','./config/logger','api','auth','safeTemplate','default','use','logger','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','name','other','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration'];(function(_0x1e2abe,_0x4cd132){var _0x5b1807=function(_0x45dc2a){while(--_0x45dc2a){_0x1e2abe['push'](_0x1e2abe['shift']());}};_0x5b1807(++_0x4cd132);}(_0x612a,0xa4));var _0xa612=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x612a[_0x2dd390];return _0x3afe47;};'use strict';var _=require('lodash');var path=require(_0xa612('0x0'));var express=require(_0xa612('0x1'));var ewinston=require(_0xa612('0x2'));var util=require(_0xa612('0x3'));var errors=require('./errors');var config=require(_0xa612('0x4'));var logger=require(_0xa612('0x5'))(_0xa612('0x6'));var authLogger=require(_0xa612('0x5'))(_0xa612('0x7'));var safeTemplate=require('./safe-template')[_0xa612('0x8')];exports[_0xa612('0x9')]=function(_0x1549e4){_0x1549e4[_0xa612('0xa')](ewinston[_0xa612('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x17b168,_0x4e0629){var _0x4db667='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xa612('0xc')](_0x17b168[_0xa612('0xd')])){_0x4db667+='\x20body=%s';var _0x2fff63=_0x17b168[_0xa612('0xd')];maskSensitiveData(_0x2fff63);}return safeTemplate(util[_0xa612('0xe')](_0x4db667,_0x17b168[_0xa612('0xf')],_0x17b168[_0xa612('0x10')]['x-forwarded-for']?_0x17b168[_0xa612('0x10')][_0xa612('0x11')]:_0x17b168[_0xa612('0x12')][_0xa612('0x13')]||_0x17b168['ip'],_0x17b168[_0xa612('0x14')],_0x4e0629[_0xa612('0x15')],_0x4e0629[_0xa612('0x16')],_0x17b168[_0xa612('0x17')]?_0x17b168[_0xa612('0x17')]['id']:null,_0x17b168['user']?_0x17b168[_0xa612('0x17')]['name']:null,_0x17b168[_0xa612('0x17')]?_0x17b168['user'][_0xa612('0x18')]:null,_0x2fff63?util[_0xa612('0x19')](_0x2fff63,![],null):''));}}));_0x1549e4[_0xa612('0xa')](ewinston[_0xa612('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3b39ea,_0x56ce52){var _0x5a28d1=_0xa612('0x1a');if(_0x3b39ea[_0xa612('0xd')]&&_0x3b39ea[_0xa612('0xd')][_0xa612('0x1b')]&&_0x3b39ea['body']['agent_id']){_0x5a28d1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x5a28d1,_0x3b39ea[_0xa612('0xf')],_0x3b39ea['headers'][_0xa612('0x11')]?_0x3b39ea[_0xa612('0x10')]['x-forwarded-for']:_0x3b39ea[_0xa612('0x12')]['remoteAddress']||_0x3b39ea['ip'],_0x3b39ea[_0xa612('0x14')],_0x56ce52[_0xa612('0x15')],_0x56ce52[_0xa612('0x16')],_0x3b39ea[_0xa612('0x17')]?_0x3b39ea[_0xa612('0x17')]['id']:null,_0x3b39ea[_0xa612('0x17')]?_0x3b39ea[_0xa612('0x17')][_0xa612('0x1c')]:null,_0x3b39ea[_0xa612('0x17')]?_0x3b39ea[_0xa612('0x17')][_0xa612('0x18')]:null,_0x3b39ea[_0xa612('0xd')]&&_0x3b39ea[_0xa612('0xd')][_0xa612('0x1b')]?_0x3b39ea[_0xa612('0xd')][_0xa612('0x1b')]:_0xa612('0x1d'),_0x3b39ea[_0xa612('0xd')]&&_0x3b39ea[_0xa612('0xd')][_0xa612('0x1e')]?_0x3b39ea[_0xa612('0xd')]['agent_id']:'',_0x3b39ea[_0xa612('0xd')]&&_0x3b39ea['body'][_0xa612('0x1f')]?_0x3b39ea[_0xa612('0xd')][_0xa612('0x1f')]:'');},'ignoreRoute':function(_0x52e29f){var _0x39f3cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x39f3cc[_0xa612('0x20')](_0x52e29f[_0xa612('0x14')]);}}));_0x1549e4[_0xa612('0xa')](_0xa612('0x21'),require(_0xa612('0x22')));_0x1549e4['use'](_0xa612('0x23'),require(_0xa612('0x24')));_0x1549e4[_0xa612('0xa')](_0xa612('0x25'),require('./api/voiceContext'));_0x1549e4[_0xa612('0xa')](_0xa612('0x26'),require(_0xa612('0x27')));_0x1549e4['use']('/api/voice/mohs',require(_0xa612('0x28')));_0x1549e4[_0xa612('0xa')]('/api/voice/queues',require(_0xa612('0x29')));_0x1549e4[_0xa612('0xa')](_0xa612('0x2a'),require(_0xa612('0x2b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x2c'),require(_0xa612('0x2d')));_0x1549e4['use']('/api/voice/mails',require(_0xa612('0x2e')));_0x1549e4[_0xa612('0xa')](_0xa612('0x2f'),require(_0xa612('0x30')));_0x1549e4[_0xa612('0xa')](_0xa612('0x31'),require(_0xa612('0x32')));_0x1549e4[_0xa612('0xa')](_0xa612('0x33'),require(_0xa612('0x34')));_0x1549e4[_0xa612('0xa')](_0xa612('0x35'),require(_0xa612('0x36')));_0x1549e4[_0xa612('0xa')](_0xa612('0x37'),require('./api/voiceQueueReport'));_0x1549e4[_0xa612('0xa')]('/api/members/reports',require(_0xa612('0x38')));_0x1549e4[_0xa612('0xa')](_0xa612('0x39'),require(_0xa612('0x3a')));_0x1549e4[_0xa612('0xa')](_0xa612('0x3b'),require(_0xa612('0x3c')));_0x1549e4['use']('/api/mail/out_servers',require(_0xa612('0x3d')));_0x1549e4[_0xa612('0xa')](_0xa612('0x3e'),require(_0xa612('0x3f')));_0x1549e4[_0xa612('0xa')](_0xa612('0x40'),require(_0xa612('0x41')));_0x1549e4[_0xa612('0xa')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x1549e4[_0xa612('0xa')](_0xa612('0x42'),require(_0xa612('0x43')));_0x1549e4[_0xa612('0xa')](_0xa612('0x44'),require(_0xa612('0x45')));_0x1549e4['use']('/api/mail/applications',require(_0xa612('0x46')));_0x1549e4[_0xa612('0xa')](_0xa612('0x47'),require(_0xa612('0x48')));_0x1549e4['use'](_0xa612('0x49'),require(_0xa612('0x4a')));_0x1549e4[_0xa612('0xa')](_0xa612('0x4b'),require(_0xa612('0x4c')));_0x1549e4['use']('/api/fax/accounts',require('./api/faxAccount'));_0x1549e4[_0xa612('0xa')](_0xa612('0x4d'),require(_0xa612('0x4e')));_0x1549e4[_0xa612('0xa')]('/api/fax/interactions',require(_0xa612('0x4f')));_0x1549e4['use'](_0xa612('0x50'),require(_0xa612('0x51')));_0x1549e4['use'](_0xa612('0x52'),require(_0xa612('0x53')));_0x1549e4['use'](_0xa612('0x54'),require(_0xa612('0x55')));_0x1549e4['use']('/api/sms/accounts',require(_0xa612('0x56')));_0x1549e4[_0xa612('0xa')](_0xa612('0x57'),require('./api/smsApplication'));_0x1549e4[_0xa612('0xa')](_0xa612('0x58'),require('./api/smsInteraction'));_0x1549e4[_0xa612('0xa')](_0xa612('0x59'),require('./api/smsMessage'));_0x1549e4[_0xa612('0xa')](_0xa612('0x5a'),require(_0xa612('0x5b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x5c'),require(_0xa612('0x5d')));_0x1549e4['use'](_0xa612('0x5e'),require(_0xa612('0x5f')));_0x1549e4[_0xa612('0xa')](_0xa612('0x60'),require('./api/openchannelInteraction'));_0x1549e4[_0xa612('0xa')](_0xa612('0x61'),require(_0xa612('0x62')));_0x1549e4['use'](_0xa612('0x63'),require('./api/openchannelQueue'));_0x1549e4[_0xa612('0xa')]('/api/chat/websites',require(_0xa612('0x64')));_0x1549e4[_0xa612('0xa')](_0xa612('0x65'),require(_0xa612('0x66')));_0x1549e4[_0xa612('0xa')](_0xa612('0x67'),require(_0xa612('0x68')));_0x1549e4[_0xa612('0xa')](_0xa612('0x69'),require('./api/chatInteraction'));_0x1549e4[_0xa612('0xa')](_0xa612('0x6a'),require(_0xa612('0x6b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x6c'),require(_0xa612('0x6d')));_0x1549e4['use'](_0xa612('0x6e'),require(_0xa612('0x6f')));_0x1549e4[_0xa612('0xa')](_0xa612('0x70'),require(_0xa612('0x71')));_0x1549e4['use'](_0xa612('0x72'),require(_0xa612('0x73')));_0x1549e4[_0xa612('0xa')](_0xa612('0x74'),require(_0xa612('0x75')));_0x1549e4[_0xa612('0xa')](_0xa612('0x76'),require(_0xa612('0x77')));_0x1549e4[_0xa612('0xa')]('/api/cm/hopper',require(_0xa612('0x78')));_0x1549e4[_0xa612('0xa')]('/api/cm/hopper_black',require(_0xa612('0x79')));_0x1549e4[_0xa612('0xa')](_0xa612('0x7a'),require(_0xa612('0x7b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x7c'),require(_0xa612('0x7d')));_0x1549e4[_0xa612('0xa')](_0xa612('0x7e'),require(_0xa612('0x7f')));_0x1549e4[_0xa612('0xa')](_0xa612('0x80'),require(_0xa612('0x81')));_0x1549e4[_0xa612('0xa')](_0xa612('0x82'),require(_0xa612('0x83')));_0x1549e4[_0xa612('0xa')](_0xa612('0x84'),require(_0xa612('0x85')));_0x1549e4[_0xa612('0xa')](_0xa612('0x86'),require(_0xa612('0x87')));_0x1549e4[_0xa612('0xa')]('/api/conditions',require('./api/condition'));_0x1549e4[_0xa612('0xa')](_0xa612('0x88'),require(_0xa612('0x89')));_0x1549e4['use'](_0xa612('0x8a'),require(_0xa612('0x8b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x8c'),require('./api/cdr'));_0x1549e4[_0xa612('0xa')](_0xa612('0x8d'),require('./api/voiceQueuesLog'));_0x1549e4[_0xa612('0xa')](_0xa612('0x8e'),require(_0xa612('0x8f')));_0x1549e4[_0xa612('0xa')]('/api/sounds',require('./api/sound'));_0x1549e4[_0xa612('0xa')]('/api/tags',require(_0xa612('0x90')));_0x1549e4['use'](_0xa612('0x91'),require(_0xa612('0x92')));_0x1549e4[_0xa612('0xa')](_0xa612('0x93'),require('./api/trigger'));_0x1549e4['use'](_0xa612('0x94'),require(_0xa612('0x95')));_0x1549e4[_0xa612('0xa')](_0xa612('0x96'),require(_0xa612('0x97')));_0x1549e4[_0xa612('0xa')](_0xa612('0x98'),require('./api/integrationReport'));_0x1549e4[_0xa612('0xa')](_0xa612('0x99'),require(_0xa612('0x9a')));_0x1549e4['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x1549e4[_0xa612('0xa')]('/api/analytics/extracted_reports',require(_0xa612('0x9b')));_0x1549e4[_0xa612('0xa')](_0xa612('0x9c'),require(_0xa612('0x9d')));_0x1549e4[_0xa612('0xa')](_0xa612('0x9e'),require(_0xa612('0x9f')));_0x1549e4[_0xa612('0xa')](_0xa612('0xa0'),require(_0xa612('0xa1')));_0x1549e4[_0xa612('0xa')]('/api/integrations/salesforce/accounts',require(_0xa612('0xa2')));_0x1549e4[_0xa612('0xa')](_0xa612('0xa3'),require('./api/intSalesforceConfiguration'));_0x1549e4[_0xa612('0xa')]('/api/integrations/salesforce/fields',require(_0xa612('0xa4')));_0x1549e4[_0xa612('0xa')](_0xa612('0xa5'),require(_0xa612('0xa6')));_0x1549e4['use'](_0xa612('0xa7'),require(_0xa612('0xa8')));_0x1549e4[_0xa612('0xa')](_0xa612('0xa9'),require('./api/intSugarcrmField'));_0x1549e4[_0xa612('0xa')](_0xa612('0xaa'),require(_0xa612('0xab')));_0x1549e4['use'](_0xa612('0xac'),require('./api/intDeskConfiguration'));_0x1549e4[_0xa612('0xa')](_0xa612('0xad'),require(_0xa612('0xae')));_0x1549e4[_0xa612('0xa')](_0xa612('0xaf'),require('./api/intZohoAccount'));_0x1549e4[_0xa612('0xa')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x1549e4[_0xa612('0xa')](_0xa612('0xb0'),require(_0xa612('0xb1')));_0x1549e4['use'](_0xa612('0xb2'),require(_0xa612('0xb3')));_0x1549e4[_0xa612('0xa')](_0xa612('0xb4'),require(_0xa612('0xb5')));_0x1549e4[_0xa612('0xa')](_0xa612('0xb6'),require(_0xa612('0xb7')));_0x1549e4[_0xa612('0xa')](_0xa612('0xb8'),require(_0xa612('0xb9')));_0x1549e4[_0xa612('0xa')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x1549e4[_0xa612('0xa')](_0xa612('0xba'),require(_0xa612('0xbb')));_0x1549e4[_0xa612('0xa')](_0xa612('0xbc'),require(_0xa612('0xbd')));_0x1549e4['use'](_0xa612('0xbe'),require('./api/intVtigerConfiguration'));_0x1549e4[_0xa612('0xa')](_0xa612('0xbf'),require(_0xa612('0xc0')));_0x1549e4[_0xa612('0xa')](_0xa612('0xc1'),require(_0xa612('0xc2')));_0x1549e4['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x1549e4[_0xa612('0xa')](_0xa612('0xc3'),require(_0xa612('0xc4')));_0x1549e4[_0xa612('0xa')](_0xa612('0xc5'),require('./api/intDynamics365Account'));_0x1549e4[_0xa612('0xa')](_0xa612('0xc6'),require(_0xa612('0xc7')));_0x1549e4[_0xa612('0xa')](_0xa612('0xc8'),require('./api/intDynamics365Field'));_0x1549e4[_0xa612('0xa')](_0xa612('0xc9'),require(_0xa612('0xca')));_0x1549e4[_0xa612('0xa')]('/api/integrations/freshsales/configurations',require(_0xa612('0xcb')));_0x1549e4['use'](_0xa612('0xcc'),require('./api/intFreshsalesField'));_0x1549e4[_0xa612('0xa')](_0xa612('0xcd'),require(_0xa612('0xce')));_0x1549e4[_0xa612('0xa')](_0xa612('0xcf'),require('./api/chatQueueReport'));_0x1549e4['use'](_0xa612('0xd0'),require(_0xa612('0xd1')));_0x1549e4['use']('/api/jscripty/answers/reports',require(_0xa612('0xd2')));_0x1549e4['use'](_0xa612('0xd3'),require(_0xa612('0xd4')));_0x1549e4['use'](_0xa612('0xd5'),require('./api/jscriptySessionReport'));_0x1549e4['use'](_0xa612('0xd6'),require(_0xa612('0xd7')));_0x1549e4[_0xa612('0xa')]('/api/square/reports',require(_0xa612('0xd8')));_0x1549e4[_0xa612('0xa')](_0xa612('0xd9'),require(_0xa612('0xda')));_0x1549e4[_0xa612('0xa')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x1549e4['use']('/api/settings',require(_0xa612('0xdb')));_0x1549e4[_0xa612('0xa')](_0xa612('0xdc'),require(_0xa612('0xdd')));_0x1549e4[_0xa612('0xa')](_0xa612('0xde'),require(_0xa612('0xdf')));_0x1549e4[_0xa612('0xa')](_0xa612('0xe0'),require(_0xa612('0xe1')));_0x1549e4['use'](_0xa612('0xe2'),require(_0xa612('0xe3')));_0x1549e4[_0xa612('0xa')](_0xa612('0xe4'),require(_0xa612('0xe5')));_0x1549e4[_0xa612('0xa')](_0xa612('0xe6'),require('./api/license'));_0x1549e4[_0xa612('0xa')](_0xa612('0xe7'),require(_0xa612('0xe8')));_0x1549e4['use']('/api/migrations',require(_0xa612('0xe9')));_0x1549e4['use'](_0xa612('0xea'),require(_0xa612('0xeb')));_0x1549e4[_0xa612('0xa')](_0xa612('0xec'),require(_0xa612('0xed')));_0x1549e4['use'](_0xa612('0xee'),require(_0xa612('0xef')));_0x1549e4[_0xa612('0xa')](_0xa612('0xf0'),require(_0xa612('0xf1')));_0x1549e4['use'](_0xa612('0xf2'),require(_0xa612('0xf3')));_0x1549e4[_0xa612('0xa')]('/api/openchannel/reports/transfer',require(_0xa612('0xf4')));_0x1549e4[_0xa612('0xa')](_0xa612('0xf5'),require(_0xa612('0xf6')));_0x1549e4[_0xa612('0xa')](_0xa612('0xf7'),require('./api/cmList'));_0x1549e4[_0xa612('0xa')](_0xa612('0xf8'),require(_0xa612('0xf9')));_0x1549e4[_0xa612('0xa')](_0xa612('0xfa'),require(_0xa612('0xfb')));_0x1549e4['use'](_0xa612('0xfc'),require(_0xa612('0xfd')));_0x1549e4[_0xa612('0xa')](_0xa612('0xfe'),require('./api/userProfileResource'));_0x1549e4[_0xa612('0xa')](_0xa612('0xff'),require(_0xa612('0x100')));_0x1549e4[_0xa612('0xa')](_0xa612('0x101'),require('./api/whatsappAccount'));_0x1549e4[_0xa612('0xa')](_0xa612('0x102'),require(_0xa612('0x103')));_0x1549e4[_0xa612('0xa')](_0xa612('0x104'),require(_0xa612('0x105')));_0x1549e4[_0xa612('0xa')](_0xa612('0x106'),require('./api/whatsappMessage'));_0x1549e4[_0xa612('0xa')]('/api/whatsapp/reports/queue',require(_0xa612('0x107')));_0x1549e4[_0xa612('0xa')](_0xa612('0x108'),require(_0xa612('0x109')));_0x1549e4['use'](_0xa612('0x10a'),require(_0xa612('0x10b')));_0x1549e4['use'](_0xa612('0x10c'),require('./api/cloudProvider'));_0x1549e4[_0xa612('0xa')](_0xa612('0x10d'),require(_0xa612('0x10e')));_0x1549e4[_0xa612('0xa')](_0xa612('0x10f'),require(_0xa612('0x110')));_0x1549e4[_0xa612('0xa')](_0xa612('0x111'),require(_0xa612('0x112')));_0x1549e4['use'](_0xa612('0x113'),require(_0xa612('0x114')));_0x1549e4[_0xa612('0xa')](_0xa612('0x115'),require('./api/rpc'));_0x1549e4[_0xa612('0xa')](_0xa612('0x116'),require('./api/version'));_0x1549e4['use']('/api/system',require(_0xa612('0x117')));_0x1549e4[_0xa612('0xa')]('/api/pm2',require('./api/pm2'));_0x1549e4['use']('/api/webbar',require(_0xa612('0x118')));_0x1549e4[_0xa612('0xa')](_0xa612('0x119'),express[_0xa612('0x11a')](path[_0xa612('0x11b')](config[_0xa612('0x11c')],_0xa612('0x119'))));_0x1549e4[_0xa612('0xa')](_0xa612('0x11d'),express[_0xa612('0x11a')](path[_0xa612('0x11b')](config[_0xa612('0x11c')],'/www')));_0x1549e4['use'](_0xa612('0x11e'),express[_0xa612('0x11a')](path[_0xa612('0x11b')](config[_0xa612('0x11c')],_0xa612('0x11e'))));_0x1549e4[_0xa612('0xa')](_0xa612('0x11f'),express[_0xa612('0x11a')](path[_0xa612('0x11b')](config[_0xa612('0x11c')],'snippet','3.0.0')));_0x1549e4['use'](_0xa612('0x120'),express[_0xa612('0x11a')](path[_0xa612('0x11b')](config[_0xa612('0x11c')],_0xa612('0x121'))));_0x1549e4[_0xa612('0x122')](_0xa612('0x123'))[_0xa612('0x124')](errors[0x194]);_0x1549e4[_0xa612('0x122')]('/*')[_0xa612('0x124')](function(_0x4c618d,_0x194649){_0x194649[_0xa612('0x125')](path[_0xa612('0x126')](_0x1549e4['get']('appPath')+'/index.html'));});};var sensitiveFields=['username',_0xa612('0x127'),'newPassword',_0xa612('0x128'),'firstName',_0xa612('0x129'),_0xa612('0x12a'),'phone',_0xa612('0x12b'),_0xa612('0x12c'),_0xa612('0x12d'),_0xa612('0x12e'),_0xa612('0x12f'),_0xa612('0x130'),_0xa612('0x131'),'accessKey',_0xa612('0x132'),_0xa612('0x133'),'channelSecret',_0xa612('0x134'),_0xa612('0x135'),_0xa612('0x136'),_0xa612('0x137'),_0xa612('0x138'),_0xa612('0x139'),_0xa612('0x13a'),'calleridnum',_0xa612('0x13b'),_0xa612('0x13c'),_0xa612('0x13d'),_0xa612('0x13e'),_0xa612('0x13f'),_0xa612('0x140'),_0xa612('0x141'),_0xa612('0x17'),_0xa612('0x142'),_0xa612('0x143'),_0xa612('0x144'),_0xa612('0x145'),_0xa612('0x146'),'registry',_0xa612('0x147')];function maskSensitiveData(_0x185e8c){var _0x540450=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x185e8c))return;for(var _0x56e593 in _0x185e8c){if(_[_0xa612('0x148')](_0x185e8c[_0x56e593])){for(var _0x147ae9=0x0;_0x147ae9<_0x185e8c[_0x56e593][_0xa612('0x149')];_0x147ae9++){maskSensitiveData(_0x185e8c[_0x56e593][_0x147ae9]);}}else if(_['isPlainObject'](_0x185e8c[_0x56e593])){maskSensitiveData(_0x185e8c[_0x56e593]);}else if(_['isString'](_0x185e8c[_0x56e593])){_0x185e8c[_0x56e593]=_0x185e8c[_0x56e593][_0xa612('0x14a')](/{{{/g,'@@{')['replace'](/}}}/g,_0xa612('0x14b'))['replace'](/{{/g,'@{')[_0xa612('0x14a')](/}}/g,'}@');if(_[_0xa612('0x14c')](sensitiveFields,_0x56e593)){_0x185e8c[_0x56e593]=_0x185e8c[_0x56e593][_0xa612('0x14a')](_0x540450,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 02748b1..ce28759 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c71=['../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','rpc','port','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','merge','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.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/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc'];(function(_0xe5a01e,_0x3b6713){var _0x2cd4f6=function(_0x306f2c){while(--_0x306f2c){_0xe5a01e['push'](_0xe5a01e['shift']());}};_0x2cd4f6(++_0x3b6713);}(_0x4c71,0x16a));var _0x14c7=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4c71[_0x346737];return _0x1ade2e;};'use strict';var jayson=require(_0x14c7('0x0'));var BPromise=require(_0x14c7('0x1'));var _=require(_0x14c7('0x2'));var config=require(_0x14c7('0x3'));exports['listen']=function(){return new BPromise(function(_0xb46bc,_0x448ee1){var _0x541910={};_0x541910=_['merge'](_0x541910,require(_0x14c7('0x4')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x5')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x6')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x7')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x8')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0xa')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0xb')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0xc')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0xd')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0xe')));_0x541910=_['merge'](_0x541910,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0xf')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x10')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x11')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x12')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/mailInteraction/mailInteraction.rpc'));_0x541910=_['merge'](_0x541910,require('../api/mailMessage/mailMessage.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x13')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/faxAccount/faxAccount.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x14')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/faxInteraction/faxInteraction.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x15')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x16')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x17')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x18')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x19')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x1a')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/smsQueue/smsQueue.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x1b')));_0x541910=_['merge'](_0x541910,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x1c')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x1d')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x1e')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/chatQueue/chatQueue.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x1f')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x20')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x21')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x22')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x23')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x24')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x25')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x26')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x27')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x28')));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x29')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x2a')));_0x541910=_['merge'](_0x541910,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x2b')));_0x541910=_['merge'](_0x541910,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x2c')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x2d')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x2e')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x2f')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x30')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x31')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x32')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/setting/setting.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x33')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x34')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x35')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x36')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/campaign/campaign.rpc'));_0x541910=_['merge'](_0x541910,require(_0x14c7('0x37')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x38')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x39')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x3a')));_0x541910=_[_0x14c7('0x9')](_0x541910,require(_0x14c7('0x3b')));_0x541910=_[_0x14c7('0x9')](_0x541910,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x541910=_['merge'](_0x541910,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x5ad243=jayson[_0x14c7('0x3c')](_0x541910)[_0x14c7('0x3d')]();var _0x42565f=config[_0x14c7('0x3e')][_0x14c7('0x3f')]||config[_0x14c7('0x3f')]+0x1;var _0x5506f1=config[_0x14c7('0x3e')]['ip']||'localhost';_0x5ad243['on'](_0x14c7('0x40'),function(_0x52866b){return _0x448ee1(_0x52866b);});_0x5ad243[_0x14c7('0x41')](_0x42565f,_0x5506f1,function(){console['log'](_0x14c7('0x42'),_0x5506f1,_0x42565f);require(_0x14c7('0x43'))[_0x14c7('0x44')]();return _0xb46bc(_0x14c7('0x45')+_0x5506f1+':'+_0x42565f);});});}; \ No newline at end of file +var _0x6646=['../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.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/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc'];(function(_0x393926,_0x4b81d1){var _0x4a1327=function(_0x21fb6f){while(--_0x21fb6f){_0x393926['push'](_0x393926['shift']());}};_0x4a1327(++_0x4b81d1);}(_0x6646,0x183));var _0x6664=function(_0x2563f2,_0x286eaf){_0x2563f2=_0x2563f2-0x0;var _0x2e75bc=_0x6646[_0x2563f2];return _0x2e75bc;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x6664('0x0'));var config=require(_0x6664('0x1'));exports[_0x6664('0x2')]=function(){return new BPromise(function(_0x55365d,_0x3924a8){var _0x1d969d={};_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x4')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x5')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x6')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x7')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x8')));_0x1d969d=_['merge'](_0x1d969d,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x9')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/memberReport/memberReport.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0xa')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0xb')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0xc')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0xd')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0xe')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0xf')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x10')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x11')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x12')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x13')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x14')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/faxApplication/faxApplication.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x15')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x16')));_0x1d969d=_['merge'](_0x1d969d,require('../api/faxQueue/faxQueue.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1d969d=_['merge'](_0x1d969d,require('../api/smsAccount/smsAccount.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x17')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x18')));_0x1d969d=_['merge'](_0x1d969d,require('../api/smsQueue/smsQueue.rpc'));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x19')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1a')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1b')));_0x1d969d=_['merge'](_0x1d969d,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1d969d=_['merge'](_0x1d969d,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1c')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1d')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1e')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x1f')));_0x1d969d=_['merge'](_0x1d969d,require('../api/cmHopper/cmHopper.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x20')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x21')));_0x1d969d=_['merge'](_0x1d969d,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x22')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x23')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/sound/sound.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/template/template.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x24')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x25')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x26')));_0x1d969d=_['merge'](_0x1d969d,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x27')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x28')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x29')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x2a')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x2b')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x2c')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x2d')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x2e')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x2f')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x30')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x31')));_0x1d969d=_['merge'](_0x1d969d,require('../api/setting/setting.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x32')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x33')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x34')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x35')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x36')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/attachment/attachment.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/plugin/plugin.rpc'));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x37')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x38')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require(_0x6664('0x39')));_0x1d969d=_['merge'](_0x1d969d,require(_0x6664('0x3a')));_0x1d969d=_[_0x6664('0x3')](_0x1d969d,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4993e8=jayson['server'](_0x1d969d)['http']();var _0x4fb3f9=config[_0x6664('0x3b')][_0x6664('0x3c')]||config[_0x6664('0x3c')]+0x1;var _0x43a4a8=config['rpc']['ip']||_0x6664('0x3d');_0x4993e8['on'](_0x6664('0x3e'),function(_0x871e20){return _0x3924a8(_0x871e20);});_0x4993e8[_0x6664('0x2')](_0x4fb3f9,_0x43a4a8,function(){console[_0x6664('0x3f')](_0x6664('0x40'),_0x43a4a8,_0x4fb3f9);require(_0x6664('0x41'))[_0x6664('0x42')]();return _0x55365d(_0x6664('0x43')+_0x43a4a8+':'+_0x4fb3f9);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index fef2749..9c25455 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x335dae,_0x2d9854){var _0x358893=function(_0x255937){while(--_0x255937){_0x335dae['push'](_0x335dae['shift']());}};_0x358893(++_0x2d9854);}(_0xef0f,0x168));var _0xfef0=function(_0xc10a88,_0x38b3f9){_0xc10a88=_0xc10a88-0x0;var _0x263183=_0xef0f[_0xc10a88];return _0x263183;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate; \ No newline at end of file +var _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x28d6e7,_0x151d60){_0x28d6e7=_0x28d6e7-0x0;var _0x5a8bb9=_0x9ffd[_0x28d6e7];return _0x5a8bb9;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e04d2d3..cd3a7a0 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 _0x7031=['sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','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','WAIT','label','exports','util','lodash','EventEmitter','./reply','setEncoding','setTimeout','utf8','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','pipe','command','write','destroy','inherits','prototype','sync'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7031,0x19a));var _0x1703=function(_0x488c71,_0x30c149){_0x488c71=_0x488c71-0x0;var _0x3a13ae=_0x7031[_0x488c71];return _0x3a13ae;};'use strict';var util=require(_0x1703('0x0'));var _=require(_0x1703('0x1'));var EventEmitter=require('events')[_0x1703('0x2')];var AGIReply=require(_0x1703('0x3'));var AGIError=require('./error');function AGIChannel(_0x1ac05c){var _0x193f2a=this,_0x520961=new AGIReply(),_0x1ad53b=![],_0x438115={};EventEmitter['call'](_0x193f2a);_0x1ac05c[_0x1703('0x4')]('utf8');_0x1ac05c[_0x1703('0x5')](0x8*0x3c*0x3c*0x3e8);_0x520961[_0x1703('0x4')](_0x1703('0x6'));_0x520961['on']('headers',function(_0x1cba9a){for(var _0x3acf9c in _0x1cba9a){_0x193f2a[_0x3acf9c]=_0x1cba9a[_0x3acf9c];}_0x193f2a[_0x1703('0x7')]('ready');});_0x520961['on'](_0x1703('0x8'),function(_0x3feed6){if(_0x3feed6[_0x1703('0x9')]()==_0x1703('0xa')){_0x193f2a[_0x1703('0x7')](_0x1703('0xa'));return;}if(_0x3feed6[_0x1703('0xb')](0x0,0xb)==_0x1703('0xc')){_0x1ad53b=!![];}if(_0x1ad53b){_0x438115['rx']+=_0x3feed6+'\x0a';if(_0x3feed6[_0x1703('0xd')](_0x1703('0xe'))!=-0x1){_0x1ad53b=![];}}else{_0x438115['rx']=_0x3feed6;}if(_0x1ad53b){return;}if(typeof _0x438115['cb']==_0x1703('0xf')){var _0x3cfcec=_0x438115['rx'][_0x1703('0xb')](0x0,0x3),_0x157055=null,_0x24b81e=null;_0x3cfcec=parseInt(_0x3cfcec);if(isNaN(_0x3cfcec)){_0x438115['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1703('0x10')});return;}if(_0x3cfcec!=0xc8){_0x438115['cb'](null,{'code':_0x3cfcec,'result':-0x1,'extra':'KO'});return;}_0x157055=_0x438115['rx'][_0x1703('0xb')](0x4)['replace']('result=','');if(_0x157055[_0x1703('0x11')]('\x20')!=-0x1){_0x157055=_0x157055[_0x1703('0x12')](0x0,_0x157055['indexOf']('\x20'));}if(_[_0x1703('0x13')](_0x157055,'-1')){_0x157055=parseInt(_0x157055);}_0x24b81e=_0x438115['rx'][_0x1703('0x14')]('\x20');if(_0x24b81e[_0x1703('0x15')]==0x3){_0x24b81e=_0x24b81e[0x2]['substring'](0x1,_0x24b81e[0x2][_0x1703('0x15')]-0x1);}else if(_0x24b81e[_0x1703('0x15')]>0x3){var _0x4d53d1=/\((.+)\)/;var _0x303c3b=_0x438115['rx'][_0x1703('0x16')](_0x4d53d1);if(_0x303c3b){_0x24b81e=_0x303c3b[0x1];}else{_0x24b81e=null;}}else{_0x24b81e=null;}_0x438115['cb'](null,{'code':_0x3cfcec,'result':_0x157055,'extra':_0x24b81e});}});_0x1ac05c['on'](_0x1703('0x17'),function(_0x3c0695){_0x193f2a[_0x1703('0x7')](_0x1703('0x17'),new AGIError(_0x1703('0x18'),_0x3c0695['code']));});_0x1ac05c['on']('close',function(){_0x193f2a['emit'](_0x1703('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1ac05c['on'](_0x1703('0x1a'),function(){_0x193f2a[_0x1703('0x7')](_0x1703('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1ac05c['destroy']();});_0x1ac05c[_0x1703('0x1b')](_0x520961);this[_0x1703('0x1c')]=function(_0x41f7b3,_0x2bf640){var _0x41f7b3=_0x41f7b3||'',_0x2bf640=typeof _0x2bf640=='function'?_0x2bf640:new Function();_0x438115={'tx':_0x41f7b3,'rx':'','cb':_0x2bf640};_0x1ac05c[_0x1703('0x1d')](_0x41f7b3+'\x0a');},this[_0x1703('0x19')]=function(){_0x1ac05c[_0x1703('0x1e')]();};}util[_0x1703('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x1703('0x20')]['sendRequest']=function(_0x4a35c2){return this[_0x1703('0x1c')][_0x1703('0x21')](this,_0x4a35c2);};AGIChannel[_0x1703('0x20')]['answer']=function(){return this[_0x1703('0x22')](_0x1703('0x23'));};AGIChannel[_0x1703('0x20')][_0x1703('0x24')]=function(_0x59b809,_0x509424,_0x38afcf){_0x59b809=_0x59b809===undefined?_0x1703('0x25'):_0x59b809;_0x509424=_0x509424===undefined?'5':_0x509424;_0x38afcf=_0x38afcf===undefined?'1':_0x38afcf;return this['sendRequest'](util[_0x1703('0x26')](_0x1703('0x27'),_0x59b809,_0x509424*0x3e8,_0x38afcf));};AGIChannel[_0x1703('0x20')][_0x1703('0x28')]=function(_0x525f06){_0x525f06=_0x525f06||'NO\x20MESSAGE';return this['sendRequest'](util[_0x1703('0x26')](_0x1703('0x29'),_0x525f06));};AGIChannel[_0x1703('0x20')]['exec']=function(_0x304968,_0x179082){if(_[_0x1703('0x2a')](_0x179082)){return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x2b'),_0x304968,_0x179082['join'](',')));}return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x2b'),_0x304968,_0x179082));};AGIChannel[_0x1703('0x20')]['setContext']=function(_0x434c7e){return this['sendRequest'](util[_0x1703('0x26')](_0x1703('0x2c'),_0x434c7e));};AGIChannel['prototype']['setExtension']=function(_0xfdc7d5){return this[_0x1703('0x22')](util['format'](_0x1703('0x2d'),_0xfdc7d5));};AGIChannel[_0x1703('0x20')][_0x1703('0x2e')]=function(_0xf76233){return this['sendRequest'](util['format'](_0x1703('0x2f'),_0xf76233));};AGIChannel[_0x1703('0x20')][_0x1703('0xa')]=function(){return this[_0x1703('0x22')](_0x1703('0x30'));};AGIChannel[_0x1703('0x20')][_0x1703('0x31')]=function(_0x5c90dc,_0x1ef4ea){var _0x5189aa=_[_0x1703('0x32')](_0x1ef4ea)||_['isNumber'](_0x1ef4ea)?_0x1ef4ea[_0x1703('0x33')]():_0x1ef4ea;return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x34'),_0x5c90dc,_0x5189aa?_0x5189aa[_0x1703('0x33')]()[_0x1703('0x35')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1a650e,_0x30b276){return this['sendRequest'](util[_0x1703('0x26')](_0x1703('0x36'),_0x1a650e,_0x30b276));};AGIChannel[_0x1703('0x20')][_0x1703('0x37')]=function(_0x236e22,_0x1c5488){return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x38'),_0x236e22,_0x1c5488));};AGIChannel[_0x1703('0x20')][_0x1703('0x39')]=function(_0x15d9db,_0x2525bc){return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x3a'),_0x15d9db,_0x2525bc));};AGIChannel[_0x1703('0x20')]['continueAt']=function(_0x4f3dc6,_0x5afe60,_0x3e246b){_0x5afe60=_0x5afe60||this[_0x1703('0x3b')];_0x3e246b=_0x3e246b||0x1;this[_0x1703('0x3c')](_0x4f3dc6);this['setExtension'](_0x5afe60);this[_0x1703('0x2e')](_0x3e246b);return this[_0x1703('0x28')](util[_0x1703('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x4f3dc6,_0x5afe60,_0x3e246b));};AGIChannel[_0x1703('0x20')][_0x1703('0x3d')]=function(_0x37ac42){return this[_0x1703('0x22')](util[_0x1703('0x26')](_0x1703('0x3e'),_0x37ac42));};AGIChannel['prototype']['recordFile']=function(_0x2aeb10,_0x4d8eff,_0x3f8da9,_0x146fc5,_0x2b4f6d,_0x3bb49f){_0x4d8eff=_0x4d8eff||_0x1703('0x3f');_0x3f8da9=_0x3f8da9||'';_0x146fc5=_0x146fc5===undefined?-0x1:_0x146fc5==='-1'?-0x1:_0x146fc5*0x3e8;_0x2b4f6d=_0x2b4f6d===undefined?'':'s='+_0x2b4f6d;_0x3bb49f=_0x3bb49f?_0x1703('0x40'):'';return this[_0x1703('0x22')](util['format'](_0x1703('0x41'),_0x2aeb10,_0x4d8eff,_0x3f8da9,_0x146fc5,_0x3bb49f,_0x2b4f6d));};AGIChannel[_0x1703('0x20')][_0x1703('0x42')]=function(_0x212757,_0x1f05ef){_0x1f05ef=_0x1f05ef||'';return this[_0x1703('0x22')](util['format'](_0x1703('0x43'),_0x212757,_0x1f05ef));};AGIChannel[_0x1703('0x20')]['agi']=function(_0x1d0a6c){return this[_0x1703('0x44')](_0x1703('0x45'),_0x1d0a6c);};AGIChannel[_0x1703('0x20')][_0x1703('0x46')]=function(_0x3fd08f){return this['exec'](_0x1703('0x47'),_0x3fd08f);};AGIChannel['prototype'][_0x1703('0x17')]=function(_0x3ea638,_0x3682ce){this['noop'](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3ea638['id'],_0x3ea638[_0x1703('0x48')],_0x3682ce));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1703('0x49')]=AGIChannel; \ No newline at end of file +var _0x0d91=['isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22'];(function(_0x483dba,_0x3fcd13){var _0x2fd8c2=function(_0x60a4d2){while(--_0x60a4d2){_0x483dba['push'](_0x483dba['shift']());}};_0x2fd8c2(++_0x3fcd13);}(_0x0d91,0x76));var _0x10d9=function(_0x6edc85,_0x2c7710){_0x6edc85=_0x6edc85-0x0;var _0x4631a9=_0x0d91[_0x6edc85];return _0x4631a9;};'use strict';var util=require(_0x10d9('0x0'));var _=require(_0x10d9('0x1'));var EventEmitter=require(_0x10d9('0x2'))[_0x10d9('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x10d9('0x4'));function AGIChannel(_0x38311f){var _0x132a71=this,_0x56ab5d=new AGIReply(),_0x2f6e57=![],_0x305c20={};EventEmitter[_0x10d9('0x5')](_0x132a71);_0x38311f['setEncoding'](_0x10d9('0x6'));_0x38311f[_0x10d9('0x7')](0x8*0x3c*0x3c*0x3e8);_0x56ab5d[_0x10d9('0x8')](_0x10d9('0x6'));_0x56ab5d['on'](_0x10d9('0x9'),function(_0x3d4ca7){for(var _0x3e5013 in _0x3d4ca7){_0x132a71[_0x3e5013]=_0x3d4ca7[_0x3e5013];}_0x132a71[_0x10d9('0xa')](_0x10d9('0xb'));});_0x56ab5d['on'](_0x10d9('0xc'),function(_0x698aa4){if(_0x698aa4[_0x10d9('0xd')]()==_0x10d9('0xe')){_0x132a71[_0x10d9('0xa')](_0x10d9('0xe'));return;}if(_0x698aa4[_0x10d9('0xf')](0x0,0xb)==_0x10d9('0x10')){_0x2f6e57=!![];}if(_0x2f6e57){_0x305c20['rx']+=_0x698aa4+'\x0a';if(_0x698aa4['search'](_0x10d9('0x11'))!=-0x1){_0x2f6e57=![];}}else{_0x305c20['rx']=_0x698aa4;}if(_0x2f6e57){return;}if(typeof _0x305c20['cb']==_0x10d9('0x12')){var _0x12a2b4=_0x305c20['rx']['substring'](0x0,0x3),_0x2910ab=null,_0x316417=null;_0x12a2b4=parseInt(_0x12a2b4);if(isNaN(_0x12a2b4)){_0x305c20['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x10d9('0x13')});return;}if(_0x12a2b4!=0xc8){_0x305c20['cb'](null,{'code':_0x12a2b4,'result':-0x1,'extra':'KO'});return;}_0x2910ab=_0x305c20['rx']['substring'](0x4)[_0x10d9('0x14')](_0x10d9('0x15'),'');if(_0x2910ab[_0x10d9('0x16')]('\x20')!=-0x1){_0x2910ab=_0x2910ab[_0x10d9('0x17')](0x0,_0x2910ab[_0x10d9('0x16')]('\x20'));}if(_[_0x10d9('0x18')](_0x2910ab,'-1')){_0x2910ab=parseInt(_0x2910ab);}_0x316417=_0x305c20['rx'][_0x10d9('0x19')]('\x20');if(_0x316417[_0x10d9('0x1a')]==0x3){_0x316417=_0x316417[0x2][_0x10d9('0xf')](0x1,_0x316417[0x2][_0x10d9('0x1a')]-0x1);}else if(_0x316417['length']>0x3){var _0x5658b5=/\((.+)\)/;var _0x379754=_0x305c20['rx'][_0x10d9('0x1b')](_0x5658b5);if(_0x379754){_0x316417=_0x379754[0x1];}else{_0x316417=null;}}else{_0x316417=null;}_0x305c20['cb'](null,{'code':_0x12a2b4,'result':_0x2910ab,'extra':_0x316417});}});_0x38311f['on'](_0x10d9('0x1c'),function(_0x1e9db9){_0x132a71['emit'](_0x10d9('0x1c'),new AGIError(_0x10d9('0x1d'),_0x1e9db9[_0x10d9('0x1e')]));});_0x38311f['on'](_0x10d9('0x1f'),function(){_0x132a71['emit'](_0x10d9('0x1f'),new AGIError(_0x10d9('0x20')));});_0x38311f['on']('timeout',function(){_0x132a71['emit'](_0x10d9('0x21'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x38311f[_0x10d9('0x22')]();});_0x38311f[_0x10d9('0x23')](_0x56ab5d);this['command']=function(_0x322b57,_0x2c1346){var _0x322b57=_0x322b57||'',_0x2c1346=typeof _0x2c1346==_0x10d9('0x12')?_0x2c1346:new Function();_0x305c20={'tx':_0x322b57,'rx':'','cb':_0x2c1346};_0x38311f[_0x10d9('0x24')](_0x322b57+'\x0a');},this[_0x10d9('0x1f')]=function(){_0x38311f[_0x10d9('0x22')]();};}util[_0x10d9('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x10d9('0x26')][_0x10d9('0x27')]=function(_0x43e8e4){return this[_0x10d9('0x28')][_0x10d9('0x29')](this,_0x43e8e4);};AGIChannel[_0x10d9('0x26')]['answer']=function(){return this[_0x10d9('0x27')](_0x10d9('0x2a'));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x2b')]=function(_0x4b2619,_0x3ba01f,_0x50971e){_0x4b2619=_0x4b2619===undefined?_0x10d9('0x2c'):_0x4b2619;_0x3ba01f=_0x3ba01f===undefined?'5':_0x3ba01f;_0x50971e=_0x50971e===undefined?'1':_0x50971e;return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x2e'),_0x4b2619,_0x3ba01f*0x3e8,_0x50971e));};AGIChannel['prototype'][_0x10d9('0x2f')]=function(_0x4cfc1c){_0x4cfc1c=_0x4cfc1c||_0x10d9('0x30');return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x31'),_0x4cfc1c));};AGIChannel[_0x10d9('0x26')]['exec']=function(_0x524eab,_0x1108f5){if(_[_0x10d9('0x32')](_0x1108f5)){return this['sendRequest'](util['format'](_0x10d9('0x33'),_0x524eab,_0x1108f5[_0x10d9('0x34')](',')));}return this[_0x10d9('0x27')](util['format'](_0x10d9('0x33'),_0x524eab,_0x1108f5));};AGIChannel['prototype'][_0x10d9('0x35')]=function(_0x9602c0){return this['sendRequest'](util['format'](_0x10d9('0x36'),_0x9602c0));};AGIChannel[_0x10d9('0x26')]['setExtension']=function(_0x26d3a4){return this[_0x10d9('0x27')](util['format'](_0x10d9('0x37'),_0x26d3a4));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x38')]=function(_0x53df21){return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x39'),_0x53df21));};AGIChannel['prototype'][_0x10d9('0xe')]=function(){return this[_0x10d9('0x27')]('HANGUP');};AGIChannel[_0x10d9('0x26')][_0x10d9('0x3a')]=function(_0x6efe7b,_0x3950b5){var _0x1d79a2=_[_0x10d9('0x3b')](_0x3950b5)||_['isNumber'](_0x3950b5)?_0x3950b5['toString']():_0x3950b5;return this['sendRequest'](util[_0x10d9('0x2d')](_0x10d9('0x3c'),_0x6efe7b,_0x1d79a2?_0x1d79a2[_0x10d9('0x3d')]()[_0x10d9('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x10d9('0x26')]['sayNumber']=function(_0x3e1c4e,_0x2e7eae){return this[_0x10d9('0x27')](util[_0x10d9('0x2d')]('SAY\x20NUMBER\x20%s\x20%s',_0x3e1c4e,_0x2e7eae));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x3e')]=function(_0xdd2c0d,_0x36a13f){return this[_0x10d9('0x27')](util[_0x10d9('0x2d')]('SAY\x20DIGITS\x20%s\x20%s',_0xdd2c0d,_0x36a13f));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x3f')]=function(_0x2c69dc,_0x320d9f){return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x40'),_0x2c69dc,_0x320d9f));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x41')]=function(_0x5cbeb3,_0x712f2c,_0x212dc0){_0x712f2c=_0x712f2c||this[_0x10d9('0x42')];_0x212dc0=_0x212dc0||0x1;this['setContext'](_0x5cbeb3);this[_0x10d9('0x43')](_0x712f2c);this[_0x10d9('0x38')](_0x212dc0);return this['noop'](util[_0x10d9('0x2d')](_0x10d9('0x44'),_0x5cbeb3,_0x712f2c,_0x212dc0));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x45')]=function(_0x285981){return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x46'),_0x285981));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x47')]=function(_0x5933c5,_0x2753a5,_0x137a1f,_0x27b722,_0xbdb82c,_0x2b6583){_0x2753a5=_0x2753a5||_0x10d9('0x48');_0x137a1f=_0x137a1f||'';_0x27b722=_0x27b722===undefined?-0x1:_0x27b722==='-1'?-0x1:_0x27b722*0x3e8;_0xbdb82c=_0xbdb82c===undefined?'':'s='+_0xbdb82c;_0x2b6583=_0x2b6583?_0x10d9('0x49'):'';return this[_0x10d9('0x27')](util[_0x10d9('0x2d')](_0x10d9('0x4a'),_0x5933c5,_0x2753a5,_0x137a1f,_0x27b722,_0x2b6583,_0xbdb82c));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x4b')]=function(_0x3c5b63,_0x54764f){_0x54764f=_0x54764f||'';return this['sendRequest'](util[_0x10d9('0x2d')](_0x10d9('0x4c'),_0x3c5b63,_0x54764f));};AGIChannel[_0x10d9('0x26')][_0x10d9('0x4d')]=function(_0x390b00){return this[_0x10d9('0x4e')]('AGI',_0x390b00);};AGIChannel['prototype'][_0x10d9('0x4f')]=function(_0x43ac87){return this['exec'](_0x10d9('0x50'),_0x43ac87);};AGIChannel[_0x10d9('0x26')][_0x10d9('0x1c')]=function(_0x159cb4,_0x41dc86){this['noop'](util[_0x10d9('0x2d')](_0x10d9('0x51'),_0x159cb4['id'],_0x159cb4[_0x10d9('0x52')],_0x41dc86));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x10d9('0x53')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 1164ab8..19c7b79 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 _0x2ef9=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x4b5b02,_0x57241b){var _0x3fc403=function(_0x494e42){while(--_0x494e42){_0x4b5b02['push'](_0x4b5b02['shift']());}};_0x3fc403(++_0x57241b);}(_0x2ef9,0x1ea));var _0x92ef=function(_0x232305,_0x650df6){_0x232305=_0x232305-0x0;var _0x336df7=_0x2ef9[_0x232305];return _0x336df7;};'use strict';var util=require(_0x92ef('0x0'));var error={'E_AGI_UNDEFINED':_0x92ef('0x1'),'E_AGI_ARGUMENT_PORT':_0x92ef('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x92ef('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x92ef('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x92ef('0x5'),'E_AGI_SOCKET_ERROR':_0x92ef('0x6'),'E_AGI_SOCKET_CLOSE':_0x92ef('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x92ef('0x8'),'E_AGI_COMMAND_EMPTY':_0x92ef('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x103abe){var _0x103abe=_0x103abe||null,_0x12a604=_0x12a604||[],_0x46a205=0x1,_0x5cac4c='';if(!error[_0x103abe]){_0x103abe='E_AGI_UNDEFINED';}_0x12a604[_0x92ef('0xa')](error[_0x103abe]);while(arguments[_0x46a205]){_0x12a604[_0x92ef('0xa')](arguments[_0x46a205]);_0x46a205++;}_0x5cac4c=util[_0x92ef('0xb')]['apply'](util,_0x12a604);this[_0x92ef('0xc')]=_0x5cac4c;this[_0x92ef('0xd')]=_0x103abe;}module[_0x92ef('0xe')]=AGIError; \ No newline at end of file +var _0xed0d=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','exports','util','Undefined\x20error.','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.','Socket\x20timeout.'];(function(_0x52c856,_0x47fd69){var _0x41f172=function(_0x7bec89){while(--_0x7bec89){_0x52c856['push'](_0x52c856['shift']());}};_0x41f172(++_0x47fd69);}(_0xed0d,0x148));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xded0('0x0'));var error={'E_AGI_UNDEFINED':_0xded0('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xded0('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xded0('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xded0('0x4'),'E_AGI_SOCKET_ERROR':_0xded0('0x5'),'E_AGI_SOCKET_CLOSE':_0xded0('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xded0('0x7'),'E_AGI_COMMAND_EMPTY':_0xded0('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xded0('0x9'),'E_AGI_IVR_ENTRY':_0xded0('0xa')};function AGIError(_0x157b1e){var _0x157b1e=_0x157b1e||null,_0x51e98a=_0x51e98a||[],_0x2a2210=0x1,_0x304146='';if(!error[_0x157b1e]){_0x157b1e=_0xded0('0xb');}_0x51e98a[_0xded0('0xc')](error[_0x157b1e]);while(arguments[_0x2a2210]){_0x51e98a[_0xded0('0xc')](arguments[_0x2a2210]);_0x2a2210++;}_0x304146=util[_0xded0('0xd')][_0xded0('0xe')](util,_0x51e98a);this['message']=_0x304146;this['name']=_0x157b1e;}module[_0xded0('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 444d2c4..1cbec24 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 _0x8a16=['no\x20edge/s\x20available','condition','split','target','info','default','agicommand','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','addEdge','push','prototype','size','relations','getVertex','no\x20vertex\x20found','stop\x20traverse','length'];(function(_0x5180dc,_0x3813f4){var _0x3d300b=function(_0x18d02c){while(--_0x18d02c){_0x5180dc['push'](_0x5180dc['shift']());}};_0x3d300b(++_0x3813f4);}(_0x8a16,0xe6));var _0x68a1=function(_0xc82ad2,_0x2374bc){_0xc82ad2=_0xc82ad2-0x0;var _0x41f5c2=_0x8a16[_0xc82ad2];return _0x41f5c2;};'use strict';var _=require(_0x68a1('0x0'));var logger=require('../../../config/logger')(_0x68a1('0x1'));var verticesWithRetry=[_0x68a1('0x2'),_0x68a1('0x3'),_0x68a1('0x4')];var Graph=function(){this[_0x68a1('0x5')]={};this[_0x68a1('0x6')]={};this[_0x68a1('0x7')]=0x0;};Graph['prototype'][_0x68a1('0x8')]=function(_0x195995){this['vertices'][_0x195995['id']]=_0x195995;this[_0x68a1('0x6')][_0x195995['id']]=[];};Graph['prototype'][_0x68a1('0x9')]=function(_0x121c9f,_0x363f65,_0x5e0457){this[_0x68a1('0x6')][_0x121c9f][_0x68a1('0xa')]({'target':_0x363f65,'condition':_0x5e0457});this[_0x68a1('0x7')]+=0x1;};Graph[_0x68a1('0xb')][_0x68a1('0xc')]=function(){return _[_0x68a1('0xc')](this[_0x68a1('0x5')]);};Graph[_0x68a1('0xb')][_0x68a1('0xd')]=function(){return this[_0x68a1('0x7')];};Graph[_0x68a1('0xb')][_0x68a1('0xe')]=function(_0x9722ba){return this[_0x68a1('0x5')][_0x9722ba];};Graph[_0x68a1('0xb')]['traverseBFS']=function(_0x251888,_0x2a4fb0){if(!this['vertices'][_0x251888]){return logger['info'](_0x68a1('0xf'));}var _0x19b8c2=_0x2a4fb0(this[_0x68a1('0x5')][_0x251888]);if(!_0x19b8c2){return logger['info'](_0x68a1('0x10'));}if(this[_0x68a1('0x6')][_0x251888][_0x68a1('0x11')]===0x0){return logger['info'](_0x68a1('0x12'));}for(var _0x2c7b1f=0x0,_0x54cc08=[],_0xdbfc1f=![];_0x2c7b1f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','retry','omit','mxCell','length','source','addEdge','target','getSquareProject','then','catch','createSquareReport','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','close','timeout','hangup','sync','production','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','log'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfef2,0xf8));var _0x2fef=function(_0x3566ea,_0x50e87d){_0x3566ea=_0x3566ea-0x0;var _0x24c0b9=_0xfef2[_0x3566ea];return _0x24c0b9;};'use strict';var parser=require(_0x2fef('0x0'));var _=require(_0x2fef('0x1'));var syncho=require(_0x2fef('0x2'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x2fef('0x3'));var utilLicense=require(_0x2fef('0x4'));var rpc=require(_0x2fef('0x5'));var mailRpc=require(_0x2fef('0x6'));var Graph=require('./graph');var Vertices=require(_0x2fef('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x2fef('0x8')](config[_0x2fef('0x3')],{'ip':_0x2fef('0x9'),'port':0x11dd});function connectionHandler(_0x508efe){process[_0x2fef('0xa')](function(){syncho(function(){try{setChannelVariables(_0x508efe);agiHandler(_0x508efe);}catch(_0x6fedd2){logger[_0x2fef('0xb')](_0x6fedd2['stack']);}});});}function listeningHandler(){console[_0x2fef('0xc')](_0x2fef('0xd'),config[_0x2fef('0x3')][_0x2fef('0xe')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x2fef('0x3')]['ip'],config[_0x2fef('0x3')]['port']));}function errorHandler(_0x55aaec){if(_0x55aaec&&_0x55aaec[_0x2fef('0xf')]&&_0x55aaec[_0x2fef('0x10')]){logger[_0x2fef('0xb')](util[_0x2fef('0x11')](_0x2fef('0x12'),_0x55aaec[_0x2fef('0xf')],_0x55aaec[_0x2fef('0x10')]));}else{logger[_0x2fef('0xb')](util[_0x2fef('0x11')]('[ERROR]\x20%s',_0x55aaec[_0x2fef('0x13')]));}}function closeHandler(){logger[_0x2fef('0x14')](util[_0x2fef('0x11')](_0x2fef('0x15'),this[_0x2fef('0x16')],this['calleridname'],this[_0x2fef('0x17')],this['dnid'],this[_0x2fef('0x18')]));try{createSquareReport(this);}catch(_0xc9d7d6){logger[_0x2fef('0xb')](_0xc9d7d6[_0x2fef('0x13')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x2fef('0x17')],this[_0x2fef('0x19')],this[_0x2fef('0x18')]));}function hangupHandler(){logger['info'](util['format'](_0x2fef('0x1a'),this[_0x2fef('0x16')],this['calleridname'],this['callerid'],this['dnid'],this[_0x2fef('0x18')]));this[_0x2fef('0x1b')]=!![];}function getRoot(_0x17bd58){return parser[_0x2fef('0x1c')](_0x17bd58,{'object':!![]})[_0x2fef('0x1d')][_0x2fef('0x1e')];}function addVertex(_0x206528,_0x20ecd7,_0x1df70e){_0x20ecd7[_0x2fef('0x1f')]=_0x1df70e;if(_0x20ecd7['hasOwnProperty']('retry')){_0x20ecd7['maxRetry']=parseInt(_0x20ecd7[_0x2fef('0x20')],0xa);}_0x206528['addVertex'](_[_0x2fef('0x21')](_0x20ecd7,_0x2fef('0x22')));}function initGraph(_0x13b7a7,_0x238465){var _0x1c39fe=new Graph();for(var _0x56fc41 in _0x13b7a7){if(_0x13b7a7['hasOwnProperty'](_0x56fc41)){if(_['isArray'](_0x13b7a7[_0x56fc41])){for(var _0x23b18f=0x0;_0x23b18f<_0x13b7a7[_0x56fc41][_0x2fef('0x23')];_0x23b18f+=0x1){addVertex(_0x1c39fe,_0x13b7a7[_0x56fc41][_0x23b18f],_0x56fc41);}}else{addVertex(_0x1c39fe,_0x13b7a7[_0x56fc41],_0x56fc41);}}}for(var _0x4df2ba=0x0;_0x4df2ba<_0x238465[_0x2fef('0x23')];_0x4df2ba+=0x1){if(_0x238465[_0x4df2ba][_0x2fef('0x24')]&&_0x238465[_0x4df2ba]['target']){_0x1c39fe[_0x2fef('0x25')](_0x238465[_0x4df2ba][_0x2fef('0x24')],_0x238465[_0x4df2ba][_0x2fef('0x26')],_0x238465[_0x4df2ba]['value']);}}return _0x1c39fe;}function getSquareProject(_0x2ae348,_0x46ad7d){rpc[_0x2fef('0x27')](_0x2ae348)[_0x2fef('0x28')](function(_0x1e03db){_0x46ad7d(null,_0x1e03db);})[_0x2fef('0x29')](function(_0xeacbe0){_0x46ad7d(null,_0xeacbe0);});}function createSquareReport(_0x50c0e4,_0x34260d){rpc[_0x2fef('0x2a')](_0x50c0e4)[_0x2fef('0x28')](function(_0x4eca09){if(_0x34260d){_0x34260d(null,_0x4eca09);}})['catch'](function(_0x3a0058){if(_0x34260d){_0x34260d(null,_0x3a0058);}});}function setChannelVariables(_0x5ea904){for(var _0x5a6a16 in _0x5ea904){if(_0x5ea904[_0x2fef('0x2b')](_0x5a6a16)){if(_0x5a6a16[_0x2fef('0x2c')](_0x2fef('0x2d'))===0x0){_0x5ea904[_0x5a6a16[_0x2fef('0x2e')](0x4)]=_0x5ea904[_0x5a6a16];delete _0x5ea904[_0x5a6a16];}}}}function getLogFromObject(_0x1d0256){return util['inspect'](_0x1d0256,{'showHidden':![],'depth':null});}function agiHandler(_0x46fe4f){var _0x51abb5,_0xa38af0,_0x1eedf0,_0x3c16d1,_0x151e37;logger['debug'](_0x2fef('0x2f'),JSON[_0x2fef('0x30')](_0x46fe4f,null,0x2));logger[_0x2fef('0x14')](util[_0x2fef('0x11')](_0x2fef('0x31'),_0x46fe4f[_0x2fef('0x16')],_0x46fe4f[_0x2fef('0x32')],_0x46fe4f[_0x2fef('0x17')],_0x46fe4f[_0x2fef('0x19')],_0x46fe4f['uniqueid']));_0x46fe4f['on'](_0x2fef('0xb'),errorHandler);_0x46fe4f['on'](_0x2fef('0x33'),closeHandler);_0x46fe4f['on'](_0x2fef('0x34'),timeoutHandler);_0x46fe4f[_0x2fef('0x1b')]=![];_0x46fe4f['on'](_0x2fef('0x35'),hangupHandler);var _0xd98142=getSquareProject[_0x2fef('0x36')](null,_0x46fe4f[_0x2fef('0x16')]);if(_0xd98142){if(_0xd98142['production']){_0x51abb5=getRoot(_0xd98142[_0x2fef('0x37')]);if(_0x51abb5&&_0x51abb5['start']){logger[_0x2fef('0x38')](_0x2fef('0x1e'),JSON['stringify'](_0x51abb5,null,0x2));_0x46fe4f[_0x2fef('0x39')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xa38af0=initGraph(_[_0x2fef('0x21')](_0x51abb5,'mxCell'),_0x51abb5[_0x2fef('0x22')]);_0x1eedf0=new Vertices(_0x46fe4f,rpc,mailRpc);logger[_0x2fef('0x14')](util['format'](_0x2fef('0x3a'),_0x46fe4f[_0x2fef('0x16')],_0x46fe4f['calleridname'],_0x46fe4f[_0x2fef('0x17')],_0x46fe4f[_0x2fef('0x19')],_0x46fe4f['uniqueid']));_0xa38af0[_0x2fef('0x3b')](_0x51abb5[_0x2fef('0x3c')]['id'],function(_0x59cd65){try{_0x59cd65=_0x1eedf0[_0x2fef('0x3d')](_0x59cd65);logger['debug'](_0x2fef('0x3e'),JSON[_0x2fef('0x30')](_0x59cd65,null,0x2));if(_0x59cd65[_0x2fef('0x1f')]===_0x2fef('0x3f')){logger[_0x2fef('0x14')](_0x2fef('0x40'));_0x46fe4f[_0x2fef('0x41')]=_0x59cd65[_0x2fef('0x41')]||_0x46fe4f[_0x2fef('0x41')];_0x46fe4f[_0x2fef('0x42')]=_0x59cd65[_0x2fef('0x42')];_0x46fe4f['priority']=_0x59cd65[_0x2fef('0x43')]?_0x59cd65[_0x2fef('0x43')]-0x1:0x1;return null;}else if(_0x59cd65&&_0x1eedf0[_0x59cd65[_0x2fef('0x1f')]]){_0x151e37=_0x1eedf0[_0x59cd65[_0x2fef('0x1f')]](_0x59cd65);logger[_0x2fef('0x14')]('response',JSON[_0x2fef('0x30')](_0x151e37,null,0x2));if(_0x151e37&&_0x151e37[_0x2fef('0x44')]===AGI_CODE_SUCCESS&&_0x151e37[_0x2fef('0x45')]!==AGI_RESULT_ERROR&&!_0x46fe4f[_0x2fef('0x1b')]){logger[_0x2fef('0x38')](_0x2fef('0x46'),getLogFromObject(_0x151e37));return _['isUndefined'](_0x151e37[_0x2fef('0x45')])?null:_0x151e37['result'][_0x2fef('0x47')]();}else{logger[_0x2fef('0xb')]('response',getLogFromObject(_0x151e37));return null;}}else{logger['error'](_0x2fef('0x48'));return null;}}catch(_0x388403){logger[_0x2fef('0xb')](_0x388403[_0x2fef('0x13')]);return null;}});if(_0x51abb5[_0x2fef('0x49')]){logger[_0x2fef('0x14')](util[_0x2fef('0x11')](_0x2fef('0x4a'),_0x46fe4f['arg_1'],_0x46fe4f['calleridname'],_0x46fe4f[_0x2fef('0x17')],_0x46fe4f[_0x2fef('0x19')],_0x46fe4f[_0x2fef('0x18')]));_0xa38af0[_0x2fef('0x3b')](_0x51abb5['finally']['id'],function(_0x309d3b){try{_0x309d3b=_0x1eedf0[_0x2fef('0x3d')](_0x309d3b);logger[_0x2fef('0x38')](_0x2fef('0x3e'),JSON[_0x2fef('0x30')](_0x309d3b,null,0x2));if(_0x309d3b&&_0x1eedf0[_0x309d3b[_0x2fef('0x1f')]]){_0x151e37=_0x1eedf0[_0x309d3b[_0x2fef('0x1f')]](_0x309d3b);if(_0x151e37){logger['debug'](_0x2fef('0x46'),getLogFromObject(_0x151e37));return _[_0x2fef('0x4b')](_0x151e37[_0x2fef('0x45')])?null:_0x151e37[_0x2fef('0x45')][_0x2fef('0x47')]();}else{logger[_0x2fef('0xb')](_0x2fef('0x46'),getLogFromObject(_0x151e37));return null;}}else{logger[_0x2fef('0xb')](_0x2fef('0x48'));return null;}}catch(_0x230d7b){logger[_0x2fef('0xb')](_0x230d7b[_0x2fef('0x13')]);return null;}});}logger['info'](util[_0x2fef('0x11')](_0x2fef('0x4c'),_0x46fe4f[_0x2fef('0x16')],_0x46fe4f[_0x2fef('0x32')],_0x46fe4f['callerid'],_0x46fe4f['dnid'],_0x46fe4f[_0x2fef('0x18')]));logger[_0x2fef('0x14')](util[_0x2fef('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x46fe4f[_0x2fef('0x41')],_0x46fe4f[_0x2fef('0x42')],parseInt(_0x46fe4f[_0x2fef('0x43')],0xa)+0x1));_0x46fe4f[_0x2fef('0x4d')](_0x46fe4f[_0x2fef('0x41')],_0x46fe4f[_0x2fef('0x42')],parseInt(_0x46fe4f['priority'],0xa)+0x1);_0x46fe4f[_0x2fef('0x33')]();}}else{logger['error'](util[_0x2fef('0x11')](_0x2fef('0x4e'),_0x46fe4f['arg_1']));_0x46fe4f[_0x2fef('0x4d')](_0x46fe4f[_0x2fef('0x41')],_0x46fe4f[_0x2fef('0x42')],parseInt(_0x46fe4f[_0x2fef('0x43')],0xa)+0x1);_0x46fe4f[_0x2fef('0x33')]();}}else{logger[_0x2fef('0xb')](util[_0x2fef('0x11')]('Project\x20%s\x20not\x20found',_0x46fe4f[_0x2fef('0x16')]));_0x46fe4f[_0x2fef('0x4d')](_0x46fe4f[_0x2fef('0x41')],_0x46fe4f[_0x2fef('0x42')],parseInt(_0x46fe4f[_0x2fef('0x43')],0xa)+0x1);_0x46fe4f[_0x2fef('0x33')]();}}function main(){var _0x34387a;return utilLicense['getLicense']()[_0x2fef('0x28')](function(_0x43aca5){if(_0x43aca5){if(_0x43aca5[_0x2fef('0x4f')]){if(_0x43aca5['callysquare']&&_0x43aca5['callysquare']>0x0){logger[_0x2fef('0x14')](util[_0x2fef('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x43aca5['callysquare']));_0x34387a=_0x43aca5[_0x2fef('0x50')];}else{logger[_0x2fef('0x14')](_0x2fef('0x51'));}}else{logger[_0x2fef('0x14')](_0x2fef('0x52'));_0x34387a=-0x1;}}})['catch'](function(_0x4a502e){logger[_0x2fef('0xb')](_0x2fef('0x53'),_0x4a502e['stack']);})[_0x2fef('0x49')](function(){var _0x50d7c9=require(_0x2fef('0x54'))(config[_0x2fef('0x3')][_0x2fef('0xe')],config[_0x2fef('0x3')]['ip'],_0x34387a);_0x50d7c9['on'](_0x2fef('0xb'),errorHandler);_0x50d7c9['on'](_0x2fef('0x55'),listeningHandler);_0x50d7c9['on'](_0x2fef('0x56'),connectionHandler);_0x50d7c9['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xa27e=['hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','value','catch','createSquareReport','then','indexOf','agi_','substring','inspect','debug','stringify','close','timeout','hangup','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','isUndefined','toString','response','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','agi','./rpc','./mailRpc','./graph','defaults','nextTick','error','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','mxGraphModel','root','agicommand'];(function(_0x64f713,_0x42cc4c){var _0x41ea6c=function(_0x13c5e5){while(--_0x13c5e5){_0x64f713['push'](_0x64f713['shift']());}};_0x41ea6c(++_0x42cc4c);}(_0xa27e,0x8a));var _0xea27=function(_0x4b48a7,_0x17f3d5){_0x4b48a7=_0x4b48a7-0x0;var _0x439f2d=_0xa27e[_0x4b48a7];return _0x439f2d;};'use strict';var parser=require(_0xea27('0x0'));var _=require(_0xea27('0x1'));var syncho=require(_0xea27('0x2'));var util=require(_0xea27('0x3'));var moment=require(_0xea27('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xea27('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xea27('0x6'));var mailRpc=require(_0xea27('0x7'));var Graph=require(_0xea27('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xea27('0x5')]=_[_0xea27('0x9')](config[_0xea27('0x5')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0xe74285){process[_0xea27('0xa')](function(){syncho(function(){try{setChannelVariables(_0xe74285);agiHandler(_0xe74285);}catch(_0x4c271c){logger[_0xea27('0xb')](_0x4c271c[_0xea27('0xc')]);}});});}function listeningHandler(){console[_0xea27('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xea27('0x5')][_0xea27('0xe')]);logger[_0xea27('0xf')](util[_0xea27('0x10')](_0xea27('0x11'),config[_0xea27('0x5')]['ip'],config[_0xea27('0x5')]['port']));}function errorHandler(_0x5cad99){if(_0x5cad99&&_0x5cad99[_0xea27('0x12')]&&_0x5cad99[_0xea27('0x13')]){logger[_0xea27('0xb')](util[_0xea27('0x10')](_0xea27('0x14'),_0x5cad99[_0xea27('0x12')],_0x5cad99[_0xea27('0x13')]));}else{logger[_0xea27('0xb')](util[_0xea27('0x10')](_0xea27('0x15'),_0x5cad99['stack']));}}function closeHandler(){logger[_0xea27('0xf')](util[_0xea27('0x10')](_0xea27('0x16'),this[_0xea27('0x17')],this['calleridname'],this[_0xea27('0x18')],this[_0xea27('0x19')],this[_0xea27('0x1a')]));try{createSquareReport(this);}catch(_0x218efe){logger['error'](_0x218efe[_0xea27('0xc')]);}}function timeoutHandler(){logger[_0xea27('0xf')](util['format'](_0xea27('0x1b'),this[_0xea27('0x17')],this['calleridname'],this[_0xea27('0x18')],this[_0xea27('0x19')],this[_0xea27('0x1a')]));}function hangupHandler(){logger[_0xea27('0xf')](util[_0xea27('0x10')](_0xea27('0x1c'),this[_0xea27('0x17')],this[_0xea27('0x1d')],this[_0xea27('0x18')],this[_0xea27('0x19')],this[_0xea27('0x1a')]));this[_0xea27('0x1e')]=!![];}function getRoot(_0x3f5c78){return parser['toJson'](_0x3f5c78,{'object':!![]})[_0xea27('0x1f')][_0xea27('0x20')];}function addVertex(_0x6c2498,_0x56f72f,_0x3145f7){_0x56f72f[_0xea27('0x21')]=_0x3145f7;if(_0x56f72f[_0xea27('0x22')](_0xea27('0x23'))){_0x56f72f[_0xea27('0x24')]=parseInt(_0x56f72f[_0xea27('0x23')],0xa);}_0x6c2498[_0xea27('0x25')](_[_0xea27('0x26')](_0x56f72f,_0xea27('0x27')));}function initGraph(_0x1e6aa0,_0x5e4e2b){var _0x3bb58b=new Graph();for(var _0x423461 in _0x1e6aa0){if(_0x1e6aa0['hasOwnProperty'](_0x423461)){if(_['isArray'](_0x1e6aa0[_0x423461])){for(var _0x4042a0=0x0;_0x4042a0<_0x1e6aa0[_0x423461][_0xea27('0x28')];_0x4042a0+=0x1){addVertex(_0x3bb58b,_0x1e6aa0[_0x423461][_0x4042a0],_0x423461);}}else{addVertex(_0x3bb58b,_0x1e6aa0[_0x423461],_0x423461);}}}for(var _0x49c7f9=0x0;_0x49c7f9<_0x5e4e2b[_0xea27('0x28')];_0x49c7f9+=0x1){if(_0x5e4e2b[_0x49c7f9][_0xea27('0x29')]&&_0x5e4e2b[_0x49c7f9]['target']){_0x3bb58b['addEdge'](_0x5e4e2b[_0x49c7f9][_0xea27('0x29')],_0x5e4e2b[_0x49c7f9][_0xea27('0x2a')],_0x5e4e2b[_0x49c7f9][_0xea27('0x2b')]);}}return _0x3bb58b;}function getSquareProject(_0x2fa8a6,_0xe16ea0){rpc['getSquareProject'](_0x2fa8a6)['then'](function(_0x4fb4fd){_0xe16ea0(null,_0x4fb4fd);})[_0xea27('0x2c')](function(_0x3ef462){_0xe16ea0(null,_0x3ef462);});}function createSquareReport(_0x34441f,_0x48f14a){rpc[_0xea27('0x2d')](_0x34441f)[_0xea27('0x2e')](function(_0x4d0d7a){if(_0x48f14a){_0x48f14a(null,_0x4d0d7a);}})[_0xea27('0x2c')](function(_0x423ab0){if(_0x48f14a){_0x48f14a(null,_0x423ab0);}});}function setChannelVariables(_0x133848){for(var _0x4e172b in _0x133848){if(_0x133848[_0xea27('0x22')](_0x4e172b)){if(_0x4e172b[_0xea27('0x2f')](_0xea27('0x30'))===0x0){_0x133848[_0x4e172b[_0xea27('0x31')](0x4)]=_0x133848[_0x4e172b];delete _0x133848[_0x4e172b];}}}}function getLogFromObject(_0x4656aa){return util[_0xea27('0x32')](_0x4656aa,{'showHidden':![],'depth':null});}function agiHandler(_0x163e01){var _0x60ef61,_0x3b58a8,_0x4d5fc7,_0x4e550f,_0x5af938;logger[_0xea27('0x33')]('variables',JSON[_0xea27('0x34')](_0x163e01,null,0x2));logger['info'](util[_0xea27('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x163e01['arg_1'],_0x163e01[_0xea27('0x1d')],_0x163e01[_0xea27('0x18')],_0x163e01['dnid'],_0x163e01['uniqueid']));_0x163e01['on'](_0xea27('0xb'),errorHandler);_0x163e01['on'](_0xea27('0x35'),closeHandler);_0x163e01['on'](_0xea27('0x36'),timeoutHandler);_0x163e01[_0xea27('0x1e')]=![];_0x163e01['on'](_0xea27('0x37'),hangupHandler);var _0x3c3d64=getSquareProject['sync'](null,_0x163e01['arg_1']);if(_0x3c3d64){if(_0x3c3d64[_0xea27('0x38')]){_0x60ef61=getRoot(_0x3c3d64[_0xea27('0x38')]);if(_0x60ef61&&_0x60ef61['start']){logger[_0xea27('0x33')](_0xea27('0x20'),JSON[_0xea27('0x34')](_0x60ef61,null,0x2));_0x163e01[_0xea27('0x39')]=moment()[_0xea27('0x10')](_0xea27('0x3a'));_0x3b58a8=initGraph(_[_0xea27('0x26')](_0x60ef61,_0xea27('0x27')),_0x60ef61[_0xea27('0x27')]);_0x4d5fc7=new Vertices(_0x163e01,rpc,mailRpc);logger[_0xea27('0xf')](util[_0xea27('0x10')](_0xea27('0x3b'),_0x163e01[_0xea27('0x17')],_0x163e01[_0xea27('0x1d')],_0x163e01['callerid'],_0x163e01[_0xea27('0x19')],_0x163e01['uniqueid']));_0x3b58a8['traverseBFS'](_0x60ef61[_0xea27('0x3c')]['id'],function(_0x5cb755){try{_0x5cb755=_0x4d5fc7[_0xea27('0x3d')](_0x5cb755);logger[_0xea27('0x33')](_0xea27('0x3e'),JSON['stringify'](_0x5cb755,null,0x2));if(_0x5cb755[_0xea27('0x21')]===_0xea27('0x3f')){logger[_0xea27('0xf')](_0xea27('0x40'));_0x163e01[_0xea27('0x41')]=_0x5cb755[_0xea27('0x41')]||_0x163e01[_0xea27('0x41')];_0x163e01[_0xea27('0x42')]=_0x5cb755[_0xea27('0x42')];_0x163e01['priority']=_0x5cb755[_0xea27('0x43')]?_0x5cb755[_0xea27('0x43')]-0x1:0x1;return null;}else if(_0x5cb755&&_0x4d5fc7[_0x5cb755[_0xea27('0x21')]]){_0x5af938=_0x4d5fc7[_0x5cb755[_0xea27('0x21')]](_0x5cb755);logger[_0xea27('0xf')]('response',JSON['stringify'](_0x5af938,null,0x2));if(_0x5af938&&_0x5af938['code']===AGI_CODE_SUCCESS&&_0x5af938[_0xea27('0x44')]!==AGI_RESULT_ERROR&&!_0x163e01[_0xea27('0x1e')]){logger[_0xea27('0x33')]('response',getLogFromObject(_0x5af938));return _[_0xea27('0x45')](_0x5af938['result'])?null:_0x5af938[_0xea27('0x44')][_0xea27('0x46')]();}else{logger['error'](_0xea27('0x47'),getLogFromObject(_0x5af938));return null;}}else{logger[_0xea27('0xb')](_0xea27('0x48'));return null;}}catch(_0x48af4b){logger[_0xea27('0xb')](_0x48af4b['stack']);return null;}});if(_0x60ef61['finally']){logger[_0xea27('0xf')](util[_0xea27('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x163e01[_0xea27('0x17')],_0x163e01[_0xea27('0x1d')],_0x163e01['callerid'],_0x163e01[_0xea27('0x19')],_0x163e01[_0xea27('0x1a')]));_0x3b58a8['traverseBFS'](_0x60ef61[_0xea27('0x49')]['id'],function(_0x2b03ed){try{_0x2b03ed=_0x4d5fc7['clear'](_0x2b03ed);logger[_0xea27('0x33')](_0xea27('0x3e'),JSON[_0xea27('0x34')](_0x2b03ed,null,0x2));if(_0x2b03ed&&_0x4d5fc7[_0x2b03ed[_0xea27('0x21')]]){_0x5af938=_0x4d5fc7[_0x2b03ed['agicommand']](_0x2b03ed);if(_0x5af938){logger[_0xea27('0x33')]('response',getLogFromObject(_0x5af938));return _[_0xea27('0x45')](_0x5af938[_0xea27('0x44')])?null:_0x5af938['result'][_0xea27('0x46')]();}else{logger[_0xea27('0xb')]('response',getLogFromObject(_0x5af938));return null;}}else{logger[_0xea27('0xb')](_0xea27('0x48'));return null;}}catch(_0x28f430){logger[_0xea27('0xb')](_0x28f430[_0xea27('0xc')]);return null;}});}logger[_0xea27('0xf')](util[_0xea27('0x10')](_0xea27('0x4a'),_0x163e01[_0xea27('0x17')],_0x163e01['calleridname'],_0x163e01['callerid'],_0x163e01[_0xea27('0x19')],_0x163e01[_0xea27('0x1a')]));logger[_0xea27('0xf')](util[_0xea27('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x163e01[_0xea27('0x41')],_0x163e01[_0xea27('0x42')],parseInt(_0x163e01[_0xea27('0x43')],0xa)+0x1));_0x163e01[_0xea27('0x4b')](_0x163e01[_0xea27('0x41')],_0x163e01[_0xea27('0x42')],parseInt(_0x163e01[_0xea27('0x43')],0xa)+0x1);_0x163e01[_0xea27('0x35')]();}}else{logger[_0xea27('0xb')](util[_0xea27('0x10')]('Project\x20%s\x20not\x20published',_0x163e01[_0xea27('0x17')]));_0x163e01[_0xea27('0x4b')](_0x163e01[_0xea27('0x41')],_0x163e01['extension'],parseInt(_0x163e01[_0xea27('0x43')],0xa)+0x1);_0x163e01[_0xea27('0x35')]();}}else{logger[_0xea27('0xb')](util['format']('Project\x20%s\x20not\x20found',_0x163e01[_0xea27('0x17')]));_0x163e01[_0xea27('0x4b')](_0x163e01['context'],_0x163e01[_0xea27('0x42')],parseInt(_0x163e01[_0xea27('0x43')],0xa)+0x1);_0x163e01[_0xea27('0x35')]();}}function main(){var _0x85ce95;return utilLicense[_0xea27('0x4c')]()[_0xea27('0x2e')](function(_0x5e217f){if(_0x5e217f){if(_0x5e217f[_0xea27('0x4d')]){if(_0x5e217f[_0xea27('0x4e')]&&_0x5e217f[_0xea27('0x4e')]>0x0){logger['info'](util['format'](_0xea27('0x4f'),_0x5e217f['callysquare']));_0x85ce95=_0x5e217f[_0xea27('0x4e')];}else{logger[_0xea27('0xf')](_0xea27('0x50'));}}else{logger['info'](_0xea27('0x51'));_0x85ce95=-0x1;}}})[_0xea27('0x2c')](function(_0x5d2139){logger[_0xea27('0xb')](_0xea27('0x52'),_0x5d2139['stack']);})[_0xea27('0x49')](function(){var _0x220062=require(_0xea27('0x53'))(config['agi'][_0xea27('0xe')],config[_0xea27('0x5')]['ip'],_0x85ce95);_0x220062['on'](_0xea27('0xb'),errorHandler);_0x220062['on'](_0xea27('0x54'),listeningHandler);_0x220062['on'](_0xea27('0x55'),connectionHandler);_0x220062['on'](_0xea27('0x35'),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 9d50d18..b8dbdf9 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 _0x2572=['sendMailMessage','bluebird','http','request','then','error','message','catch'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x2572,0x159));var _0x2257=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2572[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x2257('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2257('0x1')]({'port':0x232b});function request(_0x730e36,_0x8a19bb){return new BPromise(function(_0x4cd994,_0x984acb){return client[_0x2257('0x2')](_0x730e36,_0x8a19bb)[_0x2257('0x3')](function(_0x1e0341){if(_0x1e0341[_0x2257('0x4')]){return _0x984acb(_0x1e0341['error'][_0x2257('0x5')]);}else{return _0x4cd994(_0x1e0341['result']);}})[_0x2257('0x6')](function(_0xc53cf2){return _0x984acb(_0xc53cf2);});});}exports[_0x2257('0x7')]=function(_0x39389a,_0x1fae3f){return request('SendMail',{'account':_0x39389a,'message':_0x1fae3f});}; \ No newline at end of file +var _0xf382=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0xd53dc2,_0x51f360){var _0x2e01f9=function(_0x442bf8){while(--_0x442bf8){_0xd53dc2['push'](_0xd53dc2['shift']());}};_0x2e01f9(++_0x51f360);}(_0xf382,0xdf));var _0x2f38=function(_0x3be594,_0x293d83){_0x3be594=_0x3be594-0x0;var _0x3f4080=_0xf382[_0x3be594];return _0x3f4080;};'use strict';var BPromise=require(_0x2f38('0x0'));var jayson=require(_0x2f38('0x1'));var client=jayson[_0x2f38('0x2')][_0x2f38('0x3')]({'port':0x232b});function request(_0x3df324,_0xfd1e28){return new BPromise(function(_0x245eba,_0x30624d){return client[_0x2f38('0x4')](_0x3df324,_0xfd1e28)[_0x2f38('0x5')](function(_0x1db361){if(_0x1db361[_0x2f38('0x6')]){return _0x30624d(_0x1db361[_0x2f38('0x6')][_0x2f38('0x7')]);}else{return _0x245eba(_0x1db361['result']);}})[_0x2f38('0x8')](function(_0x305ee2){return _0x30624d(_0x305ee2);});});}exports[_0x2f38('0x9')]=function(_0x43e9b2,_0x265564){return request(_0x2f38('0xa'),{'account':_0x43e9b2,'message':_0x265564});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a29683a..d0d1dce 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 _0xb1e0=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','call','_localBuffer','_inBody','inherits'];(function(_0x9019f8,_0x199aaa){var _0x13b681=function(_0x43767c){while(--_0x43767c){_0x9019f8['push'](_0x9019f8['shift']());}};_0x13b681(++_0x199aaa);}(_0xb1e0,0x126));var _0x0b1e=function(_0x439f70,_0x233093){_0x439f70=_0x439f70-0x0;var _0x516649=_0xb1e0[_0x439f70];return _0x516649;};'use strict';var util=require(_0x0b1e('0x0'));var Transform=require(_0x0b1e('0x1'))['Transform'];function AGIReply(_0x1a33c9){Transform[_0x0b1e('0x2')](this,_0x1a33c9);this[_0x0b1e('0x3')]='';this[_0x0b1e('0x4')]=![];}util[_0x0b1e('0x5')](AGIReply,Transform);AGIReply[_0x0b1e('0x6')][_0x0b1e('0x7')]=function(_0x30462f,_0x22242b,_0x2d20a6){var _0x1cc263='\x0a',_0x249899=['\x0a\x0a',_0x0b1e('0x8')],_0x4d271f=-0x1,_0x2df3b2=-0x1,_0x53a184='',_0x531e18=0x0,_0x16ae6d='',_0x212412='';this[_0x0b1e('0x3')]+=_0x30462f[_0x0b1e('0x9')]();_0x16ae6d=this[_0x0b1e('0x3')];if(!this[_0x0b1e('0x4')]){_0x531e18=0x0;while(_0x249899[_0x531e18]){while((_0x2df3b2=_0x16ae6d[_0x0b1e('0xa')](_0x249899[_0x531e18]))!=-0x1){_0x53a184=_0x249899[_0x531e18];_0x212412=_0x16ae6d[_0x0b1e('0xb')](0x0,_0x2df3b2);_0x16ae6d=_0x16ae6d[_0x0b1e('0xb')](_0x2df3b2+_0x53a184[_0x0b1e('0xc')]);var _0x72ecf9=_0x212412[_0x0b1e('0xd')](_0x1cc263),_0x49035e=0x0,_0x259d8a={},_0x532d64='',_0x7e5533='',_0x2a3494=-0x1;while(_0x72ecf9[_0x49035e]){_0x2a3494=_0x72ecf9[_0x49035e][_0x0b1e('0xa')](':');if(_0x2a3494!=-0x1){_0x532d64=_0x72ecf9[_0x49035e][_0x0b1e('0xe')](0x0,_0x2a3494)[_0x0b1e('0xf')]();_0x7e5533=_0x72ecf9[_0x49035e][_0x0b1e('0xe')](_0x2a3494+0x1)[_0x0b1e('0xf')]();if(_0x532d64[_0x0b1e('0xc')]>0x0){_0x259d8a[_0x532d64]=_0x7e5533;}}else{}_0x49035e++;}this[_0x0b1e('0x10')](_0x0b1e('0x11'),_0x259d8a);this[_0x0b1e('0x4')]=!![];}_0x531e18++;}this[_0x0b1e('0x3')]=_0x16ae6d;}else{while((_0x4d271f=_0x16ae6d['indexOf'](_0x1cc263))!=-0x1){_0x212412=_0x16ae6d[_0x0b1e('0xb')](0x0,_0x4d271f);this[_0x0b1e('0x10')](_0x0b1e('0x12'),_0x212412);_0x16ae6d=_0x16ae6d[_0x0b1e('0xb')](_0x4d271f+_0x1cc263[_0x0b1e('0xc')]);}this[_0x0b1e('0x3')]=_0x16ae6d;}_0x2d20a6();};module[_0x0b1e('0x13')]=AGIReply; \ No newline at end of file +var _0xf660=['prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','substring','indexOf','slice','trim','length','emit','headers','line','stream','call','inherits'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0xf660,0x195));var _0x0f66=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xf660[_0x3ceb54];return _0x26d8a6;};'use strict';var util=require('util');var Transform=require(_0x0f66('0x0'))['Transform'];function AGIReply(_0x2acc78){Transform[_0x0f66('0x1')](this,_0x2acc78);this['_localBuffer']='';this['_inBody']=![];}util[_0x0f66('0x2')](AGIReply,Transform);AGIReply[_0x0f66('0x3')][_0x0f66('0x4')]=function(_0x3b1599,_0x489d01,_0x50511d){var _0x3e87b1='\x0a',_0x54b129=['\x0a\x0a',_0x0f66('0x5')],_0x49f2d5=-0x1,_0x58bcf7=-0x1,_0x17807d='',_0x5bb131=0x0,_0x512917='',_0xbf811f='';this[_0x0f66('0x6')]+=_0x3b1599[_0x0f66('0x7')]();_0x512917=this[_0x0f66('0x6')];if(!this[_0x0f66('0x8')]){_0x5bb131=0x0;while(_0x54b129[_0x5bb131]){while((_0x58bcf7=_0x512917['indexOf'](_0x54b129[_0x5bb131]))!=-0x1){_0x17807d=_0x54b129[_0x5bb131];_0xbf811f=_0x512917[_0x0f66('0x9')](0x0,_0x58bcf7);_0x512917=_0x512917['substring'](_0x58bcf7+_0x17807d['length']);var _0x10df41=_0xbf811f['split'](_0x3e87b1),_0x4587f0=0x0,_0x193d08={},_0x580d9e='',_0x5a5d57='',_0x37789c=-0x1;while(_0x10df41[_0x4587f0]){_0x37789c=_0x10df41[_0x4587f0][_0x0f66('0xa')](':');if(_0x37789c!=-0x1){_0x580d9e=_0x10df41[_0x4587f0][_0x0f66('0xb')](0x0,_0x37789c)[_0x0f66('0xc')]();_0x5a5d57=_0x10df41[_0x4587f0][_0x0f66('0xb')](_0x37789c+0x1)[_0x0f66('0xc')]();if(_0x580d9e[_0x0f66('0xd')]>0x0){_0x193d08[_0x580d9e]=_0x5a5d57;}}else{}_0x4587f0++;}this[_0x0f66('0xe')](_0x0f66('0xf'),_0x193d08);this[_0x0f66('0x8')]=!![];}_0x5bb131++;}this[_0x0f66('0x6')]=_0x512917;}else{while((_0x49f2d5=_0x512917[_0x0f66('0xa')](_0x3e87b1))!=-0x1){_0xbf811f=_0x512917[_0x0f66('0x9')](0x0,_0x49f2d5);this[_0x0f66('0xe')](_0x0f66('0x10'),_0xbf811f);_0x512917=_0x512917['substring'](_0x49f2d5+_0x3e87b1[_0x0f66('0xd')]);}this[_0x0f66('0x6')]=_0x512917;}_0x50511d();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 99d26d0..a166f97 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 _0xb6c5=['getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','moment','util','jayson/promise','http','then','error','message','result','catch'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xb6c5,0x9f));var _0x5b6c=function(_0x40e131,_0x19dfad){_0x40e131=_0x40e131-0x0;var _0xb5178d=_0xb6c5[_0x40e131];return _0xb5178d;};'use strict';var BPromise=require('bluebird');var moment=require(_0x5b6c('0x0'));var _=require('lodash');var util=require(_0x5b6c('0x1'));var jayson=require(_0x5b6c('0x2'));var client=jayson['client'][_0x5b6c('0x3')]({'port':0x2329});function request(_0x4f407f,_0x208680){return new BPromise(function(_0x1baec5,_0x4806df){return client['request'](_0x4f407f,_0x208680)[_0x5b6c('0x4')](function(_0x383ec0){if(_0x383ec0[_0x5b6c('0x5')]){return _0x4806df(_0x383ec0[_0x5b6c('0x5')][_0x5b6c('0x6')]);}else{return _0x1baec5(_0x383ec0[_0x5b6c('0x7')]);}})[_0x5b6c('0x8')](function(_0x5c2121){return _0x4806df(_0x5c2121);});});}exports[_0x5b6c('0x9')]=function(_0x5a234b){return request(_0x5b6c('0xa'),{'options':{'raw':![],'where':{'name':_0x5a234b},'attributes':[_0x5b6c('0xb')]}});};exports[_0x5b6c('0xc')]=function(_0xde3c48){return request(_0x5b6c('0xd'),{'options':{'raw':![],'where':{'id':_0xde3c48},'include':[{'model':'MailServerOut','as':_0x5b6c('0xe')}],'attributes':['id',_0x5b6c('0xf'),_0x5b6c('0x10')]}});};exports[_0x5b6c('0x11')]=function(_0x37b12a){return request(_0x5b6c('0xa'),{'options':{'where':{'id':_0x37b12a},'attributes':[_0x5b6c('0xf')]}});};exports[_0x5b6c('0x12')]=function(_0x4b99b8){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4b99b8},'attributes':[_0x5b6c('0xf')]}});};exports[_0x5b6c('0x13')]=function(_0x2ee441){return request(_0x5b6c('0x14'),{'options':{'where':{'id':_0x2ee441},'attributes':['name']}});};exports[_0x5b6c('0x15')]=function(_0x137918){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x137918},'attributes':['dsn']}});};exports['getUserById']=function(_0x14b4ae){return request(_0x5b6c('0x16'),{'options':{'where':{'id':_0x14b4ae},'attributes':[_0x5b6c('0xf')]}});};exports[_0x5b6c('0x17')]=function(_0x1db8ea){return request(_0x5b6c('0x18'),{'options':{'where':{'id':_0x1db8ea},'attributes':['name']}});};exports[_0x5b6c('0x19')]=function(_0x5a06ed){return request(_0x5b6c('0x1a'),{'options':{'where':{'id':_0x5a06ed},'attributes':[_0x5b6c('0x1b')]}});};exports[_0x5b6c('0x1c')]=function(_0x56992a){return request(_0x5b6c('0x1d'),{'options':{'raw':![],'where':{'id':_0x56992a},'include':[{'model':'Interval','as':_0x5b6c('0x1e')}]}});};exports[_0x5b6c('0x1f')]=function(_0x4eb9c3){return request(_0x5b6c('0x20'),{'options':{'where':{'id':_0x4eb9c3},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x2d069d){return request(_0x5b6c('0x21'),{'body':_0x2d069d});};exports[_0x5b6c('0x22')]=function(_0x11e161){return request('CreateSquareDetailsReport',{'body':_0x11e161});};exports[_0x5b6c('0x23')]=function(_0x32692e){return request(_0x5b6c('0x24'),{'body':_[_0x5b6c('0x25')](_0x32692e,{'project_name':_0x32692e[_0x5b6c('0x26')],'prev_project_name':_0x32692e[_0x5b6c('0x27')]||'','is_subproject':_0x32692e[_0x5b6c('0x27')]?!![]:![],'leaveAt':moment()[_0x5b6c('0x28')](_0x5b6c('0x29'))})});};exports[_0x5b6c('0x2a')]=function(_0x65baaf){return request('CreateSquareRecording',{'body':_0x65baaf});};exports['createSquareMessage']=function(_0x3865e1){return request(_0x5b6c('0x2b'),{'body':_0x3865e1});};exports[_0x5b6c('0x2c')]=function(_0x574937){return request(_0x5b6c('0x2d'),{'options':{'raw':![],'where':{'phone':_0x574937['phone'],'ListId':_0x574937[_0x5b6c('0x2e')]}}})[_0x5b6c('0x4')](function(_0x20b88b){if(_0x20b88b){return _0x20b88b;}return request(_0x5b6c('0x2f'),{'body':_0x574937});});};exports[_0x5b6c('0x30')]=function(_0x1f0d32){return request(_0x5b6c('0x31'),{'options':{'where':{'id':_0x1f0d32},'attributes':[_0x5b6c('0xf')]}});};exports[_0x5b6c('0x32')]=function(_0x17cd0a,_0x5d6385){return request(_0x5b6c('0x33'),{'body':{'interface':_0x5d6385},'options':{'where':_0x17cd0a}});};exports['agentPause']=function(_0x52ea30,_0x25133a,_0x34c1a0){return request(_0x5b6c('0x34'),{'body':{'type':_0x25133a,'uniqueid':_0x34c1a0},'options':{'where':_0x52ea30}});};exports[_0x5b6c('0x35')]=function(_0xd65b76){return request(_0x5b6c('0x36'),{'body':{},'options':{'where':_0xd65b76}});};exports['agentLogout']=function(_0x1e5012){return request(_0x5b6c('0x37'),{'body':{},'options':{'where':_0x1e5012}});}; \ No newline at end of file +var _0x24da=['http','request','error','result','ShowSquareProject','production','MailServerOut','Smtp','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','arg_2','format','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','util','client'];(function(_0xf671c8,_0x275759){var _0x2a7d44=function(_0x18481f){while(--_0x18481f){_0xf671c8['push'](_0xf671c8['shift']());}};_0x2a7d44(++_0x275759);}(_0x24da,0x160));var _0xa24d=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x24da[_0x23e7c1];return _0x1add43;};'use strict';var BPromise=require(_0xa24d('0x0'));var moment=require(_0xa24d('0x1'));var _=require(_0xa24d('0x2'));var util=require(_0xa24d('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xa24d('0x4')][_0xa24d('0x5')]({'port':0x2329});function request(_0x15d686,_0x5153cd){return new BPromise(function(_0x451c72,_0x496dc4){return client[_0xa24d('0x6')](_0x15d686,_0x5153cd)['then'](function(_0x22f9ab){if(_0x22f9ab[_0xa24d('0x7')]){return _0x496dc4(_0x22f9ab[_0xa24d('0x7')]['message']);}else{return _0x451c72(_0x22f9ab[_0xa24d('0x8')]);}})['catch'](function(_0x46d4c5){return _0x496dc4(_0x46d4c5);});});}exports['getSquareProject']=function(_0x3e8705){return request(_0xa24d('0x9'),{'options':{'raw':![],'where':{'name':_0x3e8705},'attributes':[_0xa24d('0xa')]}});};exports['getMailAccountById']=function(_0x179757){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x179757},'include':[{'model':_0xa24d('0xb'),'as':_0xa24d('0xc')}],'attributes':['id','name','email']}});};exports['getSquareProjectById']=function(_0x388d8a){return request('ShowSquareProject',{'options':{'where':{'id':_0x388d8a},'attributes':[_0xa24d('0xd')]}});};exports['getVoiceQueueById']=function(_0x10a0e1){return request(_0xa24d('0xe'),{'options':{'where':{'id':_0x10a0e1},'attributes':[_0xa24d('0xd')]}});};exports[_0xa24d('0xf')]=function(_0x1d299a){return request(_0xa24d('0x10'),{'options':{'where':{'id':_0x1d299a},'attributes':[_0xa24d('0xd')]}});};exports[_0xa24d('0x11')]=function(_0x3600ea){return request(_0xa24d('0x12'),{'options':{'where':{'id':_0x3600ea},'attributes':[_0xa24d('0x13')]}});};exports[_0xa24d('0x14')]=function(_0x3be6c6){return request(_0xa24d('0x15'),{'options':{'where':{'id':_0x3be6c6},'attributes':[_0xa24d('0xd')]}});};exports[_0xa24d('0x16')]=function(_0x3d0cfe){return request(_0xa24d('0x17'),{'options':{'where':{'id':_0x3d0cfe},'attributes':[_0xa24d('0xd')]}});};exports[_0xa24d('0x18')]=function(_0x3b3d76){return request(_0xa24d('0x19'),{'options':{'where':{'id':_0x3b3d76},'attributes':[_0xa24d('0x1a')]}});};exports[_0xa24d('0x1b')]=function(_0x3bf3f6){return request(_0xa24d('0x1c'),{'options':{'raw':![],'where':{'id':_0x3bf3f6},'include':[{'model':'Interval','as':_0xa24d('0x1d')}]}});};exports[_0xa24d('0x1e')]=function(_0x247067){return request(_0xa24d('0x1f'),{'options':{'where':{'id':_0x247067},'attributes':['id',_0xa24d('0xd')]}});};exports['createSmsMessage']=function(_0x3dca10){return request('CreateSmsMessage',{'body':_0x3dca10});};exports[_0xa24d('0x20')]=function(_0x230225){return request(_0xa24d('0x21'),{'body':_0x230225});};exports['createSquareReport']=function(_0x15f089){return request('CreateSquareReport',{'body':_['merge'](_0x15f089,{'project_name':_0x15f089['arg_1'],'prev_project_name':_0x15f089[_0xa24d('0x22')]||'','is_subproject':_0x15f089[_0xa24d('0x22')]?!![]:![],'leaveAt':moment()[_0xa24d('0x23')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x1ec7ff){return request(_0xa24d('0x24'),{'body':_0x1ec7ff});};exports[_0xa24d('0x25')]=function(_0x4de892){return request(_0xa24d('0x26'),{'body':_0x4de892});};exports[_0xa24d('0x27')]=function(_0x4fb0bf){return request(_0xa24d('0x28'),{'options':{'raw':![],'where':{'phone':_0x4fb0bf[_0xa24d('0x29')],'ListId':_0x4fb0bf[_0xa24d('0x2a')]}}})[_0xa24d('0x2b')](function(_0x2cd77d){if(_0x2cd77d){return _0x2cd77d;}return request('CreateCmContact',{'body':_0x4fb0bf});});};exports['getPauseById']=function(_0xf59c0d){return request(_0xa24d('0x2c'),{'options':{'where':{'id':_0xf59c0d},'attributes':[_0xa24d('0xd')]}});};exports[_0xa24d('0x2d')]=function(_0x3c64ef,_0xda4f3f){return request('LoginUser',{'body':{'interface':_0xda4f3f},'options':{'where':_0x3c64ef}});};exports[_0xa24d('0x2e')]=function(_0x501a38,_0x34764f,_0x278b87){return request(_0xa24d('0x2f'),{'body':{'type':_0x34764f,'uniqueid':_0x278b87},'options':{'where':_0x501a38}});};exports[_0xa24d('0x30')]=function(_0x3006fa){return request('UnpauseUser',{'body':{},'options':{'where':_0x3006fa}});};exports[_0xa24d('0x31')]=function(_0x2a1996){return request(_0xa24d('0x32'),{'body':{},'options':{'where':_0x2a1996}});}; \ 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 b46d7e0..cc9d19a 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 _0xe928=['exports','./polly','./lex'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xe928,0x145));var _0x8e92=function(_0x3d30f7,_0x224f7a){_0x3d30f7=_0x3d30f7-0x0;var _0x1dc95b=_0xe928[_0x3d30f7];return _0x1dc95b;};var polly=require(_0x8e92('0x0'));var lex=require(_0x8e92('0x1'));module[_0x8e92('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x87d8=['exports','./lex'];(function(_0x4ee68a,_0x21d65c){var _0x738a68=function(_0x253de8){while(--_0x253de8){_0x4ee68a['push'](_0x4ee68a['shift']());}};_0x738a68(++_0x21d65c);}(_0x87d8,0x1a9));var _0x887d=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x87d8[_0x53758c];return _0x425eff;};var polly=require('./polly');var lex=require(_0x887d('0x0'));module[_0x887d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1273693..22515b4 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ 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 fa45b08..1237113 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(_0x53f6f1,_0x1ded62){var _0x4b1f05=function(_0x297aee){while(--_0x297aee){_0x53f6f1['push'](_0x53f6f1['shift']());}};_0x4b1f05(++_0x1ded62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x457263,_0x35eb4f){var _0x5a7ca8=function(_0x23e63c){while(--_0x23e63c){_0x457263['push'](_0x457263['shift']());}};_0x5a7ca8(++_0x35eb4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 a63e8f9..544fee6 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 _0xb6bf=['./lib/api','exports'];(function(_0x15da60,_0x3661df){var _0x2709bc=function(_0x242df2){while(--_0x242df2){_0x15da60['push'](_0x15da60['shift']());}};_0x2709bc(++_0x3661df);}(_0xb6bf,0x9c));var _0xfb6b=function(_0xde20ec,_0x495adc){_0xde20ec=_0xde20ec-0x0;var _0x2160c8=_0xb6bf[_0xde20ec];return _0x2160c8;};'use strict';var polly=require(_0xfb6b('0x0'));module[_0xfb6b('0x1')]=function(_0x3e8104,_0x102fd4,_0x19c4e4,_0x25b0cb,_0x22d6dd,_0x1f1e7d,_0x528962){return polly(_0x3e8104,_0x102fd4,_0x19c4e4,_0x25b0cb,_0x22d6dd,_0x1f1e7d,_0x528962);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x324166,_0x2586f9,_0x309bed,_0xfa4625,_0x3c408f,_0x100802,_0xc033ae){return polly(_0x324166,_0x2586f9,_0x309bed,_0xfa4625,_0x3c408f,_0x100802,_0xc033ae);}; \ 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 18d433a..4d723a5 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 _0xb6c6=['No\x20data\x20response\x20from\x20aws\x20Polly!','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x4b90b7,_0x2b0ab0){var _0x36ac5f=function(_0x33662a){while(--_0x33662a){_0x4b90b7['push'](_0x4b90b7['shift']());}};_0x36ac5f(++_0x2b0ab0);}(_0xb6c6,0x14a));var _0x6b6c=function(_0x29b434,_0x211fbe){_0x29b434=_0x29b434-0x0;var _0x5b7f47=_0xb6c6[_0x29b434];return _0x5b7f47;};'use strict';var fs=require('fs');var path=require(_0x6b6c('0x0'));var BPromise=require(_0x6b6c('0x1'));var rs=require(_0x6b6c('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x4acd63,_0x221917,_0x15ba68){return new BPromise(function(_0x399740,_0x4e7f80){_0x4acd63[_0x6b6c('0x3')](_0x221917,function(_0x3e22a9,_0x4cc8ba){if(_0x3e22a9){_0x4e7f80(_0x3e22a9);}else if(_0x4cc8ba){if(_0x4cc8ba[_0x6b6c('0x4')]instanceof Buffer){fs[_0x6b6c('0x5')](_0x15ba68,_0x4cc8ba[_0x6b6c('0x4')],function(_0x481fc7){if(_0x481fc7){_0x4e7f80(_0x481fc7);}else{_0x399740();}});}else{_0x4e7f80(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4e7f80(new Error(_0x6b6c('0x6')));}});});}module['exports']=function(_0x2c8ba0,_0x2e4704,_0x599ab6,_0x294eb6,_0x4a7972,_0x16e831,_0x45bb32){var _0x79b5f9=new AWS['Polly']({'accessKeyId':_0x2c8ba0,'secretAccessKey':_0x2e4704,'region':_0x599ab6});var _0x1e581f={'Text':_0x4a7972,'TextType':_0x16e831||'text','OutputFormat':'mp3','VoiceId':_0x294eb6};return pollyResult(_0x79b5f9,_0x1e581f,_0x45bb32);}; \ No newline at end of file +var _0x2872=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x497e9e,_0x36e053){var _0x2aaf55=function(_0x476fa3){while(--_0x476fa3){_0x497e9e['push'](_0x497e9e['shift']());}};_0x2aaf55(++_0x36e053);}(_0x2872,0x17b));var _0x2287=function(_0x3d10d6,_0x305b41){_0x3d10d6=_0x3d10d6-0x0;var _0x2d92cc=_0x2872[_0x3d10d6];return _0x2d92cc;};'use strict';var fs=require('fs');var path=require(_0x2287('0x0'));var BPromise=require(_0x2287('0x1'));var rs=require(_0x2287('0x2'));var AWS=require(_0x2287('0x3'));function pollyResult(_0x10f246,_0xb0803a,_0x2c1756){return new BPromise(function(_0x165d65,_0x2f2171){_0x10f246[_0x2287('0x4')](_0xb0803a,function(_0x455106,_0x48c873){if(_0x455106){_0x2f2171(_0x455106);}else if(_0x48c873){if(_0x48c873['AudioStream']instanceof Buffer){fs[_0x2287('0x5')](_0x2c1756,_0x48c873[_0x2287('0x6')],function(_0x585e37){if(_0x585e37){_0x2f2171(_0x585e37);}else{_0x165d65();}});}else{_0x2f2171(new Error(_0x2287('0x7')));}}else{_0x2f2171(new Error(_0x2287('0x8')));}});});}module[_0x2287('0x9')]=function(_0xe8a5f2,_0x4b5095,_0x39a4f5,_0x357397,_0x266464,_0xe0555d,_0x1896b2){var _0x46b80a=new AWS['Polly']({'accessKeyId':_0xe8a5f2,'secretAccessKey':_0x4b5095,'region':_0x39a4f5});var _0x2fc501={'Text':_0x266464,'TextType':_0xe0555d||_0x2287('0xa'),'OutputFormat':'mp3','VoiceId':_0x357397};return pollyResult(_0x46b80a,_0x2fc501,_0x1896b2);}; \ 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 2c4399b..4aab630 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 _0x9c3f=['exports','./lib/api'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x9c3f,0x6d));var _0xf9c3=function(_0x2bc945,_0x8d3a5f){_0x2bc945=_0x2bc945-0x0;var _0xc28858=_0x9c3f[_0x2bc945];return _0xc28858;};'use strict';var asr=require(_0xf9c3('0x0'));module[_0xf9c3('0x1')]=function(_0x326ec0,_0x3af7df,_0x1e963e,_0x1ce2de){return asr(_0x326ec0,_0x3af7df,_0x1e963e);}; \ No newline at end of file +var _0x89fe=['./lib/api'];(function(_0x1fb72b,_0x3dd9dd){var _0x2364ea=function(_0x3573b1){while(--_0x3573b1){_0x1fb72b['push'](_0x1fb72b['shift']());}};_0x2364ea(++_0x3dd9dd);}(_0x89fe,0x1e2));var _0xe89f=function(_0x4f3edc,_0x2f9e1c){_0x4f3edc=_0x4f3edc-0x0;var _0x546a31=_0x89fe[_0x4f3edc];return _0x546a31;};'use strict';var asr=require(_0xe89f('0x0'));module['exports']=function(_0x2ccd5b,_0x3313c3,_0x6c93b6,_0xb006c){return asr(_0x2ccd5b,_0x3313c3,_0x6c93b6);}; \ 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 bbad082..bf488c2 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 _0xf2cb=['string','undefined','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x2120af,_0x26b2a7){var _0x228a55=function(_0x408446){while(--_0x408446){_0x2120af['push'](_0x2120af['shift']());}};_0x228a55(++_0x26b2a7);}(_0xf2cb,0x130));var _0xbf2c=function(_0x56ef76,_0x1c5a38){_0x56ef76=_0x56ef76-0x0;var _0x407d2f=_0xf2cb[_0x56ef76];return _0x407d2f;};'use strict';var url=require('url');var BPromise=require(_0xbf2c('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xbf2c('0x1')]=function(_0x4cc874,_0x424f04,_0x5a97a1){return new BPromise(function(_0x1ecb79,_0x41c649){var _0x5abeb3;if(typeof _0x4cc874!=='string'||_0x4cc874[_0xbf2c('0x2')]===0x0){return _0x41c649(_0xbf2c('0x3'));}if(typeof _0x424f04!==_0xbf2c('0x4')||_0x424f04[_0xbf2c('0x2')]===0x0){return _0x41c649('key\x20should\x20be\x20a\x20string');}if(typeof _0x5a97a1!==_0xbf2c('0x5')&&(typeof _0x5a97a1!=='string'||_0x5a97a1[_0xbf2c('0x2')]===0x0)){return _0x41c649('lang\x20should\x20be\x20a\x20string');}try{_0x5abeb3=fs['readFileSync'](_0x4cc874)[_0xbf2c('0x6')](_0xbf2c('0x7'));}catch(_0xeb0e9d){return _0x41c649(_0xeb0e9d);}return _0x1ecb79({'method':'POST','uri':host+_0xbf2c('0x8')+_0x424f04,'body':{'config':{'encoding':_0xbf2c('0x9'),'sampleRateHertz':_0xbf2c('0xa'),'languageCode':_0x5a97a1},'audio':{'content':_0x5abeb3}},'json':!![]});});}; \ No newline at end of file +var _0x98d3=['filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','length'];(function(_0x2dc091,_0x79d2e8){var _0x35eaa4=function(_0x26b89b){while(--_0x26b89b){_0x2dc091['push'](_0x2dc091['shift']());}};_0x35eaa4(++_0x79d2e8);}(_0x98d3,0x173));var _0x398d=function(_0xe5e6e0,_0x57cae4){_0xe5e6e0=_0xe5e6e0-0x0;var _0x2c8860=_0x98d3[_0xe5e6e0];return _0x2c8860;};'use strict';var url=require(_0x398d('0x0'));var BPromise=require(_0x398d('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x398d('0x2')]=function(_0x4f5ff0,_0x18da44,_0x48fcf0){return new BPromise(function(_0x465d4a,_0x41f57c){var _0x4f7a58;if(typeof _0x4f5ff0!=='string'||_0x4f5ff0[_0x398d('0x3')]===0x0){return _0x41f57c(_0x398d('0x4'));}if(typeof _0x18da44!==_0x398d('0x5')||_0x18da44['length']===0x0){return _0x41f57c(_0x398d('0x6'));}if(typeof _0x48fcf0!==_0x398d('0x7')&&(typeof _0x48fcf0!==_0x398d('0x5')||_0x48fcf0[_0x398d('0x3')]===0x0)){return _0x41f57c(_0x398d('0x8'));}try{_0x4f7a58=fs['readFileSync'](_0x4f5ff0)[_0x398d('0x9')](_0x398d('0xa'));}catch(_0x45d5e3){return _0x41f57c(_0x45d5e3);}return _0x465d4a({'method':_0x398d('0xb'),'uri':host+_0x398d('0xc')+_0x18da44,'body':{'config':{'encoding':_0x398d('0xd'),'sampleRateHertz':_0x398d('0xe'),'languageCode':_0x48fcf0},'audio':{'content':_0x4f7a58}},'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 9b014cb..8cc08f6 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 _0x7be5=['./asr','exports'];(function(_0x290dd0,_0x428613){var _0x270f37=function(_0x10cd1e){while(--_0x10cd1e){_0x290dd0['push'](_0x290dd0['shift']());}};_0x270f37(++_0x428613);}(_0x7be5,0x1a6));var _0x57be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7be5[_0x321bb2];return _0x9c12ed;};var asr=require(_0x57be('0x0'));module[_0x57be('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8d16=['./asr'];(function(_0x34b940,_0x4ce8ae){var _0x4a95e9=function(_0x1af37b){while(--_0x1af37b){_0x34b940['push'](_0x34b940['shift']());}};_0x4a95e9(++_0x4ce8ae);}(_0x8d16,0xa8));var _0x68d1=function(_0x39b9b9,_0x52f5cf){_0x39b9b9=_0x39b9b9-0x0;var _0x5c7923=_0x8d16[_0x39b9b9];return _0x5c7923;};var asr=require(_0x68d1('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 6a1bde7..ea8be6e 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 _0x7140=['777','googleTTS','utf8','f.req=','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','googleASR','asr','uri','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','source','action','actionIncomplete','fulfillment','speech','score','metadata','endConversation','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','path','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','error','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','pipe','https:','WHAT_EVER','request\x20to\x20','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent'];(function(_0x120873,_0x257146){var _0x43cda4=function(_0x4e2e57){while(--_0x4e2e57){_0x120873['push'](_0x120873['shift']());}};_0x43cda4(++_0x257146);}(_0x7140,0x161));var _0x0714=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x7140[_0x3a2e49];return _0x257140;};'use strict';var apiai=require(_0x0714('0x0'));var BPromise=require(_0x0714('0x1'));var dialogflow=require(_0x0714('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x0714('0x3'));var md5=require('md5');var path=require(_0x0714('0x4'));var querystring=require('querystring');var rp=require(_0x0714('0x5'));var rs=require(_0x0714('0x6'));var sox=require(_0x0714('0x7'));var tts=require(_0x0714('0x8'));var urlParse=require(_0x0714('0x9'))[_0x0714('0xa')];var util=require('util');var aws=require(_0x0714('0xb'));var google=require(_0x0714('0xc'));var sestek=require(_0x0714('0xd'));var tilde=require(_0x0714('0xe'));var logger=require(_0x0714('0xf'))('agi');var ISPEECH_API=_0x0714('0x10');function downloadFile(_0x1e4271,_0x37f826){return new BPromise(function(_0x45575e,_0x4c0863){var _0x29ee6d=urlParse(_0x1e4271);var _0x2cf89f=_0x29ee6d[_0x0714('0x11')]==='https:'?https:http;var _0x25a80c={'host':_0x29ee6d[_0x0714('0x12')],'path':_0x29ee6d[_0x0714('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x2cf89f[_0x0714('0x13')](_0x25a80c,function(_0x2f6a55){if(_0x2f6a55[_0x0714('0x14')]!==0xc8){logger[_0x0714('0x15')]('request\x20to\x20'+_0x1e4271+'\x20failed,\x20status\x20code\x20=\x20'+_0x2f6a55[_0x0714('0x14')]+'\x20('+_0x2f6a55[_0x0714('0x16')]+')');_0x4c0863(new Error('request\x20to\x20'+_0x1e4271+'\x20failed,\x20status\x20code\x20=\x20'+_0x2f6a55[_0x0714('0x14')]+'\x20('+_0x2f6a55[_0x0714('0x16')]+')'));return;}var _0x522259=fs[_0x0714('0x17')](_0x37f826);_0x522259['on'](_0x0714('0x18'),function(){logger[_0x0714('0x19')]('finish\x20download\x20file');_0x522259[_0x0714('0x1a')](_0x45575e);});_0x522259['on'](_0x0714('0x15'),function(_0x285c93){fs[_0x0714('0x1b')](_0x37f826);logger[_0x0714('0x15')](_0x0714('0x1c'),_0x285c93);_0x4c0863(_0x285c93);});_0x2f6a55[_0x0714('0x1d')](_0x522259);})['on']('error',function(_0x5e44e0){logger[_0x0714('0x15')](_0x5e44e0);_0x4c0863(_0x5e44e0);})['end']();});}function uploadFile(_0x192b83){return new BPromise(function(_0x1c1aee,_0x88f0ce){var _0x4ec38a=urlParse(_0x192b83);var _0x169b95=_0x4ec38a[_0x0714('0x11')]===_0x0714('0x1e')?https:http;var _0x566cc0={'host':_0x4ec38a[_0x0714('0x12')],'path':_0x4ec38a['path'],'headers':{'user-agent':_0x0714('0x1f')}};_0x169b95[_0x0714('0x13')](_0x566cc0,function(_0x52f313){if(_0x52f313[_0x0714('0x14')]!==0xc8){_0x88f0ce(new Error(_0x0714('0x20')+_0x192b83+'\x20failed,\x20status\x20code\x20=\x20'+_0x52f313[_0x0714('0x14')]+'\x20('+_0x52f313[_0x0714('0x16')]+')'));return;}var _0x38f7ca='';_0x52f313['on'](_0x0714('0x21'),function(_0x34453d){_0x38f7ca+=_0x34453d;});_0x52f313['on'](_0x0714('0x22'),function(){_0x1c1aee(_0x38f7ca);});})['on'](_0x0714('0x15'),function(_0x4e34bd){_0x88f0ce(_0x4e34bd);})[_0x0714('0x22')]();});}function convertFile(_0x2d43e9,_0x37864c){return new BPromise(function(_0xfc80d,_0x27aaa8){var _0x1f7bf4=sox[_0x0714('0x23')](_0x2d43e9,_0x37864c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1f7bf4['on']('error',function(_0x1da91e){logger[_0x0714('0x15')](_0x0714('0x24'),_0x1da91e);_0x27aaa8(_0x1da91e);});_0x1f7bf4['on'](_0x0714('0x22'),function(){logger['info'](_0x0714('0x25'));_0xfc80d();});_0x1f7bf4[_0x0714('0x26')]();});}function base64Decode(_0x25660b,_0x2ba67a){var _0xb145a3=path[_0x0714('0x27')](__dirname,'tmp',rs[_0x0714('0x28')](0x4)+_0x0714('0x29'));fs['writeFileSync'](_0xb145a3,_0x25660b,_0x0714('0x2a'));return convertFile(_0xb145a3,_0x2ba67a)[_0x0714('0x2b')](function(){try{fs[_0x0714('0x1b')](_0xb145a3);fs[_0x0714('0x2c')](_0x2ba67a,'777');}catch(_0x2bdaaf){logger[_0x0714('0x15')](_0x2bdaaf);}return _0x2ba67a[_0x0714('0x2d')]('.')[0x0];});}function base64Encode(_0x56b98f){var _0x5f1bb4=fs[_0x0714('0x2e')](_0x56b98f);return new Buffer(_0x5f1bb4)[_0x0714('0x2f')](_0x0714('0x2a'));}exports[_0x0714('0x30')]=function(_0x496964,_0x464f88,_0x3fad95,_0x1d402c,_0x87be5,_0x5e3701){var _0x550439,_0x153233;var _0x109933=_0x0714('0x31');var _0x1745ba=_0x0714('0x32')+_0x496964;var _0x2e5cb0={};if(_0x464f88===_0x0714('0x33')){_0x2e5cb0[_0x0714('0x34')]={'ssml':_0x3fad95};}else{_0x2e5cb0[_0x0714('0x34')]={'text':_0x3fad95};};_0x2e5cb0['voice']={'languageCode':_0x1d402c,'ssmlGender':_0x87be5};_0x2e5cb0[_0x0714('0x35')]={'audioEncoding':_0x0714('0x36'),'sampleRateHertz':0x1f40};var _0x4de214={'url':_0x109933+_0x0714('0x37')+_0x1745ba,'method':_0x0714('0x38'),'json':!![],'body':_0x2e5cb0};return rp(_0x4de214)[_0x0714('0x2b')](function(_0x3a352e){return new BPromise(function(_0x204db1,_0x59a207){_0x550439=path[_0x0714('0x27')](__dirname,_0x0714('0x39'),rs[_0x0714('0x28')](0x4)+_0x0714('0x3a'));var _0x1df682=Buffer[_0x0714('0x3b')](_0x3a352e[_0x0714('0x3c')],'base64');return fs['writeFile'](_0x550439,_0x1df682,function(_0x2c87bc){_0x59a207(_0x2c87bc);},function(_0x256301){fs[_0x0714('0x2c')](_0x550439,'777');_0x204db1(_0x256301);});});})[_0x0714('0x2b')](function(_0x320d4f){_0x153233=path[_0x0714('0x27')](__dirname,_0x0714('0x39'),rs['generate'](0x4)+_0x0714('0x29'));return convertFile(_0x550439,_0x153233);})[_0x0714('0x2b')](function(){try{fs[_0x0714('0x1b')](_0x550439);fs[_0x0714('0x2c')](_0x153233,_0x0714('0x3d'));}catch(_0x55a678){logger[_0x0714('0x15')](_0x55a678);}logger[_0x0714('0x19')]('googleCloudTTS\x20path',_0x153233[_0x0714('0x2d')]('.')[0x0]);return _0x153233[_0x0714('0x2d')]('.')[0x0];});};exports[_0x0714('0x3e')]=function(_0x216379,_0x1ac6a2){var _0x32a63a='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1ebb42,_0x4ca7c3;var _0x15b83e;var _0x24e65e={'encoding':_0x0714('0x3f'),'method':_0x0714('0x38'),'timeout':0x2710,'url':_0x32a63a,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x0714('0x40')+encodeURIComponent(JSON['stringify']([[[_0x0714('0x41'),JSON['stringify']([_0x216379,_0x1ac6a2||'en',![],_0x0714('0x42')]),null,_0x0714('0x43')]]]))};return rp(_0x24e65e)[_0x0714('0x2b')](function(_0x37b901){try{_0x15b83e=eval(_0x37b901[_0x0714('0x44')](0x5))[0x0][0x2];}catch(_0x54934a){throw new Error('parse\x20response\x20failed:\x0a'+_0x37b901[_0x0714('0x21')]);}if(!_0x15b83e){if(_0x216379[_0x0714('0x45')]>0xc8){throw new Error(_0x0714('0x46'));}else{throw new Error(_0x0714('0x47')+_0x1ac6a2+_0x0714('0x48'));}}try{_0x15b83e=eval(_0x15b83e)[0x0];}catch(_0x131c48){throw new Error(_0x0714('0x49')+res[_0x0714('0x21')]);}const _0x9509f=_0x15b83e;_0x1ebb42=path['resolve'](__dirname,_0x0714('0x39'),rs['generate'](0x4)+_0x0714('0x3a'));fs[_0x0714('0x4a')](_0x1ebb42,_0x15b83e,{'encoding':_0x0714('0x2a')});_0x4ca7c3=path[_0x0714('0x27')](__dirname,_0x0714('0x39'),rs[_0x0714('0x28')](0x4)+_0x0714('0x29'));return convertFile(_0x1ebb42,_0x4ca7c3);})[_0x0714('0x2b')](function(){try{fs[_0x0714('0x1b')](_0x1ebb42);fs[_0x0714('0x2c')](_0x4ca7c3,_0x0714('0x3d'));}catch(_0x4b4c46){logger[_0x0714('0x15')](_0x4b4c46);}logger['info']('goggleTTS\x20path',_0x4ca7c3['split']('.')[0x0]);return _0x4ca7c3[_0x0714('0x2d')]('.')[0x0];});};exports[_0x0714('0x4b')]=function(_0x2feba3,_0x516747,_0xdeb17c){return google[_0x0714('0x4c')](_0x2feba3,_0x516747,_0xdeb17c)[_0x0714('0x2b')](function(_0xb4b80b){logger[_0x0714('0x19')](_0xb4b80b[_0x0714('0x4d')]);return rp(_0xb4b80b);})[_0x0714('0x2b')](function(_0x324813){var _0xe73222='';var _0x5aec6b=0x0;try{fs[_0x0714('0x1b')](_0x2feba3);}catch(_0x56746f){logger[_0x0714('0x15')](_0x56746f);}if(_0x324813&&_0x324813[_0x0714('0x4e')]){_0xe73222=_0x324813['results']['map'](function(_0x47adce){return _0x47adce&&_0x47adce[_0x0714('0x4f')][0x0]&&_0x47adce['alternatives'][0x0][_0x0714('0x50')]?_0x47adce[_0x0714('0x4f')][0x0][_0x0714('0x50')]:'';})['join']('\x0a');_0x5aec6b=_0x324813[_0x0714('0x4e')][_0x0714('0x51')](function(_0x5dec5f){return _0x5dec5f&&_0x5dec5f[_0x0714('0x4f')][0x0]&&_0x5dec5f[_0x0714('0x4f')][0x0][_0x0714('0x52')]?_0x5dec5f['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x0714('0x19')](_0x0714('0x53'),_0xe73222);logger[_0x0714('0x19')](_0x0714('0x54'),_0x5aec6b);return{'transcript':_0xe73222,'confidence':_0x5aec6b};})[_0x0714('0x55')](function(_0x4fc8bf){logger[_0x0714('0x15')](_0x0714('0x56'),_0x4fc8bf[_0x0714('0x14')],_0x4fc8bf[_0x0714('0x57')],_0x4fc8bf[_0x0714('0x58')]);});};exports[_0x0714('0x59')]=function(_0x3edb27,_0x1f73df,_0x28866e,_0x42abee){var _0x45bde5=apiai(_0x1f73df,{'language':_0x42abee||'en'});return _0x45bde5['textRequest'](_0x28866e,{'sessionId':md5(_0x3edb27)})[_0x0714('0x2b')](function(_0x52af49){logger['info'](JSON[_0x0714('0x5a')](_0x52af49));return{'source':_0x52af49[_0x0714('0x5b')][_0x0714('0x5c')],'resolvedQuery':_0x52af49[_0x0714('0x5b')]['resolvedQuery'],'action':_0x52af49[_0x0714('0x5b')][_0x0714('0x5d')],'actionIncomplete':_0x52af49[_0x0714('0x5b')][_0x0714('0x5e')],'speech':_0x52af49['result'][_0x0714('0x5f')][_0x0714('0x60')],'score':_0x52af49[_0x0714('0x5b')][_0x0714('0x61')],'statusCode':_0x52af49['status']['code'],'endConversation':_0x52af49['result'][_0x0714('0x62')][_0x0714('0x63')]||![],'isFallbackIntent':_0x52af49['result'][_0x0714('0x62')]['isFallbackIntent']};});};exports[_0x0714('0x64')]=function(_0x239e8e,_0x5a5b03,_0x24d304,_0xd76af0,_0x407bc1,_0x11ef77){var _0x57d025=_0xd76af0[_0x0714('0x65')](/\\n/g,'\x0a');var _0x36284a={'credentials':{'private_key':_0x57d025,'client_email':_0x24d304}};var _0x2a90bc=new dialogflow['SessionsClient'](_0x36284a);var _0x597c97=_0x2a90bc[_0x0714('0x66')](_0x5a5b03,md5(_0x239e8e));var _0x1b3d45={'session':_0x597c97,'queryInput':{'text':{'text':_0x407bc1,'languageCode':_0x11ef77}}};return _0x2a90bc[_0x0714('0x67')](_0x1b3d45)['then'](function(_0x2e49c3){if(_0x2e49c3&&_0x2e49c3[_0x0714('0x45')]){logger['info'](_0x0714('0x68'),JSON['stringify'](_0x2e49c3));var _0x523ce4=_0x2e49c3[0x0];if(_0x523ce4){var _0x1ebf76={'action':_0x523ce4[_0x0714('0x69')]['action'],'allRequiredParamsPresent':_0x523ce4[_0x0714('0x69')][_0x0714('0x6a')],'endConversation':_0x523ce4[_0x0714('0x69')]['diagnosticInfo']&&_0x523ce4[_0x0714('0x69')][_0x0714('0x6b')]['fields']?_0x523ce4[_0x0714('0x69')][_0x0714('0x6b')]['fields'][_0x0714('0x6c')][_0x0714('0x6d')]:![],'fulfillmentText':_0x523ce4[_0x0714('0x69')][_0x0714('0x6e')],'intentName':_0x523ce4['queryResult']['intent'][_0x0714('0x57')],'intentDisplayName':_0x523ce4[_0x0714('0x69')][_0x0714('0x6f')][_0x0714('0x70')],'isFallbackIntent':_0x523ce4[_0x0714('0x69')][_0x0714('0x6f')][_0x0714('0x71')],'languageCode':_0x523ce4[_0x0714('0x69')][_0x0714('0x72')],'queryText':_0x523ce4[_0x0714('0x69')][_0x0714('0x73')],'responseId':_0x523ce4[_0x0714('0x74')],'score':_0x523ce4[_0x0714('0x69')][_0x0714('0x75')],'speech':_0x523ce4[_0x0714('0x69')][_0x0714('0x6e')],'providerResponse':JSON[_0x0714('0x5a')](_0x2e49c3)};return _0x1ebf76;}}});};exports['tildeASR']=function(_0x4e640e,_0x120729,_0x3c103a,_0x3d01da){return tilde[_0x0714('0x4c')](_0x4e640e,_0x120729,_0x3c103a,_0x3d01da)[_0x0714('0x2b')](function(_0x5b6aaa){try{fs[_0x0714('0x1b')](_0x4e640e);}catch(_0x20c403){logger[_0x0714('0x15')](_0x20c403);}logger[_0x0714('0x19')](_0x0714('0x76'),_0x5b6aaa[_0x0714('0x50')]);logger['info'](_0x0714('0x77'),_0x5b6aaa[_0x0714('0x52')]);return _0x5b6aaa;});};exports[_0x0714('0x78')]=function(_0x2cf54c,_0x300c6d,_0x533865,_0x4bb2f6,_0x59623e,_0x3534e4){var _0x5a9acd=path['resolve'](__dirname,_0x0714('0x39'),rs[_0x0714('0x28')](0x4)+_0x0714('0x3a'));var _0x5a07fe;return aws[_0x0714('0x79')](_0x2cf54c,_0x300c6d,_0x533865,_0x4bb2f6,_0x59623e,_0x3534e4,_0x5a9acd)['then'](function(){_0x5a07fe=path[_0x0714('0x27')](__dirname,_0x0714('0x39'),rs[_0x0714('0x28')](0x4)+'.wav');return convertFile(_0x5a9acd,_0x5a07fe);})['then'](function(){try{fs[_0x0714('0x1b')](_0x5a9acd);fs[_0x0714('0x2c')](_0x5a07fe,_0x0714('0x3d'));}catch(_0x242aa2){logger[_0x0714('0x15')](_0x242aa2);}return _0x5a07fe[_0x0714('0x2d')]('.')[0x0];});};exports[_0x0714('0x7a')]=function(_0x466b17,_0x54ed51,_0x168431,_0x5d8735,_0x52eea6,_0x5ffafc){return aws[_0x0714('0x7b')](_0x466b17,_0x54ed51,_0x168431,_0x5d8735,_0x52eea6,_0x5ffafc)[_0x0714('0x2b')](function(_0x272fdb){logger[_0x0714('0x19')](JSON[_0x0714('0x5a')](_0x272fdb));return _0x272fdb;});};exports[_0x0714('0x7c')]=function(_0x24047d,_0x50de7a,_0x2aa742,_0x344843){var _0x2f0d02=util['format'](_0x0714('0x7d'),ISPEECH_API,_0x24047d,encodeURIComponent(_0x50de7a),_0x2aa742,_0x344843);var _0x14d5f1=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x0714('0x3a'));var _0x3f7d2c;return downloadFile(_0x2f0d02,_0x14d5f1)['then'](function(){_0x3f7d2c=path[_0x0714('0x27')](__dirname,'tmp',rs[_0x0714('0x28')](0x4)+_0x0714('0x29'));return convertFile(_0x14d5f1,_0x3f7d2c);})[_0x0714('0x2b')](function(){try{fs[_0x0714('0x1b')](_0x14d5f1);fs['chmodSync'](_0x3f7d2c,_0x0714('0x3d'));}catch(_0x50e14d){logger[_0x0714('0x15')](_0x50e14d);}return _0x3f7d2c[_0x0714('0x2d')]('.')[0x0];});};exports[_0x0714('0x7e')]=function(_0x4feacf,_0x102636,_0x56eda7,_0x4ffaa6){var _0x7dc32d=util['format'](_0x0714('0x7f'),ISPEECH_API,_0x102636,_0x56eda7,base64Encode(_0x4feacf),_0x4ffaa6?util[_0x0714('0x80')](_0x0714('0x81'),encodeURIComponent(_0x4ffaa6)):'freeform=3');return uploadFile(_0x7dc32d)[_0x0714('0x2b')](function(_0xf8217a){return querystring[_0x0714('0xa')](_0xf8217a);});};exports[_0x0714('0x82')]=function(_0x4b68a0,_0x2153c0){return sestek['nda'](_0x4b68a0,_0x2153c0)[_0x0714('0x2b')](function(_0x2d4e56){logger[_0x0714('0x19')](JSON[_0x0714('0x5a')](_0x2d4e56));var _0x3b85fa={'speech':_0x2d4e56[_0x0714('0x83')],'action':_0x2d4e56['channelData']?_0x2d4e56[_0x0714('0x84')][_0x0714('0x85')]:undefined,'actiondata':_0x2d4e56[_0x0714('0x84')]?_0x2d4e56['channelData'][_0x0714('0x86')]:undefined};if(_0x2d4e56[_0x0714('0x84')]&&_0x2d4e56[_0x0714('0x84')][_0x0714('0x87')]){return base64Decode(_0x2d4e56['channelData']['AudioFromTts']['Data'],path[_0x0714('0x27')](__dirname,_0x0714('0x39'),rs[_0x0714('0x28')](0x4)+_0x0714('0x29')))[_0x0714('0x2b')](function(_0x1ee533){_0x3b85fa[_0x0714('0x88')]=_0x1ee533;return _0x3b85fa;});}return _0x3b85fa;});};exports[_0x0714('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x1475=['agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','get','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','then','777','split','readFileSync','toString','base64','googleCloudTTS','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','audioContent','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','text\x20length\x20limit\x20reached','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','awsLex','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','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','Data','dirName','apiai-promise','http','https','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger'];(function(_0xe291a7,_0x598988){var _0xa63cf=function(_0x289236){while(--_0x289236){_0xe291a7['push'](_0xe291a7['shift']());}};_0xa63cf(++_0x598988);}(_0x1475,0x185));var _0x5147=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x1475[_0x561f25];return _0x150e4c;};'use strict';var apiai=require(_0x5147('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x5147('0x1'));var https=require(_0x5147('0x2'));var md5=require('md5');var path=require(_0x5147('0x3'));var querystring=require(_0x5147('0x4'));var rp=require(_0x5147('0x5'));var rs=require('randomstring');var sox=require(_0x5147('0x6'));var tts=require(_0x5147('0x7'));var urlParse=require(_0x5147('0x8'))[_0x5147('0x9')];var util=require(_0x5147('0xa'));var aws=require(_0x5147('0xb'));var google=require(_0x5147('0xc'));var sestek=require(_0x5147('0xd'));var tilde=require(_0x5147('0xe'));var logger=require(_0x5147('0xf'))(_0x5147('0x10'));var ISPEECH_API=_0x5147('0x11');function downloadFile(_0x484d73,_0x537a28){return new BPromise(function(_0x329ab0,_0x4c6bd6){var _0xc1b895=urlParse(_0x484d73);var _0x2d2ae0=_0xc1b895[_0x5147('0x12')]===_0x5147('0x13')?https:http;var _0x461d07={'host':_0xc1b895[_0x5147('0x14')],'path':_0xc1b895[_0x5147('0x3')],'headers':{'user-agent':_0x5147('0x15')}};_0x2d2ae0['get'](_0x461d07,function(_0x2a8700){if(_0x2a8700[_0x5147('0x16')]!==0xc8){logger['error'](_0x5147('0x17')+_0x484d73+_0x5147('0x18')+_0x2a8700[_0x5147('0x16')]+'\x20('+_0x2a8700[_0x5147('0x19')]+')');_0x4c6bd6(new Error(_0x5147('0x17')+_0x484d73+'\x20failed,\x20status\x20code\x20=\x20'+_0x2a8700[_0x5147('0x16')]+'\x20('+_0x2a8700[_0x5147('0x19')]+')'));return;}var _0x1cbce0=fs[_0x5147('0x1a')](_0x537a28);_0x1cbce0['on'](_0x5147('0x1b'),function(){logger[_0x5147('0x1c')](_0x5147('0x1d'));_0x1cbce0['close'](_0x329ab0);});_0x1cbce0['on'](_0x5147('0x1e'),function(_0x2f8013){fs[_0x5147('0x1f')](_0x537a28);logger[_0x5147('0x1e')](_0x5147('0x20'),_0x2f8013);_0x4c6bd6(_0x2f8013);});_0x2a8700[_0x5147('0x21')](_0x1cbce0);})['on'](_0x5147('0x1e'),function(_0x392343){logger[_0x5147('0x1e')](_0x392343);_0x4c6bd6(_0x392343);})[_0x5147('0x22')]();});}function uploadFile(_0x2d0e59){return new BPromise(function(_0xdd733d,_0x9e685c){var _0x4a1fea=urlParse(_0x2d0e59);var _0x5e0d4a=_0x4a1fea[_0x5147('0x12')]===_0x5147('0x13')?https:http;var _0x2bf6e1={'host':_0x4a1fea[_0x5147('0x14')],'path':_0x4a1fea['path'],'headers':{'user-agent':_0x5147('0x15')}};_0x5e0d4a[_0x5147('0x23')](_0x2bf6e1,function(_0x472da6){if(_0x472da6[_0x5147('0x16')]!==0xc8){_0x9e685c(new Error(_0x5147('0x17')+_0x2d0e59+_0x5147('0x18')+_0x472da6[_0x5147('0x16')]+'\x20('+_0x472da6[_0x5147('0x19')]+')'));return;}var _0xbfed9c='';_0x472da6['on']('data',function(_0x1c86e2){_0xbfed9c+=_0x1c86e2;});_0x472da6['on']('end',function(){_0xdd733d(_0xbfed9c);});})['on'](_0x5147('0x1e'),function(_0x4947d8){_0x9e685c(_0x4947d8);})[_0x5147('0x22')]();});}function convertFile(_0x53f3d3,_0x5e908a){return new BPromise(function(_0x1650dc,_0x2c34ff){var _0x536ef6=sox[_0x5147('0x24')](_0x53f3d3,_0x5e908a,{'sampleRate':0x1f40,'format':_0x5147('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x536ef6['on']('error',function(_0x507b5e){logger[_0x5147('0x1e')](_0x5147('0x26'),_0x507b5e);_0x2c34ff(_0x507b5e);});_0x536ef6['on']('end',function(){logger[_0x5147('0x1c')](_0x5147('0x27'));_0x1650dc();});_0x536ef6[_0x5147('0x28')]();});}function base64Decode(_0x4f975f,_0x23542a){var _0x3ac913=path[_0x5147('0x29')](__dirname,'tmp',rs[_0x5147('0x2a')](0x4)+_0x5147('0x2b'));fs[_0x5147('0x2c')](_0x3ac913,_0x4f975f,'base64');return convertFile(_0x3ac913,_0x23542a)[_0x5147('0x2d')](function(){try{fs['unlink'](_0x3ac913);fs['chmodSync'](_0x23542a,_0x5147('0x2e'));}catch(_0x20febe){logger[_0x5147('0x1e')](_0x20febe);}return _0x23542a[_0x5147('0x2f')]('.')[0x0];});}function base64Encode(_0x17112d){var _0x37b695=fs[_0x5147('0x30')](_0x17112d);return new Buffer(_0x37b695)[_0x5147('0x31')](_0x5147('0x32'));}exports[_0x5147('0x33')]=function(_0x270a70,_0x48505d,_0x25fbc1,_0xa0529,_0x3723f3,_0x29c11e){var _0x2835c0,_0x256f04;var _0x4c995d='https://texttospeech.googleapis.com/v1/';var _0x4d134e='?key='+_0x270a70;var _0xae0caa={};if(_0x48505d===_0x5147('0x34')){_0xae0caa['input']={'ssml':_0x25fbc1};}else{_0xae0caa[_0x5147('0x35')]={'text':_0x25fbc1};};_0xae0caa[_0x5147('0x36')]={'languageCode':_0xa0529,'ssmlGender':_0x3723f3};_0xae0caa[_0x5147('0x37')]={'audioEncoding':_0x5147('0x38'),'sampleRateHertz':0x1f40};var _0x202c01={'url':_0x4c995d+_0x5147('0x39')+_0x4d134e,'method':_0x5147('0x3a'),'json':!![],'body':_0xae0caa};return rp(_0x202c01)[_0x5147('0x2d')](function(_0x131530){return new BPromise(function(_0x5c5db6,_0x23105c){_0x2835c0=path['resolve'](__dirname,_0x5147('0x3b'),rs[_0x5147('0x2a')](0x4)+_0x5147('0x3c'));var _0x435560=Buffer['from'](_0x131530[_0x5147('0x3d')],'base64');return fs['writeFile'](_0x2835c0,_0x435560,function(_0x5b110c){_0x23105c(_0x5b110c);},function(_0x29bb2c){fs[_0x5147('0x3e')](_0x2835c0,_0x5147('0x2e'));_0x5c5db6(_0x29bb2c);});});})[_0x5147('0x2d')](function(_0x166016){_0x256f04=path[_0x5147('0x29')](__dirname,_0x5147('0x3b'),rs['generate'](0x4)+_0x5147('0x2b'));return convertFile(_0x2835c0,_0x256f04);})[_0x5147('0x2d')](function(){try{fs['unlink'](_0x2835c0);fs['chmodSync'](_0x256f04,'777');}catch(_0x2c89c8){logger['error'](_0x2c89c8);}logger[_0x5147('0x1c')](_0x5147('0x3f'),_0x256f04[_0x5147('0x2f')]('.')[0x0]);return _0x256f04[_0x5147('0x2f')]('.')[0x0];});};exports[_0x5147('0x40')]=function(_0x6f1cb1,_0x58a8f7){var _0xcf3afb=_0x5147('0x41');var _0x58fef9,_0x479dda;var _0x1dddef;var _0x3ae669={'encoding':_0x5147('0x42'),'method':_0x5147('0x3a'),'timeout':0x2710,'url':_0xcf3afb,'headers':{'Content-Type':_0x5147('0x43')},'body':'f.req='+encodeURIComponent(JSON[_0x5147('0x44')]([[[_0x5147('0x45'),JSON[_0x5147('0x44')]([_0x6f1cb1,_0x58a8f7||'en',![],'null']),null,_0x5147('0x46')]]]))};return rp(_0x3ae669)[_0x5147('0x2d')](function(_0xf24e01){try{_0x1dddef=eval(_0xf24e01[_0x5147('0x47')](0x5))[0x0][0x2];}catch(_0x50d4f4){throw new Error(_0x5147('0x48')+_0xf24e01[_0x5147('0x49')]);}if(!_0x1dddef){if(_0x6f1cb1['length']>0xc8){throw new Error(_0x5147('0x4a'));}else{throw new Error('lang\x20\x22'+_0x58a8f7+'\x22\x20might\x20not\x20exist');}}try{_0x1dddef=eval(_0x1dddef)[0x0];}catch(_0x12b285){throw new Error(_0x5147('0x48')+res[_0x5147('0x49')]);}const _0x8467a3=_0x1dddef;_0x58fef9=path['resolve'](__dirname,_0x5147('0x3b'),rs[_0x5147('0x2a')](0x4)+_0x5147('0x3c'));fs[_0x5147('0x2c')](_0x58fef9,_0x1dddef,{'encoding':_0x5147('0x32')});_0x479dda=path['resolve'](__dirname,_0x5147('0x3b'),rs['generate'](0x4)+_0x5147('0x2b'));return convertFile(_0x58fef9,_0x479dda);})['then'](function(){try{fs[_0x5147('0x1f')](_0x58fef9);fs[_0x5147('0x3e')](_0x479dda,_0x5147('0x2e'));}catch(_0x445aca){logger[_0x5147('0x1e')](_0x445aca);}logger[_0x5147('0x1c')](_0x5147('0x4b'),_0x479dda[_0x5147('0x2f')]('.')[0x0]);return _0x479dda[_0x5147('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x5d67c3,_0x3b2b50,_0x58a7ca){return google[_0x5147('0x4c')](_0x5d67c3,_0x3b2b50,_0x58a7ca)[_0x5147('0x2d')](function(_0x2161ad){logger['info'](_0x2161ad[_0x5147('0x4d')]);return rp(_0x2161ad);})['then'](function(_0x5c17eb){var _0x8833e7='';var _0x1086bc=0x0;try{fs['unlink'](_0x5d67c3);}catch(_0xc32bf5){logger[_0x5147('0x1e')](_0xc32bf5);}if(_0x5c17eb&&_0x5c17eb[_0x5147('0x4e')]){_0x8833e7=_0x5c17eb[_0x5147('0x4e')]['map'](function(_0x4f26e6){return _0x4f26e6&&_0x4f26e6[_0x5147('0x4f')][0x0]&&_0x4f26e6[_0x5147('0x4f')][0x0][_0x5147('0x50')]?_0x4f26e6[_0x5147('0x4f')][0x0][_0x5147('0x50')]:'';})[_0x5147('0x51')]('\x0a');_0x1086bc=_0x5c17eb['results'][_0x5147('0x52')](function(_0x32ec8a){return _0x32ec8a&&_0x32ec8a[_0x5147('0x4f')][0x0]&&_0x32ec8a[_0x5147('0x4f')][0x0]['confidence']?_0x32ec8a[_0x5147('0x4f')][0x0][_0x5147('0x53')]:0x0;})['join']('\x0a');}logger[_0x5147('0x1c')](_0x5147('0x54'),_0x8833e7);logger[_0x5147('0x1c')](_0x5147('0x55'),_0x1086bc);return{'transcript':_0x8833e7,'confidence':_0x1086bc};})[_0x5147('0x56')](function(_0x3722b4){logger['error']('[%s]\x20%s:%s',_0x3722b4['statusCode'],_0x3722b4['name'],_0x3722b4['message']);});};exports[_0x5147('0x57')]=function(_0x8f86b3,_0x5ad2d7,_0x1aceb5,_0x4d71cb){var _0x417939=apiai(_0x5ad2d7,{'language':_0x4d71cb||'en'});return _0x417939['textRequest'](_0x1aceb5,{'sessionId':md5(_0x8f86b3)})[_0x5147('0x2d')](function(_0x2495e2){logger[_0x5147('0x1c')](JSON[_0x5147('0x44')](_0x2495e2));return{'source':_0x2495e2[_0x5147('0x58')][_0x5147('0x59')],'resolvedQuery':_0x2495e2[_0x5147('0x58')][_0x5147('0x5a')],'action':_0x2495e2[_0x5147('0x58')][_0x5147('0x5b')],'actionIncomplete':_0x2495e2[_0x5147('0x58')][_0x5147('0x5c')],'speech':_0x2495e2[_0x5147('0x58')][_0x5147('0x5d')][_0x5147('0x5e')],'score':_0x2495e2[_0x5147('0x58')]['score'],'statusCode':_0x2495e2[_0x5147('0x5f')][_0x5147('0x60')],'endConversation':_0x2495e2[_0x5147('0x58')][_0x5147('0x61')]['endConversation']||![],'isFallbackIntent':_0x2495e2[_0x5147('0x58')][_0x5147('0x61')][_0x5147('0x62')]};});};exports[_0x5147('0x63')]=function(_0x3fb4bf,_0x4389aa,_0x4dd50,_0x5f4d44,_0x4b59e3,_0x6907b8){var _0x4e163c=_0x5f4d44[_0x5147('0x64')](/\\n/g,'\x0a');var _0x34d6d6={'credentials':{'private_key':_0x4e163c,'client_email':_0x4dd50}};var _0x39ef59=new dialogflow['SessionsClient'](_0x34d6d6);var _0xd832b5=_0x39ef59[_0x5147('0x65')](_0x4389aa,md5(_0x3fb4bf));var _0x1d6d00={'session':_0xd832b5,'queryInput':{'text':{'text':_0x4b59e3,'languageCode':_0x6907b8}}};return _0x39ef59[_0x5147('0x66')](_0x1d6d00)[_0x5147('0x2d')](function(_0x5d8336){if(_0x5d8336&&_0x5d8336[_0x5147('0x67')]){logger[_0x5147('0x1c')](_0x5147('0x68'),JSON[_0x5147('0x44')](_0x5d8336));var _0xf392ca=_0x5d8336[0x0];if(_0xf392ca){var _0x395bcf={'action':_0xf392ca['queryResult']['action'],'allRequiredParamsPresent':_0xf392ca[_0x5147('0x69')][_0x5147('0x6a')],'endConversation':_0xf392ca['queryResult'][_0x5147('0x6b')]&&_0xf392ca[_0x5147('0x69')][_0x5147('0x6b')]['fields']?_0xf392ca['queryResult'][_0x5147('0x6b')]['fields'][_0x5147('0x6c')][_0x5147('0x6d')]:![],'fulfillmentText':_0xf392ca['queryResult'][_0x5147('0x6e')],'intentName':_0xf392ca[_0x5147('0x69')][_0x5147('0x6f')][_0x5147('0x70')],'intentDisplayName':_0xf392ca['queryResult'][_0x5147('0x6f')][_0x5147('0x71')],'isFallbackIntent':_0xf392ca[_0x5147('0x69')][_0x5147('0x6f')][_0x5147('0x72')],'languageCode':_0xf392ca[_0x5147('0x69')][_0x5147('0x73')],'queryText':_0xf392ca[_0x5147('0x69')][_0x5147('0x74')],'responseId':_0xf392ca[_0x5147('0x75')],'score':_0xf392ca[_0x5147('0x69')][_0x5147('0x76')],'speech':_0xf392ca[_0x5147('0x69')][_0x5147('0x6e')],'providerResponse':JSON['stringify'](_0x5d8336)};return _0x395bcf;}}});};exports['tildeASR']=function(_0x4e3ec6,_0x2f49b5,_0x3454df,_0x41397b){return tilde[_0x5147('0x4c')](_0x4e3ec6,_0x2f49b5,_0x3454df,_0x41397b)[_0x5147('0x2d')](function(_0x4e8822){try{fs[_0x5147('0x1f')](_0x4e3ec6);}catch(_0x943c67){logger[_0x5147('0x1e')](_0x943c67);}logger[_0x5147('0x1c')]('Tilde\x20ASR\x20transcription',_0x4e8822['transcript']);logger['info'](_0x5147('0x77'),_0x4e8822[_0x5147('0x53')]);return _0x4e8822;});};exports[_0x5147('0x78')]=function(_0x3659bc,_0x3b7c52,_0x3e0d1f,_0x45e1eb,_0x3b473e,_0x17343a){var _0x3ed7e3=path[_0x5147('0x29')](__dirname,'tmp',rs[_0x5147('0x2a')](0x4)+_0x5147('0x3c'));var _0x536c25;return aws['polly'](_0x3659bc,_0x3b7c52,_0x3e0d1f,_0x45e1eb,_0x3b473e,_0x17343a,_0x3ed7e3)[_0x5147('0x2d')](function(){_0x536c25=path['resolve'](__dirname,'tmp',rs[_0x5147('0x2a')](0x4)+_0x5147('0x2b'));return convertFile(_0x3ed7e3,_0x536c25);})[_0x5147('0x2d')](function(){try{fs[_0x5147('0x1f')](_0x3ed7e3);fs[_0x5147('0x3e')](_0x536c25,_0x5147('0x2e'));}catch(_0x1a8718){logger[_0x5147('0x1e')](_0x1a8718);}return _0x536c25[_0x5147('0x2f')]('.')[0x0];});};exports[_0x5147('0x79')]=function(_0x3dcb1a,_0x88078,_0x27d092,_0x49de22,_0xe033cb,_0x22b912){return aws['lex'](_0x3dcb1a,_0x88078,_0x27d092,_0x49de22,_0xe033cb,_0x22b912)[_0x5147('0x2d')](function(_0x3faf27){logger[_0x5147('0x1c')](JSON[_0x5147('0x44')](_0x3faf27));return _0x3faf27;});};exports[_0x5147('0x7a')]=function(_0x32b18,_0x25a814,_0x44a8e2,_0x202def){var _0x3de247=util[_0x5147('0x7b')](_0x5147('0x7c'),ISPEECH_API,_0x32b18,encodeURIComponent(_0x25a814),_0x44a8e2,_0x202def);var _0xcdb242=path['resolve'](__dirname,_0x5147('0x3b'),rs['generate'](0x4)+_0x5147('0x3c'));var _0x110728;return downloadFile(_0x3de247,_0xcdb242)[_0x5147('0x2d')](function(){_0x110728=path[_0x5147('0x29')](__dirname,_0x5147('0x3b'),rs[_0x5147('0x2a')](0x4)+_0x5147('0x2b'));return convertFile(_0xcdb242,_0x110728);})[_0x5147('0x2d')](function(){try{fs['unlink'](_0xcdb242);fs[_0x5147('0x3e')](_0x110728,_0x5147('0x2e'));}catch(_0x2029fe){logger[_0x5147('0x1e')](_0x2029fe);}return _0x110728[_0x5147('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x3954a8,_0x5cc43a,_0x13c58d,_0x258b6b){var _0x3a4938=util[_0x5147('0x7b')](_0x5147('0x7d'),ISPEECH_API,_0x5cc43a,_0x13c58d,base64Encode(_0x3954a8),_0x258b6b?util['format'](_0x5147('0x7e'),encodeURIComponent(_0x258b6b)):'freeform=3');return uploadFile(_0x3a4938)[_0x5147('0x2d')](function(_0x3a485a){return querystring[_0x5147('0x9')](_0x3a485a);});};exports[_0x5147('0x7f')]=function(_0x1467ce,_0x50c42e){return sestek[_0x5147('0x80')](_0x1467ce,_0x50c42e)[_0x5147('0x2d')](function(_0x1c4f4a){logger[_0x5147('0x1c')](JSON[_0x5147('0x44')](_0x1c4f4a));var _0x1a9c6c={'speech':_0x1c4f4a[_0x5147('0x81')],'action':_0x1c4f4a[_0x5147('0x82')]?_0x1c4f4a['channelData'][_0x5147('0x83')]:undefined,'actiondata':_0x1c4f4a[_0x5147('0x82')]?_0x1c4f4a[_0x5147('0x82')][_0x5147('0x84')]:undefined};if(_0x1c4f4a[_0x5147('0x82')]&&_0x1c4f4a[_0x5147('0x82')]['AudioFromTts']){return base64Decode(_0x1c4f4a[_0x5147('0x82')]['AudioFromTts'][_0x5147('0x85')],path['resolve'](__dirname,'tmp',rs[_0x5147('0x2a')](0x4)+_0x5147('0x2b')))[_0x5147('0x2d')](function(_0x316592){_0x1a9c6c['audiofile']=_0x316592;return _0x1a9c6c;});}return _0x1a9c6c;});};exports[_0x5147('0x86')]=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 40e09a4..55ac249 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 _0xc688=['./nda','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc688,0x1a2));var _0x8c68=function(_0x342b97,_0x371adb){_0x342b97=_0x342b97-0x0;var _0x171688=_0xc688[_0x342b97];return _0x171688;};var nda=require(_0x8c68('0x0'));module[_0x8c68('0x1')]={'nda':nda}; \ No newline at end of file +var _0x21a4=['./nda'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21a4,0x78));var _0x421a=function(_0x5816dc,_0x170727){_0x5816dc=_0x5816dc-0x0;var _0x42e8e4=_0x21a4[_0x5816dc];return _0x42e8e4;};var nda=require(_0x421a('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 1f8ac9f..7a76a94 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 _0x63c6=['custom_action','CustomAction','custom_action_data','body','CustomActionData','info','stringify','request-promise','url','exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x1b4264,_0x1f6663){var _0x3e667c=function(_0x3d99f5){while(--_0x3d99f5){_0x1b4264['push'](_0x1b4264['shift']());}};_0x3e667c(++_0x1f6663);}(_0x63c6,0xbb));var _0x663c=function(_0x2094eb,_0x234a56){_0x2094eb=_0x2094eb-0x0;var _0x36e9af=_0x63c6[_0x2094eb];return _0x36e9af;};'use strict';var rp=require(_0x663c('0x0'));var url=require(_0x663c('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x663c('0x2')]=function(_0x859d1d,_0x34c708){var _0x1a2514={'method':_0x663c('0x3'),'uri':url[_0x663c('0x4')](_0x34c708[_0x663c('0x5')],_0x663c('0x6')),'form':{'grant_type':_0x663c('0x7'),'username':_0x34c708['username'],'password':_0x34c708[_0x663c('0x7')]},'json':!![]};return rp(_0x1a2514)[_0x663c('0x8')](function(_0x3eb551){var _0xb32d9e={'method':'POST','uri':url[_0x663c('0x4')](_0x34c708['ndassistant_url'],_0x663c('0x9')),'body':{'type':_0x34c708['ndaactivity_type']||_0x663c('0xa'),'channelId':_0x663c('0xb'),'conversation':{'id':_0x859d1d[_0x663c('0xc')]},'from':{'id':_0x859d1d[_0x663c('0xd')],'name':_0x859d1d[_0x663c('0xe')]},'recipient':{'id':_0x859d1d[_0x663c('0xf')],'name':_0x859d1d[_0x663c('0x10')]},'text':_0x34c708['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3eb551[_0x663c('0x11')]},'json':!![]};if(_0x34c708[_0x663c('0x12')]){_0xb32d9e['body'][_0x663c('0x13')][_0x663c('0x14')]=_0x34c708[_0x663c('0x12')];}if(_0x34c708[_0x663c('0x15')]=='1'){_0xb32d9e['body'][_0x663c('0x13')][_0x663c('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x34c708[_0x663c('0x17')]){_0xb32d9e['body'][_0x663c('0x13')][_0x663c('0x18')]=_0x34c708[_0x663c('0x17')];if(_0x34c708[_0x663c('0x19')]){_0xb32d9e[_0x663c('0x1a')][_0x663c('0x13')][_0x663c('0x1b')]=_0x34c708[_0x663c('0x19')];}}logger[_0x663c('0x1c')](JSON[_0x663c('0x1d')](_0xb32d9e));return rp(_0xb32d9e);});}; \ No newline at end of file +var _0x9cff=['ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','calleridname','dnid','text','access_token','body'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x4b696e,_0x4ff3c9){_0x4b696e=_0x4b696e-0x0;var _0x40858d=_0x9cff[_0x4b696e];return _0x40858d;};'use strict';var rp=require('request-promise');var url=require(_0xf9cf('0x0'));var logger=require(_0xf9cf('0x1'))(_0xf9cf('0x2'));module['exports']=function(_0x197da2,_0x142fc6){var _0x41a299={'method':'POST','uri':url[_0xf9cf('0x3')](_0x142fc6[_0xf9cf('0x4')],_0xf9cf('0x5')),'form':{'grant_type':_0xf9cf('0x6'),'username':_0x142fc6[_0xf9cf('0x7')],'password':_0x142fc6[_0xf9cf('0x6')]},'json':!![]};return rp(_0x41a299)[_0xf9cf('0x8')](function(_0x19d7f9){var _0x1c29f6={'method':_0xf9cf('0x9'),'uri':url[_0xf9cf('0x3')](_0x142fc6['ndassistant_url'],_0xf9cf('0xa')),'body':{'type':_0x142fc6[_0xf9cf('0xb')]||'message','channelId':_0xf9cf('0xc'),'conversation':{'id':_0x197da2['uniqueid']},'from':{'id':_0x197da2['callerid'],'name':_0x197da2[_0xf9cf('0xd')]},'recipient':{'id':_0x197da2[_0xf9cf('0xe')],'name':_0x197da2['extension']},'text':_0x142fc6[_0xf9cf('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x19d7f9[_0xf9cf('0x10')]},'json':!![]};if(_0x142fc6['project']){_0x1c29f6[_0xf9cf('0x11')]['channelData'][_0xf9cf('0x12')]=_0x142fc6[_0xf9cf('0x13')];}if(_0x142fc6[_0xf9cf('0x14')]=='1'){_0x1c29f6[_0xf9cf('0x11')][_0xf9cf('0x15')][_0xf9cf('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf9cf('0x17')};}if(_0x142fc6['custom_action']){_0x1c29f6[_0xf9cf('0x11')][_0xf9cf('0x15')][_0xf9cf('0x18')]=_0x142fc6[_0xf9cf('0x19')];if(_0x142fc6[_0xf9cf('0x1a')]){_0x1c29f6[_0xf9cf('0x11')][_0xf9cf('0x15')][_0xf9cf('0x1b')]=_0x142fc6[_0xf9cf('0x1a')];}}logger[_0xf9cf('0x1c')](JSON[_0xf9cf('0x1d')](_0x1c29f6));return rp(_0x1c29f6);});}; \ 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 1002c0b..a2e5971 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 _0xe759=['exports','./lib/api'];(function(_0x5c8cf2,_0x663ad7){var _0x1976dc=function(_0x46cddd){while(--_0x46cddd){_0x5c8cf2['push'](_0x5c8cf2['shift']());}};_0x1976dc(++_0x663ad7);}(_0xe759,0x9f));var _0x9e75=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe759[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0x9e75('0x0'));module[_0x9e75('0x1')]=function(_0x11f2d9,_0x46cca7,_0x2d9c71,_0x43930f){return asr(_0x11f2d9,_0x46cca7,_0x2d9c71,_0x43930f);}; \ No newline at end of file +var _0xcd3f=['./lib/api','exports'];(function(_0x5a322d,_0x5074db){var _0x4b1d48=function(_0x418811){while(--_0x418811){_0x5a322d['push'](_0x5a322d['shift']());}};_0x4b1d48(++_0x5074db);}(_0xcd3f,0x152));var _0xfcd3=function(_0x3c5a33,_0x1090de){_0x3c5a33=_0x3c5a33-0x0;var _0x190505=_0xcd3f[_0x3c5a33];return _0x190505;};'use strict';var asr=require(_0xfcd3('0x0'));module[_0xfcd3('0x1')]=function(_0xdd4b9,_0x332771,_0x4a1022,_0x59c66e){return asr(_0xdd4b9,_0x332771,_0x4a1022,_0x59c66e);}; \ 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 3800488..d25a589 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 _0xffb8=['Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x4bfc64,_0x25976d){var _0x5d8f2a=function(_0x5d184a){while(--_0x5d184a){_0x4bfc64['push'](_0x4bfc64['shift']());}};_0x5d8f2a(++_0x25976d);}(_0xffb8,0x1a5));var _0x8ffb=function(_0x547d74,_0x435559){_0x547d74=_0x547d74-0x0;var _0x19ecf8=_0xffb8[_0x547d74];return _0x19ecf8;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8ffb('0x0'));var crypto=require(_0x8ffb('0x1'));var logger=require(_0x8ffb('0x2'))(_0x8ffb('0x3'));module[_0x8ffb('0x4')]=function(_0x243c2b,_0x5c49b4,_0x50b503,_0x2a2b49){return new BPromise(function(_0xf0932f,_0x87f481){logger[_0x8ffb('0x5')](_0x8ffb('0x6'),_0x2a2b49||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1b80ef=new WebSocket(_0x2a2b49||_0x8ffb('0x7'),{'perMessageDeflate':![]});var _0x53bf6d='';var _0x546028='0';var _0x4c1478='1';var _0x3112c8='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2bc57e(_0x1a824b){var _0xc477a6=crypto[_0x8ffb('0x8')](_0x8ffb('0x9'));_0xc477a6[_0x8ffb('0xa')](_0x1a824b);return _0xc477a6[_0x8ffb('0xb')](_0x8ffb('0xc'));}function _0x3f417b(){try{logger[_0x8ffb('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x16e9d7=moment()['unix']();var _0x3eac74=_0x2bc57e(_0x16e9d7+_0x5c49b4+_0x50b503);_0x1b80ef[_0x8ffb('0xd')](JSON[_0x8ffb('0xe')]({'appID':_0x5c49b4,'timestamp':_0x16e9d7,'appKey':_0x3eac74}));var _0x1c2c77=fs[_0x8ffb('0xf')](_0x243c2b);_0x1c2c77['on'](_0x8ffb('0x10'),function(_0x24e56f){_0x1b80ef[_0x8ffb('0xd')](_0x24e56f);});_0x1c2c77['on'](_0x8ffb('0x11'),function(){_0x1b80ef[_0x8ffb('0xd')]('EOS');});}catch(_0x5cb2d4){logger[_0x8ffb('0x12')](_0x8ffb('0x13'),JSON['stringify'](_0x5cb2d4));_0x1b80ef[_0x8ffb('0x14')]();}}function _0x2d4176(_0x1fc8f6){try{if(_0x1fc8f6){var _0xc1d367=JSON[_0x8ffb('0x15')](_0x1fc8f6);switch(_0xc1d367[_0x8ffb('0x16')]){case 0x0:if(_0xc1d367[_0x8ffb('0x17')]){if(_0xc1d367[_0x8ffb('0x17')][_0x8ffb('0x18')]){logger[_0x8ffb('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x8ffb('0xe')](_0xc1d367['result'][_0x8ffb('0x19')]));_0x53bf6d=_0xc1d367[_0x8ffb('0x17')][_0x8ffb('0x19')][0x0][_0x8ffb('0x1a')];_0x546028=_0xc1d367[_0x8ffb('0x17')]['hypotheses'][0x0][_0x8ffb('0x1b')];_0x4c1478='0';_0x3112c8=_0x8ffb('0x1c');_0x1b80ef[_0x8ffb('0x14')]();}}break;case 0x1:logger[_0x8ffb('0x5')](_0x8ffb('0x1d'));_0x4c1478='1';_0x3112c8=_0x8ffb('0x1d');break;case 0x2:logger['info'](_0x8ffb('0x1e'));_0x4c1478='2';_0x3112c8='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x8ffb('0x5')](_0x8ffb('0x1f'));_0x4c1478='9';_0x3112c8=_0x8ffb('0x1f');break;case 0xa:logger[_0x8ffb('0x5')](_0x8ffb('0x20'));_0x4c1478='10';_0x3112c8=_0x8ffb('0x20');break;case 0xb:logger[_0x8ffb('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4c1478='11';_0x3112c8=_0x8ffb('0x21');}}}catch(_0x4a51c2){logger['error'](_0x8ffb('0x22'),JSON[_0x8ffb('0xe')](_0x4a51c2));_0x1b80ef[_0x8ffb('0x14')]();}}function _0x295601(){logger[_0x8ffb('0x5')](_0x8ffb('0x23'));_0xf0932f({'transcript':_0x53bf6d,'confidence':_0x546028,'status':_0x4c1478,'status_message':_0x3112c8});}function _0x951143(_0x1b0e44){logger['error'](_0x8ffb('0x24'));if(!_[_0x8ffb('0x25')](_0x1b0e44)){logger['error'](_[_0x8ffb('0x26')](_0x1b0e44)?JSON[_0x8ffb('0xe')](_0x1b0e44):_0x1b0e44);}}_0x1b80ef['on'](_0x8ffb('0x27'),_0x3f417b);_0x1b80ef['on'](_0x8ffb('0x28'),_0x2d4176);_0x1b80ef['on'](_0x8ffb('0x11'),_0x295601);_0x1b80ef['on'](_0x8ffb('0x12'),_0x951143);});}; \ No newline at end of file +var _0x8eb5=['terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','hex','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error'];(function(_0x3f2668,_0x156268){var _0x1da0b7=function(_0x8a517c){while(--_0x8a517c){_0x3f2668['push'](_0x3f2668['shift']());}};_0x1da0b7(++_0x156268);}(_0x8eb5,0x124));var _0x58eb=function(_0x20a010,_0x33f01f){_0x20a010=_0x20a010-0x0;var _0xf6cf01=_0x8eb5[_0x20a010];return _0xf6cf01;};'use strict';var BPromise=require(_0x58eb('0x0'));var _=require(_0x58eb('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x58eb('0x2'));var crypto=require(_0x58eb('0x3'));var logger=require(_0x58eb('0x4'))(_0x58eb('0x5'));module['exports']=function(_0x174373,_0x10f9ea,_0x396f5d,_0x532a5e){return new BPromise(function(_0x7b6c1a,_0x273bea){logger[_0x58eb('0x6')](_0x58eb('0x7'),_0x532a5e||_0x58eb('0x8'));var _0x24a9c4=new WebSocket(_0x532a5e||_0x58eb('0x8'),{'perMessageDeflate':![]});var _0x3cd19d='';var _0x45bc61='0';var _0x166c6a='1';var _0x57cab2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x3cedb1(_0x3d76fa){var _0x59b184=crypto['createHash'](_0x58eb('0x9'));_0x59b184[_0x58eb('0xa')](_0x3d76fa);return _0x59b184['digest'](_0x58eb('0xb'));}function _0x46b5b5(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x51aa90=moment()['unix']();var _0x194b62=_0x3cedb1(_0x51aa90+_0x10f9ea+_0x396f5d);_0x24a9c4[_0x58eb('0xc')](JSON[_0x58eb('0xd')]({'appID':_0x10f9ea,'timestamp':_0x51aa90,'appKey':_0x194b62}));var _0x396752=fs[_0x58eb('0xe')](_0x174373);_0x396752['on'](_0x58eb('0xf'),function(_0x4de3ec){_0x24a9c4['send'](_0x4de3ec);});_0x396752['on'](_0x58eb('0x10'),function(){_0x24a9c4[_0x58eb('0xc')](_0x58eb('0x11'));});}catch(_0x4550b4){logger[_0x58eb('0x12')](_0x58eb('0x13'),JSON[_0x58eb('0xd')](_0x4550b4));_0x24a9c4[_0x58eb('0x14')]();}}function _0x534105(_0x5d968c){try{if(_0x5d968c){var _0x29e8c3=JSON[_0x58eb('0x15')](_0x5d968c);switch(_0x29e8c3[_0x58eb('0x16')]){case 0x0:if(_0x29e8c3[_0x58eb('0x17')]){if(_0x29e8c3[_0x58eb('0x17')][_0x58eb('0x18')]){logger[_0x58eb('0x6')](_0x58eb('0x19'),JSON[_0x58eb('0xd')](_0x29e8c3[_0x58eb('0x17')][_0x58eb('0x1a')]));_0x3cd19d=_0x29e8c3['result']['hypotheses'][0x0][_0x58eb('0x1b')];_0x45bc61=_0x29e8c3['result'][_0x58eb('0x1a')][0x0][_0x58eb('0x1c')];_0x166c6a='0';_0x57cab2=_0x58eb('0x1d');_0x24a9c4[_0x58eb('0x14')]();}}break;case 0x1:logger['info'](_0x58eb('0x1e'));_0x166c6a='1';_0x57cab2=_0x58eb('0x1e');break;case 0x2:logger[_0x58eb('0x6')](_0x58eb('0x1f'));_0x166c6a='2';_0x57cab2=_0x58eb('0x1f');break;case 0x9:logger[_0x58eb('0x6')](_0x58eb('0x20'));_0x166c6a='9';_0x57cab2=_0x58eb('0x20');break;case 0xa:logger['info'](_0x58eb('0x21'));_0x166c6a='10';_0x57cab2=_0x58eb('0x21');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x166c6a='11';_0x57cab2=_0x58eb('0x22');}}}catch(_0x18c0ba){logger[_0x58eb('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x58eb('0xd')](_0x18c0ba));_0x24a9c4[_0x58eb('0x14')]();}}function _0x5c2917(){logger[_0x58eb('0x6')](_0x58eb('0x23'));_0x7b6c1a({'transcript':_0x3cd19d,'confidence':_0x45bc61,'status':_0x166c6a,'status_message':_0x57cab2});}function _0x39800a(_0x5649a4){logger[_0x58eb('0x12')](_0x58eb('0x24'));if(!_[_0x58eb('0x25')](_0x5649a4)){logger[_0x58eb('0x12')](_['isObject'](_0x5649a4)?JSON[_0x58eb('0xd')](_0x5649a4):_0x5649a4);}}_0x24a9c4['on'](_0x58eb('0x26'),_0x46b5b5);_0x24a9c4['on']('message',_0x534105);_0x24a9c4['on'](_0x58eb('0x10'),_0x5c2917);_0x24a9c4['on'](_0x58eb('0x12'),_0x39800a);});}; \ 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 e22a4ab..d3922fc 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 _0xeee6=['./asr','exports'];(function(_0x6fb9c3,_0x539a3f){var _0x2c60b2=function(_0xb0247b){while(--_0xb0247b){_0x6fb9c3['push'](_0x6fb9c3['shift']());}};_0x2c60b2(++_0x539a3f);}(_0xeee6,0xbe));var _0x6eee=function(_0x259797,_0x583ed4){_0x259797=_0x259797-0x0;var _0x1d42dd=_0xeee6[_0x259797];return _0x1d42dd;};var asr=require(_0x6eee('0x0'));module[_0x6eee('0x1')]={'asr':asr}; \ No newline at end of file +var _0x25ae=['./asr','exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x25ae,0x84));var _0xe25a=function(_0x2a7b95,_0x550ce2){_0x2a7b95=_0x2a7b95-0x0;var _0x50b4e5=_0x25ae[_0x2a7b95];return _0x50b4e5;};var asr=require(_0xe25a('0x0'));module[_0xe25a('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4f4155d..e7b0dfa 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 _0xe456=['util','EventEmitter','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xe456,0xf2));var _0x6e45=function(_0x3bd70e,_0xd68771){_0x3bd70e=_0x3bd70e-0x0;var _0x400f98=_0xe456[_0x3bd70e];return _0x400f98;};'use strict';var util=require(_0x6e45('0x0'));var net=require('net');var EventEmitter=require('events')[_0x6e45('0x1')];var AGIError=require('./error');var AGIChannel=require(_0x6e45('0x2'));var AGIServer=function(_0x84a4e0,_0x184ce9,_0x4828b6){var _0x1b0817=this,_0x84a4e0=_0x84a4e0||0x11dd,_0x184ce9=_0x184ce9||'127.0.0.1',_0x8db4ef=null,_0x495069=0x0;EventEmitter[_0x6e45('0x3')](_0x1b0817);function _0x30797d(){if(!_0x84a4e0){_0x1b0817[_0x6e45('0x4')](_0x6e45('0x5'),new AGIError(_0x6e45('0x6')));return![];}_0x8db4ef=net[_0x6e45('0x7')]();_0x8db4ef[_0x6e45('0x8')](_0x84a4e0,_0x184ce9);_0x8db4ef['on'](_0x6e45('0x9'),function(){_0x1b0817[_0x6e45('0x4')](_0x6e45('0x9'));});_0x8db4ef['on']('connection',function(_0x91ab6d){_0x8db4ef[_0x6e45('0xa')](function(_0x2c342b,_0x328942){if(_0x2c342b){_0x1b0817['emit'](_0x6e45('0x5'),new AGIError(_0x6e45('0xb'),_0x2c342b));}else if(_0x4828b6&&_0x4828b6<0x0){_0x1b0817[_0x6e45('0x4')](_0x6e45('0x5'),new AGIError(_0x6e45('0xc')));_0x91ab6d[_0x6e45('0xd')]();}else if(_0x4828b6&&_0x4828b6>0x0&&_0x4828b6<_0x328942){_0x495069+=0x1;_0x1b0817[_0x6e45('0x4')](_0x6e45('0x5'),new AGIError(_0x6e45('0xe'),_0x495069));_0x91ab6d[_0x6e45('0xd')]();}else{var _0x5b99a7=new AGIChannel(_0x91ab6d);_0x5b99a7['on'](_0x6e45('0xf'),function(){_0x1b0817[_0x6e45('0x4')](_0x6e45('0x10'),_0x5b99a7);});}});});_0x8db4ef['on'](_0x6e45('0x5'),function(_0x5b497f){_0x1b0817[_0x6e45('0x4')](_0x6e45('0x5'),new AGIError(_0x6e45('0xb'),_0x5b497f[_0x6e45('0x11')]));});_0x8db4ef['on']('close',function(){_0x1b0817[_0x6e45('0x4')]('close',new AGIError(_0x6e45('0x12')));});}process[_0x6e45('0x13')](function(){_0x30797d();});};util[_0x6e45('0x14')](AGIServer,EventEmitter);module[_0x6e45('0x15')]=function(_0x21fbd4,_0xa74876,_0x2d1320){return new AGIServer(_0x21fbd4,_0xa74876,_0x2d1320);}; \ No newline at end of file +var _0xb20a=['inherits','exports','util','net','events','EventEmitter','./error','call','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','error','destroy','code','close','E_AGI_SERVER_CLOSE'];(function(_0x406795,_0x416469){var _0xfa6c20=function(_0x1bcc17){while(--_0x1bcc17){_0x406795['push'](_0x406795['shift']());}};_0xfa6c20(++_0x416469);}(_0xb20a,0x1a6));var _0xab20=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb20a[_0x27af45];return _0x18df21;};'use strict';var util=require(_0xab20('0x0'));var net=require(_0xab20('0x1'));var EventEmitter=require(_0xab20('0x2'))[_0xab20('0x3')];var AGIError=require(_0xab20('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x224e1c,_0xa2b3a4,_0xb38feb){var _0x5c97f7=this,_0x224e1c=_0x224e1c||0x11dd,_0xa2b3a4=_0xa2b3a4||'127.0.0.1',_0x373f52=null,_0x9c3926=0x0;EventEmitter[_0xab20('0x5')](_0x5c97f7);function _0xf8ec39(){if(!_0x224e1c){_0x5c97f7['emit']('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x373f52=net[_0xab20('0x6')]();_0x373f52[_0xab20('0x7')](_0x224e1c,_0xa2b3a4);_0x373f52['on'](_0xab20('0x8'),function(){_0x5c97f7[_0xab20('0x9')]('listening');});_0x373f52['on'](_0xab20('0xa'),function(_0x1a63fd){_0x373f52[_0xab20('0xb')](function(_0x1e5005,_0x5c0027){if(_0x1e5005){_0x5c97f7['emit']('error',new AGIError(_0xab20('0xc'),_0x1e5005));}else if(_0xb38feb&&_0xb38feb<0x0){_0x5c97f7[_0xab20('0x9')](_0xab20('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1a63fd['destroy']();}else if(_0xb38feb&&_0xb38feb>0x0&&_0xb38feb<_0x5c0027){_0x9c3926+=0x1;_0x5c97f7[_0xab20('0x9')](_0xab20('0xd'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x9c3926));_0x1a63fd[_0xab20('0xe')]();}else{var _0x58094d=new AGIChannel(_0x1a63fd);_0x58094d['on']('ready',function(){_0x5c97f7[_0xab20('0x9')]('connection',_0x58094d);});}});});_0x373f52['on'](_0xab20('0xd'),function(_0x9bb82e){_0x5c97f7[_0xab20('0x9')](_0xab20('0xd'),new AGIError(_0xab20('0xc'),_0x9bb82e[_0xab20('0xf')]));});_0x373f52['on'](_0xab20('0x10'),function(){_0x5c97f7['emit'](_0xab20('0x10'),new AGIError(_0xab20('0x11')));});}process['nextTick'](function(){_0xf8ec39();});};util[_0xab20('0x12')](AGIServer,EventEmitter);module[_0xab20('0x13')]=function(_0x192646,_0x920ec0,_0x5ac316){return new AGIServer(_0x192646,_0x920ec0,_0x5ac316);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 90290fb..f102696 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 _0x4358=['variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','recordingFormat','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','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','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','email','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','getSquareProject','name','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','interval','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Query\x20executed\x20correctly\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','en-US','ssmlGender','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','text','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','speed','ispeechASR','ispeech_asr_language','isConfigured','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','clear','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','saveRestApiResult','%s.%s','length','setVariable','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','getQueryOdbc'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x4358,0xf4));var _0x8435=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x4358[_0x1283d4];return _0x433643;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x8435('0x0'));var _=require(_0x8435('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x8435('0x2'));var Mustache=require('mustache');var rp=require(_0x8435('0x3'));var logger=require(_0x8435('0x4'))(_0x8435('0x5'));var config=require(_0x8435('0x6'));var scripts=require(_0x8435('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x8435('0x8'),'rawBody'];var verticesWithRetry=[_0x8435('0x9'),'getdigits',_0x8435('0xa')];var AGIVertices=function(_0x43909b,_0x16e87e,_0x56b186){this[_0x8435('0xb')]=_0x43909b;this[_0x8435('0xc')]=_0x16e87e;this[_0x8435('0xd')]=_0x56b186;};AGIVertices[_0x8435('0xe')][_0x8435('0xf')]=function(_0x150fc9,_0x1a0011){this['rpc'][_0x8435('0x10')](_0x150fc9)[_0x8435('0x11')](function(_0x535fe0){_0x1a0011(null,_0x535fe0?_0x535fe0['name']:![]);})[_0x8435('0x12')](function(_0x527788){_0x1a0011(_0x527788);});};AGIVertices[_0x8435('0xe')]['getVoiceQueue']=function(_0x15a187,_0x1f1241){this[_0x8435('0xc')][_0x8435('0x13')](_0x15a187)[_0x8435('0x11')](function(_0x17c917){_0x1f1241(null,_0x17c917?_0x17c917['name']:![]);})[_0x8435('0x12')](function(_0x3d0c8e){_0x1f1241(_0x3d0c8e);});};AGIVertices[_0x8435('0xe')][_0x8435('0x14')]=function(_0x4785bb,_0x1db69d){this[_0x8435('0xc')]['getSquareProjectById'](_0x4785bb)['then'](function(_0x316a2a){_0x1db69d(null,_0x316a2a?_0x316a2a[_0x8435('0x15')]:![]);})['catch'](function(_0x2fbf82){_0x1db69d(_0x2fbf82);});};AGIVertices[_0x8435('0xe')][_0x8435('0x16')]=function(_0x578e70,_0x324088){this[_0x8435('0xc')][_0x8435('0x17')](_0x578e70)[_0x8435('0x11')](function(_0x3442d7){_0x324088(null,_0x3442d7?_0x3442d7['dsn']:![]);})[_0x8435('0x12')](function(_0x13b378){_0x324088(_0x13b378);});};AGIVertices[_0x8435('0xe')][_0x8435('0x18')]=function(_0x2cf4e7,_0xb59444){this['rpc'][_0x8435('0x19')](_0x2cf4e7)[_0x8435('0x11')](function(_0x3af656){_0xb59444(null,_0x3af656?_0x3af656[_0x8435('0x15')]:![]);})['catch'](function(_0x2d774c){_0xb59444(_0x2d774c);});};AGIVertices[_0x8435('0xe')][_0x8435('0x1a')]=function(_0x34a64b,_0x332608){this[_0x8435('0xc')][_0x8435('0x1b')](_0x34a64b)['then'](function(_0x465384){_0x332608(null,_0x465384?_0x465384['name']:![]);})[_0x8435('0x12')](function(_0x10c089){_0x332608(_0x10c089);});};AGIVertices[_0x8435('0xe')][_0x8435('0x1c')]=function(_0x5a6f55,_0x2b3c2c){var _0x3e438b=this;this[_0x8435('0xc')][_0x8435('0x1d')](_0x5a6f55)[_0x8435('0x11')](function(_0x122047){_0x2b3c2c(null,_0x122047?_0x3e438b[_0x8435('0x1e')](_0x122047[_0x8435('0x1f')]):![]);})[_0x8435('0x12')](function(_0x89677a){_0x2b3c2c(_0x89677a);});};AGIVertices[_0x8435('0xe')][_0x8435('0x20')]=function(_0xea765a,_0x4ae641){this[_0x8435('0xc')][_0x8435('0x21')](_0xea765a)['then'](function(_0x49b3b2){_0x4ae641(null,_0x49b3b2?_0x49b3b2:![]);})[_0x8435('0x12')](function(_0x5a354f){_0x4ae641(_0x5a354f);});};AGIVertices[_0x8435('0xe')][_0x8435('0x22')]=function(_0x34a942,_0x1e9412,_0x42c3b4){this[_0x8435('0xd')][_0x8435('0x22')](_0x34a942,_0x1e9412)[_0x8435('0x11')](function(){_0x42c3b4(null);})[_0x8435('0x12')](function(_0x526aa3){_0x42c3b4(_0x526aa3);});};AGIVertices[_0x8435('0xe')][_0x8435('0x23')]=function(_0x34803a,_0x31b176){this[_0x8435('0xc')][_0x8435('0x24')](_0x34803a)[_0x8435('0x11')](function(_0x2201a3){if(_0x2201a3){if(_0x2201a3['IntervalId']){_0x31b176(null,[_0x2201a3['interval']]);}else{_0x31b176(null,_[_0x8435('0x25')](_0x2201a3[_0x8435('0x26')],_0x8435('0x27')));}}else{_0x31b176(null,![]);}})[_0x8435('0x12')](function(_0x99346){_0x31b176(_0x99346);});};AGIVertices[_0x8435('0xe')][_0x8435('0x1e')]=function(_0x130fe9){return util[_0x8435('0x28')](_0x8435('0x29'),FILES_PATH,_0x130fe9);};AGIVertices['prototype']['getQueryOdbc']=function(_0x4938aa,_0x53319e,_0x461ef5){odbc[_0x8435('0x2a')](_0x4938aa,function(_0x2c8935){if(_0x2c8935){logger[_0x8435('0x2b')](_0x8435('0x2c'),_0x2c8935);_0x461ef5(_0x2c8935);}else{logger[_0x8435('0x2d')]('ODBC\x20connection\x20successfully');odbc['query'](_0x53319e,function(_0x12f664,_0x3f6274){if(_0x12f664){logger['info']('Error\x20executing\x20query\x20%s',_0x53319e);_0x461ef5(_0x12f664);}else{logger[_0x8435('0x2d')](_0x8435('0x2e'),_0x53319e);odbc['close'](function(_0x1e0745){if(_0x1e0745){logger[_0x8435('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1e0745);}_0x461ef5(null,_0x3f6274);});}});}});};AGIVertices[_0x8435('0xe')]['getSmsAccount']=function(_0x1fcf67,_0x34aa4c){this[_0x8435('0xc')][_0x8435('0x2f')](_0x1fcf67)[_0x8435('0x11')](function(_0x3ea2a8){_0x34aa4c(null,_0x3ea2a8?_0x3ea2a8:![]);})[_0x8435('0x12')](function(_0x4eddbc){_0x34aa4c(_0x4eddbc);});};AGIVertices['prototype'][_0x8435('0x30')]=function(_0x1ab66b,_0x8d2803){this[_0x8435('0xc')]['createSmsMessage'](_0x1ab66b)['then'](function(_0x4288fd){_0x8d2803(null,_0x4288fd);})[_0x8435('0x12')](function(_0x4c67b8){_0x8d2803(_0x4c67b8);});};AGIVertices[_0x8435('0xe')][_0x8435('0x31')]=function(_0x3fee86,_0x3df48e,_0x1b59ca){this[_0x8435('0xc')][_0x8435('0x31')]({'uniqueid':this[_0x8435('0xb')][_0x8435('0x32')],'node':_0x3fee86['label'],'application':_0x3fee86['agicommand'],'data':_0x3df48e||null,'project_name':this['channel'][_0x8435('0x33')],'callerid':this[_0x8435('0xb')][_0x8435('0x34')]})[_0x8435('0x11')](function(_0x5a9c31){if(_0x1b59ca){_0x1b59ca(null,_0x5a9c31);}})[_0x8435('0x12')](function(_0x7421da){if(_0x1b59ca){_0x1b59ca(_0x7421da);}});};AGIVertices[_0x8435('0xe')][_0x8435('0x35')]=function(_0x38806f,_0xb0b453,_0x5eda47,_0x142a13){this[_0x8435('0xc')][_0x8435('0x35')]({'uniqueid':this[_0x8435('0xb')]['uniqueid'],'callerid':this[_0x8435('0xb')][_0x8435('0x34')],'calleridname':this[_0x8435('0xb')][_0x8435('0x36')],'context':this[_0x8435('0xb')][_0x8435('0x37')],'extension':this[_0x8435('0xb')][_0x8435('0x38')],'priority':this[_0x8435('0xb')]['priority'],'accountcode':this[_0x8435('0xb')][_0x8435('0x39')],'dnid':this[_0x8435('0xb')][_0x8435('0x3a')],'projectName':this[_0x8435('0xb')][_0x8435('0x33')],'saveName':_0xb0b453,'filename':_0x38806f['file']||_0xb0b453,'savePath':_0x5eda47})[_0x8435('0x11')](function(_0x3bc132){_0x142a13(null,_0x3bc132);})['catch'](function(_0x3f152e){_0x142a13(_0x3f152e);});};AGIVertices['prototype'][_0x8435('0x3b')]=function(_0x4e30c6,_0x10fac4,_0x3697ab,_0x12c3dd,_0x9a6667){this[_0x8435('0xc')]['createSquareMessage']({'uniqueid':this[_0x8435('0xb')][_0x8435('0x32')],'body':_0x4e30c6,'direction':_0x10fac4,'providerName':_0x3697ab,'providerResponse':_0x12c3dd})[_0x8435('0x11')](function(_0x11d71a){if(_0x9a6667){_0x9a6667(null,_0x11d71a);}})[_0x8435('0x12')](function(_0x153025){if(_0x9a6667){_0x9a6667(_0x153025);}});};AGIVertices[_0x8435('0xe')][_0x8435('0x3c')]=function(_0x5c0379,_0x10f6e1){this[_0x8435('0xc')][_0x8435('0x3c')]({'firstName':_[_0x8435('0x3d')](_0x5c0379[_0x8435('0x15')])||_[_0x8435('0x3e')](_0x5c0379[_0x8435('0x15')])?'callback_'+Math[_0x8435('0x3f')]():_0x5c0379['name'],'lastName':_['isEmpty'](_0x5c0379[_0x8435('0x40')])||_[_0x8435('0x3e')](_0x5c0379['lastName'])?null:_0x5c0379[_0x8435('0x40')],'phone':_0x5c0379[_0x8435('0x41')],'ListId':_0x5c0379[_0x8435('0x42')],'scheduledat':_0x5c0379[_0x8435('0x43')],'callbackUniqueid':this[_0x8435('0xb')]['uniqueid'],'tags':_0x8435('0x44'),'description':_0x8435('0x45')+_0x5c0379['scheduledAt'][_0x8435('0x46')](),'priority':_0x5c0379[_0x8435('0x47')]})[_0x8435('0x11')](function(_0x168d11){_0x10f6e1(null,_0x168d11);})[_0x8435('0x12')](function(_0x25f25a){_0x10f6e1(_0x25f25a);});};AGIVertices[_0x8435('0xe')]['getPause']=function(_0x972624,_0x2785e8){this[_0x8435('0xc')][_0x8435('0x48')](_0x972624)[_0x8435('0x11')](function(_0x33cdc2){_0x2785e8(null,_0x33cdc2?_0x33cdc2[_0x8435('0x15')]:![]);})['catch'](function(_0x708f96){_0x2785e8(_0x708f96);});};AGIVertices['prototype']['agentPause']=function(_0x8571ce,_0x539764,_0x374446){var _0x3fcef2={'role':'agent'};_0x3fcef2[_0x8571ce]=this['channel'][_0x8435('0x34')];this[_0x8435('0xc')][_0x8435('0x49')](_0x3fcef2,_0x539764,this[_0x8435('0xb')][_0x8435('0x32')])[_0x8435('0x11')](function(_0x4c385c){_0x374446(null,_['isNil'](_0x4c385c)?![]:!![]);})[_0x8435('0x12')](function(_0x5d797b){logger['error'](_0x5d797b);_0x374446(null,![]);});};AGIVertices[_0x8435('0xe')][_0x8435('0x4a')]=function(_0x2e763b,_0x19493d){var _0x50eb49={'role':_0x8435('0x4b')};_0x50eb49[_0x2e763b]=this[_0x8435('0xb')][_0x8435('0x34')];this['rpc'][_0x8435('0x4a')](_0x50eb49)[_0x8435('0x11')](function(_0x47316){_0x19493d(null,_['isNil'](_0x47316)?![]:!![]);})[_0x8435('0x12')](function(_0x51d79c){logger['error'](_0x51d79c);_0x19493d(null,![]);});};AGIVertices[_0x8435('0xe')][_0x8435('0x4c')]=function(_0x56eea1,_0x215421){var _0x237bc1={'role':_0x8435('0x4b')};_0x237bc1[_0x56eea1]=this['channel'][_0x8435('0x34')];this['rpc'][_0x8435('0x4c')](_0x237bc1)[_0x8435('0x11')](function(_0x2ca647){_0x215421(null,_[_0x8435('0x3e')](_0x2ca647)?![]:!![]);})['catch'](function(_0xdc2161){logger[_0x8435('0x2b')](_0xdc2161);_0x215421(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x19fd6e,_0x17cbc8){var _0x5802ce={'role':_0x8435('0x4b')};_0x5802ce[_0x19fd6e]=this[_0x8435('0xb')][_0x8435('0x34')];var _0x4ae0f0=_0x19fd6e!=_0x8435('0x4d')?util['format'](_0x8435('0x4e'),_0x8435('0x4f'),this[_0x8435('0xb')][_0x8435('0x34')]):undefined;this[_0x8435('0xc')][_0x8435('0x50')](_0x5802ce,_0x4ae0f0)['then'](function(_0x3d70bc){_0x17cbc8(null,_['isNil'](_0x3d70bc)?![]:!![]);})[_0x8435('0x12')](function(_0x51dc96){logger['error'](_0x51dc96);_0x17cbc8(null,![]);});};AGIVertices[_0x8435('0xe')][_0x8435('0x51')]=function(_0x531253,_0x1614c6){sh['exec'](_[_0x8435('0x52')](_0x531253),function(_0x48d7bc,_0x328453){var _0x201262=_0x328453[_0x8435('0x53')](/(\r\n|\n|\r)/gm,'');_0x1614c6(null,_0x201262);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x2a32da,_0x404080){scripts[_0x8435('0x54')](_0x2a32da[_0x8435('0x55')],_0x2a32da[_0x8435('0x56')]||'text',_0x2a32da['text'],_0x2a32da[_0x8435('0x57')]||_0x8435('0x58'),_0x2a32da[_0x8435('0x59')]||'MALE',_0x2a32da['audioEncoding']||_0x8435('0x5a'))[_0x8435('0x11')](function(_0x172f37){_0x404080(null,_0x172f37);})[_0x8435('0x12')](function(_0x727599){_0x404080(_0x727599);});};AGIVertices[_0x8435('0xe')][_0x8435('0x5b')]=function(_0x3039e5,_0x339dbb){scripts['googleTTS'](_0x3039e5['text'],_0x3039e5[_0x8435('0x5c')]||'en',0x1)[_0x8435('0x11')](function(_0x5a6e4e){_0x339dbb(null,_0x5a6e4e);})[_0x8435('0x12')](function(_0x10baed){_0x339dbb(_0x10baed);});};AGIVertices[_0x8435('0xe')][_0x8435('0x5d')]=function(_0x2aaded,_0x31917c){var _0x57a191={'uri':_0x2aaded[_0x8435('0x5e')],'method':_0x2aaded['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2aaded[_0x8435('0x5f')])===_0x8435('0x60')&&parseInt(_0x2aaded[_0x8435('0x5f')])>=0x1?parseInt(_0x2aaded['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8435('0x61')]([_0x8435('0x62'),_0x8435('0x63')],_0x57a191['method'][_0x8435('0x64')]())){try{_0x57a191['body']=_0x2aaded['rawBody']?JSON[_0x8435('0x65')](_0x2aaded['rawBody']):{};}catch(_0x243793){logger[_0x8435('0x2b')](_0x8435('0x66'),_0x243793);}}try{_0x57a191[_0x8435('0x67')]=_0x2aaded[_0x8435('0x8')]?JSON[_0x8435('0x65')](_0x2aaded[_0x8435('0x8')]):{};}catch(_0x48c389){logger[_0x8435('0x2b')](_0x8435('0x68'),_0x48c389);}if(_0x2aaded[_0x8435('0x69')]){try{var _0x999468=require(_0x2aaded[_0x8435('0x69')])[_0x8435('0x6a')](this,_0x57a191);_0x57a191[_0x8435('0x6b')]=Mustache[_0x8435('0x6c')](_0x2aaded[_0x8435('0x5e')],_0x999468,{},['$$','$$']);if(_0x57a191[_0x8435('0x67')]){_0x57a191['headers']=JSON[_0x8435('0x65')](Mustache[_0x8435('0x6c')](JSON[_0x8435('0x6d')](_0x57a191['headers']),_0x999468,{},['$$','$$']));}if(_0x57a191['body']){_0x57a191[_0x8435('0x6e')]=JSON[_0x8435('0x65')](Mustache[_0x8435('0x6c')](JSON[_0x8435('0x6d')](_0x57a191['body']),_0x999468,{},['$$','$$']));}}catch(_0xf1e33e){logger[_0x8435('0x2b')](_0x8435('0x6f'),_0xf1e33e);}}rp(_0x57a191)[_0x8435('0x11')](function(_0x4696a7){var _0x51974b={'statusCode':_0x4696a7[_0x8435('0x70')]||0xc8,'statusMessage':_0x4696a7[_0x8435('0x71')]||'OK','headers':_0x4696a7[_0x8435('0x67')]||{},'body':_0x4696a7[_0x8435('0x6e')]||{}};_0x31917c(null,_0x51974b);})[_0x8435('0x12')](function(_0x340d91){var _0x3b6ae6={'statusCode':_0x340d91[_0x8435('0x70')]||0x1f4,'statusMessage':_0x340d91[_0x8435('0x72')]||_0x8435('0x73'),'headers':_0x340d91[_0x8435('0x74')]['headers']||{},'body':_0x340d91[_0x8435('0x74')]['body']||{}};_0x31917c(null,_0x3b6ae6);});};AGIVertices[_0x8435('0xe')][_0x8435('0x75')]=function(_0x25e596,_0x43588e){scripts[_0x8435('0x75')](this[_0x8435('0xb')][_0x8435('0x32')],_0x25e596[_0x8435('0x76')],_0x25e596[_0x8435('0x77')],_0x25e596[_0x8435('0x78')]||'en')[_0x8435('0x11')](function(_0x5d6a74){_0x43588e(null,_0x5d6a74);})[_0x8435('0x12')](function(_0x420c0b){_0x43588e(_0x420c0b);});};AGIVertices[_0x8435('0xe')][_0x8435('0x79')]=function(_0x3de408,_0x4eedec){scripts[_0x8435('0x79')](this[_0x8435('0xb')][_0x8435('0x32')],_0x3de408[_0x8435('0x7a')],_0x3de408[_0x8435('0x7b')],_0x3de408[_0x8435('0x7c')],_0x3de408[_0x8435('0x77')],_0x3de408['dialogflowV2_language']||'en')['then'](function(_0x44f9de){_0x4eedec(null,_0x44f9de);})[_0x8435('0x12')](function(_0x494152){_0x4eedec(_0x494152);});};AGIVertices[_0x8435('0xe')]['sestekNDA']=function(_0x595d93,_0x244ef8){scripts[_0x8435('0x7d')](this[_0x8435('0xb')],_0x595d93)[_0x8435('0x11')](function(_0xff77b4){_0x244ef8(null,_0xff77b4);})[_0x8435('0x12')](function(_0x460bf1){_0x244ef8(_0x460bf1);});};AGIVertices[_0x8435('0xe')]['ispeechTTS']=function(_0xc2756a,_0x3bc23f){scripts['ispeechTTS'](_0xc2756a[_0x8435('0x76')],_0xc2756a[_0x8435('0x77')],_0xc2756a['ispeech_tts_language']||_0x8435('0x58'),_0xc2756a[_0x8435('0x7e')])[_0x8435('0x11')](function(_0x1159d0){_0x3bc23f(null,_0x1159d0);})[_0x8435('0x12')](function(_0x189540){_0x3bc23f(_0x189540);});};AGIVertices[_0x8435('0xe')][_0x8435('0x7f')]=function(_0x593956,_0x3bd4e4,_0x26a428){scripts[_0x8435('0x7f')](_0x3bd4e4,_0x593956['key'],_0x593956[_0x8435('0x80')]||_0x8435('0x58'),this[_0x8435('0x81')](_0x593956['model'])?_0x593956['model']:undefined)[_0x8435('0x11')](function(_0x50366d){_0x26a428(null,_0x50366d);})[_0x8435('0x12')](function(_0x1dffee){_0x26a428(_0x1dffee);});};AGIVertices[_0x8435('0xe')][_0x8435('0x82')]=function(_0x341df5,_0x5bae44){scripts[_0x8435('0x82')](_0x341df5[_0x8435('0x83')],_0x341df5[_0x8435('0x84')],_0x341df5[_0x8435('0x85')],_0x341df5[_0x8435('0x86')]||_0x8435('0x87'),_0x341df5[_0x8435('0x77')],_0x341df5[_0x8435('0x88')]||_0x8435('0x77'))['then'](function(_0x5bf093){_0x5bae44(null,_0x5bf093);})[_0x8435('0x12')](function(_0x21e574){_0x5bae44(_0x21e574);});};AGIVertices[_0x8435('0xe')][_0x8435('0x89')]=function(_0x5b622f,_0x56ef71){scripts[_0x8435('0x89')](this[_0x8435('0xb')][_0x8435('0x32')],_0x5b622f[_0x8435('0x83')],_0x5b622f[_0x8435('0x84')],_0x5b622f[_0x8435('0x8a')],_0x5b622f[_0x8435('0x77')],_0x5b622f[_0x8435('0x8b')])['then'](function(_0x429c10){_0x56ef71(null,_0x429c10);})[_0x8435('0x12')](function(_0x802b2f){_0x56ef71(_0x802b2f);});};AGIVertices[_0x8435('0xe')][_0x8435('0x8c')]=function(_0x48655a,_0x475ecf,_0x2ef16f){scripts[_0x8435('0x8c')](_0x475ecf,_0x48655a[_0x8435('0x76')],_0x48655a[_0x8435('0x8d')]||_0x8435('0x58'))['then'](function(_0x3fc6aa){_0x2ef16f(null,_0x3fc6aa);})[_0x8435('0x12')](function(_0x96f831){_0x2ef16f(_0x96f831);});};AGIVertices[_0x8435('0xe')][_0x8435('0x8e')]=function(_0x1a830f,_0x4d43f2,_0x34672e){scripts[_0x8435('0x8e')](_0x4d43f2,_0x1a830f[_0x8435('0x8f')],_0x1a830f[_0x8435('0x90')],_0x1a830f['uri'])['then'](function(_0xb6ad18){_0x34672e(null,_0xb6ad18);})[_0x8435('0x12')](function(_0x1c8a88){_0x34672e(_0x1c8a88);});};AGIVertices[_0x8435('0xe')][_0x8435('0x91')]=function(_0x9e0030){var _0x1464bc=_[_0x8435('0x61')](verticesWithRetry,_0x9e0030['agicommand'])?_0x9e0030:_['clone'](_0x9e0030);for(var _0x5b2799 in _0x1464bc){if(_0x1464bc[_0x8435('0x92')](_0x5b2799)){if(_0x1464bc[_0x5b2799]&&_[_0x8435('0x93')](_0x1464bc[_0x5b2799])){if(_[_0x8435('0x61')](recursiveMapAttributes,_0x5b2799)){_0x1464bc[_0x5b2799]=this[_0x8435('0x94')](_0x1464bc[_0x5b2799]);}else{_0x1464bc[_0x5b2799]=this['replaceAllVariables'](_0x1464bc[_0x5b2799]);}}}}return _0x1464bc;};AGIVertices[_0x8435('0xe')]['recursiveNodeIndex']=function(_0x2b39c3){for(var _0x29bbaf in _0x2b39c3){if(_0x2b39c3[_0x8435('0x92')](_0x29bbaf)){if(_[_0x8435('0x95')](_0x2b39c3[_0x29bbaf])){this[_0x8435('0x96')](_0x2b39c3[_0x29bbaf]);}else if(_['isArray'](_0x2b39c3[_0x29bbaf])){for(var _0xeb56a3=0x0;_0xeb56a3<_0x2b39c3[_0x29bbaf]['length'];_0xeb56a3++){this[_0x8435('0x96')](_0x2b39c3[_0x29bbaf][_0xeb56a3]);}}else if(_[_0x8435('0x93')](_0x2b39c3[_0x29bbaf])){_0x2b39c3[_0x29bbaf]=this['replaceAllVariables'](_0x2b39c3[_0x29bbaf]);}}}};AGIVertices[_0x8435('0xe')]['saveRestApiResult']=function(_0x396802,_0x494bc7){for(var _0x323b4c in _0x396802){if(_0x396802[_0x8435('0x92')](_0x323b4c)){if(_[_0x8435('0x95')](_0x396802[_0x323b4c])){if(!_[_0x8435('0x3d')](_0x396802[_0x323b4c])){this[_0x8435('0x97')](_0x396802[_0x323b4c],util[_0x8435('0x28')](_0x8435('0x98'),_0x494bc7,_0x323b4c));}}else if(_['isArray'](_0x396802[_0x323b4c])){for(var _0x4f6848=0x0;_0x4f6848<_0x396802[_0x323b4c][_0x8435('0x99')];_0x4f6848++){this['saveRestApiResult'](_0x396802[_0x323b4c][_0x4f6848],util[_0x8435('0x28')](_0x8435('0x98'),_0x494bc7,_0x323b4c+'['+_0x4f6848+']'));}}else{if(!_[_0x8435('0x3e')](_0x396802[_0x323b4c])){this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0x98'),_0x494bc7,_0x323b4c),_0x396802[_0x323b4c]);}}}}};AGIVertices[_0x8435('0xe')][_0x8435('0x94')]=function(_0x3d694d){try{var _0xd08df6=JSON[_0x8435('0x65')](_0x3d694d);this['recursiveNodeIndex'](_0xd08df6);return JSON[_0x8435('0x6d')](_0xd08df6);}catch(_0x408768){return this[_0x8435('0x9b')](_0x3d694d);}};AGIVertices[_0x8435('0xe')][_0x8435('0x9b')]=function(_0x1e087d){var _0x183ecc=_0x1e087d[_0x8435('0x9c')]('{');for(var _0x179783=0x1;_0x179783<_0x183ecc['length'];_0x179783+=0x1){var _0x1848c3=_0x183ecc[_0x179783][_0x8435('0x9c')]('}');if(_0x1848c3[_0x8435('0x99')]>0x1){_0x1e087d=_0x1e087d[_0x8435('0x9d')]('{'+_0x1848c3[0x0]+'}',this['channel'][_0x8435('0xf')](_0x1848c3[0x0])[_0x8435('0x9e')]||_0x1848c3[0x0]);}}if(_0x183ecc[_0x8435('0x99')]===0x1){return _0x1e087d[_0x8435('0x46')]();}return this[_0x8435('0x9b')](_0x1e087d);};AGIVertices[_0x8435('0xe')][_0x8435('0x9f')]=function(_0x5e719b,_0x1eed1f){var _0x2d3238=this[_0x8435('0xb')][_0x8435('0xf')](_0x5e719b);if(_0x2d3238[_0x8435('0xa0')]===-0x1){return _0x2d3238;}logger['info'](util[_0x8435('0x28')](_0x8435('0xa1'),_0x1eed1f,_0x2d3238['extra']));return this['channel'][_0x8435('0x9a')](_0x1eed1f,_0x2d3238[_0x8435('0x9e')]);};AGIVertices['prototype'][_0x8435('0x81')]=function(_0x3ae90b){return _0x3ae90b&&_0x3ae90b!=='0'&&_0x3ae90b!=='-1'&&_0x3ae90b!=='';};AGIVertices[_0x8435('0xe')][_0x8435('0xa2')]=function(_0x3b12d3){this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x3b12d3,'-');_0x3b12d3[_0x8435('0xa3')]=_0x3b12d3[_0x8435('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8435('0xe')][_0x8435('0xa4')]=function(_0x32279){logger['info'](util[_0x8435('0x28')](_0x8435('0xa5'),_0x32279[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x32279[_0x8435('0x77')])){return this['channel'][_0x8435('0xa7')](_0x8435('0xa8'));}var _0x310c6f='\x22'+_0x32279[_0x8435('0x77')]+'\x22';if(this[_0x8435('0x81')](_0x32279[_0x8435('0x74')])){_0x310c6f+=','+_0x32279[_0x8435('0x74')];}var _0x35c3c1=this['channel'][_0x8435('0xa9')](_0x8435('0xaa'),_0x310c6f);if(_0x35c3c1[_0x8435('0xa0')]===-0x1){return _0x35c3c1;}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xab'),_0x310c6f));};AGIVertices['prototype']['mrcprecog']=function(_0x265796){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xac'),_0x265796[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x265796[_0x8435('0xad')])){return this['channel'][_0x8435('0xa7')](_0x8435('0xae'));}var _0x423512=_0x265796[_0x8435('0xad')];if(this['isConfigured'](_0x265796[_0x8435('0x74')])){_0x423512+=','+_0x265796['options'];}var _0x16b066=this['channel']['exec'](_0x8435('0xaf'),_0x423512);if(_0x16b066['result']===-0x1){return _0x16b066;}var _0x5ad2cc=this[_0x8435('0x9f')](_0x8435('0xb0'),_0x8435('0xb1'));if(_0x5ad2cc[_0x8435('0xa0')]===-0x1){return _0x5ad2cc;}var _0x3ca37c=this[_0x8435('0x9f')](_0x8435('0xb2'),_0x8435('0xb3'));if(_0x3ca37c[_0x8435('0xa0')]===-0x1){return _0x3ca37c;}var _0x428cff=this[_0x8435('0x9f')](_0x8435('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x428cff['result']===-0x1){return _0x428cff;}return this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0xb5'),_0x423512));};AGIVertices[_0x8435('0xe')]['agi']=function(_0x2953d2){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xb6'),_0x2953d2[_0x8435('0xa6')]));return this[_0x8435('0xb')][_0x8435('0x5')]([_0x2953d2[_0x8435('0xb7')],_0x2953d2['args']]);};AGIVertices['prototype']['answer']=function(_0x20d870){logger[_0x8435('0x2d')](util['format'](_0x8435('0xb8'),_0x20d870[_0x8435('0xa6')]));if(this[_0x8435('0x81')](_0x20d870[_0x8435('0x5f')])){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xb9'),_0x20d870[_0x8435('0x5f')]));var _0x1025c1=this[_0x8435('0xb')][_0x8435('0xba')](_0x20d870[_0x8435('0x5f')]);if(_0x1025c1['result']===-0x1){return _0x1025c1;}}return this[_0x8435('0xb')][_0x8435('0xbb')]();};AGIVertices[_0x8435('0xe')][_0x8435('0x44')]=function(_0x56d641){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xbc'),_0x56d641[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x56d641['list_id'])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x56d641,_0x8435('0xbd'));}_0x56d641[_0x8435('0x43')]=moment();if(this[_0x8435('0x81')](_0x56d641['delay'])){_0x56d641[_0x8435('0x43')]=moment()[_0x8435('0xbe')](_0x56d641[_0x8435('0xbf')],_0x8435('0xc0'));}if(!this[_0x8435('0x81')](_0x56d641[_0x8435('0x47')])){_0x56d641[_0x8435('0x47')]=0x2;}this[_0x8435('0x3c')][_0x8435('0x6a')](this,_0x56d641);return this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xc1'),_0x56d641[_0x8435('0x41')],_0x56d641[_0x8435('0x42')],_0x56d641['scheduledAt']));};AGIVertices[_0x8435('0xe')][_0x8435('0xc2')]=function(_0x402961){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xc3'),_0x402961[_0x8435('0xa6')]));var _0x2f1c4d=this[_0x8435('0xb')]['exec'](_0x402961[_0x8435('0xc4')],_0x402961[_0x8435('0x74')]);if(_0x2f1c4d[_0x8435('0xa0')]===-0x1){return _0x2f1c4d;}return this['channel']['noop'](util[_0x8435('0x28')](_0x8435('0xc5'),_0x402961[_0x8435('0xc4')],_0x402961[_0x8435('0x74')]));};AGIVertices[_0x8435('0xe')][_0x8435('0xc6')]=function(_0x1d5eb0){logger['info'](util[_0x8435('0x28')](_0x8435('0xc7'),_0x1d5eb0[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x1d5eb0[_0x8435('0x77')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xa8'));}var _0x4bef57='\x22'+_0x1d5eb0[_0x8435('0x77')]+'\x22';if(this['isConfigured'](_0x1d5eb0[_0x8435('0x74')])){_0x4bef57+=','+_0x1d5eb0[_0x8435('0x74')];}var _0x25cf49=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xaa'),_0x4bef57);if(_0x25cf49[_0x8435('0xa0')]===-0x1){return _0x25cf49;}return this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4bef57));};AGIVertices[_0x8435('0xe')][_0x8435('0xc8')]=function(_0x35f9f0){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xc9'),_0x35f9f0['label']));if(!this[_0x8435('0x81')](_0x35f9f0['text'])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xa8'));}var _0x467561='\x22'+_0x35f9f0[_0x8435('0x77')]+'\x22';if(this[_0x8435('0x81')](_0x35f9f0['options'])){_0x467561+=','+_0x35f9f0[_0x8435('0x74')];}var _0x2ce4c8=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xaa'),_0x467561);if(_0x2ce4c8[_0x8435('0xa0')]===-0x1){return _0x2ce4c8;}return this['channel']['noop'](util[_0x8435('0x28')](_0x8435('0xab'),_0x467561));};AGIVertices[_0x8435('0xe')]['lumenvoxasr']=function(_0x2ed34c){logger[_0x8435('0x2d')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2ed34c[_0x8435('0xa6')]));if(!this['isConfigured'](_0x2ed34c[_0x8435('0xad')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xae'));}var _0x3f1e0e=_0x2ed34c[_0x8435('0xad')];if(this[_0x8435('0x81')](_0x2ed34c[_0x8435('0x74')])){_0x3f1e0e+=','+_0x2ed34c[_0x8435('0x74')];}var _0x2e66f3=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xaf'),_0x3f1e0e);if(_0x2e66f3[_0x8435('0xa0')]===-0x1){return _0x2e66f3;}var _0x32073a=this[_0x8435('0x9f')](_0x8435('0xb0'),_0x8435('0xca'));if(_0x32073a[_0x8435('0xa0')]===-0x1){return _0x32073a;}var _0x4475a7=this[_0x8435('0x9f')](_0x8435('0xb2'),_0x8435('0xcb'));if(_0x4475a7[_0x8435('0xa0')]===-0x1){return _0x4475a7;}var _0x271ed9=this[_0x8435('0x9f')](_0x8435('0xb4'),'LUMENVOX_ASR_INSTANCE');if(_0x271ed9[_0x8435('0xa0')]===-0x1){return _0x271ed9;}return this['channel']['noop'](util[_0x8435('0x28')](_0x8435('0xb5'),_0x3f1e0e));};AGIVertices['prototype'][_0x8435('0xcc')]=function(_0x220122){logger[_0x8435('0x2d')](util['format'](_0x8435('0xcd'),_0x220122[_0x8435('0xa6')]));if(!this['isConfigured'](_0x220122['grammar'])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xae'));}var _0x2d1109=_0x220122[_0x8435('0xad')];if(this[_0x8435('0x81')](_0x220122[_0x8435('0x74')])){_0x2d1109+=','+_0x220122['options'];}var _0xbb121a=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xaf'),_0x2d1109);if(_0xbb121a[_0x8435('0xa0')]===-0x1){return _0xbb121a;}var _0x22e3a6=this[_0x8435('0x9f')](_0x8435('0xb0'),_0x8435('0xce'));if(_0x22e3a6[_0x8435('0xa0')]===-0x1){return _0x22e3a6;}var _0x5dc3f2=this[_0x8435('0x9f')](_0x8435('0xb2'),_0x8435('0xcf'));if(_0x5dc3f2['result']===-0x1){return _0x5dc3f2;}var _0x962e9=this[_0x8435('0x9f')](_0x8435('0xb4'),_0x8435('0xd0'));if(_0x962e9[_0x8435('0xa0')]===-0x1){return _0x962e9;}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xb5'),_0x2d1109));};AGIVertices[_0x8435('0xe')]['database']=function(_0x2cd806){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xd1'),_0x2cd806['label']));if(!this[_0x8435('0x81')](_0x2cd806[_0x8435('0xd2')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2cd806,'no\x20database\x20selected');}var _0x5ac46b=this['getSquareOdbc']['sync'](this,_0x2cd806[_0x8435('0xd2')]);if(!_0x5ac46b){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2cd806,_0x8435('0xd3'));}if(!this[_0x8435('0x81')](_0x2cd806[_0x8435('0xd4')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2cd806,'no\x20query\x20configured');}var _0x1ac55e=_0x2cd806[_0x8435('0xd4')][_0x8435('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')]('query:\x20%s',_0x1ac55e));var _0x15b53e=this[_0x8435('0xd5')][_0x8435('0x6a')](this,_0x5ac46b,_0x1ac55e);this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x2cd806,_0x1ac55e);if(!this[_0x8435('0x81')](_0x2cd806[_0x8435('0xd6')])){return this['channel'][_0x8435('0xa7')](_0x8435('0xd7'));}var _0x1ce7fb=this['getVariable'][_0x8435('0x6a')](this,_0x2cd806[_0x8435('0xd6')]);if(!_0x1ce7fb){return this['channel'][_0x8435('0x2b')](_0x2cd806,_0x8435('0xd8'));}var _0x4a490c=this;_0x15b53e['forEach'](function(_0x31b14a,_0x289c3e){Object[_0x8435('0xd9')](_0x31b14a)[_0x8435('0xda')](function(_0xf92d11){_0x4a490c[_0x8435('0xb')]['setVariable'](util[_0x8435('0x28')](_0x8435('0xdb'),_0x1ce7fb,_0x289c3e,_0xf92d11),_0x31b14a[_0xf92d11]);});});this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')]('%s_ROWS_COUNT',_0x1ce7fb),_0x15b53e[_0x8435('0x99')]);return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xdc'),_0x1ce7fb));};AGIVertices['prototype'][_0x8435('0xdd')]=function(_0x450baf){logger[_0x8435('0xde')](util['format'](_0x8435('0xdf'),_0x450baf[_0x8435('0xa6')]));if(!this['isConfigured'](_0x450baf[_0x8435('0xe0')])){return this[_0x8435('0xb')]['error'](_0x450baf,_0x8435('0xe1'));}var _0x5ef2bc=this['getUser'][_0x8435('0x6a')](this,_0x450baf['sip_id']);if(!_0x5ef2bc){return this[_0x8435('0xb')]['error'](_0x450baf,'no\x20user\x20found');}var _0x55b3e0=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xe2'),[util[_0x8435('0x28')](_0x8435('0xe3'),_0x5ef2bc),_0x450baf[_0x8435('0x5f')],_0x450baf['opts'],_0x450baf[_0x8435('0x5e')]]);if(_0x55b3e0[_0x8435('0xa0')]===-0x1){return _0x55b3e0;}return this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xe4'),'DIAL'));};AGIVertices['prototype'][_0x8435('0xe5')]=function(_0x42e092){logger['info'](util[_0x8435('0x28')](_0x8435('0xe6'),_0x42e092[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x42e092['key'])){return this['channel'][_0x8435('0xa7')](_0x8435('0xe7'));}if(!this[_0x8435('0x81')](_0x42e092[_0x8435('0x77')])){return this['channel'][_0x8435('0xa7')]('no\x20text\x20configured');}this[_0x8435('0xb')][_0x8435('0xe8')]=!![];this['createSquareDetailsReport'](_0x42e092);this['createSquareMessage'](_0x42e092['text'],'in','','');this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xe9'),_0x42e092[_0x8435('0x77')]));var _0x1817c5=this[_0x8435('0x75')][_0x8435('0x6a')](this,_0x42e092);if(_0x1817c5){for(var _0x173735 in _0x1817c5){if(_0x1817c5['hasOwnProperty'](_0x173735)){this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0xea'),_0x173735['toUpperCase']()),_0x1817c5[_0x173735]);}}this['createSquareMessage'](_0x1817c5[_0x8435('0xeb')],'out','dialogflow','');return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xec'),_0x1817c5[_0x8435('0xeb')]));}return this['channel']['error'](_0x42e092,_0x8435('0xed'));};AGIVertices[_0x8435('0xe')][_0x8435('0xee')]=function(_0x7b5172){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xef'),_0x7b5172['label']));if(!this[_0x8435('0x81')](_0x7b5172['dialogflowV2_project_id'])){return this['channel'][_0x8435('0xa7')](_0x8435('0xf0'));}if(!this[_0x8435('0x81')](_0x7b5172[_0x8435('0x7b')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xf1'));}if(!this[_0x8435('0x81')](_0x7b5172['private_key'])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xf2'));}if(!this[_0x8435('0x81')](_0x7b5172[_0x8435('0xf3')])){return this[_0x8435('0xb')]['noop'](_0x8435('0xf4'));}if(!this['isConfigured'](_0x7b5172[_0x8435('0x77')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xa8'));}this[_0x8435('0xb')][_0x8435('0xe8')]=!![];this[_0x8435('0x31')](_0x7b5172);this[_0x8435('0x3b')](_0x7b5172[_0x8435('0x77')],'in','','');this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0xf5'),_0x7b5172[_0x8435('0x77')]));var _0x517877=this[_0x8435('0x79')][_0x8435('0x6a')](this,_0x7b5172);if(_0x517877){for(var _0x1e4d29 in _0x517877){if(_0x517877['hasOwnProperty'](_0x1e4d29)){if(_0x1e4d29!==_0x8435('0xf6')){this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0xea'),_0x1e4d29[_0x8435('0x64')]()),_0x517877[_0x1e4d29]);}}}this[_0x8435('0x3b')](_0x517877[_0x8435('0xeb')],'out',_0x8435('0xee'),_0x517877[_0x8435('0xf6')]);return this[_0x8435('0xb')][_0x8435('0xa7')](util['format']('DialogflowV2\x20Result\x20%s',_0x517877[_0x8435('0xeb')]));}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x7b5172,_0x8435('0xf7'));};AGIVertices[_0x8435('0xe')][_0x8435('0xf8')]=function(_0x108e19){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0xf9'),_0x108e19[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x108e19['ndauth_url'])){return this[_0x8435('0xb')]['noop'](_0x8435('0xfa'));}if(!this[_0x8435('0x81')](_0x108e19[_0x8435('0xfb')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xfc'));}if(!this[_0x8435('0x81')](_0x108e19['password'])){return this[_0x8435('0xb')][_0x8435('0xa7')]('no\x20password\x20configured');}if(!this[_0x8435('0x81')](_0x108e19[_0x8435('0xfd')])){return this[_0x8435('0xb')]['noop']('no\x20text\x20configured');}this[_0x8435('0xb')][_0x8435('0xe8')]=!![];this[_0x8435('0x31')](_0x108e19);this[_0x8435('0x3b')](_0x108e19[_0x8435('0x77')],'in','','');this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0xfe'),_0x108e19['text']));var _0x93a9df=this[_0x8435('0x7d')][_0x8435('0x6a')](this,_0x108e19);if(_0x93a9df){for(var _0x20f71b in _0x93a9df){if(_0x93a9df[_0x8435('0x92')](_0x20f71b)){this['channel']['setVariable'](util[_0x8435('0x28')](_0x8435('0xff'),_0x20f71b[_0x8435('0x64')]()),_0x93a9df[_0x20f71b]);}}this[_0x8435('0x3b')](_0x93a9df[_0x8435('0xeb')],_0x8435('0x100'),_0x8435('0xf8'),'');if(_0x93a9df[_0x8435('0x101')]){this[_0x8435('0xb')][_0x8435('0xa7')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x93a9df[_0x8435('0x101')]));var _0x3fe9a4=this['channel'][_0x8435('0x102')](_0x93a9df[_0x8435('0x101')]);try{fs['unlink'](_0x93a9df[_0x8435('0x101')]+_0x8435('0x103'));}catch(_0x5357d4){logger[_0x8435('0x2b')](_0x5357d4);}return _0x3fe9a4;}else{return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x104'),_0x93a9df[_0x8435('0xeb')]));}}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x108e19,_0x8435('0x105'));};AGIVertices['prototype'][_0x8435('0x106')]=function(_0x17c84d){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20END\x20(%s)\x20block',_0x17c84d[_0x8435('0xa6')]));return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x106'));};AGIVertices[_0x8435('0xe')][_0x8435('0x107')]=function(_0x2d94ba){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x108'),_0x2d94ba[_0x8435('0xa6')]));var _0x52a07f='';if(_0x2d94ba[_0x8435('0x109')]){if(!this[_0x8435('0x81')](_0x2d94ba[_0x8435('0x109')])){return this[_0x8435('0xb')]['error'](_0x2d94ba,'no\x20trunk\x20selected');}else{var _0x2336a0=parseInt(_0x2d94ba['trunk_id'],0xa);if(isNaN(_0x2336a0)){_0x52a07f=_0x2d94ba[_0x8435('0x109')];}else{_0x52a07f=this['getTrunk'][_0x8435('0x6a')](this,_0x2d94ba[_0x8435('0x109')]);if(!_0x52a07f){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2d94ba,'no\x20trunk\x20found');}}}}else if(_0x2d94ba[_0x8435('0x10a')]){_0x52a07f=_0x2d94ba[_0x8435('0x10a')];}else{return this['channel'][_0x8435('0x2b')](_0x2d94ba,_0x8435('0x10b'));}var _0x4405d1=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0xe2'),[util[_0x8435('0x28')](_0x8435('0x10c'),_0x52a07f,_0x2d94ba[_0x8435('0x41')]),_0x2d94ba[_0x8435('0x5f')],_0x2d94ba[_0x8435('0x10d')],_0x2d94ba[_0x8435('0x5e')]]);if(_0x4405d1[_0x8435('0xa0')]===-0x1){return _0x4405d1;}return this[_0x8435('0xb')][_0x8435('0xa7')](util['format']('Executed\x20command\x20%s',_0x8435('0xe2')));};AGIVertices[_0x8435('0xe')][_0x8435('0x10e')]=function(_0x18c6c4){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x10f'),_0x18c6c4[_0x8435('0xa6')]));return this[_0x8435('0xb')][_0x8435('0xa7')]('finally');};AGIVertices[_0x8435('0xe')][_0x8435('0x110')]=function(_0x5f532c){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x111'),_0x5f532c[_0x8435('0xa6')]));if(_0x5f532c[_0x8435('0xa3')]===0x0){return this[_0x8435('0xa2')](_0x5f532c);}_0x5f532c[_0x8435('0xa3')]-=0x1;if(!this[_0x8435('0x81')](_0x5f532c[_0x8435('0x112')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x5f532c,_0x8435('0x113'));}var _0x347d90=this['getSound']['sync'](this,_0x5f532c[_0x8435('0x112')]);if(!_0x347d90){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x5f532c,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x5f532c[_0x8435('0xd6')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x8435('0xd7'));}var _0x23aab4=this[_0x8435('0xb')][_0x8435('0x114')](_0x347d90,_0x5f532c[_0x8435('0x115')],_0x5f532c[_0x8435('0x116')]);var _0x58cce9=_0x23aab4[_0x8435('0xa0')]?_0x23aab4[_0x8435('0xa0')][_0x8435('0x46')]():'';logger[_0x8435('0x2d')](_0x8435('0x117'),JSON[_0x8435('0x6d')](_0x23aab4));if(_0x23aab4[_0x8435('0xa0')]===-0x1){this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x5f532c,_0x58cce9);return _0x23aab4;}else if(_0x23aab4[_0x8435('0x9e')]===_0x8435('0x5f')){_0x23aab4[_0x8435('0xa0')]=_0x58cce9[_0x8435('0x99')]>=parseInt(_0x5f532c['mindigit'])?'x':'i';}else{_0x23aab4[_0x8435('0xa0')]=_0x58cce9[_0x8435('0x99')]>=parseInt(_0x5f532c[_0x8435('0x118')])&&_0x58cce9[_0x8435('0x99')]<=parseInt(_0x5f532c[_0x8435('0x116')])?'x':'i';}var _0x1149f9=this[_0x8435('0xf')]['sync'](this,_0x5f532c[_0x8435('0xd6')]);if(!_0x1149f9){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x5f532c,'no\x20variable\x20found');}this['channel'][_0x8435('0x9a')](_0x1149f9,_0x58cce9);if(this['isConfigured'](_0x5f532c[_0x8435('0x119')])){var _0x5917d8=parseInt(_0x5f532c[_0x8435('0x119')],0xa);var _0x4210c3=rs['generate']({'charset':'*','length':_0x5917d8});var _0x460f5e=_0x58cce9[_0x8435('0x99')];if(_0x460f5e>0x0){if(_0x460f5e>_0x5917d8){this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x5f532c,_0x5f532c[_0x8435('0x11a')]==='first'?_0x4210c3+_0x58cce9[_0x8435('0x11b')](_0x5917d8):_0x58cce9[_0x8435('0x11b')](0x0,_0x460f5e-_0x5917d8)+_0x4210c3);}else{this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x5f532c,rs[_0x8435('0x11c')]({'charset':'*','length':_0x460f5e}));}}else{this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x5f532c,'');}}else{this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x5f532c,_0x58cce9);}return _0x23aab4;};AGIVertices[_0x8435('0xe')][_0x8435('0xa')]=function(_0x40fbd3){logger[_0x8435('0x2d')](util['format'](_0x8435('0x11d'),_0x40fbd3[_0x8435('0xa6')]));return this[_0x8435('0x110')](_0x40fbd3);};AGIVertices[_0x8435('0xe')][_0x8435('0x11e')]=function(_0x20729e){logger['info'](util['format'](_0x8435('0x11f'),_0x20729e[_0x8435('0xa6')]));this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x20729e,_0x20729e[_0x8435('0x120')]);return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x121'),_0x20729e[_0x8435('0x120')]));};AGIVertices[_0x8435('0xe')][_0x8435('0x122')]=function(_0x315638){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x123'),_0x315638[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x315638[_0x8435('0x83')])||!this[_0x8435('0x81')](_0x315638[_0x8435('0x84')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x124'));}if(!this[_0x8435('0x81')](_0x315638[_0x8435('0x77')])){return this['channel'][_0x8435('0xa7')](_0x8435('0xa8'));}this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0x125'),_0x315638[_0x8435('0x77')]));var _0x3729a5=this[_0x8435('0x82')][_0x8435('0x6a')](this,_0x315638);if(_0x3729a5){this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0x126'),_0x3729a5));var _0x323a45=this['channel']['streamFile'](_0x3729a5);try{fs[_0x8435('0x127')](_0x3729a5+_0x8435('0x103'));}catch(_0x399763){logger[_0x8435('0x2b')](_0x399763);}return _0x323a45;}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x315638,_0x8435('0x128'));};AGIVertices[_0x8435('0xe')][_0x8435('0x129')]=function(_0x5ecd5a){logger['info'](util[_0x8435('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5ecd5a[_0x8435('0xa6')]));if(!this['isConfigured'](_0x5ecd5a[_0x8435('0x83')])||!this[_0x8435('0x81')](_0x5ecd5a[_0x8435('0x84')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x124'));}if(!this['isConfigured'](_0x5ecd5a[_0x8435('0x8b')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x12a'));}if(!this[_0x8435('0x81')](_0x5ecd5a[_0x8435('0x77')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xa8'));}this[_0x8435('0xb')]['bot']=!![];this['createSquareDetailsReport'](_0x5ecd5a);this['createSquareMessage'](_0x5ecd5a[_0x8435('0x77')],'in','','');this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x12b'),_0x5ecd5a['text']));var _0x7639bb=this[_0x8435('0x89')]['sync'](this,_0x5ecd5a);if(_0x7639bb){for(var _0xa05cd in _0x7639bb){if(_0x7639bb[_0x8435('0x92')](_0xa05cd)&&_['isString'](_0x7639bb[_0xa05cd])){this['channel']['setVariable'](util[_0x8435('0x28')](_0x8435('0x12c'),_0xa05cd['toUpperCase']()),_0x7639bb[_0xa05cd]);}}if(_['isNil'](_0x7639bb['message'])){return this['channel'][_0x8435('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x7639bb['message'],_0x8435('0x100'),_0x8435('0x12d'),'');return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x12e'),_0x7639bb[_0x8435('0x72')]));}}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x5ecd5a,_0x8435('0x12f'));};AGIVertices['prototype']['googleasr']=function(_0x52378d){logger['info'](util[_0x8435('0x28')](_0x8435('0x130'),_0x52378d[_0x8435('0xa6')],_0x52378d[_0x8435('0x5f')]));if(!this[_0x8435('0x81')](_0x52378d[_0x8435('0x76')])){return this[_0x8435('0xb')]['noop'](_0x8435('0xe7'));}var _0x11845b=_0x8435('0x131');var _0x4a3652=util[_0x8435('0x28')](_0x8435('0x132'),FILES_PATH,rs[_0x8435('0x11c')](0x4));var _0x268fe7=util[_0x8435('0x28')](_0x8435('0x98'),_0x4a3652,_0x11845b);var _0x2b1d83=!![];if(_0x52378d['beep']===_0x8435('0x133')){_0x2b1d83=![];}var _0x5c34f8=this[_0x8435('0xb')][_0x8435('0x134')](_0x4a3652,_0x11845b,_0x52378d[_0x8435('0x135')],_0x52378d[_0x8435('0x5f')],undefined,_0x2b1d83);if(_0x5c34f8[_0x8435('0xa0')]!==-0x1){this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0x136'),_0x268fe7));var _0x27dfd4=this[_0x8435('0x8c')][_0x8435('0x6a')](this,_0x52378d,_0x268fe7);if(_0x27dfd4){for(var _0x423409 in _0x27dfd4){if(_0x27dfd4[_0x8435('0x92')](_0x423409)){this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0x137'),_0x423409[_0x8435('0x64')]()),_0x27dfd4[_0x423409]);}}return this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x138'),JSON[_0x8435('0x6d')](_0x27dfd4)));}}return _0x5c34f8;};AGIVertices[_0x8435('0xe')][_0x8435('0x139')]=function(_0x4b6f39){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4b6f39[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x4b6f39[_0x8435('0x8f')])){return this[_0x8435('0xb')][_0x8435('0xa7')]('no\x20appid\x20configured');}if(!this[_0x8435('0x81')](_0x4b6f39['appsecret'])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x210758=_0x8435('0x131');var _0x56a97d=util[_0x8435('0x28')](_0x8435('0x132'),FILES_PATH,rs[_0x8435('0x11c')](0x4));var _0x2866e0=util[_0x8435('0x28')](_0x8435('0x98'),_0x56a97d,_0x210758);var _0xfe9a34=!![];if(_0x4b6f39[_0x8435('0x13a')]===_0x8435('0x133')){_0xfe9a34=![];}var _0x3f9101=this[_0x8435('0xb')][_0x8435('0x134')](_0x56a97d,_0x210758,_0x4b6f39[_0x8435('0x135')],_0x4b6f39[_0x8435('0x5f')],undefined,_0xfe9a34);if(_0x3f9101['result']!==-0x1){this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x13b'),_0x2866e0));var _0x4a8434=this[_0x8435('0x8e')][_0x8435('0x6a')](this,_0x4b6f39,_0x2866e0);if(_0x4a8434){for(var _0xbeac54 in _0x4a8434){if(_0x4a8434['hasOwnProperty'](_0xbeac54)){this[_0x8435('0xb')]['setVariable'](util[_0x8435('0x28')](_0x8435('0x13c'),_0xbeac54[_0x8435('0x64')]()),_0x4a8434[_0xbeac54]);}}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x13d'),JSON[_0x8435('0x6d')](_0x4a8434)));}}return _0x3f9101;};AGIVertices[_0x8435('0xe')]['gotoc']=function(_0x52dc5f){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x13e'),_0x52dc5f[_0x8435('0xa6')]));return this[_0x8435('0xb')][_0x8435('0x13f')](_0x52dc5f[_0x8435('0x37')],_0x52dc5f[_0x8435('0x38')],_0x52dc5f[_0x8435('0x140')]);};AGIVertices[_0x8435('0xe')][_0x8435('0x141')]=function(_0x1afafb){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x142'),_0x1afafb[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x1afafb['condition'])){return this[_0x8435('0xb')]['error'](_0x1afafb,_0x8435('0x143'));}try{var _0x3bb516=eval(_0x1afafb[_0x8435('0x144')])?'true':'false';this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x145'),_0x1afafb[_0x8435('0x144')],_0x3bb516));return{'code':0xc8,'result':_0x3bb516};}catch(_0x837bd8){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x8435('0x146')]=function(_0x29a80){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x147'),_0x29a80['label']));if(!this['isConfigured'](_0x29a80[_0x8435('0x148')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x29a80,_0x8435('0x149'));}var _0x46e938=this['getIntervals']['sync'](this,_0x29a80[_0x8435('0x148')]);if(!_0x46e938){return this['channel'][_0x8435('0x2b')](_0x29a80,'no\x20intervals\x20found');}for(var _0x36fbdd=0x0;_0x36fbdd<_0x46e938[_0x8435('0x99')];_0x36fbdd+=0x1){var _0x45ed5c=this[_0x8435('0xb')]['getVariable'](util[_0x8435('0x28')]('IFTIME(%s?true:false)',_0x46e938[_0x36fbdd]));if(_0x45ed5c[_0x8435('0xa0')]===-0x1){return _0x45ed5c;}logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x14a'),_0x46e938[_0x36fbdd],_0x45ed5c[_0x8435('0x9e')]));if(_0x45ed5c[_0x8435('0x9e')]===_0x8435('0x14b')){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x14a'),_0x46e938[_0x36fbdd],_0x8435('0x14b')));this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x14a'),_0x46e938[_0x36fbdd],_0x8435('0x14b')));return{'code':0xc8,'result':_0x8435('0x14b')};}else{logger['info'](util[_0x8435('0x28')]('IFTIME\x20%s\x20%s',_0x46e938[_0x36fbdd],'false'));this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0x14a'),_0x46e938[_0x36fbdd],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8435('0xe')][_0x8435('0x14c')]=function(_0x34af62){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x14d'),_0x34af62[_0x8435('0xa6')]));return this[_0x8435('0xb')][_0x8435('0x14c')]();};AGIVertices[_0x8435('0xe')][_0x8435('0x14e')]=function(_0x247351){logger['info'](util[_0x8435('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x247351[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x247351[_0x8435('0x76')])){return this['channel'][_0x8435('0xa7')]('no\x20key\x20configured');}var _0x4c1adc=_0x8435('0x131');var _0x46734c=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x8435('0x11c')](0x4));var _0x59d8f8=util[_0x8435('0x28')](_0x8435('0x98'),_0x46734c,_0x4c1adc);var _0x3b3d40=!![];if(_0x247351[_0x8435('0x13a')]===_0x8435('0x133')){_0x3b3d40=![];}var _0x53dd74=this[_0x8435('0xb')][_0x8435('0x134')](_0x46734c,_0x4c1adc,_0x247351[_0x8435('0x135')],_0x247351['timeout'],undefined,_0x3b3d40);if(_0x53dd74[_0x8435('0xa0')]!==-0x1){this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0x14f'),_0x59d8f8));var _0x2a8f6d=this[_0x8435('0x7f')][_0x8435('0x6a')](this,_0x247351,_0x59d8f8);if(_0x2a8f6d){for(var _0x157d36 in _0x2a8f6d){if(_0x2a8f6d['hasOwnProperty'](_0x157d36)){this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')]('ISPEECH_ASR_%s',_0x157d36[_0x8435('0x64')]()),_0x2a8f6d[_0x157d36]);}}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x8435('0x6d')](_0x2a8f6d)));}}return _0x53dd74;};AGIVertices[_0x8435('0xe')][_0x8435('0x150')]=function(_0x4b1f5c){logger[_0x8435('0x2d')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4b1f5c[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x4b1f5c['key'])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xe7'));}if(!this[_0x8435('0x81')](_0x4b1f5c[_0x8435('0x77')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xa8'));}this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x151'),_0x4b1f5c[_0x8435('0x77')]));var _0x4cef80=this[_0x8435('0x152')][_0x8435('0x6a')](this,_0x4b1f5c);if(_0x4cef80){this['channel'][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x14f'),_0x4cef80));var _0x3e0181=this[_0x8435('0xb')][_0x8435('0x102')](_0x4cef80,_0x4b1f5c['intKey']);try{fs['unlink'](_0x4cef80+_0x8435('0x103'));}catch(_0x413a28){logger[_0x8435('0x2b')](_0x413a28);}return _0x3e0181;}return this['channel']['error'](_0x4b1f5c,_0x8435('0x153'));};AGIVertices['prototype'][_0x8435('0x154')]=function(_0x183fce){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x155'),_0x183fce[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x183fce[_0x8435('0x156')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x183fce,_0x8435('0x157'));}logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x158'),this[_0x8435('0xb')]['callerid'],_0x183fce[_0x8435('0x156')]));var _0x4a092b=this[_0x8435('0x50')][_0x8435('0x6a')](this,_0x183fce[_0x8435('0x156')]);if(_0x4a092b){logger['info'](util[_0x8435('0x28')](_0x8435('0x159'),this[_0x8435('0xb')][_0x8435('0x34')],_0x183fce[_0x8435('0x156')]));this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x159'),this[_0x8435('0xb')]['callerid'],_0x183fce[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15a')};}else{logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')]['callerid'],_0x183fce[_0x8435('0x156')]));this['channel']['noop'](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')][_0x8435('0x34')],_0x183fce['findBy']));return{'code':0xc8,'result':_0x8435('0x15c')};}};AGIVertices[_0x8435('0xe')][_0x8435('0x15d')]=function(_0x54adc7){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x54adc7['label']));if(!this['isConfigured'](_0x54adc7['findBy'])){return this['channel'][_0x8435('0x2b')](_0x54adc7,_0x8435('0x157'));}logger[_0x8435('0x2d')](util['format'](_0x8435('0x158'),this['channel'][_0x8435('0x34')],_0x54adc7[_0x8435('0x156')]));var _0x546de8=this[_0x8435('0x4c')][_0x8435('0x6a')](this,_0x54adc7[_0x8435('0x156')]);if(_0x546de8){logger['info'](util[_0x8435('0x28')](_0x8435('0x159'),this[_0x8435('0xb')][_0x8435('0x34')],_0x54adc7[_0x8435('0x156')]));this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0x159'),this[_0x8435('0xb')][_0x8435('0x34')],_0x54adc7[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15a')};}else{logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')][_0x8435('0x34')],_0x54adc7['findBy']));this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')][_0x8435('0x34')],_0x54adc7[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15c')};}};AGIVertices[_0x8435('0xe')][_0x8435('0x15e')]=function(_0x20115b){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x20115b['label']));if(!this['isConfigured'](_0x20115b[_0x8435('0x15f')])){return this['channel'][_0x8435('0x2b')](_0x20115b,_0x8435('0x160'));}this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0x161'),_0x20115b[_0x8435('0x15f')]));var _0x52a021=eval(_0x20115b[_0x8435('0x15f')]);if(!this[_0x8435('0x81')](_0x20115b[_0x8435('0xd6')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xd7'));}var _0x1f5281=this[_0x8435('0xf')][_0x8435('0x6a')](this,_0x20115b['variable_id']);if(!_0x1f5281){return this[_0x8435('0xb')]['error'](_0x20115b,_0x8435('0xd8'));}if(_[_0x8435('0x162')](_0x52a021)){var _0x350360=this;_0x52a021[_0x8435('0xda')](function(_0x29d852,_0x539022){_0x350360['channel'][_0x8435('0x9a')](util['format'](_0x8435('0x163'),_0x1f5281,_0x539022),_0x29d852);});return this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0x164'),_0x1f5281));}else{return this[_0x8435('0xb')][_0x8435('0x9a')](_0x1f5281,_0x52a021);}};AGIVertices['prototype']['menu']=function(_0x527fad){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x527fad[_0x8435('0xa6')]));if(_0x527fad[_0x8435('0xa3')]===0x0){return this[_0x8435('0xa2')](_0x527fad);}_0x527fad['retry']-=0x1;if(!this[_0x8435('0x81')](_0x527fad[_0x8435('0x112')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x527fad,_0x8435('0x113'));}var _0xbb4749=this['getSound'][_0x8435('0x6a')](this,_0x527fad['file_id']);if(!_0xbb4749){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x527fad,_0x8435('0x165'));}var _0x2b34dc=this[_0x8435('0xb')][_0x8435('0x114')](_0xbb4749,_0x527fad['response'],_0x527fad[_0x8435('0x166')]);var _0x3db995=_0x2b34dc[_0x8435('0xa0')];if(_0x2b34dc['result']===-0x1){this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x527fad,'-1');return _0x2b34dc;}else if(_0x2b34dc[_0x8435('0x9e')]===_0x8435('0x5f')){_0x2b34dc['result']=_0x2b34dc['result'][_0x8435('0x99')]>0x0?_0x2b34dc['result']:'t';}else if(_[_0x8435('0x3d')](_0x2b34dc[_0x8435('0xa0')])){_0x2b34dc[_0x8435('0xa0')]='#';_0x3db995='#';}if(!this[_0x8435('0x81')](_0x527fad['variable_id'])){this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0xd7'));}else{var _0x4b0720=this[_0x8435('0xf')][_0x8435('0x6a')](this,_0x527fad[_0x8435('0xd6')]);if(!_0x4b0720){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x527fad,_0x8435('0xd8'));}this[_0x8435('0xb')]['setVariable'](_0x4b0720,_0x3db995);}this[_0x8435('0x31')]['sync'](this,_0x527fad,_0x3db995);return _0x2b34dc;};AGIVertices[_0x8435('0xe')][_0x8435('0xa7')]=function(_0x415030){logger[_0x8435('0x2d')](util['format'](_0x8435('0x167'),_0x415030[_0x8435('0xa6')]));return this['channel'][_0x8435('0xa7')](_0x415030['output']||_0x415030[_0x8435('0xa6')]);};AGIVertices[_0x8435('0xe')][_0x8435('0x168')]=function(_0x5ecc29){logger[_0x8435('0x2d')](util['format'](_0x8435('0x169'),_0x5ecc29[_0x8435('0xa6')]));if(!this['isConfigured'](_0x5ecc29[_0x8435('0x156')])){return this[_0x8435('0xb')]['error'](_0x5ecc29,_0x8435('0x157'));}logger[_0x8435('0x2d')](util['format'](_0x8435('0x158'),this['channel'][_0x8435('0x34')],_0x5ecc29[_0x8435('0x156')]));var _0x1da168=this[_0x8435('0x16a')][_0x8435('0x6a')](this,_0x5ecc29['pause_id']);var _0x5b7c13=this[_0x8435('0x49')][_0x8435('0x6a')](this,_0x5ecc29[_0x8435('0x156')],_0x1da168);if(_0x5b7c13){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x159'),this[_0x8435('0xb')]['callerid'],_0x5ecc29[_0x8435('0x156')]));this['channel']['noop'](util[_0x8435('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8435('0x34')],_0x5ecc29[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15a')};}else{logger[_0x8435('0x2d')](util[_0x8435('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8435('0x34')],_0x5ecc29[_0x8435('0x156')]));this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x159'),this['channel'][_0x8435('0x34')],_0x5ecc29[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15c')};}};AGIVertices[_0x8435('0xe')][_0x8435('0x16b')]=function(_0x3b6f2e){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x16c'),_0x3b6f2e[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x3b6f2e[_0x8435('0x112')])){return this[_0x8435('0xb')]['error'](_0x3b6f2e,_0x8435('0x113'));}var _0x183e67=this[_0x8435('0x1c')][_0x8435('0x6a')](this,_0x3b6f2e[_0x8435('0x112')]);if(!_0x183e67){return this['channel']['error'](_0x3b6f2e,_0x8435('0x165'));}var _0x48c0df=this[_0x8435('0xb')][_0x8435('0xa9')](_0x8435('0x16d'),[_0x183e67,_0x3b6f2e[_0x8435('0x10d')]]);if(_0x48c0df[_0x8435('0xa0')]===-0x1){return _0x48c0df;}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')]('Executed\x20command\x20%s\x20%s',_0x8435('0x16d'),_0x183e67));};AGIVertices['prototype'][_0x8435('0x16e')]=function(_0x2bdc4a){logger['info'](util[_0x8435('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2bdc4a[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x2bdc4a['queue_id'])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2bdc4a,'no\x20queue\x20selected');}var _0x2984ba='';var _0x4d798d=parseInt(_0x2bdc4a[_0x8435('0x16f')],0xa);if(isNaN(_0x4d798d)){_0x2984ba=_0x2bdc4a['queue_id'];}else{_0x2984ba=this[_0x8435('0x170')][_0x8435('0x6a')](this,_0x2bdc4a[_0x8435('0x16f')]);if(!_0x2984ba){return this['channel'][_0x8435('0x2b')](_0x2bdc4a,_0x8435('0x171'));}}var _0x4c73a8='';if(this[_0x8435('0x81')](_0x2bdc4a['file_id'])){var _0x2b8196=this['getSound']['sync'](this,_0x2bdc4a[_0x8435('0x112')]);if(_0x2b8196){_0x4c73a8=_0x2b8196;}}this['createSquareDetailsReport'][_0x8435('0x6a')](this,_0x2bdc4a,_0x2984ba);if(_0x2bdc4a[_0x8435('0x10d')][_0x8435('0x172')]('x')<0x0){_0x2bdc4a[_0x8435('0x10d')]+='x';}if(_0x2bdc4a[_0x8435('0x10d')][_0x8435('0x172')]('X')<0x0){_0x2bdc4a[_0x8435('0x10d')]+='X';}this[_0x8435('0xb')][_0x8435('0x9a')](_0x8435('0x173'),_0x2984ba?_0x2984ba[_0x8435('0x174')]():'');var _0x368357=this['channel'][_0x8435('0xa9')](_0x8435('0x175'),[_0x2984ba,_0x2bdc4a[_0x8435('0x10d')],_0x2bdc4a['url'],_0x4c73a8,_0x2bdc4a[_0x8435('0x5f')],_0x2bdc4a[_0x8435('0x5')],_0x2bdc4a[_0x8435('0x176')],_0x2bdc4a[_0x8435('0x177')],'',_0x2bdc4a[_0x8435('0x178')]]);if(_0x368357[_0x8435('0xa0')]===-0x1){return _0x368357;}return this['channel'][_0x8435('0xa7')](util['format'](_0x8435('0xc5'),_0x8435('0x175'),_0x2984ba));};AGIVertices[_0x8435('0xe')]['record']=function(_0xe93f46){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xe93f46[_0x8435('0xa6')]));var _0x24b0fb=_0xe93f46[_0x8435('0x179')]||_0x8435('0x131');var _0x5e7314=util[_0x8435('0x28')]('%s_%s',this[_0x8435('0xb')][_0x8435('0x32')],rs['generate'](0x5));var _0x308be8=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x5e7314,_0x24b0fb);var _0x40069f=util[_0x8435('0x28')](_0x8435('0x132'),FILES_PATH,_0x5e7314);this['createSquareRecording'][_0x8435('0x6a')](this,_0xe93f46,_0x5e7314,_0x308be8);this['channel'][_0x8435('0x9a')]('RECORDING_SAVENAME',_0x5e7314);logger[_0x8435('0x2d')](_0x8435('0x17a'),_0x40069f,_0x24b0fb,_0xe93f46['escape_digits'],_0xe93f46[_0x8435('0x5f')]);return this[_0x8435('0xb')]['recordFile'](_0x40069f,_0x24b0fb,_0xe93f46[_0x8435('0x17b')],_0xe93f46['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x8435('0x17c')]=function(_0x21aa82){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x17d'),_0x21aa82[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x21aa82[_0x8435('0x5e')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x17e'));}var _0x26c9ab=this['restAPI']['sync'](this,_0x21aa82);logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x17f'),util[_0x8435('0x180')](_0x26c9ab,{'showHidden':![],'depth':null})));if(!this[_0x8435('0x81')](_0x21aa82[_0x8435('0xd6')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x181'));}var _0x509b1a=this[_0x8435('0xf')]['sync'](this,_0x21aa82[_0x8435('0xd6')]);if(!_0x509b1a){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x21aa82,_0x8435('0xd8'));}this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0x182'),_0x509b1a),_0x26c9ab[_0x8435('0x70')]?_0x26c9ab[_0x8435('0x70')]:'200');this[_0x8435('0xb')][_0x8435('0x9a')](util[_0x8435('0x28')](_0x8435('0x183'),_0x509b1a),_0x26c9ab['statusMessage']?_0x26c9ab[_0x8435('0x71')]:'OK');if(_0x26c9ab['body']){try{this[_0x8435('0x97')](_0x26c9ab['body'],_0x509b1a);}catch(_0x59814b){logger[_0x8435('0x2b')](util[_0x8435('0x28')](_0x8435('0x184'),_0x509b1a));}}return this[_0x8435('0xb')][_0x8435('0xa7')](util['format'](_0x8435('0xdc'),_0x509b1a));};AGIVertices['prototype']['saydigits']=function(_0x116c46){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x185'),_0x116c46[_0x8435('0xa6')]));return this['channel'][_0x8435('0x186')](_0x116c46[_0x8435('0x187')]['replace'](/\s+/g,''),_0x116c46[_0x8435('0x17b')]);};AGIVertices[_0x8435('0xe')][_0x8435('0x188')]=function(_0x323e90){logger['info'](util[_0x8435('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x323e90[_0x8435('0xa6')]));return this[_0x8435('0xb')]['sayNumber'](_0x323e90['number'][_0x8435('0x53')](/\s+/g,''),_0x323e90['escape_digits']);};AGIVertices[_0x8435('0xe')][_0x8435('0x189')]=function(_0x44dd64){logger[_0x8435('0x2d')](util['format'](_0x8435('0x18a'),_0x44dd64[_0x8435('0xa6')]));return this['channel'][_0x8435('0x18b')](_0x44dd64['text'],_0x44dd64['escape_digits']);};AGIVertices['prototype'][_0x8435('0x18c')]=function(_0x45a149){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x18d'),_0x45a149[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x45a149[_0x8435('0x18e')])){return this['channel'][_0x8435('0xa7')](_0x8435('0x18f'));}var _0x55c3c1=this['getMailAccount'][_0x8435('0x6a')](this,_0x45a149[_0x8435('0x18e')]);if(!_0x55c3c1||!_0x55c3c1[_0x8435('0x190')]){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x45a149,_0x8435('0x191'));}var _0x375304={'from':util[_0x8435('0x28')]('\x22%s\x22\x20<%s>',_0x55c3c1['name'],_0x55c3c1[_0x8435('0x192')]||_0x55c3c1['Smtp']['user']),'to':_0x45a149['to']||'','cc':_0x45a149['cc']||'','bcc':_0x45a149[_0x8435('0x193')]||'','subject':_0x45a149[_0x8435('0x194')],'html':_0x45a149[_0x8435('0x77')],'text':_0x45a149[_0x8435('0x77')]};var _0x20f358={'tls':{'rejectUnauthorized':![]}};if(_0x55c3c1[_0x8435('0x190')][_0x8435('0x195')]){_0x20f358[_0x8435('0x195')]=_0x55c3c1[_0x8435('0x190')][_0x8435('0x195')];}else{_0x20f358[_0x8435('0x196')]=_0x55c3c1[_0x8435('0x190')][_0x8435('0x196')];_0x20f358[_0x8435('0x197')]=_0x55c3c1[_0x8435('0x190')][_0x8435('0x197')];_0x20f358[_0x8435('0x198')]=_0x55c3c1['Smtp'][_0x8435('0x198')];}if(_0x55c3c1[_0x8435('0x190')][_0x8435('0x199')]){_0x20f358[_0x8435('0x19a')]={'user':_0x55c3c1[_0x8435('0x190')]['user'],'pass':_0x55c3c1['Smtp'][_0x8435('0x19b')]};}if(this[_0x8435('0x81')](_0x45a149[_0x8435('0x19c')])){}logger[_0x8435('0xde')](_0x8435('0x19d'),JSON[_0x8435('0x6d')](_0x375304));this['createSquareDetailsReport'][_0x8435('0x6a')](this,_0x45a149,_0x45a149[_0x8435('0x18e')]);this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x19e'),_0x55c3c1[_0x8435('0x15')]));this['sendMailMessage'][_0x8435('0x6a')](this,_0x20f358,_0x375304);return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x19f'));};AGIVertices['prototype'][_0x8435('0x1a0')]=function(_0x1bbd1e){logger[_0x8435('0x2d')](util['format'](_0x8435('0x1a1'),_0x1bbd1e[_0x8435('0xa6')]));return this[_0x8435('0xb')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x8435('0x1a2')]=function(_0x2395c6){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2395c6[_0x8435('0xa6')]));if(!this['isConfigured'](_0x2395c6[_0x8435('0x1a3')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x1a4'));}var _0x276065=this[_0x8435('0x1a5')]['sync'](this,_0x2395c6[_0x8435('0x1a3')]);if(!_0x276065){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2395c6,_0x8435('0x1a6'));}var _0xef124c={'body':_0x2395c6[_0x8435('0x1a7')],'phone':_0x2395c6['to']||'','SmsAccountId':_0x276065['id']};logger[_0x8435('0xde')](_0x8435('0x1a8'),JSON[_0x8435('0x6d')](_0xef124c));this['createSquareDetailsReport'][_0x8435('0x6a')](this,_0x2395c6,_0x2395c6['sms_account_id']);this['channel']['noop'](util[_0x8435('0x28')](_0x8435('0x1a9'),_0x276065[_0x8435('0x15')]));this[_0x8435('0x30')][_0x8435('0x6a')](this,_0xef124c);return this['channel'][_0x8435('0xa7')](_0x8435('0x1aa'));};AGIVertices['prototype'][_0x8435('0x1ab')]=function(_0x151f40){logger['info'](util['format'](_0x8435('0x1ac'),_0x151f40[_0x8435('0xa6')]));if(!this['isConfigured'](_0x151f40[_0x8435('0xd6')])){return this[_0x8435('0xb')]['error'](_0x151f40,_0x8435('0x1ad'));}var _0x406c7b=this['getVariable'][_0x8435('0x6a')](this,_0x151f40[_0x8435('0xd6')]);if(!_0x406c7b){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x151f40,_0x8435('0xd8'));}return this['channel'][_0x8435('0x9a')](_0x406c7b,_0x151f40[_0x8435('0x1ae')]);};AGIVertices[_0x8435('0xe')]['start']=function(_0x120f01){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x1af'),_0x120f01['label']));this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x1b0'));if(_0x120f01[_0x8435('0xbb')]===_0x8435('0x1b1')){this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x1b2'));return this[_0x8435('0xb')][_0x8435('0xbb')]();}return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x1b3'));};AGIVertices[_0x8435('0xe')]['subproject']=function(_0x2e79ea){logger['info'](util[_0x8435('0x28')](_0x8435('0x1b4'),_0x2e79ea[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0x2e79ea[_0x8435('0x1b5')])){return this['channel'][_0x8435('0x2b')](_0x2e79ea,'no\x20subproject\x20selected');}var _0x4fad3b=this[_0x8435('0x14')][_0x8435('0x6a')](this,_0x2e79ea[_0x8435('0x1b5')]);if(!this[_0x8435('0x81')](_0x4fad3b)){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2e79ea,util[_0x8435('0x28')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2e79ea[_0x8435('0x1b5')]));}if(_0x4fad3b===this[_0x8435('0xb')][_0x8435('0x33')]){return this[_0x8435('0xb')]['error'](_0x2e79ea,_0x8435('0x1b6'));}this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x2e79ea,_0x4fad3b);var _0x1f5d15=this[_0x8435('0xb')][_0x8435('0xa9')]('AGI',util['format'](_0x8435('0x1b7'),config[_0x8435('0x5')][_0x8435('0x196')]||_0x8435('0x1b8'),_0x4fad3b,this[_0x8435('0xb')]['arg_1']));if(_0x1f5d15[_0x8435('0xa0')]===-0x1){return _0x1f5d15;}return this['channel'][_0x8435('0xa7')](util['format'](_0x8435('0xc5'),_0x8435('0x1b9'),_0x4fad3b));};AGIVertices['prototype'][_0x8435('0x1ba')]=function(_0x4840f9){logger[_0x8435('0x2d')](util['format'](_0x8435('0x1bb'),_0x4840f9[_0x8435('0xa6')]));var _0x5a3651=this[_0x8435('0x51')][_0x8435('0x6a')](this,_0x4840f9[_0x8435('0xb7')]);this[_0x8435('0x31')][_0x8435('0x6a')](this,_0x4840f9,_0x4840f9[_0x8435('0xb7')]);if(this['isConfigured'](_0x4840f9['variable_id'])){var _0x4fbd73=this[_0x8435('0xf')]['sync'](this,_0x4840f9['variable_id']);if(_0x4fbd73){this[_0x8435('0xb')]['setVariable'](_0x4fbd73,_0x5a3651);return this['channel']['noop'](util[_0x8435('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x4840f9['command'],_0x4fbd73));}}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4840f9['command']));};AGIVertices[_0x8435('0xe')][_0x8435('0x1bc')]=function(_0x2a56bc){logger['info'](util[_0x8435('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2a56bc['label']));_0x2a56bc[_0x8435('0x77')]=_0x2a56bc['text'][_0x8435('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8435('0x81')](_0x2a56bc[_0x8435('0x55')])){return this[_0x8435('0xb')][_0x8435('0xa7')](_0x8435('0x1bd'));}if(!this[_0x8435('0x81')](_0x2a56bc['text'])){return this['channel'][_0x8435('0xa7')](_0x8435('0xa8'));}this[_0x8435('0xb')]['noop'](util[_0x8435('0x28')](_0x8435('0x1be'),_0x2a56bc['text']));var _0x5a0eb8=this[_0x8435('0x54')]['sync'](this,_0x2a56bc);if(_0x5a0eb8){this['channel']['noop'](util['format'](_0x8435('0x1bf'),_0x5a0eb8));var _0x12555b=this[_0x8435('0xb')]['streamFile'](_0x5a0eb8);try{fs[_0x8435('0x127')](_0x5a0eb8+_0x8435('0x103'));}catch(_0x2cdcb4){logger[_0x8435('0x2b')](_0x2cdcb4);}return _0x12555b;}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x2a56bc,_0x8435('0x1c0'));};AGIVertices[_0x8435('0xe')][_0x8435('0x1c1')]=function(_0x594e03){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x1c2'),_0x594e03['label']));_0x594e03[_0x8435('0x77')]=_0x594e03[_0x8435('0x77')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x594e03['text'])){return this['channel'][_0x8435('0xa7')]('no\x20text\x20configured');}this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x1c3'),_0x594e03[_0x8435('0x77')]));var _0x50f479=this[_0x8435('0x5b')]['sync'](this,_0x594e03);if(_0x50f479){this['channel']['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x50f479));var _0x3ddb32=this[_0x8435('0xb')][_0x8435('0x102')](_0x50f479);try{fs['unlink'](_0x50f479+_0x8435('0x103'));}catch(_0x5b74eb){logger['error'](_0x5b74eb);}return _0x3ddb32;}return this[_0x8435('0xb')][_0x8435('0x2b')](_0x594e03,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8435('0xe')]['unpause']=function(_0xd3e90d){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0xd3e90d[_0x8435('0xa6')]));if(!this[_0x8435('0x81')](_0xd3e90d[_0x8435('0x156')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0xd3e90d,'no\x20find\x20by\x20configured');}logger[_0x8435('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8435('0xb')][_0x8435('0x34')],_0xd3e90d[_0x8435('0x156')]));var _0x426453=this[_0x8435('0x4a')]['sync'](this,_0xd3e90d['findBy']);if(_0x426453){logger[_0x8435('0x2d')](util[_0x8435('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8435('0xb')]['callerid'],_0xd3e90d[_0x8435('0x156')]));this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x159'),this['channel'][_0x8435('0x34')],_0xd3e90d[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15a')};}else{logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')][_0x8435('0x34')],_0xd3e90d[_0x8435('0x156')]));this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0x15b'),this[_0x8435('0xb')][_0x8435('0x34')],_0xd3e90d[_0x8435('0x156')]));return{'code':0xc8,'result':_0x8435('0x15c')};}};AGIVertices['prototype'][_0x8435('0x1c4')]=function(_0x558c84){logger[_0x8435('0x2d')](util['format'](_0x8435('0x1c5'),_0x558c84[_0x8435('0xa6')]));var _0x1b7175=this[_0x8435('0xb')][_0x8435('0xa9')]('VOICEMAIL',[_0x558c84['mailbox'],_0x558c84[_0x8435('0x74')]]);if(_0x1b7175[_0x8435('0xa0')]===-0x1){return _0x1b7175;}return this[_0x8435('0xb')][_0x8435('0xa7')](util[_0x8435('0x28')](_0x8435('0xc5'),'VOICEMAIL',_0x558c84[_0x8435('0x1c6')]));};AGIVertices[_0x8435('0xe')][_0x8435('0x1c7')]=function(_0x34525d){logger[_0x8435('0x2d')](util[_0x8435('0x28')](_0x8435('0x1c8'),_0x34525d['label']));if(!this['isConfigured'](_0x34525d[_0x8435('0xd6')])){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x34525d,_0x8435('0x1ad'));}var _0x4b4275=this[_0x8435('0xf')][_0x8435('0x6a')](this,_0x34525d[_0x8435('0xd6')]);if(!_0x4b4275){return this[_0x8435('0xb')][_0x8435('0x2b')](_0x34525d,_0x8435('0xd8'));}var _0x43d731=this['channel'][_0x8435('0xf')](_0x4b4275);return{'code':0xc8,'result':_0x43d731['extra']?_0x43d731[_0x8435('0x9e')]:'-'};};String[_0x8435('0xe')][_0x8435('0x9d')]=function(_0x5db539,_0x239d6d){return this[_0x8435('0x9c')](_0x5db539)[_0x8435('0x1c9')](_0x239d6d);};module['exports']=AGIVertices; \ No newline at end of file +var _0xa24a=['format','%s/sounds/converted/%s','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','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','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','split','getAndSetVariable','result','extra','isConfigured','sync','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','beep','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','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','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','service','host','port','authentication','auth','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','./scripts','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval'];(function(_0x5d4364,_0x4a6c71){var _0x460809=function(_0x420c17){while(--_0x420c17){_0x5d4364['push'](_0x5d4364['shift']());}};_0x460809(++_0x4a6c71);}(_0xa24a,0x1a2));var _0xaa24=function(_0x52868d,_0xdec76b){_0x52868d=_0x52868d-0x0;var _0x5bc86b=_0xa24a[_0x52868d];return _0x5bc86b;};'use strict';var fs=require('fs');var path=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var _=require(_0xaa24('0x2'));var sh=require(_0xaa24('0x3'));var odbc=require(_0xaa24('0x4'))();var rs=require(_0xaa24('0x5'));var moment=require(_0xaa24('0x6'));var Mustache=require(_0xaa24('0x7'));var rp=require(_0xaa24('0x8'));var logger=require(_0xaa24('0x9'))('agi');var config=require(_0xaa24('0xa'));var scripts=require(_0xaa24('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xaa24('0xc'),_0xaa24('0xd')];var verticesWithRetry=['menu',_0xaa24('0xe'),_0xaa24('0xf')];var AGIVertices=function(_0x4cd6a5,_0x5b40cd,_0x1423db){this[_0xaa24('0x10')]=_0x4cd6a5;this[_0xaa24('0x11')]=_0x5b40cd;this[_0xaa24('0x12')]=_0x1423db;};AGIVertices[_0xaa24('0x13')][_0xaa24('0x14')]=function(_0x17b09b,_0x20148d){this[_0xaa24('0x11')]['getVariableById'](_0x17b09b)['then'](function(_0x161de6){_0x20148d(null,_0x161de6?_0x161de6['name']:![]);})[_0xaa24('0x15')](function(_0x2c44ac){_0x20148d(_0x2c44ac);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x16')]=function(_0x488ed1,_0x32e5b9){this[_0xaa24('0x11')][_0xaa24('0x17')](_0x488ed1)[_0xaa24('0x18')](function(_0xcb99dd){_0x32e5b9(null,_0xcb99dd?_0xcb99dd['name']:![]);})[_0xaa24('0x15')](function(_0x4adb32){_0x32e5b9(_0x4adb32);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x19')]=function(_0x1f5c9c,_0x135942){this[_0xaa24('0x11')][_0xaa24('0x1a')](_0x1f5c9c)['then'](function(_0x2c2df2){_0x135942(null,_0x2c2df2?_0x2c2df2[_0xaa24('0x1b')]:![]);})['catch'](function(_0x3e1be8){_0x135942(_0x3e1be8);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1c')]=function(_0x17b573,_0x26f2cf){this[_0xaa24('0x11')][_0xaa24('0x1d')](_0x17b573)[_0xaa24('0x18')](function(_0x181c7e){_0x26f2cf(null,_0x181c7e?_0x181c7e[_0xaa24('0x1e')]:![]);})[_0xaa24('0x15')](function(_0x3da691){_0x26f2cf(_0x3da691);});};AGIVertices[_0xaa24('0x13')]['getUser']=function(_0x3bdf56,_0x5bac34){this[_0xaa24('0x11')][_0xaa24('0x1f')](_0x3bdf56)[_0xaa24('0x18')](function(_0x3c0858){_0x5bac34(null,_0x3c0858?_0x3c0858['name']:![]);})['catch'](function(_0x4f90a8){_0x5bac34(_0x4f90a8);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x20')]=function(_0x2a3d2b,_0xd52e15){this['rpc'][_0xaa24('0x21')](_0x2a3d2b)['then'](function(_0x547181){_0xd52e15(null,_0x547181?_0x547181[_0xaa24('0x1b')]:![]);})['catch'](function(_0x37116e){_0xd52e15(_0x37116e);});};AGIVertices['prototype'][_0xaa24('0x22')]=function(_0xc7d404,_0x53a3c9){var _0x3459b3=this;this[_0xaa24('0x11')][_0xaa24('0x23')](_0xc7d404)[_0xaa24('0x18')](function(_0x3d90b9){_0x53a3c9(null,_0x3d90b9?_0x3459b3[_0xaa24('0x24')](_0x3d90b9[_0xaa24('0x25')]):![]);})['catch'](function(_0x57bb21){_0x53a3c9(_0x57bb21);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x26')]=function(_0x506d00,_0x3e9943){this[_0xaa24('0x11')]['getMailAccountById'](_0x506d00)[_0xaa24('0x18')](function(_0x183cd0){_0x3e9943(null,_0x183cd0?_0x183cd0:![]);})[_0xaa24('0x15')](function(_0x17f25d){_0x3e9943(_0x17f25d);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x27')]=function(_0xb69c6,_0x877767,_0x415701){this[_0xaa24('0x12')][_0xaa24('0x27')](_0xb69c6,_0x877767)['then'](function(){_0x415701(null);})[_0xaa24('0x15')](function(_0x3a120f){_0x415701(_0x3a120f);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x28')]=function(_0x163ff7,_0x59ed6f){this[_0xaa24('0x11')]['getIntervalById'](_0x163ff7)['then'](function(_0x3b50ef){if(_0x3b50ef){if(_0x3b50ef[_0xaa24('0x29')]){_0x59ed6f(null,[_0x3b50ef['interval']]);}else{_0x59ed6f(null,_[_0xaa24('0x2a')](_0x3b50ef[_0xaa24('0x2b')],_0xaa24('0x2c')));}}else{_0x59ed6f(null,![]);}})[_0xaa24('0x15')](function(_0x323a08){_0x59ed6f(_0x323a08);});};AGIVertices[_0xaa24('0x13')]['getSoundPath']=function(_0x39287b){return util[_0xaa24('0x2d')](_0xaa24('0x2e'),FILES_PATH,_0x39287b);};AGIVertices[_0xaa24('0x13')]['getQueryOdbc']=function(_0xc01853,_0x11ac60,_0x2078b0){odbc[_0xaa24('0x2f')](_0xc01853,function(_0x2e85ea){if(_0x2e85ea){logger[_0xaa24('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2e85ea);_0x2078b0(_0x2e85ea);}else{logger[_0xaa24('0x31')](_0xaa24('0x32'));odbc[_0xaa24('0x33')](_0x11ac60,function(_0x255e08,_0x13e6b0){if(_0x255e08){logger[_0xaa24('0x31')](_0xaa24('0x34'),_0x11ac60);_0x2078b0(_0x255e08);}else{logger[_0xaa24('0x31')]('Query\x20executed\x20correctly\x20%s',_0x11ac60);odbc[_0xaa24('0x35')](function(_0x22cc32){if(_0x22cc32){logger[_0xaa24('0x30')](_0xaa24('0x36'),_0x22cc32);}_0x2078b0(null,_0x13e6b0);});}});}});};AGIVertices['prototype'][_0xaa24('0x37')]=function(_0x22f732,_0x9d025a){this[_0xaa24('0x11')][_0xaa24('0x38')](_0x22f732)['then'](function(_0x2d7e4d){_0x9d025a(null,_0x2d7e4d?_0x2d7e4d:![]);})[_0xaa24('0x15')](function(_0xb9cd52){_0x9d025a(_0xb9cd52);});};AGIVertices[_0xaa24('0x13')]['createSmsMessage']=function(_0x3b5911,_0x3a52e1){this[_0xaa24('0x11')][_0xaa24('0x39')](_0x3b5911)['then'](function(_0x199f69){_0x3a52e1(null,_0x199f69);})[_0xaa24('0x15')](function(_0x679c4a){_0x3a52e1(_0x679c4a);});};AGIVertices['prototype'][_0xaa24('0x3a')]=function(_0x429b7c,_0x24edf9,_0x42fa51){this['rpc'][_0xaa24('0x3a')]({'uniqueid':this[_0xaa24('0x10')][_0xaa24('0x3b')],'node':_0x429b7c[_0xaa24('0x3c')],'application':_0x429b7c['agicommand'],'data':_0x24edf9||null,'project_name':this['channel'][_0xaa24('0x3d')],'callerid':this[_0xaa24('0x10')][_0xaa24('0x3e')]})['then'](function(_0x119c8d){if(_0x42fa51){_0x42fa51(null,_0x119c8d);}})[_0xaa24('0x15')](function(_0x348aa5){if(_0x42fa51){_0x42fa51(_0x348aa5);}});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x3f')]=function(_0x5b737e,_0x2c09af,_0x142ac8,_0xddb7fd){this['rpc'][_0xaa24('0x3f')]({'uniqueid':this['channel'][_0xaa24('0x3b')],'callerid':this[_0xaa24('0x10')][_0xaa24('0x3e')],'calleridname':this['channel'][_0xaa24('0x40')],'context':this['channel'][_0xaa24('0x41')],'extension':this['channel'][_0xaa24('0x42')],'priority':this[_0xaa24('0x10')]['priority'],'accountcode':this[_0xaa24('0x10')]['accountcode'],'dnid':this['channel'][_0xaa24('0x43')],'projectName':this['channel'][_0xaa24('0x3d')],'saveName':_0x2c09af,'filename':_0x5b737e[_0xaa24('0x44')]||_0x2c09af,'savePath':_0x142ac8})[_0xaa24('0x18')](function(_0x4578c5){_0xddb7fd(null,_0x4578c5);})[_0xaa24('0x15')](function(_0x30a1b6){_0xddb7fd(_0x30a1b6);});};AGIVertices['prototype'][_0xaa24('0x45')]=function(_0x1c29a1,_0x5c0377,_0x155640,_0x78361,_0x3b3247){this[_0xaa24('0x11')]['createSquareMessage']({'uniqueid':this[_0xaa24('0x10')][_0xaa24('0x3b')],'body':_0x1c29a1,'direction':_0x5c0377,'providerName':_0x155640,'providerResponse':_0x78361})[_0xaa24('0x18')](function(_0x1b90f1){if(_0x3b3247){_0x3b3247(null,_0x1b90f1);}})['catch'](function(_0x4809f8){if(_0x3b3247){_0x3b3247(_0x4809f8);}});};AGIVertices['prototype'][_0xaa24('0x46')]=function(_0x30eac7,_0x2d39df){this[_0xaa24('0x11')]['createCmContact']({'firstName':_['isEmpty'](_0x30eac7[_0xaa24('0x1b')])||_[_0xaa24('0x47')](_0x30eac7[_0xaa24('0x1b')])?_0xaa24('0x48')+Math[_0xaa24('0x49')]():_0x30eac7[_0xaa24('0x1b')],'lastName':_[_0xaa24('0x4a')](_0x30eac7[_0xaa24('0x4b')])||_[_0xaa24('0x47')](_0x30eac7[_0xaa24('0x4b')])?null:_0x30eac7[_0xaa24('0x4b')],'phone':_0x30eac7['phone'],'ListId':_0x30eac7[_0xaa24('0x4c')],'scheduledat':_0x30eac7[_0xaa24('0x4d')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xaa24('0x4e'),'description':'Callback\x20scheduled\x20at\x20'+_0x30eac7[_0xaa24('0x4d')][_0xaa24('0x4f')](),'priority':_0x30eac7[_0xaa24('0x50')]})[_0xaa24('0x18')](function(_0x28abfd){_0x2d39df(null,_0x28abfd);})[_0xaa24('0x15')](function(_0x16c0b6){_0x2d39df(_0x16c0b6);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x51')]=function(_0x5b8c6b,_0x41cbb2){this['rpc']['getPauseById'](_0x5b8c6b)[_0xaa24('0x18')](function(_0x5d501c){_0x41cbb2(null,_0x5d501c?_0x5d501c['name']:![]);})[_0xaa24('0x15')](function(_0x157107){_0x41cbb2(_0x157107);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x52')]=function(_0x1074fb,_0x5c32fd,_0x829090){var _0x3a2459={'role':_0xaa24('0x53')};_0x3a2459[_0x1074fb]=this['channel'][_0xaa24('0x3e')];this[_0xaa24('0x11')][_0xaa24('0x52')](_0x3a2459,_0x5c32fd,this[_0xaa24('0x10')][_0xaa24('0x3b')])[_0xaa24('0x18')](function(_0x12386b){_0x829090(null,_['isNil'](_0x12386b)?![]:!![]);})['catch'](function(_0xfebef0){logger[_0xaa24('0x30')](_0xfebef0);_0x829090(null,![]);});};AGIVertices[_0xaa24('0x13')]['agentUnpause']=function(_0x32f669,_0x5868af){var _0x3fbd76={'role':'agent'};_0x3fbd76[_0x32f669]=this['channel'][_0xaa24('0x3e')];this['rpc'][_0xaa24('0x54')](_0x3fbd76)[_0xaa24('0x18')](function(_0x1ed09a){_0x5868af(null,_['isNil'](_0x1ed09a)?![]:!![]);})['catch'](function(_0x5a631f){logger[_0xaa24('0x30')](_0x5a631f);_0x5868af(null,![]);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x55')]=function(_0x216f53,_0xf30c1d){var _0x1c2f4={'role':_0xaa24('0x53')};_0x1c2f4[_0x216f53]=this[_0xaa24('0x10')][_0xaa24('0x3e')];this[_0xaa24('0x11')][_0xaa24('0x55')](_0x1c2f4)[_0xaa24('0x18')](function(_0x1cf8ac){_0xf30c1d(null,_[_0xaa24('0x47')](_0x1cf8ac)?![]:!![]);})[_0xaa24('0x15')](function(_0x419150){logger[_0xaa24('0x30')](_0x419150);_0xf30c1d(null,![]);});};AGIVertices[_0xaa24('0x13')]['agentLogin']=function(_0x212442,_0x2fcc0c){var _0x2fe802={'role':'agent'};_0x2fe802[_0x212442]=this[_0xaa24('0x10')][_0xaa24('0x3e')];var _0x592e11=_0x212442!=_0xaa24('0x56')?util['format'](_0xaa24('0x57'),_0xaa24('0x58'),this[_0xaa24('0x10')][_0xaa24('0x3e')]):undefined;this[_0xaa24('0x11')][_0xaa24('0x59')](_0x2fe802,_0x592e11)[_0xaa24('0x18')](function(_0x3e74eb){_0x2fcc0c(null,_[_0xaa24('0x47')](_0x3e74eb)?![]:!![]);})[_0xaa24('0x15')](function(_0x345ef3){logger[_0xaa24('0x30')](_0x345ef3);_0x2fcc0c(null,![]);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x5a')]=function(_0xf4ed70,_0x2a92e3){sh[_0xaa24('0x5b')](_[_0xaa24('0x5c')](_0xf4ed70),function(_0x1a9f22,_0x5649d1){var _0x3af974=_0x5649d1[_0xaa24('0x5d')](/(\r\n|\n|\r)/gm,'');_0x2a92e3(null,_0x3af974);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x5e')]=function(_0x3367d3,_0x534466){scripts[_0xaa24('0x5e')](_0x3367d3['apiKey'],_0x3367d3[_0xaa24('0x5f')]||_0xaa24('0x60'),_0x3367d3[_0xaa24('0x60')],_0x3367d3[_0xaa24('0x61')]||_0xaa24('0x62'),_0x3367d3[_0xaa24('0x63')]||_0xaa24('0x64'),_0x3367d3['audioEncoding']||_0xaa24('0x65'))[_0xaa24('0x18')](function(_0x1b3d66){_0x534466(null,_0x1b3d66);})[_0xaa24('0x15')](function(_0x384a70){_0x534466(_0x384a70);});};AGIVertices[_0xaa24('0x13')]['googleTTS']=function(_0xb61b29,_0x337d4f){scripts['googleTTS'](_0xb61b29[_0xaa24('0x60')],_0xb61b29[_0xaa24('0x66')]||'en',0x1)[_0xaa24('0x18')](function(_0x232592){_0x337d4f(null,_0x232592);})[_0xaa24('0x15')](function(_0x244daf){_0x337d4f(_0x244daf);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x67')]=function(_0x47c405,_0x172e89){var _0x427c35={'uri':_0x47c405[_0xaa24('0x68')],'method':_0x47c405[_0xaa24('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x47c405[_0xaa24('0x6a')])===_0xaa24('0x6b')&&parseInt(_0x47c405['timeout'])>=0x1?parseInt(_0x47c405[_0xaa24('0x6a')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xaa24('0x6c'),_0xaa24('0x6d')],_0x427c35['method'][_0xaa24('0x6e')]())){try{_0x427c35[_0xaa24('0x6f')]=_0x47c405[_0xaa24('0xd')]?JSON[_0xaa24('0x70')](_0x47c405[_0xaa24('0xd')]):{};}catch(_0xb9e12e){logger[_0xaa24('0x30')](_0xaa24('0x71'),_0xb9e12e);}}try{_0x427c35['headers']=_0x47c405['rawHeaders']?JSON['parse'](_0x47c405[_0xaa24('0xc')]):{};}catch(_0x1ed0bf){logger[_0xaa24('0x30')](_0xaa24('0x72'),_0x1ed0bf);}if(_0x47c405[_0xaa24('0x73')]){try{var _0x50ddee=require(_0x47c405[_0xaa24('0x73')])['sync'](this,_0x427c35);_0x427c35['uri']=Mustache[_0xaa24('0x74')](_0x47c405[_0xaa24('0x68')],_0x50ddee,{},['$$','$$']);if(_0x427c35[_0xaa24('0x75')]){_0x427c35[_0xaa24('0x75')]=JSON['parse'](Mustache[_0xaa24('0x74')](JSON[_0xaa24('0x76')](_0x427c35[_0xaa24('0x75')]),_0x50ddee,{},['$$','$$']));}if(_0x427c35[_0xaa24('0x6f')]){_0x427c35[_0xaa24('0x6f')]=JSON['parse'](Mustache[_0xaa24('0x74')](JSON[_0xaa24('0x76')](_0x427c35[_0xaa24('0x6f')]),_0x50ddee,{},['$$','$$']));}}catch(_0x2b42ef){logger[_0xaa24('0x30')](_0xaa24('0x77'),_0x2b42ef);}}rp(_0x427c35)['then'](function(_0x4ec4e6){var _0x2d028c={'statusCode':_0x4ec4e6['statusCode']||0xc8,'statusMessage':_0x4ec4e6[_0xaa24('0x78')]||'OK','headers':_0x4ec4e6['headers']||{},'body':_0x4ec4e6[_0xaa24('0x6f')]||{}};_0x172e89(null,_0x2d028c);})['catch'](function(_0x26d81f){var _0xc2dcb4={'statusCode':_0x26d81f[_0xaa24('0x79')]||0x1f4,'statusMessage':_0x26d81f[_0xaa24('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x26d81f[_0xaa24('0x7b')][_0xaa24('0x75')]||{},'body':_0x26d81f['options'][_0xaa24('0x6f')]||{}};_0x172e89(null,_0xc2dcb4);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x7c')]=function(_0x48f2a5,_0x227dde){scripts['googleDialogflow'](this['channel'][_0xaa24('0x3b')],_0x48f2a5[_0xaa24('0x7d')],_0x48f2a5[_0xaa24('0x60')],_0x48f2a5[_0xaa24('0x7e')]||'en')[_0xaa24('0x18')](function(_0x1c32d2){_0x227dde(null,_0x1c32d2);})[_0xaa24('0x15')](function(_0x3e39e9){_0x227dde(_0x3e39e9);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x7f')]=function(_0x40f044,_0x5949df){scripts[_0xaa24('0x7f')](this[_0xaa24('0x10')]['uniqueid'],_0x40f044[_0xaa24('0x80')],_0x40f044[_0xaa24('0x81')],_0x40f044[_0xaa24('0x82')],_0x40f044[_0xaa24('0x60')],_0x40f044[_0xaa24('0x83')]||'en')[_0xaa24('0x18')](function(_0x254eea){_0x5949df(null,_0x254eea);})[_0xaa24('0x15')](function(_0x15fbfe){_0x5949df(_0x15fbfe);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x84')]=function(_0x43c708,_0x1e2832){scripts[_0xaa24('0x84')](this[_0xaa24('0x10')],_0x43c708)[_0xaa24('0x18')](function(_0x1cd757){_0x1e2832(null,_0x1cd757);})[_0xaa24('0x15')](function(_0x4fefe5){_0x1e2832(_0x4fefe5);});};AGIVertices['prototype']['ispeechTTS']=function(_0xa1b81a,_0x59e2d6){scripts['ispeechTTS'](_0xa1b81a[_0xaa24('0x7d')],_0xa1b81a['text'],_0xa1b81a[_0xaa24('0x85')]||_0xaa24('0x62'),_0xa1b81a['speed'])[_0xaa24('0x18')](function(_0x2f6907){_0x59e2d6(null,_0x2f6907);})[_0xaa24('0x15')](function(_0x15ebbd){_0x59e2d6(_0x15ebbd);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x86')]=function(_0x15a6a2,_0x4edcfe,_0x54fcb7){scripts['ispeechASR'](_0x4edcfe,_0x15a6a2[_0xaa24('0x7d')],_0x15a6a2[_0xaa24('0x87')]||_0xaa24('0x62'),this['isConfigured'](_0x15a6a2[_0xaa24('0x88')])?_0x15a6a2[_0xaa24('0x88')]:undefined)[_0xaa24('0x18')](function(_0x4dbe5f){_0x54fcb7(null,_0x4dbe5f);})[_0xaa24('0x15')](function(_0x371616){_0x54fcb7(_0x371616);});};AGIVertices['prototype'][_0xaa24('0x89')]=function(_0x4d71c6,_0x5d7ffa){scripts[_0xaa24('0x89')](_0x4d71c6[_0xaa24('0x8a')],_0x4d71c6[_0xaa24('0x8b')],_0x4d71c6['aws_polly_region'],_0x4d71c6['aws_polly_voice']||'Amy',_0x4d71c6[_0xaa24('0x60')],_0x4d71c6['aws_text_type']||_0xaa24('0x60'))['then'](function(_0x4b1328){_0x5d7ffa(null,_0x4b1328);})[_0xaa24('0x15')](function(_0x118d11){_0x5d7ffa(_0x118d11);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x8c')]=function(_0x10ee28,_0x138075){scripts['awsLex'](this['channel'][_0xaa24('0x3b')],_0x10ee28[_0xaa24('0x8a')],_0x10ee28[_0xaa24('0x8b')],_0x10ee28[_0xaa24('0x8d')],_0x10ee28['text'],_0x10ee28[_0xaa24('0x8e')])['then'](function(_0x18a031){_0x138075(null,_0x18a031);})['catch'](function(_0xad1ecc){_0x138075(_0xad1ecc);});};AGIVertices['prototype'][_0xaa24('0x8f')]=function(_0x2eeb89,_0xf9d34b,_0x523315){scripts['googleASR'](_0xf9d34b,_0x2eeb89[_0xaa24('0x7d')],_0x2eeb89[_0xaa24('0x90')]||_0xaa24('0x62'))[_0xaa24('0x18')](function(_0x5897e2){_0x523315(null,_0x5897e2);})[_0xaa24('0x15')](function(_0x42168f){_0x523315(_0x42168f);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x91')]=function(_0x544d22,_0x235cfc,_0x1dc0e8){scripts[_0xaa24('0x91')](_0x235cfc,_0x544d22[_0xaa24('0x92')],_0x544d22[_0xaa24('0x93')],_0x544d22[_0xaa24('0x94')])[_0xaa24('0x18')](function(_0x5d9231){_0x1dc0e8(null,_0x5d9231);})[_0xaa24('0x15')](function(_0x5117d2){_0x1dc0e8(_0x5117d2);});};AGIVertices[_0xaa24('0x13')][_0xaa24('0x95')]=function(_0x5f56ac){var _0x3e2d78=_[_0xaa24('0x96')](verticesWithRetry,_0x5f56ac[_0xaa24('0x97')])?_0x5f56ac:_[_0xaa24('0x98')](_0x5f56ac);for(var _0x5af1c3 in _0x3e2d78){if(_0x3e2d78[_0xaa24('0x99')](_0x5af1c3)){if(_0x3e2d78[_0x5af1c3]&&_[_0xaa24('0x9a')](_0x3e2d78[_0x5af1c3])){if(_['includes'](recursiveMapAttributes,_0x5af1c3)){_0x3e2d78[_0x5af1c3]=this[_0xaa24('0x9b')](_0x3e2d78[_0x5af1c3]);}else{_0x3e2d78[_0x5af1c3]=this[_0xaa24('0x9c')](_0x3e2d78[_0x5af1c3]);}}}}return _0x3e2d78;};AGIVertices[_0xaa24('0x13')][_0xaa24('0x9d')]=function(_0x182ded){for(var _0x19b220 in _0x182ded){if(_0x182ded['hasOwnProperty'](_0x19b220)){if(_[_0xaa24('0x9e')](_0x182ded[_0x19b220])){this[_0xaa24('0x9d')](_0x182ded[_0x19b220]);}else if(_[_0xaa24('0x9f')](_0x182ded[_0x19b220])){for(var _0x1cad20=0x0;_0x1cad20<_0x182ded[_0x19b220][_0xaa24('0xa0')];_0x1cad20++){this[_0xaa24('0x9d')](_0x182ded[_0x19b220][_0x1cad20]);}}else if(_[_0xaa24('0x9a')](_0x182ded[_0x19b220])){_0x182ded[_0x19b220]=this[_0xaa24('0x9c')](_0x182ded[_0x19b220]);}}}};AGIVertices[_0xaa24('0x13')]['saveRestApiResult']=function(_0x51ba5d,_0x2f787a){for(var _0x3d8deb in _0x51ba5d){if(_0x51ba5d[_0xaa24('0x99')](_0x3d8deb)){if(_[_0xaa24('0x9e')](_0x51ba5d[_0x3d8deb])){if(!_[_0xaa24('0x4a')](_0x51ba5d[_0x3d8deb])){this['saveRestApiResult'](_0x51ba5d[_0x3d8deb],util[_0xaa24('0x2d')](_0xaa24('0xa1'),_0x2f787a,_0x3d8deb));}}else if(_[_0xaa24('0x9f')](_0x51ba5d[_0x3d8deb])){for(var _0xcd3669=0x0;_0xcd3669<_0x51ba5d[_0x3d8deb]['length'];_0xcd3669++){this[_0xaa24('0xa2')](_0x51ba5d[_0x3d8deb][_0xcd3669],util[_0xaa24('0x2d')](_0xaa24('0xa1'),_0x2f787a,_0x3d8deb+'['+_0xcd3669+']'));}}else{if(!_['isNil'](_0x51ba5d[_0x3d8deb])){this[_0xaa24('0x10')][_0xaa24('0xa3')](util['format']('%s.%s',_0x2f787a,_0x3d8deb),_0x51ba5d[_0x3d8deb]);}}}}};AGIVertices[_0xaa24('0x13')][_0xaa24('0x9b')]=function(_0x3f7b0a){try{var _0x2fd90e=JSON[_0xaa24('0x70')](_0x3f7b0a);this[_0xaa24('0x9d')](_0x2fd90e);return JSON[_0xaa24('0x76')](_0x2fd90e);}catch(_0x3aed0d){return this[_0xaa24('0x9c')](_0x3f7b0a);}};AGIVertices[_0xaa24('0x13')][_0xaa24('0x9c')]=function(_0x43769f){var _0x546cb6=_0x43769f[_0xaa24('0xa4')]('{');for(var _0x3c18ea=0x1;_0x3c18ea<_0x546cb6[_0xaa24('0xa0')];_0x3c18ea+=0x1){var _0x904585=_0x546cb6[_0x3c18ea]['split']('}');if(_0x904585[_0xaa24('0xa0')]>0x1){_0x43769f=_0x43769f['replaceAll']('{'+_0x904585[0x0]+'}',this[_0xaa24('0x10')][_0xaa24('0x14')](_0x904585[0x0])['extra']||_0x904585[0x0]);}}if(_0x546cb6[_0xaa24('0xa0')]===0x1){return _0x43769f[_0xaa24('0x4f')]();}return this[_0xaa24('0x9c')](_0x43769f);};AGIVertices['prototype'][_0xaa24('0xa5')]=function(_0x215f50,_0x250f5a){var _0x303a5d=this[_0xaa24('0x10')][_0xaa24('0x14')](_0x215f50);if(_0x303a5d[_0xaa24('0xa6')]===-0x1){return _0x303a5d;}logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x250f5a,_0x303a5d['extra']));return this[_0xaa24('0x10')]['setVariable'](_0x250f5a,_0x303a5d[_0xaa24('0xa7')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0xa8')]=function(_0x35aa96){return _0x35aa96&&_0x35aa96!=='0'&&_0x35aa96!=='-1'&&_0x35aa96!=='';};AGIVertices[_0xaa24('0x13')]['maxRetry']=function(_0x1c2ca7){this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x1c2ca7,'-');_0x1c2ca7['retry']=_0x1c2ca7[_0xaa24('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xaa24('0x13')][_0xaa24('0xab')]=function(_0x2b6fd1){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xac'),_0x2b6fd1[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x2b6fd1['text'])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xae'));}var _0x111529='\x22'+_0x2b6fd1['text']+'\x22';if(this[_0xaa24('0xa8')](_0x2b6fd1[_0xaa24('0x7b')])){_0x111529+=','+_0x2b6fd1[_0xaa24('0x7b')];}var _0x491357=this[_0xaa24('0x10')][_0xaa24('0x5b')](_0xaa24('0xaf'),_0x111529);if(_0x491357[_0xaa24('0xa6')]===-0x1){return _0x491357;}return this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xb0'),_0x111529));};AGIVertices['prototype']['mrcprecog']=function(_0x1196d0){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1196d0[_0xaa24('0x3c')]));if(!this['isConfigured'](_0x1196d0[_0xaa24('0xb1')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xb2'));}var _0x358d4f=_0x1196d0[_0xaa24('0xb1')];if(this[_0xaa24('0xa8')](_0x1196d0[_0xaa24('0x7b')])){_0x358d4f+=','+_0x1196d0[_0xaa24('0x7b')];}var _0x5bfc8d=this[_0xaa24('0x10')]['exec'](_0xaa24('0xb3'),_0x358d4f);if(_0x5bfc8d['result']===-0x1){return _0x5bfc8d;}var _0x4c6c0b=this[_0xaa24('0xa5')](_0xaa24('0xb4'),_0xaa24('0xb5'));if(_0x4c6c0b[_0xaa24('0xa6')]===-0x1){return _0x4c6c0b;}var _0x1d8f75=this['getAndSetVariable']('RECOG_INPUT()',_0xaa24('0xb6'));if(_0x1d8f75[_0xaa24('0xa6')]===-0x1){return _0x1d8f75;}var _0x32f849=this['getAndSetVariable']('RECOG_INSTANCE()',_0xaa24('0xb7'));if(_0x32f849['result']===-0x1){return _0x32f849;}return this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xb8'),_0x358d4f));};AGIVertices['prototype']['agi']=function(_0x3d5b67){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xb9'),_0x3d5b67[_0xaa24('0x3c')]));return this[_0xaa24('0x10')][_0xaa24('0xba')]([_0x3d5b67[_0xaa24('0xbb')],_0x3d5b67[_0xaa24('0xbc')]]);};AGIVertices[_0xaa24('0x13')]['answer']=function(_0x39e79a){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0xbd'),_0x39e79a[_0xaa24('0x3c')]));if(this['isConfigured'](_0x39e79a[_0xaa24('0x6a')])){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x39e79a[_0xaa24('0x6a')]));var _0x4a5a45=this[_0xaa24('0x10')][_0xaa24('0xbe')](_0x39e79a['timeout']);if(_0x4a5a45['result']===-0x1){return _0x4a5a45;}}return this[_0xaa24('0x10')][_0xaa24('0xbf')]();};AGIVertices[_0xaa24('0x13')][_0xaa24('0x4e')]=function(_0xe4e6f5){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xc0'),_0xe4e6f5[_0xaa24('0x3c')]));if(!this['isConfigured'](_0xe4e6f5[_0xaa24('0x4c')])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0xe4e6f5,_0xaa24('0xc1'));}_0xe4e6f5[_0xaa24('0x4d')]=moment();if(this['isConfigured'](_0xe4e6f5[_0xaa24('0xc2')])){_0xe4e6f5[_0xaa24('0x4d')]=moment()[_0xaa24('0xc3')](_0xe4e6f5[_0xaa24('0xc2')],_0xaa24('0xc4'));}if(!this[_0xaa24('0xa8')](_0xe4e6f5[_0xaa24('0x50')])){_0xe4e6f5['callback_priority']=0x2;}this[_0xaa24('0x46')]['sync'](this,_0xe4e6f5);return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xe4e6f5[_0xaa24('0xc5')],_0xe4e6f5['list_id'],_0xe4e6f5[_0xaa24('0x4d')]));};AGIVertices['prototype'][_0xaa24('0xc6')]=function(_0x49ede7){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0xc7'),_0x49ede7[_0xaa24('0x3c')]));var _0x51f4aa=this['channel']['exec'](_0x49ede7['application'],_0x49ede7[_0xaa24('0x7b')]);if(_0x51f4aa['result']===-0x1){return _0x51f4aa;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0xc8'),_0x49ede7['application'],_0x49ede7['options']));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xc9')]=function(_0x107196){logger[_0xaa24('0x31')](util['format'](_0xaa24('0xca'),_0x107196[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x107196[_0xaa24('0x60')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xae'));}var _0x294cee='\x22'+_0x107196[_0xaa24('0x60')]+'\x22';if(this['isConfigured'](_0x107196[_0xaa24('0x7b')])){_0x294cee+=','+_0x107196['options'];}var _0x29d587=this[_0xaa24('0x10')]['exec'](_0xaa24('0xaf'),_0x294cee);if(_0x29d587['result']===-0x1){return _0x29d587;}return this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x294cee));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xcb')]=function(_0x13911f){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0xcc'),_0x13911f[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x13911f['text'])){return this[_0xaa24('0x10')][_0xaa24('0xad')]('no\x20text\x20configured');}var _0x5a9f87='\x22'+_0x13911f[_0xaa24('0x60')]+'\x22';if(this['isConfigured'](_0x13911f[_0xaa24('0x7b')])){_0x5a9f87+=','+_0x13911f['options'];}var _0x4d177f=this[_0xaa24('0x10')][_0xaa24('0x5b')]('MRCPSynth',_0x5a9f87);if(_0x4d177f[_0xaa24('0xa6')]===-0x1){return _0x4d177f;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xb0'),_0x5a9f87));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xcd')]=function(_0xc65e91){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xce'),_0xc65e91[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0xc65e91[_0xaa24('0xb1')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xb2'));}var _0x2a8e17=_0xc65e91[_0xaa24('0xb1')];if(this['isConfigured'](_0xc65e91[_0xaa24('0x7b')])){_0x2a8e17+=','+_0xc65e91[_0xaa24('0x7b')];}var _0x3552dc=this[_0xaa24('0x10')][_0xaa24('0x5b')](_0xaa24('0xb3'),_0x2a8e17);if(_0x3552dc[_0xaa24('0xa6')]===-0x1){return _0x3552dc;}var _0x5034b9=this['getAndSetVariable'](_0xaa24('0xb4'),_0xaa24('0xcf'));if(_0x5034b9['result']===-0x1){return _0x5034b9;}var _0xd49e33=this['getAndSetVariable'](_0xaa24('0xd0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0xd49e33['result']===-0x1){return _0xd49e33;}var _0x243c8b=this['getAndSetVariable'](_0xaa24('0xd1'),_0xaa24('0xd2'));if(_0x243c8b['result']===-0x1){return _0x243c8b;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xb8'),_0x2a8e17));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xd3')]=function(_0x3f5d0f){logger['info'](util[_0xaa24('0x2d')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x3f5d0f[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x3f5d0f[_0xaa24('0xb1')])){return this['channel']['noop'](_0xaa24('0xb2'));}var _0x5020d6=_0x3f5d0f[_0xaa24('0xb1')];if(this['isConfigured'](_0x3f5d0f['options'])){_0x5020d6+=','+_0x3f5d0f[_0xaa24('0x7b')];}var _0x3f523d=this[_0xaa24('0x10')]['exec']('MRCPRecog',_0x5020d6);if(_0x3f523d[_0xaa24('0xa6')]===-0x1){return _0x3f523d;}var _0x3c2d99=this[_0xaa24('0xa5')]('RECOG_CONFIDENCE()',_0xaa24('0xd4'));if(_0x3c2d99['result']===-0x1){return _0x3c2d99;}var _0x4713bb=this[_0xaa24('0xa5')](_0xaa24('0xd0'),_0xaa24('0xd5'));if(_0x4713bb[_0xaa24('0xa6')]===-0x1){return _0x4713bb;}var _0x1b2585=this[_0xaa24('0xa5')]('RECOG_INSTANCE()',_0xaa24('0xd6'));if(_0x1b2585[_0xaa24('0xa6')]===-0x1){return _0x1b2585;}return this[_0xaa24('0x10')]['noop'](util[_0xaa24('0x2d')](_0xaa24('0xb8'),_0x5020d6));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xd7')]=function(_0x152dad){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xd8'),_0x152dad[_0xaa24('0x3c')]));if(!this['isConfigured'](_0x152dad['odbc_id'])){return this[_0xaa24('0x10')]['error'](_0x152dad,_0xaa24('0xd9'));}var _0x26accd=this[_0xaa24('0x1c')][_0xaa24('0xa9')](this,_0x152dad[_0xaa24('0xda')]);if(!_0x26accd){return this[_0xaa24('0x10')]['error'](_0x152dad,_0xaa24('0xdb'));}if(!this['isConfigured'](_0x152dad['query'])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x152dad,'no\x20query\x20configured');}var _0x4be5d2=_0x152dad[_0xaa24('0x33')][_0xaa24('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xdc'),_0x4be5d2));var _0x2eff6c=this[_0xaa24('0xdd')][_0xaa24('0xa9')](this,_0x26accd,_0x4be5d2);this[_0xaa24('0x3a')]['sync'](this,_0x152dad,_0x4be5d2);if(!this[_0xaa24('0xa8')](_0x152dad[_0xaa24('0xde')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xdf'));}var _0x4473ea=this[_0xaa24('0x14')][_0xaa24('0xa9')](this,_0x152dad[_0xaa24('0xde')]);if(!_0x4473ea){return this['channel']['error'](_0x152dad,_0xaa24('0xe0'));}var _0x4c4055=this;_0x2eff6c[_0xaa24('0xe1')](function(_0xa8a062,_0x23a523){Object[_0xaa24('0xe2')](_0xa8a062)['forEach'](function(_0x1436e3){_0x4c4055[_0xaa24('0x10')][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0xe3'),_0x4473ea,_0x23a523,_0x1436e3),_0xa8a062[_0x1436e3]);});});this['channel'][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0xe4'),_0x4473ea),_0x2eff6c[_0xaa24('0xa0')]);return this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xe5'),_0x4473ea));};AGIVertices['prototype'][_0xaa24('0xe6')]=function(_0x1da915){logger[_0xaa24('0xe7')](util[_0xaa24('0x2d')](_0xaa24('0xe8'),_0x1da915[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x1da915[_0xaa24('0xe9')])){return this['channel']['error'](_0x1da915,_0xaa24('0xea'));}var _0x32b6d3=this['getUser']['sync'](this,_0x1da915[_0xaa24('0xe9')]);if(!_0x32b6d3){return this[_0xaa24('0x10')]['error'](_0x1da915,_0xaa24('0xeb'));}var _0x5bc37c=this[_0xaa24('0x10')][_0xaa24('0x5b')](_0xaa24('0xec'),[util[_0xaa24('0x2d')](_0xaa24('0xed'),_0x32b6d3),_0x1da915[_0xaa24('0x6a')],_0x1da915[_0xaa24('0xee')],_0x1da915[_0xaa24('0x68')]]);if(_0x5bc37c[_0xaa24('0xa6')]===-0x1){return _0x5bc37c;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xef'),'DIAL'));};AGIVertices['prototype'][_0xaa24('0xf0')]=function(_0x4ff210){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0xf1'),_0x4ff210['label']));if(!this[_0xaa24('0xa8')](_0x4ff210[_0xaa24('0x7d')])){return this[_0xaa24('0x10')]['noop']('no\x20key\x20configured');}if(!this[_0xaa24('0xa8')](_0x4ff210['text'])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xae'));}this['channel'][_0xaa24('0xf2')]=!![];this['createSquareDetailsReport'](_0x4ff210);this[_0xaa24('0x45')](_0x4ff210[_0xaa24('0x60')],'in','','');this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xf3'),_0x4ff210['text']));var _0x4812ae=this['googleDialogflow'][_0xaa24('0xa9')](this,_0x4ff210);if(_0x4812ae){for(var _0xfe7734 in _0x4812ae){if(_0x4812ae[_0xaa24('0x99')](_0xfe7734)){this['channel'][_0xaa24('0xa3')](util[_0xaa24('0x2d')]('DIALOGFLOW_%s',_0xfe7734[_0xaa24('0x6e')]()),_0x4812ae[_0xfe7734]);}}this['createSquareMessage'](_0x4812ae[_0xaa24('0xf4')],_0xaa24('0xf5'),'dialogflow','');return this['channel'][_0xaa24('0xad')](util['format'](_0xaa24('0xf6'),_0x4812ae[_0xaa24('0xf4')]));}return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x4ff210,_0xaa24('0xf7'));};AGIVertices['prototype'][_0xaa24('0xf8')]=function(_0x4f00b5){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0xf9'),_0x4f00b5[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x4f00b5['dialogflowV2_project_id'])){return this[_0xaa24('0x10')][_0xaa24('0xad')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x4f00b5[_0xaa24('0x81')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xfa'));}if(!this[_0xaa24('0xa8')](_0x4f00b5['private_key'])){return this[_0xaa24('0x10')]['noop']('no\x20private_key\x20configured');}if(!this[_0xaa24('0xa8')](_0x4f00b5['dialogflowV2_language'])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xfb'));}if(!this['isConfigured'](_0x4f00b5[_0xaa24('0x60')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xae'));}this[_0xaa24('0x10')][_0xaa24('0xf2')]=!![];this[_0xaa24('0x3a')](_0x4f00b5);this[_0xaa24('0x45')](_0x4f00b5[_0xaa24('0x60')],'in','','');this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xfc'),_0x4f00b5['text']));var _0x284b6c=this[_0xaa24('0x7f')]['sync'](this,_0x4f00b5);if(_0x284b6c){for(var _0x44a955 in _0x284b6c){if(_0x284b6c[_0xaa24('0x99')](_0x44a955)){if(_0x44a955!==_0xaa24('0xfd')){this['channel'][_0xaa24('0xa3')](util['format']('DIALOGFLOW_%s',_0x44a955[_0xaa24('0x6e')]()),_0x284b6c[_0x44a955]);}}}this['createSquareMessage'](_0x284b6c[_0xaa24('0xf4')],_0xaa24('0xf5'),_0xaa24('0xf8'),_0x284b6c['providerResponse']);return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xfe'),_0x284b6c[_0xaa24('0xf4')]));}return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x4f00b5,_0xaa24('0xff'));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x100')]=function(_0x1bc1dd){logger[_0xaa24('0x31')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1bc1dd[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x1bc1dd[_0xaa24('0x101')])){return this['channel'][_0xaa24('0xad')](_0xaa24('0x102'));}if(!this[_0xaa24('0xa8')](_0x1bc1dd[_0xaa24('0x103')])){return this[_0xaa24('0x10')]['noop']('no\x20username\x20configured');}if(!this[_0xaa24('0xa8')](_0x1bc1dd[_0xaa24('0x104')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x105'));}if(!this[_0xaa24('0xa8')](_0x1bc1dd[_0xaa24('0x106')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xae'));}this[_0xaa24('0x10')][_0xaa24('0xf2')]=!![];this['createSquareDetailsReport'](_0x1bc1dd);this[_0xaa24('0x45')](_0x1bc1dd[_0xaa24('0x60')],'in','','');this[_0xaa24('0x10')]['noop'](util[_0xaa24('0x2d')]('Trying\x20SestekNDA:\x20%s',_0x1bc1dd[_0xaa24('0x60')]));var _0x160d8f=this['sestekNDA'][_0xaa24('0xa9')](this,_0x1bc1dd);if(_0x160d8f){for(var _0x23ddc5 in _0x160d8f){if(_0x160d8f[_0xaa24('0x99')](_0x23ddc5)){this['channel'][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0x107'),_0x23ddc5[_0xaa24('0x6e')]()),_0x160d8f[_0x23ddc5]);}}this[_0xaa24('0x45')](_0x160d8f[_0xaa24('0xf4')],'out',_0xaa24('0x100'),'');if(_0x160d8f[_0xaa24('0x108')]){this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x109'),_0x160d8f[_0xaa24('0x108')]));var _0x3f7b2f=this['channel']['streamFile'](_0x160d8f[_0xaa24('0x108')]);try{fs['unlink'](_0x160d8f[_0xaa24('0x108')]+'.wav');}catch(_0x33896e){logger[_0xaa24('0x30')](_0x33896e);}return _0x3f7b2f;}else{return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x10a'),_0x160d8f[_0xaa24('0xf4')]));}}return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x1bc1dd,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xaa24('0x13')]['end']=function(_0x33d56b){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x10b'),_0x33d56b[_0xaa24('0x3c')]));return this['channel'][_0xaa24('0xad')]('end');};AGIVertices['prototype'][_0xaa24('0x10c')]=function(_0x2cf27b){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x10d'),_0x2cf27b[_0xaa24('0x3c')]));var _0x1fad95='';if(_0x2cf27b['trunk_id']){if(!this[_0xaa24('0xa8')](_0x2cf27b['trunk_id'])){return this['channel'][_0xaa24('0x30')](_0x2cf27b,'no\x20trunk\x20selected');}else{var _0x251a7d=parseInt(_0x2cf27b['trunk_id'],0xa);if(isNaN(_0x251a7d)){_0x1fad95=_0x2cf27b[_0xaa24('0x10e')];}else{_0x1fad95=this[_0xaa24('0x20')][_0xaa24('0xa9')](this,_0x2cf27b[_0xaa24('0x10e')]);if(!_0x1fad95){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x2cf27b,_0xaa24('0x10f'));}}}}else if(_0x2cf27b[_0xaa24('0x110')]){_0x1fad95=_0x2cf27b[_0xaa24('0x110')];}else{return this['channel'][_0xaa24('0x30')](_0x2cf27b,_0xaa24('0x111'));}var _0x42b4cf=this[_0xaa24('0x10')][_0xaa24('0x5b')]('DIAL',[util[_0xaa24('0x2d')](_0xaa24('0x112'),_0x1fad95,_0x2cf27b[_0xaa24('0xc5')]),_0x2cf27b[_0xaa24('0x6a')],_0x2cf27b[_0xaa24('0xee')],_0x2cf27b['url']]);if(_0x42b4cf['result']===-0x1){return _0x42b4cf;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0xef'),_0xaa24('0xec')));};AGIVertices['prototype'][_0xaa24('0x113')]=function(_0x53219d){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x114'),_0x53219d[_0xaa24('0x3c')]));return this['channel']['noop'](_0xaa24('0x113'));};AGIVertices[_0xaa24('0x13')][_0xaa24('0xe')]=function(_0x54765e){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x115'),_0x54765e[_0xaa24('0x3c')]));if(_0x54765e[_0xaa24('0x116')]===0x0){return this[_0xaa24('0xaa')](_0x54765e);}_0x54765e[_0xaa24('0x116')]-=0x1;if(!this[_0xaa24('0xa8')](_0x54765e[_0xaa24('0x117')])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x54765e,_0xaa24('0x118'));}var _0x2647ab=this[_0xaa24('0x22')][_0xaa24('0xa9')](this,_0x54765e[_0xaa24('0x117')]);if(!_0x2647ab){return this['channel'][_0xaa24('0x30')](_0x54765e,_0xaa24('0x119'));}if(!this['isConfigured'](_0x54765e[_0xaa24('0xde')])){return this[_0xaa24('0x10')]['error'](_0xaa24('0xdf'));}var _0x506fb4=this[_0xaa24('0x10')][_0xaa24('0x11a')](_0x2647ab,_0x54765e[_0xaa24('0x11b')],_0x54765e[_0xaa24('0x11c')]);var _0xcb5d98=_0x506fb4[_0xaa24('0xa6')]?_0x506fb4[_0xaa24('0xa6')]['toString']():'';logger[_0xaa24('0x31')](_0xaa24('0x11d'),JSON[_0xaa24('0x76')](_0x506fb4));if(_0x506fb4[_0xaa24('0xa6')]===-0x1){this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x54765e,_0xcb5d98);return _0x506fb4;}else if(_0x506fb4[_0xaa24('0xa7')]===_0xaa24('0x6a')){_0x506fb4[_0xaa24('0xa6')]=_0xcb5d98['length']>=parseInt(_0x54765e[_0xaa24('0x11e')])?'x':'i';}else{_0x506fb4['result']=_0xcb5d98['length']>=parseInt(_0x54765e[_0xaa24('0x11e')])&&_0xcb5d98['length']<=parseInt(_0x54765e[_0xaa24('0x11c')])?'x':'i';}var _0x468ec2=this[_0xaa24('0x14')][_0xaa24('0xa9')](this,_0x54765e[_0xaa24('0xde')]);if(!_0x468ec2){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x54765e,'no\x20variable\x20found');}this[_0xaa24('0x10')][_0xaa24('0xa3')](_0x468ec2,_0xcb5d98);if(this[_0xaa24('0xa8')](_0x54765e['hiddendigitsnum'])){var _0x2054fe=parseInt(_0x54765e['hiddendigitsnum'],0xa);var _0x38609c=rs[_0xaa24('0x11f')]({'charset':'*','length':_0x2054fe});var _0x15202d=_0xcb5d98[_0xaa24('0xa0')];if(_0x15202d>0x0){if(_0x15202d>_0x2054fe){this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x54765e,_0x54765e[_0xaa24('0x120')]===_0xaa24('0x121')?_0x38609c+_0xcb5d98[_0xaa24('0x122')](_0x2054fe):_0xcb5d98[_0xaa24('0x122')](0x0,_0x15202d-_0x2054fe)+_0x38609c);}else{this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x54765e,rs[_0xaa24('0x11f')]({'charset':'*','length':_0x15202d}));}}else{this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x54765e,'');}}else{this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x54765e,_0xcb5d98);}return _0x506fb4;};AGIVertices[_0xaa24('0x13')][_0xaa24('0xf')]=function(_0xe39592){logger['info'](util['format'](_0xaa24('0x123'),_0xe39592[_0xaa24('0x3c')]));return this['getdigits'](_0xe39592);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x124')]=function(_0x1f41d9){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x125'),_0x1f41d9[_0xaa24('0x3c')]));this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x1f41d9,_0x1f41d9['goalname']);return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x126'),_0x1f41d9[_0xaa24('0x127')]));};AGIVertices['prototype'][_0xaa24('0x128')]=function(_0x2384d8){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2384d8['label']));if(!this['isConfigured'](_0x2384d8[_0xaa24('0x8a')])||!this[_0xaa24('0xa8')](_0x2384d8[_0xaa24('0x8b')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x129'));}if(!this[_0xaa24('0xa8')](_0x2384d8[_0xaa24('0x60')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xae'));}this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x12a'),_0x2384d8[_0xaa24('0x60')]));var _0x26429c=this[_0xaa24('0x89')][_0xaa24('0xa9')](this,_0x2384d8);if(_0x26429c){this['channel'][_0xaa24('0xad')](util['format'](_0xaa24('0x12b'),_0x26429c));var _0x1392f0=this[_0xaa24('0x10')][_0xaa24('0x12c')](_0x26429c);try{fs[_0xaa24('0x12d')](_0x26429c+_0xaa24('0x12e'));}catch(_0x3ea4d0){logger[_0xaa24('0x30')](_0x3ea4d0);}return _0x1392f0;}return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x2384d8,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x1a00ec){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x12f'),_0x1a00ec['label']));if(!this[_0xaa24('0xa8')](_0x1a00ec['aws_access_key_id'])||!this['isConfigured'](_0x1a00ec[_0xaa24('0x8b')])){return this['channel'][_0xaa24('0xad')](_0xaa24('0x129'));}if(!this[_0xaa24('0xa8')](_0x1a00ec[_0xaa24('0x8e')])){return this['channel']['noop'](_0xaa24('0x130'));}if(!this[_0xaa24('0xa8')](_0x1a00ec[_0xaa24('0x60')])){return this[_0xaa24('0x10')]['noop']('no\x20text\x20configured');}this['channel'][_0xaa24('0xf2')]=!![];this[_0xaa24('0x3a')](_0x1a00ec);this[_0xaa24('0x45')](_0x1a00ec[_0xaa24('0x60')],'in','','');this[_0xaa24('0x10')]['noop'](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x1a00ec[_0xaa24('0x60')]));var _0x31ad74=this[_0xaa24('0x8c')][_0xaa24('0xa9')](this,_0x1a00ec);if(_0x31ad74){for(var _0x570b49 in _0x31ad74){if(_0x31ad74[_0xaa24('0x99')](_0x570b49)&&_[_0xaa24('0x9a')](_0x31ad74[_0x570b49])){this[_0xaa24('0x10')]['setVariable'](util[_0xaa24('0x2d')](_0xaa24('0x131'),_0x570b49[_0xaa24('0x6e')]()),_0x31ad74[_0x570b49]);}}if(_[_0xaa24('0x47')](_0x31ad74[_0xaa24('0x7a')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x132'));}else{this[_0xaa24('0x45')](_0x31ad74[_0xaa24('0x7a')],'out','amazonlex','');return this['channel']['noop'](util[_0xaa24('0x2d')]('Amazon\x20Lex\x20Result\x20%s',_0x31ad74['message']));}}return this['channel'][_0xaa24('0x30')](_0x1a00ec,_0xaa24('0x133'));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x134')]=function(_0x16212e){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x135'),_0x16212e['label'],_0x16212e['timeout']));if(!this['isConfigured'](_0x16212e[_0xaa24('0x7d')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0x136'));}var _0x4dbdf4=_0xaa24('0x137');var _0x1a0c94=util[_0xaa24('0x2d')](_0xaa24('0x138'),FILES_PATH,rs[_0xaa24('0x11f')](0x4));var _0x118ec7=util[_0xaa24('0x2d')](_0xaa24('0xa1'),_0x1a0c94,_0x4dbdf4);var _0x1353d6=!![];if(_0x16212e['beep']===_0xaa24('0x139')){_0x1353d6=![];}var _0x3fb6f6=this[_0xaa24('0x10')][_0xaa24('0x13a')](_0x1a0c94,_0x4dbdf4,_0x16212e[_0xaa24('0x13b')],_0x16212e[_0xaa24('0x6a')],undefined,_0x1353d6);if(_0x3fb6f6[_0xaa24('0xa6')]!==-0x1){this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x13c'),_0x118ec7));var _0x2f1370=this[_0xaa24('0x8f')][_0xaa24('0xa9')](this,_0x16212e,_0x118ec7);if(_0x2f1370){for(var _0x498844 in _0x2f1370){if(_0x2f1370['hasOwnProperty'](_0x498844)){this[_0xaa24('0x10')]['setVariable'](util[_0xaa24('0x2d')]('GOOGLE_ASR_%s',_0x498844[_0xaa24('0x6e')]()),_0x2f1370[_0x498844]);}}return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xaa24('0x76')](_0x2f1370)));}}return _0x3fb6f6;};AGIVertices[_0xaa24('0x13')][_0xaa24('0x13d')]=function(_0x5f3565){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x13e'),_0x5f3565['label']));if(!this[_0xaa24('0xa8')](_0x5f3565[_0xaa24('0x92')])){return this[_0xaa24('0x10')][_0xaa24('0xad')]('no\x20appid\x20configured');}if(!this[_0xaa24('0xa8')](_0x5f3565[_0xaa24('0x93')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x13f'));}var _0x351fda=_0xaa24('0x137');var _0x568fe3=util[_0xaa24('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0xaa24('0x11f')](0x4));var _0x27d863=util[_0xaa24('0x2d')]('%s.%s',_0x568fe3,_0x351fda);var _0x54c0a4=!![];if(_0x5f3565[_0xaa24('0x140')]==='NOBEEP'){_0x54c0a4=![];}var _0x4d3d8d=this[_0xaa24('0x10')]['recordFile'](_0x568fe3,_0x351fda,_0x5f3565[_0xaa24('0x13b')],_0x5f3565[_0xaa24('0x6a')],undefined,_0x54c0a4);if(_0x4d3d8d[_0xaa24('0xa6')]!==-0x1){this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('tilde\x20%s\x20file\x20created',_0x27d863));var _0x4e7835=this[_0xaa24('0x91')]['sync'](this,_0x5f3565,_0x27d863);if(_0x4e7835){for(var _0xddec03 in _0x4e7835){if(_0x4e7835['hasOwnProperty'](_0xddec03)){this[_0xaa24('0x10')][_0xaa24('0xa3')](util[_0xaa24('0x2d')]('TILDE_ASR_%s',_0xddec03[_0xaa24('0x6e')]()),_0x4e7835[_0xddec03]);}}return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x141'),JSON[_0xaa24('0x76')](_0x4e7835)));}}return _0x4d3d8d;};AGIVertices[_0xaa24('0x13')][_0xaa24('0x142')]=function(_0x43ef0b){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x143'),_0x43ef0b[_0xaa24('0x3c')]));return this[_0xaa24('0x10')][_0xaa24('0x144')](_0x43ef0b[_0xaa24('0x41')],_0x43ef0b[_0xaa24('0x42')],_0x43ef0b[_0xaa24('0x145')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x146')]=function(_0xefccf7){logger[_0xaa24('0x31')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0xefccf7[_0xaa24('0x3c')]));if(!this['isConfigured'](_0xefccf7[_0xaa24('0x147')])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0xefccf7,_0xaa24('0x148'));}try{var _0x49470a=eval(_0xefccf7[_0xaa24('0x147')])?_0xaa24('0x149'):_0xaa24('0x14a');this[_0xaa24('0x10')][_0xaa24('0xad')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0xefccf7[_0xaa24('0x147')],_0x49470a));return{'code':0xc8,'result':_0x49470a};}catch(_0xf324bc){return{'code':0xc8,'result':_0xaa24('0x14a')};}};AGIVertices[_0xaa24('0x13')][_0xaa24('0x14b')]=function(_0x449a94){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x14c'),_0x449a94[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x449a94[_0xaa24('0x14d')])){return this[_0xaa24('0x10')]['error'](_0x449a94,_0xaa24('0x14e'));}var _0x262d04=this[_0xaa24('0x28')][_0xaa24('0xa9')](this,_0x449a94[_0xaa24('0x14d')]);if(!_0x262d04){return this['channel'][_0xaa24('0x30')](_0x449a94,_0xaa24('0x14f'));}for(var _0x4f4985=0x0;_0x4f4985<_0x262d04[_0xaa24('0xa0')];_0x4f4985+=0x1){var _0x1cc06b=this[_0xaa24('0x10')][_0xaa24('0x14')](util[_0xaa24('0x2d')]('IFTIME(%s?true:false)',_0x262d04[_0x4f4985]));if(_0x1cc06b[_0xaa24('0xa6')]===-0x1){return _0x1cc06b;}logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x150'),_0x262d04[_0x4f4985],_0x1cc06b['extra']));if(_0x1cc06b[_0xaa24('0xa7')]===_0xaa24('0x149')){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x150'),_0x262d04[_0x4f4985],_0xaa24('0x149')));this['channel']['noop'](util[_0xaa24('0x2d')](_0xaa24('0x150'),_0x262d04[_0x4f4985],_0xaa24('0x149')));return{'code':0xc8,'result':_0xaa24('0x149')};}else{logger[_0xaa24('0x31')](util['format']('IFTIME\x20%s\x20%s',_0x262d04[_0x4f4985],_0xaa24('0x14a')));this[_0xaa24('0x10')][_0xaa24('0xad')](util['format']('IFTIME\x20%s\x20%s',_0x262d04[_0x4f4985],_0xaa24('0x14a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xaa24('0x13')][_0xaa24('0x151')]=function(_0xa32015){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x152'),_0xa32015[_0xaa24('0x3c')]));return this[_0xaa24('0x10')][_0xaa24('0x151')]();};AGIVertices[_0xaa24('0x13')][_0xaa24('0x153')]=function(_0x16730d){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x154'),_0x16730d[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x16730d['key'])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x136'));}var _0x150c97='wav';var _0x423e27=util['format'](_0xaa24('0x138'),FILES_PATH,rs[_0xaa24('0x11f')](0x4));var _0x4597b8=util['format'](_0xaa24('0xa1'),_0x423e27,_0x150c97);var _0x15db5d=!![];if(_0x16730d['beep']===_0xaa24('0x139')){_0x15db5d=![];}var _0x22e15f=this[_0xaa24('0x10')][_0xaa24('0x13a')](_0x423e27,_0x150c97,_0x16730d[_0xaa24('0x13b')],_0x16730d[_0xaa24('0x6a')],undefined,_0x15db5d);if(_0x22e15f[_0xaa24('0xa6')]!==-0x1){this[_0xaa24('0x10')][_0xaa24('0xad')](util['format']('ispeech\x20%s\x20file\x20created',_0x4597b8));var _0x168620=this[_0xaa24('0x86')][_0xaa24('0xa9')](this,_0x16730d,_0x4597b8);if(_0x168620){for(var _0x140164 in _0x168620){if(_0x168620[_0xaa24('0x99')](_0x140164)){this['channel'][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0x155'),_0x140164['toUpperCase']()),_0x168620[_0x140164]);}}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x156'),JSON[_0xaa24('0x76')](_0x168620)));}}return _0x22e15f;};AGIVertices[_0xaa24('0x13')][_0xaa24('0x157')]=function(_0x1b06dd){logger['info'](util['format'](_0xaa24('0x158'),_0x1b06dd[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x1b06dd[_0xaa24('0x7d')])){return this['channel'][_0xaa24('0xad')]('no\x20key\x20configured');}if(!this[_0xaa24('0xa8')](_0x1b06dd[_0xaa24('0x60')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xae'));}this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x159'),_0x1b06dd[_0xaa24('0x60')]));var _0x3f4432=this[_0xaa24('0x15a')][_0xaa24('0xa9')](this,_0x1b06dd);if(_0x3f4432){this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x15b'),_0x3f4432));var _0x2e3d53=this[_0xaa24('0x10')][_0xaa24('0x12c')](_0x3f4432,_0x1b06dd[_0xaa24('0x13b')]);try{fs[_0xaa24('0x12d')](_0x3f4432+_0xaa24('0x12e'));}catch(_0x55f44a){logger[_0xaa24('0x30')](_0x55f44a);}return _0x2e3d53;}return this['channel'][_0xaa24('0x30')](_0x1b06dd,_0xaa24('0x15c'));};AGIVertices[_0xaa24('0x13')]['login']=function(_0x55b13e){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x15d'),_0x55b13e[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x55b13e['findBy'])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x55b13e,_0xaa24('0x15e'));}logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xaa24('0x3e')],_0x55b13e[_0xaa24('0x15f')]));var _0x4d1cb2=this[_0xaa24('0x59')][_0xaa24('0xa9')](this,_0x55b13e[_0xaa24('0x15f')]);if(_0x4d1cb2){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x160'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x55b13e[_0xaa24('0x15f')]));this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x160'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x55b13e['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x161'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x55b13e[_0xaa24('0x15f')]));this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x161'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x55b13e[_0xaa24('0x15f')]));return{'code':0xc8,'result':_0xaa24('0x162')};}};AGIVertices['prototype'][_0xaa24('0x163')]=function(_0x33eb3e){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x164'),_0x33eb3e[_0xaa24('0x3c')]));if(!this['isConfigured'](_0x33eb3e[_0xaa24('0x15f')])){return this['channel'][_0xaa24('0x30')](_0x33eb3e,'no\x20find\x20by\x20configured');}logger['info'](util[_0xaa24('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x33eb3e[_0xaa24('0x15f')]));var _0x488396=this[_0xaa24('0x55')][_0xaa24('0xa9')](this,_0x33eb3e[_0xaa24('0x15f')]);if(_0x488396){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x160'),this['channel'][_0xaa24('0x3e')],_0x33eb3e[_0xaa24('0x15f')]));this[_0xaa24('0x10')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xaa24('0x10')]['callerid'],_0x33eb3e[_0xaa24('0x15f')]));return{'code':0xc8,'result':'success'};}else{logger[_0xaa24('0x31')](util['format'](_0xaa24('0x161'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x33eb3e[_0xaa24('0x15f')]));this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xaa24('0x3e')],_0x33eb3e[_0xaa24('0x15f')]));return{'code':0xc8,'result':_0xaa24('0x162')};}};AGIVertices[_0xaa24('0x13')][_0xaa24('0x165')]=function(_0x181354){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x166'),_0x181354[_0xaa24('0x3c')]));if(!this['isConfigured'](_0x181354[_0xaa24('0x167')])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x181354,_0xaa24('0x168'));}this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x169'),_0x181354['operation']));var _0x225c23=eval(_0x181354['operation']);if(!this[_0xaa24('0xa8')](_0x181354[_0xaa24('0xde')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xdf'));}var _0x166ff9=this[_0xaa24('0x14')][_0xaa24('0xa9')](this,_0x181354[_0xaa24('0xde')]);if(!_0x166ff9){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x181354,_0xaa24('0xe0'));}if(_['isArray'](_0x225c23)){var _0x4e74f3=this;_0x225c23[_0xaa24('0xe1')](function(_0xfe8885,_0x52b038){_0x4e74f3[_0xaa24('0x10')][_0xaa24('0xa3')](util[_0xaa24('0x2d')]('%s[%s]',_0x166ff9,_0x52b038),_0xfe8885);});return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0x16a'),_0x166ff9));}else{return this[_0xaa24('0x10')][_0xaa24('0xa3')](_0x166ff9,_0x225c23);}};AGIVertices[_0xaa24('0x13')]['menu']=function(_0x147d24){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x16b'),_0x147d24[_0xaa24('0x3c')]));if(_0x147d24[_0xaa24('0x116')]===0x0){return this[_0xaa24('0xaa')](_0x147d24);}_0x147d24['retry']-=0x1;if(!this['isConfigured'](_0x147d24['file_id'])){return this['channel'][_0xaa24('0x30')](_0x147d24,_0xaa24('0x118'));}var _0x320d01=this['getSound'][_0xaa24('0xa9')](this,_0x147d24['file_id']);if(!_0x320d01){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x147d24,_0xaa24('0x119'));}var _0x4aa668=this[_0xaa24('0x10')][_0xaa24('0x11a')](_0x320d01,_0x147d24['response'],_0x147d24[_0xaa24('0x16c')]);var _0x1d95fb=_0x4aa668[_0xaa24('0xa6')];if(_0x4aa668[_0xaa24('0xa6')]===-0x1){this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x147d24,'-1');return _0x4aa668;}else if(_0x4aa668['extra']==='timeout'){_0x4aa668['result']=_0x4aa668[_0xaa24('0xa6')]['length']>0x0?_0x4aa668['result']:'t';}else if(_[_0xaa24('0x4a')](_0x4aa668[_0xaa24('0xa6')])){_0x4aa668[_0xaa24('0xa6')]='#';_0x1d95fb='#';}if(!this[_0xaa24('0xa8')](_0x147d24[_0xaa24('0xde')])){this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xdf'));}else{var _0x56aa92=this[_0xaa24('0x14')]['sync'](this,_0x147d24['variable_id']);if(!_0x56aa92){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x147d24,_0xaa24('0xe0'));}this['channel'][_0xaa24('0xa3')](_0x56aa92,_0x1d95fb);}this['createSquareDetailsReport'][_0xaa24('0xa9')](this,_0x147d24,_0x1d95fb);return _0x4aa668;};AGIVertices[_0xaa24('0x13')][_0xaa24('0xad')]=function(_0x282b52){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x282b52[_0xaa24('0x3c')]));return this[_0xaa24('0x10')]['noop'](_0x282b52[_0xaa24('0x16d')]||_0x282b52[_0xaa24('0x3c')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x16e')]=function(_0x32b6f4){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x32b6f4['label']));if(!this['isConfigured'](_0x32b6f4['findBy'])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x32b6f4,_0xaa24('0x15e'));}logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x16f'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x32b6f4[_0xaa24('0x15f')]));var _0x44e197=this['getPause'][_0xaa24('0xa9')](this,_0x32b6f4[_0xaa24('0x170')]);var _0x77b291=this[_0xaa24('0x52')][_0xaa24('0xa9')](this,_0x32b6f4[_0xaa24('0x15f')],_0x44e197);if(_0x77b291){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x160'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x32b6f4[_0xaa24('0x15f')]));this[_0xaa24('0x10')]['noop'](util['format'](_0xaa24('0x160'),this[_0xaa24('0x10')]['callerid'],_0x32b6f4[_0xaa24('0x15f')]));return{'code':0xc8,'result':_0xaa24('0x171')};}else{logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x161'),this[_0xaa24('0x10')]['callerid'],_0x32b6f4[_0xaa24('0x15f')]));this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x160'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0x32b6f4[_0xaa24('0x15f')]));return{'code':0xc8,'result':_0xaa24('0x162')};}};AGIVertices[_0xaa24('0x13')][_0xaa24('0x172')]=function(_0xb30a84){logger['info'](util['format'](_0xaa24('0x173'),_0xb30a84[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0xb30a84['file_id'])){return this['channel'][_0xaa24('0x30')](_0xb30a84,_0xaa24('0x118'));}var _0x3dc291=this[_0xaa24('0x22')][_0xaa24('0xa9')](this,_0xb30a84[_0xaa24('0x117')]);if(!_0x3dc291){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0xb30a84,_0xaa24('0x119'));}var _0x31fef8=this[_0xaa24('0x10')]['exec'](_0xaa24('0x174'),[_0x3dc291,_0xb30a84[_0xaa24('0xee')]]);if(_0x31fef8['result']===-0x1){return _0x31fef8;}return this['channel']['noop'](util[_0xaa24('0x2d')](_0xaa24('0xc8'),_0xaa24('0x174'),_0x3dc291));};AGIVertices[_0xaa24('0x13')]['queue']=function(_0x5372cf){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x175'),_0x5372cf[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x5372cf[_0xaa24('0x176')])){return this[_0xaa24('0x10')]['error'](_0x5372cf,_0xaa24('0x177'));}var _0x4785bf='';var _0x325def=parseInt(_0x5372cf[_0xaa24('0x176')],0xa);if(isNaN(_0x325def)){_0x4785bf=_0x5372cf[_0xaa24('0x176')];}else{_0x4785bf=this[_0xaa24('0x16')]['sync'](this,_0x5372cf['queue_id']);if(!_0x4785bf){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x5372cf,_0xaa24('0x178'));}}var _0x224c12='';if(this['isConfigured'](_0x5372cf[_0xaa24('0x117')])){var _0x5a9048=this[_0xaa24('0x22')][_0xaa24('0xa9')](this,_0x5372cf[_0xaa24('0x117')]);if(_0x5a9048){_0x224c12=_0x5a9048;}}this['createSquareDetailsReport']['sync'](this,_0x5372cf,_0x4785bf);if(_0x5372cf['opts'][_0xaa24('0x179')]('x')<0x0){_0x5372cf['opts']+='x';}if(_0x5372cf[_0xaa24('0xee')][_0xaa24('0x179')]('X')<0x0){_0x5372cf[_0xaa24('0xee')]+='X';}this['channel'][_0xaa24('0xa3')](_0xaa24('0x17a'),_0x4785bf?_0x4785bf[_0xaa24('0x17b')]():'');var _0x3a2eee=this['channel'][_0xaa24('0x5b')](_0xaa24('0x17c'),[_0x4785bf,_0x5372cf[_0xaa24('0xee')],_0x5372cf[_0xaa24('0x68')],_0x224c12,_0x5372cf[_0xaa24('0x6a')],_0x5372cf[_0xaa24('0xba')],_0x5372cf[_0xaa24('0x17d')],_0x5372cf[_0xaa24('0x17e')],'',_0x5372cf[_0xaa24('0x17f')]]);if(_0x3a2eee[_0xaa24('0xa6')]===-0x1){return _0x3a2eee;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util['format'](_0xaa24('0xc8'),_0xaa24('0x17c'),_0x4785bf));};AGIVertices['prototype'][_0xaa24('0x180')]=function(_0xb4fefe){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x181'),_0xb4fefe[_0xaa24('0x3c')]));var _0x33ef42=_0xb4fefe[_0xaa24('0x182')]||_0xaa24('0x137');var _0x4d12cd=util[_0xaa24('0x2d')](_0xaa24('0x183'),this[_0xaa24('0x10')][_0xaa24('0x3b')],rs['generate'](0x5));var _0x14323b=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x4d12cd,_0x33ef42);var _0x4dd4e0=util[_0xaa24('0x2d')](_0xaa24('0x138'),FILES_PATH,_0x4d12cd);this['createSquareRecording'][_0xaa24('0xa9')](this,_0xb4fefe,_0x4d12cd,_0x14323b);this[_0xaa24('0x10')]['setVariable']('RECORDING_SAVENAME',_0x4d12cd);logger[_0xaa24('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x4dd4e0,_0x33ef42,_0xb4fefe['escape_digits'],_0xb4fefe['timeout']);return this[_0xaa24('0x10')][_0xaa24('0x13a')](_0x4dd4e0,_0x33ef42,_0xb4fefe[_0xaa24('0x184')],_0xb4fefe[_0xaa24('0x6a')],undefined,!![]);};AGIVertices[_0xaa24('0x13')]['restapi']=function(_0x14eeea){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x185'),_0x14eeea[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x14eeea['url'])){return this[_0xaa24('0x10')][_0xaa24('0xad')]('no\x20url\x20configured');}var _0x486269=this['restAPI']['sync'](this,_0x14eeea);logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x186'),util['inspect'](_0x486269,{'showHidden':![],'depth':null})));if(!this[_0xaa24('0xa8')](_0x14eeea[_0xaa24('0xde')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0x187'));}var _0x19283f=this[_0xaa24('0x14')]['sync'](this,_0x14eeea[_0xaa24('0xde')]);if(!_0x19283f){return this['channel'][_0xaa24('0x30')](_0x14eeea,'no\x20variable\x20found');}this[_0xaa24('0x10')][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0x188'),_0x19283f),_0x486269[_0xaa24('0x79')]?_0x486269[_0xaa24('0x79')]:_0xaa24('0x189'));this[_0xaa24('0x10')][_0xaa24('0xa3')](util[_0xaa24('0x2d')](_0xaa24('0x18a'),_0x19283f),_0x486269[_0xaa24('0x78')]?_0x486269[_0xaa24('0x78')]:'OK');if(_0x486269['body']){try{this['saveRestApiResult'](_0x486269[_0xaa24('0x6f')],_0x19283f);}catch(_0x14ea64){logger['error'](util[_0xaa24('0x2d')](_0xaa24('0x18b'),_0x19283f));}}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xe5'),_0x19283f));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x18c')]=function(_0x4bae50){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x18d'),_0x4bae50[_0xaa24('0x3c')]));return this[_0xaa24('0x10')][_0xaa24('0x18e')](_0x4bae50[_0xaa24('0x18f')][_0xaa24('0x5d')](/\s+/g,''),_0x4bae50['escape_digits']);};AGIVertices[_0xaa24('0x13')]['saynumber']=function(_0x1c45b4){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x190'),_0x1c45b4[_0xaa24('0x3c')]));return this[_0xaa24('0x10')][_0xaa24('0x191')](_0x1c45b4['number'][_0xaa24('0x5d')](/\s+/g,''),_0x1c45b4[_0xaa24('0x184')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x192')]=function(_0x39a7d9){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x39a7d9['label']));return this[_0xaa24('0x10')][_0xaa24('0x193')](_0x39a7d9[_0xaa24('0x60')],_0x39a7d9[_0xaa24('0x184')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x194')]=function(_0x4e5856){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x195'),_0x4e5856['label']));if(!this[_0xaa24('0xa8')](_0x4e5856['account_id'])){return this[_0xaa24('0x10')][_0xaa24('0xad')]('no\x20mail\x20account\x20configured');}var _0x55ba5f=this[_0xaa24('0x26')][_0xaa24('0xa9')](this,_0x4e5856[_0xaa24('0x196')]);if(!_0x55ba5f||!_0x55ba5f[_0xaa24('0x197')]){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x4e5856,_0xaa24('0x198'));}var _0x35f751={'from':util[_0xaa24('0x2d')]('\x22%s\x22\x20<%s>',_0x55ba5f['name'],_0x55ba5f[_0xaa24('0x199')]||_0x55ba5f[_0xaa24('0x197')]['user']),'to':_0x4e5856['to']||'','cc':_0x4e5856['cc']||'','bcc':_0x4e5856['bcc']||'','subject':_0x4e5856['subject'],'html':_0x4e5856['text'],'text':_0x4e5856[_0xaa24('0x60')]};var _0x1f4e58={'tls':{'rejectUnauthorized':![]}};if(_0x55ba5f['Smtp'][_0xaa24('0x19a')]){_0x1f4e58[_0xaa24('0x19a')]=_0x55ba5f[_0xaa24('0x197')][_0xaa24('0x19a')];}else{_0x1f4e58[_0xaa24('0x19b')]=_0x55ba5f['Smtp']['host'];_0x1f4e58[_0xaa24('0x19c')]=_0x55ba5f['Smtp']['port'];_0x1f4e58['secure']=_0x55ba5f[_0xaa24('0x197')]['secure'];}if(_0x55ba5f[_0xaa24('0x197')][_0xaa24('0x19d')]){_0x1f4e58[_0xaa24('0x19e')]={'user':_0x55ba5f[_0xaa24('0x197')][_0xaa24('0x19f')],'pass':_0x55ba5f[_0xaa24('0x197')][_0xaa24('0x1a0')]};}if(this[_0xaa24('0xa8')](_0x4e5856[_0xaa24('0x1a1')])){}logger['debug']('sendMail\x20message',JSON[_0xaa24('0x76')](_0x35f751));this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x4e5856,_0x4e5856[_0xaa24('0x196')]);this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x1a2'),_0x55ba5f[_0xaa24('0x1b')]));this[_0xaa24('0x27')][_0xaa24('0xa9')](this,_0x1f4e58,_0x35f751);return this[_0xaa24('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1a3')]=function(_0x456df3){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1a4'),_0x456df3[_0xaa24('0x3c')]));return this[_0xaa24('0x10')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0xaa24('0x1a5')]=function(_0x49e171){logger['info'](util[_0xaa24('0x2d')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x49e171[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x49e171[_0xaa24('0x1a6')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0x1a7'));}var _0x221782=this[_0xaa24('0x37')][_0xaa24('0xa9')](this,_0x49e171[_0xaa24('0x1a6')]);if(!_0x221782){return this[_0xaa24('0x10')]['error'](_0x49e171,_0xaa24('0x1a8'));}var _0x579bfd={'body':_0x49e171[_0xaa24('0x1a9')],'phone':_0x49e171['to']||'','SmsAccountId':_0x221782['id']};logger[_0xaa24('0xe7')]('sendSMS\x20message',JSON[_0xaa24('0x76')](_0x579bfd));this[_0xaa24('0x3a')]['sync'](this,_0x49e171,_0x49e171[_0xaa24('0x1a6')]);this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x221782['name']));this[_0xaa24('0x39')][_0xaa24('0xa9')](this,_0x579bfd);return this[_0xaa24('0x10')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x4fa883){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1aa'),_0x4fa883[_0xaa24('0x3c')]));if(!this['isConfigured'](_0x4fa883[_0xaa24('0xde')])){return this['channel'][_0xaa24('0x30')](_0x4fa883,'no\x20variable\x20selected');}var _0x26bc5c=this['getVariable'][_0xaa24('0xa9')](this,_0x4fa883['variable_id']);if(!_0x26bc5c){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x4fa883,'no\x20variable\x20found');}return this['channel']['setVariable'](_0x26bc5c,_0x4fa883[_0xaa24('0x1ab')]);};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1ac')]=function(_0x57eef7){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x1ad'),_0x57eef7[_0xaa24('0x3c')]));this['channel']['noop'](_0xaa24('0x1ae'));if(_0x57eef7[_0xaa24('0xbf')]===_0xaa24('0x1af')){this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x1b0'));return this[_0xaa24('0x10')][_0xaa24('0xbf')]();}return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0x1b1'));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1b2')]=function(_0x365eee){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1b3'),_0x365eee[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x365eee[_0xaa24('0x1b4')])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x365eee,_0xaa24('0x1b5'));}var _0x362616=this[_0xaa24('0x19')][_0xaa24('0xa9')](this,_0x365eee[_0xaa24('0x1b4')]);if(!this[_0xaa24('0xa8')](_0x362616)){return this[_0xaa24('0x10')]['error'](_0x365eee,util[_0xaa24('0x2d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x365eee[_0xaa24('0x1b4')]));}if(_0x362616===this['channel'][_0xaa24('0x3d')]){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x365eee,_0xaa24('0x1b6'));}this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x365eee,_0x362616);var _0x2224e7=this['channel'][_0xaa24('0x5b')]('AGI',util['format'](_0xaa24('0x1b7'),config[_0xaa24('0xba')][_0xaa24('0x19b')]||_0xaa24('0x1b8'),_0x362616,this[_0xaa24('0x10')][_0xaa24('0x3d')]));if(_0x2224e7['result']===-0x1){return _0x2224e7;}return this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0xc8'),_0xaa24('0x1b9'),_0x362616));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1ba')]=function(_0x5612e5){logger['info'](util[_0xaa24('0x2d')](_0xaa24('0x1bb'),_0x5612e5[_0xaa24('0x3c')]));var _0x362b82=this[_0xaa24('0x5a')][_0xaa24('0xa9')](this,_0x5612e5['command']);this[_0xaa24('0x3a')][_0xaa24('0xa9')](this,_0x5612e5,_0x5612e5[_0xaa24('0xbb')]);if(this[_0xaa24('0xa8')](_0x5612e5['variable_id'])){var _0x1446e2=this['getVariable'][_0xaa24('0xa9')](this,_0x5612e5[_0xaa24('0xde')]);if(_0x1446e2){this[_0xaa24('0x10')][_0xaa24('0xa3')](_0x1446e2,_0x362b82);return this[_0xaa24('0x10')]['noop'](util[_0xaa24('0x2d')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5612e5[_0xaa24('0xbb')],_0x1446e2));}}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x5612e5[_0xaa24('0xbb')]));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1bc')]=function(_0x38e213){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1bd'),_0x38e213[_0xaa24('0x3c')]));_0x38e213['text']=_0x38e213[_0xaa24('0x60')][_0xaa24('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaa24('0xa8')](_0x38e213['apiKey'])){return this['channel'][_0xaa24('0xad')](_0xaa24('0x1be'));}if(!this[_0xaa24('0xa8')](_0x38e213[_0xaa24('0x60')])){return this[_0xaa24('0x10')]['noop'](_0xaa24('0xae'));}this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x1bf'),_0x38e213[_0xaa24('0x60')]));var _0x4fe253=this[_0xaa24('0x5e')][_0xaa24('0xa9')](this,_0x38e213);if(_0x4fe253){this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x1c0'),_0x4fe253));var _0x1d5b40=this['channel'][_0xaa24('0x12c')](_0x4fe253);try{fs[_0xaa24('0x12d')](_0x4fe253+_0xaa24('0x12e'));}catch(_0x21528f){logger[_0xaa24('0x30')](_0x21528f);}return _0x1d5b40;}return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x38e213,_0xaa24('0x1c1'));};AGIVertices['prototype'][_0xaa24('0x1c2')]=function(_0x44b823){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1c3'),_0x44b823[_0xaa24('0x3c')]));_0x44b823[_0xaa24('0x60')]=_0x44b823[_0xaa24('0x60')][_0xaa24('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaa24('0xa8')](_0x44b823[_0xaa24('0x60')])){return this[_0xaa24('0x10')][_0xaa24('0xad')](_0xaa24('0xae'));}this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x1c4'),_0x44b823[_0xaa24('0x60')]));var _0x5b3c5e=this['googleTTS']['sync'](this,_0x44b823);if(_0x5b3c5e){this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('Google\x20TTS\x20%s\x20file\x20created',_0x5b3c5e));var _0x4dc7c6=this[_0xaa24('0x10')][_0xaa24('0x12c')](_0x5b3c5e);try{fs['unlink'](_0x5b3c5e+'.wav');}catch(_0x3d5fff){logger[_0xaa24('0x30')](_0x3d5fff);}return _0x4dc7c6;}return this[_0xaa24('0x10')]['error'](_0x44b823,_0xaa24('0x1c5'));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1c6')]=function(_0xec7c32){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1c7'),_0xec7c32['label']));if(!this[_0xaa24('0xa8')](_0xec7c32[_0xaa24('0x15f')])){return this['channel'][_0xaa24('0x30')](_0xec7c32,_0xaa24('0x15e'));}logger[_0xaa24('0x31')](util[_0xaa24('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xaa24('0x3e')],_0xec7c32[_0xaa24('0x15f')]));var _0x439128=this['agentUnpause'][_0xaa24('0xa9')](this,_0xec7c32[_0xaa24('0x15f')]);if(_0x439128){logger['info'](util[_0xaa24('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaa24('0x10')]['callerid'],_0xec7c32['findBy']));this['channel'][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x160'),this[_0xaa24('0x10')][_0xaa24('0x3e')],_0xec7c32['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x161'),this[_0xaa24('0x10')]['callerid'],_0xec7c32[_0xaa24('0x15f')]));this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')](_0xaa24('0x161'),this['channel'][_0xaa24('0x3e')],_0xec7c32[_0xaa24('0x15f')]));return{'code':0xc8,'result':_0xaa24('0x162')};}};AGIVertices[_0xaa24('0x13')]['voicemail']=function(_0x5f13af){logger[_0xaa24('0x31')](util[_0xaa24('0x2d')](_0xaa24('0x1c8'),_0x5f13af[_0xaa24('0x3c')]));var _0x4f436c=this[_0xaa24('0x10')]['exec'](_0xaa24('0x1c9'),[_0x5f13af[_0xaa24('0x1ca')],_0x5f13af[_0xaa24('0x7b')]]);if(_0x4f436c[_0xaa24('0xa6')]===-0x1){return _0x4f436c;}return this[_0xaa24('0x10')][_0xaa24('0xad')](util[_0xaa24('0x2d')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x5f13af[_0xaa24('0x1ca')]));};AGIVertices[_0xaa24('0x13')][_0xaa24('0x1cb')]=function(_0x590976){logger[_0xaa24('0x31')](util['format'](_0xaa24('0x1cc'),_0x590976[_0xaa24('0x3c')]));if(!this[_0xaa24('0xa8')](_0x590976['variable_id'])){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x590976,'no\x20variable\x20selected');}var _0x27cafa=this['getVariable'][_0xaa24('0xa9')](this,_0x590976[_0xaa24('0xde')]);if(!_0x27cafa){return this[_0xaa24('0x10')][_0xaa24('0x30')](_0x590976,_0xaa24('0xe0'));}var _0x331039=this[_0xaa24('0x10')]['getVariable'](_0x27cafa);return{'code':0xc8,'result':_0x331039[_0xaa24('0xa7')]?_0x331039[_0xaa24('0xa7')]:'-'};};String[_0xaa24('0x13')]['replaceAll']=function(_0x406e5d,_0x1f289c){return this['split'](_0x406e5d)[_0xaa24('0x1cd')](_0x1f289c);};module[_0xaa24('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b7acf67..8ea527c 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 _0x4417=['util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','prototype','channels','interface','queue','mandatoryDispositionPause','name','QueuePause','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','[%s][HANGUP:LINKEDID]','linkedid','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[ACW][syncAgentRingNoAnswer]\x20%s','exports'];(function(_0x4095b9,_0x17ac01){var _0x3f6909=function(_0x3c3189){while(--_0x3c3189){_0x4095b9['push'](_0x4095b9['shift']());}};_0x3f6909(++_0x17ac01);}(_0x4417,0x1ec));var _0x7441=function(_0x5d0167,_0x1da4b4){_0x5d0167=_0x5d0167-0x0;var _0x4768f7=_0x4417[_0x5d0167];return _0x4768f7;};'use strict';var util=require(_0x7441('0x0'));var _=require(_0x7441('0x1'));var moment=require(_0x7441('0x2'));var ami=require('../ami');var logger=require(_0x7441('0x3'))(_0x7441('0x4'));var RpcUser=require(_0x7441('0x5'));var RpcVoiceAgentReport=require(_0x7441('0x6'));function Acw(_0x451952){this[_0x7441('0x7')]=_0x451952[_0x7441('0x7')];this[_0x7441('0x8')]=_0x451952[_0x7441('0x8')];this[_0x7441('0x9')]=_0x451952[_0x7441('0x9')];this['channels']={};ami['on'](_0x7441('0xa'),this[_0x7441('0xb')][_0x7441('0xc')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x7441('0xc')](this));ami['on'](_0x7441('0xd'),this['syncHangup']['bind'](this));ami['on'](_0x7441('0xe'),this[_0x7441('0xf')][_0x7441('0xc')](this));ami['on']('attendedtransfer',this[_0x7441('0x10')][_0x7441('0xc')](this));ami['on'](_0x7441('0x11'),this['syncBlindTransfer'][_0x7441('0xc')](this));ami['on'](_0x7441('0x12'),this['syncAgentConnectPreview'][_0x7441('0xc')](this));}function getDiff(_0x522ea1){var _0x3b8223=moment()[_0x7441('0x13')](0x0);var _0x7f0aa0=moment(_0x522ea1)[_0x7441('0x13')](0x0);return _0x3b8223[_0x7441('0x14')](_0x7f0aa0,'seconds');}Acw[_0x7441('0x15')]['startAcw']=function(_0x17952b){try{var _0x5c49c7=this;var _0x21e031=this[_0x7441('0x16')][_0x17952b][_0x7441('0x17')];var _0x57aec4=this['channels'][_0x17952b][_0x7441('0x18')];var _0x524401=this[_0x7441('0x7')][_0x57aec4];var _0x224ab8=![];var _0x43ba57='ACW';if(_0x524401['mandatoryDisposition']){if(_0x524401[_0x7441('0x19')]['name']){_0x224ab8=!![];_0x43ba57=_0x524401[_0x7441('0x19')][_0x7441('0x1a')];}}ami['Action']({'action':_0x7441('0x1b'),'interface':_0x21e031,'paused':!![],'reason':_0x43ba57})['then'](function(_0x49aaff){if(_0x5c49c7[_0x7441('0x8')][_0x21e031]){return RpcUser[_0x7441('0x1c')](_0x5c49c7[_0x7441('0x8')][_0x21e031]['id'])['then'](function(_0x4f448e){if(_0x4f448e&&!_0x4f448e[_0x7441('0x1d')]){logger[_0x7441('0x1e')](_0x7441('0x1f'),_0x17952b,_0x21e031,_0x57aec4);var _0x19cbc1=_0x5c49c7[_0x7441('0x16')][_0x17952b][_0x7441('0x20')]&&_0x5c49c7[_0x7441('0x16')][_0x17952b][_0x7441('0x21')]?_0x5c49c7[_0x7441('0x16')][_0x17952b][_0x7441('0x21')]:_0x17952b;return RpcUser[_0x7441('0x22')](_0x5c49c7[_0x7441('0x8')][_0x21e031],_0x43ba57,_0x19cbc1)[_0x7441('0x23')](function(_0x4f1143){if(!_0x224ab8){_0x5c49c7[_0x7441('0x9')][_0x21e031]={};logger[_0x7441('0x1e')](_0x7441('0x24'),_0x17952b,_0x5c49c7[_0x7441('0x7')][_0x57aec4][_0x7441('0x25')],_0x21e031,_0x57aec4);_0x5c49c7[_0x7441('0x9')][_0x21e031][_0x7441('0x26')]=setTimeout(_0x5c49c7[_0x7441('0x27')][_0x7441('0xc')](_0x5c49c7,_0x21e031),_0x5c49c7[_0x7441('0x7')][_0x57aec4][_0x7441('0x25')]*0x3e8);_0x5c49c7[_0x7441('0x9')][_0x21e031]['lastPauseAt']=moment()[_0x7441('0x28')](_0x7441('0x29'));_0x5c49c7['timers'][_0x21e031][_0x7441('0x2a')]=_0x17952b;_0x5c49c7[_0x7441('0x9')][_0x21e031][_0x7441('0x18')]=_0x57aec4;_0x5c49c7['timers'][_0x21e031]['updateAcw']=function(){var _0xbb8926=getDiff(_0x5c49c7[_0x7441('0x9')][_0x21e031][_0x7441('0x2b')]);clearTimeout(_0x5c49c7['timers'][_0x21e031]['timer']);_0x5c49c7[_0x7441('0x9')][_0x21e031][_0x7441('0x26')]=![];RpcVoiceAgentReport[_0x7441('0x2c')]({'acwtime':_0xbb8926},_0x5c49c7['timers'][_0x21e031][_0x7441('0x2a')],_0x21e031)[_0x7441('0x23')](function(_0x1527ee){logger[_0x7441('0x1e')](_0x7441('0x2d'),_0x17952b,_0xbb8926,_0x1527ee);})['catch'](function(_0x327630){logger[_0x7441('0x2e')](_0x7441('0x2f'),_0x17952b,_0x327630);});delete _0x5c49c7['timers'][_0x21e031];};}});}else{logger['info'](_0x7441('0x30'),_0x17952b,_0x21e031,_0x57aec4);}});}})[_0x7441('0x31')](function(_0x134716){logger[_0x7441('0x2e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x17952b,_0x5c49c7[_0x7441('0x7')][_0x57aec4][_0x7441('0x25')],_0x21e031,_0x57aec4);})[_0x7441('0x32')](function(){delete _0x5c49c7['channels'][_0x17952b];});}catch(_0x55a54c){logger[_0x7441('0x2e')]('[ACW][START]\x20%s',_0x55a54c[_0x7441('0x33')]);}};Acw[_0x7441('0x15')]['stopAcw']=function(_0xd88be8){try{var _0x39350c=this;if(_0x39350c[_0x7441('0x9')][_0xd88be8]){_0x39350c[_0x7441('0x9')][_0xd88be8][_0x7441('0x26')]=![];var _0x191487=_0x39350c[_0x7441('0x9')][_0xd88be8][_0x7441('0x2a')];var _0x1fd53e=_0x39350c[_0x7441('0x9')][_0xd88be8][_0x7441('0x18')];var _0x3d1a73=_0x39350c['voiceQueues'][_0x1fd53e][_0x7441('0x25')];logger[_0x7441('0x1e')](_0x7441('0x34'),_0x191487,_0xd88be8);RpcUser[_0x7441('0x35')](this[_0x7441('0x8')][_0xd88be8]);RpcVoiceAgentReport[_0x7441('0x2c')]({'acwtime':_0x3d1a73,'agentacw':!![]},_0x191487,_0xd88be8)[_0x7441('0x23')](function(_0xa78da9){logger[_0x7441('0x1e')](_0x7441('0x2d'),_0x191487,_0x3d1a73,_0xa78da9);})[_0x7441('0x31')](function(_0xf0e116){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x191487,_0xf0e116);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xd88be8);if(_0x39350c[_0x7441('0x9')]){logger[_0x7441('0x1e')](_0x7441('0x36'),JSON[_0x7441('0x37')](_0x39350c[_0x7441('0x9')]));}}}catch(_0x2f24cf){logger[_0x7441('0x2e')](_0x7441('0x38'),_0x2f24cf[_0x7441('0x33')]);}};Acw['prototype'][_0x7441('0xb')]=function(_0x39a55a){try{if(this['voiceQueues'][_0x39a55a[_0x7441('0x18')]]&&(this['voiceQueues'][_0x39a55a[_0x7441('0x18')]][_0x7441('0x4')]||this[_0x7441('0x7')][_0x39a55a['queue']][_0x7441('0x39')])){if(this['agents'][_0x39a55a[_0x7441('0x17')]]){this[_0x7441('0x16')][_0x39a55a[_0x7441('0x2a')]]={'queue':_0x39a55a[_0x7441('0x18')],'interface':_0x39a55a[_0x7441('0x17')],'destlinkedid':_0x39a55a['destlinkedid']};}}}catch(_0x681d93){logger[_0x7441('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x681d93['message']);}};Acw[_0x7441('0x15')][_0x7441('0x3a')]=function(_0x43a9c7){try{if(this[_0x7441('0x7')][_0x43a9c7['queue']]&&(this[_0x7441('0x7')][_0x43a9c7['queue']][_0x7441('0x4')]||this['voiceQueues'][_0x43a9c7['queue']][_0x7441('0x39')])){if(this[_0x7441('0x8')][_0x43a9c7['interface']]){this['channels'][_0x43a9c7[_0x7441('0x2a')]]={'queue':_0x43a9c7['queue'],'interface':_0x43a9c7[_0x7441('0x17')]};}}}catch(_0x45a6a2){logger[_0x7441('0x2e')](_0x7441('0x3b'),_0x45a6a2[_0x7441('0x33')]);}};Acw[_0x7441('0x15')][_0x7441('0x3c')]=function(_0x59a0e2){try{if(this['channels'][_0x59a0e2['uniqueid']]&&_[_0x7441('0x3d')](this['channels'][_0x59a0e2[_0x7441('0x2a')]][_0x7441('0x20')])){logger[_0x7441('0x1e')](_0x7441('0x3e'),_0x59a0e2[_0x7441('0x2a')]);this[_0x7441('0x3f')](_0x59a0e2[_0x7441('0x2a')]);}else if(this[_0x7441('0x16')][_0x59a0e2['linkedid']]&&_['isUndefined'](this[_0x7441('0x16')][_0x59a0e2['linkedid']][_0x7441('0x20')])){logger[_0x7441('0x1e')](_0x7441('0x40'),_0x59a0e2['linkedid']);this[_0x7441('0x3f')](_0x59a0e2[_0x7441('0x41')]);}}catch(_0x6ffdd){logger[_0x7441('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x6ffdd['message']);}};Acw['prototype'][_0x7441('0x42')]=function(_0xc53208){try{if(this[_0x7441('0x16')][_0xc53208['uniqueid']]&&this['channels'][_0xc53208[_0x7441('0x2a')]][_0x7441('0x20')]){logger['info'](_0x7441('0x43'),_0xc53208[_0x7441('0x2a')]);this[_0x7441('0x3f')](_0xc53208[_0x7441('0x2a')]);}else if(this['channels'][_0xc53208[_0x7441('0x41')]]&&this[_0x7441('0x16')][_0xc53208['linkedid']][_0x7441('0x20')]){logger[_0x7441('0x1e')](_0x7441('0x44'),_0xc53208[_0x7441('0x41')]);this[_0x7441('0x3f')](_0xc53208[_0x7441('0x41')]);}}catch(_0x2c1371){logger['error']('[ACW][syncHangup]\x20%s',_0x2c1371[_0x7441('0x33')]);}};Acw[_0x7441('0x15')][_0x7441('0x10')]=function(_0x36dd46){try{if(!_[_0x7441('0x45')](this[_0x7441('0x16')][_0x36dd46[_0x7441('0x46')]])){this[_0x7441('0x3f')](_0x36dd46['transfereeuniqueid']);if(this[_0x7441('0x16')][_0x36dd46[_0x7441('0x47')]]){this['channels'][_0x36dd46[_0x7441('0x47')]][_0x7441('0x20')]=!![];this[_0x7441('0x16')][_0x36dd46[_0x7441('0x48')]]=this['channels'][_0x36dd46[_0x7441('0x47')]];delete this['channels'][_0x36dd46['secondtransfereruniqueid']];}}else if(!_[_0x7441('0x45')](this[_0x7441('0x16')][_0x36dd46[_0x7441('0x48')]])){this[_0x7441('0x3f')](_0x36dd46[_0x7441('0x48')]);if(this[_0x7441('0x16')][_0x36dd46[_0x7441('0x49')]]){this[_0x7441('0x16')][_0x36dd46[_0x7441('0x49')]][_0x7441('0x20')]=!![];this[_0x7441('0x16')][_0x36dd46['transfereeuniqueid']]=this[_0x7441('0x16')][_0x36dd46[_0x7441('0x49')]];delete this[_0x7441('0x16')][_0x36dd46[_0x7441('0x49')]];}}}catch(_0x454b73){logger[_0x7441('0x2e')](_0x7441('0x4a'),_0x454b73[_0x7441('0x33')]);}};Acw['prototype'][_0x7441('0x4b')]=function(_0x30a23b){try{if(this[_0x7441('0x16')][_0x30a23b[_0x7441('0x4c')]]){logger[_0x7441('0x1e')](_0x7441('0x4d'),JSON[_0x7441('0x37')](_0x30a23b[_0x7441('0x4c')]));this[_0x7441('0x3f')](_0x30a23b[_0x7441('0x4c')]);}else if(this[_0x7441('0x16')][_0x30a23b[_0x7441('0x4e')]]){logger[_0x7441('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x30a23b['transfererlinkedid']));this[_0x7441('0x3f')](_0x30a23b[_0x7441('0x4e')]);}}catch(_0x537a69){logger['error'](_0x7441('0x4f'),_0x537a69['message']);}};Acw[_0x7441('0x15')][_0x7441('0xf')]=function(_0x3f6df9){try{if(this[_0x7441('0x7')][_0x3f6df9[_0x7441('0x18')]]&&this['voiceQueues'][_0x3f6df9[_0x7441('0x18')]]['autopause']==='all'){if(this['agents'][_0x3f6df9['interface']]){logger[_0x7441('0x1e')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3f6df9[_0x7441('0x2a')],_0x3f6df9[_0x7441('0x17')],_0x3f6df9[_0x7441('0x18')]);return RpcUser[_0x7441('0x22')](this[_0x7441('0x8')][_0x3f6df9[_0x7441('0x17')]],'Auto-Pause',_0x3f6df9[_0x7441('0x2a')]);}}}catch(_0x25ba90){logger[_0x7441('0x2e')](_0x7441('0x50'),_0x25ba90[_0x7441('0x33')]);}};module[_0x7441('0x51')]=Acw; \ No newline at end of file +var _0x559f=['uniqueid','queue','updateAcw','lastPauseAt','update','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1e7d61,_0x3ef4e2){var _0x675460=function(_0x2b9d53){while(--_0x2b9d53){_0x1e7d61['push'](_0x1e7d61['shift']());}};_0x675460(++_0x3ef4e2);}(_0x559f,0x1bc));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf559('0x0'));var _=require(_0xf559('0x1'));var moment=require('moment');var ami=require(_0xf559('0x2'));var logger=require(_0xf559('0x3'))(_0xf559('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5c028b){this[_0xf559('0x5')]=_0x5c028b[_0xf559('0x5')];this['agents']=_0x5c028b[_0xf559('0x6')];this[_0xf559('0x7')]=_0x5c028b['timers'];this[_0xf559('0x8')]={};ami['on'](_0xf559('0x9'),this[_0xf559('0xa')][_0xf559('0xb')](this));ami['on']('hanguprequest',this[_0xf559('0xc')][_0xf559('0xb')](this));ami['on'](_0xf559('0xd'),this[_0xf559('0xe')][_0xf559('0xb')](this));ami['on'](_0xf559('0xf'),this[_0xf559('0x10')][_0xf559('0xb')](this));ami['on'](_0xf559('0x11'),this[_0xf559('0x12')][_0xf559('0xb')](this));ami['on']('blindtransfer',this[_0xf559('0x13')][_0xf559('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xf559('0xb')](this));}function getDiff(_0x490a5a){var _0x741ca0=moment()['milliseconds'](0x0);var _0x889901=moment(_0x490a5a)['milliseconds'](0x0);return _0x741ca0[_0xf559('0x14')](_0x889901,_0xf559('0x15'));}Acw['prototype'][_0xf559('0x16')]=function(_0x342415){try{var _0x3eac4e=this;var _0x12cf5f=this[_0xf559('0x8')][_0x342415][_0xf559('0x17')];var _0x1b1c46=this[_0xf559('0x8')][_0x342415]['queue'];var _0x15e408=this['voiceQueues'][_0x1b1c46];var _0x21ff35=![];var _0x4577ae=_0xf559('0x18');if(_0x15e408[_0xf559('0x19')]){if(_0x15e408[_0xf559('0x1a')][_0xf559('0x1b')]){_0x21ff35=!![];_0x4577ae=_0x15e408[_0xf559('0x1a')][_0xf559('0x1b')];}}ami['Action']({'action':'QueuePause','interface':_0x12cf5f,'paused':!![],'reason':_0x4577ae})[_0xf559('0x1c')](function(_0x4c9c6e){if(_0x3eac4e['agents'][_0x12cf5f]){return RpcUser['getAgent'](_0x3eac4e[_0xf559('0x6')][_0x12cf5f]['id'])[_0xf559('0x1c')](function(_0x1da6f3){if(_0x1da6f3&&!_0x1da6f3['voicePause']){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x342415,_0x12cf5f,_0x1b1c46);var _0x1bc5f1=_0x3eac4e[_0xf559('0x8')][_0x342415]['attended']&&_0x3eac4e[_0xf559('0x8')][_0x342415][_0xf559('0x1d')]?_0x3eac4e[_0xf559('0x8')][_0x342415][_0xf559('0x1d')]:_0x342415;return RpcUser[_0xf559('0x1e')](_0x3eac4e[_0xf559('0x6')][_0x12cf5f],_0x4577ae,_0x1bc5f1)[_0xf559('0x1c')](function(_0x22bb3e){if(!_0x21ff35){_0x3eac4e[_0xf559('0x7')][_0x12cf5f]={};logger['info'](_0xf559('0x1f'),_0x342415,_0x3eac4e[_0xf559('0x5')][_0x1b1c46]['acwTimeout'],_0x12cf5f,_0x1b1c46);_0x3eac4e[_0xf559('0x7')][_0x12cf5f][_0xf559('0x20')]=setTimeout(_0x3eac4e[_0xf559('0x21')][_0xf559('0xb')](_0x3eac4e,_0x12cf5f),_0x3eac4e[_0xf559('0x5')][_0x1b1c46]['acwTimeout']*0x3e8);_0x3eac4e['timers'][_0x12cf5f]['lastPauseAt']=moment()[_0xf559('0x22')](_0xf559('0x23'));_0x3eac4e['timers'][_0x12cf5f][_0xf559('0x24')]=_0x342415;_0x3eac4e[_0xf559('0x7')][_0x12cf5f][_0xf559('0x25')]=_0x1b1c46;_0x3eac4e[_0xf559('0x7')][_0x12cf5f][_0xf559('0x26')]=function(){var _0x2a3818=getDiff(_0x3eac4e['timers'][_0x12cf5f][_0xf559('0x27')]);clearTimeout(_0x3eac4e[_0xf559('0x7')][_0x12cf5f][_0xf559('0x20')]);_0x3eac4e['timers'][_0x12cf5f]['timer']=![];RpcVoiceAgentReport[_0xf559('0x28')]({'acwtime':_0x2a3818},_0x3eac4e[_0xf559('0x7')][_0x12cf5f][_0xf559('0x24')],_0x12cf5f)[_0xf559('0x1c')](function(_0x48db70){logger[_0xf559('0x29')](_0xf559('0x2a'),_0x342415,_0x2a3818,_0x48db70);})[_0xf559('0x2b')](function(_0x358ce0){logger[_0xf559('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x342415,_0x358ce0);});delete _0x3eac4e[_0xf559('0x7')][_0x12cf5f];};}});}else{logger[_0xf559('0x29')](_0xf559('0x2d'),_0x342415,_0x12cf5f,_0x1b1c46);}});}})[_0xf559('0x2b')](function(_0x190d41){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x342415,_0x3eac4e['voiceQueues'][_0x1b1c46][_0xf559('0x2e')],_0x12cf5f,_0x1b1c46);})['finally'](function(){delete _0x3eac4e['channels'][_0x342415];});}catch(_0x5b4853){logger[_0xf559('0x2c')](_0xf559('0x2f'),_0x5b4853[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0x21')]=function(_0x371170){try{var _0x59f94a=this;if(_0x59f94a[_0xf559('0x7')][_0x371170]){_0x59f94a[_0xf559('0x7')][_0x371170][_0xf559('0x20')]=![];var _0x5744d8=_0x59f94a[_0xf559('0x7')][_0x371170][_0xf559('0x24')];var _0x4c6a26=_0x59f94a[_0xf559('0x7')][_0x371170]['queue'];var _0xc7cd06=_0x59f94a[_0xf559('0x5')][_0x4c6a26]['acwTimeout'];logger[_0xf559('0x29')](_0xf559('0x32'),_0x5744d8,_0x371170);RpcUser[_0xf559('0x33')](this[_0xf559('0x6')][_0x371170]);RpcVoiceAgentReport['update']({'acwtime':_0xc7cd06,'agentacw':!![]},_0x5744d8,_0x371170)[_0xf559('0x1c')](function(_0x163a63){logger['info'](_0xf559('0x2a'),_0x5744d8,_0xc7cd06,_0x163a63);})[_0xf559('0x2b')](function(_0x56c34d){logger[_0xf559('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x5744d8,_0x56c34d);});}else{logger[_0xf559('0x2c')](_0xf559('0x34'),_0x371170);if(_0x59f94a[_0xf559('0x7')]){logger['info'](_0xf559('0x35'),JSON['stringify'](_0x59f94a[_0xf559('0x7')]));}}}catch(_0x26c036){logger['error'](_0xf559('0x36'),_0x26c036[_0xf559('0x30')]);}};Acw[_0xf559('0x31')]['syncAgentConnect']=function(_0x29c5a7){try{if(this[_0xf559('0x5')][_0x29c5a7[_0xf559('0x25')]]&&(this['voiceQueues'][_0x29c5a7['queue']][_0xf559('0x4')]||this[_0xf559('0x5')][_0x29c5a7['queue']]['mandatoryDisposition'])){if(this['agents'][_0x29c5a7[_0xf559('0x17')]]){this[_0xf559('0x8')][_0x29c5a7[_0xf559('0x24')]]={'queue':_0x29c5a7['queue'],'interface':_0x29c5a7[_0xf559('0x17')],'destlinkedid':_0x29c5a7['destlinkedid']};}}}catch(_0x2d32f6){logger[_0xf559('0x2c')](_0xf559('0x37'),_0x2d32f6[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0x38')]=function(_0x249d67){try{if(this[_0xf559('0x5')][_0x249d67['queue']]&&(this[_0xf559('0x5')][_0x249d67[_0xf559('0x25')]][_0xf559('0x4')]||this[_0xf559('0x5')][_0x249d67[_0xf559('0x25')]][_0xf559('0x19')])){if(this[_0xf559('0x6')][_0x249d67[_0xf559('0x17')]]){this[_0xf559('0x8')][_0x249d67['uniqueid']]={'queue':_0x249d67[_0xf559('0x25')],'interface':_0x249d67[_0xf559('0x17')]};}}}catch(_0x27ad23){logger[_0xf559('0x2c')](_0xf559('0x39'),_0x27ad23[_0xf559('0x30')]);}};Acw['prototype']['syncHangupRequest']=function(_0x5a2985){try{if(this[_0xf559('0x8')][_0x5a2985[_0xf559('0x24')]]&&_['isUndefined'](this['channels'][_0x5a2985['uniqueid']][_0xf559('0x3a')])){logger[_0xf559('0x29')](_0xf559('0x3b'),_0x5a2985[_0xf559('0x24')]);this[_0xf559('0x16')](_0x5a2985[_0xf559('0x24')]);}else if(this['channels'][_0x5a2985[_0xf559('0x3c')]]&&_[_0xf559('0x3d')](this['channels'][_0x5a2985[_0xf559('0x3c')]][_0xf559('0x3a')])){logger['info'](_0xf559('0x3e'),_0x5a2985['linkedid']);this['startAcw'](_0x5a2985['linkedid']);}}catch(_0x137db1){logger[_0xf559('0x2c')](_0xf559('0x3f'),_0x137db1[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0xe')]=function(_0x45601d){try{if(this[_0xf559('0x8')][_0x45601d['uniqueid']]&&this[_0xf559('0x8')][_0x45601d[_0xf559('0x24')]][_0xf559('0x3a')]){logger[_0xf559('0x29')](_0xf559('0x40'),_0x45601d[_0xf559('0x24')]);this['startAcw'](_0x45601d['uniqueid']);}else if(this['channels'][_0x45601d[_0xf559('0x3c')]]&&this[_0xf559('0x8')][_0x45601d[_0xf559('0x3c')]]['attended']){logger['info'](_0xf559('0x41'),_0x45601d['linkedid']);this['startAcw'](_0x45601d['linkedid']);}}catch(_0x19559f){logger[_0xf559('0x2c')]('[ACW][syncHangup]\x20%s',_0x19559f[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0x12')]=function(_0x10a322){try{if(!_['isNil'](this[_0xf559('0x8')][_0x10a322[_0xf559('0x42')]])){this[_0xf559('0x16')](_0x10a322[_0xf559('0x42')]);if(this[_0xf559('0x8')][_0x10a322[_0xf559('0x43')]]){this[_0xf559('0x8')][_0x10a322[_0xf559('0x43')]][_0xf559('0x3a')]=!![];this['channels'][_0x10a322[_0xf559('0x44')]]=this[_0xf559('0x8')][_0x10a322[_0xf559('0x43')]];delete this[_0xf559('0x8')][_0x10a322[_0xf559('0x43')]];}}else if(!_[_0xf559('0x45')](this[_0xf559('0x8')][_0x10a322[_0xf559('0x44')]])){this[_0xf559('0x16')](_0x10a322['transfertargetuniqueid']);if(this[_0xf559('0x8')][_0x10a322[_0xf559('0x46')]]){this[_0xf559('0x8')][_0x10a322[_0xf559('0x46')]][_0xf559('0x3a')]=!![];this[_0xf559('0x8')][_0x10a322[_0xf559('0x42')]]=this[_0xf559('0x8')][_0x10a322['origtransfereruniqueid']];delete this[_0xf559('0x8')][_0x10a322['origtransfereruniqueid']];}}}catch(_0x547076){logger[_0xf559('0x2c')]('[ACW][syncAttendedTransfer]\x20%s',_0x547076[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0x13')]=function(_0x25c2db){try{if(this[_0xf559('0x8')][_0x25c2db[_0xf559('0x47')]]){logger[_0xf559('0x29')](_0xf559('0x48'),JSON[_0xf559('0x49')](_0x25c2db[_0xf559('0x47')]));this['startAcw'](_0x25c2db[_0xf559('0x47')]);}else if(this[_0xf559('0x8')][_0x25c2db[_0xf559('0x4a')]]){logger['info'](_0xf559('0x4b'),JSON['stringify'](_0x25c2db[_0xf559('0x4a')]));this[_0xf559('0x16')](_0x25c2db[_0xf559('0x4a')]);}}catch(_0x3adf82){logger['error'](_0xf559('0x4c'),_0x3adf82[_0xf559('0x30')]);}};Acw[_0xf559('0x31')][_0xf559('0x10')]=function(_0xc99159){try{if(this[_0xf559('0x5')][_0xc99159[_0xf559('0x25')]]&&this[_0xf559('0x5')][_0xc99159['queue']]['autopause']===_0xf559('0x4d')){if(this['agents'][_0xc99159['interface']]){logger[_0xf559('0x29')](_0xf559('0x4e'),_0xc99159[_0xf559('0x24')],_0xc99159[_0xf559('0x17')],_0xc99159['queue']);return RpcUser['savePause'](this[_0xf559('0x6')][_0xc99159[_0xf559('0x17')]],_0xf559('0x4f'),_0xc99159['uniqueid']);}}}catch(_0x23ef6e){logger[_0xf559('0x2c')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x23ef6e[_0xf559('0x30')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a20ffd9..c5233c4 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x242f01,_0x15d59e){var _0x2bb519=function(_0x522f90){while(--_0x522f90){_0x242f01['push'](_0x242f01['shift']());}};_0x2bb519(++_0x15d59e);}(_0x757a,0xde));var _0xa757=function(_0x3792fa,_0xb22571){_0x3792fa=_0x3792fa-0x0;var _0x4d3d45=_0x757a[_0x3792fa];return _0x4d3d45;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x5d62bc,_0x598c29){var _0x5577ad=function(_0x4b814f){while(--_0x4b814f){_0x5d62bc['push'](_0x5d62bc['shift']());}};_0x5577ad(++_0x598c29);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5607af9..3c51107 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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x1ab29e,_0x2058bd){var _0x401ea7=function(_0x361cca){while(--_0x361cca){_0x1ab29e['push'](_0x1ab29e['shift']());}};_0x401ea7(++_0x2058bd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2a7192,_0x24a7ab){_0x2a7192=_0x2a7192-0x0;var _0x3b3cda=_0xf4eb[_0x2a7192];return _0x3b3cda;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2fce5e,_0xe6e60){_0x2fce5e=_0x2fce5e-0x0;var _0x5ed2e0=_0x9bde[_0x2fce5e];return _0x5ed2e0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 0d4c610..618eb8e 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ba4=['format','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller'];(function(_0xb926fa,_0x51641b){var _0x230934=function(_0x522aec){while(--_0x522aec){_0xb926fa['push'](_0xb926fa['shift']());}};_0x230934(++_0x51641b);}(_0x5ba4,0x148));var _0x45ba=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5ba4[_0x618414];return _0x21c19a;};'use strict';var util=require(_0x45ba('0x0'));var _=require(_0x45ba('0x1'));var moment=require(_0x45ba('0x2'));function checkNameSurname(_0x5f334d,_0x5c2cfc,_0x2d112b){var _0x194aea='';if(!_['isNil'](_0x5c2cfc)&&_0x45ba('0x3')===typeof _0x5c2cfc){_0x194aea+=_0x5c2cfc;}if(!_[_0x45ba('0x4')](_0x2d112b)&&_0x45ba('0x3')===typeof _0x2d112b){_0x194aea+='\x20'+_0x2d112b;}if(_0x194aea!==''){return _0x194aea;}return _0x5f334d;}function Action(_0x286761,_0x238d60,_0xf8e00d){this[_0x45ba('0x5')]=_0x286761;this[_0x45ba('0x6')]=_0xf8e00d||undefined;this[_0x45ba('0x7')]=checkNameSurname(_0x238d60[_0x45ba('0x8')][_0x45ba('0x9')],_0x238d60['Contact'][_0x45ba('0xa')],_0x238d60['Contact'][_0x45ba('0xb')]);this[_0x45ba('0xc')]=_0x238d60[_0x45ba('0x8')][_0x45ba('0x9')];this[_0x45ba('0xd')]=_0x286761[_0x45ba('0x7')];this[_0x45ba('0xe')]=_0x238d60['active']||![];this[_0x45ba('0xf')]=_0x286761['type'];this[_0x45ba('0x10')]=_0x286761[_0x45ba('0x10')]||0x3;this[_0x45ba('0x11')]=_0x238d60[_0x45ba('0x11')];this[_0x45ba('0x12')]=_0x238d60[_0x45ba('0x12')];this[_0x45ba('0x13')]=_0x238d60[_0x45ba('0x13')];this['countnoanswerretry']=_0x238d60['countnoanswerretry'];this[_0x45ba('0x14')]=_0x238d60[_0x45ba('0x14')];this[_0x45ba('0x15')]=_0x238d60[_0x45ba('0x15')];this[_0x45ba('0x16')]=_0x238d60[_0x45ba('0x16')];this['countmachineretry']=_0x238d60[_0x45ba('0x17')];this[_0x45ba('0x18')]=_0x238d60[_0x45ba('0x18')];this['ContactId']=_0x238d60[_0x45ba('0x19')];this[_0x45ba('0x1a')]=_0x238d60['ListId'];this[_0x45ba('0x1b')]=_0x238d60[_0x45ba('0x1b')];this[_0x45ba('0x1c')]=_0x238d60[_0x45ba('0x1c')];this[_0x45ba('0x1d')]=_0x238d60[_0x45ba('0x1d')];this['idHopper']=_0x238d60['id'];this[_0x45ba('0x1e')]=_0x238d60[_0x45ba('0x8')]['firstName']||'';this[_0x45ba('0x1f')]=moment()['format'](_0x45ba('0x20'));this[_0x45ba('0x21')]=_0x238d60['callback'];this[_0x45ba('0x22')]=_0x238d60[_0x45ba('0x22')];this[_0x45ba('0x23')]=_0x238d60[_0x45ba('0x23')];this['recallme']=_0x238d60[_0x45ba('0x24')];this[_0x45ba('0x25')]='';this[_0x45ba('0x26')]='';}Action['prototype'][_0x45ba('0x27')]=function(){return util[_0x45ba('0x28')]('\x22%s\x22\x20<%s>',this[_0x45ba('0x7')],this['voiceQueue'][_0x45ba('0x29')]>0x0?this['number'][_0x45ba('0x2a')](this[_0x45ba('0x5')][_0x45ba('0x29')]):this[_0x45ba('0xc')]);};Action[_0x45ba('0x2b')][_0x45ba('0x2c')]=function(){return this[_0x45ba('0xd')];};module[_0x45ba('0x2d')]=Action; \ No newline at end of file +var _0x9878=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','substring','prototype','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x43a1ec,_0x194d48){var _0x45766d=function(_0x12d255){while(--_0x12d255){_0x43a1ec['push'](_0x43a1ec['shift']());}};_0x45766d(++_0x194d48);}(_0x9878,0x1e3));var _0x8987=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9878[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8987('0x0'));var _=require(_0x8987('0x1'));var moment=require(_0x8987('0x2'));function checkNameSurname(_0x3b04a1,_0x21ec46,_0xbee334){var _0x517382='';if(!_[_0x8987('0x3')](_0x21ec46)&&_0x8987('0x4')===typeof _0x21ec46){_0x517382+=_0x21ec46;}if(!_['isNil'](_0xbee334)&&'string'===typeof _0xbee334){_0x517382+='\x20'+_0xbee334;}if(_0x517382!==''){return _0x517382;}return _0x3b04a1;}function Action(_0x56f7f2,_0x5a9685,_0xc4dccb){this[_0x8987('0x5')]=_0x56f7f2;this[_0x8987('0x6')]=_0xc4dccb||undefined;this[_0x8987('0x7')]=checkNameSurname(_0x5a9685['Contact']['phone'],_0x5a9685[_0x8987('0x8')]['firstName'],_0x5a9685[_0x8987('0x8')]['lastName']);this[_0x8987('0x9')]=_0x5a9685['Contact'][_0x8987('0xa')];this[_0x8987('0xb')]=_0x56f7f2[_0x8987('0x7')];this[_0x8987('0xc')]=_0x5a9685['active']||![];this[_0x8987('0xd')]=_0x56f7f2['type'];this[_0x8987('0xe')]=_0x56f7f2[_0x8987('0xe')]||0x3;this[_0x8987('0xf')]=_0x5a9685['scheduledat'];this[_0x8987('0x10')]=_0x5a9685['countbusyretry'];this[_0x8987('0x11')]=_0x5a9685['countcongestionretry'];this[_0x8987('0x12')]=_0x5a9685[_0x8987('0x12')];this[_0x8987('0x13')]=_0x5a9685[_0x8987('0x13')];this['countdropretry']=_0x5a9685['countdropretry'];this[_0x8987('0x14')]=_0x5a9685[_0x8987('0x14')];this[_0x8987('0x15')]=_0x5a9685[_0x8987('0x15')];this[_0x8987('0x16')]=_0x5a9685[_0x8987('0x16')];this['ContactId']=_0x5a9685['ContactId'];this[_0x8987('0x17')]=_0x5a9685[_0x8987('0x17')];this[_0x8987('0x18')]=_0x5a9685[_0x8987('0x18')];this[_0x8987('0x19')]=_0x5a9685['VoiceQueueId'];this[_0x8987('0x1a')]=_0x5a9685[_0x8987('0x1a')];this[_0x8987('0x1b')]=_0x5a9685['id'];this[_0x8987('0x1c')]=_0x5a9685[_0x8987('0x8')]['firstName']||'';this[_0x8987('0x1d')]=moment()[_0x8987('0x1e')](_0x8987('0x1f'));this[_0x8987('0x20')]=_0x5a9685['callback'];this[_0x8987('0x21')]=_0x5a9685[_0x8987('0x21')];this[_0x8987('0x22')]=_0x5a9685[_0x8987('0x22')];this[_0x8987('0x23')]=_0x5a9685[_0x8987('0x23')];this[_0x8987('0x24')]='';this[_0x8987('0x25')]='';}Action['prototype'][_0x8987('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x8987('0x27')]>0x0?this[_0x8987('0x9')][_0x8987('0x28')](this[_0x8987('0x5')][_0x8987('0x27')]):this['number']);};Action[_0x8987('0x29')][_0x8987('0x2a')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 30bbe04..6587de8 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fa3=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId'];(function(_0x1494d8,_0x34ffc9){var _0x3c8b8c=function(_0x84b6f1){while(--_0x84b6f1){_0x1494d8['push'](_0x1494d8['shift']());}};_0x3c8b8c(++_0x34ffc9);}(_0x6fa3,0x1dd));var _0x36fa=function(_0x5951a7,_0x24e83f){_0x5951a7=_0x5951a7-0x0;var _0x593dcf=_0x6fa3[_0x5951a7];return _0x593dcf;};'use strict';var util=require(_0x36fa('0x0'));var _=require(_0x36fa('0x1'));var moment=require(_0x36fa('0x2'));function getSeconds(_0xa251e3,_0x565913){var _0x3c0489=moment(_0xa251e3)[_0x36fa('0x3')](0x0);var _0xb1ab79=moment(_0x565913)[_0x36fa('0x3')](0x0);return _0x3c0489['diff'](_0xb1ab79,'seconds');}function AgentComplete(_0x387a8d,_0x4cb359){this[_0x36fa('0x4')]=0x4;this[_0x36fa('0x5')]=_0x36fa('0x6');this[_0x36fa('0x7')]=_0x387a8d['scheduledat'];this[_0x36fa('0x8')]=_0x387a8d[_0x36fa('0x8')];this['campaigntype']=_0x387a8d[_0x36fa('0x8')]===_0x36fa('0x9')?'queue':_0x387a8d[_0x36fa('0x8')];this['countbusyretry']=_0x387a8d[_0x36fa('0xa')];this[_0x36fa('0xb')]=_0x387a8d[_0x36fa('0xb')];this[_0x36fa('0xc')]=_0x387a8d[_0x36fa('0xc')];this[_0x36fa('0xd')]=_0x387a8d[_0x36fa('0xa')]+_0x387a8d[_0x36fa('0xb')]+_0x387a8d[_0x36fa('0xc')]+_0x387a8d[_0x36fa('0xe')]+_0x387a8d[_0x36fa('0xf')]+_0x387a8d[_0x36fa('0x10')]+_0x387a8d[_0x36fa('0x11')]+_0x387a8d[_0x36fa('0x12')];this[_0x36fa('0xe')]=_0x387a8d[_0x36fa('0xe')];this[_0x36fa('0xf')]=_0x387a8d[_0x36fa('0xf')];this['countabandonedretry']=_0x387a8d[_0x36fa('0x10')];this['countmachineretry']=_0x387a8d[_0x36fa('0x11')];this[_0x36fa('0x12')]=_0x387a8d[_0x36fa('0x12')];this[_0x36fa('0x13')]=_0x4cb359['uniqueid'];this['calleridname']=_0x387a8d['name'];this[_0x36fa('0x14')]=_0x387a8d[_0x36fa('0x15')];this[_0x36fa('0x16')]=_0x387a8d[_0x36fa('0x16')];this[_0x36fa('0x17')]=_0x387a8d[_0x36fa('0x17')];this[_0x36fa('0x18')]=_0x387a8d[_0x36fa('0x18')];this[_0x36fa('0x19')]=moment()[_0x36fa('0x1a')](_0x36fa('0x1b'));this['ringtime']=getSeconds(_0x387a8d[_0x36fa('0x17')],_0x387a8d[_0x36fa('0x16')]);this[_0x36fa('0x1c')]=getSeconds(_0x387a8d[_0x36fa('0x18')],_0x387a8d[_0x36fa('0x17')]);this[_0x36fa('0x1d')]=getSeconds(this[_0x36fa('0x19')],_0x387a8d['answertime']);this['queue']=_0x4cb359[_0x36fa('0x1e')];this[_0x36fa('0x1f')]=_0x4cb359[_0x36fa('0x1f')];this['reason']=_0x4cb359[_0x36fa('0x20')];this[_0x36fa('0x21')]=_0x387a8d['callback'];this[_0x36fa('0x22')]=_0x387a8d[_0x36fa('0x22')];this['callbackat']=_0x387a8d[_0x36fa('0x23')];this['recallme']=_0x387a8d['recallme'];this[_0x36fa('0x24')]=_0x387a8d['ContactId'];this[_0x36fa('0x25')]=_0x387a8d[_0x36fa('0x25')];this[_0x36fa('0x26')]=_0x387a8d[_0x36fa('0x26')];this['VoiceQueueId']=_0x387a8d['VoiceQueueId'];this[_0x36fa('0x27')]=_0x387a8d[_0x36fa('0x27')];this[_0x36fa('0x28')]=_0x387a8d[_0x36fa('0x28')]||'';this[_0x36fa('0x29')]=_0x387a8d[_0x36fa('0x29')]||'';}module[_0x36fa('0x2a')]=AgentComplete; \ No newline at end of file +var _0x429d=['statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state'];(function(_0x2b5066,_0x2591ae){var _0x1cd04c=function(_0x3429f7){while(--_0x3429f7){_0x2b5066['push'](_0x2b5066['shift']());}};_0x1cd04c(++_0x2591ae);}(_0x429d,0x1a1));var _0xd429=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x429d[_0x16d10f];return _0x50c823;};'use strict';var util=require(_0xd429('0x0'));var _=require(_0xd429('0x1'));var moment=require('moment');function getSeconds(_0x288545,_0x7b66b3){var _0x51f014=moment(_0x288545)[_0xd429('0x2')](0x0);var _0x3432b6=moment(_0x7b66b3)[_0xd429('0x2')](0x0);return _0x51f014[_0xd429('0x3')](_0x3432b6,_0xd429('0x4'));}function AgentComplete(_0x1a9e30,_0x2545ed){this[_0xd429('0x5')]=0x4;this[_0xd429('0x6')]=_0xd429('0x7');this['scheduledat']=_0x1a9e30[_0xd429('0x8')];this[_0xd429('0x9')]=_0x1a9e30[_0xd429('0x9')];this[_0xd429('0xa')]=_0x1a9e30[_0xd429('0x9')]===_0xd429('0xb')?'queue':_0x1a9e30[_0xd429('0x9')];this[_0xd429('0xc')]=_0x1a9e30[_0xd429('0xc')];this[_0xd429('0xd')]=_0x1a9e30[_0xd429('0xd')];this[_0xd429('0xe')]=_0x1a9e30[_0xd429('0xe')];this['countglobal']=_0x1a9e30['countbusyretry']+_0x1a9e30[_0xd429('0xd')]+_0x1a9e30[_0xd429('0xe')]+_0x1a9e30[_0xd429('0xf')]+_0x1a9e30[_0xd429('0x10')]+_0x1a9e30[_0xd429('0x11')]+_0x1a9e30[_0xd429('0x12')]+_0x1a9e30[_0xd429('0x13')];this['countnosuchnumberretry']=_0x1a9e30[_0xd429('0xf')];this[_0xd429('0x10')]=_0x1a9e30['countdropretry'];this['countabandonedretry']=_0x1a9e30['countabandonedretry'];this['countmachineretry']=_0x1a9e30[_0xd429('0x12')];this[_0xd429('0x13')]=_0x1a9e30[_0xd429('0x13')];this[_0xd429('0x14')]=_0x2545ed['uniqueid'];this[_0xd429('0x15')]=_0x1a9e30[_0xd429('0x16')];this['calleridnum']=_0x1a9e30[_0xd429('0x17')];this[_0xd429('0x18')]=_0x1a9e30[_0xd429('0x18')];this[_0xd429('0x19')]=_0x1a9e30[_0xd429('0x19')];this[_0xd429('0x1a')]=_0x1a9e30['answertime'];this['endtime']=moment()[_0xd429('0x1b')](_0xd429('0x1c'));this[_0xd429('0x1d')]=getSeconds(_0x1a9e30[_0xd429('0x19')],_0x1a9e30[_0xd429('0x18')]);this[_0xd429('0x1e')]=getSeconds(_0x1a9e30[_0xd429('0x1a')],_0x1a9e30[_0xd429('0x19')]);this['talktime']=getSeconds(this[_0xd429('0x1f')],_0x1a9e30[_0xd429('0x1a')]);this[_0xd429('0x20')]=_0x2545ed[_0xd429('0x20')];this[_0xd429('0x21')]=_0x2545ed[_0xd429('0x21')];this['reason']=_0x2545ed[_0xd429('0x22')];this[_0xd429('0x23')]=_0x1a9e30['callback'];this['callbackuniqueid']=_0x1a9e30[_0xd429('0x24')];this[_0xd429('0x25')]=_0x1a9e30[_0xd429('0x25')];this[_0xd429('0x26')]=_0x1a9e30[_0xd429('0x26')];this[_0xd429('0x27')]=_0x1a9e30[_0xd429('0x27')];this['ListId']=_0x1a9e30[_0xd429('0x28')];this[_0xd429('0x29')]=_0x1a9e30['UserId'];this[_0xd429('0x2a')]=_0x1a9e30['VoiceQueueId'];this[_0xd429('0x2b')]=_0x1a9e30['CampaignId'];this[_0xd429('0x2c')]=_0x1a9e30[_0xd429('0x2c')]||'';this['originatecalleridname']=_0x1a9e30[_0xd429('0x2d')]||'';}module[_0xd429('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 7de41c6..29a185c 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1f6=['ListId','UserId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x40162a,_0x265b0c){var _0x488161=function(_0x9307e6){while(--_0x9307e6){_0x40162a['push'](_0x40162a['shift']());}};_0x488161(++_0x265b0c);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xa1f6[_0x3b7a0c];return _0x3bb70f;};'use strict';var util=require(_0x6a1f('0x0'));var _=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));function getSeconds(_0x28788a,_0x198e14){var _0x123ad4=moment(_0x28788a)['milliseconds'](0x0);var _0x52b77b=moment(_0x198e14)['milliseconds'](0x0);return _0x123ad4['diff'](_0x52b77b,'seconds');}function Final(_0xc7a556){this[_0x6a1f('0x3')]=_0xc7a556[_0x6a1f('0x3')];this[_0x6a1f('0x4')]=_0xc7a556[_0x6a1f('0x4')];this[_0x6a1f('0x5')]=_0xc7a556[_0x6a1f('0x5')];this['campaigntype']=_0xc7a556[_0x6a1f('0x5')]===_0x6a1f('0x6')?_0x6a1f('0x7'):_0xc7a556[_0x6a1f('0x5')];this[_0x6a1f('0x8')]=_0xc7a556['countbusyretry'];this[_0x6a1f('0x9')]=_0xc7a556[_0x6a1f('0x9')];this[_0x6a1f('0xa')]=_0xc7a556[_0x6a1f('0xa')];this['countglobal']=_0xc7a556[_0x6a1f('0x8')]+_0xc7a556['countcongestionretry']+_0xc7a556[_0x6a1f('0xa')]+_0xc7a556[_0x6a1f('0xb')]+_0xc7a556[_0x6a1f('0xc')]+_0xc7a556[_0x6a1f('0xd')]+_0xc7a556[_0x6a1f('0xe')]+_0xc7a556[_0x6a1f('0xf')];this[_0x6a1f('0xb')]=_0xc7a556[_0x6a1f('0xb')];this[_0x6a1f('0xc')]=_0xc7a556[_0x6a1f('0xc')];this[_0x6a1f('0xd')]=_0xc7a556[_0x6a1f('0xd')];this[_0x6a1f('0xe')]=_0xc7a556[_0x6a1f('0xe')];this[_0x6a1f('0xf')]=_0xc7a556[_0x6a1f('0xf')];this[_0x6a1f('0x7')]=_0xc7a556[_0x6a1f('0x7')];this[_0x6a1f('0x10')]=_0xc7a556['calleridname'];this[_0x6a1f('0x11')]=_0xc7a556[_0x6a1f('0x11')];this[_0x6a1f('0x12')]=_0xc7a556[_0x6a1f('0x12')];this[_0x6a1f('0x13')]=_0xc7a556[_0x6a1f('0x13')];this[_0x6a1f('0x14')]=_0xc7a556[_0x6a1f('0x13')];this['ringtime']=_0xc7a556[_0x6a1f('0x15')]||0x0;this['holdtime']=_0xc7a556[_0x6a1f('0x16')]||0x0;this[_0x6a1f('0x17')]=_0xc7a556[_0x6a1f('0x17')]||0x0;this[_0x6a1f('0x18')]=_0xc7a556[_0x6a1f('0x18')];this['callbackuniqueid']=_0xc7a556[_0x6a1f('0x19')];this[_0x6a1f('0x1a')]=_0xc7a556[_0x6a1f('0x1a')];this[_0x6a1f('0x1b')]=_0xc7a556[_0x6a1f('0x1b')];this[_0x6a1f('0x1c')]=_0xc7a556[_0x6a1f('0x1c')];this[_0x6a1f('0x1d')]=_0xc7a556['ListId'];this[_0x6a1f('0x1e')]=_0xc7a556[_0x6a1f('0x1e')];this['VoiceQueueId']=_0xc7a556['VoiceQueueId'];this['CampaignId']=_0xc7a556['CampaignId'];this[_0x6a1f('0x1f')]=_0xc7a556['originatecalleridnum']||'';this['originatecalleridname']=_0xc7a556[_0x6a1f('0x20')]||'';}module[_0x6a1f('0x21')]=Final; \ No newline at end of file +var _0xd67b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x34ce41,_0x23352c){var _0x2f263f=function(_0x455b22){while(--_0x455b22){_0x34ce41['push'](_0x34ce41['shift']());}};_0x2f263f(++_0x23352c);}(_0xd67b,0x133));var _0xbd67=function(_0x326a2f,_0x5b4cee){_0x326a2f=_0x326a2f-0x0;var _0x11cbbf=_0xd67b[_0x326a2f];return _0x11cbbf;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var moment=require('moment');function getSeconds(_0x1da24d,_0x280954){var _0x317e33=moment(_0x1da24d)['milliseconds'](0x0);var _0x40e384=moment(_0x280954)['milliseconds'](0x0);return _0x317e33[_0xbd67('0x1')](_0x40e384,'seconds');}function Final(_0x309962){this[_0xbd67('0x2')]=_0x309962[_0xbd67('0x2')];this[_0xbd67('0x3')]=_0x309962[_0xbd67('0x3')];this[_0xbd67('0x4')]=_0x309962[_0xbd67('0x4')];this[_0xbd67('0x5')]=_0x309962[_0xbd67('0x4')]===_0xbd67('0x6')?_0xbd67('0x7'):_0x309962[_0xbd67('0x4')];this[_0xbd67('0x8')]=_0x309962['countbusyretry'];this['countcongestionretry']=_0x309962[_0xbd67('0x9')];this['countnoanswerretry']=_0x309962[_0xbd67('0xa')];this[_0xbd67('0xb')]=_0x309962[_0xbd67('0x8')]+_0x309962[_0xbd67('0x9')]+_0x309962[_0xbd67('0xa')]+_0x309962[_0xbd67('0xc')]+_0x309962[_0xbd67('0xd')]+_0x309962[_0xbd67('0xe')]+_0x309962[_0xbd67('0xf')]+_0x309962[_0xbd67('0x10')];this['countnosuchnumberretry']=_0x309962[_0xbd67('0xc')];this[_0xbd67('0xd')]=_0x309962[_0xbd67('0xd')];this[_0xbd67('0xe')]=_0x309962[_0xbd67('0xe')];this[_0xbd67('0xf')]=_0x309962[_0xbd67('0xf')];this[_0xbd67('0x10')]=_0x309962[_0xbd67('0x10')];this[_0xbd67('0x7')]=_0x309962['queue'];this['calleridname']=_0x309962[_0xbd67('0x11')];this[_0xbd67('0x12')]=_0x309962[_0xbd67('0x12')];this['starttime']=_0x309962[_0xbd67('0x13')];this[_0xbd67('0x14')]=_0x309962[_0xbd67('0x14')];this['endtime']=_0x309962[_0xbd67('0x14')];this['ringtime']=_0x309962[_0xbd67('0x15')]||0x0;this[_0xbd67('0x16')]=_0x309962[_0xbd67('0x16')]||0x0;this['talktime']=_0x309962[_0xbd67('0x17')]||0x0;this[_0xbd67('0x18')]=_0x309962[_0xbd67('0x18')];this[_0xbd67('0x19')]=_0x309962[_0xbd67('0x19')];this[_0xbd67('0x1a')]=_0x309962['callbackat'];this[_0xbd67('0x1b')]=_0x309962[_0xbd67('0x1b')];this[_0xbd67('0x1c')]=_0x309962[_0xbd67('0x1c')];this[_0xbd67('0x1d')]=_0x309962[_0xbd67('0x1d')];this[_0xbd67('0x1e')]=_0x309962[_0xbd67('0x1e')];this[_0xbd67('0x1f')]=_0x309962[_0xbd67('0x1f')];this[_0xbd67('0x20')]=_0x309962['CampaignId'];this[_0xbd67('0x21')]=_0x309962['originatecalleridnum']||'';this[_0xbd67('0x22')]=_0x309962[_0xbd67('0x22')]||'';}module[_0xbd67('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index ee73392..8deb1c3 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x802a=['calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x4c02bc,_0xddb347){var _0x3dfdf4=function(_0x1c511e){while(--_0x1c511e){_0x4c02bc['push'](_0x4c02bc['shift']());}};_0x3dfdf4(++_0xddb347);}(_0x802a,0x164));var _0xa802=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x802a[_0x4e9d3c];return _0x2d0825;};'use strict';var util=require(_0xa802('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x31a184,_0x49e466){var _0x46fce3=moment(_0x31a184)[_0xa802('0x1')](0x0);var _0x469061=moment(_0x49e466)[_0xa802('0x1')](0x0);return _0x46fce3['diff'](_0x469061,_0xa802('0x2'));}function Hangup(_0xad0af5,_0x1253e1){this['state']=0x4;this[_0xa802('0x3')]=_0xa802('0x4');this['scheduledat']=_0xad0af5[_0xa802('0x5')];this[_0xa802('0x6')]=_0xad0af5[_0xa802('0x6')];this[_0xa802('0x7')]=_0xad0af5[_0xa802('0x6')]===_0xa802('0x8')?_0xa802('0x9'):_0xad0af5[_0xa802('0x6')];this['countbusyretry']=_0xad0af5[_0xa802('0xa')];this[_0xa802('0xb')]=_0xad0af5['countcongestionretry'];this[_0xa802('0xc')]=_0xad0af5[_0xa802('0xc')];this[_0xa802('0xd')]=_0xad0af5[_0xa802('0xa')]+_0xad0af5[_0xa802('0xb')]+_0xad0af5[_0xa802('0xc')]+_0xad0af5[_0xa802('0xe')]+_0xad0af5[_0xa802('0xf')]+_0xad0af5[_0xa802('0x10')]+_0xad0af5[_0xa802('0x11')]+_0xad0af5['countagentrejectretry'];this[_0xa802('0xe')]=_0xad0af5[_0xa802('0xe')];this[_0xa802('0xf')]=_0xad0af5[_0xa802('0xf')];this[_0xa802('0x10')]=_0xad0af5['countabandonedretry'];this[_0xa802('0x11')]=_0xad0af5[_0xa802('0x11')];this[_0xa802('0x12')]=_0xad0af5[_0xa802('0x12')];this[_0xa802('0x13')]=_0x1253e1[_0xa802('0x13')];this[_0xa802('0x14')]=_0xad0af5[_0xa802('0x15')];this[_0xa802('0x16')]=_0xad0af5[_0xa802('0x17')];this[_0xa802('0x18')]=_0xad0af5[_0xa802('0x18')];this['responsetime']=_0xad0af5[_0xa802('0x19')];this[_0xa802('0x1a')]=moment()[_0xa802('0x1b')](_0xa802('0x1c'));this[_0xa802('0x1d')]=getSeconds(_0xad0af5['responsetime'],_0xad0af5[_0xa802('0x18')]);this[_0xa802('0x1e')]=0x0;this[_0xa802('0x1f')]=getSeconds(this[_0xa802('0x1a')],_0xad0af5[_0xa802('0x19')]);this[_0xa802('0x9')]=_0xad0af5[_0xa802('0x9')];this['membername']=_0xa802('0x20');this[_0xa802('0x21')]=_0x1253e1['cause-txt'];this['callback']=_0xad0af5['callback'];this['callbackuniqueid']=_0xad0af5['callbackuniqueid'];this[_0xa802('0x22')]=_0xad0af5[_0xa802('0x22')];this[_0xa802('0x23')]=_0xad0af5[_0xa802('0x23')];this[_0xa802('0x24')]=_0xad0af5[_0xa802('0x24')];this[_0xa802('0x25')]=_0xad0af5[_0xa802('0x25')];this[_0xa802('0x26')]=_0xad0af5[_0xa802('0x26')];this[_0xa802('0x27')]=_0xad0af5[_0xa802('0x27')];this['CampaignId']=_0xad0af5[_0xa802('0x28')];}module[_0xa802('0x29')]=Hangup; \ No newline at end of file +var _0x6e69=['calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name'];(function(_0x2c394b,_0x51fc13){var _0x2ef4ee=function(_0x5d3266){while(--_0x5d3266){_0x2c394b['push'](_0x2c394b['shift']());}};_0x2ef4ee(++_0x51fc13);}(_0x6e69,0x70));var _0x96e6=function(_0x5dc373,_0x22faf6){_0x5dc373=_0x5dc373-0x0;var _0x263b56=_0x6e69[_0x5dc373];return _0x263b56;};'use strict';var util=require(_0x96e6('0x0'));var _=require(_0x96e6('0x1'));var moment=require(_0x96e6('0x2'));function getSeconds(_0x42f245,_0x5edb50){var _0x573569=moment(_0x42f245)['milliseconds'](0x0);var _0x587bf0=moment(_0x5edb50)[_0x96e6('0x3')](0x0);return _0x573569[_0x96e6('0x4')](_0x587bf0,_0x96e6('0x5'));}function Hangup(_0x39921e,_0x1dfb69){this[_0x96e6('0x6')]=0x4;this['statedesc']='Answer';this[_0x96e6('0x7')]=_0x39921e[_0x96e6('0x7')];this['type']=_0x39921e[_0x96e6('0x8')];this[_0x96e6('0x9')]=_0x39921e[_0x96e6('0x8')]===_0x96e6('0xa')?_0x96e6('0xb'):_0x39921e['type'];this[_0x96e6('0xc')]=_0x39921e[_0x96e6('0xc')];this['countcongestionretry']=_0x39921e[_0x96e6('0xd')];this['countnoanswerretry']=_0x39921e['countnoanswerretry'];this[_0x96e6('0xe')]=_0x39921e[_0x96e6('0xc')]+_0x39921e[_0x96e6('0xd')]+_0x39921e[_0x96e6('0xf')]+_0x39921e['countnosuchnumberretry']+_0x39921e[_0x96e6('0x10')]+_0x39921e[_0x96e6('0x11')]+_0x39921e[_0x96e6('0x12')]+_0x39921e['countagentrejectretry'];this['countnosuchnumberretry']=_0x39921e[_0x96e6('0x13')];this[_0x96e6('0x10')]=_0x39921e[_0x96e6('0x10')];this['countabandonedretry']=_0x39921e['countabandonedretry'];this['countmachineretry']=_0x39921e[_0x96e6('0x12')];this[_0x96e6('0x14')]=_0x39921e[_0x96e6('0x14')];this[_0x96e6('0x15')]=_0x1dfb69['uniqueid'];this['calleridname']=_0x39921e[_0x96e6('0x16')];this[_0x96e6('0x17')]=_0x39921e[_0x96e6('0x18')];this[_0x96e6('0x19')]=_0x39921e[_0x96e6('0x19')];this['responsetime']=_0x39921e[_0x96e6('0x1a')];this[_0x96e6('0x1b')]=moment()[_0x96e6('0x1c')](_0x96e6('0x1d'));this[_0x96e6('0x1e')]=getSeconds(_0x39921e[_0x96e6('0x1a')],_0x39921e[_0x96e6('0x19')]);this[_0x96e6('0x1f')]=0x0;this[_0x96e6('0x20')]=getSeconds(this[_0x96e6('0x1b')],_0x39921e[_0x96e6('0x1a')]);this[_0x96e6('0xb')]=_0x39921e[_0x96e6('0xb')];this['membername']=_0x96e6('0x21');this['reason']=_0x1dfb69[_0x96e6('0x22')];this[_0x96e6('0x23')]=_0x39921e[_0x96e6('0x23')];this[_0x96e6('0x24')]=_0x39921e[_0x96e6('0x24')];this[_0x96e6('0x25')]=_0x39921e['callbackat'];this[_0x96e6('0x26')]=_0x39921e[_0x96e6('0x26')];this[_0x96e6('0x27')]=_0x39921e[_0x96e6('0x27')];this[_0x96e6('0x28')]=_0x39921e['ListId'];this['UserId']=_0x39921e[_0x96e6('0x29')];this[_0x96e6('0x2a')]=_0x39921e[_0x96e6('0x2a')];this[_0x96e6('0x2b')]=_0x39921e['CampaignId'];}module[_0x96e6('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index e18ec5f..fe161b7 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf889=['callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridname','exports','util','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x326318,_0x35715c){var _0x432e29=function(_0x358f34){while(--_0x358f34){_0x326318['push'](_0x326318['shift']());}};_0x432e29(++_0x35715c);}(_0xf889,0x1aa));var _0x9f88=function(_0x4186f6,_0x373c4e){_0x4186f6=_0x4186f6-0x0;var _0x3ee006=_0xf889[_0x4186f6];return _0x3ee006;};'use strict';var util=require(_0x9f88('0x0'));var _=require('lodash');var moment=require(_0x9f88('0x1'));function getSeconds(_0xecacde,_0x30283d){var _0x26a484=moment(_0xecacde)['milliseconds'](0x0);var _0x4d98e5=moment(_0x30283d)['milliseconds'](0x0);return _0x26a484[_0x9f88('0x2')](_0x4d98e5,_0x9f88('0x3'));}function History(_0x30ea14){this['uniqueid']=_0x30ea14[_0x9f88('0x4')];this[_0x9f88('0x5')]=_0x30ea14[_0x9f88('0x5')]||undefined;this[_0x9f88('0x6')]=_0x30ea14[_0x9f88('0x6')];this[_0x9f88('0x7')]=_0x30ea14['type']===_0x9f88('0x8')?_0x9f88('0x9'):_0x30ea14[_0x9f88('0x6')];this[_0x9f88('0xa')]=_0x30ea14['countbusyretry'];this[_0x9f88('0xb')]=_0x30ea14[_0x9f88('0xb')];this[_0x9f88('0xc')]=_0x30ea14['countnoanswerretry'];this[_0x9f88('0xd')]=_0x30ea14[_0x9f88('0xa')]+_0x30ea14['countcongestionretry']+_0x30ea14[_0x9f88('0xc')]+_0x30ea14[_0x9f88('0xe')]+_0x30ea14['countdropretry']+_0x30ea14[_0x9f88('0xf')]+_0x30ea14[_0x9f88('0x10')]+_0x30ea14[_0x9f88('0x11')];this[_0x9f88('0xe')]=_0x30ea14['countnosuchnumberretry'];this[_0x9f88('0x12')]=_0x30ea14[_0x9f88('0x12')];this['countabandonedretry']=_0x30ea14[_0x9f88('0xf')];this[_0x9f88('0x10')]=_0x30ea14[_0x9f88('0x10')];this[_0x9f88('0x11')]=_0x30ea14[_0x9f88('0x11')];this['queue']=_0x30ea14[_0x9f88('0x9')];this['calleridname']=_0x30ea14[_0x9f88('0x13')];this[_0x9f88('0x14')]=_0x30ea14[_0x9f88('0x15')];this[_0x9f88('0x16')]=_0x30ea14[_0x9f88('0x16')];this[_0x9f88('0x17')]=_0x30ea14['responsetime'];this[_0x9f88('0x18')]=_0x30ea14['responsetime'];this[_0x9f88('0x19')]=getSeconds(_0x30ea14[_0x9f88('0x17')],_0x30ea14[_0x9f88('0x16')]);this[_0x9f88('0x1a')]=0x0;this[_0x9f88('0x1b')]=0x0;this['callback']=_0x30ea14[_0x9f88('0x1c')];this[_0x9f88('0x1d')]=_0x30ea14[_0x9f88('0x1d')];this[_0x9f88('0x1e')]=_0x30ea14[_0x9f88('0x1e')];this['recallme']=_0x30ea14[_0x9f88('0x1f')];this[_0x9f88('0x20')]=_0x30ea14['ContactId'];this[_0x9f88('0x21')]=_0x30ea14[_0x9f88('0x21')];this['UserId']=_0x30ea14[_0x9f88('0x22')];this['VoiceQueueId']=_0x30ea14['VoiceQueueId'];this[_0x9f88('0x23')]=_0x30ea14[_0x9f88('0x23')];this['originatecalleridnum']=_0x30ea14['originatecalleridnum']||'';this[_0x9f88('0x24')]=_0x30ea14['originatecalleridname']||'';}module[_0x9f88('0x25')]=History; \ No newline at end of file +var _0x667d=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','starttime'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x667d,0x1cd));var _0xd667=function(_0x10a945,_0x50a103){_0x10a945=_0x10a945-0x0;var _0x44e35a=_0x667d[_0x10a945];return _0x44e35a;};'use strict';var util=require('util');var _=require(_0xd667('0x0'));var moment=require(_0xd667('0x1'));function getSeconds(_0xc21668,_0x39ee27){var _0x1e9974=moment(_0xc21668)[_0xd667('0x2')](0x0);var _0x292f6d=moment(_0x39ee27)[_0xd667('0x2')](0x0);return _0x1e9974['diff'](_0x292f6d,_0xd667('0x3'));}function History(_0x2cc1d4){this['uniqueid']=_0x2cc1d4['uniqueid'];this[_0xd667('0x4')]=_0x2cc1d4['scheduledat']||undefined;this['type']=_0x2cc1d4[_0xd667('0x5')];this[_0xd667('0x6')]=_0x2cc1d4[_0xd667('0x5')]==='outbound'?_0xd667('0x7'):_0x2cc1d4[_0xd667('0x5')];this['countbusyretry']=_0x2cc1d4[_0xd667('0x8')];this['countcongestionretry']=_0x2cc1d4[_0xd667('0x9')];this['countnoanswerretry']=_0x2cc1d4['countnoanswerretry'];this[_0xd667('0xa')]=_0x2cc1d4[_0xd667('0x8')]+_0x2cc1d4[_0xd667('0x9')]+_0x2cc1d4[_0xd667('0xb')]+_0x2cc1d4[_0xd667('0xc')]+_0x2cc1d4['countdropretry']+_0x2cc1d4[_0xd667('0xd')]+_0x2cc1d4[_0xd667('0xe')]+_0x2cc1d4[_0xd667('0xf')];this[_0xd667('0xc')]=_0x2cc1d4[_0xd667('0xc')];this[_0xd667('0x10')]=_0x2cc1d4[_0xd667('0x10')];this[_0xd667('0xd')]=_0x2cc1d4[_0xd667('0xd')];this[_0xd667('0xe')]=_0x2cc1d4['countmachineretry'];this['countagentrejectretry']=_0x2cc1d4[_0xd667('0xf')];this[_0xd667('0x7')]=_0x2cc1d4['queue'];this[_0xd667('0x11')]=_0x2cc1d4[_0xd667('0x12')];this['calleridnum']=_0x2cc1d4['number'];this['starttime']=_0x2cc1d4[_0xd667('0x13')];this[_0xd667('0x14')]=_0x2cc1d4[_0xd667('0x14')];this[_0xd667('0x15')]=_0x2cc1d4[_0xd667('0x14')];this[_0xd667('0x16')]=getSeconds(_0x2cc1d4['responsetime'],_0x2cc1d4['starttime']);this[_0xd667('0x17')]=0x0;this[_0xd667('0x18')]=0x0;this[_0xd667('0x19')]=_0x2cc1d4[_0xd667('0x19')];this['callbackuniqueid']=_0x2cc1d4[_0xd667('0x1a')];this[_0xd667('0x1b')]=_0x2cc1d4['callbackat'];this[_0xd667('0x1c')]=_0x2cc1d4[_0xd667('0x1c')];this['ContactId']=_0x2cc1d4[_0xd667('0x1d')];this[_0xd667('0x1e')]=_0x2cc1d4[_0xd667('0x1e')];this[_0xd667('0x1f')]=_0x2cc1d4['UserId'];this['VoiceQueueId']=_0x2cc1d4[_0xd667('0x20')];this[_0xd667('0x21')]=_0x2cc1d4['CampaignId'];this[_0xd667('0x22')]=_0x2cc1d4['originatecalleridnum']||'';this[_0xd667('0x23')]=_0x2cc1d4[_0xd667('0x23')]||'';}module[_0xd667('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b895415..1fc5fe2 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 _0xc1c4=['type','outbound','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','stringify','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','undefined','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','active','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','countglobal','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Unknow','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','[booked][unlockQueueStatus]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','strategy','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','iftime\x20%s,%s','interval','content','indexOf','true','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','\x5cw{0,','pow','replace','random','match','actionOriginate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','XMD-','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','originate','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','countagentrejectretry','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','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(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startPredictive','ivrOriginated','queueBooked','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','Error','milliseconds','diff','seconds','emit'];(function(_0x57ed42,_0x1eec90){var _0x34f6fb=function(_0x2dd3a6){while(--_0x2dd3a6){_0x57ed42['push'](_0x57ed42['shift']());}};_0x34f6fb(++_0x1eec90);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x358ef6,_0x3328c5){_0x358ef6=_0x358ef6-0x0;var _0x1fe44d=_0xc1c4[_0x358ef6];return _0x1fe44d;};'use strict';var util=require(_0x4c1c('0x0'));var _=require(_0x4c1c('0x1'));var BPromise=require(_0x4c1c('0x2'));var uuid=require(_0x4c1c('0x3'));var moment=require(_0x4c1c('0x4'));var rr=require('rr');var md5=require(_0x4c1c('0x5'));var Redis=require(_0x4c1c('0x6'));var ut=require('../preview/util/util');var config=require(_0x4c1c('0x7'));var logger=require(_0x4c1c('0x8'))(_0x4c1c('0x9'));var loggerBooked=require(_0x4c1c('0x8'))('booked');var loggerPredictive=require(_0x4c1c('0x8'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x4c1c('0xa'));var loggerSyncQueueSummary=require(_0x4c1c('0x8'))('syncQueueSummary');var ami=require(_0x4c1c('0xb'));config[_0x4c1c('0xc')]=_[_0x4c1c('0xd')](config[_0x4c1c('0xc')],{'host':_0x4c1c('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x4c1c('0xf'));var cmHopperHistory=require(_0x4c1c('0x10'));var cmHopperBlack=require(_0x4c1c('0x11'));var voiceQueueRt=require(_0x4c1c('0x12'));var Action=require(_0x4c1c('0x13'));var History=require(_0x4c1c('0x14'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x4c1c('0x15'));var Hangup=require(_0x4c1c('0x16'));var ipAgi=process[_0x4c1c('0x17')][_0x4c1c('0x18')]||_0x4c1c('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x4c1c('0x1a')};var Sequence=function(){};Sequence[_0x4c1c('0x1b')]['enqueue']=function(_0x146b14){this[_0x4c1c('0x1c')]=this[_0x4c1c('0x1c')]?this[_0x4c1c('0x1c')][_0x4c1c('0x1d')](_0x146b14):_0x146b14();};function Dialer(_0x25eec0,_0x457463){this[_0x4c1c('0x1e')]=new Sequence();this[_0x4c1c('0x1f')]=_0x457463;this[_0x4c1c('0x20')]=_0x25eec0[_0x4c1c('0x20')];this['campaigns']=_0x25eec0[_0x4c1c('0x21')];this[_0x4c1c('0x22')]=_0x25eec0[_0x4c1c('0x22')];this[_0x4c1c('0x23')]=_0x25eec0[_0x4c1c('0x23')];this[_0x4c1c('0x24')]=config[_0x4c1c('0x24')]||0x2;this[_0x4c1c('0x25')]={};this[_0x4c1c('0x26')]={};this[_0x4c1c('0x27')]={};this['uniqueId']={};this['optionPredictive']={};this[_0x4c1c('0x28')]={};this['startProgressive']={};this[_0x4c1c('0x29')]={};this[_0x4c1c('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x4c1c('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0x4c1c('0x2c'),this[_0x4c1c('0x2d')][_0x4c1c('0x2e')](this));ami['on'](_0x4c1c('0x2f'),this[_0x4c1c('0x30')]['bind'](this));ami['on'](_0x4c1c('0x31'),this[_0x4c1c('0x32')][_0x4c1c('0x2e')](this));ami['on'](_0x4c1c('0x33'),this[_0x4c1c('0x34')]['bind'](this));ami['on']('hangup',this[_0x4c1c('0x35')]['bind'](this));ami['on'](_0x4c1c('0x36'),this['syncNewExten'][_0x4c1c('0x2e')](this));ami['on'](_0x4c1c('0x37'),this[_0x4c1c('0x38')]['bind'](this));ami['on'](_0x4c1c('0x39'),this[_0x4c1c('0x3a')][_0x4c1c('0x2e')](this));ami['on'](_0x4c1c('0x3b'),this[_0x4c1c('0x3c')][_0x4c1c('0x2e')](this));this[_0x4c1c('0x3d')]();this[_0x4c1c('0x3e')]();}function isNotNull(_0x4966a0){return _0x4966a0!==null&&!_['isUndefined'](_0x4966a0);}function checkIsLoggedIn(_0x47bb26,_0x492665){return function(){if(_0x492665<=0x0){_0x47bb26['message']=_0x4c1c('0x3f');throw _0x47bb26[_0x4c1c('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x360999){return _0x360999;}function checkIsActive(_0x83912e,_0x5cbe86){return function(){if(!isActive(_0x5cbe86)){_0x83912e['message']=_0x4c1c('0x41');throw _0x83912e[_0x4c1c('0x40')]+_0x4c1c('0x42');}};}function checkInterval(_0x5cd418){return function(){if(!isNotNull(_0x5cd418['Interval'])){_0x5cd418[_0x4c1c('0x43')]=_0x4c1c('0x44');throw _0x5cd418[_0x4c1c('0x40')]+_0x4c1c('0x45');}if(!isNotNull(_0x5cd418[_0x4c1c('0x46')]['Intervals'])){_0x5cd418[_0x4c1c('0x43')]=_0x4c1c('0x44');throw _0x5cd418['name']+_0x4c1c('0x45');}if(!isNotNull(_[_0x4c1c('0x47')](_0x5cd418['Interval'][_0x4c1c('0x48')]))){_0x5cd418[_0x4c1c('0x43')]=_0x4c1c('0x44');throw _0x5cd418[_0x4c1c('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5e0679,_0x4e0e11,_0x1b773d){return{'action':_0x5e0679,'response':_0x4e0e11,'message':_0x1b773d,'stack':_0x1b773d};}function myreject(_0x14ec9b){return function(_0x222493){return _0x14ec9b(msgResponse('[ifTime][Action]',_0x4c1c('0x49'),JSON['stringify'](_0x222493)));};}function getSeconds(_0x37cf62,_0x214bbf){var _0x259df6=moment(_0x37cf62)[_0x4c1c('0x4a')](0x0);var _0x2191d5=moment(_0x214bbf)[_0x4c1c('0x4a')](0x0);return _0x259df6[_0x4c1c('0x4b')](_0x2191d5,_0x4c1c('0x4c'));}function emit(_0x119238,_0x8e5988,_0x43bb0b){io['to'](_0x119238)[_0x4c1c('0x4d')](_0x8e5988,_0x43bb0b);}function emitVoiceQueueSummary(_0x1d8460){if(_0x1d8460[_0x4c1c('0x4e')]===_0x4c1c('0x4f')){var _0x3c4aad={'id':_0x1d8460['id'],'name':_0x1d8460['name'],'strategy':_0x1d8460['strategy'],'answered':_0x1d8460[_0x4c1c('0x50')],'available':_0x1d8460['available'],'loggedIn':_0x1d8460[_0x4c1c('0x51')],'pTalking':_0x1d8460[_0x4c1c('0x52')],'sumBillable':_0x1d8460[_0x4c1c('0x53')],'sumDuration':_0x1d8460[_0x4c1c('0x54')],'sumHoldTime':_0x1d8460['sumHoldTime']||0x0,'talking':_0x1d8460[_0x4c1c('0x55')],'total':_0x1d8460[_0x4c1c('0x56')],'type':_0x1d8460[_0x4c1c('0x4e')],'unmanaged':_0x1d8460['unmanaged'],'abandoned':_0x1d8460[_0x4c1c('0x57')],'waiting':_0x1d8460[_0x4c1c('0x58')],'loggedInDb':_0x1d8460[_0x4c1c('0x59')],'dialActive':_0x1d8460[_0x4c1c('0x5a')],'dialMethod':_0x1d8460[_0x4c1c('0x5b')],'dialOriginateCallerIdName':_0x1d8460[_0x4c1c('0x5c')],'dialOriginateCallerIdNumber':_0x1d8460[_0x4c1c('0x5d')],'dialOriginateTimeout':_0x1d8460[_0x4c1c('0x5e')],'dialPrefix':_0x1d8460['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1d8460[_0x4c1c('0x5f')],'outboundAnswerCallsDay':_0x1d8460[_0x4c1c('0x60')],'outboundBlacklistCallsDay':_0x1d8460[_0x4c1c('0x61')],'outboundBusyCallsDay':_0x1d8460[_0x4c1c('0x62')],'outboundCongestionCallsDay':_0x1d8460['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1d8460[_0x4c1c('0x63')],'outboundDropCallsDayCallersExit':_0x1d8460[_0x4c1c('0x64')],'outboundDropCallsDayTimeout':_0x1d8460[_0x4c1c('0x65')],'outboundNoAnswerCallsDay':_0x1d8460[_0x4c1c('0x66')],'outboundNoSuchCallsDay':_0x1d8460['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1d8460['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1d8460[_0x4c1c('0x67')],'outboundRejectCallsDay':_0x1d8460['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1d8460[_0x4c1c('0x68')],'predictiveIntervalAnsweredCalls':_0x1d8460[_0x4c1c('0x69')],'predictiveIntervalAvgHoldtime':_0x1d8460[_0x4c1c('0x6a')],'predictiveIntervalAvgTalktime':_0x1d8460['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1d8460[_0x4c1c('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x1d8460[_0x4c1c('0x6c')],'predictiveIntervalErlangCalls':_0x1d8460[_0x4c1c('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d8460['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1d8460[_0x4c1c('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x1d8460[_0x4c1c('0x6f')],'predictiveIntervalPauses':_0x1d8460[_0x4c1c('0x70')],'predictiveIntervalAvailable':_0x1d8460[_0x4c1c('0x71')],'predictiveIntervalTotalCalls':_0x1d8460[_0x4c1c('0x72')],'message':_0x1d8460['message'],'originated':_0x1d8460[_0x4c1c('0x73')],'erlangCalls':_0x1d8460['erlangCalls'],'erlangCallToSecond':_0x1d8460[_0x4c1c('0x74')],'erlangAbandonmentRate':_0x1d8460[_0x4c1c('0x75')],'erlangBusyFactor':_0x1d8460[_0x4c1c('0x76')],'startPredictive':_0x1d8460[_0x4c1c('0x28')],'startProgressive':_0x1d8460[_0x4c1c('0x77')]};if(_0x1d8460['Trunk']){_0x3c4aad[_0x4c1c('0x78')]={'id':_0x1d8460['Trunk']['id'],'name':_0x1d8460['Trunk'][_0x4c1c('0x40')],'active':_0x1d8460[_0x4c1c('0x78')]['active'],'callerid':_0x1d8460[_0x4c1c('0x78')][_0x4c1c('0x79')]};}if(_0x1d8460[_0x4c1c('0x46')]){_0x3c4aad[_0x4c1c('0x46')]={'id':_0x1d8460['Interval']['id'],'name':_0x1d8460[_0x4c1c('0x46')]['name']};}var _0x32117a=md5(JSON[_0x4c1c('0x7a')](_0x3c4aad));if(_0x1d8460[_0x4c1c('0x5')]!==_0x32117a){_0x1d8460[_0x4c1c('0x5')]=_0x32117a;emit(util['format'](_0x4c1c('0x7b'),_0x3c4aad[_0x4c1c('0x40')]),_0x4c1c('0x7c'),_0x3c4aad);}}}function emitCampaignSummary(_0x198242){if(_0x198242['type']==='ivr'){emit(util['format'](_0x4c1c('0x7d'),_0x198242[_0x4c1c('0x40')]),_0x4c1c('0x7e'),_0x198242);}}function checkGetDataPredictive(_0x25377b){if(isNotNull(_0x25377b)&&!_[_0x4c1c('0x47')](_0x25377b)){loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x80'));loggerPredictive[_0x4c1c('0x7f')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25377b[_0x4c1c('0x72')]);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x81'),_0x25377b[_0x4c1c('0x69')]);loggerPredictive[_0x4c1c('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25377b[_0x4c1c('0x6c')]);loggerPredictive['info'](_0x4c1c('0x82'),_0x25377b[_0x4c1c('0x6b')]);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x83'),_0x25377b[_0x4c1c('0x6a')]);loggerPredictive[_0x4c1c('0x7f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25377b['predictiveIntervalAvgTalktime']);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x84'));if(_0x25377b['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x25377b[_0x4c1c('0x85')])&&_0x25377b[_0x4c1c('0x85')]>0x0){return!![];}loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x86'));if(!_[_0x4c1c('0x87')](_0x25377b[_0x4c1c('0x6a')])&&_0x25377b[_0x4c1c('0x6a')]>0x0){return!![];}loggerPredictive[_0x4c1c('0x7f')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x4c1c('0x7f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xbb51f4){return function(_0x5eb415){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x88'),_0x5eb415[_0x4c1c('0x89')]);loggerPredictive[_0x4c1c('0x7f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5eb415['erlangCallToSecond']);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x8a'),_0x5eb415[_0x4c1c('0x75')]);loggerPredictive['info'](_0x4c1c('0x8b'),_0x5eb415[_0x4c1c('0x76')]);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x8a'),_0x5eb415[_0x4c1c('0x75')]);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x84'));_[_0x4c1c('0x8c')](_0xbb51f4,_0x5eb415);};}function getDiff(_0x391051){var _0x3b43db=moment()[_0x4c1c('0x4a')](0x0);var _0x3e38c9=moment(_0x391051)[_0x4c1c('0x4a')](0x0);return _0x3b43db[_0x4c1c('0x4b')](_0x3e38c9,_0x4c1c('0x4c'));}function ifInterval(_0x128834,_0x427b29){if(_['isUndefined'](_0x427b29)){return![];}return getDiff(_0x427b29)<_0x128834*0x3c;}function freeVariablesPredictive(_0x143f27){if(isNotNull(_0x143f27)){if(!_['isUndefined'](_0x143f27['startProgressive'])){_0x143f27['startProgressive']=undefined;loggerPredictive[_0x4c1c('0x7f')](_0x143f27[_0x4c1c('0x40')],_0x4c1c('0x8d'));}if(!_[_0x4c1c('0x87')](_0x143f27[_0x4c1c('0x28')])){_0x143f27[_0x4c1c('0x28')]=undefined;loggerPredictive['info'](_0x143f27[_0x4c1c('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x4c1c('0x87')](_0x143f27[_0x4c1c('0x8e')])){clearInterval(_0x143f27[_0x4c1c('0x8e')]);_0x143f27['handlePredictive']=undefined;loggerPredictive[_0x4c1c('0x7f')](_0x143f27['name'],_0x4c1c('0x8f'));}}}function erlangb(_0x58d0fd,_0x4edc48){if(_0x4edc48===0x0){return 0x0;}var _0x2c8746=0x1;for(var _0xfc3cf8=0x1;_0xfc3cf8<=_0x4edc48;_0xfc3cf8+=0x1){_0x2c8746=0x1+_0x2c8746*_0xfc3cf8/_0x58d0fd;}return 0x1/_0x2c8746;}function isVoiceQueueOutbound(_0x232b01){return _0x232b01===_0x4c1c('0x4f');}function isNotPreview(_0x4641a3){return _0x4641a3!==_0x4c1c('0x1f');}function isCampaignIvr(_0x1a1f22){return _0x1a1f22===_0x4c1c('0x90');}function getCallerId(_0x14b5c9,_0x4fe15a,_0x487b4d){if(!_[_0x4c1c('0x87')](_0x487b4d)&&typeof _0x487b4d===_0x4c1c('0x91')&&!_[_0x4c1c('0x47')](_0x487b4d)){if(!_[_0x4c1c('0x87')](_0x4fe15a)&&typeof _0x4fe15a===_0x4c1c('0x91')&&!_[_0x4c1c('0x47')](_0x4fe15a)){return util[_0x4c1c('0x92')](_0x4c1c('0x93'),_0x4fe15a,_0x487b4d);}return util[_0x4c1c('0x92')](_0x4c1c('0x93'),_0x487b4d,_0x487b4d);}if(!_[_0x4c1c('0x87')](_0x14b5c9)&&typeof _0x14b5c9===_0x4c1c('0x91')&&!_[_0x4c1c('0x47')](_0x14b5c9)){return _0x14b5c9;}return _0x4c1c('0x94');}function loggerCatchQueueSummary(_0x29edfe,_0xf18715){return function(_0x15dfea){freeVariablesPredictive(_0xf18715);emitVoiceQueueSummary(_0xf18715);emitCampaignSummary(_0xf18715);loggerSyncQueueSummary[_0x4c1c('0x95')](_0x29edfe,util[_0x4c1c('0x96')](_0x15dfea,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3bf255,_0x33c228){return function(_0x1bc57b){loggerPredictive['error'](_0x33c228[_0x4c1c('0x40')],_0x3bf255);loggerPredictive[_0x4c1c('0x95')](_0x1bc57b[_0x4c1c('0x97')]);freeVariablesPredictive(_0x33c228);};}function loggerCatch(_0x36608e){return function(_0x2115f4){logger[_0x4c1c('0x95')](_0x36608e,util[_0x4c1c('0x96')](_0x2115f4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4e9c87){return _0x4e9c87&&!_[_0x4c1c('0x87')](_0x4e9c87)&&_0x4e9c87['length']>0x0;}function decremetOriginate(_0x569da7){if(!_[_0x4c1c('0x87')](_0x569da7)&&_0x569da7!==null){if(typeof _0x569da7[_0x4c1c('0x73')]!=='undefined'){if(_0x569da7[_0x4c1c('0x73')]>0x0){_0x569da7[_0x4c1c('0x73')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4c1c('0x95')](_0x4c1c('0x98'));}}function checkContactLowerLimitOriginate(_0x50c8c9,_0x5d12e2,_0x3cb052){if(_0x5d12e2>_0x3cb052){for(var _0x450e40=0x0;_0x450e40<_0x5d12e2-_0x3cb052;_0x450e40+=0x1){decremetOriginate(_0x50c8c9);}}}function loggerGetContactDialer(_0x5b0189,_0x74a3a4,_0x2ac051){return function(_0x5a006b){checkContactLowerLimitOriginate(_0x74a3a4,_0x2ac051,0x0);logger[_0x4c1c('0x95')](_0x5b0189,util[_0x4c1c('0x96')](_0x5a006b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c80fd){return function(_0x2ed3ea){if(isNotNull(_0x2ed3ea)&&isNotNull(_0x2ed3ea[0x0])){if(_0x2ed3ea[0x0][_0x4c1c('0x99')]>0x0){_0x3c80fd['message']=_0x4c1c('0x9a');logger[_0x4c1c('0x7f')](_0x4c1c('0x9b')+_0x3c80fd[_0x4c1c('0x40')],_0x2ed3ea[0x0][_0x4c1c('0x99')],_0x4c1c('0x9c'));}else{_0x3c80fd[_0x4c1c('0x43')]=_0x4c1c('0x9d');logger[_0x4c1c('0x7f')]('[getContactDialer2][Empty]'+_0x3c80fd[_0x4c1c('0x40')]);}}};}function notSendMessagesQueue(_0x5654d9){if(_0x5654d9[_0x4c1c('0x9e')]){freeVariablesPredictive(_0x5654d9);if(_0x5654d9[_0x4c1c('0x73')]===0x0&&_0x5654d9['talking']===0x0&&_0x5654d9[_0x4c1c('0x58')]===0x0&&(_0x5654d9[_0x4c1c('0x52')]||0x0)===0x0){_0x5654d9[_0x4c1c('0x9e')]=![];_0x5654d9[_0x4c1c('0x9f')]=0x0;_0x5654d9[_0x4c1c('0x43')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4c1c('0x95')](_0x4c1c('0xa0'),_0x5654d9['name'],'is\x20not\x20active');}else{_0x5654d9['message']=_0x4c1c('0xa1');loggerSyncQueueSummary['error'](_0x4c1c('0xa0'),_0x5654d9[_0x4c1c('0x40')],_0x4c1c('0xa2'));}emitVoiceQueueSummary(_0x5654d9);}}function notSendMessagesCampaign(_0x36597a){if(_0x36597a['sendMessageOneNotActive']){if(_0x36597a[_0x4c1c('0x73')]===0x0){_0x36597a[_0x4c1c('0x9e')]=![];_0x36597a[_0x4c1c('0x43')]=_0x4c1c('0x41');loggerSyncQueueSummary[_0x4c1c('0x95')](_0x4c1c('0xa3'),_0x36597a[_0x4c1c('0x40')],_0x4c1c('0xa4'));}else{_0x36597a['message']=_0x4c1c('0xa1');loggerSyncQueueSummary[_0x4c1c('0x95')](_0x4c1c('0xa3'),_0x36597a['name'],'is\x20disactive');}emitCampaignSummary(_0x36597a);}}function createObjHistory(_0x2b497a,_0x4ded81,_0xb1e313,_0x2da874,_0x51614a){_0x2b497a[_0x4c1c('0x43')]=_0xb1e313;var _0x113d4b=new Action(_0x2b497a,_0x4ded81);var _0x319dbc=new History(_0x113d4b);_0x319dbc[_0x4c1c('0xa5')]=_0x2da874;_0x319dbc['statedesc']=_0x51614a;_0x319dbc['endtime']=_0x113d4b[_0x4c1c('0xa6')];return _0x319dbc;}Dialer[_0x4c1c('0x1b')][_0x4c1c('0x3e')]=function(){var _0x1284e4=this;setInterval(function(){_0x1284e4[_0x4c1c('0xa7')](_0x1284e4[_0x4c1c('0xa8')],_0x4c1c('0xa9'));_0x1284e4[_0x4c1c('0xa7')](_0x1284e4[_0x4c1c('0x26')],_0x4c1c('0xaa'));},0x32c8);};Dialer[_0x4c1c('0x1b')]['clearZombieChannels']=function(_0x35a816,_0x94a8da){var _0x2deb79=this;for(var _0x1798f9 in _0x35a816){if(typeof _0x35a816[_0x1798f9]!==_0x4c1c('0xab')){this['sequence']['enqueue'](function(){if(!_[_0x4c1c('0xac')](_0x35a816[_0x1798f9])){return ami[_0x4c1c('0xad')]({'action':_0x4c1c('0xae'),'channel':_0x35a816[_0x1798f9][_0x4c1c('0xaf')]})[_0x4c1c('0xb0')](function(_0x2536eb){if(_0x2536eb['message']===_0x4c1c('0xb1')){setTimeout(function(){if(_0x35a816[_0x1798f9]&&_0x35a816[_0x1798f9][_0x4c1c('0x4e')]!==_0x4c1c('0x90')){_0x2deb79[_0x4c1c('0xb2')](_0x2deb79[_0x4c1c('0x20')][_0x35a816[_0x1798f9][_0x4c1c('0xb3')]]);logger[_0x4c1c('0x95')](_0x4c1c('0xb4'),_0x94a8da,_0x1798f9,_0x35a816[_0x1798f9][_0x4c1c('0xb3')]);delete _0x35a816[_0x1798f9];}if(_0x35a816[_0x1798f9]&&_0x35a816[_0x1798f9][_0x4c1c('0x4e')]==='ivr'){_0x2deb79['updateOriginated'](_0x2deb79[_0x4c1c('0x21')][_0x35a816[_0x1798f9][_0x4c1c('0xb3')]]);logger[_0x4c1c('0x95')](_0x4c1c('0xb5'),_0x94a8da,_0x1798f9,_0x35a816[_0x1798f9][_0x4c1c('0xb3')]);delete _0x35a816[_0x1798f9];}},0x2328);}});}});}}};Dialer['prototype'][_0x4c1c('0xb6')]=function(_0x1bff9e){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopper[_0x4c1c('0xb6')](_0x1bff9e))[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0xb9')));};Dialer[_0x4c1c('0x1b')]['checkIsBlackList']=function(_0x305348){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopperBlack[_0x4c1c('0xba')](_0x305348))[_0x4c1c('0xb0')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x4c1c('0x1b')]['checkIsBlackListIvr']=function(_0x46363f){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopperBlack[_0x4c1c('0xbb')](_0x46363f))[_0x4c1c('0xb0')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xbc')]=function(_0x3d4de6){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopperHistory[_0x4c1c('0xbd')](_0x3d4de6))[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0xbe')));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xbf')]=function(_0x5d6362){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopper[_0x4c1c('0xbf')](_0x5d6362))[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0xc0')));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xc1')]=function(_0x5abbaa,_0x416dfe,_0x37297e){return BPromise[_0x4c1c('0xb7')]()['then'](cmHopper[_0x4c1c('0xc1')](_0x5abbaa,_0x416dfe,_0x37297e))[_0x4c1c('0xb0')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xc2')]=function(_0x3e0d49,_0xd6d748,_0xac1afe,_0x32e0c0,_0x5a85a7){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopper['getContactDialer'](_0x3e0d49,_0xd6d748,_0xac1afe,_0x32e0c0))[_0x4c1c('0xb0')](function(_0x5da0a7){_0x5a85a7[_0x4c1c('0xc3')]-=_0xac1afe;_0x5a85a7[_0x4c1c('0xc3')]=_0x5a85a7[_0x4c1c('0xc3')]>0x0?_0x5a85a7[_0x4c1c('0xc3')]:0x0;loggerCatch(_0x4c1c('0xc4'))(_0x5da0a7);});};Dialer['prototype'][_0x4c1c('0xc5')]=function(_0x52ff3e,_0xe8f86,_0x4fdeb1,_0x38c83b){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopper['getContactDialerIvr'](_0x52ff3e,_0xe8f86,_0x4fdeb1))['catch'](function(_0x21b932){_0x38c83b['temp']-=_0xe8f86;_0x38c83b[_0x4c1c('0xc3')]=_0x38c83b['temp']>0x0?_0x38c83b['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x21b932);});};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xc6')]=function(_0xe780bc){return BPromise['resolve']()['then'](voiceQueueRt[_0x4c1c('0xc6')](_0xe780bc))[_0x4c1c('0xb0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xc7')]=function(_0x7760b4){return BPromise[_0x4c1c('0xb7')]()[_0x4c1c('0xb8')](cmHopper[_0x4c1c('0xc7')](_0x7760b4))[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0xc8')));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xc9')]=function(_0x2a42ac){return BPromise['resolve']()[_0x4c1c('0xb8')](cmHopperHistory[_0x4c1c('0xc9')](_0x2a42ac))[_0x4c1c('0xb0')](loggerCatch('[createHistory]\x20'));};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xb2')]=function(_0xb16626){if(!_[_0x4c1c('0x87')](_0xb16626)&&_0xb16626!==null){if(typeof _0xb16626[_0x4c1c('0x73')]!==_0x4c1c('0xab')){if(_0xb16626[_0x4c1c('0x73')]>0x0){_0xb16626[_0x4c1c('0x73')]-=0x1;}else{logger[_0x4c1c('0x95')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x4c1c('0xca'));}};Dialer['prototype'][_0x4c1c('0xcb')]=function(_0x470db0,_0x52210a){var _0xe319ed=this;return function(_0x2af69e){_0xe319ed['updateOriginated'](_0x52210a);logger['error'](_0x470db0,util[_0x4c1c('0x96')](_0x2af69e,{'showHidden':![],'depth':null}));};};Dialer[_0x4c1c('0x1b')]['emptyContact']=function(_0x43fb1c,_0x164a2b,_0x4f7cc8){var _0x4fe1ed={'state':0x19,'statedesc':_0x4c1c('0xcc')};this['updateOriginated'](_0x164a2b);this[_0x4c1c('0xcd')](_[_0x4c1c('0x8c')](_0x4fe1ed,_[_0x4c1c('0xce')](_0x4f7cc8,[_0x4c1c('0xcf'),_0x4c1c('0xd0'),_0x4c1c('0xd1'),_0x4c1c('0xd2'),'CampaignId'])),_0x4c1c('0xd3'),'[emptyContact]');logger[_0x4c1c('0x95')](_0x43fb1c);};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xd4')]=function(_0x1e2812){return _0x1e2812===_0x4c1c('0xd5');};Dialer['prototype'][_0x4c1c('0xd6')]=function(_0x34d311){return!_[_0x4c1c('0x87')](_0x34d311)&&_0x34d311&&!_[_0x4c1c('0x87')](_0x34d311[_0x4c1c('0x40')])&&!_[_0x4c1c('0x87')](_0x34d311[_0x4c1c('0xd7')])&&_0x34d311[_0x4c1c('0xd7')]&&(this[_0x4c1c('0x23')][util['format'](_0x4c1c('0xd8'),_0x34d311['name'])]['status']==='reachable'||this[_0x4c1c('0x23')][util['format']('SIP/%s',_0x34d311['name'])][_0x4c1c('0xae')]==='unmonitored');};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xcd')]=function(_0x29d1e0,_0x30f1a4,_0x104e61){this['createHistory'](_0x29d1e0)[_0x4c1c('0xb0')](loggerCatch(_0x30f1a4));this['moveContactManagedDialer'](_0x29d1e0)[_0x4c1c('0xb0')](loggerCatch(_0x104e61));};Dialer['prototype']['syncVarSet']=function(_0x3c6e31){var _0x5d51ce=this['uniqueId'][_0x3c6e31[_0x4c1c('0xd9')]];var _0x258a0a;if(!_['isNil'](_0x3c6e31)&&!_[_0x4c1c('0xac')](_0x3c6e31[_0x4c1c('0xda')])&&!_[_0x4c1c('0xac')](_0x3c6e31[_0x4c1c('0xda')][_0x4c1c('0xdb')])&&_0x3c6e31[_0x4c1c('0xdc')]===_0x4c1c('0xdd')&&_0x5d51ce){if(_0x5d51ce[_0x4c1c('0x4e')]!==_0x4c1c('0x90')&&this[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0xde')]&&_0x3c6e31[_0x4c1c('0xdf')]===_0x4c1c('0xe0')){delete this['uniqueId'][_0x3c6e31['uniqueid']];this[_0x4c1c('0xb2')](this[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]]);this['voiceQueues'][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x60')]+=0x1;this[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x5f')]+=0x1;_0x258a0a=new Hangup(_0x5d51ce,_0x3c6e31);_0x258a0a[_0x4c1c('0xa5')]=0x12;_0x258a0a['statedesc']='HangupInAMD';_0x258a0a[_0x4c1c('0xe1')]=_0x4c1c('0xe2');ami[_0x4c1c('0x4d')](_0x4c1c('0xe3'),ut[_0x4c1c('0xe4')](_0x258a0a,'amd'));this[_0x4c1c('0xcd')](_0x258a0a,_0x4c1c('0xe5'),_0x4c1c('0xe6'));}if(_0x5d51ce[_0x4c1c('0x4e')]!=='ivr'&&this[_0x4c1c('0x20')][_0x5d51ce['queue']][_0x4c1c('0xde')]&&_0x3c6e31[_0x4c1c('0xdf')]===_0x4c1c('0xe7')){var _0x64259b=this;return new BPromise(function(_0x31bb58,_0x27cce1){delete _0x64259b['uniqueId'][_0x3c6e31[_0x4c1c('0xd9')]];_0x64259b[_0x4c1c('0xb2')](_0x64259b[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]]);_0x64259b[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x60')]+=0x1;_0x64259b[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x5f')]+=0x1;var _0x1647fa=_0x64259b[_0x4c1c('0x20')][_0x5d51ce[_0x4c1c('0xb3')]];var _0x630818=new Hangup(_0x5d51ce,_0x3c6e31);_0x630818[_0x4c1c('0xa5')]=0x13;_0x630818[_0x4c1c('0xe8')]=_0x4c1c('0xe9');_0x630818[_0x4c1c('0xe1')]=_0x4c1c('0xe2');_0x630818['countmachineretry']+=0x1;_0x630818[_0x4c1c('0xea')]+=0x1;_0x630818[_0x4c1c('0xeb')]=!![];ami['emit'](_0x4c1c('0xe3'),ut[_0x4c1c('0xe4')](_0x630818,_0x4c1c('0xeb')));_0x64259b[_0x4c1c('0xc9')](_0x630818)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x630818[_0x4c1c('0xec')]+_0x630818['countcongestionretry']+_0x630818[_0x4c1c('0xed')]+_0x630818[_0x4c1c('0xee')]+_0x630818[_0x4c1c('0xef')]+_0x630818[_0x4c1c('0xf0')]+_0x630818[_0x4c1c('0xf1')]+_0x630818['countagentrejectretry']>=_0x1647fa[_0x4c1c('0xf2')]){_0x64259b[_0x4c1c('0xf3')](_0x630818,_0x31bb58,_0x27cce1,_0x4c1c('0xf4'));}else{if(_0x630818[_0x4c1c('0xf1')]>=_0x1647fa['dialMachineMaxRetry']){_0x64259b[_0x4c1c('0xf5')](_0x630818,_0x31bb58,_0x27cce1,_0x4c1c('0xf6'));}else{_0x64259b[_0x4c1c('0xbf')]({'active':![],'countmachineretry':_0x630818[_0x4c1c('0xf1')],'scheduledat':moment()[_0x4c1c('0xf7')](_0x1647fa[_0x4c1c('0xf8')],_0x4c1c('0xf9'))[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x630818['ContactId'],'ListId':_0x630818[_0x4c1c('0xd0')],'VoiceQueueId':_0x630818['VoiceQueueId']||undefined,'CampaignId':_0x630818[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x31bb58({'reschedule':0x1});}}});}if(_0x5d51ce[_0x4c1c('0x4e')]===_0x4c1c('0x90')&&this[_0x4c1c('0x21')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0xde')]&&_0x3c6e31['value']===_0x4c1c('0xe0')){delete this['uniqueId'][_0x3c6e31['uniqueid']];this['updateOriginated'](this['campaigns'][_0x5d51ce[_0x4c1c('0xb3')]]);_0x258a0a=new Hangup(_0x5d51ce,_0x3c6e31);_0x258a0a[_0x4c1c('0xa5')]=0x12;_0x258a0a[_0x4c1c('0xe8')]=_0x4c1c('0xfc');_0x258a0a[_0x4c1c('0xe1')]=_0x4c1c('0xe2');ami['emit'](_0x4c1c('0xe3'),ut['buildObj'](_0x258a0a,_0x4c1c('0xeb')));this[_0x4c1c('0xcd')](_0x258a0a,_0x4c1c('0xfd'),'[syncHangupInAMDIvr]');}if(_0x5d51ce[_0x4c1c('0x4e')]===_0x4c1c('0x90')&&this[_0x4c1c('0x21')][_0x5d51ce['queue']][_0x4c1c('0xde')]&&_0x3c6e31['value']===_0x4c1c('0xe7')){var _0x64259b=this;return new BPromise(function(_0xb4fdb9,_0x4de982){delete _0x64259b[_0x4c1c('0xa8')][_0x3c6e31['uniqueid']];_0x64259b['updateOriginated'](_0x64259b[_0x4c1c('0x21')][_0x5d51ce[_0x4c1c('0xb3')]]);_0x64259b[_0x4c1c('0x21')][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x60')]+=0x1;_0x64259b['campaigns'][_0x5d51ce[_0x4c1c('0xb3')]][_0x4c1c('0x5f')]+=0x1;var _0x5ceab8=_0x64259b['campaigns'][_0x5d51ce[_0x4c1c('0xb3')]];var _0x161376=new Hangup(_0x5d51ce,_0x3c6e31);_0x161376[_0x4c1c('0xa5')]=0x13;_0x161376[_0x4c1c('0xe8')]=_0x4c1c('0xe9');_0x161376[_0x4c1c('0xe1')]=_0x4c1c('0xe2');_0x161376[_0x4c1c('0xf1')]+=0x1;_0x161376[_0x4c1c('0xea')]+=0x1;_0x161376[_0x4c1c('0xeb')]=!![];ami[_0x4c1c('0x4d')]('custom:amd',ut['buildObj'](_0x161376,_0x4c1c('0xeb')));_0x64259b[_0x4c1c('0xc9')](_0x161376)['catch'](loggerCatch(_0x4c1c('0xfe')));if(_0x161376[_0x4c1c('0xec')]+_0x161376['countcongestionretry']+_0x161376[_0x4c1c('0xed')]+_0x161376[_0x4c1c('0xee')]+_0x161376[_0x4c1c('0xef')]+_0x161376[_0x4c1c('0xf0')]+_0x161376[_0x4c1c('0xf1')]+_0x161376['countagentrejectretry']>=_0x5ceab8[_0x4c1c('0xf2')]){_0x64259b[_0x4c1c('0xf3')](_0x161376,_0xb4fdb9,_0x4de982,_0x4c1c('0xf4'));}else{if(_0x161376[_0x4c1c('0xf1')]>=_0x5ceab8[_0x4c1c('0xff')]){_0x64259b[_0x4c1c('0xf5')](_0x161376,_0xb4fdb9,_0x4de982,_0x4c1c('0xf6'));}else{_0x64259b[_0x4c1c('0xbf')]({'active':![],'countmachineretry':_0x161376[_0x4c1c('0xf1')],'scheduledat':moment()[_0x4c1c('0xf7')](_0x5ceab8[_0x4c1c('0xf8')],_0x4c1c('0xf9'))[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x161376[_0x4c1c('0xcf')],'ListId':_0x161376[_0x4c1c('0xd0')],'VoiceQueueId':_0x161376[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x161376[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0xb4fdb9({'reschedule':0x1});}}});}}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x35')]=function(_0x342903){var _0x15ba75=this[_0x4c1c('0xa8')][_0x342903[_0x4c1c('0xd9')]];var _0x21b92f=this;var _0x31152d;if(_0x15ba75&&_0x15ba75[_0x4c1c('0x4e')]===_0x4c1c('0x90')){delete this[_0x4c1c('0xa8')][_0x342903[_0x4c1c('0xd9')]];this['updateOriginated'](this[_0x4c1c('0x21')][_0x15ba75[_0x4c1c('0xb3')]]);this[_0x4c1c('0x21')][_0x15ba75[_0x4c1c('0xb3')]][_0x4c1c('0x100')]+=0x1;_0x31152d=new Hangup(_0x15ba75,_0x342903);this[_0x4c1c('0xc9')](_0x31152d)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x101')));this[_0x4c1c('0xc7')](_0x31152d)['catch'](loggerCatch(_0x4c1c('0x102')));}if(_0x15ba75&&_0x15ba75[_0x4c1c('0x4e')]!==_0x4c1c('0x90')&&isNotNull(this[_0x4c1c('0x20')][_0x15ba75[_0x4c1c('0xb3')]]['dialQueueProject'])){delete this['uniqueId'][_0x342903['uniqueid']];this[_0x4c1c('0xb2')](this[_0x4c1c('0x20')][_0x15ba75['queue']]);this[_0x4c1c('0x20')][_0x15ba75['queue']][_0x4c1c('0x60')]+=0x1;this[_0x4c1c('0x20')][_0x15ba75[_0x4c1c('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x31152d=new Hangup(_0x15ba75,_0x342903);_0x31152d[_0x4c1c('0xa5')]=0x10;_0x31152d[_0x4c1c('0xe8')]=_0x4c1c('0x103');_0x31152d[_0x4c1c('0xe1')]=_0x4c1c('0x104');this['createHistory'](_0x31152d)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x101')));this[_0x4c1c('0xc7')](_0x31152d)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x15ba75&&_0x15ba75[_0x4c1c('0x4e')]!==_0x4c1c('0x90')&&!isNotNull(this[_0x4c1c('0x20')][_0x15ba75[_0x4c1c('0xb3')]][_0x4c1c('0x105')])){delete this[_0x4c1c('0xa8')][_0x342903['uniqueid']];this[_0x4c1c('0xb2')](this['voiceQueues'][_0x15ba75[_0x4c1c('0xb3')]]);this[_0x4c1c('0x20')][_0x15ba75[_0x4c1c('0xb3')]][_0x4c1c('0x68')]+=0x1;_0x31152d=new Hangup(_0x15ba75,_0x342903);_0x31152d[_0x4c1c('0xa5')]=0xc;_0x31152d[_0x4c1c('0xe8')]=_0x342903['cause-txt'];_0x31152d[_0x4c1c('0xe1')]=_0x4c1c('0x106');this[_0x4c1c('0xc9')](_0x31152d)[_0x4c1c('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4c1c('0xc7')](_0x31152d)['catch'](loggerCatch(_0x4c1c('0x102')));}};Dialer[_0x4c1c('0x1b')]['syncAgentComplete']=function(_0x5ea942){var _0x2e912f=this[_0x4c1c('0xa8')][_0x5ea942[_0x4c1c('0xd9')]];var _0x3629ad=this;if(this[_0x4c1c('0x20')][_0x5ea942[_0x4c1c('0xb3')]]){if(_0x2e912f&&_0x2e912f[_0x4c1c('0x4e')]!==_0x4c1c('0x90')){delete this[_0x4c1c('0xa8')][_0x5ea942['uniqueid']];this[_0x4c1c('0x20')][_0x5ea942[_0x4c1c('0xb3')]]['outboundAnswerCallsDay']+=0x1;var _0x2ed1ee=new AgentComplete(_0x2e912f,_0x5ea942);if(_0x5ea942['reason']==='agent'){_0x2ed1ee['agiafterat']=this[_0x4c1c('0x20')][_0x5ea942[_0x4c1c('0xb3')]][_0x4c1c('0x107')]&&this[_0x4c1c('0x20')][_0x5ea942[_0x4c1c('0xb3')]][_0x4c1c('0x108')]?moment()[_0x4c1c('0x92')](_0x4c1c('0xfa')):undefined;}this['createHistory'](_0x2ed1ee)[_0x4c1c('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x2ed1ee)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x109')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x34ffc1){if(this[_0x4c1c('0x20')][_0x34ffc1[_0x4c1c('0xb3')]]){if(this[_0x4c1c('0xa8')][_0x34ffc1[_0x4c1c('0xd9')]]&&this[_0x4c1c('0xa8')][_0x34ffc1['uniqueid']][_0x4c1c('0x4e')]!==_0x4c1c('0x90')){this[_0x4c1c('0xb2')](this[_0x4c1c('0x20')][_0x34ffc1[_0x4c1c('0xb3')]]);this[_0x4c1c('0xa8')][_0x34ffc1['uniqueid']]['answertime']=moment()[_0x4c1c('0x92')](_0x4c1c('0xfa'));}}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x10a')]=function(_0x5e4756){this[_0x4c1c('0xc9')](_0x5e4756)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x10b')));this['moveContactManagedDialer'](_0x5e4756)[_0x4c1c('0xb0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x4c1c('0x2d')]=function(_0x46feaa){var _0x35662d=this[_0x4c1c('0xa8')][_0x46feaa[_0x4c1c('0xd9')]];var _0x51973b=this;if(this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]]){if(_0x35662d&&_0x35662d['type']!=='ivr'){delete this[_0x4c1c('0xa8')][_0x46feaa[_0x4c1c('0xd9')]];this[_0x4c1c('0xb2')](this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]]);_0x35662d[_0x4c1c('0x10c')]=moment()[_0x4c1c('0x92')](_0x4c1c('0xfa'));var _0x5ec074=new QueueCallerAbandon(_0x35662d,_0x46feaa);if(getSeconds(_0x35662d[_0x4c1c('0x10c')],_0x35662d['responsetime'])>=_0x35662d[_0x4c1c('0x10d')]){this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]][_0x4c1c('0x65')]+=0x1;this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]][_0x4c1c('0x10e')]+=0x1;_0x5ec074['state']=0xa;_0x5ec074['statedesc']='Drop';_0x5ec074[_0x4c1c('0x10f')]='TIMEOUT';_0x5ec074['agiafterat']=this[_0x4c1c('0x20')][_0x46feaa['queue']][_0x4c1c('0x107')]?moment()[_0x4c1c('0x92')](_0x4c1c('0xfa')):undefined;_0x5ec074[_0x4c1c('0xef')]+=0x1;_0x5ec074[_0x4c1c('0xea')]+=0x1;if(_0x5ec074[_0x4c1c('0xef')]>=this['voiceQueues'][_0x46feaa[_0x4c1c('0xb3')]]['dialDropMaxRetry']){this[_0x4c1c('0x10a')](_0x5ec074);}else{this[_0x4c1c('0xbf')]({'active':![],'countdropretry':_0x5ec074[_0x4c1c('0xef')],'scheduledat':moment()[_0x4c1c('0xf7')](this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]][_0x4c1c('0x110')],_0x4c1c('0xf9'))[_0x4c1c('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35662d[_0x4c1c('0xcf')],'ListId':_0x35662d['ListId'],'VoiceQueueId':_0x35662d['VoiceQueueId']||undefined,'CampaignId':_0x35662d[_0x4c1c('0xfb')]||undefined})['catch'](loggerCatch(_0x4c1c('0x111')));var _0x3bcefe=new History(_0x5ec074);_0x3bcefe[_0x4c1c('0xa5')]=0xa;_0x3bcefe[_0x4c1c('0xe8')]=_0x4c1c('0x112');_0x3bcefe['starttime']=moment()[_0x4c1c('0x92')](_0x4c1c('0xfa'));_0x3bcefe[_0x4c1c('0x113')]=_0x3bcefe['starttime'];_0x3bcefe[_0x4c1c('0x114')]=_0x5ec074[_0x4c1c('0x114')];_0x3bcefe['calleridnum']=_0x5ec074[_0x4c1c('0x115')];this[_0x4c1c('0xc9')](_0x3bcefe)['catch'](loggerCatch(_0x4c1c('0x116')));}}else{this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]][_0x4c1c('0x6b')]+=0x1;this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]][_0x4c1c('0x64')]+=0x1;_0x5ec074[_0x4c1c('0xa5')]=0xb;_0x5ec074['statedesc']='Abandoned';_0x5ec074['dropreason']=_0x4c1c('0x117');_0x5ec074[_0x4c1c('0xf0')]+=0x1;_0x5ec074['countglobal']+=0x1;if(_0x5ec074[_0x4c1c('0xf0')]>=this[_0x4c1c('0x20')][_0x46feaa[_0x4c1c('0xb3')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x5ec074);}else{this[_0x4c1c('0xbf')]({'active':![],'countabandonedretry':_0x5ec074[_0x4c1c('0xf0')],'scheduledat':moment()['add'](this[_0x4c1c('0x20')][_0x46feaa['queue']][_0x4c1c('0x118')],_0x4c1c('0xf9'))['format'](_0x4c1c('0xfa')),'ContactId':_0x35662d[_0x4c1c('0xcf')],'ListId':_0x35662d[_0x4c1c('0xd0')],'VoiceQueueId':_0x35662d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x35662d['CampaignId']||undefined})[_0x4c1c('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3bcefe=new History(_0x5ec074);_0x3bcefe['state']=0xb;_0x3bcefe[_0x4c1c('0xe8')]=_0x4c1c('0x119');_0x3bcefe[_0x4c1c('0xa6')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bcefe[_0x4c1c('0x113')]=_0x3bcefe['starttime'];_0x3bcefe[_0x4c1c('0x114')]=_0x5ec074['calleridname'];_0x3bcefe[_0x4c1c('0x115')]=_0x5ec074[_0x4c1c('0x115')];this[_0x4c1c('0xc9')](_0x3bcefe)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x11a')));}}}}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x11b')]=function(_0xda3f35){if(this[_0x4c1c('0x26')][_0xda3f35[_0x4c1c('0xd9')]]){this[_0x4c1c('0x26')][_0xda3f35[_0x4c1c('0xd9')]]['channel']=_0xda3f35[_0x4c1c('0xaf')];}if(this[_0x4c1c('0xa8')][_0xda3f35['uniqueid']]){this[_0x4c1c('0xa8')][_0xda3f35[_0x4c1c('0xd9')]][_0x4c1c('0xaf')]=_0xda3f35[_0x4c1c('0xaf')];}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x3a')]=function(_0x22ba9d){if(strategy[this['voiceQueues'][this['actions'][_0x22ba9d['actionid']][_0x4c1c('0xb3')]]['strategy']]==='roundrobin'){if(this[_0x4c1c('0x26')][_0x22ba9d[_0x4c1c('0x11c')]]&&_['isNil'](this['actions'][_0x22ba9d[_0x4c1c('0x11c')]][_0x4c1c('0x11d')])&&_0x22ba9d[_0x4c1c('0xae')]==='1'&&_0x22ba9d[_0x4c1c('0x11e')]==='0'){if(this['agents'][_0x22ba9d['stateinterface']]){if(!this[_0x4c1c('0x22')][_0x22ba9d[_0x4c1c('0x11f')]]['locked']){this[_0x4c1c('0x22')][_0x22ba9d[_0x4c1c('0x11f')]]['locked']=!![];this[_0x4c1c('0x26')][_0x22ba9d[_0x4c1c('0x11c')]][_0x4c1c('0x11d')]=!![];this['actions'][_0x22ba9d[_0x4c1c('0x11c')]]['stateinterface']=_0x22ba9d[_0x4c1c('0x11f')];}}}}else if((strategy[this[_0x4c1c('0x20')][this['actions'][_0x22ba9d['actionid']][_0x4c1c('0xb3')]]['strategy']]||'rrmemory')===_0x4c1c('0x120')){if(this[_0x4c1c('0x26')][_0x22ba9d[_0x4c1c('0x11c')]]){if(this[_0x4c1c('0x22')][_0x22ba9d[_0x4c1c('0x11f')]]){this[_0x4c1c('0x26')][_0x22ba9d['actionid']]['stateinterface']=_0x22ba9d[_0x4c1c('0x11f')];if(_[_0x4c1c('0xac')](this['queueBooked'][this[_0x4c1c('0x26')][_0x22ba9d['actionid']][_0x4c1c('0xb3')]])){this['queueBooked'][this[_0x4c1c('0x26')][_0x22ba9d[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]]=[];}this['queueBooked'][this['actions'][_0x22ba9d[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]][_0x4c1c('0x121')](_[_0x4c1c('0x8c')](_[_0x4c1c('0xce')](this[_0x4c1c('0x26')][_0x22ba9d[_0x4c1c('0x11c')]],[_0x4c1c('0x122'),'stateinterface']),{'status':_0x22ba9d['status'],'paused':_0x22ba9d[_0x4c1c('0x11e')]}));}}}};function unlockQueueStatus(_0x421538,_0x5dce75){setTimeout(function(){if(_[_0x4c1c('0x87')](_0x421538['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x5dce75);}_0x421538['queueStatusComplete']=!![];loggerBooked['info'](_0x4c1c('0x123'),_0x5dce75,JSON[_0x4c1c('0x7a')](_['pick'](_0x421538,[_0x4c1c('0x40'),_0x4c1c('0x124')])));},0x1f3);}Dialer[_0x4c1c('0x1b')]['syncQueueStatusComplete']=function(_0x159fc0){var _0x4aea09=this;var _0x22ae5a=_0x4aea09['voiceQueues'][_0x4aea09['actions'][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]];if(strategy[this[_0x4c1c('0x20')][this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]]['strategy']]==='roundrobin'){if(this[_0x4c1c('0x26')][_0x159fc0['actionid']]&&this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0x11f')]){this['preview'][_0x4c1c('0x125')](this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0x122')],this[_0x4c1c('0x26')][_0x159fc0['actionid']][_0x4c1c('0x11f')])[_0x4c1c('0xb0')](function(_0xf5d7b2){logger[_0x4c1c('0x95')](_0x4c1c('0x126'),util[_0x4c1c('0x96')](_0xf5d7b2,{'showHidden':![],'depth':null}));})[_0x4c1c('0x1d')](function(){_0x4aea09[_0x4c1c('0xb2')](_0x4aea09[_0x4c1c('0x20')][_0x4aea09[_0x4c1c('0x26')][_0x159fc0['actionid']][_0x4c1c('0xb3')]]);_0x4aea09[_0x4c1c('0x22')][_0x4aea09[_0x4c1c('0x26')][_0x159fc0['actionid']][_0x4c1c('0x11f')]][_0x4c1c('0x11d')]=![];delete _0x4aea09[_0x4c1c('0x26')][_0x159fc0['actionid']];unlockQueueStatus(_0x22ae5a);});}else{this['updateOriginated'](this[_0x4c1c('0x20')][this[_0x4c1c('0x26')][_0x159fc0['actionid']]['queue']]);this[_0x4c1c('0xbf')]({'active':![],'ContactId':this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['ContactId'],'ListId':this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xd0')],'VoiceQueueId':this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x127')));delete this['actions'][_0x159fc0['actionid']];unlockQueueStatus(_0x22ae5a);}}else if((strategy[this[_0x4c1c('0x20')][this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]][_0x4c1c('0x128')]]||_0x4c1c('0x120'))==='rrmemory'){var _0x17594f;if(this['actions'][_0x159fc0['actionid']]&&!_[_0x4c1c('0x47')](this[_0x4c1c('0x2a')][this[_0x4c1c('0x26')][_0x159fc0['actionid']]['queue']])){if(this[_0x4c1c('0x129')][_0x4aea09[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]]){this[_0x4c1c('0x129')][_0x4aea09[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['queue']]=this[_0x4c1c('0x129')][this[_0x4c1c('0x26')][_0x159fc0['actionid']][_0x4c1c('0xb3')]]?this['queueBookedRR'][this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['queue']]:this['queueBooked'][this['actions'][_0x159fc0[_0x4c1c('0x11c')]]['queue']]?this[_0x4c1c('0x2a')][this['actions'][_0x159fc0[_0x4c1c('0x11c')]][_0x4c1c('0xb3')]][_0x4c1c('0x12a')]||0x0:0x0;}this[_0x4c1c('0x2a')][this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['queue']]['_rr']=this['queueBookedRR'][this[_0x4c1c('0x26')][_0x159fc0[_0x4c1c('0x11c')]]['queue']];for(var _0x324957=0x0;_0x324957=0x0;})[_0x4c1c('0xb0')](myreject(_0x5e4ca8)));}}else{_0x3d3b75[_0x4c1c('0x121')](ami[_0x4c1c('0xad')]({'action':_0x4c1c('0x147'),'command':util[_0x4c1c('0x92')](_0x4c1c('0x142'),_0x5ea972,!_[_0x4c1c('0x87')](config[_0x4c1c('0x13f')][_0x24262f])?_0x24262f:'')})[_0x4c1c('0xb8')](function(_0x5bda67){return _0x5bda67[_0x4c1c('0x144')][_0x4c1c('0x145')](_0x4c1c('0x146'))>=0x0;})[_0x4c1c('0xb0')](myreject(_0x5e4ca8)));}BPromise[_0x4c1c('0x148')](_0x3d3b75)[_0x4c1c('0xb8')](function(_0x413541){var _0x11c27b=_[_0x4c1c('0x149')](_0x413541);if(_0x11c27b){return _0x5a93df(_0x11c27b);}else{_0x1e4abb[_0x4c1c('0x43')]=_0x58c7ab?_0x4c1c('0x14a'):_0x4c1c('0x14b');return _0x5e4ca8(msgResponse('[ifTime][promiseAll]',_0x4c1c('0x13b'),'Global:\x20'+_0x58c7ab+'\x20'+_0x595f5a+_0x4c1c('0x14c')+util[_0x4c1c('0x96')](_0x5ea972,{'showHidden':![],'depth':null})+_0x4c1c('0x14d')+_0x24262f));}})[_0x4c1c('0xb0')](function(_0x2ea5a1){return _0x5e4ca8(msgResponse('ifTime',_0x4c1c('0x13b'),JSON[_0x4c1c('0x7a')](_0x2ea5a1)));});});};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x14e')]=function(_0x3e2301){var _0x16cbb3=this;return function(){switch(_0x3e2301[_0x4c1c('0x5b')]){case _0x4c1c('0x14f'):freeVariablesPredictive(_0x3e2301);_0x16cbb3[_0x4c1c('0x150')](_0x3e2301,0x1);break;case'power':freeVariablesPredictive(_0x3e2301);_0x16cbb3[_0x4c1c('0x150')](_0x3e2301,_0x3e2301['dialPowerLevel']);break;case _0x4c1c('0x151'):_0x16cbb3[_0x4c1c('0x151')](_0x3e2301);break;case'booked':freeVariablesPredictive(_0x3e2301);_0x16cbb3[_0x4c1c('0x150')](_0x3e2301,0x1);break;default:freeVariablesPredictive(_0x3e2301);logger['error'](_0x4c1c('0x152'),_0x3e2301[_0x4c1c('0x40')],_0x4c1c('0x153'));}};};Dialer[_0x4c1c('0x1b')]['launchHandleIvr']=function(_0x5c84f8){var _0x411cca=this;return function(){_0x411cca[_0x4c1c('0x154')](_0x5c84f8);};};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x34')]=function(_0x28c8c9){var _0x44398c=this;if(isNotPreview(_0x28c8c9[_0x4c1c('0x5b')])){if(isVoiceQueueOutbound(_0x28c8c9[_0x4c1c('0x4e')])&&isActive(_0x28c8c9['dialActive'])){_0x28c8c9[_0x4c1c('0x9e')]=!![];BPromise['resolve']()[_0x4c1c('0xb8')](checkIsLoggedIn(_0x28c8c9,_0x28c8c9['loggedIn']))[_0x4c1c('0xb8')](checkIsActive(_0x28c8c9,_0x28c8c9[_0x4c1c('0x5a')]))[_0x4c1c('0xb8')](checkInterval(_0x28c8c9))[_0x4c1c('0xb8')](_0x44398c[_0x4c1c('0x134')](_0x28c8c9))[_0x4c1c('0xb8')](_0x44398c[_0x4c1c('0x138')](_0x28c8c9[_0x4c1c('0x155')],_0x28c8c9[_0x4c1c('0x156')],_0x28c8c9['name'],_0x28c8c9))[_0x4c1c('0xb8')](_0x44398c[_0x4c1c('0x13a')](_0x28c8c9[_0x4c1c('0x46')],_0x28c8c9['dialTimezone'],_0x28c8c9[_0x4c1c('0x40')],_0x28c8c9))[_0x4c1c('0xb8')](_0x44398c[_0x4c1c('0x14e')](_0x28c8c9))[_0x4c1c('0xb0')](loggerCatchQueueSummary(_0x4c1c('0x157'),_0x28c8c9));}else{notSendMessagesQueue(_0x28c8c9);}}else{freeVariablesPredictive(_0x28c8c9);}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x133')]=function(){var _0x351517=this;var _0x238f8e;for(var _0x7745e in this[_0x4c1c('0x21')]){if(typeof this['campaigns'][_0x7745e]!==_0x4c1c('0xab')){_0x238f8e=this[_0x4c1c('0x21')][_0x7745e];if(isCampaignIvr(_0x238f8e[_0x4c1c('0x4e')])&&isActive(_0x238f8e[_0x4c1c('0xd7')])){_0x238f8e[_0x4c1c('0x9e')]=!![];BPromise[_0x4c1c('0xb7')]()['then'](checkIsActive(_0x238f8e,_0x238f8e[_0x4c1c('0xd7')]))[_0x4c1c('0xb8')](checkInterval(_0x238f8e))[_0x4c1c('0xb8')](_0x351517['checkIsTrunkReachable'](_0x238f8e))[_0x4c1c('0xb8')](_0x351517['checkIfTime'](_0x238f8e[_0x4c1c('0x155')],_0x238f8e[_0x4c1c('0x156')],_0x238f8e['name'],_0x238f8e))[_0x4c1c('0xb8')](_0x351517[_0x4c1c('0x13a')](_0x238f8e[_0x4c1c('0x46')],_0x238f8e[_0x4c1c('0x156')],_0x238f8e[_0x4c1c('0x40')],_0x238f8e))[_0x4c1c('0xb8')](_0x351517[_0x4c1c('0x158')](_0x238f8e))[_0x4c1c('0xb0')](loggerCatchQueueSummary('[syncCampaigns]',_0x238f8e));}else{notSendMessagesCampaign(_0x238f8e);}}}};function getCallerIdRandom(_0xf8cb3a,_0x3a7209){var _0x120dbe;var _0x232dc0;var _0x5ef008;if(_0x3a7209<=0x0){_0x3a7209=0x1;}_0x120dbe=new RegExp(_0x4c1c('0x159')+_0x3a7209+'}$');_0x232dc0=Math[_0x4c1c('0x15a')](0xa,_0x3a7209-0x1);_0x5ef008=Math[_0x4c1c('0x15a')](0xa,_0x3a7209)-0x1;return util[_0x4c1c('0x92')]('%s',_[_0x4c1c('0x15b')](_0xf8cb3a,_0x120dbe,_[_0x4c1c('0x15c')](_0x232dc0,_0x5ef008)));}function extractCalleridName(_0x576d88){var _0x434646=_0x576d88['match'](/"(.*?)"/);return _0x434646?_0x434646[0x1]:_0x576d88;}function extractCalleridNumber(_0x2bf5bf){var _0x30100a=_0x2bf5bf[_0x4c1c('0x15d')](/<(.*?)>/);return _0x30100a?_0x30100a[0x1]:_0x2bf5bf;}Dialer[_0x4c1c('0x1b')][_0x4c1c('0x15e')]=function(_0x155eef,_0x178798){var _0x11adec=this;var _0x38db7e=uuid['v4']();this['actions'][_0x38db7e]=new Action(_0x155eef,_0x178798,_0x38db7e);return new BPromise(function(_0x1eb217,_0x250e31){if(_['isUndefined'](_0x155eef)&&typeof _0x155eef!=='object'){return _0x250e31(msgResponse('originate',_0x4c1c('0x13b'),_0x4c1c('0x15f')));}if(_[_0x4c1c('0x87')](_0x178798['Contact'][_0x4c1c('0x160')])||_0x178798[_0x4c1c('0x161')][_0x4c1c('0x160')]===null){return _0x250e31(msgResponse('originate',_0x4c1c('0x13b'),_0x4c1c('0x162')));}var _0x4ed3e3={'XMD-CALLERID':_0x11adec[_0x4c1c('0x26')][_0x38db7e][_0x4c1c('0x163')](),'XMD-AGI':_0x155eef[_0x4c1c('0x105')]?util[_0x4c1c('0x92')](_0x4c1c('0x164'),ipAgi,_0x155eef['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x155eef['dialQueueProject2']?util[_0x4c1c('0x92')](_0x4c1c('0x164'),ipAgi,_0x155eef[_0x4c1c('0x107')]):_0x4c1c('0x165'),'XMD-QUEUE':_0x155eef[_0x4c1c('0x4e')]===_0x4c1c('0x4f')?util[_0x4c1c('0x92')](_0x4c1c('0x166'),_0x155eef[_0x4c1c('0x40')],_0x155eef[_0x4c1c('0x167')]||'',_0x155eef['dialAgiAfterHangupAgent']?'c':'',_0x155eef['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x178798[_0x4c1c('0xcf')],'XMD-CDRTYPE':_0x4c1c('0x9'),'CALLERID(all)':_0x11adec[_0x4c1c('0x26')][_0x38db7e]['getCaller'](),'XMD-AMD':_0x155eef[_0x4c1c('0xde')]?_0x4c1c('0x168'):_0x4c1c('0x165'),'XMD-DESTINATION':_0x4c1c('0xdd')};if(_0x155eef[_0x4c1c('0xde')]){_0x4ed3e3[_0x4c1c('0x169')]=_0x155eef[_0x4c1c('0x16a')]||0x9c4;_0x4ed3e3[_0x4c1c('0x16b')]=_0x155eef['dialAMDGreeting']||0x5dc;_0x4ed3e3[_0x4c1c('0x16c')]=_0x155eef[_0x4c1c('0x16d')]||0x320;_0x4ed3e3[_0x4c1c('0x16e')]=_0x155eef[_0x4c1c('0x16f')]||0x1388;_0x4ed3e3['XMD-AMDMINWORDLENGTH']=_0x155eef[_0x4c1c('0x170')]||0x64;_0x4ed3e3[_0x4c1c('0x171')]=_0x155eef[_0x4c1c('0x172')]||0x32;_0x4ed3e3[_0x4c1c('0x173')]=_0x155eef[_0x4c1c('0x174')]||0x3;_0x4ed3e3[_0x4c1c('0x175')]=_0x155eef[_0x4c1c('0x176')]||0x100;_0x4ed3e3['XMD-AMDMAXIMUMWORDLENGTH']=_0x155eef[_0x4c1c('0x177')]||0x1388;}if(_0x155eef[_0x4c1c('0x4e')]===_0x4c1c('0x4f')){_0x4ed3e3[_0x4c1c('0x178')]=_0x178798[_0x4c1c('0xd2')];}else{_0x4ed3e3['XMD-CAMPAIGNID']=_0x178798[_0x4c1c('0xfb')];}for(var _0x17983a in _0x178798['Contact']){if(typeof _0x178798[_0x4c1c('0x161')][_0x17983a]!==_0x4c1c('0xab')){if(isNotNull(_0x178798[_0x4c1c('0x161')][_0x17983a])&&_0x17983a!=='id'&&_0x17983a!=='tags'&&_0x17983a!==_0x4c1c('0x179')&&_0x17983a!==_0x4c1c('0x17a')){_0x4ed3e3[util['format']('%s%s',_0x4c1c('0x17b'),_['toUpper'](_0x17983a))]=_0x178798[_0x4c1c('0x161')][_0x17983a];}}}var _0xdc5a41=_0x11adec[_0x4c1c('0xd6')](_0x155eef[_0x4c1c('0x78')])?getCallerId(_0x155eef[_0x4c1c('0x78')][_0x4c1c('0x79')],_0x155eef[_0x4c1c('0x5c')],_0x155eef['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x155eef[_0x4c1c('0x5d')],_0x155eef['dialRandomLastDigitCallerIdNumber']):_0x155eef['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x155eef[_0x4c1c('0x135')])?_0x155eef[_0x4c1c('0x78')][_0x4c1c('0x79')]:_0x155eef['TrunkBackup'][_0x4c1c('0x79')],_0x155eef[_0x4c1c('0x5c')],_0x155eef['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x155eef[_0x4c1c('0x5d')],_0x155eef['dialRandomLastDigitCallerIdNumber']):_0x155eef[_0x4c1c('0x5d')]);if(_0xdc5a41){_0x4ed3e3[_0x4c1c('0x17c')]=_0x11adec[_0x4c1c('0x26')][_0x38db7e][_0x4c1c('0x17d')]=extractCalleridName(_0xdc5a41);_0x4ed3e3[_0x4c1c('0x17e')]=_0x11adec[_0x4c1c('0x26')][_0x38db7e][_0x4c1c('0x17f')]=extractCalleridNumber(_0xdc5a41);}return ami[_0x4c1c('0xad')]({'actionid':_0x38db7e,'action':_0x4c1c('0x180'),'channel':_0x11adec[_0x4c1c('0xd6')](_0x155eef['Trunk'])?util[_0x4c1c('0x92')](_0x4c1c('0x181'),_0x155eef['Trunk'][_0x4c1c('0x40')],isNotNull(_0x155eef[_0x4c1c('0x182')])?_0x155eef[_0x4c1c('0x182')]['trim']()||'':'',_0x155eef['dialCutDigit']>0x0?_0x178798[_0x4c1c('0x161')]['phone'][_0x4c1c('0x183')](_0x155eef[_0x4c1c('0x184')]):_0x178798['Contact'][_0x4c1c('0x160')]):util[_0x4c1c('0x92')]('SIP/%s/%s%s',_['isNil'](_0x155eef[_0x4c1c('0x135')])?_0x155eef[_0x4c1c('0x78')][_0x4c1c('0x40')]:_0x155eef[_0x4c1c('0x135')][_0x4c1c('0x40')],isNotNull(_0x155eef[_0x4c1c('0x182')])?_0x155eef['dialPrefix'][_0x4c1c('0x185')]()||'':'',_0x155eef[_0x4c1c('0x184')]>0x0?_0x178798[_0x4c1c('0x161')][_0x4c1c('0x160')][_0x4c1c('0x183')](_0x155eef['dialCutDigit']):_0x178798[_0x4c1c('0x161')]['phone']),'callerid':_0xdc5a41,'Exten':_0x4c1c('0xdd'),'Context':_0x4c1c('0x186'),'Priority':'1','variable':_0x4ed3e3,'timeout':(_0x155eef[_0x4c1c('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x38db7e})['then'](function(_0x5652a5){return _0x1eb217(_0x5652a5);})[_0x4c1c('0xb0')](function(_0x54d277){_0x155eef[_0x4c1c('0x187')]+=0x1;var _0x18a222=new History(_0x11adec[_0x4c1c('0x26')][_0x38db7e]);logger['error'](util[_0x4c1c('0x92')](_0x4c1c('0x188'),JSON[_0x4c1c('0x7a')](_0x54d277)));_0x18a222[_0x4c1c('0xa5')]=0xe;_0x18a222[_0x4c1c('0xe8')]='OriginateError';_0x18a222['starttime']=moment()[_0x4c1c('0x92')](_0x4c1c('0xfa'));_0x18a222[_0x4c1c('0x113')]=_0x18a222['starttime'];_0x11adec[_0x4c1c('0xc9')](_0x18a222)['catch'](loggerCatch(_0x4c1c('0x189')));_0x11adec[_0x4c1c('0xc7')](_0x18a222)['catch'](loggerCatch(_0x4c1c('0x189')))['finally'](function(){delete _0x11adec[_0x4c1c('0x26')][_0x38db7e];return _0x250e31(msgResponse(_0x4c1c('0x180'),_0x4c1c('0x49'),_0x4c1c('0x18a')));});});});};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x30')]=function(_0x1a9f42){var _0x2edee7=this[_0x4c1c('0x26')][_0x1a9f42[_0x4c1c('0x11c')]];if(_0x2edee7){delete this[_0x4c1c('0x26')][_0x1a9f42[_0x4c1c('0x11c')]];_0x2edee7[_0x4c1c('0x18b')]=moment()['format'](_0x4c1c('0xfa'));var _0x29381e=_0x2edee7[_0x4c1c('0x4e')]===_0x4c1c('0x90')?this[_0x4c1c('0x21')][_0x2edee7[_0x4c1c('0xb3')]]:this[_0x4c1c('0x20')][_0x2edee7[_0x4c1c('0x18c')]()];if(!this[_0x4c1c('0xd4')](_0x1a9f42['response'])){this[_0x4c1c('0xb2')](_0x29381e);return this[_0x4c1c('0x18d')](_0x2edee7,_0x29381e,_0x1a9f42)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x18e')));}this[_0x4c1c('0xa8')][_0x1a9f42['uniqueid']]=_0x2edee7;}};Dialer['prototype']['checkRetriveMax']=function(_0x4549b5,_0x1fbd85,_0x184976){var _0x36b19d=new History(_0x1fbd85);if(_0x36b19d[_0x4c1c('0xec')]+_0x36b19d[_0x4c1c('0x18f')]+_0x36b19d['countnoanswerretry']+_0x36b19d[_0x4c1c('0xee')]+_0x36b19d['countdropretry']+_0x36b19d[_0x4c1c('0xf0')]+_0x36b19d[_0x4c1c('0xf1')]+_0x36b19d['countagentrejectretry']>=_0x184976[_0x4c1c('0xf2')]-0x1){return!![];}switch(_0x4549b5){case 0x3:if(_0x36b19d[_0x4c1c('0xed')]>=_0x184976[_0x4c1c('0x190')]-0x1){return!![];}this[_0x4c1c('0xbf')]({'active':![],'countnoanswerretry':_0x36b19d['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x184976[_0x4c1c('0x191')],_0x4c1c('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x192')));break;case 0x5:if(_0x36b19d[_0x4c1c('0xec')]>=_0x184976['dialBusyMaxRetry']-0x1){return!![];}this[_0x4c1c('0xbf')]({'active':![],'countbusyretry':_0x36b19d[_0x4c1c('0xec')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976['dialBusyRetryFrequency'],'minutes')[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x193')));break;case 0x8:if(_0x36b19d[_0x4c1c('0x18f')]>=_0x184976[_0x4c1c('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x36b19d[_0x4c1c('0x18f')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976['dialCongestionRetryFrequency'],_0x4c1c('0xf9'))[_0x4c1c('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x195')));break;case 0x0:if(_0x36b19d[_0x4c1c('0xee')]>=_0x184976[_0x4c1c('0x196')]-0x1){return!![];}else{this[_0x4c1c('0xbf')]({'active':![],'countnosuchnumberretry':_0x36b19d[_0x4c1c('0xee')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976[_0x4c1c('0x197')],_0x4c1c('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x198')));}break;case 0xa:if(_0x36b19d['countdropretry']>=_0x184976[_0x4c1c('0x199')]-0x1){return!![];}this[_0x4c1c('0xbf')]({'active':![],'countdropretry':_0x36b19d[_0x4c1c('0xef')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976[_0x4c1c('0x110')],_0x4c1c('0xf9'))[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x111')));break;case 0xb:if(_0x36b19d[_0x4c1c('0xf0')]>=_0x184976[_0x4c1c('0x19a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x36b19d[_0x4c1c('0xf0')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976['dialAbandonedRetryFrequency'],_0x4c1c('0xf9'))[_0x4c1c('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})['catch'](loggerCatch(_0x4c1c('0x19b')));break;case 0x13:if(_0x36b19d[_0x4c1c('0xf1')]>=_0x184976[_0x4c1c('0xff')]-0x1){return!![];}this[_0x4c1c('0xbf')]({'active':![],'countmachineretry':_0x36b19d['countmachineretry']+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976[_0x4c1c('0xf8')],'minutes')[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d[_0x4c1c('0xd0')],'VoiceQueueId':_0x36b19d['VoiceQueueId']||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x36b19d['countagentrejectretry']>=_0x184976[_0x4c1c('0x19c')]-0x1){return!![];}this[_0x4c1c('0xbf')]({'active':![],'countagentrejectretry':_0x36b19d[_0x4c1c('0x19d')]+=0x1,'scheduledat':moment()[_0x4c1c('0xf7')](_0x184976['dialAgentRejectRetryFrequency'],_0x4c1c('0xf9'))[_0x4c1c('0x92')](_0x4c1c('0xfa')),'ContactId':_0x36b19d[_0x4c1c('0xcf')],'ListId':_0x36b19d['ListId'],'VoiceQueueId':_0x36b19d[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x36b19d[_0x4c1c('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3f0a8d,_0x2cf0fd,_0x1a1e7f){var _0xdea291=this;var _0x3cbf61=new History(_0x3f0a8d);return new BPromise(function(_0xdfa161,_0xe8bfd1){if(_[_0x4c1c('0x87')](_0x2cf0fd)&&typeof _0x2cf0fd!==_0x4c1c('0x19e')){return _0xe8bfd1(msgResponse('[callProgressDetecting]',_0x4c1c('0x13b'),_0x4c1c('0x19f')));}if(_[_0x4c1c('0x87')](_0x1a1e7f)&&typeof _0x1a1e7f!==_0x4c1c('0x19e')){return _0xe8bfd1(msgResponse(_0x4c1c('0x1a0'),_0x4c1c('0x13b'),_0x4c1c('0x1a1')));}switch(_0x1a1e7f['reason']){case'0':_0x2cf0fd[_0x4c1c('0x1a2')]+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0x0;_0x3cbf61['statedesc']=_0x4c1c('0x1a3');_0x3cbf61[_0x4c1c('0xee')]+=0x1;_0x3cbf61['countglobal']+=0x1;ami[_0x4c1c('0x4d')]('custom:agentnosuchnumber',ut['buildObj'](_0x3f0a8d,_0x4c1c('0x1a4')));_0xdea291[_0x4c1c('0xc9')](_0x3cbf61)[_0x4c1c('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xdea291['checkRetriveMax'](0x0,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61[_0x4c1c('0xee')]>=_0x2cf0fd[_0x4c1c('0x196')]){_0xdea291['createStateFinal'](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1a5'));}else{_0xdea291['stateGlobal'](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1a5'));}}break;case'3':_0x2cf0fd[_0x4c1c('0x66')]+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0x3;_0x3cbf61[_0x4c1c('0xe8')]=_0x4c1c('0x1a6');_0x3cbf61[_0x4c1c('0xed')]+=0x1;_0x3cbf61[_0x4c1c('0xea')]+=0x1;ami[_0x4c1c('0x4d')](_0x4c1c('0x1a7'),ut[_0x4c1c('0xe4')](_0x3f0a8d,_0x4c1c('0x1a8')));_0xdea291[_0x4c1c('0xc9')](_0x3cbf61)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x1a9')));if(_0xdea291[_0x4c1c('0x1aa')](0x3,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61[_0x4c1c('0xed')]>=_0x2cf0fd[_0x4c1c('0x190')]){_0xdea291['createStateFinal'](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1ab'));}else{_0xdea291[_0x4c1c('0xf3')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1ab'));}}break;case'5':_0x2cf0fd[_0x4c1c('0x62')]+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0x5;_0x3cbf61[_0x4c1c('0xe8')]=_0x4c1c('0x1ac');_0x3cbf61['countbusyretry']+=0x1;_0x3cbf61[_0x4c1c('0xea')]+=0x1;ami[_0x4c1c('0x4d')](_0x4c1c('0x1ad'),ut[_0x4c1c('0xe4')](_0x3f0a8d,_0x4c1c('0x1ae')));_0xdea291['createHistory'](_0x3cbf61)['catch'](loggerCatch(_0x4c1c('0x1af')));if(_0xdea291[_0x4c1c('0x1aa')](0x5,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61['countbusyretry']>=_0x2cf0fd[_0x4c1c('0x1b0')]){_0xdea291[_0x4c1c('0xf5')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b1'));}else{_0xdea291['stateGlobal'](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b1'));}}break;case'8':_0x2cf0fd[_0x4c1c('0x1b2')]+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0x8;_0x3cbf61[_0x4c1c('0xe8')]=_0x4c1c('0x1b3');_0x3cbf61[_0x4c1c('0x18f')]+=0x1;_0x3cbf61[_0x4c1c('0xea')]+=0x1;ami['emit']('custom:agentcongestion',ut[_0x4c1c('0xe4')](_0x3f0a8d,_0x4c1c('0x1b4')));_0xdea291[_0x4c1c('0xc9')](_0x3cbf61)['catch'](loggerCatch(_0x4c1c('0x1b5')));if(_0xdea291['checkRetriveMax'](0x8,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61['countcongestionretry']>=_0x2cf0fd[_0x4c1c('0x194')]){_0xdea291['createStateFinal'](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b6'));}else{_0xdea291[_0x4c1c('0xf3')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b6'));}}break;case'11':_0x2cf0fd['outboundAbandonedCallsDay']+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0xb;_0x3cbf61['statedesc']='Abandoned';_0x3cbf61[_0x4c1c('0xf0')]+=0x1;_0x3cbf61[_0x4c1c('0xea')]+=0x1;_0xdea291[_0x4c1c('0xc9')](_0x3cbf61)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x11a')));if(_0xdea291[_0x4c1c('0x1aa')](0xb,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61[_0x4c1c('0xf0')]>=_0x2cf0fd['dialAbandonedMaxRetry']){_0xdea291[_0x4c1c('0xf5')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b7'));}else{_0xdea291[_0x4c1c('0xf3')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1b7'));}}break;case'20':_0x2cf0fd[_0x4c1c('0x1b8')]+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0x14;_0x3cbf61[_0x4c1c('0xe8')]='AgentReject';_0x3cbf61['countagentrejectretry']+=0x1;_0x3cbf61[_0x4c1c('0xea')]+=0x1;ami['emit']('custom:agentreject',ut['buildObj'](_0x3f0a8d,_0x4c1c('0x1b9')));_0xdea291[_0x4c1c('0xc9')](_0x3cbf61)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x1ba')));if(_0xdea291['checkRetriveMax'](0x14,_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61[_0x4c1c('0x19d')]>=_0x2cf0fd[_0x4c1c('0x19c')]){_0xdea291[_0x4c1c('0xf5')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x4c1c('0x1bb'));}else{_0xdea291[_0x4c1c('0xf3')](_0x3cbf61,_0xdfa161,_0xe8bfd1,'reason\x2020\x20agentreject');}}break;default:_0x2cf0fd['outboundUnknownCallsDay']+=0x1;_0x3cbf61[_0x4c1c('0xa5')]=0xc;_0x3cbf61[_0x4c1c('0xe8')]=_0x1a1e7f['reason'];_0xdea291['createHistory'](_0x3cbf61)[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x1bc')));if(_0xdea291['checkRetriveMax'](_0x1a1e7f[_0x4c1c('0x1bd')],_0x3f0a8d,_0x2cf0fd)){if(_0x3cbf61[_0x4c1c('0xec')]+_0x3cbf61[_0x4c1c('0x18f')]+_0x3cbf61[_0x4c1c('0xed')]+_0x3cbf61[_0x4c1c('0xee')]+_0x3cbf61[_0x4c1c('0xef')]+_0x3cbf61['countabandonedretry']+_0x3cbf61[_0x4c1c('0xf1')]+_0x3cbf61['countagentrejectretry']>=_0x2cf0fd[_0x4c1c('0xf2')]){_0xdea291[_0x4c1c('0xf3')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x1a1e7f[_0x4c1c('0x1bd')]);}else{_0xdea291[_0x4c1c('0xf5')](_0x3cbf61,_0xdfa161,_0xe8bfd1,_0x1a1e7f[_0x4c1c('0x1bd')]);}}}});};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xf3')]=function(_0x2c6838,_0x52e33c,_0x2ff99b,_0x263eeb){var _0x765c=new Final(_0x2c6838);_0x765c[_0x4c1c('0xa5')]=0xf;_0x765c[_0x4c1c('0xe8')]=_0x4c1c('0x1be');this['createStateFinal'](_0x765c,_0x52e33c,_0x2ff99b,_0x263eeb);};Dialer[_0x4c1c('0x1b')][_0x4c1c('0xf5')]=function(_0x318f54,_0x3a6176,_0x260ecd,_0x2e1671){this[_0x4c1c('0xc7')](_0x318f54)[_0x4c1c('0xb8')](function(){return _0x3a6176(msgResponse(_0x4c1c('0x1a0'),_0x4c1c('0xd5'),_0x2e1671));})['catch'](function(){return _0x260ecd(msgResponse(_0x4c1c('0x1bf'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x151')]=function(_0x5155ea){var _0x426038=_0x5155ea[_0x4c1c('0x1c0')]/0x64;var _0x504493=_0x5155ea[_0x4c1c('0x65')]/(_0x5155ea['outboundDropCallsDayTimeout']+_0x5155ea[_0x4c1c('0x60')]);var _0x2eb56c=Math[_0x4c1c('0x1c1')](_0x5155ea[_0x4c1c('0x71')]*(_0x5155ea['predictiveIntervalMaxThreshold']/0x64));var _0x1c4ac9=Math[_0x4c1c('0x1c1')](_0x5155ea[_0x4c1c('0x71')]*(_0x5155ea[_0x4c1c('0x1c2')]/0x64));var _0x3aa6c1=_0x5155ea[_0x4c1c('0x9f')]+_0x5155ea[_0x4c1c('0x55')];var _0x1c884e=Math[_0x4c1c('0x1c3')](_0x5155ea[_0x4c1c('0x89')]*_0x5155ea[_0x4c1c('0x75')]*_0x5155ea[_0x4c1c('0x6e')]*_0x5155ea[_0x4c1c('0x6f')]);if(_[_0x4c1c('0x87')](_0x5155ea[_0x4c1c('0x77')])){if(!_[_0x4c1c('0x87')](_0x5155ea['startPredictive'])){_0x5155ea[_0x4c1c('0x28')]=undefined;loggerPredictive[_0x4c1c('0x95')]('[startMethodPredictive][StartProgressive]',_0x4c1c('0x1c4'));}if(!_[_0x4c1c('0x87')](_0x5155ea['handlePredictive'])){loggerPredictive[_0x4c1c('0x95')](_0x4c1c('0x1c5'),_0x4c1c('0x1c6'));clearInterval(_0x5155ea['handlePredictive']);_0x5155ea['handlePredictive']=undefined;}_0x5155ea['startProgressive']=moment()[_0x4c1c('0x92')](_0x4c1c('0xfa'));loggerPredictive['info'](_0x5155ea['name'],_0x4c1c('0x1c7'),_0x5155ea[_0x4c1c('0x77')]);this[_0x4c1c('0x150')](_0x5155ea,0x1);}else if(ifInterval(_0x5155ea[_0x4c1c('0x1c8')],_0x5155ea[_0x4c1c('0x77')])){this[_0x4c1c('0x150')](_0x5155ea,0x1);loggerPredictiveCalls[_0x4c1c('0x7f')](_0x4c1c('0x1c9'),_0x5155ea[_0x4c1c('0x77')],_0x5155ea[_0x4c1c('0x40')]);_0x5155ea[_0x4c1c('0x89')]=0x0;_0x5155ea[_0x4c1c('0x10e')]=0x0;}else if(_0x426038<_0x504493&&_0x5155ea[_0x4c1c('0x1ca')]===_0x4c1c('0x1cb')){freeVariablesPredictive(_0x5155ea);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x1cc'),_0x4c1c('0x1cd'),_0x504493,_0x4c1c('0x77'),_0x5155ea['name']);}else if(_0x1c884e<_0x5155ea['predictiveIntervalErlangCallsDroppedCalls']&&_0x5155ea[_0x4c1c('0x1ca')]===_0x4c1c('0x1cb')){freeVariablesPredictive(_0x5155ea);loggerPredictive['info'](_0x4c1c('0x1ce'),_0x4c1c('0x1cf'),_0x1c884e,'Drop\x20in\x20this\x20interval',_0x5155ea[_0x4c1c('0x10e')],'startProgressive',_0x5155ea[_0x4c1c('0x40')]);}else if(!ifInterval(_0x5155ea['dialPredictiveInterval'],_0x5155ea['startProgressive'])&&_['isUndefined'](_0x5155ea[_0x4c1c('0x28')])&&!_[_0x4c1c('0x87')](_0x5155ea['startProgressive'])){_0x5155ea[_0x4c1c('0x28')]=moment()[_0x4c1c('0x92')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4c1c('0x7f')](_0x5155ea['name'],_0x4c1c('0x1d0'),_0x5155ea['startPredictive']);this[_0x4c1c('0xbc')](_0x5155ea[_0x4c1c('0x1c8')])[_0x4c1c('0xb8')](this['getDataPredictive'](_0x5155ea))['then'](mergeDataErlangB(_0x5155ea))[_0x4c1c('0xb8')](this[_0x4c1c('0x1d1')](_0x5155ea))[_0x4c1c('0xb0')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5155ea));}else if(!ifInterval(_0x5155ea['dialPredictiveInterval'],_0x5155ea[_0x4c1c('0x28')])){_0x5155ea[_0x4c1c('0x10e')]=0x0;_0x5155ea['startPredictive']=moment()['format'](_0x4c1c('0xfa'));loggerPredictive['info'](_0x5155ea[_0x4c1c('0x40')],_0x4c1c('0x1d2'),_0x5155ea[_0x4c1c('0x28')]);clearInterval(_0x5155ea[_0x4c1c('0x8e')]);_0x5155ea[_0x4c1c('0x8e')]=undefined;this[_0x4c1c('0xbc')](_0x5155ea[_0x4c1c('0x1c8')])[_0x4c1c('0xb8')](this[_0x4c1c('0x1d3')](_0x5155ea))[_0x4c1c('0xb8')](mergeDataErlangB(_0x5155ea))[_0x4c1c('0xb8')](this['startMethodPredictive'](_0x5155ea))[_0x4c1c('0xb0')](loggerCatchPredictive(_0x4c1c('0x1d4'),_0x5155ea));}else if(_0x5155ea[_0x4c1c('0x71')]&&_0x3aa6c1<_0x5155ea['predictiveIntervalAvailable']-_0x1c4ac9){freeVariablesPredictive(_0x5155ea);loggerPredictive['info'](_0x5155ea[_0x4c1c('0x40')],_0x4c1c('0x1d5'),_0x3aa6c1,_0x4c1c('0x1d6'),_0x5155ea['predictiveIntervalAvailable'],'-',_0x1c4ac9,'=',_0x5155ea[_0x4c1c('0x71')]-_0x1c4ac9,')');}else if(_0x5155ea[_0x4c1c('0x71')]&&_0x3aa6c1>_0x5155ea[_0x4c1c('0x71')]+_0x2eb56c){freeVariablesPredictive(_0x5155ea);loggerPredictive[_0x4c1c('0x7f')](_0x5155ea['name'],_0x4c1c('0x1d5'),_0x3aa6c1,_0x4c1c('0x1d7'),_0x5155ea[_0x4c1c('0x71')],'+',_0x2eb56c,'=',_0x5155ea[_0x4c1c('0x71')]+_0x2eb56c,')');}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x1d3')]=function(_0x3af2d9){var _0x20b17d=this;return function(_0x271374){return new BPromise(function(_0x5651a3,_0x229f32){_[_0x4c1c('0x8c')](_0x3af2d9,_0x271374[0x0]);if(checkGetDataPredictive(_0x271374[0x0])){var _0xaab5c0=_0x3af2d9[_0x4c1c('0x71')]=_0x3af2d9[_0x4c1c('0x55')]+_0x3af2d9[_0x4c1c('0x9f')];var _0x42cbd1=_0x3af2d9[_0x4c1c('0x1c8')]*0x3c;var _0x31dc68=_0x271374[0x0]['predictiveIntervalAvgTalktime']+_0x271374[0x0][_0x4c1c('0x6a')];var _0x47800f=(_0x271374[0x0][_0x4c1c('0x69')]+_0x271374[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x271374[0x0][_0x4c1c('0x6b')])/_0x271374[0x0][_0x4c1c('0x72')];_0x3af2d9[_0x4c1c('0x6e')]=_0x47800f>0x0?_0x47800f:0x1;switch(_0x3af2d9[_0x4c1c('0x1ca')]){case _0x4c1c('0x1cb'):var _0x48fda7=_0x3af2d9[_0x4c1c('0x1c0')]/0x64;return _0x20b17d[_0x4c1c('0x1d8')](_0xaab5c0,_0x42cbd1,_0x31dc68,_0x47800f,_0x48fda7)[_0x4c1c('0xb8')](function(_0x49db50){return _0x5651a3(_0x49db50);});case _0x4c1c('0x1d9'):var _0x293b04=_0x3af2d9[_0x4c1c('0x1c0')]/0x64;return _0x20b17d[_0x4c1c('0x1da')](_0xaab5c0,_0x42cbd1,_0x31dc68,_0x47800f,_0x293b04)[_0x4c1c('0xb8')](function(_0x53d550){return _0x5651a3(_0x53d550);});default:return _0x229f32(msgResponse('[getDataPredictive]','Failure',_0x4c1c('0x1db')));}}else{return _0x229f32(msgResponse('[getDataPredictive]',_0x4c1c('0x13b'),_0x4c1c('0x1dc')));}});};};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x1dd')]=function(_0x1994e0){var _0x204502=this;return function(_0x51c4b){return new BPromise(function(_0x3963ec,_0x55ae8e){_['merge'](_0x1994e0,_0x51c4b[0x0]);if(checkGetDataPredictive(_0x51c4b[0x0])){loggerPredictive[_0x4c1c('0x7f')](JSON[_0x4c1c('0x7a')](_0x51c4b[0x0]));if(_0x1994e0[_0x4c1c('0x1ca')]===_0x4c1c('0x1cb')){return _0x204502['getVoiceQueueRtPauses'](_0x1994e0['id'])[_0x4c1c('0xb8')](function(_0x2ffd82){var _0xbbc828=_0x1994e0[_0x4c1c('0x51')]-_0x2ffd82[0x0][_0x4c1c('0x1de')];var _0x5b1fb0=_0x1994e0['dialPredictiveInterval']*0x3c;var _0x44fe74=_0x51c4b[0x0][_0x4c1c('0x85')]+_0x51c4b[0x0][_0x4c1c('0x6a')];var _0x4fab27=(_0x51c4b[0x0][_0x4c1c('0x69')]+_0x51c4b[0x0][_0x4c1c('0x6c')]+_0x51c4b[0x0][_0x4c1c('0x6b')])/_0x51c4b[0x0][_0x4c1c('0x72')];var _0x592a16=_0x1994e0['dialPredictiveOptimizationPercentage']/0x64;_0x1994e0[_0x4c1c('0x70')]=_0x2ffd82[0x0][_0x4c1c('0x1de')]||0x0;_0x1994e0[_0x4c1c('0x6e')]=_0x4fab27>0x0?_0x4fab27:0x1;return _0x204502[_0x4c1c('0x1d8')](_0xbbc828,_0x5b1fb0,_0x44fe74,_0x4fab27,_0x592a16);})[_0x4c1c('0xb8')](function(_0x58552a){return _0x3963ec(_0x58552a);})['catch'](function(_0x246402){return _0x55ae8e(msgResponse(_0x4c1c('0x1df'),'Failure',JSON['stringify'](_0x246402)));});}if(_0x1994e0[_0x4c1c('0x1ca')]==='agentBusyFactor'){return _0x204502[_0x4c1c('0xc6')](_0x1994e0['id'])['then'](function(_0x29591b){var _0x5e7bff=_0x1994e0[_0x4c1c('0x51')]-_0x29591b[0x0]['outboundQueuePauses'];var _0x5d340b=_0x1994e0[_0x4c1c('0x1c8')]*0x3c;var _0x1daad5=_0x51c4b[0x0][_0x4c1c('0x85')]+_0x51c4b[0x0]['predictiveIntervalAvgHoldtime'];var _0x413654=(_0x51c4b[0x0]['predictiveIntervalAnsweredCalls']+_0x51c4b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x51c4b[0x0][_0x4c1c('0x6b')])/_0x51c4b[0x0]['predictiveIntervalTotalCalls'];var _0x28e1e4=_0x1994e0[_0x4c1c('0x1c0')]/0x64;_0x1994e0[_0x4c1c('0x70')]=_0x29591b[0x0][_0x4c1c('0x1de')]||0x0;_0x1994e0[_0x4c1c('0x6e')]=_0x413654>0x0?_0x413654:0x1;return _0x204502[_0x4c1c('0x1da')](_0x5e7bff,_0x5d340b,_0x1daad5,_0x413654,_0x28e1e4);})[_0x4c1c('0xb8')](function(_0x498cb4){return _0x3963ec(_0x498cb4);})[_0x4c1c('0xb0')](function(_0x29f0d1){return _0x55ae8e(msgResponse(_0x4c1c('0x1df'),_0x4c1c('0x13b'),JSON[_0x4c1c('0x7a')](_0x29f0d1)));});}}else{return _0x55ae8e(msgResponse('[getDataPredictive]',_0x4c1c('0x13b'),_0x4c1c('0x1dc')));}});};};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x1d1')]=function(_0x30bc57){var _0x14d00f=this;return function(){var _0x49d735=0x0;var _0x313398=Math['floor'](_0x30bc57[_0x4c1c('0x74')]*0x3e8);if(_0x313398>0x0){_0x313398=_0x313398<0x64?0x64:_0x313398;loggerPredictive[_0x4c1c('0x7f')](_0x30bc57[_0x4c1c('0x40')],_0x4c1c('0x1e0'),_0x313398,'milliseconds');_0x30bc57[_0x4c1c('0x8e')]=setInterval(function(){_0x14d00f[_0x4c1c('0x8e')](_0x30bc57);loggerPredictiveCalls[_0x4c1c('0x7f')](_0x4c1c('0x1e1'),_0x49d735+=0x1);},_0x313398);}else{loggerPredictive['info'](_0x30bc57[_0x4c1c('0x40')],_0x4c1c('0x1e2'));}};};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x1e3')]=function(_0x4cfcbc,_0x14af6a){var _0xa706a7=this;return function(_0x181b8c){if(_[_0x4c1c('0x47')](_0x181b8c)){if(_[_0x4c1c('0xac')](_0x14af6a[_0x4c1c('0xd1')])||!_0x14af6a['recallme']){if(_0x4cfcbc[_0x4c1c('0x5b')]===_0x4c1c('0x1e4')){_0x4cfcbc[_0x4c1c('0x124')]=_[_0x4c1c('0x87')](_0x4cfcbc[_0x4c1c('0x124')])?!![]:_0x4cfcbc['queueStatusComplete'];var _0x3e0c42=uuid['v4']();_0xa706a7[_0x4c1c('0x26')][_0x3e0c42]=new Action(_0x4cfcbc,_0x14af6a,_0x3e0c42);loggerBooked[_0x4c1c('0x7f')](_0x4c1c('0x1e5'),_0x3e0c42,_0x4c1c('0x1e6'),JSON[_0x4c1c('0x7a')](_0x4cfcbc[_0x4c1c('0x124')]),_0x4c1c('0x1e7'),_0x4cfcbc[_0x4c1c('0x40')]);if(_0x4cfcbc[_0x4c1c('0x124')]){_0x4cfcbc[_0x4c1c('0x124')]=![];_0xa706a7['queueBooked'][_0xa706a7[_0x4c1c('0x26')][_0x3e0c42]['queue']]=[];ami[_0x4c1c('0xad')]({'actionid':_0x3e0c42,'action':_0x4c1c('0x1e8'),'queue':_0x4cfcbc[_0x4c1c('0x40')]})[_0x4c1c('0xb0')](function(){_0xa706a7['updateOriginated'](_0x4cfcbc);_0xa706a7['rescheduleContact']({'active':![],'ContactId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42]['ContactId'],'ListId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42][_0x4c1c('0xd0')],'VoiceQueueId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42][_0x4c1c('0xd2')]||undefined,'CampaignId':_0xa706a7['actions'][_0x3e0c42][_0x4c1c('0xfb')]||undefined})[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0x1e9')));delete _0xa706a7[_0x4c1c('0x26')][_0x3e0c42];});}else{loggerBooked[_0x4c1c('0x7f')]('[booked][checkContactBlack][else]',JSON[_0x4c1c('0x7a')](_0x4cfcbc[_0x4c1c('0x124')]),_0x4c1c('0x1e7'),_0x4cfcbc[_0x4c1c('0x40')]);_0xa706a7[_0x4c1c('0xb2')](_0x4cfcbc);_0xa706a7[_0x4c1c('0xbf')]({'active':![],'ContactId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42]['ContactId'],'ListId':_0xa706a7['actions'][_0x3e0c42][_0x4c1c('0xd0')],'VoiceQueueId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42][_0x4c1c('0xd2')]||undefined,'CampaignId':_0xa706a7[_0x4c1c('0x26')][_0x3e0c42]['CampaignId']||undefined})[_0x4c1c('0xb0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xa706a7[_0x4c1c('0x26')][_0x3e0c42];}}else{return _0xa706a7[_0x4c1c('0x15e')](_0x4cfcbc,_0x14af6a);}}else{if(getDiff(_0x14af6a[_0x4c1c('0x1ea')])<_0x4cfcbc[_0x4c1c('0x1eb')]*0x3c){if(_0x14af6a[_0x4c1c('0x1ec')]&&!_0x14af6a[_0x4c1c('0x1ec')][_0x4c1c('0x1ed')]){_0xa706a7[_0x4c1c('0x1f')][_0x4c1c('0x125')](_0x14af6a['id'])[_0x4c1c('0x1d')](function(){_0xa706a7[_0x4c1c('0xb2')](_0x4cfcbc);});}else{_0xa706a7['unlockContact']({'active':![]},_0x14af6a['id'],0x1)[_0x4c1c('0x1d')](function(){_0xa706a7[_0x4c1c('0xb2')](_0x4cfcbc);});}}else{_0x4cfcbc['outboundReCallsDay']+=0x1;_0xa706a7[_0x4c1c('0xb2')](_0x4cfcbc);if(_0x4cfcbc[_0x4c1c('0x1ee')]){_0xa706a7[_0x4c1c('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x14af6a[_0x4c1c('0xcf')],'ListId':_0x14af6a[_0x4c1c('0xd0')],'VoiceQueueId':_0x14af6a[_0x4c1c('0xd2')]||undefined,'CampaignId':_0x14af6a['CampaignId']||undefined})[_0x4c1c('0xb0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xa706a7[_0x4c1c('0xc9')](createObjHistory(_0x4cfcbc,_0x14af6a,_0x4c1c('0x1ef'),0x17,_0x4c1c('0x1f0')))[_0x4c1c('0xb0')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xa706a7['saveInDb'](createObjHistory(_0x4cfcbc,_0x14af6a,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x4c1c('0x1f1'),'[Originate][HistoryRecallClose]');}}}}else{_0x4cfcbc['outboundBlacklistCallsDay']+=0x1;_0xa706a7[_0x4c1c('0xcd')](createObjHistory(_0x4cfcbc,_0x14af6a,'BLACKLIST',0xd,_0x4c1c('0x1f2')),_0x4c1c('0x1f3'),'[Originate][MoveBlacklist]');throw _0x4c1c('0x1f4');}};};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x154')]=function(_0x2b0f1f){var _0x2f3e3b=this;var _0x4c25dc=_0x2b0f1f[_0x4c1c('0x1f5')]-_0x2b0f1f[_0x4c1c('0x73')]-_0x2b0f1f[_0x4c1c('0xc3')];emitCampaignSummary(_0x2b0f1f);if(_0x4c25dc>0x0){if(_0x4c25dc>this[_0x4c1c('0x24')]){_0x4c25dc=this['maxNumberOriginate'];}_0x2b0f1f['temp']+=_0x4c25dc;this['getContactDialerIvr'](_0x2b0f1f['id'],_0x4c25dc,_0x2b0f1f[_0x4c1c('0x1f6')],_0x2b0f1f)[_0x4c1c('0xb8')](function(_0x47d4e6){_0x2b0f1f['temp']-=_0x4c25dc;_0x2b0f1f[_0x4c1c('0xc3')]=_0x2b0f1f[_0x4c1c('0xc3')]>0x0?_0x2b0f1f[_0x4c1c('0xc3')]:0x0;if(!checkContactEmpty(_0x47d4e6)){_0x2b0f1f[_0x4c1c('0x43')]=_0x4c1c('0x9d');logger[_0x4c1c('0x7f')]('[getContactCampaign2][Empty]'+_0x2b0f1f[_0x4c1c('0x40')]);}else{_0x2b0f1f['originated']+=_0x47d4e6[_0x4c1c('0x12b')];_0x2b0f1f[_0x4c1c('0x43')]=_0x4c1c('0x1f7');for(var _0x3b4303=0x0;_0x3b4303<_0x47d4e6[_0x4c1c('0x12b')];_0x3b4303+=0x1){_0x2b0f1f[_0x4c1c('0x1f8')]+=0x1;if(_[_0x4c1c('0xac')](_0x47d4e6[_0x3b4303])||_[_0x4c1c('0xac')](_0x47d4e6[_0x3b4303]['Contact'])||_[_0x4c1c('0xac')](_0x47d4e6[_0x3b4303]['Contact']['phone'])){_0x2f3e3b[_0x4c1c('0x1f9')](_0x4c1c('0x1fa'),_0x2b0f1f,_0x47d4e6[_0x3b4303]);}else{_0x2f3e3b[_0x4c1c('0xbb')](_[_0x4c1c('0xce')](_0x47d4e6[_0x3b4303],[_0x4c1c('0xfb'),_0x4c1c('0x1fb')]))[_0x4c1c('0xb8')](_0x2f3e3b['checkContactBlack'](_0x2b0f1f,_0x47d4e6[_0x3b4303]))['catch'](_0x2f3e3b['loggerHandler'](_0x4c1c('0x1fc'),_0x2b0f1f));}}}})[_0x4c1c('0xb0')](loggerGetContactDialer(_0x4c1c('0x1fd'),_0x2b0f1f,_0x4c25dc));}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x150')]=function(_0x31cc04,_0x46c383){var _0x472500=this;var _0x19549f=[];var _0x5e9534=_0x46c383>=0x1?_0x46c383:0x1;if(_0x31cc04[_0x4c1c('0x5b')]===_0x4c1c('0x1e4')){_0x5e9534=0x1;}var _0x23750e=Math[_0x4c1c('0x1c3')](_0x31cc04[_0x4c1c('0x9f')]*_0x5e9534)-_0x31cc04[_0x4c1c('0x73')]-_0x31cc04['temp'];emitVoiceQueueSummary(_0x31cc04);if(_0x31cc04[_0x4c1c('0x1fe')]>0x0){var _0x44b106=_0x31cc04['dialLimitQueue']-_0x31cc04[_0x4c1c('0x73')]-_0x31cc04[_0x4c1c('0x55')]-_0x31cc04[_0x4c1c('0xc3')]-_0x31cc04['pTalking'];if(_0x23750e>_0x44b106){_0x23750e=_0x44b106;}}if(_0x23750e>0x0){if(_0x31cc04['dialMethod']==='booked'){_0x23750e=0x1;}if(_0x23750e>this[_0x4c1c('0x24')]){_0x23750e=this['maxNumberOriginate'];}_0x31cc04[_0x4c1c('0xc3')]+=_0x23750e;for(var _0x1b1e91 in this[_0x4c1c('0x22')]){if(typeof this[_0x4c1c('0x22')][_0x1b1e91]!==_0x4c1c('0xab')){if(this[_0x4c1c('0x22')][_0x1b1e91][_0x4c1c('0xa5')]===_0x4c1c('0x1ff')&&this['agents'][_0x1b1e91][_0x4c1c('0xae')]===_0x4c1c('0x200')){_0x19549f[_0x4c1c('0x121')](this[_0x4c1c('0x22')][_0x1b1e91]['id']);}}}this['getContactDialer'](_0x31cc04['id'],_0x19549f,_0x23750e,_0x31cc04['dialOrderByScheduledAt'],_0x31cc04)['then'](function(_0xfbd2a0){_0x31cc04[_0x4c1c('0xc3')]-=_0x23750e;_0x31cc04['temp']=_0x31cc04[_0x4c1c('0xc3')]>0x0?_0x31cc04[_0x4c1c('0xc3')]:0x0;if(!checkContactEmpty(_0xfbd2a0)){_0x472500[_0x4c1c('0xb6')](_0x31cc04)[_0x4c1c('0xb8')](sendMessageReschedule(_0x31cc04))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x31cc04[_0x4c1c('0x73')]+=_0xfbd2a0[_0x4c1c('0x12b')];_0x31cc04['message']=_0x31cc04[_0x4c1c('0x5b')]===_0x4c1c('0x1e4')?'ACTIVE':'RUNNING';for(var _0x253b11=0x0;_0x253b11<_0xfbd2a0[_0x4c1c('0x12b')];_0x253b11+=0x1){if(_[_0x4c1c('0xac')](_0xfbd2a0[_0x253b11])||_[_0x4c1c('0xac')](_0xfbd2a0[_0x253b11]['Contact'])||_[_0x4c1c('0xac')](_0xfbd2a0[_0x253b11][_0x4c1c('0x161')][_0x4c1c('0x160')])){_0x472500[_0x4c1c('0x1f9')]('[actionOriginate]\x20',_0x31cc04,_0xfbd2a0[_0x253b11]);}else{_0x472500[_0x4c1c('0xba')](_[_0x4c1c('0xce')](_0xfbd2a0[_0x253b11],['VoiceQueueId','Contact.phone']))[_0x4c1c('0xb8')](_0x472500[_0x4c1c('0x1e3')](_0x31cc04,_0xfbd2a0[_0x253b11]))['catch'](_0x472500[_0x4c1c('0xcb')]('[actionOriginate]\x20',_0x31cc04));}}}})['catch'](loggerGetContactDialer(_0x4c1c('0x201'),_0x31cc04,_0x23750e));}};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x8e')]=function(_0x21704b){if(_0x21704b['dialLimitQueue']>0x0){var _0x3528cd=_0x21704b['dialLimitQueue']-_0x21704b[_0x4c1c('0x73')]-_0x21704b[_0x4c1c('0x55')];if(_0x3528cd>0x0){this[_0x4c1c('0x202')](_0x21704b);}else{loggerPredictiveCalls[_0x4c1c('0x7f')](_0x4c1c('0x203'));}}else{this[_0x4c1c('0x202')](_0x21704b);}};Dialer['prototype'][_0x4c1c('0x202')]=function(_0x11d576){var _0x20f468=this;var _0x1e057b=[];_0x11d576[_0x4c1c('0x73')]+=0x1;for(var _0x107fb5 in this['agents']){if(typeof this[_0x4c1c('0x22')][_0x107fb5]!==_0x4c1c('0xab')){if(this[_0x4c1c('0x22')][_0x107fb5][_0x4c1c('0xa5')]===_0x4c1c('0x1ff')&&this[_0x4c1c('0x22')][_0x107fb5][_0x4c1c('0xae')]==='reachable'){_0x1e057b[_0x4c1c('0x121')](this[_0x4c1c('0x22')][_0x107fb5]['id']);}}}this[_0x4c1c('0xc2')](_0x11d576['id'],_0x1e057b,0x1,_0x11d576[_0x4c1c('0x1f6')],_0x11d576)[_0x4c1c('0xb8')](function(_0x815648){if(!checkContactEmpty(_0x815648)){checkContactLowerLimitOriginate(_0x11d576,0x1,0x0);_0x20f468[_0x4c1c('0xb6')](_0x11d576)[_0x4c1c('0xb8')](sendMessageReschedule(_0x11d576))[_0x4c1c('0xb0')](loggerCatch(_0x4c1c('0xb9')));}else{_0x11d576[_0x4c1c('0x43')]=_0x4c1c('0x1f7');if(_[_0x4c1c('0xac')](_0x815648[0x0])||_[_0x4c1c('0xac')](_0x815648[0x0][_0x4c1c('0x161')])||_['isNil'](_0x815648[0x0][_0x4c1c('0x161')][_0x4c1c('0x160')])){_0x20f468['emptyContact'](_0x4c1c('0x1fa'),_0x11d576,_0x815648[0x0]);}else{_0x20f468[_0x4c1c('0xba')](_[_0x4c1c('0xce')](_0x815648[0x0],[_0x4c1c('0xd2'),'Contact.phone']))[_0x4c1c('0xb8')](_0x20f468[_0x4c1c('0x1e3')](_0x11d576,_0x815648[0x0]))[_0x4c1c('0xb0')](_0x20f468[_0x4c1c('0xcb')]('[actionOriginatePredictive]\x20',_0x11d576));}}})[_0x4c1c('0xb0')](loggerGetContactDialer(_0x4c1c('0x204'),_0x11d576,0x1));emitVoiceQueueSummary(_0x11d576);};Dialer[_0x4c1c('0x1b')][_0x4c1c('0x1d8')]=function(_0x3e244f,_0x22a62b,_0xd37c6,_0x49175f,_0x3b0dea,_0x38042e){loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x205'));loggerPredictive[_0x4c1c('0x7f')]('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',_0x3e244f);loggerPredictive['info'](_0x4c1c('0x206'),_0x22a62b);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x207'),_0xd37c6);loggerPredictive['info'](_0x4c1c('0x208'),_0x49175f);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x209'),_0x3b0dea);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x84'));return new BPromise(function(_0x4ad847,_0x1545cb){if(_0x3e244f<=0x0||isNaN(_0x3e244f)){return _0x1545cb(msgResponse(_0x4c1c('0x20a'),_0x4c1c('0x49'),_0x4c1c('0x20b')+_0x3e244f));}if(_0xd37c6<=0x0||isNaN(_0xd37c6)){return _0x1545cb(msgResponse(_0x4c1c('0x20a'),_0x4c1c('0x49'),'Ts\x20=\x20'+_0xd37c6));}if(_0x49175f<=0x0||isNaN(_0x49175f)){return _0x1545cb(msgResponse(_0x4c1c('0x20a'),'Error',_0x4c1c('0x20c')+_0x49175f));}if(_0x22a62b<=0x0||isNaN(_0x22a62b)){return _0x1545cb(msgResponse(_0x4c1c('0x20a'),'Error','interval\x20=\x20'+_0x22a62b));}if(_0x3b0dea<=0x0||isNaN(_0x3b0dea)){return _0x1545cb(msgResponse(_0x4c1c('0x20a'),'Error',_0x4c1c('0x20d')+_0x3b0dea));}_0x38042e=_0x38042e||0x0;var _0x1cba5b=0x1/_0xd37c6;var _0x2a3292=0x0;var _0x18b16e=0x0;var _0x447c6b=0x0;var _0x434767=0x0;for(var _0x2c6d4e=0x0;_0x447c6b<_0x3b0dea;_0x2c6d4e+=0x1){_0x18b16e=_0x2c6d4e/_0x22a62b;_0x2a3292=(_0x49175f*_0x18b16e+_0x38042e)/_0x1cba5b;_0x447c6b=erlangb(_0x2a3292,_0x3e244f);_0x434767=_0x2a3292/_0x3e244f*(0x1-erlangb(_0x2a3292,_0x3e244f));}return _0x4ad847({'erlangCalls':_0x2c6d4e,'erlangCallToSecond':_0x22a62b/_0x2c6d4e,'erlangAbandonmentRate':_0x447c6b,'erlangBusyFactor':_0x434767});});};Dialer['prototype']['busyFactor']=function(_0x381fb6,_0x3cb0f9,_0x4805d6,_0x531f09,_0x1d7b8b,_0x12bd60){loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x20e'));loggerPredictive['info'](_0x4c1c('0x20f'),_0x381fb6);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x206'),_0x3cb0f9);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x207'),_0x4805d6);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x208'),_0x531f09);loggerPredictive[_0x4c1c('0x7f')](_0x4c1c('0x210'),_0x1d7b8b);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x5067ef,_0x41171f){if(_0x381fb6<=0x0||isNaN(_0x381fb6)){return _0x41171f(msgResponse(_0x4c1c('0x211'),_0x4c1c('0x49'),_0x4c1c('0x20b')+_0x381fb6));}if(_0x4805d6<=0x0||isNaN(_0x4805d6)){return _0x41171f(msgResponse(_0x4c1c('0x211'),_0x4c1c('0x49'),'Ts\x20=\x20'+_0x4805d6));}if(_0x531f09<=0x0||isNaN(_0x531f09)){return _0x41171f(msgResponse(_0x4c1c('0x211'),_0x4c1c('0x49'),_0x4c1c('0x20c')+_0x531f09));}if(_0x3cb0f9<=0x0||isNaN(_0x3cb0f9)){return _0x41171f(msgResponse(_0x4c1c('0x211'),_0x4c1c('0x49'),_0x4c1c('0x212')+_0x3cb0f9));}if(_0x1d7b8b<=0x0||isNaN(_0x1d7b8b)){return _0x41171f(msgResponse(_0x4c1c('0x211'),'Error',_0x4c1c('0x213')+_0x1d7b8b));}_0x12bd60=_0x12bd60||0x0;var _0x2889d5=0x1/_0x4805d6;var _0x3bd210=0x0;var _0x150ff9=0x0;var _0x2672b2=0x0;var _0xd404e=0x0;for(var _0x2f57ed=0x0;_0xd404e<_0x1d7b8b;_0x2f57ed+=0x1){_0x150ff9=_0x2f57ed/_0x3cb0f9;_0x3bd210=(_0x531f09*_0x150ff9+_0x12bd60)/_0x2889d5;_0x2672b2=erlangb(_0x3bd210,_0x381fb6);_0xd404e=_0x3bd210/_0x381fb6*(0x1-erlangb(_0x3bd210,_0x381fb6));}return _0x5067ef({'erlangCalls':_0x2f57ed,'erlangCallToSecond':_0x3cb0f9/_0x2f57ed,'erlangAbandonmentRate':_0x2672b2,'erlangBusyFactor':_0xd404e});});};module[_0x4c1c('0x214')]=Dialer; \ No newline at end of file +var _0xea1a=['[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','Success','isTrunkReachable','SIP/%s','status','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','MACHINE','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[syncHangupInAMDIvr][createHistory]','Machine','countdropretry','countabandonedretry','CampaignId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','cause-txt','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','syncAgentConnect','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','countglobal','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','rrmemory','push','pick','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','Action','iftime\x20%s,%s','interval','timezones','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','handleIvr','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','launchHandleIvr','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','%s%s','toUpper','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','Error','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','../rpc/cmHopper','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','agentcomplete','syncAgentComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','isUndefined','\x20AGENTS\x20NOT\x20LOGGED','message','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','undefined','isNil','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xea1a,0x158));var _0xaea1=function(_0x150005,_0x15f4ac){_0x150005=_0x150005-0x0;var _0x1bb4df=_0xea1a[_0x150005];return _0x1bb4df;};'use strict';var util=require(_0xaea1('0x0'));var _=require(_0xaea1('0x1'));var BPromise=require(_0xaea1('0x2'));var uuid=require(_0xaea1('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xaea1('0x4'));var Redis=require(_0xaea1('0x5'));var ut=require(_0xaea1('0x6'));var config=require(_0xaea1('0x7'));var logger=require(_0xaea1('0x8'))(_0xaea1('0x9'));var loggerBooked=require(_0xaea1('0x8'))(_0xaea1('0xa'));var loggerPredictive=require('../../../config/logger')(_0xaea1('0xb'));var loggerPredictiveCalls=require(_0xaea1('0x8'))(_0xaea1('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xaea1('0xd'));var ami=require('../ami');config[_0xaea1('0xe')]=_['defaults'](config[_0xaea1('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xaea1('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xaea1('0x10'));var Action=require(_0xaea1('0x11'));var History=require('./history');var Final=require(_0xaea1('0x12'));var AgentComplete=require(_0xaea1('0x13'));var QueueCallerAbandon=require(_0xaea1('0x14'));var Hangup=require(_0xaea1('0x15'));var ipAgi=process[_0xaea1('0x16')][_0xaea1('0x17')]||_0xaea1('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xaea1('0x19')};var Sequence=function(){};Sequence[_0xaea1('0x1a')][_0xaea1('0x1b')]=function(_0x294de1){this[_0xaea1('0x1c')]=this[_0xaea1('0x1c')]?this[_0xaea1('0x1c')][_0xaea1('0x1d')](_0x294de1):_0x294de1();};function Dialer(_0xaf72ab,_0x45269e){this[_0xaea1('0x1e')]=new Sequence();this[_0xaea1('0x1f')]=_0x45269e;this[_0xaea1('0x20')]=_0xaf72ab[_0xaea1('0x20')];this[_0xaea1('0x21')]=_0xaf72ab[_0xaea1('0x21')];this[_0xaea1('0x22')]=_0xaf72ab[_0xaea1('0x22')];this['trunks']=_0xaf72ab[_0xaea1('0x23')];this['maxNumberOriginate']=config[_0xaea1('0x24')]||0x2;this[_0xaea1('0x25')]={};this[_0xaea1('0x26')]={};this[_0xaea1('0x27')]={};this[_0xaea1('0x28')]={};this[_0xaea1('0x29')]={};this[_0xaea1('0x2a')]={};this[_0xaea1('0x2b')]={};this[_0xaea1('0x2c')]={};this[_0xaea1('0x2d')]={};this['queueBookedRR']={};ami['on'](_0xaea1('0x2e'),this['syncAgentConnect']['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xaea1('0x2f')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xaea1('0x2f')](this));ami['on'](_0xaea1('0x30'),this[_0xaea1('0x31')]['bind'](this));ami['on']('custom:queuesummary',this[_0xaea1('0xd')][_0xaea1('0x2f')](this));ami['on'](_0xaea1('0x32'),this[_0xaea1('0x33')][_0xaea1('0x2f')](this));ami['on']('newexten',this[_0xaea1('0x34')][_0xaea1('0x2f')](this));ami['on'](_0xaea1('0x35'),this[_0xaea1('0x36')][_0xaea1('0x2f')](this));ami['on'](_0xaea1('0x37'),this[_0xaea1('0x38')]['bind'](this));ami['on'](_0xaea1('0x39'),this['syncQueueStatusComplete'][_0xaea1('0x2f')](this));this[_0xaea1('0x3a')]();this['loopClearZombieChannels']();}function isNotNull(_0x100f39){return _0x100f39!==null&&!_[_0xaea1('0x3b')](_0x100f39);}function checkIsLoggedIn(_0x585888,_0x394591){return function(){if(_0x394591<=0x0){_0x585888['message']='AGENTS_NOT_LOGGED';throw _0x585888['name']+_0xaea1('0x3c');}};}function isActive(_0x5232b7){return _0x5232b7;}function checkIsActive(_0x1a5f9a,_0x54a217){return function(){if(!isActive(_0x54a217)){_0x1a5f9a[_0xaea1('0x3d')]='NOT_ACTIVE';throw _0x1a5f9a[_0xaea1('0x3e')]+_0xaea1('0x3f');}};}function checkInterval(_0x36e2d9){return function(){if(!isNotNull(_0x36e2d9[_0xaea1('0x40')])){_0x36e2d9[_0xaea1('0x3d')]='INTERVAL_IS_NULL';throw _0x36e2d9[_0xaea1('0x3e')]+_0xaea1('0x41');}if(!isNotNull(_0x36e2d9[_0xaea1('0x40')][_0xaea1('0x42')])){_0x36e2d9['message']=_0xaea1('0x43');throw _0x36e2d9[_0xaea1('0x3e')]+_0xaea1('0x41');}if(!isNotNull(_[_0xaea1('0x44')](_0x36e2d9[_0xaea1('0x40')][_0xaea1('0x42')]))){_0x36e2d9[_0xaea1('0x3d')]=_0xaea1('0x43');throw _0x36e2d9[_0xaea1('0x3e')]+_0xaea1('0x41');}};}function msgResponse(_0x2a5b92,_0x1f1f73,_0x3168bc){return{'action':_0x2a5b92,'response':_0x1f1f73,'message':_0x3168bc,'stack':_0x3168bc};}function myreject(_0x323302){return function(_0x48a512){return _0x323302(msgResponse('[ifTime][Action]','Error',JSON[_0xaea1('0x45')](_0x48a512)));};}function getSeconds(_0x47f840,_0xea39ac){var _0x72d144=moment(_0x47f840)['milliseconds'](0x0);var _0x43fb47=moment(_0xea39ac)[_0xaea1('0x46')](0x0);return _0x72d144[_0xaea1('0x47')](_0x43fb47,_0xaea1('0x48'));}function emit(_0x2fd4fd,_0x18edb8,_0x3b75a3){io['to'](_0x2fd4fd)[_0xaea1('0x49')](_0x18edb8,_0x3b75a3);}function emitVoiceQueueSummary(_0x4a43f8){if(_0x4a43f8[_0xaea1('0x4a')]===_0xaea1('0x4b')){var _0x2cc143={'id':_0x4a43f8['id'],'name':_0x4a43f8[_0xaea1('0x3e')],'strategy':_0x4a43f8[_0xaea1('0x4c')],'answered':_0x4a43f8[_0xaea1('0x4d')],'available':_0x4a43f8[_0xaea1('0x4e')],'loggedIn':_0x4a43f8['loggedIn'],'pTalking':_0x4a43f8[_0xaea1('0x4f')],'sumBillable':_0x4a43f8[_0xaea1('0x50')],'sumDuration':_0x4a43f8[_0xaea1('0x51')],'sumHoldTime':_0x4a43f8[_0xaea1('0x52')]||0x0,'talking':_0x4a43f8[_0xaea1('0x53')],'total':_0x4a43f8[_0xaea1('0x54')],'type':_0x4a43f8[_0xaea1('0x4a')],'unmanaged':_0x4a43f8[_0xaea1('0x55')],'abandoned':_0x4a43f8[_0xaea1('0x56')],'waiting':_0x4a43f8['waiting'],'loggedInDb':_0x4a43f8['loggedInDb'],'dialActive':_0x4a43f8[_0xaea1('0x57')],'dialMethod':_0x4a43f8['dialMethod'],'dialOriginateCallerIdName':_0x4a43f8[_0xaea1('0x58')],'dialOriginateCallerIdNumber':_0x4a43f8['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4a43f8[_0xaea1('0x59')],'dialPrefix':_0x4a43f8[_0xaea1('0x5a')],'outboundAnswerAgiCallsDay':_0x4a43f8[_0xaea1('0x5b')],'outboundAnswerCallsDay':_0x4a43f8['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4a43f8[_0xaea1('0x5c')],'outboundBusyCallsDay':_0x4a43f8['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4a43f8[_0xaea1('0x5d')],'outboundDropCallsDayACS':_0x4a43f8[_0xaea1('0x5e')],'outboundDropCallsDayCallersExit':_0x4a43f8[_0xaea1('0x5f')],'outboundDropCallsDayTimeout':_0x4a43f8[_0xaea1('0x60')],'outboundNoAnswerCallsDay':_0x4a43f8[_0xaea1('0x61')],'outboundNoSuchCallsDay':_0x4a43f8[_0xaea1('0x62')],'outboundOriginateFailureCallsDay':_0x4a43f8[_0xaea1('0x63')],'outboundReCallsDay':_0x4a43f8[_0xaea1('0x64')],'outboundRejectCallsDay':_0x4a43f8[_0xaea1('0x65')],'outboundUnknownCallsDay':_0x4a43f8[_0xaea1('0x66')],'predictiveIntervalAnsweredCalls':_0x4a43f8[_0xaea1('0x67')],'predictiveIntervalAvgHoldtime':_0x4a43f8[_0xaea1('0x68')],'predictiveIntervalAvgTalktime':_0x4a43f8[_0xaea1('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x4a43f8[_0xaea1('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x4a43f8[_0xaea1('0x6b')],'predictiveIntervalErlangCalls':_0x4a43f8[_0xaea1('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x4a43f8[_0xaea1('0x6d')],'predictiveIntervalHitRate':_0x4a43f8[_0xaea1('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x4a43f8['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4a43f8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4a43f8[_0xaea1('0x6f')],'predictiveIntervalTotalCalls':_0x4a43f8[_0xaea1('0x70')],'message':_0x4a43f8[_0xaea1('0x3d')],'originated':_0x4a43f8[_0xaea1('0x71')],'erlangCalls':_0x4a43f8['erlangCalls'],'erlangCallToSecond':_0x4a43f8[_0xaea1('0x72')],'erlangAbandonmentRate':_0x4a43f8[_0xaea1('0x73')],'erlangBusyFactor':_0x4a43f8[_0xaea1('0x74')],'startPredictive':_0x4a43f8[_0xaea1('0x2a')],'startProgressive':_0x4a43f8[_0xaea1('0x2b')]};if(_0x4a43f8[_0xaea1('0x75')]){_0x2cc143[_0xaea1('0x75')]={'id':_0x4a43f8[_0xaea1('0x75')]['id'],'name':_0x4a43f8[_0xaea1('0x75')]['name'],'active':_0x4a43f8[_0xaea1('0x75')][_0xaea1('0x76')],'callerid':_0x4a43f8['Trunk'][_0xaea1('0x77')]};}if(_0x4a43f8[_0xaea1('0x40')]){_0x2cc143[_0xaea1('0x40')]={'id':_0x4a43f8[_0xaea1('0x40')]['id'],'name':_0x4a43f8[_0xaea1('0x40')][_0xaea1('0x3e')]};}var _0x48435f=md5(JSON[_0xaea1('0x45')](_0x2cc143));if(_0x4a43f8[_0xaea1('0x4')]!==_0x48435f){_0x4a43f8[_0xaea1('0x4')]=_0x48435f;emit(util[_0xaea1('0x78')](_0xaea1('0x79'),_0x2cc143[_0xaea1('0x3e')]),_0xaea1('0x7a'),_0x2cc143);}}}function emitCampaignSummary(_0x53248b){if(_0x53248b['type']===_0xaea1('0x7b')){emit(util[_0xaea1('0x78')](_0xaea1('0x7c'),_0x53248b[_0xaea1('0x3e')]),_0xaea1('0x7d'),_0x53248b);}}function checkGetDataPredictive(_0x5c69ad){if(isNotNull(_0x5c69ad)&&!_[_0xaea1('0x44')](_0x5c69ad)){loggerPredictive['info'](_0xaea1('0x7e'));loggerPredictive['info'](_0xaea1('0x7f'),_0x5c69ad[_0xaea1('0x70')]);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x81'),_0x5c69ad[_0xaea1('0x67')]);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x82'),_0x5c69ad[_0xaea1('0x6b')]);loggerPredictive['info'](_0xaea1('0x83'),_0x5c69ad['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x84'),_0x5c69ad[_0xaea1('0x68')]);loggerPredictive['info'](_0xaea1('0x85'),_0x5c69ad[_0xaea1('0x69')]);loggerPredictive[_0xaea1('0x80')]('---------------------------');if(_0x5c69ad['predictiveIntervalTotalCalls']>0x0){if(!_[_0xaea1('0x3b')](_0x5c69ad[_0xaea1('0x69')])&&_0x5c69ad[_0xaea1('0x69')]>0x0){return!![];}loggerPredictive['info'](_0xaea1('0x86'));if(!_['isUndefined'](_0x5c69ad[_0xaea1('0x68')])&&_0x5c69ad[_0xaea1('0x68')]>0x0){return!![];}loggerPredictive[_0xaea1('0x80')](_0xaea1('0x87'));}else{loggerPredictive[_0xaea1('0x80')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xaea1('0x88'));}return![];}function mergeDataErlangB(_0x411cd8){return function(_0x3b5778){loggerPredictive[_0xaea1('0x80')](_0xaea1('0x89'));loggerPredictive[_0xaea1('0x80')](_0xaea1('0x8a'),_0x3b5778[_0xaea1('0x8b')]);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x8c'),_0x3b5778[_0xaea1('0x72')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3b5778[_0xaea1('0x73')]);loggerPredictive['info'](_0xaea1('0x8d'),_0x3b5778[_0xaea1('0x74')]);loggerPredictive[_0xaea1('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3b5778[_0xaea1('0x73')]);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x8e'));_[_0xaea1('0x8f')](_0x411cd8,_0x3b5778);};}function getDiff(_0x136e5c){var _0x5934c9=moment()[_0xaea1('0x46')](0x0);var _0xfaa5e9=moment(_0x136e5c)[_0xaea1('0x46')](0x0);return _0x5934c9['diff'](_0xfaa5e9,_0xaea1('0x48'));}function ifInterval(_0x5e4e8c,_0xed2ac4){if(_[_0xaea1('0x3b')](_0xed2ac4)){return![];}return getDiff(_0xed2ac4)<_0x5e4e8c*0x3c;}function freeVariablesPredictive(_0x3d4dfb){if(isNotNull(_0x3d4dfb)){if(!_[_0xaea1('0x3b')](_0x3d4dfb[_0xaea1('0x2b')])){_0x3d4dfb[_0xaea1('0x2b')]=undefined;loggerPredictive[_0xaea1('0x80')](_0x3d4dfb[_0xaea1('0x3e')],_0xaea1('0x90'));}if(!_[_0xaea1('0x3b')](_0x3d4dfb[_0xaea1('0x2a')])){_0x3d4dfb[_0xaea1('0x2a')]=undefined;loggerPredictive[_0xaea1('0x80')](_0x3d4dfb[_0xaea1('0x3e')],_0xaea1('0x91'));}if(!_[_0xaea1('0x3b')](_0x3d4dfb[_0xaea1('0x92')])){clearInterval(_0x3d4dfb[_0xaea1('0x92')]);_0x3d4dfb[_0xaea1('0x92')]=undefined;loggerPredictive[_0xaea1('0x80')](_0x3d4dfb[_0xaea1('0x3e')],_0xaea1('0x93'));}}}function erlangb(_0x40c0ab,_0x1581a8){if(_0x1581a8===0x0){return 0x0;}var _0x3dc4b9=0x1;for(var _0x3116d5=0x1;_0x3116d5<=_0x1581a8;_0x3116d5+=0x1){_0x3dc4b9=0x1+_0x3dc4b9*_0x3116d5/_0x40c0ab;}return 0x1/_0x3dc4b9;}function isVoiceQueueOutbound(_0x2c2e03){return _0x2c2e03==='outbound';}function isNotPreview(_0x1e8d8e){return _0x1e8d8e!==_0xaea1('0x1f');}function isCampaignIvr(_0x338775){return _0x338775===_0xaea1('0x7b');}function getCallerId(_0x1ec15a,_0x47fe5c,_0x20ae74){if(!_[_0xaea1('0x3b')](_0x20ae74)&&typeof _0x20ae74===_0xaea1('0x94')&&!_[_0xaea1('0x44')](_0x20ae74)){if(!_[_0xaea1('0x3b')](_0x47fe5c)&&typeof _0x47fe5c==='string'&&!_[_0xaea1('0x44')](_0x47fe5c)){return util['format']('\x22%s\x22\x20<%s>',_0x47fe5c,_0x20ae74);}return util[_0xaea1('0x78')](_0xaea1('0x95'),_0x20ae74,_0x20ae74);}if(!_[_0xaea1('0x3b')](_0x1ec15a)&&typeof _0x1ec15a==='string'&&!_['isEmpty'](_0x1ec15a)){return _0x1ec15a;}return _0xaea1('0x96');}function loggerCatchQueueSummary(_0x19ef6e,_0x3e75a0){return function(_0x5e5964){freeVariablesPredictive(_0x3e75a0);emitVoiceQueueSummary(_0x3e75a0);emitCampaignSummary(_0x3e75a0);loggerSyncQueueSummary[_0xaea1('0x97')](_0x19ef6e,util[_0xaea1('0x98')](_0x5e5964,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x38a5d5,_0x15ea18){return function(_0x397d2f){loggerPredictive['error'](_0x15ea18[_0xaea1('0x3e')],_0x38a5d5);loggerPredictive[_0xaea1('0x97')](_0x397d2f[_0xaea1('0x99')]);freeVariablesPredictive(_0x15ea18);};}function loggerCatch(_0x2949b2){return function(_0x540f86){logger[_0xaea1('0x97')](_0x2949b2,util[_0xaea1('0x98')](_0x540f86,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x558a57){return _0x558a57&&!_[_0xaea1('0x3b')](_0x558a57)&&_0x558a57['length']>0x0;}function decremetOriginate(_0x49ade2){if(!_[_0xaea1('0x3b')](_0x49ade2)&&_0x49ade2!==null){if(typeof _0x49ade2['originated']!=='undefined'){if(_0x49ade2['originated']>0x0){_0x49ade2[_0xaea1('0x71')]-=0x1;}else{logger[_0xaea1('0x97')](_0xaea1('0x9a'));}}}else{logger[_0xaea1('0x97')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x43bf06,_0x28b8db,_0x1d1d9e){if(_0x28b8db>_0x1d1d9e){for(var _0x200180=0x0;_0x200180<_0x28b8db-_0x1d1d9e;_0x200180+=0x1){decremetOriginate(_0x43bf06);}}}function loggerGetContactDialer(_0x553946,_0xc8bc2a,_0x15b909){return function(_0x384681){checkContactLowerLimitOriginate(_0xc8bc2a,_0x15b909,0x0);logger['error'](_0x553946,util[_0xaea1('0x98')](_0x384681,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x491140){return function(_0x265c58){if(isNotNull(_0x265c58)&&isNotNull(_0x265c58[0x0])){if(_0x265c58[0x0]['contactsRescheduled']>0x0){_0x491140[_0xaea1('0x3d')]=_0xaea1('0x9b');logger[_0xaea1('0x80')](_0xaea1('0x9c')+_0x491140['name'],_0x265c58[0x0][_0xaea1('0x9d')],'contacts');}else{_0x491140[_0xaea1('0x3d')]=_0xaea1('0x9e');logger[_0xaea1('0x80')](_0xaea1('0x9f')+_0x491140['name']);}}};}function notSendMessagesQueue(_0x573b71){if(_0x573b71[_0xaea1('0xa0')]){freeVariablesPredictive(_0x573b71);if(_0x573b71[_0xaea1('0x71')]===0x0&&_0x573b71[_0xaea1('0x53')]===0x0&&_0x573b71[_0xaea1('0xa1')]===0x0&&(_0x573b71[_0xaea1('0x4f')]||0x0)===0x0){_0x573b71['sendMessageOneNotActive']=![];_0x573b71[_0xaea1('0x4e')]=0x0;_0x573b71['message']=_0xaea1('0xa2');loggerSyncQueueSummary[_0xaea1('0x97')](_0xaea1('0xa3'),_0x573b71[_0xaea1('0x3e')],_0xaea1('0xa4'));}else{_0x573b71[_0xaea1('0x3d')]=_0xaea1('0xa5');loggerSyncQueueSummary[_0xaea1('0x97')](_0xaea1('0xa3'),_0x573b71[_0xaea1('0x3e')],_0xaea1('0xa6'));}emitVoiceQueueSummary(_0x573b71);}}function notSendMessagesCampaign(_0x352596){if(_0x352596[_0xaea1('0xa0')]){if(_0x352596['originated']===0x0){_0x352596[_0xaea1('0xa0')]=![];_0x352596['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xaea1('0x97')](_0xaea1('0xa7'),_0x352596[_0xaea1('0x3e')],'is\x20not\x20active');}else{_0x352596[_0xaea1('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xaea1('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x352596[_0xaea1('0x3e')],'is\x20disactive');}emitCampaignSummary(_0x352596);}}function createObjHistory(_0x225e36,_0xa1b7f4,_0x491951,_0x3666fc,_0x274e1c){_0x225e36[_0xaea1('0x3d')]=_0x491951;var _0x50d89a=new Action(_0x225e36,_0xa1b7f4);var _0x24fadc=new History(_0x50d89a);_0x24fadc[_0xaea1('0xa8')]=_0x3666fc;_0x24fadc[_0xaea1('0xa9')]=_0x274e1c;_0x24fadc[_0xaea1('0xaa')]=_0x50d89a['starttime'];return _0x24fadc;}Dialer[_0xaea1('0x1a')][_0xaea1('0xab')]=function(){var _0x4aab4d=this;setInterval(function(){_0x4aab4d[_0xaea1('0xac')](_0x4aab4d[_0xaea1('0x28')],_0xaea1('0xad'));_0x4aab4d[_0xaea1('0xac')](_0x4aab4d[_0xaea1('0x26')],_0xaea1('0xae'));},0x32c8);};Dialer[_0xaea1('0x1a')][_0xaea1('0xac')]=function(_0x3b889e,_0xa8fc4a){var _0x5a0184=this;for(var _0x291688 in _0x3b889e){if(typeof _0x3b889e[_0x291688]!==_0xaea1('0xaf')){this[_0xaea1('0x1e')][_0xaea1('0x1b')](function(){if(!_[_0xaea1('0xb0')](_0x3b889e[_0x291688])){return ami['Action']({'action':'status','channel':_0x3b889e[_0x291688][_0xaea1('0xb1')]})[_0xaea1('0xb2')](function(_0x2ef468){if(_0x2ef468[_0xaea1('0x3d')]===_0xaea1('0xb3')){setTimeout(function(){if(_0x3b889e[_0x291688]&&_0x3b889e[_0x291688][_0xaea1('0x4a')]!==_0xaea1('0x7b')){_0x5a0184[_0xaea1('0xb4')](_0x5a0184[_0xaea1('0x20')][_0x3b889e[_0x291688][_0xaea1('0xb5')]]);logger[_0xaea1('0x97')](_0xaea1('0xb6'),_0xa8fc4a,_0x291688,_0x3b889e[_0x291688]['queue']);delete _0x3b889e[_0x291688];}if(_0x3b889e[_0x291688]&&_0x3b889e[_0x291688][_0xaea1('0x4a')]===_0xaea1('0x7b')){_0x5a0184[_0xaea1('0xb4')](_0x5a0184['campaigns'][_0x3b889e[_0x291688][_0xaea1('0xb5')]]);logger[_0xaea1('0x97')](_0xaea1('0xb7'),_0xa8fc4a,_0x291688,_0x3b889e[_0x291688]['queue']);delete _0x3b889e[_0x291688];}},0x2328);}});}});}}};Dialer[_0xaea1('0x1a')][_0xaea1('0xb8')]=function(_0x2e0671){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper['countReScheduled'](_0x2e0671))['catch'](loggerCatch(_0xaea1('0xbb')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xbc')]=function(_0x1858a1){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopperBlack[_0xaea1('0xbc')](_0x1858a1))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xbd')));};Dialer['prototype'][_0xaea1('0xbe')]=function(_0x1943e9){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopperBlack['checkIsBlackListIvr'](_0x1943e9))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xbf')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xc0')]=function(_0x3a9163){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopperHistory[_0xaea1('0xc1')](_0x3a9163))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xc2')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xc3')]=function(_0x57ece9){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper[_0xaea1('0xc3')](_0x57ece9))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xc4')));};Dialer[_0xaea1('0x1a')]['unlockContact']=function(_0xbdf61e,_0xb2ceaa,_0x214d36){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper[_0xaea1('0xc5')](_0xbdf61e,_0xb2ceaa,_0x214d36))['catch'](loggerCatch(_0xaea1('0xc6')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xc7')]=function(_0x19b05a,_0x48d0b3,_0x3a81f4,_0x4e187e,_0x8fd997){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper[_0xaea1('0xc7')](_0x19b05a,_0x48d0b3,_0x3a81f4,_0x4e187e))['catch'](function(_0x53a0e1){_0x8fd997['temp']-=_0x3a81f4;_0x8fd997[_0xaea1('0xc8')]=_0x8fd997['temp']>0x0?_0x8fd997[_0xaea1('0xc8')]:0x0;loggerCatch(_0xaea1('0xc9'))(_0x53a0e1);});};Dialer[_0xaea1('0x1a')]['getContactDialerIvr']=function(_0x44aa43,_0x4fe083,_0x5e834e,_0x18615b){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper[_0xaea1('0xca')](_0x44aa43,_0x4fe083,_0x5e834e))['catch'](function(_0x4f18bf){_0x18615b[_0xaea1('0xc8')]-=_0x4fe083;_0x18615b[_0xaea1('0xc8')]=_0x18615b[_0xaea1('0xc8')]>0x0?_0x18615b[_0xaea1('0xc8')]:0x0;loggerCatch(_0xaea1('0xcb'))(_0x4f18bf);});};Dialer[_0xaea1('0x1a')][_0xaea1('0xcc')]=function(_0x5b74fa){return BPromise['resolve']()[_0xaea1('0xba')](voiceQueueRt[_0xaea1('0xcc')](_0x5b74fa))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xcd')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xce')]=function(_0x2f7370){return BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](cmHopper[_0xaea1('0xce')](_0x2f7370))[_0xaea1('0xb2')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype']['createHistory']=function(_0x5b66e2){return BPromise['resolve']()[_0xaea1('0xba')](cmHopperHistory[_0xaea1('0xcf')](_0x5b66e2))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xd0')));};Dialer[_0xaea1('0x1a')][_0xaea1('0xb4')]=function(_0x4928f8){if(!_[_0xaea1('0x3b')](_0x4928f8)&&_0x4928f8!==null){if(typeof _0x4928f8[_0xaea1('0x71')]!=='undefined'){if(_0x4928f8[_0xaea1('0x71')]>0x0){_0x4928f8['originated']-=0x1;}else{logger['error'](_0xaea1('0xd1'));}}}else{logger[_0xaea1('0x97')](_0xaea1('0xd2'));}};Dialer[_0xaea1('0x1a')][_0xaea1('0xd3')]=function(_0x301c36,_0x4570d3){var _0x11f746=this;return function(_0x82af2a){_0x11f746[_0xaea1('0xb4')](_0x4570d3);logger[_0xaea1('0x97')](_0x301c36,util['inspect'](_0x82af2a,{'showHidden':![],'depth':null}));};};Dialer[_0xaea1('0x1a')][_0xaea1('0xd4')]=function(_0x816ed4,_0x57be45,_0x4dd85b){var _0x16e455={'state':0x19,'statedesc':_0xaea1('0xd5')};this[_0xaea1('0xb4')](_0x57be45);this['saveInDb'](_[_0xaea1('0x8f')](_0x16e455,_['pick'](_0x4dd85b,[_0xaea1('0xd6'),'ListId',_0xaea1('0xd7'),_0xaea1('0xd8'),'CampaignId'])),_0xaea1('0xd9'),'[emptyContact]');logger[_0xaea1('0x97')](_0x816ed4);};Dialer[_0xaea1('0x1a')]['isSuccess']=function(_0x494be5){return _0x494be5===_0xaea1('0xda');};Dialer['prototype'][_0xaea1('0xdb')]=function(_0x3dd851){return!_[_0xaea1('0x3b')](_0x3dd851)&&_0x3dd851&&!_[_0xaea1('0x3b')](_0x3dd851[_0xaea1('0x3e')])&&!_['isUndefined'](_0x3dd851[_0xaea1('0x76')])&&_0x3dd851[_0xaea1('0x76')]&&(this[_0xaea1('0x23')][util[_0xaea1('0x78')](_0xaea1('0xdc'),_0x3dd851[_0xaea1('0x3e')])][_0xaea1('0xdd')]==='reachable'||this[_0xaea1('0x23')][util['format'](_0xaea1('0xdc'),_0x3dd851[_0xaea1('0x3e')])][_0xaea1('0xdd')]==='unmonitored');};Dialer['prototype'][_0xaea1('0xde')]=function(_0x47315a,_0x4ee902,_0xdc4881){this[_0xaea1('0xcf')](_0x47315a)[_0xaea1('0xb2')](loggerCatch(_0x4ee902));this['moveContactManagedDialer'](_0x47315a)[_0xaea1('0xb2')](loggerCatch(_0xdc4881));};Dialer[_0xaea1('0x1a')]['syncVarSet']=function(_0x33e518){var _0x3c7848=this[_0xaea1('0x28')][_0x33e518[_0xaea1('0xdf')]];var _0x2a8292;if(!_['isNil'](_0x33e518)&&!_[_0xaea1('0xb0')](_0x33e518[_0xaea1('0xe0')])&&!_[_0xaea1('0xb0')](_0x33e518[_0xaea1('0xe0')][_0xaea1('0xe1')])&&_0x33e518[_0xaea1('0xe2')]===_0xaea1('0xe3')&&_0x3c7848){if(_0x3c7848['type']!==_0xaea1('0x7b')&&this[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0xe4')]&&_0x33e518[_0xaea1('0xe5')]==='HANGUP'){delete this[_0xaea1('0x28')][_0x33e518[_0xaea1('0xdf')]];this[_0xaea1('0xb4')](this[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]]);this[_0xaea1('0x20')][_0x3c7848['queue']][_0xaea1('0xe6')]+=0x1;this[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0x5b')]+=0x1;_0x2a8292=new Hangup(_0x3c7848,_0x33e518);_0x2a8292['state']=0x12;_0x2a8292[_0xaea1('0xa9')]=_0xaea1('0xe7');_0x2a8292[_0xaea1('0xe8')]=_0xaea1('0xe9');ami['emit'](_0xaea1('0xea'),ut['buildObj'](_0x2a8292,_0xaea1('0xeb')));this[_0xaea1('0xde')](_0x2a8292,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x3c7848[_0xaea1('0x4a')]!==_0xaea1('0x7b')&&this[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0xe4')]&&_0x33e518[_0xaea1('0xe5')]===_0xaea1('0xec')){var _0x37eca2=this;return new BPromise(function(_0x58be2a,_0x44e157){delete _0x37eca2['uniqueId'][_0x33e518['uniqueid']];_0x37eca2[_0xaea1('0xb4')](_0x37eca2['voiceQueues'][_0x3c7848[_0xaea1('0xb5')]]);_0x37eca2[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x37eca2[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0x5b')]+=0x1;var _0x35e5f6=_0x37eca2[_0xaea1('0x20')][_0x3c7848[_0xaea1('0xb5')]];var _0x587489=new Hangup(_0x3c7848,_0x33e518);_0x587489[_0xaea1('0xa8')]=0x13;_0x587489[_0xaea1('0xa9')]='Machine';_0x587489[_0xaea1('0xe8')]=_0xaea1('0xe9');_0x587489[_0xaea1('0xed')]+=0x1;_0x587489['countglobal']+=0x1;_0x587489['amd']=!![];ami[_0xaea1('0x49')](_0xaea1('0xea'),ut[_0xaea1('0xee')](_0x587489,_0xaea1('0xeb')));_0x37eca2[_0xaea1('0xcf')](_0x587489)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xef')));if(_0x587489[_0xaea1('0xf0')]+_0x587489[_0xaea1('0xf1')]+_0x587489[_0xaea1('0xf2')]+_0x587489[_0xaea1('0xf3')]+_0x587489['countdropretry']+_0x587489['countabandonedretry']+_0x587489['countmachineretry']+_0x587489[_0xaea1('0xf4')]>=_0x35e5f6[_0xaea1('0xf5')]){_0x37eca2[_0xaea1('0xf6')](_0x587489,_0x58be2a,_0x44e157,'reason19\x20machine....');}else{if(_0x587489[_0xaea1('0xed')]>=_0x35e5f6[_0xaea1('0xf7')]){_0x37eca2[_0xaea1('0xf8')](_0x587489,_0x58be2a,_0x44e157,'reason\x2019\x20machine....');}else{_0x37eca2[_0xaea1('0xc3')]({'active':![],'countmachineretry':_0x587489[_0xaea1('0xed')],'scheduledat':moment()[_0xaea1('0xf9')](_0x35e5f6[_0xaea1('0xfa')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x587489['ContactId'],'ListId':_0x587489[_0xaea1('0xfd')],'VoiceQueueId':_0x587489[_0xaea1('0xd8')]||undefined,'CampaignId':_0x587489['CampaignId']||undefined})[_0xaea1('0xb2')](loggerCatch('[rescheduleContact][Machine]'));_0x58be2a({'reschedule':0x1});}}});}if(_0x3c7848['type']===_0xaea1('0x7b')&&this[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0xe4')]&&_0x33e518[_0xaea1('0xe5')]==='HANGUP'){delete this[_0xaea1('0x28')][_0x33e518[_0xaea1('0xdf')]];this[_0xaea1('0xb4')](this[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]]);_0x2a8292=new Hangup(_0x3c7848,_0x33e518);_0x2a8292[_0xaea1('0xa8')]=0x12;_0x2a8292[_0xaea1('0xa9')]=_0xaea1('0xe7');_0x2a8292[_0xaea1('0xe8')]=_0xaea1('0xe9');ami['emit'](_0xaea1('0xea'),ut['buildObj'](_0x2a8292,_0xaea1('0xeb')));this[_0xaea1('0xde')](_0x2a8292,_0xaea1('0xfe'),'[syncHangupInAMDIvr]');}if(_0x3c7848[_0xaea1('0x4a')]==='ivr'&&this[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]][_0xaea1('0xe4')]&&_0x33e518['value']===_0xaea1('0xec')){var _0x37eca2=this;return new BPromise(function(_0x4355dc,_0x5ea12d){delete _0x37eca2['uniqueId'][_0x33e518[_0xaea1('0xdf')]];_0x37eca2['updateOriginated'](_0x37eca2[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]]);_0x37eca2['campaigns'][_0x3c7848['queue']]['outboundAnswerCallsDay']+=0x1;_0x37eca2[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x43a9fc=_0x37eca2[_0xaea1('0x21')][_0x3c7848[_0xaea1('0xb5')]];var _0x5bb3f1=new Hangup(_0x3c7848,_0x33e518);_0x5bb3f1[_0xaea1('0xa8')]=0x13;_0x5bb3f1[_0xaea1('0xa9')]=_0xaea1('0xff');_0x5bb3f1['membername']=_0xaea1('0xe9');_0x5bb3f1['countmachineretry']+=0x1;_0x5bb3f1['countglobal']+=0x1;_0x5bb3f1[_0xaea1('0xeb')]=!![];ami[_0xaea1('0x49')](_0xaea1('0xea'),ut[_0xaea1('0xee')](_0x5bb3f1,'amd'));_0x37eca2['createHistory'](_0x5bb3f1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xef')));if(_0x5bb3f1['countbusyretry']+_0x5bb3f1['countcongestionretry']+_0x5bb3f1['countnoanswerretry']+_0x5bb3f1['countnosuchnumberretry']+_0x5bb3f1[_0xaea1('0x100')]+_0x5bb3f1[_0xaea1('0x101')]+_0x5bb3f1['countmachineretry']+_0x5bb3f1[_0xaea1('0xf4')]>=_0x43a9fc[_0xaea1('0xf5')]){_0x37eca2[_0xaea1('0xf6')](_0x5bb3f1,_0x4355dc,_0x5ea12d,'reason19\x20machine....');}else{if(_0x5bb3f1[_0xaea1('0xed')]>=_0x43a9fc[_0xaea1('0xf7')]){_0x37eca2[_0xaea1('0xf8')](_0x5bb3f1,_0x4355dc,_0x5ea12d,'reason\x2019\x20machine....');}else{_0x37eca2[_0xaea1('0xc3')]({'active':![],'countmachineretry':_0x5bb3f1['countmachineretry'],'scheduledat':moment()[_0xaea1('0xf9')](_0x43a9fc[_0xaea1('0xfa')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x5bb3f1['ContactId'],'ListId':_0x5bb3f1[_0xaea1('0xfd')],'VoiceQueueId':_0x5bb3f1[_0xaea1('0xd8')]||undefined,'CampaignId':_0x5bb3f1[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x103')));_0x4355dc({'reschedule':0x1});}}});}}};Dialer[_0xaea1('0x1a')][_0xaea1('0x33')]=function(_0x2eb706){var _0x24eb69=this[_0xaea1('0x28')][_0x2eb706['uniqueid']];var _0x870e7d=this;var _0x44f5d1;if(_0x24eb69&&_0x24eb69[_0xaea1('0x4a')]===_0xaea1('0x7b')){delete this['uniqueId'][_0x2eb706[_0xaea1('0xdf')]];this[_0xaea1('0xb4')](this[_0xaea1('0x21')][_0x24eb69[_0xaea1('0xb5')]]);this[_0xaea1('0x21')][_0x24eb69[_0xaea1('0xb5')]][_0xaea1('0x104')]+=0x1;_0x44f5d1=new Hangup(_0x24eb69,_0x2eb706);this['createHistory'](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x105')));this[_0xaea1('0xce')](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x106')));}if(_0x24eb69&&_0x24eb69[_0xaea1('0x4a')]!==_0xaea1('0x7b')&&isNotNull(this[_0xaea1('0x20')][_0x24eb69[_0xaea1('0xb5')]]['dialQueueProject'])){delete this[_0xaea1('0x28')][_0x2eb706[_0xaea1('0xdf')]];this['updateOriginated'](this['voiceQueues'][_0x24eb69[_0xaea1('0xb5')]]);this[_0xaea1('0x20')][_0x24eb69['queue']][_0xaea1('0xe6')]+=0x1;this[_0xaea1('0x20')][_0x24eb69[_0xaea1('0xb5')]][_0xaea1('0x5b')]+=0x1;_0x44f5d1=new Hangup(_0x24eb69,_0x2eb706);_0x44f5d1['state']=0x10;_0x44f5d1[_0xaea1('0xa9')]=_0xaea1('0x107');_0x44f5d1[_0xaea1('0xe8')]='AGI';this[_0xaea1('0xcf')](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x105')));this[_0xaea1('0xce')](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x106')));}if(_0x24eb69&&_0x24eb69['type']!==_0xaea1('0x7b')&&!isNotNull(this[_0xaea1('0x20')][_0x24eb69[_0xaea1('0xb5')]]['dialQueueProject'])){delete this['uniqueId'][_0x2eb706[_0xaea1('0xdf')]];this[_0xaea1('0xb4')](this[_0xaea1('0x20')][_0x24eb69[_0xaea1('0xb5')]]);this[_0xaea1('0x20')][_0x24eb69[_0xaea1('0xb5')]][_0xaea1('0x66')]+=0x1;_0x44f5d1=new Hangup(_0x24eb69,_0x2eb706);_0x44f5d1[_0xaea1('0xa8')]=0xc;_0x44f5d1[_0xaea1('0xa9')]=_0x2eb706[_0xaea1('0x108')];_0x44f5d1[_0xaea1('0xe8')]=_0xaea1('0x109');this['createHistory'](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x105')));this['moveContactManagedDialer'](_0x44f5d1)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x106')));}};Dialer[_0xaea1('0x1a')][_0xaea1('0x31')]=function(_0x1e1123){var _0x1ac907=this['uniqueId'][_0x1e1123[_0xaea1('0xdf')]];var _0x2b5e8a=this;if(this['voiceQueues'][_0x1e1123[_0xaea1('0xb5')]]){if(_0x1ac907&&_0x1ac907[_0xaea1('0x4a')]!==_0xaea1('0x7b')){delete this[_0xaea1('0x28')][_0x1e1123[_0xaea1('0xdf')]];this['voiceQueues'][_0x1e1123[_0xaea1('0xb5')]][_0xaea1('0xe6')]+=0x1;var _0x4e4328=new AgentComplete(_0x1ac907,_0x1e1123);if(_0x1e1123[_0xaea1('0x10a')]==='agent'){_0x4e4328[_0xaea1('0x10b')]=this['voiceQueues'][_0x1e1123['queue']]['dialQueueProject2']&&this['voiceQueues'][_0x1e1123[_0xaea1('0xb5')]][_0xaea1('0x10c')]?moment()[_0xaea1('0x78')](_0xaea1('0xfc')):undefined;}this[_0xaea1('0xcf')](_0x4e4328)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xaea1('0xce')](_0x4e4328)[_0xaea1('0xb2')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xaea1('0x1a')][_0xaea1('0x10d')]=function(_0x21da12){if(this['voiceQueues'][_0x21da12[_0xaea1('0xb5')]]){if(this[_0xaea1('0x28')][_0x21da12[_0xaea1('0xdf')]]&&this['uniqueId'][_0x21da12['uniqueid']]['type']!==_0xaea1('0x7b')){this[_0xaea1('0xb4')](this[_0xaea1('0x20')][_0x21da12[_0xaea1('0xb5')]]);this[_0xaea1('0x28')][_0x21da12['uniqueid']]['answertime']=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));}}};Dialer[_0xaea1('0x1a')][_0xaea1('0x10e')]=function(_0x486751){this[_0xaea1('0xcf')](_0x486751)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x10f')));this['moveContactManagedDialer'](_0x486751)[_0xaea1('0xb2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xaea1('0x1a')][_0xaea1('0x110')]=function(_0x173eec){var _0xdae2eb=this[_0xaea1('0x28')][_0x173eec[_0xaea1('0xdf')]];var _0x2cffea=this;if(this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]]){if(_0xdae2eb&&_0xdae2eb['type']!==_0xaea1('0x7b')){delete this[_0xaea1('0x28')][_0x173eec['uniqueid']];this['updateOriginated'](this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]]);_0xdae2eb[_0xaea1('0x111')]=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));var _0x109384=new QueueCallerAbandon(_0xdae2eb,_0x173eec);if(getSeconds(_0xdae2eb['droptime'],_0xdae2eb[_0xaea1('0x112')])>=_0xdae2eb[_0xaea1('0x113')]){this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]][_0xaea1('0x6b')]+=0x1;this[_0xaea1('0x20')][_0x173eec['queue']][_0xaea1('0x60')]+=0x1;this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]][_0xaea1('0x6d')]+=0x1;_0x109384['state']=0xa;_0x109384[_0xaea1('0xa9')]=_0xaea1('0x114');_0x109384[_0xaea1('0x115')]='TIMEOUT';_0x109384[_0xaea1('0x10b')]=this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]]['dialQueueProject2']?moment()[_0xaea1('0x78')](_0xaea1('0xfc')):undefined;_0x109384[_0xaea1('0x100')]+=0x1;_0x109384[_0xaea1('0x116')]+=0x1;if(_0x109384[_0xaea1('0x100')]>=this[_0xaea1('0x20')][_0x173eec['queue']][_0xaea1('0x117')]){this['queueCallerAbandonCreateState'](_0x109384);}else{this[_0xaea1('0xc3')]({'active':![],'countdropretry':_0x109384[_0xaea1('0x100')],'scheduledat':moment()['add'](this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]][_0xaea1('0x118')],_0xaea1('0xfb'))[_0xaea1('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xdae2eb[_0xaea1('0xd6')],'ListId':_0xdae2eb[_0xaea1('0xfd')],'VoiceQueueId':_0xdae2eb['VoiceQueueId']||undefined,'CampaignId':_0xdae2eb[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x119')));var _0x23057f=new History(_0x109384);_0x23057f[_0xaea1('0xa8')]=0xa;_0x23057f[_0xaea1('0xa9')]=_0xaea1('0x114');_0x23057f[_0xaea1('0x11a')]=moment()[_0xaea1('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x23057f[_0xaea1('0xaa')]=_0x23057f[_0xaea1('0x11a')];_0x23057f[_0xaea1('0x11b')]=_0x109384[_0xaea1('0x11b')];_0x23057f[_0xaea1('0x11c')]=_0x109384[_0xaea1('0x11c')];this['createHistory'](_0x23057f)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x11d')));}}else{this[_0xaea1('0x20')][_0x173eec['queue']][_0xaea1('0x6a')]+=0x1;this['voiceQueues'][_0x173eec['queue']][_0xaea1('0x5f')]+=0x1;_0x109384['state']=0xb;_0x109384[_0xaea1('0xa9')]='Abandoned';_0x109384[_0xaea1('0x115')]='CALLEREXIT';_0x109384[_0xaea1('0x101')]+=0x1;_0x109384[_0xaea1('0x116')]+=0x1;if(_0x109384[_0xaea1('0x101')]>=this['voiceQueues'][_0x173eec[_0xaea1('0xb5')]][_0xaea1('0x11e')]){this[_0xaea1('0x10e')](_0x109384);}else{this[_0xaea1('0xc3')]({'active':![],'countabandonedretry':_0x109384[_0xaea1('0x101')],'scheduledat':moment()[_0xaea1('0xf9')](this[_0xaea1('0x20')][_0x173eec[_0xaea1('0xb5')]][_0xaea1('0x11f')],_0xaea1('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xdae2eb['ContactId'],'ListId':_0xdae2eb[_0xaea1('0xfd')],'VoiceQueueId':_0xdae2eb[_0xaea1('0xd8')]||undefined,'CampaignId':_0xdae2eb[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x120')));var _0x23057f=new History(_0x109384);_0x23057f[_0xaea1('0xa8')]=0xb;_0x23057f[_0xaea1('0xa9')]=_0xaea1('0x121');_0x23057f[_0xaea1('0x11a')]=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));_0x23057f[_0xaea1('0xaa')]=_0x23057f[_0xaea1('0x11a')];_0x23057f[_0xaea1('0x11b')]=_0x109384[_0xaea1('0x11b')];_0x23057f[_0xaea1('0x11c')]=_0x109384[_0xaea1('0x11c')];this['createHistory'](_0x23057f)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x122')));}}}}};Dialer[_0xaea1('0x1a')][_0xaea1('0x34')]=function(_0x219eea){if(this[_0xaea1('0x26')][_0x219eea[_0xaea1('0xdf')]]){this[_0xaea1('0x26')][_0x219eea[_0xaea1('0xdf')]][_0xaea1('0xb1')]=_0x219eea[_0xaea1('0xb1')];}if(this[_0xaea1('0x28')][_0x219eea[_0xaea1('0xdf')]]){this[_0xaea1('0x28')][_0x219eea['uniqueid']][_0xaea1('0xb1')]=_0x219eea['channel'];}};Dialer[_0xaea1('0x1a')][_0xaea1('0x38')]=function(_0x1c9a75){if(strategy[this[_0xaea1('0x20')][this['actions'][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0xb5')]]['strategy']]===_0xaea1('0x19')){if(this['actions'][_0x1c9a75[_0xaea1('0x123')]]&&_[_0xaea1('0xb0')](this[_0xaea1('0x26')][_0x1c9a75[_0xaea1('0x123')]]['locked'])&&_0x1c9a75[_0xaea1('0xdd')]==='1'&&_0x1c9a75[_0xaea1('0x124')]==='0'){if(this['agents'][_0x1c9a75['stateinterface']]){if(!this[_0xaea1('0x22')][_0x1c9a75[_0xaea1('0x125')]][_0xaea1('0x126')]){this['agents'][_0x1c9a75['stateinterface']][_0xaea1('0x126')]=!![];this[_0xaea1('0x26')][_0x1c9a75['actionid']]['locked']=!![];this['actions'][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0x125')]=_0x1c9a75[_0xaea1('0x125')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0xb5')]]['strategy']]||_0xaea1('0x127'))===_0xaea1('0x127')){if(this[_0xaea1('0x26')][_0x1c9a75[_0xaea1('0x123')]]){if(this[_0xaea1('0x22')][_0x1c9a75[_0xaea1('0x125')]]){this[_0xaea1('0x26')][_0x1c9a75[_0xaea1('0x123')]]['stateinterface']=_0x1c9a75['stateinterface'];if(_[_0xaea1('0xb0')](this[_0xaea1('0x2d')][this['actions'][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0xb5')]])){this['queueBooked'][this[_0xaea1('0x26')][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0xb5')]]=[];}this[_0xaea1('0x2d')][this[_0xaea1('0x26')][_0x1c9a75[_0xaea1('0x123')]][_0xaea1('0xb5')]][_0xaea1('0x128')](_[_0xaea1('0x8f')](_[_0xaea1('0x129')](this['actions'][_0x1c9a75[_0xaea1('0x123')]],['idHopper',_0xaea1('0x125')]),{'status':_0x1c9a75[_0xaea1('0xdd')],'paused':_0x1c9a75[_0xaea1('0x124')]}));}}}};function unlockQueueStatus(_0x36c837,_0xf5d3af){setTimeout(function(){if(_['isUndefined'](_0x36c837['queueStatusComplete'])){loggerBooked[_0xaea1('0x97')](_0xaea1('0x12a'),_0xf5d3af);}_0x36c837[_0xaea1('0x12b')]=!![];loggerBooked[_0xaea1('0x80')](_0xaea1('0x12c'),_0xf5d3af,JSON['stringify'](_[_0xaea1('0x129')](_0x36c837,[_0xaea1('0x3e'),_0xaea1('0x12b')])));},0x1f3);}Dialer[_0xaea1('0x1a')][_0xaea1('0x12d')]=function(_0x4f8fc5){var _0x58e1f7=this;var _0x34fd76=_0x58e1f7[_0xaea1('0x20')][_0x58e1f7['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]];if(strategy[this[_0xaea1('0x20')][this[_0xaea1('0x26')][_0x4f8fc5['actionid']][_0xaea1('0xb5')]][_0xaea1('0x4c')]]==='roundrobin'){if(this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]&&this['actions'][_0x4f8fc5['actionid']]['stateinterface']){this[_0xaea1('0x1f')][_0xaea1('0x12e')](this[_0xaea1('0x26')][_0x4f8fc5['actionid']][_0xaea1('0x12f')],this['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0x125')])['catch'](function(_0x3e4984){logger[_0xaea1('0x97')](_0xaea1('0x130'),util[_0xaea1('0x98')](_0x3e4984,{'showHidden':![],'depth':null}));})['finally'](function(){_0x58e1f7[_0xaea1('0xb4')](_0x58e1f7[_0xaea1('0x20')][_0x58e1f7['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]]);_0x58e1f7[_0xaea1('0x22')][_0x58e1f7[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0x125')]][_0xaea1('0x126')]=![];delete _0x58e1f7[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]];unlockQueueStatus(_0x34fd76);});}else{this[_0xaea1('0xb4')](this['voiceQueues'][this[_0xaea1('0x26')][_0x4f8fc5['actionid']][_0xaea1('0xb5')]]);this[_0xaea1('0xc3')]({'active':![],'ContactId':this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xd6')],'ListId':this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]['ListId'],'VoiceQueueId':this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xd8')]||undefined,'CampaignId':this['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]];unlockQueueStatus(_0x34fd76);}}else if((strategy[this[_0xaea1('0x20')][this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]][_0xaea1('0x4c')]]||_0xaea1('0x127'))==='rrmemory'){var _0x24803d;if(this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]&&!_[_0xaea1('0x44')](this[_0xaea1('0x2d')][this['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]])){if(this[_0xaea1('0x131')][_0x58e1f7['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]]){this[_0xaea1('0x131')][_0x58e1f7[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]]=this[_0xaea1('0x131')][this[_0xaea1('0x26')][_0x4f8fc5['actionid']][_0xaea1('0xb5')]]?this[_0xaea1('0x131')][this['actions'][_0x4f8fc5[_0xaea1('0x123')]][_0xaea1('0xb5')]]:this['queueBooked'][this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]['queue']]?this[_0xaea1('0x2d')][this[_0xaea1('0x26')][_0x4f8fc5['actionid']][_0xaea1('0xb5')]][_0xaea1('0x132')]||0x0:0x0;}this[_0xaea1('0x2d')][this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]['queue']][_0xaea1('0x132')]=this['queueBookedRR'][this[_0xaea1('0x26')][_0x4f8fc5[_0xaea1('0x123')]]['queue']];for(var _0x1df361=0x0;_0x1df361=0x0;})['catch'](myreject(_0x55f229)));}}else{_0x2744d7['push'](ami['Action']({'action':_0xaea1('0x14b'),'command':util[_0xaea1('0x78')](_0xaea1('0x146'),_0x4753a0,!_[_0xaea1('0x3b')](config['timezones'][_0x4c5c92])?_0x4c5c92:'')})[_0xaea1('0xba')](function(_0x2618d0){return _0x2618d0[_0xaea1('0x149')][_0xaea1('0x14c')]('true')>=0x0;})['catch'](myreject(_0x55f229)));}BPromise[_0xaea1('0x14d')](_0x2744d7)[_0xaea1('0xba')](function(_0x15caa2){var _0x1617bd=_[_0xaea1('0x14e')](_0x15caa2);if(_0x1617bd){return _0x565852(_0x1617bd);}else{_0x341e40[_0xaea1('0x3d')]=_0x2c7b24?_0xaea1('0x14f'):'INTERVAL_IS_OVERTIME';return _0x55f229(msgResponse(_0xaea1('0x150'),_0xaea1('0x142'),_0xaea1('0x151')+_0x2c7b24+'\x20'+_0xecbae4+_0xaea1('0x152')+util[_0xaea1('0x98')](_0x4753a0,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4c5c92));}})[_0xaea1('0xb2')](function(_0x4266bb){return _0x55f229(msgResponse(_0xaea1('0x13f'),'Failure',JSON[_0xaea1('0x45')](_0x4266bb)));});});};Dialer['prototype'][_0xaea1('0x153')]=function(_0x5f2645){var _0x3ebe98=this;return function(){switch(_0x5f2645[_0xaea1('0x154')]){case'progressive':freeVariablesPredictive(_0x5f2645);_0x3ebe98[_0xaea1('0x155')](_0x5f2645,0x1);break;case'power':freeVariablesPredictive(_0x5f2645);_0x3ebe98[_0xaea1('0x155')](_0x5f2645,_0x5f2645[_0xaea1('0x156')]);break;case'predictive':_0x3ebe98[_0xaea1('0xb')](_0x5f2645);break;case _0xaea1('0xa'):freeVariablesPredictive(_0x5f2645);_0x3ebe98[_0xaea1('0x155')](_0x5f2645,0x1);break;default:freeVariablesPredictive(_0x5f2645);logger[_0xaea1('0x97')](_0xaea1('0x157'),_0x5f2645['name'],_0xaea1('0x158'));}};};Dialer['prototype']['launchHandleIvr']=function(_0x2368c5){var _0x4a0af6=this;return function(){_0x4a0af6[_0xaea1('0x159')](_0x2368c5);};};Dialer[_0xaea1('0x1a')][_0xaea1('0xd')]=function(_0x5e943f){var _0x57cad5=this;if(isNotPreview(_0x5e943f[_0xaea1('0x154')])){if(isVoiceQueueOutbound(_0x5e943f[_0xaea1('0x4a')])&&isActive(_0x5e943f[_0xaea1('0x57')])){_0x5e943f[_0xaea1('0xa0')]=!![];BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](checkIsLoggedIn(_0x5e943f,_0x5e943f[_0xaea1('0x15a')]))[_0xaea1('0xba')](checkIsActive(_0x5e943f,_0x5e943f[_0xaea1('0x57')]))[_0xaea1('0xba')](checkInterval(_0x5e943f))['then'](_0x57cad5[_0xaea1('0x13e')](_0x5e943f))[_0xaea1('0xba')](_0x57cad5[_0xaea1('0x15b')](_0x5e943f[_0xaea1('0x15c')],_0x5e943f[_0xaea1('0x15d')],_0x5e943f[_0xaea1('0x3e')],_0x5e943f))[_0xaea1('0xba')](_0x57cad5[_0xaea1('0x15e')](_0x5e943f[_0xaea1('0x40')],_0x5e943f[_0xaea1('0x15d')],_0x5e943f[_0xaea1('0x3e')],_0x5e943f))[_0xaea1('0xba')](_0x57cad5[_0xaea1('0x153')](_0x5e943f))['catch'](loggerCatchQueueSummary(_0xaea1('0x15f'),_0x5e943f));}else{notSendMessagesQueue(_0x5e943f);}}else{freeVariablesPredictive(_0x5e943f);}};Dialer[_0xaea1('0x1a')]['syncCampaigns']=function(){var _0x5f33c9=this;var _0x485a1c;for(var _0x23b67d in this[_0xaea1('0x21')]){if(typeof this[_0xaea1('0x21')][_0x23b67d]!==_0xaea1('0xaf')){_0x485a1c=this['campaigns'][_0x23b67d];if(isCampaignIvr(_0x485a1c[_0xaea1('0x4a')])&&isActive(_0x485a1c[_0xaea1('0x76')])){_0x485a1c[_0xaea1('0xa0')]=!![];BPromise[_0xaea1('0xb9')]()[_0xaea1('0xba')](checkIsActive(_0x485a1c,_0x485a1c[_0xaea1('0x76')]))[_0xaea1('0xba')](checkInterval(_0x485a1c))[_0xaea1('0xba')](_0x5f33c9[_0xaea1('0x13e')](_0x485a1c))[_0xaea1('0xba')](_0x5f33c9[_0xaea1('0x15b')](_0x485a1c[_0xaea1('0x15c')],_0x485a1c[_0xaea1('0x15d')],_0x485a1c[_0xaea1('0x3e')],_0x485a1c))[_0xaea1('0xba')](_0x5f33c9['checkIfTimeIntervals'](_0x485a1c[_0xaea1('0x40')],_0x485a1c[_0xaea1('0x15d')],_0x485a1c[_0xaea1('0x3e')],_0x485a1c))[_0xaea1('0xba')](_0x5f33c9[_0xaea1('0x160')](_0x485a1c))[_0xaea1('0xb2')](loggerCatchQueueSummary('[syncCampaigns]',_0x485a1c));}else{notSendMessagesCampaign(_0x485a1c);}}}};function getCallerIdRandom(_0x2374b6,_0x1a2629){var _0x1e1c80;var _0x21c5b1;var _0x3595b0;if(_0x1a2629<=0x0){_0x1a2629=0x1;}_0x1e1c80=new RegExp('\x5cw{0,'+_0x1a2629+'}$');_0x21c5b1=Math['pow'](0xa,_0x1a2629-0x1);_0x3595b0=Math[_0xaea1('0x161')](0xa,_0x1a2629)-0x1;return util['format']('%s',_[_0xaea1('0x162')](_0x2374b6,_0x1e1c80,_[_0xaea1('0x163')](_0x21c5b1,_0x3595b0)));}function extractCalleridName(_0x18adc2){var _0x2e826d=_0x18adc2[_0xaea1('0x164')](/"(.*?)"/);return _0x2e826d?_0x2e826d[0x1]:_0x18adc2;}function extractCalleridNumber(_0x1f4b49){var _0x1fad12=_0x1f4b49[_0xaea1('0x164')](/<(.*?)>/);return _0x1fad12?_0x1fad12[0x1]:_0x1f4b49;}Dialer[_0xaea1('0x1a')][_0xaea1('0x165')]=function(_0x1ee64b,_0x226185){var _0x38acdf=this;var _0x2b667f=uuid['v4']();this[_0xaea1('0x26')][_0x2b667f]=new Action(_0x1ee64b,_0x226185,_0x2b667f);return new BPromise(function(_0x8a53b9,_0x52a8f6){if(_[_0xaea1('0x3b')](_0x1ee64b)&&typeof _0x1ee64b!==_0xaea1('0x166')){return _0x52a8f6(msgResponse(_0xaea1('0x167'),_0xaea1('0x142'),_0xaea1('0x168')));}if(_[_0xaea1('0x3b')](_0x226185[_0xaea1('0x169')][_0xaea1('0x16a')])||_0x226185['Contact'][_0xaea1('0x16a')]===null){return _0x52a8f6(msgResponse('originate',_0xaea1('0x142'),_0xaea1('0x16b')));}var _0x55a267={'XMD-CALLERID':_0x38acdf['actions'][_0x2b667f][_0xaea1('0x16c')](),'XMD-AGI':_0x1ee64b[_0xaea1('0x16d')]?util['format'](_0xaea1('0x16e'),ipAgi,_0x1ee64b[_0xaea1('0x16d')]):'NONE','XMD-AGIAFTER':_0x1ee64b[_0xaea1('0x16f')]?util[_0xaea1('0x78')](_0xaea1('0x16e'),ipAgi,_0x1ee64b[_0xaea1('0x16f')]):_0xaea1('0x170'),'XMD-QUEUE':_0x1ee64b[_0xaea1('0x4a')]===_0xaea1('0x4b')?util[_0xaea1('0x78')](_0xaea1('0x171'),_0x1ee64b[_0xaea1('0x3e')],_0x1ee64b['dialQueueOptions']||'',_0x1ee64b[_0xaea1('0x10c')]?'c':'',_0x1ee64b[_0xaea1('0x113')]||0x3):'NONE','XMD-CONTACTID':_0x226185[_0xaea1('0xd6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x38acdf[_0xaea1('0x26')][_0x2b667f][_0xaea1('0x16c')](),'XMD-AMD':_0x1ee64b[_0xaea1('0xe4')]?_0xaea1('0x172'):_0xaea1('0x170'),'XMD-DESTINATION':_0xaea1('0xe3')};if(_0x1ee64b[_0xaea1('0xe4')]){_0x55a267['XMD-AMDINITIALSILENCE']=_0x1ee64b[_0xaea1('0x173')]||0x9c4;_0x55a267[_0xaea1('0x174')]=_0x1ee64b[_0xaea1('0x175')]||0x5dc;_0x55a267['XMD-AMDAFTERGREETINGSILENCE']=_0x1ee64b[_0xaea1('0x176')]||0x320;_0x55a267['XMD-AMDTOTALANALYSISTIME']=_0x1ee64b[_0xaea1('0x177')]||0x1388;_0x55a267[_0xaea1('0x178')]=_0x1ee64b['dialAMDMinWordLength']||0x64;_0x55a267[_0xaea1('0x179')]=_0x1ee64b[_0xaea1('0x17a')]||0x32;_0x55a267[_0xaea1('0x17b')]=_0x1ee64b['dialAMDMaximumNumberOfWords']||0x3;_0x55a267[_0xaea1('0x17c')]=_0x1ee64b['dialAMDSilenceThreshold']||0x100;_0x55a267[_0xaea1('0x17d')]=_0x1ee64b[_0xaea1('0x17e')]||0x1388;}if(_0x1ee64b[_0xaea1('0x4a')]===_0xaea1('0x4b')){_0x55a267['XMD-VOICEQUEUEID']=_0x226185[_0xaea1('0xd8')];}else{_0x55a267[_0xaea1('0x17f')]=_0x226185[_0xaea1('0x102')];}for(var _0x8587e3 in _0x226185[_0xaea1('0x169')]){if(typeof _0x226185[_0xaea1('0x169')][_0x8587e3]!==_0xaea1('0xaf')){if(isNotNull(_0x226185[_0xaea1('0x169')][_0x8587e3])&&_0x8587e3!=='id'&&_0x8587e3!==_0xaea1('0x180')&&_0x8587e3!==_0xaea1('0x181')&&_0x8587e3!=='updatedAt'){_0x55a267[util[_0xaea1('0x78')](_0xaea1('0x182'),'XMD-',_[_0xaea1('0x183')](_0x8587e3))]=_0x226185['Contact'][_0x8587e3];}}}var _0x1d2ffd=_0x38acdf[_0xaea1('0xdb')](_0x1ee64b[_0xaea1('0x75')])?getCallerId(_0x1ee64b['Trunk'][_0xaea1('0x77')],_0x1ee64b[_0xaea1('0x58')],_0x1ee64b['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1ee64b[_0xaea1('0x184')],_0x1ee64b[_0xaea1('0x185')]):_0x1ee64b[_0xaea1('0x184')]):getCallerId(_[_0xaea1('0xb0')](_0x1ee64b[_0xaea1('0x186')])?_0x1ee64b[_0xaea1('0x75')][_0xaea1('0x77')]:_0x1ee64b[_0xaea1('0x186')][_0xaea1('0x77')],_0x1ee64b[_0xaea1('0x58')],_0x1ee64b['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1ee64b[_0xaea1('0x184')],_0x1ee64b['dialRandomLastDigitCallerIdNumber']):_0x1ee64b[_0xaea1('0x184')]);if(_0x1d2ffd){_0x55a267[_0xaea1('0x187')]=_0x38acdf[_0xaea1('0x26')][_0x2b667f][_0xaea1('0x188')]=extractCalleridName(_0x1d2ffd);_0x55a267[_0xaea1('0x189')]=_0x38acdf[_0xaea1('0x26')][_0x2b667f][_0xaea1('0x18a')]=extractCalleridNumber(_0x1d2ffd);}return ami[_0xaea1('0x145')]({'actionid':_0x2b667f,'action':_0xaea1('0x167'),'channel':_0x38acdf[_0xaea1('0xdb')](_0x1ee64b[_0xaea1('0x75')])?util[_0xaea1('0x78')]('SIP/%s/%s%s',_0x1ee64b[_0xaea1('0x75')][_0xaea1('0x3e')],isNotNull(_0x1ee64b['dialPrefix'])?_0x1ee64b['dialPrefix'][_0xaea1('0x18b')]()||'':'',_0x1ee64b[_0xaea1('0x18c')]>0x0?_0x226185[_0xaea1('0x169')][_0xaea1('0x16a')][_0xaea1('0x18d')](_0x1ee64b[_0xaea1('0x18c')]):_0x226185[_0xaea1('0x169')][_0xaea1('0x16a')]):util['format'](_0xaea1('0x18e'),_[_0xaea1('0xb0')](_0x1ee64b['TrunkBackup'])?_0x1ee64b['Trunk'][_0xaea1('0x3e')]:_0x1ee64b[_0xaea1('0x186')]['name'],isNotNull(_0x1ee64b[_0xaea1('0x5a')])?_0x1ee64b[_0xaea1('0x5a')][_0xaea1('0x18b')]()||'':'',_0x1ee64b[_0xaea1('0x18c')]>0x0?_0x226185['Contact'][_0xaea1('0x16a')]['substring'](_0x1ee64b[_0xaea1('0x18c')]):_0x226185[_0xaea1('0x169')][_0xaea1('0x16a')]),'callerid':_0x1d2ffd,'Exten':_0xaea1('0xe3'),'Context':_0xaea1('0x18f'),'Priority':'1','variable':_0x55a267,'timeout':(_0x1ee64b[_0xaea1('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2b667f})[_0xaea1('0xba')](function(_0x2e779e){return _0x8a53b9(_0x2e779e);})[_0xaea1('0xb2')](function(_0x43b34c){_0x1ee64b['outboundOriginateFailureCallsDay']+=0x1;var _0x5de941=new History(_0x38acdf[_0xaea1('0x26')][_0x2b667f]);logger['error'](util[_0xaea1('0x78')]('[originateError]:\x20%s',JSON[_0xaea1('0x45')](_0x43b34c)));_0x5de941[_0xaea1('0xa8')]=0xe;_0x5de941[_0xaea1('0xa9')]=_0xaea1('0x190');_0x5de941[_0xaea1('0x11a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5de941[_0xaea1('0xaa')]=_0x5de941['starttime'];_0x38acdf[_0xaea1('0xcf')](_0x5de941)['catch'](loggerCatch(_0xaea1('0x191')));_0x38acdf[_0xaea1('0xce')](_0x5de941)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x191')))[_0xaea1('0x1d')](function(){delete _0x38acdf[_0xaea1('0x26')][_0x2b667f];return _0x52a8f6(msgResponse(_0xaea1('0x167'),_0xaea1('0x192'),_0xaea1('0x193')));});});});};Dialer[_0xaea1('0x1a')][_0xaea1('0x194')]=function(_0x83763){var _0x1901c0=this[_0xaea1('0x26')][_0x83763[_0xaea1('0x123')]];if(_0x1901c0){delete this['actions'][_0x83763['actionid']];_0x1901c0['responsetime']=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));var _0x39a35a=_0x1901c0[_0xaea1('0x4a')]===_0xaea1('0x7b')?this['campaigns'][_0x1901c0[_0xaea1('0xb5')]]:this[_0xaea1('0x20')][_0x1901c0[_0xaea1('0x195')]()];if(!this['isSuccess'](_0x83763[_0xaea1('0x196')])){this[_0xaea1('0xb4')](_0x39a35a);return this[_0xaea1('0x197')](_0x1901c0,_0x39a35a,_0x83763)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x198')));}this[_0xaea1('0x28')][_0x83763[_0xaea1('0xdf')]]=_0x1901c0;}};Dialer[_0xaea1('0x1a')][_0xaea1('0x199')]=function(_0x39e44b,_0x5bef8a,_0x13ba74){var _0x3ac98f=new History(_0x5bef8a);if(_0x3ac98f['countbusyretry']+_0x3ac98f[_0xaea1('0xf1')]+_0x3ac98f[_0xaea1('0xf2')]+_0x3ac98f['countnosuchnumberretry']+_0x3ac98f['countdropretry']+_0x3ac98f['countabandonedretry']+_0x3ac98f[_0xaea1('0xed')]+_0x3ac98f[_0xaea1('0xf4')]>=_0x13ba74[_0xaea1('0xf5')]-0x1){return!![];}switch(_0x39e44b){case 0x3:if(_0x3ac98f[_0xaea1('0xf2')]>=_0x13ba74[_0xaea1('0x19a')]-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countnoanswerretry':_0x3ac98f[_0xaea1('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x13ba74[_0xaea1('0x19b')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f[_0xaea1('0xd6')],'ListId':_0x3ac98f[_0xaea1('0xfd')],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x19c')));break;case 0x5:if(_0x3ac98f[_0xaea1('0xf0')]>=_0x13ba74['dialBusyMaxRetry']-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countbusyretry':_0x3ac98f[_0xaea1('0xf0')]+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74[_0xaea1('0x19d')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f['ContactId'],'ListId':_0x3ac98f[_0xaea1('0xfd')],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})['catch'](loggerCatch(_0xaea1('0x19e')));break;case 0x8:if(_0x3ac98f['countcongestionretry']>=_0x13ba74[_0xaea1('0x19f')]-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countcongestionretry':_0x3ac98f[_0xaea1('0xf1')]+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74[_0xaea1('0x1a0')],_0xaea1('0xfb'))[_0xaea1('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ac98f['ContactId'],'ListId':_0x3ac98f[_0xaea1('0xfd')],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1a1')));break;case 0x0:if(_0x3ac98f[_0xaea1('0xf3')]>=_0x13ba74[_0xaea1('0x1a2')]-0x1){return!![];}else{this[_0xaea1('0xc3')]({'active':![],'countnosuchnumberretry':_0x3ac98f[_0xaea1('0xf3')]+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74['dialNoSuchNumberRetryFrequency'],'minutes')[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f[_0xaea1('0xd6')],'ListId':_0x3ac98f[_0xaea1('0xfd')],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1a3')));}break;case 0xa:if(_0x3ac98f[_0xaea1('0x100')]>=_0x13ba74[_0xaea1('0x117')]-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countdropretry':_0x3ac98f['countdropretry']+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74[_0xaea1('0x118')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f['ContactId'],'ListId':_0x3ac98f['ListId'],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x3ac98f[_0xaea1('0x101')]>=_0x13ba74[_0xaea1('0x11e')]-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countabandonedretry':_0x3ac98f['countabandonedretry']+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74[_0xaea1('0x11f')],_0xaea1('0xfb'))[_0xaea1('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ac98f['ContactId'],'ListId':_0x3ac98f[_0xaea1('0xfd')],'VoiceQueueId':_0x3ac98f['VoiceQueueId']||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3ac98f[_0xaea1('0xed')]>=_0x13ba74[_0xaea1('0xf7')]-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countmachineretry':_0x3ac98f[_0xaea1('0xed')]+=0x1,'scheduledat':moment()['add'](_0x13ba74[_0xaea1('0xfa')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f[_0xaea1('0xd6')],'ListId':_0x3ac98f['ListId'],'VoiceQueueId':_0x3ac98f[_0xaea1('0xd8')]||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})['catch'](loggerCatch(_0xaea1('0x103')));break;case 0x14:if(_0x3ac98f['countagentrejectretry']>=_0x13ba74['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xaea1('0xc3')]({'active':![],'countagentrejectretry':_0x3ac98f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xaea1('0xf9')](_0x13ba74[_0xaea1('0x1a4')],_0xaea1('0xfb'))[_0xaea1('0x78')](_0xaea1('0xfc')),'ContactId':_0x3ac98f[_0xaea1('0xd6')],'ListId':_0x3ac98f['ListId'],'VoiceQueueId':_0x3ac98f['VoiceQueueId']||undefined,'CampaignId':_0x3ac98f[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1a5')));break;default:return!![];}};Dialer['prototype'][_0xaea1('0x197')]=function(_0x47e5b9,_0x5b064e,_0x191978){var _0x513e7d=this;var _0x35684b=new History(_0x47e5b9);return new BPromise(function(_0x3f74ee,_0x455867){if(_['isUndefined'](_0x5b064e)&&typeof _0x5b064e!==_0xaea1('0x166')){return _0x455867(msgResponse('[callProgressDetecting]',_0xaea1('0x142'),_0xaea1('0x1a6')));}if(_[_0xaea1('0x3b')](_0x191978)&&typeof _0x191978!=='object'){return _0x455867(msgResponse(_0xaea1('0x1a7'),_0xaea1('0x142'),_0xaea1('0x1a8')));}switch(_0x191978[_0xaea1('0x10a')]){case'0':_0x5b064e[_0xaea1('0x62')]+=0x1;_0x35684b[_0xaea1('0xa8')]=0x0;_0x35684b['statedesc']=_0xaea1('0x1a9');_0x35684b[_0xaea1('0xf3')]+=0x1;_0x35684b[_0xaea1('0x116')]+=0x1;ami[_0xaea1('0x49')]('custom:agentnosuchnumber',ut[_0xaea1('0xee')](_0x47e5b9,_0xaea1('0x1aa')));_0x513e7d['createHistory'](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xef')));if(_0x513e7d[_0xaea1('0x199')](0x0,_0x47e5b9,_0x5b064e)){if(_0x35684b[_0xaea1('0xf3')]>=_0x5b064e[_0xaea1('0x1a2')]){_0x513e7d['createStateFinal'](_0x35684b,_0x3f74ee,_0x455867,'reason\x200\x20no\x20such\x20number....');}else{_0x513e7d[_0xaea1('0xf6')](_0x35684b,_0x3f74ee,_0x455867,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5b064e[_0xaea1('0x61')]+=0x1;_0x35684b[_0xaea1('0xa8')]=0x3;_0x35684b[_0xaea1('0xa9')]=_0xaea1('0x1ab');_0x35684b[_0xaea1('0xf2')]+=0x1;_0x35684b[_0xaea1('0x116')]+=0x1;ami['emit'](_0xaea1('0x1ac'),ut[_0xaea1('0xee')](_0x47e5b9,_0xaea1('0x1ad')));_0x513e7d[_0xaea1('0xcf')](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1ae')));if(_0x513e7d[_0xaea1('0x199')](0x3,_0x47e5b9,_0x5b064e)){if(_0x35684b['countnoanswerretry']>=_0x5b064e[_0xaea1('0x19a')]){_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,'reason\x203\x20ringing\x20no\x20answer');}else{_0x513e7d[_0xaea1('0xf6')](_0x35684b,_0x3f74ee,_0x455867,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5b064e[_0xaea1('0x1af')]+=0x1;_0x35684b[_0xaea1('0xa8')]=0x5;_0x35684b[_0xaea1('0xa9')]=_0xaea1('0x1b0');_0x35684b[_0xaea1('0xf0')]+=0x1;_0x35684b[_0xaea1('0x116')]+=0x1;ami['emit'](_0xaea1('0x1b1'),ut[_0xaea1('0xee')](_0x47e5b9,_0xaea1('0x1b2')));_0x513e7d[_0xaea1('0xcf')](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1b3')));if(_0x513e7d[_0xaea1('0x199')](0x5,_0x47e5b9,_0x5b064e)){if(_0x35684b['countbusyretry']>=_0x5b064e[_0xaea1('0x1b4')]){_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1b5'));}else{_0x513e7d['stateGlobal'](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1b5'));}}break;case'8':_0x5b064e['outboundCongestionCallsDay']+=0x1;_0x35684b[_0xaea1('0xa8')]=0x8;_0x35684b[_0xaea1('0xa9')]=_0xaea1('0x1b6');_0x35684b[_0xaea1('0xf1')]+=0x1;_0x35684b['countglobal']+=0x1;ami[_0xaea1('0x49')](_0xaea1('0x1b7'),ut['buildObj'](_0x47e5b9,_0xaea1('0x1b8')));_0x513e7d['createHistory'](_0x35684b)[_0xaea1('0xb2')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x513e7d[_0xaea1('0x199')](0x8,_0x47e5b9,_0x5b064e)){if(_0x35684b['countcongestionretry']>=_0x5b064e[_0xaea1('0x19f')]){_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,'reason\x208\x20congestion');}else{_0x513e7d[_0xaea1('0xf6')](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1b9'));}}break;case'11':_0x5b064e[_0xaea1('0x1ba')]+=0x1;_0x35684b[_0xaea1('0xa8')]=0xb;_0x35684b[_0xaea1('0xa9')]=_0xaea1('0x121');_0x35684b[_0xaea1('0x101')]+=0x1;_0x35684b[_0xaea1('0x116')]+=0x1;_0x513e7d['createHistory'](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x122')));if(_0x513e7d[_0xaea1('0x199')](0xb,_0x47e5b9,_0x5b064e)){if(_0x35684b[_0xaea1('0x101')]>=_0x5b064e[_0xaea1('0x11e')]){_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1bb'));}else{_0x513e7d[_0xaea1('0xf6')](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1bb'));}}break;case'20':_0x5b064e[_0xaea1('0x65')]+=0x1;_0x35684b[_0xaea1('0xa8')]=0x14;_0x35684b[_0xaea1('0xa9')]=_0xaea1('0x1bc');_0x35684b[_0xaea1('0xf4')]+=0x1;_0x35684b[_0xaea1('0x116')]+=0x1;ami['emit']('custom:agentreject',ut[_0xaea1('0xee')](_0x47e5b9,_0xaea1('0x1bd')));_0x513e7d[_0xaea1('0xcf')](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1be')));if(_0x513e7d['checkRetriveMax'](0x14,_0x47e5b9,_0x5b064e)){if(_0x35684b['countagentrejectretry']>=_0x5b064e[_0xaea1('0x1bf')]){_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,'reason\x2020\x20agentreject');}else{_0x513e7d['stateGlobal'](_0x35684b,_0x3f74ee,_0x455867,_0xaea1('0x1c0'));}}break;default:_0x5b064e['outboundUnknownCallsDay']+=0x1;_0x35684b[_0xaea1('0xa8')]=0xc;_0x35684b['statedesc']=_0x191978[_0xaea1('0x10a')];_0x513e7d[_0xaea1('0xcf')](_0x35684b)[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1c1')));if(_0x513e7d['checkRetriveMax'](_0x191978[_0xaea1('0x10a')],_0x47e5b9,_0x5b064e)){if(_0x35684b[_0xaea1('0xf0')]+_0x35684b[_0xaea1('0xf1')]+_0x35684b[_0xaea1('0xf2')]+_0x35684b[_0xaea1('0xf3')]+_0x35684b[_0xaea1('0x100')]+_0x35684b[_0xaea1('0x101')]+_0x35684b[_0xaea1('0xed')]+_0x35684b[_0xaea1('0xf4')]>=_0x5b064e[_0xaea1('0xf5')]){_0x513e7d[_0xaea1('0xf6')](_0x35684b,_0x3f74ee,_0x455867,_0x191978[_0xaea1('0x10a')]);}else{_0x513e7d[_0xaea1('0xf8')](_0x35684b,_0x3f74ee,_0x455867,_0x191978[_0xaea1('0x10a')]);}}}});};Dialer['prototype'][_0xaea1('0xf6')]=function(_0x2e8dcd,_0x21f547,_0x4d869d,_0x43bc6e){var _0x31e4c3=new Final(_0x2e8dcd);_0x31e4c3[_0xaea1('0xa8')]=0xf;_0x31e4c3['statedesc']=_0xaea1('0x1c2');this[_0xaea1('0xf8')](_0x31e4c3,_0x21f547,_0x4d869d,_0x43bc6e);};Dialer[_0xaea1('0x1a')][_0xaea1('0xf8')]=function(_0x361cbf,_0x2de9c8,_0x503cb6,_0x3f6c86){this[_0xaea1('0xce')](_0x361cbf)[_0xaea1('0xba')](function(){return _0x2de9c8(msgResponse('[callProgressDetecting]',_0xaea1('0xda'),_0x3f6c86));})[_0xaea1('0xb2')](function(){return _0x503cb6(msgResponse(_0xaea1('0x1c3'),'Failure',_0xaea1('0x1c4')));});};Dialer[_0xaea1('0x1a')][_0xaea1('0xb')]=function(_0xe12d5b){var _0x4857c7=_0xe12d5b[_0xaea1('0x1c5')]/0x64;var _0x57cb3f=_0xe12d5b[_0xaea1('0x60')]/(_0xe12d5b[_0xaea1('0x60')]+_0xe12d5b['outboundAnswerCallsDay']);var _0x10301a=Math['round'](_0xe12d5b[_0xaea1('0x6f')]*(_0xe12d5b['predictiveIntervalMaxThreshold']/0x64));var _0x2da96c=Math[_0xaea1('0x1c6')](_0xe12d5b['predictiveIntervalAvailable']*(_0xe12d5b['predictiveIntervalMinThreshold']/0x64));var _0x501543=_0xe12d5b[_0xaea1('0x4e')]+_0xe12d5b[_0xaea1('0x53')];var _0x4f944f=Math[_0xaea1('0x1c7')](_0xe12d5b[_0xaea1('0x8b')]*_0xe12d5b[_0xaea1('0x73')]*_0xe12d5b['predictiveIntervalHitRate']*_0xe12d5b[_0xaea1('0x1c8')]);if(_[_0xaea1('0x3b')](_0xe12d5b['startProgressive'])){if(!_[_0xaea1('0x3b')](_0xe12d5b[_0xaea1('0x2a')])){_0xe12d5b['startPredictive']=undefined;loggerPredictive[_0xaea1('0x97')](_0xaea1('0x1c9'),_0xaea1('0x1ca'));}if(!_[_0xaea1('0x3b')](_0xe12d5b[_0xaea1('0x92')])){loggerPredictive['error'](_0xaea1('0x1c9'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xe12d5b[_0xaea1('0x92')]);_0xe12d5b[_0xaea1('0x92')]=undefined;}_0xe12d5b[_0xaea1('0x2b')]=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));loggerPredictive[_0xaea1('0x80')](_0xe12d5b[_0xaea1('0x3e')],'collection\x20data\x20in\x20progressive\x20at',_0xe12d5b[_0xaea1('0x2b')]);this['handlePower'](_0xe12d5b,0x1);}else if(ifInterval(_0xe12d5b[_0xaea1('0x1cb')],_0xe12d5b[_0xaea1('0x2b')])){this[_0xaea1('0x155')](_0xe12d5b,0x1);loggerPredictiveCalls['info'](_0xaea1('0x1cc'),_0xe12d5b[_0xaea1('0x2b')],_0xe12d5b['name']);_0xe12d5b[_0xaea1('0x8b')]=0x0;_0xe12d5b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4857c7<_0x57cb3f&&_0xe12d5b['dialPredictiveOptimization']===_0xaea1('0x1cd')){freeVariablesPredictive(_0xe12d5b);loggerPredictive[_0xaea1('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xaea1('0x1ce'),_0x57cb3f,_0xaea1('0x2b'),_0xe12d5b[_0xaea1('0x3e')]);}else if(_0x4f944f<_0xe12d5b['predictiveIntervalErlangCallsDroppedCalls']&&_0xe12d5b[_0xaea1('0x1cf')]===_0xaea1('0x1cd')){freeVariablesPredictive(_0xe12d5b);loggerPredictive[_0xaea1('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xaea1('0x1d0'),_0x4f944f,'Drop\x20in\x20this\x20interval',_0xe12d5b[_0xaea1('0x6d')],_0xaea1('0x2b'),_0xe12d5b[_0xaea1('0x3e')]);}else if(!ifInterval(_0xe12d5b[_0xaea1('0x1cb')],_0xe12d5b[_0xaea1('0x2b')])&&_[_0xaea1('0x3b')](_0xe12d5b[_0xaea1('0x2a')])&&!_[_0xaea1('0x3b')](_0xe12d5b[_0xaea1('0x2b')])){_0xe12d5b[_0xaea1('0x2a')]=moment()[_0xaea1('0x78')](_0xaea1('0xfc'));loggerPredictive['info'](_0xe12d5b[_0xaea1('0x3e')],_0xaea1('0x1d1'),_0xe12d5b[_0xaea1('0x2a')]);this[_0xaea1('0xc0')](_0xe12d5b[_0xaea1('0x1cb')])['then'](this[_0xaea1('0x1d2')](_0xe12d5b))[_0xaea1('0xba')](mergeDataErlangB(_0xe12d5b))[_0xaea1('0xba')](this['startMethodPredictive'](_0xe12d5b))['catch'](loggerCatchPredictive(_0xaea1('0x1d3'),_0xe12d5b));}else if(!ifInterval(_0xe12d5b['dialPredictiveInterval'],_0xe12d5b[_0xaea1('0x2a')])){_0xe12d5b['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0xe12d5b['startPredictive']=moment()['format'](_0xaea1('0xfc'));loggerPredictive['info'](_0xe12d5b[_0xaea1('0x3e')],_0xaea1('0x1d4'),_0xe12d5b[_0xaea1('0x2a')]);clearInterval(_0xe12d5b[_0xaea1('0x92')]);_0xe12d5b[_0xaea1('0x92')]=undefined;this['averageHandleTime'](_0xe12d5b[_0xaea1('0x1cb')])['then'](this[_0xaea1('0x1d2')](_0xe12d5b))[_0xaea1('0xba')](mergeDataErlangB(_0xe12d5b))[_0xaea1('0xba')](this[_0xaea1('0x1d5')](_0xe12d5b))[_0xaea1('0xb2')](loggerCatchPredictive(_0xaea1('0x1d6'),_0xe12d5b));}else if(_0xe12d5b[_0xaea1('0x6f')]&&_0x501543<_0xe12d5b[_0xaea1('0x6f')]-_0x2da96c){freeVariablesPredictive(_0xe12d5b);loggerPredictive[_0xaea1('0x80')](_0xe12d5b[_0xaea1('0x3e')],_0xaea1('0x1d7'),_0x501543,')\x20are\x20less\x20than\x20threshold\x20(',_0xe12d5b[_0xaea1('0x6f')],'-',_0x2da96c,'=',_0xe12d5b[_0xaea1('0x6f')]-_0x2da96c,')');}else if(_0xe12d5b['predictiveIntervalAvailable']&&_0x501543>_0xe12d5b[_0xaea1('0x6f')]+_0x10301a){freeVariablesPredictive(_0xe12d5b);loggerPredictive[_0xaea1('0x80')](_0xe12d5b['name'],_0xaea1('0x1d7'),_0x501543,_0xaea1('0x1d8'),_0xe12d5b[_0xaea1('0x6f')],'+',_0x10301a,'=',_0xe12d5b[_0xaea1('0x6f')]+_0x10301a,')');}};Dialer['prototype'][_0xaea1('0x1d2')]=function(_0x359eeb){var _0x15e99d=this;return function(_0x2c3f9e){return new BPromise(function(_0x2d9468,_0x50898b){_['merge'](_0x359eeb,_0x2c3f9e[0x0]);if(checkGetDataPredictive(_0x2c3f9e[0x0])){var _0x4e9ff5=_0x359eeb['predictiveIntervalAvailable']=_0x359eeb[_0xaea1('0x53')]+_0x359eeb[_0xaea1('0x4e')];var _0x2d823f=_0x359eeb[_0xaea1('0x1cb')]*0x3c;var _0x31ae4b=_0x2c3f9e[0x0][_0xaea1('0x69')]+_0x2c3f9e[0x0][_0xaea1('0x68')];var _0xbc38df=(_0x2c3f9e[0x0][_0xaea1('0x67')]+_0x2c3f9e[0x0][_0xaea1('0x6b')]+_0x2c3f9e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2c3f9e[0x0]['predictiveIntervalTotalCalls'];_0x359eeb[_0xaea1('0x6e')]=_0xbc38df>0x0?_0xbc38df:0x1;switch(_0x359eeb[_0xaea1('0x1cf')]){case _0xaea1('0x1cd'):var _0x58df82=_0x359eeb['dialPredictiveOptimizationPercentage']/0x64;return _0x15e99d['abandonmentRate'](_0x4e9ff5,_0x2d823f,_0x31ae4b,_0xbc38df,_0x58df82)['then'](function(_0x32924e){return _0x2d9468(_0x32924e);});case _0xaea1('0x1d9'):var _0x24fbbc=_0x359eeb[_0xaea1('0x1c5')]/0x64;return _0x15e99d[_0xaea1('0x1da')](_0x4e9ff5,_0x2d823f,_0x31ae4b,_0xbc38df,_0x24fbbc)[_0xaea1('0xba')](function(_0x36c77b){return _0x2d9468(_0x36c77b);});default:return _0x50898b(msgResponse(_0xaea1('0x1db'),_0xaea1('0x142'),'Unknown\x20Predictive'));}}else{return _0x50898b(msgResponse('[getDataPredictive]',_0xaea1('0x142'),_0xaea1('0x1dc')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x4837a5){var _0x22df72=this;return function(_0x160fc3){return new BPromise(function(_0x354bc2,_0x3e9eee){_[_0xaea1('0x8f')](_0x4837a5,_0x160fc3[0x0]);if(checkGetDataPredictive(_0x160fc3[0x0])){loggerPredictive[_0xaea1('0x80')](JSON[_0xaea1('0x45')](_0x160fc3[0x0]));if(_0x4837a5[_0xaea1('0x1cf')]===_0xaea1('0x1cd')){return _0x22df72['getVoiceQueueRtPauses'](_0x4837a5['id'])['then'](function(_0x77c47a){var _0x13e4c=_0x4837a5['loggedIn']-_0x77c47a[0x0]['outboundQueuePauses'];var _0x1ea614=_0x4837a5[_0xaea1('0x1cb')]*0x3c;var _0x3076d4=_0x160fc3[0x0][_0xaea1('0x69')]+_0x160fc3[0x0][_0xaea1('0x68')];var _0x22ce5c=(_0x160fc3[0x0][_0xaea1('0x67')]+_0x160fc3[0x0][_0xaea1('0x6b')]+_0x160fc3[0x0][_0xaea1('0x6a')])/_0x160fc3[0x0]['predictiveIntervalTotalCalls'];var _0x1626f0=_0x4837a5[_0xaea1('0x1c5')]/0x64;_0x4837a5[_0xaea1('0x1dd')]=_0x77c47a[0x0][_0xaea1('0x1de')]||0x0;_0x4837a5['predictiveIntervalHitRate']=_0x22ce5c>0x0?_0x22ce5c:0x1;return _0x22df72[_0xaea1('0x1df')](_0x13e4c,_0x1ea614,_0x3076d4,_0x22ce5c,_0x1626f0);})[_0xaea1('0xba')](function(_0x2590f8){return _0x354bc2(_0x2590f8);})[_0xaea1('0xb2')](function(_0x551d2d){return _0x3e9eee(msgResponse(_0xaea1('0x1e0'),'Failure',JSON[_0xaea1('0x45')](_0x551d2d)));});}if(_0x4837a5['dialPredictiveOptimization']===_0xaea1('0x1d9')){return _0x22df72[_0xaea1('0xcc')](_0x4837a5['id'])[_0xaea1('0xba')](function(_0x386438){var _0x2b00ab=_0x4837a5[_0xaea1('0x15a')]-_0x386438[0x0]['outboundQueuePauses'];var _0x1002be=_0x4837a5[_0xaea1('0x1cb')]*0x3c;var _0x23a15c=_0x160fc3[0x0][_0xaea1('0x69')]+_0x160fc3[0x0]['predictiveIntervalAvgHoldtime'];var _0x4c0ed4=(_0x160fc3[0x0][_0xaea1('0x67')]+_0x160fc3[0x0][_0xaea1('0x6b')]+_0x160fc3[0x0][_0xaea1('0x6a')])/_0x160fc3[0x0][_0xaea1('0x70')];var _0x2d4f5c=_0x4837a5[_0xaea1('0x1c5')]/0x64;_0x4837a5[_0xaea1('0x1dd')]=_0x386438[0x0][_0xaea1('0x1de')]||0x0;_0x4837a5[_0xaea1('0x6e')]=_0x4c0ed4>0x0?_0x4c0ed4:0x1;return _0x22df72[_0xaea1('0x1da')](_0x2b00ab,_0x1002be,_0x23a15c,_0x4c0ed4,_0x2d4f5c);})[_0xaea1('0xba')](function(_0x50b65b){return _0x354bc2(_0x50b65b);})['catch'](function(_0x265575){return _0x3e9eee(msgResponse(_0xaea1('0x1e0'),_0xaea1('0x142'),JSON[_0xaea1('0x45')](_0x265575)));});}}else{return _0x3e9eee(msgResponse('[getDataPredictive]','Failure',_0xaea1('0x1dc')));}});};};Dialer['prototype'][_0xaea1('0x1d5')]=function(_0xad5431){var _0x2d3018=this;return function(){var _0x502e47=0x0;var _0xd0d490=Math[_0xaea1('0x1c7')](_0xad5431[_0xaea1('0x72')]*0x3e8);if(_0xd0d490>0x0){_0xd0d490=_0xd0d490<0x64?0x64:_0xd0d490;loggerPredictive[_0xaea1('0x80')](_0xad5431['name'],_0xaea1('0x1e1'),_0xd0d490,_0xaea1('0x46'));_0xad5431[_0xaea1('0x92')]=setInterval(function(){_0x2d3018[_0xaea1('0x92')](_0xad5431);loggerPredictiveCalls[_0xaea1('0x80')](_0xaea1('0x1e2'),_0x502e47+=0x1);},_0xd0d490);}else{loggerPredictive[_0xaea1('0x80')](_0xad5431[_0xaea1('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xaea1('0x1a')]['checkContactBlack']=function(_0x4ad3dc,_0x5f1053){var _0x3a5c75=this;return function(_0x91e3af){if(_[_0xaea1('0x44')](_0x91e3af)){if(_[_0xaea1('0xb0')](_0x5f1053[_0xaea1('0xd7')])||!_0x5f1053[_0xaea1('0x1e3')]){if(_0x4ad3dc[_0xaea1('0x154')]===_0xaea1('0xa')){_0x4ad3dc[_0xaea1('0x12b')]=_[_0xaea1('0x3b')](_0x4ad3dc[_0xaea1('0x12b')])?!![]:_0x4ad3dc['queueStatusComplete'];var _0x37c2d4=uuid['v4']();_0x3a5c75['actions'][_0x37c2d4]=new Action(_0x4ad3dc,_0x5f1053,_0x37c2d4);loggerBooked[_0xaea1('0x80')](_0xaea1('0x1e4'),_0x37c2d4,_0xaea1('0x1e5'),JSON['stringify'](_0x4ad3dc[_0xaea1('0x12b')]),_0xaea1('0x1e6'),_0x4ad3dc[_0xaea1('0x3e')]);if(_0x4ad3dc[_0xaea1('0x12b')]){_0x4ad3dc[_0xaea1('0x12b')]=![];_0x3a5c75['queueBooked'][_0x3a5c75[_0xaea1('0x26')][_0x37c2d4]['queue']]=[];ami[_0xaea1('0x145')]({'actionid':_0x37c2d4,'action':_0xaea1('0x1e7'),'queue':_0x4ad3dc[_0xaea1('0x3e')]})[_0xaea1('0xb2')](function(){_0x3a5c75['updateOriginated'](_0x4ad3dc);_0x3a5c75['rescheduleContact']({'active':![],'ContactId':_0x3a5c75[_0xaea1('0x26')][_0x37c2d4][_0xaea1('0xd6')],'ListId':_0x3a5c75['actions'][_0x37c2d4][_0xaea1('0xfd')],'VoiceQueueId':_0x3a5c75[_0xaea1('0x26')][_0x37c2d4][_0xaea1('0xd8')]||undefined,'CampaignId':_0x3a5c75['actions'][_0x37c2d4]['CampaignId']||undefined})['catch'](loggerCatch(_0xaea1('0x1e8')));delete _0x3a5c75[_0xaea1('0x26')][_0x37c2d4];});}else{loggerBooked[_0xaea1('0x80')](_0xaea1('0x1e9'),JSON[_0xaea1('0x45')](_0x4ad3dc['queueStatusComplete']),'Queue:\x20',_0x4ad3dc['name']);_0x3a5c75[_0xaea1('0xb4')](_0x4ad3dc);_0x3a5c75[_0xaea1('0xc3')]({'active':![],'ContactId':_0x3a5c75[_0xaea1('0x26')][_0x37c2d4]['ContactId'],'ListId':_0x3a5c75[_0xaea1('0x26')][_0x37c2d4][_0xaea1('0xfd')],'VoiceQueueId':_0x3a5c75[_0xaea1('0x26')][_0x37c2d4][_0xaea1('0xd8')]||undefined,'CampaignId':_0x3a5c75['actions'][_0x37c2d4]['CampaignId']||undefined})[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1e8')));delete _0x3a5c75['actions'][_0x37c2d4];}}else{return _0x3a5c75[_0xaea1('0x165')](_0x4ad3dc,_0x5f1053);}}else{if(getDiff(_0x5f1053['scheduledat'])<_0x4ad3dc[_0xaea1('0x1ea')]*0x3c){if(_0x5f1053['Agent']&&!_0x5f1053['Agent'][_0xaea1('0x1eb')]){_0x3a5c75[_0xaea1('0x1f')][_0xaea1('0x12e')](_0x5f1053['id'])[_0xaea1('0x1d')](function(){_0x3a5c75[_0xaea1('0xb4')](_0x4ad3dc);});}else{_0x3a5c75[_0xaea1('0xc5')]({'active':![]},_0x5f1053['id'],0x1)[_0xaea1('0x1d')](function(){_0x3a5c75[_0xaea1('0xb4')](_0x4ad3dc);});}}else{_0x4ad3dc[_0xaea1('0x64')]+=0x1;_0x3a5c75['updateOriginated'](_0x4ad3dc);if(_0x4ad3dc[_0xaea1('0x1ec')]){_0x3a5c75['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5f1053['ContactId'],'ListId':_0x5f1053[_0xaea1('0xfd')],'VoiceQueueId':_0x5f1053[_0xaea1('0xd8')]||undefined,'CampaignId':_0x5f1053[_0xaea1('0x102')]||undefined})[_0xaea1('0xb2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3a5c75[_0xaea1('0xcf')](createObjHistory(_0x4ad3dc,_0x5f1053,'RECALLINQUEUE',0x17,_0xaea1('0x1ed')))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0x1ee')));}else{_0x3a5c75[_0xaea1('0xde')](createObjHistory(_0x4ad3dc,_0x5f1053,_0xaea1('0x1ef'),0x16,_0xaea1('0x1f0')),_0xaea1('0x1f1'),_0xaea1('0x1f2'));}}}}else{_0x4ad3dc['outboundBlacklistCallsDay']+=0x1;_0x3a5c75['saveInDb'](createObjHistory(_0x4ad3dc,_0x5f1053,_0xaea1('0x1f3'),0xd,_0xaea1('0x1f4')),_0xaea1('0x1f5'),_0xaea1('0x1f6'));throw'inBlackList';}};};Dialer[_0xaea1('0x1a')][_0xaea1('0x159')]=function(_0x2d3aa5){var _0x2546ca=this;var _0x426b97=_0x2d3aa5[_0xaea1('0x1f7')]-_0x2d3aa5['originated']-_0x2d3aa5['temp'];emitCampaignSummary(_0x2d3aa5);if(_0x426b97>0x0){if(_0x426b97>this[_0xaea1('0x24')]){_0x426b97=this['maxNumberOriginate'];}_0x2d3aa5[_0xaea1('0xc8')]+=_0x426b97;this[_0xaea1('0xca')](_0x2d3aa5['id'],_0x426b97,_0x2d3aa5[_0xaea1('0x1f8')],_0x2d3aa5)[_0xaea1('0xba')](function(_0x51621d){_0x2d3aa5[_0xaea1('0xc8')]-=_0x426b97;_0x2d3aa5[_0xaea1('0xc8')]=_0x2d3aa5[_0xaea1('0xc8')]>0x0?_0x2d3aa5[_0xaea1('0xc8')]:0x0;if(!checkContactEmpty(_0x51621d)){_0x2d3aa5[_0xaea1('0x3d')]=_0xaea1('0x9e');logger[_0xaea1('0x80')](_0xaea1('0x1f9')+_0x2d3aa5[_0xaea1('0x3e')]);}else{_0x2d3aa5[_0xaea1('0x71')]+=_0x51621d[_0xaea1('0x133')];_0x2d3aa5[_0xaea1('0x3d')]=_0xaea1('0x1fa');for(var _0x31244f=0x0;_0x31244f<_0x51621d[_0xaea1('0x133')];_0x31244f+=0x1){_0x2d3aa5[_0xaea1('0x1fb')]+=0x1;if(_['isNil'](_0x51621d[_0x31244f])||_[_0xaea1('0xb0')](_0x51621d[_0x31244f]['Contact'])||_[_0xaea1('0xb0')](_0x51621d[_0x31244f][_0xaea1('0x169')][_0xaea1('0x16a')])){_0x2546ca[_0xaea1('0xd4')](_0xaea1('0x1fc'),_0x2d3aa5,_0x51621d[_0x31244f]);}else{_0x2546ca[_0xaea1('0xbe')](_[_0xaea1('0x129')](_0x51621d[_0x31244f],[_0xaea1('0x102'),_0xaea1('0x1fd')]))[_0xaea1('0xba')](_0x2546ca[_0xaea1('0x1fe')](_0x2d3aa5,_0x51621d[_0x31244f]))[_0xaea1('0xb2')](_0x2546ca[_0xaea1('0xd3')](_0xaea1('0x1ff'),_0x2d3aa5));}}}})[_0xaea1('0xb2')](loggerGetContactDialer(_0xaea1('0x200'),_0x2d3aa5,_0x426b97));}};Dialer['prototype'][_0xaea1('0x155')]=function(_0x391033,_0x4be4bc){var _0x561902=this;var _0x5d3f56=[];var _0x4ec2be=_0x4be4bc>=0x1?_0x4be4bc:0x1;if(_0x391033[_0xaea1('0x154')]===_0xaea1('0xa')){_0x4ec2be=0x1;}var _0x52fca1=Math['floor'](_0x391033[_0xaea1('0x4e')]*_0x4ec2be)-_0x391033[_0xaea1('0x71')]-_0x391033[_0xaea1('0xc8')];emitVoiceQueueSummary(_0x391033);if(_0x391033[_0xaea1('0x201')]>0x0){var _0x49768b=_0x391033[_0xaea1('0x201')]-_0x391033[_0xaea1('0x71')]-_0x391033[_0xaea1('0x53')]-_0x391033['temp']-_0x391033['pTalking'];if(_0x52fca1>_0x49768b){_0x52fca1=_0x49768b;}}if(_0x52fca1>0x0){if(_0x391033['dialMethod']==='booked'){_0x52fca1=0x1;}if(_0x52fca1>this[_0xaea1('0x24')]){_0x52fca1=this['maxNumberOriginate'];}_0x391033[_0xaea1('0xc8')]+=_0x52fca1;for(var _0x216088 in this[_0xaea1('0x22')]){if(typeof this[_0xaea1('0x22')][_0x216088]!==_0xaea1('0xaf')){if(this[_0xaea1('0x22')][_0x216088][_0xaea1('0xa8')]===_0xaea1('0x202')&&this[_0xaea1('0x22')][_0x216088][_0xaea1('0xdd')]===_0xaea1('0x203')){_0x5d3f56[_0xaea1('0x128')](this[_0xaea1('0x22')][_0x216088]['id']);}}}this[_0xaea1('0xc7')](_0x391033['id'],_0x5d3f56,_0x52fca1,_0x391033[_0xaea1('0x1f8')],_0x391033)[_0xaea1('0xba')](function(_0x454517){_0x391033[_0xaea1('0xc8')]-=_0x52fca1;_0x391033[_0xaea1('0xc8')]=_0x391033['temp']>0x0?_0x391033[_0xaea1('0xc8')]:0x0;if(!checkContactEmpty(_0x454517)){_0x561902[_0xaea1('0xb8')](_0x391033)[_0xaea1('0xba')](sendMessageReschedule(_0x391033))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xbb')));}else{_0x391033[_0xaea1('0x71')]+=_0x454517[_0xaea1('0x133')];_0x391033[_0xaea1('0x3d')]=_0x391033['dialMethod']==='booked'?_0xaea1('0x172'):_0xaea1('0x1fa');for(var _0x237e3b=0x0;_0x237e3b<_0x454517[_0xaea1('0x133')];_0x237e3b+=0x1){if(_[_0xaea1('0xb0')](_0x454517[_0x237e3b])||_['isNil'](_0x454517[_0x237e3b]['Contact'])||_[_0xaea1('0xb0')](_0x454517[_0x237e3b][_0xaea1('0x169')][_0xaea1('0x16a')])){_0x561902[_0xaea1('0xd4')](_0xaea1('0x1fc'),_0x391033,_0x454517[_0x237e3b]);}else{_0x561902[_0xaea1('0xbc')](_[_0xaea1('0x129')](_0x454517[_0x237e3b],[_0xaea1('0xd8'),_0xaea1('0x1fd')]))[_0xaea1('0xba')](_0x561902[_0xaea1('0x1fe')](_0x391033,_0x454517[_0x237e3b]))[_0xaea1('0xb2')](_0x561902['loggerHandler'](_0xaea1('0x1fc'),_0x391033));}}}})[_0xaea1('0xb2')](loggerGetContactDialer(_0xaea1('0x204'),_0x391033,_0x52fca1));}};Dialer[_0xaea1('0x1a')]['handlePredictive']=function(_0x5209cd){if(_0x5209cd[_0xaea1('0x201')]>0x0){var _0x52633f=_0x5209cd['dialLimitQueue']-_0x5209cd[_0xaea1('0x71')]-_0x5209cd[_0xaea1('0x53')];if(_0x52633f>0x0){this['tryOriginatePredictive'](_0x5209cd);}else{loggerPredictiveCalls['info'](_0xaea1('0x205'));}}else{this[_0xaea1('0x206')](_0x5209cd);}};Dialer[_0xaea1('0x1a')][_0xaea1('0x206')]=function(_0xca96c){var _0x430d15=this;var _0x242ea5=[];_0xca96c['originated']+=0x1;for(var _0x2baa37 in this[_0xaea1('0x22')]){if(typeof this[_0xaea1('0x22')][_0x2baa37]!==_0xaea1('0xaf')){if(this[_0xaea1('0x22')][_0x2baa37]['state']===_0xaea1('0x202')&&this[_0xaea1('0x22')][_0x2baa37]['status']===_0xaea1('0x203')){_0x242ea5[_0xaea1('0x128')](this['agents'][_0x2baa37]['id']);}}}this[_0xaea1('0xc7')](_0xca96c['id'],_0x242ea5,0x1,_0xca96c[_0xaea1('0x1f8')],_0xca96c)['then'](function(_0x1de379){if(!checkContactEmpty(_0x1de379)){checkContactLowerLimitOriginate(_0xca96c,0x1,0x0);_0x430d15[_0xaea1('0xb8')](_0xca96c)['then'](sendMessageReschedule(_0xca96c))[_0xaea1('0xb2')](loggerCatch(_0xaea1('0xbb')));}else{_0xca96c[_0xaea1('0x3d')]=_0xaea1('0x1fa');if(_[_0xaea1('0xb0')](_0x1de379[0x0])||_['isNil'](_0x1de379[0x0][_0xaea1('0x169')])||_[_0xaea1('0xb0')](_0x1de379[0x0][_0xaea1('0x169')]['phone'])){_0x430d15[_0xaea1('0xd4')](_0xaea1('0x1fc'),_0xca96c,_0x1de379[0x0]);}else{_0x430d15[_0xaea1('0xbc')](_[_0xaea1('0x129')](_0x1de379[0x0],[_0xaea1('0xd8'),_0xaea1('0x1fd')]))[_0xaea1('0xba')](_0x430d15[_0xaea1('0x1fe')](_0xca96c,_0x1de379[0x0]))[_0xaea1('0xb2')](_0x430d15['loggerHandler'](_0xaea1('0x207'),_0xca96c));}}})[_0xaea1('0xb2')](loggerGetContactDialer('[getContactDialerPredictive]',_0xca96c,0x1));emitVoiceQueueSummary(_0xca96c);};Dialer[_0xaea1('0x1a')][_0xaea1('0x1df')]=function(_0x3b9df4,_0x74392b,_0x1c5da8,_0x5cb377,_0x4ebf56,_0x4b0739){loggerPredictive[_0xaea1('0x80')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xaea1('0x80')](_0xaea1('0x208'),_0x3b9df4);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x209'),_0x74392b);loggerPredictive['info'](_0xaea1('0x20a'),_0x1c5da8);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x20b'),_0x5cb377);loggerPredictive[_0xaea1('0x80')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ebf56);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x227483,_0x40466c){if(_0x3b9df4<=0x0||isNaN(_0x3b9df4)){return _0x40466c(msgResponse(_0xaea1('0x20c'),_0xaea1('0x192'),_0xaea1('0x20d')+_0x3b9df4));}if(_0x1c5da8<=0x0||isNaN(_0x1c5da8)){return _0x40466c(msgResponse(_0xaea1('0x20c'),'Error',_0xaea1('0x20e')+_0x1c5da8));}if(_0x5cb377<=0x0||isNaN(_0x5cb377)){return _0x40466c(msgResponse(_0xaea1('0x20c'),_0xaea1('0x192'),_0xaea1('0x20f')+_0x5cb377));}if(_0x74392b<=0x0||isNaN(_0x74392b)){return _0x40466c(msgResponse(_0xaea1('0x20c'),_0xaea1('0x192'),_0xaea1('0x210')+_0x74392b));}if(_0x4ebf56<=0x0||isNaN(_0x4ebf56)){return _0x40466c(msgResponse(_0xaea1('0x20c'),_0xaea1('0x192'),_0xaea1('0x211')+_0x4ebf56));}_0x4b0739=_0x4b0739||0x0;var _0x351810=0x1/_0x1c5da8;var _0xac6449=0x0;var _0x329126=0x0;var _0x60dd1f=0x0;var _0x4206ce=0x0;for(var _0xa7c6c=0x0;_0x60dd1f<_0x4ebf56;_0xa7c6c+=0x1){_0x329126=_0xa7c6c/_0x74392b;_0xac6449=(_0x5cb377*_0x329126+_0x4b0739)/_0x351810;_0x60dd1f=erlangb(_0xac6449,_0x3b9df4);_0x4206ce=_0xac6449/_0x3b9df4*(0x1-erlangb(_0xac6449,_0x3b9df4));}return _0x227483({'erlangCalls':_0xa7c6c,'erlangCallToSecond':_0x74392b/_0xa7c6c,'erlangAbandonmentRate':_0x60dd1f,'erlangBusyFactor':_0x4206ce});});};Dialer[_0xaea1('0x1a')][_0xaea1('0x1da')]=function(_0x5f568c,_0x46d159,_0x46f4ea,_0x9b6ac,_0x21bdc7,_0x3f0300){loggerPredictive[_0xaea1('0x80')](_0xaea1('0x212'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f568c);loggerPredictive[_0xaea1('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46d159);loggerPredictive[_0xaea1('0x80')]('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',_0x46f4ea);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x20b'),_0x9b6ac);loggerPredictive['info'](_0xaea1('0x213'),_0x21bdc7);loggerPredictive[_0xaea1('0x80')](_0xaea1('0x8e'));return new BPromise(function(_0x5a69f9,_0x10afe0){if(_0x5f568c<=0x0||isNaN(_0x5f568c)){return _0x10afe0(msgResponse(_0xaea1('0x214'),_0xaea1('0x192'),_0xaea1('0x20d')+_0x5f568c));}if(_0x46f4ea<=0x0||isNaN(_0x46f4ea)){return _0x10afe0(msgResponse(_0xaea1('0x214'),'Error',_0xaea1('0x20e')+_0x46f4ea));}if(_0x9b6ac<=0x0||isNaN(_0x9b6ac)){return _0x10afe0(msgResponse('[busyFactor]',_0xaea1('0x192'),_0xaea1('0x20f')+_0x9b6ac));}if(_0x46d159<=0x0||isNaN(_0x46d159)){return _0x10afe0(msgResponse(_0xaea1('0x214'),_0xaea1('0x192'),_0xaea1('0x210')+_0x46d159));}if(_0x21bdc7<=0x0||isNaN(_0x21bdc7)){return _0x10afe0(msgResponse('[busyFactor]',_0xaea1('0x192'),_0xaea1('0x215')+_0x21bdc7));}_0x3f0300=_0x3f0300||0x0;var _0x495162=0x1/_0x46f4ea;var _0x5be667=0x0;var _0x56482e=0x0;var _0x2b69d4=0x0;var _0x390362=0x0;for(var _0x32643a=0x0;_0x390362<_0x21bdc7;_0x32643a+=0x1){_0x56482e=_0x32643a/_0x46d159;_0x5be667=(_0x9b6ac*_0x56482e+_0x3f0300)/_0x495162;_0x2b69d4=erlangb(_0x5be667,_0x5f568c);_0x390362=_0x5be667/_0x5f568c*(0x1-erlangb(_0x5be667,_0x5f568c));}return _0x5a69f9({'erlangCalls':_0x32643a,'erlangCallToSecond':_0x46d159/_0x32643a,'erlangAbandonmentRate':_0x2b69d4,'erlangBusyFactor':_0x390362});});};module[_0xaea1('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 801ff87..ce94681 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5e9=['moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe5e9,0xda));var _0x9e5e=function(_0xb5c10c,_0x33d4e6){_0xb5c10c=_0xb5c10c-0x0;var _0x309636=_0xe5e9[_0xb5c10c];return _0x309636;};'use strict';var util=require(_0x9e5e('0x0'));var _=require(_0x9e5e('0x1'));var moment=require(_0x9e5e('0x2'));function getSeconds(_0x3a176f,_0x742e5d){var _0x97594=moment(_0x3a176f)[_0x9e5e('0x3')](0x0);var _0x363ecd=moment(_0x742e5d)['milliseconds'](0x0);return _0x97594[_0x9e5e('0x4')](_0x363ecd,_0x9e5e('0x5'));}function QueueCallerAbandon(_0x28e6e0,_0x53dd46){this[_0x9e5e('0x6')]=_0x28e6e0[_0x9e5e('0x6')];this[_0x9e5e('0x7')]=_0x28e6e0[_0x9e5e('0x7')];this[_0x9e5e('0x8')]=_0x28e6e0[_0x9e5e('0x7')]===_0x9e5e('0x9')?_0x9e5e('0xa'):_0x28e6e0[_0x9e5e('0x7')];this[_0x9e5e('0xb')]=_0x28e6e0['countbusyretry'];this[_0x9e5e('0xc')]=_0x28e6e0[_0x9e5e('0xc')];this['countnoanswerretry']=_0x28e6e0['countnoanswerretry'];this['countglobal']=_0x28e6e0[_0x9e5e('0xb')]+_0x28e6e0['countcongestionretry']+_0x28e6e0['countnoanswerretry']+_0x28e6e0['countnosuchnumberretry']+_0x28e6e0[_0x9e5e('0xd')]+_0x28e6e0[_0x9e5e('0xe')]+_0x28e6e0[_0x9e5e('0xf')]+_0x28e6e0[_0x9e5e('0x10')];this[_0x9e5e('0x11')]=_0x28e6e0[_0x9e5e('0x11')];this[_0x9e5e('0xd')]=_0x28e6e0[_0x9e5e('0xd')];this[_0x9e5e('0xe')]=_0x28e6e0[_0x9e5e('0xe')];this[_0x9e5e('0xf')]=_0x28e6e0['countmachineretry'];this[_0x9e5e('0x10')]=_0x28e6e0[_0x9e5e('0x10')];this[_0x9e5e('0x12')]=_0x53dd46[_0x9e5e('0x12')];this[_0x9e5e('0x13')]=_0x28e6e0[_0x9e5e('0x14')];this[_0x9e5e('0x15')]=_0x28e6e0[_0x9e5e('0x16')];this[_0x9e5e('0x17')]=_0x28e6e0[_0x9e5e('0x17')];this[_0x9e5e('0x18')]=_0x28e6e0[_0x9e5e('0x18')];this[_0x9e5e('0x19')]=_0x28e6e0['droptime'];this[_0x9e5e('0x1a')]=this[_0x9e5e('0x19')];this[_0x9e5e('0x1b')]=getSeconds(_0x28e6e0[_0x9e5e('0x18')],_0x28e6e0[_0x9e5e('0x17')]);this[_0x9e5e('0x1c')]=getSeconds(this[_0x9e5e('0x19')],_0x28e6e0[_0x9e5e('0x18')]);this[_0x9e5e('0x1d')]=0x0;this['queue']=_0x53dd46['queue'];this[_0x9e5e('0x1e')]=_0x53dd46[_0x9e5e('0x1f')];this[_0x9e5e('0x20')]=_0x53dd46[_0x9e5e('0x20')];this[_0x9e5e('0x21')]=_0x28e6e0[_0x9e5e('0x21')];this[_0x9e5e('0x22')]=_0x28e6e0['callbackuniqueid'];this['callbackat']=_0x28e6e0[_0x9e5e('0x23')];this[_0x9e5e('0x24')]=_0x28e6e0[_0x9e5e('0x24')];this['ContactId']=_0x28e6e0[_0x9e5e('0x25')];this['ListId']=_0x28e6e0['ListId'];this[_0x9e5e('0x26')]=_0x28e6e0['UserId'];this[_0x9e5e('0x27')]=_0x28e6e0[_0x9e5e('0x27')];this['CampaignId']=_0x28e6e0[_0x9e5e('0x28')];this[_0x9e5e('0x29')]=_0x28e6e0['originatecalleridnum']||'';this[_0x9e5e('0x2a')]=_0x28e6e0[_0x9e5e('0x2a')]||'';}module[_0x9e5e('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0xe95e=['util','lodash','moment','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x3ac527,_0xaf5872){var _0x28887b=function(_0x24b666){while(--_0x24b666){_0x3ac527['push'](_0x3ac527['shift']());}};_0x28887b(++_0xaf5872);}(_0xe95e,0x78));var _0xee95=function(_0x54f322,_0x24a660){_0x54f322=_0x54f322-0x0;var _0xb0a1d5=_0xe95e[_0x54f322];return _0xb0a1d5;};'use strict';var util=require(_0xee95('0x0'));var _=require(_0xee95('0x1'));var moment=require(_0xee95('0x2'));function getSeconds(_0x44192d,_0x1b938b){var _0x2c8572=moment(_0x44192d)['milliseconds'](0x0);var _0x1a77e0=moment(_0x1b938b)['milliseconds'](0x0);return _0x2c8572[_0xee95('0x3')](_0x1a77e0,_0xee95('0x4'));}function QueueCallerAbandon(_0x3fed53,_0x1b08f3){this[_0xee95('0x5')]=_0x3fed53[_0xee95('0x5')];this['type']=_0x3fed53[_0xee95('0x6')];this['campaigntype']=_0x3fed53['type']===_0xee95('0x7')?'queue':_0x3fed53[_0xee95('0x6')];this[_0xee95('0x8')]=_0x3fed53['countbusyretry'];this[_0xee95('0x9')]=_0x3fed53[_0xee95('0x9')];this[_0xee95('0xa')]=_0x3fed53[_0xee95('0xa')];this['countglobal']=_0x3fed53['countbusyretry']+_0x3fed53[_0xee95('0x9')]+_0x3fed53[_0xee95('0xa')]+_0x3fed53[_0xee95('0xb')]+_0x3fed53[_0xee95('0xc')]+_0x3fed53[_0xee95('0xd')]+_0x3fed53[_0xee95('0xe')]+_0x3fed53[_0xee95('0xf')];this[_0xee95('0xb')]=_0x3fed53[_0xee95('0xb')];this[_0xee95('0xc')]=_0x3fed53[_0xee95('0xc')];this[_0xee95('0xd')]=_0x3fed53[_0xee95('0xd')];this['countmachineretry']=_0x3fed53['countmachineretry'];this[_0xee95('0xf')]=_0x3fed53[_0xee95('0xf')];this['uniqueid']=_0x1b08f3['uniqueid'];this[_0xee95('0x10')]=_0x3fed53['name'];this[_0xee95('0x11')]=_0x3fed53[_0xee95('0x12')];this[_0xee95('0x13')]=_0x3fed53[_0xee95('0x13')];this[_0xee95('0x14')]=_0x3fed53[_0xee95('0x14')];this[_0xee95('0x15')]=_0x3fed53[_0xee95('0x15')];this[_0xee95('0x16')]=this['droptime'];this[_0xee95('0x17')]=getSeconds(_0x3fed53[_0xee95('0x14')],_0x3fed53['starttime']);this[_0xee95('0x18')]=getSeconds(this['droptime'],_0x3fed53[_0xee95('0x14')]);this['talktime']=0x0;this[_0xee95('0x19')]=_0x1b08f3[_0xee95('0x19')];this['membername']=_0x1b08f3[_0xee95('0x1a')];this[_0xee95('0x1b')]=_0x1b08f3[_0xee95('0x1b')];this[_0xee95('0x1c')]=_0x3fed53[_0xee95('0x1c')];this[_0xee95('0x1d')]=_0x3fed53[_0xee95('0x1d')];this['callbackat']=_0x3fed53[_0xee95('0x1e')];this[_0xee95('0x1f')]=_0x3fed53[_0xee95('0x1f')];this[_0xee95('0x20')]=_0x3fed53[_0xee95('0x20')];this[_0xee95('0x21')]=_0x3fed53['ListId'];this[_0xee95('0x22')]=_0x3fed53[_0xee95('0x22')];this['VoiceQueueId']=_0x3fed53[_0xee95('0x23')];this[_0xee95('0x24')]=_0x3fed53[_0xee95('0x24')];this[_0xee95('0x25')]=_0x3fed53['originatecalleridnum']||'';this[_0xee95('0x26')]=_0x3fed53[_0xee95('0x26')]||'';}module[_0xee95('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d6d3fe2..a8c67d8 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(_0x29dbc4,_0x1a6f2d){var _0x1cf334=function(_0x33e4d0){while(--_0x33e4d0){_0x29dbc4['push'](_0x29dbc4['shift']());}};_0x1cf334(++_0x1a6f2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x557abc,_0x56598a){var _0xf8dfad=function(_0x2f57c4){while(--_0x2f57c4){_0x557abc['push'](_0x557abc['shift']());}};_0xf8dfad(++_0x56598a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 4eb8e61..05af847 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 _0x3f8c=['faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','execute','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','fax','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3f8c,0x104));var _0xc3f8=function(_0x47cea9,_0x17f62b){_0x47cea9=_0x47cea9-0x0;var _0xd0848d=_0x3f8c[_0x47cea9];return _0xd0848d;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xc3f8('0x0'));var uuid=require(_0xc3f8('0x1'));var moment=require(_0xc3f8('0x2'));var path=require(_0xc3f8('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0xc3f8('0x4'));var Channel=require(_0xc3f8('0x5'));var ut=require(_0xc3f8('0x6'));var Action=require(_0xc3f8('0x7'));var faxAccount=require(_0xc3f8('0x8'));var attachment=require(_0xc3f8('0x9'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x28397e){this[_0xc3f8('0xa')]={};this[_0xc3f8('0xb')]=_0x28397e[_0xc3f8('0xb')];this[_0xc3f8('0xc')]=_0x28397e[_0xc3f8('0xc')];this[_0xc3f8('0xd')]={};ami['on']('newchannel',this[_0xc3f8('0xe')][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x10'),this[_0xc3f8('0x11')]['bind'](this));ami['on'](_0xc3f8('0x12'),this[_0xc3f8('0x13')][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x14'),this['syncNewExten'][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x15'),this[_0xc3f8('0x16')][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x17'),this[_0xc3f8('0x18')][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x19'),this[_0xc3f8('0x1a')][_0xc3f8('0xf')](this));ami['on'](_0xc3f8('0x1b'),this[_0xc3f8('0x1c')][_0xc3f8('0xf')](this));}Fax['prototype'][_0xc3f8('0xe')]=function(_0x4ccca7){if(_0x4ccca7['context']===_0xc3f8('0x1d')){for(var _0x2e7c0f in this[_0xc3f8('0xb')]){if(this[_0xc3f8('0xb')]['hasOwnProperty'](_0x2e7c0f)){if(_0x4ccca7[_0xc3f8('0x1e')]===this[_0xc3f8('0xb')][_0x2e7c0f]['localstationid']){this[_0xc3f8('0xa')][_0x4ccca7['uniqueid']]={};this[_0xc3f8('0xa')][_0x4ccca7[_0xc3f8('0x1f')]][_0xc3f8('0x20')]=_0x4ccca7['channel'];this['channels'][_0x4ccca7[_0xc3f8('0x1f')]]['id']=this[_0xc3f8('0xb')][_0x2e7c0f]['id'];this[_0xc3f8('0xa')][_0x4ccca7[_0xc3f8('0x1f')]][_0xc3f8('0x21')]=this[_0xc3f8('0xb')][_0x2e7c0f][_0xc3f8('0x21')];logger[_0xc3f8('0x22')](_0x4ccca7['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x4ccca7[_0xc3f8('0x1f')]]){this['channels'][_0x4ccca7[_0xc3f8('0x1f')]]={};this[_0xc3f8('0xa')][_0x4ccca7['uniqueid']][_0xc3f8('0x20')]=_0x4ccca7[_0xc3f8('0x20')];logger[_0xc3f8('0x22')](_0x4ccca7[_0xc3f8('0x1f')],_0xc3f8('0x23'));}};Fax[_0xc3f8('0x24')][_0xc3f8('0x11')]=function(_0x7f14ad){if(this[_0xc3f8('0xa')][_0x7f14ad[_0xc3f8('0x1f')]]){for(var _0x22c8e6 in _0x7f14ad[_0xc3f8('0x25')]){if(_0x7f14ad[_0xc3f8('0x25')][_0xc3f8('0x26')](_0x22c8e6)){this['channels'][_0x7f14ad[_0xc3f8('0x1f')]][_0x22c8e6]=_0x7f14ad[_0xc3f8('0x27')];}}}};Fax[_0xc3f8('0x24')]['syncNewState']=function(_0x151bba){if(this['channels'][_0x151bba[_0xc3f8('0x1f')]]){this[_0xc3f8('0xa')][_0x151bba['uniqueid']]['channelstate']=_0x151bba[_0xc3f8('0x28')];this[_0xc3f8('0xa')][_0x151bba[_0xc3f8('0x1f')]][_0xc3f8('0x29')]=_0x151bba[_0xc3f8('0x29')];}};Fax[_0xc3f8('0x24')][_0xc3f8('0x2a')]=function(_0x80546a){if(this[_0xc3f8('0xa')][_0x80546a[_0xc3f8('0x1f')]]){for(var _0x52e543 in _0x80546a[_0xc3f8('0x25')]){if(_0x80546a[_0xc3f8('0x25')][_0xc3f8('0x26')](_0x52e543)){this[_0xc3f8('0xa')][_0x80546a[_0xc3f8('0x1f')]][_0x52e543]=_0x80546a['value'];}}}};Fax['prototype'][_0xc3f8('0x16')]=function(_0x8a0b00){if(this[_0xc3f8('0xa')][_0x8a0b00[_0xc3f8('0x1f')]]){this[_0xc3f8('0xa')][_0x8a0b00['uniqueid']][_0xc3f8('0x2b')]=_0x8a0b00[_0xc3f8('0x2b')];this[_0xc3f8('0xa')][_0x8a0b00['uniqueid']][_0xc3f8('0x2c')]=_0x8a0b00[_0xc3f8('0x2c')];this[_0xc3f8('0xa')][_0x8a0b00['uniqueid']][_0xc3f8('0x2d')]=_0x8a0b00[_0xc3f8('0x2d')];this['channels'][_0x8a0b00[_0xc3f8('0x1f')]][_0xc3f8('0x2e')]=_0x8a0b00[_0xc3f8('0x2e')];logger[_0xc3f8('0x22')](_0x8a0b00[_0xc3f8('0x1f')],_0xc3f8('0x2f'));}};Fax['prototype'][_0xc3f8('0x18')]=function(_0x2e4880){var _0x2d3129=this;if(this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]]){var _0x502293=this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]]['id'];this[_0xc3f8('0xa')][_0x2e4880['uniqueid']][_0xc3f8('0x30')]=_0x2e4880[_0xc3f8('0x30')];this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]]['pagestransferred']=_0x2e4880[_0xc3f8('0x31')];this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]][_0xc3f8('0x2d')]=_0x2e4880['localstationid'];this[_0xc3f8('0xa')][_0x2e4880['uniqueid']]['resolution']=_0x2e4880[_0xc3f8('0x32')];this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]][_0xc3f8('0x33')]=_0x2e4880['transferrate'];this['channels'][_0x2e4880[_0xc3f8('0x1f')]][_0xc3f8('0x2e')]=_0x2e4880[_0xc3f8('0x2e')];this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]][_0xc3f8('0x34')]=_0x2e4880[_0xc3f8('0x34')];if(this[_0xc3f8('0xa')][_0x2e4880[_0xc3f8('0x1f')]][_0xc3f8('0x31')]>0x0){tiff2pdf(_0x2e4880[_0xc3f8('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x46f902){logger[_0xc3f8('0x22')](_0x2e4880['uniqueid'],_0xc3f8('0x35'),_0x46f902[_0xc3f8('0x36')]);attachment['create']({'name':path[_0xc3f8('0x37')](_0x2e4880[_0xc3f8('0x2e')])[_0xc3f8('0x21')],'basename':path[_0xc3f8('0x37')](_0x2e4880[_0xc3f8('0x2e')])[_0xc3f8('0x21')]+_0xc3f8('0x38'),'type':_0xc3f8('0x39')})[_0xc3f8('0x3a')](function(_0x166097){faxAccount[_0xc3f8('0x3b')](_0x502293,{'from':_0x2e4880['calleridnum'],'mapKey':_0xc3f8('0x3c'),'body':path[_0xc3f8('0x37')](_0x2e4880['filename'])[_0xc3f8('0x21')]+_0xc3f8('0x38'),'AttachmentId':_0x166097['id']})[_0xc3f8('0x3d')](function(_0x425981){logger['error'](_0x2e4880['uniqueid'],_0xc3f8('0x3e'),JSON[_0xc3f8('0x3f')](_0x425981));});})[_0xc3f8('0x3d')](function(_0x5c08a9){logger[_0xc3f8('0x40')](_0x2e4880[_0xc3f8('0x1f')],_0xc3f8('0x41'),JSON[_0xc3f8('0x3f')](_0x5c08a9));});});}logger[_0xc3f8('0x22')](_0x2e4880['uniqueid'],_0xc3f8('0x41'));}};Fax[_0xc3f8('0x24')]['syncOriginateResponse']=function(_0x1becae){if(this[_0xc3f8('0xd')][_0x1becae[_0xc3f8('0x1f')]]){_[_0xc3f8('0x42')](this[_0xc3f8('0xa')][_0x1becae[_0xc3f8('0x1f')]],_[_0xc3f8('0x43')](_0x1becae,['response',_0xc3f8('0x44')]));}};function updateStatus(_0x257be1){if(_0x257be1['AttachmentId']){faxMessage[_0xc3f8('0x45')](_0x257be1[_0xc3f8('0x46')],{'failMessage':_0xc3f8('0x47')})[_0xc3f8('0x3a')](function(_0x2b0e33){ut[_0xc3f8('0x48')](_0xc3f8('0x49'),_0x2b0e33);})['catch'](function(_0x36c09a){ut[_0xc3f8('0x48')](_0xc3f8('0x4a'),_0x36c09a);});}else{ut[_0xc3f8('0x48')](_0xc3f8('0x4b'));}}Fax[_0xc3f8('0x24')][_0xc3f8('0x4c')]=function(_0x920f4b,_0x4fc02c,_0x51249a){var _0x30cec2=this;var _0x206a57={};if(_0x4fc02c){_0x206a57={'read':_0x4fc02c};}else{_0x206a57={'failMessage':_0x51249a};}if(this['actions'][_0x920f4b]['AttachmentId']){faxMessage[_0xc3f8('0x45')](this['actions'][_0x920f4b][_0xc3f8('0x46')],_0x206a57)[_0xc3f8('0x3a')](function(_0x1d95f5){ut['logger'](_0xc3f8('0x4d'),_0x1d95f5);})['catch'](function(_0x4d8436){ut[_0xc3f8('0x48')]('[Fax][Message][NoUpdate1]',_0x4d8436);})[_0xc3f8('0x4e')](function(){delete _0x30cec2[_0xc3f8('0xa')][_0x920f4b];delete _0x30cec2[_0xc3f8('0xd')][_0x920f4b];});}else{ut['logger'](_0xc3f8('0x4f'));delete this[_0xc3f8('0xa')][_0x920f4b];delete this[_0xc3f8('0xd')][_0x920f4b];}};Fax[_0xc3f8('0x24')][_0xc3f8('0x1a')]=function(_0x4e9e22){var _0x5ced29=this;if(this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]]){if(this[_0xc3f8('0xd')][_0x4e9e22[_0xc3f8('0x1f')]]){this[_0xc3f8('0xa')][_0x4e9e22['uniqueid']]['id']=this[_0xc3f8('0xd')][_0x4e9e22['uniqueid']]['id'];this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]][_0xc3f8('0x21')]=this[_0xc3f8('0xd')][_0x4e9e22['uniqueid']][_0xc3f8('0x21')];}logger['info'](_0x4e9e22['uniqueid'],this['actions'][_0x4e9e22['uniqueid']]?_0xc3f8('0x50'):_0xc3f8('0x51'),JSON[_0xc3f8('0x3f')](this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]]));if(this[_0xc3f8('0xd')][_0x4e9e22[_0xc3f8('0x1f')]]){if(this[_0xc3f8('0xa')][_0x4e9e22['uniqueid']][_0xc3f8('0x52')]>0x0&&this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]][_0xc3f8('0x15')]===_0xc3f8('0x53')){this['updateStatus'](_0x4e9e22[_0xc3f8('0x1f')],!![]);}else{this[_0xc3f8('0x4c')](_0x4e9e22[_0xc3f8('0x1f')],![],this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]]['faxstatusstring']?_0xc3f8('0x54')+this[_0xc3f8('0xa')][_0x4e9e22[_0xc3f8('0x1f')]][_0xc3f8('0x55')]:_0xc3f8('0x56'));}}}};Fax[_0xc3f8('0x24')]['send']=function(_0x2f199d){var _0x4ca426=this;return new BPromise(function(_0x9c7956,_0x5e3f96){_0x4ca426[_0xc3f8('0x57')](_0x2f199d,_0x4ca426[_0xc3f8('0xb')][_0x2f199d['FaxAccountId']])['then'](function(_0xbe23b2){ut[_0xc3f8('0x48')]('[Fax][execOriginate][success]',_0xbe23b2);_0x9c7956(ut[_0xc3f8('0x36')](_0xc3f8('0x58')));})[_0xc3f8('0x3d')](function(_0x44e105){ut[_0xc3f8('0x48')](_0xc3f8('0x59'),_0x44e105);updateStatus(_0x2f199d);_0x5e3f96(ut[_0xc3f8('0x36')](_0xc3f8('0x5a')));});});};Fax['prototype']['checkAfterSend']=function(_0x228920){var _0x5cd8b4=this;return new BPromise(function(_0x4a1cf5,_0x4a8a41){var _0x504f01=_0x5cd8b4['checkTrunk'](_0x5cd8b4[_0xc3f8('0xb')][_0x228920[_0xc3f8('0x5b')]][_0xc3f8('0x5c')],_0x228920);if(_0x504f01[_0xc3f8('0x5d')]){_0x4a1cf5(ut['message'](_0xc3f8('0x5e')));}else{_0x4a8a41(ut[_0xc3f8('0x36')](_0x504f01['message']));}});};function originate(_0x3b9b47,_0x273faf,_0x104eec){return new BPromise(function(_0x531de8,_0xaedf89){if(_0x104eec){var _0x5e3125=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xc3f8('0x37')](_0x3b9b47[_0xc3f8('0x3')])['name'],_0x3b9b47[_0xc3f8('0x3')]);gs[_0xc3f8('0x5f')](_0x5e3125)['then'](function(){_0x3b9b47[_0xc3f8('0x3')]=util[_0xc3f8('0x60')]('%s/%s.tif',path[_0xc3f8('0x37')](_0x3b9b47['path'])[_0xc3f8('0x61')],path[_0xc3f8('0x37')](_0x3b9b47['path'])['name']);_0x273faf[_0xc3f8('0x62')]=_0x3b9b47[_0xc3f8('0x3')];ut['logger'](_0xc3f8('0x63'),'');ami['Action'](ut[_0xc3f8('0x64')](_0x3b9b47,_0x273faf))['then'](function(_0x280e74){_0x531de8(_0x280e74);})[_0xc3f8('0x3d')](function(_0x2795d4){_0xaedf89(_0x2795d4);});})[_0xc3f8('0x3d')](function(_0x3042b3){_0xaedf89(_0x3042b3);});}else{ami[_0xc3f8('0x65')](ut[_0xc3f8('0x64')](_0x3b9b47,_0x273faf))[_0xc3f8('0x3a')](function(_0x3f0083){_0x531de8(_0x3f0083);})['catch'](function(_0x2bf08b){_0xaedf89(_0x2bf08b);});}});}Fax[_0xc3f8('0x24')][_0xc3f8('0x57')]=function(_0x26b994,_0x3c321d){var _0x5e3c9d=this;return new BPromise(function(_0x5c4115,_0x2609ff){var _0x1d3212=uuid['v4']();var _0x1e8685=ut[_0xc3f8('0x66')](_0x26b994,_0x3c321d);_0x5e3c9d['actions'][_0x1d3212]=new Action(_0x1d3212,_0x3c321d,_0x26b994);var _0x2f69f7=_0x5e3c9d[_0xc3f8('0xd')][_0x1d3212];if(path[_0xc3f8('0x37')](_0x26b994['path'])['ext']===_0xc3f8('0x38')){originate(_0x2f69f7,_0x1e8685,!![])[_0xc3f8('0x3a')](function(_0x1a9c33){_0x5c4115(_0x1a9c33);})[_0xc3f8('0x3d')](function(_0x4b9b3b){_0x2609ff(_0x4b9b3b);});}else{originate(_0x2f69f7,_0x1e8685,![])[_0xc3f8('0x3a')](function(_0x2a5711){_0x5c4115(_0x2a5711);})[_0xc3f8('0x3d')](function(_0x5f1fbb){_0x2609ff(_0x5f1fbb);});}});};Fax[_0xc3f8('0x24')][_0xc3f8('0x67')]=function(_0x4bb10a){return!_['isNil'](_0x4bb10a)&&!_[_0xc3f8('0x68')](_0x4bb10a[_0xc3f8('0x21')])&&!_['isNil'](_0x4bb10a[_0xc3f8('0x69')])&&_0x4bb10a[_0xc3f8('0x69')]&&!_['isNil'](this[_0xc3f8('0xc')][util['format'](_0xc3f8('0x6a'),_0x4bb10a['name'])])&&!_[_0xc3f8('0x68')](this[_0xc3f8('0xc')][util[_0xc3f8('0x60')](_0xc3f8('0x6a'),_0x4bb10a[_0xc3f8('0x21')])][_0xc3f8('0x2c')])&&(this[_0xc3f8('0xc')][util[_0xc3f8('0x60')](_0xc3f8('0x6a'),_0x4bb10a['name'])]['status']===_0xc3f8('0x6b')||this['trunks'][util[_0xc3f8('0x60')](_0xc3f8('0x6a'),_0x4bb10a[_0xc3f8('0x21')])][_0xc3f8('0x2c')]==='unmonitored');};Fax[_0xc3f8('0x24')][_0xc3f8('0x6c')]=function(_0x18f9f4,_0xb33986){if(!this[_0xc3f8('0x67')](_0x18f9f4)){ut[_0xc3f8('0x48')](_0xc3f8('0x6d'),_[_0xc3f8('0x68')](_0x18f9f4)?'':_0x18f9f4[_0xc3f8('0x21')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xc3f8('0x68')](_0xb33986[_0xc3f8('0x3c')])){ut[_0xc3f8('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xc3f8('0x3f')](_0xb33986));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xc3f8('0x68')](_0xb33986['path'])){ut[_0xc3f8('0x48')](_0xc3f8('0x6e'),JSON[_0xc3f8('0x3f')](_0xb33986));return{'isValid':![],'message':_0xc3f8('0x6f')};}return{'isValid':!![],'message':_0xc3f8('0x70')};};module[_0xc3f8('0x71')]=Fax; \ No newline at end of file +var _0x3423=['name','info','\x20syncNewchannel\x20','actions','variable','value','prototype','channelstate','channelstatedesc','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','error','\x20notify\x20','catch','\x20receiveFax\x20','pick','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','stringify','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','varset','syncVarSet','newstate','bind','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel'];(function(_0x159f95,_0x288e9c){var _0x44536f=function(_0x101423){while(--_0x101423){_0x159f95['push'](_0x159f95['shift']());}};_0x44536f(++_0x288e9c);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x3342('0x0'));var uuid=require(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var path=require(_0x3342('0x3'));var tiff2pdf=require(_0x3342('0x4'));var gs=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var ami=require(_0x3342('0x8'));var rpcDb=require(_0x3342('0x9'));var Channel=require(_0x3342('0xa'));var ut=require(_0x3342('0xb'));var Action=require(_0x3342('0xc'));var faxAccount=require(_0x3342('0xd'));var attachment=require(_0x3342('0xe'));var faxMessage=require(_0x3342('0xf'));function Fax(_0x305d13){this[_0x3342('0x10')]={};this[_0x3342('0x11')]=_0x305d13['faxAccounts'];this['trunks']=_0x305d13[_0x3342('0x12')];this['actions']={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on'](_0x3342('0x13'),this[_0x3342('0x14')]['bind'](this));ami['on'](_0x3342('0x15'),this['syncNewState'][_0x3342('0x16')](this));ami['on'](_0x3342('0x17'),this['syncNewExten'][_0x3342('0x16')](this));ami['on'](_0x3342('0x18'),this[_0x3342('0x19')][_0x3342('0x16')](this));ami['on'](_0x3342('0x1a'),this[_0x3342('0x1b')][_0x3342('0x16')](this));ami['on']('hangup',this[_0x3342('0x1c')][_0x3342('0x16')](this));ami['on']('originateresponse',this[_0x3342('0x1d')][_0x3342('0x16')](this));}Fax['prototype']['syncNewchannel']=function(_0xdbbb6c){if(_0xdbbb6c[_0x3342('0x1e')]===_0x3342('0x1f')){for(var _0x2075cb in this[_0x3342('0x11')]){if(this[_0x3342('0x11')][_0x3342('0x20')](_0x2075cb)){if(_0xdbbb6c[_0x3342('0x21')]===this[_0x3342('0x11')][_0x2075cb]['localstationid']){this[_0x3342('0x10')][_0xdbbb6c[_0x3342('0x22')]]={};this[_0x3342('0x10')][_0xdbbb6c['uniqueid']][_0x3342('0x23')]=_0xdbbb6c[_0x3342('0x23')];this['channels'][_0xdbbb6c[_0x3342('0x22')]]['id']=this[_0x3342('0x11')][_0x2075cb]['id'];this['channels'][_0xdbbb6c[_0x3342('0x22')]]['name']=this[_0x3342('0x11')][_0x2075cb][_0x3342('0x24')];logger[_0x3342('0x25')](_0xdbbb6c[_0x3342('0x22')],_0x3342('0x26'));}}}}if(this[_0x3342('0x27')][_0xdbbb6c[_0x3342('0x22')]]){this[_0x3342('0x10')][_0xdbbb6c['uniqueid']]={};this[_0x3342('0x10')][_0xdbbb6c['uniqueid']]['channel']=_0xdbbb6c[_0x3342('0x23')];logger['info'](_0xdbbb6c['uniqueid'],_0x3342('0x26'));}};Fax['prototype'][_0x3342('0x14')]=function(_0x543ec3){if(this['channels'][_0x543ec3['uniqueid']]){for(var _0x1497d9 in _0x543ec3[_0x3342('0x28')]){if(_0x543ec3[_0x3342('0x28')]['hasOwnProperty'](_0x1497d9)){this[_0x3342('0x10')][_0x543ec3[_0x3342('0x22')]][_0x1497d9]=_0x543ec3[_0x3342('0x29')];}}}};Fax[_0x3342('0x2a')]['syncNewState']=function(_0x27e25b){if(this[_0x3342('0x10')][_0x27e25b[_0x3342('0x22')]]){this[_0x3342('0x10')][_0x27e25b[_0x3342('0x22')]][_0x3342('0x2b')]=_0x27e25b[_0x3342('0x2b')];this['channels'][_0x27e25b[_0x3342('0x22')]]['channelstatedesc']=_0x27e25b[_0x3342('0x2c')];}};Fax[_0x3342('0x2a')]['syncNewExten']=function(_0x250396){if(this[_0x3342('0x10')][_0x250396[_0x3342('0x22')]]){for(var _0x4e7410 in _0x250396['variable']){if(_0x250396[_0x3342('0x28')][_0x3342('0x20')](_0x4e7410)){this[_0x3342('0x10')][_0x250396[_0x3342('0x22')]][_0x4e7410]=_0x250396[_0x3342('0x29')];}}}};Fax[_0x3342('0x2a')][_0x3342('0x19')]=function(_0x78c868){if(this[_0x3342('0x10')][_0x78c868[_0x3342('0x22')]]){this[_0x3342('0x10')][_0x78c868[_0x3342('0x22')]]['operation']=_0x78c868['operation'];this[_0x3342('0x10')][_0x78c868['uniqueid']][_0x3342('0x2d')]=_0x78c868[_0x3342('0x2d')];this[_0x3342('0x10')][_0x78c868[_0x3342('0x22')]][_0x3342('0x2e')]=_0x78c868[_0x3342('0x2e')];this[_0x3342('0x10')][_0x78c868['uniqueid']][_0x3342('0x2f')]=_0x78c868[_0x3342('0x2f')];logger[_0x3342('0x25')](_0x78c868[_0x3342('0x22')],_0x3342('0x30'));}};Fax['prototype'][_0x3342('0x1b')]=function(_0x4d1a59){var _0x22ca76=this;if(this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]]){var _0x2e57a0=this['channels'][_0x4d1a59[_0x3342('0x22')]]['id'];this['channels'][_0x4d1a59[_0x3342('0x22')]][_0x3342('0x31')]=_0x4d1a59[_0x3342('0x31')];this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]][_0x3342('0x32')]=_0x4d1a59[_0x3342('0x32')];this['channels'][_0x4d1a59[_0x3342('0x22')]][_0x3342('0x2e')]=_0x4d1a59['localstationid'];this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]]['resolution']=_0x4d1a59[_0x3342('0x33')];this[_0x3342('0x10')][_0x4d1a59['uniqueid']]['transferrate']=_0x4d1a59['transferrate'];this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]]['filename']=_0x4d1a59[_0x3342('0x2f')];this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]][_0x3342('0x34')]=_0x4d1a59[_0x3342('0x34')];if(this[_0x3342('0x10')][_0x4d1a59[_0x3342('0x22')]][_0x3342('0x32')]>0x0){tiff2pdf(_0x4d1a59['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x472ed2){logger[_0x3342('0x25')](_0x4d1a59[_0x3342('0x22')],_0x3342('0x35'),_0x472ed2[_0x3342('0x36')]);attachment[_0x3342('0x37')]({'name':path['parse'](_0x4d1a59[_0x3342('0x2f')])[_0x3342('0x24')],'basename':path[_0x3342('0x38')](_0x4d1a59[_0x3342('0x2f')])[_0x3342('0x24')]+_0x3342('0x39'),'type':'application/pdf'})[_0x3342('0x3a')](function(_0x4b267c){faxAccount[_0x3342('0x3b')](_0x2e57a0,{'from':_0x4d1a59[_0x3342('0x34')],'mapKey':_0x3342('0x7'),'body':path[_0x3342('0x38')](_0x4d1a59['filename'])[_0x3342('0x24')]+_0x3342('0x39'),'AttachmentId':_0x4b267c['id']})['catch'](function(_0x1f54a8){logger[_0x3342('0x3c')](_0x4d1a59[_0x3342('0x22')],_0x3342('0x3d'),JSON['stringify'](_0x1f54a8));});})[_0x3342('0x3e')](function(_0x2453a9){logger['error'](_0x4d1a59[_0x3342('0x22')],'\x20receiveFax\x20',JSON['stringify'](_0x2453a9));});});}logger[_0x3342('0x25')](_0x4d1a59[_0x3342('0x22')],_0x3342('0x3f'));}};Fax[_0x3342('0x2a')][_0x3342('0x1d')]=function(_0x171387){if(this[_0x3342('0x27')][_0x171387['uniqueid']]){_['merge'](this[_0x3342('0x10')][_0x171387['uniqueid']],_[_0x3342('0x40')](_0x171387,['response','reason']));}};function updateStatus(_0x494d60){if(_0x494d60[_0x3342('0x41')]){faxMessage[_0x3342('0x42')](_0x494d60[_0x3342('0x41')],{'failMessage':_0x3342('0x43')})['then'](function(_0x3eff37){ut[_0x3342('0x44')]('[Fax][Message][Error][Updated]',_0x3eff37);})[_0x3342('0x3e')](function(_0x24d543){ut[_0x3342('0x44')]('[Fax][Message][Error][NoUpdate1]',_0x24d543);});}else{ut[_0x3342('0x44')](_0x3342('0x45'));}}Fax[_0x3342('0x2a')][_0x3342('0x46')]=function(_0x250e6a,_0x4c7f5a,_0x2699d2){var _0x1d5001=this;var _0x23f24d={};if(_0x4c7f5a){_0x23f24d={'read':_0x4c7f5a};}else{_0x23f24d={'failMessage':_0x2699d2};}if(this[_0x3342('0x27')][_0x250e6a][_0x3342('0x41')]){faxMessage[_0x3342('0x42')](this[_0x3342('0x27')][_0x250e6a][_0x3342('0x41')],_0x23f24d)[_0x3342('0x3a')](function(_0x542181){ut[_0x3342('0x44')]('[Fax][Message][Updated]',_0x542181);})[_0x3342('0x3e')](function(_0x524fb6){ut['logger']('[Fax][Message][NoUpdate1]',_0x524fb6);})['finally'](function(){delete _0x1d5001[_0x3342('0x10')][_0x250e6a];delete _0x1d5001[_0x3342('0x27')][_0x250e6a];});}else{ut[_0x3342('0x44')](_0x3342('0x47'));delete this[_0x3342('0x10')][_0x250e6a];delete this[_0x3342('0x27')][_0x250e6a];}};Fax[_0x3342('0x2a')][_0x3342('0x1c')]=function(_0x2938e0){var _0x394418=this;if(this[_0x3342('0x10')][_0x2938e0['uniqueid']]){if(this['actions'][_0x2938e0[_0x3342('0x22')]]){this['channels'][_0x2938e0[_0x3342('0x22')]]['id']=this['actions'][_0x2938e0['uniqueid']]['id'];this[_0x3342('0x10')][_0x2938e0[_0x3342('0x22')]][_0x3342('0x24')]=this['actions'][_0x2938e0['uniqueid']][_0x3342('0x24')];}logger[_0x3342('0x25')](_0x2938e0['uniqueid'],this[_0x3342('0x27')][_0x2938e0[_0x3342('0x22')]]?_0x3342('0x48'):'\x20hangup\x20faxRiceive\x20',JSON[_0x3342('0x49')](this[_0x3342('0x10')][_0x2938e0[_0x3342('0x22')]]));if(this[_0x3342('0x27')][_0x2938e0[_0x3342('0x22')]]){if(this[_0x3342('0x10')][_0x2938e0[_0x3342('0x22')]]['faxpages']>0x0&&this['channels'][_0x2938e0[_0x3342('0x22')]]['faxstatus']===_0x3342('0x4a')){this[_0x3342('0x46')](_0x2938e0[_0x3342('0x22')],!![]);}else{this[_0x3342('0x46')](_0x2938e0[_0x3342('0x22')],![],this['channels'][_0x2938e0[_0x3342('0x22')]][_0x3342('0x4b')]?'SENDING\x20FAILED:\x20'+this[_0x3342('0x10')][_0x2938e0[_0x3342('0x22')]][_0x3342('0x4b')]:_0x3342('0x4c'));}}}};Fax[_0x3342('0x2a')][_0x3342('0x4d')]=function(_0x19fcc5){var _0x2f6a48=this;return new BPromise(function(_0x16c3f3,_0x36eec8){_0x2f6a48[_0x3342('0x4e')](_0x19fcc5,_0x2f6a48[_0x3342('0x11')][_0x19fcc5[_0x3342('0x4f')]])['then'](function(_0x5c9399){ut[_0x3342('0x44')](_0x3342('0x50'),_0x5c9399);_0x16c3f3(ut[_0x3342('0x36')](_0x3342('0x51')));})['catch'](function(_0x5d6e61){ut[_0x3342('0x44')](_0x3342('0x52'),_0x5d6e61);updateStatus(_0x19fcc5);_0x36eec8(ut[_0x3342('0x36')](_0x3342('0x53')));});});};Fax[_0x3342('0x2a')][_0x3342('0x54')]=function(_0x6032a0){var _0x403ccd=this;return new BPromise(function(_0x13fdbc,_0x385d9c){var _0x4887d4=_0x403ccd[_0x3342('0x55')](_0x403ccd['faxAccounts'][_0x6032a0[_0x3342('0x4f')]][_0x3342('0x56')],_0x6032a0);if(_0x4887d4['isValid']){_0x13fdbc(ut[_0x3342('0x36')](_0x3342('0x57')));}else{_0x385d9c(ut['message'](_0x4887d4[_0x3342('0x36')]));}});};function originate(_0x3624be,_0x1e3353,_0x466e06){return new BPromise(function(_0x6b9502,_0x42bc3b){if(_0x466e06){var _0x28d937=util['format'](_0x3342('0x58'),path['parse'](_0x3624be['path'])[_0x3342('0x24')],_0x3624be[_0x3342('0x3')]);gs[_0x3342('0x59')](_0x28d937)[_0x3342('0x3a')](function(){_0x3624be[_0x3342('0x3')]=util[_0x3342('0x5a')](_0x3342('0x5b'),path[_0x3342('0x38')](_0x3624be['path'])[_0x3342('0x5c')],path[_0x3342('0x38')](_0x3624be[_0x3342('0x3')])[_0x3342('0x24')]);_0x1e3353[_0x3342('0x5d')]=_0x3624be[_0x3342('0x3')];ut[_0x3342('0x44')]('Convert\x20pdf\x20to\x20tif','');ami[_0x3342('0x5e')](ut[_0x3342('0x5f')](_0x3624be,_0x1e3353))[_0x3342('0x3a')](function(_0x20203b){_0x6b9502(_0x20203b);})[_0x3342('0x3e')](function(_0x30e493){_0x42bc3b(_0x30e493);});})['catch'](function(_0x59ac64){_0x42bc3b(_0x59ac64);});}else{ami['Action'](ut[_0x3342('0x5f')](_0x3624be,_0x1e3353))[_0x3342('0x3a')](function(_0x15be66){_0x6b9502(_0x15be66);})[_0x3342('0x3e')](function(_0x339da1){_0x42bc3b(_0x339da1);});}});}Fax[_0x3342('0x2a')][_0x3342('0x4e')]=function(_0x14f528,_0x4b47ab){var _0x9763d5=this;return new BPromise(function(_0x1b24d2,_0x2967d6){var _0x42782f=uuid['v4']();var _0x5f4f56=ut[_0x3342('0x60')](_0x14f528,_0x4b47ab);_0x9763d5[_0x3342('0x27')][_0x42782f]=new Action(_0x42782f,_0x4b47ab,_0x14f528);var _0x3cbe12=_0x9763d5[_0x3342('0x27')][_0x42782f];if(path[_0x3342('0x38')](_0x14f528[_0x3342('0x3')])[_0x3342('0x61')]===_0x3342('0x39')){originate(_0x3cbe12,_0x5f4f56,!![])[_0x3342('0x3a')](function(_0x5e85e5){_0x1b24d2(_0x5e85e5);})[_0x3342('0x3e')](function(_0x1862b8){_0x2967d6(_0x1862b8);});}else{originate(_0x3cbe12,_0x5f4f56,![])['then'](function(_0x58405){_0x1b24d2(_0x58405);})['catch'](function(_0x123fd4){_0x2967d6(_0x123fd4);});}});};Fax['prototype'][_0x3342('0x62')]=function(_0x5b2f46){return!_[_0x3342('0x63')](_0x5b2f46)&&!_[_0x3342('0x63')](_0x5b2f46['name'])&&!_[_0x3342('0x63')](_0x5b2f46[_0x3342('0x64')])&&_0x5b2f46['active']&&!_[_0x3342('0x63')](this[_0x3342('0x12')][util[_0x3342('0x5a')](_0x3342('0x65'),_0x5b2f46[_0x3342('0x24')])])&&!_[_0x3342('0x63')](this['trunks'][util[_0x3342('0x5a')](_0x3342('0x65'),_0x5b2f46[_0x3342('0x24')])][_0x3342('0x2d')])&&(this[_0x3342('0x12')][util[_0x3342('0x5a')](_0x3342('0x65'),_0x5b2f46[_0x3342('0x24')])][_0x3342('0x2d')]===_0x3342('0x66')||this['trunks'][util[_0x3342('0x5a')](_0x3342('0x65'),_0x5b2f46[_0x3342('0x24')])]['status']==='unmonitored');};Fax[_0x3342('0x2a')]['checkTrunk']=function(_0x59088e,_0x2a19db){if(!this[_0x3342('0x62')](_0x59088e)){ut['logger'](_0x3342('0x67'),_['isNil'](_0x59088e)?'':_0x59088e[_0x3342('0x24')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x3342('0x63')](_0x2a19db[_0x3342('0x7')])){ut[_0x3342('0x44')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2a19db));return{'isValid':![],'message':_0x3342('0x68')};}if(_['isNil'](_0x2a19db[_0x3342('0x3')])){ut[_0x3342('0x44')](_0x3342('0x69'),JSON[_0x3342('0x49')](_0x2a19db));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x3342('0x6a')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5818f47..7cc7bb0 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 _0x1438=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','catch'];(function(_0x4f59a9,_0x5d3392){var _0x1faad8=function(_0x57db09){while(--_0x57db09){_0x4f59a9['push'](_0x4f59a9['shift']());}};_0x1faad8(++_0x5d3392);}(_0x1438,0x6f));var _0x8143=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1438[_0x5d2803];return _0xdcad2c;};'use strict';var util=require(_0x8143('0x0'));var BPromise=require(_0x8143('0x1'));var logger=require(_0x8143('0x2'))(_0x8143('0x3'));var _=require(_0x8143('0x4'));var faxAccount=require(_0x8143('0x5'));function loggerCatch(_0x2d9e1b){return function(_0x565d76){logger[_0x8143('0x6')](_0x2d9e1b,util[_0x8143('0x7')](_0x565d76,{'showHidden':![],'depth':null}));};}exports[_0x8143('0x8')]=function(_0x3b5df0,_0x46c60c){return BPromise['resolve']()['then'](faxAccount['notify'](_0x3b5df0,_0x46c60c))[_0x8143('0x9')](loggerCatch(_0x8143('0xa')));}; \ No newline at end of file +var _0x3c4d=['[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','resolve','then','notify','catch'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x3c4d,0x109));var _0xd3c4=function(_0x4a8c82,_0x1ab980){_0x4a8c82=_0x4a8c82-0x0;var _0x525661=_0x3c4d[_0x4a8c82];return _0x525661;};'use strict';var util=require(_0xd3c4('0x0'));var BPromise=require(_0xd3c4('0x1'));var logger=require('../../../config/logger')(_0xd3c4('0x2'));var _=require(_0xd3c4('0x3'));var faxAccount=require(_0xd3c4('0x4'));function loggerCatch(_0x4e09bb){return function(_0x5848c9){logger[_0xd3c4('0x5')](_0x4e09bb,util[_0xd3c4('0x6')](_0x5848c9,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1fdd84,_0x37321a){return BPromise[_0xd3c4('0x7')]()[_0xd3c4('0x8')](faxAccount[_0xd3c4('0x9')](_0x1fdd84,_0x37321a))[_0xd3c4('0xa')](loggerCatch(_0xd3c4('0xb')));}; \ 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 12e9e64..3a60b8c 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 _0x3c73=['\x20Error\x20:','util','../../../../config/logger','bluebird','exec','execute','info','Exec\x20gs'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0x3c73,0x1c9));var _0x33c7=function(_0x11af17,_0x428f0d){_0x11af17=_0x11af17-0x0;var _0x50f641=_0x3c73[_0x11af17];return _0x50f641;};'use strict';var util=require(_0x33c7('0x0'));var logger=require(_0x33c7('0x1'))('fax');var BPromise=require(_0x33c7('0x2'));var exec=require('child_process')[_0x33c7('0x3')];exports[_0x33c7('0x4')]=function(_0x3d0fa4){return new BPromise(function(_0x19ff54,_0xede71a){exec(_0x3d0fa4,function(_0x2bfa9e,_0xb112f5,_0x51ccd2){logger[_0x33c7('0x5')](_0x33c7('0x6'),_0xb112f5);if(_0x2bfa9e){logger[_0x33c7('0x5')](_0x33c7('0x6'),_0x33c7('0x7'),util['inspect'](_0x2bfa9e,{'showHidden':![],'depth':null}),_0xb112f5,_0x51ccd2);_0xede71a(_0x2bfa9e);}_0x19ff54(_0xb112f5);});});}; \ No newline at end of file +var _0x346b=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x389a11,_0x157863){var _0x540289=function(_0x2df0c1){while(--_0x2df0c1){_0x389a11['push'](_0x389a11['shift']());}};_0x540289(++_0x157863);}(_0x346b,0xef));var _0xb346=function(_0x48b53f,_0x4b4917){_0x48b53f=_0x48b53f-0x0;var _0x4c5ec2=_0x346b[_0x48b53f];return _0x4c5ec2;};'use strict';var util=require(_0xb346('0x0'));var logger=require(_0xb346('0x1'))(_0xb346('0x2'));var BPromise=require(_0xb346('0x3'));var exec=require('child_process')['exec'];exports[_0xb346('0x4')]=function(_0x44a591){return new BPromise(function(_0x3748bc,_0x114958){exec(_0x44a591,function(_0x540cb4,_0x3b88ab,_0xb4bf40){logger[_0xb346('0x5')](_0xb346('0x6'),_0x3b88ab);if(_0x540cb4){logger[_0xb346('0x5')](_0xb346('0x6'),_0xb346('0x7'),util[_0xb346('0x8')](_0x540cb4,{'showHidden':![],'depth':null}),_0x3b88ab,_0xb4bf40);_0x114958(_0x540cb4);}_0x3748bc(_0x3b88ab);});});}; \ 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 d127d48..6012073 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 _0x354a=['originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash','../../../../config/logger','fax','message','info','inspect','ecm','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction'];(function(_0x45a795,_0x41e642){var _0x2db592=function(_0x43dd36){while(--_0x43dd36){_0x45a795['push'](_0x45a795['shift']());}};_0x2db592(++_0x41e642);}(_0x354a,0xd6));var _0xa354=function(_0x5c110f,_0x3c4bd8){_0x5c110f=_0x5c110f-0x0;var _0x5ebfc5=_0x354a[_0x5c110f];return _0x5ebfc5;};'use strict';var util=require('util');var _=require(_0xa354('0x0'));var moment=require('moment');var logger=require(_0xa354('0x1'))(_0xa354('0x2'));exports[_0xa354('0x3')]=function(_0x18136e){return{'message':_0x18136e};};exports['logger']=function(_0x522622,_0x3c2664){logger[_0xa354('0x4')](_0x522622,util[_0xa354('0x5')](_0x3c2664,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2bfc3c,_0x3c10d8){var _0x4479c1={'XMF-ECM':_0x3c10d8[_0xa354('0x6')],'XMF-HEADERINFO':_0x3c10d8['headerinfo'],'XMF-MINRATE':_0x3c10d8[_0xa354('0x7')],'XMF-MAXRATE':_0x3c10d8[_0xa354('0x8')],'XMF-MODEM':util['format'](_0xa354('0x9'),_0x3c10d8[_0xa354('0xa')]),'XMF-GATEWAY':_0x3c10d8[_0xa354('0xb')],'XMF-FAXDETECT':_0x3c10d8[_0xa354('0xc')],'XMF-T38TIMEOUT':_0x3c10d8['t38timeout'],'XMF-LOCALSTATIONID':_0x3c10d8[_0xa354('0xd')],'XMF-PATH':_0x2bfc3c[_0xa354('0xe')]};return _0x4479c1;};exports[_0xa354('0xf')]=function(_0x22c990,_0xeeb9b9){return{'actionid':_0x22c990['uniqueid'],'action':_0xa354('0x10'),'channel':_0x22c990['channel'],'Exten':_0xa354('0x11'),'Context':_0xa354('0x12'),'Priority':'1','callerid':util[_0xa354('0x13')](_0xa354('0x14'),_0x22c990[_0xa354('0x15')]?_0x22c990[_0xa354('0x15')]:'',_0x22c990[_0xa354('0xd')]),'variable':_0xeeb9b9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x22c990[_0xa354('0x16')]};}; \ No newline at end of file +var _0x8755=['path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message','logger','info','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid'];(function(_0x315b6c,_0x2ac37f){var _0x94dc8=function(_0x24bb2e){while(--_0x24bb2e){_0x315b6c['push'](_0x315b6c['shift']());}};_0x94dc8(++_0x2ac37f);}(_0x8755,0xdf));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x5875('0x0'));var _=require(_0x5875('0x1'));var moment=require('moment');var logger=require(_0x5875('0x2'))(_0x5875('0x3'));exports[_0x5875('0x4')]=function(_0x5c6ae3){return{'message':_0x5c6ae3};};exports[_0x5875('0x5')]=function(_0x36b674,_0x34a752){logger[_0x5875('0x6')](_0x36b674,util['inspect'](_0x34a752,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x20895c,_0x43d62c){var _0x113e00={'XMF-ECM':_0x43d62c['ecm'],'XMF-HEADERINFO':_0x43d62c[_0x5875('0x7')],'XMF-MINRATE':_0x43d62c[_0x5875('0x8')],'XMF-MAXRATE':_0x43d62c[_0x5875('0x9')],'XMF-MODEM':util[_0x5875('0xa')](_0x5875('0xb'),_0x43d62c[_0x5875('0xc')]),'XMF-GATEWAY':_0x43d62c[_0x5875('0xd')],'XMF-FAXDETECT':_0x43d62c[_0x5875('0xe')],'XMF-T38TIMEOUT':_0x43d62c[_0x5875('0xf')],'XMF-LOCALSTATIONID':_0x43d62c[_0x5875('0x10')],'XMF-PATH':_0x20895c[_0x5875('0x11')]};return _0x113e00;};exports[_0x5875('0x12')]=function(_0x36a10a,_0x2342e0){return{'actionid':_0x36a10a[_0x5875('0x13')],'action':_0x5875('0x14'),'channel':_0x36a10a['channel'],'Exten':_0x5875('0x15'),'Context':_0x5875('0x16'),'Priority':'1','callerid':util[_0x5875('0xa')](_0x5875('0x17'),_0x36a10a['headerinfo']?_0x36a10a[_0x5875('0x7')]:'',_0x36a10a[_0x5875('0x10')]),'variable':_0x2342e0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x36a10a[_0x5875('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2164683..8113078 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 _0x90cf=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','then','getAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','catch','[index.js][main]','bluebird','util','./server','./realtime','./report','./trigger','./dialer','./preview'];(function(_0x53c944,_0x327afa){var _0x237bdf=function(_0x133563){while(--_0x133563){_0x53c944['push'](_0x53c944['shift']());}};_0x237bdf(++_0x327afa);}(_0x90cf,0xca));var _0xf90c=function(_0x415f6c,_0x43e569){_0x415f6c=_0x415f6c-0x0;var _0x9bd08=_0x90cf[_0x415f6c];return _0x9bd08;};'use strict';var BPromise=require(_0xf90c('0x0'));var util=require(_0xf90c('0x1'));var moment=require('moment');var server=require(_0xf90c('0x2'));var Realtime=require(_0xf90c('0x3'));var Report=require(_0xf90c('0x4'));var Acw=require('./acw');var Trigger=require(_0xf90c('0x5'));var Dialer=require(_0xf90c('0x6'));var Preview=require(_0xf90c('0x7'));var Fax=require(_0xf90c('0x8'));var user=require(_0xf90c('0x9'));var voiceQueue=require(_0xf90c('0xa'));var voiceQueueReport=require(_0xf90c('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xf90c('0xc'));var template=require(_0xf90c('0xd'));var cmHopperHistory=require(_0xf90c('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf90c('0xf'));var zendesk=require(_0xf90c('0x10'));var salesforce=require(_0xf90c('0x11'));var sugarcrm=require(_0xf90c('0x12'));var freshdesk=require(_0xf90c('0x13'));var desk=require(_0xf90c('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xf90c('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xf90c('0x16'));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(_0xf90c('0x17'))(_0xf90c('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xf90c('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf90c('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xf90c('0x1b')](user[_0xf90c('0x1c')]())[_0xf90c('0x1b')](realtime['initAgents']())[_0xf90c('0x1b')](user[_0xf90c('0x1d')]())[_0xf90c('0x1b')](realtime['initTelephones']())[_0xf90c('0x1b')](trunk[_0xf90c('0x1e')]())['then'](realtime[_0xf90c('0x1f')]())['then'](voiceQueue['getVoiceQueues']())[_0xf90c('0x1b')](realtime[_0xf90c('0x20')]())['then'](trigger['getTriggers']())[_0xf90c('0x1b')](realtime[_0xf90c('0x21')]())[_0xf90c('0x1b')](template[_0xf90c('0x22')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x23')]())[_0xf90c('0x1b')](zendesk[_0xf90c('0x24')]())[_0xf90c('0x1b')](realtime['initZendeskAccounts']())[_0xf90c('0x1b')](salesforce[_0xf90c('0x25')]())['then'](realtime[_0xf90c('0x26')]())['then'](sugarcrm[_0xf90c('0x27')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x28')]())[_0xf90c('0x1b')](freshdesk[_0xf90c('0x29')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x2a')]())[_0xf90c('0x1b')](desk['getDeskAccounts']())[_0xf90c('0x1b')](realtime[_0xf90c('0x2b')]())[_0xf90c('0x1b')](zoho[_0xf90c('0x2c')]())[_0xf90c('0x1b')](realtime['initZohoAccounts']())[_0xf90c('0x1b')](vtiger[_0xf90c('0x2d')]())['then'](realtime[_0xf90c('0x2e')]())[_0xf90c('0x1b')](freshsales[_0xf90c('0x2f')]())['then'](realtime[_0xf90c('0x30')]())[_0xf90c('0x1b')](servicenow['getServicenowAccounts']())['then'](realtime[_0xf90c('0x31')]())['then'](dynamics365[_0xf90c('0x32')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x33')]())[_0xf90c('0x1b')](campaign['getCampaigns']())[_0xf90c('0x1b')](realtime[_0xf90c('0x34')]())['then'](voiceExtension[_0xf90c('0x35')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x36')]())[_0xf90c('0x1b')](faxAccount['getFaxAccounts']())['then'](realtime[_0xf90c('0x37')]())[_0xf90c('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xf90c('0x1b')](voiceQueueReport[_0xf90c('0x38')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x39')]())[_0xf90c('0x1b')](cmHopperHistory[_0xf90c('0x3a')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x3b')]())[_0xf90c('0x1b')](cmHopperHistory[_0xf90c('0x3c')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x3d')]())[_0xf90c('0x1b')](voiceCallReport[_0xf90c('0x3e')]())[_0xf90c('0x1b')](realtime[_0xf90c('0x3f')]())['catch'](function(_0x4841f1){logger[_0xf90c('0x40')](_0xf90c('0x41'),util[_0xf90c('0x42')](_0x4841f1,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf90c('0x43')](realtime,preview,fax)[_0xf90c('0x1b')](function(_0x27cd9c){return initRealtime();})[_0xf90c('0x1b')](function(){return initParams();})[_0xf90c('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xf90c('0x44')](function(_0xa457e0){logger[_0xf90c('0x40')](_0xf90c('0x45'),util[_0xf90c('0x42')](_0xa457e0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x48da=['getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','resolve','then'];(function(_0x3e56d7,_0xa6b287){var _0x4e8640=function(_0x25891d){while(--_0x25891d){_0x3e56d7['push'](_0x3e56d7['shift']());}};_0x4e8640(++_0xa6b287);}(_0x48da,0x70));var _0xa48d=function(_0x16994a,_0x439145){_0x16994a=_0x16994a-0x0;var _0x5689fc=_0x48da[_0x16994a];return _0x5689fc;};'use strict';var BPromise=require(_0xa48d('0x0'));var util=require(_0xa48d('0x1'));var moment=require(_0xa48d('0x2'));var server=require(_0xa48d('0x3'));var Realtime=require(_0xa48d('0x4'));var Report=require(_0xa48d('0x5'));var Acw=require(_0xa48d('0x6'));var Trigger=require(_0xa48d('0x7'));var Dialer=require(_0xa48d('0x8'));var Preview=require(_0xa48d('0x9'));var Fax=require(_0xa48d('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0xa48d('0xb'));var voiceQueueReport=require(_0xa48d('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xa48d('0xd'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xa48d('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xa48d('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xa48d('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xa48d('0x11'));var freshdesk=require(_0xa48d('0x12'));var desk=require(_0xa48d('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xa48d('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xa48d('0x15'));var dynamics365=require(_0xa48d('0x16'));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(_0xa48d('0x17'))(_0xa48d('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa48d('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa48d('0x1a')]()[_0xa48d('0x1b')](user[_0xa48d('0x1c')]())['then'](realtime[_0xa48d('0x1d')]())['then'](user[_0xa48d('0x1e')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x1f')]())['then'](trunk[_0xa48d('0x20')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x21')]())['then'](voiceQueue['getVoiceQueues']())[_0xa48d('0x1b')](realtime['initVoiceQueues']())[_0xa48d('0x1b')](trigger['getTriggers']())[_0xa48d('0x1b')](realtime[_0xa48d('0x22')]())[_0xa48d('0x1b')](template['getTemplates']())['then'](realtime[_0xa48d('0x23')]())[_0xa48d('0x1b')](zendesk[_0xa48d('0x24')]())['then'](realtime['initZendeskAccounts']())[_0xa48d('0x1b')](salesforce[_0xa48d('0x25')]())['then'](realtime[_0xa48d('0x26')]())[_0xa48d('0x1b')](sugarcrm['getSugarcrmAccounts']())[_0xa48d('0x1b')](realtime[_0xa48d('0x27')]())[_0xa48d('0x1b')](freshdesk['getFreshdeskAccounts']())[_0xa48d('0x1b')](realtime[_0xa48d('0x28')]())[_0xa48d('0x1b')](desk[_0xa48d('0x29')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x2a')]())[_0xa48d('0x1b')](zoho[_0xa48d('0x2b')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x2c')]())[_0xa48d('0x1b')](vtiger[_0xa48d('0x2d')]())[_0xa48d('0x1b')](realtime['initVtigerAccounts']())[_0xa48d('0x1b')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xa48d('0x2e')]())[_0xa48d('0x1b')](servicenow[_0xa48d('0x2f')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0xa48d('0x1b')](realtime[_0xa48d('0x31')]())[_0xa48d('0x1b')](campaign[_0xa48d('0x32')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x33')]())[_0xa48d('0x1b')](voiceExtension[_0xa48d('0x34')]())['then'](realtime[_0xa48d('0x35')]())[_0xa48d('0x1b')](faxAccount[_0xa48d('0x36')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x37')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xa48d('0x1a')]()['then'](voiceQueueReport[_0xa48d('0x38')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x39')]())[_0xa48d('0x1b')](cmHopperHistory[_0xa48d('0x3a')]())[_0xa48d('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0xa48d('0x1b')](cmHopperHistory[_0xa48d('0x3b')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x3c')]())['then'](voiceCallReport[_0xa48d('0x3d')]())[_0xa48d('0x1b')](realtime[_0xa48d('0x3e')]())[_0xa48d('0x3f')](function(_0x259c0e){logger[_0xa48d('0x40')](_0xa48d('0x41'),util[_0xa48d('0x42')](_0x259c0e,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa48d('0x43')](realtime,preview,fax)['then'](function(_0x4e8d86){return initRealtime();})[_0xa48d('0x1b')](function(){return initParams();})['then'](function(){report[_0xa48d('0x44')]();setInterval(initRealtime,0x1388);})[_0xa48d('0x3f')](function(_0x42f1b0){logger[_0xa48d('0x40')](_0xa48d('0x45'),util[_0xa48d('0x42')](_0x42f1b0,{'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 51fbc8d..f9d4dcd 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x93f202,_0x5d01a6){var _0x3fe427=function(_0x5215d1){while(--_0x5215d1){_0x93f202['push'](_0x93f202['shift']());}};_0x3fe427(++_0x5d01a6);}(_0xe706,0xa3));var _0x6e70=function(_0x8ae836,_0x5735d7){_0x8ae836=_0x8ae836-0x0;var _0x2f9136=_0xe706[_0x8ae836];return _0x2f9136;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x5f3499,_0x3e2217){var _0x4733d8=function(_0x3fd2e3){while(--_0x3fd2e3){_0x5f3499['push'](_0x5f3499['shift']());}};_0x4733d8(++_0x3e2217);}(_0xe706,0xa3));var _0x6e70=function(_0x2c921c,_0x3c6a85){_0x2c921c=_0x2c921c-0x0;var _0x440bf2=_0xe706[_0x2c921c];return _0x440bf2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a6842cc..b4419e3 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 _0xb334=['type','ivrTotalCallsDays','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0xf2acc0,_0x33a85a){var _0x383a9f=function(_0x1651dd){while(--_0x1651dd){_0xf2acc0['push'](_0xf2acc0['shift']());}};_0x383a9f(++_0x33a85a);}(_0xb334,0xbb));var _0x4b33=function(_0xf172b1,_0x121ecd){_0xf172b1=_0xf172b1-0x0;var _0x4a6e4e=_0xb334[_0xf172b1];return _0x4a6e4e;};'use strict';function Campaign(_0x267594){this['id']=_0x267594['id']||0x0;this[_0x4b33('0x0')]=_0x267594[_0x4b33('0x0')]||'';this[_0x4b33('0x1')]=_0x267594[_0x4b33('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x4b33('0x2')]=0x0;this['message']='';this[_0x4b33('0x3')]=!![];this['active']=_0x267594['active'];this[_0x4b33('0x4')]=_0x267594[_0x4b33('0x4')];this['dialTimezone']=_0x267594[_0x4b33('0x5')]||null;this[_0x4b33('0x6')]=_0x267594['dialGlobalInterval']?_0x267594[_0x4b33('0x6')]:null;this[_0x4b33('0x7')]=_0x267594[_0x4b33('0x7')];this[_0x4b33('0x8')]=_0x267594[_0x4b33('0x8')];this[_0x4b33('0x9')]=_0x267594[_0x4b33('0x9')]||0x1e;this[_0x4b33('0xa')]=_0x267594[_0x4b33('0xa')];this[_0x4b33('0xb')]=_0x267594[_0x4b33('0xb')];this[_0x4b33('0xc')]=_0x267594[_0x4b33('0xc')];this[_0x4b33('0xd')]=_0x267594[_0x4b33('0xd')];this[_0x4b33('0xe')]=_0x267594['dialNoAnswerMaxRetry'];this[_0x4b33('0xf')]=_0x267594[_0x4b33('0xf')];this['dialGlobalMaxRetry']=_0x267594[_0x4b33('0x10')];this[_0x4b33('0x11')]=_0x267594[_0x4b33('0x11')]||0x3;this[_0x4b33('0x12')]=_0x267594['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x267594[_0x4b33('0x13')]||0x3;this[_0x4b33('0x14')]=_0x267594['dialDropRetryFrequency']||0x96;this[_0x4b33('0x15')]=_0x267594[_0x4b33('0x15')]||0x3;this[_0x4b33('0x16')]=_0x267594[_0x4b33('0x16')]||0x96;this[_0x4b33('0x17')]=_0x267594['dialMachineMaxRetry']||0x3;this[_0x4b33('0x18')]=_0x267594[_0x4b33('0x18')]||0x96;this['dialAgentRejectMaxRetry']=_0x267594[_0x4b33('0x19')]||0x3;this[_0x4b33('0x1a')]=_0x267594['dialAgentRejectRetryFrequency']||0x96;this[_0x4b33('0x1b')]=_0x267594[_0x4b33('0x1b')]||_0x4b33('0x1c');this[_0x4b33('0x1d')]=_0x267594['dialPrefix']||undefined;this[_0x4b33('0x1e')]=_0x267594[_0x4b33('0x1e')]||undefined;this[_0x4b33('0x1f')]=_0x267594['dialCutDigit']||undefined;this[_0x4b33('0x20')]=_0x267594['TrunkBackup']?_0x267594['TrunkBackup']:undefined;this[_0x4b33('0x21')]=_0x267594[_0x4b33('0x21')]?_0x267594[_0x4b33('0x21')]:undefined;this[_0x4b33('0x22')]=_0x267594[_0x4b33('0x22')]?_0x267594[_0x4b33('0x22')]:undefined;this['SquareProject']=_0x267594[_0x4b33('0x23')]?_0x267594[_0x4b33('0x23')]:undefined;this['dialQueueProject']=_0x267594[_0x4b33('0x23')]?_0x267594[_0x4b33('0x23')][_0x4b33('0x0')]:undefined;this[_0x4b33('0x24')]=_0x267594[_0x4b33('0x24')]||![];this[_0x4b33('0x25')]=_0x267594[_0x4b33('0x25')];this[_0x4b33('0x26')]=_0x267594[_0x4b33('0x26')];this['dialAMDAfterGreetingSilence']=_0x267594[_0x4b33('0x27')];this['dialAMDTotalAnalysisTime']=_0x267594[_0x4b33('0x28')];this[_0x4b33('0x29')]=_0x267594[_0x4b33('0x29')];this[_0x4b33('0x2a')]=_0x267594[_0x4b33('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x267594[_0x4b33('0x2b')];this[_0x4b33('0x2c')]=_0x267594[_0x4b33('0x2c')];this[_0x4b33('0x2d')]=_0x267594[_0x4b33('0x2d')];}module[_0x4b33('0x2e')]=Campaign; \ No newline at end of file +var _0x4322=['type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x5e6536,_0x33a7b9){var _0x4bb384=function(_0x300689){while(--_0x300689){_0x5e6536['push'](_0x5e6536['shift']());}};_0x4bb384(++_0x33a7b9);}(_0x4322,0x1a7));var _0x2432=function(_0x2a4710,_0x12b411){_0x2a4710=_0x2a4710-0x0;var _0x2e55bd=_0x4322[_0x2a4710];return _0x2e55bd;};'use strict';function Campaign(_0x48de88){this['id']=_0x48de88['id']||0x0;this[_0x2432('0x0')]=_0x48de88['name']||'';this[_0x2432('0x1')]=_0x48de88[_0x2432('0x1')]||_0x2432('0x2');this[_0x2432('0x3')]=0x0;this[_0x2432('0x4')]=0x0;this[_0x2432('0x5')]=0x0;this[_0x2432('0x6')]=0x0;this[_0x2432('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x2432('0x8')]=_0x48de88[_0x2432('0x8')];this[_0x2432('0x9')]=_0x48de88['limitCalls'];this['dialTimezone']=_0x48de88[_0x2432('0xa')]||null;this[_0x2432('0xb')]=_0x48de88[_0x2432('0xb')]?_0x48de88['dialGlobalInterval']:null;this[_0x2432('0xc')]=_0x48de88['dialOriginateCallerIdName'];this[_0x2432('0xd')]=_0x48de88[_0x2432('0xd')];this['dialOriginateTimeout']=_0x48de88[_0x2432('0xe')]||0x1e;this[_0x2432('0xf')]=_0x48de88[_0x2432('0xf')];this['dialCongestionRetryFrequency']=_0x48de88[_0x2432('0x10')];this[_0x2432('0x11')]=_0x48de88[_0x2432('0x11')];this[_0x2432('0x12')]=_0x48de88[_0x2432('0x12')];this[_0x2432('0x13')]=_0x48de88[_0x2432('0x13')];this[_0x2432('0x14')]=_0x48de88[_0x2432('0x14')];this[_0x2432('0x15')]=_0x48de88[_0x2432('0x15')];this['dialNoSuchNumberMaxRetry']=_0x48de88[_0x2432('0x16')]||0x3;this[_0x2432('0x17')]=_0x48de88[_0x2432('0x17')]||0x96;this[_0x2432('0x18')]=_0x48de88[_0x2432('0x18')]||0x3;this[_0x2432('0x19')]=_0x48de88[_0x2432('0x19')]||0x96;this[_0x2432('0x1a')]=_0x48de88[_0x2432('0x1a')]||0x3;this[_0x2432('0x1b')]=_0x48de88[_0x2432('0x1b')]||0x96;this[_0x2432('0x1c')]=_0x48de88[_0x2432('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x48de88[_0x2432('0x1d')]||0x96;this[_0x2432('0x1e')]=_0x48de88['dialAgentRejectMaxRetry']||0x3;this[_0x2432('0x1f')]=_0x48de88[_0x2432('0x1f')]||0x96;this[_0x2432('0x20')]=_0x48de88['dialOrderByScheduledAt']||_0x2432('0x21');this[_0x2432('0x22')]=_0x48de88[_0x2432('0x22')]||undefined;this[_0x2432('0x23')]=_0x48de88[_0x2432('0x23')]||undefined;this[_0x2432('0x24')]=_0x48de88[_0x2432('0x24')]||undefined;this[_0x2432('0x25')]=_0x48de88[_0x2432('0x25')]?_0x48de88['TrunkBackup']:undefined;this[_0x2432('0x26')]=_0x48de88[_0x2432('0x26')]?_0x48de88[_0x2432('0x26')]:undefined;this[_0x2432('0x27')]=_0x48de88[_0x2432('0x27')]?_0x48de88[_0x2432('0x27')]:undefined;this[_0x2432('0x28')]=_0x48de88[_0x2432('0x28')]?_0x48de88[_0x2432('0x28')]:undefined;this[_0x2432('0x29')]=_0x48de88[_0x2432('0x28')]?_0x48de88[_0x2432('0x28')]['name']:undefined;this[_0x2432('0x2a')]=_0x48de88['dialAMDActive']||![];this[_0x2432('0x2b')]=_0x48de88[_0x2432('0x2b')];this['dialAMDGreeting']=_0x48de88[_0x2432('0x2c')];this[_0x2432('0x2d')]=_0x48de88[_0x2432('0x2d')];this[_0x2432('0x2e')]=_0x48de88[_0x2432('0x2e')];this[_0x2432('0x2f')]=_0x48de88[_0x2432('0x2f')];this[_0x2432('0x30')]=_0x48de88[_0x2432('0x30')];this[_0x2432('0x31')]=_0x48de88[_0x2432('0x31')];this[_0x2432('0x32')]=_0x48de88[_0x2432('0x32')];this[_0x2432('0x33')]=_0x48de88[_0x2432('0x33')];}module[_0x2432('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 09e163f..0397e06 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 _0xeec6=['calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','exten','answered','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','transferType','starttime'];(function(_0x1aa660,_0x55cfcf){var _0x56b6f5=function(_0x54d875){while(--_0x54d875){_0x1aa660['push'](_0x1aa660['shift']());}};_0x56b6f5(++_0x55cfcf);}(_0xeec6,0x125));var _0x6eec=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xeec6[_0x4bb66f];return _0xf2772f;};'use strict';function Channel(){this[_0x6eec('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x6eec('0x1')]=0x0;this[_0x6eec('0x2')]='';this[_0x6eec('0x3')]=undefined;this[_0x6eec('0x4')]=undefined;this['accountcode']=0x0;this[_0x6eec('0x5')]='';this[_0x6eec('0x6')]=0x0;this['linkedid']=0x0;this[_0x6eec('0x7')]=0x0;this[_0x6eec('0x8')]=![];this['answertime']=null;this[_0x6eec('0x9')]=null;this[_0x6eec('0xa')]=![];this[_0x6eec('0xb')]=![];this[_0x6eec('0xc')]='';this['lastdata']='';this[_0x6eec('0xd')]=0x0;this[_0x6eec('0xe')]=0x0;this[_0x6eec('0xf')]=0x0;this['type']=null;this[_0x6eec('0x10')]=null;this['disposition']=null;this[_0x6eec('0x11')]=![];this[_0x6eec('0x12')]=null;this[_0x6eec('0x13')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x6eec('0x14')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x2d08=['destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','endtime','unmanaged','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','mohtime','starttime','channel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d08,0x129));var _0x82d0=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x2d08[_0x24487f];return _0x456456;};'use strict';function Channel(){this[_0x82d0('0x0')]=null;this[_0x82d0('0x1')]='';this[_0x82d0('0x2')]='';this[_0x82d0('0x3')]=0x0;this[_0x82d0('0x4')]='';this[_0x82d0('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x82d0('0x6')]=0x0;this[_0x82d0('0x7')]='';this['uniqueid']=0x0;this[_0x82d0('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this['answertime']=null;this[_0x82d0('0x9')]=null;this[_0x82d0('0xa')]=![];this['abandoned']=![];this['lastapplication']='';this[_0x82d0('0xb')]='';this[_0x82d0('0xc')]=0x0;this['billableseconds']=0x0;this[_0x82d0('0xd')]=0x0;this[_0x82d0('0xe')]=null;this[_0x82d0('0xf')]=null;this[_0x82d0('0x10')]=null;this[_0x82d0('0x11')]=![];this[_0x82d0('0x12')]=null;this[_0x82d0('0x13')]=null;this[_0x82d0('0x14')]=[];this[_0x82d0('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x82d0('0x16')]=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 20d043b..1f953ff 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 _0x713c=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','consumerKey'];(function(_0x21d1fe,_0x45eb48){var _0xef03c3=function(_0x11e9a2){while(--_0x11e9a2){_0x21d1fe['push'](_0x21d1fe['shift']());}};_0xef03c3(++_0x45eb48);}(_0x713c,0x8b));var _0xc713=function(_0xa8c29b,_0x1253bd){_0xa8c29b=_0xa8c29b-0x0;var _0x7caf1e=_0x713c[_0xa8c29b];return _0x7caf1e;};'use strict';function DeskAccount(_0x2fdbaf){this['id']=_0x2fdbaf['id']||0x0;this[_0xc713('0x0')]=_0x2fdbaf[_0xc713('0x0')]||'';this[_0xc713('0x1')]=_0x2fdbaf[_0xc713('0x1')]||'';this[_0xc713('0x2')]=_0x2fdbaf[_0xc713('0x2')]||'';this[_0xc713('0x3')]=_0x2fdbaf['authType']||'';this['password']=_0x2fdbaf['password']||'';this[_0xc713('0x4')]=_0x2fdbaf[_0xc713('0x4')]||'';this['consumerSecret']=_0x2fdbaf[_0xc713('0x5')]||'';this[_0xc713('0x6')]=_0x2fdbaf['token']||'';this[_0xc713('0x7')]=_0x2fdbaf[_0xc713('0x7')]||'';this[_0xc713('0x8')]=_0x2fdbaf[_0xc713('0x8')]||'';this[_0xc713('0x9')]=_0x2fdbaf[_0xc713('0x9')]||'';this[_0xc713('0xa')]=_0x2fdbaf['Configurations']||{};}module[_0xc713('0xb')]=DeskAccount; \ No newline at end of file +var _0xcf60=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x241c0d,_0x5cd0ee){var _0x26fbc9=function(_0x2f6693){while(--_0x2f6693){_0x241c0d['push'](_0x241c0d['shift']());}};_0x26fbc9(++_0x5cd0ee);}(_0xcf60,0xc4));var _0x0cf6=function(_0x4de8cf,_0x4bef0f){_0x4de8cf=_0x4de8cf-0x0;var _0x10ef8f=_0xcf60[_0x4de8cf];return _0x10ef8f;};'use strict';function DeskAccount(_0x4c3fba){this['id']=_0x4c3fba['id']||0x0;this[_0x0cf6('0x0')]=_0x4c3fba[_0x0cf6('0x0')]||'';this[_0x0cf6('0x1')]=_0x4c3fba[_0x0cf6('0x1')]||'';this[_0x0cf6('0x2')]=_0x4c3fba[_0x0cf6('0x2')]||'';this[_0x0cf6('0x3')]=_0x4c3fba[_0x0cf6('0x3')]||'';this['password']=_0x4c3fba[_0x0cf6('0x4')]||'';this[_0x0cf6('0x5')]=_0x4c3fba[_0x0cf6('0x5')]||'';this['consumerSecret']=_0x4c3fba[_0x0cf6('0x6')]||'';this[_0x0cf6('0x7')]=_0x4c3fba[_0x0cf6('0x7')]||'';this[_0x0cf6('0x8')]=_0x4c3fba[_0x0cf6('0x8')]||'';this[_0x0cf6('0x9')]=_0x4c3fba['type']||'';this['serverUrl']=_0x4c3fba[_0x0cf6('0xa')]||'';this[_0x0cf6('0xb')]=_0x4c3fba['Configurations']||{};}module[_0x0cf6('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 9385ad5..289a4f6 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 _0x6e6c=['clientSecret','serverUrl','Configurations','name','username','remoteUri','tenantId','clientId'];(function(_0x27a67e,_0x14027a){var _0x54c72d=function(_0x14e37c){while(--_0x14e37c){_0x27a67e['push'](_0x27a67e['shift']());}};_0x54c72d(++_0x14027a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';function Dynamics365Account(_0xc51915){this['id']=_0xc51915['id']||0x0;this[_0xc6e6('0x0')]=_0xc51915['name']||'';this[_0xc6e6('0x1')]=_0xc51915[_0xc6e6('0x1')]||'';this['password']=_0xc51915['password']||'';this[_0xc6e6('0x2')]=_0xc51915['remoteUri']||'';this[_0xc6e6('0x3')]=_0xc51915['tenantId']||'';this[_0xc6e6('0x4')]=_0xc51915[_0xc6e6('0x4')]||'';this['clientSecret']=_0xc51915[_0xc6e6('0x5')]||{};this[_0xc6e6('0x6')]=_0xc51915['serverUrl']||'';this[_0xc6e6('0x7')]=_0xc51915[_0xc6e6('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x153f=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x153f,0x15b));var _0xf153=function(_0x16166a,_0xd55498){_0x16166a=_0x16166a-0x0;var _0x697a61=_0x153f[_0x16166a];return _0x697a61;};'use strict';function Dynamics365Account(_0x2bbc4c){this['id']=_0x2bbc4c['id']||0x0;this[_0xf153('0x0')]=_0x2bbc4c[_0xf153('0x0')]||'';this[_0xf153('0x1')]=_0x2bbc4c[_0xf153('0x1')]||'';this[_0xf153('0x2')]=_0x2bbc4c[_0xf153('0x2')]||'';this['remoteUri']=_0x2bbc4c[_0xf153('0x3')]||'';this['tenantId']=_0x2bbc4c[_0xf153('0x4')]||'';this[_0xf153('0x5')]=_0x2bbc4c[_0xf153('0x5')]||'';this[_0xf153('0x6')]=_0x2bbc4c[_0xf153('0x6')]||{};this['serverUrl']=_0x2bbc4c[_0xf153('0x7')]||'';this[_0xf153('0x8')]=_0x2bbc4c[_0xf153('0x8')]||{};}module[_0xf153('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index aa574f7..28e4ee6 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 _0xd477=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0xd477,0xdf));var _0x7d47=function(_0x2a22eb,_0x3da482){_0x2a22eb=_0x2a22eb-0x0;var _0x427fec=_0xd477[_0x2a22eb];return _0x427fec;};'use strict';function FaxAccount(_0x4dfc41){this['id']=_0x4dfc41['id']||0x0;this[_0x7d47('0x0')]=_0x4dfc41[_0x7d47('0x0')]||'';this[_0x7d47('0x1')]=_0x4dfc41[_0x7d47('0x1')];this['ecm']=_0x4dfc41[_0x7d47('0x2')];this['headerinfo']=_0x4dfc41[_0x7d47('0x3')];this[_0x7d47('0x4')]=_0x4dfc41['localstationid'];this[_0x7d47('0x5')]=_0x4dfc41[_0x7d47('0x5')]||0x960;this[_0x7d47('0x6')]=_0x4dfc41[_0x7d47('0x6')]||0x3840;this[_0x7d47('0x7')]=_0x4dfc41[_0x7d47('0x7')]||_0x7d47('0x8');this['gateway']=_0x4dfc41[_0x7d47('0x9')]||'no';this['faxdetect']=_0x4dfc41['faxdetect']||'no';this[_0x7d47('0xa')]=_0x4dfc41[_0x7d47('0xa')]||0x1388;this[_0x7d47('0xb')]=_0x4dfc41[_0x7d47('0xb')]||'SIP';this[_0x7d47('0xc')]=_0x4dfc41[_0x7d47('0xc')]?_0x4dfc41[_0x7d47('0xc')]:undefined;this[_0x7d47('0xd')]=_0x4dfc41['ListId'];this[_0x7d47('0xe')]=_0x4dfc41[_0x7d47('0xe')];}module[_0x7d47('0xf')]=FaxAccount; \ No newline at end of file +var _0xeec6=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x4c11c0,_0x116fc8){var _0x419379=function(_0x101b71){while(--_0x101b71){_0x4c11c0['push'](_0x4c11c0['shift']());}};_0x419379(++_0x116fc8);}(_0xeec6,0x125));var _0x6eec=function(_0x309458,_0xba6e63){_0x309458=_0x309458-0x0;var _0x3306ee=_0xeec6[_0x309458];return _0x3306ee;};'use strict';function FaxAccount(_0xa57194){this['id']=_0xa57194['id']||0x0;this['name']=_0xa57194['name']||'';this[_0x6eec('0x0')]=_0xa57194[_0x6eec('0x0')];this[_0x6eec('0x1')]=_0xa57194[_0x6eec('0x1')];this['headerinfo']=_0xa57194[_0x6eec('0x2')];this[_0x6eec('0x3')]=_0xa57194['localstationid'];this[_0x6eec('0x4')]=_0xa57194[_0x6eec('0x4')]||0x960;this['maxrate']=_0xa57194[_0x6eec('0x5')]||0x3840;this[_0x6eec('0x6')]=_0xa57194[_0x6eec('0x6')]||_0x6eec('0x7');this['gateway']=_0xa57194[_0x6eec('0x8')]||'no';this[_0x6eec('0x9')]=_0xa57194[_0x6eec('0x9')]||'no';this['t38timeout']=_0xa57194[_0x6eec('0xa')]||0x1388;this['tech']=_0xa57194[_0x6eec('0xb')]||_0x6eec('0xc');this[_0x6eec('0xd')]=_0xa57194['Trunk']?_0xa57194['Trunk']:undefined;this['ListId']=_0xa57194[_0x6eec('0xe')];this['key']=_0xa57194['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b9be253..55b3cab 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 _0x42a4=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x3b2524,_0x21705f){var _0x3be2ff=function(_0x4b01da){while(--_0x4b01da){_0x3b2524['push'](_0x3b2524['shift']());}};_0x3be2ff(++_0x21705f);}(_0x42a4,0xe4));var _0x442a=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x42a4[_0x310504];return _0x5b36d0;};'use strict';function FreshdeskAccount(_0x4fd10c){this['id']=_0x4fd10c['id']||0x0;this['name']=_0x4fd10c[_0x442a('0x0')]||'';this[_0x442a('0x1')]=_0x4fd10c[_0x442a('0x1')]||'';this[_0x442a('0x2')]=_0x4fd10c[_0x442a('0x3')]||'';this['remoteUri']=_0x4fd10c[_0x442a('0x4')]||'';this[_0x442a('0x5')]=_0x4fd10c['serverUrl']||'';this[_0x442a('0x6')]=_0x4fd10c['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xae57=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x15876c,_0x5abaa5){var _0x53debd=function(_0x4a240b){while(--_0x4a240b){_0x15876c['push'](_0x15876c['shift']());}};_0x53debd(++_0x5abaa5);}(_0xae57,0x13f));var _0x7ae5=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xae57[_0x4fde08];return _0x12e725;};'use strict';function FreshdeskAccount(_0x3a05d4){this['id']=_0x3a05d4['id']||0x0;this['name']=_0x3a05d4[_0x7ae5('0x0')]||'';this[_0x7ae5('0x1')]=_0x3a05d4[_0x7ae5('0x1')]||'';this[_0x7ae5('0x2')]=_0x3a05d4['token']||'';this['remoteUri']=_0x3a05d4[_0x7ae5('0x3')]||'';this['serverUrl']=_0x3a05d4[_0x7ae5('0x4')]||'';this[_0x7ae5('0x5')]=_0x3a05d4[_0x7ae5('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1f8210a..09d9a37 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 _0xab29=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x1b83fc,_0x810a03){var _0x2cacec=function(_0x1527cd){while(--_0x1527cd){_0x1b83fc['push'](_0x1b83fc['shift']());}};_0x2cacec(++_0x810a03);}(_0xab29,0x145));var _0x9ab2=function(_0x4f6a47,_0x59fd60){_0x4f6a47=_0x4f6a47-0x0;var _0x1f8d33=_0xab29[_0x4f6a47];return _0x1f8d33;};'use strict';function FreshsalesAccount(_0x54d887){this['id']=_0x54d887['id']||0x0;this[_0x9ab2('0x0')]=_0x54d887[_0x9ab2('0x0')]||'';this[_0x9ab2('0x1')]=_0x54d887['username']||'';this[_0x9ab2('0x2')]=_0x54d887['token']||'';this[_0x9ab2('0x3')]=_0x54d887[_0x9ab2('0x3')]||'';this[_0x9ab2('0x4')]=_0x54d887[_0x9ab2('0x4')]||'';this[_0x9ab2('0x5')]=_0x54d887['Configurations']||{};}module[_0x9ab2('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x33ac=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x5aa418,_0x4f9d6e){var _0x4b515b=function(_0x38702f){while(--_0x38702f){_0x5aa418['push'](_0x5aa418['shift']());}};_0x4b515b(++_0x4f9d6e);}(_0x33ac,0x1f2));var _0xc33a=function(_0x51e928,_0x44b646){_0x51e928=_0x51e928-0x0;var _0x15f2ad=_0x33ac[_0x51e928];return _0x15f2ad;};'use strict';function FreshsalesAccount(_0x11e91c){this['id']=_0x11e91c['id']||0x0;this[_0xc33a('0x0')]=_0x11e91c['name']||'';this['username']=_0x11e91c[_0xc33a('0x1')]||'';this[_0xc33a('0x2')]=_0x11e91c[_0xc33a('0x3')]||'';this[_0xc33a('0x4')]=_0x11e91c[_0xc33a('0x4')]||'';this[_0xc33a('0x5')]=_0x11e91c[_0xc33a('0x5')]||'';this[_0xc33a('0x6')]=_0x11e91c[_0xc33a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a6bb676..b1292bc 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 _0xe003=['queuecallercomplete','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe003,0xe7));var _0x3e00=function(_0x5a68af,_0x17432c){_0x5a68af=_0x5a68af-0x0;var _0x5d7b61=_0xe003[_0x5a68af];return _0x5d7b61;};'use strict';function QueueReport(){this[_0x3e00('0x0')]=_0x3e00('0x1');this[_0x3e00('0x2')]='';this['calleridnum']='';this[_0x3e00('0x3')]='';this[_0x3e00('0x4')]='';this[_0x3e00('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x3e00('0x6')]=0x1;this[_0x3e00('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x3e00('0x8')]=null;this[_0x3e00('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x3e00('0xa')]=![];this['queuecallerexitAt']=null;this[_0x3e00('0xb')]=0x1;this[_0x3e00('0xc')]='';this[_0x3e00('0xd')]='';this[_0x3e00('0xe')]='';this[_0x3e00('0xf')]='';this['context']='';this[_0x3e00('0x10')]='';this[_0x3e00('0x11')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x3e00('0x12')]='';this[_0x3e00('0x13')]=_0x3e00('0x14');this[_0x3e00('0x15')]=0x0;this[_0x3e00('0x16')]={};}module[_0x3e00('0x17')]=QueueReport; \ No newline at end of file +var _0x42ea=['connectedlinenum','connectedlinename','accountcode','priority','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel'];(function(_0x15f83d,_0x3da4eb){var _0x5f4be9=function(_0x1762b0){while(--_0x1762b0){_0x15f83d['push'](_0x15f83d['shift']());}};_0x5f4be9(++_0x3da4eb);}(_0x42ea,0x1be));var _0xa42e=function(_0x45d6b6,_0x304ad5){_0x45d6b6=_0x45d6b6-0x0;var _0x1fb84e=_0x42ea[_0x45d6b6];return _0x1fb84e;};'use strict';function QueueReport(){this[_0xa42e('0x0')]=_0xa42e('0x1');this[_0xa42e('0x2')]='';this[_0xa42e('0x3')]='';this[_0xa42e('0x4')]='';this[_0xa42e('0x5')]='';this[_0xa42e('0x6')]=null;this[_0xa42e('0x7')]=null;this['position']=0x1;this['count']=0x1;this[_0xa42e('0x8')]=![];this['queuecallerabandonAt']=null;this[_0xa42e('0x9')]=![];this[_0xa42e('0xa')]=null;this[_0xa42e('0xb')]=![];this['queuecallerexitAt']=null;this[_0xa42e('0xc')]=0x1;this[_0xa42e('0xd')]='';this[_0xa42e('0xe')]='';this[_0xa42e('0xf')]='';this[_0xa42e('0x10')]='';this['context']='';this['exten']='';this[_0xa42e('0x11')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xa42e('0x12')]='';this['motionChannel']=_0xa42e('0x13');this[_0xa42e('0x14')]=0x0;this[_0xa42e('0x15')]={};}module[_0xa42e('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8cfe52e..df30909 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 _0x4436=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','username','remoteUri'];(function(_0x449484,_0x4afc54){var _0x3ee4d5=function(_0x2b7d48){while(--_0x2b7d48){_0x449484['push'](_0x449484['shift']());}};_0x3ee4d5(++_0x4afc54);}(_0x4436,0x7c));var _0x6443=function(_0xda60a4,_0x5702db){_0xda60a4=_0xda60a4-0x0;var _0x16b168=_0x4436[_0xda60a4];return _0x16b168;};'use strict';function SalesforceAccount(_0x540591){this['id']=_0x540591['id']||0x0;this['name']=_0x540591['name']||'';this['username']=_0x540591[_0x6443('0x0')]||'';this[_0x6443('0x1')]=_0x540591['remoteUri']||'';this['password']=_0x540591[_0x6443('0x2')]||'';this[_0x6443('0x3')]=_0x540591[_0x6443('0x3')]||'';this[_0x6443('0x4')]=_0x540591[_0x6443('0x4')]||'';this[_0x6443('0x5')]=_0x540591[_0x6443('0x5')]||'';this[_0x6443('0x6')]=_0x540591['type']||'integrationTab';this[_0x6443('0x7')]=_0x540591['serverUrl']||'';this[_0x6443('0x8')]=_0x540591[_0x6443('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xb9c6=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','clientId'];(function(_0x49266b,_0x31521f){var _0x41941c=function(_0x48c6dd){while(--_0x48c6dd){_0x49266b['push'](_0x49266b['shift']());}};_0x41941c(++_0x31521f);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x1e84e3,_0x281bc1){_0x1e84e3=_0x1e84e3-0x0;var _0x487b5a=_0xb9c6[_0x1e84e3];return _0x487b5a;};'use strict';function SalesforceAccount(_0x2cce5a){this['id']=_0x2cce5a['id']||0x0;this[_0x6b9c('0x0')]=_0x2cce5a[_0x6b9c('0x0')]||'';this[_0x6b9c('0x1')]=_0x2cce5a['username']||'';this[_0x6b9c('0x2')]=_0x2cce5a[_0x6b9c('0x2')]||'';this['password']=_0x2cce5a['password']||'';this['clientId']=_0x2cce5a[_0x6b9c('0x3')]||'';this[_0x6b9c('0x4')]=_0x2cce5a[_0x6b9c('0x4')]||'';this['securityToken']=_0x2cce5a[_0x6b9c('0x5')]||'';this[_0x6b9c('0x6')]=_0x2cce5a['type']||_0x6b9c('0x7');this[_0x6b9c('0x8')]=_0x2cce5a['serverUrl']||'';this[_0x6b9c('0x9')]=_0x2cce5a[_0x6b9c('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index b20bc5e..3f0a888 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 _0x0aac=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x441dc0,_0x1ae866){var _0x59a203=function(_0xe4cd24){while(--_0xe4cd24){_0x441dc0['push'](_0x441dc0['shift']());}};_0x59a203(++_0x1ae866);}(_0x0aac,0x1a2));var _0xc0aa=function(_0x4d9d54,_0x1b9bcf){_0x4d9d54=_0x4d9d54-0x0;var _0x489b1b=_0x0aac[_0x4d9d54];return _0x489b1b;};'use strict';function ServicenowAccount(_0x5230dd){this['id']=_0x5230dd['id']||0x0;this[_0xc0aa('0x0')]=_0x5230dd[_0xc0aa('0x0')]||'';this['username']=_0x5230dd[_0xc0aa('0x1')]||'';this[_0xc0aa('0x2')]=_0x5230dd['password']||'';this[_0xc0aa('0x3')]=_0x5230dd['remoteUri']||'';this['serverUrl']=_0x5230dd[_0xc0aa('0x4')]||'';this[_0xc0aa('0x5')]=_0x5230dd[_0xc0aa('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xa9c1=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x23f333,_0x5c2fb9){var _0x8bedc5=function(_0x246e61){while(--_0x246e61){_0x23f333['push'](_0x23f333['shift']());}};_0x8bedc5(++_0x5c2fb9);}(_0xa9c1,0xb3));var _0x1a9c=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xa9c1[_0xc0a3d3];return _0x3386e8;};'use strict';function ServicenowAccount(_0x395a71){this['id']=_0x395a71['id']||0x0;this[_0x1a9c('0x0')]=_0x395a71[_0x1a9c('0x0')]||'';this['username']=_0x395a71[_0x1a9c('0x1')]||'';this[_0x1a9c('0x2')]=_0x395a71['password']||'';this[_0x1a9c('0x3')]=_0x395a71[_0x1a9c('0x3')]||'';this['serverUrl']=_0x395a71[_0x1a9c('0x4')]||'';this[_0x1a9c('0x5')]=_0x395a71[_0x1a9c('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 134fca0..0c6eb13 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 _0x1d19=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x5f4405,_0x46aa23){var _0x348e74=function(_0xdca321){while(--_0xdca321){_0x5f4405['push'](_0x5f4405['shift']());}};_0x348e74(++_0x46aa23);}(_0x1d19,0xef));var _0x91d1=function(_0x3c9d10,_0x4233e7){_0x3c9d10=_0x3c9d10-0x0;var _0x5b52b2=_0x1d19[_0x3c9d10];return _0x5b52b2;};'use strict';function SugarcrmAccount(_0x46aca5){this['id']=_0x46aca5['id']||0x0;this['name']=_0x46aca5[_0x91d1('0x0')]||'';this[_0x91d1('0x1')]=_0x46aca5[_0x91d1('0x1')]||'';this[_0x91d1('0x2')]=_0x46aca5[_0x91d1('0x2')]||'';this[_0x91d1('0x3')]=_0x46aca5[_0x91d1('0x3')]||'';this[_0x91d1('0x4')]=_0x46aca5[_0x91d1('0x4')]||'';this[_0x91d1('0x5')]=_0x46aca5[_0x91d1('0x5')]||{};}module[_0x91d1('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xd9c5=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x42d131,_0x10a237){var _0x247dd2=function(_0x339001){while(--_0x339001){_0x42d131['push'](_0x42d131['shift']());}};_0x247dd2(++_0x10a237);}(_0xd9c5,0x196));var _0x5d9c=function(_0x20fff5,_0x9b765a){_0x20fff5=_0x20fff5-0x0;var _0x519ca3=_0xd9c5[_0x20fff5];return _0x519ca3;};'use strict';function SugarcrmAccount(_0xcf0924){this['id']=_0xcf0924['id']||0x0;this['name']=_0xcf0924[_0x5d9c('0x0')]||'';this[_0x5d9c('0x1')]=_0xcf0924[_0x5d9c('0x1')]||'';this['password']=_0xcf0924[_0x5d9c('0x2')]||'';this[_0x5d9c('0x3')]=_0xcf0924[_0x5d9c('0x3')]||'';this[_0x5d9c('0x4')]=_0xcf0924[_0x5d9c('0x4')]||'';this[_0x5d9c('0x5')]=_0xcf0924['Configurations']||{};}module[_0x5d9c('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 e39e365..ba1f600 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 _0x1ebd=['address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x2af261,_0x33d5ae){var _0x5e4774=function(_0x562286){while(--_0x562286){_0x2af261['push'](_0x2af261['shift']());}};_0x5e4774(++_0x33d5ae);}(_0x1ebd,0x64));var _0xd1eb=function(_0x384972,_0x3c99d3){_0x384972=_0x384972-0x0;var _0x26b729=_0x1ebd[_0x384972];return _0x26b729;};'use strict';function Telephone(_0x3bf1a6){this['id']=_0x3bf1a6['id']||0x0;this[_0xd1eb('0x0')]=_0x3bf1a6[_0xd1eb('0x0')]||'';this['accountcode']=_0x3bf1a6[_0xd1eb('0x1')]||'';this[_0xd1eb('0x2')]=_0xd1eb('0x3');this[_0xd1eb('0x4')]=0x0;this['status']='unknown';this[_0xd1eb('0x5')]='';}module[_0xd1eb('0x6')]=Telephone; \ No newline at end of file +var _0xceb0=['exports','accountcode','unknown','stateTime','status'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xceb0,0x173));var _0x0ceb=function(_0x250719,_0x13f3fa){_0x250719=_0x250719-0x0;var _0x4194cc=_0xceb0[_0x250719];return _0x4194cc;};'use strict';function Telephone(_0x5c19fb){this['id']=_0x5c19fb['id']||0x0;this['name']=_0x5c19fb['name']||'';this['accountcode']=_0x5c19fb[_0x0ceb('0x0')]||'';this['state']=_0x0ceb('0x1');this[_0x0ceb('0x2')]=0x0;this[_0x0ceb('0x3')]='unknown';this['address']='';}module[_0x0ceb('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 904f095..81194a0 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0xe56160,_0x1a4317){var _0x36ec60=function(_0x1cec17){while(--_0x1cec17){_0xe56160['push'](_0xe56160['shift']());}};_0x36ec60(++_0x1a4317);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x52c82c,_0x5499e1){var _0x192436=function(_0x1b8c17){while(--_0x1b8c17){_0x52c82c['push'](_0x52c82c['shift']());}};_0x192436(++_0x5499e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ad1f78e..617d5d8 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x24d042,_0x3ae099){var _0x2c5512=function(_0x1e9453){while(--_0x1e9453){_0x24d042['push'](_0x24d042['shift']());}};_0x2c5512(++_0x3ae099);}(_0x2032,0xd9));var _0x2203=function(_0x42cf2d,_0x5af862){_0x42cf2d=_0x42cf2d-0x0;var _0x2d68fc=_0x2032[_0x42cf2d];return _0x2d68fc;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x223bdb,_0x5882e6){_0x223bdb=_0x223bdb-0x0;var _0xef8e68=_0x0b0e[_0x223bdb];return _0xef8e68;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 02d6632..10840fc 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 _0xde98=['defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x211eef,_0x3881c4){var _0x31948a=function(_0x462330){while(--_0x462330){_0x211eef['push'](_0x211eef['shift']());}};_0x31948a(++_0x3881c4);}(_0xde98,0xa2));var _0x8de9=function(_0x35c750,_0x4dcafe){_0x35c750=_0x35c750-0x0;var _0x916c98=_0xde98[_0x35c750];return _0x916c98;};'use strict';function Trunk(_0x1e7390){this['id']=_0x1e7390['id']||0x0;this[_0x8de9('0x0')]=_0x1e7390[_0x8de9('0x0')]||![];this[_0x8de9('0x1')]=_0x1e7390[_0x8de9('0x1')]||'';this['state']=_0x8de9('0x2');this[_0x8de9('0x3')]=0x0;this[_0x8de9('0x4')]=_0x8de9('0x2');this[_0x8de9('0x5')]=_0x1e7390[_0x8de9('0x5')]&&_0x1e7390[_0x8de9('0x5')][_0x8de9('0x6')](':')?_0x1e7390[_0x8de9('0x5')][_0x8de9('0x7')](':')[0x0]:'';this[_0x8de9('0x8')]='';this['port']='';this[_0x8de9('0x9')]='';this[_0x8de9('0xa')]='';this[_0x8de9('0xb')]='';this[_0x8de9('0xc')]=_0x8de9('0x2');this[_0x8de9('0xd')]='';this['address']='';this[_0x8de9('0xe')]=_0x1e7390[_0x8de9('0xe')]||'';}module[_0x8de9('0xf')]=Trunk; \ No newline at end of file +var _0x0854=['unknown','stateTime','status','registry','indexOf','split','host','port','domainport','refresh','registrationtime','address','defaultuser','active','name','state'];(function(_0x3d081d,_0x267c8e){var _0x8e1bea=function(_0x5c1188){while(--_0x5c1188){_0x3d081d['push'](_0x3d081d['shift']());}};_0x8e1bea(++_0x267c8e);}(_0x0854,0x18d));var _0x4085=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0854[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x3f9b65){this['id']=_0x3f9b65['id']||0x0;this[_0x4085('0x0')]=_0x3f9b65[_0x4085('0x0')]||![];this[_0x4085('0x1')]=_0x3f9b65['name']||'';this[_0x4085('0x2')]=_0x4085('0x3');this[_0x4085('0x4')]=0x0;this[_0x4085('0x5')]=_0x4085('0x3');this[_0x4085('0x6')]=_0x3f9b65[_0x4085('0x6')]&&_0x3f9b65[_0x4085('0x6')][_0x4085('0x7')](':')?_0x3f9b65[_0x4085('0x6')][_0x4085('0x8')](':')[0x0]:'';this[_0x4085('0x9')]='';this[_0x4085('0xa')]='';this['domain']='';this[_0x4085('0xb')]='';this[_0x4085('0xc')]='';this['stateRegistry']=_0x4085('0x3');this[_0x4085('0xd')]='';this[_0x4085('0xe')]='';this[_0x4085('0xf')]=_0x3f9b65[_0x4085('0xf')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 63fddc3..b6a872d 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 _0xcfe3=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcfe3,0x1c8));var _0x3cfe=function(_0x24060d,_0x203042){_0x24060d=_0x24060d-0x0;var _0x5b3cd9=_0xcfe3[_0x24060d];return _0x5b3cd9;};'use strict';function voiceExtension(_0x1b10e9){this['id']=_0x1b10e9['id']||0x0;this['exten']=_0x1b10e9[_0x3cfe('0x0')]||'';this['recordingFormat']=_0x1b10e9[_0x3cfe('0x1')]||'none';this[_0x3cfe('0x2')]=_0x1b10e9['mandatoryDisposition']||![];}module[_0x3cfe('0x3')]=voiceExtension; \ No newline at end of file +var _0x3015=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x3015,0xd2));var _0x5301=function(_0x2c45cb,_0x40d76b){_0x2c45cb=_0x2c45cb-0x0;var _0x32a6ca=_0x3015[_0x2c45cb];return _0x32a6ca;};'use strict';function voiceExtension(_0x1c4cff){this['id']=_0x1c4cff['id']||0x0;this[_0x5301('0x0')]=_0x1c4cff[_0x5301('0x0')]||'';this[_0x5301('0x1')]=_0x1c4cff[_0x5301('0x1')]||'none';this[_0x5301('0x2')]=_0x1c4cff['mandatoryDisposition']||![];}module[_0x5301('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 4b53883..612e666 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 _0x21bd=['dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x21f4f1,_0x2accb8){var _0x675c84=function(_0x55659e){while(--_0x55659e){_0x21f4f1['push'](_0x21f4f1['shift']());}};_0x675c84(++_0x2accb8);}(_0x21bd,0x1c3));var _0xd21b=function(_0x55bde5,_0x576d3c){_0x55bde5=_0x55bde5-0x0;var _0x5ca5d2=_0x21bd[_0x55bde5];return _0x5ca5d2;};'use strict';var statusDesc=[_0xd21b('0x0'),_0xd21b('0x1'),_0xd21b('0x2'),_0xd21b('0x3'),_0xd21b('0x4'),'unavailable',_0xd21b('0x5'),_0xd21b('0x6'),_0xd21b('0x7')];var monitorFormat={'wav':_0xd21b('0x8'),'wav49':_0xd21b('0x9'),'gsm':_0xd21b('0xa')};var strategy={'rrmemory':_0xd21b('0xb'),'roundrobin':_0xd21b('0xc')};function VoiceQueue(_0x2a62ee){this['id']=_0x2a62ee['id']||0x0;this['name']=_0x2a62ee[_0xd21b('0xd')]||'';this[_0xd21b('0xe')]=_0x2a62ee[_0xd21b('0xe')]||'';this['type']=_0x2a62ee[_0xd21b('0xf')]||_0xd21b('0x10');this['waiting']=0x0;this[_0xd21b('0x11')]=0x0;this[_0xd21b('0x12')]=0x0;this[_0xd21b('0x13')]=0x0;this[_0xd21b('0x14')]=0x0;this[_0xd21b('0x15')]=0x0;this[_0xd21b('0x16')]=0x0;this[_0xd21b('0x17')]=0x0;this[_0xd21b('0x18')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0x2a62ee[_0xd21b('0x19')]||![];this[_0xd21b('0x1a')]=_0x2a62ee[_0xd21b('0x1a')]||0xa;this[_0xd21b('0x1b')]=_0x2a62ee[_0xd21b('0x1b')]||'no';this[_0xd21b('0x1c')]=!![];this[_0xd21b('0x1d')]='';this[_0xd21b('0x1e')]=0x0;this[_0xd21b('0x1f')]=0x0;this[_0xd21b('0x20')]=_0x2a62ee[_0xd21b('0x20')]||null;this[_0xd21b('0x21')]=_0x2a62ee[_0xd21b('0x21')]?_0x2a62ee[_0xd21b('0x21')]:null;this[_0xd21b('0x22')]=_0x2a62ee[_0xd21b('0x22')];this[_0xd21b('0x23')]=_0x2a62ee[_0xd21b('0x23')]||_0xd21b('0x24');this[_0xd21b('0x25')]=_0x2a62ee[_0xd21b('0x25')]||0x0;this[_0xd21b('0x26')]=_0x2a62ee['dialLimitQueue']||0x0;this[_0xd21b('0x27')]=_0x2a62ee['dialPowerLevel']||0x1;this[_0xd21b('0x28')]=_0x2a62ee[_0xd21b('0x28')]||_0xd21b('0x29');this[_0xd21b('0x2a')]=_0x2a62ee[_0xd21b('0x2a')]||0.03;this[_0xd21b('0x2b')]=_0x2a62ee[_0xd21b('0x2b')]||0x258;this['dialOriginateCallerIdName']=_0x2a62ee[_0xd21b('0x2c')]||'anonymous';this[_0xd21b('0x2d')]=_0x2a62ee[_0xd21b('0x2d')]||_0xd21b('0x2e');this['dialOriginateTimeout']=_0x2a62ee['dialOriginateTimeout']||0x1e;this[_0xd21b('0x2f')]=_0x2a62ee[_0xd21b('0x2f')]||'tTxX';this['dialQueueTimeout']=_0x2a62ee[_0xd21b('0x30')]||0x3;this[_0xd21b('0x31')]=_0x2a62ee[_0xd21b('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x2a62ee[_0xd21b('0x32')]||0x3;this[_0xd21b('0x33')]=_0x2a62ee[_0xd21b('0x33')]||0x96;this[_0xd21b('0x34')]=_0x2a62ee['dialBusyMaxRetry']||0x3;this[_0xd21b('0x35')]=_0x2a62ee[_0xd21b('0x35')]||0x96;this[_0xd21b('0x36')]=_0x2a62ee['dialNoAnswerMaxRetry']||0x3;this[_0xd21b('0x37')]=_0x2a62ee[_0xd21b('0x37')]||0x96;this[_0xd21b('0x38')]=_0x2a62ee[_0xd21b('0x38')]||0x3;this[_0xd21b('0x39')]=_0x2a62ee[_0xd21b('0x39')]||0x96;this[_0xd21b('0x3a')]=_0x2a62ee[_0xd21b('0x3a')]||0x3;this[_0xd21b('0x3b')]=_0x2a62ee[_0xd21b('0x3b')]||0x96;this[_0xd21b('0x3c')]=_0x2a62ee[_0xd21b('0x3c')]||0x3;this[_0xd21b('0x3d')]=_0x2a62ee[_0xd21b('0x3d')]||0x96;this[_0xd21b('0x3e')]=_0x2a62ee[_0xd21b('0x3e')]||0x3;this[_0xd21b('0x3f')]=_0x2a62ee[_0xd21b('0x3f')]||0x96;this['dialAgentRejectMaxRetry']=_0x2a62ee['dialAgentRejectMaxRetry']||0x3;this[_0xd21b('0x40')]=_0x2a62ee['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x2a62ee[_0xd21b('0x41')]||0x4;this['Trunk']=_0x2a62ee[_0xd21b('0x42')]?_0x2a62ee[_0xd21b('0x42')]:undefined;this[_0xd21b('0x43')]=_0x2a62ee['TrunkBackup']?_0x2a62ee[_0xd21b('0x43')]:undefined;this[_0xd21b('0x44')]=_0x2a62ee[_0xd21b('0x44')]||undefined;this[_0xd21b('0x45')]=_0x2a62ee['Interval']?_0x2a62ee[_0xd21b('0x45')]:undefined;this[_0xd21b('0x46')]=_0x2a62ee[_0xd21b('0x46')]||_0xd21b('0x47');this['dialRandomLastDigitCallerIdNumber']=_0x2a62ee[_0xd21b('0x48')]||undefined;this[_0xd21b('0x49')]=_0x2a62ee[_0xd21b('0x49')]||undefined;this[_0xd21b('0x4a')]=strategy[_0x2a62ee[_0xd21b('0x4a')]]||_0xd21b('0xb');this[_0xd21b('0x4b')]=!![];this[_0xd21b('0x4c')]=_0x2a62ee[_0xd21b('0x4c')]||![];this[_0xd21b('0x4d')]=_0x2a62ee[_0xd21b('0x4d')];this[_0xd21b('0x4e')]=_0x2a62ee[_0xd21b('0x4e')];this[_0xd21b('0x4f')]=_0x2a62ee['dialAMDAfterGreetingSilence'];this[_0xd21b('0x50')]=_0x2a62ee[_0xd21b('0x50')];this[_0xd21b('0x51')]=_0x2a62ee[_0xd21b('0x51')];this[_0xd21b('0x52')]=_0x2a62ee[_0xd21b('0x52')];this[_0xd21b('0x53')]=_0x2a62ee['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x2a62ee['dialAMDSilenceThreshold'];this[_0xd21b('0x54')]=_0x2a62ee['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xd21b('0x55')]=0x0;this[_0xd21b('0x56')]=_0x2a62ee[_0xd21b('0x56')];this[_0xd21b('0x57')]=0x0;this[_0xd21b('0x58')]=0x0;this[_0xd21b('0x59')]=0x0;this[_0xd21b('0x5a')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xd21b('0x5b')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd21b('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xd21b('0x5d')]=0x0;this[_0xd21b('0x5e')]=0x0;this[_0xd21b('0x5f')]=0x0;this[_0xd21b('0x60')]=0x0;this[_0xd21b('0x61')]=0x0;this[_0xd21b('0x62')]=undefined;this[_0xd21b('0x63')]=undefined;this['handlePredictive']=undefined;this[_0xd21b('0x64')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xd21b('0x65')]=0x0;this[_0xd21b('0x66')]=0x0;this[_0xd21b('0x67')]=0x0;this[_0xd21b('0x68')]=0x0;this[_0xd21b('0x69')]=0x0;this[_0xd21b('0x6a')]=0x0;this[_0xd21b('0x6b')]=0x0;this[_0xd21b('0x6c')]=_0x2a62ee[_0xd21b('0x6d')]||0x14;this[_0xd21b('0x6e')]=_0x2a62ee[_0xd21b('0x6d')]||0xa;this[_0xd21b('0x6f')]=0x0;this[_0xd21b('0x70')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xd21b('0x71')]=0x0;this['erlangCallToSecond']=0x0;this[_0xd21b('0x72')]=0x0;this['erlangBusyFactor']=0x0;this[_0xd21b('0x73')]=_0x2a62ee[_0xd21b('0x73')]||0x1e;this[_0xd21b('0x74')]=_0x2a62ee[_0xd21b('0x74')]||![];this[_0xd21b('0x75')]=!!_0x2a62ee[_0xd21b('0x75')]||![];this[_0xd21b('0x76')]=_0x2a62ee[_0xd21b('0x76')]||undefined;this['dialAgiAfterHangupClient']=_0x2a62ee['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x2a62ee[_0xd21b('0x77')]||![];this[_0xd21b('0xe')]=monitorFormat[_0x2a62ee[_0xd21b('0xe')]]?monitorFormat[_0x2a62ee[_0xd21b('0xe')]]:undefined;this[_0xd21b('0x78')]=_0x2a62ee[_0xd21b('0x78')]||![];this[_0xd21b('0x79')]=_0x2a62ee[_0xd21b('0x79')]?_0x2a62ee[_0xd21b('0x79')]:undefined;}module[_0xd21b('0x7a')]=VoiceQueue; \ No newline at end of file +var _0x39cb=['dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','invalid','unavailable','ringing','ringinuse','wav49','rrmemory','roundrobin','name','monitor_format','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x3c57a5,_0x1ce02a){var _0x4e03a4=function(_0x5e86e0){while(--_0x5e86e0){_0x3c57a5['push'](_0x3c57a5['shift']());}};_0x4e03a4(++_0x1ce02a);}(_0x39cb,0x130));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var statusDesc=[_0xb39c('0x0'),'not_inuse',_0xb39c('0x1'),'busy',_0xb39c('0x2'),_0xb39c('0x3'),_0xb39c('0x4'),_0xb39c('0x5'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xb39c('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0xb39c('0x7'),'roundrobin':_0xb39c('0x8')};function VoiceQueue(_0x174a78){this['id']=_0x174a78['id']||0x0;this[_0xb39c('0x9')]=_0x174a78[_0xb39c('0x9')]||'';this[_0xb39c('0xa')]=_0x174a78['monitor_format']||'';this['type']=_0x174a78['type']||'inbound';this[_0xb39c('0xb')]=0x0;this[_0xb39c('0xc')]=0x0;this[_0xb39c('0xd')]=0x0;this[_0xb39c('0xe')]=0x0;this[_0xb39c('0xf')]=0x0;this[_0xb39c('0x10')]=0x0;this[_0xb39c('0x11')]=0x0;this[_0xb39c('0x12')]=0x0;this[_0xb39c('0x13')]=0x0;this[_0xb39c('0x14')]=0x0;this['available']=0x0;this[_0xb39c('0x15')]=_0x174a78['acw']||![];this['acwTimeout']=_0x174a78['acwTimeout']||0xa;this[_0xb39c('0x16')]=_0x174a78[_0xb39c('0x16')]||'no';this[_0xb39c('0x17')]=!![];this['message']='';this[_0xb39c('0x18')]=0x0;this[_0xb39c('0x19')]=0x0;this['dialTimezone']=_0x174a78[_0xb39c('0x1a')]||null;this[_0xb39c('0x1b')]=_0x174a78[_0xb39c('0x1b')]?_0x174a78[_0xb39c('0x1b')]:null;this[_0xb39c('0x1c')]=_0x174a78[_0xb39c('0x1c')];this[_0xb39c('0x1d')]=_0x174a78['dialMethod']||'progressive';this[_0xb39c('0x1e')]=_0x174a78[_0xb39c('0x1e')]||0x0;this['dialLimitQueue']=_0x174a78[_0xb39c('0x1f')]||0x0;this[_0xb39c('0x20')]=_0x174a78['dialPowerLevel']||0x1;this[_0xb39c('0x21')]=_0x174a78[_0xb39c('0x21')]||'dropRate';this[_0xb39c('0x22')]=_0x174a78['dialPredictiveOptimizationPercentage']||0.03;this[_0xb39c('0x23')]=_0x174a78[_0xb39c('0x23')]||0x258;this[_0xb39c('0x24')]=_0x174a78[_0xb39c('0x24')]||'anonymous';this[_0xb39c('0x25')]=_0x174a78['dialOriginateCallerIdNumber']||_0xb39c('0x26');this['dialOriginateTimeout']=_0x174a78[_0xb39c('0x27')]||0x1e;this['dialQueueOptions']=_0x174a78[_0xb39c('0x28')]||_0xb39c('0x29');this[_0xb39c('0x2a')]=_0x174a78[_0xb39c('0x2a')]||0x3;this[_0xb39c('0x2b')]=_0x174a78['dialQueueProject']||undefined;this[_0xb39c('0x2c')]=_0x174a78[_0xb39c('0x2c')]||0x3;this['dialCongestionRetryFrequency']=_0x174a78[_0xb39c('0x2d')]||0x96;this[_0xb39c('0x2e')]=_0x174a78[_0xb39c('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x174a78[_0xb39c('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x174a78[_0xb39c('0x30')]||0x3;this[_0xb39c('0x31')]=_0x174a78[_0xb39c('0x31')]||0x96;this[_0xb39c('0x32')]=_0x174a78[_0xb39c('0x32')]||0x3;this[_0xb39c('0x33')]=_0x174a78['dialNoSuchNumberRetryFrequency']||0x96;this[_0xb39c('0x34')]=_0x174a78['dialDropMaxRetry']||0x3;this[_0xb39c('0x35')]=_0x174a78[_0xb39c('0x35')]||0x96;this[_0xb39c('0x36')]=_0x174a78[_0xb39c('0x36')]||0x3;this[_0xb39c('0x37')]=_0x174a78[_0xb39c('0x37')]||0x96;this[_0xb39c('0x38')]=_0x174a78['dialMachineMaxRetry']||0x3;this[_0xb39c('0x39')]=_0x174a78[_0xb39c('0x39')]||0x96;this[_0xb39c('0x3a')]=_0x174a78['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x174a78[_0xb39c('0x3b')]||0x96;this[_0xb39c('0x3c')]=_0x174a78[_0xb39c('0x3c')]||0x4;this[_0xb39c('0x3d')]=_0x174a78[_0xb39c('0x3d')]?_0x174a78['Trunk']:undefined;this['TrunkBackup']=_0x174a78[_0xb39c('0x3e')]?_0x174a78[_0xb39c('0x3e')]:undefined;this[_0xb39c('0x3f')]=_0x174a78['dialPrefix']||undefined;this['Interval']=_0x174a78[_0xb39c('0x40')]?_0x174a78[_0xb39c('0x40')]:undefined;this[_0xb39c('0x41')]=_0x174a78[_0xb39c('0x41')]||_0xb39c('0x42');this[_0xb39c('0x43')]=_0x174a78['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb39c('0x44')]=_0x174a78[_0xb39c('0x44')]||undefined;this['strategy']=strategy[_0x174a78['strategy']]||_0xb39c('0x7');this[_0xb39c('0x45')]=!![];this[_0xb39c('0x46')]=_0x174a78[_0xb39c('0x46')]||![];this[_0xb39c('0x47')]=_0x174a78[_0xb39c('0x47')];this[_0xb39c('0x48')]=_0x174a78['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x174a78[_0xb39c('0x49')];this[_0xb39c('0x4a')]=_0x174a78[_0xb39c('0x4a')];this[_0xb39c('0x4b')]=_0x174a78['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x174a78['dialAMDBetweenWordsSilence'];this[_0xb39c('0x4c')]=_0x174a78[_0xb39c('0x4c')];this[_0xb39c('0x4d')]=_0x174a78[_0xb39c('0x4d')];this[_0xb39c('0x4e')]=_0x174a78[_0xb39c('0x4e')];this[_0xb39c('0x4f')]=0x0;this[_0xb39c('0x50')]=0x0;this[_0xb39c('0x51')]=_0x174a78['timeout'];this[_0xb39c('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xb39c('0x53')]=0x0;this[_0xb39c('0x54')]=0x0;this[_0xb39c('0x55')]=0x0;this[_0xb39c('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb39c('0x57')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xb39c('0x58')]=0x0;this[_0xb39c('0x59')]=0x0;this[_0xb39c('0x5a')]=undefined;this[_0xb39c('0x5b')]=undefined;this[_0xb39c('0x5c')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xb39c('0x5d')]=0x0;this[_0xb39c('0x5e')]=0x0;this[_0xb39c('0x5f')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb39c('0x60')]=0x0;this[_0xb39c('0x61')]=0x0;this[_0xb39c('0x62')]=0x0;this[_0xb39c('0x63')]=0x0;this[_0xb39c('0x64')]=_0x174a78['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb39c('0x65')]=_0x174a78[_0xb39c('0x66')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb39c('0x67')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xb39c('0x68')]=0x0;this[_0xb39c('0x69')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x174a78['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x174a78['dialRecallInQueue']||![];this[_0xb39c('0x6a')]=!!_0x174a78[_0xb39c('0x6a')]||![];this[_0xb39c('0x6b')]=_0x174a78['dialQueueProject2']||undefined;this[_0xb39c('0x6c')]=_0x174a78[_0xb39c('0x6c')]||![];this[_0xb39c('0x6d')]=_0x174a78[_0xb39c('0x6d')]||![];this['monitor_format']=monitorFormat[_0x174a78[_0xb39c('0xa')]]?monitorFormat[_0x174a78[_0xb39c('0xa')]]:undefined;this[_0xb39c('0x6e')]=_0x174a78['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x174a78['mandatoryDispositionPause']?_0x174a78[_0xb39c('0x6f')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 726b08c..a8e5510 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 _0xe84f=['username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0xe84f,0xde));var _0xfe84=function(_0x7601ef,_0x1bfd2a){_0x7601ef=_0x7601ef-0x0;var _0x58c7d4=_0xe84f[_0x7601ef];return _0x58c7d4;};'use strict';function VtigerAccount(_0x3a4330){this['id']=_0x3a4330['id']||0x0;this['name']=_0x3a4330['name']||'';this[_0xfe84('0x0')]=_0x3a4330[_0xfe84('0x0')]||'';this['accessKey']=_0x3a4330[_0xfe84('0x1')]||'';this[_0xfe84('0x2')]=_0x3a4330[_0xfe84('0x2')]||'';this[_0xfe84('0x3')]=_0x3a4330[_0xfe84('0x3')]||'';this[_0xfe84('0x4')]=_0x3a4330[_0xfe84('0x4')]||{};}module[_0xfe84('0x5')]=VtigerAccount; \ No newline at end of file +var _0xf446=['accessKey','remoteUri','serverUrl','name','username'];(function(_0x2a04,_0x434f07){var _0x2c7007=function(_0x24fd20){while(--_0x24fd20){_0x2a04['push'](_0x2a04['shift']());}};_0x2c7007(++_0x434f07);}(_0xf446,0x1c0));var _0x6f44=function(_0x1afd57,_0x24d036){_0x1afd57=_0x1afd57-0x0;var _0x191c63=_0xf446[_0x1afd57];return _0x191c63;};'use strict';function VtigerAccount(_0x8d926a){this['id']=_0x8d926a['id']||0x0;this['name']=_0x8d926a[_0x6f44('0x0')]||'';this[_0x6f44('0x1')]=_0x8d926a['username']||'';this[_0x6f44('0x2')]=_0x8d926a['accessKey']||'';this[_0x6f44('0x3')]=_0x8d926a[_0x6f44('0x3')]||'';this['serverUrl']=_0x8d926a[_0x6f44('0x4')]||'';this['Configurations']=_0x8d926a['Configurations']||{};}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 dc5d0ac..0865c67 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 _0xc60e=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc60e,0x16b));var _0xec60=function(_0x40fb00,_0x4da8f6){_0x40fb00=_0x40fb00-0x0;var _0x31754c=_0xc60e[_0x40fb00];return _0x31754c;};'use strict';function ZendeskAccount(_0x570f59){this['id']=_0x570f59['id']||0x0;this[_0xec60('0x0')]=_0x570f59[_0xec60('0x0')]||'';this['username']=_0x570f59[_0xec60('0x1')]||'';this['password']=_0x570f59[_0xec60('0x2')]||'';this[_0xec60('0x3')]=_0x570f59[_0xec60('0x3')]||'';this[_0xec60('0x4')]=_0x570f59['remoteUri']||'';this['authType']=_0x570f59[_0xec60('0x5')]||'';this['type']=_0x570f59['type']||_0xec60('0x6');this[_0xec60('0x7')]=_0x570f59[_0xec60('0x7')]||'';this['Configurations']=_0x570f59[_0xec60('0x8')]||{};}module[_0xec60('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xa682=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x3e4e33,_0x1c01fc){var _0x58a9da=function(_0x32180f){while(--_0x32180f){_0x3e4e33['push'](_0x3e4e33['shift']());}};_0x58a9da(++_0x1c01fc);}(_0xa682,0xa4));var _0x2a68=function(_0x16bdca,_0x5d75f1){_0x16bdca=_0x16bdca-0x0;var _0x5cf812=_0xa682[_0x16bdca];return _0x5cf812;};'use strict';function ZendeskAccount(_0x2d807c){this['id']=_0x2d807c['id']||0x0;this[_0x2a68('0x0')]=_0x2d807c['name']||'';this[_0x2a68('0x1')]=_0x2d807c['username']||'';this[_0x2a68('0x2')]=_0x2d807c[_0x2a68('0x2')]||'';this[_0x2a68('0x3')]=_0x2d807c[_0x2a68('0x3')]||'';this[_0x2a68('0x4')]=_0x2d807c[_0x2a68('0x4')]||'';this[_0x2a68('0x5')]=_0x2d807c[_0x2a68('0x5')]||'';this[_0x2a68('0x6')]=_0x2d807c[_0x2a68('0x6')]||_0x2a68('0x7');this[_0x2a68('0x8')]=_0x2d807c['serverUrl']||'';this['Configurations']=_0x2d807c[_0x2a68('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 49c5dbd..a2d24c2 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 _0x24f1=['code','refreshToken','exports','name','description','host','clientSecret','serverUrl'];(function(_0x331b91,_0x34af38){var _0x457cbb=function(_0x11b430){while(--_0x11b430){_0x331b91['push'](_0x331b91['shift']());}};_0x457cbb(++_0x34af38);}(_0x24f1,0x73));var _0x124f=function(_0x5ce10e,_0x305435){_0x5ce10e=_0x5ce10e-0x0;var _0x292382=_0x24f1[_0x5ce10e];return _0x292382;};'use strict';function ZohoAccount(_0x49f589){this['id']=_0x49f589['id']||0x0;this['name']=_0x49f589[_0x124f('0x0')]||'';this[_0x124f('0x1')]=_0x49f589[_0x124f('0x1')]||'';this[_0x124f('0x2')]=_0x49f589[_0x124f('0x2')]||'';this['zone']=_0x49f589['zone']||'';this['clientId']=_0x49f589['clientId']||'';this[_0x124f('0x3')]=_0x49f589[_0x124f('0x3')]||'';this[_0x124f('0x4')]=_0x49f589[_0x124f('0x4')]||'';this[_0x124f('0x5')]=_0x49f589['code']||'';this[_0x124f('0x6')]=_0x49f589[_0x124f('0x6')]||'';this['Configurations']=_0x49f589['Configurations']||{};}module[_0x124f('0x7')]=ZohoAccount; \ No newline at end of file +var _0x4c34=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0xada427,_0x5bd5e6){var _0x4b1a6f=function(_0x4b2bd1){while(--_0x4b2bd1){_0xada427['push'](_0xada427['shift']());}};_0x4b1a6f(++_0x5bd5e6);}(_0x4c34,0x186));var _0x44c3=function(_0x490d66,_0x2026bf){_0x490d66=_0x490d66-0x0;var _0x4196e8=_0x4c34[_0x490d66];return _0x4196e8;};'use strict';function ZohoAccount(_0x32d99e){this['id']=_0x32d99e['id']||0x0;this['name']=_0x32d99e[_0x44c3('0x0')]||'';this[_0x44c3('0x1')]=_0x32d99e[_0x44c3('0x1')]||'';this[_0x44c3('0x2')]=_0x32d99e[_0x44c3('0x2')]||'';this[_0x44c3('0x3')]=_0x32d99e[_0x44c3('0x3')]||'';this[_0x44c3('0x4')]=_0x32d99e[_0x44c3('0x4')]||'';this[_0x44c3('0x5')]=_0x32d99e['clientSecret']||'';this[_0x44c3('0x6')]=_0x32d99e[_0x44c3('0x6')]||'';this[_0x44c3('0x7')]=_0x32d99e[_0x44c3('0x7')]||'';this[_0x44c3('0x8')]=_0x32d99e[_0x44c3('0x8')]||'';this[_0x44c3('0x9')]=_0x32d99e['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index c8cae4a..b5fbc83 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 _0x9dc0=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','calleridname','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0xfac045,_0x2a52e5){var _0xf1a728=function(_0x18e91a){while(--_0x18e91a){_0xfac045['push'](_0xfac045['shift']());}};_0xf1a728(++_0x2a52e5);}(_0x9dc0,0x1cc));var _0x09dc=function(_0x4776cc,_0x3a715e){_0x4776cc=_0x4776cc-0x0;var _0x427bda=_0x9dc0[_0x4776cc];return _0x427bda;};'use strict';var util=require(_0x09dc('0x0'));var _=require(_0x09dc('0x1'));var moment=require(_0x09dc('0x2'));function checkNameSurname(_0x18389d,_0x3a03d7,_0xce32f2){var _0x3f22de='';if(!_[_0x09dc('0x3')](_0x3a03d7)&&_0x09dc('0x4')===typeof _0x3a03d7){_0x3f22de+=_0x3a03d7;}if(!_[_0x09dc('0x3')](_0xce32f2)&&_0x09dc('0x4')===typeof _0xce32f2){_0x3f22de+='\x20'+_0xce32f2;}if(_0x3f22de!==''){return _0x3f22de;}return _0x18389d;}function Action(_0xddc403,_0x763981,_0x12e3e9,_0x569ab5,_0x367697){this[_0x09dc('0x5')]=_0x12e3e9||undefined;this['idContact']=_0xddc403['id'];this[_0x09dc('0x6')]=_0x763981[_0x09dc('0x7')];this[_0x09dc('0x8')]=_0x763981['type'];this[_0x09dc('0x9')]=_0x09dc('0x6');this[_0x09dc('0xa')]=![];this['membername']=_[_0x09dc('0x3')](_0xddc403['Agent'])?undefined:_0xddc403[_0x09dc('0xb')][_0x09dc('0x7')];this[_0x09dc('0xc')]=this['membername']?util[_0x09dc('0xd')](_0x09dc('0xe'),this[_0x09dc('0xf')]):_0x569ab5||undefined;this['calleridname']=checkNameSurname(_0xddc403[_0x09dc('0x10')][_0x09dc('0x11')],_0xddc403[_0x09dc('0x10')][_0x09dc('0x12')],_0xddc403[_0x09dc('0x10')][_0x09dc('0x13')]);this[_0x09dc('0x14')]=_0xddc403[_0x09dc('0x14')]||![];this[_0x09dc('0x15')]=_0xddc403[_0x09dc('0x10')]['phone'];this['scheduledat']=_0xddc403[_0x09dc('0x16')];this['countbusyretry']=_0xddc403[_0x09dc('0x17')]||0x0;this[_0x09dc('0x18')]=_0xddc403[_0x09dc('0x18')]||0x0;this['countnoanswerretry']=_0xddc403[_0x09dc('0x19')]||0x0;this[_0x09dc('0x1a')]=(_0xddc403[_0x09dc('0x17')]||0x0)+(_0xddc403[_0x09dc('0x18')]||0x0)+(_0xddc403[_0x09dc('0x19')]||0x0)+(_0xddc403[_0x09dc('0x1b')]||0x0)+(_0xddc403[_0x09dc('0x1c')]||0x0)+(_0xddc403[_0x09dc('0x1d')]||0x0)+(_0xddc403[_0x09dc('0x1e')]||0x0)+(_0xddc403[_0x09dc('0x1f')]||0x0);this['countnosuchnumberretry']=_0xddc403[_0x09dc('0x1b')]||0x0;this['countdropretry']=_0xddc403[_0x09dc('0x1c')]||0x0;this[_0x09dc('0x1d')]=_0xddc403[_0x09dc('0x1d')]||0x0;this[_0x09dc('0x1e')]=_0xddc403['countmachineretry']||0x0;this[_0x09dc('0x1f')]=_0xddc403[_0x09dc('0x1f')]||0x0;this[_0x09dc('0x20')]=_0xddc403['callback'];this[_0x09dc('0x21')]=_0xddc403[_0x09dc('0x21')];this[_0x09dc('0x22')]=_0xddc403[_0x09dc('0x22')];this[_0x09dc('0x23')]=_0xddc403['recallme'];this[_0x09dc('0x24')]=_0xddc403['ContactId'];this[_0x09dc('0x25')]=_0xddc403['ListId'];this[_0x09dc('0x26')]=_['isNil'](_0xddc403[_0x09dc('0xb')])?_0xddc403['UserId']:_0xddc403[_0x09dc('0xb')]['id'];this[_0x09dc('0x27')]=_0xddc403[_0x09dc('0x27')];this['originatecalleridnum']='';this[_0x09dc('0x28')]='';}Action[_0x09dc('0x29')][_0x09dc('0x2a')]=function(){return util[_0x09dc('0xd')]('\x22%s\x22\x20<%s>',this[_0x09dc('0x2b')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x668f=['queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','number','exports','util','lodash','isNil','string','uniqueid','idContact'];(function(_0x52991d,_0x429d72){var _0x5b9004=function(_0x4bfe0d){while(--_0x4bfe0d){_0x52991d['push'](_0x52991d['shift']());}};_0x5b9004(++_0x429d72);}(_0x668f,0x1d3));var _0xf668=function(_0x17843e,_0x51c9a2){_0x17843e=_0x17843e-0x0;var _0x1797aa=_0x668f[_0x17843e];return _0x1797aa;};'use strict';var util=require(_0xf668('0x0'));var _=require(_0xf668('0x1'));var moment=require('moment');function checkNameSurname(_0x2cc4b8,_0x1e88fd,_0x519ebe){var _0x379d95='';if(!_[_0xf668('0x2')](_0x1e88fd)&&_0xf668('0x3')===typeof _0x1e88fd){_0x379d95+=_0x1e88fd;}if(!_[_0xf668('0x2')](_0x519ebe)&&_0xf668('0x3')===typeof _0x519ebe){_0x379d95+='\x20'+_0x519ebe;}if(_0x379d95!==''){return _0x379d95;}return _0x2cc4b8;}function Action(_0x5579cd,_0x201079,_0x47b3d3,_0x295eca,_0x1d5592){this[_0xf668('0x4')]=_0x47b3d3||undefined;this[_0xf668('0x5')]=_0x5579cd['id'];this[_0xf668('0x6')]=_0x201079[_0xf668('0x7')];this[_0xf668('0x8')]=_0x201079[_0xf668('0x8')];this[_0xf668('0x9')]='queue';this[_0xf668('0xa')]=![];this[_0xf668('0xb')]=_[_0xf668('0x2')](_0x5579cd[_0xf668('0xc')])?undefined:_0x5579cd[_0xf668('0xc')]['name'];this[_0xf668('0xd')]=this[_0xf668('0xb')]?util['format']('SIP/%s',this[_0xf668('0xb')]):_0x295eca||undefined;this[_0xf668('0xe')]=checkNameSurname(_0x5579cd[_0xf668('0xf')]['phone'],_0x5579cd[_0xf668('0xf')][_0xf668('0x10')],_0x5579cd[_0xf668('0xf')][_0xf668('0x11')]);this[_0xf668('0x12')]=_0x5579cd['active']||![];this['calleridnum']=_0x5579cd[_0xf668('0xf')][_0xf668('0x13')];this[_0xf668('0x14')]=_0x5579cd[_0xf668('0x14')];this[_0xf668('0x15')]=_0x5579cd[_0xf668('0x15')]||0x0;this[_0xf668('0x16')]=_0x5579cd[_0xf668('0x16')]||0x0;this[_0xf668('0x17')]=_0x5579cd[_0xf668('0x17')]||0x0;this[_0xf668('0x18')]=(_0x5579cd[_0xf668('0x15')]||0x0)+(_0x5579cd[_0xf668('0x16')]||0x0)+(_0x5579cd[_0xf668('0x17')]||0x0)+(_0x5579cd['countnosuchnumberretry']||0x0)+(_0x5579cd['countdropretry']||0x0)+(_0x5579cd[_0xf668('0x19')]||0x0)+(_0x5579cd[_0xf668('0x1a')]||0x0)+(_0x5579cd[_0xf668('0x1b')]||0x0);this[_0xf668('0x1c')]=_0x5579cd[_0xf668('0x1c')]||0x0;this[_0xf668('0x1d')]=_0x5579cd[_0xf668('0x1d')]||0x0;this['countabandonedretry']=_0x5579cd[_0xf668('0x19')]||0x0;this[_0xf668('0x1a')]=_0x5579cd['countmachineretry']||0x0;this['countagentrejectretry']=_0x5579cd[_0xf668('0x1b')]||0x0;this['callback']=_0x5579cd['callback'];this['callbackuniqueid']=_0x5579cd[_0xf668('0x1e')];this[_0xf668('0x1f')]=_0x5579cd[_0xf668('0x1f')];this[_0xf668('0x20')]=_0x5579cd[_0xf668('0x20')];this[_0xf668('0x21')]=_0x5579cd['ContactId'];this[_0xf668('0x22')]=_0x5579cd[_0xf668('0x22')];this[_0xf668('0x23')]=_[_0xf668('0x2')](_0x5579cd['Agent'])?_0x5579cd[_0xf668('0x23')]:_0x5579cd[_0xf668('0xc')]['id'];this[_0xf668('0x24')]=_0x5579cd[_0xf668('0x24')];this[_0xf668('0x25')]='';this[_0xf668('0x26')]='';}Action[_0xf668('0x27')]['getCaller']=function(){return util[_0xf668('0x28')]('\x22%s\x22\x20<%s>',this[_0xf668('0xe')],this[_0xf668('0x29')]);};module[_0xf668('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 69b0502..fc3a50a 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 _0x8958=['Busy','custom:agentbusy','busy','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countglobal','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','phone','trim','getCallerId','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','responsetime','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','addVariable','keys','value','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','lodash','ioredis','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','dialMethod','booked','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','actions','queue','pick','UserId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','ANSWER','answertime','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','complete','buildObj','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry'];(function(_0x4f8716,_0x3212a9){var _0x6b8c27=function(_0x433323){while(--_0x433323){_0x4f8716['push'](_0x4f8716['shift']());}};_0x6b8c27(++_0x3212a9);}(_0x8958,0x93));var _0x8895=function(_0x9c6ac9,_0x3d5d4c){_0x9c6ac9=_0x9c6ac9-0x0;var _0x1cba69=_0x8958[_0x9c6ac9];return _0x1cba69;};'use strict';var util=require('util');var _=require(_0x8895('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require(_0x8895('0x1'));var config=require('../../../config/environment');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var loggerAction=require(_0x8895('0x2'))('actionPreview');var ami=require(_0x8895('0x4'));var rpcDb=require(_0x8895('0x5'));var Action=require(_0x8895('0x6'));var ut=require(_0x8895('0x7'));config[_0x8895('0x8')]=_['defaults'](config[_0x8895('0x8')],{'host':_0x8895('0x9'),'port':0x18eb});var io=require(_0x8895('0xa'))(new Redis(config[_0x8895('0x8')]));var Sequence=function(){};Sequence[_0x8895('0xb')][_0x8895('0xc')]=function(_0x22a12b){this[_0x8895('0xd')]=this[_0x8895('0xd')]?this[_0x8895('0xd')]['finally'](_0x22a12b):_0x22a12b();};function Preview(_0x1cf600){this[_0x8895('0xe')]=new Sequence();this[_0x8895('0xf')]=_0x1cf600[_0x8895('0x10')];this[_0x8895('0x11')]=_0x1cf600[_0x8895('0x11')];this['actions']={};this[_0x8895('0x12')]=_0x1cf600[_0x8895('0x12')];this[_0x8895('0x13')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x8895('0x14')](this));ami['on']('hangup',this[_0x8895('0x15')][_0x8895('0x14')](this));ami['on'](_0x8895('0x16'),this[_0x8895('0x17')][_0x8895('0x14')](this));ami['on']('dialend',this[_0x8895('0x18')][_0x8895('0x14')](this));ami['on'](_0x8895('0x19'),this[_0x8895('0x1a')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1b'),this[_0x8895('0x1c')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1d'),this[_0x8895('0x1e')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1f'),this[_0x8895('0x20')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x3daf43,_0x456282,_0x2d189c){io['to'](_0x3daf43)[_0x8895('0x21')](_0x456282,_0x2d189c);}function emitCampaignPreview(_0x3f7d5a){if(_0x3f7d5a[_0x8895('0x22')]===_0x8895('0x23')){var _0xc1ce17={'id':_0x3f7d5a['id'],'name':_0x3f7d5a['name'],'strategy':_0x3f7d5a[_0x8895('0x24')],'answered':_0x3f7d5a[_0x8895('0x25')],'available':_0x3f7d5a[_0x8895('0x26')],'loggedIn':_0x3f7d5a[_0x8895('0x27')],'pTalking':_0x3f7d5a[_0x8895('0x28')],'sumBillable':_0x3f7d5a['sumBillable'],'sumDuration':_0x3f7d5a['sumDuration'],'sumHoldTime':_0x3f7d5a[_0x8895('0x29')]||0x0,'talking':_0x3f7d5a[_0x8895('0x2a')],'total':_0x3f7d5a[_0x8895('0x2b')],'type':_0x3f7d5a[_0x8895('0x22')],'unmanaged':_0x3f7d5a['unmanaged'],'abandoned':_0x3f7d5a[_0x8895('0x2c')],'waiting':_0x3f7d5a[_0x8895('0x2d')],'loggedInDb':_0x3f7d5a[_0x8895('0x2e')],'dialActive':_0x3f7d5a['dialActive'],'dialMethod':_0x3f7d5a['dialMethod'],'dialOriginateCallerIdName':_0x3f7d5a[_0x8895('0x2f')],'dialOriginateCallerIdNumber':_0x3f7d5a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3f7d5a[_0x8895('0x30')],'dialPrefix':_0x3f7d5a[_0x8895('0x31')],'outboundAnswerAgiCallsDay':_0x3f7d5a[_0x8895('0x32')],'outboundAnswerCallsDay':_0x3f7d5a[_0x8895('0x33')],'outboundBlacklistCallsDay':_0x3f7d5a[_0x8895('0x34')],'outboundBusyCallsDay':_0x3f7d5a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3f7d5a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3f7d5a[_0x8895('0x35')],'outboundDropCallsDayCallersExit':_0x3f7d5a[_0x8895('0x36')],'outboundDropCallsDayTimeout':_0x3f7d5a[_0x8895('0x37')],'outboundNoAnswerCallsDay':_0x3f7d5a[_0x8895('0x38')],'outboundNoSuchCallsDay':_0x3f7d5a[_0x8895('0x39')],'outboundOriginateFailureCallsDay':_0x3f7d5a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3f7d5a['outboundReCallsDay'],'outboundRejectCallsDay':_0x3f7d5a[_0x8895('0x3a')],'outboundUnknownCallsDay':_0x3f7d5a[_0x8895('0x3b')],'outboundAbandonedCallsDay':_0x3f7d5a[_0x8895('0x3c')],'predictiveIntervalAnsweredCalls':_0x3f7d5a[_0x8895('0x3d')],'predictiveIntervalAvgHoldtime':_0x3f7d5a[_0x8895('0x3e')],'predictiveIntervalAvgTalktime':_0x3f7d5a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3f7d5a[_0x8895('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x3f7d5a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3f7d5a[_0x8895('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x3f7d5a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3f7d5a[_0x8895('0x41')],'predictiveIntervalMultiplicativeFactor':_0x3f7d5a[_0x8895('0x42')],'predictiveIntervalPauses':_0x3f7d5a[_0x8895('0x43')],'predictiveIntervalAvailable':_0x3f7d5a[_0x8895('0x44')],'predictiveIntervalTotalCalls':_0x3f7d5a[_0x8895('0x45')],'message':_0x3f7d5a['message'],'originated':_0x3f7d5a[_0x8895('0x46')],'erlangCalls':_0x3f7d5a[_0x8895('0x47')],'erlangCallToSecond':_0x3f7d5a[_0x8895('0x48')],'erlangAbandonmentRate':_0x3f7d5a[_0x8895('0x49')],'erlangBusyFactor':_0x3f7d5a[_0x8895('0x4a')],'startPredictive':_0x3f7d5a['startPredictive'],'startProgressive':_0x3f7d5a[_0x8895('0x4b')]};if(_0x3f7d5a['Trunk']){_0xc1ce17[_0x8895('0x4c')]={'id':_0x3f7d5a['Trunk']['id'],'name':_0x3f7d5a[_0x8895('0x4c')][_0x8895('0x4d')],'active':_0x3f7d5a[_0x8895('0x4c')][_0x8895('0x4e')],'callerid':_0x3f7d5a[_0x8895('0x4c')]['callerid']};}if(_0x3f7d5a[_0x8895('0x4f')]){_0xc1ce17['Interval']={'id':_0x3f7d5a[_0x8895('0x4f')]['id'],'name':_0x3f7d5a[_0x8895('0x4f')][_0x8895('0x4d')]};}var _0x9297ea=md5(JSON[_0x8895('0x50')](_0xc1ce17));if(_0x3f7d5a[_0x8895('0x51')]!==_0x9297ea){_0x3f7d5a['md5']=_0x9297ea;emit(util[_0x8895('0x52')](_0x8895('0x53'),_0xc1ce17['name']),_0x8895('0x54'),_0xc1ce17);}}}function emitVoiceQueueChannelRemove(_0x54ca09){logger[_0x8895('0x55')](_0x8895('0x56'),JSON['stringify'](_0x54ca09));emit(util[_0x8895('0x52')](_0x8895('0x53'),_0x54ca09['name']),'voice_queue_channel:remove',_0x54ca09);io[_0x8895('0x21')](_0x8895('0x57'),_0x54ca09);}function notSendMessagesQueue(_0x55aacc){if(_0x55aacc[_0x8895('0x58')]){if(_0x55aacc[_0x8895('0x46')]===0x0&&_0x55aacc['pTalking']===0x0){_0x55aacc[_0x8895('0x58')]=![];_0x55aacc[_0x8895('0x26')]=0x0;_0x55aacc[_0x8895('0x59')]=0x0;_0x55aacc[_0x8895('0x5a')]=_0x8895('0x5b');ut[_0x8895('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x55aacc[_0x8895('0x4d')]+'\x20is\x20not\x20active');}else{_0x55aacc[_0x8895('0x5a')]=_0x8895('0x5d');ut['logger'](_0x8895('0x5e'),_0x55aacc['name']+_0x8895('0x5f'));}emitCampaignPreview(_0x55aacc);}}Preview['prototype']['loopCampaigns']=function(){var _0x51277b=this;setInterval(function(){_0x51277b['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x447ed6=this[_0x8895('0xf')];this['clockClearZombieChannels']+=0x1;for(var _0x4835d7 in _0x447ed6){if(_0x447ed6[_0x8895('0x60')](_0x4835d7)&&(_0x447ed6[_0x4835d7][_0x8895('0x61')]==='preview'||_0x447ed6[_0x4835d7][_0x8895('0x61')]===_0x8895('0x62'))&&_0x447ed6[_0x4835d7][_0x8895('0x22')]===_0x8895('0x23')){if(this[_0x8895('0x13')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x447ed6['hasOwnProperty'](_0x4835d7)&&_0x447ed6[_0x4835d7][_0x8895('0x61')]==='preview'&&_0x447ed6[_0x4835d7][_0x8895('0x22')]===_0x8895('0x23')){if(_0x447ed6[_0x4835d7][_0x8895('0x63')]){this[_0x8895('0x64')](_0x447ed6[_0x4835d7]);if(_0x447ed6[_0x4835d7]['dialPreviewAutoRecallMe'])this[_0x8895('0x65')](_0x447ed6[_0x4835d7]);}else{notSendMessagesQueue(_0x447ed6[_0x4835d7]);}}}};Preview[_0x8895('0xb')][_0x8895('0x66')]=function(_0x167302){var _0x2d585c=this;this[_0x8895('0xe')][_0x8895('0xc')](function(){if(!_[_0x8895('0x67')](_0x2d585c['actions'][_0x167302])){loggerAction[_0x8895('0x55')](_0x8895('0x68'),_0x167302,'Queue',_0x2d585c[_0x8895('0x69')][_0x167302]['queue'],'originated:\x20',JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302]['queue']][_0x8895('0x46')]),'pTalking:\x20',JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]][_0x8895('0x28')]),JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0x69')][_0x167302]['dialAnswer']),JSON['stringify'](_[_0x8895('0x6b')](_0x2d585c[_0x8895('0x69')][_0x167302],['contactId',_0x8895('0x6c'),'VoiceQueueId','ListId'])));return ami[_0x8895('0x6d')]({'action':'status','channel':_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6e')]})[_0x8895('0x6f')](function(_0x459e1a){if(_0x459e1a[_0x8895('0x5a')]===_0x8895('0x70')){setTimeout(function(){if(_0x2d585c[_0x8895('0x69')][_0x167302]){ut[_0x8895('0x71')](_0x2d585c['campaignsPreview'][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]],_0x8895('0x72'));if(_0x2d585c['actions'][_0x167302][_0x8895('0x73')]===!![]){ut[_0x8895('0x74')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]],_0x8895('0x72'));ut[_0x8895('0x75')](_0x8895('0x76')+_0x167302,_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]);}ut['loggerError'](_0x8895('0x77')+_0x167302,_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]);delete _0x2d585c[_0x8895('0x69')][_0x167302];}},0x2328);}});}});};Preview[_0x8895('0xb')]['clearZombieChannels']=function(){var _0x1b3c99=this;loggerAction[_0x8895('0x55')](_0x8895('0x78'),_[_0x8895('0x79')](this[_0x8895('0x69')]));for(var _0x58dd6c in this[_0x8895('0x69')]){if(_0x1b3c99[_0x8895('0x69')][_0x8895('0x60')](_0x58dd6c)){_0x1b3c99['clearZombieChannel'](_0x58dd6c);}}};Preview[_0x8895('0xb')][_0x8895('0x65')]=function(_0x2c777b){var _0x4ec8eb=this;rpcDb[_0x8895('0x7a')](_0x2c777b['id'],ut[_0x8895('0x7b')](this['agents']))[_0x8895('0x7c')](function(_0x26f68c){if(!_['isNil'](_0x26f68c)){for(var _0x2f990a=0x0;_0x2f990a<_0x26f68c[_0x8895('0x7d')];_0x2f990a+=0x1){if(ut[_0x8895('0x7e')](_0x26f68c[_0x2f990a][_0x8895('0x7f')])<_0x2c777b['dialRecallMeTimeout']*0x3c){if(_0x26f68c[_0x2f990a]['Agent']&&!_0x26f68c[_0x2f990a][_0x8895('0x80')][_0x8895('0x81')]){_0x4ec8eb[_0x8895('0x82')](_0x26f68c[_0x2f990a]['id'])['then'](ut[_0x8895('0x83')](_0x8895('0x84')))['catch'](ut[_0x8895('0x83')]('[RecallMe]'));}else{rpcDb[_0x8895('0x85')](_0x26f68c[_0x2f990a]['id']);}}else{var _0x2bd955=new Action(_0x26f68c[_0x2f990a],_0x2c777b);_0x2bd955[_0x8895('0x86')]=moment()[_0x8895('0x52')](_0x8895('0x87'));_0x2c777b['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x2bd955,0x17,_0x8895('0x88'));if(_0x2c777b[_0x8895('0x89')]){rpcDb['rescheduleContactInQueue'](ut[_0x8895('0x8a')](_0x26f68c[_0x2f990a]));rpcDb[_0x8895('0x8b')](_0x2bd955,_0x8895('0x8c'));}else{ut[_0x8895('0x8d')](_0x2bd955,0x16,'RecallFailedTimeout');rpcDb[_0x8895('0x8b')](_0x2bd955,_0x8895('0x8e'));rpcDb[_0x8895('0x8f')](_0x2bd955,_0x8895('0x8e'));}}}}})[_0x8895('0x6f')](ut[_0x8895('0x83')](_0x8895('0x90')));};Preview[_0x8895('0xb')][_0x8895('0x64')]=function(_0x21c7bb){_0x21c7bb[_0x8895('0x58')]=!![];if(ut[_0x8895('0x91')](_0x21c7bb[_0x8895('0x27')])){_0x21c7bb[_0x8895('0x5a')]=_0x8895('0x92');}else if(!ut['isActive'](_0x21c7bb['dialActive'])){_0x21c7bb['message']=_0x8895('0x5b');}else if(!this[_0x8895('0x93')](_0x21c7bb[_0x8895('0x4c')])){if(!this[_0x8895('0x93')](_0x21c7bb[_0x8895('0x94')])){_0x21c7bb['message']=_0x8895('0x95');}else{_0x21c7bb[_0x8895('0x5a')]='ACTIVE';}}else{_0x21c7bb[_0x8895('0x5a')]=_0x8895('0x96');}emitCampaignPreview(_0x21c7bb);};Preview[_0x8895('0xb')][_0x8895('0x97')]=function(_0x3ee89e,_0x526ac9,_0x6440ea){var _0x3c318c=this;var _0x119624=this[_0x8895('0x69')][_0x526ac9];var _0x113ac4=this[_0x8895('0xf')][_0x119624[_0x8895('0x6a')]];var _0x5e7048;if(_0x113ac4){switch(_0x6440ea){case'1':_0x113ac4[_0x8895('0x39')]+=0x1;_0x119624[_0x8895('0x98')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x0,_0x8895('0x9a'));ami[_0x8895('0x21')](_0x8895('0x9b'),ut['buildObj'](_0x119624,_0x8895('0x9c')));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0x9d'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xa0'));}else{if(_0x119624['countnosuchnumberretry']>=_0x113ac4[_0x8895('0xa1')]){rpcDb['createCustomerFinal'](_0x119624,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0x98'),_0x113ac4['dialNoSuchNumberRetryFrequency']),_0x119624[_0x8895('0xa4')],_0x119624['activeContact']);}}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;case _0x8895('0xa6'):var _0x42d342=moment()[_0x8895('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x119624['responsetime']=_0x42d342;_0x119624[_0x8895('0xa7')]=_0x42d342;_0x119624['dialAnswer']=!![];_0x113ac4[_0x8895('0x28')]+=0x1;logger[_0x8895('0x55')]('[syncHangup][talking][increment]',_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],_0x8895('0xaa'),_0x113ac4[_0x8895('0x28')]);ami['emit'](_0x8895('0xab'),ut['buildObj'](_0x119624,'connect',this[_0x8895('0xf')][_0x119624['queue']]));if(_0x113ac4[_0x8895('0xac')]){ami[_0x8895('0x21')](_0x8895('0xad'),ut[_0x8895('0xae')](_0x119624));}break;case'16':ami['emit']('custom:agentcomplete',ut['buildObj'](_0x119624,_0x8895('0xaf'),this[_0x8895('0xf')][_0x119624[_0x8895('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0x8895('0xb0')](_0x119624,_0x8895('0xaf')));_0x113ac4[_0x8895('0x33')]+=0x1;_0x113ac4['total']+=0x1;_0x113ac4[_0x8895('0x25')]+=0x1;ut[_0x8895('0x74')](_0x113ac4,_0x8895('0xb1'));_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut['logCustomer'](_0x119624,0x4,_0x8895('0xb2'));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0xb3'));rpcDb[_0x8895('0x8f')](_0x119624,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8895('0xb4')](_0x119624);_0x113ac4[_0x8895('0xb5')]+=_0x119624['talktime'];_0x113ac4[_0x8895('0xb6')]+=_0x119624[_0x8895('0xb7')];logger[_0x8895('0x55')](_0x8895('0xb8'),_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],'pTalking:\x20',_0x113ac4[_0x8895('0x28')]);delete this['actions'][_0x3ee89e[_0x8895('0xa5')]];break;case _0x8895('0xb9'):_0x113ac4[_0x8895('0xba')]+=0x1;_0x119624[_0x8895('0xbb')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x5,_0x8895('0xbc'));ami[_0x8895('0x21')](_0x8895('0xbd'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xbe')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0xf,'Global');rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xc0'));}else{if(_0x119624[_0x8895('0xbb')]>=_0x113ac4[_0x8895('0xc1')]){rpcDb['createCustomerFinal'](_0x119624,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xbb'),_0x113ac4[_0x8895('0xc2')]),_0x119624[_0x8895('0xa4')],_0x119624['activeContact']);}}break;case _0x8895('0xc3'):_0x113ac4[_0x8895('0x38')]+=0x1;_0x119624['countnoanswerretry']+=0x1;_0x119624[_0x8895('0xc4')]=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x3,_0x8895('0xc5'));ami[_0x8895('0x21')](_0x8895('0xc6'),ut['buildObj'](_0x119624,_0x8895('0xc7')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xc8'));}else{if(_0x119624['countnoanswerretry']>=_0x113ac4['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xc9'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xca'),_0x113ac4[_0x8895('0xcb')]),_0x119624['unlockAgent'],_0x119624[_0x8895('0xcc')]);}}break;case _0x8895('0xcd'):_0x113ac4[_0x8895('0xce')]+=0x1;_0x119624['countcongestionretry']+=0x1;_0x119624['countglobal']=ut['totalGlobal'](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x8,_0x8895('0xcf'));ami[_0x8895('0x21')](_0x8895('0xd0'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xd1')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,'Global');rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xd2'));}else{if(_0x119624[_0x8895('0xd3')]>=_0x113ac4[_0x8895('0xd4')]){rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xd5'));}else{rpcDb[_0x8895('0xa2')](ut['scheduledAt'](_0x119624,_0x8895('0xd3'),_0x113ac4[_0x8895('0xc2')]),_0x119624[_0x8895('0xa4')],_0x119624[_0x8895('0xcc')]);}}break;case _0x8895('0xd6'):_0x113ac4['outboundRejectCallsDay']+=0x1;_0x119624[_0x8895('0xd7')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x14,_0x8895('0xd8'));ami[_0x8895('0x21')](_0x8895('0xd9'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xda')));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xdb'));if(ut['totalGlobal'](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0x14,_0x8895('0xd8'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xdc'));}else{if(_0x119624['countagentrejectretry']>=_0x113ac4[_0x8895('0xdd')]){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xdc'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xd7'),_0x113ac4['dialAgentRejectRetryFrequency']),_0x119624['unlockAgent'],_0x119624[_0x8895('0xcc')]);}}break;case'ABANDONED':_0x113ac4['outboundAbandonedCallsDay']+=0x1;_0x119624[_0x8895('0xde')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0xb,_0x8895('0xdf'));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xe0'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xe0'));}else{if(_0x119624[_0x8895('0xe1')]>=_0x113ac4[_0x8895('0xe2')]){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xe0'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,'countabandonedretry',_0x113ac4[_0x8895('0xe3')]),_0x119624[_0x8895('0xa4')],_0x119624[_0x8895('0xcc')]);}}break;case'18':_0x113ac4[_0x8895('0x3b')]+=0x1;_0x119624[_0x8895('0xe4')]+=0x1;_0x119624[_0x8895('0xc4')]=ut[_0x8895('0x99')](_0x119624);ut['logCustomer'](_0x119624,0x12,_0x3ee89e[_0x8895('0xe5')]||_0x3ee89e[_0x8895('0xe6')]);ami[_0x8895('0x21')](_0x8895('0xe7'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xe8')));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0xe9'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut['cloneAction'](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xe9'));}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;case'19':_0x113ac4[_0x8895('0x3b')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x13,_0x3ee89e[_0x8895('0xe5')]||_0x3ee89e[_0x8895('0xe6')]);ami[_0x8895('0x21')](_0x8895('0xe7'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xe8')));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xea'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xea'));}else{rpcDb[_0x8895('0x8f')](_0x119624,'[callProgressDetectingCustomer][machine]');}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;default:if(_0x119624['dialAnswer']){ut['decrementTalkink'](_0x113ac4,_0x8895('0xeb'));ut['loggerError'](_0x8895('0xec')+_0x113ac4['name'],_0x3ee89e);}_0x113ac4['outboundUnknownCallsDay']+=0x1;_0x119624[_0x8895('0xc4')]=ut['totalGlobal'](_0x119624);ut[_0x8895('0x8d')](_0x119624,0xc,_0x3ee89e['cause-txt']||_0x3ee89e[_0x8895('0xe6')]);rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,'Global');rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xed'));}else{rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xed'));}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];}if(!(_0x119624[_0x8895('0x73')]&&_0x6440ea==='16')){ut[_0x8895('0x71')](_0x113ac4,_0x8895('0xee'));logger[_0x8895('0x55')](_0x8895('0xef'),_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],_0x8895('0xf0'),_0x113ac4['originated']);}if(_0x6440ea!==_0x8895('0xa6')){delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];delete this[_0x8895('0x69')][_0x3ee89e['destlinkedid']];}}};Preview[_0x8895('0xb')][_0x8895('0xf1')]=function(_0xf3b3e5,_0x20752d,_0x124e1b){if(_[_0x8895('0xf2')](_0x20752d)&&_0x8895('0xf3')!==typeof _0x20752d){return;}if(_[_0x8895('0xf2')](_0x124e1b)&&_0x8895('0xf3')!==typeof _0x124e1b){return;}switch(_0x124e1b[_0x8895('0xf4')]){case'0':ut[_0x8895('0xf5')](_0xf3b3e5,0x0,_0x8895('0x9a'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xf7'));break;case'3':ut[_0x8895('0xf5')](_0xf3b3e5,0x3,_0x8895('0xc5'));rpcDb['createAgentHistory'](_0xf3b3e5,_0x8895('0xf8'));break;case'5':ut['logAgent'](_0xf3b3e5,0x5,_0x8895('0xbc'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xf9'));break;case'8':ut['logAgent'](_0xf3b3e5,0x8,_0x8895('0xcf'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8895('0xf5')](_0xf3b3e5,0x16,'AnswerAGI');rpcDb[_0x8895('0xf6')](_0xf3b3e5,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xf3b3e5,0xc,_0x124e1b[_0x8895('0xf4')]);rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xfa'));}ut[_0x8895('0x71')](_0x20752d,_0x8895('0xfb'));logger['info'](_0x8895('0xfc'),_0xf3b3e5['uniqueid'],'\x20Queue',_0x20752d[_0x8895('0x4d')],_0x8895('0xf0'),_0x20752d['originated']);delete this[_0x8895('0x69')][_0xf3b3e5[_0x8895('0xa8')]];};Preview[_0x8895('0xb')]['checkInBlack']=function(_0x3816b4,_0x431b18,_0x114200,_0x54e1b5,_0x465c2b){var _0x34a3c9=this;return new BPromise(function(_0x87bfe4,_0x3a1882){if(_[_0x8895('0x67')](_0x431b18)||_[_0x8895('0x67')](_0x431b18[_0x8895('0xfd')])||_[_0x8895('0x67')](_0x431b18['Contact']['phone'])||_[_0x8895('0x67')](_0x431b18['VoiceQueueId'])){_0x3a1882(ut[_0x8895('0x5a')](_0x8895('0xfe'),_0x54e1b5,_0x465c2b));return;}var _0x270a6e=uuid['v4']();var _0x21d14b=_0x34a3c9[_0x8895('0xf')][_0x431b18[_0x8895('0xff')][_0x8895('0x4d')]];var _0x44951a=_0x114200?_0x34a3c9[_0x8895('0x12')][_0x114200]['id']:undefined;_0x34a3c9[_0x8895('0x69')][_0x270a6e]=new Action(_0x431b18,_0x21d14b,_0x270a6e,_0x114200,_0x44951a);var _0x119bf3=_0x34a3c9[_0x8895('0x69')][_0x270a6e];_0x119bf3['unlockAgent']=_0x54e1b5;_0x119bf3[_0x8895('0xcc')]=_0x465c2b;_0x119bf3[_0x8895('0x100')]=_0x114200;if(_[_0x8895('0x101')](_0x3816b4)){_0x34a3c9[_0x8895('0x102')](_0x119bf3,_0x21d14b,_0x431b18,_0x114200)[_0x8895('0x7c')](function(_0x3c68a9){logger[_0x8895('0x55')](_0x8895('0x103'),_0x8895('0x104')+_0x119bf3[_0x8895('0x6a')]+_0x8895('0x105')+_0x119bf3[_0x8895('0x106')],JSON[_0x8895('0x50')](_0x3c68a9));ami[_0x8895('0x21')]('custom:agentcalled',ut[_0x8895('0xb0')](_0x119bf3,'called',_0x34a3c9['campaignsPreview'][_0x119bf3['queue']]));_0x87bfe4(ut[_0x8895('0x5a')](_0x8895('0x107')));})[_0x8895('0x6f')](function(_0x560732){ut[_0x8895('0x5c')](_0x8895('0x108'),_0x560732);_0x3a1882(ut[_0x8895('0x5a')]('Call\x20failed',_0x54e1b5,_0x465c2b));});}else{_0x21d14b[_0x8895('0x34')]+=0x1;ut[_0x8895('0x109')](_0x119bf3);rpcDb[_0x8895('0x10a')](_0x119bf3,'[Blacklist][error]');delete _0x34a3c9[_0x8895('0x69')][_0x270a6e];_0x3a1882(ut[_0x8895('0x5a')](_0x8895('0x10b'),_0x54e1b5,_0x465c2b));}});};Preview[_0x8895('0xb')][_0x8895('0x93')]=function(_0x3273c1){return!_['isNil'](_0x3273c1)&&!_[_0x8895('0x67')](_0x3273c1[_0x8895('0x4d')])&&!_['isNil'](_0x3273c1[_0x8895('0x4e')])&&_0x3273c1[_0x8895('0x4e')]&&!_[_0x8895('0x67')](this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1[_0x8895('0x4d')])])&&!_[_0x8895('0x67')](this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1['name'])]['status'])&&(this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1[_0x8895('0x4d')])][_0x8895('0x10d')]===_0x8895('0x10e')||this[_0x8895('0x11')][util['format']('SIP/%s',_0x3273c1[_0x8895('0x4d')])][_0x8895('0x10d')]===_0x8895('0x10f'));};Preview[_0x8895('0xb')][_0x8895('0x82')]=function(_0x3b465c,_0x28aeb9){var _0x2ff7e6=this;return new BPromise(function(_0x1be275,_0x8f1f00){_0x2ff7e6['execRun'](_0x3b465c,_0x28aeb9)[_0x8895('0x7c')](function(_0x5033d6){_0x1be275(_[_0x8895('0x6b')](_0x5033d6,[_0x8895('0x5a')]));})[_0x8895('0x6f')](function(_0x5e109c){if(_0x5e109c['unlock']){rpcDb['unlockContact'](_0x3b465c);}if(_0x5e109c[_0x8895('0x4e')]){rpcDb['disableContact'](_0x3b465c);}_0x8f1f00(_[_0x8895('0x6b')](_0x5e109c,[_0x8895('0x5a')]));});});};Preview[_0x8895('0xb')]['execRun']=function(_0x3ccf2a,_0x3a348d){var _0x50136b=this;return new BPromise(function(_0x2bd804,_0x564234){var _0x9ce4f5,_0xa87a01;rpcDb[_0x8895('0x110')](_0x3ccf2a)[_0x8895('0x7c')](function(_0x1d5fd7){if(!_['isNil'](_0x1d5fd7[0x0])){_0xa87a01=_0x1d5fd7[0x0]['recallme']?![]:!![];_0x9ce4f5=_0x1d5fd7[0x0][_0x8895('0x111')]?!![]:![];_0x9ce4f5=_0x3a348d?!![]:_0x9ce4f5;}var _0x41d7f9=_0x50136b[_0x8895('0x112')](_0x1d5fd7);if(_0x41d7f9[_0x8895('0x113')]){rpcDb[_0x8895('0x114')](_[_0x8895('0x6b')](_0x1d5fd7[0x0],['VoiceQueueId','Contact.phone']))[_0x8895('0x7c')](function(_0x3a6226){_0x50136b[_0x8895('0x115')](_0x3a6226,_0x1d5fd7[0x0],_0x3a348d,_0xa87a01,_0x9ce4f5)[_0x8895('0x7c')](function(_0x448496){_0x2bd804(_0x448496);})['catch'](function(_0x50baed){_0x564234(_0x50baed);});})[_0x8895('0x6f')](function(_0x4f0a55){ut['logger'](_0x8895('0x116'),_0x4f0a55);_0x564234(ut[_0x8895('0x5a')]('Call\x20unsuccessful',_0xa87a01,_0x9ce4f5));});}else{_0x564234(ut[_0x8895('0x5a')](_0x41d7f9['message'],_0xa87a01,_0x9ce4f5));}})[_0x8895('0x6f')](function(_0x242a19){ut[_0x8895('0x5c')](_0x8895('0x117'),_0x242a19);_0x564234(ut[_0x8895('0x5a')](_0x8895('0x118'),![],!![]));});});};Preview['prototype'][_0x8895('0x112')]=function(_0x3ecc83){if(_[_0x8895('0x67')](_0x3ecc83)||_[_0x8895('0x101')](_0x3ecc83)||!_[_0x8895('0x67')](_0x3ecc83[0x0][_0x8895('0x80')])&&_['isNil'](_0x3ecc83[0x0][_0x8895('0x80')][_0x8895('0x4d')])){ut[_0x8895('0x5c')](_0x8895('0x119'),_0x3ecc83);return{'isValid':![],'message':_0x8895('0x11a')};}var _0x57230f=this['campaignsPreview'][_0x3ecc83[0x0]['Queue'][_0x8895('0x4d')]];_0x57230f[_0x8895('0x5a')]=_0x8895('0x96');if(_['isNil'](_0x57230f)){ut['logger'](_0x8895('0x11b'),_0x57230f);return{'isValid':![],'message':_0x8895('0x11c')};}if(!this[_0x8895('0x93')](_0x57230f[_0x8895('0x4c')])){ut[_0x8895('0x5c')](_0x8895('0x11d'),'campaign\x20Name:\x20'+_0x57230f['name']+_0x8895('0x11e'));if(!this[_0x8895('0x93')](_0x57230f['TrunkBackup'])){ut[_0x8895('0x5c')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x57230f['name']+_0x8895('0x11f'));return{'isValid':![],'message':_0x8895('0x120')};}}if(!ut[_0x8895('0x121')](_0x57230f['dialActive'])){ut[_0x8895('0x5c')]('[Preview][validateContact][Campaign\x20Active]',_0x57230f[_0x8895('0x4d')]+_0x8895('0x122'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x57230f[_0x8895('0x4d')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8895('0x123')};};Preview[_0x8895('0xb')][_0x8895('0x102')]=function(_0x20f05c,_0x5eca7f,_0x4036ab,_0x4bf06a){var _0x2f2490=this;return new BPromise(function(_0x28506a,_0x30baea){var _0x2ecc8b=_0x20f05c[_0x8895('0xa8')];var _0x1f5eb7=_0x2f2490[_0x8895('0x93')](_0x5eca7f[_0x8895('0x4c')])?util[_0x8895('0x52')](_0x8895('0x124'),_0x5eca7f[_0x8895('0x4c')]['name'],_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x31')])?'':_0x5eca7f[_0x8895('0x31')]['trim']()||'',_0x5eca7f[_0x8895('0x125')]>0x0?_0x4036ab[_0x8895('0xfd')]['phone'][_0x8895('0x126')](_0x5eca7f[_0x8895('0x125')]):_0x4036ab[_0x8895('0xfd')][_0x8895('0x127')]):util[_0x8895('0x52')](_0x8895('0x124'),_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x94')])?_0x5eca7f[_0x8895('0x4c')]['name']:_0x5eca7f['TrunkBackup'][_0x8895('0x4d')],_['isNil'](_0x5eca7f[_0x8895('0x31')])?'':_0x5eca7f[_0x8895('0x31')][_0x8895('0x128')]()||'',_0x5eca7f['dialCutDigit']>0x0?_0x4036ab[_0x8895('0xfd')]['phone'][_0x8895('0x126')](_0x5eca7f[_0x8895('0x125')]):_0x4036ab['Contact'][_0x8895('0x127')]);var _0x30e5a2=_0x2f2490[_0x8895('0x93')](_0x5eca7f[_0x8895('0x4c')])?ut[_0x8895('0x129')](_0x5eca7f['Trunk'][_0x8895('0x12a')],_0x5eca7f[_0x8895('0x2f')],_0x5eca7f['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x5eca7f[_0x8895('0x12b')],_0x5eca7f['dialRandomLastDigitCallerIdNumber']):_0x5eca7f[_0x8895('0x12b')]):ut[_0x8895('0x129')](_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x94')])?_0x5eca7f[_0x8895('0x4c')][_0x8895('0x12a')]:_0x5eca7f['TrunkBackup'][_0x8895('0x12a')],_0x5eca7f[_0x8895('0x2f')],_0x5eca7f[_0x8895('0x12c')]>0x0?ut[_0x8895('0x12d')](_0x5eca7f[_0x8895('0x12b')],_0x5eca7f[_0x8895('0x12c')]):_0x5eca7f[_0x8895('0x12b')]);if(_0x30e5a2){_0x20f05c['originatecalleridname']=ut['extractCalleridName'](_0x30e5a2);_0x20f05c[_0x8895('0x12e')]=ut[_0x8895('0x12f')](_0x30e5a2);}var _0x43523c=ut[_0x8895('0x130')](_0x5eca7f,_0x4036ab,_0x1f5eb7,_0x30e5a2,_0x2ecc8b,_0x20f05c);_['merge'](_0x20f05c,ut['toLowerVariables'](_0x43523c));_0x20f05c[_0x8895('0x86')]=moment()[_0x8895('0x52')](_0x8895('0x87'));ami[_0x8895('0x6d')](ut[_0x8895('0x131')](_0x20f05c,_0x5eca7f,_0x43523c,_0x20f05c[_0x8895('0xcc')],_0x4bf06a))['then'](function(_0x4c4148){_0x5eca7f[_0x8895('0x46')]+=0x1;logger[_0x8895('0x55')](_0x8895('0x132'),_0x2ecc8b,_0x8895('0xa9'),_0x5eca7f[_0x8895('0x4d')],_0x8895('0xf0'),_0x5eca7f[_0x8895('0x46')]);_0x28506a(_0x4c4148);})[_0x8895('0x6f')](function(_0x18a523){ut['logAgent'](_0x20f05c,0xe,_0x8895('0x133'));rpcDb[_0x8895('0xf6')](_0x20f05c,'[originateFailure][logOriginateFailure]');_0x30baea(_0x18a523);});});};Preview[_0x8895('0xb')][_0x8895('0x1a')]=function(_0x3ff7fa){if(this[_0x8895('0x69')][_0x3ff7fa[_0x8895('0xa5')]]){this[_0x8895('0x69')][_0x3ff7fa[_0x8895('0xa5')]][_0x8895('0x6e')]=_0x3ff7fa['channel'];}};Preview['prototype'][_0x8895('0x134')]=function(_0xc93e09){var _0x398041=this;var _0xc35be9=this[_0x8895('0x69')][_0xc93e09[_0x8895('0x135')]];if(_0xc35be9){if(_0xc35be9['lookAgent']&&this[_0x8895('0x12')][_0xc35be9[_0x8895('0x100')]]){ut[_0x8895('0x136')](_0xc35be9,this['agents'][_0xc35be9[_0x8895('0x100')]][_0x8895('0x4d')],this[_0x8895('0x12')][_0xc35be9['lookAgent']]['id']);}var _0x1a62b4=_['clone'](_0xc35be9);_0x1a62b4[_0x8895('0x137')]=moment()[_0x8895('0x52')](_0x8895('0x87'));var _0x447dc0=_0x398041[_0x8895('0xf')][_0xc35be9['queue']];if(ut['isFailure'](_0xc93e09[_0x8895('0x138')])){if(_0xc35be9['unlockAgent']){rpcDb[_0x8895('0x139')](_0xc35be9[_0x8895('0x106')]);}if(_0xc35be9[_0x8895('0xcc')]){rpcDb[_0x8895('0x85')](_0xc35be9[_0x8895('0x106')]);}ami[_0x8895('0x21')](_0x8895('0x13a'),ut[_0x8895('0xb0')](_0xc35be9,'rejected',this[_0x8895('0xf')][_0xc35be9[_0x8895('0x6a')]]));this[_0x8895('0xf1')](_0x1a62b4,_0x447dc0,_0xc93e09);}else{_0xc35be9['starttime']=moment()[_0x8895('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8895('0xf5')](_0x1a62b4,0x4,_0x8895('0xb2'));rpcDb[_0x8895('0xf6')](_0x1a62b4,_0x8895('0x13b'));}}};Preview[_0x8895('0xb')][_0x8895('0x15')]=function(_0x55d290){var _0x1186fa=this;var _0x466d3a=this[_0x8895('0x69')][_0x55d290['linkedid']];var _0x268d3c;if(_0x466d3a){_0x268d3c=this['campaignsPreview'][_0x466d3a[_0x8895('0x6a')]];logger[_0x8895('0x55')](_0x8895('0x13c'),_0x55d290[_0x8895('0xa5')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],_0x8895('0xaa'),_0x268d3c[_0x8895('0x28')]);}if(this[_0x8895('0x69')][_0x55d290[_0x8895('0xa5')]]&&_0x55d290[_0x8895('0xa5')]!==_0x55d290['uniqueid']){if(_0x55d290['cause']==='16'&&this[_0x8895('0x69')][_0x55d290[_0x8895('0xa5')]][_0x8895('0x73')]){this['callProgressDetectingCustomer'](_0x55d290,_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')]);}else if(this['actions'][_0x55d290[_0x8895('0xa5')]]['dialAnswer']){logger[_0x8895('0x55')](_0x8895('0x13e'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],'pTalking:\x20',_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')]);}}else if(_0x466d3a&&_[_0x8895('0x67')](_0x466d3a[_0x8895('0x13f')])&&_0x268d3c[_0x8895('0x140')]&&_0x55d290[_0x8895('0xa5')]===_0x55d290['uniqueid']&&_[_0x8895('0x67')](_0x55d290[_0x8895('0xf4')])&&_0x55d290[_0x8895('0x13d')]==='16'&&_0x55d290[_0x8895('0x141')]==='6'&&_[_0x8895('0xf2')](_0x466d3a[_0x8895('0x142')])){if(_0x466d3a['unlockAgent']){rpcDb['unlockContact'](_0x466d3a[_0x8895('0x106')]);}if(_0x466d3a[_0x8895('0xcc')]){rpcDb[_0x8895('0x85')](_0x466d3a[_0x8895('0x106')]);}_0x55d290[_0x8895('0xf4')]='22';this[_0x8895('0xf1')](_0x466d3a,_0x268d3c,_0x55d290);}else if(_0x466d3a&&_0x466d3a[_0x8895('0x142')]){if(_0x55d290['cause']==='16'&&this['actions'][_0x55d290[_0x8895('0xa5')]]['dialAnswer']){logger[_0x8895('0x55')](_0x8895('0x143'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],'\x20Queue',_0x268d3c[_0x8895('0x4d')],_0x8895('0xaa'),_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290['linkedid'],_0x55d290[_0x8895('0x13d')]);}else if(this[_0x8895('0x69')][_0x55d290['linkedid']][_0x8895('0x73')]){logger[_0x8895('0x55')](_0x8895('0x13e'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],'pTalking:\x20',_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290['linkedid'],_0x55d290[_0x8895('0x13d')]);}}};Preview[_0x8895('0xb')]['syncDialEnd']=function(_0x4c4240){if(this[_0x8895('0x69')][_0x4c4240[_0x8895('0x144')]]&&_0x4c4240[_0x8895('0x144')]!==_0x4c4240[_0x8895('0x145')]){this[_0x8895('0x97')](_0x4c4240,_0x4c4240[_0x8895('0x144')],_0x4c4240[_0x8895('0xe6')]);}};Preview[_0x8895('0xb')]['syncHangupRequest']=function(_0x28ec87){if(this['actions'][_0x28ec87[_0x8895('0xa5')]]&&_0x28ec87[_0x8895('0xa5')]!==_0x28ec87[_0x8895('0xa8')]&&!this[_0x8895('0x69')][_0x28ec87[_0x8895('0xa5')]]['dialAnswer']){if(_0x28ec87[_0x8895('0x13d')]==='1'){this[_0x8895('0x97')](_0x28ec87,_0x28ec87[_0x8895('0xa5')],_0x28ec87[_0x8895('0x13d')]);}}};Preview[_0x8895('0xb')]['addVariable']=function(_0x419702,_0x3a7d70,_0x4b937f){if(this['actions'][_0x419702]){if(_[_0x8895('0x67')](this[_0x8895('0x69')][_0x419702][_0x8895('0x146')])){this[_0x8895('0x69')][_0x419702][_0x8895('0x146')]={};}this[_0x8895('0x69')][_0x419702][_0x8895('0x146')][_0x3a7d70]=_0x4b937f;}};Preview['prototype'][_0x8895('0x1c')]=function(_0x49928b){try{if(!_[_0x8895('0x67')](_0x49928b)){if(ut[_0x8895('0x147')](_['keys'](_0x49928b['variable'])[0x0])){this[_0x8895('0x148')](_0x49928b[_0x8895('0xa8')],_[_0x8895('0x149')](_0x49928b['variable'])[0x0],_0x49928b[_0x8895('0x14a')]);}}}catch(_0x47837c){logger['error'](_0x8895('0x14b'),util[_0x8895('0x14c')](_0x47837c,{'showHidden':![],'depth':null}));}};Preview[_0x8895('0xb')][_0x8895('0x1e')]=function(_0x592e3b){if(_0x592e3b){if(this[_0x8895('0x69')][_0x592e3b['transfertargetlinkedid']]){this[_0x8895('0x69')][_0x592e3b['transfertargetlinkedid']][_0x8895('0x142')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0xe5a83a){if(_0xe5a83a){if(this[_0x8895('0x69')][_0xe5a83a[_0x8895('0x14d')]]){this[_0x8895('0x69')][_0xe5a83a[_0x8895('0x14d')]][_0x8895('0x142')]=!![];}}};module[_0x8895('0x14e')]=Preview; \ No newline at end of file +var _0x5c12=['[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','execCall','trim','phone','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','isFailure','idContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','defaults','redis','localhost','socket.io-emitter','enqueue','tail','sequence','voiceQueues','trunks','actions','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','newexten','varset','attendedtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','prototype','syncCampaigns','clockClearZombieChannels','clearZombieChannels','outbound','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','ListId','Action','channel','catch','No\x20such\x20channel','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','hasOwnProperty','getContactRecallMe','agentReadyId','agents','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','buildAcw','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','pick','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive'];(function(_0xc4f56f,_0xb72ae5){var _0x5da108=function(_0x24afc5){while(--_0x24afc5){_0xc4f56f['push'](_0xc4f56f['shift']());}};_0x5da108(++_0xb72ae5);}(_0x5c12,0x188));var _0x25c1=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x5c12[_0x5ef55a];return _0x20ae40;};'use strict';var util=require('util');var _=require(_0x25c1('0x0'));var BPromise=require(_0x25c1('0x1'));var uuid=require('uuid');var moment=require(_0x25c1('0x2'));var md5=require(_0x25c1('0x3'));var Redis=require(_0x25c1('0x4'));var config=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var loggerAction=require(_0x25c1('0x6'))('actionPreview');var ami=require(_0x25c1('0x8'));var rpcDb=require(_0x25c1('0x9'));var Action=require(_0x25c1('0xa'));var ut=require('./util/util');config['redis']=_[_0x25c1('0xb')](config[_0x25c1('0xc')],{'host':_0x25c1('0xd'),'port':0x18eb});var io=require(_0x25c1('0xe'))(new Redis(config[_0x25c1('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x25c1('0xf')]=function(_0x41c89d){this[_0x25c1('0x10')]=this[_0x25c1('0x10')]?this[_0x25c1('0x10')]['finally'](_0x41c89d):_0x41c89d();};function Preview(_0x196e2f){this[_0x25c1('0x11')]=new Sequence();this['campaignsPreview']=_0x196e2f[_0x25c1('0x12')];this[_0x25c1('0x13')]=_0x196e2f[_0x25c1('0x13')];this[_0x25c1('0x14')]={};this['agents']=_0x196e2f['agents'];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x25c1('0x15')][_0x25c1('0x16')](this));ami['on'](_0x25c1('0x17'),this[_0x25c1('0x18')][_0x25c1('0x16')](this));ami['on']('hanguprequest',this[_0x25c1('0x19')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0x25c1('0x16')](this));ami['on'](_0x25c1('0x1a'),this['syncNewExten']['bind'](this));ami['on'](_0x25c1('0x1b'),this['syncVarSet'][_0x25c1('0x16')](this));ami['on'](_0x25c1('0x1c'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x25c1('0x1d')][_0x25c1('0x16')](this));this[_0x25c1('0x1e')](this[_0x25c1('0x1f')]);}function emit(_0x481c12,_0x119639,_0x9f54e3){io['to'](_0x481c12)[_0x25c1('0x20')](_0x119639,_0x9f54e3);}function emitCampaignPreview(_0x29e637){if(_0x29e637['type']==='outbound'){var _0x2a8a84={'id':_0x29e637['id'],'name':_0x29e637[_0x25c1('0x21')],'strategy':_0x29e637[_0x25c1('0x22')],'answered':_0x29e637[_0x25c1('0x23')],'available':_0x29e637[_0x25c1('0x24')],'loggedIn':_0x29e637[_0x25c1('0x25')],'pTalking':_0x29e637[_0x25c1('0x26')],'sumBillable':_0x29e637[_0x25c1('0x27')],'sumDuration':_0x29e637[_0x25c1('0x28')],'sumHoldTime':_0x29e637[_0x25c1('0x29')]||0x0,'talking':_0x29e637[_0x25c1('0x2a')],'total':_0x29e637[_0x25c1('0x2b')],'type':_0x29e637[_0x25c1('0x2c')],'unmanaged':_0x29e637['unmanaged'],'abandoned':_0x29e637[_0x25c1('0x2d')],'waiting':_0x29e637[_0x25c1('0x2e')],'loggedInDb':_0x29e637[_0x25c1('0x2f')],'dialActive':_0x29e637[_0x25c1('0x30')],'dialMethod':_0x29e637[_0x25c1('0x31')],'dialOriginateCallerIdName':_0x29e637[_0x25c1('0x32')],'dialOriginateCallerIdNumber':_0x29e637['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x29e637[_0x25c1('0x33')],'dialPrefix':_0x29e637[_0x25c1('0x34')],'outboundAnswerAgiCallsDay':_0x29e637[_0x25c1('0x35')],'outboundAnswerCallsDay':_0x29e637[_0x25c1('0x36')],'outboundBlacklistCallsDay':_0x29e637[_0x25c1('0x37')],'outboundBusyCallsDay':_0x29e637[_0x25c1('0x38')],'outboundCongestionCallsDay':_0x29e637['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x29e637[_0x25c1('0x39')],'outboundDropCallsDayCallersExit':_0x29e637['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x29e637[_0x25c1('0x3a')],'outboundNoAnswerCallsDay':_0x29e637[_0x25c1('0x3b')],'outboundNoSuchCallsDay':_0x29e637[_0x25c1('0x3c')],'outboundOriginateFailureCallsDay':_0x29e637[_0x25c1('0x3d')],'outboundReCallsDay':_0x29e637[_0x25c1('0x3e')],'outboundRejectCallsDay':_0x29e637[_0x25c1('0x3f')],'outboundUnknownCallsDay':_0x29e637[_0x25c1('0x40')],'outboundAbandonedCallsDay':_0x29e637[_0x25c1('0x41')],'predictiveIntervalAnsweredCalls':_0x29e637[_0x25c1('0x42')],'predictiveIntervalAvgHoldtime':_0x29e637['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x29e637[_0x25c1('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x29e637['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x29e637['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x29e637[_0x25c1('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x29e637[_0x25c1('0x45')],'predictiveIntervalHitRate':_0x29e637['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x29e637[_0x25c1('0x46')],'predictiveIntervalPauses':_0x29e637['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x29e637[_0x25c1('0x47')],'predictiveIntervalTotalCalls':_0x29e637['predictiveIntervalTotalCalls'],'message':_0x29e637[_0x25c1('0x48')],'originated':_0x29e637[_0x25c1('0x49')],'erlangCalls':_0x29e637[_0x25c1('0x4a')],'erlangCallToSecond':_0x29e637[_0x25c1('0x4b')],'erlangAbandonmentRate':_0x29e637[_0x25c1('0x4c')],'erlangBusyFactor':_0x29e637[_0x25c1('0x4d')],'startPredictive':_0x29e637[_0x25c1('0x4e')],'startProgressive':_0x29e637[_0x25c1('0x4f')]};if(_0x29e637['Trunk']){_0x2a8a84[_0x25c1('0x50')]={'id':_0x29e637['Trunk']['id'],'name':_0x29e637[_0x25c1('0x50')]['name'],'active':_0x29e637[_0x25c1('0x50')][_0x25c1('0x51')],'callerid':_0x29e637[_0x25c1('0x50')][_0x25c1('0x52')]};}if(_0x29e637[_0x25c1('0x53')]){_0x2a8a84[_0x25c1('0x53')]={'id':_0x29e637[_0x25c1('0x53')]['id'],'name':_0x29e637[_0x25c1('0x53')][_0x25c1('0x21')]};}var _0x2d060c=md5(JSON[_0x25c1('0x54')](_0x2a8a84));if(_0x29e637[_0x25c1('0x3')]!==_0x2d060c){_0x29e637[_0x25c1('0x3')]=_0x2d060c;emit(util[_0x25c1('0x55')](_0x25c1('0x56'),_0x2a8a84[_0x25c1('0x21')]),_0x25c1('0x57'),_0x2a8a84);}}}function emitVoiceQueueChannelRemove(_0x30b1d7){logger[_0x25c1('0x58')](_0x25c1('0x59'),JSON['stringify'](_0x30b1d7));emit(util[_0x25c1('0x55')](_0x25c1('0x56'),_0x30b1d7['name']),_0x25c1('0x5a'),_0x30b1d7);io['emit'](_0x25c1('0x5b'),_0x30b1d7);}function notSendMessagesQueue(_0x4f978c){if(_0x4f978c[_0x25c1('0x5c')]){if(_0x4f978c[_0x25c1('0x49')]===0x0&&_0x4f978c[_0x25c1('0x26')]===0x0){_0x4f978c[_0x25c1('0x5c')]=![];_0x4f978c[_0x25c1('0x24')]=0x0;_0x4f978c['paused']=0x0;_0x4f978c[_0x25c1('0x48')]='NOT_ACTIVE';ut[_0x25c1('0x5d')](_0x25c1('0x5e'),_0x4f978c[_0x25c1('0x21')]+_0x25c1('0x5f'));}else{_0x4f978c['message']='IS_DISACTIVED';ut['logger'](_0x25c1('0x5e'),_0x4f978c[_0x25c1('0x21')]+'\x20is\x20disactive');}emitCampaignPreview(_0x4f978c);}}Preview[_0x25c1('0x60')]['loopCampaigns']=function(){var _0x3d5172=this;setInterval(function(){_0x3d5172[_0x25c1('0x61')]();},0x7cf);};Preview[_0x25c1('0x60')]['syncCampaigns']=function(){var _0x5502c1=this['campaignsPreview'];this[_0x25c1('0x62')]+=0x1;for(var _0x3cf9c0 in _0x5502c1){if(_0x5502c1['hasOwnProperty'](_0x3cf9c0)&&(_0x5502c1[_0x3cf9c0][_0x25c1('0x31')]===_0x25c1('0x7')||_0x5502c1[_0x3cf9c0][_0x25c1('0x31')]==='booked')&&_0x5502c1[_0x3cf9c0]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x25c1('0x62')]=0x0;this[_0x25c1('0x63')]();}}if(_0x5502c1['hasOwnProperty'](_0x3cf9c0)&&_0x5502c1[_0x3cf9c0][_0x25c1('0x31')]===_0x25c1('0x7')&&_0x5502c1[_0x3cf9c0][_0x25c1('0x2c')]===_0x25c1('0x64')){if(_0x5502c1[_0x3cf9c0][_0x25c1('0x30')]){this[_0x25c1('0x65')](_0x5502c1[_0x3cf9c0]);if(_0x5502c1[_0x3cf9c0][_0x25c1('0x66')])this['recallMe'](_0x5502c1[_0x3cf9c0]);}else{notSendMessagesQueue(_0x5502c1[_0x3cf9c0]);}}}};Preview['prototype'][_0x25c1('0x67')]=function(_0x43d96a){var _0x389547=this;this['sequence'][_0x25c1('0xf')](function(){if(!_[_0x25c1('0x68')](_0x389547[_0x25c1('0x14')][_0x43d96a])){loggerAction[_0x25c1('0x58')]('[clearZombieChannels][talking]',_0x43d96a,_0x25c1('0x69'),_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6a')],_0x25c1('0x6b'),JSON['stringify'](_0x389547['campaignsPreview'][_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6a')]][_0x25c1('0x49')]),_0x25c1('0x6c'),JSON['stringify'](_0x389547[_0x25c1('0x1f')][_0x389547[_0x25c1('0x14')][_0x43d96a]['queue']][_0x25c1('0x26')]),JSON[_0x25c1('0x54')](_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6d')]),JSON['stringify'](_['pick'](_0x389547[_0x25c1('0x14')][_0x43d96a],[_0x25c1('0x6e'),_0x25c1('0x6f'),'VoiceQueueId',_0x25c1('0x70')])));return ami[_0x25c1('0x71')]({'action':'status','channel':_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x72')]})[_0x25c1('0x73')](function(_0x2b3bcb){if(_0x2b3bcb[_0x25c1('0x48')]===_0x25c1('0x74')){setTimeout(function(){if(_0x389547[_0x25c1('0x14')][_0x43d96a]){ut['updateOriginated'](_0x389547['campaignsPreview'][_0x389547['actions'][_0x43d96a][_0x25c1('0x6a')]],'[clearZombieChannel]');if(_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6d')]===!![]){ut[_0x25c1('0x75')](_0x389547[_0x25c1('0x1f')][_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6a')]],'[clearZombieChannel]');ut[_0x25c1('0x76')](_0x25c1('0x77')+_0x43d96a,_0x389547[_0x25c1('0x14')][_0x43d96a][_0x25c1('0x6a')]);}ut[_0x25c1('0x76')](_0x25c1('0x78')+_0x43d96a,_0x389547['actions'][_0x43d96a][_0x25c1('0x6a')]);delete _0x389547[_0x25c1('0x14')][_0x43d96a];}},0x2328);}});}});};Preview[_0x25c1('0x60')][_0x25c1('0x63')]=function(){var _0x6b2ebc=this;loggerAction['info'](_0x25c1('0x79'),_[_0x25c1('0x7a')](this['actions']));for(var _0x1341d2 in this[_0x25c1('0x14')]){if(_0x6b2ebc[_0x25c1('0x14')][_0x25c1('0x7b')](_0x1341d2)){_0x6b2ebc[_0x25c1('0x67')](_0x1341d2);}}};Preview[_0x25c1('0x60')]['recallMe']=function(_0x20ff17){var _0x381804=this;rpcDb[_0x25c1('0x7c')](_0x20ff17['id'],ut[_0x25c1('0x7d')](this[_0x25c1('0x7e')]))[_0x25c1('0x7f')](function(_0x2745b6){if(!_[_0x25c1('0x68')](_0x2745b6)){for(var _0x321833=0x0;_0x321833<_0x2745b6[_0x25c1('0x80')];_0x321833+=0x1){if(ut[_0x25c1('0x81')](_0x2745b6[_0x321833][_0x25c1('0x82')])<_0x20ff17[_0x25c1('0x83')]*0x3c){if(_0x2745b6[_0x321833][_0x25c1('0x84')]&&!_0x2745b6[_0x321833]['Agent'][_0x25c1('0x85')]){_0x381804[_0x25c1('0x86')](_0x2745b6[_0x321833]['id'])[_0x25c1('0x7f')](ut[_0x25c1('0x87')](_0x25c1('0x88')))[_0x25c1('0x73')](ut[_0x25c1('0x87')]('[RecallMe]'));}else{rpcDb[_0x25c1('0x89')](_0x2745b6[_0x321833]['id']);}}else{var _0x571d1a=new Action(_0x2745b6[_0x321833],_0x20ff17);_0x571d1a[_0x25c1('0x8a')]=moment()[_0x25c1('0x55')](_0x25c1('0x8b'));_0x20ff17[_0x25c1('0x3e')]+=0x1;ut[_0x25c1('0x8c')](_0x571d1a,0x17,_0x25c1('0x8d'));if(_0x20ff17[_0x25c1('0x8e')]){rpcDb[_0x25c1('0x8f')](ut['createBody'](_0x2745b6[_0x321833]));rpcDb[_0x25c1('0x90')](_0x571d1a,_0x25c1('0x91'));}else{ut[_0x25c1('0x8c')](_0x571d1a,0x16,_0x25c1('0x92'));rpcDb[_0x25c1('0x90')](_0x571d1a,_0x25c1('0x93'));rpcDb[_0x25c1('0x94')](_0x571d1a,'[HistoryRecallClose]');}}}}})[_0x25c1('0x73')](ut['logger2']('[getContactRecallMe]'));};Preview['prototype'][_0x25c1('0x65')]=function(_0x4b1ead){_0x4b1ead[_0x25c1('0x5c')]=!![];if(ut[_0x25c1('0x95')](_0x4b1ead[_0x25c1('0x25')])){_0x4b1ead['message']=_0x25c1('0x96');}else if(!ut['isActive'](_0x4b1ead[_0x25c1('0x30')])){_0x4b1ead[_0x25c1('0x48')]=_0x25c1('0x97');}else if(!this[_0x25c1('0x98')](_0x4b1ead[_0x25c1('0x50')])){if(!this[_0x25c1('0x98')](_0x4b1ead[_0x25c1('0x99')])){_0x4b1ead['message']=_0x25c1('0x9a');}else{_0x4b1ead[_0x25c1('0x48')]=_0x25c1('0x9b');}}else{_0x4b1ead[_0x25c1('0x48')]=_0x25c1('0x9b');}emitCampaignPreview(_0x4b1ead);};Preview[_0x25c1('0x60')]['callProgressDetectingCustomer']=function(_0x2482df,_0x4c19d7,_0x26a9d9){var _0x4ff3e6=this;var _0x588b5f=this[_0x25c1('0x14')][_0x4c19d7];var _0x58fd37=this['campaignsPreview'][_0x588b5f['queue']];var _0x50bd38;if(_0x58fd37){switch(_0x26a9d9){case'1':_0x58fd37[_0x25c1('0x3c')]+=0x1;_0x588b5f['countnosuchnumberretry']+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0x0,_0x25c1('0x9e'));ami['emit']('custom:agentnosuchnumber',ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xa0')));rpcDb['createCustomerHistory'](_0x588b5f,_0x25c1('0xa1'));if(ut[_0x25c1('0x9d')](_0x588b5f)>=_0x58fd37[_0x25c1('0xa2')]){_0x50bd38=ut['cloneAction'](_0x588b5f,0xf,_0x25c1('0xa3'));rpcDb['createCustomerFinal'](_0x50bd38,_0x25c1('0xa4'));}else{if(_0x588b5f[_0x25c1('0xa5')]>=_0x58fd37[_0x25c1('0xa6')]){rpcDb['createCustomerFinal'](_0x588b5f,_0x25c1('0xa4'));}else{rpcDb[_0x25c1('0xa7')](ut[_0x25c1('0xa8')](_0x588b5f,'countnosuchnumberretry',_0x58fd37[_0x25c1('0xa9')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f[_0x25c1('0xab')]);}}delete this[_0x25c1('0x14')][_0x2482df[_0x25c1('0xac')]];break;case _0x25c1('0xad'):var _0xbcffa=moment()[_0x25c1('0x55')](_0x25c1('0x8b'));_0x588b5f[_0x25c1('0xae')]=_0xbcffa;_0x588b5f[_0x25c1('0xaf')]=_0xbcffa;_0x588b5f[_0x25c1('0x6d')]=!![];_0x58fd37[_0x25c1('0x26')]+=0x1;logger[_0x25c1('0x58')]('[syncHangup][talking][increment]',_0x588b5f[_0x25c1('0xb0')],_0x25c1('0xb1'),_0x58fd37[_0x25c1('0x21')],_0x25c1('0x6c'),_0x58fd37[_0x25c1('0x26')]);ami[_0x25c1('0x20')](_0x25c1('0xb2'),ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xb3'),this[_0x25c1('0x1f')][_0x588b5f[_0x25c1('0x6a')]]));if(_0x58fd37['acw']){ami[_0x25c1('0x20')]('custom:agentConnectPreview',ut[_0x25c1('0xb4')](_0x588b5f));}break;case'16':ami[_0x25c1('0x20')]('custom:agentcomplete',ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xb5'),this[_0x25c1('0x1f')][_0x588b5f['queue']]));emitVoiceQueueChannelRemove(ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xb5')));_0x58fd37['outboundAnswerCallsDay']+=0x1;_0x58fd37[_0x25c1('0x2b')]+=0x1;_0x58fd37[_0x25c1('0x23')]+=0x1;ut[_0x25c1('0x75')](_0x58fd37,'[16]');_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0x4,_0x25c1('0xb6'));rpcDb['createCustomerHistory'](_0x588b5f,_0x25c1('0xb7'));rpcDb['createCustomerFinal'](_0x588b5f,_0x25c1('0xb8'));rpcDb[_0x25c1('0xb9')](_0x588b5f);_0x58fd37['sumDuration']+=_0x588b5f[_0x25c1('0xba')];_0x58fd37['sumBillable']+=_0x588b5f[_0x25c1('0xba')];logger[_0x25c1('0x58')](_0x25c1('0xbb'),_0x588b5f[_0x25c1('0xb0')],_0x25c1('0xb1'),_0x58fd37[_0x25c1('0x21')],_0x25c1('0x6c'),_0x58fd37['pTalking']);delete this['actions'][_0x2482df[_0x25c1('0xac')]];break;case _0x25c1('0xbc'):_0x58fd37['outboundBusyCallsDay']+=0x1;_0x588b5f[_0x25c1('0xbd')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut['logCustomer'](_0x588b5f,0x5,'Busy');ami[_0x25c1('0x20')]('custom:agentbusy',ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xbe')));rpcDb[_0x25c1('0x90')](_0x588b5f,_0x25c1('0xbf'));if(ut['totalGlobal'](_0x588b5f)>=_0x58fd37['dialGlobalMaxRetry']){_0x50bd38=ut[_0x25c1('0xc0')](_0x588b5f,0xf,'Global');rpcDb[_0x25c1('0x94')](_0x50bd38,_0x25c1('0xc1'));}else{if(_0x588b5f[_0x25c1('0xbd')]>=_0x58fd37['dialBusyMaxRetry']){rpcDb[_0x25c1('0x94')](_0x588b5f,_0x25c1('0xbf'));}else{rpcDb[_0x25c1('0xa7')](ut[_0x25c1('0xa8')](_0x588b5f,_0x25c1('0xbd'),_0x58fd37[_0x25c1('0xc2')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f[_0x25c1('0xab')]);}}break;case _0x25c1('0xc3'):_0x58fd37[_0x25c1('0x3b')]+=0x1;_0x588b5f[_0x25c1('0xc4')]+=0x1;_0x588b5f['countglobal']=ut[_0x25c1('0x9d')](_0x588b5f);ut['logCustomer'](_0x588b5f,0x3,_0x25c1('0xc5'));ami[_0x25c1('0x20')](_0x25c1('0xc6'),ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xc7')));rpcDb[_0x25c1('0x90')](_0x588b5f,_0x25c1('0xc8'));if(ut['totalGlobal'](_0x588b5f)>=_0x58fd37['dialGlobalMaxRetry']){_0x50bd38=ut[_0x25c1('0xc0')](_0x588b5f,0xf,'Global');rpcDb['createCustomerFinal'](_0x50bd38,_0x25c1('0xc9'));}else{if(_0x588b5f[_0x25c1('0xc4')]>=_0x58fd37[_0x25c1('0xca')]){rpcDb[_0x25c1('0x94')](_0x588b5f,_0x25c1('0xc8'));}else{rpcDb[_0x25c1('0xa7')](ut['scheduledAt'](_0x588b5f,_0x25c1('0xc4'),_0x58fd37[_0x25c1('0xcb')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f[_0x25c1('0xab')]);}}break;case'CONGESTION':_0x58fd37[_0x25c1('0xcc')]+=0x1;_0x588b5f[_0x25c1('0xcd')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut['logCustomer'](_0x588b5f,0x8,_0x25c1('0xce'));ami[_0x25c1('0x20')](_0x25c1('0xcf'),ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xd0')));rpcDb['createCustomerHistory'](_0x588b5f,_0x25c1('0xd1'));if(ut['totalGlobal'](_0x588b5f)>=_0x58fd37[_0x25c1('0xa2')]){_0x50bd38=ut['cloneAction'](_0x588b5f,0xf,_0x25c1('0xa3'));rpcDb[_0x25c1('0x94')](_0x50bd38,_0x25c1('0xd2'));}else{if(_0x588b5f['countcongestionretry']>=_0x58fd37[_0x25c1('0xd3')]){rpcDb['createCustomerFinal'](_0x588b5f,_0x25c1('0xd1'));}else{rpcDb['rescheduleContact'](ut[_0x25c1('0xa8')](_0x588b5f,_0x25c1('0xcd'),_0x58fd37[_0x25c1('0xc2')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f[_0x25c1('0xab')]);}}break;case _0x25c1('0xd4'):_0x58fd37['outboundRejectCallsDay']+=0x1;_0x588b5f[_0x25c1('0xd5')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut['logCustomer'](_0x588b5f,0x14,'AgentReject');ami[_0x25c1('0x20')](_0x25c1('0xd6'),ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xd7')));rpcDb[_0x25c1('0x90')](_0x588b5f,_0x25c1('0xd8'));if(ut[_0x25c1('0x9d')](_0x588b5f)>=_0x58fd37['dialGlobalMaxRetry']){_0x50bd38=ut['cloneAction'](_0x588b5f,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x50bd38,_0x25c1('0xd9'));}else{if(_0x588b5f[_0x25c1('0xd5')]>=_0x58fd37[_0x25c1('0xda')]){rpcDb[_0x25c1('0x94')](_0x588b5f,_0x25c1('0xd9'));}else{rpcDb[_0x25c1('0xa7')](ut[_0x25c1('0xa8')](_0x588b5f,_0x25c1('0xd5'),_0x58fd37[_0x25c1('0xdb')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f[_0x25c1('0xab')]);}}break;case _0x25c1('0xdc'):_0x58fd37[_0x25c1('0x41')]+=0x1;_0x588b5f[_0x25c1('0xdd')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut['totalGlobal'](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0xb,_0x25c1('0xde'));rpcDb['createCustomerHistory'](_0x588b5f,_0x25c1('0xdf'));if(ut[_0x25c1('0x9d')](_0x588b5f)>=_0x58fd37['dialGlobalMaxRetry']){_0x50bd38=ut['cloneAction'](_0x588b5f,0xf,'Global');rpcDb['createCustomerFinal'](_0x50bd38,_0x25c1('0xdf'));}else{if(_0x588b5f[_0x25c1('0xe0')]>=_0x58fd37[_0x25c1('0xe1')]){rpcDb['createCustomerFinal'](_0x588b5f,_0x25c1('0xdf'));}else{rpcDb[_0x25c1('0xa7')](ut[_0x25c1('0xa8')](_0x588b5f,'countabandonedretry',_0x58fd37[_0x25c1('0xe2')]),_0x588b5f[_0x25c1('0xaa')],_0x588b5f['activeContact']);}}break;case'18':_0x58fd37[_0x25c1('0x40')]+=0x1;_0x588b5f[_0x25c1('0xe3')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0x12,_0x2482df['cause-txt']||_0x2482df[_0x25c1('0xe4')]);ami[_0x25c1('0x20')]('custom:amd',ut[_0x25c1('0x9f')](_0x588b5f,_0x25c1('0xe5')));rpcDb[_0x25c1('0x90')](_0x588b5f,_0x25c1('0xe6'));if(ut[_0x25c1('0x9d')](_0x588b5f)>=_0x58fd37[_0x25c1('0xa2')]){_0x50bd38=ut[_0x25c1('0xc0')](_0x588b5f,0xf,_0x25c1('0xa3'));rpcDb[_0x25c1('0x94')](_0x50bd38,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x25c1('0x94')](_0x588b5f,_0x25c1('0xe6'));}delete this[_0x25c1('0x14')][_0x2482df[_0x25c1('0xac')]];break;case'19':_0x58fd37['outboundUnknownCallsDay']+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0x13,_0x2482df[_0x25c1('0xe7')]||_0x2482df[_0x25c1('0xe4')]);ami[_0x25c1('0x20')](_0x25c1('0xe8'),ut[_0x25c1('0x9f')](_0x588b5f,'amd'));rpcDb[_0x25c1('0x90')](_0x588b5f,'[callProgressDetectingCustomer][machine]');if(ut[_0x25c1('0x9d')](_0x588b5f)>=_0x58fd37[_0x25c1('0xa2')]){_0x50bd38=ut[_0x25c1('0xc0')](_0x588b5f,0xf,_0x25c1('0xa3'));rpcDb[_0x25c1('0x94')](_0x50bd38,_0x25c1('0xe9'));}else{rpcDb['createCustomerFinal'](_0x588b5f,_0x25c1('0xe9'));}delete this[_0x25c1('0x14')][_0x2482df['linkedid']];break;default:if(_0x588b5f[_0x25c1('0x6d')]){ut[_0x25c1('0x75')](_0x58fd37,_0x25c1('0xea'));ut[_0x25c1('0x76')](_0x25c1('0xeb')+_0x58fd37[_0x25c1('0x21')],_0x2482df);}_0x58fd37[_0x25c1('0x40')]+=0x1;_0x588b5f[_0x25c1('0x9c')]=ut[_0x25c1('0x9d')](_0x588b5f);ut[_0x25c1('0x8c')](_0x588b5f,0xc,_0x2482df[_0x25c1('0xe7')]||_0x2482df['dialstatus']);rpcDb[_0x25c1('0x90')](_0x588b5f,_0x25c1('0xec'));if(ut['totalGlobal'](_0x588b5f)>=_0x58fd37[_0x25c1('0xa2')]){_0x50bd38=ut[_0x25c1('0xc0')](_0x588b5f,0xf,_0x25c1('0xa3'));rpcDb[_0x25c1('0x94')](_0x50bd38,_0x25c1('0xed'));}else{rpcDb[_0x25c1('0x94')](_0x588b5f,_0x25c1('0xed'));}delete this[_0x25c1('0x14')][_0x2482df[_0x25c1('0xac')]];}if(!(_0x588b5f[_0x25c1('0x6d')]&&_0x26a9d9==='16')){ut['updateOriginated'](_0x58fd37,_0x25c1('0xee'));logger['info'](_0x25c1('0xef'),_0x588b5f[_0x25c1('0xb0')],_0x25c1('0xb1'),_0x58fd37[_0x25c1('0x21')],'originated:\x20',_0x58fd37[_0x25c1('0x49')]);}if(_0x26a9d9!==_0x25c1('0xad')){delete this[_0x25c1('0x14')][_0x2482df[_0x25c1('0xac')]];delete this['actions'][_0x2482df['destlinkedid']];}}};Preview['prototype'][_0x25c1('0xf0')]=function(_0x25923e,_0x2c87ff,_0x423dbe){if(_[_0x25c1('0xf1')](_0x2c87ff)&&_0x25c1('0xf2')!==typeof _0x2c87ff){return;}if(_[_0x25c1('0xf1')](_0x423dbe)&&'object'!==typeof _0x423dbe){return;}switch(_0x423dbe[_0x25c1('0xf3')]){case'0':ut['logAgent'](_0x25923e,0x0,'NoSuchNumber');rpcDb[_0x25c1('0xf4')](_0x25923e,_0x25c1('0xf5'));break;case'3':ut[_0x25c1('0xf6')](_0x25923e,0x3,_0x25c1('0xc5'));rpcDb[_0x25c1('0xf4')](_0x25923e,_0x25c1('0xf7'));break;case'5':ut[_0x25c1('0xf6')](_0x25923e,0x5,_0x25c1('0xf8'));rpcDb[_0x25c1('0xf4')](_0x25923e,_0x25c1('0xf9'));break;case'8':ut['logAgent'](_0x25923e,0x8,'Congestion');rpcDb[_0x25c1('0xf4')](_0x25923e,_0x25c1('0xfa'));break;case'22':ut['logAgent'](_0x25923e,0x16,_0x25c1('0xfb'));rpcDb[_0x25c1('0xf4')](_0x25923e,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x25c1('0xf6')](_0x25923e,0xc,_0x423dbe[_0x25c1('0xf3')]);rpcDb[_0x25c1('0xf4')](_0x25923e,_0x25c1('0xfa'));}ut[_0x25c1('0xfc')](_0x2c87ff,_0x25c1('0xfd'));logger[_0x25c1('0x58')](_0x25c1('0xfe'),_0x25923e[_0x25c1('0xb0')],_0x25c1('0xb1'),_0x2c87ff['name'],_0x25c1('0x6b'),_0x2c87ff[_0x25c1('0x49')]);delete this[_0x25c1('0x14')][_0x25923e['uniqueid']];};Preview[_0x25c1('0x60')][_0x25c1('0xff')]=function(_0x3627e6,_0x52b336,_0x148502,_0x1894a6,_0x282a3c){var _0x1f073e=this;return new BPromise(function(_0x21c5d3,_0x132c0c){if(_['isNil'](_0x52b336)||_[_0x25c1('0x68')](_0x52b336[_0x25c1('0x100')])||_[_0x25c1('0x68')](_0x52b336[_0x25c1('0x100')]['phone'])||_[_0x25c1('0x68')](_0x52b336[_0x25c1('0x101')])){_0x132c0c(ut[_0x25c1('0x48')](_0x25c1('0x102'),_0x1894a6,_0x282a3c));return;}var _0x1cfb23=uuid['v4']();var _0x480134=_0x1f073e[_0x25c1('0x1f')][_0x52b336[_0x25c1('0x69')][_0x25c1('0x21')]];var _0xe6283b=_0x148502?_0x1f073e['agents'][_0x148502]['id']:undefined;_0x1f073e[_0x25c1('0x14')][_0x1cfb23]=new Action(_0x52b336,_0x480134,_0x1cfb23,_0x148502,_0xe6283b);var _0x2ecac3=_0x1f073e[_0x25c1('0x14')][_0x1cfb23];_0x2ecac3[_0x25c1('0xaa')]=_0x1894a6;_0x2ecac3[_0x25c1('0xab')]=_0x282a3c;_0x2ecac3[_0x25c1('0x103')]=_0x148502;if(_['isEmpty'](_0x3627e6)){_0x1f073e['execCall'](_0x2ecac3,_0x480134,_0x52b336,_0x148502)[_0x25c1('0x7f')](function(_0xa595de){logger[_0x25c1('0x58')](_0x25c1('0x104'),_0x25c1('0x105')+_0x2ecac3[_0x25c1('0x6a')]+'\x20IdHopper:\x20'+_0x2ecac3['idContact'],JSON['stringify'](_0xa595de));ami[_0x25c1('0x20')](_0x25c1('0x106'),ut[_0x25c1('0x9f')](_0x2ecac3,'called',_0x1f073e[_0x25c1('0x1f')][_0x2ecac3[_0x25c1('0x6a')]]));_0x21c5d3(ut[_0x25c1('0x48')](_0x25c1('0x107')));})[_0x25c1('0x73')](function(_0x18829e){ut[_0x25c1('0x5d')](_0x25c1('0x108'),_0x18829e);_0x132c0c(ut[_0x25c1('0x48')](_0x25c1('0x109'),_0x1894a6,_0x282a3c));});}else{_0x480134[_0x25c1('0x37')]+=0x1;ut[_0x25c1('0x10a')](_0x2ecac3);rpcDb['createHistory'](_0x2ecac3,_0x25c1('0x10b'));delete _0x1f073e[_0x25c1('0x14')][_0x1cfb23];_0x132c0c(ut['message'](_0x25c1('0x10c'),_0x1894a6,_0x282a3c));}});};Preview[_0x25c1('0x60')][_0x25c1('0x98')]=function(_0x28af6d){return!_[_0x25c1('0x68')](_0x28af6d)&&!_['isNil'](_0x28af6d[_0x25c1('0x21')])&&!_[_0x25c1('0x68')](_0x28af6d[_0x25c1('0x51')])&&_0x28af6d[_0x25c1('0x51')]&&!_['isNil'](this[_0x25c1('0x13')][util['format'](_0x25c1('0x10d'),_0x28af6d[_0x25c1('0x21')])])&&!_[_0x25c1('0x68')](this['trunks'][util[_0x25c1('0x55')](_0x25c1('0x10d'),_0x28af6d[_0x25c1('0x21')])][_0x25c1('0x10e')])&&(this[_0x25c1('0x13')][util[_0x25c1('0x55')](_0x25c1('0x10d'),_0x28af6d[_0x25c1('0x21')])][_0x25c1('0x10e')]==='reachable'||this[_0x25c1('0x13')][util[_0x25c1('0x55')](_0x25c1('0x10d'),_0x28af6d[_0x25c1('0x21')])][_0x25c1('0x10e')]==='unmonitored');};Preview[_0x25c1('0x60')][_0x25c1('0x86')]=function(_0x3e8e62,_0x5a9fc0){var _0xc6345a=this;return new BPromise(function(_0x386a3d,_0x3e522b){_0xc6345a['execRun'](_0x3e8e62,_0x5a9fc0)['then'](function(_0x567437){_0x386a3d(_[_0x25c1('0x10f')](_0x567437,[_0x25c1('0x48')]));})[_0x25c1('0x73')](function(_0x2ccfb7){if(_0x2ccfb7[_0x25c1('0x110')]){rpcDb[_0x25c1('0x111')](_0x3e8e62);}if(_0x2ccfb7[_0x25c1('0x51')]){rpcDb[_0x25c1('0x89')](_0x3e8e62);}_0x3e522b(_[_0x25c1('0x10f')](_0x2ccfb7,[_0x25c1('0x48')]));});});};Preview[_0x25c1('0x60')]['execRun']=function(_0x582166,_0x355e71){var _0x39306b=this;return new BPromise(function(_0x17d6dd,_0x762495){var _0x3a5e79,_0x559cd5;rpcDb[_0x25c1('0x112')](_0x582166)['then'](function(_0x3a9e3b){if(!_[_0x25c1('0x68')](_0x3a9e3b[0x0])){_0x559cd5=_0x3a9e3b[0x0][_0x25c1('0x113')]?![]:!![];_0x3a5e79=_0x3a9e3b[0x0][_0x25c1('0x113')]?!![]:![];_0x3a5e79=_0x355e71?!![]:_0x3a5e79;}var _0x540250=_0x39306b['validateContact'](_0x3a9e3b);if(_0x540250[_0x25c1('0x114')]){rpcDb[_0x25c1('0x115')](_[_0x25c1('0x10f')](_0x3a9e3b[0x0],['VoiceQueueId','Contact.phone']))[_0x25c1('0x7f')](function(_0xd9acda){_0x39306b['checkInBlack'](_0xd9acda,_0x3a9e3b[0x0],_0x355e71,_0x559cd5,_0x3a5e79)[_0x25c1('0x7f')](function(_0x267788){_0x17d6dd(_0x267788);})[_0x25c1('0x73')](function(_0x33f8ee){_0x762495(_0x33f8ee);});})[_0x25c1('0x73')](function(_0x971716){ut[_0x25c1('0x5d')](_0x25c1('0x116'),_0x971716);_0x762495(ut[_0x25c1('0x48')](_0x25c1('0x117'),_0x559cd5,_0x3a5e79));});}else{_0x762495(ut[_0x25c1('0x48')](_0x540250[_0x25c1('0x48')],_0x559cd5,_0x3a5e79));}})[_0x25c1('0x73')](function(_0x2f71f6){ut['logger'](_0x25c1('0x118'),_0x2f71f6);_0x762495(ut[_0x25c1('0x48')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x25c1('0x60')]['validateContact']=function(_0x457f1b){if(_[_0x25c1('0x68')](_0x457f1b)||_['isEmpty'](_0x457f1b)||!_[_0x25c1('0x68')](_0x457f1b[0x0][_0x25c1('0x84')])&&_[_0x25c1('0x68')](_0x457f1b[0x0][_0x25c1('0x84')][_0x25c1('0x21')])){ut['logger'](_0x25c1('0x119'),_0x457f1b);return{'isValid':![],'message':_0x25c1('0x11a')};}var _0x39b295=this[_0x25c1('0x1f')][_0x457f1b[0x0]['Queue'][_0x25c1('0x21')]];_0x39b295[_0x25c1('0x48')]=_0x25c1('0x9b');if(_['isNil'](_0x39b295)){ut[_0x25c1('0x5d')](_0x25c1('0x11b'),_0x39b295);return{'isValid':![],'message':_0x25c1('0x11c')};}if(!this[_0x25c1('0x98')](_0x39b295[_0x25c1('0x50')])){ut[_0x25c1('0x5d')](_0x25c1('0x11d'),_0x25c1('0x11e')+_0x39b295['name']+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x39b295[_0x25c1('0x99')])){ut[_0x25c1('0x5d')](_0x25c1('0x11d'),_0x39b295['name']+_0x25c1('0x11f'));return{'isValid':![],'message':_0x25c1('0x120')};}}if(!ut[_0x25c1('0x121')](_0x39b295[_0x25c1('0x30')])){ut[_0x25c1('0x5d')](_0x25c1('0x122'),_0x39b295[_0x25c1('0x21')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x25c1('0x11e')+_0x39b295[_0x25c1('0x21')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x25c1('0x123')};};Preview[_0x25c1('0x60')][_0x25c1('0x124')]=function(_0x2fc724,_0x3d7a69,_0x10d222,_0x3383a1){var _0x2f0f6b=this;return new BPromise(function(_0x3639bc,_0x1b2dd6){var _0x66316d=_0x2fc724[_0x25c1('0xb0')];var _0x3e69b5=_0x2f0f6b[_0x25c1('0x98')](_0x3d7a69[_0x25c1('0x50')])?util['format']('SIP/%s/%s%s',_0x3d7a69[_0x25c1('0x50')][_0x25c1('0x21')],_['isNil'](_0x3d7a69[_0x25c1('0x34')])?'':_0x3d7a69[_0x25c1('0x34')][_0x25c1('0x125')]()||'',_0x3d7a69['dialCutDigit']>0x0?_0x10d222[_0x25c1('0x100')][_0x25c1('0x126')][_0x25c1('0x127')](_0x3d7a69[_0x25c1('0x128')]):_0x10d222[_0x25c1('0x100')]['phone']):util[_0x25c1('0x55')](_0x25c1('0x129'),_[_0x25c1('0x68')](_0x3d7a69[_0x25c1('0x99')])?_0x3d7a69['Trunk']['name']:_0x3d7a69['TrunkBackup']['name'],_[_0x25c1('0x68')](_0x3d7a69['dialPrefix'])?'':_0x3d7a69[_0x25c1('0x34')]['trim']()||'',_0x3d7a69[_0x25c1('0x128')]>0x0?_0x10d222[_0x25c1('0x100')][_0x25c1('0x126')][_0x25c1('0x127')](_0x3d7a69[_0x25c1('0x128')]):_0x10d222[_0x25c1('0x100')][_0x25c1('0x126')]);var _0x4d07d4=_0x2f0f6b['isTrunkReachable'](_0x3d7a69[_0x25c1('0x50')])?ut[_0x25c1('0x12a')](_0x3d7a69[_0x25c1('0x50')][_0x25c1('0x52')],_0x3d7a69[_0x25c1('0x32')],_0x3d7a69['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x3d7a69[_0x25c1('0x12b')],_0x3d7a69[_0x25c1('0x12c')]):_0x3d7a69[_0x25c1('0x12b')]):ut[_0x25c1('0x12a')](_[_0x25c1('0x68')](_0x3d7a69[_0x25c1('0x99')])?_0x3d7a69[_0x25c1('0x50')][_0x25c1('0x52')]:_0x3d7a69[_0x25c1('0x99')][_0x25c1('0x52')],_0x3d7a69[_0x25c1('0x32')],_0x3d7a69[_0x25c1('0x12c')]>0x0?ut['getCallerIdRandom'](_0x3d7a69[_0x25c1('0x12b')],_0x3d7a69[_0x25c1('0x12c')]):_0x3d7a69['dialOriginateCallerIdNumber']);if(_0x4d07d4){_0x2fc724[_0x25c1('0x12d')]=ut[_0x25c1('0x12e')](_0x4d07d4);_0x2fc724[_0x25c1('0x12f')]=ut[_0x25c1('0x130')](_0x4d07d4);}var _0x4fdca2=ut[_0x25c1('0x131')](_0x3d7a69,_0x10d222,_0x3e69b5,_0x4d07d4,_0x66316d,_0x2fc724);_['merge'](_0x2fc724,ut['toLowerVariables'](_0x4fdca2));_0x2fc724[_0x25c1('0x8a')]=moment()[_0x25c1('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x25c1('0x132')](_0x2fc724,_0x3d7a69,_0x4fdca2,_0x2fc724[_0x25c1('0xab')],_0x3383a1))[_0x25c1('0x7f')](function(_0x2a4cbd){_0x3d7a69[_0x25c1('0x49')]+=0x1;logger['info'](_0x25c1('0x133'),_0x66316d,_0x25c1('0xb1'),_0x3d7a69['name'],'originated:\x20',_0x3d7a69[_0x25c1('0x49')]);_0x3639bc(_0x2a4cbd);})[_0x25c1('0x73')](function(_0x33a141){ut[_0x25c1('0xf6')](_0x2fc724,0xe,_0x25c1('0x134'));rpcDb[_0x25c1('0xf4')](_0x2fc724,_0x25c1('0x135'));_0x1b2dd6(_0x33a141);});});};Preview[_0x25c1('0x60')][_0x25c1('0x136')]=function(_0x29d44b){if(this[_0x25c1('0x14')][_0x29d44b[_0x25c1('0xac')]]){this[_0x25c1('0x14')][_0x29d44b[_0x25c1('0xac')]][_0x25c1('0x72')]=_0x29d44b[_0x25c1('0x72')];}};Preview[_0x25c1('0x60')][_0x25c1('0x15')]=function(_0x41b19b){var _0x3d8a0a=this;var _0x4551a5=this[_0x25c1('0x14')][_0x41b19b[_0x25c1('0x137')]];if(_0x4551a5){if(_0x4551a5[_0x25c1('0x103')]&&this[_0x25c1('0x7e')][_0x4551a5[_0x25c1('0x103')]]){ut['logLookAgent'](_0x4551a5,this[_0x25c1('0x7e')][_0x4551a5['lookAgent']][_0x25c1('0x21')],this['agents'][_0x4551a5['lookAgent']]['id']);}var _0x56d4ca=_['clone'](_0x4551a5);_0x56d4ca[_0x25c1('0xae')]=moment()[_0x25c1('0x55')](_0x25c1('0x8b'));var _0x4809ac=_0x3d8a0a['campaignsPreview'][_0x4551a5[_0x25c1('0x6a')]];if(ut[_0x25c1('0x138')](_0x41b19b['response'])){if(_0x4551a5[_0x25c1('0xaa')]){rpcDb[_0x25c1('0x111')](_0x4551a5[_0x25c1('0x139')]);}if(_0x4551a5[_0x25c1('0xab')]){rpcDb[_0x25c1('0x89')](_0x4551a5[_0x25c1('0x139')]);}ami[_0x25c1('0x20')](_0x25c1('0x13a'),ut['buildObj'](_0x4551a5,_0x25c1('0x13b'),this[_0x25c1('0x1f')][_0x4551a5['queue']]));this['callProgressDetectingAgent'](_0x56d4ca,_0x4809ac,_0x41b19b);}else{_0x4551a5['starttime']=moment()[_0x25c1('0x55')](_0x25c1('0x8b'));ut[_0x25c1('0xf6')](_0x56d4ca,0x4,_0x25c1('0xb6'));rpcDb[_0x25c1('0xf4')](_0x56d4ca,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x25c1('0x60')][_0x25c1('0x18')]=function(_0x4b1099){var _0x5cbc3=this;var _0x9aba08=this[_0x25c1('0x14')][_0x4b1099[_0x25c1('0xac')]];var _0x2e11a5;if(_0x9aba08){_0x2e11a5=this['campaignsPreview'][_0x9aba08[_0x25c1('0x6a')]];logger[_0x25c1('0x58')](_0x25c1('0x13c'),_0x4b1099[_0x25c1('0xac')],_0x25c1('0xb1'),_0x2e11a5[_0x25c1('0x21')],_0x25c1('0x6c'),_0x2e11a5[_0x25c1('0x26')]);}if(this[_0x25c1('0x14')][_0x4b1099['linkedid']]&&_0x4b1099[_0x25c1('0xac')]!==_0x4b1099['uniqueid']){if(_0x4b1099[_0x25c1('0x13d')]==='16'&&this['actions'][_0x4b1099[_0x25c1('0xac')]][_0x25c1('0x6d')]){this[_0x25c1('0x13e')](_0x4b1099,_0x4b1099[_0x25c1('0xac')],_0x4b1099[_0x25c1('0x13d')]);}else if(this[_0x25c1('0x14')][_0x4b1099[_0x25c1('0xac')]]['dialAnswer']){logger['info'](_0x25c1('0x13f'),_0x4b1099[_0x25c1('0xac')],_0x4b1099[_0x25c1('0x13d')],'\x20Queue',_0x2e11a5[_0x25c1('0x21')],_0x25c1('0x6c'),_0x2e11a5['pTalking']);this[_0x25c1('0x13e')](_0x4b1099,_0x4b1099[_0x25c1('0xac')],_0x4b1099[_0x25c1('0x13d')]);}}else if(_0x9aba08&&_[_0x25c1('0x68')](_0x9aba08[_0x25c1('0x140')])&&_0x2e11a5[_0x25c1('0x141')]&&_0x4b1099['linkedid']===_0x4b1099[_0x25c1('0xb0')]&&_[_0x25c1('0x68')](_0x4b1099[_0x25c1('0xf3')])&&_0x4b1099[_0x25c1('0x13d')]==='16'&&_0x4b1099[_0x25c1('0x142')]==='6'&&_[_0x25c1('0xf1')](_0x9aba08[_0x25c1('0x143')])){if(_0x9aba08[_0x25c1('0xaa')]){rpcDb[_0x25c1('0x111')](_0x9aba08[_0x25c1('0x139')]);}if(_0x9aba08[_0x25c1('0xab')]){rpcDb[_0x25c1('0x89')](_0x9aba08[_0x25c1('0x139')]);}_0x4b1099[_0x25c1('0xf3')]='22';this[_0x25c1('0xf0')](_0x9aba08,_0x2e11a5,_0x4b1099);}else if(_0x9aba08&&_0x9aba08[_0x25c1('0x143')]){if(_0x4b1099[_0x25c1('0x13d')]==='16'&&this[_0x25c1('0x14')][_0x4b1099[_0x25c1('0xac')]][_0x25c1('0x6d')]){logger[_0x25c1('0x58')](_0x25c1('0x144'),_0x4b1099['linkedid'],_0x4b1099[_0x25c1('0x13d')],'\x20Queue',_0x2e11a5['name'],_0x25c1('0x6c'),_0x2e11a5[_0x25c1('0x26')]);this[_0x25c1('0x13e')](_0x4b1099,_0x4b1099[_0x25c1('0xac')],_0x4b1099['cause']);}else if(this[_0x25c1('0x14')][_0x4b1099[_0x25c1('0xac')]][_0x25c1('0x6d')]){logger[_0x25c1('0x58')](_0x25c1('0x13f'),_0x4b1099[_0x25c1('0xac')],_0x4b1099[_0x25c1('0x13d')],_0x25c1('0xb1'),_0x2e11a5[_0x25c1('0x21')],_0x25c1('0x6c'),_0x2e11a5[_0x25c1('0x26')]);this[_0x25c1('0x13e')](_0x4b1099,_0x4b1099[_0x25c1('0xac')],_0x4b1099[_0x25c1('0x13d')]);}}};Preview['prototype']['syncDialEnd']=function(_0x59b694){if(this[_0x25c1('0x14')][_0x59b694[_0x25c1('0x145')]]&&_0x59b694['destlinkedid']!==_0x59b694[_0x25c1('0x146')]){this[_0x25c1('0x13e')](_0x59b694,_0x59b694[_0x25c1('0x145')],_0x59b694[_0x25c1('0xe4')]);}};Preview[_0x25c1('0x60')]['syncHangupRequest']=function(_0x1ddf40){if(this[_0x25c1('0x14')][_0x1ddf40[_0x25c1('0xac')]]&&_0x1ddf40[_0x25c1('0xac')]!==_0x1ddf40['uniqueid']&&!this[_0x25c1('0x14')][_0x1ddf40[_0x25c1('0xac')]][_0x25c1('0x6d')]){if(_0x1ddf40[_0x25c1('0x13d')]==='1'){this[_0x25c1('0x13e')](_0x1ddf40,_0x1ddf40[_0x25c1('0xac')],_0x1ddf40[_0x25c1('0x13d')]);}}};Preview[_0x25c1('0x60')][_0x25c1('0x147')]=function(_0x419348,_0x387ff1,_0x4eb1ff){if(this[_0x25c1('0x14')][_0x419348]){if(_['isNil'](this[_0x25c1('0x14')][_0x419348][_0x25c1('0x148')])){this[_0x25c1('0x14')][_0x419348][_0x25c1('0x148')]={};}this[_0x25c1('0x14')][_0x419348]['variables'][_0x387ff1]=_0x4eb1ff;}};Preview[_0x25c1('0x60')][_0x25c1('0x149')]=function(_0x4a970e){try{if(!_[_0x25c1('0x68')](_0x4a970e)){if(ut[_0x25c1('0x14a')](_[_0x25c1('0x14b')](_0x4a970e[_0x25c1('0x14c')])[0x0])){this[_0x25c1('0x147')](_0x4a970e[_0x25c1('0xb0')],_[_0x25c1('0x14b')](_0x4a970e[_0x25c1('0x14c')])[0x0],_0x4a970e[_0x25c1('0x14d')]);}}}catch(_0x2ce626){logger[_0x25c1('0x14e')](_0x25c1('0x14f'),util[_0x25c1('0x150')](_0x2ce626,{'showHidden':![],'depth':null}));}};Preview[_0x25c1('0x60')][_0x25c1('0x151')]=function(_0x7d636b){if(_0x7d636b){if(this[_0x25c1('0x14')][_0x7d636b['transfertargetlinkedid']]){this[_0x25c1('0x14')][_0x7d636b[_0x25c1('0x152')]][_0x25c1('0x143')]=!![];}}};Preview[_0x25c1('0x60')][_0x25c1('0x1d')]=function(_0x567eaa){if(_0x567eaa){if(this[_0x25c1('0x14')][_0x567eaa['transfererlinkedid']]){this['actions'][_0x567eaa[_0x25c1('0x153')]]['transfer']=!![];}}};module[_0x25c1('0x154')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index f54b4ec..4ce4632 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 _0xfb43=['queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueReport','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt'];(function(_0x1ce8c8,_0x27a81b){var _0x462090=function(_0x564bd4){while(--_0x564bd4){_0x1ce8c8['push'](_0x1ce8c8['shift']());}};_0x462090(++_0x27a81b);}(_0xfb43,0xc8));var _0x3fb4=function(_0x56f856,_0x20d5bb){_0x56f856=_0x56f856-0x0;var _0x1855f7=_0xfb43[_0x56f856];return _0x1855f7;};'use strict';var util=require(_0x3fb4('0x0'));var BPromise=require('bluebird');var logger=require(_0x3fb4('0x1'))(_0x3fb4('0x2'));var _=require(_0x3fb4('0x3'));var cmHopper=require(_0x3fb4('0x4'));var cmHopperFinal=require(_0x3fb4('0x5'));var cmHopperHistory=require(_0x3fb4('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x3fb4('0x7'));function loggerCatch(_0x264120){return function(_0x33396e){logger['error'](_0x264120,util['inspect'](_0x33396e,{'showHidden':![],'depth':null}));};}function create(_0x2a9516){return BPromise[_0x3fb4('0x8')]()[_0x3fb4('0x9')](cmHopperHistory[_0x3fb4('0xa')](_0x2a9516))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0xc')));}function createAgent(_0x2920b4){return BPromise[_0x3fb4('0x8')]()['then'](agentReportPreview[_0x3fb4('0xa')](_0x2920b4))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0xc')));}function moveContact(_0x542e2e){return BPromise['resolve']()[_0x3fb4('0x9')](cmHopper['moveContactManagedDialer'](_0x542e2e,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x3fb4('0xd')]=function(_0x2cb5e4){return BPromise[_0x3fb4('0x8')]()[_0x3fb4('0x9')](cmHopperBlack[_0x3fb4('0xd')](_0x2cb5e4))[_0x3fb4('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x100eed){return BPromise[_0x3fb4('0x8')]()['then'](cmHopper[_0x3fb4('0xe')](_0x100eed))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0xf')));};exports['createHistory']=function(_0x4de678,_0x280d03){create(_0x4de678)[_0x3fb4('0xb')](loggerCatch(_0x280d03));moveContact(_0x4de678)[_0x3fb4('0xb')](loggerCatch(_0x280d03));};exports['createAgentHistory']=function(_0xe3421f,_0x2d32f3){createAgent(_0xe3421f)[_0x3fb4('0xb')](loggerCatch(_0x2d32f3));};exports['createCustomerHistory']=function(_0x472fca,_0x47b77e){create(_0x472fca)[_0x3fb4('0xb')](loggerCatch(_0x47b77e));};exports[_0x3fb4('0x10')]=function(_0x484341,_0x33362e){moveContact(_0x484341)[_0x3fb4('0xb')](loggerCatch(_0x33362e));};exports[_0x3fb4('0x11')]=function(_0x38d63d,_0x3b474b,_0x5d8640){if(_0x3b474b){_0x38d63d['UserId']=null;}if(_0x5d8640){_0x38d63d['active']=![];}return BPromise[_0x3fb4('0x8')]()[_0x3fb4('0x9')](cmHopper[_0x3fb4('0x11')](_0x38d63d))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0x12')));};exports['countReScheduled']=function(_0x2ed899){return BPromise[_0x3fb4('0x8')]()[_0x3fb4('0x9')](cmHopper[_0x3fb4('0x13')](_0x2ed899))['catch'](loggerCatch(_0x3fb4('0x14')));};exports[_0x3fb4('0x15')]=function(_0x41bd0f){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'UserId':null},_0x41bd0f,0x1))[_0x3fb4('0xb')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x2dc1c6){return BPromise[_0x3fb4('0x8')]()['then'](cmHopper[_0x3fb4('0x15')]({'active':![]},_0x2dc1c6,0x1))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0x16')));};exports['crateCustomerReportQueue']=function(_0x4b55cb){var _0x19d049={};_0x19d049[_0x3fb4('0x17')]=_0x4b55cb['type'];_0x19d049[_0x3fb4('0x18')]=_0x4b55cb['uniqueid'];_0x19d049[_0x3fb4('0x19')]=_0x4b55cb['calleridnum'];_0x19d049['calleridname']=_0x4b55cb['calleridname'];_0x19d049[_0x3fb4('0x1a')]=_0x4b55cb['queue'];_0x19d049[_0x3fb4('0x1b')]=_0x4b55cb[_0x3fb4('0x1c')];_0x19d049[_0x3fb4('0x1d')]=_0x4b55cb[_0x3fb4('0x1c')];_0x19d049[_0x3fb4('0x1e')]=0x1;_0x19d049[_0x3fb4('0x1f')]=_0x4b55cb[_0x3fb4('0x20')];_0x19d049[_0x3fb4('0x21')]=_0x4b55cb[_0x3fb4('0x22')];_0x19d049[_0x3fb4('0x23')]='from-sip';_0x19d049['exten']=_0x3fb4('0x24');_0x19d049[_0x3fb4('0x25')]=0x0;_0x19d049[_0x3fb4('0x26')]=0x1;_0x19d049[_0x3fb4('0x27')]=_0x4b55cb['membername'];_0x19d049[_0x3fb4('0x28')]=_0x3fb4('0x29');return BPromise['resolve']()[_0x3fb4('0x9')](voiceQueueReport['create'](_0x19d049))[_0x3fb4('0xb')](loggerCatch(_0x3fb4('0x2a')));};exports['getContactRecallMe']=function(_0x2fd866,_0x5c03c3){return BPromise[_0x3fb4('0x8')]()[_0x3fb4('0x9')](cmHopper[_0x3fb4('0x2b')](_0x2fd866,_0x5c03c3))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3fb4('0x2c')]=function(_0x2a5af2){return BPromise['resolve']()[_0x3fb4('0x9')](cmHopper[_0x3fb4('0x11')](_0x2a5af2,!![],!![]))['catch'](loggerCatch(_0x3fb4('0x2d')));}; \ No newline at end of file +var _0x663b=['assigned','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x663b,0xd8));var _0xb663=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x663b[_0x5e6cb8];return _0x3faeb3;};'use strict';var util=require(_0xb663('0x0'));var BPromise=require(_0xb663('0x1'));var logger=require(_0xb663('0x2'))(_0xb663('0x3'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xb663('0x4'));var cmHopperBlack=require(_0xb663('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xb663('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4356aa){return function(_0x35095e){logger['error'](_0x4356aa,util[_0xb663('0x7')](_0x35095e,{'showHidden':![],'depth':null}));};}function create(_0x4422a6){return BPromise[_0xb663('0x8')]()['then'](cmHopperHistory[_0xb663('0x9')](_0x4422a6))[_0xb663('0xa')](loggerCatch(_0xb663('0xb')));}function createAgent(_0x36a2aa){return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](agentReportPreview[_0xb663('0x9')](_0x36a2aa))[_0xb663('0xa')](loggerCatch(_0xb663('0xb')));}function moveContact(_0x4b5696){return BPromise['resolve']()[_0xb663('0xc')](cmHopper[_0xb663('0xd')](_0x4b5696,!![]))['catch'](loggerCatch(_0xb663('0xe')));}exports['checkIsBlackList']=function(_0x33b791){return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](cmHopperBlack['checkIsBlackList'](_0x33b791))[_0xb663('0xa')](loggerCatch(_0xb663('0xf')));};exports[_0xb663('0x10')]=function(_0x360a81){return BPromise[_0xb663('0x8')]()['then'](cmHopper['getContactPreview'](_0x360a81))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xb663('0x9')]=function(_0x3dafd7,_0x2daf5a){create(_0x3dafd7)[_0xb663('0xa')](loggerCatch(_0x2daf5a));moveContact(_0x3dafd7)[_0xb663('0xa')](loggerCatch(_0x2daf5a));};exports[_0xb663('0x11')]=function(_0x29f316,_0x240c84){createAgent(_0x29f316)[_0xb663('0xa')](loggerCatch(_0x240c84));};exports['createCustomerHistory']=function(_0x506cf1,_0x418629){create(_0x506cf1)[_0xb663('0xa')](loggerCatch(_0x418629));};exports[_0xb663('0x12')]=function(_0x159eb7,_0x5a9fb5){moveContact(_0x159eb7)['catch'](loggerCatch(_0x5a9fb5));};exports['rescheduleContact']=function(_0x3ed3ba,_0x2fc168,_0x32a79f){if(_0x2fc168){_0x3ed3ba['UserId']=null;}if(_0x32a79f){_0x3ed3ba[_0xb663('0x13')]=![];}return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](cmHopper[_0xb663('0x14')](_0x3ed3ba))[_0xb663('0xa')](loggerCatch(_0xb663('0x15')));};exports[_0xb663('0x16')]=function(_0x1c5c8f){return BPromise['resolve']()['then'](cmHopper[_0xb663('0x16')](_0x1c5c8f))[_0xb663('0xa')](loggerCatch(_0xb663('0x17')));};exports[_0xb663('0x18')]=function(_0x39ad9c){return BPromise['resolve']()[_0xb663('0xc')](cmHopper['unlockContact']({'UserId':null},_0x39ad9c,0x1))[_0xb663('0xa')](loggerCatch(_0xb663('0x19')));};exports[_0xb663('0x1a')]=function(_0x168fdf){return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](cmHopper[_0xb663('0x18')]({'active':![]},_0x168fdf,0x1))[_0xb663('0xa')](loggerCatch(_0xb663('0x1b')));};exports[_0xb663('0x1c')]=function(_0x1a8e8a){var _0x492fd1={};_0x492fd1[_0xb663('0x1d')]=_0x1a8e8a[_0xb663('0x1d')];_0x492fd1[_0xb663('0x1e')]=_0x1a8e8a[_0xb663('0x1e')];_0x492fd1[_0xb663('0x1f')]=_0x1a8e8a[_0xb663('0x1f')];_0x492fd1[_0xb663('0x20')]=_0x1a8e8a[_0xb663('0x20')];_0x492fd1['queue']=_0x1a8e8a[_0xb663('0x21')];_0x492fd1['queuecallerjoinAt']=_0x1a8e8a[_0xb663('0x22')];_0x492fd1[_0xb663('0x23')]=_0x1a8e8a[_0xb663('0x22')];_0x492fd1[_0xb663('0x24')]=0x1;_0x492fd1[_0xb663('0x25')]=_0x1a8e8a[_0xb663('0x26')];_0x492fd1[_0xb663('0x27')]=_0x1a8e8a['membername'];_0x492fd1[_0xb663('0x28')]='from-sip';_0x492fd1[_0xb663('0x29')]=_0xb663('0x2a');_0x492fd1[_0xb663('0x2b')]=0x0;_0x492fd1[_0xb663('0x2c')]=0x1;_0x492fd1[_0xb663('0x2d')]=_0x1a8e8a['membername'];_0x492fd1[_0xb663('0x2e')]='COMPLETED';return BPromise[_0xb663('0x8')]()['then'](voiceQueueReport[_0xb663('0x2f')](_0x492fd1))[_0xb663('0xa')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xb663('0x30')]=function(_0x5b50ef,_0x40ec34){return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](cmHopper['getContactRecallMe'](_0x5b50ef,_0x40ec34))[_0xb663('0xa')](loggerCatch(_0xb663('0x31')));};exports[_0xb663('0x32')]=function(_0x2fcf94){return BPromise[_0xb663('0x8')]()[_0xb663('0xc')](cmHopper[_0xb663('0x14')](_0x2fcf94,!![],!![]))['catch'](loggerCatch(_0xb663('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 e12b2d4..9a1b617 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 _0xc3f8=['YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','logCustomer','endtime','talktime','answertime','isFailure','Failure','calleridname','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','calleridnum','callbackuniqueid','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','logAgent'];(function(_0x1dbbce,_0x48410a){var _0x30b20d=function(_0x239d3e){while(--_0x239d3e){_0x1dbbce['push'](_0x1dbbce['shift']());}};_0x30b20d(++_0x48410a);}(_0xc3f8,0xdf));var _0x8c3f=function(_0x384d91,_0xedbef1){_0x384d91=_0x384d91-0x0;var _0x415b03=_0xc3f8[_0x384d91];return _0x415b03;};'use strict';var util=require(_0x8c3f('0x0'));var _=require(_0x8c3f('0x1'));var moment=require(_0x8c3f('0x2'));var logger=require(_0x8c3f('0x3'))(_0x8c3f('0x4'));var ipAgi=process[_0x8c3f('0x5')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x442839,_0x5a4797){var _0x1d6084=moment(_0x442839)['milliseconds'](0x0);var _0xa4d9e6=moment(_0x5a4797)[_0x8c3f('0x6')](0x0);return _0x1d6084[_0x8c3f('0x7')](_0xa4d9e6,_0x8c3f('0x8'));}exports[_0x8c3f('0x9')]=function(_0xb6c6b6){return function(_0xb36768){logger[_0x8c3f('0xa')](_0xb6c6b6,util[_0x8c3f('0xb')](_0xb36768,{'showHidden':![],'depth':null}));};};exports[_0x8c3f('0xc')]=function(_0x5eea2e,_0x1e1f93){logger[_0x8c3f('0xd')](_0x5eea2e,util['inspect'](_0x1e1f93,{'showHidden':![],'depth':null}));};exports[_0x8c3f('0xe')]=function(_0x387a80,_0x558f9b){logger[_0x8c3f('0xa')](_0x387a80,util[_0x8c3f('0xb')](_0x558f9b,{'showHidden':![],'depth':null}));};exports[_0x8c3f('0xf')]=function(_0x5a7563){return function(_0x48c827){logger[_0x8c3f('0xd')](_0x5a7563,util['inspect'](_0x48c827,{'showHidden':![],'depth':null}));};};exports[_0x8c3f('0x10')]=function(_0xda4bae,_0x1eeca6,_0x448ed5){return{'message':_0xda4bae,'unlock':_0x1eeca6,'active':_0x448ed5};};exports[_0x8c3f('0x11')]=function(_0x5f3610,_0x316f4d,_0x1995dd){if(!_[_0x8c3f('0x12')](_0x1995dd)&&_0x8c3f('0x13')===typeof _0x1995dd&&!_['isEmpty'](_0x1995dd)){if(!_[_0x8c3f('0x12')](_0x316f4d)&&'string'===typeof _0x316f4d&&!_[_0x8c3f('0x14')](_0x316f4d)){return util[_0x8c3f('0x15')]('\x22%s\x22\x20<%s>',_0x316f4d,_0x1995dd);}return util['format'](_0x8c3f('0x16'),_0x1995dd,_0x1995dd);}if(!_[_0x8c3f('0x12')](_0x5f3610)&&_0x8c3f('0x13')===typeof _0x5f3610&&!_[_0x8c3f('0x14')](_0x5f3610)){return _0x5f3610;}return _0x8c3f('0x17');};exports['isActive']=function(_0x4f9b37){if(_['isNil'](_0x4f9b37)){return![];}return _0x4f9b37;};exports[_0x8c3f('0x18')]=function(_0x4b6540,_0x1f2f1c,_0x724770,_0x341c7c,_0x49a310,_0x43ec72){var _0x195afc={'XMD-QUEUE':_0x1f2f1c[_0x8c3f('0x19')]?_0x1f2f1c[_0x8c3f('0x19')][_0x8c3f('0x1a')]:'','XMD-CALLERID':_0x341c7c,'XMD-CALLERID-PREVIEW':_0x43ec72?util[_0x8c3f('0x15')](_0x8c3f('0x16'),_0x43ec72['calleridname'],_0x43ec72['calleridnum']):_0x341c7c,'XMD-DIALID':_0x49a310,'XMD-CONTACTID':_0x1f2f1c['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x341c7c,'XMD-VOICEQUEUEID':_0x1f2f1c[_0x8c3f('0x1b')],'XMD-DIALCHANNEL':_0x724770,'XMD-DIALTIMEOUT':_0x4b6540[_0x8c3f('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x8c3f('0x15')]('\x22rtTxX%s%s\x22',_0x4b6540[_0x8c3f('0x1d')]?'g':'',_[_0x8c3f('0x14')](_0x4b6540['monitor_format'])?'':_0x8c3f('0x1e')),'XMD-DIALURL':_0x4b6540[_0x8c3f('0x1f')]||'','XMD-AGI':_0x4b6540['dialQueueProject']?util['format'](_0x8c3f('0x20'),ipAgi,_0x4b6540[_0x8c3f('0x21')]):_0x8c3f('0x22'),'XMD-AGIAFTER':_0x4b6540['dialQueueProject2']?util[_0x8c3f('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b6540[_0x8c3f('0x1d')]):_0x8c3f('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x43ec72?_0x43ec72['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x43ec72?_0x43ec72[_0x8c3f('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x8c3f('0x14')](_0x4b6540[_0x8c3f('0x24')])){_0x195afc[util[_0x8c3f('0x15')]('%s',_0x8c3f('0x25'))]=_0x4b6540[_0x8c3f('0x24')];_0x195afc[util[_0x8c3f('0x15')]('%s',_0x8c3f('0x26'))]=_0x49a310;}if(_0x1f2f1c&&_0x1f2f1c[_0x8c3f('0x27')]){for(var _0x4aafdf in _0x1f2f1c[_0x8c3f('0x27')]){if(_0x1f2f1c[_0x8c3f('0x27')]['hasOwnProperty'](_0x4aafdf)){if(!_['isNil'](_0x1f2f1c[_0x8c3f('0x27')][_0x4aafdf])&&_0x4aafdf!=='id'&&_0x4aafdf!==_0x8c3f('0x28')&&_0x4aafdf!==_0x8c3f('0x29')&&_0x4aafdf!==_0x8c3f('0x2a')){_0x195afc[util['format'](_0x8c3f('0x2b'),_0x8c3f('0x2c'),_[_0x8c3f('0x2d')](_0x4aafdf))]=_0x1f2f1c[_0x8c3f('0x27')][_0x4aafdf];}}}}return _0x195afc;};exports[_0x8c3f('0x2e')]=function(_0x491519){var _0x4b883b={};for(var _0x2e2b30 in _0x491519){if(_0x491519[_0x8c3f('0x2f')](_0x2e2b30)){_0x4b883b[util[_0x8c3f('0x15')]('%s',_['toLower'](_0x2e2b30))]=_0x491519[_0x2e2b30];}}return{'variables':_0x4b883b};};exports[_0x8c3f('0x30')]=function(_0x1c6714,_0x4b0992){if(!_[_0x8c3f('0x31')](_0x1c6714)){if(_0x1c6714[_0x8c3f('0x2f')](_0x8c3f('0x32'))){if(_0x1c6714[_0x8c3f('0x32')]>0x0){_0x1c6714['originated']-=0x1;}else{logger[_0x8c3f('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4b0992);}}}else{logger[_0x8c3f('0xa')](_0x8c3f('0x33'),_0x4b0992);}};exports[_0x8c3f('0x34')]=function(_0x23a7a6){var _0x4832ae=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x23a7a6[_0x8c3f('0x35')]=0xd;_0x23a7a6[_0x8c3f('0x36')]=_0x8c3f('0x37');_0x23a7a6[_0x8c3f('0x38')]=_0x4832ae;_0x23a7a6[_0x8c3f('0x39')]=_0x4832ae;_0x23a7a6['endtime']=_0x4832ae;};exports[_0x8c3f('0x3a')]=function(_0x10c014,_0x2c6305,_0x2ed5f8){var _0x1400a4=moment()[_0x8c3f('0x15')](_0x8c3f('0x3b'));_0x10c014['state']=_0x2c6305;_0x10c014[_0x8c3f('0x36')]=_0x2ed5f8;_0x10c014[_0x8c3f('0x39')]=_0x1400a4;_0x10c014[_0x8c3f('0x3c')]=getSeconds(_0x10c014[_0x8c3f('0x39')],_0x10c014['starttime']);};exports[_0x8c3f('0x3d')]=function(_0x249bea,_0x25dd30,_0x145b19){_0x249bea[_0x8c3f('0x3e')]=_0x25dd30;_0x249bea['UserId']=_0x145b19;};exports[_0x8c3f('0x3f')]=function(_0x1a1cd2,_0x3693a4,_0xc2efd){var _0x175481=moment()['format'](_0x8c3f('0x3b'));_0x1a1cd2[_0x8c3f('0x35')]=_0x3693a4;_0x1a1cd2[_0x8c3f('0x36')]=_0xc2efd;_0x1a1cd2[_0x8c3f('0x39')]=_0x1a1cd2['responsetime']?_0x1a1cd2[_0x8c3f('0x39')]:_0x175481;_0x1a1cd2[_0x8c3f('0x40')]=_0x1a1cd2['endtime']?_0x1a1cd2[_0x8c3f('0x40')]:_0x175481;_0x1a1cd2['ringtime']=getSeconds(_0x1a1cd2['responsetime']||0x0,_0x1a1cd2[_0x8c3f('0x38')]||0x0);_0x1a1cd2[_0x8c3f('0x41')]=_0x1a1cd2['answertime']?getSeconds(_0x1a1cd2[_0x8c3f('0x40')],_0x1a1cd2[_0x8c3f('0x42')]):0x0;};exports[_0x8c3f('0x43')]=function(_0x599eb7){return _0x599eb7===_0x8c3f('0x44');};exports['variablesAction']=function(_0x52f874,_0x30feac,_0x26bb2d,_0x14ad71,_0x19f4ba){var _0x47e1a1=_0x14ad71?'RECALL':_0x52f874[_0x8c3f('0x45')];_0x47e1a1=_0x19f4ba?_0x8c3f('0x46'):_0x47e1a1;return{'actionid':_0x52f874[_0x8c3f('0x47')],'action':_0x8c3f('0x48'),'channel':_0x52f874['channelAgent'],'callerid':util[_0x8c3f('0x15')](_0x8c3f('0x16'),_0x47e1a1,_0x52f874['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x8c3f('0x49'),'Priority':'1','variable':_0x26bb2d,'timeout':(_0x30feac[_0x8c3f('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52f874[_0x8c3f('0x47')]};};exports[_0x8c3f('0x4b')]=function(_0x40a72a){return _0x40a72a[_0x8c3f('0x4c')]+_0x40a72a[_0x8c3f('0x4d')]+_0x40a72a[_0x8c3f('0x4e')]+_0x40a72a['countagentrejectretry']+_0x40a72a[_0x8c3f('0x4f')];};exports[_0x8c3f('0x50')]=function(_0xf13740){var _0x3cb608=_[_0x8c3f('0x51')](_0xf13740);_0x3cb608[_0x8c3f('0x35')]=0xf;_0x3cb608['statedesc']=_0x8c3f('0x52');return _0x3cb608;};exports[_0x8c3f('0x53')]=function(_0x5e8d5f,_0x423225,_0x4fab73){var _0x4d4824={};_0x4d4824[_0x423225]=_0x5e8d5f[_0x423225];_0x4d4824[_0x8c3f('0x54')]=![];_0x4d4824[_0x8c3f('0x55')]=moment()[_0x8c3f('0x56')](_0x4fab73,_0x8c3f('0x57'))[_0x8c3f('0x15')](_0x8c3f('0x3b'));_0x4d4824[_0x8c3f('0x58')]=_0x5e8d5f[_0x8c3f('0x58')];_0x4d4824[_0x8c3f('0x59')]=_0x5e8d5f[_0x8c3f('0x59')];_0x4d4824[_0x8c3f('0x1b')]=_0x5e8d5f[_0x8c3f('0x1b')]||undefined;return _0x4d4824;};exports[_0x8c3f('0x5a')]=function(_0x5a7964,_0x3135d5){if(!_['isNil'](_0x5a7964)){if(_0x5a7964['pTalking']>0x0){_0x5a7964[_0x8c3f('0x5b')]-=0x1;}else{logger['error'](_0x3135d5,_0x8c3f('0x5c'));}}else{logger[_0x8c3f('0xa')](_0x3135d5,_0x8c3f('0x5d'));}};exports[_0x8c3f('0x5e')]=function(_0xfd93d3){if(_0xfd93d3<=0x0){return!![];}return![];};exports['buildObj']=function(_0xd08e35,_0x144206,_0xf1980a){_0xd08e35['lastevent']=_0x144206;_0xd08e35[_0x8c3f('0x1a')]=_0xd08e35[_0x8c3f('0x5f')];_0xd08e35[_0x8c3f('0x60')]=_0xd08e35[_0x8c3f('0x61')];_0xd08e35[_0x8c3f('0x62')]=_0x8c3f('0x63');if(_0xf1980a){_0xd08e35['mandatoryDisposition']=_0xf1980a[_0x8c3f('0x64')];}return _0xd08e35;};exports[_0x8c3f('0x65')]=function(_0x57b734){var _0x33ccdf={};_0x33ccdf[_0x8c3f('0x5f')]=_0x57b734[_0x8c3f('0x5f')];_0x33ccdf['interface']=_0x57b734[_0x8c3f('0x61')];_0x33ccdf[_0x8c3f('0x47')]=_0x57b734[_0x8c3f('0x47')];return _0x33ccdf;};exports[_0x8c3f('0x66')]=function(_0x174d44){var _0x27f233=[];for(var _0x202406 in _0x174d44){if(_0x174d44['hasOwnProperty'](_0x202406)){if(!_[_0x8c3f('0x31')](_0x174d44[_0x202406])&&_0x174d44[_0x202406][_0x8c3f('0x35')]===_0x8c3f('0x67')&&_0x174d44[_0x202406][_0x8c3f('0x68')]===_0x8c3f('0x69')){_0x27f233[_0x8c3f('0x6a')](_0x174d44[_0x202406]['id']);}}}return _0x27f233;};exports[_0x8c3f('0x6b')]=function(_0x1b622c){var _0x5bef4=moment()['milliseconds'](0x0);var _0x1fa4b9=moment(_0x1b622c)[_0x8c3f('0x6')](0x0);return _0x5bef4[_0x8c3f('0x7')](_0x1fa4b9,_0x8c3f('0x8'));};exports[_0x8c3f('0x6c')]=function(_0x5802c9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5802c9[_0x8c3f('0x58')],'ListId':_0x5802c9[_0x8c3f('0x59')],'VoiceQueueId':_0x5802c9['VoiceQueueId']||undefined,'CampaignId':_0x5802c9[_0x8c3f('0x6d')]||undefined};};exports['filterKey']=function(_0x3ef82b){if(_0x3ef82b==='uniqueid'||_0x3ef82b===_0x8c3f('0x6e')||_0x3ef82b===_0x8c3f('0x5f')||_0x3ef82b===_0x8c3f('0x6f')||_0x3ef82b===_0x8c3f('0x70')||_0x3ef82b===_0x8c3f('0x71')||_0x3ef82b===_0x8c3f('0x3e')||_0x3ef82b===_0x8c3f('0x61')||_0x3ef82b==='calleridname'||_0x3ef82b===_0x8c3f('0x54')||_0x3ef82b===_0x8c3f('0x72')||_0x3ef82b===_0x8c3f('0x55')||_0x3ef82b===_0x8c3f('0x4c')||_0x3ef82b===_0x8c3f('0x4d')||_0x3ef82b==='countnoanswerretry'||_0x3ef82b==='countglobal'||_0x3ef82b==='callback'||_0x3ef82b===_0x8c3f('0x73')||_0x3ef82b==='callbackat'||_0x3ef82b==='recallme'||_0x3ef82b===_0x8c3f('0x58')||_0x3ef82b===_0x8c3f('0x59')||_0x3ef82b==='UserId'||_0x3ef82b===_0x8c3f('0x1b')||_0x3ef82b===_0x8c3f('0x74')||_0x3ef82b==='xmd-voicequeueid'||_0x3ef82b===_0x8c3f('0x75')||_0x3ef82b===_0x8c3f('0x76')||_0x3ef82b===_0x8c3f('0x77')||_0x3ef82b===_0x8c3f('0x78')||_0x3ef82b==='xmd-dialtimeout'||_0x3ef82b===_0x8c3f('0x79')||_0x3ef82b==='xmd-dialid'||_0x3ef82b===_0x8c3f('0x7a')||_0x3ef82b===_0x8c3f('0x7b')||_0x3ef82b===_0x8c3f('0x7c')||_0x3ef82b==='xmd-callerid'||_0x3ef82b===_0x8c3f('0x7d')||_0x3ef82b===_0x8c3f('0x7e')||_0x3ef82b==='rtpaudioqos'||_0x3ef82b==='rtpaudioqosbridged'||_0x3ef82b==='rtpaudioqosjitter'||_0x3ef82b==='rtpaudioqosjitterbridged'||_0x3ef82b===_0x8c3f('0x7f')||_0x3ef82b==='rtpaudioqoslossbridged'||_0x3ef82b==='rtpaudioqosrtt'||_0x3ef82b===_0x8c3f('0x80')||_0x3ef82b==='rtpaudioqos'||_0x3ef82b===_0x8c3f('0x81')||_0x3ef82b===_0x8c3f('0x82')||_0x3ef82b==='rtpaudioqosjitterbridged'||_0x3ef82b===_0x8c3f('0x7f')||_0x3ef82b===_0x8c3f('0x83')||_0x3ef82b===_0x8c3f('0x84')||_0x3ef82b===_0x8c3f('0x80')||_0x3ef82b===_0x8c3f('0x85')||_0x3ef82b==='bridgepvtcallid'||_0x3ef82b===_0x8c3f('0x35')||_0x3ef82b===_0x8c3f('0x36')){return![];}return!![];};exports[_0x8c3f('0x86')]=function(_0x21040c,_0x275a2f){var _0xa2fe3c,_0x2c224f,_0x1183c7;if(_0x275a2f<=0x0){_0x275a2f=0x1;}_0xa2fe3c=new RegExp(_0x8c3f('0x87')+_0x275a2f+'}$');_0x2c224f=Math[_0x8c3f('0x88')](0xa,_0x275a2f-0x1);_0x1183c7=Math[_0x8c3f('0x88')](0xa,_0x275a2f)-0x1;return util['format']('%s',_['replace'](_0x21040c,_0xa2fe3c,_[_0x8c3f('0x89')](_0x2c224f,_0x1183c7)));};exports[_0x8c3f('0x8a')]=function(_0x5c6347){var _0x348cb2=_0x5c6347[_0x8c3f('0x8b')](/"(.*?)"/);return _0x348cb2?_0x348cb2[0x1]:_0x5c6347;};exports[_0x8c3f('0x8c')]=function(_0x1d6e3b){var _0xec19d2=_0x1d6e3b[_0x8c3f('0x8b')](/<(.*?)>/);return _0xec19d2?_0xec19d2[0x1]:_0x1d6e3b;}; \ No newline at end of file +var _0xfc82=['\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','queue','interface','voice','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','seconds','createBody','filterKey','idContact','campaigntype','dialAnswer','countnoanswerretry','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','inspect','logger','info','loggerError','logger2','message','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','format','calleridname','ContactId','dialer','VoiceQueueId'];(function(_0x549ff2,_0x2ac58f){var _0x5f5beb=function(_0x3d88f7){while(--_0x3d88f7){_0x549ff2['push'](_0x549ff2['shift']());}};_0x5f5beb(++_0x2ac58f);}(_0xfc82,0xfb));var _0x2fc8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xfc82[_0x2d7f0e];return _0x110b07;};'use strict';var util=require(_0x2fc8('0x0'));var _=require(_0x2fc8('0x1'));var moment=require(_0x2fc8('0x2'));var logger=require(_0x2fc8('0x3'))('preview');var ipAgi=process[_0x2fc8('0x4')][_0x2fc8('0x5')]||_0x2fc8('0x6');function getSeconds(_0x522362,_0x3beeb0){var _0xbf7258=moment(_0x522362)['milliseconds'](0x0);var _0x365997=moment(_0x3beeb0)[_0x2fc8('0x7')](0x0);return _0xbf7258[_0x2fc8('0x8')](_0x365997,'seconds');}exports['loggerCatch']=function(_0x2360a4){return function(_0x24bff0){logger['error'](_0x2360a4,util[_0x2fc8('0x9')](_0x24bff0,{'showHidden':![],'depth':null}));};};exports[_0x2fc8('0xa')]=function(_0xee4ae6,_0x300128){logger[_0x2fc8('0xb')](_0xee4ae6,util['inspect'](_0x300128,{'showHidden':![],'depth':null}));};exports[_0x2fc8('0xc')]=function(_0x33bb27,_0x456d0c){logger['error'](_0x33bb27,util[_0x2fc8('0x9')](_0x456d0c,{'showHidden':![],'depth':null}));};exports[_0x2fc8('0xd')]=function(_0x5efec2){return function(_0xe1a2e6){logger[_0x2fc8('0xb')](_0x5efec2,util[_0x2fc8('0x9')](_0xe1a2e6,{'showHidden':![],'depth':null}));};};exports[_0x2fc8('0xe')]=function(_0x3a9108,_0x168442,_0x1629c5){return{'message':_0x3a9108,'unlock':_0x168442,'active':_0x1629c5};};exports['getCallerId']=function(_0x5c0ae8,_0x25ad02,_0x31f070){if(!_[_0x2fc8('0xf')](_0x31f070)&&'string'===typeof _0x31f070&&!_[_0x2fc8('0x10')](_0x31f070)){if(!_['isUndefined'](_0x25ad02)&&_0x2fc8('0x11')===typeof _0x25ad02&&!_[_0x2fc8('0x10')](_0x25ad02)){return util['format'](_0x2fc8('0x12'),_0x25ad02,_0x31f070);}return util['format'](_0x2fc8('0x12'),_0x31f070,_0x31f070);}if(!_[_0x2fc8('0xf')](_0x5c0ae8)&&_0x2fc8('0x11')===typeof _0x5c0ae8&&!_[_0x2fc8('0x10')](_0x5c0ae8)){return _0x5c0ae8;}return _0x2fc8('0x13');};exports[_0x2fc8('0x14')]=function(_0x26e2d8){if(_[_0x2fc8('0x15')](_0x26e2d8)){return![];}return _0x26e2d8;};exports[_0x2fc8('0x16')]=function(_0x2669da,_0x2b0226,_0x47c01d,_0x325c43,_0x570ace,_0x504832){var _0x140625={'XMD-QUEUE':_0x2b0226['Queue']?_0x2b0226[_0x2fc8('0x17')]['name']:'','XMD-CALLERID':_0x325c43,'XMD-CALLERID-PREVIEW':_0x504832?util[_0x2fc8('0x18')](_0x2fc8('0x12'),_0x504832[_0x2fc8('0x19')],_0x504832['calleridnum']):_0x325c43,'XMD-DIALID':_0x570ace,'XMD-CONTACTID':_0x2b0226[_0x2fc8('0x1a')],'XMD-CDRTYPE':_0x2fc8('0x1b'),'CALLERID(all)':_0x325c43,'XMD-VOICEQUEUEID':_0x2b0226[_0x2fc8('0x1c')],'XMD-DIALCHANNEL':_0x47c01d,'XMD-DIALTIMEOUT':_0x2669da['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x2fc8('0x18')](_0x2fc8('0x1d'),_0x2669da[_0x2fc8('0x1e')]?'g':'',_[_0x2fc8('0x10')](_0x2669da[_0x2fc8('0x1f')])?'':_0x2fc8('0x20')),'XMD-DIALURL':_0x2669da[_0x2fc8('0x21')]||'','XMD-AGI':_0x2669da[_0x2fc8('0x22')]?util[_0x2fc8('0x18')](_0x2fc8('0x23'),ipAgi,_0x2669da[_0x2fc8('0x22')]):_0x2fc8('0x24'),'XMD-AGIAFTER':_0x2669da['dialQueueProject2']?util[_0x2fc8('0x18')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2669da[_0x2fc8('0x1e')]):_0x2fc8('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x504832?_0x504832[_0x2fc8('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x504832?_0x504832[_0x2fc8('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x2fc8('0x27')};if(!_['isEmpty'](_0x2669da[_0x2fc8('0x1f')])){_0x140625[util[_0x2fc8('0x18')]('%s',_0x2fc8('0x28'))]=_0x2669da['monitor_format'];_0x140625[util[_0x2fc8('0x18')]('%s',_0x2fc8('0x29'))]=_0x570ace;}if(_0x2b0226&&_0x2b0226[_0x2fc8('0x2a')]){for(var _0x70f649 in _0x2b0226['Contact']){if(_0x2b0226[_0x2fc8('0x2a')][_0x2fc8('0x2b')](_0x70f649)){if(!_[_0x2fc8('0x15')](_0x2b0226[_0x2fc8('0x2a')][_0x70f649])&&_0x70f649!=='id'&&_0x70f649!==_0x2fc8('0x2c')&&_0x70f649!==_0x2fc8('0x2d')&&_0x70f649!=='updatedAt'){_0x140625[util['format'](_0x2fc8('0x2e'),'XMD-',_[_0x2fc8('0x2f')](_0x70f649))]=_0x2b0226['Contact'][_0x70f649];}}}}return _0x140625;};exports[_0x2fc8('0x30')]=function(_0xfe0b93){var _0x328add={};for(var _0x2daf62 in _0xfe0b93){if(_0xfe0b93[_0x2fc8('0x2b')](_0x2daf62)){_0x328add[util[_0x2fc8('0x18')]('%s',_[_0x2fc8('0x31')](_0x2daf62))]=_0xfe0b93[_0x2daf62];}}return{'variables':_0x328add};};exports[_0x2fc8('0x32')]=function(_0x304f98,_0x2afc37){if(!_[_0x2fc8('0x15')](_0x304f98)){if(_0x304f98[_0x2fc8('0x2b')](_0x2fc8('0x33'))){if(_0x304f98[_0x2fc8('0x33')]>0x0){_0x304f98['originated']-=0x1;}else{logger[_0x2fc8('0x34')](_0x2fc8('0x35'),_0x2afc37);}}}else{logger[_0x2fc8('0x34')](_0x2fc8('0x36'),_0x2afc37);}};exports[_0x2fc8('0x37')]=function(_0x3b2524){var _0xcd9b24=moment()[_0x2fc8('0x18')](_0x2fc8('0x38'));_0x3b2524[_0x2fc8('0x39')]=0xd;_0x3b2524[_0x2fc8('0x3a')]=_0x2fc8('0x3b');_0x3b2524['starttime']=_0xcd9b24;_0x3b2524[_0x2fc8('0x3c')]=_0xcd9b24;_0x3b2524[_0x2fc8('0x3d')]=_0xcd9b24;};exports[_0x2fc8('0x3e')]=function(_0x3ad3ba,_0xd9f619,_0x13462b){var _0x5d7c92=moment()[_0x2fc8('0x18')](_0x2fc8('0x38'));_0x3ad3ba[_0x2fc8('0x39')]=_0xd9f619;_0x3ad3ba[_0x2fc8('0x3a')]=_0x13462b;_0x3ad3ba['responsetime']=_0x5d7c92;_0x3ad3ba[_0x2fc8('0x3f')]=getSeconds(_0x3ad3ba[_0x2fc8('0x3c')],_0x3ad3ba[_0x2fc8('0x40')]);};exports[_0x2fc8('0x41')]=function(_0x278c22,_0x203bd6,_0x33a6bc){_0x278c22[_0x2fc8('0x42')]=_0x203bd6;_0x278c22['UserId']=_0x33a6bc;};exports[_0x2fc8('0x43')]=function(_0x5f37dc,_0x1a0890,_0x109c3b){var _0x6d2df5=moment()[_0x2fc8('0x18')](_0x2fc8('0x38'));_0x5f37dc[_0x2fc8('0x39')]=_0x1a0890;_0x5f37dc[_0x2fc8('0x3a')]=_0x109c3b;_0x5f37dc['responsetime']=_0x5f37dc[_0x2fc8('0x3c')]?_0x5f37dc[_0x2fc8('0x3c')]:_0x6d2df5;_0x5f37dc[_0x2fc8('0x3d')]=_0x5f37dc[_0x2fc8('0x3d')]?_0x5f37dc[_0x2fc8('0x3d')]:_0x6d2df5;_0x5f37dc[_0x2fc8('0x3f')]=getSeconds(_0x5f37dc['responsetime']||0x0,_0x5f37dc[_0x2fc8('0x40')]||0x0);_0x5f37dc[_0x2fc8('0x44')]=_0x5f37dc[_0x2fc8('0x45')]?getSeconds(_0x5f37dc[_0x2fc8('0x3d')],_0x5f37dc['answertime']):0x0;};exports[_0x2fc8('0x46')]=function(_0x298416){return _0x298416===_0x2fc8('0x47');};exports[_0x2fc8('0x48')]=function(_0x19f64d,_0x36f806,_0x45ad21,_0x4ae6f1,_0x99472){var _0x5c4ec4=_0x4ae6f1?_0x2fc8('0x49'):_0x19f64d[_0x2fc8('0x19')];_0x5c4ec4=_0x99472?_0x2fc8('0x4a'):_0x5c4ec4;return{'actionid':_0x19f64d[_0x2fc8('0x4b')],'action':_0x2fc8('0x4c'),'channel':_0x19f64d[_0x2fc8('0x4d')],'callerid':util[_0x2fc8('0x18')](_0x2fc8('0x12'),_0x5c4ec4,_0x19f64d['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x45ad21,'timeout':(_0x36f806[_0x2fc8('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x19f64d[_0x2fc8('0x4b')]};};exports[_0x2fc8('0x4f')]=function(_0x3cdc17){return _0x3cdc17[_0x2fc8('0x50')]+_0x3cdc17[_0x2fc8('0x51')]+_0x3cdc17['countnoanswerretry']+_0x3cdc17['countagentrejectretry']+_0x3cdc17['countnosuchnumberretry'];};exports[_0x2fc8('0x52')]=function(_0x304717){var _0x30d13b=_['clone'](_0x304717);_0x30d13b['state']=0xf;_0x30d13b[_0x2fc8('0x3a')]=_0x2fc8('0x53');return _0x30d13b;};exports[_0x2fc8('0x54')]=function(_0x53ffaa,_0x8904d5,_0x26ebb7){var _0x1dd0e8={};_0x1dd0e8[_0x8904d5]=_0x53ffaa[_0x8904d5];_0x1dd0e8[_0x2fc8('0x55')]=![];_0x1dd0e8[_0x2fc8('0x56')]=moment()['add'](_0x26ebb7,_0x2fc8('0x57'))[_0x2fc8('0x18')]('YYYY-MM-DD\x20HH:mm:ss');_0x1dd0e8[_0x2fc8('0x1a')]=_0x53ffaa[_0x2fc8('0x1a')];_0x1dd0e8[_0x2fc8('0x58')]=_0x53ffaa[_0x2fc8('0x58')];_0x1dd0e8['VoiceQueueId']=_0x53ffaa[_0x2fc8('0x1c')]||undefined;return _0x1dd0e8;};exports[_0x2fc8('0x59')]=function(_0x4e1932,_0xa4b768){if(!_['isNil'](_0x4e1932)){if(_0x4e1932[_0x2fc8('0x5a')]>0x0){_0x4e1932[_0x2fc8('0x5a')]-=0x1;}else{logger[_0x2fc8('0x34')](_0xa4b768,_0x2fc8('0x5b'));}}else{logger[_0x2fc8('0x34')](_0xa4b768,_0x2fc8('0x5c'));}};exports['IsNotLoggedIn']=function(_0x19ff5d){if(_0x19ff5d<=0x0){return!![];}return![];};exports[_0x2fc8('0x5d')]=function(_0x48e939,_0x459d93,_0x14d7ac){_0x48e939[_0x2fc8('0x5e')]=_0x459d93;_0x48e939[_0x2fc8('0x5f')]=_0x48e939[_0x2fc8('0x60')];_0x48e939[_0x2fc8('0x61')]=_0x48e939[_0x2fc8('0x4d')];_0x48e939['motionChannel']=_0x2fc8('0x62');if(_0x14d7ac){_0x48e939[_0x2fc8('0x63')]=_0x14d7ac[_0x2fc8('0x63')];}return _0x48e939;};exports[_0x2fc8('0x64')]=function(_0x1cc77a){var _0x3894be={};_0x3894be[_0x2fc8('0x60')]=_0x1cc77a[_0x2fc8('0x60')];_0x3894be[_0x2fc8('0x61')]=_0x1cc77a[_0x2fc8('0x4d')];_0x3894be[_0x2fc8('0x4b')]=_0x1cc77a[_0x2fc8('0x4b')];return _0x3894be;};exports['agentReadyId']=function(_0x57f2cd){var _0x16b2b1=[];for(var _0x81b1a7 in _0x57f2cd){if(_0x57f2cd[_0x2fc8('0x2b')](_0x81b1a7)){if(!_[_0x2fc8('0x15')](_0x57f2cd[_0x81b1a7])&&_0x57f2cd[_0x81b1a7][_0x2fc8('0x39')]===_0x2fc8('0x65')&&_0x57f2cd[_0x81b1a7][_0x2fc8('0x66')]===_0x2fc8('0x67')){_0x16b2b1[_0x2fc8('0x68')](_0x57f2cd[_0x81b1a7]['id']);}}}return _0x16b2b1;};exports[_0x2fc8('0x69')]=function(_0x331a3){var _0xc18a26=moment()[_0x2fc8('0x7')](0x0);var _0x8fd983=moment(_0x331a3)[_0x2fc8('0x7')](0x0);return _0xc18a26[_0x2fc8('0x8')](_0x8fd983,_0x2fc8('0x6a'));};exports[_0x2fc8('0x6b')]=function(_0x536910){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x536910['ContactId'],'ListId':_0x536910[_0x2fc8('0x58')],'VoiceQueueId':_0x536910['VoiceQueueId']||undefined,'CampaignId':_0x536910['CampaignId']||undefined};};exports[_0x2fc8('0x6c')]=function(_0x45ed79){if(_0x45ed79===_0x2fc8('0x4b')||_0x45ed79===_0x2fc8('0x6d')||_0x45ed79==='queue'||_0x45ed79==='type'||_0x45ed79===_0x2fc8('0x6e')||_0x45ed79===_0x2fc8('0x6f')||_0x45ed79===_0x2fc8('0x42')||_0x45ed79===_0x2fc8('0x4d')||_0x45ed79===_0x2fc8('0x19')||_0x45ed79==='active'||_0x45ed79==='calleridnum'||_0x45ed79==='scheduledat'||_0x45ed79===_0x2fc8('0x50')||_0x45ed79===_0x2fc8('0x51')||_0x45ed79===_0x2fc8('0x70')||_0x45ed79==='countglobal'||_0x45ed79==='callback'||_0x45ed79===_0x2fc8('0x71')||_0x45ed79===_0x2fc8('0x72')||_0x45ed79==='recallme'||_0x45ed79===_0x2fc8('0x1a')||_0x45ed79===_0x2fc8('0x58')||_0x45ed79==='UserId'||_0x45ed79==='VoiceQueueId'||_0x45ed79===_0x2fc8('0x73')||_0x45ed79===_0x2fc8('0x74')||_0x45ed79===_0x2fc8('0x75')||_0x45ed79===_0x2fc8('0x76')||_0x45ed79==='xmd-listid'||_0x45ed79==='xmd-dialurl'||_0x45ed79===_0x2fc8('0x77')||_0x45ed79===_0x2fc8('0x78')||_0x45ed79===_0x2fc8('0x79')||_0x45ed79==='xmd-dialchannel'||_0x45ed79==='xmd-contactid'||_0x45ed79==='xmd-cdrtype'||_0x45ed79===_0x2fc8('0x7a')||_0x45ed79===_0x2fc8('0x7b')||_0x45ed79==='xmd-agi'||_0x45ed79===_0x2fc8('0x7c')||_0x45ed79===_0x2fc8('0x7d')||_0x45ed79===_0x2fc8('0x7e')||_0x45ed79===_0x2fc8('0x7f')||_0x45ed79===_0x2fc8('0x80')||_0x45ed79===_0x2fc8('0x81')||_0x45ed79==='rtpaudioqosrtt'||_0x45ed79===_0x2fc8('0x82')||_0x45ed79===_0x2fc8('0x7c')||_0x45ed79===_0x2fc8('0x7d')||_0x45ed79===_0x2fc8('0x7e')||_0x45ed79===_0x2fc8('0x7f')||_0x45ed79===_0x2fc8('0x80')||_0x45ed79===_0x2fc8('0x81')||_0x45ed79===_0x2fc8('0x83')||_0x45ed79==='rtpaudioqosrttbridged'||_0x45ed79===_0x2fc8('0x84')||_0x45ed79===_0x2fc8('0x85')||_0x45ed79===_0x2fc8('0x39')||_0x45ed79==='statedesc'){return![];}return!![];};exports[_0x2fc8('0x86')]=function(_0x506033,_0x45d3c6){var _0x3e7cc9,_0x4322fe,_0x19d8ab;if(_0x45d3c6<=0x0){_0x45d3c6=0x1;}_0x3e7cc9=new RegExp('\x5cw{0,'+_0x45d3c6+'}$');_0x4322fe=Math[_0x2fc8('0x87')](0xa,_0x45d3c6-0x1);_0x19d8ab=Math[_0x2fc8('0x87')](0xa,_0x45d3c6)-0x1;return util[_0x2fc8('0x18')]('%s',_[_0x2fc8('0x88')](_0x506033,_0x3e7cc9,_[_0x2fc8('0x89')](_0x4322fe,_0x19d8ab)));};exports[_0x2fc8('0x8a')]=function(_0x3ff1e8){var _0x26fc8d=_0x3ff1e8[_0x2fc8('0x8b')](/"(.*?)"/);return _0x26fc8d?_0x26fc8d[0x1]:_0x3ff1e8;};exports['extractCalleridNumber']=function(_0x1b0540){var _0x560be9=_0x1b0540[_0x2fc8('0x8b')](/<(.*?)>/);return _0x560be9?_0x560be9[0x1]:_0x1b0540;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index bfac067..caa3e2c 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 _0x7d8d=['queueadd','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x101fb8,_0x2de1ad){var _0x13aa8f=function(_0x4b0a14){while(--_0x4b0a14){_0x101fb8['push'](_0x101fb8['shift']());}};_0x13aa8f(++_0x2de1ad);}(_0x7d8d,0x134));var _0xd7d8=function(_0x5045d5,_0x5194e7){_0x5045d5=_0x5045d5-0x0;var _0x41e862=_0x7d8d[_0x5045d5];return _0x41e862;};'use strict';exports[_0xd7d8('0x0')]={'queue':{'type':_0xd7d8('0x1'),'required':!![]},'interface':{'type':_0xd7d8('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xd7d8('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xd7d8('0x3')]={'queue':{'type':_0xd7d8('0x1'),'required':!![]},'interface':{'type':_0xd7d8('0x1'),'required':!![]}};exports[_0xd7d8('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xd7d8('0x5')},'reason':{'type':_0xd7d8('0x1'),'required':![]}};exports[_0xd7d8('0x6')]={'module':{'type':_0xd7d8('0x1'),'required':![]}};exports[_0xd7d8('0x7')]={'uniqueid':{'type':_0xd7d8('0x1'),'required':!![]}};exports[_0xd7d8('0x8')]={'uniqueid':{'type':_0xd7d8('0x1'),'required':!![]},'filename':{'type':_0xd7d8('0x1')},'format':{'type':_0xd7d8('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xd7d8('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd7d8('0xa')]={'uniqueid':{'type':_0xd7d8('0x1'),'required':!![]},'exten':{'type':_0xd7d8('0x1'),'required':!![]},'context':{'type':_0xd7d8('0x1')}}; \ No newline at end of file +var _0x80ea=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80ea,0x1cf));var _0xa80e=function(_0x53f8d2,_0x3039d7){_0x53f8d2=_0x53f8d2-0x0;var _0x3bdf17=_0x80ea[_0x53f8d2];return _0x3bdf17;};'use strict';exports[_0xa80e('0x0')]={'queue':{'type':_0xa80e('0x1'),'required':!![]},'interface':{'type':_0xa80e('0x1'),'required':!![]},'membername':{'type':_0xa80e('0x1'),'required':!![]},'penalty':{'type':_0xa80e('0x2'),'required':![]},'paused':{'type':_0xa80e('0x3'),'required':![]}};exports[_0xa80e('0x4')]={'queue':{'type':_0xa80e('0x1'),'required':!![]},'interface':{'type':_0xa80e('0x1'),'required':!![]}};exports[_0xa80e('0x5')]={'interface':{'type':_0xa80e('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xa80e('0x6')]={'module':{'type':'string','required':![]}};exports[_0xa80e('0x7')]={'uniqueid':{'type':_0xa80e('0x1'),'required':!![]}};exports[_0xa80e('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xa80e('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xa80e('0x1')}};exports[_0xa80e('0x9')]={'uniqueid':{'type':_0xa80e('0x1'),'required':!![]}};exports[_0xa80e('0xa')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xa80e('0x1'),'required':!![]},'context':{'type':_0xa80e('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2a1b1f1..cc29b4f 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 _0x1ea0=['mergeFromDatabase','initTriggers','zendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','unmanaged','queuecallerabandon','diff','seconds','sumDuration','queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','mapKeys','format','SIP/%s','name','interface','hasOwnProperty','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','isUndefined'];(function(_0x547d1f,_0x5218e4){var _0x47ffc1=function(_0xd6ee5a){while(--_0xd6ee5a){_0x547d1f['push'](_0x547d1f['shift']());}};_0x47ffc1(++_0x5218e4);}(_0x1ea0,0x158));var _0x01ea=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1ea0[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x01ea('0x0'));var util=require('util');var _=require(_0x01ea('0x1'));var moment=require(_0x01ea('0x2'));var Agent=require(_0x01ea('0x3'));var Telephone=require(_0x01ea('0x4'));var Trunk=require(_0x01ea('0x5'));var VoiceQueue=require(_0x01ea('0x6'));var Trigger=require(_0x01ea('0x7'));var Template=require(_0x01ea('0x8'));var Campaign=require(_0x01ea('0x9'));var VoiceExtension=require(_0x01ea('0xa'));var ZendeskAccount=require(_0x01ea('0xb'));var SalesforceAccount=require(_0x01ea('0xc'));var FreshdeskAccount=require(_0x01ea('0xd'));var SugarcrmAccount=require(_0x01ea('0xe'));var ZohoAccount=require(_0x01ea('0xf'));var DeskAccount=require(_0x01ea('0x10'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x01ea('0x11'));var Dynamics365Account=require(_0x01ea('0x12'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x01ea('0x13'));var Realtime=function(){this[_0x01ea('0x14')]={};this[_0x01ea('0x15')]={};this[_0x01ea('0x16')]={};this[_0x01ea('0x17')]={};this[_0x01ea('0x18')]={};this[_0x01ea('0x19')]={};this[_0x01ea('0x1a')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x01ea('0x1b')]={};this['channels']={};this[_0x01ea('0x1c')]={};this[_0x01ea('0x1d')]={};this[_0x01ea('0x1e')]={};this[_0x01ea('0x1f')]={};this['zendeskAccounts']={};this[_0x01ea('0x20')]={};this[_0x01ea('0x21')]={};this[_0x01ea('0x22')]={};this[_0x01ea('0x23')]={};this['deskAccounts']={};this[_0x01ea('0x24')]={};this[_0x01ea('0x25')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0xb59d92,_0x2be326,_0x1f31aa){var _0x51b9fe=_[_0x01ea('0x26')](_0xb59d92,function(_0x5a7bbb,_0x54bbae){return _0x5a7bbb[_0x1f31aa];});for(var _0xde0a28 in _0x2be326){if(_0x2be326['hasOwnProperty'](_0xde0a28)){if(!_0x51b9fe[_0xde0a28]){delete _0x2be326[_0xde0a28];}}}}function freeIsNotKeySip(_0x3f8c4a,_0x2fae37){var _0x23293d=_['mapKeys'](_0x3f8c4a,function(_0xaee574,_0x18133e){return util[_0x01ea('0x27')](_0x01ea('0x28'),_0xaee574[_0x01ea('0x29')]);});for(var _0x387003 in _0x2fae37){if(_0x2fae37['hasOwnProperty'](_0x387003)){if(!_0x23293d[_0x387003]){delete _0x2fae37[_0x387003];}}}}function freeIsNotKeyAgent(_0x33078e,_0x4d21b3){var _0x199fd3=_[_0x01ea('0x26')](_0x33078e,function(_0x15b5ba,_0x5e90f7){var _0x4449d7=_['isNil'](_0x15b5ba[_0x01ea('0x2a')])?util[_0x01ea('0x27')](_0x01ea('0x28'),_0x15b5ba[_0x01ea('0x29')]):_0x15b5ba['interface'];return _0x4449d7;});for(var _0x26aad0 in _0x4d21b3){if(_0x4d21b3[_0x01ea('0x2b')](_0x26aad0)){if(!_0x199fd3[_0x26aad0]){delete _0x4d21b3[_0x26aad0];}}}}function clearVoiceCallReports(_0x3e6cef){_0x3e6cef[_0x01ea('0x2c')]=0x0;_0x3e6cef[_0x01ea('0x2d')]=0x0;_0x3e6cef[_0x01ea('0x2e')]=0x0;_0x3e6cef['sumDuration']=0x0;_0x3e6cef[_0x01ea('0x2f')]=0x0;}function clearCampaigns(_0x338db5){if(!_[_0x01ea('0x30')](_0x338db5)){for(var _0x27c514 in _0x338db5){if(_0x338db5[_0x01ea('0x2b')](_0x27c514)){_0x338db5[_0x27c514][_0x01ea('0x31')]=0x0;_0x338db5[_0x27c514]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xcf4d72){if(!_[_0x01ea('0x30')](_0xcf4d72)){for(var _0x439a23 in _0xcf4d72){if(_0xcf4d72['hasOwnProperty'](_0x439a23)){_0xcf4d72[_0x439a23][_0x01ea('0x2c')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x2d')]=0x0;_0xcf4d72[_0x439a23]['unmanaged']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x32')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x2e')]=0x0;_0xcf4d72[_0x439a23]['sumDuration']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x2f')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x33')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x34')]=0x0;_0xcf4d72[_0x439a23]['outboundBusyCallsDay']=0x0;_0xcf4d72[_0x439a23]['outboundCongestionCallsDay']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x35')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x36')]=0x0;_0xcf4d72[_0x439a23]['outboundDropCallsDayTimeout']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x37')]=0x0;_0xcf4d72[_0x439a23]['outboundBlacklistCallsDay']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x38')]=0x0;_0xcf4d72[_0x439a23]['outboundRejectCallsDay']=0x0;_0xcf4d72[_0x439a23]['outboundReCallsDay']=0x0;_0xcf4d72[_0x439a23]['outboundAnswerAgiCallsDay']=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x39')]=0x0;_0xcf4d72[_0x439a23][_0x01ea('0x3a')]=!![];}}}}Realtime[_0x01ea('0x3b')]['mergeFromDatabase']=function(_0x15f62f,_0x395aa8){for(var _0xe7af5b in _0x395aa8){if(_0x15f62f[_0x01ea('0x2b')](_0xe7af5b)){_0x15f62f[_0xe7af5b]=_0x395aa8[_0xe7af5b];}}};Realtime[_0x01ea('0x3b')][_0x01ea('0x3c')]=function(){var _0x3147f6=this;return function(_0x507988){if(_0x507988){freeIsNotKeyAgent(_0x507988,_0x3147f6[_0x01ea('0x14')]);for(var _0x925416=0x0,_0x2c2128={},_0x44dba5={};_0x925416<_0x507988[_0x01ea('0x3d')];_0x925416+=0x1){_0x2c2128=_0x507988[_0x925416];var _0x1c2381=_[_0x01ea('0x3e')](_0x2c2128['interface'])?util['format'](_0x01ea('0x28'),_0x2c2128[_0x01ea('0x29')]):_0x2c2128[_0x01ea('0x2a')];if(_[_0x01ea('0x3f')](_0x3147f6[_0x01ea('0x14')][_0x1c2381])){_0x3147f6[_0x01ea('0x14')][_0x1c2381]=new Agent(_0x2c2128);}else{_0x3147f6[_0x01ea('0x40')](_0x3147f6[_0x01ea('0x14')][_0x1c2381],_0x2c2128);}}}return _0x3147f6[_0x01ea('0x14')];};};Realtime['prototype']['initTelephones']=function(){var _0x4cc172=this;return function(_0x2b153a){if(_0x2b153a){freeIsNotKeySip(_0x2b153a,_0x4cc172[_0x01ea('0x15')]);for(var _0x5eef98=0x0,_0x47da2f={},_0x1bdc0e={};_0x5eef98<_0x2b153a['length'];_0x5eef98+=0x1){_0x47da2f=_0x2b153a[_0x5eef98];if(_[_0x01ea('0x3f')](_0x4cc172[_0x01ea('0x15')][util[_0x01ea('0x27')](_0x01ea('0x28'),_0x47da2f[_0x01ea('0x29')])])){_0x4cc172[_0x01ea('0x15')][util[_0x01ea('0x27')](_0x01ea('0x28'),_0x47da2f[_0x01ea('0x29')])]=new Telephone(_0x47da2f);}else{_0x4cc172[_0x01ea('0x40')](_0x4cc172[_0x01ea('0x15')][util[_0x01ea('0x27')]('SIP/%s',_0x47da2f[_0x01ea('0x29')])],_0x47da2f);}}}return _0x4cc172[_0x01ea('0x15')];};};Realtime[_0x01ea('0x3b')]['initTrunks']=function(){var _0x524d4b=this;return function(_0xdfcec7){if(_0xdfcec7){freeIsNotKeySip(_0xdfcec7,_0x524d4b['trunks']);for(var _0x510adb=0x0,_0x519684={},_0x28ed34={};_0x510adb<_0xdfcec7[_0x01ea('0x3d')];_0x510adb+=0x1){_0x519684=_0xdfcec7[_0x510adb];if(_['isUndefined'](_0x524d4b['trunks'][util[_0x01ea('0x27')]('SIP/%s',_0x519684[_0x01ea('0x29')])])){_0x524d4b[_0x01ea('0x16')][util[_0x01ea('0x27')](_0x01ea('0x28'),_0x519684[_0x01ea('0x29')])]=new Trunk(_0x519684);}else{_0x524d4b[_0x01ea('0x40')](_0x524d4b['trunks'][util[_0x01ea('0x27')]('SIP/%s',_0x519684['name'])],_0x519684);}}}return _0x524d4b[_0x01ea('0x16')];};};Realtime[_0x01ea('0x3b')]['initVoiceQueues']=function(){var _0x1a1993=this;return function(_0x3e2c07){if(_0x3e2c07){freeIsNotKey(_0x3e2c07,_0x1a1993['voiceQueues'],_0x01ea('0x29'));for(var _0x7fe986=0x0,_0x54e1bc={},_0x428936={};_0x7fe986<_0x3e2c07[_0x01ea('0x3d')];_0x7fe986+=0x1){_0x54e1bc=_0x3e2c07[_0x7fe986];if(_[_0x01ea('0x3f')](_0x1a1993[_0x01ea('0x17')][_0x54e1bc[_0x01ea('0x29')]])){_0x1a1993[_0x01ea('0x17')][_0x54e1bc['name']]=new VoiceQueue(_0x54e1bc);}else{_0x1a1993[_0x01ea('0x40')](_0x1a1993[_0x01ea('0x17')][_0x54e1bc['name']],_0x54e1bc);}}}return _0x1a1993['voiceQueues'];};};Realtime['prototype'][_0x01ea('0x41')]=function(){var _0x3c7fd5=this;return function(_0x34c66b){if(_0x34c66b){freeIsNotKey(_0x34c66b,_0x3c7fd5['triggers'],'id');for(var _0x5192e2=0x0,_0x3b714c={},_0x36b47b={};_0x5192e2<_0x34c66b[_0x01ea('0x3d')];_0x5192e2+=0x1){_0x3b714c=_0x34c66b[_0x5192e2];if(_['isUndefined'](_0x3c7fd5[_0x01ea('0x18')][_0x3b714c['id']])){_0x3c7fd5[_0x01ea('0x18')][_0x3b714c['id']]=new Trigger(_0x3b714c);}else{_0x3c7fd5[_0x01ea('0x40')](_0x3c7fd5[_0x01ea('0x18')][_0x3b714c['id']],_0x3b714c);}}}return _0x3c7fd5[_0x01ea('0x18')];};};Realtime[_0x01ea('0x3b')]['initTemplates']=function(){var _0x1d14a5=this;return function(_0x34fe3c){if(_0x34fe3c){freeIsNotKey(_0x34fe3c,_0x1d14a5[_0x01ea('0x1a')],'id');for(var _0x3f4b36=0x0,_0x501ec8={},_0x125b3f={};_0x3f4b36<_0x34fe3c[_0x01ea('0x3d')];_0x3f4b36+=0x1){_0x501ec8=_0x34fe3c[_0x3f4b36];if(_['isUndefined'](_0x1d14a5[_0x01ea('0x1a')][_0x501ec8['id']])){_0x1d14a5[_0x01ea('0x1a')][_0x501ec8['id']]=new Template(_0x501ec8);}else{_0x1d14a5[_0x01ea('0x40')](_0x1d14a5['templates'][_0x501ec8['id']],_0x501ec8);}}}return _0x1d14a5[_0x01ea('0x1a')];};};Realtime[_0x01ea('0x3b')]['initZendeskAccounts']=function(){var _0x56713d=this;return function(_0x587912){if(_0x587912){freeIsNotKey(_0x587912,_0x56713d[_0x01ea('0x42')],'id');for(var _0x45e737=0x0,_0x1f6e7c={},_0x259cf8={};_0x45e737<_0x587912['length'];_0x45e737+=0x1){_0x1f6e7c=_0x587912[_0x45e737];if(_['isUndefined'](_0x56713d[_0x01ea('0x42')][_0x1f6e7c['id']])){_0x56713d[_0x01ea('0x42')][_0x1f6e7c['id']]=new ZendeskAccount(_0x1f6e7c);}else{_0x56713d[_0x01ea('0x40')](_0x56713d[_0x01ea('0x42')][_0x1f6e7c['id']],_0x1f6e7c);}}}return _0x56713d[_0x01ea('0x42')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x43')]=function(){var _0x26f4c3=this;return function(_0xb912e6){if(_0xb912e6){freeIsNotKey(_0xb912e6,_0x26f4c3[_0x01ea('0x20')],'id');for(var _0x34c7cf=0x0,_0x263269={},_0x23b12f={};_0x34c7cf<_0xb912e6['length'];_0x34c7cf+=0x1){_0x263269=_0xb912e6[_0x34c7cf];if(_[_0x01ea('0x3f')](_0x26f4c3[_0x01ea('0x20')][_0x263269['id']])){_0x26f4c3[_0x01ea('0x20')][_0x263269['id']]=new SalesforceAccount(_0x263269);}else{_0x26f4c3[_0x01ea('0x40')](_0x26f4c3[_0x01ea('0x20')][_0x263269['id']],_0x263269);}}}return _0x26f4c3[_0x01ea('0x20')];};};Realtime[_0x01ea('0x3b')]['initFreshdeskAccounts']=function(){var _0x4b20a6=this;return function(_0x2a0799){if(_0x2a0799){freeIsNotKey(_0x2a0799,_0x4b20a6[_0x01ea('0x22')],'id');for(var _0x69dc77=0x0,_0x215f7a={},_0x4aec6e={};_0x69dc77<_0x2a0799[_0x01ea('0x3d')];_0x69dc77+=0x1){_0x215f7a=_0x2a0799[_0x69dc77];if(_[_0x01ea('0x3f')](_0x4b20a6[_0x01ea('0x22')][_0x215f7a['id']])){_0x4b20a6[_0x01ea('0x22')][_0x215f7a['id']]=new FreshdeskAccount(_0x215f7a);}else{_0x4b20a6[_0x01ea('0x40')](_0x4b20a6['freshdeskAccounts'][_0x215f7a['id']],_0x215f7a);}}}return _0x4b20a6['freshdeskAccounts'];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x44')]=function(){var _0x3dcbd3=this;return function(_0x1fd6f3){if(_0x1fd6f3){freeIsNotKey(_0x1fd6f3,_0x3dcbd3['zohoAccounts'],'id');for(var _0x25e91d=0x0,_0x468250={},_0x406a1c={};_0x25e91d<_0x1fd6f3[_0x01ea('0x3d')];_0x25e91d+=0x1){_0x468250=_0x1fd6f3[_0x25e91d];if(_[_0x01ea('0x3f')](_0x3dcbd3[_0x01ea('0x23')][_0x468250['id']])){_0x3dcbd3[_0x01ea('0x23')][_0x468250['id']]=new ZohoAccount(_0x468250);}else{_0x3dcbd3[_0x01ea('0x40')](_0x3dcbd3[_0x01ea('0x23')][_0x468250['id']],_0x468250);}}}return _0x3dcbd3[_0x01ea('0x23')];};};Realtime['prototype'][_0x01ea('0x45')]=function(){var _0x43bc79=this;return function(_0x3413d4){if(_0x3413d4){freeIsNotKey(_0x3413d4,_0x43bc79['deskAccounts'],'id');for(var _0x4e7399=0x0,_0x4a3f4f={},_0xf11c4d={};_0x4e7399<_0x3413d4[_0x01ea('0x3d')];_0x4e7399+=0x1){_0x4a3f4f=_0x3413d4[_0x4e7399];if(_['isUndefined'](_0x43bc79[_0x01ea('0x46')][_0x4a3f4f['id']])){_0x43bc79[_0x01ea('0x46')][_0x4a3f4f['id']]=new DeskAccount(_0x4a3f4f);}else{_0x43bc79[_0x01ea('0x40')](_0x43bc79[_0x01ea('0x46')][_0x4a3f4f['id']],_0x4a3f4f);}}}return _0x43bc79[_0x01ea('0x46')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x47')]=function(){var _0x5a25b0=this;return function(_0x219975){if(_0x219975){freeIsNotKey(_0x219975,_0x5a25b0[_0x01ea('0x21')],'id');for(var _0x30c5ec=0x0,_0x49df9d={},_0x1c1ad1={};_0x30c5ec<_0x219975[_0x01ea('0x3d')];_0x30c5ec+=0x1){_0x49df9d=_0x219975[_0x30c5ec];if(_['isUndefined'](_0x5a25b0[_0x01ea('0x21')][_0x49df9d['id']])){_0x5a25b0[_0x01ea('0x21')][_0x49df9d['id']]=new SugarcrmAccount(_0x49df9d);}else{_0x5a25b0[_0x01ea('0x40')](_0x5a25b0[_0x01ea('0x21')][_0x49df9d['id']],_0x49df9d);}}}return _0x5a25b0[_0x01ea('0x21')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x48')]=function(){var _0x2961a3=this;return function(_0x28841f){if(_0x28841f){freeIsNotKey(_0x28841f,_0x2961a3['vtigerAccounts'],'id');for(var _0x14f22d=0x0,_0x487ae5={},_0xd48d3={};_0x14f22d<_0x28841f['length'];_0x14f22d+=0x1){_0x487ae5=_0x28841f[_0x14f22d];if(_['isUndefined'](_0x2961a3[_0x01ea('0x24')][_0x487ae5['id']])){_0x2961a3[_0x01ea('0x24')][_0x487ae5['id']]=new VtigerAccount(_0x487ae5);}else{_0x2961a3[_0x01ea('0x40')](_0x2961a3[_0x01ea('0x24')][_0x487ae5['id']],_0x487ae5);}}}return _0x2961a3[_0x01ea('0x24')];};};Realtime[_0x01ea('0x3b')]['initServicenowAccounts']=function(){var _0xc22213=this;return function(_0x3c3451){if(_0x3c3451){freeIsNotKey(_0x3c3451,_0xc22213[_0x01ea('0x25')],'id');for(var _0x28711a=0x0,_0x3a5242={},_0x2b2833={};_0x28711a<_0x3c3451['length'];_0x28711a+=0x1){_0x3a5242=_0x3c3451[_0x28711a];if(_['isUndefined'](_0xc22213[_0x01ea('0x25')][_0x3a5242['id']])){_0xc22213[_0x01ea('0x25')][_0x3a5242['id']]=new ServicenowAccount(_0x3a5242);}else{_0xc22213['mergeFromDatabase'](_0xc22213['servicenowAccounts'][_0x3a5242['id']],_0x3a5242);}}}return _0xc22213[_0x01ea('0x25')];};};Realtime['prototype'][_0x01ea('0x49')]=function(){var _0xea6d23=this;return function(_0xd9c2d4){if(_0xd9c2d4){freeIsNotKey(_0xd9c2d4,_0xea6d23[_0x01ea('0x4a')],'id');for(var _0x592693=0x0,_0x20bc34={},_0x10e0aa={};_0x592693<_0xd9c2d4[_0x01ea('0x3d')];_0x592693+=0x1){_0x20bc34=_0xd9c2d4[_0x592693];if(_['isUndefined'](_0xea6d23[_0x01ea('0x4a')][_0x20bc34['id']])){_0xea6d23[_0x01ea('0x4a')][_0x20bc34['id']]=new Dynamics365Account(_0x20bc34);}else{_0xea6d23['mergeFromDatabase'](_0xea6d23[_0x01ea('0x4a')][_0x20bc34['id']],_0x20bc34);}}}return _0xea6d23[_0x01ea('0x4a')];};};Realtime[_0x01ea('0x3b')]['initFreshsalesAccounts']=function(){var _0xd5cf02=this;return function(_0x41171d){if(_0x41171d){freeIsNotKey(_0x41171d,_0xd5cf02['freshsalesAccounts'],'id');for(var _0x215b24=0x0,_0x5bf190={},_0x2c6490={};_0x215b24<_0x41171d[_0x01ea('0x3d')];_0x215b24+=0x1){_0x5bf190=_0x41171d[_0x215b24];if(_['isUndefined'](_0xd5cf02[_0x01ea('0x4b')][_0x5bf190['id']])){_0xd5cf02['freshsalesAccounts'][_0x5bf190['id']]=new FreshsalesAccount(_0x5bf190);}else{_0xd5cf02[_0x01ea('0x40')](_0xd5cf02['freshsalesAccounts'][_0x5bf190['id']],_0x5bf190);}}}return _0xd5cf02[_0x01ea('0x4b')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x4c')]=function(){var _0x428634=this;return function(_0x38175d){for(var _0x46d68a=0x0;_0x46d68a<_0x38175d[_0x01ea('0x3d')];_0x46d68a+=0x1){_[_0x01ea('0x4d')](_0x428634['voiceQueues'][_0x38175d[_0x46d68a][_0x01ea('0x29')]],_0x38175d[_0x46d68a]);}return _0x428634[_0x01ea('0x17')];};};Realtime['prototype'][_0x01ea('0x4e')]=function(){var _0x2dd5d3=this;return function(_0xb2365f){clearVoiceQueues(_0x2dd5d3[_0x01ea('0x17')]);if(_0xb2365f){_0xb2365f=_[_0x01ea('0x4f')](_0xb2365f,'uniqueid');for(var _0x3b1641 in _0xb2365f){if(_0xb2365f[_0x01ea('0x2b')](_0x3b1641)){var _0x3ccd49={};for(var _0x2722f9=0x0;_0x2722f9<_0xb2365f[_0x3b1641]['length'];_0x2722f9+=0x1){var _0x453876=_0xb2365f[_0x3b1641][_0x2722f9]['queue'];if(_0x2dd5d3[_0x01ea('0x17')][_0x453876]){if(_0xb2365f[_0x3b1641][_0x2722f9]['queuecallerexit']){_0x2dd5d3['voiceQueues'][_0x453876][_0x01ea('0x50')]+=0x1;}if(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x51')]){_0x2dd5d3['voiceQueues'][_0x453876][_0x01ea('0x32')]+=0x1;}_0x2dd5d3[_0x01ea('0x17')][_0x453876][_0x01ea('0x2e')]+=moment(_0xb2365f[_0x3b1641][_0x2722f9]['queuecallerleaveAt'])[_0x01ea('0x52')](moment(_0xb2365f[_0x3b1641][_0x2722f9]['queuecallerjoinAt']),_0x01ea('0x53'))||0x0;if(_0x2722f9===_0xb2365f[_0x3b1641][_0x01ea('0x3d')]-0x1){_0x2dd5d3[_0x01ea('0x17')][_0x453876][_0x01ea('0x54')]+=moment(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x55')]||_0xb2365f[_0x3b1641][_0x2722f9]['queuecallerabandonAt']||_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x56')])[_0x01ea('0x52')](moment(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x57')]),_0x01ea('0x53'))||0x0;_0x2dd5d3[_0x01ea('0x17')][_0x453876][_0x01ea('0x2c')]+=0x1;if(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x58')]){_0x2dd5d3['voiceQueues'][_0x453876]['answered']+=0x1;_0x2dd5d3[_0x01ea('0x17')][_0x453876][_0x01ea('0x2f')]+=moment(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x55')])[_0x01ea('0x52')](moment(_0xb2365f[_0x3b1641][_0x2722f9][_0x01ea('0x59')]),_0x01ea('0x53'))||0x0;}}else{_0x2dd5d3[_0x01ea('0x17')][_0x453876]['sumDuration']+=_0x2dd5d3['voiceQueues'][_0x453876]['sumHoldTime']||0x0;}}}}}}return _0x2dd5d3[_0x01ea('0x17')];};};Realtime['prototype'][_0x01ea('0x5a')]=function(){var _0x1e2924=this;return function(_0x1f11d9){clearVoiceCallReports(_0x1e2924['outbound']);if(_0x1f11d9){for(var _0x52a5d9=0x0;_0x52a5d9<_0x1f11d9[_0x01ea('0x3d')];_0x52a5d9+=0x1){_0x1e2924[_0x01ea('0x5b')][_0x01ea('0x2c')]+=0x1;_0x1e2924[_0x01ea('0x5b')][_0x01ea('0x54')]+=_0x1f11d9[_0x52a5d9]['duration'];if(_0x1f11d9[_0x52a5d9]['disposition']==='ANSWERED'){_0x1e2924[_0x01ea('0x5b')][_0x01ea('0x2d')]+=0x1;_0x1e2924['outbound'][_0x01ea('0x2e')]+=_0x1f11d9[_0x52a5d9][_0x01ea('0x5c')]-_0x1f11d9[_0x52a5d9][_0x01ea('0x5d')]||0x0;_0x1e2924['outbound'][_0x01ea('0x2f')]+=_0x1f11d9[_0x52a5d9]['billableseconds'];}}}return _0x1e2924['outbound'];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x5e')]=function(){var _0x449120=this;return function(_0x530696){if(_0x530696){freeIsNotKey(_0x530696,_0x449120[_0x01ea('0x19')],_0x01ea('0x29'));for(var _0x5a0c1c=0x0,_0x1ae27c={};_0x5a0c1c<_0x530696[_0x01ea('0x3d')];_0x5a0c1c+=0x1){_0x1ae27c=_0x530696[_0x5a0c1c];if(_[_0x01ea('0x3f')](_0x449120[_0x01ea('0x19')][_0x1ae27c[_0x01ea('0x29')]])){_0x449120['campaigns'][_0x1ae27c[_0x01ea('0x29')]]=new Campaign(_0x1ae27c);}else{_0x449120[_0x01ea('0x40')](_0x449120[_0x01ea('0x19')][_0x1ae27c[_0x01ea('0x29')]],_0x1ae27c);_0x449120[_0x01ea('0x19')][_0x1ae27c['name']][_0x01ea('0x5f')]=_0x1ae27c[_0x01ea('0x60')]?_0x1ae27c[_0x01ea('0x60')][_0x01ea('0x29')]:undefined;}}}return _0x449120[_0x01ea('0x19')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x61')]=function(){var _0x13db23=this;return function(_0x4156c0){if(_0x4156c0){freeIsNotKey(_0x4156c0,_0x13db23[_0x01ea('0x1b')],'id');for(var _0x2bb974=0x0,_0xceb12b={};_0x2bb974<_0x4156c0[_0x01ea('0x3d')];_0x2bb974+=0x1){_0xceb12b=_0x4156c0[_0x2bb974];if(_[_0x01ea('0x3f')](_0x13db23[_0x01ea('0x1b')][_0xceb12b['id']])){_0x13db23['voiceExtensions'][_0xceb12b['id']]=new VoiceExtension(_0xceb12b);}else{_0x13db23[_0x01ea('0x40')](_0x13db23[_0x01ea('0x1b')][_0xceb12b['id']],_0xceb12b);}}}return _0x13db23['voiceExtensions'];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x62')]=function(){var _0x474afe=this;return function(_0x73310b){clearCampaigns(_0x474afe[_0x01ea('0x19')]);for(var _0x23b0dc=0x0;_0x23b0dc<_0x73310b[_0x01ea('0x3d')];_0x23b0dc+=0x1){_[_0x01ea('0x4d')](_0x474afe[_0x01ea('0x19')][_0x73310b[_0x23b0dc][_0x01ea('0x29')]],_0x73310b[_0x23b0dc]);}return _0x474afe[_0x01ea('0x19')];};};Realtime[_0x01ea('0x3b')][_0x01ea('0x63')]=function(){var _0x13f747=this;return function(_0x5b03db){if(_0x5b03db){freeIsNotKey(_0x5b03db,_0x13f747[_0x01ea('0x64')],'id');for(var _0x147f9f=0x0,_0x149de3={},_0x52d709={};_0x147f9f<_0x5b03db['length'];_0x147f9f+=0x1){_0x149de3=_0x5b03db[_0x147f9f];if(_[_0x01ea('0x3f')](_0x13f747[_0x01ea('0x64')][_0x149de3['id']])){_0x13f747[_0x01ea('0x64')][_0x149de3['id']]=new FaxAccount(_0x149de3);}else{_0x13f747[_0x01ea('0x40')](_0x13f747[_0x01ea('0x64')][_0x149de3['id']],_0x149de3);}}}return _0x13f747[_0x01ea('0x64')];};};module[_0x01ea('0x65')]=Realtime; \ No newline at end of file +var _0x6164=['initTelephones','length','initVoiceQueues','voiceQueues','initTemplates','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','telephones','trunks','triggers','templates','outbound','voiceExtensions','queueChannels','timers','settings','zendeskAccounts','salesforceAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','isNil','format','isUndefined'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6164,0xff));var _0x4616=function(_0x1e9ae1,_0x10dc5d){_0x1e9ae1=_0x1e9ae1-0x0;var _0xc6bc15=_0x6164[_0x1e9ae1];return _0xc6bc15;};'use strict';var BPromise=require(_0x4616('0x0'));var util=require(_0x4616('0x1'));var _=require(_0x4616('0x2'));var moment=require(_0x4616('0x3'));var Agent=require(_0x4616('0x4'));var Telephone=require(_0x4616('0x5'));var Trunk=require(_0x4616('0x6'));var VoiceQueue=require(_0x4616('0x7'));var Trigger=require(_0x4616('0x8'));var Template=require('../model/template');var Campaign=require(_0x4616('0x9'));var VoiceExtension=require(_0x4616('0xa'));var ZendeskAccount=require(_0x4616('0xb'));var SalesforceAccount=require(_0x4616('0xc'));var FreshdeskAccount=require(_0x4616('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x4616('0xe'));var DeskAccount=require(_0x4616('0xf'));var VtigerAccount=require(_0x4616('0x10'));var ServicenowAccount=require(_0x4616('0x11'));var Dynamics365Account=require(_0x4616('0x12'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x4616('0x13')]={};this[_0x4616('0x14')]={};this['voiceQueues']={};this[_0x4616('0x15')]={};this['campaigns']={};this[_0x4616('0x16')]={};this[_0x4616('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4616('0x18')]={};this['channels']={};this[_0x4616('0x19')]={};this['outboundChannels']={};this[_0x4616('0x1a')]={};this[_0x4616('0x1b')]={};this[_0x4616('0x1c')]={};this[_0x4616('0x1d')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x4616('0x1e')]={};this[_0x4616('0x1f')]={};this[_0x4616('0x20')]={};this[_0x4616('0x21')]={};this['freshsalesAccounts']={};this[_0x4616('0x22')]={};};function freeIsNotKey(_0x4f4151,_0x341729,_0x545b74){var _0x135372=_[_0x4616('0x23')](_0x4f4151,function(_0x376b5a,_0x3caf88){return _0x376b5a[_0x545b74];});for(var _0x261ad4 in _0x341729){if(_0x341729[_0x4616('0x24')](_0x261ad4)){if(!_0x135372[_0x261ad4]){delete _0x341729[_0x261ad4];}}}}function freeIsNotKeySip(_0x3ef156,_0x302530){var _0x1cfb6b=_[_0x4616('0x23')](_0x3ef156,function(_0x377af5,_0x447bdb){return util['format'](_0x4616('0x25'),_0x377af5['name']);});for(var _0x46ba2f in _0x302530){if(_0x302530[_0x4616('0x24')](_0x46ba2f)){if(!_0x1cfb6b[_0x46ba2f]){delete _0x302530[_0x46ba2f];}}}}function freeIsNotKeyAgent(_0x382915,_0x471d6f){var _0x158abe=_['mapKeys'](_0x382915,function(_0x17e8f0,_0x1b8c76){var _0x2f4eb1=_['isNil'](_0x17e8f0[_0x4616('0x26')])?util['format']('SIP/%s',_0x17e8f0[_0x4616('0x27')]):_0x17e8f0[_0x4616('0x26')];return _0x2f4eb1;});for(var _0x529f67 in _0x471d6f){if(_0x471d6f[_0x4616('0x24')](_0x529f67)){if(!_0x158abe[_0x529f67]){delete _0x471d6f[_0x529f67];}}}}function clearVoiceCallReports(_0x30f4e6){_0x30f4e6[_0x4616('0x28')]=0x0;_0x30f4e6[_0x4616('0x29')]=0x0;_0x30f4e6[_0x4616('0x2a')]=0x0;_0x30f4e6[_0x4616('0x2b')]=0x0;_0x30f4e6[_0x4616('0x2c')]=0x0;}function clearCampaigns(_0x15fd7f){if(!_[_0x4616('0x2d')](_0x15fd7f)){for(var _0xce38f6 in _0x15fd7f){if(_0x15fd7f[_0x4616('0x24')](_0xce38f6)){_0x15fd7f[_0xce38f6][_0x4616('0x2e')]=0x0;_0x15fd7f[_0xce38f6][_0x4616('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x118b65){if(!_[_0x4616('0x2d')](_0x118b65)){for(var _0x54aeff in _0x118b65){if(_0x118b65['hasOwnProperty'](_0x54aeff)){_0x118b65[_0x54aeff]['total']=0x0;_0x118b65[_0x54aeff][_0x4616('0x29')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x30')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x31')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x2a')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x2b')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x2c')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x32')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x33')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x34')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x35')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x36')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x37')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x38')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x39')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x3a')]=0x0;_0x118b65[_0x54aeff]['outboundOriginateFailureCallsDay']=0x0;_0x118b65[_0x54aeff]['outboundRejectCallsDay']=0x0;_0x118b65[_0x54aeff][_0x4616('0x3b')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x32')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x3c')]=0x0;_0x118b65[_0x54aeff][_0x4616('0x3d')]=!![];}}}}Realtime[_0x4616('0x3e')][_0x4616('0x3f')]=function(_0x4c4e35,_0x4db90b){for(var _0x4f6d53 in _0x4db90b){if(_0x4c4e35[_0x4616('0x24')](_0x4f6d53)){_0x4c4e35[_0x4f6d53]=_0x4db90b[_0x4f6d53];}}};Realtime[_0x4616('0x3e')][_0x4616('0x40')]=function(){var _0x300537=this;return function(_0xcdc5ad){if(_0xcdc5ad){freeIsNotKeyAgent(_0xcdc5ad,_0x300537[_0x4616('0x41')]);for(var _0x32bc14=0x0,_0x39743b={},_0x3daf95={};_0x32bc14<_0xcdc5ad['length'];_0x32bc14+=0x1){_0x39743b=_0xcdc5ad[_0x32bc14];var _0x19acbf=_[_0x4616('0x42')](_0x39743b[_0x4616('0x26')])?util[_0x4616('0x43')](_0x4616('0x25'),_0x39743b[_0x4616('0x27')]):_0x39743b[_0x4616('0x26')];if(_[_0x4616('0x44')](_0x300537['agents'][_0x19acbf])){_0x300537[_0x4616('0x41')][_0x19acbf]=new Agent(_0x39743b);}else{_0x300537[_0x4616('0x3f')](_0x300537[_0x4616('0x41')][_0x19acbf],_0x39743b);}}}return _0x300537[_0x4616('0x41')];};};Realtime[_0x4616('0x3e')][_0x4616('0x45')]=function(){var _0x2c2056=this;return function(_0xa75bf3){if(_0xa75bf3){freeIsNotKeySip(_0xa75bf3,_0x2c2056[_0x4616('0x13')]);for(var _0xe5dd34=0x0,_0x5a612c={},_0x5e433a={};_0xe5dd34<_0xa75bf3[_0x4616('0x46')];_0xe5dd34+=0x1){_0x5a612c=_0xa75bf3[_0xe5dd34];if(_[_0x4616('0x44')](_0x2c2056[_0x4616('0x13')][util[_0x4616('0x43')]('SIP/%s',_0x5a612c[_0x4616('0x27')])])){_0x2c2056[_0x4616('0x13')][util[_0x4616('0x43')](_0x4616('0x25'),_0x5a612c[_0x4616('0x27')])]=new Telephone(_0x5a612c);}else{_0x2c2056[_0x4616('0x3f')](_0x2c2056[_0x4616('0x13')][util[_0x4616('0x43')](_0x4616('0x25'),_0x5a612c[_0x4616('0x27')])],_0x5a612c);}}}return _0x2c2056[_0x4616('0x13')];};};Realtime[_0x4616('0x3e')]['initTrunks']=function(){var _0x4ec039=this;return function(_0x1f8c33){if(_0x1f8c33){freeIsNotKeySip(_0x1f8c33,_0x4ec039[_0x4616('0x14')]);for(var _0x563f32=0x0,_0xf13359={},_0x17e8b4={};_0x563f32<_0x1f8c33[_0x4616('0x46')];_0x563f32+=0x1){_0xf13359=_0x1f8c33[_0x563f32];if(_[_0x4616('0x44')](_0x4ec039[_0x4616('0x14')][util[_0x4616('0x43')](_0x4616('0x25'),_0xf13359['name'])])){_0x4ec039[_0x4616('0x14')][util[_0x4616('0x43')]('SIP/%s',_0xf13359[_0x4616('0x27')])]=new Trunk(_0xf13359);}else{_0x4ec039['mergeFromDatabase'](_0x4ec039[_0x4616('0x14')][util[_0x4616('0x43')](_0x4616('0x25'),_0xf13359[_0x4616('0x27')])],_0xf13359);}}}return _0x4ec039[_0x4616('0x14')];};};Realtime[_0x4616('0x3e')][_0x4616('0x47')]=function(){var _0xcc5a8d=this;return function(_0x5cfd26){if(_0x5cfd26){freeIsNotKey(_0x5cfd26,_0xcc5a8d[_0x4616('0x48')],_0x4616('0x27'));for(var _0xc7004=0x0,_0x5cacaa={},_0x5b40f1={};_0xc7004<_0x5cfd26[_0x4616('0x46')];_0xc7004+=0x1){_0x5cacaa=_0x5cfd26[_0xc7004];if(_[_0x4616('0x44')](_0xcc5a8d['voiceQueues'][_0x5cacaa[_0x4616('0x27')]])){_0xcc5a8d['voiceQueues'][_0x5cacaa[_0x4616('0x27')]]=new VoiceQueue(_0x5cacaa);}else{_0xcc5a8d['mergeFromDatabase'](_0xcc5a8d[_0x4616('0x48')][_0x5cacaa['name']],_0x5cacaa);}}}return _0xcc5a8d[_0x4616('0x48')];};};Realtime['prototype']['initTriggers']=function(){var _0x2c6f3f=this;return function(_0x10e3aa){if(_0x10e3aa){freeIsNotKey(_0x10e3aa,_0x2c6f3f['triggers'],'id');for(var _0x57202d=0x0,_0x4360cf={},_0x4f2d66={};_0x57202d<_0x10e3aa['length'];_0x57202d+=0x1){_0x4360cf=_0x10e3aa[_0x57202d];if(_[_0x4616('0x44')](_0x2c6f3f[_0x4616('0x15')][_0x4360cf['id']])){_0x2c6f3f[_0x4616('0x15')][_0x4360cf['id']]=new Trigger(_0x4360cf);}else{_0x2c6f3f['mergeFromDatabase'](_0x2c6f3f['triggers'][_0x4360cf['id']],_0x4360cf);}}}return _0x2c6f3f[_0x4616('0x15')];};};Realtime[_0x4616('0x3e')][_0x4616('0x49')]=function(){var _0x258043=this;return function(_0x5bd6b2){if(_0x5bd6b2){freeIsNotKey(_0x5bd6b2,_0x258043[_0x4616('0x16')],'id');for(var _0x180ca0=0x0,_0x66a50a={},_0x5df935={};_0x180ca0<_0x5bd6b2[_0x4616('0x46')];_0x180ca0+=0x1){_0x66a50a=_0x5bd6b2[_0x180ca0];if(_[_0x4616('0x44')](_0x258043[_0x4616('0x16')][_0x66a50a['id']])){_0x258043[_0x4616('0x16')][_0x66a50a['id']]=new Template(_0x66a50a);}else{_0x258043[_0x4616('0x3f')](_0x258043['templates'][_0x66a50a['id']],_0x66a50a);}}}return _0x258043[_0x4616('0x16')];};};Realtime[_0x4616('0x3e')]['initZendeskAccounts']=function(){var _0x2126ff=this;return function(_0x30c2fc){if(_0x30c2fc){freeIsNotKey(_0x30c2fc,_0x2126ff['zendeskAccounts'],'id');for(var _0x3e8bc2=0x0,_0x511302={},_0x54ed68={};_0x3e8bc2<_0x30c2fc['length'];_0x3e8bc2+=0x1){_0x511302=_0x30c2fc[_0x3e8bc2];if(_[_0x4616('0x44')](_0x2126ff[_0x4616('0x1c')][_0x511302['id']])){_0x2126ff[_0x4616('0x1c')][_0x511302['id']]=new ZendeskAccount(_0x511302);}else{_0x2126ff['mergeFromDatabase'](_0x2126ff[_0x4616('0x1c')][_0x511302['id']],_0x511302);}}}return _0x2126ff[_0x4616('0x1c')];};};Realtime[_0x4616('0x3e')]['initSalesforceAccounts']=function(){var _0x419bde=this;return function(_0x447add){if(_0x447add){freeIsNotKey(_0x447add,_0x419bde[_0x4616('0x1d')],'id');for(var _0x5aa3ee=0x0,_0x421a06={},_0x1396a3={};_0x5aa3ee<_0x447add[_0x4616('0x46')];_0x5aa3ee+=0x1){_0x421a06=_0x447add[_0x5aa3ee];if(_[_0x4616('0x44')](_0x419bde['salesforceAccounts'][_0x421a06['id']])){_0x419bde[_0x4616('0x1d')][_0x421a06['id']]=new SalesforceAccount(_0x421a06);}else{_0x419bde[_0x4616('0x3f')](_0x419bde[_0x4616('0x1d')][_0x421a06['id']],_0x421a06);}}}return _0x419bde[_0x4616('0x1d')];};};Realtime[_0x4616('0x3e')][_0x4616('0x4a')]=function(){var _0x3826bc=this;return function(_0x19fadd){if(_0x19fadd){freeIsNotKey(_0x19fadd,_0x3826bc[_0x4616('0x4b')],'id');for(var _0x521bb8=0x0,_0x2e736e={},_0x2adf7e={};_0x521bb8<_0x19fadd[_0x4616('0x46')];_0x521bb8+=0x1){_0x2e736e=_0x19fadd[_0x521bb8];if(_[_0x4616('0x44')](_0x3826bc['freshdeskAccounts'][_0x2e736e['id']])){_0x3826bc[_0x4616('0x4b')][_0x2e736e['id']]=new FreshdeskAccount(_0x2e736e);}else{_0x3826bc['mergeFromDatabase'](_0x3826bc[_0x4616('0x4b')][_0x2e736e['id']],_0x2e736e);}}}return _0x3826bc[_0x4616('0x4b')];};};Realtime[_0x4616('0x3e')][_0x4616('0x4c')]=function(){var _0x1d2aa5=this;return function(_0x1d19a4){if(_0x1d19a4){freeIsNotKey(_0x1d19a4,_0x1d2aa5[_0x4616('0x4d')],'id');for(var _0x38a405=0x0,_0x6d422d={},_0x2fd1fc={};_0x38a405<_0x1d19a4[_0x4616('0x46')];_0x38a405+=0x1){_0x6d422d=_0x1d19a4[_0x38a405];if(_['isUndefined'](_0x1d2aa5[_0x4616('0x4d')][_0x6d422d['id']])){_0x1d2aa5[_0x4616('0x4d')][_0x6d422d['id']]=new ZohoAccount(_0x6d422d);}else{_0x1d2aa5[_0x4616('0x3f')](_0x1d2aa5[_0x4616('0x4d')][_0x6d422d['id']],_0x6d422d);}}}return _0x1d2aa5['zohoAccounts'];};};Realtime['prototype'][_0x4616('0x4e')]=function(){var _0x4ce753=this;return function(_0x4c4afe){if(_0x4c4afe){freeIsNotKey(_0x4c4afe,_0x4ce753['deskAccounts'],'id');for(var _0x394632=0x0,_0x2a749a={},_0x2e4698={};_0x394632<_0x4c4afe[_0x4616('0x46')];_0x394632+=0x1){_0x2a749a=_0x4c4afe[_0x394632];if(_[_0x4616('0x44')](_0x4ce753[_0x4616('0x1e')][_0x2a749a['id']])){_0x4ce753[_0x4616('0x1e')][_0x2a749a['id']]=new DeskAccount(_0x2a749a);}else{_0x4ce753[_0x4616('0x3f')](_0x4ce753['deskAccounts'][_0x2a749a['id']],_0x2a749a);}}}return _0x4ce753[_0x4616('0x1e')];};};Realtime[_0x4616('0x3e')][_0x4616('0x4f')]=function(){var _0x3a2181=this;return function(_0x1381c1){if(_0x1381c1){freeIsNotKey(_0x1381c1,_0x3a2181[_0x4616('0x50')],'id');for(var _0x5d6510=0x0,_0x108e32={},_0x26f8dc={};_0x5d6510<_0x1381c1[_0x4616('0x46')];_0x5d6510+=0x1){_0x108e32=_0x1381c1[_0x5d6510];if(_[_0x4616('0x44')](_0x3a2181[_0x4616('0x50')][_0x108e32['id']])){_0x3a2181['sugarcrmAccounts'][_0x108e32['id']]=new SugarcrmAccount(_0x108e32);}else{_0x3a2181[_0x4616('0x3f')](_0x3a2181[_0x4616('0x50')][_0x108e32['id']],_0x108e32);}}}return _0x3a2181['sugarcrmAccounts'];};};Realtime[_0x4616('0x3e')][_0x4616('0x51')]=function(){var _0x11b856=this;return function(_0x59e82f){if(_0x59e82f){freeIsNotKey(_0x59e82f,_0x11b856[_0x4616('0x1f')],'id');for(var _0x3f34b4=0x0,_0x582381={},_0x3e92e2={};_0x3f34b4<_0x59e82f[_0x4616('0x46')];_0x3f34b4+=0x1){_0x582381=_0x59e82f[_0x3f34b4];if(_[_0x4616('0x44')](_0x11b856[_0x4616('0x1f')][_0x582381['id']])){_0x11b856[_0x4616('0x1f')][_0x582381['id']]=new VtigerAccount(_0x582381);}else{_0x11b856[_0x4616('0x3f')](_0x11b856[_0x4616('0x1f')][_0x582381['id']],_0x582381);}}}return _0x11b856['vtigerAccounts'];};};Realtime[_0x4616('0x3e')][_0x4616('0x52')]=function(){var _0x38779e=this;return function(_0x2fc978){if(_0x2fc978){freeIsNotKey(_0x2fc978,_0x38779e[_0x4616('0x20')],'id');for(var _0x580d1a=0x0,_0x2bd1a0={},_0xa3748b={};_0x580d1a<_0x2fc978[_0x4616('0x46')];_0x580d1a+=0x1){_0x2bd1a0=_0x2fc978[_0x580d1a];if(_[_0x4616('0x44')](_0x38779e[_0x4616('0x20')][_0x2bd1a0['id']])){_0x38779e['servicenowAccounts'][_0x2bd1a0['id']]=new ServicenowAccount(_0x2bd1a0);}else{_0x38779e[_0x4616('0x3f')](_0x38779e[_0x4616('0x20')][_0x2bd1a0['id']],_0x2bd1a0);}}}return _0x38779e[_0x4616('0x20')];};};Realtime[_0x4616('0x3e')]['initDynamics365Accounts']=function(){var _0x2d415f=this;return function(_0x43ff5e){if(_0x43ff5e){freeIsNotKey(_0x43ff5e,_0x2d415f[_0x4616('0x21')],'id');for(var _0xc18049=0x0,_0x3b445f={},_0x4824ee={};_0xc18049<_0x43ff5e[_0x4616('0x46')];_0xc18049+=0x1){_0x3b445f=_0x43ff5e[_0xc18049];if(_[_0x4616('0x44')](_0x2d415f[_0x4616('0x21')][_0x3b445f['id']])){_0x2d415f['dynamics365Accounts'][_0x3b445f['id']]=new Dynamics365Account(_0x3b445f);}else{_0x2d415f[_0x4616('0x3f')](_0x2d415f[_0x4616('0x21')][_0x3b445f['id']],_0x3b445f);}}}return _0x2d415f[_0x4616('0x21')];};};Realtime[_0x4616('0x3e')]['initFreshsalesAccounts']=function(){var _0x15f603=this;return function(_0x1a35b8){if(_0x1a35b8){freeIsNotKey(_0x1a35b8,_0x15f603[_0x4616('0x53')],'id');for(var _0x3af33a=0x0,_0x59d11a={},_0x5b388a={};_0x3af33a<_0x1a35b8[_0x4616('0x46')];_0x3af33a+=0x1){_0x59d11a=_0x1a35b8[_0x3af33a];if(_[_0x4616('0x44')](_0x15f603[_0x4616('0x53')][_0x59d11a['id']])){_0x15f603[_0x4616('0x53')][_0x59d11a['id']]=new FreshsalesAccount(_0x59d11a);}else{_0x15f603[_0x4616('0x3f')](_0x15f603[_0x4616('0x53')][_0x59d11a['id']],_0x59d11a);}}}return _0x15f603[_0x4616('0x53')];};};Realtime[_0x4616('0x3e')][_0x4616('0x54')]=function(){var _0x29a1d3=this;return function(_0x52895d){for(var _0x101aa1=0x0;_0x101aa1<_0x52895d[_0x4616('0x46')];_0x101aa1+=0x1){_[_0x4616('0x55')](_0x29a1d3['voiceQueues'][_0x52895d[_0x101aa1][_0x4616('0x27')]],_0x52895d[_0x101aa1]);}return _0x29a1d3[_0x4616('0x48')];};};Realtime[_0x4616('0x3e')][_0x4616('0x56')]=function(){var _0x21da58=this;return function(_0x4e76f6){clearVoiceQueues(_0x21da58[_0x4616('0x48')]);if(_0x4e76f6){_0x4e76f6=_['groupBy'](_0x4e76f6,_0x4616('0x57'));for(var _0x471161 in _0x4e76f6){if(_0x4e76f6[_0x4616('0x24')](_0x471161)){var _0x5db300={};for(var _0x4debf4=0x0;_0x4debf4<_0x4e76f6[_0x471161][_0x4616('0x46')];_0x4debf4+=0x1){var _0x319193=_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x58')];if(_0x21da58['voiceQueues'][_0x319193]){if(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x59')]){_0x21da58['voiceQueues'][_0x319193]['unmanaged']+=0x1;}if(_0x4e76f6[_0x471161][_0x4debf4]['queuecallerabandon']){_0x21da58['voiceQueues'][_0x319193]['abandoned']+=0x1;}_0x21da58['voiceQueues'][_0x319193][_0x4616('0x2a')]+=moment(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5a')])[_0x4616('0x5b')](moment(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5c')]),_0x4616('0x5d'))||0x0;if(_0x4debf4===_0x4e76f6[_0x471161][_0x4616('0x46')]-0x1){_0x21da58['voiceQueues'][_0x319193][_0x4616('0x2b')]+=moment(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5e')]||_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5f')]||_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x60')])['diff'](moment(_0x4e76f6[_0x471161][_0x4debf4]['queuecallerjoinAt']),'seconds')||0x0;_0x21da58[_0x4616('0x48')][_0x319193][_0x4616('0x28')]+=0x1;if(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x61')]){_0x21da58[_0x4616('0x48')][_0x319193]['answered']+=0x1;_0x21da58[_0x4616('0x48')][_0x319193][_0x4616('0x2c')]+=moment(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5e')])[_0x4616('0x5b')](moment(_0x4e76f6[_0x471161][_0x4debf4][_0x4616('0x5a')]),_0x4616('0x5d'))||0x0;}}else{_0x21da58[_0x4616('0x48')][_0x319193][_0x4616('0x2b')]+=_0x21da58[_0x4616('0x48')][_0x319193][_0x4616('0x2a')]||0x0;}}}}}}return _0x21da58[_0x4616('0x48')];};};Realtime[_0x4616('0x3e')]['initVoiceCallReports']=function(){var _0x3baed8=this;return function(_0x4ee98){clearVoiceCallReports(_0x3baed8[_0x4616('0x17')]);if(_0x4ee98){for(var _0x5bb557=0x0;_0x5bb557<_0x4ee98[_0x4616('0x46')];_0x5bb557+=0x1){_0x3baed8[_0x4616('0x17')][_0x4616('0x28')]+=0x1;_0x3baed8[_0x4616('0x17')][_0x4616('0x2b')]+=_0x4ee98[_0x5bb557]['duration'];if(_0x4ee98[_0x5bb557]['disposition']==='ANSWERED'){_0x3baed8[_0x4616('0x17')][_0x4616('0x29')]+=0x1;_0x3baed8[_0x4616('0x17')]['sumHoldTime']+=_0x4ee98[_0x5bb557][_0x4616('0x62')]-_0x4ee98[_0x5bb557]['billableseconds']||0x0;_0x3baed8['outbound'][_0x4616('0x2c')]+=_0x4ee98[_0x5bb557][_0x4616('0x63')];}}}return _0x3baed8[_0x4616('0x17')];};};Realtime['prototype'][_0x4616('0x64')]=function(){var _0x5b9320=this;return function(_0x246b13){if(_0x246b13){freeIsNotKey(_0x246b13,_0x5b9320[_0x4616('0x65')],_0x4616('0x27'));for(var _0x3f6d05=0x0,_0x9136ee={};_0x3f6d05<_0x246b13[_0x4616('0x46')];_0x3f6d05+=0x1){_0x9136ee=_0x246b13[_0x3f6d05];if(_[_0x4616('0x44')](_0x5b9320[_0x4616('0x65')][_0x9136ee[_0x4616('0x27')]])){_0x5b9320['campaigns'][_0x9136ee['name']]=new Campaign(_0x9136ee);}else{_0x5b9320['mergeFromDatabase'](_0x5b9320[_0x4616('0x65')][_0x9136ee['name']],_0x9136ee);_0x5b9320[_0x4616('0x65')][_0x9136ee[_0x4616('0x27')]][_0x4616('0x66')]=_0x9136ee['SquareProject']?_0x9136ee[_0x4616('0x67')][_0x4616('0x27')]:undefined;}}}return _0x5b9320[_0x4616('0x65')];};};Realtime[_0x4616('0x3e')][_0x4616('0x68')]=function(){var _0x3e1b6b=this;return function(_0x52a7ed){if(_0x52a7ed){freeIsNotKey(_0x52a7ed,_0x3e1b6b['voiceExtensions'],'id');for(var _0x1f9e3c=0x0,_0x3c26b7={};_0x1f9e3c<_0x52a7ed[_0x4616('0x46')];_0x1f9e3c+=0x1){_0x3c26b7=_0x52a7ed[_0x1f9e3c];if(_[_0x4616('0x44')](_0x3e1b6b['voiceExtensions'][_0x3c26b7['id']])){_0x3e1b6b['voiceExtensions'][_0x3c26b7['id']]=new VoiceExtension(_0x3c26b7);}else{_0x3e1b6b[_0x4616('0x3f')](_0x3e1b6b[_0x4616('0x18')][_0x3c26b7['id']],_0x3c26b7);}}}return _0x3e1b6b[_0x4616('0x18')];};};Realtime[_0x4616('0x3e')][_0x4616('0x69')]=function(){var _0x4c4f6d=this;return function(_0x269ff8){clearCampaigns(_0x4c4f6d['campaigns']);for(var _0x47c370=0x0;_0x47c370<_0x269ff8[_0x4616('0x46')];_0x47c370+=0x1){_[_0x4616('0x55')](_0x4c4f6d[_0x4616('0x65')][_0x269ff8[_0x47c370]['name']],_0x269ff8[_0x47c370]);}return _0x4c4f6d[_0x4616('0x65')];};};Realtime[_0x4616('0x3e')][_0x4616('0x6a')]=function(){var _0x5c036a=this;return function(_0x8f5f90){if(_0x8f5f90){freeIsNotKey(_0x8f5f90,_0x5c036a[_0x4616('0x22')],'id');for(var _0x1716c4=0x0,_0x1fbf83={},_0x4aa103={};_0x1716c4<_0x8f5f90[_0x4616('0x46')];_0x1716c4+=0x1){_0x1fbf83=_0x8f5f90[_0x1716c4];if(_[_0x4616('0x44')](_0x5c036a[_0x4616('0x22')][_0x1fbf83['id']])){_0x5c036a[_0x4616('0x22')][_0x1fbf83['id']]=new FaxAccount(_0x1fbf83);}else{_0x5c036a[_0x4616('0x3f')](_0x5c036a[_0x4616('0x22')][_0x1fbf83['id']],_0x1fbf83);}}}return _0x5c036a[_0x4616('0x22')];};};module[_0x4616('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 11b0be9..dfd078b 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 _0xae80=['../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','interface','format','SIP/%s','voiceQueueReport','length','assigned','queuecallerexit','queuecallerexitAt','create','match','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','filename','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','lodash','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport'];(function(_0x24fa88,_0x4007b2){var _0x2a7377=function(_0x32b955){while(--_0x32b955){_0x24fa88['push'](_0x24fa88['shift']());}};_0x2a7377(++_0x4007b2);}(_0xae80,0x1e8));var _0x0ae8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xae80[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0ae8('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x0ae8('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x0ae8('0x2'));var RpcVoiceCallReport=require(_0x0ae8('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x0ae8('0x4'));var RpcVoiceQueueReport=require(_0x0ae8('0x5'));var RpcVoiceRecording=require(_0x0ae8('0x6'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0ae8('0x7'));var VoiceAgentReport=require(_0x0ae8('0x8'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x0ae8('0x9'));function Report(_0x574315){this[_0x0ae8('0xa')]=_0x574315;this[_0x0ae8('0xb')]=_0x574315[_0x0ae8('0xb')];this['telephones']=_0x574315[_0x0ae8('0xc')];}Report[_0x0ae8('0xd')][_0x0ae8('0xe')]=function(_0x19568d){var _0x4de79a=new VoiceQueueReport(this[_0x0ae8('0xa')]);var _0x2de591=new VoiceAgentReport(this[_0x0ae8('0xa')]);var _0x48bb48=new VoiceDialReport(this['realtime']);var _0x9fbf02=new VoiceCallReport(this['realtime']);var _0x1fdc99=new UserReport(this[_0x0ae8('0xa')]);if(config['xdr']&&config[_0x0ae8('0xf')][_0x0ae8('0x10')]){ami['on'](_0x0ae8('0x11'),this['voiceQueueReport'][_0x0ae8('0x12')](this));ami['on'](_0x0ae8('0x13'),this[_0x0ae8('0x14')]['bind'](this));ami['on'](_0x0ae8('0x15'),this['voiceAgentReport']['bind'](this));ami['on'](_0x0ae8('0x16'),this['voiceDialReport']['bind'](this));ami['on'](_0x0ae8('0x17'),this[_0x0ae8('0x18')][_0x0ae8('0x12')](this));ami['on'](_0x0ae8('0x19'),this[_0x0ae8('0x1a')][_0x0ae8('0x12')](this));}};Report[_0x0ae8('0xd')][_0x0ae8('0x1b')]=function(_0xa49733){var _0x3c3138;_0x3c3138=_[_0x0ae8('0x1c')](this['agents'],function(_0x5cf81b){return _0x5cf81b['accountcode']==_0xa49733||_0x5cf81b[_0x0ae8('0x1d')]==_0xa49733;});if(_[_0x0ae8('0x1e')](_0x3c3138)){var _0x55c38e=_[_0x0ae8('0x1c')](this[_0x0ae8('0xc')],function(_0x3b8ab2){return _0x3b8ab2[_0x0ae8('0x1f')]==_0xa49733||_0x3b8ab2[_0x0ae8('0x1d')]==_0xa49733;});if(_0x55c38e){_0x3c3138=_[_0x0ae8('0x1c')](this[_0x0ae8('0xb')],function(_0x410ff5){return _0x410ff5[_0x0ae8('0x20')]==util[_0x0ae8('0x21')](_0x0ae8('0x22'),_0x55c38e[_0x0ae8('0x1d')]);});}}return _0x3c3138;};Report[_0x0ae8('0xd')][_0x0ae8('0x23')]=function(_0x430bfb){for(var _0xf40d07=0x0;_0xf40d07<_0x430bfb[_0x0ae8('0x24')];_0xf40d07+=0x1){var _0x41aa52=this['findAgent'](_0x430bfb[_0xf40d07]['connectedlinenum']);if(_0x41aa52){_0x430bfb[_0xf40d07][_0x0ae8('0x1f')]=_0x41aa52[_0x0ae8('0x1f')];_0x430bfb[_0xf40d07][_0x0ae8('0x25')]=!![];_0x430bfb[_0xf40d07]['lastAssignedTo']=_0x41aa52['name'];_0x430bfb[_0xf40d07]['interface']=_[_0x0ae8('0x1e')](_0x41aa52[_0x0ae8('0x20')])?util[_0x0ae8('0x21')](_0x0ae8('0x22'),_0x41aa52['name']):_0x41aa52[_0x0ae8('0x20')];if(_0x430bfb[_0xf40d07]['queuecallercomplete']){_0x430bfb[_0xf40d07]['queuecallercompleteAt']=moment()[_0x0ae8('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x430bfb[_0xf40d07][_0x0ae8('0x26')]){_0x430bfb[_0xf40d07][_0x0ae8('0x27')]=moment()[_0x0ae8('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x430bfb[_0xf40d07]);}RpcVoiceQueueReport[_0x0ae8('0x28')](_0x430bfb[_0xf40d07]);}};function extractCalleridNumber(_0xad4622){var _0x366d0f=_0xad4622[_0x0ae8('0x29')](/<(.*?)>/);return _0x366d0f?_0x366d0f[0x1]:_0xad4622;}Report[_0x0ae8('0xd')][_0x0ae8('0x14')]=function(_0x31e7bc){_0x31e7bc[_0x0ae8('0x2a')]=_0x31e7bc[_0x0ae8('0x2a')]||_0x31e7bc[_0x0ae8('0x2b')];if(_0x31e7bc['type']==_0x0ae8('0x2c')){_0x31e7bc[_0x0ae8('0x2d')]=_0x0ae8('0x2e');_0x31e7bc['lastdata']=_0x31e7bc[_0x0ae8('0x2e')];if(_0x31e7bc[_0x0ae8('0x2f')]==_0x0ae8('0x30')){_0x31e7bc[_0x0ae8('0x1f')]='';_0x31e7bc['destination']=extractCalleridNumber(_0x31e7bc[_0x0ae8('0x31')]);}else if(_0x31e7bc[_0x0ae8('0x2f')]==_0x0ae8('0x32')){if(_0x31e7bc['destination']==_0x0ae8('0x33')){_0x31e7bc[_0x0ae8('0x2a')]=extractCalleridNumber(_0x31e7bc['calleridpreview']);_0x31e7bc[_0x0ae8('0x34')]=_0x31e7bc[_0x0ae8('0x35')];_0x31e7bc[_0x0ae8('0x36')]=[_0x31e7bc[_0x0ae8('0x37')],_0x31e7bc['channel']=_0x31e7bc[_0x0ae8('0x36')]][0x0];_0x31e7bc[_0x0ae8('0x31')]=_0x31e7bc[_0x0ae8('0x38')];}else{_0x31e7bc['destination']=_0x31e7bc['calleridnum'];_0x31e7bc[_0x0ae8('0x34')]=_0x31e7bc['originatecalleridnum'];if(_0x31e7bc[_0x0ae8('0x39')]==_0x0ae8('0x3a')){_0x31e7bc[_0x0ae8('0x1f')]=_0x31e7bc[_0x0ae8('0x3b')];}else{_0x31e7bc[_0x0ae8('0x1f')]='';}}}}else{_0x31e7bc['callerid']=util[_0x0ae8('0x21')](_0x0ae8('0x3c'),_0x31e7bc[_0x0ae8('0x3d')],_0x31e7bc[_0x0ae8('0x34')]);}if(RpcVoiceTransferReport[_0x0ae8('0x3e')][_0x31e7bc[_0x0ae8('0x3f')]]){var _0x6170a=RpcVoiceTransferReport['transfers'][_0x31e7bc[_0x0ae8('0x3f')]];_0x6170a[_0x0ae8('0x40')]=_0x31e7bc[_0x0ae8('0x41')];RpcVoiceTransferReport[_0x0ae8('0x18')](_0x6170a);delete RpcVoiceTransferReport[_0x0ae8('0x3e')][_0x31e7bc[_0x0ae8('0x3f')]];}RpcVoiceCallReport[_0x0ae8('0x28')](_0x31e7bc);if(_0x31e7bc['monitor']){for(var _0x1ad800=0x0;_0x1ad800<_0x31e7bc[_0x0ae8('0x42')][_0x0ae8('0x24')];_0x1ad800+=0x1){_0x31e7bc['monitorFilename']=_0x31e7bc[_0x0ae8('0x42')][_0x1ad800][_0x0ae8('0x43')];_0x31e7bc['createdAt']=_0x31e7bc[_0x0ae8('0x42')][_0x1ad800]['createdAt'];if(_0x31e7bc[_0x0ae8('0x2b')]==_0x0ae8('0x33')){_0x31e7bc[_0x0ae8('0x34')]=_0x31e7bc['connectedlinenum'];_0x31e7bc[_0x0ae8('0x3d')]=_0x31e7bc[_0x0ae8('0x44')];_0x31e7bc[_0x0ae8('0x3b')]=_0x31e7bc[_0x0ae8('0x1f')];_0x31e7bc['connectedlinename']=_0x31e7bc[_0x0ae8('0x45')];_0x31e7bc[_0x0ae8('0x2b')]=_0x31e7bc[_0x0ae8('0x35')];}else if(_0x31e7bc[_0x0ae8('0x2b')]==_0x0ae8('0x46')){_0x31e7bc[_0x0ae8('0x34')]=_0x31e7bc[_0x0ae8('0x2a')];_0x31e7bc[_0x0ae8('0x2b')]=_0x31e7bc[_0x0ae8('0x35')];}RpcVoiceRecording[_0x0ae8('0x28')](_0x31e7bc);}}};Report[_0x0ae8('0xd')]['voiceAgentReport']=function(_0x54d33a){if(_[_0x0ae8('0x47')](_0x54d33a)){_0x54d33a[_0x0ae8('0x48')](function(_0x15fc21){RpcVoiceAgentReport[_0x0ae8('0x28')](_0x15fc21);});}else{RpcVoiceAgentReport['create'](_0x54d33a);}};Report[_0x0ae8('0xd')][_0x0ae8('0x49')]=function(_0x1f3f9b){RpcVoiceDialReport[_0x0ae8('0x28')](_0x1f3f9b);var _0x30430b;var _0x5354e9;var _0x1f8d82=_0x1f3f9b['channel'];if(_[_0x0ae8('0x4a')](_0x1f8d82,_0x0ae8('0x4b'))){_0x5354e9=_0x1f8d82[_0x0ae8('0x4c')](_0x1f8d82['indexOf']('/')+0x1,_0x1f8d82[_0x0ae8('0x4d')]('@'));_0x30430b=_['find'](this[_0x0ae8('0xb')],function(_0xd7e253){return _0xd7e253[_0x0ae8('0x4e')]==_0x5354e9||_0xd7e253[_0x0ae8('0x4f')]==_0x5354e9||_0xd7e253[_0x0ae8('0x1f')]==_0x5354e9;});}else{_0x5354e9=_0x1f8d82[_0x0ae8('0x4c')](_0x1f8d82[_0x0ae8('0x4d')]('/')+0x1,_0x1f8d82[_0x0ae8('0x50')]('-'));_0x30430b=this['findAgent'](_0x5354e9);}if(_0x30430b){_0x1f3f9b[_0x0ae8('0x20')]=_[_0x0ae8('0x1e')](_0x30430b[_0x0ae8('0x20')])?util[_0x0ae8('0x21')](_0x0ae8('0x22'),_0x30430b[_0x0ae8('0x1d')]):_0x30430b[_0x0ae8('0x20')];_0x1f3f9b[_0x0ae8('0x45')]=_0x30430b[_0x0ae8('0x1d')];_0x1f3f9b['accountcode']=_0x30430b[_0x0ae8('0x1f')];RpcMemberReport[_0x0ae8('0x49')](_0x1f3f9b);}};Report[_0x0ae8('0xd')][_0x0ae8('0x18')]=function(_0x37a680){RpcVoiceTransferReport[_0x0ae8('0x3e')][_0x37a680[_0x0ae8('0x51')]]=_0x37a680;};Report[_0x0ae8('0xd')]['attendedTransfer']=function(_0x466bbc){RpcVoiceTransferReport[_0x0ae8('0x1a')](_0x466bbc);};module['exports']=Report; \ No newline at end of file +var _0x0464=['./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','dialer','lastapplication','queue','lastdata','callerid','context','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','lastIndexOf','voiceDialReport','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport'];(function(_0x89687f,_0x2fa79c){var _0x513038=function(_0xd91740){while(--_0xd91740){_0x89687f['push'](_0x89687f['shift']());}};_0x513038(++_0x2fa79c);}(_0x0464,0xef));var _0x4046=function(_0x19497f,_0x127de4){_0x19497f=_0x19497f-0x0;var _0x20947d=_0x0464[_0x19497f];return _0x20947d;};'use strict';var _=require(_0x4046('0x0'));var moment=require(_0x4046('0x1'));var util=require(_0x4046('0x2'));var config=require(_0x4046('0x3'));var ami=require(_0x4046('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x4046('0x5'));var RpcMemberReport=require(_0x4046('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x4046('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x4046('0x8'));var VoiceAgentReport=require(_0x4046('0x9'));var VoiceDialReport=require(_0x4046('0xa'));var UserReport=require(_0x4046('0xb'));function Report(_0x2a19b9){this[_0x4046('0xc')]=_0x2a19b9;this[_0x4046('0xd')]=_0x2a19b9[_0x4046('0xd')];this[_0x4046('0xe')]=_0x2a19b9[_0x4046('0xe')];}Report[_0x4046('0xf')][_0x4046('0x10')]=function(_0x548b38){var _0x594162=new VoiceQueueReport(this[_0x4046('0xc')]);var _0x251d59=new VoiceAgentReport(this[_0x4046('0xc')]);var _0xcfc620=new VoiceDialReport(this[_0x4046('0xc')]);var _0x5690b7=new VoiceCallReport(this['realtime']);var _0x435de0=new UserReport(this[_0x4046('0xc')]);if(config[_0x4046('0x11')]&&config[_0x4046('0x11')]['disabled']){ami['on'](_0x4046('0x12'),this[_0x4046('0x13')][_0x4046('0x14')](this));ami['on'](_0x4046('0x15'),this['voiceCallReport'][_0x4046('0x14')](this));ami['on']('custom:voiceAgentReport',this[_0x4046('0x16')]['bind'](this));ami['on'](_0x4046('0x17'),this['voiceDialReport']['bind'](this));ami['on'](_0x4046('0x18'),this['blindTransfer'][_0x4046('0x14')](this));ami['on'](_0x4046('0x19'),this[_0x4046('0x1a')]['bind'](this));}};Report[_0x4046('0xf')][_0x4046('0x1b')]=function(_0x5d4d30){var _0x59354c;_0x59354c=_[_0x4046('0x1c')](this['agents'],function(_0x315856){return _0x315856[_0x4046('0x1d')]==_0x5d4d30||_0x315856[_0x4046('0x1e')]==_0x5d4d30;});if(_[_0x4046('0x1f')](_0x59354c)){var _0x2ec5fe=_[_0x4046('0x1c')](this[_0x4046('0xe')],function(_0x2bfa59){return _0x2bfa59['accountcode']==_0x5d4d30||_0x2bfa59[_0x4046('0x1e')]==_0x5d4d30;});if(_0x2ec5fe){_0x59354c=_[_0x4046('0x1c')](this[_0x4046('0xd')],function(_0x4e7ebb){return _0x4e7ebb[_0x4046('0x20')]==util[_0x4046('0x21')](_0x4046('0x22'),_0x2ec5fe[_0x4046('0x1e')]);});}}return _0x59354c;};Report[_0x4046('0xf')][_0x4046('0x13')]=function(_0x1a0c5a){for(var _0x28e8e0=0x0;_0x28e8e0<_0x1a0c5a[_0x4046('0x23')];_0x28e8e0+=0x1){var _0x3abd27=this['findAgent'](_0x1a0c5a[_0x28e8e0]['connectedlinenum']);if(_0x3abd27){_0x1a0c5a[_0x28e8e0][_0x4046('0x1d')]=_0x3abd27[_0x4046('0x1d')];_0x1a0c5a[_0x28e8e0][_0x4046('0x24')]=!![];_0x1a0c5a[_0x28e8e0][_0x4046('0x25')]=_0x3abd27['name'];_0x1a0c5a[_0x28e8e0][_0x4046('0x20')]=_[_0x4046('0x1f')](_0x3abd27[_0x4046('0x20')])?util[_0x4046('0x21')](_0x4046('0x22'),_0x3abd27[_0x4046('0x1e')]):_0x3abd27['interface'];if(_0x1a0c5a[_0x28e8e0][_0x4046('0x26')]){_0x1a0c5a[_0x28e8e0]['queuecallercompleteAt']=moment()[_0x4046('0x21')](_0x4046('0x27'));}if(_0x1a0c5a[_0x28e8e0][_0x4046('0x28')]){_0x1a0c5a[_0x28e8e0][_0x4046('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x4046('0x13')](_0x1a0c5a[_0x28e8e0]);}RpcVoiceQueueReport[_0x4046('0x2a')](_0x1a0c5a[_0x28e8e0]);}};function extractCalleridNumber(_0x55332d){var _0x38d0ba=_0x55332d[_0x4046('0x2b')](/<(.*?)>/);return _0x38d0ba?_0x38d0ba[0x1]:_0x55332d;}Report[_0x4046('0xf')][_0x4046('0x2c')]=function(_0x3893a0){_0x3893a0['destination']=_0x3893a0[_0x4046('0x2d')]||_0x3893a0[_0x4046('0x2e')];if(_0x3893a0['type']==_0x4046('0x2f')){_0x3893a0[_0x4046('0x30')]=_0x4046('0x31');_0x3893a0[_0x4046('0x32')]=_0x3893a0[_0x4046('0x31')];if(_0x3893a0['context']=='from-voip-provider'){_0x3893a0[_0x4046('0x1d')]='';_0x3893a0[_0x4046('0x2d')]=extractCalleridNumber(_0x3893a0[_0x4046('0x33')]);}else if(_0x3893a0[_0x4046('0x34')]=='from-sip'){if(_0x3893a0['destination']==_0x4046('0x35')){_0x3893a0[_0x4046('0x2d')]=extractCalleridNumber(_0x3893a0['calleridpreview']);_0x3893a0[_0x4046('0x36')]=_0x3893a0[_0x4046('0x37')];_0x3893a0[_0x4046('0x38')]=[_0x3893a0[_0x4046('0x39')],_0x3893a0['channel']=_0x3893a0[_0x4046('0x38')]][0x0];_0x3893a0[_0x4046('0x33')]=_0x3893a0['calleridpreview'];}else{_0x3893a0[_0x4046('0x2d')]=_0x3893a0[_0x4046('0x36')];_0x3893a0[_0x4046('0x36')]=_0x3893a0['originatecalleridnum'];if(_0x3893a0['disposition']==_0x4046('0x3a')){_0x3893a0[_0x4046('0x1d')]=_0x3893a0[_0x4046('0x3b')];}else{_0x3893a0[_0x4046('0x1d')]='';}}}}else{_0x3893a0[_0x4046('0x33')]=util[_0x4046('0x21')](_0x4046('0x3c'),_0x3893a0[_0x4046('0x3d')],_0x3893a0['calleridnum']);}if(RpcVoiceTransferReport[_0x4046('0x3e')][_0x3893a0[_0x4046('0x3f')]]){var _0x3b1a47=RpcVoiceTransferReport[_0x4046('0x3e')][_0x3893a0[_0x4046('0x3f')]];_0x3b1a47[_0x4046('0x40')]=_0x3893a0['uniqueid'];RpcVoiceTransferReport[_0x4046('0x41')](_0x3b1a47);delete RpcVoiceTransferReport[_0x4046('0x3e')][_0x3893a0[_0x4046('0x3f')]];}RpcVoiceCallReport[_0x4046('0x2a')](_0x3893a0);if(_0x3893a0['monitor']){for(var _0x410c08=0x0;_0x410c08<_0x3893a0[_0x4046('0x42')]['length'];_0x410c08+=0x1){_0x3893a0[_0x4046('0x43')]=_0x3893a0['monitors'][_0x410c08][_0x4046('0x44')];_0x3893a0[_0x4046('0x45')]=_0x3893a0[_0x4046('0x42')][_0x410c08][_0x4046('0x45')];if(_0x3893a0[_0x4046('0x2e')]=='xcally-motion-preview'){_0x3893a0[_0x4046('0x36')]=_0x3893a0[_0x4046('0x3b')];_0x3893a0['calleridname']=_0x3893a0[_0x4046('0x46')];_0x3893a0['connectedlinenum']=_0x3893a0[_0x4046('0x1d')];_0x3893a0['connectedlinename']=_0x3893a0[_0x4046('0x47')];_0x3893a0[_0x4046('0x2e')]=_0x3893a0[_0x4046('0x37')];}else if(_0x3893a0['exten']==_0x4046('0x48')){_0x3893a0[_0x4046('0x36')]=_0x3893a0[_0x4046('0x2d')];_0x3893a0['exten']=_0x3893a0[_0x4046('0x37')];}RpcVoiceRecording[_0x4046('0x2a')](_0x3893a0);}}};Report['prototype'][_0x4046('0x16')]=function(_0x31cfd5){if(_[_0x4046('0x49')](_0x31cfd5)){_0x31cfd5[_0x4046('0x4a')](function(_0x231f72){RpcVoiceAgentReport[_0x4046('0x2a')](_0x231f72);});}else{RpcVoiceAgentReport[_0x4046('0x2a')](_0x31cfd5);}};Report[_0x4046('0xf')]['voiceDialReport']=function(_0x8f4f5c){RpcVoiceDialReport[_0x4046('0x2a')](_0x8f4f5c);var _0x47f76e;var _0x47eaad;var _0x453fcd=_0x8f4f5c[_0x4046('0x39')];if(_[_0x4046('0x4b')](_0x453fcd,_0x4046('0x4c'))){_0x47eaad=_0x453fcd[_0x4046('0x4d')](_0x453fcd[_0x4046('0x4e')]('/')+0x1,_0x453fcd[_0x4046('0x4e')]('@'));_0x47f76e=_[_0x4046('0x1c')](this[_0x4046('0xd')],function(_0x54eb4e){return _0x54eb4e['mobile']==_0x47eaad||_0x54eb4e['phone']==_0x47eaad||_0x54eb4e[_0x4046('0x1d')]==_0x47eaad;});}else{_0x47eaad=_0x453fcd[_0x4046('0x4d')](_0x453fcd[_0x4046('0x4e')]('/')+0x1,_0x453fcd[_0x4046('0x4f')]('-'));_0x47f76e=this[_0x4046('0x1b')](_0x47eaad);}if(_0x47f76e){_0x8f4f5c['interface']=_[_0x4046('0x1f')](_0x47f76e['interface'])?util[_0x4046('0x21')](_0x4046('0x22'),_0x47f76e[_0x4046('0x1e')]):_0x47f76e[_0x4046('0x20')];_0x8f4f5c['membername']=_0x47f76e[_0x4046('0x1e')];_0x8f4f5c['accountcode']=_0x47f76e[_0x4046('0x1d')];RpcMemberReport[_0x4046('0x50')](_0x8f4f5c);}};Report['prototype']['blindTransfer']=function(_0x810ba1){RpcVoiceTransferReport['transfers'][_0x810ba1[_0x4046('0x51')]]=_0x810ba1;};Report['prototype'][_0x4046('0x1a')]=function(_0xaf8f92){RpcVoiceTransferReport[_0x4046('0x1a')](_0xaf8f92);};module[_0x4046('0x52')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index c192c3f..cab9a4b 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedf7=['actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','format','trunk:%s','name','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','substring','indexOf','find','mobile','accountcode','updateStatusRealtime','[userReport][devicestatechange]','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../ami','defaults','redis','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]'];(function(_0x4f21cd,_0x30f06f){var _0x1af331=function(_0x51145e){while(--_0x51145e){_0x4f21cd['push'](_0x4f21cd['shift']());}};_0x1af331(++_0x30f06f);}(_0xedf7,0x15d));var _0x7edf=function(_0x5aad20,_0x185dcb){_0x5aad20=_0x5aad20-0x0;var _0x589727=_0xedf7[_0x5aad20];return _0x589727;};'use strict';var _=require(_0x7edf('0x0'));var moment=require(_0x7edf('0x1'));var util=require(_0x7edf('0x2'));var Redis=require(_0x7edf('0x3'));var BPromise=require(_0x7edf('0x4'));var config=require(_0x7edf('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0x7edf('0x6'));config['redis']=_[_0x7edf('0x7')](config[_0x7edf('0x8')],{'host':_0x7edf('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7edf('0x8')]));function UserReport(_0x16e1c9){this[_0x7edf('0xa')]=_0x16e1c9[_0x7edf('0xa')];this['agents']=_0x16e1c9[_0x7edf('0xb')];this[_0x7edf('0xc')]=_0x16e1c9['telephones'];ami['on']('registryentry',this[_0x7edf('0xd')]['bind'](this));ami['on']('registry',this[_0x7edf('0xd')][_0x7edf('0xe')](this));ami['on'](_0x7edf('0xf'),this['syncDeviceState']['bind'](this));ami['on'](_0x7edf('0x10'),this[_0x7edf('0x11')][_0x7edf('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x7edf('0x12')]()[_0x7edf('0x13')](ami[_0x7edf('0x14')]())['catch'](function(_0x4b6dd4){logger['error'](_0x7edf('0x15'),util[_0x7edf('0x16')](_0x4b6dd4,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7edf('0x12')]()[_0x7edf('0x13')](ami[_0x7edf('0x17')]())['catch'](function(_0x14c431){logger[_0x7edf('0x18')](_0x7edf('0x19'),util[_0x7edf('0x16')](_0x14c431,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x7edf('0x13')](ami[_0x7edf('0x1a')]())[_0x7edf('0x1b')](function(_0xdaa6c4){logger[_0x7edf('0x18')](_0x7edf('0x1c'),util['inspect'](_0xdaa6c4,{'showHidden':![],'depth':null}));});}UserReport[_0x7edf('0x1d')][_0x7edf('0x1e')]=function(){setInterval(function(){BPromise[_0x7edf('0x12')]()[_0x7edf('0x13')](showSipRegistrations())['then'](listDeviceStates())[_0x7edf('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x7edf('0x1d')][_0x7edf('0x1f')]=function(_0x65c99d){return _0x65c99d!==null&&!_[_0x7edf('0x20')](_0x65c99d);};UserReport[_0x7edf('0x1d')]['emit']=function(_0x15151b,_0x404881,_0xcd4a0){io['to'](_0x15151b)['emit'](_0x404881,_0xcd4a0);};UserReport[_0x7edf('0x1d')][_0x7edf('0xd')]=function(_0x403aa6){try{if(this['isNotNull'](_0x403aa6)){logger[_0x7edf('0x21')](_0x7edf('0x22'),_0x403aa6[_0x7edf('0x23')],_0x403aa6[_0x7edf('0x24')]);logger[_0x7edf('0x25')](_0x7edf('0x26'),util[_0x7edf('0x16')](_0x403aa6,{'showHidden':![],'depth':null}));var _0x215cda=_['find'](this[_0x7edf('0xa')],{'defaultuser':_0x403aa6[_0x7edf('0x23')]});if(_0x215cda){_0x403aa6['stateRegistry']=_0x403aa6[_0x7edf('0x24')];_['merge'](_0x215cda,_[_0x7edf('0x27')](_0x403aa6,[_0x7edf('0x28'),_0x7edf('0x29'),_0x7edf('0x23'),'state']));logger['debug'](_0x7edf('0x2a'),util[_0x7edf('0x16')](_0x215cda,{'showHidden':![],'depth':null}));this[_0x7edf('0x2b')](util[_0x7edf('0x2c')](_0x7edf('0x2d'),_0x215cda[_0x7edf('0x2e')]),'trunk:save',_0x215cda);}}}catch(_0x47b01c){logger[_0x7edf('0x18')](_0x7edf('0x26'),util[_0x7edf('0x16')](_0x47b01c,{'showHidden':![],'depth':null}));}};UserReport[_0x7edf('0x1d')][_0x7edf('0x2f')]=function(_0xc91d9c){try{if(this[_0x7edf('0x1f')](_0xc91d9c)){logger[_0x7edf('0x21')](_0x7edf('0x30'),_0xc91d9c[_0x7edf('0x31')],_0xc91d9c['state']);logger[_0x7edf('0x25')]('[userReport][devicestatechange]',util[_0x7edf('0x16')](_0xc91d9c,{'showHidden':![],'depth':null}));if(this[_0x7edf('0xb')][_0xc91d9c[_0x7edf('0x31')]]){if(!this[_0x7edf('0xb')][_0xc91d9c['device']][_0x7edf('0x32')]||_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]()==_0x7edf('0x34')){this[_0x7edf('0xb')][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x32')]=![];if(this['agents'][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x24')]!==_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]()){this[_0x7edf('0xb')][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x35')]=_[_0x7edf('0x36')](moment()[_0x7edf('0x2c')]('x'));}this[_0x7edf('0xb')][_0xc91d9c['device']]['state']=_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]();this[_0x7edf('0xb')][_0xc91d9c['device']]['updateStatusRealtime'](_0xc91d9c);}}else if(this[_0x7edf('0xc')][_0xc91d9c[_0x7edf('0x31')]]){if(this[_0x7edf('0xc')][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x24')]!==_0xc91d9c[_0x7edf('0x24')]['toLowerCase']()){this['telephones'][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x35')]=_[_0x7edf('0x36')](moment()[_0x7edf('0x2c')]('x'));}this[_0x7edf('0xc')][_0xc91d9c['device']]['state']=_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]();logger[_0x7edf('0x25')](_0x7edf('0x37'),util[_0x7edf('0x16')](this[_0x7edf('0xc')][_0xc91d9c[_0x7edf('0x31')]],{'showHidden':![],'depth':null}));this[_0x7edf('0x2b')](util[_0x7edf('0x2c')](_0x7edf('0x38'),this[_0x7edf('0xc')][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x2e')]),_0x7edf('0x39'),this[_0x7edf('0xc')][_0xc91d9c[_0x7edf('0x31')]]);}else if(this[_0x7edf('0xa')][_0xc91d9c[_0x7edf('0x31')]]){if(this['trunks'][_0xc91d9c[_0x7edf('0x31')]]['state']!==_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]()){this[_0x7edf('0xa')][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x35')]=_[_0x7edf('0x36')](moment()[_0x7edf('0x2c')]('x'));}this[_0x7edf('0xa')][_0xc91d9c[_0x7edf('0x31')]]['state']=_0xc91d9c['state'][_0x7edf('0x33')]();logger[_0x7edf('0x25')](_0x7edf('0x3a'),util[_0x7edf('0x16')](this[_0x7edf('0xa')][_0xc91d9c[_0x7edf('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x7edf('0x2c')]('trunk:%s',this['trunks'][_0xc91d9c[_0x7edf('0x31')]][_0x7edf('0x2e')]),_0x7edf('0x3b'),this[_0x7edf('0xa')][_0xc91d9c[_0x7edf('0x31')]]);}else if(_['startsWith'](_0xc91d9c[_0x7edf('0x31')],_0x7edf('0x3c'))){var _0x4f9231=_0xc91d9c[_0x7edf('0x31')];var _0x448259=_0x4f9231[_0x7edf('0x3d')](_0x4f9231[_0x7edf('0x3e')]('/')+0x1,_0x4f9231[_0x7edf('0x3e')]('@'));var _0x398643=_[_0x7edf('0x3f')](this[_0x7edf('0xb')],function(_0x3b509d){return _0x3b509d[_0x7edf('0x40')]==_0x448259||_0x3b509d['phone']==_0x448259||_0x3b509d[_0x7edf('0x41')]==_0x448259;});if(_0x398643){if(_0x398643[_0x7edf('0x24')]!==_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]()){_0x398643[_0x7edf('0x35')]=_['toNumber'](moment()[_0x7edf('0x2c')]('x'));}_0x398643[_0x7edf('0x24')]=_0xc91d9c[_0x7edf('0x24')][_0x7edf('0x33')]();_0x398643[_0x7edf('0x32')]=!![];_0x398643[_0x7edf('0x42')](_0xc91d9c);}}}}catch(_0xcbc056){logger[_0x7edf('0x18')](_0x7edf('0x43'),util[_0x7edf('0x16')](_0xcbc056,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x7edf('0x11')]=function(_0x49f159){try{if(this[_0x7edf('0x1f')](_0x49f159)&&this[_0x7edf('0x1f')](_0x49f159[_0x7edf('0x10')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x49f159[_0x7edf('0x44')],_0x49f159[_0x7edf('0x45')],_0x49f159[_0x7edf('0x10')]);logger[_0x7edf('0x25')]('[userReport][peerstatus]',util[_0x7edf('0x16')](_0x49f159,{'showHidden':![],'depth':null}));if(this['agents'][_0x49f159['peer']]){if(!this[_0x7edf('0xb')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x32')]||_0x49f159[_0x7edf('0x10')][_0x7edf('0x33')]()=='registered'){this[_0x7edf('0xb')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x32')]=![];this[_0x7edf('0xb')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x46')]=_0x49f159['peerstatus'][_0x7edf('0x33')]();this[_0x7edf('0xb')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x45')]=_0x49f159[_0x7edf('0x45')];this['agents'][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x42')](_0x49f159);}}else if(this[_0x7edf('0xc')][_0x49f159[_0x7edf('0x44')]]){this[_0x7edf('0xc')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x46')]=_0x49f159[_0x7edf('0x10')][_0x7edf('0x33')]();this['telephones'][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x45')]=_0x49f159[_0x7edf('0x45')];logger['debug'](_0x7edf('0x47'),util[_0x7edf('0x16')](this[_0x7edf('0xc')][_0x49f159['peer']],{'showHidden':![],'depth':null}));this[_0x7edf('0x2b')](util[_0x7edf('0x2c')](_0x7edf('0x38'),this[_0x7edf('0xc')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x2e')]),_0x7edf('0x39'),this['telephones'][_0x49f159[_0x7edf('0x44')]]);}else if(this[_0x7edf('0xa')][_0x49f159['peer']]){this[_0x7edf('0xa')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x46')]=_0x49f159[_0x7edf('0x10')][_0x7edf('0x33')]();this[_0x7edf('0xa')][_0x49f159[_0x7edf('0x44')]]['address']=_0x49f159[_0x7edf('0x45')];logger[_0x7edf('0x25')](_0x7edf('0x48'),util['inspect'](this['trunks'][_0x49f159[_0x7edf('0x44')]],{'showHidden':![],'depth':null}));this[_0x7edf('0x2b')](util[_0x7edf('0x2c')]('trunk:%s',this[_0x7edf('0xa')][_0x49f159[_0x7edf('0x44')]][_0x7edf('0x2e')]),_0x7edf('0x3b'),this[_0x7edf('0xa')][_0x49f159[_0x7edf('0x44')]]);}}}catch(_0x87f141){logger[_0x7edf('0x18')](_0x7edf('0x49'),util[_0x7edf('0x16')](_0x87f141,{'showHidden':![],'depth':null}));}};module[_0x7edf('0x4a')]=UserReport; \ No newline at end of file +var _0xf739=['[userReport][registry]','omit','event','actionid','emit','format','trunk:%s','trunk:save','device','agents','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','find','mobile','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','trunks','telephones','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug'];(function(_0x30e33c,_0x3969eb){var _0x30dff0=function(_0x303cde){while(--_0x303cde){_0x30e33c['push'](_0x30e33c['shift']());}};_0x30dff0(++_0x3969eb);}(_0xf739,0xb5));var _0x9f73=function(_0x3fae9c,_0x34a6d0){_0x3fae9c=_0x3fae9c-0x0;var _0x2ce598=_0xf739[_0x3fae9c];return _0x2ce598;};'use strict';var _=require(_0x9f73('0x0'));var moment=require('moment');var util=require(_0x9f73('0x1'));var Redis=require(_0x9f73('0x2'));var BPromise=require('bluebird');var config=require(_0x9f73('0x3'));var logger=require(_0x9f73('0x4'))(_0x9f73('0x5'));var ami=require('../ami');config['redis']=_[_0x9f73('0x6')](config[_0x9f73('0x7')],{'host':_0x9f73('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9f73('0x7')]));function UserReport(_0x108897){this[_0x9f73('0x9')]=_0x108897[_0x9f73('0x9')];this['agents']=_0x108897['agents'];this[_0x9f73('0xa')]=_0x108897['telephones'];ami['on']('registryentry',this[_0x9f73('0xb')]['bind'](this));ami['on'](_0x9f73('0xc'),this[_0x9f73('0xb')][_0x9f73('0xd')](this));ami['on'](_0x9f73('0xe'),this[_0x9f73('0xf')][_0x9f73('0xd')](this));ami['on'](_0x9f73('0x10'),this[_0x9f73('0x11')][_0x9f73('0xd')](this));return this[_0x9f73('0x12')]();}function showSipRegistrations(){Promise[_0x9f73('0x13')]()[_0x9f73('0x14')](ami[_0x9f73('0x15')]())[_0x9f73('0x16')](function(_0x26d424){logger[_0x9f73('0x17')](_0x9f73('0x18'),util[_0x9f73('0x19')](_0x26d424,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x9f73('0x13')]()[_0x9f73('0x14')](ami[_0x9f73('0x1a')]())[_0x9f73('0x16')](function(_0x11321c){logger['error'](_0x9f73('0x1b'),util[_0x9f73('0x19')](_0x11321c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x9f73('0x14')](ami[_0x9f73('0x1c')]())[_0x9f73('0x16')](function(_0x55b650){logger[_0x9f73('0x17')](_0x9f73('0x1d'),util[_0x9f73('0x19')](_0x55b650,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x9f73('0x13')]()[_0x9f73('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0x9f73('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x9f73('0x1e')]['isNotNull']=function(_0x20b704){return _0x20b704!==null&&!_[_0x9f73('0x1f')](_0x20b704);};UserReport[_0x9f73('0x1e')]['emit']=function(_0x1a6087,_0x1847e2,_0xd01b27){io['to'](_0x1a6087)['emit'](_0x1847e2,_0xd01b27);};UserReport[_0x9f73('0x1e')]['syncRegistry']=function(_0x3b8045){try{if(this[_0x9f73('0x20')](_0x3b8045)){logger[_0x9f73('0x21')](_0x9f73('0x22'),_0x3b8045[_0x9f73('0x23')],_0x3b8045[_0x9f73('0x24')]);logger[_0x9f73('0x25')](_0x9f73('0x26'),util[_0x9f73('0x19')](_0x3b8045,{'showHidden':![],'depth':null}));var _0xd854fa=_['find'](this[_0x9f73('0x9')],{'defaultuser':_0x3b8045[_0x9f73('0x23')]});if(_0xd854fa){_0x3b8045['stateRegistry']=_0x3b8045['state'];_['merge'](_0xd854fa,_[_0x9f73('0x27')](_0x3b8045,[_0x9f73('0x28'),_0x9f73('0x29'),'username',_0x9f73('0x24')]));logger[_0x9f73('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0xd854fa,{'showHidden':![],'depth':null}));this[_0x9f73('0x2a')](util[_0x9f73('0x2b')](_0x9f73('0x2c'),_0xd854fa['name']),_0x9f73('0x2d'),_0xd854fa);}}}catch(_0x54b200){logger[_0x9f73('0x17')]('[userReport][registry]',util[_0x9f73('0x19')](_0x54b200,{'showHidden':![],'depth':null}));}};UserReport[_0x9f73('0x1e')]['syncDeviceState']=function(_0x1f1725){try{if(this[_0x9f73('0x20')](_0x1f1725)){logger[_0x9f73('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x1f1725[_0x9f73('0x2e')],_0x1f1725[_0x9f73('0x24')]);logger[_0x9f73('0x25')]('[userReport][devicestatechange]',util[_0x9f73('0x19')](_0x1f1725,{'showHidden':![],'depth':null}));if(this['agents'][_0x1f1725[_0x9f73('0x2e')]]){if(!this[_0x9f73('0x2f')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x30')]||_0x1f1725['state']['toLowerCase']()==_0x9f73('0x31')){this[_0x9f73('0x2f')][_0x1f1725['device']][_0x9f73('0x30')]=![];if(this[_0x9f73('0x2f')][_0x1f1725[_0x9f73('0x2e')]]['state']!==_0x1f1725['state'][_0x9f73('0x32')]()){this[_0x9f73('0x2f')][_0x1f1725['device']][_0x9f73('0x33')]=_['toNumber'](moment()[_0x9f73('0x2b')]('x'));}this[_0x9f73('0x2f')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x24')]=_0x1f1725[_0x9f73('0x24')][_0x9f73('0x32')]();this[_0x9f73('0x2f')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x34')](_0x1f1725);}}else if(this[_0x9f73('0xa')][_0x1f1725[_0x9f73('0x2e')]]){if(this['telephones'][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x24')]!==_0x1f1725[_0x9f73('0x24')]['toLowerCase']()){this['telephones'][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x33')]=_[_0x9f73('0x35')](moment()[_0x9f73('0x2b')]('x'));}this[_0x9f73('0xa')][_0x1f1725[_0x9f73('0x2e')]]['state']=_0x1f1725[_0x9f73('0x24')][_0x9f73('0x32')]();logger[_0x9f73('0x25')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x9f73('0xa')][_0x1f1725['device']],{'showHidden':![],'depth':null}));this[_0x9f73('0x2a')](util[_0x9f73('0x2b')](_0x9f73('0x36'),this[_0x9f73('0xa')][_0x1f1725['device']][_0x9f73('0x37')]),_0x9f73('0x38'),this[_0x9f73('0xa')][_0x1f1725[_0x9f73('0x2e')]]);}else if(this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]]){if(this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x24')]!==_0x1f1725[_0x9f73('0x24')][_0x9f73('0x32')]()){this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]]['stateTime']=_['toNumber'](moment()[_0x9f73('0x2b')]('x'));}this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x24')]=_0x1f1725[_0x9f73('0x24')][_0x9f73('0x32')]();logger[_0x9f73('0x25')](_0x9f73('0x39'),util[_0x9f73('0x19')](this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x9f73('0x2b')](_0x9f73('0x2c'),this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]][_0x9f73('0x37')]),_0x9f73('0x2d'),this[_0x9f73('0x9')][_0x1f1725[_0x9f73('0x2e')]]);}else if(_[_0x9f73('0x3a')](_0x1f1725[_0x9f73('0x2e')],_0x9f73('0x3b'))){var _0x4cc74e=_0x1f1725[_0x9f73('0x2e')];var _0x21bb4e=_0x4cc74e['substring'](_0x4cc74e[_0x9f73('0x3c')]('/')+0x1,_0x4cc74e[_0x9f73('0x3c')]('@'));var _0x17a0fb=_[_0x9f73('0x3d')](this[_0x9f73('0x2f')],function(_0x4a43bd){return _0x4a43bd[_0x9f73('0x3e')]==_0x21bb4e||_0x4a43bd[_0x9f73('0x3f')]==_0x21bb4e||_0x4a43bd[_0x9f73('0x40')]==_0x21bb4e;});if(_0x17a0fb){if(_0x17a0fb['state']!==_0x1f1725[_0x9f73('0x24')][_0x9f73('0x32')]()){_0x17a0fb[_0x9f73('0x33')]=_[_0x9f73('0x35')](moment()[_0x9f73('0x2b')]('x'));}_0x17a0fb['state']=_0x1f1725[_0x9f73('0x24')]['toLowerCase']();_0x17a0fb[_0x9f73('0x30')]=!![];_0x17a0fb[_0x9f73('0x34')](_0x1f1725);}}}}catch(_0x79c8ab){logger['error'](_0x9f73('0x41'),util[_0x9f73('0x19')](_0x79c8ab,{'showHidden':![],'depth':null}));}};UserReport[_0x9f73('0x1e')][_0x9f73('0x11')]=function(_0x5b2776){try{if(this[_0x9f73('0x20')](_0x5b2776)&&this[_0x9f73('0x20')](_0x5b2776['peerstatus'])){logger[_0x9f73('0x21')](_0x9f73('0x42'),_0x5b2776[_0x9f73('0x43')],_0x5b2776[_0x9f73('0x44')],_0x5b2776['peerstatus']);logger[_0x9f73('0x25')](_0x9f73('0x45'),util[_0x9f73('0x19')](_0x5b2776,{'showHidden':![],'depth':null}));if(this['agents'][_0x5b2776[_0x9f73('0x43')]]){if(!this[_0x9f73('0x2f')][_0x5b2776['peer']][_0x9f73('0x30')]||_0x5b2776[_0x9f73('0x10')][_0x9f73('0x32')]()==_0x9f73('0x46')){this[_0x9f73('0x2f')][_0x5b2776[_0x9f73('0x43')]]['local']=![];this['agents'][_0x5b2776[_0x9f73('0x43')]]['status']=_0x5b2776['peerstatus']['toLowerCase']();this[_0x9f73('0x2f')][_0x5b2776[_0x9f73('0x43')]][_0x9f73('0x44')]=_0x5b2776[_0x9f73('0x44')];this[_0x9f73('0x2f')][_0x5b2776[_0x9f73('0x43')]]['updateStatusRealtime'](_0x5b2776);}}else if(this[_0x9f73('0xa')][_0x5b2776[_0x9f73('0x43')]]){this['telephones'][_0x5b2776[_0x9f73('0x43')]][_0x9f73('0x47')]=_0x5b2776[_0x9f73('0x10')]['toLowerCase']();this[_0x9f73('0xa')][_0x5b2776[_0x9f73('0x43')]][_0x9f73('0x44')]=_0x5b2776['address'];logger[_0x9f73('0x25')](_0x9f73('0x48'),util['inspect'](this[_0x9f73('0xa')][_0x5b2776[_0x9f73('0x43')]],{'showHidden':![],'depth':null}));this[_0x9f73('0x2a')](util[_0x9f73('0x2b')](_0x9f73('0x36'),this['telephones'][_0x5b2776[_0x9f73('0x43')]]['name']),_0x9f73('0x38'),this['telephones'][_0x5b2776[_0x9f73('0x43')]]);}else if(this[_0x9f73('0x9')][_0x5b2776[_0x9f73('0x43')]]){this[_0x9f73('0x9')][_0x5b2776['peer']][_0x9f73('0x47')]=_0x5b2776['peerstatus']['toLowerCase']();this['trunks'][_0x5b2776[_0x9f73('0x43')]][_0x9f73('0x44')]=_0x5b2776[_0x9f73('0x44')];logger[_0x9f73('0x25')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x9f73('0x19')](this[_0x9f73('0x9')][_0x5b2776[_0x9f73('0x43')]],{'showHidden':![],'depth':null}));this[_0x9f73('0x2a')](util[_0x9f73('0x2b')](_0x9f73('0x2c'),this[_0x9f73('0x9')][_0x5b2776['peer']][_0x9f73('0x37')]),'trunk:save',this['trunks'][_0x5b2776[_0x9f73('0x43')]]);}}}catch(_0x1aa803){logger[_0x9f73('0x17')](_0x9f73('0x45'),util[_0x9f73('0x19')](_0x1aa803,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index da5dee2..78a57b3 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x42ed1a,_0x29a397){var _0x482252=function(_0xaac024){while(--_0xaac024){_0x42ed1a['push'](_0x42ed1a['shift']());}};_0x482252(++_0x29a397);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x27c3a6,_0x3835d8){var _0x336427=function(_0x4273fe){while(--_0x4273fe){_0x27c3a6['push'](_0x27c3a6['shift']());}};_0x336427(++_0x3835d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 9e6b8aa..ca1b1f9 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8822=['mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','uniqueid','merge','pick','keys','context','channel','split','xcally-motion-preview','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','debug','OutgoingSpoolFailed','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','from-sip','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','emit','error','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','lastdata','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','connectedlinename','disposition','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV','monitorFilename','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','diff','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','destinationchannel','webbar:stopmonitors','BlindTransfer','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','secondtransfereruniqueid','transfercalleridnum','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:'];(function(_0x1410e6,_0x332ea1){var _0x364b2b=function(_0x52a08b){while(--_0x52a08b){_0x1410e6['push'](_0x1410e6['shift']());}};_0x364b2b(++_0x332ea1);}(_0x8822,0xc6));var _0x2882=function(_0x2b6eb6,_0x3c903b){_0x2b6eb6=_0x2b6eb6-0x0;var _0x117fca=_0x8822[_0x2b6eb6];return _0x117fca;};'use strict';var _=require('lodash');var moment=require(_0x2882('0x0'));var util=require('util');var path=require(_0x2882('0x1'));var Redis=require('ioredis');var config=require(_0x2882('0x2'));var logger=require(_0x2882('0x3'))(_0x2882('0x4'));var ami=require(_0x2882('0x5'));var Channel=require(_0x2882('0x6'));var RpcSetting=require(_0x2882('0x7'));var applications=[_0x2882('0x8'),_0x2882('0x9'),_0x2882('0xa'),_0x2882('0xb'),_0x2882('0xc'),'voicemail'];var dispositions=[_0x2882('0xd'),'FAILED',_0x2882('0xe'),_0x2882('0xd'),_0x2882('0xd'),_0x2882('0xd'),_0x2882('0xf'),_0x2882('0x10'),_0x2882('0xe'),_0x2882('0xe'),_0x2882('0xe')];config[_0x2882('0x11')]=_[_0x2882('0x12')](config[_0x2882('0x11')],{'host':_0x2882('0x13'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2882('0x11')]));function VoiceCallReport(_0x2d0b47){this[_0x2882('0x14')]=_0x2d0b47[_0x2882('0x14')];this[_0x2882('0x15')]=_0x2d0b47[_0x2882('0x15')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x2882('0x16')][_0x2882('0x17')](this));ami['on']('newexten',this[_0x2882('0x16')][_0x2882('0x17')](this));ami['on'](_0x2882('0x18'),this[_0x2882('0x19')]['bind'](this));ami['on'](_0x2882('0x1a'),this[_0x2882('0x1b')]['bind'](this));ami['on'](_0x2882('0x1c'),this[_0x2882('0x1d')][_0x2882('0x17')](this));ami['on']('hangup',this[_0x2882('0x1e')][_0x2882('0x17')](this));ami['on']('newcallerid',this[_0x2882('0x1f')]['bind'](this));ami['on']('attendedtransfer',this[_0x2882('0x20')][_0x2882('0x17')](this));ami['on'](_0x2882('0x21'),this[_0x2882('0x22')][_0x2882('0x17')](this));ami['on'](_0x2882('0x23'),this[_0x2882('0x24')][_0x2882('0x17')](this));ami['on'](_0x2882('0x25'),this[_0x2882('0x26')]['bind'](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x2882('0x27')]();}catch(_0x388e5e){logger['error'](_0x2882('0x28'),util['inspect'](_0x388e5e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x2882('0x29')][_0x2882('0x2a')]=function(_0x1caaf3){return _0x1caaf3!==null&&!_[_0x2882('0x2b')](_0x1caaf3);};VoiceCallReport[_0x2882('0x29')]['emit']=function(_0x1866df,_0x101c8c,_0x108321){io['to'](_0x1866df)['emit'](_0x101c8c,_0x108321);};VoiceCallReport['prototype'][_0x2882('0x1f')]=function(_0x446bef){try{if(this[_0x2882('0x2a')](_0x446bef)){logger['info'](_0x2882('0x2c'),_0x446bef['uniqueid'],_0x446bef['calleridname'],_0x446bef[_0x2882('0x2d')]);logger['debug'](_0x2882('0x2e'),_0x446bef['uniqueid'],util[_0x2882('0x2f')](_0x446bef,{'showHidden':![],'depth':null}));if(_0x446bef['uniqueid']===_0x446bef[_0x2882('0x30')]){if(!_[_0x2882('0x2b')](this[_0x2882('0x14')][_0x446bef[_0x2882('0x31')]])){_[_0x2882('0x32')](this[_0x2882('0x14')][_0x446bef['uniqueid']],_[_0x2882('0x33')](_0x446bef,_[_0x2882('0x34')](this[_0x2882('0x14')][_0x446bef[_0x2882('0x31')]])));}}if(_0x446bef[_0x2882('0x35')]==='from-sip'){if(this['agents'][_0x446bef[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]){if(_0x446bef['exten']==_0x2882('0x38')){this['agents'][_0x446bef[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]['destconnectedlinenum']=_0x446bef['connectedlinenum'];this['emit'](util['format'](_0x2882('0x39'),this['agents'][_0x446bef['channel'][_0x2882('0x37')]('-')[0x0]][_0x2882('0x3a')]),_0x2882('0x3b'),{'destaccountcode':this[_0x2882('0x15')][_0x446bef['channel'][_0x2882('0x37')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x446bef[_0x2882('0x3c')]});}}}}}catch(_0x28df55){logger['error'](_0x2882('0x3d'),_0x446bef['uniqueid'],util['inspect'](_0x28df55,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2882('0x19')]=function(_0xc185c8){try{if(this[_0x2882('0x2a')](_0xc185c8)){logger[_0x2882('0x3e')]('[%s][voiceCallReport][newchannel]\x20event:',_0xc185c8[_0x2882('0x31')],util[_0x2882('0x2f')](_0xc185c8,{'showHidden':![],'depth':null}));if(_0xc185c8['uniqueid']===_0xc185c8[_0x2882('0x30')]&&_0xc185c8[_0x2882('0x36')]!=_0x2882('0x3f')){if(_[_0x2882('0x2b')](this[_0x2882('0x14')][_0xc185c8[_0x2882('0x31')]])){logger[_0x2882('0x40')](_0x2882('0x41'),_0xc185c8[_0x2882('0x31')],_0xc185c8[_0x2882('0x35')],_0xc185c8[_0x2882('0x42')]);this['channels'][_0xc185c8[_0x2882('0x31')]]=new Channel();this[_0x2882('0x14')][_0xc185c8[_0x2882('0x31')]]['starttime']=moment()[_0x2882('0x43')](_0x2882('0x44'));this[_0x2882('0x14')][_0xc185c8[_0x2882('0x31')]]['disposition']=dispositions[_[_0x2882('0x45')](_0xc185c8[_0x2882('0x46')])];_[_0x2882('0x32')](this[_0x2882('0x14')][_0xc185c8[_0x2882('0x31')]],_[_0x2882('0x33')](_0xc185c8,_['keys'](this[_0x2882('0x14')][_0xc185c8['uniqueid']])));if(_0xc185c8[_0x2882('0x35')]===_0x2882('0x47')){if(this[_0x2882('0x15')][_0xc185c8[_0x2882('0x36')]['split']('-')[0x0]]){if(_[_0x2882('0x2b')](this[_0x2882('0x15')][_0xc185c8[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x48')])){this['agents'][_0xc185c8[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x48')]=_0xc185c8[_0x2882('0x42')];logger['debug'](_0x2882('0x49'),_0xc185c8[_0x2882('0x31')],util[_0x2882('0x2f')]({'id':this[_0x2882('0x15')][_0xc185c8['channel'][_0x2882('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x2882('0x15')][_0xc185c8[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x4a')],'destconnectedlinenum':_0xc185c8[_0x2882('0x42')]},{'showHidden':![],'depth':null}));this[_0x2882('0x4b')](util[_0x2882('0x43')](_0x2882('0x39'),this['agents'][_0xc185c8[_0x2882('0x36')]['split']('-')[0x0]][_0x2882('0x3a')]),'user:agentconnect',{'id':this[_0x2882('0x15')][_0xc185c8[_0x2882('0x36')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x2882('0x15')][_0xc185c8[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x4a')],'destconnectedlinenum':_0xc185c8[_0x2882('0x42')]});}}}}}}}catch(_0x181063){logger[_0x2882('0x4c')](_0x2882('0x4d'),_0xc185c8[_0x2882('0x31')],util['inspect'](_0x181063,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2882('0x29')][_0x2882('0x16')]=function(_0x35f30a){try{if(this[_0x2882('0x2a')](_0x35f30a)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x35f30a['uniqueid'],util[_0x2882('0x2f')](_0x35f30a,{'showHidden':![],'depth':null}));if(_0x35f30a['uniqueid']===_0x35f30a[_0x2882('0x30')]&&_0x35f30a[_0x2882('0x42')]!='h'&&_0x35f30a['channel']!=_0x2882('0x3f')){_0x35f30a[_0x2882('0x4e')]=_0x35f30a[_0x2882('0x4e')][_0x2882('0x4f')]();_0x35f30a[_0x2882('0x50')]=_0x35f30a['appdata']&&_0x35f30a[_0x2882('0x51')][_0x2882('0x52')](_0x2882('0x53'))?_0x35f30a[_0x2882('0x51')]:(_0x35f30a[_0x2882('0x51')]||_0x35f30a['applicationdata'])[_0x2882('0x4f')]();logger[_0x2882('0x40')](_0x2882('0x54'),_0x35f30a[_0x2882('0x31')],_0x35f30a[_0x2882('0x4e')],_0x35f30a[_0x2882('0x50')]);if(_['isUndefined'](this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]])){this['channels'][_0x35f30a['uniqueid']]=new Channel();this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]][_0x2882('0x55')]=_0x35f30a[_0x2882('0x56')]?moment()[_0x2882('0x57')](moment[_0x2882('0x56')](_0x35f30a[_0x2882('0x56')])['seconds'](),_0x2882('0x58'))[_0x2882('0x43')](_0x2882('0x44')):moment()[_0x2882('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]]['disposition']=_0x2882('0xd');}_[_0x2882('0x32')](this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]],_['pick'](_0x35f30a,_[_0x2882('0x34')](this['channels'][_0x35f30a[_0x2882('0x31')]])));if(_['includes'](applications,_0x35f30a[_0x2882('0x4e')])){this['channels'][_0x35f30a['uniqueid']]['lastapplication']=_0x35f30a[_0x2882('0x4e')];this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]][_0x2882('0x59')]=_0x35f30a[_0x2882('0x50')];if(_0x35f30a[_0x2882('0x4e')]===_0x2882('0x8')&&_[_0x2882('0x52')](_0x35f30a[_0x2882('0x50')][_0x2882('0x4f')](),_0x2882('0x5a'))){var _0x406783=_0x35f30a['applicationdata'][_0x2882('0x37')]('=');var _0x38e575=_0x406783[0x0][_0x2882('0x4f')]()['match'](/cdr\((.*)\)/);if(_0x38e575){this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]][_0x38e575[0x1]]=_0x406783[0x1];}}else if(_0x35f30a[_0x2882('0x4e')]==='queue'){this[_0x2882('0x14')][_0x35f30a[_0x2882('0x31')]][_0x2882('0x9')]=_0x35f30a[_0x2882('0x50')][_0x2882('0x37')](',')[0x0];}}}}}catch(_0x5ee526){logger[_0x2882('0x4c')](_0x2882('0x5b'),_0x35f30a[_0x2882('0x31')],util[_0x2882('0x2f')](_0x5ee526,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x75ec8d){try{if(this[_0x2882('0x2a')](_0x75ec8d)){logger[_0x2882('0x40')](_0x2882('0x5c'),_0x75ec8d[_0x2882('0x31')],_0x75ec8d[_0x2882('0x30')],_0x75ec8d[_0x2882('0x5d')],_0x75ec8d[_0x2882('0x2d')]);logger[_0x2882('0x3e')](_0x2882('0x5e'),_0x75ec8d[_0x2882('0x31')],util['inspect'](_0x75ec8d,{'showHidden':![],'depth':null}));if(_0x75ec8d[_0x2882('0x31')]!==_0x75ec8d[_0x2882('0x30')]){if(this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]]){if(_0x75ec8d['channelstate']==='6'){if(!this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]]['answered']){var _0x433483=moment();this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x5f')]=!![];this[_0x2882('0x14')][_0x75ec8d['linkedid']][_0x2882('0x60')]=_0x433483[_0x2882('0x43')](_0x2882('0x44'));if(this['channels'][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x55')]){this['channels'][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x61')]=_0x433483['diff'](this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x55')],_0x2882('0x58'));}}this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]]['linkedid']=_0x75ec8d[_0x2882('0x31')];if(_0x75ec8d[_0x2882('0x2d')]!==_0x2882('0x38')){this[_0x2882('0x14')][_0x75ec8d['linkedid']][_0x2882('0x3c')]=_0x75ec8d[_0x2882('0x2d')];}this[_0x2882('0x14')][_0x75ec8d['linkedid']][_0x2882('0x62')]=_0x75ec8d[_0x2882('0x5d')];this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]]['destinationchannel']=_0x75ec8d['channel'];this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x63')]=dispositions[_[_0x2882('0x45')](_0x75ec8d['channelstate'])];if(this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]){this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x64')]=this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')]['split']('-')[0x0]]['id'];this['channels'][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x65')]=this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')]['split']('-')[0x0]][_0x2882('0x3a')];}}}}else{if(this['channels'][_0x75ec8d[_0x2882('0x31')]]){if(_0x75ec8d[_0x2882('0x46')]==='6'){if(this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]){this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x31')]]['UserId']=this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]['id'];this[_0x2882('0x14')][_0x75ec8d['uniqueid']][_0x2882('0x65')]=this['agents'][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x3a')];}}}}if(_0x75ec8d[_0x2882('0x46')]==='6'&&_0x75ec8d[_0x2882('0x35')]===_0x2882('0x47')){if(this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]){this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x48')]=_0x75ec8d['exten'];var _0x1a51b6,_0x2c62f6;if(this[_0x2882('0x14')][_0x75ec8d['uniqueid']]){_0x1a51b6=this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x31')]][_0x2882('0x66')];_0x2c62f6=this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x31')]]['queue'];}else if(this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]]){_0x1a51b6=this['channels'][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x66')];_0x2c62f6=this[_0x2882('0x14')][_0x75ec8d[_0x2882('0x30')]][_0x2882('0x9')];}logger[_0x2882('0x3e')](_0x2882('0x67'),_0x75ec8d[_0x2882('0x31')],util['inspect']({'id':this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x75ec8d[_0x2882('0x36')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x75ec8d[_0x2882('0x42')],'routealias':_0x1a51b6,'queue':_0x2c62f6||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0x2882('0x43')](_0x2882('0x39'),this[_0x2882('0x15')][_0x75ec8d['channel'][_0x2882('0x37')]('-')[0x0]][_0x2882('0x3a')]),_0x2882('0x3b'),{'id':this[_0x2882('0x15')][_0x75ec8d[_0x2882('0x36')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x2882('0x15')][_0x75ec8d['channel']['split']('-')[0x0]][_0x2882('0x4a')],'destconnectedlinenum':_0x75ec8d[_0x2882('0x42')],'routealias':_0x1a51b6,'queue':_0x2c62f6||undefined});}}}}catch(_0x763a1c){logger['error']('[%s][voiceCallReport][newstate]',_0x75ec8d[_0x2882('0x31')],util[_0x2882('0x2f')](_0x763a1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2882('0x29')][_0x2882('0x68')]=function(_0x4a0bb0,_0x5103af){try{if(this[_0x2882('0x14')][_0x4a0bb0]){logger['info'](_0x2882('0x69'),_0x4a0bb0,_0x5103af);this['channels'][_0x4a0bb0]['monitor']=!![];if(_[_0x2882('0x6a')](_0x5103af,_0x2882('0x6b'))){_0x5103af=_0x5103af['replace'](_0x2882('0x6b'),_0x2882('0x6c'));}this[_0x2882('0x14')][_0x4a0bb0][_0x2882('0x6d')]=_0x5103af;var _0x442b73=_['find'](this[_0x2882('0x14')][_0x4a0bb0][_0x2882('0x6e')],{'filename':_0x5103af});if(_['isNil'](_0x442b73)){this[_0x2882('0x14')][_0x4a0bb0]['monitors']['push']({'filename':_0x5103af,'createdAt':moment()[_0x2882('0x43')](_0x2882('0x44')),'mixmonitorid':'','status':_0x2882('0x6f')});}}}catch(_0x1b910f){logger[_0x2882('0x4c')](_0x2882('0x70'),_0x4a0bb0,util[_0x2882('0x2f')](_0x1b910f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2882('0x29')][_0x2882('0x1d')]=function(_0x965746){try{if(this[_0x2882('0x2a')](_0x965746)){logger[_0x2882('0x3e')](_0x2882('0x71'),_0x965746[_0x2882('0x31')],util[_0x2882('0x2f')](_0x965746,{'showHidden':![],'depth':null}));if(this['channels'][_0x965746['uniqueid']]&&_0x965746[_0x2882('0x36')]!=_0x2882('0x3f')){if(this['isNotNull'](_0x965746[_0x2882('0x72')])){if(this['isNotNull'](_0x965746[_0x2882('0x72')][_0x2882('0x73')])){logger[_0x2882('0x40')](_0x2882('0x74'),_0x965746['uniqueid'],_0x965746[_0x2882('0x75')]);this[_0x2882('0x68')](_0x965746['uniqueid'],_0x965746['value']);}else if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')][_0x2882('0x76')])){logger[_0x2882('0x40')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x965746[_0x2882('0x31')],_0x965746[_0x2882('0x75')]);this['channels'][_0x965746[_0x2882('0x31')]][_0x2882('0x2d')]=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746['variable'][_0x2882('0x77')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x965746[_0x2882('0x31')],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]]['callerid']=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746['variable'][_0x2882('0x78')])){logger[_0x2882('0x40')](_0x2882('0x79'),_0x965746['uniqueid'],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]][_0x2882('0x7a')]=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')]['xmd-queue'])){logger[_0x2882('0x40')](_0x2882('0x7b'),_0x965746['uniqueid'],_0x965746[_0x2882('0x75')]['split'](',')[0x0]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]][_0x2882('0x9')]=_0x965746['value'][_0x2882('0x37')](',')[0x0];}else if(this[_0x2882('0x2a')](_0x965746['variable']['xmd-originatecalleridnum'])){logger[_0x2882('0x40')](_0x2882('0x7c'),_0x965746['uniqueid'],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746['uniqueid']][_0x2882('0x7d')]=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746['variable'][_0x2882('0x7e')])){logger[_0x2882('0x40')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x965746[_0x2882('0x31')],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]][_0x2882('0x7f')]=_0x965746['value'];}else if(this[_0x2882('0x2a')](_0x965746['variable']['xmd-callerid-preview'])){logger[_0x2882('0x40')](_0x2882('0x80'),_0x965746[_0x2882('0x31')],_0x965746['value']);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]][_0x2882('0x81')]=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')]['xmcs-queue'])){logger[_0x2882('0x40')](_0x2882('0x82'),_0x965746['uniqueid'],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]]['queue']=_0x965746[_0x2882('0x75')];}else if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')]['sipcallid'])){logger[_0x2882('0x40')](_0x2882('0x83'),_0x965746[_0x2882('0x31')],_0x965746[_0x2882('0x75')]);this[_0x2882('0x14')][_0x965746[_0x2882('0x31')]][_0x2882('0x84')]=_0x965746[_0x2882('0x75')];}}}else if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')][_0x2882('0x73')])){if(_0x965746[_0x2882('0x75')]){var _0x251464=path[_0x2882('0x85')](_0x965746[_0x2882('0x75')])[_0x2882('0x3a')];logger['info'](_0x2882('0x74'),_0x251464,_0x965746[_0x2882('0x75')]);this[_0x2882('0x68')](_0x251464,_0x965746[_0x2882('0x75')]);}}else if(this['channels'][_0x965746[_0x2882('0x30')]]){if(this[_0x2882('0x2a')](_0x965746['variable'])){if(this[_0x2882('0x2a')](_0x965746[_0x2882('0x72')]['sipcallid'])){logger[_0x2882('0x40')](_0x2882('0x83'),_0x965746[_0x2882('0x30')],_0x965746['value']);this[_0x2882('0x14')][_0x965746[_0x2882('0x30')]][_0x2882('0x86')]=_0x965746[_0x2882('0x75')];}}}}}catch(_0x294449){logger[_0x2882('0x4c')](_0x2882('0x87'),_0x965746[_0x2882('0x31')],util[_0x2882('0x2f')](_0x294449,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2882('0x29')][_0x2882('0x1e')]=function(_0x169905){try{if(this[_0x2882('0x2a')](_0x169905)){logger[_0x2882('0x3e')](_0x2882('0x88'),_0x169905['uniqueid'],util[_0x2882('0x2f')](_0x169905,{'showHidden':![],'depth':null}));if(this['channels'][_0x169905[_0x2882('0x31')]]){logger[_0x2882('0x40')](_0x2882('0x89'),_0x169905[_0x2882('0x31')],_0x169905[_0x2882('0x8a')]);var _0x2fa4bf=moment();this['channels'][_0x169905['uniqueid']][_0x2882('0x8b')]=_0x2fa4bf['format'](_0x2882('0x44'));this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]]['duration']=_0x2fa4bf['diff'](this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]][_0x2882('0x55')],'seconds');if(this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]][_0x2882('0x5f')]){this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]][_0x2882('0x8c')]=_0x2fa4bf[_0x2882('0x8d')](this['channels'][_0x169905[_0x2882('0x31')]]['answertime'],'seconds');this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]][_0x2882('0x61')]=this['channels'][_0x169905[_0x2882('0x31')]]['duration']-this[_0x2882('0x14')][_0x169905[_0x2882('0x31')]][_0x2882('0x8c')];}if(_0x169905[_0x2882('0x35')]===_0x2882('0x47')){if(this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]){this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]=_['omit'](this['agents'][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]],[_0x2882('0x48')]);logger['debug'](_0x2882('0x8e'),_0x169905['uniqueid'],util[_0x2882('0x2f')]({'id':this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x4a')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x2882('0x39'),this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]][_0x2882('0x3a')]),_0x2882('0x8f'),{'id':this[_0x2882('0x15')][_0x169905[_0x2882('0x36')][_0x2882('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x169905[_0x2882('0x36')]['split']('-')[0x0]]['accountcode']});for(var _0x39132c=0x0;_0x39132c0x0?_0x3d75e0:0x0;this[_0x642f('0x13')][_0x4f6cb6['queue']]['talking']=this['voiceQueues'][_0x4f6cb6[_0x642f('0x69')]][_0x642f('0x30')]>_[_0x642f('0x6e')](_0x4f6cb6[_0x642f('0x70')])?_[_0x642f('0x6e')](_0x4f6cb6[_0x642f('0x70')]):this[_0x642f('0x13')][_0x4f6cb6[_0x642f('0x69')]][_0x642f('0x30')];this[_0x642f('0x72')](this['voiceQueues'][_0x4f6cb6[_0x642f('0x69')]],_0x642f('0x67'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x642f('0x40')](this[_0x642f('0x13')][_0x4f6cb6['queue']],{'showHidden':![],'depth':null}));ami[_0x642f('0x47')](_0x642f('0x73'),this[_0x642f('0x13')][_0x4f6cb6['queue']]);}}}catch(_0x5a33c4){logger['error'](_0x642f('0x68'),util['inspect'](_0x5a33c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x642f('0xd')]['syncQueueSummaryComplete']=function(_0x1f79e2){logger[_0x642f('0x50')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x1f79e2,{'showHidden':![],'depth':null}));this[_0x642f('0x14')]=!![];};VoiceQueueReport['prototype'][_0x642f('0x1c')]=function(_0x2cbec8){try{if(this['isNotNull'](_0x2cbec8)){logger[_0x642f('0x50')](_0x642f('0x74'),_0x2cbec8[_0x642f('0x4b')],util[_0x642f('0x40')](_0x2cbec8,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x2cbec8[_0x642f('0x4b')]]))this[_0x642f('0x10')][_0x2cbec8[_0x642f('0x4b')]]=[];if(_[_0x642f('0x75')](this[_0x642f('0x35')][_0x2cbec8[_0x642f('0x4b')]]))this['channels'][_0x2cbec8[_0x642f('0x4b')]]={};var _0x37e76e=new QueueReport();_0x37e76e[_0x642f('0x4e')]=_0x2cbec8[_0x642f('0x69')];_0x37e76e['type']=this[_0x642f('0x13')][_0x37e76e[_0x642f('0x4e')]]&&this['voiceQueues'][_0x37e76e[_0x642f('0x4e')]][_0x642f('0x5a')]?this['voiceQueues'][_0x37e76e['name']][_0x642f('0x5a')]||_0x642f('0x54'):_0x642f('0x54');_0x37e76e['queue']=_0x2cbec8[_0x642f('0x69')];_0x37e76e[_0x642f('0x76')]=moment()[_0x642f('0x4c')](_0x642f('0x77'));_0x37e76e['position']=_0x2cbec8[_0x642f('0x78')];_0x37e76e[_0x642f('0x79')]=_0x2cbec8[_0x642f('0x79')];_0x37e76e[_0x642f('0x4b')]=_0x2cbec8['uniqueid'];_0x37e76e[_0x642f('0x7a')]=this[_0x642f('0x35')][_0x2cbec8[_0x642f('0x4b')]][_0x642f('0x7a')];logger[_0x642f('0x7b')](_0x642f('0x7c'),_0x37e76e[_0x642f('0x4e')],_0x37e76e[_0x642f('0x5a')]);_[_0x642f('0x7d')](_0x37e76e,_[_0x642f('0x7e')](_0x2cbec8,_[_0x642f('0x7f')](_0x37e76e)));this[_0x642f('0x10')][_0x2cbec8[_0x642f('0x4b')]][_0x642f('0x80')](_0x37e76e);this[_0x642f('0x35')][_0x2cbec8['uniqueid']]=_0x37e76e;this['emitVoiceQueueChannelSave'](_0x37e76e,_0x642f('0x1b'));}}catch(_0x37f62f){logger[_0x642f('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2cbec8[_0x642f('0x4b')],util[_0x642f('0x40')](_0x37f62f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x642f('0x1e')]=function(_0x11ca18){try{if(this[_0x642f('0x63')](_0x11ca18)){logger[_0x642f('0x50')](_0x642f('0x81'),_0x11ca18['uniqueid'],util[_0x642f('0x40')](_0x11ca18,{'showHidden':![],'depth':null}));if(this[_0x642f('0x10')][_0x11ca18[_0x642f('0x4b')]]){var _0x26df7d=_[_0x642f('0x82')](this[_0x642f('0x10')][_0x11ca18[_0x642f('0x4b')]]);_0x26df7d[_0x642f('0x83')]=![];_0x26df7d['queuecallercompleteAt']=null;_0x26df7d[_0x642f('0x84')]=_0x11ca18[_0x642f('0x84')];_0x26df7d[_0x642f('0x85')]=_0x11ca18[_0x642f('0x85')];_0x26df7d['queuecallerabandon']=!![];_0x26df7d[_0x642f('0x86')]=moment()[_0x642f('0x4c')](_0x642f('0x77'));_0x26df7d[_0x642f('0x87')]='ABANDONED';_0x26df7d[_0x642f('0x88')]=null;logger[_0x642f('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x26df7d['name'],_0x26df7d['type']);this[_0x642f('0x35')][_0x11ca18[_0x642f('0x4b')]]=_0x26df7d;this[_0x642f('0x45')](_0x26df7d,_0x642f('0x1d'));}}}catch(_0x222e35){logger[_0x642f('0x3f')](_0x642f('0x81'),_0x11ca18['uniqueid'],util[_0x642f('0x40')](_0x222e35,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x642f('0xd')]['syncQueueCallerLeave']=function(_0xfc48fa){try{if(this[_0x642f('0x63')](_0xfc48fa)){logger[_0x642f('0x50')](_0x642f('0x89'),_0xfc48fa[_0x642f('0x4b')],util[_0x642f('0x40')](_0xfc48fa,{'showHidden':![],'depth':null}));if(this[_0x642f('0x10')][_0xfc48fa['uniqueid']]){var _0x30f4b7=_[_0x642f('0x82')](this[_0x642f('0x10')][_0xfc48fa['uniqueid']]);_0x30f4b7[_0x642f('0x8a')]=moment()[_0x642f('0x4c')](_0x642f('0x77'));_0x30f4b7[_0x642f('0x8b')]=_0xfc48fa[_0x642f('0x8b')];_0x30f4b7[_0x642f('0x8c')]=_0xfc48fa['connectedlinename'];logger[_0x642f('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30f4b7['name'],_0x30f4b7['type'],_0xfc48fa['connectedlinenum'],_0xfc48fa[_0x642f('0x8c')]);this['channels'][_0xfc48fa[_0x642f('0x4b')]]=_0x30f4b7;this[_0x642f('0x48')](_0x30f4b7,_0x642f('0x1f'));}}}catch(_0x1d81b4){logger[_0x642f('0x3f')](_0x642f('0x89'),_0xfc48fa[_0x642f('0x4b')],util[_0x642f('0x40')](_0x1d81b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x642f('0xd')][_0x642f('0x8d')]=function(_0x9939ae){try{if(this[_0x642f('0x63')](_0x9939ae)){logger[_0x642f('0x50')](_0x642f('0x8e'),_0x9939ae[_0x642f('0x4b')],util[_0x642f('0x40')](_0x9939ae,{'showHidden':![],'depth':null}));if(this[_0x642f('0x10')][_0x9939ae[_0x642f('0x4b')]]){var _0x3a07a9=_[_0x642f('0x82')](this['queueReports'][_0x9939ae['uniqueid']]);_0x3a07a9[_0x642f('0x83')]=!![];_0x3a07a9[_0x642f('0x87')]=_0x642f('0x8f');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x3a07a9['name'],_0x3a07a9[_0x642f('0x5a')]);}}}catch(_0x51a5ae){logger[_0x642f('0x3f')](_0x642f('0x8e'),_0x9939ae[_0x642f('0x4b')],util['inspect'](_0x51a5ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x642f('0xd')]['syncAgentComplete']=function(_0x4a3378){try{if(this[_0x642f('0x63')](_0x4a3378)){logger['debug'](_0x642f('0x90'),_0x4a3378['uniqueid'],util[_0x642f('0x40')](_0x4a3378,{'showHidden':![],'depth':null}));if(this[_0x642f('0x10')][_0x4a3378[_0x642f('0x4b')]]){var _0xd3322e=_['last'](this['queueReports'][_0x4a3378[_0x642f('0x4b')]]);_0xd3322e['queuecallerabandon']=![];_0xd3322e['queuecallerabandonAt']=null;_0xd3322e[_0x642f('0x91')]=!![];_0xd3322e[_0x642f('0x88')]=_0x4a3378[_0x642f('0x92')];_0xd3322e['holdtime']=_0x4a3378[_0x642f('0x84')];_0xd3322e['queuecallercomplete']=!![];_0xd3322e[_0x642f('0x93')]=![];_0xd3322e['queuecallerexitAt']=null;if(!_0xd3322e['transfer']){if(_0x4a3378[_0x642f('0x94')]==_0x642f('0x95')){_0xd3322e[_0x642f('0x87')]=_0x642f('0x96');logger[_0x642f('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xd3322e[_0x642f('0x4e')],_0xd3322e[_0x642f('0x5a')]);}else{if(_[_0x642f('0x97')](_0x4a3378[_0x642f('0x3b')]['toLowerCase'](),_0x642f('0x98'))){if(this[_0x642f('0x10')][_0x4a3378[_0x642f('0x99')]]){var _0x5a9252=_['last'](this[_0x642f('0x10')][_0x4a3378['linkedid']]);_0x5a9252[_0x642f('0x83')]=![];_0x5a9252['queuecallerexit']=!![];_0x5a9252[_0x642f('0x9a')]=moment(_0xd3322e[_0x642f('0x76')])['add'](_0x4a3378['holdtime'],_0x642f('0x9b'))[_0x642f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a9252['queuecallerexitreason']='FORWARDTRANSFER';_0x5a9252[_0x642f('0x95')]=!![];_0x5a9252[_0x642f('0x9c')]=_0x642f('0x9d');_0x5a9252[_0x642f('0x9e')]=_0x4a3378['destexten'];_0x5a9252[_0x642f('0x9f')]=_0x4a3378['uniqueid'];logger['info'](_0x642f('0xa0'),_0x5a9252[_0x642f('0x4e')],_0x5a9252[_0x642f('0x5a')]);var _0x51ddd0=this[_0x642f('0x10')][_0x4a3378[_0x642f('0x99')]];this['queueReports'][_0x4a3378[_0x642f('0x99')]]=this[_0x642f('0x10')][_0x4a3378[_0x642f('0x4b')]];this[_0x642f('0x10')][_0x4a3378[_0x642f('0x4b')]]=_0x51ddd0;}}else{_0xd3322e['queuecallerexitreason']=_0x642f('0xa1')+_0x4a3378['reason'][_0x642f('0xa2')]();logger[_0x642f('0x7b')](_0x642f('0xa3'),_0xd3322e[_0x642f('0x4e')],_0xd3322e[_0x642f('0x5a')],_0xd3322e[_0x642f('0x87')]);}}}this['channels'][_0x4a3378[_0x642f('0x4b')]]=_0xd3322e;this['emitVoiceQueueChannelRemove'](_0xd3322e,'agentcomplete');}}}catch(_0x3f288b){logger[_0x642f('0x3f')](_0x642f('0x90'),_0x4a3378[_0x642f('0x4b')],util['inspect'](_0x3f288b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x642f('0xd')][_0x642f('0xa4')]=function(_0x2e98d3){try{if(this['isNotNull'](_0x2e98d3)){logger[_0x642f('0x50')](_0x642f('0xa5'),_0x2e98d3['uniqueid'],util['inspect'](_0x2e98d3,{'showHidden':![],'depth':null}));this[_0x642f('0xa6')](_0x2e98d3[_0x642f('0x4b')],_[_0x642f('0x7f')](_0x2e98d3[_0x642f('0xa7')])[0x0],_0x2e98d3[_0x642f('0xa8')]);if(this[_0x642f('0x10')][_0x2e98d3[_0x642f('0x4b')]]){var _0x3d7216=_['last'](this[_0x642f('0x10')][_0x2e98d3[_0x642f('0x4b')]]);if(_0x3d7216){if(this['isNotNull'](_0x2e98d3[_0x642f('0xa7')])&&this[_0x642f('0x63')](_0x2e98d3[_0x642f('0xa7')][_0x642f('0xa9')])){switch(_0x2e98d3[_0x642f('0xa8')]){case _0x642f('0xaa'):_0x3d7216[_0x642f('0x93')]=![];_0x3d7216[_0x642f('0x9a')]=null;break;case _0x642f('0xab'):_0x3d7216[_0x642f('0xac')]='timeout';_0x3d7216[_0x642f('0x93')]=!![];_0x3d7216['queuecallerexitAt']=moment()[_0x642f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7216[_0x642f('0x8a')]=moment()[_0x642f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x642f('0x50')](_0x642f('0xad'),_0x2e98d3['uniqueid'],util[_0x642f('0x40')](_0x3d7216,{'showHidden':![],'depth':null}));ami[_0x642f('0x47')](_0x642f('0xae'),_0x3d7216);break;default:_0x3d7216['queuecallerexit']=!![];_0x3d7216[_0x642f('0x9a')]=moment()[_0x642f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7216[_0x642f('0x8a')]=moment()[_0x642f('0x4c')](_0x642f('0x77'));}_0x3d7216[_0x642f('0x1d')]=![];_0x3d7216[_0x642f('0x86')]=null;_0x3d7216['queuecallerexitreason']=_0x2e98d3[_0x642f('0xa8')];this[_0x642f('0x35')][_0x2e98d3['uniqueid']]=_0x3d7216;this['emitVoiceQueueChannelRemove'](_0x3d7216,'varset');}else if(this['isNotNull'](_0x2e98d3['variable'])&&this[_0x642f('0x63')](_0x2e98d3['variable'][_0x642f('0xaf')])){if(!_0x3d7216['queuecallerabandon']){_0x3d7216[_0x642f('0x93')]=!![];_0x3d7216[_0x642f('0x9a')]=moment()[_0x642f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7216[_0x642f('0x87')]='EXITWITHKEY';_0x3d7216[_0x642f('0x8a')]=moment()[_0x642f('0x4c')](_0x642f('0x77'));this['channels'][_0x2e98d3[_0x642f('0x4b')]]=_0x3d7216;}}logger['info'](_0x642f('0xb0'),_0x2e98d3[_0x642f('0x4b')],_0x3d7216[_0x642f('0x4e')],_0x3d7216[_0x642f('0x5a')],_[_0x642f('0x7f')](_0x2e98d3['variable'])[0x0],_0x2e98d3[_0x642f('0xa8')]);_0x3d7216[_0x642f('0x16')]=this[_0x642f('0x16')][_0x2e98d3['uniqueid']];}}}}catch(_0x34ada3){logger[_0x642f('0x3f')](_0x642f('0xa5'),_0x2e98d3['uniqueid'],util['inspect'](_0x34ada3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x642f('0xa6')]=function(_0x16a6eb,_0x54bc3b,_0x3fdf7a){var _0x48753c=['rtpaudioqos',_0x642f('0xb1'),_0x642f('0xb2'),'rtpaudioqosjitterbridged',_0x642f('0xb3'),_0x642f('0xb4'),_0x642f('0xb5'),'rtpaudioqosrttbridged',_0x642f('0xb6'),_0x642f('0xb7'),'bridgepeer',_0x642f('0xb8'),_0x642f('0xb9'),'memberdynamic',_0x642f('0xba'),_0x642f('0xbb'),_0x642f('0x92'),_0x642f('0xbc'),_0x642f('0xbd')];if(!_[_0x642f('0x38')](_0x54bc3b)&&!_[_0x642f('0xbe')](_0x48753c,_0x54bc3b)){if(_[_0x642f('0x75')](this[_0x642f('0x16')][_0x16a6eb])){this['variables'][_0x16a6eb]={};}this[_0x642f('0x16')][_0x16a6eb][_0x54bc3b]=_0x3fdf7a;}};VoiceQueueReport[_0x642f('0xd')][_0x642f('0x24')]=function(_0x51f545){try{if(this[_0x642f('0x63')](_0x51f545)){logger[_0x642f('0x50')]('[%s][voiceQueueReport][hangup]',_0x51f545[_0x642f('0x4b')],util['inspect'](_0x51f545,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x51f545[_0x642f('0x4b')]]){for(var _0x132cb2=0x0,_0x422fb8={};_0x132cb20x0?_0x5f1c17:0x0;this[_0x6489('0x11')][_0x53760b[_0x6489('0x66')]][_0x6489('0x30')]=this['voiceQueues'][_0x53760b[_0x6489('0x66')]][_0x6489('0x30')]>_[_0x6489('0x6c')](_0x53760b[_0x6489('0x6d')])?_['toNumber'](_0x53760b[_0x6489('0x6d')]):this['voiceQueues'][_0x53760b['queue']]['talking'];this[_0x6489('0x52')](this['voiceQueues'][_0x53760b[_0x6489('0x66')]],_0x6489('0x15'));}logger[_0x6489('0x46')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x6489('0x3b')](this[_0x6489('0x11')][_0x53760b[_0x6489('0x66')]],{'showHidden':![],'depth':null}));ami[_0x6489('0x44')](_0x6489('0x6f'),this['voiceQueues'][_0x53760b[_0x6489('0x66')]]);}}}catch(_0x231850){logger[_0x6489('0x3d')](_0x6489('0x64'),util[_0x6489('0x3b')](_0x231850,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6489('0x9')][_0x6489('0x19')]=function(_0x20d9be){logger['debug'](_0x6489('0x70'),util[_0x6489('0x3b')](_0x20d9be,{'showHidden':![],'depth':null}));this[_0x6489('0x12')]=!![];};VoiceQueueReport[_0x6489('0x9')]['syncQueueCallerJoin']=function(_0x5be126){try{if(this['isNotNull'](_0x5be126)){logger[_0x6489('0x46')](_0x6489('0x71'),_0x5be126[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x5be126,{'showHidden':![],'depth':null}));if(_[_0x6489('0x72')](this['queueReports'][_0x5be126[_0x6489('0x4f')]]))this[_0x6489('0x3c')][_0x5be126[_0x6489('0x4f')]]=[];if(_[_0x6489('0x72')](this[_0x6489('0xf')][_0x5be126[_0x6489('0x4f')]]))this[_0x6489('0xf')][_0x5be126[_0x6489('0x4f')]]={};var _0x429aad=new QueueReport();_0x429aad[_0x6489('0x4a')]=_0x5be126[_0x6489('0x66')];_0x429aad['type']=this[_0x6489('0x11')][_0x429aad[_0x6489('0x4a')]]&&this[_0x6489('0x11')][_0x429aad[_0x6489('0x4a')]]['type']?this[_0x6489('0x11')][_0x429aad[_0x6489('0x4a')]][_0x6489('0x53')]||'inbound':_0x6489('0x54');_0x429aad['queue']=_0x5be126[_0x6489('0x66')];_0x429aad['queuecallerjoinAt']=moment()[_0x6489('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x429aad[_0x6489('0x73')]=_0x5be126[_0x6489('0x73')];_0x429aad[_0x6489('0x74')]=_0x5be126['count'];_0x429aad[_0x6489('0x4f')]=_0x5be126[_0x6489('0x4f')];_0x429aad[_0x6489('0x75')]=this['channels'][_0x5be126['uniqueid']][_0x6489('0x75')];logger['info'](_0x6489('0x76'),_0x429aad[_0x6489('0x4a')],_0x429aad[_0x6489('0x53')]);_[_0x6489('0x77')](_0x429aad,_[_0x6489('0x78')](_0x5be126,_[_0x6489('0x79')](_0x429aad)));this[_0x6489('0x3c')][_0x5be126[_0x6489('0x4f')]][_0x6489('0x7a')](_0x429aad);this[_0x6489('0xf')][_0x5be126[_0x6489('0x4f')]]=_0x429aad;this[_0x6489('0x45')](_0x429aad,_0x6489('0x1a'));}}catch(_0x566fcb){logger[_0x6489('0x3d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5be126['uniqueid'],util[_0x6489('0x3b')](_0x566fcb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0xd7a016){try{if(this['isNotNull'](_0xd7a016)){logger[_0x6489('0x46')]('[%s][voiceQueueReport][queuecallerabandon]',_0xd7a016[_0x6489('0x4f')],util[_0x6489('0x3b')](_0xd7a016,{'showHidden':![],'depth':null}));if(this[_0x6489('0x3c')][_0xd7a016[_0x6489('0x4f')]]){var _0x4a399c=_[_0x6489('0x7b')](this['queueReports'][_0xd7a016['uniqueid']]);_0x4a399c[_0x6489('0x7c')]=![];_0x4a399c[_0x6489('0x7d')]=null;_0x4a399c['holdtime']=_0xd7a016[_0x6489('0x7e')];_0x4a399c[_0x6489('0x7f')]=_0xd7a016[_0x6489('0x7f')];_0x4a399c[_0x6489('0x80')]=!![];_0x4a399c['queuecallerabandonAt']=moment()[_0x6489('0x48')](_0x6489('0x81'));_0x4a399c[_0x6489('0x82')]=_0x6489('0x83');_0x4a399c['lastAssignedTo']=null;logger['info'](_0x6489('0x84'),_0x4a399c['name'],_0x4a399c[_0x6489('0x53')]);this[_0x6489('0xf')][_0xd7a016[_0x6489('0x4f')]]=_0x4a399c;this['emitVoiceQueueChannelRemove'](_0x4a399c,'queuecallerabandon');}}}catch(_0x4dec45){logger[_0x6489('0x3d')](_0x6489('0x85'),_0xd7a016[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x4dec45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6489('0x9')][_0x6489('0x86')]=function(_0x1598c2){try{if(this[_0x6489('0x65')](_0x1598c2)){logger[_0x6489('0x46')](_0x6489('0x87'),_0x1598c2['uniqueid'],util[_0x6489('0x3b')](_0x1598c2,{'showHidden':![],'depth':null}));if(this[_0x6489('0x3c')][_0x1598c2['uniqueid']]){var _0x58970d=_[_0x6489('0x7b')](this[_0x6489('0x3c')][_0x1598c2['uniqueid']]);_0x58970d[_0x6489('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x58970d[_0x6489('0x89')]=_0x1598c2['connectedlinenum'];_0x58970d['connectedlinename']=_0x1598c2[_0x6489('0x8a')];logger[_0x6489('0x8b')](_0x6489('0x8c'),_0x58970d[_0x6489('0x4a')],_0x58970d[_0x6489('0x53')],_0x1598c2[_0x6489('0x89')],_0x1598c2[_0x6489('0x8a')]);this[_0x6489('0xf')][_0x1598c2[_0x6489('0x4f')]]=_0x58970d;this[_0x6489('0x45')](_0x58970d,_0x6489('0x1b'));}}}catch(_0x297913){logger[_0x6489('0x3d')](_0x6489('0x87'),_0x1598c2['uniqueid'],util[_0x6489('0x3b')](_0x297913,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6489('0x9')]['syncAgentConnect']=function(_0x197a51){try{if(this[_0x6489('0x65')](_0x197a51)){logger[_0x6489('0x46')](_0x6489('0x8d'),_0x197a51['uniqueid'],util['inspect'](_0x197a51,{'showHidden':![],'depth':null}));if(this[_0x6489('0x3c')][_0x197a51[_0x6489('0x4f')]]){var _0x9de05c=_[_0x6489('0x7b')](this[_0x6489('0x3c')][_0x197a51[_0x6489('0x4f')]]);_0x9de05c[_0x6489('0x7c')]=!![];_0x9de05c[_0x6489('0x82')]=_0x6489('0x8e');logger['info'](_0x6489('0x8f'),_0x9de05c[_0x6489('0x4a')],_0x9de05c['type']);}}}catch(_0x1d8bb3){logger[_0x6489('0x3d')](_0x6489('0x8d'),_0x197a51[_0x6489('0x4f')],util['inspect'](_0x1d8bb3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6489('0x1d')]=function(_0x4c0ecf){try{if(this[_0x6489('0x65')](_0x4c0ecf)){logger[_0x6489('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x4c0ecf[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x4c0ecf,{'showHidden':![],'depth':null}));if(this[_0x6489('0x3c')][_0x4c0ecf['uniqueid']]){var _0xf81046=_['last'](this[_0x6489('0x3c')][_0x4c0ecf['uniqueid']]);_0xf81046[_0x6489('0x80')]=![];_0xf81046[_0x6489('0x90')]=null;_0xf81046[_0x6489('0x91')]=!![];_0xf81046[_0x6489('0x92')]=_0x4c0ecf['membername'];_0xf81046['holdtime']=_0x4c0ecf['holdtime'];_0xf81046['queuecallercomplete']=!![];_0xf81046[_0x6489('0x93')]=![];_0xf81046['queuecallerexitAt']=null;if(!_0xf81046[_0x6489('0x94')]){if(_0x4c0ecf['reason']==_0x6489('0x94')){_0xf81046[_0x6489('0x82')]='COMPLETED';logger[_0x6489('0x8b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xf81046[_0x6489('0x4a')],_0xf81046[_0x6489('0x53')]);}else{if(_[_0x6489('0x95')](_0x4c0ecf['channel'][_0x6489('0x96')](),_0x6489('0x97'))){if(this[_0x6489('0x3c')][_0x4c0ecf[_0x6489('0x98')]]){var _0x4f2357=_[_0x6489('0x7b')](this['queueReports'][_0x4c0ecf[_0x6489('0x98')]]);_0x4f2357[_0x6489('0x7c')]=![];_0x4f2357[_0x6489('0x93')]=!![];_0x4f2357[_0x6489('0x99')]=moment(_0xf81046[_0x6489('0x9a')])['add'](_0x4c0ecf['holdtime'],'seconds')['format'](_0x6489('0x81'));_0x4f2357[_0x6489('0x82')]=_0x6489('0x9b');_0x4f2357[_0x6489('0x94')]=!![];_0x4f2357['transfertype']=_0x6489('0x9c');_0x4f2357[_0x6489('0x9d')]=_0x4c0ecf[_0x6489('0x9e')];_0x4f2357[_0x6489('0x9f')]=_0x4c0ecf[_0x6489('0x4f')];logger[_0x6489('0x8b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4f2357[_0x6489('0x4a')],_0x4f2357[_0x6489('0x53')]);var _0x4bfdb8=this[_0x6489('0x3c')][_0x4c0ecf['linkedid']];this[_0x6489('0x3c')][_0x4c0ecf[_0x6489('0x98')]]=this['queueReports'][_0x4c0ecf[_0x6489('0x4f')]];this[_0x6489('0x3c')][_0x4c0ecf[_0x6489('0x4f')]]=_0x4bfdb8;}}else{_0xf81046[_0x6489('0x82')]=_0x6489('0xa0')+_0x4c0ecf[_0x6489('0xa1')][_0x6489('0xa2')]();logger[_0x6489('0x8b')](_0x6489('0xa3'),_0xf81046[_0x6489('0x4a')],_0xf81046[_0x6489('0x53')],_0xf81046['queuecallerexitreason']);}}}this['channels'][_0x4c0ecf[_0x6489('0x4f')]]=_0xf81046;this[_0x6489('0x42')](_0xf81046,_0x6489('0x1c'));}}}catch(_0x5ed502){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x4c0ecf[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x5ed502,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6489('0x9')][_0x6489('0x21')]=function(_0x5a3303){try{if(this[_0x6489('0x65')](_0x5a3303)){logger['debug'](_0x6489('0xa4'),_0x5a3303[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x5a3303,{'showHidden':![],'depth':null}));this[_0x6489('0xa5')](_0x5a3303[_0x6489('0x4f')],_[_0x6489('0x79')](_0x5a3303[_0x6489('0xa6')])[0x0],_0x5a3303[_0x6489('0xa7')]);if(this[_0x6489('0x3c')][_0x5a3303[_0x6489('0x4f')]]){var _0x570ca4=_[_0x6489('0x7b')](this[_0x6489('0x3c')][_0x5a3303[_0x6489('0x4f')]]);if(_0x570ca4){if(this[_0x6489('0x65')](_0x5a3303[_0x6489('0xa6')])&&this[_0x6489('0x65')](_0x5a3303[_0x6489('0xa6')]['queuestatus'])){switch(_0x5a3303[_0x6489('0xa7')]){case _0x6489('0xa8'):_0x570ca4[_0x6489('0x93')]=![];_0x570ca4[_0x6489('0x99')]=null;break;case _0x6489('0xa9'):_0x570ca4[_0x6489('0xaa')]=_0x6489('0xab');_0x570ca4[_0x6489('0x93')]=!![];_0x570ca4[_0x6489('0x99')]=moment()[_0x6489('0x48')](_0x6489('0x81'));_0x570ca4[_0x6489('0x88')]=moment()[_0x6489('0x48')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6489('0x46')](_0x6489('0xac'),_0x5a3303[_0x6489('0x4f')],util['inspect'](_0x570ca4,{'showHidden':![],'depth':null}));ami[_0x6489('0x44')](_0x6489('0xad'),_0x570ca4);break;default:_0x570ca4[_0x6489('0x93')]=!![];_0x570ca4[_0x6489('0x99')]=moment()[_0x6489('0x48')](_0x6489('0x81'));_0x570ca4[_0x6489('0x88')]=moment()[_0x6489('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}_0x570ca4[_0x6489('0x80')]=![];_0x570ca4[_0x6489('0x90')]=null;_0x570ca4[_0x6489('0x82')]=_0x5a3303[_0x6489('0xa7')];this['channels'][_0x5a3303[_0x6489('0x4f')]]=_0x570ca4;this['emitVoiceQueueChannelRemove'](_0x570ca4,'varset');}else if(this[_0x6489('0x65')](_0x5a3303[_0x6489('0xa6')])&&this[_0x6489('0x65')](_0x5a3303[_0x6489('0xa6')][_0x6489('0xae')])){if(!_0x570ca4[_0x6489('0x80')]){_0x570ca4[_0x6489('0x93')]=!![];_0x570ca4[_0x6489('0x99')]=moment()[_0x6489('0x48')](_0x6489('0x81'));_0x570ca4['queuecallerexitreason']=_0x6489('0xaf');_0x570ca4[_0x6489('0x88')]=moment()['format'](_0x6489('0x81'));this[_0x6489('0xf')][_0x5a3303[_0x6489('0x4f')]]=_0x570ca4;}}logger[_0x6489('0x8b')](_0x6489('0xb0'),_0x5a3303['uniqueid'],_0x570ca4['name'],_0x570ca4[_0x6489('0x53')],_[_0x6489('0x79')](_0x5a3303[_0x6489('0xa6')])[0x0],_0x5a3303[_0x6489('0xa7')]);_0x570ca4[_0x6489('0x14')]=this[_0x6489('0x14')][_0x5a3303['uniqueid']];}}}}catch(_0x7fcf20){logger[_0x6489('0x3d')](_0x6489('0xa4'),_0x5a3303[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x7fcf20,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6489('0x9')][_0x6489('0xa5')]=function(_0x87a889,_0x13d699,_0xd15f1f){var _0x1a3075=['rtpaudioqos',_0x6489('0xb1'),_0x6489('0xb2'),_0x6489('0xb3'),'rtpaudioqosloss',_0x6489('0xb4'),_0x6489('0xb5'),'rtpaudioqosrttbridged',_0x6489('0xb6'),_0x6489('0xb7'),_0x6489('0xb8'),_0x6489('0xb9'),_0x6489('0xba'),_0x6489('0xbb'),_0x6489('0xbc'),_0x6489('0xbd'),_0x6489('0xbe'),'memberpenalty','memberrealtime'];if(!_[_0x6489('0x34')](_0x13d699)&&!_['includes'](_0x1a3075,_0x13d699)){if(_[_0x6489('0x72')](this[_0x6489('0x14')][_0x87a889])){this[_0x6489('0x14')][_0x87a889]={};}this[_0x6489('0x14')][_0x87a889][_0x13d699]=_0xd15f1f;}};VoiceQueueReport[_0x6489('0x9')]['syncHangup']=function(_0x5c2ccf){try{if(this[_0x6489('0x65')](_0x5c2ccf)){logger[_0x6489('0x46')]('[%s][voiceQueueReport][hangup]',_0x5c2ccf[_0x6489('0x4f')],util[_0x6489('0x3b')](_0x5c2ccf,{'showHidden':![],'depth':null}));if(this[_0x6489('0x3c')][_0x5c2ccf[_0x6489('0x4f')]]){for(var _0x5aa8b5=0x0,_0x188d55={};_0x5aa8b5=0x0?moment(_0xe0d423[_0x9a17('0x14')])['diff'](_0xe0d423[_0x9a17('0x15')],'seconds'):null,'data1':_0x9a17('0x16'),'data2':_0xe0d423[_0x9a17('0x10')],'data3':_0xe0d423['exten'],'data4':_0xe0d423['dialstring']||null,'role':_0x9a17('0x17'),'internal':_0xe0d423[_0x9a17('0x10')]?_[_0x9a17('0x18')](_0xe0d423[_0x9a17('0x10')]):undefined,'uniqueid':_0xe0d423[_0x9a17('0x11')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x6b1e=['toNumber','uniqueid','voiceDialReport','Request','membername','TALKING','endtime','starttime','seconds','outbound','dialstring','agent','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','accountcode'];(function(_0x4de622,_0x16bf7c){var _0x2b238a=function(_0x2ac5e2){while(--_0x2ac5e2){_0x4de622['push'](_0x4de622['shift']());}};_0x2b238a(++_0x16bf7c);}(_0x6b1e,0x142));var _0xe6b1=function(_0x22e1c4,_0x410e2a){_0x22e1c4=_0x22e1c4-0x0;var _0x5d70d5=_0x6b1e[_0x22e1c4];return _0x5d70d5;};'use strict';var moment=require('moment');var _=require(_0xe6b1('0x0'));var util=require(_0xe6b1('0x1'));var client=require(_0xe6b1('0x2'));exports[_0xe6b1('0x3')]=function(_0xdf45e0){var _0x39c2c6=_0xdf45e0[_0xe6b1('0x4')]||_0xdf45e0[_0xe6b1('0x5')];return client['Request'](_0xe6b1('0x6'),{'body':{'channel':_0xe6b1('0x7'),'membername':_0xdf45e0[_0xe6b1('0x8')],'interface':_[_0xe6b1('0x9')](_0xdf45e0[_0xe6b1('0xa')])?util['format'](_0xe6b1('0xb'),_0xdf45e0['lastAssignedTo']):_0xdf45e0[_0xe6b1('0xa')],'type':'TALKING','enterAt':_0xdf45e0[_0xe6b1('0xc')],'exitAt':_0x39c2c6,'duration':moment(_0x39c2c6)[_0xe6b1('0xd')](_0xdf45e0[_0xe6b1('0xc')],'seconds'),'data1':_0xe6b1('0xe'),'data2':_0xdf45e0[_0xe6b1('0xf')],'data3':_0xdf45e0[_0xe6b1('0x10')],'data4':null,'data5':_0xdf45e0[_0xe6b1('0x11')],'role':'agent','internal':_0xdf45e0[_0xe6b1('0x12')]?_[_0xe6b1('0x13')](_0xdf45e0[_0xe6b1('0x12')]):undefined,'uniqueid':_0xdf45e0[_0xe6b1('0x14')]},'log':_0xe6b1('0x6')});};exports[_0xe6b1('0x15')]=function(_0x59bf48){return client[_0xe6b1('0x16')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x59bf48[_0xe6b1('0x17')],'interface':_0x59bf48[_0xe6b1('0xa')],'type':_0xe6b1('0x18'),'enterAt':_0x59bf48['starttime'],'exitAt':_0x59bf48[_0xe6b1('0x19')],'duration':moment(_0x59bf48[_0xe6b1('0x19')])[_0xe6b1('0xd')](_0x59bf48[_0xe6b1('0x1a')],'seconds')>=0x0?moment(_0x59bf48[_0xe6b1('0x19')])[_0xe6b1('0xd')](_0x59bf48[_0xe6b1('0x1a')],_0xe6b1('0x1b')):null,'data1':_0xe6b1('0x1c'),'data2':_0x59bf48[_0xe6b1('0x12')],'data3':_0x59bf48['exten'],'data4':_0x59bf48[_0xe6b1('0x1d')]||null,'role':_0xe6b1('0x1e'),'internal':_0x59bf48['accountcode']?_[_0xe6b1('0x13')](_0x59bf48[_0xe6b1('0x12')]):undefined,'uniqueid':_0x59bf48['uniqueid']},'log':_0xe6b1('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c7ec163..e4d370c 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 _0x6505=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x222e2d,_0x4cff0c){var _0x3dbbac=function(_0x13ccbb){while(--_0x13ccbb){_0x222e2d['push'](_0x222e2d['shift']());}};_0x3dbbac(++_0x4cff0c);}(_0x6505,0x8c));var _0x5650=function(_0x3ef527,_0x497b1d){_0x3ef527=_0x3ef527-0x0;var _0xbf2e75=_0x6505[_0x3ef527];return _0xbf2e75;};'use strict';var client=require(_0x5650('0x0'));exports[_0x5650('0x1')]=function(){return client[_0x5650('0x2')](_0x5650('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5650('0x4')]},'log':_0x5650('0x5')});}; \ No newline at end of file +var _0x4242=['ShowSetting','../client','getSettings','Request'];(function(_0x2f1398,_0x221512){var _0x78069=function(_0x49bff2){while(--_0x49bff2){_0x2f1398['push'](_0x2f1398['shift']());}};_0x78069(++_0x221512);}(_0x4242,0xb5));var _0x2424=function(_0x2e8b20,_0x222475){_0x2e8b20=_0x2e8b20-0x0;var _0x5a8fb9=_0x4242[_0x2e8b20];return _0x5a8fb9;};'use strict';var client=require(_0x2424('0x0'));exports[_0x2424('0x1')]=function(){return client[_0x2424('0x2')](_0x2424('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6105062..46713fb 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 _0x3b99=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x3b99,0x161));var _0x93b9=function(_0x3a9ae8,_0x6fab6e){_0x3a9ae8=_0x3a9ae8-0x0;var _0x1ac58c=_0x3b99[_0x3a9ae8];return _0x1ac58c;};'use strict';var client=require(_0x93b9('0x0'));exports[_0x93b9('0x1')]=function(_0x33c48c){return function(_0x3751fe){return client[_0x93b9('0x2')](_0x93b9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x93b9('0x4'),_0x93b9('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x4c50=['name','../client','getTemplates','Request','GetTemplate'];(function(_0x7f677f,_0x5f2c1c){var _0x5acea1=function(_0x21e95e){while(--_0x21e95e){_0x7f677f['push'](_0x7f677f['shift']());}};_0x5acea1(++_0x5f2c1c);}(_0x4c50,0x10f));var _0x04c5=function(_0x4ec6a8,_0x549d09){_0x4ec6a8=_0x4ec6a8-0x0;var _0x1f0cff=_0x4c50[_0x4ec6a8];return _0x1f0cff;};'use strict';var client=require(_0x04c5('0x0'));exports[_0x04c5('0x1')]=function(_0x3bd505){return function(_0x3d467f){return client[_0x04c5('0x2')](_0x04c5('0x3'),{'options':{'raw':!![],'attributes':['id',_0x04c5('0x4'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index cca4936..0727ad4 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 _0x606f=['../client','getTriggers','GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data6','data7'];(function(_0x26185e,_0xa003bd){var _0x4d925b=function(_0x3d5f4f){while(--_0x3d5f4f){_0x26185e['push'](_0x26185e['shift']());}};_0x4d925b(++_0xa003bd);}(_0x606f,0x1b5));var _0xf606=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x606f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf606('0x0'));exports[_0xf606('0x1')]=function(_0xf6b2af){return function(_0x5baadb){return client['Request'](_0xf606('0x2'),{'options':{'raw':![],'attributes':['id',_0xf606('0x3'),_0xf606('0x4'),'status'],'include':[{'model':_0xf606('0x5'),'as':_0xf606('0x6'),'attributes':['id','field',_0xf606('0x7'),_0xf606('0x8')]},{'model':_0xf606('0x5'),'as':_0xf606('0x9'),'attributes':['id',_0xf606('0xa'),_0xf606('0x7'),_0xf606('0x8')]},{'model':_0xf606('0xb'),'as':_0xf606('0xc'),'attributes':['id',_0xf606('0xd'),_0xf606('0xe'),_0xf606('0xf'),_0xf606('0x10'),'data4','data5',_0xf606('0x11'),_0xf606('0x12')]}]},'log':_0xf606('0x2')});};}; \ No newline at end of file +var _0x5755=['action','data1','data4','data5','data7','getTriggers','Request','GetTrigger','name','status','Condition','field','value','AnyConditions','Action','Actions'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5755,0xc5));var _0x5575=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x5755[_0x4fc421];return _0x8c6d63;};'use strict';var client=require('../client');exports[_0x5575('0x0')]=function(_0x3a1079){return function(_0x2eb79d){return client[_0x5575('0x1')](_0x5575('0x2'),{'options':{'raw':![],'attributes':['id',_0x5575('0x3'),'channel',_0x5575('0x4')],'include':[{'model':_0x5575('0x5'),'as':'AllConditions','attributes':['id',_0x5575('0x6'),'operator',_0x5575('0x7')]},{'model':_0x5575('0x5'),'as':_0x5575('0x8'),'attributes':['id',_0x5575('0x6'),'operator',_0x5575('0x7')]},{'model':_0x5575('0x9'),'as':_0x5575('0xa'),'attributes':['id',_0x5575('0xb'),_0x5575('0xc'),'data2','data3',_0x5575('0xd'),_0x5575('0xe'),'data6',_0x5575('0xf')]}]},'log':_0x5575('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 8813021..b33fbdb 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 _0x23bb=['GetTrunk','../client','getTrunks','Request','name','defaultuser'];(function(_0x39c5fd,_0x375e45){var _0x420c3f=function(_0x4823f4){while(--_0x4823f4){_0x39c5fd['push'](_0x39c5fd['shift']());}};_0x420c3f(++_0x375e45);}(_0x23bb,0xc1));var _0xb23b=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x23bb[_0x120123];return _0x3bec4c;};'use strict';var client=require(_0xb23b('0x0'));exports[_0xb23b('0x1')]=function(_0x2f2f1a){return function(_0x385a98){return client[_0xb23b('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb23b('0x3'),'registry',_0xb23b('0x4')]},'log':_0xb23b('0x5')});};}; \ No newline at end of file +var _0xea20=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x49512b,_0x4ce9e9){var _0x1bbbc7=function(_0x13afcc){while(--_0x13afcc){_0x49512b['push'](_0x49512b['shift']());}};_0x1bbbc7(++_0x4ce9e9);}(_0xea20,0x198));var _0x0ea2=function(_0x12519b,_0xc172bf){_0x12519b=_0x12519b-0x0;var _0xbf1e98=_0xea20[_0x12519b];return _0xbf1e98;};'use strict';var client=require(_0x0ea2('0x0'));exports[_0x0ea2('0x1')]=function(_0xb94431){return function(_0xd8a823){return client[_0x0ea2('0x2')](_0x0ea2('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0ea2('0x4'),_0x0ea2('0x5'),_0x0ea2('0x6')]},'log':_0x0ea2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d1a3243..3f3e321 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x2865fd,_0x495e9d){var _0x34e2a1=function(_0x5cbca8){while(--_0x5cbca8){_0x2865fd['push'](_0x2865fd['shift']());}};_0x34e2a1(++_0x495e9d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xcb91[_0x28f1de];return _0x5b5dad;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6d0a247..d6527a2 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 _0xb030=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x2e8349,_0x84c5ac){var _0x9c2cd5=function(_0x11e01f){while(--_0x11e01f){_0x2e8349['push'](_0x2e8349['shift']());}};_0x9c2cd5(++_0x84c5ac);}(_0xb030,0x84));var _0x0b03=function(_0x56dd58,_0xb1287d){_0x56dd58=_0x56dd58-0x0;var _0x103e75=_0xb030[_0x56dd58];return _0x103e75;};'use strict';var client=require(_0x0b03('0x0'));exports[_0x0b03('0x1')]=function(_0x5b6a76){return client[_0x0b03('0x2')]('CreateVoiceAgentReport',{'body':_0x5b6a76,'log':_0x0b03('0x3')});};exports['update']=function(_0x59a0d8,_0x425364,_0x7d7797){return client[_0x0b03('0x2')](_0x0b03('0x4'),{'body':_0x59a0d8,'options':{'where':{'uniqueid':_0x425364,'interface':_0x7d7797,'agentcomplete':!![]}},'log':_0x0b03('0x4')});}; \ No newline at end of file +var _0xce13=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x4855ce,_0x3fbf65){var _0x150377=function(_0x21555b){while(--_0x21555b){_0x4855ce['push'](_0x4855ce['shift']());}};_0x150377(++_0x3fbf65);}(_0xce13,0x180));var _0x3ce1=function(_0x3531e0,_0x336cc1){_0x3531e0=_0x3531e0-0x0;var _0x3757f0=_0xce13[_0x3531e0];return _0x3757f0;};'use strict';var client=require(_0x3ce1('0x0'));exports['create']=function(_0x18bf27){return client['Request'](_0x3ce1('0x1'),{'body':_0x18bf27,'log':_0x3ce1('0x1')});};exports[_0x3ce1('0x2')]=function(_0x1cf9c5,_0x2e8033,_0x5d0b4c){return client[_0x3ce1('0x3')](_0x3ce1('0x4'),{'body':_0x1cf9c5,'options':{'where':{'uniqueid':_0x2e8033,'interface':_0x5d0b4c,'agentcomplete':!![]}},'log':_0x3ce1('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 7e00e11..2b02ea3 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 _0x1690=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x1690,0xc0));var _0x0169=function(_0x32b63b,_0x109f65){_0x32b63b=_0x32b63b-0x0;var _0x1bbfca=_0x1690[_0x32b63b];return _0x1bbfca;};'use strict';var moment=require(_0x0169('0x0'));var util=require(_0x0169('0x1'));var _=require(_0x0169('0x2'));var client=require(_0x0169('0x3'));exports[_0x0169('0x4')]=function(_0x3cb393){return client['Request'](_0x0169('0x5'),{'body':_[_0x0169('0x6')](_0x3cb393,{'source':_0x3cb393[_0x0169('0x7')],'destinationcontext':_0x3cb393[_0x0169('0x8')],'callerid':_0x3cb393['callerid'],'amaflags':_0x0169('0x9')}),'log':_0x0169('0x5')});};exports[_0x0169('0xa')]=function(){return function(){return client[_0x0169('0xb')](_0x0169('0xc'),{'options':{'where':{'type':[_0x0169('0xd')],'createdAt':{'$between':[moment()[_0x0169('0xe')]('day')[_0x0169('0xf')](_0x0169('0x10')),moment()[_0x0169('0x11')](_0x0169('0x12'))[_0x0169('0xf')](_0x0169('0x10'))]}},'attributes':[_0x0169('0x13'),'disposition',_0x0169('0x14'),_0x0169('0x15')]},'log':_0x0169('0x16')});};}; \ No newline at end of file +var _0xcb19=['day','type','disposition','duration','billableseconds','moment','lodash','../client','create','Request','merge','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','format','endOf'];(function(_0x5be9a6,_0x1df31c){var _0x5dd8e1=function(_0x6ccb99){while(--_0x6ccb99){_0x5be9a6['push'](_0x5be9a6['shift']());}};_0x5dd8e1(++_0x1df31c);}(_0xcb19,0x16d));var _0x9cb1=function(_0x3009b5,_0x263f69){_0x3009b5=_0x3009b5-0x0;var _0x478465=_0xcb19[_0x3009b5];return _0x478465;};'use strict';var moment=require(_0x9cb1('0x0'));var util=require('util');var _=require(_0x9cb1('0x1'));var client=require(_0x9cb1('0x2'));exports[_0x9cb1('0x3')]=function(_0x2f5be3){return client[_0x9cb1('0x4')]('CreateVoiceCallReport',{'body':_[_0x9cb1('0x5')](_0x2f5be3,{'source':_0x2f5be3[_0x9cb1('0x6')],'destinationcontext':_0x2f5be3['context'],'callerid':_0x2f5be3[_0x9cb1('0x7')],'amaflags':_0x9cb1('0x8')}),'log':_0x9cb1('0x9')});};exports[_0x9cb1('0xa')]=function(){return function(){return client['Request'](_0x9cb1('0xb'),{'options':{'where':{'type':[_0x9cb1('0xc')],'createdAt':{'$between':[moment()['startOf']('day')[_0x9cb1('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9cb1('0xe')](_0x9cb1('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x9cb1('0x10'),_0x9cb1('0x11'),_0x9cb1('0x12'),_0x9cb1('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ceb656c..4365a6e 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 _0xf55b=['../client','create','Request','CreateVoiceDialReport'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xf55b,0xb8));var _0xbf55=function(_0x4c2620,_0x27992c){_0x4c2620=_0x4c2620-0x0;var _0x23afc6=_0xf55b[_0x4c2620];return _0x23afc6;};'use strict';var client=require(_0xbf55('0x0'));exports[_0xbf55('0x1')]=function(_0x2b109b){return client[_0xbf55('0x2')]('CreateVoiceDialReport',{'body':_0x2b109b,'log':_0xbf55('0x3')});}; \ No newline at end of file +var _0x0336=['create','Request','CreateVoiceDialReport'];(function(_0x4d7010,_0x3f179e){var _0x35e5dd=function(_0x34fb82){while(--_0x34fb82){_0x4d7010['push'](_0x4d7010['shift']());}};_0x35e5dd(++_0x3f179e);}(_0x0336,0x1e9));var _0x6033=function(_0x3e7057,_0x501c2a){_0x3e7057=_0x3e7057-0x0;var _0x4bbf00=_0x0336[_0x3e7057];return _0x4bbf00;};'use strict';var client=require('../client');exports[_0x6033('0x0')]=function(_0x3c78c4){return client[_0x6033('0x1')](_0x6033('0x2'),{'body':_0x3c78c4,'log':_0x6033('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 0ae4ced..9684945 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 _0xb84e=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x30e7c1,_0x5d63b8){var _0x18b293=function(_0x2d7469){while(--_0x2d7469){_0x30e7c1['push'](_0x30e7c1['shift']());}};_0x18b293(++_0x5d63b8);}(_0xb84e,0xbf));var _0xeb84=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb84e[_0x3b0731];return _0x4204d7;};'use strict';var client=require('../client');exports[_0xeb84('0x0')]=function(){return function(){return client[_0xeb84('0x1')](_0xeb84('0x2'),{'options':{'raw':!![],'attributes':['id',_0xeb84('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x2333=['exten','recordingFormat','../client','getVoiceExtensions'];(function(_0xb83515,_0x15f73b){var _0x57dc1f=function(_0x55b921){while(--_0x55b921){_0xb83515['push'](_0xb83515['shift']());}};_0x57dc1f(++_0x15f73b);}(_0x2333,0x11a));var _0x3233=function(_0x330e9e,_0x4c9552){_0x330e9e=_0x330e9e-0x0;var _0x49426b=_0x2333[_0x330e9e];return _0x49426b;};'use strict';var client=require(_0x3233('0x0'));exports[_0x3233('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x3233('0x2'),_0x3233('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4885631..eda924c 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 _0x04cc=['dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x04cc,0x11a));var _0xc04c=function(_0x1181f3,_0xf81baa){_0x1181f3=_0x1181f3-0x0;var _0x37abb6=_0x04cc[_0x1181f3];return _0x37abb6;};'use strict';var client=require(_0xc04c('0x0'));exports[_0xc04c('0x1')]=function(){return function(){return client[_0xc04c('0x2')](_0xc04c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc04c('0x4'),'acwTimeout','autopause',_0xc04c('0x5'),_0xc04c('0x6'),_0xc04c('0x7'),_0xc04c('0x8'),_0xc04c('0x9'),_0xc04c('0xa'),_0xc04c('0xb'),'dialPredictiveOptimization',_0xc04c('0xc'),_0xc04c('0xd'),_0xc04c('0xe'),_0xc04c('0xf'),_0xc04c('0x10'),_0xc04c('0x11'),_0xc04c('0x12'),_0xc04c('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xc04c('0x14'),_0xc04c('0x15'),_0xc04c('0x16'),_0xc04c('0x17'),_0xc04c('0x18'),_0xc04c('0x19'),_0xc04c('0x1a'),'dialPrefix','dialCheckDuplicateType',_0xc04c('0x1b'),'dialAMDInitialSilence',_0xc04c('0x1c'),_0xc04c('0x1d'),_0xc04c('0x1e'),_0xc04c('0x1f'),'dialAMDBetweenWordsSilence',_0xc04c('0x20'),_0xc04c('0x21'),_0xc04c('0x22'),_0xc04c('0x23'),'dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt',_0xc04c('0x24'),_0xc04c('0x25'),'dialQueueProject2',_0xc04c('0x5'),'strategy',_0xc04c('0x26'),_0xc04c('0x27'),'dialNoSuchNumberMaxRetry',_0xc04c('0x28'),_0xc04c('0x29'),_0xc04c('0x2a'),_0xc04c('0x2b'),_0xc04c('0x2c'),_0xc04c('0x2d'),_0xc04c('0x2e'),_0xc04c('0x2f'),_0xc04c('0x30'),_0xc04c('0x31'),_0xc04c('0x32'),'dialPredictiveIntervalMinThreshold',_0xc04c('0x33')],'include':[{'model':_0xc04c('0x34'),'as':_0xc04c('0x34'),'attributes':['id',_0xc04c('0x35'),_0xc04c('0x36'),_0xc04c('0x37')]},{'model':_0xc04c('0x38'),'as':_0xc04c('0x39'),'attributes':['id',_0xc04c('0x35')]},{'model':_0xc04c('0x34'),'as':'TrunkBackup','attributes':['id',_0xc04c('0x35'),'callerid',_0xc04c('0x37')]},{'model':_0xc04c('0x3a'),'as':_0xc04c('0x3a'),'attributes':['id',_0xc04c('0x35')],'include':[{'model':_0xc04c('0x3a'),'as':'Intervals','attributes':['id',_0xc04c('0x35'),_0xc04c('0x3b')]}]}]},'log':_0xc04c('0x1')});};}; \ No newline at end of file +var _0x649f=['dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','name','TrunkBackup','active','Interval','interval','../client','getVoiceQueues','Request','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x649f,0x93));var _0xf649=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x649f[_0x39e283];return _0x7de89f;};'use strict';var client=require(_0xf649('0x0'));exports[_0xf649('0x1')]=function(){return function(){return client[_0xf649('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0xf649('0x3'),'acwTimeout',_0xf649('0x4'),_0xf649('0x5'),_0xf649('0x6'),_0xf649('0x7'),_0xf649('0x8'),_0xf649('0x9'),_0xf649('0xa'),_0xf649('0xb'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xf649('0xc'),_0xf649('0xd'),_0xf649('0xe'),'dialOriginateTimeout',_0xf649('0xf'),_0xf649('0x10'),_0xf649('0x11'),_0xf649('0x12'),'dialCongestionRetryFrequency',_0xf649('0x13'),_0xf649('0x14'),_0xf649('0x15'),_0xf649('0x16'),_0xf649('0x17'),_0xf649('0x18'),'dialGlobalInterval',_0xf649('0x19'),'dialCheckDuplicateType','dialAMDActive',_0xf649('0x1a'),_0xf649('0x1b'),_0xf649('0x1c'),_0xf649('0x1d'),_0xf649('0x1e'),_0xf649('0x1f'),_0xf649('0x20'),_0xf649('0x21'),'dialAMDMaximumWordLength',_0xf649('0x22'),_0xf649('0x23'),'dialRecallInQueue',_0xf649('0x24'),_0xf649('0x25'),_0xf649('0x26'),'dialQueueProject2','monitor_format',_0xf649('0x27'),_0xf649('0x28'),_0xf649('0x29'),_0xf649('0x2a'),_0xf649('0x2b'),_0xf649('0x2c'),_0xf649('0x2d'),_0xf649('0x2e'),_0xf649('0x2f'),_0xf649('0x30'),_0xf649('0x31'),_0xf649('0x32'),_0xf649('0x33'),_0xf649('0x34'),_0xf649('0x35'),_0xf649('0x36'),_0xf649('0x37')],'include':[{'model':_0xf649('0x38'),'as':_0xf649('0x38'),'attributes':['id','name',_0xf649('0x39'),'active']},{'model':_0xf649('0x3a'),'as':_0xf649('0x3b'),'attributes':['id',_0xf649('0x3c')]},{'model':_0xf649('0x38'),'as':_0xf649('0x3d'),'attributes':['id',_0xf649('0x3c'),_0xf649('0x39'),_0xf649('0x3e')]},{'model':_0xf649('0x3f'),'as':_0xf649('0x3f'),'attributes':['id','name'],'include':[{'model':_0xf649('0x3f'),'as':'Intervals','attributes':['id','name',_0xf649('0x40')]}]}]},'log':_0xf649('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 12a9aea..2822b3a 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(_0x18dffd,_0x47963c){var _0x23f419=function(_0x3702ef){while(--_0x3702ef){_0x18dffd['push'](_0x18dffd['shift']());}};_0x23f419(++_0x47963c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x3a5b81,_0x504c2d){var _0xb6cbc3=function(_0x53ffab){while(--_0x53ffab){_0x3a5b81['push'](_0x3a5b81['shift']());}};_0xb6cbc3(++_0x504c2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 e3e41d4..63f52fe 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 _0x8f91=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0xfde968,_0x3f9dfc){var _0x4038bd=function(_0x3fac38){while(--_0x3fac38){_0xfde968['push'](_0xfde968['shift']());}};_0x4038bd(++_0x3f9dfc);}(_0x8f91,0x1e8));var _0x18f9=function(_0x31c638,_0x189036){_0x31c638=_0x31c638-0x0;var _0x50a81e=_0x8f91[_0x31c638];return _0x50a81e;};'use strict';var client=require(_0x18f9('0x0'));exports[_0x18f9('0x1')]=function(_0x1165ce){return function(){return client['Request'](_0x18f9('0x2'),{'options':{'where':{'VoiceQueueId':_0x1165ce,'paused':!![]},'raw':!![]},'log':_0x18f9('0x1')});};}; \ No newline at end of file +var _0x3970=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x1b3eda,_0x4084a2){var _0x48812c=function(_0x137792){while(--_0x137792){_0x1b3eda['push'](_0x1b3eda['shift']());}};_0x48812c(++_0x4084a2);}(_0x3970,0x163));var _0x0397=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x3970[_0xb833b1];return _0x1ab87a;};'use strict';var client=require(_0x0397('0x0'));exports['getVoiceQueueRtPauses']=function(_0x28aa85){return function(){return client[_0x0397('0x1')](_0x0397('0x2'),{'options':{'where':{'VoiceQueueId':_0x28aa85,'paused':!![]},'raw':!![]},'log':_0x0397('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 53a7936..2340d5c 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2c1b31,_0x43dacf){var _0x425fed=function(_0x7dcf0c){while(--_0x7dcf0c){_0x2c1b31['push'](_0x2c1b31['shift']());}};_0x425fed(++_0x43dacf);}(_0x7a54,0x106));var _0x47a5=function(_0x2fea1d,_0x3bb886){_0x2fea1d=_0x2fea1d-0x0;var _0x3b0f4b=_0x7a54[_0x2fea1d];return _0x3b0f4b;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3fae12,_0x521ec0){var _0x1298f4=function(_0x6bc01e){while(--_0x6bc01e){_0x3fae12['push'](_0x3fae12['shift']());}};_0x1298f4(++_0x521ec0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 925c31b..87bd1ad 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 _0xe07b=['transfereeexten','transfereelinkedid','context','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode'];(function(_0xd2e00c,_0x218b36){var _0x5e7688=function(_0x29b51a){while(--_0x29b51a){_0xd2e00c['push'](_0xd2e00c['shift']());}};_0x5e7688(++_0x218b36);}(_0xe07b,0x164));var _0xbe07=function(_0x29dadd,_0x26b6e0){_0x29dadd=_0x29dadd-0x0;var _0x12e802=_0xe07b[_0x29dadd];return _0x12e802;};'use strict';var client=require('../client');exports[_0xbe07('0x0')]={};exports[_0xbe07('0x1')]=function(_0x4b759d){return client[_0xbe07('0x2')](_0xbe07('0x3'),{'body':{'result':_0x4b759d['result'],'transfererchannel':_0x4b759d[_0xbe07('0x4')],'transferercalleridnum':_0x4b759d[_0xbe07('0x5')],'transferercalleridname':_0x4b759d[_0xbe07('0x6')],'transfererconnectedlinenum':_0x4b759d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4b759d['transfererconnectedlinename'],'transfereraccountcode':_0x4b759d['transfereraccountcode'],'transferercontext':_0x4b759d[_0xbe07('0x7')],'transfererexten':_0x4b759d[_0xbe07('0x8')],'transfererlinkedid':_0x4b759d[_0xbe07('0x9')],'transfereechannel':_0x4b759d['transfereechannel'],'transfereecalleridnum':_0x4b759d[_0xbe07('0xa')],'transfereecalleridname':_0x4b759d['transfereecalleridname'],'transfereeconnectedlinenum':_0x4b759d[_0xbe07('0xb')],'transfereeconnectedlinename':_0x4b759d[_0xbe07('0xc')],'transfereeaccountcode':_0x4b759d[_0xbe07('0xd')],'transfereecontext':_0x4b759d['transfereecontext'],'transfereeexten':_0x4b759d[_0xbe07('0xe')],'transfereelinkedid':_0x4b759d[_0xbe07('0xf')],'isexternal':_0x4b759d['isexternal'],'context':_0x4b759d[_0xbe07('0x10')],'extension':_0x4b759d[_0xbe07('0x11')],'type':'blind'},'log':_0xbe07('0x3')});};exports[_0xbe07('0x12')]=function(_0xf1d6c5){return client[_0xbe07('0x2')](_0xbe07('0x3'),{'body':{'result':_0xf1d6c5[_0xbe07('0x13')],'transfererchannel':_0xf1d6c5[_0xbe07('0x14')],'transferercalleridnum':_0xf1d6c5[_0xbe07('0x15')],'transferercalleridname':_0xf1d6c5[_0xbe07('0x16')],'transfererconnectedlinenum':_0xf1d6c5['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xf1d6c5[_0xbe07('0x17')],'transfereraccountcode':_0xf1d6c5[_0xbe07('0x18')],'transferercontext':_0xf1d6c5[_0xbe07('0x19')],'transfererexten':_0xf1d6c5[_0xbe07('0x1a')],'transfererlinkedid':_0xf1d6c5[_0xbe07('0x1b')],'transfereechannel':_0xf1d6c5['transfertargetchannel'],'transfereecalleridnum':_0xf1d6c5[_0xbe07('0x1c')],'transfereecalleridname':_0xf1d6c5[_0xbe07('0x1d')],'transfereeconnectedlinenum':_0xf1d6c5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xf1d6c5[_0xbe07('0x1e')],'transfereeaccountcode':_0xf1d6c5[_0xbe07('0x1f')],'transfereecontext':_0xf1d6c5[_0xbe07('0x20')],'transfereeexten':_0xf1d6c5[_0xbe07('0x21')],'transfereelinkedid':_0xf1d6c5['transfertargetlinkedid'],'isexternal':_0xf1d6c5[_0xbe07('0x22')],'context':_0xf1d6c5['origtransferercontext'],'extension':_0xf1d6c5[_0xbe07('0x23')],'type':_0xbe07('0x24')},'log':_0xbe07('0x3')});}; \ No newline at end of file +var _0x1bdc=['blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','CreateVoiceTransferReport','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransfererexten','attended','transfers'];(function(_0x802fe1,_0x15435e){var _0x3f5fe1=function(_0x39e490){while(--_0x39e490){_0x802fe1['push'](_0x802fe1['shift']());}};_0x3f5fe1(++_0x15435e);}(_0x1bdc,0x179));var _0xc1bd=function(_0x390740,_0x25d70c){_0x390740=_0x390740-0x0;var _0x246558=_0x1bdc[_0x390740];return _0x246558;};'use strict';var client=require('../client');exports[_0xc1bd('0x0')]={};exports[_0xc1bd('0x1')]=function(_0x5a0476){return client[_0xc1bd('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x5a0476[_0xc1bd('0x3')],'transfererchannel':_0x5a0476[_0xc1bd('0x4')],'transferercalleridnum':_0x5a0476[_0xc1bd('0x5')],'transferercalleridname':_0x5a0476[_0xc1bd('0x6')],'transfererconnectedlinenum':_0x5a0476[_0xc1bd('0x7')],'transfererconnectedlinename':_0x5a0476[_0xc1bd('0x8')],'transfereraccountcode':_0x5a0476[_0xc1bd('0x9')],'transferercontext':_0x5a0476[_0xc1bd('0xa')],'transfererexten':_0x5a0476['transfererexten'],'transfererlinkedid':_0x5a0476[_0xc1bd('0xb')],'transfereechannel':_0x5a0476[_0xc1bd('0xc')],'transfereecalleridnum':_0x5a0476[_0xc1bd('0xd')],'transfereecalleridname':_0x5a0476[_0xc1bd('0xe')],'transfereeconnectedlinenum':_0x5a0476[_0xc1bd('0xf')],'transfereeconnectedlinename':_0x5a0476['transfereeconnectedlinename'],'transfereeaccountcode':_0x5a0476[_0xc1bd('0x10')],'transfereecontext':_0x5a0476[_0xc1bd('0x11')],'transfereeexten':_0x5a0476[_0xc1bd('0x12')],'transfereelinkedid':_0x5a0476[_0xc1bd('0x13')],'isexternal':_0x5a0476['isexternal'],'context':_0x5a0476[_0xc1bd('0x14')],'extension':_0x5a0476[_0xc1bd('0x15')],'type':_0xc1bd('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0xc1bd('0x17')]=function(_0x39eba2){return client['Request'](_0xc1bd('0x18'),{'body':{'result':_0x39eba2[_0xc1bd('0x3')],'transfererchannel':_0x39eba2['origtransfererchannel'],'transferercalleridnum':_0x39eba2[_0xc1bd('0x19')],'transferercalleridname':_0x39eba2[_0xc1bd('0x1a')],'transfererconnectedlinenum':_0x39eba2['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x39eba2[_0xc1bd('0x1b')],'transfereraccountcode':_0x39eba2[_0xc1bd('0x1c')],'transferercontext':_0x39eba2[_0xc1bd('0x1d')],'transfererexten':_0x39eba2['secondtransfererexten'],'transfererlinkedid':_0x39eba2[_0xc1bd('0x1e')],'transfereechannel':_0x39eba2[_0xc1bd('0x1f')],'transfereecalleridnum':_0x39eba2[_0xc1bd('0x20')],'transfereecalleridname':_0x39eba2[_0xc1bd('0x21')],'transfereeconnectedlinenum':_0x39eba2[_0xc1bd('0x22')],'transfereeconnectedlinename':_0x39eba2[_0xc1bd('0x23')],'transfereeaccountcode':_0x39eba2[_0xc1bd('0x24')],'transfereecontext':_0x39eba2[_0xc1bd('0x25')],'transfereeexten':_0x39eba2['transfertargetexten'],'transfereelinkedid':_0x39eba2[_0xc1bd('0x26')],'isexternal':_0x39eba2[_0xc1bd('0x27')],'context':_0x39eba2['origtransferercontext'],'extension':_0x39eba2[_0xc1bd('0x28')],'type':_0xc1bd('0x29')},'log':_0xc1bd('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0656727..23a9265 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 _0xb091=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','filename','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','isConnected','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','agents','telephones','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','../../../config/environment','listen','format','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','command','content','catch','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xb091,0x16e));var _0x1b09=function(_0x562cf8,_0x2d96b4){_0x562cf8=_0x562cf8-0x0;var _0x46ff17=_0xb091[_0x562cf8];return _0x46ff17;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var jayson=require(_0x1b09('0x1'));var schema=require(_0x1b09('0x2'));var BPromise=require(_0x1b09('0x3'));var moment=require('moment');var config=require(_0x1b09('0x4'));var properties=require('../properties');var ami=require('../ami');exports[_0x1b09('0x5')]=function(_0x24d22c,_0x4e252c,_0xda8caa){return new BPromise(function(_0x5fa348,_0x2bf4f6){var _0x5ce726={'QueuePause':function(_0x142c33){return new Promise(function(_0x8c26a5,_0x2f359f){var _0x328815=util[_0x1b09('0x6')](_0x1b09('0x7'),_0x1b09('0x8'),_0x142c33[_0x1b09('0x9')]);if(_0x24d22c[_0x1b09('0xa')]&&_0x24d22c[_0x1b09('0xa')][_0x328815]&&_0x24d22c[_0x1b09('0xa')][_0x328815]['timer']){_0x24d22c[_0x1b09('0xa')][_0x328815][_0x1b09('0xb')]();}if(_0x24d22c['agents'][_0x328815]){_0x24d22c['agents'][_0x328815][_0x1b09('0xc')]({'statePause':_0x142c33[_0x1b09('0xd')]?!![]:![]});}_0x8c26a5({'code':0xc8,'message':_0x1b09('0xe')});});},'Reload':function(_0x1046f8){var _0x428cc5=this;return new Promise(function(_0x3a44f1,_0x1fd3bc){if(ami['isConnected']()==![]){return _0x1fd3bc(_0x428cc5[_0x1b09('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x1b09('0x10')][_0x1b09('0x11')],_0x1b09('0x12')][_0x1b09('0x13')]('\x20')));}_0x1046f8=_[_0x1b09('0x14')](_0x1046f8,_[_0x1b09('0x15')](properties[_0x1b09('0x16')]));_0x1046f8[_0x1b09('0x17')]=_0x1b09('0x18');return ami[_0x1b09('0x19')](_0x1046f8)[_0x1b09('0x1a')](function(_0x231ef6){_0x3a44f1({'code':0xc8,'message':_0x231ef6[_0x1b09('0x1b')]});})['catch'](function(_0x214c6b){_0x1fd3bc(_0x428cc5[_0x1b09('0xf')](0x1f5,_0x214c6b['message']));});});},'Command':function(_0x5cf855){var _0xe93ac4=this;return new Promise(function(_0x5debd9,_0x267b5e){if(ami['isConnected']()==![]){return _0x267b5e(_0xe93ac4[_0x1b09('0xf')](0x1f4,[config[_0x1b09('0x10')]['ip'],config[_0x1b09('0x10')][_0x1b09('0x11')],_0x1b09('0x12')][_0x1b09('0x13')]('\x20')));}_0x5cf855=_[_0x1b09('0x14')](_0x5cf855,_0x1b09('0x1c'));_0x5cf855['action']='Command';return ami[_0x1b09('0x19')](_0x5cf855)[_0x1b09('0x1a')](function(_0x4ce7dc){_0x5debd9({'code':0xc8,'message':_0x4ce7dc[_0x1b09('0x1d')]});})[_0x1b09('0x1e')](function(_0x6e132c){_0x267b5e(_0xe93ac4[_0x1b09('0xf')](0x1f5,_0x6e132c['message']));});});},'VoiceQueues':function(_0xe0d931){return new Promise(function(_0x15be49,_0x4936d0){var _0x2d3b86=[];for(var _0x472d30 in _0x24d22c['voiceQueues']){if(_0x24d22c[_0x1b09('0x1f')][_0x1b09('0x20')](_0x472d30)){var _0xa71272=_0x24d22c[_0x1b09('0x1f')][_0x472d30];var _0x547fbb={'id':_0xa71272['id'],'name':_0xa71272[_0x1b09('0x9')],'strategy':_0xa71272[_0x1b09('0x21')],'answered':_0xa71272['answered'],'available':_0xa71272[_0x1b09('0x22')],'loggedIn':_0xa71272[_0x1b09('0x23')],'pTalking':_0xa71272[_0x1b09('0x24')],'sumBillable':_0xa71272[_0x1b09('0x25')],'sumDuration':_0xa71272[_0x1b09('0x26')],'sumHoldTime':_0xa71272[_0x1b09('0x27')]||0x0,'talking':_0xa71272[_0x1b09('0x28')],'total':_0xa71272['total'],'type':_0xa71272[_0x1b09('0x29')],'unmanaged':_0xa71272[_0x1b09('0x2a')],'abandoned':_0xa71272['abandoned'],'waiting':_0xa71272[_0x1b09('0x2b')],'loggedInDb':_0xa71272[_0x1b09('0x2c')]};if(_0xa71272[_0x1b09('0x29')]===_0x1b09('0x2d')){_0x547fbb[_0x1b09('0x2e')]=_0xa71272['dialActive'];_0x547fbb[_0x1b09('0x2f')]=_0xa71272['dialMethod'];_0x547fbb[_0x1b09('0x30')]=_0xa71272['dialOriginateCallerIdName'];_0x547fbb[_0x1b09('0x31')]=_0xa71272[_0x1b09('0x31')];_0x547fbb[_0x1b09('0x32')]=_0xa71272[_0x1b09('0x32')];_0x547fbb[_0x1b09('0x33')]=_0xa71272[_0x1b09('0x33')];_0x547fbb[_0x1b09('0x34')]=_0xa71272[_0x1b09('0x34')];_0x547fbb[_0x1b09('0x35')]=_0xa71272[_0x1b09('0x35')];_0x547fbb['outboundAnswerCallsDay']=_0xa71272[_0x1b09('0x36')];_0x547fbb[_0x1b09('0x37')]=_0xa71272[_0x1b09('0x37')];_0x547fbb['outboundBusyCallsDay']=_0xa71272[_0x1b09('0x38')];_0x547fbb[_0x1b09('0x39')]=_0xa71272[_0x1b09('0x39')];_0x547fbb[_0x1b09('0x3a')]=_0xa71272[_0x1b09('0x3a')];_0x547fbb[_0x1b09('0x3b')]=_0xa71272[_0x1b09('0x3b')];_0x547fbb[_0x1b09('0x3c')]=_0xa71272['outboundDropCallsDayTimeout'];_0x547fbb[_0x1b09('0x3d')]=_0xa71272['outboundNoAnswerCallsDay'];_0x547fbb[_0x1b09('0x3e')]=_0xa71272['outboundNoSuchCallsDay'];_0x547fbb[_0x1b09('0x3f')]=_0xa71272[_0x1b09('0x3f')];_0x547fbb[_0x1b09('0x40')]=_0xa71272[_0x1b09('0x40')];_0x547fbb[_0x1b09('0x41')]=_0xa71272[_0x1b09('0x41')];_0x547fbb[_0x1b09('0x42')]=_0xa71272[_0x1b09('0x42')];_0x547fbb[_0x1b09('0x43')]=_0xa71272[_0x1b09('0x43')];_0x547fbb[_0x1b09('0x44')]=_0xa71272[_0x1b09('0x44')];_0x547fbb[_0x1b09('0x45')]=_0xa71272['predictiveIntervalAvgTalktime'];_0x547fbb['predictiveIntervalDroppedCallsCallersExit']=_0xa71272[_0x1b09('0x46')];_0x547fbb[_0x1b09('0x47')]=_0xa71272[_0x1b09('0x47')];_0x547fbb[_0x1b09('0x48')]=_0xa71272[_0x1b09('0x48')];_0x547fbb[_0x1b09('0x49')]=_0xa71272[_0x1b09('0x49')];_0x547fbb[_0x1b09('0x4a')]=_0xa71272['predictiveIntervalHitRate'];_0x547fbb['predictiveIntervalMultiplicativeFactor']=_0xa71272[_0x1b09('0x4b')];_0x547fbb['predictiveIntervalPauses']=_0xa71272[_0x1b09('0x4c')];_0x547fbb[_0x1b09('0x4d')]=_0xa71272[_0x1b09('0x4d')];_0x547fbb['predictiveIntervalTotalCalls']=_0xa71272[_0x1b09('0x4e')];_0x547fbb[_0x1b09('0x1b')]=_0xa71272[_0x1b09('0x1b')];_0x547fbb['originated']=_0xa71272[_0x1b09('0x4f')];_0x547fbb[_0x1b09('0x50')]=_0xa71272[_0x1b09('0x50')];_0x547fbb[_0x1b09('0x51')]=_0xa71272['erlangCallToSecond'];_0x547fbb[_0x1b09('0x52')]=_0xa71272[_0x1b09('0x52')];_0x547fbb['erlangBusyFactor']=_0xa71272[_0x1b09('0x53')];_0x547fbb[_0x1b09('0x54')]=_0xa71272['startPredictive'];_0x547fbb['startProgressive']=_0xa71272['startProgressive'];}if(_0xa71272['Trunk']){_0x547fbb[_0x1b09('0x55')]={'id':_0xa71272[_0x1b09('0x55')]['id'],'name':_0xa71272[_0x1b09('0x55')]['name'],'active':_0xa71272[_0x1b09('0x55')][_0x1b09('0x56')],'callerid':_0xa71272['Trunk'][_0x1b09('0x57')]};}if(_0xa71272[_0x1b09('0x58')]){_0x547fbb[_0x1b09('0x58')]={'id':_0xa71272[_0x1b09('0x58')]['id'],'name':_0xa71272[_0x1b09('0x58')][_0x1b09('0x9')]};}_0x2d3b86[_0x1b09('0x59')](_0x547fbb);}}_0x15be49({'count':_0x2d3b86[_0x1b09('0x5a')],'rows':_0x2d3b86});});},'UpdateVoiceQueue':function(_0x3b03c9){return new Promise(function(_0x176c2f,_0x5750f9){var _0xd23fa2=_[_0x1b09('0x5b')](_0x24d22c[_0x1b09('0x1f')],{'id':parseInt(_0x3b03c9['id'])});var _0x5bbfef=_[_0x1b09('0x5c')](_0x3b03c9,['id']);if(_0xd23fa2){for(var _0x4bf205 in _0x5bbfef){if(typeof _0x5bbfef[_0x4bf205]!==_0x1b09('0x5d')&&typeof _0xd23fa2[_0x4bf205]!==_0x1b09('0x5d')){_0xd23fa2[_0x4bf205]=_0x5bbfef[_0x4bf205];}}_0x176c2f(_0xd23fa2);}else{_0x5750f9();}});},'VoiceChannels':function(_0x4aac72){return new Promise(function(_0x10a248,_0x9be1a){var _0x3732fb=_[_0x1b09('0x5e')](_0x24d22c[_0x1b09('0x5f')]);_0x10a248({'count':_0x3732fb[_0x1b09('0x5a')],'rows':_0x3732fb});});},'VoiceChannelMixMonitor':function(_0x51402f){var _0x479dfc=this;return new Promise(function(_0x5df547,_0x35d9ee){if(ami['isConnected']()==![]){return _0x35d9ee(_0x479dfc['error'](0x1f4,[config[_0x1b09('0x10')]['ip'],config[_0x1b09('0x10')][_0x1b09('0x11')],_0x1b09('0x12')][_0x1b09('0x13')]('\x20')));}var _0x3e7046=schema(properties[_0x1b09('0x60')])[_0x1b09('0x2')](_0x51402f);if(_0x3e7046['length']>0x0){return _0x35d9ee(_0x479dfc[_0x1b09('0xf')](0x1f4,_[_0x1b09('0x61')](_0x3e7046,_0x1b09('0x1b'))['join'](',\x20')));}var _0x55df13=_[_0x1b09('0x5b')](_0x24d22c['channels'],{'uniqueid':_0x51402f[_0x1b09('0x62')]});if(_0x55df13&&_0x55df13[_0x1b09('0x63')]){var _0x49b051=util[_0x1b09('0x6')](_0x1b09('0x64'),_0x51402f['filename']||_0x51402f[_0x1b09('0x62')],_0x51402f[_0x1b09('0x6')]||_0x1b09('0x65'));return ami[_0x1b09('0x19')]({'action':_0x1b09('0x66'),'channel':_0x55df13['channel'],'file':_0x49b051,'options':_0x1b09('0x67')})[_0x1b09('0x1a')](function(_0x408d50){var _0x337777=_[_0x1b09('0x5b')](_0x55df13[_0x1b09('0x68')],{'filename':_0x1b09('0x69')+_0x49b051['toLowerCase']()});if(_['isNil'](_0x337777)){_0x55df13[_0x1b09('0x68')][_0x1b09('0x59')]({'filename':_0x1b09('0x69')+_0x49b051['toLowerCase'](),'createdAt':moment()[_0x1b09('0x6')](_0x1b09('0x6a')),'mixmonitorid':_0x408d50[_0x1b09('0x6b')],'status':'rec'});}else{_0x337777[_0x1b09('0x6b')]=_0x408d50[_0x1b09('0x6b')];_0x337777[_0x1b09('0x6c')]=_0x1b09('0x6d');}_0x5df547({'code':0xc8,'message':[_0x51402f[_0x1b09('0x62')],_0x1b09('0x6e'),_0x408d50[_0x1b09('0x6b')]][_0x1b09('0x13')]('\x20'),'mixmonitorid':_0x408d50[_0x1b09('0x6b')]});})[_0x1b09('0x1e')](function(_0x1e618e){_0x35d9ee(_0x479dfc[_0x1b09('0xf')](0x1f5,[_0x51402f[_0x1b09('0x62')],_0x1e618e[_0x1b09('0x1b')][_0x1b09('0x6f')]()]['join']('\x20')));});}else{return _0x35d9ee(_0x479dfc['error'](0x1f5,_0x1b09('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x54efba){var _0x315fe3=this;return new Promise(function(_0x4468f6,_0x246134){if(ami['isConnected']()==![]){return _0x246134(_0x315fe3['error'](0x1f4,[config[_0x1b09('0x10')]['ip'],config[_0x1b09('0x10')]['username'],_0x1b09('0x12')][_0x1b09('0x13')]('\x20')));}var _0x1ba539=schema(properties[_0x1b09('0x60')])[_0x1b09('0x2')](_0x54efba);if(_0x1ba539[_0x1b09('0x5a')]>0x0){return _0x246134(_0x315fe3[_0x1b09('0xf')](0x1f4,_['map'](_0x1ba539,_0x1b09('0x1b'))['join'](',\x20')));}var _0x34c0d2=_[_0x1b09('0x5b')](_0x24d22c[_0x1b09('0x5f')],{'uniqueid':_0x54efba[_0x1b09('0x62')]});if(_0x34c0d2){return BPromise[_0x1b09('0x71')]()[_0x1b09('0x1a')](function(){if(_0x34c0d2[_0x1b09('0x63')]){return ami[_0x1b09('0x19')]({'action':_0x1b09('0x72'),'channel':_0x34c0d2[_0x1b09('0x63')],'mixmonitorid':_0x54efba[_0x1b09('0x6b')]})[_0x1b09('0x1e')](function(_0x517e2d){});}})['then'](function(){if(_0x34c0d2[_0x1b09('0x73')]){return ami[_0x1b09('0x19')]({'action':_0x1b09('0x72'),'channel':_0x34c0d2['destinationchannel'],'mixmonitorid':_0x54efba[_0x1b09('0x6b')]})[_0x1b09('0x1e')](function(_0x2b422c){});}})['then'](function(_0x28d473){var _0x103d7e=_[_0x1b09('0x5b')](_0x34c0d2['monitors'],{'mixmonitorid':_0x54efba[_0x1b09('0x6b')]});if(_0x103d7e){_0x103d7e['status']='stop';}})[_0x1b09('0x1a')](function(){var _0x439880=util[_0x1b09('0x6')]('%s.%s',_0x54efba[_0x1b09('0x74')]||_0x54efba['uniqueid'],_0x54efba[_0x1b09('0x6')]||_0x1b09('0x65'));var _0x4931ca=_[_0x1b09('0x5b')](_0x34c0d2['monitors'],{'filename':_0x1b09('0x69')+_0x439880[_0x1b09('0x6f')]()});if(_0x4931ca){_0x4931ca['status']=_0x1b09('0x75');}})[_0x1b09('0x1a')](function(){_0x4468f6({'code':0xc8,'message':[_0x54efba[_0x1b09('0x62')],_0x1b09('0x76')][_0x1b09('0x13')]('\x20')});})[_0x1b09('0x1e')](function(_0x2570e9){_0x246134(_0x315fe3['error'](0x1f5,[_0x54efba[_0x1b09('0x62')],_0x2570e9[_0x1b09('0x1b')][_0x1b09('0x6f')]()]['join']('\x20')));});}else{return _0x246134(_0x315fe3[_0x1b09('0xf')](0x1f5,_0x1b09('0x70')));}});},'VoiceQueuesChannels':function(_0x29cf4e){return new Promise(function(_0x28b0c5,_0x25fca8){var _0x5051dc=_[_0x1b09('0x5e')](_0x24d22c['queueChannels']);_0x28b0c5({'count':_0x5051dc[_0x1b09('0x5a')],'rows':_0x5051dc});});},'VoiceQueuesChannel':function(_0x417875){var _0x22b1a9=this;return new Promise(function(_0x1fd5cd,_0x45526d){var _0x28a677=schema(properties[_0x1b09('0x77')])[_0x1b09('0x2')](_0x417875);if(_0x28a677['length']>0x0){return _0x45526d(_0x22b1a9[_0x1b09('0xf')](0x1f4,_[_0x1b09('0x61')](_0x28a677,'message')[_0x1b09('0x13')](',\x20')));}var _0xf7a8c8=_[_0x1b09('0x5b')](_0x24d22c[_0x1b09('0x78')],{'uniqueid':_0x417875[_0x1b09('0x62')]});if(_0xf7a8c8){_0x1fd5cd(_0xf7a8c8);}else{return _0x45526d(_0x22b1a9[_0x1b09('0xf')](0x1f5,_0x1b09('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x3dbe9a){var _0x20818a=this;return new Promise(function(_0x59fba4,_0x68f83b){if(ami[_0x1b09('0x79')]()==![]){return _0x68f83b(_0x20818a[_0x1b09('0xf')](0x1f4,[config[_0x1b09('0x10')]['ip'],config[_0x1b09('0x10')]['username'],_0x1b09('0x12')][_0x1b09('0x13')]('\x20')));}var _0x5736c5=schema(properties[_0x1b09('0x7a')])['validate'](_0x3dbe9a);if(_0x5736c5[_0x1b09('0x5a')]>0x0){return _0x68f83b(_0x20818a[_0x1b09('0xf')](0x1f4,_[_0x1b09('0x61')](_0x5736c5,'message')['join'](',\x20')));}var _0x51ed71=_[_0x1b09('0x5b')](_0x24d22c[_0x1b09('0x78')],{'uniqueid':_0x3dbe9a[_0x1b09('0x62')]});if(_0x51ed71&&_0x51ed71[_0x1b09('0x63')]){return ami[_0x1b09('0x19')]({'action':_0x1b09('0x7b'),'channel':_0x51ed71[_0x1b09('0x63')]})[_0x1b09('0x1a')](function(_0x4560e3){_0x59fba4({'code':0xc8,'message':[_0x3dbe9a[_0x1b09('0x62')],_0x4560e3[_0x1b09('0x1b')][_0x1b09('0x6f')]()]['join']('\x20')});})['catch'](function(_0x33a78e){_0x68f83b(_0x20818a[_0x1b09('0xf')](0x1f5,[_0x3dbe9a[_0x1b09('0x62')],_0x33a78e[_0x1b09('0x1b')][_0x1b09('0x6f')]()][_0x1b09('0x13')]('\x20')));});}else{return _0x68f83b(_0x20818a[_0x1b09('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2fbbaf){var _0x23ab6d=this;return new Promise(function(_0x2b2220,_0x4f777b){if(ami[_0x1b09('0x79')]()==![]){return _0x4f777b(_0x23ab6d[_0x1b09('0xf')](0x1f4,[config[_0x1b09('0x10')]['ip'],config[_0x1b09('0x10')][_0x1b09('0x11')],'ami\x20disconnected']['join']('\x20')));}var _0x3ea535=schema(properties[_0x1b09('0x7c')])['validate'](_0x2fbbaf);if(_0x3ea535[_0x1b09('0x5a')]>0x0){return _0x4f777b(_0x23ab6d['error'](0x1f4,_[_0x1b09('0x61')](_0x3ea535,_0x1b09('0x1b'))[_0x1b09('0x13')](',\x20')));}var _0x595a32=_[_0x1b09('0x5b')](_0x24d22c['queueChannels'],{'uniqueid':_0x2fbbaf['uniqueid']});if(_0x595a32&&_0x595a32[_0x1b09('0x63')]){return ami['Action']({'action':'Redirect','channel':_0x595a32['channel'],'exten':_0x2fbbaf[_0x1b09('0x7d')],'context':_0x2fbbaf[_0x1b09('0x7e')]||_0x595a32[_0x1b09('0x7e')],'priority':0x1})[_0x1b09('0x1a')](function(_0x589b8b){_0x2b2220({'code':0xc8,'message':[_0x2fbbaf[_0x1b09('0x62')],_0x589b8b[_0x1b09('0x1b')][_0x1b09('0x6f')]()][_0x1b09('0x13')]('\x20')});})[_0x1b09('0x1e')](function(_0x4e1562){_0x4f777b(_0x23ab6d[_0x1b09('0xf')](0x1f5,[_0x2fbbaf[_0x1b09('0x62')],_0x4e1562[_0x1b09('0x1b')][_0x1b09('0x6f')]()]['join']('\x20')));});}else{return _0x4f777b(_0x23ab6d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x4750df){return new Promise(function(_0x419add,_0x1aa510){var _0x371943=_[_0x1b09('0x5e')](_0x24d22c[_0x1b09('0x7f')]);_0x419add({'count':_0x371943['length'],'rows':_0x371943});});},'Telephones':function(_0x258a26){return new Promise(function(_0x1d4834,_0x57a953){var _0x56be94=_[_0x1b09('0x5e')](_0x24d22c[_0x1b09('0x80')]);_0x1d4834({'count':_0x56be94[_0x1b09('0x5a')],'rows':_0x56be94});});},'Trunks':function(_0x49a600){return new Promise(function(_0x5c0c7a,_0x20bd49){var _0x58ff42=_[_0x1b09('0x5e')](_0x24d22c['trunks']);_0x5c0c7a({'count':_0x58ff42['length'],'rows':_0x58ff42});});},'OutboundChannels':function(_0x24a450){return new Promise(function(_0xbd17f8,_0x40f6bf){var _0x47fa0f=_[_0x1b09('0x5e')](_0x24d22c[_0x1b09('0x81')]);_0xbd17f8({'count':_0x47fa0f[_0x1b09('0x5a')],'rows':_0x47fa0f});});},'Outbound':function(_0x3ad51b){return new Promise(function(_0x2d0639,_0x315303){_0x2d0639(_0x24d22c[_0x1b09('0x2d')]);});},'Campaigns':function(_0x520076){return new Promise(function(_0x3b8864,_0x4da93e){var _0x2d7faa=_[_0x1b09('0x5e')](_0x24d22c['campaigns']);_0x3b8864({'count':_0x2d7faa[_0x1b09('0x5a')],'rows':_0x2d7faa});});},'VoiceQueuesPreview':function(_0x2f2306){var _0x597643=this;return new Promise(function(_0x4ef2e5,_0x292517){_0x4e252c[_0x1b09('0x82')](_0x2f2306['id'])[_0x1b09('0x1a')](function(_0x266139){_0x4ef2e5({'code':0xc8,'message':_0x266139[_0x1b09('0x1b')]});})[_0x1b09('0x1e')](function(_0xb9f0b0){_0x292517(_0x597643[_0x1b09('0xf')](0x1f4,_0xb9f0b0[_0x1b09('0x1b')]));});});},'EventManager':function(_0x1822ef){var _0xa9ee8=this;return new Promise(function(_0x2eb447,_0x44e8f9){if(!_0x1822ef['event']){return _0x44e8f9(_0xa9ee8[_0x1b09('0xf')](0x1f4,_0x1b09('0x83')));}ami[_0x1b09('0x84')](_0x1b09('0x85')+_0x1822ef[_0x1b09('0x86')],_0x1822ef[_0x1b09('0x1b')]);_0x2eb447({'code':0xc8,'message':_0x1822ef});});},'FaxAccounts':function(_0x2efd5a){return new Promise(function(_0x266117,_0x1b934){var _0x3c6ebe=_[_0x1b09('0x5e')](_0x24d22c[_0x1b09('0x87')]);_0x266117({'count':_0x3c6ebe[_0x1b09('0x5a')],'rows':_0x3c6ebe});});},'SendFax':function(_0x3d6333){var _0x406f46=this;return new Promise(function(_0x2ab5e5,_0x590266){_0xda8caa['send'](_0x3d6333)['then'](function(_0x4aad75){_0x2ab5e5({'code':0xc8,'message':_0x4aad75['message']});})[_0x1b09('0x1e')](function(_0x29b1b4){_0x590266(_0x406f46['error'](0x1f4,_0x29b1b4['message']));});});},'CheckAfterSend':function(_0x145efe){var _0x25d450=this;return new Promise(function(_0x36bee8,_0x2713a2){_0xda8caa[_0x1b09('0x88')](_0x145efe)[_0x1b09('0x1a')](function(_0x3f7a46){_0x36bee8({'code':0xc8,'message':_0x3f7a46[_0x1b09('0x1b')]});})[_0x1b09('0x1e')](function(_0x5d1fa3){_0x2713a2(_0x25d450[_0x1b09('0xf')](0x1f4,_0x5d1fa3[_0x1b09('0x1b')]));});});}};var _0x19266a=jayson['server'](_0x5ce726)[_0x1b09('0x89')]();_0x19266a['on'](_0x1b09('0xf'),function(_0x41ec2b){return _0x2bf4f6(_0x41ec2b);});_0x19266a[_0x1b09('0x5')](0x232a,_0x1b09('0x8a'),function(){console[_0x1b09('0x8b')](_0x1b09('0x8c'),0x232a);return _0x5fa348(_0x1b09('0x8d')+0x232a);});});}; \ No newline at end of file +var _0xda19=['outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','values','channels','voicechannel','validate','map','uniqueid','format','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/environment','../ami','listen','%s/%s','name','timers','timer','updateAcw','updateStatusRealtime','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch','error','username','Command','content','voiceQueues','hasOwnProperty','strategy','available','sumDuration','sumHoldTime','talking','total','type','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay'];(function(_0x21d6bd,_0x5be372){var _0x1d78a0=function(_0x265ce0){while(--_0x265ce0){_0x21d6bd['push'](_0x21d6bd['shift']());}};_0x1d78a0(++_0x5be372);}(_0xda19,0xd5));var _0x9da1=function(_0x3d3992,_0x510557){_0x3d3992=_0x3d3992-0x0;var _0x4b1d71=_0xda19[_0x3d3992];return _0x4b1d71;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var jayson=require(_0x9da1('0x1'));var schema=require('validate');var BPromise=require(_0x9da1('0x2'));var moment=require('moment');var config=require(_0x9da1('0x3'));var properties=require('../properties');var ami=require(_0x9da1('0x4'));exports[_0x9da1('0x5')]=function(_0x3c5f54,_0x470043,_0x156faf){return new BPromise(function(_0x2dcbc6,_0x23e4f7){var _0x2c3cdd={'QueuePause':function(_0x1c24e6){return new Promise(function(_0x5e2d18,_0x47df89){var _0x55f66b=util['format'](_0x9da1('0x6'),'SIP',_0x1c24e6[_0x9da1('0x7')]);if(_0x3c5f54[_0x9da1('0x8')]&&_0x3c5f54[_0x9da1('0x8')][_0x55f66b]&&_0x3c5f54[_0x9da1('0x8')][_0x55f66b][_0x9da1('0x9')]){_0x3c5f54[_0x9da1('0x8')][_0x55f66b][_0x9da1('0xa')]();}if(_0x3c5f54['agents'][_0x55f66b]){_0x3c5f54['agents'][_0x55f66b][_0x9da1('0xb')]({'statePause':_0x1c24e6['pause']?!![]:![]});}_0x5e2d18({'code':0xc8,'message':_0x9da1('0xc')});});},'Reload':function(_0x1d93f8){var _0xd2d225=this;return new Promise(function(_0x1ffa2a,_0x4b75cc){if(ami[_0x9da1('0xd')]()==![]){return _0x4b75cc(_0xd2d225['error'](0x1f4,[config['asterisk']['ip'],config[_0x9da1('0xe')]['username'],_0x9da1('0xf')][_0x9da1('0x10')]('\x20')));}_0x1d93f8=_[_0x9da1('0x11')](_0x1d93f8,_[_0x9da1('0x12')](properties[_0x9da1('0x13')]));_0x1d93f8['action']=_0x9da1('0x14');return ami[_0x9da1('0x15')](_0x1d93f8)[_0x9da1('0x16')](function(_0x77347a){_0x1ffa2a({'code':0xc8,'message':_0x77347a[_0x9da1('0x17')]});})[_0x9da1('0x18')](function(_0x497676){_0x4b75cc(_0xd2d225['error'](0x1f5,_0x497676[_0x9da1('0x17')]));});});},'Command':function(_0x8da712){var _0x1b0e7f=this;return new Promise(function(_0x41e555,_0x40a967){if(ami[_0x9da1('0xd')]()==![]){return _0x40a967(_0x1b0e7f[_0x9da1('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x9da1('0xe')][_0x9da1('0x1a')],_0x9da1('0xf')][_0x9da1('0x10')]('\x20')));}_0x8da712=_[_0x9da1('0x11')](_0x8da712,'command');_0x8da712['action']=_0x9da1('0x1b');return ami[_0x9da1('0x15')](_0x8da712)[_0x9da1('0x16')](function(_0x330219){_0x41e555({'code':0xc8,'message':_0x330219[_0x9da1('0x1c')]});})[_0x9da1('0x18')](function(_0x4c60aa){_0x40a967(_0x1b0e7f[_0x9da1('0x19')](0x1f5,_0x4c60aa[_0x9da1('0x17')]));});});},'VoiceQueues':function(_0x4fd25a){return new Promise(function(_0x45fcce,_0x3f5680){var _0x534210=[];for(var _0x2fd49c in _0x3c5f54[_0x9da1('0x1d')]){if(_0x3c5f54['voiceQueues'][_0x9da1('0x1e')](_0x2fd49c)){var _0x1d6af5=_0x3c5f54['voiceQueues'][_0x2fd49c];var _0x5c09ed={'id':_0x1d6af5['id'],'name':_0x1d6af5[_0x9da1('0x7')],'strategy':_0x1d6af5[_0x9da1('0x1f')],'answered':_0x1d6af5['answered'],'available':_0x1d6af5[_0x9da1('0x20')],'loggedIn':_0x1d6af5['loggedIn'],'pTalking':_0x1d6af5['pTalking'],'sumBillable':_0x1d6af5['sumBillable'],'sumDuration':_0x1d6af5[_0x9da1('0x21')],'sumHoldTime':_0x1d6af5[_0x9da1('0x22')]||0x0,'talking':_0x1d6af5[_0x9da1('0x23')],'total':_0x1d6af5[_0x9da1('0x24')],'type':_0x1d6af5[_0x9da1('0x25')],'unmanaged':_0x1d6af5['unmanaged'],'abandoned':_0x1d6af5[_0x9da1('0x26')],'waiting':_0x1d6af5['waiting'],'loggedInDb':_0x1d6af5[_0x9da1('0x27')]};if(_0x1d6af5[_0x9da1('0x25')]==='outbound'){_0x5c09ed[_0x9da1('0x28')]=_0x1d6af5[_0x9da1('0x28')];_0x5c09ed['dialMethod']=_0x1d6af5[_0x9da1('0x29')];_0x5c09ed[_0x9da1('0x2a')]=_0x1d6af5[_0x9da1('0x2a')];_0x5c09ed[_0x9da1('0x2b')]=_0x1d6af5['dialOriginateCallerIdNumber'];_0x5c09ed['dialOriginateTimeout']=_0x1d6af5[_0x9da1('0x2c')];_0x5c09ed[_0x9da1('0x2d')]=_0x1d6af5[_0x9da1('0x2d')];_0x5c09ed[_0x9da1('0x2e')]=_0x1d6af5[_0x9da1('0x2e')];_0x5c09ed['outboundAnswerAgiCallsDay']=_0x1d6af5[_0x9da1('0x2f')];_0x5c09ed[_0x9da1('0x30')]=_0x1d6af5[_0x9da1('0x30')];_0x5c09ed[_0x9da1('0x31')]=_0x1d6af5[_0x9da1('0x31')];_0x5c09ed[_0x9da1('0x32')]=_0x1d6af5['outboundBusyCallsDay'];_0x5c09ed[_0x9da1('0x33')]=_0x1d6af5['outboundCongestionCallsDay'];_0x5c09ed['outboundDropCallsDayACS']=_0x1d6af5[_0x9da1('0x34')];_0x5c09ed['outboundDropCallsDayCallersExit']=_0x1d6af5[_0x9da1('0x35')];_0x5c09ed[_0x9da1('0x36')]=_0x1d6af5[_0x9da1('0x36')];_0x5c09ed[_0x9da1('0x37')]=_0x1d6af5[_0x9da1('0x37')];_0x5c09ed[_0x9da1('0x38')]=_0x1d6af5[_0x9da1('0x38')];_0x5c09ed[_0x9da1('0x39')]=_0x1d6af5['outboundOriginateFailureCallsDay'];_0x5c09ed[_0x9da1('0x3a')]=_0x1d6af5['outboundReCallsDay'];_0x5c09ed[_0x9da1('0x3b')]=_0x1d6af5['outboundRejectCallsDay'];_0x5c09ed['outboundUnknownCallsDay']=_0x1d6af5[_0x9da1('0x3c')];_0x5c09ed['predictiveIntervalAnsweredCalls']=_0x1d6af5[_0x9da1('0x3d')];_0x5c09ed[_0x9da1('0x3e')]=_0x1d6af5['predictiveIntervalAvgHoldtime'];_0x5c09ed[_0x9da1('0x3f')]=_0x1d6af5[_0x9da1('0x3f')];_0x5c09ed[_0x9da1('0x40')]=_0x1d6af5[_0x9da1('0x40')];_0x5c09ed['predictiveIntervalDroppedCallsTimeout']=_0x1d6af5[_0x9da1('0x41')];_0x5c09ed['predictiveIntervalErlangCalls']=_0x1d6af5[_0x9da1('0x42')];_0x5c09ed['predictiveIntervalErlangCallsDroppedCalls']=_0x1d6af5[_0x9da1('0x43')];_0x5c09ed[_0x9da1('0x44')]=_0x1d6af5['predictiveIntervalHitRate'];_0x5c09ed[_0x9da1('0x45')]=_0x1d6af5[_0x9da1('0x45')];_0x5c09ed[_0x9da1('0x46')]=_0x1d6af5['predictiveIntervalPauses'];_0x5c09ed['predictiveIntervalAvailable']=_0x1d6af5['predictiveIntervalAvailable'];_0x5c09ed[_0x9da1('0x47')]=_0x1d6af5['predictiveIntervalTotalCalls'];_0x5c09ed[_0x9da1('0x17')]=_0x1d6af5[_0x9da1('0x17')];_0x5c09ed[_0x9da1('0x48')]=_0x1d6af5[_0x9da1('0x48')];_0x5c09ed['erlangCalls']=_0x1d6af5[_0x9da1('0x49')];_0x5c09ed[_0x9da1('0x4a')]=_0x1d6af5[_0x9da1('0x4a')];_0x5c09ed[_0x9da1('0x4b')]=_0x1d6af5[_0x9da1('0x4b')];_0x5c09ed[_0x9da1('0x4c')]=_0x1d6af5[_0x9da1('0x4c')];_0x5c09ed['startPredictive']=_0x1d6af5[_0x9da1('0x4d')];_0x5c09ed['startProgressive']=_0x1d6af5[_0x9da1('0x4e')];}if(_0x1d6af5['Trunk']){_0x5c09ed[_0x9da1('0x4f')]={'id':_0x1d6af5[_0x9da1('0x4f')]['id'],'name':_0x1d6af5['Trunk'][_0x9da1('0x7')],'active':_0x1d6af5[_0x9da1('0x4f')]['active'],'callerid':_0x1d6af5[_0x9da1('0x4f')]['callerid']};}if(_0x1d6af5[_0x9da1('0x50')]){_0x5c09ed[_0x9da1('0x50')]={'id':_0x1d6af5['Interval']['id'],'name':_0x1d6af5['Interval'][_0x9da1('0x7')]};}_0x534210[_0x9da1('0x51')](_0x5c09ed);}}_0x45fcce({'count':_0x534210[_0x9da1('0x52')],'rows':_0x534210});});},'UpdateVoiceQueue':function(_0x40f514){return new Promise(function(_0x41753d,_0x15578d){var _0x2d7003=_[_0x9da1('0x53')](_0x3c5f54['voiceQueues'],{'id':parseInt(_0x40f514['id'])});var _0xd7fb0a=_[_0x9da1('0x54')](_0x40f514,['id']);if(_0x2d7003){for(var _0x1eebc5 in _0xd7fb0a){if(typeof _0xd7fb0a[_0x1eebc5]!=='undefined'&&typeof _0x2d7003[_0x1eebc5]!==_0x9da1('0x55')){_0x2d7003[_0x1eebc5]=_0xd7fb0a[_0x1eebc5];}}_0x41753d(_0x2d7003);}else{_0x15578d();}});},'VoiceChannels':function(_0x3e4e24){return new Promise(function(_0x290687,_0x4ad7b1){var _0x336fc3=_[_0x9da1('0x56')](_0x3c5f54[_0x9da1('0x57')]);_0x290687({'count':_0x336fc3['length'],'rows':_0x336fc3});});},'VoiceChannelMixMonitor':function(_0xd243a4){var _0x4d3909=this;return new Promise(function(_0x5798f1,_0xfbdde9){if(ami[_0x9da1('0xd')]()==![]){return _0xfbdde9(_0x4d3909['error'](0x1f4,[config[_0x9da1('0xe')]['ip'],config[_0x9da1('0xe')]['username'],_0x9da1('0xf')][_0x9da1('0x10')]('\x20')));}var _0x1984f7=schema(properties[_0x9da1('0x58')])[_0x9da1('0x59')](_0xd243a4);if(_0x1984f7[_0x9da1('0x52')]>0x0){return _0xfbdde9(_0x4d3909[_0x9da1('0x19')](0x1f4,_[_0x9da1('0x5a')](_0x1984f7,_0x9da1('0x17'))['join'](',\x20')));}var _0x147c65=_[_0x9da1('0x53')](_0x3c5f54[_0x9da1('0x57')],{'uniqueid':_0xd243a4[_0x9da1('0x5b')]});if(_0x147c65&&_0x147c65['channel']){var _0x59c6da=util[_0x9da1('0x5c')](_0x9da1('0x5d'),_0xd243a4[_0x9da1('0x5e')]||_0xd243a4[_0x9da1('0x5b')],_0xd243a4[_0x9da1('0x5c')]||_0x9da1('0x5f'));return ami[_0x9da1('0x15')]({'action':_0x9da1('0x60'),'channel':_0x147c65[_0x9da1('0x61')],'file':_0x59c6da,'options':_0x9da1('0x62')})[_0x9da1('0x16')](function(_0x19f1ca){var _0x368ee7=_[_0x9da1('0x53')](_0x147c65['monitors'],{'filename':_0x9da1('0x63')+_0x59c6da[_0x9da1('0x64')]()});if(_['isNil'](_0x368ee7)){_0x147c65[_0x9da1('0x65')]['push']({'filename':_0x9da1('0x63')+_0x59c6da['toLowerCase'](),'createdAt':moment()[_0x9da1('0x5c')](_0x9da1('0x66')),'mixmonitorid':_0x19f1ca[_0x9da1('0x67')],'status':_0x9da1('0x68')});}else{_0x368ee7[_0x9da1('0x67')]=_0x19f1ca[_0x9da1('0x67')];_0x368ee7[_0x9da1('0x69')]=_0x9da1('0x68');}_0x5798f1({'code':0xc8,'message':[_0xd243a4[_0x9da1('0x5b')],_0x9da1('0x6a'),_0x19f1ca['mixmonitorid']][_0x9da1('0x10')]('\x20'),'mixmonitorid':_0x19f1ca[_0x9da1('0x67')]});})[_0x9da1('0x18')](function(_0xa125d7){_0xfbdde9(_0x4d3909[_0x9da1('0x19')](0x1f5,[_0xd243a4[_0x9da1('0x5b')],_0xa125d7[_0x9da1('0x17')][_0x9da1('0x64')]()][_0x9da1('0x10')]('\x20')));});}else{return _0xfbdde9(_0x4d3909[_0x9da1('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0xdaa51b){var _0x374a1a=this;return new Promise(function(_0x5bda2a,_0x39e79e){if(ami[_0x9da1('0xd')]()==![]){return _0x39e79e(_0x374a1a[_0x9da1('0x19')](0x1f4,[config[_0x9da1('0xe')]['ip'],config[_0x9da1('0xe')][_0x9da1('0x1a')],_0x9da1('0xf')]['join']('\x20')));}var _0x195943=schema(properties[_0x9da1('0x58')])[_0x9da1('0x59')](_0xdaa51b);if(_0x195943[_0x9da1('0x52')]>0x0){return _0x39e79e(_0x374a1a['error'](0x1f4,_[_0x9da1('0x5a')](_0x195943,'message')[_0x9da1('0x10')](',\x20')));}var _0x10ebc9=_[_0x9da1('0x53')](_0x3c5f54[_0x9da1('0x57')],{'uniqueid':_0xdaa51b[_0x9da1('0x5b')]});if(_0x10ebc9){return BPromise[_0x9da1('0x6b')]()['then'](function(){if(_0x10ebc9['channel']){return ami[_0x9da1('0x15')]({'action':'StopMixMonitor','channel':_0x10ebc9['channel'],'mixmonitorid':_0xdaa51b['mixmonitorid']})[_0x9da1('0x18')](function(_0x497d49){});}})[_0x9da1('0x16')](function(){if(_0x10ebc9['destinationchannel']){return ami[_0x9da1('0x15')]({'action':_0x9da1('0x6c'),'channel':_0x10ebc9['destinationchannel'],'mixmonitorid':_0xdaa51b[_0x9da1('0x67')]})[_0x9da1('0x18')](function(_0x575a9b){});}})[_0x9da1('0x16')](function(_0x375606){var _0x495904=_['find'](_0x10ebc9[_0x9da1('0x65')],{'mixmonitorid':_0xdaa51b[_0x9da1('0x67')]});if(_0x495904){_0x495904[_0x9da1('0x69')]=_0x9da1('0x6d');}})[_0x9da1('0x16')](function(){var _0x44d7fe=util['format'](_0x9da1('0x5d'),_0xdaa51b['filename']||_0xdaa51b['uniqueid'],_0xdaa51b[_0x9da1('0x5c')]||_0x9da1('0x5f'));var _0x2e4ea4=_[_0x9da1('0x53')](_0x10ebc9[_0x9da1('0x65')],{'filename':_0x9da1('0x63')+_0x44d7fe[_0x9da1('0x64')]()});if(_0x2e4ea4){_0x2e4ea4[_0x9da1('0x69')]=_0x9da1('0x6d');}})['then'](function(){_0x5bda2a({'code':0xc8,'message':[_0xdaa51b[_0x9da1('0x5b')],_0x9da1('0x6e')][_0x9da1('0x10')]('\x20')});})[_0x9da1('0x18')](function(_0xb2c3f1){_0x39e79e(_0x374a1a['error'](0x1f5,[_0xdaa51b[_0x9da1('0x5b')],_0xb2c3f1[_0x9da1('0x17')][_0x9da1('0x64')]()][_0x9da1('0x10')]('\x20')));});}else{return _0x39e79e(_0x374a1a[_0x9da1('0x19')](0x1f5,_0x9da1('0x6f')));}});},'VoiceQueuesChannels':function(_0x55a6d2){return new Promise(function(_0x197e1d,_0x559c10){var _0x38a10c=_['values'](_0x3c5f54[_0x9da1('0x70')]);_0x197e1d({'count':_0x38a10c[_0x9da1('0x52')],'rows':_0x38a10c});});},'VoiceQueuesChannel':function(_0x44b6c0){var _0x23209b=this;return new Promise(function(_0x59125a,_0x5d9c84){var _0x4c832f=schema(properties[_0x9da1('0x71')])[_0x9da1('0x59')](_0x44b6c0);if(_0x4c832f[_0x9da1('0x52')]>0x0){return _0x5d9c84(_0x23209b[_0x9da1('0x19')](0x1f4,_['map'](_0x4c832f,'message')[_0x9da1('0x10')](',\x20')));}var _0x327bb4=_[_0x9da1('0x53')](_0x3c5f54['queueChannels'],{'uniqueid':_0x44b6c0['uniqueid']});if(_0x327bb4){_0x59125a(_0x327bb4);}else{return _0x5d9c84(_0x23209b[_0x9da1('0x19')](0x1f5,_0x9da1('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x114093){var _0x57f20c=this;return new Promise(function(_0x5b68fd,_0x8f2e0){if(ami[_0x9da1('0xd')]()==![]){return _0x8f2e0(_0x57f20c[_0x9da1('0x19')](0x1f4,[config[_0x9da1('0xe')]['ip'],config[_0x9da1('0xe')]['username'],_0x9da1('0xf')][_0x9da1('0x10')]('\x20')));}var _0x1e4ede=schema(properties[_0x9da1('0x72')])['validate'](_0x114093);if(_0x1e4ede[_0x9da1('0x52')]>0x0){return _0x8f2e0(_0x57f20c[_0x9da1('0x19')](0x1f4,_[_0x9da1('0x5a')](_0x1e4ede,'message')[_0x9da1('0x10')](',\x20')));}var _0x7cf296=_[_0x9da1('0x53')](_0x3c5f54['queueChannels'],{'uniqueid':_0x114093[_0x9da1('0x5b')]});if(_0x7cf296&&_0x7cf296[_0x9da1('0x61')]){return ami['Action']({'action':_0x9da1('0x73'),'channel':_0x7cf296['channel']})[_0x9da1('0x16')](function(_0x551928){_0x5b68fd({'code':0xc8,'message':[_0x114093[_0x9da1('0x5b')],_0x551928[_0x9da1('0x17')][_0x9da1('0x64')]()][_0x9da1('0x10')]('\x20')});})[_0x9da1('0x18')](function(_0x3a03cd){_0x8f2e0(_0x57f20c[_0x9da1('0x19')](0x1f5,[_0x114093[_0x9da1('0x5b')],_0x3a03cd[_0x9da1('0x17')][_0x9da1('0x64')]()][_0x9da1('0x10')]('\x20')));});}else{return _0x8f2e0(_0x57f20c[_0x9da1('0x19')](0x1f5,_0x9da1('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x569d1f){var _0x14dbe1=this;return new Promise(function(_0x30c5a8,_0x27cec6){if(ami[_0x9da1('0xd')]()==![]){return _0x27cec6(_0x14dbe1[_0x9da1('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x9da1('0xe')][_0x9da1('0x1a')],'ami\x20disconnected']['join']('\x20')));}var _0x84f8d8=schema(properties[_0x9da1('0x74')])[_0x9da1('0x59')](_0x569d1f);if(_0x84f8d8[_0x9da1('0x52')]>0x0){return _0x27cec6(_0x14dbe1[_0x9da1('0x19')](0x1f4,_[_0x9da1('0x5a')](_0x84f8d8,_0x9da1('0x17'))[_0x9da1('0x10')](',\x20')));}var _0x29c4e8=_[_0x9da1('0x53')](_0x3c5f54[_0x9da1('0x70')],{'uniqueid':_0x569d1f[_0x9da1('0x5b')]});if(_0x29c4e8&&_0x29c4e8[_0x9da1('0x61')]){return ami['Action']({'action':_0x9da1('0x75'),'channel':_0x29c4e8[_0x9da1('0x61')],'exten':_0x569d1f[_0x9da1('0x76')],'context':_0x569d1f[_0x9da1('0x77')]||_0x29c4e8[_0x9da1('0x77')],'priority':0x1})['then'](function(_0x3db75f){_0x30c5a8({'code':0xc8,'message':[_0x569d1f[_0x9da1('0x5b')],_0x3db75f['message'][_0x9da1('0x64')]()]['join']('\x20')});})[_0x9da1('0x18')](function(_0x5955e8){_0x27cec6(_0x14dbe1[_0x9da1('0x19')](0x1f5,[_0x569d1f[_0x9da1('0x5b')],_0x5955e8[_0x9da1('0x17')][_0x9da1('0x64')]()][_0x9da1('0x10')]('\x20')));});}else{return _0x27cec6(_0x14dbe1[_0x9da1('0x19')](0x1f5,_0x9da1('0x6f')));}});},'Agents':function(_0x1fa9c5){return new Promise(function(_0x118e26,_0x38cc9f){var _0xbd3a16=_[_0x9da1('0x56')](_0x3c5f54['agents']);_0x118e26({'count':_0xbd3a16[_0x9da1('0x52')],'rows':_0xbd3a16});});},'Telephones':function(_0x9b8c01){return new Promise(function(_0x31bbee,_0x4015b9){var _0xeef6b=_[_0x9da1('0x56')](_0x3c5f54['telephones']);_0x31bbee({'count':_0xeef6b['length'],'rows':_0xeef6b});});},'Trunks':function(_0x3d0544){return new Promise(function(_0xdecc82,_0xe12dd7){var _0x4cd85f=_[_0x9da1('0x56')](_0x3c5f54[_0x9da1('0x78')]);_0xdecc82({'count':_0x4cd85f[_0x9da1('0x52')],'rows':_0x4cd85f});});},'OutboundChannels':function(_0x37143a){return new Promise(function(_0x210e49,_0x198fd6){var _0x2bfd0b=_['values'](_0x3c5f54[_0x9da1('0x79')]);_0x210e49({'count':_0x2bfd0b[_0x9da1('0x52')],'rows':_0x2bfd0b});});},'Outbound':function(_0x5a64fd){return new Promise(function(_0x56af13,_0x392d19){_0x56af13(_0x3c5f54['outbound']);});},'Campaigns':function(_0x496ccd){return new Promise(function(_0x1ce0bb,_0x154708){var _0x3f9010=_[_0x9da1('0x56')](_0x3c5f54[_0x9da1('0x7a')]);_0x1ce0bb({'count':_0x3f9010[_0x9da1('0x52')],'rows':_0x3f9010});});},'VoiceQueuesPreview':function(_0x40a2ef){var _0x39afa7=this;return new Promise(function(_0x5e9bfc,_0x5569d5){_0x470043[_0x9da1('0x7b')](_0x40a2ef['id'])[_0x9da1('0x16')](function(_0x22196d){_0x5e9bfc({'code':0xc8,'message':_0x22196d[_0x9da1('0x17')]});})[_0x9da1('0x18')](function(_0x2ea2e5){_0x5569d5(_0x39afa7[_0x9da1('0x19')](0x1f4,_0x2ea2e5[_0x9da1('0x17')]));});});},'EventManager':function(_0x4c9aa5){var _0x436f5f=this;return new Promise(function(_0x539bb7,_0x37cfd3){if(!_0x4c9aa5[_0x9da1('0x7c')]){return _0x37cfd3(_0x436f5f[_0x9da1('0x19')](0x1f4,_0x9da1('0x7d')));}ami[_0x9da1('0x7e')](_0x9da1('0x7f')+_0x4c9aa5[_0x9da1('0x7c')],_0x4c9aa5['message']);_0x539bb7({'code':0xc8,'message':_0x4c9aa5});});},'FaxAccounts':function(_0x4afb26){return new Promise(function(_0x532686,_0x174d15){var _0x35322c=_[_0x9da1('0x56')](_0x3c5f54[_0x9da1('0x80')]);_0x532686({'count':_0x35322c['length'],'rows':_0x35322c});});},'SendFax':function(_0x3310af){var _0x1f93bf=this;return new Promise(function(_0x2afe1e,_0x19322d){_0x156faf[_0x9da1('0x81')](_0x3310af)[_0x9da1('0x16')](function(_0x305d80){_0x2afe1e({'code':0xc8,'message':_0x305d80[_0x9da1('0x17')]});})[_0x9da1('0x18')](function(_0x1faea5){_0x19322d(_0x1f93bf[_0x9da1('0x19')](0x1f4,_0x1faea5[_0x9da1('0x17')]));});});},'CheckAfterSend':function(_0x27890f){var _0x32ff53=this;return new Promise(function(_0x534657,_0x3a592e){_0x156faf['checkAfterSend'](_0x27890f)[_0x9da1('0x16')](function(_0x48ff92){_0x534657({'code':0xc8,'message':_0x48ff92[_0x9da1('0x17')]});})[_0x9da1('0x18')](function(_0xb86ed0){_0x3a592e(_0x32ff53[_0x9da1('0x19')](0x1f4,_0xb86ed0[_0x9da1('0x17')]));});});}};var _0x1e09c8=jayson[_0x9da1('0x82')](_0x2c3cdd)[_0x9da1('0x83')]();_0x1e09c8['on']('error',function(_0xe8b0a5){return _0x23e4f7(_0xe8b0a5);});_0x1e09c8[_0x9da1('0x5')](0x232a,'127.0.0.1',function(){console[_0x9da1('0x84')](_0x9da1('0x85'),0x232a);return _0x2dcbc6(_0x9da1('0x86')+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 67fd224..e995435 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 _0x3e74=['scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','data1','data2','isNil','data5','ListId','data3','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt'];(function(_0x485677,_0x3993bf){var _0x560810=function(_0x33f3a4){while(--_0x33f3a4){_0x485677['push'](_0x485677['shift']());}};_0x560810(++_0x3993bf);}(_0x3e74,0x175));var _0x43e7=function(_0x298157,_0x4ca2a8){_0x298157=_0x298157-0x0;var _0x68965f=_0x3e74[_0x298157];return _0x68965f;};'use strict';var _=require(_0x43e7('0x0'));var BPromise=require('bluebird');var Redis=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x43e7('0x4'));config['redis']=_[_0x43e7('0x5')](config[_0x43e7('0x6')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config[_0x43e7('0x6')]));function emit(_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){logger[_0x43e7('0x9')]('[CM][%s][%s]',_0x503698,_0x45a0d1['id'],_0x3491d6,_0x2ede2d,JSON[_0x43e7('0xa')](_0x8528fc));io['to'](_0x3491d6)['emit'](_0x2ede2d,_0x8528fc);}exports['exec']=function(_0x39c8bd,_0x4139c9,_0x5c34f4,_0x2803d9){var _0x513707,_0xf7c520;var _0x37302c={};var _0x4ebc8e=Number(_0x5c34f4[_0x43e7('0xb')]);var _0xc960ea=_0x5c34f4[_0x43e7('0xc')]?Boolean(Number(_0x5c34f4[_0x43e7('0xc')])):![];var _0x4e008c;var _0x583d85=![];if(!_[_0x43e7('0xd')](_0x5c34f4[_0x43e7('0xe')])){if(_0x5c34f4[_0x43e7('0xe')]=='1')_0x583d85=!![];}if(!_0x583d85){if(_0x2803d9['xmd-contactid']){_0x37302c['id']=_0x2803d9['xmd-contactid'];}}if(!_0x37302c['id']){_0x37302c[_0x43e7('0xf')]=_0x4ebc8e;_0x4e008c=_0x5c34f4[_0x43e7('0x10')]&&_0x5c34f4[_0x43e7('0x10')]!=='0'?_0x5c34f4[_0x43e7('0x10')]['split'](','):['phone'];_0x37302c[_0x43e7('0x11')]=_[_0x43e7('0x12')](_0x4e008c,function(_0x273a32){var _0x5d346f={};_0x5d346f[_0x273a32]=_0x2803d9['routeId']?_0x2803d9[_0x43e7('0x13')]:_0x2803d9[_0x43e7('0x14')];return _0x5d346f;});}var _0x9037d3=['id',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),_0x43e7('0x19'),_0x43e7('0xf'),_0x43e7('0x1a'),_0x43e7('0x1b'),_0x43e7('0x1c')];var _0x4b5d64=_[_0x43e7('0x1d')](_0x9037d3,_0x4e008c);BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x1f')]({'attributes':_0x4b5d64,'where':_0x37302c}))[_0x43e7('0x20')](function(_0x3945bb){_0xf7c520=_0x3945bb;if(!_[_0x43e7('0x21')](_0xf7c520)){if(_0xf7c520[_0x43e7('0x22')]===0x1){_0x513707=_0xf7c520[0x0];logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_[_0x43e7('0x12')](_0xf7c520,'id')['join'](','));}return;}else{logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);var _0x5c5e67={'ListId':_0x4ebc8e};var _0x1af208=_0x5c34f4[_0x43e7('0x24')]&&_0x5c34f4[_0x43e7('0x24')]!=='0'?_0x5c34f4[_0x43e7('0x24')]:'phone';if(_0xc960ea){logger['info'](_0x43e7('0x25'),_0x2803d9['uniqueid'],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])?_0x2803d9[_0x43e7('0x14')]:_0x2803d9[_0x43e7('0x13')];if(_['isNil'](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x27')]:_0x43e7('0x29');}else{_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x2a')]&&_0x2803d9[_0x43e7('0x2a')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x2a')]:_0x43e7('0x29');}return BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x2b')](_0x5c5e67))[_0x43e7('0x20')](function(_0x3b8f78){_0x513707=_0x3b8f78;_0xf7c520[_0x43e7('0x2c')](_0x3b8f78);if(_0x513707){logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}return;});}else{logger[_0x43e7('0x9')](_0x43e7('0x2d'),_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_['isNil'](_0x2803d9['routeId'])?_0x2803d9['calleridnum']:_0x2803d9[_0x43e7('0x13')];if(_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==''?_0x2803d9['calleridname']:'Unknown';}else{_0x5c5e67['firstName']=_0x2803d9['destcalleridname']&&_0x2803d9['destcalleridname']!==''?_0x2803d9[_0x43e7('0x2a')]:'Unknown';}_0x513707=_0x5c5e67;_0xf7c520[_0x43e7('0x2c')](_0x5c5e67);return;}}})[_0x43e7('0x20')](function(){if(_0x39c8bd){emit(_0x2803d9[_0x43e7('0x23')],_0x4139c9,util[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x39c8bd[_0x43e7('0x30')]),util[_0x43e7('0x2e')]('trigger:%s',_0x5c34f4['action']['toLowerCase']()),{'evt':_[_0x43e7('0x31')](_0x2803d9,{'autoCreate':_0xc960ea}),'contact':_0x513707===undefined?{}:_0x513707,'contacts':_0xf7c520[_0x43e7('0x22')]===0x0?undefined:_0xf7c520});}});}; \ No newline at end of file +var _0x0a9a=['exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','calleridnum','firstName','lastName','phone','mobile','createdAt','union','resolve','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','destcalleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','then','user:%s','name','format','trigger:%s','action','toLowerCase','merge','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify'];(function(_0x2cb4bd,_0x1571cc){var _0x4774ca=function(_0x9ce063){while(--_0x9ce063){_0x2cb4bd['push'](_0x2cb4bd['shift']());}};_0x4774ca(++_0x1571cc);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3ae8f4,_0x3df91d){_0x3ae8f4=_0x3ae8f4-0x0;var _0x52ee37=_0x0a9a[_0x3ae8f4];return _0x52ee37;};'use strict';var _=require('lodash');var BPromise=require(_0xa0a9('0x0'));var Redis=require('ioredis');var util=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));var logger=require(_0xa0a9('0x3'))(_0xa0a9('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xa0a9('0x5')]=_[_0xa0a9('0x6')](config['redis'],{'host':_0xa0a9('0x7'),'port':0x18eb});var io=require(_0xa0a9('0x8'))(new Redis(config[_0xa0a9('0x5')]));function emit(_0x31d689,_0x499a29,_0x2b2eb4,_0x520f42,_0x10aa8a){logger[_0xa0a9('0x9')](_0xa0a9('0xa'),_0x31d689,_0x499a29['id'],_0x2b2eb4,_0x520f42,JSON[_0xa0a9('0xb')](_0x10aa8a));io['to'](_0x2b2eb4)['emit'](_0x520f42,_0x10aa8a);}exports[_0xa0a9('0xc')]=function(_0x1b5bfb,_0x5ce7e9,_0x5909cf,_0x13dc4a){var _0x33f54f,_0x51d5a5;var _0x42110f={};var _0x5cc496=Number(_0x5909cf[_0xa0a9('0xd')]);var _0x4b7913=_0x5909cf[_0xa0a9('0xe')]?Boolean(Number(_0x5909cf[_0xa0a9('0xe')])):![];var _0xa10656;var _0x35e7cd=![];if(!_[_0xa0a9('0xf')](_0x5909cf['data5'])){if(_0x5909cf[_0xa0a9('0x10')]=='1')_0x35e7cd=!![];}if(!_0x35e7cd){if(_0x13dc4a[_0xa0a9('0x11')]){_0x42110f['id']=_0x13dc4a[_0xa0a9('0x11')];}}if(!_0x42110f['id']){_0x42110f[_0xa0a9('0x12')]=_0x5cc496;_0xa10656=_0x5909cf[_0xa0a9('0x13')]&&_0x5909cf[_0xa0a9('0x13')]!=='0'?_0x5909cf['data3'][_0xa0a9('0x14')](','):['phone'];_0x42110f['$or']=_[_0xa0a9('0x15')](_0xa10656,function(_0x9f5abd){var _0x476762={};_0x476762[_0x9f5abd]=_0x13dc4a[_0xa0a9('0x16')]?_0x13dc4a['destcalleridnum']:_0x13dc4a[_0xa0a9('0x17')];return _0x476762;});}var _0x126401=['id',_0xa0a9('0x18'),_0xa0a9('0x19'),_0xa0a9('0x1a'),_0xa0a9('0x1b'),'fax',_0xa0a9('0x12'),_0xa0a9('0x1c'),'scheduledAt','updatedAt'];var _0x465d60=_[_0xa0a9('0x1d')](_0x126401,_0xa10656);BPromise[_0xa0a9('0x1e')]()['then'](cmContactRpc[_0xa0a9('0x1f')]({'attributes':_0x465d60,'where':_0x42110f}))['then'](function(_0x1fb36b){_0x51d5a5=_0x1fb36b;if(!_['isEmpty'](_0x51d5a5)){if(_0x51d5a5[_0xa0a9('0x20')]===0x1){_0x33f54f=_0x51d5a5[0x0];logger[_0xa0a9('0x9')](_0xa0a9('0x21'),_0x13dc4a[_0xa0a9('0x22')],_0x5ce7e9['id'],_0x33f54f['id']);}else{logger['info'](_0xa0a9('0x23'),_0x13dc4a['uniqueid'],_0x5ce7e9['id'],_[_0xa0a9('0x15')](_0x51d5a5,'id')[_0xa0a9('0x24')](','));}return;}else{logger[_0xa0a9('0x9')](_0xa0a9('0x25'),_0x13dc4a['uniqueid'],_0x5ce7e9['id']);var _0x7c1502={'ListId':_0x5cc496};var _0xe49d3b=_0x5909cf[_0xa0a9('0x26')]&&_0x5909cf[_0xa0a9('0x26')]!=='0'?_0x5909cf['data4']:_0xa0a9('0x1a');if(_0x4b7913){logger[_0xa0a9('0x9')](_0xa0a9('0x27'),_0x13dc4a['uniqueid'],_0x5ce7e9['id']);_0x7c1502[_0xe49d3b]=_['isNil'](_0x13dc4a[_0xa0a9('0x16')])?_0x13dc4a[_0xa0a9('0x17')]:_0x13dc4a[_0xa0a9('0x28')];if(_[_0xa0a9('0xf')](_0x13dc4a[_0xa0a9('0x16')])){_0x7c1502[_0xa0a9('0x18')]=_0x13dc4a[_0xa0a9('0x29')]&&_0x13dc4a[_0xa0a9('0x29')]!==_0xa0a9('0x2a')?_0x13dc4a[_0xa0a9('0x29')]:_0xa0a9('0x2b');}else{_0x7c1502['firstName']=_0x13dc4a[_0xa0a9('0x2c')]&&_0x13dc4a[_0xa0a9('0x2c')]!==''?_0x13dc4a[_0xa0a9('0x2c')]:_0xa0a9('0x2b');}return BPromise['resolve']()['then'](cmContactRpc[_0xa0a9('0x2d')](_0x7c1502))['then'](function(_0x5a1095){_0x33f54f=_0x5a1095;_0x51d5a5[_0xa0a9('0x2e')](_0x5a1095);if(_0x33f54f){logger[_0xa0a9('0x9')](_0xa0a9('0x2f'),_0x13dc4a[_0xa0a9('0x22')],_0x5ce7e9['id'],_0x33f54f['id']);}return;});}else{logger[_0xa0a9('0x9')](_0xa0a9('0x30'),_0x13dc4a[_0xa0a9('0x22')],_0x5ce7e9['id']);_0x7c1502[_0xe49d3b]=_['isNil'](_0x13dc4a[_0xa0a9('0x16')])?_0x13dc4a[_0xa0a9('0x17')]:_0x13dc4a['destcalleridnum'];if(_[_0xa0a9('0xf')](_0x13dc4a[_0xa0a9('0x16')])){_0x7c1502[_0xa0a9('0x18')]=_0x13dc4a['calleridname']&&_0x13dc4a['calleridname']!==_0xa0a9('0x2a')?_0x13dc4a[_0xa0a9('0x29')]:_0xa0a9('0x2b');}else{_0x7c1502[_0xa0a9('0x18')]=_0x13dc4a['destcalleridname']&&_0x13dc4a[_0xa0a9('0x2c')]!==_0xa0a9('0x2a')?_0x13dc4a[_0xa0a9('0x2c')]:'Unknown';}_0x33f54f=_0x7c1502;_0x51d5a5[_0xa0a9('0x2e')](_0x7c1502);return;}}})[_0xa0a9('0x31')](function(){if(_0x1b5bfb){emit(_0x13dc4a[_0xa0a9('0x22')],_0x5ce7e9,util['format'](_0xa0a9('0x32'),_0x1b5bfb[_0xa0a9('0x33')]),util[_0xa0a9('0x34')](_0xa0a9('0x35'),_0x5909cf[_0xa0a9('0x36')][_0xa0a9('0x37')]()),{'evt':_[_0xa0a9('0x38')](_0x13dc4a,{'autoCreate':_0x4b7913}),'contact':_0x33f54f===undefined?{}:_0x33f54f,'contacts':_0x51d5a5[_0xa0a9('0x20')]===0x0?undefined:_0x51d5a5});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4c37cb2..da947ea 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 _0x34c8=['data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','windowWidth','800','data5','windowHeight','data6','winapp','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','queue','script','parse','query','search','replace','checkTrigger','channel','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','event','agent','membername','lastevent','routeId','exports','util','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','socket.io-emitter','redis','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentringnoanswer','custom:agentcomplete','syncCustomEvent','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','stringify','motionChannel','undefined','checkTriggers','hasOwnProperty','status','merge','length','Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId'];(function(_0x2d69e1,_0x43f881){var _0x9b5140=function(_0x374b86){while(--_0x374b86){_0x2d69e1['push'](_0x2d69e1['shift']());}};_0x9b5140(++_0x43f881);}(_0x34c8,0xa3));var _0x834c=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x34c8[_0x344a3f];return _0x264712;};'use strict';var util=require(_0x834c('0x0'));var _=require('lodash');var url=require(_0x834c('0x1'));var Mustache=require('mustache');var Redis=require(_0x834c('0x2'));var urlforward=require(_0x834c('0x3'));var integration=require('./integration');var cmContact=require(_0x834c('0x4'));var script=require(_0x834c('0x5'));var config=require(_0x834c('0x6'));var logger=require(_0x834c('0x7'))('trigger');var ami=require(_0x834c('0x8'));config['redis']=_[_0x834c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x834c('0xa'))(new Redis(config[_0x834c('0xb')]));var operators={'equals':function(_0x46787f,_0xbb2f5d){return _0x46787f==_0xbb2f5d;},'not_equals':function(_0x3f60dd,_0x3c4730){return _0x3f60dd!=_0x3c4730;}};var barAndWebActions=[_0x834c('0xc'),_0x834c('0x1'),'winapp'];function Trigger(_0x1b23f6){this[_0x834c('0xd')]=_0x1b23f6[_0x834c('0xd')];this[_0x834c('0xe')]=_0x1b23f6[_0x834c('0xe')];this[_0x834c('0xf')]=_0x1b23f6[_0x834c('0xf')];this['templates']=_0x1b23f6[_0x834c('0x10')];this['voiceExtensions']=_0x1b23f6[_0x834c('0x11')];this[_0x834c('0x12')]=_0x1b23f6[_0x834c('0x12')];this[_0x834c('0x13')]=_0x1b23f6[_0x834c('0x13')];this[_0x834c('0x14')]=_0x1b23f6['salesforceAccounts'];this[_0x834c('0x15')]=_0x1b23f6[_0x834c('0x15')];this[_0x834c('0x16')]=_0x1b23f6['zohoAccounts'];this[_0x834c('0x17')]=_0x1b23f6['deskAccounts'];this[_0x834c('0x18')]=_0x1b23f6[_0x834c('0x18')];this[_0x834c('0x19')]=_0x1b23f6['servicenowAccounts'];this[_0x834c('0x1a')]=_0x1b23f6['dynamics365Accounts'];this[_0x834c('0x1b')]=_0x1b23f6[_0x834c('0x1b')];this[_0x834c('0x1c')]={'zendesk':this[_0x834c('0x12')],'salesforce':this[_0x834c('0x14')],'freshdesk':this[_0x834c('0x13')],'sugarcrm':this[_0x834c('0x15')],'zoho':this[_0x834c('0x16')],'desk':this[_0x834c('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x834c('0x1b')],'servicenow':this[_0x834c('0x19')]};ami['on'](_0x834c('0x1d'),this['syncCustomEvent'][_0x834c('0x1e')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x834c('0x1e')](this));ami['on'](_0x834c('0x1f'),this['syncCustomEvent'][_0x834c('0x1e')](this));ami['on'](_0x834c('0x20'),this[_0x834c('0x21')]['bind'](this));ami['on'](_0x834c('0x22'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x23'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x24'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x25'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x26'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x27'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x28'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x29'),this[_0x834c('0x2a')]['bind'](this));ami['on'](_0x834c('0x2b'),this[_0x834c('0x2a')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x2c'),this[_0x834c('0x2a')][_0x834c('0x1e')](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x834c('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on']('custom:substatus',this[_0x834c('0x21')]['bind'](this));ami['on'](_0x834c('0x2d'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on'](_0x834c('0x2e'),this['syncCustomEvent'][_0x834c('0x1e')](this));ami['on'](_0x834c('0x2f'),this[_0x834c('0x21')][_0x834c('0x1e')](this));ami['on']('custom:rejectmessage',this[_0x834c('0x21')][_0x834c('0x1e')](this));}Trigger[_0x834c('0x30')][_0x834c('0x31')]=function(_0x4df3e4,_0x3e9e00,_0x226c0d){logger['info'](_0x4df3e4,_0x3e9e00,JSON[_0x834c('0x32')](_0x226c0d));io['to'](_0x4df3e4)['emit'](_0x3e9e00,_0x226c0d);};Trigger[_0x834c('0x30')][_0x834c('0x21')]=function(_0x88a9b4){var _0x5cd8eb=_['clone'](_0x88a9b4);if(typeof _0x5cd8eb[_0x834c('0x33')]===_0x834c('0x34')){_0x5cd8eb[_0x834c('0x33')]='voice';}this[_0x834c('0x35')](_0x5cd8eb);};Trigger[_0x834c('0x30')][_0x834c('0x2a')]=function(_0x32a795){if(this[_0x834c('0xe')][_0x32a795['interface']]){this[_0x834c('0x21')](_0x32a795);}};Trigger[_0x834c('0x30')][_0x834c('0x35')]=function(_0x2b3f43){var _0x48b334;for(var _0x3f34c9 in this['triggers']){if(this[_0x834c('0xd')][_0x834c('0x36')](_0x3f34c9)){if(this['triggers'][_0x3f34c9][_0x834c('0x37')]){_0x48b334=this['checkTrigger'](this['triggers'][_0x3f34c9],_0x2b3f43);if(_0x48b334){_[_0x834c('0x38')](_0x2b3f43,_0x2b3f43['variables']);for(var _0x14661c=0x0,_0x413cc4,_0xdfaaf0,_0x236e8a;_0x14661c0x0){_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 +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x51f053,_0x5192e9){var _0x10727c=function(_0x54dfef){while(--_0x54dfef){_0x51f053['push'](_0x51f053['shift']());}};_0x10727c(++_0x5192e9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index c8a310c..53c3d6b 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 _0x75a8=['name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch','error','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled',']\x20Agent\x20found\x20',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','systemuserid','message','outbound','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','info','forEach','includes','string','picklist','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','/contacts(','callDirection','queue','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x19488e,_0x20ae6b){var _0x255e3d=function(_0x1ca994){while(--_0x1ca994){_0x19488e['push'](_0x19488e['shift']());}};_0x255e3d(++_0x20ae6b);}(_0x75a8,0x1f2));var _0x875a=function(_0x41b667,_0x560d84){_0x41b667=_0x41b667-0x0;var _0x37cca7=_0x75a8[_0x41b667];return _0x37cca7;};'use strict';var _=require(_0x875a('0x0'));var BPromise=require('bluebird');var rp=require(_0x875a('0x1'));var util=require(_0x875a('0x2'));var intUtil=require(_0x875a('0x3'));var md5=require(_0x875a('0x4'));var Redis=require(_0x875a('0x5'));var logger=require(_0x875a('0x6'))(_0x875a('0x7'));var config=require(_0x875a('0x8'));config[_0x875a('0x9')]=_['defaults'](config[_0x875a('0x9')],{'host':_0x875a('0xa'),'port':0x18eb});var io=require(_0x875a('0xb'))(new Redis(config[_0x875a('0x9')]));function getAuthToken(_0x288a46,_0x530839,_0x1f9002){var _0x313c21={'method':_0x875a('0xc'),'uri':_0x530839,'form':{'client_id':_0x288a46[_0x875a('0xd')],'resource':_0x288a46[_0x875a('0xe')],'username':_0x288a46[_0x875a('0xf')],'password':_0x288a46[_0x875a('0x10')],'grant_type':_0x875a('0x10'),'client_secret':_0x288a46['clientSecret']},'json':!![]};return rp(_0x313c21)[_0x875a('0x11')](function(_0x351f07){return _0x351f07[_0x875a('0x12')];})[_0x875a('0x13')](function(_0x1be538){logger[_0x875a('0x14')]('['+[_0x1f9002[_0x875a('0x15')]()]+']\x20Wrong\x20credentials!');return _0x1be538['message'];});}function getUser(_0x2e676b,_0xe5789f,_0x1bbab0,_0x5afdc2,_0x2712e4,_0x52efd3){return new BPromise(function(_0x374209,_0x12a975){return getAuthToken(_0xe5789f,_0x5afdc2,_0x52efd3)[_0x875a('0x11')](function(_0x12971e){var _0x1e1965={'method':_0x875a('0x16'),'uri':_0x2712e4+_0x875a('0x17'),'headers':{'Authorization':_0x875a('0x18')+_0x12971e,'OData-Version':_0x875a('0x19')},'json':!![]};return rp(_0x1e1965);})['then'](function(_0x37cb2c){var _0x564613=_0x37cb2c[_0x875a('0x1a')];var _0x44e2bd=![];var _0x5a1e52=null;if(!_[_0x875a('0x1b')](_0x1bbab0)){if(intUtil[_0x875a('0x1c')](_0x1bbab0[_0x875a('0x1d')])){_0x2e676b[_0x875a('0x1e')]=_0x1bbab0[_0x875a('0x1d')];for(_0x5a1e52=0x0;_0x5a1e52<_0x564613['length'];_0x5a1e52++){if(_0x564613[_0x5a1e52][_0x875a('0x1f')]===_0x1bbab0['email']&&!_0x564613[_0x5a1e52][_0x875a('0x20')]){_0x44e2bd=!![];logger['info']('['+[_0x52efd3[_0x875a('0x15')]()]+_0x875a('0x21')+_0x564613[_0x5a1e52]['systemuserid']+'!');_0x2e676b['userId']=_0x564613[_0x5a1e52]['systemuserid'];}}}}if(!_0x44e2bd){logger['info']('['+[_0x52efd3[_0x875a('0x15')]()]+_0x875a('0x22'));_0x2e676b[_0x875a('0x1e')]=_0xe5789f[_0x875a('0xf')];for(_0x5a1e52=0x0;_0x5a1e52<_0x564613[_0x875a('0x23')];_0x5a1e52++){if(_0x564613[_0x5a1e52][_0x875a('0x1f')]===_0xe5789f['username']){_0x2e676b[_0x875a('0x24')]=_0x564613[_0x5a1e52][_0x875a('0x25')];}}}_0x374209(_0x2e676b);})['catch'](function(_0x166366){_0x12a975(_0x166366[_0x875a('0x26')]);});});}function createEndUser(_0x28dfb8,_0x309629,_0xc0edc9,_0xb8ca26,_0x201795,_0x3fd154){return new BPromise(function(_0xe647b8,_0x52927e){return getAuthToken(_0x309629,_0xc0edc9,_0x3fd154)[_0x875a('0x11')](function(_0x419f7d){var _0x1baf1d=_0x3fd154['toLowerCase']()===_0x875a('0x27')?_0x201795[_0x875a('0x28')]:_0x201795[_0x875a('0x29')];var _0x364406={'method':_0x875a('0xc'),'uri':_0xb8ca26+'contacts','body':{'telephone1':_0x1baf1d,'fullname':_0x1baf1d,'firstname':_0x1baf1d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x875a('0x2a')+_0x28dfb8[_0x875a('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x419f7d,'OData-Version':_0x875a('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x364406);})['then'](function(_0x1661fa){var _0x5d2f49=_0x1661fa[_0x875a('0x2b')][_0x875a('0x2c')];var _0x45ae31=_0x5d2f49[_0x875a('0x2d')](_0x5d2f49[_0x875a('0x2e')]('(')+0x1,_0x5d2f49[_0x875a('0x2e')](')'));_0x28dfb8[_0x875a('0x2f')]=_0x45ae31;_0xe647b8(_0x28dfb8);})['catch'](function(_0x165699){_0x52927e(_0x165699[_0x875a('0x26')]);});});}function getEndUser(_0x2f2e3d,_0x16b457,_0x128fd1,_0x50712b,_0x4d01c9,_0x286498){return new BPromise(function(_0x32278d,_0x2d0765){var _0x342e8e=_0x286498[_0x875a('0x30')]()===_0x875a('0x27')?_0x4d01c9[_0x875a('0x28')]:_0x4d01c9['calleridnum'];return getAuthToken(_0x16b457,_0x128fd1,_0x286498)[_0x875a('0x11')](function(_0x2fecc2){var _0x2101f6={'method':_0x875a('0x16'),'uri':_0x50712b+_0x875a('0x31')+_0x342e8e[_0x875a('0x32')]('+','%2b')+'\x27','headers':{'Authorization':_0x875a('0x18')+_0x2fecc2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2101f6);})['then'](function(_0x29dbe5){var _0x4ee13e=null;if(_0x29dbe5){var _0x2bb4fc=_0x29dbe5[_0x875a('0x1a')];var _0x3c6638=![];for(_0x4ee13e=0x0;_0x4ee13e<_0x2bb4fc[_0x875a('0x23')];_0x4ee13e++){if(_0x2bb4fc[_0x4ee13e][_0x875a('0x33')]===_0x342e8e){_0x3c6638=!![];_0x2f2e3d[_0x875a('0x2f')]=_0x2bb4fc[_0x4ee13e]['contactid'];}}if(_0x3c6638){_0x32278d(_0x2f2e3d);}else{return createEndUser(_0x2f2e3d,_0x16b457,_0x128fd1,_0x50712b,_0x4d01c9,_0x286498)[_0x875a('0x11')](function(_0x21669d){logger[_0x875a('0x34')]('['+[_0x286498[_0x875a('0x15')]()]+']\x20Enduser\x20created!',_0x21669d[_0x875a('0x2f')]);_0x32278d(_0x21669d);});}}else{return createEndUser(_0x2f2e3d,_0x16b457,_0x128fd1,_0x50712b,_0x4d01c9,_0x286498)[_0x875a('0x11')](function(_0x521140){logger[_0x875a('0x34')]('['+[_0x286498['toUpperCase']()]+']\x20Enduser\x20Created!',_0x521140['enduserId']);_0x32278d(_0x521140);});}});});}function getCustomFields(_0x1b177d,_0x344fc4,_0x2a2251){var _0x25e1bb={};if(_0x1b177d['length']>0x0){_[_0x875a('0x35')](_0x1b177d,function(_0x46e7c1){if(_[_0x875a('0x36')]([_0x875a('0x37'),_0x875a('0x38')],_0x46e7c1['type'])&&_0x46e7c1[_0x875a('0x39')]&&!_0x46e7c1['customField']){var _0x5dd2fb=_0x46e7c1['idField'][_0x875a('0x30')]();var _0x1fdd3d=_0x5dd2fb[_0x875a('0x2d')](0x0,_0x5dd2fb[_0x875a('0x3a')]('_'));var _0x31ea36=_0x5dd2fb[_0x875a('0x2d')](_0x5dd2fb['indexOf']('_')+0x1);if(_0x1fdd3d===_0x2a2251){_0x25e1bb[_0x31ea36]=_0x46e7c1[_0x875a('0x3b')];}}});}return _0x25e1bb;}function getTicket(_0x572969,_0x1a10ba,_0x531946,_0x4facf7,_0x14e99b,_0x158190,_0x1ba1b5){return new BPromise(function(_0x3e2ec6,_0x1c5002){var _0x22564e;return getAuthToken(_0x1a10ba,_0x531946,_0x1ba1b5)[_0x875a('0x11')](function(_0x408e96){if(_0x158190[_0x875a('0x3c')]===_0x875a('0x3d')){_0x22564e={'method':_0x875a('0xc'),'uri':_0x4facf7+_0x875a('0x3e'),'body':Object[_0x875a('0x3f')]({},{'title':intUtil[_0x875a('0x40')](_0x158190[_0x875a('0x41')],_0x14e99b,'\x20'),'description':intUtil['getString'](_0x158190[_0x875a('0x42')],_0x14e99b,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x572969[_0x875a('0x2f')]+')','ownerid@odata.bind':_0x875a('0x2a')+_0x572969[_0x875a('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x158190[_0x875a('0x43')],_0x14e99b,_0x158190[_0x875a('0x3c')])),'headers':{'Authorization':_0x875a('0x18')+_0x408e96,'OData-Version':_0x875a('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x158190[_0x875a('0x3c')]===_0x875a('0x44')){_0x22564e={'method':_0x875a('0xc'),'uri':_0x4facf7+_0x875a('0x45'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x158190[_0x875a('0x41')],_0x14e99b,'\x20'),'phonenumber':String(_0x14e99b[_0x875a('0x29')]),'description':intUtil[_0x875a('0x40')](_0x158190[_0x875a('0x42')],_0x14e99b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x875a('0x46')+_0x572969[_0x875a('0x2f')]+')','ownerid@odata.bind':_0x875a('0x2a')+_0x572969[_0x875a('0x24')]+')','directioncode':_0x572969[_0x875a('0x47')]===_0x875a('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x572969[_0x875a('0x24')]+')','participationtypemask':_0x572969[_0x875a('0x47')]===_0x875a('0x48')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x572969[_0x875a('0x2f')]+')','participationtypemask':_0x572969[_0x875a('0x47')]===_0x875a('0x48')?0x1:0x2}]},getCustomFields(_0x158190[_0x875a('0x43')],_0x14e99b,_0x158190[_0x875a('0x3c')])),'headers':{'Authorization':_0x875a('0x18')+_0x408e96,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x22564e);})[_0x875a('0x11')](function(_0xb48472){var _0xbbf07f=_0xb48472[_0x875a('0x2b')][_0x875a('0x2c')];var _0x51dc42=_0xbbf07f[_0x875a('0x2d')](_0xbbf07f[_0x875a('0x2e')]('(')+0x1,_0xbbf07f[_0x875a('0x2e')](')'));_0x572969[_0x875a('0x49')]=_0x51dc42;_0x3e2ec6(_0x572969);})[_0x875a('0x13')](function(_0x20ef99){_0x1c5002(_0x20ef99['message']);});});}function emit(_0x2272d8,_0x133f1e,_0x4f00da,_0x2ceffb){var _0x41a8b8={'uri':util[_0x875a('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2272d8,_0x4f00da,_0x2ceffb)};io['to'](util[_0x875a('0x4a')](_0x875a('0x4b'),_0x133f1e))['emit'](_0x875a('0x4c'),_0x41a8b8);}exports['cs']=function(_0xe6fa9,_0x1f7f18,_0x1f1c9c,_0x2f8a51,_0x4048db,_0x589219,_0x250656,_0x18a939){var _0x961d64={};_0x589219['remoteUri']=intUtil[_0x875a('0x4d')](_0x589219[_0x875a('0xe')]);_0x589219[_0x875a('0x4e')]=intUtil[_0x875a('0x4d')](_0x589219[_0x875a('0x4e')]);_0x961d64['callDirection']=_0x18a939==='queue'||_0x18a939==='unmanaged'?_0x875a('0x48'):_0x875a('0x27');var _0x3f0beb=util[_0x875a('0x4a')](_0x875a('0x4f'),_0x589219['remoteUri']);var _0x400b58=util['format'](_0x875a('0x50'),_0x589219[_0x875a('0x51')]);var _0x1330cf=util[_0x875a('0x4a')](_0x875a('0x52'),_0x589219[_0x875a('0x4e')],_0x1f7f18['uniqueid'],md5(_0x1f7f18['uniqueid']));if(_0x4048db&&_0x4048db[_0x875a('0x53')]){logger[_0x875a('0x34')](_0x875a('0x54'),_0x875a('0x55'));_0x1f7f18['recordingURL']=_0x1330cf;}else if(_0x250656&&_0x250656[_0x875a('0x56')]&&_0x250656[_0x875a('0x56')]!==_0x875a('0x57')){logger[_0x875a('0x34')](_0x875a('0x58'),'Recording\x20is\x20enabled!');_0x1f7f18['recordingURL']=_0x1330cf;}else{_0x1f7f18['recordingURL']='';}return getUser(_0x961d64,_0x589219,_0x2f8a51,_0x400b58,_0x3f0beb,_0x18a939)['then'](function(_0x23eb2d){logger[_0x875a('0x34')]('['+_0x18a939[_0x875a('0x15')]()+_0x875a('0x59'),_0x23eb2d[_0x875a('0x24')]);logger['info']('['+_0x18a939[_0x875a('0x15')]()+_0x875a('0x5a'),_0x23eb2d[_0x875a('0x1e')]);return getEndUser(_0x23eb2d,_0x589219,_0x400b58,_0x3f0beb,_0x1f7f18,_0x18a939);})[_0x875a('0x11')](function(_0x5e6694){logger[_0x875a('0x34')]('['+_0x18a939[_0x875a('0x15')]()+_0x875a('0x5b'),_0x5e6694[_0x875a('0x2f')]);logger[_0x875a('0x34')]('['+_0x18a939['toUpperCase']()+_0x875a('0x5c'),_0x1f7f18[_0x875a('0x29')]);return getTicket(_0x5e6694,_0x589219,_0x400b58,_0x3f0beb,_0x1f7f18,_0x1f1c9c,_0x18a939);})[_0x875a('0x11')](function(_0x5c821e){logger[_0x875a('0x34')](util[_0x875a('0x4a')]('['+_0x18a939[_0x875a('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1f1c9c[_0x875a('0x3c')],_0x5c821e['ticketId']));logger['info'](util[_0x875a('0x4a')]('['+_0x18a939[_0x875a('0x15')]()+_0x875a('0x5d'),_0x18a939));if(_0x18a939!==_0x875a('0x5e')){logger[_0x875a('0x34')]('['+_0x18a939['toUpperCase']()+']',_0x875a('0x5f'));emit(_0x589219['remoteUri'],_0x2f8a51[_0x875a('0x60')],_0x1f1c9c[_0x875a('0x3c')],_0x5c821e[_0x875a('0x49')]);}})[_0x875a('0x13')](function(_0x37e91f){logger['error']('['+_0x18a939[_0x875a('0x15')]()+_0x875a('0x61'),util[_0x875a('0x62')](_0x37e91f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc586=['then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','calleridnum','POST','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','replace','%2b','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','username','password','clientSecret'];(function(_0x10eb6b,_0x3fe155){var _0x3a3ab1=function(_0x467f24){while(--_0x467f24){_0x10eb6b['push'](_0x10eb6b['shift']());}};_0x3a3ab1(++_0x3fe155);}(_0xc586,0xbb));var _0x6c58=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xc586[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x6c58('0x0'));var BPromise=require('bluebird');var rp=require(_0x6c58('0x1'));var util=require('util');var intUtil=require(_0x6c58('0x2'));var md5=require(_0x6c58('0x3'));var Redis=require(_0x6c58('0x4'));var logger=require(_0x6c58('0x5'))(_0x6c58('0x6'));var config=require(_0x6c58('0x7'));config[_0x6c58('0x8')]=_[_0x6c58('0x9')](config[_0x6c58('0x8')],{'host':_0x6c58('0xa'),'port':0x18eb});var io=require(_0x6c58('0xb'))(new Redis(config['redis']));function getAuthToken(_0x6f205d,_0x54fa20,_0x2f7310){var _0x3ec854={'method':'POST','uri':_0x54fa20,'form':{'client_id':_0x6f205d['clientId'],'resource':_0x6f205d['remoteUri'],'username':_0x6f205d[_0x6c58('0xc')],'password':_0x6f205d[_0x6c58('0xd')],'grant_type':_0x6c58('0xd'),'client_secret':_0x6f205d[_0x6c58('0xe')]},'json':!![]};return rp(_0x3ec854)[_0x6c58('0xf')](function(_0x29c1c4){return _0x29c1c4[_0x6c58('0x10')];})[_0x6c58('0x11')](function(_0x3b3eba){logger[_0x6c58('0x12')]('['+[_0x2f7310[_0x6c58('0x13')]()]+_0x6c58('0x14'));return _0x3b3eba[_0x6c58('0x15')];});}function getUser(_0x57636e,_0x2238ac,_0xd673b0,_0x42c8a3,_0x52ebab,_0x18b294){return new BPromise(function(_0xec28e,_0x2ce95c){return getAuthToken(_0x2238ac,_0x42c8a3,_0x18b294)['then'](function(_0x13ca9f){var _0x55ae73={'method':_0x6c58('0x16'),'uri':_0x52ebab+_0x6c58('0x17'),'headers':{'Authorization':_0x6c58('0x18')+_0x13ca9f,'OData-Version':_0x6c58('0x19')},'json':!![]};return rp(_0x55ae73);})['then'](function(_0x26981f){var _0x2ed20b=_0x26981f['value'];var _0xfc6f1=![];var _0x29cecf=null;if(!_[_0x6c58('0x1a')](_0xd673b0)){if(intUtil[_0x6c58('0x1b')](_0xd673b0['email'])){_0x57636e['userEmail']=_0xd673b0['email'];for(_0x29cecf=0x0;_0x29cecf<_0x2ed20b[_0x6c58('0x1c')];_0x29cecf++){if(_0x2ed20b[_0x29cecf][_0x6c58('0x1d')]===_0xd673b0[_0x6c58('0x1e')]&&!_0x2ed20b[_0x29cecf][_0x6c58('0x1f')]){_0xfc6f1=!![];logger[_0x6c58('0x20')]('['+[_0x18b294[_0x6c58('0x13')]()]+_0x6c58('0x21')+_0x2ed20b[_0x29cecf][_0x6c58('0x22')]+'!');_0x57636e[_0x6c58('0x23')]=_0x2ed20b[_0x29cecf][_0x6c58('0x22')];}}}}if(!_0xfc6f1){logger[_0x6c58('0x20')]('['+[_0x18b294[_0x6c58('0x13')]()]+_0x6c58('0x24'));_0x57636e[_0x6c58('0x25')]=_0x2238ac[_0x6c58('0xc')];for(_0x29cecf=0x0;_0x29cecf<_0x2ed20b['length'];_0x29cecf++){if(_0x2ed20b[_0x29cecf][_0x6c58('0x1d')]===_0x2238ac[_0x6c58('0xc')]){_0x57636e['userId']=_0x2ed20b[_0x29cecf]['systemuserid'];}}}_0xec28e(_0x57636e);})['catch'](function(_0x548f4c){_0x2ce95c(_0x548f4c['message']);});});}function createEndUser(_0x14b9cc,_0x57cdc7,_0x797e3b,_0x1139cf,_0x4f1ce4,_0x4ee634){return new BPromise(function(_0x27afb4,_0x53441e){return getAuthToken(_0x57cdc7,_0x797e3b,_0x4ee634)[_0x6c58('0xf')](function(_0x3bb7ad){var _0x212d91=_0x4ee634['toLowerCase']()===_0x6c58('0x26')?_0x4f1ce4['destcalleridnum']:_0x4f1ce4[_0x6c58('0x27')];var _0x5ab0f7={'method':_0x6c58('0x28'),'uri':_0x1139cf+_0x6c58('0x29'),'body':{'telephone1':_0x212d91,'fullname':_0x212d91,'firstname':_0x212d91,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6c58('0x2a')+_0x14b9cc['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x3bb7ad,'OData-Version':_0x6c58('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5ab0f7);})[_0x6c58('0xf')](function(_0x4ad556){var _0x5888f3=_0x4ad556[_0x6c58('0x2b')][_0x6c58('0x2c')];var _0x4080ac=_0x5888f3[_0x6c58('0x2d')](_0x5888f3[_0x6c58('0x2e')]('(')+0x1,_0x5888f3[_0x6c58('0x2e')](')'));_0x14b9cc[_0x6c58('0x2f')]=_0x4080ac;_0x27afb4(_0x14b9cc);})[_0x6c58('0x11')](function(_0x5333c8){_0x53441e(_0x5333c8[_0x6c58('0x15')]);});});}function getEndUser(_0x3d9598,_0x4d9315,_0x5dfd9c,_0x48d59c,_0x250f26,_0x595f18){return new BPromise(function(_0x425a6e,_0x4ea801){var _0xe3031c=_0x595f18[_0x6c58('0x30')]()==='outbound'?_0x250f26[_0x6c58('0x31')]:_0x250f26[_0x6c58('0x27')];return getAuthToken(_0x4d9315,_0x5dfd9c,_0x595f18)[_0x6c58('0xf')](function(_0xd8fc2b){var _0x4ef3fa={'method':_0x6c58('0x16'),'uri':_0x48d59c+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0xe3031c[_0x6c58('0x32')]('+',_0x6c58('0x33'))+'\x27','headers':{'Authorization':_0x6c58('0x18')+_0xd8fc2b,'If-None-Match':null,'OData-Version':_0x6c58('0x19')},'json':!![]};return rp(_0x4ef3fa);})[_0x6c58('0xf')](function(_0x4c784a){var _0xee5e07=null;if(_0x4c784a){var _0x22b775=_0x4c784a['value'];var _0x3a3da4=![];for(_0xee5e07=0x0;_0xee5e07<_0x22b775[_0x6c58('0x1c')];_0xee5e07++){if(_0x22b775[_0xee5e07][_0x6c58('0x34')]===_0xe3031c){_0x3a3da4=!![];_0x3d9598[_0x6c58('0x2f')]=_0x22b775[_0xee5e07]['contactid'];}}if(_0x3a3da4){_0x425a6e(_0x3d9598);}else{return createEndUser(_0x3d9598,_0x4d9315,_0x5dfd9c,_0x48d59c,_0x250f26,_0x595f18)[_0x6c58('0xf')](function(_0x5db216){logger[_0x6c58('0x20')]('['+[_0x595f18[_0x6c58('0x13')]()]+_0x6c58('0x35'),_0x5db216[_0x6c58('0x2f')]);_0x425a6e(_0x5db216);});}}else{return createEndUser(_0x3d9598,_0x4d9315,_0x5dfd9c,_0x48d59c,_0x250f26,_0x595f18)[_0x6c58('0xf')](function(_0x4f5207){logger[_0x6c58('0x20')]('['+[_0x595f18['toUpperCase']()]+_0x6c58('0x36'),_0x4f5207[_0x6c58('0x2f')]);_0x425a6e(_0x4f5207);});}});});}function getCustomFields(_0x5392ad,_0x3cda30,_0x695b5d){var _0x990f01={};if(_0x5392ad[_0x6c58('0x1c')]>0x0){_[_0x6c58('0x37')](_0x5392ad,function(_0x13af65){if(_[_0x6c58('0x38')]([_0x6c58('0x39'),'picklist'],_0x13af65[_0x6c58('0x3a')])&&_0x13af65['nameField']&&!_0x13af65['customField']){var _0x3bb79e=_0x13af65[_0x6c58('0x3b')][_0x6c58('0x30')]();var _0x339d33=_0x3bb79e[_0x6c58('0x2d')](0x0,_0x3bb79e[_0x6c58('0x3c')]('_'));var _0x3a7b7c=_0x3bb79e[_0x6c58('0x2d')](_0x3bb79e['indexOf']('_')+0x1);if(_0x339d33===_0x695b5d){_0x990f01[_0x3a7b7c]=_0x13af65[_0x6c58('0x3d')];}}});}return _0x990f01;}function getTicket(_0x171ed7,_0x2ca3f4,_0x2df4ad,_0x251b49,_0x402e38,_0x5c5059,_0x4a6fa6){return new BPromise(function(_0x90cbfc,_0x931fdb){var _0x16b5ac;return getAuthToken(_0x2ca3f4,_0x2df4ad,_0x4a6fa6)[_0x6c58('0xf')](function(_0x267071){if(_0x5c5059[_0x6c58('0x3e')]===_0x6c58('0x3f')){_0x16b5ac={'method':_0x6c58('0x28'),'uri':_0x251b49+_0x6c58('0x40'),'body':Object[_0x6c58('0x41')]({},{'title':intUtil[_0x6c58('0x42')](_0x5c5059[_0x6c58('0x43')],_0x402e38,'\x20'),'description':intUtil[_0x6c58('0x42')](_0x5c5059['Descriptions'],_0x402e38,'\x0a'),'customerid_contact@odata.bind':_0x6c58('0x44')+_0x171ed7[_0x6c58('0x2f')]+')','ownerid@odata.bind':_0x6c58('0x2a')+_0x171ed7[_0x6c58('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x5c5059[_0x6c58('0x45')],_0x402e38,_0x5c5059[_0x6c58('0x3e')])),'headers':{'Authorization':_0x6c58('0x18')+_0x267071,'OData-Version':_0x6c58('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5c5059[_0x6c58('0x3e')]===_0x6c58('0x46')){_0x16b5ac={'method':_0x6c58('0x28'),'uri':_0x251b49+_0x6c58('0x47'),'body':Object[_0x6c58('0x41')]({},{'subject':intUtil[_0x6c58('0x42')](_0x5c5059[_0x6c58('0x43')],_0x402e38,'\x20'),'phonenumber':String(_0x402e38[_0x6c58('0x27')]),'description':intUtil[_0x6c58('0x42')](_0x5c5059['Descriptions'],_0x402e38,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c58('0x44')+_0x171ed7[_0x6c58('0x2f')]+')','ownerid@odata.bind':_0x6c58('0x2a')+_0x171ed7[_0x6c58('0x23')]+')','directioncode':_0x171ed7[_0x6c58('0x48')]===_0x6c58('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6c58('0x2a')+_0x171ed7[_0x6c58('0x23')]+')','participationtypemask':_0x171ed7[_0x6c58('0x48')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x6c58('0x44')+_0x171ed7[_0x6c58('0x2f')]+')','participationtypemask':_0x171ed7['callDirection']===_0x6c58('0x49')?0x1:0x2}]},getCustomFields(_0x5c5059['Fields'],_0x402e38,_0x5c5059[_0x6c58('0x3e')])),'headers':{'Authorization':_0x6c58('0x18')+_0x267071,'OData-Version':_0x6c58('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x16b5ac);})[_0x6c58('0xf')](function(_0x225226){var _0x579c3e=_0x225226['headers']['odata-entityid'];var _0x343287=_0x579c3e['substring'](_0x579c3e[_0x6c58('0x2e')]('(')+0x1,_0x579c3e[_0x6c58('0x2e')](')'));_0x171ed7[_0x6c58('0x4a')]=_0x343287;_0x90cbfc(_0x171ed7);})[_0x6c58('0x11')](function(_0x4174c6){_0x931fdb(_0x4174c6[_0x6c58('0x15')]);});});}function emit(_0x3f7012,_0x24d3dd,_0x209974,_0x2a591c){var _0x6f8a6b={'uri':util[_0x6c58('0x4b')](_0x6c58('0x4c'),_0x3f7012,_0x209974,_0x2a591c)};io['to'](util[_0x6c58('0x4b')](_0x6c58('0x4d'),_0x24d3dd))['emit'](_0x6c58('0x4e'),_0x6f8a6b);}exports['cs']=function(_0x4b2d32,_0x1ec25e,_0x36583c,_0x39e816,_0x1804d9,_0x1175fb,_0x4450aa,_0x214c20){var _0x5d7965={};_0x1175fb[_0x6c58('0x4f')]=intUtil[_0x6c58('0x50')](_0x1175fb['remoteUri']);_0x1175fb[_0x6c58('0x51')]=intUtil[_0x6c58('0x50')](_0x1175fb[_0x6c58('0x51')]);_0x5d7965['callDirection']=_0x214c20==='queue'||_0x214c20===_0x6c58('0x52')?_0x6c58('0x49'):_0x6c58('0x26');var _0x9f334=util['format'](_0x6c58('0x53'),_0x1175fb['remoteUri']);var _0x2a425d=util[_0x6c58('0x4b')](_0x6c58('0x54'),_0x1175fb[_0x6c58('0x55')]);var _0x2260d0=util[_0x6c58('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1175fb[_0x6c58('0x51')],_0x1ec25e[_0x6c58('0x56')],md5(_0x1ec25e[_0x6c58('0x56')]));if(_0x1804d9&&_0x1804d9[_0x6c58('0x57')]){logger[_0x6c58('0x20')](_0x6c58('0x58'),_0x6c58('0x59'));_0x1ec25e['recordingURL']=_0x2260d0;}else if(_0x4450aa&&_0x4450aa[_0x6c58('0x5a')]&&_0x4450aa[_0x6c58('0x5a')]!==_0x6c58('0x5b')){logger[_0x6c58('0x20')](_0x6c58('0x5c'),_0x6c58('0x59'));_0x1ec25e['recordingURL']=_0x2260d0;}else{_0x1ec25e[_0x6c58('0x5d')]='';}return getUser(_0x5d7965,_0x1175fb,_0x39e816,_0x2a425d,_0x9f334,_0x214c20)['then'](function(_0x563f6c){logger['info']('['+_0x214c20[_0x6c58('0x13')]()+_0x6c58('0x5e'),_0x563f6c['userId']);logger['info']('['+_0x214c20[_0x6c58('0x13')]()+_0x6c58('0x5f'),_0x563f6c['userEmail']);return getEndUser(_0x563f6c,_0x1175fb,_0x2a425d,_0x9f334,_0x1ec25e,_0x214c20);})[_0x6c58('0xf')](function(_0x226c04){logger[_0x6c58('0x20')]('['+_0x214c20[_0x6c58('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x226c04[_0x6c58('0x2f')]);logger[_0x6c58('0x20')]('['+_0x214c20[_0x6c58('0x13')]()+_0x6c58('0x60'),_0x1ec25e[_0x6c58('0x27')]);return getTicket(_0x226c04,_0x1175fb,_0x2a425d,_0x9f334,_0x1ec25e,_0x36583c,_0x214c20);})[_0x6c58('0xf')](function(_0x42dbb4){logger[_0x6c58('0x20')](util[_0x6c58('0x4b')]('['+_0x214c20[_0x6c58('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x36583c[_0x6c58('0x3e')],_0x42dbb4[_0x6c58('0x4a')]));logger[_0x6c58('0x20')](util[_0x6c58('0x4b')]('['+_0x214c20[_0x6c58('0x13')]()+_0x6c58('0x61'),_0x214c20));if(_0x214c20!==_0x6c58('0x52')){logger[_0x6c58('0x20')]('['+_0x214c20[_0x6c58('0x13')]()+']',_0x6c58('0x62'));emit(_0x1175fb['remoteUri'],_0x39e816[_0x6c58('0x63')],_0x36583c[_0x6c58('0x3e')],_0x42dbb4[_0x6c58('0x4a')]);}})[_0x6c58('0x11')](function(_0x264b0d){logger[_0x6c58('0x12')]('['+_0x214c20[_0x6c58('0x13')]()+_0x6c58('0x64'),util['inspect'](_0x264b0d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 3521f2b..a9fd4ee 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 _0xb139=['destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','info','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','picklist','type','nameField','customField','content','includes','push','variable','idField','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname'];(function(_0x1488e0,_0x2081ff){var _0x9ca7a=function(_0x26b430){while(--_0x26b430){_0x1488e0['push'](_0x1488e0['shift']());}};_0x9ca7a(++_0x2081ff);}(_0xb139,0x11d));var _0x9b13=function(_0x5fcd80,_0x1d6165){_0x5fcd80=_0x5fcd80-0x0;var _0x401201=_0xb139[_0x5fcd80];return _0x401201;};'use strict';var _=require(_0x9b13('0x0'));var rp=require(_0x9b13('0x1'));var md5=require(_0x9b13('0x2'));var util=require(_0x9b13('0x3'));var Redis=require(_0x9b13('0x4'));var intUtil=require(_0x9b13('0x5'));var config=require('../../../../config/environment');var logger=require(_0x9b13('0x6'))(_0x9b13('0x7'));config[_0x9b13('0x8')]=_[_0x9b13('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9b13('0xa'))(new Redis(config[_0x9b13('0x8')]));var headers={'Content-Type':_0x9b13('0xb'),'Accept':_0x9b13('0xb')};function emit(_0x36a370,_0x97ccb3,_0x4fc19a){io['to'](_0x36a370)['emit'](_0x97ccb3,_0x4fc19a);}function getTicket(_0x2682e6,_0x22cbd5,_0x19b17f,_0x570fbb,_0x1cdbda){logger['info'](_0x9b13('0xc'));var _0x136d5a=_[_0x9b13('0xd')]({'responder_id':_0x22cbd5['id'],'requester_id':_0x19b17f['id'],'name':util[_0x9b13('0xe')]('Caller\x20-\x20%s',_0x1cdbda[_0x9b13('0xf')]),'phone':_0x1cdbda[_0x9b13('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9b13('0x11')](_0x570fbb[_0x9b13('0x12')],_0x1cdbda,'\x20'),'description':intUtil[_0x9b13('0x11')](_0x570fbb[_0x9b13('0x13')],_0x1cdbda,_0x9b13('0x14')),'tags':getTags(_0x570fbb[_0x9b13('0x15')],_0x9b13('0x16'))},getCustomFields(_0x570fbb[_0x9b13('0x17')],_0x1cdbda));_0x136d5a['custom_fields']=_['mapValues'](_['keyBy'](_0x136d5a[_0x9b13('0x18')],'id'),'value');return request({'uri':util[_0x9b13('0xe')]('%s/api/v2/tickets',_0x2682e6[_0x9b13('0x19')]),'method':_0x9b13('0x1a'),'body':_0x136d5a})[_0x9b13('0x1b')](function(_0x4e6130){logger['info'](_0x9b13('0x1c'));return _0x4e6130;});}function getUser(_0x8a5242,_0x29ed47){if(intUtil[_0x9b13('0x1d')](_0x29ed47)){return request({'uri':util[_0x9b13('0xe')]('%s/api/v2/agents',_0x8a5242[_0x9b13('0x19')]),'qs':{'email':_0x29ed47}})[_0x9b13('0x1b')](function(_0x13f9db){if(_0x13f9db[_0x9b13('0x1e')]){logger[_0x9b13('0x1f')](_0x9b13('0x20'));return _['find'](_0x13f9db,function(_0x41ac8d){return _0x41ac8d[_0x9b13('0x21')][_0x9b13('0x22')]===_0x29ed47;});}else{logger[_0x9b13('0x1f')](_0x9b13('0x23'));return request({'uri':util['format'](_0x9b13('0x24'),_0x8a5242[_0x9b13('0x19')])})[_0x9b13('0x1b')](function(_0x4a160b){logger[_0x9b13('0x1f')](_0x9b13('0x25'));return _0x4a160b;});}});}else{logger[_0x9b13('0x1f')](_0x9b13('0x26'));return request({'uri':util[_0x9b13('0xe')]('%s/api/v2/agents/me',_0x8a5242[_0x9b13('0x19')])})[_0x9b13('0x1b')](function(_0x2cda59){logger[_0x9b13('0x1f')]('Admin\x20account\x20selected.');return _0x2cda59;});}}function getEndUser(_0x5e8669,_0x29c4e6,_0xca8974){logger['info'](_0x9b13('0x27'),_0xca8974);return request({'uri':util[_0x9b13('0xe')](_0x9b13('0x28'),_0x5e8669[_0x9b13('0x19')]),'qs':{'phone':_0xca8974}})['then'](function(_0x393f59){if(_0x393f59[_0x9b13('0x1e')]){logger[_0x9b13('0x1f')](_0x9b13('0x29'));return _['find'](_0x393f59,{'phone':_0xca8974});}else{logger[_0x9b13('0x1f')](_0x9b13('0x2a'));return request({'uri':util[_0x9b13('0xe')](_0x9b13('0x28'),_0x5e8669[_0x9b13('0x19')]),'method':'POST','body':{'name':_0x29c4e6,'phone':_0xca8974}})['then'](function(_0x25f1fa){logger[_0x9b13('0x1f')](_0x9b13('0x2b'));return _0x25f1fa;});}});}function getAuth(_0x4dd7cc){return util[_0x9b13('0xe')](_0x9b13('0x2c'),new Buffer(_0x4dd7cc['apiKey']+':X')[_0x9b13('0x2d')](_0x9b13('0x2e')));}function request(_0x3a2835){logger[_0x9b13('0x2f')](_0x9b13('0x30'),JSON[_0x9b13('0x31')](_0x3a2835));return rp(_[_0x9b13('0x9')](_0x3a2835,{'method':_0x9b13('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x11220d,_0x3946e3){var _0x2a58ab=[];if(_0x11220d&&_0x11220d[_0x9b13('0x1e')]>0x0){_0x2a58ab=_[_0x9b13('0x33')](_0x11220d,_0x3946e3);}return _0x2a58ab;}function getCustomFields(_0x55c056,_0x380bfa){var _0x1cec27=[];var _0xc2e4ac={'custom_fields':[]};if(_0x55c056[_0x9b13('0x1e')]>0x0){_[_0x9b13('0x34')](_0x55c056,function(_0x15f1e4){if(_['includes'](['string',_0x9b13('0x35')],_0x15f1e4[_0x9b13('0x36')])&&_0x15f1e4[_0x9b13('0x37')]&&!_0x15f1e4[_0x9b13('0x38')]){_0xc2e4ac[_0x15f1e4[_0x9b13('0x37')]['toLowerCase']()]=_0x15f1e4[_0x9b13('0x39')][_0x9b13('0x2d')]();}else if(_[_0x9b13('0x3a')](['string',_0x9b13('0x35')],_0x15f1e4[_0x9b13('0x36')])&&_0x15f1e4['idField']&&_0x15f1e4[_0x9b13('0x38')]){_0xc2e4ac[_0x9b13('0x18')][_0x9b13('0x3b')]({'id':_0x15f1e4['idField'],'value':_0x15f1e4[_0x9b13('0x39')][_0x9b13('0x2d')]()});}else if(_0x15f1e4['type']===_0x9b13('0x3c')&&_0x15f1e4['variableName']&&_0x15f1e4[_0x9b13('0x3d')]&&_0x15f1e4[_0x9b13('0x38')]){_0x380bfa[_0x15f1e4[_0x9b13('0x3e')]]&&_0xc2e4ac['custom_fields'][_0x9b13('0x3b')]({'id':_0x15f1e4[_0x9b13('0x3d')],'value':_0x380bfa[_0x15f1e4[_0x9b13('0x3e')]][_0x9b13('0x2d')]()});}else if(_0x15f1e4[_0x9b13('0x36')]==='customVariable'&&_0x15f1e4['Variable']&&_0x15f1e4[_0x9b13('0x3f')][_0x9b13('0x16')]&&_0x15f1e4['idField']&&_0x15f1e4['customField']){_0x380bfa[_0x15f1e4[_0x9b13('0x3f')][_0x9b13('0x16')][_0x9b13('0x40')]()]&&_0xc2e4ac['custom_fields'][_0x9b13('0x3b')]({'id':_0x15f1e4[_0x9b13('0x3d')],'value':_0x380bfa[_0x15f1e4[_0x9b13('0x3f')][_0x9b13('0x16')][_0x9b13('0x40')]()][_0x9b13('0x2d')]()});}});}return _0xc2e4ac;}exports[_0x9b13('0x41')]=function(_0x1d0914,_0x43b28b,_0x4c8f58,_0xa265ac,_0x3b55ab,_0x8df00f){var _0x3415e5,_0x3dc2cc;_0x8df00f[_0x9b13('0x19')]=intUtil[_0x9b13('0x42')](_0x8df00f[_0x9b13('0x19')]);_0x8df00f['serverUrl']=intUtil[_0x9b13('0x42')](_0x8df00f[_0x9b13('0x43')]);if(_0x3b55ab&&_0x3b55ab[_0x9b13('0x44')]){logger[_0x9b13('0x1f')](_0x9b13('0x45'),_0x9b13('0x46'));_0x43b28b['recordingURL']=util[_0x9b13('0xe')](_0x9b13('0x47'),_0x8df00f[_0x9b13('0x43')],_0x43b28b[_0x9b13('0x48')],md5(_0x43b28b['uniqueid']));}else{_0x43b28b[_0x9b13('0x49')]='';}headers[_0x9b13('0x4a')]=getAuth(_0x8df00f);return getUser(_0x8df00f,_0xa265ac[_0x9b13('0x22')])['then'](function(_0x30de54){_0x3415e5=_0x30de54;logger[_0x9b13('0x1f')](_0x9b13('0x4b'),_0x3415e5['id']);return getEndUser(_0x8df00f,_0x43b28b[_0x9b13('0xf')],_0x43b28b[_0x9b13('0x10')]);})[_0x9b13('0x1b')](function(_0x559547){_0x3dc2cc=_0x559547;logger[_0x9b13('0x1f')]('The\x20Enduser\x20ID\x20is:',_0x3dc2cc['id']);return getTicket(_0x8df00f,_0x3415e5,_0x3dc2cc,_0x4c8f58,_0x43b28b);})['then'](function(_0x243ea9){if(_0x243ea9&&_0x243ea9['id']){logger[_0x9b13('0x1f')](_0x9b13('0x1c'));logger[_0x9b13('0x1f')](_0x9b13('0x4c'),_0x243ea9['id']);logger[_0x9b13('0x1f')](_0x9b13('0x45'),_0x9b13('0x4d'));emit(util[_0x9b13('0xe')](_0x9b13('0x4e'),_0xa265ac['name']),'trigger:browser:url',{'uri':util[_0x9b13('0xe')](_0x9b13('0x4f'),_0x8df00f[_0x9b13('0x19')],_0x243ea9['id'])});}})[_0x9b13('0x50')](function(_0x3f66dc){logger[_0x9b13('0x51')](_0x9b13('0x45'),JSON[_0x9b13('0x31')](_0x3f66dc));});};exports[_0x9b13('0x52')]=function(_0x50e761,_0x5cc002,_0x30d71c,_0x387b32,_0x49bf5a,_0x4ac287,_0xc999da){var _0x32f01b,_0x5d244a;_0x4ac287[_0x9b13('0x19')]=intUtil[_0x9b13('0x42')](_0x4ac287[_0x9b13('0x19')]);_0x4ac287[_0x9b13('0x43')]=intUtil[_0x9b13('0x42')](_0x4ac287[_0x9b13('0x43')]);if(_0xc999da&&_0xc999da[_0x9b13('0x53')]&&_0xc999da[_0x9b13('0x53')]!==_0x9b13('0x54')){logger[_0x9b13('0x1f')](_0x9b13('0x55'),'Recording\x20is\x20enabled!');_0x5cc002[_0x9b13('0x49')]=util[_0x9b13('0xe')](_0x9b13('0x47'),_0x4ac287[_0x9b13('0x43')],_0x5cc002['uniqueid'],md5(_0x5cc002[_0x9b13('0x48')]));}headers[_0x9b13('0x4a')]=getAuth(_0x4ac287);return getUser(_0x4ac287,_0x387b32[_0x9b13('0x22')])[_0x9b13('0x1b')](function(_0x3029c5){_0x32f01b=_0x3029c5;logger[_0x9b13('0x1f')]('The\x20User\x20ID\x20is:',_0x32f01b['id']);return getEndUser(_0x4ac287,_0x5cc002[_0x9b13('0x56')],_0x5cc002[_0x9b13('0x57')]);})[_0x9b13('0x1b')](function(_0x4ed024){_0x5d244a=_0x4ed024;logger[_0x9b13('0x1f')]('The\x20Enduser\x20ID\x20is:',_0x5d244a['id']);return getTicket(_0x4ac287,_0x32f01b,_0x5d244a,_0x30d71c,_0x5cc002);})[_0x9b13('0x1b')](function(_0x298c9f){if(_0x298c9f&&_0x298c9f['id']){logger[_0x9b13('0x1f')](_0x9b13('0x1c'));logger[_0x9b13('0x1f')](_0x9b13('0x4c'),_0x298c9f['id']);logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9b13('0xe')](_0x9b13('0x4e'),_0x387b32[_0x9b13('0x16')]),_0x9b13('0x58'),{'uri':util[_0x9b13('0xe')](_0x9b13('0x4f'),_0x4ac287[_0x9b13('0x19')],_0x298c9f['id'])});}})[_0x9b13('0x50')](function(_0x3a03fb){logger[_0x9b13('0x51')](_0x9b13('0x55'),JSON[_0x9b13('0x31')](_0x3a03fb));});};exports[_0x9b13('0x59')]=function(_0x43b993,_0x5367f0,_0x2e39ac,_0x367918,_0x34b088,_0x552df1){var _0x454e0c,_0x254c26;_0x552df1[_0x9b13('0x19')]=intUtil[_0x9b13('0x42')](_0x552df1[_0x9b13('0x19')]);_0x552df1['serverUrl']=intUtil[_0x9b13('0x42')](_0x552df1[_0x9b13('0x43')]);if(_0x34b088&&_0x34b088[_0x9b13('0x44')]){logger[_0x9b13('0x1f')]('['+_0x5367f0[_0x9b13('0x5a')][_0x9b13('0x5b')]()+']',_0x9b13('0x46'));_0x5367f0[_0x9b13('0x49')]=util[_0x9b13('0xe')](_0x9b13('0x47'),_0x552df1['serverUrl'],_0x5367f0['uniqueid'],md5(_0x5367f0[_0x9b13('0x48')]));}else{_0x5367f0[_0x9b13('0x49')]='';}headers[_0x9b13('0x4a')]=getAuth(_0x552df1);return getUser(_0x552df1,'')['then'](function(_0x44279a){_0x454e0c=_0x44279a;logger[_0x9b13('0x1f')](_0x9b13('0x4b'),_0x454e0c['id']);return getEndUser(_0x552df1,_0x5367f0['calleridname'],_0x5367f0[_0x9b13('0x10')]);})[_0x9b13('0x1b')](function(_0x535e79){_0x254c26=_0x535e79;logger['info'](_0x9b13('0x5c'),_0x254c26['id']);return getTicket(_0x552df1,_0x454e0c,_0x254c26,_0x2e39ac,_0x5367f0);})[_0x9b13('0x1b')](function(_0x4a5666){if(_0x4a5666){logger[_0x9b13('0x1f')](_0x9b13('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4a5666['id']);}})[_0x9b13('0x50')](function(_0x421c2d){logger[_0x9b13('0x51')]('['+_0x5367f0[_0x9b13('0x5a')][_0x9b13('0x5b')]()+']',JSON[_0x9b13('0x31')](_0x421c2d));});}; \ No newline at end of file +var _0x0d02=['md5','util','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','Subjects','getString','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','%s/api/v2/agents','info','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','debug','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','idField','variable','variableName','push','Variable','queue','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','stringify','serverUrl','recordingFormat','none','Authorization','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise'];(function(_0x199d41,_0x426d53){var _0x505735=function(_0x230899){while(--_0x230899){_0x199d41['push'](_0x199d41['shift']());}};_0x505735(++_0x426d53);}(_0x0d02,0x103));var _0x20d0=function(_0x4cca4f,_0xbf47af){_0x4cca4f=_0x4cca4f-0x0;var _0x506c3b=_0x0d02[_0x4cca4f];return _0x506c3b;};'use strict';var _=require(_0x20d0('0x0'));var rp=require(_0x20d0('0x1'));var md5=require(_0x20d0('0x2'));var util=require(_0x20d0('0x3'));var Redis=require('ioredis');var intUtil=require(_0x20d0('0x4'));var config=require(_0x20d0('0x5'));var logger=require('../../../../config/logger')(_0x20d0('0x6'));config[_0x20d0('0x7')]=_[_0x20d0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x20d0('0x9'))(new Redis(config[_0x20d0('0x7')]));var headers={'Content-Type':_0x20d0('0xa'),'Accept':_0x20d0('0xa')};function emit(_0x3c8c12,_0x290d9c,_0x206e2d){io['to'](_0x3c8c12)[_0x20d0('0xb')](_0x290d9c,_0x206e2d);}function getTicket(_0x5d80cd,_0x3ec47a,_0x405df2,_0x364001,_0x262cb1){logger['info'](_0x20d0('0xc'));var _0x28a66d=_[_0x20d0('0xd')]({'responder_id':_0x3ec47a['id'],'requester_id':_0x405df2['id'],'name':util[_0x20d0('0xe')](_0x20d0('0xf'),_0x262cb1[_0x20d0('0x10')]),'phone':_0x262cb1['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x364001[_0x20d0('0x11')],_0x262cb1,'\x20'),'description':intUtil[_0x20d0('0x12')](_0x364001[_0x20d0('0x13')],_0x262cb1,_0x20d0('0x14')),'tags':getTags(_0x364001['Tags'],_0x20d0('0x15'))},getCustomFields(_0x364001[_0x20d0('0x16')],_0x262cb1));_0x28a66d['custom_fields']=_[_0x20d0('0x17')](_[_0x20d0('0x18')](_0x28a66d[_0x20d0('0x19')],'id'),'value');return request({'uri':util['format'](_0x20d0('0x1a'),_0x5d80cd[_0x20d0('0x1b')]),'method':_0x20d0('0x1c'),'body':_0x28a66d})[_0x20d0('0x1d')](function(_0x41c2a2){logger['info']('Ticket\x20created!');return _0x41c2a2;});}function getUser(_0x2acbed,_0x572363){if(intUtil['validateEmail'](_0x572363)){return request({'uri':util['format'](_0x20d0('0x1e'),_0x2acbed[_0x20d0('0x1b')]),'qs':{'email':_0x572363}})['then'](function(_0xc3f591){if(_0xc3f591['length']){logger[_0x20d0('0x1f')](_0x20d0('0x20'));return _['find'](_0xc3f591,function(_0x4ffafd){return _0x4ffafd['contact'][_0x20d0('0x21')]===_0x572363;});}else{logger[_0x20d0('0x1f')](_0x20d0('0x22'));return request({'uri':util[_0x20d0('0xe')]('%s/api/v2/agents/me',_0x2acbed[_0x20d0('0x1b')])})[_0x20d0('0x1d')](function(_0x4604bc){logger[_0x20d0('0x1f')]('Admin\x20account\x20selected.');return _0x4604bc;});}});}else{logger[_0x20d0('0x1f')](_0x20d0('0x23'));return request({'uri':util[_0x20d0('0xe')]('%s/api/v2/agents/me',_0x2acbed[_0x20d0('0x1b')])})[_0x20d0('0x1d')](function(_0x339925){logger[_0x20d0('0x1f')](_0x20d0('0x24'));return _0x339925;});}}function getEndUser(_0x10d57c,_0x1c7ab5,_0x43a43b){logger[_0x20d0('0x1f')](_0x20d0('0x25'),_0x43a43b);return request({'uri':util[_0x20d0('0xe')]('%s/api/v2/contacts',_0x10d57c[_0x20d0('0x1b')]),'qs':{'phone':_0x43a43b}})[_0x20d0('0x1d')](function(_0x46f248){if(_0x46f248[_0x20d0('0x26')]){logger[_0x20d0('0x1f')]('Enduser\x20found!');return _[_0x20d0('0x27')](_0x46f248,{'phone':_0x43a43b});}else{logger[_0x20d0('0x1f')](_0x20d0('0x28'));return request({'uri':util[_0x20d0('0xe')]('%s/api/v2/contacts',_0x10d57c[_0x20d0('0x1b')]),'method':_0x20d0('0x1c'),'body':{'name':_0x1c7ab5,'phone':_0x43a43b}})[_0x20d0('0x1d')](function(_0x328685){logger[_0x20d0('0x1f')](_0x20d0('0x29'));return _0x328685;});}});}function getAuth(_0x2cfc9b){return util['format']('Basic\x20%s',new Buffer(_0x2cfc9b[_0x20d0('0x2a')]+':X')[_0x20d0('0x2b')]('base64'));}function request(_0x26bd7b){logger[_0x20d0('0x2c')]('[HTTP]',JSON['stringify'](_0x26bd7b));return rp(_['defaults'](_0x26bd7b,{'method':_0x20d0('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x592919,_0x36b973){var _0x5d21f7=[];if(_0x592919&&_0x592919[_0x20d0('0x26')]>0x0){_0x5d21f7=_[_0x20d0('0x2e')](_0x592919,_0x36b973);}return _0x5d21f7;}function getCustomFields(_0x335881,_0xbc5f56){var _0x3ef1dc=[];var _0x41166a={'custom_fields':[]};if(_0x335881[_0x20d0('0x26')]>0x0){_['forEach'](_0x335881,function(_0x4b814c){if(_[_0x20d0('0x2f')]([_0x20d0('0x30'),_0x20d0('0x31')],_0x4b814c[_0x20d0('0x32')])&&_0x4b814c[_0x20d0('0x33')]&&!_0x4b814c[_0x20d0('0x34')]){_0x41166a[_0x4b814c[_0x20d0('0x33')][_0x20d0('0x35')]()]=_0x4b814c['content']['toString']();}else if(_['includes']([_0x20d0('0x30'),_0x20d0('0x31')],_0x4b814c['type'])&&_0x4b814c[_0x20d0('0x36')]&&_0x4b814c[_0x20d0('0x34')]){_0x41166a['custom_fields']['push']({'id':_0x4b814c[_0x20d0('0x36')],'value':_0x4b814c['content'][_0x20d0('0x2b')]()});}else if(_0x4b814c['type']===_0x20d0('0x37')&&_0x4b814c['variableName']&&_0x4b814c[_0x20d0('0x36')]&&_0x4b814c[_0x20d0('0x34')]){_0xbc5f56[_0x4b814c[_0x20d0('0x38')]]&&_0x41166a['custom_fields'][_0x20d0('0x39')]({'id':_0x4b814c[_0x20d0('0x36')],'value':_0xbc5f56[_0x4b814c[_0x20d0('0x38')]][_0x20d0('0x2b')]()});}else if(_0x4b814c[_0x20d0('0x32')]==='customVariable'&&_0x4b814c[_0x20d0('0x3a')]&&_0x4b814c[_0x20d0('0x3a')]['name']&&_0x4b814c[_0x20d0('0x36')]&&_0x4b814c['customField']){_0xbc5f56[_0x4b814c[_0x20d0('0x3a')][_0x20d0('0x15')]['toLowerCase']()]&&_0x41166a[_0x20d0('0x19')][_0x20d0('0x39')]({'id':_0x4b814c[_0x20d0('0x36')],'value':_0xbc5f56[_0x4b814c[_0x20d0('0x3a')][_0x20d0('0x15')][_0x20d0('0x35')]()]['toString']()});}});}return _0x41166a;}exports[_0x20d0('0x3b')]=function(_0x336f1d,_0x28a4d7,_0x1531ce,_0x411759,_0x3ae927,_0x10f328){var _0x2fd0d3,_0x47079b;_0x10f328[_0x20d0('0x1b')]=intUtil[_0x20d0('0x3c')](_0x10f328[_0x20d0('0x1b')]);_0x10f328['serverUrl']=intUtil['stripTrailingSlash'](_0x10f328['serverUrl']);if(_0x3ae927&&_0x3ae927['monitor_format']){logger[_0x20d0('0x1f')]('[QUEUE]',_0x20d0('0x3d'));_0x28a4d7[_0x20d0('0x3e')]=util[_0x20d0('0xe')](_0x20d0('0x3f'),_0x10f328['serverUrl'],_0x28a4d7[_0x20d0('0x40')],md5(_0x28a4d7[_0x20d0('0x40')]));}else{_0x28a4d7[_0x20d0('0x3e')]='';}headers['Authorization']=getAuth(_0x10f328);return getUser(_0x10f328,_0x411759[_0x20d0('0x21')])['then'](function(_0x392cdb){_0x2fd0d3=_0x392cdb;logger['info']('The\x20User\x20ID\x20is:',_0x2fd0d3['id']);return getEndUser(_0x10f328,_0x28a4d7[_0x20d0('0x10')],_0x28a4d7[_0x20d0('0x41')]);})[_0x20d0('0x1d')](function(_0x13c7a6){_0x47079b=_0x13c7a6;logger['info'](_0x20d0('0x42'),_0x47079b['id']);return getTicket(_0x10f328,_0x2fd0d3,_0x47079b,_0x1531ce,_0x28a4d7);})[_0x20d0('0x1d')](function(_0xb6648){if(_0xb6648&&_0xb6648['id']){logger['info'](_0x20d0('0x43'));logger['info'](_0x20d0('0x44'),_0xb6648['id']);logger[_0x20d0('0x1f')](_0x20d0('0x45'),_0x20d0('0x46'));emit(util[_0x20d0('0xe')](_0x20d0('0x47'),_0x411759[_0x20d0('0x15')]),'trigger:browser:url',{'uri':util[_0x20d0('0xe')](_0x20d0('0x48'),_0x10f328[_0x20d0('0x1b')],_0xb6648['id'])});}})[_0x20d0('0x49')](function(_0x5947ba){logger[_0x20d0('0x4a')]('[QUEUE]',JSON[_0x20d0('0x4b')](_0x5947ba));});};exports['outbound']=function(_0x1dedcd,_0x23dfd5,_0x4e1d12,_0x4fd01a,_0x10116f,_0x3d6259,_0x4c1d94){var _0x3a793c,_0x2930ce;_0x3d6259[_0x20d0('0x1b')]=intUtil[_0x20d0('0x3c')](_0x3d6259[_0x20d0('0x1b')]);_0x3d6259[_0x20d0('0x4c')]=intUtil['stripTrailingSlash'](_0x3d6259[_0x20d0('0x4c')]);if(_0x4c1d94&&_0x4c1d94[_0x20d0('0x4d')]&&_0x4c1d94[_0x20d0('0x4d')]!==_0x20d0('0x4e')){logger[_0x20d0('0x1f')]('[OUTBOUND]',_0x20d0('0x3d'));_0x23dfd5[_0x20d0('0x3e')]=util[_0x20d0('0xe')](_0x20d0('0x3f'),_0x3d6259[_0x20d0('0x4c')],_0x23dfd5[_0x20d0('0x40')],md5(_0x23dfd5['uniqueid']));}headers[_0x20d0('0x4f')]=getAuth(_0x3d6259);return getUser(_0x3d6259,_0x4fd01a['email'])[_0x20d0('0x1d')](function(_0x4f0b99){_0x3a793c=_0x4f0b99;logger[_0x20d0('0x1f')](_0x20d0('0x50'),_0x3a793c['id']);return getEndUser(_0x3d6259,_0x23dfd5[_0x20d0('0x51')],_0x23dfd5['destcalleridnum']);})[_0x20d0('0x1d')](function(_0x1c4113){_0x2930ce=_0x1c4113;logger['info'](_0x20d0('0x42'),_0x2930ce['id']);return getTicket(_0x3d6259,_0x3a793c,_0x2930ce,_0x4e1d12,_0x23dfd5);})[_0x20d0('0x1d')](function(_0x4a7de2){if(_0x4a7de2&&_0x4a7de2['id']){logger[_0x20d0('0x1f')](_0x20d0('0x43'));logger[_0x20d0('0x1f')](_0x20d0('0x44'),_0x4a7de2['id']);logger[_0x20d0('0x1f')](_0x20d0('0x52'),_0x20d0('0x46'));emit(util[_0x20d0('0xe')]('user:%s',_0x4fd01a[_0x20d0('0x15')]),_0x20d0('0x53'),{'uri':util[_0x20d0('0xe')](_0x20d0('0x48'),_0x3d6259[_0x20d0('0x1b')],_0x4a7de2['id'])});}})[_0x20d0('0x49')](function(_0x4a3336){logger[_0x20d0('0x4a')](_0x20d0('0x52'),JSON[_0x20d0('0x4b')](_0x4a3336));});};exports[_0x20d0('0x54')]=function(_0x5e3fd5,_0x17dada,_0x274cc6,_0x135a44,_0x1ae829,_0x306673){var _0x58628e,_0x148d14;_0x306673[_0x20d0('0x1b')]=intUtil[_0x20d0('0x3c')](_0x306673[_0x20d0('0x1b')]);_0x306673[_0x20d0('0x4c')]=intUtil[_0x20d0('0x3c')](_0x306673[_0x20d0('0x4c')]);if(_0x1ae829&&_0x1ae829['monitor_format']){logger[_0x20d0('0x1f')]('['+_0x17dada[_0x20d0('0x55')][_0x20d0('0x56')]()+']',_0x20d0('0x3d'));_0x17dada['recordingURL']=util['format'](_0x20d0('0x3f'),_0x306673[_0x20d0('0x4c')],_0x17dada[_0x20d0('0x40')],md5(_0x17dada[_0x20d0('0x40')]));}else{_0x17dada['recordingURL']='';}headers[_0x20d0('0x4f')]=getAuth(_0x306673);return getUser(_0x306673,'')[_0x20d0('0x1d')](function(_0x40d1a2){_0x58628e=_0x40d1a2;logger['info'](_0x20d0('0x50'),_0x58628e['id']);return getEndUser(_0x306673,_0x17dada[_0x20d0('0x10')],_0x17dada[_0x20d0('0x41')]);})[_0x20d0('0x1d')](function(_0x4faaad){_0x148d14=_0x4faaad;logger['info'](_0x20d0('0x42'),_0x148d14['id']);return getTicket(_0x306673,_0x58628e,_0x148d14,_0x274cc6,_0x17dada);})[_0x20d0('0x1d')](function(_0x1a216d){if(_0x1a216d){logger[_0x20d0('0x1f')]('Ticket\x20created!');logger[_0x20d0('0x1f')](_0x20d0('0x44'),_0x1a216d['id']);}})[_0x20d0('0x49')](function(_0x52dc55){logger['error']('['+_0x17dada[_0x20d0('0x55')]['toUpperCase']()+']',JSON[_0x20d0('0x4b')](_0x52dc55));});}; \ 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 0903d06..7dceedd 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 _0x40ca=['[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','ioredis','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','email','userId','Admin\x20selected','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x40ca,0x19f));var _0xa40c=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x40ca[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xa40c('0x0'));var rp=require(_0xa40c('0x1'));var md5=require(_0xa40c('0x2'));var util=require(_0xa40c('0x3'));var moment=require(_0xa40c('0x4'));var Promise=require('bluebird');var Redis=require(_0xa40c('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xa40c('0x6'))(_0xa40c('0x7'));config[_0xa40c('0x8')]=_[_0xa40c('0x9')](config['redis'],{'host':_0xa40c('0xa'),'port':0x18eb});var io=require(_0xa40c('0xb'))(new Redis(config[_0xa40c('0x8')]));function getAdminId(_0x4b0cfe,_0x78003f,_0x1bca84,_0x113eb3){return new Promise(function(_0x96582c,_0xae9129){var _0x17c89c=![];var _0x2f3b65={'method':_0xa40c('0xc'),'uri':_0x113eb3+_0xa40c('0xd'),'json':!![]};_0x2f3b65[_0xa40c('0xe')]=_0x1bca84;logger[_0xa40c('0xf')](_0xa40c('0x10'));return rp(_0x2f3b65)[_0xa40c('0x11')](function(_0x4d82d7){if(_0x4d82d7){var _0x1f7bdf=_0x4d82d7[_0xa40c('0x12')];var _0x55788c=null;for(_0x55788c=0x0;_0x55788c<_0x1f7bdf[_0xa40c('0x13')];_0x55788c++){if(_0x1f7bdf[_0x55788c]['email']===_0x4b0cfe[_0xa40c('0x14')]){_0x4b0cfe[_0xa40c('0x15')]=_0x1f7bdf[_0x55788c]['id'];_0x17c89c=!![];}}if(_0x17c89c){logger[_0xa40c('0xf')](_0xa40c('0x16'),_0x4b0cfe['adminId']);_0x96582c(_0x4b0cfe);}else{_0xae9129({'statusCode':0x194,'message':_0xa40c('0x17')});}}else{_0xae9129({'statusCode':0x194,'message':_0xa40c('0x17')});}})[_0xa40c('0x18')](function(_0x5d10b1){logger[_0xa40c('0x19')]('['+[_0x78003f[_0xa40c('0x1a')]()]+']',_0x5d10b1[_0xa40c('0x1b')]);_0xae9129(_0x5d10b1);});});}function getUser(_0x5e92f4,_0x3fd4e8,_0x404ed4){return function(_0x202eaa){return new Promise(function(_0x41711c,_0x194598){var _0x18e31e={'method':_0xa40c('0xc'),'uri':_0x404ed4+'/api/selector/owners','json':!![]};_0x18e31e['headers']=_0x3fd4e8;logger['info'](_0xa40c('0x1c'));return rp(_0x18e31e)[_0xa40c('0x11')](function(_0x3e7a54){if(_0x3e7a54){var _0x71489a=_0x3e7a54[_0xa40c('0x12')];var _0x41135a=![];var _0x5de0ee=null;if(_0x202eaa[_0xa40c('0x1d')]!==null){logger[_0xa40c('0xf')]('Getting\x20user\x20with\x20email',_0x202eaa['agentEmail']);_0x202eaa[_0xa40c('0x1e')]=_0x202eaa[_0xa40c('0x1d')];for(_0x5de0ee=0x0;_0x5de0ee<_0x71489a[_0xa40c('0x13')];_0x5de0ee++){if(_0x71489a[_0x5de0ee][_0xa40c('0x1f')]===_0x202eaa[_0xa40c('0x1d')]){_0x41135a=!![];_0x202eaa[_0xa40c('0x20')]=_0x71489a[_0x5de0ee]['id'];logger['info']('User\x20found:',_0x202eaa[_0xa40c('0x20')]);}}}if(!_0x41135a){logger[_0xa40c('0xf')](_0xa40c('0x21'));_0x202eaa['userEmail']=_0x202eaa[_0xa40c('0x14')];_0x202eaa[_0xa40c('0x20')]=_0x202eaa[_0xa40c('0x15')];_0x41135a=!![];}if(_0x41135a){_0x41711c(_0x202eaa);}else{_0x194598({'statusCode':0x194,'message':_0xa40c('0x17')});}}else{_0x194598({'statusCode':0x194,'message':_0xa40c('0x17')});}})[_0xa40c('0x18')](function(_0x361c5e){logger[_0xa40c('0x19')]('['+[_0x5e92f4['toUpperCase']()]+']',_0x361c5e[_0xa40c('0x1b')]);_0x194598(_0x361c5e);});});};}function searchContact(_0x4db106,_0x460728,_0x172101,_0x5446fe){return new Promise(function(_0x480985,_0x2becd0){var _0x22768d={'method':'GET','headers':_0x460728,'uri':_0x4db106+'/api/lookup?q='+_0x5446fe+'&f='+_0x172101+_0xa40c('0x22'),'json':!![]};rp(_0x22768d)[_0xa40c('0x11')](function(_0x28589f){var _0xd6fc60=_[_0xa40c('0x23')](_0x28589f[_0xa40c('0x24')][_0xa40c('0x24')],[_0x172101,_0x5446fe]);_0x480985(_0xd6fc60);})[_0xa40c('0x18')](function(_0x77d582){_0x2becd0(_0x77d582);});});}function getEndUser(_0x535fd7,_0x52e4b5,_0x2d2c86){return function(_0x9e83ab){return new Promise(function(_0x30a648,_0x4306b9){logger['info'](util['format'](_0xa40c('0x25'),_0x9e83ab[_0xa40c('0x26')]));searchContact(_0x2d2c86,_0x52e4b5,_0xa40c('0x27'),_0x9e83ab[_0xa40c('0x26')])[_0xa40c('0x11')](function(_0x5732ab){if(_0x5732ab){_0x9e83ab['endUserId']=_0x5732ab['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x9e83ab[_0xa40c('0x28')]);return _0x30a648(_0x9e83ab);}searchContact(_0x2d2c86,_0x52e4b5,_0xa40c('0x29'),_0x9e83ab['contactNumber'])[_0xa40c('0x11')](function(_0x41b57c){if(_0x41b57c){_0x9e83ab[_0xa40c('0x28')]=_0x41b57c['id'];logger['info']('Contact\x20found\x20work_number:',_0x9e83ab['endUserId']);return _0x30a648(_0x9e83ab);}createEndUser(_0x9e83ab,_0x535fd7,_0x52e4b5,_0x2d2c86)['then'](function(_0x51a3e0){logger['info'](_0xa40c('0x2a'),_0x51a3e0['endUserId']);return _0x30a648(_0x51a3e0);});});})['catch'](function(_0x3c6322){_0x4306b9(_0x3c6322);});});};}function createEndUser(_0x207864,_0x3cbbea,_0x143011,_0x430d66){return new Promise(function(_0x5344da,_0x2d7249){var _0xdc45a2=moment();var _0xe03c18={'method':_0xa40c('0x2b'),'uri':_0x430d66+_0xa40c('0x2c'),'body':{'contact':{'last_name':_0x207864['contactNumber'],'work_number':_0x207864[_0xa40c('0x26')],'mobile_number':_0x207864[_0xa40c('0x26')],'owner_id':_0x207864[_0xa40c('0x20')],'created_at':_0xdc45a2[_0xa40c('0x2d')](_0xa40c('0x2e'))}},'json':!![]};_0xe03c18['headers']=_0x143011;logger[_0xa40c('0xf')](_0xa40c('0x2f'));return rp(_0xe03c18)[_0xa40c('0x11')](function(_0x292aac){_0x207864[_0xa40c('0x28')]=_0x292aac[_0xa40c('0x30')]['id'];_0x5344da(_0x207864);})[_0xa40c('0x18')](function(_0x3b19ce){logger[_0xa40c('0x19')]('['+[_0x3cbbea[_0xa40c('0x1a')]()]+']',_0x3b19ce[_0xa40c('0x1b')]);_0x2d7249(_0x3b19ce['message']);});});}function getTicket(_0x2c056d,_0x5ac57d,_0x1778f5,_0x345988,_0x364b47){return function(_0x499f3a){logger[_0xa40c('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x38a325,_0x565ce4){var _0x1e7048=moment();var _0x46c27f={'method':_0xa40c('0x2b'),'uri':_0x1778f5+'/api/tasks','body':{'title':intUtil[_0xa40c('0x31')](_0x345988[_0xa40c('0x32')],_0x364b47,'\x20'),'description':intUtil[_0xa40c('0x31')](_0x345988[_0xa40c('0x33')],_0x364b47,'\x0a'),'owner_id':_0x499f3a[_0xa40c('0x20')],'creater_id':_0x499f3a[_0xa40c('0x15')],'targetable_id':_0x499f3a['endUserId'],'targetable_type':_0xa40c('0x34'),'created_at':_0x1e7048[_0xa40c('0x2d')](_0xa40c('0x2e')),'due_date':_0x1e7048[_0xa40c('0x35')](0x1e,'m')[_0xa40c('0x2d')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x46c27f[_0xa40c('0xe')]=_0x5ac57d;return rp(_0x46c27f)['then'](function(_0xa121cb){_0x499f3a[_0xa40c('0x36')]=_0xa121cb['task']['id'];logger[_0xa40c('0xf')](_0xa40c('0x37'),_0x499f3a[_0xa40c('0x36')]);_0x38a325(_0x499f3a);})[_0xa40c('0x18')](function(_0x5a1899){logger[_0xa40c('0x19')]('['+[_0x2c056d[_0xa40c('0x1a')]()]+']',_0x5a1899[_0xa40c('0x1b')]);_0x565ce4(_0x5a1899[_0xa40c('0x1b')]);});});};}function emit(_0x330d83,_0x39b63a,_0x3cd7e0){var _0x16e1d5={'uri':_0x330d83+_0xa40c('0x38')+_0x3cd7e0};io['to'](util[_0xa40c('0x2d')]('user:%s',_0x39b63a))[_0xa40c('0x39')](_0xa40c('0x3a'),_0x16e1d5);}exports['cs']=function(_0xde370c,_0x3a230a,_0x3205e7,_0x43cd15,_0x18236d,_0x5285ba,_0x106878,_0x1e2a83){var _0x45ce36={};var _0x38637e={'Authorization':_0xa40c('0x3b')+_0x5285ba[_0xa40c('0x3c')]};_0x5285ba[_0xa40c('0x3d')]=intUtil[_0xa40c('0x3e')](_0x5285ba[_0xa40c('0x3d')]);_0x5285ba[_0xa40c('0x3f')]=intUtil[_0xa40c('0x3e')](_0x5285ba[_0xa40c('0x3f')]);var _0x4b6553=_0x5285ba[_0xa40c('0x3d')];_0x45ce36[_0xa40c('0x14')]=_0x5285ba['username'];_0x45ce36[_0xa40c('0x26')]=_0x1e2a83['toLowerCase']()==='outbound'?_0x3a230a[_0xa40c('0x40')]:_0x3a230a[_0xa40c('0x41')];_0x45ce36[_0xa40c('0x42')]=_0x1e2a83===_0xa40c('0x43')||_0x1e2a83==='unmanaged'?_0xa40c('0x43'):_0xa40c('0x44');if(_0x43cd15){_0x45ce36[_0xa40c('0x1d')]=_0x43cd15['email'];}var _0x128c13=util['format'](_0xa40c('0x45'),_0x5285ba[_0xa40c('0x3f')],_0x3a230a[_0xa40c('0x46')],md5(_0x3a230a[_0xa40c('0x46')]));if(_0x18236d&&_0x18236d[_0xa40c('0x47')]){logger[_0xa40c('0xf')](_0xa40c('0x48'),_0xa40c('0x49'));_0x3a230a[_0xa40c('0x4a')]=_0x128c13;}else if(_0x106878&&_0x106878[_0xa40c('0x4b')]&&_0x106878['recordingFormat']!==_0xa40c('0x4c')){logger['info'](_0xa40c('0x4d'),_0xa40c('0x49'));_0x3a230a['recordingURL']=_0x128c13;}else{_0x3a230a[_0xa40c('0x4a')]='';}return getAdminId(_0x45ce36,_0x1e2a83,_0x38637e,_0x4b6553)[_0xa40c('0x11')](getUser(_0x1e2a83,_0x38637e,_0x4b6553))[_0xa40c('0x11')](getEndUser(_0x1e2a83,_0x38637e,_0x4b6553))[_0xa40c('0x11')](getTicket(_0x1e2a83,_0x38637e,_0x4b6553,_0x3205e7,_0x3a230a))[_0xa40c('0x11')](function(_0x16d324){logger[_0xa40c('0xf')](util[_0xa40c('0x2d')](_0xa40c('0x4e'),_0x16d324[_0xa40c('0x36')]));if(_0x1e2a83!=='unmanaged'){logger[_0xa40c('0xf')]('['+[_0x1e2a83['toUpperCase']()]+']',_0xa40c('0x4f'));emit(_0x4b6553,_0x43cd15[_0xa40c('0x50')],_0x16d324[_0xa40c('0x28')]);}})[_0xa40c('0x18')](function(_0x25a080){logger['error']('['+[_0x1e2a83[_0xa40c('0x1a')]()]+_0xa40c('0x51'),util['inspect'](_0x25a080,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0cec=['agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','format','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','add','ticketId','task','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','redis','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','GET'];(function(_0x34e5ab,_0x5e106a){var _0x117f6f=function(_0x5e1a95){while(--_0x5e1a95){_0x34e5ab['push'](_0x34e5ab['shift']());}};_0x117f6f(++_0x5e106a);}(_0x0cec,0x8c));var _0xc0ce=function(_0x124322,_0x25d367){_0x124322=_0x124322-0x0;var _0x5d5e31=_0x0cec[_0x124322];return _0x5d5e31;};'use strict';var _=require(_0xc0ce('0x0'));var rp=require(_0xc0ce('0x1'));var md5=require(_0xc0ce('0x2'));var util=require('util');var moment=require(_0xc0ce('0x3'));var Promise=require('bluebird');var Redis=require(_0xc0ce('0x4'));var intUtil=require(_0xc0ce('0x5'));var config=require(_0xc0ce('0x6'));var logger=require(_0xc0ce('0x7'))(_0xc0ce('0x8'));config['redis']=_[_0xc0ce('0x9')](config['redis'],{'host':_0xc0ce('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc0ce('0xb')]));function getAdminId(_0x4e6e26,_0x2965ff,_0x1a8fb5,_0x3a6cde){return new Promise(function(_0x2dad32,_0x66cb76){var _0x20c745=![];var _0x361c45={'method':'GET','uri':_0x3a6cde+_0xc0ce('0xc'),'json':!![]};_0x361c45[_0xc0ce('0xd')]=_0x1a8fb5;logger[_0xc0ce('0xe')](_0xc0ce('0xf'));return rp(_0x361c45)[_0xc0ce('0x10')](function(_0x29f55c){if(_0x29f55c){var _0x572a30=_0x29f55c[_0xc0ce('0x11')];var _0x170cf2=null;for(_0x170cf2=0x0;_0x170cf2<_0x572a30['length'];_0x170cf2++){if(_0x572a30[_0x170cf2][_0xc0ce('0x12')]===_0x4e6e26[_0xc0ce('0x13')]){_0x4e6e26[_0xc0ce('0x14')]=_0x572a30[_0x170cf2]['id'];_0x20c745=!![];}}if(_0x20c745){logger[_0xc0ce('0xe')]('Admin\x20found:',_0x4e6e26[_0xc0ce('0x14')]);_0x2dad32(_0x4e6e26);}else{_0x66cb76({'statusCode':0x194,'message':_0xc0ce('0x15')});}}else{_0x66cb76({'statusCode':0x194,'message':_0xc0ce('0x15')});}})['catch'](function(_0x28892c){logger[_0xc0ce('0x16')]('['+[_0x2965ff[_0xc0ce('0x17')]()]+']',_0x28892c[_0xc0ce('0x18')]);_0x66cb76(_0x28892c);});});}function getUser(_0x4a5776,_0x446550,_0x430232){return function(_0x3d0269){return new Promise(function(_0x5e54b1,_0x410075){var _0x170944={'method':_0xc0ce('0x19'),'uri':_0x430232+_0xc0ce('0xc'),'json':!![]};_0x170944[_0xc0ce('0xd')]=_0x446550;logger[_0xc0ce('0xe')]('Getting\x20user\x20list');return rp(_0x170944)[_0xc0ce('0x10')](function(_0x299511){if(_0x299511){var _0x5baed4=_0x299511[_0xc0ce('0x11')];var _0x4c9582=![];var _0x2c3110=null;if(_0x3d0269[_0xc0ce('0x1a')]!==null){logger[_0xc0ce('0xe')](_0xc0ce('0x1b'),_0x3d0269[_0xc0ce('0x1a')]);_0x3d0269[_0xc0ce('0x1c')]=_0x3d0269['agentEmail'];for(_0x2c3110=0x0;_0x2c3110<_0x5baed4[_0xc0ce('0x1d')];_0x2c3110++){if(_0x5baed4[_0x2c3110]['email']===_0x3d0269[_0xc0ce('0x1a')]){_0x4c9582=!![];_0x3d0269[_0xc0ce('0x1e')]=_0x5baed4[_0x2c3110]['id'];logger[_0xc0ce('0xe')](_0xc0ce('0x1f'),_0x3d0269['userId']);}}}if(!_0x4c9582){logger['info'](_0xc0ce('0x20'));_0x3d0269['userEmail']=_0x3d0269['adminEmail'];_0x3d0269[_0xc0ce('0x1e')]=_0x3d0269[_0xc0ce('0x14')];_0x4c9582=!![];}if(_0x4c9582){_0x5e54b1(_0x3d0269);}else{_0x410075({'statusCode':0x194,'message':_0xc0ce('0x15')});}}else{_0x410075({'statusCode':0x194,'message':_0xc0ce('0x15')});}})['catch'](function(_0x48b700){logger[_0xc0ce('0x16')]('['+[_0x4a5776[_0xc0ce('0x17')]()]+']',_0x48b700[_0xc0ce('0x18')]);_0x410075(_0x48b700);});});};}function searchContact(_0x2efaec,_0x11847d,_0x383897,_0x4d3d18){return new Promise(function(_0x17f729,_0x351c9b){var _0x2512ab={'method':_0xc0ce('0x19'),'headers':_0x11847d,'uri':_0x2efaec+_0xc0ce('0x21')+_0x4d3d18+_0xc0ce('0x22')+_0x383897+_0xc0ce('0x23'),'json':!![]};rp(_0x2512ab)[_0xc0ce('0x10')](function(_0x524cca){var _0x2ee364=_[_0xc0ce('0x24')](_0x524cca[_0xc0ce('0x25')]['contacts'],[_0x383897,_0x4d3d18]);_0x17f729(_0x2ee364);})[_0xc0ce('0x26')](function(_0x2ab5a0){_0x351c9b(_0x2ab5a0);});});}function getEndUser(_0x261392,_0x1f39ee,_0x4aba15){return function(_0x412c7f){return new Promise(function(_0x1e54de,_0x456327){logger[_0xc0ce('0xe')](util[_0xc0ce('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x412c7f[_0xc0ce('0x28')]));searchContact(_0x4aba15,_0x1f39ee,_0xc0ce('0x29'),_0x412c7f[_0xc0ce('0x28')])[_0xc0ce('0x10')](function(_0x49f792){if(_0x49f792){_0x412c7f[_0xc0ce('0x2a')]=_0x49f792['id'];logger[_0xc0ce('0xe')]('Contact\x20found\x20mobile_number:',_0x412c7f[_0xc0ce('0x2a')]);return _0x1e54de(_0x412c7f);}searchContact(_0x4aba15,_0x1f39ee,_0xc0ce('0x2b'),_0x412c7f[_0xc0ce('0x28')])['then'](function(_0x30c9fd){if(_0x30c9fd){_0x412c7f['endUserId']=_0x30c9fd['id'];logger[_0xc0ce('0xe')](_0xc0ce('0x2c'),_0x412c7f[_0xc0ce('0x2a')]);return _0x1e54de(_0x412c7f);}createEndUser(_0x412c7f,_0x261392,_0x1f39ee,_0x4aba15)[_0xc0ce('0x10')](function(_0x2c71f5){logger[_0xc0ce('0xe')](_0xc0ce('0x2d'),_0x2c71f5[_0xc0ce('0x2a')]);return _0x1e54de(_0x2c71f5);});});})['catch'](function(_0x49bc0c){_0x456327(_0x49bc0c);});});};}function createEndUser(_0x435950,_0x43ee40,_0x4e75c9,_0x310aa0){return new Promise(function(_0x100065,_0xeb723e){var _0x177478=moment();var _0x3633c9={'method':'POST','uri':_0x310aa0+'/api/contacts','body':{'contact':{'last_name':_0x435950[_0xc0ce('0x28')],'work_number':_0x435950[_0xc0ce('0x28')],'mobile_number':_0x435950[_0xc0ce('0x28')],'owner_id':_0x435950[_0xc0ce('0x1e')],'created_at':_0x177478['format'](_0xc0ce('0x2e'))}},'json':!![]};_0x3633c9[_0xc0ce('0xd')]=_0x4e75c9;logger[_0xc0ce('0xe')](_0xc0ce('0x2f'));return rp(_0x3633c9)[_0xc0ce('0x10')](function(_0x47ea09){_0x435950['endUserId']=_0x47ea09['contact']['id'];_0x100065(_0x435950);})[_0xc0ce('0x26')](function(_0x1774ce){logger[_0xc0ce('0x16')]('['+[_0x43ee40[_0xc0ce('0x17')]()]+']',_0x1774ce[_0xc0ce('0x18')]);_0xeb723e(_0x1774ce[_0xc0ce('0x18')]);});});}function getTicket(_0x2bde6f,_0x338909,_0x1982a6,_0x12ab0a,_0x551dba){return function(_0x58ed6b){logger[_0xc0ce('0xe')](_0xc0ce('0x30'));return new Promise(function(_0x33d5fd,_0x3d4393){var _0x142420=moment();var _0x273117={'method':_0xc0ce('0x31'),'uri':_0x1982a6+_0xc0ce('0x32'),'body':{'title':intUtil[_0xc0ce('0x33')](_0x12ab0a[_0xc0ce('0x34')],_0x551dba,'\x20'),'description':intUtil[_0xc0ce('0x33')](_0x12ab0a['Descriptions'],_0x551dba,'\x0a'),'owner_id':_0x58ed6b[_0xc0ce('0x1e')],'creater_id':_0x58ed6b[_0xc0ce('0x14')],'targetable_id':_0x58ed6b[_0xc0ce('0x2a')],'targetable_type':_0xc0ce('0x35'),'created_at':_0x142420[_0xc0ce('0x27')](_0xc0ce('0x2e')),'due_date':_0x142420[_0xc0ce('0x36')](0x1e,'m')[_0xc0ce('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x273117[_0xc0ce('0xd')]=_0x338909;return rp(_0x273117)['then'](function(_0x41ec49){_0x58ed6b[_0xc0ce('0x37')]=_0x41ec49[_0xc0ce('0x38')]['id'];logger['info']('Task\x20created:',_0x58ed6b['ticketId']);_0x33d5fd(_0x58ed6b);})[_0xc0ce('0x26')](function(_0x581d2a){logger[_0xc0ce('0x16')]('['+[_0x2bde6f[_0xc0ce('0x17')]()]+']',_0x581d2a[_0xc0ce('0x18')]);_0x3d4393(_0x581d2a[_0xc0ce('0x18')]);});});};}function emit(_0x52de28,_0x37d958,_0x453fe9){var _0x2cd4a7={'uri':_0x52de28+'/contacts/'+_0x453fe9};io['to'](util[_0xc0ce('0x27')](_0xc0ce('0x39'),_0x37d958))[_0xc0ce('0x3a')](_0xc0ce('0x3b'),_0x2cd4a7);}exports['cs']=function(_0x18efea,_0x3a4b35,_0x3843ff,_0x12ad7d,_0x48f245,_0x13b03a,_0x2c3c6f,_0x3eaaa6){var _0x17c1a7={};var _0x20ab4a={'Authorization':_0xc0ce('0x3c')+_0x13b03a[_0xc0ce('0x3d')]};_0x13b03a[_0xc0ce('0x3e')]=intUtil[_0xc0ce('0x3f')](_0x13b03a[_0xc0ce('0x3e')]);_0x13b03a[_0xc0ce('0x40')]=intUtil[_0xc0ce('0x3f')](_0x13b03a[_0xc0ce('0x40')]);var _0xa52e70=_0x13b03a['remoteUri'];_0x17c1a7[_0xc0ce('0x13')]=_0x13b03a[_0xc0ce('0x41')];_0x17c1a7[_0xc0ce('0x28')]=_0x3eaaa6[_0xc0ce('0x42')]()===_0xc0ce('0x43')?_0x3a4b35['destcalleridnum']:_0x3a4b35[_0xc0ce('0x44')];_0x17c1a7[_0xc0ce('0x45')]=_0x3eaaa6==='queue'||_0x3eaaa6===_0xc0ce('0x46')?'queue':_0xc0ce('0x43');if(_0x12ad7d){_0x17c1a7[_0xc0ce('0x1a')]=_0x12ad7d[_0xc0ce('0x12')];}var _0x5b58d9=util[_0xc0ce('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x13b03a[_0xc0ce('0x40')],_0x3a4b35['uniqueid'],md5(_0x3a4b35[_0xc0ce('0x47')]));if(_0x48f245&&_0x48f245[_0xc0ce('0x48')]){logger[_0xc0ce('0xe')](_0xc0ce('0x49'),_0xc0ce('0x4a'));_0x3a4b35[_0xc0ce('0x4b')]=_0x5b58d9;}else if(_0x2c3c6f&&_0x2c3c6f[_0xc0ce('0x4c')]&&_0x2c3c6f[_0xc0ce('0x4c')]!==_0xc0ce('0x4d')){logger['info'](_0xc0ce('0x4e'),'Recording\x20is\x20enabled!');_0x3a4b35['recordingURL']=_0x5b58d9;}else{_0x3a4b35[_0xc0ce('0x4b')]='';}return getAdminId(_0x17c1a7,_0x3eaaa6,_0x20ab4a,_0xa52e70)['then'](getUser(_0x3eaaa6,_0x20ab4a,_0xa52e70))[_0xc0ce('0x10')](getEndUser(_0x3eaaa6,_0x20ab4a,_0xa52e70))[_0xc0ce('0x10')](getTicket(_0x3eaaa6,_0x20ab4a,_0xa52e70,_0x3843ff,_0x3a4b35))[_0xc0ce('0x10')](function(_0x221828){logger[_0xc0ce('0xe')](util[_0xc0ce('0x27')](_0xc0ce('0x4f'),_0x221828[_0xc0ce('0x37')]));if(_0x3eaaa6!==_0xc0ce('0x46')){logger[_0xc0ce('0xe')]('['+[_0x3eaaa6[_0xc0ce('0x17')]()]+']',_0xc0ce('0x50'));emit(_0xa52e70,_0x12ad7d[_0xc0ce('0x51')],_0x221828[_0xc0ce('0x2a')]);}})[_0xc0ce('0x26')](function(_0x5eb5b8){logger['error']('['+[_0x3eaaa6[_0xc0ce('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc0ce('0x52')](_0x5eb5b8,{'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 377c8b0..1fffd73 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 _0xdc3c=['./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','dynamics365','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','error','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc3c,0x1b4));var _0xcdc3=function(_0x32087a,_0x16349b){_0x32087a=_0x32087a-0x0;var _0x144d02=_0xdc3c[_0x32087a];return _0x144d02;};'use strict';var _=require(_0xcdc3('0x0'));var util=require('util');var zendesk=require(_0xcdc3('0x1'));var salesforce=require(_0xcdc3('0x2'));var sugarcrm=require(_0xcdc3('0x3'));var freshdesk=require(_0xcdc3('0x4'));var zoho=require(_0xcdc3('0x5'));var desk=require(_0xcdc3('0x6'));var vtiger=require(_0xcdc3('0x7'));var servicenow=require(_0xcdc3('0x8'));var dynamics365=require(_0xcdc3('0x9'));var freshsales=require(_0xcdc3('0xa'));var integrations=[_0xcdc3('0xb'),_0xcdc3('0xc'),_0xcdc3('0xd'),_0xcdc3('0xe'),_0xcdc3('0xf'),_0xcdc3('0x10'),'vtiger','dynamics365','freshsales',_0xcdc3('0x11')];exports[_0xcdc3('0x12')]=function(_0x1900a2,_0x14478e,_0x18ba5f,_0x3c8a53,_0x358771,_0x64c9af){if(_0x18ba5f){if(_[_0xcdc3('0x13')](integrations,_0x1900a2['data1']['toLowerCase']())){try{var _0x6cf272=null;var _0x1ea112='';var _0x1c22c5=_0x18ba5f[_0x1900a2[_0xcdc3('0x14')][_0xcdc3('0x15')]()];if(_0x1c22c5){var _0x20cf7c=_0x1c22c5[_0x1900a2[_0xcdc3('0x16')]];if(_0x20cf7c){var _0x359598=_['find'](_0x20cf7c[_0xcdc3('0x17')],{'id':parseInt(_0x1900a2['data3'],0xa)});if(_0x359598){if(_0x3c8a53){if(_0x358771&&_0x14478e[_0xcdc3('0x18')]){_0x1ea112='queue';}else if(_0x14478e[_0xcdc3('0x19')]){_0x1ea112=_0xcdc3('0x1a');}else{console[_0xcdc3('0x1b')](_0xcdc3('0x1c'),_0x14478e);}}else{_0x1ea112=_0xcdc3('0x1d');}switch(_0x1900a2[_0xcdc3('0x14')][_0xcdc3('0x15')]()){case _0xcdc3('0xb'):zendesk[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0xc'):salesforce[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0xd'):sugarcrm[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0xe'):freshdesk[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case'zoho':zoho[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0x10'):desk[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0x1e'):vtiger[_0x1ea112](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af);break;case _0xcdc3('0x1f'):freshsales['cs'](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af,_0x1ea112);break;case _0xcdc3('0x11'):servicenow['cs'](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af,_0x1ea112);break;case _0xcdc3('0x20'):dynamics365['cs'](_0x1900a2,_0x14478e,_0x359598,_0x3c8a53,_0x358771,_0x20cf7c,_0x64c9af,_0x1ea112);break;default:console[_0xcdc3('0x1b')]('unknown\x20integration');}}else{_0x6cf272=require('../../../../config/logger')(_0x1900a2['data1'][_0xcdc3('0x15')]());_0x6cf272['error'](_0xcdc3('0x21'),util[_0xcdc3('0x22')](_0xcdc3('0x23'),_0x1900a2[_0xcdc3('0x14')][_0xcdc3('0x15')](),_0x1900a2[_0xcdc3('0x24')]));}}else{_0x6cf272=require(_0xcdc3('0x25'))(_0x1900a2['data1']['toLowerCase']());_0x6cf272[_0xcdc3('0x26')](_0xcdc3('0x21'),util[_0xcdc3('0x22')](_0xcdc3('0x27'),_0x1900a2['data1'][_0xcdc3('0x15')](),_0x1900a2[_0xcdc3('0x16')]));}}else{}}catch(_0x499d63){console[_0xcdc3('0x26')](_0x499d63);}}}}; \ No newline at end of file +var _0x73d0=['[EXEC]','format','data2','error','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','dynamics365','freshsales','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','servicenow','unknown\x20integration','../../../../config/logger'];(function(_0x3fa4f5,_0x3cc63b){var _0x576e28=function(_0x5b2fa4){while(--_0x5b2fa4){_0x3fa4f5['push'](_0x3fa4f5['shift']());}};_0x576e28(++_0x3cc63b);}(_0x73d0,0xdc));var _0x073d=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x73d0[_0x3653c7];return _0x58a021;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x073d('0x0'));var sugarcrm=require(_0x073d('0x1'));var freshdesk=require(_0x073d('0x2'));var zoho=require(_0x073d('0x3'));var desk=require(_0x073d('0x4'));var vtiger=require(_0x073d('0x5'));var servicenow=require(_0x073d('0x6'));var dynamics365=require(_0x073d('0x7'));var freshsales=require(_0x073d('0x8'));var integrations=[_0x073d('0x9'),_0x073d('0xa'),_0x073d('0xb'),_0x073d('0xc'),'zoho',_0x073d('0xd'),'vtiger',_0x073d('0xe'),_0x073d('0xf'),'servicenow'];exports[_0x073d('0x10')]=function(_0x396bf6,_0x50a249,_0x49f51b,_0x4c63a8,_0x483361,_0x4262a1){if(_0x49f51b){if(_[_0x073d('0x11')](integrations,_0x396bf6[_0x073d('0x12')]['toLowerCase']())){try{var _0x433610=null;var _0x1d0737='';var _0x3e233a=_0x49f51b[_0x396bf6[_0x073d('0x12')][_0x073d('0x13')]()];if(_0x3e233a){var _0xec0f50=_0x3e233a[_0x396bf6['data2']];if(_0xec0f50){var _0x4c7590=_[_0x073d('0x14')](_0xec0f50[_0x073d('0x15')],{'id':parseInt(_0x396bf6[_0x073d('0x16')],0xa)});if(_0x4c7590){if(_0x4c63a8){if(_0x483361&&_0x50a249[_0x073d('0x17')]){_0x1d0737=_0x073d('0x17');}else if(_0x50a249['routeId']){_0x1d0737=_0x073d('0x18');}else{console[_0x073d('0x19')](_0x073d('0x1a'),_0x50a249);}}else{_0x1d0737=_0x073d('0x1b');}switch(_0x396bf6[_0x073d('0x12')][_0x073d('0x13')]()){case _0x073d('0x9'):zendesk[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case'salesforce':salesforce[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case _0x073d('0xb'):sugarcrm[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case'freshdesk':freshdesk[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case _0x073d('0x1c'):zoho[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case _0x073d('0xd'):desk[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case'vtiger':vtiger[_0x1d0737](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1);break;case _0x073d('0xf'):freshsales['cs'](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1,_0x1d0737);break;case _0x073d('0x1d'):servicenow['cs'](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1,_0x1d0737);break;case _0x073d('0xe'):dynamics365['cs'](_0x396bf6,_0x50a249,_0x4c7590,_0x4c63a8,_0x483361,_0xec0f50,_0x4262a1,_0x1d0737);break;default:console[_0x073d('0x19')](_0x073d('0x1e'));}}else{_0x433610=require(_0x073d('0x1f'))(_0x396bf6[_0x073d('0x12')]['toLowerCase']());_0x433610['error'](_0x073d('0x20'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x396bf6[_0x073d('0x12')][_0x073d('0x13')](),_0x396bf6['data3']));}}else{_0x433610=require(_0x073d('0x1f'))(_0x396bf6['data1'][_0x073d('0x13')]());_0x433610['error'](_0x073d('0x20'),util[_0x073d('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x396bf6[_0x073d('0x12')][_0x073d('0x13')](),_0x396bf6[_0x073d('0x22')]));}}else{}}catch(_0x39a58a){console[_0x073d('0x23')](_0x39a58a);}}}}; \ 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 02da925..e17ca71 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 _0x7033=['Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','$or','Account','Contact','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','moduleCreate','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variable','variableName','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','utc','IsReminderSet','IsRecurrence','endUserType','lead','Case','contact','account','AccountId','leadId','info'];(function(_0x5a9130,_0x57fb4a){var _0x4a3d77=function(_0x2e645e){while(--_0x2e645e){_0x5a9130['push'](_0x5a9130['shift']());}};_0x4a3d77(++_0x57fb4a);}(_0x7033,0x1df));var _0x3703=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7033[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x3703('0x0'));var rp=require(_0x3703('0x1'));var moment=require(_0x3703('0x2'));var BPromise=require('bluebird');var md5=require(_0x3703('0x3'));var jsforce=require(_0x3703('0x4'));var util=require(_0x3703('0x5'));var Redis=require('ioredis');var intUtil=require(_0x3703('0x6'));var config=require(_0x3703('0x7'));var logger=require(_0x3703('0x8'))(_0x3703('0x9'));config[_0x3703('0xa')]=_[_0x3703('0xb')](config[_0x3703('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x3703('0xc'))(new Redis(config[_0x3703('0xa')]));function emit(_0x26acbe,_0x541115,_0x34de60){io['to'](_0x26acbe)[_0x3703('0xd')](_0x541115,_0x34de60);}function getTicket(_0x598463,_0x5fba3d,_0x60e914,_0x486281,_0x1cf45e,_0x5bc7d1,_0x436836,_0x23923f){var _0x356e50=Object[_0x3703('0xe')]({},{'OwnerId':_0x5fba3d['id'],'Subject':intUtil[_0x3703('0xf')](_0x486281['Subjects'],_0x1cf45e,'\x20'),'Description':intUtil['getString'](_0x486281[_0x3703('0x10')],_0x1cf45e,'\x0a')},getCustomFields(_0x5bc7d1,_0x1cf45e));if(_0x60e914){if(_0x486281[_0x3703('0x11')]==='Task'){_0x356e50['ActivityDate']=moment[_0x3703('0x12')]();_0x356e50[_0x3703('0x13')]=![];_0x356e50[_0x3703('0x14')]=![];if(_0x60e914[_0x3703('0x15')]==='contact'||_0x60e914[_0x3703('0x15')]===_0x3703('0x16')){_0x356e50['WhoId']=_0x60e914['id'];}else if(_0x60e914[_0x3703('0x15')]==='account'){_0x356e50['WhatId']=_0x60e914['id'];}}else if(_0x486281[_0x3703('0x11')]===_0x3703('0x17')){if(_0x60e914[_0x3703('0x15')]===_0x3703('0x18')){_0x356e50['ContactId']=_0x60e914['id'];}else if(_0x60e914[_0x3703('0x15')]===_0x3703('0x19')){_0x356e50[_0x3703('0x1a')]=_0x60e914['id'];}else if(_0x60e914[_0x3703('0x15')]===_0x3703('0x16')&&_0x486281[_0x3703('0x1b')]){_0x356e50[_0x486281[_0x3703('0x1b')]]=_0x60e914['id'];}else{logger[_0x3703('0x1c')](_0x3703('0x1d'));}}}return _0x436836[_0x3703('0x1e')](_0x486281['ticketType'])[_0x3703('0x1f')](_0x356e50);}function getUser(_0x1e2b27,_0xf603f9,_0x420940){if(!_[_0x3703('0x20')](_0xf603f9)&&intUtil['validateEmail'](_0xf603f9)){var _0x561462={'Email':_0xf603f9};var _0x98b4fe={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x420940[_0x3703('0x1e')](_0x3703('0x21'))[_0x3703('0x22')](_0x561462,_0x98b4fe)['execute']()[_0x3703('0x23')](function(_0x53e7d7){if(_0x53e7d7[_0x3703('0x24')]){var _0x14e964=_['find'](_0x53e7d7,function(_0x1ef3d0){return _0x1ef3d0[_0x3703('0x25')]===_0xf603f9;});if(_0x14e964){logger[_0x3703('0x1c')](_0x3703('0x26'),_0xf603f9);return BPromise[_0x3703('0x27')]({'id':_0x14e964['Id'],'name':_0x14e964[_0x3703('0x28')]});}}else{logger[_0x3703('0x1c')](_0x3703('0x29'),_0xf603f9);return _0x420940[_0x3703('0x2a')]()['then'](function(_0x8f32cb){return BPromise['resolve']({'id':_0x8f32cb['user_id'],'name':_0x8f32cb[_0x3703('0x2b')]});});}});}else{logger[_0x3703('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xf603f9);return _0x420940['identity']()[_0x3703('0x23')](function(_0x5173ba){return BPromise[_0x3703('0x27')]({'id':_0x5173ba[_0x3703('0x2c')],'name':_0x5173ba['display_name']});});}}function getEndUser(_0x2e81ce,_0x4d184a,_0x949fa0,_0x11f5ca,_0x1019f2){var _0x1695b1={'$or':{'Phone':_0x11f5ca}};var _0x552074={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3703('0x27')]()[_0x3703('0x23')](function(){logger[_0x3703('0x1c')](_0x3703('0x2d'),_0x11f5ca,_0x4d184a[_0x3703('0x2e')]);switch(_0x4d184a[_0x3703('0x2e')]){case _0x3703('0x2f'):var _0x41f091=_[_0x3703('0x30')](_0x1695b1);if(_0x4d184a[_0x3703('0x31')]){var _0x197eb2={};_0x197eb2[_0x4d184a[_0x3703('0x31')]]=_0x11f5ca;_[_0x3703('0x32')](_0x41f091['$or'],_0x197eb2);}return _0x1019f2['sobject']('Contact')[_0x3703('0x22')](_0x41f091,_0x552074)[_0x3703('0x33')]()['then'](function(_0x3eb0a1){if(_0x3eb0a1&&_0x3eb0a1[_0x3703('0x24')]){return _0x3eb0a1;}else{var _0x4d12c2=_[_0x3703('0x30')](_0x1695b1);if(_0x4d184a[_0x3703('0x34')]){var _0x243178={};_0x243178[_0x4d184a[_0x3703('0x34')]]=_0x11f5ca;_[_0x3703('0x32')](_0x4d12c2['$or'],_0x243178);}return _0x1019f2[_0x3703('0x1e')](_0x3703('0x35'))[_0x3703('0x22')](_0x4d12c2,_0x552074);}});case _0x3703('0x36'):var _0x29a226=_['cloneDeep'](_0x1695b1);if(_0x4d184a[_0x3703('0x37')]){var _0x197eb2={};_0x197eb2[_0x4d184a['additionalSearchAccount']]=_0x11f5ca;_[_0x3703('0x32')](_0x29a226[_0x3703('0x38')],_0x197eb2);}return _0x1019f2[_0x3703('0x1e')](_0x3703('0x39'))['find'](_0x29a226,_0x552074)[_0x3703('0x33')]()[_0x3703('0x23')](function(_0x1047d5){if(_0x1047d5&&_0x1047d5['length']){return _0x1047d5;}else{var _0x1fc1ca=_[_0x3703('0x30')](_0x1695b1);if(_0x4d184a[_0x3703('0x31')]){var _0x4bfbce={};_0x4bfbce[_0x4d184a[_0x3703('0x31')]]=_0x11f5ca;_[_0x3703('0x32')](_0x1fc1ca[_0x3703('0x38')],_0x4bfbce);}return _0x1019f2[_0x3703('0x1e')](_0x3703('0x3a'))[_0x3703('0x22')](_0x1fc1ca,_0x552074)[_0x3703('0x23')](function(_0x18e56f){if(_0x18e56f&&_0x18e56f['length']){return _0x18e56f;}else{var _0x4c00f8=_[_0x3703('0x30')](_0x1695b1);if(_0x4d184a['additionalSearchLead']){var _0x33f067={};_0x33f067[_0x4d184a[_0x3703('0x34')]]=_0x11f5ca;_[_0x3703('0x32')](_0x4c00f8[_0x3703('0x38')],_0x33f067);}return _0x1019f2[_0x3703('0x1e')](_0x3703('0x35'))[_0x3703('0x22')](_0x4c00f8,_0x552074);}});}});case'contact':var _0x41f091=_['cloneDeep'](_0x1695b1);if(_0x4d184a[_0x3703('0x31')]){var _0x197eb2={};_0x197eb2[_0x4d184a[_0x3703('0x31')]]=_0x11f5ca;_[_0x3703('0x32')](_0x41f091['$or'],_0x197eb2);}return _0x1019f2[_0x3703('0x1e')](_0x3703('0x3a'))[_0x3703('0x22')](_0x41f091,_0x552074)['execute']();case _0x3703('0x16'):var _0x9e466c=_[_0x3703('0x30')](_0x1695b1);if(_0x4d184a[_0x3703('0x34')]){var _0x197eb2={};_0x197eb2[_0x4d184a[_0x3703('0x34')]]=_0x11f5ca;_['merge'](_0x9e466c['$or'],_0x197eb2);}return _0x1019f2['sobject']('Lead')[_0x3703('0x22')](_0x9e466c,_0x552074);case'account':var _0x29a226=_['cloneDeep'](_0x1695b1);if(_0x4d184a[_0x3703('0x37')]){var _0x197eb2={};_0x197eb2[_0x4d184a[_0x3703('0x37')]]=_0x11f5ca;_[_0x3703('0x32')](_0x29a226[_0x3703('0x38')],_0x197eb2);}return _0x1019f2[_0x3703('0x1e')]('Account')[_0x3703('0x22')](_0x29a226,_0x552074);default:return null;}})[_0x3703('0x23')](function(_0x2b8737){if(_0x2b8737&&_0x2b8737[_0x3703('0x24')]){var _0xd33844=_[_0x3703('0x3b')](_0x2b8737);if(_0xd33844){return BPromise[_0x3703('0x27')]({'id':_0xd33844['Id'],'name':_0xd33844[_0x3703('0x28')],'phone':_0xd33844[_0x3703('0x3c')],'endUserType':_0xd33844[_0x3703('0x3d')][_0x3703('0x3e')][_0x3703('0x3f')]()});}}})[_0x3703('0x23')](function(_0x48f074){if(_0x48f074){logger['info'](_0x3703('0x40'),_0x48f074[_0x3703('0x15')],_0x11f5ca);return BPromise[_0x3703('0x27')](_0x48f074);}else{logger[_0x3703('0x1c')](_0x3703('0x41'),_0x11f5ca);var _0x38bb4c={'Phone':_0x11f5ca};if(_0x4d184a['moduleCreate']){if(_0x4d184a['moduleCreate']===_0x3703('0x18')){logger[_0x3703('0x1c')](_0x3703('0x42'),_0x11f5ca,_0x4d184a['moduleCreate']);_0x38bb4c[_0x3703('0x43')]=_0x949fa0!==_0x3703('0x44')?_0x949fa0:util[_0x3703('0x45')](_0x3703('0x46'),_0x11f5ca);}else if(_0x4d184a[_0x3703('0x47')]==='lead'){logger['info'](_0x3703('0x42'),_0x11f5ca,_0x4d184a[_0x3703('0x47')]);_0x38bb4c[_0x3703('0x43')]=_0x949fa0!==''?_0x949fa0:util[_0x3703('0x45')](_0x3703('0x46'),_0x11f5ca);_0x38bb4c[_0x3703('0x48')]=_0x3703('0x49');}else if(_0x4d184a[_0x3703('0x47')]===_0x3703('0x19')){logger['info'](_0x3703('0x42'),_0x11f5ca,_0x4d184a[_0x3703('0x47')]);_0x38bb4c['Name']=_0x949fa0!==''?_0x949fa0:util[_0x3703('0x45')](_0x3703('0x46'),_0x11f5ca);}else{return null;}}return _0x1019f2[_0x3703('0x1e')](_[_0x3703('0x4a')](_0x4d184a[_0x3703('0x47')]))[_0x3703('0x1f')](_0x38bb4c)[_0x3703('0x23')](function(_0x583d1e){return BPromise[_0x3703('0x27')]({'id':_0x583d1e['id'],'endUserType':_0x4d184a[_0x3703('0x47')]});});}});}function getCustomFields(_0x57f028,_0x2b4975){var _0x46f6df={};if(_0x57f028[_0x3703('0x24')]>0x0){_[_0x3703('0x4b')](_0x57f028,function(_0x368cef){if(_[_0x3703('0x4c')](['string',_0x3703('0x4d')],_0x368cef[_0x3703('0x3e')])&&_0x368cef[_0x3703('0x4e')]){_0x46f6df[_0x368cef[_0x3703('0x4e')]]=_0x368cef[_0x3703('0x4f')][_0x3703('0x50')]();}else if(_0x368cef[_0x3703('0x3e')]===_0x3703('0x51')&&_0x368cef[_0x3703('0x52')]&&_0x368cef[_0x3703('0x4e')]){_0x2b4975[_0x368cef['variableName']]&&(_0x46f6df[_0x368cef['idField']]=_0x2b4975[_0x368cef['variableName']][_0x3703('0x50')]());}else if(_0x368cef[_0x3703('0x3e')]==='customVariable'&&_0x368cef[_0x3703('0x53')]&&_0x368cef[_0x3703('0x53')][_0x3703('0x54')]&&_0x368cef[_0x3703('0x4e')]){_0x2b4975[_0x368cef['Variable'][_0x3703('0x54')]['toLowerCase']()]&&(_0x46f6df[_0x368cef[_0x3703('0x4e')]]=_0x2b4975[_0x368cef[_0x3703('0x53')][_0x3703('0x54')]['toLowerCase']()]['toString']());}});}return _0x46f6df;}function getConnection(_0x23abe4){var _0x29401c=_0x23abe4[_0x3703('0x55')][_0x3703('0x56')](_0x23abe4['securityToken']);var _0x18ab9c=new jsforce[(_0x3703('0x57'))]({'oauth2':{'loginUrl':_0x23abe4[_0x3703('0x58')]||_0x3703('0x59'),'clientId':_0x23abe4[_0x3703('0x5a')],'clientSecret':_0x23abe4[_0x3703('0x5b')]}});return _0x18ab9c[_0x3703('0x5c')](_0x23abe4['username'],_0x29401c)[_0x3703('0x23')](function(){logger[_0x3703('0x1c')](_0x3703('0x5d'));return _0x18ab9c;});}exports['queue']=function(_0x401dba,_0x1c0846,_0x10fe81,_0x17ca60,_0x53a19c,_0x24c4e0){var _0x2e61f5,_0x4efac1,_0x54e4b8,_0x40fc09;_0x24c4e0[_0x3703('0x5e')]=intUtil['stripTrailingSlash'](_0x24c4e0[_0x3703('0x5e')]);_0x24c4e0[_0x3703('0x58')]=intUtil['stripTrailingSlash'](_0x24c4e0['remoteUri']);if(_0x53a19c&&_0x53a19c[_0x3703('0x5f')]){logger[_0x3703('0x1c')](_0x3703('0x60'),_0x3703('0x61'));_0x1c0846[_0x3703('0x62')]=util[_0x3703('0x45')](_0x3703('0x63'),_0x24c4e0[_0x3703('0x5e')],_0x1c0846[_0x3703('0x64')],md5(_0x1c0846[_0x3703('0x64')]));}else{_0x1c0846['recordingURL']='';}return getConnection(_0x24c4e0)[_0x3703('0x23')](function(_0x519bf8){_0x40fc09=_0x519bf8;return getUser(_0x24c4e0,_0x17ca60[_0x3703('0x65')],_0x40fc09);})[_0x3703('0x23')](function(_0x98674f){_0x2e61f5=_0x98674f;return getEndUser(_0x24c4e0,_0x10fe81,_0x1c0846[_0x3703('0x66')],_0x1c0846[_0x3703('0x67')],_0x40fc09);})[_0x3703('0x23')](function(_0x2acade){_0x4efac1=_0x2acade;return getTicket(_0x24c4e0,_0x2e61f5,_0x4efac1,_0x10fe81,_0x1c0846,_0x10fe81['Fields'],_0x40fc09,'queue');})[_0x3703('0x23')](function(_0x2fdae5){_0x54e4b8=_0x2fdae5;logger[_0x3703('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x54e4b8['id']);logger[_0x3703('0x1c')](_0x3703('0x68'),_0x54e4b8['id'],_0x17ca60['name'],_0x24c4e0[_0x3703('0x3e')]);switch(_0x24c4e0['type']){case _0x3703('0x69'):emit(util[_0x3703('0x45')]('user:%s',_0x17ca60[_0x3703('0x54')]),_0x3703('0x6a'),{'recordId':_0x54e4b8['id']});break;case _0x3703('0x6b'):emit(util[_0x3703('0x45')]('user:%s',_0x17ca60[_0x3703('0x54')]),_0x3703('0x6c'),{'uri':util[_0x3703('0x45')](_0x3703('0x6d'),_0x40fc09[_0x3703('0x6e')],_0x54e4b8['id'])});break;default:logger[_0x3703('0x6f')](_0x3703('0x70'));}})[_0x3703('0x71')](function(_0x5667d5){logger[_0x3703('0x6f')](_0x3703('0x60'),_0x5667d5);});};exports[_0x3703('0x72')]=function(_0x76da5a,_0x17cfed,_0x24510b,_0x2e820d,_0x279550,_0x15b16e,_0x88ce46){var _0x77c30f,_0x20aba3,_0x19c625,_0x1da67b;_0x15b16e[_0x3703('0x5e')]=intUtil[_0x3703('0x73')](_0x15b16e[_0x3703('0x5e')]);_0x15b16e[_0x3703('0x58')]=intUtil[_0x3703('0x73')](_0x15b16e[_0x3703('0x58')]);if(_0x88ce46&&_0x88ce46[_0x3703('0x74')]&&_0x88ce46[_0x3703('0x74')]!==_0x3703('0x75')){logger[_0x3703('0x1c')](_0x3703('0x76'),_0x3703('0x61'));_0x17cfed['recordingURL']=util[_0x3703('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x15b16e[_0x3703('0x5e')],_0x17cfed['uniqueid'],md5(_0x17cfed[_0x3703('0x64')]));}return getConnection(_0x15b16e)[_0x3703('0x23')](function(_0x2f813c){_0x1da67b=_0x2f813c;return getUser(_0x15b16e,_0x2e820d['email'],_0x1da67b);})[_0x3703('0x23')](function(_0x187412){_0x77c30f=_0x187412;return getEndUser(_0x15b16e,_0x24510b,_0x17cfed['destcalleridname'],_0x17cfed['destcalleridnum'],_0x1da67b);})[_0x3703('0x23')](function(_0x590b80){_0x20aba3=_0x590b80;return getTicket(_0x15b16e,_0x77c30f,_0x20aba3,_0x24510b,_0x17cfed,_0x24510b['Fields'],_0x1da67b,_0x3703('0x72'));})[_0x3703('0x23')](function(_0x3df7f2){_0x19c625=_0x3df7f2;logger[_0x3703('0x1c')](_0x3703('0x77'),_0x19c625['id']);logger['info'](_0x3703('0x78'),_0x19c625['id'],_0x2e820d[_0x3703('0x54')],_0x15b16e[_0x3703('0x3e')]);switch(_0x15b16e[_0x3703('0x3e')]){case _0x3703('0x69'):emit(util['format']('user:%s',_0x2e820d[_0x3703('0x54')]),'trigger:salesforce:display',{'recordId':_0x19c625['id']});break;case _0x3703('0x6b'):emit(util['format']('user:%s',_0x2e820d['name']),'trigger:browser:url',{'uri':util[_0x3703('0x45')]('%s/%s/e',_0x1da67b[_0x3703('0x6e')],_0x19c625['id'])});break;default:logger['error'](_0x3703('0x76'),_0x3703('0x79'));}})[_0x3703('0x71')](function(_0x207c88){logger[_0x3703('0x6f')]('[OUTBOUND]',_0x207c88);});};exports[_0x3703('0x7a')]=function(_0xf93ea6,_0x3a67cd,_0x22c525,_0x522c92,_0x498287,_0x527ca0){var _0x4cf63a,_0x3964d0,_0x1fd1f2,_0x620d3;_0x527ca0[_0x3703('0x5e')]=intUtil['stripTrailingSlash'](_0x527ca0[_0x3703('0x5e')]);_0x527ca0[_0x3703('0x58')]=intUtil[_0x3703('0x73')](_0x527ca0[_0x3703('0x58')]);if(_0x498287&&_0x498287['monitor_format']){logger[_0x3703('0x1c')]('['+_0x3a67cd[_0x3703('0x7b')][_0x3703('0x7c')]()+']','Recording\x20is\x20enabled!');_0x3a67cd[_0x3703('0x62')]=util[_0x3703('0x45')](_0x3703('0x63'),_0x527ca0['serverUrl'],_0x3a67cd[_0x3703('0x64')],md5(_0x3a67cd['uniqueid']));}else{_0x3a67cd[_0x3703('0x62')]='';}return getConnection(_0x527ca0)[_0x3703('0x23')](function(_0x5f03a4){_0x620d3=_0x5f03a4;if(!_[_0x3703('0x20')](_0x522c92)){return getUser(_0x527ca0,_0x522c92['name'],_0x620d3);}else{return getUser(_0x527ca0,null,_0x620d3);}})[_0x3703('0x23')](function(_0x39dc65){_0x4cf63a=_0x39dc65;return getEndUser(_0x527ca0,_0x22c525,_0x3a67cd[_0x3703('0x66')],_0x3a67cd['calleridnum'],_0x620d3);})[_0x3703('0x23')](function(_0x1ccc55){_0x3964d0=_0x1ccc55;return getTicket(_0x527ca0,_0x4cf63a,_0x3964d0,_0x22c525,_0x3a67cd,_0x22c525['Fields'],_0x620d3);})['then'](function(_0x5e2e68){_0x1fd1f2=_0x5e2e68;logger['info']('['+_0x3a67cd[_0x3703('0x7b')][_0x3703('0x7c')]()+_0x3703('0x7d'),_0x1fd1f2['id']);logger['info']('['+_0x3a67cd[_0x3703('0x7b')][_0x3703('0x7c')]()+_0x3703('0x7e'),_0x527ca0[_0x3703('0x3e')]);})[_0x3703('0x71')](function(_0x40c42f){logger[_0x3703('0x6f')]('['+_0x3a67cd[_0x3703('0x7b')]['toUpperCase']()+']',_0x40c42f);});}; \ No newline at end of file +var _0x1fae=['identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','newTab','trigger:browser:url','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','user:%s','trigger:salesforce:display','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','info','sobject','create','isNil','validateEmail','execute','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name'];(function(_0x36221a,_0x4646d1){var _0x2a75ee=function(_0x13837b){while(--_0x13837b){_0x36221a['push'](_0x36221a['shift']());}};_0x2a75ee(++_0x4646d1);}(_0x1fae,0xd4));var _0xe1fa=function(_0x4d2a31,_0x2f1477){_0x4d2a31=_0x4d2a31-0x0;var _0x38e2f1=_0x1fae[_0x4d2a31];return _0x38e2f1;};'use strict';var _=require('lodash');var rp=require(_0xe1fa('0x0'));var moment=require(_0xe1fa('0x1'));var BPromise=require(_0xe1fa('0x2'));var md5=require(_0xe1fa('0x3'));var jsforce=require(_0xe1fa('0x4'));var util=require(_0xe1fa('0x5'));var Redis=require(_0xe1fa('0x6'));var intUtil=require(_0xe1fa('0x7'));var config=require(_0xe1fa('0x8'));var logger=require('../../../../config/logger')(_0xe1fa('0x9'));config[_0xe1fa('0xa')]=_[_0xe1fa('0xb')](config['redis'],{'host':_0xe1fa('0xc'),'port':0x18eb});var io=require(_0xe1fa('0xd'))(new Redis(config[_0xe1fa('0xa')]));function emit(_0x3ccba7,_0x13df78,_0x3ca873){io['to'](_0x3ccba7)[_0xe1fa('0xe')](_0x13df78,_0x3ca873);}function getTicket(_0x4632df,_0x359856,_0x25e8f9,_0x3387b1,_0x3a7d59,_0x198ab8,_0x567fd3,_0x5e4996){var _0x231513=Object[_0xe1fa('0xf')]({},{'OwnerId':_0x359856['id'],'Subject':intUtil[_0xe1fa('0x10')](_0x3387b1['Subjects'],_0x3a7d59,'\x20'),'Description':intUtil[_0xe1fa('0x10')](_0x3387b1[_0xe1fa('0x11')],_0x3a7d59,'\x0a')},getCustomFields(_0x198ab8,_0x3a7d59));if(_0x25e8f9){if(_0x3387b1[_0xe1fa('0x12')]==='Task'){_0x231513[_0xe1fa('0x13')]=moment[_0xe1fa('0x14')]();_0x231513[_0xe1fa('0x15')]=![];_0x231513['IsRecurrence']=![];if(_0x25e8f9[_0xe1fa('0x16')]==='contact'||_0x25e8f9['endUserType']===_0xe1fa('0x17')){_0x231513[_0xe1fa('0x18')]=_0x25e8f9['id'];}else if(_0x25e8f9[_0xe1fa('0x16')]===_0xe1fa('0x19')){_0x231513[_0xe1fa('0x1a')]=_0x25e8f9['id'];}}else if(_0x3387b1[_0xe1fa('0x12')]===_0xe1fa('0x1b')){if(_0x25e8f9[_0xe1fa('0x16')]===_0xe1fa('0x1c')){_0x231513[_0xe1fa('0x1d')]=_0x25e8f9['id'];}else if(_0x25e8f9[_0xe1fa('0x16')]===_0xe1fa('0x19')){_0x231513[_0xe1fa('0x1e')]=_0x25e8f9['id'];}else if(_0x25e8f9[_0xe1fa('0x16')]==='lead'&&_0x3387b1['leadId']){_0x231513[_0x3387b1['leadId']]=_0x25e8f9['id'];}else{logger[_0xe1fa('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x567fd3[_0xe1fa('0x20')](_0x3387b1[_0xe1fa('0x12')])[_0xe1fa('0x21')](_0x231513);}function getUser(_0x54f589,_0x41d620,_0x37751f){if(!_[_0xe1fa('0x22')](_0x41d620)&&intUtil[_0xe1fa('0x23')](_0x41d620)){var _0x4abe02={'Email':_0x41d620};var _0x2ffceb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x37751f['sobject']('User')['find'](_0x4abe02,_0x2ffceb)[_0xe1fa('0x24')]()[_0xe1fa('0x25')](function(_0x3222c7){if(_0x3222c7[_0xe1fa('0x26')]){var _0x3333e4=_[_0xe1fa('0x27')](_0x3222c7,function(_0x26cb82){return _0x26cb82[_0xe1fa('0x28')]===_0x41d620;});if(_0x3333e4){logger[_0xe1fa('0x1f')](_0xe1fa('0x29'),_0x41d620);return BPromise[_0xe1fa('0x2a')]({'id':_0x3333e4['Id'],'name':_0x3333e4[_0xe1fa('0x2b')]});}}else{logger[_0xe1fa('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x41d620);return _0x37751f[_0xe1fa('0x2c')]()[_0xe1fa('0x25')](function(_0x4cf905){return BPromise[_0xe1fa('0x2a')]({'id':_0x4cf905[_0xe1fa('0x2d')],'name':_0x4cf905[_0xe1fa('0x2e')]});});}});}else{logger[_0xe1fa('0x1f')](_0xe1fa('0x2f'),_0x41d620);return _0x37751f[_0xe1fa('0x2c')]()[_0xe1fa('0x25')](function(_0xf910de){return BPromise[_0xe1fa('0x2a')]({'id':_0xf910de['user_id'],'name':_0xf910de[_0xe1fa('0x2e')]});});}}function getEndUser(_0x3373d9,_0x44f476,_0x513bd8,_0x40676c,_0x50f8b4){var _0x1f0100={'$or':{'Phone':_0x40676c}};var _0x52db45={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe1fa('0x2a')]()[_0xe1fa('0x25')](function(){logger[_0xe1fa('0x1f')](_0xe1fa('0x30'),_0x40676c,_0x44f476[_0xe1fa('0x31')]);switch(_0x44f476[_0xe1fa('0x31')]){case _0xe1fa('0x32'):var _0x165a87=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476['additionalSearchContact']){var _0x5ca00a={};_0x5ca00a[_0x44f476[_0xe1fa('0x34')]]=_0x40676c;_[_0xe1fa('0x35')](_0x165a87[_0xe1fa('0x36')],_0x5ca00a);}return _0x50f8b4[_0xe1fa('0x20')]('Contact')[_0xe1fa('0x27')](_0x165a87,_0x52db45)[_0xe1fa('0x24')]()[_0xe1fa('0x25')](function(_0x1b6c61){if(_0x1b6c61&&_0x1b6c61[_0xe1fa('0x26')]){return _0x1b6c61;}else{var _0x4a0870=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476[_0xe1fa('0x37')]){var _0x4ca241={};_0x4ca241[_0x44f476['additionalSearchLead']]=_0x40676c;_['merge'](_0x4a0870[_0xe1fa('0x36')],_0x4ca241);}return _0x50f8b4[_0xe1fa('0x20')](_0xe1fa('0x38'))[_0xe1fa('0x27')](_0x4a0870,_0x52db45);}});case _0xe1fa('0x39'):var _0x48cbff=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476[_0xe1fa('0x3a')]){var _0x5ca00a={};_0x5ca00a[_0x44f476[_0xe1fa('0x3a')]]=_0x40676c;_[_0xe1fa('0x35')](_0x48cbff['$or'],_0x5ca00a);}return _0x50f8b4['sobject'](_0xe1fa('0x3b'))[_0xe1fa('0x27')](_0x48cbff,_0x52db45)[_0xe1fa('0x24')]()[_0xe1fa('0x25')](function(_0x1c1481){if(_0x1c1481&&_0x1c1481['length']){return _0x1c1481;}else{var _0x352322=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476[_0xe1fa('0x34')]){var _0x4483aa={};_0x4483aa[_0x44f476[_0xe1fa('0x34')]]=_0x40676c;_[_0xe1fa('0x35')](_0x352322[_0xe1fa('0x36')],_0x4483aa);}return _0x50f8b4[_0xe1fa('0x20')](_0xe1fa('0x3c'))[_0xe1fa('0x27')](_0x352322,_0x52db45)['then'](function(_0x2b432f){if(_0x2b432f&&_0x2b432f[_0xe1fa('0x26')]){return _0x2b432f;}else{var _0x3b0837=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476['additionalSearchLead']){var _0x354126={};_0x354126[_0x44f476['additionalSearchLead']]=_0x40676c;_[_0xe1fa('0x35')](_0x3b0837[_0xe1fa('0x36')],_0x354126);}return _0x50f8b4[_0xe1fa('0x20')]('Lead')[_0xe1fa('0x27')](_0x3b0837,_0x52db45);}});}});case _0xe1fa('0x1c'):var _0x165a87=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476[_0xe1fa('0x34')]){var _0x5ca00a={};_0x5ca00a[_0x44f476[_0xe1fa('0x34')]]=_0x40676c;_[_0xe1fa('0x35')](_0x165a87[_0xe1fa('0x36')],_0x5ca00a);}return _0x50f8b4[_0xe1fa('0x20')](_0xe1fa('0x3c'))[_0xe1fa('0x27')](_0x165a87,_0x52db45)['execute']();case _0xe1fa('0x17'):var _0x70f851=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476['additionalSearchLead']){var _0x5ca00a={};_0x5ca00a[_0x44f476[_0xe1fa('0x37')]]=_0x40676c;_['merge'](_0x70f851['$or'],_0x5ca00a);}return _0x50f8b4[_0xe1fa('0x20')](_0xe1fa('0x38'))[_0xe1fa('0x27')](_0x70f851,_0x52db45);case'account':var _0x48cbff=_[_0xe1fa('0x33')](_0x1f0100);if(_0x44f476[_0xe1fa('0x3a')]){var _0x5ca00a={};_0x5ca00a[_0x44f476[_0xe1fa('0x3a')]]=_0x40676c;_[_0xe1fa('0x35')](_0x48cbff[_0xe1fa('0x36')],_0x5ca00a);}return _0x50f8b4[_0xe1fa('0x20')](_0xe1fa('0x3b'))[_0xe1fa('0x27')](_0x48cbff,_0x52db45);default:return null;}})['then'](function(_0x45d0b1){if(_0x45d0b1&&_0x45d0b1[_0xe1fa('0x26')]){var _0x458499=_[_0xe1fa('0x3d')](_0x45d0b1);if(_0x458499){return BPromise[_0xe1fa('0x2a')]({'id':_0x458499['Id'],'name':_0x458499[_0xe1fa('0x2b')],'phone':_0x458499[_0xe1fa('0x3e')],'endUserType':_0x458499['attributes'][_0xe1fa('0x3f')]['toLowerCase']()});}}})[_0xe1fa('0x25')](function(_0x2d7152){if(_0x2d7152){logger[_0xe1fa('0x1f')](_0xe1fa('0x40'),_0x2d7152[_0xe1fa('0x16')],_0x40676c);return BPromise[_0xe1fa('0x2a')](_0x2d7152);}else{logger[_0xe1fa('0x1f')](_0xe1fa('0x41'),_0x40676c);var _0x5a4d1e={'Phone':_0x40676c};if(_0x44f476[_0xe1fa('0x42')]){if(_0x44f476[_0xe1fa('0x42')]===_0xe1fa('0x1c')){logger[_0xe1fa('0x1f')](_0xe1fa('0x43'),_0x40676c,_0x44f476[_0xe1fa('0x42')]);_0x5a4d1e[_0xe1fa('0x44')]=_0x513bd8!==_0xe1fa('0x45')?_0x513bd8:util[_0xe1fa('0x46')](_0xe1fa('0x47'),_0x40676c);}else if(_0x44f476['moduleCreate']===_0xe1fa('0x17')){logger[_0xe1fa('0x1f')](_0xe1fa('0x43'),_0x40676c,_0x44f476[_0xe1fa('0x42')]);_0x5a4d1e[_0xe1fa('0x44')]=_0x513bd8!==_0xe1fa('0x45')?_0x513bd8:util[_0xe1fa('0x46')](_0xe1fa('0x47'),_0x40676c);_0x5a4d1e['Company']='No\x20Company';}else if(_0x44f476[_0xe1fa('0x42')]===_0xe1fa('0x19')){logger[_0xe1fa('0x1f')](_0xe1fa('0x43'),_0x40676c,_0x44f476[_0xe1fa('0x42')]);_0x5a4d1e[_0xe1fa('0x2b')]=_0x513bd8!==''?_0x513bd8:util['format'](_0xe1fa('0x47'),_0x40676c);}else{return null;}}return _0x50f8b4[_0xe1fa('0x20')](_[_0xe1fa('0x48')](_0x44f476[_0xe1fa('0x42')]))[_0xe1fa('0x21')](_0x5a4d1e)[_0xe1fa('0x25')](function(_0x556635){return BPromise[_0xe1fa('0x2a')]({'id':_0x556635['id'],'endUserType':_0x44f476[_0xe1fa('0x42')]});});}});}function getCustomFields(_0x32f959,_0x40a5ab){var _0x4ca2ce={};if(_0x32f959['length']>0x0){_[_0xe1fa('0x49')](_0x32f959,function(_0x12cea7){if(_[_0xe1fa('0x4a')]([_0xe1fa('0x4b'),_0xe1fa('0x4c')],_0x12cea7[_0xe1fa('0x3f')])&&_0x12cea7[_0xe1fa('0x4d')]){_0x4ca2ce[_0x12cea7[_0xe1fa('0x4d')]]=_0x12cea7[_0xe1fa('0x4e')][_0xe1fa('0x4f')]();}else if(_0x12cea7[_0xe1fa('0x3f')]===_0xe1fa('0x50')&&_0x12cea7[_0xe1fa('0x51')]&&_0x12cea7[_0xe1fa('0x4d')]){_0x40a5ab[_0x12cea7[_0xe1fa('0x51')]]&&(_0x4ca2ce[_0x12cea7[_0xe1fa('0x4d')]]=_0x40a5ab[_0x12cea7['variableName']]['toString']());}else if(_0x12cea7[_0xe1fa('0x3f')]===_0xe1fa('0x52')&&_0x12cea7[_0xe1fa('0x53')]&&_0x12cea7['Variable']['name']&&_0x12cea7[_0xe1fa('0x4d')]){_0x40a5ab[_0x12cea7[_0xe1fa('0x53')]['name']['toLowerCase']()]&&(_0x4ca2ce[_0x12cea7['idField']]=_0x40a5ab[_0x12cea7['Variable'][_0xe1fa('0x54')][_0xe1fa('0x55')]()]['toString']());}});}return _0x4ca2ce;}function getConnection(_0x3a7ff0){var _0x329a84=_0x3a7ff0['password'][_0xe1fa('0x56')](_0x3a7ff0['securityToken']);var _0x5d9431=new jsforce[(_0xe1fa('0x57'))]({'oauth2':{'loginUrl':_0x3a7ff0[_0xe1fa('0x58')]||_0xe1fa('0x59'),'clientId':_0x3a7ff0[_0xe1fa('0x5a')],'clientSecret':_0x3a7ff0[_0xe1fa('0x5b')]}});return _0x5d9431['login'](_0x3a7ff0[_0xe1fa('0x5c')],_0x329a84)['then'](function(){logger[_0xe1fa('0x1f')]('Connection\x20established.');return _0x5d9431;});}exports['queue']=function(_0x9ed635,_0x11cc5c,_0x55bd49,_0x156c7d,_0x59453e,_0x4c34b4){var _0x428974,_0x1aa8f5,_0x3b6147,_0x1ae46f;_0x4c34b4['serverUrl']=intUtil[_0xe1fa('0x5d')](_0x4c34b4[_0xe1fa('0x5e')]);_0x4c34b4['remoteUri']=intUtil[_0xe1fa('0x5d')](_0x4c34b4['remoteUri']);if(_0x59453e&&_0x59453e[_0xe1fa('0x5f')]){logger[_0xe1fa('0x1f')](_0xe1fa('0x60'),'Recording\x20is\x20enabled!');_0x11cc5c[_0xe1fa('0x61')]=util[_0xe1fa('0x46')](_0xe1fa('0x62'),_0x4c34b4[_0xe1fa('0x5e')],_0x11cc5c[_0xe1fa('0x63')],md5(_0x11cc5c[_0xe1fa('0x63')]));}else{_0x11cc5c[_0xe1fa('0x61')]='';}return getConnection(_0x4c34b4)[_0xe1fa('0x25')](function(_0x3a58c2){_0x1ae46f=_0x3a58c2;return getUser(_0x4c34b4,_0x156c7d[_0xe1fa('0x64')],_0x1ae46f);})[_0xe1fa('0x25')](function(_0x46c845){_0x428974=_0x46c845;return getEndUser(_0x4c34b4,_0x55bd49,_0x11cc5c[_0xe1fa('0x65')],_0x11cc5c[_0xe1fa('0x66')],_0x1ae46f);})[_0xe1fa('0x25')](function(_0x56e5f2){_0x1aa8f5=_0x56e5f2;return getTicket(_0x4c34b4,_0x428974,_0x1aa8f5,_0x55bd49,_0x11cc5c,_0x55bd49[_0xe1fa('0x67')],_0x1ae46f,_0xe1fa('0x68'));})[_0xe1fa('0x25')](function(_0x184e87){_0x3b6147=_0x184e87;logger[_0xe1fa('0x1f')](_0xe1fa('0x69'),_0x3b6147['id']);logger[_0xe1fa('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3b6147['id'],_0x156c7d['name'],_0x4c34b4[_0xe1fa('0x3f')]);switch(_0x4c34b4[_0xe1fa('0x3f')]){case _0xe1fa('0x6a'):emit(util[_0xe1fa('0x46')]('user:%s',_0x156c7d[_0xe1fa('0x54')]),'trigger:salesforce:display',{'recordId':_0x3b6147['id']});break;case _0xe1fa('0x6b'):emit(util['format']('user:%s',_0x156c7d[_0xe1fa('0x54')]),_0xe1fa('0x6c'),{'uri':util[_0xe1fa('0x46')]('%s/%s/e',_0x1ae46f[_0xe1fa('0x6d')],_0x3b6147['id'])});break;default:logger[_0xe1fa('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xe1fa('0x6f')](function(_0x3d0a19){logger['error'](_0xe1fa('0x60'),_0x3d0a19);});};exports['outbound']=function(_0x56f223,_0x361f16,_0x2a3361,_0x16e317,_0x5b7f56,_0x5374ac,_0x356d4e){var _0x7420ac,_0x5d4875,_0x713b7a,_0x2094ae;_0x5374ac['serverUrl']=intUtil[_0xe1fa('0x5d')](_0x5374ac[_0xe1fa('0x5e')]);_0x5374ac[_0xe1fa('0x58')]=intUtil[_0xe1fa('0x5d')](_0x5374ac['remoteUri']);if(_0x356d4e&&_0x356d4e['recordingFormat']&&_0x356d4e[_0xe1fa('0x70')]!==_0xe1fa('0x71')){logger[_0xe1fa('0x1f')](_0xe1fa('0x72'),'Recording\x20is\x20enabled!');_0x361f16[_0xe1fa('0x61')]=util[_0xe1fa('0x46')](_0xe1fa('0x62'),_0x5374ac[_0xe1fa('0x5e')],_0x361f16[_0xe1fa('0x63')],md5(_0x361f16['uniqueid']));}return getConnection(_0x5374ac)[_0xe1fa('0x25')](function(_0x3522a6){_0x2094ae=_0x3522a6;return getUser(_0x5374ac,_0x16e317[_0xe1fa('0x64')],_0x2094ae);})['then'](function(_0x547461){_0x7420ac=_0x547461;return getEndUser(_0x5374ac,_0x2a3361,_0x361f16[_0xe1fa('0x73')],_0x361f16[_0xe1fa('0x74')],_0x2094ae);})[_0xe1fa('0x25')](function(_0x234a94){_0x5d4875=_0x234a94;return getTicket(_0x5374ac,_0x7420ac,_0x5d4875,_0x2a3361,_0x361f16,_0x2a3361['Fields'],_0x2094ae,_0xe1fa('0x75'));})[_0xe1fa('0x25')](function(_0x1f7785){_0x713b7a=_0x1f7785;logger[_0xe1fa('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x713b7a['id']);logger[_0xe1fa('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x713b7a['id'],_0x16e317[_0xe1fa('0x54')],_0x5374ac['type']);switch(_0x5374ac[_0xe1fa('0x3f')]){case _0xe1fa('0x6a'):emit(util[_0xe1fa('0x46')](_0xe1fa('0x76'),_0x16e317['name']),_0xe1fa('0x77'),{'recordId':_0x713b7a['id']});break;case'newTab':emit(util[_0xe1fa('0x46')](_0xe1fa('0x76'),_0x16e317[_0xe1fa('0x54')]),'trigger:browser:url',{'uri':util[_0xe1fa('0x46')](_0xe1fa('0x78'),_0x2094ae['instanceUrl'],_0x713b7a['id'])});break;default:logger[_0xe1fa('0x6e')](_0xe1fa('0x72'),_0xe1fa('0x79'));}})[_0xe1fa('0x6f')](function(_0x2f37c0){logger['error'](_0xe1fa('0x72'),_0x2f37c0);});};exports[_0xe1fa('0x7a')]=function(_0x580cd5,_0x43b2a1,_0x3cd233,_0x26186a,_0x4ac18f,_0x2cfd9a){var _0x4aaba3,_0x54d757,_0x12d611,_0x1ebab6;_0x2cfd9a[_0xe1fa('0x5e')]=intUtil[_0xe1fa('0x5d')](_0x2cfd9a[_0xe1fa('0x5e')]);_0x2cfd9a['remoteUri']=intUtil[_0xe1fa('0x5d')](_0x2cfd9a[_0xe1fa('0x58')]);if(_0x4ac18f&&_0x4ac18f[_0xe1fa('0x5f')]){logger[_0xe1fa('0x1f')]('['+_0x43b2a1['lastevent'][_0xe1fa('0x7b')]()+']',_0xe1fa('0x7c'));_0x43b2a1['recordingURL']=util[_0xe1fa('0x46')](_0xe1fa('0x62'),_0x2cfd9a[_0xe1fa('0x5e')],_0x43b2a1[_0xe1fa('0x63')],md5(_0x43b2a1[_0xe1fa('0x63')]));}else{_0x43b2a1['recordingURL']='';}return getConnection(_0x2cfd9a)[_0xe1fa('0x25')](function(_0x47d210){_0x1ebab6=_0x47d210;if(!_[_0xe1fa('0x22')](_0x26186a)){return getUser(_0x2cfd9a,_0x26186a[_0xe1fa('0x54')],_0x1ebab6);}else{return getUser(_0x2cfd9a,null,_0x1ebab6);}})['then'](function(_0x328d98){_0x4aaba3=_0x328d98;return getEndUser(_0x2cfd9a,_0x3cd233,_0x43b2a1[_0xe1fa('0x65')],_0x43b2a1[_0xe1fa('0x66')],_0x1ebab6);})[_0xe1fa('0x25')](function(_0x2dd1f4){_0x54d757=_0x2dd1f4;return getTicket(_0x2cfd9a,_0x4aaba3,_0x54d757,_0x3cd233,_0x43b2a1,_0x3cd233[_0xe1fa('0x67')],_0x1ebab6);})[_0xe1fa('0x25')](function(_0xb596ae){_0x12d611=_0xb596ae;logger[_0xe1fa('0x1f')]('['+_0x43b2a1[_0xe1fa('0x7d')][_0xe1fa('0x7b')]()+_0xe1fa('0x7e'),_0x12d611['id']);logger[_0xe1fa('0x1f')]('['+_0x43b2a1[_0xe1fa('0x7d')][_0xe1fa('0x7b')]()+_0xe1fa('0x7f'),_0x2cfd9a[_0xe1fa('0x3f')]);})[_0xe1fa('0x6f')](function(_0x1ffcdc){logger[_0xe1fa('0x6e')]('['+_0x43b2a1[_0xe1fa('0x7d')][_0xe1fa('0x7b')]()+']',_0x1ffcdc);});}; \ 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 547bd20..63c3ec7 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 _0xbfc2=['Incident','ticketId','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','email','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','adminId','sys_id','info','toUpperCase','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','System','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','label_entry'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0xbfc2,0x1e3));var _0x2bfc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xbfc2[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2bfc('0x0'));var Promise=require(_0x2bfc('0x1'));var rp=require(_0x2bfc('0x2'));var util=require(_0x2bfc('0x3'));var md5=require(_0x2bfc('0x4'));var Redis=require(_0x2bfc('0x5'));var intUtil=require(_0x2bfc('0x6'));var config=require(_0x2bfc('0x7'));var logger=require(_0x2bfc('0x8'))(_0x2bfc('0x9'));config[_0x2bfc('0xa')]=_[_0x2bfc('0xb')](config['redis'],{'host':_0x2bfc('0xc'),'port':0x18eb});var io=require(_0x2bfc('0xd'))(new Redis(config[_0x2bfc('0xa')]));function getAdminUser(_0x2b00a7,_0x1af245,_0x2ac148,_0x4b0254,_0x260a23,_0x43cf70){return new Promise(function(_0xb70aea,_0x3aa33b){var _0x3c888f={'method':_0x2bfc('0xe'),'uri':_0x4b0254+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x260a23+'&'+_0x43cf70,'auth':_0x1af245,'json':!![]};return rp(_0x3c888f)[_0x2bfc('0xf')](function(_0xbc29a){if(_0xbc29a[_0x2bfc('0x10')]['length']>0x0){_0x2ac148[_0x2bfc('0x11')]=_0xbc29a[_0x2bfc('0x10')][0x0][_0x2bfc('0x12')];}logger[_0x2bfc('0x13')]('['+[_0x2b00a7[_0x2bfc('0x14')]()]+'],\x20getAdminUser\x20crm',_0x2ac148);_0xb70aea(_0x2ac148);})[_0x2bfc('0x15')](function(_0x4b4dd2){logger[_0x2bfc('0x16')]('['+[_0x2b00a7[_0x2bfc('0x14')]()]+']',_0x4b4dd2[_0x2bfc('0x17')]);_0x3aa33b(_0x4b4dd2[_0x2bfc('0x17')]);});});}function getUser(_0x38f099,_0x89f39e,_0x3ad75b,_0x2d91ce,_0x52c276){return function(_0x207de4){logger[_0x2bfc('0x13')]('['+[_0x38f099['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x207de4);return new Promise(function(_0x16b568,_0x5d5353){if(intUtil[_0x2bfc('0x18')](_0x207de4[_0x2bfc('0x19')])){var _0x19f460={'method':'GET','uri':_0x3ad75b+_0x2bfc('0x1a')+_0x207de4[_0x2bfc('0x19')]+'&'+_0x2d91ce+'&'+_0x52c276,'auth':_0x89f39e,'json':!![]};logger[_0x2bfc('0x13')]('['+[_0x38f099[_0x2bfc('0x14')]()]+'],\x20getUser\x20rp\x20obj',_0x19f460);return rp(_0x19f460)[_0x2bfc('0xf')](function(_0x2e0717){logger[_0x2bfc('0x13')]('['+[_0x38f099['toUpperCase']()]+_0x2bfc('0x1b'),_0x2e0717);if(_0x2e0717[_0x2bfc('0x10')]['length']>0x0&&String(_0x2e0717[_0x2bfc('0x10')][0x0][_0x2bfc('0x1c')])===_0x2bfc('0x1d')){_0x207de4[_0x2bfc('0x1e')]=_0x2e0717['result'][0x0][_0x2bfc('0x12')];}else{_0x207de4[_0x2bfc('0x1e')]=_0x207de4[_0x2bfc('0x11')];_0x207de4[_0x2bfc('0x19')]=_0x207de4[_0x2bfc('0x1f')];}logger['info']('['+[_0x38f099[_0x2bfc('0x14')]()]+_0x2bfc('0x20'),_0x207de4);_0x16b568(_0x207de4);})['catch'](function(_0x497a8c){logger[_0x2bfc('0x16')]('['+[_0x38f099['toUpperCase']()]+']',_0x497a8c[_0x2bfc('0x17')]);_0x5d5353(_0x497a8c[_0x2bfc('0x17')]);});}else{logger[_0x2bfc('0x13')]('['+[_0x38f099[_0x2bfc('0x14')]()]+_0x2bfc('0x21'));_0x207de4[_0x2bfc('0x1e')]=_0x207de4[_0x2bfc('0x11')];_0x207de4[_0x2bfc('0x19')]=_0x207de4[_0x2bfc('0x1f')];_0x16b568(_0x207de4);}});};}function createEndUser(_0x4a83f7,_0x40e008,_0x413228,_0x5751ac,_0x1c772d){logger[_0x2bfc('0x13')]('['+[_0x4a83f7['toUpperCase']()]+_0x2bfc('0x22'),_0x413228);return new Promise(function(_0x81ed57,_0x562508){var _0x18df61={'method':_0x2bfc('0x23'),'uri':_0x5751ac+_0x2bfc('0x24')+_0x1c772d,'body':{'user_name':_0x413228['endUserNumber'],'roles':'user','first_name':_0x413228['endUserNumber'],'active':_0x2bfc('0x1d'),'date_format':_0x2bfc('0x25'),'phone':_0x413228[_0x2bfc('0x26')]},'auth':_0x40e008,'json':!![]};return rp(_0x18df61)['then'](function(_0x153be6){logger[_0x2bfc('0x13')]('['+[_0x4a83f7[_0x2bfc('0x14')]()]+_0x2bfc('0x27'),_0x153be6[_0x2bfc('0x10')]);_0x413228[_0x2bfc('0x28')]=_0x153be6['result']['sys_id'];_0x81ed57(_0x413228);})[_0x2bfc('0x15')](function(_0x3c49f){logger['error']('['+[_0x4a83f7[_0x2bfc('0x14')]()]+']',_0x3c49f[_0x2bfc('0x17')]);_0x562508(_0x3c49f[_0x2bfc('0x17')]);});});}function getEndUser(_0x439c69,_0x3262e4,_0x2db64a,_0x4bacc0,_0x1199ee){return function(_0x291adf){logger[_0x2bfc('0x13')]('['+[_0x439c69[_0x2bfc('0x14')]()]+_0x2bfc('0x29'),_0x291adf);return new Promise(function(_0x286b19,_0x222a63){var _0x562fed={'method':_0x2bfc('0xe'),'uri':_0x2db64a+_0x2bfc('0x2a')+_0x291adf[_0x2bfc('0x26')]+'&'+_0x4bacc0+'&'+_0x1199ee,'auth':_0x3262e4,'json':!![]};return rp(_0x562fed)[_0x2bfc('0xf')](function(_0xa77ac1){if(_0xa77ac1[_0x2bfc('0x10')][_0x2bfc('0x2b')]>0x0){_0x291adf[_0x2bfc('0x28')]=_0xa77ac1['result'][0x0]['sys_id'];logger[_0x2bfc('0x13')]('['+[_0x439c69['toUpperCase']()]+_0x2bfc('0x2c'),_0x291adf);_0x286b19(_0x291adf);}else{return createEndUser(_0x439c69,_0x3262e4,_0x291adf,_0x2db64a,_0x4bacc0)[_0x2bfc('0xf')](function(_0x4a5752){logger[_0x2bfc('0x13')]('['+[_0x439c69[_0x2bfc('0x14')]()]+'],\x20createEndUser\x20crm',_0x4a5752);_0x286b19(_0x4a5752);});}})[_0x2bfc('0x15')](function(_0x5b8264){logger[_0x2bfc('0x16')]('['+[_0x439c69[_0x2bfc('0x14')]()]+']',_0x5b8264['message']);_0x222a63(_0x5b8264[_0x2bfc('0x17')]);});});};}function getCustomFields(_0x1c6555,_0x32cd54){var _0x494b97={};if(_0x1c6555[_0x2bfc('0x2b')]>0x0){_[_0x2bfc('0x2d')](_0x1c6555,function(_0x4e615b){if(_[_0x2bfc('0x2e')]([_0x2bfc('0x2f'),'picklist'],_0x4e615b[_0x2bfc('0x30')])&&_0x4e615b[_0x2bfc('0x31')]&&!_0x4e615b[_0x2bfc('0x32')]){_0x494b97[_0x4e615b[_0x2bfc('0x31')][_0x2bfc('0x33')]()]=_0x4e615b[_0x2bfc('0x34')][_0x2bfc('0x35')]();}else if(_[_0x2bfc('0x2e')]([_0x2bfc('0x2f'),_0x2bfc('0x36')],_0x4e615b[_0x2bfc('0x30')])&&_0x4e615b[_0x2bfc('0x37')]&&_0x4e615b['customField']){_0x494b97[_0x4e615b[_0x2bfc('0x37')][_0x2bfc('0x33')]()]=_0x4e615b[_0x2bfc('0x34')][_0x2bfc('0x35')]();}else if(_0x4e615b[_0x2bfc('0x30')]==='variable'&&_0x4e615b[_0x2bfc('0x38')]&&_0x4e615b[_0x2bfc('0x37')]&&_0x4e615b['customField']){_0x494b97[_0x4e615b[_0x2bfc('0x37')][_0x2bfc('0x33')]()]=_0x32cd54[_0x4e615b[_0x2bfc('0x38')]][_0x2bfc('0x35')]();}else if(_0x4e615b['type']===_0x2bfc('0x39')&&_0x4e615b[_0x2bfc('0x3a')]&&_0x4e615b['Variable'][_0x2bfc('0x3b')]&&_0x4e615b[_0x2bfc('0x37')]&&_0x4e615b['customField']){_0x494b97[_0x4e615b[_0x2bfc('0x37')][_0x2bfc('0x33')]()]=_0x32cd54[_0x4e615b['Variable'][_0x2bfc('0x3b')][_0x2bfc('0x33')]()][_0x2bfc('0x35')]();}});}return _0x494b97;}function getTicket(_0x48d6b2,_0x55685c,_0x717501,_0x92d43b,_0x5b2fbc,_0x2a9ae3){return function(_0x24f9fb){logger[_0x2bfc('0x13')]('['+[_0x48d6b2[_0x2bfc('0x14')]()]+_0x2bfc('0x3c'),_0x24f9fb);return new Promise(function(_0x4398c9,_0x1f6a4c){var _0x5f56db=_0x48d6b2[_0x2bfc('0x33')]()==='outbound'?_0x24f9fb[_0x2bfc('0x1e')]:_0x24f9fb[_0x2bfc('0x28')];var _0x31ba37={'method':_0x2bfc('0x23'),'uri':_0x717501+_0x2bfc('0x3d')+'?'+_0x2a9ae3,'body':Object['assign']({},{'active':_0x2bfc('0x1d'),'caller_id':_0x5f56db,'assigned_to':_0x24f9fb['userId'],'short_description':intUtil[_0x2bfc('0x3e')](_0x92d43b[_0x2bfc('0x3f')],_0x5b2fbc,'\x20'),'description':intUtil[_0x2bfc('0x3e')](_0x92d43b[_0x2bfc('0x40')],_0x5b2fbc,'\x0a')},getCustomFields(_0x92d43b[_0x2bfc('0x41')],_0x5b2fbc)),'auth':_0x55685c,'json':!![]};return rp(_0x31ba37)[_0x2bfc('0xf')](function(_0x281a2f){logger[_0x2bfc('0x13')]('['+[_0x48d6b2[_0x2bfc('0x14')]()]+_0x2bfc('0x42'),_0x281a2f['result']);_0x24f9fb['ticketId']=_0x281a2f[_0x2bfc('0x10')][_0x2bfc('0x12')];_0x24f9fb[_0x2bfc('0x43')]=_0x281a2f['result'][_0x2bfc('0x44')];logger[_0x2bfc('0x13')]('['+[_0x48d6b2[_0x2bfc('0x14')]()]+']\x20getTicket\x20crm',_0x24f9fb);_0x4398c9(_0x24f9fb);})[_0x2bfc('0x15')](function(_0x1eb5ab){logger['error']('['+[_0x48d6b2['toUpperCase']()]+']',_0x1eb5ab[_0x2bfc('0x17')]);_0x1f6a4c(_0x1eb5ab['message']);});});};}function createRemoteTag(_0x2f6fd5,_0x3a53b6,_0x78ba3c,_0x5628b7){return new Promise(function(_0x9a0bec,_0x6fb442){var _0x3cea64={'method':_0x2bfc('0x23'),'uri':_0x78ba3c+_0x2bfc('0x45')+'?'+_0x5628b7,'body':{'short_description':_0x2f6fd5,'global':!![],'active':!![],'name':_0x2f6fd5},'auth':_0x3a53b6,'json':!![]};return rp(_0x3cea64)[_0x2bfc('0xf')](function(_0x9b5dd2){var _0x32cf81=_0x9b5dd2[_0x2bfc('0x10')][_0x2bfc('0x12')];_0x9a0bec(_0x32cf81);});});}function getRemoteTag(_0x5063b8,_0x3773e7,_0x4791bf,_0x20aa8c,_0x3abb27){return new Promise(function(_0x4915bb,_0x2ca44a){var _0x5a7dcb={'method':_0x2bfc('0xe'),'uri':_0x4791bf+_0x2bfc('0x45')+_0x2bfc('0x46')+_0x5063b8+'&'+_0x20aa8c,'auth':_0x3773e7,'json':!![]};return rp(_0x5a7dcb)[_0x2bfc('0xf')](function(_0x4e623d){if(_0x4e623d[_0x2bfc('0x10')][_0x2bfc('0x2b')]>0x0){var _0x2a0ed1=_0x4e623d['result'][0x0][_0x2bfc('0x12')];_0x4915bb(_0x2a0ed1);}else{return createRemoteTag(_0x5063b8,_0x3773e7,_0x4791bf,_0x20aa8c)['then'](function(_0x46613){_0x4915bb(_0x46613);});}});});}function assignTagToIncident(_0x2ec454,_0x3e0e70,_0x284247,_0x1d6d55,_0x35f3a1){return new Promise(function(_0x37631b,_0x433614){var _0x540c4a={'method':'POST','uri':_0x284247+_0x2bfc('0x47')+'?'+_0x35f3a1,'body':{'label':_0x2ec454,'table':_0x2bfc('0x3d'),'id_type':_0x2bfc('0x48'),'table_key':_0x1d6d55[_0x2bfc('0x49')],'title':'Incident\x20-\x20'+_0x1d6d55['ticketNumber'],'id_display':_0x1d6d55[_0x2bfc('0x43')]},'auth':_0x3e0e70,'json':!![]};return rp(_0x540c4a)[_0x2bfc('0xf')](function(_0x25d06f){_0x37631b();})[_0x2bfc('0x15')](function(){_0x37631b();});});}function manageTags(_0x1c2261,_0x43a0cd,_0x8287f0,_0x520fa3,_0x12df78,_0xb90b80,_0x346d7a){return new Promise(function(_0x1eb7f8,_0xdcb401){var _0x21fb3d=[];_0x43a0cd[_0x2bfc('0x2d')](function(_0x4e705c){_0x21fb3d[_0x2bfc('0x4a')](getRemoteTag(_0x4e705c,_0x8287f0,_0x520fa3,_0xb90b80,_0x346d7a));});return Promise['all'](_0x21fb3d)[_0x2bfc('0xf')](function(_0x2b5cb6){if(_0x2b5cb6[_0x2bfc('0x2b')]){logger[_0x2bfc('0x13')]('['+[_0x1c2261[_0x2bfc('0x14')]()]+_0x2bfc('0x4b'),_0x2b5cb6);var _0x3ffcf7=[];_0x2b5cb6[_0x2bfc('0x2d')](function(_0x2805a4){_0x3ffcf7['push'](assignTagToIncident(_0x2805a4,_0x8287f0,_0x520fa3,_0x12df78,_0xb90b80));});return Promise[_0x2bfc('0x4c')](_0x3ffcf7)['then'](function(){_0x1eb7f8();})[_0x2bfc('0x15')](function(){_0x1eb7f8();});}else{_0x1eb7f8();}});});}function getTags(_0x354cfa,_0x1731bb,_0x361dc3,_0x240850,_0x7ce391,_0x2ebfe1){return function(_0xfdf6ba){return new Promise(function(_0x4d45c0,_0x238831){var _0x21ec22=[];var _0x3a37ec=_0x240850[_0x2bfc('0x4d')];if(_0x3a37ec&&_0x3a37ec[_0x2bfc('0x2b')]>0x0){_0x21ec22=_['map'](_0x3a37ec,_0x2bfc('0x3b'));}if(_0x21ec22[_0x2bfc('0x2b')]>0x0){return manageTags(_0x354cfa,_0x21ec22,_0x1731bb,_0x361dc3,_0xfdf6ba,_0x7ce391,_0x2ebfe1)[_0x2bfc('0xf')](function(){_0x4d45c0(_0xfdf6ba);});}else{_0x4d45c0(_0xfdf6ba);}});};}function emit(_0x2e620c,_0x4ef0db,_0x680d63){var _0x382ea2=_0x2bfc('0x4e')+_0x2bfc('0x4f')+_0x2bfc('0x50')+_0x2bfc('0x51');var _0x1cda15={'uri':_0x2e620c+_0x2bfc('0x52')+_0x680d63+_0x382ea2};io['to'](util[_0x2bfc('0x53')](_0x2bfc('0x54'),_0x4ef0db))['emit'](_0x2bfc('0x55'),_0x1cda15);}exports['cs']=function(_0xc056b8,_0x2e9098,_0x3e3eed,_0x2dcfd3,_0x43a67d,_0x535210,_0x168c8b,_0xdd3203){var _0x461a73={};var _0x209db5={'user':_0x535210['username'],'pass':_0x535210[_0x2bfc('0x56')]};var _0x33d6e2=_0x2bfc('0x57');var _0x1a09be='sysparm_display_value=true';_0x535210[_0x2bfc('0x58')]=intUtil[_0x2bfc('0x59')](_0x535210[_0x2bfc('0x58')]);_0x535210[_0x2bfc('0x5a')]=intUtil[_0x2bfc('0x59')](_0x535210[_0x2bfc('0x5a')]);var _0x4f781c=util[_0x2bfc('0x53')]('%s/api/now/table/',_0x535210['remoteUri']);_0x461a73[_0x2bfc('0x19')]=!_['isNil'](_0x2dcfd3)?_0x2dcfd3[_0x2bfc('0x5b')]:null;_0x461a73[_0x2bfc('0x1f')]=_0x535210[_0x2bfc('0x5b')];_0x461a73['endUserNumber']=_0xdd3203[_0x2bfc('0x33')]()===_0x2bfc('0x5c')?_0x2e9098[_0x2bfc('0x5d')]:_0x2e9098[_0x2bfc('0x5e')];_0x461a73[_0x2bfc('0x5f')]=_0xdd3203==='queue'||_0xdd3203==='unmanaged'?'queue':_0x2bfc('0x5c');var _0x5e0b85=util[_0x2bfc('0x53')](_0x2bfc('0x60'),_0x535210['serverUrl'],_0x2e9098[_0x2bfc('0x61')],md5(_0x2e9098[_0x2bfc('0x61')]));if(_0x43a67d&&_0x43a67d[_0x2bfc('0x62')]){logger[_0x2bfc('0x13')](_0x2bfc('0x63'),_0x2bfc('0x64'));_0x2e9098[_0x2bfc('0x65')]=_0x5e0b85;}else if(_0x168c8b&&_0x168c8b[_0x2bfc('0x66')]&&_0x168c8b['recordingFormat']!==_0x2bfc('0x67')){logger['info'](_0x2bfc('0x68'),_0x2bfc('0x64'));_0x2e9098['recordingURL']=_0x5e0b85;}else{_0x2e9098['recordingURL']='';}return getAdminUser(_0xdd3203,_0x209db5,_0x461a73,_0x4f781c,_0x1a09be,_0x33d6e2)[_0x2bfc('0xf')](getUser(_0xdd3203,_0x209db5,_0x4f781c,_0x1a09be,_0x33d6e2))[_0x2bfc('0xf')](getEndUser(_0xdd3203,_0x209db5,_0x4f781c,_0x1a09be,_0x33d6e2))[_0x2bfc('0xf')](getTicket(_0xdd3203,_0x209db5,_0x4f781c,_0x3e3eed,_0x2e9098,_0x1a09be))[_0x2bfc('0xf')](function(_0x38c015){logger[_0x2bfc('0x13')](util['format'](_0x2bfc('0x69'),_0x38c015['ticketId']));logger[_0x2bfc('0x13')](util[_0x2bfc('0x53')](_0x2bfc('0x6a'),_0xdd3203));if(_0xdd3203!==_0x2bfc('0x6b')){logger[_0x2bfc('0x13')]('['+[_0xdd3203[_0x2bfc('0x14')]()]+']',_0x2bfc('0x6c'));emit(_0x535210['remoteUri'],_0x2dcfd3[_0x2bfc('0x3b')],_0x38c015['ticketId']);}})['catch'](function(_0x1cd031){logger['error']('['+[_0xdd3203['toUpperCase']()]+_0x2bfc('0x6d'),util[_0x2bfc('0x6e')](_0x1cd031,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7886=['POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','nameField','toLowerCase','content','toString','includes','picklist','customField','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/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','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm','catch'];(function(_0x4b0208,_0xf4ae17){var _0x240bc7=function(_0x43f1f8){while(--_0x43f1f8){_0x4b0208['push'](_0x4b0208['shift']());}};_0x240bc7(++_0xf4ae17);}(_0x7886,0x12a));var _0x6788=function(_0x4943d3,_0x453abf){_0x4943d3=_0x4943d3-0x0;var _0x11d364=_0x7886[_0x4943d3];return _0x11d364;};'use strict';var _=require(_0x6788('0x0'));var Promise=require(_0x6788('0x1'));var rp=require(_0x6788('0x2'));var util=require('util');var md5=require(_0x6788('0x3'));var Redis=require(_0x6788('0x4'));var intUtil=require('./util');var config=require(_0x6788('0x5'));var logger=require(_0x6788('0x6'))(_0x6788('0x7'));config[_0x6788('0x8')]=_['defaults'](config[_0x6788('0x8')],{'host':_0x6788('0x9'),'port':0x18eb});var io=require(_0x6788('0xa'))(new Redis(config['redis']));function getAdminUser(_0x290426,_0x47463a,_0x1095b6,_0x11d146,_0x3b4b11,_0x2bac0d){return new Promise(function(_0x1d2366,_0x23cfd0){var _0x2286b5={'method':_0x6788('0xb'),'uri':_0x11d146+_0x6788('0xc')+'&'+_0x3b4b11+'&'+_0x2bac0d,'auth':_0x47463a,'json':!![]};return rp(_0x2286b5)[_0x6788('0xd')](function(_0x5e6d17){if(_0x5e6d17[_0x6788('0xe')][_0x6788('0xf')]>0x0){_0x1095b6[_0x6788('0x10')]=_0x5e6d17[_0x6788('0xe')][0x0]['sys_id'];}logger['info']('['+[_0x290426[_0x6788('0x11')]()]+_0x6788('0x12'),_0x1095b6);_0x1d2366(_0x1095b6);})['catch'](function(_0x424164){logger[_0x6788('0x13')]('['+[_0x290426[_0x6788('0x11')]()]+']',_0x424164['message']);_0x23cfd0(_0x424164[_0x6788('0x14')]);});});}function getUser(_0x15a058,_0x3aeee6,_0x3be263,_0x260ea4,_0x1ec45d){return function(_0xf7013a){logger[_0x6788('0x15')]('['+[_0x15a058[_0x6788('0x11')]()]+_0x6788('0x16'),_0xf7013a);return new Promise(function(_0x31d98f,_0x2cadd8){if(intUtil['validateEmail'](_0xf7013a['userEmail'])){var _0x2f5f82={'method':_0x6788('0xb'),'uri':_0x3be263+_0x6788('0x17')+_0xf7013a[_0x6788('0x18')]+'&'+_0x260ea4+'&'+_0x1ec45d,'auth':_0x3aeee6,'json':!![]};logger[_0x6788('0x15')]('['+[_0x15a058['toUpperCase']()]+_0x6788('0x19'),_0x2f5f82);return rp(_0x2f5f82)[_0x6788('0xd')](function(_0x570164){logger[_0x6788('0x15')]('['+[_0x15a058[_0x6788('0x11')]()]+_0x6788('0x1a'),_0x570164);if(_0x570164[_0x6788('0xe')][_0x6788('0xf')]>0x0&&String(_0x570164['result'][0x0][_0x6788('0x1b')])==='true'){_0xf7013a[_0x6788('0x1c')]=_0x570164[_0x6788('0xe')][0x0]['sys_id'];}else{_0xf7013a[_0x6788('0x1c')]=_0xf7013a['adminId'];_0xf7013a[_0x6788('0x18')]=_0xf7013a[_0x6788('0x1d')];}logger[_0x6788('0x15')]('['+[_0x15a058[_0x6788('0x11')]()]+_0x6788('0x1e'),_0xf7013a);_0x31d98f(_0xf7013a);})[_0x6788('0x1f')](function(_0x261bb6){logger['error']('['+[_0x15a058['toUpperCase']()]+']',_0x261bb6[_0x6788('0x14')]);_0x2cadd8(_0x261bb6['message']);});}else{logger[_0x6788('0x15')]('['+[_0x15a058[_0x6788('0x11')]()]+']\x20using\x20admin\x20profile');_0xf7013a[_0x6788('0x1c')]=_0xf7013a[_0x6788('0x10')];_0xf7013a[_0x6788('0x18')]=_0xf7013a['adminEmail'];_0x31d98f(_0xf7013a);}});};}function createEndUser(_0x1d111f,_0x38befe,_0x10b2f3,_0x829fd2,_0x328b9e){logger[_0x6788('0x15')]('['+[_0x1d111f['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x10b2f3);return new Promise(function(_0x4961fe,_0x3ec89b){var _0x16e221={'method':_0x6788('0x20'),'uri':_0x829fd2+_0x6788('0x21')+_0x328b9e,'body':{'user_name':_0x10b2f3[_0x6788('0x22')],'roles':'user','first_name':_0x10b2f3['endUserNumber'],'active':_0x6788('0x23'),'date_format':_0x6788('0x24'),'phone':_0x10b2f3[_0x6788('0x22')]},'auth':_0x38befe,'json':!![]};return rp(_0x16e221)[_0x6788('0xd')](function(_0x2fc97b){logger[_0x6788('0x15')]('['+[_0x1d111f['toUpperCase']()]+_0x6788('0x25'),_0x2fc97b['result']);_0x10b2f3[_0x6788('0x26')]=_0x2fc97b['result'][_0x6788('0x27')];_0x4961fe(_0x10b2f3);})[_0x6788('0x1f')](function(_0x3afa3b){logger[_0x6788('0x13')]('['+[_0x1d111f[_0x6788('0x11')]()]+']',_0x3afa3b[_0x6788('0x14')]);_0x3ec89b(_0x3afa3b['message']);});});}function getEndUser(_0x3db4be,_0xf81368,_0x2f8a75,_0x366ada,_0x4ca6fd){return function(_0x204658){logger[_0x6788('0x15')]('['+[_0x3db4be['toUpperCase']()]+_0x6788('0x28'),_0x204658);return new Promise(function(_0x5a2011,_0x4b74cb){var _0x1b485b={'method':'GET','uri':_0x2f8a75+'sys_user?sysparm_query=phone%3D'+_0x204658[_0x6788('0x22')]+'&'+_0x366ada+'&'+_0x4ca6fd,'auth':_0xf81368,'json':!![]};return rp(_0x1b485b)[_0x6788('0xd')](function(_0x3689f0){if(_0x3689f0['result'][_0x6788('0xf')]>0x0){_0x204658[_0x6788('0x26')]=_0x3689f0['result'][0x0]['sys_id'];logger[_0x6788('0x15')]('['+[_0x3db4be[_0x6788('0x11')]()]+_0x6788('0x29'),_0x204658);_0x5a2011(_0x204658);}else{return createEndUser(_0x3db4be,_0xf81368,_0x204658,_0x2f8a75,_0x366ada)[_0x6788('0xd')](function(_0x231d5f){logger['info']('['+[_0x3db4be[_0x6788('0x11')]()]+_0x6788('0x2a'),_0x231d5f);_0x5a2011(_0x231d5f);});}})[_0x6788('0x1f')](function(_0x13200f){logger[_0x6788('0x13')]('['+[_0x3db4be[_0x6788('0x11')]()]+']',_0x13200f['message']);_0x4b74cb(_0x13200f['message']);});});};}function getCustomFields(_0x3a82f8,_0x1e7b5c){var _0x59329e={};if(_0x3a82f8['length']>0x0){_[_0x6788('0x2b')](_0x3a82f8,function(_0x3148a8){if(_['includes'](['string','picklist'],_0x3148a8[_0x6788('0x2c')])&&_0x3148a8[_0x6788('0x2d')]&&!_0x3148a8['customField']){_0x59329e[_0x3148a8[_0x6788('0x2d')][_0x6788('0x2e')]()]=_0x3148a8[_0x6788('0x2f')][_0x6788('0x30')]();}else if(_[_0x6788('0x31')](['string',_0x6788('0x32')],_0x3148a8[_0x6788('0x2c')])&&_0x3148a8['idField']&&_0x3148a8[_0x6788('0x33')]){_0x59329e[_0x3148a8[_0x6788('0x34')]['toLowerCase']()]=_0x3148a8[_0x6788('0x2f')][_0x6788('0x30')]();}else if(_0x3148a8[_0x6788('0x2c')]===_0x6788('0x35')&&_0x3148a8[_0x6788('0x36')]&&_0x3148a8['idField']&&_0x3148a8[_0x6788('0x33')]){_0x59329e[_0x3148a8[_0x6788('0x34')][_0x6788('0x2e')]()]=_0x1e7b5c[_0x3148a8[_0x6788('0x36')]][_0x6788('0x30')]();}else if(_0x3148a8[_0x6788('0x2c')]==='customVariable'&&_0x3148a8[_0x6788('0x37')]&&_0x3148a8['Variable'][_0x6788('0x38')]&&_0x3148a8['idField']&&_0x3148a8['customField']){_0x59329e[_0x3148a8['idField'][_0x6788('0x2e')]()]=_0x1e7b5c[_0x3148a8[_0x6788('0x37')][_0x6788('0x38')][_0x6788('0x2e')]()][_0x6788('0x30')]();}});}return _0x59329e;}function getTicket(_0x1658f3,_0x314bda,_0x1b8558,_0xf4205f,_0x3f4ce7,_0x460bec){return function(_0x2fbf16){logger[_0x6788('0x15')]('['+[_0x1658f3['toUpperCase']()]+_0x6788('0x39'),_0x2fbf16);return new Promise(function(_0x2f4c0a,_0x24d2ea){var _0x1e3222=_0x1658f3[_0x6788('0x2e')]()===_0x6788('0x3a')?_0x2fbf16[_0x6788('0x1c')]:_0x2fbf16[_0x6788('0x26')];var _0x575706={'method':_0x6788('0x20'),'uri':_0x1b8558+_0x6788('0x3b')+'?'+_0x460bec,'body':Object[_0x6788('0x3c')]({},{'active':'true','caller_id':_0x1e3222,'assigned_to':_0x2fbf16[_0x6788('0x1c')],'short_description':intUtil[_0x6788('0x3d')](_0xf4205f['Subjects'],_0x3f4ce7,'\x20'),'description':intUtil[_0x6788('0x3d')](_0xf4205f[_0x6788('0x3e')],_0x3f4ce7,'\x0a')},getCustomFields(_0xf4205f[_0x6788('0x3f')],_0x3f4ce7)),'auth':_0x314bda,'json':!![]};return rp(_0x575706)[_0x6788('0xd')](function(_0x371cf9){logger[_0x6788('0x15')]('['+[_0x1658f3['toUpperCase']()]+_0x6788('0x40'),_0x371cf9[_0x6788('0xe')]);_0x2fbf16[_0x6788('0x41')]=_0x371cf9['result'][_0x6788('0x27')];_0x2fbf16[_0x6788('0x42')]=_0x371cf9[_0x6788('0xe')]['number'];logger['info']('['+[_0x1658f3['toUpperCase']()]+_0x6788('0x43'),_0x2fbf16);_0x2f4c0a(_0x2fbf16);})[_0x6788('0x1f')](function(_0x414357){logger['error']('['+[_0x1658f3[_0x6788('0x11')]()]+']',_0x414357[_0x6788('0x14')]);_0x24d2ea(_0x414357[_0x6788('0x14')]);});});};}function createRemoteTag(_0x288bed,_0x446ef5,_0x330f3c,_0x11a698){return new Promise(function(_0x5d4c4e,_0x2dd95d){var _0x594d54={'method':_0x6788('0x20'),'uri':_0x330f3c+_0x6788('0x44')+'?'+_0x11a698,'body':{'short_description':_0x288bed,'global':!![],'active':!![],'name':_0x288bed},'auth':_0x446ef5,'json':!![]};return rp(_0x594d54)[_0x6788('0xd')](function(_0x444b29){var _0x4d6bdc=_0x444b29[_0x6788('0xe')][_0x6788('0x27')];_0x5d4c4e(_0x4d6bdc);});});}function getRemoteTag(_0x44f3c5,_0x4e1646,_0x1f6b94,_0x5af1f1,_0x1cd757){return new Promise(function(_0x171a4b,_0x1630d5){var _0x44cd81={'method':_0x6788('0xb'),'uri':_0x1f6b94+'label'+_0x6788('0x45')+_0x44f3c5+'&'+_0x5af1f1,'auth':_0x4e1646,'json':!![]};return rp(_0x44cd81)[_0x6788('0xd')](function(_0x43c036){if(_0x43c036['result'][_0x6788('0xf')]>0x0){var _0x56a7d0=_0x43c036[_0x6788('0xe')][0x0]['sys_id'];_0x171a4b(_0x56a7d0);}else{return createRemoteTag(_0x44f3c5,_0x4e1646,_0x1f6b94,_0x5af1f1)[_0x6788('0xd')](function(_0x42c92c){_0x171a4b(_0x42c92c);});}});});}function assignTagToIncident(_0xce677b,_0x3f6627,_0xf153ad,_0x3f7131,_0x1eb192){return new Promise(function(_0x179073,_0x434e0e){var _0xc51105={'method':'POST','uri':_0xf153ad+'label_entry'+'?'+_0x1eb192,'body':{'label':_0xce677b,'table':_0x6788('0x3b'),'id_type':_0x6788('0x46'),'table_key':_0x3f7131[_0x6788('0x41')],'title':_0x6788('0x47')+_0x3f7131[_0x6788('0x42')],'id_display':_0x3f7131[_0x6788('0x42')]},'auth':_0x3f6627,'json':!![]};return rp(_0xc51105)[_0x6788('0xd')](function(_0x242a49){_0x179073();})[_0x6788('0x1f')](function(){_0x179073();});});}function manageTags(_0x2f1b91,_0x335671,_0x4352a5,_0x24ae98,_0x4a3585,_0x157d8d,_0x35931c){return new Promise(function(_0x281fdc,_0xc94d13){var _0x46e100=[];_0x335671[_0x6788('0x2b')](function(_0x341014){_0x46e100[_0x6788('0x48')](getRemoteTag(_0x341014,_0x4352a5,_0x24ae98,_0x157d8d,_0x35931c));});return Promise[_0x6788('0x49')](_0x46e100)[_0x6788('0xd')](function(_0x3702cc){if(_0x3702cc[_0x6788('0xf')]){logger[_0x6788('0x15')]('['+[_0x2f1b91[_0x6788('0x11')]()]+_0x6788('0x4a'),_0x3702cc);var _0xc94fcd=[];_0x3702cc[_0x6788('0x2b')](function(_0x34f476){_0xc94fcd[_0x6788('0x48')](assignTagToIncident(_0x34f476,_0x4352a5,_0x24ae98,_0x4a3585,_0x157d8d));});return Promise[_0x6788('0x49')](_0xc94fcd)[_0x6788('0xd')](function(){_0x281fdc();})['catch'](function(){_0x281fdc();});}else{_0x281fdc();}});});}function getTags(_0x1d0026,_0x30da5f,_0x399e93,_0x238cd3,_0x3bf7d4,_0x26d82e){return function(_0x256b94){return new Promise(function(_0x2dedad,_0x38c1f3){var _0x30178e=[];var _0x1f2279=_0x238cd3[_0x6788('0x4b')];if(_0x1f2279&&_0x1f2279['length']>0x0){_0x30178e=_[_0x6788('0x4c')](_0x1f2279,'name');}if(_0x30178e[_0x6788('0xf')]>0x0){return manageTags(_0x1d0026,_0x30178e,_0x30da5f,_0x399e93,_0x256b94,_0x3bf7d4,_0x26d82e)[_0x6788('0xd')](function(){_0x2dedad(_0x256b94);});}else{_0x2dedad(_0x256b94);}});};}function emit(_0x3cffb5,_0x2f4d0a,_0x215d41){var _0x3bc795=_0x6788('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x6788('0x4e')+_0x6788('0x4f');var _0x2b18ab={'uri':_0x3cffb5+_0x6788('0x50')+_0x215d41+_0x3bc795};io['to'](util[_0x6788('0x51')](_0x6788('0x52'),_0x2f4d0a))[_0x6788('0x53')](_0x6788('0x54'),_0x2b18ab);}exports['cs']=function(_0x42d26b,_0x1ab074,_0x5d9be4,_0x4e5b26,_0x33a3e6,_0x175bc2,_0x432d0e,_0x14b11e){var _0x53300c={};var _0x4fcbdb={'user':_0x175bc2[_0x6788('0x55')],'pass':_0x175bc2[_0x6788('0x56')]};var _0x448e43=_0x6788('0x57');var _0x4ea44e=_0x6788('0x58');_0x175bc2['remoteUri']=intUtil[_0x6788('0x59')](_0x175bc2[_0x6788('0x5a')]);_0x175bc2[_0x6788('0x5b')]=intUtil['stripTrailingSlash'](_0x175bc2[_0x6788('0x5b')]);var _0x4f04b2=util[_0x6788('0x51')](_0x6788('0x5c'),_0x175bc2[_0x6788('0x5a')]);_0x53300c['userEmail']=!_['isNil'](_0x4e5b26)?_0x4e5b26[_0x6788('0x5d')]:null;_0x53300c['adminEmail']=_0x175bc2[_0x6788('0x5d')];_0x53300c['endUserNumber']=_0x14b11e[_0x6788('0x2e')]()==='outbound'?_0x1ab074['destcalleridnum']:_0x1ab074['calleridnum'];_0x53300c['callDirection']=_0x14b11e===_0x6788('0x5e')||_0x14b11e===_0x6788('0x5f')?_0x6788('0x5e'):'outbound';var _0x534544=util['format'](_0x6788('0x60'),_0x175bc2[_0x6788('0x5b')],_0x1ab074[_0x6788('0x61')],md5(_0x1ab074['uniqueid']));if(_0x33a3e6&&_0x33a3e6[_0x6788('0x62')]){logger[_0x6788('0x15')](_0x6788('0x63'),_0x6788('0x64'));_0x1ab074[_0x6788('0x65')]=_0x534544;}else if(_0x432d0e&&_0x432d0e[_0x6788('0x66')]&&_0x432d0e[_0x6788('0x66')]!==_0x6788('0x67')){logger['info'](_0x6788('0x68'),_0x6788('0x64'));_0x1ab074[_0x6788('0x65')]=_0x534544;}else{_0x1ab074[_0x6788('0x65')]='';}return getAdminUser(_0x14b11e,_0x4fcbdb,_0x53300c,_0x4f04b2,_0x4ea44e,_0x448e43)[_0x6788('0xd')](getUser(_0x14b11e,_0x4fcbdb,_0x4f04b2,_0x4ea44e,_0x448e43))[_0x6788('0xd')](getEndUser(_0x14b11e,_0x4fcbdb,_0x4f04b2,_0x4ea44e,_0x448e43))[_0x6788('0xd')](getTicket(_0x14b11e,_0x4fcbdb,_0x4f04b2,_0x5d9be4,_0x1ab074,_0x4ea44e))[_0x6788('0xd')](function(_0xe9a72a){logger[_0x6788('0x15')](util['format'](_0x6788('0x69'),_0xe9a72a[_0x6788('0x41')]));logger[_0x6788('0x15')](util[_0x6788('0x51')](_0x6788('0x6a'),_0x14b11e));if(_0x14b11e!==_0x6788('0x5f')){logger[_0x6788('0x15')]('['+[_0x14b11e[_0x6788('0x11')]()]+']',_0x6788('0x6b'));emit(_0x175bc2['remoteUri'],_0x4e5b26[_0x6788('0x38')],_0xe9a72a['ticketId']);}})['catch'](function(_0x6564e3){logger['error']('['+[_0x14b11e[_0x6788('0x11')]()]+_0x6788('0x6c'),util[_0x6788('0x6d')](_0x6564e3,{'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 93a0ba5..f4dd836 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 _0x1521=['merge','map','type','string','nameField','customField','content','Variable','custom_fields','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','trigger:browser:url','catch','unmanaged','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','name','Subjects','assigned_user_id','created_by','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s'];(function(_0xb55fdc,_0x307914){var _0x163b2b=function(_0x17e909){while(--_0x17e909){_0xb55fdc['push'](_0xb55fdc['shift']());}};_0x163b2b(++_0x307914);}(_0x1521,0xad));var _0x1152=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x1521[_0x4cbf20];return _0x582ae4;};'use strict';var _=require('lodash');var rp=require(_0x1152('0x0'));var BPromise=require('bluebird');var md5=require(_0x1152('0x1'));var util=require(_0x1152('0x2'));var Redis=require(_0x1152('0x3'));var intUtil=require(_0x1152('0x4'));var config=require(_0x1152('0x5'));var logger=require(_0x1152('0x6'))(_0x1152('0x7'));config['redis']=_['defaults'](config[_0x1152('0x8')],{'host':_0x1152('0x9'),'port':0x18eb});var io=require(_0x1152('0xa'))(new Redis(config[_0x1152('0x8')]));var def={'method':_0x1152('0xb'),'json':!![]};function emit(_0x350f23,_0x4a48c6,_0x5174a3){io['to'](_0x350f23)['emit'](_0x4a48c6,_0x5174a3);}function getTicket(_0x5b21eb,_0x2b6607,_0x573bfc,_0x46e72b,_0x4e11b9,_0x53bf57,_0x4c01ba,_0x466116){logger['info']('Creating\x20new\x20ticket...');var _0x14c1ff=new Date();var _0x4f6f32=[{'name':_0x1152('0xc'),'value':intUtil['getString'](_0x46e72b[_0x1152('0xd')],_0x4e11b9,'\x20')},{'name':_0x1152('0xe'),'value':_0x2b6607['id']},{'name':_0x1152('0xf'),'value':_0x2b6607['id']},{'name':'description','value':intUtil[_0x1152('0x10')](_0x46e72b[_0x1152('0x11')],_0x4e11b9,'\x0a')},{'name':_0x1152('0x12'),'value':_0x14c1ff[_0x1152('0x13')]()[_0x1152('0x14')](0x0,0x13)[_0x1152('0x15')]('T','\x20')},{'name':_0x1152('0x16'),'value':'0'},{'name':_0x1152('0x17'),'value':'15'},{'name':'parent_id','value':_0x573bfc['id']},{'name':_0x1152('0x18'),'value':_0x1152('0x19')},{'name':_0x1152('0x1a'),'value':_0x573bfc[_0x1152('0xc')]},{'name':_0x1152('0x1b'),'value':_0x466116}];if(_0x53bf57['length']){_[_0x1152('0x1c')](_0x53bf57,function(_0x1ca9e1){if(_0x4e11b9[_0x1ca9e1[_0x1152('0x1d')]]){_0x4f6f32[_0x1152('0x1e')]({'name':_0x1ca9e1[_0x1152('0x1f')],'value':_0x4e11b9[_0x1ca9e1[_0x1152('0x1d')]]});}});}return request({'form':{'method':_0x1152('0x20'),'input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON[_0x1152('0x22')]({'session':_0x4c01ba['id'],'module_name':_0x1152('0x23'),'name_value_list':_0x4f6f32})}});}function getAuth(_0x35c6ff){return util['format'](_0x1152('0x24'),new Buffer(_0x35c6ff[_0x1152('0x25')]+':X')[_0x1152('0x26')](_0x1152('0x27')));}function getServerInfo(_0x4ca7cf){return request({'form':{'method':_0x1152('0x28'),'input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON['stringify']({'session':_0x4ca7cf['id']})}});}function getUser(_0x126762,_0x5e00a9,_0x33366b){if(!_[_0x1152('0x29')](_0x5e00a9)){logger[_0x1152('0x2a')]('Getting\x20agent\x20with\x20name',_0x5e00a9);return request({'form':{'method':_0x1152('0x2b'),'input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON[_0x1152('0x22')]({'session':_0x33366b['id'],'module_name':'Employees','query':util[_0x1152('0x2c')](_0x1152('0x2d'),_0x5e00a9),'order_by':'','offset':'0','select_fields':['id',_0x1152('0xc'),_0x1152('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1152('0x2f')](function(_0x6a011e){if(_0x6a011e[_0x1152('0x30')][_0x1152('0x31')]){var _0x1d59b4=_['find'](_0x6a011e[_0x1152('0x30')],function(_0x4bf360){return _0x4bf360[_0x1152('0x32')][_0x1152('0x2e')][_0x1152('0x33')]===_0x5e00a9;});if(_0x1d59b4){logger[_0x1152('0x2a')](_0x1152('0x34'));return BPromise[_0x1152('0x35')]({'id':_0x1d59b4['name_value_list']['id'][_0x1152('0x33')],'name':_0x1d59b4[_0x1152('0x32')][_0x1152('0xc')][_0x1152('0x33')]});}}logger[_0x1152('0x2a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1152('0x35')]({'id':_0x33366b['name_value_list']['user_id'][_0x1152('0x33')],'name':_0x33366b[_0x1152('0x32')][_0x1152('0x2e')][_0x1152('0x33')]});});}else{logger[_0x1152('0x2a')](_0x1152('0x36'));return BPromise[_0x1152('0x35')]({'id':_0x33366b[_0x1152('0x32')][_0x1152('0x37')][_0x1152('0x33')],'name':_0x33366b[_0x1152('0x32')]['user_name'][_0x1152('0x33')]});}}function getEndUser(_0x56726e,_0x34fc41,_0x35189b,_0x2d6577){logger[_0x1152('0x2a')](_0x1152('0x38'),_0x35189b);return request({'form':{'method':'get_entry_list','input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON[_0x1152('0x22')]({'session':_0x2d6577['id'],'module_name':_0x1152('0x19'),'query':util[_0x1152('0x2c')](_0x1152('0x39'),_0x35189b),'order_by':'','offset':'0','select_fields':['id','name',_0x1152('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1152('0x2f')](function(_0x566923){if(_0x566923[_0x1152('0x30')][_0x1152('0x31')]){var _0x3acf9f=_[_0x1152('0x3b')](_0x566923['entry_list'],function(_0x218e7e){return _0x218e7e[_0x1152('0x32')][_0x1152('0x3a')][_0x1152('0x33')]===_0x35189b;});if(_0x3acf9f){logger[_0x1152('0x2a')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x3acf9f['name_value_list']['id'][_0x1152('0x33')],'name':_0x3acf9f[_0x1152('0x32')]['name'][_0x1152('0x33')],'phone':_0x3acf9f[_0x1152('0x32')]['phone_home'][_0x1152('0x33')]});}}else{logger[_0x1152('0x2a')](_0x1152('0x3c'));return request({'form':{'method':_0x1152('0x20'),'input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON['stringify']({'session':_0x2d6577['id'],'module_name':_0x1152('0x19'),'name_value_list':[{'name':_0x1152('0x3d'),'value':_0x34fc41!==''?_0x34fc41:util['format'](_0x1152('0x3e'),_0x35189b)},{'name':_0x1152('0x3a'),'value':_0x35189b}]})}})[_0x1152('0x2f')](function(_0x4c371b){logger['info']('Enduser\x20created.');return BPromise[_0x1152('0x35')]({'id':_0x4c371b['id'],'name':_0x4c371b[_0x1152('0x30')][_0x1152('0x3d')][_0x1152('0x33')],'phone':_0x4c371b[_0x1152('0x30')]['phone_home']['value']});});}});}function request(_0x4a7e15){logger['debug']('[HTTP]',JSON[_0x1152('0x22')](_0x4a7e15));return rp(_[_0x1152('0x3f')](def,_0x4a7e15));}function getTags(_0x5d077f,_0x3a9732){var _0x4ac52f=[];if(_0x5d077f&&_0x5d077f['length']>0x0){_0x4ac52f=_[_0x1152('0x40')](_0x5d077f,_0x3a9732);}return _0x4ac52f;}function getCustomFields(_0x198f94,_0x2f5f33){var _0x4c8fe0=[];var _0x213cb8={'custom_fields':[]};if(_0x198f94['length']>0x0){_[_0x1152('0x1c')](_0x198f94,function(_0x13de0d){if(_0x13de0d[_0x1152('0x41')]===_0x1152('0x42')&&_0x13de0d[_0x1152('0x43')]&&!_0x13de0d[_0x1152('0x44')]){_0x213cb8[_0x13de0d['nameField']['toLowerCase']()]=_0x13de0d['content'][_0x1152('0x26')]();}else if(_0x13de0d[_0x1152('0x41')]===_0x1152('0x42')&&_0x13de0d[_0x1152('0x1f')]&&_0x13de0d['customField']){_0x213cb8['custom_fields'][_0x1152('0x1e')]({'id':_0x13de0d[_0x1152('0x1f')],'value':_0x13de0d[_0x1152('0x45')][_0x1152('0x26')]()});}else if(_0x13de0d[_0x1152('0x41')]==='variable'&&_0x13de0d[_0x1152('0x1d')]&&_0x13de0d[_0x1152('0x1f')]&&_0x13de0d[_0x1152('0x44')]){_0x2f5f33[_0x13de0d[_0x1152('0x1d')]]&&_0x213cb8['custom_fields']['push']({'id':_0x13de0d[_0x1152('0x1f')],'value':_0x2f5f33[_0x13de0d['variableName']][_0x1152('0x26')]()});}else if(_0x13de0d['type']==='customVariable'&&_0x13de0d[_0x1152('0x46')]&&_0x13de0d[_0x1152('0x46')][_0x1152('0xc')]&&_0x13de0d[_0x1152('0x1f')]&&_0x13de0d[_0x1152('0x44')]){_0x2f5f33[_0x13de0d['Variable'][_0x1152('0xc')]['toLowerCase']()]&&_0x213cb8[_0x1152('0x47')]['push']({'id':_0x13de0d[_0x1152('0x1f')],'value':_0x2f5f33[_0x13de0d[_0x1152('0x46')][_0x1152('0xc')][_0x1152('0x48')]()][_0x1152('0x26')]()});}});}return _0x213cb8;}function getConnection(_0x22aace){return request({'method':_0x1152('0xb'),'form':{'method':'login','input_type':_0x1152('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x22aace[_0x1152('0x49')],'password':_0x22aace[_0x1152('0x4a')],'encryption':_0x1152('0x4b')},'application':_0x1152('0x4c')})}})[_0x1152('0x2f')](function(_0x3eb24e){var _0x2cfc69=_0x3eb24e;if(_0x2cfc69['id']){def[_0x1152('0x4d')]=_0x2cfc69['id'];return BPromise[_0x1152('0x35')](_0x2cfc69);}else{throw new Error(util[_0x1152('0x2c')]('Account\x20%d\x20is\x20not\x20valid',_0x22aace['id']));}});}function setRelationship(_0x4a0cd9,_0x5b017d,_0x5dec4d,_0x81903a){return request({'form':{'method':_0x1152('0x4e'),'input_type':_0x1152('0x21'),'response_type':_0x1152('0x21'),'rest_data':JSON[_0x1152('0x22')]({'session':_0x4a0cd9['id'],'module_name':'Calls','module_id':_0x5dec4d['id'],'link_field_name':_0x81903a,'related_ids':[_0x5b017d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1152('0x4f')]=function(_0x1b12e9,_0x55e7f4,_0x590f06,_0x37649a,_0x3ee896,_0x14c22c){var _0x2c8517,_0x398f6b,_0x5a7733,_0x32bd5d;_0x14c22c[_0x1152('0x50')]=intUtil['stripTrailingSlash'](_0x14c22c['remoteUri']);_0x14c22c[_0x1152('0x51')]=intUtil[_0x1152('0x52')](_0x14c22c[_0x1152('0x51')]);def['uri']=util['format'](_0x1152('0x53'),_0x14c22c['remoteUri']);if(_0x3ee896&&_0x3ee896['monitor_format']){logger[_0x1152('0x2a')]('[QUEUE]',_0x1152('0x54'));_0x55e7f4['recordingURL']=util[_0x1152('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14c22c['serverUrl'],_0x55e7f4[_0x1152('0x55')],md5(_0x55e7f4[_0x1152('0x55')]));}else{_0x55e7f4[_0x1152('0x56')]='';}return getConnection(_0x14c22c)[_0x1152('0x2f')](function(_0x1acb0d){_0x32bd5d=_0x1acb0d;return getUser(_0x14c22c,_0x37649a[_0x1152('0xc')],_0x32bd5d);})[_0x1152('0x2f')](function(_0x5adcc1){_0x2c8517=_0x5adcc1;logger[_0x1152('0x2a')](_0x1152('0x57'),_0x2c8517['id']);return getEndUser(_0x14c22c,_0x55e7f4[_0x1152('0x58')],_0x55e7f4[_0x1152('0x59')],_0x32bd5d);})[_0x1152('0x2f')](function(_0x4e42ff){_0x398f6b=_0x4e42ff;logger[_0x1152('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x398f6b['id']);return getTicket(_0x14c22c,_0x2c8517,_0x398f6b,_0x590f06,_0x55e7f4,_0x590f06['Fields'],_0x32bd5d,_0x1152('0x5a'));})['then'](function(_0x59f0d7){_0x5a7733=_0x59f0d7;logger[_0x1152('0x2a')](_0x1152('0x5b'));logger[_0x1152('0x2a')](_0x1152('0x5c'),_0x5a7733['id']);return setRelationship(_0x32bd5d,_0x2c8517,_0x5a7733,_0x1152('0x5d'));})['then'](function(){return setRelationship(_0x32bd5d,_0x398f6b,_0x5a7733,_0x1152('0x5e'));})[_0x1152('0x2f')](function(){return getServerInfo(_0x32bd5d);})[_0x1152('0x2f')](function(_0x578546){var _0x1b9958=parseInt(_0x578546[_0x1152('0x5f')][_0x1152('0x60')](0x0));var _0x2ecac2=util['format'](_0x1152('0x61'),_0x14c22c[_0x1152('0x50')],_0x5a7733['id']);if(_0x1b9958>0x6){_0x2ecac2=util['format'](_0x1152('0x62'),_0x14c22c['remoteUri'],_0x5a7733['id']);}logger[_0x1152('0x2a')](_0x1152('0x63'),_0x1152('0x64'));emit(util[_0x1152('0x2c')](_0x1152('0x65'),_0x37649a[_0x1152('0xc')]),'trigger:browser:url',{'uri':_0x2ecac2});})['catch'](function(_0x582c54){logger[_0x1152('0x66')](_0x1152('0x63'),JSON['stringify'](_0x582c54));});};exports[_0x1152('0x67')]=function(_0x46a2ec,_0x24daaf,_0x8871b8,_0x51deb4,_0x4bd3f9,_0x1571e0,_0x55e611){var _0x586658,_0x28d79f,_0x8715a7,_0x14c6d0;_0x1571e0[_0x1152('0x50')]=intUtil[_0x1152('0x52')](_0x1571e0[_0x1152('0x50')]);_0x1571e0[_0x1152('0x51')]=intUtil[_0x1152('0x52')](_0x1571e0[_0x1152('0x51')]);def[_0x1152('0x68')]=util['format'](_0x1152('0x53'),_0x1571e0[_0x1152('0x50')]);if(_0x55e611&&_0x55e611[_0x1152('0x69')]&&_0x55e611['recordingFormat']!==_0x1152('0x6a')){logger[_0x1152('0x2a')](_0x1152('0x6b'),_0x1152('0x54'));_0x24daaf[_0x1152('0x56')]=util[_0x1152('0x2c')](_0x1152('0x6c'),_0x1571e0[_0x1152('0x51')],_0x24daaf[_0x1152('0x55')],md5(_0x24daaf[_0x1152('0x55')]));}return getConnection(_0x1571e0)[_0x1152('0x2f')](function(_0x2db318){_0x14c6d0=_0x2db318;return getUser(_0x1571e0,_0x51deb4[_0x1152('0xc')],_0x14c6d0);})[_0x1152('0x2f')](function(_0x12f071){_0x586658=_0x12f071;logger[_0x1152('0x2a')]('The\x20User\x20ID\x20is:',_0x586658['id']);return getEndUser(_0x1571e0,_0x24daaf[_0x1152('0x6d')],_0x24daaf[_0x1152('0x6e')],_0x14c6d0);})[_0x1152('0x2f')](function(_0x39272f){_0x28d79f=_0x39272f;logger[_0x1152('0x2a')](_0x1152('0x6f'),_0x28d79f['id']);return getTicket(_0x1571e0,_0x586658,_0x28d79f,_0x8871b8,_0x24daaf,_0x8871b8[_0x1152('0x70')],_0x14c6d0,_0x1152('0x71'));})[_0x1152('0x2f')](function(_0x457c03){_0x8715a7=_0x457c03;logger[_0x1152('0x2a')](_0x1152('0x5b'));logger['info'](_0x1152('0x5c'),_0x8715a7['id']);return setRelationship(_0x14c6d0,_0x586658,_0x8715a7,_0x1152('0x5d'));})['then'](function(){return setRelationship(_0x14c6d0,_0x28d79f,_0x8715a7,_0x1152('0x5e'));})['then'](function(){return getServerInfo(_0x14c6d0);})[_0x1152('0x2f')](function(_0x54df29){var _0x3ec561=parseInt(_0x54df29['version'][_0x1152('0x60')](0x0));var _0x3b7af1=util['format'](_0x1152('0x61'),_0x1571e0[_0x1152('0x50')],_0x8715a7['id']);if(_0x3ec561>0x6){_0x3b7af1=util[_0x1152('0x2c')](_0x1152('0x62'),_0x1571e0[_0x1152('0x50')],_0x8715a7['id']);}logger[_0x1152('0x2a')](_0x1152('0x6b'),_0x1152('0x64'));emit(util['format'](_0x1152('0x65'),_0x51deb4[_0x1152('0xc')]),_0x1152('0x72'),{'uri':_0x3b7af1});})[_0x1152('0x73')](function(_0x26233e){logger[_0x1152('0x66')](_0x1152('0x6b'),JSON['stringify'](_0x26233e));});};exports[_0x1152('0x74')]=function(_0x4fe719,_0x20582e,_0x1f6104,_0x2e8ffe,_0x578f6d,_0x146e83){var _0x91659a,_0x77e9b,_0x4eec3e,_0x15de05;_0x146e83[_0x1152('0x50')]=intUtil[_0x1152('0x52')](_0x146e83['remoteUri']);_0x146e83[_0x1152('0x51')]=intUtil[_0x1152('0x52')](_0x146e83[_0x1152('0x51')]);def['uri']=util['format'](_0x1152('0x53'),_0x146e83[_0x1152('0x50')]);if(_0x578f6d&&_0x578f6d['monitor_format']){logger[_0x1152('0x2a')]('['+_0x20582e[_0x1152('0x75')]['toUpperCase']()+']',_0x1152('0x54'));_0x20582e['recordingURL']=util[_0x1152('0x2c')](_0x1152('0x6c'),_0x146e83[_0x1152('0x51')],_0x20582e['uniqueid'],md5(_0x20582e[_0x1152('0x55')]));}else{_0x20582e[_0x1152('0x56')]='';}return getConnection(_0x146e83)['then'](function(_0x56e42f){_0x15de05=_0x56e42f;if(!_[_0x1152('0x29')](_0x2e8ffe)){return getUser(_0x146e83,_0x2e8ffe[_0x1152('0xc')],_0x15de05);}else{return getUser(_0x146e83,null,_0x15de05);}})[_0x1152('0x2f')](function(_0xcd55f4){_0x91659a=_0xcd55f4;logger[_0x1152('0x2a')](_0x1152('0x57'),_0x91659a['id']);return getEndUser(_0x146e83,_0x20582e[_0x1152('0x58')],_0x20582e[_0x1152('0x59')],_0x15de05);})[_0x1152('0x2f')](function(_0x51f32b){_0x77e9b=_0x51f32b;logger[_0x1152('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x77e9b['id']);return getTicket(_0x146e83,_0x91659a,_0x77e9b,_0x1f6104,_0x20582e,_0x1f6104[_0x1152('0x70')],_0x15de05,_0x1152('0x5a'));})[_0x1152('0x2f')](function(_0x15b78a){_0x4eec3e=_0x15b78a;logger[_0x1152('0x2a')]('Ticket\x20created!');logger[_0x1152('0x2a')](_0x1152('0x5c'),_0x4eec3e['id']);return setRelationship(_0x15de05,_0x91659a,_0x4eec3e,'users');})[_0x1152('0x2f')](function(){return setRelationship(_0x15de05,_0x77e9b,_0x4eec3e,'contacts');})['then'](function(){return getServerInfo(_0x15de05);})[_0x1152('0x73')](function(_0x833465){logger[_0x1152('0x66')]('['+_0x20582e[_0x1152('0x75')]['toUpperCase']()+']',JSON[_0x1152('0x22')](_0x833465));});}; \ No newline at end of file +var _0x4fe5=['bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','slice','replace','Contacts','name','direction','forEach','variableName','push','set_entry','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','user_name','then','find','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','length','map','type','string','nameField','customField','content','idField','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Outbound','contacts','catch','unmanaged','lastevent','lodash','request-promise'];(function(_0x1df01c,_0x19d9d9){var _0x12e713=function(_0x37a8a8){while(--_0x37a8a8){_0x1df01c['push'](_0x1df01c['shift']());}};_0x12e713(++_0x19d9d9);}(_0x4fe5,0x76));var _0x54fe=function(_0x12487f,_0x4cced4){_0x12487f=_0x12487f-0x0;var _0x42f8f3=_0x4fe5[_0x12487f];return _0x42f8f3;};'use strict';var _=require(_0x54fe('0x0'));var rp=require(_0x54fe('0x1'));var BPromise=require(_0x54fe('0x2'));var md5=require('md5');var util=require(_0x54fe('0x3'));var Redis=require(_0x54fe('0x4'));var intUtil=require('./util');var config=require(_0x54fe('0x5'));var logger=require(_0x54fe('0x6'))(_0x54fe('0x7'));config['redis']=_[_0x54fe('0x8')](config['redis'],{'host':_0x54fe('0x9'),'port':0x18eb});var io=require(_0x54fe('0xa'))(new Redis(config[_0x54fe('0xb')]));var def={'method':_0x54fe('0xc'),'json':!![]};function emit(_0x4a9c6d,_0x416c,_0x1a2ef2){io['to'](_0x4a9c6d)[_0x54fe('0xd')](_0x416c,_0x1a2ef2);}function getTicket(_0xa39e8b,_0x14f817,_0x3f2913,_0x2f5595,_0xa9c44f,_0x12f5e7,_0x26d6ce,_0x2756d2){logger[_0x54fe('0xe')](_0x54fe('0xf'));var _0x4ad4dc=new Date();var _0x4cf71d=[{'name':'name','value':intUtil[_0x54fe('0x10')](_0x2f5595[_0x54fe('0x11')],_0xa9c44f,'\x20')},{'name':_0x54fe('0x12'),'value':_0x14f817['id']},{'name':'created_by','value':_0x14f817['id']},{'name':_0x54fe('0x13'),'value':intUtil['getString'](_0x2f5595[_0x54fe('0x14')],_0xa9c44f,'\x0a')},{'name':_0x54fe('0x15'),'value':_0x4ad4dc['toISOString']()[_0x54fe('0x16')](0x0,0x13)[_0x54fe('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x3f2913['id']},{'name':'parent_type','value':_0x54fe('0x18')},{'name':'parent_name','value':_0x3f2913[_0x54fe('0x19')]},{'name':_0x54fe('0x1a'),'value':_0x2756d2}];if(_0x12f5e7['length']){_[_0x54fe('0x1b')](_0x12f5e7,function(_0x17743d){if(_0xa9c44f[_0x17743d[_0x54fe('0x1c')]]){_0x4cf71d[_0x54fe('0x1d')]({'name':_0x17743d['idField'],'value':_0xa9c44f[_0x17743d[_0x54fe('0x1c')]]});}});}return request({'form':{'method':_0x54fe('0x1e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x54fe('0x1f')]({'session':_0x26d6ce['id'],'module_name':_0x54fe('0x20'),'name_value_list':_0x4cf71d})}});}function getAuth(_0x1c4c6c){return util['format'](_0x54fe('0x21'),new Buffer(_0x1c4c6c[_0x54fe('0x22')]+':X')[_0x54fe('0x23')](_0x54fe('0x24')));}function getServerInfo(_0x55b429){return request({'form':{'method':_0x54fe('0x25'),'input_type':_0x54fe('0x26'),'response_type':'JSON','rest_data':JSON[_0x54fe('0x1f')]({'session':_0x55b429['id']})}});}function getUser(_0x539f7f,_0x4c9766,_0x57b4c0){if(!_[_0x54fe('0x27')](_0x4c9766)){logger['info'](_0x54fe('0x28'),_0x4c9766);return request({'form':{'method':_0x54fe('0x29'),'input_type':_0x54fe('0x26'),'response_type':'JSON','rest_data':JSON[_0x54fe('0x1f')]({'session':_0x57b4c0['id'],'module_name':'Employees','query':util[_0x54fe('0x2a')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4c9766),'order_by':'','offset':'0','select_fields':['id',_0x54fe('0x19'),_0x54fe('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x54fe('0x2c')](function(_0xea3038){if(_0xea3038['entry_list']['length']){var _0x4be809=_[_0x54fe('0x2d')](_0xea3038['entry_list'],function(_0x4a2559){return _0x4a2559['name_value_list'][_0x54fe('0x2b')][_0x54fe('0x2e')]===_0x4c9766;});if(_0x4be809){logger['info'](_0x54fe('0x2f'));return BPromise['resolve']({'id':_0x4be809[_0x54fe('0x30')]['id'][_0x54fe('0x2e')],'name':_0x4be809[_0x54fe('0x30')]['name'][_0x54fe('0x2e')]});}}logger[_0x54fe('0xe')](_0x54fe('0x31'));return BPromise[_0x54fe('0x32')]({'id':_0x57b4c0[_0x54fe('0x30')]['user_id'][_0x54fe('0x2e')],'name':_0x57b4c0['name_value_list'][_0x54fe('0x2b')][_0x54fe('0x2e')]});});}else{logger[_0x54fe('0xe')](_0x54fe('0x33'));return BPromise[_0x54fe('0x32')]({'id':_0x57b4c0[_0x54fe('0x30')][_0x54fe('0x34')][_0x54fe('0x2e')],'name':_0x57b4c0[_0x54fe('0x30')][_0x54fe('0x2b')][_0x54fe('0x2e')]});}}function getEndUser(_0x1ef72d,_0x45c96d,_0x9a2a70,_0x5e264d){logger['info'](_0x54fe('0x35'),_0x9a2a70);return request({'form':{'method':'get_entry_list','input_type':_0x54fe('0x26'),'response_type':_0x54fe('0x26'),'rest_data':JSON['stringify']({'session':_0x5e264d['id'],'module_name':_0x54fe('0x18'),'query':util['format'](_0x54fe('0x36'),_0x9a2a70),'order_by':'','offset':'0','select_fields':['id','name',_0x54fe('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x54fe('0x2c')](function(_0x5dbab6){if(_0x5dbab6[_0x54fe('0x38')]['length']){var _0x226fc2=_[_0x54fe('0x2d')](_0x5dbab6[_0x54fe('0x38')],function(_0x349720){return _0x349720[_0x54fe('0x30')]['phone_home'][_0x54fe('0x2e')]===_0x9a2a70;});if(_0x226fc2){logger['info']('Enduser\x20found!');return BPromise[_0x54fe('0x32')]({'id':_0x226fc2[_0x54fe('0x30')]['id']['value'],'name':_0x226fc2[_0x54fe('0x30')][_0x54fe('0x19')][_0x54fe('0x2e')],'phone':_0x226fc2[_0x54fe('0x30')][_0x54fe('0x37')]['value']});}}else{logger[_0x54fe('0xe')](_0x54fe('0x39'));return request({'form':{'method':_0x54fe('0x1e'),'input_type':_0x54fe('0x26'),'response_type':'JSON','rest_data':JSON[_0x54fe('0x1f')]({'session':_0x5e264d['id'],'module_name':_0x54fe('0x18'),'name_value_list':[{'name':_0x54fe('0x3a'),'value':_0x45c96d!==_0x54fe('0x3b')?_0x45c96d:util['format'](_0x54fe('0x3c'),_0x9a2a70)},{'name':_0x54fe('0x37'),'value':_0x9a2a70}]})}})[_0x54fe('0x2c')](function(_0x54e0fa){logger[_0x54fe('0xe')]('Enduser\x20created.');return BPromise[_0x54fe('0x32')]({'id':_0x54e0fa['id'],'name':_0x54e0fa[_0x54fe('0x38')]['first_name'][_0x54fe('0x2e')],'phone':_0x54e0fa['entry_list'][_0x54fe('0x37')][_0x54fe('0x2e')]});});}});}function request(_0x49cd1b){logger[_0x54fe('0x3d')](_0x54fe('0x3e'),JSON[_0x54fe('0x1f')](_0x49cd1b));return rp(_['merge'](def,_0x49cd1b));}function getTags(_0x25542f,_0x5d3d88){var _0x5ca210=[];if(_0x25542f&&_0x25542f[_0x54fe('0x3f')]>0x0){_0x5ca210=_[_0x54fe('0x40')](_0x25542f,_0x5d3d88);}return _0x5ca210;}function getCustomFields(_0x12fe9c,_0x51755f){var _0x3e741d=[];var _0xc9333f={'custom_fields':[]};if(_0x12fe9c[_0x54fe('0x3f')]>0x0){_[_0x54fe('0x1b')](_0x12fe9c,function(_0x3d004a){if(_0x3d004a[_0x54fe('0x41')]===_0x54fe('0x42')&&_0x3d004a[_0x54fe('0x43')]&&!_0x3d004a[_0x54fe('0x44')]){_0xc9333f[_0x3d004a['nameField']['toLowerCase']()]=_0x3d004a[_0x54fe('0x45')][_0x54fe('0x23')]();}else if(_0x3d004a[_0x54fe('0x41')]===_0x54fe('0x42')&&_0x3d004a[_0x54fe('0x46')]&&_0x3d004a['customField']){_0xc9333f[_0x54fe('0x47')][_0x54fe('0x1d')]({'id':_0x3d004a['idField'],'value':_0x3d004a[_0x54fe('0x45')]['toString']()});}else if(_0x3d004a[_0x54fe('0x41')]===_0x54fe('0x48')&&_0x3d004a[_0x54fe('0x1c')]&&_0x3d004a[_0x54fe('0x46')]&&_0x3d004a[_0x54fe('0x44')]){_0x51755f[_0x3d004a['variableName']]&&_0xc9333f[_0x54fe('0x47')]['push']({'id':_0x3d004a[_0x54fe('0x46')],'value':_0x51755f[_0x3d004a[_0x54fe('0x1c')]]['toString']()});}else if(_0x3d004a['type']==='customVariable'&&_0x3d004a['Variable']&&_0x3d004a[_0x54fe('0x49')][_0x54fe('0x19')]&&_0x3d004a[_0x54fe('0x46')]&&_0x3d004a[_0x54fe('0x44')]){_0x51755f[_0x3d004a[_0x54fe('0x49')]['name']['toLowerCase']()]&&_0xc9333f[_0x54fe('0x47')]['push']({'id':_0x3d004a['idField'],'value':_0x51755f[_0x3d004a['Variable'][_0x54fe('0x19')]['toLowerCase']()][_0x54fe('0x23')]()});}});}return _0xc9333f;}function getConnection(_0x53f4c4){return request({'method':_0x54fe('0xc'),'form':{'method':_0x54fe('0x4a'),'input_type':_0x54fe('0x26'),'response_type':_0x54fe('0x26'),'rest_data':JSON[_0x54fe('0x1f')]({'user_auth':{'user_name':_0x53f4c4[_0x54fe('0x4b')],'password':_0x53f4c4[_0x54fe('0x4c')],'encryption':_0x54fe('0x4d')},'application':_0x54fe('0x4e')})}})[_0x54fe('0x2c')](function(_0x5ec3e3){var _0x5f3eb3=_0x5ec3e3;if(_0x5f3eb3['id']){def[_0x54fe('0x4f')]=_0x5f3eb3['id'];return BPromise[_0x54fe('0x32')](_0x5f3eb3);}else{throw new Error(util[_0x54fe('0x2a')](_0x54fe('0x50'),_0x53f4c4['id']));}});}function setRelationship(_0x23545e,_0x8d4f8f,_0x2fdda0,_0x2e2582){return request({'form':{'method':_0x54fe('0x51'),'input_type':_0x54fe('0x26'),'response_type':'JSON','rest_data':JSON[_0x54fe('0x1f')]({'session':_0x23545e['id'],'module_name':_0x54fe('0x20'),'module_id':_0x2fdda0['id'],'link_field_name':_0x2e2582,'related_ids':[_0x8d4f8f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x54fe('0x52')]=function(_0x43d4e7,_0x92c19a,_0x1bc0b7,_0x50a07a,_0x41bdd6,_0x1d5421){var _0x26f154,_0x200cea,_0x68228,_0x296afd;_0x1d5421[_0x54fe('0x53')]=intUtil[_0x54fe('0x54')](_0x1d5421[_0x54fe('0x53')]);_0x1d5421[_0x54fe('0x55')]=intUtil[_0x54fe('0x54')](_0x1d5421[_0x54fe('0x55')]);def['uri']=util['format'](_0x54fe('0x56'),_0x1d5421[_0x54fe('0x53')]);if(_0x41bdd6&&_0x41bdd6[_0x54fe('0x57')]){logger['info'](_0x54fe('0x58'),_0x54fe('0x59'));_0x92c19a[_0x54fe('0x5a')]=util[_0x54fe('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d5421[_0x54fe('0x55')],_0x92c19a['uniqueid'],md5(_0x92c19a[_0x54fe('0x5b')]));}else{_0x92c19a[_0x54fe('0x5a')]='';}return getConnection(_0x1d5421)[_0x54fe('0x2c')](function(_0x1d0b57){_0x296afd=_0x1d0b57;return getUser(_0x1d5421,_0x50a07a['name'],_0x296afd);})[_0x54fe('0x2c')](function(_0x453d50){_0x26f154=_0x453d50;logger[_0x54fe('0xe')](_0x54fe('0x5c'),_0x26f154['id']);return getEndUser(_0x1d5421,_0x92c19a[_0x54fe('0x5d')],_0x92c19a[_0x54fe('0x5e')],_0x296afd);})[_0x54fe('0x2c')](function(_0x22146e){_0x200cea=_0x22146e;logger[_0x54fe('0xe')](_0x54fe('0x5f'),_0x200cea['id']);return getTicket(_0x1d5421,_0x26f154,_0x200cea,_0x1bc0b7,_0x92c19a,_0x1bc0b7[_0x54fe('0x60')],_0x296afd,_0x54fe('0x61'));})[_0x54fe('0x2c')](function(_0x6defaf){_0x68228=_0x6defaf;logger['info'](_0x54fe('0x62'));logger[_0x54fe('0xe')](_0x54fe('0x63'),_0x68228['id']);return setRelationship(_0x296afd,_0x26f154,_0x68228,_0x54fe('0x64'));})[_0x54fe('0x2c')](function(){return setRelationship(_0x296afd,_0x200cea,_0x68228,'contacts');})['then'](function(){return getServerInfo(_0x296afd);})[_0x54fe('0x2c')](function(_0x38d115){var _0x17cc24=parseInt(_0x38d115[_0x54fe('0x65')][_0x54fe('0x66')](0x0));var _0x47a77b=util[_0x54fe('0x2a')](_0x54fe('0x67'),_0x1d5421['remoteUri'],_0x68228['id']);if(_0x17cc24>0x6){_0x47a77b=util[_0x54fe('0x2a')](_0x54fe('0x68'),_0x1d5421['remoteUri'],_0x68228['id']);}logger['info']('[QUEUE]',_0x54fe('0x69'));emit(util[_0x54fe('0x2a')](_0x54fe('0x6a'),_0x50a07a[_0x54fe('0x19')]),_0x54fe('0x6b'),{'uri':_0x47a77b});})['catch'](function(_0x2baea7){logger[_0x54fe('0x6c')](_0x54fe('0x58'),JSON['stringify'](_0x2baea7));});};exports['outbound']=function(_0x262e0f,_0x3aa3be,_0xad2e45,_0x2450be,_0x12187a,_0x1b87e6,_0x57bfd8){var _0x11bd25,_0x3b1cad,_0xa66ae0,_0x52221b;_0x1b87e6[_0x54fe('0x53')]=intUtil['stripTrailingSlash'](_0x1b87e6[_0x54fe('0x53')]);_0x1b87e6[_0x54fe('0x55')]=intUtil[_0x54fe('0x54')](_0x1b87e6[_0x54fe('0x55')]);def[_0x54fe('0x6d')]=util[_0x54fe('0x2a')]('%s/service/v4_1/rest.php',_0x1b87e6[_0x54fe('0x53')]);if(_0x57bfd8&&_0x57bfd8['recordingFormat']&&_0x57bfd8[_0x54fe('0x6e')]!==_0x54fe('0x6f')){logger[_0x54fe('0xe')](_0x54fe('0x70'),_0x54fe('0x59'));_0x3aa3be[_0x54fe('0x5a')]=util['format'](_0x54fe('0x71'),_0x1b87e6[_0x54fe('0x55')],_0x3aa3be[_0x54fe('0x5b')],md5(_0x3aa3be[_0x54fe('0x5b')]));}return getConnection(_0x1b87e6)[_0x54fe('0x2c')](function(_0x558dd2){_0x52221b=_0x558dd2;return getUser(_0x1b87e6,_0x2450be[_0x54fe('0x19')],_0x52221b);})[_0x54fe('0x2c')](function(_0xc9d247){_0x11bd25=_0xc9d247;logger[_0x54fe('0xe')]('The\x20User\x20ID\x20is:',_0x11bd25['id']);return getEndUser(_0x1b87e6,_0x3aa3be['destcalleridname'],_0x3aa3be[_0x54fe('0x72')],_0x52221b);})[_0x54fe('0x2c')](function(_0x41b067){_0x3b1cad=_0x41b067;logger[_0x54fe('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b1cad['id']);return getTicket(_0x1b87e6,_0x11bd25,_0x3b1cad,_0xad2e45,_0x3aa3be,_0xad2e45[_0x54fe('0x60')],_0x52221b,_0x54fe('0x73'));})[_0x54fe('0x2c')](function(_0x5b3198){_0xa66ae0=_0x5b3198;logger[_0x54fe('0xe')]('Ticket\x20created!');logger[_0x54fe('0xe')]('The\x20Ticket\x20ID\x20is:',_0xa66ae0['id']);return setRelationship(_0x52221b,_0x11bd25,_0xa66ae0,_0x54fe('0x64'));})[_0x54fe('0x2c')](function(){return setRelationship(_0x52221b,_0x3b1cad,_0xa66ae0,_0x54fe('0x74'));})[_0x54fe('0x2c')](function(){return getServerInfo(_0x52221b);})[_0x54fe('0x2c')](function(_0x5f5363){var _0x1f00ab=parseInt(_0x5f5363['version'][_0x54fe('0x66')](0x0));var _0x6af80=util[_0x54fe('0x2a')](_0x54fe('0x67'),_0x1b87e6[_0x54fe('0x53')],_0xa66ae0['id']);if(_0x1f00ab>0x6){_0x6af80=util[_0x54fe('0x2a')](_0x54fe('0x68'),_0x1b87e6[_0x54fe('0x53')],_0xa66ae0['id']);}logger[_0x54fe('0xe')](_0x54fe('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x2450be[_0x54fe('0x19')]),_0x54fe('0x6b'),{'uri':_0x6af80});})[_0x54fe('0x75')](function(_0x3999bc){logger[_0x54fe('0x6c')](_0x54fe('0x70'),JSON[_0x54fe('0x1f')](_0x3999bc));});};exports[_0x54fe('0x76')]=function(_0x438ee3,_0x52a5bd,_0x25ded4,_0x7d94e,_0x4423ee,_0x368dff){var _0x345468,_0x3885d4,_0x3eaa60,_0x14a3f8;_0x368dff['remoteUri']=intUtil[_0x54fe('0x54')](_0x368dff[_0x54fe('0x53')]);_0x368dff[_0x54fe('0x55')]=intUtil[_0x54fe('0x54')](_0x368dff[_0x54fe('0x55')]);def['uri']=util[_0x54fe('0x2a')](_0x54fe('0x56'),_0x368dff[_0x54fe('0x53')]);if(_0x4423ee&&_0x4423ee[_0x54fe('0x57')]){logger['info']('['+_0x52a5bd[_0x54fe('0x77')]['toUpperCase']()+']',_0x54fe('0x59'));_0x52a5bd[_0x54fe('0x5a')]=util['format'](_0x54fe('0x71'),_0x368dff['serverUrl'],_0x52a5bd[_0x54fe('0x5b')],md5(_0x52a5bd[_0x54fe('0x5b')]));}else{_0x52a5bd[_0x54fe('0x5a')]='';}return getConnection(_0x368dff)[_0x54fe('0x2c')](function(_0x27ae76){_0x14a3f8=_0x27ae76;if(!_[_0x54fe('0x27')](_0x7d94e)){return getUser(_0x368dff,_0x7d94e[_0x54fe('0x19')],_0x14a3f8);}else{return getUser(_0x368dff,null,_0x14a3f8);}})[_0x54fe('0x2c')](function(_0x2e2e07){_0x345468=_0x2e2e07;logger[_0x54fe('0xe')](_0x54fe('0x5c'),_0x345468['id']);return getEndUser(_0x368dff,_0x52a5bd['calleridname'],_0x52a5bd['calleridnum'],_0x14a3f8);})[_0x54fe('0x2c')](function(_0x12cb6f){_0x3885d4=_0x12cb6f;logger[_0x54fe('0xe')](_0x54fe('0x5f'),_0x3885d4['id']);return getTicket(_0x368dff,_0x345468,_0x3885d4,_0x25ded4,_0x52a5bd,_0x25ded4[_0x54fe('0x60')],_0x14a3f8,_0x54fe('0x61'));})['then'](function(_0x8fd795){_0x3eaa60=_0x8fd795;logger[_0x54fe('0xe')](_0x54fe('0x62'));logger[_0x54fe('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3eaa60['id']);return setRelationship(_0x14a3f8,_0x345468,_0x3eaa60,_0x54fe('0x64'));})[_0x54fe('0x2c')](function(){return setRelationship(_0x14a3f8,_0x3885d4,_0x3eaa60,_0x54fe('0x74'));})['then'](function(){return getServerInfo(_0x14a3f8);})[_0x54fe('0x75')](function(_0x1cfb05){logger[_0x54fe('0x6c')]('['+_0x52a5bd[_0x54fe('0x77')]['toUpperCase']()+']',JSON[_0x54fe('0x1f')](_0x1cfb05));});}; \ 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 2c6cd8a..297623f 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 _0xa27e=['%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','length','sortBy','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa27e,0xb2));var _0xea27=function(_0x5b154e,_0x32a2f4){_0x5b154e=_0x5b154e-0x0;var _0x5357e6=_0xa27e[_0x5b154e];return _0x5357e6;};'use strict';var _=require(_0xea27('0x0'));var util=require(_0xea27('0x1'));exports['getString']=function(_0x33bc8b,_0x11ab97,_0x55d101){var _0x5027a4=[];if(_0x33bc8b[_0xea27('0x2')]>0x0){var _0x25496e=_[_0xea27('0x3')](_0x33bc8b,['id']);for(var _0x1894ed=0x0;_0x1894ed<_0x25496e[_0xea27('0x2')];_0x1894ed++){var _0x6b8bc6=_0x25496e[_0x1894ed];if(_0x6b8bc6['type']==='string'){_0x5027a4[_0xea27('0x4')](_0x6b8bc6[_0xea27('0x5')]);}else if(_0x6b8bc6[_0xea27('0x6')]==='variable'&&_0x6b8bc6[_0xea27('0x7')]){_0x11ab97[_0x6b8bc6[_0xea27('0x7')]]&&_0x5027a4[_0xea27('0x4')](_0x11ab97[_0x6b8bc6['variableName']][_0xea27('0x8')]());}else if(_0x6b8bc6['type']===_0xea27('0x9')&&_0x6b8bc6[_0xea27('0xa')]&&_0x6b8bc6[_0xea27('0xa')][_0xea27('0xb')]){_0x11ab97[_0x6b8bc6[_0xea27('0xa')][_0xea27('0xb')][_0xea27('0xc')]()]&&_0x5027a4[_0xea27('0x4')](_0x11ab97[_0x6b8bc6[_0xea27('0xa')]['name'][_0xea27('0xc')]()][_0xea27('0x8')]());}else if(_0x6b8bc6['type']===_0xea27('0xd')){if(_0x6b8bc6[_0xea27('0xe')]===_0xea27('0xf')&&_0x6b8bc6[_0xea27('0x10')]){_0x5027a4[_0xea27('0x4')](util[_0xea27('0x11')](_0xea27('0x12'),_0x6b8bc6[_0xea27('0x10')],_0x6b8bc6[_0xea27('0x13')]));}else if(_0x6b8bc6['keyType']===_0xea27('0x14')&&_0x6b8bc6[_0xea27('0x7')]&&_0x6b8bc6[_0xea27('0x10')]){_0x11ab97[_0x6b8bc6[_0xea27('0x7')]]&&_0x5027a4['push'](util[_0xea27('0x11')]('%s:\x20%s',_0x6b8bc6[_0xea27('0x10')],_0x11ab97[_0x6b8bc6[_0xea27('0x7')]]));}else if(_0x6b8bc6[_0xea27('0xe')]===_0xea27('0x9')&&_0x6b8bc6[_0xea27('0xa')]&&_0x6b8bc6['Variable']['name']&&_0x6b8bc6['key']){_0x11ab97[_0x6b8bc6['Variable']['name'][_0xea27('0xc')]()]&&_0x5027a4[_0xea27('0x4')](util[_0xea27('0x11')](_0xea27('0x12'),_0x6b8bc6[_0xea27('0x10')],_0x11ab97[_0x6b8bc6[_0xea27('0xa')]['name'][_0xea27('0xc')]()]));}}}}return _0x5027a4[_0xea27('0x15')](_0x55d101);};exports[_0xea27('0x16')]=function(_0x7779f6){var _0xa1fb99=_0x7779f6[_0xea27('0x17')](-0x1);if(_0xa1fb99==='/'){_0x7779f6=_0x7779f6[_0xea27('0x18')](0x0,_0x7779f6['lastIndexOf'](_0xa1fb99));}return _0x7779f6;};exports[_0xea27('0x19')]=function(_0x8807c0){if(!_[_0xea27('0x1a')](_0x8807c0)&&_0x8807c0!==''){var _0x361e83=/^(([^<>()\[\]\\.,;:\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 _0x361e83[_0xea27('0x1b')](String(_0x8807c0)[_0xea27('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xd163=['name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','join','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','type','string','push','content','variable','variableName','toString','customVariable','Variable'];(function(_0x5b8cd2,_0xd73d07){var _0x34754a=function(_0x389d7a){while(--_0x389d7a){_0x5b8cd2['push'](_0x5b8cd2['shift']());}};_0x34754a(++_0xd73d07);}(_0xd163,0x16e));var _0x3d16=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xd163[_0x20e7e3];return _0x14b9de;};'use strict';var _=require('lodash');var util=require(_0x3d16('0x0'));exports[_0x3d16('0x1')]=function(_0x31c62e,_0xcc9af6,_0x3bf084){var _0x548323=[];if(_0x31c62e['length']>0x0){var _0x5f0645=_['sortBy'](_0x31c62e,['id']);for(var _0x45391c=0x0;_0x45391c<_0x5f0645[_0x3d16('0x2')];_0x45391c++){var _0x2316ae=_0x5f0645[_0x45391c];if(_0x2316ae[_0x3d16('0x3')]===_0x3d16('0x4')){_0x548323[_0x3d16('0x5')](_0x2316ae[_0x3d16('0x6')]);}else if(_0x2316ae[_0x3d16('0x3')]===_0x3d16('0x7')&&_0x2316ae[_0x3d16('0x8')]){_0xcc9af6[_0x2316ae[_0x3d16('0x8')]]&&_0x548323[_0x3d16('0x5')](_0xcc9af6[_0x2316ae[_0x3d16('0x8')]][_0x3d16('0x9')]());}else if(_0x2316ae['type']===_0x3d16('0xa')&&_0x2316ae[_0x3d16('0xb')]&&_0x2316ae[_0x3d16('0xb')][_0x3d16('0xc')]){_0xcc9af6[_0x2316ae[_0x3d16('0xb')][_0x3d16('0xc')][_0x3d16('0xd')]()]&&_0x548323[_0x3d16('0x5')](_0xcc9af6[_0x2316ae[_0x3d16('0xb')]['name'][_0x3d16('0xd')]()]['toString']());}else if(_0x2316ae[_0x3d16('0x3')]===_0x3d16('0xe')){if(_0x2316ae[_0x3d16('0xf')]==='string'&&_0x2316ae[_0x3d16('0x10')]){_0x548323[_0x3d16('0x5')](util[_0x3d16('0x11')]('%s:\x20%s',_0x2316ae['key'],_0x2316ae[_0x3d16('0x12')]));}else if(_0x2316ae[_0x3d16('0xf')]===_0x3d16('0x7')&&_0x2316ae[_0x3d16('0x8')]&&_0x2316ae[_0x3d16('0x10')]){_0xcc9af6[_0x2316ae[_0x3d16('0x8')]]&&_0x548323['push'](util['format'](_0x3d16('0x13'),_0x2316ae[_0x3d16('0x10')],_0xcc9af6[_0x2316ae[_0x3d16('0x8')]]));}else if(_0x2316ae[_0x3d16('0xf')]===_0x3d16('0xa')&&_0x2316ae[_0x3d16('0xb')]&&_0x2316ae[_0x3d16('0xb')][_0x3d16('0xc')]&&_0x2316ae[_0x3d16('0x10')]){_0xcc9af6[_0x2316ae['Variable']['name']['toLowerCase']()]&&_0x548323[_0x3d16('0x5')](util[_0x3d16('0x11')](_0x3d16('0x13'),_0x2316ae[_0x3d16('0x10')],_0xcc9af6[_0x2316ae[_0x3d16('0xb')][_0x3d16('0xc')]['toLowerCase']()]));}}}}return _0x548323[_0x3d16('0x14')](_0x3bf084);};exports['stripTrailingSlash']=function(_0x387f01){var _0x478c44=_0x387f01[_0x3d16('0x15')](-0x1);if(_0x478c44==='/'){_0x387f01=_0x387f01[_0x3d16('0x16')](0x0,_0x387f01[_0x3d16('0x17')](_0x478c44));}return _0x387f01;};exports[_0x3d16('0x18')]=function(_0x3ee705){if(!_[_0x3d16('0x19')](_0x3ee705)&&_0x3ee705!==''){var _0x67337=/^(([^<>()\[\]\\.,;:\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 _0x67337[_0x3d16('0x1a')](String(_0x3ee705)[_0x3d16('0xd')]());}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 1d91653..4a71d57 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(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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(_0x5385b7,_0x4b7cce){var _0x54153d=function(_0x50f665){while(--_0x50f665){_0x5385b7['push'](_0x5385b7['shift']());}};_0x54153d(++_0x4b7cce);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 cdd08ca..71f08cd 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 _0xead2=['idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string'];(function(_0x3b0268,_0x7ae2ee){var _0x429c10=function(_0x461d95){while(--_0x461d95){_0x3b0268['push'](_0x3b0268['shift']());}};_0x429c10(++_0x7ae2ee);}(_0xead2,0x112));var _0x2ead=function(_0x4bb0a9,_0x3b1191){_0x4bb0a9=_0x4bb0a9-0x0;var _0x38449d=_0xead2[_0x4bb0a9];return _0x38449d;};'use strict';var _=require(_0x2ead('0x0'));var rp=require('request-promise');var md5=require(_0x2ead('0x1'));var util=require(_0x2ead('0x2'));var Redis=require(_0x2ead('0x3'));var intUtil=require(_0x2ead('0x4'));var config=require('../../../../config/environment');var logger=require(_0x2ead('0x5'))(_0x2ead('0x6'));config[_0x2ead('0x7')]=_[_0x2ead('0x8')](config[_0x2ead('0x7')],{'host':_0x2ead('0x9'),'port':0x18eb});var io=require(_0x2ead('0xa'))(new Redis(config['redis']));function emit(_0x536719,_0x1284ae,_0x47780e){io['to'](_0x536719)[_0x2ead('0xb')](_0x1284ae,_0x47780e);}var headers={'Content-Type':_0x2ead('0xc'),'Accept':'application/json'};function getTicket(_0x183c16,_0x50a383,_0x23b4c9,_0x4fb8b8,_0x5d3d82){logger[_0x2ead('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x2ead('0xe'),_0x183c16['remoteUri']),'method':_0x2ead('0xf'),'body':{'ticket':_[_0x2ead('0x10')]({'requester_id':_0x23b4c9['id'],'submitter_id':_0x50a383?_0x50a383['id']:undefined,'assignee_id':_0x50a383?_0x50a383['id']:undefined,'tags':getTags(_0x4fb8b8[_0x2ead('0x11')],_0x2ead('0x12')),'subject':intUtil[_0x2ead('0x13')](_0x4fb8b8[_0x2ead('0x14')],_0x5d3d82,'\x20'),'description':intUtil[_0x2ead('0x13')](_0x4fb8b8['Descriptions'],_0x5d3d82,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4fb8b8[_0x2ead('0x15')],_0x5d3d82,'\x0a')}},getCustomFields(_0x4fb8b8[_0x2ead('0x16')],_0x5d3d82))}})[_0x2ead('0x17')](function(_0x32a1f6){logger[_0x2ead('0xd')](_0x2ead('0x18'));return _0x32a1f6['ticket'];});}function getUser(_0xc6f65,_0x3c6127){if(intUtil[_0x2ead('0x19')](_0x3c6127)){logger[_0x2ead('0xd')](_0x2ead('0x1a'),_0x3c6127);return request({'uri':util['format'](_0x2ead('0x1b'),_0xc6f65[_0x2ead('0x1c')]),'qs':{'query':util['format'](_0x2ead('0x1d'),_0x3c6127)}})['then'](function(_0x1f3223){if(_0x1f3223['count']){logger['info'](_0x2ead('0x1e'));return _[_0x2ead('0x1f')](_0x1f3223['results'],{'email':_0x3c6127,'role':_0x2ead('0x20')});}else{logger['info'](_0x2ead('0x21'));return request({'uri':util[_0x2ead('0x22')](_0x2ead('0x23'),_0xc6f65['remoteUri'])})[_0x2ead('0x17')](function(_0x7610ae){logger[_0x2ead('0xd')](_0x2ead('0x24'));return _0x7610ae[_0x2ead('0x25')];});}});}else{logger[_0x2ead('0xd')](_0x2ead('0x21'));return request({'uri':util['format']('%s/users/me.json',_0xc6f65[_0x2ead('0x1c')])})[_0x2ead('0x17')](function(_0x467ab9){logger['info'](_0x2ead('0x24'));return _0x467ab9[_0x2ead('0x25')];});}}function getEndUser(_0x2e2088,_0x44f394,_0x757261){logger['info'](_0x2ead('0x26'),_0x757261);return request({'uri':util[_0x2ead('0x22')]('%s/search.json',_0x2e2088[_0x2ead('0x1c')]),'qs':{'query':util[_0x2ead('0x22')](_0x2ead('0x27'),_0x757261)}})[_0x2ead('0x17')](function(_0x1cbd66){var _0x4008a1;if(_0x1cbd66[_0x2ead('0x28')]['length']){_0x1cbd66[_0x2ead('0x28')]=_['filter'](_0x1cbd66[_0x2ead('0x28')],{'suspended':![],'role':_0x2ead('0x29')});if(_0x1cbd66[_0x2ead('0x28')][_0x2ead('0x2a')]){_0x4008a1=_[_0x2ead('0x2b')](_0x1cbd66[_0x2ead('0x28')]);}}if(_0x4008a1){logger[_0x2ead('0xd')](_0x2ead('0x2c'));return _0x4008a1;}else{logger[_0x2ead('0xd')](_0x2ead('0x2d'));return request({'uri':util['format']('%s/users.json',_0x2e2088[_0x2ead('0x1c')]),'method':_0x2ead('0xf'),'body':{'user':{'role':_0x2ead('0x29'),'name':util[_0x2ead('0x22')](_0x2ead('0x2e'),_0x44f394||_0x757261),'phone':_0x757261}}})['then'](function(_0x4299e2){logger[_0x2ead('0xd')](_0x2ead('0x2f'));return _0x4299e2[_0x2ead('0x25')];});}});}function getAuth(_0x5e68ad){var _0xd196ff;if(_0x5e68ad[_0x2ead('0x30')]===_0x2ead('0x31')){_0xd196ff=util[_0x2ead('0x22')]('%s:%s',_0x5e68ad['username'],_0x5e68ad[_0x2ead('0x31')]);}else if(_0x5e68ad['authType']===_0x2ead('0x32')){_0xd196ff=util['format'](_0x2ead('0x33'),_0x5e68ad[_0x2ead('0x34')],_0x5e68ad[_0x2ead('0x32')]);}return util[_0x2ead('0x22')](_0x2ead('0x35'),new Buffer(_0xd196ff)[_0x2ead('0x36')](_0x2ead('0x37')));}function request(_0x466b75){logger['debug'](_0x2ead('0x38'),JSON[_0x2ead('0x39')](_0x466b75));return rp(_[_0x2ead('0x8')](_0x466b75,{'method':_0x2ead('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x47622a,_0x78e0b){var _0x16d329=[];if(_0x47622a&&_0x47622a[_0x2ead('0x2a')]>0x0){_0x16d329=_['map'](_0x47622a,_0x78e0b);}return _0x16d329;}function getCustomFields(_0x31b3d7,_0x24347a){var _0x3a15b6=[];var _0x46a8c1={'custom_fields':[]};if(_0x31b3d7[_0x2ead('0x2a')]>0x0){_[_0x2ead('0x3b')](_0x31b3d7,function(_0x4ec35c){if(_[_0x2ead('0x3c')](['string',_0x2ead('0x3d')],_0x4ec35c[_0x2ead('0x3e')])&&_0x4ec35c[_0x2ead('0x3f')]&&!_0x4ec35c[_0x2ead('0x40')]){_0x46a8c1[_0x4ec35c['nameField'][_0x2ead('0x41')]()]=_0x4ec35c[_0x2ead('0x42')][_0x2ead('0x36')]();}else if(_['includes']([_0x2ead('0x43'),_0x2ead('0x3d')],_0x4ec35c[_0x2ead('0x3e')])&&_0x4ec35c[_0x2ead('0x44')]&&_0x4ec35c[_0x2ead('0x40')]){_0x46a8c1[_0x2ead('0x45')]['push']({'id':_0x4ec35c[_0x2ead('0x44')],'value':_0x4ec35c[_0x2ead('0x42')][_0x2ead('0x36')]()});}else if(_0x4ec35c['type']===_0x2ead('0x46')&&_0x4ec35c[_0x2ead('0x47')]&&_0x4ec35c[_0x2ead('0x44')]&&_0x4ec35c[_0x2ead('0x40')]){_0x24347a[_0x4ec35c[_0x2ead('0x47')]]&&_0x46a8c1[_0x2ead('0x45')][_0x2ead('0x48')]({'id':_0x4ec35c[_0x2ead('0x44')],'value':_0x24347a[_0x4ec35c[_0x2ead('0x47')]]['toString']()});}else if(_0x4ec35c[_0x2ead('0x3e')]===_0x2ead('0x49')&&_0x4ec35c['Variable']&&_0x4ec35c[_0x2ead('0x4a')][_0x2ead('0x12')]&&_0x4ec35c[_0x2ead('0x44')]&&_0x4ec35c['customField']){_0x24347a[_0x4ec35c[_0x2ead('0x4a')][_0x2ead('0x12')]['toLowerCase']()]&&_0x46a8c1[_0x2ead('0x45')][_0x2ead('0x48')]({'id':_0x4ec35c[_0x2ead('0x44')],'value':_0x24347a[_0x4ec35c[_0x2ead('0x4a')][_0x2ead('0x12')][_0x2ead('0x41')]()][_0x2ead('0x36')]()});}});}return _0x46a8c1;}exports[_0x2ead('0x4b')]=function(_0x4a21d9,_0x29855e,_0x526e1f,_0x4c5d37,_0x44341e,_0x14f582){var _0x5bd9a2,_0x2005f5;_0x14f582[_0x2ead('0x1c')]=intUtil[_0x2ead('0x4c')](_0x14f582[_0x2ead('0x1c')]);_0x14f582[_0x2ead('0x4d')]=intUtil['stripTrailingSlash'](_0x14f582[_0x2ead('0x4d')]);if(_0x44341e&&_0x44341e[_0x2ead('0x4e')]){logger[_0x2ead('0xd')](_0x2ead('0x4f'),_0x2ead('0x50'));_0x29855e[_0x2ead('0x51')]=util[_0x2ead('0x22')](_0x2ead('0x52'),_0x14f582[_0x2ead('0x4d')],_0x29855e[_0x2ead('0x53')],md5(_0x29855e[_0x2ead('0x53')]));}else{_0x29855e[_0x2ead('0x51')]='';}headers[_0x2ead('0x54')]=getAuth(_0x14f582);return getUser(_0x14f582,_0x4c5d37['email'])[_0x2ead('0x17')](function(_0x3dc712){_0x5bd9a2=_0x3dc712;logger[_0x2ead('0xd')](_0x2ead('0x55'),_0x5bd9a2['id']);return getEndUser(_0x14f582,_0x29855e[_0x2ead('0x56')],_0x29855e[_0x2ead('0x57')]);})[_0x2ead('0x17')](function(_0x38925e){_0x2005f5=_0x38925e;logger[_0x2ead('0xd')](_0x2ead('0x58'),_0x2005f5['id']);return getTicket(_0x14f582,_0x5bd9a2,_0x2005f5,_0x526e1f,_0x29855e);})[_0x2ead('0x17')](function(_0xbb6275){if(_0xbb6275){logger[_0x2ead('0xd')](_0x2ead('0x59'),_0xbb6275['id']);switch(_0x14f582['type']){case _0x2ead('0x5a'):logger[_0x2ead('0xd')](_0x2ead('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2ead('0x22')](_0x2ead('0x5b'),_0x14f582['remoteUri'],_0x5bd9a2['id'],_0xbb6275['id']),'method':_0x2ead('0xf')});case _0x2ead('0x5c'):logger[_0x2ead('0xd')]('[QUEUE]',_0x2ead('0x5d'));emit(util['format'](_0x2ead('0x5e'),_0x4c5d37[_0x2ead('0x12')]),_0x2ead('0x5f'),{'uri':util[_0x2ead('0x22')](_0x2ead('0x60'),_0x14f582[_0x2ead('0x1c')][_0x2ead('0x61')]('/api/v2',''),_0xbb6275['id'])});break;default:logger['error'](_0x2ead('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2ead('0x62')](function(_0x3f7936){logger['error'](_0x2ead('0x63'),util[_0x2ead('0x64')](_0x3f7936,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xb0fe9a,_0x5a8a14,_0x244adc,_0x497a50,_0x2a938d,_0x2d6b97,_0x42dd05){var _0x2ffc87,_0x32136a;_0x2d6b97[_0x2ead('0x1c')]=intUtil[_0x2ead('0x4c')](_0x2d6b97[_0x2ead('0x1c')]);_0x2d6b97[_0x2ead('0x4d')]=intUtil[_0x2ead('0x4c')](_0x2d6b97[_0x2ead('0x4d')]);if(_0x42dd05&&_0x42dd05[_0x2ead('0x65')]&&_0x42dd05[_0x2ead('0x65')]!==_0x2ead('0x66')){logger[_0x2ead('0xd')](_0x2ead('0x67'),_0x2ead('0x50'));_0x5a8a14['recordingURL']=util[_0x2ead('0x22')](_0x2ead('0x52'),_0x2d6b97[_0x2ead('0x4d')],_0x5a8a14[_0x2ead('0x53')],md5(_0x5a8a14[_0x2ead('0x53')]));}headers[_0x2ead('0x54')]=getAuth(_0x2d6b97);return getUser(_0x2d6b97,_0x497a50[_0x2ead('0x68')])['then'](function(_0x1c0967){_0x2ffc87=_0x1c0967;logger[_0x2ead('0xd')](_0x2ead('0x55'),_0x2ffc87['id']);return getEndUser(_0x2d6b97,_0x5a8a14[_0x2ead('0x69')],_0x5a8a14[_0x2ead('0x6a')]);})[_0x2ead('0x17')](function(_0x1e017c){_0x32136a=_0x1e017c;logger[_0x2ead('0xd')](_0x2ead('0x58'),_0x32136a['id']);return getTicket(_0x2d6b97,_0x2ffc87,_0x32136a,_0x244adc,_0x5a8a14);})[_0x2ead('0x17')](function(_0x2f66b8){if(_0x2f66b8){logger[_0x2ead('0xd')](_0x2ead('0x59'),_0x2f66b8['id']);switch(_0x2d6b97[_0x2ead('0x3e')]){case _0x2ead('0x5a'):logger[_0x2ead('0xd')](_0x2ead('0x67'),_0x2ead('0x6b'));return request({'uri':util[_0x2ead('0x22')](_0x2ead('0x5b'),_0x2d6b97[_0x2ead('0x1c')],_0x2ffc87['id'],_0x2f66b8['id']),'method':_0x2ead('0xf')});case _0x2ead('0x5c'):logger[_0x2ead('0xd')](_0x2ead('0x67'),_0x2ead('0x5d'));emit(util[_0x2ead('0x22')](_0x2ead('0x5e'),_0x497a50[_0x2ead('0x12')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x2d6b97[_0x2ead('0x1c')][_0x2ead('0x61')]('/api/v2',''),_0x2f66b8['id'])});break;default:logger[_0x2ead('0x6c')](_0x2ead('0x67'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2ead('0x62')](function(_0x14f480){logger[_0x2ead('0x6c')](_0x2ead('0x6d'),util['inspect'](_0x14f480,{'showHidden':!![],'depth':null}));});};exports[_0x2ead('0x6e')]=function(_0xeb27c4,_0x16efe9,_0x3b7f3c,_0x418dc1,_0x1487b5,_0x245191){var _0x207a8d,_0x271ff9;_0x245191['remoteUri']=intUtil[_0x2ead('0x4c')](_0x245191[_0x2ead('0x1c')]);_0x245191[_0x2ead('0x4d')]=intUtil[_0x2ead('0x4c')](_0x245191[_0x2ead('0x4d')]);if(_0x1487b5&&_0x1487b5['monitor_format']){logger[_0x2ead('0xd')]('['+_0x16efe9[_0x2ead('0x6f')][_0x2ead('0x70')]()+']',_0x2ead('0x50'));_0x16efe9['recordingURL']=util[_0x2ead('0x22')](_0x2ead('0x52'),_0x245191[_0x2ead('0x4d')],_0x16efe9[_0x2ead('0x53')],md5(_0x16efe9['uniqueid']));}else{_0x16efe9[_0x2ead('0x51')]='';}headers[_0x2ead('0x54')]=getAuth(_0x245191);return getUser(_0x245191)[_0x2ead('0x17')](function(_0x223fd2){_0x207a8d=_0x223fd2;logger[_0x2ead('0xd')]('The\x20User\x20ID\x20is:',_0x207a8d['id']);return getEndUser(_0x245191,_0x16efe9['calleridname'],_0x16efe9[_0x2ead('0x57')]);})[_0x2ead('0x17')](function(_0x1b12e5){_0x271ff9=_0x1b12e5;logger[_0x2ead('0xd')](_0x2ead('0x58'),_0x271ff9['id']);return getTicket(_0x245191,_0x207a8d,_0x271ff9,_0x3b7f3c,_0x16efe9);})['then'](function(_0x4828c0){if(_0x4828c0){logger['info'](_0x2ead('0x59'),_0x4828c0['id']);}})[_0x2ead('0x62')](function(_0x3964df){logger[_0x2ead('0x6c')]('['+_0x16efe9[_0x2ead('0x6f')]['toUpperCase']()+']'+_0x2ead('0x71'),util[_0x2ead('0x64')](_0x3964df,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe613=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','error','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','calleridname','The\x20Ticket\x20ID\x20is:','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','filter','results','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','map','forEach','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]'];(function(_0x351e72,_0x237d4f){var _0x208cea=function(_0x725545){while(--_0x725545){_0x351e72['push'](_0x351e72['shift']());}};_0x208cea(++_0x237d4f);}(_0xe613,0x1de));var _0x3e61=function(_0x240e19,_0xdca954){_0x240e19=_0x240e19-0x0;var _0x2f016e=_0xe613[_0x240e19];return _0x2f016e;};'use strict';var _=require('lodash');var rp=require(_0x3e61('0x0'));var md5=require(_0x3e61('0x1'));var util=require(_0x3e61('0x2'));var Redis=require('ioredis');var intUtil=require(_0x3e61('0x3'));var config=require(_0x3e61('0x4'));var logger=require(_0x3e61('0x5'))(_0x3e61('0x6'));config[_0x3e61('0x7')]=_[_0x3e61('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xda12d0,_0x17ddfe,_0x2232bc){io['to'](_0xda12d0)[_0x3e61('0x9')](_0x17ddfe,_0x2232bc);}var headers={'Content-Type':'application/json','Accept':_0x3e61('0xa')};function getTicket(_0x1eba94,_0x5c9718,_0x731232,_0x4eca71,_0x45b58c){logger[_0x3e61('0xb')](_0x3e61('0xc'));return request({'uri':util[_0x3e61('0xd')](_0x3e61('0xe'),_0x1eba94[_0x3e61('0xf')]),'method':_0x3e61('0x10'),'body':{'ticket':_[_0x3e61('0x11')]({'requester_id':_0x731232['id'],'submitter_id':_0x5c9718?_0x5c9718['id']:undefined,'assignee_id':_0x5c9718?_0x5c9718['id']:undefined,'tags':getTags(_0x4eca71[_0x3e61('0x12')],_0x3e61('0x13')),'subject':intUtil[_0x3e61('0x14')](_0x4eca71[_0x3e61('0x15')],_0x45b58c,'\x20'),'description':intUtil[_0x3e61('0x14')](_0x4eca71[_0x3e61('0x16')],_0x45b58c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3e61('0x14')](_0x4eca71[_0x3e61('0x16')],_0x45b58c,'\x0a')}},getCustomFields(_0x4eca71[_0x3e61('0x17')],_0x45b58c))}})[_0x3e61('0x18')](function(_0x4c4eaf){logger['info'](_0x3e61('0x19'));return _0x4c4eaf[_0x3e61('0x1a')];});}function getUser(_0x5d213d,_0x558780){if(intUtil[_0x3e61('0x1b')](_0x558780)){logger[_0x3e61('0xb')](_0x3e61('0x1c'),_0x558780);return request({'uri':util[_0x3e61('0xd')]('%s/search.json',_0x5d213d[_0x3e61('0xf')]),'qs':{'query':util['format'](_0x3e61('0x1d'),_0x558780)}})[_0x3e61('0x18')](function(_0x5d68b0){if(_0x5d68b0[_0x3e61('0x1e')]){logger[_0x3e61('0xb')](_0x3e61('0x1f'));return _['find'](_0x5d68b0['results'],{'email':_0x558780,'role':_0x3e61('0x20')});}else{logger[_0x3e61('0xb')](_0x3e61('0x21'));return request({'uri':util[_0x3e61('0xd')](_0x3e61('0x22'),_0x5d213d['remoteUri'])})[_0x3e61('0x18')](function(_0x180e25){logger['info'](_0x3e61('0x23'));return _0x180e25['user'];});}});}else{logger[_0x3e61('0xb')](_0x3e61('0x21'));return request({'uri':util[_0x3e61('0xd')](_0x3e61('0x22'),_0x5d213d[_0x3e61('0xf')])})['then'](function(_0x37f4ac){logger[_0x3e61('0xb')](_0x3e61('0x23'));return _0x37f4ac[_0x3e61('0x24')];});}}function getEndUser(_0x55f6a1,_0x3a4ac6,_0xb0dd77){logger[_0x3e61('0xb')](_0x3e61('0x25'),_0xb0dd77);return request({'uri':util['format'](_0x3e61('0x26'),_0x55f6a1[_0x3e61('0xf')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0xb0dd77)}})[_0x3e61('0x18')](function(_0x3c3efd){var _0x412ed3;if(_0x3c3efd['results']['length']){_0x3c3efd['results']=_[_0x3e61('0x27')](_0x3c3efd[_0x3e61('0x28')],{'suspended':![],'role':_0x3e61('0x29')});if(_0x3c3efd['results'][_0x3e61('0x2a')]){_0x412ed3=_[_0x3e61('0x2b')](_0x3c3efd['results']);}}if(_0x412ed3){logger['info']('Enduser\x20found!');return _0x412ed3;}else{logger[_0x3e61('0xb')](_0x3e61('0x2c'));return request({'uri':util[_0x3e61('0xd')]('%s/users.json',_0x55f6a1[_0x3e61('0xf')]),'method':_0x3e61('0x10'),'body':{'user':{'role':_0x3e61('0x29'),'name':util[_0x3e61('0xd')](_0x3e61('0x2d'),_0x3a4ac6||_0xb0dd77),'phone':_0xb0dd77}}})[_0x3e61('0x18')](function(_0x341e25){logger[_0x3e61('0xb')]('Enduser\x20created.');return _0x341e25[_0x3e61('0x24')];});}});}function getAuth(_0x45af2b){var _0x2e9acd;if(_0x45af2b[_0x3e61('0x2e')]===_0x3e61('0x2f')){_0x2e9acd=util[_0x3e61('0xd')](_0x3e61('0x30'),_0x45af2b[_0x3e61('0x31')],_0x45af2b['password']);}else if(_0x45af2b[_0x3e61('0x2e')]===_0x3e61('0x32')){_0x2e9acd=util[_0x3e61('0xd')](_0x3e61('0x33'),_0x45af2b[_0x3e61('0x31')],_0x45af2b[_0x3e61('0x32')]);}return util[_0x3e61('0xd')](_0x3e61('0x34'),new Buffer(_0x2e9acd)[_0x3e61('0x35')](_0x3e61('0x36')));}function request(_0x5e6396){logger[_0x3e61('0x37')]('[HTTP]',JSON[_0x3e61('0x38')](_0x5e6396));return rp(_[_0x3e61('0x8')](_0x5e6396,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2e9528,_0x975abd){var _0x1c9fb5=[];if(_0x2e9528&&_0x2e9528[_0x3e61('0x2a')]>0x0){_0x1c9fb5=_[_0x3e61('0x39')](_0x2e9528,_0x975abd);}return _0x1c9fb5;}function getCustomFields(_0x3af442,_0xeb14be){var _0x2ce22b=[];var _0x39f995={'custom_fields':[]};if(_0x3af442['length']>0x0){_[_0x3e61('0x3a')](_0x3af442,function(_0xf227fc){if(_['includes'](['string',_0x3e61('0x3b')],_0xf227fc[_0x3e61('0x3c')])&&_0xf227fc[_0x3e61('0x3d')]&&!_0xf227fc[_0x3e61('0x3e')]){_0x39f995[_0xf227fc['nameField'][_0x3e61('0x3f')]()]=_0xf227fc[_0x3e61('0x40')]['toString']();}else if(_['includes'](['string',_0x3e61('0x3b')],_0xf227fc[_0x3e61('0x3c')])&&_0xf227fc[_0x3e61('0x41')]&&_0xf227fc[_0x3e61('0x3e')]){_0x39f995[_0x3e61('0x42')][_0x3e61('0x43')]({'id':_0xf227fc['idField'],'value':_0xf227fc[_0x3e61('0x40')]['toString']()});}else if(_0xf227fc[_0x3e61('0x3c')]===_0x3e61('0x44')&&_0xf227fc[_0x3e61('0x45')]&&_0xf227fc[_0x3e61('0x41')]&&_0xf227fc[_0x3e61('0x3e')]){_0xeb14be[_0xf227fc[_0x3e61('0x45')]]&&_0x39f995['custom_fields'][_0x3e61('0x43')]({'id':_0xf227fc[_0x3e61('0x41')],'value':_0xeb14be[_0xf227fc[_0x3e61('0x45')]][_0x3e61('0x35')]()});}else if(_0xf227fc['type']===_0x3e61('0x46')&&_0xf227fc['Variable']&&_0xf227fc[_0x3e61('0x47')][_0x3e61('0x13')]&&_0xf227fc[_0x3e61('0x41')]&&_0xf227fc[_0x3e61('0x3e')]){_0xeb14be[_0xf227fc[_0x3e61('0x47')][_0x3e61('0x13')][_0x3e61('0x3f')]()]&&_0x39f995[_0x3e61('0x42')]['push']({'id':_0xf227fc[_0x3e61('0x41')],'value':_0xeb14be[_0xf227fc[_0x3e61('0x47')][_0x3e61('0x13')][_0x3e61('0x3f')]()][_0x3e61('0x35')]()});}});}return _0x39f995;}exports[_0x3e61('0x48')]=function(_0x3a48a5,_0x49718b,_0x4dfb6b,_0xbfbdc4,_0x195db2,_0x338cbe){var _0xac1e5a,_0x483fe0;_0x338cbe[_0x3e61('0xf')]=intUtil[_0x3e61('0x49')](_0x338cbe['remoteUri']);_0x338cbe[_0x3e61('0x4a')]=intUtil[_0x3e61('0x49')](_0x338cbe['serverUrl']);if(_0x195db2&&_0x195db2[_0x3e61('0x4b')]){logger[_0x3e61('0xb')]('[QUEUE]',_0x3e61('0x4c'));_0x49718b[_0x3e61('0x4d')]=util[_0x3e61('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x338cbe['serverUrl'],_0x49718b[_0x3e61('0x4e')],md5(_0x49718b[_0x3e61('0x4e')]));}else{_0x49718b[_0x3e61('0x4d')]='';}headers['Authorization']=getAuth(_0x338cbe);return getUser(_0x338cbe,_0xbfbdc4[_0x3e61('0x4f')])[_0x3e61('0x18')](function(_0x5766db){_0xac1e5a=_0x5766db;logger[_0x3e61('0xb')](_0x3e61('0x50'),_0xac1e5a['id']);return getEndUser(_0x338cbe,_0x49718b['calleridname'],_0x49718b[_0x3e61('0x51')]);})[_0x3e61('0x18')](function(_0x4dff8c){_0x483fe0=_0x4dff8c;logger[_0x3e61('0xb')](_0x3e61('0x52'),_0x483fe0['id']);return getTicket(_0x338cbe,_0xac1e5a,_0x483fe0,_0x4dfb6b,_0x49718b);})['then'](function(_0x14ea28){if(_0x14ea28){logger[_0x3e61('0xb')]('The\x20Ticket\x20ID\x20is:',_0x14ea28['id']);switch(_0x338cbe[_0x3e61('0x3c')]){case _0x3e61('0x53'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3e61('0xd')](_0x3e61('0x54'),_0x338cbe[_0x3e61('0xf')],_0xac1e5a['id'],_0x14ea28['id']),'method':'POST'});case _0x3e61('0x55'):logger[_0x3e61('0xb')](_0x3e61('0x56'),_0x3e61('0x57'));emit(util[_0x3e61('0xd')]('user:%s',_0xbfbdc4[_0x3e61('0x13')]),'trigger:browser:url',{'uri':util[_0x3e61('0xd')](_0x3e61('0x58'),_0x338cbe[_0x3e61('0xf')]['replace']('/api/v2',''),_0x14ea28['id'])});break;default:logger[_0x3e61('0x59')](_0x3e61('0x56'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3e61('0x5a')](function(_0x444411){logger[_0x3e61('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x444411,{'showHidden':!![],'depth':null}));});};exports[_0x3e61('0x5b')]=function(_0x3348f3,_0x661cb7,_0x5648f9,_0x5247fc,_0x25d550,_0x2452e3,_0x6ece0f){var _0x5b0b73,_0x5891c5;_0x2452e3['remoteUri']=intUtil[_0x3e61('0x49')](_0x2452e3['remoteUri']);_0x2452e3[_0x3e61('0x4a')]=intUtil[_0x3e61('0x49')](_0x2452e3[_0x3e61('0x4a')]);if(_0x6ece0f&&_0x6ece0f[_0x3e61('0x5c')]&&_0x6ece0f[_0x3e61('0x5c')]!==_0x3e61('0x5d')){logger[_0x3e61('0xb')](_0x3e61('0x5e'),_0x3e61('0x4c'));_0x661cb7[_0x3e61('0x4d')]=util['format'](_0x3e61('0x5f'),_0x2452e3[_0x3e61('0x4a')],_0x661cb7[_0x3e61('0x4e')],md5(_0x661cb7[_0x3e61('0x4e')]));}headers[_0x3e61('0x60')]=getAuth(_0x2452e3);return getUser(_0x2452e3,_0x5247fc[_0x3e61('0x4f')])[_0x3e61('0x18')](function(_0x4e31d1){_0x5b0b73=_0x4e31d1;logger[_0x3e61('0xb')](_0x3e61('0x50'),_0x5b0b73['id']);return getEndUser(_0x2452e3,_0x661cb7[_0x3e61('0x61')],_0x661cb7[_0x3e61('0x62')]);})[_0x3e61('0x18')](function(_0x149360){_0x5891c5=_0x149360;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5891c5['id']);return getTicket(_0x2452e3,_0x5b0b73,_0x5891c5,_0x5648f9,_0x661cb7);})[_0x3e61('0x18')](function(_0x283b09){if(_0x283b09){logger[_0x3e61('0xb')]('The\x20Ticket\x20ID\x20is:',_0x283b09['id']);switch(_0x2452e3[_0x3e61('0x3c')]){case _0x3e61('0x53'):logger['info'](_0x3e61('0x5e'),_0x3e61('0x63'));return request({'uri':util[_0x3e61('0xd')](_0x3e61('0x54'),_0x2452e3[_0x3e61('0xf')],_0x5b0b73['id'],_0x283b09['id']),'method':_0x3e61('0x10')});case _0x3e61('0x55'):logger[_0x3e61('0xb')]('[OUTBOUND]',_0x3e61('0x57'));emit(util[_0x3e61('0xd')](_0x3e61('0x64'),_0x5247fc[_0x3e61('0x13')]),_0x3e61('0x65'),{'uri':util[_0x3e61('0xd')](_0x3e61('0x58'),_0x2452e3[_0x3e61('0xf')][_0x3e61('0x66')](_0x3e61('0x67'),''),_0x283b09['id'])});break;default:logger[_0x3e61('0x59')]('[OUTBOUND]',_0x3e61('0x68'));}}})[_0x3e61('0x5a')](function(_0x5c804a){logger[_0x3e61('0x59')](_0x3e61('0x69'),util[_0x3e61('0x6a')](_0x5c804a,{'showHidden':!![],'depth':null}));});};exports[_0x3e61('0x6b')]=function(_0x4aeb69,_0x539517,_0x80bf7f,_0x1785d0,_0x1fcfa1,_0x510c7c){var _0x1d6175,_0x33877d;_0x510c7c[_0x3e61('0xf')]=intUtil[_0x3e61('0x49')](_0x510c7c[_0x3e61('0xf')]);_0x510c7c[_0x3e61('0x4a')]=intUtil[_0x3e61('0x49')](_0x510c7c[_0x3e61('0x4a')]);if(_0x1fcfa1&&_0x1fcfa1['monitor_format']){logger[_0x3e61('0xb')]('['+_0x539517[_0x3e61('0x6c')]['toUpperCase']()+']',_0x3e61('0x4c'));_0x539517[_0x3e61('0x4d')]=util[_0x3e61('0xd')](_0x3e61('0x5f'),_0x510c7c[_0x3e61('0x4a')],_0x539517[_0x3e61('0x4e')],md5(_0x539517[_0x3e61('0x4e')]));}else{_0x539517[_0x3e61('0x4d')]='';}headers[_0x3e61('0x60')]=getAuth(_0x510c7c);return getUser(_0x510c7c)[_0x3e61('0x18')](function(_0x133fc5){_0x1d6175=_0x133fc5;logger[_0x3e61('0xb')](_0x3e61('0x50'),_0x1d6175['id']);return getEndUser(_0x510c7c,_0x539517[_0x3e61('0x6d')],_0x539517[_0x3e61('0x51')]);})[_0x3e61('0x18')](function(_0x512fb9){_0x33877d=_0x512fb9;logger[_0x3e61('0xb')](_0x3e61('0x52'),_0x33877d['id']);return getTicket(_0x510c7c,_0x1d6175,_0x33877d,_0x80bf7f,_0x539517);})[_0x3e61('0x18')](function(_0xdb0ca2){if(_0xdb0ca2){logger[_0x3e61('0xb')](_0x3e61('0x6e'),_0xdb0ca2['id']);}})[_0x3e61('0x5a')](function(_0x51ef9d){logger['error']('['+_0x539517[_0x3e61('0x6c')][_0x3e61('0x6f')]()+']'+_0x3e61('0x70'),util[_0x3e61('0x6a')](_0x51ef9d,{'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 44b6a75..627f640 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 _0x5bc5=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','unmanaged','monitor_format','toUpperCase','/downloads?type=uniqueid&token=','calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','type','idField','toString','variable','variableName','customVariable','name','Variable','toLowerCase','split','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','host','com','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x504e64,_0x52692c){var _0x1a0520=function(_0x54d98d){while(--_0x54d98d){_0x504e64['push'](_0x504e64['shift']());}};_0x1a0520(++_0x52692c);}(_0x5bc5,0xb2));var _0x55bc=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x5bc5[_0x3207aa];return _0x51758f;};'use strict';var _=require(_0x55bc('0x0'));var rp=require(_0x55bc('0x1'));var md5=require(_0x55bc('0x2'));var util=require(_0x55bc('0x3'));var intUtil=require(_0x55bc('0x4'));var moment=require(_0x55bc('0x5'));var Redis=require(_0x55bc('0x6'));var BPromise=require(_0x55bc('0x7'));var config=require(_0x55bc('0x8'));var logger=require(_0x55bc('0x9'))(_0x55bc('0xa'));config[_0x55bc('0xb')]=_[_0x55bc('0xc')](config['redis'],{'host':_0x55bc('0xd'),'port':0x18eb});var io=require(_0x55bc('0xe'))(new Redis(config[_0x55bc('0xb')]));function emit(_0x38839e,_0x4d0610,_0x1d6e72){io['to'](_0x38839e)[_0x55bc('0xf')](_0x4d0610,_0x1d6e72);}function request(_0xc535ac){logger[_0x55bc('0x10')](_0x55bc('0x11'),JSON[_0x55bc('0x12')](_0xc535ac));return rp(_0xc535ac);}function getCustomFields(_0x72a619,_0x718891){var _0x4b905d={};if(_0x72a619[_0x55bc('0x13')]>0x0){_[_0x55bc('0x14')](_0x72a619,function(_0x41f298){if(_['includes']([_0x55bc('0x15'),'picklist'],_0x41f298[_0x55bc('0x16')])&&_0x41f298[_0x55bc('0x17')]){_0x4b905d[_0x41f298[_0x55bc('0x17')]]=_0x41f298['content'][_0x55bc('0x18')]();}else if(_0x41f298['type']===_0x55bc('0x19')&&_0x41f298[_0x55bc('0x1a')]&&_0x41f298[_0x55bc('0x17')]&&_0x718891[_0x41f298['variableName']]){_0x4b905d[_0x41f298[_0x55bc('0x17')]]=_0x718891[_0x41f298[_0x55bc('0x1a')]]['toString']();}else if(_0x41f298['type']===_0x55bc('0x1b')&&_0x41f298['Variable']&&_0x41f298['Variable'][_0x55bc('0x1c')]&&_0x41f298[_0x55bc('0x17')]&&_0x718891[_0x41f298[_0x55bc('0x1d')]['name'][_0x55bc('0x1e')]()]){_0x4b905d[_0x41f298[_0x55bc('0x17')]]=_0x718891[_0x41f298[_0x55bc('0x1d')]['name'][_0x55bc('0x1e')]()]['toString']();}});}return _0x4b905d;}function getName(_0x29f969){if(_0x29f969['indexOf']('\x20')>0x0){var _0x53f103=_0x29f969[_0x55bc('0x1f')](/ (.+)/);if(_0x53f103[0x1]){return _0x53f103;}}return[_0x29f969,_0x29f969];}var accountsTokens={};function getAccessToken(_0x390af6){return new Promise(function(_0x2dbfaf,_0x5781f2){if(!_['isNil'](accountsTokens[_0x390af6['id']])&&!_['isNil'](accountsTokens[_0x390af6['id']][_0x55bc('0x20')])){if(moment()[_0x55bc('0x21')](accountsTokens[_0x390af6['id']]['expires_in'])){_0x2dbfaf(accountsTokens[_0x390af6['id']]['access_token']);}}var _0x384433;switch(_0x390af6[_0x55bc('0x22')]){case'US':_0x384433=_0x55bc('0x23');break;case'AU':_0x384433=_0x55bc('0x24');break;case'EU':_0x384433='https://accounts.zoho.eu';break;case'IN':_0x384433=_0x55bc('0x25');break;case'CN':_0x384433='https://accounts.zoho.com.cn';break;default:_0x384433='https://accounts.zoho.eu';break;}var _0x3e6254={'method':_0x55bc('0x26'),'uri':_0x384433+_0x55bc('0x27'),'qs':{'refresh_token':_0x390af6[_0x55bc('0x28')],'client_id':_0x390af6[_0x55bc('0x29')],'client_secret':_0x390af6['clientSecret'],'grant_type':_0x55bc('0x2a')},'json':!![]};return rp(_0x3e6254)[_0x55bc('0x2b')](function(_0xa649a3){accountsTokens[_0x390af6['id']]={'access_token':_0xa649a3[_0x55bc('0x20')],'expires_in':moment()[_0x55bc('0x2c')](_0xa649a3[_0x55bc('0x2d')],'seconds')};_0x2dbfaf(_0xa649a3[_0x55bc('0x20')]);})[_0x55bc('0x2e')](function(_0x4227be){logger[_0x55bc('0x2f')](_0x55bc('0x30'),_0x4227be[_0x55bc('0x31')]);_0x5781f2(_0x4227be);});});}function getUser(_0x1268ac,_0x29cf97,_0x1d840f,_0x409295){logger[_0x55bc('0x32')](_0x55bc('0x33'));return request({'method':'GET','uri':util[_0x55bc('0x34')](_0x55bc('0x35'),_0x29cf97),'qs':{'type':_0x55bc('0x36')},'headers':{'Authorization':_0x55bc('0x37')+_0x1268ac},'json':!![]})[_0x55bc('0x2b')](function(_0x497681){if(_0x497681[_0x55bc('0x38')]){var _0x412d57=-0x1;if(_[_0x55bc('0x39')](_0x497681[_0x55bc('0x38')])){if(!_[_0x55bc('0x3a')](_0x409295)){_0x412d57=_[_0x55bc('0x3b')](_0x497681[_0x55bc('0x38')],function(_0x33ee3a){return _0x33ee3a[_0x55bc('0x3c')]===_0x409295;});}if(_0x412d57>=0x0){logger['info'](_0x55bc('0x3d'));}else{logger[_0x55bc('0x32')](_0x55bc('0x3e'));_0x412d57=_[_0x55bc('0x3b')](_0x497681[_0x55bc('0x38')],function(_0x2f7beb){return _0x2f7beb[_0x55bc('0x3f')]['name']===_0x55bc('0x40');});}return _0x497681[_0x55bc('0x38')][_0x412d57];}else{if(_0x497681['user'][_0x55bc('0x3f')][_0x55bc('0x1c')]===_0x55bc('0x40')){logger[_0x55bc('0x32')](_0x55bc('0x3e'));user=_0x497681['user'];return user;}else{logger['error'](_0x55bc('0x41'),JSON[_0x55bc('0x12')](_0x497681));throw new Error(_0x55bc('0x42')+JSON[_0x55bc('0x12')](_0x497681));}}}else{logger[_0x55bc('0x2f')](_0x55bc('0x41'),JSON[_0x55bc('0x12')](_0x497681));throw new Error(_0x55bc('0x42')+JSON['stringify'](_0x497681));}})[_0x55bc('0x2e')](function(_0x224342){console[_0x55bc('0x2f')](_0x224342);});}function getZohoUser(_0x53ae76,_0x5661de){return new BPromise(function(_0x32c468,_0x58b58d){request(_0x53ae76)[_0x55bc('0x2b')](function(_0x69d8b1){var _0x4c1e8e=null;if(_0x69d8b1){_0x4c1e8e=_0x69d8b1[_0x55bc('0x43')][0x0];_0x4c1e8e[_0x55bc('0x44')]=_0x5661de;}_0x32c468(_0x4c1e8e);})[_0x55bc('0x2e')](function(_0x1f8c9c){_0x58b58d(_0x1f8c9c);});});}function createEndUser(_0x26ae3e,_0x3bb55a,_0x334e24,_0x3e5b7c,_0x5ebce8,_0x339704){var _0x334e24=getName(_0x334e24);return request({'method':_0x55bc('0x26'),'uri':_0x55bc('0x45')+_0x3bb55a+_0x55bc('0x46')+_[_0x55bc('0x47')](_0x339704[_0x55bc('0x48')])+'s','body':{'data':[{'Last_Name':_0x334e24[0x1],'First_Name':_0x334e24[0x0],'Phone':_0x3e5b7c,'Owner':{'name':!_[_0x55bc('0x3a')](_0x5ebce8['role'][_0x55bc('0x1c')])?_0x5ebce8[_0x55bc('0x49')]['name']:!_[_0x55bc('0x3a')](_0x5ebce8[_0x55bc('0x4a')])?_0x5ebce8[_0x55bc('0x4a')]+'\x20'+_0x5ebce8[_0x55bc('0x4b')]:_0x5ebce8[_0x55bc('0x4b')],'id':_0x5ebce8['id']}}]},'headers':{'Authorization':_0x55bc('0x37')+_0x26ae3e},'json':!![]})[_0x55bc('0x2b')](function(_0x54e4f6){if(_0x54e4f6&&_0x54e4f6[_0x55bc('0x43')][0x0][_0x55bc('0x4c')]===_0x55bc('0x4d')){var _0x57c4e9=_0x54e4f6[_0x55bc('0x43')][0x0][_0x55bc('0x4e')];_0x57c4e9[_0x55bc('0x44')]=_[_0x55bc('0x47')](_0x339704['moduleCreate'])+'s';return _0x57c4e9;}logger[_0x55bc('0x2f')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x55bc('0x4f')+JSON['stringify'](data));})[_0x55bc('0x2e')](function(_0x41a2db){console[_0x55bc('0x50')](_0x55bc('0x51'),_0x41a2db);});}function getEndUser(_0x5f361d,_0x5894d9,_0x509c62,_0x5e2aea,_0x18f6f9,_0x1359a6,_0x55eaa7){var _0x37ff3e={'method':_0x55bc('0x52'),'uri':'','headers':{'Authorization':_0x55bc('0x37')+_0x5f361d},'json':!![]};switch(_0x55eaa7[_0x55bc('0x53')]){case'contact_lead':_0x37ff3e[_0x55bc('0x54')]=_0x55bc('0x45')+_0x5894d9+_0x55bc('0x55')+_0x18f6f9+'))';return getZohoUser(_0x37ff3e,_0x55bc('0x56'))[_0x55bc('0x2b')](function(_0x5bebda){if(_0x5bebda)return _0x5bebda;_0x37ff3e[_0x55bc('0x54')]=_0x55bc('0x45')+_0x5894d9+_0x55bc('0x57')+_0x18f6f9+'))';return getZohoUser(_0x37ff3e,_0x55bc('0x58'))[_0x55bc('0x2b')](function(_0x44d617){if(_0x44d617)return _0x44d617;if(_0x55eaa7[_0x55bc('0x48')]!='nothing'){return createEndUser(_0x5f361d,_0x5894d9,_0x5e2aea,_0x18f6f9,_0x1359a6,_0x55eaa7);}else{return{};}});});break;case _0x55bc('0x59'):_0x37ff3e[_0x55bc('0x54')]=_0x55bc('0x45')+_0x5894d9+_0x55bc('0x55')+_0x18f6f9+'))';return getZohoUser(_0x37ff3e,_0x55bc('0x56'))[_0x55bc('0x2b')](function(_0x3f77a8){if(_0x3f77a8)return _0x3f77a8;if(_0x55eaa7[_0x55bc('0x48')]!=_0x55bc('0x5a')){return createEndUser(_0x5f361d,_0x5894d9,_0x5e2aea,_0x18f6f9,_0x1359a6,_0x55eaa7);}else{return{};}});break;case _0x55bc('0x5b'):_0x37ff3e[_0x55bc('0x54')]=_0x55bc('0x45')+_0x5894d9+_0x55bc('0x57')+_0x18f6f9+'))';return getZohoUser(_0x37ff3e,_0x55bc('0x58'))['then'](function(_0x56dc07){if(_0x56dc07)return _0x56dc07;if(_0x55eaa7[_0x55bc('0x48')]!=_0x55bc('0x5a')){return createEndUser(_0x5f361d,_0x5894d9,_0x5e2aea,_0x18f6f9,_0x1359a6,_0x55eaa7);}else{return{};}});break;}}function getCall(_0x3de9b4,_0x4c161c,_0x42847b,_0x5b7ec0,_0x212560,_0x496448,_0x104960,_0x566be2){logger[_0x55bc('0x32')](_0x55bc('0x5c'));var _0x2630fa={};_0x2630fa['Owner']={'name':!_[_0x55bc('0x3a')](_0x5b7ec0[_0x55bc('0x49')][_0x55bc('0x1c')])&&!_[_0x55bc('0x3a')](_0x5b7ec0[_0x55bc('0x3f')]['name'])&&_0x5b7ec0[_0x55bc('0x3f')]['name']===_0x55bc('0x5d')?_0x5b7ec0[_0x55bc('0x49')][_0x55bc('0x1c')]:!_[_0x55bc('0x3a')](_0x5b7ec0[_0x55bc('0x4a')])?_0x5b7ec0[_0x55bc('0x4a')]+'\x20'+_0x5b7ec0[_0x55bc('0x4b')]:_0x5b7ec0[_0x55bc('0x4b')],'id':_0x5b7ec0['id']};_0x2630fa[_0x55bc('0x5e')]=intUtil[_0x55bc('0x5f')](_0x496448[_0x55bc('0x60')],_0x104960,'\x20');_0x2630fa[_0x55bc('0x61')]=intUtil[_0x55bc('0x5f')](_0x496448[_0x55bc('0x62')],_0x104960,'\x0a');if(_0x212560[_0x55bc('0x44')]==='Contacts'){_0x2630fa[_0x55bc('0x63')]={'name':!_['isNil'](_0x212560[_0x55bc('0x64')])?_0x212560[_0x55bc('0x64')]:!_[_0x55bc('0x3a')](_0x212560[_0x55bc('0x65')])?_0x212560[_0x55bc('0x65')]+'\x20'+_0x212560[_0x55bc('0x66')]:_0x212560['Last_Name'],'id':_0x212560['id']};}if(_0x212560['enduserType']===_0x55bc('0x58')){_0x2630fa[_0x55bc('0x67')]={'name':!_[_0x55bc('0x3a')](_0x212560['Full_Name'])?_0x212560[_0x55bc('0x64')]:!_[_0x55bc('0x3a')](_0x212560['First_Name'])?_0x212560[_0x55bc('0x65')]+'\x20'+_0x212560[_0x55bc('0x66')]:_0x212560['Last_Name'],'id':_0x212560['id']};_0x2630fa[_0x55bc('0x68')]=_[_0x55bc('0x47')](_0x212560[_0x55bc('0x44')]);}if(_0x104960['talktime']){_0x2630fa[_0x55bc('0x69')]=moment[_0x55bc('0x6a')](parseInt(_0x104960[_0x55bc('0x6b')])*0x3e8)[_0x55bc('0x34')](_0x55bc('0x6c'));}else if(_0x104960[_0x55bc('0x6d')]&&_0x104960[_0x55bc('0x6e')]){_0x2630fa[_0x55bc('0x69')]=moment[_0x55bc('0x6a')](moment(_0x104960[_0x55bc('0x6e')],_0x55bc('0x6f'))[_0x55bc('0x70')](moment(_0x104960['starttime'],_0x55bc('0x6f'))))['format']('mm:ss');}switch(_0x104960[_0x55bc('0x71')]){case'called':_0x2630fa['Call_Result']=_0x55bc('0x72');break;case _0x55bc('0x73'):case'connect':_0x2630fa[_0x55bc('0x74')]=_0x55bc('0x75');break;case _0x55bc('0x76'):_0x2630fa[_0x55bc('0x74')]=_0x55bc('0x77');break;case _0x55bc('0x78'):_0x2630fa['Call_Result']=_0x55bc('0x79');break;case _0x55bc('0x7a'):_0x2630fa[_0x55bc('0x74')]=_0x55bc('0x7b');default:}_0x2630fa[_0x55bc('0x7c')]=(_0x566be2===_0x55bc('0x7d')?moment(_0x104960[_0x55bc('0x7e')])[_0x55bc('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x104960[_0x55bc('0x7f')])[_0x55bc('0x34')](_0x55bc('0x6f')))||moment()[_0x55bc('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x2630fa[_0x55bc('0x80')]=_0x566be2||_0x55bc('0x81');_0x2630fa=_[_0x55bc('0x82')](_0x2630fa,getCustomFields(_0x496448[_0x55bc('0x83')],_0x104960));return request({'method':_0x55bc('0x26'),'uri':_0x55bc('0x45')+_0x4c161c+_0x55bc('0x84'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3de9b4},'body':{'data':[_0x2630fa]},'json':!![]})[_0x55bc('0x2b')](function(_0x1c127a){if(_0x1c127a&&_0x1c127a['data'][0x0][_0x55bc('0x4c')]===_0x55bc('0x4d')){logger[_0x55bc('0x32')](_0x55bc('0x85'));return{'id':_0x1c127a[_0x55bc('0x43')][0x0][_0x55bc('0x4e')]['id']};}})[_0x55bc('0x2e')](function(_0x845f2f){logger[_0x55bc('0x32')](_0x55bc('0x86'),_0x845f2f[_0x55bc('0x31')]);console[_0x55bc('0x50')](_0x55bc('0x86'),_0x845f2f);});}exports[_0x55bc('0x87')]=function(_0x27a66d,_0x55c509,_0xbf17b,_0x3a3e85,_0x56629f,_0x6faa0a){var _0x1d7981,_0x19e8d5,_0x4a4251;_0x6faa0a['host']=intUtil['stripTrailingSlash'](_0x6faa0a['host']);_0x6faa0a[_0x55bc('0x88')]=intUtil[_0x55bc('0x89')](_0x6faa0a[_0x55bc('0x88')]);if(_0x56629f&&_0x56629f['monitor_format']){logger[_0x55bc('0x32')](_0x55bc('0x8a'),_0x55bc('0x8b'));_0x55c509[_0x55bc('0x8c')]=_0x6faa0a[_0x55bc('0x88')]+_0x55bc('0x8d')+_0x55c509['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x55c509[_0x55bc('0x8e')]);}else{_0x55c509['recordingURL']='';}var _0x815490=_0x6faa0a[_0x55bc('0x8f')]==='zoho.eu'?'eu':_0x55bc('0x90');return getAccessToken(_0x6faa0a)[_0x55bc('0x2b')](function(_0x3857be){_0x4a4251=_0x3857be;return getUser(_0x4a4251,_0x815490,_0x6faa0a,_0x3a3e85[_0x55bc('0x3c')]);})[_0x55bc('0x2b')](function(_0x3937f0){_0x1d7981=_0x3937f0;logger[_0x55bc('0x32')]('The\x20User\x20ID\x20is:',_0x1d7981['id']);return getEndUser(_0x4a4251,_0x815490,_0x6faa0a,_0x55c509[_0x55bc('0x91')],_0x55c509['calleridnum'],_0x1d7981,_0xbf17b);})['then'](function(_0x5d94a9){_0x19e8d5=_0x5d94a9;return getCall(_0x4a4251,_0x815490,_0x6faa0a,_0x1d7981,_0x19e8d5,_0xbf17b,_0x55c509,_0x55bc('0x81'));})['then'](function(_0x9a802b){if(_0x9a802b){logger[_0x55bc('0x32')]('The\x20Call\x20ID\x20is:',_0x9a802b['id']);logger['info'](_0x55bc('0x8a'),_0x55bc('0x92'));emit(util[_0x55bc('0x34')](_0x55bc('0x93'),_0x3a3e85[_0x55bc('0x1c')]),_0x55bc('0x94'),{'uri':_0x55bc('0x95')+_0x6faa0a[_0x55bc('0x8f')]+_0x55bc('0x96')+_0x9a802b['id']});}})[_0x55bc('0x2e')](function(_0x3c24ba){logger['error'](_0x55bc('0x8a'),JSON['stringify'](_0x3c24ba));});};exports[_0x55bc('0x7d')]=function(_0x3266c5,_0x25a212,_0x22ffba,_0x524b0e,_0x494bf7,_0x26c677,_0x3d0a42){var _0x20dca2,_0xbb0d71,_0x5f4872;_0x26c677[_0x55bc('0x8f')]=intUtil['stripTrailingSlash'](_0x26c677[_0x55bc('0x8f')]);_0x26c677[_0x55bc('0x88')]=intUtil[_0x55bc('0x89')](_0x26c677[_0x55bc('0x88')]);if(_0x3d0a42&&_0x3d0a42[_0x55bc('0x97')]&&_0x3d0a42[_0x55bc('0x97')]!=='none'){logger['info'](_0x55bc('0x98'),_0x55bc('0x8b'));_0x25a212[_0x55bc('0x8c')]=_0x26c677['serverUrl']+_0x55bc('0x8d')+_0x25a212[_0x55bc('0x8e')]+'/downloads?type=uniqueid&token='+md5(_0x25a212[_0x55bc('0x8e')]);}var _0x283e74=_0x26c677[_0x55bc('0x8f')]===_0x55bc('0x99')?'eu':_0x55bc('0x90');return getAccessToken(_0x26c677)[_0x55bc('0x2b')](function(_0x26217e){_0x5f4872=_0x26217e;return getUser(_0x5f4872,_0x283e74,_0x26c677,_0x524b0e[_0x55bc('0x3c')]);})[_0x55bc('0x2b')](function(_0x89a067){_0x20dca2=_0x89a067;logger[_0x55bc('0x32')](_0x55bc('0x9a'),_0x20dca2['id']);return getEndUser(_0x5f4872,_0x283e74,_0x26c677,_0x25a212[_0x55bc('0x9b')],_0x25a212[_0x55bc('0x9c')],_0x20dca2,_0x22ffba);})[_0x55bc('0x2b')](function(_0x34d8b2){_0xbb0d71=_0x34d8b2;return getCall(_0x5f4872,_0x283e74,_0x26c677,_0x20dca2,_0xbb0d71,_0x22ffba,_0x25a212,'Outbound');})[_0x55bc('0x2b')](function(_0x3a673a){if(_0x3a673a){logger['info'](_0x55bc('0x9d'),_0x3a673a['id']);logger[_0x55bc('0x32')](_0x55bc('0x98'),_0x55bc('0x92'));emit(util[_0x55bc('0x34')](_0x55bc('0x93'),_0x524b0e['name']),_0x55bc('0x94'),{'uri':_0x55bc('0x95')+_0x26c677[_0x55bc('0x8f')]+_0x55bc('0x96')+_0x3a673a['id']});}})['catch'](function(_0x3067ba){logger[_0x55bc('0x2f')](_0x55bc('0x98'),JSON[_0x55bc('0x12')](_0x3067ba));});};exports[_0x55bc('0x9e')]=function(_0x510e30,_0x2bb33b,_0x5b8d5f,_0x126a1a,_0x400ad4,_0x953f62){var _0x50cfb5,_0x2c227b,_0x4d8bd0;_0x953f62['host']=intUtil[_0x55bc('0x89')](_0x953f62[_0x55bc('0x8f')]);_0x953f62[_0x55bc('0x88')]=intUtil[_0x55bc('0x89')](_0x953f62[_0x55bc('0x88')]);if(_0x400ad4&&_0x400ad4[_0x55bc('0x9f')]){logger[_0x55bc('0x32')]('['+_0x2bb33b[_0x55bc('0x71')][_0x55bc('0xa0')]()+']',_0x55bc('0x8b'));_0x2bb33b['recordingURL']=_0x953f62[_0x55bc('0x88')]+_0x55bc('0x8d')+_0x2bb33b['uniqueid']+_0x55bc('0xa1')+md5(_0x2bb33b[_0x55bc('0x8e')]);}else{_0x2bb33b['recordingURL']='';}var _0x1fab56=_0x953f62[_0x55bc('0x8f')]==='zoho.eu'?'eu':_0x55bc('0x90');return getAccessToken(_0x953f62)[_0x55bc('0x2b')](function(_0x1fa595){_0x4d8bd0=_0x1fa595;return getUser(_0x4d8bd0,_0x1fab56,_0x953f62);})[_0x55bc('0x2b')](function(_0x15c846){_0x50cfb5=_0x15c846;logger[_0x55bc('0x32')](_0x55bc('0x9a'),_0x50cfb5['id']);return getEndUser(_0x4d8bd0,_0x1fab56,_0x953f62,_0x2bb33b[_0x55bc('0x91')],_0x2bb33b[_0x55bc('0xa2')],_0x50cfb5,_0x5b8d5f);})[_0x55bc('0x2b')](function(_0x32b9d0){_0x2c227b=_0x32b9d0;return getCall(_0x4d8bd0,_0x1fab56,_0x953f62,_0x50cfb5,_0x2c227b,_0x5b8d5f,_0x2bb33b,'Inbound');})[_0x55bc('0x2b')](function(_0x1fd72c){if(_0x1fd72c){logger[_0x55bc('0x32')](_0x55bc('0x9d'),_0x1fd72c['id']);}})[_0x55bc('0x2e')](function(_0x552247){logger[_0x55bc('0x2f')]('['+_0x2bb33b[_0x55bc('0x71')][_0x55bc('0xa0')]()+']',JSON[_0x55bc('0x12')](_0x552247));});}; \ No newline at end of file +var _0xbef6=['clientId','clientSecret','refresh_token','then','add','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','Zoho-oauthtoken\x20','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Leads','Owner','profile','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','/crm/v2/Calls','code','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','calleridname','toUpperCase','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken'];(function(_0x256239,_0x400d3d){var _0x4e4b0d=function(_0xdac09e){while(--_0xdac09e){_0x256239['push'](_0x256239['shift']());}};_0x4e4b0d(++_0x400d3d);}(_0xbef6,0x1b0));var _0x6bef=function(_0x44e6ca,_0x3400e0){_0x44e6ca=_0x44e6ca-0x0;var _0x10bb7d=_0xbef6[_0x44e6ca];return _0x10bb7d;};'use strict';var _=require(_0x6bef('0x0'));var rp=require(_0x6bef('0x1'));var md5=require('md5');var util=require(_0x6bef('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x6bef('0x3'));var BPromise=require('bluebird');var config=require(_0x6bef('0x4'));var logger=require(_0x6bef('0x5'))('zoho');config[_0x6bef('0x6')]=_[_0x6bef('0x7')](config['redis'],{'host':_0x6bef('0x8'),'port':0x18eb});var io=require(_0x6bef('0x9'))(new Redis(config['redis']));function emit(_0x4d47d0,_0x30639d,_0x2fdc50){io['to'](_0x4d47d0)[_0x6bef('0xa')](_0x30639d,_0x2fdc50);}function request(_0x19d992){logger[_0x6bef('0xb')](_0x6bef('0xc'),JSON[_0x6bef('0xd')](_0x19d992));return rp(_0x19d992);}function getCustomFields(_0x419c12,_0xe12a46){var _0x2c9f42={};if(_0x419c12[_0x6bef('0xe')]>0x0){_[_0x6bef('0xf')](_0x419c12,function(_0x2af4c9){if(_['includes']([_0x6bef('0x10'),_0x6bef('0x11')],_0x2af4c9[_0x6bef('0x12')])&&_0x2af4c9[_0x6bef('0x13')]){_0x2c9f42[_0x2af4c9[_0x6bef('0x13')]]=_0x2af4c9[_0x6bef('0x14')][_0x6bef('0x15')]();}else if(_0x2af4c9[_0x6bef('0x12')]===_0x6bef('0x16')&&_0x2af4c9[_0x6bef('0x17')]&&_0x2af4c9[_0x6bef('0x13')]&&_0xe12a46[_0x2af4c9[_0x6bef('0x17')]]){_0x2c9f42[_0x2af4c9[_0x6bef('0x13')]]=_0xe12a46[_0x2af4c9['variableName']][_0x6bef('0x15')]();}else if(_0x2af4c9['type']===_0x6bef('0x18')&&_0x2af4c9[_0x6bef('0x19')]&&_0x2af4c9[_0x6bef('0x19')][_0x6bef('0x1a')]&&_0x2af4c9[_0x6bef('0x13')]&&_0xe12a46[_0x2af4c9['Variable'][_0x6bef('0x1a')][_0x6bef('0x1b')]()]){_0x2c9f42[_0x2af4c9[_0x6bef('0x13')]]=_0xe12a46[_0x2af4c9['Variable'][_0x6bef('0x1a')][_0x6bef('0x1b')]()][_0x6bef('0x15')]();}});}return _0x2c9f42;}function getName(_0x254752){if(_0x254752[_0x6bef('0x1c')]('\x20')>0x0){var _0x336e85=_0x254752[_0x6bef('0x1d')](/ (.+)/);if(_0x336e85[0x1]){return _0x336e85;}}return[_0x254752,_0x254752];}var accountsTokens={};function getAccessToken(_0x81015c){return new Promise(function(_0xc9761f,_0x5c9289){if(!_['isNil'](accountsTokens[_0x81015c['id']])&&!_[_0x6bef('0x1e')](accountsTokens[_0x81015c['id']][_0x6bef('0x1f')])){if(moment()[_0x6bef('0x20')](accountsTokens[_0x81015c['id']][_0x6bef('0x21')])){_0xc9761f(accountsTokens[_0x81015c['id']][_0x6bef('0x1f')]);}}var _0x19101e;switch(_0x81015c[_0x6bef('0x22')]){case'US':_0x19101e='https://accounts.zoho.com';break;case'AU':_0x19101e=_0x6bef('0x23');break;case'EU':_0x19101e=_0x6bef('0x24');break;case'IN':_0x19101e=_0x6bef('0x25');break;case'CN':_0x19101e=_0x6bef('0x26');break;default:_0x19101e=_0x6bef('0x24');break;}var _0x5da389={'method':_0x6bef('0x27'),'uri':_0x19101e+_0x6bef('0x28'),'qs':{'refresh_token':_0x81015c[_0x6bef('0x29')],'client_id':_0x81015c[_0x6bef('0x2a')],'client_secret':_0x81015c[_0x6bef('0x2b')],'grant_type':_0x6bef('0x2c')},'json':!![]};return rp(_0x5da389)[_0x6bef('0x2d')](function(_0x5dbfd3){accountsTokens[_0x81015c['id']]={'access_token':_0x5dbfd3[_0x6bef('0x1f')],'expires_in':moment()[_0x6bef('0x2e')](_0x5dbfd3[_0x6bef('0x21')],_0x6bef('0x2f'))};_0xc9761f(_0x5dbfd3[_0x6bef('0x1f')]);})[_0x6bef('0x30')](function(_0x36570f){logger['error']('Failing\x20creating\x20the\x20access_token',_0x36570f[_0x6bef('0x31')]);_0x5c9289(_0x36570f);});});}function getUser(_0x38394f,_0x1a12b0,_0x1209a5,_0x552aa9){logger[_0x6bef('0x32')](_0x6bef('0x33'));return request({'method':_0x6bef('0x34'),'uri':util[_0x6bef('0x35')](_0x6bef('0x36'),_0x1a12b0),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x38394f},'json':!![]})[_0x6bef('0x2d')](function(_0x23fe7f){if(_0x23fe7f[_0x6bef('0x37')]){var _0x24a842=-0x1;if(_[_0x6bef('0x38')](_0x23fe7f['users'])){if(!_[_0x6bef('0x1e')](_0x552aa9)){_0x24a842=_[_0x6bef('0x39')](_0x23fe7f[_0x6bef('0x37')],function(_0x46cc77){return _0x46cc77[_0x6bef('0x3a')]===_0x552aa9;});}if(_0x24a842>=0x0){logger[_0x6bef('0x32')](_0x6bef('0x3b'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x24a842=_[_0x6bef('0x39')](_0x23fe7f[_0x6bef('0x37')],function(_0x478761){return _0x478761['profile'][_0x6bef('0x1a')]===_0x6bef('0x3c');});}return _0x23fe7f[_0x6bef('0x37')][_0x24a842];}else{if(_0x23fe7f[_0x6bef('0x3d')]['profile'][_0x6bef('0x1a')]===_0x6bef('0x3c')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x23fe7f['user'];return user;}else{logger[_0x6bef('0x3e')](_0x6bef('0x3f'),JSON[_0x6bef('0xd')](_0x23fe7f));throw new Error(_0x6bef('0x40')+JSON[_0x6bef('0xd')](_0x23fe7f));}}}else{logger['error'](_0x6bef('0x3f'),JSON[_0x6bef('0xd')](_0x23fe7f));throw new Error(_0x6bef('0x40')+JSON[_0x6bef('0xd')](_0x23fe7f));}})['catch'](function(_0x53c9dd){console[_0x6bef('0x3e')](_0x53c9dd);});}function getZohoUser(_0x5f0cee,_0x5c8f41){return new BPromise(function(_0x39cee8,_0x27d153){request(_0x5f0cee)[_0x6bef('0x2d')](function(_0x2536ab){var _0x324872=null;if(_0x2536ab){_0x324872=_0x2536ab[_0x6bef('0x41')][0x0];_0x324872[_0x6bef('0x42')]=_0x5c8f41;}_0x39cee8(_0x324872);})[_0x6bef('0x30')](function(_0xe574a9){_0x27d153(_0xe574a9);});});}function createEndUser(_0x384ba9,_0x31adba,_0x2d448d,_0x3f4bc7,_0x2f767a,_0x1099c0){var _0x2d448d=getName(_0x2d448d);return request({'method':_0x6bef('0x27'),'uri':_0x6bef('0x43')+_0x31adba+_0x6bef('0x44')+_[_0x6bef('0x45')](_0x1099c0[_0x6bef('0x46')])+'s','body':{'data':[{'Last_Name':_0x2d448d[0x1],'First_Name':_0x2d448d[0x0],'Phone':_0x3f4bc7,'Owner':{'name':!_['isNil'](_0x2f767a[_0x6bef('0x47')]['name'])?_0x2f767a[_0x6bef('0x47')][_0x6bef('0x1a')]:!_['isNil'](_0x2f767a['first_name'])?_0x2f767a['first_name']+'\x20'+_0x2f767a[_0x6bef('0x48')]:_0x2f767a[_0x6bef('0x48')],'id':_0x2f767a['id']}}]},'headers':{'Authorization':_0x6bef('0x49')+_0x384ba9},'json':!![]})[_0x6bef('0x2d')](function(_0xe487c){if(_0xe487c&&_0xe487c['data'][0x0]['code']===_0x6bef('0x4a')){var _0x446664=_0xe487c[_0x6bef('0x41')][0x0][_0x6bef('0x4b')];_0x446664['enduserType']=_[_0x6bef('0x45')](_0x1099c0[_0x6bef('0x46')])+'s';return _0x446664;}logger[_0x6bef('0x3e')](_0x6bef('0x3f'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x6bef('0xd')](data));})['catch'](function(_0x5a9271){console['log'](_0x6bef('0x4c'),_0x5a9271);});}function getEndUser(_0x33abfa,_0x56e44b,_0x2b31e0,_0x4743d4,_0x5edadb,_0x3b6d75,_0x5b3b10){var _0x3536f4={'method':_0x6bef('0x34'),'uri':'','headers':{'Authorization':_0x6bef('0x49')+_0x33abfa},'json':!![]};switch(_0x5b3b10[_0x6bef('0x4d')]){case _0x6bef('0x4e'):_0x3536f4['uri']=_0x6bef('0x43')+_0x56e44b+_0x6bef('0x4f')+_0x5edadb+'))';return getZohoUser(_0x3536f4,_0x6bef('0x50'))['then'](function(_0x28e79e){if(_0x28e79e)return _0x28e79e;_0x3536f4[_0x6bef('0x51')]=_0x6bef('0x43')+_0x56e44b+_0x6bef('0x52')+_0x5edadb+'))';return getZohoUser(_0x3536f4,'Leads')[_0x6bef('0x2d')](function(_0x4e8e75){if(_0x4e8e75)return _0x4e8e75;if(_0x5b3b10[_0x6bef('0x46')]!=_0x6bef('0x53')){return createEndUser(_0x33abfa,_0x56e44b,_0x4743d4,_0x5edadb,_0x3b6d75,_0x5b3b10);}else{return{};}});});break;case'contact':_0x3536f4[_0x6bef('0x51')]=_0x6bef('0x43')+_0x56e44b+_0x6bef('0x4f')+_0x5edadb+'))';return getZohoUser(_0x3536f4,_0x6bef('0x50'))['then'](function(_0x1c71ea){if(_0x1c71ea)return _0x1c71ea;if(_0x5b3b10[_0x6bef('0x46')]!=_0x6bef('0x53')){return createEndUser(_0x33abfa,_0x56e44b,_0x4743d4,_0x5edadb,_0x3b6d75,_0x5b3b10);}else{return{};}});break;case'lead':_0x3536f4['uri']=_0x6bef('0x43')+_0x56e44b+_0x6bef('0x52')+_0x5edadb+'))';return getZohoUser(_0x3536f4,_0x6bef('0x54'))['then'](function(_0x4b345e){if(_0x4b345e)return _0x4b345e;if(_0x5b3b10[_0x6bef('0x46')]!='nothing'){return createEndUser(_0x33abfa,_0x56e44b,_0x4743d4,_0x5edadb,_0x3b6d75,_0x5b3b10);}else{return{};}});break;}}function getCall(_0x5dc2a7,_0x34d9bc,_0x1843d2,_0x39796d,_0x3351e5,_0x433558,_0x2788ef,_0x39d1b1){logger[_0x6bef('0x32')]('Creating\x20new\x20call...');var _0x52ab2f={};_0x52ab2f[_0x6bef('0x55')]={'name':!_[_0x6bef('0x1e')](_0x39796d[_0x6bef('0x47')]['name'])&&!_[_0x6bef('0x1e')](_0x39796d[_0x6bef('0x56')][_0x6bef('0x1a')])&&_0x39796d[_0x6bef('0x56')]['name']===_0x6bef('0x57')?_0x39796d[_0x6bef('0x47')][_0x6bef('0x1a')]:!_['isNil'](_0x39796d[_0x6bef('0x58')])?_0x39796d['first_name']+'\x20'+_0x39796d[_0x6bef('0x48')]:_0x39796d[_0x6bef('0x48')],'id':_0x39796d['id']};_0x52ab2f[_0x6bef('0x59')]=intUtil[_0x6bef('0x5a')](_0x433558[_0x6bef('0x5b')],_0x2788ef,'\x20');_0x52ab2f[_0x6bef('0x5c')]=intUtil[_0x6bef('0x5a')](_0x433558[_0x6bef('0x5d')],_0x2788ef,'\x0a');if(_0x3351e5[_0x6bef('0x42')]===_0x6bef('0x50')){_0x52ab2f[_0x6bef('0x5e')]={'name':!_[_0x6bef('0x1e')](_0x3351e5[_0x6bef('0x5f')])?_0x3351e5[_0x6bef('0x5f')]:!_[_0x6bef('0x1e')](_0x3351e5['First_Name'])?_0x3351e5[_0x6bef('0x60')]+'\x20'+_0x3351e5['Last_Name']:_0x3351e5[_0x6bef('0x61')],'id':_0x3351e5['id']};}if(_0x3351e5[_0x6bef('0x42')]===_0x6bef('0x54')){_0x52ab2f[_0x6bef('0x62')]={'name':!_['isNil'](_0x3351e5[_0x6bef('0x5f')])?_0x3351e5[_0x6bef('0x5f')]:!_[_0x6bef('0x1e')](_0x3351e5[_0x6bef('0x60')])?_0x3351e5[_0x6bef('0x60')]+'\x20'+_0x3351e5[_0x6bef('0x61')]:_0x3351e5['Last_Name'],'id':_0x3351e5['id']};_0x52ab2f[_0x6bef('0x63')]=_[_0x6bef('0x45')](_0x3351e5['enduserType']);}if(_0x2788ef[_0x6bef('0x64')]){_0x52ab2f[_0x6bef('0x65')]=moment[_0x6bef('0x66')](parseInt(_0x2788ef['talktime'])*0x3e8)[_0x6bef('0x35')](_0x6bef('0x67'));}else if(_0x2788ef[_0x6bef('0x68')]&&_0x2788ef['endtime']){_0x52ab2f[_0x6bef('0x65')]=moment[_0x6bef('0x66')](moment(_0x2788ef['endtime'],_0x6bef('0x69'))['diff'](moment(_0x2788ef[_0x6bef('0x6a')],_0x6bef('0x69'))))['format']('mm:ss');}switch(_0x2788ef[_0x6bef('0x6b')]){case _0x6bef('0x6c'):_0x52ab2f[_0x6bef('0x6d')]='Called';break;case _0x6bef('0x6e'):case _0x6bef('0x6f'):_0x52ab2f[_0x6bef('0x6d')]=_0x6bef('0x70');break;case _0x6bef('0x71'):_0x52ab2f[_0x6bef('0x6d')]=_0x6bef('0x72');break;case _0x6bef('0x73'):_0x52ab2f[_0x6bef('0x6d')]=_0x6bef('0x74');break;case _0x6bef('0x75'):_0x52ab2f[_0x6bef('0x6d')]=_0x6bef('0x76');default:}_0x52ab2f[_0x6bef('0x77')]=(_0x39d1b1==='outbound'?moment(_0x2788ef[_0x6bef('0x6a')])[_0x6bef('0x35')](_0x6bef('0x69')):moment(_0x2788ef[_0x6bef('0x78')])[_0x6bef('0x35')](_0x6bef('0x69')))||moment()[_0x6bef('0x35')]('YYYY-MM-DDTHH:mm:ss');_0x52ab2f[_0x6bef('0x79')]=_0x39d1b1||'Inbound';_0x52ab2f=_[_0x6bef('0x7a')](_0x52ab2f,getCustomFields(_0x433558['Fields'],_0x2788ef));return request({'method':_0x6bef('0x27'),'uri':_0x6bef('0x43')+_0x34d9bc+_0x6bef('0x7b'),'headers':{'Authorization':_0x6bef('0x49')+_0x5dc2a7},'body':{'data':[_0x52ab2f]},'json':!![]})[_0x6bef('0x2d')](function(_0x1589c0){if(_0x1589c0&&_0x1589c0['data'][0x0][_0x6bef('0x7c')]===_0x6bef('0x4a')){logger[_0x6bef('0x32')](_0x6bef('0x7d'));return{'id':_0x1589c0['data'][0x0][_0x6bef('0x4b')]['id']};}})[_0x6bef('0x30')](function(_0x448c73){logger['info']('err',_0x448c73['stack']);console[_0x6bef('0x7e')](_0x6bef('0x7f'),_0x448c73);});}exports[_0x6bef('0x80')]=function(_0xecdfed,_0x29e13f,_0x5584f3,_0x33ccd8,_0x12f7cc,_0x4f7b64){var _0x3394f4,_0x13f325,_0x561df1;_0x4f7b64[_0x6bef('0x81')]=intUtil[_0x6bef('0x82')](_0x4f7b64[_0x6bef('0x81')]);_0x4f7b64['serverUrl']=intUtil[_0x6bef('0x82')](_0x4f7b64[_0x6bef('0x83')]);if(_0x12f7cc&&_0x12f7cc[_0x6bef('0x84')]){logger[_0x6bef('0x32')](_0x6bef('0x85'),_0x6bef('0x86'));_0x29e13f[_0x6bef('0x87')]=_0x4f7b64[_0x6bef('0x83')]+'/api/voice/recordings/'+_0x29e13f[_0x6bef('0x88')]+_0x6bef('0x89')+md5(_0x29e13f[_0x6bef('0x88')]);}else{_0x29e13f[_0x6bef('0x87')]='';}var _0x4d4b05=_0x4f7b64[_0x6bef('0x81')]===_0x6bef('0x8a')?'eu':_0x6bef('0x8b');return getAccessToken(_0x4f7b64)[_0x6bef('0x2d')](function(_0x44f24a){_0x561df1=_0x44f24a;return getUser(_0x561df1,_0x4d4b05,_0x4f7b64,_0x33ccd8[_0x6bef('0x3a')]);})[_0x6bef('0x2d')](function(_0x3ea973){_0x3394f4=_0x3ea973;logger['info']('The\x20User\x20ID\x20is:',_0x3394f4['id']);return getEndUser(_0x561df1,_0x4d4b05,_0x4f7b64,_0x29e13f['calleridname'],_0x29e13f[_0x6bef('0x8c')],_0x3394f4,_0x5584f3);})[_0x6bef('0x2d')](function(_0x2176c2){_0x13f325=_0x2176c2;return getCall(_0x561df1,_0x4d4b05,_0x4f7b64,_0x3394f4,_0x13f325,_0x5584f3,_0x29e13f,_0x6bef('0x8d'));})['then'](function(_0x239192){if(_0x239192){logger['info'](_0x6bef('0x8e'),_0x239192['id']);logger[_0x6bef('0x32')](_0x6bef('0x85'),_0x6bef('0x8f'));emit(util[_0x6bef('0x35')](_0x6bef('0x90'),_0x33ccd8['name']),_0x6bef('0x91'),{'uri':'https://crm.'+_0x4f7b64[_0x6bef('0x81')]+_0x6bef('0x92')+_0x239192['id']});}})[_0x6bef('0x30')](function(_0x35dbbe){logger[_0x6bef('0x3e')](_0x6bef('0x85'),JSON['stringify'](_0x35dbbe));});};exports[_0x6bef('0x93')]=function(_0x4ff3fa,_0x37d222,_0x481d84,_0x3d6c4f,_0x18f27a,_0x41d8df,_0x11a878){var _0x44449e,_0xb33cc8,_0x13a6ac;_0x41d8df[_0x6bef('0x81')]=intUtil[_0x6bef('0x82')](_0x41d8df[_0x6bef('0x81')]);_0x41d8df[_0x6bef('0x83')]=intUtil[_0x6bef('0x82')](_0x41d8df[_0x6bef('0x83')]);if(_0x11a878&&_0x11a878[_0x6bef('0x94')]&&_0x11a878['recordingFormat']!==_0x6bef('0x95')){logger['info'](_0x6bef('0x96'),_0x6bef('0x86'));_0x37d222[_0x6bef('0x87')]=_0x41d8df[_0x6bef('0x83')]+_0x6bef('0x97')+_0x37d222[_0x6bef('0x88')]+_0x6bef('0x89')+md5(_0x37d222[_0x6bef('0x88')]);}var _0x34ff4c=_0x41d8df[_0x6bef('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x41d8df)[_0x6bef('0x2d')](function(_0x2f3da0){_0x13a6ac=_0x2f3da0;return getUser(_0x13a6ac,_0x34ff4c,_0x41d8df,_0x3d6c4f[_0x6bef('0x3a')]);})[_0x6bef('0x2d')](function(_0x194847){_0x44449e=_0x194847;logger['info'](_0x6bef('0x98'),_0x44449e['id']);return getEndUser(_0x13a6ac,_0x34ff4c,_0x41d8df,_0x37d222[_0x6bef('0x99')],_0x37d222[_0x6bef('0x9a')],_0x44449e,_0x481d84);})[_0x6bef('0x2d')](function(_0x5b10f3){_0xb33cc8=_0x5b10f3;return getCall(_0x13a6ac,_0x34ff4c,_0x41d8df,_0x44449e,_0xb33cc8,_0x481d84,_0x37d222,'Outbound');})['then'](function(_0x464217){if(_0x464217){logger[_0x6bef('0x32')]('The\x20Call\x20ID\x20is:',_0x464217['id']);logger['info']('[OUTBOUND]',_0x6bef('0x8f'));emit(util[_0x6bef('0x35')](_0x6bef('0x90'),_0x3d6c4f[_0x6bef('0x1a')]),_0x6bef('0x91'),{'uri':'https://crm.'+_0x41d8df[_0x6bef('0x81')]+_0x6bef('0x92')+_0x464217['id']});}})[_0x6bef('0x30')](function(_0xce781c){logger[_0x6bef('0x3e')](_0x6bef('0x96'),JSON[_0x6bef('0xd')](_0xce781c));});};exports[_0x6bef('0x9b')]=function(_0x426bae,_0x5cae80,_0x343fe3,_0x311c45,_0x4bf5b2,_0x4a0208){var _0x495140,_0x4d9001,_0x3d76a8;_0x4a0208[_0x6bef('0x81')]=intUtil[_0x6bef('0x82')](_0x4a0208[_0x6bef('0x81')]);_0x4a0208[_0x6bef('0x83')]=intUtil[_0x6bef('0x82')](_0x4a0208['serverUrl']);if(_0x4bf5b2&&_0x4bf5b2[_0x6bef('0x84')]){logger[_0x6bef('0x32')]('['+_0x5cae80['lastevent']['toUpperCase']()+']',_0x6bef('0x86'));_0x5cae80[_0x6bef('0x87')]=_0x4a0208[_0x6bef('0x83')]+_0x6bef('0x97')+_0x5cae80[_0x6bef('0x88')]+_0x6bef('0x89')+md5(_0x5cae80[_0x6bef('0x88')]);}else{_0x5cae80['recordingURL']='';}var _0x5f274e=_0x4a0208[_0x6bef('0x81')]===_0x6bef('0x8a')?'eu':_0x6bef('0x8b');return getAccessToken(_0x4a0208)[_0x6bef('0x2d')](function(_0x114986){_0x3d76a8=_0x114986;return getUser(_0x3d76a8,_0x5f274e,_0x4a0208);})['then'](function(_0x2f4bf2){_0x495140=_0x2f4bf2;logger[_0x6bef('0x32')](_0x6bef('0x98'),_0x495140['id']);return getEndUser(_0x3d76a8,_0x5f274e,_0x4a0208,_0x5cae80[_0x6bef('0x9c')],_0x5cae80[_0x6bef('0x8c')],_0x495140,_0x343fe3);})[_0x6bef('0x2d')](function(_0x491a27){_0x4d9001=_0x491a27;return getCall(_0x3d76a8,_0x5f274e,_0x4a0208,_0x495140,_0x4d9001,_0x343fe3,_0x5cae80,'Inbound');})[_0x6bef('0x2d')](function(_0x3081eb){if(_0x3081eb){logger[_0x6bef('0x32')](_0x6bef('0x8e'),_0x3081eb['id']);}})['catch'](function(_0x17c521){logger[_0x6bef('0x3e')]('['+_0x5cae80[_0x6bef('0x6b')][_0x6bef('0x9d')]()+']',JSON[_0x6bef('0xd')](_0x17c521));});}; \ 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 be75ca8..5af9a08 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 _0xd1c8=['mustache','../../../../config/logger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x59c427,_0x377cba){var _0x547bf5=function(_0x3e9557){while(--_0x3e9557){_0x59c427['push'](_0x59c427['shift']());}};_0x547bf5(++_0x377cba);}(_0xd1c8,0xdb));var _0x8d1c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd1c8[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x8d1c('0x0'));var sh=require(_0x8d1c('0x1'));var Mustache=require(_0x8d1c('0x2'));var logger=require(_0x8d1c('0x3'))('trigger');exports[_0x8d1c('0x4')]=function(_0x1fc6c1,_0x32e4c1){var _0x313ac2=_0x1fc6c1[_0x8d1c('0x5')]?_0x1fc6c1['data2']:_0x8d1c('0x6');var _0x4fc0de=_0x1fc6c1[_0x8d1c('0x7')]?Mustache[_0x8d1c('0x8')](_0x1fc6c1[_0x8d1c('0x7')],_0x32e4c1):_0x32e4c1;sh[_0x8d1c('0x4')](_0x4fc0de,function(_0x4b3fb7,_0x308432,_0x1283db){if(_0x4b3fb7!==0x0){logger[_0x8d1c('0x9')](util[_0x8d1c('0xa')](_0x8d1c('0xb'),_0x313ac2,_0x4fc0de,_0x4b3fb7,_0x1283db));}else{logger['info'](util[_0x8d1c('0xa')](_0x8d1c('0xc'),_0x313ac2,_0x4fc0de,_0x308432));}});}; \ No newline at end of file +var _0xefbc=['shelljs','mustache','../../../../config/logger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x2855d4,_0x31bc97){var _0x3a4353=function(_0xa450d9){while(--_0xa450d9){_0x2855d4['push'](_0x2855d4['shift']());}};_0x3a4353(++_0x31bc97);}(_0xefbc,0x1b1));var _0xcefb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xefbc[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcefb('0x0'));var sh=require(_0xcefb('0x1'));var Mustache=require(_0xcefb('0x2'));var logger=require(_0xcefb('0x3'))('trigger');exports[_0xcefb('0x4')]=function(_0x4027a4,_0x5ec526){var _0x8bce65=_0x4027a4[_0xcefb('0x5')]?_0x4027a4['data2']:_0xcefb('0x6');var _0x3b9e3f=_0x4027a4[_0xcefb('0x7')]?Mustache[_0xcefb('0x8')](_0x4027a4[_0xcefb('0x7')],_0x5ec526):_0x5ec526;sh[_0xcefb('0x4')](_0x3b9e3f,function(_0x3ce2c1,_0x29460a,_0x3cf827){if(_0x3ce2c1!==0x0){logger[_0xcefb('0x9')](util[_0xcefb('0xa')](_0xcefb('0xb'),_0x8bce65,_0x3b9e3f,_0x3ce2c1,_0x3cf827));}else{logger[_0xcefb('0xc')](util[_0xcefb('0xa')](_0xcefb('0xd'),_0x8bce65,_0x3b9e3f,_0x29460a));}});}; \ 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 5957cf1..0b99354 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 _0x9a09=['data2','data5','headers','data6','stack','data1','GET','DELETE','PUT','data7','parse','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','render'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x9a09,0x88));var _0x99a0=function(_0x2c9d5f,_0x2a04a7){_0x2c9d5f=_0x2c9d5f-0x0;var _0x10173e=_0x9a09[_0x2c9d5f];return _0x10173e;};'use strict';var rp=require(_0x99a0('0x0'));var util=require(_0x99a0('0x1'));var _=require(_0x99a0('0x2'));var Mustache=require(_0x99a0('0x3'));var logger=require(_0x99a0('0x4'))(_0x99a0('0x5'));exports['exec']=function(_0x45f3f6,_0x5d0e80){var _0x360008,_0x41415b;var _0x1f346f={'method':_0x45f3f6['data1'][_0x99a0('0x6')](),'uri':Mustache[_0x99a0('0x7')](_0x45f3f6[_0x99a0('0x8')],_0x5d0e80),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x45f3f6['data5'])==='number'&&parseInt(_0x45f3f6[_0x99a0('0x9')])>=0x1&&parseInt(_0x45f3f6['data5'])<=0xa?parseInt(_0x45f3f6[_0x99a0('0x9')])*0x3e8:0x5*0x3e8};try{_0x1f346f[_0x99a0('0xa')]=_0x45f3f6[_0x99a0('0xb')]?JSON['parse'](Mustache['render'](_0x45f3f6['data6'],_0x5d0e80)):{};}catch(_0xc40b07){logger['error'](_0xc40b07[_0x99a0('0xc')]);}switch(_0x45f3f6[_0x99a0('0xd')][_0x99a0('0x6')]()){case _0x99a0('0xe'):case _0x99a0('0xf'):_0x360008=null;_0x1f346f['qs']=_0x5d0e80;break;case'POST':case _0x99a0('0x10'):if(_0x45f3f6[_0x99a0('0x11')]){try{_0x360008=JSON[_0x99a0('0x12')](Mustache['render'](_0x45f3f6[_0x99a0('0x11')],_0x5d0e80));_0x1f346f['body']=_0x360008;}catch(_0x2e5c27){logger[_0x99a0('0x13')](_0x2e5c27[_0x99a0('0xc')]);logger[_0x99a0('0x13')](_0x99a0('0x14'));}}else{_0x360008=_0x5d0e80;_0x1f346f[_0x99a0('0x15')]=_0x360008;}break;}logger[_0x99a0('0x16')](util[_0x99a0('0x17')](_0x99a0('0x18'),_0x45f3f6[_0x99a0('0xd')],_0x45f3f6[_0x99a0('0x8')],JSON['stringify'](_0x1f346f)));rp(_0x1f346f)[_0x99a0('0x19')](function(_0x10e147){_0x360008=!_[_0x99a0('0x1a')](_0x360008)?_0x99a0('0x1b')+_0x360008:'';_0x41415b=typeof _0x10e147[_0x99a0('0x15')]===_0x99a0('0x1c')?JSON[_0x99a0('0x1d')](_0x10e147[_0x99a0('0x15')]):_0x10e147[_0x99a0('0x15')];logger[_0x99a0('0x16')](util[_0x99a0('0x17')](_0x99a0('0x1e'),_0x45f3f6['data1'],_0x45f3f6[_0x99a0('0x8')],_0x10e147[_0x99a0('0x1f')],_0x41415b));})[_0x99a0('0x20')](function(_0xdc5eb8){logger[_0x99a0('0x13')](util[_0x99a0('0x17')](_0x99a0('0x21'),_0x45f3f6[_0x99a0('0xd')],_0x45f3f6[_0x99a0('0x8')],_0xdc5eb8['statusCode'],_0xdc5eb8[_0x99a0('0x22')],_0xdc5eb8[_0x99a0('0x23')]));});}; \ No newline at end of file +var _0x7a3a=['stack','data1','GET','DELETE','POST','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','trigger','exec','render','data2','data5','headers','data6','parse','error'];(function(_0x340945,_0x20874f){var _0x2ad37e=function(_0x502f75){while(--_0x502f75){_0x340945['push'](_0x340945['shift']());}};_0x2ad37e(++_0x20874f);}(_0x7a3a,0x85));var _0xa7a3=function(_0x207fbe,_0x4ff553){_0x207fbe=_0x207fbe-0x0;var _0x3cb079=_0x7a3a[_0x207fbe];return _0x3cb079;};'use strict';var rp=require(_0xa7a3('0x0'));var util=require('util');var _=require(_0xa7a3('0x1'));var Mustache=require(_0xa7a3('0x2'));var logger=require('../../../../config/logger')(_0xa7a3('0x3'));exports[_0xa7a3('0x4')]=function(_0x184127,_0x51474c){var _0x599bd9,_0x53735e;var _0x1b50e8={'method':_0x184127['data1']['toUpperCase'](),'uri':Mustache[_0xa7a3('0x5')](_0x184127[_0xa7a3('0x6')],_0x51474c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x184127[_0xa7a3('0x7')])==='number'&&parseInt(_0x184127[_0xa7a3('0x7')])>=0x1&&parseInt(_0x184127['data5'])<=0xa?parseInt(_0x184127['data5'])*0x3e8:0x5*0x3e8};try{_0x1b50e8[_0xa7a3('0x8')]=_0x184127[_0xa7a3('0x9')]?JSON[_0xa7a3('0xa')](Mustache['render'](_0x184127[_0xa7a3('0x9')],_0x51474c)):{};}catch(_0x54f64b){logger[_0xa7a3('0xb')](_0x54f64b[_0xa7a3('0xc')]);}switch(_0x184127[_0xa7a3('0xd')]['toUpperCase']()){case _0xa7a3('0xe'):case _0xa7a3('0xf'):_0x599bd9=null;_0x1b50e8['qs']=_0x51474c;break;case _0xa7a3('0x10'):case'PUT':if(_0x184127[_0xa7a3('0x11')]){try{_0x599bd9=JSON[_0xa7a3('0xa')](Mustache['render'](_0x184127[_0xa7a3('0x11')],_0x51474c));_0x1b50e8[_0xa7a3('0x12')]=_0x599bd9;}catch(_0x1aa8f3){logger[_0xa7a3('0xb')](_0x1aa8f3['stack']);logger[_0xa7a3('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x599bd9=_0x51474c;_0x1b50e8[_0xa7a3('0x12')]=_0x599bd9;}break;}logger[_0xa7a3('0x13')](util[_0xa7a3('0x14')](_0xa7a3('0x15'),_0x184127[_0xa7a3('0xd')],_0x184127[_0xa7a3('0x6')],JSON[_0xa7a3('0x16')](_0x1b50e8)));rp(_0x1b50e8)['then'](function(_0x178f1f){_0x599bd9=!_[_0xa7a3('0x17')](_0x599bd9)?',\x20request\x20body:\x20'+_0x599bd9:'';_0x53735e=typeof _0x178f1f[_0xa7a3('0x12')]==='object'?JSON[_0xa7a3('0x16')](_0x178f1f['body']):_0x178f1f['body'];logger[_0xa7a3('0x13')](util[_0xa7a3('0x14')](_0xa7a3('0x18'),_0x184127[_0xa7a3('0xd')],_0x184127[_0xa7a3('0x6')],_0x178f1f[_0xa7a3('0x19')],_0x53735e));})['catch'](function(_0x21a2a8){logger[_0xa7a3('0xb')](util['format'](_0xa7a3('0x1a'),_0x184127[_0xa7a3('0xd')],_0x184127['data2'],_0x21a2a8[_0xa7a3('0x19')],_0x21a2a8[_0xa7a3('0x1b')],_0x21a2a8[_0xa7a3('0x1c')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 76aa8fc..0db3f77 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 _0x86f8=['routing','exports','jayson/promise','../../config/logger','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x4b1408,_0x113e90){var _0x2696e7=function(_0x4fbb18){while(--_0x4fbb18){_0x4b1408['push'](_0x4b1408['shift']());}};_0x2696e7(++_0x113e90);}(_0x86f8,0x147));var _0x886f=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x86f8[_0xbb9dbf];return _0x30223c;};'use strict';var jayson=require(_0x886f('0x0'));var BPromise=require('bluebird');var logger=require(_0x886f('0x1'))('routing');var client=jayson['client'][_0x886f('0x2')]({'port':0x2329});client[_0x886f('0x3')]=function(_0x37812c,_0x1e4506){return new BPromise(function(_0x2e8752,_0x1e9f6a){return client[_0x886f('0x4')](_0x37812c,_0x1e4506)[_0x886f('0x5')](function(_0x1588b2){logger[_0x886f('0x6')](_0x886f('0x7'),'routing',_0x37812c,_0x1e4506,_0x1588b2);if(_0x1588b2[_0x886f('0x8')]){logger[_0x886f('0x8')](_0x886f('0x7'),'routing',_0x37812c,_0x1588b2[_0x886f('0x8')]['message'],_0x1e4506);return _0x1e9f6a(_0x1588b2['error'][_0x886f('0x9')]);}else{return _0x2e8752(_0x1588b2[_0x886f('0xa')]);}})['catch'](function(_0x2cbbc7){logger[_0x886f('0x8')](_0x886f('0x7'),_0x886f('0xb'),_0x37812c,_0x2cbbc7,_0x1e4506);return _0x1e9f6a(_0x2cbbc7);});});};module[_0x886f('0xc')]=client; \ No newline at end of file +var _0xc65b=['result','jayson/promise','bluebird','../../config/logger','routing','client','http','request','rpc','error','message'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xc65b,0x16c));var _0xbc65=function(_0x1a15ed,_0x269dc4){_0x1a15ed=_0x1a15ed-0x0;var _0x386030=_0xc65b[_0x1a15ed];return _0x386030;};'use strict';var jayson=require(_0xbc65('0x0'));var BPromise=require(_0xbc65('0x1'));var logger=require(_0xbc65('0x2'))(_0xbc65('0x3'));var client=jayson[_0xbc65('0x4')][_0xbc65('0x5')]({'port':0x2329});client['Request']=function(_0x2297ca,_0x22e798){return new BPromise(function(_0x2fbe9b,_0x513964){return client[_0xbc65('0x6')](_0x2297ca,_0x22e798)['then'](function(_0x1eb4b2){logger['debug'](_0xbc65('0x7'),_0xbc65('0x3'),_0x2297ca,_0x22e798,_0x1eb4b2);if(_0x1eb4b2['error']){logger[_0xbc65('0x8')]('rpc','routing',_0x2297ca,_0x1eb4b2[_0xbc65('0x8')][_0xbc65('0x9')],_0x22e798);return _0x513964(_0x1eb4b2[_0xbc65('0x8')][_0xbc65('0x9')]);}else{return _0x2fbe9b(_0x1eb4b2[_0xbc65('0xa')]);}})['catch'](function(_0x2b7f2a){logger[_0xbc65('0x8')]('rpc',_0xbc65('0x3'),_0x2297ca,_0x2b7f2a,_0x22e798);return _0x513964(_0x2b7f2a);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 9213423..5e14e21 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 _0x97dd=['log','bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts','initMailAccounts','then','mailAccounts','listen','getSettings','catch'];(function(_0x2b7ba3,_0x3eb26a){var _0x2d189f=function(_0x29678e){while(--_0x29678e){_0x2b7ba3['push'](_0x2b7ba3['shift']());}};_0x2d189f(++_0x3eb26a);}(_0x97dd,0xef));var _0xd97d=function(_0xf9bc,_0x572260){_0xf9bc=_0xf9bc-0x0;var _0x3822c9=_0x97dd[_0xf9bc];return _0x3822c9;};'use strict';var BPromise=require(_0xd97d('0x0'));var server=require(_0xd97d('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xd97d('0x2'));var mailAccount=require(_0xd97d('0x3'));var setting=require(_0xd97d('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xd97d('0x5')]()['then'](mailAccount[_0xd97d('0x6')]())['then'](realtime[_0xd97d('0x7')]())[_0xd97d('0x8')](function(){email['refresh'](realtime[_0xd97d('0x9')]);return realtime;});}function main(){return server[_0xd97d('0xa')](realtime,email)[_0xd97d('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0xd97d('0xb')]();})[_0xd97d('0x8')](function(_0x385860){return setInterval(initRealtime,_0x385860['loginMailFrequency']*0x3e8);})[_0xd97d('0xc')](function(_0x3ce705){console[_0xd97d('0xd')](_0x3ce705);});}main(); \ No newline at end of file +var _0x98d4=['resolve','then','getMailAccounts','mailAccounts','getSettings','catch','log','./lib/email','./rpc/mailAccount'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x98d4,0x6a));var _0x498d=function(_0x22b4e1,_0x11959c){_0x22b4e1=_0x22b4e1-0x0;var _0x4f692f=_0x98d4[_0x22b4e1];return _0x4f692f;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x498d('0x0'));var mailAccount=require(_0x498d('0x1'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x498d('0x2')]()[_0x498d('0x3')](mailAccount[_0x498d('0x4')]())['then'](realtime['initMailAccounts']())[_0x498d('0x3')](function(){email['refresh'](realtime[_0x498d('0x5')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x498d('0x3')](function(){return initRealtime();})[_0x498d('0x3')](function(){return setting[_0x498d('0x6')]();})[_0x498d('0x3')](function(_0x3fd7c6){return setInterval(initRealtime,_0x3fd7c6['loginMailFrequency']*0x3e8);})[_0x498d('0x7')](function(_0x1e91f6){console[_0x498d('0x8')](_0x1e91f6);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3e62c38..766faee 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 _0xe197=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','Imap','messageStatus','isNil','stringify','emit','refresh','hasOwnProperty','active','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError','status','disabled','prototype','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe197,0x68));var _0x7e19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe197[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7e19('0x0'));var moment=require(_0x7e19('0x1'));var BPromise=require(_0x7e19('0x2'));var md5=require(_0x7e19('0x3'));var Redis=require(_0x7e19('0x4'));var config=require(_0x7e19('0x5'));var logger=require(_0x7e19('0x6'))(_0x7e19('0x7'));config[_0x7e19('0x8')]=_[_0x7e19('0x9')](config[_0x7e19('0x8')],{'host':_0x7e19('0xa'),'port':0x18eb});var io=require(_0x7e19('0xb'))(new Redis(config[_0x7e19('0x8')]));var EmailImap=require(_0x7e19('0xc'));var EmailSmtp=require(_0x7e19('0xd'));var mailAccount=require(_0x7e19('0xe'));var md5Accounts={};function EmailChannel(_0x5c1cf7){logger[_0x7e19('0xf')](_0x7e19('0x10'));this['mailAccounts']=_0x5c1cf7[_0x7e19('0x11')];this[_0x7e19('0x12')]={};this[_0x7e19('0x13')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x5513d6){var _0x1b4375=this[_0x7e19('0x11')][_0x5513d6];var _0x399b3c={'id':_0x1b4375['id'],'name':_0x1b4375[_0x7e19('0x14')],'key':_0x1b4375[_0x7e19('0x15')],'active':_0x1b4375['active'],'Imap':{'status':_0x1b4375[_0x7e19('0x16')]['status'],'messageStatus':_0x1b4375['Imap'][_0x7e19('0x17')],'total':_0x1b4375[_0x7e19('0x16')]['total']}};if(_[_0x7e19('0x18')](md5Accounts[_0x5513d6])){md5Accounts[_0x5513d6]={};}var _0x58aced=md5(JSON[_0x7e19('0x19')](_0x399b3c));if(md5Accounts[_0x5513d6][_0x7e19('0x3')]!==_0x58aced){md5Accounts[_0x5513d6][_0x7e19('0x3')]=_0x58aced;io[_0x7e19('0x1a')]('mailAccount:update',_0x399b3c);}};EmailChannel['prototype'][_0x7e19('0x1b')]=function(_0x3fd5f6){for(var _0x13b52e in _0x3fd5f6){if(_0x3fd5f6[_0x7e19('0x1c')](_0x13b52e)){if(_0x3fd5f6[_0x13b52e][_0x7e19('0x16')]&&_0x3fd5f6[_0x13b52e][_0x7e19('0x1d')]){var _0x4e20a2=_0x3fd5f6[_0x13b52e][_0x7e19('0x16')];if(!this['imapAccounts']['hasOwnProperty'](_0x4e20a2['id'])){this['imapAccounts'][_0x4e20a2['id']]=new EmailImap(_0x4e20a2,_0x3fd5f6[_0x13b52e][_0x7e19('0x7')]);this[_0x7e19('0x12')][_0x4e20a2['id']]['on'](_0x7e19('0x1e'),this[_0x7e19('0x1f')]['bind'](this,_0x13b52e));this[_0x7e19('0x12')][_0x4e20a2['id']]['on'](_0x7e19('0x7'),this[_0x7e19('0x20')][_0x7e19('0x21')](this,_0x13b52e));this[_0x7e19('0x12')][_0x4e20a2['id']]['on'](_0x7e19('0x22'),this[_0x7e19('0x23')][_0x7e19('0x21')](this,_0x13b52e));this[_0x7e19('0x12')][_0x4e20a2['id']]['on']('error',this[_0x7e19('0x24')]['bind'](this,_0x13b52e));}}else{if(_[_0x7e19('0x18')](this['mailAccounts'][_0x13b52e][_0x7e19('0x16')])){this[_0x7e19('0x11')][_0x13b52e][_0x7e19('0x16')]={};}this[_0x7e19('0x11')][_0x13b52e][_0x7e19('0x16')][_0x7e19('0x25')]=_0x7e19('0x26');this['mailAccounts'][_0x13b52e][_0x7e19('0x16')][_0x7e19('0x17')]='';this[_0x7e19('0x1a')](_0x13b52e);}}}};EmailChannel[_0x7e19('0x27')][_0x7e19('0x1f')]=function(_0x1a85c1,_0x4a6a92){if(this['mailAccounts'][_0x1a85c1]){this[_0x7e19('0x11')][_0x1a85c1]['Imap']['status']=_0x7e19('0x28');this[_0x7e19('0x11')][_0x1a85c1][_0x7e19('0x16')][_0x7e19('0x17')]=_0x4a6a92[_0x7e19('0x14')];if(_0x4a6a92[_0x7e19('0x29')]){this['mailAccounts'][_0x1a85c1][_0x7e19('0x16')][_0x7e19('0x2a')]=_0x4a6a92[_0x7e19('0x29')][_0x7e19('0x2a')];}return this['emit'](_0x1a85c1);}};EmailChannel[_0x7e19('0x27')][_0x7e19('0x20')]=function(_0x569ac6,_0x1799ea){logger['info'](_0x7e19('0x2b'),_0x1799ea[_0x7e19('0x2c')],_0x1799ea[_0x7e19('0x2d')],_0x1799ea[_0x7e19('0x2e')],_0x569ac6);if(this[_0x7e19('0x11')][_0x569ac6]){return mailAccount[_0x7e19('0x2f')](_0x569ac6,_0x1799ea)['then'](function(_0xea5efc){if(_0xea5efc){logger[_0x7e19('0xf')](_0x7e19('0x30'));}})[_0x7e19('0x31')](function(_0x1dc748){logger['error'](_0x7e19('0x32'),JSON[_0x7e19('0x19')](_0x1dc748));});}};EmailChannel['prototype'][_0x7e19('0x23')]=function(_0x314f85){if(this[_0x7e19('0x11')][_0x314f85]&&this[_0x7e19('0x11')][_0x314f85]['Imap']){if(this[_0x7e19('0x12')][this['mailAccounts'][_0x314f85][_0x7e19('0x16')]['id']]){delete this[_0x7e19('0x12')][this[_0x7e19('0x11')][_0x314f85][_0x7e19('0x16')]['id']];}this[_0x7e19('0x11')][_0x314f85]['Imap'][_0x7e19('0x33')]=moment();this['emit'](_0x314f85);}};EmailChannel['prototype'][_0x7e19('0x24')]=function(_0x59a520,_0x19f4db){if(this['mailAccounts'][_0x59a520]){this[_0x7e19('0x11')][_0x59a520][_0x7e19('0x16')][_0x7e19('0x25')]=_0x7e19('0x34');this[_0x7e19('0x11')][_0x59a520][_0x7e19('0x16')]['messageStatus']=_0x19f4db;return this['emit'](_0x59a520);}};EmailChannel[_0x7e19('0x27')][_0x7e19('0x35')]=function(_0x523a10,_0x14052c){return this[_0x7e19('0x13')]['send'](_0x523a10,_0x14052c);};EmailChannel[_0x7e19('0x27')][_0x7e19('0x36')]=function(_0x5aad56){var _0x3020ad=this;if(this[_0x7e19('0x11')][_0x5aad56['id']]){if(_[_0x7e19('0x18')](this[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')])){this['mailAccounts'][_0x5aad56['id']][_0x7e19('0x37')]={};}this[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')][_0x7e19('0x33')]=moment();return new BPromise(function(_0x596fbf,_0x3cc545){return _0x3020ad[_0x7e19('0x13')][_0x7e19('0x38')](_0x5aad56)['then'](function(_0x4b4e69){_0x3020ad[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')][_0x7e19('0x25')]=_0x7e19('0x39');_0x3020ad[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')][_0x7e19('0x17')]='';_0x3020ad[_0x7e19('0x1a')](_0x5aad56['id']);_0x596fbf(_0x4b4e69);})[_0x7e19('0x31')](function(_0x16036e){_0x3020ad[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')][_0x7e19('0x25')]=_0x7e19('0x34');_0x3020ad[_0x7e19('0x11')][_0x5aad56['id']][_0x7e19('0x37')]['messageStatus']=_0x16036e;_0x3020ad[_0x7e19('0x1a')](_0x5aad56['id']);_0x3cc545(_0x16036e);});});}return this[_0x7e19('0x13')][_0x7e19('0x38')](_0x5aad56);};module[_0x7e19('0x3a')]=EmailChannel; \ No newline at end of file +var _0x552e=['hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','handleImapBox','connected','messageStatus','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','lastSync','verify','Smtp','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','total','stringify','md5','prototype','refresh'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x552e,0x16b));var _0xe552=function(_0x30f744,_0x4d6b6f){_0x30f744=_0x30f744-0x0;var _0x20dc53=_0x552e[_0x30f744];return _0x20dc53;};'use strict';var _=require(_0xe552('0x0'));var moment=require(_0xe552('0x1'));var BPromise=require(_0xe552('0x2'));var md5=require('md5');var Redis=require(_0xe552('0x3'));var config=require(_0xe552('0x4'));var logger=require(_0xe552('0x5'))(_0xe552('0x6'));config[_0xe552('0x7')]=_[_0xe552('0x8')](config[_0xe552('0x7')],{'host':_0xe552('0x9'),'port':0x18eb});var io=require(_0xe552('0xa'))(new Redis(config[_0xe552('0x7')]));var EmailImap=require(_0xe552('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xe552('0xc'));var md5Accounts={};function EmailChannel(_0x52df8d){logger[_0xe552('0xd')](_0xe552('0xe'));this['mailAccounts']=_0x52df8d[_0xe552('0xf')];this[_0xe552('0x10')]={};this[_0xe552('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xe552('0x12')]=function(_0x4ca8ea){var _0x50fc0b=this[_0xe552('0xf')][_0x4ca8ea];var _0x3e63b2={'id':_0x50fc0b['id'],'name':_0x50fc0b[_0xe552('0x13')],'key':_0x50fc0b[_0xe552('0x14')],'active':_0x50fc0b[_0xe552('0x15')],'Imap':{'status':_0x50fc0b[_0xe552('0x16')][_0xe552('0x17')],'messageStatus':_0x50fc0b['Imap']['messageStatus'],'total':_0x50fc0b['Imap'][_0xe552('0x18')]}};if(_['isNil'](md5Accounts[_0x4ca8ea])){md5Accounts[_0x4ca8ea]={};}var _0x5a7dcf=md5(JSON[_0xe552('0x19')](_0x3e63b2));if(md5Accounts[_0x4ca8ea][_0xe552('0x1a')]!==_0x5a7dcf){md5Accounts[_0x4ca8ea]['md5']=_0x5a7dcf;io[_0xe552('0x12')]('mailAccount:update',_0x3e63b2);}};EmailChannel[_0xe552('0x1b')][_0xe552('0x1c')]=function(_0x2564fc){for(var _0x3d92cc in _0x2564fc){if(_0x2564fc[_0xe552('0x1d')](_0x3d92cc)){if(_0x2564fc[_0x3d92cc][_0xe552('0x16')]&&_0x2564fc[_0x3d92cc][_0xe552('0x15')]){var _0x1033a8=_0x2564fc[_0x3d92cc][_0xe552('0x16')];if(!this[_0xe552('0x10')]['hasOwnProperty'](_0x1033a8['id'])){this[_0xe552('0x10')][_0x1033a8['id']]=new EmailImap(_0x1033a8,_0x2564fc[_0x3d92cc][_0xe552('0x6')]);this[_0xe552('0x10')][_0x1033a8['id']]['on'](_0xe552('0x1e'),this['handleImapBox'][_0xe552('0x1f')](this,_0x3d92cc));this['imapAccounts'][_0x1033a8['id']]['on'](_0xe552('0x6'),this[_0xe552('0x20')][_0xe552('0x1f')](this,_0x3d92cc));this[_0xe552('0x10')][_0x1033a8['id']]['on'](_0xe552('0x21'),this[_0xe552('0x22')]['bind'](this,_0x3d92cc));this[_0xe552('0x10')][_0x1033a8['id']]['on'](_0xe552('0x23'),this[_0xe552('0x24')][_0xe552('0x1f')](this,_0x3d92cc));}}else{if(_[_0xe552('0x25')](this[_0xe552('0xf')][_0x3d92cc][_0xe552('0x16')])){this[_0xe552('0xf')][_0x3d92cc]['Imap']={};}this[_0xe552('0xf')][_0x3d92cc]['Imap'][_0xe552('0x17')]=_0xe552('0x26');this[_0xe552('0xf')][_0x3d92cc]['Imap']['messageStatus']='';this['emit'](_0x3d92cc);}}}};EmailChannel['prototype'][_0xe552('0x27')]=function(_0x2b97c9,_0x4b29ad){if(this[_0xe552('0xf')][_0x2b97c9]){this[_0xe552('0xf')][_0x2b97c9][_0xe552('0x16')]['status']=_0xe552('0x28');this[_0xe552('0xf')][_0x2b97c9][_0xe552('0x16')][_0xe552('0x29')]=_0x4b29ad['name'];if(_0x4b29ad['messages']){this[_0xe552('0xf')][_0x2b97c9][_0xe552('0x16')][_0xe552('0x18')]=_0x4b29ad['messages']['total'];}return this[_0xe552('0x12')](_0x2b97c9);}};EmailChannel['prototype'][_0xe552('0x20')]=function(_0x2becf9,_0x3bd06b){logger[_0xe552('0xd')](_0xe552('0x2a'),_0x3bd06b[_0xe552('0x2b')],_0x3bd06b[_0xe552('0x2c')],_0x3bd06b[_0xe552('0x2d')],_0x2becf9);if(this[_0xe552('0xf')][_0x2becf9]){return mailAccount['notify'](_0x2becf9,_0x3bd06b)[_0xe552('0x2e')](function(_0x3dc3f8){if(_0x3dc3f8){logger[_0xe552('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0xe552('0x2f')](function(_0x17ca9e){logger[_0xe552('0x23')](_0xe552('0x30'),JSON[_0xe552('0x19')](_0x17ca9e));});}};EmailChannel[_0xe552('0x1b')][_0xe552('0x22')]=function(_0x27b8cf){if(this[_0xe552('0xf')][_0x27b8cf]&&this[_0xe552('0xf')][_0x27b8cf][_0xe552('0x16')]){if(this[_0xe552('0x10')][this[_0xe552('0xf')][_0x27b8cf][_0xe552('0x16')]['id']]){delete this[_0xe552('0x10')][this[_0xe552('0xf')][_0x27b8cf][_0xe552('0x16')]['id']];}this[_0xe552('0xf')][_0x27b8cf]['Imap']['lastSync']=moment();this[_0xe552('0x12')](_0x27b8cf);}};EmailChannel[_0xe552('0x1b')][_0xe552('0x24')]=function(_0x53ae0c,_0x5e1c0){if(this[_0xe552('0xf')][_0x53ae0c]){this[_0xe552('0xf')][_0x53ae0c]['Imap'][_0xe552('0x17')]=_0xe552('0x23');this[_0xe552('0xf')][_0x53ae0c]['Imap'][_0xe552('0x29')]=_0x5e1c0;return this[_0xe552('0x12')](_0x53ae0c);}};EmailChannel[_0xe552('0x1b')]['sendMail']=function(_0x585652,_0x428a9b){return this[_0xe552('0x11')][_0xe552('0x31')](_0x585652,_0x428a9b);};EmailChannel['prototype'][_0xe552('0x32')]=function(_0x2fd005){var _0x3542f0=this;if(this['mailAccounts'][_0x2fd005['id']]){if(_[_0xe552('0x25')](this[_0xe552('0xf')][_0x2fd005['id']]['Smtp'])){this[_0xe552('0xf')][_0x2fd005['id']]['Smtp']={};}this[_0xe552('0xf')][_0x2fd005['id']]['Smtp'][_0xe552('0x33')]=moment();return new BPromise(function(_0x33487a,_0x6cf883){return _0x3542f0[_0xe552('0x11')][_0xe552('0x34')](_0x2fd005)[_0xe552('0x2e')](function(_0x5e97c3){_0x3542f0['mailAccounts'][_0x2fd005['id']][_0xe552('0x35')][_0xe552('0x17')]=_0xe552('0x36');_0x3542f0[_0xe552('0xf')][_0x2fd005['id']][_0xe552('0x35')]['messageStatus']='';_0x3542f0[_0xe552('0x12')](_0x2fd005['id']);_0x33487a(_0x5e97c3);})[_0xe552('0x2f')](function(_0x23464d){_0x3542f0[_0xe552('0xf')][_0x2fd005['id']][_0xe552('0x35')][_0xe552('0x17')]=_0xe552('0x23');_0x3542f0['mailAccounts'][_0x2fd005['id']]['Smtp'][_0xe552('0x29')]=_0x23464d;_0x3542f0[_0xe552('0x12')](_0x2fd005['id']);_0x6cf883(_0x23464d);});});}return this['smtp'][_0xe552('0x34')](_0x2fd005);};module[_0xe552('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index fad75ee..c00a44e 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 _0x20cb=['lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','once','end','handleEnd','bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','authentication','user','host','port','tls','autotls','required','password','getHost','email','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','util','imap'];(function(_0x13950d,_0xe828fe){var _0x37013b=function(_0x17d355){while(--_0x17d355){_0x13950d['push'](_0x13950d['shift']());}};_0x37013b(++_0xe828fe);}(_0x20cb,0x12a));var _0xb20c=function(_0x1f0345,_0x554d63){_0x1f0345=_0x1f0345-0x0;var _0x232157=_0x20cb[_0x1f0345];return _0x232157;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xb20c('0x0'));var Imap=require(_0xb20c('0x1'));var _=require(_0xb20c('0x2'));var rs=require(_0xb20c('0x3'));var simpleParser=require('mailparser')[_0xb20c('0x4')];var Iconv=require(_0xb20c('0x5'))[_0xb20c('0x6')];var EventEmitter=require(_0xb20c('0x7'))[_0xb20c('0x8')];var utils=require(_0xb20c('0x9'));var logger=require(_0xb20c('0xa'))('email');function EmailImap(_0x5bfbe7,_0x188769){this[_0xb20c('0xb')]=_0xb20c('0xc');this[_0xb20c('0xd')]=this[_0xb20c('0xe')](_0x5bfbe7,_0x188769);this[_0xb20c('0x1')]=new Imap(this[_0xb20c('0xd')]);this['imap']['once']('ready',this['handleReady']['bind'](this));this[_0xb20c('0x1')][_0xb20c('0xf')](_0xb20c('0x10'),this[_0xb20c('0x11')][_0xb20c('0x12')](this));this[_0xb20c('0x1')]['on'](_0xb20c('0x13'),this[_0xb20c('0x14')]['bind'](this));this[_0xb20c('0x1')][_0xb20c('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xb20c('0x16')][_0xb20c('0xe')]=function(_0x1b42c2,_0x2f4314){var _0x378962={'connTimeout':_0x1b42c2[_0xb20c('0x17')]?_0x1b42c2['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1b42c2[_0xb20c('0x18')]?_0x1b42c2[_0xb20c('0x18')]*0x3e8:0x1388};if(_[_0xb20c('0x19')](_0x1b42c2['service'])){if(_0x1b42c2[_0xb20c('0x1a')]){_0x378962[_0xb20c('0x1b')]=_0x1b42c2[_0xb20c('0x1b')];_0x378962['password']=_0x1b42c2['password'];}_0x378962[_0xb20c('0x1c')]=_0x1b42c2[_0xb20c('0x1c')];_0x378962[_0xb20c('0x1d')]=_0x1b42c2[_0xb20c('0x1d')]||0x3e1;if(_0x1b42c2[_0xb20c('0x1e')]){_0x378962[_0xb20c('0x1e')]=!![];}else{_0x378962[_0xb20c('0x1e')]=![];_0x378962[_0xb20c('0x1f')]=_0xb20c('0x20');}}else{_0x378962[_0xb20c('0x1b')]=_0x1b42c2[_0xb20c('0x1b')];_0x378962[_0xb20c('0x21')]=_0x1b42c2[_0xb20c('0x21')];_0x378962[_0xb20c('0x1c')]=utils[_0xb20c('0x22')](_0x1b42c2['service']);_0x378962[_0xb20c('0x1d')]=0x3e1;_0x378962[_0xb20c('0x1e')]=!![];}_0x378962[_0xb20c('0x23')]=_0x2f4314||_0x1b42c2[_0xb20c('0x1b')]||_0xb20c('0x24');return _0x378962;};EmailImap[_0xb20c('0x16')]['handleReady']=function(){this[_0xb20c('0x1')][_0xb20c('0x25')](this['mailbox'],![],this[_0xb20c('0x26')]['bind'](this));};EmailImap[_0xb20c('0x16')][_0xb20c('0x26')]=function(_0x8a6529,_0x1ddf3a){if(_0x8a6529){this[_0xb20c('0x14')](_0x8a6529,!![]);}else{this[_0xb20c('0x27')](_0xb20c('0x28'),_0x1ddf3a);this[_0xb20c('0x29')]();}};EmailImap[_0xb20c('0x16')][_0xb20c('0x2a')]=function(_0x12608d){if(_0x12608d){this['handleError'](_0x12608d,!![]);}else{this[_0xb20c('0x1')]['end']();}};EmailImap[_0xb20c('0x16')]['readUnseen']=function(){this[_0xb20c('0x1')][_0xb20c('0x2b')]([_0xb20c('0x2c')],this[_0xb20c('0x2d')][_0xb20c('0x12')](this));};EmailImap['prototype'][_0xb20c('0x2d')]=function(_0x3402f6,_0x2038c2){if(_0x3402f6){this[_0xb20c('0x14')](_0x3402f6,!![]);}else{if(_0x2038c2[_0xb20c('0x2e')]){try{var _0x1c592c=this[_0xb20c('0x1')]['fetch'](_0x2038c2,{'bodies':'','markSeen':!![]});_0x1c592c['on'](_0xb20c('0x2f'),this[_0xb20c('0x30')][_0xb20c('0x12')](this));_0x1c592c[_0xb20c('0xf')]('error',this['handleFetchError'][_0xb20c('0x12')](this));_0x1c592c['once']('end',this[_0xb20c('0x31')]['bind'](this));}catch(_0x13d2b2){logger[_0xb20c('0x13')](_0x13d2b2);}}else{this[_0xb20c('0x1')]['closeBox'](!![],this[_0xb20c('0x2a')][_0xb20c('0x12')](this));}}};EmailImap[_0xb20c('0x16')][_0xb20c('0x30')]=function(_0x4f34e3,_0x5c7533){_0x4f34e3['on'](_0xb20c('0x32'),this[_0xb20c('0x33')][_0xb20c('0x12')](this));_0x4f34e3['once'](_0xb20c('0x34'),this[_0xb20c('0x35')][_0xb20c('0x12')](this));_0x4f34e3[_0xb20c('0xf')](_0xb20c('0x10'),this[_0xb20c('0x36')][_0xb20c('0x12')](this));};EmailImap[_0xb20c('0x16')]['handleMessageBody']=function(_0x553d6e,_0x4cf42b){simpleParser(_0x553d6e,{'Iconv':Iconv},this['handleSimpleParser'][_0xb20c('0x12')](this));};EmailImap[_0xb20c('0x16')][_0xb20c('0x35')]=function(_0x300570){};EmailImap[_0xb20c('0x16')][_0xb20c('0x36')]=function(){};EmailImap[_0xb20c('0x16')][_0xb20c('0x37')]=function(_0x5a63f6,_0x379097){if(_0x5a63f6){logger[_0xb20c('0x13')](_0x5a63f6);}else{var _0x9fbafd=this;utils[_0xb20c('0x38')](this[_0xb20c('0xd')],_0x379097,function(_0x48f487){_0x9fbafd[_0xb20c('0x27')]('email',_0x48f487);});}};EmailImap['prototype'][_0xb20c('0x31')]=function(){this[_0xb20c('0x1')][_0xb20c('0x39')](!![],this[_0xb20c('0x2a')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x5ac43a){this['handleError'](_0x5ac43a);this[_0xb20c('0x1')][_0xb20c('0x39')](!![],this['handleCloseBox'][_0xb20c('0x12')](this));};EmailImap[_0xb20c('0x16')]['handleEnd']=function(){this[_0xb20c('0x27')](_0xb20c('0x10'));};EmailImap['prototype'][_0xb20c('0x14')]=function(_0x1b2448,_0x155ae2){logger[_0xb20c('0x13')](_0xb20c('0x14'),this['account'][_0xb20c('0x23')],JSON[_0xb20c('0x3a')](_0x1b2448));var _0x516dc9='';if(_0x1b2448){if(_0x1b2448['textCode']){_0x516dc9=_0x1b2448[_0xb20c('0x3b')];}else{for(var _0x1685cf in _0x1b2448){if(_0x1b2448['hasOwnProperty'](_0x1685cf)){_0x516dc9+=_['upperFirst'](_0x1685cf)+':\x20'+_0x1b2448[_0x1685cf]+'\x0a';}}}}if(_0x155ae2){this[_0xb20c('0x1')][_0xb20c('0x10')]();}else{this['emit'](_0xb20c('0x13'),_0x516dc9);this['emit'](_0xb20c('0x10'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xad99=['isNil','service','authentication','user','password','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','error','parser','textCode','hasOwnProperty','exports','path','util','imap','randomstring','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','ready','handleReady','bind','once','end','handleEnd','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout'];(function(_0x105c75,_0x513044){var _0x5c7a82=function(_0x3d89b8){while(--_0x3d89b8){_0x105c75['push'](_0x105c75['shift']());}};_0x5c7a82(++_0x513044);}(_0xad99,0x64));var _0x9ad9=function(_0x203eec,_0x563e0f){_0x203eec=_0x203eec-0x0;var _0x4fa0e6=_0xad99[_0x203eec];return _0x4fa0e6;};'use strict';var fs=require('fs');var path=require(_0x9ad9('0x0'));var util=require(_0x9ad9('0x1'));var Imap=require(_0x9ad9('0x2'));var _=require('lodash');var rs=require(_0x9ad9('0x3'));var simpleParser=require(_0x9ad9('0x4'))[_0x9ad9('0x5')];var Iconv=require('iconv')[_0x9ad9('0x6')];var EventEmitter=require(_0x9ad9('0x7'))[_0x9ad9('0x8')];var utils=require(_0x9ad9('0x9'));var logger=require(_0x9ad9('0xa'))(_0x9ad9('0xb'));function EmailImap(_0x3dd3e7,_0x2b42b){this[_0x9ad9('0xc')]=_0x9ad9('0xd');this[_0x9ad9('0xe')]=this['getAccount'](_0x3dd3e7,_0x2b42b);this[_0x9ad9('0x2')]=new Imap(this[_0x9ad9('0xe')]);this[_0x9ad9('0x2')]['once'](_0x9ad9('0xf'),this[_0x9ad9('0x10')][_0x9ad9('0x11')](this));this['imap'][_0x9ad9('0x12')](_0x9ad9('0x13'),this[_0x9ad9('0x14')][_0x9ad9('0x11')](this));this['imap']['on']('error',this[_0x9ad9('0x15')][_0x9ad9('0x11')](this));this[_0x9ad9('0x2')][_0x9ad9('0x16')]();}util[_0x9ad9('0x17')](EmailImap,EventEmitter);EmailImap[_0x9ad9('0x18')][_0x9ad9('0x19')]=function(_0x458bd1,_0x28fa5c){var _0x40f117={'connTimeout':_0x458bd1[_0x9ad9('0x1a')]?_0x458bd1[_0x9ad9('0x1a')]*0x3e8:0x2710,'authTimeout':_0x458bd1[_0x9ad9('0x1b')]?_0x458bd1[_0x9ad9('0x1b')]*0x3e8:0x1388};if(_[_0x9ad9('0x1c')](_0x458bd1[_0x9ad9('0x1d')])){if(_0x458bd1[_0x9ad9('0x1e')]){_0x40f117[_0x9ad9('0x1f')]=_0x458bd1[_0x9ad9('0x1f')];_0x40f117[_0x9ad9('0x20')]=_0x458bd1[_0x9ad9('0x20')];}_0x40f117['host']=_0x458bd1['host'];_0x40f117['port']=_0x458bd1[_0x9ad9('0x21')]||0x3e1;if(_0x458bd1['tls']){_0x40f117[_0x9ad9('0x22')]=!![];}else{_0x40f117[_0x9ad9('0x22')]=![];_0x40f117[_0x9ad9('0x23')]=_0x9ad9('0x24');}}else{_0x40f117['user']=_0x458bd1[_0x9ad9('0x1f')];_0x40f117[_0x9ad9('0x20')]=_0x458bd1[_0x9ad9('0x20')];_0x40f117['host']=utils[_0x9ad9('0x25')](_0x458bd1[_0x9ad9('0x1d')]);_0x40f117['port']=0x3e1;_0x40f117[_0x9ad9('0x22')]=!![];}_0x40f117[_0x9ad9('0xb')]=_0x28fa5c||_0x458bd1[_0x9ad9('0x1f')]||_0x9ad9('0x26');return _0x40f117;};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x10')]=function(){this[_0x9ad9('0x2')][_0x9ad9('0x27')](this['mailbox'],![],this[_0x9ad9('0x28')][_0x9ad9('0x11')](this));};EmailImap[_0x9ad9('0x18')]['handleOpenBox']=function(_0x209c73,_0x3526bd){if(_0x209c73){this[_0x9ad9('0x15')](_0x209c73,!![]);}else{this[_0x9ad9('0x29')](_0x9ad9('0x2a'),_0x3526bd);this['readUnseen']();}};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x2b')]=function(_0x88560c){if(_0x88560c){this['handleError'](_0x88560c,!![]);}else{this[_0x9ad9('0x2')][_0x9ad9('0x13')]();}};EmailImap['prototype'][_0x9ad9('0x2c')]=function(){this[_0x9ad9('0x2')][_0x9ad9('0x2d')]([_0x9ad9('0x2e')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x2f')]=function(_0x571748,_0x20a856){if(_0x571748){this[_0x9ad9('0x15')](_0x571748,!![]);}else{if(_0x20a856[_0x9ad9('0x30')]){try{var _0x483a7a=this['imap'][_0x9ad9('0x31')](_0x20a856,{'bodies':'','markSeen':!![]});_0x483a7a['on'](_0x9ad9('0x32'),this[_0x9ad9('0x33')][_0x9ad9('0x11')](this));_0x483a7a[_0x9ad9('0x12')]('error',this[_0x9ad9('0x34')][_0x9ad9('0x11')](this));_0x483a7a['once']('end',this['handleFetchEnd']['bind'](this));}catch(_0x1724ba){logger['error'](_0x1724ba);}}else{this[_0x9ad9('0x2')][_0x9ad9('0x35')](!![],this['handleCloseBox'][_0x9ad9('0x11')](this));}}};EmailImap[_0x9ad9('0x18')]['handleFetchMessage']=function(_0x59b2dc,_0x3c2fbe){_0x59b2dc['on'](_0x9ad9('0x36'),this['handleMessageBody'][_0x9ad9('0x11')](this));_0x59b2dc[_0x9ad9('0x12')](_0x9ad9('0x37'),this['handleMessageAttributes'][_0x9ad9('0x11')](this));_0x59b2dc[_0x9ad9('0x12')](_0x9ad9('0x13'),this[_0x9ad9('0x38')]['bind'](this));};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x39')]=function(_0x492585,_0x2e1797){simpleParser(_0x492585,{'Iconv':Iconv},this[_0x9ad9('0x3a')][_0x9ad9('0x11')](this));};EmailImap[_0x9ad9('0x18')]['handleMessageAttributes']=function(_0x231633){};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x38')]=function(){};EmailImap['prototype'][_0x9ad9('0x3a')]=function(_0x2cb7d9,_0x3950bb){if(_0x2cb7d9){logger[_0x9ad9('0x3b')](_0x2cb7d9);}else{var _0x26db07=this;utils[_0x9ad9('0x3c')](this[_0x9ad9('0xe')],_0x3950bb,function(_0x2b6b62){_0x26db07[_0x9ad9('0x29')](_0x9ad9('0xb'),_0x2b6b62);});}};EmailImap[_0x9ad9('0x18')]['handleFetchEnd']=function(){this['imap'][_0x9ad9('0x35')](!![],this[_0x9ad9('0x2b')][_0x9ad9('0x11')](this));};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x34')]=function(_0x51f6fa){this['handleError'](_0x51f6fa);this[_0x9ad9('0x2')]['closeBox'](!![],this[_0x9ad9('0x2b')][_0x9ad9('0x11')](this));};EmailImap[_0x9ad9('0x18')][_0x9ad9('0x14')]=function(){this[_0x9ad9('0x29')](_0x9ad9('0x13'));};EmailImap['prototype'][_0x9ad9('0x15')]=function(_0x1bb8d2,_0xa07b31){logger['error']('handleError',this[_0x9ad9('0xe')][_0x9ad9('0xb')],JSON['stringify'](_0x1bb8d2));var _0x4a47cb='';if(_0x1bb8d2){if(_0x1bb8d2[_0x9ad9('0x3d')]){_0x4a47cb=_0x1bb8d2[_0x9ad9('0x3d')];}else{for(var _0x59438b in _0x1bb8d2){if(_0x1bb8d2[_0x9ad9('0x3e')](_0x59438b)){_0x4a47cb+=_['upperFirst'](_0x59438b)+':\x20'+_0x1bb8d2[_0x59438b]+'\x0a';}}}}if(_0xa07b31){this[_0x9ad9('0x2')][_0x9ad9('0x13')]();}else{this[_0x9ad9('0x29')]('error',_0x4a47cb);this[_0x9ad9('0x29')](_0x9ad9('0x13'));}};module[_0x9ad9('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index ecd8789..2260c82 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 _0x3492=['toString','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x12aaff,_0x371ff6){var _0x2395f4=function(_0x3b7cfd){while(--_0x3b7cfd){_0x12aaff['push'](_0x12aaff['shift']());}};_0x2395f4(++_0x371ff6);}(_0x3492,0x123));var _0x2349=function(_0x2d23ec,_0x3a76c9){_0x2d23ec=_0x2d23ec-0x0;var _0x45f263=_0x3492[_0x2d23ec];return _0x45f263;};'use strict';var nodemailer=require(_0x2349('0x0'));var BPromise=require(_0x2349('0x1'));var inlineBase64=require(_0x2349('0x2'));function EmailSmtp(){}EmailSmtp[_0x2349('0x3')][_0x2349('0x4')]=function(_0x15c0cf,_0x48b97d){return new BPromise(function(_0x1ed0a6,_0x59b77e){var _0x5a141f=nodemailer[_0x2349('0x5')](_0x15c0cf);_0x5a141f[_0x2349('0x6')](_0x2349('0x7'),inlineBase64());_0x5a141f[_0x2349('0x8')](_0x48b97d,function(_0x3a9579,_0x3fbf39){if(_0x3a9579){_0x59b77e(_0x3a9579[_0x2349('0x9')]());}else{_0x1ed0a6(_0x3fbf39);}});});};EmailSmtp['prototype'][_0x2349('0xa')]=function(_0x40314d){return new BPromise(function(_0xfb0627,_0x581773){var _0x262fce=nodemailer['createTransport'](_0x40314d);_0x262fce['verify'](function(_0x4c512e,_0x237466){if(_0x4c512e){_0x581773(_0x4c512e[_0x2349('0x9')]());}else{if(_0x237466){_0xfb0627(_0x237466);}else{_0x581773(_0x2349('0xb'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xf0bb=['use','compile','sendMail','verify','toString','bluebird','prototype','send','createTransport'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xf0bb,0xcb));var _0xbf0b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf0bb[_0x4b369d];return _0x571a98;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xbf0b('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xbf0b('0x1')][_0xbf0b('0x2')]=function(_0x284d2d,_0x229241){return new BPromise(function(_0x390820,_0x3b6fee){var _0x2acf15=nodemailer[_0xbf0b('0x3')](_0x284d2d);_0x2acf15[_0xbf0b('0x4')](_0xbf0b('0x5'),inlineBase64());_0x2acf15[_0xbf0b('0x6')](_0x229241,function(_0x2033f6,_0x221815){if(_0x2033f6){_0x3b6fee(_0x2033f6['toString']());}else{_0x390820(_0x221815);}});});};EmailSmtp['prototype'][_0xbf0b('0x7')]=function(_0x22b0f7){return new BPromise(function(_0x5a233f,_0x5afdb2){var _0x1f0296=nodemailer['createTransport'](_0x22b0f7);_0x1f0296[_0xbf0b('0x7')](function(_0x3ceac3,_0x436b44){if(_0x3ceac3){_0x5afdb2(_0x3ceac3[_0xbf0b('0x8')]());}else{if(_0x436b44){_0x5a233f(_0x436b44);}else{_0x5afdb2('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 0a2ff70..31e6386 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 _0x2cf5=['\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','path','node-tnef','../../../config/logger','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','isEmpty','html','test','replace','includes','0x1?_0x54806d[_0x52cf('0x10')](0x0,-0x1)[_0x52cf('0x11')]('\x20'):_0x17e1b0[_0x52cf('0xb')];}return'Anonymous';}function getLastName(_0x4a5547){var _0x2bff22=_[_0x52cf('0x5')](_0x4a5547[_0x52cf('0x6')]);if(_0x2bff22&&_0x2bff22[_0x52cf('0xb')]){var _0x294b83=_0x2bff22[_0x52cf('0xb')][_0x52cf('0xe')](/\s+/);return _0x294b83[_0x52cf('0xf')]>0x1?_0x294b83['pop']():'';}return'';}function getMails(_0x3c6283,_0x3a2492){var _0x31099e='';for(var _0x580154=0x0;_0x580154<_0x3a2492[_0x52cf('0x6')]['length'];_0x580154+=0x1){if(_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]!==_0x3c6283){if(!_[_0x52cf('0x12')](_0x31099e)){_0x31099e+=',';}_0x31099e+=_0x3a2492[_0x52cf('0x6')][_0x580154]['name']||_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]||'';_0x31099e+='\x20<';_0x31099e+=_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]?_0x3a2492['value'][_0x580154][_0x52cf('0x7')]:'anonymous'+random[_0x52cf('0x9')](0x6)+_0x52cf('0xa');_0x31099e+='>';}}return _0x31099e;}function parseEmail(_0x2d3edf,_0x556e07,_0x538a28){if(_0x556e07[_0x52cf('0x13')]){var _0x32abd7=/)<[^<]*)*<\/script>/gi;while(_0x32abd7[_0x52cf('0x14')](_0x556e07[_0x52cf('0x13')])){_0x556e07[_0x52cf('0x13')]=_0x556e07[_0x52cf('0x13')][_0x52cf('0x15')](_0x32abd7,'');}if(_0x556e07[_0x52cf('0x13')][_0x52cf('0x16')](_0x52cf('0x17'))){var _0x57e910=[];_0x556e07['attachments'][_0x52cf('0x18')](_0x122817=>{_0x57e910[_0x52cf('0x19')](_0x122817[_0x52cf('0x1a')]);});var _0x499ac7=/]+>/g;var _0x47a610=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x40eec3=_0x556e07[_0x52cf('0x13')][_0x52cf('0x15')](_0x47a610,_0x52cf('0x1b'));var _0x42132c=_0x40eec3[_0x52cf('0x15')](_0x499ac7,_0x52cf('0x1c'));for(let _0x1f6b75=0x0;_0x1f6b75<_0x57e910[_0x52cf('0xf')];_0x1f6b75++){var _0x4cc1d4=_0x42132c['replace'](_0x52cf('0x1c'),_0x52cf('0x1d')+_0x57e910[_0x1f6b75]+_0x52cf('0x1e'));_0x42132c=_0x4cc1d4;}_0x556e07[_0x52cf('0x13')]=_0x42132c;}_0x538a28['body']=_0x556e07[_0x52cf('0x13')];}else{_0x538a28[_0x52cf('0x1f')]=_0x556e07[_0x52cf('0x20')];}if(_0x538a28[_0x52cf('0x1f')]){_0x538a28[_0x52cf('0x1f')]=_0x538a28[_0x52cf('0x1f')]['replace'](/0x0){var _0x20ca56=[_0x52cf('0x32'),_0x52cf('0x33'),_0x52cf('0x34')];for(var _0x4375ae=0x0;_0x4375ae<_0x556e07[_0x52cf('0x31')][_0x52cf('0xf')];_0x4375ae++){var _0x55f081=_[_0x52cf('0xd')](_0x20ca56,_0x556e07['headerLines'][_0x4375ae][_0x52cf('0x35')]);if(_0x55f081>=0x0){_0x538a28['isAutoreply']=!![];}}}return _0x538a28;}exports[_0x52cf('0x36')]=function(_0x160d32,_0x4e2f99,_0x25e084){var _0x4a49f0={'from':getAddress(_0x4e2f99[_0x52cf('0x37')]),'firstName':getFirstName(_0x4e2f99[_0x52cf('0x37')]),'lastName':getLastName(_0x4e2f99[_0x52cf('0x37')]),'mapKey':'email','message':{'from':getMails(_0x160d32[_0x52cf('0x25')],_0x4e2f99['from']),'to':_0x160d32['email'],'cc':'','subject':_0x4e2f99['subject']||'','messageId':_0x4e2f99['messageId'],'inReplyTo':_0x4e2f99['inReplyTo'],'sentAt':moment(_0x4e2f99[_0x52cf('0x38')])[_0x52cf('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4e2f99[_0x52cf('0x13')]&&!_0x4e2f99[_0x52cf('0x20')]){var _0x39b56a=_[_0x52cf('0x3a')](_0x4e2f99[_0x52cf('0x27')],{'contentType':'application/ms-tnef'});if(_0x39b56a[_0x52cf('0xf')]){logger[_0x52cf('0x3b')](util[_0x52cf('0x39')](_0x52cf('0x3c'),_0x4e2f99[_0x52cf('0x3d')]));tnef['parseBuffer'](_[_0x52cf('0x3e')](_0x39b56a)[_0x52cf('0x2f')],function(_0x51ca3e,_0x44c324){if(_0x44c324){_0x4e2f99['html']=_0x44c324[_0x52cf('0x3f')]||_0x52cf('0x40');if(_0x44c324[_0x52cf('0x41')]){for(var _0x476085=0x0;_0x476085<_0x44c324[_0x52cf('0x41')][_0x52cf('0xf')];_0x476085++){var _0x43acf8=_0x44c324['Attachments'][_0x476085];_0x4a49f0['message']['attachments'][_0x52cf('0x19')]({'filename':_0x43acf8['Title'],'content':Buffer['from'](_0x43acf8[_0x52cf('0x42')])});}}}_0x25e084(parseEmail(_0x160d32,_0x4e2f99,_0x4a49f0));});}else{_0x4e2f99[_0x52cf('0x13')]='

Empty\x20message

';_0x25e084(parseEmail(_0x160d32,_0x4e2f99,_0x4a49f0));}}else{_0x25e084(parseEmail(_0x160d32,_0x4e2f99,_0x4a49f0));}};exports['getHost']=function(_0x30f142){switch(_0x30f142){case _0x52cf('0x43'):return _0x52cf('0x44');case'yahoo':return _0x52cf('0x45');case _0x52cf('0x46'):return _0x52cf('0x47');case _0x52cf('0x48'):return _0x52cf('0x49');}return'127.0.0.1';}; \ No newline at end of file +var _0x6337=['imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','split','length','slice','Anonymous','pop','isEmpty','generate','html','replace','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo'];(function(_0x4f096b,_0x47d8ee){var _0x1c0f6a=function(_0x23d236){while(--_0x23d236){_0x4f096b['push'](_0x4f096b['shift']());}};_0x1c0f6a(++_0x47d8ee);}(_0x6337,0x18a));var _0x7633=function(_0x57ed12,_0x24fd71){_0x57ed12=_0x57ed12-0x0;var _0x289b0c=_0x6337[_0x57ed12];return _0x289b0c;};'use strict';var _=require('lodash');var moment=require(_0x7633('0x0'));var random=require(_0x7633('0x1'));var fs=require('fs');var path=require(_0x7633('0x2'));var util=require(_0x7633('0x3'));var tnef=require(_0x7633('0x4'));var logger=require(_0x7633('0x5'))(_0x7633('0x6'));var config=require(_0x7633('0x7'));function getAddress(_0x2ccc60){var _0x56f3ba=_[_0x7633('0x8')](_0x2ccc60[_0x7633('0x9')]);return _0x56f3ba&&_0x56f3ba[_0x7633('0xa')]?_0x56f3ba['address']:_0x7633('0xb')+random['generate'](0x6)+_0x7633('0xc');}function getFirstName(_0x14742c){var _0x54cc0e=_[_0x7633('0x8')](_0x14742c['value']);if(_0x54cc0e&&_0x54cc0e[_0x7633('0xd')]){if(_0x54cc0e['name']==_0x54cc0e[_0x7633('0xa')]){return _0x54cc0e[_0x7633('0xd')]['substring'](0x0,_0x54cc0e[_0x7633('0xd')][_0x7633('0xe')]('@'));}var _0x332283=_0x54cc0e['name'][_0x7633('0xf')](/\s+/);return _0x332283[_0x7633('0x10')]>0x1?_0x332283[_0x7633('0x11')](0x0,-0x1)['join']('\x20'):_0x54cc0e[_0x7633('0xd')];}return _0x7633('0x12');}function getLastName(_0x304a67){var _0x5ce87a=_['head'](_0x304a67['value']);if(_0x5ce87a&&_0x5ce87a[_0x7633('0xd')]){var _0x1be0ab=_0x5ce87a[_0x7633('0xd')][_0x7633('0xf')](/\s+/);return _0x1be0ab[_0x7633('0x10')]>0x1?_0x1be0ab[_0x7633('0x13')]():'';}return'';}function getMails(_0x47e212,_0x45ded1){var _0x1528b4='';for(var _0x5cbd62=0x0;_0x5cbd62<_0x45ded1[_0x7633('0x9')][_0x7633('0x10')];_0x5cbd62+=0x1){if(_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]!==_0x47e212){if(!_[_0x7633('0x14')](_0x1528b4)){_0x1528b4+=',';}_0x1528b4+=_0x45ded1['value'][_0x5cbd62][_0x7633('0xd')]||_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]||'';_0x1528b4+='\x20<';_0x1528b4+=_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]?_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]:_0x7633('0xb')+random[_0x7633('0x15')](0x6)+'@xcally.com';_0x1528b4+='>';}}return _0x1528b4;}function parseEmail(_0xdb0809,_0x1140cd,_0x1eb32e){if(_0x1140cd[_0x7633('0x16')]){var _0x1c8efc=/)<[^<]*)*<\/script>/gi;while(_0x1c8efc['test'](_0x1140cd[_0x7633('0x16')])){_0x1140cd[_0x7633('0x16')]=_0x1140cd[_0x7633('0x16')][_0x7633('0x17')](_0x1c8efc,'');}if(_0x1140cd['html'][_0x7633('0x18')](_0x7633('0x19'))){var _0x29177d=[];_0x1140cd[_0x7633('0x1a')]['forEach'](_0x2c2bdd=>{_0x29177d[_0x7633('0x1b')](_0x2c2bdd['filename']);});var _0x1eb275=/]+>/g;var _0x4e73c4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x47f2cb=_0x1140cd[_0x7633('0x16')][_0x7633('0x17')](_0x4e73c4,_0x7633('0x1c'));var _0x407053=_0x47f2cb[_0x7633('0x17')](_0x1eb275,_0x7633('0x1d'));for(let _0x22a817=0x0;_0x22a817<_0x29177d['length'];_0x22a817++){var _0x380f38=_0x407053[_0x7633('0x17')](_0x7633('0x1d'),_0x7633('0x1e')+_0x29177d[_0x22a817]+_0x7633('0x1f'));_0x407053=_0x380f38;}_0x1140cd[_0x7633('0x16')]=_0x407053;}_0x1eb32e['body']=_0x1140cd[_0x7633('0x16')];}else{_0x1eb32e[_0x7633('0x20')]=_0x1140cd['textAsHtml'];}if(_0x1eb32e[_0x7633('0x20')]){_0x1eb32e[_0x7633('0x20')]=_0x1eb32e['body']['replace'](/0x0){var _0x1ede5b=[_0x7633('0x32'),_0x7633('0x33'),'Precedence:\x20auto_reply'];for(var _0x295f72=0x0;_0x295f72<_0x1140cd['headerLines'][_0x7633('0x10')];_0x295f72++){var _0x548285=_[_0x7633('0xe')](_0x1ede5b,_0x1140cd[_0x7633('0x31')][_0x295f72]['line']);if(_0x548285>=0x0){_0x1eb32e[_0x7633('0x34')]=!![];}}}return _0x1eb32e;}exports[_0x7633('0x35')]=function(_0x3f24b2,_0x79c2d0,_0x18dd27){var _0x263290={'from':getAddress(_0x79c2d0[_0x7633('0x36')]),'firstName':getFirstName(_0x79c2d0['from']),'lastName':getLastName(_0x79c2d0['from']),'mapKey':_0x7633('0x6'),'message':{'from':getMails(_0x3f24b2['email'],_0x79c2d0[_0x7633('0x36')]),'to':_0x3f24b2[_0x7633('0x6')],'cc':'','subject':_0x79c2d0[_0x7633('0x37')]||'','messageId':_0x79c2d0[_0x7633('0x38')],'inReplyTo':_0x79c2d0[_0x7633('0x39')],'sentAt':moment(_0x79c2d0[_0x7633('0x3a')])[_0x7633('0x2a')](_0x7633('0x3b')),'attach':![],'attachments':[]}};if(!_0x79c2d0[_0x7633('0x16')]&&!_0x79c2d0[_0x7633('0x3c')]){var _0x806350=_[_0x7633('0x3d')](_0x79c2d0[_0x7633('0x1a')],{'contentType':'application/ms-tnef'});if(_0x806350['length']){logger[_0x7633('0x3e')](util[_0x7633('0x2a')](_0x7633('0x3f'),_0x79c2d0[_0x7633('0x38')]));tnef[_0x7633('0x40')](_[_0x7633('0x41')](_0x806350)['content'],function(_0x5b4902,_0x3a0201){if(_0x3a0201){_0x79c2d0[_0x7633('0x16')]=_0x3a0201[_0x7633('0x42')]||_0x7633('0x43');if(_0x3a0201['Attachments']){for(var _0x5d9a0d=0x0;_0x5d9a0d<_0x3a0201[_0x7633('0x44')][_0x7633('0x10')];_0x5d9a0d++){var _0x238c1f=_0x3a0201['Attachments'][_0x5d9a0d];_0x263290[_0x7633('0x23')][_0x7633('0x1a')][_0x7633('0x1b')]({'filename':_0x238c1f[_0x7633('0x45')],'content':Buffer[_0x7633('0x36')](_0x238c1f[_0x7633('0x46')])});}}}_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));});}else{_0x79c2d0['html']=_0x7633('0x43');_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));}}else{_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));}};exports[_0x7633('0x47')]=function(_0x362c72){switch(_0x362c72){case'gmail':return _0x7633('0x48');case _0x7633('0x49'):return _0x7633('0x4a');case'hotmail':return'imap-mail.outlook.com';case _0x7633('0x4b'):return _0x7633('0x4c');}return _0x7633('0x4d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 68b83fb..5c22878 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 _0xf92d=['Service','key','SERV','Imap','Smtp','exports','lodash','name'];(function(_0x264747,_0x4569f4){var _0x47c3be=function(_0x2bfe6d){while(--_0x2bfe6d){_0x264747['push'](_0x264747['shift']());}};_0x47c3be(++_0x4569f4);}(_0xf92d,0x13e));var _0xdf92=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xf92d[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xdf92('0x0'));function MailAccount(_0x365507){this['id']=_0x365507['id']||0x0;this[_0xdf92('0x1')]=_0x365507['name']||_0xdf92('0x2');this[_0xdf92('0x3')]=_0x365507[_0xdf92('0x3')]||_0xdf92('0x4');this['active']=_0x365507['active']||![];this[_0xdf92('0x5')]=_0x365507['Imap']||[];this[_0xdf92('0x6')]=_0x365507[_0xdf92('0x6')]||[];}module[_0xdf92('0x7')]=MailAccount; \ No newline at end of file +var _0xf0c3=['Smtp','name','Service','key','active','Imap'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf0c3,0x1a5));var _0x3f0c=function(_0x4e11a7,_0x2145aa){_0x4e11a7=_0x4e11a7-0x0;var _0x1ed835=_0xf0c3[_0x4e11a7];return _0x1ed835;};'use strict';var _=require('lodash');function MailAccount(_0x212cbf){this['id']=_0x212cbf['id']||0x0;this[_0x3f0c('0x0')]=_0x212cbf['name']||_0x3f0c('0x1');this[_0x3f0c('0x2')]=_0x212cbf['key']||'SERV';this[_0x3f0c('0x3')]=_0x212cbf['active']||![];this[_0x3f0c('0x4')]=_0x212cbf['Imap']||[];this[_0x3f0c('0x5')]=_0x212cbf[_0x3f0c('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index fdb332e..8784897 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 _0x861e=['isUndefined','merge','exports','lodash','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','length'];(function(_0x45c8d8,_0x432aa9){var _0x355fa0=function(_0xb13007){while(--_0xb13007){_0x45c8d8['push'](_0x45c8d8['shift']());}};_0x355fa0(++_0x432aa9);}(_0x861e,0x12f));var _0xe861=function(_0x58be73,_0x2118fc){_0x58be73=_0x58be73-0x0;var _0x28c3f1=_0x861e[_0x58be73];return _0x28c3f1;};'use strict';var _=require(_0xe861('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xe861('0x1')]={};};function freeIsNotKey(_0x23d734,_0x3e2375,_0x5537c5){var _0x1d02df=_[_0xe861('0x2')](_0x23d734,function(_0x11d26c,_0x3ee004){return _0x11d26c[_0x5537c5];});for(var _0x2e2c94 in _0x3e2375){if(_0x3e2375['hasOwnProperty'](_0x2e2c94)){if(!_0x1d02df[_0x2e2c94]){delete _0x3e2375[_0x2e2c94];}}}}Realtime[_0xe861('0x3')][_0xe861('0x4')]=function(_0x3ea6cc,_0x37020f){for(var _0x3f10de in _0x37020f){if(_0x3ea6cc[_0xe861('0x5')](_0x3f10de)){_0x3ea6cc[_0x3f10de]=_0x37020f[_0x3f10de];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x3219bf=this;return function(_0x11ae3c){if(_0x11ae3c){freeIsNotKey(_0x11ae3c,_0x3219bf[_0xe861('0x1')],'id');for(var _0x1f4eac=0x0,_0x14d677={},_0x5514d2={};_0x1f4eac<_0x11ae3c[_0xe861('0x6')];_0x1f4eac+=0x1){_0x14d677=_0x11ae3c[_0x1f4eac];if(_[_0xe861('0x7')](_0x3219bf[_0xe861('0x1')][_0x14d677['id']])){_0x3219bf[_0xe861('0x1')][_0x14d677['id']]=new MailAccount(_0x14d677);}else{_[_0xe861('0x8')](_0x3219bf[_0xe861('0x1')][_0x14d677['id']],_0x14d677);}}}return _0x3219bf[_0xe861('0x1')];};};module[_0xe861('0x9')]=Realtime; \ No newline at end of file +var _0xf4af=['exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge'];(function(_0x2526f1,_0x362203){var _0x1570a4=function(_0x270c8e){while(--_0x270c8e){_0x2526f1['push'](_0x2526f1['shift']());}};_0x1570a4(++_0x362203);}(_0xf4af,0x7a));var _0xff4a=function(_0x4cf6d2,_0x22e6d3){_0x4cf6d2=_0x4cf6d2-0x0;var _0x4146b4=_0xf4af[_0x4cf6d2];return _0x4146b4;};'use strict';var _=require('lodash');var MailAccount=require(_0xff4a('0x0'));var Realtime=function(){this[_0xff4a('0x1')]={};};function freeIsNotKey(_0x363388,_0x86e78f,_0x518ff2){var _0x10030=_[_0xff4a('0x2')](_0x363388,function(_0xff1cc1,_0x3048b6){return _0xff1cc1[_0x518ff2];});for(var _0x5aa5ad in _0x86e78f){if(_0x86e78f[_0xff4a('0x3')](_0x5aa5ad)){if(!_0x10030[_0x5aa5ad]){delete _0x86e78f[_0x5aa5ad];}}}}Realtime[_0xff4a('0x4')][_0xff4a('0x5')]=function(_0x559e5f,_0x4c796d){for(var _0x1812af in _0x4c796d){if(_0x559e5f[_0xff4a('0x3')](_0x1812af)){_0x559e5f[_0x1812af]=_0x4c796d[_0x1812af];}}};Realtime[_0xff4a('0x4')][_0xff4a('0x6')]=function(){var _0x40a90d=this;return function(_0xc09740){if(_0xc09740){freeIsNotKey(_0xc09740,_0x40a90d[_0xff4a('0x1')],'id');for(var _0x1c36db=0x0,_0x1907cf={},_0x5c6c83={};_0x1c36db<_0xc09740[_0xff4a('0x7')];_0x1c36db+=0x1){_0x1907cf=_0xc09740[_0x1c36db];if(_[_0xff4a('0x8')](_0x40a90d[_0xff4a('0x1')][_0x1907cf['id']])){_0x40a90d[_0xff4a('0x1')][_0x1907cf['id']]=new MailAccount(_0x1907cf);}else{_[_0xff4a('0x9')](_0x40a90d[_0xff4a('0x1')][_0x1907cf['id']],_0x1907cf);}}}return _0x40a90d['mailAccounts'];};};module[_0xff4a('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 0a4888c..1e84475 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 _0xfd2e=['../client','Request','name','email','active','key','ListId','TemplateId','MailServerOut','notify','NotifyMailAccount'];(function(_0x4ed9c9,_0x1b9648){var _0x591fc0=function(_0x11c379){while(--_0x11c379){_0x4ed9c9['push'](_0x4ed9c9['shift']());}};_0x591fc0(++_0x1b9648);}(_0xfd2e,0x6e));var _0xefd2=function(_0xcfd9d,_0x51f18e){_0xcfd9d=_0xcfd9d-0x0;var _0x595c5f=_0xfd2e[_0xcfd9d];return _0x595c5f;};'use strict';var client=require(_0xefd2('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xefd2('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0xefd2('0x2'),'service',_0xefd2('0x3'),_0xefd2('0x4'),_0xefd2('0x5'),_0xefd2('0x6'),_0xefd2('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':_0xefd2('0x8'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0xefd2('0x9')]=function(_0x50dd63,_0x440d11){return client[_0xefd2('0x1')](_0xefd2('0xa'),{'account':{'id':_0x50dd63},'body':_0x440d11,'log':_0xefd2('0xa')});}; \ No newline at end of file +var _0x2484=['Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active','key','ListId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify'];(function(_0xb6c1db,_0x423b4c){var _0x53227d=function(_0x53e9c9){while(--_0x53e9c9){_0xb6c1db['push'](_0xb6c1db['shift']());}};_0x53227d(++_0x423b4c);}(_0x2484,0x178));var _0x4248=function(_0x16c467,_0x53d6fa){_0x16c467=_0x16c467-0x0;var _0x22db4f=_0x2484[_0x16c467];return _0x22db4f;};'use strict';var client=require(_0x4248('0x0'));exports[_0x4248('0x1')]=function(){return function(){return client['Request'](_0x4248('0x2'),{'options':{'attributes':['id',_0x4248('0x3'),_0x4248('0x4'),_0x4248('0x5'),_0x4248('0x6'),_0x4248('0x7'),_0x4248('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x4248('0x9'),'as':_0x4248('0xa')},{'model':_0x4248('0xb'),'as':_0x4248('0xc')}]},'log':_0x4248('0xd')});};};exports[_0x4248('0xe')]=function(_0x5c1284,_0xa19286){return client[_0x4248('0xf')](_0x4248('0x10'),{'account':{'id':_0x5c1284},'body':_0xa19286,'log':_0x4248('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 5b3b8c0..fab8dee 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 _0x1fa4=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x50aae2,_0x437f60){var _0x6fc938=function(_0x3bc8ca){while(--_0x3bc8ca){_0x50aae2['push'](_0x50aae2['shift']());}};_0x6fc938(++_0x437f60);}(_0x1fa4,0x1bc));var _0x41fa=function(_0x3a8897,_0x259a0a){_0x3a8897=_0x3a8897-0x0;var _0x1ebf21=_0x1fa4[_0x3a8897];return _0x1ebf21;};'use strict';var client=require(_0x41fa('0x0'));exports[_0x41fa('0x1')]=function(){return client['Request'](_0x41fa('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x41fa('0x3')]},'log':_0x41fa('0x4')});}; \ No newline at end of file +var _0x7be1=['GetSettings','../client','getSettings'];(function(_0x456b77,_0x4fed12){var _0x118bb6=function(_0x2ea238){while(--_0x2ea238){_0x456b77['push'](_0x456b77['shift']());}};_0x118bb6(++_0x4fed12);}(_0x7be1,0x10f));var _0x17be=function(_0x697a85,_0x238db2){_0x697a85=_0x697a85-0x0;var _0x4a6ba9=_0x7be1[_0x697a85];return _0x4a6ba9;};'use strict';var client=require(_0x17be('0x0'));exports[_0x17be('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x17be('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d6dea78..71062a6 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 c7d056e..d0c7855 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 _0x5d4c=['default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','ioredis','../../config/environment','timeout','listen','socket.io','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers'];(function(_0x2b4f64,_0x5508b8){var _0x4bb12c=function(_0x40332a){while(--_0x40332a){_0x2b4f64['push'](_0x2b4f64['shift']());}};_0x4bb12c(++_0x5508b8);}(_0x5d4c,0x195));var _0xc5d4=function(_0x304ab3,_0x593ab3){_0x304ab3=_0x304ab3-0x0;var _0x44a9cc=_0x5d4c[_0x304ab3];return _0x44a9cc;};'use strict';var _=require(_0xc5d4('0x0'));var http=require('http');var express=require(_0xc5d4('0x1'));var sticky=require('sticky-session');var Redis=require(_0xc5d4('0x2'));var config=require(_0xc5d4('0x3'));var app=express();var server=http['createServer'](app);server[_0xc5d4('0x4')]=0xdbba0;if(sticky[_0xc5d4('0x5')](server,config['port'])){var socketio=require(_0xc5d4('0x6'))(server,{'transports':['websocket',_0xc5d4('0x7')]});config[_0xc5d4('0x8')]=_[_0xc5d4('0x9')](config['redis'],{'host':_0xc5d4('0xa'),'port':0x18eb});socketio['adapter'](require(_0xc5d4('0xb'))({'pubClient':new Redis(config[_0xc5d4('0x8')]),'subClient':new Redis(config[_0xc5d4('0x8')])}));require(_0xc5d4('0xc'))[_0xc5d4('0xd')]();require('../../config/socketio')[_0xc5d4('0xd')](socketio);require(_0xc5d4('0xe'))[_0xc5d4('0xd')](app);require(_0xc5d4('0xf'))[_0xc5d4('0xd')](app);}else{server[_0xc5d4('0x10')](_0xc5d4('0x11'),function(){console[_0xc5d4('0x12')](_0xc5d4('0x13'),config[_0xc5d4('0x14')]);});}exports=module[_0xc5d4('0x15')]=app; \ No newline at end of file +var _0x7e3c=['defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7e3c,0x1d3));var _0xc7e3=function(_0x3b073c,_0x178aa3){_0x3b073c=_0x3b073c-0x0;var _0x482655=_0x7e3c[_0x3b073c];return _0x482655;};'use strict';var _=require(_0xc7e3('0x0'));var http=require(_0xc7e3('0x1'));var express=require('express');var sticky=require(_0xc7e3('0x2'));var Redis=require(_0xc7e3('0x3'));var config=require(_0xc7e3('0x4'));var app=express();var server=http[_0xc7e3('0x5')](app);server[_0xc7e3('0x6')]=0xdbba0;if(sticky[_0xc7e3('0x7')](server,config[_0xc7e3('0x8')])){var socketio=require(_0xc7e3('0x9'))(server,{'transports':[_0xc7e3('0xa'),_0xc7e3('0xb')]});config[_0xc7e3('0xc')]=_[_0xc7e3('0xd')](config[_0xc7e3('0xc')],{'host':_0xc7e3('0xe'),'port':0x18eb});socketio['adapter'](require(_0xc7e3('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xc7e3('0xc')])}));require(_0xc7e3('0x10'))[_0xc7e3('0x11')]();require(_0xc7e3('0x12'))[_0xc7e3('0x11')](socketio);require(_0xc7e3('0x13'))[_0xc7e3('0x11')](app);require(_0xc7e3('0x14'))[_0xc7e3('0x11')](app);}else{server[_0xc7e3('0x15')]('listening',function(){console[_0xc7e3('0x16')](_0xc7e3('0x17'),config[_0xc7e3('0x8')]);});}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 58b70be..16b33e2 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 _0xc76d=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc76d,0x1b3));var _0xdc76=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0xc76d[_0x170cbb];return _0x39fae4;};'use strict';var jayson=require(_0xdc76('0x0'));var BPromise=require(_0xdc76('0x1'));var logger=require(_0xdc76('0x2'))(_0xdc76('0x3'));var client=jayson[_0xdc76('0x4')][_0xdc76('0x5')]({'port':0x2329});client[_0xdc76('0x6')]=function(_0x28c3d9,_0x3ed724){return new BPromise(function(_0x195346,_0x1f77ba){return client[_0xdc76('0x7')](_0x28c3d9,_0x3ed724)[_0xdc76('0x8')](function(_0xf66155){logger[_0xdc76('0x9')](_0xdc76('0xa'),_0xdc76('0x3'),_0x28c3d9,_0x3ed724,_0xf66155);if(_0xf66155[_0xdc76('0xb')]){logger[_0xdc76('0xb')](_0xdc76('0xa'),_0xdc76('0x3'),_0x28c3d9,_0xf66155['error'][_0xdc76('0xc')],_0x3ed724);return _0x1f77ba(_0xf66155['error']['message']);}else{return _0x195346(_0xf66155[_0xdc76('0xd')]);}})['catch'](function(_0xc0482a){logger['error'](_0xdc76('0xa'),_0xdc76('0x3'),_0x28c3d9,_0xc0482a,_0x3ed724);return _0x1f77ba(_0xc0482a);});});};module[_0xdc76('0xe')]=client; \ No newline at end of file +var _0x0f7f=['debug','rpc','routing','message','catch','error','exports','bluebird','../../config/logger','client','http','Request','request'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x0f7f,0x13f));var _0xf0f7=function(_0x2af001,_0x186dc0){_0x2af001=_0x2af001-0x0;var _0xee2f79=_0x0f7f[_0x2af001];return _0xee2f79;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf0f7('0x0'));var logger=require(_0xf0f7('0x1'))('routing');var client=jayson[_0xf0f7('0x2')][_0xf0f7('0x3')]({'port':0x2329});client[_0xf0f7('0x4')]=function(_0xe4c3ee,_0x22a547){return new BPromise(function(_0x13efe7,_0x3b3a4a){return client[_0xf0f7('0x5')](_0xe4c3ee,_0x22a547)['then'](function(_0x51e001){logger[_0xf0f7('0x6')](_0xf0f7('0x7'),_0xf0f7('0x8'),_0xe4c3ee,_0x22a547,_0x51e001);if(_0x51e001['error']){logger['error'](_0xf0f7('0x7'),_0xf0f7('0x8'),_0xe4c3ee,_0x51e001['error'][_0xf0f7('0x9')],_0x22a547);return _0x3b3a4a(_0x51e001['error'][_0xf0f7('0x9')]);}else{return _0x13efe7(_0x51e001['result']);}})[_0xf0f7('0xa')](function(_0x197a8f){logger[_0xf0f7('0xb')](_0xf0f7('0x7'),_0xf0f7('0x8'),_0xe4c3ee,_0x197a8f,_0x22a547);return _0x3b3a4a(_0x197a8f);});});};module[_0xf0f7('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 6cb60c5..c874dea 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 _0xe618=['initIntervals','getOpenchannelQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents'];(function(_0x3e9364,_0x4620e5){var _0xb837f1=function(_0x161062){while(--_0x161062){_0x3e9364['push'](_0x3e9364['shift']());}};_0xb837f1(++_0x4620e5);}(_0xe618,0x17b));var _0x8e61=function(_0x4601f3,_0x4d2401){_0x4601f3=_0x4601f3-0x0;var _0x2afb49=_0xe618[_0x4601f3];return _0x2afb49;};'use strict';var BPromise=require('bluebird');var server=require(_0x8e61('0x0'));var Realtime=require('./realtime');var user=require(_0x8e61('0x1'));var interval=require(_0x8e61('0x2'));var openchannelQueue=require(_0x8e61('0x3'));var chatQueue=require(_0x8e61('0x4'));var smsQueue=require(_0x8e61('0x5'));var mailQueue=require(_0x8e61('0x6'));var faxQueue=require(_0x8e61('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x8e61('0x8')]()[_0x8e61('0x9')](user[_0x8e61('0xa')]())[_0x8e61('0x9')](realtime[_0x8e61('0xb')]())[_0x8e61('0x9')](interval['getIntervals']())[_0x8e61('0x9')](realtime[_0x8e61('0xc')]())[_0x8e61('0x9')](openchannelQueue[_0x8e61('0xd')]())[_0x8e61('0x9')](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())[_0x8e61('0x9')](realtime['initChatQueues']())[_0x8e61('0x9')](smsQueue[_0x8e61('0xe')]())[_0x8e61('0x9')](realtime['initSmsQueues']())['then'](mailQueue[_0x8e61('0xf')]())[_0x8e61('0x9')](realtime[_0x8e61('0x10')]())[_0x8e61('0x9')](faxQueue[_0x8e61('0x11')]())[_0x8e61('0x9')](realtime[_0x8e61('0x12')]())[_0x8e61('0x9')](whatsappQueue[_0x8e61('0x13')]())[_0x8e61('0x9')](realtime['initWhatsappQueues']())[_0x8e61('0x9')](function(){return realtime;});}function main(){return server[_0x8e61('0x14')](realtime)[_0x8e61('0x9')](function(_0x2cd741){return initRealtime();})['then'](function(_0x46a538){return setInterval(initRealtime,0x1388);})[_0x8e61('0x15')](function(_0x3a93ea){console[_0x8e61('0x16')](_0x3a93ea);});}main(); \ No newline at end of file +var _0x14ef=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x54a1ac,_0x4dbb6c){var _0x505693=function(_0x368e6c){while(--_0x368e6c){_0x54a1ac['push'](_0x54a1ac['shift']());}};_0x505693(++_0x4dbb6c);}(_0x14ef,0x108));var _0xf14e=function(_0x3a90b6,_0x782086){_0x3a90b6=_0x3a90b6-0x0;var _0x56f71a=_0x14ef[_0x3a90b6];return _0x56f71a;};'use strict';var BPromise=require('bluebird');var server=require(_0xf14e('0x0'));var Realtime=require(_0xf14e('0x1'));var user=require(_0xf14e('0x2'));var interval=require(_0xf14e('0x3'));var openchannelQueue=require(_0xf14e('0x4'));var chatQueue=require(_0xf14e('0x5'));var smsQueue=require(_0xf14e('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf14e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf14e('0x8')]()['then'](user[_0xf14e('0x9')]())[_0xf14e('0xa')](realtime[_0xf14e('0xb')]())['then'](interval[_0xf14e('0xc')]())['then'](realtime[_0xf14e('0xd')]())[_0xf14e('0xa')](openchannelQueue[_0xf14e('0xe')]())[_0xf14e('0xa')](realtime[_0xf14e('0xf')]())[_0xf14e('0xa')](chatQueue[_0xf14e('0x10')]())['then'](realtime[_0xf14e('0x11')]())[_0xf14e('0xa')](smsQueue[_0xf14e('0x12')]())[_0xf14e('0xa')](realtime[_0xf14e('0x13')]())[_0xf14e('0xa')](mailQueue[_0xf14e('0x14')]())[_0xf14e('0xa')](realtime['initMailQueues']())['then'](faxQueue[_0xf14e('0x15')]())['then'](realtime[_0xf14e('0x16')]())[_0xf14e('0xa')](whatsappQueue[_0xf14e('0x17')]())[_0xf14e('0xa')](realtime[_0xf14e('0x18')]())[_0xf14e('0xa')](function(){return realtime;});}function main(){return server[_0xf14e('0x19')](realtime)['then'](function(_0x4e9bbe){return initRealtime();})[_0xf14e('0xa')](function(_0x3edcd5){return setInterval(initRealtime,0x1388);})[_0xf14e('0x1a')](function(_0x45534){console[_0xf14e('0x1b')](_0x45534);});}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 3d35c59..a4e97e6 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x411871,_0x3f6641){var _0x2ab4fc=function(_0x5c6919){while(--_0x5c6919){_0x411871['push'](_0x411871['shift']());}};_0x2ab4fc(++_0x3f6641);}(_0x5fc3,0xa8));var _0x35fc=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x5fc3[_0x506d2f];return _0x101255;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5b6576,_0x99240d){var _0x5dbcaf=function(_0x19eb3a){while(--_0x19eb3a){_0x5b6576['push'](_0x5b6576['shift']());}};_0x5dbcaf(++_0x99240d);}(_0x814b,0x1a2));var _0xb814=function(_0x5cc556,_0x158710){_0x5cc556=_0x5cc556-0x0;var _0x12103b=_0x814b[_0x5cc556];return _0x12103b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 405b6d1..ec77408 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 _0xe604=['SendMail','bluebird','jayson/promise','http','request','then','error','message','result','catch','sendMailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe604,0x7a));var _0x4e60=function(_0x3d67f5,_0x45379f){_0x3d67f5=_0x3d67f5-0x0;var _0x225ce9=_0xe604[_0x3d67f5];return _0x225ce9;};'use strict';var BPromise=require(_0x4e60('0x0'));var jayson=require(_0x4e60('0x1'));var client=jayson['client'][_0x4e60('0x2')]({'port':0x232b});function request(_0x3a4677,_0x30e7ce){return new BPromise(function(_0x43b8ae,_0x2a3517){return client[_0x4e60('0x3')](_0x3a4677,_0x30e7ce)[_0x4e60('0x4')](function(_0x170b37){if(_0x170b37[_0x4e60('0x5')]){return _0x2a3517(_0x170b37[_0x4e60('0x5')][_0x4e60('0x6')]);}else{return _0x43b8ae(_0x170b37[_0x4e60('0x7')]);}})[_0x4e60('0x8')](function(_0x20a36e){return _0x2a3517(_0x20a36e);});});}exports[_0x4e60('0x9')]=function(_0xf2b757,_0xb563cd){return request(_0x4e60('0xa'),{'account':_0xf2b757,'message':_0xb563cd});}; \ No newline at end of file +var _0xcd75=['message','sendMailMessage','SendMail','bluebird','jayson/promise','http','request','error'];(function(_0x51fc5e,_0x1763c9){var _0x11f3f2=function(_0x5b146e){while(--_0x5b146e){_0x51fc5e['push'](_0x51fc5e['shift']());}};_0x11f3f2(++_0x1763c9);}(_0xcd75,0x183));var _0x5cd7=function(_0x5c1092,_0x454d2a){_0x5c1092=_0x5c1092-0x0;var _0x21d279=_0xcd75[_0x5c1092];return _0x21d279;};'use strict';var BPromise=require(_0x5cd7('0x0'));var jayson=require(_0x5cd7('0x1'));var client=jayson['client'][_0x5cd7('0x2')]({'port':0x232b});function request(_0xa9e886,_0x38debd){return new BPromise(function(_0x30ba54,_0x4e9c5a){return client[_0x5cd7('0x3')](_0xa9e886,_0x38debd)['then'](function(_0x573677){if(_0x573677['error']){return _0x4e9c5a(_0x573677[_0x5cd7('0x4')][_0x5cd7('0x5')]);}else{return _0x30ba54(_0x573677['result']);}})['catch'](function(_0x578626){return _0x4e9c5a(_0x578626);});});}exports[_0x5cd7('0x6')]=function(_0xf19738,_0x1604f8){return request(_0x5cd7('0x7'),{'account':_0xf19738,'message':_0x1604f8});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0d60e52..1d8f356 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 _0x72f6=['smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','chatStatusTime','mailStatusTime','faxStatus','smsStatus','stringify','emit','lodash','moment','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0x221923,_0x16aab4){var _0x2c7d9b=function(_0x3398d9){while(--_0x3398d9){_0x221923['push'](_0x221923['shift']());}};_0x2c7d9b(++_0x16aab4);}(_0x72f6,0x1a9));var _0x672f=function(_0x5143ec,_0xde026){_0x5143ec=_0x5143ec-0x0;var _0x9d7439=_0x72f6[_0x5143ec];return _0x9d7439;};'use strict';var _=require(_0x672f('0x0'));var moment=require(_0x672f('0x1'));var md5=require(_0x672f('0x2'));var Redis=require('ioredis');var config=require(_0x672f('0x3'));config[_0x672f('0x4')]=_[_0x672f('0x5')](config[_0x672f('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x672f('0x6'))(new Redis(config[_0x672f('0x4')]));function Agent(_0x307451){this['id']=_0x307451['id']||0x0;this['name']=_0x307451[_0x672f('0x7')]||'';this[_0x672f('0x8')]=_0x307451[_0x672f('0x8')]||!![];this[_0x672f('0x9')]=_0x307451[_0x672f('0x9')]||![];this['chatPause']=_0x307451[_0x672f('0xa')]||![];this[_0x672f('0xb')]=_0x307451['mailPause']||![];this['faxPause']=_0x307451[_0x672f('0xc')]||![];this['smsPause']=_0x307451[_0x672f('0xd')]||![];this['openchannelPause']=_0x307451['openchannelPause']||![];this[_0x672f('0xe')]=_0x672f('0xf');this['chatStatusTime']=0x0;this[_0x672f('0x10')]=_0x307451[_0x672f('0x10')]||0x0;this[_0x672f('0x11')]=0x0;this['mailStatus']=_0x672f('0xf');this['mailStatusTime']=0x0;this[_0x672f('0x12')]=_0x307451['mailCapacity']||0x0;this[_0x672f('0x13')]=0x0;this['faxStatus']=_0x672f('0xf');this[_0x672f('0x14')]=0x0;this[_0x672f('0x15')]=_0x307451[_0x672f('0x15')]||0x0;this[_0x672f('0x16')]=0x0;this['smsStatus']=_0x672f('0xf');this[_0x672f('0x17')]=0x0;this[_0x672f('0x18')]=_0x307451[_0x672f('0x18')]||0x0;this[_0x672f('0x19')]=0x0;this[_0x672f('0x1a')]=_0x672f('0xf');this[_0x672f('0x1b')]=0x0;this[_0x672f('0x1c')]=_0x307451[_0x672f('0x1c')]||0x0;this[_0x672f('0x1d')]=0x0;this[_0x672f('0x1e')]=_0x672f('0xf');this[_0x672f('0x1f')]=0x0;this[_0x672f('0x20')]=_0x307451[_0x672f('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x672f('0x21')]=![];this[_0x672f('0x22')]=undefined;this[_0x672f('0x2')]='';this[_0x672f('0x23')]();}Agent[_0x672f('0x24')][_0x672f('0x25')]=function(_0x14f85f){if(this[_0x14f85f+'CurrentCapacity']>0x0){if(this[_0x14f85f+_0x672f('0x26')]>0x0&&this[_0x14f85f+_0x672f('0x27')]>=this[_0x14f85f+_0x672f('0x26')]){return'maxcapacity';}else{return _0x672f('0x28');}}else{return _0x672f('0x29');}};Agent[_0x672f('0x24')][_0x672f('0x23')]=function(){var _0x27134d=[_0x672f('0x2a'),'chat',_0x672f('0x2b'),'fax',_0x672f('0x2c'),_0x672f('0x2d')];for(var _0x42b018=0x0;_0x42b018<_0x27134d[_0x672f('0x2e')];_0x42b018+=0x1){var _0x3964d0=this[_0x672f('0x25')](_0x27134d[_0x42b018]);if(this[_0x27134d[_0x42b018]+_0x672f('0x2f')]!==_0x3964d0){this[_0x27134d[_0x42b018]+_0x672f('0x30')]=_[_0x672f('0x31')](moment()['format']('x'));}this[_0x27134d[_0x42b018]+_0x672f('0x2f')]=_0x3964d0;}var _0x8be90b={'id':this['id'],'name':this[_0x672f('0x7')],'online':this[_0x672f('0x8')],'voicePause':this[_0x672f('0x9')],'chatPause':this[_0x672f('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x672f('0xd')],'faxPause':this[_0x672f('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x672f('0xe')],'chatStatusTime':this[_0x672f('0x32')],'chatCapacity':this[_0x672f('0x10')],'chatCurrentCapacity':this[_0x672f('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x672f('0x33')],'mailCapacity':this[_0x672f('0x12')],'mailCurrentCapacity':this[_0x672f('0x13')],'faxStatus':this[_0x672f('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x672f('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x672f('0x35')],'smsStatusTime':this[_0x672f('0x17')],'smsCapacity':this[_0x672f('0x18')],'smsCurrentCapacity':this[_0x672f('0x19')],'whatsappStatus':this[_0x672f('0x1a')],'whatsappStatusTime':this[_0x672f('0x1b')],'whatsappCapacity':this[_0x672f('0x1c')],'whatsappCurrentCapacity':this[_0x672f('0x1d')],'openchannelStatus':this[_0x672f('0x1e')],'openchannelStatusTime':this[_0x672f('0x1f')],'openchannelCapacity':this[_0x672f('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x672f('0x21')],'busyQueue':this[_0x672f('0x22')]};var _0x516ff4=md5(JSON[_0x672f('0x36')](_0x8be90b));if(this[_0x672f('0x2')]!==_0x516ff4){this[_0x672f('0x2')]=_0x516ff4;io[_0x672f('0x37')]('user:save',_0x8be90b);}};module['exports']=Agent; \ No newline at end of file +var _0x507f=['whatsapp','Status','StatusTime','toNumber','format','whatsappStatusTime','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','updateRealtime','mail','chat','fax','sms'];(function(_0x50ff61,_0x311e41){var _0x242d76=function(_0x3fb4ac){while(--_0x3fb4ac){_0x50ff61['push'](_0x50ff61['shift']());}};_0x242d76(++_0x311e41);}(_0x507f,0x1f1));var _0xf507=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x507f[_0x16771d];return _0x386f11;};'use strict';var _=require(_0xf507('0x0'));var moment=require(_0xf507('0x1'));var md5=require(_0xf507('0x2'));var Redis=require(_0xf507('0x3'));var config=require(_0xf507('0x4'));config[_0xf507('0x5')]=_['defaults'](config[_0xf507('0x5')],{'host':_0xf507('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf507('0x5')]));function Agent(_0x581b7b){this['id']=_0x581b7b['id']||0x0;this[_0xf507('0x7')]=_0x581b7b[_0xf507('0x7')]||'';this[_0xf507('0x8')]=_0x581b7b[_0xf507('0x8')]||!![];this[_0xf507('0x9')]=_0x581b7b[_0xf507('0x9')]||![];this[_0xf507('0xa')]=_0x581b7b['chatPause']||![];this['mailPause']=_0x581b7b[_0xf507('0xb')]||![];this[_0xf507('0xc')]=_0x581b7b[_0xf507('0xc')]||![];this['smsPause']=_0x581b7b[_0xf507('0xd')]||![];this[_0xf507('0xe')]=_0x581b7b[_0xf507('0xe')]||![];this[_0xf507('0xf')]=_0xf507('0x10');this[_0xf507('0x11')]=0x0;this['chatCapacity']=_0x581b7b[_0xf507('0x12')]||0x0;this[_0xf507('0x13')]=0x0;this[_0xf507('0x14')]=_0xf507('0x10');this[_0xf507('0x15')]=0x0;this[_0xf507('0x16')]=_0x581b7b['mailCapacity']||0x0;this[_0xf507('0x17')]=0x0;this[_0xf507('0x18')]=_0xf507('0x10');this[_0xf507('0x19')]=0x0;this[_0xf507('0x1a')]=_0x581b7b[_0xf507('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xf507('0x1b')]=_0xf507('0x10');this[_0xf507('0x1c')]=0x0;this[_0xf507('0x1d')]=_0x581b7b[_0xf507('0x1d')]||0x0;this[_0xf507('0x1e')]=0x0;this[_0xf507('0x1f')]=_0xf507('0x10');this['whatsappStatusTime']=0x0;this[_0xf507('0x20')]=_0x581b7b[_0xf507('0x20')]||0x0;this[_0xf507('0x21')]=0x0;this[_0xf507('0x22')]=_0xf507('0x10');this[_0xf507('0x23')]=0x0;this[_0xf507('0x24')]=_0x581b7b[_0xf507('0x24')]||0x0;this[_0xf507('0x25')]=0x0;this[_0xf507('0x26')]=![];this[_0xf507('0x27')]=undefined;this[_0xf507('0x2')]='';this['updateRealtime']();}Agent['prototype'][_0xf507('0x28')]=function(_0x17218c){if(this[_0x17218c+_0xf507('0x29')]>0x0){if(this[_0x17218c+_0xf507('0x2a')]>0x0&&this[_0x17218c+_0xf507('0x29')]>=this[_0x17218c+'Capacity']){return _0xf507('0x2b');}else{return _0xf507('0x2c');}}else{return _0xf507('0x2d');}};Agent[_0xf507('0x2e')][_0xf507('0x2f')]=function(){var _0x1fe540=[_0xf507('0x30'),_0xf507('0x31'),'openchannel',_0xf507('0x32'),_0xf507('0x33'),_0xf507('0x34')];for(var _0x124596=0x0;_0x124596<_0x1fe540['length'];_0x124596+=0x1){var _0x31d9da=this[_0xf507('0x28')](_0x1fe540[_0x124596]);if(this[_0x1fe540[_0x124596]+_0xf507('0x35')]!==_0x31d9da){this[_0x1fe540[_0x124596]+_0xf507('0x36')]=_[_0xf507('0x37')](moment()[_0xf507('0x38')]('x'));}this[_0x1fe540[_0x124596]+_0xf507('0x35')]=_0x31d9da;}var _0x3034e5={'id':this['id'],'name':this[_0xf507('0x7')],'online':this[_0xf507('0x8')],'voicePause':this[_0xf507('0x9')],'chatPause':this[_0xf507('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0xf507('0xd')],'faxPause':this[_0xf507('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xf507('0x11')],'chatCapacity':this[_0xf507('0x12')],'chatCurrentCapacity':this[_0xf507('0x13')],'mailStatus':this[_0xf507('0x14')],'mailStatusTime':this[_0xf507('0x15')],'mailCapacity':this[_0xf507('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xf507('0x18')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xf507('0x1a')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xf507('0x1b')],'smsStatusTime':this[_0xf507('0x1c')],'smsCapacity':this[_0xf507('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xf507('0x39')],'whatsappCapacity':this[_0xf507('0x20')],'whatsappCurrentCapacity':this[_0xf507('0x21')],'openchannelStatus':this[_0xf507('0x22')],'openchannelStatusTime':this[_0xf507('0x23')],'openchannelCapacity':this[_0xf507('0x24')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xf507('0x26')],'busyQueue':this[_0xf507('0x27')]};var _0x40f416=md5(JSON['stringify'](_0x3034e5));if(this[_0xf507('0x2')]!==_0x40f416){this[_0xf507('0x2')]=_0x40f416;io[_0xf507('0x3a')](_0xf507('0x3b'),_0x3034e5);}};module[_0xf507('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 127c669..cf02032 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 _0xeb03=['paused','length','online','available','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','updateRealtime','loggedIn'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0xeb03,0xb7));var _0x3eb0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xeb03[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x3eb0('0x0'));var md5=require(_0x3eb0('0x1'));var util=require(_0x3eb0('0x2'));var Redis=require('ioredis');var config=require(_0x3eb0('0x3'));config[_0x3eb0('0x4')]=_[_0x3eb0('0x5')](config[_0x3eb0('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x3eb0('0x6'))(new Redis(config['redis']));function ChatQueue(_0x1f0dbe){this['id']=_0x1f0dbe['id']||0x0;this[_0x3eb0('0x7')]=_0x1f0dbe['name']||'';this[_0x3eb0('0x8')]=_0x1f0dbe['timeout']||0xa;this['strategy']=_0x1f0dbe[_0x3eb0('0x9')]||'beepall';this[_0x3eb0('0xa')]=_0x1f0dbe[_0x3eb0('0xa')];this[_0x3eb0('0xb')]={};this[_0x3eb0('0xc')]=0x0;this[_0x3eb0('0x1')]='';this[_0x3eb0('0xd')]();this['updateRealtime']();}ChatQueue[_0x3eb0('0xe')][_0x3eb0('0xd')]=function(){var _0xc8d741=this[_0x3eb0('0xb')]['_rr'];this[_0x3eb0('0xb')]=_['map'](this[_0x3eb0('0xa')],'id');this[_0x3eb0('0xb')]['_rr']=_0xc8d741;};ChatQueue['prototype'][_0x3eb0('0xf')]=function(){this[_0x3eb0('0x10')]=0x0;this[_0x3eb0('0x11')]=0x0;for(var _0x352512=0x0;_0x352512=0x0?this[_0x3eb0('0x14')]:0x0;var _0x59b32a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3eb0('0x10')],'name':this['name'],'paused':this[_0x3eb0('0x11')],'waiting':this[_0x3eb0('0xc')]};var _0x4c0faa=md5(JSON['stringify'](_0x59b32a));if(this[_0x3eb0('0x1')]!==_0x4c0faa){this['md5']=_0x4c0faa;io['to'](util['format'](_0x3eb0('0x15'),_0x59b32a[_0x3eb0('0x7')]))[_0x3eb0('0x16')](_0x3eb0('0x17'),_0x59b32a);}};module[_0x3eb0('0x18')]=ChatQueue; \ No newline at end of file +var _0x198d=['md5','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','online','chatPause','available','loggedIn','stringify','format','chat:queue:%s','chat_queue:save','lodash'];(function(_0x4ecef7,_0x3f7786){var _0x31c33d=function(_0x6ca0a4){while(--_0x6ca0a4){_0x4ecef7['push'](_0x4ecef7['shift']());}};_0x31c33d(++_0x3f7786);}(_0x198d,0x1a3));var _0xd198=function(_0x5e74ea,_0x2cf12f){_0x5e74ea=_0x5e74ea-0x0;var _0x54f8cd=_0x198d[_0x5e74ea];return _0x54f8cd;};'use strict';var _=require(_0xd198('0x0'));var md5=require(_0xd198('0x1'));var util=require('util');var Redis=require(_0xd198('0x2'));var config=require(_0xd198('0x3'));config[_0xd198('0x4')]=_[_0xd198('0x5')](config[_0xd198('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x3f569d){this['id']=_0x3f569d['id']||0x0;this['name']=_0x3f569d[_0xd198('0x6')]||'';this[_0xd198('0x7')]=_0x3f569d['timeout']||0xa;this[_0xd198('0x8')]=_0x3f569d[_0xd198('0x8')]||_0xd198('0x9');this[_0xd198('0xa')]=_0x3f569d['Agents'];this['mapAgentsId']={};this[_0xd198('0xb')]=0x0;this[_0xd198('0x1')]='';this[_0xd198('0xc')]();this['updateRealtime']();}ChatQueue[_0xd198('0xd')][_0xd198('0xc')]=function(){var _0x266b02=this[_0xd198('0xe')][_0xd198('0xf')];this[_0xd198('0xe')]=_[_0xd198('0x10')](this[_0xd198('0xa')],'id');this[_0xd198('0xe')]['_rr']=_0x266b02;};ChatQueue[_0xd198('0xd')][_0xd198('0x11')]=function(){this['loggedIn']=0x0;this[_0xd198('0x12')]=0x0;for(var _0x216fab=0x0;_0x216fab=0x0?this[_0xd198('0x16')]:0x0;var _0x5c4826={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd198('0x17')],'name':this[_0xd198('0x6')],'paused':this[_0xd198('0x12')],'waiting':this['waiting']};var _0x35879e=md5(JSON[_0xd198('0x18')](_0x5c4826));if(this['md5']!==_0x35879e){this[_0xd198('0x1')]=_0x35879e;io['to'](util[_0xd198('0x19')](_0xd198('0x1a'),_0x5c4826[_0xd198('0x6')]))['emit'](_0xd198('0x1b'),_0x5c4826);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 6d631c5..2bb3f58 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 _0x4af1=['updateRouting','updateRealtime','map','prototype','loggedIn','paused','length','online','available','stringify','md5','format','emit','fax_queue:save','exports','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x16a64e,_0x4b3491){var _0x29a6e4=function(_0x3a81b8){while(--_0x3a81b8){_0x16a64e['push'](_0x16a64e['shift']());}};_0x29a6e4(++_0x4b3491);}(_0x4af1,0x91));var _0x14af=function(_0x58df5d,_0xd74e9f){_0x58df5d=_0x58df5d-0x0;var _0x482294=_0x4af1[_0x58df5d];return _0x482294;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x14af('0x0'));var Redis=require('ioredis');var config=require(_0x14af('0x1'));config[_0x14af('0x2')]=_['defaults'](config['redis'],{'host':_0x14af('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x14af('0x2')]));function FaxQueue(_0x4554ed){this['id']=_0x4554ed['id']||0x0;this[_0x14af('0x4')]=_0x4554ed[_0x14af('0x4')]||'';this[_0x14af('0x5')]=_0x4554ed[_0x14af('0x5')]||0xa;this[_0x14af('0x6')]=_0x4554ed[_0x14af('0x6')]||_0x14af('0x7');this[_0x14af('0x8')]=_0x4554ed[_0x14af('0x8')];this[_0x14af('0x9')]={};this[_0x14af('0xa')]=0x0;this['md5']='';this[_0x14af('0xb')]();this[_0x14af('0xc')]();}FaxQueue['prototype'][_0x14af('0xb')]=function(){var _0x94d835=this['mapAgentsId']['_rr'];this[_0x14af('0x9')]=_[_0x14af('0xd')](this[_0x14af('0x8')],'id');this[_0x14af('0x9')]['_rr']=_0x94d835;};FaxQueue[_0x14af('0xe')][_0x14af('0xc')]=function(){this[_0x14af('0xf')]=0x0;this[_0x14af('0x10')]=0x0;for(var _0x1c00b3=0x0;_0x1c00b3=0x0?this['available']:0x0;var _0x543fef={'id':this['id'],'available':this[_0x14af('0x13')],'loggedIn':this[_0x14af('0xf')],'name':this['name'],'paused':this[_0x14af('0x10')],'waiting':this[_0x14af('0xa')]};var _0x437c74=md5(JSON[_0x14af('0x14')](_0x543fef));if(this[_0x14af('0x15')]!==_0x437c74){this['md5']=_0x437c74;io['to'](util[_0x14af('0x16')]('fax:queue:%s',_0x543fef[_0x14af('0x4')]))[_0x14af('0x17')](_0x14af('0x18'),_0x543fef);}};module[_0x14af('0x19')]=FaxQueue; \ No newline at end of file +var _0x5120=['format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','paused','length','online','loggedIn','available','waiting','stringify'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x5120,0x143));var _0x0512=function(_0x5d0746,_0x511b2d){_0x5d0746=_0x5d0746-0x0;var _0x19a392=_0x5120[_0x5d0746];return _0x19a392;};'use strict';var _=require(_0x0512('0x0'));var md5=require(_0x0512('0x1'));var util=require(_0x0512('0x2'));var Redis=require(_0x0512('0x3'));var config=require(_0x0512('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x0512('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0512('0x6')]));function FaxQueue(_0x4cca58){this['id']=_0x4cca58['id']||0x0;this[_0x0512('0x7')]=_0x4cca58['name']||'';this[_0x0512('0x8')]=_0x4cca58[_0x0512('0x8')]||0xa;this[_0x0512('0x9')]=_0x4cca58[_0x0512('0x9')]||_0x0512('0xa');this[_0x0512('0xb')]=_0x4cca58[_0x0512('0xb')];this[_0x0512('0xc')]={};this['waiting']=0x0;this[_0x0512('0x1')]='';this[_0x0512('0xd')]();this['updateRealtime']();}FaxQueue['prototype'][_0x0512('0xd')]=function(){var _0x1ee1dc=this[_0x0512('0xc')][_0x0512('0xe')];this[_0x0512('0xc')]=_[_0x0512('0xf')](this[_0x0512('0xb')],'id');this[_0x0512('0xc')]['_rr']=_0x1ee1dc;};FaxQueue[_0x0512('0x10')][_0x0512('0x11')]=function(){this['loggedIn']=0x0;this[_0x0512('0x12')]=0x0;for(var _0x39422c=0x0;_0x39422c=0x0?this['available']:0x0;var _0x433cf2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0512('0x15')],'name':this[_0x0512('0x7')],'paused':this['paused'],'waiting':this[_0x0512('0x17')]};var _0x3f482b=md5(JSON[_0x0512('0x18')](_0x433cf2));if(this[_0x0512('0x1')]!==_0x3f482b){this[_0x0512('0x1')]=_0x3f482b;io['to'](util[_0x0512('0x19')](_0x0512('0x1a'),_0x433cf2[_0x0512('0x7')]))['emit'](_0x0512('0x1b'),_0x433cf2);}};module[_0x0512('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 838593f..63efaa6 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 _0x3955=['exports','name','Intervals'];(function(_0x1cd5b3,_0x288f7d){var _0x3a93ac=function(_0x2f5bc7){while(--_0x2f5bc7){_0x1cd5b3['push'](_0x1cd5b3['shift']());}};_0x3a93ac(++_0x288f7d);}(_0x3955,0xa6));var _0x5395=function(_0x499b0a,_0x49fd69){_0x499b0a=_0x499b0a-0x0;var _0x4cde14=_0x3955[_0x499b0a];return _0x4cde14;};'use strict';function Interval(_0x11bc57){this['id']=_0x11bc57['id']||0x0;this[_0x5395('0x0')]=_0x11bc57[_0x5395('0x0')]||'';this[_0x5395('0x1')]=_0x11bc57[_0x5395('0x1')]||{};}module[_0x5395('0x2')]=Interval; \ No newline at end of file +var _0xd410=['exports','name','Intervals'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd410,0x151));var _0x0d41=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xd410[_0x29b609];return _0x54c952;};'use strict';function Interval(_0x3e3dbb){this['id']=_0x3e3dbb['id']||0x0;this[_0x0d41('0x0')]=_0x3e3dbb['name']||'';this[_0x0d41('0x1')]=_0x3e3dbb[_0x0d41('0x1')]||{};}module[_0x0d41('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 56d42ad..d4287a4 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 _0x7b0a=['prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting'];(function(_0x31b448,_0x179c65){var _0x3a9497=function(_0x4c28e7){while(--_0x4c28e7){_0x31b448['push'](_0x31b448['shift']());}};_0x3a9497(++_0x179c65);}(_0x7b0a,0xca));var _0xa7b0=function(_0x419763,_0x48ae33){_0x419763=_0x419763-0x0;var _0x44a255=_0x7b0a[_0x419763];return _0x44a255;};'use strict';var _=require(_0xa7b0('0x0'));var md5=require(_0xa7b0('0x1'));var util=require(_0xa7b0('0x2'));var Redis=require(_0xa7b0('0x3'));var config=require(_0xa7b0('0x4'));config[_0xa7b0('0x5')]=_[_0xa7b0('0x6')](config[_0xa7b0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa7b0('0x7'))(new Redis(config[_0xa7b0('0x5')]));function MailQueue(_0x55dbd0){this['id']=_0x55dbd0['id']||0x0;this[_0xa7b0('0x8')]=_0x55dbd0[_0xa7b0('0x8')]||'';this[_0xa7b0('0x9')]=_0x55dbd0[_0xa7b0('0x9')]||0xa;this['strategy']=_0x55dbd0[_0xa7b0('0xa')]||_0xa7b0('0xb');this[_0xa7b0('0xc')]=_0x55dbd0[_0xa7b0('0xc')];this[_0xa7b0('0xd')]={};this['waiting']=0x0;this[_0xa7b0('0x1')]='';this[_0xa7b0('0xe')]();this['updateRealtime']();}MailQueue[_0xa7b0('0xf')][_0xa7b0('0xe')]=function(){var _0x5e85fc=this['mapAgentsId'][_0xa7b0('0x10')];this[_0xa7b0('0xd')]=_[_0xa7b0('0x11')](this[_0xa7b0('0xc')],'id');this['mapAgentsId'][_0xa7b0('0x10')]=_0x5e85fc;};MailQueue[_0xa7b0('0xf')]['updateRealtime']=function(){this[_0xa7b0('0x12')]=0x0;this[_0xa7b0('0x13')]=0x0;for(var _0xb2475=0x0;_0xb2475=0x0?this['available']:0x0;var _0x14c4a9={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa7b0('0x12')],'name':this[_0xa7b0('0x8')],'paused':this[_0xa7b0('0x13')],'waiting':this[_0xa7b0('0x18')]};var _0x4de2b8=md5(JSON[_0xa7b0('0x19')](_0x14c4a9));if(this[_0xa7b0('0x1')]!==_0x4de2b8){this['md5']=_0x4de2b8;io['to'](util[_0xa7b0('0x1a')](_0xa7b0('0x1b'),_0x14c4a9[_0xa7b0('0x8')]))[_0xa7b0('0x1c')](_0xa7b0('0x1d'),_0x14c4a9);}};module[_0xa7b0('0x1e')]=MailQueue; \ No newline at end of file +var _0x24b3=['md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x5b17bf,_0x5c03e4){var _0x451247=function(_0x5ad93a){while(--_0x5ad93a){_0x5b17bf['push'](_0x5b17bf['shift']());}};_0x451247(++_0x5c03e4);}(_0x24b3,0x64));var _0x324b=function(_0x1fd6a7,_0x4e2634){_0x1fd6a7=_0x1fd6a7-0x0;var _0xe8ed42=_0x24b3[_0x1fd6a7];return _0xe8ed42;};'use strict';var _=require(_0x324b('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x324b('0x1'));config[_0x324b('0x2')]=_[_0x324b('0x3')](config[_0x324b('0x2')],{'host':_0x324b('0x4'),'port':0x18eb});var io=require(_0x324b('0x5'))(new Redis(config[_0x324b('0x2')]));function MailQueue(_0x24c6c7){this['id']=_0x24c6c7['id']||0x0;this[_0x324b('0x6')]=_0x24c6c7['name']||'';this[_0x324b('0x7')]=_0x24c6c7['timeout']||0xa;this[_0x324b('0x8')]=_0x24c6c7[_0x324b('0x8')]||'beepall';this[_0x324b('0x9')]=_0x24c6c7[_0x324b('0x9')];this[_0x324b('0xa')]={};this[_0x324b('0xb')]=0x0;this[_0x324b('0xc')]='';this[_0x324b('0xd')]();this[_0x324b('0xe')]();}MailQueue[_0x324b('0xf')][_0x324b('0xd')]=function(){var _0x3b2244=this[_0x324b('0xa')][_0x324b('0x10')];this['mapAgentsId']=_[_0x324b('0x11')](this[_0x324b('0x9')],'id');this[_0x324b('0xa')][_0x324b('0x10')]=_0x3b2244;};MailQueue[_0x324b('0xf')][_0x324b('0xe')]=function(){this[_0x324b('0x12')]=0x0;this[_0x324b('0x13')]=0x0;for(var _0x532db7=0x0;_0x532db7=0x0?this[_0x324b('0x16')]:0x0;var _0xd1d089={'id':this['id'],'available':this['available'],'loggedIn':this[_0x324b('0x12')],'name':this[_0x324b('0x6')],'paused':this[_0x324b('0x13')],'waiting':this[_0x324b('0xb')]};var _0xc4477=md5(JSON[_0x324b('0x17')](_0xd1d089));if(this[_0x324b('0xc')]!==_0xc4477){this[_0x324b('0xc')]=_0xc4477;io['to'](util[_0x324b('0x18')](_0x324b('0x19'),_0xd1d089[_0x324b('0x6')]))['emit'](_0x324b('0x1a'),_0xd1d089);}};module[_0x324b('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 1421300..8d44e78 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x2ef3,0xba));var _0x32ef=function(_0x889323,_0x246ce8){_0x889323=_0x889323-0x0;var _0xe7fddf=_0x2ef3[_0x889323];return _0xe7fddf;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x4637dd,_0x4e2109){var _0x4d97d3=function(_0x3e19cc){while(--_0x3e19cc){_0x4637dd['push'](_0x4637dd['shift']());}};_0x4d97d3(++_0x4e2109);}(_0x5fc3,0xa8));var _0x35fc=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x5fc3[_0x478414];return _0x5eb6b9;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 0a54b65..39b6ad8 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 _0x46fc=['prototype','updateRealtime','length','smsPause','paused','available','loggedIn','stringify','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x3ce67,_0x5f50f7){var _0x31d4fe=function(_0xd3c390){while(--_0xd3c390){_0x3ce67['push'](_0x3ce67['shift']());}};_0x31d4fe(++_0x5f50f7);}(_0x46fc,0x103));var _0xc46f=function(_0x2d77e1,_0xac474b){_0x2d77e1=_0x2d77e1-0x0;var _0x13781a=_0x46fc[_0x2d77e1];return _0x13781a;};'use strict';var _=require(_0xc46f('0x0'));var md5=require(_0xc46f('0x1'));var util=require(_0xc46f('0x2'));var Redis=require(_0xc46f('0x3'));var config=require(_0xc46f('0x4'));config[_0xc46f('0x5')]=_[_0xc46f('0x6')](config[_0xc46f('0x5')],{'host':_0xc46f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x46315d){this['id']=_0x46315d['id']||0x0;this[_0xc46f('0x8')]=_0x46315d[_0xc46f('0x8')]||'';this[_0xc46f('0x9')]=_0x46315d[_0xc46f('0x9')]||0xa;this[_0xc46f('0xa')]=_0x46315d[_0xc46f('0xa')]||_0xc46f('0xb');this[_0xc46f('0xc')]=_0x46315d[_0xc46f('0xc')];this[_0xc46f('0xd')]={};this[_0xc46f('0xe')]=0x0;this[_0xc46f('0x1')]='';this[_0xc46f('0xf')]();this['updateRealtime']();}SmsQueue[_0xc46f('0x10')][_0xc46f('0xf')]=function(){var _0x32e9fe=this[_0xc46f('0xd')]['_rr'];this['mapAgentsId']=_['map'](this[_0xc46f('0xc')],'id');this[_0xc46f('0xd')]['_rr']=_0x32e9fe;};SmsQueue[_0xc46f('0x10')][_0xc46f('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1e3575=0x0;_0x1e3575=0x0?this['available']:0x0;var _0x4740b3={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc46f('0x16')],'name':this[_0xc46f('0x8')],'paused':this[_0xc46f('0x14')],'waiting':this['waiting']};var _0x474af7=md5(JSON[_0xc46f('0x17')](_0x4740b3));if(this[_0xc46f('0x1')]!==_0x474af7){this[_0xc46f('0x1')]=_0x474af7;io['to'](util['format']('sms:queue:%s',_0x4740b3['name']))['emit']('sms_queue:save',_0x4740b3);}};module[_0xc46f('0x18')]=SmsQueue; \ No newline at end of file +var _0x222f=['lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','length','online','smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports'];(function(_0x9e8a76,_0xf64fbd){var _0x5b353c=function(_0x17f80e){while(--_0x17f80e){_0x9e8a76['push'](_0x9e8a76['shift']());}};_0x5b353c(++_0xf64fbd);}(_0x222f,0x1a4));var _0xf222=function(_0x4caf4f,_0x1f9d37){_0x4caf4f=_0x4caf4f-0x0;var _0xf64dd9=_0x222f[_0x4caf4f];return _0xf64dd9;};'use strict';var _=require(_0xf222('0x0'));var md5=require(_0xf222('0x1'));var util=require(_0xf222('0x2'));var Redis=require(_0xf222('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xf222('0x4')](config[_0xf222('0x5')],{'host':_0xf222('0x6'),'port':0x18eb});var io=require(_0xf222('0x7'))(new Redis(config['redis']));function SmsQueue(_0x3a2751){this['id']=_0x3a2751['id']||0x0;this['name']=_0x3a2751[_0xf222('0x8')]||'';this[_0xf222('0x9')]=_0x3a2751['timeout']||0xa;this[_0xf222('0xa')]=_0x3a2751[_0xf222('0xa')]||'beepall';this[_0xf222('0xb')]=_0x3a2751[_0xf222('0xb')];this[_0xf222('0xc')]={};this[_0xf222('0xd')]=0x0;this[_0xf222('0x1')]='';this[_0xf222('0xe')]();this['updateRealtime']();}SmsQueue[_0xf222('0xf')][_0xf222('0xe')]=function(){var _0x226dbd=this[_0xf222('0xc')]['_rr'];this[_0xf222('0xc')]=_[_0xf222('0x10')](this[_0xf222('0xb')],'id');this[_0xf222('0xc')][_0xf222('0x11')]=_0x226dbd;};SmsQueue[_0xf222('0xf')][_0xf222('0x12')]=function(){this[_0xf222('0x13')]=0x0;this['paused']=0x0;for(var _0x5b8f97=0x0;_0x5b8f97=0x0?this[_0xf222('0x18')]:0x0;var _0xfb4ddf={'id':this['id'],'available':this[_0xf222('0x18')],'loggedIn':this[_0xf222('0x13')],'name':this[_0xf222('0x8')],'paused':this['paused'],'waiting':this[_0xf222('0xd')]};var _0x1bdd0a=md5(JSON[_0xf222('0x19')](_0xfb4ddf));if(this[_0xf222('0x1')]!==_0x1bdd0a){this['md5']=_0x1bdd0a;io['to'](util['format'](_0xf222('0x1a'),_0xfb4ddf[_0xf222('0x8')]))[_0xf222('0x1b')](_0xf222('0x1c'),_0xfb4ddf);}};module[_0xf222('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bfa5c61..7b2bef2 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 _0xede5=['exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','updateRouting','_rr','map','prototype','paused','online','loggedIn','whatsappPause','available','stringify','format'];(function(_0x3957c6,_0x6e9e2a){var _0x58cddb=function(_0x1b50b8){while(--_0x1b50b8){_0x3957c6['push'](_0x3957c6['shift']());}};_0x58cddb(++_0x6e9e2a);}(_0xede5,0xbe));var _0x5ede=function(_0x2ad8f8,_0x35c53e){_0x2ad8f8=_0x2ad8f8-0x0;var _0x35d59e=_0xede5[_0x2ad8f8];return _0x35d59e;};'use strict';var _=require(_0x5ede('0x0'));var md5=require('md5');var util=require(_0x5ede('0x1'));var Redis=require('ioredis');var config=require(_0x5ede('0x2'));config[_0x5ede('0x3')]=_[_0x5ede('0x4')](config[_0x5ede('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x5ede('0x5'))(new Redis(config[_0x5ede('0x3')]));function WhatsappQueue(_0x6c3eca){this['id']=_0x6c3eca['id']||0x0;this[_0x5ede('0x6')]=_0x6c3eca['name']||'';this[_0x5ede('0x7')]=_0x6c3eca[_0x5ede('0x7')]||0xa;this[_0x5ede('0x8')]=_0x6c3eca[_0x5ede('0x8')]||_0x5ede('0x9');this[_0x5ede('0xa')]=_0x6c3eca[_0x5ede('0xa')];this[_0x5ede('0xb')]={};this[_0x5ede('0xc')]=0x0;this[_0x5ede('0xd')]='';this['updateRouting']();this[_0x5ede('0xe')]();}WhatsappQueue['prototype'][_0x5ede('0xf')]=function(){var _0x177e0a=this[_0x5ede('0xb')][_0x5ede('0x10')];this[_0x5ede('0xb')]=_[_0x5ede('0x11')](this[_0x5ede('0xa')],'id');this['mapAgentsId']['_rr']=_0x177e0a;};WhatsappQueue[_0x5ede('0x12')][_0x5ede('0xe')]=function(){this['loggedIn']=0x0;this[_0x5ede('0x13')]=0x0;for(var _0x35093a=0x0;_0x35093a=0x0?this[_0x5ede('0x17')]:0x0;var _0x12cdc1={'id':this['id'],'available':this[_0x5ede('0x17')],'loggedIn':this[_0x5ede('0x15')],'name':this[_0x5ede('0x6')],'paused':this['paused'],'waiting':this[_0x5ede('0xc')]};var _0x4b0f65=md5(JSON[_0x5ede('0x18')](_0x12cdc1));if(this['md5']!==_0x4b0f65){this[_0x5ede('0xd')]=_0x4b0f65;io['to'](util[_0x5ede('0x19')]('whatsapp:queue:%s',_0x12cdc1[_0x5ede('0x6')]))['emit']('whatsapp_queue:save',_0x12cdc1);}};module[_0x5ede('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x6142=['md5','format','whatsapp:queue:%s','whatsapp_queue:save','exports','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','whatsappPause','available'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x6142,0x1b5));var _0x2614=function(_0x544025,_0x55a5f9){_0x544025=_0x544025-0x0;var _0x5ad9a4=_0x6142[_0x544025];return _0x5ad9a4;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x2614('0x0'));var Redis=require(_0x2614('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x2614('0x2')](config[_0x2614('0x3')],{'host':_0x2614('0x4'),'port':0x18eb});var io=require(_0x2614('0x5'))(new Redis(config[_0x2614('0x3')]));function WhatsappQueue(_0x1f5be1){this['id']=_0x1f5be1['id']||0x0;this[_0x2614('0x6')]=_0x1f5be1['name']||'';this[_0x2614('0x7')]=_0x1f5be1[_0x2614('0x7')]||0xa;this[_0x2614('0x8')]=_0x1f5be1['strategy']||_0x2614('0x9');this[_0x2614('0xa')]=_0x1f5be1[_0x2614('0xa')];this[_0x2614('0xb')]={};this[_0x2614('0xc')]=0x0;this['md5']='';this[_0x2614('0xd')]();this[_0x2614('0xe')]();}WhatsappQueue[_0x2614('0xf')][_0x2614('0xd')]=function(){var _0x26febb=this[_0x2614('0xb')][_0x2614('0x10')];this[_0x2614('0xb')]=_[_0x2614('0x11')](this[_0x2614('0xa')],'id');this[_0x2614('0xb')][_0x2614('0x10')]=_0x26febb;};WhatsappQueue[_0x2614('0xf')]['updateRealtime']=function(){this[_0x2614('0x12')]=0x0;this[_0x2614('0x13')]=0x0;for(var _0x24ce53=0x0;_0x24ce53=0x0?this[_0x2614('0x15')]:0x0;var _0x1b2331={'id':this['id'],'available':this[_0x2614('0x15')],'loggedIn':this[_0x2614('0x12')],'name':this[_0x2614('0x6')],'paused':this['paused'],'waiting':this[_0x2614('0xc')]};var _0x550c87=md5(JSON['stringify'](_0x1b2331));if(this['md5']!==_0x550c87){this[_0x2614('0x16')]=_0x550c87;io['to'](util[_0x2614('0x17')](_0x2614('0x18'),_0x1b2331[_0x2614('0x6')]))['emit'](_0x2614('0x19'),_0x1b2331);}};module[_0x2614('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d3bce2d..b1c493b 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x443242,_0x4d9878){var _0x2c7479=function(_0xa1a7b6){while(--_0xa1a7b6){_0x443242['push'](_0x443242['shift']());}};_0x2c7479(++_0x4d9878);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fbd74,_0x3dc5ba){_0x4fbd74=_0x4fbd74-0x0;var _0x45bdc7=_0xb10b[_0x4fbd74];return _0x45bdc7;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +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(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 ef54c40..c5c7a47 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 _0xa9c3=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x5cb622,_0x47da28){var _0x3a083d=function(_0x34ef2d){while(--_0x34ef2d){_0x5cb622['push'](_0x5cb622['shift']());}};_0x3a083d(++_0x47da28);}(_0xa9c3,0x8d));var _0x3a9c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa9c3[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x3a9c('0x0'));exports[_0x3a9c('0x1')]=function(_0x48df85,_0x461042){return client[_0x3a9c('0x2')](_0x3a9c('0x3'),{'body':_0x461042,'options':{'where':{'id':_0x48df85}},'log':_0x3a9c('0x4')});};exports[_0x3a9c('0x5')]=function(_0x4a88cf,_0x24cf0d){return client[_0x3a9c('0x2')](_0x3a9c('0x6'),{'body':_0x24cf0d,'options':{'where':{'id':_0x4a88cf}},'log':_0x3a9c('0x7')});}; \ No newline at end of file +var _0xb298=['../client','update','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x5df8aa,_0x1a857f){var _0x3dd86f=function(_0x45ef66){while(--_0x45ef66){_0x5df8aa['push'](_0x5df8aa['shift']());}};_0x3dd86f(++_0x1a857f);}(_0xb298,0x168));var _0x8b29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb298[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8b29('0x0'));exports[_0x8b29('0x1')]=function(_0x1ca16d,_0x19edb0){return client[_0x8b29('0x2')](_0x8b29('0x3'),{'body':_0x19edb0,'options':{'where':{'id':_0x1ca16d}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x3b452a,_0x3dd867){return client['Request'](_0x8b29('0x4'),{'body':_0x3dd867,'options':{'where':{'id':_0x3b452a}},'log':_0x8b29('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 3691357..80972ed 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 _0x47be=['CreateChatMessage','createChatMessage','Request'];(function(_0x47b605,_0x5c837f){var _0x35dcc8=function(_0x53d666){while(--_0x53d666){_0x47b605['push'](_0x47b605['shift']());}};_0x35dcc8(++_0x5c837f);}(_0x47be,0x122));var _0xe47b=function(_0x317b63,_0x2acf92){_0x317b63=_0x317b63-0x0;var _0x36a2e2=_0x47be[_0x317b63];return _0x36a2e2;};'use strict';var client=require('../client');exports['create']=function(_0x4c1b92){return client[_0xe47b('0x0')](_0xe47b('0x1'),{'body':_0x4c1b92,'log':_0xe47b('0x2')});}; \ No newline at end of file +var _0x20b5=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x1959f3,_0x13f071){var _0x190326=function(_0x2ec17a){while(--_0x2ec17a){_0x1959f3['push'](_0x1959f3['shift']());}};_0x190326(++_0x13f071);}(_0x20b5,0xa5));var _0x520b=function(_0x5480e5,_0x52e354){_0x5480e5=_0x5480e5-0x0;var _0x20b7cc=_0x20b5[_0x5480e5];return _0x20b7cc;};'use strict';var client=require(_0x520b('0x0'));exports[_0x520b('0x1')]=function(_0xe4fae2){return client[_0x520b('0x2')](_0x520b('0x3'),{'body':_0xe4fae2,'log':_0x520b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 7a5b658..1db1087 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 _0x4fde=['strategy','Agents','name','online','chatPause','../client','getChatQueues','Request','GetChatQueue','timeout'];(function(_0x4f6f13,_0x1c3bd0){var _0x10d5f7=function(_0x31c5fc){while(--_0x31c5fc){_0x4f6f13['push'](_0x4f6f13['shift']());}};_0x10d5f7(++_0x1c3bd0);}(_0x4fde,0x19f));var _0xe4fd=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x4fde[_0x4dbaad];return _0x226c72;};'use strict';var client=require(_0xe4fd('0x0'));exports[_0xe4fd('0x1')]=function(){return function(){return client[_0xe4fd('0x2')](_0xe4fd('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe4fd('0x4'),_0xe4fd('0x5')],'include':[{'model':'User','as':_0xe4fd('0x6'),'attributes':['id',_0xe4fd('0x7'),_0xe4fd('0x8'),_0xe4fd('0x9')]}]},'log':_0xe4fd('0x1')});};}; \ No newline at end of file +var _0xe3c5=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents','online'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xe3c5,0x17d));var _0x5e3c=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0xe3c5[_0xf35bc1];return _0xa6b162;};'use strict';var client=require(_0x5e3c('0x0'));exports[_0x5e3c('0x1')]=function(){return function(){return client[_0x5e3c('0x2')](_0x5e3c('0x3'),{'options':{'raw':![],'attributes':['id',_0x5e3c('0x4'),_0x5e3c('0x5'),'strategy'],'include':[{'model':_0x5e3c('0x6'),'as':_0x5e3c('0x7'),'attributes':['id',_0x5e3c('0x4'),_0x5e3c('0x8'),_0x5e3c('0x9')]}]},'log':_0x5e3c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 4eb3def..b73fc95 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 _0x2333=['../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport','DESC'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x2333,0x11a));var _0x3233=function(_0x4dd021,_0x21fe94){_0x4dd021=_0x4dd021-0x0;var _0x71eadf=_0x2333[_0x4dd021];return _0x71eadf;};'use strict';var client=require(_0x3233('0x0'));exports[_0x3233('0x1')]=function(_0x4c4ec0){return client['Request'](_0x3233('0x2'),{'body':_0x4c4ec0,'log':_0x3233('0x2')});};exports['update']=function(_0x8fdc58,_0x1c473f){return client[_0x3233('0x3')](_0x3233('0x4'),{'body':_0x1c473f,'options':{'where':{'uniqueid':_0x8fdc58},'order':[['id',_0x3233('0x5')]],'limit':0x1},'log':_0x3233('0x4')});}; \ No newline at end of file +var _0xa7dc=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client','create'];(function(_0x1fedc7,_0x40e44b){var _0x525fa4=function(_0x3d98b3){while(--_0x3d98b3){_0x1fedc7['push'](_0x1fedc7['shift']());}};_0x525fa4(++_0x40e44b);}(_0xa7dc,0x11d));var _0xca7d=function(_0x144cc2,_0x172d39){_0x144cc2=_0x144cc2-0x0;var _0x111137=_0xa7dc[_0x144cc2];return _0x111137;};'use strict';var client=require(_0xca7d('0x0'));exports[_0xca7d('0x1')]=function(_0x150001){return client['Request'](_0xca7d('0x2'),{'body':_0x150001,'log':'CreateChatQueueReport'});};exports[_0xca7d('0x3')]=function(_0x75fca7,_0xc9d57a){return client[_0xca7d('0x4')](_0xca7d('0x5'),{'body':_0xc9d57a,'options':{'where':{'uniqueid':_0x75fca7},'order':[['id',_0xca7d('0x6')]],'limit':0x1},'log':_0xca7d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 1ddb447..688651d 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(_0x7d7d53,_0x150b52){var _0x28d9ff=function(_0x3b1c1b){while(--_0x3b1c1b){_0x7d7d53['push'](_0x7d7d53['shift']());}};_0x28d9ff(++_0x150b52);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0x7a54,0x106));var _0x47a5=function(_0x1e66a0,_0x5d549e){_0x1e66a0=_0x1e66a0-0x0;var _0x40cf2f=_0x7a54[_0x1e66a0];return _0x40cf2f;};'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 64694af..87dd1f9 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 _0x9680=['createFaxMessage','Request','CreateFaxMessage'];(function(_0x583142,_0x294774){var _0x554e92=function(_0x3a75ac){while(--_0x3a75ac){_0x583142['push'](_0x583142['shift']());}};_0x554e92(++_0x294774);}(_0x9680,0x1c3));var _0x0968=function(_0x416941,_0x478f9b){_0x416941=_0x416941-0x0;var _0x206f04=_0x9680[_0x416941];return _0x206f04;};'use strict';var client=require('../client');exports['create']=function(_0x2a67aa){return client[_0x0968('0x0')](_0x0968('0x1'),{'body':_0x2a67aa,'log':_0x0968('0x2')});}; \ No newline at end of file +var _0x53b9=['Request','../client','create'];(function(_0x4aa4f3,_0x3d34ce){var _0x1b4cc1=function(_0x424dd7){while(--_0x424dd7){_0x4aa4f3['push'](_0x4aa4f3['shift']());}};_0x1b4cc1(++_0x3d34ce);}(_0x53b9,0xac));var _0x953b=function(_0x4afc7d,_0x461034){_0x4afc7d=_0x4afc7d-0x0;var _0x5304f5=_0x53b9[_0x4afc7d];return _0x5304f5;};'use strict';var client=require(_0x953b('0x0'));exports[_0x953b('0x1')]=function(_0xa8b18b){return client[_0x953b('0x2')]('CreateFaxMessage',{'body':_0xa8b18b,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ffdd7f6..61bc661 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 _0xa728=['timeout','strategy','User','online','faxPause','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xa728,0x11d));var _0x8a72=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0xa728[_0x1dac7a];return _0x4cb363;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x8a72('0x0')](_0x8a72('0x1'),{'options':{'raw':![],'attributes':['id',_0x8a72('0x2'),_0x8a72('0x3'),_0x8a72('0x4')],'include':[{'model':_0x8a72('0x5'),'as':'Agents','attributes':['id','name',_0x8a72('0x6'),_0x8a72('0x7')]}]},'log':_0x8a72('0x8')});};}; \ No newline at end of file +var _0x21a6=['Request','GetFaxQueue','name','timeout','strategy','Agents','online','getFaxQueues'];(function(_0x49abd0,_0x567d6b){var _0x3c533c=function(_0x2d23ba){while(--_0x2d23ba){_0x49abd0['push'](_0x49abd0['shift']());}};_0x3c533c(++_0x567d6b);}(_0x21a6,0x13f));var _0x621a=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x21a6[_0x11ca63];return _0x41f1f6;};'use strict';var client=require('../client');exports[_0x621a('0x0')]=function(){return function(){return client[_0x621a('0x1')](_0x621a('0x2'),{'options':{'raw':![],'attributes':['id',_0x621a('0x3'),_0x621a('0x4'),_0x621a('0x5')],'include':[{'model':'User','as':_0x621a('0x6'),'attributes':['id','name',_0x621a('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 97b2847..e92aee1 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 _0x1849=['update','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x2620fb,_0x48846f){var _0x71c456=function(_0x270b98){while(--_0x270b98){_0x2620fb['push'](_0x2620fb['shift']());}};_0x71c456(++_0x48846f);}(_0x1849,0x8c));var _0x9184=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1849[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x9184('0x0'));exports[_0x9184('0x1')]=function(_0x22f903){return client[_0x9184('0x2')]('CreateFaxQueueReport',{'body':_0x22f903,'log':_0x9184('0x3')});};exports[_0x9184('0x4')]=function(_0x17db5f,_0xb470c9){return client[_0x9184('0x2')](_0x9184('0x5'),{'body':_0xb470c9,'options':{'where':{'uniqueid':_0x17db5f},'order':[['id','DESC']],'limit':0x1},'log':_0x9184('0x5')});}; \ No newline at end of file +var _0x975f=['DESC','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x455a9c,_0x4235c6){var _0x112350=function(_0x5a044d){while(--_0x5a044d){_0x455a9c['push'](_0x455a9c['shift']());}};_0x112350(++_0x4235c6);}(_0x975f,0x1e1));var _0xf975=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x975f[_0x255c48];return _0xaebda3;};'use strict';var client=require('../client');exports[_0xf975('0x0')]=function(_0x12a0fe){return client[_0xf975('0x1')](_0xf975('0x2'),{'body':_0x12a0fe,'log':_0xf975('0x2')});};exports[_0xf975('0x3')]=function(_0x3c8693,_0x4f6f5a){return client[_0xf975('0x1')](_0xf975('0x4'),{'body':_0x4f6f5a,'options':{'where':{'uniqueid':_0x3c8693},'order':[['id',_0xf975('0x5')]],'limit':0x1},'log':_0xf975('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6a2fd52..4126c53 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 _0x95ae=['Intervals','interval','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0xdc8dc7,_0x128ad6){var _0xd21432=function(_0x5bf3a7){while(--_0x5bf3a7){_0xdc8dc7['push'](_0xdc8dc7['shift']());}};_0xd21432(++_0x128ad6);}(_0x95ae,0x16a));var _0xe95a=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x95ae[_0x1cb18a];return _0x22442e;};'use strict';var client=require(_0xe95a('0x0'));exports[_0xe95a('0x1')]=function(){return function(){return client[_0xe95a('0x2')](_0xe95a('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe95a('0x4')],'include':[{'model':_0xe95a('0x5'),'as':_0xe95a('0x6'),'attributes':['id',_0xe95a('0x4'),_0xe95a('0x7')]}]},'log':_0xe95a('0x1')});};}; \ No newline at end of file +var _0xe553=['name','interval','../client','getIntervals','Request','Interval'];(function(_0x3ab99f,_0x3b7378){var _0xe37398=function(_0x98cf12){while(--_0x98cf12){_0x3ab99f['push'](_0x3ab99f['shift']());}};_0xe37398(++_0x3b7378);}(_0xe553,0x8c));var _0x3e55=function(_0x4b1475,_0x2912a3){_0x4b1475=_0x4b1475-0x0;var _0x3457d0=_0xe553[_0x4b1475];return _0x3457d0;};'use strict';var client=require(_0x3e55('0x0'));exports[_0x3e55('0x1')]=function(){return function(){return client[_0x3e55('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3e55('0x3'),'as':'Intervals','attributes':['id',_0x3e55('0x4'),_0x3e55('0x5')]}]},'log':_0x3e55('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 5d87b8b..ed2c4dc 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 _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x4bd6d3,_0x3a7e64){var _0x3e663c=function(_0x23f1d6){while(--_0x23f1d6){_0x4bd6d3['push'](_0x4bd6d3['shift']());}};_0x3e663c(++_0x3a7e64);}(_0x056b,0xb6));var _0xb056=function(_0x5a3785,_0x2de636){_0x5a3785=_0x5a3785-0x0;var _0x4d058a=_0x056b[_0x5a3785];return _0x4d058a;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4325=['update','Request','UpdateMailInteraction','addTagsToChatInteraction','../client'];(function(_0x277180,_0x3a33c3){var _0x45cd8f=function(_0x1adc59){while(--_0x1adc59){_0x277180['push'](_0x277180['shift']());}};_0x45cd8f(++_0x3a33c3);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5432('0x0'));exports[_0x5432('0x1')]=function(_0x5aa4b8,_0x3f491f){return client[_0x5432('0x2')](_0x5432('0x3'),{'body':_0x3f491f,'options':{'where':{'id':_0x5aa4b8}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x20f704,_0x36ce53){return client[_0x5432('0x2')]('AddTagsToMailInteraction',{'body':_0x36ce53,'options':{'where':{'id':_0x20f704}},'log':_0x5432('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 7f6575f..10d4e80 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 _0x2d3f=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x324002,_0x59f3e7){var _0x3f43ab=function(_0xacc1b1){while(--_0xacc1b1){_0x324002['push'](_0x324002['shift']());}};_0x3f43ab(++_0x59f3e7);}(_0x2d3f,0x11b));var _0xf2d3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2d3f[_0x160c73];return _0xd9302;};'use strict';var client=require(_0xf2d3('0x0'));exports[_0xf2d3('0x1')]=function(_0x38dd22){return client[_0xf2d3('0x2')](_0xf2d3('0x3'),{'body':_0x38dd22,'log':_0xf2d3('0x4')});}; \ No newline at end of file +var _0x053c=['Request'];(function(_0x24c5df,_0x36adbc){var _0x374082=function(_0x332441){while(--_0x332441){_0x24c5df['push'](_0x24c5df['shift']());}};_0x374082(++_0x36adbc);}(_0x053c,0xe0));var _0xc053=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x053c[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports['create']=function(_0x4eef72){return client[_0xc053('0x0')]('CreateMailMessage',{'body':_0x4eef72,'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 b2866a5..f315690 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 _0x0f2c=['name','timeout','strategy','User','Agents','online','../client','Request','GetMailQueue'];(function(_0x11b1e0,_0x329362){var _0x3f1b14=function(_0x473b49){while(--_0x473b49){_0x11b1e0['push'](_0x11b1e0['shift']());}};_0x3f1b14(++_0x329362);}(_0x0f2c,0x192));var _0xc0f2=function(_0x2cd0c3,_0x1488b4){_0x2cd0c3=_0x2cd0c3-0x0;var _0x3fc793=_0x0f2c[_0x2cd0c3];return _0x3fc793;};'use strict';var client=require(_0xc0f2('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xc0f2('0x1')](_0xc0f2('0x2'),{'options':{'raw':![],'attributes':['id',_0xc0f2('0x3'),_0xc0f2('0x4'),_0xc0f2('0x5')],'include':[{'model':_0xc0f2('0x6'),'as':_0xc0f2('0x7'),'attributes':['id',_0xc0f2('0x3'),_0xc0f2('0x8'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x391d=['getMailQueues','Request','name','strategy','User','Agents','online','../client'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x391d,0x10f));var _0xd391=function(_0x258aa2,_0x5ba123){_0x258aa2=_0x258aa2-0x0;var _0x3a7d14=_0x391d[_0x258aa2];return _0x3a7d14;};'use strict';var client=require(_0xd391('0x0'));exports[_0xd391('0x1')]=function(){return function(){return client[_0xd391('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd391('0x3'),'timeout',_0xd391('0x4')],'include':[{'model':_0xd391('0x5'),'as':_0xd391('0x6'),'attributes':['id',_0xd391('0x3'),_0xd391('0x7'),'mailPause']}]},'log':_0xd391('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f80547f..c7b0548 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 _0xe285=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client','create'];(function(_0x5901cb,_0x33f8aa){var _0x4ba75f=function(_0x278d05){while(--_0x278d05){_0x5901cb['push'](_0x5901cb['shift']());}};_0x4ba75f(++_0x33f8aa);}(_0xe285,0x76));var _0x5e28=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe285[_0x465a0c];return _0x1e202e;};'use strict';var client=require(_0x5e28('0x0'));exports[_0x5e28('0x1')]=function(_0x4ff0a1){return client[_0x5e28('0x2')](_0x5e28('0x3'),{'body':_0x4ff0a1,'log':_0x5e28('0x3')});};exports[_0x5e28('0x4')]=function(_0x5cd7cb,_0x40a78a){return client[_0x5e28('0x2')](_0x5e28('0x5'),{'body':_0x40a78a,'options':{'where':{'uniqueid':_0x5cd7cb},'order':[['id','DESC']],'limit':0x1},'log':_0x5e28('0x5')});}; \ No newline at end of file +var _0x7f58=['DESC','UpdateMailQueueReport','Request','CreateMailQueueReport'];(function(_0x2f77a7,_0x35fd6a){var _0x170f86=function(_0x5c5bd5){while(--_0x5c5bd5){_0x2f77a7['push'](_0x2f77a7['shift']());}};_0x170f86(++_0x35fd6a);}(_0x7f58,0xda));var _0x87f5=function(_0x35d647,_0x4757d8){_0x35d647=_0x35d647-0x0;var _0x4363fc=_0x7f58[_0x35d647];return _0x4363fc;};'use strict';var client=require('../client');exports['create']=function(_0x7a200e){return client[_0x87f5('0x0')](_0x87f5('0x1'),{'body':_0x7a200e,'log':_0x87f5('0x1')});};exports['update']=function(_0x4b367e,_0x588d2c){return client[_0x87f5('0x0')]('UpdateMailQueueReport',{'body':_0x588d2c,'options':{'where':{'uniqueid':_0x4b367e},'order':[['id',_0x87f5('0x2')]],'limit':0x1},'log':_0x87f5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ee4d30b..bf54f9a 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 _0x0042=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x0042,0x165));var _0x2004=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0x0042[_0x5e42a7];return _0x36d21b;};'use strict';var client=require(_0x2004('0x0'));exports[_0x2004('0x1')]=function(_0x445cb3,_0x23811a){return client[_0x2004('0x2')](_0x2004('0x3'),{'body':_0x23811a,'options':{'where':{'id':_0x445cb3}},'log':_0x2004('0x4')});};exports[_0x2004('0x5')]=function(_0x5c0d6f,_0x43994a){return client[_0x2004('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x43994a,'options':{'where':{'id':_0x5c0d6f}},'log':_0x2004('0x6')});}; \ No newline at end of file +var _0xc5a8=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','updateOpenchannelInteraction','addTags'];(function(_0x465893,_0x364547){var _0x3e4908=function(_0x56e822){while(--_0x56e822){_0x465893['push'](_0x465893['shift']());}};_0x3e4908(++_0x364547);}(_0xc5a8,0x18e));var _0x8c5a=function(_0x165241,_0x2f1be0){_0x165241=_0x165241-0x0;var _0x5f256c=_0xc5a8[_0x165241];return _0x5f256c;};'use strict';var client=require('../client');exports[_0x8c5a('0x0')]=function(_0x2f3b62,_0x492d88){return client[_0x8c5a('0x1')]('UpdateOpenchannelInteraction',{'body':_0x492d88,'options':{'where':{'id':_0x2f3b62}},'log':_0x8c5a('0x2')});};exports[_0x8c5a('0x3')]=function(_0x3a8bbb,_0x23c2d7){return client[_0x8c5a('0x1')](_0x8c5a('0x4'),{'body':_0x23c2d7,'options':{'where':{'id':_0x3a8bbb}},'log':_0x8c5a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 00e900b..e2e70d8 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 _0xa290=['../client','create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x21b4cb,_0x2bd0c3){var _0x21318b=function(_0x4bf488){while(--_0x4bf488){_0x21b4cb['push'](_0x21b4cb['shift']());}};_0x21318b(++_0x2bd0c3);}(_0xa290,0x1e4));var _0x0a29=function(_0x220a4d,_0x4f5876){_0x220a4d=_0x220a4d-0x0;var _0x11e8ab=_0xa290[_0x220a4d];return _0x11e8ab;};'use strict';var client=require(_0x0a29('0x0'));exports[_0x0a29('0x1')]=function(_0x26616f){return client['Request'](_0x0a29('0x2'),{'body':_0x26616f,'log':_0x0a29('0x3')});}; \ No newline at end of file +var _0x6848=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x388d75,_0x41662f){var _0x399ecf=function(_0x401e3f){while(--_0x401e3f){_0x388d75['push'](_0x388d75['shift']());}};_0x399ecf(++_0x41662f);}(_0x6848,0xbf));var _0x8684=function(_0xef0536,_0x26039d){_0xef0536=_0xef0536-0x0;var _0x18d24d=_0x6848[_0xef0536];return _0x18d24d;};'use strict';var client=require(_0x8684('0x0'));exports['create']=function(_0x49b0a9){return client[_0x8684('0x1')](_0x8684('0x2'),{'body':_0x49b0a9,'log':_0x8684('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 06266a0..a0d31cb 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 _0x62d2=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','openchannelPause','../client'];(function(_0x3ed2a9,_0x1db7d0){var _0x51bc6d=function(_0xe4c76e){while(--_0xe4c76e){_0x3ed2a9['push'](_0x3ed2a9['shift']());}};_0x51bc6d(++_0x1db7d0);}(_0x62d2,0xce));var _0x262d=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0x62d2[_0xbd4254];return _0x46c0f3;};'use strict';var client=require(_0x262d('0x0'));exports[_0x262d('0x1')]=function(){return function(){return client[_0x262d('0x2')](_0x262d('0x3'),{'options':{'raw':![],'attributes':['id',_0x262d('0x4'),_0x262d('0x5'),'strategy'],'include':[{'model':_0x262d('0x6'),'as':_0x262d('0x7'),'attributes':['id','name','online',_0x262d('0x8')]}]},'log':_0x262d('0x1')});};}; \ No newline at end of file +var _0xfd4f=['Agents','name','online','../client','getOpenchannelQueues','Request','timeout','User'];(function(_0x22ee0f,_0x22e6d2){var _0x204696=function(_0x4cab38){while(--_0x4cab38){_0x22ee0f['push'](_0x22ee0f['shift']());}};_0x204696(++_0x22e6d2);}(_0xfd4f,0x133));var _0xffd4=function(_0x3c58cd,_0x5d8d9d){_0x3c58cd=_0x3c58cd-0x0;var _0x1e6b39=_0xfd4f[_0x3c58cd];return _0x1e6b39;};'use strict';var client=require(_0xffd4('0x0'));exports[_0xffd4('0x1')]=function(){return function(){return client[_0xffd4('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xffd4('0x3'),'strategy'],'include':[{'model':_0xffd4('0x4'),'as':_0xffd4('0x5'),'attributes':['id',_0xffd4('0x6'),_0xffd4('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 1375748..bf46117 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 _0x4a29=['update','DESC','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4a29,0x18b));var _0x94a2=function(_0x3b5ebb,_0x44546e){_0x3b5ebb=_0x3b5ebb-0x0;var _0xe64cdb=_0x4a29[_0x3b5ebb];return _0xe64cdb;};'use strict';var client=require(_0x94a2('0x0'));exports[_0x94a2('0x1')]=function(_0x55ae8f){return client[_0x94a2('0x2')]('CreateOpenchannelQueueReport',{'body':_0x55ae8f,'log':_0x94a2('0x3')});};exports[_0x94a2('0x4')]=function(_0x4ccdea,_0x27948d){return client[_0x94a2('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x27948d,'options':{'where':{'uniqueid':_0x4ccdea},'order':[['id',_0x94a2('0x5')]],'limit':0x1},'log':_0x94a2('0x6')});}; \ No newline at end of file +var _0xabae=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x3b1e6f,_0x17e752){var _0x5760a2=function(_0x271694){while(--_0x271694){_0x3b1e6f['push'](_0x3b1e6f['shift']());}};_0x5760a2(++_0x17e752);}(_0xabae,0x1a1));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['create']=function(_0x189cb8){return client[_0xeaba('0x0')](_0xeaba('0x1'),{'body':_0x189cb8,'log':_0xeaba('0x1')});};exports[_0xeaba('0x2')]=function(_0x291b53,_0x72b876){return client[_0xeaba('0x0')](_0xeaba('0x3'),{'body':_0x72b876,'options':{'where':{'uniqueid':_0x291b53},'order':[['id',_0xeaba('0x4')]],'limit':0x1},'log':_0xeaba('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 63cdf60..582e7d1 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 _0x41f2=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41f2,0x14f));var _0x241f=function(_0x41341c,_0x51f9fa){_0x41341c=_0x41341c-0x0;var _0x23d163=_0x41f2[_0x41341c];return _0x23d163;};'use strict';var client=require(_0x241f('0x0'));exports[_0x241f('0x1')]=function(_0x5736b8,_0x462fef){return client[_0x241f('0x2')](_0x241f('0x3'),{'body':_0x462fef,'options':{'where':{'id':_0x5736b8}},'log':_0x241f('0x4')});};exports['addTags']=function(_0x1a7e43,_0x106ee3){return client['Request'](_0x241f('0x5'),{'body':_0x106ee3,'options':{'where':{'id':_0x1a7e43}},'log':_0x241f('0x6')});}; \ No newline at end of file +var _0x98a8=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x1346a2,_0xb75071){var _0x5d83d3=function(_0x2f8cbf){while(--_0x2f8cbf){_0x1346a2['push'](_0x1346a2['shift']());}};_0x5d83d3(++_0xb75071);}(_0x98a8,0x12c));var _0x898a=function(_0x1387fb,_0x253ce0){_0x1387fb=_0x1387fb-0x0;var _0x314f9f=_0x98a8[_0x1387fb];return _0x314f9f;};'use strict';var client=require(_0x898a('0x0'));exports[_0x898a('0x1')]=function(_0x3c1d2d,_0x4583d9){return client[_0x898a('0x2')](_0x898a('0x3'),{'body':_0x4583d9,'options':{'where':{'id':_0x3c1d2d}},'log':_0x898a('0x4')});};exports['addTags']=function(_0x2bb3e2,_0xf84a19){return client[_0x898a('0x2')](_0x898a('0x5'),{'body':_0xf84a19,'options':{'where':{'id':_0x2bb3e2}},'log':_0x898a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index eb74d95..6d1215c 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 _0x0a74=['create','Request','../client'];(function(_0x48f106,_0x26405c){var _0x561294=function(_0x1d6968){while(--_0x1d6968){_0x48f106['push'](_0x48f106['shift']());}};_0x561294(++_0x26405c);}(_0x0a74,0x1ac));var _0x40a7=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x0a74[_0x4456a2];return _0xf36b56;};'use strict';var client=require(_0x40a7('0x0'));exports[_0x40a7('0x1')]=function(_0x5614b8){return client[_0x40a7('0x2')]('CreateSmsMessage',{'body':_0x5614b8,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x5252=['Request','CreateSmsMessage','../client'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x5252,0x11c));var _0x2525=function(_0x230189,_0x58be4a){_0x230189=_0x230189-0x0;var _0x53ac60=_0x5252[_0x230189];return _0x53ac60;};'use strict';var client=require(_0x2525('0x0'));exports['create']=function(_0x463074){return client[_0x2525('0x1')](_0x2525('0x2'),{'body':_0x463074,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index ce0745e..1c618c0 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x37c7c0,_0x49fde0){var _0x2021d0=function(_0x38344e){while(--_0x38344e){_0x37c7c0['push'](_0x37c7c0['shift']());}};_0x2021d0(++_0x49fde0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5c1044,_0xe41ad8){var _0x37e398=function(_0x33598c){while(--_0x33598c){_0x5c1044['push'](_0x5c1044['shift']());}};_0x37e398(++_0xe41ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'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 d4048a3..1006da5 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(_0x3b74fb,_0x68a121){var _0x144977=function(_0x20eac5){while(--_0x20eac5){_0x3b74fb['push'](_0x3b74fb['shift']());}};_0x144977(++_0x68a121);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0xedd9,0xfc));var _0x9edd=function(_0x497e16,_0x578572){_0x497e16=_0x497e16-0x0;var _0x1d8936=_0xedd9[_0x497e16];return _0x1d8936;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4dd5a36..35e9abf 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(_0x3d208c,_0x489cc3){var _0x4789c0=function(_0x1219c3){while(--_0x1219c3){_0x3d208c['push'](_0x3d208c['shift']());}};_0x4789c0(++_0x489cc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x3f8081,_0x1b91ca){var _0x2d3f81=function(_0x32cdda){while(--_0x32cdda){_0x3f8081['push'](_0x3f8081['shift']());}};_0x2d3f81(++_0x1b91ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 d34e372..9a03daa 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 _0x4f0d=['addTags','addTagsToWhatsappInteraction','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5f124a,_0x34e5d2){var _0x3717c1=function(_0x16e713){while(--_0x16e713){_0x5f124a['push'](_0x5f124a['shift']());}};_0x3717c1(++_0x34e5d2);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x4f0d[_0x191154];return _0x3dcd73;};'use strict';var client=require('../client');exports['update']=function(_0x4c1091,_0x5290b6){return client['Request'](_0xd4f0('0x0'),{'body':_0x5290b6,'options':{'where':{'id':_0x4c1091}},'log':_0xd4f0('0x1')});};exports[_0xd4f0('0x2')]=function(_0x577c8f,_0xb1db5){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xb1db5,'options':{'where':{'id':_0x577c8f}},'log':_0xd4f0('0x3')});}; \ No newline at end of file +var _0x66c7=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x22ac78,_0xea761e){var _0x4587c2=function(_0x33ab2b){while(--_0x33ab2b){_0x22ac78['push'](_0x22ac78['shift']());}};_0x4587c2(++_0xea761e);}(_0x66c7,0x15c));var _0x766c=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x66c7[_0x172ed7];return _0xfa8f61;};'use strict';var client=require(_0x766c('0x0'));exports[_0x766c('0x1')]=function(_0x576b0a,_0x4c9f46){return client[_0x766c('0x2')](_0x766c('0x3'),{'body':_0x4c9f46,'options':{'where':{'id':_0x576b0a}},'log':_0x766c('0x4')});};exports[_0x766c('0x5')]=function(_0x1b2a8e,_0x2b4c75){return client['Request'](_0x766c('0x6'),{'body':_0x2b4c75,'options':{'where':{'id':_0x1b2a8e}},'log':_0x766c('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index a3900a5..41f5334 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 _0x6683=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x6683,0x129));var _0x3668=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x6683[_0x154940];return _0x401409;};'use strict';var client=require(_0x3668('0x0'));exports[_0x3668('0x1')]=function(_0x2eb547){return client[_0x3668('0x2')](_0x3668('0x3'),{'body':_0x2eb547,'log':_0x3668('0x4')});}; \ No newline at end of file +var _0x2782=['createWhatsappMessage','../client','create','Request'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0x2782,0x91));var _0x2278=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x2782[_0x337748];return _0x3bb03f;};'use strict';var client=require(_0x2278('0x0'));exports[_0x2278('0x1')]=function(_0xe09781){return client[_0x2278('0x2')]('CreateWhatsappMessage',{'body':_0xe09781,'log':_0x2278('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 71df314..6e36cae 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 _0xba79=['getWhatsappQueues','../client','Request','GetWhatsappQueue','name','User','Agents','whatsappPause'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xba79,0x101));var _0x9ba7=function(_0x2d6ab8,_0x1b6b82){_0x2d6ab8=_0x2d6ab8-0x0;var _0x339c56=_0xba79[_0x2d6ab8];return _0x339c56;};'use strict';var client=require(_0x9ba7('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x9ba7('0x1')](_0x9ba7('0x2'),{'options':{'raw':![],'attributes':['id',_0x9ba7('0x3'),'timeout','strategy'],'include':[{'model':_0x9ba7('0x4'),'as':_0x9ba7('0x5'),'attributes':['id','name','online',_0x9ba7('0x6')]}]},'log':_0x9ba7('0x7')});};}; \ No newline at end of file +var _0x9f0d=['User','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x1c7fb7,_0x5c9b3b){var _0x4d145f=function(_0xf29258){while(--_0xf29258){_0x1c7fb7['push'](_0x1c7fb7['shift']());}};_0x4d145f(++_0x5c9b3b);}(_0x9f0d,0x133));var _0xd9f0=function(_0x5e8ad6,_0x13d864){_0x5e8ad6=_0x5e8ad6-0x0;var _0x19883f=_0x9f0d[_0x5e8ad6];return _0x19883f;};'use strict';var client=require('../client');exports[_0xd9f0('0x0')]=function(){return function(){return client[_0xd9f0('0x1')](_0xd9f0('0x2'),{'options':{'raw':![],'attributes':['id',_0xd9f0('0x3'),_0xd9f0('0x4'),'strategy'],'include':[{'model':_0xd9f0('0x5'),'as':'Agents','attributes':['id',_0xd9f0('0x3'),_0xd9f0('0x6'),_0xd9f0('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 6614559..6d726ce 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 _0xd815=['../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x4f48a7,_0x19156d){var _0x38c82a=function(_0x4caa2d){while(--_0x4caa2d){_0x4f48a7['push'](_0x4f48a7['shift']());}};_0x38c82a(++_0x19156d);}(_0xd815,0x177));var _0x5d81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd815[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5d81('0x0'));exports[_0x5d81('0x1')]=function(_0x27eab8){return client[_0x5d81('0x2')](_0x5d81('0x3'),{'body':_0x27eab8,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x1d1792,_0x2eac82){return client[_0x5d81('0x2')](_0x5d81('0x4'),{'body':_0x2eac82,'options':{'where':{'uniqueid':_0x1d1792},'order':[['id','DESC']],'limit':0x1},'log':_0x5d81('0x4')});}; \ No newline at end of file +var _0x0081=['UpdateWhatsappQueueReport','DESC','create','CreateWhatsappQueueReport','Request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0081,0x142));var _0x1008=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0081[_0xf50820];return _0x2a9b10;};'use strict';var client=require('../client');exports[_0x1008('0x0')]=function(_0x2fac4c){return client['Request'](_0x1008('0x1'),{'body':_0x2fac4c,'log':_0x1008('0x1')});};exports['update']=function(_0x4e4d46,_0x404888){return client[_0x1008('0x2')](_0x1008('0x3'),{'body':_0x404888,'options':{'where':{'uniqueid':_0x4e4d46},'order':[['id',_0x1008('0x4')]],'limit':0x1},'log':_0x1008('0x3')});}; \ 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 787c746..66fa99b 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 _0x15c9=['atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','error','stack','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue'];(function(_0x590ef7,_0x175f08){var _0x4c2634=function(_0xf94570){while(--_0xf94570){_0x590ef7['push'](_0x590ef7['shift']());}};_0x4c2634(++_0x175f08);}(_0x15c9,0xcc));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x915c('0x0'));var seqqueue=require(_0x915c('0x1'));var logger=require(_0x915c('0x2'))(_0x915c('0x3'));var strategy=require(_0x915c('0x4'));var queue=schema({'name':{'type':_0x915c('0x5'),'required':!![],'message':_0x915c('0x6')},'timeout':{'type':_0x915c('0x7'),'message':_0x915c('0x8')}});function writeLog(_0x22aa78,_0x19be1b,_0x21169d){return logger[_0x915c('0x9')](util[_0x915c('0xa')](_0x915c('0xb'),_0x22aa78,_0x19be1b[_0x915c('0xc')],_0x21169d));}function handleFindAgent(_0x3b2a9c){return function(_0x55a31a){return _0x55a31a[_0x915c('0xc')]['toLowerCase']()===_0x3b2a9c[_0x915c('0xd')]();};}exports[_0x915c('0xe')]=function(_0x40e079,_0x180b8d,_0x1e785,_0x1536ee){return function(_0x5df353){try{var _0x4ada8f={'name':_0x180b8d[0x0],'timeout':_0x180b8d[0x1]};var _0x3b08e3=queue[_0x915c('0xf')](_0x4ada8f,{'typecast':!![]});if(_0x3b08e3['length']){logger['error'](_0x915c('0x10'),_0x40e079,_[_0x915c('0x11')](_0x3b08e3,_0x915c('0x12'))[_0x915c('0x13')](',\x20'));_0x5df353[_0x915c('0x14')]();}else{var _0x593ffb=_['find'](_0x1e785[_0x915c('0x15')],handleFindAgent(_0x4ada8f['name']));if(_0x593ffb){var _0x26407e=(_0x4ada8f[_0x915c('0x16')]||0xa)*0x3e8;var _0x5d0689,_0x40372f;var _0x10afb6=seqqueue[_0x915c('0x17')](_0x26407e);_0x10afb6['id']=_0x40e079;_0x10afb6[_0x915c('0x18')]=_0x26407e;_0x10afb6['channel']=_0x1536ee[_0x915c('0x19')];writeLog(_0x40e079,_0x593ffb,util[_0x915c('0xa')](_0x915c('0x1a'),_0x26407e));_0x1e785[_0x915c('0x1b')][_0x40e079]['on'](_0x915c('0x1c'),function(){logger[_0x915c('0x9')](_0x915c('0x1d'),_0x40e079);clearTimeout(_0x40372f);_0x40372f=undefined;_0x10afb6[_0x915c('0x1e')]();if(_0x1e785['rules'][_0x40e079]){delete _0x1e785[_0x915c('0x1b')][_0x40e079];}_0x5df353['stop']();});_0x1e785[_0x915c('0x1b')][_0x40e079]['on'](_0x915c('0x1f'),function(){if(_0x1e785[_0x915c('0x1b')][_0x40e079]){delete _0x1e785['rules'][_0x40e079];}});_0x40372f=setTimeout(function(){logger[_0x915c('0x9')](_0x915c('0x20'),_0x40e079);clearTimeout(_0x40372f);_0x10afb6[_0x915c('0x1e')]();_0x5df353[_0x915c('0x21')]();},_0x26407e);strategy[_0x915c('0x22')](_0x10afb6,_0x593ffb,_0x1e785,_0x1536ee);}else{logger['error'](_0x915c('0x23'),_0x40e079,_0x4ada8f[_0x915c('0xc')]);_0x5df353['stop']();}}}catch(_0x1e5452){console['log'](_0x1e5452);logger[_0x915c('0x24')]('[%s][QUEUE]\x20%s',_0x40e079,_0x1e5452[_0x915c('0x25')]);_0x5df353['stop']();}};}; \ No newline at end of file +var _0xb3b5=['timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x28c308,_0x46a169){var _0x3c95f7=function(_0x48adb9){while(--_0x48adb9){_0x28c308['push'](_0x28c308['shift']());}};_0x3c95f7(++_0x46a169);}(_0xb3b5,0x1cd));var _0x5b3b=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0xb3b5[_0x183b97];return _0x629cf7;};'use strict';var schema=require(_0x5b3b('0x0'));var _=require(_0x5b3b('0x1'));var util=require(_0x5b3b('0x2'));var seqqueue=require(_0x5b3b('0x3'));var logger=require(_0x5b3b('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x5b3b('0x5')},'timeout':{'type':_0x5b3b('0x6'),'message':_0x5b3b('0x7')}});function writeLog(_0x9ed97e,_0x371dae,_0xb16dd6){return logger[_0x5b3b('0x8')](util[_0x5b3b('0x9')](_0x5b3b('0xa'),_0x9ed97e,_0x371dae['name'],_0xb16dd6));}function handleFindAgent(_0x2ad992){return function(_0x98fe4c){return _0x98fe4c[_0x5b3b('0xb')][_0x5b3b('0xc')]()===_0x2ad992['toLowerCase']();};}exports[_0x5b3b('0xd')]=function(_0x2b01da,_0x425c74,_0xc38ad1,_0xf16c7a){return function(_0xd43c2b){try{var _0x2b9c56={'name':_0x425c74[0x0],'timeout':_0x425c74[0x1]};var _0x5cf2e6=queue[_0x5b3b('0x0')](_0x2b9c56,{'typecast':!![]});if(_0x5cf2e6[_0x5b3b('0xe')]){logger['error'](_0x5b3b('0xf'),_0x2b01da,_[_0x5b3b('0x10')](_0x5cf2e6,_0x5b3b('0x11'))[_0x5b3b('0x12')](',\x20'));_0xd43c2b[_0x5b3b('0x13')]();}else{var _0x4e4565=_[_0x5b3b('0x14')](_0xc38ad1[_0x5b3b('0x15')],handleFindAgent(_0x2b9c56[_0x5b3b('0xb')]));if(_0x4e4565){var _0x4c157e=(_0x2b9c56[_0x5b3b('0x16')]||0xa)*0x3e8;var _0x40b7e3,_0x2c8462;var _0x37fd8b=seqqueue[_0x5b3b('0x17')](_0x4c157e);_0x37fd8b['id']=_0x2b01da;_0x37fd8b['atimeout']=_0x4c157e;_0x37fd8b[_0x5b3b('0x18')]=_0xf16c7a[_0x5b3b('0x18')];writeLog(_0x2b01da,_0x4e4565,util['format'](_0x5b3b('0x19'),_0x4c157e));_0xc38ad1[_0x5b3b('0x1a')][_0x2b01da]['on'](_0x5b3b('0x1b'),function(){logger[_0x5b3b('0x8')](_0x5b3b('0x1c'),_0x2b01da);clearTimeout(_0x2c8462);_0x2c8462=undefined;_0x37fd8b[_0x5b3b('0x1d')]();if(_0xc38ad1[_0x5b3b('0x1a')][_0x2b01da]){delete _0xc38ad1['rules'][_0x2b01da];}_0xd43c2b[_0x5b3b('0x13')]();});_0xc38ad1[_0x5b3b('0x1a')][_0x2b01da]['on'](_0x5b3b('0x1e'),function(){if(_0xc38ad1[_0x5b3b('0x1a')][_0x2b01da]){delete _0xc38ad1[_0x5b3b('0x1a')][_0x2b01da];}});_0x2c8462=setTimeout(function(){logger[_0x5b3b('0x8')](_0x5b3b('0x1f'),_0x2b01da);clearTimeout(_0x2c8462);_0x37fd8b[_0x5b3b('0x1d')]();_0xd43c2b[_0x5b3b('0x20')]();},_0x4c157e);strategy[_0x5b3b('0x21')](_0x37fd8b,_0x4e4565,_0xc38ad1,_0xf16c7a);}else{logger[_0x5b3b('0x22')](_0x5b3b('0x23'),_0x2b01da,_0x2b9c56[_0x5b3b('0xb')]);_0xd43c2b[_0x5b3b('0x13')]();}}}catch(_0x305ffb){console[_0x5b3b('0x24')](_0x305ffb);logger[_0x5b3b('0x22')](_0x5b3b('0x25'),_0x2b01da,_0x305ffb[_0x5b3b('0x26')]);_0xd43c2b[_0x5b3b('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 c36b34e..9b8f7ea 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 _0x1c63=['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','postText','amazonlex','providerName','providerResponse','Message','dialogState','Failed','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','InteractionId','isEmpty','body','getMustacheRender','create','then','catch','error','stringify'];(function(_0x1ca12d,_0x2bb976){var _0x3dc560=function(_0x237ce2){while(--_0x237ce2){_0x1ca12d['push'](_0x1ca12d['shift']());}};_0x3dc560(++_0x2bb976);}(_0x1c63,0x134));var _0x31c6=function(_0x58dc03,_0x1c0b28){_0x58dc03=_0x58dc03-0x0;var _0x2f14bb=_0x1c63[_0x58dc03];return _0x2f14bb;};'use strict';var _=require('lodash');var moment=require(_0x31c6('0x0'));var AWS=require(_0x31c6('0x1'));var utils=require(_0x31c6('0x2'));var logger=require('../../../../config/logger')(_0x31c6('0x3'));var rpc={'chatMessage':require(_0x31c6('0x4')),'openchannelMessage':require(_0x31c6('0x5')),'mailMessage':require(_0x31c6('0x6')),'smsMessage':require(_0x31c6('0x7')),'faxMessage':require(_0x31c6('0x8')),'whatsappMessage':require(_0x31c6('0x9'))};exports[_0x31c6('0xa')]=function(_0x2c82f0,_0x39c6cb){return function(_0x4accb5){try{if(!_['isNil'](this[_0x31c6('0xb')][_0x31c6('0xc')])){logger[_0x31c6('0xd')](_0x31c6('0xe'),_0x2c82f0,_0x31c6('0xf'));return _0x4accb5[_0x31c6('0x10')]();}var _0x3edebb={'ContactId':this[_0x31c6('0x11')]['id'],'sentAt':moment()[_0x31c6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x31c6('0x13')||this['channel']===_0x31c6('0x14')){_0x3edebb[_0x31c6('0x15')]=this['interaction']['phone'];}var _0x58664e=this[_0x31c6('0x16')];if(_0x58664e===_0x31c6('0x17')){_0x3edebb[_0x31c6('0x18')]=this[_0x31c6('0x19')]['id'];}else{_0x3edebb[_['upperFirst'](_0x58664e)+'AccountId']=this[_0x31c6('0x19')]['id'];}_0x3edebb[_['upperFirst'](_0x58664e)+_0x31c6('0x1a')]=this[_0x31c6('0xb')]['id'];if(this[_0x31c6('0xb')]['created']){var _0x29bc41=_0x39c6cb[0x4];if(!_[_0x31c6('0x1b')](_0x29bc41)){_0x3edebb[_0x31c6('0x1c')]=utils[_0x31c6('0x1d')](_0x29bc41,this);return rpc[_0x58664e+'Message'][_0x31c6('0x1e')](_0x3edebb)[_0x31c6('0x1f')](function(_0xe4f51){logger[_0x31c6('0xd')](_0x31c6('0xe'),_0x2c82f0,_0x3edebb[_0x31c6('0x1c')]);})[_0x31c6('0x20')](function(_0x520e8c){logger[_0x31c6('0x21')](_0x31c6('0xe'),_0x2c82f0,JSON[_0x31c6('0x22')](_0x520e8c));})[_0x31c6('0x23')](function(){logger[_0x31c6('0xd')](_0x31c6('0x24'),_0x2c82f0);_0x4accb5[_0x31c6('0x25')]();});}else{logger[_0x31c6('0xd')](_0x31c6('0x26'),_0x2c82f0);_0x4accb5[_0x31c6('0x25')]();}}else{var _0x3d3dcb=this;var _0x1b81c5=new AWS[(_0x31c6('0x27'))]({'accessKeyId':_0x39c6cb[0x0],'secretAccessKey':_0x39c6cb[0x1],'region':_0x39c6cb[0x2]});var _0x53469f={'botAlias':_0x31c6('0x28'),'botName':_0x39c6cb[0x3],'inputText':this[_0x31c6('0x29')][_0x31c6('0x1c')],'userId':this[_0x31c6('0x16')]+':'+this[_0x31c6('0xb')]['id']['toString']()};_0x1b81c5[_0x31c6('0x2a')](_0x53469f,function(_0x4f4c3c,_0x7aed75){if(_0x4f4c3c){logger[_0x31c6('0x21')](_0x31c6('0xe'),_0x2c82f0,_0x4f4c3c[_0x31c6('0x29')]);_0x4accb5[_0x31c6('0x10')]();}else if(_0x7aed75&&_0x7aed75[_0x31c6('0x29')]){_0x3d3dcb[_0x31c6('0x1c')][_0x31c6('0x2b')]=_0x7aed75;_0x3edebb[_0x31c6('0x1c')]=_0x7aed75[_0x31c6('0x29')];_0x3edebb[_0x31c6('0x2c')]=_0x31c6('0x2b');_0x3edebb[_0x31c6('0x2d')]=JSON[_0x31c6('0x22')](_0x7aed75);return rpc[_0x58664e+_0x31c6('0x2e')][_0x31c6('0x1e')](_0x3edebb)[_0x31c6('0x1f')](function(_0x1f14d1){logger['info'](_0x31c6('0xe'),_0x2c82f0,_0x3edebb[_0x31c6('0x1c')]);if(_0x7aed75[_0x31c6('0x2f')]==_0x31c6('0x30')){_0x4accb5[_0x31c6('0x10')]();}else{_0x4accb5['stop']();}})[_0x31c6('0x20')](function(_0x11bedb){logger[_0x31c6('0x21')](_0x31c6('0xe'),_0x2c82f0,JSON[_0x31c6('0x22')](_0x11bedb));_0x4accb5[_0x31c6('0x10')]();});}else{_0x4accb5['next']();}});}}catch(_0xee6a0a){logger['error'](_0x31c6('0xe'),_0x2c82f0,JSON[_0x31c6('0x22')](_0xee6a0a));_0x4accb5[_0x31c6('0x25')]();}};}; \ No newline at end of file +var _0xe6dd=['stringify','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','info','[%s][AMAZONLEX]\x20%s','catch','error','finally','stop','LexRuntime','message','toString','amazonlex','providerResponse','dialogState','Failed'];(function(_0x308681,_0x282762){var _0x203d53=function(_0x3deb20){while(--_0x3deb20){_0x308681['push'](_0x308681['shift']());}};_0x203d53(++_0x282762);}(_0xe6dd,0xc5));var _0xde6d=function(_0x532cbe,_0x11d689){_0x532cbe=_0x532cbe-0x0;var _0x167255=_0xe6dd[_0x532cbe];return _0x167255;};'use strict';var _=require(_0xde6d('0x0'));var moment=require(_0xde6d('0x1'));var AWS=require(_0xde6d('0x2'));var utils=require(_0xde6d('0x3'));var logger=require(_0xde6d('0x4'))(_0xde6d('0x5'));var rpc={'chatMessage':require(_0xde6d('0x6')),'openchannelMessage':require(_0xde6d('0x7')),'mailMessage':require(_0xde6d('0x8')),'smsMessage':require(_0xde6d('0x9')),'faxMessage':require(_0xde6d('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xde6d('0xb')]=function(_0x2bee8f,_0x522400){return function(_0x2f0bd5){try{if(!_[_0xde6d('0xc')](this[_0xde6d('0xd')][_0xde6d('0xe')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x2bee8f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2f0bd5[_0xde6d('0xf')]();}var _0xf244a1={'ContactId':this[_0xde6d('0x10')]['id'],'sentAt':moment()['format'](_0xde6d('0x11')),'direction':_0xde6d('0x12')};if(this['channel']===_0xde6d('0x13')||this['channel']===_0xde6d('0x14')){_0xf244a1['phone']=this[_0xde6d('0xd')][_0xde6d('0x15')];}var _0x35f18a=this[_0xde6d('0x16')];if(_0x35f18a===_0xde6d('0x17')){_0xf244a1[_0xde6d('0x18')]=this[_0xde6d('0x19')]['id'];}else{_0xf244a1[_[_0xde6d('0x1a')](_0x35f18a)+_0xde6d('0x1b')]=this[_0xde6d('0x19')]['id'];}_0xf244a1[_['upperFirst'](_0x35f18a)+_0xde6d('0x1c')]=this[_0xde6d('0xd')]['id'];if(this[_0xde6d('0xd')]['created']){var _0x2edacb=_0x522400[0x4];if(!_[_0xde6d('0x1d')](_0x2edacb)){_0xf244a1[_0xde6d('0x1e')]=utils[_0xde6d('0x1f')](_0x2edacb,this);return rpc[_0x35f18a+_0xde6d('0x20')][_0xde6d('0x21')](_0xf244a1)[_0xde6d('0x22')](function(_0x15beab){logger[_0xde6d('0x23')](_0xde6d('0x24'),_0x2bee8f,_0xf244a1[_0xde6d('0x1e')]);})[_0xde6d('0x25')](function(_0x2b4d03){logger[_0xde6d('0x26')](_0xde6d('0x24'),_0x2bee8f,JSON['stringify'](_0x2b4d03));})[_0xde6d('0x27')](function(){logger[_0xde6d('0x23')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2bee8f);_0x2f0bd5[_0xde6d('0x28')]();});}else{logger[_0xde6d('0x23')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2bee8f);_0x2f0bd5['stop']();}}else{var _0x414a40=this;var _0x11d020=new AWS[(_0xde6d('0x29'))]({'accessKeyId':_0x522400[0x0],'secretAccessKey':_0x522400[0x1],'region':_0x522400[0x2]});var _0x52e083={'botAlias':'$LATEST','botName':_0x522400[0x3],'inputText':this[_0xde6d('0x2a')][_0xde6d('0x1e')],'userId':this['channel']+':'+this[_0xde6d('0xd')]['id'][_0xde6d('0x2b')]()};_0x11d020['postText'](_0x52e083,function(_0x4ea38c,_0x39f66a){if(_0x4ea38c){logger[_0xde6d('0x26')](_0xde6d('0x24'),_0x2bee8f,_0x4ea38c[_0xde6d('0x2a')]);_0x2f0bd5[_0xde6d('0xf')]();}else if(_0x39f66a&&_0x39f66a[_0xde6d('0x2a')]){_0x414a40[_0xde6d('0x1e')][_0xde6d('0x2c')]=_0x39f66a;_0xf244a1[_0xde6d('0x1e')]=_0x39f66a[_0xde6d('0x2a')];_0xf244a1['providerName']=_0xde6d('0x2c');_0xf244a1[_0xde6d('0x2d')]=JSON['stringify'](_0x39f66a);return rpc[_0x35f18a+'Message'][_0xde6d('0x21')](_0xf244a1)[_0xde6d('0x22')](function(_0x5ec581){logger[_0xde6d('0x23')](_0xde6d('0x24'),_0x2bee8f,_0xf244a1[_0xde6d('0x1e')]);if(_0x39f66a[_0xde6d('0x2e')]==_0xde6d('0x2f')){_0x2f0bd5[_0xde6d('0xf')]();}else{_0x2f0bd5[_0xde6d('0x28')]();}})['catch'](function(_0x4c9c76){logger[_0xde6d('0x26')]('[%s][AMAZONLEX]\x20%s',_0x2bee8f,JSON[_0xde6d('0x30')](_0x4c9c76));_0x2f0bd5[_0xde6d('0xf')]();});}else{_0x2f0bd5[_0xde6d('0xf')]();}});}}catch(_0x296221){logger[_0xde6d('0x26')](_0xde6d('0x24'),_0x2bee8f,JSON['stringify'](_0x296221));_0x2f0bd5[_0xde6d('0x28')]();}};}; \ 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 cf6c3ac..3091e2d 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 _0xef38=['../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','InteractionId','Message','Smtp','service','account','host','port','secure','pass','inReplyTo','','','headers','auto-replied','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','then','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x32d8a4,_0x5436c8){var _0x30e62c=function(_0x20fbc6){while(--_0x20fbc6){_0x32d8a4['push'](_0x32d8a4['shift']());}};_0x30e62c(++_0x5436c8);}(_0xef38,0x16f));var _0x8ef3=function(_0x5e009f,_0xa51ac5){_0x5e009f=_0x5e009f-0x0;var _0x7e50a0=_0xef38[_0x5e009f];return _0x7e50a0;};'use strict';var _=require('lodash');var moment=require(_0x8ef3('0x0'));var utils=require(_0x8ef3('0x1'));var logger=require(_0x8ef3('0x2'))('routing');var rpc={'chatMessage':require(_0x8ef3('0x3')),'openchannelMessage':require(_0x8ef3('0x4')),'mailMessage':require(_0x8ef3('0x5')),'smsMessage':require(_0x8ef3('0x6')),'faxMessage':require(_0x8ef3('0x7')),'whatsappMessage':require(_0x8ef3('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8ef3('0x9')),'mailInteraction':require(_0x8ef3('0xa')),'smsInteraction':require(_0x8ef3('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x8ef3('0xc'))};var mailRpc=require(_0x8ef3('0xd'));exports[_0x8ef3('0xe')]=function(_0x5cc0ef,_0x160389,_0x1453ff,_0xe417f1){return function(_0x115ecc){try{var _0x2eea1c=this[_0x8ef3('0xf')];if(_0x2eea1c===_0x8ef3('0x10')&&_0xe417f1[_0x8ef3('0x11')][_0x8ef3('0x12')]){logger['info'](_0x8ef3('0x13'),_0x5cc0ef,_0x8ef3('0x14'));return _0x115ecc[_0x8ef3('0x15')]();}if(_0x160389[0x0]==='1'&&(_[_0x8ef3('0x16')](this[_0x8ef3('0x17')]['created'])||!this['interaction'][_0x8ef3('0x18')])){logger[_0x8ef3('0x19')]('[%s][AUTOREPLY]\x20%s',_0x5cc0ef,_0x8ef3('0x1a'));return _0x115ecc[_0x8ef3('0x15')]();}if(_0x160389[0x0]==='2'&&this[_0x8ef3('0x17')]['autoreplyExecuted']){logger[_0x8ef3('0x19')](_0x8ef3('0x1b'),_0x5cc0ef,_0x8ef3('0x1c'));return _0x115ecc['next']();}var _0x2184f2={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8ef3('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x8ef3('0x1e')};if(this[_0x8ef3('0xf')]===_0x8ef3('0x10')){_0x2184f2[_0x8ef3('0x11')]=utils['getMustacheRender'](_0x160389[0x2],this);}else{_0x2184f2['body']=utils[_0x8ef3('0x1f')](_0x160389[0x1],this);}if(this[_0x8ef3('0x20')]){_0x2184f2['to']=this[_0x8ef3('0x20')][_0x8ef3('0x21')]||'';if(this[_0x8ef3('0xf')]===_0x8ef3('0x10')&&_0x160389[0x1]==='1'){_0x2184f2['cc']=this[_0x8ef3('0x20')]['cc']||'';}_0x2184f2['from']=this['message']['to']||'';_0x2184f2[_0x8ef3('0x22')]=this[_0x8ef3('0x20')][_0x8ef3('0x22')]||'';_0x2184f2['read']=!![];if(this[_0x8ef3('0x20')]['subject']){_0x2184f2[_0x8ef3('0x23')]='';_0x2184f2[_0x8ef3('0x23')]+=_[_0x8ef3('0x24')](this[_0x8ef3('0x20')]['subject'],_0x8ef3('0x25'))?'':_0x8ef3('0x26');_0x2184f2[_0x8ef3('0x23')]+=this[_0x8ef3('0x20')][_0x8ef3('0x23')];}}if(this[_0x8ef3('0xf')]===_0x8ef3('0x27')){_0x2184f2[_0x8ef3('0x28')]=this['account']['id'];}else{_0x2184f2[_['upperFirst'](this[_0x8ef3('0xf')])+'AccountId']=this['account']['id'];}_0x2184f2[_[_0x8ef3('0x29')](this[_0x8ef3('0xf')])+_0x8ef3('0x2a')]=this[_0x8ef3('0x17')]['id'];var _0x41fc7b=this['interaction'];if(rpc[this[_0x8ef3('0xf')]+_0x8ef3('0x2b')]){if(this[_0x8ef3('0xf')]===_0x8ef3('0x10')){var _0x20537e={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x8ef3('0x2c')]['service']){_0x20537e[_0x8ef3('0x2d')]=this[_0x8ef3('0x2e')][_0x8ef3('0x2c')]['service'];}else{_0x20537e[_0x8ef3('0x2f')]=this[_0x8ef3('0x2e')]['Smtp']['host'];_0x20537e[_0x8ef3('0x30')]=this[_0x8ef3('0x2e')]['Smtp'][_0x8ef3('0x30')];_0x20537e[_0x8ef3('0x31')]=this[_0x8ef3('0x2e')]['Smtp']['secure'];}if(this['account'][_0x8ef3('0x2c')]['authentication']){_0x20537e['auth']={'user':this['account'][_0x8ef3('0x2c')]['user'],'pass':this[_0x8ef3('0x2e')][_0x8ef3('0x2c')][_0x8ef3('0x32')]};}_0x2184f2[_0x8ef3('0x33')]=this[_0x8ef3('0x20')]['messageId'];_0x2184f2['html']=_0x8ef3('0x34')+_['replace'](_0x2184f2[_0x8ef3('0x11')],_0x8ef3('0x35'),_0x8ef3('0x36'))+_0x8ef3('0x37');_0x2184f2[_0x8ef3('0x38')]={'Auto-Submitted':_0x8ef3('0x39'),'X-Auto-Response-Suppress':'All','Precedence':_0x8ef3('0x3a')};return mailRpc[_0x8ef3('0x3b')](_0x20537e,_0x2184f2)['then'](function(_0x21a8c7){logger[_0x8ef3('0x19')](_0x8ef3('0x3c'),_0x5cc0ef);_0x2184f2[_0x8ef3('0x3d')]=_0x21a8c7[_0x8ef3('0x20')][_0x8ef3('0x3d')];return rpc[_0x2eea1c+_0x8ef3('0x2b')][_0x8ef3('0x3e')](_0x2184f2);})[_0x8ef3('0x3f')](function(_0x1d3398){logger[_0x8ef3('0x19')]('[%s][AUTOREPLY]\x20%s',_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x1d3398));})[_0x8ef3('0x41')](function(_0xdb3607){logger['error'](_0x8ef3('0x42'),_0x5cc0ef,JSON[_0x8ef3('0x40')](_0xdb3607));})[_0x8ef3('0x43')](function(){Promise[_0x8ef3('0x44')]()[_0x8ef3('0x3f')](function(){if(_0x160389[0x0]!=='2'||_0x41fc7b[_0x8ef3('0x45')])return;return rpc[_0x2eea1c+_0x8ef3('0x46')][_0x8ef3('0x47')](_0x41fc7b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4ec569){logger[_0x8ef3('0x19')](_0x8ef3('0x1b'),_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x4ec569));})['catch'](function(_0x2b949b){logger[_0x8ef3('0x48')](_0x8ef3('0x49'),_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x2b949b));});})['then'](function(){_0x115ecc[_0x8ef3('0x15')]();});});}else{return rpc[this['channel']+'Message']['create'](_0x2184f2)[_0x8ef3('0x3f')](function(_0x57d9c3){logger[_0x8ef3('0x19')]('[%s][AUTOREPLY]\x20%s',_0x5cc0ef,_0x2184f2[_0x8ef3('0x11')]);})[_0x8ef3('0x41')](function(_0xc6367e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x5cc0ef,JSON[_0x8ef3('0x40')](_0xc6367e));})[_0x8ef3('0x43')](function(){Promise[_0x8ef3('0x44')]()[_0x8ef3('0x3f')](function(){if(_0x160389[0x0]!=='2'||_0x41fc7b[_0x8ef3('0x45')])return;return rpc[_0x2eea1c+'Interaction'][_0x8ef3('0x47')](_0x41fc7b['id'],{'autoreplyExecuted':!![]})[_0x8ef3('0x3f')](function(_0x46f8f9){logger[_0x8ef3('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x46f8f9));})[_0x8ef3('0x41')](function(_0x28454e){logger[_0x8ef3('0x48')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x28454e));});})['then'](function(){_0x115ecc['next']();});});}}}catch(_0x5d971c){logger['error']('[%s][AUTOREPLY]\x20%s',_0x5cc0ef,JSON[_0x8ef3('0x40')](_0x5d971c));_0x115ecc[_0x8ef3('0x4a')]();}};}; \ No newline at end of file +var _0x7ed6=['isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','next','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','auth','pass','inReplyTo','messageId','html','','replace','','headers','auto-replied','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','finally','resolve','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','body'];(function(_0x1f8d1d,_0x1e41b9){var _0x4c59f2=function(_0x1b8d0a){while(--_0x1b8d0a){_0x1f8d1d['push'](_0x1f8d1d['shift']());}};_0x4c59f2(++_0x1e41b9);}(_0x7ed6,0x122));var _0x67ed=function(_0x436710,_0x173e1b){_0x436710=_0x436710-0x0;var _0x3b17ad=_0x7ed6[_0x436710];return _0x3b17ad;};'use strict';var _=require(_0x67ed('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x67ed('0x1'))(_0x67ed('0x2'));var rpc={'chatMessage':require(_0x67ed('0x3')),'openchannelMessage':require(_0x67ed('0x4')),'mailMessage':require(_0x67ed('0x5')),'smsMessage':require(_0x67ed('0x6')),'faxMessage':require(_0x67ed('0x7')),'whatsappMessage':require(_0x67ed('0x8')),'chatInteraction':require(_0x67ed('0x9')),'openchannelInteraction':require(_0x67ed('0xa')),'mailInteraction':require(_0x67ed('0xb')),'smsInteraction':require(_0x67ed('0xc')),'faxInteraction':require(_0x67ed('0xd')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x67ed('0xe'));exports['consequence']=function(_0xd5a838,_0x3a3c90,_0x266ef2,_0x1bc049){return function(_0x786d32){try{var _0x1ce172=this[_0x67ed('0xf')];if(_0x1ce172===_0x67ed('0x10')&&_0x1bc049[_0x67ed('0x11')][_0x67ed('0x12')]){logger[_0x67ed('0x13')](_0x67ed('0x14'),_0xd5a838,_0x67ed('0x15'));return _0x786d32['next']();}if(_0x3a3c90[0x0]==='1'&&(_[_0x67ed('0x16')](this[_0x67ed('0x17')][_0x67ed('0x18')])||!this['interaction'][_0x67ed('0x18')])){logger[_0x67ed('0x13')](_0x67ed('0x14'),_0xd5a838,'Autoreply\x20already\x20sent');return _0x786d32[_0x67ed('0x19')]();}if(_0x3a3c90[0x0]==='2'&&this['interaction'][_0x67ed('0x1a')]){logger[_0x67ed('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xd5a838,_0x67ed('0x1b'));return _0x786d32[_0x67ed('0x19')]();}var _0x37ad02={'ContactId':this[_0x67ed('0x1c')]['id'],'sentAt':moment()[_0x67ed('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x67ed('0xf')]===_0x67ed('0x10')){_0x37ad02[_0x67ed('0x11')]=utils[_0x67ed('0x1e')](_0x3a3c90[0x2],this);}else{_0x37ad02[_0x67ed('0x11')]=utils['getMustacheRender'](_0x3a3c90[0x1],this);}if(this[_0x67ed('0x1f')]){_0x37ad02['to']=this[_0x67ed('0x1f')]['from']||'';if(this['channel']==='mail'&&_0x3a3c90[0x1]==='1'){_0x37ad02['cc']=this[_0x67ed('0x1f')]['cc']||'';}_0x37ad02[_0x67ed('0x20')]=this[_0x67ed('0x1f')]['to']||'';_0x37ad02[_0x67ed('0x21')]=this[_0x67ed('0x1f')][_0x67ed('0x21')]||'';_0x37ad02[_0x67ed('0x22')]=!![];if(this[_0x67ed('0x1f')][_0x67ed('0x23')]){_0x37ad02[_0x67ed('0x23')]='';_0x37ad02[_0x67ed('0x23')]+=_[_0x67ed('0x24')](this[_0x67ed('0x1f')][_0x67ed('0x23')],_0x67ed('0x25'))?'':'Re:\x20';_0x37ad02[_0x67ed('0x23')]+=this[_0x67ed('0x1f')][_0x67ed('0x23')];}}if(this[_0x67ed('0xf')]===_0x67ed('0x26')){_0x37ad02[_0x67ed('0x27')]=this[_0x67ed('0x28')]['id'];}else{_0x37ad02[_[_0x67ed('0x29')](this['channel'])+_0x67ed('0x2a')]=this[_0x67ed('0x28')]['id'];}_0x37ad02[_['upperFirst'](this['channel'])+_0x67ed('0x2b')]=this[_0x67ed('0x17')]['id'];var _0x19b109=this[_0x67ed('0x17')];if(rpc[this[_0x67ed('0xf')]+_0x67ed('0x2c')]){if(this[_0x67ed('0xf')]===_0x67ed('0x10')){var _0x3e5099={'tls':{'rejectUnauthorized':![]}};if(this[_0x67ed('0x28')]['Smtp'][_0x67ed('0x2d')]){_0x3e5099[_0x67ed('0x2d')]=this[_0x67ed('0x28')][_0x67ed('0x2e')][_0x67ed('0x2d')];}else{_0x3e5099[_0x67ed('0x2f')]=this[_0x67ed('0x28')][_0x67ed('0x2e')][_0x67ed('0x2f')];_0x3e5099[_0x67ed('0x30')]=this['account'][_0x67ed('0x2e')][_0x67ed('0x30')];_0x3e5099[_0x67ed('0x31')]=this[_0x67ed('0x28')][_0x67ed('0x2e')]['secure'];}if(this[_0x67ed('0x28')]['Smtp']['authentication']){_0x3e5099[_0x67ed('0x32')]={'user':this[_0x67ed('0x28')][_0x67ed('0x2e')]['user'],'pass':this[_0x67ed('0x28')][_0x67ed('0x2e')][_0x67ed('0x33')]};}_0x37ad02[_0x67ed('0x34')]=this[_0x67ed('0x1f')][_0x67ed('0x35')];_0x37ad02[_0x67ed('0x36')]=_0x67ed('0x37')+_[_0x67ed('0x38')](_0x37ad02[_0x67ed('0x11')],_0x67ed('0x39'),_0x67ed('0x3a'))+_0x67ed('0x3b');_0x37ad02[_0x67ed('0x3c')]={'Auto-Submitted':_0x67ed('0x3d'),'X-Auto-Response-Suppress':'All','Precedence':_0x67ed('0x3e')};return mailRpc['sendMailMessage'](_0x3e5099,_0x37ad02)['then'](function(_0x2c7269){logger[_0x67ed('0x13')](_0x67ed('0x3f'),_0xd5a838);_0x37ad02[_0x67ed('0x35')]=_0x2c7269[_0x67ed('0x1f')][_0x67ed('0x35')];return rpc[_0x1ce172+_0x67ed('0x2c')][_0x67ed('0x40')](_0x37ad02);})[_0x67ed('0x41')](function(_0x5003c8){logger['info'](_0x67ed('0x14'),_0xd5a838,JSON[_0x67ed('0x42')](_0x5003c8));})[_0x67ed('0x43')](function(_0x5abb41){logger['error'](_0x67ed('0x44'),_0xd5a838,JSON['stringify'](_0x5abb41));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x3a3c90[0x0]!=='2'||_0x19b109[_0x67ed('0x1a')])return;return rpc[_0x1ce172+_0x67ed('0x45')][_0x67ed('0x46')](_0x19b109['id'],{'autoreplyExecuted':!![]})[_0x67ed('0x41')](function(_0x32087c){logger[_0x67ed('0x13')](_0x67ed('0x47'),_0xd5a838,JSON['stringify'](_0x32087c));})[_0x67ed('0x43')](function(_0x597085){logger['error'](_0x67ed('0x48'),_0xd5a838,JSON['stringify'](_0x597085));});})[_0x67ed('0x41')](function(){_0x786d32[_0x67ed('0x19')]();});});}else{return rpc[this[_0x67ed('0xf')]+_0x67ed('0x2c')]['create'](_0x37ad02)[_0x67ed('0x41')](function(_0x132699){logger[_0x67ed('0x13')](_0x67ed('0x14'),_0xd5a838,_0x37ad02[_0x67ed('0x11')]);})[_0x67ed('0x43')](function(_0x4cfa5f){logger[_0x67ed('0x49')](_0x67ed('0x14'),_0xd5a838,JSON['stringify'](_0x4cfa5f));})[_0x67ed('0x4a')](function(){Promise[_0x67ed('0x4b')]()[_0x67ed('0x41')](function(){if(_0x3a3c90[0x0]!=='2'||_0x19b109[_0x67ed('0x1a')])return;return rpc[_0x1ce172+'Interaction'][_0x67ed('0x46')](_0x19b109['id'],{'autoreplyExecuted':!![]})['then'](function(_0x7f4d8d){logger[_0x67ed('0x13')](_0x67ed('0x47'),_0xd5a838,JSON['stringify'](_0x7f4d8d));})['catch'](function(_0x57c009){logger[_0x67ed('0x49')](_0x67ed('0x48'),_0xd5a838,JSON[_0x67ed('0x42')](_0x57c009));});})['then'](function(){_0x786d32[_0x67ed('0x19')]();});});}}}catch(_0x217959){logger[_0x67ed('0x49')]('[%s][AUTOREPLY]\x20%s',_0xd5a838,JSON[_0x67ed('0x42')](_0x217959));_0x786d32[_0x67ed('0x4c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 7a66de9..d0cd424 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x842d=['../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction'];(function(_0x2f622e,_0x4d7a29){var _0x30bd5c=function(_0xbd8c45){while(--_0xbd8c45){_0x2f622e['push'](_0x2f622e['shift']());}};_0x30bd5c(++_0x4d7a29);}(_0x842d,0x104));var _0xd842=function(_0x3238bd,_0x4ea3ef){_0x3238bd=_0x3238bd-0x0;var _0xdc7a7e=_0x842d[_0x3238bd];return _0xdc7a7e;};'use strict';var moment=require(_0xd842('0x0'));var logger=require(_0xd842('0x1'))(_0xd842('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd842('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xd842('0x4')),'faxInteraction':require(_0xd842('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xd842('0x6')]=function(_0x5b9df3,_0x4d0328,_0x13b297,_0x25e79c){return function(_0x3ec395){try{logger[_0xd842('0x7')](_0xd842('0x8'),_0x5b9df3,_0x4d0328[0x0]);var _0x55ec4e={'closed':0x1,'closedAt':moment()[_0xd842('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xd842('0xa'),'disposition':_0x4d0328[0x0]};if(rpc[_0x25e79c[_0xd842('0xb')]+_0xd842('0xc')]){rpc[_0x25e79c['channel']+_0xd842('0xc')]['update'](_0x25e79c[_0xd842('0xd')]['id'],_0x55ec4e)[_0xd842('0xe')](function(_0x391832){logger['info'](_0xd842('0xf'),_0x5b9df3,_0x25e79c[_0xd842('0xd')]['id']);})[_0xd842('0x10')](function(_0x365dde){logger[_0xd842('0x11')](_0xd842('0x12'),_0x5b9df3,JSON[_0xd842('0x13')](_0x365dde));})[_0xd842('0x14')](function(){_0x3ec395[_0xd842('0x15')]();});}}catch(_0xd3e813){logger['error']('[%s][CLOSE]\x20%s',_0x5b9df3,JSON['stringify'](_0xd3e813));_0x3ec395[_0xd842('0x15')]();}};}; \ No newline at end of file +var _0xa0c8=['info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','error','[%s][CLOSE]\x20%s','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0xa0c8,0x10c));var _0x8a0c=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xa0c8[_0x14477e];return _0x5d4a05;};'use strict';var moment=require('moment');var logger=require(_0x8a0c('0x0'))('routing');var rpc={'chatInteraction':require(_0x8a0c('0x1')),'openchannelInteraction':require(_0x8a0c('0x2')),'smsInteraction':require(_0x8a0c('0x3')),'mailInteraction':require(_0x8a0c('0x4')),'faxInteraction':require(_0x8a0c('0x5')),'whatsappInteraction':require(_0x8a0c('0x6'))};exports[_0x8a0c('0x7')]=function(_0x31cca3,_0x31f8f7,_0x26ba2c,_0x32c4f0){return function(_0x2f6958){try{logger[_0x8a0c('0x8')](_0x8a0c('0x9'),_0x31cca3,_0x31f8f7[0x0]);var _0x48c72c={'closed':0x1,'closedAt':moment()['format'](_0x8a0c('0xa')),'closeReason':'system','disposition':_0x31f8f7[0x0]};if(rpc[_0x32c4f0[_0x8a0c('0xb')]+_0x8a0c('0xc')]){rpc[_0x32c4f0[_0x8a0c('0xb')]+_0x8a0c('0xc')][_0x8a0c('0xd')](_0x32c4f0[_0x8a0c('0xe')]['id'],_0x48c72c)[_0x8a0c('0xf')](function(_0x532179){logger[_0x8a0c('0x8')](_0x8a0c('0x10'),_0x31cca3,_0x32c4f0[_0x8a0c('0xe')]['id']);})[_0x8a0c('0x11')](function(_0x49b167){logger['error']('[%s][CLOSE]\x20%s',_0x31cca3,JSON[_0x8a0c('0x12')](_0x49b167));})[_0x8a0c('0x13')](function(){_0x2f6958[_0x8a0c('0x14')]();});}}catch(_0x184b54){logger[_0x8a0c('0x15')](_0x8a0c('0x16'),_0x31cca3,JSON[_0x8a0c('0x12')](_0x184b54));_0x2f6958['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index f14d74e..0ff0e3b 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6657=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','providerResponse','stringify','result','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0x6657,0x17f));var _0x7665=function(_0x291b7e,_0x1d92d6){_0x291b7e=_0x291b7e-0x0;var _0x502780=_0x6657[_0x291b7e];return _0x502780;};'use strict';var _=require(_0x7665('0x0'));var moment=require('moment');var apiai=require(_0x7665('0x1'));var md5=require(_0x7665('0x2'));var utils=require(_0x7665('0x3'));var logger=require(_0x7665('0x4'))('routing');var rpc={'chatMessage':require(_0x7665('0x5')),'openchannelMessage':require(_0x7665('0x6')),'mailMessage':require(_0x7665('0x7')),'smsMessage':require(_0x7665('0x8')),'faxMessage':require(_0x7665('0x9')),'whatsappMessage':require(_0x7665('0xa'))};exports[_0x7665('0xb')]=function(_0x3387d8,_0x4c0b5c){return function(_0x31da89){try{if(!_[_0x7665('0xc')](this[_0x7665('0xd')][_0x7665('0xe')])){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x7665('0x11'));return _0x31da89[_0x7665('0x12')]();}var _0x5ca72e={'ContactId':this[_0x7665('0x13')]['id'],'sentAt':moment()[_0x7665('0x14')](_0x7665('0x15')),'direction':'out'};if(this[_0x7665('0x16')]==='sms'||this[_0x7665('0x16')]===_0x7665('0x17')){_0x5ca72e['phone']=this[_0x7665('0xd')][_0x7665('0x18')];}var _0x4dd9aa=this[_0x7665('0x16')];if(_0x4dd9aa===_0x7665('0x19')){_0x5ca72e['ChatWebsiteId']=this[_0x7665('0x1a')]['id'];}else{_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1c')]=this[_0x7665('0x1a')]['id'];}_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1d')]=this[_0x7665('0xd')]['id'];if(this[_0x7665('0xd')][_0x7665('0x1e')]){var _0x334ee6=_0x4c0b5c[0x2];if(!_[_0x7665('0x1f')](_0x334ee6)){_0x5ca72e[_0x7665('0x20')]=utils[_0x7665('0x21')](_0x334ee6,this);return rpc[_0x4dd9aa+_0x7665('0x22')][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x522944){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x5ca72e['body']);})[_0x7665('0x25')](function(_0x2033a5){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON['stringify'](_0x2033a5));})[_0x7665('0x27')](function(){logger[_0x7665('0xf')](_0x7665('0x28'),_0x3387d8);_0x31da89[_0x7665('0x29')]();});}else{logger[_0x7665('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3387d8);_0x31da89[_0x7665('0x29')]();}}else{var _0x51d577=this;var _0x37be5d=apiai(_0x4c0b5c[0x0],{'language':_0x4c0b5c[0x1]||'en'});return _0x37be5d[_0x7665('0x2a')](this['message']['body'],{'sessionId':md5(this[_0x7665('0xd')]['id'])})[_0x7665('0x24')](function(_0x4a9a25){_0x51d577[_0x7665('0x20')][_0x7665('0x2b')]=_0x4a9a25;_0x5ca72e[_0x7665('0x20')]=_0x4a9a25['result']['fulfillment']['speech'];_0x5ca72e['providerName']=_0x7665('0x2b');_0x5ca72e[_0x7665('0x2c')]=JSON[_0x7665('0x2d')](_0x4a9a25);return rpc[_0x4dd9aa+'Message'][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x50bfa5){logger['info'](_0x7665('0x10'),_0x3387d8,_0x5ca72e[_0x7665('0x20')]);if(_0x4a9a25[_0x7665('0x2e')][_0x7665('0x2f')][_0x7665('0x30')]){_0x31da89[_0x7665('0x12')]();}else{_0x31da89['stop']();}})[_0x7665('0x25')](function(_0x55d046){logger['error'](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x55d046));_0x31da89[_0x7665('0x12')]();});})[_0x7665('0x25')](function(_0x264b6e){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,_0x264b6e[_0x7665('0x31')]);_0x31da89[_0x7665('0x12')]();});}}catch(_0x415cb8){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x415cb8));_0x31da89[_0x7665('0x29')]();}};}; \ No newline at end of file +var _0x3bd7=['speech','providerName','providerResponse','next','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','info','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','then','dialogflow','result','fulfillment'];(function(_0x9d16da,_0x30a0ff){var _0x21083e=function(_0x1def2e){while(--_0x1def2e){_0x9d16da['push'](_0x9d16da['shift']());}};_0x21083e(++_0x30a0ff);}(_0x3bd7,0x199));var _0x73bd=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x3bd7[_0x55d8c5];return _0x225ae5;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x73bd('0x0'));var md5=require(_0x73bd('0x1'));var utils=require(_0x73bd('0x2'));var logger=require('../../../../config/logger')(_0x73bd('0x3'));var rpc={'chatMessage':require(_0x73bd('0x4')),'openchannelMessage':require(_0x73bd('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x73bd('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x73bd('0x7'))};exports[_0x73bd('0x8')]=function(_0x4bca41,_0x38ffbb){return function(_0x4c1254){try{if(!_['isNil'](this['interaction'][_0x73bd('0x9')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4bca41,_0x73bd('0xa'));return _0x4c1254['next']();}var _0xb35c78={'ContactId':this[_0x73bd('0xb')]['id'],'sentAt':moment()[_0x73bd('0xc')](_0x73bd('0xd')),'direction':_0x73bd('0xe')};if(this[_0x73bd('0xf')]==='sms'||this[_0x73bd('0xf')]===_0x73bd('0x10')){_0xb35c78[_0x73bd('0x11')]=this[_0x73bd('0x12')][_0x73bd('0x11')];}var _0x415fc4=this['channel'];if(_0x415fc4===_0x73bd('0x13')){_0xb35c78['ChatWebsiteId']=this[_0x73bd('0x14')]['id'];}else{_0xb35c78[_[_0x73bd('0x15')](_0x415fc4)+_0x73bd('0x16')]=this[_0x73bd('0x14')]['id'];}_0xb35c78[_[_0x73bd('0x15')](_0x415fc4)+'InteractionId']=this[_0x73bd('0x12')]['id'];if(this[_0x73bd('0x12')][_0x73bd('0x17')]){var _0x3e5933=_0x38ffbb[0x2];if(!_[_0x73bd('0x18')](_0x3e5933)){_0xb35c78[_0x73bd('0x19')]=utils[_0x73bd('0x1a')](_0x3e5933,this);return rpc[_0x415fc4+_0x73bd('0x1b')][_0x73bd('0x1c')](_0xb35c78)['then'](function(_0x1e559b){logger[_0x73bd('0x1d')](_0x73bd('0x1e'),_0x4bca41,_0xb35c78[_0x73bd('0x19')]);})[_0x73bd('0x1f')](function(_0x46865b){logger[_0x73bd('0x20')](_0x73bd('0x1e'),_0x4bca41,JSON[_0x73bd('0x21')](_0x46865b));})['finally'](function(){logger[_0x73bd('0x1d')](_0x73bd('0x22'),_0x4bca41);_0x4c1254[_0x73bd('0x23')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4bca41);_0x4c1254['stop']();}}else{var _0x10b388=this;var _0x269e84=apiai(_0x38ffbb[0x0],{'language':_0x38ffbb[0x1]||'en'});return _0x269e84['textRequest'](this[_0x73bd('0x24')][_0x73bd('0x19')],{'sessionId':md5(this[_0x73bd('0x12')]['id'])})[_0x73bd('0x25')](function(_0x1e22c5){_0x10b388[_0x73bd('0x19')][_0x73bd('0x26')]=_0x1e22c5;_0xb35c78[_0x73bd('0x19')]=_0x1e22c5[_0x73bd('0x27')][_0x73bd('0x28')][_0x73bd('0x29')];_0xb35c78[_0x73bd('0x2a')]=_0x73bd('0x26');_0xb35c78[_0x73bd('0x2b')]=JSON[_0x73bd('0x21')](_0x1e22c5);return rpc[_0x415fc4+'Message']['create'](_0xb35c78)[_0x73bd('0x25')](function(_0x1903a5){logger['info'](_0x73bd('0x1e'),_0x4bca41,_0xb35c78[_0x73bd('0x19')]);if(_0x1e22c5[_0x73bd('0x27')]['metadata']['endConversation']){_0x4c1254[_0x73bd('0x2c')]();}else{_0x4c1254[_0x73bd('0x23')]();}})[_0x73bd('0x1f')](function(_0x5be8d6){logger[_0x73bd('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x4bca41,JSON[_0x73bd('0x21')](_0x5be8d6));_0x4c1254[_0x73bd('0x2c')]();});})['catch'](function(_0x4c47d4){logger[_0x73bd('0x20')](_0x73bd('0x1e'),_0x4bca41,_0x4c47d4[_0x73bd('0x24')]);_0x4c1254[_0x73bd('0x2c')]();});}}catch(_0x57ab43){logger[_0x73bd('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x4bca41,JSON[_0x73bd('0x21')](_0x57ab43));_0x4c1254[_0x73bd('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index c0f5c26..4330669 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2e5=['created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','length','fulfillmentText','all','stop','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xc2e5,0x6f));var _0x5c2e=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0xc2e5[_0x2c5255];return _0x30d0ea;};'use strict';var _=require('lodash');var dialogflow=require(_0x5c2e('0x0'));var md5=require(_0x5c2e('0x1'));var moment=require(_0x5c2e('0x2'));var Promise=require(_0x5c2e('0x3'));var logger=require(_0x5c2e('0x4'))(_0x5c2e('0x5'));var utils=require(_0x5c2e('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5c2e('0x7')),'mailMessage':require(_0x5c2e('0x8')),'smsMessage':require(_0x5c2e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5c2e('0xa'))};function createMessage(_0x5316f3,_0x3f34d9,_0x461b83,_0x11782c){return new Promise(function(_0xb70b30,_0x1ed0d6){var _0x572bc9=_[_0x5c2e('0xb')](_0x461b83);_0x572bc9[_0x5c2e('0xc')]=_0x11782c;return rpc[_0x3f34d9+_0x5c2e('0xd')][_0x5c2e('0xe')](_0x572bc9)[_0x5c2e('0xf')](function(){logger[_0x5c2e('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x5316f3,_0x572bc9[_0x5c2e('0xc')]);_0xb70b30();})[_0x5c2e('0x11')](function(_0xd5e670){logger[_0x5c2e('0x12')](_0x5c2e('0x13'),_0x5316f3,JSON[_0x5c2e('0x14')](_0xd5e670));_0x1ed0d6(_0xd5e670);});});}exports['consequence']=function(_0x1ba5ad,_0x507482){return function(_0x5dd5b4){try{if(!_[_0x5c2e('0x15')](this[_0x5c2e('0x16')][_0x5c2e('0x17')])){logger[_0x5c2e('0x10')](_0x5c2e('0x13'),_0x1ba5ad,_0x5c2e('0x18'));return _0x5dd5b4[_0x5c2e('0x19')]();}var _0x33601e={'ContactId':this[_0x5c2e('0x1a')]['id'],'sentAt':moment()[_0x5c2e('0x1b')](_0x5c2e('0x1c')),'direction':_0x5c2e('0x1d')};if(this['channel']==='sms'||this['channel']===_0x5c2e('0x1e')){_0x33601e[_0x5c2e('0x1f')]=this['interaction']['phone'];}var _0x17750f=this['channel'];if(_0x17750f===_0x5c2e('0x20')){_0x33601e['ChatWebsiteId']=this[_0x5c2e('0x21')]['id'];}else{_0x33601e[_['upperFirst'](_0x17750f)+_0x5c2e('0x22')]=this['account']['id'];}_0x33601e[_[_0x5c2e('0x23')](_0x17750f)+_0x5c2e('0x24')]=this['interaction']['id'];if(this[_0x5c2e('0x16')][_0x5c2e('0x25')]){var _0x11c755=_0x507482[0x4];if(!_[_0x5c2e('0x26')](_0x11c755)){_0x33601e[_0x5c2e('0xc')]=utils[_0x5c2e('0x27')](_0x11c755,this);return rpc[_0x17750f+_0x5c2e('0xd')]['create'](_0x33601e)[_0x5c2e('0xf')](function(_0x3e9535){logger[_0x5c2e('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1ba5ad,_0x33601e[_0x5c2e('0xc')]);})['catch'](function(_0x52e283){logger[_0x5c2e('0x12')](_0x5c2e('0x13'),_0x1ba5ad,JSON[_0x5c2e('0x14')](_0x52e283));})['finally'](function(){logger['info'](_0x5c2e('0x28'),_0x1ba5ad);_0x5dd5b4['stop']();});}else{logger[_0x5c2e('0x10')](_0x5c2e('0x29'),_0x1ba5ad);_0x5dd5b4['stop']();}}else{var _0x2e85ff=this;var _0x2de98f=_0x507482[0x2][_0x5c2e('0x2a')](/\\n/g,'\x0a');var _0x5b8b81={'credentials':{'private_key':_0x2de98f,'client_email':_0x507482[0x1]}};var _0x2e45ba=new dialogflow[(_0x5c2e('0x2b'))](_0x5b8b81);var _0x13b0d8=_0x2e45ba['sessionPath'](_0x507482[0x0],md5(_0x2e85ff[_0x5c2e('0x16')]['id']));var _0x515427={'session':_0x13b0d8,'queryInput':{'text':{'text':_0x2e85ff[_0x5c2e('0x2c')][_0x5c2e('0xc')],'languageCode':_0x507482[0x3]||'en'}}};return _0x2e45ba[_0x5c2e('0x2d')](_0x515427)['then'](function(_0xc2b38a){if(_0xc2b38a&&_0xc2b38a['length']){_0x2e85ff[_0x5c2e('0xc')]['dialogflowV2']=_0xc2b38a;var _0x3ba5b6=_0xc2b38a[0x0];var _0x4fa15=_0x3ba5b6['queryResult'][_0x5c2e('0x2e')]&&_0x3ba5b6[_0x5c2e('0x2f')]['diagnosticInfo']['fields']?_0x3ba5b6['queryResult']['diagnosticInfo'][_0x5c2e('0x30')][_0x5c2e('0x31')][_0x5c2e('0x32')]:![];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x33')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x34')];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x35')]=_0x3ba5b6['queryResult'][_0x5c2e('0x36')];_0x2e85ff['body'][_0x5c2e('0x37')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x2e')]&&_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x2e')][_0x5c2e('0x30')]?_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x2e')]['fields'][_0x5c2e('0x31')][_0x5c2e('0x32')]:![];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x38')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x39')][_0x5c2e('0x3a')];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x3b')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x39')]['displayName'];_0x2e85ff['body'][_0x5c2e('0x3c')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x39')]['isFallback'];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x3d')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x3e')];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x3f')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x40')];_0x2e85ff[_0x5c2e('0xc')][_0x5c2e('0x41')]=_0x3ba5b6[_0x5c2e('0x2f')][_0x5c2e('0x42')];_0x33601e[_0x5c2e('0x43')]=_0x5c2e('0x44');_0x33601e[_0x5c2e('0x45')]=JSON['stringify'](_0xc2b38a);var _0xd39d71=[];for(var _0x49882d=0x0;_0x49882d<_0xc2b38a[_0x5c2e('0x46')];_0x49882d++){var _0x397ba3=_0xc2b38a[_0x49882d];if(_0x397ba3&&_0x397ba3[_0x5c2e('0x2f')]&&_0x397ba3[_0x5c2e('0x2f')]['fulfillmentText']){_0xd39d71['push'](createMessage(_0x1ba5ad,_0x17750f,_0x33601e,_0x397ba3['queryResult'][_0x5c2e('0x47')]));}}return Promise[_0x5c2e('0x48')](_0xd39d71)[_0x5c2e('0xf')](function(){if(_0x4fa15){_0x5dd5b4[_0x5c2e('0x19')]();}else{_0x5dd5b4[_0x5c2e('0x49')]();}})['catch'](function(_0x2b269c){logger[_0x5c2e('0x12')](_0x5c2e('0x13'),_0x1ba5ad,JSON[_0x5c2e('0x14')](_0x2b269c));_0x5dd5b4[_0x5c2e('0x19')]();});}})[_0x5c2e('0x11')](function(_0x2dd263){logger[_0x5c2e('0x12')](_0x5c2e('0x13'),_0x1ba5ad,_0x2dd263[_0x5c2e('0x2c')]);_0x5dd5b4['next']();});}}catch(_0x38a653){logger[_0x5c2e('0x12')](_0x5c2e('0x13'),_0x1ba5ad,JSON[_0x5c2e('0x14')](_0x38a653));_0x5dd5b4[_0x5c2e('0x49')]();}};}; \ No newline at end of file +var _0x7c5a=['message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','stringify','consequence','isNil','UserId','info','next','contact','format','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','error','stop','replace','SessionsClient'];(function(_0x5d83a8,_0x4e6ca6){var _0x57cf2d=function(_0x5bb8f4){while(--_0x5bb8f4){_0x5d83a8['push'](_0x5d83a8['shift']());}};_0x57cf2d(++_0x4e6ca6);}(_0x7c5a,0x167));var _0xa7c5=function(_0x1ac473,_0x2af39c){_0x1ac473=_0x1ac473-0x0;var _0x995eb1=_0x7c5a[_0x1ac473];return _0x995eb1;};'use strict';var _=require(_0xa7c5('0x0'));var dialogflow=require(_0xa7c5('0x1'));var md5=require('md5');var moment=require(_0xa7c5('0x2'));var Promise=require(_0xa7c5('0x3'));var logger=require(_0xa7c5('0x4'))(_0xa7c5('0x5'));var utils=require(_0xa7c5('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa7c5('0x7')),'mailMessage':require(_0xa7c5('0x8')),'smsMessage':require(_0xa7c5('0x9')),'faxMessage':require(_0xa7c5('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x138491,_0x535663,_0x3275ea,_0x2ecb18){return new Promise(function(_0x422878,_0x1206e0){var _0x4b14b0=_[_0xa7c5('0xb')](_0x3275ea);_0x4b14b0['body']=_0x2ecb18;return rpc[_0x535663+_0xa7c5('0xc')][_0xa7c5('0xd')](_0x4b14b0)[_0xa7c5('0xe')](function(){logger['info'](_0xa7c5('0xf'),_0x138491,_0x4b14b0[_0xa7c5('0x10')]);_0x422878();})[_0xa7c5('0x11')](function(_0x5e64dc){logger['error'](_0xa7c5('0xf'),_0x138491,JSON[_0xa7c5('0x12')](_0x5e64dc));_0x1206e0(_0x5e64dc);});});}exports[_0xa7c5('0x13')]=function(_0x4725af,_0x532822){return function(_0x1e6a8d){try{if(!_[_0xa7c5('0x14')](this['interaction'][_0xa7c5('0x15')])){logger[_0xa7c5('0x16')]('[%s][DIALOGFLOWV2]\x20%s',_0x4725af,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1e6a8d[_0xa7c5('0x17')]();}var _0x432c4e={'ContactId':this[_0xa7c5('0x18')]['id'],'sentAt':moment()[_0xa7c5('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa7c5('0x1a')};if(this['channel']==='sms'||this[_0xa7c5('0x1b')]===_0xa7c5('0x1c')){_0x432c4e[_0xa7c5('0x1d')]=this[_0xa7c5('0x1e')][_0xa7c5('0x1d')];}var _0x192422=this[_0xa7c5('0x1b')];if(_0x192422===_0xa7c5('0x1f')){_0x432c4e[_0xa7c5('0x20')]=this[_0xa7c5('0x21')]['id'];}else{_0x432c4e[_['upperFirst'](_0x192422)+_0xa7c5('0x22')]=this[_0xa7c5('0x21')]['id'];}_0x432c4e[_[_0xa7c5('0x23')](_0x192422)+_0xa7c5('0x24')]=this['interaction']['id'];if(this['interaction'][_0xa7c5('0x25')]){var _0x32351d=_0x532822[0x4];if(!_[_0xa7c5('0x26')](_0x32351d)){_0x432c4e[_0xa7c5('0x10')]=utils['getMustacheRender'](_0x32351d,this);return rpc[_0x192422+_0xa7c5('0xc')][_0xa7c5('0xd')](_0x432c4e)[_0xa7c5('0xe')](function(_0x1e0fab){logger[_0xa7c5('0x16')](_0xa7c5('0xf'),_0x4725af,_0x432c4e[_0xa7c5('0x10')]);})['catch'](function(_0x431820){logger[_0xa7c5('0x27')](_0xa7c5('0xf'),_0x4725af,JSON[_0xa7c5('0x12')](_0x431820));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4725af);_0x1e6a8d[_0xa7c5('0x28')]();});}else{logger[_0xa7c5('0x16')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4725af);_0x1e6a8d[_0xa7c5('0x28')]();}}else{var _0x4fe56a=this;var _0xb76492=_0x532822[0x2][_0xa7c5('0x29')](/\\n/g,'\x0a');var _0x38e794={'credentials':{'private_key':_0xb76492,'client_email':_0x532822[0x1]}};var _0x1479db=new dialogflow[(_0xa7c5('0x2a'))](_0x38e794);var _0x59ef55=_0x1479db['sessionPath'](_0x532822[0x0],md5(_0x4fe56a['interaction']['id']));var _0x1e6fb5={'session':_0x59ef55,'queryInput':{'text':{'text':_0x4fe56a[_0xa7c5('0x2b')][_0xa7c5('0x10')],'languageCode':_0x532822[0x3]||'en'}}};return _0x1479db[_0xa7c5('0x2c')](_0x1e6fb5)[_0xa7c5('0xe')](function(_0x61aed1){if(_0x61aed1&&_0x61aed1['length']){_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x2d')]=_0x61aed1;var _0x2ca7b5=_0x61aed1[0x0];var _0x207e3a=_0x2ca7b5[_0xa7c5('0x2e')]['diagnosticInfo']&&_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x2f')]['fields']?_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x2f')][_0xa7c5('0x30')]['end_conversation'][_0xa7c5('0x31')]:![];_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x32')]=_0x2ca7b5['queryResult']['action'];_0x4fe56a[_0xa7c5('0x10')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2ca7b5[_0xa7c5('0x2e')]['allRequiredParamsPresent'];_0x4fe56a['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x2f')]&&_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x2f')]['fields']?_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x2f')][_0xa7c5('0x30')][_0xa7c5('0x33')][_0xa7c5('0x31')]:![];_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x34')]=_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x35')][_0xa7c5('0x36')];_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x37')]=_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x35')][_0xa7c5('0x38')];_0x4fe56a[_0xa7c5('0x10')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x2ca7b5['queryResult'][_0xa7c5('0x35')][_0xa7c5('0x39')];_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x3a')]=_0x2ca7b5[_0xa7c5('0x2e')]['languageCode'];_0x4fe56a[_0xa7c5('0x10')]['DIALOGFLOWV2_QUERYTEXT']=_0x2ca7b5[_0xa7c5('0x2e')][_0xa7c5('0x3b')];_0x4fe56a[_0xa7c5('0x10')][_0xa7c5('0x3c')]=_0x2ca7b5['queryResult'][_0xa7c5('0x3d')];_0x432c4e[_0xa7c5('0x3e')]='dialogflowV2';_0x432c4e[_0xa7c5('0x3f')]=JSON['stringify'](_0x61aed1);var _0x10d5a3=[];for(var _0x54c4ae=0x0;_0x54c4ae<_0x61aed1[_0xa7c5('0x40')];_0x54c4ae++){var _0x31fee5=_0x61aed1[_0x54c4ae];if(_0x31fee5&&_0x31fee5[_0xa7c5('0x2e')]&&_0x31fee5['queryResult'][_0xa7c5('0x41')]){_0x10d5a3[_0xa7c5('0x42')](createMessage(_0x4725af,_0x192422,_0x432c4e,_0x31fee5[_0xa7c5('0x2e')][_0xa7c5('0x41')]));}}return Promise['all'](_0x10d5a3)['then'](function(){if(_0x207e3a){_0x1e6a8d[_0xa7c5('0x17')]();}else{_0x1e6a8d[_0xa7c5('0x28')]();}})[_0xa7c5('0x11')](function(_0x44a3b0){logger[_0xa7c5('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x4725af,JSON['stringify'](_0x44a3b0));_0x1e6a8d[_0xa7c5('0x17')]();});}})[_0xa7c5('0x11')](function(_0x5d694a){logger[_0xa7c5('0x27')](_0xa7c5('0xf'),_0x4725af,_0x5d694a[_0xa7c5('0x2b')]);_0x1e6a8d[_0xa7c5('0x17')]();});}}catch(_0x337583){logger[_0xa7c5('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x4725af,JSON['stringify'](_0x337583));_0x1e6a8d[_0xa7c5('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 5f3746b..eaee6e7 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd97d=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x4a6f9b,_0x241606){var _0x32fdb2=function(_0x5548fa){while(--_0x5548fa){_0x4a6f9b['push'](_0x4a6f9b['shift']());}};_0x32fdb2(++_0x241606);}(_0xd97d,0x1dd));var _0xdd97=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xd97d[_0x125ff8];return _0x2d9ef;};'use strict';var schema=require(_0xdd97('0x0'));var _=require(_0xdd97('0x1'));var htmlToText=require(_0xdd97('0x2'));var utils=require(_0xdd97('0x3'));var logger=require(_0xdd97('0x4'))(_0xdd97('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xdd97('0x6')},'priorityTrue':{'type':'number','message':_0xdd97('0x7')},'priorityFalse':{'type':_0xdd97('0x8'),'message':_0xdd97('0x9')}});exports[_0xdd97('0xa')]=function(_0x2e2d0f,_0x43ec2c){return function(_0x14bcee){try{var _0x55ad46={'condition':htmlToText[_0xdd97('0xb')](utils[_0xdd97('0xc')](_0x43ec2c[0x0],this),{'wordwrap':![]})[_0xdd97('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x43ec2c[0x1],'priorityFalse':_0x43ec2c[0x2]};var _0x5d26e5=gotoif[_0xdd97('0x0')](_0x55ad46,{'typecast':!![]});if(_0x5d26e5['length']){logger[_0xdd97('0xe')](_0xdd97('0xf'),_0x2e2d0f,_[_0xdd97('0x10')](_0x5d26e5,_0xdd97('0x11'))[_0xdd97('0x12')](',\x20'));_0x14bcee[_0xdd97('0x13')]();}else{try{var _0x34ed53=eval('('+_0x55ad46[_0xdd97('0x14')]+')');var _0x53cd73=_0x34ed53?_0x55ad46[_0xdd97('0x15')]:_0x55ad46['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2e2d0f,_0x55ad46[_0xdd97('0x14')],_0x34ed53,_0x53cd73||'next');if(_0x53cd73){var _0x5f5a59=_['findIndex'](_0x14bcee[_0xdd97('0x16')](),{'p':_0x53cd73});if(_0x5f5a59>=0x0){logger[_0xdd97('0x17')](_0xdd97('0x18'),_0x2e2d0f,_0x53cd73||'next',_0x5f5a59);_0x14bcee[_0xdd97('0x19')](_0x5f5a59);}else{logger[_0xdd97('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2e2d0f,_0x53cd73||_0xdd97('0x19'));_0x14bcee[_0xdd97('0x13')]();}}else{_0x14bcee['next']();}}catch(_0x51efcb){logger[_0xdd97('0xe')](_0xdd97('0x1a'),_0x2e2d0f,_0x51efcb[_0xdd97('0x11')]);_0x14bcee[_0xdd97('0x13')]();}}}catch(_0x19f920){logger[_0xdd97('0xe')](_0xdd97('0xf'),_0x2e2d0f,JSON[_0xdd97('0x1b')](_0x19f920));_0x14bcee['stop']();}};}; \ No newline at end of file +var _0x5920=['fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number'];(function(_0x7d0b8c,_0x3752f7){var _0x4810d2=function(_0x214e1d){while(--_0x214e1d){_0x7d0b8c['push'](_0x7d0b8c['shift']());}};_0x4810d2(++_0x3752f7);}(_0x5920,0x13c));var _0x0592=function(_0x47ba3e,_0x2508af){_0x47ba3e=_0x47ba3e-0x0;var _0xe89e88=_0x5920[_0x47ba3e];return _0xe89e88;};'use strict';var schema=require(_0x0592('0x0'));var _=require(_0x0592('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x0592('0x2'))(_0x0592('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x0592('0x4')},'priorityTrue':{'type':'number','message':_0x0592('0x5')},'priorityFalse':{'type':_0x0592('0x6'),'message':_0x0592('0x7')}});exports['consequence']=function(_0x4a3095,_0x3362fb){return function(_0x65190a){try{var _0x2807d4={'condition':htmlToText[_0x0592('0x8')](utils[_0x0592('0x9')](_0x3362fb[0x0],this),{'wordwrap':![]})[_0x0592('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3362fb[0x1],'priorityFalse':_0x3362fb[0x2]};var _0x7ddf3e=gotoif[_0x0592('0x0')](_0x2807d4,{'typecast':!![]});if(_0x7ddf3e[_0x0592('0xb')]){logger[_0x0592('0xc')](_0x0592('0xd'),_0x4a3095,_[_0x0592('0xe')](_0x7ddf3e,_0x0592('0xf'))['join'](',\x20'));_0x65190a[_0x0592('0x10')]();}else{try{var _0x24e93c=eval('('+_0x2807d4[_0x0592('0x11')]+')');var _0x5630db=_0x24e93c?_0x2807d4[_0x0592('0x12')]:_0x2807d4['priorityFalse'];logger['info'](_0x0592('0x13'),_0x4a3095,_0x2807d4['condition'],_0x24e93c,_0x5630db||_0x0592('0x14'));if(_0x5630db){var _0x6a8333=_[_0x0592('0x15')](_0x65190a[_0x0592('0x16')](),{'p':_0x5630db});if(_0x6a8333>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4a3095,_0x5630db||_0x0592('0x14'),_0x6a8333);_0x65190a[_0x0592('0x14')](_0x6a8333);}else{logger[_0x0592('0x17')](_0x0592('0x18'),_0x4a3095,_0x5630db||_0x0592('0x14'));_0x65190a[_0x0592('0x10')]();}}else{_0x65190a[_0x0592('0x14')]();}}catch(_0x53cb6f){logger['error'](_0x0592('0x19'),_0x4a3095,_0x53cb6f[_0x0592('0xf')]);_0x65190a[_0x0592('0x10')]();}}}catch(_0x2974cf){logger[_0x0592('0xc')]('[%s][GOTOIF]\x20%s',_0x4a3095,JSON[_0x0592('0x1a')](_0x2974cf));_0x65190a[_0x0592('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 4ef88e1..37cd4b0 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 _0xab48=['rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x497911,_0x16e1fd){var _0x483442=function(_0x23f8d7){while(--_0x23f8d7){_0x497911['push'](_0x497911['shift']());}};_0x483442(++_0x16e1fd);}(_0xab48,0x121));var _0x8ab4=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0xab48[_0x4e82ff];return _0x495205;};'use strict';var schema=require(_0x8ab4('0x0'));var _=require(_0x8ab4('0x1'));var logger=require(_0x8ab4('0x2'))(_0x8ab4('0x3'));var gotop=schema({'priority':{'type':_0x8ab4('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x8ab4('0x5')]=function(_0x5eafec,_0x2ee7d8){return function(_0x254b32){try{var _0x10ce5c={'priority':_0x2ee7d8[0x0]};var _0x331dee=gotop[_0x8ab4('0x0')](_0x10ce5c,{'typecast':!![]});if(_0x331dee[_0x8ab4('0x6')]){logger[_0x8ab4('0x7')]('[%s][GOTOP]\x20%s',_0x5eafec,_['map'](_0x331dee,_0x8ab4('0x8'))[_0x8ab4('0x9')](',\x20'));_0x254b32[_0x8ab4('0xa')]();}else{logger[_0x8ab4('0xb')](_0x8ab4('0xc'),_0x5eafec,_0x10ce5c[_0x8ab4('0xd')]);if(_0x10ce5c[_0x8ab4('0xd')]){var _0x1e9b14=_[_0x8ab4('0xe')](_0x254b32[_0x8ab4('0xf')](),{'p':_0x10ce5c[_0x8ab4('0xd')]});if(_0x1e9b14>=0x0){logger[_0x8ab4('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5eafec,_0x10ce5c['priority']||_0x8ab4('0x10'),_0x1e9b14);_0x254b32[_0x8ab4('0x10')](_0x1e9b14);}else{logger[_0x8ab4('0xb')](_0x8ab4('0x11'),_0x5eafec,_0x10ce5c[_0x8ab4('0xd')]||_0x8ab4('0x10'));_0x254b32['stop']();}}else{_0x254b32[_0x8ab4('0x10')]();}}}catch(_0x542279){logger['error']('[%s][GOTOP]\x20%s',_0x5eafec,JSON[_0x8ab4('0x12')](_0x542279));_0x254b32['stop']();}};}; \ No newline at end of file +var _0x54e7=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x54e7,0xf3));var _0x754e=function(_0x3086c7,_0x4a50b9){_0x3086c7=_0x3086c7-0x0;var _0x3c3ba9=_0x54e7[_0x3086c7];return _0x3c3ba9;};'use strict';var schema=require(_0x754e('0x0'));var _=require(_0x754e('0x1'));var logger=require(_0x754e('0x2'))(_0x754e('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x754e('0x4')}});exports[_0x754e('0x5')]=function(_0x3ffbad,_0x1f4413){return function(_0x4e3b92){try{var _0x554419={'priority':_0x1f4413[0x0]};var _0x476f32=gotop['validate'](_0x554419,{'typecast':!![]});if(_0x476f32[_0x754e('0x6')]){logger[_0x754e('0x7')](_0x754e('0x8'),_0x3ffbad,_[_0x754e('0x9')](_0x476f32,_0x754e('0xa'))[_0x754e('0xb')](',\x20'));_0x4e3b92[_0x754e('0xc')]();}else{logger[_0x754e('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x3ffbad,_0x554419['priority']);if(_0x554419[_0x754e('0xe')]){var _0x47842b=_[_0x754e('0xf')](_0x4e3b92[_0x754e('0x10')](),{'p':_0x554419[_0x754e('0xe')]});if(_0x47842b>=0x0){logger[_0x754e('0xd')](_0x754e('0x11'),_0x3ffbad,_0x554419[_0x754e('0xe')]||_0x754e('0x12'),_0x47842b);_0x4e3b92['next'](_0x47842b);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3ffbad,_0x554419['priority']||'next');_0x4e3b92[_0x754e('0xc')]();}}else{_0x4e3b92[_0x754e('0x12')]();}}}catch(_0x385546){logger[_0x754e('0x7')](_0x754e('0x8'),_0x3ffbad,JSON['stringify'](_0x385546));_0x4e3b92['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 36185c1..000d034 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 _0xa664=['then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa664,0x132));var _0x4a66=function(_0x12542a,_0x220a0d){_0x12542a=_0x12542a-0x0;var _0x1cd15b=_0xa664[_0x12542a];return _0x1cd15b;};'use strict';var _=require('lodash');var utils=require(_0x4a66('0x0'));var logger=require(_0x4a66('0x1'))(_0x4a66('0x2'));var rpc={'chatMessage':require(_0x4a66('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4a66('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4a66('0x5'))};exports[_0x4a66('0x6')]=function(_0x47372d,_0x2661f8){return function(_0x3dd553){try{var _0x3fe28c={'body':utils[_0x4a66('0x7')](_0x2661f8[0x0],this),'ContactId':this['contact']['id']};if(this[_0x4a66('0x8')]===_0x4a66('0x9')){_0x3fe28c[_0x4a66('0xa')]=this[_0x4a66('0xb')]['id'];}else{_0x3fe28c[_['upperFirst'](this[_0x4a66('0x8')])+_0x4a66('0xc')]=this['account']['id'];}_0x3fe28c[_[_0x4a66('0xd')](this[_0x4a66('0x8')])+_0x4a66('0xe')]=this[_0x4a66('0xf')]['id'];if(rpc[this[_0x4a66('0x8')]+_0x4a66('0x10')]){return rpc[this[_0x4a66('0x8')]+_0x4a66('0x10')][_0x4a66('0x11')](_0x3fe28c)[_0x4a66('0x12')](function(_0x177bf1){logger[_0x4a66('0x13')](_0x4a66('0x14'),_0x47372d,_0x3fe28c[_0x4a66('0x15')]);_0x3dd553[_0x4a66('0x16')]();})[_0x4a66('0x17')](function(_0x11f34f){logger['error'](_0x4a66('0x14'),_0x47372d,JSON[_0x4a66('0x18')](_0x11f34f));_0x3dd553[_0x4a66('0x19')]();});}}catch(_0x4208f9){logger[_0x4a66('0x1a')](_0x4a66('0x14'),_0x47372d,JSON[_0x4a66('0x18')](_0x4208f9));_0x3dd553[_0x4a66('0x19')]();}};}; \ No newline at end of file +var _0xf925=['create','info','[%s][MESSAGE]\x20%s','catch','stringify','stop','error','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','chat','account','upperFirst','AccountId','channel','InteractionId','interaction','Message'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xf925,0xb7));var _0x5f92=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0xf925[_0x3434d7];return _0x51eebd;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x5f92('0x0'));var rpc={'chatMessage':require(_0x5f92('0x1')),'openchannelMessage':require(_0x5f92('0x2')),'mailMessage':require(_0x5f92('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5f92('0x4')),'whatsappMessage':require(_0x5f92('0x5'))};exports[_0x5f92('0x6')]=function(_0x232f09,_0x91d10c){return function(_0x3e2312){try{var _0x1c7ad6={'body':utils['getMustacheRender'](_0x91d10c[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x5f92('0x7')){_0x1c7ad6['ChatWebsiteId']=this[_0x5f92('0x8')]['id'];}else{_0x1c7ad6[_[_0x5f92('0x9')](this['channel'])+_0x5f92('0xa')]=this['account']['id'];}_0x1c7ad6[_[_0x5f92('0x9')](this[_0x5f92('0xb')])+_0x5f92('0xc')]=this[_0x5f92('0xd')]['id'];if(rpc[this['channel']+_0x5f92('0xe')]){return rpc[this[_0x5f92('0xb')]+_0x5f92('0xe')][_0x5f92('0xf')](_0x1c7ad6)['then'](function(_0x37640f){logger[_0x5f92('0x10')](_0x5f92('0x11'),_0x232f09,_0x1c7ad6['body']);_0x3e2312['next']();})[_0x5f92('0x12')](function(_0x2642f5){logger['error']('[%s][MESSAGE]\x20%s',_0x232f09,JSON[_0x5f92('0x13')](_0x2642f5));_0x3e2312[_0x5f92('0x14')]();});}}catch(_0x4ccd50){logger[_0x5f92('0x15')](_0x5f92('0x11'),_0x232f09,JSON['stringify'](_0x4ccd50));_0x3e2312[_0x5f92('0x14')]();}};}; \ 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 a0cf76c..e724c3c 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 _0x2c3c=['getMustacheRender','next','error','stop','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s'];(function(_0x2ff127,_0x3d6e2b){var _0x53af48=function(_0x4a0c47){while(--_0x4a0c47){_0x2ff127['push'](_0x2ff127['shift']());}};_0x53af48(++_0x3d6e2b);}(_0x2c3c,0x134));var _0xc2c3=function(_0xde27cc,_0xb99d9f){_0xde27cc=_0xde27cc-0x0;var _0x23e45e=_0x2c3c[_0xde27cc];return _0x23e45e;};'use strict';var utils=require('./utils');var logger=require(_0xc2c3('0x0'))('routing');exports[_0xc2c3('0x1')]=function(_0x40f63c,_0x5aec34){return function(_0x3c178e){try{logger[_0xc2c3('0x2')](_0xc2c3('0x3'),_0x40f63c,utils[_0xc2c3('0x4')](_0x5aec34[0x0],this));_0x3c178e[_0xc2c3('0x5')]();}catch(_0x4b5592){logger[_0xc2c3('0x6')](_0xc2c3('0x3'),_0x40f63c,JSON['stringify'](_0x4b5592));_0x3c178e[_0xc2c3('0x7')]();}};}; \ No newline at end of file +var _0x41ed=['routing','consequence','info','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x41ed,0x104));var _0xd41e=function(_0x521d7c,_0x2957db){_0x521d7c=_0x521d7c-0x0;var _0x616483=_0x41ed[_0x521d7c];return _0x616483;};'use strict';var utils=require('./utils');var logger=require(_0xd41e('0x0'))(_0xd41e('0x1'));exports[_0xd41e('0x2')]=function(_0x260184,_0x2ad139){return function(_0x420681){try{logger[_0xd41e('0x3')]('[%s][NOOP]\x20%s',_0x260184,utils['getMustacheRender'](_0x2ad139[0x0],this));_0x420681[_0xd41e('0x4')]();}catch(_0x571102){logger[_0xd41e('0x5')](_0xd41e('0x6'),_0x260184,JSON[_0xd41e('0x7')](_0x571102));_0x420681[_0xd41e('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index fa8e00f..a6e452e 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 _0x71f6=['timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','stack','lodash','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x39853d,_0x2501bf){var _0x5864ca=function(_0xbc99d5){while(--_0xbc99d5){_0x39853d['push'](_0x39853d['shift']());}};_0x5864ca(++_0x2501bf);}(_0x71f6,0x1ac));var _0x671f=function(_0x545c00,_0x5f026e){_0x545c00=_0x545c00-0x0;var _0x3f0f48=_0x71f6[_0x545c00];return _0x3f0f48;};'use strict';var schema=require('validate');var _=require(_0x671f('0x0'));var util=require('util');var seqqueue=require(_0x671f('0x1'));var moment=require(_0x671f('0x2'));var Redis=require(_0x671f('0x3'));var config=require('../../../../config/environment');var logger=require(_0x671f('0x4'))(_0x671f('0x5'));var strategy=require(_0x671f('0x6'));config[_0x671f('0x7')]=_[_0x671f('0x8')](config[_0x671f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x671f('0x9'))(new Redis(config[_0x671f('0x7')]));var attributes=['id',_0x671f('0xa'),_0x671f('0xb'),_0x671f('0xc'),'from',_0x671f('0xd')];function emit(_0x337ebd,_0x475334,_0x3f0204){io['to'](_0x337ebd)[_0x671f('0xe')](_0x475334,_0x3f0204);}function emitChannelQueueInteraction(_0x5e633b,_0x578f1b,_0x1bdde2,_0x2b0960,_0x340808,_0x5eb7d7,_0x45a059,_0x4e93aa){var _0x590d83=_[_0x671f('0xf')](_0x1bdde2);_0x590d83['queue_id']=_0x4e93aa;_0x590d83['queue']=_0x578f1b;_0x590d83[_0x671f('0xb')]=_0x2b0960;_0x590d83['id']=_0x340808;if(_0x5eb7d7){_0x45a059[util[_0x671f('0x10')](_0x671f('0x11'),_0x5e633b)][_0x340808]=_[_0x671f('0x12')](_0x590d83,attributes);}else{delete _0x45a059[util['format'](_0x671f('0x11'),_0x5e633b)][_0x340808];}emit(util[_0x671f('0x10')](_0x671f('0x13'),_0x5e633b,_0x578f1b),util['format']('%s_queue_waiting_interaction:%s',_0x5e633b,_0x5eb7d7?_0x671f('0x14'):_0x671f('0x15')),_[_0x671f('0x12')](_0x590d83,attributes));}var rpc={'openchannelQueueReport':require(_0x671f('0x16')),'mailQueueReport':require(_0x671f('0x17')),'chatQueueReport':require(_0x671f('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x671f('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x671f('0x1a')},'timeout':{'type':_0x671f('0x1b'),'message':_0x671f('0x1c')}});function startRouting(_0x518c36,_0x4465d2,_0x41e04c,_0x49d9b6){if(_0x518c36&&_0x4465d2&&_0x41e04c){_0x4465d2[_0x671f('0x1d')]+=0x1;var _0xcdd791={'uniqueid':_0x518c36,'from':_0x41e04c[_0x671f('0x1e')]?_0x41e04c[_0x671f('0x1e')][_0x671f('0x1f')]:'','joinAt':moment()[_0x671f('0x10')](_0x671f('0x20')),'ContactId':_0x41e04c['contact']?_0x41e04c[_0x671f('0x21')]['id']:null,'ListId':_0x41e04c['list']?_0x41e04c['list']['id']:null};_0xcdd791[_[_0x671f('0x22')](_0x41e04c[_0x671f('0x23')])+_0x671f('0x24')]=_0x4465d2['id']||null;_0xcdd791[_[_0x671f('0x22')](_0x41e04c[_0x671f('0x23')])+'InteractionId']=_0x41e04c[_0x671f('0x25')]?_0x41e04c[_0x671f('0x25')]['id']:null;_0xcdd791[_[_0x671f('0x22')](_0x41e04c[_0x671f('0x23')])+'MessageId']=_0x41e04c[_0x671f('0x26')]?_0x41e04c[_0x671f('0x26')]['id']:null;_0xcdd791[_[_0x671f('0x22')](_0x41e04c[_0x671f('0x23')])+(_0x41e04c[_0x671f('0x23')]!==_0x671f('0x27')?_0x671f('0x28'):'WebsiteId')]=_0x41e04c[_0x671f('0xb')]?_0x41e04c['account']['id']:null;logger[_0x671f('0x29')](util[_0x671f('0x10')](_0x671f('0x2a'),_0x518c36,_0x4465d2[_0x671f('0x2b')]));emitChannelQueueInteraction(_0x41e04c['channel'],_0x4465d2[_0x671f('0x2b')],_0xcdd791,_0x41e04c[_0x671f('0xb')][_0x671f('0x2b')],_0x41e04c[_0x671f('0x26')]['id'],!![],_0x49d9b6,_0x4465d2['id']);if(rpc[_0x41e04c['channel']+_0x671f('0x2c')]){return rpc[_0x41e04c['channel']+_0x671f('0x2c')]['create'](_0xcdd791)[_0x671f('0x2d')](function(_0xea441f){logger[_0x671f('0x2e')](_0x671f('0x2f'));});}}}function stopRouting(_0x2d6ada,_0x4402aa,_0x473b45,_0x3fe654){if(_0x2d6ada&&_0x4402aa){_0x4402aa[_0x671f('0x1d')]-=0x1;var _0x2582dd={'leaveAt':moment()[_0x671f('0x10')](_0x671f('0x20')),'acceptAt':moment()[_0x671f('0x10')](_0x671f('0x20')),'reason':_0x671f('0x30')};logger[_0x671f('0x29')](util[_0x671f('0x10')](_0x671f('0x31'),_0x2d6ada,_0x4402aa['name']));emitChannelQueueInteraction(_0x473b45[_0x671f('0x23')],_0x4402aa[_0x671f('0x2b')],_0x473b45[_0x671f('0x1e')],_0x473b45[_0x671f('0xb')][_0x671f('0x2b')],_0x473b45[_0x671f('0x26')]['id'],![],_0x3fe654,_0x4402aa['id']);if(rpc[_0x473b45[_0x671f('0x23')]+_0x671f('0x2c')]){return rpc[_0x473b45['channel']+_0x671f('0x2c')]['update'](_0x2d6ada,_0x2582dd)['catch'](function(_0x1b473a){logger[_0x671f('0x2e')](_0x671f('0x32'));});}}}function endRouting(_0x338f87,_0x46ae59,_0x1ac9c3,_0xe240ef){if(_0x338f87&&_0x46ae59){_0x46ae59[_0x671f('0x1d')]-=0x1;var _0xfba2c6={'leaveAt':moment()[_0x671f('0x10')](_0x671f('0x20')),'exitAt':moment()[_0x671f('0x10')](_0x671f('0x20')),'reason':_0x671f('0x33')};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x338f87,_0x46ae59[_0x671f('0x2b')]));emitChannelQueueInteraction(_0x1ac9c3['channel'],_0x46ae59[_0x671f('0x2b')],_0x1ac9c3[_0x671f('0x1e')],_0x1ac9c3['account'][_0x671f('0x2b')],_0x1ac9c3[_0x671f('0x26')]['id'],![],_0xe240ef);if(rpc[_0x1ac9c3[_0x671f('0x23')]+_0x671f('0x2c')]){return rpc[_0x1ac9c3[_0x671f('0x23')]+_0x671f('0x2c')][_0x671f('0x34')](_0x338f87,_0xfba2c6)[_0x671f('0x2d')](function(_0x2b29c5){logger[_0x671f('0x2e')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x3334aa){return function(_0x16d77f){return _0x16d77f[_0x671f('0x2b')][_0x671f('0x35')]()===_0x3334aa[_0x671f('0x35')]();};}exports[_0x671f('0x36')]=function(_0x568815,_0x2860ec,_0x233499,_0x3b2c3b){return function(_0x41c11f){try{var _0x3cc39b={'name':_0x2860ec[0x0],'timeout':_0x2860ec[0x1]};var _0x4cde8a=queue[_0x671f('0x37')](_0x3cc39b,{'typecast':!![]});if(_0x4cde8a[_0x671f('0x38')]){logger[_0x671f('0x2e')](_0x671f('0x39'),_0x568815,_[_0x671f('0x3a')](_0x4cde8a,_0x671f('0x26'))[_0x671f('0x3b')](',\x20'));_0x41c11f[_0x671f('0x3c')]();}else{var _0x4f06c2=_['find'](_0x233499[_0x3b2c3b[_0x671f('0x23')]+_0x671f('0x3d')],handleFindQueue(_0x3cc39b[_0x671f('0x2b')]));if(_0x4f06c2){startRouting(_0x568815,_0x4f06c2,_0x3b2c3b,_0x233499);var _0x59f340=(_0x4f06c2[_0x671f('0x33')]||0xa)*0x3e8;var _0x4d9484=(_0x3cc39b[_0x671f('0x33')]||0x14)*0x3e8;var _0x362489,_0x14330a;if(_0x59f340>_0x4d9484){_0x4d9484=_0x59f340;}var _0x28deab=seqqueue[_0x671f('0x3e')](_0x59f340);_0x28deab['id']=_0x568815;_0x28deab[_0x671f('0x3f')]=_0x59f340;_0x28deab[_0x671f('0x40')]=_0x4d9484;_0x28deab[_0x671f('0x23')]=_0x3b2c3b[_0x671f('0x23')];_0x233499[_0x671f('0x41')][_0x568815]['on']('end',function(){logger[_0x671f('0x29')](_0x671f('0x42'),_0x568815);stopRouting(_0x568815,_0x4f06c2,_0x3b2c3b,_0x233499);clearTimeout(_0x362489);_0x362489=undefined;_0x28deab[_0x671f('0x43')](!![]);if(_0x233499[_0x671f('0x41')][_0x568815]){delete _0x233499[_0x671f('0x41')][_0x568815];}_0x41c11f[_0x671f('0x3c')]();});_0x233499[_0x671f('0x41')][_0x568815]['on'](_0x671f('0x44'),function(){if(_0x233499[_0x671f('0x41')][_0x568815]){delete _0x233499[_0x671f('0x41')][_0x568815];}});_0x362489=setTimeout(function(){logger[_0x671f('0x29')](_0x671f('0x45'),_0x568815);endRouting(_0x568815,_0x4f06c2,_0x3b2c3b,_0x233499);clearTimeout(_0x362489);_0x28deab[_0x671f('0x43')](!![]);_0x41c11f[_0x671f('0x46')]();},_0x4d9484);switch(_0x4f06c2[_0x671f('0x47')]){case'rrmemory':strategy[_0x671f('0x48')](_0x28deab,_0x4f06c2,_0x233499,_0x3b2c3b);break;default:strategy[_0x671f('0x49')](_0x28deab,_0x4f06c2,_0x233499,_0x3b2c3b);}}else{logger[_0x671f('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x568815,_0x3cc39b[_0x671f('0x2b')]);_0x41c11f[_0x671f('0x3c')]();}}}catch(_0x3add15){console[_0x671f('0x4a')](_0x3add15);logger[_0x671f('0x2e')](_0x671f('0x39'),_0x568815,_0x3add15[_0x671f('0x4b')]);_0x41c11f['stop']();}};}; \ No newline at end of file +var _0xc465=['next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','queue','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0xd78ff6,_0x3dcaa1){var _0x458026=function(_0x52dec4){while(--_0x52dec4){_0xd78ff6['push'](_0xd78ff6['shift']());}};_0x458026(++_0x3dcaa1);}(_0xc465,0x100));var _0x5c46=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xc465[_0x599f41];return _0x2e4d58;};'use strict';var schema=require(_0x5c46('0x0'));var _=require(_0x5c46('0x1'));var util=require(_0x5c46('0x2'));var seqqueue=require(_0x5c46('0x3'));var moment=require(_0x5c46('0x4'));var Redis=require(_0x5c46('0x5'));var config=require(_0x5c46('0x6'));var logger=require(_0x5c46('0x7'))(_0x5c46('0x8'));var strategy=require('./strategy');config[_0x5c46('0x9')]=_[_0x5c46('0xa')](config[_0x5c46('0x9')],{'host':_0x5c46('0xb'),'port':0x18eb});var io=require(_0x5c46('0xc'))(new Redis(config[_0x5c46('0x9')]));var attributes=['id',_0x5c46('0xd'),_0x5c46('0xe'),'queue',_0x5c46('0xf'),_0x5c46('0x10')];function emit(_0x139fb5,_0x28326f,_0x4171f0){io['to'](_0x139fb5)[_0x5c46('0x11')](_0x28326f,_0x4171f0);}function emitChannelQueueInteraction(_0x25126b,_0x24c4c9,_0x1c9adb,_0x1d220e,_0x1f456f,_0x5da873,_0x3713b9,_0xd634c7){var _0x24eab6=_['clone'](_0x1c9adb);_0x24eab6[_0x5c46('0xd')]=_0xd634c7;_0x24eab6[_0x5c46('0x12')]=_0x24c4c9;_0x24eab6[_0x5c46('0xe')]=_0x1d220e;_0x24eab6['id']=_0x1f456f;if(_0x5da873){_0x3713b9[util[_0x5c46('0x13')](_0x5c46('0x14'),_0x25126b)][_0x1f456f]=_['pick'](_0x24eab6,attributes);}else{delete _0x3713b9[util[_0x5c46('0x13')](_0x5c46('0x14'),_0x25126b)][_0x1f456f];}emit(util[_0x5c46('0x13')](_0x5c46('0x15'),_0x25126b,_0x24c4c9),util[_0x5c46('0x13')](_0x5c46('0x16'),_0x25126b,_0x5da873?_0x5c46('0x17'):'remove'),_['pick'](_0x24eab6,attributes));}var rpc={'openchannelQueueReport':require(_0x5c46('0x18')),'mailQueueReport':require(_0x5c46('0x19')),'chatQueueReport':require(_0x5c46('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x5c46('0x1b')),'whatsappQueueReport':require(_0x5c46('0x1c'))};var queue=schema({'name':{'type':_0x5c46('0x1d'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x5c46('0x1e'),'message':_0x5c46('0x1f')}});function startRouting(_0x3b1c9e,_0x5e0412,_0x420b75,_0x4e503a){if(_0x3b1c9e&&_0x5e0412&&_0x420b75){_0x5e0412[_0x5c46('0x20')]+=0x1;var _0x23a567={'uniqueid':_0x3b1c9e,'from':_0x420b75[_0x5c46('0x21')]?_0x420b75[_0x5c46('0x21')][_0x5c46('0xf')]:'','joinAt':moment()[_0x5c46('0x13')](_0x5c46('0x22')),'ContactId':_0x420b75[_0x5c46('0x23')]?_0x420b75['contact']['id']:null,'ListId':_0x420b75[_0x5c46('0x24')]?_0x420b75[_0x5c46('0x24')]['id']:null};_0x23a567[_[_0x5c46('0x25')](_0x420b75['channel'])+'QueueId']=_0x5e0412['id']||null;_0x23a567[_[_0x5c46('0x25')](_0x420b75[_0x5c46('0x26')])+_0x5c46('0x27')]=_0x420b75[_0x5c46('0x28')]?_0x420b75[_0x5c46('0x28')]['id']:null;_0x23a567[_[_0x5c46('0x25')](_0x420b75['channel'])+'MessageId']=_0x420b75['message']?_0x420b75[_0x5c46('0x29')]['id']:null;_0x23a567[_[_0x5c46('0x25')](_0x420b75[_0x5c46('0x26')])+(_0x420b75[_0x5c46('0x26')]!==_0x5c46('0x2a')?_0x5c46('0x2b'):_0x5c46('0x2c'))]=_0x420b75[_0x5c46('0xe')]?_0x420b75[_0x5c46('0xe')]['id']:null;logger[_0x5c46('0x2d')](util[_0x5c46('0x13')](_0x5c46('0x2e'),_0x3b1c9e,_0x5e0412[_0x5c46('0x2f')]));emitChannelQueueInteraction(_0x420b75['channel'],_0x5e0412[_0x5c46('0x2f')],_0x23a567,_0x420b75['account']['name'],_0x420b75[_0x5c46('0x29')]['id'],!![],_0x4e503a,_0x5e0412['id']);if(rpc[_0x420b75['channel']+'QueueReport']){return rpc[_0x420b75[_0x5c46('0x26')]+'QueueReport'][_0x5c46('0x30')](_0x23a567)[_0x5c46('0x31')](function(_0x1398af){logger[_0x5c46('0x32')](_0x5c46('0x33'));});}}}function stopRouting(_0x5623ce,_0x5a49e0,_0xd6e339,_0x3ac265){if(_0x5623ce&&_0x5a49e0){_0x5a49e0[_0x5c46('0x20')]-=0x1;var _0x2af252={'leaveAt':moment()[_0x5c46('0x13')](_0x5c46('0x22')),'acceptAt':moment()[_0x5c46('0x13')](_0x5c46('0x22')),'reason':_0x5c46('0x34')};logger[_0x5c46('0x2d')](util[_0x5c46('0x13')](_0x5c46('0x35'),_0x5623ce,_0x5a49e0['name']));emitChannelQueueInteraction(_0xd6e339[_0x5c46('0x26')],_0x5a49e0[_0x5c46('0x2f')],_0xd6e339[_0x5c46('0x21')],_0xd6e339[_0x5c46('0xe')][_0x5c46('0x2f')],_0xd6e339[_0x5c46('0x29')]['id'],![],_0x3ac265,_0x5a49e0['id']);if(rpc[_0xd6e339[_0x5c46('0x26')]+_0x5c46('0x36')]){return rpc[_0xd6e339['channel']+_0x5c46('0x36')][_0x5c46('0x37')](_0x5623ce,_0x2af252)[_0x5c46('0x31')](function(_0x48d6b4){logger[_0x5c46('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0xa97be2,_0x59b87f,_0x38aeb1,_0x51222a){if(_0xa97be2&&_0x59b87f){_0x59b87f[_0x5c46('0x20')]-=0x1;var _0x27134e={'leaveAt':moment()[_0x5c46('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x5c46('0x13')](_0x5c46('0x22')),'reason':_0x5c46('0x38')};logger[_0x5c46('0x2d')](util[_0x5c46('0x13')](_0x5c46('0x39'),_0xa97be2,_0x59b87f['name']));emitChannelQueueInteraction(_0x38aeb1[_0x5c46('0x26')],_0x59b87f[_0x5c46('0x2f')],_0x38aeb1['body'],_0x38aeb1[_0x5c46('0xe')][_0x5c46('0x2f')],_0x38aeb1[_0x5c46('0x29')]['id'],![],_0x51222a);if(rpc[_0x38aeb1['channel']+_0x5c46('0x36')]){return rpc[_0x38aeb1['channel']+_0x5c46('0x36')][_0x5c46('0x37')](_0xa97be2,_0x27134e)[_0x5c46('0x31')](function(_0x521303){logger[_0x5c46('0x32')](_0x5c46('0x3a'));});}}}function handleFindQueue(_0x4943b0){return function(_0x5733fe){return _0x5733fe[_0x5c46('0x2f')][_0x5c46('0x3b')]()===_0x4943b0[_0x5c46('0x3b')]();};}exports[_0x5c46('0x3c')]=function(_0x37a1e5,_0x47c900,_0x575ac5,_0x8ecc1e){return function(_0x47e308){try{var _0x490cdf={'name':_0x47c900[0x0],'timeout':_0x47c900[0x1]};var _0x9c0e4d=queue[_0x5c46('0x0')](_0x490cdf,{'typecast':!![]});if(_0x9c0e4d[_0x5c46('0x3d')]){logger['error'](_0x5c46('0x3e'),_0x37a1e5,_[_0x5c46('0x3f')](_0x9c0e4d,_0x5c46('0x29'))[_0x5c46('0x40')](',\x20'));_0x47e308[_0x5c46('0x41')]();}else{var _0x482ceb=_[_0x5c46('0x42')](_0x575ac5[_0x8ecc1e[_0x5c46('0x26')]+_0x5c46('0x43')],handleFindQueue(_0x490cdf[_0x5c46('0x2f')]));if(_0x482ceb){startRouting(_0x37a1e5,_0x482ceb,_0x8ecc1e,_0x575ac5);var _0x67204c=(_0x482ceb[_0x5c46('0x38')]||0xa)*0x3e8;var _0xa1c6e8=(_0x490cdf[_0x5c46('0x38')]||0x14)*0x3e8;var _0x503e7e,_0x47d819;if(_0x67204c>_0xa1c6e8){_0xa1c6e8=_0x67204c;}var _0xd5ecd4=seqqueue[_0x5c46('0x44')](_0x67204c);_0xd5ecd4['id']=_0x37a1e5;_0xd5ecd4[_0x5c46('0x45')]=_0x67204c;_0xd5ecd4[_0x5c46('0x46')]=_0xa1c6e8;_0xd5ecd4[_0x5c46('0x26')]=_0x8ecc1e[_0x5c46('0x26')];_0x575ac5[_0x5c46('0x47')][_0x37a1e5]['on'](_0x5c46('0x48'),function(){logger[_0x5c46('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x37a1e5);stopRouting(_0x37a1e5,_0x482ceb,_0x8ecc1e,_0x575ac5);clearTimeout(_0x503e7e);_0x503e7e=undefined;_0xd5ecd4[_0x5c46('0x49')](!![]);if(_0x575ac5[_0x5c46('0x47')][_0x37a1e5]){delete _0x575ac5[_0x5c46('0x47')][_0x37a1e5];}_0x47e308['stop']();});_0x575ac5[_0x5c46('0x47')][_0x37a1e5]['on'](_0x5c46('0x4a'),function(){if(_0x575ac5[_0x5c46('0x47')][_0x37a1e5]){delete _0x575ac5[_0x5c46('0x47')][_0x37a1e5];}});_0x503e7e=setTimeout(function(){logger['info'](_0x5c46('0x4b'),_0x37a1e5);endRouting(_0x37a1e5,_0x482ceb,_0x8ecc1e,_0x575ac5);clearTimeout(_0x503e7e);_0xd5ecd4[_0x5c46('0x49')](!![]);_0x47e308[_0x5c46('0x4c')]();},_0xa1c6e8);switch(_0x482ceb[_0x5c46('0x4d')]){case'rrmemory':strategy[_0x5c46('0x4e')](_0xd5ecd4,_0x482ceb,_0x575ac5,_0x8ecc1e);break;default:strategy[_0x5c46('0x4f')](_0xd5ecd4,_0x482ceb,_0x575ac5,_0x8ecc1e);}}else{logger[_0x5c46('0x32')](_0x5c46('0x50'),_0x37a1e5,_0x490cdf[_0x5c46('0x2f')]);_0x47e308[_0x5c46('0x41')]();}}}catch(_0x842a32){console[_0x5c46('0x51')](_0x842a32);logger[_0x5c46('0x32')]('[%s][QUEUE]\x20%s',_0x37a1e5,_0x842a32[_0x5c46('0x52')]);_0x47e308[_0x5c46('0x41')]();}};}; \ 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 eda15c9..258cd57 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 _0xf98c=['drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','realtime','squeue','push','bind','timeout','handleTimeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf98c,0x10e));var _0xcf98=function(_0xa3c5b7,_0x16ddeb){_0xa3c5b7=_0xa3c5b7-0x0;var _0x4e200a=_0xf98c[_0xa3c5b7];return _0x4e200a;};'use strict';var _=require('lodash');var uuid=require(_0xcf98('0x0'));var util=require(_0xcf98('0x1'));var logger=require(_0xcf98('0x2'))(_0xcf98('0x3'));var Agent=function(_0x3b2ded,_0x17a3b8,_0x4ef097,_0xed043f){this['notificationId']=uuid['v4']();this['squeue']=_0x3b2ded;this['agent']=_0x17a3b8;this[_0xcf98('0x4')]=_0x4ef097;this['routing']=_0xed043f;this[_0xcf98('0x5')][_0xcf98('0x6')](this['handleRun'][_0xcf98('0x7')](this),this['handleTimeout'][_0xcf98('0x7')](this));this[_0xcf98('0x5')]['on'](_0xcf98('0x8'),this[_0xcf98('0x9')][_0xcf98('0x7')](this));this[_0xcf98('0x5')]['on'](_0xcf98('0xa'),this[_0xcf98('0xb')][_0xcf98('0x7')](this));};Agent[_0xcf98('0xc')][_0xcf98('0x6')]=function(){this[_0xcf98('0x5')][_0xcf98('0x6')](this[_0xcf98('0xd')][_0xcf98('0x7')](this),this[_0xcf98('0x9')][_0xcf98('0x7')](this));};Agent[_0xcf98('0xc')][_0xcf98('0xb')]=function(){this[_0xcf98('0x9')](!![]);};Agent['prototype']['handleRun']=function(_0x33966c){logger[_0xcf98('0xe')](_0xcf98('0xf'),this[_0xcf98('0x5')]['id'],this[_0xcf98('0x10')]['id']);if(_[_0xcf98('0x11')](this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']])){logger[_0xcf98('0xe')](_0xcf98('0x13'),this[_0xcf98('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xcf98('0x6')][_0xcf98('0x7')](this),0x3e8);}else{if(this[_0xcf98('0x3')][_0xcf98('0x14')]||util[_0xcf98('0x15')](this[_0xcf98('0x5')]['id'],this[_0xcf98('0x4')]['agents'][this['agent']['id']],this[_0xcf98('0x5')][_0xcf98('0x16')],![])){this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']][_0xcf98('0x17')]=!![];this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']][_0xcf98('0x18')]=undefined;util[_0xcf98('0x19')](this[_0xcf98('0x1a')],this[_0xcf98('0x5')]['id'],this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']],null,this[_0xcf98('0x3')]);util[_0xcf98('0x1b')](this[_0xcf98('0x5')]['id'],this[_0xcf98('0x4')][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']],_0xcf98('0x1c')+(this[_0xcf98('0x3')]['forcedOwnership']?_0xcf98('0x1d'):''));}else{logger['info'](_0xcf98('0x1e'),this[_0xcf98('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xcf98('0x6')][_0xcf98('0x7')](this),0x3e8);}}};Agent['prototype'][_0xcf98('0x9')]=function(_0x12daa6){if(_[_0xcf98('0x11')](this[_0xcf98('0x4')]['agents'][this[_0xcf98('0x10')]['id']])){return logger[_0xcf98('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xcf98('0x5')]['id'],this[_0xcf98('0x10')]['id']);}else{logger[_0xcf98('0xe')](_0xcf98('0x1f'),this['squeue']['id'],this['agent']['id']);util['hideNotification'](this[_0xcf98('0x1a')],this['squeue']['id'],this[_0xcf98('0x4')][_0xcf98('0x12')][this['agent']['id']],null,this[_0xcf98('0x3')]);this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']]['busy']=![];this['realtime'][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']][_0xcf98('0x18')]=undefined;util[_0xcf98('0x1b')](this[_0xcf98('0x5')]['id'],this[_0xcf98('0x4')][_0xcf98('0x12')][this[_0xcf98('0x10')]['id']],_0x12daa6?_0xcf98('0x20'):_0xcf98('0x21'));}if(!_0x12daa6){setTimeout(this[_0xcf98('0x6')][_0xcf98('0x7')](this),0x3e8);}};function agent(_0x4ea333,_0x4a14ec,_0x303858,_0x1114b1){return new Agent(_0x4ea333,_0x4a14ec,_0x303858,_0x1114b1);}module[_0xcf98('0x22')]=agent; \ No newline at end of file +var _0x92d3=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleTimeout','bind','handleDrained','push','handleRun','prototype','info','isNil'];(function(_0x43bd62,_0x107420){var _0x22321c=function(_0x5ed92c){while(--_0x5ed92c){_0x43bd62['push'](_0x43bd62['shift']());}};_0x22321c(++_0x107420);}(_0x92d3,0x1c0));var _0x392d=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x92d3[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x392d('0x0'));var uuid=require(_0x392d('0x1'));var util=require(_0x392d('0x2'));var logger=require(_0x392d('0x3'))(_0x392d('0x4'));var Agent=function(_0x5c5409,_0x4b5462,_0x82aa4c,_0x57ccd6){this[_0x392d('0x5')]=uuid['v4']();this[_0x392d('0x6')]=_0x5c5409;this[_0x392d('0x7')]=_0x4b5462;this[_0x392d('0x8')]=_0x82aa4c;this['routing']=_0x57ccd6;this[_0x392d('0x6')]['push'](this['handleRun']['bind'](this),this[_0x392d('0x9')][_0x392d('0xa')](this));this['squeue']['on']('timeout',this[_0x392d('0x9')][_0x392d('0xa')](this));this[_0x392d('0x6')]['on']('drained',this[_0x392d('0xb')]['bind'](this));};Agent['prototype'][_0x392d('0xc')]=function(){this[_0x392d('0x6')][_0x392d('0xc')](this[_0x392d('0xd')][_0x392d('0xa')](this),this[_0x392d('0x9')]['bind'](this));};Agent[_0x392d('0xe')]['handleDrained']=function(){this[_0x392d('0x9')](!![]);};Agent['prototype'][_0x392d('0xd')]=function(_0x56b450){logger[_0x392d('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x392d('0x6')]['id'],this[_0x392d('0x7')]['id']);if(_[_0x392d('0x10')](this[_0x392d('0x8')]['agents'][this['agent']['id']])){logger[_0x392d('0xf')](_0x392d('0x11'),this[_0x392d('0x6')]['id'],this[_0x392d('0x7')]['id']);setTimeout(this[_0x392d('0xc')][_0x392d('0xa')](this),0x3e8);}else{if(this[_0x392d('0x4')][_0x392d('0x12')]||util[_0x392d('0x13')](this[_0x392d('0x6')]['id'],this[_0x392d('0x8')][_0x392d('0x14')][this['agent']['id']],this['squeue']['channel'],![])){this['realtime'][_0x392d('0x14')][this[_0x392d('0x7')]['id']][_0x392d('0x15')]=!![];this[_0x392d('0x8')][_0x392d('0x14')][this[_0x392d('0x7')]['id']][_0x392d('0x16')]=undefined;util[_0x392d('0x17')](this[_0x392d('0x5')],this[_0x392d('0x6')]['id'],this['realtime'][_0x392d('0x14')][this[_0x392d('0x7')]['id']],null,this['routing']);util[_0x392d('0x18')](this[_0x392d('0x6')]['id'],this[_0x392d('0x8')][_0x392d('0x14')][this[_0x392d('0x7')]['id']],_0x392d('0x19')+(this['routing'][_0x392d('0x12')]?_0x392d('0x1a'):''));}else{logger['info'](_0x392d('0x1b'),this[_0x392d('0x6')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x392d('0xe')][_0x392d('0x9')]=function(_0x5efe46){if(_[_0x392d('0x10')](this[_0x392d('0x8')][_0x392d('0x14')][this[_0x392d('0x7')]['id']])){return logger[_0x392d('0xf')](_0x392d('0x11'),this['squeue']['id'],this[_0x392d('0x7')]['id']);}else{logger['info'](_0x392d('0x1c'),this[_0x392d('0x6')]['id'],this['agent']['id']);util[_0x392d('0x1d')](this['notificationId'],this['squeue']['id'],this['realtime'][_0x392d('0x14')][this[_0x392d('0x7')]['id']],null,this[_0x392d('0x4')]);this[_0x392d('0x8')]['agents'][this[_0x392d('0x7')]['id']][_0x392d('0x15')]=![];this[_0x392d('0x8')][_0x392d('0x14')][this[_0x392d('0x7')]['id']][_0x392d('0x16')]=undefined;util[_0x392d('0x18')](this[_0x392d('0x6')]['id'],this[_0x392d('0x8')][_0x392d('0x14')][this['agent']['id']],_0x5efe46?'STOP':'TIMEOUT');}if(!_0x5efe46){setTimeout(this[_0x392d('0xc')][_0x392d('0xa')](this),0x3e8);}};function agent(_0x12949c,_0x50717b,_0x578db6,_0x279c11){return new Agent(_0x12949c,_0x50717b,_0x578db6,_0x279c11);}module[_0x392d('0x1e')]=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 cc80b01..186ee76 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 _0xf88f=['exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','queue','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT'];(function(_0x13300a,_0x1b80aa){var _0xeecb0c=function(_0x10372f){while(--_0x10372f){_0x13300a['push'](_0x13300a['shift']());}};_0xeecb0c(++_0x1b80aa);}(_0xf88f,0x1bb));var _0xff88=function(_0x3d489b,_0x420673){_0x3d489b=_0x3d489b-0x0;var _0x538fff=_0xf88f[_0x3d489b];return _0x538fff;};'use strict';var _=require(_0xff88('0x0'));var uuid=require(_0xff88('0x1'));var util=require(_0xff88('0x2'));var logger=require(_0xff88('0x3'))(_0xff88('0x4'));var Beepall=function(_0x25c2a8,_0x184827,_0x47b3fe,_0x1bcee9){this[_0xff88('0x5')]=uuid['v4']();this[_0xff88('0x6')]=_0x25c2a8;this['queue']=_0x184827;this[_0xff88('0x7')]=_0x47b3fe;this[_0xff88('0x4')]=_0x1bcee9;this[_0xff88('0x6')][_0xff88('0x8')](this[_0xff88('0x9')][_0xff88('0xa')](this),this['handleTimeout'][_0xff88('0xa')](this));this[_0xff88('0x6')]['on'](_0xff88('0xb'),this[_0xff88('0xc')][_0xff88('0xa')](this));this[_0xff88('0x6')]['on'](_0xff88('0xd'),this[_0xff88('0xe')][_0xff88('0xa')](this));};Beepall[_0xff88('0xf')][_0xff88('0x8')]=function(){this[_0xff88('0x6')][_0xff88('0x8')](this[_0xff88('0x9')][_0xff88('0xa')](this),this['handleTimeout'][_0xff88('0xa')](this));};Beepall[_0xff88('0xf')][_0xff88('0xe')]=function(_0x50b341){this[_0xff88('0xc')](!![]);};Beepall[_0xff88('0xf')][_0xff88('0x9')]=function(_0x116712){var _0xcd256f=!![];if(!_[_0xff88('0x10')](this[_0xff88('0x11')])&&!_[_0xff88('0x10')](this['queue'][_0xff88('0x12')])&&this[_0xff88('0x11')]['Agents']['length']>0x0){for(var _0x1181a1=0x0,_0x23fbfc;_0x1181a10x0){for(var _0x49cb73=0x0,_0x38a9b0;_0x49cb730x0&&_0x2f7c45[_0x15c4a9+'CurrentCapacity']>=_0x2f7c45[_0x15c4a9+_0xbd8f('0x21')]){writeLog(_0x1628f5,_0x2f7c45,_0x15c4a9[_0xbd8f('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xbd8f('0x24')]=function(_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126){return sendNotification(!![],_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126);};exports[_0xbd8f('0x25')]=function(_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d){return sendNotification(![],_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d);};exports[_0xbd8f('0x26')]=writeLog; \ No newline at end of file +var _0x4745=['../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','online','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','toUpperCase','showNotification','lodash','util','../utils','mustache','ioredis'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4745,0x1e7));var _0x5474=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x4745[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var utils=require(_0x5474('0x2'));var Mustache=require(_0x5474('0x3'));var Redis=require(_0x5474('0x4'));var config=require(_0x5474('0x5'));var logger=require(_0x5474('0x6'))(_0x5474('0x7'));config[_0x5474('0x8')]=_[_0x5474('0x9')](config[_0x5474('0x8')],{'host':_0x5474('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5474('0x8')]));function emit(_0x431f81,_0x57add7,_0x13929f){io['to'](_0x431f81)['emit'](_0x57add7,_0x13929f);}function sendNotification(_0x902ba8,_0x3c8860,_0x4fae2b,_0xf876f8,_0x11dcb2,_0x46b4b3){io['to'](util[_0x5474('0xb')](_0x5474('0xc'),_0xf876f8[_0x5474('0xd')]))[_0x5474('0xe')](_0x5474('0xf'),_0xf876f8);var _0x48fc51=_0x46b4b3||{};var _0x38dadb=_0x4fae2b[_0x5474('0x10')]('.');var _0xdc4c23={'uniqueid':_0x3c8860,'channel':_0x38dadb[0x0],'id':_0x38dadb[0x1],'title':_0x38dadb[0x0]+_0x5474('0x11'),'interactionId':_0x38dadb[0x2],'queue':_0x11dcb2?_0x11dcb2[_0x5474('0xd')]:null,'sound':_0x48fc51[_0x5474('0x12')][_0x5474('0x13')],'shake':_0x48fc51[_0x5474('0x12')][_0x5474('0x14')]};try{if(!_0x48fc51['body']){_0x48fc51[_0x5474('0x15')]={};}if(_0x11dcb2){_0x48fc51[_0x5474('0x15')][_0x5474('0x16')]=_0x11dcb2;}else if(_0x48fc51[_0x5474('0x15')]['queue']){delete _0x48fc51['body']['queue'];}_0xdc4c23['msg']=utils[_0x5474('0x17')](_0x48fc51[_0x5474('0x12')][_0x5474('0x18')],_0x48fc51);}catch(_0x532718){_0xdc4c23[_0x5474('0x19')]=_0x5474('0x1a');logger['error'](util[_0x5474('0xb')](_0x5474('0x1b'),_0x3c8860,_0x532718[_0x5474('0x1c')]));}io['to'](util[_0x5474('0xb')](_0x5474('0xc'),_0xf876f8['name']))[_0x5474('0xe')](util['format'](_0x5474('0x1d'),_0x902ba8?_0x5474('0x1e'):'remove'),_0xdc4c23);}function writeLog(_0x504826,_0x563539,_0x1f81d6){return logger[_0x5474('0x1f')](util[_0x5474('0xb')](_0x5474('0x20'),_0x504826,_0x563539[_0x5474('0xd')],_0x1f81d6));}exports[_0x5474('0x21')]=function(_0xe4850d,_0x1e512d,_0x219be1,_0x9c80cc){if(_0x1e512d['busy']){writeLog(_0xe4850d,_0x1e512d,'BUSY');return![];}if(!_0x1e512d[_0x5474('0x22')]){writeLog(_0xe4850d,_0x1e512d,_0x5474('0x23'));return![];}if(_0x1e512d[_0x219be1+_0x5474('0x24')]){writeLog(_0xe4850d,_0x1e512d,'PAUSE');return![];}if(_0x9c80cc&&_0x1e512d[_0x5474('0x25')](_0x219be1+'Capacity')&&_0x1e512d[_0x5474('0x25')](_0x219be1+_0x5474('0x26'))){if(_0x1e512d[_0x219be1+'Capacity']>0x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 56ee7af..a8aaa27 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 _0x08d2=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','./utils','../../../../config/logger','routing'];(function(_0x422186,_0x542b0e){var _0x2fbc1a=function(_0x22ab0b){while(--_0x22ab0b){_0x422186['push'](_0x422186['shift']());}};_0x2fbc1a(++_0x542b0e);}(_0x08d2,0x182));var _0x208d=function(_0x2600fc,_0x51522f){_0x2600fc=_0x2600fc-0x0;var _0x5ade65=_0x08d2[_0x2600fc];return _0x5ade65;};'use strict';var schema=require(_0x208d('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x208d('0x1'));var logger=require(_0x208d('0x2'))(_0x208d('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x208d('0x4')}});exports[_0x208d('0x5')]=function(_0x4df5c5,_0x767054){return function(_0x295cbe){try{var _0x21e29b={'command':_0x767054[0x0]};var _0x502760=system[_0x208d('0x0')](_0x21e29b,{'typecast':!![]});if(_0x502760[_0x208d('0x6')]){logger[_0x208d('0x7')](_0x208d('0x8'),_0x4df5c5,_[_0x208d('0x9')](_0x502760,_0x208d('0xa'))[_0x208d('0xb')](',\x20'));logger[_0x208d('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4df5c5);_0x295cbe[_0x208d('0xd')]();}else{var _0x51d6d3=this;var _0x319561=utils['getMustacheRender'](_0x767054[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x4df5c5,_0x319561);sh[_0x208d('0xe')](_[_0x208d('0xf')](_0x319561),function(_0x159009,_0x2698a1){logger[_0x208d('0xc')](_0x208d('0x10'),_0x4df5c5,_0x159009);if(_0x159009==0x0){var _0x6a6204=_0x2698a1[_0x208d('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x208d('0x12')](_0x767054[0x1])||_[_0x208d('0x13')](_0x767054[0x1])){logger[_0x208d('0xc')](_0x208d('0x14'),_0x4df5c5);_0x51d6d3[_0x208d('0x15')][_0x767054[0x1]]=_0x6a6204;}else{logger[_0x208d('0xc')](_0x208d('0x16'),_0x4df5c5,_0x767054[0x1],_0x6a6204);_0x51d6d3['body'][_0x767054[0x1]]=_0x6a6204;}}_0x295cbe[_0x208d('0xd')]();});}}catch(_0x3521e5){logger['error']('[%s][SYSTEM]\x20%s',_0x4df5c5,_[_0x208d('0x17')](_0x3521e5)?JSON[_0x208d('0x18')](_0x3521e5):_0x3521e5);logger['info'](_0x208d('0x19'),_0x4df5c5);_0x295cbe[_0x208d('0xd')]();}};}; \ No newline at end of file +var _0xab55=['message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x593a37,_0x20ac5b){var _0x4bde96=function(_0x236f2d){while(--_0x236f2d){_0x593a37['push'](_0x593a37['shift']());}};_0x4bde96(++_0x20ac5b);}(_0xab55,0x139));var _0x5ab5=function(_0x564341,_0x4208c7){_0x564341=_0x564341-0x0;var _0x48222a=_0xab55[_0x564341];return _0x48222a;};'use strict';var schema=require(_0x5ab5('0x0'));var sh=require(_0x5ab5('0x1'));var _=require(_0x5ab5('0x2'));var utils=require(_0x5ab5('0x3'));var logger=require('../../../../config/logger')(_0x5ab5('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x5ab5('0x5')}});exports[_0x5ab5('0x6')]=function(_0x25955a,_0x14a49f){return function(_0x1bd410){try{var _0x37fce1={'command':_0x14a49f[0x0]};var _0x27d170=system[_0x5ab5('0x0')](_0x37fce1,{'typecast':!![]});if(_0x27d170[_0x5ab5('0x7')]){logger[_0x5ab5('0x8')](_0x5ab5('0x9'),_0x25955a,_[_0x5ab5('0xa')](_0x27d170,_0x5ab5('0xb'))[_0x5ab5('0xc')](',\x20'));logger[_0x5ab5('0xd')](_0x5ab5('0xe'),_0x25955a);_0x1bd410['next']();}else{var _0x1650bf=this;var _0xb83553=utils['getMustacheRender'](_0x14a49f[0x0],this);logger[_0x5ab5('0xd')](_0x5ab5('0xf'),_0x25955a,_0xb83553);sh[_0x5ab5('0x10')](_[_0x5ab5('0x11')](_0xb83553),function(_0x245c39,_0x30148a){logger[_0x5ab5('0xd')](_0x5ab5('0x12'),_0x25955a,_0x245c39);if(_0x245c39==0x0){var _0x5ee85b=_0x30148a[_0x5ab5('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ab5('0x14')](_0x14a49f[0x1])||_[_0x5ab5('0x15')](_0x14a49f[0x1])){logger[_0x5ab5('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x25955a);_0x1650bf[_0x5ab5('0x16')][_0x14a49f[0x1]]=_0x5ee85b;}else{logger['info'](_0x5ab5('0x17'),_0x25955a,_0x14a49f[0x1],_0x5ee85b);_0x1650bf[_0x5ab5('0x16')][_0x14a49f[0x1]]=_0x5ee85b;}}_0x1bd410[_0x5ab5('0x18')]();});}}catch(_0x33ac14){logger[_0x5ab5('0x8')](_0x5ab5('0x9'),_0x25955a,_[_0x5ab5('0x19')](_0x33ac14)?JSON[_0x5ab5('0x1a')](_0x33ac14):_0x33ac14);logger[_0x5ab5('0xd')](_0x5ab5('0xe'),_0x25955a);_0x1bd410[_0x5ab5('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 6118756..d208c71 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 _0xde2d=['../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','message','join','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x5d42fe,_0x5071ff){var _0x5b4597=function(_0x3ac70c){while(--_0x3ac70c){_0x5d42fe['push'](_0x5d42fe['shift']());}};_0x5b4597(++_0x5071ff);}(_0xde2d,0x1ea));var _0xdde2=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0xde2d[_0x3cb7c1];return _0x3f6ffc;};'use strict';var schema=require(_0xdde2('0x0'));var _=require(_0xdde2('0x1'));var rpc={'chatInteraction':require(_0xdde2('0x2')),'openchannelInteraction':require(_0xdde2('0x3')),'smsInteraction':require(_0xdde2('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xdde2('0x5'))};var logger=require(_0xdde2('0x6'))('routing');var tag=schema({'tag':{'type':_0xdde2('0x7'),'required':!![],'message':_0xdde2('0x8')}});exports[_0xdde2('0x9')]=function(_0x3a4185,_0x478b87,_0x4f6e4f,_0x146212){return function(_0x10434d){try{var _0xd9aaf9={'tag':_0x478b87[0x0]};var _0x39eb06=tag[_0xdde2('0x0')](_0xd9aaf9,{'typecast':!![]});if(_0x39eb06[_0xdde2('0xa')]){logger['error']('[%s][TAG]\x20%s',_0x3a4185,_['map'](_0x39eb06,_0xdde2('0xb'))[_0xdde2('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3a4185);_0x10434d['next']();}else{var _0x7d84e4={'ids':[_0x478b87[0x0]]};if(rpc[_0x146212[_0xdde2('0xd')]+_0xdde2('0xe')]){rpc[_0x146212['channel']+_0xdde2('0xe')][_0xdde2('0xf')](_0x146212[_0xdde2('0x10')]['id'],_0x7d84e4)['then'](function(_0x588748){logger[_0xdde2('0x11')](_0xdde2('0x12'),_0x3a4185,_0x478b87[0x1],_0x146212[_0xdde2('0xd')],_0x146212[_0xdde2('0x10')]['id']);})['catch'](function(_0x5ab5ca){logger[_0xdde2('0x13')](_0xdde2('0x14'),_0x3a4185,JSON[_0xdde2('0x15')](_0x5ab5ca));logger[_0xdde2('0x11')](_0xdde2('0x16'),_0x3a4185);})[_0xdde2('0x17')](function(){_0x10434d[_0xdde2('0x18')]();});}}}catch(_0x4541ce){logger[_0xdde2('0x13')]('[%s][TAG]\x20%s',_0x3a4185,_[_0xdde2('0x19')](_0x4541ce)?JSON['stringify'](_0x4541ce):_0x4541ce);logger[_0xdde2('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3a4185);_0x10434d[_0xdde2('0x18')]();}};}; \ No newline at end of file +var _0xaf4f=['../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','interaction','then','catch','next','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf4f,0xdb));var _0xfaf4=function(_0x1ed0d3,_0x7fceb2){_0x1ed0d3=_0x1ed0d3-0x0;var _0x3a1c39=_0xaf4f[_0x1ed0d3];return _0x3a1c39;};'use strict';var schema=require(_0xfaf4('0x0'));var _=require(_0xfaf4('0x1'));var rpc={'chatInteraction':require(_0xfaf4('0x2')),'openchannelInteraction':require(_0xfaf4('0x3')),'smsInteraction':require(_0xfaf4('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xfaf4('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xfaf4('0x6'))(_0xfaf4('0x7'));var tag=schema({'tag':{'type':_0xfaf4('0x8'),'required':!![],'message':_0xfaf4('0x9')}});exports[_0xfaf4('0xa')]=function(_0x52b7f7,_0x518c37,_0x488866,_0x2dcf60){return function(_0x33a123){try{var _0x56266b={'tag':_0x518c37[0x0]};var _0x156750=tag['validate'](_0x56266b,{'typecast':!![]});if(_0x156750[_0xfaf4('0xb')]){logger[_0xfaf4('0xc')](_0xfaf4('0xd'),_0x52b7f7,_['map'](_0x156750,_0xfaf4('0xe'))['join'](',\x20'));logger[_0xfaf4('0xf')](_0xfaf4('0x10'),_0x52b7f7);_0x33a123['next']();}else{var _0x3435f1={'ids':[_0x518c37[0x0]]};if(rpc[_0x2dcf60['channel']+_0xfaf4('0x11')]){rpc[_0x2dcf60[_0xfaf4('0x12')]+_0xfaf4('0x11')]['addTags'](_0x2dcf60[_0xfaf4('0x13')]['id'],_0x3435f1)[_0xfaf4('0x14')](function(_0x4ad1a6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x52b7f7,_0x518c37[0x1],_0x2dcf60['channel'],_0x2dcf60[_0xfaf4('0x13')]['id']);})[_0xfaf4('0x15')](function(_0x3f5a88){logger[_0xfaf4('0xc')]('[%s][TAG]\x20%s',_0x52b7f7,JSON['stringify'](_0x3f5a88));logger[_0xfaf4('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x52b7f7);})['finally'](function(){_0x33a123[_0xfaf4('0x16')]();});}}}catch(_0x6765b5){logger[_0xfaf4('0xc')](_0xfaf4('0xd'),_0x52b7f7,_[_0xfaf4('0x17')](_0x6765b5)?JSON[_0xfaf4('0x18')](_0x6765b5):_0x6765b5);logger['info'](_0xfaf4('0x10'),_0x52b7f7);_0x33a123['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 58e89fb..246e3cf 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x175178,_0xc1f0f0){var _0x5bc4b9=function(_0x5c8b20){while(--_0x5c8b20){_0x175178['push'](_0x175178['shift']());}};_0x5bc4b9(++_0xc1f0f0);}(_0xe706,0xa3));var _0x6e70=function(_0x14110b,_0x3ce4f6){_0x14110b=_0x14110b-0x0;var _0x33d8db=_0xe706[_0x14110b];return _0x33d8db;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x37d61b,_0x1c1358){var _0x2e7961=function(_0x1d187a){while(--_0x1d187a){_0x37d61b['push'](_0x37d61b['shift']());}};_0x2e7961(++_0x1c1358);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 21ec39b..30b1b1b 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 _0xef4f=['split','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xef4f,0x105));var _0xfef4=function(_0x3f8e91,_0x2c9737){_0x3f8e91=_0x3f8e91-0x0;var _0x59ff00=_0xef4f[_0x3f8e91];return _0x59ff00;};'use strict';var _=require('lodash');var util=require(_0xfef4('0x0'));var path=require(_0xfef4('0x1'));var fs=require('fs');var jayson=require(_0xfef4('0x2'));var BPromise=require('bluebird');var uuid=require(_0xfef4('0x3'));var config=require(_0xfef4('0x4'));var logger=require(_0xfef4('0x5'))(_0xfef4('0x6'));var rpc={'openchannelQueueReport':require(_0xfef4('0x7')),'mailQueueReport':require(_0xfef4('0x8')),'chatQueueReport':require(_0xfef4('0x9')),'smsQueueReport':require(_0xfef4('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xfef4('0xb'))};var RuleEngine=require(_0xfef4('0xc'));function getId(_0x519aaa,_0x4bd2fe,_0x26fe33){return util[_0xfef4('0xd')]('%s.%s.%s',_0x519aaa,_0x4bd2fe||0x0,_0x26fe33||0x0);}function getIntervals(_0x5dff51,_0x2942ba){var _0x157157=[];if(!_[_0xfef4('0xe')](_0x2942ba[_0xfef4('0xf')])&&!_[_0xfef4('0xe')](_0x5dff51[_0x2942ba[_0xfef4('0xf')]])&&!_[_0xfef4('0xe')](_0x5dff51[_0x2942ba[_0xfef4('0xf')]][_0xfef4('0x10')])){_0x157157=_['map'](_0x5dff51[_0x2942ba['IntervalId']]['Intervals'],_0xfef4('0x11'));}else if(!_[_0xfef4('0xe')](_0x2942ba[_0xfef4('0x11')])){_0x157157=[_0x2942ba[_0xfef4('0x11')]];}return _0x157157;}exports[_0xfef4('0x12')]=function(_0x33a619){_0x33a619[_0xfef4('0x13')]={};return new BPromise(function(_0x396051,_0x54d514){var _0x58c7a9={'Start':function(_0x45dde9){var _0x17210f=this;return new Promise(function(_0x1c43d1,_0x5387ee){if(_0x45dde9){try{var _0xc6fc0d=[];var _0x1e27a3=getId(_0x45dde9[_0xfef4('0x14')],_0x45dde9['message']?_0x45dde9[_0xfef4('0x15')]['id']:0x0,_0x45dde9[_0xfef4('0x16')]?_0x45dde9[_0xfef4('0x16')]['id']:0x0);if(_0x45dde9['applications']&&_[_0xfef4('0x17')](_0x45dde9[_0xfef4('0x18')])&&_0x45dde9[_0xfef4('0x18')][_0xfef4('0x19')]){for(var _0x1b898f=0x0;_0x1b898f<_0x45dde9[_0xfef4('0x18')][_0xfef4('0x19')];_0x1b898f+=0x1){var _0x1ba827=_0x45dde9[_0xfef4('0x18')][_0x1b898f];if(fs[_0xfef4('0x1a')](path[_0xfef4('0x1b')](__dirname,_0xfef4('0x18'),_0x1ba827[_0xfef4('0x1c')]+_0xfef4('0x1d')))){var _0x518e5a=[];switch(_0x1ba827[_0xfef4('0x1c')][_0xfef4('0x1e')]()){case _0xfef4('0x1f'):var _0x2d766e=_0x1ba827[_0xfef4('0x20')][_0xfef4('0x21')](',');if(_0x45dde9['channel']===_0xfef4('0x22')){_0x518e5a['push'](_0x2d766e[0x0]);_0x518e5a[_0xfef4('0x23')](_0x2d766e[0x1]);_0x518e5a[_0xfef4('0x23')](_0x2d766e[_0xfef4('0x24')](0x2,_0x2d766e[_0xfef4('0x19')])[_0xfef4('0x1b')](','));}else{_0x518e5a['push'](_0x2d766e[0x0]);_0x518e5a[_0xfef4('0x23')](_0x2d766e[_0xfef4('0x24')](0x1,_0x2d766e[_0xfef4('0x19')])[_0xfef4('0x1b')](','));}break;case'dialogflow':var _0x3f8309=_0x1ba827[_0xfef4('0x20')]['split'](',');_0x518e5a['push'](_0x3f8309[0x0]);_0x518e5a['push'](_0x3f8309[0x1]);_0x518e5a[_0xfef4('0x23')](_0x3f8309['slice'](0x2,_0x3f8309[_0xfef4('0x19')])[_0xfef4('0x1b')](','));break;case _0xfef4('0x25'):var _0x9fe015=_0x1ba827['appdata'][_0xfef4('0x21')](',');_0x518e5a[_0xfef4('0x23')](_0x9fe015[0x0]);_0x518e5a['push'](_0x9fe015[0x1]);_0x518e5a[_0xfef4('0x23')](_0x9fe015[0x2]);_0x518e5a[_0xfef4('0x23')](_0x9fe015[0x3]);_0x518e5a[_0xfef4('0x23')](_0x9fe015['slice'](0x4,_0x9fe015[_0xfef4('0x19')])['join'](','));break;case _0xfef4('0x26'):var _0x442685=_0x1ba827[_0xfef4('0x20')][_0xfef4('0x21')](',');_0x518e5a[_0xfef4('0x23')](_0x442685[0x0]);_0x518e5a[_0xfef4('0x23')](_0x442685[0x1]);_0x518e5a[_0xfef4('0x23')](_0x442685[0x2]);_0x518e5a[_0xfef4('0x23')](_0x442685[0x3]);_0x518e5a['push'](_0x442685[_0xfef4('0x24')](0x4,_0x442685[_0xfef4('0x19')])[_0xfef4('0x1b')](','));break;case _0xfef4('0x15'):_0x518e5a[_0xfef4('0x23')](_0x1ba827['appdata']);break;case _0xfef4('0x27'):_0x518e5a[_0xfef4('0x23')](_0x1ba827[_0xfef4('0x28')]);_0x518e5a[_0xfef4('0x23')](_0x1ba827[_0xfef4('0x20')]);break;default:_0x518e5a=_['isNil'](_0x1ba827[_0xfef4('0x20')])?[]:_0x1ba827[_0xfef4('0x20')]['split'](',');}var _0x34fc37={'id':util['format'](_0xfef4('0x29'),_0x1e27a3,_0x1ba827['id'],_0x1ba827[_0xfef4('0x1c')]),'condition':require(_0xfef4('0x2a'))[_0xfef4('0x2b')](_0x1e27a3,getIntervals(_0x33a619['intervals'],_0x1ba827),_0x33a619),'consequence':require(_0xfef4('0x2c')+_0x1ba827['app'])[_0xfef4('0x2d')](_0x1e27a3,_0x518e5a,_0x33a619,_0x45dde9),'p':_0x1ba827[_0xfef4('0x2e')]||0x0};logger[_0xfef4('0x2f')](_0xfef4('0x30'),_0x34fc37['id'],_0xfef4('0x31'),getIntervals(_0x33a619[_0xfef4('0x32')],_0x1ba827)[_0xfef4('0x1b')](_0xfef4('0x33')));_0xc6fc0d[_0xfef4('0x23')](_0x34fc37);}else{logger['error'](_0xfef4('0x34'),path[_0xfef4('0x1b')](__dirname,_0xfef4('0x18'),_0x1ba827[_0xfef4('0x1c')]+_0xfef4('0x1d')));}}_0x33a619[_0xfef4('0x13')][_0x1e27a3]=new RuleEngine(_0xc6fc0d);_0x33a619[_0xfef4('0x13')][_0x1e27a3][_0xfef4('0x35')](_0x45dde9,function(_0x378e08){logger['info'](_0xfef4('0x36'),JSON['stringify'](_0x378e08[_0xfef4('0x37')]));if(_0x33a619['rules'][_0x1e27a3]){_0x33a619['rules'][_0x1e27a3][_0xfef4('0x38')](_0xfef4('0x39'));}});return _0x1c43d1({'code':0xc8,'message':_0x45dde9});}else{logger[_0xfef4('0x2f')]('No\x20applications\x20to\x20execute');return _0x1c43d1({'code':0xc8,'message':_0x45dde9});}}catch(_0x3e8727){logger[_0xfef4('0x3a')](_0x3e8727[_0xfef4('0x3b')]);return _0x5387ee(_0x17210f[_0xfef4('0x3a')](0x1f4,_0x3e8727));}}return _0x5387ee(_0xfef4('0x3c'));});},'AcceptMessage':function(_0x513598){var _0x193567=this;return new Promise(function(_0x580434,_0x94e543){if(_0x513598[_0xfef4('0x3d')]&&_0x513598[_0xfef4('0x3d')]['id']){if(_0x33a619['agents'][_0x513598[_0xfef4('0x3d')]['id']]){_0x33a619[_0xfef4('0x3e')][_0x513598[_0xfef4('0x3d')]['id']][_0xfef4('0x3f')]=![];_0x33a619[_0xfef4('0x3e')][_0x513598['agent']['id']][_0xfef4('0x40')]=undefined;}}if(_0x513598[_0xfef4('0x15')]&&_0x513598[_0xfef4('0x15')]['id']){try{var _0x19b6cc=getId(_0x513598[_0xfef4('0x14')],_0x513598[_0xfef4('0x15')]?_0x513598[_0xfef4('0x15')]['id']:0x0,_0x513598[_0xfef4('0x16')]?_0x513598[_0xfef4('0x16')]['id']:0x0);if(_0x33a619[_0xfef4('0x13')][_0x19b6cc]){_0x33a619[_0xfef4('0x13')][_0x19b6cc]['emit'](_0xfef4('0x41'));if(rpc[_0x513598[_0xfef4('0x14')]+_0xfef4('0x42')]){rpc[_0x513598[_0xfef4('0x14')]+_0xfef4('0x42')][_0xfef4('0x43')](_0x19b6cc,{'UserId':_0x513598['message'][_0xfef4('0x44')]})[_0xfef4('0x45')](function(_0x3095e1){logger[_0xfef4('0x3a')](_0xfef4('0x46'));});}}return _0x580434({'code':0xc8,'message':_0x513598});}catch(_0x5d66a3){logger['error'](_0x5d66a3[_0xfef4('0x3b')]);return _0x94e543(_0x193567[_0xfef4('0x3a')](0x1f4,_0x5d66a3));}}logger[_0xfef4('0x3a')]('message\x20is\x20empty');return _0x94e543(_0x193567[_0xfef4('0x3a')](0x1f4,_0xfef4('0x47')));});},'RejectMessage':function(_0x5a9828){var _0x10a0d1=this;return new Promise(function(_0x310ef4,_0xf4006a){if(_0x5a9828[_0xfef4('0x3d')]&&_0x5a9828[_0xfef4('0x3d')]['id']){try{if(_0x33a619[_0xfef4('0x3e')][_0x5a9828[_0xfef4('0x3d')]['id']]){_0x33a619[_0xfef4('0x3e')][_0x5a9828[_0xfef4('0x3d')]['id']][_0xfef4('0x3f')]=![];_0x33a619[_0xfef4('0x3e')][_0x5a9828[_0xfef4('0x3d')]['id']][_0xfef4('0x40')]=undefined;}return _0x310ef4({'code':0xc8,'message':_0x5a9828});}catch(_0x4e1b35){logger['error'](_0x4e1b35['stack']);return _0xf4006a(_0x10a0d1[_0xfef4('0x3a')](0x1f4,_0x4e1b35));}}logger[_0xfef4('0x3a')](_0xfef4('0x47'));return _0xf4006a(_0x10a0d1['error'](0x1f4,_0xfef4('0x47')));});},'AbandonInteraction':function(_0x4ab9fa){var _0x5147d0=this;return new Promise(function(_0xcfef5a,_0x33e950){if(_0x4ab9fa[_0xfef4('0x14')]&&_0x4ab9fa['interaction']&&_0x4ab9fa[_0xfef4('0x16')]['id']){try{var _0x1b5afe=getId(_0x4ab9fa[_0xfef4('0x14')],_0x4ab9fa[_0xfef4('0x15')]?_0x4ab9fa[_0xfef4('0x15')]['id']:0x0,_0x4ab9fa[_0xfef4('0x16')]?_0x4ab9fa[_0xfef4('0x16')]['id']:0x0);if(_0x33a619[_0xfef4('0x13')][_0x1b5afe]){_0x33a619['rules'][_0x1b5afe][_0xfef4('0x38')](_0xfef4('0x41'));}return _0xcfef5a({'code':0xc8,'message':_0x4ab9fa});}catch(_0x463593){logger[_0xfef4('0x3a')](_0x463593[_0xfef4('0x3b')]);return _0x33e950(_0x5147d0[_0xfef4('0x3a')](0x1f4,_0x463593));}}logger['error'](_0xfef4('0x47'));return _0x33e950(_0x5147d0['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x592468){var _0x1778b4=this;return new Promise(function(_0x210a4c,_0x11de7a){if(_0x33a619[_0xfef4('0x3e')][_0xfef4('0x48')](_0x592468['id'])){for(var _0x4a4395 in _0x592468[_0xfef4('0x49')]){if(_0x592468[_0xfef4('0x49')][_0xfef4('0x48')](_0x4a4395)){if(_0x33a619[_0xfef4('0x3e')][_0x592468['id']][_0xfef4('0x48')](_0x4a4395+_0xfef4('0x4a'))){_0x33a619[_0xfef4('0x3e')][_0x592468['id']][_0x4a4395+_0xfef4('0x4a')]=parseInt(_0x592468[_0xfef4('0x49')][_0x4a4395],0xa);}}}_0x33a619[_0xfef4('0x3e')][_0x592468['id']][_0xfef4('0x4b')]();return _0x210a4c({'code':0xc8,'message':_0x33a619[_0xfef4('0x3e')][_0x592468['id']]});}else{return _0x11de7a(_0x1778b4[_0xfef4('0x3a')](0x1f4,_0xfef4('0x4c')));}});},'Agents':function(_0x297d89){return new Promise(function(_0x1dbf6d,_0x244f80){var _0x19bf43=_[_0xfef4('0x4d')](_0x33a619[_0xfef4('0x3e')]);_0x1dbf6d({'count':_0x19bf43['length'],'rows':_0x19bf43});});},'ChatQueues':function(_0x151de5){return new Promise(function(_0x508ca1,_0x230d02){var _0xf9a5c9=[];for(var _0x1e6f88 in _0x33a619[_0xfef4('0x4e')]){if(_0x33a619[_0xfef4('0x4e')][_0xfef4('0x48')](_0x1e6f88)){var _0xdfcc45=_0x33a619[_0xfef4('0x4e')][_0x1e6f88];var _0x43d976={'id':_0xdfcc45['id'],'available':_0xdfcc45['available'],'loggedIn':_0xdfcc45[_0xfef4('0x4f')],'name':_0xdfcc45[_0xfef4('0x50')],'paused':_0xdfcc45['paused'],'waiting':_0xdfcc45[_0xfef4('0x51')]};_0xf9a5c9[_0xfef4('0x23')](_0x43d976);}}_0x508ca1({'count':_0xf9a5c9[_0xfef4('0x19')],'rows':_0xf9a5c9});});},'MailQueues':function(_0x4d6bfd){return new Promise(function(_0x23fd12,_0x41ac53){var _0x257757=[];for(var _0x21a783 in _0x33a619[_0xfef4('0x52')]){if(_0x33a619[_0xfef4('0x52')][_0xfef4('0x48')](_0x21a783)){var _0x493f9d=_0x33a619[_0xfef4('0x52')][_0x21a783];var _0x50fdf8={'id':_0x493f9d['id'],'available':_0x493f9d[_0xfef4('0x53')],'loggedIn':_0x493f9d['loggedIn'],'name':_0x493f9d[_0xfef4('0x50')],'paused':_0x493f9d[_0xfef4('0x54')],'waiting':_0x493f9d['waiting']};_0x257757['push'](_0x50fdf8);}}_0x23fd12({'count':_0x257757[_0xfef4('0x19')],'rows':_0x257757});});},'OpenchannelQueues':function(_0x11e7d6){return new Promise(function(_0x4ff9bd,_0x56fb84){var _0x1e032f=[];for(var _0x7dcf41 in _0x33a619['openchannelQueues']){if(_0x33a619[_0xfef4('0x55')][_0xfef4('0x48')](_0x7dcf41)){var _0x413b74=_0x33a619[_0xfef4('0x55')][_0x7dcf41];var _0x27c3c5={'id':_0x413b74['id'],'available':_0x413b74[_0xfef4('0x53')],'loggedIn':_0x413b74[_0xfef4('0x4f')],'name':_0x413b74['name'],'paused':_0x413b74[_0xfef4('0x54')],'waiting':_0x413b74[_0xfef4('0x51')]};_0x1e032f[_0xfef4('0x23')](_0x27c3c5);}}_0x4ff9bd({'count':_0x1e032f['length'],'rows':_0x1e032f});});},'SmsQueues':function(_0x30c9db){return new Promise(function(_0x3a4daf,_0x306603){var _0x244c06=[];for(var _0x15ef48 in _0x33a619[_0xfef4('0x56')]){if(_0x33a619[_0xfef4('0x56')][_0xfef4('0x48')](_0x15ef48)){var _0x2121da=_0x33a619[_0xfef4('0x56')][_0x15ef48];var _0x4cb563={'id':_0x2121da['id'],'available':_0x2121da[_0xfef4('0x53')],'loggedIn':_0x2121da[_0xfef4('0x4f')],'name':_0x2121da['name'],'paused':_0x2121da[_0xfef4('0x54')],'waiting':_0x2121da[_0xfef4('0x51')]};_0x244c06[_0xfef4('0x23')](_0x4cb563);}}_0x3a4daf({'count':_0x244c06[_0xfef4('0x19')],'rows':_0x244c06});});},'FaxQueues':function(_0x20df85){return new Promise(function(_0x102f03,_0x1c15f0){var _0x43e982=[];for(var _0x3ccc5b in _0x33a619[_0xfef4('0x57')]){if(_0x33a619[_0xfef4('0x57')][_0xfef4('0x48')](_0x3ccc5b)){var _0xbd0229=_0x33a619[_0xfef4('0x57')][_0x3ccc5b];var _0x212e86={'id':_0xbd0229['id'],'available':_0xbd0229[_0xfef4('0x53')],'loggedIn':_0xbd0229[_0xfef4('0x4f')],'name':_0xbd0229[_0xfef4('0x50')],'paused':_0xbd0229[_0xfef4('0x54')],'waiting':_0xbd0229[_0xfef4('0x51')]};_0x43e982[_0xfef4('0x23')](_0x212e86);}}_0x102f03({'count':_0x43e982[_0xfef4('0x19')],'rows':_0x43e982});});},'WhatsappQueues':function(_0x5a611d){return new Promise(function(_0x2c05ab,_0x34c247){var _0xd8bba1=[];for(var _0x326f95 in _0x33a619[_0xfef4('0x58')]){if(_0x33a619[_0xfef4('0x58')][_0xfef4('0x48')](_0x326f95)){var _0x223853=_0x33a619[_0xfef4('0x58')][_0x326f95];var _0x657c13={'id':_0x223853['id'],'available':_0x223853[_0xfef4('0x53')],'loggedIn':_0x223853[_0xfef4('0x4f')],'name':_0x223853['name'],'paused':_0x223853[_0xfef4('0x54')],'waiting':_0x223853[_0xfef4('0x51')]};_0xd8bba1['push'](_0x657c13);}}_0x2c05ab({'count':_0xd8bba1[_0xfef4('0x19')],'rows':_0xd8bba1});});},'ChatQueuesWaitingInteractions':function(_0x5bc914){return new Promise(function(_0xe26b19,_0x5bd1ae){var _0x2d1490=_['values'](_0x33a619[_0xfef4('0x59')]);_0xe26b19({'count':_0x2d1490[_0xfef4('0x19')],'rows':_0x2d1490});});},'MailQueuesWaitingInteractions':function(_0x241da4){return new Promise(function(_0x5a8b64,_0x5cb4b8){var _0x1e750e=_[_0xfef4('0x4d')](_0x33a619[_0xfef4('0x5a')]);_0x5a8b64({'count':_0x1e750e[_0xfef4('0x19')],'rows':_0x1e750e});});},'OpenchannelQueuesWaitingInteractions':function(_0x2ffe1d){return new Promise(function(_0x4c21dd,_0x47b3a5){var _0x491372=_['values'](_0x33a619[_0xfef4('0x5b')]);_0x4c21dd({'count':_0x491372[_0xfef4('0x19')],'rows':_0x491372});});},'SmsQueuesWaitingInteractions':function(_0x29fa37){return new Promise(function(_0x9fdf7,_0x344570){var _0xdec84d=_[_0xfef4('0x4d')](_0x33a619['smsQueuesWaitingInteractions']);_0x9fdf7({'count':_0xdec84d[_0xfef4('0x19')],'rows':_0xdec84d});});},'FaxQueuesWaitingInteractions':function(_0x366877){return new Promise(function(_0x4702d0,_0x165123){var _0x1515b0=_[_0xfef4('0x4d')](_0x33a619[_0xfef4('0x5c')]);_0x4702d0({'count':_0x1515b0[_0xfef4('0x19')],'rows':_0x1515b0});});},'WhatsappQueuesWaitingInteractions':function(_0x2897cc){return new Promise(function(_0x220bb3,_0xd50069){var _0x3f12b8=_[_0xfef4('0x4d')](_0x33a619['whatsappQueuesWaitingInteractions']);_0x220bb3({'count':_0x3f12b8[_0xfef4('0x19')],'rows':_0x3f12b8});});}};var _0x1022ac=jayson[_0xfef4('0x5d')](_0x58c7a9)[_0xfef4('0x5e')]();_0x1022ac['on'](_0xfef4('0x3a'),function(_0x4deb96){logger[_0xfef4('0x3a')](JSON[_0xfef4('0x5f')](_0x4deb96));return _0x54d514(_0x4deb96);});_0x1022ac[_0xfef4('0x12')](0x232c,_0xfef4('0x60'),function(){console['log'](_0xfef4('0x61'),0x232c);return _0x396051('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xa51d=['update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','lodash','util','jayson/promise','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','Intervals','map','interval','isNil','listen','rules','channel','message','interaction','isArray','applications','length','app','.js','toLowerCase','autoreply','split','mail','push','slice','join','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','QueueReport'];(function(_0x441e17,_0x340ea9){var _0x3c9eb4=function(_0x3b941f){while(--_0x3b941f){_0x441e17['push'](_0x441e17['shift']());}};_0x3c9eb4(++_0x340ea9);}(_0xa51d,0x1e0));var _0xda51=function(_0x3e83f1,_0x1b09ae){_0x3e83f1=_0x3e83f1-0x0;var _0x28cd96=_0xa51d[_0x3e83f1];return _0x28cd96;};'use strict';var _=require(_0xda51('0x0'));var util=require(_0xda51('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xda51('0x2'));var BPromise=require('bluebird');var uuid=require(_0xda51('0x3'));var config=require(_0xda51('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0xda51('0x5')),'mailQueueReport':require(_0xda51('0x6')),'chatQueueReport':require(_0xda51('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xda51('0x8'))};var RuleEngine=require(_0xda51('0x9'));function getId(_0x403e48,_0x5e893b,_0x4d0540){return util[_0xda51('0xa')](_0xda51('0xb'),_0x403e48,_0x5e893b||0x0,_0x4d0540||0x0);}function getIntervals(_0x5973d9,_0x99014){var _0xcd69b2=[];if(!_['isNil'](_0x99014[_0xda51('0xc')])&&!_['isNil'](_0x5973d9[_0x99014[_0xda51('0xc')]])&&!_['isNil'](_0x5973d9[_0x99014['IntervalId']][_0xda51('0xd')])){_0xcd69b2=_[_0xda51('0xe')](_0x5973d9[_0x99014[_0xda51('0xc')]][_0xda51('0xd')],_0xda51('0xf'));}else if(!_[_0xda51('0x10')](_0x99014[_0xda51('0xf')])){_0xcd69b2=[_0x99014[_0xda51('0xf')]];}return _0xcd69b2;}exports[_0xda51('0x11')]=function(_0x46c748){_0x46c748[_0xda51('0x12')]={};return new BPromise(function(_0x26e1f9,_0x43fa9c){var _0x4556c1={'Start':function(_0x25d6ae){var _0x396f2d=this;return new Promise(function(_0x1a3acf,_0x4bf5c5){if(_0x25d6ae){try{var _0x4e5fa8=[];var _0x52f913=getId(_0x25d6ae[_0xda51('0x13')],_0x25d6ae[_0xda51('0x14')]?_0x25d6ae[_0xda51('0x14')]['id']:0x0,_0x25d6ae[_0xda51('0x15')]?_0x25d6ae[_0xda51('0x15')]['id']:0x0);if(_0x25d6ae['applications']&&_[_0xda51('0x16')](_0x25d6ae[_0xda51('0x17')])&&_0x25d6ae[_0xda51('0x17')]['length']){for(var _0x268cd9=0x0;_0x268cd9<_0x25d6ae[_0xda51('0x17')][_0xda51('0x18')];_0x268cd9+=0x1){var _0x229e38=_0x25d6ae[_0xda51('0x17')][_0x268cd9];if(fs['existsSync'](path['join'](__dirname,_0xda51('0x17'),_0x229e38[_0xda51('0x19')]+_0xda51('0x1a')))){var _0x41d997=[];switch(_0x229e38[_0xda51('0x19')][_0xda51('0x1b')]()){case _0xda51('0x1c'):var _0x3242b6=_0x229e38['appdata'][_0xda51('0x1d')](',');if(_0x25d6ae[_0xda51('0x13')]===_0xda51('0x1e')){_0x41d997['push'](_0x3242b6[0x0]);_0x41d997['push'](_0x3242b6[0x1]);_0x41d997[_0xda51('0x1f')](_0x3242b6[_0xda51('0x20')](0x2,_0x3242b6[_0xda51('0x18')])[_0xda51('0x21')](','));}else{_0x41d997[_0xda51('0x1f')](_0x3242b6[0x0]);_0x41d997[_0xda51('0x1f')](_0x3242b6[_0xda51('0x20')](0x1,_0x3242b6[_0xda51('0x18')])[_0xda51('0x21')](','));}break;case _0xda51('0x22'):var _0x4febe0=_0x229e38[_0xda51('0x23')][_0xda51('0x1d')](',');_0x41d997[_0xda51('0x1f')](_0x4febe0[0x0]);_0x41d997[_0xda51('0x1f')](_0x4febe0[0x1]);_0x41d997[_0xda51('0x1f')](_0x4febe0['slice'](0x2,_0x4febe0[_0xda51('0x18')])[_0xda51('0x21')](','));break;case _0xda51('0x24'):var _0x520591=_0x229e38[_0xda51('0x23')][_0xda51('0x1d')](',');_0x41d997['push'](_0x520591[0x0]);_0x41d997[_0xda51('0x1f')](_0x520591[0x1]);_0x41d997[_0xda51('0x1f')](_0x520591[0x2]);_0x41d997[_0xda51('0x1f')](_0x520591[0x3]);_0x41d997[_0xda51('0x1f')](_0x520591[_0xda51('0x20')](0x4,_0x520591['length'])[_0xda51('0x21')](','));break;case _0xda51('0x25'):var _0x840fdf=_0x229e38[_0xda51('0x23')]['split'](',');_0x41d997['push'](_0x840fdf[0x0]);_0x41d997['push'](_0x840fdf[0x1]);_0x41d997['push'](_0x840fdf[0x2]);_0x41d997['push'](_0x840fdf[0x3]);_0x41d997[_0xda51('0x1f')](_0x840fdf[_0xda51('0x20')](0x4,_0x840fdf[_0xda51('0x18')])['join'](','));break;case _0xda51('0x14'):_0x41d997[_0xda51('0x1f')](_0x229e38[_0xda51('0x23')]);break;case _0xda51('0x26'):_0x41d997[_0xda51('0x1f')](_0x229e38[_0xda51('0x27')]);_0x41d997[_0xda51('0x1f')](_0x229e38[_0xda51('0x23')]);break;default:_0x41d997=_[_0xda51('0x10')](_0x229e38['appdata'])?[]:_0x229e38[_0xda51('0x23')][_0xda51('0x1d')](',');}var _0x5ab7f6={'id':util[_0xda51('0xa')](_0xda51('0x28'),_0x52f913,_0x229e38['id'],_0x229e38[_0xda51('0x19')]),'condition':require(_0xda51('0x29'))['condition'](_0x52f913,getIntervals(_0x46c748[_0xda51('0x2a')],_0x229e38),_0x46c748),'consequence':require(_0xda51('0x2b')+_0x229e38[_0xda51('0x19')])[_0xda51('0x2c')](_0x52f913,_0x41d997,_0x46c748,_0x25d6ae),'p':_0x229e38['priority']||0x0};logger[_0xda51('0x2d')](_0xda51('0x2e'),_0x5ab7f6['id'],'on\x20interval',getIntervals(_0x46c748[_0xda51('0x2a')],_0x229e38)[_0xda51('0x21')]('\x20|\x20'));_0x4e5fa8[_0xda51('0x1f')](_0x5ab7f6);}else{logger['error'](_0xda51('0x2f'),path[_0xda51('0x21')](__dirname,_0xda51('0x17'),_0x229e38[_0xda51('0x19')]+_0xda51('0x1a')));}}_0x46c748[_0xda51('0x12')][_0x52f913]=new RuleEngine(_0x4e5fa8);_0x46c748[_0xda51('0x12')][_0x52f913]['execute'](_0x25d6ae,function(_0x5b27b8){logger[_0xda51('0x2d')](_0xda51('0x30'),JSON[_0xda51('0x31')](_0x5b27b8['matchPath']));if(_0x46c748[_0xda51('0x12')][_0x52f913]){_0x46c748[_0xda51('0x12')][_0x52f913]['emit'](_0xda51('0x32'));}});return _0x1a3acf({'code':0xc8,'message':_0x25d6ae});}else{logger['info'](_0xda51('0x33'));return _0x1a3acf({'code':0xc8,'message':_0x25d6ae});}}catch(_0x1a078e){logger[_0xda51('0x34')](_0x1a078e['stack']);return _0x4bf5c5(_0x396f2d[_0xda51('0x34')](0x1f4,_0x1a078e));}}return _0x4bf5c5(_0xda51('0x35'));});},'AcceptMessage':function(_0x5bb62c){var _0x52e502=this;return new Promise(function(_0xdee748,_0x3c21c0){if(_0x5bb62c['agent']&&_0x5bb62c[_0xda51('0x36')]['id']){if(_0x46c748[_0xda51('0x37')][_0x5bb62c['agent']['id']]){_0x46c748[_0xda51('0x37')][_0x5bb62c[_0xda51('0x36')]['id']][_0xda51('0x38')]=![];_0x46c748[_0xda51('0x37')][_0x5bb62c[_0xda51('0x36')]['id']][_0xda51('0x39')]=undefined;}}if(_0x5bb62c[_0xda51('0x14')]&&_0x5bb62c[_0xda51('0x14')]['id']){try{var _0x239923=getId(_0x5bb62c['channel'],_0x5bb62c['message']?_0x5bb62c[_0xda51('0x14')]['id']:0x0,_0x5bb62c['interaction']?_0x5bb62c[_0xda51('0x15')]['id']:0x0);if(_0x46c748[_0xda51('0x12')][_0x239923]){_0x46c748['rules'][_0x239923][_0xda51('0x3a')]('end');if(rpc[_0x5bb62c[_0xda51('0x13')]+_0xda51('0x3b')]){rpc[_0x5bb62c[_0xda51('0x13')]+_0xda51('0x3b')][_0xda51('0x3c')](_0x239923,{'UserId':_0x5bb62c[_0xda51('0x14')]['UserId']})[_0xda51('0x3d')](function(_0x16e2bf){logger['error'](_0xda51('0x3e'));});}}return _0xdee748({'code':0xc8,'message':_0x5bb62c});}catch(_0x308a7d){logger['error'](_0x308a7d[_0xda51('0x3f')]);return _0x3c21c0(_0x52e502[_0xda51('0x34')](0x1f4,_0x308a7d));}}logger[_0xda51('0x34')]('message\x20is\x20empty');return _0x3c21c0(_0x52e502[_0xda51('0x34')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5857ea){var _0x1a2ed6=this;return new Promise(function(_0x5d354b,_0x329314){if(_0x5857ea['agent']&&_0x5857ea[_0xda51('0x36')]['id']){try{if(_0x46c748['agents'][_0x5857ea['agent']['id']]){_0x46c748[_0xda51('0x37')][_0x5857ea[_0xda51('0x36')]['id']]['busy']=![];_0x46c748[_0xda51('0x37')][_0x5857ea[_0xda51('0x36')]['id']]['busyQueue']=undefined;}return _0x5d354b({'code':0xc8,'message':_0x5857ea});}catch(_0xac2334){logger[_0xda51('0x34')](_0xac2334['stack']);return _0x329314(_0x1a2ed6[_0xda51('0x34')](0x1f4,_0xac2334));}}logger[_0xda51('0x34')](_0xda51('0x40'));return _0x329314(_0x1a2ed6[_0xda51('0x34')](0x1f4,_0xda51('0x40')));});},'AbandonInteraction':function(_0x11b686){var _0x42a8d7=this;return new Promise(function(_0x13eca3,_0x2a02e1){if(_0x11b686['channel']&&_0x11b686[_0xda51('0x15')]&&_0x11b686[_0xda51('0x15')]['id']){try{var _0x3c0bff=getId(_0x11b686['channel'],_0x11b686[_0xda51('0x14')]?_0x11b686[_0xda51('0x14')]['id']:0x0,_0x11b686[_0xda51('0x15')]?_0x11b686[_0xda51('0x15')]['id']:0x0);if(_0x46c748[_0xda51('0x12')][_0x3c0bff]){_0x46c748[_0xda51('0x12')][_0x3c0bff][_0xda51('0x3a')]('end');}return _0x13eca3({'code':0xc8,'message':_0x11b686});}catch(_0x335394){logger[_0xda51('0x34')](_0x335394[_0xda51('0x3f')]);return _0x2a02e1(_0x42a8d7[_0xda51('0x34')](0x1f4,_0x335394));}}logger[_0xda51('0x34')](_0xda51('0x40'));return _0x2a02e1(_0x42a8d7['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x537601){var _0x3addca=this;return new Promise(function(_0x265386,_0x14c3cb){if(_0x46c748[_0xda51('0x37')][_0xda51('0x41')](_0x537601['id'])){for(var _0xc2bfa3 in _0x537601[_0xda51('0x42')]){if(_0x537601[_0xda51('0x42')]['hasOwnProperty'](_0xc2bfa3)){if(_0x46c748[_0xda51('0x37')][_0x537601['id']][_0xda51('0x41')](_0xc2bfa3+_0xda51('0x43'))){_0x46c748[_0xda51('0x37')][_0x537601['id']][_0xc2bfa3+_0xda51('0x43')]=parseInt(_0x537601[_0xda51('0x42')][_0xc2bfa3],0xa);}}}_0x46c748[_0xda51('0x37')][_0x537601['id']][_0xda51('0x44')]();return _0x265386({'code':0xc8,'message':_0x46c748[_0xda51('0x37')][_0x537601['id']]});}else{return _0x14c3cb(_0x3addca[_0xda51('0x34')](0x1f4,_0xda51('0x45')));}});},'Agents':function(_0xae522b){return new Promise(function(_0x5c15a8,_0x3fbcef){var _0x8a001d=_[_0xda51('0x46')](_0x46c748[_0xda51('0x37')]);_0x5c15a8({'count':_0x8a001d[_0xda51('0x18')],'rows':_0x8a001d});});},'ChatQueues':function(_0x511e10){return new Promise(function(_0x229511,_0xa83f81){var _0x1a61ec=[];for(var _0x1cece9 in _0x46c748[_0xda51('0x47')]){if(_0x46c748[_0xda51('0x47')]['hasOwnProperty'](_0x1cece9)){var _0x100e77=_0x46c748[_0xda51('0x47')][_0x1cece9];var _0x3b8d15={'id':_0x100e77['id'],'available':_0x100e77[_0xda51('0x48')],'loggedIn':_0x100e77[_0xda51('0x49')],'name':_0x100e77[_0xda51('0x4a')],'paused':_0x100e77[_0xda51('0x4b')],'waiting':_0x100e77['waiting']};_0x1a61ec['push'](_0x3b8d15);}}_0x229511({'count':_0x1a61ec[_0xda51('0x18')],'rows':_0x1a61ec});});},'MailQueues':function(_0x760124){return new Promise(function(_0x2bfc29,_0x22159a){var _0x42adb6=[];for(var _0x5d53bc in _0x46c748['mailQueues']){if(_0x46c748[_0xda51('0x4c')]['hasOwnProperty'](_0x5d53bc)){var _0x567ad1=_0x46c748['mailQueues'][_0x5d53bc];var _0x113384={'id':_0x567ad1['id'],'available':_0x567ad1[_0xda51('0x48')],'loggedIn':_0x567ad1[_0xda51('0x49')],'name':_0x567ad1[_0xda51('0x4a')],'paused':_0x567ad1[_0xda51('0x4b')],'waiting':_0x567ad1[_0xda51('0x4d')]};_0x42adb6[_0xda51('0x1f')](_0x113384);}}_0x2bfc29({'count':_0x42adb6[_0xda51('0x18')],'rows':_0x42adb6});});},'OpenchannelQueues':function(_0x368adc){return new Promise(function(_0xeb321f,_0x31a329){var _0x59ac87=[];for(var _0x2a9568 in _0x46c748[_0xda51('0x4e')]){if(_0x46c748[_0xda51('0x4e')][_0xda51('0x41')](_0x2a9568)){var _0x4cdc7a=_0x46c748[_0xda51('0x4e')][_0x2a9568];var _0x63fffb={'id':_0x4cdc7a['id'],'available':_0x4cdc7a[_0xda51('0x48')],'loggedIn':_0x4cdc7a[_0xda51('0x49')],'name':_0x4cdc7a[_0xda51('0x4a')],'paused':_0x4cdc7a[_0xda51('0x4b')],'waiting':_0x4cdc7a[_0xda51('0x4d')]};_0x59ac87[_0xda51('0x1f')](_0x63fffb);}}_0xeb321f({'count':_0x59ac87[_0xda51('0x18')],'rows':_0x59ac87});});},'SmsQueues':function(_0x348589){return new Promise(function(_0x9e97cf,_0x4af48c){var _0x49ea5b=[];for(var _0x4ec69e in _0x46c748[_0xda51('0x4f')]){if(_0x46c748[_0xda51('0x4f')][_0xda51('0x41')](_0x4ec69e)){var _0x6f42f4=_0x46c748[_0xda51('0x4f')][_0x4ec69e];var _0xc908d5={'id':_0x6f42f4['id'],'available':_0x6f42f4[_0xda51('0x48')],'loggedIn':_0x6f42f4[_0xda51('0x49')],'name':_0x6f42f4['name'],'paused':_0x6f42f4[_0xda51('0x4b')],'waiting':_0x6f42f4[_0xda51('0x4d')]};_0x49ea5b[_0xda51('0x1f')](_0xc908d5);}}_0x9e97cf({'count':_0x49ea5b[_0xda51('0x18')],'rows':_0x49ea5b});});},'FaxQueues':function(_0x50ab21){return new Promise(function(_0x143ff0,_0x4de08f){var _0x22bbe9=[];for(var _0x1c3651 in _0x46c748[_0xda51('0x50')]){if(_0x46c748[_0xda51('0x50')][_0xda51('0x41')](_0x1c3651)){var _0x5f4b01=_0x46c748[_0xda51('0x50')][_0x1c3651];var _0x359468={'id':_0x5f4b01['id'],'available':_0x5f4b01[_0xda51('0x48')],'loggedIn':_0x5f4b01[_0xda51('0x49')],'name':_0x5f4b01['name'],'paused':_0x5f4b01[_0xda51('0x4b')],'waiting':_0x5f4b01['waiting']};_0x22bbe9['push'](_0x359468);}}_0x143ff0({'count':_0x22bbe9[_0xda51('0x18')],'rows':_0x22bbe9});});},'WhatsappQueues':function(_0x40b652){return new Promise(function(_0x21f408,_0x52c405){var _0x19e1c2=[];for(var _0x5e0abb in _0x46c748[_0xda51('0x51')]){if(_0x46c748[_0xda51('0x51')][_0xda51('0x41')](_0x5e0abb)){var _0x3eb2a8=_0x46c748[_0xda51('0x51')][_0x5e0abb];var _0x734dc5={'id':_0x3eb2a8['id'],'available':_0x3eb2a8[_0xda51('0x48')],'loggedIn':_0x3eb2a8['loggedIn'],'name':_0x3eb2a8[_0xda51('0x4a')],'paused':_0x3eb2a8[_0xda51('0x4b')],'waiting':_0x3eb2a8[_0xda51('0x4d')]};_0x19e1c2[_0xda51('0x1f')](_0x734dc5);}}_0x21f408({'count':_0x19e1c2['length'],'rows':_0x19e1c2});});},'ChatQueuesWaitingInteractions':function(_0x540656){return new Promise(function(_0x27574b,_0x221a7c){var _0x230f7d=_[_0xda51('0x46')](_0x46c748[_0xda51('0x52')]);_0x27574b({'count':_0x230f7d[_0xda51('0x18')],'rows':_0x230f7d});});},'MailQueuesWaitingInteractions':function(_0xf3d622){return new Promise(function(_0x42bdbb,_0x48e091){var _0x280cfe=_['values'](_0x46c748['mailQueuesWaitingInteractions']);_0x42bdbb({'count':_0x280cfe['length'],'rows':_0x280cfe});});},'OpenchannelQueuesWaitingInteractions':function(_0x45d3dd){return new Promise(function(_0x4ddd1c,_0x4fdfa6){var _0x1bc5c8=_['values'](_0x46c748['openchannelQueuesWaitingInteractions']);_0x4ddd1c({'count':_0x1bc5c8['length'],'rows':_0x1bc5c8});});},'SmsQueuesWaitingInteractions':function(_0xd9308c){return new Promise(function(_0x17f986,_0x28ee2a){var _0x487ccc=_[_0xda51('0x46')](_0x46c748[_0xda51('0x53')]);_0x17f986({'count':_0x487ccc[_0xda51('0x18')],'rows':_0x487ccc});});},'FaxQueuesWaitingInteractions':function(_0x1d59ca){return new Promise(function(_0x219a29,_0x4f17ef){var _0x3c30cc=_['values'](_0x46c748[_0xda51('0x54')]);_0x219a29({'count':_0x3c30cc[_0xda51('0x18')],'rows':_0x3c30cc});});},'WhatsappQueuesWaitingInteractions':function(_0x2cbde7){return new Promise(function(_0x2bc4f3,_0x6e104b){var _0x3302cd=_['values'](_0x46c748[_0xda51('0x55')]);_0x2bc4f3({'count':_0x3302cd[_0xda51('0x18')],'rows':_0x3302cd});});}};var _0x5e3e7d=jayson[_0xda51('0x56')](_0x4556c1)[_0xda51('0x57')]();_0x5e3e7d['on'](_0xda51('0x34'),function(_0x2f791a){logger[_0xda51('0x34')](JSON[_0xda51('0x31')](_0x2f791a));return _0x43fa9c(_0x2f791a);});_0x5e3e7d[_0xda51('0x11')](0x232c,_0xda51('0x58'),function(){console[_0xda51('0x59')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x26e1f9('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 31fcc9e..2532401 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 _0x3184=['jayson/promise','../../../config/logger','routing','http','then','error','message','result','condition','length','push','Command','iftime\x20%s','indexOf','true','catch','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird'];(function(_0xaa661c,_0x4ca3e4){var _0x9f75a3=function(_0x3c95f0){while(--_0x3c95f0){_0xaa661c['push'](_0xaa661c['shift']());}};_0x9f75a3(++_0x4ca3e4);}(_0x3184,0x186));var _0x4318=function(_0x6b23f3,_0x4189c9){_0x6b23f3=_0x6b23f3-0x0;var _0x473e8f=_0x3184[_0x6b23f3];return _0x473e8f;};'use strict';var util=require(_0x4318('0x0'));var BPromise=require(_0x4318('0x1'));var jayson=require(_0x4318('0x2'));var _=require('lodash');var logger=require(_0x4318('0x3'))(_0x4318('0x4'));var client=jayson['client'][_0x4318('0x5')]({'port':0x232a});function request(_0x2ecb53,_0x5364e6){return new BPromise(function(_0x306d76,_0x5a24a2){return client['request'](_0x2ecb53,_0x5364e6)[_0x4318('0x6')](function(_0x5bef59){if(_0x5bef59[_0x4318('0x7')]){return _0x5a24a2(_0x5bef59['error'][_0x4318('0x8')]);}else{return _0x306d76(_0x5bef59[_0x4318('0x9')]);}})['catch'](function(_0x2b7a07){return _0x5a24a2(_0x2b7a07);});});}exports[_0x4318('0xa')]=function(_0x1af914,_0x591f31,_0xf711ac){return function(_0x339e96){if(_0xf711ac['rules']&&!_0xf711ac['rules'][_0x1af914]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1af914);return _0x339e96['stop']();}var _0x5556ae=[];for(var _0x569108=0x0;_0x569108<_0x591f31[_0x4318('0xb')];_0x569108+=0x1){_0x5556ae[_0x4318('0xc')](request(_0x4318('0xd'),{'command':util['format'](_0x4318('0xe'),_0x591f31[_0x569108])})[_0x4318('0x6')](function(_0x3b9090){return _0x3b9090&&_0x3b9090['message']&&_0x3b9090[_0x4318('0x8')][_0x4318('0xf')](_0x4318('0x10'))>=0x0?!![]:![];})[_0x4318('0x11')](function(_0x1ea4f3){logger['error']('[%s][INTERVAL]\x20%s',_0x1af914,_0x591f31[_0x569108]);}));}BPromise[_0x4318('0x12')](_0x5556ae)[_0x4318('0x6')](function(_0x5b957a){var _0x49368b=_[_0x4318('0x13')](_0x5b957a);logger[_0x4318('0x14')](_0x4318('0x15'),_0x1af914,_0x591f31[_0x4318('0x16')](_0x4318('0x17')),_0x49368b);_0x339e96[_0x4318('0x18')](_0x49368b);})[_0x4318('0x11')](function(_0x1aecb9){console[_0x4318('0x19')](_0x1aecb9);logger['error'](_0x4318('0x15'),_0x1af914,_0x591f31[_0x4318('0x16')](_0x4318('0x17')),_0x1aecb9[_0x4318('0x1a')]);_0x339e96[_0x4318('0x1b')]();});};}; \ No newline at end of file +var _0xa167=['../../../config/logger','http','request','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','then','true','all','some','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','jayson/promise','lodash'];(function(_0x38110e,_0x5bd177){var _0x5d4946=function(_0x55df5f){while(--_0x55df5f){_0x38110e['push'](_0x38110e['shift']());}};_0x5d4946(++_0x5bd177);}(_0xa167,0xef));var _0x7a16=function(_0x704e4,_0x19ce4f){_0x704e4=_0x704e4-0x0;var _0x42ffae=_0xa167[_0x704e4];return _0x42ffae;};'use strict';var util=require(_0x7a16('0x0'));var BPromise=require(_0x7a16('0x1'));var jayson=require(_0x7a16('0x2'));var _=require(_0x7a16('0x3'));var logger=require(_0x7a16('0x4'))('routing');var client=jayson['client'][_0x7a16('0x5')]({'port':0x232a});function request(_0x416f7a,_0x1f3a76){return new BPromise(function(_0x4bf378,_0x2a188c){return client[_0x7a16('0x6')](_0x416f7a,_0x1f3a76)['then'](function(_0x15358e){if(_0x15358e[_0x7a16('0x7')]){return _0x2a188c(_0x15358e[_0x7a16('0x7')][_0x7a16('0x8')]);}else{return _0x4bf378(_0x15358e[_0x7a16('0x9')]);}})[_0x7a16('0xa')](function(_0x324c33){return _0x2a188c(_0x324c33);});});}exports['condition']=function(_0x3101d6,_0x281cb5,_0x3cc62e){return function(_0x1d7724){if(_0x3cc62e[_0x7a16('0xb')]&&!_0x3cc62e['rules'][_0x3101d6]){logger[_0x7a16('0xc')](_0x7a16('0xd'),_0x3101d6);return _0x1d7724[_0x7a16('0xe')]();}var _0x49e5c5=[];for(var _0x5a0ffa=0x0;_0x5a0ffa<_0x281cb5[_0x7a16('0xf')];_0x5a0ffa+=0x1){_0x49e5c5[_0x7a16('0x10')](request(_0x7a16('0x11'),{'command':util['format'](_0x7a16('0x12'),_0x281cb5[_0x5a0ffa])})[_0x7a16('0x13')](function(_0xe4475){return _0xe4475&&_0xe4475['message']&&_0xe4475['message']['indexOf'](_0x7a16('0x14'))>=0x0?!![]:![];})[_0x7a16('0xa')](function(_0x352731){logger[_0x7a16('0x7')]('[%s][INTERVAL]\x20%s',_0x3101d6,_0x281cb5[_0x5a0ffa]);}));}BPromise[_0x7a16('0x15')](_0x49e5c5)[_0x7a16('0x13')](function(_0x345548){var _0x4783e0=_[_0x7a16('0x16')](_0x345548);logger[_0x7a16('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x3101d6,_0x281cb5[_0x7a16('0x17')](_0x7a16('0x18')),_0x4783e0);_0x1d7724['when'](_0x4783e0);})[_0x7a16('0xa')](function(_0x4cf34c){console[_0x7a16('0x19')](_0x4cf34c);logger[_0x7a16('0x7')](_0x7a16('0x1a'),_0x3101d6,_0x281cb5[_0x7a16('0x17')](_0x7a16('0x18')),_0x4cf34c['stack']);_0x1d7724[_0x7a16('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d2e3575..bb0fb36 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 _0x0972=['clone','calleridname','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','util','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0972,0x64));var _0x2097=function(_0x236f14,_0xbbaf6a){_0x236f14=_0x236f14-0x0;var _0x3eccb4=_0x0972[_0x236f14];return _0x3eccb4;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1c7a40,_0x4ec7aa){utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1c7a40[_0x2097('0x3')],_0x1c7a40[_0x2097('0x4')],_0x1c7a40[_0x2097('0x5')],_0x1c7a40[_0x2097('0x6')],_0x1c7a40[_0x2097('0x7')],_0x1c7a40[_0x2097('0x8')],_0x1c7a40[_0x2097('0x9')],_0x1c7a40['lastevent']));if(_0x1c7a40[_0x2097('0x5')]){utils[_0x2097('0xa')](_0x1c7a40[_0x2097('0x5')])[_0x2097('0xb')](function(_0x3b8fac){if(_0x3b8fac){_0x1c7a40['type']=_0x3b8fac[_0x2097('0xc')];_0x1c7a40[_0x2097('0xd')]=_0x1c7a40[_0x2097('0xe')]?_0x3b8fac[_0x2097('0xf')]:![];_0x1c7a40[_0x2097('0x10')]=_0x1c7a40[_0x2097('0xd')]?_0x3b8fac[_0x2097('0x11')]:0x0;}utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);});}else{utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);}if(_0x4ec7aa){delete transfers[_0x1c7a40[_0x2097('0x3')]];}else{delete agents[_0x1c7a40[_0x2097('0x14')]];}}exports[_0x2097('0x15')]=function(_0x24ca42){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x24ca42);agents[_0x24ca42[_0x2097('0x14')]]=_0x24ca42;agents[_0x24ca42['destuniqueid']][_0x2097('0x18')]=utils[_0x2097('0x19')]();agents[_0x24ca42['destuniqueid']]['lastevent']='called';agents[_0x24ca42[_0x2097('0x14')]]['connectedlinenum']=null;agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x1a')]=null;utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x1b'),_0x24ca42['uniqueid'],agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x6')],_0x24ca42[_0x2097('0x14')]));}catch(_0x34654a){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x34654a);}};exports['agentringnoanswer']=function(_0x4d957e){try{if(!_[_0x2097('0x1d')](agents[_0x4d957e['destuniqueid']])){utils[_0x2097('0x16')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x4d957e);utils['info'](util[_0x2097('0x2')](_0x2097('0x1e'),_0x4d957e[_0x2097('0x3')],agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x6')],_0x4d957e[_0x2097('0x14')]));agents[_0x4d957e['destuniqueid']][_0x2097('0x1f')]=!![];agents[_0x4d957e['destuniqueid']][_0x2097('0x20')]=utils[_0x2097('0x19')]();agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x21')]='timeout';agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x22')]='timeout';agents[_0x4d957e[_0x2097('0x14')]]['holdtime']=_0x4d957e[_0x2097('0x23')]?parseInt(_0x4d957e['ringtime'])/0x3e8:0x0;agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x24')]=0x0;unanswered[_0x2097('0x25')](_0x4d957e[_0x2097('0x14')]);}}catch(_0x410afa){utils[_0x2097('0x1c')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x410afa);}};exports[_0x2097('0x26')]=function(_0x5cce55){try{_[_0x2097('0x27')](agents,function(_0x41487d,_0x59fb84){if(_0x41487d['uniqueid']==_0x5cce55[_0x2097('0x3')]&&!_[_0x2097('0x28')](unanswered,_0x41487d[_0x2097('0x14')])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x5cce55);utils[_0x2097('0x1')](util['format'](_0x2097('0x2a'),_0x5cce55[_0x2097('0x3')],_0x41487d[_0x2097('0x6')],_0x41487d[_0x2097('0x14')]));_0x41487d[_0x2097('0x1f')]=!![];_0x41487d[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x41487d[_0x2097('0x21')]=_0x2097('0x2b');_0x41487d['reason']=_0x2097('0x2b');_0x41487d[_0x2097('0x2c')]=_0x5cce55[_0x2097('0x2c')];_0x41487d['talktime']=0x0;writeDB(_0x41487d);}});}catch(_0x3d97ee){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x3d97ee);}};exports['agentconnect']=function(_0x5689f6){try{if(agents[_0x5689f6[_0x2097('0x14')]]){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x5689f6);utils[_0x2097('0x1')](util['format'](_0x2097('0x2e'),_0x5689f6[_0x2097('0x3')],agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x6')],_0x5689f6[_0x2097('0x14')]));agents[_0x5689f6[_0x2097('0x14')]]['agentconnectAt']=utils[_0x2097('0x19')]();agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x9')]=_0x5689f6['connectedlinenum'];agents[_0x5689f6['destuniqueid']][_0x2097('0x1a')]=_0x5689f6[_0x2097('0x1a')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x2c')]=_0x5689f6[_0x2097('0x23')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x21')]=_0x2097('0x2f');_[_0x2097('0x27')](agents,function(_0x3bfb5c,_0x337979){if(_0x3bfb5c[_0x2097('0x14')]!=_0x5689f6['destuniqueid']&&_0x3bfb5c[_0x2097('0x3')]==_0x5689f6[_0x2097('0x3')]){_0x3bfb5c[_0x2097('0x24')]=0x0;_0x3bfb5c['holdtime']=_0x5689f6[_0x2097('0x23')];_0x3bfb5c[_0x2097('0x1f')]=!![];_0x3bfb5c[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x3bfb5c[_0x2097('0x21')]=_0x2097('0x30');_0x3bfb5c[_0x2097('0x22')]=_0x2097('0x30');_0x3bfb5c['answeredelsewheredestinationuniqueid']=_0x5689f6[_0x2097('0x14')];_0x3bfb5c[_0x2097('0x31')]=_0x5689f6[_0x2097('0x6')];writeDB(_0x3bfb5c);}});}}catch(_0x3288ae){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x3288ae);}};exports['agentcomplete']=function(_0x3fc3fe){try{if(!_['isNil'](agents[_0x3fc3fe[_0x2097('0x14')]])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x32'),_0x3fc3fe[_0x2097('0x3')]),_0x3fc3fe);utils['info'](util[_0x2097('0x2')](_0x2097('0x33'),_0x3fc3fe[_0x2097('0x3')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x6')],_0x3fc3fe['destuniqueid']));agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0xe')]=!![];agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x34')]=utils[_0x2097('0x19')]();agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x3fc3fe['destuniqueid']][_0x2097('0x34')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x36')]);agents[_0x3fc3fe[_0x2097('0x14')]]['reason']=_0x3fc3fe['reason'];agents[_0x3fc3fe['destuniqueid']][_0x2097('0x21')]=_0x2097('0x37');writeDB(agents[_0x3fc3fe['destuniqueid']]);}}catch(_0x10577d){utils[_0x2097('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x3fc3fe[_0x2097('0x3')]),_0x10577d);}};exports[_0x2097('0x38')]=function(_0x1b4de6){try{if(!_['isNil'](agents[_0x1b4de6[_0x2097('0x39')]])){utils[_0x2097('0x16')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x1b4de6);utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x3b'),_0x1b4de6['uniqueid'],agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x6')],agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3')]));agents[_0x1b4de6['transfereruniqueid']]['transfer']=!![];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3c')]='blind';agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3d')]=_0x1b4de6[_0x2097('0x3e')];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3f')]=agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x3')];}}catch(_0x228b60){utils[_0x2097('0x1c')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x228b60);}};exports['attendedtransfer']=function(_0x12ba76){try{utils['debug'](util[_0x2097('0x2')]('[%s][agents][attendedtransfer]',_0x12ba76['origtransfereruniqueid']),_0x12ba76);if(_0x12ba76['origtransfereruniqueid']==_0x12ba76[_0x2097('0x40')]){if(!_['isNil'](agents[_0x12ba76['secondtransfereruniqueid']])){utils[_0x2097('0x1')](util['format'](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76['secondtransfereruniqueid']][_0x2097('0x6')]));agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3c')]='ATTENDED';agents[_0x12ba76[_0x2097('0x43')]]['transferexten']=_0x12ba76[_0x2097('0x45')];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3f')]=_0x12ba76['origtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x46')]&&agents[_0x12ba76[_0x2097('0x46')]]){agents[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x46')]]=_['clone'](agents[_0x12ba76['transfereeuniqueid']]);transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x8')]=agents[_0x12ba76['secondtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76['transfereeuniqueid']]['calleridname']=agents[_0x12ba76[_0x2097('0x43')]]['calleridname'];transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x2c')]=0x0;transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x2;}}else if(_0x12ba76[_0x2097('0x43')]==_0x12ba76[_0x2097('0x48')]){if(!_['isNil'](agents[_0x12ba76[_0x2097('0x42')]])){utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76[_0x2097('0x42')]]['membername']));agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x3c')]=_0x2097('0x49');agents[_0x12ba76['origtransfereruniqueid']][_0x2097('0x3d')]=_0x12ba76[_0x2097('0x4a')];agents[_0x12ba76['origtransfereruniqueid']]['transferuniqueid']=_0x12ba76['secondtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x4b')]&&agents[_0x12ba76[_0x2097('0x4b')]]){agents[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x4b')]]=_[_0x2097('0x4c')](agents[_0x12ba76[_0x2097('0x4b')]]);transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x8')]=agents[_0x12ba76['origtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x4d')]=agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x4d')];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x4b')]]['holdtime']=0x0;transfers[_0x12ba76['transfertargetuniqueid']][_0x2097('0x47')]=0x2;}}}catch(_0x345a12){utils['error'](util[_0x2097('0x2')](_0x2097('0x4e'),_0x12ba76[_0x2097('0x42')]),_0x345a12);}};exports[_0x2097('0x4f')]=function(_0x1f824f){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f['uniqueid']),_0x1f824f);if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f[_0x2097('0x3')]]['reason']===_0x2097('0x51')){if(_0x1f824f[_0x2097('0x52')]==='21'){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x53');agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x53');}utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f['uniqueid'],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f[_0x2097('0x3')]]);var _0x2a950f=unanswered[_0x2097('0x55')](_0x1f824f['uniqueid']);if(_0x2a950f>-0x1){unanswered[_0x2097('0x56')](_0x2a950f,0x1);}}if(transfers[_0x1f824f['uniqueid']]){transfers[_0x1f824f[_0x2097('0x3')]]['agentcomplete']=!![];transfers[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();transfers[_0x1f824f['uniqueid']][_0x2097('0x24')]=utils[_0x2097('0x35')](transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x34')],transfers[_0x1f824f[_0x2097('0x3')]]['agentconnectAt']);transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x57');transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f[_0x2097('0x3')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]));writeDB(transfers[_0x1f824f['uniqueid']],!![]);}if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f['uniqueid']]['agentconnectAt']){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0xe')]=!![];agents[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x1f824f['uniqueid']][_0x2097('0x34')],agents[_0x1f824f['uniqueid']][_0x2097('0x36')]);agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=agents[_0x1f824f[_0x2097('0x3')]]['transfer']?_0x2097('0x44'):_0x2097('0x57');agents[_0x1f824f[_0x2097('0x3')]]['lastevent']=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1f824f[_0x2097('0x3')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f['uniqueid']]);}}catch(_0xc7481d){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f[_0x2097('0x3')]),_0xc7481d);}}; \ No newline at end of file +var _0x0102=['agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','util','./utils','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]'];(function(_0x314d54,_0x5b2a85){var _0x397a18=function(_0x320e05){while(--_0x320e05){_0x314d54['push'](_0x314d54['shift']());}};_0x397a18(++_0x5b2a85);}(_0x0102,0x186));var _0x2010=function(_0x54ee7b,_0x2d7f14){_0x54ee7b=_0x54ee7b-0x0;var _0x464e22=_0x0102[_0x54ee7b];return _0x464e22;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var utils=require(_0x2010('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34c31e,_0x9ae519){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34c31e['uniqueid'],_0x34c31e['channel'],_0x34c31e[_0x2010('0x2')],_0x34c31e[_0x2010('0x3')],_0x34c31e[_0x2010('0x4')],_0x34c31e[_0x2010('0x5')],_0x34c31e['connectedlinenum'],_0x34c31e[_0x2010('0x6')]));if(_0x34c31e['queue']){utils[_0x2010('0x7')](_0x34c31e[_0x2010('0x2')])['then'](function(_0x1f94ca){if(_0x1f94ca){_0x34c31e[_0x2010('0x8')]=_0x1f94ca[_0x2010('0x8')];_0x34c31e[_0x2010('0x9')]=_0x34c31e[_0x2010('0xa')]?_0x1f94ca[_0x2010('0xb')]:![];_0x34c31e[_0x2010('0xc')]=_0x34c31e[_0x2010('0x9')]?_0x1f94ca[_0x2010('0xd')]:0x0;}utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);});}else{utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);}if(_0x9ae519){delete transfers[_0x34c31e[_0x2010('0x10')]];}else{delete agents[_0x34c31e[_0x2010('0x11')]];}}exports[_0x2010('0x12')]=function(_0x528a38){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38[_0x2010('0x10')]),_0x528a38);agents[_0x528a38[_0x2010('0x11')]]=_0x528a38;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x15')]=utils['now']();agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x6')]='called';agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x16')]=null;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x17')]=null;utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x19'),_0x528a38[_0x2010('0x10')],agents[_0x528a38[_0x2010('0x11')]]['membername'],_0x528a38['destuniqueid']));}catch(_0x3c72a8){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38['uniqueid']),_0x3c72a8);}};exports['agentringnoanswer']=function(_0x22c252){try{if(!_[_0x2010('0x1b')](agents[_0x22c252[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x1d'),_0x22c252['uniqueid']),_0x22c252);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x22c252['uniqueid'],agents[_0x22c252['destuniqueid']][_0x2010('0x3')],_0x22c252['destuniqueid']));agents[_0x22c252[_0x2010('0x11')]]['agentringnoanswer']=!![];agents[_0x22c252['destuniqueid']][_0x2010('0x1e')]=utils[_0x2010('0x1f')]();agents[_0x22c252['destuniqueid']][_0x2010('0x6')]='timeout';agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x20')]=_0x2010('0x21');agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x22')]=_0x22c252[_0x2010('0x23')]?parseInt(_0x22c252[_0x2010('0x23')])/0x3e8:0x0;agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x24')]=0x0;unanswered[_0x2010('0x25')](_0x22c252[_0x2010('0x11')]);}}catch(_0x2ebdbb){utils['error'](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]',_0x22c252[_0x2010('0x10')]),_0x2ebdbb);}};exports[_0x2010('0x26')]=function(_0xd16c04){try{_[_0x2010('0x27')](agents,function(_0x564a64,_0x554f66){if(_0x564a64[_0x2010('0x10')]==_0xd16c04['uniqueid']&&!_[_0x2010('0x28')](unanswered,_0x564a64[_0x2010('0x11')])){utils['debug'](util[_0x2010('0x13')](_0x2010('0x29'),_0xd16c04[_0x2010('0x10')]),_0xd16c04);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd16c04[_0x2010('0x10')],_0x564a64[_0x2010('0x3')],_0x564a64[_0x2010('0x11')]));_0x564a64['agentringnoanswer']=!![];_0x564a64['agentringnoanswerAt']=utils[_0x2010('0x1f')]();_0x564a64[_0x2010('0x6')]=_0x2010('0x2a');_0x564a64['reason']='abandoned';_0x564a64[_0x2010('0x22')]=_0xd16c04[_0x2010('0x22')];_0x564a64[_0x2010('0x24')]=0x0;writeDB(_0x564a64);}});}catch(_0x339fd2){utils[_0x2010('0x1a')](util['format']('[%s][agents][queuecallerabandon]',_0xd16c04['uniqueid']),_0x339fd2);}};exports[_0x2010('0x2b')]=function(_0x447eed){try{if(agents[_0x447eed[_0x2010('0x11')]]){utils['debug'](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x447eed);utils[_0x2010('0x18')](util['format'](_0x2010('0x2d'),_0x447eed[_0x2010('0x10')],agents[_0x447eed[_0x2010('0x11')]]['membername'],_0x447eed[_0x2010('0x11')]));agents[_0x447eed['destuniqueid']][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x16')]=_0x447eed[_0x2010('0x16')];agents[_0x447eed[_0x2010('0x11')]]['connectedlinename']=_0x447eed[_0x2010('0x17')];agents[_0x447eed['destuniqueid']][_0x2010('0x22')]=_0x447eed[_0x2010('0x23')];agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x2f');_[_0x2010('0x27')](agents,function(_0x398f10,_0x36ff3e){if(_0x398f10[_0x2010('0x11')]!=_0x447eed[_0x2010('0x11')]&&_0x398f10[_0x2010('0x10')]==_0x447eed[_0x2010('0x10')]){_0x398f10[_0x2010('0x24')]=0x0;_0x398f10[_0x2010('0x22')]=_0x447eed['ringtime'];_0x398f10['agentringnoanswer']=!![];_0x398f10[_0x2010('0x1e')]=utils[_0x2010('0x1f')]();_0x398f10[_0x2010('0x6')]=_0x2010('0x30');_0x398f10[_0x2010('0x20')]=_0x2010('0x30');_0x398f10[_0x2010('0x31')]=_0x447eed['destuniqueid'];_0x398f10[_0x2010('0x32')]=_0x447eed['membername'];writeDB(_0x398f10);}});}}catch(_0x27fd64){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x27fd64);}};exports['agentcomplete']=function(_0x364338){try{if(!_[_0x2010('0x1b')](agents[_0x364338[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util['format'](_0x2010('0x33'),_0x364338['uniqueid']),_0x364338);utils['info'](util['format'](_0x2010('0x34'),_0x364338[_0x2010('0x10')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x3')],_0x364338[_0x2010('0x11')]));agents[_0x364338[_0x2010('0x11')]]['agentcomplete']=!![];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();agents[_0x364338['destuniqueid']]['talktime']=utils[_0x2010('0x36')](agents[_0x364338['destuniqueid']][_0x2010('0x35')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x2e')]);agents[_0x364338[_0x2010('0x11')]]['reason']=_0x364338[_0x2010('0x20')];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x37');writeDB(agents[_0x364338[_0x2010('0x11')]]);}}catch(_0x2a53b3){utils['error'](util[_0x2010('0x13')](_0x2010('0x33'),_0x364338[_0x2010('0x10')]),_0x2a53b3);}};exports['blindtransfer']=function(_0x30e5d0){try{if(!_[_0x2010('0x1b')](agents[_0x30e5d0['transfereruniqueid']])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x30e5d0);utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x39'),_0x30e5d0[_0x2010('0x10')],agents[_0x30e5d0['transfereruniqueid']]['membername'],agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')]));agents[_0x30e5d0['transfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3c')]=_0x2010('0x3d');agents[_0x30e5d0[_0x2010('0x3a')]]['transferexten']=_0x30e5d0['extension'];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3e')]=agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')];}}catch(_0x38e596){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x38e596);}};exports[_0x2010('0x3f')]=function(_0x1cc164){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x40'),_0x1cc164['origtransfereruniqueid']),_0x1cc164);if(_0x1cc164[_0x2010('0x41')]==_0x1cc164[_0x2010('0x42')]){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x43')]])){utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3')]));agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3b')]=!![];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x46')]=_0x1cc164[_0x2010('0x47')];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3e')]=_0x1cc164[_0x2010('0x41')];}if(_0x1cc164[_0x2010('0x48')]&&agents[_0x1cc164[_0x2010('0x48')]]){agents[_0x1cc164['transfereeuniqueid']][_0x2010('0x49')]=0x1;transfers[_0x1cc164['transfereeuniqueid']]=_['clone'](agents[_0x1cc164[_0x2010('0x48')]]);transfers[_0x1cc164[_0x2010('0x48')]]['calleridnum']=agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x4a')]=agents[_0x1cc164['secondtransfereruniqueid']][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x15')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164['transfereeuniqueid']][_0x2010('0x2e')]=utils['now']();transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x49')]=0x2;}}else if(_0x1cc164['secondtransfereruniqueid']==_0x1cc164['secondtransfererlinkedid']){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x41')]])){utils['info'](util['format'](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3')]));agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x46')]=_0x1cc164['secondtransfererexten'];agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3e')]=_0x1cc164['secondtransfereruniqueid'];}if(_0x1cc164[_0x2010('0x4b')]&&agents[_0x1cc164[_0x2010('0x4b')]]){agents[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x49')]=0x1;transfers[_0x1cc164[_0x2010('0x4b')]]=_[_0x2010('0x4c')](agents[_0x1cc164[_0x2010('0x4b')]]);transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x5')]=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x4b')]]['calleridname']=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x4b')]]['agentcalledAt']=utils['now']();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x4b')]]['agententerreason']=0x2;}}}catch(_0xe37cef){utils[_0x2010('0x1a')](util[_0x2010('0x13')]('[%s][agents][attendedtransfer]',_0x1cc164[_0x2010('0x41')]),_0xe37cef);}};exports[_0x2010('0x4d')]=function(_0x13d06d){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x4e'),_0x13d06d['uniqueid']),_0x13d06d);if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]]['reason']==='timeout'){if(_0x13d06d[_0x2010('0x4f')]==='21'){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')]=_0x2010('0x50');agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x50');}utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3')],agents[_0x13d06d['uniqueid']][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d[_0x2010('0x10')]]);var _0x517afa=unanswered[_0x2010('0x52')](_0x13d06d[_0x2010('0x10')]);if(_0x517afa>-0x1){unanswered['splice'](_0x517afa,0x1);}}if(transfers[_0x13d06d['uniqueid']]){transfers[_0x13d06d[_0x2010('0x10')]]['agentcomplete']=!![];transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x24')]=utils[_0x2010('0x36')](transfers[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]);transfers[_0x13d06d[_0x2010('0x10')]]['reason']=_0x2010('0x53');transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d[_0x2010('0x10')],transfers[_0x13d06d['uniqueid']][_0x2010('0x3')],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],transfers[_0x13d06d['uniqueid']][_0x2010('0x6')]));writeDB(transfers[_0x13d06d[_0x2010('0x10')]],!![]);}if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0xa')]=!![];agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt']=utils[_0x2010('0x1f')]();agents[_0x13d06d[_0x2010('0x10')]]['talktime']=utils[_0x2010('0x36')](agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],agents[_0x13d06d[_0x2010('0x10')]]['agentconnectAt']);agents[_0x13d06d['uniqueid']][_0x2010('0x20')]=agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3b')]?_0x2010('0x3b'):_0x2010('0x53');agents[_0x13d06d[_0x2010('0x10')]]['lastevent']=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]]['membername'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d['uniqueid']]);}}catch(_0x496280){utils['error'](util[_0x2010('0x13')]('[%s][agents][hangup]',_0x13d06d[_0x2010('0x10')]),_0x496280);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index deee0d4..af5d4d8 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 _0xd6aa=['secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','includes','hangup','noop','execif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','format','linkedid','channel','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xd6aa,0x9e));var _0xad6a=function(_0x430d21,_0x2fdf27){_0x430d21=_0x430d21-0x0;var _0x24e924=_0xd6aa[_0x430d21];return _0x24e924;};'use strict';var _=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var utils=require(_0xad6a('0x2'));var transfers=require(_0xad6a('0x3'));var dispositions=[_0xad6a('0x4'),_0xad6a('0x5'),'FAILED','NO\x20ANSWER',_0xad6a('0x4'),_0xad6a('0x4'),'ANSWERED','BUSY',_0xad6a('0x5'),_0xad6a('0x5'),_0xad6a('0x5')];var channels={};function writeDB(_0x2bd917){var _0x39cae4;if(transfers[_0xad6a('0x6')][_0x2bd917['uniqueid']]){_0x39cae4=_0x2bd917[_0xad6a('0x7')];_0x2bd917[_0xad6a('0x7')]=transfers[_0xad6a('0x6')][_0x2bd917['uniqueid']][_0xad6a('0x8')];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2bd917['uniqueid'],_0x2bd917['channel'],_0x2bd917[_0xad6a('0x9')],_0x2bd917[_0xad6a('0xa')],_0x2bd917[_0xad6a('0xb')],_0x2bd917[_0xad6a('0xc')],_0x2bd917[_0xad6a('0xd')],_0x2bd917[_0xad6a('0xe')]));if(_0x2bd917[_0xad6a('0xf')]){utils[_0xad6a('0x10')](_0x2bd917['accountcode'])['then'](function(_0x48c9cd){if(_0x48c9cd){_0x2bd917[_0xad6a('0x11')]=_0x48c9cd['id'];}utils[_0xad6a('0x12')](_0xad6a('0x13'),_0x2bd917);});}else{utils[_0xad6a('0x12')](_0xad6a('0x13'),_0x2bd917);}if(channels[_0x2bd917[_0xad6a('0x7')]]){delete channels[_0x2bd917[_0xad6a('0x7')]];}else if(_0x39cae4&&channels[_0x39cae4]){delete transfers[_0xad6a('0x6')][_0x39cae4];delete channels[_0x39cae4];}}exports[_0xad6a('0x14')]=function(_0x156926){try{utils['debug'](util[_0xad6a('0x15')]('[%s][calls][newchannel]',_0x156926['uniqueid']),_0x156926);if(_0x156926[_0xad6a('0x7')]==_0x156926[_0xad6a('0x16')]&&_0x156926[_0xad6a('0x17')]!=_0xad6a('0x18')){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x1a'),_0x156926['uniqueid'],_0x156926[_0xad6a('0x1b')],_0x156926[_0xad6a('0x1c')]));channels[_0x156926[_0xad6a('0x7')]]={'uniqueid':_0x156926[_0xad6a('0x7')],'accountcode':_0x156926[_0xad6a('0xf')],'source':_0x156926['calleridnum'],'destination':_0x156926[_0xad6a('0x1c')],'destinationcontext':_0x156926[_0xad6a('0x1b')],'channel':_0x156926[_0xad6a('0x17')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xad6a('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x3802da){utils['error'](util[_0xad6a('0x15')](_0xad6a('0x1d'),_0x156926[_0xad6a('0x7')]),_0x3802da);}};exports[_0xad6a('0x1e')]=function(_0x250e9c){try{utils[_0xad6a('0x1f')](util['format'](_0xad6a('0x20'),_0x250e9c[_0xad6a('0x7')]),_0x250e9c);if(!_[_0xad6a('0x21')](channels[_0x250e9c['uniqueid']])&&_0x250e9c[_0xad6a('0x22')]==0x6){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x23'),_0x250e9c[_0xad6a('0x7')],_0x250e9c[_0xad6a('0x1b')],_0x250e9c[_0xad6a('0x17')]));if(_[_0xad6a('0x21')](channels[_0x250e9c['uniqueid']][_0xad6a('0x24')])){channels[_0x250e9c[_0xad6a('0x7')]][_0xad6a('0x24')]=utils[_0xad6a('0x25')]();}}else if(!_[_0xad6a('0x21')](channels[_0x250e9c[_0xad6a('0x16')]])&&_0x250e9c['channelstate']==0x6&&_0x250e9c[_0xad6a('0x1b')]!=_0xad6a('0x26')){utils['info'](util[_0xad6a('0x15')](_0xad6a('0x27'),_0x250e9c[_0xad6a('0x7')],_0x250e9c[_0xad6a('0x16')],_0x250e9c[_0xad6a('0x1b')],_0x250e9c[_0xad6a('0x17')]));channels[_0x250e9c[_0xad6a('0x16')]][_0xad6a('0xf')]=_0x250e9c[_0xad6a('0xf')];channels[_0x250e9c[_0xad6a('0x16')]][_0xad6a('0x28')]=_0x250e9c[_0xad6a('0x17')];if(_[_0xad6a('0x21')](channels[_0x250e9c[_0xad6a('0x16')]]['answertime'])){channels[_0x250e9c[_0xad6a('0x16')]][_0xad6a('0x29')]=utils[_0xad6a('0x25')]();}channels[_0x250e9c[_0xad6a('0x16')]][_0xad6a('0x2a')]=dispositions[_[_0xad6a('0x2b')](_0x250e9c[_0xad6a('0x22')])]||_0xad6a('0x2c');}}catch(_0x136f11){utils[_0xad6a('0x2d')](util['format'](_0xad6a('0x20'),_0x250e9c[_0xad6a('0x7')]),_0x136f11);}};exports['hangup']=function(_0x4cb603){try{if(!_[_0xad6a('0x21')](channels[_0x4cb603[_0xad6a('0x7')]])){utils[_0xad6a('0x1f')](util[_0xad6a('0x15')](_0xad6a('0x2e'),_0x4cb603[_0xad6a('0x7')]),_0x4cb603);if(_[_0xad6a('0x21')](channels[_0x4cb603[_0xad6a('0x7')]][_0xad6a('0x2f')])){channels[_0x4cb603[_0xad6a('0x7')]][_0xad6a('0x2f')]=_0x4cb603[_0xad6a('0x30')]+'\x20<'+_0x4cb603[_0xad6a('0xc')]+'>';}utils['info'](util[_0xad6a('0x15')](_0xad6a('0x31'),_0x4cb603['uniqueid'],channels[_0x4cb603[_0xad6a('0x7')]][_0xad6a('0x2f')],_0x4cb603[_0xad6a('0x32')]));channels[_0x4cb603['uniqueid']][_0xad6a('0x33')]=utils[_0xad6a('0x25')]();channels[_0x4cb603[_0xad6a('0x7')]][_0xad6a('0x34')]=utils['diffTime'](channels[_0x4cb603['uniqueid']][_0xad6a('0x33')],channels[_0x4cb603[_0xad6a('0x7')]][_0xad6a('0x35')]);channels[_0x4cb603[_0xad6a('0x7')]]['billableseconds']=channels[_0x4cb603['uniqueid']][_0xad6a('0x29')]?utils[_0xad6a('0x36')](channels[_0x4cb603[_0xad6a('0x7')]]['endtime'],channels[_0x4cb603['uniqueid']][_0xad6a('0x29')]):0x0;writeDB(channels[_0x4cb603[_0xad6a('0x7')]]);}}catch(_0xe23333){utils['error'](util['format'](_0xad6a('0x2e'),_0x4cb603['uniqueid']),_0xe23333);}};exports[_0xad6a('0x37')]=function(_0x30f601){try{if(!_[_0xad6a('0x21')](channels[_0x30f601[_0xad6a('0x38')]])){utils[_0xad6a('0x1f')](util['format'](_0xad6a('0x39'),_0x30f601[_0xad6a('0x3a')]),_0x30f601);if(channels[_0x30f601[_0xad6a('0x38')]][_0xad6a('0x17')]==_0x30f601['transfereechannel']){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x3b'),_0x30f601[_0xad6a('0x3a')],_0x30f601[_0xad6a('0x38')],_0x30f601[_0xad6a('0x3c')]));channels[_0x30f601[_0xad6a('0x38')]]['destinationchannel']=_0x30f601['secondtransfererchannel'];channels[_0x30f601[_0xad6a('0x38')]][_0xad6a('0x3d')]=_0xad6a('0x3e');}else if(channels[_0x30f601[_0xad6a('0x38')]][_0xad6a('0x17')]=_0x30f601[_0xad6a('0x3f')]){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x3b'),_0x30f601['origtransfereruniqueid'],_0x30f601[_0xad6a('0x38')],_0x30f601[_0xad6a('0x40')]));channels[_0x30f601[_0xad6a('0x38')]]['destinationchannel']=_0x30f601[_0xad6a('0x40')];channels[_0x30f601[_0xad6a('0x38')]][_0xad6a('0x3d')]=_0xad6a('0x3e');}}}catch(_0x13be99){utils[_0xad6a('0x2d')](util[_0xad6a('0x15')](_0xad6a('0x39'),_0x30f601['origtransfereruniqueid']),_0x13be99);}};exports[_0xad6a('0x41')]=function(_0x402a6b){try{if(!_[_0xad6a('0x21')](channels[_0x402a6b[_0xad6a('0x7')]])){utils[_0xad6a('0x1f')](util[_0xad6a('0x15')](_0xad6a('0x42'),_0x402a6b[_0xad6a('0x7')]),_0x402a6b);channels[_0x402a6b[_0xad6a('0x7')]][_0xad6a('0x43')]=utils['now']();utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x44'),_0x402a6b[_0xad6a('0x7')],channels[_0x402a6b[_0xad6a('0x7')]][_0xad6a('0x43')]));}}catch(_0x117431){utils[_0xad6a('0x2d')](util['format'](_0xad6a('0x42'),_0x402a6b['uniqueid']),_0x117431);}};exports['musiconholdstop']=function(_0x37e2d5){try{if(!_[_0xad6a('0x21')](channels[_0x37e2d5[_0xad6a('0x7')]])){utils[_0xad6a('0x1f')](util[_0xad6a('0x15')]('[%s][calls][musiconholdstop]',_0x37e2d5[_0xad6a('0x7')]),_0x37e2d5);if(!_[_0xad6a('0x21')](channels[_0x37e2d5['uniqueid']]['musiconholdstartAt'])){channels[_0x37e2d5['uniqueid']][_0xad6a('0x45')]+=utils[_0xad6a('0x36')](utils[_0xad6a('0x25')](),channels[_0x37e2d5[_0xad6a('0x7')]][_0xad6a('0x43')]);utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x46'),_0x37e2d5[_0xad6a('0x7')],channels[_0x37e2d5[_0xad6a('0x7')]][_0xad6a('0x45')]));delete channels[_0x37e2d5[_0xad6a('0x7')]][_0xad6a('0x43')];}}}catch(_0x1c063e){utils['error'](util[_0xad6a('0x15')](_0xad6a('0x47'),_0x37e2d5[_0xad6a('0x7')]),_0x1c063e);}};exports[_0xad6a('0x48')]=function(_0x450049){try{if(!_[_0xad6a('0x21')](channels[_0x450049[_0xad6a('0x7')]])){utils[_0xad6a('0x1f')](util[_0xad6a('0x15')](_0xad6a('0x49'),_0x450049[_0xad6a('0x7')]),_0x450049);if(!_['isNil'](_0x450049[_0xad6a('0x4a')]['xmd-originatecalleridnum'])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x4b'),_0x450049[_0xad6a('0x7')],_0x450049[_0xad6a('0x4c')]));channels[_0x450049[_0xad6a('0x7')]][_0xad6a('0x4d')]=_0x450049['value'];}if(!_[_0xad6a('0x21')](_0x450049['variable'][_0xad6a('0x4e')])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x450049[_0xad6a('0x7')],_0x450049[_0xad6a('0x4c')]));channels[_0x450049[_0xad6a('0x7')]]['destination']=_0x450049[_0xad6a('0x4c')];channels[_0x450049['uniqueid']][_0xad6a('0x2f')]='\x22'+_0x450049[_0xad6a('0x4c')]+_0xad6a('0x4f')+_0x450049[_0xad6a('0x4c')]+'>';}if(!_['isNil'](_0x450049['variable'][_0xad6a('0x50')])||!_[_0xad6a('0x21')](_0x450049[_0xad6a('0x4a')]['xmd-callerid'])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x51'),_0x450049[_0xad6a('0x7')],!_['isNil'](_0x450049[_0xad6a('0x4a')]['xmd-callerid-preview'])?_0xad6a('0x50'):_0xad6a('0x52'),_0x450049[_0xad6a('0x4c')]));channels[_0x450049['uniqueid']][_0xad6a('0x2f')]=_0x450049['value'];}if(!_[_0xad6a('0x21')](_0x450049['variable']['xmd-queue'])||!_[_0xad6a('0x21')](_0x450049[_0xad6a('0x4a')][_0xad6a('0x53')])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x51'),_0x450049[_0xad6a('0x7')],!_['isNil'](_0x450049[_0xad6a('0x4a')]['xmd-queue'])?'xmd-queue':_0xad6a('0x53'),_0x450049[_0xad6a('0x4c')]));channels[_0x450049['uniqueid']][_0xad6a('0x54')]='Queue';channels[_0x450049[_0xad6a('0x7')]][_0xad6a('0x55')]=_0x450049[_0xad6a('0x4c')];channels[_0x450049[_0xad6a('0x7')]][_0xad6a('0x9')]=!![];}if(!_[_0xad6a('0x21')](_0x450049[_0xad6a('0x4a')][_0xad6a('0x56')])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x57'),_0x450049[_0xad6a('0x7')],_0x450049[_0xad6a('0x4c')]));channels[_0x450049[_0xad6a('0x7')]][_0xad6a('0x58')]=_0x450049[_0xad6a('0x4c')];}if(!_[_0xad6a('0x21')](_0x450049['variable'][_0xad6a('0x59')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x450049['uniqueid'],_0x450049[_0xad6a('0x4c')]));channels[_0x450049['uniqueid']][_0xad6a('0x5a')]=_0x450049['value'];}if(!_[_0xad6a('0x21')](_0x450049[_0xad6a('0x4a')][_0xad6a('0x5b')])){utils[_0xad6a('0x19')](util[_0xad6a('0x15')](_0xad6a('0x5c'),_0x450049['uniqueid'],_0x450049[_0xad6a('0x4c')]));channels[_0x450049['uniqueid']][_0xad6a('0x5d')]=_0x450049[_0xad6a('0x4c')];}if(!_[_0xad6a('0x21')](_0x450049[_0xad6a('0x4a')][_0xad6a('0x5e')])){utils['info'](util[_0xad6a('0x15')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x450049[_0xad6a('0x7')],_0x450049[_0xad6a('0x4c')]));channels[_0x450049[_0xad6a('0x7')]][_0xad6a('0x5e')]=_0x450049[_0xad6a('0x4c')];}}}catch(_0x465dd6){utils[_0xad6a('0x2d')](util['format']('[%s][calls][varset]',_0x450049['uniqueid']),_0x465dd6);}};exports['newexten']=function(_0xd09cf){try{if(!_[_0xad6a('0x21')](channels[_0xd09cf[_0xad6a('0x7')]])){utils['debug'](util['format'](_0xad6a('0x5f'),_0xd09cf['uniqueid']),_0xd09cf);utils['info'](util[_0xad6a('0x15')](_0xad6a('0x60'),_0xd09cf[_0xad6a('0x7')],_0xd09cf[_0xad6a('0x61')],_0xd09cf['appdata']));if(_0xd09cf[_0xad6a('0x61')][_0xad6a('0x62')]()==_0xad6a('0x63')&&_[_0xad6a('0x64')](_0xd09cf[_0xad6a('0x65')][_0xad6a('0x62')](),'cdr')){var _0xcda3af=_0xd09cf['appdata'][_0xad6a('0x66')]('=');var _0xe79256=_0xcda3af[0x0][_0xad6a('0x67')](_0xcda3af[0x0]['lastIndexOf']('(')+0x1,_0xcda3af[0x0][_0xad6a('0x68')](')'));var _0x2b3530=_0xcda3af[0x1];channels[_0xd09cf['uniqueid']][_0xe79256]=_0x2b3530;}if(!_[_0xad6a('0x69')]([_0xad6a('0x6a'),_0xad6a('0x6b'),_0xad6a('0x6c'),_0xad6a('0x63'),'gotoif'],_0xd09cf[_0xad6a('0x61')][_0xad6a('0x62')]())){channels[_0xd09cf['uniqueid']][_0xad6a('0x54')]=_0xd09cf['application'];channels[_0xd09cf[_0xad6a('0x7')]]['lastdata']=_0xd09cf[_0xad6a('0x65')];}}}catch(_0x3deb75){utils['error'](util[_0xad6a('0x15')]('[%s][calls][newexten]',_0xd09cf[_0xad6a('0x7')]),_0x3deb75);}}; \ No newline at end of file +var _0x63f3=['membername','interface','connectedlinenum','accountcode','then','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','error','newstate','[%s][calls][newstate]','isNil','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','callerid','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s'];(function(_0xbf0b93,_0x4fe678){var _0x3f3cad=function(_0xe7db95){while(--_0xe7db95){_0xbf0b93['push'](_0xbf0b93['shift']());}};_0x3f3cad(++_0x4fe678);}(_0x63f3,0x65));var _0x363f=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x63f3[_0x397f37];return _0x31cae6;};'use strict';var _=require(_0x363f('0x0'));var util=require(_0x363f('0x1'));var utils=require('./utils');var transfers=require(_0x363f('0x2'));var dispositions=[_0x363f('0x3'),'FAILED',_0x363f('0x4'),_0x363f('0x3'),_0x363f('0x3'),'NO\x20ANSWER','ANSWERED','BUSY',_0x363f('0x4'),'FAILED',_0x363f('0x4')];var channels={};function writeDB(_0x2bfaf0){var _0x39c7bc;if(transfers[_0x363f('0x5')][_0x2bfaf0['uniqueid']]){_0x39c7bc=_0x2bfaf0[_0x363f('0x6')];_0x2bfaf0[_0x363f('0x6')]=transfers[_0x363f('0x5')][_0x2bfaf0[_0x363f('0x6')]][_0x363f('0x7')];}utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0xa'),_0x2bfaf0[_0x363f('0x6')],_0x2bfaf0['channel'],_0x2bfaf0['queue'],_0x2bfaf0[_0x363f('0xb')],_0x2bfaf0[_0x363f('0xc')],_0x2bfaf0['calleridnum'],_0x2bfaf0[_0x363f('0xd')],_0x2bfaf0['lastevent']));if(_0x2bfaf0[_0x363f('0xe')]){utils['getUserByInternal'](_0x2bfaf0[_0x363f('0xe')])[_0x363f('0xf')](function(_0x4114b7){if(_0x4114b7){_0x2bfaf0['UserId']=_0x4114b7['id'];}utils['request'](_0x363f('0x10'),_0x2bfaf0);});}else{utils[_0x363f('0x11')]('CreateVoiceCallReport',_0x2bfaf0);}if(channels[_0x2bfaf0[_0x363f('0x6')]]){delete channels[_0x2bfaf0[_0x363f('0x6')]];}else if(_0x39c7bc&&channels[_0x39c7bc]){delete transfers[_0x363f('0x5')][_0x39c7bc];delete channels[_0x39c7bc];}}exports[_0x363f('0x12')]=function(_0x5b2c1b){try{utils[_0x363f('0x13')](util['format'](_0x363f('0x14'),_0x5b2c1b[_0x363f('0x6')]),_0x5b2c1b);if(_0x5b2c1b[_0x363f('0x6')]==_0x5b2c1b[_0x363f('0x15')]&&_0x5b2c1b[_0x363f('0x16')]!=_0x363f('0x17')){utils['info'](util['format'](_0x363f('0x18'),_0x5b2c1b[_0x363f('0x6')],_0x5b2c1b[_0x363f('0x19')],_0x5b2c1b[_0x363f('0x1a')]));channels[_0x5b2c1b[_0x363f('0x6')]]={'uniqueid':_0x5b2c1b[_0x363f('0x6')],'accountcode':_0x5b2c1b['accountcode'],'source':_0x5b2c1b[_0x363f('0x1b')],'destination':_0x5b2c1b[_0x363f('0x1a')],'destinationcontext':_0x5b2c1b['context'],'channel':_0x5b2c1b['channel'],'starttime':utils[_0x363f('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0xc6af34){utils[_0x363f('0x1d')](util[_0x363f('0x9')](_0x363f('0x14'),_0x5b2c1b[_0x363f('0x6')]),_0xc6af34);}};exports[_0x363f('0x1e')]=function(_0x5e4e85){try{utils['debug'](util[_0x363f('0x9')](_0x363f('0x1f'),_0x5e4e85[_0x363f('0x6')]),_0x5e4e85);if(!_[_0x363f('0x20')](channels[_0x5e4e85[_0x363f('0x6')]])&&_0x5e4e85['channelstate']==0x6){utils[_0x363f('0x8')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5e4e85[_0x363f('0x6')],_0x5e4e85[_0x363f('0x19')],_0x5e4e85[_0x363f('0x16')]));if(_['isNil'](channels[_0x5e4e85[_0x363f('0x6')]]['systemanswertime'])){channels[_0x5e4e85[_0x363f('0x6')]][_0x363f('0x21')]=utils['now']();}}else if(!_[_0x363f('0x20')](channels[_0x5e4e85[_0x363f('0x15')]])&&_0x5e4e85[_0x363f('0x22')]==0x6&&_0x5e4e85[_0x363f('0x19')]!=_0x363f('0x23')){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x24'),_0x5e4e85[_0x363f('0x6')],_0x5e4e85[_0x363f('0x15')],_0x5e4e85[_0x363f('0x19')],_0x5e4e85[_0x363f('0x16')]));channels[_0x5e4e85[_0x363f('0x15')]][_0x363f('0xe')]=_0x5e4e85[_0x363f('0xe')];channels[_0x5e4e85['linkedid']][_0x363f('0x25')]=_0x5e4e85[_0x363f('0x16')];if(_[_0x363f('0x20')](channels[_0x5e4e85['linkedid']][_0x363f('0x26')])){channels[_0x5e4e85[_0x363f('0x15')]][_0x363f('0x26')]=utils['now']();}channels[_0x5e4e85[_0x363f('0x15')]][_0x363f('0x27')]=dispositions[_[_0x363f('0x28')](_0x5e4e85[_0x363f('0x22')])]||_0x363f('0x29');}}catch(_0x192b1d){utils[_0x363f('0x1d')](util['format'](_0x363f('0x1f'),_0x5e4e85['uniqueid']),_0x192b1d);}};exports[_0x363f('0x2a')]=function(_0x4db49b){try{if(!_['isNil'](channels[_0x4db49b['uniqueid']])){utils[_0x363f('0x13')](util[_0x363f('0x9')](_0x363f('0x2b'),_0x4db49b[_0x363f('0x6')]),_0x4db49b);if(_[_0x363f('0x20')](channels[_0x4db49b[_0x363f('0x6')]]['callerid'])){channels[_0x4db49b['uniqueid']]['callerid']=_0x4db49b[_0x363f('0x2c')]+'\x20<'+_0x4db49b[_0x363f('0x1b')]+'>';}utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x2d'),_0x4db49b[_0x363f('0x6')],channels[_0x4db49b[_0x363f('0x6')]]['callerid'],_0x4db49b[_0x363f('0x2e')]));channels[_0x4db49b['uniqueid']]['endtime']=utils[_0x363f('0x1c')]();channels[_0x4db49b['uniqueid']]['duration']=utils['diffTime'](channels[_0x4db49b['uniqueid']][_0x363f('0x2f')],channels[_0x4db49b[_0x363f('0x6')]][_0x363f('0x30')]);channels[_0x4db49b[_0x363f('0x6')]][_0x363f('0x31')]=channels[_0x4db49b[_0x363f('0x6')]]['answertime']?utils['diffTime'](channels[_0x4db49b['uniqueid']][_0x363f('0x2f')],channels[_0x4db49b[_0x363f('0x6')]][_0x363f('0x26')]):0x0;writeDB(channels[_0x4db49b['uniqueid']]);}}catch(_0x5d1ae4){utils['error'](util[_0x363f('0x9')](_0x363f('0x2b'),_0x4db49b[_0x363f('0x6')]),_0x5d1ae4);}};exports['attendedtransfer']=function(_0x5c42b6){try{if(!_[_0x363f('0x20')](channels[_0x5c42b6['localtwolinkedid']])){utils['debug'](util['format'](_0x363f('0x32'),_0x5c42b6[_0x363f('0x33')]),_0x5c42b6);if(channels[_0x5c42b6['localtwolinkedid']]['channel']==_0x5c42b6[_0x363f('0x34')]){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x35'),_0x5c42b6[_0x363f('0x33')],_0x5c42b6[_0x363f('0x36')],_0x5c42b6[_0x363f('0x37')]));channels[_0x5c42b6[_0x363f('0x36')]][_0x363f('0x25')]=_0x5c42b6['secondtransfererchannel'];channels[_0x5c42b6[_0x363f('0x36')]][_0x363f('0x38')]='_attended';}else if(channels[_0x5c42b6[_0x363f('0x36')]][_0x363f('0x16')]=_0x5c42b6[_0x363f('0x39')]){utils[_0x363f('0x8')](util[_0x363f('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5c42b6[_0x363f('0x33')],_0x5c42b6['localtwolinkedid'],_0x5c42b6[_0x363f('0x3a')]));channels[_0x5c42b6[_0x363f('0x36')]][_0x363f('0x25')]=_0x5c42b6[_0x363f('0x3a')];channels[_0x5c42b6['localtwolinkedid']][_0x363f('0x38')]=_0x363f('0x3b');}}}catch(_0x46ff04){utils[_0x363f('0x1d')](util['format']('[%s][calls][attendedtransfer]',_0x5c42b6[_0x363f('0x33')]),_0x46ff04);}};exports[_0x363f('0x3c')]=function(_0xfc1822){try{if(!_[_0x363f('0x20')](channels[_0xfc1822[_0x363f('0x6')]])){utils[_0x363f('0x13')](util['format']('[%s][calls][musiconholdstart]',_0xfc1822[_0x363f('0x6')]),_0xfc1822);channels[_0xfc1822[_0x363f('0x6')]][_0x363f('0x3d')]=utils[_0x363f('0x1c')]();utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x3e'),_0xfc1822['uniqueid'],channels[_0xfc1822['uniqueid']][_0x363f('0x3d')]));}}catch(_0x4efa2e){utils['error'](util[_0x363f('0x9')](_0x363f('0x3f'),_0xfc1822[_0x363f('0x6')]),_0x4efa2e);}};exports[_0x363f('0x40')]=function(_0x2b0049){try{if(!_[_0x363f('0x20')](channels[_0x2b0049[_0x363f('0x6')]])){utils[_0x363f('0x13')](util[_0x363f('0x9')](_0x363f('0x41'),_0x2b0049['uniqueid']),_0x2b0049);if(!_[_0x363f('0x20')](channels[_0x2b0049[_0x363f('0x6')]][_0x363f('0x3d')])){channels[_0x2b0049[_0x363f('0x6')]]['mohtime']+=utils[_0x363f('0x42')](utils['now'](),channels[_0x2b0049[_0x363f('0x6')]][_0x363f('0x3d')]);utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x43'),_0x2b0049['uniqueid'],channels[_0x2b0049[_0x363f('0x6')]][_0x363f('0x44')]));delete channels[_0x2b0049[_0x363f('0x6')]][_0x363f('0x3d')];}}}catch(_0x2b3703){utils[_0x363f('0x1d')](util[_0x363f('0x9')](_0x363f('0x41'),_0x2b0049[_0x363f('0x6')]),_0x2b3703);}};exports[_0x363f('0x45')]=function(_0x49bf6b){try{if(!_[_0x363f('0x20')](channels[_0x49bf6b[_0x363f('0x6')]])){utils[_0x363f('0x13')](util[_0x363f('0x9')](_0x363f('0x46'),_0x49bf6b[_0x363f('0x6')]),_0x49bf6b);if(!_['isNil'](_0x49bf6b[_0x363f('0x47')]['xmd-originatecalleridnum'])){utils[_0x363f('0x8')](util['format'](_0x363f('0x48'),_0x49bf6b[_0x363f('0x6')],_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b['uniqueid']][_0x363f('0x4a')]=_0x49bf6b[_0x363f('0x49')];}if(!_[_0x363f('0x20')](_0x49bf6b['variable'][_0x363f('0x4b')])){utils['info'](util['format'](_0x363f('0x4c'),_0x49bf6b['uniqueid'],_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x4d')]=_0x49bf6b[_0x363f('0x49')];channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x4e')]='\x22'+_0x49bf6b[_0x363f('0x49')]+_0x363f('0x4f')+_0x49bf6b[_0x363f('0x49')]+'>';}if(!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')]['xmd-callerid-preview'])||!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')]['xmd-callerid'])){utils[_0x363f('0x8')](util[_0x363f('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x49bf6b[_0x363f('0x6')],!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')]['xmd-callerid-preview'])?_0x363f('0x50'):'xmd-callerid',_0x49bf6b['value']));channels[_0x49bf6b['uniqueid']][_0x363f('0x4e')]=_0x49bf6b[_0x363f('0x49')];}if(!_['isNil'](_0x49bf6b[_0x363f('0x47')][_0x363f('0x51')])||!_['isNil'](_0x49bf6b['variable'][_0x363f('0x52')])){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x53'),_0x49bf6b['uniqueid'],!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')]['xmd-queue'])?_0x363f('0x51'):_0x363f('0x52'),_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x54')]=_0x363f('0x55');channels[_0x49bf6b['uniqueid']][_0x363f('0x56')]=_0x49bf6b[_0x363f('0x49')];channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x57')]=!![];}if(!_['isNil'](_0x49bf6b[_0x363f('0x47')][_0x363f('0x58')])){utils['info'](util[_0x363f('0x9')](_0x363f('0x59'),_0x49bf6b[_0x363f('0x6')],_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x5a')]=_0x49bf6b[_0x363f('0x49')];}if(!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')]['xmd-cdrtype'])){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x5b'),_0x49bf6b[_0x363f('0x6')],_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b[_0x363f('0x6')]][_0x363f('0x5c')]=_0x49bf6b[_0x363f('0x49')];}if(!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')][_0x363f('0x5d')])){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x5e'),_0x49bf6b[_0x363f('0x6')],_0x49bf6b[_0x363f('0x49')]));channels[_0x49bf6b['uniqueid']][_0x363f('0x5f')]=_0x49bf6b[_0x363f('0x49')];}if(!_[_0x363f('0x20')](_0x49bf6b[_0x363f('0x47')][_0x363f('0x60')])){utils[_0x363f('0x8')](util[_0x363f('0x9')](_0x363f('0x61'),_0x49bf6b[_0x363f('0x6')],_0x49bf6b['value']));channels[_0x49bf6b[_0x363f('0x6')]]['sipcallid']=_0x49bf6b[_0x363f('0x49')];}}}catch(_0x403394){utils[_0x363f('0x1d')](util[_0x363f('0x9')](_0x363f('0x46'),_0x49bf6b[_0x363f('0x6')]),_0x403394);}};exports[_0x363f('0x62')]=function(_0x4b6ef1){try{if(!_[_0x363f('0x20')](channels[_0x4b6ef1[_0x363f('0x6')]])){utils['debug'](util[_0x363f('0x9')](_0x363f('0x63'),_0x4b6ef1[_0x363f('0x6')]),_0x4b6ef1);utils['info'](util[_0x363f('0x9')](_0x363f('0x64'),_0x4b6ef1[_0x363f('0x6')],_0x4b6ef1['application'],_0x4b6ef1[_0x363f('0x65')]));if(_0x4b6ef1[_0x363f('0x66')][_0x363f('0x67')]()==_0x363f('0x68')&&_[_0x363f('0x69')](_0x4b6ef1[_0x363f('0x65')][_0x363f('0x67')](),_0x363f('0x6a'))){var _0x8ceb5=_0x4b6ef1[_0x363f('0x65')]['split']('=');var _0x1d3929=_0x8ceb5[0x0][_0x363f('0x6b')](_0x8ceb5[0x0][_0x363f('0x6c')]('(')+0x1,_0x8ceb5[0x0][_0x363f('0x6c')](')'));var _0x69b8ff=_0x8ceb5[0x1];channels[_0x4b6ef1['uniqueid']][_0x1d3929]=_0x69b8ff;}if(!_[_0x363f('0x6d')]([_0x363f('0x2a'),_0x363f('0x6e'),'execif',_0x363f('0x68'),_0x363f('0x6f')],_0x4b6ef1[_0x363f('0x66')]['toLowerCase']())){channels[_0x4b6ef1['uniqueid']][_0x363f('0x54')]=_0x4b6ef1['application'];channels[_0x4b6ef1[_0x363f('0x6')]]['lastdata']=_0x4b6ef1['appdata'];}}}catch(_0x436125){utils[_0x363f('0x1d')](util[_0x363f('0x9')]('[%s][calls][newexten]',_0x4b6ef1[_0x363f('0x6')]),_0x436125);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6551210..497dc0c 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 _0xe880=['./utils','connect','[core]\x20connected','fullybooted','info','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x4e0d9f,_0x16b2af){var _0x7509b2=function(_0x464ba3){while(--_0x464ba3){_0x4e0d9f['push'](_0x4e0d9f['shift']());}};_0x7509b2(++_0x16b2af);}(_0xe880,0x1d6));var _0x0e88=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe880[_0x122ef9];return _0x42fba0;};'use strict';var utils=require(_0x0e88('0x0'));exports[_0x0e88('0x1')]=function(){utils['info'](_0x0e88('0x2'));};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0x0e88('0x3')]=function(){utils[_0x0e88('0x4')](_0x0e88('0x5'));};exports['error']=function(_0x47cea1){utils[_0x0e88('0x6')](_0x0e88('0x7'),_0x47cea1);};exports[_0x0e88('0x8')]=function(){utils[_0x0e88('0x4')](_0x0e88('0x9'));};exports['managerevent']=function(_0x5d5329){}; \ No newline at end of file +var _0x06b7=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x20aff8,_0x12b74d){var _0x494dee=function(_0x3d4e68){while(--_0x3d4e68){_0x20aff8['push'](_0x20aff8['shift']());}};_0x494dee(++_0x12b74d);}(_0x06b7,0x8b));var _0x706b=function(_0x4d7c25,_0x11846c){_0x4d7c25=_0x4d7c25-0x0;var _0x47a93b=_0x06b7[_0x4d7c25];return _0x47a93b;};'use strict';var utils=require(_0x706b('0x0'));exports[_0x706b('0x1')]=function(){utils[_0x706b('0x2')](_0x706b('0x3'));};exports[_0x706b('0x4')]=function(){utils[_0x706b('0x2')](_0x706b('0x5'));};exports[_0x706b('0x6')]=function(){utils[_0x706b('0x2')](_0x706b('0x7'));};exports[_0x706b('0x8')]=function(_0x5329ad){utils['error']('[core]\x20error',_0x5329ad);};exports['close']=function(){utils[_0x706b('0x2')](_0x706b('0x9'));};exports[_0x706b('0xa')]=function(_0x4c442e){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f5a558b..1b497c0 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 _0x817b=['called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent'];(function(_0x48fbac,_0xf85b17){var _0x5db70e=function(_0x72b0cb){while(--_0x72b0cb){_0x48fbac['push'](_0x48fbac['shift']());}};_0x5db70e(++_0xf85b17);}(_0x817b,0x13d));var _0xb817=function(_0x15a562,_0x205ef8){_0x15a562=_0x15a562-0x0;var _0x39af1b=_0x817b[_0x15a562];return _0x39af1b;};'use strict';var _=require('lodash');var util=require(_0xb817('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x245491){utils[_0xb817('0x1')](util['format'](_0xb817('0x2'),_0x245491['uniqueid'],_0x245491[_0xb817('0x3')],_0x245491[_0xb817('0x4')],_0x245491[_0xb817('0x5')],_0x245491[_0xb817('0x6')],_0x245491[_0xb817('0x7')]));utils[_0xb817('0x8')]('CreateVoiceDialReport',_0x245491);delete dials[_0x245491[_0xb817('0x9')]];}exports[_0xb817('0xa')]=function(_0x554733){try{utils['debug'](util[_0xb817('0xb')](_0xb817('0xc'),_0x554733[_0xb817('0x9')]),_0x554733);utils['info'](util[_0xb817('0xb')](_0xb817('0xd'),_0x554733['uniqueid'],_0x554733[_0xb817('0xe')],_0x554733[_0xb817('0xf')]));if(_0x554733['application'][_0xb817('0x10')]()=='set'&&_[_0xb817('0x11')](_0x554733['appdata']['toLowerCase'](),_0xb817('0x12'))){var _0x3261c2=_0x554733[_0xb817('0xf')][_0xb817('0x13')]('=');dials[_0x554733['uniqueid']]={'routeId':_0x3261c2[0x1]};}}catch(_0x36e31b){utils['error'](util[_0xb817('0xb')](_0xb817('0xc'),_0x554733[_0xb817('0x9')]),_0x36e31b);}};exports[_0xb817('0x14')]=function(_0x197808){try{utils[_0xb817('0x15')](util[_0xb817('0xb')](_0xb817('0x16'),_0x197808[_0xb817('0x9')]),_0x197808);if(!_[_0xb817('0x17')](_0x197808['variable'][_0xb817('0x18')])){utils[_0xb817('0x1')](util[_0xb817('0xb')](_0xb817('0x19'),_0x197808[_0xb817('0x9')],_0x197808['value']));dials[_0x197808[_0xb817('0x9')]]={'routeId':_0x197808[_0xb817('0x1a')]};}}catch(_0x3409dd){utils[_0xb817('0x1b')](util[_0xb817('0xb')](_0xb817('0x16'),_0x197808['uniqueid']),_0x3409dd);}};exports[_0xb817('0x1c')]=function(_0x473af6){try{if(!_[_0xb817('0x17')](dials[_0x473af6[_0xb817('0x9')]])){utils[_0xb817('0x15')](util[_0xb817('0xb')](_0xb817('0x1d'),_0x473af6[_0xb817('0x9')]),_0x473af6);dials[_0x473af6[_0xb817('0x9')]]=_['assign'](dials[_0x473af6[_0xb817('0x9')]],_0x473af6);dials[_0x473af6[_0xb817('0x9')]][_0xb817('0x1e')]=utils[_0xb817('0x1f')]();dials[_0x473af6[_0xb817('0x9')]][_0xb817('0x20')]=_0xb817('0x21');utils[_0xb817('0x1')](util['format'](_0xb817('0x22'),_0x473af6['uniqueid'],dials[_0x473af6[_0xb817('0x9')]][_0xb817('0x1e')]));}}catch(_0x2d424c){utils[_0xb817('0x1b')](util[_0xb817('0xb')]('[%s][dials][dialbegin]',_0x473af6[_0xb817('0x9')]),_0x2d424c);}};exports['dialend']=function(_0x298566){try{if(!_['isNil'](dials[_0x298566['uniqueid']])){utils[_0xb817('0x15')](util[_0xb817('0xb')](_0xb817('0x23'),_0x298566[_0xb817('0x9')]),_0x298566);dials[_0x298566[_0xb817('0x9')]][_0xb817('0x7')]=_0x298566[_0xb817('0x7')];if(_0x298566[_0xb817('0x7')]==_0xb817('0x24')){dials[_0x298566[_0xb817('0x9')]]=_[_0xb817('0x25')](dials[_0x298566[_0xb817('0x9')]],_0x298566);dials[_0x298566['uniqueid']]['answertime']=utils[_0xb817('0x1f')]();dials[_0x298566[_0xb817('0x9')]][_0xb817('0x20')]=_0xb817('0x26');utils[_0xb817('0x1')](util[_0xb817('0xb')](_0xb817('0x27'),_0x298566[_0xb817('0x9')],_0x298566[_0xb817('0x7')],dials[_0x298566['uniqueid']][_0xb817('0x28')]));}else{utils[_0xb817('0x1')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x298566[_0xb817('0x9')],_0x298566[_0xb817('0x7')]));}}}catch(_0x4eac86){utils[_0xb817('0x1b')](util['format'](_0xb817('0x23'),_0x298566['uniqueid']),_0x4eac86);}};exports[_0xb817('0x29')]=function(_0x3ca0b2){try{if(!_['isNil'](dials[_0x3ca0b2[_0xb817('0x9')]])){utils[_0xb817('0x15')](util['format']('[%s][dials][hangup]',_0x3ca0b2['uniqueid']),_0x3ca0b2);utils[_0xb817('0x1')](util[_0xb817('0xb')](_0xb817('0x2a'),_0x3ca0b2[_0xb817('0x9')],_0x3ca0b2[_0xb817('0x5')],_0x3ca0b2[_0xb817('0x2b')],_0x3ca0b2['cause-txt']));dials[_0x3ca0b2[_0xb817('0x9')]]=_['assign'](dials[_0x3ca0b2['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xb817('0x2c')});dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x2d')]=utils[_0xb817('0x2e')](dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x2f')],dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x1e')]);dials[_0x3ca0b2['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x28')]||dials[_0x3ca0b2[_0xb817('0x9')]]['endtime'],dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x1e')]);dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x30')]=dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x28')]?utils[_0xb817('0x2e')](dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x2f')],dials[_0x3ca0b2[_0xb817('0x9')]][_0xb817('0x28')]):0x0;writeDB(dials[_0x3ca0b2[_0xb817('0x9')]]);}}catch(_0x5a104d){utils[_0xb817('0x1b')](util['format'](_0xb817('0x31'),_0x3ca0b2['uniqueid']),_0x5a104d);}}; \ No newline at end of file +var _0xd337=['billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime'];(function(_0x5bd18c,_0x2d3d94){var _0x4318e7=function(_0x5ea5de){while(--_0x5ea5de){_0x5bd18c['push'](_0x5bd18c['shift']());}};_0x4318e7(++_0x2d3d94);}(_0xd337,0x14a));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d33('0x0'));var util=require(_0x7d33('0x1'));var utils=require(_0x7d33('0x2'));var dials={};function writeDB(_0x12a8a3){utils[_0x7d33('0x3')](util['format'](_0x7d33('0x4'),_0x12a8a3['uniqueid'],_0x12a8a3[_0x7d33('0x5')],_0x12a8a3[_0x7d33('0x6')],_0x12a8a3[_0x7d33('0x7')],_0x12a8a3['connectedlinenum'],_0x12a8a3[_0x7d33('0x8')]));utils['request'](_0x7d33('0x9'),_0x12a8a3);delete dials[_0x12a8a3[_0x7d33('0xa')]];}exports['newexten']=function(_0x15592c){try{utils[_0x7d33('0xb')](util[_0x7d33('0xc')](_0x7d33('0xd'),_0x15592c[_0x7d33('0xa')]),_0x15592c);utils[_0x7d33('0x3')](util['format'](_0x7d33('0xe'),_0x15592c[_0x7d33('0xa')],_0x15592c[_0x7d33('0xf')],_0x15592c[_0x7d33('0x10')]));if(_0x15592c[_0x7d33('0xf')][_0x7d33('0x11')]()==_0x7d33('0x12')&&_['startsWith'](_0x15592c[_0x7d33('0x10')]['toLowerCase'](),_0x7d33('0x13'))){var _0x2cc717=_0x15592c[_0x7d33('0x10')][_0x7d33('0x14')]('=');dials[_0x15592c[_0x7d33('0xa')]]={'routeId':_0x2cc717[0x1]};}}catch(_0x5278d4){utils[_0x7d33('0x15')](util[_0x7d33('0xc')](_0x7d33('0xd'),_0x15592c[_0x7d33('0xa')]),_0x5278d4);}};exports[_0x7d33('0x16')]=function(_0x5d0ece){try{utils[_0x7d33('0xb')](util[_0x7d33('0xc')](_0x7d33('0x17'),_0x5d0ece['uniqueid']),_0x5d0ece);if(!_['isNil'](_0x5d0ece[_0x7d33('0x18')]['outboundrouteid'])){utils[_0x7d33('0x3')](util['format'](_0x7d33('0x19'),_0x5d0ece[_0x7d33('0xa')],_0x5d0ece[_0x7d33('0x1a')]));dials[_0x5d0ece[_0x7d33('0xa')]]={'routeId':_0x5d0ece[_0x7d33('0x1a')]};}}catch(_0x5ce12c){utils[_0x7d33('0x15')](util['format'](_0x7d33('0x17'),_0x5d0ece['uniqueid']),_0x5ce12c);}};exports[_0x7d33('0x1b')]=function(_0x109788){try{if(!_[_0x7d33('0x1c')](dials[_0x109788[_0x7d33('0xa')]])){utils[_0x7d33('0xb')](util[_0x7d33('0xc')](_0x7d33('0x1d'),_0x109788['uniqueid']),_0x109788);dials[_0x109788[_0x7d33('0xa')]]=_[_0x7d33('0x1e')](dials[_0x109788[_0x7d33('0xa')]],_0x109788);dials[_0x109788[_0x7d33('0xa')]][_0x7d33('0x1f')]=utils[_0x7d33('0x20')]();dials[_0x109788['uniqueid']][_0x7d33('0x21')]=_0x7d33('0x22');utils['info'](util[_0x7d33('0xc')](_0x7d33('0x23'),_0x109788[_0x7d33('0xa')],dials[_0x109788[_0x7d33('0xa')]]['starttime']));}}catch(_0x3c19f7){utils[_0x7d33('0x15')](util['format']('[%s][dials][dialbegin]',_0x109788[_0x7d33('0xa')]),_0x3c19f7);}};exports['dialend']=function(_0x71ff88){try{if(!_[_0x7d33('0x1c')](dials[_0x71ff88[_0x7d33('0xa')]])){utils[_0x7d33('0xb')](util['format']('[%s][dials][dialend]',_0x71ff88[_0x7d33('0xa')]),_0x71ff88);dials[_0x71ff88['uniqueid']]['dialstatus']=_0x71ff88[_0x7d33('0x8')];if(_0x71ff88[_0x7d33('0x8')]=='ANSWER'){dials[_0x71ff88[_0x7d33('0xa')]]=_[_0x7d33('0x1e')](dials[_0x71ff88[_0x7d33('0xa')]],_0x71ff88);dials[_0x71ff88[_0x7d33('0xa')]]['answertime']=utils[_0x7d33('0x20')]();dials[_0x71ff88[_0x7d33('0xa')]][_0x7d33('0x21')]='connect';utils[_0x7d33('0x3')](util[_0x7d33('0xc')](_0x7d33('0x24'),_0x71ff88[_0x7d33('0xa')],_0x71ff88[_0x7d33('0x8')],dials[_0x71ff88['uniqueid']][_0x7d33('0x25')]));}else{utils[_0x7d33('0x3')](util[_0x7d33('0xc')](_0x7d33('0x26'),_0x71ff88[_0x7d33('0xa')],_0x71ff88[_0x7d33('0x8')]));}}}catch(_0x48edfc){utils['error'](util[_0x7d33('0xc')](_0x7d33('0x27'),_0x71ff88[_0x7d33('0xa')]),_0x48edfc);}};exports['hangup']=function(_0x33d1c0){try{if(!_['isNil'](dials[_0x33d1c0['uniqueid']])){utils[_0x7d33('0xb')](util[_0x7d33('0xc')]('[%s][dials][hangup]',_0x33d1c0[_0x7d33('0xa')]),_0x33d1c0);utils['info'](util[_0x7d33('0xc')](_0x7d33('0x28'),_0x33d1c0['uniqueid'],_0x33d1c0[_0x7d33('0x7')],_0x33d1c0[_0x7d33('0x29')],_0x33d1c0[_0x7d33('0x2a')]));dials[_0x33d1c0['uniqueid']]=_['assign'](dials[_0x33d1c0[_0x7d33('0xa')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x2b')]=utils[_0x7d33('0x2c')](dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x2d')],dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x1f')]);dials[_0x33d1c0[_0x7d33('0xa')]]['holdtime']=utils['diffTime'](dials[_0x33d1c0[_0x7d33('0xa')]]['answertime']||dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x2d')],dials[_0x33d1c0[_0x7d33('0xa')]]['starttime']);dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x2e')]=dials[_0x33d1c0[_0x7d33('0xa')]]['answertime']?utils[_0x7d33('0x2c')](dials[_0x33d1c0[_0x7d33('0xa')]]['endtime'],dials[_0x33d1c0[_0x7d33('0xa')]][_0x7d33('0x25')]):0x0;writeDB(dials[_0x33d1c0[_0x7d33('0xa')]]);}}catch(_0x1ab62d){utils[_0x7d33('0x15')](util['format']('[%s][dials][hangup]',_0x33d1c0[_0x7d33('0xa')]),_0x1ab62d);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ec96c36..02db765 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 _0x7b91=['shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7b91,0xfa));var _0x17b9=function(_0x2bfdde,_0x5dd690){_0x2bfdde=_0x2bfdde-0x0;var _0x70d8eb=_0x7b91[_0x2bfdde];return _0x70d8eb;};var AsteriskManager=require(_0x17b9('0x0'));var config=require(_0x17b9('0x1'));var utils=require(_0x17b9('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x17b9('0x3')][_0x17b9('0x4')],config[_0x17b9('0x3')]['ip'],config[_0x17b9('0x3')][_0x17b9('0x5')],config[_0x17b9('0x3')][_0x17b9('0x6')],!![]);ami[_0x17b9('0x7')]();if(config[_0x17b9('0x8')]&&config[_0x17b9('0x8')]['disabled']){utils['info'](_0x17b9('0x9'));}else{var agents=require(_0x17b9('0xa'));var calls=require(_0x17b9('0xb'));var queues=require('./queues.controller');var recordings=require(_0x17b9('0xc'));var members=require(_0x17b9('0xd'));var dials=require(_0x17b9('0xe'));var transfers=require(_0x17b9('0xf'));var core=require(_0x17b9('0x10'));ami['on'](_0x17b9('0x11'),core['connect']);ami['on'](_0x17b9('0x12'),core['shutdown']);ami['on'](_0x17b9('0x13'),core[_0x17b9('0x13')]);ami['on'](_0x17b9('0x14'),core[_0x17b9('0x14')]);ami['on'](_0x17b9('0x15'),core[_0x17b9('0x15')]);ami['on'](_0x17b9('0x16'),core['managerevent']);ami['on'](_0x17b9('0x17'),function(_0x259331){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')]('[%s][index][devicestatechange]',_0x259331[_0x17b9('0x1a')]),_0x259331);members[_0x17b9('0x17')](_0x259331);}catch(_0x5cca1a){utils[_0x17b9('0x14')](util['format'](_0x17b9('0x1b'),_0x259331[_0x17b9('0x1a')]),_0x5cca1a);}});ami['on'](_0x17b9('0x1c'),function(_0x527d5e){try{utils[_0x17b9('0x18')](util['format'](_0x17b9('0x1d'),_0x527d5e['uniqueid']),_0x527d5e);agents[_0x17b9('0x1c')](_0x527d5e);}catch(_0x49da8e){utils[_0x17b9('0x14')](util[_0x17b9('0x19')]('[%s][index][agentcalled]',_0x527d5e[_0x17b9('0x1e')]),_0x49da8e);}});ami['on'](_0x17b9('0x1f'),function(_0x517eca){try{utils[_0x17b9('0x18')](util['format'](_0x17b9('0x20'),_0x517eca[_0x17b9('0x1e')]),_0x517eca);agents['agentringnoanswer'](_0x517eca);}catch(_0x21e04c){utils[_0x17b9('0x14')](util[_0x17b9('0x19')]('[%s][index][agentringnoanswer]',_0x517eca['uniqueid']),_0x21e04c);}});ami['on'](_0x17b9('0x21'),function(_0x160238){try{utils['debug'](util[_0x17b9('0x19')](_0x17b9('0x22'),_0x160238[_0x17b9('0x1e')]),_0x160238);agents[_0x17b9('0x21')](_0x160238);queues[_0x17b9('0x21')](_0x160238);}catch(_0x22b3b1){utils[_0x17b9('0x14')](util[_0x17b9('0x19')]('[%s][index][agentconnect]',_0x160238[_0x17b9('0x1e')]),_0x22b3b1);}});ami['on']('agentcomplete',function(_0x4863ee){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x23'),_0x4863ee[_0x17b9('0x1e')]),_0x4863ee);agents[_0x17b9('0x24')](_0x4863ee);queues['agentcomplete'](_0x4863ee);members[_0x17b9('0x24')](_0x4863ee);}catch(_0x888e76){utils['error'](util[_0x17b9('0x19')](_0x17b9('0x23'),_0x4863ee[_0x17b9('0x1e')]),_0x888e76);}});ami['on'](_0x17b9('0x25'),function(_0x4a8c77){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x26'),_0x4a8c77[_0x17b9('0x1e')]),_0x4a8c77);agents[_0x17b9('0x25')](_0x4a8c77);queues['queuecallerabandon'](_0x4a8c77);}catch(_0x1246f2){utils['error'](util[_0x17b9('0x19')](_0x17b9('0x26'),_0x4a8c77['uniqueid']),_0x1246f2);}});ami['on'](_0x17b9('0x27'),function(_0x5d4404){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x28'),_0x5d4404['uniqueid']),_0x5d4404);queues[_0x17b9('0x27')](_0x5d4404);recordings[_0x17b9('0x27')](_0x5d4404);}catch(_0x2a3cc6){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x28'),_0x5d4404[_0x17b9('0x1e')]),_0x2a3cc6);}});ami['on'](_0x17b9('0x29'),function(_0xa7ec45){try{utils[_0x17b9('0x18')](util['format'](_0x17b9('0x2a'),_0xa7ec45[_0x17b9('0x1e')]),_0xa7ec45);queues['queuecallerleave'](_0xa7ec45);}catch(_0x46efed){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x2a'),_0xa7ec45[_0x17b9('0x1e')]),_0x46efed);}});ami['on'](_0x17b9('0x2b'),function(_0xc28f62){try{utils['debug'](util[_0x17b9('0x19')]('[%s][index][musiconholdstart]',_0xc28f62['uniqueid']),_0xc28f62);queues['musiconholdstart'](_0xc28f62);calls[_0x17b9('0x2b')](_0xc28f62);}catch(_0x40551d){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x2c'),_0xc28f62[_0x17b9('0x1e')]),_0x40551d);}});ami['on']('musiconholdstop',function(_0x4af5ba){try{utils['debug'](util[_0x17b9('0x19')](_0x17b9('0x2d'),_0x4af5ba[_0x17b9('0x1e')]),_0x4af5ba);queues[_0x17b9('0x2e')](_0x4af5ba);calls[_0x17b9('0x2e')](_0x4af5ba);}catch(_0x550094){utils['error'](util[_0x17b9('0x19')](_0x17b9('0x2d'),_0x4af5ba[_0x17b9('0x1e')]),_0x550094);}});ami['on'](_0x17b9('0x2f'),function(_0x2ed363){try{utils['debug'](util[_0x17b9('0x19')](_0x17b9('0x30'),_0x2ed363['uniqueid']),_0x2ed363);calls['newstate'](_0x2ed363);recordings[_0x17b9('0x2f')](_0x2ed363);}catch(_0x4a011c){utils[_0x17b9('0x14')](util[_0x17b9('0x19')]('[%s][index][newstate]',_0x2ed363['uniqueid']),_0x4a011c);}});ami['on'](_0x17b9('0x31'),function(_0x52b274){try{utils['debug'](util[_0x17b9('0x19')]('[%s][index][hangup]',_0x52b274[_0x17b9('0x1e')]),_0x52b274);calls['hangup'](_0x52b274);recordings[_0x17b9('0x31')](_0x52b274);dials[_0x17b9('0x31')](_0x52b274);agents[_0x17b9('0x31')](_0x52b274);queues['hangup'](_0x52b274);}catch(_0x5e57f5){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x32'),_0x52b274[_0x17b9('0x1e')]),_0x5e57f5);}});ami['on'](_0x17b9('0x33'),function(_0x10e2bd){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x34'),_0x10e2bd[_0x17b9('0x1e')]),_0x10e2bd);members[_0x17b9('0x33')](_0x10e2bd);}catch(_0x4fe250){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x34'),_0x10e2bd[_0x17b9('0x1e')]),_0x4fe250);}});ami['on'](_0x17b9('0x35'),function(_0x1e88da){try{utils[_0x17b9('0x18')](util['format'](_0x17b9('0x36'),_0x1e88da[_0x17b9('0x1e')]),_0x1e88da);queues[_0x17b9('0x35')](_0x1e88da);agents[_0x17b9('0x35')](_0x1e88da);transfers[_0x17b9('0x35')](_0x1e88da);}catch(_0x381648){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x36'),_0x1e88da[_0x17b9('0x1e')]),_0x381648);}});ami['on']('attendedtransfer',function(_0xf9bfbc){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x37'),_0xf9bfbc[_0x17b9('0x38')]),_0xf9bfbc);queues[_0x17b9('0x39')](_0xf9bfbc);transfers[_0x17b9('0x39')](_0xf9bfbc);agents[_0x17b9('0x39')](_0xf9bfbc);calls[_0x17b9('0x39')](_0xf9bfbc);}catch(_0x3180fd){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x37'),_0xf9bfbc[_0x17b9('0x38')]),_0x3180fd);}});ami['on'](_0x17b9('0x3a'),function(_0x1f6eae){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x3b'),_0x1f6eae['uniqueid']),_0x1f6eae);queues['varset'](_0x1f6eae);recordings[_0x17b9('0x3a')](_0x1f6eae);calls[_0x17b9('0x3a')](_0x1f6eae);dials[_0x17b9('0x3a')](_0x1f6eae);}catch(_0x10858a){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x3b'),_0x1f6eae[_0x17b9('0x1e')]),_0x10858a);}});ami['on'](_0x17b9('0x3c'),function(_0x2bbb7e){try{utils[_0x17b9('0x18')](util['format']('[%s][index][newexten]',_0x2bbb7e[_0x17b9('0x1e')]),_0x2bbb7e);calls['newexten'](_0x2bbb7e);recordings['newexten'](_0x2bbb7e);dials[_0x17b9('0x3c')](_0x2bbb7e);}catch(_0x1315a4){utils['error'](util[_0x17b9('0x19')]('[%s][index][newexten]',_0x2bbb7e[_0x17b9('0x1e')]),_0x1315a4);}});ami['on']('newchannel',function(_0x5474b1){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')]('[%s][index][newchannel]',_0x5474b1[_0x17b9('0x1e')]),_0x5474b1);calls[_0x17b9('0x3d')](_0x5474b1);recordings[_0x17b9('0x3d')](_0x5474b1);}catch(_0x28a848){utils[_0x17b9('0x14')](util[_0x17b9('0x19')](_0x17b9('0x3e'),_0x5474b1['uniqueid']),_0x28a848);}});ami['on'](_0x17b9('0x3f'),function(_0xa27b2d){try{utils[_0x17b9('0x18')](util[_0x17b9('0x19')](_0x17b9('0x40'),_0xa27b2d['uniqueid']),_0xa27b2d);dials[_0x17b9('0x3f')](_0xa27b2d);}catch(_0x6d5afb){utils[_0x17b9('0x14')](util['format']('[%s]dialbegin',_0xa27b2d[_0x17b9('0x1e')]),_0x6d5afb);}});ami['on'](_0x17b9('0x41'),function(_0x22bbb0){try{utils[_0x17b9('0x18')](util['format'](_0x17b9('0x42'),_0x22bbb0['uniqueid']),_0x22bbb0);dials[_0x17b9('0x41')](_0x22bbb0);}catch(_0x56f7ae){utils[_0x17b9('0x14')](util['format'](_0x17b9('0x42'),_0x22bbb0[_0x17b9('0x1e')]),_0x56f7ae);}});} \ No newline at end of file +var _0x126e=['[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','util','asterisk','username','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid'];(function(_0x32c39c,_0x330866){var _0x4e0a68=function(_0x494442){while(--_0x494442){_0x32c39c['push'](_0x32c39c['shift']());}};_0x4e0a68(++_0x330866);}(_0x126e,0x1e6));var _0xe126=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x126e[_0xb0f7c3];return _0x28ea68;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xe126('0x0'));var ami=new AsteriskManager(config[_0xe126('0x1')]['port'],config[_0xe126('0x1')]['ip'],config[_0xe126('0x1')][_0xe126('0x2')],config[_0xe126('0x1')][_0xe126('0x3')],!![]);ami['keepConnected']();if(config[_0xe126('0x4')]&&config[_0xe126('0x4')][_0xe126('0x5')]){utils[_0xe126('0x6')](_0xe126('0x7'));}else{var agents=require(_0xe126('0x8'));var calls=require(_0xe126('0x9'));var queues=require('./queues.controller');var recordings=require(_0xe126('0xa'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xe126('0xb'));var core=require(_0xe126('0xc'));ami['on'](_0xe126('0xd'),core[_0xe126('0xd')]);ami['on'](_0xe126('0xe'),core[_0xe126('0xe')]);ami['on'](_0xe126('0xf'),core[_0xe126('0xf')]);ami['on']('error',core[_0xe126('0x10')]);ami['on'](_0xe126('0x11'),core[_0xe126('0x11')]);ami['on'](_0xe126('0x12'),core[_0xe126('0x12')]);ami['on'](_0xe126('0x13'),function(_0x55ef06){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x16'),_0x55ef06[_0xe126('0x17')]),_0x55ef06);members[_0xe126('0x13')](_0x55ef06);}catch(_0x14dfea){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x16'),_0x55ef06['device']),_0x14dfea);}});ami['on'](_0xe126('0x18'),function(_0x5c3adf){try{utils[_0xe126('0x14')](util[_0xe126('0x15')]('[%s][index][agentcalled]',_0x5c3adf[_0xe126('0x19')]),_0x5c3adf);agents[_0xe126('0x18')](_0x5c3adf);}catch(_0xcc6944){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x1a'),_0x5c3adf['uniqueid']),_0xcc6944);}});ami['on'](_0xe126('0x1b'),function(_0x212842){try{utils[_0xe126('0x14')](util[_0xe126('0x15')]('[%s][index][agentringnoanswer]',_0x212842[_0xe126('0x19')]),_0x212842);agents[_0xe126('0x1b')](_0x212842);}catch(_0x18d2c4){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x1c'),_0x212842[_0xe126('0x19')]),_0x18d2c4);}});ami['on'](_0xe126('0x1d'),function(_0x16a2c0){try{utils['debug'](util[_0xe126('0x15')](_0xe126('0x1e'),_0x16a2c0['uniqueid']),_0x16a2c0);agents[_0xe126('0x1d')](_0x16a2c0);queues[_0xe126('0x1d')](_0x16a2c0);}catch(_0x101f87){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x1e'),_0x16a2c0['uniqueid']),_0x101f87);}});ami['on']('agentcomplete',function(_0x1bb7ae){try{utils['debug'](util['format'](_0xe126('0x1f'),_0x1bb7ae['uniqueid']),_0x1bb7ae);agents[_0xe126('0x20')](_0x1bb7ae);queues[_0xe126('0x20')](_0x1bb7ae);members['agentcomplete'](_0x1bb7ae);}catch(_0x39a665){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x1f'),_0x1bb7ae[_0xe126('0x19')]),_0x39a665);}});ami['on']('queuecallerabandon',function(_0x4432d6){try{utils[_0xe126('0x14')](util['format'](_0xe126('0x21'),_0x4432d6[_0xe126('0x19')]),_0x4432d6);agents['queuecallerabandon'](_0x4432d6);queues[_0xe126('0x22')](_0x4432d6);}catch(_0xcc5b13){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x21'),_0x4432d6[_0xe126('0x19')]),_0xcc5b13);}});ami['on'](_0xe126('0x23'),function(_0x5aeccd){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x24'),_0x5aeccd[_0xe126('0x19')]),_0x5aeccd);queues[_0xe126('0x23')](_0x5aeccd);recordings['queuecallerjoin'](_0x5aeccd);}catch(_0x1b1e3c){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x24'),_0x5aeccd[_0xe126('0x19')]),_0x1b1e3c);}});ami['on']('queuecallerleave',function(_0xbdd562){try{utils['debug'](util[_0xe126('0x15')]('[%s][index][queuecallerleave]',_0xbdd562[_0xe126('0x19')]),_0xbdd562);queues[_0xe126('0x25')](_0xbdd562);}catch(_0x56afb6){utils[_0xe126('0x10')](util['format'](_0xe126('0x26'),_0xbdd562[_0xe126('0x19')]),_0x56afb6);}});ami['on'](_0xe126('0x27'),function(_0x50514e){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x28'),_0x50514e[_0xe126('0x19')]),_0x50514e);queues[_0xe126('0x27')](_0x50514e);calls[_0xe126('0x27')](_0x50514e);}catch(_0x5e02f8){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x28'),_0x50514e[_0xe126('0x19')]),_0x5e02f8);}});ami['on'](_0xe126('0x29'),function(_0x271dbf){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x2a'),_0x271dbf['uniqueid']),_0x271dbf);queues[_0xe126('0x29')](_0x271dbf);calls[_0xe126('0x29')](_0x271dbf);}catch(_0x518295){utils[_0xe126('0x10')](util['format'](_0xe126('0x2a'),_0x271dbf[_0xe126('0x19')]),_0x518295);}});ami['on'](_0xe126('0x2b'),function(_0xf0947){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x2c'),_0xf0947[_0xe126('0x19')]),_0xf0947);calls[_0xe126('0x2b')](_0xf0947);recordings[_0xe126('0x2b')](_0xf0947);}catch(_0x56fe62){utils['error'](util[_0xe126('0x15')](_0xe126('0x2c'),_0xf0947[_0xe126('0x19')]),_0x56fe62);}});ami['on']('hangup',function(_0x2cf3e3){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x2d'),_0x2cf3e3[_0xe126('0x19')]),_0x2cf3e3);calls[_0xe126('0x2e')](_0x2cf3e3);recordings[_0xe126('0x2e')](_0x2cf3e3);dials[_0xe126('0x2e')](_0x2cf3e3);agents[_0xe126('0x2e')](_0x2cf3e3);queues[_0xe126('0x2e')](_0x2cf3e3);}catch(_0x34ac4c){utils[_0xe126('0x10')](util[_0xe126('0x15')]('[%s][index][hangup]',_0x2cf3e3[_0xe126('0x19')]),_0x34ac4c);}});ami['on'](_0xe126('0x2f'),function(_0x171587){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x30'),_0x171587['uniqueid']),_0x171587);members['cdr'](_0x171587);}catch(_0x5eaa9e){utils['error'](util[_0xe126('0x15')](_0xe126('0x30'),_0x171587['uniqueid']),_0x5eaa9e);}});ami['on'](_0xe126('0x31'),function(_0x3deb23){try{utils[_0xe126('0x14')](util[_0xe126('0x15')]('[%s][index][blindtransfer]',_0x3deb23['uniqueid']),_0x3deb23);queues[_0xe126('0x31')](_0x3deb23);agents['blindtransfer'](_0x3deb23);transfers[_0xe126('0x31')](_0x3deb23);}catch(_0x472eb2){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x32'),_0x3deb23['uniqueid']),_0x472eb2);}});ami['on']('attendedtransfer',function(_0x478159){try{utils['debug'](util['format'](_0xe126('0x33'),_0x478159['origtransfereruniqueid']),_0x478159);queues['attendedtransfer'](_0x478159);transfers[_0xe126('0x34')](_0x478159);agents['attendedtransfer'](_0x478159);calls[_0xe126('0x34')](_0x478159);}catch(_0x408d37){utils[_0xe126('0x10')](util[_0xe126('0x15')]('[%s][index][attendedtransfer]',_0x478159[_0xe126('0x35')]),_0x408d37);}});ami['on'](_0xe126('0x36'),function(_0x56362b){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x37'),_0x56362b[_0xe126('0x19')]),_0x56362b);queues['varset'](_0x56362b);recordings[_0xe126('0x36')](_0x56362b);calls[_0xe126('0x36')](_0x56362b);dials['varset'](_0x56362b);}catch(_0x11e9f2){utils[_0xe126('0x10')](util[_0xe126('0x15')]('[%s][index][varset]',_0x56362b[_0xe126('0x19')]),_0x11e9f2);}});ami['on'](_0xe126('0x38'),function(_0x2e3015){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x39'),_0x2e3015['uniqueid']),_0x2e3015);calls[_0xe126('0x38')](_0x2e3015);recordings[_0xe126('0x38')](_0x2e3015);dials[_0xe126('0x38')](_0x2e3015);}catch(_0x2644f3){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x39'),_0x2e3015['uniqueid']),_0x2644f3);}});ami['on'](_0xe126('0x3a'),function(_0x5de9be){try{utils[_0xe126('0x14')](util['format']('[%s][index][newchannel]',_0x5de9be[_0xe126('0x19')]),_0x5de9be);calls['newchannel'](_0x5de9be);recordings[_0xe126('0x3a')](_0x5de9be);}catch(_0x49a2e8){utils[_0xe126('0x10')](util[_0xe126('0x15')](_0xe126('0x3b'),_0x5de9be['uniqueid']),_0x49a2e8);}});ami['on'](_0xe126('0x3c'),function(_0x408a45){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x3d'),_0x408a45[_0xe126('0x19')]),_0x408a45);dials['dialbegin'](_0x408a45);}catch(_0x23f22d){utils[_0xe126('0x10')](util[_0xe126('0x15')]('[%s]dialbegin',_0x408a45[_0xe126('0x19')]),_0x23f22d);}});ami['on']('dialend',function(_0x4b12b0){try{utils[_0xe126('0x14')](util[_0xe126('0x15')](_0xe126('0x3e'),_0x4b12b0[_0xe126('0x19')]),_0x4b12b0);dials[_0xe126('0x3f')](_0x4b12b0);}catch(_0x687ec3){utils[_0xe126('0x10')](util[_0xe126('0x15')]('[%s][index][dialend]',_0x4b12b0[_0xe126('0x19')]),_0x687ec3);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e1d774a..1ada34d 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 _0x331c=['membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','format','[%s][members][writeDB]','some','devicestatechange','[%s][members][devicestatechange]','device','uniqueid','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','agent','now','duration','diffTime','exitAt','error','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','./utils','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel'];(function(_0x3a1844,_0x2d0387){var _0x38440c=function(_0xe9d295){while(--_0xe9d295){_0x3a1844['push'](_0x3a1844['shift']());}};_0x38440c(++_0x2d0387);}(_0x331c,0xf0));var _0xc331=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x331c[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xc331('0x0'));var util=require('util');var utils=require(_0xc331('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x15f272){utils['info'](util['format'](_0xc331('0x2'),_0x15f272['uniqueid'],_0x15f272[_0xc331('0x3')],_0x15f272[_0xc331('0x4')],_0x15f272['data2'],_0x15f272[_0xc331('0x5')],_0x15f272[_0xc331('0x6')]));if(_0x15f272['interface']){utils[_0xc331('0x7')](_0x15f272[_0xc331('0x3')])[_0xc331('0x8')](function(_0x336c30){if(_0x336c30){_0x15f272['membername']=_0x336c30[_0xc331('0x9')];_0x15f272['internal']=_0x336c30[_0xc331('0xa')];utils[_0xc331('0xb')](_0xc331('0xc'),_0x15f272);}else{utils[_0xc331('0xd')](_0x15f272[_0xc331('0x3')][_0xc331('0xe')]('/')[0x1])[_0xc331('0x8')](function(_0x25ac6e){if(_0x25ac6e){_0x15f272[_0xc331('0x5')]=_0x25ac6e['name'];_0x15f272[_0xc331('0xa')]=_0x25ac6e[_0xc331('0xa')];utils[_0xc331('0xb')](_0xc331('0xc'),_0x15f272);}});}})[_0xc331('0xf')](function(_0x149caf){utils['error'](util[_0xc331('0x10')](_0xc331('0x11'),_0x15f272['uniqueid']),_0x149caf);});}delete members[_0x15f272[_0xc331('0x3')]];}function startsWith(_0x47639c,_0x297418){return _[_0xc331('0x12')](_0x47639c,function(_0x5265b5){return _['startsWith'](_0x297418,_0x5265b5);});}exports[_0xc331('0x13')]=function(_0x18e6df){try{utils['debug'](util[_0xc331('0x10')](_0xc331('0x14'),members[_0x18e6df['device']]?members[_0x18e6df[_0xc331('0x15')]][_0xc331('0x16')]:_0x18e6df['device']),_0x18e6df);utils[_0xc331('0x17')](util[_0xc331('0x10')](_0xc331('0x18'),members[_0x18e6df[_0xc331('0x15')]]?members[_0x18e6df[_0xc331('0x15')]]['uniqueid']:_0x18e6df[_0xc331('0x15')],_0x18e6df['state'],_0x18e6df[_0xc331('0x15')]));switch(_0x18e6df[_0xc331('0x19')]){case'INUSE':case _0xc331('0x1a'):if(!startsWith(exclude,_0x18e6df[_0xc331('0x15')])){members[_0x18e6df[_0xc331('0x15')]]={'channel':'voice','interface':_0x18e6df[_0xc331('0x15')],'type':_0xc331('0x1b'),'enterAt':utils['now'](),'role':_0xc331('0x1c')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x18e6df['device']])){members[_0x18e6df[_0xc331('0x15')]]['exitAt']=utils[_0xc331('0x1d')]();members[_0x18e6df[_0xc331('0x15')]][_0xc331('0x1e')]=utils[_0xc331('0x1f')](members[_0x18e6df['device']][_0xc331('0x20')],members[_0x18e6df['device']]['enterAt']);if(members[_0x18e6df['device']][_0xc331('0x16')]){writeDB(members[_0x18e6df[_0xc331('0x15')]]);}}break;default:break;}}catch(_0x38c1e7){utils[_0xc331('0x21')](util[_0xc331('0x10')](_0xc331('0x14'),members[_0x18e6df[_0xc331('0x15')]]?members[_0x18e6df[_0xc331('0x15')]][_0xc331('0x16')]:_0x18e6df[_0xc331('0x15')]),_0x38c1e7);}};exports[_0xc331('0x22')]=function(_0x2a1fbd){try{if(!_['isNil'](members[_0x2a1fbd[_0xc331('0x3')]])){utils[_0xc331('0x23')](util['format'](_0xc331('0x24'),_0x2a1fbd['uniqueid']),_0x2a1fbd);utils[_0xc331('0x17')](util['format'](_0xc331('0x25'),_0x2a1fbd['uniqueid'],_0x2a1fbd[_0xc331('0x3')],_0x2a1fbd[_0xc331('0x26')]));members[_0x2a1fbd[_0xc331('0x3')]]=_[_0xc331('0x27')](members[_0x2a1fbd[_0xc331('0x3')]],{'data4':_0x2a1fbd[_0xc331('0x26')],'uniqueid':_0x2a1fbd['uniqueid']});}}catch(_0x5d35f4){utils[_0xc331('0x21')](util['format'](_0xc331('0x24'),_0x2a1fbd['uniqueid']),_0x5d35f4);}};exports[_0xc331('0x28')]=function(_0x1bab6d){try{utils['debug'](util[_0xc331('0x10')](_0xc331('0x29'),_0x1bab6d[_0xc331('0x16')]),_0x1bab6d);if(_0x1bab6d[_0xc331('0x4')]){var _0x3c75b=_0x1bab6d[_0xc331('0x4')][_0xc331('0xe')]('-')[0x0];if(!_['isNil'](members[_0x3c75b])){members[_0x3c75b]=_[_0xc331('0x27')](members[_0x3c75b],{'data1':members[_0x3c75b][_0xc331('0x2a')]||_0x1bab6d['type'],'data2':members[_0x3c75b][_0xc331('0x2b')]||_0x1bab6d[_0xc331('0x2c')],'data3':members[_0x3c75b][_0xc331('0x2d')]||_0x1bab6d[_0xc331('0x2e')],'uniqueid':members[_0x3c75b][_0xc331('0x16')]||_0x1bab6d[_0xc331('0x16')]});utils['info'](util['format'](_0xc331('0x2f'),_0x1bab6d['uniqueid'],members[_0x3c75b]['data1'],members[_0x3c75b][_0xc331('0x2b')],members[_0x3c75b]['data3']));if(members[_0x3c75b]['exitAt']){writeDB(members[_0x3c75b]);}}}if(_0x1bab6d[_0xc331('0x30')]){var _0x36d4ac=_0x1bab6d[_0xc331('0x30')]['split']('-')[0x0];if(!_['isNil'](members[_0x36d4ac])){members[_0x36d4ac]=_[_0xc331('0x27')](members[_0x36d4ac],{'data1':members[_0x36d4ac][_0xc331('0x2a')]||_0x1bab6d[_0xc331('0x6')],'data2':members[_0x36d4ac][_0xc331('0x2b')]||_0x1bab6d['source'],'data3':members[_0x36d4ac][_0xc331('0x2d')]||_0x1bab6d[_0xc331('0x2e')],'uniqueid':members[_0x36d4ac]['uniqueid']||_0x1bab6d[_0xc331('0x16')]});utils[_0xc331('0x17')](util[_0xc331('0x10')](_0xc331('0x2f'),_0x1bab6d['uniqueid'],members[_0x36d4ac][_0xc331('0x2a')],members[_0x36d4ac][_0xc331('0x2b')],members[_0x36d4ac][_0xc331('0x2d')]));if(members[_0x36d4ac]['exitAt']){writeDB(members[_0x36d4ac]);}}}}catch(_0x21d5ce){utils[_0xc331('0x21')](util['format'](_0xc331('0x29'),_0x1bab6d[_0xc331('0x16')]),_0x21d5ce);}}; \ No newline at end of file +var _0x23c5=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now'];(function(_0x2aed45,_0x7da562){var _0x1119bb=function(_0x5a67cb){while(--_0x5a67cb){_0x2aed45['push'](_0x2aed45['shift']());}};_0x1119bb(++_0x7da562);}(_0x23c5,0x128));var _0x523c=function(_0x1c1205,_0x19b2fd){_0x1c1205=_0x1c1205-0x0;var _0x2d96f3=_0x23c5[_0x1c1205];return _0x2d96f3;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var utils=require(_0x523c('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x523c('0x3')];function writeDB(_0x26febf){utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x6'),_0x26febf[_0x523c('0x7')],_0x26febf[_0x523c('0x8')],_0x26febf[_0x523c('0x9')],_0x26febf['data2'],_0x26febf[_0x523c('0xa')],_0x26febf[_0x523c('0xb')]));if(_0x26febf[_0x523c('0x8')]){utils[_0x523c('0xc')](_0x26febf[_0x523c('0x8')])[_0x523c('0xd')](function(_0x55b4eb){if(_0x55b4eb){_0x26febf['membername']=_0x55b4eb[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x55b4eb[_0x523c('0xf')];utils[_0x523c('0x10')]('CreateMemberReport',_0x26febf);}else{utils[_0x523c('0x11')](_0x26febf[_0x523c('0x8')]['split']('/')[0x1])[_0x523c('0xd')](function(_0x75c1c4){if(_0x75c1c4){_0x26febf[_0x523c('0xa')]=_0x75c1c4[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x75c1c4[_0x523c('0xf')];utils[_0x523c('0x10')](_0x523c('0x12'),_0x26febf);}});}})[_0x523c('0x13')](function(_0x31d57a){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][writeDB]',_0x26febf[_0x523c('0x7')]),_0x31d57a);});}delete members[_0x26febf[_0x523c('0x8')]];}function startsWith(_0x51f274,_0x5c62fc){return _[_0x523c('0x15')](_0x51f274,function(_0x5d8635){return _[_0x523c('0x16')](_0x5c62fc,_0x5d8635);});}exports[_0x523c('0x17')]=function(_0x233a08){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')]),_0x233a08);utils[_0x523c('0x4')](util['format'](_0x523c('0x1b'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')],_0x233a08['state'],_0x233a08[_0x523c('0x1a')]));switch(_0x233a08[_0x523c('0x1c')]){case _0x523c('0x1d'):case _0x523c('0x1e'):if(!startsWith(exclude,_0x233a08[_0x523c('0x1a')])){members[_0x233a08[_0x523c('0x1a')]]={'channel':_0x523c('0x1f'),'interface':_0x233a08[_0x523c('0x1a')],'type':_0x523c('0x20'),'enterAt':utils[_0x523c('0x21')](),'role':_0x523c('0x22')};}break;case _0x523c('0x23'):if(!_[_0x523c('0x24')](members[_0x233a08['device']])){members[_0x233a08['device']][_0x523c('0x25')]=utils[_0x523c('0x21')]();members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x26')]=utils[_0x523c('0x27')](members[_0x233a08[_0x523c('0x1a')]]['exitAt'],members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x28')]);if(members[_0x233a08[_0x523c('0x1a')]]['uniqueid']){writeDB(members[_0x233a08[_0x523c('0x1a')]]);}}break;default:break;}}catch(_0x1c4e5f){utils['error'](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]]['uniqueid']:_0x233a08[_0x523c('0x1a')]),_0x1c4e5f);}};exports[_0x523c('0x29')]=function(_0x9f872){try{if(!_['isNil'](members[_0x9f872[_0x523c('0x8')]])){utils[_0x523c('0x18')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x9f872);utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x2a'),_0x9f872[_0x523c('0x7')],_0x9f872[_0x523c('0x8')],_0x9f872[_0x523c('0x2b')]));members[_0x9f872[_0x523c('0x8')]]=_[_0x523c('0x2c')](members[_0x9f872[_0x523c('0x8')]],{'data4':_0x9f872['queue'],'uniqueid':_0x9f872[_0x523c('0x7')]});}}catch(_0x425596){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x425596);}};exports[_0x523c('0x2d')]=function(_0x18668b){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b['uniqueid']),_0x18668b);if(_0x18668b[_0x523c('0x9')]){var _0x59fabe=_0x18668b[_0x523c('0x9')][_0x523c('0x2f')]('-')[0x0];if(!_[_0x523c('0x24')](members[_0x59fabe])){members[_0x59fabe]=_[_0x523c('0x2c')](members[_0x59fabe],{'data1':members[_0x59fabe][_0x523c('0x30')]||_0x18668b[_0x523c('0xb')],'data2':members[_0x59fabe][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x59fabe][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x59fabe]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x59fabe]['data1'],members[_0x59fabe][_0x523c('0x31')],members[_0x59fabe]['data3']));if(members[_0x59fabe][_0x523c('0x25')]){writeDB(members[_0x59fabe]);}}}if(_0x18668b[_0x523c('0x36')]){var _0x5ce3fc=_0x18668b[_0x523c('0x36')]['split']('-')[0x0];if(!_[_0x523c('0x24')](members[_0x5ce3fc])){members[_0x5ce3fc]=_['assign'](members[_0x5ce3fc],{'data1':members[_0x5ce3fc]['data1']||_0x18668b[_0x523c('0xb')],'data2':members[_0x5ce3fc][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x5ce3fc][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x5ce3fc]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x5ce3fc]['data1'],members[_0x5ce3fc][_0x523c('0x31')],members[_0x5ce3fc][_0x523c('0x33')]));if(members[_0x5ce3fc]['exitAt']){writeDB(members[_0x5ce3fc]);}}}}catch(_0x42c814){utils[_0x523c('0x14')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b[_0x523c('0x7')]),_0x42c814);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bae9637..4545ee4 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 _0x3574=['holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','isNil','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x3574,0x9e));var _0x4357=function(_0x2e50bc,_0x391ad9){_0x2e50bc=_0x2e50bc-0x0;var _0x4e2fea=_0x3574[_0x2e50bc];return _0x4e2fea;};'use strict';var _=require(_0x4357('0x0'));var util=require('util');var utils=require(_0x4357('0x1'));var queues={};function writeDB(_0xfe5300){utils[_0x4357('0x2')](util[_0x4357('0x3')](_0x4357('0x4'),_0xfe5300['uniqueid'],_0xfe5300['channel'],_0xfe5300[_0x4357('0x5')],_0xfe5300[_0x4357('0x6')],_0xfe5300['calleridnum'],_0xfe5300['accountcode'],_0xfe5300[_0x4357('0x7')]));if(_0xfe5300[_0x4357('0x5')]){utils[_0x4357('0x8')](_0xfe5300[_0x4357('0x5')])[_0x4357('0x9')](function(_0x161695){if(_0x161695){_0xfe5300[_0x4357('0xa')]=_0x161695[_0x4357('0xa')];}utils[_0x4357('0xb')]('CreateVoiceQueueReport',_0xfe5300);});}else{utils[_0x4357('0xb')](_0x4357('0xc'),_0xfe5300);}if(_0xfe5300[_0x4357('0xd')]){delete queues[_0xfe5300[_0x4357('0xd')]];}else{delete queues[_0xfe5300[_0x4357('0xe')]];}}exports[_0x4357('0xf')]=function(_0x4da387){try{utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x11'),_0x4da387[_0x4357('0xe')]),_0x4da387);utils['info'](util[_0x4357('0x3')](_0x4357('0x12'),_0x4da387[_0x4357('0xe')],_0x4da387[_0x4357('0x5')],_0x4da387[_0x4357('0x13')]));queues[_0x4da387[_0x4357('0xe')]]=_[_0x4357('0x14')](_0x4da387,{'originalposition':_0x4da387[_0x4357('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x444fe3){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x11'),_0x4da387[_0x4357('0xe')]),_0x444fe3);}};exports[_0x4357('0x16')]=function(_0x57e5e8){try{if(!_['isNil'](queues[_0x57e5e8[_0x4357('0xe')]])){utils[_0x4357('0x10')](util[_0x4357('0x3')]('[%s][queues][hangup]',_0x57e5e8[_0x4357('0xe')]),_0x57e5e8);if(queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x17')]){if(!queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x18')]&&!queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x19')]){queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x1a')]=!![];queues[_0x57e5e8[_0x4357('0xe')]]['queuecallercompleteAt']=utils[_0x4357('0x1b')]();queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x7')]=_0x4357('0x1c');}utils[_0x4357('0x2')](util['format'](_0x4357('0x1d'),_0x57e5e8[_0x4357('0xe')],queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x1e')],queues[_0x57e5e8[_0x4357('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x57e5e8[_0x4357('0xe')]]);}else if(queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0xd')]){utils['info'](util[_0x4357('0x3')](_0x4357('0x1f'),_0x57e5e8[_0x4357('0xe')],queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0x1e')],queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0xd')]));queues[queues[_0x57e5e8[_0x4357('0xe')]][_0x4357('0xd')]]=queues[_0x57e5e8[_0x4357('0xe')]];queues[queues[_0x57e5e8['uniqueid']][_0x4357('0xd')]][_0x4357('0x20')]=0x2;delete queues[_0x57e5e8['uniqueid']];}}}catch(_0x1e3fb4){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x21'),_0x57e5e8[_0x4357('0xe')]),_0x1e3fb4);}};exports['varset']=function(_0x208bd3){try{utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x22'),_0x208bd3['uniqueid']),_0x208bd3);if(!_['isNil'](_0x208bd3[_0x4357('0x23')][_0x4357('0x24')])&&_0x208bd3[_0x4357('0x25')][_0x4357('0x26')]()!==_0x4357('0x27')){if(!_[_0x4357('0x28')](queues[_0x208bd3['uniqueid']])){queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x18')]=![];queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x29')]=null;queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x19')]=!![];queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x2a')]=utils[_0x4357('0x1b')]();queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x7')]=_0x208bd3[_0x4357('0x25')][_0x4357('0x26')]();utils[_0x4357('0x2')](util[_0x4357('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x208bd3['uniqueid'],queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x1e')],_0x208bd3[_0x4357('0x25')],queues[_0x208bd3['uniqueid']][_0x4357('0x7')]));writeDB(queues[_0x208bd3[_0x4357('0xe')]]);}}else if(!_[_0x4357('0x28')](_0x208bd3['variable'][_0x4357('0x2b')])){if(!_[_0x4357('0x28')](queues[_0x208bd3['uniqueid']])&&!queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x18')]){queues[_0x208bd3['uniqueid']]['queuecallerabandon']=![];queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x29')]=null;queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x19')]=!![];queues[_0x208bd3['uniqueid']][_0x4357('0x2a')]=utils[_0x4357('0x1b')]();queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x7')]=_0x4357('0x2c');utils[_0x4357('0x2')](util[_0x4357('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x208bd3[_0x4357('0xe')],queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x1e')],_0x208bd3[_0x4357('0x25')],queues[_0x208bd3[_0x4357('0xe')]][_0x4357('0x7')]));}}}catch(_0x1b0dbc){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x22'),_0x208bd3[_0x4357('0xe')]),_0x1b0dbc);}};exports[_0x4357('0x18')]=function(_0x2632b2){try{if(!_[_0x4357('0x28')](queues[_0x2632b2[_0x4357('0xe')]])){utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x2d'),_0x2632b2[_0x4357('0xe')]),_0x2632b2);queues[_0x2632b2['uniqueid']][_0x4357('0x19')]=![];queues[_0x2632b2[_0x4357('0xe')]][_0x4357('0x2a')]=null;queues[_0x2632b2[_0x4357('0xe')]]['queuecallerabandon']=!![];queues[_0x2632b2[_0x4357('0xe')]]['queuecallerabandonAt']=utils[_0x4357('0x1b')]();queues[_0x2632b2['uniqueid']][_0x4357('0x7')]=_0x4357('0x2e');utils['info'](util[_0x4357('0x3')](_0x4357('0x2f'),_0x2632b2[_0x4357('0xe')],queues[_0x2632b2['uniqueid']][_0x4357('0x1e')],queues[_0x2632b2[_0x4357('0xe')]][_0x4357('0x7')]));}}catch(_0x557f74){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x2d'),_0x2632b2['uniqueid']),_0x557f74);}};exports['queuecallerleave']=function(_0x50b382){try{if(!_[_0x4357('0x28')](queues[_0x50b382['uniqueid']])){utils['debug'](util[_0x4357('0x3')](_0x4357('0x30'),_0x50b382[_0x4357('0xe')]),_0x50b382);utils[_0x4357('0x2')](util['format'](_0x4357('0x31'),_0x50b382['uniqueid'],queues[_0x50b382[_0x4357('0xe')]][_0x4357('0x1e')],_0x50b382[_0x4357('0x32')],_0x50b382[_0x4357('0x33')]));queues[_0x50b382['uniqueid']]['queuecallerleave']=!![];queues[_0x50b382[_0x4357('0xe')]][_0x4357('0x17')]=utils[_0x4357('0x1b')]();queues[_0x50b382[_0x4357('0xe')]][_0x4357('0x34')]=utils[_0x4357('0x35')](queues[_0x50b382['uniqueid']][_0x4357('0x17')],queues[_0x50b382[_0x4357('0xe')]][_0x4357('0x36')]);queues[_0x50b382['uniqueid']]['position']=_0x50b382[_0x4357('0x13')];queues[_0x50b382[_0x4357('0xe')]]['count']=_0x50b382[_0x4357('0x37')];queues[_0x50b382[_0x4357('0xe')]][_0x4357('0x32')]=_0x50b382['connectedlinenum'];queues[_0x50b382['uniqueid']]['connectedlinename']=_0x50b382[_0x4357('0x33')];}}catch(_0x47ae1e){utils[_0x4357('0x15')](util['format']('[%s][queues][queuecallerleave]',_0x50b382[_0x4357('0xe')]),_0x47ae1e);}};exports[_0x4357('0x38')]=function(_0x2e10e1){try{if(!_[_0x4357('0x28')](queues[_0x2e10e1[_0x4357('0xe')]])){utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x39'),_0x2e10e1[_0x4357('0xe')]),_0x2e10e1);utils[_0x4357('0x2')](util[_0x4357('0x3')](_0x4357('0x3a'),_0x2e10e1[_0x4357('0xe')],queues[_0x2e10e1[_0x4357('0xe')]][_0x4357('0x1e')],_0x2e10e1[_0x4357('0x3b')],_0x2e10e1[_0x4357('0x3c')]));queues[_0x2e10e1[_0x4357('0xe')]]['queuecallerabandon']=![];queues[_0x2e10e1[_0x4357('0xe')]][_0x4357('0x18')]=![];queues[_0x2e10e1[_0x4357('0xe')]]['queuecallerabandonAt']=null;queues[_0x2e10e1[_0x4357('0xe')]]['queuecallerexit']=![];queues[_0x2e10e1[_0x4357('0xe')]]['queuecallerexitreason']=null;queues[_0x2e10e1[_0x4357('0xe')]]['queuecallerexitAt']=null;queues[_0x2e10e1[_0x4357('0xe')]][_0x4357('0x3d')]=!![];queues[_0x2e10e1['uniqueid']]['accountcode']=_0x2e10e1[_0x4357('0x3c')];queues[_0x2e10e1[_0x4357('0xe')]][_0x4357('0x6')]=_0x2e10e1['membername'];}}catch(_0x39ef09){utils['error'](util[_0x4357('0x3')]('[%s][queues][agentconnect]',_0x2e10e1['uniqueid']),_0x39ef09);}};exports[_0x4357('0x3e')]=function(_0x6d03f6){try{if(!_[_0x4357('0x28')](queues[_0x6d03f6[_0x4357('0xe')]])){if(queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x17')]){utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x3f'),_0x6d03f6[_0x4357('0xe')]),_0x6d03f6);queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x18')]=![];queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x18')]=![];queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x29')]=null;queues[_0x6d03f6['uniqueid']]['queuecallerexit']=![];queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x2a')]=null;queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x3d')]=!![];queues[_0x6d03f6[_0x4357('0xe')]]['lastAssignedTo']=_0x6d03f6[_0x4357('0x3b')];queues[_0x6d03f6[_0x4357('0xe')]]['queuecallercomplete']=!![];queues[_0x6d03f6['uniqueid']][_0x4357('0x40')]=utils[_0x4357('0x1b')]();if(_0x6d03f6[_0x4357('0x41')]==_0x4357('0x42')){if(!queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x42')]){queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x7')]='TRANSFER';}}else{queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x7')]=_0x4357('0x43')+_0x6d03f6['reason'][_0x4357('0x26')]();}utils['info'](util[_0x4357('0x3')](_0x4357('0x44'),_0x6d03f6[_0x4357('0xe')],queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x1e')],_0x6d03f6[_0x4357('0x3b')],queues[_0x6d03f6[_0x4357('0xe')]][_0x4357('0x7')]));writeDB(queues[_0x6d03f6[_0x4357('0xe')]]);}}}catch(_0x548a34){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x3f'),_0x6d03f6[_0x4357('0xe')]),_0x548a34);}};exports[_0x4357('0x45')]=function(_0x585797){try{if(!_['isNil'](queues[_0x585797[_0x4357('0x46')]])){utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x47'),_0x585797[_0x4357('0xe')]),_0x585797);queues[_0x585797[_0x4357('0x46')]][_0x4357('0x42')]=!![];queues[_0x585797[_0x4357('0x46')]][_0x4357('0x48')]=_0x4357('0x49');queues[_0x585797['transfereeuniqueid']][_0x4357('0x4a')]=_0x585797[_0x4357('0x4b')];queues[_0x585797[_0x4357('0x46')]][_0x4357('0x4c')]=_0x585797[_0x4357('0x46')];queues[_0x585797[_0x4357('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0x4357('0x3')](_0x4357('0x4d'),_0x585797[_0x4357('0xe')],queues[_0x585797[_0x4357('0x46')]]['name'],_0x585797[_0x4357('0x46')],_0x585797[_0x4357('0x4b')]));}}catch(_0x56d01e){utils[_0x4357('0x15')](util[_0x4357('0x3')](_0x4357('0x47'),_0x585797[_0x4357('0xe')]),_0x56d01e);}};exports[_0x4357('0x4e')]=function(_0x4ec2e7){try{utils['debug'](util['format']('[%s][queues][attendedtransfer]',_0x4ec2e7[_0x4357('0x4f')]),_0x4ec2e7);if(_0x4ec2e7[_0x4357('0x4f')]==_0x4ec2e7[_0x4357('0x50')]){if(!_[_0x4357('0x28')](queues[_0x4ec2e7[_0x4357('0x51')]])){utils['info'](util[_0x4357('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4ec2e7[_0x4357('0x4f')],queues[_0x4ec2e7['secondtransfererlinkedid']][_0x4357('0x1e')],_0x4ec2e7['origtransfererexten']));queues[_0x4ec2e7[_0x4357('0x51')]][_0x4357('0x42')]=!![];queues[_0x4ec2e7['secondtransfererlinkedid']][_0x4357('0x48')]='ATTENDED';queues[_0x4ec2e7[_0x4357('0x51')]][_0x4357('0x4a')]=_0x4ec2e7['origtransfererexten'];queues[_0x4ec2e7[_0x4357('0x51')]]['transferuniqueid']=_0x4ec2e7['origtransfereruniqueid'];queues[_0x4ec2e7['secondtransfererlinkedid']][_0x4357('0x7')]=_0x4357('0x52');}if(!_['isNil'](queues[_0x4ec2e7[_0x4357('0x50')]])){if(_0x4ec2e7[_0x4357('0x53')]&&queues[_0x4ec2e7[_0x4357('0x53')]]){queues[_0x4ec2e7['transfereelinkedid']][_0x4357('0x20')]=0x1;queues[_0x4ec2e7[_0x4357('0x46')]]=_[_0x4357('0x54')](queues[_0x4ec2e7['transfereelinkedid']]);queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0xd')]=_0x4ec2e7['transfertargetuniqueid'];queues[_0x4ec2e7['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x55')]=queues[_0x4ec2e7[_0x4357('0x51')]][_0x4357('0x55')];queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x56')]=queues[_0x4ec2e7[_0x4357('0x51')]][_0x4357('0x56')];queues[_0x4ec2e7[_0x4357('0x46')]]['queuecallerjoinAt']=utils[_0x4357('0x1b')]();queues[_0x4ec2e7[_0x4357('0x46')]]['queuecallerleaveAt']=utils[_0x4357('0x1b')]();queues[_0x4ec2e7[_0x4357('0x46')]]['holdtime']=0x0;queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x57')]=0x0;utils['info'](util[_0x4357('0x3')](_0x4357('0x58'),_0x4ec2e7['origtransfereruniqueid'],queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x1e')],queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x55')],queues[_0x4ec2e7[_0x4357('0x46')]][_0x4357('0x56')]));}else{utils[_0x4357('0x2')](util['format'](_0x4357('0x59'),_0x4ec2e7[_0x4357('0x4f')],queues[_0x4ec2e7[_0x4357('0x50')]]['name'],_0x4ec2e7[_0x4357('0x51')]));queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0xd')]=_0x4ec2e7[_0x4357('0x51')];}}}else if(_0x4ec2e7[_0x4357('0x5a')]==_0x4ec2e7[_0x4357('0x51')]){if(!_['isNil'](queues[_0x4ec2e7['origtransfererlinkedid']])){utils['info'](util[_0x4357('0x3')](_0x4357('0x5b'),_0x4ec2e7[_0x4357('0x4f')],queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0x1e')],_0x4ec2e7[_0x4357('0x5a')],_0x4ec2e7[_0x4357('0x5c')]));queues[_0x4ec2e7['origtransfererlinkedid']][_0x4357('0x42')]=!![];queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0x48')]=_0x4357('0x5d');queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0x4a')]=_0x4ec2e7[_0x4357('0x5c')];queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0x4c')]=_0x4ec2e7['secondtransfereruniqueid'];queues[_0x4ec2e7[_0x4357('0x50')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x4ec2e7[_0x4357('0x51')]])){if(_0x4ec2e7[_0x4357('0x5e')]&&queues[_0x4ec2e7[_0x4357('0x5e')]]){queues[_0x4ec2e7[_0x4357('0x5e')]][_0x4357('0x20')]=0x1;queues[_0x4ec2e7[_0x4357('0x5f')]]=_[_0x4357('0x54')](queues[_0x4ec2e7[_0x4357('0x5e')]]);queues[_0x4ec2e7[_0x4357('0x5f')]]['transfereduniqueid']=_0x4ec2e7[_0x4357('0x5f')];queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x20')]=0x2;queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x55')]=queues[_0x4ec2e7[_0x4357('0x50')]][_0x4357('0x55')];queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x56')]=queues[_0x4ec2e7[_0x4357('0x50')]]['calleridname'];queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x36')]=utils[_0x4357('0x1b')]();queues[_0x4ec2e7[_0x4357('0x5f')]]['queuecallerleaveAt']=utils[_0x4357('0x1b')]();queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x34')]=0x0;queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x57')]=0x0;utils[_0x4357('0x2')](util[_0x4357('0x3')](_0x4357('0x60'),_0x4ec2e7[_0x4357('0x4f')],queues[_0x4ec2e7[_0x4357('0x5f')]]['name'],queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0xd')],queues[_0x4ec2e7[_0x4357('0x5f')]][_0x4357('0x55')],queues[_0x4ec2e7['transfertargetuniqueid']][_0x4357('0x56')]));}else{utils['info'](util[_0x4357('0x3')](_0x4357('0x59'),_0x4ec2e7[_0x4357('0x4f')],queues[_0x4ec2e7['secondtransfererlinkedid']][_0x4357('0x1e')],_0x4ec2e7['origtransfererlinkedid']));queues[_0x4ec2e7[_0x4357('0x51')]][_0x4357('0xd')]=_0x4ec2e7[_0x4357('0x50')];}}}}catch(_0x1cf6da){utils['error'](util['format'](_0x4357('0x61'),_0x4ec2e7[_0x4357('0x4f')]),_0x1cf6da);}};exports[_0x4357('0x62')]=function(_0x27cc65){try{if(!_[_0x4357('0x28')](queues[_0x27cc65['uniqueid']])){utils[_0x4357('0x10')](util[_0x4357('0x3')](_0x4357('0x63'),_0x27cc65['uniqueid']),_0x27cc65);queues[_0x27cc65[_0x4357('0xe')]][_0x4357('0x64')]=utils[_0x4357('0x1b')]();utils[_0x4357('0x2')](util[_0x4357('0x3')](_0x4357('0x65'),_0x27cc65[_0x4357('0xe')],queues[_0x27cc65[_0x4357('0xe')]][_0x4357('0x1e')],queues[_0x27cc65['uniqueid']][_0x4357('0x64')]));}}catch(_0x2654e5){utils['error'](util[_0x4357('0x3')]('[%s][queues][musiconholdstart]',_0x27cc65[_0x4357('0xe')]),_0x2654e5);}};exports[_0x4357('0x66')]=function(_0xaf9509){try{if(!_[_0x4357('0x28')](queues[_0xaf9509[_0x4357('0xe')]])){if(!_[_0x4357('0x28')](queues[_0xaf9509['uniqueid']][_0x4357('0x64')])){utils[_0x4357('0x10')](util['format'](_0x4357('0x67'),_0xaf9509[_0x4357('0xe')]),_0xaf9509);queues[_0xaf9509[_0x4357('0xe')]][_0x4357('0x57')]+=utils[_0x4357('0x35')](utils[_0x4357('0x1b')](),queues[_0xaf9509['uniqueid']][_0x4357('0x64')]);utils[_0x4357('0x2')](util['format'](_0x4357('0x68'),_0xaf9509['uniqueid'],queues[_0xaf9509[_0x4357('0xe')]]['name'],queues[_0xaf9509[_0x4357('0xe')]][_0x4357('0x57')]));delete queues[_0xaf9509[_0x4357('0xe')]][_0x4357('0x64')];}}}catch(_0x5edee9){utils['error'](util[_0x4357('0x3')](_0x4357('0x67'),_0xaf9509[_0x4357('0xe')]),_0x5edee9);}}; \ No newline at end of file +var _0xfc31=['channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinenum','connectedlinename','holdtime','diffTime','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfc31,0xc8));var _0x1fc3=function(_0x4b6c8f,_0x2eb14f){_0x4b6c8f=_0x4b6c8f-0x0;var _0x1ba3d7=_0xfc31[_0x4b6c8f];return _0x1ba3d7;};'use strict';var _=require(_0x1fc3('0x0'));var util=require(_0x1fc3('0x1'));var utils=require(_0x1fc3('0x2'));var queues={};function writeDB(_0x58aaad){utils[_0x1fc3('0x3')](util['format'](_0x1fc3('0x4'),_0x58aaad[_0x1fc3('0x5')],_0x58aaad[_0x1fc3('0x6')],_0x58aaad[_0x1fc3('0x7')],_0x58aaad[_0x1fc3('0x8')],_0x58aaad[_0x1fc3('0x9')],_0x58aaad[_0x1fc3('0xa')],_0x58aaad[_0x1fc3('0xb')]));if(_0x58aaad[_0x1fc3('0x7')]){utils[_0x1fc3('0xc')](_0x58aaad[_0x1fc3('0x7')])[_0x1fc3('0xd')](function(_0x5e6d6a){if(_0x5e6d6a){_0x58aaad[_0x1fc3('0xe')]=_0x5e6d6a[_0x1fc3('0xe')];}utils[_0x1fc3('0xf')]('CreateVoiceQueueReport',_0x58aaad);});}else{utils[_0x1fc3('0xf')](_0x1fc3('0x10'),_0x58aaad);}if(_0x58aaad[_0x1fc3('0x11')]){delete queues[_0x58aaad[_0x1fc3('0x11')]];}else{delete queues[_0x58aaad[_0x1fc3('0x5')]];}}exports[_0x1fc3('0x12')]=function(_0x3cec26){try{utils['debug'](util[_0x1fc3('0x13')](_0x1fc3('0x14'),_0x3cec26[_0x1fc3('0x5')]),_0x3cec26);utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x15'),_0x3cec26[_0x1fc3('0x5')],_0x3cec26['queue'],_0x3cec26[_0x1fc3('0x16')]));queues[_0x3cec26[_0x1fc3('0x5')]]=_[_0x1fc3('0x17')](_0x3cec26,{'originalposition':_0x3cec26[_0x1fc3('0x16')],'queuecallerjoinAt':utils[_0x1fc3('0x18')](),'mohtime':0x0});}catch(_0x56694e){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x14'),_0x3cec26[_0x1fc3('0x5')]),_0x56694e);}};exports[_0x1fc3('0x1a')]=function(_0x36f50f){try{if(!_[_0x1fc3('0x1b')](queues[_0x36f50f['uniqueid']])){utils['debug'](util[_0x1fc3('0x13')](_0x1fc3('0x1c'),_0x36f50f[_0x1fc3('0x5')]),_0x36f50f);if(queues[_0x36f50f['uniqueid']][_0x1fc3('0x1d')]){if(!queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x1e')]&&!queues[_0x36f50f['uniqueid']][_0x1fc3('0x1f')]){queues[_0x36f50f['uniqueid']][_0x1fc3('0x20')]=!![];queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x21')]=utils['now']();queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0xb')]='COMPLETEDBYAGENT';}utils['info'](util[_0x1fc3('0x13')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x36f50f[_0x1fc3('0x5')],queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x22')],queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0xb')]));writeDB(queues[_0x36f50f['uniqueid']]);}else if(queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x11')]){utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x23'),_0x36f50f['uniqueid'],queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x22')],queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x11')]));queues[queues[_0x36f50f[_0x1fc3('0x5')]]['transfereduniqueid']]=queues[_0x36f50f[_0x1fc3('0x5')]];queues[queues[_0x36f50f[_0x1fc3('0x5')]][_0x1fc3('0x11')]][_0x1fc3('0x24')]=0x2;delete queues[_0x36f50f[_0x1fc3('0x5')]];}}}catch(_0x4714dd){utils[_0x1fc3('0x19')](util['format'](_0x1fc3('0x1c'),_0x36f50f[_0x1fc3('0x5')]),_0x4714dd);}};exports[_0x1fc3('0x25')]=function(_0x7a8278){try{utils[_0x1fc3('0x26')](util[_0x1fc3('0x13')](_0x1fc3('0x27'),_0x7a8278[_0x1fc3('0x5')]),_0x7a8278);if(!_['isNil'](_0x7a8278['variable']['queuestatus'])&&_0x7a8278[_0x1fc3('0x28')]['toUpperCase']()!==_0x1fc3('0x29')){if(!_['isNil'](queues[_0x7a8278[_0x1fc3('0x5')]])){queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x1e')]=![];queues[_0x7a8278['uniqueid']][_0x1fc3('0x2a')]=null;queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x1f')]=!![];queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x2b')]=utils[_0x1fc3('0x18')]();queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0xb')]=_0x7a8278[_0x1fc3('0x28')][_0x1fc3('0x2c')]();utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x7a8278['uniqueid'],queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x22')],_0x7a8278[_0x1fc3('0x28')],queues[_0x7a8278[_0x1fc3('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x7a8278[_0x1fc3('0x5')]]);}}else if(!_[_0x1fc3('0x1b')](_0x7a8278[_0x1fc3('0x2d')][_0x1fc3('0x2e')])){if(!_[_0x1fc3('0x1b')](queues[_0x7a8278[_0x1fc3('0x5')]])&&!queues[_0x7a8278['uniqueid']][_0x1fc3('0x1e')]){queues[_0x7a8278['uniqueid']][_0x1fc3('0x1e')]=![];queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x2a')]=null;queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x1f')]=!![];queues[_0x7a8278[_0x1fc3('0x5')]][_0x1fc3('0x2b')]=utils['now']();queues[_0x7a8278[_0x1fc3('0x5')]]['queuecallerexitreason']=_0x1fc3('0x2f');utils[_0x1fc3('0x3')](util['format'](_0x1fc3('0x30'),_0x7a8278[_0x1fc3('0x5')],queues[_0x7a8278['uniqueid']]['name'],_0x7a8278[_0x1fc3('0x28')],queues[_0x7a8278[_0x1fc3('0x5')]]['queuecallerexitreason']));}}}catch(_0x4bbe39){utils['error'](util['format'](_0x1fc3('0x27'),_0x7a8278[_0x1fc3('0x5')]),_0x4bbe39);}};exports['queuecallerabandon']=function(_0x54a724){try{if(!_[_0x1fc3('0x1b')](queues[_0x54a724['uniqueid']])){utils['debug'](util['format'](_0x1fc3('0x31'),_0x54a724['uniqueid']),_0x54a724);queues[_0x54a724[_0x1fc3('0x5')]][_0x1fc3('0x1f')]=![];queues[_0x54a724[_0x1fc3('0x5')]][_0x1fc3('0x2b')]=null;queues[_0x54a724[_0x1fc3('0x5')]]['queuecallerabandon']=!![];queues[_0x54a724[_0x1fc3('0x5')]][_0x1fc3('0x2a')]=utils[_0x1fc3('0x18')]();queues[_0x54a724[_0x1fc3('0x5')]]['queuecallerexitreason']='ABANDONED';utils['info'](util[_0x1fc3('0x13')](_0x1fc3('0x32'),_0x54a724[_0x1fc3('0x5')],queues[_0x54a724['uniqueid']][_0x1fc3('0x22')],queues[_0x54a724[_0x1fc3('0x5')]][_0x1fc3('0xb')]));}}catch(_0x1f8a36){utils['error'](util[_0x1fc3('0x13')](_0x1fc3('0x31'),_0x54a724[_0x1fc3('0x5')]),_0x1f8a36);}};exports[_0x1fc3('0x33')]=function(_0x290312){try{if(!_[_0x1fc3('0x1b')](queues[_0x290312[_0x1fc3('0x5')]])){utils[_0x1fc3('0x26')](util[_0x1fc3('0x13')]('[%s][queues][queuecallerleave]',_0x290312['uniqueid']),_0x290312);utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x290312['uniqueid'],queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x22')],_0x290312[_0x1fc3('0x34')],_0x290312[_0x1fc3('0x35')]));queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x33')]=!![];queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x1d')]=utils[_0x1fc3('0x18')]();queues[_0x290312['uniqueid']][_0x1fc3('0x36')]=utils[_0x1fc3('0x37')](queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x1d')],queues[_0x290312['uniqueid']]['queuecallerjoinAt']);queues[_0x290312['uniqueid']][_0x1fc3('0x16')]=_0x290312['position'];queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x38')]=_0x290312[_0x1fc3('0x38')];queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x34')]=_0x290312[_0x1fc3('0x34')];queues[_0x290312[_0x1fc3('0x5')]][_0x1fc3('0x35')]=_0x290312[_0x1fc3('0x35')];}}catch(_0x5a7bea){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x39'),_0x290312[_0x1fc3('0x5')]),_0x5a7bea);}};exports[_0x1fc3('0x3a')]=function(_0x3d10f8){try{if(!_[_0x1fc3('0x1b')](queues[_0x3d10f8[_0x1fc3('0x5')]])){utils[_0x1fc3('0x26')](util['format'](_0x1fc3('0x3b'),_0x3d10f8[_0x1fc3('0x5')]),_0x3d10f8);utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x3c'),_0x3d10f8[_0x1fc3('0x5')],queues[_0x3d10f8[_0x1fc3('0x5')]]['name'],_0x3d10f8[_0x1fc3('0x3d')],_0x3d10f8[_0x1fc3('0x3e')]));queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0x1e')]=![];queues[_0x3d10f8['uniqueid']][_0x1fc3('0x1e')]=![];queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0x2a')]=null;queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0x1f')]=![];queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0xb')]=null;queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0x2b')]=null;queues[_0x3d10f8['uniqueid']]['assigned']=!![];queues[_0x3d10f8['uniqueid']]['accountcode']=_0x3d10f8['destaccountcode'];queues[_0x3d10f8[_0x1fc3('0x5')]][_0x1fc3('0x8')]=_0x3d10f8[_0x1fc3('0x3d')];}}catch(_0x50dc95){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')]('[%s][queues][agentconnect]',_0x3d10f8[_0x1fc3('0x5')]),_0x50dc95);}};exports[_0x1fc3('0x3f')]=function(_0x2ef939){try{if(!_[_0x1fc3('0x1b')](queues[_0x2ef939[_0x1fc3('0x5')]])){if(queues[_0x2ef939['uniqueid']][_0x1fc3('0x1d')]){utils[_0x1fc3('0x26')](util[_0x1fc3('0x13')](_0x1fc3('0x40'),_0x2ef939[_0x1fc3('0x5')]),_0x2ef939);queues[_0x2ef939[_0x1fc3('0x5')]][_0x1fc3('0x1e')]=![];queues[_0x2ef939[_0x1fc3('0x5')]]['queuecallerabandon']=![];queues[_0x2ef939[_0x1fc3('0x5')]]['queuecallerabandonAt']=null;queues[_0x2ef939['uniqueid']][_0x1fc3('0x1f')]=![];queues[_0x2ef939['uniqueid']][_0x1fc3('0x2b')]=null;queues[_0x2ef939[_0x1fc3('0x5')]]['assigned']=!![];queues[_0x2ef939[_0x1fc3('0x5')]][_0x1fc3('0x8')]=_0x2ef939['membername'];queues[_0x2ef939[_0x1fc3('0x5')]][_0x1fc3('0x20')]=!![];queues[_0x2ef939['uniqueid']]['queuecallercompleteAt']=utils[_0x1fc3('0x18')]();if(_0x2ef939[_0x1fc3('0x41')]==_0x1fc3('0x42')){if(!queues[_0x2ef939[_0x1fc3('0x5')]]['transfer']){queues[_0x2ef939['uniqueid']][_0x1fc3('0xb')]=_0x1fc3('0x43');}}else{queues[_0x2ef939[_0x1fc3('0x5')]]['queuecallerexitreason']=_0x1fc3('0x44')+_0x2ef939[_0x1fc3('0x41')][_0x1fc3('0x2c')]();}utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x45'),_0x2ef939[_0x1fc3('0x5')],queues[_0x2ef939[_0x1fc3('0x5')]][_0x1fc3('0x22')],_0x2ef939[_0x1fc3('0x3d')],queues[_0x2ef939[_0x1fc3('0x5')]][_0x1fc3('0xb')]));writeDB(queues[_0x2ef939[_0x1fc3('0x5')]]);}}}catch(_0x4f934a){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x40'),_0x2ef939[_0x1fc3('0x5')]),_0x4f934a);}};exports[_0x1fc3('0x46')]=function(_0x2c45ea){try{if(!_['isNil'](queues[_0x2c45ea[_0x1fc3('0x47')]])){utils['debug'](util[_0x1fc3('0x13')](_0x1fc3('0x48'),_0x2c45ea[_0x1fc3('0x5')]),_0x2c45ea);queues[_0x2c45ea[_0x1fc3('0x47')]][_0x1fc3('0x42')]=!![];queues[_0x2c45ea[_0x1fc3('0x47')]][_0x1fc3('0x49')]='BLIND';queues[_0x2c45ea['transfereeuniqueid']]['transferexten']=_0x2c45ea[_0x1fc3('0x4a')];queues[_0x2c45ea[_0x1fc3('0x47')]][_0x1fc3('0x4b')]=_0x2c45ea['transfereeuniqueid'];queues[_0x2c45ea[_0x1fc3('0x47')]][_0x1fc3('0xb')]='BLINDTRANSFER';utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x2c45ea[_0x1fc3('0x5')],queues[_0x2c45ea['transfereeuniqueid']][_0x1fc3('0x22')],_0x2c45ea[_0x1fc3('0x47')],_0x2c45ea[_0x1fc3('0x4a')]));}}catch(_0x19d40a){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x48'),_0x2c45ea[_0x1fc3('0x5')]),_0x19d40a);}};exports[_0x1fc3('0x4c')]=function(_0x5bc925){try{utils['debug'](util[_0x1fc3('0x13')](_0x1fc3('0x4d'),_0x5bc925[_0x1fc3('0x4e')]),_0x5bc925);if(_0x5bc925[_0x1fc3('0x4e')]==_0x5bc925['origtransfererlinkedid']){if(!_[_0x1fc3('0x1b')](queues[_0x5bc925[_0x1fc3('0x4f')]])){utils['info'](util[_0x1fc3('0x13')](_0x1fc3('0x50'),_0x5bc925[_0x1fc3('0x4e')],queues[_0x5bc925['secondtransfererlinkedid']][_0x1fc3('0x22')],_0x5bc925[_0x1fc3('0x51')]));queues[_0x5bc925['secondtransfererlinkedid']][_0x1fc3('0x42')]=!![];queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0x49')]=_0x1fc3('0x52');queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0x53')]=_0x5bc925['origtransfererexten'];queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0x4b')]=_0x5bc925['origtransfereruniqueid'];queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0xb')]=_0x1fc3('0x54');}if(!_[_0x1fc3('0x1b')](queues[_0x5bc925[_0x1fc3('0x55')]])){if(_0x5bc925[_0x1fc3('0x56')]&&queues[_0x5bc925[_0x1fc3('0x56')]]){queues[_0x5bc925[_0x1fc3('0x56')]]['queuecallerenterreason']=0x1;queues[_0x5bc925[_0x1fc3('0x47')]]=_[_0x1fc3('0x57')](queues[_0x5bc925[_0x1fc3('0x56')]]);queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x11')]=_0x5bc925[_0x1fc3('0x58')];queues[_0x5bc925['transfereeuniqueid']][_0x1fc3('0x24')]=0x2;queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x9')]=queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0x9')];queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x59')]=queues[_0x5bc925[_0x1fc3('0x4f')]][_0x1fc3('0x59')];queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x5a')]=utils[_0x1fc3('0x18')]();queues[_0x5bc925[_0x1fc3('0x47')]]['queuecallerleaveAt']=utils['now']();queues[_0x5bc925[_0x1fc3('0x47')]]['holdtime']=0x0;queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x5b')]=0x0;utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x5c'),_0x5bc925[_0x1fc3('0x4e')],queues[_0x5bc925[_0x1fc3('0x47')]]['name'],queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x9')],queues[_0x5bc925[_0x1fc3('0x47')]][_0x1fc3('0x59')]));}else{utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x5d'),_0x5bc925[_0x1fc3('0x4e')],queues[_0x5bc925[_0x1fc3('0x55')]][_0x1fc3('0x22')],_0x5bc925[_0x1fc3('0x4f')]));queues[_0x5bc925['origtransfererlinkedid']]['transfereduniqueid']=_0x5bc925[_0x1fc3('0x4f')];}}}else if(_0x5bc925[_0x1fc3('0x5e')]==_0x5bc925[_0x1fc3('0x4f')]){if(!_[_0x1fc3('0x1b')](queues[_0x5bc925[_0x1fc3('0x55')]])){utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5bc925['origtransfereruniqueid'],queues[_0x5bc925[_0x1fc3('0x55')]][_0x1fc3('0x22')],_0x5bc925['secondtransfereruniqueid'],_0x5bc925[_0x1fc3('0x5f')]));queues[_0x5bc925[_0x1fc3('0x55')]][_0x1fc3('0x42')]=!![];queues[_0x5bc925[_0x1fc3('0x55')]]['transfertype']='ATTENDED';queues[_0x5bc925['origtransfererlinkedid']][_0x1fc3('0x53')]=_0x5bc925[_0x1fc3('0x5f')];queues[_0x5bc925['origtransfererlinkedid']][_0x1fc3('0x4b')]=_0x5bc925[_0x1fc3('0x5e')];queues[_0x5bc925[_0x1fc3('0x55')]][_0x1fc3('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x1fc3('0x1b')](queues[_0x5bc925['secondtransfererlinkedid']])){if(_0x5bc925[_0x1fc3('0x60')]&&queues[_0x5bc925[_0x1fc3('0x60')]]){queues[_0x5bc925['transfertargetlinkedid']][_0x1fc3('0x24')]=0x1;queues[_0x5bc925['transfertargetuniqueid']]=_[_0x1fc3('0x57')](queues[_0x5bc925['transfertargetlinkedid']]);queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x11')]=_0x5bc925['transfertargetuniqueid'];queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x24')]=0x2;queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x9')]=queues[_0x5bc925[_0x1fc3('0x55')]][_0x1fc3('0x9')];queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x59')]=queues[_0x5bc925[_0x1fc3('0x55')]]['calleridname'];queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x5a')]=utils[_0x1fc3('0x18')]();queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x1d')]=utils[_0x1fc3('0x18')]();queues[_0x5bc925['transfertargetuniqueid']][_0x1fc3('0x36')]=0x0;queues[_0x5bc925['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util[_0x1fc3('0x13')](_0x1fc3('0x61'),_0x5bc925[_0x1fc3('0x4e')],queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x22')],queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x11')],queues[_0x5bc925[_0x1fc3('0x58')]][_0x1fc3('0x9')],queues[_0x5bc925['transfertargetuniqueid']][_0x1fc3('0x59')]));}else{utils[_0x1fc3('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5bc925[_0x1fc3('0x4e')],queues[_0x5bc925['secondtransfererlinkedid']]['name'],_0x5bc925[_0x1fc3('0x55')]));queues[_0x5bc925['secondtransfererlinkedid']]['transfereduniqueid']=_0x5bc925[_0x1fc3('0x55')];}}}}catch(_0x3c253b){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x4d'),_0x5bc925[_0x1fc3('0x4e')]),_0x3c253b);}};exports['musiconholdstart']=function(_0x32e3c0){try{if(!_[_0x1fc3('0x1b')](queues[_0x32e3c0[_0x1fc3('0x5')]])){utils[_0x1fc3('0x26')](util[_0x1fc3('0x13')]('[%s][queues][musiconholdstart]',_0x32e3c0['uniqueid']),_0x32e3c0);queues[_0x32e3c0['uniqueid']][_0x1fc3('0x62')]=utils['now']();utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')](_0x1fc3('0x63'),_0x32e3c0['uniqueid'],queues[_0x32e3c0[_0x1fc3('0x5')]][_0x1fc3('0x22')],queues[_0x32e3c0['uniqueid']][_0x1fc3('0x62')]));}}catch(_0x19348a){utils['error'](util[_0x1fc3('0x13')](_0x1fc3('0x64'),_0x32e3c0[_0x1fc3('0x5')]),_0x19348a);}};exports[_0x1fc3('0x65')]=function(_0x1eb475){try{if(!_[_0x1fc3('0x1b')](queues[_0x1eb475[_0x1fc3('0x5')]])){if(!_['isNil'](queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x62')])){utils['debug'](util[_0x1fc3('0x13')](_0x1fc3('0x66'),_0x1eb475['uniqueid']),_0x1eb475);queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x5b')]+=utils['diffTime'](utils['now'](),queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x62')]);utils[_0x1fc3('0x3')](util[_0x1fc3('0x13')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x1eb475[_0x1fc3('0x5')],queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x22')],queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x5b')]));delete queues[_0x1eb475[_0x1fc3('0x5')]][_0x1fc3('0x62')];}}}catch(_0x4d8f10){utils[_0x1fc3('0x19')](util[_0x1fc3('0x13')](_0x1fc3('0x66'),_0x1eb475['uniqueid']),_0x4d8f10);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index fa3c4c3..b755b3b 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 _0x0f4d=['channel','error','newstate','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','calleridname','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','info','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f4d,0xde));var _0xd0f4=function(_0x2b77c0,_0x1219f8){_0x2b77c0=_0x2b77c0-0x0;var _0x2e0bf3=_0x0f4d[_0x2b77c0];return _0x2e0bf3;};'use strict';var _=require('lodash');var util=require(_0xd0f4('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x278c60){utils[_0xd0f4('0x1')](util['format'](_0xd0f4('0x2'),_0x278c60['uniqueid']));if(_0x278c60[_0xd0f4('0x3')]){utils[_0xd0f4('0x4')](_0x278c60[_0xd0f4('0x3')])[_0xd0f4('0x5')](function(_0x1ebdbb){if(_0x1ebdbb){_0x278c60[_0xd0f4('0x6')]=_0x1ebdbb[_0xd0f4('0x7')];_0x278c60[_0xd0f4('0x8')]=_0x1ebdbb['id'];}utils[_0xd0f4('0x9')](_0xd0f4('0xa'),_0x278c60);});}else{utils['request'](_0xd0f4('0xa'),_0x278c60);}}exports[_0xd0f4('0xb')]=function(_0x4521b0){try{utils['debug'](util[_0xd0f4('0xc')](_0xd0f4('0xd'),_0x4521b0['uniqueid']),_0x4521b0);if(_0x4521b0[_0xd0f4('0xe')]==_0x4521b0[_0xd0f4('0xf')]){utils[_0xd0f4('0x1')](util[_0xd0f4('0xc')](_0xd0f4('0x10'),_0x4521b0['uniqueid'],_0x4521b0['context'],_0x4521b0[_0xd0f4('0x11')]));recordings[_0x4521b0[_0xd0f4('0xe')]]={'uniqueid':_0x4521b0['uniqueid'],'accountcode':_0x4521b0['accountcode'],'exten':_0x4521b0[_0xd0f4('0x11')],'context':_0x4521b0['context'],'channel':_0x4521b0[_0xd0f4('0x12')],'monitors':[]};}}catch(_0x3d627b){utils[_0xd0f4('0x13')](util[_0xd0f4('0xc')](_0xd0f4('0xd'),_0x4521b0[_0xd0f4('0xe')]),_0x3d627b);}};exports[_0xd0f4('0x14')]=function(_0x4c8ee0){try{utils[_0xd0f4('0x15')](util['format'](_0xd0f4('0x16'),_0x4c8ee0[_0xd0f4('0xe')]),_0x4c8ee0);if(!_['isNil'](recordings[_0x4c8ee0[_0xd0f4('0xe')]])&&_0x4c8ee0[_0xd0f4('0x17')]==0x6){utils[_0xd0f4('0x1')](util['format'](_0xd0f4('0x18'),_0x4c8ee0['uniqueid'],_0x4c8ee0[_0xd0f4('0x19')],_0x4c8ee0['channel']));}else if(!_['isNil'](recordings[_0x4c8ee0['linkedid']])&&_0x4c8ee0[_0xd0f4('0x17')]==0x6&&_0x4c8ee0[_0xd0f4('0x19')]!=_0xd0f4('0x1a')){utils[_0xd0f4('0x1')](util[_0xd0f4('0xc')](_0xd0f4('0x1b'),_0x4c8ee0[_0xd0f4('0xe')],_0x4c8ee0[_0xd0f4('0xf')],_0x4c8ee0[_0xd0f4('0x19')],_0x4c8ee0[_0xd0f4('0x12')]));recordings[_0x4c8ee0[_0xd0f4('0xf')]][_0xd0f4('0x3')]=_0x4c8ee0['accountcode'];}}catch(_0x2b5d30){utils['error'](util['format'](_0xd0f4('0x16'),_0x4c8ee0[_0xd0f4('0xe')]),_0x2b5d30);}};exports[_0xd0f4('0x1c')]=function(_0x78e692){try{if(!_[_0xd0f4('0x1d')](_0x78e692[_0xd0f4('0x1e')])&&!_[_0xd0f4('0x1d')](_0x78e692[_0xd0f4('0x1e')][_0xd0f4('0x1f')])){utils['debug'](util[_0xd0f4('0xc')](_0xd0f4('0x20'),_0x78e692['uniqueid']),_0x78e692);utils[_0xd0f4('0x1')](util[_0xd0f4('0xc')](_0xd0f4('0x21'),_0x78e692[_0xd0f4('0xe')],_0x78e692[_0xd0f4('0x1e')],_0x78e692[_0xd0f4('0x22')]));if(_['endsWith'](_0x78e692['value'],_0xd0f4('0x23'))){_0x78e692['value']=_0x78e692[_0xd0f4('0x22')][_0xd0f4('0x24')](_0xd0f4('0x23'),_0xd0f4('0x25'));}if(recordings[_0x78e692[_0xd0f4('0xf')]]){var _0x2bc944=_[_0xd0f4('0x26')](recordings[_0x78e692['linkedid']][_0xd0f4('0x27')],{'value':_0x78e692[_0xd0f4('0x22')]});if(_[_0xd0f4('0x1d')](_0x2bc944)){recordings[_0x78e692[_0xd0f4('0xf')]]['monitors'][_0xd0f4('0x28')]({'value':_0x78e692[_0xd0f4('0x22')]});}}}}catch(_0x5c35be){utils[_0xd0f4('0x13')](util['format']('[%s][recordings][varset]',_0x78e692['uniqueid']),_0x5c35be);}};exports['hangup']=function(_0x11fb52){try{if(!_['isNil'](recordings[_0x11fb52[_0xd0f4('0xe')]])){utils[_0xd0f4('0x15')](util['format']('[%s][recordings][hangup]',_0x11fb52[_0xd0f4('0xe')]),_0x11fb52);utils[_0xd0f4('0x1')](util[_0xd0f4('0xc')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x11fb52[_0xd0f4('0xe')],_0x11fb52['calleridnum'],_0x11fb52[_0xd0f4('0x29')],_0x11fb52['cause-txt']));recordings[_0x11fb52[_0xd0f4('0xe')]][_0xd0f4('0x2a')]=_0x11fb52[_0xd0f4('0x2a')];recordings[_0x11fb52[_0xd0f4('0xe')]][_0xd0f4('0x29')]=_0x11fb52[_0xd0f4('0x29')];recordings[_0x11fb52['uniqueid']][_0xd0f4('0x2b')]=_0x11fb52[_0xd0f4('0x2b')];recordings[_0x11fb52['uniqueid']][_0xd0f4('0x2c')]=_0x11fb52['connectedlinename'];if(recordings[_0x11fb52[_0xd0f4('0xe')]]['type']==_0xd0f4('0x2d')&&recordings[_0x11fb52[_0xd0f4('0xe')]][_0xd0f4('0x3')]){recordings[_0x11fb52[_0xd0f4('0xe')]]['connectedlinenum']=recordings[_0x11fb52[_0xd0f4('0xe')]][_0xd0f4('0x3')];recordings[_0x11fb52[_0xd0f4('0xe')]]['connectedlinename']='';}recordings[_0x11fb52['uniqueid']][_0xd0f4('0x27')][_0xd0f4('0x2e')](function(_0x55643e){var _0x288c32=_[_0xd0f4('0x2f')](recordings[_0x11fb52[_0xd0f4('0xe')]]);_0x288c32[_0xd0f4('0x22')]=_0x55643e['value'];writeDB(_0x288c32);});delete recordings[_0x11fb52['uniqueid']];}}catch(_0x4f1493){utils[_0xd0f4('0x13')](util[_0xd0f4('0xc')]('[%s][recordings][hangup]',_0x11fb52[_0xd0f4('0xe')]),_0x4f1493);}};exports[_0xd0f4('0x30')]=function(_0x1739a0){try{if(!_['isNil'](recordings[_0x1739a0['uniqueid']])){utils[_0xd0f4('0x15')](util[_0xd0f4('0xc')](_0xd0f4('0x31'),_0x1739a0['uniqueid']),_0x1739a0);utils['info'](util[_0xd0f4('0xc')](_0xd0f4('0x32'),_0x1739a0['uniqueid'],_0x1739a0['application'],_0x1739a0[_0xd0f4('0x33')]));if(_0x1739a0[_0xd0f4('0x34')][_0xd0f4('0x35')]()=='set'&&_['startsWith'](_0x1739a0['appdata'][_0xd0f4('0x35')](),'cdr')){var _0x33f41f=_0x1739a0[_0xd0f4('0x33')][_0xd0f4('0x36')]('=');var _0x458e2f=_0x33f41f[0x0][_0xd0f4('0x37')](_0x33f41f[0x0][_0xd0f4('0x38')]('(')+0x1,_0x33f41f[0x0]['lastIndexOf'](')'));var _0x4d12e0=_0x33f41f[0x1];recordings[_0x1739a0[_0xd0f4('0xe')]][_0x458e2f]=_0x4d12e0;}}}catch(_0x4e4e5b){utils[_0xd0f4('0x13')](util['format'](_0xd0f4('0x31'),_0x1739a0[_0xd0f4('0xe')]),_0x4e4e5b);}};exports[_0xd0f4('0x39')]=function(_0x12ced8){try{if(!_[_0xd0f4('0x1d')](recordings[_0x12ced8['uniqueid']])){utils['debug'](util['format'](_0xd0f4('0x3a'),_0x12ced8[_0xd0f4('0xe')]),_0x12ced8);utils[_0xd0f4('0x1')](util[_0xd0f4('0xc')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x12ced8[_0xd0f4('0xe')],_0x12ced8[_0xd0f4('0x3b')]));recordings[_0x12ced8[_0xd0f4('0xe')]][_0xd0f4('0x3b')]=_0x12ced8[_0xd0f4('0x3b')];}}catch(_0x49ce1d){utils[_0xd0f4('0x13')](util[_0xd0f4('0xc')]('[%s][recordings][queuecallerjoin]',_0x12ced8[_0xd0f4('0xe')]),_0x49ce1d);}}; \ No newline at end of file +var _0x7735=['linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','./utils','info','format','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]'];(function(_0x5ae04d,_0x5e4289){var _0x206c82=function(_0x50ec74){while(--_0x50ec74){_0x5ae04d['push'](_0x5ae04d['shift']());}};_0x206c82(++_0x5e4289);}(_0x7735,0xa6));var _0x5773=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7735[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5773('0x0'));var recordings={};function writeDB(_0x578a60){utils[_0x5773('0x1')](util[_0x5773('0x2')]('[%s][recordings][writeDB]',_0x578a60[_0x5773('0x3')]));if(_0x578a60[_0x5773('0x4')]){utils['getUserByInternal'](_0x578a60[_0x5773('0x4')])[_0x5773('0x5')](function(_0x3ee35d){if(_0x3ee35d){_0x578a60[_0x5773('0x6')]=_0x3ee35d[_0x5773('0x7')];_0x578a60[_0x5773('0x8')]=_0x3ee35d['id'];}utils[_0x5773('0x9')]('CreateVoiceRecording',_0x578a60);});}else{utils[_0x5773('0x9')](_0x5773('0xa'),_0x578a60);}}exports[_0x5773('0xb')]=function(_0x1ed8a4){try{utils[_0x5773('0xc')](util['format'](_0x5773('0xd'),_0x1ed8a4[_0x5773('0x3')]),_0x1ed8a4);if(_0x1ed8a4['uniqueid']==_0x1ed8a4[_0x5773('0xe')]){utils[_0x5773('0x1')](util[_0x5773('0x2')](_0x5773('0xf'),_0x1ed8a4[_0x5773('0x3')],_0x1ed8a4[_0x5773('0x10')],_0x1ed8a4['exten']));recordings[_0x1ed8a4[_0x5773('0x3')]]={'uniqueid':_0x1ed8a4[_0x5773('0x3')],'accountcode':_0x1ed8a4[_0x5773('0x4')],'exten':_0x1ed8a4[_0x5773('0x11')],'context':_0x1ed8a4[_0x5773('0x10')],'channel':_0x1ed8a4[_0x5773('0x12')],'monitors':[]};}}catch(_0x4f1274){utils[_0x5773('0x13')](util[_0x5773('0x2')]('[%s][recordings][newchannel]',_0x1ed8a4['uniqueid']),_0x4f1274);}};exports[_0x5773('0x14')]=function(_0xe8aec9){try{utils[_0x5773('0xc')](util[_0x5773('0x2')]('[%s][recordings][newstate]',_0xe8aec9[_0x5773('0x3')]),_0xe8aec9);if(!_[_0x5773('0x15')](recordings[_0xe8aec9[_0x5773('0x3')]])&&_0xe8aec9[_0x5773('0x16')]==0x6){utils[_0x5773('0x1')](util['format'](_0x5773('0x17'),_0xe8aec9[_0x5773('0x3')],_0xe8aec9[_0x5773('0x10')],_0xe8aec9[_0x5773('0x12')]));}else if(!_[_0x5773('0x15')](recordings[_0xe8aec9[_0x5773('0xe')]])&&_0xe8aec9['channelstate']==0x6&&_0xe8aec9[_0x5773('0x10')]!=_0x5773('0x18')){utils[_0x5773('0x1')](util[_0x5773('0x2')](_0x5773('0x19'),_0xe8aec9[_0x5773('0x3')],_0xe8aec9[_0x5773('0xe')],_0xe8aec9['context'],_0xe8aec9[_0x5773('0x12')]));recordings[_0xe8aec9[_0x5773('0xe')]][_0x5773('0x4')]=_0xe8aec9[_0x5773('0x4')];}}catch(_0x677340){utils['error'](util[_0x5773('0x2')](_0x5773('0x1a'),_0xe8aec9['uniqueid']),_0x677340);}};exports['varset']=function(_0x5ce860){try{if(!_['isNil'](_0x5ce860[_0x5773('0x1b')])&&!_['isNil'](_0x5ce860[_0x5773('0x1b')][_0x5773('0x1c')])){utils['debug'](util[_0x5773('0x2')]('[%s][recordings][varset]',_0x5ce860[_0x5773('0x3')]),_0x5ce860);utils[_0x5773('0x1')](util['format'](_0x5773('0x1d'),_0x5ce860['uniqueid'],_0x5ce860[_0x5773('0x1b')],_0x5ce860[_0x5773('0x1e')]));if(_[_0x5773('0x1f')](_0x5ce860[_0x5773('0x1e')],'.wav49')){_0x5ce860[_0x5773('0x1e')]=_0x5ce860[_0x5773('0x1e')]['replace'](_0x5773('0x20'),_0x5773('0x21'));}if(recordings[_0x5ce860[_0x5773('0xe')]]){var _0x1d0519=_[_0x5773('0x22')](recordings[_0x5ce860[_0x5773('0xe')]][_0x5773('0x23')],{'value':_0x5ce860[_0x5773('0x1e')]});if(_[_0x5773('0x15')](_0x1d0519)){recordings[_0x5ce860['linkedid']][_0x5773('0x23')][_0x5773('0x24')]({'value':_0x5ce860['value']});}}}}catch(_0x555aae){utils[_0x5773('0x13')](util['format']('[%s][recordings][varset]',_0x5ce860[_0x5773('0x3')]),_0x555aae);}};exports[_0x5773('0x25')]=function(_0x1e13b7){try{if(!_[_0x5773('0x15')](recordings[_0x1e13b7[_0x5773('0x3')]])){utils[_0x5773('0xc')](util[_0x5773('0x2')](_0x5773('0x26'),_0x1e13b7[_0x5773('0x3')]),_0x1e13b7);utils[_0x5773('0x1')](util[_0x5773('0x2')](_0x5773('0x27'),_0x1e13b7[_0x5773('0x3')],_0x1e13b7['calleridnum'],_0x1e13b7['calleridname'],_0x1e13b7[_0x5773('0x28')]));recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x29')]=_0x1e13b7['calleridnum'];recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x2a')]=_0x1e13b7['calleridname'];recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x2b')]=_0x1e13b7['connectedlinenum'];recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x2c')]=_0x1e13b7[_0x5773('0x2c')];if(recordings[_0x1e13b7['uniqueid']]['type']==_0x5773('0x2d')&&recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x4')]){recordings[_0x1e13b7['uniqueid']][_0x5773('0x2b')]=recordings[_0x1e13b7['uniqueid']]['accountcode'];recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x2c')]='';}recordings[_0x1e13b7[_0x5773('0x3')]][_0x5773('0x23')]['forEach'](function(_0x114b47){var _0x6d10b8=_[_0x5773('0x2e')](recordings[_0x1e13b7[_0x5773('0x3')]]);_0x6d10b8[_0x5773('0x1e')]=_0x114b47[_0x5773('0x1e')];writeDB(_0x6d10b8);});delete recordings[_0x1e13b7['uniqueid']];}}catch(_0x256ff7){utils[_0x5773('0x13')](util[_0x5773('0x2')](_0x5773('0x26'),_0x1e13b7[_0x5773('0x3')]),_0x256ff7);}};exports[_0x5773('0x2f')]=function(_0x43c6b2){try{if(!_[_0x5773('0x15')](recordings[_0x43c6b2[_0x5773('0x3')]])){utils[_0x5773('0xc')](util[_0x5773('0x2')](_0x5773('0x30'),_0x43c6b2[_0x5773('0x3')]),_0x43c6b2);utils['info'](util['format'](_0x5773('0x31'),_0x43c6b2[_0x5773('0x3')],_0x43c6b2[_0x5773('0x32')],_0x43c6b2['appdata']));if(_0x43c6b2[_0x5773('0x32')][_0x5773('0x33')]()==_0x5773('0x34')&&_['startsWith'](_0x43c6b2[_0x5773('0x35')][_0x5773('0x33')](),_0x5773('0x36'))){var _0x390f42=_0x43c6b2[_0x5773('0x35')][_0x5773('0x37')]('=');var _0x121b46=_0x390f42[0x0]['substring'](_0x390f42[0x0]['lastIndexOf']('(')+0x1,_0x390f42[0x0][_0x5773('0x38')](')'));var _0x267a63=_0x390f42[0x1];recordings[_0x43c6b2['uniqueid']][_0x121b46]=_0x267a63;}}}catch(_0x28950c){utils[_0x5773('0x13')](util[_0x5773('0x2')](_0x5773('0x30'),_0x43c6b2[_0x5773('0x3')]),_0x28950c);}};exports['queuecallerjoin']=function(_0x2d0fbc){try{if(!_[_0x5773('0x15')](recordings[_0x2d0fbc[_0x5773('0x3')]])){utils[_0x5773('0xc')](util[_0x5773('0x2')](_0x5773('0x39'),_0x2d0fbc[_0x5773('0x3')]),_0x2d0fbc);utils[_0x5773('0x1')](util[_0x5773('0x2')](_0x5773('0x3a'),_0x2d0fbc[_0x5773('0x3')],_0x2d0fbc['queue']));recordings[_0x2d0fbc[_0x5773('0x3')]][_0x5773('0x3b')]=_0x2d0fbc[_0x5773('0x3b')];}}catch(_0x2d756b){utils[_0x5773('0x13')](util[_0x5773('0x2')]('[%s][recordings][queuecallerjoin]',_0x2d0fbc[_0x5773('0x3')]),_0x2d756b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 6c4295b..36c4df5 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 _0x493b=['[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridname','transfereecalleridnum','transfereruniqueid','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format'];(function(_0x2bf3ef,_0x4f7929){var _0x5f274f=function(_0x2b00f0){while(--_0x2b00f0){_0x2bf3ef['push'](_0x2bf3ef['shift']());}};_0x5f274f(++_0x4f7929);}(_0x493b,0x113));var _0xb493=function(_0xacda67,_0x10877d){_0xacda67=_0xacda67-0x0;var _0x967dd9=_0x493b[_0xacda67];return _0x967dd9;};'use strict';var _=require(_0xb493('0x0'));var util=require(_0xb493('0x1'));var utils=require(_0xb493('0x2'));function writeDB(_0x2afb2a){utils[_0xb493('0x3')](util[_0xb493('0x4')](_0xb493('0x5'),_0x2afb2a[_0xb493('0x6')]===_0xb493('0x7')?_0x2afb2a[_0xb493('0x8')]:_0x2afb2a['uniqueid'],_0x2afb2a['type']));utils[_0xb493('0x9')](_0xb493('0xa'),_0x2afb2a);}exports['blinds']={};exports[_0xb493('0xb')]=function(_0x841f6a){try{utils[_0xb493('0xc')](util['format'](_0xb493('0xd'),_0x841f6a[_0xb493('0xe')]),_0x841f6a);utils['info'](util[_0xb493('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x841f6a[_0xb493('0xe')],_0x841f6a['transferercalleridnum'],_0x841f6a[_0xb493('0xf')],_0x841f6a[_0xb493('0x10')],_0x841f6a['transfereecalleridname']));_0x841f6a[_0xb493('0x6')]='blind';exports['blinds'][_0x841f6a[_0xb493('0x11')]]=_0x841f6a;writeDB(_0x841f6a);}catch(_0xe5ceab){utils[_0xb493('0x12')](util[_0xb493('0x4')](_0xb493('0xd'),_0x841f6a[_0xb493('0xe')]),_0xe5ceab);}};exports['attendedtransfer']=function(_0x4e2f07){try{utils['debug'](util[_0xb493('0x4')](_0xb493('0x13'),_0x4e2f07[_0xb493('0x8')]),_0x4e2f07);utils['info'](util[_0xb493('0x4')](_0xb493('0x14'),_0x4e2f07[_0xb493('0x8')],_0x4e2f07['origtransferercalleridnum'],_0x4e2f07[_0xb493('0x15')],_0x4e2f07[_0xb493('0x16')],_0x4e2f07[_0xb493('0x17')]));_0x4e2f07=_[_0xb493('0x18')](_0x4e2f07,{'transfererchannel':_0x4e2f07[_0xb493('0x19')],'transferercalleridnum':_0x4e2f07[_0xb493('0x1a')],'transferercalleridname':_0x4e2f07[_0xb493('0x15')],'transfererconnectedlinenum':_0x4e2f07[_0xb493('0x1b')],'transfererconnectedlinename':_0x4e2f07[_0xb493('0x1c')],'transfereraccountcode':_0x4e2f07['origtransfereraccountcode'],'transferercontext':_0x4e2f07['secondtransferercontext'],'transfererexten':_0x4e2f07['secondtransfererexten'],'transfererlinkedid':_0x4e2f07['origtransfererlinkedid'],'context':_0x4e2f07[_0xb493('0x1d')],'extension':_0x4e2f07[_0xb493('0x1e')],'type':'attended'});if(_[_0xb493('0x1f')](_0x4e2f07[_0xb493('0x20')])){_0x4e2f07=_[_0xb493('0x18')](_0x4e2f07,{'transfereechannel':_0x4e2f07[_0xb493('0x21')],'transfereecalleridnum':_0x4e2f07[_0xb493('0x16')],'transfereecalleridname':_0x4e2f07['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4e2f07[_0xb493('0x22')],'transfereeconnectedlinename':_0x4e2f07[_0xb493('0x23')],'transfereeaccountcode':_0x4e2f07[_0xb493('0x24')],'transfereecontext':_0x4e2f07[_0xb493('0x25')],'transfereeexten':_0x4e2f07[_0xb493('0x26')],'transfereelinkedid':_0x4e2f07[_0xb493('0x27')]});}writeDB(_0x4e2f07);}catch(_0x60436d){utils[_0xb493('0x12')](util[_0xb493('0x4')](_0xb493('0x13'),_0x4e2f07['origtransfereruniqueid']),_0x60436d);}}; \ No newline at end of file +var _0x0a38=['transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','[%s][transfers][attendedtransfer]','lodash','util','./utils','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','format','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','attended','isNil','transfereechannel'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x0a38,0xf6));var _0x80a3=function(_0x5895a1,_0x3f656d){_0x5895a1=_0x5895a1-0x0;var _0x122e64=_0x0a38[_0x5895a1];return _0x122e64;};'use strict';var _=require(_0x80a3('0x0'));var util=require(_0x80a3('0x1'));var utils=require(_0x80a3('0x2'));function writeDB(_0x280d03){utils['info'](util['format'](_0x80a3('0x3'),_0x280d03['type']==='attended'?_0x280d03[_0x80a3('0x4')]:_0x280d03[_0x80a3('0x5')],_0x280d03[_0x80a3('0x6')]));utils['request'](_0x80a3('0x7'),_0x280d03);}exports[_0x80a3('0x8')]={};exports[_0x80a3('0x9')]=function(_0x19685b){try{utils[_0x80a3('0xa')](util['format'](_0x80a3('0xb'),_0x19685b[_0x80a3('0x5')]),_0x19685b);utils[_0x80a3('0xc')](util[_0x80a3('0xd')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x19685b[_0x80a3('0x5')],_0x19685b[_0x80a3('0xe')],_0x19685b['transferercalleridname'],_0x19685b[_0x80a3('0xf')],_0x19685b[_0x80a3('0x10')]));_0x19685b[_0x80a3('0x6')]=_0x80a3('0x11');exports[_0x80a3('0x8')][_0x19685b[_0x80a3('0x12')]]=_0x19685b;writeDB(_0x19685b);}catch(_0x12a8b){utils[_0x80a3('0x13')](util[_0x80a3('0xd')](_0x80a3('0xb'),_0x19685b[_0x80a3('0x5')]),_0x12a8b);}};exports[_0x80a3('0x14')]=function(_0x55f22c){try{utils['debug'](util[_0x80a3('0xd')]('[%s][transfers][attendedtransfer]',_0x55f22c[_0x80a3('0x4')]),_0x55f22c);utils[_0x80a3('0xc')](util[_0x80a3('0xd')](_0x80a3('0x15'),_0x55f22c[_0x80a3('0x4')],_0x55f22c['origtransferercalleridnum'],_0x55f22c['origtransferercalleridname'],_0x55f22c['transfertargetcalleridnum'],_0x55f22c[_0x80a3('0x16')]));_0x55f22c=_[_0x80a3('0x17')](_0x55f22c,{'transfererchannel':_0x55f22c[_0x80a3('0x18')],'transferercalleridnum':_0x55f22c[_0x80a3('0x19')],'transferercalleridname':_0x55f22c['origtransferercalleridname'],'transfererconnectedlinenum':_0x55f22c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x55f22c[_0x80a3('0x1a')],'transfereraccountcode':_0x55f22c[_0x80a3('0x1b')],'transferercontext':_0x55f22c[_0x80a3('0x1c')],'transfererexten':_0x55f22c[_0x80a3('0x1d')],'transfererlinkedid':_0x55f22c['origtransfererlinkedid'],'context':_0x55f22c['origtransferercontext'],'extension':_0x55f22c[_0x80a3('0x1e')],'type':_0x80a3('0x1f')});if(_[_0x80a3('0x20')](_0x55f22c[_0x80a3('0x21')])){_0x55f22c=_[_0x80a3('0x17')](_0x55f22c,{'transfereechannel':_0x55f22c[_0x80a3('0x22')],'transfereecalleridnum':_0x55f22c[_0x80a3('0x23')],'transfereecalleridname':_0x55f22c[_0x80a3('0x16')],'transfereeconnectedlinenum':_0x55f22c[_0x80a3('0x24')],'transfereeconnectedlinename':_0x55f22c[_0x80a3('0x25')],'transfereeaccountcode':_0x55f22c['transfertargetaccountcode'],'transfereecontext':_0x55f22c['transfertargetcontext'],'transfereeexten':_0x55f22c[_0x80a3('0x26')],'transfereelinkedid':_0x55f22c['transfertargetlinkedid']});}writeDB(_0x55f22c);}catch(_0x3294da){utils['error'](util['format'](_0x80a3('0x27'),_0x55f22c['origtransfereruniqueid']),_0x3294da);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 99a99d5..5d243ad 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 _0xd2d9=['now','format','isAfter','isBefore','bluebird','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','stringify','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','notfound','result','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime'];(function(_0x473a8a,_0x22858b){var _0x192b62=function(_0x23408b){while(--_0x23408b){_0x473a8a['push'](_0x473a8a['shift']());}};_0x192b62(++_0x22858b);}(_0xd2d9,0x16c));var _0x9d2d=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0xd2d9[_0x1529a3];return _0x1a0d4b;};'use strict';var BPromise=require(_0x9d2d('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x9d2d('0x1'));var client=jayson['client'][_0x9d2d('0x2')]({'port':0x2329});var logger=require(_0x9d2d('0x3'))(_0x9d2d('0x4'));exports[_0x9d2d('0x5')]=function(_0x4b4189,_0x9430a8){logger[_0x9d2d('0x5')](_0x4b4189,_0x9430a8?util[_0x9d2d('0x6')](_0x9430a8,{'showHidden':![],'depth':null}):'');};exports[_0x9d2d('0x7')]=function(_0x19ad18,_0x2a1bc2){logger[_0x9d2d('0x7')](_0x19ad18,_0x2a1bc2?util['inspect'](_0x2a1bc2,{'showHidden':![],'depth':null}):'');};exports[_0x9d2d('0x8')]=function(_0x3f9474,_0x1a723d){logger['error'](_0x3f9474,_0x1a723d?util[_0x9d2d('0x6')](_0x1a723d,{'showHidden':![],'depth':null}):'');};exports[_0x9d2d('0x9')]=function(_0x448e3e,_0x124eaf){return client['request'](_0x448e3e,{'body':_0x124eaf})[_0x9d2d('0xa')](function(_0x3de70c){logger['debug'](_0x9d2d('0xb'),_0x448e3e,_0x3de70c?util[_0x9d2d('0x6')](_0x3de70c,{'showHidden':![],'depth':null}):'');})[_0x9d2d('0xc')](function(_0x946cc4){logger['error'](_0x9d2d('0xb'),_0x448e3e,_0x946cc4?util[_0x9d2d('0x6')](_0x946cc4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x239e83){return client[_0x9d2d('0x9')](_0x9d2d('0xd'),{'options':{'raw':!![],'attributes':['id',_0x9d2d('0xe'),_0x9d2d('0xf'),'interface'],'where':_0x239e83,'limit':0x1}})['then'](function(_0x5dfea3){logger[_0x9d2d('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x9d2d('0x10')](_0x239e83),_0x5dfea3?util[_0x9d2d('0x6')](_0x5dfea3,{'showHidden':![],'depth':null}):'');return _0x5dfea3['result'][_0x9d2d('0x11')]?_0x5dfea3['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x1768a9){return new BPromise(function(_0x3686d9,_0x5ab68a){if(_0x1768a9){return getUser({'internal':_0x1768a9})[_0x9d2d('0xa')](function(_0x53ea08){logger['info'](_0x9d2d('0x12'),_0x1768a9,_0x53ea08?_0x9d2d('0x13'):'notfound');return _0x3686d9(_0x53ea08);})[_0x9d2d('0xc')](function(_0x4708b8){logger[_0x9d2d('0x8')]('[utils][getUserByInternal]',_0x4708b8?util['inspect'](_0x4708b8,{'showHidden':![],'depth':null}):'');return _0x3686d9(null);});}return _0x3686d9(null);});};exports[_0x9d2d('0x14')]=function(_0x5ea924){return new BPromise(function(_0x7a7afc,_0x2ec8c2){if(_0x5ea924){return getUser({'interface':_0x5ea924})[_0x9d2d('0xa')](function(_0xeaf613){logger[_0x9d2d('0x5')](_0x9d2d('0x15'),_0x5ea924,_0xeaf613?_0x9d2d('0x13'):'notfound');return _0x7a7afc(_0xeaf613);})[_0x9d2d('0xc')](function(_0x745d72){logger[_0x9d2d('0x8')](_0x9d2d('0x16'),_0x745d72?util[_0x9d2d('0x6')](_0x745d72,{'showHidden':![],'depth':null}):'');return _0x7a7afc(null);});}return _0x7a7afc(null);});};exports[_0x9d2d('0x17')]=function(_0xca2c20){return new BPromise(function(_0x5610f1,_0x4854b9){if(_0xca2c20){return getUser({'name':_0xca2c20})['then'](function(_0x3215a1){logger[_0x9d2d('0x5')](_0x9d2d('0x18'),_0xca2c20,_0x3215a1?_0x9d2d('0x13'):'notfound');return _0x5610f1(_0x3215a1);})['catch'](function(_0x226cd6){logger['error']('[utils][getUserByName]',_0x226cd6?util[_0x9d2d('0x6')](_0x226cd6,{'showHidden':![],'depth':null}):'');return _0x5610f1(null);});}return _0x5610f1(null);});};exports[_0x9d2d('0x19')]=function(_0x86970d){return new BPromise(function(_0x423113,_0x35d31f){if(_0x86970d){return client[_0x9d2d('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x9d2d('0xf'),_0x9d2d('0x1a'),'acw',_0x9d2d('0x1b')],'where':{'name':_0x86970d},'limit':0x1}})['then'](function(_0x3b7d49){logger[_0x9d2d('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x86970d,_0x3b7d49?util[_0x9d2d('0x6')](_0x3b7d49,{'showHidden':![],'depth':null}):'');logger[_0x9d2d('0x5')](_0x9d2d('0x1c'),_0x86970d,_0x3b7d49?_0x9d2d('0x13'):_0x9d2d('0x1d'));return _0x423113(_0x3b7d49[_0x9d2d('0x1e')]['length']?_0x3b7d49[_0x9d2d('0x1e')][0x0]:null);})[_0x9d2d('0xc')](function(_0x5de56d){logger[_0x9d2d('0x8')](_0x9d2d('0x1f'),_0x5de56d?util['inspect'](_0x5de56d,{'showHidden':![],'depth':null}):'');return _0x423113(null);});}return _0x423113(null);});};exports[_0x9d2d('0x20')]=function(_0x22fbdb,_0x2acb02){return moment(_0x22fbdb)[_0x9d2d('0x21')](_0x2acb02,_0x9d2d('0x22'))['format'](_0x9d2d('0x23'));};exports[_0x9d2d('0x24')]=function(_0x47b97c,_0x317e19){return moment(_0x47b97c)[_0x9d2d('0x25')](_0x317e19,_0x9d2d('0x22'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9d2d('0x26')]=function(_0x464088,_0x2ec778){return moment(_0x464088)[_0x9d2d('0x27')](moment(_0x2ec778),_0x9d2d('0x22'));};exports[_0x9d2d('0x28')]=function(_0x45041e,_0x2d116b){return parseInt(_0x45041e,0xa)+parseInt(_0x2d116b,0xa);};exports[_0x9d2d('0x29')]=function(){return moment()[_0x9d2d('0x2a')](_0x9d2d('0x23'));};exports[_0x9d2d('0x2b')]=function(_0x38d928,_0x5a034c){if(_0x5a034c){return moment(_0x38d928)['isAfter'](_0x5a034c);}return!![];};exports[_0x9d2d('0x2c')]=function(_0x260dda,_0x38740b){if(_0x38740b){return moment(_0x260dda)[_0x9d2d('0x2c')](_0x38740b);}else if(_0x260dda){return!![];}return![];}; \ No newline at end of file +var _0xc61d=['[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','notfound','[utils][getUserByName]','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','found','[utils][getUserByInternal]'];(function(_0x55c0b2,_0x3fd4a4){var _0x368755=function(_0x331f86){while(--_0x331f86){_0x55c0b2['push'](_0x55c0b2['shift']());}};_0x368755(++_0x3fd4a4);}(_0xc61d,0xfb));var _0xdc61=function(_0x5d3890,_0x13f17c){_0x5d3890=_0x5d3890-0x0;var _0x803fa=_0xc61d[_0x5d3890];return _0x803fa;};'use strict';var BPromise=require(_0xdc61('0x0'));var jayson=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var util=require(_0xdc61('0x3'));var client=jayson[_0xdc61('0x4')][_0xdc61('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xdc61('0x6'));exports[_0xdc61('0x7')]=function(_0x4ebd75,_0x2b94dd){logger[_0xdc61('0x7')](_0x4ebd75,_0x2b94dd?util[_0xdc61('0x8')](_0x2b94dd,{'showHidden':![],'depth':null}):'');};exports[_0xdc61('0x9')]=function(_0x3518fc,_0x84103c){logger[_0xdc61('0x9')](_0x3518fc,_0x84103c?util[_0xdc61('0x8')](_0x84103c,{'showHidden':![],'depth':null}):'');};exports[_0xdc61('0xa')]=function(_0x46e918,_0x5aacc0){logger[_0xdc61('0xa')](_0x46e918,_0x5aacc0?util[_0xdc61('0x8')](_0x5aacc0,{'showHidden':![],'depth':null}):'');};exports[_0xdc61('0xb')]=function(_0x333f0b,_0xf27275){return client['request'](_0x333f0b,{'body':_0xf27275})[_0xdc61('0xc')](function(_0x5c780f){logger[_0xdc61('0x9')]('[utils][request]\x20name:%s',_0x333f0b,_0x5c780f?util[_0xdc61('0x8')](_0x5c780f,{'showHidden':![],'depth':null}):'');})[_0xdc61('0xd')](function(_0x1bb2f2){logger[_0xdc61('0xa')](_0xdc61('0xe'),_0x333f0b,_0x1bb2f2?util['inspect'](_0x1bb2f2,{'showHidden':![],'depth':null}):'');});};function getUser(_0xbff332){return client[_0xdc61('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xdc61('0xf'),_0xdc61('0x10'),_0xdc61('0x11')],'where':_0xbff332,'limit':0x1}})[_0xdc61('0xc')](function(_0x4117f8){logger[_0xdc61('0x9')](_0xdc61('0x12'),JSON[_0xdc61('0x13')](_0xbff332),_0x4117f8?util[_0xdc61('0x8')](_0x4117f8,{'showHidden':![],'depth':null}):'');return _0x4117f8['result'][_0xdc61('0x14')]?_0x4117f8[_0xdc61('0x15')][0x0]:null;});}exports[_0xdc61('0x16')]=function(_0x2cd1a4){return new BPromise(function(_0x45b7b7,_0x393205){if(_0x2cd1a4){return getUser({'internal':_0x2cd1a4})[_0xdc61('0xc')](function(_0x5dbe97){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2cd1a4,_0x5dbe97?_0xdc61('0x17'):'notfound');return _0x45b7b7(_0x5dbe97);})[_0xdc61('0xd')](function(_0x387f9a){logger[_0xdc61('0xa')](_0xdc61('0x18'),_0x387f9a?util[_0xdc61('0x8')](_0x387f9a,{'showHidden':![],'depth':null}):'');return _0x45b7b7(null);});}return _0x45b7b7(null);});};exports['getUserByInterface']=function(_0x2c687d){return new BPromise(function(_0x39faf4,_0x338952){if(_0x2c687d){return getUser({'interface':_0x2c687d})[_0xdc61('0xc')](function(_0x32514d){logger['info'](_0xdc61('0x19'),_0x2c687d,_0x32514d?'found':'notfound');return _0x39faf4(_0x32514d);})['catch'](function(_0x42a52a){logger[_0xdc61('0xa')]('[utils][getUserByInterface]',_0x42a52a?util[_0xdc61('0x8')](_0x42a52a,{'showHidden':![],'depth':null}):'');return _0x39faf4(null);});}return _0x39faf4(null);});};exports[_0xdc61('0x1a')]=function(_0x37cd23){return new BPromise(function(_0x40cf53,_0x290790){if(_0x37cd23){return getUser({'name':_0x37cd23})[_0xdc61('0xc')](function(_0xda80ca){logger[_0xdc61('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x37cd23,_0xda80ca?_0xdc61('0x17'):_0xdc61('0x1b'));return _0x40cf53(_0xda80ca);})[_0xdc61('0xd')](function(_0x8977d2){logger[_0xdc61('0xa')](_0xdc61('0x1c'),_0x8977d2?util[_0xdc61('0x8')](_0x8977d2,{'showHidden':![],'depth':null}):'');return _0x40cf53(null);});}return _0x40cf53(null);});};exports['getVoiceQueueByName']=function(_0xfc12ac){return new BPromise(function(_0x2b94eb,_0x2d200d){if(_0xfc12ac){return client[_0xdc61('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xdc61('0x10'),_0xdc61('0x1d'),_0xdc61('0x1e'),'acwTimeout'],'where':{'name':_0xfc12ac},'limit':0x1}})[_0xdc61('0xc')](function(_0x6305c1){logger['debug'](_0xdc61('0x1f'),_0xfc12ac,_0x6305c1?util[_0xdc61('0x8')](_0x6305c1,{'showHidden':![],'depth':null}):'');logger[_0xdc61('0x7')](_0xdc61('0x20'),_0xfc12ac,_0x6305c1?_0xdc61('0x17'):_0xdc61('0x1b'));return _0x2b94eb(_0x6305c1[_0xdc61('0x15')]['length']?_0x6305c1[_0xdc61('0x15')][0x0]:null);})['catch'](function(_0x3128b3){logger[_0xdc61('0xa')](_0xdc61('0x21'),_0x3128b3?util[_0xdc61('0x8')](_0x3128b3,{'showHidden':![],'depth':null}):'');return _0x2b94eb(null);});}return _0x2b94eb(null);});};exports[_0xdc61('0x22')]=function(_0x313a19,_0xa916fd){return moment(_0x313a19)['add'](_0xa916fd,_0xdc61('0x23'))[_0xdc61('0x24')](_0xdc61('0x25'));};exports[_0xdc61('0x26')]=function(_0x35fe57,_0x5ccbed){return moment(_0x35fe57)[_0xdc61('0x27')](_0x5ccbed,_0xdc61('0x23'))[_0xdc61('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdc61('0x28')]=function(_0x45add7,_0x393cda){return moment(_0x45add7)[_0xdc61('0x29')](moment(_0x393cda),_0xdc61('0x23'));};exports[_0xdc61('0x2a')]=function(_0x45d9aa,_0x57fe16){return parseInt(_0x45d9aa,0xa)+parseInt(_0x57fe16,0xa);};exports[_0xdc61('0x2b')]=function(){return moment()['format'](_0xdc61('0x25'));};exports[_0xdc61('0x2c')]=function(_0xff5813,_0x5b4e05){if(_0x5b4e05){return moment(_0xff5813)[_0xdc61('0x2c')](_0x5b4e05);}return!![];};exports[_0xdc61('0x2d')]=function(_0x42970a,_0x4fcd28){if(_0x4fcd28){return moment(_0x42970a)['isBefore'](_0x4fcd28);}else if(_0x42970a){return!![];}return![];}; \ No newline at end of file